{"version":3,"sources":["../src/coders/input.ts","../src/coders/byte-array.ts","../src/coders/tx-pointer.ts","../src/coders/output.ts","../src/coders/policy.ts","../src/receipt.ts","../src/coders/storage-slot.ts","../src/coders/transaction.ts","../src/coders/upgrade-purpose.ts","../src/coders/witness.ts","../src/coders/utxo-id.ts"],"sourcesContent":["/* eslint-disable max-classes-per-file */\nimport { Coder, B256Coder, NumberCoder, BigNumberCoder } from '@fuel-ts/abi-coder';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { sha256 } from '@fuel-ts/hasher';\nimport type { BN } from '@fuel-ts/math';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { concat, arrayify } from '@fuel-ts/utils';\n\nimport { ByteArrayCoder } from './byte-array';\nimport type { TxPointer } from './tx-pointer';\nimport { TxPointerCoder } from './tx-pointer';\n\nexport enum InputType {\n  Coin = 0,\n  Contract = 1,\n  Message = 2,\n}\n\nexport type InputCoin = {\n  type: InputType.Coin;\n\n  /** Hash of transaction (b256) */\n  txID: string;\n\n  /** Index of transaction output (u16) */\n  outputIndex: number;\n\n  /** Owning address or script hash (b256) */\n  owner: string;\n\n  /** Amount of coins (u64) */\n  amount: BN;\n\n  /** Asset ID of the coins (b256) */\n  assetId: string;\n\n  /** Points to the TX whose output is being spent. (TxPointer) */\n  txPointer: TxPointer;\n\n  /** Index of witness that authorizes spending the coin (u16) */\n  witnessIndex: number;\n\n  /** Gas used by predicate (u64) */\n  predicateGasUsed: BN;\n\n  /** Length of predicate, in instructions (u64) */\n  predicateLength: BN;\n\n  /** Length of predicate input data, in bytes (u64) */\n  predicateDataLength: BN;\n\n  /** Predicate bytecode (byte[]) */\n  predicate: string;\n\n  /** Predicate input data (parameters) (byte[]) */\n  predicateData: string;\n};\n\nexport class InputCoinCoder extends Coder<InputCoin, InputCoin> {\n  constructor() {\n    super('InputCoin', 'struct InputCoin', 0);\n  }\n\n  encode(value: InputCoin): Uint8Array {\n    const parts: Uint8Array[] = [];\n\n    parts.push(new B256Coder().encode(value.txID));\n    parts.push(new NumberCoder('u16', { padToWordSize: true }).encode(value.outputIndex));\n    parts.push(new B256Coder().encode(value.owner));\n    parts.push(new BigNumberCoder('u64').encode(value.amount));\n    parts.push(new B256Coder().encode(value.assetId));\n    parts.push(new TxPointerCoder().encode(value.txPointer));\n    parts.push(new NumberCoder('u16', { padToWordSize: true }).encode(value.witnessIndex));\n    parts.push(new BigNumberCoder('u64').encode(value.predicateGasUsed));\n    parts.push(new BigNumberCoder('u64').encode(value.predicateLength));\n    parts.push(new BigNumberCoder('u64').encode(value.predicateDataLength));\n    parts.push(new ByteArrayCoder(value.predicateLength.toNumber()).encode(value.predicate));\n    parts.push(\n      new ByteArrayCoder(value.predicateDataLength.toNumber()).encode(value.predicateData)\n    );\n\n    return concat(parts);\n  }\n\n  decode(data: Uint8Array, offset: number): [InputCoin, number] {\n    let decoded;\n    let o = offset;\n\n    [decoded, o] = new B256Coder().decode(data, o);\n    const txID = decoded;\n    [decoded, o] = new NumberCoder('u16', { padToWordSize: true }).decode(data, o);\n    const outputIndex = decoded;\n    [decoded, o] = new B256Coder().decode(data, o);\n    const owner = decoded;\n    [decoded, o] = new BigNumberCoder('u64').decode(data, o);\n    const amount = decoded;\n    [decoded, o] = new B256Coder().decode(data, o);\n    const assetId = decoded;\n    [decoded, o] = new TxPointerCoder().decode(data, o);\n    const txPointer = decoded;\n    [decoded, o] = new NumberCoder('u16', { padToWordSize: true }).decode(data, o);\n    const witnessIndex = Number(decoded);\n    [decoded, o] = new BigNumberCoder('u64').decode(data, o);\n    const predicateGasUsed = decoded;\n    [decoded, o] = new BigNumberCoder('u64').decode(data, o);\n    const predicateLength = decoded;\n    [decoded, o] = new BigNumberCoder('u64').decode(data, o);\n    const predicateDataLength = decoded;\n    [decoded, o] = new ByteArrayCoder(predicateLength.toNumber()).decode(data, o);\n    const predicate = decoded;\n    [decoded, o] = new ByteArrayCoder(predicateDataLength.toNumber()).decode(data, o);\n    const predicateData = decoded;\n\n    return [\n      {\n        type: InputType.Coin,\n        txID,\n        outputIndex,\n        owner,\n        amount,\n        assetId,\n        txPointer,\n        witnessIndex,\n        predicateGasUsed,\n        predicateLength,\n        predicateDataLength,\n        predicate,\n        predicateData,\n      },\n      o,\n    ];\n  }\n}\n\nexport type InputContract = {\n  type: InputType.Contract;\n\n  /** Hash of transaction (b256) */\n  txID: string;\n\n  /** Index of transaction output (u16) */\n  outputIndex: number;\n\n  /** Root of amount of coins owned by contract before transaction execution (b256) */\n  balanceRoot: string;\n\n  /** State root of contract before transaction execution (b256) */\n  stateRoot: string;\n\n  /** Points to the TX whose output is being spent. (TxPointer) */\n  txPointer: TxPointer;\n\n  /** Contract ID (b256) */\n  contractID: string;\n};\n\nexport class InputContractCoder extends Coder<InputContract, InputContract> {\n  constructor() {\n    super('InputContract', 'struct InputContract', 0);\n  }\n\n  encode(value: InputContract): Uint8Array {\n    const parts: Uint8Array[] = [];\n\n    parts.push(new B256Coder().encode(value.txID));\n    parts.push(new NumberCoder('u16', { padToWordSize: true }).encode(value.outputIndex));\n    parts.push(new B256Coder().encode(value.balanceRoot));\n    parts.push(new B256Coder().encode(value.stateRoot));\n    parts.push(new TxPointerCoder().encode(value.txPointer));\n    parts.push(new B256Coder().encode(value.contractID));\n\n    return concat(parts);\n  }\n\n  decode(data: Uint8Array, offset: number): [InputContract, number] {\n    let decoded;\n    let o = offset;\n\n    [decoded, o] = new B256Coder().decode(data, o);\n    const txID = decoded;\n    [decoded, o] = new NumberCoder('u16', { padToWordSize: true }).decode(data, o);\n    const outputIndex = decoded;\n    [decoded, o] = new B256Coder().decode(data, o);\n    const balanceRoot = decoded;\n    [decoded, o] = new B256Coder().decode(data, o);\n    const stateRoot = decoded;\n    [decoded, o] = new TxPointerCoder().decode(data, o);\n    const txPointer = decoded;\n    [decoded, o] = new B256Coder().decode(data, o);\n    const contractID = decoded;\n\n    return [\n      {\n        type: InputType.Contract,\n        txID,\n        outputIndex,\n        balanceRoot,\n        stateRoot,\n        txPointer,\n        contractID,\n      },\n      o,\n    ];\n  }\n}\n\nexport type InputMessage = {\n  type: InputType.Message;\n\n  /** Address of sender */\n  sender: string;\n\n  /** Address of recipient */\n  recipient: string;\n\n  /** Amount of coins */\n  amount: BN;\n\n  /** Unique nonce of message */\n  nonce: string;\n\n  /** Index of witness that authorizes message (u16) */\n  witnessIndex: number;\n\n  /** Gas used by predicate (u64) */\n  predicateGasUsed: BN;\n\n  /** Length of data (u64) */\n  dataLength?: number;\n\n  /** Length of predicate, in instructions (u64) */\n  predicateLength: BN;\n\n  /** Length of predicate input data, in bytes (u64) */\n  predicateDataLength: BN;\n\n  /** data of message */\n  data?: string;\n\n  /** Predicate bytecode (byte[]) */\n  predicate: string;\n\n  /** Predicate input data (parameters) (byte[]) */\n  predicateData: string;\n};\n\nexport class InputMessageCoder extends Coder<InputMessage, InputMessage> {\n  constructor() {\n    super('InputMessage', 'struct InputMessage', 0);\n  }\n\n  static getMessageId(\n    value: Pick<InputMessage, 'sender' | 'recipient' | 'nonce' | 'amount' | 'data'>\n  ): string {\n    const parts: Uint8Array[] = [];\n\n    parts.push(new ByteArrayCoder(32).encode(value.sender));\n    parts.push(new ByteArrayCoder(32).encode(value.recipient));\n    parts.push(new ByteArrayCoder(32).encode(value.nonce));\n    parts.push(new BigNumberCoder('u64').encode(value.amount));\n    parts.push(arrayify(value.data || '0x'));\n\n    return sha256(concat(parts));\n  }\n\n  static encodeData(messageData?: BytesLike): Uint8Array {\n    const bytes = arrayify(messageData || '0x');\n    const dataLength = bytes.length;\n    return new ByteArrayCoder(dataLength).encode(bytes);\n  }\n\n  encode(value: InputMessage): Uint8Array {\n    const parts: Uint8Array[] = [];\n    const data = InputMessageCoder.encodeData(value.data);\n\n    parts.push(new ByteArrayCoder(32).encode(value.sender));\n    parts.push(new ByteArrayCoder(32).encode(value.recipient));\n    parts.push(new BigNumberCoder('u64').encode(value.amount));\n    parts.push(new ByteArrayCoder(32).encode(value.nonce));\n    parts.push(new NumberCoder('u16', { padToWordSize: true }).encode(value.witnessIndex));\n    parts.push(new BigNumberCoder('u64').encode(value.predicateGasUsed));\n    parts.push(new BigNumberCoder('u64').encode(data.length));\n    parts.push(new BigNumberCoder('u64').encode(value.predicateLength));\n    parts.push(new BigNumberCoder('u64').encode(value.predicateDataLength));\n    parts.push(new ByteArrayCoder(data.length).encode(data));\n    parts.push(new ByteArrayCoder(value.predicateLength.toNumber()).encode(value.predicate));\n    parts.push(\n      new ByteArrayCoder(value.predicateDataLength.toNumber()).encode(value.predicateData)\n    );\n\n    return concat(parts);\n  }\n\n  static decodeData(messageData: BytesLike): Uint8Array {\n    const bytes = arrayify(messageData);\n    const dataLength = bytes.length;\n    const [data] = new ByteArrayCoder(dataLength).decode(bytes, 0);\n\n    return arrayify(data);\n  }\n\n  decode(data: Uint8Array, offset: number): [InputMessage, number] {\n    let decoded;\n    let o = offset;\n\n    [decoded, o] = new B256Coder().decode(data, o);\n    const sender = decoded;\n    [decoded, o] = new B256Coder().decode(data, o);\n    const recipient = decoded;\n    [decoded, o] = new BigNumberCoder('u64').decode(data, o);\n    const amount = decoded;\n    [decoded, o] = new B256Coder().decode(data, o);\n    const nonce = decoded;\n    [decoded, o] = new NumberCoder('u16', { padToWordSize: true }).decode(data, o);\n    const witnessIndex = Number(decoded);\n    [decoded, o] = new BigNumberCoder('u64').decode(data, o);\n    const predicateGasUsed = decoded;\n    [decoded, o] = new NumberCoder('u32', { padToWordSize: true }).decode(data, o);\n    const dataLength = decoded;\n    [decoded, o] = new BigNumberCoder('u64').decode(data, o);\n    const predicateLength = decoded;\n    [decoded, o] = new BigNumberCoder('u64').decode(data, o);\n    const predicateDataLength = decoded;\n    [decoded, o] = new ByteArrayCoder(dataLength).decode(data, o);\n    const messageData = decoded;\n    [decoded, o] = new ByteArrayCoder(predicateLength.toNumber()).decode(data, o);\n    const predicate = decoded;\n    [decoded, o] = new ByteArrayCoder(predicateDataLength.toNumber()).decode(data, o);\n    const predicateData = decoded;\n\n    return [\n      {\n        type: InputType.Message,\n        sender,\n        recipient,\n        amount,\n        witnessIndex,\n        nonce,\n        predicateGasUsed,\n        dataLength,\n        predicateLength,\n        predicateDataLength,\n        data: messageData,\n        predicate,\n        predicateData,\n      },\n      o,\n    ];\n  }\n}\n\nexport type Input = InputCoin | InputContract | InputMessage;\n\nexport class InputCoder extends Coder<Input, Input> {\n  constructor() {\n    super('Input', 'struct Input', 0);\n  }\n\n  encode(value: Input): Uint8Array {\n    const parts: Uint8Array[] = [];\n\n    parts.push(new NumberCoder('u8', { padToWordSize: true }).encode(value.type));\n\n    const { type } = value;\n\n    switch (type) {\n      case InputType.Coin: {\n        parts.push(new InputCoinCoder().encode(value));\n        break;\n      }\n      case InputType.Contract: {\n        parts.push(new InputContractCoder().encode(value));\n        break;\n      }\n      case InputType.Message: {\n        parts.push(new InputMessageCoder().encode(value));\n        break;\n      }\n      default: {\n        throw new FuelError(\n          ErrorCode.INVALID_TRANSACTION_INPUT,\n          `Invalid transaction input type: ${type}.`\n        );\n      }\n    }\n\n    return concat(parts);\n  }\n\n  decode(data: Uint8Array, offset: number): [Input, number] {\n    let decoded;\n    let o = offset;\n\n    [decoded, o] = new NumberCoder('u8', { padToWordSize: true }).decode(data, o);\n    const type = decoded as InputType;\n    switch (type) {\n      case InputType.Coin: {\n        [decoded, o] = new InputCoinCoder().decode(data, o);\n        return [decoded, o];\n      }\n      case InputType.Contract: {\n        [decoded, o] = new InputContractCoder().decode(data, o);\n        return [decoded, o];\n      }\n      case InputType.Message: {\n        [decoded, o] = new InputMessageCoder().decode(data, o);\n        return [decoded, o];\n      }\n      default: {\n        throw new FuelError(\n          ErrorCode.INVALID_TRANSACTION_INPUT,\n          `Invalid transaction input type: ${type}.`\n        );\n      }\n    }\n  }\n}\n","import { Coder } from '@fuel-ts/abi-coder';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { concat, hexlify, arrayify } from '@fuel-ts/utils';\n\nexport class ByteArrayCoder extends Coder<BytesLike, string> {\n  length: number;\n  #paddingLength: number;\n\n  constructor(length: number) {\n    const paddingLength = (8 - (length % 8)) % 8;\n    const encodedLength = length + paddingLength;\n    super(\n      'ByteArray',\n      // While this might sound like a [u8; N] coder it's actually not.\n      // A [u8; N] coder would pad every u8 to 8 bytes which would\n      // make every u8 have the same size as a u64.\n      // We are packing four u8s into u64s here, avoiding this padding.\n      `[u64; ${encodedLength / 4}]`,\n      encodedLength\n    );\n    this.length = length;\n    this.#paddingLength = paddingLength;\n  }\n\n  encode(value: BytesLike): Uint8Array {\n    const parts: Uint8Array[] = [];\n\n    const data = arrayify(value);\n    parts.push(data);\n    // Write padding\n    if (this.#paddingLength) {\n      parts.push(new Uint8Array(this.#paddingLength));\n    }\n\n    return concat(parts);\n  }\n\n  decode(data: Uint8Array, offset: number): [string, number] {\n    let decoded;\n    let o = offset;\n\n    [decoded, o] = [hexlify(data.slice(o, o + this.length)), o + this.length];\n    const value = decoded;\n    // Read padding\n    if (this.#paddingLength) {\n      [decoded, o] = [null, o + this.#paddingLength];\n    }\n\n    return [value, o];\n  }\n}\n","import { NumberCoder, StructCoder } from '@fuel-ts/abi-coder';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\n\nexport type TxPointer = {\n  /** Block height (u32) */\n  blockHeight: number;\n\n  /** Transaction index (u16) */\n  txIndex: number;\n};\n\nexport class TxPointerCoder extends StructCoder<{\n  blockHeight: NumberCoder;\n  txIndex: NumberCoder;\n}> {\n  constructor() {\n    super('TxPointer', {\n      blockHeight: new NumberCoder('u32', { padToWordSize: true }),\n      txIndex: new NumberCoder('u16', { padToWordSize: true }),\n    });\n  }\n\n  public static decodeFromGqlScalar(value: string) {\n    // taken from https://github.com/FuelLabs/fuel-vm/blob/7366db6955589cb3444c9b2bb46e45c8539f19f5/fuel-tx/src/tx_pointer.rs#L87\n    if (value.length !== 12) {\n      throw new FuelError(\n        ErrorCode.DECODE_ERROR,\n        `Invalid TxPointer scalar string length ${value.length}. It must have length 12.`\n      );\n    }\n    const [blockHeight, txIndex] = [value.substring(0, 8), value.substring(8)];\n    return {\n      blockHeight: parseInt(blockHeight, 16),\n      txIndex: parseInt(txIndex, 16),\n    };\n  }\n}\n","/* eslint-disable max-classes-per-file */\nimport { Coder, B256Coder, NumberCoder, BigNumberCoder } from '@fuel-ts/abi-coder';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport type { BN } from '@fuel-ts/math';\nimport { concat } from '@fuel-ts/utils';\n\nexport enum OutputType /* u8 */ {\n  Coin = 0,\n  Contract = 1,\n  Change = 2,\n  Variable = 3,\n  ContractCreated = 4,\n}\n\nexport type OutputCoin = {\n  type: OutputType.Coin;\n  /** Receiving address or script hash (b256) */\n  to: string;\n  /** Amount of coins to send (u64) */\n  amount: BN;\n  /** Asset ID of coins (b256) */\n  assetId: string;\n};\n\nexport class OutputCoinCoder extends Coder<OutputCoin, OutputCoin> {\n  constructor() {\n    super('OutputCoin', 'struct OutputCoin', 0);\n  }\n\n  encode(value: OutputCoin): Uint8Array {\n    const parts: Uint8Array[] = [];\n\n    parts.push(new B256Coder().encode(value.to));\n    parts.push(new BigNumberCoder('u64').encode(value.amount));\n    parts.push(new B256Coder().encode(value.assetId));\n\n    return concat(parts);\n  }\n\n  decode(data: Uint8Array, offset: number): [OutputCoin, number] {\n    let decoded;\n    let o = offset;\n\n    [decoded, o] = new B256Coder().decode(data, o);\n    const to = decoded;\n    [decoded, o] = new BigNumberCoder('u64').decode(data, o);\n    const amount = decoded;\n    [decoded, o] = new B256Coder().decode(data, o);\n    const assetId = decoded;\n\n    return [\n      {\n        type: OutputType.Coin,\n        to,\n        amount,\n        assetId,\n      },\n      o,\n    ];\n  }\n}\n\nexport type OutputContract = {\n  type: OutputType.Contract;\n  /** Index of input contract (u8) */\n  inputIndex: number;\n  /** Root of amount of coins owned by contract after transaction execution (b256) */\n  balanceRoot: string;\n  /** State root of contract after transaction execution (b256) */\n  stateRoot: string;\n};\n\nexport class OutputContractCoder extends Coder<OutputContract, OutputContract> {\n  constructor() {\n    super('OutputContract', 'struct OutputContract', 0);\n  }\n\n  encode(value: OutputContract): Uint8Array {\n    const parts: Uint8Array[] = [];\n\n    parts.push(new NumberCoder('u8', { padToWordSize: true }).encode(value.inputIndex));\n    parts.push(new B256Coder().encode(value.balanceRoot));\n    parts.push(new B256Coder().encode(value.stateRoot));\n\n    return concat(parts);\n  }\n\n  decode(data: Uint8Array, offset: number): [OutputContract, number] {\n    let decoded;\n    let o = offset;\n\n    [decoded, o] = new NumberCoder('u8', { padToWordSize: true }).decode(data, o);\n    const inputIndex = decoded;\n    [decoded, o] = new B256Coder().decode(data, o);\n    const balanceRoot = decoded;\n    [decoded, o] = new B256Coder().decode(data, o);\n    const stateRoot = decoded;\n\n    return [\n      {\n        type: OutputType.Contract,\n        inputIndex,\n        balanceRoot,\n        stateRoot,\n      },\n      o,\n    ];\n  }\n}\n\nexport type OutputChange = {\n  type: OutputType.Change;\n  /** Receiving address or script hash (b256) */\n  to: string;\n  /** Amount of coins to send (u64) */\n  amount: BN;\n  /** Asset ID of coins (b256) */\n  assetId: string;\n};\n\nexport class OutputChangeCoder extends Coder<OutputChange, OutputChange> {\n  constructor() {\n    super('OutputChange', 'struct OutputChange', 0);\n  }\n\n  encode(value: OutputChange): Uint8Array {\n    const parts: Uint8Array[] = [];\n\n    parts.push(new B256Coder().encode(value.to));\n    parts.push(new BigNumberCoder('u64').encode(value.amount));\n    parts.push(new B256Coder().encode(value.assetId));\n\n    return concat(parts);\n  }\n\n  decode(data: Uint8Array, offset: number): [OutputChange, number] {\n    let decoded;\n    let o = offset;\n\n    [decoded, o] = new B256Coder().decode(data, o);\n    const to = decoded;\n    [decoded, o] = new BigNumberCoder('u64').decode(data, o);\n    const amount = decoded;\n    [decoded, o] = new B256Coder().decode(data, o);\n    const assetId = decoded;\n\n    return [\n      {\n        type: OutputType.Change,\n        to,\n        amount,\n        assetId,\n      },\n      o,\n    ];\n  }\n}\n\nexport type OutputVariable = {\n  type: OutputType.Variable;\n  /** Receiving address or script hash (b256) */\n  to: string;\n  /** Amount of coins to send (u64) */\n  amount: BN;\n  /** Asset ID of coins (b256) */\n  assetId: string;\n};\n\nexport class OutputVariableCoder extends Coder<OutputVariable, OutputVariable> {\n  constructor() {\n    super('OutputVariable', 'struct OutputVariable', 0);\n  }\n\n  encode(value: OutputVariable): Uint8Array {\n    const parts: Uint8Array[] = [];\n\n    parts.push(new B256Coder().encode(value.to));\n    parts.push(new BigNumberCoder('u64').encode(value.amount));\n    parts.push(new B256Coder().encode(value.assetId));\n\n    return concat(parts);\n  }\n\n  decode(data: Uint8Array, offset: number): [OutputVariable, number] {\n    let decoded;\n    let o = offset;\n\n    [decoded, o] = new B256Coder().decode(data, o);\n    const to = decoded;\n    [decoded, o] = new BigNumberCoder('u64').decode(data, o);\n    const amount = decoded;\n    [decoded, o] = new B256Coder().decode(data, o);\n    const assetId = decoded;\n\n    return [\n      {\n        type: OutputType.Variable,\n        to,\n        amount,\n        assetId,\n      },\n      o,\n    ];\n  }\n}\n\nexport type OutputContractCreated = {\n  type: OutputType.ContractCreated;\n  /** Contract ID (b256) */\n  contractId: string;\n  /** State root of contract (b256) */\n  stateRoot: string;\n};\n\nexport class OutputContractCreatedCoder extends Coder<\n  OutputContractCreated,\n  OutputContractCreated\n> {\n  constructor() {\n    super('OutputContractCreated', 'struct OutputContractCreated', 0);\n  }\n\n  encode(value: OutputContractCreated): Uint8Array {\n    const parts: Uint8Array[] = [];\n\n    parts.push(new B256Coder().encode(value.contractId));\n    parts.push(new B256Coder().encode(value.stateRoot));\n\n    return concat(parts);\n  }\n\n  decode(data: Uint8Array, offset: number): [OutputContractCreated, number] {\n    let decoded;\n    let o = offset;\n\n    [decoded, o] = new B256Coder().decode(data, o);\n    const contractId = decoded;\n    [decoded, o] = new B256Coder().decode(data, o);\n    const stateRoot = decoded;\n\n    return [\n      {\n        type: OutputType.ContractCreated,\n        contractId,\n        stateRoot,\n      },\n      o,\n    ];\n  }\n}\n\nexport type Output =\n  | OutputCoin\n  | OutputContract\n  | OutputChange\n  | OutputVariable\n  | OutputContractCreated;\n\nexport class OutputCoder extends Coder<Output, Output> {\n  constructor() {\n    super('Output', ' struct Output', 0);\n  }\n\n  encode(value: Output): Uint8Array {\n    const parts: Uint8Array[] = [];\n\n    parts.push(new NumberCoder('u8', { padToWordSize: true }).encode(value.type));\n\n    const { type } = value;\n\n    switch (type) {\n      case OutputType.Coin: {\n        parts.push(new OutputCoinCoder().encode(value));\n        break;\n      }\n      case OutputType.Contract: {\n        parts.push(new OutputContractCoder().encode(value));\n        break;\n      }\n      case OutputType.Change: {\n        parts.push(new OutputChangeCoder().encode(value));\n        break;\n      }\n      case OutputType.Variable: {\n        parts.push(new OutputVariableCoder().encode(value));\n        break;\n      }\n      case OutputType.ContractCreated: {\n        parts.push(new OutputContractCreatedCoder().encode(value));\n        break;\n      }\n      default: {\n        throw new FuelError(\n          ErrorCode.INVALID_TRANSACTION_OUTPUT,\n          `Invalid transaction output type: ${type}.`\n        );\n      }\n    }\n\n    return concat(parts);\n  }\n\n  decode(data: Uint8Array, offset: number): [Output, number] {\n    let decoded;\n    let o = offset;\n\n    [decoded, o] = new NumberCoder('u8', { padToWordSize: true }).decode(data, o);\n    const type = decoded as OutputType;\n    switch (type) {\n      case OutputType.Coin: {\n        [decoded, o] = new OutputCoinCoder().decode(data, o);\n        return [decoded, o];\n      }\n      case OutputType.Contract: {\n        [decoded, o] = new OutputContractCoder().decode(data, o);\n        return [decoded, o];\n      }\n      case OutputType.Change: {\n        [decoded, o] = new OutputChangeCoder().decode(data, o);\n        return [decoded, o];\n      }\n      case OutputType.Variable: {\n        [decoded, o] = new OutputVariableCoder().decode(data, o);\n        return [decoded, o];\n      }\n      case OutputType.ContractCreated: {\n        [decoded, o] = new OutputContractCreatedCoder().decode(data, o);\n        return [decoded, o];\n      }\n      default: {\n        throw new FuelError(\n          ErrorCode.INVALID_TRANSACTION_OUTPUT,\n          `Invalid transaction output type: ${type}.`\n        );\n      }\n    }\n  }\n}\n","import { BigNumberCoder, Coder, NumberCoder, WORD_SIZE } from '@fuel-ts/abi-coder';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport type { BN } from '@fuel-ts/math';\nimport { concat } from '@fuel-ts/utils';\n\n// Bitfield of used policy types.\nexport enum PolicyType {\n  Tip = 1,\n  WitnessLimit = 2,\n  Maturity = 4,\n  MaxFee = 8,\n  Expiration = 16,\n  Owner = 32,\n}\n\nexport type Policy =\n  | PolicyTip\n  | PolicyWitnessLimit\n  | PolicyMaturity\n  | PolicyMaxFee\n  | PolicyExpiration\n  | PolicyOwner;\n\nexport type PolicyTip = {\n  type: PolicyType.Tip;\n  data: BN;\n};\n\nexport type PolicyWitnessLimit = {\n  type: PolicyType.WitnessLimit;\n  data: BN;\n};\n\nexport type PolicyMaturity = {\n  type: PolicyType.Maturity;\n  data: number;\n};\n\nexport type PolicyExpiration = {\n  type: PolicyType.Expiration;\n  data: number;\n};\n\nexport type PolicyMaxFee = {\n  type: PolicyType.MaxFee;\n  data: BN;\n};\n\nexport type PolicyOwner = {\n  type: PolicyType.Owner;\n  data: BN;\n};\n\nexport const sortPolicies = (policies: Policy[]): Policy[] =>\n  policies.sort((a, b) => a.type - b.type);\n\nfunction validateDuplicatedPolicies(policies: Policy[]): void {\n  const seenTypes = new Set<PolicyType>();\n\n  policies.forEach((policy) => {\n    if (seenTypes.has(policy.type)) {\n      throw new FuelError(\n        ErrorCode.DUPLICATED_POLICY,\n        `Duplicate policy type found: ${PolicyType.MaxFee}`\n      );\n    }\n    seenTypes.add(policy.type);\n  });\n}\n\nexport function getPolicyTypesArray(policyTypes: number): number[] {\n  const out: number[] = [];\n  let m = policyTypes >>> 0;\n  while (m !== 0) {\n    const low = m & -m;\n    out.push(low);\n    m &= m - 1;\n  }\n  return out;\n}\nexport class PoliciesCoder extends Coder<Policy[], Policy[]> {\n  constructor() {\n    super('Policies', 'array Policy', 0);\n  }\n\n  encode(policies: Policy[]): Uint8Array {\n    validateDuplicatedPolicies(policies);\n    const sortedPolicies = sortPolicies(policies);\n\n    const parts: Uint8Array[] = [];\n\n    sortedPolicies.forEach(({ data, type }) => {\n      switch (type) {\n        case PolicyType.MaxFee:\n        case PolicyType.Tip:\n        case PolicyType.WitnessLimit:\n          parts.push(new BigNumberCoder('u64').encode(data));\n          break;\n\n        case PolicyType.Maturity:\n        case PolicyType.Expiration:\n          parts.push(new NumberCoder('u32', { padToWordSize: true }).encode(data));\n          break;\n        case PolicyType.Owner:\n          parts.push(new BigNumberCoder('u64').encode(data));\n          break;\n\n        default: {\n          throw new FuelError(ErrorCode.INVALID_POLICY_TYPE, `Invalid policy type: ${type}`);\n        }\n      }\n    });\n\n    return concat(parts);\n  }\n\n  decode(data: Uint8Array, offset: number, policyTypes: number): [Policy[], number] {\n    let o = offset;\n    const policies: Policy[] = [];\n    const policyTypesArray = getPolicyTypesArray(policyTypes);\n\n    for (const policyType of policyTypesArray) {\n      switch (policyType) {\n        case PolicyType.Tip: {\n          const [tip, nextOffset] = new BigNumberCoder('u64').decode(data, o);\n          o = nextOffset;\n          policies.push({ type: PolicyType.Tip, data: tip });\n          break;\n        }\n        case PolicyType.WitnessLimit: {\n          const [witnessLimit, nextOffset] = new BigNumberCoder('u64').decode(data, o);\n          o = nextOffset;\n          policies.push({ type: PolicyType.WitnessLimit, data: witnessLimit });\n          break;\n        }\n        case PolicyType.Maturity: {\n          const [maturity, nextOffset] = new NumberCoder('u32', { padToWordSize: true }).decode(\n            data,\n            o\n          );\n          o = nextOffset;\n          policies.push({ type: PolicyType.Maturity, data: maturity });\n          break;\n        }\n        case PolicyType.MaxFee: {\n          const [maxFee, nextOffset] = new BigNumberCoder('u64').decode(data, o);\n          o = nextOffset;\n          policies.push({ type: PolicyType.MaxFee, data: maxFee });\n          break;\n        }\n        case PolicyType.Expiration: {\n          const [expiration, nextOffset] = new NumberCoder('u32', { padToWordSize: true }).decode(\n            data,\n            o\n          );\n          o = nextOffset;\n          policies.push({ type: PolicyType.Expiration, data: expiration });\n          break;\n        }\n        case PolicyType.Owner: {\n          const [owner, nextOffset] = new BigNumberCoder('u64').decode(data, o);\n          o = nextOffset;\n          policies.push({ type: PolicyType.Owner, data: owner });\n          break;\n        }\n        default:\n          // Unknown policy types will be handled after the loop\n          break;\n      }\n    }\n\n    // If the policy types are greater than the maximum policy type, we need to skip the remaining bits\n    // this allows for backwards compatibility with newer versions of the policy types.\n    const leftPolicyTypes = policyTypesArray.length - policies.length;\n    if (leftPolicyTypes > 0) {\n      // eslint-disable-next-line no-console\n      console.warn(\n        `${leftPolicyTypes} unknown policy types found in the transaction, please update fuels to the latest version`\n      );\n      o += leftPolicyTypes * WORD_SIZE;\n    }\n\n    return [policies, o];\n  }\n}\n","import { BigNumberCoder } from '@fuel-ts/abi-coder';\nimport type { AssetId } from '@fuel-ts/address';\nimport { sha256 } from '@fuel-ts/hasher';\nimport type { BN } from '@fuel-ts/math';\nimport { arrayify, concat } from '@fuel-ts/utils';\n\nimport { ByteArrayCoder } from './coders/byte-array';\n\nexport enum ReceiptType /* u8 */ {\n  Call = 0,\n  Return = 1,\n  ReturnData = 2,\n  Panic = 3,\n  Revert = 4,\n  Log = 5,\n  LogData = 6,\n  Transfer = 7,\n  TransferOut = 8,\n  ScriptResult = 9,\n  MessageOut = 10,\n  Mint = 11,\n  Burn = 12,\n}\n\nexport type ReceiptCall = {\n  type: ReceiptType.Call;\n  /** Contract ID of current context if in an internal context, zero otherwise (b256) */\n  id: string;\n  /** Contract ID of called contract (b256) */\n  to: string;\n  /** Amount of coins to forward, i.e. $rB (u64) */\n  amount: BN;\n  /** Asset ID of coins to forward, i.e. MEM[$rC, 32] (b256) */\n  assetId: string;\n  /** Gas to forward, i.e. $rD (u64) */\n  gas: BN;\n  /** Method name offset (u64) */\n  param1: BN;\n  /** Method args offset (u64) */\n  param2: BN;\n  /** Value of register $pc (u64) */\n  pc: BN;\n  /** Value of register $is (u64) */\n  is: BN;\n};\n\nexport type ReceiptReturn = {\n  type: ReceiptType.Return;\n  /** Contract ID of current context if in an internal context, zero otherwise (b256) */\n  id: string;\n  /** Value of register $rA (u64) */\n  val: BN;\n  /** Value of register $pc (u64) */\n  pc: BN;\n  /** Value of register $is (u64) */\n  is: BN;\n};\n\nexport type ReceiptReturnData = {\n  type: ReceiptType.ReturnData;\n  /** Contract ID of current context if in an internal context, zero otherwise (b256) */\n  id: string;\n  /** Value of register $rA (u64) */\n  ptr: BN;\n  /** Value of register $rB (u64) */\n  len: BN;\n  /** Hash of MEM[$rA, $rB] (b256) */\n  digest: string;\n  /** Value of register $pc (u64) */\n  pc: BN;\n  /** Value of the memory range MEM[$rA, $rB]. */\n  data: string;\n  /** Value of register $is (u64) */\n  is: BN;\n};\n\nexport type ReceiptPanic = {\n  type: ReceiptType.Panic;\n  /** Contract ID of current context if in an internal context, zero otherwise (b256) */\n  id: string;\n  /** Panic reason (u64) */\n  reason: BN;\n  /** Value of register $pc (u64) */\n  pc: BN;\n  /** Value of register $is (u64) */\n  is: BN;\n  /** Value of optional contract ID */\n  contractId: string;\n};\n\nexport type ReceiptRevert = {\n  type: ReceiptType.Revert;\n  /** Contract ID of current context if in an internal context, zero otherwise (b256) */\n  id: string;\n  /** Value of register $rA (u64) */\n  val: BN;\n  /** Value of register $pc (u64) */\n  pc: BN;\n  /** Value of register $is (u64) */\n  is: BN;\n};\n\nexport type ReceiptLog = {\n  type: ReceiptType.Log;\n  /** Contract ID of current context if in an internal context, zero otherwise (b256) */\n  id: string;\n  /** Value of register $rA (u64) */\n  ra: BN;\n  /** Value of register $rB (u64) */\n  rb: BN;\n  /** Value of register $rC (u64) */\n  rc: BN;\n  /** Value of register $rD (u64) */\n  rd: BN;\n  /** Value of register $pc (u64) */\n  pc: BN;\n  /** Value of register $is (u64) */\n  is: BN;\n};\n\nexport type ReceiptLogData = {\n  type: ReceiptType.LogData;\n  /** Contract ID of current context if in an internal context, zero otherwise (b256) */\n  id: string;\n  /** Value of register $rA (u64) */\n  ra: BN;\n  /** Value of register $rB (u64) */\n  rb: BN;\n  /** Value of register $rC (u64) */\n  ptr: BN;\n  /** Value of register $rD (u64) */\n  len: BN;\n  /** Hash of MEM[$rC, $rD] (b256) */\n  digest: string;\n  /** Value of the memory range MEM[$rC, $rD]. */\n  data: string;\n  /** Value of register $pc (u64) */\n  pc: BN;\n  /** Value of register $is (u64) */\n  is: BN;\n};\n\nexport type ReceiptTransfer = {\n  type: ReceiptType.Transfer;\n  /** Contract ID of current context if in an internal context, zero otherwise (b256) */\n  id: string;\n  /** Contract ID of contract to transfer coins to (b256) */\n  to: string;\n  /** Amount of coins transferred (u64) */\n  amount: BN;\n  /** Asset ID of coins transferred (b256) */\n  assetId: string;\n  /** Value of register $pc (u64) */\n  pc: BN;\n  /** Value of register $is (u64) */\n  is: BN;\n};\n\nexport type ReceiptTransferOut = {\n  type: ReceiptType.TransferOut;\n  /** Contract ID of current context if in an internal context, zero otherwise (b256) */\n  id: string;\n  /** Address to transfer coins to (b256) */\n  to: string;\n  /** Amount of coins transferred (u64) */\n  amount: BN;\n  /** Asset ID of coins transferred (b256) */\n  assetId: string;\n  /** Value of register $pc (u64) */\n  pc: BN;\n  /** Value of register $is (u64) */\n  is: BN;\n};\n\nexport type ReceiptScriptResult = {\n  type: ReceiptType.ScriptResult;\n  /** Result variant with embedded `PanicReason` in first 8 bits and `instr` (u64) */\n  result: BN;\n  /** Gas consumed by the script (u64) */\n  gasUsed: BN;\n};\n\nexport type ReceiptMessageOut = {\n  type: ReceiptType.MessageOut;\n  /** Hexadecimal string representation of the 256-bit (32-byte) message ID */\n  messageId: string;\n  /** Hexadecimal string representation of the 256-bit (32-byte) address of the message sender: MEM[$fp, 32] */\n  sender: string;\n  /** Hexadecimal string representation of the 256-bit (32-byte) address of the message recipient: MEM[$rA, 32] */\n  recipient: string;\n  /** Hexadecimal string representation of a 64-bit unsigned integer; value of register $rD */\n  amount: BN;\n  /** Hexadecimal string representation of the 256-bit (32-byte) message nonce */\n  nonce: string;\n  /** Decimal string representation of a 16-bit unsigned integer; value of register $rC. */\n  len: number;\n  /** Hexadecimal string representation of 256-bit (32-byte), hash of MEM[$rA + 32, $rB] */\n  digest: string;\n  /** Hexadecimal string representation of the value of the memory range MEM[$rA + 32, $rB] */\n  data: Uint8Array;\n};\n\nexport type ReceiptMint = {\n  type: ReceiptType.Mint;\n\n  subId: string;\n\n  contractId: string;\n\n  assetId: string;\n\n  val: BN;\n  /** Value of register $pc (u64) */\n  pc: BN;\n  /** Value of register $is (u64) */\n  is: BN;\n};\n\nexport type ReceiptBurn = {\n  type: ReceiptType.Burn;\n\n  subId: string;\n\n  contractId: string;\n\n  assetId: string;\n\n  val: BN;\n  /** Value of register $pc (u64) */\n  pc: BN;\n  /** Value of register $is (u64) */\n  is: BN;\n};\n\nexport type Receipt =\n  | ReceiptCall\n  | ReceiptReturn\n  | ReceiptReturnData\n  | ReceiptPanic\n  | ReceiptRevert\n  | ReceiptLog\n  | ReceiptLogData\n  | ReceiptTransfer\n  | ReceiptTransferOut\n  | ReceiptScriptResult\n  | ReceiptMessageOut\n  | ReceiptMint\n  | ReceiptBurn;\n\nexport const getMintedAssetId = (contractId: string, subId: string): string => {\n  const contractIdBytes = arrayify(contractId);\n  const subIdBytes = arrayify(subId);\n\n  return sha256(concat([contractIdBytes, subIdBytes]));\n};\n\nexport const createAssetId = (contractId: string, subId: string): AssetId => ({\n  bits: getMintedAssetId(contractId, subId),\n});\n\nexport const getMessageId = (\n  value: Pick<ReceiptMessageOut, 'sender' | 'recipient' | 'nonce' | 'amount' | 'data'>\n): string => {\n  const parts: Uint8Array[] = [];\n\n  parts.push(new ByteArrayCoder(32).encode(value.sender));\n  parts.push(new ByteArrayCoder(32).encode(value.recipient));\n  parts.push(new ByteArrayCoder(32).encode(value.nonce));\n  parts.push(new BigNumberCoder('u64').encode(value.amount));\n  parts.push(arrayify(value.data || '0x'));\n\n  return sha256(concat(parts));\n};\n","import { B256Coder, StructCoder } from '@fuel-ts/abi-coder';\n\nexport type StorageSlot = {\n  /** Key (b256) */\n  key: string;\n  /** Value (b256) */\n  value: string;\n};\n\nexport class StorageSlotCoder extends StructCoder<{\n  key: B256Coder;\n  value: B256Coder;\n}> {\n  constructor() {\n    super('StorageSlot', {\n      key: new B256Coder(),\n      value: new B256Coder(),\n    });\n  }\n}\n","/* eslint-disable max-classes-per-file */\n\nimport { Coder, ArrayCoder, B256Coder, NumberCoder, BigNumberCoder } from '@fuel-ts/abi-coder';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { type BN } from '@fuel-ts/math';\nimport { concat } from '@fuel-ts/utils';\n\nimport { ByteArrayCoder } from './byte-array';\nimport type { Input, InputContract } from './input';\nimport { InputCoder, InputContractCoder } from './input';\nimport type { Output, OutputContract } from './output';\nimport { OutputCoder, OutputContractCoder } from './output';\nimport type { Policy } from './policy';\nimport { PoliciesCoder } from './policy';\nimport { StorageSlotCoder } from './storage-slot';\nimport type { StorageSlot } from './storage-slot';\nimport type { TxPointer } from './tx-pointer';\nimport { TxPointerCoder } from './tx-pointer';\nimport { UpgradePurposeCoder, type UpgradePurpose } from './upgrade-purpose';\nimport type { Witness } from './witness';\nimport { WitnessCoder } from './witness';\n\nexport enum TransactionType /* u8 */ {\n  Script = 0,\n  Create = 1,\n  Mint = 2,\n  Upgrade = 3,\n  Upload = 4,\n  Blob = 5,\n}\n\n/** @hidden */\nexport type BaseTransactionType = {\n  /** The type of the transaction */\n  type: TransactionType;\n  /** List of witnesses (Witness[]) */\n  witnesses: Witness[];\n\n  /** Number of witnesses (u16) */\n  witnessesCount: number;\n\n  /** List of outputs (Output[]) */\n  outputs: Output[];\n\n  /** List of inputs (Input[]) */\n  inputs: Input[];\n\n  /** List of policies. */\n  policies: Policy[];\n\n  /** Bitfield of used policy types (u32) */\n  policyTypes: number;\n\n  /** Number of inputs (u16) */\n  inputsCount: number;\n\n  /** Number of outputs (u16) */\n  outputsCount: number;\n};\n\nexport type TransactionScript = BaseTransactionType & {\n  type: TransactionType.Script;\n\n  /** Gas limit for transaction (u64) */\n  scriptGasLimit: BN;\n\n  /** Merkle root of receipts (b256) */\n  receiptsRoot: string;\n\n  /** Script length, in instructions (u64) */\n  scriptLength: BN;\n\n  /** Length of script input data, in bytes (u64) */\n  scriptDataLength: BN;\n\n  /** Script to execute (byte[]) */\n  script: string;\n\n  /** Script input data (parameters) (byte[]) */\n  scriptData: string;\n};\n\nexport class TransactionScriptCoder extends Coder<TransactionScript, TransactionScript> {\n  constructor() {\n    super('TransactionScript', 'struct TransactionScript', 0);\n  }\n\n  encode(value: TransactionScript): Uint8Array {\n    const parts: Uint8Array[] = [];\n\n    parts.push(new BigNumberCoder('u64').encode(value.scriptGasLimit));\n    parts.push(new B256Coder().encode(value.receiptsRoot));\n    parts.push(new BigNumberCoder('u64').encode(value.scriptLength));\n    parts.push(new BigNumberCoder('u64').encode(value.scriptDataLength));\n    parts.push(new NumberCoder('u32', { padToWordSize: true }).encode(value.policyTypes));\n    parts.push(new NumberCoder('u16', { padToWordSize: true }).encode(value.inputsCount));\n    parts.push(new NumberCoder('u16', { padToWordSize: true }).encode(value.outputsCount));\n    parts.push(new NumberCoder('u16', { padToWordSize: true }).encode(value.witnessesCount));\n    parts.push(new ByteArrayCoder(value.scriptLength.toNumber()).encode(value.script));\n    parts.push(new ByteArrayCoder(value.scriptDataLength.toNumber()).encode(value.scriptData));\n    parts.push(new PoliciesCoder().encode(value.policies));\n    parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));\n    parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));\n    parts.push(new ArrayCoder(new WitnessCoder(), value.witnessesCount).encode(value.witnesses));\n\n    return concat(parts);\n  }\n\n  decode(data: Uint8Array, offset: number): [TransactionScript, number] {\n    let decoded;\n    let o = offset;\n    [decoded, o] = new BigNumberCoder('u64').decode(data, o);\n    const scriptGasLimit = decoded;\n    [decoded, o] = new B256Coder().decode(data, o);\n    const receiptsRoot = decoded;\n    [decoded, o] = new BigNumberCoder('u64').decode(data, o);\n    const scriptLength = decoded;\n    [decoded, o] = new BigNumberCoder('u64').decode(data, o);\n    const scriptDataLength = decoded;\n    [decoded, o] = new NumberCoder('u32', { padToWordSize: true }).decode(data, o);\n    const policyTypes = decoded;\n    [decoded, o] = new NumberCoder('u16', { padToWordSize: true }).decode(data, o);\n    const inputsCount = decoded;\n    [decoded, o] = new NumberCoder('u16', { padToWordSize: true }).decode(data, o);\n    const outputsCount = decoded;\n    [decoded, o] = new NumberCoder('u16', { padToWordSize: true }).decode(data, o);\n    const witnessesCount = decoded;\n    [decoded, o] = new ByteArrayCoder(scriptLength.toNumber()).decode(data, o);\n    const script = decoded;\n    [decoded, o] = new ByteArrayCoder(scriptDataLength.toNumber()).decode(data, o);\n    const scriptData = decoded;\n    [decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);\n    const policies = decoded;\n    [decoded, o] = new ArrayCoder(new InputCoder(), inputsCount).decode(data, o);\n    const inputs = decoded;\n    [decoded, o] = new ArrayCoder(new OutputCoder(), outputsCount).decode(data, o);\n    const outputs = decoded;\n    [decoded, o] = new ArrayCoder(new WitnessCoder(), witnessesCount).decode(data, o);\n    const witnesses = decoded;\n\n    return [\n      {\n        type: TransactionType.Script,\n        scriptGasLimit,\n        scriptLength,\n        scriptDataLength,\n        policyTypes,\n        inputsCount,\n        outputsCount,\n        witnessesCount,\n        receiptsRoot,\n        script,\n        scriptData,\n        policies,\n        inputs,\n        outputs,\n        witnesses,\n      },\n      o,\n    ];\n  }\n}\n\nexport type TransactionCreate = BaseTransactionType & {\n  type: TransactionType.Create;\n\n  /** Witness index of contract bytecode to create (u8) */\n  bytecodeWitnessIndex: number;\n\n  /** Salt (b256) */\n  salt: string;\n\n  /** Number of storage slots to initialize (u16) */\n  storageSlotsCount: BN;\n\n  /** List of inputs (StorageSlot[]) */\n  storageSlots: StorageSlot[];\n};\n\nexport class TransactionCreateCoder extends Coder<TransactionCreate, TransactionCreate> {\n  constructor() {\n    super('TransactionCreate', 'struct TransactionCreate', 0);\n  }\n\n  encode(value: TransactionCreate): Uint8Array {\n    const parts: Uint8Array[] = [];\n\n    parts.push(new NumberCoder('u16', { padToWordSize: true }).encode(value.bytecodeWitnessIndex));\n    parts.push(new B256Coder().encode(value.salt));\n    parts.push(new BigNumberCoder('u64').encode(value.storageSlotsCount));\n    parts.push(new NumberCoder('u32', { padToWordSize: true }).encode(value.policyTypes));\n    parts.push(new NumberCoder('u16', { padToWordSize: true }).encode(value.inputsCount));\n    parts.push(new NumberCoder('u16', { padToWordSize: true }).encode(value.outputsCount));\n    parts.push(new NumberCoder('u16', { padToWordSize: true }).encode(value.witnessesCount));\n    parts.push(\n      new ArrayCoder(new StorageSlotCoder(), value.storageSlotsCount.toNumber()).encode(\n        value.storageSlots\n      )\n    );\n    parts.push(new PoliciesCoder().encode(value.policies));\n    parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));\n    parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));\n    parts.push(new ArrayCoder(new WitnessCoder(), value.witnessesCount).encode(value.witnesses));\n\n    return concat(parts);\n  }\n\n  decode(data: Uint8Array, offset: number): [TransactionCreate, number] {\n    let decoded;\n    let o = offset;\n\n    [decoded, o] = new NumberCoder('u16', { padToWordSize: true }).decode(data, o);\n    const bytecodeWitnessIndex = decoded;\n    [decoded, o] = new B256Coder().decode(data, o);\n    const salt = decoded;\n    [decoded, o] = new BigNumberCoder('u64').decode(data, o);\n    const storageSlotsCount = decoded;\n    [decoded, o] = new NumberCoder('u32', { padToWordSize: true }).decode(data, o);\n    const policyTypes = decoded;\n    [decoded, o] = new NumberCoder('u16', { padToWordSize: true }).decode(data, o);\n    const inputsCount = decoded;\n    [decoded, o] = new NumberCoder('u16', { padToWordSize: true }).decode(data, o);\n    const outputsCount = decoded;\n    [decoded, o] = new NumberCoder('u16', { padToWordSize: true }).decode(data, o);\n    const witnessesCount = decoded;\n    [decoded, o] = new ArrayCoder(new StorageSlotCoder(), storageSlotsCount.toNumber()).decode(\n      data,\n      o\n    );\n    const storageSlots = decoded;\n    [decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);\n    const policies = decoded;\n    [decoded, o] = new ArrayCoder(new InputCoder(), inputsCount).decode(data, o);\n    const inputs = decoded;\n    [decoded, o] = new ArrayCoder(new OutputCoder(), outputsCount).decode(data, o);\n    const outputs = decoded;\n    [decoded, o] = new ArrayCoder(new WitnessCoder(), witnessesCount).decode(data, o);\n    const witnesses = decoded;\n\n    return [\n      {\n        type: TransactionType.Create,\n        bytecodeWitnessIndex,\n        policyTypes,\n        storageSlotsCount,\n        inputsCount,\n        outputsCount,\n        witnessesCount,\n        salt,\n        policies,\n        storageSlots,\n        inputs,\n        outputs,\n        witnesses,\n      },\n      o,\n    ];\n  }\n}\n\nexport type TransactionMint = {\n  type: TransactionType.Mint;\n\n  /** The location of the Mint transaction in the block. */\n  txPointer: TxPointer;\n\n  /** The contract utxo that assets are minted to. */\n  inputContract: InputContract;\n\n  /** The contract utxo that assets are being minted to. */\n  outputContract: OutputContract;\n\n  /** The amount of funds minted. */\n  mintAmount: BN;\n\n  /** The asset ID corresponding to the minted amount. */\n  mintAssetId: string;\n\n  gasPrice: BN;\n};\n\nexport class TransactionMintCoder extends Coder<TransactionMint, TransactionMint> {\n  constructor() {\n    super('TransactionMint', 'struct TransactionMint', 0);\n  }\n\n  encode(value: TransactionMint): Uint8Array {\n    const parts: Uint8Array[] = [];\n\n    parts.push(new TxPointerCoder().encode(value.txPointer));\n    parts.push(new InputContractCoder().encode(value.inputContract));\n    parts.push(new OutputContractCoder().encode(value.outputContract));\n    parts.push(new BigNumberCoder('u64').encode(value.mintAmount));\n    parts.push(new B256Coder().encode(value.mintAssetId));\n    parts.push(new BigNumberCoder('u64').encode(value.gasPrice));\n\n    return concat(parts);\n  }\n\n  decode(data: Uint8Array, offset: number): [TransactionMint, number] {\n    let decoded;\n    let o = offset;\n\n    [decoded, o] = new TxPointerCoder().decode(data, o);\n    const txPointer = decoded;\n    [decoded, o] = new InputContractCoder().decode(data, o);\n    const inputContract = decoded;\n    [decoded, o] = new OutputContractCoder().decode(data, o);\n    const outputContract = decoded;\n    [decoded, o] = new BigNumberCoder('u64').decode(data, o);\n    const mintAmount = decoded;\n    [decoded, o] = new B256Coder().decode(data, o);\n    const mintAssetId = decoded;\n    [decoded, o] = new BigNumberCoder('u64').decode(data, o);\n    const gasPrice = decoded;\n\n    return [\n      {\n        type: TransactionType.Mint,\n        txPointer,\n        inputContract,\n        outputContract,\n        mintAmount,\n        mintAssetId,\n        gasPrice,\n      },\n      o,\n    ];\n  }\n}\n\nexport type TransactionUpgrade = BaseTransactionType & {\n  type: TransactionType.Upgrade;\n\n  /** The purpose of the upgrade. */\n  upgradePurpose: UpgradePurpose;\n};\n\nexport class TransactionUpgradeCoder extends Coder<TransactionUpgrade, TransactionUpgrade> {\n  constructor() {\n    super('TransactionUpgrade', 'struct TransactionUpgrade', 0);\n  }\n\n  encode(value: TransactionUpgrade): Uint8Array {\n    const parts: Uint8Array[] = [];\n\n    parts.push(new UpgradePurposeCoder().encode(value.upgradePurpose));\n    parts.push(new NumberCoder('u32', { padToWordSize: true }).encode(value.policyTypes));\n    parts.push(new NumberCoder('u16', { padToWordSize: true }).encode(value.inputsCount));\n    parts.push(new NumberCoder('u16', { padToWordSize: true }).encode(value.outputsCount));\n    parts.push(new NumberCoder('u16', { padToWordSize: true }).encode(value.witnessesCount));\n    parts.push(new PoliciesCoder().encode(value.policies));\n    parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));\n    parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));\n    parts.push(new ArrayCoder(new WitnessCoder(), value.witnessesCount).encode(value.witnesses));\n\n    return concat(parts);\n  }\n\n  decode(data: Uint8Array, offset: number): [TransactionUpgrade, number] {\n    let decoded;\n    let o = offset;\n\n    [decoded, o] = new UpgradePurposeCoder().decode(data, o);\n    const upgradePurpose = decoded;\n    [decoded, o] = new NumberCoder('u32', { padToWordSize: true }).decode(data, o);\n    const policyTypes = decoded;\n    [decoded, o] = new NumberCoder('u16', { padToWordSize: true }).decode(data, o);\n    const inputsCount = decoded;\n    [decoded, o] = new NumberCoder('u16', { padToWordSize: true }).decode(data, o);\n    const outputsCount = decoded;\n    [decoded, o] = new NumberCoder('u16', { padToWordSize: true }).decode(data, o);\n    const witnessesCount = decoded;\n    [decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);\n    const policies = decoded;\n    [decoded, o] = new ArrayCoder(new InputCoder(), inputsCount).decode(data, o);\n    const inputs = decoded;\n    [decoded, o] = new ArrayCoder(new OutputCoder(), outputsCount).decode(data, o);\n    const outputs = decoded;\n    [decoded, o] = new ArrayCoder(new WitnessCoder(), witnessesCount).decode(data, o);\n    const witnesses = decoded;\n\n    return [\n      {\n        type: TransactionType.Upgrade,\n        upgradePurpose,\n        policyTypes,\n        inputsCount,\n        outputsCount,\n        witnessesCount,\n        policies,\n        inputs,\n        outputs,\n        witnesses,\n      },\n      o,\n    ];\n  }\n}\n\nexport type TransactionUpload = BaseTransactionType & {\n  type: TransactionType.Upload;\n\n  /** The root of the Merkle tree is created over the bytecode. (b256) */\n  root: string;\n\n  /** Index of witness that authorizes spending the coin (u16) */\n  witnessIndex: number;\n\n  /** The index of the subsection of the bytecode. (u16) */\n  subsectionIndex: number;\n\n  /** The total number of subsections on which bytecode was divided. (u16) */\n  subsectionsNumber: number;\n\n  /** Number of Merkle nodes in the proof. (u16) */\n  proofSetCount: number;\n\n  /** List of proof nodes (b256[]) */\n  proofSet: string[];\n};\n\nexport class TransactionUploadCoder extends Coder<TransactionUpload, TransactionUpload> {\n  constructor() {\n    super('TransactionUpload', 'struct TransactionUpload', 0);\n  }\n\n  encode(value: TransactionUpload): Uint8Array {\n    const parts: Uint8Array[] = [];\n\n    parts.push(new B256Coder().encode(value.root));\n    parts.push(new NumberCoder('u16', { padToWordSize: true }).encode(value.witnessIndex));\n    parts.push(new NumberCoder('u16', { padToWordSize: true }).encode(value.subsectionIndex));\n    parts.push(new NumberCoder('u16', { padToWordSize: true }).encode(value.subsectionsNumber));\n    parts.push(new NumberCoder('u16', { padToWordSize: true }).encode(value.proofSetCount));\n    parts.push(new NumberCoder('u32', { padToWordSize: true }).encode(value.policyTypes));\n    parts.push(new NumberCoder('u16', { padToWordSize: true }).encode(value.inputsCount));\n    parts.push(new NumberCoder('u16', { padToWordSize: true }).encode(value.outputsCount));\n    parts.push(new NumberCoder('u16', { padToWordSize: true }).encode(value.witnessesCount));\n    parts.push(new ArrayCoder(new B256Coder(), value.proofSetCount).encode(value.proofSet));\n    parts.push(new PoliciesCoder().encode(value.policies));\n    parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));\n    parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));\n    parts.push(new ArrayCoder(new WitnessCoder(), value.witnessesCount).encode(value.witnesses));\n\n    return concat(parts);\n  }\n\n  decode(data: Uint8Array, offset: number): [TransactionUpload, number] {\n    let decoded;\n    let o = offset;\n\n    [decoded, o] = new B256Coder().decode(data, o);\n    const root = decoded;\n    [decoded, o] = new NumberCoder('u16', { padToWordSize: true }).decode(data, o);\n    const witnessIndex = decoded;\n    [decoded, o] = new NumberCoder('u16', { padToWordSize: true }).decode(data, o);\n    const subsectionIndex = decoded;\n    [decoded, o] = new NumberCoder('u16', { padToWordSize: true }).decode(data, o);\n    const subsectionsNumber = decoded;\n    [decoded, o] = new NumberCoder('u16', { padToWordSize: true }).decode(data, o);\n    const proofSetCount = decoded;\n    [decoded, o] = new NumberCoder('u32', { padToWordSize: true }).decode(data, o);\n    const policyTypes = decoded;\n    [decoded, o] = new NumberCoder('u16', { padToWordSize: true }).decode(data, o);\n    const inputsCount = decoded;\n    [decoded, o] = new NumberCoder('u16', { padToWordSize: true }).decode(data, o);\n    const outputsCount = decoded;\n    [decoded, o] = new NumberCoder('u16', { padToWordSize: true }).decode(data, o);\n    const witnessesCount = decoded;\n    [decoded, o] = new ArrayCoder(new B256Coder(), proofSetCount).decode(data, o);\n    const proofSet = decoded;\n    [decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);\n    const policies = decoded;\n    [decoded, o] = new ArrayCoder(new InputCoder(), inputsCount).decode(data, o);\n    const inputs = decoded;\n    [decoded, o] = new ArrayCoder(new OutputCoder(), outputsCount).decode(data, o);\n    const outputs = decoded;\n    [decoded, o] = new ArrayCoder(new WitnessCoder(), witnessesCount).decode(data, o);\n    const witnesses = decoded;\n\n    return [\n      {\n        type: TransactionType.Upload,\n        root,\n        witnessIndex,\n        subsectionIndex,\n        subsectionsNumber,\n        proofSetCount,\n        policyTypes,\n        inputsCount,\n        outputsCount,\n        witnessesCount,\n        proofSet,\n        policies,\n        inputs,\n        outputs,\n        witnesses,\n      },\n      o,\n    ];\n  }\n}\n\nexport type TransactionBlob = BaseTransactionType & {\n  type: TransactionType.Blob;\n\n  /** Hash of the bytecode. (b256) */\n  blobId: string;\n\n  /** Witness index of contract bytecode (u16) */\n  witnessIndex: number;\n};\n\nexport class TransactionBlobCoder extends Coder<TransactionBlob, TransactionBlob> {\n  constructor() {\n    super('TransactionBlob', 'struct TransactionBlob', 0);\n  }\n\n  encode(value: TransactionBlob): Uint8Array {\n    const parts: Uint8Array[] = [];\n\n    parts.push(new B256Coder().encode(value.blobId));\n    parts.push(new NumberCoder('u16', { padToWordSize: true }).encode(value.witnessIndex));\n    parts.push(new NumberCoder('u32', { padToWordSize: true }).encode(value.policyTypes));\n    parts.push(new NumberCoder('u16', { padToWordSize: true }).encode(value.inputsCount));\n    parts.push(new NumberCoder('u16', { padToWordSize: true }).encode(value.outputsCount));\n    parts.push(new NumberCoder('u16', { padToWordSize: true }).encode(value.witnessesCount));\n    parts.push(new PoliciesCoder().encode(value.policies));\n    parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));\n    parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));\n    parts.push(new ArrayCoder(new WitnessCoder(), value.witnessesCount).encode(value.witnesses));\n\n    return concat(parts);\n  }\n\n  decode(data: Uint8Array, offset: number): [TransactionBlob, number] {\n    let decoded;\n    let o = offset;\n\n    [decoded, o] = new B256Coder().decode(data, o);\n    const blobId = decoded;\n    [decoded, o] = new NumberCoder('u16', { padToWordSize: true }).decode(data, o);\n    const witnessIndex = decoded;\n    [decoded, o] = new NumberCoder('u32', { padToWordSize: true }).decode(data, o);\n    const policyTypes = decoded;\n    [decoded, o] = new NumberCoder('u16', { padToWordSize: true }).decode(data, o);\n    const inputsCount = decoded;\n    [decoded, o] = new NumberCoder('u16', { padToWordSize: true }).decode(data, o);\n    const outputsCount = decoded;\n    [decoded, o] = new NumberCoder('u16', { padToWordSize: true }).decode(data, o);\n    const witnessesCount = decoded;\n    [decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);\n    const policies = decoded;\n    [decoded, o] = new ArrayCoder(new InputCoder(), inputsCount).decode(data, o);\n    const inputs = decoded;\n    [decoded, o] = new ArrayCoder(new OutputCoder(), outputsCount).decode(data, o);\n    const outputs = decoded;\n    [decoded, o] = new ArrayCoder(new WitnessCoder(), witnessesCount).decode(data, o);\n    const witnesses = decoded;\n\n    return [\n      {\n        type: TransactionType.Blob,\n        blobId,\n        witnessIndex,\n        policyTypes,\n        inputsCount,\n        outputsCount,\n        witnessesCount,\n        policies,\n        inputs,\n        outputs,\n        witnesses,\n      },\n      o,\n    ];\n  }\n}\n\ntype PossibleTransactions =\n  | TransactionScript\n  | TransactionCreate\n  | TransactionMint\n  | TransactionUpgrade\n  | TransactionUpload\n  | TransactionBlob;\n\nexport type SubmittableTransactions =\n  | TransactionScript\n  | TransactionCreate\n  | TransactionUpgrade\n  | TransactionUpload\n  | TransactionBlob;\n\nexport type Transaction<TTransactionType = void> = TTransactionType extends TransactionType\n  ? Extract<PossibleTransactions, { type: TTransactionType }>\n  : Partial<Omit<TransactionScript, 'type'>> &\n      Partial<Omit<TransactionCreate, 'type'>> &\n      Partial<Omit<TransactionMint, 'type'>> &\n      Partial<Omit<TransactionUpgrade, 'type'>> &\n      Partial<Omit<TransactionUpload, 'type'>> &\n      Partial<Omit<TransactionBlob, 'type'>> & {\n        type: TransactionType;\n      };\n\nexport class TransactionCoder extends Coder<Transaction, Transaction> {\n  constructor() {\n    super('Transaction', 'struct Transaction', 0);\n  }\n\n  encode(value: Transaction): Uint8Array {\n    const parts: Uint8Array[] = [];\n\n    parts.push(new NumberCoder('u8', { padToWordSize: true }).encode(value.type));\n\n    const { type } = value;\n\n    switch (value.type) {\n      case TransactionType.Script: {\n        parts.push(\n          new TransactionScriptCoder().encode(value as Transaction<TransactionType.Script>)\n        );\n        break;\n      }\n      case TransactionType.Create: {\n        parts.push(\n          new TransactionCreateCoder().encode(value as Transaction<TransactionType.Create>)\n        );\n        break;\n      }\n      case TransactionType.Mint: {\n        parts.push(new TransactionMintCoder().encode(value as Transaction<TransactionType.Mint>));\n        break;\n      }\n      case TransactionType.Upgrade: {\n        parts.push(\n          new TransactionUpgradeCoder().encode(value as Transaction<TransactionType.Upgrade>)\n        );\n        break;\n      }\n      case TransactionType.Upload: {\n        parts.push(\n          new TransactionUploadCoder().encode(value as Transaction<TransactionType.Upload>)\n        );\n        break;\n      }\n      case TransactionType.Blob: {\n        parts.push(new TransactionBlobCoder().encode(value as Transaction<TransactionType.Blob>));\n        break;\n      }\n      default: {\n        throw new FuelError(\n          ErrorCode.UNSUPPORTED_TRANSACTION_TYPE,\n          `Unsupported transaction type: ${type}`\n        );\n      }\n    }\n\n    return concat(parts);\n  }\n\n  decode(data: Uint8Array, offset: number): [Transaction, number] {\n    let decoded;\n    let o = offset;\n\n    [decoded, o] = new NumberCoder('u8', { padToWordSize: true }).decode(data, o);\n    const type = decoded as TransactionType;\n\n    switch (type) {\n      case TransactionType.Script: {\n        [decoded, o] = new TransactionScriptCoder().decode(data, o);\n        return [decoded, o];\n      }\n      case TransactionType.Create: {\n        [decoded, o] = new TransactionCreateCoder().decode(data, o);\n        return [decoded, o];\n      }\n      case TransactionType.Mint: {\n        [decoded, o] = new TransactionMintCoder().decode(data, o);\n        return [decoded, o];\n      }\n      case TransactionType.Upgrade: {\n        [decoded, o] = new TransactionUpgradeCoder().decode(data, o);\n        return [decoded, o];\n      }\n      case TransactionType.Upload: {\n        [decoded, o] = new TransactionUploadCoder().decode(data, o);\n        return [decoded, o];\n      }\n      case TransactionType.Blob: {\n        [decoded, o] = new TransactionBlobCoder().decode(data, o);\n        return [decoded, o];\n      }\n      default: {\n        throw new FuelError(\n          ErrorCode.UNSUPPORTED_TRANSACTION_TYPE,\n          `Unsupported transaction type: ${type}`\n        );\n      }\n    }\n  }\n}\n","import { B256Coder, Coder, NumberCoder } from '@fuel-ts/abi-coder';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { concat } from '@fuel-ts/utils';\n\nexport enum UpgradePurposeTypeEnum {\n  ConsensusParameters = 0,\n  StateTransition = 1,\n}\n\nexport type UpgradePurpose =\n  | {\n      type: UpgradePurposeTypeEnum.ConsensusParameters;\n      data: ConsensusParameters;\n    }\n  | {\n      type: UpgradePurposeTypeEnum.StateTransition;\n      data: StateTransition;\n    };\n\nexport interface ConsensusParameters {\n  /** Index of witness that contains a serialized(with postcard) consensus parameters. (u16) */\n  witnessIndex: number;\n\n  /** The hash of the serialized consensus parameters. */\n  checksum: string;\n}\n\nexport interface StateTransition {\n  /** The root of the new bytecode of the state transition function. */\n  bytecodeRoot: string;\n}\n\nexport class UpgradePurposeCoder extends Coder<UpgradePurpose, UpgradePurpose> {\n  constructor() {\n    super('UpgradePurpose', 'UpgradePurpose', 0);\n  }\n\n  encode(upgradePurposeType: UpgradePurpose): Uint8Array {\n    const parts: Uint8Array[] = [];\n    const { type } = upgradePurposeType;\n\n    parts.push(new NumberCoder('u8', { padToWordSize: true }).encode(type));\n\n    switch (type) {\n      case UpgradePurposeTypeEnum.ConsensusParameters: {\n        const data = upgradePurposeType.data as ConsensusParameters;\n\n        parts.push(new NumberCoder('u16', { padToWordSize: true }).encode(data.witnessIndex));\n        parts.push(new B256Coder().encode(data.checksum));\n        break;\n      }\n\n      case UpgradePurposeTypeEnum.StateTransition: {\n        const data = upgradePurposeType.data as StateTransition;\n\n        parts.push(new B256Coder().encode(data.bytecodeRoot));\n        break;\n      }\n\n      default: {\n        throw new FuelError(\n          ErrorCode.UNSUPPORTED_TRANSACTION_TYPE,\n          `Unsupported transaction type: ${type}`\n        );\n      }\n    }\n\n    return concat(parts);\n  }\n\n  decode(data: Uint8Array, offset: number): [UpgradePurpose, number] {\n    let o = offset;\n    let decoded;\n\n    [decoded, o] = new NumberCoder('u8', { padToWordSize: true }).decode(data, o);\n    const type = decoded as UpgradePurposeTypeEnum;\n\n    switch (type) {\n      case UpgradePurposeTypeEnum.ConsensusParameters: {\n        [decoded, o] = new NumberCoder('u16', { padToWordSize: true }).decode(data, o);\n        const witnessIndex = decoded;\n        [decoded, o] = new B256Coder().decode(data, o);\n        const checksum = decoded;\n\n        return [{ type, data: { witnessIndex, checksum } }, o];\n      }\n\n      case UpgradePurposeTypeEnum.StateTransition: {\n        [decoded, o] = new B256Coder().decode(data, o);\n        const bytecodeRoot = decoded;\n\n        return [{ type, data: { bytecodeRoot } }, o];\n      }\n\n      default: {\n        throw new FuelError(\n          ErrorCode.UNSUPPORTED_TRANSACTION_TYPE,\n          `Unsupported transaction type: ${type}`\n        );\n      }\n    }\n  }\n}\n","import { Coder, NumberCoder } from '@fuel-ts/abi-coder';\nimport { concat } from '@fuel-ts/utils';\n\nimport { ByteArrayCoder } from './byte-array';\n\nexport type Witness = {\n  /** Length of witness data byte array */\n  dataLength: number;\n  /** Witness data (byte[]) */\n  data: string;\n};\n\nexport class WitnessCoder extends Coder<Witness, Witness> {\n  constructor() {\n    super(\n      'Witness',\n      // Types of dynamic length are not supported in the ABI\n      'unknown',\n      0\n    );\n  }\n\n  encode(value: Witness): Uint8Array {\n    const parts: Uint8Array[] = [];\n\n    parts.push(new NumberCoder('u32', { padToWordSize: true }).encode(value.dataLength));\n    parts.push(new ByteArrayCoder(value.dataLength).encode(value.data));\n\n    return concat(parts);\n  }\n\n  decode(data: Uint8Array, offset: number): [Witness, number] {\n    let decoded;\n    let o = offset;\n\n    [decoded, o] = new NumberCoder('u32', { padToWordSize: true }).decode(data, o);\n    const dataLength = decoded;\n    [decoded, o] = new ByteArrayCoder(dataLength).decode(data, o);\n    const witnessData = decoded;\n\n    return [\n      {\n        dataLength,\n        data: witnessData,\n      },\n      o,\n    ];\n  }\n}\n","import { B256Coder, NumberCoder, StructCoder } from '@fuel-ts/abi-coder';\n\nexport type UtxoId = {\n  /** Transaction ID (b256) */\n  transactionId: string;\n  /** Output index (u8) */\n  outputIndex: number;\n};\n\nexport class UtxoIdCoder extends StructCoder<{\n  transactionId: B256Coder;\n  outputIndex: NumberCoder;\n}> {\n  constructor() {\n    super('UtxoId', {\n      transactionId: new B256Coder(),\n      outputIndex: new NumberCoder('u16', { padToWordSize: true }),\n    });\n  }\n}\n"],"mappings":";;;;AACA,SAAS,SAAAA,QAAO,WAAW,eAAAC,cAAa,sBAAsB;AAC9D,SAAS,aAAAC,YAAW,aAAAC,kBAAiB;AACrC,SAAS,cAAc;AAGvB,SAAS,UAAAC,SAAQ,YAAAC,iBAAgB;;;ACNjC,SAAS,aAAa;AAEtB,SAAS,QAAQ,SAAS,gBAAgB;AAEnC,IAAM,iBAAN,cAA6B,MAAyB;AAAA,EAJ7D,OAI6D;AAAA;AAAA;AAAA,EAC3D;AAAA,EACA;AAAA,EAEA,YAAY,QAAgB;AAC1B,UAAM,iBAAiB,IAAK,SAAS,KAAM;AAC3C,UAAM,gBAAgB,SAAS;AAC/B;AAAA,MACE;AAAA;AAAA;AAAA;AAAA;AAAA,MAKA,SAAS,gBAAgB,CAAC;AAAA,MAC1B;AAAA,IACF;AACA,SAAK,SAAS;AACd,SAAK,iBAAiB;AAAA,EACxB;AAAA,EAEA,OAAO,OAA8B;AACnC,UAAM,QAAsB,CAAC;AAE7B,UAAM,OAAO,SAAS,KAAK;AAC3B,UAAM,KAAK,IAAI;AAEf,QAAI,KAA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CAAC;AAAA,MACpB;AAAA,MACA,KAAK,gBAAwB;AAC3B,SAAC,SAAS,CAAC,IAAI,IAAI,uBAAuB,EAAE,OAAO,MAAM,CAAC;AAC1D,eAAO,CAAC,SAAS,CAAC;AAAA,MACpB;AAAA,MACA,KAAK,cAAsB;AACzB,SAAC,SAAS,CAAC,IAAI,IAAI,qBAAqB,EAAE,OAAO,MAAM,CAAC;AACxD,eAAO,CAAC,SAAS,CAAC;AAAA,MACpB;AAAA,MACA,SAAS;AACP,cAAM,IAAIE;AAAA,UACRC,WAAU;AAAA,UACV,iCAAiC,IAAI;AAAA,QACvC;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;;;AG9rBA,SAAS,aAAAC,YAAW,eAAAC,cAAa,eAAAC,oBAAmB;AAS7C,IAAM,cAAN,cAA0BC,aAG9B;AAAA,EAZH,OAYG;AAAA;AAAA;AAAA,EACD,cAAc;AACZ,UAAM,UAAU;AAAA,MACd,eAAe,IAAIC,WAAU;AAAA,MAC7B,aAAa,IAAIC,aAAY,OAAO,EAAE,eAAe,KAAK,CAAC;AAAA,IAC7D,CAAC;AAAA,EACH;AACF;","names":["Coder","NumberCoder","ErrorCode","FuelError","concat","arrayify","InputType","Coder","NumberCoder","concat","arrayify","FuelError","ErrorCode","Coder","B256Coder","NumberCoder","BigNumberCoder","ErrorCode","FuelError","concat","OutputType","Coder","B256Coder","BigNumberCoder","concat","NumberCoder","FuelError","ErrorCode","BigNumberCoder","Coder","NumberCoder","ErrorCode","FuelError","concat","PolicyType","FuelError","ErrorCode","Coder","BigNumberCoder","NumberCoder","concat","BigNumberCoder","sha256","arrayify","concat","ReceiptType","arrayify","sha256","concat","BigNumberCoder","B256Coder","StructCoder","StructCoder","B256Coder","Coder","B256Coder","NumberCoder","BigNumberCoder","ErrorCode","FuelError","concat","B256Coder","Coder","NumberCoder","ErrorCode","FuelError","concat","UpgradePurposeTypeEnum","Coder","NumberCoder","B256Coder","FuelError","ErrorCode","concat","Coder","NumberCoder","concat","Coder","NumberCoder","concat","TransactionType","Coder","BigNumberCoder","B256Coder","NumberCoder","concat","FuelError","ErrorCode","B256Coder","NumberCoder","StructCoder","StructCoder","B256Coder","NumberCoder"]}