FuelLabs/fuels-ts · error · FuelError

INVALID_RECEIPT_TYPE

INVALID_RECEIPT_TYPE

Error message

Invalid receipt type: ${receiptType}.

What it means

Thrown by `deserializeReceipt()` (utils/serialization.ts) when the receipt's `receiptType` does not match any known receipt kind handled by the switch (call, return, returnData, panic, revert, log, logData, transfer, transferOut, scriptResult, messageOut, mint, burn, etc.). The default branch guards against an unknown receipt shape so downstream summary code never processes an undefined receipt.

Source

Thrown at packages/account/src/providers/utils/serialization.ts:465

      const contractId = hexOrZero(receipt.id || receipt.contractId);
      const subId = hexOrZero(receipt.subId);
      const assetId = getMintedAssetId(contractId, subId);

      const burnReceipt: ReceiptBurn = {
        type: ReceiptType.Burn,
        subId,
        contractId,
        assetId,
        val: bn(receipt.val),
        pc: bn(receipt.pc),
        is: bn(receipt.is),
      };

      return burnReceipt;
    }

    default:
      throw new FuelError(ErrorCode.INVALID_RECEIPT_TYPE, `Invalid receipt type: ${receiptType}.`);
  }
};

export const deserializeInput = (input: InputJson) => {
  let parsedInput: TransactionRequestInput;

  switch (input.type) {
    case 'InputCoin':
      parsedInput = {
        type: InputType.Coin,
        id: input.utxoId,
        amount: bn(input.amount),
        assetId: input.assetId,
        owner: input.owner,
        txPointer: `0x${input.txPointer}`,
        witnessIndex: Number(input.coinWitnessIndex),
        predicate: input.predicate,
        predicateData: input.predicateData,

View on GitHub (pinned to b3f37c91ac)

Solutions

  1. Upgrade @fuel-ts packages to a version compatible with the connected node.
  2. Verify the provider points to a node whose protocol version the SDK supports.
  3. If unavoidable, pre-filter receipts to known types before summary assembly (requires forking the helper).

Example fix

// no direct caller fix; alignment is the resolution
// before: getTransactionSummary throws on unknown receipt type
// after: upgrade @fuel-ts/account to match node version
//   pnpm up @fuel-ts/account@latest
Defensive patterns

Strategy: try-catch

Validate before calling

null

Type guard

null

Try / catch

import { ErrorCode } from '@fuel-ts/errors';
try {
  await getTransactionSummary({ id, provider });
} catch (e) {
  if (e.code === ErrorCode.INVALID_RECEIPT_TYPE) { /* upgrade SDK or report node version skew */ }
  else throw e;
}

Prevention

When it happens

Trigger: Deserializing transaction receipts during `getTransactionSummary` when the node returns a receipt whose `receiptType` is not recognized by the installed SDK. Reached from the receipts map in get-transaction-summary.ts.

Common situations: Node/SDK version skew: the node emits a new receipt type the client SDK does not know; corrupted receipt payload; decoding receipts from a transaction produced by a newer protocol version.

Related errors


AI-assisted analysis of FuelLabs/fuels-ts@b3f37c91ac (2026-08-12). Data as JSON: /api/errors/30feb9d149e141b1. Report an issue: GitHub.