{"record":{"id":"55567aa2abd6c80b","repo":"unionlabs/union","slug":"transaction-failed-transaction-vm-status","errorCode":null,"errorMessage":"Transaction failed: ${transaction?.vm_status} - ${JSON.stringify(transaction, undefined, 2)}","messagePattern":"Transaction failed: (.+?) - (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"typescript-sdk/src/aptos/transfer.ts","lineNumber":146,"sourceCode":"            function: payload.function,\n            type_arguments: payload.typeArguments,\n            arguments: [\n              parameters.sourceChannel,\n              isValidBech32Address(parameters.receiver)\n                ? bech32AddressToHex({ address: parameters.receiver })\n                : parameters.receiver,\n              [parameters.denomAddress],\n              [parameters.amount.toString()],\n              parameters.memo ?? \"\",\n              BigInt(9n).toString(),\n              BigInt(999_999_999).toString(),\n              BigInt(0n).toString(),\n            ],\n          },\n        })\n\n        if (!transaction?.success) {\n          throw new Error(\n            `Transaction failed: ${transaction?.vm_status} - ${\n              JSON.stringify(transaction, undefined, 2)\n            }`,\n          )\n        }\n        return transaction.hash\n      }\n\n      const signer = parameters.signer as AptosAccount\n\n      const transaction = await buildSimpleTransaction({\n        data: payload,\n        aptos: parameters.aptos,\n        accountAddress: signer.accountAddress,\n      })\n\n      if (!transaction.isOk()) {\n        throw transaction.error","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/unionlabs/union/blob/031785bb6dc6b957c624e62bc64c184409c97d7b/typescript-sdk/src/aptos/transfer.ts#L128-L164","documentation":"Thrown in transferAssetFromAptos on the wallet path after signAndSubmitTransaction: the returned transaction object either failed on-chain or lacks a truthy success field, and the error embeds vm_status plus a pretty-printed JSON dump of the whole transaction so nothing is lost. Note that a pending submission response often has no success field, in which case the JSON dump is the only diagnostic.","triggerScenarios":"A wallet-signed cross-chain (ibc::send) Aptos transaction whose result is not marked successful: Move abort inside the relay entrypoint, gas exhaustion, malformed arguments, or a wallet SDK response shape without success that the strict check treats as failure.","commonSituations":"Browser wallet (Petra/Pontem) submissions of IBC transfers; user's account out of gas; memo/timeout arguments built incorrectly; wallet adapter returning a pending-transaction object rather than the full transaction view.","solutions":["Read the vm_status and JSON dump in the message to determine whether it is a real on-chain failure or a response-shape issue","If it is a response-shape issue (no success field on a pending tx), poll waitForTransaction with the returned hash instead of relying on the submit response","Verify the ibc::send arguments (denom address, receiver, amount string, timeout heights) and account gas balance","Update the wallet adapter / SDK versions so signAndSubmitTransaction returns the documented shape"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  hash = await transferAssetFromAptos(params).toPromise()\n} catch (error) {\n  const msg = (error as Error).message\n  if (msg.startsWith(\"Transfer failed: Transaction failed:\")) {\n    const dumped = msg.slice(msg.indexOf(\"{\")) // JSON dump starts at the opening brace\n    // parse the dump: real VM abort vs response without success field\n  }\n  throw error\n}","preventionTips":["After any wallet submit, confirm final state with waitForTransaction(hash) rather than trusting the submit response alone","Log the full JSON dump when triaging — it contains gas usage, status, and events","Keep wallet adapter versions current so response shapes match SDK expectations"],"tags":["aptos","wallet","transaction","typescript-sdk"],"backgroundTag":null,"analyzedSha":"031785bb6dc6b957c624e62bc64c184409c97d7b","analyzedAt":"2026-08-16T06:24:09.996Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}