I'm getting this error when trying to submit a transaction using graphql:

  "errors": [
      "message": "Deserialization failed in Transaction.metadata because: Expected null, found other type",
      "locations": [
          "line": 2,
          "column": 3
      "path": [
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR",
        "exception": {
          "stacktrace": [
            "Error: Deserialization failed in Transaction.metadata because: Expected null, found other type",
            "    at Object.<anonymous> (/app/packages/api-cardano-db-hasura/dist/executableSchema.js:77:43)",
            "    at Generator.throw (<anonymous>)",
            "    at rejected (/app/packages/api-cardano-db-hasura/dist/executableSchema.js:6:65)",
            "    at processTicksAndRejections (internal/process/task_queues.js:95:5)"
  "data": null

What is this trying to say?

The transaction has been built using cardano-serialization-lib.

I'm 100% sure the transaction is correct because it's been accepted using other methods.

1 Answer 1


I don't suggest using cardano-graphql to submit a transaction: every time the node gets behind the tip of the blockchain, it fails.

ogmios is much more reliable for this regard.

You can submit a transaction using the following code:

const WebSocket = require('ws');
const client = new WebSocket("wss://ogmios-api.testnet.dandelion.link");

function wsp(methodname, args) {
        type: "jsonwsp/request",
        version: "1.0",
        servicename: "ogmios",

client.once('open', () => {
    const submit =

    wsp("SubmitTx", { submit });

client.on('message', function(msg) {
    const response = JSON.parse(msg);

Keep in mind that, in this example, the transaction is already in base64 format (submit variable). To convert from hex to base64, you need to use these helpers:

const arrayBufferToBase64=( buffer )=> {
  var binary = '';
  var bytes = new Uint8Array( buffer );
  var len = bytes.byteLength;
  for (var i = 0; i < len; i++) {
      binary += String.fromCharCode( bytes[ i ] );
  return Buffer.from(binary, "binary").toString("base64");

const fromHex=(hex)=>Buffer.from(hex,"hex");

const bytes = arrayBufferToBase64(fromHex(txHex));

Then you can pass bytes to wsp function.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.