unionlabs/union · error · Error

hash not found

Error message

hash not found

What it means

Thrown at the end of the key-signed path in transferAssetFromAptos: submitSimpleTransaction succeeded (the ResultAsync is Ok) but the returned pending transaction's hash does not start with "0x". Aptos transaction hashes are 0x-prefixed 64-hex strings, so a non-conforming value means the node returned a malformed or unexpected submission response.

Source

Thrown at typescript-sdk/src/aptos/transfer.ts:193

        }

        console.info(`aptosTransferSimulate simulation succeeded: ${simulationResult.value.hash}`)
      }

      const pendingTransaction = await submitSimpleTransaction({
        aptos: parameters.aptos,
        transaction: transaction.value,
        accountAuthenticator: parameters.aptos.transaction.sign({
          signer,
          transaction: transaction.value,
        }),
      })

      if (!pendingTransaction.isOk()) {
        throw pendingTransaction.error
      }
      if (!pendingTransaction.value.hash.startsWith("0x")) {
        throw new Error("hash not found")
      }

      return pendingTransaction.value.hash
    },
    error => new Error(`Transfer failed: ${error}`, { cause: error }),
  )

export const aptosSameChainTransfer: (args: AptosTransferBaseParams) => ResultAsync<string, Error> =
  ResultAsync.fromThrowable(
    async parameters => {
      if (!parameters.signer) {
        throw new Error("no `signer` passed")
      }

      if (parameters.authAccess === "wallet") {
        const signer = parameters.signer as AptosBrowserWallet
        const transaction = await signer.signAndSubmitTransaction({
          payload: {

View on GitHub (pinned to 031785bb6d)

Solutions

  1. Point transport at a canonical fullnode (https://fullnode.mainnet.aptoslabs.com/v1 or https://fullnode.testnet.aptoslabs.com/v1) and retry
  2. Log pendingTransaction.value to see what the node actually returned and adjust the endpoint accordingly
  3. Upgrade @union/client and @aptos-labs/ts-sdk so response parsing matches the node version
Defensive patterns

Strategy: retry

Type guard

const isAptosHash = (h: unknown): h is `0x${string}` =>
  typeof h === "string" && /^0x[0-9a-fA-F]{64}$/.test(h)

Try / catch

try {
  hash = await transferAssetFromAptos(params).toPromise()
} catch (error) {
  if ((error as Error).message.includes("hash not found")) {
    // switch transport to a canonical fullnode and retry the transfer
  }
  throw error
}

Prevention

When it happens

Trigger: A fullnode/RPC gateway that answers submission with a nonstandard body (proxy stripping fields, wrong endpoint, error payload in place of the hash). The ResultAsync chain is otherwise successful, so this is purely a response-shape guard.

Common situations: Custom or third-party Aptos RPC providers behind proxies; pointing the transport at an indexer or REST route that does not accept transaction submission; version mismatch between the SDK's expected PendingTransactionResponse and the node's response.

Related errors


AI-assisted analysis of unionlabs/union@031785bb6d (2026-08-16). Data as JSON: /api/errors/ddc6c1192252c63d. Report an issue: GitHub.