@fuel-ts/account 0.98.0 → 0.99.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/account.d.ts +4 -4
- package/dist/account.d.ts.map +1 -1
- package/dist/assets/asset-api.d.ts +69 -0
- package/dist/assets/asset-api.d.ts.map +1 -0
- package/dist/assets/assets.d.ts.map +1 -0
- package/dist/{providers/assets → assets}/index.d.ts +1 -0
- package/dist/assets/index.d.ts.map +1 -0
- package/dist/assets/types.d.ts.map +1 -0
- package/dist/assets/utils/fuelAssetsBaseUrl.d.ts +2 -0
- package/dist/assets/utils/fuelAssetsBaseUrl.d.ts.map +1 -0
- package/dist/assets/utils/index.d.ts.map +1 -0
- package/dist/{providers/assets → assets}/utils/network.d.ts +6 -6
- package/dist/assets/utils/network.d.ts.map +1 -0
- package/dist/assets/utils/resolveIconPaths.d.ts.map +1 -0
- package/dist/assets/utils/url.d.ts.map +1 -0
- package/dist/configs.d.ts +2 -2
- package/dist/configs.global.js.map +1 -1
- package/dist/configs.js.map +1 -1
- package/dist/configs.mjs.map +1 -1
- package/dist/connectors/fuel-connector.d.ts +1 -1
- package/dist/connectors/fuel-connector.d.ts.map +1 -1
- package/dist/connectors/types/events.d.ts +1 -1
- package/dist/connectors/types/events.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.global.js +14564 -14439
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +6423 -6303
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6461 -6347
- package/dist/index.mjs.map +1 -1
- package/dist/providers/__generated__/operations.d.ts +28 -6
- package/dist/providers/__generated__/operations.d.ts.map +1 -1
- package/dist/providers/fuel-graphql-subscriber.d.ts +1 -0
- package/dist/providers/fuel-graphql-subscriber.d.ts.map +1 -1
- package/dist/providers/index.d.ts +0 -1
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/provider.d.ts +43 -13
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/providers/transaction-request/transaction-request.d.ts +2 -2
- package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -1
- package/dist/providers/transaction-response/transaction-response.d.ts.map +1 -1
- package/dist/providers/utils/handle-gql-error-message.d.ts +5 -1
- package/dist/providers/utils/handle-gql-error-message.d.ts.map +1 -1
- package/dist/test-utils/wallet-config.d.ts +2 -1
- package/dist/test-utils/wallet-config.d.ts.map +1 -1
- package/dist/test-utils.global.js +205 -740
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +270 -822
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +195 -747
- package/dist/test-utils.mjs.map +1 -1
- package/dist/utils/deployScriptOrPredicate.d.ts.map +1 -1
- package/dist/utils/formatTransferToContractScriptData.d.ts.map +1 -1
- package/dist/utils/predicate-script-loader-instructions.d.ts +36 -1
- package/dist/utils/predicate-script-loader-instructions.d.ts.map +1 -1
- package/dist/wallet/keystore-wallet.d.ts +2 -2
- package/dist/wallet/keystore-wallet.d.ts.map +1 -1
- package/dist/wallet-manager/vaults/mnemonic-vault.d.ts +3 -2
- package/dist/wallet-manager/vaults/mnemonic-vault.d.ts.map +1 -1
- package/dist/wallet-manager/vaults/privatekey-vault.d.ts +2 -1
- package/dist/wallet-manager/vaults/privatekey-vault.d.ts.map +1 -1
- package/dist/wallet-manager/wallet-manager.d.ts +3 -3
- package/dist/wallet-manager/wallet-manager.d.ts.map +1 -1
- package/package.json +15 -16
- package/dist/providers/assets/assets.d.ts.map +0 -1
- package/dist/providers/assets/index.d.ts.map +0 -1
- package/dist/providers/assets/types.d.ts.map +0 -1
- package/dist/providers/assets/utils/fuelAssetsBaseUrl.d.ts +0 -2
- package/dist/providers/assets/utils/fuelAssetsBaseUrl.d.ts.map +0 -1
- package/dist/providers/assets/utils/index.d.ts.map +0 -1
- package/dist/providers/assets/utils/network.d.ts.map +0 -1
- package/dist/providers/assets/utils/resolveIconPaths.d.ts.map +0 -1
- package/dist/providers/assets/utils/url.d.ts.map +0 -1
- /package/dist/{providers/assets → assets}/assets.d.ts +0 -0
- /package/dist/{providers/assets → assets}/types.d.ts +0 -0
- /package/dist/{providers/assets → assets}/utils/index.d.ts +0 -0
- /package/dist/{providers/assets → assets}/utils/resolveIconPaths.d.ts +0 -0
- /package/dist/{providers/assets → assets}/utils/url.d.ts +0 -0
package/dist/index.mjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/account.ts","../src/providers/coin-quantity.ts","../src/providers/provider.ts","../src/providers/__generated__/operations.ts","../src/providers/fuel-graphql-subscriber.ts","../src/providers/resource-cache.ts","../src/providers/transaction-request/input.ts","../src/providers/transaction-request/output.ts","../src/providers/transaction-request/transaction-request.ts","../src/providers/message.ts","../src/providers/resource.ts","../src/providers/utils/receipts.ts","../src/providers/utils/block-explorer.ts","../src/providers/utils/gas.ts","../src/providers/utils/json.ts","../src/providers/utils/extract-tx-error.ts","../src/providers/transaction-request/errors.ts","../src/providers/transaction-request/helpers.ts","../src/providers/transaction-request/witness.ts","../src/providers/transaction-request/blob-transaction-request.ts","../src/providers/transaction-request/hash-transaction.ts","../src/providers/transaction-request/create-transaction-request.ts","../src/providers/transaction-request/storage-slot.ts","../src/providers/transaction-request/script-transaction-request.ts","../src/providers/transaction-request/scripts.ts","../src/providers/transaction-request/upgrade-transaction-request.ts","../src/providers/transaction-request/upload-transaction-request.ts","../src/providers/transaction-request/types.ts","../src/providers/transaction-request/utils.ts","../src/providers/transaction-response/transaction-response.ts","../src/providers/transaction-summary/assemble-transaction-summary.ts","../src/providers/transaction-summary/calculate-tx-fee-for-summary.ts","../src/providers/transaction-summary/operations.ts","../src/providers/transaction-summary/call.ts","../src/providers/transaction-summary/input.ts","../src/providers/transaction-summary/output.ts","../src/providers/transaction-summary/types.ts","../src/providers/transaction-summary/receipt.ts","../src/providers/transaction-summary/status.ts","../src/providers/transaction-response/getDecodedLogs.ts","../src/providers/utils/auto-retry-fetch.ts","../src/providers/utils/handle-gql-error-message.ts","../src/providers/utils/validate-pagination-args.ts","../src/providers/transaction-summary/get-transaction-summary.ts","../src/providers/chains.ts","../src/providers/assets/utils/network.ts","../src/providers/assets/utils/url.ts","../src/providers/assets/utils/resolveIconPaths.ts","../src/providers/assets/utils/fuelAssetsBaseUrl.ts","../src/providers/assets/assets.ts","../src/providers/utils/merge-quantities.ts","../src/types.ts","../src/utils/formatTransferToContractScriptData.ts","../src/wallet/base-wallet-unlocked.ts","../src/signer/signer.ts","../src/wallet/keystore-wallet.ts","../src/hdwallet/hdwallet.ts","../src/mnemonic/mnemonic.ts","../src/wordlists/words/english.ts","../src/wordlists/index.ts","../src/mnemonic/utils.ts","../src/wallet/wallets.ts","../src/wallet/wallet.ts","../src/wallet-manager/wallet-manager.ts","../src/wallet-manager/storages/memory-storage.ts","../src/wallet-manager/vaults/mnemonic-vault.ts","../src/wallet-manager/vaults/privatekey-vault.ts","../src/wallet-manager/types.ts","../src/predicate/predicate.ts","../src/utils/deployScriptOrPredicate.ts","../src/utils/predicate-script-loader-instructions.ts","../src/predicate/utils/getPredicateRoot.ts","../src/connectors/fuel.ts","../src/connectors/fuel-connector.ts","../src/connectors/types/connector-types.ts","../src/connectors/types/local-storage.ts","../src/connectors/utils/cache.ts","../src/connectors/utils/dispatch-fuel-connector-event.ts","../src/connectors/utils/promises.ts"],"sourcesContent":["import { UTXO_ID_LEN } from '@fuel-ts/abi-coder';\nimport type { WithAddress } from '@fuel-ts/address';\nimport { Address } from '@fuel-ts/address';\nimport { randomBytes } from '@fuel-ts/crypto';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport type { BigNumberish, BN } from '@fuel-ts/math';\nimport { bn } from '@fuel-ts/math';\nimport { InputType } from '@fuel-ts/transactions';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { arrayify, hexlify, isDefined } from '@fuel-ts/utils';\nimport { clone } from 'ramda';\n\nimport type { FuelConnector, FuelConnectorSendTxParams } from './connectors';\nimport type {\n TransactionRequest,\n CoinQuantityLike,\n CoinQuantity,\n Resource,\n ExcludeResourcesOption,\n Provider,\n ScriptTransactionRequestLike,\n TransactionCost,\n EstimateTransactionParams,\n CursorPaginationArgs,\n TransactionRequestLike,\n CallResult,\n GetCoinsResponse,\n GetMessagesResponse,\n GetBalancesResponse,\n Coin,\n TransactionCostParams,\n TransactionResponse,\n ProviderSendTxParams,\n} from './providers';\nimport {\n withdrawScript,\n ScriptTransactionRequest,\n transactionRequestify,\n addAmountToCoinQuantities,\n} from './providers';\nimport {\n cacheRequestInputsResourcesFromOwner,\n getAssetAmountInRequestInputs,\n isRequestInputCoin,\n isRequestInputMessageWithoutData,\n isRequestInputResource,\n} from './providers/transaction-request/helpers';\nimport { mergeQuantities } from './providers/utils/merge-quantities';\nimport { AbstractAccount } from './types';\nimport { assembleTransferToContractScript } from './utils/formatTransferToContractScriptData';\n\nexport type TxParamsType = Pick<\n ScriptTransactionRequestLike,\n 'gasLimit' | 'tip' | 'maturity' | 'maxFee' | 'witnessLimit'\n>;\n\nexport type TransferParams = {\n destination: string | Address;\n amount: BigNumberish;\n assetId: BytesLike;\n};\n\nexport type ContractTransferParams = {\n contractId: string | Address;\n amount: BigNumberish;\n assetId: BytesLike;\n};\n\nexport type AccountSendTxParams = ProviderSendTxParams & FuelConnectorSendTxParams;\n\nexport type EstimatedTxParams = Pick<\n TransactionCost,\n 'estimatedPredicates' | 'addedSignatures' | 'requiredQuantities' | 'updateMaxFee' | 'gasPrice'\n>;\nconst MAX_FUNDING_ATTEMPTS = 5;\n\nexport type FakeResources = Partial<Coin> & Required<Pick<Coin, 'amount' | 'assetId'>>;\n\n/**\n * `Account` provides an abstraction for interacting with accounts or wallets on the network.\n */\nexport class Account extends AbstractAccount implements WithAddress {\n /**\n * The address associated with the account.\n */\n readonly address: Address;\n\n /**\n * The provider used to interact with the network.\n */\n protected _provider?: Provider;\n\n /**\n * The connector for use with external wallets\n */\n protected _connector?: FuelConnector;\n\n /**\n * Creates a new Account instance.\n *\n * @param address - The address of the account.\n * @param provider - A Provider instance (optional).\n * @param connector - A FuelConnector instance (optional).\n */\n constructor(address: string | Address, provider?: Provider, connector?: FuelConnector) {\n super();\n this._provider = provider;\n this._connector = connector;\n this.address = Address.fromDynamicInput(address);\n }\n\n /**\n * The provider used to interact with the network.\n *\n * @returns A Provider instance.\n *\n * @throws `FuelError` if the provider is not set.\n */\n get provider(): Provider {\n if (!this._provider) {\n throw new FuelError(ErrorCode.MISSING_PROVIDER, 'Provider not set');\n }\n\n return this._provider;\n }\n\n /**\n * Sets the provider for the account.\n *\n * @param provider - A Provider instance.\n */\n set provider(provider: Provider) {\n this._provider = provider;\n }\n\n /**\n * Changes the provider connection for the account.\n *\n * @param provider - A Provider instance.\n * @returns The updated Provider instance.\n */\n connect(provider: Provider): Provider {\n this._provider = provider;\n return this.provider;\n }\n\n /**\n * Retrieves resources satisfying the spend query for the account.\n *\n * @param quantities - Quantities of resources to be obtained.\n * @param excludedIds - IDs of resources to be excluded from the query (optional).\n * @returns A promise that resolves to an array of Resources.\n */\n async getResourcesToSpend(\n quantities: CoinQuantityLike[],\n excludedIds?: ExcludeResourcesOption\n ): Promise<Resource[]> {\n return this.provider.getResourcesToSpend(this.address, quantities, excludedIds);\n }\n\n /**\n * Retrieves coins owned by the account.\n *\n * @param assetId - The asset ID of the coins to retrieve (optional).\n * @returns A promise that resolves to an array of Coins.\n */\n async getCoins(\n assetId?: BytesLike,\n paginationArgs?: CursorPaginationArgs\n ): Promise<GetCoinsResponse> {\n return this.provider.getCoins(this.address, assetId, paginationArgs);\n }\n\n /**\n * Retrieves messages owned by the account.\n *\n * @returns A promise that resolves to an array of Messages.\n */\n async getMessages(paginationArgs?: CursorPaginationArgs): Promise<GetMessagesResponse> {\n return this.provider.getMessages(this.address, paginationArgs);\n }\n\n /**\n * Retrieves the balance of the account for the given asset.\n *\n * @param assetId - The asset ID to check the balance for (optional).\n * @returns A promise that resolves to the balance amount.\n */\n async getBalance(assetId?: BytesLike): Promise<BN> {\n const assetIdToFetch = assetId ?? (await this.provider.getBaseAssetId());\n const amount = await this.provider.getBalance(this.address, assetIdToFetch);\n return amount;\n }\n\n /**\n * Retrieves all the balances for the account.\n *\n * @returns A promise that resolves to an array of Coins and their quantities.\n */\n async getBalances(): Promise<GetBalancesResponse> {\n return this.provider.getBalances(this.address);\n }\n\n /**\n * Funds a transaction request by adding the necessary resources.\n *\n * @typeParam T - The type of the TransactionRequest.\n * @param request - The transaction request to fund.\n * @param params - The estimated transaction parameters.\n * @returns A promise that resolves to the funded transaction request.\n */\n async fund<T extends TransactionRequest>(request: T, params: EstimatedTxParams): Promise<T> {\n const { addedSignatures, estimatedPredicates, requiredQuantities, updateMaxFee, gasPrice } =\n params;\n\n const fee = request.maxFee;\n const baseAssetId = await this.provider.getBaseAssetId();\n const requiredInBaseAsset =\n requiredQuantities.find((quantity) => quantity.assetId === baseAssetId)?.amount || bn(0);\n\n const requiredQuantitiesWithFee = addAmountToCoinQuantities({\n amount: bn(fee),\n assetId: baseAssetId,\n coinQuantities: requiredQuantities,\n });\n\n const quantitiesDict: Record<string, { required: BN; owned: BN }> = {};\n\n requiredQuantitiesWithFee.forEach(({ amount, assetId }) => {\n quantitiesDict[assetId] = {\n required: amount,\n owned: bn(0),\n };\n });\n\n request.inputs.filter(isRequestInputResource).forEach((input) => {\n const isCoin = isRequestInputCoin(input);\n const assetId = isCoin ? String(input.assetId) : baseAssetId;\n if (quantitiesDict[assetId]) {\n quantitiesDict[assetId].owned = quantitiesDict[assetId].owned.add(input.amount);\n }\n });\n\n let missingQuantities: CoinQuantity[] = [];\n Object.entries(quantitiesDict).forEach(([assetId, { owned, required }]) => {\n if (owned.lt(required)) {\n missingQuantities.push({\n assetId,\n amount: required.sub(owned),\n });\n }\n });\n\n let needsToBeFunded = missingQuantities.length > 0;\n let fundingAttempts = 0;\n while (needsToBeFunded && fundingAttempts < MAX_FUNDING_ATTEMPTS) {\n const resources = await this.getResourcesToSpend(\n missingQuantities,\n cacheRequestInputsResourcesFromOwner(request.inputs, this.address)\n );\n\n request.addResources(resources);\n request.updatePredicateGasUsed(estimatedPredicates);\n\n const requestToReestimate = clone(request);\n if (addedSignatures) {\n Array.from({ length: addedSignatures }).forEach(() =>\n requestToReestimate.addEmptyWitness()\n );\n }\n\n if (!updateMaxFee) {\n needsToBeFunded = false;\n break;\n }\n\n // Recalculate the fee after adding the resources\n const { maxFee: newFee } = await this.provider.estimateTxGasAndFee({\n transactionRequest: requestToReestimate,\n gasPrice,\n });\n\n const totalBaseAssetOnInputs = getAssetAmountInRequestInputs(\n request.inputs.filter(isRequestInputResource),\n baseAssetId,\n baseAssetId\n );\n\n // Update the new total as the fee will change after adding new resources\n const totalBaseAssetRequiredWithFee = requiredInBaseAsset.add(newFee);\n\n if (totalBaseAssetOnInputs.gt(totalBaseAssetRequiredWithFee)) {\n needsToBeFunded = false;\n } else {\n missingQuantities = [\n {\n amount: totalBaseAssetRequiredWithFee.sub(totalBaseAssetOnInputs),\n assetId: baseAssetId,\n },\n ];\n }\n\n fundingAttempts += 1;\n }\n\n // If the transaction still needs to be funded after the maximum number of attempts\n if (needsToBeFunded) {\n throw new FuelError(\n ErrorCode.NOT_ENOUGH_FUNDS,\n `The account ${this.address} does not have enough base asset funds to cover the transaction execution.`\n );\n }\n\n await this.provider.validateTransaction(request);\n\n request.updatePredicateGasUsed(estimatedPredicates);\n\n const requestToReestimate = clone(request);\n if (addedSignatures) {\n Array.from({ length: addedSignatures }).forEach(() => requestToReestimate.addEmptyWitness());\n }\n\n if (!updateMaxFee) {\n return request;\n }\n\n const { maxFee } = await this.provider.estimateTxGasAndFee({\n transactionRequest: requestToReestimate,\n gasPrice,\n });\n\n request.maxFee = maxFee;\n\n return request;\n }\n\n /**\n * A helper that creates a transfer transaction request and returns it.\n *\n * @param destination - The address of the destination.\n * @param amount - The amount of coins to transfer.\n * @param assetId - The asset ID of the coins to transfer (optional).\n * @param txParams - The transaction parameters (optional).\n * @returns A promise that resolves to the prepared transaction request.\n */\n async createTransfer(\n destination: string | Address,\n amount: BigNumberish,\n assetId?: BytesLike,\n txParams: TxParamsType = {}\n ): Promise<ScriptTransactionRequest> {\n let request = new ScriptTransactionRequest(txParams);\n\n request = this.addTransfer(request, {\n destination,\n amount,\n assetId: assetId || (await this.provider.getBaseAssetId()),\n });\n\n request = await this.estimateAndFundTransaction(request, txParams);\n\n return request;\n }\n\n /**\n * Transfers coins to a destination address.\n *\n * @param destination - The address of the destination.\n * @param amount - The amount of coins to transfer.\n * @param assetId - The asset ID of the coins to transfer (optional).\n * @param txParams - The transaction parameters (optional).\n * @returns A promise that resolves to the transaction response.\n */\n async transfer(\n destination: string | Address,\n amount: BigNumberish,\n assetId?: BytesLike,\n txParams: TxParamsType = {}\n ): Promise<TransactionResponse> {\n const request = await this.createTransfer(destination, amount, assetId, txParams);\n return this.sendTransaction(request, { estimateTxDependencies: false });\n }\n\n /**\n * Transfers multiple amounts of a token to multiple recipients.\n *\n * @param transferParams - An array of `TransferParams` objects representing the transfers to be made.\n * @param txParams - Optional transaction parameters.\n * @returns A promise that resolves to a `TransactionResponse` object representing the transaction result.\n */\n async batchTransfer(\n transferParams: TransferParams[],\n txParams: TxParamsType = {}\n ): Promise<TransactionResponse> {\n let request = new ScriptTransactionRequest(txParams);\n request = this.addBatchTransfer(request, transferParams);\n request = await this.estimateAndFundTransaction(request, txParams);\n return this.sendTransaction(request, { estimateTxDependencies: false });\n }\n\n /**\n * Adds a transfer to the given transaction request.\n *\n * @param request - The script transaction request to add transfers to.\n * @param transferParams - The object representing the transfer to be made.\n * @returns The updated transaction request with the added transfer.\n */\n addTransfer(request: ScriptTransactionRequest, transferParams: TransferParams) {\n const { destination, amount, assetId } = transferParams;\n this.validateTransferAmount(amount);\n request.addCoinOutput(Address.fromAddressOrString(destination), amount, assetId);\n return request;\n }\n\n /**\n * Adds multiple transfers to a script transaction request.\n *\n * @param request - The script transaction request to add transfers to.\n * @param transferParams - An array of `TransferParams` objects representing the transfers to be made.\n * @returns The updated script transaction request.\n */\n addBatchTransfer(request: ScriptTransactionRequest, transferParams: TransferParams[]) {\n transferParams.forEach(({ destination, amount, assetId }) => {\n this.addTransfer(request, {\n destination,\n amount,\n assetId,\n });\n });\n return request;\n }\n\n /**\n * Transfers coins to a contract address.\n *\n * @param contractId - The address of the contract.\n * @param amount - The amount of coins to transfer.\n * @param assetId - The asset ID of the coins to transfer (optional).\n * @param txParams - The transaction parameters (optional).\n * @returns A promise that resolves to the transaction response.\n */\n async transferToContract(\n contractId: string | Address,\n amount: BigNumberish,\n assetId: BytesLike,\n txParams: TxParamsType = {}\n ): Promise<TransactionResponse> {\n return this.batchTransferToContracts([{ amount, assetId, contractId }], txParams);\n }\n\n async batchTransferToContracts(\n contractTransferParams: ContractTransferParams[],\n txParams: TxParamsType = {}\n ): Promise<TransactionResponse> {\n let request = new ScriptTransactionRequest({\n ...txParams,\n });\n\n const quantities: CoinQuantity[] = [];\n\n const defaultAssetId = await this.provider.getBaseAssetId();\n\n const transferParams = contractTransferParams.map((transferParam) => {\n const amount = bn(transferParam.amount);\n const contractAddress = Address.fromAddressOrString(transferParam.contractId);\n\n const assetId = transferParam.assetId ? hexlify(transferParam.assetId) : defaultAssetId;\n\n if (amount.lte(0)) {\n throw new FuelError(\n ErrorCode.INVALID_TRANSFER_AMOUNT,\n 'Transfer amount must be a positive number.'\n );\n }\n\n request.addContractInputAndOutput(contractAddress);\n quantities.push({ amount, assetId });\n\n return {\n amount,\n contractId: contractAddress.toB256(),\n assetId,\n };\n });\n\n const { script, scriptData } = await assembleTransferToContractScript(transferParams);\n\n request.script = script;\n request.scriptData = scriptData;\n\n request = await this.estimateAndFundTransaction(request, txParams, { quantities });\n\n return this.sendTransaction(request);\n }\n\n /**\n * Withdraws an amount of the base asset to the base chain.\n *\n * @param recipient - Address of the recipient on the base chain.\n * @param amount - Amount of base asset.\n * @param txParams - The transaction parameters (optional).\n * @returns A promise that resolves to the transaction response.\n */\n async withdrawToBaseLayer(\n recipient: string | Address,\n amount: BigNumberish,\n txParams: TxParamsType = {}\n ): Promise<TransactionResponse> {\n const recipientAddress = Address.fromAddressOrString(recipient);\n // add recipient and amount to the transaction script code\n const recipientDataArray = arrayify(\n '0x'.concat(recipientAddress.toHexString().substring(2).padStart(64, '0'))\n );\n const amountDataArray = arrayify(\n '0x'.concat(bn(amount).toHex().substring(2).padStart(16, '0'))\n );\n const script = new Uint8Array([\n ...arrayify(withdrawScript.bytes),\n ...recipientDataArray,\n ...amountDataArray,\n ]);\n\n const params: ScriptTransactionRequestLike = { script, ...txParams };\n\n const baseAssetId = await this.provider.getBaseAssetId();\n let request = new ScriptTransactionRequest(params);\n const quantities = [{ amount: bn(amount), assetId: baseAssetId }];\n\n const txCost = await this.getTransactionCost(request, { quantities });\n\n request = this.validateGasLimitAndMaxFee({\n transactionRequest: request,\n gasUsed: txCost.gasUsed,\n maxFee: txCost.maxFee,\n txParams,\n });\n\n await this.fund(request, txCost);\n\n return this.sendTransaction(request);\n }\n\n /**\n * Returns a transaction cost to enable user\n * to set gasLimit and also reserve balance amounts\n * on the transaction.\n *\n * @param transactionRequestLike - The transaction request object.\n * @param transactionCostParams - The transaction cost parameters (optional).\n *\n * @returns A promise that resolves to the transaction cost object.\n */\n async getTransactionCost(\n transactionRequestLike: TransactionRequestLike,\n { signatureCallback, quantities = [] }: TransactionCostParams = {}\n ): Promise<TransactionCost> {\n const txRequestClone = clone(transactionRequestify(transactionRequestLike));\n const baseAssetId = await this.provider.getBaseAssetId();\n\n // Fund with fake UTXOs to avoid not enough funds error\n // Getting coin quantities from amounts being transferred\n const coinOutputsQuantities = txRequestClone.getCoinOutputsQuantities();\n // Combining coin quantities from amounts being transferred and forwarding to contracts\n const requiredQuantities = mergeQuantities(coinOutputsQuantities, quantities);\n // An arbitrary amount of the base asset is added to cover the transaction fee during dry runs\n const transactionFeeForDryRun = [{ assetId: baseAssetId, amount: bn('100000000000000000') }];\n\n const findAssetInput = (assetId: string) =>\n txRequestClone.inputs.find((input) => {\n if (input.type === InputType.Coin) {\n return input.assetId === assetId;\n }\n\n // We only consider the message input if it has no data.\n // Messages with `data` cannot fund the gas of a transaction.\n if (isRequestInputMessageWithoutData(input)) {\n return baseAssetId === assetId;\n }\n return false;\n });\n\n const updateAssetInput = (assetId: string, quantity: BN) => {\n const assetInput = findAssetInput(assetId);\n const usedQuantity = quantity;\n\n if (assetInput && 'amount' in assetInput) {\n assetInput.amount = usedQuantity;\n } else {\n txRequestClone.addResources(\n this.generateFakeResources([\n {\n amount: quantity,\n assetId,\n },\n ])\n );\n }\n };\n\n mergeQuantities(requiredQuantities, transactionFeeForDryRun).forEach(({ amount, assetId }) =>\n updateAssetInput(assetId, amount)\n );\n\n const txCost = await this.provider.getTransactionCost(txRequestClone, {\n signatureCallback,\n });\n\n return {\n ...txCost,\n requiredQuantities,\n };\n }\n\n /**\n * Sign a message from the account via the connector.\n *\n * @param message - the message to sign.\n * @returns a promise that resolves to the signature.\n *\n * @hidden\n */\n async signMessage(message: string): Promise<string> {\n if (!this._connector) {\n throw new FuelError(ErrorCode.MISSING_CONNECTOR, 'A connector is required to sign messages.');\n }\n return this._connector.signMessage(this.address.toString(), message);\n }\n\n /**\n * Signs a transaction from the account via the connector..\n *\n * @param transactionRequestLike - The transaction request to sign.\n * @returns A promise that resolves to the signature of the transaction.\n */\n async signTransaction(transactionRequestLike: TransactionRequestLike): Promise<string> {\n if (!this._connector) {\n throw new FuelError(\n ErrorCode.MISSING_CONNECTOR,\n 'A connector is required to sign transactions.'\n );\n }\n return this._connector.signTransaction(this.address.toString(), transactionRequestLike);\n }\n\n /**\n * Sends a transaction to the network.\n *\n * @param transactionRequestLike - The transaction request to be sent.\n * @param sendTransactionParams - The provider send transaction parameters (optional).\n * @returns A promise that resolves to the transaction response.\n */\n async sendTransaction(\n transactionRequestLike: TransactionRequestLike,\n { estimateTxDependencies = true, onBeforeSend, skipCustomFee = false }: AccountSendTxParams = {}\n ): Promise<TransactionResponse> {\n if (this._connector) {\n return this.provider.getTransactionResponse(\n await this._connector.sendTransaction(this.address.toString(), transactionRequestLike, {\n onBeforeSend,\n skipCustomFee,\n })\n );\n }\n const transactionRequest = transactionRequestify(transactionRequestLike);\n if (estimateTxDependencies) {\n await this.provider.estimateTxDependencies(transactionRequest);\n }\n return this.provider.sendTransaction(transactionRequest, {\n estimateTxDependencies: false,\n });\n }\n\n /**\n * Simulates a transaction.\n *\n * @param transactionRequestLike - The transaction request to be simulated.\n * @param estimateTxParams - The estimate transaction params (optional).\n * @returns A promise that resolves to the call result.\n */\n async simulateTransaction(\n transactionRequestLike: TransactionRequestLike,\n { estimateTxDependencies = true }: EstimateTransactionParams = {}\n ): Promise<CallResult> {\n const transactionRequest = transactionRequestify(transactionRequestLike);\n if (estimateTxDependencies) {\n await this.provider.estimateTxDependencies(transactionRequest);\n }\n return this.provider.simulate(transactionRequest, { estimateTxDependencies: false });\n }\n\n /**\n * Generates an array of fake resources based on the provided coins.\n *\n * @param coins - An array of `FakeResources` objects representing the coins.\n * @returns An array of `Resource` objects with generated properties.\n */\n generateFakeResources(coins: FakeResources[]): Array<Resource> {\n return coins.map((coin) => ({\n id: hexlify(randomBytes(UTXO_ID_LEN)),\n owner: this.address,\n blockCreated: bn(1),\n txCreatedIdx: bn(1),\n ...coin,\n }));\n }\n\n /** @hidden * */\n private validateTransferAmount(amount: BigNumberish) {\n if (bn(amount).lte(0)) {\n throw new FuelError(\n ErrorCode.INVALID_TRANSFER_AMOUNT,\n 'Transfer amount must be a positive number.'\n );\n }\n }\n\n /** @hidden * */\n private async estimateAndFundTransaction(\n transactionRequest: ScriptTransactionRequest,\n txParams: TxParamsType,\n costParams?: TransactionCostParams\n ) {\n let request = transactionRequest;\n const txCost = await this.getTransactionCost(request, costParams);\n request = this.validateGasLimitAndMaxFee({\n transactionRequest: request,\n gasUsed: txCost.gasUsed,\n maxFee: txCost.maxFee,\n txParams,\n });\n request = await this.fund(request, txCost);\n return request;\n }\n\n /** @hidden * */\n private validateGasLimitAndMaxFee({\n gasUsed,\n maxFee,\n transactionRequest,\n txParams: { gasLimit: setGasLimit, maxFee: setMaxFee },\n }: {\n gasUsed: BN;\n maxFee: BN;\n transactionRequest: ScriptTransactionRequest;\n txParams: Pick<TxParamsType, 'gasLimit' | 'maxFee'>;\n }) {\n const request = transactionRequestify(transactionRequest) as ScriptTransactionRequest;\n\n if (!isDefined(setGasLimit)) {\n request.gasLimit = gasUsed;\n } else if (gasUsed.gt(setGasLimit)) {\n throw new FuelError(\n ErrorCode.GAS_LIMIT_TOO_LOW,\n `Gas limit '${setGasLimit}' is lower than the required: '${gasUsed}'.`\n );\n }\n\n if (!isDefined(setMaxFee)) {\n request.maxFee = maxFee;\n } else if (maxFee.gt(setMaxFee)) {\n throw new FuelError(\n ErrorCode.MAX_FEE_TOO_LOW,\n `Max fee '${setMaxFee}' is lower than the required: '${maxFee}'.`\n );\n }\n\n return request;\n }\n}\n","import type { BigNumberish, BN } from '@fuel-ts/math';\nimport { bn } from '@fuel-ts/math';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { hexlify } from '@fuel-ts/utils';\n\nexport type CoinQuantityLike =\n | [amount: BigNumberish, assetId: BytesLike, max?: BigNumberish]\n | { amount: BigNumberish; assetId: BytesLike; max?: BigNumberish };\nexport type CoinQuantity = { amount: BN; assetId: string; max?: BN };\n\n/** @hidden */\nexport const coinQuantityfy = (coinQuantityLike: CoinQuantityLike): CoinQuantity => {\n let assetId;\n let amount;\n let max;\n if (Array.isArray(coinQuantityLike)) {\n amount = coinQuantityLike[0];\n assetId = coinQuantityLike[1];\n max = coinQuantityLike[2] ?? undefined;\n } else {\n amount = coinQuantityLike.amount;\n assetId = coinQuantityLike.assetId;\n max = coinQuantityLike.max ?? undefined;\n }\n\n const bnAmount = bn(amount);\n return {\n assetId: hexlify(assetId),\n amount: bnAmount.lt(1) ? bn(1) : bnAmount,\n max: max ? bn(max) : undefined,\n };\n};\n\nexport interface IAddAmountToAssetParams {\n assetId: string;\n amount: BN;\n coinQuantities: CoinQuantity[];\n}\n\nexport const addAmountToCoinQuantities = (params: IAddAmountToAssetParams): CoinQuantity[] => {\n const { amount, assetId } = params;\n\n const coinQuantities = [...params.coinQuantities];\n\n const assetIdx = coinQuantities.findIndex((coinQuantity) => coinQuantity.assetId === assetId);\n\n if (assetIdx !== -1) {\n coinQuantities[assetIdx].amount = coinQuantities[assetIdx].amount.add(amount);\n } else {\n coinQuantities.push({ assetId, amount });\n }\n\n return coinQuantities;\n};\n","import { Address } from '@fuel-ts/address';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { BN, bn } from '@fuel-ts/math';\nimport type { Transaction } from '@fuel-ts/transactions';\nimport { InputType, InputMessageCoder, TransactionCoder } from '@fuel-ts/transactions';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { arrayify, hexlify, DateTime, isDefined } from '@fuel-ts/utils';\nimport { checkFuelCoreVersionCompatibility, versions } from '@fuel-ts/versions';\nimport { equalBytes } from '@noble/curves/abstract/utils';\nimport type { DocumentNode } from 'graphql';\nimport { GraphQLClient } from 'graphql-request';\nimport type { GraphQLClientResponse, GraphQLResponse } from 'graphql-request/src/types';\nimport gql from 'graphql-tag';\nimport { clone } from 'ramda';\n\nimport { getSdk as getOperationsSdk } from './__generated__/operations';\nimport type {\n GqlChainInfoFragment,\n GqlConsensusParametersVersion,\n GqlContractParameters as ContractParameters,\n GqlDryRunFailureStatusFragment,\n GqlDryRunSuccessStatusFragment,\n GqlFeeParameters as FeeParameters,\n GqlGasCostsFragment as GasCosts,\n GqlPredicateParameters as PredicateParameters,\n GqlScriptParameters as ScriptParameters,\n GqlTxParameters as TxParameters,\n GqlPageInfo,\n GqlRelayedTransactionFailed,\n Requester,\n GqlBlockFragment,\n} from './__generated__/operations';\nimport type { Coin } from './coin';\nimport type { CoinQuantity, CoinQuantityLike } from './coin-quantity';\nimport { coinQuantityfy } from './coin-quantity';\nimport { FuelGraphqlSubscriber } from './fuel-graphql-subscriber';\nimport type { Message, MessageCoin, MessageProof, MessageStatus } from './message';\nimport type { ExcludeResourcesOption, Resource } from './resource';\nimport { ResourceCache } from './resource-cache';\nimport type {\n TransactionRequestLike,\n TransactionRequest,\n TransactionRequestInput,\n CoinTransactionRequestInput,\n JsonAbisFromAllCalls,\n ScriptTransactionRequest,\n} from './transaction-request';\nimport {\n isTransactionTypeCreate,\n isTransactionTypeScript,\n transactionRequestify,\n validateTransactionForAssetBurn,\n} from './transaction-request';\nimport type { TransactionResultReceipt } from './transaction-response';\nimport { TransactionResponse, getDecodedLogs } from './transaction-response';\nimport { processGqlReceipt } from './transaction-summary/receipt';\nimport {\n calculateGasFee,\n extractTxError,\n getGasUsedFromReceipts,\n getReceiptsWithMissingData,\n} from './utils';\nimport type { RetryOptions } from './utils/auto-retry-fetch';\nimport { autoRetryFetch } from './utils/auto-retry-fetch';\nimport { handleGqlErrorMessage } from './utils/handle-gql-error-message';\nimport { validatePaginationArgs } from './utils/validate-pagination-args';\n\nconst MAX_RETRIES = 10;\n\nexport const RESOURCES_PAGE_SIZE_LIMIT = 512;\nexport const TRANSACTIONS_PAGE_SIZE_LIMIT = 60;\nexport const BLOCKS_PAGE_SIZE_LIMIT = 5;\nexport const DEFAULT_RESOURCE_CACHE_TTL = 20_000; // 20 seconds\nexport const GAS_USED_MODIFIER = 1.2;\n\nexport type DryRunFailureStatusFragment = GqlDryRunFailureStatusFragment;\nexport type DryRunSuccessStatusFragment = GqlDryRunSuccessStatusFragment;\n\nexport type DryRunStatus = DryRunFailureStatusFragment | DryRunSuccessStatusFragment;\n\nexport type CallResult = {\n receipts: TransactionResultReceipt[];\n dryRunStatus?: DryRunStatus;\n};\n\nexport type EstimateTxDependenciesReturns = CallResult & {\n outputVariables: number;\n missingContractIds: string[];\n};\n\n/**\n * A Fuel block\n */\nexport type Block = {\n id: string;\n height: BN;\n time: string;\n transactionIds: string[];\n header: {\n daHeight: BN;\n stateTransitionBytecodeVersion: string;\n transactionsCount: string;\n transactionsRoot: string;\n messageOutboxRoot: string;\n eventInboxRoot: string;\n prevRoot: string;\n applicationHash: string;\n };\n};\n\nexport type PageInfo = GqlPageInfo;\n\nexport type GetCoinsResponse = {\n coins: Coin[];\n pageInfo: PageInfo;\n};\n\nexport type GetMessagesResponse = {\n messages: Message[];\n pageInfo: PageInfo;\n};\n\nexport type GetBalancesResponse = {\n balances: CoinQuantity[];\n};\n\nexport type GetTransactionsResponse = {\n transactions: Transaction[];\n pageInfo: PageInfo;\n};\n\nexport type GetBlocksResponse = {\n blocks: Block[];\n pageInfo: PageInfo;\n};\n\n/**\n * Deployed Contract bytecode and contract id\n */\nexport type ContractResult = {\n id: string;\n bytecode: string;\n};\n\ntype ModifyStringToBN<T> = {\n [P in keyof T]: P extends 'version' ? T[P] : T[P] extends string ? BN : T[P];\n};\n\nexport {\n GasCosts,\n FeeParameters,\n ContractParameters,\n PredicateParameters,\n ScriptParameters,\n TxParameters,\n};\n\nexport type ConsensusParameters = {\n version: GqlConsensusParametersVersion;\n chainId: BN;\n baseAssetId: string;\n feeParameters: ModifyStringToBN<FeeParameters>;\n contractParameters: ModifyStringToBN<ContractParameters>;\n predicateParameters: ModifyStringToBN<PredicateParameters>;\n scriptParameters: ModifyStringToBN<ScriptParameters>;\n txParameters: ModifyStringToBN<TxParameters>;\n gasCosts: GasCosts;\n};\n\n/**\n * Chain information\n */\nexport type ChainInfo = {\n name: string;\n baseChainHeight: BN;\n consensusParameters: ConsensusParameters;\n};\n\n/**\n * Node information\n */\nexport type NodeInfo = {\n utxoValidation: boolean;\n vmBacktrace: boolean;\n maxTx: BN;\n maxDepth: BN;\n nodeVersion: string;\n};\n\nexport type NodeInfoAndConsensusParameters = {\n nodeVersion: string;\n gasPerByte: BN;\n gasPriceFactor: BN;\n maxGasPerTx: BN;\n};\n\n// #region cost-estimation-1\nexport type TransactionCost = {\n gasPrice: BN;\n gasUsed: BN;\n minGas: BN;\n minFee: BN;\n maxFee: BN;\n maxGas: BN;\n receipts: TransactionResultReceipt[];\n outputVariables: number;\n missingContractIds: string[];\n estimatedPredicates: TransactionRequestInput[];\n requiredQuantities: CoinQuantity[];\n addedSignatures: number;\n dryRunStatus?: DryRunStatus;\n updateMaxFee?: boolean;\n};\n// #endregion cost-estimation-1\n\nconst processGqlChain = (chain: GqlChainInfoFragment): ChainInfo => {\n const { name, daHeight, consensusParameters } = chain;\n\n const {\n contractParams,\n feeParams,\n predicateParams,\n scriptParams,\n txParams,\n gasCosts,\n baseAssetId,\n chainId,\n version,\n } = consensusParameters;\n\n return {\n name,\n baseChainHeight: bn(daHeight),\n consensusParameters: {\n version,\n chainId: bn(chainId),\n baseAssetId,\n feeParameters: {\n version: feeParams.version,\n gasPerByte: bn(feeParams.gasPerByte),\n gasPriceFactor: bn(feeParams.gasPriceFactor),\n },\n contractParameters: {\n version: contractParams.version,\n contractMaxSize: bn(contractParams.contractMaxSize),\n maxStorageSlots: bn(contractParams.maxStorageSlots),\n },\n txParameters: {\n version: txParams.version,\n maxInputs: bn(txParams.maxInputs),\n maxOutputs: bn(txParams.maxOutputs),\n maxWitnesses: bn(txParams.maxWitnesses),\n maxGasPerTx: bn(txParams.maxGasPerTx),\n maxSize: bn(txParams.maxSize),\n maxBytecodeSubsections: bn(txParams.maxBytecodeSubsections),\n },\n predicateParameters: {\n version: predicateParams.version,\n maxPredicateLength: bn(predicateParams.maxPredicateLength),\n maxPredicateDataLength: bn(predicateParams.maxPredicateDataLength),\n maxGasPerPredicate: bn(predicateParams.maxGasPerPredicate),\n maxMessageDataLength: bn(predicateParams.maxMessageDataLength),\n },\n scriptParameters: {\n version: scriptParams.version,\n maxScriptLength: bn(scriptParams.maxScriptLength),\n maxScriptDataLength: bn(scriptParams.maxScriptDataLength),\n },\n gasCosts,\n },\n };\n};\n\n/**\n * @hidden\n *\n * Cursor pagination arguments\n *\n * https://relay.dev/graphql/connections.htm#sec-Arguments\n */\nexport type CursorPaginationArgs = {\n /** Forward pagination limit */\n first?: number | null;\n /** Forward pagination cursor */\n after?: string | null;\n /** Backward pagination limit */\n last?: number | null;\n /** Backward pagination cursor */\n before?: string | null;\n};\n\n/*\n * Provider initialization options\n */\nexport type ProviderOptions = {\n /**\n * Custom fetch function to use for making requests.\n */\n fetch?: (\n url: string,\n requestInit?: RequestInit,\n providerOptions?: Omit<ProviderOptions, 'fetch'>\n ) => Promise<Response>;\n /**\n * Timeout [ms] after which every request will be aborted.\n */\n timeout?: number;\n /**\n * Resources cache for the given time [ms]. If set to -1, the cache will be disabled.\n */\n resourceCacheTTL?: number;\n /**\n * Retry options to use when fetching data from the node.\n */\n retryOptions?: RetryOptions;\n /**\n * Custom headers to include in the request.\n */\n headers?: RequestInit['headers'];\n /**\n * Middleware to modify the request before it is sent.\n * This can be used to add headers, modify the body, etc.\n */\n requestMiddleware?: (request: RequestInit) => RequestInit | Promise<RequestInit>;\n};\n\n/**\n * UTXO validation params\n */\nexport type UTXOValidationParams = {\n utxoValidation?: boolean;\n};\n\n/**\n * Transaction estimation params\n */\nexport type EstimateTransactionParams = {\n /**\n * Estimate the transaction dependencies.\n */\n estimateTxDependencies?: boolean;\n};\n\nexport type TransactionCostParams = EstimateTransactionParams & {\n /**\n * The quantities to forward to the contract.\n */\n quantities?: CoinQuantity[];\n\n /**\n * A callback to sign the transaction.\n *\n * @param request - The transaction request to sign.\n * @returns A promise that resolves to the signed transaction request.\n */\n signatureCallback?: (request: ScriptTransactionRequest) => Promise<ScriptTransactionRequest>;\n};\n\n/**\n * Provider Call transaction params\n */\nexport type ProviderCallParams = UTXOValidationParams & EstimateTransactionParams;\n\n/**\n * Provider Send transaction params\n */\nexport type ProviderSendTxParams = EstimateTransactionParams & {\n /**\n * Whether to enable asset burn for the transaction.\n */\n enableAssetBurn?: boolean;\n};\n\n/**\n * URL - Consensus Params mapping.\n */\ntype ChainInfoCache = Record<string, ChainInfo>;\n\n/**\n * URL - Node Info mapping.\n */\ntype NodeInfoCache = Record<string, NodeInfo>;\n\ntype Operations = ReturnType<typeof getOperationsSdk>;\n\ntype SdkOperations = Omit<Operations, 'statusChange' | 'submitAndAwaitStatus'> & {\n statusChange: (\n ...args: Parameters<Operations['statusChange']>\n ) => Promise<ReturnType<Operations['statusChange']>>;\n submitAndAwaitStatus: (\n ...args: Parameters<Operations['submitAndAwaitStatus']>\n ) => Promise<ReturnType<Operations['submitAndAwaitStatus']>>;\n getBlobs: (variables: { blobIds: string[] }) => Promise<{ blob: { id: string } | null }[]>;\n};\n\n/**\n * A provider for connecting to a node\n */\nexport default class Provider {\n operations: SdkOperations;\n cache?: ResourceCache;\n\n /** @hidden */\n static clearChainAndNodeCaches() {\n Provider.nodeInfoCache = {};\n Provider.chainInfoCache = {};\n }\n\n /** @hidden */\n public url: string;\n /** @hidden */\n private urlWithoutAuth: string;\n /** @hidden */\n private static chainInfoCache: ChainInfoCache = {};\n /** @hidden */\n private static nodeInfoCache: NodeInfoCache = {};\n\n /** @hidden */\n public consensusParametersTimestamp?: number;\n\n options: ProviderOptions = {\n timeout: undefined,\n resourceCacheTTL: undefined,\n fetch: undefined,\n retryOptions: undefined,\n headers: undefined,\n };\n\n /**\n * @hidden\n */\n private static getFetchFn(options: ProviderOptions): NonNullable<ProviderOptions['fetch']> {\n const { retryOptions, timeout, headers } = options;\n\n return autoRetryFetch(async (...args) => {\n const url = args[0];\n const request = args[1];\n const signal = timeout ? AbortSignal.timeout(timeout) : undefined;\n\n let fullRequest: RequestInit = {\n ...request,\n signal,\n headers: { ...request?.headers, ...headers },\n };\n\n if (options.requestMiddleware) {\n fullRequest = await options.requestMiddleware(fullRequest);\n }\n\n return options.fetch ? options.fetch(url, fullRequest, options) : fetch(url, fullRequest);\n }, retryOptions);\n }\n\n /**\n * Constructor to initialize a Provider.\n *\n * @param url - GraphQL endpoint of the Fuel node\n * @param options - Additional options for the provider\n * @hidden\n */\n constructor(url: string, options: ProviderOptions = {}) {\n const { url: rawUrl, urlWithoutAuth, headers: authHeaders } = Provider.extractBasicAuth(url);\n\n this.url = rawUrl;\n this.urlWithoutAuth = urlWithoutAuth;\n this.url = url;\n\n const { FUELS } = versions;\n const headers = { ...authHeaders, ...options.headers, Source: `ts-sdk-${FUELS}` };\n\n this.options = {\n ...this.options,\n ...options,\n headers,\n };\n\n this.operations = this.createOperations();\n const { resourceCacheTTL } = this.options;\n if (isDefined(resourceCacheTTL)) {\n if (resourceCacheTTL !== -1) {\n this.cache = new ResourceCache(resourceCacheTTL);\n } else {\n this.cache = undefined;\n }\n } else {\n this.cache = new ResourceCache(DEFAULT_RESOURCE_CACHE_TTL);\n }\n }\n\n private static extractBasicAuth(url: string): {\n url: string;\n urlWithoutAuth: string;\n headers: ProviderOptions['headers'];\n } {\n let parsedUrl: URL;\n try {\n parsedUrl = new URL(url);\n } catch (error) {\n throw new FuelError(FuelError.CODES.INVALID_URL, 'Invalid URL provided.', { url }, error);\n }\n\n const username = parsedUrl.username;\n const password = parsedUrl.password;\n const urlWithoutAuth = `${parsedUrl.origin}${parsedUrl.pathname}`;\n if (!(username && password)) {\n return { url, urlWithoutAuth: url, headers: undefined };\n }\n\n return {\n url,\n urlWithoutAuth,\n headers: { Authorization: `Basic ${btoa(`${username}:${password}`)}` },\n };\n }\n\n /**\n * Initialize Provider async stuff\n */\n async init(): Promise<Provider> {\n await this.fetchChainAndNodeInfo();\n return this;\n }\n\n /**\n * Returns the `chainInfo` for the current network.\n *\n * @returns the chain information configuration.\n */\n async getChain(): Promise<ChainInfo> {\n await this.init();\n return Provider.chainInfoCache[this.urlWithoutAuth];\n }\n\n /**\n * Returns the `nodeInfo` for the current network.\n *\n * @returns the node information configuration.\n */\n async getNode(): Promise<NodeInfo> {\n await this.init();\n return Provider.nodeInfoCache[this.urlWithoutAuth];\n }\n\n /**\n * Returns some helpful parameters related to gas fees.\n */\n async getGasConfig() {\n const {\n txParameters: { maxGasPerTx },\n predicateParameters: { maxGasPerPredicate },\n feeParameters: { gasPriceFactor, gasPerByte },\n gasCosts,\n } = (await this.getChain()).consensusParameters;\n\n return {\n maxGasPerTx,\n maxGasPerPredicate,\n gasPriceFactor,\n gasPerByte,\n gasCosts,\n };\n }\n\n /**\n * Updates the URL for the provider and fetches the consensus parameters for the new URL, if needed.\n *\n * @param url - The URL to connect to.\n * @param options - Additional options for the provider.\n */\n async connect(url: string, options?: ProviderOptions): Promise<void> {\n const { url: rawUrl, urlWithoutAuth, headers } = Provider.extractBasicAuth(url);\n\n this.url = rawUrl;\n this.urlWithoutAuth = urlWithoutAuth;\n this.options = options ?? this.options;\n this.options = { ...this.options, headers: { ...this.options.headers, ...headers } };\n\n this.operations = this.createOperations();\n\n await this.init();\n }\n\n /**\n * Return the chain and node information.\n * @param ignoreCache - If true, ignores the cache and re-fetch configs.\n * @returns A promise that resolves to the Chain and NodeInfo.\n */\n async fetchChainAndNodeInfo(ignoreCache: boolean = false) {\n let nodeInfo: NodeInfo;\n let chain: ChainInfo;\n\n try {\n nodeInfo = Provider.nodeInfoCache[this.urlWithoutAuth];\n chain = Provider.chainInfoCache[this.urlWithoutAuth];\n\n const noCache = !nodeInfo || !chain;\n\n if (ignoreCache || noCache) {\n throw new Error(`Jumps to the catch block and re-fetch`);\n }\n } catch (_err) {\n const data = await this.operations.getChainAndNodeInfo();\n\n nodeInfo = {\n maxDepth: bn(data.nodeInfo.maxDepth),\n maxTx: bn(data.nodeInfo.maxTx),\n nodeVersion: data.nodeInfo.nodeVersion,\n utxoValidation: data.nodeInfo.utxoValidation,\n vmBacktrace: data.nodeInfo.vmBacktrace,\n };\n\n Provider.ensureClientVersionIsSupported(nodeInfo);\n\n chain = processGqlChain(data.chain);\n\n Provider.chainInfoCache[this.urlWithoutAuth] = chain;\n Provider.nodeInfoCache[this.urlWithoutAuth] = nodeInfo;\n\n this.consensusParametersTimestamp = Date.now();\n }\n\n return {\n chain,\n nodeInfo,\n };\n }\n\n /**\n * @hidden\n */\n private static ensureClientVersionIsSupported(nodeInfo: NodeInfo) {\n const { isMajorSupported, isMinorSupported, supportedVersion } =\n checkFuelCoreVersionCompatibility(nodeInfo.nodeVersion);\n\n if (!isMajorSupported || !isMinorSupported) {\n // eslint-disable-next-line no-console\n console.warn(\n `The Fuel Node that you are trying to connect to is using fuel-core version ${nodeInfo.nodeVersion},\nwhich is not supported by the version of the TS SDK that you are using.\nThings may not work as expected.\nSupported fuel-core version: ${supportedVersion}.`\n );\n }\n }\n\n /**\n * Create GraphQL client and set operations.\n *\n * @returns The operation SDK object\n * @hidden\n */\n private createOperations(): SdkOperations {\n const fetchFn = Provider.getFetchFn(this.options);\n const gqlClient = new GraphQLClient(this.urlWithoutAuth, {\n fetch: (input: RequestInfo | URL, requestInit?: RequestInit) =>\n fetchFn(input.toString(), requestInit || {}, this.options),\n responseMiddleware: (response: GraphQLClientResponse<unknown> | Error) => {\n if ('response' in response) {\n const graphQlResponse = response.response as GraphQLResponse;\n\n if (Array.isArray(graphQlResponse?.errors)) {\n for (const error of graphQlResponse.errors) {\n handleGqlErrorMessage(error.message, error);\n }\n }\n }\n },\n });\n\n const executeQuery = (query: DocumentNode, vars: Record<string, unknown>) => {\n const opDefinition = query.definitions.find((x) => x.kind === 'OperationDefinition') as {\n operation: string;\n };\n const isSubscription = opDefinition?.operation === 'subscription';\n\n if (isSubscription) {\n return FuelGraphqlSubscriber.create({\n url: this.urlWithoutAuth,\n query,\n fetchFn: (url, requestInit) => fetchFn(url as string, requestInit, this.options),\n variables: vars,\n });\n }\n return gqlClient.request(query, vars);\n };\n\n const customOperations = (requester: Requester) => ({\n getBlobs(variables: { blobIds: string[] }) {\n const queryParams = variables.blobIds.map((_, i) => `$blobId${i}: BlobId!`).join(', ');\n const blobParams = variables.blobIds\n .map((_, i) => `blob${i}: blob(id: $blobId${i}) { id }`)\n .join('\\n');\n\n const updatedVariables = variables.blobIds.reduce(\n (acc, blobId, i) => {\n acc[`blobId${i}`] = blobId;\n return acc;\n },\n {} as Record<string, string>\n );\n\n const document = gql`\n query getBlobs(${queryParams}) {\n ${blobParams}\n }\n `;\n\n return requester(document, updatedVariables);\n },\n });\n\n // @ts-expect-error This is due to this function being generic. Its type is specified when calling a specific operation via provider.operations.xyz.\n return { ...getOperationsSdk(executeQuery), ...customOperations(executeQuery) };\n }\n\n /**\n * Returns the version of the connected node.\n *\n * @returns A promise that resolves to the version string.\n */\n async getVersion(): Promise<string> {\n const {\n nodeInfo: { nodeVersion },\n } = await this.operations.getVersion();\n return nodeVersion;\n }\n\n /**\n * Returns the latest block number.\n *\n * @returns A promise that resolves to the latest block number.\n */\n async getBlockNumber(): Promise<BN> {\n const {\n chain: {\n latestBlock: { height },\n },\n } = await this.operations.getLatestBlockHeight();\n return bn(height);\n }\n\n /**\n * Returns the node information for the current provider network.\n *\n * @returns a promise that resolves to the node information.\n */\n async fetchNode(): Promise<NodeInfo> {\n const { nodeInfo } = await this.operations.getNodeInfo();\n\n const processedNodeInfo: NodeInfo = {\n maxDepth: bn(nodeInfo.maxDepth),\n maxTx: bn(nodeInfo.maxTx),\n nodeVersion: nodeInfo.nodeVersion,\n utxoValidation: nodeInfo.utxoValidation,\n vmBacktrace: nodeInfo.vmBacktrace,\n };\n\n Provider.nodeInfoCache[this.urlWithoutAuth] = processedNodeInfo;\n\n return processedNodeInfo;\n }\n\n /**\n * Returns the chain information for the current provider network.\n *\n * @returns a promise that resolves to the chain information.\n */\n async fetchChain(): Promise<ChainInfo> {\n const { chain } = await this.operations.getChain();\n\n const processedChain = processGqlChain(chain);\n\n Provider.chainInfoCache[this.urlWithoutAuth] = processedChain;\n\n return processedChain;\n }\n\n /**\n * Returns the chain ID for the current provider network.\n *\n * @returns A promise that resolves to the chain ID number.\n */\n async getChainId() {\n const {\n consensusParameters: { chainId },\n } = await this.getChain();\n return chainId.toNumber();\n }\n\n /**\n * Returns the base asset ID for the current provider network.\n *\n * @returns the base asset ID.\n */\n async getBaseAssetId() {\n const all = await this.getChain();\n const {\n consensusParameters: { baseAssetId },\n } = all;\n return baseAssetId;\n }\n\n /**\n * @hidden\n */\n #cacheInputs(inputs: TransactionRequestInput[], transactionId: string): void {\n if (!this.cache) {\n return;\n }\n\n const inputsToCache = inputs.reduce(\n (acc, input) => {\n if (input.type === InputType.Coin) {\n acc.utxos.push(input.id);\n } else if (input.type === InputType.Message) {\n acc.messages.push(input.nonce);\n }\n return acc;\n },\n { utxos: [], messages: [] } as Required<ExcludeResourcesOption>\n );\n\n this.cache.set(transactionId, inputsToCache);\n }\n\n /**\n * @hidden\n */\n async validateTransaction(tx: TransactionRequest) {\n const {\n consensusParameters: {\n txParameters: { maxInputs, maxOutputs },\n },\n } = await this.getChain();\n if (bn(tx.inputs.length).gt(maxInputs)) {\n throw new FuelError(\n ErrorCode.MAX_INPUTS_EXCEEDED,\n `The transaction exceeds the maximum allowed number of inputs. Tx inputs: ${tx.inputs.length}, max inputs: ${maxInputs}`\n );\n }\n\n if (bn(tx.outputs.length).gt(maxOutputs)) {\n throw new FuelError(\n ErrorCode.MAX_OUTPUTS_EXCEEDED,\n `The transaction exceeds the maximum allowed number of outputs. Tx outputs: ${tx.outputs.length}, max outputs: ${maxOutputs}`\n );\n }\n }\n\n /**\n * Submits a transaction to the chain to be executed.\n *\n * If the transaction is missing any dependencies,\n * the transaction will be mutated and those dependencies will be added.\n *\n * @param transactionRequestLike - The transaction request object.\n * @param sendTransactionParams - The provider send transaction parameters (optional).\n * @returns A promise that resolves to the transaction response object.\n */\n async sendTransaction(\n transactionRequestLike: TransactionRequestLike,\n { estimateTxDependencies = true, enableAssetBurn }: ProviderSendTxParams = {}\n ): Promise<TransactionResponse> {\n const transactionRequest = transactionRequestify(transactionRequestLike);\n validateTransactionForAssetBurn(\n await this.getBaseAssetId(),\n transactionRequest,\n enableAssetBurn\n );\n\n if (estimateTxDependencies) {\n await this.estimateTxDependencies(transactionRequest);\n }\n\n await this.validateTransaction(transactionRequest);\n\n const encodedTransaction = hexlify(transactionRequest.toTransactionBytes());\n\n let abis: JsonAbisFromAllCalls | undefined;\n\n if (isTransactionTypeScript(transactionRequest)) {\n abis = transactionRequest.abis;\n }\n const subscription = await this.operations.submitAndAwaitStatus({ encodedTransaction });\n\n this.#cacheInputs(\n transactionRequest.inputs,\n transactionRequest.getTransactionId(await this.getChainId())\n );\n\n const chainId = await this.getChainId();\n return new TransactionResponse(transactionRequest, this, chainId, abis, subscription);\n }\n\n /**\n * Executes a transaction without actually submitting it to the chain.\n *\n * If the transaction is missing any dependencies,\n * the transaction will be mutated and those dependencies will be added.\n *\n * @param transactionRequestLike - The transaction request object.\n * @param sendTransactionParams - The provider call parameters (optional).\n * @returns A promise that resolves to the call result object.\n */\n async dryRun(\n transactionRequestLike: TransactionRequestLike,\n { utxoValidation, estimateTxDependencies = true }: ProviderCallParams = {}\n ): Promise<CallResult> {\n const transactionRequest = transactionRequestify(transactionRequestLike);\n if (estimateTxDependencies) {\n return this.estimateTxDependencies(transactionRequest);\n }\n const encodedTransaction = hexlify(transactionRequest.toTransactionBytes());\n const { dryRun: dryRunStatuses } = await this.operations.dryRun({\n encodedTransactions: encodedTransaction,\n utxoValidation: utxoValidation || false,\n });\n const [{ receipts: rawReceipts, status: dryRunStatus }] = dryRunStatuses;\n const receipts = rawReceipts.map(processGqlReceipt);\n\n return { receipts, dryRunStatus };\n }\n\n /**\n * Verifies whether enough gas is available to complete transaction.\n *\n * @template T - The type of the transaction request object.\n *\n * @param transactionRequest - The transaction request object.\n * @returns A promise that resolves to the estimated transaction request object.\n */\n async estimatePredicates<T extends TransactionRequest>(transactionRequest: T): Promise<T> {\n const shouldEstimatePredicates = Boolean(\n transactionRequest.inputs.find(\n (input) =>\n 'predicate' in input &&\n input.predicate &&\n !equalBytes(arrayify(input.predicate), arrayify('0x')) &&\n new BN(input.predicateGasUsed).isZero()\n )\n );\n if (!shouldEstimatePredicates) {\n return transactionRequest;\n }\n const encodedTransaction = hexlify(transactionRequest.toTransactionBytes());\n const response = await this.operations.estimatePredicates({\n encodedTransaction,\n });\n\n const {\n estimatePredicates: { inputs },\n } = response;\n\n if (inputs) {\n inputs.forEach((input, index) => {\n if ('predicateGasUsed' in input && bn(input.predicateGasUsed).gt(0)) {\n // eslint-disable-next-line no-param-reassign\n (<CoinTransactionRequestInput>transactionRequest.inputs[index]).predicateGasUsed =\n input.predicateGasUsed;\n }\n });\n }\n\n return transactionRequest;\n }\n\n /**\n * Will dryRun a transaction and check for missing dependencies.\n *\n * If there are missing variable outputs,\n * `addVariableOutputs` is called on the transaction.\n *\n * @param transactionRequest - The transaction request object.\n * @returns A promise that resolves to the estimate transaction dependencies.\n */\n async estimateTxDependencies(\n transactionRequest: TransactionRequest\n ): Promise<EstimateTxDependenciesReturns> {\n if (isTransactionTypeCreate(transactionRequest)) {\n return {\n receipts: [],\n outputVariables: 0,\n missingContractIds: [],\n };\n }\n\n let receipts: TransactionResultReceipt[] = [];\n const missingContractIds: string[] = [];\n let outputVariables = 0;\n let dryRunStatus: DryRunStatus | undefined;\n\n await this.validateTransaction(transactionRequest);\n\n for (let attempt = 0; attempt < MAX_RETRIES; attempt++) {\n const {\n dryRun: [{ receipts: rawReceipts, status }],\n } = await this.operations.dryRun({\n encodedTransactions: [hexlify(transactionRequest.toTransactionBytes())],\n utxoValidation: false,\n gasPrice: '0',\n });\n\n receipts = rawReceipts.map(processGqlReceipt);\n dryRunStatus = status;\n\n const { missingOutputVariables, missingOutputContractIds } =\n getReceiptsWithMissingData(receipts);\n\n const hasMissingOutputs =\n missingOutputVariables.length !== 0 || missingOutputContractIds.length !== 0;\n\n if (hasMissingOutputs && isTransactionTypeScript(transactionRequest)) {\n outputVariables += missingOutputVariables.length;\n transactionRequest.addVariableOutputs(missingOutputVariables.length);\n missingOutputContractIds.forEach(({ contractId }) => {\n transactionRequest.addContractInputAndOutput(Address.fromString(contractId));\n missingContractIds.push(contractId);\n });\n\n const { maxFee } = await this.estimateTxGasAndFee({\n transactionRequest,\n gasPrice: bn(0),\n });\n\n // eslint-disable-next-line no-param-reassign\n transactionRequest.maxFee = maxFee;\n } else {\n break;\n }\n }\n\n return {\n receipts,\n outputVariables,\n missingContractIds,\n dryRunStatus,\n };\n }\n\n /**\n * Dry runs multiple transactions and checks for missing dependencies in batches.\n *\n * Transactions are dry run in batches. After each dry run, transactions requiring\n * further modifications are identified. The method iteratively updates these transactions\n * and performs subsequent dry runs until all dependencies for each transaction are satisfied.\n *\n * @param transactionRequests - Array of transaction request objects.\n * @returns A promise that resolves to an array of results for each transaction.\n */\n async estimateMultipleTxDependencies(\n transactionRequests: TransactionRequest[]\n ): Promise<EstimateTxDependenciesReturns[]> {\n const results: EstimateTxDependenciesReturns[] = transactionRequests.map(() => ({\n receipts: [],\n outputVariables: 0,\n missingContractIds: [],\n dryRunStatus: undefined,\n }));\n\n const allRequests = clone(transactionRequests);\n\n // Map of original request index to its serialized transaction (for ScriptTransactionRequest only)\n const serializedTransactionsMap = new Map();\n\n // Prepare ScriptTransactionRequests and their indices\n allRequests.forEach((req, index) => {\n if (isTransactionTypeScript(req)) {\n serializedTransactionsMap.set(index, hexlify(req.toTransactionBytes()));\n }\n });\n\n // Indices of ScriptTransactionRequests\n let transactionsToProcess = Array.from(serializedTransactionsMap.keys());\n let attempt = 0;\n\n while (transactionsToProcess.length > 0 && attempt < MAX_RETRIES) {\n const encodedTransactions = transactionsToProcess.map((index) =>\n serializedTransactionsMap.get(index)\n );\n const dryRunResults = await this.operations.dryRun({\n encodedTransactions,\n utxoValidation: false,\n });\n\n const nextRoundTransactions = [];\n\n for (let i = 0; i < dryRunResults.dryRun.length; i++) {\n const requestIdx = transactionsToProcess[i];\n const { receipts: rawReceipts, status } = dryRunResults.dryRun[i];\n const result = results[requestIdx];\n result.receipts = rawReceipts.map(processGqlReceipt);\n result.dryRunStatus = status;\n const { missingOutputVariables, missingOutputContractIds } = getReceiptsWithMissingData(\n result.receipts\n );\n const hasMissingOutputs =\n missingOutputVariables.length > 0 || missingOutputContractIds.length > 0;\n const request = allRequests[requestIdx];\n if (hasMissingOutputs && isTransactionTypeScript(request)) {\n result.outputVariables += missingOutputVariables.length;\n request.addVariableOutputs(missingOutputVariables.length);\n missingOutputContractIds.forEach(({ contractId }) => {\n request.addContractInputAndOutput(Address.fromString(contractId));\n result.missingContractIds.push(contractId);\n });\n const { maxFee } = await this.estimateTxGasAndFee({\n transactionRequest: request,\n });\n request.maxFee = maxFee;\n // Prepare for the next round of dry run\n serializedTransactionsMap.set(requestIdx, hexlify(request.toTransactionBytes()));\n nextRoundTransactions.push(requestIdx);\n }\n }\n\n transactionsToProcess = nextRoundTransactions;\n attempt += 1;\n }\n\n return results;\n }\n\n /**\n * Dry runs multiple transactions.\n *\n * @param transactionRequests - Array of transaction request objects.\n * @param sendTransactionParams - The provider call parameters (optional).\n *\n * @returns A promise that resolves to an array of results for each transaction call.\n */\n async dryRunMultipleTransactions(\n transactionRequests: TransactionRequest[],\n { utxoValidation, estimateTxDependencies = true }: ProviderCallParams = {}\n ): Promise<CallResult[]> {\n if (estimateTxDependencies) {\n return this.estimateMultipleTxDependencies(transactionRequests);\n }\n const encodedTransactions = transactionRequests.map((tx) => hexlify(tx.toTransactionBytes()));\n const { dryRun: dryRunStatuses } = await this.operations.dryRun({\n encodedTransactions,\n utxoValidation: utxoValidation || false,\n });\n\n const results = dryRunStatuses.map(({ receipts: rawReceipts, status }) => {\n const receipts = rawReceipts.map(processGqlReceipt);\n return { receipts, dryRunStatus: status };\n });\n\n return results;\n }\n\n public async autoRefetchConfigs() {\n const now = Date.now();\n const diff = now - (this.consensusParametersTimestamp ?? 0);\n\n if (diff < 60000) {\n return;\n }\n\n // no cache? refetch.\n if (!Provider.chainInfoCache?.[this.urlWithoutAuth]) {\n await this.fetchChainAndNodeInfo(true);\n return;\n }\n\n const chainInfo = Provider.chainInfoCache[this.urlWithoutAuth];\n\n const {\n consensusParameters: { version: previous },\n } = chainInfo;\n\n const {\n chain: {\n latestBlock: {\n header: { consensusParametersVersion: current },\n },\n },\n } = await this.operations.getConsensusParametersVersion();\n\n // old cache? refetch.\n if (previous !== current) {\n // calling with true to skip cache\n await this.fetchChainAndNodeInfo(true);\n }\n }\n\n /**\n * Estimates the transaction gas and fee based on the provided transaction request.\n * @param transactionRequest - The transaction request object.\n * @returns An object containing the estimated minimum gas, minimum fee, maximum gas, and maximum fee.\n */\n async estimateTxGasAndFee(params: { transactionRequest: TransactionRequest; gasPrice?: BN }) {\n const { transactionRequest } = params;\n let { gasPrice } = params;\n\n await this.autoRefetchConfigs();\n\n const chainInfo = await this.getChain();\n const { gasPriceFactor, maxGasPerTx } = await this.getGasConfig();\n\n const minGas = transactionRequest.calculateMinGas(chainInfo);\n if (!isDefined(gasPrice)) {\n gasPrice = await this.estimateGasPrice(10);\n }\n\n const minFee = calculateGasFee({\n gasPrice: bn(gasPrice),\n gas: minGas,\n priceFactor: gasPriceFactor,\n tip: transactionRequest.tip,\n }).add(1);\n\n let gasLimit = bn(0);\n\n // Only Script transactions consume gas\n if (isTransactionTypeScript(transactionRequest)) {\n // If the gasLimit is set to 0, it means we need to estimate it.\n gasLimit = transactionRequest.gasLimit;\n if (transactionRequest.gasLimit.eq(0)) {\n transactionRequest.gasLimit = minGas;\n\n /*\n * Adjusting the gasLimit of a transaction (TX) impacts its maxGas.\n * Consequently, this affects the maxFee, as it is derived from the maxGas. To accurately estimate the\n * gasLimit for a transaction, especially when the exact gas consumption is uncertain (as in an estimation dry-run),\n * the following steps are required:\n * 1 - Initially, set the gasLimit using the calculated minGas.\n * 2 - Based on this initial gasLimit, calculate the maxGas.\n * 3 - Get the maximum gas per transaction allowed by the chain, and subtract the previously calculated maxGas from this limit.\n * 4 - The result of this subtraction should then be adopted as the new, definitive gasLimit.\n * 5 - Recalculate the maxGas with the updated gasLimit. This new maxGas is then used to compute the maxFee.\n * 6 - The calculated maxFee represents the safe, estimated cost required to fund the transaction.\n */\n transactionRequest.gasLimit = maxGasPerTx.sub(\n transactionRequest.calculateMaxGas(chainInfo, minGas)\n );\n\n gasLimit = transactionRequest.gasLimit;\n }\n }\n const maxGas = transactionRequest.calculateMaxGas(chainInfo, minGas);\n const maxFee = calculateGasFee({\n gasPrice: bn(gasPrice),\n gas: maxGas,\n priceFactor: gasPriceFactor,\n tip: transactionRequest.tip,\n }).add(1);\n\n return {\n minGas,\n minFee,\n maxGas,\n maxFee,\n gasPrice,\n gasLimit,\n };\n }\n\n /**\n * Executes a signed transaction without applying the states changes\n * on the chain.\n *\n * If the transaction is missing any dependencies,\n * the transaction will be mutated and those dependencies will be added\n *\n * @param transactionRequestLike - The transaction request object.\n * @param estimateTxParams - The estimate transaction params (optional).\n * @returns A promise that resolves to the call result object.\n */\n async simulate(\n transactionRequestLike: TransactionRequestLike,\n { estimateTxDependencies = true }: EstimateTransactionParams = {}\n ): Promise<CallResult> {\n const transactionRequest = transactionRequestify(transactionRequestLike);\n if (estimateTxDependencies) {\n return this.estimateTxDependencies(transactionRequest);\n }\n const encodedTransactions = [hexlify(transactionRequest.toTransactionBytes())];\n\n const { dryRun: dryRunStatuses } = await this.operations.dryRun({\n encodedTransactions,\n utxoValidation: true,\n });\n\n const callResult = dryRunStatuses.map((dryRunStatus) => {\n const { id, receipts, status } = dryRunStatus;\n\n const processedReceipts = receipts.map(processGqlReceipt);\n\n return { id, receipts: processedReceipts, status };\n });\n\n return { receipts: callResult[0].receipts };\n }\n\n /**\n * @hidden\n *\n * Returns a transaction cost to enable user\n * to set gasLimit and also reserve balance amounts\n * on the transaction.\n *\n * @param transactionRequestLike - The transaction request object.\n * @param transactionCostParams - The transaction cost parameters (optional).\n *\n * @returns A promise that resolves to the transaction cost object.\n */\n async getTransactionCost(\n transactionRequestLike: TransactionRequestLike,\n { signatureCallback }: TransactionCostParams = {}\n ): Promise<Omit<TransactionCost, 'requiredQuantities'>> {\n const txRequestClone = clone(transactionRequestify(transactionRequestLike));\n const updateMaxFee = txRequestClone.maxFee.eq(0);\n const isScriptTransaction = isTransactionTypeScript(txRequestClone);\n\n // Remove gasLimit to avoid gasLimit when estimating predicates\n if (isScriptTransaction) {\n txRequestClone.gasLimit = bn(0);\n }\n\n const signedRequest = clone(txRequestClone);\n let addedSignatures = 0;\n if (signatureCallback && isTransactionTypeScript(signedRequest)) {\n const lengthBefore = signedRequest.witnesses.length;\n await signatureCallback(signedRequest);\n addedSignatures = signedRequest.witnesses.length - lengthBefore;\n }\n\n await this.estimatePredicates(signedRequest);\n txRequestClone.updatePredicateGasUsed(signedRequest.inputs);\n\n /**\n * Calculate minGas and maxGas based on the real transaction\n */\n // eslint-disable-next-line prefer-const\n let { maxFee, maxGas, minFee, minGas, gasPrice, gasLimit } = await this.estimateTxGasAndFee({\n transactionRequest: signedRequest,\n });\n\n let receipts: TransactionResultReceipt[] = [];\n let dryRunStatus: DryRunStatus | undefined;\n let missingContractIds: string[] = [];\n let outputVariables = 0;\n let gasUsed = bn(0);\n\n txRequestClone.maxFee = maxFee;\n if (isScriptTransaction) {\n txRequestClone.gasLimit = gasLimit;\n if (signatureCallback) {\n await signatureCallback(txRequestClone);\n }\n\n ({ receipts, missingContractIds, outputVariables, dryRunStatus } =\n await this.estimateTxDependencies(txRequestClone));\n\n if (dryRunStatus && 'reason' in dryRunStatus) {\n throw this.extractDryRunError(txRequestClone, receipts, dryRunStatus);\n }\n\n const { maxGasPerTx } = await this.getGasConfig();\n\n const pristineGasUsed = getGasUsedFromReceipts(receipts);\n gasUsed = bn(pristineGasUsed.muln(GAS_USED_MODIFIER)).max(maxGasPerTx.sub(minGas));\n txRequestClone.gasLimit = gasUsed;\n\n ({ maxFee, maxGas, minFee, minGas, gasPrice } = await this.estimateTxGasAndFee({\n transactionRequest: txRequestClone,\n gasPrice,\n }));\n }\n\n return {\n receipts,\n gasUsed,\n gasPrice,\n minGas,\n maxGas,\n minFee,\n maxFee,\n outputVariables,\n missingContractIds,\n addedSignatures,\n estimatedPredicates: txRequestClone.inputs,\n dryRunStatus,\n updateMaxFee,\n };\n }\n\n /**\n * Returns coins for the given owner.\n *\n * @param owner - The address to get coins for.\n * @param assetId - The asset ID of coins to get (optional).\n * @param paginationArgs - Pagination arguments (optional).\n *\n * @returns A promise that resolves to the coins.\n */\n async getCoins(\n owner: string | Address,\n assetId?: BytesLike,\n paginationArgs?: CursorPaginationArgs\n ): Promise<GetCoinsResponse> {\n const ownerAddress = Address.fromAddressOrString(owner);\n const {\n coins: { edges, pageInfo },\n } = await this.operations.getCoins({\n ...validatePaginationArgs({\n paginationLimit: RESOURCES_PAGE_SIZE_LIMIT,\n inputArgs: paginationArgs,\n }),\n filter: { owner: ownerAddress.toB256(), assetId: assetId && hexlify(assetId) },\n });\n\n const coins = edges.map(({ node }) => ({\n id: node.utxoId,\n assetId: node.assetId,\n amount: bn(node.amount),\n owner: ownerAddress,\n blockCreated: bn(node.blockCreated),\n txCreatedIdx: bn(node.txCreatedIdx),\n }));\n\n return {\n coins,\n pageInfo,\n };\n }\n\n /**\n * Returns resources for the given owner satisfying the spend query.\n *\n * @param owner - The address to get resources for.\n * @param quantities - The coin quantities to get.\n * @param excludedIds - IDs of excluded resources from the selection (optional).\n * @returns A promise that resolves to the resources.\n */\n async getResourcesToSpend(\n owner: string | Address,\n quantities: CoinQuantityLike[],\n excludedIds?: ExcludeResourcesOption\n ): Promise<Resource[]> {\n const ownerAddress = Address.fromAddressOrString(owner);\n const excludeInput = {\n messages: excludedIds?.messages?.map((nonce) => hexlify(nonce)) || [],\n utxos: excludedIds?.utxos?.map((id) => hexlify(id)) || [],\n };\n\n if (this.cache) {\n const cached = this.cache.getActiveData();\n excludeInput.messages.push(...cached.messages);\n excludeInput.utxos.push(...cached.utxos);\n }\n\n const coinsQuery = {\n owner: ownerAddress.toB256(),\n queryPerAsset: quantities\n .map(coinQuantityfy)\n .map(({ assetId, amount, max: maxPerAsset }) => ({\n assetId: hexlify(assetId),\n amount: amount.toString(10),\n max: maxPerAsset ? maxPerAsset.toString(10) : undefined,\n })),\n excludedIds: excludeInput,\n };\n\n const result = await this.operations.getCoinsToSpend(coinsQuery);\n\n const coins = result.coinsToSpend\n .flat()\n .map((coin) => {\n switch (coin.type) {\n case 'MessageCoin':\n return {\n amount: bn(coin.amount),\n assetId: coin.assetId,\n daHeight: bn(coin.daHeight),\n sender: Address.fromAddressOrString(coin.sender),\n recipient: Address.fromAddressOrString(coin.recipient),\n nonce: coin.nonce,\n } as MessageCoin;\n case 'Coin':\n return {\n id: coin.utxoId,\n amount: bn(coin.amount),\n assetId: coin.assetId,\n owner: ownerAddress,\n blockCreated: bn(coin.blockCreated),\n txCreatedIdx: bn(coin.txCreatedIdx),\n } as Coin;\n default:\n return null;\n }\n })\n .filter((v) => !!v) as Array<Resource>;\n\n return coins;\n }\n\n /**\n * Returns an array of blobIds that exist on chain, for a given array of blobIds.\n *\n * @param blobIds - blobIds to check.\n * @returns - A promise that resolves to an array of blobIds that exist on chain.\n */\n async getBlobs(blobIds: string[]): Promise<string[]> {\n const res = await this.operations.getBlobs({ blobIds });\n const blobs: (string | null)[] = [];\n\n Object.keys(res).forEach((key) => {\n // @ts-expect-error keys are strings\n const val = res[key];\n blobs.push(val?.id ?? null);\n });\n\n return blobs.filter((v) => v) as string[];\n }\n\n /**\n * Returns block matching the given ID or height.\n *\n * @param idOrHeight - ID or height of the block.\n * @returns A promise that resolves to the block or null.\n */\n async getBlock(idOrHeight: string | number | 'latest'): Promise<Block | null> {\n let block: GqlBlockFragment | undefined | null;\n\n if (idOrHeight === 'latest') {\n const {\n chain: { latestBlock },\n } = await this.operations.getLatestBlock();\n block = latestBlock;\n } else {\n const isblockId = typeof idOrHeight === 'string' && idOrHeight.length === 66;\n const variables = isblockId\n ? { blockId: idOrHeight }\n : { height: bn(idOrHeight).toString(10) };\n const response = await this.operations.getBlock(variables);\n block = response.block;\n }\n\n if (!block) {\n return null;\n }\n\n const { header, height, id, transactions } = block;\n\n return {\n id,\n height: bn(height),\n time: header.time,\n header: {\n applicationHash: header.applicationHash,\n daHeight: bn(header.daHeight),\n eventInboxRoot: header.eventInboxRoot,\n messageOutboxRoot: header.messageOutboxRoot,\n prevRoot: header.prevRoot,\n stateTransitionBytecodeVersion: header.stateTransitionBytecodeVersion,\n transactionsCount: header.transactionsCount,\n transactionsRoot: header.transactionsRoot,\n },\n transactionIds: transactions.map((tx) => tx.id),\n };\n }\n\n /**\n * Returns all the blocks matching the given parameters.\n *\n * @param params - The parameters to query blocks.\n * @returns A promise that resolves to the blocks.\n */\n async getBlocks(params?: CursorPaginationArgs): Promise<GetBlocksResponse> {\n const {\n blocks: { edges, pageInfo },\n } = await this.operations.getBlocks({\n ...validatePaginationArgs({\n paginationLimit: BLOCKS_PAGE_SIZE_LIMIT,\n inputArgs: params,\n }),\n });\n\n const blocks: Block[] = edges.map(({ node: block }) => ({\n id: block.id,\n height: bn(block.height),\n time: block.header.time,\n header: {\n applicationHash: block.header.applicationHash,\n daHeight: bn(block.header.daHeight),\n eventInboxRoot: block.header.eventInboxRoot,\n messageOutboxRoot: block.header.messageOutboxRoot,\n prevRoot: block.header.prevRoot,\n stateTransitionBytecodeVersion: block.header.stateTransitionBytecodeVersion,\n transactionsCount: block.header.transactionsCount,\n transactionsRoot: block.header.transactionsRoot,\n },\n transactionIds: block.transactions.map((tx) => tx.id),\n }));\n\n return { blocks, pageInfo };\n }\n\n /**\n * Returns block matching the given ID or type, including transaction data.\n *\n * @param idOrHeight - ID or height of the block.\n * @returns A promise that resolves to the block.\n */\n async getBlockWithTransactions(\n /** ID or height of the block */\n idOrHeight: string | number | 'latest'\n ): Promise<(Block & { transactions: Transaction[] }) | null> {\n let variables;\n if (typeof idOrHeight === 'number') {\n variables = { blockHeight: bn(idOrHeight).toString(10) };\n } else if (idOrHeight === 'latest') {\n variables = { blockHeight: (await this.getBlockNumber()).toString() };\n } else {\n variables = { blockId: idOrHeight };\n }\n\n const { block } = await this.operations.getBlockWithTransactions(variables);\n\n if (!block) {\n return null;\n }\n\n return {\n id: block.id,\n height: bn(block.height, 10),\n time: block.header.time,\n header: {\n applicationHash: block.header.applicationHash,\n daHeight: bn(block.header.daHeight),\n eventInboxRoot: block.header.eventInboxRoot,\n messageOutboxRoot: block.header.messageOutboxRoot,\n prevRoot: block.header.prevRoot,\n stateTransitionBytecodeVersion: block.header.stateTransitionBytecodeVersion,\n transactionsCount: block.header.transactionsCount,\n transactionsRoot: block.header.transactionsRoot,\n },\n transactionIds: block.transactions.map((tx) => tx.id),\n transactions: block.transactions.map(\n (tx) => new TransactionCoder().decode(arrayify(tx.rawPayload), 0)?.[0]\n ),\n };\n }\n\n /**\n * Get transaction with the given ID.\n *\n * @param transactionId - ID of the transaction.\n * @returns A promise that resolves to the transaction.\n */\n async getTransaction<TTransactionType = void>(\n transactionId: string\n ): Promise<Transaction<TTransactionType> | null> {\n const { transaction } = await this.operations.getTransaction({ transactionId });\n\n if (!transaction) {\n return null;\n }\n\n try {\n return new TransactionCoder().decode(\n arrayify(transaction.rawPayload),\n 0\n )?.[0] as Transaction<TTransactionType>;\n } catch (error) {\n if (error instanceof FuelError && error.code === ErrorCode.UNSUPPORTED_TRANSACTION_TYPE) {\n // eslint-disable-next-line no-console\n console.warn('Unsupported transaction type encountered');\n return null;\n }\n throw error;\n }\n }\n\n /**\n * Retrieves transactions based on the provided pagination arguments.\n * @param paginationArgs - The pagination arguments for retrieving transactions.\n * @returns A promise that resolves to an object containing the retrieved transactions and pagination information.\n */\n async getTransactions(paginationArgs?: CursorPaginationArgs): Promise<GetTransactionsResponse> {\n const {\n transactions: { edges, pageInfo },\n } = await this.operations.getTransactions({\n ...validatePaginationArgs({\n inputArgs: paginationArgs,\n paginationLimit: TRANSACTIONS_PAGE_SIZE_LIMIT,\n }),\n });\n\n const coder = new TransactionCoder();\n const transactions = edges\n .map(({ node: { rawPayload } }) => {\n try {\n return coder.decode(arrayify(rawPayload), 0)[0];\n } catch (error) {\n if (error instanceof FuelError && error.code === ErrorCode.UNSUPPORTED_TRANSACTION_TYPE) {\n // eslint-disable-next-line no-console\n console.warn('Unsupported transaction type encountered');\n return null;\n }\n throw error;\n }\n })\n .filter((tx): tx is Transaction => tx !== null);\n\n return { transactions, pageInfo };\n }\n\n /**\n * Get deployed contract with the given ID.\n *\n * @param contractId - ID of the contract.\n * @returns A promise that resolves to the contract.\n */\n async getContract(contractId: string): Promise<ContractResult | null> {\n const { contract } = await this.operations.getContract({ contractId });\n if (!contract) {\n return null;\n }\n return contract;\n }\n\n /**\n * Returns the balance for the given contract for the given asset ID.\n *\n * @param contractId - The contract ID to get the balance for.\n * @param assetId - The asset ID of coins to get.\n * @returns A promise that resolves to the balance.\n */\n async getContractBalance(\n /** The contract ID to get the balance for */\n contractId: string | Address,\n /** The asset ID of coins to get */\n assetId: BytesLike\n ): Promise<BN> {\n const { contractBalance } = await this.operations.getContractBalance({\n contract: Address.fromAddressOrString(contractId).toB256(),\n asset: hexlify(assetId),\n });\n return bn(contractBalance.amount, 10);\n }\n\n /**\n * Returns the balance for the given owner for the given asset ID.\n *\n * @param owner - The address to get coins for.\n * @param assetId - The asset ID of coins to get.\n * @returns A promise that resolves to the balance.\n */\n async getBalance(\n /** The address to get coins for */\n owner: string | Address,\n /** The asset ID of coins to get */\n assetId: BytesLike\n ): Promise<BN> {\n const { balance } = await this.operations.getBalance({\n owner: Address.fromAddressOrString(owner).toB256(),\n assetId: hexlify(assetId),\n });\n return bn(balance.amount, 10);\n }\n\n /**\n * Returns balances for the given owner.\n *\n * @param owner - The address to get coins for.\n * @param paginationArgs - Pagination arguments (optional).\n * @returns A promise that resolves to the balances.\n */\n async getBalances(owner: string | Address): Promise<GetBalancesResponse> {\n const {\n balances: { edges },\n } = await this.operations.getBalances({\n /**\n * The query parameters for this method were designed to support pagination,\n * but the current Fuel-Core implementation does not support pagination yet.\n */\n first: 10000,\n filter: { owner: Address.fromAddressOrString(owner).toB256() },\n });\n\n const balances = edges.map(({ node }) => ({\n assetId: node.assetId,\n amount: bn(node.amount),\n }));\n\n return { balances };\n }\n\n /**\n * Returns message for the given address.\n *\n * @param address - The address to get message from.\n * @param paginationArgs - Pagination arguments (optional).\n * @returns A promise that resolves to the messages.\n */\n async getMessages(\n address: string | Address,\n paginationArgs?: CursorPaginationArgs\n ): Promise<GetMessagesResponse> {\n const {\n messages: { edges, pageInfo },\n } = await this.operations.getMessages({\n ...validatePaginationArgs({\n inputArgs: paginationArgs,\n paginationLimit: RESOURCES_PAGE_SIZE_LIMIT,\n }),\n owner: Address.fromAddressOrString(address).toB256(),\n });\n\n const messages = edges.map(({ node }) => ({\n messageId: InputMessageCoder.getMessageId({\n sender: node.sender,\n recipient: node.recipient,\n nonce: node.nonce,\n amount: bn(node.amount),\n data: node.data,\n }),\n sender: Address.fromAddressOrString(node.sender),\n recipient: Address.fromAddressOrString(node.recipient),\n nonce: node.nonce,\n amount: bn(node.amount),\n data: InputMessageCoder.decodeData(node.data),\n daHeight: bn(node.daHeight),\n }));\n\n return {\n messages,\n pageInfo,\n };\n }\n\n /**\n * Returns Message Proof for given transaction id and the message id from MessageOut receipt.\n *\n * @param transactionId - The transaction to get message from.\n * @param messageId - The message id from MessageOut receipt.\n * @param commitBlockId - The commit block id (optional).\n * @param commitBlockHeight - The commit block height (optional).\n * @returns A promise that resolves to the message proof.\n */\n async getMessageProof(\n transactionId: string,\n nonce: string,\n commitBlockId?: string,\n commitBlockHeight?: BN\n ): Promise<MessageProof | null> {\n let inputObject: {\n /** The transaction to get message from */\n transactionId: string;\n /** The message id from MessageOut receipt */\n nonce: string;\n commitBlockId?: string;\n commitBlockHeight?: string;\n } = {\n transactionId,\n nonce,\n };\n\n if (commitBlockId && commitBlockHeight) {\n throw new FuelError(\n ErrorCode.INVALID_INPUT_PARAMETERS,\n 'commitBlockId and commitBlockHeight cannot be used together'\n );\n }\n\n if (commitBlockId) {\n inputObject = {\n ...inputObject,\n commitBlockId,\n };\n }\n\n if (commitBlockHeight) {\n inputObject = {\n ...inputObject,\n // Conver BN into a number string required on the query\n // This should problably be fixed on the fuel client side\n commitBlockHeight: commitBlockHeight.toNumber().toString(),\n };\n }\n\n const result = await this.operations.getMessageProof(inputObject);\n\n if (!result.messageProof) {\n return null;\n }\n\n const {\n messageProof,\n messageBlockHeader,\n commitBlockHeader,\n blockProof,\n sender,\n recipient,\n amount,\n data,\n } = result.messageProof;\n\n return {\n messageProof: {\n proofIndex: bn(messageProof.proofIndex),\n proofSet: messageProof.proofSet,\n },\n blockProof: {\n proofIndex: bn(blockProof.proofIndex),\n proofSet: blockProof.proofSet,\n },\n messageBlockHeader: {\n id: messageBlockHeader.id,\n daHeight: bn(messageBlockHeader.daHeight),\n transactionsCount: Number(messageBlockHeader.transactionsCount),\n transactionsRoot: messageBlockHeader.transactionsRoot,\n height: bn(messageBlockHeader.height),\n prevRoot: messageBlockHeader.prevRoot,\n time: messageBlockHeader.time,\n applicationHash: messageBlockHeader.applicationHash,\n messageReceiptCount: Number(messageBlockHeader.messageReceiptCount),\n messageOutboxRoot: messageBlockHeader.messageOutboxRoot,\n consensusParametersVersion: Number(messageBlockHeader.consensusParametersVersion),\n eventInboxRoot: messageBlockHeader.eventInboxRoot,\n stateTransitionBytecodeVersion: Number(messageBlockHeader.stateTransitionBytecodeVersion),\n },\n commitBlockHeader: {\n id: commitBlockHeader.id,\n daHeight: bn(commitBlockHeader.daHeight),\n transactionsCount: Number(commitBlockHeader.transactionsCount),\n transactionsRoot: commitBlockHeader.transactionsRoot,\n height: bn(commitBlockHeader.height),\n prevRoot: commitBlockHeader.prevRoot,\n time: commitBlockHeader.time,\n applicationHash: commitBlockHeader.applicationHash,\n messageReceiptCount: Number(commitBlockHeader.messageReceiptCount),\n messageOutboxRoot: commitBlockHeader.messageOutboxRoot,\n consensusParametersVersion: Number(commitBlockHeader.consensusParametersVersion),\n eventInboxRoot: commitBlockHeader.eventInboxRoot,\n stateTransitionBytecodeVersion: Number(commitBlockHeader.stateTransitionBytecodeVersion),\n },\n sender: Address.fromAddressOrString(sender),\n recipient: Address.fromAddressOrString(recipient),\n nonce,\n amount: bn(amount),\n data,\n };\n }\n\n /**\n * Get the latest gas price from the node.\n *\n * @returns A promise that resolves to the latest gas price.\n */\n async getLatestGasPrice(): Promise<BN> {\n const { latestGasPrice } = await this.operations.getLatestGasPrice();\n return bn(latestGasPrice.gasPrice);\n }\n\n /**\n * Returns the estimate gas price for the given block horizon.\n *\n * @param blockHorizon - The block horizon to estimate gas price for.\n * @returns A promise that resolves to the estimated gas price.\n */\n async estimateGasPrice(blockHorizon: number): Promise<BN> {\n const { estimateGasPrice } = await this.operations.estimateGasPrice({\n blockHorizon: String(blockHorizon),\n });\n return bn(estimateGasPrice.gasPrice);\n }\n\n /**\n * Returns Message Proof for given transaction id and the message id from MessageOut receipt.\n *\n * @param nonce - The nonce of the message to get status from.\n * @returns A promise that resolves to the message status\n */\n async getMessageStatus(\n /** The nonce of the message to get status from */\n nonce: string\n ): Promise<MessageStatus> {\n const result = await this.operations.getMessageStatus({ nonce });\n return result.messageStatus;\n }\n\n /**\n * Lets you produce blocks with custom timestamps and the block number of the last block produced.\n *\n * @param amount - The amount of blocks to produce.\n * @param startTime - The UNIX timestamp (milliseconds) to set for the first produced block (optional).\n * @returns A promise that resolves to the block number of the last produced block.\n */\n async produceBlocks(amount: number, startTime?: number) {\n const { produceBlocks: latestBlockHeight } = await this.operations.produceBlocks({\n blocksToProduce: bn(amount).toString(10),\n startTimestamp: startTime ? DateTime.fromUnixMilliseconds(startTime).toTai64() : undefined,\n });\n return bn(latestBlockHeight);\n }\n\n /**\n * Check if the given ID is an account.\n *\n * @param id - The ID to check.\n * @returns A promise that resolves to the result of the check.\n */\n async isUserAccount(id: string): Promise<boolean> {\n const { contract, blob, transaction } = await this.operations.isUserAccount({\n blobId: id,\n contractId: id,\n transactionId: id,\n });\n\n if (contract || blob || transaction) {\n return false;\n }\n return true;\n }\n\n async getAddressType(id: string): Promise<'Account' | 'Contract' | 'Transaction' | 'Blob'> {\n const { contract, blob, transaction } = await this.operations.isUserAccount({\n blobId: id,\n contractId: id,\n transactionId: id,\n });\n\n if (contract) {\n return 'Contract';\n }\n if (blob) {\n return 'Blob';\n }\n if (transaction) {\n return 'Transaction';\n }\n\n return 'Account';\n }\n\n /**\n * Get the transaction response for the given transaction ID.\n *\n * @param transactionId - The transaction ID to get the response for.\n * @returns A promise that resolves to the transaction response.\n */\n\n async getTransactionResponse(transactionId: string): Promise<TransactionResponse> {\n const chainId = await this.getChainId();\n return new TransactionResponse(transactionId, this, chainId);\n }\n\n /**\n * Returns Message for given nonce.\n *\n * @param nonce - The nonce of the message to retrieve.\n * @returns A promise that resolves to the Message object or null.\n */\n async getMessageByNonce(nonce: string): Promise<Message | null> {\n const { message: rawMessage } = await this.operations.getMessageByNonce({ nonce });\n\n if (!rawMessage) {\n return null;\n }\n\n const message: Message = {\n messageId: InputMessageCoder.getMessageId({\n sender: rawMessage.sender,\n recipient: rawMessage.recipient,\n nonce,\n amount: bn(rawMessage.amount),\n data: rawMessage.data,\n }),\n sender: Address.fromAddressOrString(rawMessage.sender),\n recipient: Address.fromAddressOrString(rawMessage.recipient),\n nonce,\n amount: bn(rawMessage.amount),\n data: InputMessageCoder.decodeData(rawMessage.data),\n daHeight: bn(rawMessage.daHeight),\n };\n\n return message;\n }\n\n /**\n * Get the relayed transaction for the given transaction ID.\n *\n * @param relayedTransactionId - The relayed transaction ID to get the response for.\n * @returns A promise that resolves to the relayed transaction.\n */\n async getRelayedTransactionStatus(\n relayedTransactionId: string\n ): Promise<GqlRelayedTransactionFailed | null> {\n const { relayedTransactionStatus } = await this.operations.getRelayedTransactionStatus({\n relayedTransactionId,\n });\n\n if (!relayedTransactionStatus) {\n return null;\n }\n\n return relayedTransactionStatus;\n }\n\n /**\n * @hidden\n */\n private extractDryRunError(\n transactionRequest: ScriptTransactionRequest,\n receipts: TransactionResultReceipt[],\n dryRunStatus: DryRunStatus\n ): FuelError {\n const status = dryRunStatus as DryRunFailureStatusFragment;\n let logs: unknown[] = [];\n if (transactionRequest.abis) {\n logs = getDecodedLogs(\n receipts,\n transactionRequest.abis.main,\n transactionRequest.abis.otherContractsAbis\n );\n }\n\n return extractTxError({\n logs,\n receipts,\n statusReason: status.reason,\n });\n }\n}\n","import type { DocumentNode } from 'graphql';\nimport gql from 'graphql-tag';\nexport type Maybe<T> = T | null;\nexport type InputMaybe<T> = Maybe<T>;\nexport type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };\nexport type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };\nexport type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };\nexport type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };\nexport type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };\n/** All built-in and custom scalars, mapped to their actual values */\nexport type Scalars = {\n ID: { input: string; output: string; }\n String: { input: string; output: string; }\n Boolean: { input: boolean; output: boolean; }\n Int: { input: number; output: number; }\n Float: { input: number; output: number; }\n Address: { input: string; output: string; }\n AssetId: { input: string; output: string; }\n BlobId: { input: any; output: any; }\n BlockId: { input: string; output: string; }\n Bytes32: { input: string; output: string; }\n ContractId: { input: string; output: string; }\n HexString: { input: string; output: string; }\n Nonce: { input: string; output: string; }\n RelayedTransactionId: { input: string; output: string; }\n Salt: { input: string; output: string; }\n Signature: { input: string; output: string; }\n Tai64Timestamp: { input: string; output: string; }\n TransactionId: { input: string; output: string; }\n TxPointer: { input: string; output: string; }\n U16: { input: string; output: string; }\n U32: { input: string; output: string; }\n U64: { input: string; output: string; }\n UtxoId: { input: string; output: string; }\n};\n\nexport type GqlBalance = {\n amount: Scalars['U64']['output'];\n assetId: Scalars['AssetId']['output'];\n owner: Scalars['Address']['output'];\n};\n\nexport type GqlBalanceConnection = {\n /** A list of edges. */\n edges: Array<GqlBalanceEdge>;\n /** A list of nodes. */\n nodes: Array<GqlBalance>;\n /** Information to aid in pagination. */\n pageInfo: GqlPageInfo;\n};\n\n/** An edge in a connection. */\nexport type GqlBalanceEdge = {\n /** A cursor for use in pagination */\n cursor: Scalars['String']['output'];\n /** The item at the end of the edge */\n node: GqlBalance;\n};\n\nexport type GqlBalanceFilterInput = {\n /** Filter coins based on the `owner` field */\n owner: Scalars['Address']['input'];\n};\n\nexport type GqlBlob = {\n bytecode: Scalars['HexString']['output'];\n id: Scalars['BlobId']['output'];\n};\n\nexport type GqlBlock = {\n consensus: GqlConsensus;\n header: GqlHeader;\n height: Scalars['U32']['output'];\n id: Scalars['BlockId']['output'];\n transactionIds: Array<Scalars['TransactionId']['output']>;\n transactions: Array<GqlTransaction>;\n version: GqlBlockVersion;\n};\n\nexport type GqlBlockConnection = {\n /** A list of edges. */\n edges: Array<GqlBlockEdge>;\n /** A list of nodes. */\n nodes: Array<GqlBlock>;\n /** Information to aid in pagination. */\n pageInfo: GqlPageInfo;\n};\n\n/** An edge in a connection. */\nexport type GqlBlockEdge = {\n /** A cursor for use in pagination */\n cursor: Scalars['String']['output'];\n /** The item at the end of the edge */\n node: GqlBlock;\n};\n\nexport enum GqlBlockVersion {\n V1 = 'V1'\n}\n\n/** Breakpoint, defined as a tuple of contract ID and relative PC offset inside it */\nexport type GqlBreakpoint = {\n contract: Scalars['ContractId']['input'];\n pc: Scalars['U64']['input'];\n};\n\nexport type GqlChainInfo = {\n consensusParameters: GqlConsensusParameters;\n daHeight: Scalars['U64']['output'];\n gasCosts: GqlGasCosts;\n latestBlock: GqlBlock;\n name: Scalars['String']['output'];\n};\n\nexport type GqlChangeOutput = {\n amount: Scalars['U64']['output'];\n assetId: Scalars['AssetId']['output'];\n to: Scalars['Address']['output'];\n};\n\nexport type GqlCoin = {\n amount: Scalars['U64']['output'];\n assetId: Scalars['AssetId']['output'];\n /** TxPointer - the height of the block this coin was created in */\n blockCreated: Scalars['U32']['output'];\n owner: Scalars['Address']['output'];\n /** TxPointer - the index of the transaction that created this coin */\n txCreatedIdx: Scalars['U16']['output'];\n utxoId: Scalars['UtxoId']['output'];\n};\n\nexport type GqlCoinConnection = {\n /** A list of edges. */\n edges: Array<GqlCoinEdge>;\n /** A list of nodes. */\n nodes: Array<GqlCoin>;\n /** Information to aid in pagination. */\n pageInfo: GqlPageInfo;\n};\n\n/** An edge in a connection. */\nexport type GqlCoinEdge = {\n /** A cursor for use in pagination */\n cursor: Scalars['String']['output'];\n /** The item at the end of the edge */\n node: GqlCoin;\n};\n\nexport type GqlCoinFilterInput = {\n /** Returns coins only with `asset_id`. */\n assetId?: InputMaybe<Scalars['AssetId']['input']>;\n /** Returns coins owned by the `owner`. */\n owner: Scalars['Address']['input'];\n};\n\nexport type GqlCoinOutput = {\n amount: Scalars['U64']['output'];\n assetId: Scalars['AssetId']['output'];\n to: Scalars['Address']['output'];\n};\n\n/** The schema analog of the [`coins::CoinType`]. */\nexport type GqlCoinType = GqlCoin | GqlMessageCoin;\n\nexport type GqlConsensus = GqlGenesis | GqlPoAConsensus;\n\nexport type GqlConsensusParameters = {\n baseAssetId: Scalars['AssetId']['output'];\n blockGasLimit: Scalars['U64']['output'];\n blockTransactionSizeLimit: Scalars['U64']['output'];\n chainId: Scalars['U64']['output'];\n contractParams: GqlContractParameters;\n feeParams: GqlFeeParameters;\n gasCosts: GqlGasCosts;\n predicateParams: GqlPredicateParameters;\n privilegedAddress: Scalars['Address']['output'];\n scriptParams: GqlScriptParameters;\n txParams: GqlTxParameters;\n version: GqlConsensusParametersVersion;\n};\n\nexport type GqlConsensusParametersPurpose = {\n checksum: Scalars['Bytes32']['output'];\n witnessIndex: Scalars['U16']['output'];\n};\n\nexport enum GqlConsensusParametersVersion {\n V1 = 'V1'\n}\n\nexport type GqlContract = {\n bytecode: Scalars['HexString']['output'];\n id: Scalars['ContractId']['output'];\n salt: Scalars['Salt']['output'];\n};\n\nexport type GqlContractBalance = {\n amount: Scalars['U64']['output'];\n assetId: Scalars['AssetId']['output'];\n contract: Scalars['ContractId']['output'];\n};\n\nexport type GqlContractBalanceConnection = {\n /** A list of edges. */\n edges: Array<GqlContractBalanceEdge>;\n /** A list of nodes. */\n nodes: Array<GqlContractBalance>;\n /** Information to aid in pagination. */\n pageInfo: GqlPageInfo;\n};\n\n/** An edge in a connection. */\nexport type GqlContractBalanceEdge = {\n /** A cursor for use in pagination */\n cursor: Scalars['String']['output'];\n /** The item at the end of the edge */\n node: GqlContractBalance;\n};\n\nexport type GqlContractBalanceFilterInput = {\n /** Filter assets based on the `contractId` field */\n contract: Scalars['ContractId']['input'];\n};\n\nexport type GqlContractCreated = {\n contract: Scalars['ContractId']['output'];\n stateRoot: Scalars['Bytes32']['output'];\n};\n\nexport type GqlContractOutput = {\n balanceRoot: Scalars['Bytes32']['output'];\n inputIndex: Scalars['U16']['output'];\n stateRoot: Scalars['Bytes32']['output'];\n};\n\nexport type GqlContractParameters = {\n contractMaxSize: Scalars['U64']['output'];\n maxStorageSlots: Scalars['U64']['output'];\n version: GqlContractParametersVersion;\n};\n\nexport enum GqlContractParametersVersion {\n V1 = 'V1'\n}\n\nexport type GqlDependentCost = GqlHeavyOperation | GqlLightOperation;\n\nexport type GqlDryRunFailureStatus = {\n programState?: Maybe<GqlProgramState>;\n reason: Scalars['String']['output'];\n receipts: Array<GqlReceipt>;\n totalFee: Scalars['U64']['output'];\n totalGas: Scalars['U64']['output'];\n};\n\nexport type GqlDryRunSuccessStatus = {\n programState?: Maybe<GqlProgramState>;\n receipts: Array<GqlReceipt>;\n totalFee: Scalars['U64']['output'];\n totalGas: Scalars['U64']['output'];\n};\n\nexport type GqlDryRunTransactionExecutionStatus = {\n id: Scalars['TransactionId']['output'];\n receipts: Array<GqlReceipt>;\n status: GqlDryRunTransactionStatus;\n};\n\nexport type GqlDryRunTransactionStatus = GqlDryRunFailureStatus | GqlDryRunSuccessStatus;\n\nexport type GqlEstimateGasPrice = {\n gasPrice: Scalars['U64']['output'];\n};\n\nexport type GqlExcludeInput = {\n /** Messages to exclude from the selection. */\n messages: Array<Scalars['Nonce']['input']>;\n /** Utxos to exclude from the selection. */\n utxos: Array<Scalars['UtxoId']['input']>;\n};\n\nexport type GqlFailureStatus = {\n block: GqlBlock;\n blockHeight: Scalars['U32']['output'];\n programState?: Maybe<GqlProgramState>;\n reason: Scalars['String']['output'];\n receipts: Array<GqlReceipt>;\n time: Scalars['Tai64Timestamp']['output'];\n totalFee: Scalars['U64']['output'];\n totalGas: Scalars['U64']['output'];\n transaction: GqlTransaction;\n transactionId: Scalars['TransactionId']['output'];\n};\n\nexport type GqlFeeParameters = {\n gasPerByte: Scalars['U64']['output'];\n gasPriceFactor: Scalars['U64']['output'];\n version: GqlFeeParametersVersion;\n};\n\nexport enum GqlFeeParametersVersion {\n V1 = 'V1'\n}\n\nexport type GqlGasCosts = {\n add: Scalars['U64']['output'];\n addi: Scalars['U64']['output'];\n aloc: Scalars['U64']['output'];\n alocDependentCost: GqlDependentCost;\n and: Scalars['U64']['output'];\n andi: Scalars['U64']['output'];\n bal: Scalars['U64']['output'];\n bhei: Scalars['U64']['output'];\n bhsh: Scalars['U64']['output'];\n bldd?: Maybe<GqlDependentCost>;\n bsiz?: Maybe<GqlDependentCost>;\n burn: Scalars['U64']['output'];\n call: GqlDependentCost;\n cb: Scalars['U64']['output'];\n ccp: GqlDependentCost;\n cfe: GqlDependentCost;\n cfei: Scalars['U64']['output'];\n cfeiDependentCost: GqlDependentCost;\n cfsi: Scalars['U64']['output'];\n contractRoot: GqlDependentCost;\n croo: GqlDependentCost;\n csiz: GqlDependentCost;\n div: Scalars['U64']['output'];\n divi: Scalars['U64']['output'];\n eck1: Scalars['U64']['output'];\n ecr1: Scalars['U64']['output'];\n ed19: Scalars['U64']['output'];\n ed19DependentCost: GqlDependentCost;\n eq: Scalars['U64']['output'];\n exp: Scalars['U64']['output'];\n expi: Scalars['U64']['output'];\n flag: Scalars['U64']['output'];\n gm: Scalars['U64']['output'];\n gt: Scalars['U64']['output'];\n gtf: Scalars['U64']['output'];\n ji: Scalars['U64']['output'];\n jmp: Scalars['U64']['output'];\n jmpb: Scalars['U64']['output'];\n jmpf: Scalars['U64']['output'];\n jne: Scalars['U64']['output'];\n jneb: Scalars['U64']['output'];\n jnef: Scalars['U64']['output'];\n jnei: Scalars['U64']['output'];\n jnzb: Scalars['U64']['output'];\n jnzf: Scalars['U64']['output'];\n jnzi: Scalars['U64']['output'];\n k256: GqlDependentCost;\n lb: Scalars['U64']['output'];\n ldc: GqlDependentCost;\n log: Scalars['U64']['output'];\n logd: GqlDependentCost;\n lt: Scalars['U64']['output'];\n lw: Scalars['U64']['output'];\n mcl: GqlDependentCost;\n mcli: GqlDependentCost;\n mcp: GqlDependentCost;\n mcpi: GqlDependentCost;\n meq: GqlDependentCost;\n mint: Scalars['U64']['output'];\n mldv: Scalars['U64']['output'];\n mlog: Scalars['U64']['output'];\n modOp: Scalars['U64']['output'];\n modi: Scalars['U64']['output'];\n moveOp: Scalars['U64']['output'];\n movi: Scalars['U64']['output'];\n mroo: Scalars['U64']['output'];\n mul: Scalars['U64']['output'];\n muli: Scalars['U64']['output'];\n newStoragePerByte: Scalars['U64']['output'];\n noop: Scalars['U64']['output'];\n not: Scalars['U64']['output'];\n or: Scalars['U64']['output'];\n ori: Scalars['U64']['output'];\n poph: Scalars['U64']['output'];\n popl: Scalars['U64']['output'];\n pshh: Scalars['U64']['output'];\n pshl: Scalars['U64']['output'];\n ret: Scalars['U64']['output'];\n retd: GqlDependentCost;\n rvrt: Scalars['U64']['output'];\n s256: GqlDependentCost;\n sb: Scalars['U64']['output'];\n scwq: GqlDependentCost;\n sll: Scalars['U64']['output'];\n slli: Scalars['U64']['output'];\n smo: GqlDependentCost;\n srl: Scalars['U64']['output'];\n srli: Scalars['U64']['output'];\n srw: Scalars['U64']['output'];\n srwq: GqlDependentCost;\n stateRoot: GqlDependentCost;\n sub: Scalars['U64']['output'];\n subi: Scalars['U64']['output'];\n sw: Scalars['U64']['output'];\n sww: Scalars['U64']['output'];\n swwq: GqlDependentCost;\n time: Scalars['U64']['output'];\n tr: Scalars['U64']['output'];\n tro: Scalars['U64']['output'];\n version: GqlGasCostsVersion;\n vmInitialization: GqlDependentCost;\n wdam: Scalars['U64']['output'];\n wdcm: Scalars['U64']['output'];\n wddv: Scalars['U64']['output'];\n wdmd: Scalars['U64']['output'];\n wdml: Scalars['U64']['output'];\n wdmm: Scalars['U64']['output'];\n wdop: Scalars['U64']['output'];\n wqam: Scalars['U64']['output'];\n wqcm: Scalars['U64']['output'];\n wqdv: Scalars['U64']['output'];\n wqmd: Scalars['U64']['output'];\n wqml: Scalars['U64']['output'];\n wqmm: Scalars['U64']['output'];\n wqop: Scalars['U64']['output'];\n xor: Scalars['U64']['output'];\n xori: Scalars['U64']['output'];\n};\n\nexport enum GqlGasCostsVersion {\n V1 = 'V1'\n}\n\nexport type GqlGenesis = {\n /**\n * The chain configs define what consensus type to use, what settlement layer to use,\n * rules of block validity, etc.\n */\n chainConfigHash: Scalars['Bytes32']['output'];\n /** The Binary Merkle Tree root of all genesis coins. */\n coinsRoot: Scalars['Bytes32']['output'];\n /** The Binary Merkle Tree root of state, balances, contracts code hash of each contract. */\n contractsRoot: Scalars['Bytes32']['output'];\n /** The Binary Merkle Tree root of all genesis messages. */\n messagesRoot: Scalars['Bytes32']['output'];\n /** The Binary Merkle Tree root of all processed transaction ids. */\n transactionsRoot: Scalars['Bytes32']['output'];\n};\n\nexport type GqlHeader = {\n /** Hash of the application header. */\n applicationHash: Scalars['Bytes32']['output'];\n /** The version of the consensus parameters used to create this block. */\n consensusParametersVersion: Scalars['U32']['output'];\n /** The layer 1 height of messages and events to include since the last layer 1 block number. */\n daHeight: Scalars['U64']['output'];\n /** Merkle root of inbox events in this block. */\n eventInboxRoot: Scalars['Bytes32']['output'];\n /** Fuel block height. */\n height: Scalars['U32']['output'];\n /** Hash of the header */\n id: Scalars['BlockId']['output'];\n /** Merkle root of message receipts in this block. */\n messageOutboxRoot: Scalars['Bytes32']['output'];\n /** Number of message receipts in this block. */\n messageReceiptCount: Scalars['U32']['output'];\n /** Merkle root of all previous block header hashes. */\n prevRoot: Scalars['Bytes32']['output'];\n /** The version of the state transition bytecode used to create this block. */\n stateTransitionBytecodeVersion: Scalars['U32']['output'];\n /** The block producer time. */\n time: Scalars['Tai64Timestamp']['output'];\n /** Number of transactions in this block. */\n transactionsCount: Scalars['U16']['output'];\n /** Merkle root of transactions. */\n transactionsRoot: Scalars['Bytes32']['output'];\n /** Version of the header */\n version: GqlHeaderVersion;\n};\n\nexport enum GqlHeaderVersion {\n V1 = 'V1'\n}\n\nexport type GqlHeavyOperation = {\n base: Scalars['U64']['output'];\n gasPerUnit: Scalars['U64']['output'];\n};\n\nexport type GqlInput = GqlInputCoin | GqlInputContract | GqlInputMessage;\n\nexport type GqlInputCoin = {\n amount: Scalars['U64']['output'];\n assetId: Scalars['AssetId']['output'];\n owner: Scalars['Address']['output'];\n predicate: Scalars['HexString']['output'];\n predicateData: Scalars['HexString']['output'];\n predicateGasUsed: Scalars['U64']['output'];\n txPointer: Scalars['TxPointer']['output'];\n utxoId: Scalars['UtxoId']['output'];\n witnessIndex: Scalars['Int']['output'];\n};\n\nexport type GqlInputContract = {\n balanceRoot: Scalars['Bytes32']['output'];\n contractId: Scalars['ContractId']['output'];\n stateRoot: Scalars['Bytes32']['output'];\n txPointer: Scalars['TxPointer']['output'];\n utxoId: Scalars['UtxoId']['output'];\n};\n\nexport type GqlInputMessage = {\n amount: Scalars['U64']['output'];\n data: Scalars['HexString']['output'];\n nonce: Scalars['Nonce']['output'];\n predicate: Scalars['HexString']['output'];\n predicateData: Scalars['HexString']['output'];\n predicateGasUsed: Scalars['U64']['output'];\n recipient: Scalars['Address']['output'];\n sender: Scalars['Address']['output'];\n witnessIndex: Scalars['U16']['output'];\n};\n\nexport type GqlLatestGasPrice = {\n blockHeight: Scalars['U32']['output'];\n gasPrice: Scalars['U64']['output'];\n};\n\nexport type GqlLightOperation = {\n base: Scalars['U64']['output'];\n unitsPerGas: Scalars['U64']['output'];\n};\n\nexport type GqlMerkleProof = {\n proofIndex: Scalars['U64']['output'];\n proofSet: Array<Scalars['Bytes32']['output']>;\n};\n\nexport type GqlMessage = {\n amount: Scalars['U64']['output'];\n daHeight: Scalars['U64']['output'];\n data: Scalars['HexString']['output'];\n nonce: Scalars['Nonce']['output'];\n recipient: Scalars['Address']['output'];\n sender: Scalars['Address']['output'];\n};\n\nexport type GqlMessageCoin = {\n amount: Scalars['U64']['output'];\n assetId: Scalars['AssetId']['output'];\n daHeight: Scalars['U64']['output'];\n nonce: Scalars['Nonce']['output'];\n recipient: Scalars['Address']['output'];\n sender: Scalars['Address']['output'];\n};\n\nexport type GqlMessageConnection = {\n /** A list of edges. */\n edges: Array<GqlMessageEdge>;\n /** A list of nodes. */\n nodes: Array<GqlMessage>;\n /** Information to aid in pagination. */\n pageInfo: GqlPageInfo;\n};\n\n/** An edge in a connection. */\nexport type GqlMessageEdge = {\n /** A cursor for use in pagination */\n cursor: Scalars['String']['output'];\n /** The item at the end of the edge */\n node: GqlMessage;\n};\n\nexport type GqlMessageProof = {\n amount: Scalars['U64']['output'];\n blockProof: GqlMerkleProof;\n commitBlockHeader: GqlHeader;\n data: Scalars['HexString']['output'];\n messageBlockHeader: GqlHeader;\n messageProof: GqlMerkleProof;\n nonce: Scalars['Nonce']['output'];\n recipient: Scalars['Address']['output'];\n sender: Scalars['Address']['output'];\n};\n\nexport enum GqlMessageState {\n NotFound = 'NOT_FOUND',\n Spent = 'SPENT',\n Unspent = 'UNSPENT'\n}\n\nexport type GqlMessageStatus = {\n state: GqlMessageState;\n};\n\nexport type GqlMutation = {\n /**\n * Resume execution of the VM instance after a breakpoint.\n * Runs until the next breakpoint or until the transaction completes.\n */\n continueTx: GqlRunResult;\n /** Execute a dry-run of multiple transactions using a fork of current state, no changes are committed. */\n dryRun: Array<GqlDryRunTransactionExecutionStatus>;\n /** End debugger session. */\n endSession: Scalars['Boolean']['output'];\n /** Execute a single fuel-asm instruction. */\n execute: Scalars['Boolean']['output'];\n /**\n * Sequentially produces `blocks_to_produce` blocks. The first block starts with\n * `start_timestamp`. If the block production in the [`crate::service::Config`] is\n * `Trigger::Interval { block_time }`, produces blocks with `block_time ` intervals between\n * them. The `start_timestamp` is the timestamp in seconds.\n */\n produceBlocks: Scalars['U32']['output'];\n /** Reset the VM instance to the initial state. */\n reset: Scalars['Boolean']['output'];\n /** Set a breakpoint for a VM instance. */\n setBreakpoint: Scalars['Boolean']['output'];\n /** Set single-stepping mode for the VM instance. */\n setSingleStepping: Scalars['Boolean']['output'];\n /**\n * Initialize a new debugger session, returning its ID.\n * A new VM instance is spawned for each session.\n * The session is run in a separate database transaction,\n * on top of the most recent node state.\n */\n startSession: Scalars['ID']['output'];\n /**\n * Run a single transaction in given session until it\n * hits a breakpoint or completes.\n */\n startTx: GqlRunResult;\n /**\n * Submits transaction to the `TxPool`.\n *\n * Returns submitted transaction if the transaction is included in the `TxPool` without problems.\n */\n submit: GqlTransaction;\n};\n\n\nexport type GqlMutationContinueTxArgs = {\n id: Scalars['ID']['input'];\n};\n\n\nexport type GqlMutationDryRunArgs = {\n gasPrice?: InputMaybe<Scalars['U64']['input']>;\n txs: Array<Scalars['HexString']['input']>;\n utxoValidation?: InputMaybe<Scalars['Boolean']['input']>;\n};\n\n\nexport type GqlMutationEndSessionArgs = {\n id: Scalars['ID']['input'];\n};\n\n\nexport type GqlMutationExecuteArgs = {\n id: Scalars['ID']['input'];\n op: Scalars['String']['input'];\n};\n\n\nexport type GqlMutationProduceBlocksArgs = {\n blocksToProduce: Scalars['U32']['input'];\n startTimestamp?: InputMaybe<Scalars['Tai64Timestamp']['input']>;\n};\n\n\nexport type GqlMutationResetArgs = {\n id: Scalars['ID']['input'];\n};\n\n\nexport type GqlMutationSetBreakpointArgs = {\n breakpoint: GqlBreakpoint;\n id: Scalars['ID']['input'];\n};\n\n\nexport type GqlMutationSetSingleSteppingArgs = {\n enable: Scalars['Boolean']['input'];\n id: Scalars['ID']['input'];\n};\n\n\nexport type GqlMutationStartTxArgs = {\n id: Scalars['ID']['input'];\n txJson: Scalars['String']['input'];\n};\n\n\nexport type GqlMutationSubmitArgs = {\n tx: Scalars['HexString']['input'];\n};\n\nexport type GqlNodeInfo = {\n maxDepth: Scalars['U64']['output'];\n maxTx: Scalars['U64']['output'];\n nodeVersion: Scalars['String']['output'];\n peers: Array<GqlPeerInfo>;\n utxoValidation: Scalars['Boolean']['output'];\n vmBacktrace: Scalars['Boolean']['output'];\n};\n\nexport type GqlOutput = GqlChangeOutput | GqlCoinOutput | GqlContractCreated | GqlContractOutput | GqlVariableOutput;\n\n/**\n * A separate `Breakpoint` type to be used as an output, as a single\n * type cannot act as both input and output type in async-graphql\n */\nexport type GqlOutputBreakpoint = {\n contract: Scalars['ContractId']['output'];\n pc: Scalars['U64']['output'];\n};\n\n/** Information about pagination in a connection */\nexport type GqlPageInfo = {\n /** When paginating forwards, the cursor to continue. */\n endCursor?: Maybe<Scalars['String']['output']>;\n /** When paginating forwards, are there more items? */\n hasNextPage: Scalars['Boolean']['output'];\n /** When paginating backwards, are there more items? */\n hasPreviousPage: Scalars['Boolean']['output'];\n /** When paginating backwards, the cursor to continue. */\n startCursor?: Maybe<Scalars['String']['output']>;\n};\n\nexport type GqlPeerInfo = {\n /** The advertised multi-addrs that can be used to connect to this peer */\n addresses: Array<Scalars['String']['output']>;\n /** The internal fuel p2p reputation of this peer */\n appScore: Scalars['Float']['output'];\n /** The last reported height of the peer */\n blockHeight?: Maybe<Scalars['U32']['output']>;\n /** The self-reported version of the client the peer is using */\n clientVersion?: Maybe<Scalars['String']['output']>;\n /** The libp2p peer id */\n id: Scalars['String']['output'];\n /** The last heartbeat from this peer in unix epoch time ms */\n lastHeartbeatMs: Scalars['U64']['output'];\n};\n\nexport type GqlPoAConsensus = {\n /** Gets the signature of the block produced by `PoA` consensus. */\n signature: Scalars['Signature']['output'];\n};\n\nexport type GqlPolicies = {\n maturity?: Maybe<Scalars['U32']['output']>;\n maxFee?: Maybe<Scalars['U64']['output']>;\n tip?: Maybe<Scalars['U64']['output']>;\n witnessLimit?: Maybe<Scalars['U64']['output']>;\n};\n\nexport type GqlPredicateParameters = {\n maxGasPerPredicate: Scalars['U64']['output'];\n maxMessageDataLength: Scalars['U64']['output'];\n maxPredicateDataLength: Scalars['U64']['output'];\n maxPredicateLength: Scalars['U64']['output'];\n version: GqlPredicateParametersVersion;\n};\n\nexport enum GqlPredicateParametersVersion {\n V1 = 'V1'\n}\n\nexport type GqlProgramState = {\n data: Scalars['HexString']['output'];\n returnType: GqlReturnType;\n};\n\nexport type GqlQuery = {\n balance: GqlBalance;\n balances: GqlBalanceConnection;\n blob?: Maybe<GqlBlob>;\n block?: Maybe<GqlBlock>;\n blocks: GqlBlockConnection;\n chain: GqlChainInfo;\n /** Gets the coin by `utxo_id`. */\n coin?: Maybe<GqlCoin>;\n /** Gets all unspent coins of some `owner` maybe filtered with by `asset_id` per page. */\n coins: GqlCoinConnection;\n /**\n * For each `query_per_asset`, get some spendable coins(of asset specified by the query) owned by\n * `owner` that add up at least the query amount. The returned coins can be spent.\n * The number of coins is optimized to prevent dust accumulation.\n *\n * The query supports excluding and maximum the number of coins.\n *\n * Returns:\n * The list of spendable coins per asset from the query. The length of the result is\n * the same as the length of `query_per_asset`. The ordering of assets and `query_per_asset`\n * is the same.\n */\n coinsToSpend: Array<Array<GqlCoinType>>;\n consensusParameters: GqlConsensusParameters;\n contract?: Maybe<GqlContract>;\n contractBalance: GqlContractBalance;\n contractBalances: GqlContractBalanceConnection;\n estimateGasPrice: GqlEstimateGasPrice;\n /** Estimate the predicate gas for the provided transaction */\n estimatePredicates: GqlTransaction;\n /** Returns true when the GraphQL API is serving requests. */\n health: Scalars['Boolean']['output'];\n latestGasPrice: GqlLatestGasPrice;\n /** Read read a range of memory bytes. */\n memory: Scalars['String']['output'];\n message?: Maybe<GqlMessage>;\n messageProof?: Maybe<GqlMessageProof>;\n messageStatus: GqlMessageStatus;\n messages: GqlMessageConnection;\n nodeInfo: GqlNodeInfo;\n /** Read register value by index. */\n register: Scalars['U64']['output'];\n relayedTransactionStatus?: Maybe<GqlRelayedTransactionStatus>;\n stateTransitionBytecodeByRoot: GqlStateTransitionBytecode;\n stateTransitionBytecodeByVersion?: Maybe<GqlStateTransitionBytecode>;\n transaction?: Maybe<GqlTransaction>;\n transactions: GqlTransactionConnection;\n transactionsByOwner: GqlTransactionConnection;\n};\n\n\nexport type GqlQueryBalanceArgs = {\n assetId: Scalars['AssetId']['input'];\n owner: Scalars['Address']['input'];\n};\n\n\nexport type GqlQueryBalancesArgs = {\n after?: InputMaybe<Scalars['String']['input']>;\n before?: InputMaybe<Scalars['String']['input']>;\n filter: GqlBalanceFilterInput;\n first?: InputMaybe<Scalars['Int']['input']>;\n last?: InputMaybe<Scalars['Int']['input']>;\n};\n\n\nexport type GqlQueryBlobArgs = {\n id: Scalars['BlobId']['input'];\n};\n\n\nexport type GqlQueryBlockArgs = {\n height?: InputMaybe<Scalars['U32']['input']>;\n id?: InputMaybe<Scalars['BlockId']['input']>;\n};\n\n\nexport type GqlQueryBlocksArgs = {\n after?: InputMaybe<Scalars['String']['input']>;\n before?: InputMaybe<Scalars['String']['input']>;\n first?: InputMaybe<Scalars['Int']['input']>;\n last?: InputMaybe<Scalars['Int']['input']>;\n};\n\n\nexport type GqlQueryCoinArgs = {\n utxoId: Scalars['UtxoId']['input'];\n};\n\n\nexport type GqlQueryCoinsArgs = {\n after?: InputMaybe<Scalars['String']['input']>;\n before?: InputMaybe<Scalars['String']['input']>;\n filter: GqlCoinFilterInput;\n first?: InputMaybe<Scalars['Int']['input']>;\n last?: InputMaybe<Scalars['Int']['input']>;\n};\n\n\nexport type GqlQueryCoinsToSpendArgs = {\n excludedIds?: InputMaybe<GqlExcludeInput>;\n owner: Scalars['Address']['input'];\n queryPerAsset: Array<GqlSpendQueryElementInput>;\n};\n\n\nexport type GqlQueryConsensusParametersArgs = {\n version: Scalars['Int']['input'];\n};\n\n\nexport type GqlQueryContractArgs = {\n id: Scalars['ContractId']['input'];\n};\n\n\nexport type GqlQueryContractBalanceArgs = {\n asset: Scalars['AssetId']['input'];\n contract: Scalars['ContractId']['input'];\n};\n\n\nexport type GqlQueryContractBalancesArgs = {\n after?: InputMaybe<Scalars['String']['input']>;\n before?: InputMaybe<Scalars['String']['input']>;\n filter: GqlContractBalanceFilterInput;\n first?: InputMaybe<Scalars['Int']['input']>;\n last?: InputMaybe<Scalars['Int']['input']>;\n};\n\n\nexport type GqlQueryEstimateGasPriceArgs = {\n blockHorizon?: InputMaybe<Scalars['U32']['input']>;\n};\n\n\nexport type GqlQueryEstimatePredicatesArgs = {\n tx: Scalars['HexString']['input'];\n};\n\n\nexport type GqlQueryMemoryArgs = {\n id: Scalars['ID']['input'];\n size: Scalars['U32']['input'];\n start: Scalars['U32']['input'];\n};\n\n\nexport type GqlQueryMessageArgs = {\n nonce: Scalars['Nonce']['input'];\n};\n\n\nexport type GqlQueryMessageProofArgs = {\n commitBlockHeight?: InputMaybe<Scalars['U32']['input']>;\n commitBlockId?: InputMaybe<Scalars['BlockId']['input']>;\n nonce: Scalars['Nonce']['input'];\n transactionId: Scalars['TransactionId']['input'];\n};\n\n\nexport type GqlQueryMessageStatusArgs = {\n nonce: Scalars['Nonce']['input'];\n};\n\n\nexport type GqlQueryMessagesArgs = {\n after?: InputMaybe<Scalars['String']['input']>;\n before?: InputMaybe<Scalars['String']['input']>;\n first?: InputMaybe<Scalars['Int']['input']>;\n last?: InputMaybe<Scalars['Int']['input']>;\n owner?: InputMaybe<Scalars['Address']['input']>;\n};\n\n\nexport type GqlQueryRegisterArgs = {\n id: Scalars['ID']['input'];\n register: Scalars['U32']['input'];\n};\n\n\nexport type GqlQueryRelayedTransactionStatusArgs = {\n id: Scalars['RelayedTransactionId']['input'];\n};\n\n\nexport type GqlQueryStateTransitionBytecodeByRootArgs = {\n root: Scalars['HexString']['input'];\n};\n\n\nexport type GqlQueryStateTransitionBytecodeByVersionArgs = {\n version: Scalars['Int']['input'];\n};\n\n\nexport type GqlQueryTransactionArgs = {\n id: Scalars['TransactionId']['input'];\n};\n\n\nexport type GqlQueryTransactionsArgs = {\n after?: InputMaybe<Scalars['String']['input']>;\n before?: InputMaybe<Scalars['String']['input']>;\n first?: InputMaybe<Scalars['Int']['input']>;\n last?: InputMaybe<Scalars['Int']['input']>;\n};\n\n\nexport type GqlQueryTransactionsByOwnerArgs = {\n after?: InputMaybe<Scalars['String']['input']>;\n before?: InputMaybe<Scalars['String']['input']>;\n first?: InputMaybe<Scalars['Int']['input']>;\n last?: InputMaybe<Scalars['Int']['input']>;\n owner: Scalars['Address']['input'];\n};\n\nexport type GqlReceipt = {\n amount?: Maybe<Scalars['U64']['output']>;\n assetId?: Maybe<Scalars['AssetId']['output']>;\n /** Set in the case of a Panic receipt to indicate a missing contract input id */\n contractId?: Maybe<Scalars['ContractId']['output']>;\n data?: Maybe<Scalars['HexString']['output']>;\n digest?: Maybe<Scalars['Bytes32']['output']>;\n gas?: Maybe<Scalars['U64']['output']>;\n gasUsed?: Maybe<Scalars['U64']['output']>;\n id?: Maybe<Scalars['ContractId']['output']>;\n is?: Maybe<Scalars['U64']['output']>;\n len?: Maybe<Scalars['U64']['output']>;\n nonce?: Maybe<Scalars['Nonce']['output']>;\n param1?: Maybe<Scalars['U64']['output']>;\n param2?: Maybe<Scalars['U64']['output']>;\n pc?: Maybe<Scalars['U64']['output']>;\n ptr?: Maybe<Scalars['U64']['output']>;\n ra?: Maybe<Scalars['U64']['output']>;\n rb?: Maybe<Scalars['U64']['output']>;\n rc?: Maybe<Scalars['U64']['output']>;\n rd?: Maybe<Scalars['U64']['output']>;\n reason?: Maybe<Scalars['U64']['output']>;\n receiptType: GqlReceiptType;\n recipient?: Maybe<Scalars['Address']['output']>;\n result?: Maybe<Scalars['U64']['output']>;\n sender?: Maybe<Scalars['Address']['output']>;\n subId?: Maybe<Scalars['Bytes32']['output']>;\n to?: Maybe<Scalars['ContractId']['output']>;\n toAddress?: Maybe<Scalars['Address']['output']>;\n val?: Maybe<Scalars['U64']['output']>;\n};\n\nexport enum GqlReceiptType {\n Burn = 'BURN',\n Call = 'CALL',\n Log = 'LOG',\n LogData = 'LOG_DATA',\n MessageOut = 'MESSAGE_OUT',\n Mint = 'MINT',\n Panic = 'PANIC',\n Return = 'RETURN',\n ReturnData = 'RETURN_DATA',\n Revert = 'REVERT',\n ScriptResult = 'SCRIPT_RESULT',\n Transfer = 'TRANSFER',\n TransferOut = 'TRANSFER_OUT'\n}\n\nexport type GqlRelayedTransactionFailed = {\n blockHeight: Scalars['U32']['output'];\n failure: Scalars['String']['output'];\n};\n\nexport type GqlRelayedTransactionStatus = GqlRelayedTransactionFailed;\n\nexport enum GqlReturnType {\n Return = 'RETURN',\n ReturnData = 'RETURN_DATA',\n Revert = 'REVERT'\n}\n\nexport type GqlRunResult = {\n breakpoint?: Maybe<GqlOutputBreakpoint>;\n jsonReceipts: Array<Scalars['String']['output']>;\n state: GqlRunState;\n};\n\nexport enum GqlRunState {\n /** Stopped on a breakpoint */\n Breakpoint = 'BREAKPOINT',\n /** All breakpoints have been processed, and the program has terminated */\n Completed = 'COMPLETED'\n}\n\nexport type GqlScriptParameters = {\n maxScriptDataLength: Scalars['U64']['output'];\n maxScriptLength: Scalars['U64']['output'];\n version: GqlScriptParametersVersion;\n};\n\nexport enum GqlScriptParametersVersion {\n V1 = 'V1'\n}\n\nexport type GqlSpendQueryElementInput = {\n /** Target amount for the query. */\n amount: Scalars['U64']['input'];\n /** Identifier of the asset to spend. */\n assetId: Scalars['AssetId']['input'];\n /** The maximum number of currencies for selection. */\n max?: InputMaybe<Scalars['U32']['input']>;\n};\n\nexport type GqlSqueezedOutStatus = {\n reason: Scalars['String']['output'];\n};\n\nexport type GqlStateTransitionBytecode = {\n bytecode: GqlUploadedBytecode;\n root: Scalars['HexString']['output'];\n};\n\nexport type GqlStateTransitionPurpose = {\n root: Scalars['Bytes32']['output'];\n};\n\nexport type GqlSubmittedStatus = {\n time: Scalars['Tai64Timestamp']['output'];\n};\n\nexport type GqlSubscription = {\n /**\n * Returns a stream of status updates for the given transaction id.\n * If the current status is [`TransactionStatus::Success`], [`TransactionStatus::SqueezedOut`]\n * or [`TransactionStatus::Failed`] the stream will return that and end immediately.\n * If the current status is [`TransactionStatus::Submitted`] this will be returned\n * and the stream will wait for a future update.\n *\n * This stream will wait forever so it's advised to use within a timeout.\n *\n * It is possible for the stream to miss an update if it is polled slower\n * then the updates arrive. In such a case the stream will close without\n * a status. If this occurs the stream can simply be restarted to return\n * the latest status.\n */\n statusChange: GqlTransactionStatus;\n /** Submits transaction to the `TxPool` and await either confirmation or failure. */\n submitAndAwait: GqlTransactionStatus;\n /**\n * Submits the transaction to the `TxPool` and returns a stream of events.\n * Compared to the `submitAndAwait`, the stream also contains `\n * SubmittedStatus` as an intermediate state.\n */\n submitAndAwaitStatus: GqlTransactionStatus;\n};\n\n\nexport type GqlSubscriptionStatusChangeArgs = {\n id: Scalars['TransactionId']['input'];\n};\n\n\nexport type GqlSubscriptionSubmitAndAwaitArgs = {\n tx: Scalars['HexString']['input'];\n};\n\n\nexport type GqlSubscriptionSubmitAndAwaitStatusArgs = {\n tx: Scalars['HexString']['input'];\n};\n\nexport type GqlSuccessStatus = {\n block: GqlBlock;\n blockHeight: Scalars['U32']['output'];\n programState?: Maybe<GqlProgramState>;\n receipts: Array<GqlReceipt>;\n time: Scalars['Tai64Timestamp']['output'];\n totalFee: Scalars['U64']['output'];\n totalGas: Scalars['U64']['output'];\n transaction: GqlTransaction;\n transactionId: Scalars['TransactionId']['output'];\n};\n\nexport type GqlTransaction = {\n blobId?: Maybe<Scalars['BlobId']['output']>;\n bytecodeRoot?: Maybe<Scalars['Bytes32']['output']>;\n bytecodeWitnessIndex?: Maybe<Scalars['U16']['output']>;\n id: Scalars['TransactionId']['output'];\n inputAssetIds?: Maybe<Array<Scalars['AssetId']['output']>>;\n inputContract?: Maybe<GqlInputContract>;\n inputContracts?: Maybe<Array<Scalars['ContractId']['output']>>;\n inputs?: Maybe<Array<GqlInput>>;\n isBlob: Scalars['Boolean']['output'];\n isCreate: Scalars['Boolean']['output'];\n isMint: Scalars['Boolean']['output'];\n isScript: Scalars['Boolean']['output'];\n isUpgrade: Scalars['Boolean']['output'];\n isUpload: Scalars['Boolean']['output'];\n maturity?: Maybe<Scalars['U32']['output']>;\n mintAmount?: Maybe<Scalars['U64']['output']>;\n mintAssetId?: Maybe<Scalars['AssetId']['output']>;\n mintGasPrice?: Maybe<Scalars['U64']['output']>;\n outputContract?: Maybe<GqlContractOutput>;\n outputs: Array<GqlOutput>;\n policies?: Maybe<GqlPolicies>;\n proofSet?: Maybe<Array<Scalars['Bytes32']['output']>>;\n /** Return the transaction bytes using canonical encoding */\n rawPayload: Scalars['HexString']['output'];\n receiptsRoot?: Maybe<Scalars['Bytes32']['output']>;\n salt?: Maybe<Scalars['Salt']['output']>;\n script?: Maybe<Scalars['HexString']['output']>;\n scriptData?: Maybe<Scalars['HexString']['output']>;\n scriptGasLimit?: Maybe<Scalars['U64']['output']>;\n status?: Maybe<GqlTransactionStatus>;\n storageSlots?: Maybe<Array<Scalars['HexString']['output']>>;\n subsectionIndex?: Maybe<Scalars['U16']['output']>;\n subsectionsNumber?: Maybe<Scalars['U16']['output']>;\n txPointer?: Maybe<Scalars['TxPointer']['output']>;\n upgradePurpose?: Maybe<GqlUpgradePurpose>;\n witnesses?: Maybe<Array<Scalars['HexString']['output']>>;\n};\n\nexport type GqlTransactionConnection = {\n /** A list of edges. */\n edges: Array<GqlTransactionEdge>;\n /** A list of nodes. */\n nodes: Array<GqlTransaction>;\n /** Information to aid in pagination. */\n pageInfo: GqlPageInfo;\n};\n\n/** An edge in a connection. */\nexport type GqlTransactionEdge = {\n /** A cursor for use in pagination */\n cursor: Scalars['String']['output'];\n /** The item at the end of the edge */\n node: GqlTransaction;\n};\n\nexport type GqlTransactionStatus = GqlFailureStatus | GqlSqueezedOutStatus | GqlSubmittedStatus | GqlSuccessStatus;\n\nexport type GqlTxParameters = {\n maxBytecodeSubsections: Scalars['U16']['output'];\n maxGasPerTx: Scalars['U64']['output'];\n maxInputs: Scalars['U16']['output'];\n maxOutputs: Scalars['U16']['output'];\n maxSize: Scalars['U64']['output'];\n maxWitnesses: Scalars['U32']['output'];\n version: GqlTxParametersVersion;\n};\n\nexport enum GqlTxParametersVersion {\n V1 = 'V1'\n}\n\nexport type GqlUpgradePurpose = GqlConsensusParametersPurpose | GqlStateTransitionPurpose;\n\nexport type GqlUploadedBytecode = {\n /** Combined bytecode of all uploaded subsections. */\n bytecode: Scalars['HexString']['output'];\n /** Indicates if the bytecode upload is complete. */\n completed: Scalars['Boolean']['output'];\n /** Number of uploaded subsections (if incomplete). */\n uploadedSubsectionsNumber?: Maybe<Scalars['Int']['output']>;\n};\n\nexport type GqlVariableOutput = {\n amount: Scalars['U64']['output'];\n assetId: Scalars['AssetId']['output'];\n to: Scalars['Address']['output'];\n};\n\nexport type GqlSubmittedStatusFragment = { time: string, type: 'SubmittedStatus' };\n\nexport type GqlSuccessStatusFragment = { time: string, totalGas: string, totalFee: string, type: 'SuccessStatus', programState?: { returnType: GqlReturnType, data: string } | null, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> };\n\nexport type GqlSuccessStatusWithBlockIdFragment = { time: string, totalGas: string, totalFee: string, type: 'SuccessStatus', block: { id: string }, programState?: { returnType: GqlReturnType, data: string } | null, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> };\n\nexport type GqlFailureStatusFragment = { totalGas: string, totalFee: string, time: string, reason: string, type: 'FailureStatus', receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> };\n\nexport type GqlFailureStatusWithBlockIdFragment = { totalGas: string, totalFee: string, time: string, reason: string, type: 'FailureStatus', block: { id: string }, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> };\n\nexport type GqlSqueezedOutStatusFragment = { reason: string, type: 'SqueezedOutStatus' };\n\ntype GqlTransactionStatusFragment_FailureStatus = { totalGas: string, totalFee: string, time: string, reason: string, type: 'FailureStatus', receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> };\n\ntype GqlTransactionStatusFragment_SqueezedOutStatus = { reason: string, type: 'SqueezedOutStatus' };\n\ntype GqlTransactionStatusFragment_SubmittedStatus = { time: string, type: 'SubmittedStatus' };\n\ntype GqlTransactionStatusFragment_SuccessStatus = { time: string, totalGas: string, totalFee: string, type: 'SuccessStatus', programState?: { returnType: GqlReturnType, data: string } | null, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> };\n\nexport type GqlTransactionStatusFragment = GqlTransactionStatusFragment_FailureStatus | GqlTransactionStatusFragment_SqueezedOutStatus | GqlTransactionStatusFragment_SubmittedStatus | GqlTransactionStatusFragment_SuccessStatus;\n\nexport type GqlMalleableTransactionFieldsFragment = { receiptsRoot?: string | null, inputs?: Array<{ txPointer: string, type: 'InputCoin' } | { txPointer: string, type: 'InputContract' } | { type: 'InputMessage' }> | null, outputs: Array<{ to: string, amount: string, assetId: string, type: 'ChangeOutput' } | { to: string, amount: string, assetId: string, type: 'CoinOutput' } | { contract: string, stateRoot: string, type: 'ContractCreated' } | { inputIndex: string, balanceRoot: string, stateRoot: string, type: 'ContractOutput' } | { to: string, amount: string, assetId: string, type: 'VariableOutput' }> };\n\ntype GqlTransactionStatusSubscriptionFragment_FailureStatus = { totalGas: string, totalFee: string, time: string, reason: string, type: 'FailureStatus', transaction: { receiptsRoot?: string | null, inputs?: Array<{ txPointer: string, type: 'InputCoin' } | { txPointer: string, type: 'InputContract' } | { type: 'InputMessage' }> | null, outputs: Array<{ to: string, amount: string, assetId: string, type: 'ChangeOutput' } | { to: string, amount: string, assetId: string, type: 'CoinOutput' } | { contract: string, stateRoot: string, type: 'ContractCreated' } | { inputIndex: string, balanceRoot: string, stateRoot: string, type: 'ContractOutput' } | { to: string, amount: string, assetId: string, type: 'VariableOutput' }> }, block: { id: string }, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> };\n\ntype GqlTransactionStatusSubscriptionFragment_SqueezedOutStatus = { reason: string, type: 'SqueezedOutStatus' };\n\ntype GqlTransactionStatusSubscriptionFragment_SubmittedStatus = { time: string, type: 'SubmittedStatus' };\n\ntype GqlTransactionStatusSubscriptionFragment_SuccessStatus = { time: string, totalGas: string, totalFee: string, type: 'SuccessStatus', transaction: { receiptsRoot?: string | null, inputs?: Array<{ txPointer: string, type: 'InputCoin' } | { txPointer: string, type: 'InputContract' } | { type: 'InputMessage' }> | null, outputs: Array<{ to: string, amount: string, assetId: string, type: 'ChangeOutput' } | { to: string, amount: string, assetId: string, type: 'CoinOutput' } | { contract: string, stateRoot: string, type: 'ContractCreated' } | { inputIndex: string, balanceRoot: string, stateRoot: string, type: 'ContractOutput' } | { to: string, amount: string, assetId: string, type: 'VariableOutput' }> }, block: { id: string }, programState?: { returnType: GqlReturnType, data: string } | null, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> };\n\nexport type GqlTransactionStatusSubscriptionFragment = GqlTransactionStatusSubscriptionFragment_FailureStatus | GqlTransactionStatusSubscriptionFragment_SqueezedOutStatus | GqlTransactionStatusSubscriptionFragment_SubmittedStatus | GqlTransactionStatusSubscriptionFragment_SuccessStatus;\n\nexport type GqlTransactionFragment = { id: string, rawPayload: string, status?: { totalGas: string, totalFee: string, time: string, reason: string, type: 'FailureStatus', receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> } | { reason: string, type: 'SqueezedOutStatus' } | { time: string, type: 'SubmittedStatus' } | { time: string, totalGas: string, totalFee: string, type: 'SuccessStatus', programState?: { returnType: GqlReturnType, data: string } | null, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> } | null };\n\nexport type GqlTransactionRawPayloadFragment = { id: string, rawPayload: string };\n\ntype GqlInputEstimatePredicatesFragment_InputCoin = { predicateGasUsed: string };\n\ntype GqlInputEstimatePredicatesFragment_InputContract = {};\n\ntype GqlInputEstimatePredicatesFragment_InputMessage = { predicateGasUsed: string };\n\nexport type GqlInputEstimatePredicatesFragment = GqlInputEstimatePredicatesFragment_InputCoin | GqlInputEstimatePredicatesFragment_InputContract | GqlInputEstimatePredicatesFragment_InputMessage;\n\nexport type GqlTransactionEstimatePredicatesFragment = { inputs?: Array<{ predicateGasUsed: string } | { predicateGasUsed: string } | {}> | null };\n\nexport type GqlDryRunFailureStatusFragment = { totalGas: string, totalFee: string, reason: string, type: 'DryRunFailureStatus', programState?: { returnType: GqlReturnType, data: string } | null };\n\nexport type GqlDryRunSuccessStatusFragment = { totalGas: string, totalFee: string, type: 'DryRunSuccessStatus', programState?: { returnType: GqlReturnType, data: string } | null };\n\nexport type GqlReceiptFragment = { id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null };\n\ntype GqlDryRunTransactionStatusFragment_DryRunFailureStatus = { totalGas: string, totalFee: string, reason: string, type: 'DryRunFailureStatus', programState?: { returnType: GqlReturnType, data: string } | null };\n\ntype GqlDryRunTransactionStatusFragment_DryRunSuccessStatus = { totalGas: string, totalFee: string, type: 'DryRunSuccessStatus', programState?: { returnType: GqlReturnType, data: string } | null };\n\nexport type GqlDryRunTransactionStatusFragment = GqlDryRunTransactionStatusFragment_DryRunFailureStatus | GqlDryRunTransactionStatusFragment_DryRunSuccessStatus;\n\nexport type GqlDryRunTransactionExecutionStatusFragment = { id: string, status: { totalGas: string, totalFee: string, reason: string, type: 'DryRunFailureStatus', programState?: { returnType: GqlReturnType, data: string } | null } | { totalGas: string, totalFee: string, type: 'DryRunSuccessStatus', programState?: { returnType: GqlReturnType, data: string } | null }, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> };\n\nexport type GqlBlockFragment = { id: string, height: string, header: { time: string, daHeight: string, stateTransitionBytecodeVersion: string, transactionsCount: string, transactionsRoot: string, messageOutboxRoot: string, eventInboxRoot: string, prevRoot: string, applicationHash: string }, transactions: Array<{ id: string }> };\n\nexport type GqlCoinFragment = { utxoId: string, amount: string, assetId: string, blockCreated: string, txCreatedIdx: string, type: 'Coin' };\n\nexport type GqlMessageCoinFragment = { sender: string, recipient: string, nonce: string, amount: string, assetId: string, daHeight: string, type: 'MessageCoin' };\n\nexport type GqlMessageFragment = { amount: string, sender: string, recipient: string, data: string, daHeight: string };\n\nexport type GqlGetMessageFragment = { nonce: string, amount: string, sender: string, recipient: string, data: string, daHeight: string };\n\nexport type GqlMessageProofFragment = { sender: string, recipient: string, amount: string, data: string, messageProof: { proofSet: Array<string>, proofIndex: string }, blockProof: { proofSet: Array<string>, proofIndex: string }, messageBlockHeader: { version: GqlHeaderVersion, id: string, daHeight: string, consensusParametersVersion: string, stateTransitionBytecodeVersion: string, transactionsCount: string, messageReceiptCount: string, transactionsRoot: string, messageOutboxRoot: string, eventInboxRoot: string, height: string, prevRoot: string, time: string, applicationHash: string }, commitBlockHeader: { version: GqlHeaderVersion, id: string, daHeight: string, consensusParametersVersion: string, stateTransitionBytecodeVersion: string, transactionsCount: string, messageReceiptCount: string, transactionsRoot: string, messageOutboxRoot: string, eventInboxRoot: string, height: string, prevRoot: string, time: string, applicationHash: string } };\n\nexport type GqlTxParametersFragment = { version: GqlTxParametersVersion, maxInputs: string, maxOutputs: string, maxWitnesses: string, maxGasPerTx: string, maxSize: string, maxBytecodeSubsections: string };\n\nexport type GqlPredicateParametersFragment = { version: GqlPredicateParametersVersion, maxPredicateLength: string, maxPredicateDataLength: string, maxGasPerPredicate: string, maxMessageDataLength: string };\n\nexport type GqlScriptParametersFragment = { version: GqlScriptParametersVersion, maxScriptLength: string, maxScriptDataLength: string };\n\nexport type GqlContractParametersFragment = { version: GqlContractParametersVersion, contractMaxSize: string, maxStorageSlots: string };\n\nexport type GqlFeeParametersFragment = { version: GqlFeeParametersVersion, gasPriceFactor: string, gasPerByte: string };\n\ntype GqlDependentCostFragment_HeavyOperation = { base: string, gasPerUnit: string, type: 'HeavyOperation' };\n\ntype GqlDependentCostFragment_LightOperation = { base: string, unitsPerGas: string, type: 'LightOperation' };\n\nexport type GqlDependentCostFragment = GqlDependentCostFragment_HeavyOperation | GqlDependentCostFragment_LightOperation;\n\nexport type GqlGasCostsFragment = { ecr1: string, newStoragePerByte: string, contractRoot: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' }, stateRoot: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' }, vmInitialization: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' }, s256: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' } };\n\nexport type GqlConsensusParametersFragment = { version: GqlConsensusParametersVersion, baseAssetId: string, chainId: string, txParams: { version: GqlTxParametersVersion, maxInputs: string, maxOutputs: string, maxWitnesses: string, maxGasPerTx: string, maxSize: string, maxBytecodeSubsections: string }, predicateParams: { version: GqlPredicateParametersVersion, maxPredicateLength: string, maxPredicateDataLength: string, maxGasPerPredicate: string, maxMessageDataLength: string }, scriptParams: { version: GqlScriptParametersVersion, maxScriptLength: string, maxScriptDataLength: string }, contractParams: { version: GqlContractParametersVersion, contractMaxSize: string, maxStorageSlots: string }, feeParams: { version: GqlFeeParametersVersion, gasPriceFactor: string, gasPerByte: string }, gasCosts: { ecr1: string, newStoragePerByte: string, contractRoot: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' }, stateRoot: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' }, vmInitialization: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' }, s256: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' } } };\n\nexport type GqlChainInfoFragment = { name: string, daHeight: string, consensusParameters: { version: GqlConsensusParametersVersion, baseAssetId: string, chainId: string, txParams: { version: GqlTxParametersVersion, maxInputs: string, maxOutputs: string, maxWitnesses: string, maxGasPerTx: string, maxSize: string, maxBytecodeSubsections: string }, predicateParams: { version: GqlPredicateParametersVersion, maxPredicateLength: string, maxPredicateDataLength: string, maxGasPerPredicate: string, maxMessageDataLength: string }, scriptParams: { version: GqlScriptParametersVersion, maxScriptLength: string, maxScriptDataLength: string }, contractParams: { version: GqlContractParametersVersion, contractMaxSize: string, maxStorageSlots: string }, feeParams: { version: GqlFeeParametersVersion, gasPriceFactor: string, gasPerByte: string }, gasCosts: { ecr1: string, newStoragePerByte: string, contractRoot: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' }, stateRoot: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' }, vmInitialization: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' }, s256: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' } } } };\n\nexport type GqlContractBalanceFragment = { contract: string, amount: string, assetId: string };\n\nexport type GqlPageInfoFragment = { hasPreviousPage: boolean, hasNextPage: boolean, startCursor?: string | null, endCursor?: string | null };\n\nexport type GqlGetVersionQueryVariables = Exact<{ [key: string]: never; }>;\n\n\nexport type GqlGetVersionQuery = { nodeInfo: { nodeVersion: string } };\n\nexport type GqlNodeInfoFragment = { utxoValidation: boolean, vmBacktrace: boolean, maxTx: string, maxDepth: string, nodeVersion: string };\n\nexport type GqlRelayedTransactionStatusFragment = { blockHeight: string, failure: string };\n\nexport type GqlGetNodeInfoQueryVariables = Exact<{ [key: string]: never; }>;\n\n\nexport type GqlGetNodeInfoQuery = { nodeInfo: { utxoValidation: boolean, vmBacktrace: boolean, maxTx: string, maxDepth: string, nodeVersion: string } };\n\nexport type GqlGetChainQueryVariables = Exact<{ [key: string]: never; }>;\n\n\nexport type GqlGetChainQuery = { chain: { name: string, daHeight: string, consensusParameters: { version: GqlConsensusParametersVersion, baseAssetId: string, chainId: string, txParams: { version: GqlTxParametersVersion, maxInputs: string, maxOutputs: string, maxWitnesses: string, maxGasPerTx: string, maxSize: string, maxBytecodeSubsections: string }, predicateParams: { version: GqlPredicateParametersVersion, maxPredicateLength: string, maxPredicateDataLength: string, maxGasPerPredicate: string, maxMessageDataLength: string }, scriptParams: { version: GqlScriptParametersVersion, maxScriptLength: string, maxScriptDataLength: string }, contractParams: { version: GqlContractParametersVersion, contractMaxSize: string, maxStorageSlots: string }, feeParams: { version: GqlFeeParametersVersion, gasPriceFactor: string, gasPerByte: string }, gasCosts: { ecr1: string, newStoragePerByte: string, contractRoot: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' }, stateRoot: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' }, vmInitialization: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' }, s256: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' } } } } };\n\nexport type GqlGetChainAndNodeInfoQueryVariables = Exact<{ [key: string]: never; }>;\n\n\nexport type GqlGetChainAndNodeInfoQuery = { chain: { name: string, daHeight: string, consensusParameters: { version: GqlConsensusParametersVersion, baseAssetId: string, chainId: string, txParams: { version: GqlTxParametersVersion, maxInputs: string, maxOutputs: string, maxWitnesses: string, maxGasPerTx: string, maxSize: string, maxBytecodeSubsections: string }, predicateParams: { version: GqlPredicateParametersVersion, maxPredicateLength: string, maxPredicateDataLength: string, maxGasPerPredicate: string, maxMessageDataLength: string }, scriptParams: { version: GqlScriptParametersVersion, maxScriptLength: string, maxScriptDataLength: string }, contractParams: { version: GqlContractParametersVersion, contractMaxSize: string, maxStorageSlots: string }, feeParams: { version: GqlFeeParametersVersion, gasPriceFactor: string, gasPerByte: string }, gasCosts: { ecr1: string, newStoragePerByte: string, contractRoot: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' }, stateRoot: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' }, vmInitialization: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' }, s256: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' } } } }, nodeInfo: { utxoValidation: boolean, vmBacktrace: boolean, maxTx: string, maxDepth: string, nodeVersion: string } };\n\nexport type GqlGetTransactionQueryVariables = Exact<{\n transactionId: Scalars['TransactionId']['input'];\n}>;\n\n\nexport type GqlGetTransactionQuery = { transaction?: { id: string, rawPayload: string, status?: { totalGas: string, totalFee: string, time: string, reason: string, type: 'FailureStatus', receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> } | { reason: string, type: 'SqueezedOutStatus' } | { time: string, type: 'SubmittedStatus' } | { time: string, totalGas: string, totalFee: string, type: 'SuccessStatus', programState?: { returnType: GqlReturnType, data: string } | null, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> } | null } | null };\n\nexport type GqlGetTransactionWithReceiptsQueryVariables = Exact<{\n transactionId: Scalars['TransactionId']['input'];\n}>;\n\n\nexport type GqlGetTransactionWithReceiptsQuery = { transaction?: { id: string, rawPayload: string, status?: { totalGas: string, totalFee: string, time: string, reason: string, type: 'FailureStatus', block: { id: string }, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> } | { reason: string, type: 'SqueezedOutStatus' } | { time: string, type: 'SubmittedStatus' } | { time: string, totalGas: string, totalFee: string, type: 'SuccessStatus', block: { id: string }, programState?: { returnType: GqlReturnType, data: string } | null, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> } | null } | null };\n\nexport type GqlGetTransactionsQueryVariables = Exact<{\n after?: InputMaybe<Scalars['String']['input']>;\n before?: InputMaybe<Scalars['String']['input']>;\n first?: InputMaybe<Scalars['Int']['input']>;\n last?: InputMaybe<Scalars['Int']['input']>;\n}>;\n\n\nexport type GqlGetTransactionsQuery = { transactions: { edges: Array<{ node: { rawPayload: string } }>, pageInfo: { hasPreviousPage: boolean, hasNextPage: boolean, startCursor?: string | null, endCursor?: string | null } } };\n\nexport type GqlGetTransactionsByOwnerQueryVariables = Exact<{\n owner: Scalars['Address']['input'];\n after?: InputMaybe<Scalars['String']['input']>;\n before?: InputMaybe<Scalars['String']['input']>;\n first?: InputMaybe<Scalars['Int']['input']>;\n last?: InputMaybe<Scalars['Int']['input']>;\n}>;\n\n\nexport type GqlGetTransactionsByOwnerQuery = { transactionsByOwner: { pageInfo: { hasPreviousPage: boolean, hasNextPage: boolean, startCursor?: string | null, endCursor?: string | null }, edges: Array<{ node: { id: string, rawPayload: string, status?: { totalGas: string, totalFee: string, time: string, reason: string, type: 'FailureStatus', receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> } | { reason: string, type: 'SqueezedOutStatus' } | { time: string, type: 'SubmittedStatus' } | { time: string, totalGas: string, totalFee: string, type: 'SuccessStatus', programState?: { returnType: GqlReturnType, data: string } | null, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> } | null } }> } };\n\nexport type GqlEstimatePredicatesQueryVariables = Exact<{\n encodedTransaction: Scalars['HexString']['input'];\n}>;\n\n\nexport type GqlEstimatePredicatesQuery = { estimatePredicates: { inputs?: Array<{ predicateGasUsed: string } | { predicateGasUsed: string } | {}> | null } };\n\nexport type GqlGetLatestBlockQueryVariables = Exact<{ [key: string]: never; }>;\n\n\nexport type GqlGetLatestBlockQuery = { chain: { latestBlock: { id: string, height: string, header: { time: string, daHeight: string, stateTransitionBytecodeVersion: string, transactionsCount: string, transactionsRoot: string, messageOutboxRoot: string, eventInboxRoot: string, prevRoot: string, applicationHash: string }, transactions: Array<{ id: string }> } } };\n\nexport type GqlGetLatestBlockHeightQueryVariables = Exact<{ [key: string]: never; }>;\n\n\nexport type GqlGetLatestBlockHeightQuery = { chain: { latestBlock: { height: string } } };\n\nexport type GqlGetBlockQueryVariables = Exact<{\n blockId?: InputMaybe<Scalars['BlockId']['input']>;\n height?: InputMaybe<Scalars['U32']['input']>;\n}>;\n\n\nexport type GqlGetBlockQuery = { block?: { id: string, height: string, header: { time: string, daHeight: string, stateTransitionBytecodeVersion: string, transactionsCount: string, transactionsRoot: string, messageOutboxRoot: string, eventInboxRoot: string, prevRoot: string, applicationHash: string }, transactions: Array<{ id: string }> } | null };\n\nexport type GqlGetBlockWithTransactionsQueryVariables = Exact<{\n blockId?: InputMaybe<Scalars['BlockId']['input']>;\n blockHeight?: InputMaybe<Scalars['U32']['input']>;\n}>;\n\n\nexport type GqlGetBlockWithTransactionsQuery = { block?: { id: string, height: string, transactions: Array<{ id: string, rawPayload: string }>, header: { time: string, daHeight: string, stateTransitionBytecodeVersion: string, transactionsCount: string, transactionsRoot: string, messageOutboxRoot: string, eventInboxRoot: string, prevRoot: string, applicationHash: string } } | null };\n\nexport type GqlGetBlocksQueryVariables = Exact<{\n after?: InputMaybe<Scalars['String']['input']>;\n before?: InputMaybe<Scalars['String']['input']>;\n first?: InputMaybe<Scalars['Int']['input']>;\n last?: InputMaybe<Scalars['Int']['input']>;\n}>;\n\n\nexport type GqlGetBlocksQuery = { blocks: { pageInfo: { hasPreviousPage: boolean, hasNextPage: boolean, startCursor?: string | null, endCursor?: string | null }, edges: Array<{ node: { id: string, height: string, header: { time: string, daHeight: string, stateTransitionBytecodeVersion: string, transactionsCount: string, transactionsRoot: string, messageOutboxRoot: string, eventInboxRoot: string, prevRoot: string, applicationHash: string }, transactions: Array<{ id: string }> } }> } };\n\nexport type GqlGetCoinQueryVariables = Exact<{\n coinId: Scalars['UtxoId']['input'];\n}>;\n\n\nexport type GqlGetCoinQuery = { coin?: { owner: string, utxoId: string, amount: string, assetId: string, blockCreated: string, txCreatedIdx: string, type: 'Coin' } | null };\n\nexport type GqlGetCoinsQueryVariables = Exact<{\n filter: GqlCoinFilterInput;\n after?: InputMaybe<Scalars['String']['input']>;\n before?: InputMaybe<Scalars['String']['input']>;\n first?: InputMaybe<Scalars['Int']['input']>;\n last?: InputMaybe<Scalars['Int']['input']>;\n}>;\n\n\nexport type GqlGetCoinsQuery = { coins: { pageInfo: { hasPreviousPage: boolean, hasNextPage: boolean, startCursor?: string | null, endCursor?: string | null }, edges: Array<{ node: { utxoId: string, amount: string, assetId: string, blockCreated: string, txCreatedIdx: string, type: 'Coin' } }> } };\n\nexport type GqlGetCoinsToSpendQueryVariables = Exact<{\n owner: Scalars['Address']['input'];\n queryPerAsset: Array<GqlSpendQueryElementInput> | GqlSpendQueryElementInput;\n excludedIds?: InputMaybe<GqlExcludeInput>;\n}>;\n\n\nexport type GqlGetCoinsToSpendQuery = { coinsToSpend: Array<Array<{ utxoId: string, amount: string, assetId: string, blockCreated: string, txCreatedIdx: string, type: 'Coin' } | { sender: string, recipient: string, nonce: string, amount: string, assetId: string, daHeight: string, type: 'MessageCoin' }>> };\n\nexport type GqlGetContractQueryVariables = Exact<{\n contractId: Scalars['ContractId']['input'];\n}>;\n\n\nexport type GqlGetContractQuery = { contract?: { bytecode: string, id: string } | null };\n\nexport type GqlGetContractBalanceQueryVariables = Exact<{\n contract: Scalars['ContractId']['input'];\n asset: Scalars['AssetId']['input'];\n}>;\n\n\nexport type GqlGetContractBalanceQuery = { contractBalance: { contract: string, amount: string, assetId: string } };\n\nexport type GqlGetBalanceQueryVariables = Exact<{\n owner: Scalars['Address']['input'];\n assetId: Scalars['AssetId']['input'];\n}>;\n\n\nexport type GqlGetBalanceQuery = { balance: { amount: string } };\n\nexport type GqlGetLatestGasPriceQueryVariables = Exact<{ [key: string]: never; }>;\n\n\nexport type GqlGetLatestGasPriceQuery = { latestGasPrice: { gasPrice: string } };\n\nexport type GqlEstimateGasPriceQueryVariables = Exact<{\n blockHorizon: Scalars['U32']['input'];\n}>;\n\n\nexport type GqlEstimateGasPriceQuery = { estimateGasPrice: { gasPrice: string } };\n\nexport type GqlGetBalancesQueryVariables = Exact<{\n filter: GqlBalanceFilterInput;\n after?: InputMaybe<Scalars['String']['input']>;\n before?: InputMaybe<Scalars['String']['input']>;\n first?: InputMaybe<Scalars['Int']['input']>;\n last?: InputMaybe<Scalars['Int']['input']>;\n}>;\n\n\nexport type GqlGetBalancesQuery = { balances: { pageInfo: { hasPreviousPage: boolean, hasNextPage: boolean, startCursor?: string | null, endCursor?: string | null }, edges: Array<{ node: { assetId: string, amount: string } }> } };\n\nexport type GqlGetMessagesQueryVariables = Exact<{\n owner: Scalars['Address']['input'];\n after?: InputMaybe<Scalars['String']['input']>;\n before?: InputMaybe<Scalars['String']['input']>;\n first?: InputMaybe<Scalars['Int']['input']>;\n last?: InputMaybe<Scalars['Int']['input']>;\n}>;\n\n\nexport type GqlGetMessagesQuery = { messages: { pageInfo: { hasPreviousPage: boolean, hasNextPage: boolean, startCursor?: string | null, endCursor?: string | null }, edges: Array<{ node: { nonce: string, amount: string, sender: string, recipient: string, data: string, daHeight: string } }> } };\n\nexport type GqlGetMessageProofQueryVariables = Exact<{\n transactionId: Scalars['TransactionId']['input'];\n nonce: Scalars['Nonce']['input'];\n commitBlockId?: InputMaybe<Scalars['BlockId']['input']>;\n commitBlockHeight?: InputMaybe<Scalars['U32']['input']>;\n}>;\n\n\nexport type GqlGetMessageProofQuery = { messageProof?: { sender: string, recipient: string, amount: string, data: string, messageProof: { proofSet: Array<string>, proofIndex: string }, blockProof: { proofSet: Array<string>, proofIndex: string }, messageBlockHeader: { version: GqlHeaderVersion, id: string, daHeight: string, consensusParametersVersion: string, stateTransitionBytecodeVersion: string, transactionsCount: string, messageReceiptCount: string, transactionsRoot: string, messageOutboxRoot: string, eventInboxRoot: string, height: string, prevRoot: string, time: string, applicationHash: string }, commitBlockHeader: { version: GqlHeaderVersion, id: string, daHeight: string, consensusParametersVersion: string, stateTransitionBytecodeVersion: string, transactionsCount: string, messageReceiptCount: string, transactionsRoot: string, messageOutboxRoot: string, eventInboxRoot: string, height: string, prevRoot: string, time: string, applicationHash: string } } | null };\n\nexport type GqlGetMessageStatusQueryVariables = Exact<{\n nonce: Scalars['Nonce']['input'];\n}>;\n\n\nexport type GqlGetMessageStatusQuery = { messageStatus: { state: GqlMessageState } };\n\nexport type GqlGetRelayedTransactionStatusQueryVariables = Exact<{\n relayedTransactionId: Scalars['RelayedTransactionId']['input'];\n}>;\n\n\nexport type GqlGetRelayedTransactionStatusQuery = { relayedTransactionStatus?: { blockHeight: string, failure: string } | null };\n\nexport type GqlDryRunMutationVariables = Exact<{\n encodedTransactions: Array<Scalars['HexString']['input']> | Scalars['HexString']['input'];\n utxoValidation?: InputMaybe<Scalars['Boolean']['input']>;\n gasPrice?: InputMaybe<Scalars['U64']['input']>;\n}>;\n\n\nexport type GqlDryRunMutation = { dryRun: Array<{ id: string, status: { totalGas: string, totalFee: string, reason: string, type: 'DryRunFailureStatus', programState?: { returnType: GqlReturnType, data: string } | null } | { totalGas: string, totalFee: string, type: 'DryRunSuccessStatus', programState?: { returnType: GqlReturnType, data: string } | null }, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> }> };\n\nexport type GqlSubmitMutationVariables = Exact<{\n encodedTransaction: Scalars['HexString']['input'];\n}>;\n\n\nexport type GqlSubmitMutation = { submit: { id: string } };\n\nexport type GqlProduceBlocksMutationVariables = Exact<{\n startTimestamp?: InputMaybe<Scalars['Tai64Timestamp']['input']>;\n blocksToProduce: Scalars['U32']['input'];\n}>;\n\n\nexport type GqlProduceBlocksMutation = { produceBlocks: string };\n\nexport type GqlGetMessageByNonceQueryVariables = Exact<{\n nonce: Scalars['Nonce']['input'];\n}>;\n\n\nexport type GqlGetMessageByNonceQuery = { message?: { amount: string, sender: string, recipient: string, data: string, daHeight: string } | null };\n\nexport type GqlIsUserAccountQueryVariables = Exact<{\n blobId: Scalars['BlobId']['input'];\n contractId: Scalars['ContractId']['input'];\n transactionId: Scalars['TransactionId']['input'];\n}>;\n\n\nexport type GqlIsUserAccountQuery = { blob?: { id: any } | null, contract?: { id: string } | null, transaction?: { id: string } | null };\n\nexport type GqlGetConsensusParametersVersionQueryVariables = Exact<{ [key: string]: never; }>;\n\n\nexport type GqlGetConsensusParametersVersionQuery = { chain: { latestBlock: { header: { consensusParametersVersion: string } } } };\n\nexport type GqlSubmitAndAwaitStatusSubscriptionVariables = Exact<{\n encodedTransaction: Scalars['HexString']['input'];\n}>;\n\n\nexport type GqlSubmitAndAwaitStatusSubscription = { submitAndAwaitStatus: { totalGas: string, totalFee: string, time: string, reason: string, type: 'FailureStatus', transaction: { receiptsRoot?: string | null, inputs?: Array<{ txPointer: string, type: 'InputCoin' } | { txPointer: string, type: 'InputContract' } | { type: 'InputMessage' }> | null, outputs: Array<{ to: string, amount: string, assetId: string, type: 'ChangeOutput' } | { to: string, amount: string, assetId: string, type: 'CoinOutput' } | { contract: string, stateRoot: string, type: 'ContractCreated' } | { inputIndex: string, balanceRoot: string, stateRoot: string, type: 'ContractOutput' } | { to: string, amount: string, assetId: string, type: 'VariableOutput' }> }, block: { id: string }, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> } | { reason: string, type: 'SqueezedOutStatus' } | { time: string, type: 'SubmittedStatus' } | { time: string, totalGas: string, totalFee: string, type: 'SuccessStatus', transaction: { receiptsRoot?: string | null, inputs?: Array<{ txPointer: string, type: 'InputCoin' } | { txPointer: string, type: 'InputContract' } | { type: 'InputMessage' }> | null, outputs: Array<{ to: string, amount: string, assetId: string, type: 'ChangeOutput' } | { to: string, amount: string, assetId: string, type: 'CoinOutput' } | { contract: string, stateRoot: string, type: 'ContractCreated' } | { inputIndex: string, balanceRoot: string, stateRoot: string, type: 'ContractOutput' } | { to: string, amount: string, assetId: string, type: 'VariableOutput' }> }, block: { id: string }, programState?: { returnType: GqlReturnType, data: string } | null, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> } };\n\nexport type GqlStatusChangeSubscriptionVariables = Exact<{\n transactionId: Scalars['TransactionId']['input'];\n}>;\n\n\nexport type GqlStatusChangeSubscription = { statusChange: { totalGas: string, totalFee: string, time: string, reason: string, type: 'FailureStatus', transaction: { receiptsRoot?: string | null, inputs?: Array<{ txPointer: string, type: 'InputCoin' } | { txPointer: string, type: 'InputContract' } | { type: 'InputMessage' }> | null, outputs: Array<{ to: string, amount: string, assetId: string, type: 'ChangeOutput' } | { to: string, amount: string, assetId: string, type: 'CoinOutput' } | { contract: string, stateRoot: string, type: 'ContractCreated' } | { inputIndex: string, balanceRoot: string, stateRoot: string, type: 'ContractOutput' } | { to: string, amount: string, assetId: string, type: 'VariableOutput' }> }, block: { id: string }, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> } | { reason: string, type: 'SqueezedOutStatus' } | { time: string, type: 'SubmittedStatus' } | { time: string, totalGas: string, totalFee: string, type: 'SuccessStatus', transaction: { receiptsRoot?: string | null, inputs?: Array<{ txPointer: string, type: 'InputCoin' } | { txPointer: string, type: 'InputContract' } | { type: 'InputMessage' }> | null, outputs: Array<{ to: string, amount: string, assetId: string, type: 'ChangeOutput' } | { to: string, amount: string, assetId: string, type: 'CoinOutput' } | { contract: string, stateRoot: string, type: 'ContractCreated' } | { inputIndex: string, balanceRoot: string, stateRoot: string, type: 'ContractOutput' } | { to: string, amount: string, assetId: string, type: 'VariableOutput' }> }, block: { id: string }, programState?: { returnType: GqlReturnType, data: string } | null, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> } };\n\nexport const SubmittedStatusFragmentDoc = gql`\n fragment SubmittedStatusFragment on SubmittedStatus {\n type: __typename\n time\n}\n `;\nexport const ReceiptFragmentDoc = gql`\n fragment receiptFragment on Receipt {\n id\n pc\n is\n to\n toAddress\n amount\n assetId\n gas\n param1\n param2\n val\n ptr\n digest\n reason\n ra\n rb\n rc\n rd\n len\n receiptType\n result\n gasUsed\n data\n sender\n recipient\n nonce\n contractId\n subId\n}\n `;\nexport const SuccessStatusFragmentDoc = gql`\n fragment SuccessStatusFragment on SuccessStatus {\n type: __typename\n time\n programState {\n returnType\n data\n }\n receipts {\n ...receiptFragment\n }\n totalGas\n totalFee\n}\n ${ReceiptFragmentDoc}`;\nexport const SuccessStatusWithBlockIdFragmentDoc = gql`\n fragment SuccessStatusWithBlockIdFragment on SuccessStatus {\n ...SuccessStatusFragment\n block {\n id\n }\n}\n ${SuccessStatusFragmentDoc}`;\nexport const MalleableTransactionFieldsFragmentDoc = gql`\n fragment malleableTransactionFieldsFragment on Transaction {\n receiptsRoot\n inputs {\n type: __typename\n ... on InputCoin {\n txPointer\n }\n ... on InputContract {\n txPointer\n }\n }\n outputs {\n type: __typename\n ... on CoinOutput {\n to\n amount\n assetId\n }\n ... on ContractOutput {\n inputIndex\n balanceRoot\n stateRoot\n }\n ... on ChangeOutput {\n to\n amount\n assetId\n }\n ... on VariableOutput {\n to\n amount\n assetId\n }\n ... on ContractCreated {\n contract\n stateRoot\n }\n }\n}\n `;\nexport const FailureStatusFragmentDoc = gql`\n fragment FailureStatusFragment on FailureStatus {\n type: __typename\n totalGas\n totalFee\n time\n reason\n receipts {\n ...receiptFragment\n }\n}\n ${ReceiptFragmentDoc}`;\nexport const FailureStatusWithBlockIdFragmentDoc = gql`\n fragment FailureStatusWithBlockIdFragment on FailureStatus {\n ...FailureStatusFragment\n block {\n id\n }\n}\n ${FailureStatusFragmentDoc}`;\nexport const SqueezedOutStatusFragmentDoc = gql`\n fragment SqueezedOutStatusFragment on SqueezedOutStatus {\n type: __typename\n reason\n}\n `;\nexport const TransactionStatusSubscriptionFragmentDoc = gql`\n fragment transactionStatusSubscriptionFragment on TransactionStatus {\n ... on SubmittedStatus {\n ...SubmittedStatusFragment\n }\n ... on SuccessStatus {\n ...SuccessStatusWithBlockIdFragment\n transaction {\n ...malleableTransactionFieldsFragment\n }\n }\n ... on FailureStatus {\n ...FailureStatusWithBlockIdFragment\n transaction {\n ...malleableTransactionFieldsFragment\n }\n }\n ... on SqueezedOutStatus {\n ...SqueezedOutStatusFragment\n }\n}\n ${SubmittedStatusFragmentDoc}\n${SuccessStatusWithBlockIdFragmentDoc}\n${MalleableTransactionFieldsFragmentDoc}\n${FailureStatusWithBlockIdFragmentDoc}\n${SqueezedOutStatusFragmentDoc}`;\nexport const TransactionStatusFragmentDoc = gql`\n fragment transactionStatusFragment on TransactionStatus {\n ... on SubmittedStatus {\n ...SubmittedStatusFragment\n }\n ... on SuccessStatus {\n ...SuccessStatusFragment\n }\n ... on FailureStatus {\n ...FailureStatusFragment\n }\n ... on SqueezedOutStatus {\n ...SqueezedOutStatusFragment\n }\n}\n ${SubmittedStatusFragmentDoc}\n${SuccessStatusFragmentDoc}\n${FailureStatusFragmentDoc}\n${SqueezedOutStatusFragmentDoc}`;\nexport const TransactionFragmentDoc = gql`\n fragment transactionFragment on Transaction {\n id\n rawPayload\n status {\n ...transactionStatusFragment\n }\n}\n ${TransactionStatusFragmentDoc}`;\nexport const TransactionRawPayloadFragmentDoc = gql`\n fragment transactionRawPayloadFragment on Transaction {\n id\n rawPayload\n}\n `;\nexport const InputEstimatePredicatesFragmentDoc = gql`\n fragment inputEstimatePredicatesFragment on Input {\n ... on InputCoin {\n predicateGasUsed\n }\n ... on InputMessage {\n predicateGasUsed\n }\n}\n `;\nexport const TransactionEstimatePredicatesFragmentDoc = gql`\n fragment transactionEstimatePredicatesFragment on Transaction {\n inputs {\n ...inputEstimatePredicatesFragment\n }\n}\n ${InputEstimatePredicatesFragmentDoc}`;\nexport const DryRunFailureStatusFragmentDoc = gql`\n fragment dryRunFailureStatusFragment on DryRunFailureStatus {\n type: __typename\n totalGas\n totalFee\n reason\n programState {\n returnType\n data\n }\n}\n `;\nexport const DryRunSuccessStatusFragmentDoc = gql`\n fragment dryRunSuccessStatusFragment on DryRunSuccessStatus {\n type: __typename\n totalGas\n totalFee\n programState {\n returnType\n data\n }\n}\n `;\nexport const DryRunTransactionStatusFragmentDoc = gql`\n fragment dryRunTransactionStatusFragment on DryRunTransactionStatus {\n ... on DryRunFailureStatus {\n ...dryRunFailureStatusFragment\n }\n ... on DryRunSuccessStatus {\n ...dryRunSuccessStatusFragment\n }\n}\n ${DryRunFailureStatusFragmentDoc}\n${DryRunSuccessStatusFragmentDoc}`;\nexport const DryRunTransactionExecutionStatusFragmentDoc = gql`\n fragment dryRunTransactionExecutionStatusFragment on DryRunTransactionExecutionStatus {\n id\n status {\n ...dryRunTransactionStatusFragment\n }\n receipts {\n ...receiptFragment\n }\n}\n ${DryRunTransactionStatusFragmentDoc}\n${ReceiptFragmentDoc}`;\nexport const BlockFragmentDoc = gql`\n fragment blockFragment on Block {\n id\n height\n header {\n time\n daHeight\n stateTransitionBytecodeVersion\n transactionsCount\n transactionsRoot\n messageOutboxRoot\n eventInboxRoot\n prevRoot\n applicationHash\n }\n transactions {\n id\n }\n}\n `;\nexport const CoinFragmentDoc = gql`\n fragment coinFragment on Coin {\n type: __typename\n utxoId\n amount\n assetId\n blockCreated\n txCreatedIdx\n}\n `;\nexport const MessageCoinFragmentDoc = gql`\n fragment messageCoinFragment on MessageCoin {\n type: __typename\n sender\n recipient\n nonce\n amount\n assetId\n daHeight\n}\n `;\nexport const MessageFragmentDoc = gql`\n fragment messageFragment on Message {\n amount\n sender\n recipient\n data\n daHeight\n}\n `;\nexport const GetMessageFragmentDoc = gql`\n fragment getMessageFragment on Message {\n ...messageFragment\n nonce\n}\n ${MessageFragmentDoc}`;\nexport const MessageProofFragmentDoc = gql`\n fragment messageProofFragment on MessageProof {\n messageProof {\n proofSet\n proofIndex\n }\n blockProof {\n proofSet\n proofIndex\n }\n messageBlockHeader {\n version\n id\n daHeight\n consensusParametersVersion\n stateTransitionBytecodeVersion\n transactionsCount\n messageReceiptCount\n transactionsRoot\n messageOutboxRoot\n eventInboxRoot\n height\n prevRoot\n time\n applicationHash\n }\n commitBlockHeader {\n version\n id\n daHeight\n consensusParametersVersion\n stateTransitionBytecodeVersion\n transactionsCount\n messageReceiptCount\n transactionsRoot\n messageOutboxRoot\n eventInboxRoot\n height\n prevRoot\n time\n applicationHash\n }\n sender\n recipient\n amount\n data\n}\n `;\nexport const TxParametersFragmentDoc = gql`\n fragment TxParametersFragment on TxParameters {\n version\n maxInputs\n maxOutputs\n maxWitnesses\n maxGasPerTx\n maxSize\n maxBytecodeSubsections\n}\n `;\nexport const PredicateParametersFragmentDoc = gql`\n fragment PredicateParametersFragment on PredicateParameters {\n version\n maxPredicateLength\n maxPredicateDataLength\n maxGasPerPredicate\n maxMessageDataLength\n}\n `;\nexport const ScriptParametersFragmentDoc = gql`\n fragment ScriptParametersFragment on ScriptParameters {\n version\n maxScriptLength\n maxScriptDataLength\n}\n `;\nexport const ContractParametersFragmentDoc = gql`\n fragment ContractParametersFragment on ContractParameters {\n version\n contractMaxSize\n maxStorageSlots\n}\n `;\nexport const FeeParametersFragmentDoc = gql`\n fragment FeeParametersFragment on FeeParameters {\n version\n gasPriceFactor\n gasPerByte\n}\n `;\nexport const DependentCostFragmentDoc = gql`\n fragment DependentCostFragment on DependentCost {\n ... on LightOperation {\n type: __typename\n base\n unitsPerGas\n }\n ... on HeavyOperation {\n type: __typename\n base\n gasPerUnit\n }\n}\n `;\nexport const GasCostsFragmentDoc = gql`\n fragment GasCostsFragment on GasCosts {\n contractRoot {\n ...DependentCostFragment\n }\n stateRoot {\n ...DependentCostFragment\n }\n vmInitialization {\n ...DependentCostFragment\n }\n s256 {\n ...DependentCostFragment\n }\n ecr1\n newStoragePerByte\n}\n ${DependentCostFragmentDoc}`;\nexport const ConsensusParametersFragmentDoc = gql`\n fragment consensusParametersFragment on ConsensusParameters {\n version\n txParams {\n ...TxParametersFragment\n }\n predicateParams {\n ...PredicateParametersFragment\n }\n scriptParams {\n ...ScriptParametersFragment\n }\n contractParams {\n ...ContractParametersFragment\n }\n feeParams {\n ...FeeParametersFragment\n }\n gasCosts {\n ...GasCostsFragment\n }\n baseAssetId\n chainId\n}\n ${TxParametersFragmentDoc}\n${PredicateParametersFragmentDoc}\n${ScriptParametersFragmentDoc}\n${ContractParametersFragmentDoc}\n${FeeParametersFragmentDoc}\n${GasCostsFragmentDoc}`;\nexport const ChainInfoFragmentDoc = gql`\n fragment chainInfoFragment on ChainInfo {\n name\n daHeight\n consensusParameters {\n ...consensusParametersFragment\n }\n}\n ${ConsensusParametersFragmentDoc}`;\nexport const ContractBalanceFragmentDoc = gql`\n fragment contractBalanceFragment on ContractBalance {\n contract\n amount\n assetId\n}\n `;\nexport const PageInfoFragmentDoc = gql`\n fragment pageInfoFragment on PageInfo {\n hasPreviousPage\n hasNextPage\n startCursor\n endCursor\n}\n `;\nexport const NodeInfoFragmentDoc = gql`\n fragment nodeInfoFragment on NodeInfo {\n utxoValidation\n vmBacktrace\n maxTx\n maxDepth\n nodeVersion\n}\n `;\nexport const RelayedTransactionStatusFragmentDoc = gql`\n fragment relayedTransactionStatusFragment on RelayedTransactionStatus {\n ... on RelayedTransactionFailed {\n blockHeight\n failure\n }\n}\n `;\nexport const GetVersionDocument = gql`\n query getVersion {\n nodeInfo {\n nodeVersion\n }\n}\n `;\nexport const GetNodeInfoDocument = gql`\n query getNodeInfo {\n nodeInfo {\n ...nodeInfoFragment\n }\n}\n ${NodeInfoFragmentDoc}`;\nexport const GetChainDocument = gql`\n query getChain {\n chain {\n ...chainInfoFragment\n }\n}\n ${ChainInfoFragmentDoc}`;\nexport const GetChainAndNodeInfoDocument = gql`\n query getChainAndNodeInfo {\n chain {\n ...chainInfoFragment\n }\n nodeInfo {\n ...nodeInfoFragment\n }\n}\n ${ChainInfoFragmentDoc}\n${NodeInfoFragmentDoc}`;\nexport const GetTransactionDocument = gql`\n query getTransaction($transactionId: TransactionId!) {\n transaction(id: $transactionId) {\n ...transactionFragment\n }\n}\n ${TransactionFragmentDoc}`;\nexport const GetTransactionWithReceiptsDocument = gql`\n query getTransactionWithReceipts($transactionId: TransactionId!) {\n transaction(id: $transactionId) {\n id\n rawPayload\n status {\n ... on SubmittedStatus {\n ...SubmittedStatusFragment\n }\n ... on SuccessStatus {\n ...SuccessStatusWithBlockIdFragment\n }\n ... on FailureStatus {\n ...FailureStatusWithBlockIdFragment\n }\n ... on SqueezedOutStatus {\n ...SqueezedOutStatusFragment\n }\n }\n }\n}\n ${SubmittedStatusFragmentDoc}\n${SuccessStatusWithBlockIdFragmentDoc}\n${FailureStatusWithBlockIdFragmentDoc}\n${SqueezedOutStatusFragmentDoc}`;\nexport const GetTransactionsDocument = gql`\n query getTransactions($after: String, $before: String, $first: Int, $last: Int) {\n transactions(after: $after, before: $before, first: $first, last: $last) {\n edges {\n node {\n rawPayload\n }\n }\n pageInfo {\n ...pageInfoFragment\n }\n }\n}\n ${PageInfoFragmentDoc}`;\nexport const GetTransactionsByOwnerDocument = gql`\n query getTransactionsByOwner($owner: Address!, $after: String, $before: String, $first: Int, $last: Int) {\n transactionsByOwner(\n owner: $owner\n after: $after\n before: $before\n first: $first\n last: $last\n ) {\n pageInfo {\n ...pageInfoFragment\n }\n edges {\n node {\n ...transactionFragment\n }\n }\n }\n}\n ${PageInfoFragmentDoc}\n${TransactionFragmentDoc}`;\nexport const EstimatePredicatesDocument = gql`\n query estimatePredicates($encodedTransaction: HexString!) {\n estimatePredicates(tx: $encodedTransaction) {\n ...transactionEstimatePredicatesFragment\n }\n}\n ${TransactionEstimatePredicatesFragmentDoc}`;\nexport const GetLatestBlockDocument = gql`\n query getLatestBlock {\n chain {\n latestBlock {\n ...blockFragment\n }\n }\n}\n ${BlockFragmentDoc}`;\nexport const GetLatestBlockHeightDocument = gql`\n query getLatestBlockHeight {\n chain {\n latestBlock {\n height\n }\n }\n}\n `;\nexport const GetBlockDocument = gql`\n query getBlock($blockId: BlockId, $height: U32) {\n block(id: $blockId, height: $height) {\n ...blockFragment\n }\n}\n ${BlockFragmentDoc}`;\nexport const GetBlockWithTransactionsDocument = gql`\n query getBlockWithTransactions($blockId: BlockId, $blockHeight: U32) {\n block(id: $blockId, height: $blockHeight) {\n ...blockFragment\n transactions {\n ...transactionRawPayloadFragment\n }\n }\n}\n ${BlockFragmentDoc}\n${TransactionRawPayloadFragmentDoc}`;\nexport const GetBlocksDocument = gql`\n query getBlocks($after: String, $before: String, $first: Int, $last: Int) {\n blocks(after: $after, before: $before, first: $first, last: $last) {\n pageInfo {\n ...pageInfoFragment\n }\n edges {\n node {\n ...blockFragment\n }\n }\n }\n}\n ${PageInfoFragmentDoc}\n${BlockFragmentDoc}`;\nexport const GetCoinDocument = gql`\n query getCoin($coinId: UtxoId!) {\n coin(utxoId: $coinId) {\n ...coinFragment\n owner\n }\n}\n ${CoinFragmentDoc}`;\nexport const GetCoinsDocument = gql`\n query getCoins($filter: CoinFilterInput!, $after: String, $before: String, $first: Int, $last: Int) {\n coins(\n filter: $filter\n after: $after\n before: $before\n first: $first\n last: $last\n ) {\n pageInfo {\n ...pageInfoFragment\n }\n edges {\n node {\n ...coinFragment\n }\n }\n }\n}\n ${PageInfoFragmentDoc}\n${CoinFragmentDoc}`;\nexport const GetCoinsToSpendDocument = gql`\n query getCoinsToSpend($owner: Address!, $queryPerAsset: [SpendQueryElementInput!]!, $excludedIds: ExcludeInput) {\n coinsToSpend(\n owner: $owner\n queryPerAsset: $queryPerAsset\n excludedIds: $excludedIds\n ) {\n ...coinFragment\n ...messageCoinFragment\n }\n}\n ${CoinFragmentDoc}\n${MessageCoinFragmentDoc}`;\nexport const GetContractDocument = gql`\n query getContract($contractId: ContractId!) {\n contract(id: $contractId) {\n bytecode\n id\n }\n}\n `;\nexport const GetContractBalanceDocument = gql`\n query getContractBalance($contract: ContractId!, $asset: AssetId!) {\n contractBalance(contract: $contract, asset: $asset) {\n ...contractBalanceFragment\n }\n}\n ${ContractBalanceFragmentDoc}`;\nexport const GetBalanceDocument = gql`\n query getBalance($owner: Address!, $assetId: AssetId!) {\n balance(owner: $owner, assetId: $assetId) {\n amount\n }\n}\n `;\nexport const GetLatestGasPriceDocument = gql`\n query getLatestGasPrice {\n latestGasPrice {\n gasPrice\n }\n}\n `;\nexport const EstimateGasPriceDocument = gql`\n query estimateGasPrice($blockHorizon: U32!) {\n estimateGasPrice(blockHorizon: $blockHorizon) {\n gasPrice\n }\n}\n `;\nexport const GetBalancesDocument = gql`\n query getBalances($filter: BalanceFilterInput!, $after: String, $before: String, $first: Int, $last: Int) {\n balances(\n filter: $filter\n after: $after\n before: $before\n first: $first\n last: $last\n ) {\n pageInfo {\n ...pageInfoFragment\n }\n edges {\n node {\n assetId\n amount\n }\n }\n }\n}\n ${PageInfoFragmentDoc}`;\nexport const GetMessagesDocument = gql`\n query getMessages($owner: Address!, $after: String, $before: String, $first: Int, $last: Int) {\n messages(\n owner: $owner\n after: $after\n before: $before\n first: $first\n last: $last\n ) {\n pageInfo {\n ...pageInfoFragment\n }\n edges {\n node {\n ...getMessageFragment\n }\n }\n }\n}\n ${PageInfoFragmentDoc}\n${GetMessageFragmentDoc}`;\nexport const GetMessageProofDocument = gql`\n query getMessageProof($transactionId: TransactionId!, $nonce: Nonce!, $commitBlockId: BlockId, $commitBlockHeight: U32) {\n messageProof(\n transactionId: $transactionId\n nonce: $nonce\n commitBlockId: $commitBlockId\n commitBlockHeight: $commitBlockHeight\n ) {\n ...messageProofFragment\n }\n}\n ${MessageProofFragmentDoc}`;\nexport const GetMessageStatusDocument = gql`\n query getMessageStatus($nonce: Nonce!) {\n messageStatus(nonce: $nonce) {\n state\n }\n}\n `;\nexport const GetRelayedTransactionStatusDocument = gql`\n query getRelayedTransactionStatus($relayedTransactionId: RelayedTransactionId!) {\n relayedTransactionStatus(id: $relayedTransactionId) {\n ...relayedTransactionStatusFragment\n }\n}\n ${RelayedTransactionStatusFragmentDoc}`;\nexport const DryRunDocument = gql`\n mutation dryRun($encodedTransactions: [HexString!]!, $utxoValidation: Boolean, $gasPrice: U64) {\n dryRun(\n txs: $encodedTransactions\n utxoValidation: $utxoValidation\n gasPrice: $gasPrice\n ) {\n ...dryRunTransactionExecutionStatusFragment\n }\n}\n ${DryRunTransactionExecutionStatusFragmentDoc}`;\nexport const SubmitDocument = gql`\n mutation submit($encodedTransaction: HexString!) {\n submit(tx: $encodedTransaction) {\n id\n }\n}\n `;\nexport const ProduceBlocksDocument = gql`\n mutation produceBlocks($startTimestamp: Tai64Timestamp, $blocksToProduce: U32!) {\n produceBlocks(\n blocksToProduce: $blocksToProduce\n startTimestamp: $startTimestamp\n )\n}\n `;\nexport const GetMessageByNonceDocument = gql`\n query getMessageByNonce($nonce: Nonce!) {\n message(nonce: $nonce) {\n ...messageFragment\n }\n}\n ${MessageFragmentDoc}`;\nexport const IsUserAccountDocument = gql`\n query isUserAccount($blobId: BlobId!, $contractId: ContractId!, $transactionId: TransactionId!) {\n blob(id: $blobId) {\n id\n }\n contract(id: $contractId) {\n id\n }\n transaction(id: $transactionId) {\n id\n }\n}\n `;\nexport const GetConsensusParametersVersionDocument = gql`\n query getConsensusParametersVersion {\n chain {\n latestBlock {\n header {\n consensusParametersVersion\n }\n }\n }\n}\n `;\nexport const SubmitAndAwaitStatusDocument = gql`\n subscription submitAndAwaitStatus($encodedTransaction: HexString!) {\n submitAndAwaitStatus(tx: $encodedTransaction) {\n ...transactionStatusSubscriptionFragment\n }\n}\n ${TransactionStatusSubscriptionFragmentDoc}`;\nexport const StatusChangeDocument = gql`\n subscription statusChange($transactionId: TransactionId!) {\n statusChange(id: $transactionId) {\n ...transactionStatusSubscriptionFragment\n }\n}\n ${TransactionStatusSubscriptionFragmentDoc}`;\nexport type Requester<C = {}> = <R, V>(doc: DocumentNode, vars?: V, options?: C) => Promise<R> | AsyncIterable<R>\nexport function getSdk<C>(requester: Requester<C>) {\n return {\n getVersion(variables?: GqlGetVersionQueryVariables, options?: C): Promise<GqlGetVersionQuery> {\n return requester<GqlGetVersionQuery, GqlGetVersionQueryVariables>(GetVersionDocument, variables, options) as Promise<GqlGetVersionQuery>;\n },\n getNodeInfo(variables?: GqlGetNodeInfoQueryVariables, options?: C): Promise<GqlGetNodeInfoQuery> {\n return requester<GqlGetNodeInfoQuery, GqlGetNodeInfoQueryVariables>(GetNodeInfoDocument, variables, options) as Promise<GqlGetNodeInfoQuery>;\n },\n getChain(variables?: GqlGetChainQueryVariables, options?: C): Promise<GqlGetChainQuery> {\n return requester<GqlGetChainQuery, GqlGetChainQueryVariables>(GetChainDocument, variables, options) as Promise<GqlGetChainQuery>;\n },\n getChainAndNodeInfo(variables?: GqlGetChainAndNodeInfoQueryVariables, options?: C): Promise<GqlGetChainAndNodeInfoQuery> {\n return requester<GqlGetChainAndNodeInfoQuery, GqlGetChainAndNodeInfoQueryVariables>(GetChainAndNodeInfoDocument, variables, options) as Promise<GqlGetChainAndNodeInfoQuery>;\n },\n getTransaction(variables: GqlGetTransactionQueryVariables, options?: C): Promise<GqlGetTransactionQuery> {\n return requester<GqlGetTransactionQuery, GqlGetTransactionQueryVariables>(GetTransactionDocument, variables, options) as Promise<GqlGetTransactionQuery>;\n },\n getTransactionWithReceipts(variables: GqlGetTransactionWithReceiptsQueryVariables, options?: C): Promise<GqlGetTransactionWithReceiptsQuery> {\n return requester<GqlGetTransactionWithReceiptsQuery, GqlGetTransactionWithReceiptsQueryVariables>(GetTransactionWithReceiptsDocument, variables, options) as Promise<GqlGetTransactionWithReceiptsQuery>;\n },\n getTransactions(variables?: GqlGetTransactionsQueryVariables, options?: C): Promise<GqlGetTransactionsQuery> {\n return requester<GqlGetTransactionsQuery, GqlGetTransactionsQueryVariables>(GetTransactionsDocument, variables, options) as Promise<GqlGetTransactionsQuery>;\n },\n getTransactionsByOwner(variables: GqlGetTransactionsByOwnerQueryVariables, options?: C): Promise<GqlGetTransactionsByOwnerQuery> {\n return requester<GqlGetTransactionsByOwnerQuery, GqlGetTransactionsByOwnerQueryVariables>(GetTransactionsByOwnerDocument, variables, options) as Promise<GqlGetTransactionsByOwnerQuery>;\n },\n estimatePredicates(variables: GqlEstimatePredicatesQueryVariables, options?: C): Promise<GqlEstimatePredicatesQuery> {\n return requester<GqlEstimatePredicatesQuery, GqlEstimatePredicatesQueryVariables>(EstimatePredicatesDocument, variables, options) as Promise<GqlEstimatePredicatesQuery>;\n },\n getLatestBlock(variables?: GqlGetLatestBlockQueryVariables, options?: C): Promise<GqlGetLatestBlockQuery> {\n return requester<GqlGetLatestBlockQuery, GqlGetLatestBlockQueryVariables>(GetLatestBlockDocument, variables, options) as Promise<GqlGetLatestBlockQuery>;\n },\n getLatestBlockHeight(variables?: GqlGetLatestBlockHeightQueryVariables, options?: C): Promise<GqlGetLatestBlockHeightQuery> {\n return requester<GqlGetLatestBlockHeightQuery, GqlGetLatestBlockHeightQueryVariables>(GetLatestBlockHeightDocument, variables, options) as Promise<GqlGetLatestBlockHeightQuery>;\n },\n getBlock(variables?: GqlGetBlockQueryVariables, options?: C): Promise<GqlGetBlockQuery> {\n return requester<GqlGetBlockQuery, GqlGetBlockQueryVariables>(GetBlockDocument, variables, options) as Promise<GqlGetBlockQuery>;\n },\n getBlockWithTransactions(variables?: GqlGetBlockWithTransactionsQueryVariables, options?: C): Promise<GqlGetBlockWithTransactionsQuery> {\n return requester<GqlGetBlockWithTransactionsQuery, GqlGetBlockWithTransactionsQueryVariables>(GetBlockWithTransactionsDocument, variables, options) as Promise<GqlGetBlockWithTransactionsQuery>;\n },\n getBlocks(variables?: GqlGetBlocksQueryVariables, options?: C): Promise<GqlGetBlocksQuery> {\n return requester<GqlGetBlocksQuery, GqlGetBlocksQueryVariables>(GetBlocksDocument, variables, options) as Promise<GqlGetBlocksQuery>;\n },\n getCoin(variables: GqlGetCoinQueryVariables, options?: C): Promise<GqlGetCoinQuery> {\n return requester<GqlGetCoinQuery, GqlGetCoinQueryVariables>(GetCoinDocument, variables, options) as Promise<GqlGetCoinQuery>;\n },\n getCoins(variables: GqlGetCoinsQueryVariables, options?: C): Promise<GqlGetCoinsQuery> {\n return requester<GqlGetCoinsQuery, GqlGetCoinsQueryVariables>(GetCoinsDocument, variables, options) as Promise<GqlGetCoinsQuery>;\n },\n getCoinsToSpend(variables: GqlGetCoinsToSpendQueryVariables, options?: C): Promise<GqlGetCoinsToSpendQuery> {\n return requester<GqlGetCoinsToSpendQuery, GqlGetCoinsToSpendQueryVariables>(GetCoinsToSpendDocument, variables, options) as Promise<GqlGetCoinsToSpendQuery>;\n },\n getContract(variables: GqlGetContractQueryVariables, options?: C): Promise<GqlGetContractQuery> {\n return requester<GqlGetContractQuery, GqlGetContractQueryVariables>(GetContractDocument, variables, options) as Promise<GqlGetContractQuery>;\n },\n getContractBalance(variables: GqlGetContractBalanceQueryVariables, options?: C): Promise<GqlGetContractBalanceQuery> {\n return requester<GqlGetContractBalanceQuery, GqlGetContractBalanceQueryVariables>(GetContractBalanceDocument, variables, options) as Promise<GqlGetContractBalanceQuery>;\n },\n getBalance(variables: GqlGetBalanceQueryVariables, options?: C): Promise<GqlGetBalanceQuery> {\n return requester<GqlGetBalanceQuery, GqlGetBalanceQueryVariables>(GetBalanceDocument, variables, options) as Promise<GqlGetBalanceQuery>;\n },\n getLatestGasPrice(variables?: GqlGetLatestGasPriceQueryVariables, options?: C): Promise<GqlGetLatestGasPriceQuery> {\n return requester<GqlGetLatestGasPriceQuery, GqlGetLatestGasPriceQueryVariables>(GetLatestGasPriceDocument, variables, options) as Promise<GqlGetLatestGasPriceQuery>;\n },\n estimateGasPrice(variables: GqlEstimateGasPriceQueryVariables, options?: C): Promise<GqlEstimateGasPriceQuery> {\n return requester<GqlEstimateGasPriceQuery, GqlEstimateGasPriceQueryVariables>(EstimateGasPriceDocument, variables, options) as Promise<GqlEstimateGasPriceQuery>;\n },\n getBalances(variables: GqlGetBalancesQueryVariables, options?: C): Promise<GqlGetBalancesQuery> {\n return requester<GqlGetBalancesQuery, GqlGetBalancesQueryVariables>(GetBalancesDocument, variables, options) as Promise<GqlGetBalancesQuery>;\n },\n getMessages(variables: GqlGetMessagesQueryVariables, options?: C): Promise<GqlGetMessagesQuery> {\n return requester<GqlGetMessagesQuery, GqlGetMessagesQueryVariables>(GetMessagesDocument, variables, options) as Promise<GqlGetMessagesQuery>;\n },\n getMessageProof(variables: GqlGetMessageProofQueryVariables, options?: C): Promise<GqlGetMessageProofQuery> {\n return requester<GqlGetMessageProofQuery, GqlGetMessageProofQueryVariables>(GetMessageProofDocument, variables, options) as Promise<GqlGetMessageProofQuery>;\n },\n getMessageStatus(variables: GqlGetMessageStatusQueryVariables, options?: C): Promise<GqlGetMessageStatusQuery> {\n return requester<GqlGetMessageStatusQuery, GqlGetMessageStatusQueryVariables>(GetMessageStatusDocument, variables, options) as Promise<GqlGetMessageStatusQuery>;\n },\n getRelayedTransactionStatus(variables: GqlGetRelayedTransactionStatusQueryVariables, options?: C): Promise<GqlGetRelayedTransactionStatusQuery> {\n return requester<GqlGetRelayedTransactionStatusQuery, GqlGetRelayedTransactionStatusQueryVariables>(GetRelayedTransactionStatusDocument, variables, options) as Promise<GqlGetRelayedTransactionStatusQuery>;\n },\n dryRun(variables: GqlDryRunMutationVariables, options?: C): Promise<GqlDryRunMutation> {\n return requester<GqlDryRunMutation, GqlDryRunMutationVariables>(DryRunDocument, variables, options) as Promise<GqlDryRunMutation>;\n },\n submit(variables: GqlSubmitMutationVariables, options?: C): Promise<GqlSubmitMutation> {\n return requester<GqlSubmitMutation, GqlSubmitMutationVariables>(SubmitDocument, variables, options) as Promise<GqlSubmitMutation>;\n },\n produceBlocks(variables: GqlProduceBlocksMutationVariables, options?: C): Promise<GqlProduceBlocksMutation> {\n return requester<GqlProduceBlocksMutation, GqlProduceBlocksMutationVariables>(ProduceBlocksDocument, variables, options) as Promise<GqlProduceBlocksMutation>;\n },\n getMessageByNonce(variables: GqlGetMessageByNonceQueryVariables, options?: C): Promise<GqlGetMessageByNonceQuery> {\n return requester<GqlGetMessageByNonceQuery, GqlGetMessageByNonceQueryVariables>(GetMessageByNonceDocument, variables, options) as Promise<GqlGetMessageByNonceQuery>;\n },\n isUserAccount(variables: GqlIsUserAccountQueryVariables, options?: C): Promise<GqlIsUserAccountQuery> {\n return requester<GqlIsUserAccountQuery, GqlIsUserAccountQueryVariables>(IsUserAccountDocument, variables, options) as Promise<GqlIsUserAccountQuery>;\n },\n getConsensusParametersVersion(variables?: GqlGetConsensusParametersVersionQueryVariables, options?: C): Promise<GqlGetConsensusParametersVersionQuery> {\n return requester<GqlGetConsensusParametersVersionQuery, GqlGetConsensusParametersVersionQueryVariables>(GetConsensusParametersVersionDocument, variables, options) as Promise<GqlGetConsensusParametersVersionQuery>;\n },\n submitAndAwaitStatus(variables: GqlSubmitAndAwaitStatusSubscriptionVariables, options?: C): AsyncIterable<GqlSubmitAndAwaitStatusSubscription> {\n return requester<GqlSubmitAndAwaitStatusSubscription, GqlSubmitAndAwaitStatusSubscriptionVariables>(SubmitAndAwaitStatusDocument, variables, options) as AsyncIterable<GqlSubmitAndAwaitStatusSubscription>;\n },\n statusChange(variables: GqlStatusChangeSubscriptionVariables, options?: C): AsyncIterable<GqlStatusChangeSubscription> {\n return requester<GqlStatusChangeSubscription, GqlStatusChangeSubscriptionVariables>(StatusChangeDocument, variables, options) as AsyncIterable<GqlStatusChangeSubscription>;\n }\n };\n}\nexport type Sdk = ReturnType<typeof getSdk>;","import { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport type { DocumentNode } from 'graphql';\nimport { print } from 'graphql';\n\ntype FuelGraphQLSubscriberOptions = {\n url: string;\n query: DocumentNode;\n variables?: Record<string, unknown>;\n fetchFn: typeof fetch;\n};\n\nexport class FuelGraphqlSubscriber implements AsyncIterator<unknown> {\n private static textDecoder = new TextDecoder();\n\n private constructor(private stream: ReadableStreamDefaultReader<Uint8Array>) {}\n\n public static async create(options: FuelGraphQLSubscriberOptions) {\n const { url, query, variables, fetchFn } = options;\n const response = await fetchFn(`${url}-sub`, {\n method: 'POST',\n body: JSON.stringify({\n query: print(query),\n variables,\n }),\n headers: {\n 'Content-Type': 'application/json',\n Accept: 'text/event-stream',\n },\n });\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const [errorReader, resultReader] = response.body!.tee().map((stream) => stream.getReader());\n\n /**\n * If the node threw an error, read it and throw it to the user\n * Else just discard the response and return the subscriber below,\n * which will have that same response via `resultReader`\n */\n await new FuelGraphqlSubscriber(errorReader).next();\n\n return new FuelGraphqlSubscriber(resultReader);\n }\n\n private events: Array<{ data: unknown; errors?: { message: string }[] }> = [];\n private parsingLeftover = '';\n\n async next(): Promise<IteratorResult<unknown, unknown>> {\n // eslint-disable-next-line no-constant-condition\n while (true) {\n if (this.events.length > 0) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const { data, errors } = this.events.shift()!;\n if (Array.isArray(errors)) {\n throw new FuelError(\n FuelError.CODES.INVALID_REQUEST,\n errors.map((err) => err.message).join('\\n\\n')\n );\n }\n return { value: data, done: false };\n }\n const { value, done } = await this.stream.read();\n if (done) {\n return { value, done };\n }\n\n /**\n * We don't care about keep-alive messages.\n * The only responses that I came across from the node are either 200 responses with \"data:.*\" or keep-alive messages.\n * You can find the keep-alive message in the fuel-core codebase (latest permalink as of writing):\n * https://github.com/FuelLabs/fuel-core/blob/e1e631902f762081d2124d9c457ddfe13ac366dc/crates/fuel-core/src/graphql_api/service.rs#L247\n * To get the actual latest info you need to check out the master branch (might change):\n * https://github.com/FuelLabs/fuel-core/blob/master/crates/fuel-core/src/graphql_api/service.rs#L247\n * */\n const decoded = FuelGraphqlSubscriber.textDecoder\n .decode(value)\n .replace(':keep-alive-text\\n\\n', '');\n\n if (decoded === '') {\n continue;\n }\n\n const text = `${this.parsingLeftover}${decoded}`;\n const regex = /data:.*\\n\\n/g;\n\n const matches = [...text.matchAll(regex)].flatMap((match) => match);\n\n matches.forEach((match) => {\n try {\n this.events.push(JSON.parse(match.replace(/^data:/, '')));\n } catch (e) {\n throw new FuelError(\n ErrorCode.STREAM_PARSING_ERROR,\n `Error while parsing stream data response: ${text}`\n );\n }\n });\n\n this.parsingLeftover = text.replace(matches.join(), '');\n }\n }\n\n /**\n * Gets called when `break` is called in a `for-await-of` loop.\n */\n return(): Promise<IteratorResult<unknown, undefined>> {\n return Promise.resolve({ done: true, value: undefined });\n }\n\n [Symbol.asyncIterator](): AsyncIterator<unknown, unknown, undefined> {\n return this;\n }\n}\n","import { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { hexlify } from '@fuel-ts/utils';\n\nimport type { ExcludeResourcesOption } from './resource';\n\ninterface CachedResource {\n utxos: Set<string>;\n messages: Set<string>;\n timestamp: number;\n}\n\nconst cache = new Map<string, CachedResource>();\n\nexport class ResourceCache {\n readonly ttl: number;\n\n constructor(ttl: number) {\n this.ttl = ttl; // TTL in milliseconds\n\n if (typeof ttl !== 'number' || this.ttl <= 0) {\n throw new FuelError(\n ErrorCode.INVALID_TTL,\n `Invalid TTL: ${this.ttl}. Use a value greater than zero.`\n );\n }\n }\n\n // Add resources to the cache\n set(transactionId: string, resources: Required<ExcludeResourcesOption>): void {\n const currentTime = Date.now();\n const existingResources = cache.get(transactionId) || {\n utxos: new Set<string>(),\n messages: new Set<string>(),\n timestamp: currentTime,\n };\n\n resources.utxos.forEach((utxo) => existingResources.utxos.add(hexlify(utxo)));\n resources.messages.forEach((message) => existingResources.messages.add(hexlify(message)));\n\n cache.set(transactionId, existingResources);\n }\n\n // Remove resources from the cache for a given transaction ID\n unset(transactionId: string): void {\n cache.delete(transactionId);\n }\n\n // Get all cached resources and remove expired ones\n getActiveData() {\n const allResources: { utxos: string[]; messages: string[] } = { utxos: [], messages: [] };\n const currentTime = Date.now();\n cache.forEach((resource, transactionId) => {\n if (currentTime - resource.timestamp < this.ttl) {\n allResources.utxos.push(...resource.utxos);\n allResources.messages.push(...resource.messages);\n } else {\n cache.delete(transactionId);\n }\n });\n return allResources;\n }\n\n // Check if a UTXO ID or message nonce is already cached and not expired\n isCached(key: string): boolean {\n const currentTime = Date.now();\n for (const [transactionId, resourceData] of cache.entries()) {\n if (currentTime - resourceData.timestamp > this.ttl) {\n cache.delete(transactionId);\n } else if (resourceData.utxos.has(key) || resourceData.messages.has(key)) {\n return true;\n }\n }\n return false;\n }\n\n clear() {\n cache.clear();\n }\n}\n","import { BYTES_32, UTXO_ID_LEN } from '@fuel-ts/abi-coder';\nimport { ZeroBytes32 } from '@fuel-ts/address/configs';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport type { BigNumberish } from '@fuel-ts/math';\nimport { bn, toNumber } from '@fuel-ts/math';\nimport type { Input } from '@fuel-ts/transactions';\nimport { InputType } from '@fuel-ts/transactions';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { arrayify, hexlify } from '@fuel-ts/utils';\n\nexport type CoinTransactionRequestInput = {\n type: InputType.Coin;\n\n /** UTXO ID */\n id: BytesLike;\n\n /** Owning address or script hash */\n owner: BytesLike;\n\n /** Amount of coins */\n amount: BigNumberish;\n\n /** Asset ID of the coins */\n assetId: BytesLike;\n\n /** Points to the TX whose output is being spent. (TxPointer) */\n txPointer: BytesLike;\n\n /** Index of witness that authorizes spending the coin */\n witnessIndex: number;\n\n /** Gas used by predicate */\n predicateGasUsed?: BigNumberish;\n\n /** Predicate bytecode */\n predicate?: BytesLike;\n\n /** Predicate input data (parameters) */\n predicateData?: BytesLike;\n};\n\nexport type MessageTransactionRequestInput = {\n type: InputType.Message;\n\n /** Address of sender */\n sender: BytesLike;\n\n /** Address of recipient */\n recipient: BytesLike;\n\n /** Amount of coins */\n amount: BigNumberish;\n\n /** Index of witness that authorizes the message */\n witnessIndex: number;\n\n /** Unique nonce of message */\n nonce: BytesLike;\n\n /** Gas used by predicate */\n predicateGasUsed?: BigNumberish;\n\n /** Predicate bytecode */\n predicate?: BytesLike;\n\n /** Predicate input data (parameters) */\n predicateData?: BytesLike;\n\n /** data of message */\n data?: BytesLike;\n};\n\nexport type ContractTransactionRequestInput = {\n type: InputType.Contract;\n\n /** Points to the TX whose output is being spent. (TxPointer) */\n txPointer: BytesLike;\n\n /** Contract ID */\n contractId: BytesLike;\n};\nexport type TransactionRequestInput =\n | CoinTransactionRequestInput\n | ContractTransactionRequestInput\n | MessageTransactionRequestInput;\n\n/** @hidden */\nexport const inputify = (value: TransactionRequestInput): Input => {\n const { type } = value;\n\n switch (value.type) {\n case InputType.Coin: {\n const predicate = arrayify(value.predicate ?? '0x');\n const predicateData = arrayify(value.predicateData ?? '0x');\n return {\n type: InputType.Coin,\n txID: hexlify(arrayify(value.id).slice(0, BYTES_32)),\n outputIndex: toNumber(arrayify(value.id).slice(BYTES_32, UTXO_ID_LEN)),\n owner: hexlify(value.owner),\n amount: bn(value.amount),\n assetId: hexlify(value.assetId),\n txPointer: {\n blockHeight: toNumber(arrayify(value.txPointer).slice(0, 8)),\n txIndex: toNumber(arrayify(value.txPointer).slice(8, 16)),\n },\n witnessIndex: value.witnessIndex,\n predicateGasUsed: bn(value.predicateGasUsed),\n predicateLength: bn(predicate.length),\n predicateDataLength: bn(predicateData.length),\n predicate: hexlify(predicate),\n predicateData: hexlify(predicateData),\n };\n }\n case InputType.Contract: {\n return {\n type: InputType.Contract,\n txID: ZeroBytes32,\n outputIndex: 0,\n balanceRoot: ZeroBytes32,\n stateRoot: ZeroBytes32,\n txPointer: {\n blockHeight: toNumber(arrayify(value.txPointer).slice(0, 8)),\n txIndex: toNumber(arrayify(value.txPointer).slice(8, 16)),\n },\n contractID: hexlify(value.contractId),\n };\n }\n case InputType.Message: {\n const predicate = arrayify(value.predicate ?? '0x');\n const predicateData = arrayify(value.predicateData ?? '0x');\n const data = arrayify(value.data ?? '0x');\n return {\n type: InputType.Message,\n sender: hexlify(value.sender),\n recipient: hexlify(value.recipient),\n amount: bn(value.amount),\n nonce: hexlify(value.nonce),\n witnessIndex: value.witnessIndex,\n predicateGasUsed: bn(value.predicateGasUsed),\n predicateLength: bn(predicate.length),\n predicateDataLength: bn(predicateData.length),\n predicate: hexlify(predicate),\n predicateData: hexlify(predicateData),\n data: hexlify(data),\n dataLength: data.length,\n };\n }\n default: {\n throw new FuelError(\n ErrorCode.INVALID_TRANSACTION_INPUT,\n `Invalid transaction input type: ${type}.`\n );\n }\n }\n};\n","import { ZeroBytes32 } from '@fuel-ts/address/configs';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport type { BigNumberish } from '@fuel-ts/math';\nimport { bn } from '@fuel-ts/math';\nimport type { Output } from '@fuel-ts/transactions';\nimport { OutputType } from '@fuel-ts/transactions';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { hexlify } from '@fuel-ts/utils';\n\nexport type CoinTransactionRequestOutput = {\n type: OutputType.Coin;\n /** Receiving address or script hash */\n to: BytesLike;\n /** Amount of coins to send */\n amount: BigNumberish;\n /** Asset ID of coins */\n assetId: BytesLike;\n};\nexport type ContractTransactionRequestOutput = {\n type: OutputType.Contract;\n /** Index of input contract */\n inputIndex: number;\n};\nexport type ChangeTransactionRequestOutput = {\n type: OutputType.Change;\n /** Receiving address or script hash */\n to: BytesLike;\n /** Asset ID of coins */\n assetId: BytesLike;\n};\nexport type VariableTransactionRequestOutput = {\n type: OutputType.Variable;\n};\nexport type ContractCreatedTransactionRequestOutput = {\n type: OutputType.ContractCreated;\n /** Contract ID */\n contractId: BytesLike;\n /** State Root */\n stateRoot: BytesLike;\n};\nexport type TransactionRequestOutput =\n | CoinTransactionRequestOutput\n | ContractTransactionRequestOutput\n | ChangeTransactionRequestOutput\n | VariableTransactionRequestOutput\n | ContractCreatedTransactionRequestOutput;\n\n/** @hidden */\nexport const outputify = (value: TransactionRequestOutput): Output => {\n const { type } = value;\n\n switch (type) {\n case OutputType.Coin: {\n return {\n type: OutputType.Coin,\n to: hexlify(value.to),\n amount: bn(value.amount),\n assetId: hexlify(value.assetId),\n };\n }\n case OutputType.Contract: {\n return {\n type: OutputType.Contract,\n inputIndex: value.inputIndex,\n balanceRoot: ZeroBytes32,\n stateRoot: ZeroBytes32,\n };\n }\n case OutputType.Change: {\n return {\n type: OutputType.Change,\n to: hexlify(value.to),\n amount: bn(0),\n assetId: hexlify(value.assetId),\n };\n }\n case OutputType.Variable: {\n return {\n type: OutputType.Variable,\n to: ZeroBytes32,\n amount: bn(0),\n assetId: ZeroBytes32,\n };\n }\n case OutputType.ContractCreated: {\n return {\n type: OutputType.ContractCreated,\n contractId: hexlify(value.contractId),\n stateRoot: hexlify(value.stateRoot),\n };\n }\n default: {\n throw new FuelError(\n ErrorCode.INVALID_TRANSACTION_INPUT,\n `Invalid transaction output type: ${type}.`\n );\n }\n }\n};\n","import { UTXO_ID_LEN } from '@fuel-ts/abi-coder';\nimport { Address, addressify } from '@fuel-ts/address';\nimport type { AddressLike } from '@fuel-ts/address';\nimport { ZeroBytes32 } from '@fuel-ts/address/configs';\nimport { randomBytes } from '@fuel-ts/crypto';\nimport { FuelError } from '@fuel-ts/errors';\nimport type { BN, BigNumberish } from '@fuel-ts/math';\nimport { bn } from '@fuel-ts/math';\nimport type {\n TransactionScript,\n Policy,\n TransactionCreate,\n TransactionBlob,\n TransactionUpload,\n TransactionUpgrade,\n} from '@fuel-ts/transactions';\nimport {\n PolicyType,\n TransactionCoder,\n InputType,\n OutputType,\n TransactionType,\n} from '@fuel-ts/transactions';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { concat, hexlify, isDefined } from '@fuel-ts/utils';\n\nimport type { Account } from '../../account';\nimport type { Coin } from '../coin';\nimport type { CoinQuantity, CoinQuantityLike } from '../coin-quantity';\nimport { coinQuantityfy } from '../coin-quantity';\nimport { isMessageCoin, type Message, type MessageCoin } from '../message';\nimport type { ChainInfo, GasCosts } from '../provider';\nimport type { Resource } from '../resource';\nimport { isCoin } from '../resource';\nimport { normalizeJSON } from '../utils';\nimport { getMaxGas, getMinGas } from '../utils/gas';\n\nimport { NoWitnessAtIndexError } from './errors';\nimport {\n getRequestInputResourceOwner,\n isRequestInputCoinOrMessage,\n isRequestInputResource,\n isRequestInputResourceFromOwner,\n} from './helpers';\nimport type {\n TransactionRequestInput,\n CoinTransactionRequestInput,\n MessageTransactionRequestInput,\n} from './input';\nimport { inputify } from './input';\nimport type {\n TransactionRequestOutput,\n ChangeTransactionRequestOutput,\n CoinTransactionRequestOutput,\n} from './output';\nimport { outputify } from './output';\nimport type { TransactionRequestLike } from './types';\nimport type { TransactionRequestWitness } from './witness';\nimport { witnessify } from './witness';\n\nexport {\n /**\n * @hidden\n */\n TransactionType,\n};\n\n/**\n * @hidden\n *\n * Interface defining a like structure for a base transaction request.\n */\nexport interface BaseTransactionRequestLike {\n /** Gas price for transaction */\n tip?: BigNumberish;\n /** Block until which tx cannot be included */\n maturity?: number;\n /** The maximum fee payable by this transaction using BASE_ASSET. */\n maxFee?: BigNumberish;\n /** The maximum amount of witness data allowed for the transaction */\n witnessLimit?: BigNumberish;\n /** List of inputs */\n inputs?: TransactionRequestInput[];\n /** List of outputs */\n outputs?: TransactionRequestOutput[];\n /** List of witnesses */\n witnesses?: TransactionRequestWitness[];\n}\n\ntype ToBaseTransactionResponse = Pick<\n TransactionScript,\n | 'inputs'\n | 'inputsCount'\n | 'outputs'\n | 'outputsCount'\n | 'witnesses'\n | 'witnessesCount'\n | 'policies'\n | 'policyTypes'\n>;\n\n/**\n * Abstract class to define the functionalities of a transaction request transaction request.\n */\nexport abstract class BaseTransactionRequest implements BaseTransactionRequestLike {\n /** Type of the transaction */\n abstract type: TransactionType;\n /** Gas price for transaction */\n tip?: BN;\n /** Block until which tx cannot be included */\n maturity?: number;\n /** The maximum fee payable by this transaction using BASE_ASSET. */\n maxFee: BN;\n /** The maximum amount of witness data allowed for the transaction */\n witnessLimit?: BN | undefined;\n /** List of inputs */\n inputs: TransactionRequestInput[] = [];\n /** List of outputs */\n outputs: TransactionRequestOutput[] = [];\n /** List of witnesses */\n witnesses: TransactionRequestWitness[] = [];\n\n /**\n * Constructor for initializing a base transaction request.\n *\n * @param baseTransactionRequest - Optional object containing properties to initialize the transaction request.\n */\n constructor({\n tip,\n maturity,\n maxFee,\n witnessLimit,\n inputs,\n outputs,\n witnesses,\n }: BaseTransactionRequestLike = {}) {\n this.tip = tip ? bn(tip) : undefined;\n this.maturity = maturity && maturity > 0 ? maturity : undefined;\n this.witnessLimit = isDefined(witnessLimit) ? bn(witnessLimit) : undefined;\n this.maxFee = bn(maxFee);\n this.inputs = inputs ?? [];\n this.outputs = outputs ?? [];\n this.witnesses = witnesses ?? [];\n }\n\n static getPolicyMeta(req: BaseTransactionRequest) {\n let policyTypes = 0;\n const policies: Policy[] = [];\n\n const { tip, witnessLimit, maturity } = req;\n\n if (bn(tip).gt(0)) {\n policyTypes += PolicyType.Tip;\n policies.push({ data: bn(tip), type: PolicyType.Tip });\n }\n if (isDefined(witnessLimit) && bn(witnessLimit).gte(0)) {\n policyTypes += PolicyType.WitnessLimit;\n policies.push({ data: bn(witnessLimit), type: PolicyType.WitnessLimit });\n }\n if (maturity && maturity > 0) {\n policyTypes += PolicyType.Maturity;\n policies.push({ data: maturity, type: PolicyType.Maturity });\n }\n\n policyTypes += PolicyType.MaxFee;\n policies.push({ data: req.maxFee, type: PolicyType.MaxFee });\n\n return {\n policyTypes,\n policies,\n };\n }\n\n /**\n * Method to obtain the base transaction details.\n *\n * @returns The base transaction details.\n */\n\n protected getBaseTransaction(): ToBaseTransactionResponse {\n const inputs = this.inputs?.map(inputify) ?? [];\n const outputs = this.outputs?.map(outputify) ?? [];\n const witnesses = this.witnesses?.map(witnessify) ?? [];\n\n const { policyTypes, policies } = BaseTransactionRequest.getPolicyMeta(this);\n\n return {\n policyTypes,\n inputs,\n outputs,\n policies,\n witnesses,\n inputsCount: inputs.length,\n outputsCount: outputs.length,\n witnessesCount: witnesses.length,\n };\n }\n\n abstract toTransaction():\n | TransactionCreate\n | TransactionScript\n | TransactionBlob\n | TransactionUpgrade\n | TransactionUpload;\n\n /**\n * Converts the transaction request to a byte array.\n *\n * @returns The transaction bytes.\n */\n toTransactionBytes(): Uint8Array {\n return new TransactionCoder().encode(this.toTransaction());\n }\n\n /**\n * @hidden\n *\n * Pushes an input to the list without any side effects and returns the index\n */\n protected pushInput(input: TransactionRequestInput): number {\n this.inputs.push(input);\n return this.inputs.length - 1;\n }\n\n /**\n * @hidden\n *\n * Pushes an output to the list without any side effects and returns the index\n */\n protected pushOutput(output: TransactionRequestOutput): number {\n this.outputs.push(output);\n return this.outputs.length - 1;\n }\n\n /**\n * @hidden\n *\n * Pushes a witness to the list and returns the index\n *\n * @param signature - The signature to add to the witness.\n * @returns The index of the created witness.\n */\n addWitness(signature: BytesLike) {\n this.witnesses.push(signature);\n return this.witnesses.length - 1;\n }\n\n /**\n * @hidden\n *\n * Creates an empty witness without any side effects and returns the index\n *\n * @returns The index of the created witness.\n */\n addEmptyWitness(): number {\n // Push a dummy witness with same byte size as a real witness signature\n this.addWitness(concat([ZeroBytes32, ZeroBytes32]));\n return this.witnesses.length - 1;\n }\n\n /**\n * Updates the witness for a given owner and signature.\n *\n * @param address - The address to get the coin input witness index for.\n * @param signature - The signature to update the witness with.\n */\n updateWitnessByOwner(address: string | Address, signature: BytesLike) {\n const ownerAddress = Address.fromAddressOrString(address);\n const witnessIndex = this.getCoinInputWitnessIndexByOwner(ownerAddress);\n if (typeof witnessIndex === 'number') {\n this.updateWitness(witnessIndex, signature);\n }\n }\n\n /**\n * Updates an existing witness without any side effects.\n *\n * @param index - The index of the witness to update.\n * @param witness - The new witness.\n * @throws If the witness does not exist.\n */\n updateWitness(index: number, witness: TransactionRequestWitness) {\n if (!this.witnesses[index]) {\n throw new NoWitnessAtIndexError(index);\n }\n this.witnesses[index] = witness;\n }\n\n /**\n * Helper function to add an external signature to the transaction.\n *\n * @param account - The account/s to sign to the transaction.\n * @returns The transaction with the signature witness added.\n */\n async addAccountWitnesses(account: Account | Account[]) {\n const accounts = Array.isArray(account) ? account : [account];\n await Promise.all(\n accounts.map(async (acc) => {\n this.addWitness(await acc.signTransaction(<TransactionRequestLike>this));\n })\n );\n\n return this;\n }\n\n /**\n * Gets the coin inputs for a transaction.\n *\n * @returns The coin inputs.\n */\n getCoinInputs(): CoinTransactionRequestInput[] {\n return this.inputs.filter(\n (input): input is CoinTransactionRequestInput => input.type === InputType.Coin\n );\n }\n\n /**\n * Gets the coin outputs for a transaction.\n *\n * @returns The coin outputs.\n */\n getCoinOutputs(): CoinTransactionRequestOutput[] {\n return this.outputs.filter(\n (output): output is CoinTransactionRequestOutput => output.type === OutputType.Coin\n );\n }\n\n /**\n * Gets the change outputs for a transaction.\n *\n * @returns The change outputs.\n */\n getChangeOutputs(): ChangeTransactionRequestOutput[] {\n return this.outputs.filter(\n (output): output is ChangeTransactionRequestOutput => output.type === OutputType.Change\n );\n }\n\n /**\n * @hidden\n *\n * Returns the witnessIndex of the found CoinInput.\n */\n getCoinInputWitnessIndexByOwner(owner: AddressLike): number | undefined {\n const ownerAddress = addressify(owner);\n\n const found = this.inputs.find((input) => {\n switch (input.type) {\n case InputType.Coin:\n return hexlify((<CoinTransactionRequestInput>input).owner) === ownerAddress.toB256();\n case InputType.Message:\n return (\n hexlify((<MessageTransactionRequestInput>input).recipient) === ownerAddress.toB256()\n );\n default:\n return false;\n }\n });\n\n return (<CoinTransactionRequestInput>found)?.witnessIndex;\n }\n\n /**\n * Adds a single coin input to the transaction and a change output for the related\n * assetId, if one it was not added yet.\n *\n * @param coin - Coin resource.\n */\n addCoinInput(coin: Coin) {\n const { assetId, owner, amount, id, predicate, predicateData } = coin;\n\n let witnessIndex;\n\n if (coin.predicate) {\n witnessIndex = 0;\n } else {\n witnessIndex = this.getCoinInputWitnessIndexByOwner(owner);\n\n // Insert a dummy witness if no witness exists\n if (typeof witnessIndex !== 'number') {\n witnessIndex = this.addEmptyWitness();\n }\n }\n\n const input: CoinTransactionRequestInput = {\n id,\n type: InputType.Coin,\n owner: owner.toB256(),\n amount,\n assetId,\n txPointer: '0x00000000000000000000000000000000',\n witnessIndex,\n predicate,\n predicateData,\n };\n\n // Insert the Input\n this.pushInput(input);\n\n // Insert a ChangeOutput if it does not exist\n this.addChangeOutput(owner, assetId);\n }\n\n /**\n * Adds a single message input to the transaction and a change output for the\n * asset against the message\n *\n * @param message - Message resource.\n */\n addMessageInput(message: Message | MessageCoin) {\n const { recipient, sender, amount, predicate, nonce, predicateData } = message;\n\n let witnessIndex;\n\n if (message.predicate) {\n witnessIndex = 0;\n } else {\n witnessIndex = this.getCoinInputWitnessIndexByOwner(recipient);\n\n // Insert a dummy witness if no witness exists\n if (typeof witnessIndex !== 'number') {\n witnessIndex = this.addEmptyWitness();\n }\n }\n\n const input: MessageTransactionRequestInput = {\n nonce,\n type: InputType.Message,\n sender: sender.toB256(),\n recipient: recipient.toB256(),\n data: isMessageCoin(message) ? '0x' : message.data,\n amount,\n witnessIndex,\n predicate,\n predicateData,\n };\n\n // Insert the Input\n this.pushInput(input);\n\n // Insert a ChangeOutput if it does not exist\n if (isMessageCoin(message)) {\n this.addChangeOutput(recipient, message.assetId);\n }\n }\n\n /**\n * Adds a single resource to the transaction by adding a coin/message input and a\n * change output for the related assetId, if one it was not added yet.\n *\n * @param resource - The resource to add.\n * @returns This transaction.\n */\n addResource(resource: Resource) {\n if (isCoin(resource)) {\n this.addCoinInput(resource);\n } else {\n this.addMessageInput(resource);\n }\n\n return this;\n }\n\n /**\n * Adds multiple resources to the transaction by adding coin/message inputs and change\n * outputs from the related assetIds.\n *\n * @param resources - The resources to add.\n * @returns This transaction.\n */\n addResources(resources: ReadonlyArray<Resource>) {\n resources.forEach((resource) => this.addResource(resource));\n\n return this;\n }\n\n /**\n * Adds a coin output to the transaction.\n *\n * @param to - Address of the owner.\n * @param amount - Amount of coin.\n * @param assetId - Asset ID of coin.\n */\n addCoinOutput(to: AddressLike, amount: BigNumberish, assetId: BytesLike) {\n this.pushOutput({\n type: OutputType.Coin,\n to: addressify(to).toB256(),\n amount,\n assetId,\n });\n\n return this;\n }\n\n /**\n * Adds multiple coin outputs to the transaction.\n *\n * @param to - Address of the destination.\n * @param quantities - Quantities of coins.\n */\n addCoinOutputs(to: AddressLike, quantities: CoinQuantityLike[]) {\n quantities.map(coinQuantityfy).forEach((quantity) => {\n this.pushOutput({\n type: OutputType.Coin,\n to: addressify(to).toB256(),\n amount: quantity.amount,\n assetId: quantity.assetId,\n });\n });\n\n return this;\n }\n\n /**\n * Adds a change output to the transaction.\n *\n * @param to - Address of the owner.\n * @param assetId - Asset ID of coin.\n */\n addChangeOutput(to: AddressLike, assetId: BytesLike) {\n // Find the ChangeOutput for the AssetId of the Resource\n const changeOutput = this.getChangeOutputs().find(\n (output) => hexlify(output.assetId) === assetId\n );\n\n // Insert a ChangeOutput if it does not exist\n if (!changeOutput) {\n this.pushOutput({\n type: OutputType.Change,\n to: addressify(to).toB256(),\n assetId,\n });\n }\n }\n\n /**\n * @hidden\n */\n byteSize() {\n return this.toTransactionBytes().length;\n }\n\n /**\n * @hidden\n */\n metadataGas(_gasCosts: GasCosts): BN {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Not implemented');\n }\n\n /**\n * @hidden\n */\n calculateMinGas(chainInfo: ChainInfo): BN {\n const { consensusParameters } = chainInfo;\n const {\n gasCosts,\n feeParameters: { gasPerByte },\n } = consensusParameters;\n return getMinGas({\n gasPerByte,\n gasCosts,\n inputs: this.inputs,\n txBytesSize: this.byteSize(),\n metadataGas: this.metadataGas(gasCosts),\n });\n }\n\n calculateMaxGas(chainInfo: ChainInfo, minGas: BN): BN {\n const { consensusParameters } = chainInfo;\n const {\n feeParameters: { gasPerByte },\n txParameters: { maxGasPerTx },\n } = consensusParameters;\n\n const witnessesLength = this.toTransaction().witnesses.reduce(\n (acc, wit) => acc + wit.dataLength,\n 0\n );\n return getMaxGas({\n gasPerByte,\n minGas,\n witnessesLength,\n witnessLimit: this.witnessLimit,\n maxGasPerTx,\n });\n }\n\n /**\n * Funds the transaction with fake UTXOs for each assetId and amount in the\n * quantities array.\n *\n * @param quantities - CoinQuantity Array.\n * @param baseAssetId - The base asset to fund the transaction.\n * @deprecated - This method is deprecated and will be removed in future versions.\n * Please use `Account.generateFakeResources` along with `this.addResources` instead.\n */\n fundWithFakeUtxos(quantities: CoinQuantity[], baseAssetId: string, resourcesOwner?: Address) {\n const findAssetInput = (assetId: string) =>\n this.inputs.find((input) => {\n if ('assetId' in input) {\n return input.assetId === assetId;\n }\n return false;\n });\n\n const updateAssetInput = (assetId: string, quantity: BN) => {\n const assetInput = findAssetInput(assetId);\n\n let usedQuantity = quantity;\n\n if (assetId === baseAssetId) {\n usedQuantity = bn('1000000000000000000');\n }\n\n if (assetInput && 'assetId' in assetInput) {\n assetInput.id = hexlify(randomBytes(UTXO_ID_LEN));\n assetInput.amount = usedQuantity;\n } else {\n this.addResources([\n {\n id: hexlify(randomBytes(UTXO_ID_LEN)),\n amount: usedQuantity,\n assetId,\n owner: resourcesOwner || Address.fromRandom(),\n blockCreated: bn(1),\n txCreatedIdx: bn(1),\n },\n ]);\n }\n };\n\n updateAssetInput(baseAssetId, bn(100_000_000_000));\n quantities.forEach((q) => updateAssetInput(q.assetId, q.amount));\n\n return this;\n }\n\n /**\n * Retrieves an array of CoinQuantity for each coin output present in the transaction.\n * a transaction.\n *\n * @returns CoinQuantity array.\n */\n getCoinOutputsQuantities(): CoinQuantity[] {\n const coinsQuantities = this.getCoinOutputs().map(({ amount, assetId }) => ({\n amount: bn(amount),\n assetId: assetId.toString(),\n }));\n\n return coinsQuantities;\n }\n\n /**\n * Gets the Transaction Request by hashing the transaction.\n *\n * @param chainId - The chain ID.\n *\n * @returns - A hash of the transaction, which is the transaction ID.\n */\n abstract getTransactionId(chainId: number): string;\n\n /**\n * Return the minimum amount in native coins required to create\n * a transaction.\n *\n * @returns The transaction as a JSON object.\n */\n toJSON() {\n return normalizeJSON(this);\n }\n\n removeWitness(index: number) {\n this.witnesses.splice(index, 1);\n this.adjustWitnessIndexes(index);\n }\n\n private adjustWitnessIndexes(removedIndex: number) {\n this.inputs.filter(isRequestInputResource).forEach((input) => {\n if (input.witnessIndex > removedIndex) {\n // eslint-disable-next-line no-param-reassign\n input.witnessIndex -= 1;\n }\n });\n }\n\n updatePredicateGasUsed(inputs: TransactionRequestInput[]) {\n const inputsToExtractGasUsed = inputs.filter(isRequestInputCoinOrMessage);\n\n this.inputs.filter(isRequestInputResource).forEach((i) => {\n const owner = getRequestInputResourceOwner(i);\n const correspondingInput = inputsToExtractGasUsed.find((x) =>\n isRequestInputResourceFromOwner(x, Address.fromString(String(owner)))\n );\n\n if (\n correspondingInput &&\n 'predicateGasUsed' in correspondingInput &&\n bn(correspondingInput.predicateGasUsed).gt(0)\n ) {\n // eslint-disable-next-line no-param-reassign\n i.predicateGasUsed = correspondingInput.predicateGasUsed;\n }\n });\n }\n\n byteLength(): number {\n return this.toTransactionBytes().byteLength;\n }\n}\n","import type { Address } from '@fuel-ts/address';\nimport type { BN } from '@fuel-ts/math';\nimport type { BytesLike } from '@fuel-ts/utils';\n\nimport type { GqlMessageState } from './__generated__/operations';\n\n// #region Message-shape\n/**\n * A Fuel message\n */\nexport type Message = {\n messageId: BytesLike;\n sender: Address;\n recipient: Address;\n nonce: BytesLike;\n amount: BN;\n data: BytesLike;\n daHeight: BN;\n predicate?: BytesLike;\n predicateData?: BytesLike;\n};\n// #endregion Message-shape\n\nexport type MessageCoin = {\n assetId: string;\n sender: Address;\n recipient: Address;\n nonce: BytesLike;\n amount: BN;\n daHeight: BN;\n predicate?: BytesLike;\n predicateData?: BytesLike;\n};\n\nexport type MerkleProof = {\n proofSet: Array<string>;\n proofIndex: BN;\n};\n\nexport type BlockHeader = {\n id: string;\n daHeight: BN;\n transactionsCount: number;\n transactionsRoot: string;\n height: BN;\n prevRoot: string;\n time: string;\n applicationHash: string;\n messageOutboxRoot: string;\n eventInboxRoot: string;\n consensusParametersVersion: number;\n stateTransitionBytecodeVersion: number;\n messageReceiptCount: number;\n};\n\n/**\n * Message Proof\n */\nexport type MessageProof = {\n messageProof: MerkleProof;\n blockProof: MerkleProof;\n messageBlockHeader: BlockHeader;\n commitBlockHeader: BlockHeader;\n sender: Address;\n recipient: Address;\n nonce: string;\n amount: BN;\n data: string;\n};\n\n/**\n * Message Status\n */\nexport type MessageStatus = {\n state: GqlMessageState;\n};\n\nexport const isMessageCoin = (message: Message | MessageCoin): message is MessageCoin =>\n !('data' in message);\n","import type { BytesLike } from '@fuel-ts/utils';\n\nimport type { Coin } from './coin';\nimport type { MessageCoin } from './message';\n\nexport type RawCoin = {\n utxoId: string;\n owner: string;\n amount: string;\n assetId: string;\n blockCreated: string;\n txCreatedIdx: string;\n};\n\nexport type RawMessage = {\n amount: string;\n sender: string;\n assetId: string;\n recipient: string;\n data: string;\n nonce: string;\n daHeight: string;\n};\n\nexport type RawResource = RawCoin | RawMessage;\nexport type Resource = Coin | MessageCoin;\n\n/** @hidden */\nexport type ExcludeResourcesOption = {\n utxos?: BytesLike[];\n messages?: BytesLike[];\n};\n\n/** @hidden */\nexport const isRawCoin = (resource: RawResource): resource is RawCoin => 'utxoId' in resource;\n/** @hidden */\nexport const isRawMessage = (resource: RawResource): resource is RawMessage =>\n 'recipient' in resource;\n/** @hidden */\nexport const isCoin = (resource: Resource): resource is Coin => 'id' in resource;\n/** @hidden */\nexport const isMessage = (resource: Resource): resource is MessageCoin => 'recipient' in resource;\n","import { ZeroBytes32 } from '@fuel-ts/address/configs';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { bn } from '@fuel-ts/math';\nimport type {\n ReceiptBurn,\n ReceiptCall,\n ReceiptLog,\n ReceiptLogData,\n ReceiptMessageOut,\n ReceiptMint,\n ReceiptPanic,\n ReceiptReturn,\n ReceiptReturnData,\n ReceiptRevert,\n ReceiptScriptResult,\n ReceiptTransfer,\n ReceiptTransferOut,\n} from '@fuel-ts/transactions';\nimport { getMintedAssetId, InputMessageCoder, ReceiptType } from '@fuel-ts/transactions';\nimport { FAILED_TRANSFER_TO_ADDRESS_SIGNAL } from '@fuel-ts/transactions/configs';\nimport { arrayify, hexlify } from '@fuel-ts/utils';\n\nimport type { GqlReceiptFragment } from '../__generated__/operations';\nimport { GqlReceiptType } from '../__generated__/operations';\nimport type { TransactionResultReceipt } from '../transaction-response';\n\n/** @hidden */\nconst doesReceiptHaveMissingOutputVariables = (\n receipt: TransactionResultReceipt\n): receipt is ReceiptRevert =>\n receipt.type === ReceiptType.Revert &&\n receipt.val.toString('hex') === FAILED_TRANSFER_TO_ADDRESS_SIGNAL;\n\n/** @hidden */\nconst doesReceiptHaveMissingContractId = (\n receipt: TransactionResultReceipt\n): receipt is ReceiptPanic =>\n receipt.type === ReceiptType.Panic &&\n receipt.contractId !== '0x0000000000000000000000000000000000000000000000000000000000000000';\n\n/** @hidden */\nexport const getReceiptsWithMissingData = (receipts: Array<TransactionResultReceipt>) =>\n receipts.reduce<{\n missingOutputVariables: Array<ReceiptRevert>;\n missingOutputContractIds: Array<ReceiptPanic>;\n }>(\n (memo, receipt) => {\n if (doesReceiptHaveMissingOutputVariables(receipt)) {\n memo.missingOutputVariables.push(receipt);\n }\n if (doesReceiptHaveMissingContractId(receipt)) {\n memo.missingOutputContractIds.push(receipt);\n }\n return memo;\n },\n {\n missingOutputVariables: [],\n missingOutputContractIds: [],\n }\n );\n\nconst hexOrZero = (hex?: string | null) => hex || ZeroBytes32;\n\nexport function assembleReceiptByType(receipt: GqlReceiptFragment) {\n const { receiptType } = receipt;\n\n switch (receiptType) {\n case GqlReceiptType.Call: {\n const id = hexOrZero(receipt.id || receipt.contractId);\n const callReceipt: ReceiptCall = {\n type: ReceiptType.Call,\n id,\n to: hexOrZero(receipt?.to),\n amount: bn(receipt.amount),\n assetId: hexOrZero(receipt.assetId),\n gas: bn(receipt.gas),\n param1: bn(receipt.param1),\n param2: bn(receipt.param2),\n pc: bn(receipt.pc),\n is: bn(receipt.is),\n };\n\n return callReceipt;\n }\n\n case GqlReceiptType.Return: {\n const returnReceipt: ReceiptReturn = {\n type: ReceiptType.Return,\n id: hexOrZero(receipt.id || receipt.contractId),\n val: bn(receipt.val),\n pc: bn(receipt.pc),\n is: bn(receipt.is),\n };\n\n return returnReceipt;\n }\n\n case GqlReceiptType.ReturnData: {\n const returnDataReceipt: ReceiptReturnData = {\n type: ReceiptType.ReturnData,\n id: hexOrZero(receipt.id || receipt.contractId),\n ptr: bn(receipt.ptr),\n len: bn(receipt.len),\n digest: hexOrZero(receipt.digest),\n pc: bn(receipt.pc),\n data: hexOrZero(receipt.data),\n is: bn(receipt.is),\n };\n\n return returnDataReceipt;\n }\n\n case GqlReceiptType.Panic: {\n const panicReceipt: ReceiptPanic = {\n type: ReceiptType.Panic,\n id: hexOrZero(receipt.id),\n reason: bn(receipt.reason),\n pc: bn(receipt.pc),\n is: bn(receipt.is),\n contractId: hexOrZero(receipt.contractId),\n };\n\n return panicReceipt;\n }\n\n case GqlReceiptType.Revert: {\n const revertReceipt: ReceiptRevert = {\n type: ReceiptType.Revert,\n id: hexOrZero(receipt.id || receipt.contractId),\n val: bn(receipt.ra),\n pc: bn(receipt.pc),\n is: bn(receipt.is),\n };\n return revertReceipt;\n }\n\n case GqlReceiptType.Log: {\n const ra = bn(receipt.ra);\n const rb = bn(receipt.rb);\n const rc = bn(receipt.rc);\n const rd = bn(receipt.rd);\n\n const logReceipt: ReceiptLog = {\n type: ReceiptType.Log,\n id: hexOrZero(receipt.id || receipt.contractId),\n ra,\n rb,\n rc,\n rd,\n pc: bn(receipt.pc),\n is: bn(receipt.is),\n };\n\n return logReceipt;\n }\n\n case GqlReceiptType.LogData: {\n const ra = bn(receipt.ra);\n const rb = bn(receipt.rb);\n const logDataReceipt: ReceiptLogData = {\n type: ReceiptType.LogData,\n id: hexOrZero(receipt.id || receipt.contractId),\n ra,\n rb,\n ptr: bn(receipt.ptr),\n len: bn(receipt.len),\n digest: hexOrZero(receipt.digest),\n pc: bn(receipt.pc),\n data: hexOrZero(receipt.data),\n is: bn(receipt.is),\n };\n return logDataReceipt;\n }\n\n case GqlReceiptType.Transfer: {\n const id = hexOrZero(receipt.id || receipt.contractId);\n const transferReceipt: ReceiptTransfer = {\n type: ReceiptType.Transfer,\n id,\n to: hexOrZero(receipt.toAddress || receipt?.to),\n amount: bn(receipt.amount),\n assetId: hexOrZero(receipt.assetId),\n pc: bn(receipt.pc),\n is: bn(receipt.is),\n };\n\n return transferReceipt;\n }\n\n case GqlReceiptType.TransferOut: {\n const id = hexOrZero(receipt.id || receipt.contractId);\n const transferOutReceipt: ReceiptTransferOut = {\n type: ReceiptType.TransferOut,\n id,\n to: hexOrZero(receipt.toAddress || receipt.to),\n amount: bn(receipt.amount),\n assetId: hexOrZero(receipt.assetId),\n pc: bn(receipt.pc),\n is: bn(receipt.is),\n };\n return transferOutReceipt;\n }\n\n case GqlReceiptType.ScriptResult: {\n const scriptResultReceipt: ReceiptScriptResult = {\n type: ReceiptType.ScriptResult,\n result: bn(receipt.result),\n gasUsed: bn(receipt.gasUsed),\n };\n\n return scriptResultReceipt;\n }\n\n case GqlReceiptType.MessageOut: {\n const sender = hexOrZero(receipt.sender);\n const recipient = hexOrZero(receipt.recipient);\n const nonce = hexOrZero(receipt.nonce);\n const amount = bn(receipt.amount);\n const data = receipt.data ? arrayify(receipt.data) : Uint8Array.from([]);\n const digest = hexOrZero(receipt.digest);\n const len = bn(receipt.len).toNumber();\n\n const messageId = InputMessageCoder.getMessageId({\n sender,\n recipient,\n nonce,\n amount,\n data: hexlify(data),\n });\n\n const receiptMessageOut: ReceiptMessageOut = {\n type: ReceiptType.MessageOut,\n sender,\n recipient,\n amount,\n nonce,\n len,\n data,\n digest,\n messageId,\n };\n\n return receiptMessageOut;\n }\n\n case GqlReceiptType.Mint: {\n const contractId = hexOrZero(receipt.id || receipt.contractId);\n const subId = hexOrZero(receipt.subId);\n const assetId = getMintedAssetId(contractId, subId);\n\n const mintReceipt: ReceiptMint = {\n type: ReceiptType.Mint,\n subId,\n contractId,\n assetId,\n val: bn(receipt.val),\n pc: bn(receipt.pc),\n is: bn(receipt.is),\n };\n\n return mintReceipt;\n }\n\n case GqlReceiptType.Burn: {\n const contractId = hexOrZero(receipt.id || receipt.contractId);\n const subId = hexOrZero(receipt.subId);\n const assetId = getMintedAssetId(contractId, subId);\n\n const burnReceipt: ReceiptBurn = {\n type: ReceiptType.Burn,\n subId,\n contractId,\n assetId,\n val: bn(receipt.val),\n pc: bn(receipt.pc),\n is: bn(receipt.is),\n };\n\n return burnReceipt;\n }\n\n default:\n throw new FuelError(ErrorCode.INVALID_RECEIPT_TYPE, `Invalid receipt type: ${receiptType}.`);\n }\n}\n","import { ErrorCode, FuelError } from '@fuel-ts/errors';\n\nconst DEFAULT_BLOCK_EXPLORER_URL = 'https://app.fuel.network';\n\n/** @hidden */\nconst getPathFromInput = (\n key: BuildBlockExplorerUrlHelperParam,\n value: string | number | undefined\n) => {\n const pathMap = {\n address: `address`,\n txId: `transaction`,\n blockNumber: `block`,\n };\n const path = pathMap[key] || key;\n return `${path}/${value}`;\n};\n\ntype BuildBlockExplorerUrlHelperParam = 'address' | 'txId' | 'blockNumber';\n\n/**\n * @hidden\n *\n * Builds a block explorer url based on and the given path, block explorer URL and provider URL\n */\nexport const buildBlockExplorerUrl = (\n options: {\n blockExplorerUrl?: string;\n path?: string;\n providerUrl?: string;\n address?: string;\n txId?: string;\n blockNumber?: number;\n } = {}\n) => {\n const { blockExplorerUrl, path, providerUrl, address, txId, blockNumber } = options;\n const explorerUrl = blockExplorerUrl || DEFAULT_BLOCK_EXPLORER_URL;\n\n // make sure that only ONE or none of the following is defined: address, txId, blockNumber\n const customInputParams = [\n {\n key: 'address',\n value: address,\n },\n {\n key: 'txId',\n value: txId,\n },\n {\n key: 'blockNumber',\n value: blockNumber,\n },\n ];\n\n const definedValues = customInputParams\n .filter((param) => !!param.value)\n .map(({ key, value }) => ({\n key,\n value,\n }));\n\n const hasAnyDefinedValues = definedValues.length > 0;\n\n if (definedValues.length > 1) {\n throw new FuelError(\n ErrorCode.ERROR_BUILDING_BLOCK_EXPLORER_URL,\n `Only one of the following can be passed in to buildBlockExplorerUrl: ${customInputParams\n .map((param) => param.key)\n .join(', ')}.`\n );\n }\n\n if (path && definedValues.length > 0) {\n const inputKeys = customInputParams.map(({ key }) => key).join(', ');\n throw new FuelError(\n ErrorCode.ERROR_BUILDING_BLOCK_EXPLORER_URL,\n `You cannot pass in a path to 'buildBlockExplorerUrl' along with any of the following: ${inputKeys}.`\n );\n }\n\n const pathGeneratedFromInputParams = hasAnyDefinedValues\n ? getPathFromInput(\n definedValues[0].key as BuildBlockExplorerUrlHelperParam,\n definedValues[0].value\n )\n : '';\n\n // Remove leading and trailing slashes from the path and block explorer url respectively, if present\n const trimSlashes = /^\\/|\\/$/gm;\n const cleanPath = path ? path.replace(trimSlashes, '') : pathGeneratedFromInputParams;\n const cleanBlockExplorerUrl = explorerUrl.replace(trimSlashes, '');\n const cleanProviderUrl = providerUrl?.replace(trimSlashes, '');\n const encodedProviderUrl = cleanProviderUrl ? encodeURIComponent(cleanProviderUrl) : undefined;\n\n // if the block explorer url doesn't have a protocol i.e. http:// or https://, add https://\n const protocol = cleanBlockExplorerUrl.match(/^https?:\\/\\//) ? '' : 'https://';\n const providerUrlProtocol = cleanProviderUrl?.match(/^https?:\\/\\//) ? '' : 'https://';\n\n const url = `${protocol}${cleanBlockExplorerUrl}/${cleanPath}${\n encodedProviderUrl ? `?providerUrl=${providerUrlProtocol}${encodedProviderUrl}` : ''\n }`;\n\n return url;\n};\n","import { bn } from '@fuel-ts/math';\nimport type { BN, BNInput } from '@fuel-ts/math';\nimport { ReceiptType, type Input } from '@fuel-ts/transactions';\nimport { arrayify } from '@fuel-ts/utils';\n\nimport type {\n GqlDependentCost,\n GqlHeavyOperation,\n GqlLightOperation,\n} from '../__generated__/operations';\nimport type { GasCosts } from '../provider';\nimport type { TransactionRequestInput } from '../transaction-request';\nimport type {\n TransactionResultReceipt,\n TransactionResultScriptResultReceipt,\n} from '../transaction-response';\n\n/** @hidden */\nexport const getGasUsedFromReceipts = (receipts: Array<TransactionResultReceipt>): BN => {\n const scriptResult = receipts.filter(\n (receipt) => receipt.type === ReceiptType.ScriptResult\n ) as TransactionResultScriptResultReceipt[];\n\n const gasUsed = scriptResult.reduce((prev, receipt) => prev.add(receipt.gasUsed), bn(0));\n\n return gasUsed;\n};\n\nexport function resolveGasDependentCosts(byteSize: BNInput, gasDependentCost: GqlDependentCost) {\n const base = bn(gasDependentCost.base);\n let dependentValue = bn(0);\n if ('unitsPerGas' in gasDependentCost) {\n dependentValue = bn(byteSize).div(bn((<GqlLightOperation>gasDependentCost).unitsPerGas));\n } else {\n dependentValue = bn(byteSize).mul(bn((<GqlHeavyOperation>gasDependentCost).gasPerUnit));\n }\n return base.add(dependentValue);\n}\n\nexport function gasUsedByInputs(\n inputs: Array<TransactionRequestInput | Input>,\n txBytesSize: number,\n gasCosts: GasCosts\n) {\n const witnessCache: Array<number> = [];\n\n const chargeableInputs = inputs.filter((input) => {\n const isCoinOrMessage = 'owner' in input || 'sender' in input;\n if (isCoinOrMessage) {\n if ('predicate' in input && input.predicate && input.predicate !== '0x') {\n return true;\n }\n\n if (!witnessCache.includes(input.witnessIndex)) {\n // should charge only once for each witness\n witnessCache.push(input.witnessIndex);\n return true;\n }\n }\n return false;\n });\n\n const vmInitializationCost = resolveGasDependentCosts(txBytesSize, gasCosts.vmInitialization);\n\n const totalGas = chargeableInputs.reduce((total, input) => {\n if ('predicate' in input && input.predicate && input.predicate !== '0x') {\n return total.add(\n vmInitializationCost\n .add(resolveGasDependentCosts(arrayify(input.predicate).length, gasCosts.contractRoot))\n .add(bn(input.predicateGasUsed))\n );\n }\n\n return total.add(gasCosts.ecr1);\n }, bn(0));\n // Never allow gas to exceed MAX_U64\n return totalGas;\n}\n\nexport interface IGetMinGasParams {\n inputs: Array<TransactionRequestInput | Input>;\n gasCosts: GasCosts;\n txBytesSize: number;\n metadataGas: BN;\n gasPerByte: BN;\n}\n\nexport function getMinGas(params: IGetMinGasParams) {\n const { gasCosts, gasPerByte, inputs, metadataGas, txBytesSize } = params;\n\n const vmInitGas = resolveGasDependentCosts(txBytesSize, gasCosts.vmInitialization);\n const bytesGas = bn(txBytesSize).mul(gasPerByte);\n const inputsGas = gasUsedByInputs(inputs, txBytesSize, gasCosts);\n\n const minGas = vmInitGas.add(bytesGas).add(inputsGas).add(metadataGas).maxU64();\n\n return minGas;\n}\n\nexport interface IGetMaxGasParams {\n witnessesLength: number;\n witnessLimit?: BN;\n gasPerByte: BN;\n minGas: BN;\n gasLimit?: BN;\n blobSize?: BN;\n maxGasPerTx: BN;\n}\n\nexport function getMaxGas(params: IGetMaxGasParams) {\n const {\n gasPerByte,\n witnessesLength,\n witnessLimit,\n minGas,\n gasLimit = bn(0),\n maxGasPerTx,\n } = params;\n\n let remainingAllowedWitnessGas = bn(0);\n\n if (witnessLimit?.gt(0) && witnessLimit.gte(witnessesLength)) {\n remainingAllowedWitnessGas = bn(witnessLimit).sub(witnessesLength).mul(gasPerByte);\n }\n\n const maxGas = remainingAllowedWitnessGas.add(minGas).add(gasLimit);\n\n return maxGas.gte(maxGasPerTx) ? maxGasPerTx : maxGas;\n}\n\nexport function calculateMetadataGasForTxCreate({\n gasCosts,\n stateRootSize,\n txBytesSize,\n contractBytesSize,\n}: {\n gasCosts: GasCosts;\n contractBytesSize: BN;\n stateRootSize: number;\n txBytesSize: number;\n}) {\n const contractRootGas = resolveGasDependentCosts(contractBytesSize, gasCosts.contractRoot);\n const stateRootGas = resolveGasDependentCosts(stateRootSize, gasCosts.stateRoot);\n const txIdGas = resolveGasDependentCosts(txBytesSize, gasCosts.s256);\n // See https://github.com/FuelLabs/fuel-specs/blob/master/src/identifiers/contract-id.md\n const contractIdInputSize = bn(4 + 32 + 32 + 32);\n const contractIdGas = resolveGasDependentCosts(contractIdInputSize, gasCosts.s256);\n const metadataGas = contractRootGas.add(stateRootGas).add(txIdGas).add(contractIdGas);\n return metadataGas.maxU64();\n}\n\nexport function calculateMetadataGasForTxScript({\n gasCosts,\n txBytesSize,\n}: {\n gasCosts: GasCosts;\n txBytesSize: number;\n}) {\n return resolveGasDependentCosts(txBytesSize, gasCosts.s256);\n}\n\nexport function calculateMetadataGasForTxBlob({\n gasCosts,\n txBytesSize,\n witnessBytesSize,\n}: {\n gasCosts: GasCosts;\n txBytesSize: number;\n witnessBytesSize: number;\n}) {\n const txId = resolveGasDependentCosts(txBytesSize, gasCosts.s256);\n const blobLen = resolveGasDependentCosts(witnessBytesSize, gasCosts.s256);\n return txId.add(blobLen);\n}\n\nexport function calculateMetadataGasForTxUpgrade({\n gasCosts,\n txBytesSize,\n consensusSize,\n}: {\n gasCosts: GasCosts;\n txBytesSize: number;\n consensusSize?: number;\n}) {\n const txId = resolveGasDependentCosts(txBytesSize, gasCosts.s256);\n\n if (consensusSize) {\n const consensusLen = resolveGasDependentCosts(consensusSize, gasCosts.s256);\n txId.add(consensusLen);\n }\n\n return txId;\n}\n\nexport function calculateMetadataGasForTxUpload({\n gasCosts,\n txBytesSize,\n subsectionSize,\n subsectionsSize,\n}: {\n gasCosts: GasCosts;\n txBytesSize: number;\n subsectionSize: number;\n subsectionsSize: number;\n}) {\n const txId = resolveGasDependentCosts(txBytesSize, gasCosts.s256);\n\n const subsectionLen = resolveGasDependentCosts(subsectionSize, gasCosts.s256);\n txId.add(subsectionLen);\n\n const subsectionsLen = resolveGasDependentCosts(subsectionsSize, gasCosts.stateRoot);\n txId.add(subsectionsLen);\n\n return txId;\n}\n\nexport function calculateMinGasForTxUpload({\n gasCosts,\n baseMinGas,\n subsectionSize,\n}: {\n gasCosts: GasCosts;\n baseMinGas: number;\n subsectionSize: number;\n}) {\n // Since the `Upload` transaction occupies much of the storage, we want to\n // discourage people from using it too much. For that, we charge additional gas\n // for the storage.\n // https://github.com/FuelLabs/fuel-vm/blob/6e137db6387bd291b9505d17e15e0f2edda7957e/fuel-tx/src/transaction/types/upload.rs#L135-L150\n const additionalStoragePerByte = bn(gasCosts.newStoragePerByte).mul(subsectionSize);\n return bn(baseMinGas).add(additionalStoragePerByte);\n}\n\nexport interface CalculateGasFeeParams {\n tip?: BN;\n gas: BN;\n gasPrice: BN;\n priceFactor: BN;\n}\n\nexport const calculateGasFee = (params: CalculateGasFeeParams) => {\n const { gas, gasPrice, priceFactor, tip } = params;\n return gas.mul(gasPrice).div(priceFactor).add(bn(tip));\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable no-param-reassign */\nimport { hexlify } from '@fuel-ts/utils';\nimport { clone } from 'ramda';\n\n// When parsing a Transaction to JSON we need\n// to convert special types into each respective\n// JSON friendly value. This enables a tx to be\n// stringified and parsed back into a Transaction\n/** @hidden */\nfunction normalize(object: any) {\n Object.keys(object).forEach((key) => {\n switch (object[key]?.constructor.name) {\n case 'Uint8Array':\n object[key] = hexlify(object[key]);\n break;\n case 'Array':\n object[key] = normalize(object[key]);\n break;\n case 'BN':\n object[key] = object[key].toHex();\n break;\n case 'Address':\n object[key] = object[key].toB256();\n break;\n case 'Object':\n object[key] = normalize(object[key]);\n break;\n default:\n break;\n }\n });\n return object;\n}\n\n/**\n * Stringify Transaction to a JSON object\n * compatible with the Transaction class constructor.\n */\n/** @hidden */\nexport function normalizeJSON(root: any) {\n // Do a single deep clone before normalizing\n // to avoid mutating the original object\n // and doing extra clones on each iteration\n return normalize(clone(root));\n}\n","import { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { bn } from '@fuel-ts/math';\nimport type { ReceiptRevert } from '@fuel-ts/transactions';\nimport { ReceiptType } from '@fuel-ts/transactions';\nimport {\n FAILED_REQUIRE_SIGNAL,\n FAILED_ASSERT_EQ_SIGNAL,\n FAILED_ASSERT_NE_SIGNAL,\n FAILED_ASSERT_SIGNAL,\n FAILED_TRANSFER_TO_ADDRESS_SIGNAL,\n PANIC_REASONS,\n PANIC_DOC_URL,\n} from '@fuel-ts/transactions/configs';\n\nimport type { TransactionResultReceipt } from '../transaction-response';\n\n/**\n * Assembles an error message for a panic status.\n * @param status - The transaction failure status.\n * @returns The error message.\n */\nexport const assemblePanicError = (\n statusReason: string,\n metadata: Record<string, unknown>\n): FuelError => {\n let errorMessage = `The transaction reverted with reason: \"${statusReason}\".`;\n\n if (PANIC_REASONS.includes(statusReason)) {\n errorMessage = `${errorMessage}\\n\\nYou can read more about this error at:\\n\\n${PANIC_DOC_URL}#variant.${statusReason}`;\n }\n\n return new FuelError(ErrorCode.SCRIPT_REVERTED, errorMessage, {\n ...metadata,\n reason: statusReason,\n });\n};\n\n/** @hidden */\nconst stringify = (obj: unknown) => JSON.stringify(obj, null, 2);\n\n/**\n * Assembles an error message for a revert status.\n * @param receipts - The transaction result processed receipts.\n * @param logs - The transaction decoded logs.\n * @returns The error message.\n */\nexport const assembleRevertError = (\n receipts: Array<TransactionResultReceipt>,\n logs: Array<unknown>,\n metadata: Record<string, unknown>\n): FuelError => {\n let errorMessage = 'The transaction reverted with an unknown reason.';\n\n const revertReceipt = receipts.find(({ type }) => type === ReceiptType.Revert) as ReceiptRevert;\n let reason = '';\n\n if (revertReceipt) {\n const reasonHex = bn(revertReceipt.val).toHex();\n const lastLog = logs[logs.length - 1];\n const lastButOneLog = logs[logs.length - 2];\n\n switch (reasonHex) {\n case FAILED_REQUIRE_SIGNAL: {\n reason = 'require';\n errorMessage = `The transaction reverted because a \"require\" statement has thrown ${\n logs.length ? stringify(lastLog) : 'an error.'\n }.`;\n break;\n }\n\n case FAILED_ASSERT_EQ_SIGNAL: {\n const sufix =\n logs.length >= 2\n ? ` comparing ${stringify(lastLog)} and ${stringify(lastButOneLog)}.`\n : '.';\n\n reason = 'assert_eq';\n errorMessage = `The transaction reverted because of an \"assert_eq\" statement${sufix}`;\n break;\n }\n\n case FAILED_ASSERT_NE_SIGNAL: {\n const sufix =\n logs.length >= 2\n ? ` comparing ${stringify(lastButOneLog)} and ${stringify(lastLog)}.`\n : '.';\n\n reason = 'assert_ne';\n errorMessage = `The transaction reverted because of an \"assert_ne\" statement${sufix}`;\n break;\n }\n\n case FAILED_ASSERT_SIGNAL:\n reason = 'assert';\n errorMessage = `The transaction reverted because an \"assert\" statement failed to evaluate to true.`;\n break;\n\n case FAILED_TRANSFER_TO_ADDRESS_SIGNAL:\n reason = 'MissingOutputChange';\n errorMessage = `The transaction reverted because it's missing an \"OutputChange\".`;\n break;\n\n default:\n throw new FuelError(\n ErrorCode.UNKNOWN,\n `The transaction reverted with an unknown reason: ${revertReceipt.val}`,\n {\n ...metadata,\n reason: 'unknown',\n }\n );\n }\n }\n\n return new FuelError(ErrorCode.SCRIPT_REVERTED, errorMessage, {\n ...metadata,\n reason,\n });\n};\n\ninterface IExtractTxError {\n receipts: Array<TransactionResultReceipt>;\n logs: Array<unknown>;\n statusReason: string;\n}\n\n/**\n * Extracts the transaction error and returns a FuelError object.\n * @param IExtractTxError - The parameters for extracting the error.\n * @returns The FuelError object.\n */\nexport const extractTxError = (params: IExtractTxError): FuelError => {\n const { receipts, statusReason, logs } = params;\n\n const isPanic = receipts.some(({ type }) => type === ReceiptType.Panic);\n const isRevert = receipts.some(({ type }) => type === ReceiptType.Revert);\n const metadata = {\n logs,\n receipts,\n panic: isPanic,\n revert: isRevert,\n reason: '',\n };\n\n if (isPanic) {\n return assemblePanicError(statusReason, metadata);\n }\n return assembleRevertError(receipts, logs, metadata);\n};\n","/* eslint-disable max-classes-per-file */\nimport type { Address } from '@fuel-ts/address';\n\n/**\n * @hidden\n */\nexport class ChangeOutputCollisionError extends Error {\n override name = 'ChangeOutputCollisionError';\n override message =\n 'A ChangeOutput with the same \"assetId\" already exists for a different \"to\" address';\n}\n\n/**\n * @hidden\n */\nexport class NoWitnessAtIndexError extends Error {\n override name = 'NoWitnessAtIndexError';\n constructor(public readonly index: number) {\n super();\n this.message = `Witness at index \"${index}\" was not found`;\n }\n}\n\n/**\n * @hidden\n */\nexport class NoWitnessByOwnerError extends Error {\n override name = 'NoWitnessByOwnerError';\n constructor(public readonly owner: Address) {\n super();\n this.message = `A witness for the given owner \"${owner}\" was not found`;\n }\n}\n","import type { Address } from '@fuel-ts/address';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { bn } from '@fuel-ts/math';\nimport { InputType, OutputType } from '@fuel-ts/transactions';\n\nimport type { ExcludeResourcesOption } from '../resource';\n\nimport type {\n TransactionRequestInput,\n CoinTransactionRequestInput,\n MessageTransactionRequestInput,\n} from './input';\nimport type { TransactionRequest } from './types';\n\nexport const isRequestInputCoin = (\n input: TransactionRequestInput\n): input is CoinTransactionRequestInput => input.type === InputType.Coin;\n\nexport const isRequestInputMessage = (\n input: TransactionRequestInput\n): input is MessageTransactionRequestInput => input.type === InputType.Message;\n\nexport const isRequestInputMessageWithoutData = (\n input: TransactionRequestInput\n): input is MessageTransactionRequestInput =>\n input.type === InputType.Message && bn(input.data).isZero();\n\nexport const isRequestInputCoinOrMessage = (\n input: TransactionRequestInput\n): input is CoinTransactionRequestInput | MessageTransactionRequestInput =>\n isRequestInputCoin(input) || isRequestInputMessage(input);\n\nexport const isRequestInputResource = (\n input: TransactionRequestInput\n): input is CoinTransactionRequestInput | MessageTransactionRequestInput =>\n isRequestInputCoin(input) || isRequestInputMessageWithoutData(input);\n\nexport const getRequestInputResourceOwner = (\n input: CoinTransactionRequestInput | MessageTransactionRequestInput\n) => (isRequestInputCoin(input) ? input.owner : input.recipient);\n\nexport const isRequestInputResourceFromOwner = (\n input: CoinTransactionRequestInput | MessageTransactionRequestInput,\n owner: Address\n) => getRequestInputResourceOwner(input) === owner.toB256();\n\nexport const getAssetAmountInRequestInputs = (\n inputs: TransactionRequestInput[],\n assetId: string,\n baseAsset: string\n) =>\n inputs.filter(isRequestInputResource).reduce((acc, input) => {\n if (isRequestInputCoin(input) && input.assetId === assetId) {\n return acc.add(input.amount);\n }\n\n if (isRequestInputMessage(input) && assetId === baseAsset) {\n return acc.add(input.amount);\n }\n\n return acc;\n }, bn(0));\n\nexport const cacheRequestInputsResources = (inputs: TransactionRequestInput[]) =>\n inputs.filter(isRequestInputResource).reduce(\n (cache, input) => {\n if (isRequestInputCoin(input)) {\n cache.utxos.push(input.id);\n } else {\n cache.messages.push(input.nonce);\n }\n return cache;\n },\n {\n utxos: [],\n messages: [],\n } as Required<ExcludeResourcesOption>\n );\n\nexport const cacheRequestInputsResourcesFromOwner = (\n inputs: TransactionRequestInput[],\n owner: Address\n): ExcludeResourcesOption =>\n inputs.reduce(\n (acc, input) => {\n if (isRequestInputCoin(input) && input.owner === owner.toB256()) {\n acc.utxos.push(input.id);\n } else if (isRequestInputMessage(input) && input.recipient === owner.toB256()) {\n acc.messages.push(input.nonce);\n }\n return acc;\n },\n {\n utxos: [],\n messages: [],\n } as Required<ExcludeResourcesOption>\n );\n\n/**\n * @hidden\n *\n * Get the number of burnable assets in the transaction request.\n *\n * @param baseAssetId - The base asset ID.\n * @param transactionRequest - The transaction request to get the burnable asset count from.\n * @returns The number of burnable assets in the transaction request.\n */\nexport const getBurnableAssetCount = (\n baseAssetId: string,\n transactionRequest: TransactionRequest\n) => {\n const { inputs, outputs } = transactionRequest;\n const coinInputs = new Set(inputs.filter(isRequestInputCoin).map((input) => input.assetId));\n // If there is a message input without data, we need to add the base asset to the set\n if (inputs.some((i) => isRequestInputMessage(i) && bn(i.amount).gt(0))) {\n coinInputs.add(baseAssetId);\n }\n const changeOutputs = new Set(\n outputs.filter((output) => output.type === OutputType.Change).map((output) => output.assetId)\n );\n const difference = new Set([...coinInputs].filter((x) => !changeOutputs.has(x)));\n return difference.size;\n};\n\n/**\n * @hidden\n *\n * Validates the transaction request for asset burn.\n *\n * @param transactionRequest - The transaction request to validate.\n * @param enableAssetBurn - Whether asset burn is enabled (default: false).\n *\n * @throws `FuelError` when an asset burn is detected and not enabled.\n */\nexport const validateTransactionForAssetBurn = (\n baseAssetId: string,\n transactionRequest: TransactionRequest,\n enableAssetBurn: boolean = false\n) => {\n // Asset burn is enabled\n if (enableAssetBurn === true) {\n return;\n }\n\n // No burnable assets detected\n if (getBurnableAssetCount(baseAssetId, transactionRequest) <= 0) {\n return;\n }\n\n const message = [\n 'Asset burn detected.',\n 'Add the relevant change outputs to the transaction to avoid burning assets.',\n 'Or enable asset burn, upon sending the transaction.',\n ].join('\\n');\n throw new FuelError(ErrorCode.ASSET_BURN_DETECTED, message);\n};\n","import type { Witness } from '@fuel-ts/transactions';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { arrayify, hexlify } from '@fuel-ts/utils';\n\nexport type TransactionRequestWitness = BytesLike;\n\nexport const witnessify = (value: TransactionRequestWitness): Witness => {\n const data = arrayify(value);\n\n return {\n data: hexlify(data),\n dataLength: data.length,\n };\n};\n","import type { BN } from '@fuel-ts/math';\nimport type { TransactionBlob } from '@fuel-ts/transactions';\nimport { clone } from 'ramda';\n\nimport type { GasCosts } from '../provider';\nimport { calculateMetadataGasForTxBlob } from '../utils';\n\nimport { hashTransaction } from './hash-transaction';\nimport type { BaseTransactionRequestLike } from './transaction-request';\nimport { BaseTransactionRequest, TransactionType } from './transaction-request';\n\nexport interface BlobTransactionRequestLike extends BaseTransactionRequestLike {\n /** Blob ID */\n blobId: string;\n /** Witness index of the bytecode to create */\n witnessIndex?: number;\n}\n\nexport class BlobTransactionRequest extends BaseTransactionRequest {\n static from(obj: BlobTransactionRequestLike) {\n return new this(clone(obj));\n }\n\n /** Type of the transaction */\n type = TransactionType.Blob as const;\n /** Blob ID */\n blobId: string;\n /** Witness index of the bytecode to create */\n witnessIndex: number;\n\n /**\n * Creates an instance `BlobTransactionRequest`.\n *\n * @param blobTransactionRequestLike - The initial values for the instance\n */\n constructor({ witnessIndex, blobId, ...rest }: BlobTransactionRequestLike) {\n super(rest);\n this.blobId = blobId;\n this.witnessIndex = witnessIndex ?? 0;\n }\n\n /**\n * Converts the transaction request to a `TransactionBlob`.\n *\n * @returns The transaction create object.\n */\n toTransaction(): TransactionBlob {\n const baseTransaction = this.getBaseTransaction();\n const { witnessIndex, blobId } = this;\n return {\n type: TransactionType.Blob,\n ...baseTransaction,\n blobId,\n witnessIndex,\n };\n }\n\n /**\n * Gets the Transaction Request by hashing the transaction.\n *\n * @param chainId - The chain ID.\n *\n * @returns - A hash of the transaction, which is the transaction ID.\n */\n getTransactionId(chainId: number): string {\n return hashTransaction(this, chainId);\n }\n\n /**\n * Calculates the metadata gas cost for a blob transaction.\n *\n * @param gasCosts - gas costs passed from the chain.\n * @returns metadata gas cost for the blob transaction.\n */\n override metadataGas(gasCosts: GasCosts): BN {\n return calculateMetadataGasForTxBlob({\n gasCosts,\n txBytesSize: this.byteSize(),\n witnessBytesSize: this.witnesses[this.witnessIndex].length,\n });\n }\n}\n","import { ZeroBytes32 } from '@fuel-ts/address/configs';\nimport { uint64ToBytesBE, sha256 } from '@fuel-ts/hasher';\nimport { bn } from '@fuel-ts/math';\nimport { TransactionType, InputType, OutputType, TransactionCoder } from '@fuel-ts/transactions';\nimport { concat } from '@fuel-ts/utils';\nimport { clone } from 'ramda';\n\nimport type { TransactionRequest } from './types';\n\n/**\n * Hash transaction request with sha256. [Read more](https://github.com/FuelLabs/fuel-specs/blob/master/specs/protocol/identifiers.md#transaction-id)\n *\n * @param transactionRequest - Transaction request to be hashed\n * @returns sha256 hash of the transaction\n */\nexport function hashTransaction(transactionRequest: TransactionRequest, chainId: number) {\n const transaction = transactionRequest.toTransaction();\n\n if (transaction.type === TransactionType.Script) {\n transaction.receiptsRoot = ZeroBytes32;\n }\n\n // Zero out input fields\n transaction.inputs = transaction.inputs.map((input) => {\n const inputClone = clone(input);\n\n switch (inputClone.type) {\n // Zero out on signing: txPointer, predicateGasUsed\n case InputType.Coin: {\n inputClone.txPointer = {\n blockHeight: 0,\n txIndex: 0,\n };\n inputClone.predicateGasUsed = bn(0);\n return inputClone;\n }\n // Zero out on signing: predicateGasUsed\n case InputType.Message: {\n inputClone.predicateGasUsed = bn(0);\n return inputClone;\n }\n // Zero out on signing: txID, outputIndex, balanceRoot, stateRoot, and txPointer\n case InputType.Contract: {\n inputClone.txPointer = {\n blockHeight: 0,\n txIndex: 0,\n };\n inputClone.txID = ZeroBytes32;\n inputClone.outputIndex = 0;\n inputClone.balanceRoot = ZeroBytes32;\n inputClone.stateRoot = ZeroBytes32;\n return inputClone;\n }\n default:\n return inputClone;\n }\n });\n // Zero out output fields\n transaction.outputs = transaction.outputs.map((output) => {\n const outputClone = clone(output);\n\n switch (outputClone.type) {\n // Zero out on signing: balanceRoot, stateRoot\n case OutputType.Contract: {\n outputClone.balanceRoot = ZeroBytes32;\n outputClone.stateRoot = ZeroBytes32;\n return outputClone;\n }\n // Zero out on signing: amount\n case OutputType.Change: {\n outputClone.amount = bn(0);\n return outputClone;\n }\n // Zero out on signing: amount, to and assetId\n case OutputType.Variable: {\n outputClone.to = ZeroBytes32;\n outputClone.amount = bn(0);\n outputClone.assetId = ZeroBytes32;\n return outputClone;\n }\n default:\n return outputClone;\n }\n });\n transaction.witnessesCount = 0;\n transaction.witnesses = [];\n\n const chainIdBytes = uint64ToBytesBE(chainId);\n const concatenatedData = concat([chainIdBytes, new TransactionCoder().encode(transaction)]);\n return sha256(concatenatedData);\n}\n","import { ZeroBytes32 } from '@fuel-ts/address/configs';\nimport { bn, type BN } from '@fuel-ts/math';\nimport type { TransactionCreate } from '@fuel-ts/transactions';\nimport { TransactionType, OutputType } from '@fuel-ts/transactions';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { arrayify, hexlify } from '@fuel-ts/utils';\nimport { clone } from 'ramda';\n\nimport type { GasCosts } from '../provider';\nimport { calculateMetadataGasForTxCreate } from '../utils/gas';\n\nimport { hashTransaction } from './hash-transaction';\nimport type { ContractCreatedTransactionRequestOutput } from './output';\nimport type { TransactionRequestStorageSlot } from './storage-slot';\nimport { storageSlotify } from './storage-slot';\nimport { BaseTransactionRequest } from './transaction-request';\nimport type { BaseTransactionRequestLike } from './transaction-request';\n\n/**\n * @hidden\n */\nexport interface CreateTransactionRequestLike extends BaseTransactionRequestLike {\n /** Witness index of contract bytecode to create */\n bytecodeWitnessIndex?: number;\n /** Salt */\n salt?: BytesLike;\n /** List of storage slots to initialize */\n storageSlots?: TransactionRequestStorageSlot[];\n}\n\n/**\n * `CreateTransactionRequest` provides functionalities for creating a transaction request that creates a contract.\n */\nexport class CreateTransactionRequest extends BaseTransactionRequest {\n static from(obj: CreateTransactionRequestLike) {\n return new this(clone(obj));\n }\n\n /** Type of the transaction */\n type = TransactionType.Create as const;\n /** Witness index of contract bytecode to create */\n bytecodeWitnessIndex: number;\n /** Salt */\n salt: string;\n /** List of storage slots to initialize */\n storageSlots: TransactionRequestStorageSlot[];\n\n /**\n * Creates an instance `CreateTransactionRequest`.\n *\n * @param createTransactionRequestLike - The initial values for the instance\n */\n constructor({ bytecodeWitnessIndex, salt, storageSlots, ...rest }: CreateTransactionRequestLike) {\n super(rest);\n this.bytecodeWitnessIndex = bytecodeWitnessIndex ?? 0;\n this.salt = hexlify(salt ?? ZeroBytes32);\n this.storageSlots = [...(storageSlots ?? [])];\n }\n\n /**\n * Converts the transaction request to a `TransactionCreate`.\n *\n * @returns The transaction create object.\n */\n toTransaction(): TransactionCreate {\n const baseTransaction = this.getBaseTransaction();\n const bytecodeWitnessIndex = this.bytecodeWitnessIndex;\n const storageSlots = this.storageSlots?.map(storageSlotify) ?? [];\n return {\n type: TransactionType.Create,\n ...baseTransaction,\n bytecodeWitnessIndex,\n storageSlotsCount: bn(storageSlots.length),\n salt: this.salt ? hexlify(this.salt) : ZeroBytes32,\n storageSlots,\n };\n }\n\n /**\n * Get contract created outputs for the transaction.\n *\n * @returns An array of contract created transaction request outputs.\n */\n getContractCreatedOutputs(): ContractCreatedTransactionRequestOutput[] {\n return this.outputs.filter(\n (output): output is ContractCreatedTransactionRequestOutput =>\n output.type === OutputType.ContractCreated\n );\n }\n\n /**\n * Gets the Transaction Request by hashing the transaction.\n *\n * @param chainId - The chain ID.\n *\n * @returns - A hash of the transaction, which is the transaction ID.\n */\n getTransactionId(chainId: number): string {\n return hashTransaction(this, chainId);\n }\n\n /**\n * Adds a contract created output to the transaction request.\n *\n * @param contractId - The contract ID.\n * @param stateRoot - The state root.\n */\n addContractCreatedOutput(\n /** Contract ID */\n contractId: BytesLike,\n /** State Root */\n stateRoot: BytesLike\n ) {\n this.pushOutput({\n type: OutputType.ContractCreated,\n contractId,\n stateRoot,\n });\n }\n\n override metadataGas(gasCosts: GasCosts): BN {\n return calculateMetadataGasForTxCreate({\n contractBytesSize: bn(arrayify(this.witnesses[this.bytecodeWitnessIndex] || '0x').length),\n gasCosts,\n stateRootSize: this.storageSlots.length,\n txBytesSize: this.byteSize(),\n });\n }\n}\n","import type { StorageSlot } from '@fuel-ts/transactions';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { arrayify, hexlify } from '@fuel-ts/utils';\n\nexport type TransactionRequestStorageSlot =\n | {\n /** Key */\n key: BytesLike;\n /** Value */\n value: BytesLike;\n }\n | [key: BytesLike, value: BytesLike];\n\n// Make sure all values have 32 bytes\nconst getStorageValue = (value: BytesLike): Uint8Array => {\n const v = new Uint8Array(32);\n v.set(arrayify(value));\n return v;\n};\n\nexport const storageSlotify = (storageSlot: TransactionRequestStorageSlot): StorageSlot => {\n let key;\n let value;\n\n if (Array.isArray(storageSlot)) {\n key = storageSlot[0];\n value = storageSlot[1];\n } else {\n key = storageSlot.key;\n value = storageSlot.value;\n }\n\n return {\n key: hexlify(key),\n value: hexlify(getStorageValue(value)),\n };\n};\n","import type { InputValue, JsonAbi } from '@fuel-ts/abi-coder';\nimport { Interface } from '@fuel-ts/abi-coder';\nimport { addressify } from '@fuel-ts/address';\nimport type { ContractIdLike } from '@fuel-ts/address';\nimport { ZeroBytes32 } from '@fuel-ts/address/configs';\nimport { bn } from '@fuel-ts/math';\nimport type { BN, BigNumberish } from '@fuel-ts/math';\nimport type { TransactionScript } from '@fuel-ts/transactions';\nimport { InputType, OutputType, TransactionType } from '@fuel-ts/transactions';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { arrayify, hexlify } from '@fuel-ts/utils';\nimport { clone } from 'ramda';\n\nimport type { Account } from '../../account';\nimport type { ChainInfo, GasCosts, TransactionCostParams } from '../provider';\nimport { calculateMetadataGasForTxScript, getMaxGas } from '../utils/gas';\n\nimport { hashTransaction } from './hash-transaction';\nimport type { ContractTransactionRequestInput } from './input';\nimport type { ContractTransactionRequestOutput, VariableTransactionRequestOutput } from './output';\nimport { returnZeroScript } from './scripts';\nimport type { BaseTransactionRequestLike } from './transaction-request';\nimport { BaseTransactionRequest } from './transaction-request';\nimport type { AbstractScriptRequest, JsonAbisFromAllCalls } from './types';\n\n/**\n * @hidden\n */\nexport interface ScriptTransactionRequestLike extends BaseTransactionRequestLike {\n /** Gas limit for transaction */\n gasLimit?: BigNumberish;\n /** Script to execute */\n script?: BytesLike;\n /** Script input data (parameters) */\n scriptData?: BytesLike;\n\n abis?: JsonAbisFromAllCalls;\n}\n\n/**\n * `ScriptTransactionRequest` provides functionalities for creating a transaction request that uses a script.\n */\nexport class ScriptTransactionRequest extends BaseTransactionRequest {\n static from(obj: ScriptTransactionRequestLike) {\n return new this(clone(obj));\n }\n\n /** Type of the transaction */\n type = TransactionType.Script as const;\n /** Gas limit for transaction */\n gasLimit: BN;\n /** Script to execute */\n script: Uint8Array;\n /** Script input data (parameters) */\n scriptData: Uint8Array;\n\n abis?: JsonAbisFromAllCalls;\n\n /**\n * Constructor for `ScriptTransactionRequest`.\n *\n * @param scriptTransactionRequestLike - The initial values for the instance.\n */\n constructor({ script, scriptData, gasLimit, ...rest }: ScriptTransactionRequestLike = {}) {\n super(rest);\n this.gasLimit = bn(gasLimit);\n this.script = arrayify(script ?? returnZeroScript.bytes);\n this.scriptData = arrayify(scriptData ?? returnZeroScript.encodeScriptData());\n this.abis = rest.abis;\n }\n\n /**\n * Helper function to estimate and fund the transaction request with a specified account.\n *\n * @param account - The account to fund the transaction.\n * @param params - The parameters for the transaction cost.\n * @returns The current instance of the `ScriptTransactionRequest` funded.\n */\n async estimateAndFund(\n account: Account,\n { signatureCallback, quantities = [] }: TransactionCostParams = {}\n ): Promise<ScriptTransactionRequest> {\n const txCost = await account.getTransactionCost(this, { signatureCallback, quantities });\n\n this.maxFee = txCost.maxFee;\n this.gasLimit = txCost.gasUsed;\n\n await account.fund(this, txCost);\n\n return this;\n }\n\n /**\n * Converts the transaction request to a `TransactionScript`.\n *\n * @returns The transaction script object.\n */\n toTransaction(): TransactionScript {\n const script = arrayify(this.script ?? '0x');\n const scriptData = arrayify(this.scriptData ?? '0x');\n return {\n type: TransactionType.Script,\n scriptGasLimit: this.gasLimit,\n ...super.getBaseTransaction(),\n scriptLength: bn(script.length),\n scriptDataLength: bn(scriptData.length),\n receiptsRoot: ZeroBytes32,\n script: hexlify(script),\n scriptData: hexlify(scriptData),\n };\n }\n\n /**\n * Get contract inputs for the transaction.\n *\n * @returns An array of contract transaction request inputs.\n */\n getContractInputs(): ContractTransactionRequestInput[] {\n return this.inputs.filter(\n (input): input is ContractTransactionRequestInput => input.type === InputType.Contract\n );\n }\n\n /**\n * Get contract outputs for the transaction.\n *\n * @returns An array of contract transaction request outputs.\n */\n getContractOutputs(): ContractTransactionRequestOutput[] {\n return this.outputs.filter(\n (output): output is ContractTransactionRequestOutput => output.type === OutputType.Contract\n );\n }\n\n /**\n * Get variable outputs for the transaction.\n *\n * @returns An array of variable transaction request outputs.\n */\n getVariableOutputs(): VariableTransactionRequestOutput[] {\n return this.outputs.filter(\n (output): output is VariableTransactionRequestOutput => output.type === OutputType.Variable\n );\n }\n\n /**\n * Set the script and its data.\n *\n * @param script - The abstract script request.\n * @param data - The script data.\n */\n setScript<T>(script: AbstractScriptRequest<T>, data: T) {\n this.scriptData = script.encodeScriptData(data);\n this.script = script.bytes;\n }\n\n /**\n * Adds variable outputs to the transaction request.\n *\n * @param numberOfVariables - The number of variables to add.\n * @returns The new length of the outputs array.\n */\n addVariableOutputs(numberOfVariables: number = 1) {\n let outputsNumber = numberOfVariables;\n\n while (outputsNumber) {\n this.pushOutput({\n type: OutputType.Variable,\n });\n outputsNumber -= 1;\n }\n\n return this.outputs.length - 1;\n }\n\n /**\n * Calculates the maximum gas for the transaction.\n *\n * @param chainInfo - The chain information.\n * @param minGas - The minimum gas.\n * @returns the maximum gas.\n */\n override calculateMaxGas(chainInfo: ChainInfo, minGas: BN): BN {\n const { consensusParameters } = chainInfo;\n const {\n feeParameters: { gasPerByte },\n txParameters: { maxGasPerTx },\n } = consensusParameters;\n\n const witnessesLength = this.toTransaction().witnesses.reduce(\n (acc, wit) => acc + wit.dataLength,\n 0\n );\n\n return getMaxGas({\n gasPerByte,\n minGas,\n witnessesLength,\n witnessLimit: this.witnessLimit,\n gasLimit: this.gasLimit,\n maxGasPerTx,\n });\n }\n\n /**\n * Adds a contract input and output to the transaction request.\n *\n * @param contract - The contract ID.\n * @returns The current instance of the `ScriptTransactionRequest`.\n */\n addContractInputAndOutput(contract: ContractIdLike): ScriptTransactionRequest {\n const contractAddress = addressify(contract);\n\n // Add only one input contract per contractId\n if (this.getContractInputs().find((i) => i.contractId === contractAddress.toB256())) {\n return this;\n }\n\n const inputIndex = super.pushInput({\n type: InputType.Contract,\n contractId: contractAddress.toB256(),\n txPointer: '0x00000000000000000000000000000000',\n });\n\n this.pushOutput({\n type: OutputType.Contract,\n inputIndex,\n });\n\n return this;\n }\n\n /**\n * Gets the Transaction Request by hashing the transaction.\n *\n * @param chainId - The chain ID.\n *\n * @returns - A hash of the transaction, which is the transaction ID.\n */\n getTransactionId(chainId: number): string {\n return hashTransaction(this, chainId);\n }\n\n /**\n * Sets the data for the transaction request.\n *\n * @param abi - Script JSON ABI.\n * @param args - The input arguments.\n * @returns The current instance of the `ScriptTransactionRequest`.\n */\n setData(abi: JsonAbi, args: InputValue[]): ScriptTransactionRequest {\n const abiInterface = new Interface(abi);\n this.scriptData = abiInterface.functions.main.encodeArguments(args);\n return this;\n }\n\n override metadataGas(gasCosts: GasCosts): BN {\n return calculateMetadataGasForTxScript({\n gasCosts,\n txBytesSize: this.byteSize(),\n });\n }\n}\n","import { arrayify } from '@fuel-ts/utils';\n\nimport type { AbstractScriptRequest } from './types';\n\n// We can't import this from `@fuel-ts/script` because it causes\n// cyclic dependency errors so we duplicate it here.\n/** @hidden */\nexport const returnZeroScript: AbstractScriptRequest<void> = {\n /*\n Opcode::RET(REG_ZERO)\n Opcode::NOOP\n */\n // TODO: Don't use hardcoded scripts: https://github.com/FuelLabs/fuels-ts/issues/281\n bytes: arrayify('0x24000000'),\n encodeScriptData: () => new Uint8Array(0),\n};\n\n/** @hidden */\nexport const withdrawScript: AbstractScriptRequest<void> = {\n /*\n The following code loads some basic values into registers and calls SMO to create an output message\n 5040C010 \t- ADDI r16 $is i16 [r16 now points to memory 16 bytes from the start of this program (start of receiver data)]\n 5D44C006\t- LW r17 $is i6 [r17 set to the 6th word in this program (6*8=48 bytes from the start of this program)]\n 4C400011\t- SMO r16 r0 r0 r17 [send message out to address starting at memory position r16 with amount in r17]\n 24000000\t- RET [return 0]\n 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [recipient address]\n 00000000 00000000 [amount value]\n */\n // TODO: Don't use hardcoded scripts: https://github.com/FuelLabs/fuels-ts/issues/281\n bytes: arrayify('0x5040C0105D44C0064C40001124000000'),\n encodeScriptData: () => new Uint8Array(0),\n};\n","import { FuelError } from '@fuel-ts/errors';\nimport { hash } from '@fuel-ts/hasher';\nimport type { BN } from '@fuel-ts/math';\nimport {\n TransactionType,\n type TransactionUpgrade,\n type UpgradePurpose,\n UpgradePurposeTypeEnum,\n} from '@fuel-ts/transactions';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { hexlify } from '@fuel-ts/utils';\nimport { clone } from 'ramda';\n\nimport type { GasCosts } from '../provider';\nimport { calculateMetadataGasForTxUpgrade } from '../utils';\n\nimport { hashTransaction } from './hash-transaction';\nimport { BaseTransactionRequest, type BaseTransactionRequestLike } from './transaction-request';\n\n/**\n * @hidden\n */\nexport type UpgradePurposeRequest =\n | {\n type: UpgradePurposeTypeEnum.ConsensusParameters;\n checksum: string;\n }\n | {\n type: UpgradePurposeTypeEnum.StateTransition;\n data: BytesLike;\n };\n\n/**\n * @hidden\n */\nexport interface UpgradeTransactionRequestLike extends BaseTransactionRequestLike {\n /** The upgrade purpose */\n upgradePurpose?: UpgradePurposeRequest;\n\n /** Witness index */\n bytecodeWitnessIndex?: number;\n}\n\nexport class UpgradeTransactionRequest extends BaseTransactionRequest {\n static from(obj: UpgradeTransactionRequestLike) {\n if (obj instanceof UpgradeTransactionRequest) {\n return obj;\n }\n return new this(clone(obj));\n }\n\n /** The type of transaction */\n type = TransactionType.Upgrade as const;\n /** The upgrade purpose */\n upgradePurpose: UpgradePurposeRequest;\n /** Witness index of consensus */\n bytecodeWitnessIndex: number;\n\n /**\n * Creates an instance `UpgradeTransactionRequest`.\n *\n * @param upgradeTransactionRequestLike - The initial values for the instance\n */\n constructor({\n upgradePurpose,\n bytecodeWitnessIndex,\n ...rest\n }: UpgradeTransactionRequestLike = {}) {\n super(rest);\n this.bytecodeWitnessIndex = bytecodeWitnessIndex ?? 0;\n this.upgradePurpose = upgradePurpose ?? {\n type: UpgradePurposeTypeEnum.ConsensusParameters,\n checksum: '0x',\n };\n }\n\n /**\n * Adds a consensus parameters upgrade purpose.\n *\n * @param consensus - The consensus bytecode.\n *\n * @returns - The current instance of `UpgradeTransactionRequest`.\n */\n addConsensusParametersUpgradePurpose(consensus: BytesLike) {\n this.bytecodeWitnessIndex = this.addWitness(consensus);\n this.upgradePurpose = {\n type: UpgradePurposeTypeEnum.ConsensusParameters,\n checksum: hash(consensus),\n };\n return this;\n }\n\n /**\n * Adds a state transition upgrade purpose.\n *\n * @param bytecodeRoot - The Merkle root of the state transition.\n *\n * @returns - The current instance of `UpgradeTransactionRequest`.\n */\n addStateTransitionUpgradePurpose(bytecodeRoot: BytesLike) {\n this.upgradePurpose = {\n type: UpgradePurposeTypeEnum.StateTransition,\n data: hexlify(bytecodeRoot),\n };\n return this;\n }\n\n /**\n * Adds an upgrade purpose.\n *\n * @param type - The upgrade purpose type.\n * @param data - The bytecode or merkle root of upgrade purpose\n *\n * @returns - The current instance of `UpgradeTransactionRequest`.\n */\n addUpgradePurpose(type: UpgradePurposeTypeEnum, data: BytesLike) {\n if (type === UpgradePurposeTypeEnum.ConsensusParameters) {\n this.addConsensusParametersUpgradePurpose(data);\n }\n\n if (type === UpgradePurposeTypeEnum.StateTransition) {\n this.addStateTransitionUpgradePurpose(data);\n }\n\n return this;\n }\n\n /**\n * Converts the transaction request to a `TransactionUpgrade`.\n *\n * @returns The transaction create object.\n */\n toTransaction(): TransactionUpgrade {\n let upgradePurpose: UpgradePurpose;\n\n if (this.upgradePurpose.type === UpgradePurposeTypeEnum.ConsensusParameters) {\n upgradePurpose = {\n type: UpgradePurposeTypeEnum.ConsensusParameters,\n data: {\n witnessIndex: this.bytecodeWitnessIndex,\n checksum: this.upgradePurpose.checksum,\n },\n };\n } else if (this.upgradePurpose.type === UpgradePurposeTypeEnum.StateTransition) {\n upgradePurpose = {\n type: UpgradePurposeTypeEnum.StateTransition,\n data: {\n bytecodeRoot: hexlify(this.upgradePurpose.data),\n },\n };\n } else {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Invalid upgrade purpose');\n }\n\n return {\n type: TransactionType.Upgrade,\n ...super.getBaseTransaction(),\n upgradePurpose,\n };\n }\n\n /**\n * Gets the Transaction ID by hashing the transaction\n *\n * @param chainId - The chain ID.\n *\n * @returns - A hash of the transaction, which is the transaction ID.\n */\n getTransactionId(chainId: number): string {\n return hashTransaction(this, chainId);\n }\n\n /**\n * Calculates the metadata gas cost for an upgrade transaction.\n *\n * @param gasCosts - gas costs passed from the chain.\n *\n * @returns metadata gas cost for the upgrade transaction.\n */\n override metadataGas(gasCosts: GasCosts): BN {\n const txBytesSize = this.byteSize();\n\n if (this.upgradePurpose.type === UpgradePurposeTypeEnum.ConsensusParameters) {\n const witnessIndex = this.bytecodeWitnessIndex;\n const consensusSize = this.witnesses[witnessIndex].length;\n return calculateMetadataGasForTxUpgrade({\n gasCosts,\n txBytesSize,\n consensusSize,\n });\n }\n\n if (this.upgradePurpose.type === UpgradePurposeTypeEnum.StateTransition) {\n return calculateMetadataGasForTxUpgrade({\n gasCosts,\n txBytesSize,\n });\n }\n\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Invalid upgrade purpose');\n }\n}\n","import { ZeroBytes32 } from '@fuel-ts/address/configs';\nimport type { BN } from '@fuel-ts/math';\nimport { type TransactionUpload, TransactionType } from '@fuel-ts/transactions';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { arrayify, hexlify } from '@fuel-ts/utils';\nimport { clone } from 'ramda';\n\nimport type { ChainInfo, GasCosts } from '../provider';\nimport { calculateMetadataGasForTxUpload, calculateMinGasForTxUpload } from '../utils';\n\nimport { hashTransaction } from './hash-transaction';\nimport { type BaseTransactionRequestLike, BaseTransactionRequest } from './transaction-request';\n\n/**\n * @hidden\n */\nexport interface UploadSubsectionRequest {\n /** The root of the Merkle tree is created over the bytecode. */\n root: BytesLike;\n\n /** The index of the subsection of the bytecode. */\n subsectionIndex: number;\n\n /** The total number of subsections on which bytecode was divided. */\n subsectionsNumber: number;\n\n /** The proof set helps to verify the connection of the subsection to the `root`. */\n proofSet: BytesLike[];\n\n /** The subsection bytecode. */\n subsection: BytesLike;\n}\n\n/**\n * @hidden\n */\nexport interface UploadTransactionRequestLike extends BaseTransactionRequestLike {\n /** The witness index of the subsection of the bytecode. */\n witnessIndex?: number;\n\n /** The subsection data. */\n subsection?: Omit<UploadSubsectionRequest, 'subsection'>;\n}\n\nexport class UploadTransactionRequest extends BaseTransactionRequest {\n static from(obj: UploadTransactionRequestLike): UploadTransactionRequest {\n if (obj instanceof UploadTransactionRequest) {\n return obj;\n }\n return new this(clone(obj));\n }\n\n /** Type of the transaction */\n type = TransactionType.Upload as const;\n /** The witness index of the subsection of the bytecode. */\n witnessIndex: number;\n /** The subsection data. */\n subsection: Omit<UploadSubsectionRequest, 'subsection'>;\n\n /**\n * Creates an instance `UploadTransactionRequest`.\n *\n * @param uploadTransactionRequestLike - The initial values for the instance\n */\n constructor({ witnessIndex, subsection, ...rest }: UploadTransactionRequestLike = {}) {\n super(rest);\n this.witnessIndex = witnessIndex ?? 0;\n this.subsection = subsection ?? {\n proofSet: [],\n root: ZeroBytes32,\n subsectionIndex: 0,\n subsectionsNumber: 0,\n };\n }\n\n /**\n * Adds the subsection.\n *\n * @param subsection - The subsection data.\n */\n addSubsection(subsection: UploadSubsectionRequest) {\n const { subsection: subsectionBytecode, ...rest } = subsection;\n this.subsection = rest;\n this.witnessIndex = this.addWitness(subsectionBytecode);\n }\n\n /**\n * Gets the Transaction Request by hashing the transaction.\n *\n * @param chainId - The chain ID.\n *\n * @returns - A hash of the transaction, which is the transaction ID.\n */\n getTransactionId(chainId: number): string {\n return hashTransaction(this, chainId);\n }\n\n /**\n * Converts the transaction request to a `TransactionUpload`.\n *\n * @returns The transaction create object.\n */\n toTransaction(): TransactionUpload {\n const baseTransaction = this.getBaseTransaction();\n const { subsectionIndex, subsectionsNumber, root, proofSet } = this.subsection;\n return {\n type: TransactionType.Upload,\n ...baseTransaction,\n subsectionIndex,\n subsectionsNumber,\n root: hexlify(root),\n proofSet: proofSet.map(hexlify),\n witnessIndex: this.witnessIndex,\n proofSetCount: proofSet.length,\n };\n }\n\n /**\n * Calculates the metadata gas cost for an upload transaction.\n *\n * @param gasCosts - gas costs passed from the chain.\n *\n * @returns metadata gas cost for the upload transaction.\n */\n override metadataGas(gasCosts: GasCosts): BN {\n return calculateMetadataGasForTxUpload({\n gasCosts,\n txBytesSize: this.byteSize(),\n subsectionSize: arrayify(this.witnesses[this.witnessIndex]).length,\n subsectionsSize: this.subsection.subsectionsNumber,\n });\n }\n\n /**\n * Calculates the minimum gas for an upload transaction.\n *\n * @param chainInfo - The chain information.\n *\n * @returns the minimum gas for the upload transaction\n */\n override calculateMinGas(chainInfo: ChainInfo): BN {\n const minGas = super.calculateMinGas(chainInfo);\n const { gasCosts } = chainInfo.consensusParameters;\n const bytecode = this.witnesses[this.witnessIndex] ?? ZeroBytes32;\n return calculateMinGasForTxUpload({\n gasCosts,\n baseMinGas: minGas.toNumber(),\n subsectionSize: arrayify(bytecode).length,\n });\n }\n}\n","import type { JsonAbi } from '@fuel-ts/abi-coder';\nimport type { TransactionType } from '@fuel-ts/transactions';\n\nimport type {\n BlobTransactionRequest,\n BlobTransactionRequestLike,\n} from './blob-transaction-request';\nimport type {\n CreateTransactionRequest,\n CreateTransactionRequestLike,\n} from './create-transaction-request';\nimport type {\n ScriptTransactionRequest,\n ScriptTransactionRequestLike,\n} from './script-transaction-request';\nimport type {\n UpgradeTransactionRequest,\n UpgradeTransactionRequestLike,\n} from './upgrade-transaction-request';\nimport type {\n UploadTransactionRequest,\n UploadTransactionRequestLike,\n} from './upload-transaction-request';\n\nexport type TransactionRequest =\n | ScriptTransactionRequest\n | CreateTransactionRequest\n | BlobTransactionRequest\n | UpgradeTransactionRequest\n | UploadTransactionRequest;\nexport type TransactionRequestLike =\n | ({ type: TransactionType.Script } & ScriptTransactionRequestLike)\n | ({ type: TransactionType.Create } & CreateTransactionRequestLike)\n | ({ type: TransactionType.Blob } & BlobTransactionRequestLike)\n | ({ type: TransactionType.Upgrade } & UpgradeTransactionRequestLike)\n | ({ type: TransactionType.Upload } & UploadTransactionRequestLike);\n\nexport type JsonAbisFromAllCalls = {\n main: JsonAbi;\n otherContractsAbis: Record<string, JsonAbi>;\n};\n\n/**\n * @hidden\n */\nexport abstract class AbstractScriptRequest<T> {\n abstract bytes: Uint8Array;\n abstract encodeScriptData: (data: T) => Uint8Array;\n}\n","import { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { TransactionType } from '@fuel-ts/transactions';\n\nimport { BlobTransactionRequest } from './blob-transaction-request';\nimport { CreateTransactionRequest } from './create-transaction-request';\nimport { ScriptTransactionRequest } from './script-transaction-request';\nimport type { TransactionRequestLike, TransactionRequest } from './types';\nimport { UpgradeTransactionRequest } from './upgrade-transaction-request';\nimport { UploadTransactionRequest } from './upload-transaction-request';\n\n/** @hidden */\nexport const transactionRequestify = (obj: TransactionRequestLike): TransactionRequest => {\n if (\n obj instanceof ScriptTransactionRequest ||\n obj instanceof CreateTransactionRequest ||\n obj instanceof BlobTransactionRequest ||\n obj instanceof UpgradeTransactionRequest ||\n obj instanceof UploadTransactionRequest\n ) {\n return obj;\n }\n\n const { type } = obj;\n\n switch (obj.type) {\n case TransactionType.Script: {\n return ScriptTransactionRequest.from(obj);\n }\n case TransactionType.Create: {\n return CreateTransactionRequest.from(obj);\n }\n case TransactionType.Blob: {\n return BlobTransactionRequest.from(obj);\n }\n case TransactionType.Upgrade: {\n return UpgradeTransactionRequest.from(obj);\n }\n case TransactionType.Upload: {\n return UploadTransactionRequest.from(obj);\n }\n default: {\n throw new FuelError(\n ErrorCode.UNSUPPORTED_TRANSACTION_TYPE,\n `Unsupported transaction type: ${type}.`\n );\n }\n }\n};\n\n/** @hidden */\nexport const isTransactionTypeScript = (\n request: TransactionRequestLike\n): request is ScriptTransactionRequest => request.type === TransactionType.Script;\n\n/** @hidden */\nexport const isTransactionTypeCreate = (\n request: TransactionRequestLike\n): request is CreateTransactionRequest => request.type === TransactionType.Create;\n\n/** @hidden */\nexport const isTransactionTypeBlob = (\n request: TransactionRequestLike\n): request is BlobTransactionRequest => request.type === TransactionType.Blob;\n\n/** @hidden */\nexport const isTransactionTypeUpgrade = (\n request: TransactionRequestLike\n): request is UpgradeTransactionRequest => request.type === TransactionType.Upgrade;\n\n/** @hidden */\nexport const isTransactionTypeUpload = (\n request: TransactionRequestLike\n): request is UploadTransactionRequest => request.type === TransactionType.Upload;\n","import { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport type { BN } from '@fuel-ts/math';\nimport { bn } from '@fuel-ts/math';\nimport type {\n ReceiptCall,\n ReceiptLog,\n ReceiptLogData,\n ReceiptPanic,\n ReceiptReturn,\n ReceiptReturnData,\n ReceiptRevert,\n ReceiptTransfer,\n ReceiptTransferOut,\n ReceiptScriptResult,\n ReceiptMessageOut,\n Transaction,\n ReceiptMint,\n ReceiptBurn,\n OutputCoin,\n OutputContract,\n OutputChange,\n OutputVariable,\n OutputContractCreated,\n Output,\n TransactionType,\n} from '@fuel-ts/transactions';\nimport { OutputType, TransactionCoder, TxPointerCoder } from '@fuel-ts/transactions';\nimport { arrayify, assertUnreachable } from '@fuel-ts/utils';\n\nimport type {\n GqlMalleableTransactionFieldsFragment,\n GqlStatusChangeSubscription,\n GqlSubmitAndAwaitStatusSubscription,\n} from '../__generated__/operations';\nimport type Provider from '../provider';\nimport type { JsonAbisFromAllCalls, TransactionRequest } from '../transaction-request';\nimport { assembleTransactionSummary } from '../transaction-summary/assemble-transaction-summary';\nimport { processGqlReceipt } from '../transaction-summary/receipt';\nimport { getTotalFeeFromStatus } from '../transaction-summary/status';\nimport type { TransactionSummary, GqlTransaction, AbiMap } from '../transaction-summary/types';\nimport { extractTxError } from '../utils';\n\nimport { getDecodedLogs } from './getDecodedLogs';\n\n/** @hidden */\nexport type TransactionResultCallReceipt = ReceiptCall;\n/** @hidden */\nexport type TransactionResultReturnReceipt = ReceiptReturn;\n/** @hidden */\nexport type TransactionResultReturnDataReceipt = ReceiptReturnData & { data: string };\n/** @hidden */\nexport type TransactionResultPanicReceipt = ReceiptPanic;\n/** @hidden */\nexport type TransactionResultRevertReceipt = ReceiptRevert;\n/** @hidden */\nexport type TransactionResultLogReceipt = ReceiptLog;\n/** @hidden */\nexport type TransactionResultLogDataReceipt = ReceiptLogData & { data: string };\n/** @hidden */\nexport type TransactionResultTransferReceipt = ReceiptTransfer;\n/** @hidden */\nexport type TransactionResultTransferOutReceipt = ReceiptTransferOut;\n/** @hidden */\nexport type TransactionResultScriptResultReceipt = ReceiptScriptResult;\n/** @hidden */\nexport type TransactionResultMessageOutReceipt = ReceiptMessageOut;\nexport type TransactionResultMintReceipt = ReceiptMint;\nexport type TransactionResultBurnReceipt = ReceiptBurn;\n\n/** @hidden */\nexport type TransactionResultReceipt =\n | ReceiptCall\n | ReceiptReturn\n | (ReceiptReturnData & { data: string })\n | ReceiptPanic\n | ReceiptRevert\n | ReceiptLog\n | (ReceiptLogData & { data: string })\n | ReceiptTransfer\n | ReceiptTransferOut\n | ReceiptScriptResult\n | ReceiptMessageOut\n | TransactionResultMintReceipt\n | TransactionResultBurnReceipt;\n\n/** @hidden */\nexport type TransactionResult<TTransactionType = void> = TransactionSummary<TTransactionType> & {\n logs?: Array<unknown>;\n};\n\nfunction mapGqlOutputsToTxOutputs(\n outputs: GqlMalleableTransactionFieldsFragment['outputs']\n): Output[] {\n return outputs.map((o) => {\n const obj = 'amount' in o ? { ...o, amount: bn(o.amount) } : o;\n switch (obj.type) {\n case 'CoinOutput':\n return { ...obj, type: OutputType.Coin } satisfies OutputCoin;\n case 'ContractOutput':\n return {\n ...obj,\n type: OutputType.Contract,\n inputIndex: parseInt(obj.inputIndex, 10),\n } satisfies OutputContract;\n case 'ChangeOutput':\n return {\n ...obj,\n type: OutputType.Change,\n } satisfies OutputChange;\n case 'VariableOutput':\n return { ...obj, type: OutputType.Variable } satisfies OutputVariable;\n case 'ContractCreated':\n return {\n ...obj,\n type: OutputType.ContractCreated,\n contractId: obj.contract,\n } satisfies OutputContractCreated;\n default:\n return assertUnreachable(obj);\n }\n });\n}\n\n/**\n * Represents a response for a transaction.\n */\nexport class TransactionResponse {\n /** Transaction ID */\n id: string;\n /** Current provider */\n provider: Provider;\n /** Gas used on the transaction */\n gasUsed: BN = bn(0);\n /** The graphql Transaction with receipts object. */\n private gqlTransaction?: GqlTransaction;\n private request?: TransactionRequest;\n private status?: GqlStatusChangeSubscription['statusChange'];\n abis?: JsonAbisFromAllCalls;\n\n /**\n * Constructor for `TransactionResponse`.\n *\n * @param tx - The transaction ID or TransactionRequest.\n * @param provider - The provider.\n */\n constructor(\n tx: string | TransactionRequest,\n provider: Provider,\n chainId: number,\n abis?: JsonAbisFromAllCalls,\n private submitTxSubscription?: AsyncIterable<GqlSubmitAndAwaitStatusSubscription>\n ) {\n this.id = typeof tx === 'string' ? tx : tx.getTransactionId(chainId);\n\n this.provider = provider;\n this.abis = abis;\n this.request = typeof tx === 'string' ? undefined : tx;\n }\n\n /**\n * Async constructor for `TransactionResponse`. This method can be used to create\n * an instance of `TransactionResponse` and wait for the transaction to be fetched\n * from the chain, ensuring that the `gqlTransaction` property is set.\n *\n * @param id - The transaction ID.\n * @param provider - The provider.\n */\n static async create(\n id: string,\n provider: Provider,\n abis?: JsonAbisFromAllCalls\n ): Promise<TransactionResponse> {\n const chainId = await provider.getChainId();\n const response = new TransactionResponse(id, provider, chainId, abis);\n await response.fetch();\n return response;\n }\n\n private applyMalleableSubscriptionFields<TTransactionType = void>(\n transaction: Transaction<TTransactionType>\n ) {\n const status = this.status;\n if (!status) {\n return;\n }\n\n // The SDK currently submits only these\n const tx = transaction as Transaction<\n TransactionType.Script | TransactionType.Create | TransactionType.Blob\n >;\n\n if (status.type === 'SuccessStatus' || status.type === 'FailureStatus') {\n tx.inputs = tx.inputs.map((input, idx) => {\n if ('txPointer' in input) {\n const correspondingInput = status.transaction.inputs?.[idx] as { txPointer: string };\n return {\n ...input,\n txPointer: TxPointerCoder.decodeFromGqlScalar(correspondingInput.txPointer),\n };\n }\n return input;\n });\n\n tx.outputs = mapGqlOutputsToTxOutputs(status.transaction.outputs);\n\n if ('receiptsRoot' in status.transaction) {\n (tx as Transaction<TransactionType.Script>).receiptsRoot = status.transaction\n .receiptsRoot as string;\n }\n }\n }\n\n private async getTransaction<TTransactionType = void>(): Promise<{\n tx: Transaction<TTransactionType>;\n bytes: Uint8Array;\n }> {\n if (this.request) {\n const tx = this.request.toTransaction() as Transaction<TTransactionType>;\n this.applyMalleableSubscriptionFields(tx);\n return {\n tx,\n bytes: this.request.toTransactionBytes(),\n };\n }\n\n const gqlTransaction = this.gqlTransaction ?? (await this.fetch());\n return {\n tx: this.decodeTransaction(gqlTransaction) as Transaction<TTransactionType>,\n bytes: arrayify(gqlTransaction.rawPayload),\n };\n }\n\n private getReceipts(): TransactionResultReceipt[] {\n const status = this.status ?? this.gqlTransaction?.status;\n\n switch (status?.type) {\n case 'SuccessStatus':\n case 'FailureStatus':\n return status.receipts.map(processGqlReceipt);\n default:\n return [];\n }\n }\n\n /**\n * Fetch the transaction with receipts from the provider.\n *\n * @returns Transaction with receipts query result.\n */\n async fetch(): Promise<GqlTransaction> {\n const response = await this.provider.operations.getTransactionWithReceipts({\n transactionId: this.id,\n });\n\n if (!response.transaction) {\n const subscription = await this.provider.operations.statusChange({\n transactionId: this.id,\n });\n\n for await (const { statusChange } of subscription) {\n if (statusChange) {\n this.status = statusChange;\n break;\n }\n }\n\n return this.fetch();\n }\n\n this.gqlTransaction = response.transaction;\n\n return response.transaction;\n }\n\n /**\n * Decode the raw payload of the transaction.\n *\n * @param transactionWithReceipts - The transaction with receipts object.\n * @returns The decoded transaction.\n */\n decodeTransaction<TTransactionType = void>(transactionWithReceipts: GqlTransaction) {\n return new TransactionCoder().decode(\n arrayify(transactionWithReceipts.rawPayload),\n 0\n )?.[0] as Transaction<TTransactionType>;\n }\n\n /**\n * Retrieves the TransactionSummary. If the `gqlTransaction` is not set, it will\n * fetch it from the provider\n *\n * @param contractsAbiMap - The contracts ABI map.\n * @returns\n */\n async getTransactionSummary<TTransactionType = void>(\n contractsAbiMap?: AbiMap\n ): Promise<TransactionSummary<TTransactionType>> {\n const { tx: transaction, bytes: transactionBytes } =\n await this.getTransaction<TTransactionType>();\n\n const { gasPerByte, gasPriceFactor, gasCosts, maxGasPerTx } =\n await this.provider.getGasConfig();\n\n // If we have the total fee, we do not need to refetch the gas price\n const totalFee = getTotalFeeFromStatus(this.status ?? this.gqlTransaction?.status);\n const gasPrice = totalFee ? bn(0) : await this.provider.getLatestGasPrice();\n\n const maxInputs = (await this.provider.getChain()).consensusParameters.txParameters.maxInputs;\n const baseAssetId = await this.provider.getBaseAssetId();\n\n const transactionSummary = assembleTransactionSummary<TTransactionType>({\n id: this.id,\n receipts: this.getReceipts(),\n transaction,\n transactionBytes,\n gqlTransactionStatus: this.status ?? this.gqlTransaction?.status,\n gasPerByte,\n gasPriceFactor,\n abiMap: contractsAbiMap,\n maxInputs,\n gasCosts,\n maxGasPerTx,\n gasPrice,\n baseAssetId,\n });\n\n return transactionSummary;\n }\n\n private async waitForStatusChange() {\n const status = this.gqlTransaction?.status?.type;\n if (status && status !== 'SubmittedStatus') {\n return;\n }\n\n const subscription =\n this.submitTxSubscription ??\n (await this.provider.operations.statusChange({\n transactionId: this.id,\n }));\n\n for await (const sub of subscription) {\n const statusChange = 'statusChange' in sub ? sub.statusChange : sub.submitAndAwaitStatus;\n this.status = statusChange;\n if (statusChange.type === 'SqueezedOutStatus') {\n this.unsetResourceCache();\n throw new FuelError(\n ErrorCode.TRANSACTION_SQUEEZED_OUT,\n `Transaction Squeezed Out with reason: ${statusChange.reason}`\n );\n }\n if (statusChange.type !== 'SubmittedStatus') {\n break;\n }\n }\n }\n\n /**\n * Assembles the result of a transaction by retrieving the transaction summary,\n * decoding logs (if available), and handling transaction failure.\n *\n * This method can be used to obtain the result of a transaction that has just\n * been submitted or one that has already been processed.\n *\n * @template TTransactionType - The type of the transaction.\n * @param contractsAbiMap - The map of contract ABIs.\n * @returns - The assembled transaction result.\n * @throws If the transaction status is a failure.\n */\n async assembleResult<TTransactionType = void>(\n contractsAbiMap?: AbiMap\n ): Promise<TransactionResult<TTransactionType>> {\n const transactionSummary = await this.getTransactionSummary<TTransactionType>(contractsAbiMap);\n\n const transactionResult: TransactionResult<TTransactionType> = {\n ...transactionSummary,\n };\n\n let logs: Array<unknown> = [];\n\n if (this.abis) {\n logs = getDecodedLogs(\n transactionSummary.receipts,\n this.abis.main,\n this.abis.otherContractsAbis\n );\n\n transactionResult.logs = logs;\n }\n\n const { receipts } = transactionResult;\n\n const status = this.status ?? this.gqlTransaction?.status;\n if (status?.type === 'FailureStatus') {\n this.unsetResourceCache();\n const { reason } = status;\n throw extractTxError({\n receipts,\n statusReason: reason,\n logs,\n });\n }\n\n return transactionResult;\n }\n\n /**\n * Waits for transaction to complete and returns the result.\n *\n * @returns The completed transaction result\n */\n async waitForResult<TTransactionType = void>(\n contractsAbiMap?: AbiMap\n ): Promise<TransactionResult<TTransactionType>> {\n await this.waitForStatusChange();\n return this.assembleResult<TTransactionType>(contractsAbiMap);\n }\n\n /**\n * Waits for transaction to complete and returns the result.\n *\n * @param contractsAbiMap - The contracts ABI map.\n */\n async wait<TTransactionType = void>(\n contractsAbiMap?: AbiMap\n ): Promise<TransactionResult<TTransactionType>> {\n return this.waitForResult<TTransactionType>(contractsAbiMap);\n }\n\n private unsetResourceCache() {\n this.provider.cache?.unset(this.id);\n }\n}\n","import { bn, type BN } from '@fuel-ts/math';\nimport { PolicyType, type Transaction } from '@fuel-ts/transactions';\nimport { DateTime, hexlify } from '@fuel-ts/utils';\n\nimport type { GasCosts } from '../provider';\nimport type { TransactionResultReceipt } from '../transaction-response';\nimport { getGasUsedFromReceipts } from '../utils';\n\nimport { calculateTXFeeForSummary } from './calculate-tx-fee-for-summary';\nimport {\n getOperations,\n getTransactionTypeName,\n isTypeMint,\n isTypeCreate,\n isTypeScript,\n isTypeUpgrade,\n isTypeUpload,\n isTypeBlob,\n} from './operations';\nimport { extractBurnedAssetsFromReceipts, extractMintedAssetsFromReceipts } from './receipt';\nimport { processGraphqlStatus } from './status';\nimport type { AbiMap, GraphqlTransactionStatus, TransactionSummary } from './types';\n\nexport interface AssembleTransactionSummaryParams {\n gasPerByte: BN;\n gasPriceFactor: BN;\n transaction: Transaction;\n id: string;\n transactionBytes: Uint8Array;\n gqlTransactionStatus?: GraphqlTransactionStatus;\n receipts: TransactionResultReceipt[];\n abiMap?: AbiMap;\n maxInputs: BN;\n gasCosts: GasCosts;\n maxGasPerTx: BN;\n gasPrice: BN;\n baseAssetId: string;\n}\n\n/** @hidden */\nexport function assembleTransactionSummary<TTransactionType = void>(\n params: AssembleTransactionSummaryParams\n) {\n const {\n id,\n receipts,\n gasPerByte,\n gasPriceFactor,\n transaction,\n transactionBytes,\n gqlTransactionStatus,\n abiMap = {},\n maxInputs,\n gasCosts,\n maxGasPerTx,\n gasPrice,\n baseAssetId,\n } = params;\n\n const gasUsed = getGasUsedFromReceipts(receipts);\n\n const rawPayload = hexlify(transactionBytes);\n\n const operations = getOperations({\n transactionType: transaction.type,\n inputs: transaction.inputs || [],\n outputs: transaction.outputs || [],\n receipts,\n rawPayload,\n abiMap,\n maxInputs,\n baseAssetId,\n });\n\n const typeName = getTransactionTypeName(transaction.type);\n\n const tip = bn(transaction.policies?.find((policy) => policy.type === PolicyType.Tip)?.data);\n\n const { isStatusFailure, isStatusPending, isStatusSuccess, blockId, status, time, totalFee } =\n processGraphqlStatus(gqlTransactionStatus);\n\n const fee =\n totalFee ??\n calculateTXFeeForSummary({\n gasPrice,\n rawPayload,\n tip,\n consensusParameters: {\n gasCosts,\n maxGasPerTx,\n feeParams: {\n gasPerByte,\n gasPriceFactor,\n },\n },\n });\n\n const mintedAssets = extractMintedAssetsFromReceipts(receipts);\n const burnedAssets = extractBurnedAssetsFromReceipts(receipts);\n\n let date: DateTime | undefined;\n\n if (time) {\n date = DateTime.fromTai64(time);\n }\n\n const transactionSummary: TransactionSummary<TTransactionType> = {\n id,\n tip,\n fee,\n gasUsed,\n operations,\n type: typeName,\n blockId,\n time,\n status,\n receipts,\n mintedAssets,\n burnedAssets,\n isTypeMint: isTypeMint(transaction.type),\n isTypeCreate: isTypeCreate(transaction.type),\n isTypeScript: isTypeScript(transaction.type),\n isTypeUpgrade: isTypeUpgrade(transaction.type),\n isTypeUpload: isTypeUpload(transaction.type),\n isTypeBlob: isTypeBlob(transaction.type),\n isStatusFailure,\n isStatusSuccess,\n isStatusPending,\n date,\n transaction: transaction as Transaction<TTransactionType>,\n };\n\n return transactionSummary;\n}\n","import type { BN } from '@fuel-ts/math';\nimport { bn } from '@fuel-ts/math';\nimport type { TransactionCreate, TransactionScript } from '@fuel-ts/transactions';\nimport { PolicyType, TransactionCoder, TransactionType } from '@fuel-ts/transactions';\nimport { arrayify } from '@fuel-ts/utils';\n\nimport type { GqlFeeParameters } from '../__generated__/operations';\nimport type { ConsensusParameters } from '../provider';\nimport {\n calculateGasFee,\n calculateMetadataGasForTxCreate,\n calculateMetadataGasForTxScript,\n getMaxGas,\n getMinGas,\n} from '../utils/gas';\n\ntype FeeParams =\n | Pick<GqlFeeParameters, 'gasPerByte' | 'gasPriceFactor'>\n | {\n gasPerByte: BN | number;\n gasPriceFactor: BN | number;\n };\n\nexport type CalculateTXFeeForSummaryParams = {\n gasPrice: BN;\n rawPayload: string;\n tip: BN;\n consensusParameters: Pick<ConsensusParameters, 'gasCosts'> & {\n feeParams: FeeParams;\n maxGasPerTx: BN;\n };\n};\n\nexport const calculateTXFeeForSummary = (params: CalculateTXFeeForSummaryParams): BN => {\n const {\n gasPrice,\n rawPayload,\n tip,\n consensusParameters: { gasCosts, feeParams, maxGasPerTx },\n } = params;\n\n const gasPerByte = bn(feeParams.gasPerByte);\n const gasPriceFactor = bn(feeParams.gasPriceFactor);\n\n const transactionBytes = arrayify(rawPayload);\n\n const [transaction] = new TransactionCoder().decode(transactionBytes, 0);\n\n const { type, witnesses, inputs, policies } = transaction as\n | TransactionCreate\n | TransactionScript;\n\n let metadataGas = bn(0);\n let gasLimit = bn(0);\n\n if (type !== TransactionType.Create && type !== TransactionType.Script) {\n return bn(0);\n }\n\n if (type === TransactionType.Create) {\n const { bytecodeWitnessIndex, storageSlots } = transaction as TransactionCreate;\n\n const contractBytesSize = bn(arrayify(witnesses[bytecodeWitnessIndex].data).length);\n\n metadataGas = calculateMetadataGasForTxCreate({\n contractBytesSize,\n gasCosts,\n stateRootSize: storageSlots.length || 0,\n txBytesSize: transactionBytes.length,\n });\n } else {\n const { scriptGasLimit } = transaction;\n\n if (scriptGasLimit) {\n gasLimit = scriptGasLimit;\n }\n\n metadataGas = calculateMetadataGasForTxScript({\n gasCosts,\n txBytesSize: transactionBytes.length,\n });\n }\n\n const minGas = getMinGas({\n gasCosts,\n gasPerByte: bn(gasPerByte),\n inputs,\n metadataGas,\n txBytesSize: transactionBytes.length,\n });\n\n const witnessLimit = policies.find((policy) => policy.type === PolicyType.WitnessLimit)?.data as\n | BN\n | undefined;\n\n const witnessesLength = witnesses.reduce((acc, wit) => acc + wit.dataLength, 0);\n\n const maxGas = getMaxGas({\n gasPerByte,\n minGas,\n witnessesLength,\n gasLimit,\n witnessLimit,\n maxGasPerTx,\n });\n\n const maxFee = calculateGasFee({\n gasPrice,\n gas: maxGas,\n priceFactor: gasPriceFactor,\n tip,\n });\n\n return maxFee;\n};\n","import { ZeroBytes32 } from '@fuel-ts/address/configs';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport type { BN } from '@fuel-ts/math';\nimport { bn } from '@fuel-ts/math';\nimport { ReceiptType, TransactionType } from '@fuel-ts/transactions';\nimport type { InputContract, Output, OutputChange, Input } from '@fuel-ts/transactions';\n\nimport type {\n TransactionResultReceipt,\n TransactionResultCallReceipt,\n TransactionResultMessageOutReceipt,\n TransactionResultTransferOutReceipt,\n TransactionResultTransferReceipt,\n} from '../transaction-response';\n\nimport type { FunctionCall } from './call';\nimport { getFunctionCall } from './call';\nimport {\n getInputFromAssetId,\n getInputAccountAddress,\n getInputContractFromIndex,\n getInputsContract,\n getInputsCoinAndMessage,\n aggregateInputsAmountsByAssetAndOwner,\n} from './input';\nimport {\n getOutputsChange,\n getOutputsCoin,\n getOutputsContract,\n getOutputsContractCreated,\n} from './output';\nimport { AddressType, ChainName, OperationName, TransactionTypeName } from './types';\nimport type {\n InputOutputParam,\n InputParam,\n OperationCoin,\n RawPayloadParam,\n ReceiptParam,\n Operation,\n GetOperationParams,\n GetTransferOperationsParams,\n AbiMap,\n} from './types';\n\n/**\n * Extracts a specific type of receipt from a list of receipts.\n *\n * @param receipts - The list of receipts to filter.\n * @param type - The type of receipt to filter for.\n * @returns The filtered list of receipts.\n */\nexport function getReceiptsByType<T = TransactionResultReceipt>(\n receipts: TransactionResultReceipt[],\n type: ReceiptType\n) {\n return (receipts ?? []).filter((r) => r.type === type) as T[];\n}\n\n/**\n * Returns the transaction type's name based on the transaction type enum value.\n *\n * @param transactionType - The transaction type enum value.\n * @returns The transaction type's name.\n */\nexport function getTransactionTypeName(transactionType: TransactionType): TransactionTypeName {\n switch (transactionType) {\n case TransactionType.Mint:\n return TransactionTypeName.Mint;\n case TransactionType.Create:\n return TransactionTypeName.Create;\n case TransactionType.Script:\n return TransactionTypeName.Script;\n case TransactionType.Blob:\n return TransactionTypeName.Blob;\n case TransactionType.Upgrade:\n return TransactionTypeName.Upgrade;\n case TransactionType.Upload:\n return TransactionTypeName.Upload;\n default:\n throw new FuelError(\n ErrorCode.UNSUPPORTED_TRANSACTION_TYPE,\n `Unsupported transaction type: ${transactionType}.`\n );\n }\n}\n\n/** @hidden */\nexport function isType(transactionType: TransactionType, type: TransactionTypeName) {\n const txType = getTransactionTypeName(transactionType);\n\n return txType === type;\n}\n\n/** @hidden */\nexport function isTypeMint(transactionType: TransactionType) {\n return isType(transactionType, TransactionTypeName.Mint);\n}\n\n/** @hidden */\nexport function isTypeCreate(transactionType: TransactionType) {\n return isType(transactionType, TransactionTypeName.Create);\n}\n\n/** @hidden */\nexport function isTypeScript(transactionType: TransactionType) {\n return isType(transactionType, TransactionTypeName.Script);\n}\n\n/** @hidden */\nexport function isTypeUpgrade(transactionType: TransactionType) {\n return isType(transactionType, TransactionTypeName.Upgrade);\n}\n\n/** @hidden */\nexport function isTypeUpload(transactionType: TransactionType) {\n return isType(transactionType, TransactionTypeName.Upload);\n}\n\n/** @hidden */\nexport function isTypeBlob(transactionType: TransactionType) {\n return isType(transactionType, TransactionTypeName.Blob);\n}\n\n/** @hidden */\nexport function hasSameAssetId(a: OperationCoin) {\n return (b: OperationCoin) => a.assetId === b.assetId;\n}\n\n/** @hidden */\nexport function getReceiptsCall(receipts: TransactionResultReceipt[]) {\n return getReceiptsByType<TransactionResultCallReceipt>(receipts, ReceiptType.Call);\n}\n\n/** @hidden */\nexport function getReceiptsMessageOut(receipts: TransactionResultReceipt[]) {\n return getReceiptsByType<TransactionResultMessageOutReceipt>(receipts, ReceiptType.MessageOut);\n}\n\n/** @hidden */\nfunction mergeAssets(op1: Operation, op2: Operation): OperationCoin[] {\n const assets1 = op1.assetsSent || [];\n const assets2 = op2.assetsSent || [];\n\n const assetMap = new Map<string, OperationCoin>();\n\n // Merge assets from op1\n assets1.forEach((asset) => {\n assetMap.set(asset.assetId, { ...asset });\n });\n\n // Merge assets from op2, adding to existing assets or creating new ones\n assets2.forEach((asset) => {\n const existingAsset = assetMap.get(asset.assetId);\n if (existingAsset) {\n existingAsset.amount = bn(existingAsset.amount).add(asset.amount);\n } else {\n assetMap.set(asset.assetId, { ...asset });\n }\n });\n\n return Array.from(assetMap.values());\n}\n\n/** @hidden */\nfunction isSameOperation(a: Operation, b: Operation) {\n return (\n a.name === b.name &&\n a.from?.address === b.from?.address &&\n a.to?.address === b.to?.address &&\n a.from?.type === b.from?.type &&\n a.to?.type === b.to?.type\n );\n}\n\n/** @hidden */\nfunction mergeAssetsSent(existing: Operation, toAdd: Operation): Operation['assetsSent'] {\n if (!toAdd.assetsSent?.length) {\n return existing.assetsSent;\n }\n\n return existing.assetsSent?.length ? mergeAssets(existing, toAdd) : toAdd.assetsSent;\n}\n\n/** @hidden */\nfunction mergeCalls(existing: Operation, toAdd: Operation): Operation['calls'] {\n if (!toAdd.calls?.length) {\n return existing.calls;\n }\n\n return [...(existing.calls || []), ...toAdd.calls];\n}\n\n/** @hidden */\nfunction mergeOperations(existing: Operation, toAdd: Operation): Operation {\n return {\n ...existing,\n assetsSent: mergeAssetsSent(existing, toAdd),\n calls: mergeCalls(existing, toAdd),\n };\n}\n\n/** @hidden */\nexport function addOperation(operations: Operation[], toAdd: Operation): Operation[] {\n const existingIndex = operations.findIndex((op) => isSameOperation(op, toAdd));\n\n if (existingIndex === -1) {\n return [...operations, toAdd];\n }\n\n return operations.map((op, index) => (index === existingIndex ? mergeOperations(op, toAdd) : op));\n}\n\n/** @hidden */\nexport function getReceiptsTransferOut(receipts: TransactionResultReceipt[]) {\n return getReceiptsByType<TransactionResultTransferOutReceipt>(receipts, ReceiptType.TransferOut);\n}\n\n/**\n * Creates withdrawal operations from Fuel to Ethereum based on message out receipts\n *\n * @param inputs - Transaction inputs containing account information\n * @param receipts - Transaction receipts containing withdrawal details\n * @param baseAssetId - The ID of the asset being withdrawn\n * @returns Array of withdrawal operations with sender, recipient, and asset id.\n */\nexport function getWithdrawFromFuelOperations({\n inputs,\n receipts,\n baseAssetId,\n}: InputParam & ReceiptParam & { baseAssetId: string }): Operation[] {\n const messageOutReceipts = getReceiptsMessageOut(receipts);\n\n const withdrawFromFuelOperations = messageOutReceipts.reduce(\n (prevWithdrawFromFuelOps, receipt) => {\n const input = getInputFromAssetId(inputs, baseAssetId, true);\n if (input) {\n const inputAddress = getInputAccountAddress(input);\n const newWithdrawFromFuelOps = addOperation(prevWithdrawFromFuelOps, {\n name: OperationName.withdrawFromFuel,\n from: {\n type: AddressType.account,\n address: inputAddress,\n },\n to: {\n type: AddressType.account,\n address: receipt.recipient.toString(),\n chain: ChainName.ethereum,\n },\n assetsSent: [\n {\n amount: receipt.amount,\n assetId: baseAssetId,\n },\n ],\n });\n\n return newWithdrawFromFuelOps;\n }\n\n return prevWithdrawFromFuelOps;\n },\n [] as Operation[]\n );\n\n return withdrawFromFuelOperations;\n}\n\n/** @hidden */\nfunction getContractCalls(\n contractInput: InputContract,\n abiMap: AbiMap | undefined,\n receipt: TransactionResultCallReceipt,\n rawPayload: string,\n maxInputs: BN\n): FunctionCall[] {\n const abi = abiMap?.[contractInput.contractID];\n if (!abi) {\n return [];\n }\n\n return [\n getFunctionCall({\n abi,\n receipt,\n rawPayload,\n maxInputs,\n }),\n ];\n}\n\n/** @hidden */\nfunction getAssetsSent(receipt: TransactionResultCallReceipt): OperationCoin[] | undefined {\n return receipt.amount?.isZero()\n ? undefined\n : [\n {\n amount: receipt.amount,\n assetId: receipt.assetId,\n },\n ];\n}\n\n/** @hidden */\nfunction processCallReceipt(\n receipt: TransactionResultCallReceipt,\n contractInput: InputContract,\n inputs: Input[],\n abiMap: AbiMap | undefined,\n rawPayload: string,\n maxInputs: BN,\n baseAssetId: string\n): Operation[] {\n const assetId = receipt.assetId === ZeroBytes32 ? baseAssetId : receipt.assetId;\n const input = getInputFromAssetId(inputs, assetId, assetId === baseAssetId);\n if (!input) {\n return [];\n }\n\n const inputAddress = getInputAccountAddress(input);\n const calls = getContractCalls(contractInput, abiMap, receipt, rawPayload, maxInputs);\n\n return [\n {\n name: OperationName.contractCall,\n from: {\n type: AddressType.account,\n address: inputAddress,\n },\n to: {\n type: AddressType.contract,\n address: receipt.to,\n },\n assetsSent: getAssetsSent(receipt),\n calls,\n },\n ];\n}\n\n/** @hidden */\nexport function getContractCallOperations({\n inputs,\n outputs,\n receipts,\n abiMap,\n rawPayload,\n maxInputs,\n baseAssetId,\n}: InputOutputParam &\n ReceiptParam &\n Pick<GetOperationParams, 'abiMap' | 'maxInputs' | 'baseAssetId'> &\n RawPayloadParam): Operation[] {\n const contractCallReceipts = getReceiptsCall(receipts);\n const contractOutputs = getOutputsContract(outputs);\n\n return contractOutputs.flatMap((output) => {\n const contractInput = getInputContractFromIndex(inputs, output.inputIndex);\n if (!contractInput) {\n return [];\n }\n\n return contractCallReceipts\n .filter((receipt) => receipt.to === contractInput.contractID)\n .flatMap((receipt) =>\n processCallReceipt(\n receipt,\n contractInput,\n inputs,\n abiMap,\n rawPayload as string,\n maxInputs,\n baseAssetId\n )\n );\n });\n}\n\n/**\n * Extracts a transfer operation from a transaction receipt, determining the addresses and types\n * of the sender and receiver, along with the transferred asset details.\n *\n * @param receipt - The transaction receipt containing transfer information\n * @param contractInputs - Array of contract inputs to determine address types\n * @param changeOutputs - Array of change outputs to resolve zero addresses\n * @returns A transfer operation object with sender, receiver and asset details\n */\nfunction extractTransferOperationFromReceipt(\n receipt: TransactionResultTransferReceipt | TransactionResultTransferOutReceipt,\n contractInputs: InputContract[],\n changeOutputs: OutputChange[]\n) {\n const { to: toAddress, assetId, amount } = receipt;\n let { id: fromAddress } = receipt;\n\n const toType = contractInputs.some((input) => input.contractID === toAddress)\n ? AddressType.contract\n : AddressType.account;\n\n if (ZeroBytes32 === fromAddress) {\n const change = changeOutputs.find((output) => output.assetId === assetId);\n\n fromAddress = change?.to || fromAddress;\n }\n\n const fromType = contractInputs.some((input) => input.contractID === fromAddress)\n ? AddressType.contract\n : AddressType.account;\n\n return {\n name: OperationName.transfer,\n from: {\n type: fromType,\n address: fromAddress,\n },\n to: {\n type: toType,\n address: toAddress,\n },\n assetsSent: [\n {\n assetId: assetId.toString(),\n amount,\n },\n ],\n };\n}\n\n/** @hidden */\nexport function getTransferOperations({\n inputs,\n outputs,\n receipts,\n baseAssetId,\n}: GetTransferOperationsParams): Operation[] {\n let operations: Operation[] = [];\n\n const coinOutputs = getOutputsCoin(outputs);\n const contractInputs = getInputsContract(inputs);\n const changeOutputs = getOutputsChange(outputs);\n\n const aggregated = aggregateInputsAmountsByAssetAndOwner(inputs, baseAssetId);\n\n /**\n * Extracting transfer operations between wallets, as they do not produce receipts\n */\n coinOutputs.forEach(({ amount, assetId, to }) => {\n const txPayers = aggregated.get(assetId) || new Map<string, BN>();\n let selectedPayer: string | undefined;\n let fallbackPayer: string | undefined;\n\n for (const [address, payedAmount] of txPayers) {\n if (!fallbackPayer) {\n fallbackPayer = address; // Set the first payer as a fallback\n }\n\n if (payedAmount.gte(amount)) {\n selectedPayer = address;\n break; // Stop looping once a suitable payer is found\n }\n }\n\n // If no suitable payer is found, use the fallback payer\n selectedPayer = selectedPayer || fallbackPayer;\n\n if (selectedPayer) {\n operations = addOperation(operations, {\n name: OperationName.transfer,\n from: {\n type: AddressType.account,\n address: selectedPayer,\n },\n to: {\n type: AddressType.account,\n address: to,\n },\n assetsSent: [{ assetId, amount }],\n });\n }\n });\n\n /**\n * `Transfer` receipts are produced from transfers:\n * - Wallet to Contract\n * - Contract to Contract\n */\n const transferReceipts = getReceiptsByType<TransactionResultTransferReceipt>(\n receipts,\n ReceiptType.Transfer\n );\n\n /**\n * `TransferOut` receipts are produced from transfer:\n * - Contract to Wallet\n */\n const transferOutReceipts = getReceiptsByType<TransactionResultTransferOutReceipt>(\n receipts,\n ReceiptType.TransferOut\n );\n\n [...transferReceipts, ...transferOutReceipts].forEach((receipt) => {\n const operation = extractTransferOperationFromReceipt(receipt, contractInputs, changeOutputs);\n\n operations = addOperation(operations, operation);\n });\n\n return operations;\n}\n\n/** @hidden */\nexport function getPayProducerOperations(outputs: Output[]): Operation[] {\n const coinOutputs = getOutputsCoin(outputs);\n const payProducerOperations = coinOutputs.reduce((prev, output) => {\n const operations = addOperation(prev, {\n name: OperationName.payBlockProducer,\n from: {\n type: AddressType.account,\n address: 'Network',\n },\n to: {\n type: AddressType.account,\n address: output.to.toString(),\n },\n assetsSent: [\n {\n assetId: output.assetId.toString(),\n amount: output.amount,\n },\n ],\n });\n\n return operations;\n }, [] as Operation[]);\n\n return payProducerOperations;\n}\n\n/** @hidden */\nexport function getContractCreatedOperations({ inputs, outputs }: InputOutputParam): Operation[] {\n const contractCreatedOutputs = getOutputsContractCreated(outputs);\n const input = getInputsCoinAndMessage(inputs)[0];\n const fromAddress = getInputAccountAddress(input);\n const contractCreatedOperations = contractCreatedOutputs.reduce((prev, contractCreatedOutput) => {\n const operations = addOperation(prev, {\n name: OperationName.contractCreated,\n from: {\n type: AddressType.account,\n address: fromAddress,\n },\n to: {\n type: AddressType.contract,\n address: contractCreatedOutput?.contractId || '',\n },\n });\n\n return operations;\n }, [] as Operation[]);\n\n return contractCreatedOperations;\n}\n\n/** @hidden */\nexport function getOperations({\n transactionType,\n inputs,\n outputs,\n receipts,\n abiMap,\n rawPayload,\n maxInputs,\n baseAssetId,\n}: GetOperationParams): Operation[] {\n if (isTypeCreate(transactionType)) {\n return [...getContractCreatedOperations({ inputs, outputs })];\n }\n\n if (isTypeScript(transactionType)) {\n return [\n ...getTransferOperations({ inputs, outputs, receipts, baseAssetId }),\n ...getContractCallOperations({\n inputs,\n outputs,\n receipts,\n abiMap,\n rawPayload,\n maxInputs,\n baseAssetId,\n }),\n ...getWithdrawFromFuelOperations({ inputs, receipts, baseAssetId }),\n ];\n }\n // at this point we are sure it's a mint transaction\n return [...getPayProducerOperations(outputs)];\n}\n","import { Interface, type JsonAbi } from '@fuel-ts/abi-coder';\nimport type { BN } from '@fuel-ts/math';\nimport type { ReceiptCall } from '@fuel-ts/transactions';\n\ntype GetFunctionCallProps = {\n abi: JsonAbi;\n receipt: ReceiptCall;\n rawPayload?: string;\n maxInputs: BN;\n};\n\nexport interface FunctionCall {\n amount?: BN | undefined;\n assetId?: string | undefined;\n functionSignature: string;\n functionName: string;\n argumentsProvided: Record<string, unknown> | undefined;\n}\n\nexport const getFunctionCall = ({ abi, receipt }: GetFunctionCallProps): FunctionCall => {\n const abiInterface = new Interface(abi);\n const callFunctionSelector = receipt.param1.toHex(8);\n const functionFragment = abiInterface.getFunction(callFunctionSelector);\n const inputs = functionFragment.jsonFn.inputs;\n\n const encodedArgs = receipt.param2.toHex();\n let argumentsProvided;\n\n // use bytes got from rawPayload to decode function params\n const data = functionFragment.decodeArguments(encodedArgs);\n if (data) {\n // put together decoded data with input names from abi\n argumentsProvided = inputs.reduce((prev, input, index) => {\n const value = data[index];\n const name = input.name;\n\n if (name) {\n return {\n ...prev,\n // reparse to remove bn\n [name]: JSON.parse(JSON.stringify(value)),\n };\n }\n\n return prev;\n }, {});\n }\n\n const call = {\n functionSignature: functionFragment.signature,\n functionName: functionFragment.name,\n argumentsProvided,\n ...(receipt.amount?.isZero() ? {} : { amount: receipt.amount, assetId: receipt.assetId }),\n };\n\n return call;\n};\n","import { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { BN } from '@fuel-ts/math';\nimport type { Input, InputCoin, InputContract, InputMessage } from '@fuel-ts/transactions';\nimport { InputType } from '@fuel-ts/transactions';\n\n/** @hidden */\nexport function getInputsByTypes<T = Input>(inputs: Input[], types: Array<InputType>) {\n return inputs.filter((i) => types.includes(i.type)) as T[];\n}\n\n/** @hidden */\nexport function getInputsByType<T = Input>(inputs: Input[], type: InputType) {\n return inputs.filter((i) => i.type === type) as T[];\n}\n\n/** @hidden */\nexport function getInputsCoin(inputs: Input[]): InputCoin[] {\n return getInputsByType<InputCoin>(inputs, InputType.Coin);\n}\n\n/** @hidden */\nexport function getInputsMessage(inputs: Input[]) {\n return getInputsByType<InputMessage>(inputs, InputType.Message);\n}\n\n/** @hidden */\nexport function getInputsCoinAndMessage(inputs: Input[]) {\n return getInputsByTypes<InputCoin | InputMessage>(inputs, [InputType.Coin, InputType.Message]);\n}\n\n/** @hidden */\nexport function isInputCoin(input: Input): input is InputCoin {\n return input.type === InputType.Coin;\n}\n\n/** @hidden */\nexport function getInputsContract(inputs: Input[]) {\n return getInputsByType<InputContract>(inputs, InputType.Contract);\n}\n\n/** @hidden */\nfunction findCoinInput(inputs: Input[], assetId: string): InputCoin | undefined {\n const coinInputs = getInputsCoin(inputs);\n return coinInputs.find((i) => i.assetId === assetId);\n}\n\n/** @hidden */\nexport function aggregateInputsAmountsByAssetAndOwner(\n inputs: Input[],\n baseAssetId: string\n): Map<string, Map<string, BN>> {\n const aggregated = new Map<string, Map<string, BN>>();\n\n getInputsCoinAndMessage(inputs).forEach((input) => {\n const assetId = isInputCoin(input) ? input.assetId : baseAssetId;\n const owner = isInputCoin(input) ? input.owner : input.recipient;\n\n // Ensure that the map for the assetId exists\n let ownersMap = aggregated.get(assetId);\n if (!ownersMap) {\n ownersMap = new Map<string, BN>();\n aggregated.set(assetId, ownersMap);\n }\n\n // Ensure that the map for the owner exists\n let ownerBalance = ownersMap.get(owner);\n if (!ownerBalance) {\n ownerBalance = new BN(0);\n ownersMap.set(owner, ownerBalance);\n }\n\n // Update the balance\n ownersMap.set(owner, ownerBalance.add(input.amount));\n });\n\n return aggregated;\n}\n\n/** @hidden */\nfunction findMessageInput(inputs: Input[]): InputMessage | undefined {\n return getInputsMessage(inputs)?.[0];\n}\n/** @hidden */\nexport function getInputFromAssetId(\n inputs: Input[],\n assetId: string,\n isBaseAsset = false\n): InputCoin | InputMessage | undefined {\n const coinInput = findCoinInput(inputs, assetId);\n if (coinInput) {\n return coinInput;\n }\n\n if (isBaseAsset) {\n return findMessageInput(inputs);\n }\n\n // #TODO: we should throw an error here if we are unable to return a valid input\n return undefined;\n}\n\n/** @hidden */\nexport function getInputContractFromIndex(\n inputs: Input[],\n inputIndex: number\n): InputContract | undefined {\n if (inputIndex == null) {\n return undefined;\n }\n\n const contractInput = inputs?.[inputIndex];\n\n if (!contractInput) {\n return undefined;\n }\n if (contractInput.type !== InputType.Contract) {\n throw new FuelError(\n ErrorCode.INVALID_TRANSACTION_INPUT,\n `Contract input should be of type 'contract'.`\n );\n }\n\n return contractInput as InputContract;\n}\n\n/** @hidden */\nexport function getInputAccountAddress(input: Input) {\n if (input.type === InputType.Coin) {\n return input.owner.toString();\n }\n\n if (input.type === InputType.Message) {\n return input.recipient.toString();\n }\n\n return '';\n}\n","import type {\n Output,\n OutputChange,\n OutputCoin,\n OutputContract,\n OutputContractCreated,\n OutputVariable,\n} from '@fuel-ts/transactions';\nimport { OutputType } from '@fuel-ts/transactions';\n\n/** @hidden */\nexport function getOutputsByType<T = Output>(outputs: Output[], type: OutputType) {\n return outputs.filter((o) => o.type === type) as T[];\n}\n\n/** @hidden */\nexport function getOutputsContractCreated(outputs: Output[]) {\n return getOutputsByType<OutputContractCreated>(outputs, OutputType.ContractCreated);\n}\n\n/** @hidden */\nexport function getOutputsCoin(outputs: Output[]) {\n return getOutputsByType<OutputCoin>(outputs, OutputType.Coin);\n}\n\n/** @hidden */\nexport function getOutputsChange(outputs: Output[]) {\n return getOutputsByType<OutputChange>(outputs, OutputType.Change);\n}\n\n/** @hidden */\nexport function getOutputsContract(outputs: Output[]) {\n return getOutputsByType<OutputContract>(outputs, OutputType.Contract);\n}\n\n/** @hidden */\nexport function getOutputsVariable(outputs: Output[]) {\n return getOutputsByType<OutputVariable>(outputs, OutputType.Variable);\n}\n","import type { JsonAbi } from '@fuel-ts/abi-coder';\nimport type { B256Address } from '@fuel-ts/address';\nimport type { BN, BNInput } from '@fuel-ts/math';\nimport type { Input, Output, Transaction, TransactionType } from '@fuel-ts/transactions';\n\nimport type { GqlReceiptFragment, GqlSuccessStatusFragment } from '../__generated__/operations';\nimport type { TransactionResultReceipt } from '../transaction-response';\n\nexport type SubmittedStatus = {\n type: 'SubmittedStatus';\n time: string;\n};\n\nexport type SuccessStatus = {\n type: 'SuccessStatus';\n time: string;\n programState?: GqlSuccessStatusFragment['programState'];\n block?: {\n id: string;\n };\n receipts: GqlReceiptFragment[];\n totalGas: string;\n totalFee: string;\n};\n\nexport type FailureStatus = {\n type: 'FailureStatus';\n time: string;\n reason: string;\n block?: {\n id: string;\n };\n receipts: GqlReceiptFragment[];\n totalGas: string;\n totalFee: string;\n};\n\nexport type SqueezedOutStatus = {\n type: 'SqueezedOutStatus';\n reason: string;\n};\n\nexport type GraphqlTransactionStatus =\n | SubmittedStatus\n | SuccessStatus\n | FailureStatus\n | SqueezedOutStatus\n | null;\n\nexport type GqlTransaction = {\n id: string;\n rawPayload: string;\n status?: GraphqlTransactionStatus;\n};\n\nexport type Reason = FailureStatus['reason'];\nexport type ProgramState = SuccessStatus['programState'];\nexport type Time = SubmittedStatus['time'] | SuccessStatus['time'] | FailureStatus['time'];\nexport type BlockId = string;\n\n/**\n * @hidden\n */\nexport enum TransactionTypeName {\n Create = 'Create',\n Mint = 'Mint',\n Script = 'Script',\n Upgrade = 'Upgrade',\n Upload = 'Upload',\n Blob = 'Blob',\n}\n\n/**\n * @hidden\n */\nexport enum TransactionStatus {\n submitted = 'submitted',\n success = 'success',\n squeezedout = 'squeezedout',\n failure = 'failure',\n}\n\n/**\n * @hidden\n */\nexport type GqlTransactionStatusesNames =\n | 'FailureStatus'\n | 'SubmittedStatus'\n | 'SuccessStatus'\n | 'SqueezedOutStatus';\n\n/**\n * @hidden\n */\nexport enum OperationName {\n payBlockProducer = 'Pay network fee to block producer',\n contractCreated = 'Contract created',\n transfer = 'Transfer asset',\n contractCall = 'Contract call',\n receive = 'Receive asset',\n withdrawFromFuel = 'Withdraw from Fuel',\n}\n\nexport type OperationCoin = {\n assetId: string;\n amount: BNInput;\n};\n\nexport type OperationFunctionCall = {\n functionSignature: string;\n functionName: string;\n argumentsProvided?: Record<string, unknown>;\n} & Partial<OperationCoin>;\n\nexport type Operation = {\n name?: OperationName;\n from?: OperationTransactionAddress;\n to?: OperationTransactionAddress;\n assetsSent?: Array<OperationCoin>;\n calls?: Array<OperationFunctionCall>;\n};\n\n/**\n * @hidden\n */\nexport enum AddressType {\n contract,\n account,\n}\n\n/**\n * @hidden\n */\nexport enum ChainName {\n ethereum = 'ethereum',\n fuel = 'fuel',\n}\n\nexport type OperationTransactionAddress = {\n address: string;\n type: AddressType;\n chain?: ChainName;\n};\n\nexport type InputParam = {\n inputs: Input[];\n};\n\nexport type OutputParam = {\n outputs: Output[];\n};\n\nexport type ReceiptParam = {\n receipts: TransactionResultReceipt[];\n};\n\nexport type AbiMap = Record<string, JsonAbi>;\n\nexport type RawPayloadParam = {\n rawPayload?: string;\n};\n\nexport type InputOutputParam = InputParam & OutputParam;\n\nexport interface GetTransferOperationsParams extends InputOutputParam {\n receipts: TransactionResultReceipt[];\n baseAssetId: string;\n}\n\nexport type GetOperationParams = {\n transactionType: TransactionType;\n abiMap?: AbiMap;\n maxInputs: BN;\n baseAssetId: string;\n} & InputOutputParam &\n ReceiptParam &\n RawPayloadParam;\n\nexport interface MintedAsset {\n subId: B256Address;\n contractId: B256Address;\n assetId: B256Address;\n amount: BN;\n}\n\nexport type BurnedAsset = MintedAsset;\n\nexport type TransactionSummary<TTransactionType = void> = {\n id: string;\n time?: string;\n operations: Operation[];\n gasUsed: BN;\n tip: BN;\n fee: BN;\n type: TransactionTypeName;\n blockId?: BlockId;\n status?: TransactionStatus;\n isTypeMint: boolean;\n isTypeCreate: boolean;\n isTypeScript: boolean;\n isTypeUpgrade: boolean;\n isTypeUpload: boolean;\n isTypeBlob: boolean;\n isStatusPending: boolean;\n isStatusSuccess: boolean;\n isStatusFailure: boolean;\n mintedAssets: MintedAsset[];\n burnedAssets: BurnedAsset[];\n date?: Date;\n receipts: TransactionResultReceipt[];\n transaction: Transaction<TTransactionType>;\n};\n","import { ReceiptType } from '@fuel-ts/transactions';\n\nimport type { GqlReceiptFragment } from '../__generated__/operations';\nimport type { TransactionResultReceipt } from '../transaction-response';\nimport { assembleReceiptByType } from '../utils';\n\nimport type { BurnedAsset, MintedAsset } from './types';\n\nexport const processGqlReceipt = (gqlReceipt: GqlReceiptFragment): TransactionResultReceipt =>\n assembleReceiptByType(gqlReceipt);\n\nexport const extractMintedAssetsFromReceipts = (\n receipts: Array<TransactionResultReceipt>\n): MintedAsset[] => {\n const mintedAssets: MintedAsset[] = [];\n\n receipts.forEach((receipt) => {\n if (receipt.type === ReceiptType.Mint) {\n mintedAssets.push({\n subId: receipt.subId,\n contractId: receipt.contractId,\n assetId: receipt.assetId,\n amount: receipt.val,\n });\n }\n });\n\n return mintedAssets;\n};\n\nexport const extractBurnedAssetsFromReceipts = (\n receipts: Array<TransactionResultReceipt>\n): BurnedAsset[] => {\n const burnedAssets: BurnedAsset[] = [];\n\n receipts.forEach((receipt) => {\n if (receipt.type === ReceiptType.Burn) {\n burnedAssets.push({\n subId: receipt.subId,\n contractId: receipt.contractId,\n assetId: receipt.assetId,\n amount: receipt.val,\n });\n }\n });\n\n return burnedAssets;\n};\n","import { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport type { BN } from '@fuel-ts/math';\nimport { bn } from '@fuel-ts/math';\n\nimport { TransactionStatus } from './types';\nimport type {\n BlockId,\n GqlTransactionStatusesNames,\n GraphqlTransactionStatus,\n Time,\n TransactionSummary,\n} from './types';\n\n/** @hidden */\nexport const getTransactionStatusName = (gqlStatus: GqlTransactionStatusesNames) => {\n switch (gqlStatus) {\n case 'FailureStatus':\n return TransactionStatus.failure;\n case 'SuccessStatus':\n return TransactionStatus.success;\n case 'SubmittedStatus':\n return TransactionStatus.submitted;\n case 'SqueezedOutStatus':\n return TransactionStatus.squeezedout;\n default:\n throw new FuelError(\n ErrorCode.INVALID_TRANSACTION_STATUS,\n `Invalid transaction status: ${gqlStatus}.`\n );\n }\n};\n\ntype IProcessGraphqlStatusResponse = Pick<\n TransactionSummary,\n 'time' | 'blockId' | 'isStatusPending' | 'isStatusSuccess' | 'isStatusFailure' | 'status'\n> & { totalFee?: BN; totalGas?: BN };\n\n/** @hidden */\nexport const processGraphqlStatus = (gqlTransactionStatus?: GraphqlTransactionStatus) => {\n let time: Time | undefined;\n let blockId: BlockId | undefined;\n let status: TransactionStatus | undefined;\n let totalFee: BN | undefined;\n let totalGas: BN | undefined;\n\n let isStatusFailure = false;\n let isStatusSuccess = false;\n let isStatusPending = false;\n\n if (gqlTransactionStatus?.type) {\n status = getTransactionStatusName(gqlTransactionStatus.type);\n\n switch (gqlTransactionStatus.type) {\n case 'SuccessStatus':\n time = gqlTransactionStatus.time;\n blockId = gqlTransactionStatus.block?.id;\n isStatusSuccess = true;\n totalFee = bn(gqlTransactionStatus.totalFee);\n totalGas = bn(gqlTransactionStatus.totalGas);\n break;\n\n case 'FailureStatus':\n time = gqlTransactionStatus.time;\n blockId = gqlTransactionStatus.block?.id;\n isStatusFailure = true;\n totalFee = bn(gqlTransactionStatus.totalFee);\n totalGas = bn(gqlTransactionStatus.totalGas);\n break;\n\n case 'SubmittedStatus':\n time = gqlTransactionStatus.time;\n isStatusPending = true;\n break;\n default:\n }\n }\n\n const processedGraphqlStatus: IProcessGraphqlStatusResponse = {\n time,\n blockId,\n status,\n totalFee,\n totalGas,\n isStatusFailure,\n isStatusSuccess,\n isStatusPending,\n };\n\n return processedGraphqlStatus;\n};\n\n/**\n * Returns the total fee from the transaction status.\n *\n * @param status - The transaction status.\n * @returns The total fee from the transaction status or undefined.\n */\nexport const getTotalFeeFromStatus = (status?: GraphqlTransactionStatus): BN | undefined =>\n status && 'totalFee' in status ? bn(status.totalFee) : undefined;\n","import type { JsonAbi } from '@fuel-ts/abi-coder';\nimport { Interface, BigNumberCoder } from '@fuel-ts/abi-coder';\nimport { ReceiptType } from '@fuel-ts/transactions';\n\nimport type { TransactionResultReceipt } from './transaction-response';\n\n/** @hidden */\nexport function getDecodedLogs<T = unknown>(\n receipts: Array<TransactionResultReceipt>,\n mainAbi: JsonAbi,\n externalAbis: Record<string, JsonAbi> = {}\n): T[] {\n /**\n * This helper decodes logs from transaction receipts.\n * It loops through all receipts and decodes two types of logs:\n * - ReceiptType.LogData\n * - ReceiptType.Log\n *\n * The \"mainAbi\" parameter represents the ABI of the main contract used to create the transaction\n * or the ABI from a script used within a \"BaseInvocationScope\" context.\n * The \"externalAbis\" parameter is a record of contract ABIs that are also part of the transaction.\n * These ABIs were added using `contract.addContracts` or through a multicall with `contract.multiCall`.\n *\n * @param receipts - The array of transaction result receipts.\n * @param mainAbi - The ABI of the script or main contract.\n * @param externalAbis - The record of external contract ABIs.\n * @returns An array of decoded logs from Sway projects.\n */\n return receipts.reduce((logs: T[], receipt) => {\n if (receipt.type === ReceiptType.LogData || receipt.type === ReceiptType.Log) {\n const interfaceToUse = new Interface(externalAbis[receipt.id] || mainAbi);\n\n const data =\n receipt.type === ReceiptType.Log\n ? new BigNumberCoder('u64').encode(receipt.ra)\n : receipt.data;\n\n const [decodedLog] = interfaceToUse.decodeLog(data, receipt.rb.toString());\n logs.push(decodedLog);\n }\n\n return logs;\n }, []);\n}\n","import { sleep } from '@fuel-ts/utils';\n\nimport type { ProviderOptions } from '../provider';\n\ntype Backoff = 'linear' | 'exponential' | 'fixed';\n\n/**\n * Retry options scheme\n */\nexport type RetryOptions = {\n /**\n * Amount of attempts to retry before failing the call.\n */\n maxRetries: number;\n /**\n * Backoff strategy to use when retrying. Default is exponential.\n */\n backoff?: Backoff;\n /**\n * Starting delay for backoff strategy. Default is 150ms.\n */\n baseDelay?: number;\n};\n\n/**\n * Calculate the delay for the next retry attempt\n * @param options - Retry options configuration\n * @param retryAttemptNum - 1-based, tells which retry attempt is this\n * @returns Next wait delay\n */\nexport function getWaitDelay(options: RetryOptions, retryAttemptNum: number) {\n const duration = options.baseDelay ?? 150;\n\n switch (options.backoff) {\n case 'linear':\n return duration * retryAttemptNum;\n case 'fixed':\n return duration;\n case 'exponential':\n default:\n return 2 ** (retryAttemptNum - 1) * duration;\n }\n}\n\n/**\n * Returns a wrapped fetch function that will auto-execute itself in case of errors, until it succeeds\n * @param fetchFn - Function to be auto-retried\n * @param options - Retry options configuration\n * @param retryAttemptNum - ZERO=first call, ONE=first retry, TWO=second retry, etc.\n * @returns Whatever is the output of the `fetchFn` function\n */\nexport function autoRetryFetch(\n fetchFn: NonNullable<ProviderOptions['fetch']>,\n options?: RetryOptions,\n retryAttemptNum: number = 0\n): NonNullable<ProviderOptions['fetch']> {\n if (options === undefined) {\n return fetchFn;\n }\n\n return async (...args) => {\n try {\n return await fetchFn(...args);\n } catch (_error: unknown) {\n const error = _error as Error & { cause?: { code: string } };\n\n /**\n * So far, we are auto-retrying only for `ECONNREFUSED` error.\n * TODO: Investigate if we should consider more errors.\n */\n if (error.cause?.code !== 'ECONNREFUSED') {\n throw error;\n }\n const retryNum = retryAttemptNum + 1;\n\n if (retryNum > options.maxRetries) {\n throw error;\n }\n\n const delay = getWaitDelay(options, retryNum);\n\n await sleep(delay);\n\n return autoRetryFetch(fetchFn, options, retryNum)(...args);\n }\n };\n}\n","import { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport type { GraphQLError } from 'graphql';\n\nexport enum GqlErrorMessage {\n NOT_ENOUGH_COINS = 'not enough coins to fit the target',\n MAX_COINS_REACHED = 'max number of coins is reached while trying to fit the target',\n}\n\nexport const handleGqlErrorMessage = (errorMessage: string, rawError: GraphQLError) => {\n switch (errorMessage) {\n case GqlErrorMessage.NOT_ENOUGH_COINS:\n throw new FuelError(\n ErrorCode.NOT_ENOUGH_FUNDS,\n `The account(s) sending the transaction don't have enough funds to cover the transaction.`,\n {},\n rawError\n );\n case GqlErrorMessage.MAX_COINS_REACHED:\n throw new FuelError(\n ErrorCode.MAX_COINS_REACHED,\n 'The account retrieving coins has exceeded the maximum number of coins per asset. Please consider combining your coins into a single UTXO.',\n {},\n rawError\n );\n default:\n throw new FuelError(ErrorCode.INVALID_REQUEST, errorMessage);\n }\n};\n","import { FuelError, ErrorCode } from '@fuel-ts/errors';\n\nimport type { CursorPaginationArgs } from '../provider';\n\n/**\n * @hidden\n */\nexport const validatePaginationArgs = (params: {\n inputArgs?: CursorPaginationArgs;\n paginationLimit: number;\n}): CursorPaginationArgs => {\n const { paginationLimit, inputArgs = {} } = params;\n const { first, last, after, before } = inputArgs;\n\n if (after && before) {\n throw new FuelError(\n ErrorCode.INVALID_INPUT_PARAMETERS,\n 'Pagination arguments \"after\" and \"before\" cannot be used together'\n );\n }\n\n if ((first || 0) > paginationLimit || (last || 0) > paginationLimit) {\n throw new FuelError(\n ErrorCode.INVALID_INPUT_PARAMETERS,\n `Pagination limit for this query cannot exceed ${paginationLimit} items`\n );\n }\n\n if (first && before) {\n throw new FuelError(\n ErrorCode.INVALID_INPUT_PARAMETERS,\n 'The use of pagination argument \"first\" with \"before\" is not supported'\n );\n }\n\n if (last && after) {\n throw new FuelError(\n ErrorCode.INVALID_INPUT_PARAMETERS,\n 'The use of pagination argument \"last\" with \"after\" is not supported'\n );\n }\n\n // If neither first nor last is provided, set a default first value\n if (!first && !last) {\n inputArgs.first = paginationLimit;\n }\n\n return inputArgs;\n};\n","import { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { bn } from '@fuel-ts/math';\nimport { TransactionCoder } from '@fuel-ts/transactions';\nimport { arrayify } from '@fuel-ts/utils';\n\nimport type {\n GqlGetTransactionsByOwnerQueryVariables,\n GqlReceiptFragment,\n} from '../__generated__/operations';\nimport type Provider from '../provider';\nimport { TRANSACTIONS_PAGE_SIZE_LIMIT, type PageInfo } from '../provider';\nimport type { TransactionRequest } from '../transaction-request';\nimport type { TransactionResult } from '../transaction-response';\nimport { validatePaginationArgs } from '../utils/validate-pagination-args';\n\nimport { assembleTransactionSummary } from './assemble-transaction-summary';\nimport { processGqlReceipt } from './receipt';\nimport { getTotalFeeFromStatus } from './status';\nimport type { AbiMap, TransactionSummary } from './types';\n/** @hidden */\nexport interface GetTransactionSummaryParams {\n id: string;\n provider: Provider;\n abiMap?: AbiMap;\n}\n\nexport async function getTransactionSummary<TTransactionType = void>(\n params: GetTransactionSummaryParams\n): Promise<TransactionResult> {\n const { id, provider, abiMap } = params;\n\n const { transaction: gqlTransaction } = await provider.operations.getTransactionWithReceipts({\n transactionId: id,\n });\n\n if (!gqlTransaction) {\n throw new FuelError(\n ErrorCode.TRANSACTION_NOT_FOUND,\n `Transaction not found for given id: ${id}.`\n );\n }\n\n const [decodedTransaction] = new TransactionCoder().decode(\n arrayify(gqlTransaction.rawPayload),\n 0\n );\n\n let txReceipts: GqlReceiptFragment[] = [];\n\n if (gqlTransaction?.status && 'receipts' in gqlTransaction.status) {\n txReceipts = gqlTransaction.status.receipts;\n }\n\n const receipts = txReceipts.map(processGqlReceipt);\n\n const {\n consensusParameters: {\n feeParameters: { gasPerByte, gasPriceFactor },\n txParameters: { maxInputs, maxGasPerTx },\n gasCosts,\n },\n } = await provider.getChain();\n\n // If we have the total fee, we do not need to refetch the gas price\n const totalFee = getTotalFeeFromStatus(gqlTransaction.status);\n const gasPrice = totalFee ? bn(0) : await provider.getLatestGasPrice();\n\n const baseAssetId = await provider.getBaseAssetId();\n\n const transactionInfo = assembleTransactionSummary<TTransactionType>({\n id: gqlTransaction.id,\n receipts,\n transaction: decodedTransaction,\n transactionBytes: arrayify(gqlTransaction.rawPayload),\n gqlTransactionStatus: gqlTransaction.status,\n gasPerByte: bn(gasPerByte),\n gasPriceFactor: bn(gasPriceFactor),\n abiMap,\n maxInputs,\n gasCosts,\n maxGasPerTx,\n gasPrice,\n baseAssetId,\n });\n\n return {\n ...transactionInfo,\n };\n}\n\nexport interface GetTransactionSummaryFromRequestParams {\n transactionRequest: TransactionRequest;\n provider: Provider;\n abiMap?: AbiMap;\n}\n\n/** @hidden */\nexport async function getTransactionSummaryFromRequest<TTransactionType = void>(\n params: GetTransactionSummaryFromRequestParams\n): Promise<TransactionSummary<TTransactionType>> {\n const { provider, transactionRequest, abiMap } = params;\n\n const { receipts } = await provider.dryRun(transactionRequest);\n\n const { gasPerByte, gasPriceFactor, gasCosts, maxGasPerTx } = await provider.getGasConfig();\n const maxInputs = (await provider.getChain()).consensusParameters.txParameters.maxInputs;\n\n const transaction = transactionRequest.toTransaction();\n const transactionBytes = transactionRequest.toTransactionBytes();\n\n const gasPrice = await provider.getLatestGasPrice();\n const baseAssetId = await provider.getBaseAssetId();\n\n const transactionSummary = assembleTransactionSummary<TTransactionType>({\n id: transactionRequest.getTransactionId(await provider.getChainId()),\n receipts,\n transaction,\n transactionBytes,\n abiMap,\n gasPerByte,\n gasPriceFactor,\n maxInputs,\n gasCosts,\n maxGasPerTx,\n gasPrice,\n baseAssetId,\n });\n\n return transactionSummary;\n}\n\nexport interface GetTransactionsSummariesParams {\n provider: Provider;\n filters: GqlGetTransactionsByOwnerQueryVariables;\n abiMap?: AbiMap;\n}\n\nexport interface GetTransactionsSummariesReturns {\n transactions: TransactionResult[];\n pageInfo: PageInfo;\n}\n\n/**\n * Gets transaction summaries for a given owner/address.\n *\n * @param params - The filters to apply to the query.\n * @returns The transaction summaries.\n */\nexport async function getTransactionsSummaries(\n params: GetTransactionsSummariesParams\n): Promise<GetTransactionsSummariesReturns> {\n const { filters, provider, abiMap } = params;\n\n const { owner, ...inputArgs } = filters;\n\n const validPaginationParams = validatePaginationArgs({\n inputArgs,\n paginationLimit: TRANSACTIONS_PAGE_SIZE_LIMIT,\n });\n\n const { transactionsByOwner } = await provider.operations.getTransactionsByOwner({\n ...validPaginationParams,\n owner,\n });\n\n const { edges, pageInfo } = transactionsByOwner;\n\n const {\n consensusParameters: {\n feeParameters: { gasPerByte, gasPriceFactor },\n txParameters: { maxInputs, maxGasPerTx },\n gasCosts,\n },\n } = await provider.getChain();\n\n const gasPrice = await provider.getLatestGasPrice();\n const baseAssetId = await provider.getBaseAssetId();\n\n const transactions = edges.map((edge) => {\n const { node: gqlTransaction } = edge;\n\n const { id, rawPayload, status } = gqlTransaction;\n\n const [decodedTransaction] = new TransactionCoder().decode(arrayify(rawPayload), 0);\n\n let txReceipts: GqlReceiptFragment[] = [];\n\n if (gqlTransaction?.status && 'receipts' in gqlTransaction.status) {\n txReceipts = gqlTransaction.status.receipts;\n }\n\n const receipts = txReceipts.map(processGqlReceipt);\n\n const transactionSummary = assembleTransactionSummary({\n id,\n receipts,\n transaction: decodedTransaction,\n transactionBytes: arrayify(rawPayload),\n gqlTransactionStatus: status,\n abiMap,\n gasPerByte,\n gasPriceFactor,\n maxInputs,\n gasCosts,\n maxGasPerTx,\n gasPrice,\n baseAssetId,\n });\n\n const output: TransactionResult = {\n ...transactionSummary,\n };\n\n return output;\n });\n\n return {\n transactions,\n pageInfo,\n };\n}\n","export const CHAIN_IDS = {\n eth: {\n mainnet: 1,\n sepolia: 11155111,\n foundry: 31337,\n },\n fuel: {\n devnet: 0,\n testnet: 0,\n mainnet: 9889,\n },\n};\n","import { CHAIN_IDS } from '../../chains';\nimport type { Asset, AssetEth, AssetFuel, NetworkEthereum, NetworkFuel } from '../types';\n\ntype Network = NetworkEthereum | NetworkFuel;\nexport type NetworkTypes = NetworkEthereum['type'] | NetworkFuel['type'];\ntype NetworkTypeToNetwork<T> = T extends 'ethereum' ? NetworkEthereum : T extends 'fuel' ? NetworkFuel : Network;\n\n/**\n * Returns the default chainId for the given network\n*/\nexport const getDefaultChainId = (networkType: NetworkTypes): number | undefined => {\n if (networkType === 'ethereum') {\n return CHAIN_IDS.eth.sepolia;\n }\n if (networkType === 'fuel') {\n return CHAIN_IDS.fuel.testnet;\n }\n\n return undefined;\n};\n\nexport type GetAssetNetworkParams<T extends NetworkTypes | undefined> = {\n asset: Asset;\n chainId?: number;\n networkType: T;\n};\n\n/**\n * Returns the asset's network on the given network\n * eg. getAssetNetwork({ asset, chainId: 1, networkType: 'ethereum' }) will return the asset's details on Ethereum mainnet\n*/\nexport const getAssetNetwork = <T extends NetworkTypes | undefined>({\n asset,\n chainId,\n networkType,\n}: GetAssetNetworkParams<T>): NetworkTypeToNetwork<T> => {\n const network = asset.networks.find(\n (item) => item.chainId === chainId && item.type === networkType\n ) as NetworkTypeToNetwork<T>;\n\n return network;\n};\n\n/**\n * Returns the asset's details on the given network alongwith the asset itself\n * eg. getAssetWithNetwork({ asset, chainId: 1, networkType: 'ethereum' }) will return the asset's details on Ethereum mainnet and the asset itself\n*/\nexport const getAssetWithNetwork = <T extends NetworkTypes>({\n asset,\n chainId,\n networkType,\n}: GetAssetNetworkParams<T>): AssetEth | AssetFuel | undefined => {\n const { networks: _, ...assetRest } = asset;\n\n const chainIdToUse = chainId ?? getDefaultChainId(networkType);\n // use two equals(==) cuz we wan't to keep 0 as a valid chainId\n if (chainIdToUse === undefined) {\n return undefined;\n }\n\n const assetNetwork = getAssetNetwork({\n asset,\n chainId: chainIdToUse,\n networkType,\n });\n\n if (!assetNetwork) {\n return undefined;\n }\n\n return {\n ...assetRest,\n ...assetNetwork,\n };\n};\n\n/**\n * Returns the asset's details on Ethereum\n*/\nexport const getAssetEth = (asset: Asset, chainId?: number): AssetEth | undefined =>\n getAssetWithNetwork({\n asset,\n networkType: 'ethereum',\n chainId,\n }) as AssetEth;\n\n/**\n * Returns the asset's details on Fuel\n*/\nexport const getAssetFuel = (asset: Asset, chainId?: number): AssetFuel | undefined =>\n getAssetWithNetwork({\n asset,\n networkType: 'fuel',\n chainId,\n }) as AssetFuel;\n","const DELIMITER_PATH = '/';\nconst trimRegex = /^\\/|\\/$/g;\nconst trimPath = (path = '') => path.replace(trimRegex, '');\n\nexport function urlJoin(baseUrl: string | undefined, ...paths: Array<string>): string {\n const hasBaseUrl = baseUrl !== null && baseUrl !== undefined;\n const rootPath = baseUrl?.[0] === '/' && baseUrl.length > 1;\n const allPaths = [baseUrl, ...paths].filter(Boolean).map(trimPath);\n if (rootPath && hasBaseUrl) {\n allPaths.unshift('');\n }\n return allPaths.join(DELIMITER_PATH);\n}\n","import type { Assets } from '../types';\n\nimport { urlJoin } from './url';\n\n/**\n * Returns the list of assets with the icon paths 'resolved'. eg. `./eth.svg` -> `https://some-url.com/eth.svg`\n * @param assets - List of assets\n * @param basePath - Base path for the icon URLs (default: './')\n * @returns The assets with the icon paths resolved\n */\nexport function resolveIconPaths(assets: Assets, basePath: string = './') {\n return assets.map((asset) => ({\n ...asset,\n icon: urlJoin(basePath, asset.icon),\n }));\n}\n","export const fuelAssetsBaseUrl = 'https://cdn.fuel.network/assets/'\n","import { CHAIN_IDS } from '../chains';\n\nimport type { Assets } from './types';\nimport { resolveIconPaths, fuelAssetsBaseUrl } from './utils';\n\nexport const rawAssets: Assets = [\n {\n name: 'Ethereum',\n symbol: 'ETH',\n icon: 'eth.svg',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.sepolia,\n decimals: 18,\n },\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.foundry,\n decimals: 18,\n },\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.devnet,\n decimals: 9,\n assetId: '0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07',\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.testnet,\n decimals: 9,\n assetId: '0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07'\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n decimals: 9,\n assetId: '0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07',\n }\n ],\n },\n {\n name: 'WETH',\n symbol: 'WETH',\n icon: 'weth.svg',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId:\n '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId:\n '0xa38a5a8beeb08d95744bc7f58528073f4052b254def59eba20c99c202b5acaa3',\n decimals: 9,\n },\n ],\n },\n {\n name: 'weETH',\n symbol: 'weETH',\n icon: 'weETH.webp',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0xCd5fE23C85820F7B72D0926FC9b05b43E359b7ee',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId:\n '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId:\n '0x239ed6e12b7ce4089ee245244e3bf906999a6429c2a9a445a1e1faf56914a4ab',\n decimals: 9,\n },\n ],\n },\n {\n name: 'rsETH',\n symbol: 'rsETH',\n icon: 'rsETH.webp',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0xA1290d69c65A6Fe4DF752f95823fae25cB99e5A7',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId:\n '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId:\n '0xbae80f7fb8aa6b90d9b01ef726ec847cc4f59419c4d5f2ea88fec785d1b0e849',\n decimals: 9,\n },\n ],\n },\n {\n name: 'rETH',\n symbol: 'rETH',\n icon: 'reth.svg',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0xae78736cd615f374d3085123a210448e74fc6393',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId:\n '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId:\n '0xf3f9a0ed0ce8eac5f89d6b83e41b3848212d5b5f56108c54a205bb228ca30c16',\n decimals: 9,\n },\n ],\n },\n {\n name: 'wbETH',\n symbol: 'wbETH',\n icon: 'wbeth.png',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0xa2E3356610840701BDf5611a53974510Ae27E2e1',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId:\n '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId:\n '0x7843c74bef935e837f2bcf67b5d64ecb46dd53ff86375530b0caf3699e8ffafe',\n decimals: 9,\n },\n ],\n },\n {\n name: 'rstETH',\n symbol: 'rstETH',\n icon: 'rstETH.webp',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0x7a4EffD87C2f3C55CA251080b1343b605f327E3a',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId:\n '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId:\n '0x962792286fbc9b1d5860b4551362a12249362c21594c77abf4b3fe2bbe8d977a',\n decimals: 9,\n },\n ],\n },\n {\n name: 'amphrETH',\n symbol: 'amphrETH',\n icon: 'amphrETH.png',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0x5fD13359Ba15A84B76f7F87568309040176167cd',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId:\n '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId:\n '0x05fc623e57bd7bc1258efa8e4f62b05af5471d73df6f2c2dc11ecc81134c4f36',\n decimals: 9,\n },\n ],\n },\n {\n name: 'Manta mBTC',\n symbol: 'Manta mBTC',\n icon: 'manta-mbtc.svg',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0x4041381e947CFD3D483d67a25C6aa9Dc924250c5',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId:\n '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId:\n '0xaf3111a248ff7a3238cdeea845bb2d43cf3835f1f6b8c9d28360728b55b9ce5b',\n decimals: 9,\n },\n ],\n },\n {\n name: 'Manta mETH',\n symbol: 'Manta mETH',\n icon: 'manta-meth.svg',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0x8CdF550C04Bc9B9F10938368349C9c8051A772b6',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId:\n '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId:\n '0xafd219f513317b1750783c6581f55530d6cf189a5863fd18bd1b3ffcec1714b4',\n decimals: 9,\n },\n ],\n },\n {\n name: 'Manta mUSD',\n symbol: 'Manta mUSD',\n icon: 'manta-musd.svg',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0x3f24E1d7a973867fC2A03fE199E5502514E0e11E',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId:\n '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId:\n '0x89cb9401e55d49c3269654dd1cdfb0e80e57823a4a7db98ba8fc5953b120fef4',\n decimals: 9,\n },\n ],\n },\n {\n name: 'pumpBTC',\n symbol: 'pumpBTC',\n icon: 'pumpbtc.webp',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0xf469fbd2abcd6b9de8e169d128226c0fc90a012e',\n decimals: 8,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId:\n '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId:\n '0x0aa5eb2bb97ca915288b653a2529355d4dc66de2b37533213f0e4aeee3d3421f',\n decimals: 8,\n },\n ],\n },\n {\n name: 'FBTC',\n symbol: 'FBTC',\n icon: 'fbtc.svg',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0xc96de26018a54d51c097160568752c4e3bd6c364',\n decimals: 8,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId:\n '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId:\n '0xb5ecb0a1e08e2abbabf624ffea089df933376855f468ade35c6375b00c33996a',\n decimals: 8,\n },\n ],\n },\n {\n name: 'SolvBTC',\n symbol: 'SolvBTC',\n icon: 'solvBTC.webp',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0x7a56e1c57c7475ccf742a1832b028f0456652f97',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId:\n '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId:\n '0x1186afea9affb88809c210e13e2330b5258c2cef04bb8fff5eff372b7bd3f40f',\n decimals: 9,\n },\n ],\n },\n {\n name: 'SolvBTC.BBN',\n symbol: 'SolvBTC.BBN',\n icon: 'SolvBTC.BBN.png',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0xd9d920aa40f578ab794426f5c90f6c731d159def',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId:\n '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId:\n '0x7a4f087c957d30218223c2baaaa365355c9ca81b6ea49004cfb1590a5399216f',\n decimals: 9,\n },\n ],\n },\n {\n name: 'Mantle mETH',\n symbol: 'Mantle mETH',\n icon: 'mantle-meth.svg',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0xd5F7838F5C461fefF7FE49ea5ebaF7728bB0ADfa',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId:\n '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId:\n '0x642a5db59ec323c2f846d4d4cf3e58d78aff64accf4f8f6455ba0aa3ef000a3b',\n decimals: 9,\n },\n ],\n },\n {\n name: 'sDAI',\n symbol: 'sDAI',\n icon: 'sdai.svg',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0x83f20f44975d03b1b09e64809b757c47f942beea',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId:\n '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId:\n '0x9e46f919fbf978f3cad7cd34cca982d5613af63ff8aab6c379e4faa179552958',\n decimals: 9,\n },\n ],\n },\n {\n name: 'USDT',\n symbol: 'USDT',\n icon: 'usdt.svg',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0xdAC17F958D2ee523a2206206994597C13D831ec7',\n decimals: 6,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId:\n '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId:\n '0xa0265fb5c32f6e8db3197af3c7eb05c48ae373605b8165b6f4a51c5b0ba4812e',\n decimals: 6,\n },\n ],\n },\n {\n name: 'USDC',\n symbol: 'USDC',\n icon: 'usdc.svg',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',\n decimals: 6,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId:\n '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId:\n '0x286c479da40dc953bddc3bb4c453b608bba2e0ac483b077bd475174115395e6b',\n decimals: 6,\n },\n ],\n },\n {\n name: 'USDe',\n symbol: 'USDe',\n icon: 'USDe.svg',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0x4c9edd5852cd905f086c759e8383e09bff1e68b3',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId:\n '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId:\n '0xb6133b2ef9f6153eb869125d23dcf20d1e735331b5e41b15a6a7a6cec70e8651',\n decimals: 9,\n },\n ],\n },\n {\n name: 'sUSDe',\n symbol: 'sUSDe',\n icon: 'sUSDe.webp',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0x9d39a5de30e57443bff2a8307a4256c8797a3497',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId:\n '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId:\n '0xd05563025104fc36496c15c7021ad6b31034b0e89a356f4f818045d1f48808bc',\n decimals: 9,\n },\n ],\n },\n {\n name: 'rsUSDe',\n symbol: 'rsUSDe',\n icon: 'rsUSDe.svg',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0x82f5104b23FF2FA54C2345F821dAc9369e9E0B26',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId:\n '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId:\n '0x78d4522ec607f6e8efb66ea49439d1ee48623cf763f9688a8eada025def033d9',\n decimals: 9,\n },\n ],\n },\n {\n name: 'wstETH',\n symbol: 'wstETH',\n icon: 'wsteth.svg',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId:\n '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId:\n '0x1a7815cc9f75db5c24a5b0814bfb706bb9fe485333e98254015de8f48f84c67b',\n decimals: 9,\n },\n ],\n },\n {\n name: 'ezETH',\n symbol: 'ezETH',\n icon: 'ezeth.webp',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0xbf5495Efe5DB9ce00f80364C8B423567e58d2110',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId:\n '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId:\n '0x91b3559edb2619cde8ffb2aa7b3c3be97efd794ea46700db7092abeee62281b0',\n decimals: 9,\n },\n ],\n },\n {\n name: 'pzETH',\n symbol: 'pzETH',\n icon: 'pzETH.webp',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0x8c9532a60e0e7c6bbd2b2c1303f63ace1c3e9811',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId:\n '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId:\n '0x1493d4ec82124de8f9b625682de69dcccda79e882b89a55a8c737b12de67bd68',\n decimals: 9,\n },\n ],\n },\n {\n name: 'Re7LRT',\n symbol: 'Re7LRT',\n icon: 'Re7LRT.png',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0x84631c0d0081FDe56DeB72F6DE77abBbF6A9f93a',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId:\n '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId:\n '0xf2fc648c23a5db24610a1cf696acc4f0f6d9a7d6028dd9944964ab23f6e35995',\n decimals: 9,\n },\n ],\n },\n {\n name: 'steakLRT',\n symbol: 'steakLRT',\n icon: 'steakLRT.png',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0xBEEF69Ac7870777598A04B2bd4771c71212E6aBc',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId:\n '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId:\n '0x4fc8ac9f101df07e2c2dec4a53c8c42c439bdbe5e36ea2d863a61ff60afafc30',\n decimals: 9,\n },\n ],\n },\n];\n\nexport const assets = resolveIconPaths(rawAssets, fuelAssetsBaseUrl);","import type { BN } from '@fuel-ts/math';\n\nimport type { CoinQuantity } from '../coin-quantity';\n\nexport const mergeQuantities = (...coinQuantities: CoinQuantity[][]): CoinQuantity[] => {\n const resultMap: { [key: string]: BN } = {};\n\n function addToMap({ amount, assetId }: CoinQuantity) {\n if (resultMap[assetId]) {\n resultMap[assetId] = resultMap[assetId].add(amount);\n } else {\n resultMap[assetId] = amount;\n }\n }\n\n coinQuantities.forEach((arr) => arr.forEach(addToMap));\n\n // Convert the resultMap back to an array\n return Object.entries(resultMap).map(([assetId, amount]) => ({ assetId, amount }));\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { Address } from '@fuel-ts/address';\n\nexport abstract class AbstractAccount {\n abstract address: Address;\n abstract provider: unknown;\n abstract getResourcesToSpend(quantities: any[], options?: any): any;\n abstract sendTransaction(transactionRequest: any, options?: any): any;\n abstract simulateTransaction(transactionRequest: any, options?: any): any;\n abstract getTransactionCost(transactionRequest: any, options?: any): Promise<any>;\n abstract fund(transactionRequest: any, txCost: any): Promise<any>;\n}\n","import { ASSET_ID_LEN, BigNumberCoder, CONTRACT_ID_LEN, WORD_SIZE } from '@fuel-ts/abi-coder';\nimport { Address } from '@fuel-ts/address';\nimport type { BN } from '@fuel-ts/math';\nimport { arrayify, concat } from '@fuel-ts/utils';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport * as asm from '@fuels/vm-asm';\n\ninterface AssembleTransferToContractParams {\n contractId: string;\n assetId: BytesLike;\n amount: BN;\n}\n\nexport const formatTransferToContractScriptData = (\n transferParams: Array<AssembleTransferToContractParams>\n) => {\n const numberCoder = new BigNumberCoder('u64');\n return transferParams.reduce((acc, transferParam) => {\n const { assetId, amount, contractId } = transferParam;\n const encoded = numberCoder.encode(amount);\n const scriptData = concat([\n Address.fromAddressOrString(contractId).toBytes(),\n encoded,\n arrayify(assetId),\n ]);\n return concat([acc, scriptData]);\n }, new Uint8Array());\n};\n\nexport const assembleTransferToContractScript = async (\n transferParams: Array<AssembleTransferToContractParams>\n) => {\n const scriptData = formatTransferToContractScriptData(transferParams);\n\n // @ts-expect-error method reference missing in DTS\n await asm.initWasm();\n\n let script = new Uint8Array();\n\n transferParams.forEach((_, i) => {\n const offset = (CONTRACT_ID_LEN + WORD_SIZE + ASSET_ID_LEN) * i;\n\n script = concat([\n script,\n // Load ScriptData into register 0x10.\n asm.gtf(0x10, 0x0, asm.GTFArgs.ScriptData).to_bytes(),\n // Add the offset to 0x10 so it will point to the current contract ID, store in 0x11.\n asm.addi(0x11, 0x10, offset).to_bytes(),\n // Add CONTRACT_ID_LEN to 0x11 to point to the amount in the ScriptData, store in 0x12.\n asm.addi(0x12, 0x11, CONTRACT_ID_LEN).to_bytes(),\n // Load word to the amount at 0x12 into register 0x13.\n asm.lw(0x13, 0x12, 0x0).to_bytes(),\n // Add WORD_SIZE to 0x12 to point to the asset ID in the ScriptData, store in 0x14.\n asm.addi(0x14, 0x12, WORD_SIZE).to_bytes(),\n // Perform the transfer using contract ID in 0x11, amount in 0x13, and asset ID in 0x14.\n asm.tr(0x11, 0x13, 0x14).to_bytes(),\n ]);\n });\n\n // Add return instruction at the end of the script\n script = concat([script, asm.ret(0x1).to_bytes()]);\n\n return { script, scriptData };\n};\n","import { hashMessage } from '@fuel-ts/hasher';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { hexlify } from '@fuel-ts/utils';\n\nimport { Account } from '../account';\nimport { transactionRequestify, validateTransactionForAssetBurn } from '../providers';\nimport type {\n TransactionRequestLike,\n CallResult,\n Provider,\n ProviderSendTxParams,\n EstimateTransactionParams,\n TransactionRequest,\n TransactionResponse,\n} from '../providers';\nimport { Signer } from '../signer';\n\nimport { encryptKeystoreWallet } from './keystore-wallet';\n\n/**\n * `BaseWalletUnlocked` provides the base functionalities for an unlocked wallet.\n */\nexport class BaseWalletUnlocked extends Account {\n /**\n * Default HDWallet path.\n */\n static defaultPath = \"m/44'/1179993420'/0'/0/0\";\n\n /**\n * A function that returns the wallet's signer.\n */\n signer: () => Signer;\n\n /**\n * Creates a new BaseWalletUnlocked instance.\n *\n * @param privateKey - The private key of the wallet.\n * @param provider - A Provider instance (optional).\n */\n constructor(privateKey: BytesLike, provider?: Provider) {\n const signer = new Signer(privateKey);\n super(signer.address, provider);\n this.signer = () => signer;\n }\n\n /**\n * Gets the private key of the wallet.\n *\n * @returns The private key of the wallet.\n */\n get privateKey(): string {\n return this.signer().privateKey;\n }\n\n /**\n * Gets the public key of the wallet.\n *\n * @returns\n */\n get publicKey(): string {\n return this.signer().publicKey;\n }\n\n /**\n * Signs a message with the wallet's private key.\n *\n * @param message - The message to sign.\n * @returns A promise that resolves to the signature as a ECDSA 64 bytes string.\n */\n override async signMessage(message: string): Promise<string> {\n const signedMessage = await this.signer().sign(hashMessage(message));\n return hexlify(signedMessage);\n }\n\n /**\n * Signs a transaction with the wallet's private key.\n *\n * @param transactionRequestLike - The transaction request to sign.\n * @returns A promise that resolves to the signature as a ECDSA 64 bytes string.\n */\n override async signTransaction(transactionRequestLike: TransactionRequestLike): Promise<string> {\n const transactionRequest = transactionRequestify(transactionRequestLike);\n const chainId = await this.provider.getChainId();\n const hashedTransaction = transactionRequest.getTransactionId(chainId);\n const signature = await this.signer().sign(hashedTransaction);\n return hexlify(signature);\n }\n\n /**\n * Populates a transaction with the witnesses signature.\n *\n * @param transactionRequestLike - The transaction request to populate.\n * @returns The populated transaction request.\n */\n async populateTransactionWitnessesSignature<T extends TransactionRequest>(\n transactionRequestLike: TransactionRequestLike\n ) {\n const transactionRequest = transactionRequestify(transactionRequestLike) as T;\n const signedTransaction = await this.signTransaction(transactionRequest);\n\n transactionRequest.updateWitnessByOwner(this.address, signedTransaction);\n\n return transactionRequest;\n }\n\n /**\n * Populates the witness signature for a transaction and sends it to the network using `provider.sendTransaction`.\n *\n * @param transactionRequestLike - The transaction request to send.\n * @param estimateTxDependencies - Whether to estimate the transaction dependencies.\n * @returns A promise that resolves to the TransactionResponse object.\n */\n override async sendTransaction(\n transactionRequestLike: TransactionRequestLike,\n { estimateTxDependencies = false, enableAssetBurn }: ProviderSendTxParams = {}\n ): Promise<TransactionResponse> {\n const transactionRequest = transactionRequestify(transactionRequestLike);\n validateTransactionForAssetBurn(\n await this.provider.getBaseAssetId(),\n transactionRequest,\n enableAssetBurn\n );\n if (estimateTxDependencies) {\n await this.provider.estimateTxDependencies(transactionRequest);\n }\n return this.provider.sendTransaction(\n await this.populateTransactionWitnessesSignature(transactionRequest),\n { estimateTxDependencies: false, enableAssetBurn }\n );\n }\n\n /**\n * Populates the witness signature for a transaction and sends a call to the network using `provider.dryRun`.\n *\n * @param transactionRequestLike - The transaction request to simulate.\n * @returns A promise that resolves to the CallResult object.\n */\n override async simulateTransaction(\n transactionRequestLike: TransactionRequestLike,\n { estimateTxDependencies = true }: EstimateTransactionParams = {}\n ): Promise<CallResult> {\n const transactionRequest = transactionRequestify(transactionRequestLike);\n if (estimateTxDependencies) {\n await this.provider.estimateTxDependencies(transactionRequest);\n }\n return this.provider.dryRun(\n await this.populateTransactionWitnessesSignature(transactionRequest),\n {\n utxoValidation: true,\n estimateTxDependencies: false,\n }\n );\n }\n\n /**\n * Encrypts an unlocked wallet with a password.\n *\n * @param password - the password to encrypt the wallet with.\n * @returns - the encrypted wallet.\n */\n async encrypt(password: string): Promise<string> {\n return encryptKeystoreWallet(this.privateKey, this.address, password);\n }\n}\n","import { Address } from '@fuel-ts/address';\nimport { randomBytes } from '@fuel-ts/crypto';\nimport { hash } from '@fuel-ts/hasher';\nimport { toBytes } from '@fuel-ts/math';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { hexlify, concat, arrayify } from '@fuel-ts/utils';\nimport { secp256k1 } from '@noble/curves/secp256k1';\n\nexport class Signer {\n readonly address: Address;\n\n readonly publicKey: string;\n\n readonly compressedPublicKey: string;\n\n readonly privateKey: string;\n\n /**\n * Create a Signer instance from a given private key\n *\n * @param privateKey - The private key to use for signing\n * @returns A new Signer instance\n */\n constructor(privateKey: BytesLike) {\n // A lot of common tools do not prefix private keys with a 0x\n if (typeof privateKey === 'string') {\n if (privateKey.match(/^[0-9a-f]*$/i) && privateKey.length === 64) {\n // eslint-disable-next-line no-param-reassign\n privateKey = `0x${privateKey}`;\n }\n }\n // Convert to byte array, normalize private key input allowing it to be BytesLike\n // like remove 0x prefix and accept array of bytes\n const privateKeyBytes = toBytes(privateKey, 32);\n\n this.privateKey = hexlify(privateKeyBytes);\n\n // Slice(1) removes the encoding scheme from the public key\n this.publicKey = hexlify(secp256k1.getPublicKey(privateKeyBytes, false).slice(1));\n this.compressedPublicKey = hexlify(secp256k1.getPublicKey(privateKeyBytes, true));\n this.address = Address.fromPublicKey(this.publicKey);\n }\n\n /**\n * Sign data using the Signer instance\n *\n * Signature is a 64 byte array of the concatenated r and s values with the compressed recoveryParam byte.\n * @ignore\n * [Read more](FuelLabs/fuel-specs/specs/protocol/cryptographic_primitives.md#public-key-cryptography)\n *\n * @param data - The data to be sign\n * @returns hashed signature\n */\n sign(data: BytesLike) {\n const signature = secp256k1.sign(arrayify(data), arrayify(this.privateKey));\n\n const r = toBytes(`0x${signature.r.toString(16)}`, 32);\n const s = toBytes(`0x${signature.s.toString(16)}`, 32);\n\n // add recoveryParam to first s byte\n s[0] |= (signature.recovery || 0) << 7;\n\n return hexlify(concat([r, s]));\n }\n\n /**\n * Add point on the current elliptic curve\n *\n * @param point - Point to add on the curve\n * @returns compressed point on the curve\n */\n addPoint(point: BytesLike) {\n const p0 = secp256k1.ProjectivePoint.fromHex(arrayify(this.compressedPublicKey));\n const p1 = secp256k1.ProjectivePoint.fromHex(arrayify(point));\n const result = p0.add(p1);\n return `0x${result.toHex(true)}`;\n }\n\n /**\n * Recover the public key from a signature performed with [`sign`](#sign).\n *\n * @param data - Data\n * @param signature - hashed signature\n * @returns public key from signature from the\n */\n static recoverPublicKey(data: BytesLike, signature: BytesLike): string {\n const signedMessageBytes = arrayify(signature);\n const r = signedMessageBytes.slice(0, 32);\n const s = signedMessageBytes.slice(32, 64);\n const recoveryParam = (s[0] & 0x80) >> 7;\n\n // remove recoveryParam from s first byte\n s[0] &= 0x7f;\n\n const sig = new secp256k1.Signature(BigInt(hexlify(r)), BigInt(hexlify(s))).addRecoveryBit(\n recoveryParam\n );\n\n const publicKey = sig.recoverPublicKey(arrayify(data)).toRawBytes(false).slice(1);\n return hexlify(publicKey);\n }\n\n /**\n * Recover the address from a signature performed with [`sign`](#sign).\n *\n * @param data - Data\n * @param signature - Signature\n * @returns Address from signature\n */\n static recoverAddress(data: BytesLike, signature: BytesLike): Address {\n return Address.fromPublicKey(Signer.recoverPublicKey(data, signature));\n }\n\n /**\n * Generate a random privateKey\n *\n * @param entropy - Adds extra entropy to generate the privateKey\n * @returns random 32-byte hashed\n */\n static generatePrivateKey(entropy?: BytesLike) {\n return entropy ? hash(concat([randomBytes(32), arrayify(entropy)])) : randomBytes(32);\n }\n\n /**\n * Extended publicKey from a compact publicKey\n *\n * @param publicKey - Compact publicKey\n * @returns extended publicKey\n */\n static extendPublicKey(publicKey: BytesLike) {\n const point = secp256k1.ProjectivePoint.fromHex(arrayify(publicKey));\n return hexlify(point.toRawBytes(false).slice(1));\n }\n}\n","import { Address } from '@fuel-ts/address';\nimport {\n bufferFromString,\n keccak256,\n randomBytes,\n scrypt,\n stringFromBuffer,\n decryptJsonWalletData,\n encryptJsonWalletData,\n randomUUID,\n} from '@fuel-ts/crypto';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { hexlify } from '@fuel-ts/utils';\n\nexport type KeystoreWallet = {\n id: string;\n version: number;\n address: string;\n crypto: KeystoreCrypto;\n};\n\ntype KeystoreCrypto = {\n cipher: 'aes-128-ctr';\n cipherparams: { iv: string };\n ciphertext: string;\n kdf: 'scrypt';\n mac: string;\n kdfparams: KDFParams;\n};\n\ntype KDFParams = {\n dklen: number;\n n: number;\n p: number;\n r: number;\n salt: string;\n};\n\n// Same values used in the Rust SDK\nexport const DEFAULT_KDF_PARAMS_LOG_N = 13;\nexport const DEFAULT_KDF_PARAMS_R = 8;\nexport const DEFAULT_KDF_PARAMS_P = 1;\nexport const DEFAULT_KEY_SIZE = 32;\nexport const DEFAULT_IV_SIZE = 16;\n\n/**\n * Removes the '0x' prefix from a hexadecimal string.\n * If the prefix does not exist, it returns the original string.\n */\nexport const removeHexPrefix = (hexString: string) => {\n if (/^0x/.test(hexString)) {\n return hexString.slice(2);\n }\n\n return hexString;\n};\n\nexport async function encryptKeystoreWallet(\n privateKey: string,\n address: string | Address,\n password: string\n): Promise<string> {\n // Convert the hexlified private key string to a Buffer.\n const privateKeyBuffer = bufferFromString(removeHexPrefix(privateKey), 'hex');\n const ownerAddress = Address.fromAddressOrString(address);\n // Generate a random salt.\n const salt = randomBytes(DEFAULT_KEY_SIZE);\n\n const key = scrypt({\n password: bufferFromString(password),\n salt,\n dklen: DEFAULT_KEY_SIZE,\n n: 2 ** DEFAULT_KDF_PARAMS_LOG_N,\n r: DEFAULT_KDF_PARAMS_R,\n p: DEFAULT_KDF_PARAMS_P,\n });\n\n // Encrypt the private key using AES-128-CTR.\n const iv = randomBytes(DEFAULT_IV_SIZE);\n\n const ciphertext = await encryptJsonWalletData(privateKeyBuffer, key, iv);\n\n const data = Uint8Array.from([...key.subarray(16, 32), ...ciphertext]);\n\n // Calculate the MAC.\n const macHashUint8Array = keccak256(data);\n\n const mac = stringFromBuffer(macHashUint8Array, 'hex');\n\n // Construct keystore.\n const keystore: KeystoreWallet = {\n id: randomUUID(),\n version: 3,\n address: removeHexPrefix(ownerAddress.toHexString()),\n crypto: {\n cipher: 'aes-128-ctr',\n mac,\n cipherparams: { iv: stringFromBuffer(iv, 'hex') },\n ciphertext: stringFromBuffer(ciphertext, 'hex'),\n kdf: 'scrypt',\n kdfparams: {\n dklen: DEFAULT_KEY_SIZE,\n n: 2 ** DEFAULT_KDF_PARAMS_LOG_N,\n p: DEFAULT_KDF_PARAMS_P,\n r: DEFAULT_KDF_PARAMS_R,\n salt: stringFromBuffer(salt, 'hex'),\n },\n },\n };\n\n return JSON.stringify(keystore);\n}\n\nexport async function decryptKeystoreWallet(jsonWallet: string, password: string): Promise<string> {\n const keystoreWallet = JSON.parse(jsonWallet) as KeystoreWallet;\n\n // Extract the parameters needed for decryption.\n const {\n crypto: {\n mac,\n ciphertext,\n cipherparams: { iv },\n kdfparams: { dklen, n, r, p, salt },\n },\n } = keystoreWallet;\n\n const ciphertextBuffer = bufferFromString(ciphertext, 'hex');\n const ivBuffer = bufferFromString(iv, 'hex');\n const saltBuffer = bufferFromString(salt, 'hex');\n\n const passwordBuffer = bufferFromString(password);\n\n const key = scrypt({\n password: passwordBuffer,\n salt: saltBuffer,\n n,\n p,\n r,\n dklen,\n });\n\n // Verify the MAC. It should be the Keccak-256 hash of the concatenation of the second half of the derived key and the ciphertext.\n const data = Uint8Array.from([...key.subarray(16, 32), ...ciphertextBuffer]);\n\n const macHashUint8Array = keccak256(data);\n\n const macHash = stringFromBuffer(macHashUint8Array, 'hex');\n\n if (mac !== macHash) {\n throw new FuelError(\n ErrorCode.INVALID_PASSWORD,\n 'Failed to decrypt the keystore wallet, the provided password is incorrect.'\n );\n }\n\n // Decrypt the private key.\n const buffer = await decryptJsonWalletData(ciphertextBuffer, key, ivBuffer);\n\n const privateKey = hexlify(buffer);\n\n return privateKey;\n}\n","import { computeHmac, ripemd160 } from '@fuel-ts/crypto';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { sha256 } from '@fuel-ts/hasher';\nimport { bn, toBytes, toHex } from '@fuel-ts/math';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { arrayify, hexlify, concat, dataSlice, encodeBase58, decodeBase58 } from '@fuel-ts/utils';\n\nimport { Mnemonic } from '../mnemonic';\nimport { Signer } from '../signer';\n\n// \"Bitcoin seed\"\nconst HARDENED_INDEX = 0x80000000;\n\n// 4 byte: version bytes (mainnet: 0x0488B21E public, 0x0488ADE4 private; testnet: 0x043587CF public, 0x04358394 private)\nconst MainnetPRV = hexlify('0x0488ade4');\nconst MainnetPUB = hexlify('0x0488b21e');\nconst TestnetPRV = hexlify('0x04358394');\nconst TestnetPUB = hexlify('0x043587cf');\n\nfunction base58check(data: Uint8Array): string {\n return encodeBase58(concat([data, dataSlice(sha256(sha256(data)), 0, 4)]));\n}\n\nfunction getExtendedKeyPrefix(isPublic: boolean = false, testnet: boolean = false) {\n if (isPublic) {\n return testnet ? TestnetPUB : MainnetPUB;\n }\n return testnet ? TestnetPRV : MainnetPRV;\n}\n\nfunction isPublicExtendedKey(extendedKey: Uint8Array) {\n return [MainnetPUB, TestnetPUB].includes(hexlify(extendedKey.slice(0, 4)));\n}\n\nfunction isValidExtendedKey(extendedKey: Uint8Array) {\n return [MainnetPRV, TestnetPRV, MainnetPUB, TestnetPUB].includes(\n hexlify(extendedKey.slice(0, 4))\n );\n}\n\nfunction parsePath(path: string, depth: number = 0) {\n const components = path.split('/');\n\n if (components.length === 0 || (components[0] === 'm' && depth !== 0)) {\n throw new FuelError(ErrorCode.HD_WALLET_ERROR, `invalid path - ${path}`);\n }\n\n if (components[0] === 'm') {\n components.shift();\n }\n\n return components.map((p) =>\n ~p.indexOf(`'`) ? parseInt(p, 10) + HARDENED_INDEX : parseInt(p, 10)\n );\n}\n\ntype HDWalletConfig = {\n privateKey?: BytesLike;\n publicKey?: BytesLike;\n chainCode: BytesLike;\n depth?: number;\n index?: number;\n parentFingerprint?: string;\n};\n\nclass HDWallet {\n depth: number = 0;\n index: number = 0;\n fingerprint: string = hexlify('0x00000000');\n parentFingerprint: string = hexlify('0x00000000');\n privateKey?: string;\n publicKey: string;\n chainCode: BytesLike;\n\n /**\n * HDWallet is a implementation of the BIP-0044 and BIP-0032, Multi-Account Hierarchy for Deterministic Wallets\n *\n * @param config - Wallet configurations\n */\n constructor(config: HDWalletConfig) {\n // TODO: set some asserts here\n\n if (config.privateKey) {\n const signer = new Signer(config.privateKey);\n this.publicKey = hexlify(signer.compressedPublicKey);\n this.privateKey = hexlify(config.privateKey);\n } else {\n if (!config.publicKey) {\n throw new FuelError(\n ErrorCode.HD_WALLET_ERROR,\n 'Both public and private Key cannot be missing. At least one should be provided.'\n );\n }\n this.publicKey = hexlify(config.publicKey);\n }\n\n this.parentFingerprint = config.parentFingerprint || this.parentFingerprint;\n this.fingerprint = dataSlice(ripemd160(sha256(this.publicKey)), 0, 4);\n this.depth = config.depth || this.depth;\n this.index = config.index || this.index;\n this.chainCode = config.chainCode;\n }\n\n get extendedKey() {\n return this.toExtendedKey();\n }\n\n /**\n * Derive the current HDWallet instance navigating only on the index.\n * `Ex.: m/44'/0 -> Ex.: m/44'/1 -> m/44'/2`. [Learn more](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki)\n *\n * @param index - Index of the child HDWallet.\n * @returns A new instance of HDWallet on the derived index\n */\n deriveIndex(index: number) {\n const privateKey = this.privateKey && arrayify(this.privateKey);\n const publicKey = arrayify(this.publicKey);\n const chainCode = arrayify(this.chainCode);\n const data = new Uint8Array(37);\n\n if (index & HARDENED_INDEX) {\n if (!privateKey) {\n throw new FuelError(\n ErrorCode.HD_WALLET_ERROR,\n 'Cannot derive a hardened index without a private Key.'\n );\n }\n\n // 33 bytes: 0x00 || private key\n data.set(privateKey, 1);\n } else {\n data.set(arrayify(this.publicKey));\n }\n\n // child number: ser32(i)\n data.set(toBytes(index, 4), 33);\n\n const bytes = arrayify(computeHmac('sha512', chainCode, data));\n const IL = bytes.slice(0, 32);\n const IR = bytes.slice(32);\n\n if (privateKey) {\n const N = '0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141';\n // Child key ki is parse256(IL) + kpar (mod n).\n const ki = bn(IL).add(privateKey).mod(N).toBytes(32);\n\n return new HDWallet({\n privateKey: ki,\n chainCode: IR,\n index,\n depth: this.depth + 1,\n parentFingerprint: this.fingerprint,\n });\n }\n\n const signer = new Signer(hexlify(IL));\n const Ki = signer.addPoint(publicKey);\n\n return new HDWallet({\n publicKey: Ki,\n chainCode: IR,\n index,\n depth: this.depth + 1,\n parentFingerprint: this.fingerprint,\n });\n }\n\n /**\n * Derive the current HDWallet instance to the path. [Learn more](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki)\n *\n * @param path - The string representation of the child HDWallet. `Ex.: m/44'/0'/0'/0/0`\n * @returns A new instance of HDWallet on the derived path\n */\n derivePath(path: string) {\n const paths = parsePath(path, this.depth);\n\n return paths.reduce((hdwallet, index) => hdwallet.deriveIndex(index), <HDWallet>this);\n }\n\n /**\n * Get the extendKey as defined on BIP-32 from the provided seed\n *\n * @param isPublic - enable to export public extendedKey, it not required when HDWallet didn't have the privateKey.\n * @param testnet - Inform if should use testnet or mainnet prefix, default value is true (`mainnet`).\n * @returns BIP-32 extended private key\n */\n toExtendedKey(isPublic: boolean = false, testnet: boolean = false): string {\n if (this.depth >= 256) {\n throw new FuelError(\n ErrorCode.HD_WALLET_ERROR,\n `Exceeded max depth of 255. Current depth: ${this.depth}.`\n );\n }\n const prefix = getExtendedKeyPrefix(this.privateKey == null || isPublic, testnet);\n const depth = hexlify(Uint8Array.from([this.depth]));\n const parentFingerprint = this.parentFingerprint;\n const index = toHex(this.index, 4);\n // last 32 bites from the key\n const chainCode = this.chainCode;\n // first 32 bites from the key\n const key =\n this.privateKey != null && !isPublic ? concat(['0x00', this.privateKey]) : this.publicKey;\n const extendedKey = arrayify(concat([prefix, depth, parentFingerprint, index, chainCode, key]));\n\n return base58check(extendedKey);\n }\n\n /**\n * Create HDWallet instance from seed\n *\n * @param seed - Seed\n * @returns A new instance of HDWallet\n */\n static fromSeed(seed: string) {\n const masterKey = Mnemonic.masterKeysFromSeed(seed);\n\n return new HDWallet({\n chainCode: arrayify(masterKey.slice(32)),\n privateKey: arrayify(masterKey.slice(0, 32)),\n });\n }\n\n static fromExtendedKey(extendedKey: string) {\n const decoded = hexlify(toBytes(decodeBase58(extendedKey)));\n const bytes = arrayify(decoded);\n const validChecksum = base58check(bytes.slice(0, 78)) === extendedKey;\n\n if (bytes.length !== 82 || !isValidExtendedKey(bytes)) {\n throw new FuelError(ErrorCode.HD_WALLET_ERROR, 'Provided key is not a valid extended key.');\n }\n if (!validChecksum) {\n throw new FuelError(ErrorCode.HD_WALLET_ERROR, 'Provided key has an invalid checksum.');\n }\n\n const depth = bytes[4];\n const parentFingerprint = hexlify(bytes.slice(5, 9));\n const index = parseInt(hexlify(bytes.slice(9, 13)).substring(2), 16);\n const chainCode = hexlify(bytes.slice(13, 45));\n const key = bytes.slice(45, 78);\n\n if ((depth === 0 && parentFingerprint !== '0x00000000') || (depth === 0 && index !== 0)) {\n throw new FuelError(\n ErrorCode.HD_WALLET_ERROR,\n 'Inconsistency detected: Depth is zero but fingerprint/index is non-zero.'\n );\n }\n\n if (isPublicExtendedKey(bytes)) {\n if (key[0] !== 3) {\n throw new FuelError(ErrorCode.HD_WALLET_ERROR, 'Invalid public extended key.');\n }\n\n return new HDWallet({\n publicKey: key,\n chainCode,\n index,\n depth,\n parentFingerprint,\n });\n }\n\n if (key[0] !== 0) {\n throw new FuelError(ErrorCode.HD_WALLET_ERROR, 'Invalid private extended key.');\n }\n\n return new HDWallet({\n privateKey: key.slice(1),\n chainCode,\n index,\n depth,\n parentFingerprint,\n });\n }\n}\n\nexport default HDWallet;\n","import { randomBytes, pbkdf2, computeHmac } from '@fuel-ts/crypto';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { sha256 } from '@fuel-ts/hasher';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { arrayify, hexlify, concat, dataSlice, encodeBase58, toUtf8Bytes } from '@fuel-ts/utils';\n\nimport { english } from '../wordlists';\n\nimport type { MnemonicPhrase } from './utils';\nimport { entropyToMnemonicIndices, getWords, getPhrase, mnemonicWordsToEntropy } from './utils';\n\n//\n// Constants\n//\n// \"Bitcoin seed\"\nconst MasterSecret = toUtf8Bytes('Bitcoin seed');\n// 4 byte: version bytes (mainnet: 0x0488B21E public, 0x0488ADE4 private; testnet: 0x043587CF public, 0x04358394 private)\nconst MainnetPRV = '0x0488ade4';\nconst TestnetPRV = '0x04358394';\nexport const MNEMONIC_SIZES = [12, 15, 18, 21, 24];\n\nfunction assertWordList(wordlist: Array<string>) {\n if (wordlist.length !== 2048) {\n throw new FuelError(\n ErrorCode.INVALID_WORD_LIST,\n `Expected word list length of 2048, but got ${wordlist.length}.`\n );\n }\n}\n\nfunction assertEntropy(entropy: BytesLike) {\n if (entropy.length % 4 !== 0 || entropy.length < 16 || entropy.length > 32) {\n throw new FuelError(\n ErrorCode.INVALID_ENTROPY,\n `Entropy should be between 16 and 32 bytes and a multiple of 4, but got ${entropy.length} bytes.`\n );\n }\n}\n\nfunction assertMnemonic(words: Array<string>) {\n if (!MNEMONIC_SIZES.includes(words.length)) {\n const errorMsg = `Invalid mnemonic size. Expected one of [${MNEMONIC_SIZES.join(\n ', '\n )}] words, but got ${words.length}.`;\n\n throw new FuelError(ErrorCode.INVALID_MNEMONIC, errorMsg);\n }\n}\n\nclass Mnemonic {\n wordlist: Array<string>;\n\n /**\n *\n * @param wordlist - Provide a wordlist with the list of words used to generate the mnemonic phrase. The default value is the English list.\n * @returns Mnemonic instance\n */\n constructor(wordlist: Array<string> = english) {\n this.wordlist = wordlist;\n\n assertWordList(this.wordlist);\n }\n\n /**\n *\n * @param phrase - Mnemonic phrase composed by words from the provided wordlist\n * @returns Entropy hash\n */\n mnemonicToEntropy(phrase: MnemonicPhrase) {\n return Mnemonic.mnemonicToEntropy(phrase, this.wordlist);\n }\n\n /**\n *\n * @param entropy - Entropy source to the mnemonic phrase.\n * @returns Mnemonic phrase\n */\n entropyToMnemonic(entropy: BytesLike) {\n return Mnemonic.entropyToMnemonic(entropy, this.wordlist);\n }\n\n /**\n *\n * @param phrase - Mnemonic phrase composed by words from the provided wordlist\n * @param wordlist - Provide a wordlist with the list of words used to generate the mnemonic phrase. The default value is the English list.\n * @returns Mnemonic phrase\n */\n static mnemonicToEntropy(phrase: MnemonicPhrase, wordlist: Array<string> = english): string {\n const words = getWords(phrase);\n\n assertMnemonic(words);\n\n return hexlify(mnemonicWordsToEntropy(words, wordlist));\n }\n\n /**\n * @param entropy - Entropy source to the mnemonic phrase.\n * @param testnet - Inform if should use testnet or mainnet prefix, default value is true (`mainnet`).\n * @returns 64-byte array contains privateKey and chainCode as described on BIP39\n */\n static entropyToMnemonic(entropy: BytesLike, wordlist: Array<string> = english): string {\n const entropyBytes = arrayify(entropy);\n\n assertWordList(wordlist);\n assertEntropy(entropyBytes);\n\n return entropyToMnemonicIndices(entropyBytes)\n .map((i) => wordlist[i])\n .join(' ');\n }\n\n /**\n * @param phrase - Mnemonic phrase composed by words from the provided wordlist\n * @param passphrase - Add additional security to protect the generated seed with a memorized passphrase. `Note: if the owner forgot the passphrase, all wallets and accounts derive from the phrase will be lost.`\n * @returns 64-byte array contains privateKey and chainCode as described on BIP39\n */\n static mnemonicToSeed(phrase: MnemonicPhrase, passphrase: BytesLike = '') {\n assertMnemonic(getWords(phrase));\n\n const phraseBytes = toUtf8Bytes(getPhrase(phrase));\n const salt = toUtf8Bytes(`mnemonic${passphrase}`);\n\n return pbkdf2(phraseBytes, salt, 2048, 64, 'sha512');\n }\n\n /**\n * @param phrase - Mnemonic phrase composed by words from the provided wordlist\n * @param passphrase - Add additional security to protect the generated seed with a memorized passphrase. `Note: if the owner forgot the passphrase, all wallets and accounts derive from the phrase will be lost.`\n * @returns 64-byte array contains privateKey and chainCode as described on BIP39\n */\n static mnemonicToMasterKeys(phrase: MnemonicPhrase, passphrase: BytesLike = '') {\n const seed = Mnemonic.mnemonicToSeed(phrase, passphrase);\n return Mnemonic.masterKeysFromSeed(seed);\n }\n\n /**\n * Validates if given mnemonic is valid\n * @param phrase - Mnemonic phrase composed by words from the provided wordlist\n * @returns true if phrase is a valid mnemonic\n */\n static isMnemonicValid(phrase: string) {\n const words = getWords(phrase);\n\n let i: number = 0;\n\n try {\n assertMnemonic(words);\n } catch {\n return false;\n }\n\n while (i < words.length) {\n if (Mnemonic.binarySearch(words[i]) === false) {\n return false;\n }\n i += 1;\n }\n\n return true;\n }\n\n static binarySearch(target: string): boolean {\n const words = english;\n let left: number = 0;\n let right: number = words.length - 1;\n\n while (left <= right) {\n const mid: number = Math.floor((left + right) / 2);\n\n if (words[mid] === target) {\n return true;\n }\n if (target < words[mid]) {\n right = mid - 1;\n } else {\n left = mid + 1;\n }\n }\n\n return false;\n }\n\n /**\n * @param seed - BIP39 seed\n * @param testnet - Inform if should use testnet or mainnet prefix, the default value is true (`mainnet`).\n * @returns 64-byte array contains privateKey and chainCode as described on BIP39\n */\n static masterKeysFromSeed(seed: string): Uint8Array {\n const seedArray = arrayify(seed);\n\n if (seedArray.length < 16 || seedArray.length > 64) {\n throw new FuelError(\n ErrorCode.INVALID_SEED,\n `Seed length should be between 16 and 64 bytes, but received ${seedArray.length} bytes.`\n );\n }\n\n return arrayify(computeHmac('sha512', MasterSecret, seedArray));\n }\n\n /**\n * Get the extendKey as defined on BIP-32 from the provided seed\n *\n * @param seed - BIP39 seed\n * @param testnet - Inform if should use testnet or mainnet prefix, default value is true (`mainnet`).\n * @returns BIP-32 extended private key\n */\n static seedToExtendedKey(seed: string, testnet: boolean = false): string {\n const masterKey = Mnemonic.masterKeysFromSeed(seed);\n const prefix = arrayify(testnet ? TestnetPRV : MainnetPRV);\n const depth = '0x00';\n const fingerprint = '0x00000000';\n const index = '0x00000000';\n // last 32 bites from the key\n const chainCode = masterKey.slice(32);\n // first 32 bites from the key\n const privateKey = masterKey.slice(0, 32);\n const extendedKey = concat([\n prefix,\n depth,\n fingerprint,\n index,\n chainCode,\n concat(['0x00', privateKey]),\n ]);\n const checksum = dataSlice(sha256(sha256(extendedKey)), 0, 4);\n\n return encodeBase58(concat([extendedKey, checksum]));\n }\n\n /**\n * Create a new mnemonic using a randomly generated number as entropy.\n * As defined in BIP39, the entropy must be a multiple of 32 bits, and its size must be between 128 and 256 bits.\n * Therefore, the possible values for `strength` are 128, 160, 192, 224, and 256.\n * If not provided, the default entropy length will be set to 256 bits.\n * The return is a list of words that encodes the generated entropy.\n *\n *\n * @param size - Number of bytes used as an entropy\n * @param extraEntropy - Optional extra entropy to increase randomness\n * @returns A randomly generated mnemonic\n */\n static generate(size: number = 32, extraEntropy: BytesLike = '') {\n const entropy = extraEntropy\n ? sha256(concat([randomBytes(size), arrayify(extraEntropy)]))\n : randomBytes(size);\n return Mnemonic.entropyToMnemonic(entropy);\n }\n}\n\nexport default Mnemonic;\n","export const english = [\n 'abandon',\n 'ability',\n 'able',\n 'about',\n 'above',\n 'absent',\n 'absorb',\n 'abstract',\n 'absurd',\n 'abuse',\n 'access',\n 'accident',\n 'account',\n 'accuse',\n 'achieve',\n 'acid',\n 'acoustic',\n 'acquire',\n 'across',\n 'act',\n 'action',\n 'actor',\n 'actress',\n 'actual',\n 'adapt',\n 'add',\n 'addict',\n 'address',\n 'adjust',\n 'admit',\n 'adult',\n 'advance',\n 'advice',\n 'aerobic',\n 'affair',\n 'afford',\n 'afraid',\n 'again',\n 'age',\n 'agent',\n 'agree',\n 'ahead',\n 'aim',\n 'air',\n 'airport',\n 'aisle',\n 'alarm',\n 'album',\n 'alcohol',\n 'alert',\n 'alien',\n 'all',\n 'alley',\n 'allow',\n 'almost',\n 'alone',\n 'alpha',\n 'already',\n 'also',\n 'alter',\n 'always',\n 'amateur',\n 'amazing',\n 'among',\n 'amount',\n 'amused',\n 'analyst',\n 'anchor',\n 'ancient',\n 'anger',\n 'angle',\n 'angry',\n 'animal',\n 'ankle',\n 'announce',\n 'annual',\n 'another',\n 'answer',\n 'antenna',\n 'antique',\n 'anxiety',\n 'any',\n 'apart',\n 'apology',\n 'appear',\n 'apple',\n 'approve',\n 'april',\n 'arch',\n 'arctic',\n 'area',\n 'arena',\n 'argue',\n 'arm',\n 'armed',\n 'armor',\n 'army',\n 'around',\n 'arrange',\n 'arrest',\n 'arrive',\n 'arrow',\n 'art',\n 'artefact',\n 'artist',\n 'artwork',\n 'ask',\n 'aspect',\n 'assault',\n 'asset',\n 'assist',\n 'assume',\n 'asthma',\n 'athlete',\n 'atom',\n 'attack',\n 'attend',\n 'attitude',\n 'attract',\n 'auction',\n 'audit',\n 'august',\n 'aunt',\n 'author',\n 'auto',\n 'autumn',\n 'average',\n 'avocado',\n 'avoid',\n 'awake',\n 'aware',\n 'away',\n 'awesome',\n 'awful',\n 'awkward',\n 'axis',\n 'baby',\n 'bachelor',\n 'bacon',\n 'badge',\n 'bag',\n 'balance',\n 'balcony',\n 'ball',\n 'bamboo',\n 'banana',\n 'banner',\n 'bar',\n 'barely',\n 'bargain',\n 'barrel',\n 'base',\n 'basic',\n 'basket',\n 'battle',\n 'beach',\n 'bean',\n 'beauty',\n 'because',\n 'become',\n 'beef',\n 'before',\n 'begin',\n 'behave',\n 'behind',\n 'believe',\n 'below',\n 'belt',\n 'bench',\n 'benefit',\n 'best',\n 'betray',\n 'better',\n 'between',\n 'beyond',\n 'bicycle',\n 'bid',\n 'bike',\n 'bind',\n 'biology',\n 'bird',\n 'birth',\n 'bitter',\n 'black',\n 'blade',\n 'blame',\n 'blanket',\n 'blast',\n 'bleak',\n 'bless',\n 'blind',\n 'blood',\n 'blossom',\n 'blouse',\n 'blue',\n 'blur',\n 'blush',\n 'board',\n 'boat',\n 'body',\n 'boil',\n 'bomb',\n 'bone',\n 'bonus',\n 'book',\n 'boost',\n 'border',\n 'boring',\n 'borrow',\n 'boss',\n 'bottom',\n 'bounce',\n 'box',\n 'boy',\n 'bracket',\n 'brain',\n 'brand',\n 'brass',\n 'brave',\n 'bread',\n 'breeze',\n 'brick',\n 'bridge',\n 'brief',\n 'bright',\n 'bring',\n 'brisk',\n 'broccoli',\n 'broken',\n 'bronze',\n 'broom',\n 'brother',\n 'brown',\n 'brush',\n 'bubble',\n 'buddy',\n 'budget',\n 'buffalo',\n 'build',\n 'bulb',\n 'bulk',\n 'bullet',\n 'bundle',\n 'bunker',\n 'burden',\n 'burger',\n 'burst',\n 'bus',\n 'business',\n 'busy',\n 'butter',\n 'buyer',\n 'buzz',\n 'cabbage',\n 'cabin',\n 'cable',\n 'cactus',\n 'cage',\n 'cake',\n 'call',\n 'calm',\n 'camera',\n 'camp',\n 'can',\n 'canal',\n 'cancel',\n 'candy',\n 'cannon',\n 'canoe',\n 'canvas',\n 'canyon',\n 'capable',\n 'capital',\n 'captain',\n 'car',\n 'carbon',\n 'card',\n 'cargo',\n 'carpet',\n 'carry',\n 'cart',\n 'case',\n 'cash',\n 'casino',\n 'castle',\n 'casual',\n 'cat',\n 'catalog',\n 'catch',\n 'category',\n 'cattle',\n 'caught',\n 'cause',\n 'caution',\n 'cave',\n 'ceiling',\n 'celery',\n 'cement',\n 'census',\n 'century',\n 'cereal',\n 'certain',\n 'chair',\n 'chalk',\n 'champion',\n 'change',\n 'chaos',\n 'chapter',\n 'charge',\n 'chase',\n 'chat',\n 'cheap',\n 'check',\n 'cheese',\n 'chef',\n 'cherry',\n 'chest',\n 'chicken',\n 'chief',\n 'child',\n 'chimney',\n 'choice',\n 'choose',\n 'chronic',\n 'chuckle',\n 'chunk',\n 'churn',\n 'cigar',\n 'cinnamon',\n 'circle',\n 'citizen',\n 'city',\n 'civil',\n 'claim',\n 'clap',\n 'clarify',\n 'claw',\n 'clay',\n 'clean',\n 'clerk',\n 'clever',\n 'click',\n 'client',\n 'cliff',\n 'climb',\n 'clinic',\n 'clip',\n 'clock',\n 'clog',\n 'close',\n 'cloth',\n 'cloud',\n 'clown',\n 'club',\n 'clump',\n 'cluster',\n 'clutch',\n 'coach',\n 'coast',\n 'coconut',\n 'code',\n 'coffee',\n 'coil',\n 'coin',\n 'collect',\n 'color',\n 'column',\n 'combine',\n 'come',\n 'comfort',\n 'comic',\n 'common',\n 'company',\n 'concert',\n 'conduct',\n 'confirm',\n 'congress',\n 'connect',\n 'consider',\n 'control',\n 'convince',\n 'cook',\n 'cool',\n 'copper',\n 'copy',\n 'coral',\n 'core',\n 'corn',\n 'correct',\n 'cost',\n 'cotton',\n 'couch',\n 'country',\n 'couple',\n 'course',\n 'cousin',\n 'cover',\n 'coyote',\n 'crack',\n 'cradle',\n 'craft',\n 'cram',\n 'crane',\n 'crash',\n 'crater',\n 'crawl',\n 'crazy',\n 'cream',\n 'credit',\n 'creek',\n 'crew',\n 'cricket',\n 'crime',\n 'crisp',\n 'critic',\n 'crop',\n 'cross',\n 'crouch',\n 'crowd',\n 'crucial',\n 'cruel',\n 'cruise',\n 'crumble',\n 'crunch',\n 'crush',\n 'cry',\n 'crystal',\n 'cube',\n 'culture',\n 'cup',\n 'cupboard',\n 'curious',\n 'current',\n 'curtain',\n 'curve',\n 'cushion',\n 'custom',\n 'cute',\n 'cycle',\n 'dad',\n 'damage',\n 'damp',\n 'dance',\n 'danger',\n 'daring',\n 'dash',\n 'daughter',\n 'dawn',\n 'day',\n 'deal',\n 'debate',\n 'debris',\n 'decade',\n 'december',\n 'decide',\n 'decline',\n 'decorate',\n 'decrease',\n 'deer',\n 'defense',\n 'define',\n 'defy',\n 'degree',\n 'delay',\n 'deliver',\n 'demand',\n 'demise',\n 'denial',\n 'dentist',\n 'deny',\n 'depart',\n 'depend',\n 'deposit',\n 'depth',\n 'deputy',\n 'derive',\n 'describe',\n 'desert',\n 'design',\n 'desk',\n 'despair',\n 'destroy',\n 'detail',\n 'detect',\n 'develop',\n 'device',\n 'devote',\n 'diagram',\n 'dial',\n 'diamond',\n 'diary',\n 'dice',\n 'diesel',\n 'diet',\n 'differ',\n 'digital',\n 'dignity',\n 'dilemma',\n 'dinner',\n 'dinosaur',\n 'direct',\n 'dirt',\n 'disagree',\n 'discover',\n 'disease',\n 'dish',\n 'dismiss',\n 'disorder',\n 'display',\n 'distance',\n 'divert',\n 'divide',\n 'divorce',\n 'dizzy',\n 'doctor',\n 'document',\n 'dog',\n 'doll',\n 'dolphin',\n 'domain',\n 'donate',\n 'donkey',\n 'donor',\n 'door',\n 'dose',\n 'double',\n 'dove',\n 'draft',\n 'dragon',\n 'drama',\n 'drastic',\n 'draw',\n 'dream',\n 'dress',\n 'drift',\n 'drill',\n 'drink',\n 'drip',\n 'drive',\n 'drop',\n 'drum',\n 'dry',\n 'duck',\n 'dumb',\n 'dune',\n 'during',\n 'dust',\n 'dutch',\n 'duty',\n 'dwarf',\n 'dynamic',\n 'eager',\n 'eagle',\n 'early',\n 'earn',\n 'earth',\n 'easily',\n 'east',\n 'easy',\n 'echo',\n 'ecology',\n 'economy',\n 'edge',\n 'edit',\n 'educate',\n 'effort',\n 'egg',\n 'eight',\n 'either',\n 'elbow',\n 'elder',\n 'electric',\n 'elegant',\n 'element',\n 'elephant',\n 'elevator',\n 'elite',\n 'else',\n 'embark',\n 'embody',\n 'embrace',\n 'emerge',\n 'emotion',\n 'employ',\n 'empower',\n 'empty',\n 'enable',\n 'enact',\n 'end',\n 'endless',\n 'endorse',\n 'enemy',\n 'energy',\n 'enforce',\n 'engage',\n 'engine',\n 'enhance',\n 'enjoy',\n 'enlist',\n 'enough',\n 'enrich',\n 'enroll',\n 'ensure',\n 'enter',\n 'entire',\n 'entry',\n 'envelope',\n 'episode',\n 'equal',\n 'equip',\n 'era',\n 'erase',\n 'erode',\n 'erosion',\n 'error',\n 'erupt',\n 'escape',\n 'essay',\n 'essence',\n 'estate',\n 'eternal',\n 'ethics',\n 'evidence',\n 'evil',\n 'evoke',\n 'evolve',\n 'exact',\n 'example',\n 'excess',\n 'exchange',\n 'excite',\n 'exclude',\n 'excuse',\n 'execute',\n 'exercise',\n 'exhaust',\n 'exhibit',\n 'exile',\n 'exist',\n 'exit',\n 'exotic',\n 'expand',\n 'expect',\n 'expire',\n 'explain',\n 'expose',\n 'express',\n 'extend',\n 'extra',\n 'eye',\n 'eyebrow',\n 'fabric',\n 'face',\n 'faculty',\n 'fade',\n 'faint',\n 'faith',\n 'fall',\n 'false',\n 'fame',\n 'family',\n 'famous',\n 'fan',\n 'fancy',\n 'fantasy',\n 'farm',\n 'fashion',\n 'fat',\n 'fatal',\n 'father',\n 'fatigue',\n 'fault',\n 'favorite',\n 'feature',\n 'february',\n 'federal',\n 'fee',\n 'feed',\n 'feel',\n 'female',\n 'fence',\n 'festival',\n 'fetch',\n 'fever',\n 'few',\n 'fiber',\n 'fiction',\n 'field',\n 'figure',\n 'file',\n 'film',\n 'filter',\n 'final',\n 'find',\n 'fine',\n 'finger',\n 'finish',\n 'fire',\n 'firm',\n 'first',\n 'fiscal',\n 'fish',\n 'fit',\n 'fitness',\n 'fix',\n 'flag',\n 'flame',\n 'flash',\n 'flat',\n 'flavor',\n 'flee',\n 'flight',\n 'flip',\n 'float',\n 'flock',\n 'floor',\n 'flower',\n 'fluid',\n 'flush',\n 'fly',\n 'foam',\n 'focus',\n 'fog',\n 'foil',\n 'fold',\n 'follow',\n 'food',\n 'foot',\n 'force',\n 'forest',\n 'forget',\n 'fork',\n 'fortune',\n 'forum',\n 'forward',\n 'fossil',\n 'foster',\n 'found',\n 'fox',\n 'fragile',\n 'frame',\n 'frequent',\n 'fresh',\n 'friend',\n 'fringe',\n 'frog',\n 'front',\n 'frost',\n 'frown',\n 'frozen',\n 'fruit',\n 'fuel',\n 'fun',\n 'funny',\n 'furnace',\n 'fury',\n 'future',\n 'gadget',\n 'gain',\n 'galaxy',\n 'gallery',\n 'game',\n 'gap',\n 'garage',\n 'garbage',\n 'garden',\n 'garlic',\n 'garment',\n 'gas',\n 'gasp',\n 'gate',\n 'gather',\n 'gauge',\n 'gaze',\n 'general',\n 'genius',\n 'genre',\n 'gentle',\n 'genuine',\n 'gesture',\n 'ghost',\n 'giant',\n 'gift',\n 'giggle',\n 'ginger',\n 'giraffe',\n 'girl',\n 'give',\n 'glad',\n 'glance',\n 'glare',\n 'glass',\n 'glide',\n 'glimpse',\n 'globe',\n 'gloom',\n 'glory',\n 'glove',\n 'glow',\n 'glue',\n 'goat',\n 'goddess',\n 'gold',\n 'good',\n 'goose',\n 'gorilla',\n 'gospel',\n 'gossip',\n 'govern',\n 'gown',\n 'grab',\n 'grace',\n 'grain',\n 'grant',\n 'grape',\n 'grass',\n 'gravity',\n 'great',\n 'green',\n 'grid',\n 'grief',\n 'grit',\n 'grocery',\n 'group',\n 'grow',\n 'grunt',\n 'guard',\n 'guess',\n 'guide',\n 'guilt',\n 'guitar',\n 'gun',\n 'gym',\n 'habit',\n 'hair',\n 'half',\n 'hammer',\n 'hamster',\n 'hand',\n 'happy',\n 'harbor',\n 'hard',\n 'harsh',\n 'harvest',\n 'hat',\n 'have',\n 'hawk',\n 'hazard',\n 'head',\n 'health',\n 'heart',\n 'heavy',\n 'hedgehog',\n 'height',\n 'hello',\n 'helmet',\n 'help',\n 'hen',\n 'hero',\n 'hidden',\n 'high',\n 'hill',\n 'hint',\n 'hip',\n 'hire',\n 'history',\n 'hobby',\n 'hockey',\n 'hold',\n 'hole',\n 'holiday',\n 'hollow',\n 'home',\n 'honey',\n 'hood',\n 'hope',\n 'horn',\n 'horror',\n 'horse',\n 'hospital',\n 'host',\n 'hotel',\n 'hour',\n 'hover',\n 'hub',\n 'huge',\n 'human',\n 'humble',\n 'humor',\n 'hundred',\n 'hungry',\n 'hunt',\n 'hurdle',\n 'hurry',\n 'hurt',\n 'husband',\n 'hybrid',\n 'ice',\n 'icon',\n 'idea',\n 'identify',\n 'idle',\n 'ignore',\n 'ill',\n 'illegal',\n 'illness',\n 'image',\n 'imitate',\n 'immense',\n 'immune',\n 'impact',\n 'impose',\n 'improve',\n 'impulse',\n 'inch',\n 'include',\n 'income',\n 'increase',\n 'index',\n 'indicate',\n 'indoor',\n 'industry',\n 'infant',\n 'inflict',\n 'inform',\n 'inhale',\n 'inherit',\n 'initial',\n 'inject',\n 'injury',\n 'inmate',\n 'inner',\n 'innocent',\n 'input',\n 'inquiry',\n 'insane',\n 'insect',\n 'inside',\n 'inspire',\n 'install',\n 'intact',\n 'interest',\n 'into',\n 'invest',\n 'invite',\n 'involve',\n 'iron',\n 'island',\n 'isolate',\n 'issue',\n 'item',\n 'ivory',\n 'jacket',\n 'jaguar',\n 'jar',\n 'jazz',\n 'jealous',\n 'jeans',\n 'jelly',\n 'jewel',\n 'job',\n 'join',\n 'joke',\n 'journey',\n 'joy',\n 'judge',\n 'juice',\n 'jump',\n 'jungle',\n 'junior',\n 'junk',\n 'just',\n 'kangaroo',\n 'keen',\n 'keep',\n 'ketchup',\n 'key',\n 'kick',\n 'kid',\n 'kidney',\n 'kind',\n 'kingdom',\n 'kiss',\n 'kit',\n 'kitchen',\n 'kite',\n 'kitten',\n 'kiwi',\n 'knee',\n 'knife',\n 'knock',\n 'know',\n 'lab',\n 'label',\n 'labor',\n 'ladder',\n 'lady',\n 'lake',\n 'lamp',\n 'language',\n 'laptop',\n 'large',\n 'later',\n 'latin',\n 'laugh',\n 'laundry',\n 'lava',\n 'law',\n 'lawn',\n 'lawsuit',\n 'layer',\n 'lazy',\n 'leader',\n 'leaf',\n 'learn',\n 'leave',\n 'lecture',\n 'left',\n 'leg',\n 'legal',\n 'legend',\n 'leisure',\n 'lemon',\n 'lend',\n 'length',\n 'lens',\n 'leopard',\n 'lesson',\n 'letter',\n 'level',\n 'liar',\n 'liberty',\n 'library',\n 'license',\n 'life',\n 'lift',\n 'light',\n 'like',\n 'limb',\n 'limit',\n 'link',\n 'lion',\n 'liquid',\n 'list',\n 'little',\n 'live',\n 'lizard',\n 'load',\n 'loan',\n 'lobster',\n 'local',\n 'lock',\n 'logic',\n 'lonely',\n 'long',\n 'loop',\n 'lottery',\n 'loud',\n 'lounge',\n 'love',\n 'loyal',\n 'lucky',\n 'luggage',\n 'lumber',\n 'lunar',\n 'lunch',\n 'luxury',\n 'lyrics',\n 'machine',\n 'mad',\n 'magic',\n 'magnet',\n 'maid',\n 'mail',\n 'main',\n 'major',\n 'make',\n 'mammal',\n 'man',\n 'manage',\n 'mandate',\n 'mango',\n 'mansion',\n 'manual',\n 'maple',\n 'marble',\n 'march',\n 'margin',\n 'marine',\n 'market',\n 'marriage',\n 'mask',\n 'mass',\n 'master',\n 'match',\n 'material',\n 'math',\n 'matrix',\n 'matter',\n 'maximum',\n 'maze',\n 'meadow',\n 'mean',\n 'measure',\n 'meat',\n 'mechanic',\n 'medal',\n 'media',\n 'melody',\n 'melt',\n 'member',\n 'memory',\n 'mention',\n 'menu',\n 'mercy',\n 'merge',\n 'merit',\n 'merry',\n 'mesh',\n 'message',\n 'metal',\n 'method',\n 'middle',\n 'midnight',\n 'milk',\n 'million',\n 'mimic',\n 'mind',\n 'minimum',\n 'minor',\n 'minute',\n 'miracle',\n 'mirror',\n 'misery',\n 'miss',\n 'mistake',\n 'mix',\n 'mixed',\n 'mixture',\n 'mobile',\n 'model',\n 'modify',\n 'mom',\n 'moment',\n 'monitor',\n 'monkey',\n 'monster',\n 'month',\n 'moon',\n 'moral',\n 'more',\n 'morning',\n 'mosquito',\n 'mother',\n 'motion',\n 'motor',\n 'mountain',\n 'mouse',\n 'move',\n 'movie',\n 'much',\n 'muffin',\n 'mule',\n 'multiply',\n 'muscle',\n 'museum',\n 'mushroom',\n 'music',\n 'must',\n 'mutual',\n 'myself',\n 'mystery',\n 'myth',\n 'naive',\n 'name',\n 'napkin',\n 'narrow',\n 'nasty',\n 'nation',\n 'nature',\n 'near',\n 'neck',\n 'need',\n 'negative',\n 'neglect',\n 'neither',\n 'nephew',\n 'nerve',\n 'nest',\n 'net',\n 'network',\n 'neutral',\n 'never',\n 'news',\n 'next',\n 'nice',\n 'night',\n 'noble',\n 'noise',\n 'nominee',\n 'noodle',\n 'normal',\n 'north',\n 'nose',\n 'notable',\n 'note',\n 'nothing',\n 'notice',\n 'novel',\n 'now',\n 'nuclear',\n 'number',\n 'nurse',\n 'nut',\n 'oak',\n 'obey',\n 'object',\n 'oblige',\n 'obscure',\n 'observe',\n 'obtain',\n 'obvious',\n 'occur',\n 'ocean',\n 'october',\n 'odor',\n 'off',\n 'offer',\n 'office',\n 'often',\n 'oil',\n 'okay',\n 'old',\n 'olive',\n 'olympic',\n 'omit',\n 'once',\n 'one',\n 'onion',\n 'online',\n 'only',\n 'open',\n 'opera',\n 'opinion',\n 'oppose',\n 'option',\n 'orange',\n 'orbit',\n 'orchard',\n 'order',\n 'ordinary',\n 'organ',\n 'orient',\n 'original',\n 'orphan',\n 'ostrich',\n 'other',\n 'outdoor',\n 'outer',\n 'output',\n 'outside',\n 'oval',\n 'oven',\n 'over',\n 'own',\n 'owner',\n 'oxygen',\n 'oyster',\n 'ozone',\n 'pact',\n 'paddle',\n 'page',\n 'pair',\n 'palace',\n 'palm',\n 'panda',\n 'panel',\n 'panic',\n 'panther',\n 'paper',\n 'parade',\n 'parent',\n 'park',\n 'parrot',\n 'party',\n 'pass',\n 'patch',\n 'path',\n 'patient',\n 'patrol',\n 'pattern',\n 'pause',\n 'pave',\n 'payment',\n 'peace',\n 'peanut',\n 'pear',\n 'peasant',\n 'pelican',\n 'pen',\n 'penalty',\n 'pencil',\n 'people',\n 'pepper',\n 'perfect',\n 'permit',\n 'person',\n 'pet',\n 'phone',\n 'photo',\n 'phrase',\n 'physical',\n 'piano',\n 'picnic',\n 'picture',\n 'piece',\n 'pig',\n 'pigeon',\n 'pill',\n 'pilot',\n 'pink',\n 'pioneer',\n 'pipe',\n 'pistol',\n 'pitch',\n 'pizza',\n 'place',\n 'planet',\n 'plastic',\n 'plate',\n 'play',\n 'please',\n 'pledge',\n 'pluck',\n 'plug',\n 'plunge',\n 'poem',\n 'poet',\n 'point',\n 'polar',\n 'pole',\n 'police',\n 'pond',\n 'pony',\n 'pool',\n 'popular',\n 'portion',\n 'position',\n 'possible',\n 'post',\n 'potato',\n 'pottery',\n 'poverty',\n 'powder',\n 'power',\n 'practice',\n 'praise',\n 'predict',\n 'prefer',\n 'prepare',\n 'present',\n 'pretty',\n 'prevent',\n 'price',\n 'pride',\n 'primary',\n 'print',\n 'priority',\n 'prison',\n 'private',\n 'prize',\n 'problem',\n 'process',\n 'produce',\n 'profit',\n 'program',\n 'project',\n 'promote',\n 'proof',\n 'property',\n 'prosper',\n 'protect',\n 'proud',\n 'provide',\n 'public',\n 'pudding',\n 'pull',\n 'pulp',\n 'pulse',\n 'pumpkin',\n 'punch',\n 'pupil',\n 'puppy',\n 'purchase',\n 'purity',\n 'purpose',\n 'purse',\n 'push',\n 'put',\n 'puzzle',\n 'pyramid',\n 'quality',\n 'quantum',\n 'quarter',\n 'question',\n 'quick',\n 'quit',\n 'quiz',\n 'quote',\n 'rabbit',\n 'raccoon',\n 'race',\n 'rack',\n 'radar',\n 'radio',\n 'rail',\n 'rain',\n 'raise',\n 'rally',\n 'ramp',\n 'ranch',\n 'random',\n 'range',\n 'rapid',\n 'rare',\n 'rate',\n 'rather',\n 'raven',\n 'raw',\n 'razor',\n 'ready',\n 'real',\n 'reason',\n 'rebel',\n 'rebuild',\n 'recall',\n 'receive',\n 'recipe',\n 'record',\n 'recycle',\n 'reduce',\n 'reflect',\n 'reform',\n 'refuse',\n 'region',\n 'regret',\n 'regular',\n 'reject',\n 'relax',\n 'release',\n 'relief',\n 'rely',\n 'remain',\n 'remember',\n 'remind',\n 'remove',\n 'render',\n 'renew',\n 'rent',\n 'reopen',\n 'repair',\n 'repeat',\n 'replace',\n 'report',\n 'require',\n 'rescue',\n 'resemble',\n 'resist',\n 'resource',\n 'response',\n 'result',\n 'retire',\n 'retreat',\n 'return',\n 'reunion',\n 'reveal',\n 'review',\n 'reward',\n 'rhythm',\n 'rib',\n 'ribbon',\n 'rice',\n 'rich',\n 'ride',\n 'ridge',\n 'rifle',\n 'right',\n 'rigid',\n 'ring',\n 'riot',\n 'ripple',\n 'risk',\n 'ritual',\n 'rival',\n 'river',\n 'road',\n 'roast',\n 'robot',\n 'robust',\n 'rocket',\n 'romance',\n 'roof',\n 'rookie',\n 'room',\n 'rose',\n 'rotate',\n 'rough',\n 'round',\n 'route',\n 'royal',\n 'rubber',\n 'rude',\n 'rug',\n 'rule',\n 'run',\n 'runway',\n 'rural',\n 'sad',\n 'saddle',\n 'sadness',\n 'safe',\n 'sail',\n 'salad',\n 'salmon',\n 'salon',\n 'salt',\n 'salute',\n 'same',\n 'sample',\n 'sand',\n 'satisfy',\n 'satoshi',\n 'sauce',\n 'sausage',\n 'save',\n 'say',\n 'scale',\n 'scan',\n 'scare',\n 'scatter',\n 'scene',\n 'scheme',\n 'school',\n 'science',\n 'scissors',\n 'scorpion',\n 'scout',\n 'scrap',\n 'screen',\n 'script',\n 'scrub',\n 'sea',\n 'search',\n 'season',\n 'seat',\n 'second',\n 'secret',\n 'section',\n 'security',\n 'seed',\n 'seek',\n 'segment',\n 'select',\n 'sell',\n 'seminar',\n 'senior',\n 'sense',\n 'sentence',\n 'series',\n 'service',\n 'session',\n 'settle',\n 'setup',\n 'seven',\n 'shadow',\n 'shaft',\n 'shallow',\n 'share',\n 'shed',\n 'shell',\n 'sheriff',\n 'shield',\n 'shift',\n 'shine',\n 'ship',\n 'shiver',\n 'shock',\n 'shoe',\n 'shoot',\n 'shop',\n 'short',\n 'shoulder',\n 'shove',\n 'shrimp',\n 'shrug',\n 'shuffle',\n 'shy',\n 'sibling',\n 'sick',\n 'side',\n 'siege',\n 'sight',\n 'sign',\n 'silent',\n 'silk',\n 'silly',\n 'silver',\n 'similar',\n 'simple',\n 'since',\n 'sing',\n 'siren',\n 'sister',\n 'situate',\n 'six',\n 'size',\n 'skate',\n 'sketch',\n 'ski',\n 'skill',\n 'skin',\n 'skirt',\n 'skull',\n 'slab',\n 'slam',\n 'sleep',\n 'slender',\n 'slice',\n 'slide',\n 'slight',\n 'slim',\n 'slogan',\n 'slot',\n 'slow',\n 'slush',\n 'small',\n 'smart',\n 'smile',\n 'smoke',\n 'smooth',\n 'snack',\n 'snake',\n 'snap',\n 'sniff',\n 'snow',\n 'soap',\n 'soccer',\n 'social',\n 'sock',\n 'soda',\n 'soft',\n 'solar',\n 'soldier',\n 'solid',\n 'solution',\n 'solve',\n 'someone',\n 'song',\n 'soon',\n 'sorry',\n 'sort',\n 'soul',\n 'sound',\n 'soup',\n 'source',\n 'south',\n 'space',\n 'spare',\n 'spatial',\n 'spawn',\n 'speak',\n 'special',\n 'speed',\n 'spell',\n 'spend',\n 'sphere',\n 'spice',\n 'spider',\n 'spike',\n 'spin',\n 'spirit',\n 'split',\n 'spoil',\n 'sponsor',\n 'spoon',\n 'sport',\n 'spot',\n 'spray',\n 'spread',\n 'spring',\n 'spy',\n 'square',\n 'squeeze',\n 'squirrel',\n 'stable',\n 'stadium',\n 'staff',\n 'stage',\n 'stairs',\n 'stamp',\n 'stand',\n 'start',\n 'state',\n 'stay',\n 'steak',\n 'steel',\n 'stem',\n 'step',\n 'stereo',\n 'stick',\n 'still',\n 'sting',\n 'stock',\n 'stomach',\n 'stone',\n 'stool',\n 'story',\n 'stove',\n 'strategy',\n 'street',\n 'strike',\n 'strong',\n 'struggle',\n 'student',\n 'stuff',\n 'stumble',\n 'style',\n 'subject',\n 'submit',\n 'subway',\n 'success',\n 'such',\n 'sudden',\n 'suffer',\n 'sugar',\n 'suggest',\n 'suit',\n 'summer',\n 'sun',\n 'sunny',\n 'sunset',\n 'super',\n 'supply',\n 'supreme',\n 'sure',\n 'surface',\n 'surge',\n 'surprise',\n 'surround',\n 'survey',\n 'suspect',\n 'sustain',\n 'swallow',\n 'swamp',\n 'swap',\n 'swarm',\n 'swear',\n 'sweet',\n 'swift',\n 'swim',\n 'swing',\n 'switch',\n 'sword',\n 'symbol',\n 'symptom',\n 'syrup',\n 'system',\n 'table',\n 'tackle',\n 'tag',\n 'tail',\n 'talent',\n 'talk',\n 'tank',\n 'tape',\n 'target',\n 'task',\n 'taste',\n 'tattoo',\n 'taxi',\n 'teach',\n 'team',\n 'tell',\n 'ten',\n 'tenant',\n 'tennis',\n 'tent',\n 'term',\n 'test',\n 'text',\n 'thank',\n 'that',\n 'theme',\n 'then',\n 'theory',\n 'there',\n 'they',\n 'thing',\n 'this',\n 'thought',\n 'three',\n 'thrive',\n 'throw',\n 'thumb',\n 'thunder',\n 'ticket',\n 'tide',\n 'tiger',\n 'tilt',\n 'timber',\n 'time',\n 'tiny',\n 'tip',\n 'tired',\n 'tissue',\n 'title',\n 'toast',\n 'tobacco',\n 'today',\n 'toddler',\n 'toe',\n 'together',\n 'toilet',\n 'token',\n 'tomato',\n 'tomorrow',\n 'tone',\n 'tongue',\n 'tonight',\n 'tool',\n 'tooth',\n 'top',\n 'topic',\n 'topple',\n 'torch',\n 'tornado',\n 'tortoise',\n 'toss',\n 'total',\n 'tourist',\n 'toward',\n 'tower',\n 'town',\n 'toy',\n 'track',\n 'trade',\n 'traffic',\n 'tragic',\n 'train',\n 'transfer',\n 'trap',\n 'trash',\n 'travel',\n 'tray',\n 'treat',\n 'tree',\n 'trend',\n 'trial',\n 'tribe',\n 'trick',\n 'trigger',\n 'trim',\n 'trip',\n 'trophy',\n 'trouble',\n 'truck',\n 'true',\n 'truly',\n 'trumpet',\n 'trust',\n 'truth',\n 'try',\n 'tube',\n 'tuition',\n 'tumble',\n 'tuna',\n 'tunnel',\n 'turkey',\n 'turn',\n 'turtle',\n 'twelve',\n 'twenty',\n 'twice',\n 'twin',\n 'twist',\n 'two',\n 'type',\n 'typical',\n 'ugly',\n 'umbrella',\n 'unable',\n 'unaware',\n 'uncle',\n 'uncover',\n 'under',\n 'undo',\n 'unfair',\n 'unfold',\n 'unhappy',\n 'uniform',\n 'unique',\n 'unit',\n 'universe',\n 'unknown',\n 'unlock',\n 'until',\n 'unusual',\n 'unveil',\n 'update',\n 'upgrade',\n 'uphold',\n 'upon',\n 'upper',\n 'upset',\n 'urban',\n 'urge',\n 'usage',\n 'use',\n 'used',\n 'useful',\n 'useless',\n 'usual',\n 'utility',\n 'vacant',\n 'vacuum',\n 'vague',\n 'valid',\n 'valley',\n 'valve',\n 'van',\n 'vanish',\n 'vapor',\n 'various',\n 'vast',\n 'vault',\n 'vehicle',\n 'velvet',\n 'vendor',\n 'venture',\n 'venue',\n 'verb',\n 'verify',\n 'version',\n 'very',\n 'vessel',\n 'veteran',\n 'viable',\n 'vibrant',\n 'vicious',\n 'victory',\n 'video',\n 'view',\n 'village',\n 'vintage',\n 'violin',\n 'virtual',\n 'virus',\n 'visa',\n 'visit',\n 'visual',\n 'vital',\n 'vivid',\n 'vocal',\n 'voice',\n 'void',\n 'volcano',\n 'volume',\n 'vote',\n 'voyage',\n 'wage',\n 'wagon',\n 'wait',\n 'walk',\n 'wall',\n 'walnut',\n 'want',\n 'warfare',\n 'warm',\n 'warrior',\n 'wash',\n 'wasp',\n 'waste',\n 'water',\n 'wave',\n 'way',\n 'wealth',\n 'weapon',\n 'wear',\n 'weasel',\n 'weather',\n 'web',\n 'wedding',\n 'weekend',\n 'weird',\n 'welcome',\n 'west',\n 'wet',\n 'whale',\n 'what',\n 'wheat',\n 'wheel',\n 'when',\n 'where',\n 'whip',\n 'whisper',\n 'wide',\n 'width',\n 'wife',\n 'wild',\n 'will',\n 'win',\n 'window',\n 'wine',\n 'wing',\n 'wink',\n 'winner',\n 'winter',\n 'wire',\n 'wisdom',\n 'wise',\n 'wish',\n 'witness',\n 'wolf',\n 'woman',\n 'wonder',\n 'wood',\n 'wool',\n 'word',\n 'work',\n 'world',\n 'worry',\n 'worth',\n 'wrap',\n 'wreck',\n 'wrestle',\n 'wrist',\n 'write',\n 'wrong',\n 'yard',\n 'year',\n 'yellow',\n 'you',\n 'young',\n 'youth',\n 'zebra',\n 'zero',\n 'zone',\n 'zoo',\n];\n","export { english } from './words/english';\n\nexport enum Language {\n 'english' = 'english',\n}\n","import { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { sha256 } from '@fuel-ts/hasher';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { arrayify } from '@fuel-ts/utils';\n\n/* Mnemonic phrase composed by words from the provided wordlist it can be a text or a array of words */\nexport type MnemonicPhrase = string | Array<string>;\n\n// Returns a byte with the LSB bits set\nfunction getLowerMask(bits: number): number {\n return (1 << bits) - 1;\n}\n\n// Returns a byte with the MSB bits set\nfunction getUpperMask(bits: number): number {\n return ((1 << bits) - 1) << (8 - bits);\n}\n\nexport function getWords(mnemonic: MnemonicPhrase): Array<string> {\n if (!Array.isArray(mnemonic)) {\n return mnemonic.split(/\\s+/);\n }\n return mnemonic;\n}\n\nexport function getPhrase(mnemonic: MnemonicPhrase): string {\n if (Array.isArray(mnemonic)) {\n return mnemonic.join(' ');\n }\n return mnemonic;\n}\n\nexport function entropyToMnemonicIndices(entropy: Uint8Array): Array<number> {\n const indices: Array<number> = [0];\n\n let remainingBits = 11;\n for (let i = 0; i < entropy.length; i += 1) {\n if (remainingBits > 8) {\n indices[indices.length - 1] <<= 8;\n indices[indices.length - 1] |= entropy[i];\n\n remainingBits -= 8;\n // This byte will complete an 11-bit index\n } else {\n indices[indices.length - 1] <<= remainingBits;\n indices[indices.length - 1] |= entropy[i] >> (8 - remainingBits);\n\n // Start the next word\n indices.push(entropy[i] & getLowerMask(8 - remainingBits));\n\n remainingBits += 3;\n }\n }\n\n // Compute the checksum bits\n const checksumBits = entropy.length / 4;\n const checksum = arrayify(sha256(entropy))[0] & getUpperMask(checksumBits);\n\n // Shift the checksum into the word indices\n indices[indices.length - 1] <<= checksumBits;\n indices[indices.length - 1] |= checksum >> (8 - checksumBits);\n\n return indices;\n}\n\nexport function mnemonicWordsToEntropy(words: Array<string>, wordlist: Array<string>): BytesLike {\n const size = Math.ceil((11 * words.length) / 8);\n const entropy = arrayify(new Uint8Array(size));\n\n let offset = 0;\n for (let i = 0; i < words.length; i += 1) {\n const index = wordlist.indexOf(words[i].normalize('NFKD'));\n if (index === -1) {\n throw new FuelError(\n ErrorCode.INVALID_MNEMONIC,\n `Invalid mnemonic: the word '${words[i]}' is not found in the provided wordlist.`\n );\n }\n\n for (let bit = 0; bit < 11; bit += 1) {\n if (index & (1 << (10 - bit))) {\n entropy[offset >> 3] |= 1 << (7 - (offset % 8));\n }\n offset += 1;\n }\n }\n const entropyBits = (32 * words.length) / 3;\n const checksumBits = words.length / 3;\n const checksumMask = getUpperMask(checksumBits);\n const checksum = arrayify(sha256(entropy.slice(0, entropyBits / 8)))[0] & checksumMask;\n\n if (checksum !== (entropy[entropy.length - 1] & checksumMask)) {\n throw new FuelError(\n ErrorCode.INVALID_CHECKSUM,\n 'Checksum validation failed for the provided mnemonic.'\n );\n }\n\n return entropy.slice(0, entropyBits / 8);\n}\n","//\n// Because WalletLocked and WalletUnlocked has a cycle dependency\n// it's not possible to split the two classes in different files\n//\n/* eslint-disable max-classes-per-file */\nimport type { BytesLike } from '@fuel-ts/utils';\n\nimport { Account } from '../account';\nimport { HDWallet } from '../hdwallet';\nimport { Mnemonic } from '../mnemonic';\nimport type { Provider } from '../providers';\nimport { Signer } from '../signer';\n\nimport { BaseWalletUnlocked } from './base-wallet-unlocked';\nimport { decryptKeystoreWallet } from './keystore-wallet';\n\nexport interface GenerateOptions {\n /** Additional entropy for the random bytes */\n entropy?: BytesLike;\n provider?: Provider;\n}\n\n/**\n * `WalletLocked` provides the functionalities for a locked wallet.\n */\nexport class WalletLocked extends Account {\n /**\n * Unlocks the wallet using the provided private key and returns an instance of WalletUnlocked.\n *\n * @param privateKey - The private key used to unlock the wallet.\n * @returns An instance of WalletUnlocked.\n */\n unlock(privateKey: BytesLike): WalletUnlocked {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return new WalletUnlocked(privateKey, this._provider);\n }\n}\n\n/**\n * `WalletUnlocked` provides the functionalities for an unlocked wallet.\n */\nexport class WalletUnlocked extends BaseWalletUnlocked {\n /**\n * Locks the wallet and returns an instance of WalletLocked.\n *\n * @returns An instance of WalletLocked.\n */\n lock(): WalletLocked {\n this.signer = () => new Signer('0x00');\n return new WalletLocked(this.address, this._provider);\n }\n\n /**\n * Generate a new Wallet Unlocked with a random key pair.\n *\n * @param generateOptions - Options to customize the generation process (optional).\n * @returns An instance of WalletUnlocked.\n */\n static generate(generateOptions?: GenerateOptions): WalletUnlocked {\n const privateKey = Signer.generatePrivateKey(generateOptions?.entropy);\n\n return new WalletUnlocked(privateKey, generateOptions?.provider);\n }\n\n /**\n * Create a Wallet Unlocked from a seed.\n *\n * @param seed - The seed phrase.\n * @param provider - A Provider instance (optional).\n * @param path - The derivation path (optional).\n * @returns An instance of WalletUnlocked.\n */\n static fromSeed(seed: string, path?: string, provider?: Provider): WalletUnlocked {\n const hdWallet = HDWallet.fromSeed(seed);\n const childWallet = hdWallet.derivePath(path || WalletUnlocked.defaultPath);\n\n return new WalletUnlocked(<string>childWallet.privateKey, provider);\n }\n\n /**\n * Create a Wallet Unlocked from a mnemonic phrase.\n *\n * @param mnemonic - The mnemonic phrase.\n * @param provider - A Provider instance (optional).\n * @param path - The derivation path (optional).\n * @param passphrase - The passphrase for the mnemonic (optional).\n * @returns An instance of WalletUnlocked.\n */\n static fromMnemonic(\n mnemonic: string,\n path?: string,\n passphrase?: BytesLike,\n provider?: Provider\n ): WalletUnlocked {\n const seed = Mnemonic.mnemonicToSeed(mnemonic, passphrase);\n const hdWallet = HDWallet.fromSeed(seed);\n const childWallet = hdWallet.derivePath(path || WalletUnlocked.defaultPath);\n\n return new WalletUnlocked(<string>childWallet.privateKey, provider);\n }\n\n /**\n * Create a Wallet Unlocked from an extended key.\n *\n * @param extendedKey - The extended key.\n * @param provider - A Provider instance (optional).\n * @returns An instance of WalletUnlocked.\n */\n static fromExtendedKey(extendedKey: string, provider?: Provider): WalletUnlocked {\n const hdWallet = HDWallet.fromExtendedKey(extendedKey);\n\n return new WalletUnlocked(<string>hdWallet.privateKey, provider);\n }\n\n /**\n * Create a Wallet Unlocked from an encrypted JSON.\n *\n * @param jsonWallet - The encrypted JSON keystore.\n * @param password - The password to decrypt the JSON.\n * @param provider - A Provider instance (optional).\n * @returns An unlocked wallet instance.\n */\n static async fromEncryptedJson(\n jsonWallet: string,\n password: string,\n provider?: Provider\n ): Promise<WalletUnlocked> {\n const privateKey = await decryptKeystoreWallet(jsonWallet, password);\n\n return new WalletUnlocked(privateKey, provider);\n }\n}\n","import type { Address } from '@fuel-ts/address';\nimport type { BytesLike } from '@fuel-ts/utils';\n\nimport type { Provider } from '../providers';\n\nimport { WalletLocked, WalletUnlocked } from './wallets';\n\n/**\n * `Wallet` provides methods to create locked and unlocked wallet instances.\n */\nexport class Wallet {\n /**\n * Creates a locked wallet instance from an address and a provider.\n *\n * @param address - The address of the wallet.\n * @param provider - A Provider instance (optional).\n * @returns A locked wallet instance.\n */\n static fromAddress(address: string | Address, provider?: Provider): WalletLocked {\n return new WalletLocked(address, provider);\n }\n\n /**\n * Creates an unlocked wallet instance from a private key and a provider.\n *\n * @param privateKey - The private key of the wallet.\n * @param provider - A Provider instance (optional).\n * @returns An unlocked wallet instance.\n */\n static fromPrivateKey(privateKey: BytesLike, provider?: Provider) {\n return new WalletUnlocked(privateKey, provider);\n }\n\n /**\n * Generate a new Wallet Unlocked with a random key pair.\n *\n * @param generateOptions - Options to customize the generation process (optional).\n * @returns An unlocked wallet instance.\n */\n static generate = WalletUnlocked.generate;\n\n /**\n * Create a Wallet Unlocked from a seed.\n *\n * @param seed - The seed phrase.\n * @param provider - A Provider instance (optional).\n * @param path - The derivation path (optional).\n * @returns An unlocked wallet instance.\n */\n static fromSeed = WalletUnlocked.fromSeed;\n\n /**\n * Create a Wallet Unlocked from a mnemonic phrase.\n *\n * @param mnemonic - The mnemonic phrase.\n * @param provider - A Provider instance (optional).\n * @param path - The derivation path (optional).\n * @param passphrase - The passphrase for the mnemonic (optional).\n * @returns An unlocked wallet instance.\n */\n static fromMnemonic = WalletUnlocked.fromMnemonic;\n\n /**\n * Create a Wallet Unlocked from an extended key.\n *\n * @param extendedKey - The extended key.\n * @param provider - A Provider instance (optional).\n * @returns An unlocked wallet instance.\n */\n static fromExtendedKey = WalletUnlocked.fromExtendedKey;\n\n /**\n * Create a Wallet Unlocked from an encrypted JSON.\n *\n * @param jsonWallet - The encrypted JSON keystore.\n * @param password - The password to decrypt the JSON.\n * @param provider - A Provider instance (optional).\n * @returns An unlocked wallet instance.\n */\n static fromEncryptedJson = WalletUnlocked.fromEncryptedJson;\n}\n","import { Address } from '@fuel-ts/address';\nimport type { Keystore } from '@fuel-ts/crypto';\nimport { encrypt, decrypt } from '@fuel-ts/crypto';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { EventEmitter } from 'events';\n\nimport type { WalletUnlocked } from '../wallet';\n\nimport { MemoryStorage } from './storages/memory-storage';\nimport type {\n StorageAbstract,\n WalletManagerAccount,\n VaultConfig,\n VaultsState,\n WalletManagerOptions,\n WalletManagerState,\n Vault,\n} from './types';\nimport { MnemonicVault } from './vaults/mnemonic-vault';\nimport { PrivateKeyVault } from './vaults/privatekey-vault';\n\nconst ERROR_MESSAGES = {\n invalid_vault_type: 'The provided Vault type is invalid.',\n address_not_found: 'No private key found for address the specified wallet address.',\n vault_not_found: 'The specified vault was not found.',\n wallet_not_unlocked: 'The wallet is currently locked.',\n passphrase_not_match: 'The provided passphrase did not match the expected value.',\n};\n\n/**\n * Generic assert function to avoid undesirable errors\n */\nfunction assert(condition: unknown, message: string): asserts condition {\n if (!condition) {\n throw new FuelError(ErrorCode.WALLET_MANAGER_ERROR, message);\n }\n}\n\n/**\n * WalletManager is a upper package to manage multiple vaults like mnemonic and privateKeys.\n *\n * - VaultTypes can be add to `WalletManager.Vaults` enabling to add custom Vault types.\n * - Storage can be instantiate when initializing enabling custom storage types.\n */\nexport class WalletManager extends EventEmitter {\n /**\n * Vaults\n *\n * Vaults are responsible to store secret keys and return an `Wallet` instance,\n * to interact with the network.\n *\n * Each vault has access to its own state\n *\n */\n static Vaults = [MnemonicVault, PrivateKeyVault];\n /**\n * Storage\n *\n * Persistent encrypted data. `The default storage works only on memory`.\n */\n readonly storage: StorageAbstract = new MemoryStorage();\n /* Key name passed to the storage */\n readonly STORAGE_KEY: string = 'WalletManager';\n\n // `This variables are only accessible from inside the class`\n #vaults: VaultsState = [];\n #passphrase = '';\n #isLocked: boolean = true;\n\n constructor(options?: WalletManagerOptions) {\n super();\n this.storage = options?.storage || this.storage;\n }\n\n get isLocked(): boolean {\n return this.#isLocked;\n }\n\n /**\n * Return the vault serialized object containing all the privateKeys,\n * the format of the return depends on the Vault type.\n */\n exportVault<T extends Vault>(vaultId: number): ReturnType<T['serialize']> {\n assert(!this.#isLocked, ERROR_MESSAGES.wallet_not_unlocked);\n const vaultState = this.#vaults.find((_, idx) => idx === vaultId);\n assert(vaultState, ERROR_MESSAGES.vault_not_found);\n return vaultState.vault.serialize() as ReturnType<T['serialize']>;\n }\n\n /**\n * List all vaults on the Wallet Manager, this function not return secret's\n */\n getVaults(): Array<{ title?: string; type: string; vaultId: number }> {\n return this.#vaults.map((v, idx) => ({\n title: v.title,\n type: v.type,\n vaultId: idx,\n }));\n }\n\n /**\n * List all accounts on the Wallet Manager not vault information is revealed\n */\n getAccounts(): Array<WalletManagerAccount> {\n // Return all WalletManagerAccounts from vaults\n return this.#vaults.flatMap<WalletManagerAccount>((vaultState, vaultId) =>\n vaultState.vault.getAccounts().map((account) => ({ ...account, vaultId }))\n );\n }\n\n /**\n * Create a Wallet instance for the specific account\n */\n getWallet(address: string | Address): WalletUnlocked {\n const ownerAddress = Address.fromAddressOrString(address);\n const vaultState = this.#vaults.find((vs) =>\n vs.vault.getAccounts().find((a) => a.address.equals(ownerAddress))\n );\n assert(vaultState, ERROR_MESSAGES.address_not_found);\n\n return vaultState.vault.getWallet(ownerAddress);\n }\n\n /**\n * Export specific account privateKey\n */\n exportPrivateKey(address: string | Address) {\n const ownerAddress = Address.fromAddressOrString(address);\n assert(!this.#isLocked, ERROR_MESSAGES.wallet_not_unlocked);\n const vaultState = this.#vaults.find((vs) =>\n vs.vault.getAccounts().find((a) => a.address.equals(ownerAddress))\n );\n assert(vaultState, ERROR_MESSAGES.address_not_found);\n\n return vaultState.vault.exportAccount(ownerAddress);\n }\n\n /**\n * Add account to a selected vault or on the first vault as default.\n * If not vaults are adds it will return error\n */\n async addAccount(options?: { vaultId: number }) {\n // Make sure before add new vault state is fully loaded\n await this.loadState();\n // Get vault instance\n const vaultState = this.#vaults[options?.vaultId || 0];\n await assert(vaultState, ERROR_MESSAGES.vault_not_found);\n // Add account on vault\n const account = vaultState.vault.addAccount();\n // Save the accounts state\n await this.saveState();\n // Return account\n return account;\n }\n\n /**\n * Remove vault by index, by remove the vault you also remove all accounts\n * created by the vault.\n */\n async removeVault(index: number) {\n this.#vaults.splice(index, 1);\n await this.saveState();\n }\n\n /**\n * Add Vault, the `vaultConfig.type` will look for the Vaults supported if\n * didn't found it will throw.\n */\n async addVault(vaultConfig: VaultConfig) {\n // Make sure before add new vault state is fully loaded\n await this.loadState();\n // Check if vault is supported\n const Vault = this.getVaultClass(vaultConfig.type);\n // create Vault instance\n const vault = new Vault(vaultConfig);\n // Push vaults to state\n this.#vaults = this.#vaults.concat({\n title: vaultConfig.title,\n type: vaultConfig.type,\n vault,\n });\n // Persist data on storage\n await this.saveState();\n }\n\n /**\n * Lock wallet. It removes passphrase from class instance, encrypt and hide all address and\n * secrets.\n */\n lock() {\n this.#isLocked = true;\n // Clean state vaults from state\n this.#vaults = [];\n // Clean password from state\n this.#passphrase = '';\n // Emit event that wallet is locked\n this.emit('lock');\n }\n\n /**\n * Unlock wallet. It sets passphrase on WalletManger instance load all address from configured vaults.\n * Vaults with secrets are not unlocked or instantiated on this moment.\n */\n async unlock(passphrase: string) {\n // Set password on state\n this.#passphrase = passphrase;\n // Set locked state to false\n this.#isLocked = false;\n // Try to load state with passphrase\n try {\n // Load state with passphrase\n await this.loadState();\n // Emit event that wallet is unlocked\n this.emit('unlock');\n } catch (err) {\n // If passphrase is wrong lock wallet\n await this.lock();\n // Forward error\n throw err;\n }\n }\n\n /**\n * Update WalletManager encryption passphrase\n */\n async updatePassphrase(oldpass: string, newpass: string) {\n const isLocked = this.#isLocked;\n // Unlock wallet to decrypt data\n await this.unlock(oldpass);\n // Set new password on state\n this.#passphrase = newpass;\n // Persist data on storage\n await this.saveState();\n // Load state with new password\n await this.loadState();\n // If wallet was locked, lock the wallet again\n if (isLocked) {\n await this.lock();\n }\n }\n\n /**\n * Retrieve and decrypt WalletManager state from storage\n */\n async loadState() {\n await assert(!this.#isLocked, ERROR_MESSAGES.wallet_not_unlocked);\n\n const data = await this.storage.getItem(this.STORAGE_KEY);\n if (data) {\n const state = await decrypt<WalletManagerState>(this.#passphrase, <Keystore>JSON.parse(data));\n this.#vaults = this.#deserializeVaults(state.vaults);\n }\n }\n\n /**\n * Store encrypted WalletManager state on storage\n */\n private async saveState() {\n await assert(!this.#isLocked, ERROR_MESSAGES.wallet_not_unlocked);\n\n const encryptedData = await encrypt(this.#passphrase, {\n vaults: this.#serializeVaults(this.#vaults),\n });\n await this.storage.setItem(this.STORAGE_KEY, JSON.stringify(encryptedData));\n this.emit('update');\n }\n\n /**\n * Serialize all vaults to store\n *\n * `This is only accessible from inside the class`\n */\n #serializeVaults(vaults: VaultsState) {\n return vaults.map(({ title, type, vault }) => ({\n title,\n type,\n data: vault.serialize(),\n }));\n }\n\n /**\n * Deserialize all vaults to state\n *\n * `This is only accessible from inside the class`\n */\n #deserializeVaults(vaults: VaultsState) {\n return vaults.map(({ title, type, data: vaultConfig }) => {\n const VaultClass = this.getVaultClass(type);\n return {\n title,\n type,\n vault: new VaultClass(<VaultConfig>vaultConfig),\n };\n });\n }\n\n /**\n * Return a instantiable Class reference from `WalletManager.Vaults` supported list.\n */\n private getVaultClass(type: string) {\n const VaultClass = WalletManager.Vaults.find((v) => v.type === type);\n\n assert(VaultClass, ERROR_MESSAGES.invalid_vault_type);\n\n return VaultClass;\n }\n}\n","import type { StorageAbstract } from '../types';\n\nexport class MemoryStorage implements StorageAbstract {\n storage = new Map<string, unknown>();\n\n async getItem<T>(key: string): Promise<T | null> {\n const item = await this.storage.get(key);\n return item as T | null;\n }\n\n async setItem(key: string, value: string) {\n await this.storage.set(key, value);\n }\n\n async removeItem(key: string) {\n await this.storage.delete(key);\n }\n\n async clear() {\n await this.storage.clear();\n }\n}\n","import { Address } from '@fuel-ts/address';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\n\nimport { Mnemonic } from '../../mnemonic';\nimport type { WalletUnlocked } from '../../wallet';\nimport { Wallet } from '../../wallet';\nimport type { Vault } from '../types';\n\nexport interface MnemonicVaultOptions {\n secret?: string;\n rootPath?: string;\n numberOfAccounts?: number | null;\n}\n\nexport class MnemonicVault implements Vault<MnemonicVaultOptions> {\n static readonly type = 'mnemonic';\n readonly #secret: string;\n\n pathKey = '{}';\n rootPath: string = `m/44'/1179993420'/${this.pathKey}'/0/0`;\n numberOfAccounts: number = 0;\n\n constructor(options: MnemonicVaultOptions) {\n this.#secret = options.secret || Mnemonic.generate();\n this.rootPath = options.rootPath || this.rootPath;\n // On creating the vault also adds one account\n this.numberOfAccounts = options.numberOfAccounts || 1;\n }\n\n getDerivePath(index: number) {\n if (this.rootPath.includes(this.pathKey)) {\n return this.rootPath.replace(this.pathKey, String(index));\n }\n return `${this.rootPath}/${index}`;\n }\n\n serialize(): MnemonicVaultOptions {\n return {\n secret: this.#secret,\n rootPath: this.rootPath,\n numberOfAccounts: this.numberOfAccounts,\n };\n }\n\n getAccounts() {\n const accounts = [];\n let numberOfAccounts = 0;\n\n // Create all accounts to current vault\n do {\n const wallet = Wallet.fromMnemonic(this.#secret, this.getDerivePath(numberOfAccounts));\n accounts.push({\n publicKey: wallet.publicKey,\n address: wallet.address,\n });\n numberOfAccounts += 1;\n } while (numberOfAccounts < this.numberOfAccounts);\n\n return accounts;\n }\n\n addAccount() {\n this.numberOfAccounts += 1;\n const wallet = Wallet.fromMnemonic(this.#secret, this.getDerivePath(this.numberOfAccounts - 1));\n\n return {\n publicKey: wallet.publicKey,\n address: wallet.address,\n };\n }\n\n exportAccount(address: string | Address): string {\n let numberOfAccounts = 0;\n const ownerAddress = Address.fromAddressOrString(address);\n // Look for the account that has the same address\n do {\n const wallet = Wallet.fromMnemonic(this.#secret, this.getDerivePath(numberOfAccounts));\n if (wallet.address.equals(ownerAddress)) {\n return wallet.privateKey;\n }\n numberOfAccounts += 1;\n } while (numberOfAccounts < this.numberOfAccounts);\n\n throw new FuelError(\n ErrorCode.WALLET_MANAGER_ERROR,\n `Account with address '${address}' not found in derived wallets.`\n );\n }\n\n getWallet(address: string | Address): WalletUnlocked {\n const privateKey = this.exportAccount(address);\n return Wallet.fromPrivateKey(privateKey);\n }\n}\n","import { Address } from '@fuel-ts/address';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\n\nimport type { WalletUnlocked } from '../../wallet';\nimport { Wallet } from '../../wallet';\nimport type { WalletManagerAccount, Vault } from '../types';\n\nexport interface PkVaultOptions {\n secret?: string;\n accounts?: Array<string>;\n}\n\nexport class PrivateKeyVault implements Vault<PkVaultOptions> {\n static readonly type = 'privateKey';\n\n #privateKeys: Array<string> = [];\n\n /**\n * If privateKey vault is initialized with a secretKey, it creates\n * one account with the fallowing secret\n */\n constructor(options: PkVaultOptions = {}) {\n if (options.secret) {\n this.#privateKeys = [options.secret];\n } else {\n this.#privateKeys = options.accounts || [Wallet.generate().privateKey];\n }\n }\n\n serialize(): PkVaultOptions {\n return {\n accounts: this.#privateKeys,\n };\n }\n\n getPublicAccount(privateKey: string) {\n const wallet = Wallet.fromPrivateKey(privateKey);\n return {\n address: wallet.address,\n publicKey: wallet.publicKey,\n };\n }\n\n getAccounts(): WalletManagerAccount[] {\n return this.#privateKeys.map((pk) => this.getPublicAccount(pk));\n }\n\n addAccount() {\n const wallet = Wallet.generate();\n\n this.#privateKeys.push(wallet.privateKey);\n\n return this.getPublicAccount(wallet.privateKey);\n }\n\n exportAccount(address: string | Address): string {\n const ownerAddress = Address.fromAddressOrString(address);\n const privateKey = this.#privateKeys.find((pk) =>\n Wallet.fromPrivateKey(pk).address.equals(ownerAddress)\n );\n\n if (!privateKey) {\n throw new FuelError(\n ErrorCode.WALLET_MANAGER_ERROR,\n `No private key found for address '${address}'.`\n );\n }\n\n return privateKey;\n }\n\n getWallet(address: string | Address): WalletUnlocked {\n const privateKey = this.exportAccount(address);\n return Wallet.fromPrivateKey(privateKey);\n }\n}\n","/* eslint-disable max-classes-per-file */\nimport type { Address } from '@fuel-ts/address';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\n\nimport type { WalletUnlocked } from '../wallet';\n\nexport type WalletManagerAccount = {\n address: Address;\n publicKey: string;\n vaultId?: number;\n};\n\nexport type WalletManagerOptions = {\n storage: StorageAbstract;\n};\n\nexport type VaultConfig = {\n type: string;\n title?: string;\n secret?: string;\n};\n\nexport type VaultsState = Array<{\n type: string;\n title?: string;\n data?: VaultConfig;\n vault: Vault;\n}>;\n\nexport interface WalletManagerState {\n vaults: VaultsState;\n}\n\nexport abstract class Vault<TOptions = { secret?: string }> {\n static readonly type: string;\n\n constructor(_options: TOptions) {\n throw new FuelError(ErrorCode.NOT_IMPLEMENTED, 'Not implemented.');\n }\n\n serialize(): TOptions {\n throw new FuelError(ErrorCode.NOT_IMPLEMENTED, 'Not implemented.');\n }\n\n getAccounts(): WalletManagerAccount[] {\n throw new FuelError(ErrorCode.NOT_IMPLEMENTED, 'Not implemented.');\n }\n\n addAccount(): WalletManagerAccount {\n throw new FuelError(ErrorCode.NOT_IMPLEMENTED, 'Not implemented.');\n }\n\n exportAccount(_address: Address): string {\n throw new FuelError(ErrorCode.NOT_IMPLEMENTED, 'Not implemented.');\n }\n\n getWallet(_address: Address): WalletUnlocked {\n throw new FuelError(ErrorCode.NOT_IMPLEMENTED, 'Not implemented.');\n }\n}\n\nexport abstract class StorageAbstract {\n abstract setItem(key: string, value: string): Promise<void>;\n abstract getItem(key: string): Promise<string | null | undefined>;\n abstract removeItem(key: string): Promise<void>;\n abstract clear(): Promise<void>;\n}\n","import type { JsonAbi, InputValue } from '@fuel-ts/abi-coder';\nimport { Interface } from '@fuel-ts/abi-coder';\nimport { Address } from '@fuel-ts/address';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { arrayify, hexlify } from '@fuel-ts/utils';\n\nimport type { FakeResources } from '../account';\nimport { Account } from '../account';\nimport {\n transactionRequestify,\n isRequestInputResource,\n isRequestInputResourceFromOwner,\n isRequestInputCoinOrMessage,\n} from '../providers';\nimport type {\n CallResult,\n CoinQuantityLike,\n ExcludeResourcesOption,\n Provider,\n Resource,\n TransactionRequest,\n TransactionRequestLike,\n TransactionResponse,\n} from '../providers';\nimport { deployScriptOrPredicate } from '../utils/deployScriptOrPredicate';\n\nimport { getPredicateRoot } from './utils';\n\nexport type PredicateParams<\n TData extends InputValue[] = InputValue[],\n TConfigurables extends { [name: string]: unknown } | undefined = { [name: string]: unknown },\n> = {\n bytecode: BytesLike;\n provider: Provider;\n abi: JsonAbi;\n data?: TData;\n configurableConstants?: TConfigurables;\n};\n\n/**\n * `Predicate` provides methods to populate transaction data with predicate information and sending transactions with them.\n */\nexport class Predicate<\n TData extends InputValue[] = InputValue[],\n TConfigurables extends { [name: string]: unknown } | undefined = { [name: string]: unknown },\n> extends Account {\n bytes: Uint8Array;\n predicateData: TData = [] as unknown as TData;\n interface: Interface;\n initialBytecode: Uint8Array;\n configurableConstants: TConfigurables | undefined;\n /**\n * Creates an instance of the Predicate class.\n *\n * @param bytecode - The bytecode of the predicate.\n * @param abi - The JSON ABI of the predicate.\n * @param provider - The provider used to interact with the blockchain.\n * @param data - The predicate input data (optional).\n * @param configurableConstants - Optional configurable constants for the predicate.\n */\n constructor({\n bytecode,\n abi,\n provider,\n data,\n configurableConstants,\n }: PredicateParams<TData, TConfigurables>) {\n const { predicateBytes, predicateInterface } = Predicate.processPredicateData(\n bytecode,\n abi,\n configurableConstants\n );\n const address = Address.fromB256(getPredicateRoot(predicateBytes));\n super(address, provider);\n\n this.initialBytecode = arrayify(bytecode);\n this.bytes = predicateBytes;\n this.interface = predicateInterface;\n this.configurableConstants = configurableConstants;\n if (data !== undefined && data.length > 0) {\n this.predicateData = data;\n }\n }\n\n /**\n * Populates the transaction data with predicate data.\n *\n * @param transactionRequestLike - The transaction request-like object.\n * @returns The transaction request with predicate data.\n */\n populateTransactionPredicateData<T extends TransactionRequest>(\n transactionRequestLike: TransactionRequestLike\n ) {\n const request = transactionRequestify(transactionRequestLike) as T;\n\n const placeholderIndex = this.getIndexFromPlaceholderWitness(request);\n\n if (placeholderIndex !== -1) {\n request.removeWitness(placeholderIndex);\n }\n\n request.inputs.filter(isRequestInputCoinOrMessage).forEach((input) => {\n if (isRequestInputResourceFromOwner(input, this.address)) {\n // eslint-disable-next-line no-param-reassign\n input.predicate = hexlify(this.bytes);\n // eslint-disable-next-line no-param-reassign\n input.predicateData = hexlify(this.getPredicateData());\n // eslint-disable-next-line no-param-reassign\n input.witnessIndex = 0;\n }\n });\n\n return request;\n }\n\n /**\n * Sends a transaction with the populated predicate data.\n *\n * @param transactionRequestLike - The transaction request-like object.\n * @returns A promise that resolves to the transaction response.\n */\n override sendTransaction(\n transactionRequestLike: TransactionRequestLike\n ): Promise<TransactionResponse> {\n const transactionRequest = transactionRequestify(transactionRequestLike);\n\n return super.sendTransaction(transactionRequest, { estimateTxDependencies: false });\n }\n\n /**\n * Simulates a transaction with the populated predicate data.\n *\n * @param transactionRequestLike - The transaction request-like object.\n * @returns A promise that resolves to the call result.\n */\n override simulateTransaction(\n transactionRequestLike: TransactionRequestLike\n ): Promise<CallResult> {\n const transactionRequest = transactionRequestify(transactionRequestLike);\n return super.simulateTransaction(transactionRequest, { estimateTxDependencies: false });\n }\n\n private getPredicateData(): Uint8Array {\n if (!this.predicateData.length) {\n return new Uint8Array();\n }\n\n const mainFn = this.interface?.functions.main;\n return mainFn?.encodeArguments(this.predicateData) || new Uint8Array();\n }\n\n /**\n * Creates a new Predicate instance from an existing Predicate instance.\n * @param overrides - The data and configurable constants to override.\n * @returns A new Predicate instance with the same bytecode, ABI and provider but with the ability to set the data and configurable constants.\n */\n toNewInstance(\n overrides: Pick<PredicateParams<TData, TConfigurables>, 'data' | 'configurableConstants'> = {}\n ) {\n return new Predicate<TData, TConfigurables>({\n bytecode: this.initialBytecode,\n abi: this.interface.jsonAbi,\n provider: this.provider,\n data: overrides.data ?? this.predicateData,\n configurableConstants: overrides.configurableConstants ?? this.configurableConstants,\n });\n }\n\n /**\n * Processes the predicate data and returns the altered bytecode and interface.\n *\n * @param bytes - The bytes of the predicate.\n * @param jsonAbi - The JSON ABI of the predicate.\n * @param configurableConstants - Optional configurable constants for the predicate.\n * @returns An object containing the new predicate bytes and interface.\n */\n private static processPredicateData(\n bytes: BytesLike,\n jsonAbi: JsonAbi,\n configurableConstants?: { [name: string]: unknown }\n ) {\n let predicateBytes = arrayify(bytes);\n const abiInterface: Interface = new Interface(jsonAbi);\n\n if (abiInterface.functions.main === undefined) {\n throw new FuelError(\n ErrorCode.ABI_MAIN_METHOD_MISSING,\n 'Cannot use ABI without \"main\" function.'\n );\n }\n\n if (configurableConstants && Object.keys(configurableConstants).length) {\n predicateBytes = Predicate.setConfigurableConstants(\n predicateBytes,\n configurableConstants,\n abiInterface\n );\n }\n\n return {\n predicateBytes,\n predicateInterface: abiInterface,\n };\n }\n\n /**\n * Retrieves resources satisfying the spend query for the account.\n *\n * @param quantities - IDs of coins to exclude.\n * @param excludedIds - IDs of resources to be excluded from the query.\n * @returns A promise that resolves to an array of Resources.\n */\n override async getResourcesToSpend(\n quantities: CoinQuantityLike[] /** IDs of coins to exclude */,\n excludedIds?: ExcludeResourcesOption\n ): Promise<Resource[]> {\n const resources = await this.provider.getResourcesToSpend(\n this.address,\n quantities,\n excludedIds\n );\n return resources.map((resource) => ({\n ...resource,\n predicate: hexlify(this.bytes),\n predicateData: hexlify(this.getPredicateData()),\n }));\n }\n\n /**\n * Generates an array of fake resources based on the provided coins.\n *\n * @param coins - An array of `FakeResources` objects representing the coins.\n * @returns An array of `Resource` objects with generated properties.\n */\n override generateFakeResources(coins: FakeResources[]): Array<Resource> {\n return super.generateFakeResources(coins).map((coin) => ({\n ...coin,\n predicate: hexlify(this.bytes),\n predicateData: hexlify(this.getPredicateData()),\n }));\n }\n\n /**\n * Sets the configurable constants for the predicate.\n *\n * @param bytes - The bytes of the predicate.\n * @param configurableConstants - Configurable constants to be set.\n * @param abiInterface - The ABI interface of the predicate.\n * @returns The mutated bytes with the configurable constants set.\n */\n private static setConfigurableConstants(\n bytes: Uint8Array,\n configurableConstants: { [name: string]: unknown },\n abiInterface: Interface\n ) {\n const mutatedBytes = bytes;\n\n try {\n if (Object.keys(abiInterface.configurables).length === 0) {\n throw new FuelError(\n ErrorCode.INVALID_CONFIGURABLE_CONSTANTS,\n 'Predicate has no configurable constants to be set'\n );\n }\n\n Object.entries(configurableConstants).forEach(([key, value]) => {\n if (!abiInterface?.configurables[key]) {\n throw new FuelError(\n ErrorCode.CONFIGURABLE_NOT_FOUND,\n `No configurable constant named '${key}' found in the Predicate`\n );\n }\n\n const { offset } = abiInterface.configurables[key];\n\n const encoded = abiInterface.encodeConfigurable(key, value as InputValue);\n\n mutatedBytes.set(encoded, offset);\n });\n } catch (err) {\n throw new FuelError(\n ErrorCode.INVALID_CONFIGURABLE_CONSTANTS,\n `Error setting configurable constants: ${(<Error>err).message}.`\n );\n }\n\n return mutatedBytes;\n }\n\n /**\n * Returns the index of the witness placeholder that was added to this predicate.\n * If no witness placeholder was added, it returns -1.\n * @param request - The transaction request.\n * @returns The index of the witness placeholder, or -1 if there is no witness placeholder.\n */\n private getIndexFromPlaceholderWitness(request: TransactionRequest): number {\n const predicateInputs = request.inputs\n .filter(isRequestInputResource)\n .filter((input) => isRequestInputResourceFromOwner(input, this.address));\n\n let index = -1;\n\n const hasEmptyPredicateInputs = predicateInputs.find((input) => !input.predicate);\n\n if (hasEmptyPredicateInputs) {\n index = hasEmptyPredicateInputs.witnessIndex;\n\n const allInputsAreEmpty = predicateInputs.every((input) => !input.predicate);\n\n if (!allInputsAreEmpty) {\n /**\n * If at least one resource was added as a predicate resource, we need to check if it was the\n * first one. If that is the case, we don't need to remove the witness placeholder\n * as this was added with the \"witnessIndex\" as 0 and without a placeholder witness. Later if\n * any resource without a predicate is added, it will have the same witnessIndex because it has the\n * same owner.\n */\n const wasFilledInputAddedFirst = !!predicateInputs[0]?.predicate;\n\n if (wasFilledInputAddedFirst) {\n index = -1;\n }\n }\n }\n\n return index;\n }\n\n /**\n *\n * @param account - The account used to pay the deployment costs.\n * @returns The _blobId_ and a _waitForResult_ callback that returns the deployed predicate\n * once the blob deployment transaction finishes.\n *\n * The returned loader predicate will have the same configurable constants\n * as the original predicate which was used to generate the loader predicate.\n */\n async deploy<T = this>(account: Account) {\n return deployScriptOrPredicate<T>({\n deployer: account,\n abi: this.interface.jsonAbi,\n bytecode: this.bytes,\n loaderInstanceCallback: (loaderBytecode, newAbi) =>\n new Predicate({\n bytecode: loaderBytecode,\n abi: newAbi,\n provider: this.provider,\n data: this.predicateData,\n }) as T,\n });\n }\n}\n","import type { JsonAbi } from '@fuel-ts/abi-coder';\nimport { FuelError, ErrorCode } from '@fuel-ts/errors';\nimport { hash } from '@fuel-ts/hasher';\nimport { bn } from '@fuel-ts/math';\nimport { arrayify } from '@fuel-ts/utils';\n\nimport type { Account } from '../account';\nimport { BlobTransactionRequest, calculateGasFee, TransactionStatus } from '../providers';\n\nimport {\n getDataOffset,\n getPredicateScriptLoaderInstructions,\n} from './predicate-script-loader-instructions';\n\nasync function fundBlobTx(deployer: Account, blobTxRequest: BlobTransactionRequest) {\n // Check the account can afford to deploy all chunks and loader\n let totalCost = bn(0);\n const chainInfo = await deployer.provider.getChain();\n const gasPrice = await deployer.provider.estimateGasPrice(10);\n const priceFactor = chainInfo.consensusParameters.feeParameters.gasPriceFactor;\n\n const minGas = blobTxRequest.calculateMinGas(chainInfo);\n\n const minFee = calculateGasFee({\n gasPrice,\n gas: minGas,\n priceFactor,\n tip: blobTxRequest.tip,\n }).add(1);\n\n totalCost = totalCost.add(minFee);\n\n if (totalCost.gt(await deployer.getBalance())) {\n throw new FuelError(ErrorCode.FUNDS_TOO_LOW, 'Insufficient balance to deploy predicate.');\n }\n\n const txCost = await deployer.getTransactionCost(blobTxRequest);\n // eslint-disable-next-line no-param-reassign\n blobTxRequest.maxFee = txCost.maxFee;\n return deployer.fund(blobTxRequest, txCost);\n}\n\nfunction adjustConfigurableOffsets(jsonAbi: JsonAbi, configurableOffsetDiff: number) {\n const { configurables: readOnlyConfigurables } = jsonAbi;\n const configurables: JsonAbi['configurables'] = [];\n readOnlyConfigurables.forEach((config) => {\n // @ts-expect-error shut up the read-only thing\n configurables.push({ ...config, offset: config.offset - configurableOffsetDiff });\n });\n return { ...jsonAbi, configurables } as JsonAbi;\n}\n\ninterface Deployer<T> {\n deployer: Account;\n bytecode: Uint8Array;\n abi: JsonAbi;\n loaderInstanceCallback: (loaderBytecode: Uint8Array, newAbi: JsonAbi) => T;\n}\n\nexport async function deployScriptOrPredicate<T>({\n deployer,\n bytecode,\n abi,\n loaderInstanceCallback,\n}: Deployer<T>) {\n const dataSectionOffset = getDataOffset(arrayify(bytecode));\n const byteCodeWithoutDataSection = bytecode.slice(0, dataSectionOffset);\n\n // Generate the associated create tx for the loader contract\n const blobId = hash(byteCodeWithoutDataSection);\n\n const blobTxRequest = new BlobTransactionRequest({\n blobId,\n witnessIndex: 0,\n witnesses: [byteCodeWithoutDataSection],\n });\n\n const { loaderBytecode, blobOffset } = getPredicateScriptLoaderInstructions(\n arrayify(bytecode),\n arrayify(blobId)\n );\n\n const configurableOffsetDiff = byteCodeWithoutDataSection.length - (blobOffset || 0);\n const newAbi = adjustConfigurableOffsets(abi, configurableOffsetDiff);\n\n const blobExists = (await deployer.provider.getBlobs([blobId])).length > 0;\n\n const loaderInstance = loaderInstanceCallback(loaderBytecode, newAbi);\n if (blobExists) {\n return {\n waitForResult: () => Promise.resolve(loaderInstance),\n blobId,\n };\n }\n\n const fundedBlobRequest = await fundBlobTx(deployer, blobTxRequest);\n\n // Transaction id is unset until we have funded the create tx, which is dependent on the blob tx\n const waitForResult = async () => {\n try {\n const blobTx = await deployer.sendTransaction(fundedBlobRequest);\n const result = await blobTx.waitForResult();\n\n if (result.status !== TransactionStatus.success) {\n throw new Error();\n }\n } catch (err: unknown) {\n throw new FuelError(ErrorCode.TRANSACTION_FAILED, 'Failed to deploy predicate chunk');\n }\n\n return loaderInstance;\n };\n\n return {\n waitForResult,\n blobId,\n };\n}\n","import { concat } from '@fuel-ts/utils';\nimport * as asm from '@fuels/vm-asm';\n\nconst BLOB_ID_SIZE = 32;\nconst REG_ADDRESS_OF_DATA_AFTER_CODE = 0x10;\nconst REG_START_OF_LOADED_CODE = 0x11;\nconst REG_GENERAL_USE = 0x12;\nconst WORD_SIZE = 8; // size in bytes\n\nexport function getDataOffset(binary: Uint8Array): number {\n // Extract 8 bytes starting from index 8 (similar to binary[8..16] in Rust)\n const OFFSET_INDEX = 8;\n const dataView = new DataView(binary.buffer, OFFSET_INDEX, 8);\n\n // Read the value as a 64-bit big-endian unsigned integer\n const dataOffset = dataView.getBigUint64(0, false); // false means big-endian\n\n // Convert the BigInt to a regular number (safe as long as the offset is within Number.MAX_SAFE_INTEGER)\n return Number(dataOffset);\n}\n\nexport function getPredicateScriptLoaderInstructions(\n originalBinary: Uint8Array,\n blobId: Uint8Array\n) {\n // The final code is going to have this structure:\n // 1. loader instructions\n // 2. blob id\n // 3. length_of_data_section\n // 4. the data_section (updated with configurables as needed)\n\n const { RegId, Instruction } = asm;\n\n const REG_PC = RegId.pc().to_u8();\n const REG_SP = RegId.sp().to_u8();\n const REG_IS = RegId.is().to_u8();\n\n const getInstructions = (numOfInstructions: number) => [\n // 1. Load the blob content into memory\n // Find the start of the hardcoded blob ID, which is located after the loader code ends.\n asm.move_(REG_ADDRESS_OF_DATA_AFTER_CODE, REG_PC),\n // hold the address of the blob ID.\n asm.addi(\n REG_ADDRESS_OF_DATA_AFTER_CODE,\n REG_ADDRESS_OF_DATA_AFTER_CODE,\n numOfInstructions * Instruction.size()\n ),\n // The code is going to be loaded from the current value of SP onwards, save\n // the location into REG_START_OF_LOADED_CODE so we can jump into it at the end.\n asm.move_(REG_START_OF_LOADED_CODE, REG_SP),\n // REG_GENERAL_USE to hold the size of the blob.\n asm.bsiz(REG_GENERAL_USE, REG_ADDRESS_OF_DATA_AFTER_CODE),\n // Push the blob contents onto the stack.\n asm.ldc(REG_ADDRESS_OF_DATA_AFTER_CODE, 0, REG_GENERAL_USE, 1),\n // Move on to the data section length\n asm.addi(REG_ADDRESS_OF_DATA_AFTER_CODE, REG_ADDRESS_OF_DATA_AFTER_CODE, BLOB_ID_SIZE),\n // load the size of the data section into REG_GENERAL_USE\n asm.lw(REG_GENERAL_USE, REG_ADDRESS_OF_DATA_AFTER_CODE, 0),\n // after we have read the length of the data section, we move the pointer to the actual\n // data by skipping WORD_SIZE bytes.\n asm.addi(REG_ADDRESS_OF_DATA_AFTER_CODE, REG_ADDRESS_OF_DATA_AFTER_CODE, WORD_SIZE),\n // load the data section of the executable\n asm.ldc(REG_ADDRESS_OF_DATA_AFTER_CODE, 0, REG_GENERAL_USE, 2),\n // Jump into the memory where the contract is loaded.\n // What follows is called _jmp_mem by the sway compiler.\n // Subtract the address contained in IS because jmp will add it back.\n asm.sub(REG_START_OF_LOADED_CODE, REG_START_OF_LOADED_CODE, REG_IS),\n // jmp will multiply by 4, so we need to divide to cancel that out.\n asm.divi(REG_START_OF_LOADED_CODE, REG_START_OF_LOADED_CODE, 4),\n // Jump to the start of the contract we loaded.\n asm.jmp(REG_START_OF_LOADED_CODE),\n ];\n\n const getInstructionsNoDataSection = (numOfInstructions: number) => [\n // 1. Load the blob content into memory\n // Find the start of the hardcoded blob ID, which is located after the loader code ends.\n // 1. Load the blob content into memory\n // Find the start of the hardcoded blob ID, which is located after the loader code ends.\n asm.move_(REG_ADDRESS_OF_DATA_AFTER_CODE, REG_PC),\n // hold the address of the blob ID.\n asm.addi(\n REG_ADDRESS_OF_DATA_AFTER_CODE,\n REG_ADDRESS_OF_DATA_AFTER_CODE,\n numOfInstructions * Instruction.size()\n ),\n // The code is going to be loaded from the current value of SP onwards, save\n // the location into REG_START_OF_LOADED_CODE so we can jump into it at the end.\n asm.move_(REG_START_OF_LOADED_CODE, REG_SP),\n // REG_GENERAL_USE to hold the size of the blob.\n asm.bsiz(REG_GENERAL_USE, REG_ADDRESS_OF_DATA_AFTER_CODE),\n // Push the blob contents onto the stack.\n asm.ldc(REG_ADDRESS_OF_DATA_AFTER_CODE, 0, REG_GENERAL_USE, 1),\n // Jump into the memory where the contract is loaded.\n // What follows is called _jmp_mem by the sway compiler.\n // Subtract the address contained in IS because jmp will add it back.\n asm.sub(REG_START_OF_LOADED_CODE, REG_START_OF_LOADED_CODE, REG_IS),\n // jmp will multiply by 4, so we need to divide to cancel that out.\n asm.divi(REG_START_OF_LOADED_CODE, REG_START_OF_LOADED_CODE, 4),\n // Jump to the start of the contract we loaded.\n asm.jmp(REG_START_OF_LOADED_CODE),\n ];\n\n const offset = getDataOffset(originalBinary);\n\n // if the binary length is smaller than the offset\n if (originalBinary.length < offset) {\n throw new Error(\n `Data section offset is out of bounds, offset: ${offset}, binary length: ${originalBinary.length}`\n );\n }\n\n // Extract the data section from the binary (slice from the offset onwards)\n const dataSection = originalBinary.slice(offset);\n\n // Check if the data section is non-empty\n if (dataSection.length > 0) {\n // Get the number of instructions (assuming it won't exceed u16::MAX)\n const numOfInstructions = getInstructions(0).length;\n if (numOfInstructions > 65535) {\n throw new Error('Too many instructions, exceeding u16::MAX.');\n }\n\n // Convert instructions to bytes\n const instructionBytes = new Uint8Array(\n getInstructions(numOfInstructions).flatMap((instruction) =>\n Array.from(instruction.to_bytes())\n )\n );\n\n // Convert blobId to bytes\n const blobBytes = new Uint8Array(blobId);\n\n // Convert data section length to big-endian 8-byte array\n const dataSectionLenBytes = new Uint8Array(8);\n const dataView = new DataView(dataSectionLenBytes.buffer);\n dataView.setBigUint64(0, BigInt(dataSection.length), false); // false for big-endian\n\n // Combine the instruction bytes, blob bytes, data section length, and the data section\n const loaderBytecode = new Uint8Array([\n ...instructionBytes,\n ...blobBytes,\n ...dataSectionLenBytes,\n ]);\n\n return {\n loaderBytecode: concat([loaderBytecode, dataSection]),\n blobOffset: loaderBytecode.length,\n };\n }\n // Handle case where there is no data section\n const numOfInstructions = getInstructionsNoDataSection(0).length;\n if (numOfInstructions > 65535) {\n throw new Error('Too many instructions, exceeding u16::MAX.');\n }\n\n // Convert instructions to bytes\n const instructionBytes = new Uint8Array(\n getInstructionsNoDataSection(numOfInstructions).flatMap((instruction) =>\n Array.from(instruction.to_bytes())\n )\n );\n\n // Convert blobId to bytes\n const blobBytes = new Uint8Array(blobId);\n\n // Combine the instruction bytes and blob bytes\n const loaderBytecode = new Uint8Array([...instructionBytes, ...blobBytes]);\n\n return { loaderBytecode };\n}\n","import { hash } from '@fuel-ts/hasher';\nimport { calcRoot } from '@fuel-ts/merkle';\nimport { chunkAndPadBytes, hexlify, concat, arrayify } from '@fuel-ts/utils';\nimport type { BytesLike } from '@fuel-ts/utils';\n\n/**\n * @hidden\n *\n * Calculates the predicate root for a given bytecode and chain ID.\n *\n * @param bytecode - The bytecode represented as a BytesLike object.\n * @param chainId - The ID of the chain associated with the bytecode.\n * @returns The predicate root as a string.\n */\nexport const getPredicateRoot = (bytecode: BytesLike): string => {\n const chunkSize = 16 * 1024;\n const bytes = arrayify(bytecode);\n const chunks = chunkAndPadBytes(bytes, chunkSize);\n const codeRoot = calcRoot(chunks.map((c) => hexlify(c)));\n\n const predicateRoot = hash(concat(['0x4655454C', codeRoot]));\n return predicateRoot;\n};\n","import type { Address } from '@fuel-ts/address';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\n\nimport { Account } from '../account';\nimport { Provider } from '../providers';\nimport type { StorageAbstract } from '../wallet-manager';\n\nimport { FuelConnector } from './fuel-connector';\nimport {\n FuelConnectorMethods,\n FuelConnectorEventTypes,\n FuelConnectorEventType,\n LocalStorage,\n} from './types';\nimport type { Network, FuelConnectorEventsType, TargetObject } from './types';\nimport type { CacheFor } from './utils';\nimport { cacheFor, deferPromise, withTimeout } from './utils';\n\n// This is the time to wait for the connector\n// to be available before returning false for hasConnector.\nconst HAS_CONNECTOR_TIMEOUT = 2_000;\n// The time to cache the ping result, as is not\n// expected to change the availability of the connector to\n// change too often we can safely cache the result for 5 seconds\n// at minimum.\nconst PING_CACHE_TIME = 5_000;\n\nconst { warn } = console;\n\nexport type FuelConfig = {\n connectors?: Array<FuelConnector>;\n storage?: StorageAbstract | null;\n targetObject?: TargetObject;\n};\n\nexport type FuelConnectorSelectOptions = {\n emitEvents?: boolean;\n};\n\nexport type Status = {\n installed: boolean;\n connected: boolean;\n};\n\ninterface FuelSdk {\n // #region connector-manager-method-connectors\n connectors: () => Promise<Array<FuelConnector>>;\n // #endregion connector-manager-method-connectors\n // #region connector-manager-method-getConnector\n getConnector: (connector: FuelConnector | string) => FuelConnector | null;\n // #endregion connector-manager-method-getConnector\n // #region connector-manager-method-hasConnector\n hasConnector(): Promise<boolean>;\n // #endregion connector-manager-method-hasConnector\n // #region connector-manager-method-selectConnector\n selectConnector(connectorName: string, options: FuelConnectorSelectOptions): Promise<boolean>;\n // #endregion connector-manager-method-selectConnector\n // #region connector-manager-method-currentConnector\n currentConnector(): FuelConnector | null | undefined;\n // #endregion connector-manager-method-currentConnector\n // #region connector-manager-method-hasWallet\n hasWallet(): Promise<boolean>;\n // #endregion connector-manager-method-hasWallet\n // #region connector-manager-method-getWallet\n getWallet(address: string | Address, providerOrNetwork?: Provider | Network): Promise<Account>;\n // #endregion connector-manager-method-getWallet\n // #region connector-manager-method-unsubscribe\n unsubscribe(): void;\n // #endregion connector-manager-method-unsubscribe\n // #region connector-manager-method-clean\n clean(): Promise<void>;\n // #endregion connector-manager-method-clean\n // #region connector-manager-method-destroy\n destroy(): Promise<void>;\n // #endregion connector-manager-method-destroy\n}\n\nexport class Fuel extends FuelConnector implements FuelSdk {\n static STORAGE_KEY = 'fuel-current-connector';\n static defaultConfig: FuelConfig = {};\n private _storage?: StorageAbstract | null = null;\n private _connectors: Array<FuelConnector> = [];\n private _targetObject: TargetObject | null = null;\n private _unsubscribes: Array<() => void> = [];\n private _targetUnsubscribe = () => {};\n private _pingCache: CacheFor = {};\n private _currentConnector?: FuelConnector | null;\n private _initializationPromise: Promise<void> | null = null;\n\n constructor(config: FuelConfig = Fuel.defaultConfig) {\n super();\n // Increase the limit of listeners\n this.setMaxListeners(1_000);\n // Set all connectors\n this._connectors = config.connectors ?? [];\n // Set the target object to listen for global events\n this._targetObject = this.getTargetObject(config.targetObject);\n // Set default storage\n this._storage = config.storage === undefined ? this.getStorage() : config.storage;\n // Setup all methods\n this.setupMethods();\n this._initializationPromise = this.initialize();\n }\n\n private async initialize(): Promise<void> {\n try {\n const connectResponse = this.setDefaultConnector();\n this._targetUnsubscribe = this.setupConnectorListener();\n await connectResponse;\n } catch (error) {\n throw new FuelError(ErrorCode.INVALID_PROVIDER, 'Error initializing Fuel Connector');\n }\n }\n\n public async init(): Promise<Fuel> {\n await this._initializationPromise;\n return this;\n }\n\n /**\n * Return the target object to listen for global events.\n */\n private getTargetObject(targetObject?: TargetObject): TargetObject | null {\n if (targetObject) {\n return targetObject;\n }\n if (typeof window !== 'undefined') {\n return window;\n }\n if (typeof document !== 'undefined') {\n return document;\n }\n return null;\n }\n\n /**\n * Return the storage used.\n */\n private getStorage(): StorageAbstract | undefined {\n if (typeof window !== 'undefined') {\n return new LocalStorage(window.localStorage);\n }\n return undefined;\n }\n\n /**\n * Setup the default connector from the storage.\n */\n private async setDefaultConnector(): Promise<boolean | undefined> {\n const connectorName =\n (await this._storage?.getItem(Fuel.STORAGE_KEY)) || this._connectors[0]?.name;\n if (connectorName) {\n // Setup all events for the current connector\n return this.selectConnector(connectorName, {\n emitEvents: false,\n });\n }\n\n return undefined;\n }\n\n /**\n * Start listener for all the events of the current\n * connector and emit them to the Fuel instance\n */\n private setupConnectorEvents(events: string[]): void {\n if (!this._currentConnector) {\n return;\n }\n const currentConnector = this._currentConnector;\n this._unsubscribes.map((unSub) => unSub());\n this._unsubscribes = events.map((event) => {\n const handler = (...args: unknown[]) => this.emit(event, ...args);\n currentConnector.on(event as FuelConnectorEventsType, handler);\n return () => currentConnector.off(event, handler);\n });\n }\n\n /**\n * Call method from the current connector.\n */\n private async callMethod(method: string, ...args: unknown[]) {\n const hasConnector = await this.hasConnector();\n await this.pingConnector();\n if (!this._currentConnector || !hasConnector) {\n throw new FuelError(\n ErrorCode.MISSING_CONNECTOR,\n `No connector selected for calling ${method}. Use hasConnector before executing other methods.`\n );\n }\n if (typeof this._currentConnector[method as keyof FuelConnector] === 'function') {\n return (this._currentConnector[method as keyof FuelConnector] as CallableFunction)(...args);\n }\n\n return undefined;\n }\n\n /**\n * Create a method for each method proxy that is available on the Common interface\n * and call the method from the current connector.\n */\n private setupMethods(): void {\n Object.values(FuelConnectorMethods).forEach((method) => {\n this[method] = async (...args: unknown[]) => this.callMethod(method, ...args);\n });\n }\n\n /**\n * Fetch the status of a connector and set the installed and connected\n * status.\n */\n private async fetchConnectorStatus(\n connector: FuelConnector & { _latestUpdate?: number }\n ): Promise<Status> {\n // Control fetch status to avoid rewriting the status\n // on late responses in this way even if a response is\n // late we can avoid rewriting the status of the connector\n const requestTimestamp = Date.now();\n const [isConnected, ping] = await Promise.allSettled([\n withTimeout(connector.isConnected()),\n withTimeout(this.pingConnector(connector)),\n ]);\n // If the requestTimestamp is greater than the latest update\n // we can ignore the response as is treated as stale.\n const isStale = requestTimestamp < (connector._latestUpdate || 0);\n if (!isStale) {\n // eslint-disable-next-line no-param-reassign\n connector._latestUpdate = Date.now();\n // eslint-disable-next-line no-param-reassign\n connector.installed = ping.status === 'fulfilled' && ping.value;\n // eslint-disable-next-line no-param-reassign\n connector.connected = isConnected.status === 'fulfilled' && isConnected.value;\n }\n return {\n installed: connector.installed,\n connected: connector.connected,\n };\n }\n\n /**\n * Fetch the status of all connectors and set the installed and connected\n * status.\n */\n private async fetchConnectorsStatus(): Promise<Status[]> {\n return Promise.all(\n this._connectors.map(async (connector) => this.fetchConnectorStatus(connector))\n );\n }\n\n /**\n * Fetch the status of a connector and set the installed and connected\n * status. If no connector is provided it will ping the current connector.\n */\n private async pingConnector(connector?: FuelConnector) {\n const curConnector = connector || this._currentConnector;\n if (!curConnector) {\n return false;\n }\n // If finds a ping in the cache and the value is true\n // return from cache\n try {\n return await cacheFor(async () => withTimeout(curConnector.ping()), {\n key: curConnector.name,\n cache: this._pingCache,\n cacheTime: PING_CACHE_TIME,\n })();\n } catch {\n throw new FuelError(ErrorCode.INVALID_PROVIDER, 'Current connector is not available.');\n }\n }\n\n /**\n * Setup a listener for the FuelConnector event and add the connector\n * to the list of new connectors.\n */\n private setupConnectorListener = () => {\n const { _targetObject: targetObject } = this;\n const eventName = FuelConnectorEventType;\n if (targetObject?.on) {\n targetObject.on(eventName, this.addConnector);\n return () => {\n targetObject.off?.(eventName, this.addConnector);\n };\n }\n if (targetObject?.addEventListener) {\n const handler = (e: CustomEvent<FuelConnector>) => {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.addConnector(e.detail);\n };\n targetObject.addEventListener(eventName, handler);\n return () => {\n targetObject.removeEventListener?.(eventName, handler);\n };\n }\n return () => {};\n };\n\n /**\n * Add a new connector to the list of connectors.\n */\n private addConnector = async (connector: FuelConnector): Promise<void> => {\n if (!this.getConnector(connector)) {\n this._connectors.push(connector);\n }\n // Fetch the status of the new connector\n await this.fetchConnectorStatus(connector);\n // Emit connectors events once the connector list changes\n this.emit(this.events.connectors, this._connectors);\n // If the current connector is not set\n if (!this._currentConnector) {\n // set the new connector as currentConnector\n await this.selectConnector(connector.name, {\n emitEvents: false,\n });\n }\n };\n\n private triggerConnectorEvents = async () => {\n const [isConnected, networks, currentNetwork] = await Promise.all([\n this.isConnected(),\n this.networks(),\n this.currentNetwork(),\n ]);\n this.emit(this.events.connection, isConnected);\n this.emit(this.events.networks, networks);\n this.emit(this.events.currentNetwork, currentNetwork);\n if (isConnected) {\n const [accounts, currentAccount] = await Promise.all([\n this.accounts(),\n this.currentAccount(),\n ]);\n this.emit(this.events.accounts, accounts);\n this.emit(this.events.currentAccount, currentAccount);\n }\n };\n\n /**\n * Get a connector from the list of connectors.\n */\n getConnector = (connector: FuelConnector | string): FuelConnector | null =>\n this._connectors.find((c) => {\n const connectorName = typeof connector === 'string' ? connector : connector.name;\n return c.name === connectorName || c === connector;\n }) || null;\n\n /**\n * Return the list of connectors with the status of installed and connected.\n */\n async connectors(): Promise<Array<FuelConnector>> {\n await this.fetchConnectorsStatus();\n return this._connectors;\n }\n\n /**\n * Set the current connector to be used.\n */\n async selectConnector(\n connectorName: string,\n options: FuelConnectorSelectOptions = {\n emitEvents: true,\n }\n ): Promise<boolean> {\n const connector = this.getConnector(connectorName);\n if (!connector) {\n return false;\n }\n if (this._currentConnector?.name === connectorName) {\n return true;\n }\n const { installed } = await this.fetchConnectorStatus(connector);\n if (installed) {\n this._currentConnector = connector;\n this.emit(this.events.currentConnector, connector);\n this.setupConnectorEvents(Object.values(FuelConnectorEventTypes));\n await this._storage?.setItem(Fuel.STORAGE_KEY, connector.name);\n // If emitEvents is true we query all the data from the connector\n // and emit the events to the Fuel instance allowing the application to\n // react to changes in the connector state.\n if (options.emitEvents) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.triggerConnectorEvents();\n }\n return true;\n }\n return false;\n }\n\n /**\n * Return the current selected connector.\n */\n currentConnector(): FuelConnector | null | undefined {\n return this._currentConnector;\n }\n\n /**\n * Return true if any connector is available.\n */\n async hasConnector(): Promise<boolean> {\n // If there is a current connector return true\n // as the connector is ready\n if (this._currentConnector) {\n return true;\n }\n // If there is no current connector\n // wait for the current connector to be set\n // for 1 second and return false if is not set\n const defer = deferPromise<boolean>();\n this.once(this.events.currentConnector, () => {\n defer.resolve(true);\n });\n // As the max ping time is 1 second we wait for 2 seconds\n // to allow applications to react to the current connector\n return withTimeout(defer.promise, HAS_CONNECTOR_TIMEOUT)\n .then(() => true)\n .catch(() => false);\n }\n\n async hasWallet(): Promise<boolean> {\n return this.hasConnector();\n }\n\n /**\n * Return a Fuel Provider instance with extends features to work with\n * connectors.\n *\n * @deprecated getProvider is deprecated and is going to be removed in the future, use getWallet instead.\n */\n async getProvider(providerOrNetwork?: Provider | Network): Promise<Provider> {\n warn(\n 'getProvider is deprecated and is going to be removed in the future, use getWallet instead.'\n );\n return this._getProvider(providerOrNetwork);\n }\n\n /**\n * Return a Fuel Provider instance with extends features to work with\n * connectors.\n */\n private async _getProvider(providerOrNetwork?: Provider | Network): Promise<Provider> {\n // Decide which provider to use based on the providerOrNetwork\n let provider: Provider;\n // If provider is a valid instance of a Provider use it\n if (providerOrNetwork && 'getTransactionResponse' in providerOrNetwork) {\n provider = providerOrNetwork;\n // If the provided param is a valid network use it\n } else if (providerOrNetwork && 'chainId' in providerOrNetwork && 'url' in providerOrNetwork) {\n provider = new Provider(providerOrNetwork.url);\n // If nor provider or network is provided use the current network\n } else if (!providerOrNetwork) {\n const currentNetwork = await this.currentNetwork();\n provider = new Provider(currentNetwork.url);\n // If a provider or network was informed but is not valid\n // throw an error\n } else {\n throw new FuelError(ErrorCode.INVALID_PROVIDER, 'Provider is not valid.');\n }\n return provider;\n }\n\n /**\n * Return a Fuel Wallet Locked instance with extends features to work with\n * connectors.\n */\n async getWallet(\n address: string | Address,\n providerOrNetwork?: Provider | Network\n ): Promise<Account> {\n const provider = await this._getProvider(providerOrNetwork);\n return new Account(address, provider, this);\n }\n\n /**\n * Remove all open listeners this is useful when you want to\n * remove the Fuel instance and avoid memory leaks.\n */\n unsubscribe(): void {\n // Unsubscribe from all events\n this._unsubscribes.map((unSub) => unSub());\n this._targetUnsubscribe();\n // Remove all listeners from fuel instance\n this.removeAllListeners();\n }\n\n /**\n * Clean all the data from the storage.\n */\n async clean(): Promise<void> {\n await this._storage?.removeItem(Fuel.STORAGE_KEY);\n }\n\n /**\n * Removes all listeners and cleans the storage.\n */\n async destroy(): Promise<void> {\n this.unsubscribe();\n await this.clean();\n }\n}\n","/* eslint-disable @typescript-eslint/require-await */\nimport { FuelError } from '@fuel-ts/errors';\nimport { EventEmitter } from 'events';\n\nimport type { TransactionRequestLike } from '../providers';\nimport type { Asset } from '../providers/assets/types';\n\nimport { FuelConnectorEventTypes } from './types';\nimport type {\n FuelConnectorEvents,\n ConnectorMetadata,\n FuelABI,\n Network,\n FuelEventArg,\n Version,\n SelectNetworkArguments,\n FuelConnectorSendTxParams,\n} from './types';\n\ninterface Connector {\n // #region fuel-connector-method-ping\n ping(): Promise<boolean>;\n // #endregion fuel-connector-method-ping\n // #region fuel-connector-method-version\n version(): Promise<Version>;\n // #endregion fuel-connector-method-version\n // #region fuel-connector-method-isConnected\n isConnected(): Promise<boolean>;\n // #endregion fuel-connector-method-isConnected\n // #region fuel-connector-method-accounts\n accounts(): Promise<Array<string>>;\n // #endregion fuel-connector-method-accounts\n // #region fuel-connector-method-connect\n connect(): Promise<boolean>;\n // #endregion fuel-connector-method-connect\n // #region fuel-connector-method-disconnect\n disconnect(): Promise<boolean>;\n // #endregion fuel-connector-method-disconnect\n // #region fuel-connector-method-signMessage\n signMessage(address: string, message: string): Promise<string>;\n // #endregion fuel-connector-method-signMessage\n // #region fuel-connector-method-signTransaction\n signTransaction(address: string, transaction: TransactionRequestLike): Promise<string>;\n // #endregion fuel-connector-method-signTransaction\n // #region fuel-connector-method-sendTransaction\n sendTransaction(\n address: string,\n transaction: TransactionRequestLike,\n params?: FuelConnectorSendTxParams\n ): Promise<string>;\n // #endregion fuel-connector-method-sendTransaction\n // #region fuel-connector-method-currentAccount\n currentAccount(): Promise<string | null>;\n // #endregion fuel-connector-method-currentAccount\n // #region fuel-connector-method-addAssets\n addAssets(assets: Array<Asset>): Promise<boolean>;\n // #endregion fuel-connector-method-addAssets\n // #region fuel-connector-method-addAsset\n addAsset(asset: Asset): Promise<boolean>;\n // #endregion fuel-connector-method-addAsset\n // #region fuel-connector-method-assets\n assets(): Promise<Array<Asset>>;\n // #endregion fuel-connector-method-assets\n // #region fuel-connector-method-addNetwork\n addNetwork(networkUrl: string): Promise<boolean>;\n // #endregion fuel-connector-method-addNetwork\n // #region fuel-connector-method-selectNetwork\n selectNetwork(network: SelectNetworkArguments): Promise<boolean>;\n // #endregion fuel-connector-method-selectNetwork\n // #region fuel-connector-method-networks\n networks(): Promise<Array<Network>>;\n // #endregion fuel-connector-method-networks\n // #region fuel-connector-method-currentNetwork\n currentNetwork(): Promise<Network>;\n // #endregion fuel-connector-method-currentNetwork\n // #region fuel-connector-method-addABI\n addABI(contractId: string, abi: FuelABI): Promise<boolean>;\n // #endregion fuel-connector-method-addABI\n // #region fuel-connector-method-getABI\n getABI(contractId: string): Promise<FuelABI | null>;\n // #endregion fuel-connector-method-getABI\n // #region fuel-connector-method-hasABI\n hasABI(contractId: string): Promise<boolean>;\n // #endregion fuel-connector-method-hasABI\n}\n\n/**\n * @name FuelConnector\n *\n * Wallet Connector is a interface that represents a Wallet Connector and all the methods\n * that should be implemented to be compatible with the Fuel SDK.\n */\nexport abstract class FuelConnector extends EventEmitter implements Connector {\n name: string = '';\n metadata: ConnectorMetadata = {} as ConnectorMetadata;\n connected: boolean = false;\n installed: boolean = false;\n external: boolean = true;\n events = FuelConnectorEventTypes;\n\n /**\n * Should return true if the connector is loaded\n * in less then one second.\n *\n * @returns Always true.\n */\n async ping(): Promise<boolean> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should return the current version of the connector\n * and the network version that is compatible.\n *\n * @returns boolean - connection status.\n */\n async version(): Promise<Version> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should return true if the connector is connected\n * to any of the accounts available.\n *\n * @returns The connection status.\n */\n async isConnected(): Promise<boolean> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should return all the accounts authorized for the\n * current connection.\n *\n * @returns The accounts addresses strings\n */\n async accounts(): Promise<Array<string>> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should start the connection process and return\n * true if the account authorize the connection.\n *\n * and return false if the user reject the connection.\n *\n * @emits accounts\n * @returns boolean - connection status.\n */\n async connect(): Promise<boolean> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should disconnect the current connection and\n * return false if the disconnection was successful.\n *\n * @emits assets connection\n * @returns The connection status.\n */\n async disconnect(): Promise<boolean> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should start the sign message process and return\n * the signed message.\n *\n * @param address - The address to sign the message\n * @param message - The message to sign all text will be treated as text utf-8\n *\n * @returns Message signature\n */\n async signMessage(_address: string, _message: string): Promise<string> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should start the sign transaction process and return\n * the signed transaction.\n *\n * @param address - The address to sign the transaction\n * @param transaction - The transaction to sign\n *\n * @returns Transaction signature\n */\n async signTransaction(_address: string, _transaction: TransactionRequestLike): Promise<string> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should start the send transaction process and return\n * the transaction id submitted to the network.\n *\n * If the network is not available for the connection\n * it should throw an error to avoid the transaction\n * to be sent to the wrong network and lost.\n *\n * @param address - The address to sign the transaction\n * @param transaction - The transaction to send\n * @param params - Optional parameters to send the transaction\n * @returns The transaction id\n */\n async sendTransaction(\n _address: string,\n _transaction: TransactionRequestLike,\n _params?: FuelConnectorSendTxParams\n ): Promise<string> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should return the current account selected inside the connector, if the account\n * is authorized for the connection.\n *\n * If the account is not authorized it should return null.\n *\n * @returns The current account selected otherwise null.\n */\n async currentAccount(): Promise<string | null> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should add the assets metadata to the connector and return true if the asset\n * was added successfully.\n *\n * If the asset already exists it should throw an error.\n *\n * @emits assets\n * @param assets - The assets to add the metadata to the connection.\n * @throws Error if the asset already exists\n * @returns True if the asset was added successfully\n */\n async addAssets(_assets: Array<Asset>): Promise<boolean> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should add the asset metadata to the connector and return true if the asset\n * was added successfully.\n *\n * If the asset already exists it should throw an error.\n *\n * @emits assets\n * @param asset - The asset to add the metadata to the connection.\n * @throws Error if the asset already exists\n * @returns True if the asset was added successfully\n */\n async addAsset(_asset: Asset): Promise<boolean> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should return all the assets added to the connector. If a connection is already established.\n *\n * @returns Array of assets metadata from the connector vinculated to the all accounts from a specific Wallet.\n */\n async assets(): Promise<Array<Asset>> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should start the add network process and return true if the network was added successfully.\n *\n * @emits networks\n * @throws Error if the network already exists\n * @param networkUrl - The URL of the network to be added.\n * @returns Return true if the network was added successfully\n */\n async addNetwork(_networkUrl: string): Promise<boolean> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should start the select network process and return true if the network has change successfully.\n *\n * @emits networks\n * @throws Error if the network already exists\n * @param network - The network to be selected.\n * @returns Return true if the network was added successfully\n */\n async selectNetwork(_network: SelectNetworkArguments): Promise<boolean> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should return all the networks available from the connector. If the connection is already established.\n *\n * @returns Return all the networks added to the connector.\n */\n async networks(): Promise<Array<Network>> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should return the current network selected inside the connector. Even if the connection is not established.\n *\n * @returns Return the current network selected inside the connector.\n */\n async currentNetwork(): Promise<Network> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should add the ABI to the connector and return true if the ABI was added successfully.\n *\n * @param contractId - The contract id to add the ABI.\n * @param abi - The JSON ABI that represents a contract.\n * @returns Return true if the ABI was added successfully.\n */\n async addABI(_contractId: string, _abi: FuelABI): Promise<boolean> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should return the ABI from the connector vinculated to the all accounts from a specific Wallet.\n *\n * @param id - The contract id to get the ABI.\n * @returns The ABI if it exists, otherwise return null.\n */\n async getABI(_id: string): Promise<FuelABI | null> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should return true if the abi exists in the connector vinculated to the all accounts from a specific Wallet.\n *\n * @param id - The contract id to get the abi\n * @returns Returns true if the abi exists or false if not.\n */\n async hasABI(_id: string): Promise<boolean> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Event listener for the connector.\n *\n * @param eventName - The event name to listen\n * @param listener - The listener function\n */\n override on<E extends FuelConnectorEvents['type'], D extends FuelEventArg<E>>(\n eventName: E,\n listener: (data: D) => void\n ): this {\n super.on(eventName, listener);\n return this;\n }\n}\n","export enum FuelConnectorMethods {\n // General methods\n ping = 'ping',\n version = 'version',\n // Connection methods\n connect = 'connect',\n disconnect = 'disconnect',\n isConnected = 'isConnected',\n // Account methods\n accounts = 'accounts',\n currentAccount = 'currentAccount',\n // Signature methods\n signMessage = 'signMessage',\n sendTransaction = 'sendTransaction',\n // Assets metadata methods\n assets = 'assets',\n addAsset = 'addAsset',\n addAssets = 'addAssets',\n // Network methods\n networks = 'networks',\n currentNetwork = 'currentNetwork',\n addNetwork = 'addNetwork',\n selectNetwork = 'selectNetwork',\n // ABI methods\n addABI = 'addABI',\n getABI = 'getABI',\n hasABI = 'hasABI',\n}\n\nexport enum FuelConnectorEventTypes {\n connectors = 'connectors',\n currentConnector = 'currentConnector',\n connection = 'connection',\n accounts = 'accounts',\n currentAccount = 'currentAccount',\n networks = 'networks',\n currentNetwork = 'currentNetwork',\n assets = 'assets',\n abis = 'abis',\n}\n\nexport const FuelConnectorEventType = 'FuelConnector';\n","/* eslint-disable @typescript-eslint/require-await */\nimport type { StorageAbstract } from '../../wallet-manager';\n\nexport class LocalStorage implements StorageAbstract {\n private storage: Storage;\n\n constructor(localStorage: Storage) {\n this.storage = localStorage;\n }\n\n async setItem(key: string, value: string): Promise<void> {\n this.storage.setItem(key, value);\n }\n\n async getItem(key: string): Promise<string | null | undefined> {\n return this.storage.getItem(key);\n }\n\n async removeItem(key: string): Promise<void> {\n this.storage.removeItem(key);\n }\n\n async clear(): Promise<void> {\n this.storage.clear();\n }\n}\n","/* eslint-disable no-param-reassign */\n\nexport type CacheFor = {\n [key: string]: {\n timeout: number;\n value: unknown;\n } | null;\n};\n\ntype CacheForOptions = {\n key: string;\n cache: CacheFor;\n cacheTime: number;\n};\n\nexport function cacheFor<F extends (...args: unknown[]) => Promise<unknown>>(\n fn: F,\n { cache, cacheTime, key }: CacheForOptions\n): F {\n return (async (...args: unknown[]) => {\n if (cache[key] && cache[key]?.value) {\n return cache[key]?.value as ReturnType<F>;\n }\n clearTimeout(cache[key]?.timeout);\n const result = await fn(...args);\n\n // Create cache auto clean\n\n cache[key] = {\n timeout: Number(\n setTimeout(() => {\n cache[key] = null;\n }, cacheTime)\n ),\n value: result,\n };\n\n return result;\n }) as F;\n}\n","import type { FuelConnector } from '../fuel-connector';\nimport { FuelConnectorEventType } from '../types';\n\n/**\n * Fuel Connector Event is a custom event that can be used by the connector to\n * inform the Fuel Connector Manager that a new connector is available.\n */\nexport function dispatchFuelConnectorEvent(connector: FuelConnector) {\n window.dispatchEvent(\n new CustomEvent(FuelConnectorEventType, {\n detail: connector,\n })\n );\n}\n","import { FuelError } from '@fuel-ts/errors';\n\n// eslint-disable-next-line eslint-comments/disable-enable-pair\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport type DeferPromise<R = unknown> = {\n promise: Promise<R>;\n resolve: (value: R) => void;\n reject: (error: unknown) => void;\n};\n\nexport function deferPromise<R = unknown>() {\n const defer: DeferPromise<R> = {} as any;\n\n defer.promise = new Promise((resolve, reject) => {\n defer.reject = reject;\n defer.resolve = resolve;\n });\n\n return defer;\n}\n\n// eslint-disable-next-line @typescript-eslint/require-await\nexport async function withTimeout<F extends Promise<unknown>, RT = Awaited<F>>(\n promise: F,\n timeout: number = 1050\n): Promise<RT> {\n const timeoutPromise = new Promise((resolve, reject) => {\n setTimeout(() => {\n reject(new FuelError(FuelError.CODES.TIMEOUT_EXCEEDED, 'Promise timed out'));\n }, timeout);\n });\n return Promise.race([timeoutPromise, promise]) as any;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,eAAAA,oBAAmB;AAE5B,SAAS,WAAAC,gBAAe;AACxB,SAAS,eAAAC,oBAAmB;AAC5B,SAAS,aAAAC,aAAW,aAAAC,mBAAiB;AAErC,SAAS,MAAAC,YAAU;AACnB,SAAS,aAAAC,kB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EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAC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AAK,WAAW;AAAA,EAClD;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,UAAyB;AAC7B,SAAK,YAAY;AACjB,UAAM,KAAK,MAAM;AAAA,EACnB;AACF;AApaO,IAAM,OAAN;AACL,cADW,MACJ,eAAc;AACrB,cAFW,MAEJ,iBAA4B,CAAC;","names":["UTXO_ID_LEN","Address","randomBytes","ErrorCode","FuelError","bn","InputType","arrayify","hexlify","isDefined","clone","Address","ErrorCode","FuelError","BN","bn","InputType","InputMessageCoder","TransactionCoder","arrayify","hexlify","DateTime","isDefined","gql","clone","ErrorCode","FuelError","hexlify","ErrorCode","FuelError","bn","hexlify","ZeroBytes32","ErrorCode","FuelError","bn","hexlify","UTXO_ID_LEN","ZeroBytes32","FuelError","bn","InputType","OutputType","hexlify","ZeroBytes32","ErrorCode","FuelError","bn","arrayify","hexlify","ZeroBytes32","bn","arrayify","hexlify","FuelError","ErrorCode","ErrorCode","FuelError","bn","ReceiptType","arrayify","hexlify","ErrorCode","FuelError","bn","ReceiptType","FAILED_TRANSFER_TO_ADDRESS_SIGNAL","ErrorCode","FuelError","bn","InputType","OutputType","cache","arrayify","hexlify","bn","ZeroBytes32","InputType","OutputType","hexlify","FuelError","UTXO_ID_LEN","clone","ZeroBytes32","bn","TransactionType","InputType","OutputType","TransactionCoder","concat","clone","clone","ZeroBytes32","bn","TransactionType","OutputType","arrayify","hexlify","clone","arrayify","hexlify","clone","TransactionType","hexlify","ZeroBytes32","bn","OutputType","arrayify","addressify","ZeroBytes32","bn","InputType","OutputType","TransactionType","arrayify","hexlify","clone","arrayify","clone","TransactionType","bn","arrayify","ZeroBytes32","hexlify","InputType","OutputType","addressify","FuelError","TransactionType","hexlify","clone","clone","TransactionType","hexlify","FuelError","ZeroBytes32","TransactionType","arrayify","hexlify","clone","clone","TransactionType","ZeroBytes32","hexlify","arrayify","ErrorCode","FuelError","TransactionType","TransactionType","FuelError","ErrorCode","ErrorCode","FuelError","bn","OutputType","TransactionCoder","arrayify","bn","PolicyType","hexlify","bn","PolicyType","TransactionCoder","TransactionType","arrayify","bn","arrayify","TransactionCoder","TransactionType","PolicyType","ZeroBytes32","ErrorCode","FuelError","bn","ReceiptType","TransactionType","Interface","ErrorCode","FuelError","InputType","OutputType","TransactionTypeName","TransactionStatus","OperationName","AddressType","ChainName","TransactionType","FuelError","ErrorCode","ReceiptType","bn","ZeroBytes32","ReceiptType","ReceiptType","ErrorCode","FuelError","bn","FuelError","ErrorCode","bn","hexlify","bn","PolicyType","Interface","ReceiptType","bn","OutputType","arrayify","TransactionCoder","sub","FuelError","ErrorCode","ErrorCode","FuelError","FuelError","ErrorCode","FuelError","ErrorCode","bn","isDefined","FuelError","document","gql","ErrorCode","hexlify","arrayify","BN","Address","clone","TransactionCoder","InputMessageCoder","DateTime","InputType","ErrorCode","FuelError","bn","TransactionCoder","arrayify","FuelError","ErrorCode","TransactionCoder","arrayify","bn","assets","BigNumberCoder","Address","arrayify","concat","Address","FuelError","ErrorCode","bn","isCoin","requestToReestimate","clone","hexlify","arrayify","InputType","randomBytes","UTXO_ID_LEN","isDefined","hexlify","Address","randomBytes","hash","hexlify","concat","arrayify","Address","randomBytes","ErrorCode","FuelError","hexlify","hexlify","computeHmac","ErrorCode","FuelError","sha256","bn","toBytes","arrayify","hexlify","concat","dataSlice","encodeBase58","randomBytes","ErrorCode","FuelError","sha256","arrayify","hexlify","concat","Language","ErrorCode","FuelError","sha256","arrayify","FuelError","ErrorCode","hexlify","arrayify","concat","sha256","randomBytes","MainnetPRV","hexlify","TestnetPRV","encodeBase58","concat","dataSlice","sha256","FuelError","ErrorCode","arrayify","toBytes","computeHmac","bn","Address","ErrorCode","FuelError","Address","ErrorCode","FuelError","Address","FuelError","ErrorCode","Address","ErrorCode","FuelError","Address","FuelError","ErrorCode","FuelError","ErrorCode","Address","Vault","ErrorCode","FuelError","FuelError","ErrorCode","Interface","Address","ErrorCode","FuelError","arrayify","hexlify","FuelError","ErrorCode","hash","bn","arrayify","concat","asm","WORD_SIZE","numOfInstructions","instructionBytes","blobBytes","loaderBytecode","bn","FuelError","ErrorCode","arrayify","hash","hash","hexlify","concat","arrayify","Address","arrayify","hexlify","Interface","FuelError","ErrorCode","ErrorCode","FuelError","FuelError","EventEmitter","FuelConnectorMethods","FuelConnectorEventTypes","EventEmitter","FuelError","cache","FuelError","FuelError","ErrorCode"]}
|
1
|
+
{"version":3,"sources":["../src/providers/chains.ts","../src/assets/utils/network.ts","../src/assets/utils/url.ts","../src/assets/utils/resolveIconPaths.ts","../src/assets/utils/fuelAssetsBaseUrl.ts","../src/assets/assets.ts","../src/assets/asset-api.ts","../src/account.ts","../src/providers/coin-quantity.ts","../src/providers/provider.ts","../src/providers/__generated__/operations.ts","../src/providers/fuel-graphql-subscriber.ts","../src/providers/utils/handle-gql-error-message.ts","../src/providers/resource-cache.ts","../src/providers/transaction-request/input.ts","../src/providers/transaction-request/output.ts","../src/providers/transaction-request/transaction-request.ts","../src/providers/message.ts","../src/providers/resource.ts","../src/providers/utils/receipts.ts","../src/providers/utils/block-explorer.ts","../src/providers/utils/gas.ts","../src/providers/utils/json.ts","../src/providers/utils/extract-tx-error.ts","../src/providers/transaction-request/errors.ts","../src/providers/transaction-request/helpers.ts","../src/providers/transaction-request/witness.ts","../src/providers/transaction-request/blob-transaction-request.ts","../src/providers/transaction-request/hash-transaction.ts","../src/providers/transaction-request/create-transaction-request.ts","../src/providers/transaction-request/storage-slot.ts","../src/providers/transaction-request/script-transaction-request.ts","../src/providers/transaction-request/scripts.ts","../src/providers/transaction-request/upgrade-transaction-request.ts","../src/providers/transaction-request/upload-transaction-request.ts","../src/providers/transaction-request/types.ts","../src/providers/transaction-request/utils.ts","../src/providers/transaction-response/transaction-response.ts","../src/providers/transaction-summary/assemble-transaction-summary.ts","../src/providers/transaction-summary/calculate-tx-fee-for-summary.ts","../src/providers/transaction-summary/operations.ts","../src/providers/transaction-summary/call.ts","../src/providers/transaction-summary/input.ts","../src/providers/transaction-summary/output.ts","../src/providers/transaction-summary/types.ts","../src/providers/transaction-summary/receipt.ts","../src/providers/transaction-summary/status.ts","../src/providers/transaction-response/getDecodedLogs.ts","../src/providers/utils/auto-retry-fetch.ts","../src/providers/utils/validate-pagination-args.ts","../src/providers/transaction-summary/get-transaction-summary.ts","../src/providers/utils/merge-quantities.ts","../src/types.ts","../src/utils/formatTransferToContractScriptData.ts","../src/wallet/base-wallet-unlocked.ts","../src/signer/signer.ts","../src/wallet/keystore-wallet.ts","../src/hdwallet/hdwallet.ts","../src/mnemonic/mnemonic.ts","../src/wordlists/words/english.ts","../src/wordlists/index.ts","../src/mnemonic/utils.ts","../src/wallet/wallets.ts","../src/wallet/wallet.ts","../src/wallet-manager/wallet-manager.ts","../src/wallet-manager/storages/memory-storage.ts","../src/wallet-manager/vaults/mnemonic-vault.ts","../src/wallet-manager/vaults/privatekey-vault.ts","../src/wallet-manager/types.ts","../src/predicate/predicate.ts","../src/utils/deployScriptOrPredicate.ts","../src/utils/predicate-script-loader-instructions.ts","../src/predicate/utils/getPredicateRoot.ts","../src/connectors/fuel.ts","../src/connectors/fuel-connector.ts","../src/connectors/types/connector-types.ts","../src/connectors/types/local-storage.ts","../src/connectors/utils/cache.ts","../src/connectors/utils/dispatch-fuel-connector-event.ts","../src/connectors/utils/promises.ts"],"sourcesContent":["export const CHAIN_IDS = {\n eth: {\n mainnet: 1,\n sepolia: 11155111,\n foundry: 31337,\n },\n fuel: {\n devnet: 0,\n testnet: 0,\n mainnet: 9889,\n },\n};\n","import { CHAIN_IDS } from '../../providers/chains';\nimport type { Asset, AssetEth, AssetFuel, NetworkEthereum, NetworkFuel } from '../types';\n\ntype Network = NetworkEthereum | NetworkFuel;\nexport type NetworkTypes = NetworkEthereum['type'] | NetworkFuel['type'];\ntype NetworkTypeToNetwork<T> = T extends 'ethereum'\n ? NetworkEthereum\n : T extends 'fuel'\n ? NetworkFuel\n : Network;\n\n/**\n * Returns the default chainId for the given network\n */\nexport const getDefaultChainId = (networkType: NetworkTypes): number | undefined => {\n if (networkType === 'ethereum') {\n return CHAIN_IDS.eth.sepolia;\n }\n if (networkType === 'fuel') {\n return CHAIN_IDS.fuel.testnet;\n }\n\n return undefined;\n};\n\nexport type GetAssetNetworkParams<T extends NetworkTypes | undefined> = {\n asset: Asset;\n chainId?: number;\n networkType: T;\n};\n\n/**\n * Returns the asset's network on the given network\n * eg. getAssetNetwork({ asset, chainId: 1, networkType: 'ethereum' }) will return the asset's details on Ethereum mainnet\n */\nexport const getAssetNetwork = <T extends NetworkTypes | undefined>({\n asset,\n chainId,\n networkType,\n}: GetAssetNetworkParams<T>): NetworkTypeToNetwork<T> => {\n const network = asset.networks.find(\n (item) => item.chainId === chainId && item.type === networkType\n ) as NetworkTypeToNetwork<T>;\n\n return network;\n};\n\n/**\n * Returns the asset's details on the given network along with the asset itself\n * eg. getAssetWithNetwork({ asset, chainId: 1, networkType: 'ethereum' }) will return the asset's details on Ethereum mainnet and the asset itself\n */\nexport const getAssetWithNetwork = <T extends NetworkTypes>({\n asset,\n chainId,\n networkType,\n}: GetAssetNetworkParams<T>): AssetEth | AssetFuel | undefined => {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const { networks: _, ...assetRest } = asset;\n\n const chainIdToUse = chainId ?? getDefaultChainId(networkType);\n // use two equals(==) cuz we wan't to keep 0 as a valid chainId\n if (chainIdToUse === undefined) {\n return undefined;\n }\n\n const assetNetwork = getAssetNetwork({\n asset,\n chainId: chainIdToUse,\n networkType,\n });\n\n if (!assetNetwork) {\n return undefined;\n }\n\n return {\n ...assetRest,\n ...assetNetwork,\n };\n};\n\n/**\n * Returns the asset's details on Ethereum\n */\nexport const getAssetEth = (asset: Asset, chainId?: number): AssetEth | undefined =>\n getAssetWithNetwork({\n asset,\n networkType: 'ethereum',\n chainId,\n }) as AssetEth;\n\n/**\n * Returns the asset's details on Fuel\n */\nexport const getAssetFuel = (asset: Asset, chainId?: number): AssetFuel | undefined =>\n getAssetWithNetwork({\n asset,\n networkType: 'fuel',\n chainId,\n }) as AssetFuel;\n","const DELIMITER_PATH = '/';\nconst trimRegex = /^\\/|\\/$/g;\nconst trimPath = (path = '') => path.replace(trimRegex, '');\n\nexport function urlJoin(baseUrl: string | undefined, ...paths: Array<string>): string {\n const hasBaseUrl = baseUrl !== null && baseUrl !== undefined;\n const rootPath = baseUrl?.[0] === '/' && baseUrl.length > 1;\n const allPaths = [baseUrl, ...paths].filter(Boolean).map(trimPath);\n if (rootPath && hasBaseUrl) {\n allPaths.unshift('');\n }\n return allPaths.join(DELIMITER_PATH);\n}\n","import type { Assets } from '../types';\n\nimport { urlJoin } from './url';\n\n/**\n * Returns the list of assets with the icon paths 'resolved'. eg. `./eth.svg` -> `https://some-url.com/eth.svg`\n * @param assets - List of assets\n * @param basePath - Base path for the icon URLs (default: './')\n * @returns The assets with the icon paths resolved\n */\nexport function resolveIconPaths(assets: Assets, basePath: string = './') {\n return assets.map((asset) => ({\n ...asset,\n icon: urlJoin(basePath, asset.icon),\n }));\n}\n","export const fuelAssetsBaseUrl = 'https://assets.fuel.network/providers/'\n","import { CHAIN_IDS } from '../providers/chains';\n\nimport type { Assets } from './types';\nimport { resolveIconPaths, fuelAssetsBaseUrl } from './utils';\n\nexport const rawAssets: Assets = [\n {\n name: 'Ethereum',\n symbol: 'ETH',\n icon: 'eth.svg',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.sepolia,\n decimals: 18,\n },\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.foundry,\n decimals: 18,\n },\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.devnet,\n decimals: 9,\n assetId: '0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07',\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.testnet,\n decimals: 9,\n assetId: '0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07',\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n decimals: 9,\n assetId: '0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07',\n },\n ],\n },\n {\n name: 'WETH',\n symbol: 'WETH',\n icon: 'weth.svg',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId: '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId: '0xa38a5a8beeb08d95744bc7f58528073f4052b254def59eba20c99c202b5acaa3',\n decimals: 9,\n },\n ],\n },\n {\n name: 'weETH',\n symbol: 'weETH',\n icon: 'weETH.webp',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0xCd5fE23C85820F7B72D0926FC9b05b43E359b7ee',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId: '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId: '0x239ed6e12b7ce4089ee245244e3bf906999a6429c2a9a445a1e1faf56914a4ab',\n decimals: 9,\n },\n ],\n },\n {\n name: 'rsETH',\n symbol: 'rsETH',\n icon: 'rsETH.webp',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0xA1290d69c65A6Fe4DF752f95823fae25cB99e5A7',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId: '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId: '0xbae80f7fb8aa6b90d9b01ef726ec847cc4f59419c4d5f2ea88fec785d1b0e849',\n decimals: 9,\n },\n ],\n },\n {\n name: 'rETH',\n symbol: 'rETH',\n icon: 'reth.svg',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0xae78736cd615f374d3085123a210448e74fc6393',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId: '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId: '0xf3f9a0ed0ce8eac5f89d6b83e41b3848212d5b5f56108c54a205bb228ca30c16',\n decimals: 9,\n },\n ],\n },\n {\n name: 'wbETH',\n symbol: 'wbETH',\n icon: 'wbeth.png',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0xa2E3356610840701BDf5611a53974510Ae27E2e1',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId: '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId: '0x7843c74bef935e837f2bcf67b5d64ecb46dd53ff86375530b0caf3699e8ffafe',\n decimals: 9,\n },\n ],\n },\n {\n name: 'rstETH',\n symbol: 'rstETH',\n icon: 'rstETH.webp',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0x7a4EffD87C2f3C55CA251080b1343b605f327E3a',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId: '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId: '0x962792286fbc9b1d5860b4551362a12249362c21594c77abf4b3fe2bbe8d977a',\n decimals: 9,\n },\n ],\n },\n {\n name: 'amphrETH',\n symbol: 'amphrETH',\n icon: 'amphrETH.png',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0x5fD13359Ba15A84B76f7F87568309040176167cd',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId: '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId: '0x05fc623e57bd7bc1258efa8e4f62b05af5471d73df6f2c2dc11ecc81134c4f36',\n decimals: 9,\n },\n ],\n },\n {\n name: 'Manta mBTC',\n symbol: 'Manta mBTC',\n icon: 'manta-mbtc.svg',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0x4041381e947CFD3D483d67a25C6aa9Dc924250c5',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId: '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId: '0xaf3111a248ff7a3238cdeea845bb2d43cf3835f1f6b8c9d28360728b55b9ce5b',\n decimals: 9,\n },\n ],\n },\n {\n name: 'Manta mETH',\n symbol: 'Manta mETH',\n icon: 'manta-meth.svg',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0x8CdF550C04Bc9B9F10938368349C9c8051A772b6',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId: '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId: '0xafd219f513317b1750783c6581f55530d6cf189a5863fd18bd1b3ffcec1714b4',\n decimals: 9,\n },\n ],\n },\n {\n name: 'Manta mUSD',\n symbol: 'Manta mUSD',\n icon: 'manta-musd.svg',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0x3f24E1d7a973867fC2A03fE199E5502514E0e11E',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId: '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId: '0x89cb9401e55d49c3269654dd1cdfb0e80e57823a4a7db98ba8fc5953b120fef4',\n decimals: 9,\n },\n ],\n },\n {\n name: 'pumpBTC',\n symbol: 'pumpBTC',\n icon: 'pumpbtc.webp',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0xf469fbd2abcd6b9de8e169d128226c0fc90a012e',\n decimals: 8,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId: '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId: '0x0aa5eb2bb97ca915288b653a2529355d4dc66de2b37533213f0e4aeee3d3421f',\n decimals: 8,\n },\n ],\n },\n {\n name: 'FBTC',\n symbol: 'FBTC',\n icon: 'fbtc.svg',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0xc96de26018a54d51c097160568752c4e3bd6c364',\n decimals: 8,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId: '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId: '0xb5ecb0a1e08e2abbabf624ffea089df933376855f468ade35c6375b00c33996a',\n decimals: 8,\n },\n ],\n },\n {\n name: 'SolvBTC',\n symbol: 'SolvBTC',\n icon: 'solvBTC.webp',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0x7a56e1c57c7475ccf742a1832b028f0456652f97',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId: '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId: '0x1186afea9affb88809c210e13e2330b5258c2cef04bb8fff5eff372b7bd3f40f',\n decimals: 9,\n },\n ],\n },\n {\n name: 'SolvBTC.BBN',\n symbol: 'SolvBTC.BBN',\n icon: 'SolvBTC.BBN.png',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0xd9d920aa40f578ab794426f5c90f6c731d159def',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId: '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId: '0x7a4f087c957d30218223c2baaaa365355c9ca81b6ea49004cfb1590a5399216f',\n decimals: 9,\n },\n ],\n },\n {\n name: 'Mantle mETH',\n symbol: 'Mantle mETH',\n icon: 'mantle-meth.svg',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0xd5F7838F5C461fefF7FE49ea5ebaF7728bB0ADfa',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId: '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId: '0x642a5db59ec323c2f846d4d4cf3e58d78aff64accf4f8f6455ba0aa3ef000a3b',\n decimals: 9,\n },\n ],\n },\n {\n name: 'sDAI',\n symbol: 'sDAI',\n icon: 'sdai.svg',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0x83f20f44975d03b1b09e64809b757c47f942beea',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId: '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId: '0x9e46f919fbf978f3cad7cd34cca982d5613af63ff8aab6c379e4faa179552958',\n decimals: 9,\n },\n ],\n },\n {\n name: 'USDT',\n symbol: 'USDT',\n icon: 'usdt.svg',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0xdAC17F958D2ee523a2206206994597C13D831ec7',\n decimals: 6,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId: '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId: '0xa0265fb5c32f6e8db3197af3c7eb05c48ae373605b8165b6f4a51c5b0ba4812e',\n decimals: 6,\n },\n ],\n },\n {\n name: 'USDC',\n symbol: 'USDC',\n icon: 'usdc.svg',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',\n decimals: 6,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId: '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId: '0x286c479da40dc953bddc3bb4c453b608bba2e0ac483b077bd475174115395e6b',\n decimals: 6,\n },\n ],\n },\n {\n name: 'USDe',\n symbol: 'USDe',\n icon: 'USDe.svg',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0x4c9edd5852cd905f086c759e8383e09bff1e68b3',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId: '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId: '0xb6133b2ef9f6153eb869125d23dcf20d1e735331b5e41b15a6a7a6cec70e8651',\n decimals: 9,\n },\n ],\n },\n {\n name: 'sUSDe',\n symbol: 'sUSDe',\n icon: 'sUSDe.webp',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0x9d39a5de30e57443bff2a8307a4256c8797a3497',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId: '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId: '0xd05563025104fc36496c15c7021ad6b31034b0e89a356f4f818045d1f48808bc',\n decimals: 9,\n },\n ],\n },\n {\n name: 'rsUSDe',\n symbol: 'rsUSDe',\n icon: 'rsUSDe.svg',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0x82f5104b23FF2FA54C2345F821dAc9369e9E0B26',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId: '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId: '0x78d4522ec607f6e8efb66ea49439d1ee48623cf763f9688a8eada025def033d9',\n decimals: 9,\n },\n ],\n },\n {\n name: 'wstETH',\n symbol: 'wstETH',\n icon: 'wsteth.svg',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId: '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId: '0x1a7815cc9f75db5c24a5b0814bfb706bb9fe485333e98254015de8f48f84c67b',\n decimals: 9,\n },\n ],\n },\n {\n name: 'ezETH',\n symbol: 'ezETH',\n icon: 'ezeth.webp',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0xbf5495Efe5DB9ce00f80364C8B423567e58d2110',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId: '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId: '0x91b3559edb2619cde8ffb2aa7b3c3be97efd794ea46700db7092abeee62281b0',\n decimals: 9,\n },\n ],\n },\n {\n name: 'pzETH',\n symbol: 'pzETH',\n icon: 'pzETH.webp',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0x8c9532a60e0e7c6bbd2b2c1303f63ace1c3e9811',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId: '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId: '0x1493d4ec82124de8f9b625682de69dcccda79e882b89a55a8c737b12de67bd68',\n decimals: 9,\n },\n ],\n },\n {\n name: 'Re7LRT',\n symbol: 'Re7LRT',\n icon: 'Re7LRT.png',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0x84631c0d0081FDe56DeB72F6DE77abBbF6A9f93a',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId: '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId: '0xf2fc648c23a5db24610a1cf696acc4f0f6d9a7d6028dd9944964ab23f6e35995',\n decimals: 9,\n },\n ],\n },\n {\n name: 'steakLRT',\n symbol: 'steakLRT',\n icon: 'steakLRT.png',\n networks: [\n {\n type: 'ethereum',\n chainId: CHAIN_IDS.eth.mainnet,\n address: '0xBEEF69Ac7870777598A04B2bd4771c71212E6aBc',\n decimals: 18,\n },\n {\n type: 'fuel',\n chainId: CHAIN_IDS.fuel.mainnet,\n contractId: '0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8',\n assetId: '0x4fc8ac9f101df07e2c2dec4a53c8c42c439bdbe5e36ea2d863a61ff60afafc30',\n decimals: 9,\n },\n ],\n },\n];\n\nexport const assets = resolveIconPaths(rawAssets, fuelAssetsBaseUrl);\n","import { B256Address } from \"@fuel-ts/address\";\nimport { NetworkEthereum, NetworkFuel } from \"./types\";\n\nconst networks = {\n mainnet: 'https://mainnet-explorer.fuel.network',\n testnet: 'https://explorer-indexer-testnet.fuel.network',\n} as const;\n\nexport interface AssetPaginationOptions {\n last: number;\n}\n\nexport interface AssetPageInfo {\n count: number;\n}\n\nconst request = async <TResponse>(url: string, slug: string): Promise<TResponse | null> => {\n const response = await fetch(`${url}${slug}`, {\n headers: {\n 'Content-Type': 'application/json',\n 'Accept': 'application/json',\n }\n });\n\n try {\n return await response.json() satisfies TResponse;\n } catch (error) {\n // The API returns a 200 status code but the response is not valid JSON\n return null;\n }\n};\n\nconst buildQueryString = (parameters: Record<string, string | { toString: () => string }>) => {\n const query = new URLSearchParams();\n Object.entries(parameters).forEach(([key, value]) => {\n query.set(key, value.toString());\n });\n return query.size > 0 ? `?${query.toString()}` : '';\n};\n\nexport interface AssetInfo {\n assetId: string;\n contractId?: string;\n subId?: string;\n name: string;\n symbol: string;\n decimals: number;\n suspicious: boolean;\n verified: boolean;\n totalSupply?: string;\n networks?: (NetworkEthereum | NetworkFuel)[];\n rate?: number;\n icon?: string;\n owner?: string;\n amount?: string;\n amountInUsd?: string;\n uri?: string;\n metadata: Record<string, string>;\n collection?: string;\n isNFT?: boolean;\n}\n\n/**\n * Get information about any asset (including NFTs)\n *\n * @param opts - The options for the request\n * @param opts.network {'mainnet' | 'testnet'} - The network to use (default: `mainnet`)\n * @param opts.assetId {string} - The ID of the asset to get information about\n * @returns {Promise<AssetInfo>} - The information about the asset\n *\n * @see {@link https://github.com/FuelLabs/fuel-explorer/wiki/Assets-API#instructions-for-consuming-assets-data-from-indexer-api}\n */\nexport const getAssetById = (opts: {\n assetId: B256Address;\n network?: keyof typeof networks;\n}): Promise<AssetInfo | null> => {\n const { network = 'mainnet', assetId } = opts;\n const url = networks[network];\n return request<AssetInfo>(url, `/assets/${assetId}`);\n};\n\nexport interface AssetsByOwner {\n data: AssetInfo[];\n pageInfo: AssetPageInfo;\n}\n\n/**\n * Get assets by owner\n *\n * @param opts - The options for the request\n * @param opts.owner {B256Address} - The owner of the assets\n * @param opts.network {'mainnet' | 'testnet'} - The network to use (default: `mainnet`)\n * @param opts.pagination {AssetPaginationOptions} - The pagination options (default: 10)\n * @returns {Promise<AssetsByOwnerResponse>} - The assets by owner\n *\n * @see {@link https://github.com/FuelLabs/fuel-explorer/wiki/Assets-API#instructions-for-consuming-assets-data-owned-by-an-account-from-indexer-api}\n */\nexport const getAssetsByOwner = async (opts: {\n owner: B256Address;\n network?: keyof typeof networks;\n pagination?: AssetPaginationOptions;\n}): Promise<AssetsByOwner> => {\n const { network = 'mainnet', owner, pagination = { last: 10 } } = opts;\n const url = networks[network];\n const { last } = pagination;\n const queryString = buildQueryString({ last });\n const response = await request<AssetsByOwner>(url, `/accounts/${owner}/assets${queryString}`);\n\n // If the response is not valid JSON, return an empty array\n if (!response) {\n return { data: [], pageInfo: { count: 0 } };\n }\n\n return response;\n};","import { UTXO_ID_LEN } from '@fuel-ts/abi-coder';\nimport type { AddressInput, WithAddress } from '@fuel-ts/address';\nimport { Address } from '@fuel-ts/address';\nimport { randomBytes } from '@fuel-ts/crypto';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport type { BigNumberish, BN } from '@fuel-ts/math';\nimport { bn } from '@fuel-ts/math';\nimport { InputType } from '@fuel-ts/transactions';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { arrayify, hexlify, isDefined } from '@fuel-ts/utils';\nimport { clone } from 'ramda';\n\nimport type { FuelConnector, FuelConnectorSendTxParams } from './connectors';\nimport type {\n TransactionRequest,\n CoinQuantityLike,\n CoinQuantity,\n Resource,\n ExcludeResourcesOption,\n Provider,\n ScriptTransactionRequestLike,\n TransactionCost,\n EstimateTransactionParams,\n CursorPaginationArgs,\n TransactionRequestLike,\n CallResult,\n GetCoinsResponse,\n GetMessagesResponse,\n GetBalancesResponse,\n Coin,\n TransactionCostParams,\n TransactionResponse,\n ProviderSendTxParams,\n} from './providers';\nimport {\n withdrawScript,\n ScriptTransactionRequest,\n transactionRequestify,\n addAmountToCoinQuantities,\n} from './providers';\nimport {\n cacheRequestInputsResourcesFromOwner,\n getAssetAmountInRequestInputs,\n isRequestInputCoin,\n isRequestInputMessageWithoutData,\n isRequestInputResource,\n} from './providers/transaction-request/helpers';\nimport { mergeQuantities } from './providers/utils/merge-quantities';\nimport { AbstractAccount } from './types';\nimport { assembleTransferToContractScript } from './utils/formatTransferToContractScriptData';\n\nexport type TxParamsType = Pick<\n ScriptTransactionRequestLike,\n 'gasLimit' | 'tip' | 'maturity' | 'maxFee' | 'witnessLimit'\n>;\n\nexport type TransferParams = {\n destination: string | Address;\n amount: BigNumberish;\n assetId: BytesLike;\n};\n\nexport type ContractTransferParams = {\n contractId: string | Address;\n amount: BigNumberish;\n assetId: BytesLike;\n};\n\nexport type AccountSendTxParams = ProviderSendTxParams & FuelConnectorSendTxParams;\n\nexport type EstimatedTxParams = Pick<\n TransactionCost,\n 'estimatedPredicates' | 'addedSignatures' | 'requiredQuantities' | 'updateMaxFee' | 'gasPrice'\n>;\nconst MAX_FUNDING_ATTEMPTS = 5;\n\nexport type FakeResources = Partial<Coin> & Required<Pick<Coin, 'amount' | 'assetId'>>;\n\n/**\n * `Account` provides an abstraction for interacting with accounts or wallets on the network.\n */\nexport class Account extends AbstractAccount implements WithAddress {\n /**\n * The address associated with the account.\n */\n readonly address: Address;\n\n /**\n * The provider used to interact with the network.\n */\n protected _provider?: Provider;\n\n /**\n * The connector for use with external wallets\n */\n protected _connector?: FuelConnector;\n\n /**\n * Creates a new Account instance.\n *\n * @param address - The address of the account.\n * @param provider - A Provider instance (optional).\n * @param connector - A FuelConnector instance (optional).\n */\n constructor(address: AddressInput, provider?: Provider, connector?: FuelConnector) {\n super();\n this._provider = provider;\n this._connector = connector;\n this.address = new Address(address);\n }\n\n /**\n * The provider used to interact with the network.\n *\n * @returns A Provider instance.\n *\n * @throws `FuelError` if the provider is not set.\n */\n get provider(): Provider {\n if (!this._provider) {\n throw new FuelError(ErrorCode.MISSING_PROVIDER, 'Provider not set');\n }\n\n return this._provider;\n }\n\n /**\n * Sets the provider for the account.\n *\n * @param provider - A Provider instance.\n */\n set provider(provider: Provider) {\n this._provider = provider;\n }\n\n /**\n * Changes the provider connection for the account.\n *\n * @param provider - A Provider instance.\n * @returns The updated Provider instance.\n */\n connect(provider: Provider): Provider {\n this._provider = provider;\n return this.provider;\n }\n\n /**\n * Retrieves resources satisfying the spend query for the account.\n *\n * @param quantities - Quantities of resources to be obtained.\n * @param excludedIds - IDs of resources to be excluded from the query (optional).\n * @returns A promise that resolves to an array of Resources.\n */\n async getResourcesToSpend(\n quantities: CoinQuantityLike[],\n excludedIds?: ExcludeResourcesOption\n ): Promise<Resource[]> {\n return this.provider.getResourcesToSpend(this.address, quantities, excludedIds);\n }\n\n /**\n * Retrieves coins owned by the account.\n *\n * @param assetId - The asset ID of the coins to retrieve (optional).\n * @returns A promise that resolves to an array of Coins.\n */\n async getCoins(\n assetId?: BytesLike,\n paginationArgs?: CursorPaginationArgs\n ): Promise<GetCoinsResponse> {\n return this.provider.getCoins(this.address, assetId, paginationArgs);\n }\n\n /**\n * Retrieves messages owned by the account.\n *\n * @returns A promise that resolves to an array of Messages.\n */\n async getMessages(paginationArgs?: CursorPaginationArgs): Promise<GetMessagesResponse> {\n return this.provider.getMessages(this.address, paginationArgs);\n }\n\n /**\n * Retrieves the balance of the account for the given asset.\n *\n * @param assetId - The asset ID to check the balance for (optional).\n * @returns A promise that resolves to the balance amount.\n */\n async getBalance(assetId?: BytesLike): Promise<BN> {\n const assetIdToFetch = assetId ?? (await this.provider.getBaseAssetId());\n const amount = await this.provider.getBalance(this.address, assetIdToFetch);\n return amount;\n }\n\n /**\n * Retrieves all the balances for the account.\n *\n * @returns A promise that resolves to an array of Coins and their quantities.\n */\n async getBalances(): Promise<GetBalancesResponse> {\n return this.provider.getBalances(this.address);\n }\n\n /**\n * Funds a transaction request by adding the necessary resources.\n *\n * @typeParam T - The type of the TransactionRequest.\n * @param request - The transaction request to fund.\n * @param params - The estimated transaction parameters.\n * @returns A promise that resolves to the funded transaction request.\n */\n async fund<T extends TransactionRequest>(request: T, params: EstimatedTxParams): Promise<T> {\n const { addedSignatures, estimatedPredicates, requiredQuantities, updateMaxFee, gasPrice } =\n params;\n\n const fee = request.maxFee;\n const baseAssetId = await this.provider.getBaseAssetId();\n const requiredInBaseAsset =\n requiredQuantities.find((quantity) => quantity.assetId === baseAssetId)?.amount || bn(0);\n\n const requiredQuantitiesWithFee = addAmountToCoinQuantities({\n amount: bn(fee),\n assetId: baseAssetId,\n coinQuantities: requiredQuantities,\n });\n\n const quantitiesDict: Record<string, { required: BN; owned: BN }> = {};\n\n requiredQuantitiesWithFee.forEach(({ amount, assetId }) => {\n quantitiesDict[assetId] = {\n required: amount,\n owned: bn(0),\n };\n });\n\n request.inputs.filter(isRequestInputResource).forEach((input) => {\n const isCoin = isRequestInputCoin(input);\n const assetId = isCoin ? String(input.assetId) : baseAssetId;\n if (quantitiesDict[assetId]) {\n quantitiesDict[assetId].owned = quantitiesDict[assetId].owned.add(input.amount);\n }\n });\n\n let missingQuantities: CoinQuantity[] = [];\n Object.entries(quantitiesDict).forEach(([assetId, { owned, required }]) => {\n if (owned.lt(required)) {\n missingQuantities.push({\n assetId,\n amount: required.sub(owned),\n });\n }\n });\n\n let needsToBeFunded = missingQuantities.length > 0;\n let fundingAttempts = 0;\n while (needsToBeFunded && fundingAttempts < MAX_FUNDING_ATTEMPTS) {\n const resources = await this.getResourcesToSpend(\n missingQuantities,\n cacheRequestInputsResourcesFromOwner(request.inputs, this.address)\n );\n\n request.addResources(resources);\n request.updatePredicateGasUsed(estimatedPredicates);\n\n const requestToReestimate = clone(request);\n if (addedSignatures) {\n Array.from({ length: addedSignatures }).forEach(() =>\n requestToReestimate.addEmptyWitness()\n );\n }\n\n if (!updateMaxFee) {\n needsToBeFunded = false;\n break;\n }\n\n // Recalculate the fee after adding the resources\n const { maxFee: newFee } = await this.provider.estimateTxGasAndFee({\n transactionRequest: requestToReestimate,\n gasPrice,\n });\n\n const totalBaseAssetOnInputs = getAssetAmountInRequestInputs(\n request.inputs.filter(isRequestInputResource),\n baseAssetId,\n baseAssetId\n );\n\n // Update the new total as the fee will change after adding new resources\n const totalBaseAssetRequiredWithFee = requiredInBaseAsset.add(newFee);\n\n if (totalBaseAssetOnInputs.gt(totalBaseAssetRequiredWithFee)) {\n needsToBeFunded = false;\n } else {\n missingQuantities = [\n {\n amount: totalBaseAssetRequiredWithFee.sub(totalBaseAssetOnInputs),\n assetId: baseAssetId,\n },\n ];\n }\n\n fundingAttempts += 1;\n }\n\n // If the transaction still needs to be funded after the maximum number of attempts\n if (needsToBeFunded) {\n throw new FuelError(\n ErrorCode.NOT_ENOUGH_FUNDS,\n `The account ${this.address} does not have enough base asset funds to cover the transaction execution.`\n );\n }\n\n await this.provider.validateTransaction(request);\n\n request.updatePredicateGasUsed(estimatedPredicates);\n\n const requestToReestimate = clone(request);\n if (addedSignatures) {\n Array.from({ length: addedSignatures }).forEach(() => requestToReestimate.addEmptyWitness());\n }\n\n if (!updateMaxFee) {\n return request;\n }\n\n const { maxFee } = await this.provider.estimateTxGasAndFee({\n transactionRequest: requestToReestimate,\n gasPrice,\n });\n\n request.maxFee = maxFee;\n\n return request;\n }\n\n /**\n * A helper that creates a transfer transaction request and returns it.\n *\n * @param destination - The address of the destination.\n * @param amount - The amount of coins to transfer.\n * @param assetId - The asset ID of the coins to transfer (optional).\n * @param txParams - The transaction parameters (optional).\n * @returns A promise that resolves to the prepared transaction request.\n */\n async createTransfer(\n destination: string | Address,\n amount: BigNumberish,\n assetId?: BytesLike,\n txParams: TxParamsType = {}\n ): Promise<ScriptTransactionRequest> {\n let request = new ScriptTransactionRequest(txParams);\n\n request = this.addTransfer(request, {\n destination,\n amount,\n assetId: assetId || (await this.provider.getBaseAssetId()),\n });\n\n request = await this.estimateAndFundTransaction(request, txParams);\n\n return request;\n }\n\n /**\n * Transfers coins to a destination address.\n *\n * @param destination - The address of the destination.\n * @param amount - The amount of coins to transfer.\n * @param assetId - The asset ID of the coins to transfer (optional).\n * @param txParams - The transaction parameters (optional).\n * @returns A promise that resolves to the transaction response.\n */\n async transfer(\n destination: string | Address,\n amount: BigNumberish,\n assetId?: BytesLike,\n txParams: TxParamsType = {}\n ): Promise<TransactionResponse> {\n const request = await this.createTransfer(destination, amount, assetId, txParams);\n return this.sendTransaction(request, { estimateTxDependencies: false });\n }\n\n /**\n * Transfers multiple amounts of a token to multiple recipients.\n *\n * @param transferParams - An array of `TransferParams` objects representing the transfers to be made.\n * @param txParams - Optional transaction parameters.\n * @returns A promise that resolves to a `TransactionResponse` object representing the transaction result.\n */\n async batchTransfer(\n transferParams: TransferParams[],\n txParams: TxParamsType = {}\n ): Promise<TransactionResponse> {\n let request = new ScriptTransactionRequest(txParams);\n request = this.addBatchTransfer(request, transferParams);\n request = await this.estimateAndFundTransaction(request, txParams);\n return this.sendTransaction(request, { estimateTxDependencies: false });\n }\n\n /**\n * Adds a transfer to the given transaction request.\n *\n * @param request - The script transaction request to add transfers to.\n * @param transferParams - The object representing the transfer to be made.\n * @returns The updated transaction request with the added transfer.\n */\n addTransfer(request: ScriptTransactionRequest, transferParams: TransferParams) {\n const { destination, amount, assetId } = transferParams;\n this.validateTransferAmount(amount);\n request.addCoinOutput(new Address(destination), amount, assetId);\n return request;\n }\n\n /**\n * Adds multiple transfers to a script transaction request.\n *\n * @param request - The script transaction request to add transfers to.\n * @param transferParams - An array of `TransferParams` objects representing the transfers to be made.\n * @returns The updated script transaction request.\n */\n addBatchTransfer(request: ScriptTransactionRequest, transferParams: TransferParams[]) {\n transferParams.forEach(({ destination, amount, assetId }) => {\n this.addTransfer(request, {\n destination,\n amount,\n assetId,\n });\n });\n return request;\n }\n\n /**\n * Transfers coins to a contract address.\n *\n * @param contractId - The address of the contract.\n * @param amount - The amount of coins to transfer.\n * @param assetId - The asset ID of the coins to transfer (optional).\n * @param txParams - The transaction parameters (optional).\n * @returns A promise that resolves to the transaction response.\n */\n async transferToContract(\n contractId: string | Address,\n amount: BigNumberish,\n assetId: BytesLike,\n txParams: TxParamsType = {}\n ): Promise<TransactionResponse> {\n return this.batchTransferToContracts([{ amount, assetId, contractId }], txParams);\n }\n\n async batchTransferToContracts(\n contractTransferParams: ContractTransferParams[],\n txParams: TxParamsType = {}\n ): Promise<TransactionResponse> {\n let request = new ScriptTransactionRequest({\n ...txParams,\n });\n\n const quantities: CoinQuantity[] = [];\n\n const defaultAssetId = await this.provider.getBaseAssetId();\n\n const transferParams = contractTransferParams.map((transferParam) => {\n const amount = bn(transferParam.amount);\n const contractAddress = new Address(transferParam.contractId);\n\n const assetId = transferParam.assetId ? hexlify(transferParam.assetId) : defaultAssetId;\n\n if (amount.lte(0)) {\n throw new FuelError(\n ErrorCode.INVALID_TRANSFER_AMOUNT,\n 'Transfer amount must be a positive number.'\n );\n }\n\n request.addContractInputAndOutput(contractAddress);\n quantities.push({ amount, assetId });\n\n return {\n amount,\n contractId: contractAddress.toB256(),\n assetId,\n };\n });\n\n const { script, scriptData } = await assembleTransferToContractScript(transferParams);\n\n request.script = script;\n request.scriptData = scriptData;\n\n request = await this.estimateAndFundTransaction(request, txParams, { quantities });\n\n return this.sendTransaction(request);\n }\n\n /**\n * Withdraws an amount of the base asset to the base chain.\n *\n * @param recipient - Address of the recipient on the base chain.\n * @param amount - Amount of base asset.\n * @param txParams - The transaction parameters (optional).\n * @returns A promise that resolves to the transaction response.\n */\n async withdrawToBaseLayer(\n recipient: AddressInput,\n amount: BigNumberish,\n txParams: TxParamsType = {}\n ): Promise<TransactionResponse> {\n const recipientAddress = new Address(recipient);\n // add recipient and amount to the transaction script code\n const recipientDataArray = arrayify(\n '0x'.concat(recipientAddress.toHexString().substring(2).padStart(64, '0'))\n );\n const amountDataArray = arrayify(\n '0x'.concat(bn(amount).toHex().substring(2).padStart(16, '0'))\n );\n const script = new Uint8Array([\n ...arrayify(withdrawScript.bytes),\n ...recipientDataArray,\n ...amountDataArray,\n ]);\n\n const params: ScriptTransactionRequestLike = { script, ...txParams };\n\n const baseAssetId = await this.provider.getBaseAssetId();\n let request = new ScriptTransactionRequest(params);\n const quantities = [{ amount: bn(amount), assetId: baseAssetId }];\n\n const txCost = await this.getTransactionCost(request, { quantities });\n\n request = this.validateGasLimitAndMaxFee({\n transactionRequest: request,\n gasUsed: txCost.gasUsed,\n maxFee: txCost.maxFee,\n txParams,\n });\n\n await this.fund(request, txCost);\n\n return this.sendTransaction(request);\n }\n\n /**\n * Returns a transaction cost to enable user\n * to set gasLimit and also reserve balance amounts\n * on the transaction.\n *\n * @param transactionRequestLike - The transaction request object.\n * @param transactionCostParams - The transaction cost parameters (optional).\n *\n * @returns A promise that resolves to the transaction cost object.\n */\n async getTransactionCost(\n transactionRequestLike: TransactionRequestLike,\n { signatureCallback, quantities = [], gasPrice }: TransactionCostParams = {}\n ): Promise<TransactionCost> {\n const txRequestClone = clone(transactionRequestify(transactionRequestLike));\n const baseAssetId = await this.provider.getBaseAssetId();\n\n // Fund with fake UTXOs to avoid not enough funds error\n // Getting coin quantities from amounts being transferred\n const coinOutputsQuantities = txRequestClone.getCoinOutputsQuantities();\n // Combining coin quantities from amounts being transferred and forwarding to contracts\n const requiredQuantities = mergeQuantities(coinOutputsQuantities, quantities);\n // An arbitrary amount of the base asset is added to cover the transaction fee during dry runs\n const transactionFeeForDryRun = [{ assetId: baseAssetId, amount: bn('100000000000000000') }];\n\n const findAssetInput = (assetId: string) =>\n txRequestClone.inputs.find((input) => {\n if (input.type === InputType.Coin) {\n return input.assetId === assetId;\n }\n\n // We only consider the message input if it has no data.\n // Messages with `data` cannot fund the gas of a transaction.\n if (isRequestInputMessageWithoutData(input)) {\n return baseAssetId === assetId;\n }\n return false;\n });\n\n const updateAssetInput = (assetId: string, quantity: BN) => {\n const assetInput = findAssetInput(assetId);\n const usedQuantity = quantity;\n\n if (assetInput && 'amount' in assetInput) {\n assetInput.amount = usedQuantity;\n } else {\n txRequestClone.addResources(\n this.generateFakeResources([\n {\n amount: quantity,\n assetId,\n },\n ])\n );\n }\n };\n\n mergeQuantities(requiredQuantities, transactionFeeForDryRun).forEach(({ amount, assetId }) =>\n updateAssetInput(assetId, amount)\n );\n\n const txCost = await this.provider.getTransactionCost(txRequestClone, {\n signatureCallback,\n gasPrice,\n });\n\n return {\n ...txCost,\n requiredQuantities,\n };\n }\n\n /**\n * Sign a message from the account via the connector.\n *\n * @param message - the message to sign.\n * @returns a promise that resolves to the signature.\n *\n * @hidden\n */\n async signMessage(message: string): Promise<string> {\n if (!this._connector) {\n throw new FuelError(ErrorCode.MISSING_CONNECTOR, 'A connector is required to sign messages.');\n }\n return this._connector.signMessage(this.address.toString(), message);\n }\n\n /**\n * Signs a transaction from the account via the connector..\n *\n * @param transactionRequestLike - The transaction request to sign.\n * @returns A promise that resolves to the signature of the transaction.\n */\n async signTransaction(transactionRequestLike: TransactionRequestLike): Promise<string> {\n if (!this._connector) {\n throw new FuelError(\n ErrorCode.MISSING_CONNECTOR,\n 'A connector is required to sign transactions.'\n );\n }\n return this._connector.signTransaction(this.address.toString(), transactionRequestLike);\n }\n\n /**\n * Sends a transaction to the network.\n *\n * @param transactionRequestLike - The transaction request to be sent.\n * @param sendTransactionParams - The provider send transaction parameters (optional).\n * @returns A promise that resolves to the transaction response.\n */\n async sendTransaction(\n transactionRequestLike: TransactionRequestLike,\n { estimateTxDependencies = true, onBeforeSend, skipCustomFee = false }: AccountSendTxParams = {}\n ): Promise<TransactionResponse> {\n if (this._connector) {\n return this.provider.getTransactionResponse(\n await this._connector.sendTransaction(this.address.toString(), transactionRequestLike, {\n onBeforeSend,\n skipCustomFee,\n })\n );\n }\n const transactionRequest = transactionRequestify(transactionRequestLike);\n if (estimateTxDependencies) {\n await this.provider.estimateTxDependencies(transactionRequest);\n }\n return this.provider.sendTransaction(transactionRequest, {\n estimateTxDependencies: false,\n });\n }\n\n /**\n * Simulates a transaction.\n *\n * @param transactionRequestLike - The transaction request to be simulated.\n * @param estimateTxParams - The estimate transaction params (optional).\n * @returns A promise that resolves to the call result.\n */\n async simulateTransaction(\n transactionRequestLike: TransactionRequestLike,\n { estimateTxDependencies = true }: EstimateTransactionParams = {}\n ): Promise<CallResult> {\n const transactionRequest = transactionRequestify(transactionRequestLike);\n if (estimateTxDependencies) {\n await this.provider.estimateTxDependencies(transactionRequest);\n }\n return this.provider.simulate(transactionRequest, { estimateTxDependencies: false });\n }\n\n /**\n * Generates an array of fake resources based on the provided coins.\n *\n * @param coins - An array of `FakeResources` objects representing the coins.\n * @returns An array of `Resource` objects with generated properties.\n */\n generateFakeResources(coins: FakeResources[]): Array<Resource> {\n return coins.map((coin) => ({\n id: hexlify(randomBytes(UTXO_ID_LEN)),\n owner: this.address,\n blockCreated: bn(1),\n txCreatedIdx: bn(1),\n ...coin,\n }));\n }\n\n /** @hidden * */\n private validateTransferAmount(amount: BigNumberish) {\n if (bn(amount).lte(0)) {\n throw new FuelError(\n ErrorCode.INVALID_TRANSFER_AMOUNT,\n 'Transfer amount must be a positive number.'\n );\n }\n }\n\n /** @hidden * */\n private async estimateAndFundTransaction(\n transactionRequest: ScriptTransactionRequest,\n txParams: TxParamsType,\n costParams?: TransactionCostParams\n ) {\n let request = transactionRequest;\n const txCost = await this.getTransactionCost(request, costParams);\n request = this.validateGasLimitAndMaxFee({\n transactionRequest: request,\n gasUsed: txCost.gasUsed,\n maxFee: txCost.maxFee,\n txParams,\n });\n request = await this.fund(request, txCost);\n return request;\n }\n\n /** @hidden * */\n private validateGasLimitAndMaxFee({\n gasUsed,\n maxFee,\n transactionRequest,\n txParams: { gasLimit: setGasLimit, maxFee: setMaxFee },\n }: {\n gasUsed: BN;\n maxFee: BN;\n transactionRequest: ScriptTransactionRequest;\n txParams: Pick<TxParamsType, 'gasLimit' | 'maxFee'>;\n }) {\n const request = transactionRequestify(transactionRequest) as ScriptTransactionRequest;\n\n if (!isDefined(setGasLimit)) {\n request.gasLimit = gasUsed;\n } else if (gasUsed.gt(setGasLimit)) {\n throw new FuelError(\n ErrorCode.GAS_LIMIT_TOO_LOW,\n `Gas limit '${setGasLimit}' is lower than the required: '${gasUsed}'.`\n );\n }\n\n if (!isDefined(setMaxFee)) {\n request.maxFee = maxFee;\n } else if (maxFee.gt(setMaxFee)) {\n throw new FuelError(\n ErrorCode.MAX_FEE_TOO_LOW,\n `Max fee '${setMaxFee}' is lower than the required: '${maxFee}'.`\n );\n }\n\n return request;\n }\n}\n","import type { BigNumberish, BN } from '@fuel-ts/math';\nimport { bn } from '@fuel-ts/math';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { hexlify } from '@fuel-ts/utils';\n\nexport type CoinQuantityLike =\n | [amount: BigNumberish, assetId: BytesLike, max?: BigNumberish]\n | { amount: BigNumberish; assetId: BytesLike; max?: BigNumberish };\nexport type CoinQuantity = { amount: BN; assetId: string; max?: BN };\n\n/** @hidden */\nexport const coinQuantityfy = (coinQuantityLike: CoinQuantityLike): CoinQuantity => {\n let assetId;\n let amount;\n let max;\n if (Array.isArray(coinQuantityLike)) {\n amount = coinQuantityLike[0];\n assetId = coinQuantityLike[1];\n max = coinQuantityLike[2] ?? undefined;\n } else {\n amount = coinQuantityLike.amount;\n assetId = coinQuantityLike.assetId;\n max = coinQuantityLike.max ?? undefined;\n }\n\n const bnAmount = bn(amount);\n return {\n assetId: hexlify(assetId),\n amount: bnAmount.lt(1) ? bn(1) : bnAmount,\n max: max ? bn(max) : undefined,\n };\n};\n\nexport interface IAddAmountToAssetParams {\n assetId: string;\n amount: BN;\n coinQuantities: CoinQuantity[];\n}\n\nexport const addAmountToCoinQuantities = (params: IAddAmountToAssetParams): CoinQuantity[] => {\n const { amount, assetId } = params;\n\n const coinQuantities = [...params.coinQuantities];\n\n const assetIdx = coinQuantities.findIndex((coinQuantity) => coinQuantity.assetId === assetId);\n\n if (assetIdx !== -1) {\n coinQuantities[assetIdx].amount = coinQuantities[assetIdx].amount.add(amount);\n } else {\n coinQuantities.push({ assetId, amount });\n }\n\n return coinQuantities;\n};\n","import type { AddressInput } from '@fuel-ts/address';\nimport { Address } from '@fuel-ts/address';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { BN, bn } from '@fuel-ts/math';\nimport type { Transaction } from '@fuel-ts/transactions';\nimport { InputType, InputMessageCoder, TransactionCoder } from '@fuel-ts/transactions';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { arrayify, hexlify, DateTime, isDefined } from '@fuel-ts/utils';\nimport { checkFuelCoreVersionCompatibility, versions } from '@fuel-ts/versions';\nimport { equalBytes } from '@noble/curves/abstract/utils';\nimport type { DocumentNode } from 'graphql';\nimport { GraphQLClient } from 'graphql-request';\nimport type { GraphQLClientResponse, GraphQLResponse } from 'graphql-request/src/types';\nimport gql from 'graphql-tag';\nimport { clone } from 'ramda';\n\nimport { getSdk as getOperationsSdk } from './__generated__/operations';\nimport type {\n GqlChainInfoFragment,\n GqlConsensusParametersVersion,\n GqlContractParameters as ContractParameters,\n GqlDryRunFailureStatusFragment,\n GqlDryRunSuccessStatusFragment,\n GqlFeeParameters as FeeParameters,\n GqlGasCostsFragment as GasCosts,\n GqlPredicateParameters as PredicateParameters,\n GqlScriptParameters as ScriptParameters,\n GqlTxParameters as TxParameters,\n GqlPageInfo,\n GqlRelayedTransactionFailed,\n Requester,\n GqlBlockFragment,\n} from './__generated__/operations';\nimport type { Coin } from './coin';\nimport type { CoinQuantity, CoinQuantityLike } from './coin-quantity';\nimport { coinQuantityfy } from './coin-quantity';\nimport { FuelGraphqlSubscriber } from './fuel-graphql-subscriber';\nimport type { Message, MessageCoin, MessageProof, MessageStatus } from './message';\nimport type { ExcludeResourcesOption, Resource } from './resource';\nimport { ResourceCache } from './resource-cache';\nimport type {\n TransactionRequestLike,\n TransactionRequest,\n TransactionRequestInput,\n CoinTransactionRequestInput,\n JsonAbisFromAllCalls,\n ScriptTransactionRequest,\n} from './transaction-request';\nimport {\n isTransactionTypeCreate,\n isTransactionTypeScript,\n transactionRequestify,\n validateTransactionForAssetBurn,\n} from './transaction-request';\nimport type { TransactionResultReceipt } from './transaction-response';\nimport { TransactionResponse, getDecodedLogs } from './transaction-response';\nimport { processGqlReceipt } from './transaction-summary/receipt';\nimport {\n calculateGasFee,\n extractTxError,\n getGasUsedFromReceipts,\n getReceiptsWithMissingData,\n} from './utils';\nimport type { RetryOptions } from './utils/auto-retry-fetch';\nimport { autoRetryFetch } from './utils/auto-retry-fetch';\nimport { assertGqlResponseHasNoErrors } from './utils/handle-gql-error-message';\nimport { validatePaginationArgs } from './utils/validate-pagination-args';\n\nconst MAX_RETRIES = 10;\n\nexport const RESOURCES_PAGE_SIZE_LIMIT = 512;\nexport const TRANSACTIONS_PAGE_SIZE_LIMIT = 60;\nexport const BLOCKS_PAGE_SIZE_LIMIT = 5;\nexport const DEFAULT_RESOURCE_CACHE_TTL = 20_000; // 20 seconds\nexport const GAS_USED_MODIFIER = 1.2;\n\nexport type DryRunFailureStatusFragment = GqlDryRunFailureStatusFragment;\nexport type DryRunSuccessStatusFragment = GqlDryRunSuccessStatusFragment;\n\nexport type DryRunStatus = DryRunFailureStatusFragment | DryRunSuccessStatusFragment;\n\nexport type CallResult = {\n receipts: TransactionResultReceipt[];\n dryRunStatus?: DryRunStatus;\n};\n\nexport type EstimateTxDependenciesReturns = CallResult & {\n outputVariables: number;\n missingContractIds: string[];\n};\n\n/**\n * A Fuel block\n */\nexport type Block = {\n id: string;\n height: BN;\n time: string;\n transactionIds: string[];\n header: {\n daHeight: BN;\n stateTransitionBytecodeVersion: string;\n transactionsCount: string;\n transactionsRoot: string;\n messageOutboxRoot: string;\n eventInboxRoot: string;\n prevRoot: string;\n applicationHash: string;\n };\n};\n\nexport type PageInfo = GqlPageInfo;\n\nexport type GetCoinsResponse = {\n coins: Coin[];\n pageInfo: PageInfo;\n};\n\nexport type GetMessagesResponse = {\n messages: Message[];\n pageInfo: PageInfo;\n};\n\nexport type GetBalancesResponse = {\n balances: CoinQuantity[];\n};\n\nexport type GetTransactionsResponse = {\n transactions: Transaction[];\n pageInfo: PageInfo;\n};\n\nexport type GetBlocksResponse = {\n blocks: Block[];\n pageInfo: PageInfo;\n};\n\n/**\n * Deployed Contract bytecode and contract id\n */\nexport type ContractResult = {\n id: string;\n bytecode: string;\n};\n\ntype ModifyStringToBN<T> = {\n [P in keyof T]: P extends 'version' ? T[P] : T[P] extends string ? BN : T[P];\n};\n\nexport {\n GasCosts,\n FeeParameters,\n ContractParameters,\n PredicateParameters,\n ScriptParameters,\n TxParameters,\n};\n\nexport type ConsensusParameters = {\n version: GqlConsensusParametersVersion;\n chainId: BN;\n baseAssetId: string;\n feeParameters: ModifyStringToBN<FeeParameters>;\n contractParameters: ModifyStringToBN<ContractParameters>;\n predicateParameters: ModifyStringToBN<PredicateParameters>;\n scriptParameters: ModifyStringToBN<ScriptParameters>;\n txParameters: ModifyStringToBN<TxParameters>;\n gasCosts: GasCosts;\n};\n\n/**\n * Chain information\n */\nexport type ChainInfo = {\n name: string;\n baseChainHeight: BN;\n consensusParameters: ConsensusParameters;\n};\n\n/**\n * Node information\n */\nexport type NodeInfo = {\n utxoValidation: boolean;\n vmBacktrace: boolean;\n maxTx: BN;\n maxDepth: BN;\n nodeVersion: string;\n};\n\nexport type NodeInfoAndConsensusParameters = {\n nodeVersion: string;\n gasPerByte: BN;\n gasPriceFactor: BN;\n maxGasPerTx: BN;\n};\n\n// #region cost-estimation-1\nexport type TransactionCost = {\n gasPrice: BN;\n gasUsed: BN;\n minGas: BN;\n minFee: BN;\n maxFee: BN;\n maxGas: BN;\n receipts: TransactionResultReceipt[];\n outputVariables: number;\n missingContractIds: string[];\n estimatedPredicates: TransactionRequestInput[];\n requiredQuantities: CoinQuantity[];\n addedSignatures: number;\n dryRunStatus?: DryRunStatus;\n updateMaxFee?: boolean;\n};\n// #endregion cost-estimation-1\n\nconst processGqlChain = (chain: GqlChainInfoFragment): ChainInfo => {\n const { name, daHeight, consensusParameters } = chain;\n\n const {\n contractParams,\n feeParams,\n predicateParams,\n scriptParams,\n txParams,\n gasCosts,\n baseAssetId,\n chainId,\n version,\n } = consensusParameters;\n\n return {\n name,\n baseChainHeight: bn(daHeight),\n consensusParameters: {\n version,\n chainId: bn(chainId),\n baseAssetId,\n feeParameters: {\n version: feeParams.version,\n gasPerByte: bn(feeParams.gasPerByte),\n gasPriceFactor: bn(feeParams.gasPriceFactor),\n },\n contractParameters: {\n version: contractParams.version,\n contractMaxSize: bn(contractParams.contractMaxSize),\n maxStorageSlots: bn(contractParams.maxStorageSlots),\n },\n txParameters: {\n version: txParams.version,\n maxInputs: bn(txParams.maxInputs),\n maxOutputs: bn(txParams.maxOutputs),\n maxWitnesses: bn(txParams.maxWitnesses),\n maxGasPerTx: bn(txParams.maxGasPerTx),\n maxSize: bn(txParams.maxSize),\n maxBytecodeSubsections: bn(txParams.maxBytecodeSubsections),\n },\n predicateParameters: {\n version: predicateParams.version,\n maxPredicateLength: bn(predicateParams.maxPredicateLength),\n maxPredicateDataLength: bn(predicateParams.maxPredicateDataLength),\n maxGasPerPredicate: bn(predicateParams.maxGasPerPredicate),\n maxMessageDataLength: bn(predicateParams.maxMessageDataLength),\n },\n scriptParameters: {\n version: scriptParams.version,\n maxScriptLength: bn(scriptParams.maxScriptLength),\n maxScriptDataLength: bn(scriptParams.maxScriptDataLength),\n },\n gasCosts,\n },\n };\n};\n\n/**\n * @hidden\n *\n * Cursor pagination arguments\n *\n * https://relay.dev/graphql/connections.htm#sec-Arguments\n */\nexport type CursorPaginationArgs = {\n /** Forward pagination limit */\n first?: number | null;\n /** Forward pagination cursor */\n after?: string | null;\n /** Backward pagination limit */\n last?: number | null;\n /** Backward pagination cursor */\n before?: string | null;\n};\n\n/*\n * Provider initialization options\n */\nexport type ProviderOptions = {\n /**\n * Custom fetch function to use for making requests.\n */\n fetch?: (\n url: string,\n requestInit?: RequestInit,\n providerOptions?: Omit<ProviderOptions, 'fetch'>\n ) => Promise<Response>;\n /**\n * Timeout [ms] after which every request will be aborted.\n */\n timeout?: number;\n /**\n * Resources cache for the given time [ms]. If set to -1, the cache will be disabled.\n */\n resourceCacheTTL?: number;\n /**\n * Retry options to use when fetching data from the node.\n */\n retryOptions?: RetryOptions;\n /**\n * Custom headers to include in the request.\n */\n headers?: RequestInit['headers'];\n /**\n * Middleware to modify the request before it is sent.\n * This can be used to add headers, modify the body, etc.\n */\n requestMiddleware?: (request: RequestInit) => RequestInit | Promise<RequestInit>;\n};\n\n/**\n * UTXO validation params\n */\nexport type UTXOValidationParams = {\n utxoValidation?: boolean;\n};\n\n/**\n * Transaction estimation params\n */\nexport type EstimateTransactionParams = {\n /**\n * Estimate the transaction dependencies.\n */\n estimateTxDependencies?: boolean;\n};\n\nexport type TransactionCostParams = EstimateTransactionParams & {\n /**\n * The quantities to forward to the contract.\n */\n quantities?: CoinQuantity[];\n\n /**\n * A callback to sign the transaction.\n *\n * @param request - The transaction request to sign.\n * @returns A promise that resolves to the signed transaction request.\n */\n signatureCallback?: (request: ScriptTransactionRequest) => Promise<ScriptTransactionRequest>;\n\n /**\n * The gas price to use for the transaction.\n */\n gasPrice?: BN;\n};\n\nexport type EstimateTxDependenciesParams = {\n /**\n * The gas price to use for the transaction.\n */\n gasPrice?: BN;\n};\n\nexport type EstimateTxGasAndFeeParams = {\n /**\n * The transaction request to estimate the gas and fee for.\n */\n transactionRequest: TransactionRequest;\n\n /**\n * The gas price to use for the transaction.\n */\n gasPrice?: BN;\n};\n\n/**\n * Provider Call transaction params\n */\nexport type ProviderCallParams = UTXOValidationParams & EstimateTransactionParams;\n\n/**\n * Provider Send transaction params\n */\nexport type ProviderSendTxParams = EstimateTransactionParams & {\n /**\n * Whether to enable asset burn for the transaction.\n */\n enableAssetBurn?: boolean;\n};\n\n/**\n * URL - Consensus Params mapping.\n */\ntype ChainInfoCache = Record<string, ChainInfo>;\n\n/**\n * URL - Node Info mapping.\n */\ntype NodeInfoCache = Record<string, NodeInfo>;\n\ntype Operations = ReturnType<typeof getOperationsSdk>;\n\ntype SdkOperations = Omit<Operations, 'statusChange' | 'submitAndAwaitStatus'> & {\n statusChange: (\n ...args: Parameters<Operations['statusChange']>\n ) => Promise<ReturnType<Operations['statusChange']>>;\n submitAndAwaitStatus: (\n ...args: Parameters<Operations['submitAndAwaitStatus']>\n ) => Promise<ReturnType<Operations['submitAndAwaitStatus']>>;\n getBlobs: (variables: { blobIds: string[] }) => Promise<{ blob: { id: string } | null }[]>;\n};\n\n/**\n * A provider for connecting to a node\n */\nexport default class Provider {\n operations: SdkOperations;\n cache?: ResourceCache;\n\n /** @hidden */\n static clearChainAndNodeCaches() {\n Provider.nodeInfoCache = {};\n Provider.chainInfoCache = {};\n }\n\n /** @hidden */\n public url: string;\n /** @hidden */\n private urlWithoutAuth: string;\n /** @hidden */\n private static chainInfoCache: ChainInfoCache = {};\n /** @hidden */\n private static nodeInfoCache: NodeInfoCache = {};\n /** @hidden */\n private static incompatibleNodeVersionMessage: string = '';\n\n /** @hidden */\n public consensusParametersTimestamp?: number;\n\n options: ProviderOptions = {\n timeout: undefined,\n resourceCacheTTL: undefined,\n fetch: undefined,\n retryOptions: undefined,\n headers: undefined,\n };\n\n /**\n * @hidden\n */\n private static getFetchFn(options: ProviderOptions): NonNullable<ProviderOptions['fetch']> {\n const { retryOptions, timeout, headers } = options;\n\n return autoRetryFetch(async (...args) => {\n const url = args[0];\n const request = args[1];\n const signal = timeout ? AbortSignal.timeout(timeout) : undefined;\n\n let fullRequest: RequestInit = {\n ...request,\n signal,\n headers: { ...request?.headers, ...headers },\n };\n\n if (options.requestMiddleware) {\n fullRequest = await options.requestMiddleware(fullRequest);\n }\n\n return options.fetch ? options.fetch(url, fullRequest, options) : fetch(url, fullRequest);\n }, retryOptions);\n }\n\n /**\n * Constructor to initialize a Provider.\n *\n * @param url - GraphQL endpoint of the Fuel node\n * @param options - Additional options for the provider\n * @hidden\n */\n constructor(url: string, options: ProviderOptions = {}) {\n const { url: rawUrl, urlWithoutAuth, headers: authHeaders } = Provider.extractBasicAuth(url);\n\n this.url = rawUrl;\n this.urlWithoutAuth = urlWithoutAuth;\n this.url = url;\n\n const { FUELS } = versions;\n const headers = { ...authHeaders, ...options.headers, Source: `ts-sdk-${FUELS}` };\n\n this.options = {\n ...this.options,\n ...options,\n headers,\n };\n\n this.operations = this.createOperations();\n const { resourceCacheTTL } = this.options;\n if (isDefined(resourceCacheTTL)) {\n if (resourceCacheTTL !== -1) {\n this.cache = new ResourceCache(resourceCacheTTL);\n } else {\n this.cache = undefined;\n }\n } else {\n this.cache = new ResourceCache(DEFAULT_RESOURCE_CACHE_TTL);\n }\n }\n\n private static extractBasicAuth(url: string): {\n url: string;\n urlWithoutAuth: string;\n headers: ProviderOptions['headers'];\n } {\n let parsedUrl: URL;\n try {\n parsedUrl = new URL(url);\n } catch (error) {\n throw new FuelError(FuelError.CODES.INVALID_URL, 'Invalid URL provided.', { url }, error);\n }\n\n const username = parsedUrl.username;\n const password = parsedUrl.password;\n const urlWithoutAuth = `${parsedUrl.origin}${parsedUrl.pathname}`;\n if (!(username && password)) {\n return { url, urlWithoutAuth: url, headers: undefined };\n }\n\n return {\n url,\n urlWithoutAuth,\n headers: { Authorization: `Basic ${btoa(`${username}:${password}`)}` },\n };\n }\n\n /**\n * Initialize Provider async stuff\n */\n async init(): Promise<Provider> {\n await this.fetchChainAndNodeInfo();\n return this;\n }\n\n /**\n * Returns the `chainInfo` for the current network.\n *\n * @returns the chain information configuration.\n */\n async getChain(): Promise<ChainInfo> {\n await this.init();\n return Provider.chainInfoCache[this.urlWithoutAuth];\n }\n\n /**\n * Returns the `nodeInfo` for the current network.\n *\n * @returns the node information configuration.\n */\n async getNode(): Promise<NodeInfo> {\n await this.init();\n return Provider.nodeInfoCache[this.urlWithoutAuth];\n }\n\n /**\n * Returns some helpful parameters related to gas fees.\n */\n async getGasConfig() {\n const {\n txParameters: { maxGasPerTx },\n predicateParameters: { maxGasPerPredicate },\n feeParameters: { gasPriceFactor, gasPerByte },\n gasCosts,\n } = (await this.getChain()).consensusParameters;\n\n return {\n maxGasPerTx,\n maxGasPerPredicate,\n gasPriceFactor,\n gasPerByte,\n gasCosts,\n };\n }\n\n /**\n * Updates the URL for the provider and fetches the consensus parameters for the new URL, if needed.\n *\n * @param url - The URL to connect to.\n * @param options - Additional options for the provider.\n */\n async connect(url: string, options?: ProviderOptions): Promise<void> {\n const { url: rawUrl, urlWithoutAuth, headers } = Provider.extractBasicAuth(url);\n\n this.url = rawUrl;\n this.urlWithoutAuth = urlWithoutAuth;\n this.options = options ?? this.options;\n this.options = { ...this.options, headers: { ...this.options.headers, ...headers } };\n\n this.operations = this.createOperations();\n\n await this.init();\n }\n\n /**\n * Return the chain and node information.\n * @param ignoreCache - If true, ignores the cache and re-fetch configs.\n * @returns A promise that resolves to the Chain and NodeInfo.\n */\n async fetchChainAndNodeInfo(ignoreCache: boolean = false) {\n let nodeInfo: NodeInfo;\n let chain: ChainInfo;\n\n try {\n nodeInfo = Provider.nodeInfoCache[this.urlWithoutAuth];\n chain = Provider.chainInfoCache[this.urlWithoutAuth];\n\n const noCache = !nodeInfo || !chain;\n\n if (ignoreCache || noCache) {\n throw new Error(`Jumps to the catch block and re-fetch`);\n }\n } catch (_err) {\n const data = await this.operations.getChainAndNodeInfo();\n\n nodeInfo = {\n maxDepth: bn(data.nodeInfo.maxDepth),\n maxTx: bn(data.nodeInfo.maxTx),\n nodeVersion: data.nodeInfo.nodeVersion,\n utxoValidation: data.nodeInfo.utxoValidation,\n vmBacktrace: data.nodeInfo.vmBacktrace,\n };\n\n Provider.setIncompatibleNodeVersionMessage(nodeInfo);\n\n chain = processGqlChain(data.chain);\n\n Provider.chainInfoCache[this.urlWithoutAuth] = chain;\n Provider.nodeInfoCache[this.urlWithoutAuth] = nodeInfo;\n\n this.consensusParametersTimestamp = Date.now();\n }\n\n return {\n chain,\n nodeInfo,\n };\n }\n\n /**\n * @hidden\n */\n private static setIncompatibleNodeVersionMessage(nodeInfo: NodeInfo) {\n const { isMajorSupported, isMinorSupported, supportedVersion } =\n checkFuelCoreVersionCompatibility(nodeInfo.nodeVersion);\n\n if (!isMajorSupported || !isMinorSupported) {\n Provider.incompatibleNodeVersionMessage = [\n `The Fuel Node that you are trying to connect to is using fuel-core version ${nodeInfo.nodeVersion}.`,\n `The TS SDK currently supports fuel-core version ${supportedVersion}.`,\n `Things may not work as expected.`,\n ].join('\\n');\n FuelGraphqlSubscriber.incompatibleNodeVersionMessage =\n Provider.incompatibleNodeVersionMessage;\n }\n }\n\n /**\n * Create GraphQL client and set operations.\n *\n * @returns The operation SDK object\n * @hidden\n */\n private createOperations(): SdkOperations {\n const fetchFn = Provider.getFetchFn(this.options);\n const gqlClient = new GraphQLClient(this.urlWithoutAuth, {\n fetch: (input: RequestInfo | URL, requestInit?: RequestInit) =>\n fetchFn(input.toString(), requestInit || {}, this.options),\n responseMiddleware: (response: GraphQLClientResponse<unknown> | Error) => {\n if ('response' in response) {\n const graphQlResponse = response.response as GraphQLResponse;\n assertGqlResponseHasNoErrors(\n graphQlResponse.errors,\n Provider.incompatibleNodeVersionMessage\n );\n }\n },\n });\n\n const executeQuery = (query: DocumentNode, vars: Record<string, unknown>) => {\n const opDefinition = query.definitions.find((x) => x.kind === 'OperationDefinition') as {\n operation: string;\n };\n const isSubscription = opDefinition?.operation === 'subscription';\n\n if (isSubscription) {\n return FuelGraphqlSubscriber.create({\n url: this.urlWithoutAuth,\n query,\n fetchFn: (url, requestInit) => fetchFn(url as string, requestInit, this.options),\n variables: vars,\n });\n }\n return gqlClient.request(query, vars);\n };\n\n const customOperations = (requester: Requester) => ({\n getBlobs(variables: { blobIds: string[] }) {\n const queryParams = variables.blobIds.map((_, i) => `$blobId${i}: BlobId!`).join(', ');\n const blobParams = variables.blobIds\n .map((_, i) => `blob${i}: blob(id: $blobId${i}) { id }`)\n .join('\\n');\n\n const updatedVariables = variables.blobIds.reduce(\n (acc, blobId, i) => {\n acc[`blobId${i}`] = blobId;\n return acc;\n },\n {} as Record<string, string>\n );\n\n const document = gql`\n query getBlobs(${queryParams}) {\n ${blobParams}\n }\n `;\n\n return requester(document, updatedVariables);\n },\n });\n\n // @ts-expect-error This is due to this function being generic. Its type is specified when calling a specific operation via provider.operations.xyz.\n return { ...getOperationsSdk(executeQuery), ...customOperations(executeQuery) };\n }\n\n /**\n * Returns the version of the connected node.\n *\n * @returns A promise that resolves to the version string.\n */\n async getVersion(): Promise<string> {\n const {\n nodeInfo: { nodeVersion },\n } = await this.operations.getVersion();\n return nodeVersion;\n }\n\n /**\n * Returns the latest block number.\n *\n * @returns A promise that resolves to the latest block number.\n */\n async getBlockNumber(): Promise<BN> {\n const {\n chain: {\n latestBlock: { height },\n },\n } = await this.operations.getLatestBlockHeight();\n return bn(height);\n }\n\n /**\n * Returns the node information for the current provider network.\n *\n * @returns a promise that resolves to the node information.\n */\n async fetchNode(): Promise<NodeInfo> {\n const { nodeInfo } = await this.operations.getNodeInfo();\n\n const processedNodeInfo: NodeInfo = {\n maxDepth: bn(nodeInfo.maxDepth),\n maxTx: bn(nodeInfo.maxTx),\n nodeVersion: nodeInfo.nodeVersion,\n utxoValidation: nodeInfo.utxoValidation,\n vmBacktrace: nodeInfo.vmBacktrace,\n };\n\n Provider.nodeInfoCache[this.urlWithoutAuth] = processedNodeInfo;\n\n return processedNodeInfo;\n }\n\n /**\n * Returns the chain information for the current provider network.\n *\n * @returns a promise that resolves to the chain information.\n */\n async fetchChain(): Promise<ChainInfo> {\n const { chain } = await this.operations.getChain();\n\n const processedChain = processGqlChain(chain);\n\n Provider.chainInfoCache[this.urlWithoutAuth] = processedChain;\n\n return processedChain;\n }\n\n /**\n * Returns the chain ID for the current provider network.\n *\n * @returns A promise that resolves to the chain ID number.\n */\n async getChainId() {\n const {\n consensusParameters: { chainId },\n } = await this.getChain();\n return chainId.toNumber();\n }\n\n /**\n * Returns the base asset ID for the current provider network.\n *\n * @returns the base asset ID.\n */\n async getBaseAssetId() {\n const all = await this.getChain();\n const {\n consensusParameters: { baseAssetId },\n } = all;\n return baseAssetId;\n }\n\n /**\n * @hidden\n */\n #cacheInputs(inputs: TransactionRequestInput[], transactionId: string): void {\n if (!this.cache) {\n return;\n }\n\n const inputsToCache = inputs.reduce(\n (acc, input) => {\n if (input.type === InputType.Coin) {\n acc.utxos.push(input.id);\n } else if (input.type === InputType.Message) {\n acc.messages.push(input.nonce);\n }\n return acc;\n },\n { utxos: [], messages: [] } as Required<ExcludeResourcesOption>\n );\n\n this.cache.set(transactionId, inputsToCache);\n }\n\n /**\n * @hidden\n */\n async validateTransaction(tx: TransactionRequest) {\n const {\n consensusParameters: {\n txParameters: { maxInputs, maxOutputs },\n },\n } = await this.getChain();\n if (bn(tx.inputs.length).gt(maxInputs)) {\n throw new FuelError(\n ErrorCode.MAX_INPUTS_EXCEEDED,\n `The transaction exceeds the maximum allowed number of inputs. Tx inputs: ${tx.inputs.length}, max inputs: ${maxInputs}`\n );\n }\n\n if (bn(tx.outputs.length).gt(maxOutputs)) {\n throw new FuelError(\n ErrorCode.MAX_OUTPUTS_EXCEEDED,\n `The transaction exceeds the maximum allowed number of outputs. Tx outputs: ${tx.outputs.length}, max outputs: ${maxOutputs}`\n );\n }\n }\n\n /**\n * Submits a transaction to the chain to be executed.\n *\n * If the transaction is missing any dependencies,\n * the transaction will be mutated and those dependencies will be added.\n *\n * @param transactionRequestLike - The transaction request object.\n * @param sendTransactionParams - The provider send transaction parameters (optional).\n * @returns A promise that resolves to the transaction response object.\n */\n async sendTransaction(\n transactionRequestLike: TransactionRequestLike,\n { estimateTxDependencies = true, enableAssetBurn }: ProviderSendTxParams = {}\n ): Promise<TransactionResponse> {\n const transactionRequest = transactionRequestify(transactionRequestLike);\n validateTransactionForAssetBurn(\n await this.getBaseAssetId(),\n transactionRequest,\n enableAssetBurn\n );\n\n if (estimateTxDependencies) {\n await this.estimateTxDependencies(transactionRequest);\n }\n\n await this.validateTransaction(transactionRequest);\n\n const encodedTransaction = hexlify(transactionRequest.toTransactionBytes());\n\n let abis: JsonAbisFromAllCalls | undefined;\n\n if (isTransactionTypeScript(transactionRequest)) {\n abis = transactionRequest.abis;\n }\n const subscription = await this.operations.submitAndAwaitStatus({ encodedTransaction });\n\n this.#cacheInputs(\n transactionRequest.inputs,\n transactionRequest.getTransactionId(await this.getChainId())\n );\n\n const chainId = await this.getChainId();\n return new TransactionResponse(transactionRequest, this, chainId, abis, subscription);\n }\n\n /**\n * Executes a transaction without actually submitting it to the chain.\n *\n * If the transaction is missing any dependencies,\n * the transaction will be mutated and those dependencies will be added.\n *\n * @param transactionRequestLike - The transaction request object.\n * @param sendTransactionParams - The provider call parameters (optional).\n * @returns A promise that resolves to the call result object.\n */\n async dryRun(\n transactionRequestLike: TransactionRequestLike,\n { utxoValidation, estimateTxDependencies = true }: ProviderCallParams = {}\n ): Promise<CallResult> {\n const transactionRequest = transactionRequestify(transactionRequestLike);\n if (estimateTxDependencies) {\n return this.estimateTxDependencies(transactionRequest);\n }\n const encodedTransaction = hexlify(transactionRequest.toTransactionBytes());\n const { dryRun: dryRunStatuses } = await this.operations.dryRun({\n encodedTransactions: encodedTransaction,\n utxoValidation: utxoValidation || false,\n });\n const [{ receipts: rawReceipts, status: dryRunStatus }] = dryRunStatuses;\n const receipts = rawReceipts.map(processGqlReceipt);\n\n return { receipts, dryRunStatus };\n }\n\n /**\n * Verifies whether enough gas is available to complete transaction.\n *\n * @template T - The type of the transaction request object.\n *\n * @param transactionRequest - The transaction request object.\n * @returns A promise that resolves to the estimated transaction request object.\n */\n async estimatePredicates<T extends TransactionRequest>(transactionRequest: T): Promise<T> {\n const shouldEstimatePredicates = Boolean(\n transactionRequest.inputs.find(\n (input) =>\n 'predicate' in input &&\n input.predicate &&\n !equalBytes(arrayify(input.predicate), arrayify('0x')) &&\n new BN(input.predicateGasUsed).isZero()\n )\n );\n if (!shouldEstimatePredicates) {\n return transactionRequest;\n }\n const encodedTransaction = hexlify(transactionRequest.toTransactionBytes());\n const response = await this.operations.estimatePredicates({\n encodedTransaction,\n });\n\n const {\n estimatePredicates: { inputs },\n } = response;\n\n if (inputs) {\n inputs.forEach((input, index) => {\n if ('predicateGasUsed' in input && bn(input.predicateGasUsed).gt(0)) {\n // eslint-disable-next-line no-param-reassign\n (<CoinTransactionRequestInput>transactionRequest.inputs[index]).predicateGasUsed =\n input.predicateGasUsed;\n }\n });\n }\n\n return transactionRequest;\n }\n\n /**\n * Will dryRun a transaction and check for missing dependencies.\n *\n * If there are missing variable outputs,\n * `addVariableOutputs` is called on the transaction.\n *\n * @param transactionRequest - The transaction request object.\n * @param gasPrice - The gas price to use for the transaction, if not provided it will be fetched.\n * @returns A promise that resolves to the estimate transaction dependencies.\n */\n async estimateTxDependencies(\n transactionRequest: TransactionRequest,\n { gasPrice: gasPriceParam }: EstimateTxDependenciesParams = {}\n ): Promise<EstimateTxDependenciesReturns> {\n if (isTransactionTypeCreate(transactionRequest)) {\n return {\n receipts: [],\n outputVariables: 0,\n missingContractIds: [],\n };\n }\n\n let receipts: TransactionResultReceipt[] = [];\n const missingContractIds: string[] = [];\n let outputVariables = 0;\n let dryRunStatus: DryRunStatus | undefined;\n\n await this.validateTransaction(transactionRequest);\n\n const gasPrice = gasPriceParam ?? (await this.estimateGasPrice(10));\n\n for (let attempt = 0; attempt < MAX_RETRIES; attempt++) {\n const {\n dryRun: [{ receipts: rawReceipts, status }],\n } = await this.operations.dryRun({\n encodedTransactions: [hexlify(transactionRequest.toTransactionBytes())],\n utxoValidation: false,\n gasPrice: gasPrice.toString(),\n });\n\n receipts = rawReceipts.map(processGqlReceipt);\n dryRunStatus = status;\n\n const { missingOutputVariables, missingOutputContractIds } =\n getReceiptsWithMissingData(receipts);\n\n const hasMissingOutputs =\n missingOutputVariables.length !== 0 || missingOutputContractIds.length !== 0;\n\n if (hasMissingOutputs && isTransactionTypeScript(transactionRequest)) {\n outputVariables += missingOutputVariables.length;\n transactionRequest.addVariableOutputs(missingOutputVariables.length);\n missingOutputContractIds.forEach(({ contractId }) => {\n transactionRequest.addContractInputAndOutput(new Address(contractId));\n missingContractIds.push(contractId);\n });\n\n const { maxFee } = await this.estimateTxGasAndFee({\n transactionRequest,\n gasPrice,\n });\n\n // eslint-disable-next-line no-param-reassign\n transactionRequest.maxFee = maxFee;\n } else {\n break;\n }\n }\n\n return {\n receipts,\n outputVariables,\n missingContractIds,\n dryRunStatus,\n };\n }\n\n /**\n * Dry runs multiple transactions and checks for missing dependencies in batches.\n *\n * Transactions are dry run in batches. After each dry run, transactions requiring\n * further modifications are identified. The method iteratively updates these transactions\n * and performs subsequent dry runs until all dependencies for each transaction are satisfied.\n *\n * @param transactionRequests - Array of transaction request objects.\n * @returns A promise that resolves to an array of results for each transaction.\n */\n async estimateMultipleTxDependencies(\n transactionRequests: TransactionRequest[]\n ): Promise<EstimateTxDependenciesReturns[]> {\n const results: EstimateTxDependenciesReturns[] = transactionRequests.map(() => ({\n receipts: [],\n outputVariables: 0,\n missingContractIds: [],\n dryRunStatus: undefined,\n }));\n\n const allRequests = clone(transactionRequests);\n\n // Map of original request index to its serialized transaction (for ScriptTransactionRequest only)\n const serializedTransactionsMap = new Map();\n\n // Prepare ScriptTransactionRequests and their indices\n allRequests.forEach((req, index) => {\n if (isTransactionTypeScript(req)) {\n serializedTransactionsMap.set(index, hexlify(req.toTransactionBytes()));\n }\n });\n\n // Indices of ScriptTransactionRequests\n let transactionsToProcess = Array.from(serializedTransactionsMap.keys());\n let attempt = 0;\n\n while (transactionsToProcess.length > 0 && attempt < MAX_RETRIES) {\n const encodedTransactions = transactionsToProcess.map((index) =>\n serializedTransactionsMap.get(index)\n );\n const dryRunResults = await this.operations.dryRun({\n encodedTransactions,\n utxoValidation: false,\n });\n\n const nextRoundTransactions = [];\n\n for (let i = 0; i < dryRunResults.dryRun.length; i++) {\n const requestIdx = transactionsToProcess[i];\n const { receipts: rawReceipts, status } = dryRunResults.dryRun[i];\n const result = results[requestIdx];\n result.receipts = rawReceipts.map(processGqlReceipt);\n result.dryRunStatus = status;\n const { missingOutputVariables, missingOutputContractIds } = getReceiptsWithMissingData(\n result.receipts\n );\n const hasMissingOutputs =\n missingOutputVariables.length > 0 || missingOutputContractIds.length > 0;\n const request = allRequests[requestIdx];\n if (hasMissingOutputs && isTransactionTypeScript(request)) {\n result.outputVariables += missingOutputVariables.length;\n request.addVariableOutputs(missingOutputVariables.length);\n missingOutputContractIds.forEach(({ contractId }) => {\n request.addContractInputAndOutput(new Address(contractId));\n result.missingContractIds.push(contractId);\n });\n const { maxFee } = await this.estimateTxGasAndFee({\n transactionRequest: request,\n });\n request.maxFee = maxFee;\n // Prepare for the next round of dry run\n serializedTransactionsMap.set(requestIdx, hexlify(request.toTransactionBytes()));\n nextRoundTransactions.push(requestIdx);\n }\n }\n\n transactionsToProcess = nextRoundTransactions;\n attempt += 1;\n }\n\n return results;\n }\n\n /**\n * Dry runs multiple transactions.\n *\n * @param transactionRequests - Array of transaction request objects.\n * @param sendTransactionParams - The provider call parameters (optional).\n *\n * @returns A promise that resolves to an array of results for each transaction call.\n */\n async dryRunMultipleTransactions(\n transactionRequests: TransactionRequest[],\n { utxoValidation, estimateTxDependencies = true }: ProviderCallParams = {}\n ): Promise<CallResult[]> {\n if (estimateTxDependencies) {\n return this.estimateMultipleTxDependencies(transactionRequests);\n }\n const encodedTransactions = transactionRequests.map((tx) => hexlify(tx.toTransactionBytes()));\n const { dryRun: dryRunStatuses } = await this.operations.dryRun({\n encodedTransactions,\n utxoValidation: utxoValidation || false,\n });\n\n const results = dryRunStatuses.map(({ receipts: rawReceipts, status }) => {\n const receipts = rawReceipts.map(processGqlReceipt);\n return { receipts, dryRunStatus: status };\n });\n\n return results;\n }\n\n public async autoRefetchConfigs() {\n const now = Date.now();\n const diff = now - (this.consensusParametersTimestamp ?? 0);\n\n if (diff < 60000) {\n return;\n }\n\n // no cache? refetch.\n if (!Provider.chainInfoCache?.[this.urlWithoutAuth]) {\n await this.fetchChainAndNodeInfo(true);\n return;\n }\n\n const chainInfo = Provider.chainInfoCache[this.urlWithoutAuth];\n\n const {\n consensusParameters: { version: previous },\n } = chainInfo;\n\n const {\n chain: {\n latestBlock: {\n header: { consensusParametersVersion: current },\n },\n },\n } = await this.operations.getConsensusParametersVersion();\n\n // old cache? refetch.\n if (previous !== current) {\n // calling with true to skip cache\n await this.fetchChainAndNodeInfo(true);\n }\n }\n\n /**\n * Estimates the transaction gas and fee based on the provided transaction request.\n * @param params - The parameters for estimating the transaction gas and fee.\n * @returns An object containing the estimated minimum gas, minimum fee, maximum gas, and maximum fee.\n */\n async estimateTxGasAndFee(params: EstimateTxGasAndFeeParams) {\n const { transactionRequest, gasPrice: gasPriceParam } = params;\n let gasPrice = gasPriceParam;\n\n await this.autoRefetchConfigs();\n\n const chainInfo = await this.getChain();\n const { gasPriceFactor, maxGasPerTx } = await this.getGasConfig();\n\n const minGas = transactionRequest.calculateMinGas(chainInfo);\n if (!isDefined(gasPrice)) {\n gasPrice = await this.estimateGasPrice(10);\n }\n\n const minFee = calculateGasFee({\n gasPrice: bn(gasPrice),\n gas: minGas,\n priceFactor: gasPriceFactor,\n tip: transactionRequest.tip,\n }).add(1);\n\n let gasLimit = bn(0);\n\n // Only Script transactions consume gas\n if (isTransactionTypeScript(transactionRequest)) {\n // If the gasLimit is set to 0, it means we need to estimate it.\n gasLimit = transactionRequest.gasLimit;\n if (transactionRequest.gasLimit.eq(0)) {\n transactionRequest.gasLimit = minGas;\n\n /*\n * Adjusting the gasLimit of a transaction (TX) impacts its maxGas.\n * Consequently, this affects the maxFee, as it is derived from the maxGas. To accurately estimate the\n * gasLimit for a transaction, especially when the exact gas consumption is uncertain (as in an estimation dry-run),\n * the following steps are required:\n * 1 - Initially, set the gasLimit using the calculated minGas.\n * 2 - Based on this initial gasLimit, calculate the maxGas.\n * 3 - Get the maximum gas per transaction allowed by the chain, and subtract the previously calculated maxGas from this limit.\n * 4 - The result of this subtraction should then be adopted as the new, definitive gasLimit.\n * 5 - Recalculate the maxGas with the updated gasLimit. This new maxGas is then used to compute the maxFee.\n * 6 - The calculated maxFee represents the safe, estimated cost required to fund the transaction.\n */\n transactionRequest.gasLimit = maxGasPerTx.sub(\n transactionRequest.calculateMaxGas(chainInfo, minGas)\n );\n\n gasLimit = transactionRequest.gasLimit;\n }\n }\n const maxGas = transactionRequest.calculateMaxGas(chainInfo, minGas);\n const maxFee = calculateGasFee({\n gasPrice: bn(gasPrice),\n gas: maxGas,\n priceFactor: gasPriceFactor,\n tip: transactionRequest.tip,\n }).add(1);\n\n return {\n minGas,\n minFee,\n maxGas,\n maxFee,\n gasPrice,\n gasLimit,\n };\n }\n\n /**\n * Executes a signed transaction without applying the states changes\n * on the chain.\n *\n * If the transaction is missing any dependencies,\n * the transaction will be mutated and those dependencies will be added\n *\n * @param transactionRequestLike - The transaction request object.\n * @param estimateTxParams - The estimate transaction params (optional).\n * @returns A promise that resolves to the call result object.\n */\n async simulate(\n transactionRequestLike: TransactionRequestLike,\n { estimateTxDependencies = true }: EstimateTransactionParams = {}\n ): Promise<CallResult> {\n const transactionRequest = transactionRequestify(transactionRequestLike);\n if (estimateTxDependencies) {\n return this.estimateTxDependencies(transactionRequest);\n }\n const encodedTransactions = [hexlify(transactionRequest.toTransactionBytes())];\n\n const { dryRun: dryRunStatuses } = await this.operations.dryRun({\n encodedTransactions,\n utxoValidation: true,\n });\n\n const callResult = dryRunStatuses.map((dryRunStatus) => {\n const { id, receipts, status } = dryRunStatus;\n\n const processedReceipts = receipts.map(processGqlReceipt);\n\n return { id, receipts: processedReceipts, status };\n });\n\n return { receipts: callResult[0].receipts };\n }\n\n /**\n * @hidden\n *\n * Returns a transaction cost to enable user\n * to set gasLimit and also reserve balance amounts\n * on the transaction.\n *\n * @param transactionRequestLike - The transaction request object.\n * @param transactionCostParams - The transaction cost parameters (optional).\n *\n * @returns A promise that resolves to the transaction cost object.\n */\n async getTransactionCost(\n transactionRequestLike: TransactionRequestLike,\n { signatureCallback, gasPrice: gasPriceParam }: TransactionCostParams = {}\n ): Promise<Omit<TransactionCost, 'requiredQuantities'>> {\n const txRequestClone = clone(transactionRequestify(transactionRequestLike));\n const updateMaxFee = txRequestClone.maxFee.eq(0);\n const isScriptTransaction = isTransactionTypeScript(txRequestClone);\n\n // Remove gasLimit to avoid gasLimit when estimating predicates\n if (isScriptTransaction) {\n txRequestClone.gasLimit = bn(0);\n }\n\n const signedRequest = clone(txRequestClone);\n let addedSignatures = 0;\n if (signatureCallback && isTransactionTypeScript(signedRequest)) {\n const lengthBefore = signedRequest.witnesses.length;\n await signatureCallback(signedRequest);\n addedSignatures = signedRequest.witnesses.length - lengthBefore;\n }\n\n await this.estimatePredicates(signedRequest);\n txRequestClone.updatePredicateGasUsed(signedRequest.inputs);\n\n const gasPrice = gasPriceParam ?? (await this.estimateGasPrice(10));\n\n /**\n * Calculate minGas and maxGas based on the real transaction\n */\n // eslint-disable-next-line prefer-const\n let { maxFee, maxGas, minFee, minGas, gasLimit } = await this.estimateTxGasAndFee({\n // Fetches and returns a gas price\n transactionRequest: signedRequest,\n gasPrice,\n });\n\n let receipts: TransactionResultReceipt[] = [];\n let dryRunStatus: DryRunStatus | undefined;\n let missingContractIds: string[] = [];\n let outputVariables = 0;\n let gasUsed = bn(0);\n\n txRequestClone.maxFee = maxFee;\n if (isScriptTransaction) {\n txRequestClone.gasLimit = gasLimit;\n if (signatureCallback) {\n await signatureCallback(txRequestClone);\n }\n\n ({ receipts, missingContractIds, outputVariables, dryRunStatus } =\n await this.estimateTxDependencies(txRequestClone, { gasPrice }));\n\n if (dryRunStatus && 'reason' in dryRunStatus) {\n throw this.extractDryRunError(txRequestClone, receipts, dryRunStatus);\n }\n\n const { maxGasPerTx } = await this.getGasConfig();\n\n const pristineGasUsed = getGasUsedFromReceipts(receipts);\n gasUsed = bn(pristineGasUsed.muln(GAS_USED_MODIFIER)).max(maxGasPerTx.sub(minGas));\n txRequestClone.gasLimit = gasUsed;\n\n ({ maxFee, maxGas, minFee, minGas } = await this.estimateTxGasAndFee({\n transactionRequest: txRequestClone,\n gasPrice,\n }));\n }\n\n return {\n receipts,\n gasUsed,\n gasPrice,\n minGas,\n maxGas,\n minFee,\n maxFee,\n outputVariables,\n missingContractIds,\n addedSignatures,\n estimatedPredicates: txRequestClone.inputs,\n dryRunStatus,\n updateMaxFee,\n };\n }\n\n /**\n * Returns coins for the given owner.\n *\n * @param owner - The address to get coins for.\n * @param assetId - The asset ID of coins to get (optional).\n * @param paginationArgs - Pagination arguments (optional).\n *\n * @returns A promise that resolves to the coins.\n */\n async getCoins(\n owner: AddressInput,\n assetId?: BytesLike,\n paginationArgs?: CursorPaginationArgs\n ): Promise<GetCoinsResponse> {\n const ownerAddress = new Address(owner);\n const {\n coins: { edges, pageInfo },\n } = await this.operations.getCoins({\n ...validatePaginationArgs({\n paginationLimit: RESOURCES_PAGE_SIZE_LIMIT,\n inputArgs: paginationArgs,\n }),\n filter: { owner: ownerAddress.toB256(), assetId: assetId && hexlify(assetId) },\n });\n\n const coins = edges.map(({ node }) => ({\n id: node.utxoId,\n assetId: node.assetId,\n amount: bn(node.amount),\n owner: ownerAddress,\n blockCreated: bn(node.blockCreated),\n txCreatedIdx: bn(node.txCreatedIdx),\n }));\n\n return {\n coins,\n pageInfo,\n };\n }\n\n /**\n * Returns resources for the given owner satisfying the spend query.\n *\n * @param owner - The address to get resources for.\n * @param quantities - The coin quantities to get.\n * @param excludedIds - IDs of excluded resources from the selection (optional).\n * @returns A promise that resolves to the resources.\n */\n async getResourcesToSpend(\n owner: AddressInput,\n quantities: CoinQuantityLike[],\n excludedIds?: ExcludeResourcesOption\n ): Promise<Resource[]> {\n const ownerAddress = new Address(owner);\n const excludeInput = {\n messages: excludedIds?.messages?.map((nonce) => hexlify(nonce)) || [],\n utxos: excludedIds?.utxos?.map((id) => hexlify(id)) || [],\n };\n\n if (this.cache) {\n const cached = this.cache.getActiveData();\n excludeInput.messages.push(...cached.messages);\n excludeInput.utxos.push(...cached.utxos);\n }\n\n const coinsQuery = {\n owner: ownerAddress.toB256(),\n queryPerAsset: quantities\n .map(coinQuantityfy)\n .map(({ assetId, amount, max: maxPerAsset }) => ({\n assetId: hexlify(assetId),\n amount: amount.toString(10),\n max: maxPerAsset ? maxPerAsset.toString(10) : undefined,\n })),\n excludedIds: excludeInput,\n };\n\n const result = await this.operations.getCoinsToSpend(coinsQuery);\n\n const coins = result.coinsToSpend\n .flat()\n .map((coin) => {\n switch (coin.type) {\n case 'MessageCoin':\n return {\n amount: bn(coin.amount),\n assetId: coin.assetId,\n daHeight: bn(coin.daHeight),\n sender: new Address(coin.sender),\n recipient: new Address(coin.recipient),\n nonce: coin.nonce,\n } as MessageCoin;\n case 'Coin':\n return {\n id: coin.utxoId,\n amount: bn(coin.amount),\n assetId: coin.assetId,\n owner: ownerAddress,\n blockCreated: bn(coin.blockCreated),\n txCreatedIdx: bn(coin.txCreatedIdx),\n } as Coin;\n default:\n return null;\n }\n })\n .filter((v) => !!v) as Array<Resource>;\n\n return coins;\n }\n\n /**\n * Returns an array of blobIds that exist on chain, for a given array of blobIds.\n *\n * @param blobIds - blobIds to check.\n * @returns - A promise that resolves to an array of blobIds that exist on chain.\n */\n async getBlobs(blobIds: string[]): Promise<string[]> {\n const res = await this.operations.getBlobs({ blobIds });\n const blobs: (string | null)[] = [];\n\n Object.keys(res).forEach((key) => {\n // @ts-expect-error keys are strings\n const val = res[key];\n blobs.push(val?.id ?? null);\n });\n\n return blobs.filter((v) => v) as string[];\n }\n\n /**\n * Returns block matching the given ID or height.\n *\n * @param idOrHeight - ID or height of the block.\n * @returns A promise that resolves to the block or null.\n */\n async getBlock(idOrHeight: string | number | 'latest'): Promise<Block | null> {\n let block: GqlBlockFragment | undefined | null;\n\n if (idOrHeight === 'latest') {\n const {\n chain: { latestBlock },\n } = await this.operations.getLatestBlock();\n block = latestBlock;\n } else {\n const isblockId = typeof idOrHeight === 'string' && idOrHeight.length === 66;\n const variables = isblockId\n ? { blockId: idOrHeight }\n : { height: bn(idOrHeight).toString(10) };\n const response = await this.operations.getBlock(variables);\n block = response.block;\n }\n\n if (!block) {\n return null;\n }\n\n const { header, height, id, transactions } = block;\n\n return {\n id,\n height: bn(height),\n time: header.time,\n header: {\n applicationHash: header.applicationHash,\n daHeight: bn(header.daHeight),\n eventInboxRoot: header.eventInboxRoot,\n messageOutboxRoot: header.messageOutboxRoot,\n prevRoot: header.prevRoot,\n stateTransitionBytecodeVersion: header.stateTransitionBytecodeVersion,\n transactionsCount: header.transactionsCount,\n transactionsRoot: header.transactionsRoot,\n },\n transactionIds: transactions.map((tx) => tx.id),\n };\n }\n\n /**\n * Returns all the blocks matching the given parameters.\n *\n * @param params - The parameters to query blocks.\n * @returns A promise that resolves to the blocks.\n */\n async getBlocks(params?: CursorPaginationArgs): Promise<GetBlocksResponse> {\n const {\n blocks: { edges, pageInfo },\n } = await this.operations.getBlocks({\n ...validatePaginationArgs({\n paginationLimit: BLOCKS_PAGE_SIZE_LIMIT,\n inputArgs: params,\n }),\n });\n\n const blocks: Block[] = edges.map(({ node: block }) => ({\n id: block.id,\n height: bn(block.height),\n time: block.header.time,\n header: {\n applicationHash: block.header.applicationHash,\n daHeight: bn(block.header.daHeight),\n eventInboxRoot: block.header.eventInboxRoot,\n messageOutboxRoot: block.header.messageOutboxRoot,\n prevRoot: block.header.prevRoot,\n stateTransitionBytecodeVersion: block.header.stateTransitionBytecodeVersion,\n transactionsCount: block.header.transactionsCount,\n transactionsRoot: block.header.transactionsRoot,\n },\n transactionIds: block.transactions.map((tx) => tx.id),\n }));\n\n return { blocks, pageInfo };\n }\n\n /**\n * Returns block matching the given ID or type, including transaction data.\n *\n * @param idOrHeight - ID or height of the block.\n * @returns A promise that resolves to the block.\n */\n async getBlockWithTransactions(\n /** ID or height of the block */\n idOrHeight: string | number | 'latest'\n ): Promise<(Block & { transactions: Transaction[] }) | null> {\n let variables;\n if (typeof idOrHeight === 'number') {\n variables = { blockHeight: bn(idOrHeight).toString(10) };\n } else if (idOrHeight === 'latest') {\n variables = { blockHeight: (await this.getBlockNumber()).toString() };\n } else {\n variables = { blockId: idOrHeight };\n }\n\n const { block } = await this.operations.getBlockWithTransactions(variables);\n\n if (!block) {\n return null;\n }\n\n return {\n id: block.id,\n height: bn(block.height, 10),\n time: block.header.time,\n header: {\n applicationHash: block.header.applicationHash,\n daHeight: bn(block.header.daHeight),\n eventInboxRoot: block.header.eventInboxRoot,\n messageOutboxRoot: block.header.messageOutboxRoot,\n prevRoot: block.header.prevRoot,\n stateTransitionBytecodeVersion: block.header.stateTransitionBytecodeVersion,\n transactionsCount: block.header.transactionsCount,\n transactionsRoot: block.header.transactionsRoot,\n },\n transactionIds: block.transactions.map((tx) => tx.id),\n transactions: block.transactions.map(\n (tx) => new TransactionCoder().decode(arrayify(tx.rawPayload), 0)?.[0]\n ),\n };\n }\n\n /**\n * Get transaction with the given ID.\n *\n * @param transactionId - ID of the transaction.\n * @returns A promise that resolves to the transaction.\n */\n async getTransaction<TTransactionType = void>(\n transactionId: string\n ): Promise<Transaction<TTransactionType> | null> {\n const { transaction } = await this.operations.getTransaction({ transactionId });\n\n if (!transaction) {\n return null;\n }\n\n try {\n return new TransactionCoder().decode(\n arrayify(transaction.rawPayload),\n 0\n )?.[0] as Transaction<TTransactionType>;\n } catch (error) {\n if (error instanceof FuelError && error.code === ErrorCode.UNSUPPORTED_TRANSACTION_TYPE) {\n // eslint-disable-next-line no-console\n console.warn('Unsupported transaction type encountered');\n return null;\n }\n throw error;\n }\n }\n\n /**\n * Retrieves transactions based on the provided pagination arguments.\n * @param paginationArgs - The pagination arguments for retrieving transactions.\n * @returns A promise that resolves to an object containing the retrieved transactions and pagination information.\n */\n async getTransactions(paginationArgs?: CursorPaginationArgs): Promise<GetTransactionsResponse> {\n const {\n transactions: { edges, pageInfo },\n } = await this.operations.getTransactions({\n ...validatePaginationArgs({\n inputArgs: paginationArgs,\n paginationLimit: TRANSACTIONS_PAGE_SIZE_LIMIT,\n }),\n });\n\n const coder = new TransactionCoder();\n const transactions = edges\n .map(({ node: { rawPayload } }) => {\n try {\n return coder.decode(arrayify(rawPayload), 0)[0];\n } catch (error) {\n if (error instanceof FuelError && error.code === ErrorCode.UNSUPPORTED_TRANSACTION_TYPE) {\n // eslint-disable-next-line no-console\n console.warn('Unsupported transaction type encountered');\n return null;\n }\n throw error;\n }\n })\n .filter((tx): tx is Transaction => tx !== null);\n\n return { transactions, pageInfo };\n }\n\n /**\n * Fetches a compressed block at the specified height.\n *\n * @param height - The height of the block to fetch.\n * @returns The compressed block if available, otherwise `null`.\n */\n async daCompressedBlock(height: string) {\n const { daCompressedBlock } = await this.operations.daCompressedBlock({\n height,\n });\n\n if (!daCompressedBlock) {\n return null;\n }\n\n return daCompressedBlock;\n }\n\n /**\n * Get deployed contract with the given ID.\n *\n * @param contractId - ID of the contract.\n * @returns A promise that resolves to the contract.\n */\n async getContract(contractId: string): Promise<ContractResult | null> {\n const { contract } = await this.operations.getContract({ contractId });\n if (!contract) {\n return null;\n }\n return contract;\n }\n\n /**\n * Returns the balance for the given contract for the given asset ID.\n *\n * @param contractId - The contract ID to get the balance for.\n * @param assetId - The asset ID of coins to get.\n * @returns A promise that resolves to the balance.\n */\n async getContractBalance(\n /** The contract ID to get the balance for */\n contractId: string | Address,\n /** The asset ID of coins to get */\n assetId: BytesLike\n ): Promise<BN> {\n const { contractBalance } = await this.operations.getContractBalance({\n contract: new Address(contractId).toB256(),\n asset: hexlify(assetId),\n });\n return bn(contractBalance.amount, 10);\n }\n\n /**\n * Returns the balance for the given owner for the given asset ID.\n *\n * @param owner - The address to get coins for.\n * @param assetId - The asset ID of coins to get.\n * @returns A promise that resolves to the balance.\n */\n async getBalance(\n /** The address to get coins for */\n owner: AddressInput,\n /** The asset ID of coins to get */\n assetId: BytesLike\n ): Promise<BN> {\n const { balance } = await this.operations.getBalance({\n owner: new Address(owner).toB256(),\n assetId: hexlify(assetId),\n });\n return bn(balance.amount, 10);\n }\n\n /**\n * Returns balances for the given owner.\n *\n * @param owner - The address to get coins for.\n * @param paginationArgs - Pagination arguments (optional).\n * @returns A promise that resolves to the balances.\n */\n async getBalances(owner: AddressInput): Promise<GetBalancesResponse> {\n const {\n balances: { edges },\n } = await this.operations.getBalances({\n /**\n * The query parameters for this method were designed to support pagination,\n * but the current Fuel-Core implementation does not support pagination yet.\n */\n first: 10000,\n filter: { owner: new Address(owner).toB256() },\n });\n\n const balances = edges.map(({ node }) => ({\n assetId: node.assetId,\n amount: bn(node.amount),\n }));\n\n return { balances };\n }\n\n /**\n * Returns message for the given address.\n *\n * @param address - The address to get message from.\n * @param paginationArgs - Pagination arguments (optional).\n * @returns A promise that resolves to the messages.\n */\n async getMessages(\n address: AddressInput,\n paginationArgs?: CursorPaginationArgs\n ): Promise<GetMessagesResponse> {\n const {\n messages: { edges, pageInfo },\n } = await this.operations.getMessages({\n ...validatePaginationArgs({\n inputArgs: paginationArgs,\n paginationLimit: RESOURCES_PAGE_SIZE_LIMIT,\n }),\n owner: new Address(address).toB256(),\n });\n\n const messages = edges.map(({ node }) => ({\n messageId: InputMessageCoder.getMessageId({\n sender: node.sender,\n recipient: node.recipient,\n nonce: node.nonce,\n amount: bn(node.amount),\n data: node.data,\n }),\n sender: new Address(node.sender),\n recipient: new Address(node.recipient),\n nonce: node.nonce,\n amount: bn(node.amount),\n data: InputMessageCoder.decodeData(node.data),\n daHeight: bn(node.daHeight),\n }));\n\n return {\n messages,\n pageInfo,\n };\n }\n\n /**\n * Returns Message Proof for given transaction id and the message id from MessageOut receipt.\n *\n * @param transactionId - The transaction to get message from.\n * @param messageId - The message id from MessageOut receipt.\n * @param commitBlockId - The commit block id (optional).\n * @param commitBlockHeight - The commit block height (optional).\n * @returns A promise that resolves to the message proof.\n */\n async getMessageProof(\n transactionId: string,\n nonce: string,\n commitBlockId?: string,\n commitBlockHeight?: BN\n ): Promise<MessageProof | null> {\n let inputObject: {\n /** The transaction to get message from */\n transactionId: string;\n /** The message id from MessageOut receipt */\n nonce: string;\n commitBlockId?: string;\n commitBlockHeight?: string;\n } = {\n transactionId,\n nonce,\n };\n\n if (commitBlockId && commitBlockHeight) {\n throw new FuelError(\n ErrorCode.INVALID_INPUT_PARAMETERS,\n 'commitBlockId and commitBlockHeight cannot be used together'\n );\n }\n\n if (commitBlockId) {\n inputObject = {\n ...inputObject,\n commitBlockId,\n };\n }\n\n if (commitBlockHeight) {\n inputObject = {\n ...inputObject,\n // Conver BN into a number string required on the query\n // This should problably be fixed on the fuel client side\n commitBlockHeight: commitBlockHeight.toNumber().toString(),\n };\n }\n\n const result = await this.operations.getMessageProof(inputObject);\n\n if (!result.messageProof) {\n return null;\n }\n\n const {\n messageProof,\n messageBlockHeader,\n commitBlockHeader,\n blockProof,\n sender,\n recipient,\n amount,\n data,\n } = result.messageProof;\n\n return {\n messageProof: {\n proofIndex: bn(messageProof.proofIndex),\n proofSet: messageProof.proofSet,\n },\n blockProof: {\n proofIndex: bn(blockProof.proofIndex),\n proofSet: blockProof.proofSet,\n },\n messageBlockHeader: {\n id: messageBlockHeader.id,\n daHeight: bn(messageBlockHeader.daHeight),\n transactionsCount: Number(messageBlockHeader.transactionsCount),\n transactionsRoot: messageBlockHeader.transactionsRoot,\n height: bn(messageBlockHeader.height),\n prevRoot: messageBlockHeader.prevRoot,\n time: messageBlockHeader.time,\n applicationHash: messageBlockHeader.applicationHash,\n messageReceiptCount: Number(messageBlockHeader.messageReceiptCount),\n messageOutboxRoot: messageBlockHeader.messageOutboxRoot,\n consensusParametersVersion: Number(messageBlockHeader.consensusParametersVersion),\n eventInboxRoot: messageBlockHeader.eventInboxRoot,\n stateTransitionBytecodeVersion: Number(messageBlockHeader.stateTransitionBytecodeVersion),\n },\n commitBlockHeader: {\n id: commitBlockHeader.id,\n daHeight: bn(commitBlockHeader.daHeight),\n transactionsCount: Number(commitBlockHeader.transactionsCount),\n transactionsRoot: commitBlockHeader.transactionsRoot,\n height: bn(commitBlockHeader.height),\n prevRoot: commitBlockHeader.prevRoot,\n time: commitBlockHeader.time,\n applicationHash: commitBlockHeader.applicationHash,\n messageReceiptCount: Number(commitBlockHeader.messageReceiptCount),\n messageOutboxRoot: commitBlockHeader.messageOutboxRoot,\n consensusParametersVersion: Number(commitBlockHeader.consensusParametersVersion),\n eventInboxRoot: commitBlockHeader.eventInboxRoot,\n stateTransitionBytecodeVersion: Number(commitBlockHeader.stateTransitionBytecodeVersion),\n },\n sender: new Address(sender),\n recipient: new Address(recipient),\n nonce,\n amount: bn(amount),\n data,\n };\n }\n\n /**\n * Get the latest gas price from the node.\n *\n * @returns A promise that resolves to the latest gas price.\n */\n async getLatestGasPrice(): Promise<BN> {\n const { latestGasPrice } = await this.operations.getLatestGasPrice();\n return bn(latestGasPrice.gasPrice);\n }\n\n /**\n * Returns the estimate gas price for the given block horizon.\n *\n * @param blockHorizon - The block horizon to estimate gas price for.\n * @returns A promise that resolves to the estimated gas price.\n */\n async estimateGasPrice(blockHorizon: number): Promise<BN> {\n const { estimateGasPrice } = await this.operations.estimateGasPrice({\n blockHorizon: String(blockHorizon),\n });\n return bn(estimateGasPrice.gasPrice);\n }\n\n /**\n * Returns Message Proof for given transaction id and the message id from MessageOut receipt.\n *\n * @param nonce - The nonce of the message to get status from.\n * @returns A promise that resolves to the message status\n */\n async getMessageStatus(\n /** The nonce of the message to get status from */\n nonce: string\n ): Promise<MessageStatus> {\n const result = await this.operations.getMessageStatus({ nonce });\n return result.messageStatus;\n }\n\n /**\n * Lets you produce blocks with custom timestamps and the block number of the last block produced.\n *\n * @param amount - The amount of blocks to produce.\n * @param startTime - The UNIX timestamp (milliseconds) to set for the first produced block (optional).\n * @returns A promise that resolves to the block number of the last produced block.\n */\n async produceBlocks(amount: number, startTime?: number) {\n const { produceBlocks: latestBlockHeight } = await this.operations.produceBlocks({\n blocksToProduce: bn(amount).toString(10),\n startTimestamp: startTime ? DateTime.fromUnixMilliseconds(startTime).toTai64() : undefined,\n });\n return bn(latestBlockHeight);\n }\n\n /**\n * Check if the given ID is an account.\n *\n * @param id - The ID to check.\n * @returns A promise that resolves to the result of the check.\n */\n async isUserAccount(id: string): Promise<boolean> {\n const { contract, blob, transaction } = await this.operations.isUserAccount({\n blobId: id,\n contractId: id,\n transactionId: id,\n });\n\n if (contract || blob || transaction) {\n return false;\n }\n return true;\n }\n\n async getAddressType(id: string): Promise<'Account' | 'Contract' | 'Transaction' | 'Blob'> {\n const { contract, blob, transaction } = await this.operations.isUserAccount({\n blobId: id,\n contractId: id,\n transactionId: id,\n });\n\n if (contract) {\n return 'Contract';\n }\n if (blob) {\n return 'Blob';\n }\n if (transaction) {\n return 'Transaction';\n }\n\n return 'Account';\n }\n\n /**\n * Get the transaction response for the given transaction ID.\n *\n * @param transactionId - The transaction ID to get the response for.\n * @returns A promise that resolves to the transaction response.\n */\n\n async getTransactionResponse(transactionId: string): Promise<TransactionResponse> {\n const chainId = await this.getChainId();\n return new TransactionResponse(transactionId, this, chainId);\n }\n\n /**\n * Returns Message for given nonce.\n *\n * @param nonce - The nonce of the message to retrieve.\n * @returns A promise that resolves to the Message object or null.\n */\n async getMessageByNonce(nonce: string): Promise<Message | null> {\n const { message: rawMessage } = await this.operations.getMessageByNonce({ nonce });\n\n if (!rawMessage) {\n return null;\n }\n\n const message: Message = {\n messageId: InputMessageCoder.getMessageId({\n sender: rawMessage.sender,\n recipient: rawMessage.recipient,\n nonce,\n amount: bn(rawMessage.amount),\n data: rawMessage.data,\n }),\n sender: new Address(rawMessage.sender),\n recipient: new Address(rawMessage.recipient),\n nonce,\n amount: bn(rawMessage.amount),\n data: InputMessageCoder.decodeData(rawMessage.data),\n daHeight: bn(rawMessage.daHeight),\n };\n\n return message;\n }\n\n /**\n * Get the relayed transaction for the given transaction ID.\n *\n * @param relayedTransactionId - The relayed transaction ID to get the response for.\n * @returns A promise that resolves to the relayed transaction.\n */\n async getRelayedTransactionStatus(\n relayedTransactionId: string\n ): Promise<GqlRelayedTransactionFailed | null> {\n const { relayedTransactionStatus } = await this.operations.getRelayedTransactionStatus({\n relayedTransactionId,\n });\n\n if (!relayedTransactionStatus) {\n return null;\n }\n\n return relayedTransactionStatus;\n }\n\n /**\n * @hidden\n */\n private extractDryRunError(\n transactionRequest: ScriptTransactionRequest,\n receipts: TransactionResultReceipt[],\n dryRunStatus: DryRunStatus\n ): FuelError {\n const status = dryRunStatus as DryRunFailureStatusFragment;\n let logs: unknown[] = [];\n if (transactionRequest.abis) {\n logs = getDecodedLogs(\n receipts,\n transactionRequest.abis.main,\n transactionRequest.abis.otherContractsAbis\n );\n }\n\n return extractTxError({\n logs,\n receipts,\n statusReason: status.reason,\n });\n }\n}\n","import type { DocumentNode } from 'graphql';\nimport gql from 'graphql-tag';\nexport type Maybe<T> = T | null;\nexport type InputMaybe<T> = Maybe<T>;\nexport type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };\nexport type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };\nexport type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };\nexport type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };\nexport type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };\n/** All built-in and custom scalars, mapped to their actual values */\nexport type Scalars = {\n ID: { input: string; output: string; }\n String: { input: string; output: string; }\n Boolean: { input: boolean; output: boolean; }\n Int: { input: number; output: number; }\n Float: { input: number; output: number; }\n Address: { input: string; output: string; }\n AssetId: { input: string; output: string; }\n BlobId: { input: any; output: any; }\n BlockId: { input: string; output: string; }\n Bytes32: { input: string; output: string; }\n ContractId: { input: string; output: string; }\n HexString: { input: string; output: string; }\n Nonce: { input: string; output: string; }\n RelayedTransactionId: { input: string; output: string; }\n Salt: { input: string; output: string; }\n Signature: { input: string; output: string; }\n Tai64Timestamp: { input: string; output: string; }\n TransactionId: { input: string; output: string; }\n TxPointer: { input: string; output: string; }\n U16: { input: string; output: string; }\n U32: { input: string; output: string; }\n U64: { input: string; output: string; }\n UtxoId: { input: string; output: string; }\n};\n\nexport type GqlBalance = {\n amount: Scalars['U64']['output'];\n assetId: Scalars['AssetId']['output'];\n owner: Scalars['Address']['output'];\n};\n\nexport type GqlBalanceConnection = {\n /** A list of edges. */\n edges: Array<GqlBalanceEdge>;\n /** A list of nodes. */\n nodes: Array<GqlBalance>;\n /** Information to aid in pagination. */\n pageInfo: GqlPageInfo;\n};\n\n/** An edge in a connection. */\nexport type GqlBalanceEdge = {\n /** A cursor for use in pagination */\n cursor: Scalars['String']['output'];\n /** The item at the end of the edge */\n node: GqlBalance;\n};\n\nexport type GqlBalanceFilterInput = {\n /** Filter coins based on the `owner` field */\n owner: Scalars['Address']['input'];\n};\n\nexport type GqlBlob = {\n bytecode: Scalars['HexString']['output'];\n id: Scalars['BlobId']['output'];\n};\n\nexport type GqlBlock = {\n consensus: GqlConsensus;\n header: GqlHeader;\n height: Scalars['U32']['output'];\n id: Scalars['BlockId']['output'];\n transactionIds: Array<Scalars['TransactionId']['output']>;\n transactions: Array<GqlTransaction>;\n version: GqlBlockVersion;\n};\n\nexport type GqlBlockConnection = {\n /** A list of edges. */\n edges: Array<GqlBlockEdge>;\n /** A list of nodes. */\n nodes: Array<GqlBlock>;\n /** Information to aid in pagination. */\n pageInfo: GqlPageInfo;\n};\n\n/** An edge in a connection. */\nexport type GqlBlockEdge = {\n /** A cursor for use in pagination */\n cursor: Scalars['String']['output'];\n /** The item at the end of the edge */\n node: GqlBlock;\n};\n\nexport enum GqlBlockVersion {\n V1 = 'V1'\n}\n\n/** Breakpoint, defined as a tuple of contract ID and relative PC offset inside it */\nexport type GqlBreakpoint = {\n contract: Scalars['ContractId']['input'];\n pc: Scalars['U64']['input'];\n};\n\nexport type GqlChainInfo = {\n consensusParameters: GqlConsensusParameters;\n daHeight: Scalars['U64']['output'];\n gasCosts: GqlGasCosts;\n latestBlock: GqlBlock;\n name: Scalars['String']['output'];\n};\n\nexport type GqlChangeOutput = {\n amount: Scalars['U64']['output'];\n assetId: Scalars['AssetId']['output'];\n to: Scalars['Address']['output'];\n};\n\nexport type GqlCoin = {\n amount: Scalars['U64']['output'];\n assetId: Scalars['AssetId']['output'];\n /** TxPointer - the height of the block this coin was created in */\n blockCreated: Scalars['U32']['output'];\n owner: Scalars['Address']['output'];\n /** TxPointer - the index of the transaction that created this coin */\n txCreatedIdx: Scalars['U16']['output'];\n utxoId: Scalars['UtxoId']['output'];\n};\n\nexport type GqlCoinConnection = {\n /** A list of edges. */\n edges: Array<GqlCoinEdge>;\n /** A list of nodes. */\n nodes: Array<GqlCoin>;\n /** Information to aid in pagination. */\n pageInfo: GqlPageInfo;\n};\n\n/** An edge in a connection. */\nexport type GqlCoinEdge = {\n /** A cursor for use in pagination */\n cursor: Scalars['String']['output'];\n /** The item at the end of the edge */\n node: GqlCoin;\n};\n\nexport type GqlCoinFilterInput = {\n /** Returns coins only with `asset_id`. */\n assetId?: InputMaybe<Scalars['AssetId']['input']>;\n /** Returns coins owned by the `owner`. */\n owner: Scalars['Address']['input'];\n};\n\nexport type GqlCoinOutput = {\n amount: Scalars['U64']['output'];\n assetId: Scalars['AssetId']['output'];\n to: Scalars['Address']['output'];\n};\n\n/** The schema analog of the [`coins::CoinType`]. */\nexport type GqlCoinType = GqlCoin | GqlMessageCoin;\n\nexport type GqlConsensus = GqlGenesis | GqlPoAConsensus;\n\nexport type GqlConsensusParameters = {\n baseAssetId: Scalars['AssetId']['output'];\n blockGasLimit: Scalars['U64']['output'];\n blockTransactionSizeLimit: Scalars['U64']['output'];\n chainId: Scalars['U64']['output'];\n contractParams: GqlContractParameters;\n feeParams: GqlFeeParameters;\n gasCosts: GqlGasCosts;\n predicateParams: GqlPredicateParameters;\n privilegedAddress: Scalars['Address']['output'];\n scriptParams: GqlScriptParameters;\n txParams: GqlTxParameters;\n version: GqlConsensusParametersVersion;\n};\n\nexport type GqlConsensusParametersPurpose = {\n checksum: Scalars['Bytes32']['output'];\n witnessIndex: Scalars['U16']['output'];\n};\n\nexport enum GqlConsensusParametersVersion {\n V1 = 'V1'\n}\n\nexport type GqlContract = {\n bytecode: Scalars['HexString']['output'];\n id: Scalars['ContractId']['output'];\n salt: Scalars['Salt']['output'];\n};\n\nexport type GqlContractBalance = {\n amount: Scalars['U64']['output'];\n assetId: Scalars['AssetId']['output'];\n contract: Scalars['ContractId']['output'];\n};\n\nexport type GqlContractBalanceConnection = {\n /** A list of edges. */\n edges: Array<GqlContractBalanceEdge>;\n /** A list of nodes. */\n nodes: Array<GqlContractBalance>;\n /** Information to aid in pagination. */\n pageInfo: GqlPageInfo;\n};\n\n/** An edge in a connection. */\nexport type GqlContractBalanceEdge = {\n /** A cursor for use in pagination */\n cursor: Scalars['String']['output'];\n /** The item at the end of the edge */\n node: GqlContractBalance;\n};\n\nexport type GqlContractBalanceFilterInput = {\n /** Filter assets based on the `contractId` field */\n contract: Scalars['ContractId']['input'];\n};\n\nexport type GqlContractCreated = {\n contract: Scalars['ContractId']['output'];\n stateRoot: Scalars['Bytes32']['output'];\n};\n\nexport type GqlContractOutput = {\n balanceRoot: Scalars['Bytes32']['output'];\n inputIndex: Scalars['U16']['output'];\n stateRoot: Scalars['Bytes32']['output'];\n};\n\nexport type GqlContractParameters = {\n contractMaxSize: Scalars['U64']['output'];\n maxStorageSlots: Scalars['U64']['output'];\n version: GqlContractParametersVersion;\n};\n\nexport enum GqlContractParametersVersion {\n V1 = 'V1'\n}\n\nexport type GqlDaCompressedBlock = {\n bytes: Scalars['HexString']['output'];\n};\n\nexport type GqlDependentCost = GqlHeavyOperation | GqlLightOperation;\n\nexport type GqlDryRunFailureStatus = {\n programState?: Maybe<GqlProgramState>;\n reason: Scalars['String']['output'];\n receipts: Array<GqlReceipt>;\n totalFee: Scalars['U64']['output'];\n totalGas: Scalars['U64']['output'];\n};\n\nexport type GqlDryRunSuccessStatus = {\n programState?: Maybe<GqlProgramState>;\n receipts: Array<GqlReceipt>;\n totalFee: Scalars['U64']['output'];\n totalGas: Scalars['U64']['output'];\n};\n\nexport type GqlDryRunTransactionExecutionStatus = {\n id: Scalars['TransactionId']['output'];\n receipts: Array<GqlReceipt>;\n status: GqlDryRunTransactionStatus;\n};\n\nexport type GqlDryRunTransactionStatus = GqlDryRunFailureStatus | GqlDryRunSuccessStatus;\n\nexport type GqlEstimateGasPrice = {\n gasPrice: Scalars['U64']['output'];\n};\n\nexport type GqlExcludeInput = {\n /** Messages to exclude from the selection. */\n messages: Array<Scalars['Nonce']['input']>;\n /** Utxos to exclude from the selection. */\n utxos: Array<Scalars['UtxoId']['input']>;\n};\n\nexport type GqlFailureStatus = {\n block: GqlBlock;\n blockHeight: Scalars['U32']['output'];\n programState?: Maybe<GqlProgramState>;\n reason: Scalars['String']['output'];\n receipts: Array<GqlReceipt>;\n time: Scalars['Tai64Timestamp']['output'];\n totalFee: Scalars['U64']['output'];\n totalGas: Scalars['U64']['output'];\n transaction: GqlTransaction;\n transactionId: Scalars['TransactionId']['output'];\n};\n\nexport type GqlFeeParameters = {\n gasPerByte: Scalars['U64']['output'];\n gasPriceFactor: Scalars['U64']['output'];\n version: GqlFeeParametersVersion;\n};\n\nexport enum GqlFeeParametersVersion {\n V1 = 'V1'\n}\n\nexport type GqlGasCosts = {\n add: Scalars['U64']['output'];\n addi: Scalars['U64']['output'];\n aloc: Scalars['U64']['output'];\n alocDependentCost: GqlDependentCost;\n and: Scalars['U64']['output'];\n andi: Scalars['U64']['output'];\n bal: Scalars['U64']['output'];\n bhei: Scalars['U64']['output'];\n bhsh: Scalars['U64']['output'];\n bldd?: Maybe<GqlDependentCost>;\n bsiz?: Maybe<GqlDependentCost>;\n burn: Scalars['U64']['output'];\n call: GqlDependentCost;\n cb: Scalars['U64']['output'];\n ccp: GqlDependentCost;\n cfe: GqlDependentCost;\n cfei: Scalars['U64']['output'];\n cfeiDependentCost: GqlDependentCost;\n cfsi: Scalars['U64']['output'];\n contractRoot: GqlDependentCost;\n croo: GqlDependentCost;\n csiz: GqlDependentCost;\n div: Scalars['U64']['output'];\n divi: Scalars['U64']['output'];\n eck1: Scalars['U64']['output'];\n ecr1: Scalars['U64']['output'];\n ed19: Scalars['U64']['output'];\n ed19DependentCost: GqlDependentCost;\n eq: Scalars['U64']['output'];\n exp: Scalars['U64']['output'];\n expi: Scalars['U64']['output'];\n flag: Scalars['U64']['output'];\n gm: Scalars['U64']['output'];\n gt: Scalars['U64']['output'];\n gtf: Scalars['U64']['output'];\n ji: Scalars['U64']['output'];\n jmp: Scalars['U64']['output'];\n jmpb: Scalars['U64']['output'];\n jmpf: Scalars['U64']['output'];\n jne: Scalars['U64']['output'];\n jneb: Scalars['U64']['output'];\n jnef: Scalars['U64']['output'];\n jnei: Scalars['U64']['output'];\n jnzb: Scalars['U64']['output'];\n jnzf: Scalars['U64']['output'];\n jnzi: Scalars['U64']['output'];\n k256: GqlDependentCost;\n lb: Scalars['U64']['output'];\n ldc: GqlDependentCost;\n log: Scalars['U64']['output'];\n logd: GqlDependentCost;\n lt: Scalars['U64']['output'];\n lw: Scalars['U64']['output'];\n mcl: GqlDependentCost;\n mcli: GqlDependentCost;\n mcp: GqlDependentCost;\n mcpi: GqlDependentCost;\n meq: GqlDependentCost;\n mint: Scalars['U64']['output'];\n mldv: Scalars['U64']['output'];\n mlog: Scalars['U64']['output'];\n modOp: Scalars['U64']['output'];\n modi: Scalars['U64']['output'];\n moveOp: Scalars['U64']['output'];\n movi: Scalars['U64']['output'];\n mroo: Scalars['U64']['output'];\n mul: Scalars['U64']['output'];\n muli: Scalars['U64']['output'];\n newStoragePerByte: Scalars['U64']['output'];\n noop: Scalars['U64']['output'];\n not: Scalars['U64']['output'];\n or: Scalars['U64']['output'];\n ori: Scalars['U64']['output'];\n poph: Scalars['U64']['output'];\n popl: Scalars['U64']['output'];\n pshh: Scalars['U64']['output'];\n pshl: Scalars['U64']['output'];\n ret: Scalars['U64']['output'];\n retd: GqlDependentCost;\n rvrt: Scalars['U64']['output'];\n s256: GqlDependentCost;\n sb: Scalars['U64']['output'];\n scwq: GqlDependentCost;\n sll: Scalars['U64']['output'];\n slli: Scalars['U64']['output'];\n smo: GqlDependentCost;\n srl: Scalars['U64']['output'];\n srli: Scalars['U64']['output'];\n srw: Scalars['U64']['output'];\n srwq: GqlDependentCost;\n stateRoot: GqlDependentCost;\n sub: Scalars['U64']['output'];\n subi: Scalars['U64']['output'];\n sw: Scalars['U64']['output'];\n sww: Scalars['U64']['output'];\n swwq: GqlDependentCost;\n time: Scalars['U64']['output'];\n tr: Scalars['U64']['output'];\n tro: Scalars['U64']['output'];\n version: GqlGasCostsVersion;\n vmInitialization: GqlDependentCost;\n wdam: Scalars['U64']['output'];\n wdcm: Scalars['U64']['output'];\n wddv: Scalars['U64']['output'];\n wdmd: Scalars['U64']['output'];\n wdml: Scalars['U64']['output'];\n wdmm: Scalars['U64']['output'];\n wdop: Scalars['U64']['output'];\n wqam: Scalars['U64']['output'];\n wqcm: Scalars['U64']['output'];\n wqdv: Scalars['U64']['output'];\n wqmd: Scalars['U64']['output'];\n wqml: Scalars['U64']['output'];\n wqmm: Scalars['U64']['output'];\n wqop: Scalars['U64']['output'];\n xor: Scalars['U64']['output'];\n xori: Scalars['U64']['output'];\n};\n\nexport enum GqlGasCostsVersion {\n V1 = 'V1'\n}\n\nexport type GqlGenesis = {\n /**\n * The chain configs define what consensus type to use, what settlement layer to use,\n * rules of block validity, etc.\n */\n chainConfigHash: Scalars['Bytes32']['output'];\n /** The Binary Merkle Tree root of all genesis coins. */\n coinsRoot: Scalars['Bytes32']['output'];\n /** The Binary Merkle Tree root of state, balances, contracts code hash of each contract. */\n contractsRoot: Scalars['Bytes32']['output'];\n /** The Binary Merkle Tree root of all genesis messages. */\n messagesRoot: Scalars['Bytes32']['output'];\n /** The Binary Merkle Tree root of all processed transaction ids. */\n transactionsRoot: Scalars['Bytes32']['output'];\n};\n\nexport type GqlHeader = {\n /** Hash of the application header. */\n applicationHash: Scalars['Bytes32']['output'];\n /** The version of the consensus parameters used to create this block. */\n consensusParametersVersion: Scalars['U32']['output'];\n /** The layer 1 height of messages and events to include since the last layer 1 block number. */\n daHeight: Scalars['U64']['output'];\n /** Merkle root of inbox events in this block. */\n eventInboxRoot: Scalars['Bytes32']['output'];\n /** Fuel block height. */\n height: Scalars['U32']['output'];\n /** Hash of the header */\n id: Scalars['BlockId']['output'];\n /** Merkle root of message receipts in this block. */\n messageOutboxRoot: Scalars['Bytes32']['output'];\n /** Number of message receipts in this block. */\n messageReceiptCount: Scalars['U32']['output'];\n /** Merkle root of all previous block header hashes. */\n prevRoot: Scalars['Bytes32']['output'];\n /** The version of the state transition bytecode used to create this block. */\n stateTransitionBytecodeVersion: Scalars['U32']['output'];\n /** The block producer time. */\n time: Scalars['Tai64Timestamp']['output'];\n /** Number of transactions in this block. */\n transactionsCount: Scalars['U16']['output'];\n /** Merkle root of transactions. */\n transactionsRoot: Scalars['Bytes32']['output'];\n /** Version of the header */\n version: GqlHeaderVersion;\n};\n\nexport enum GqlHeaderVersion {\n V1 = 'V1'\n}\n\nexport type GqlHeavyOperation = {\n base: Scalars['U64']['output'];\n gasPerUnit: Scalars['U64']['output'];\n};\n\nexport type GqlInput = GqlInputCoin | GqlInputContract | GqlInputMessage;\n\nexport type GqlInputCoin = {\n amount: Scalars['U64']['output'];\n assetId: Scalars['AssetId']['output'];\n owner: Scalars['Address']['output'];\n predicate: Scalars['HexString']['output'];\n predicateData: Scalars['HexString']['output'];\n predicateGasUsed: Scalars['U64']['output'];\n txPointer: Scalars['TxPointer']['output'];\n utxoId: Scalars['UtxoId']['output'];\n witnessIndex: Scalars['Int']['output'];\n};\n\nexport type GqlInputContract = {\n balanceRoot: Scalars['Bytes32']['output'];\n contractId: Scalars['ContractId']['output'];\n stateRoot: Scalars['Bytes32']['output'];\n txPointer: Scalars['TxPointer']['output'];\n utxoId: Scalars['UtxoId']['output'];\n};\n\nexport type GqlInputMessage = {\n amount: Scalars['U64']['output'];\n data: Scalars['HexString']['output'];\n nonce: Scalars['Nonce']['output'];\n predicate: Scalars['HexString']['output'];\n predicateData: Scalars['HexString']['output'];\n predicateGasUsed: Scalars['U64']['output'];\n recipient: Scalars['Address']['output'];\n sender: Scalars['Address']['output'];\n witnessIndex: Scalars['U16']['output'];\n};\n\nexport type GqlLatestGasPrice = {\n blockHeight: Scalars['U32']['output'];\n gasPrice: Scalars['U64']['output'];\n};\n\nexport type GqlLightOperation = {\n base: Scalars['U64']['output'];\n unitsPerGas: Scalars['U64']['output'];\n};\n\nexport type GqlMerkleProof = {\n proofIndex: Scalars['U64']['output'];\n proofSet: Array<Scalars['Bytes32']['output']>;\n};\n\nexport type GqlMessage = {\n amount: Scalars['U64']['output'];\n daHeight: Scalars['U64']['output'];\n data: Scalars['HexString']['output'];\n nonce: Scalars['Nonce']['output'];\n recipient: Scalars['Address']['output'];\n sender: Scalars['Address']['output'];\n};\n\nexport type GqlMessageCoin = {\n amount: Scalars['U64']['output'];\n assetId: Scalars['AssetId']['output'];\n daHeight: Scalars['U64']['output'];\n nonce: Scalars['Nonce']['output'];\n recipient: Scalars['Address']['output'];\n sender: Scalars['Address']['output'];\n};\n\nexport type GqlMessageConnection = {\n /** A list of edges. */\n edges: Array<GqlMessageEdge>;\n /** A list of nodes. */\n nodes: Array<GqlMessage>;\n /** Information to aid in pagination. */\n pageInfo: GqlPageInfo;\n};\n\n/** An edge in a connection. */\nexport type GqlMessageEdge = {\n /** A cursor for use in pagination */\n cursor: Scalars['String']['output'];\n /** The item at the end of the edge */\n node: GqlMessage;\n};\n\nexport type GqlMessageProof = {\n amount: Scalars['U64']['output'];\n blockProof: GqlMerkleProof;\n commitBlockHeader: GqlHeader;\n data: Scalars['HexString']['output'];\n messageBlockHeader: GqlHeader;\n messageProof: GqlMerkleProof;\n nonce: Scalars['Nonce']['output'];\n recipient: Scalars['Address']['output'];\n sender: Scalars['Address']['output'];\n};\n\nexport enum GqlMessageState {\n NotFound = 'NOT_FOUND',\n Spent = 'SPENT',\n Unspent = 'UNSPENT'\n}\n\nexport type GqlMessageStatus = {\n state: GqlMessageState;\n};\n\nexport type GqlMutation = {\n /**\n * Resume execution of the VM instance after a breakpoint.\n * Runs until the next breakpoint or until the transaction completes.\n */\n continueTx: GqlRunResult;\n /** Execute a dry-run of multiple transactions using a fork of current state, no changes are committed. */\n dryRun: Array<GqlDryRunTransactionExecutionStatus>;\n /** End debugger session. */\n endSession: Scalars['Boolean']['output'];\n /** Execute a single fuel-asm instruction. */\n execute: Scalars['Boolean']['output'];\n /**\n * Sequentially produces `blocks_to_produce` blocks. The first block starts with\n * `start_timestamp`. If the block production in the [`crate::service::Config`] is\n * `Trigger::Interval { block_time }`, produces blocks with `block_time ` intervals between\n * them. The `start_timestamp` is the timestamp in seconds.\n */\n produceBlocks: Scalars['U32']['output'];\n /** Reset the VM instance to the initial state. */\n reset: Scalars['Boolean']['output'];\n /** Set a breakpoint for a VM instance. */\n setBreakpoint: Scalars['Boolean']['output'];\n /** Set single-stepping mode for the VM instance. */\n setSingleStepping: Scalars['Boolean']['output'];\n /**\n * Initialize a new debugger session, returning its ID.\n * A new VM instance is spawned for each session.\n * The session is run in a separate database transaction,\n * on top of the most recent node state.\n */\n startSession: Scalars['ID']['output'];\n /**\n * Run a single transaction in given session until it\n * hits a breakpoint or completes.\n */\n startTx: GqlRunResult;\n /**\n * Submits transaction to the `TxPool`.\n *\n * Returns submitted transaction if the transaction is included in the `TxPool` without problems.\n */\n submit: GqlTransaction;\n};\n\n\nexport type GqlMutationContinueTxArgs = {\n id: Scalars['ID']['input'];\n};\n\n\nexport type GqlMutationDryRunArgs = {\n gasPrice?: InputMaybe<Scalars['U64']['input']>;\n txs: Array<Scalars['HexString']['input']>;\n utxoValidation?: InputMaybe<Scalars['Boolean']['input']>;\n};\n\n\nexport type GqlMutationEndSessionArgs = {\n id: Scalars['ID']['input'];\n};\n\n\nexport type GqlMutationExecuteArgs = {\n id: Scalars['ID']['input'];\n op: Scalars['String']['input'];\n};\n\n\nexport type GqlMutationProduceBlocksArgs = {\n blocksToProduce: Scalars['U32']['input'];\n startTimestamp?: InputMaybe<Scalars['Tai64Timestamp']['input']>;\n};\n\n\nexport type GqlMutationResetArgs = {\n id: Scalars['ID']['input'];\n};\n\n\nexport type GqlMutationSetBreakpointArgs = {\n breakpoint: GqlBreakpoint;\n id: Scalars['ID']['input'];\n};\n\n\nexport type GqlMutationSetSingleSteppingArgs = {\n enable: Scalars['Boolean']['input'];\n id: Scalars['ID']['input'];\n};\n\n\nexport type GqlMutationStartTxArgs = {\n id: Scalars['ID']['input'];\n txJson: Scalars['String']['input'];\n};\n\n\nexport type GqlMutationSubmitArgs = {\n tx: Scalars['HexString']['input'];\n};\n\nexport type GqlNodeInfo = {\n maxDepth: Scalars['U64']['output'];\n maxGas: Scalars['U64']['output'];\n maxSize: Scalars['U64']['output'];\n maxTx: Scalars['U64']['output'];\n nodeVersion: Scalars['String']['output'];\n peers: Array<GqlPeerInfo>;\n txPoolStats: GqlTxPoolStats;\n utxoValidation: Scalars['Boolean']['output'];\n vmBacktrace: Scalars['Boolean']['output'];\n};\n\nexport type GqlOutput = GqlChangeOutput | GqlCoinOutput | GqlContractCreated | GqlContractOutput | GqlVariableOutput;\n\n/**\n * A separate `Breakpoint` type to be used as an output, as a single\n * type cannot act as both input and output type in async-graphql\n */\nexport type GqlOutputBreakpoint = {\n contract: Scalars['ContractId']['output'];\n pc: Scalars['U64']['output'];\n};\n\n/** Information about pagination in a connection */\nexport type GqlPageInfo = {\n /** When paginating forwards, the cursor to continue. */\n endCursor?: Maybe<Scalars['String']['output']>;\n /** When paginating forwards, are there more items? */\n hasNextPage: Scalars['Boolean']['output'];\n /** When paginating backwards, are there more items? */\n hasPreviousPage: Scalars['Boolean']['output'];\n /** When paginating backwards, the cursor to continue. */\n startCursor?: Maybe<Scalars['String']['output']>;\n};\n\nexport type GqlPeerInfo = {\n /** The advertised multi-addrs that can be used to connect to this peer */\n addresses: Array<Scalars['String']['output']>;\n /** The internal fuel p2p reputation of this peer */\n appScore: Scalars['Float']['output'];\n /** The last reported height of the peer */\n blockHeight?: Maybe<Scalars['U32']['output']>;\n /** The self-reported version of the client the peer is using */\n clientVersion?: Maybe<Scalars['String']['output']>;\n /** The libp2p peer id */\n id: Scalars['String']['output'];\n /** The last heartbeat from this peer in unix epoch time ms */\n lastHeartbeatMs: Scalars['U64']['output'];\n};\n\nexport type GqlPoAConsensus = {\n /** Gets the signature of the block produced by `PoA` consensus. */\n signature: Scalars['Signature']['output'];\n};\n\nexport type GqlPolicies = {\n maturity?: Maybe<Scalars['U32']['output']>;\n maxFee?: Maybe<Scalars['U64']['output']>;\n tip?: Maybe<Scalars['U64']['output']>;\n witnessLimit?: Maybe<Scalars['U64']['output']>;\n};\n\nexport type GqlPredicateParameters = {\n maxGasPerPredicate: Scalars['U64']['output'];\n maxMessageDataLength: Scalars['U64']['output'];\n maxPredicateDataLength: Scalars['U64']['output'];\n maxPredicateLength: Scalars['U64']['output'];\n version: GqlPredicateParametersVersion;\n};\n\nexport enum GqlPredicateParametersVersion {\n V1 = 'V1'\n}\n\nexport type GqlProgramState = {\n data: Scalars['HexString']['output'];\n returnType: GqlReturnType;\n};\n\nexport type GqlQuery = {\n balance: GqlBalance;\n balances: GqlBalanceConnection;\n blob?: Maybe<GqlBlob>;\n block?: Maybe<GqlBlock>;\n blocks: GqlBlockConnection;\n chain: GqlChainInfo;\n /** Gets the coin by `utxo_id`. */\n coin?: Maybe<GqlCoin>;\n /** Gets all unspent coins of some `owner` maybe filtered with by `asset_id` per page. */\n coins: GqlCoinConnection;\n /**\n * For each `query_per_asset`, get some spendable coins(of asset specified by the query) owned by\n * `owner` that add up at least the query amount. The returned coins can be spent.\n * The number of coins is optimized to prevent dust accumulation.\n *\n * The query supports excluding and maximum the number of coins.\n *\n * Returns:\n * The list of spendable coins per asset from the query. The length of the result is\n * the same as the length of `query_per_asset`. The ordering of assets and `query_per_asset`\n * is the same.\n */\n coinsToSpend: Array<Array<GqlCoinType>>;\n consensusParameters: GqlConsensusParameters;\n contract?: Maybe<GqlContract>;\n contractBalance: GqlContractBalance;\n contractBalances: GqlContractBalanceConnection;\n daCompressedBlock?: Maybe<GqlDaCompressedBlock>;\n estimateGasPrice: GqlEstimateGasPrice;\n /** Estimate the predicate gas for the provided transaction */\n estimatePredicates: GqlTransaction;\n /** Returns true when the GraphQL API is serving requests. */\n health: Scalars['Boolean']['output'];\n latestGasPrice: GqlLatestGasPrice;\n /** Read read a range of memory bytes. */\n memory: Scalars['String']['output'];\n message?: Maybe<GqlMessage>;\n messageProof?: Maybe<GqlMessageProof>;\n messageStatus: GqlMessageStatus;\n messages: GqlMessageConnection;\n nodeInfo: GqlNodeInfo;\n /** Read register value by index. */\n register: Scalars['U64']['output'];\n relayedTransactionStatus?: Maybe<GqlRelayedTransactionStatus>;\n stateTransitionBytecodeByRoot: GqlStateTransitionBytecode;\n stateTransitionBytecodeByVersion?: Maybe<GqlStateTransitionBytecode>;\n transaction?: Maybe<GqlTransaction>;\n transactions: GqlTransactionConnection;\n transactionsByOwner: GqlTransactionConnection;\n};\n\n\nexport type GqlQueryBalanceArgs = {\n assetId: Scalars['AssetId']['input'];\n owner: Scalars['Address']['input'];\n};\n\n\nexport type GqlQueryBalancesArgs = {\n after?: InputMaybe<Scalars['String']['input']>;\n before?: InputMaybe<Scalars['String']['input']>;\n filter: GqlBalanceFilterInput;\n first?: InputMaybe<Scalars['Int']['input']>;\n last?: InputMaybe<Scalars['Int']['input']>;\n};\n\n\nexport type GqlQueryBlobArgs = {\n id: Scalars['BlobId']['input'];\n};\n\n\nexport type GqlQueryBlockArgs = {\n height?: InputMaybe<Scalars['U32']['input']>;\n id?: InputMaybe<Scalars['BlockId']['input']>;\n};\n\n\nexport type GqlQueryBlocksArgs = {\n after?: InputMaybe<Scalars['String']['input']>;\n before?: InputMaybe<Scalars['String']['input']>;\n first?: InputMaybe<Scalars['Int']['input']>;\n last?: InputMaybe<Scalars['Int']['input']>;\n};\n\n\nexport type GqlQueryCoinArgs = {\n utxoId: Scalars['UtxoId']['input'];\n};\n\n\nexport type GqlQueryCoinsArgs = {\n after?: InputMaybe<Scalars['String']['input']>;\n before?: InputMaybe<Scalars['String']['input']>;\n filter: GqlCoinFilterInput;\n first?: InputMaybe<Scalars['Int']['input']>;\n last?: InputMaybe<Scalars['Int']['input']>;\n};\n\n\nexport type GqlQueryCoinsToSpendArgs = {\n excludedIds?: InputMaybe<GqlExcludeInput>;\n owner: Scalars['Address']['input'];\n queryPerAsset: Array<GqlSpendQueryElementInput>;\n};\n\n\nexport type GqlQueryConsensusParametersArgs = {\n version: Scalars['Int']['input'];\n};\n\n\nexport type GqlQueryContractArgs = {\n id: Scalars['ContractId']['input'];\n};\n\n\nexport type GqlQueryContractBalanceArgs = {\n asset: Scalars['AssetId']['input'];\n contract: Scalars['ContractId']['input'];\n};\n\n\nexport type GqlQueryContractBalancesArgs = {\n after?: InputMaybe<Scalars['String']['input']>;\n before?: InputMaybe<Scalars['String']['input']>;\n filter: GqlContractBalanceFilterInput;\n first?: InputMaybe<Scalars['Int']['input']>;\n last?: InputMaybe<Scalars['Int']['input']>;\n};\n\n\nexport type GqlQueryDaCompressedBlockArgs = {\n height: Scalars['U32']['input'];\n};\n\n\nexport type GqlQueryEstimateGasPriceArgs = {\n blockHorizon?: InputMaybe<Scalars['U32']['input']>;\n};\n\n\nexport type GqlQueryEstimatePredicatesArgs = {\n tx: Scalars['HexString']['input'];\n};\n\n\nexport type GqlQueryMemoryArgs = {\n id: Scalars['ID']['input'];\n size: Scalars['U32']['input'];\n start: Scalars['U32']['input'];\n};\n\n\nexport type GqlQueryMessageArgs = {\n nonce: Scalars['Nonce']['input'];\n};\n\n\nexport type GqlQueryMessageProofArgs = {\n commitBlockHeight?: InputMaybe<Scalars['U32']['input']>;\n commitBlockId?: InputMaybe<Scalars['BlockId']['input']>;\n nonce: Scalars['Nonce']['input'];\n transactionId: Scalars['TransactionId']['input'];\n};\n\n\nexport type GqlQueryMessageStatusArgs = {\n nonce: Scalars['Nonce']['input'];\n};\n\n\nexport type GqlQueryMessagesArgs = {\n after?: InputMaybe<Scalars['String']['input']>;\n before?: InputMaybe<Scalars['String']['input']>;\n first?: InputMaybe<Scalars['Int']['input']>;\n last?: InputMaybe<Scalars['Int']['input']>;\n owner?: InputMaybe<Scalars['Address']['input']>;\n};\n\n\nexport type GqlQueryRegisterArgs = {\n id: Scalars['ID']['input'];\n register: Scalars['U32']['input'];\n};\n\n\nexport type GqlQueryRelayedTransactionStatusArgs = {\n id: Scalars['RelayedTransactionId']['input'];\n};\n\n\nexport type GqlQueryStateTransitionBytecodeByRootArgs = {\n root: Scalars['HexString']['input'];\n};\n\n\nexport type GqlQueryStateTransitionBytecodeByVersionArgs = {\n version: Scalars['Int']['input'];\n};\n\n\nexport type GqlQueryTransactionArgs = {\n id: Scalars['TransactionId']['input'];\n};\n\n\nexport type GqlQueryTransactionsArgs = {\n after?: InputMaybe<Scalars['String']['input']>;\n before?: InputMaybe<Scalars['String']['input']>;\n first?: InputMaybe<Scalars['Int']['input']>;\n last?: InputMaybe<Scalars['Int']['input']>;\n};\n\n\nexport type GqlQueryTransactionsByOwnerArgs = {\n after?: InputMaybe<Scalars['String']['input']>;\n before?: InputMaybe<Scalars['String']['input']>;\n first?: InputMaybe<Scalars['Int']['input']>;\n last?: InputMaybe<Scalars['Int']['input']>;\n owner: Scalars['Address']['input'];\n};\n\nexport type GqlReceipt = {\n amount?: Maybe<Scalars['U64']['output']>;\n assetId?: Maybe<Scalars['AssetId']['output']>;\n /** Set in the case of a Panic receipt to indicate a missing contract input id */\n contractId?: Maybe<Scalars['ContractId']['output']>;\n data?: Maybe<Scalars['HexString']['output']>;\n digest?: Maybe<Scalars['Bytes32']['output']>;\n gas?: Maybe<Scalars['U64']['output']>;\n gasUsed?: Maybe<Scalars['U64']['output']>;\n id?: Maybe<Scalars['ContractId']['output']>;\n is?: Maybe<Scalars['U64']['output']>;\n len?: Maybe<Scalars['U64']['output']>;\n nonce?: Maybe<Scalars['Nonce']['output']>;\n param1?: Maybe<Scalars['U64']['output']>;\n param2?: Maybe<Scalars['U64']['output']>;\n pc?: Maybe<Scalars['U64']['output']>;\n ptr?: Maybe<Scalars['U64']['output']>;\n ra?: Maybe<Scalars['U64']['output']>;\n rb?: Maybe<Scalars['U64']['output']>;\n rc?: Maybe<Scalars['U64']['output']>;\n rd?: Maybe<Scalars['U64']['output']>;\n reason?: Maybe<Scalars['U64']['output']>;\n receiptType: GqlReceiptType;\n recipient?: Maybe<Scalars['Address']['output']>;\n result?: Maybe<Scalars['U64']['output']>;\n sender?: Maybe<Scalars['Address']['output']>;\n subId?: Maybe<Scalars['Bytes32']['output']>;\n to?: Maybe<Scalars['ContractId']['output']>;\n toAddress?: Maybe<Scalars['Address']['output']>;\n val?: Maybe<Scalars['U64']['output']>;\n};\n\nexport enum GqlReceiptType {\n Burn = 'BURN',\n Call = 'CALL',\n Log = 'LOG',\n LogData = 'LOG_DATA',\n MessageOut = 'MESSAGE_OUT',\n Mint = 'MINT',\n Panic = 'PANIC',\n Return = 'RETURN',\n ReturnData = 'RETURN_DATA',\n Revert = 'REVERT',\n ScriptResult = 'SCRIPT_RESULT',\n Transfer = 'TRANSFER',\n TransferOut = 'TRANSFER_OUT'\n}\n\nexport type GqlRelayedTransactionFailed = {\n blockHeight: Scalars['U32']['output'];\n failure: Scalars['String']['output'];\n};\n\nexport type GqlRelayedTransactionStatus = GqlRelayedTransactionFailed;\n\nexport enum GqlReturnType {\n Return = 'RETURN',\n ReturnData = 'RETURN_DATA',\n Revert = 'REVERT'\n}\n\nexport type GqlRunResult = {\n breakpoint?: Maybe<GqlOutputBreakpoint>;\n jsonReceipts: Array<Scalars['String']['output']>;\n state: GqlRunState;\n};\n\nexport enum GqlRunState {\n /** Stopped on a breakpoint */\n Breakpoint = 'BREAKPOINT',\n /** All breakpoints have been processed, and the program has terminated */\n Completed = 'COMPLETED'\n}\n\nexport type GqlScriptParameters = {\n maxScriptDataLength: Scalars['U64']['output'];\n maxScriptLength: Scalars['U64']['output'];\n version: GqlScriptParametersVersion;\n};\n\nexport enum GqlScriptParametersVersion {\n V1 = 'V1'\n}\n\nexport type GqlSpendQueryElementInput = {\n /** Target amount for the query. */\n amount: Scalars['U64']['input'];\n /** Identifier of the asset to spend. */\n assetId: Scalars['AssetId']['input'];\n /** The maximum number of currencies for selection. */\n max?: InputMaybe<Scalars['U32']['input']>;\n};\n\nexport type GqlSqueezedOutStatus = {\n reason: Scalars['String']['output'];\n};\n\nexport type GqlStateTransitionBytecode = {\n bytecode: GqlUploadedBytecode;\n root: Scalars['HexString']['output'];\n};\n\nexport type GqlStateTransitionPurpose = {\n root: Scalars['Bytes32']['output'];\n};\n\nexport type GqlSubmittedStatus = {\n time: Scalars['Tai64Timestamp']['output'];\n};\n\nexport type GqlSubscription = {\n /**\n * Returns a stream of status updates for the given transaction id.\n * If the current status is [`TransactionStatus::Success`], [`TransactionStatus::SqueezedOut`]\n * or [`TransactionStatus::Failed`] the stream will return that and end immediately.\n * If the current status is [`TransactionStatus::Submitted`] this will be returned\n * and the stream will wait for a future update.\n *\n * This stream will wait forever so it's advised to use within a timeout.\n *\n * It is possible for the stream to miss an update if it is polled slower\n * then the updates arrive. In such a case the stream will close without\n * a status. If this occurs the stream can simply be restarted to return\n * the latest status.\n */\n statusChange: GqlTransactionStatus;\n /** Submits transaction to the `TxPool` and await either confirmation or failure. */\n submitAndAwait: GqlTransactionStatus;\n /**\n * Submits the transaction to the `TxPool` and returns a stream of events.\n * Compared to the `submitAndAwait`, the stream also contains `\n * SubmittedStatus` as an intermediate state.\n */\n submitAndAwaitStatus: GqlTransactionStatus;\n};\n\n\nexport type GqlSubscriptionStatusChangeArgs = {\n id: Scalars['TransactionId']['input'];\n};\n\n\nexport type GqlSubscriptionSubmitAndAwaitArgs = {\n tx: Scalars['HexString']['input'];\n};\n\n\nexport type GqlSubscriptionSubmitAndAwaitStatusArgs = {\n tx: Scalars['HexString']['input'];\n};\n\nexport type GqlSuccessStatus = {\n block: GqlBlock;\n blockHeight: Scalars['U32']['output'];\n programState?: Maybe<GqlProgramState>;\n receipts: Array<GqlReceipt>;\n time: Scalars['Tai64Timestamp']['output'];\n totalFee: Scalars['U64']['output'];\n totalGas: Scalars['U64']['output'];\n transaction: GqlTransaction;\n transactionId: Scalars['TransactionId']['output'];\n};\n\nexport type GqlTransaction = {\n blobId?: Maybe<Scalars['BlobId']['output']>;\n bytecodeRoot?: Maybe<Scalars['Bytes32']['output']>;\n bytecodeWitnessIndex?: Maybe<Scalars['U16']['output']>;\n id: Scalars['TransactionId']['output'];\n inputAssetIds?: Maybe<Array<Scalars['AssetId']['output']>>;\n inputContract?: Maybe<GqlInputContract>;\n inputContracts?: Maybe<Array<Scalars['ContractId']['output']>>;\n inputs?: Maybe<Array<GqlInput>>;\n isBlob: Scalars['Boolean']['output'];\n isCreate: Scalars['Boolean']['output'];\n isMint: Scalars['Boolean']['output'];\n isScript: Scalars['Boolean']['output'];\n isUpgrade: Scalars['Boolean']['output'];\n isUpload: Scalars['Boolean']['output'];\n maturity?: Maybe<Scalars['U32']['output']>;\n mintAmount?: Maybe<Scalars['U64']['output']>;\n mintAssetId?: Maybe<Scalars['AssetId']['output']>;\n mintGasPrice?: Maybe<Scalars['U64']['output']>;\n outputContract?: Maybe<GqlContractOutput>;\n outputs: Array<GqlOutput>;\n policies?: Maybe<GqlPolicies>;\n proofSet?: Maybe<Array<Scalars['Bytes32']['output']>>;\n /** Return the transaction bytes using canonical encoding */\n rawPayload: Scalars['HexString']['output'];\n receiptsRoot?: Maybe<Scalars['Bytes32']['output']>;\n salt?: Maybe<Scalars['Salt']['output']>;\n script?: Maybe<Scalars['HexString']['output']>;\n scriptData?: Maybe<Scalars['HexString']['output']>;\n scriptGasLimit?: Maybe<Scalars['U64']['output']>;\n status?: Maybe<GqlTransactionStatus>;\n storageSlots?: Maybe<Array<Scalars['HexString']['output']>>;\n subsectionIndex?: Maybe<Scalars['U16']['output']>;\n subsectionsNumber?: Maybe<Scalars['U16']['output']>;\n txPointer?: Maybe<Scalars['TxPointer']['output']>;\n upgradePurpose?: Maybe<GqlUpgradePurpose>;\n witnesses?: Maybe<Array<Scalars['HexString']['output']>>;\n};\n\nexport type GqlTransactionConnection = {\n /** A list of edges. */\n edges: Array<GqlTransactionEdge>;\n /** A list of nodes. */\n nodes: Array<GqlTransaction>;\n /** Information to aid in pagination. */\n pageInfo: GqlPageInfo;\n};\n\n/** An edge in a connection. */\nexport type GqlTransactionEdge = {\n /** A cursor for use in pagination */\n cursor: Scalars['String']['output'];\n /** The item at the end of the edge */\n node: GqlTransaction;\n};\n\nexport type GqlTransactionStatus = GqlFailureStatus | GqlSqueezedOutStatus | GqlSubmittedStatus | GqlSuccessStatus;\n\nexport type GqlTxParameters = {\n maxBytecodeSubsections: Scalars['U16']['output'];\n maxGasPerTx: Scalars['U64']['output'];\n maxInputs: Scalars['U16']['output'];\n maxOutputs: Scalars['U16']['output'];\n maxSize: Scalars['U64']['output'];\n maxWitnesses: Scalars['U32']['output'];\n version: GqlTxParametersVersion;\n};\n\nexport enum GqlTxParametersVersion {\n V1 = 'V1'\n}\n\nexport type GqlTxPoolStats = {\n /** The total gas of the transactions in the pool */\n totalGas: Scalars['U64']['output'];\n /** The total size of the transactions in the pool */\n totalSize: Scalars['U64']['output'];\n /** The number of transactions in the pool */\n txCount: Scalars['U64']['output'];\n};\n\nexport type GqlUpgradePurpose = GqlConsensusParametersPurpose | GqlStateTransitionPurpose;\n\nexport type GqlUploadedBytecode = {\n /** Combined bytecode of all uploaded subsections. */\n bytecode: Scalars['HexString']['output'];\n /** Indicates if the bytecode upload is complete. */\n completed: Scalars['Boolean']['output'];\n /** Number of uploaded subsections (if incomplete). */\n uploadedSubsectionsNumber?: Maybe<Scalars['Int']['output']>;\n};\n\nexport type GqlVariableOutput = {\n amount: Scalars['U64']['output'];\n assetId: Scalars['AssetId']['output'];\n to: Scalars['Address']['output'];\n};\n\nexport type GqlSubmittedStatusFragment = { time: string, type: 'SubmittedStatus' };\n\nexport type GqlSuccessStatusFragment = { time: string, totalGas: string, totalFee: string, type: 'SuccessStatus', programState?: { returnType: GqlReturnType, data: string } | null, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> };\n\nexport type GqlSuccessStatusWithBlockIdFragment = { time: string, totalGas: string, totalFee: string, type: 'SuccessStatus', block: { id: string }, programState?: { returnType: GqlReturnType, data: string } | null, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> };\n\nexport type GqlFailureStatusFragment = { totalGas: string, totalFee: string, time: string, reason: string, type: 'FailureStatus', receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> };\n\nexport type GqlFailureStatusWithBlockIdFragment = { totalGas: string, totalFee: string, time: string, reason: string, type: 'FailureStatus', block: { id: string }, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> };\n\nexport type GqlSqueezedOutStatusFragment = { reason: string, type: 'SqueezedOutStatus' };\n\ntype GqlTransactionStatusFragment_FailureStatus = { totalGas: string, totalFee: string, time: string, reason: string, type: 'FailureStatus', receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> };\n\ntype GqlTransactionStatusFragment_SqueezedOutStatus = { reason: string, type: 'SqueezedOutStatus' };\n\ntype GqlTransactionStatusFragment_SubmittedStatus = { time: string, type: 'SubmittedStatus' };\n\ntype GqlTransactionStatusFragment_SuccessStatus = { time: string, totalGas: string, totalFee: string, type: 'SuccessStatus', programState?: { returnType: GqlReturnType, data: string } | null, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> };\n\nexport type GqlTransactionStatusFragment = GqlTransactionStatusFragment_FailureStatus | GqlTransactionStatusFragment_SqueezedOutStatus | GqlTransactionStatusFragment_SubmittedStatus | GqlTransactionStatusFragment_SuccessStatus;\n\nexport type GqlMalleableTransactionFieldsFragment = { receiptsRoot?: string | null, inputs?: Array<{ txPointer: string, type: 'InputCoin' } | { txPointer: string, type: 'InputContract' } | { type: 'InputMessage' }> | null, outputs: Array<{ to: string, amount: string, assetId: string, type: 'ChangeOutput' } | { to: string, amount: string, assetId: string, type: 'CoinOutput' } | { contract: string, stateRoot: string, type: 'ContractCreated' } | { inputIndex: string, balanceRoot: string, stateRoot: string, type: 'ContractOutput' } | { to: string, amount: string, assetId: string, type: 'VariableOutput' }> };\n\ntype GqlTransactionStatusSubscriptionFragment_FailureStatus = { totalGas: string, totalFee: string, time: string, reason: string, type: 'FailureStatus', transaction: { receiptsRoot?: string | null, inputs?: Array<{ txPointer: string, type: 'InputCoin' } | { txPointer: string, type: 'InputContract' } | { type: 'InputMessage' }> | null, outputs: Array<{ to: string, amount: string, assetId: string, type: 'ChangeOutput' } | { to: string, amount: string, assetId: string, type: 'CoinOutput' } | { contract: string, stateRoot: string, type: 'ContractCreated' } | { inputIndex: string, balanceRoot: string, stateRoot: string, type: 'ContractOutput' } | { to: string, amount: string, assetId: string, type: 'VariableOutput' }> }, block: { id: string }, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> };\n\ntype GqlTransactionStatusSubscriptionFragment_SqueezedOutStatus = { reason: string, type: 'SqueezedOutStatus' };\n\ntype GqlTransactionStatusSubscriptionFragment_SubmittedStatus = { time: string, type: 'SubmittedStatus' };\n\ntype GqlTransactionStatusSubscriptionFragment_SuccessStatus = { time: string, totalGas: string, totalFee: string, type: 'SuccessStatus', transaction: { receiptsRoot?: string | null, inputs?: Array<{ txPointer: string, type: 'InputCoin' } | { txPointer: string, type: 'InputContract' } | { type: 'InputMessage' }> | null, outputs: Array<{ to: string, amount: string, assetId: string, type: 'ChangeOutput' } | { to: string, amount: string, assetId: string, type: 'CoinOutput' } | { contract: string, stateRoot: string, type: 'ContractCreated' } | { inputIndex: string, balanceRoot: string, stateRoot: string, type: 'ContractOutput' } | { to: string, amount: string, assetId: string, type: 'VariableOutput' }> }, block: { id: string }, programState?: { returnType: GqlReturnType, data: string } | null, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> };\n\nexport type GqlTransactionStatusSubscriptionFragment = GqlTransactionStatusSubscriptionFragment_FailureStatus | GqlTransactionStatusSubscriptionFragment_SqueezedOutStatus | GqlTransactionStatusSubscriptionFragment_SubmittedStatus | GqlTransactionStatusSubscriptionFragment_SuccessStatus;\n\nexport type GqlTransactionFragment = { id: string, rawPayload: string, status?: { totalGas: string, totalFee: string, time: string, reason: string, type: 'FailureStatus', receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> } | { reason: string, type: 'SqueezedOutStatus' } | { time: string, type: 'SubmittedStatus' } | { time: string, totalGas: string, totalFee: string, type: 'SuccessStatus', programState?: { returnType: GqlReturnType, data: string } | null, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> } | null };\n\nexport type GqlTransactionRawPayloadFragment = { id: string, rawPayload: string };\n\ntype GqlInputEstimatePredicatesFragment_InputCoin = { predicateGasUsed: string };\n\ntype GqlInputEstimatePredicatesFragment_InputContract = {};\n\ntype GqlInputEstimatePredicatesFragment_InputMessage = { predicateGasUsed: string };\n\nexport type GqlInputEstimatePredicatesFragment = GqlInputEstimatePredicatesFragment_InputCoin | GqlInputEstimatePredicatesFragment_InputContract | GqlInputEstimatePredicatesFragment_InputMessage;\n\nexport type GqlTransactionEstimatePredicatesFragment = { inputs?: Array<{ predicateGasUsed: string } | { predicateGasUsed: string } | {}> | null };\n\nexport type GqlDryRunFailureStatusFragment = { totalGas: string, totalFee: string, reason: string, type: 'DryRunFailureStatus', programState?: { returnType: GqlReturnType, data: string } | null };\n\nexport type GqlDryRunSuccessStatusFragment = { totalGas: string, totalFee: string, type: 'DryRunSuccessStatus', programState?: { returnType: GqlReturnType, data: string } | null };\n\nexport type GqlReceiptFragment = { id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null };\n\ntype GqlDryRunTransactionStatusFragment_DryRunFailureStatus = { totalGas: string, totalFee: string, reason: string, type: 'DryRunFailureStatus', programState?: { returnType: GqlReturnType, data: string } | null };\n\ntype GqlDryRunTransactionStatusFragment_DryRunSuccessStatus = { totalGas: string, totalFee: string, type: 'DryRunSuccessStatus', programState?: { returnType: GqlReturnType, data: string } | null };\n\nexport type GqlDryRunTransactionStatusFragment = GqlDryRunTransactionStatusFragment_DryRunFailureStatus | GqlDryRunTransactionStatusFragment_DryRunSuccessStatus;\n\nexport type GqlDryRunTransactionExecutionStatusFragment = { id: string, status: { totalGas: string, totalFee: string, reason: string, type: 'DryRunFailureStatus', programState?: { returnType: GqlReturnType, data: string } | null } | { totalGas: string, totalFee: string, type: 'DryRunSuccessStatus', programState?: { returnType: GqlReturnType, data: string } | null }, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> };\n\nexport type GqlBlockFragment = { id: string, height: string, header: { time: string, daHeight: string, stateTransitionBytecodeVersion: string, transactionsCount: string, transactionsRoot: string, messageOutboxRoot: string, eventInboxRoot: string, prevRoot: string, applicationHash: string }, transactions: Array<{ id: string }> };\n\nexport type GqlCoinFragment = { utxoId: string, amount: string, assetId: string, blockCreated: string, txCreatedIdx: string, type: 'Coin' };\n\nexport type GqlMessageCoinFragment = { sender: string, recipient: string, nonce: string, amount: string, assetId: string, daHeight: string, type: 'MessageCoin' };\n\nexport type GqlMessageFragment = { amount: string, sender: string, recipient: string, data: string, daHeight: string };\n\nexport type GqlGetMessageFragment = { nonce: string, amount: string, sender: string, recipient: string, data: string, daHeight: string };\n\nexport type GqlMessageProofFragment = { sender: string, recipient: string, amount: string, data: string, messageProof: { proofSet: Array<string>, proofIndex: string }, blockProof: { proofSet: Array<string>, proofIndex: string }, messageBlockHeader: { version: GqlHeaderVersion, id: string, daHeight: string, consensusParametersVersion: string, stateTransitionBytecodeVersion: string, transactionsCount: string, messageReceiptCount: string, transactionsRoot: string, messageOutboxRoot: string, eventInboxRoot: string, height: string, prevRoot: string, time: string, applicationHash: string }, commitBlockHeader: { version: GqlHeaderVersion, id: string, daHeight: string, consensusParametersVersion: string, stateTransitionBytecodeVersion: string, transactionsCount: string, messageReceiptCount: string, transactionsRoot: string, messageOutboxRoot: string, eventInboxRoot: string, height: string, prevRoot: string, time: string, applicationHash: string } };\n\nexport type GqlTxParametersFragment = { version: GqlTxParametersVersion, maxInputs: string, maxOutputs: string, maxWitnesses: string, maxGasPerTx: string, maxSize: string, maxBytecodeSubsections: string };\n\nexport type GqlPredicateParametersFragment = { version: GqlPredicateParametersVersion, maxPredicateLength: string, maxPredicateDataLength: string, maxGasPerPredicate: string, maxMessageDataLength: string };\n\nexport type GqlScriptParametersFragment = { version: GqlScriptParametersVersion, maxScriptLength: string, maxScriptDataLength: string };\n\nexport type GqlContractParametersFragment = { version: GqlContractParametersVersion, contractMaxSize: string, maxStorageSlots: string };\n\nexport type GqlFeeParametersFragment = { version: GqlFeeParametersVersion, gasPriceFactor: string, gasPerByte: string };\n\ntype GqlDependentCostFragment_HeavyOperation = { base: string, gasPerUnit: string, type: 'HeavyOperation' };\n\ntype GqlDependentCostFragment_LightOperation = { base: string, unitsPerGas: string, type: 'LightOperation' };\n\nexport type GqlDependentCostFragment = GqlDependentCostFragment_HeavyOperation | GqlDependentCostFragment_LightOperation;\n\nexport type GqlGasCostsFragment = { ecr1: string, newStoragePerByte: string, contractRoot: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' }, stateRoot: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' }, vmInitialization: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' }, s256: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' } };\n\nexport type GqlConsensusParametersFragment = { version: GqlConsensusParametersVersion, baseAssetId: string, chainId: string, txParams: { version: GqlTxParametersVersion, maxInputs: string, maxOutputs: string, maxWitnesses: string, maxGasPerTx: string, maxSize: string, maxBytecodeSubsections: string }, predicateParams: { version: GqlPredicateParametersVersion, maxPredicateLength: string, maxPredicateDataLength: string, maxGasPerPredicate: string, maxMessageDataLength: string }, scriptParams: { version: GqlScriptParametersVersion, maxScriptLength: string, maxScriptDataLength: string }, contractParams: { version: GqlContractParametersVersion, contractMaxSize: string, maxStorageSlots: string }, feeParams: { version: GqlFeeParametersVersion, gasPriceFactor: string, gasPerByte: string }, gasCosts: { ecr1: string, newStoragePerByte: string, contractRoot: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' }, stateRoot: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' }, vmInitialization: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' }, s256: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' } } };\n\nexport type GqlChainInfoFragment = { name: string, daHeight: string, consensusParameters: { version: GqlConsensusParametersVersion, baseAssetId: string, chainId: string, txParams: { version: GqlTxParametersVersion, maxInputs: string, maxOutputs: string, maxWitnesses: string, maxGasPerTx: string, maxSize: string, maxBytecodeSubsections: string }, predicateParams: { version: GqlPredicateParametersVersion, maxPredicateLength: string, maxPredicateDataLength: string, maxGasPerPredicate: string, maxMessageDataLength: string }, scriptParams: { version: GqlScriptParametersVersion, maxScriptLength: string, maxScriptDataLength: string }, contractParams: { version: GqlContractParametersVersion, contractMaxSize: string, maxStorageSlots: string }, feeParams: { version: GqlFeeParametersVersion, gasPriceFactor: string, gasPerByte: string }, gasCosts: { ecr1: string, newStoragePerByte: string, contractRoot: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' }, stateRoot: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' }, vmInitialization: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' }, s256: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' } } } };\n\nexport type GqlContractBalanceFragment = { contract: string, amount: string, assetId: string };\n\nexport type GqlPageInfoFragment = { hasPreviousPage: boolean, hasNextPage: boolean, startCursor?: string | null, endCursor?: string | null };\n\nexport type GqlGetVersionQueryVariables = Exact<{ [key: string]: never; }>;\n\n\nexport type GqlGetVersionQuery = { nodeInfo: { nodeVersion: string } };\n\nexport type GqlNodeInfoFragment = { utxoValidation: boolean, vmBacktrace: boolean, maxTx: string, maxDepth: string, nodeVersion: string };\n\nexport type GqlRelayedTransactionStatusFragment = { blockHeight: string, failure: string };\n\nexport type GqlGetNodeInfoQueryVariables = Exact<{ [key: string]: never; }>;\n\n\nexport type GqlGetNodeInfoQuery = { nodeInfo: { utxoValidation: boolean, vmBacktrace: boolean, maxTx: string, maxDepth: string, nodeVersion: string } };\n\nexport type GqlGetChainQueryVariables = Exact<{ [key: string]: never; }>;\n\n\nexport type GqlGetChainQuery = { chain: { name: string, daHeight: string, consensusParameters: { version: GqlConsensusParametersVersion, baseAssetId: string, chainId: string, txParams: { version: GqlTxParametersVersion, maxInputs: string, maxOutputs: string, maxWitnesses: string, maxGasPerTx: string, maxSize: string, maxBytecodeSubsections: string }, predicateParams: { version: GqlPredicateParametersVersion, maxPredicateLength: string, maxPredicateDataLength: string, maxGasPerPredicate: string, maxMessageDataLength: string }, scriptParams: { version: GqlScriptParametersVersion, maxScriptLength: string, maxScriptDataLength: string }, contractParams: { version: GqlContractParametersVersion, contractMaxSize: string, maxStorageSlots: string }, feeParams: { version: GqlFeeParametersVersion, gasPriceFactor: string, gasPerByte: string }, gasCosts: { ecr1: string, newStoragePerByte: string, contractRoot: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' }, stateRoot: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' }, vmInitialization: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' }, s256: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' } } } } };\n\nexport type GqlGetChainAndNodeInfoQueryVariables = Exact<{ [key: string]: never; }>;\n\n\nexport type GqlGetChainAndNodeInfoQuery = { chain: { name: string, daHeight: string, consensusParameters: { version: GqlConsensusParametersVersion, baseAssetId: string, chainId: string, txParams: { version: GqlTxParametersVersion, maxInputs: string, maxOutputs: string, maxWitnesses: string, maxGasPerTx: string, maxSize: string, maxBytecodeSubsections: string }, predicateParams: { version: GqlPredicateParametersVersion, maxPredicateLength: string, maxPredicateDataLength: string, maxGasPerPredicate: string, maxMessageDataLength: string }, scriptParams: { version: GqlScriptParametersVersion, maxScriptLength: string, maxScriptDataLength: string }, contractParams: { version: GqlContractParametersVersion, contractMaxSize: string, maxStorageSlots: string }, feeParams: { version: GqlFeeParametersVersion, gasPriceFactor: string, gasPerByte: string }, gasCosts: { ecr1: string, newStoragePerByte: string, contractRoot: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' }, stateRoot: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' }, vmInitialization: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' }, s256: { base: string, gasPerUnit: string, type: 'HeavyOperation' } | { base: string, unitsPerGas: string, type: 'LightOperation' } } } }, nodeInfo: { utxoValidation: boolean, vmBacktrace: boolean, maxTx: string, maxDepth: string, nodeVersion: string } };\n\nexport type GqlGetTransactionQueryVariables = Exact<{\n transactionId: Scalars['TransactionId']['input'];\n}>;\n\n\nexport type GqlGetTransactionQuery = { transaction?: { id: string, rawPayload: string, status?: { totalGas: string, totalFee: string, time: string, reason: string, type: 'FailureStatus', receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> } | { reason: string, type: 'SqueezedOutStatus' } | { time: string, type: 'SubmittedStatus' } | { time: string, totalGas: string, totalFee: string, type: 'SuccessStatus', programState?: { returnType: GqlReturnType, data: string } | null, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> } | null } | null };\n\nexport type GqlGetTransactionWithReceiptsQueryVariables = Exact<{\n transactionId: Scalars['TransactionId']['input'];\n}>;\n\n\nexport type GqlGetTransactionWithReceiptsQuery = { transaction?: { id: string, rawPayload: string, status?: { totalGas: string, totalFee: string, time: string, reason: string, type: 'FailureStatus', block: { id: string }, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> } | { reason: string, type: 'SqueezedOutStatus' } | { time: string, type: 'SubmittedStatus' } | { time: string, totalGas: string, totalFee: string, type: 'SuccessStatus', block: { id: string }, programState?: { returnType: GqlReturnType, data: string } | null, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> } | null } | null };\n\nexport type GqlGetTransactionsQueryVariables = Exact<{\n after?: InputMaybe<Scalars['String']['input']>;\n before?: InputMaybe<Scalars['String']['input']>;\n first?: InputMaybe<Scalars['Int']['input']>;\n last?: InputMaybe<Scalars['Int']['input']>;\n}>;\n\n\nexport type GqlGetTransactionsQuery = { transactions: { edges: Array<{ node: { rawPayload: string } }>, pageInfo: { hasPreviousPage: boolean, hasNextPage: boolean, startCursor?: string | null, endCursor?: string | null } } };\n\nexport type GqlGetTransactionsByOwnerQueryVariables = Exact<{\n owner: Scalars['Address']['input'];\n after?: InputMaybe<Scalars['String']['input']>;\n before?: InputMaybe<Scalars['String']['input']>;\n first?: InputMaybe<Scalars['Int']['input']>;\n last?: InputMaybe<Scalars['Int']['input']>;\n}>;\n\n\nexport type GqlGetTransactionsByOwnerQuery = { transactionsByOwner: { pageInfo: { hasPreviousPage: boolean, hasNextPage: boolean, startCursor?: string | null, endCursor?: string | null }, edges: Array<{ node: { id: string, rawPayload: string, status?: { totalGas: string, totalFee: string, time: string, reason: string, type: 'FailureStatus', receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> } | { reason: string, type: 'SqueezedOutStatus' } | { time: string, type: 'SubmittedStatus' } | { time: string, totalGas: string, totalFee: string, type: 'SuccessStatus', programState?: { returnType: GqlReturnType, data: string } | null, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> } | null } }> } };\n\nexport type GqlEstimatePredicatesQueryVariables = Exact<{\n encodedTransaction: Scalars['HexString']['input'];\n}>;\n\n\nexport type GqlEstimatePredicatesQuery = { estimatePredicates: { inputs?: Array<{ predicateGasUsed: string } | { predicateGasUsed: string } | {}> | null } };\n\nexport type GqlGetLatestBlockQueryVariables = Exact<{ [key: string]: never; }>;\n\n\nexport type GqlGetLatestBlockQuery = { chain: { latestBlock: { id: string, height: string, header: { time: string, daHeight: string, stateTransitionBytecodeVersion: string, transactionsCount: string, transactionsRoot: string, messageOutboxRoot: string, eventInboxRoot: string, prevRoot: string, applicationHash: string }, transactions: Array<{ id: string }> } } };\n\nexport type GqlGetLatestBlockHeightQueryVariables = Exact<{ [key: string]: never; }>;\n\n\nexport type GqlGetLatestBlockHeightQuery = { chain: { latestBlock: { height: string } } };\n\nexport type GqlGetBlockQueryVariables = Exact<{\n blockId?: InputMaybe<Scalars['BlockId']['input']>;\n height?: InputMaybe<Scalars['U32']['input']>;\n}>;\n\n\nexport type GqlGetBlockQuery = { block?: { id: string, height: string, header: { time: string, daHeight: string, stateTransitionBytecodeVersion: string, transactionsCount: string, transactionsRoot: string, messageOutboxRoot: string, eventInboxRoot: string, prevRoot: string, applicationHash: string }, transactions: Array<{ id: string }> } | null };\n\nexport type GqlGetBlockWithTransactionsQueryVariables = Exact<{\n blockId?: InputMaybe<Scalars['BlockId']['input']>;\n blockHeight?: InputMaybe<Scalars['U32']['input']>;\n}>;\n\n\nexport type GqlGetBlockWithTransactionsQuery = { block?: { id: string, height: string, transactions: Array<{ id: string, rawPayload: string }>, header: { time: string, daHeight: string, stateTransitionBytecodeVersion: string, transactionsCount: string, transactionsRoot: string, messageOutboxRoot: string, eventInboxRoot: string, prevRoot: string, applicationHash: string } } | null };\n\nexport type GqlGetBlocksQueryVariables = Exact<{\n after?: InputMaybe<Scalars['String']['input']>;\n before?: InputMaybe<Scalars['String']['input']>;\n first?: InputMaybe<Scalars['Int']['input']>;\n last?: InputMaybe<Scalars['Int']['input']>;\n}>;\n\n\nexport type GqlGetBlocksQuery = { blocks: { pageInfo: { hasPreviousPage: boolean, hasNextPage: boolean, startCursor?: string | null, endCursor?: string | null }, edges: Array<{ node: { id: string, height: string, header: { time: string, daHeight: string, stateTransitionBytecodeVersion: string, transactionsCount: string, transactionsRoot: string, messageOutboxRoot: string, eventInboxRoot: string, prevRoot: string, applicationHash: string }, transactions: Array<{ id: string }> } }> } };\n\nexport type GqlGetCoinQueryVariables = Exact<{\n coinId: Scalars['UtxoId']['input'];\n}>;\n\n\nexport type GqlGetCoinQuery = { coin?: { owner: string, utxoId: string, amount: string, assetId: string, blockCreated: string, txCreatedIdx: string, type: 'Coin' } | null };\n\nexport type GqlGetCoinsQueryVariables = Exact<{\n filter: GqlCoinFilterInput;\n after?: InputMaybe<Scalars['String']['input']>;\n before?: InputMaybe<Scalars['String']['input']>;\n first?: InputMaybe<Scalars['Int']['input']>;\n last?: InputMaybe<Scalars['Int']['input']>;\n}>;\n\n\nexport type GqlGetCoinsQuery = { coins: { pageInfo: { hasPreviousPage: boolean, hasNextPage: boolean, startCursor?: string | null, endCursor?: string | null }, edges: Array<{ node: { utxoId: string, amount: string, assetId: string, blockCreated: string, txCreatedIdx: string, type: 'Coin' } }> } };\n\nexport type GqlGetCoinsToSpendQueryVariables = Exact<{\n owner: Scalars['Address']['input'];\n queryPerAsset: Array<GqlSpendQueryElementInput> | GqlSpendQueryElementInput;\n excludedIds?: InputMaybe<GqlExcludeInput>;\n}>;\n\n\nexport type GqlGetCoinsToSpendQuery = { coinsToSpend: Array<Array<{ utxoId: string, amount: string, assetId: string, blockCreated: string, txCreatedIdx: string, type: 'Coin' } | { sender: string, recipient: string, nonce: string, amount: string, assetId: string, daHeight: string, type: 'MessageCoin' }>> };\n\nexport type GqlGetContractQueryVariables = Exact<{\n contractId: Scalars['ContractId']['input'];\n}>;\n\n\nexport type GqlGetContractQuery = { contract?: { bytecode: string, id: string } | null };\n\nexport type GqlGetContractBalanceQueryVariables = Exact<{\n contract: Scalars['ContractId']['input'];\n asset: Scalars['AssetId']['input'];\n}>;\n\n\nexport type GqlGetContractBalanceQuery = { contractBalance: { contract: string, amount: string, assetId: string } };\n\nexport type GqlGetBalanceQueryVariables = Exact<{\n owner: Scalars['Address']['input'];\n assetId: Scalars['AssetId']['input'];\n}>;\n\n\nexport type GqlGetBalanceQuery = { balance: { amount: string } };\n\nexport type GqlGetLatestGasPriceQueryVariables = Exact<{ [key: string]: never; }>;\n\n\nexport type GqlGetLatestGasPriceQuery = { latestGasPrice: { gasPrice: string } };\n\nexport type GqlEstimateGasPriceQueryVariables = Exact<{\n blockHorizon: Scalars['U32']['input'];\n}>;\n\n\nexport type GqlEstimateGasPriceQuery = { estimateGasPrice: { gasPrice: string } };\n\nexport type GqlGetBalancesQueryVariables = Exact<{\n filter: GqlBalanceFilterInput;\n after?: InputMaybe<Scalars['String']['input']>;\n before?: InputMaybe<Scalars['String']['input']>;\n first?: InputMaybe<Scalars['Int']['input']>;\n last?: InputMaybe<Scalars['Int']['input']>;\n}>;\n\n\nexport type GqlGetBalancesQuery = { balances: { edges: Array<{ node: { assetId: string, amount: string } }> } };\n\nexport type GqlGetMessagesQueryVariables = Exact<{\n owner: Scalars['Address']['input'];\n after?: InputMaybe<Scalars['String']['input']>;\n before?: InputMaybe<Scalars['String']['input']>;\n first?: InputMaybe<Scalars['Int']['input']>;\n last?: InputMaybe<Scalars['Int']['input']>;\n}>;\n\n\nexport type GqlGetMessagesQuery = { messages: { pageInfo: { hasPreviousPage: boolean, hasNextPage: boolean, startCursor?: string | null, endCursor?: string | null }, edges: Array<{ node: { nonce: string, amount: string, sender: string, recipient: string, data: string, daHeight: string } }> } };\n\nexport type GqlDaCompressedBlockQueryVariables = Exact<{\n height: Scalars['U32']['input'];\n}>;\n\n\nexport type GqlDaCompressedBlockQuery = { daCompressedBlock?: { bytes: string } | null };\n\nexport type GqlGetMessageProofQueryVariables = Exact<{\n transactionId: Scalars['TransactionId']['input'];\n nonce: Scalars['Nonce']['input'];\n commitBlockId?: InputMaybe<Scalars['BlockId']['input']>;\n commitBlockHeight?: InputMaybe<Scalars['U32']['input']>;\n}>;\n\n\nexport type GqlGetMessageProofQuery = { messageProof?: { sender: string, recipient: string, amount: string, data: string, messageProof: { proofSet: Array<string>, proofIndex: string }, blockProof: { proofSet: Array<string>, proofIndex: string }, messageBlockHeader: { version: GqlHeaderVersion, id: string, daHeight: string, consensusParametersVersion: string, stateTransitionBytecodeVersion: string, transactionsCount: string, messageReceiptCount: string, transactionsRoot: string, messageOutboxRoot: string, eventInboxRoot: string, height: string, prevRoot: string, time: string, applicationHash: string }, commitBlockHeader: { version: GqlHeaderVersion, id: string, daHeight: string, consensusParametersVersion: string, stateTransitionBytecodeVersion: string, transactionsCount: string, messageReceiptCount: string, transactionsRoot: string, messageOutboxRoot: string, eventInboxRoot: string, height: string, prevRoot: string, time: string, applicationHash: string } } | null };\n\nexport type GqlGetMessageStatusQueryVariables = Exact<{\n nonce: Scalars['Nonce']['input'];\n}>;\n\n\nexport type GqlGetMessageStatusQuery = { messageStatus: { state: GqlMessageState } };\n\nexport type GqlGetRelayedTransactionStatusQueryVariables = Exact<{\n relayedTransactionId: Scalars['RelayedTransactionId']['input'];\n}>;\n\n\nexport type GqlGetRelayedTransactionStatusQuery = { relayedTransactionStatus?: { blockHeight: string, failure: string } | null };\n\nexport type GqlDryRunMutationVariables = Exact<{\n encodedTransactions: Array<Scalars['HexString']['input']> | Scalars['HexString']['input'];\n utxoValidation?: InputMaybe<Scalars['Boolean']['input']>;\n gasPrice?: InputMaybe<Scalars['U64']['input']>;\n}>;\n\n\nexport type GqlDryRunMutation = { dryRun: Array<{ id: string, status: { totalGas: string, totalFee: string, reason: string, type: 'DryRunFailureStatus', programState?: { returnType: GqlReturnType, data: string } | null } | { totalGas: string, totalFee: string, type: 'DryRunSuccessStatus', programState?: { returnType: GqlReturnType, data: string } | null }, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> }> };\n\nexport type GqlSubmitMutationVariables = Exact<{\n encodedTransaction: Scalars['HexString']['input'];\n}>;\n\n\nexport type GqlSubmitMutation = { submit: { id: string } };\n\nexport type GqlProduceBlocksMutationVariables = Exact<{\n startTimestamp?: InputMaybe<Scalars['Tai64Timestamp']['input']>;\n blocksToProduce: Scalars['U32']['input'];\n}>;\n\n\nexport type GqlProduceBlocksMutation = { produceBlocks: string };\n\nexport type GqlGetMessageByNonceQueryVariables = Exact<{\n nonce: Scalars['Nonce']['input'];\n}>;\n\n\nexport type GqlGetMessageByNonceQuery = { message?: { amount: string, sender: string, recipient: string, data: string, daHeight: string } | null };\n\nexport type GqlIsUserAccountQueryVariables = Exact<{\n blobId: Scalars['BlobId']['input'];\n contractId: Scalars['ContractId']['input'];\n transactionId: Scalars['TransactionId']['input'];\n}>;\n\n\nexport type GqlIsUserAccountQuery = { blob?: { id: any } | null, contract?: { id: string } | null, transaction?: { id: string } | null };\n\nexport type GqlGetConsensusParametersVersionQueryVariables = Exact<{ [key: string]: never; }>;\n\n\nexport type GqlGetConsensusParametersVersionQuery = { chain: { latestBlock: { header: { consensusParametersVersion: string } } } };\n\nexport type GqlSubmitAndAwaitStatusSubscriptionVariables = Exact<{\n encodedTransaction: Scalars['HexString']['input'];\n}>;\n\n\nexport type GqlSubmitAndAwaitStatusSubscription = { submitAndAwaitStatus: { totalGas: string, totalFee: string, time: string, reason: string, type: 'FailureStatus', transaction: { receiptsRoot?: string | null, inputs?: Array<{ txPointer: string, type: 'InputCoin' } | { txPointer: string, type: 'InputContract' } | { type: 'InputMessage' }> | null, outputs: Array<{ to: string, amount: string, assetId: string, type: 'ChangeOutput' } | { to: string, amount: string, assetId: string, type: 'CoinOutput' } | { contract: string, stateRoot: string, type: 'ContractCreated' } | { inputIndex: string, balanceRoot: string, stateRoot: string, type: 'ContractOutput' } | { to: string, amount: string, assetId: string, type: 'VariableOutput' }> }, block: { id: string }, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> } | { reason: string, type: 'SqueezedOutStatus' } | { time: string, type: 'SubmittedStatus' } | { time: string, totalGas: string, totalFee: string, type: 'SuccessStatus', transaction: { receiptsRoot?: string | null, inputs?: Array<{ txPointer: string, type: 'InputCoin' } | { txPointer: string, type: 'InputContract' } | { type: 'InputMessage' }> | null, outputs: Array<{ to: string, amount: string, assetId: string, type: 'ChangeOutput' } | { to: string, amount: string, assetId: string, type: 'CoinOutput' } | { contract: string, stateRoot: string, type: 'ContractCreated' } | { inputIndex: string, balanceRoot: string, stateRoot: string, type: 'ContractOutput' } | { to: string, amount: string, assetId: string, type: 'VariableOutput' }> }, block: { id: string }, programState?: { returnType: GqlReturnType, data: string } | null, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> } };\n\nexport type GqlStatusChangeSubscriptionVariables = Exact<{\n transactionId: Scalars['TransactionId']['input'];\n}>;\n\n\nexport type GqlStatusChangeSubscription = { statusChange: { totalGas: string, totalFee: string, time: string, reason: string, type: 'FailureStatus', transaction: { receiptsRoot?: string | null, inputs?: Array<{ txPointer: string, type: 'InputCoin' } | { txPointer: string, type: 'InputContract' } | { type: 'InputMessage' }> | null, outputs: Array<{ to: string, amount: string, assetId: string, type: 'ChangeOutput' } | { to: string, amount: string, assetId: string, type: 'CoinOutput' } | { contract: string, stateRoot: string, type: 'ContractCreated' } | { inputIndex: string, balanceRoot: string, stateRoot: string, type: 'ContractOutput' } | { to: string, amount: string, assetId: string, type: 'VariableOutput' }> }, block: { id: string }, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> } | { reason: string, type: 'SqueezedOutStatus' } | { time: string, type: 'SubmittedStatus' } | { time: string, totalGas: string, totalFee: string, type: 'SuccessStatus', transaction: { receiptsRoot?: string | null, inputs?: Array<{ txPointer: string, type: 'InputCoin' } | { txPointer: string, type: 'InputContract' } | { type: 'InputMessage' }> | null, outputs: Array<{ to: string, amount: string, assetId: string, type: 'ChangeOutput' } | { to: string, amount: string, assetId: string, type: 'CoinOutput' } | { contract: string, stateRoot: string, type: 'ContractCreated' } | { inputIndex: string, balanceRoot: string, stateRoot: string, type: 'ContractOutput' } | { to: string, amount: string, assetId: string, type: 'VariableOutput' }> }, block: { id: string }, programState?: { returnType: GqlReturnType, data: string } | null, receipts: Array<{ id?: string | null, pc?: string | null, is?: string | null, to?: string | null, toAddress?: string | null, amount?: string | null, assetId?: string | null, gas?: string | null, param1?: string | null, param2?: string | null, val?: string | null, ptr?: string | null, digest?: string | null, reason?: string | null, ra?: string | null, rb?: string | null, rc?: string | null, rd?: string | null, len?: string | null, receiptType: GqlReceiptType, result?: string | null, gasUsed?: string | null, data?: string | null, sender?: string | null, recipient?: string | null, nonce?: string | null, contractId?: string | null, subId?: string | null }> } };\n\nexport const SubmittedStatusFragmentDoc = gql`\n fragment SubmittedStatusFragment on SubmittedStatus {\n type: __typename\n time\n}\n `;\nexport const ReceiptFragmentDoc = gql`\n fragment receiptFragment on Receipt {\n id\n pc\n is\n to\n toAddress\n amount\n assetId\n gas\n param1\n param2\n val\n ptr\n digest\n reason\n ra\n rb\n rc\n rd\n len\n receiptType\n result\n gasUsed\n data\n sender\n recipient\n nonce\n contractId\n subId\n}\n `;\nexport const SuccessStatusFragmentDoc = gql`\n fragment SuccessStatusFragment on SuccessStatus {\n type: __typename\n time\n programState {\n returnType\n data\n }\n receipts {\n ...receiptFragment\n }\n totalGas\n totalFee\n}\n ${ReceiptFragmentDoc}`;\nexport const SuccessStatusWithBlockIdFragmentDoc = gql`\n fragment SuccessStatusWithBlockIdFragment on SuccessStatus {\n ...SuccessStatusFragment\n block {\n id\n }\n}\n ${SuccessStatusFragmentDoc}`;\nexport const MalleableTransactionFieldsFragmentDoc = gql`\n fragment malleableTransactionFieldsFragment on Transaction {\n receiptsRoot\n inputs {\n type: __typename\n ... on InputCoin {\n txPointer\n }\n ... on InputContract {\n txPointer\n }\n }\n outputs {\n type: __typename\n ... on CoinOutput {\n to\n amount\n assetId\n }\n ... on ContractOutput {\n inputIndex\n balanceRoot\n stateRoot\n }\n ... on ChangeOutput {\n to\n amount\n assetId\n }\n ... on VariableOutput {\n to\n amount\n assetId\n }\n ... on ContractCreated {\n contract\n stateRoot\n }\n }\n}\n `;\nexport const FailureStatusFragmentDoc = gql`\n fragment FailureStatusFragment on FailureStatus {\n type: __typename\n totalGas\n totalFee\n time\n reason\n receipts {\n ...receiptFragment\n }\n}\n ${ReceiptFragmentDoc}`;\nexport const FailureStatusWithBlockIdFragmentDoc = gql`\n fragment FailureStatusWithBlockIdFragment on FailureStatus {\n ...FailureStatusFragment\n block {\n id\n }\n}\n ${FailureStatusFragmentDoc}`;\nexport const SqueezedOutStatusFragmentDoc = gql`\n fragment SqueezedOutStatusFragment on SqueezedOutStatus {\n type: __typename\n reason\n}\n `;\nexport const TransactionStatusSubscriptionFragmentDoc = gql`\n fragment transactionStatusSubscriptionFragment on TransactionStatus {\n ... on SubmittedStatus {\n ...SubmittedStatusFragment\n }\n ... on SuccessStatus {\n ...SuccessStatusWithBlockIdFragment\n transaction {\n ...malleableTransactionFieldsFragment\n }\n }\n ... on FailureStatus {\n ...FailureStatusWithBlockIdFragment\n transaction {\n ...malleableTransactionFieldsFragment\n }\n }\n ... on SqueezedOutStatus {\n ...SqueezedOutStatusFragment\n }\n}\n ${SubmittedStatusFragmentDoc}\n${SuccessStatusWithBlockIdFragmentDoc}\n${MalleableTransactionFieldsFragmentDoc}\n${FailureStatusWithBlockIdFragmentDoc}\n${SqueezedOutStatusFragmentDoc}`;\nexport const TransactionStatusFragmentDoc = gql`\n fragment transactionStatusFragment on TransactionStatus {\n ... on SubmittedStatus {\n ...SubmittedStatusFragment\n }\n ... on SuccessStatus {\n ...SuccessStatusFragment\n }\n ... on FailureStatus {\n ...FailureStatusFragment\n }\n ... on SqueezedOutStatus {\n ...SqueezedOutStatusFragment\n }\n}\n ${SubmittedStatusFragmentDoc}\n${SuccessStatusFragmentDoc}\n${FailureStatusFragmentDoc}\n${SqueezedOutStatusFragmentDoc}`;\nexport const TransactionFragmentDoc = gql`\n fragment transactionFragment on Transaction {\n id\n rawPayload\n status {\n ...transactionStatusFragment\n }\n}\n ${TransactionStatusFragmentDoc}`;\nexport const TransactionRawPayloadFragmentDoc = gql`\n fragment transactionRawPayloadFragment on Transaction {\n id\n rawPayload\n}\n `;\nexport const InputEstimatePredicatesFragmentDoc = gql`\n fragment inputEstimatePredicatesFragment on Input {\n ... on InputCoin {\n predicateGasUsed\n }\n ... on InputMessage {\n predicateGasUsed\n }\n}\n `;\nexport const TransactionEstimatePredicatesFragmentDoc = gql`\n fragment transactionEstimatePredicatesFragment on Transaction {\n inputs {\n ...inputEstimatePredicatesFragment\n }\n}\n ${InputEstimatePredicatesFragmentDoc}`;\nexport const DryRunFailureStatusFragmentDoc = gql`\n fragment dryRunFailureStatusFragment on DryRunFailureStatus {\n type: __typename\n totalGas\n totalFee\n reason\n programState {\n returnType\n data\n }\n}\n `;\nexport const DryRunSuccessStatusFragmentDoc = gql`\n fragment dryRunSuccessStatusFragment on DryRunSuccessStatus {\n type: __typename\n totalGas\n totalFee\n programState {\n returnType\n data\n }\n}\n `;\nexport const DryRunTransactionStatusFragmentDoc = gql`\n fragment dryRunTransactionStatusFragment on DryRunTransactionStatus {\n ... on DryRunFailureStatus {\n ...dryRunFailureStatusFragment\n }\n ... on DryRunSuccessStatus {\n ...dryRunSuccessStatusFragment\n }\n}\n ${DryRunFailureStatusFragmentDoc}\n${DryRunSuccessStatusFragmentDoc}`;\nexport const DryRunTransactionExecutionStatusFragmentDoc = gql`\n fragment dryRunTransactionExecutionStatusFragment on DryRunTransactionExecutionStatus {\n id\n status {\n ...dryRunTransactionStatusFragment\n }\n receipts {\n ...receiptFragment\n }\n}\n ${DryRunTransactionStatusFragmentDoc}\n${ReceiptFragmentDoc}`;\nexport const BlockFragmentDoc = gql`\n fragment blockFragment on Block {\n id\n height\n header {\n time\n daHeight\n stateTransitionBytecodeVersion\n transactionsCount\n transactionsRoot\n messageOutboxRoot\n eventInboxRoot\n prevRoot\n applicationHash\n }\n transactions {\n id\n }\n}\n `;\nexport const CoinFragmentDoc = gql`\n fragment coinFragment on Coin {\n type: __typename\n utxoId\n amount\n assetId\n blockCreated\n txCreatedIdx\n}\n `;\nexport const MessageCoinFragmentDoc = gql`\n fragment messageCoinFragment on MessageCoin {\n type: __typename\n sender\n recipient\n nonce\n amount\n assetId\n daHeight\n}\n `;\nexport const MessageFragmentDoc = gql`\n fragment messageFragment on Message {\n amount\n sender\n recipient\n data\n daHeight\n}\n `;\nexport const GetMessageFragmentDoc = gql`\n fragment getMessageFragment on Message {\n ...messageFragment\n nonce\n}\n ${MessageFragmentDoc}`;\nexport const MessageProofFragmentDoc = gql`\n fragment messageProofFragment on MessageProof {\n messageProof {\n proofSet\n proofIndex\n }\n blockProof {\n proofSet\n proofIndex\n }\n messageBlockHeader {\n version\n id\n daHeight\n consensusParametersVersion\n stateTransitionBytecodeVersion\n transactionsCount\n messageReceiptCount\n transactionsRoot\n messageOutboxRoot\n eventInboxRoot\n height\n prevRoot\n time\n applicationHash\n }\n commitBlockHeader {\n version\n id\n daHeight\n consensusParametersVersion\n stateTransitionBytecodeVersion\n transactionsCount\n messageReceiptCount\n transactionsRoot\n messageOutboxRoot\n eventInboxRoot\n height\n prevRoot\n time\n applicationHash\n }\n sender\n recipient\n amount\n data\n}\n `;\nexport const TxParametersFragmentDoc = gql`\n fragment TxParametersFragment on TxParameters {\n version\n maxInputs\n maxOutputs\n maxWitnesses\n maxGasPerTx\n maxSize\n maxBytecodeSubsections\n}\n `;\nexport const PredicateParametersFragmentDoc = gql`\n fragment PredicateParametersFragment on PredicateParameters {\n version\n maxPredicateLength\n maxPredicateDataLength\n maxGasPerPredicate\n maxMessageDataLength\n}\n `;\nexport const ScriptParametersFragmentDoc = gql`\n fragment ScriptParametersFragment on ScriptParameters {\n version\n maxScriptLength\n maxScriptDataLength\n}\n `;\nexport const ContractParametersFragmentDoc = gql`\n fragment ContractParametersFragment on ContractParameters {\n version\n contractMaxSize\n maxStorageSlots\n}\n `;\nexport const FeeParametersFragmentDoc = gql`\n fragment FeeParametersFragment on FeeParameters {\n version\n gasPriceFactor\n gasPerByte\n}\n `;\nexport const DependentCostFragmentDoc = gql`\n fragment DependentCostFragment on DependentCost {\n ... on LightOperation {\n type: __typename\n base\n unitsPerGas\n }\n ... on HeavyOperation {\n type: __typename\n base\n gasPerUnit\n }\n}\n `;\nexport const GasCostsFragmentDoc = gql`\n fragment GasCostsFragment on GasCosts {\n contractRoot {\n ...DependentCostFragment\n }\n stateRoot {\n ...DependentCostFragment\n }\n vmInitialization {\n ...DependentCostFragment\n }\n s256 {\n ...DependentCostFragment\n }\n ecr1\n newStoragePerByte\n}\n ${DependentCostFragmentDoc}`;\nexport const ConsensusParametersFragmentDoc = gql`\n fragment consensusParametersFragment on ConsensusParameters {\n version\n txParams {\n ...TxParametersFragment\n }\n predicateParams {\n ...PredicateParametersFragment\n }\n scriptParams {\n ...ScriptParametersFragment\n }\n contractParams {\n ...ContractParametersFragment\n }\n feeParams {\n ...FeeParametersFragment\n }\n gasCosts {\n ...GasCostsFragment\n }\n baseAssetId\n chainId\n}\n ${TxParametersFragmentDoc}\n${PredicateParametersFragmentDoc}\n${ScriptParametersFragmentDoc}\n${ContractParametersFragmentDoc}\n${FeeParametersFragmentDoc}\n${GasCostsFragmentDoc}`;\nexport const ChainInfoFragmentDoc = gql`\n fragment chainInfoFragment on ChainInfo {\n name\n daHeight\n consensusParameters {\n ...consensusParametersFragment\n }\n}\n ${ConsensusParametersFragmentDoc}`;\nexport const ContractBalanceFragmentDoc = gql`\n fragment contractBalanceFragment on ContractBalance {\n contract\n amount\n assetId\n}\n `;\nexport const PageInfoFragmentDoc = gql`\n fragment pageInfoFragment on PageInfo {\n hasPreviousPage\n hasNextPage\n startCursor\n endCursor\n}\n `;\nexport const NodeInfoFragmentDoc = gql`\n fragment nodeInfoFragment on NodeInfo {\n utxoValidation\n vmBacktrace\n maxTx\n maxDepth\n nodeVersion\n}\n `;\nexport const RelayedTransactionStatusFragmentDoc = gql`\n fragment relayedTransactionStatusFragment on RelayedTransactionStatus {\n ... on RelayedTransactionFailed {\n blockHeight\n failure\n }\n}\n `;\nexport const GetVersionDocument = gql`\n query getVersion {\n nodeInfo {\n nodeVersion\n }\n}\n `;\nexport const GetNodeInfoDocument = gql`\n query getNodeInfo {\n nodeInfo {\n ...nodeInfoFragment\n }\n}\n ${NodeInfoFragmentDoc}`;\nexport const GetChainDocument = gql`\n query getChain {\n chain {\n ...chainInfoFragment\n }\n}\n ${ChainInfoFragmentDoc}`;\nexport const GetChainAndNodeInfoDocument = gql`\n query getChainAndNodeInfo {\n chain {\n ...chainInfoFragment\n }\n nodeInfo {\n ...nodeInfoFragment\n }\n}\n ${ChainInfoFragmentDoc}\n${NodeInfoFragmentDoc}`;\nexport const GetTransactionDocument = gql`\n query getTransaction($transactionId: TransactionId!) {\n transaction(id: $transactionId) {\n ...transactionFragment\n }\n}\n ${TransactionFragmentDoc}`;\nexport const GetTransactionWithReceiptsDocument = gql`\n query getTransactionWithReceipts($transactionId: TransactionId!) {\n transaction(id: $transactionId) {\n id\n rawPayload\n status {\n ... on SubmittedStatus {\n ...SubmittedStatusFragment\n }\n ... on SuccessStatus {\n ...SuccessStatusWithBlockIdFragment\n }\n ... on FailureStatus {\n ...FailureStatusWithBlockIdFragment\n }\n ... on SqueezedOutStatus {\n ...SqueezedOutStatusFragment\n }\n }\n }\n}\n ${SubmittedStatusFragmentDoc}\n${SuccessStatusWithBlockIdFragmentDoc}\n${FailureStatusWithBlockIdFragmentDoc}\n${SqueezedOutStatusFragmentDoc}`;\nexport const GetTransactionsDocument = gql`\n query getTransactions($after: String, $before: String, $first: Int, $last: Int) {\n transactions(after: $after, before: $before, first: $first, last: $last) {\n edges {\n node {\n rawPayload\n }\n }\n pageInfo {\n ...pageInfoFragment\n }\n }\n}\n ${PageInfoFragmentDoc}`;\nexport const GetTransactionsByOwnerDocument = gql`\n query getTransactionsByOwner($owner: Address!, $after: String, $before: String, $first: Int, $last: Int) {\n transactionsByOwner(\n owner: $owner\n after: $after\n before: $before\n first: $first\n last: $last\n ) {\n pageInfo {\n ...pageInfoFragment\n }\n edges {\n node {\n ...transactionFragment\n }\n }\n }\n}\n ${PageInfoFragmentDoc}\n${TransactionFragmentDoc}`;\nexport const EstimatePredicatesDocument = gql`\n query estimatePredicates($encodedTransaction: HexString!) {\n estimatePredicates(tx: $encodedTransaction) {\n ...transactionEstimatePredicatesFragment\n }\n}\n ${TransactionEstimatePredicatesFragmentDoc}`;\nexport const GetLatestBlockDocument = gql`\n query getLatestBlock {\n chain {\n latestBlock {\n ...blockFragment\n }\n }\n}\n ${BlockFragmentDoc}`;\nexport const GetLatestBlockHeightDocument = gql`\n query getLatestBlockHeight {\n chain {\n latestBlock {\n height\n }\n }\n}\n `;\nexport const GetBlockDocument = gql`\n query getBlock($blockId: BlockId, $height: U32) {\n block(id: $blockId, height: $height) {\n ...blockFragment\n }\n}\n ${BlockFragmentDoc}`;\nexport const GetBlockWithTransactionsDocument = gql`\n query getBlockWithTransactions($blockId: BlockId, $blockHeight: U32) {\n block(id: $blockId, height: $blockHeight) {\n ...blockFragment\n transactions {\n ...transactionRawPayloadFragment\n }\n }\n}\n ${BlockFragmentDoc}\n${TransactionRawPayloadFragmentDoc}`;\nexport const GetBlocksDocument = gql`\n query getBlocks($after: String, $before: String, $first: Int, $last: Int) {\n blocks(after: $after, before: $before, first: $first, last: $last) {\n pageInfo {\n ...pageInfoFragment\n }\n edges {\n node {\n ...blockFragment\n }\n }\n }\n}\n ${PageInfoFragmentDoc}\n${BlockFragmentDoc}`;\nexport const GetCoinDocument = gql`\n query getCoin($coinId: UtxoId!) {\n coin(utxoId: $coinId) {\n ...coinFragment\n owner\n }\n}\n ${CoinFragmentDoc}`;\nexport const GetCoinsDocument = gql`\n query getCoins($filter: CoinFilterInput!, $after: String, $before: String, $first: Int, $last: Int) {\n coins(\n filter: $filter\n after: $after\n before: $before\n first: $first\n last: $last\n ) {\n pageInfo {\n ...pageInfoFragment\n }\n edges {\n node {\n ...coinFragment\n }\n }\n }\n}\n ${PageInfoFragmentDoc}\n${CoinFragmentDoc}`;\nexport const GetCoinsToSpendDocument = gql`\n query getCoinsToSpend($owner: Address!, $queryPerAsset: [SpendQueryElementInput!]!, $excludedIds: ExcludeInput) {\n coinsToSpend(\n owner: $owner\n queryPerAsset: $queryPerAsset\n excludedIds: $excludedIds\n ) {\n ...coinFragment\n ...messageCoinFragment\n }\n}\n ${CoinFragmentDoc}\n${MessageCoinFragmentDoc}`;\nexport const GetContractDocument = gql`\n query getContract($contractId: ContractId!) {\n contract(id: $contractId) {\n bytecode\n id\n }\n}\n `;\nexport const GetContractBalanceDocument = gql`\n query getContractBalance($contract: ContractId!, $asset: AssetId!) {\n contractBalance(contract: $contract, asset: $asset) {\n ...contractBalanceFragment\n }\n}\n ${ContractBalanceFragmentDoc}`;\nexport const GetBalanceDocument = gql`\n query getBalance($owner: Address!, $assetId: AssetId!) {\n balance(owner: $owner, assetId: $assetId) {\n amount\n }\n}\n `;\nexport const GetLatestGasPriceDocument = gql`\n query getLatestGasPrice {\n latestGasPrice {\n gasPrice\n }\n}\n `;\nexport const EstimateGasPriceDocument = gql`\n query estimateGasPrice($blockHorizon: U32!) {\n estimateGasPrice(blockHorizon: $blockHorizon) {\n gasPrice\n }\n}\n `;\nexport const GetBalancesDocument = gql`\n query getBalances($filter: BalanceFilterInput!, $after: String, $before: String, $first: Int, $last: Int) {\n balances(\n filter: $filter\n after: $after\n before: $before\n first: $first\n last: $last\n ) {\n edges {\n node {\n assetId\n amount\n }\n }\n }\n}\n `;\nexport const GetMessagesDocument = gql`\n query getMessages($owner: Address!, $after: String, $before: String, $first: Int, $last: Int) {\n messages(\n owner: $owner\n after: $after\n before: $before\n first: $first\n last: $last\n ) {\n pageInfo {\n ...pageInfoFragment\n }\n edges {\n node {\n ...getMessageFragment\n }\n }\n }\n}\n ${PageInfoFragmentDoc}\n${GetMessageFragmentDoc}`;\nexport const DaCompressedBlockDocument = gql`\n query daCompressedBlock($height: U32!) {\n daCompressedBlock(height: $height) {\n bytes\n }\n}\n `;\nexport const GetMessageProofDocument = gql`\n query getMessageProof($transactionId: TransactionId!, $nonce: Nonce!, $commitBlockId: BlockId, $commitBlockHeight: U32) {\n messageProof(\n transactionId: $transactionId\n nonce: $nonce\n commitBlockId: $commitBlockId\n commitBlockHeight: $commitBlockHeight\n ) {\n ...messageProofFragment\n }\n}\n ${MessageProofFragmentDoc}`;\nexport const GetMessageStatusDocument = gql`\n query getMessageStatus($nonce: Nonce!) {\n messageStatus(nonce: $nonce) {\n state\n }\n}\n `;\nexport const GetRelayedTransactionStatusDocument = gql`\n query getRelayedTransactionStatus($relayedTransactionId: RelayedTransactionId!) {\n relayedTransactionStatus(id: $relayedTransactionId) {\n ...relayedTransactionStatusFragment\n }\n}\n ${RelayedTransactionStatusFragmentDoc}`;\nexport const DryRunDocument = gql`\n mutation dryRun($encodedTransactions: [HexString!]!, $utxoValidation: Boolean, $gasPrice: U64) {\n dryRun(\n txs: $encodedTransactions\n utxoValidation: $utxoValidation\n gasPrice: $gasPrice\n ) {\n ...dryRunTransactionExecutionStatusFragment\n }\n}\n ${DryRunTransactionExecutionStatusFragmentDoc}`;\nexport const SubmitDocument = gql`\n mutation submit($encodedTransaction: HexString!) {\n submit(tx: $encodedTransaction) {\n id\n }\n}\n `;\nexport const ProduceBlocksDocument = gql`\n mutation produceBlocks($startTimestamp: Tai64Timestamp, $blocksToProduce: U32!) {\n produceBlocks(\n blocksToProduce: $blocksToProduce\n startTimestamp: $startTimestamp\n )\n}\n `;\nexport const GetMessageByNonceDocument = gql`\n query getMessageByNonce($nonce: Nonce!) {\n message(nonce: $nonce) {\n ...messageFragment\n }\n}\n ${MessageFragmentDoc}`;\nexport const IsUserAccountDocument = gql`\n query isUserAccount($blobId: BlobId!, $contractId: ContractId!, $transactionId: TransactionId!) {\n blob(id: $blobId) {\n id\n }\n contract(id: $contractId) {\n id\n }\n transaction(id: $transactionId) {\n id\n }\n}\n `;\nexport const GetConsensusParametersVersionDocument = gql`\n query getConsensusParametersVersion {\n chain {\n latestBlock {\n header {\n consensusParametersVersion\n }\n }\n }\n}\n `;\nexport const SubmitAndAwaitStatusDocument = gql`\n subscription submitAndAwaitStatus($encodedTransaction: HexString!) {\n submitAndAwaitStatus(tx: $encodedTransaction) {\n ...transactionStatusSubscriptionFragment\n }\n}\n ${TransactionStatusSubscriptionFragmentDoc}`;\nexport const StatusChangeDocument = gql`\n subscription statusChange($transactionId: TransactionId!) {\n statusChange(id: $transactionId) {\n ...transactionStatusSubscriptionFragment\n }\n}\n ${TransactionStatusSubscriptionFragmentDoc}`;\nexport type Requester<C = {}> = <R, V>(doc: DocumentNode, vars?: V, options?: C) => Promise<R> | AsyncIterable<R>\nexport function getSdk<C>(requester: Requester<C>) {\n return {\n getVersion(variables?: GqlGetVersionQueryVariables, options?: C): Promise<GqlGetVersionQuery> {\n return requester<GqlGetVersionQuery, GqlGetVersionQueryVariables>(GetVersionDocument, variables, options) as Promise<GqlGetVersionQuery>;\n },\n getNodeInfo(variables?: GqlGetNodeInfoQueryVariables, options?: C): Promise<GqlGetNodeInfoQuery> {\n return requester<GqlGetNodeInfoQuery, GqlGetNodeInfoQueryVariables>(GetNodeInfoDocument, variables, options) as Promise<GqlGetNodeInfoQuery>;\n },\n getChain(variables?: GqlGetChainQueryVariables, options?: C): Promise<GqlGetChainQuery> {\n return requester<GqlGetChainQuery, GqlGetChainQueryVariables>(GetChainDocument, variables, options) as Promise<GqlGetChainQuery>;\n },\n getChainAndNodeInfo(variables?: GqlGetChainAndNodeInfoQueryVariables, options?: C): Promise<GqlGetChainAndNodeInfoQuery> {\n return requester<GqlGetChainAndNodeInfoQuery, GqlGetChainAndNodeInfoQueryVariables>(GetChainAndNodeInfoDocument, variables, options) as Promise<GqlGetChainAndNodeInfoQuery>;\n },\n getTransaction(variables: GqlGetTransactionQueryVariables, options?: C): Promise<GqlGetTransactionQuery> {\n return requester<GqlGetTransactionQuery, GqlGetTransactionQueryVariables>(GetTransactionDocument, variables, options) as Promise<GqlGetTransactionQuery>;\n },\n getTransactionWithReceipts(variables: GqlGetTransactionWithReceiptsQueryVariables, options?: C): Promise<GqlGetTransactionWithReceiptsQuery> {\n return requester<GqlGetTransactionWithReceiptsQuery, GqlGetTransactionWithReceiptsQueryVariables>(GetTransactionWithReceiptsDocument, variables, options) as Promise<GqlGetTransactionWithReceiptsQuery>;\n },\n getTransactions(variables?: GqlGetTransactionsQueryVariables, options?: C): Promise<GqlGetTransactionsQuery> {\n return requester<GqlGetTransactionsQuery, GqlGetTransactionsQueryVariables>(GetTransactionsDocument, variables, options) as Promise<GqlGetTransactionsQuery>;\n },\n getTransactionsByOwner(variables: GqlGetTransactionsByOwnerQueryVariables, options?: C): Promise<GqlGetTransactionsByOwnerQuery> {\n return requester<GqlGetTransactionsByOwnerQuery, GqlGetTransactionsByOwnerQueryVariables>(GetTransactionsByOwnerDocument, variables, options) as Promise<GqlGetTransactionsByOwnerQuery>;\n },\n estimatePredicates(variables: GqlEstimatePredicatesQueryVariables, options?: C): Promise<GqlEstimatePredicatesQuery> {\n return requester<GqlEstimatePredicatesQuery, GqlEstimatePredicatesQueryVariables>(EstimatePredicatesDocument, variables, options) as Promise<GqlEstimatePredicatesQuery>;\n },\n getLatestBlock(variables?: GqlGetLatestBlockQueryVariables, options?: C): Promise<GqlGetLatestBlockQuery> {\n return requester<GqlGetLatestBlockQuery, GqlGetLatestBlockQueryVariables>(GetLatestBlockDocument, variables, options) as Promise<GqlGetLatestBlockQuery>;\n },\n getLatestBlockHeight(variables?: GqlGetLatestBlockHeightQueryVariables, options?: C): Promise<GqlGetLatestBlockHeightQuery> {\n return requester<GqlGetLatestBlockHeightQuery, GqlGetLatestBlockHeightQueryVariables>(GetLatestBlockHeightDocument, variables, options) as Promise<GqlGetLatestBlockHeightQuery>;\n },\n getBlock(variables?: GqlGetBlockQueryVariables, options?: C): Promise<GqlGetBlockQuery> {\n return requester<GqlGetBlockQuery, GqlGetBlockQueryVariables>(GetBlockDocument, variables, options) as Promise<GqlGetBlockQuery>;\n },\n getBlockWithTransactions(variables?: GqlGetBlockWithTransactionsQueryVariables, options?: C): Promise<GqlGetBlockWithTransactionsQuery> {\n return requester<GqlGetBlockWithTransactionsQuery, GqlGetBlockWithTransactionsQueryVariables>(GetBlockWithTransactionsDocument, variables, options) as Promise<GqlGetBlockWithTransactionsQuery>;\n },\n getBlocks(variables?: GqlGetBlocksQueryVariables, options?: C): Promise<GqlGetBlocksQuery> {\n return requester<GqlGetBlocksQuery, GqlGetBlocksQueryVariables>(GetBlocksDocument, variables, options) as Promise<GqlGetBlocksQuery>;\n },\n getCoin(variables: GqlGetCoinQueryVariables, options?: C): Promise<GqlGetCoinQuery> {\n return requester<GqlGetCoinQuery, GqlGetCoinQueryVariables>(GetCoinDocument, variables, options) as Promise<GqlGetCoinQuery>;\n },\n getCoins(variables: GqlGetCoinsQueryVariables, options?: C): Promise<GqlGetCoinsQuery> {\n return requester<GqlGetCoinsQuery, GqlGetCoinsQueryVariables>(GetCoinsDocument, variables, options) as Promise<GqlGetCoinsQuery>;\n },\n getCoinsToSpend(variables: GqlGetCoinsToSpendQueryVariables, options?: C): Promise<GqlGetCoinsToSpendQuery> {\n return requester<GqlGetCoinsToSpendQuery, GqlGetCoinsToSpendQueryVariables>(GetCoinsToSpendDocument, variables, options) as Promise<GqlGetCoinsToSpendQuery>;\n },\n getContract(variables: GqlGetContractQueryVariables, options?: C): Promise<GqlGetContractQuery> {\n return requester<GqlGetContractQuery, GqlGetContractQueryVariables>(GetContractDocument, variables, options) as Promise<GqlGetContractQuery>;\n },\n getContractBalance(variables: GqlGetContractBalanceQueryVariables, options?: C): Promise<GqlGetContractBalanceQuery> {\n return requester<GqlGetContractBalanceQuery, GqlGetContractBalanceQueryVariables>(GetContractBalanceDocument, variables, options) as Promise<GqlGetContractBalanceQuery>;\n },\n getBalance(variables: GqlGetBalanceQueryVariables, options?: C): Promise<GqlGetBalanceQuery> {\n return requester<GqlGetBalanceQuery, GqlGetBalanceQueryVariables>(GetBalanceDocument, variables, options) as Promise<GqlGetBalanceQuery>;\n },\n getLatestGasPrice(variables?: GqlGetLatestGasPriceQueryVariables, options?: C): Promise<GqlGetLatestGasPriceQuery> {\n return requester<GqlGetLatestGasPriceQuery, GqlGetLatestGasPriceQueryVariables>(GetLatestGasPriceDocument, variables, options) as Promise<GqlGetLatestGasPriceQuery>;\n },\n estimateGasPrice(variables: GqlEstimateGasPriceQueryVariables, options?: C): Promise<GqlEstimateGasPriceQuery> {\n return requester<GqlEstimateGasPriceQuery, GqlEstimateGasPriceQueryVariables>(EstimateGasPriceDocument, variables, options) as Promise<GqlEstimateGasPriceQuery>;\n },\n getBalances(variables: GqlGetBalancesQueryVariables, options?: C): Promise<GqlGetBalancesQuery> {\n return requester<GqlGetBalancesQuery, GqlGetBalancesQueryVariables>(GetBalancesDocument, variables, options) as Promise<GqlGetBalancesQuery>;\n },\n getMessages(variables: GqlGetMessagesQueryVariables, options?: C): Promise<GqlGetMessagesQuery> {\n return requester<GqlGetMessagesQuery, GqlGetMessagesQueryVariables>(GetMessagesDocument, variables, options) as Promise<GqlGetMessagesQuery>;\n },\n daCompressedBlock(variables: GqlDaCompressedBlockQueryVariables, options?: C): Promise<GqlDaCompressedBlockQuery> {\n return requester<GqlDaCompressedBlockQuery, GqlDaCompressedBlockQueryVariables>(DaCompressedBlockDocument, variables, options) as Promise<GqlDaCompressedBlockQuery>;\n },\n getMessageProof(variables: GqlGetMessageProofQueryVariables, options?: C): Promise<GqlGetMessageProofQuery> {\n return requester<GqlGetMessageProofQuery, GqlGetMessageProofQueryVariables>(GetMessageProofDocument, variables, options) as Promise<GqlGetMessageProofQuery>;\n },\n getMessageStatus(variables: GqlGetMessageStatusQueryVariables, options?: C): Promise<GqlGetMessageStatusQuery> {\n return requester<GqlGetMessageStatusQuery, GqlGetMessageStatusQueryVariables>(GetMessageStatusDocument, variables, options) as Promise<GqlGetMessageStatusQuery>;\n },\n getRelayedTransactionStatus(variables: GqlGetRelayedTransactionStatusQueryVariables, options?: C): Promise<GqlGetRelayedTransactionStatusQuery> {\n return requester<GqlGetRelayedTransactionStatusQuery, GqlGetRelayedTransactionStatusQueryVariables>(GetRelayedTransactionStatusDocument, variables, options) as Promise<GqlGetRelayedTransactionStatusQuery>;\n },\n dryRun(variables: GqlDryRunMutationVariables, options?: C): Promise<GqlDryRunMutation> {\n return requester<GqlDryRunMutation, GqlDryRunMutationVariables>(DryRunDocument, variables, options) as Promise<GqlDryRunMutation>;\n },\n submit(variables: GqlSubmitMutationVariables, options?: C): Promise<GqlSubmitMutation> {\n return requester<GqlSubmitMutation, GqlSubmitMutationVariables>(SubmitDocument, variables, options) as Promise<GqlSubmitMutation>;\n },\n produceBlocks(variables: GqlProduceBlocksMutationVariables, options?: C): Promise<GqlProduceBlocksMutation> {\n return requester<GqlProduceBlocksMutation, GqlProduceBlocksMutationVariables>(ProduceBlocksDocument, variables, options) as Promise<GqlProduceBlocksMutation>;\n },\n getMessageByNonce(variables: GqlGetMessageByNonceQueryVariables, options?: C): Promise<GqlGetMessageByNonceQuery> {\n return requester<GqlGetMessageByNonceQuery, GqlGetMessageByNonceQueryVariables>(GetMessageByNonceDocument, variables, options) as Promise<GqlGetMessageByNonceQuery>;\n },\n isUserAccount(variables: GqlIsUserAccountQueryVariables, options?: C): Promise<GqlIsUserAccountQuery> {\n return requester<GqlIsUserAccountQuery, GqlIsUserAccountQueryVariables>(IsUserAccountDocument, variables, options) as Promise<GqlIsUserAccountQuery>;\n },\n getConsensusParametersVersion(variables?: GqlGetConsensusParametersVersionQueryVariables, options?: C): Promise<GqlGetConsensusParametersVersionQuery> {\n return requester<GqlGetConsensusParametersVersionQuery, GqlGetConsensusParametersVersionQueryVariables>(GetConsensusParametersVersionDocument, variables, options) as Promise<GqlGetConsensusParametersVersionQuery>;\n },\n submitAndAwaitStatus(variables: GqlSubmitAndAwaitStatusSubscriptionVariables, options?: C): AsyncIterable<GqlSubmitAndAwaitStatusSubscription> {\n return requester<GqlSubmitAndAwaitStatusSubscription, GqlSubmitAndAwaitStatusSubscriptionVariables>(SubmitAndAwaitStatusDocument, variables, options) as AsyncIterable<GqlSubmitAndAwaitStatusSubscription>;\n },\n statusChange(variables: GqlStatusChangeSubscriptionVariables, options?: C): AsyncIterable<GqlStatusChangeSubscription> {\n return requester<GqlStatusChangeSubscription, GqlStatusChangeSubscriptionVariables>(StatusChangeDocument, variables, options) as AsyncIterable<GqlStatusChangeSubscription>;\n }\n };\n}\nexport type Sdk = ReturnType<typeof getSdk>;","import { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport type { DocumentNode } from 'graphql';\nimport { print } from 'graphql';\n\nimport { assertGqlResponseHasNoErrors } from './utils/handle-gql-error-message';\n\ntype FuelGraphQLSubscriberOptions = {\n url: string;\n query: DocumentNode;\n variables?: Record<string, unknown>;\n fetchFn: typeof fetch;\n};\n\nexport class FuelGraphqlSubscriber implements AsyncIterator<unknown> {\n public static incompatibleNodeVersionMessage: string | false = false;\n private static textDecoder = new TextDecoder();\n\n private constructor(private stream: ReadableStreamDefaultReader<Uint8Array>) {}\n\n public static async create(options: FuelGraphQLSubscriberOptions) {\n const { url, query, variables, fetchFn } = options;\n const response = await fetchFn(`${url}-sub`, {\n method: 'POST',\n body: JSON.stringify({\n query: print(query),\n variables,\n }),\n headers: {\n 'Content-Type': 'application/json',\n Accept: 'text/event-stream',\n },\n });\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const [errorReader, resultReader] = response.body!.tee().map((stream) => stream.getReader());\n\n /**\n * If the node threw an error, read it and throw it to the user\n * Else just discard the response and return the subscriber below,\n * which will have that same response via `resultReader`\n */\n await new FuelGraphqlSubscriber(errorReader).next();\n\n return new FuelGraphqlSubscriber(resultReader);\n }\n\n private events: Array<{ data: unknown; errors?: { message: string }[] }> = [];\n private parsingLeftover = '';\n\n async next(): Promise<IteratorResult<unknown, unknown>> {\n // eslint-disable-next-line no-constant-condition\n while (true) {\n if (this.events.length > 0) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const { data, errors } = this.events.shift()!;\n assertGqlResponseHasNoErrors(errors, FuelGraphqlSubscriber.incompatibleNodeVersionMessage);\n return { value: data, done: false };\n }\n const { value, done } = await this.stream.read();\n if (done) {\n return { value, done };\n }\n\n /**\n * We don't care about keep-alive messages.\n * The only responses that I came across from the node are either 200 responses with \"data:.*\" or keep-alive messages.\n * You can find the keep-alive message in the fuel-core codebase (latest permalink as of writing):\n * https://github.com/FuelLabs/fuel-core/blob/e1e631902f762081d2124d9c457ddfe13ac366dc/crates/fuel-core/src/graphql_api/service.rs#L247\n * To get the actual latest info you need to check out the master branch (might change):\n * https://github.com/FuelLabs/fuel-core/blob/master/crates/fuel-core/src/graphql_api/service.rs#L247\n * */\n const decoded = FuelGraphqlSubscriber.textDecoder\n .decode(value)\n .replace(':keep-alive-text\\n\\n', '');\n\n if (decoded === '') {\n continue;\n }\n\n const text = `${this.parsingLeftover}${decoded}`;\n const regex = /data:.*\\n\\n/g;\n\n const matches = [...text.matchAll(regex)].flatMap((match) => match);\n\n matches.forEach((match) => {\n try {\n this.events.push(JSON.parse(match.replace(/^data:/, '')));\n } catch (e) {\n throw new FuelError(\n ErrorCode.STREAM_PARSING_ERROR,\n `Error while parsing stream data response: ${text}`\n );\n }\n });\n\n this.parsingLeftover = text.replace(matches.join(), '');\n }\n }\n\n /**\n * Gets called when `break` is called in a `for-await-of` loop.\n */\n return(): Promise<IteratorResult<unknown, undefined>> {\n return Promise.resolve({ done: true, value: undefined });\n }\n\n [Symbol.asyncIterator](): AsyncIterator<unknown, unknown, undefined> {\n return this;\n }\n}\n","import { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport type { GraphQLError } from 'graphql';\n\nexport enum GqlErrorMessage {\n NOT_ENOUGH_COINS = 'not enough coins to fit the target',\n MAX_COINS_REACHED = 'max number of coins is reached while trying to fit the target',\n}\n\ntype GqlError = { message: string } | GraphQLError;\n\nconst mapGqlErrorMessage = (error: GqlError): FuelError => {\n switch (error.message) {\n case GqlErrorMessage.NOT_ENOUGH_COINS:\n return new FuelError(\n ErrorCode.NOT_ENOUGH_FUNDS,\n `The account(s) sending the transaction don't have enough funds to cover the transaction.`,\n {},\n error\n );\n case GqlErrorMessage.MAX_COINS_REACHED:\n return new FuelError(\n ErrorCode.MAX_COINS_REACHED,\n 'The account retrieving coins has exceeded the maximum number of coins per asset. Please consider combining your coins into a single UTXO.',\n {},\n error\n );\n default:\n return new FuelError(ErrorCode.INVALID_REQUEST, error.message, {}, error);\n }\n};\n\nconst mapGqlErrorWithIncompatibleNodeVersion = (\n error: FuelError,\n incompatibleNodeVersionMessage: string | false\n) => {\n if (!incompatibleNodeVersionMessage) {\n return error;\n }\n\n return new FuelError(\n error.code,\n `${error.message}\\n\\n${incompatibleNodeVersionMessage}`,\n error.metadata,\n error.rawError\n );\n};\n\nexport const assertGqlResponseHasNoErrors = (\n errors: GqlError[] | undefined,\n incompatibleNodeVersionMessage: string | false = false\n) => {\n if (!Array.isArray(errors)) {\n return;\n }\n\n const mappedErrors = errors.map(mapGqlErrorMessage);\n if (mappedErrors.length === 1) {\n throw mapGqlErrorWithIncompatibleNodeVersion(mappedErrors[0], incompatibleNodeVersionMessage);\n }\n\n const errorMessage = mappedErrors.map((err) => err.message).join('\\n');\n throw mapGqlErrorWithIncompatibleNodeVersion(\n new FuelError(ErrorCode.INVALID_REQUEST, errorMessage, {}, mappedErrors),\n incompatibleNodeVersionMessage\n );\n};\n","import { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { hexlify } from '@fuel-ts/utils';\n\nimport type { ExcludeResourcesOption } from './resource';\n\ninterface CachedResource {\n utxos: Set<string>;\n messages: Set<string>;\n timestamp: number;\n}\n\nconst cache = new Map<string, CachedResource>();\n\nexport class ResourceCache {\n readonly ttl: number;\n\n constructor(ttl: number) {\n this.ttl = ttl; // TTL in milliseconds\n\n if (typeof ttl !== 'number' || this.ttl <= 0) {\n throw new FuelError(\n ErrorCode.INVALID_TTL,\n `Invalid TTL: ${this.ttl}. Use a value greater than zero.`\n );\n }\n }\n\n // Add resources to the cache\n set(transactionId: string, resources: Required<ExcludeResourcesOption>): void {\n const currentTime = Date.now();\n const existingResources = cache.get(transactionId) || {\n utxos: new Set<string>(),\n messages: new Set<string>(),\n timestamp: currentTime,\n };\n\n resources.utxos.forEach((utxo) => existingResources.utxos.add(hexlify(utxo)));\n resources.messages.forEach((message) => existingResources.messages.add(hexlify(message)));\n\n cache.set(transactionId, existingResources);\n }\n\n // Remove resources from the cache for a given transaction ID\n unset(transactionId: string): void {\n cache.delete(transactionId);\n }\n\n // Get all cached resources and remove expired ones\n getActiveData() {\n const allResources: { utxos: string[]; messages: string[] } = { utxos: [], messages: [] };\n const currentTime = Date.now();\n cache.forEach((resource, transactionId) => {\n if (currentTime - resource.timestamp < this.ttl) {\n allResources.utxos.push(...resource.utxos);\n allResources.messages.push(...resource.messages);\n } else {\n cache.delete(transactionId);\n }\n });\n return allResources;\n }\n\n // Check if a UTXO ID or message nonce is already cached and not expired\n isCached(key: string): boolean {\n const currentTime = Date.now();\n for (const [transactionId, resourceData] of cache.entries()) {\n if (currentTime - resourceData.timestamp > this.ttl) {\n cache.delete(transactionId);\n } else if (resourceData.utxos.has(key) || resourceData.messages.has(key)) {\n return true;\n }\n }\n return false;\n }\n\n clear() {\n cache.clear();\n }\n}\n","import { BYTES_32, UTXO_ID_LEN } from '@fuel-ts/abi-coder';\nimport { ZeroBytes32 } from '@fuel-ts/address/configs';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport type { BigNumberish } from '@fuel-ts/math';\nimport { bn, toNumber } from '@fuel-ts/math';\nimport type { Input } from '@fuel-ts/transactions';\nimport { InputType } from '@fuel-ts/transactions';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { arrayify, hexlify } from '@fuel-ts/utils';\n\nexport type CoinTransactionRequestInput = {\n type: InputType.Coin;\n\n /** UTXO ID */\n id: BytesLike;\n\n /** Owning address or script hash */\n owner: BytesLike;\n\n /** Amount of coins */\n amount: BigNumberish;\n\n /** Asset ID of the coins */\n assetId: BytesLike;\n\n /** Points to the TX whose output is being spent. (TxPointer) */\n txPointer: BytesLike;\n\n /** Index of witness that authorizes spending the coin */\n witnessIndex: number;\n\n /** Gas used by predicate */\n predicateGasUsed?: BigNumberish;\n\n /** Predicate bytecode */\n predicate?: BytesLike;\n\n /** Predicate input data (parameters) */\n predicateData?: BytesLike;\n};\n\nexport type MessageTransactionRequestInput = {\n type: InputType.Message;\n\n /** Address of sender */\n sender: BytesLike;\n\n /** Address of recipient */\n recipient: BytesLike;\n\n /** Amount of coins */\n amount: BigNumberish;\n\n /** Index of witness that authorizes the message */\n witnessIndex: number;\n\n /** Unique nonce of message */\n nonce: BytesLike;\n\n /** Gas used by predicate */\n predicateGasUsed?: BigNumberish;\n\n /** Predicate bytecode */\n predicate?: BytesLike;\n\n /** Predicate input data (parameters) */\n predicateData?: BytesLike;\n\n /** data of message */\n data?: BytesLike;\n};\n\nexport type ContractTransactionRequestInput = {\n type: InputType.Contract;\n\n /** Points to the TX whose output is being spent. (TxPointer) */\n txPointer: BytesLike;\n\n /** Contract ID */\n contractId: BytesLike;\n};\nexport type TransactionRequestInput =\n | CoinTransactionRequestInput\n | ContractTransactionRequestInput\n | MessageTransactionRequestInput;\n\n/** @hidden */\nexport const inputify = (value: TransactionRequestInput): Input => {\n const { type } = value;\n\n switch (value.type) {\n case InputType.Coin: {\n const predicate = arrayify(value.predicate ?? '0x');\n const predicateData = arrayify(value.predicateData ?? '0x');\n return {\n type: InputType.Coin,\n txID: hexlify(arrayify(value.id).slice(0, BYTES_32)),\n outputIndex: toNumber(arrayify(value.id).slice(BYTES_32, UTXO_ID_LEN)),\n owner: hexlify(value.owner),\n amount: bn(value.amount),\n assetId: hexlify(value.assetId),\n txPointer: {\n blockHeight: toNumber(arrayify(value.txPointer).slice(0, 8)),\n txIndex: toNumber(arrayify(value.txPointer).slice(8, 16)),\n },\n witnessIndex: value.witnessIndex,\n predicateGasUsed: bn(value.predicateGasUsed),\n predicateLength: bn(predicate.length),\n predicateDataLength: bn(predicateData.length),\n predicate: hexlify(predicate),\n predicateData: hexlify(predicateData),\n };\n }\n case InputType.Contract: {\n return {\n type: InputType.Contract,\n txID: ZeroBytes32,\n outputIndex: 0,\n balanceRoot: ZeroBytes32,\n stateRoot: ZeroBytes32,\n txPointer: {\n blockHeight: toNumber(arrayify(value.txPointer).slice(0, 8)),\n txIndex: toNumber(arrayify(value.txPointer).slice(8, 16)),\n },\n contractID: hexlify(value.contractId),\n };\n }\n case InputType.Message: {\n const predicate = arrayify(value.predicate ?? '0x');\n const predicateData = arrayify(value.predicateData ?? '0x');\n const data = arrayify(value.data ?? '0x');\n return {\n type: InputType.Message,\n sender: hexlify(value.sender),\n recipient: hexlify(value.recipient),\n amount: bn(value.amount),\n nonce: hexlify(value.nonce),\n witnessIndex: value.witnessIndex,\n predicateGasUsed: bn(value.predicateGasUsed),\n predicateLength: bn(predicate.length),\n predicateDataLength: bn(predicateData.length),\n predicate: hexlify(predicate),\n predicateData: hexlify(predicateData),\n data: hexlify(data),\n dataLength: data.length,\n };\n }\n default: {\n throw new FuelError(\n ErrorCode.INVALID_TRANSACTION_INPUT,\n `Invalid transaction input type: ${type}.`\n );\n }\n }\n};\n","import { ZeroBytes32 } from '@fuel-ts/address/configs';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport type { BigNumberish } from '@fuel-ts/math';\nimport { bn } from '@fuel-ts/math';\nimport type { Output } from '@fuel-ts/transactions';\nimport { OutputType } from '@fuel-ts/transactions';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { hexlify } from '@fuel-ts/utils';\n\nexport type CoinTransactionRequestOutput = {\n type: OutputType.Coin;\n /** Receiving address or script hash */\n to: BytesLike;\n /** Amount of coins to send */\n amount: BigNumberish;\n /** Asset ID of coins */\n assetId: BytesLike;\n};\nexport type ContractTransactionRequestOutput = {\n type: OutputType.Contract;\n /** Index of input contract */\n inputIndex: number;\n};\nexport type ChangeTransactionRequestOutput = {\n type: OutputType.Change;\n /** Receiving address or script hash */\n to: BytesLike;\n /** Asset ID of coins */\n assetId: BytesLike;\n};\nexport type VariableTransactionRequestOutput = {\n type: OutputType.Variable;\n};\nexport type ContractCreatedTransactionRequestOutput = {\n type: OutputType.ContractCreated;\n /** Contract ID */\n contractId: BytesLike;\n /** State Root */\n stateRoot: BytesLike;\n};\nexport type TransactionRequestOutput =\n | CoinTransactionRequestOutput\n | ContractTransactionRequestOutput\n | ChangeTransactionRequestOutput\n | VariableTransactionRequestOutput\n | ContractCreatedTransactionRequestOutput;\n\n/** @hidden */\nexport const outputify = (value: TransactionRequestOutput): Output => {\n const { type } = value;\n\n switch (type) {\n case OutputType.Coin: {\n return {\n type: OutputType.Coin,\n to: hexlify(value.to),\n amount: bn(value.amount),\n assetId: hexlify(value.assetId),\n };\n }\n case OutputType.Contract: {\n return {\n type: OutputType.Contract,\n inputIndex: value.inputIndex,\n balanceRoot: ZeroBytes32,\n stateRoot: ZeroBytes32,\n };\n }\n case OutputType.Change: {\n return {\n type: OutputType.Change,\n to: hexlify(value.to),\n amount: bn(0),\n assetId: hexlify(value.assetId),\n };\n }\n case OutputType.Variable: {\n return {\n type: OutputType.Variable,\n to: ZeroBytes32,\n amount: bn(0),\n assetId: ZeroBytes32,\n };\n }\n case OutputType.ContractCreated: {\n return {\n type: OutputType.ContractCreated,\n contractId: hexlify(value.contractId),\n stateRoot: hexlify(value.stateRoot),\n };\n }\n default: {\n throw new FuelError(\n ErrorCode.INVALID_TRANSACTION_INPUT,\n `Invalid transaction output type: ${type}.`\n );\n }\n }\n};\n","import { UTXO_ID_LEN } from '@fuel-ts/abi-coder';\nimport { Address, addressify } from '@fuel-ts/address';\nimport type { AddressInput, AddressLike } from '@fuel-ts/address';\nimport { ZeroBytes32 } from '@fuel-ts/address/configs';\nimport { randomBytes } from '@fuel-ts/crypto';\nimport { FuelError } from '@fuel-ts/errors';\nimport type { BN, BigNumberish } from '@fuel-ts/math';\nimport { bn } from '@fuel-ts/math';\nimport type {\n TransactionScript,\n Policy,\n TransactionCreate,\n TransactionBlob,\n TransactionUpload,\n TransactionUpgrade,\n} from '@fuel-ts/transactions';\nimport {\n PolicyType,\n TransactionCoder,\n InputType,\n OutputType,\n TransactionType,\n} from '@fuel-ts/transactions';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { concat, hexlify, isDefined } from '@fuel-ts/utils';\n\nimport type { Account } from '../../account';\nimport type { Coin } from '../coin';\nimport type { CoinQuantity, CoinQuantityLike } from '../coin-quantity';\nimport { coinQuantityfy } from '../coin-quantity';\nimport { isMessageCoin, type Message, type MessageCoin } from '../message';\nimport type { ChainInfo, GasCosts } from '../provider';\nimport type { Resource } from '../resource';\nimport { isCoin } from '../resource';\nimport { normalizeJSON } from '../utils';\nimport { getMaxGas, getMinGas } from '../utils/gas';\n\nimport { NoWitnessAtIndexError } from './errors';\nimport {\n getRequestInputResourceOwner,\n isRequestInputCoinOrMessage,\n isRequestInputResource,\n isRequestInputResourceFromOwner,\n} from './helpers';\nimport type {\n TransactionRequestInput,\n CoinTransactionRequestInput,\n MessageTransactionRequestInput,\n} from './input';\nimport { inputify } from './input';\nimport type {\n TransactionRequestOutput,\n ChangeTransactionRequestOutput,\n CoinTransactionRequestOutput,\n} from './output';\nimport { outputify } from './output';\nimport type { TransactionRequestLike } from './types';\nimport type { TransactionRequestWitness } from './witness';\nimport { witnessify } from './witness';\n\nexport {\n /**\n * @hidden\n */\n TransactionType,\n};\n\n/**\n * @hidden\n *\n * Interface defining a like structure for a base transaction request.\n */\nexport interface BaseTransactionRequestLike {\n /** Gas price for transaction */\n tip?: BigNumberish;\n /** Block until which tx cannot be included */\n maturity?: number;\n /** The maximum fee payable by this transaction using BASE_ASSET. */\n maxFee?: BigNumberish;\n /** The maximum amount of witness data allowed for the transaction */\n witnessLimit?: BigNumberish;\n /** List of inputs */\n inputs?: TransactionRequestInput[];\n /** List of outputs */\n outputs?: TransactionRequestOutput[];\n /** List of witnesses */\n witnesses?: TransactionRequestWitness[];\n}\n\ntype ToBaseTransactionResponse = Pick<\n TransactionScript,\n | 'inputs'\n | 'inputsCount'\n | 'outputs'\n | 'outputsCount'\n | 'witnesses'\n | 'witnessesCount'\n | 'policies'\n | 'policyTypes'\n>;\n\n/**\n * Abstract class to define the functionalities of a transaction request transaction request.\n */\nexport abstract class BaseTransactionRequest implements BaseTransactionRequestLike {\n /** Type of the transaction */\n abstract type: TransactionType;\n /** Gas price for transaction */\n tip?: BN;\n /** Block until which tx cannot be included */\n maturity?: number;\n /** The maximum fee payable by this transaction using BASE_ASSET. */\n maxFee: BN;\n /** The maximum amount of witness data allowed for the transaction */\n witnessLimit?: BN | undefined;\n /** List of inputs */\n inputs: TransactionRequestInput[] = [];\n /** List of outputs */\n outputs: TransactionRequestOutput[] = [];\n /** List of witnesses */\n witnesses: TransactionRequestWitness[] = [];\n\n /**\n * Constructor for initializing a base transaction request.\n *\n * @param baseTransactionRequest - Optional object containing properties to initialize the transaction request.\n */\n constructor({\n tip,\n maturity,\n maxFee,\n witnessLimit,\n inputs,\n outputs,\n witnesses,\n }: BaseTransactionRequestLike = {}) {\n this.tip = tip ? bn(tip) : undefined;\n this.maturity = maturity && maturity > 0 ? maturity : undefined;\n this.witnessLimit = isDefined(witnessLimit) ? bn(witnessLimit) : undefined;\n this.maxFee = bn(maxFee);\n this.inputs = inputs ?? [];\n this.outputs = outputs ?? [];\n this.witnesses = witnesses ?? [];\n }\n\n static getPolicyMeta(req: BaseTransactionRequest) {\n let policyTypes = 0;\n const policies: Policy[] = [];\n\n const { tip, witnessLimit, maturity } = req;\n\n if (bn(tip).gt(0)) {\n policyTypes += PolicyType.Tip;\n policies.push({ data: bn(tip), type: PolicyType.Tip });\n }\n if (isDefined(witnessLimit) && bn(witnessLimit).gte(0)) {\n policyTypes += PolicyType.WitnessLimit;\n policies.push({ data: bn(witnessLimit), type: PolicyType.WitnessLimit });\n }\n if (maturity && maturity > 0) {\n policyTypes += PolicyType.Maturity;\n policies.push({ data: maturity, type: PolicyType.Maturity });\n }\n\n policyTypes += PolicyType.MaxFee;\n policies.push({ data: req.maxFee, type: PolicyType.MaxFee });\n\n return {\n policyTypes,\n policies,\n };\n }\n\n /**\n * Method to obtain the base transaction details.\n *\n * @returns The base transaction details.\n */\n\n protected getBaseTransaction(): ToBaseTransactionResponse {\n const inputs = this.inputs?.map(inputify) ?? [];\n const outputs = this.outputs?.map(outputify) ?? [];\n const witnesses = this.witnesses?.map(witnessify) ?? [];\n\n const { policyTypes, policies } = BaseTransactionRequest.getPolicyMeta(this);\n\n return {\n policyTypes,\n inputs,\n outputs,\n policies,\n witnesses,\n inputsCount: inputs.length,\n outputsCount: outputs.length,\n witnessesCount: witnesses.length,\n };\n }\n\n abstract toTransaction():\n | TransactionCreate\n | TransactionScript\n | TransactionBlob\n | TransactionUpgrade\n | TransactionUpload;\n\n /**\n * Converts the transaction request to a byte array.\n *\n * @returns The transaction bytes.\n */\n toTransactionBytes(): Uint8Array {\n return new TransactionCoder().encode(this.toTransaction());\n }\n\n /**\n * @hidden\n *\n * Pushes an input to the list without any side effects and returns the index\n */\n protected pushInput(input: TransactionRequestInput): number {\n this.inputs.push(input);\n return this.inputs.length - 1;\n }\n\n /**\n * @hidden\n *\n * Pushes an output to the list without any side effects and returns the index\n */\n protected pushOutput(output: TransactionRequestOutput): number {\n this.outputs.push(output);\n return this.outputs.length - 1;\n }\n\n /**\n * @hidden\n *\n * Pushes a witness to the list and returns the index\n *\n * @param signature - The signature to add to the witness.\n * @returns The index of the created witness.\n */\n addWitness(signature: BytesLike) {\n this.witnesses.push(signature);\n return this.witnesses.length - 1;\n }\n\n /**\n * @hidden\n *\n * Creates an empty witness without any side effects and returns the index\n *\n * @returns The index of the created witness.\n */\n addEmptyWitness(): number {\n // Push a dummy witness with same byte size as a real witness signature\n this.addWitness(concat([ZeroBytes32, ZeroBytes32]));\n return this.witnesses.length - 1;\n }\n\n /**\n * Updates the witness for a given owner and signature.\n *\n * @param address - The address to get the coin input witness index for.\n * @param signature - The signature to update the witness with.\n */\n updateWitnessByOwner(address: AddressInput, signature: BytesLike) {\n const ownerAddress = new Address(address);\n const witnessIndex = this.getCoinInputWitnessIndexByOwner(ownerAddress);\n if (typeof witnessIndex === 'number') {\n this.updateWitness(witnessIndex, signature);\n }\n }\n\n /**\n * Updates an existing witness without any side effects.\n *\n * @param index - The index of the witness to update.\n * @param witness - The new witness.\n * @throws If the witness does not exist.\n */\n updateWitness(index: number, witness: TransactionRequestWitness) {\n if (!this.witnesses[index]) {\n throw new NoWitnessAtIndexError(index);\n }\n this.witnesses[index] = witness;\n }\n\n /**\n * Helper function to add an external signature to the transaction.\n *\n * @param account - The account/s to sign to the transaction.\n * @returns The transaction with the signature witness added.\n */\n async addAccountWitnesses(account: Account | Account[]) {\n const accounts = Array.isArray(account) ? account : [account];\n await Promise.all(\n accounts.map(async (acc) => {\n this.addWitness(await acc.signTransaction(<TransactionRequestLike>this));\n })\n );\n\n return this;\n }\n\n /**\n * Gets the coin inputs for a transaction.\n *\n * @returns The coin inputs.\n */\n getCoinInputs(): CoinTransactionRequestInput[] {\n return this.inputs.filter(\n (input): input is CoinTransactionRequestInput => input.type === InputType.Coin\n );\n }\n\n /**\n * Gets the coin outputs for a transaction.\n *\n * @returns The coin outputs.\n */\n getCoinOutputs(): CoinTransactionRequestOutput[] {\n return this.outputs.filter(\n (output): output is CoinTransactionRequestOutput => output.type === OutputType.Coin\n );\n }\n\n /**\n * Gets the change outputs for a transaction.\n *\n * @returns The change outputs.\n */\n getChangeOutputs(): ChangeTransactionRequestOutput[] {\n return this.outputs.filter(\n (output): output is ChangeTransactionRequestOutput => output.type === OutputType.Change\n );\n }\n\n /**\n * @hidden\n *\n * Returns the witnessIndex of the found CoinInput.\n */\n getCoinInputWitnessIndexByOwner(owner: AddressLike): number | undefined {\n const ownerAddress = addressify(owner);\n\n const found = this.inputs.find((input) => {\n switch (input.type) {\n case InputType.Coin:\n return hexlify((<CoinTransactionRequestInput>input).owner) === ownerAddress.toB256();\n case InputType.Message:\n return (\n hexlify((<MessageTransactionRequestInput>input).recipient) === ownerAddress.toB256()\n );\n default:\n return false;\n }\n });\n\n return (<CoinTransactionRequestInput>found)?.witnessIndex;\n }\n\n /**\n * Adds a single coin input to the transaction and a change output for the related\n * assetId, if one it was not added yet.\n *\n * @param coin - Coin resource.\n */\n addCoinInput(coin: Coin) {\n const { assetId, owner, amount, id, predicate, predicateData } = coin;\n\n let witnessIndex;\n\n if (coin.predicate) {\n witnessIndex = 0;\n } else {\n witnessIndex = this.getCoinInputWitnessIndexByOwner(owner);\n\n // Insert a dummy witness if no witness exists\n if (typeof witnessIndex !== 'number') {\n witnessIndex = this.addEmptyWitness();\n }\n }\n\n const input: CoinTransactionRequestInput = {\n id,\n type: InputType.Coin,\n owner: owner.toB256(),\n amount,\n assetId,\n txPointer: '0x00000000000000000000000000000000',\n witnessIndex,\n predicate,\n predicateData,\n };\n\n // Insert the Input\n this.pushInput(input);\n\n // Insert a ChangeOutput if it does not exist\n this.addChangeOutput(owner, assetId);\n }\n\n /**\n * Adds a single message input to the transaction and a change output for the\n * asset against the message\n *\n * @param message - Message resource.\n */\n addMessageInput(message: Message | MessageCoin) {\n const { recipient, sender, amount, predicate, nonce, predicateData } = message;\n\n let witnessIndex;\n\n if (message.predicate) {\n witnessIndex = 0;\n } else {\n witnessIndex = this.getCoinInputWitnessIndexByOwner(recipient);\n\n // Insert a dummy witness if no witness exists\n if (typeof witnessIndex !== 'number') {\n witnessIndex = this.addEmptyWitness();\n }\n }\n\n const input: MessageTransactionRequestInput = {\n nonce,\n type: InputType.Message,\n sender: sender.toB256(),\n recipient: recipient.toB256(),\n data: isMessageCoin(message) ? '0x' : message.data,\n amount,\n witnessIndex,\n predicate,\n predicateData,\n };\n\n // Insert the Input\n this.pushInput(input);\n\n // Insert a ChangeOutput if it does not exist\n if (isMessageCoin(message)) {\n this.addChangeOutput(recipient, message.assetId);\n }\n }\n\n /**\n * Adds a single resource to the transaction by adding a coin/message input and a\n * change output for the related assetId, if one it was not added yet.\n *\n * @param resource - The resource to add.\n * @returns This transaction.\n */\n addResource(resource: Resource) {\n if (isCoin(resource)) {\n this.addCoinInput(resource);\n } else {\n this.addMessageInput(resource);\n }\n\n return this;\n }\n\n /**\n * Adds multiple resources to the transaction by adding coin/message inputs and change\n * outputs from the related assetIds.\n *\n * @param resources - The resources to add.\n * @returns This transaction.\n */\n addResources(resources: ReadonlyArray<Resource>) {\n resources.forEach((resource) => this.addResource(resource));\n\n return this;\n }\n\n /**\n * Adds a coin output to the transaction.\n *\n * @param to - Address of the owner.\n * @param amount - Amount of coin.\n * @param assetId - Asset ID of coin.\n */\n addCoinOutput(to: AddressLike, amount: BigNumberish, assetId: BytesLike) {\n this.pushOutput({\n type: OutputType.Coin,\n to: addressify(to).toB256(),\n amount,\n assetId,\n });\n\n return this;\n }\n\n /**\n * Adds multiple coin outputs to the transaction.\n *\n * @param to - Address of the destination.\n * @param quantities - Quantities of coins.\n */\n addCoinOutputs(to: AddressLike, quantities: CoinQuantityLike[]) {\n quantities.map(coinQuantityfy).forEach((quantity) => {\n this.pushOutput({\n type: OutputType.Coin,\n to: addressify(to).toB256(),\n amount: quantity.amount,\n assetId: quantity.assetId,\n });\n });\n\n return this;\n }\n\n /**\n * Adds a change output to the transaction.\n *\n * @param to - Address of the owner.\n * @param assetId - Asset ID of coin.\n */\n addChangeOutput(to: AddressLike, assetId: BytesLike) {\n // Find the ChangeOutput for the AssetId of the Resource\n const changeOutput = this.getChangeOutputs().find(\n (output) => hexlify(output.assetId) === assetId\n );\n\n // Insert a ChangeOutput if it does not exist\n if (!changeOutput) {\n this.pushOutput({\n type: OutputType.Change,\n to: addressify(to).toB256(),\n assetId,\n });\n }\n }\n\n /**\n * @hidden\n */\n byteSize() {\n return this.toTransactionBytes().length;\n }\n\n /**\n * @hidden\n */\n metadataGas(_gasCosts: GasCosts): BN {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Not implemented');\n }\n\n /**\n * @hidden\n */\n calculateMinGas(chainInfo: ChainInfo): BN {\n const { consensusParameters } = chainInfo;\n const {\n gasCosts,\n feeParameters: { gasPerByte },\n } = consensusParameters;\n return getMinGas({\n gasPerByte,\n gasCosts,\n inputs: this.inputs,\n txBytesSize: this.byteSize(),\n metadataGas: this.metadataGas(gasCosts),\n });\n }\n\n calculateMaxGas(chainInfo: ChainInfo, minGas: BN): BN {\n const { consensusParameters } = chainInfo;\n const {\n feeParameters: { gasPerByte },\n txParameters: { maxGasPerTx },\n } = consensusParameters;\n\n const witnessesLength = this.toTransaction().witnesses.reduce(\n (acc, wit) => acc + wit.dataLength,\n 0\n );\n return getMaxGas({\n gasPerByte,\n minGas,\n witnessesLength,\n witnessLimit: this.witnessLimit,\n maxGasPerTx,\n });\n }\n\n /**\n * Funds the transaction with fake UTXOs for each assetId and amount in the\n * quantities array.\n *\n * @param quantities - CoinQuantity Array.\n * @param baseAssetId - The base asset to fund the transaction.\n * @deprecated - This method is deprecated and will be removed in future versions.\n * Please use `Account.generateFakeResources` along with `this.addResources` instead.\n */\n fundWithFakeUtxos(quantities: CoinQuantity[], baseAssetId: string, resourcesOwner?: Address) {\n const findAssetInput = (assetId: string) =>\n this.inputs.find((input) => {\n if ('assetId' in input) {\n return input.assetId === assetId;\n }\n return false;\n });\n\n const updateAssetInput = (assetId: string, quantity: BN) => {\n const assetInput = findAssetInput(assetId);\n\n let usedQuantity = quantity;\n\n if (assetId === baseAssetId) {\n usedQuantity = bn('1000000000000000000');\n }\n\n if (assetInput && 'assetId' in assetInput) {\n assetInput.id = hexlify(randomBytes(UTXO_ID_LEN));\n assetInput.amount = usedQuantity;\n } else {\n this.addResources([\n {\n id: hexlify(randomBytes(UTXO_ID_LEN)),\n amount: usedQuantity,\n assetId,\n owner: resourcesOwner || Address.fromRandom(),\n blockCreated: bn(1),\n txCreatedIdx: bn(1),\n },\n ]);\n }\n };\n\n updateAssetInput(baseAssetId, bn(100_000_000_000));\n quantities.forEach((q) => updateAssetInput(q.assetId, q.amount));\n\n return this;\n }\n\n /**\n * Retrieves an array of CoinQuantity for each coin output present in the transaction.\n * a transaction.\n *\n * @returns CoinQuantity array.\n */\n getCoinOutputsQuantities(): CoinQuantity[] {\n const coinsQuantities = this.getCoinOutputs().map(({ amount, assetId }) => ({\n amount: bn(amount),\n assetId: assetId.toString(),\n }));\n\n return coinsQuantities;\n }\n\n /**\n * Gets the Transaction Request by hashing the transaction.\n *\n * @param chainId - The chain ID.\n *\n * @returns - A hash of the transaction, which is the transaction ID.\n */\n abstract getTransactionId(chainId: number): string;\n\n /**\n * Return the minimum amount in native coins required to create\n * a transaction.\n *\n * @returns The transaction as a JSON object.\n */\n toJSON() {\n return normalizeJSON(this);\n }\n\n removeWitness(index: number) {\n this.witnesses.splice(index, 1);\n this.adjustWitnessIndexes(index);\n }\n\n private adjustWitnessIndexes(removedIndex: number) {\n this.inputs.filter(isRequestInputResource).forEach((input) => {\n if (input.witnessIndex > removedIndex) {\n // eslint-disable-next-line no-param-reassign\n input.witnessIndex -= 1;\n }\n });\n }\n\n updatePredicateGasUsed(inputs: TransactionRequestInput[]) {\n const inputsToExtractGasUsed = inputs.filter(isRequestInputCoinOrMessage);\n\n this.inputs.filter(isRequestInputResource).forEach((i) => {\n const owner = getRequestInputResourceOwner(i);\n const correspondingInput = inputsToExtractGasUsed.find((x) =>\n isRequestInputResourceFromOwner(x, new Address(String(owner)))\n );\n\n if (\n correspondingInput &&\n 'predicateGasUsed' in correspondingInput &&\n bn(correspondingInput.predicateGasUsed).gt(0)\n ) {\n // eslint-disable-next-line no-param-reassign\n i.predicateGasUsed = correspondingInput.predicateGasUsed;\n }\n });\n }\n\n byteLength(): number {\n return this.toTransactionBytes().byteLength;\n }\n}\n","import type { Address } from '@fuel-ts/address';\nimport type { BN } from '@fuel-ts/math';\nimport type { BytesLike } from '@fuel-ts/utils';\n\nimport type { GqlMessageState } from './__generated__/operations';\n\n// #region Message-shape\n/**\n * A Fuel message\n */\nexport type Message = {\n messageId: BytesLike;\n sender: Address;\n recipient: Address;\n nonce: BytesLike;\n amount: BN;\n data: BytesLike;\n daHeight: BN;\n predicate?: BytesLike;\n predicateData?: BytesLike;\n};\n// #endregion Message-shape\n\nexport type MessageCoin = {\n assetId: string;\n sender: Address;\n recipient: Address;\n nonce: BytesLike;\n amount: BN;\n daHeight: BN;\n predicate?: BytesLike;\n predicateData?: BytesLike;\n};\n\nexport type MerkleProof = {\n proofSet: Array<string>;\n proofIndex: BN;\n};\n\nexport type BlockHeader = {\n id: string;\n daHeight: BN;\n transactionsCount: number;\n transactionsRoot: string;\n height: BN;\n prevRoot: string;\n time: string;\n applicationHash: string;\n messageOutboxRoot: string;\n eventInboxRoot: string;\n consensusParametersVersion: number;\n stateTransitionBytecodeVersion: number;\n messageReceiptCount: number;\n};\n\n/**\n * Message Proof\n */\nexport type MessageProof = {\n messageProof: MerkleProof;\n blockProof: MerkleProof;\n messageBlockHeader: BlockHeader;\n commitBlockHeader: BlockHeader;\n sender: Address;\n recipient: Address;\n nonce: string;\n amount: BN;\n data: string;\n};\n\n/**\n * Message Status\n */\nexport type MessageStatus = {\n state: GqlMessageState;\n};\n\nexport const isMessageCoin = (message: Message | MessageCoin): message is MessageCoin =>\n !('data' in message);\n","import type { BytesLike } from '@fuel-ts/utils';\n\nimport type { Coin } from './coin';\nimport type { MessageCoin } from './message';\n\nexport type RawCoin = {\n utxoId: string;\n owner: string;\n amount: string;\n assetId: string;\n blockCreated: string;\n txCreatedIdx: string;\n};\n\nexport type RawMessage = {\n amount: string;\n sender: string;\n assetId: string;\n recipient: string;\n data: string;\n nonce: string;\n daHeight: string;\n};\n\nexport type RawResource = RawCoin | RawMessage;\nexport type Resource = Coin | MessageCoin;\n\n/** @hidden */\nexport type ExcludeResourcesOption = {\n utxos?: BytesLike[];\n messages?: BytesLike[];\n};\n\n/** @hidden */\nexport const isRawCoin = (resource: RawResource): resource is RawCoin => 'utxoId' in resource;\n/** @hidden */\nexport const isRawMessage = (resource: RawResource): resource is RawMessage =>\n 'recipient' in resource;\n/** @hidden */\nexport const isCoin = (resource: Resource): resource is Coin => 'id' in resource;\n/** @hidden */\nexport const isMessage = (resource: Resource): resource is MessageCoin => 'recipient' in resource;\n","import { ZeroBytes32 } from '@fuel-ts/address/configs';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { bn } from '@fuel-ts/math';\nimport type {\n ReceiptBurn,\n ReceiptCall,\n ReceiptLog,\n ReceiptLogData,\n ReceiptMessageOut,\n ReceiptMint,\n ReceiptPanic,\n ReceiptReturn,\n ReceiptReturnData,\n ReceiptRevert,\n ReceiptScriptResult,\n ReceiptTransfer,\n ReceiptTransferOut,\n} from '@fuel-ts/transactions';\nimport { getMintedAssetId, InputMessageCoder, ReceiptType } from '@fuel-ts/transactions';\nimport { FAILED_TRANSFER_TO_ADDRESS_SIGNAL } from '@fuel-ts/transactions/configs';\nimport { arrayify, hexlify } from '@fuel-ts/utils';\n\nimport type { GqlReceiptFragment } from '../__generated__/operations';\nimport { GqlReceiptType } from '../__generated__/operations';\nimport type { TransactionResultReceipt } from '../transaction-response';\n\n/** @hidden */\nconst doesReceiptHaveMissingOutputVariables = (\n receipt: TransactionResultReceipt\n): receipt is ReceiptRevert =>\n receipt.type === ReceiptType.Revert &&\n receipt.val.toString('hex') === FAILED_TRANSFER_TO_ADDRESS_SIGNAL;\n\n/** @hidden */\nconst doesReceiptHaveMissingContractId = (\n receipt: TransactionResultReceipt\n): receipt is ReceiptPanic =>\n receipt.type === ReceiptType.Panic &&\n receipt.contractId !== '0x0000000000000000000000000000000000000000000000000000000000000000';\n\n/** @hidden */\nexport const getReceiptsWithMissingData = (receipts: Array<TransactionResultReceipt>) =>\n receipts.reduce<{\n missingOutputVariables: Array<ReceiptRevert>;\n missingOutputContractIds: Array<ReceiptPanic>;\n }>(\n (memo, receipt) => {\n if (doesReceiptHaveMissingOutputVariables(receipt)) {\n memo.missingOutputVariables.push(receipt);\n }\n if (doesReceiptHaveMissingContractId(receipt)) {\n memo.missingOutputContractIds.push(receipt);\n }\n return memo;\n },\n {\n missingOutputVariables: [],\n missingOutputContractIds: [],\n }\n );\n\nconst hexOrZero = (hex?: string | null) => hex || ZeroBytes32;\n\nexport function assembleReceiptByType(receipt: GqlReceiptFragment) {\n const { receiptType } = receipt;\n\n switch (receiptType) {\n case GqlReceiptType.Call: {\n const id = hexOrZero(receipt.id || receipt.contractId);\n const callReceipt: ReceiptCall = {\n type: ReceiptType.Call,\n id,\n to: hexOrZero(receipt?.to),\n amount: bn(receipt.amount),\n assetId: hexOrZero(receipt.assetId),\n gas: bn(receipt.gas),\n param1: bn(receipt.param1),\n param2: bn(receipt.param2),\n pc: bn(receipt.pc),\n is: bn(receipt.is),\n };\n\n return callReceipt;\n }\n\n case GqlReceiptType.Return: {\n const returnReceipt: ReceiptReturn = {\n type: ReceiptType.Return,\n id: hexOrZero(receipt.id || receipt.contractId),\n val: bn(receipt.val),\n pc: bn(receipt.pc),\n is: bn(receipt.is),\n };\n\n return returnReceipt;\n }\n\n case GqlReceiptType.ReturnData: {\n const returnDataReceipt: ReceiptReturnData = {\n type: ReceiptType.ReturnData,\n id: hexOrZero(receipt.id || receipt.contractId),\n ptr: bn(receipt.ptr),\n len: bn(receipt.len),\n digest: hexOrZero(receipt.digest),\n pc: bn(receipt.pc),\n data: hexOrZero(receipt.data),\n is: bn(receipt.is),\n };\n\n return returnDataReceipt;\n }\n\n case GqlReceiptType.Panic: {\n const panicReceipt: ReceiptPanic = {\n type: ReceiptType.Panic,\n id: hexOrZero(receipt.id),\n reason: bn(receipt.reason),\n pc: bn(receipt.pc),\n is: bn(receipt.is),\n contractId: hexOrZero(receipt.contractId),\n };\n\n return panicReceipt;\n }\n\n case GqlReceiptType.Revert: {\n const revertReceipt: ReceiptRevert = {\n type: ReceiptType.Revert,\n id: hexOrZero(receipt.id || receipt.contractId),\n val: bn(receipt.ra),\n pc: bn(receipt.pc),\n is: bn(receipt.is),\n };\n return revertReceipt;\n }\n\n case GqlReceiptType.Log: {\n const ra = bn(receipt.ra);\n const rb = bn(receipt.rb);\n const rc = bn(receipt.rc);\n const rd = bn(receipt.rd);\n\n const logReceipt: ReceiptLog = {\n type: ReceiptType.Log,\n id: hexOrZero(receipt.id || receipt.contractId),\n ra,\n rb,\n rc,\n rd,\n pc: bn(receipt.pc),\n is: bn(receipt.is),\n };\n\n return logReceipt;\n }\n\n case GqlReceiptType.LogData: {\n const ra = bn(receipt.ra);\n const rb = bn(receipt.rb);\n const logDataReceipt: ReceiptLogData = {\n type: ReceiptType.LogData,\n id: hexOrZero(receipt.id || receipt.contractId),\n ra,\n rb,\n ptr: bn(receipt.ptr),\n len: bn(receipt.len),\n digest: hexOrZero(receipt.digest),\n pc: bn(receipt.pc),\n data: hexOrZero(receipt.data),\n is: bn(receipt.is),\n };\n return logDataReceipt;\n }\n\n case GqlReceiptType.Transfer: {\n const id = hexOrZero(receipt.id || receipt.contractId);\n const transferReceipt: ReceiptTransfer = {\n type: ReceiptType.Transfer,\n id,\n to: hexOrZero(receipt.toAddress || receipt?.to),\n amount: bn(receipt.amount),\n assetId: hexOrZero(receipt.assetId),\n pc: bn(receipt.pc),\n is: bn(receipt.is),\n };\n\n return transferReceipt;\n }\n\n case GqlReceiptType.TransferOut: {\n const id = hexOrZero(receipt.id || receipt.contractId);\n const transferOutReceipt: ReceiptTransferOut = {\n type: ReceiptType.TransferOut,\n id,\n to: hexOrZero(receipt.toAddress || receipt.to),\n amount: bn(receipt.amount),\n assetId: hexOrZero(receipt.assetId),\n pc: bn(receipt.pc),\n is: bn(receipt.is),\n };\n return transferOutReceipt;\n }\n\n case GqlReceiptType.ScriptResult: {\n const scriptResultReceipt: ReceiptScriptResult = {\n type: ReceiptType.ScriptResult,\n result: bn(receipt.result),\n gasUsed: bn(receipt.gasUsed),\n };\n\n return scriptResultReceipt;\n }\n\n case GqlReceiptType.MessageOut: {\n const sender = hexOrZero(receipt.sender);\n const recipient = hexOrZero(receipt.recipient);\n const nonce = hexOrZero(receipt.nonce);\n const amount = bn(receipt.amount);\n const data = receipt.data ? arrayify(receipt.data) : Uint8Array.from([]);\n const digest = hexOrZero(receipt.digest);\n const len = bn(receipt.len).toNumber();\n\n const messageId = InputMessageCoder.getMessageId({\n sender,\n recipient,\n nonce,\n amount,\n data: hexlify(data),\n });\n\n const receiptMessageOut: ReceiptMessageOut = {\n type: ReceiptType.MessageOut,\n sender,\n recipient,\n amount,\n nonce,\n len,\n data,\n digest,\n messageId,\n };\n\n return receiptMessageOut;\n }\n\n case GqlReceiptType.Mint: {\n const contractId = hexOrZero(receipt.id || receipt.contractId);\n const subId = hexOrZero(receipt.subId);\n const assetId = getMintedAssetId(contractId, subId);\n\n const mintReceipt: ReceiptMint = {\n type: ReceiptType.Mint,\n subId,\n contractId,\n assetId,\n val: bn(receipt.val),\n pc: bn(receipt.pc),\n is: bn(receipt.is),\n };\n\n return mintReceipt;\n }\n\n case GqlReceiptType.Burn: {\n const contractId = hexOrZero(receipt.id || receipt.contractId);\n const subId = hexOrZero(receipt.subId);\n const assetId = getMintedAssetId(contractId, subId);\n\n const burnReceipt: ReceiptBurn = {\n type: ReceiptType.Burn,\n subId,\n contractId,\n assetId,\n val: bn(receipt.val),\n pc: bn(receipt.pc),\n is: bn(receipt.is),\n };\n\n return burnReceipt;\n }\n\n default:\n throw new FuelError(ErrorCode.INVALID_RECEIPT_TYPE, `Invalid receipt type: ${receiptType}.`);\n }\n}\n","import { ErrorCode, FuelError } from '@fuel-ts/errors';\n\nconst DEFAULT_BLOCK_EXPLORER_URL = 'https://app.fuel.network';\n\n/** @hidden */\nconst getPathFromInput = (\n key: BuildBlockExplorerUrlHelperParam,\n value: string | number | undefined\n) => {\n const pathMap = {\n address: `address`,\n txId: `transaction`,\n blockNumber: `block`,\n };\n const path = pathMap[key] || key;\n return `${path}/${value}`;\n};\n\ntype BuildBlockExplorerUrlHelperParam = 'address' | 'txId' | 'blockNumber';\n\n/**\n * @hidden\n *\n * Builds a block explorer url based on and the given path, block explorer URL and provider URL\n */\nexport const buildBlockExplorerUrl = (\n options: {\n blockExplorerUrl?: string;\n path?: string;\n providerUrl?: string;\n address?: string;\n txId?: string;\n blockNumber?: number;\n } = {}\n) => {\n const { blockExplorerUrl, path, providerUrl, address, txId, blockNumber } = options;\n const explorerUrl = blockExplorerUrl || DEFAULT_BLOCK_EXPLORER_URL;\n\n // make sure that only ONE or none of the following is defined: address, txId, blockNumber\n const customInputParams = [\n {\n key: 'address',\n value: address,\n },\n {\n key: 'txId',\n value: txId,\n },\n {\n key: 'blockNumber',\n value: blockNumber,\n },\n ];\n\n const definedValues = customInputParams\n .filter((param) => !!param.value)\n .map(({ key, value }) => ({\n key,\n value,\n }));\n\n const hasAnyDefinedValues = definedValues.length > 0;\n\n if (definedValues.length > 1) {\n throw new FuelError(\n ErrorCode.ERROR_BUILDING_BLOCK_EXPLORER_URL,\n `Only one of the following can be passed in to buildBlockExplorerUrl: ${customInputParams\n .map((param) => param.key)\n .join(', ')}.`\n );\n }\n\n if (path && definedValues.length > 0) {\n const inputKeys = customInputParams.map(({ key }) => key).join(', ');\n throw new FuelError(\n ErrorCode.ERROR_BUILDING_BLOCK_EXPLORER_URL,\n `You cannot pass in a path to 'buildBlockExplorerUrl' along with any of the following: ${inputKeys}.`\n );\n }\n\n const pathGeneratedFromInputParams = hasAnyDefinedValues\n ? getPathFromInput(\n definedValues[0].key as BuildBlockExplorerUrlHelperParam,\n definedValues[0].value\n )\n : '';\n\n // Remove leading and trailing slashes from the path and block explorer url respectively, if present\n const trimSlashes = /^\\/|\\/$/gm;\n const cleanPath = path ? path.replace(trimSlashes, '') : pathGeneratedFromInputParams;\n const cleanBlockExplorerUrl = explorerUrl.replace(trimSlashes, '');\n const cleanProviderUrl = providerUrl?.replace(trimSlashes, '');\n const encodedProviderUrl = cleanProviderUrl ? encodeURIComponent(cleanProviderUrl) : undefined;\n\n // if the block explorer url doesn't have a protocol i.e. http:// or https://, add https://\n const protocol = cleanBlockExplorerUrl.match(/^https?:\\/\\//) ? '' : 'https://';\n const providerUrlProtocol = cleanProviderUrl?.match(/^https?:\\/\\//) ? '' : 'https://';\n\n const url = `${protocol}${cleanBlockExplorerUrl}/${cleanPath}${\n encodedProviderUrl ? `?providerUrl=${providerUrlProtocol}${encodedProviderUrl}` : ''\n }`;\n\n return url;\n};\n","import { bn } from '@fuel-ts/math';\nimport type { BN, BNInput } from '@fuel-ts/math';\nimport { ReceiptType, type Input } from '@fuel-ts/transactions';\nimport { arrayify } from '@fuel-ts/utils';\n\nimport type {\n GqlDependentCost,\n GqlHeavyOperation,\n GqlLightOperation,\n} from '../__generated__/operations';\nimport type { GasCosts } from '../provider';\nimport type { TransactionRequestInput } from '../transaction-request';\nimport type {\n TransactionResultReceipt,\n TransactionResultScriptResultReceipt,\n} from '../transaction-response';\n\n/** @hidden */\nexport const getGasUsedFromReceipts = (receipts: Array<TransactionResultReceipt>): BN => {\n const scriptResult = receipts.filter(\n (receipt) => receipt.type === ReceiptType.ScriptResult\n ) as TransactionResultScriptResultReceipt[];\n\n const gasUsed = scriptResult.reduce((prev, receipt) => prev.add(receipt.gasUsed), bn(0));\n\n return gasUsed;\n};\n\nexport function resolveGasDependentCosts(byteSize: BNInput, gasDependentCost: GqlDependentCost) {\n const base = bn(gasDependentCost.base);\n let dependentValue = bn(0);\n if ('unitsPerGas' in gasDependentCost) {\n dependentValue = bn(byteSize).div(bn((<GqlLightOperation>gasDependentCost).unitsPerGas));\n } else {\n dependentValue = bn(byteSize).mul(bn((<GqlHeavyOperation>gasDependentCost).gasPerUnit));\n }\n return base.add(dependentValue);\n}\n\nexport function gasUsedByInputs(\n inputs: Array<TransactionRequestInput | Input>,\n txBytesSize: number,\n gasCosts: GasCosts\n) {\n const witnessCache: Array<number> = [];\n\n const chargeableInputs = inputs.filter((input) => {\n const isCoinOrMessage = 'owner' in input || 'sender' in input;\n if (isCoinOrMessage) {\n if ('predicate' in input && input.predicate && input.predicate !== '0x') {\n return true;\n }\n\n if (!witnessCache.includes(input.witnessIndex)) {\n // should charge only once for each witness\n witnessCache.push(input.witnessIndex);\n return true;\n }\n }\n return false;\n });\n\n const vmInitializationCost = resolveGasDependentCosts(txBytesSize, gasCosts.vmInitialization);\n\n const totalGas = chargeableInputs.reduce((total, input) => {\n if ('predicate' in input && input.predicate && input.predicate !== '0x') {\n return total.add(\n vmInitializationCost\n .add(resolveGasDependentCosts(arrayify(input.predicate).length, gasCosts.contractRoot))\n .add(bn(input.predicateGasUsed))\n );\n }\n\n return total.add(gasCosts.ecr1);\n }, bn(0));\n // Never allow gas to exceed MAX_U64\n return totalGas;\n}\n\nexport interface IGetMinGasParams {\n inputs: Array<TransactionRequestInput | Input>;\n gasCosts: GasCosts;\n txBytesSize: number;\n metadataGas: BN;\n gasPerByte: BN;\n}\n\nexport function getMinGas(params: IGetMinGasParams) {\n const { gasCosts, gasPerByte, inputs, metadataGas, txBytesSize } = params;\n\n const vmInitGas = resolveGasDependentCosts(txBytesSize, gasCosts.vmInitialization);\n const bytesGas = bn(txBytesSize).mul(gasPerByte);\n const inputsGas = gasUsedByInputs(inputs, txBytesSize, gasCosts);\n\n const minGas = vmInitGas.add(bytesGas).add(inputsGas).add(metadataGas).maxU64();\n\n return minGas;\n}\n\nexport interface IGetMaxGasParams {\n witnessesLength: number;\n witnessLimit?: BN;\n gasPerByte: BN;\n minGas: BN;\n gasLimit?: BN;\n blobSize?: BN;\n maxGasPerTx: BN;\n}\n\nexport function getMaxGas(params: IGetMaxGasParams) {\n const {\n gasPerByte,\n witnessesLength,\n witnessLimit,\n minGas,\n gasLimit = bn(0),\n maxGasPerTx,\n } = params;\n\n let remainingAllowedWitnessGas = bn(0);\n\n if (witnessLimit?.gt(0) && witnessLimit.gte(witnessesLength)) {\n remainingAllowedWitnessGas = bn(witnessLimit).sub(witnessesLength).mul(gasPerByte);\n }\n\n const maxGas = remainingAllowedWitnessGas.add(minGas).add(gasLimit);\n\n return maxGas.gte(maxGasPerTx) ? maxGasPerTx : maxGas;\n}\n\nexport function calculateMetadataGasForTxCreate({\n gasCosts,\n stateRootSize,\n txBytesSize,\n contractBytesSize,\n}: {\n gasCosts: GasCosts;\n contractBytesSize: BN;\n stateRootSize: number;\n txBytesSize: number;\n}) {\n const contractRootGas = resolveGasDependentCosts(contractBytesSize, gasCosts.contractRoot);\n const stateRootGas = resolveGasDependentCosts(stateRootSize, gasCosts.stateRoot);\n const txIdGas = resolveGasDependentCosts(txBytesSize, gasCosts.s256);\n // See https://github.com/FuelLabs/fuel-specs/blob/master/src/identifiers/contract-id.md\n const contractIdInputSize = bn(4 + 32 + 32 + 32);\n const contractIdGas = resolveGasDependentCosts(contractIdInputSize, gasCosts.s256);\n const metadataGas = contractRootGas.add(stateRootGas).add(txIdGas).add(contractIdGas);\n return metadataGas.maxU64();\n}\n\nexport function calculateMetadataGasForTxScript({\n gasCosts,\n txBytesSize,\n}: {\n gasCosts: GasCosts;\n txBytesSize: number;\n}) {\n return resolveGasDependentCosts(txBytesSize, gasCosts.s256);\n}\n\nexport function calculateMetadataGasForTxBlob({\n gasCosts,\n txBytesSize,\n witnessBytesSize,\n}: {\n gasCosts: GasCosts;\n txBytesSize: number;\n witnessBytesSize: number;\n}) {\n const txId = resolveGasDependentCosts(txBytesSize, gasCosts.s256);\n const blobLen = resolveGasDependentCosts(witnessBytesSize, gasCosts.s256);\n return txId.add(blobLen);\n}\n\nexport function calculateMetadataGasForTxUpgrade({\n gasCosts,\n txBytesSize,\n consensusSize,\n}: {\n gasCosts: GasCosts;\n txBytesSize: number;\n consensusSize?: number;\n}) {\n const txId = resolveGasDependentCosts(txBytesSize, gasCosts.s256);\n\n if (consensusSize) {\n const consensusLen = resolveGasDependentCosts(consensusSize, gasCosts.s256);\n txId.add(consensusLen);\n }\n\n return txId;\n}\n\nexport function calculateMetadataGasForTxUpload({\n gasCosts,\n txBytesSize,\n subsectionSize,\n subsectionsSize,\n}: {\n gasCosts: GasCosts;\n txBytesSize: number;\n subsectionSize: number;\n subsectionsSize: number;\n}) {\n const txId = resolveGasDependentCosts(txBytesSize, gasCosts.s256);\n\n const subsectionLen = resolveGasDependentCosts(subsectionSize, gasCosts.s256);\n txId.add(subsectionLen);\n\n const subsectionsLen = resolveGasDependentCosts(subsectionsSize, gasCosts.stateRoot);\n txId.add(subsectionsLen);\n\n return txId;\n}\n\nexport function calculateMinGasForTxUpload({\n gasCosts,\n baseMinGas,\n subsectionSize,\n}: {\n gasCosts: GasCosts;\n baseMinGas: number;\n subsectionSize: number;\n}) {\n // Since the `Upload` transaction occupies much of the storage, we want to\n // discourage people from using it too much. For that, we charge additional gas\n // for the storage.\n // https://github.com/FuelLabs/fuel-vm/blob/6e137db6387bd291b9505d17e15e0f2edda7957e/fuel-tx/src/transaction/types/upload.rs#L135-L150\n const additionalStoragePerByte = bn(gasCosts.newStoragePerByte).mul(subsectionSize);\n return bn(baseMinGas).add(additionalStoragePerByte);\n}\n\nexport interface CalculateGasFeeParams {\n tip?: BN;\n gas: BN;\n gasPrice: BN;\n priceFactor: BN;\n}\n\nexport const calculateGasFee = (params: CalculateGasFeeParams) => {\n const { gas, gasPrice, priceFactor, tip } = params;\n return gas.mul(gasPrice).div(priceFactor).add(bn(tip));\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable no-param-reassign */\nimport { hexlify } from '@fuel-ts/utils';\nimport { clone } from 'ramda';\n\n// When parsing a Transaction to JSON we need\n// to convert special types into each respective\n// JSON friendly value. This enables a tx to be\n// stringified and parsed back into a Transaction\n/** @hidden */\nfunction normalize(object: any) {\n Object.keys(object).forEach((key) => {\n switch (object[key]?.constructor.name) {\n case 'Uint8Array':\n object[key] = hexlify(object[key]);\n break;\n case 'Array':\n object[key] = normalize(object[key]);\n break;\n case 'BN':\n object[key] = object[key].toHex();\n break;\n case 'Address':\n object[key] = object[key].toB256();\n break;\n case 'Object':\n object[key] = normalize(object[key]);\n break;\n default:\n break;\n }\n });\n return object;\n}\n\n/**\n * Stringify Transaction to a JSON object\n * compatible with the Transaction class constructor.\n */\n/** @hidden */\nexport function normalizeJSON(root: any) {\n // Do a single deep clone before normalizing\n // to avoid mutating the original object\n // and doing extra clones on each iteration\n return normalize(clone(root));\n}\n","import { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { bn } from '@fuel-ts/math';\nimport type { ReceiptRevert } from '@fuel-ts/transactions';\nimport { ReceiptType } from '@fuel-ts/transactions';\nimport {\n FAILED_REQUIRE_SIGNAL,\n FAILED_ASSERT_EQ_SIGNAL,\n FAILED_ASSERT_NE_SIGNAL,\n FAILED_ASSERT_SIGNAL,\n FAILED_TRANSFER_TO_ADDRESS_SIGNAL,\n PANIC_REASONS,\n PANIC_DOC_URL,\n} from '@fuel-ts/transactions/configs';\n\nimport type { TransactionResultReceipt } from '../transaction-response';\n\n/**\n * Assembles an error message for a panic status.\n * @param status - The transaction failure status.\n * @returns The error message.\n */\nexport const assemblePanicError = (\n statusReason: string,\n metadata: Record<string, unknown>\n): FuelError => {\n let errorMessage = `The transaction reverted with reason: \"${statusReason}\".`;\n\n if (PANIC_REASONS.includes(statusReason)) {\n errorMessage = `${errorMessage}\\n\\nYou can read more about this error at:\\n\\n${PANIC_DOC_URL}#variant.${statusReason}`;\n }\n\n return new FuelError(ErrorCode.SCRIPT_REVERTED, errorMessage, {\n ...metadata,\n reason: statusReason,\n });\n};\n\n/** @hidden */\nconst stringify = (obj: unknown) => JSON.stringify(obj, null, 2);\n\n/**\n * Assembles an error message for a revert status.\n * @param receipts - The transaction result processed receipts.\n * @param logs - The transaction decoded logs.\n * @returns The error message.\n */\nexport const assembleRevertError = (\n receipts: Array<TransactionResultReceipt>,\n logs: Array<unknown>,\n metadata: Record<string, unknown>\n): FuelError => {\n let errorMessage = 'The transaction reverted with an unknown reason.';\n\n const revertReceipt = receipts.find(({ type }) => type === ReceiptType.Revert) as ReceiptRevert;\n let reason = '';\n\n if (revertReceipt) {\n const reasonHex = bn(revertReceipt.val).toHex();\n const lastLog = logs[logs.length - 1];\n const lastButOneLog = logs[logs.length - 2];\n\n switch (reasonHex) {\n case FAILED_REQUIRE_SIGNAL: {\n reason = 'require';\n errorMessage = `The transaction reverted because a \"require\" statement has thrown ${\n logs.length ? stringify(lastLog) : 'an error.'\n }.`;\n break;\n }\n\n case FAILED_ASSERT_EQ_SIGNAL: {\n const sufix =\n logs.length >= 2\n ? ` comparing ${stringify(lastLog)} and ${stringify(lastButOneLog)}.`\n : '.';\n\n reason = 'assert_eq';\n errorMessage = `The transaction reverted because of an \"assert_eq\" statement${sufix}`;\n break;\n }\n\n case FAILED_ASSERT_NE_SIGNAL: {\n const sufix =\n logs.length >= 2\n ? ` comparing ${stringify(lastButOneLog)} and ${stringify(lastLog)}.`\n : '.';\n\n reason = 'assert_ne';\n errorMessage = `The transaction reverted because of an \"assert_ne\" statement${sufix}`;\n break;\n }\n\n case FAILED_ASSERT_SIGNAL:\n reason = 'assert';\n errorMessage = `The transaction reverted because an \"assert\" statement failed to evaluate to true.`;\n break;\n\n case FAILED_TRANSFER_TO_ADDRESS_SIGNAL:\n reason = 'MissingOutputChange';\n errorMessage = `The transaction reverted because it's missing an \"OutputChange\".`;\n break;\n\n default:\n throw new FuelError(\n ErrorCode.UNKNOWN,\n `The transaction reverted with an unknown reason: ${revertReceipt.val}`,\n {\n ...metadata,\n reason: 'unknown',\n }\n );\n }\n }\n\n return new FuelError(ErrorCode.SCRIPT_REVERTED, errorMessage, {\n ...metadata,\n reason,\n });\n};\n\ninterface IExtractTxError {\n receipts: Array<TransactionResultReceipt>;\n logs: Array<unknown>;\n statusReason: string;\n}\n\n/**\n * Extracts the transaction error and returns a FuelError object.\n * @param IExtractTxError - The parameters for extracting the error.\n * @returns The FuelError object.\n */\nexport const extractTxError = (params: IExtractTxError): FuelError => {\n const { receipts, statusReason, logs } = params;\n\n const isPanic = receipts.some(({ type }) => type === ReceiptType.Panic);\n const isRevert = receipts.some(({ type }) => type === ReceiptType.Revert);\n const metadata = {\n logs,\n receipts,\n panic: isPanic,\n revert: isRevert,\n reason: '',\n };\n\n if (isPanic) {\n return assemblePanicError(statusReason, metadata);\n }\n return assembleRevertError(receipts, logs, metadata);\n};\n","/* eslint-disable max-classes-per-file */\nimport type { Address } from '@fuel-ts/address';\n\n/**\n * @hidden\n */\nexport class ChangeOutputCollisionError extends Error {\n override name = 'ChangeOutputCollisionError';\n override message =\n 'A ChangeOutput with the same \"assetId\" already exists for a different \"to\" address';\n}\n\n/**\n * @hidden\n */\nexport class NoWitnessAtIndexError extends Error {\n override name = 'NoWitnessAtIndexError';\n constructor(public readonly index: number) {\n super();\n this.message = `Witness at index \"${index}\" was not found`;\n }\n}\n\n/**\n * @hidden\n */\nexport class NoWitnessByOwnerError extends Error {\n override name = 'NoWitnessByOwnerError';\n constructor(public readonly owner: Address) {\n super();\n this.message = `A witness for the given owner \"${owner}\" was not found`;\n }\n}\n","import type { Address } from '@fuel-ts/address';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { bn } from '@fuel-ts/math';\nimport { InputType, OutputType } from '@fuel-ts/transactions';\n\nimport type { ExcludeResourcesOption } from '../resource';\n\nimport type {\n TransactionRequestInput,\n CoinTransactionRequestInput,\n MessageTransactionRequestInput,\n} from './input';\nimport type { TransactionRequest } from './types';\n\nexport const isRequestInputCoin = (\n input: TransactionRequestInput\n): input is CoinTransactionRequestInput => input.type === InputType.Coin;\n\nexport const isRequestInputMessage = (\n input: TransactionRequestInput\n): input is MessageTransactionRequestInput => input.type === InputType.Message;\n\nexport const isRequestInputMessageWithoutData = (\n input: TransactionRequestInput\n): input is MessageTransactionRequestInput =>\n input.type === InputType.Message && bn(input.data).isZero();\n\nexport const isRequestInputCoinOrMessage = (\n input: TransactionRequestInput\n): input is CoinTransactionRequestInput | MessageTransactionRequestInput =>\n isRequestInputCoin(input) || isRequestInputMessage(input);\n\nexport const isRequestInputResource = (\n input: TransactionRequestInput\n): input is CoinTransactionRequestInput | MessageTransactionRequestInput =>\n isRequestInputCoin(input) || isRequestInputMessageWithoutData(input);\n\nexport const getRequestInputResourceOwner = (\n input: CoinTransactionRequestInput | MessageTransactionRequestInput\n) => (isRequestInputCoin(input) ? input.owner : input.recipient);\n\nexport const isRequestInputResourceFromOwner = (\n input: CoinTransactionRequestInput | MessageTransactionRequestInput,\n owner: Address\n) => getRequestInputResourceOwner(input) === owner.toB256();\n\nexport const getAssetAmountInRequestInputs = (\n inputs: TransactionRequestInput[],\n assetId: string,\n baseAsset: string\n) =>\n inputs.filter(isRequestInputResource).reduce((acc, input) => {\n if (isRequestInputCoin(input) && input.assetId === assetId) {\n return acc.add(input.amount);\n }\n\n if (isRequestInputMessage(input) && assetId === baseAsset) {\n return acc.add(input.amount);\n }\n\n return acc;\n }, bn(0));\n\nexport const cacheRequestInputsResources = (inputs: TransactionRequestInput[]) =>\n inputs.filter(isRequestInputResource).reduce(\n (cache, input) => {\n if (isRequestInputCoin(input)) {\n cache.utxos.push(input.id);\n } else {\n cache.messages.push(input.nonce);\n }\n return cache;\n },\n {\n utxos: [],\n messages: [],\n } as Required<ExcludeResourcesOption>\n );\n\nexport const cacheRequestInputsResourcesFromOwner = (\n inputs: TransactionRequestInput[],\n owner: Address\n): ExcludeResourcesOption =>\n inputs.reduce(\n (acc, input) => {\n if (isRequestInputCoin(input) && input.owner === owner.toB256()) {\n acc.utxos.push(input.id);\n } else if (isRequestInputMessage(input) && input.recipient === owner.toB256()) {\n acc.messages.push(input.nonce);\n }\n return acc;\n },\n {\n utxos: [],\n messages: [],\n } as Required<ExcludeResourcesOption>\n );\n\n/**\n * @hidden\n *\n * Get the number of burnable assets in the transaction request.\n *\n * @param baseAssetId - The base asset ID.\n * @param transactionRequest - The transaction request to get the burnable asset count from.\n * @returns The number of burnable assets in the transaction request.\n */\nexport const getBurnableAssetCount = (\n baseAssetId: string,\n transactionRequest: TransactionRequest\n) => {\n const { inputs, outputs } = transactionRequest;\n const coinInputs = new Set(inputs.filter(isRequestInputCoin).map((input) => input.assetId));\n // If there is a message input without data, we need to add the base asset to the set\n if (inputs.some((i) => isRequestInputMessage(i) && bn(i.amount).gt(0))) {\n coinInputs.add(baseAssetId);\n }\n const changeOutputs = new Set(\n outputs.filter((output) => output.type === OutputType.Change).map((output) => output.assetId)\n );\n const difference = new Set([...coinInputs].filter((x) => !changeOutputs.has(x)));\n return difference.size;\n};\n\n/**\n * @hidden\n *\n * Validates the transaction request for asset burn.\n *\n * @param transactionRequest - The transaction request to validate.\n * @param enableAssetBurn - Whether asset burn is enabled (default: false).\n *\n * @throws `FuelError` when an asset burn is detected and not enabled.\n */\nexport const validateTransactionForAssetBurn = (\n baseAssetId: string,\n transactionRequest: TransactionRequest,\n enableAssetBurn: boolean = false\n) => {\n // Asset burn is enabled\n if (enableAssetBurn === true) {\n return;\n }\n\n // No burnable assets detected\n if (getBurnableAssetCount(baseAssetId, transactionRequest) <= 0) {\n return;\n }\n\n const message = [\n 'Asset burn detected.',\n 'Add the relevant change outputs to the transaction to avoid burning assets.',\n 'Or enable asset burn, upon sending the transaction.',\n ].join('\\n');\n throw new FuelError(ErrorCode.ASSET_BURN_DETECTED, message);\n};\n","import type { Witness } from '@fuel-ts/transactions';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { arrayify, hexlify } from '@fuel-ts/utils';\n\nexport type TransactionRequestWitness = BytesLike;\n\nexport const witnessify = (value: TransactionRequestWitness): Witness => {\n const data = arrayify(value);\n\n return {\n data: hexlify(data),\n dataLength: data.length,\n };\n};\n","import type { BN } from '@fuel-ts/math';\nimport type { TransactionBlob } from '@fuel-ts/transactions';\nimport { clone } from 'ramda';\n\nimport type { GasCosts } from '../provider';\nimport { calculateMetadataGasForTxBlob } from '../utils';\n\nimport { hashTransaction } from './hash-transaction';\nimport type { BaseTransactionRequestLike } from './transaction-request';\nimport { BaseTransactionRequest, TransactionType } from './transaction-request';\n\nexport interface BlobTransactionRequestLike extends BaseTransactionRequestLike {\n /** Blob ID */\n blobId: string;\n /** Witness index of the bytecode to create */\n witnessIndex?: number;\n}\n\nexport class BlobTransactionRequest extends BaseTransactionRequest {\n static from(obj: BlobTransactionRequestLike) {\n return new this(clone(obj));\n }\n\n /** Type of the transaction */\n type = TransactionType.Blob as const;\n /** Blob ID */\n blobId: string;\n /** Witness index of the bytecode to create */\n witnessIndex: number;\n\n /**\n * Creates an instance `BlobTransactionRequest`.\n *\n * @param blobTransactionRequestLike - The initial values for the instance\n */\n constructor({ witnessIndex, blobId, ...rest }: BlobTransactionRequestLike) {\n super(rest);\n this.blobId = blobId;\n this.witnessIndex = witnessIndex ?? 0;\n }\n\n /**\n * Converts the transaction request to a `TransactionBlob`.\n *\n * @returns The transaction create object.\n */\n toTransaction(): TransactionBlob {\n const baseTransaction = this.getBaseTransaction();\n const { witnessIndex, blobId } = this;\n return {\n type: TransactionType.Blob,\n ...baseTransaction,\n blobId,\n witnessIndex,\n };\n }\n\n /**\n * Gets the Transaction Request by hashing the transaction.\n *\n * @param chainId - The chain ID.\n *\n * @returns - A hash of the transaction, which is the transaction ID.\n */\n getTransactionId(chainId: number): string {\n return hashTransaction(this, chainId);\n }\n\n /**\n * Calculates the metadata gas cost for a blob transaction.\n *\n * @param gasCosts - gas costs passed from the chain.\n * @returns metadata gas cost for the blob transaction.\n */\n override metadataGas(gasCosts: GasCosts): BN {\n return calculateMetadataGasForTxBlob({\n gasCosts,\n txBytesSize: this.byteSize(),\n witnessBytesSize: this.witnesses[this.witnessIndex].length,\n });\n }\n}\n","import { ZeroBytes32 } from '@fuel-ts/address/configs';\nimport { uint64ToBytesBE, sha256 } from '@fuel-ts/hasher';\nimport { bn } from '@fuel-ts/math';\nimport { TransactionType, InputType, OutputType, TransactionCoder } from '@fuel-ts/transactions';\nimport { concat } from '@fuel-ts/utils';\nimport { clone } from 'ramda';\n\nimport type { TransactionRequest } from './types';\n\n/**\n * Hash transaction request with sha256. [Read more](https://github.com/FuelLabs/fuel-specs/blob/master/specs/protocol/identifiers.md#transaction-id)\n *\n * @param transactionRequest - Transaction request to be hashed\n * @returns sha256 hash of the transaction\n */\nexport function hashTransaction(transactionRequest: TransactionRequest, chainId: number) {\n const transaction = transactionRequest.toTransaction();\n\n if (transaction.type === TransactionType.Script) {\n transaction.receiptsRoot = ZeroBytes32;\n }\n\n // Zero out input fields\n transaction.inputs = transaction.inputs.map((input) => {\n const inputClone = clone(input);\n\n switch (inputClone.type) {\n // Zero out on signing: txPointer, predicateGasUsed\n case InputType.Coin: {\n inputClone.txPointer = {\n blockHeight: 0,\n txIndex: 0,\n };\n inputClone.predicateGasUsed = bn(0);\n return inputClone;\n }\n // Zero out on signing: predicateGasUsed\n case InputType.Message: {\n inputClone.predicateGasUsed = bn(0);\n return inputClone;\n }\n // Zero out on signing: txID, outputIndex, balanceRoot, stateRoot, and txPointer\n case InputType.Contract: {\n inputClone.txPointer = {\n blockHeight: 0,\n txIndex: 0,\n };\n inputClone.txID = ZeroBytes32;\n inputClone.outputIndex = 0;\n inputClone.balanceRoot = ZeroBytes32;\n inputClone.stateRoot = ZeroBytes32;\n return inputClone;\n }\n default:\n return inputClone;\n }\n });\n // Zero out output fields\n transaction.outputs = transaction.outputs.map((output) => {\n const outputClone = clone(output);\n\n switch (outputClone.type) {\n // Zero out on signing: balanceRoot, stateRoot\n case OutputType.Contract: {\n outputClone.balanceRoot = ZeroBytes32;\n outputClone.stateRoot = ZeroBytes32;\n return outputClone;\n }\n // Zero out on signing: amount\n case OutputType.Change: {\n outputClone.amount = bn(0);\n return outputClone;\n }\n // Zero out on signing: amount, to and assetId\n case OutputType.Variable: {\n outputClone.to = ZeroBytes32;\n outputClone.amount = bn(0);\n outputClone.assetId = ZeroBytes32;\n return outputClone;\n }\n default:\n return outputClone;\n }\n });\n transaction.witnessesCount = 0;\n transaction.witnesses = [];\n\n const chainIdBytes = uint64ToBytesBE(chainId);\n const concatenatedData = concat([chainIdBytes, new TransactionCoder().encode(transaction)]);\n return sha256(concatenatedData);\n}\n","import { ZeroBytes32 } from '@fuel-ts/address/configs';\nimport { bn, type BN } from '@fuel-ts/math';\nimport type { TransactionCreate } from '@fuel-ts/transactions';\nimport { TransactionType, OutputType } from '@fuel-ts/transactions';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { arrayify, hexlify } from '@fuel-ts/utils';\nimport { clone } from 'ramda';\n\nimport type { GasCosts } from '../provider';\nimport { calculateMetadataGasForTxCreate } from '../utils/gas';\n\nimport { hashTransaction } from './hash-transaction';\nimport type { ContractCreatedTransactionRequestOutput } from './output';\nimport type { TransactionRequestStorageSlot } from './storage-slot';\nimport { storageSlotify } from './storage-slot';\nimport { BaseTransactionRequest } from './transaction-request';\nimport type { BaseTransactionRequestLike } from './transaction-request';\n\n/**\n * @hidden\n */\nexport interface CreateTransactionRequestLike extends BaseTransactionRequestLike {\n /** Witness index of contract bytecode to create */\n bytecodeWitnessIndex?: number;\n /** Salt */\n salt?: BytesLike;\n /** List of storage slots to initialize */\n storageSlots?: TransactionRequestStorageSlot[];\n}\n\n/**\n * `CreateTransactionRequest` provides functionalities for creating a transaction request that creates a contract.\n */\nexport class CreateTransactionRequest extends BaseTransactionRequest {\n static from(obj: CreateTransactionRequestLike) {\n return new this(clone(obj));\n }\n\n /** Type of the transaction */\n type = TransactionType.Create as const;\n /** Witness index of contract bytecode to create */\n bytecodeWitnessIndex: number;\n /** Salt */\n salt: string;\n /** List of storage slots to initialize */\n storageSlots: TransactionRequestStorageSlot[];\n\n /**\n * Creates an instance `CreateTransactionRequest`.\n *\n * @param createTransactionRequestLike - The initial values for the instance\n */\n constructor({ bytecodeWitnessIndex, salt, storageSlots, ...rest }: CreateTransactionRequestLike) {\n super(rest);\n this.bytecodeWitnessIndex = bytecodeWitnessIndex ?? 0;\n this.salt = hexlify(salt ?? ZeroBytes32);\n this.storageSlots = [...(storageSlots ?? [])];\n }\n\n /**\n * Converts the transaction request to a `TransactionCreate`.\n *\n * @returns The transaction create object.\n */\n toTransaction(): TransactionCreate {\n const baseTransaction = this.getBaseTransaction();\n const bytecodeWitnessIndex = this.bytecodeWitnessIndex;\n const storageSlots = this.storageSlots?.map(storageSlotify) ?? [];\n return {\n type: TransactionType.Create,\n ...baseTransaction,\n bytecodeWitnessIndex,\n storageSlotsCount: bn(storageSlots.length),\n salt: this.salt ? hexlify(this.salt) : ZeroBytes32,\n storageSlots,\n };\n }\n\n /**\n * Get contract created outputs for the transaction.\n *\n * @returns An array of contract created transaction request outputs.\n */\n getContractCreatedOutputs(): ContractCreatedTransactionRequestOutput[] {\n return this.outputs.filter(\n (output): output is ContractCreatedTransactionRequestOutput =>\n output.type === OutputType.ContractCreated\n );\n }\n\n /**\n * Gets the Transaction Request by hashing the transaction.\n *\n * @param chainId - The chain ID.\n *\n * @returns - A hash of the transaction, which is the transaction ID.\n */\n getTransactionId(chainId: number): string {\n return hashTransaction(this, chainId);\n }\n\n /**\n * Adds a contract created output to the transaction request.\n *\n * @param contractId - The contract ID.\n * @param stateRoot - The state root.\n */\n addContractCreatedOutput(\n /** Contract ID */\n contractId: BytesLike,\n /** State Root */\n stateRoot: BytesLike\n ) {\n this.pushOutput({\n type: OutputType.ContractCreated,\n contractId,\n stateRoot,\n });\n }\n\n override metadataGas(gasCosts: GasCosts): BN {\n return calculateMetadataGasForTxCreate({\n contractBytesSize: bn(arrayify(this.witnesses[this.bytecodeWitnessIndex] || '0x').length),\n gasCosts,\n stateRootSize: this.storageSlots.length,\n txBytesSize: this.byteSize(),\n });\n }\n}\n","import type { StorageSlot } from '@fuel-ts/transactions';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { arrayify, hexlify } from '@fuel-ts/utils';\n\nexport type TransactionRequestStorageSlot =\n | {\n /** Key */\n key: BytesLike;\n /** Value */\n value: BytesLike;\n }\n | [key: BytesLike, value: BytesLike];\n\n// Make sure all values have 32 bytes\nconst getStorageValue = (value: BytesLike): Uint8Array => {\n const v = new Uint8Array(32);\n v.set(arrayify(value));\n return v;\n};\n\nexport const storageSlotify = (storageSlot: TransactionRequestStorageSlot): StorageSlot => {\n let key;\n let value;\n\n if (Array.isArray(storageSlot)) {\n key = storageSlot[0];\n value = storageSlot[1];\n } else {\n key = storageSlot.key;\n value = storageSlot.value;\n }\n\n return {\n key: hexlify(key),\n value: hexlify(getStorageValue(value)),\n };\n};\n","import type { InputValue, JsonAbi } from '@fuel-ts/abi-coder';\nimport { Interface } from '@fuel-ts/abi-coder';\nimport { addressify } from '@fuel-ts/address';\nimport type { ContractIdLike } from '@fuel-ts/address';\nimport { ZeroBytes32 } from '@fuel-ts/address/configs';\nimport { bn } from '@fuel-ts/math';\nimport type { BN, BigNumberish } from '@fuel-ts/math';\nimport type { TransactionScript } from '@fuel-ts/transactions';\nimport { InputType, OutputType, TransactionType } from '@fuel-ts/transactions';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { arrayify, hexlify } from '@fuel-ts/utils';\nimport { clone } from 'ramda';\n\nimport type { Account } from '../../account';\nimport type { ChainInfo, GasCosts, TransactionCostParams } from '../provider';\nimport { calculateMetadataGasForTxScript, getMaxGas } from '../utils/gas';\n\nimport { hashTransaction } from './hash-transaction';\nimport type { ContractTransactionRequestInput } from './input';\nimport type { ContractTransactionRequestOutput, VariableTransactionRequestOutput } from './output';\nimport { returnZeroScript } from './scripts';\nimport type { BaseTransactionRequestLike } from './transaction-request';\nimport { BaseTransactionRequest } from './transaction-request';\nimport type { AbstractScriptRequest, JsonAbisFromAllCalls } from './types';\n\n/**\n * @hidden\n */\nexport interface ScriptTransactionRequestLike extends BaseTransactionRequestLike {\n /** Gas limit for transaction */\n gasLimit?: BigNumberish;\n /** Script to execute */\n script?: BytesLike;\n /** Script input data (parameters) */\n scriptData?: BytesLike;\n\n abis?: JsonAbisFromAllCalls;\n}\n\n/**\n * `ScriptTransactionRequest` provides functionalities for creating a transaction request that uses a script.\n */\nexport class ScriptTransactionRequest extends BaseTransactionRequest {\n static from(obj: ScriptTransactionRequestLike) {\n return new this(clone(obj));\n }\n\n /** Type of the transaction */\n type = TransactionType.Script as const;\n /** Gas limit for transaction */\n gasLimit: BN;\n /** Script to execute */\n script: Uint8Array;\n /** Script input data (parameters) */\n scriptData: Uint8Array;\n\n abis?: JsonAbisFromAllCalls;\n\n /**\n * Constructor for `ScriptTransactionRequest`.\n *\n * @param scriptTransactionRequestLike - The initial values for the instance.\n */\n constructor({ script, scriptData, gasLimit, ...rest }: ScriptTransactionRequestLike = {}) {\n super(rest);\n this.gasLimit = bn(gasLimit);\n this.script = arrayify(script ?? returnZeroScript.bytes);\n this.scriptData = arrayify(scriptData ?? returnZeroScript.encodeScriptData());\n this.abis = rest.abis;\n }\n\n /**\n * Helper function to estimate and fund the transaction request with a specified account.\n *\n * @param account - The account to fund the transaction.\n * @param params - The parameters for the transaction cost.\n * @returns The current instance of the `ScriptTransactionRequest` funded.\n */\n async estimateAndFund(\n account: Account,\n { signatureCallback, quantities = [] }: TransactionCostParams = {}\n ): Promise<ScriptTransactionRequest> {\n const txCost = await account.getTransactionCost(this, { signatureCallback, quantities });\n\n this.maxFee = txCost.maxFee;\n this.gasLimit = txCost.gasUsed;\n\n await account.fund(this, txCost);\n\n return this;\n }\n\n /**\n * Converts the transaction request to a `TransactionScript`.\n *\n * @returns The transaction script object.\n */\n toTransaction(): TransactionScript {\n const script = arrayify(this.script ?? '0x');\n const scriptData = arrayify(this.scriptData ?? '0x');\n return {\n type: TransactionType.Script,\n scriptGasLimit: this.gasLimit,\n ...super.getBaseTransaction(),\n scriptLength: bn(script.length),\n scriptDataLength: bn(scriptData.length),\n receiptsRoot: ZeroBytes32,\n script: hexlify(script),\n scriptData: hexlify(scriptData),\n };\n }\n\n /**\n * Get contract inputs for the transaction.\n *\n * @returns An array of contract transaction request inputs.\n */\n getContractInputs(): ContractTransactionRequestInput[] {\n return this.inputs.filter(\n (input): input is ContractTransactionRequestInput => input.type === InputType.Contract\n );\n }\n\n /**\n * Get contract outputs for the transaction.\n *\n * @returns An array of contract transaction request outputs.\n */\n getContractOutputs(): ContractTransactionRequestOutput[] {\n return this.outputs.filter(\n (output): output is ContractTransactionRequestOutput => output.type === OutputType.Contract\n );\n }\n\n /**\n * Get variable outputs for the transaction.\n *\n * @returns An array of variable transaction request outputs.\n */\n getVariableOutputs(): VariableTransactionRequestOutput[] {\n return this.outputs.filter(\n (output): output is VariableTransactionRequestOutput => output.type === OutputType.Variable\n );\n }\n\n /**\n * Set the script and its data.\n *\n * @param script - The abstract script request.\n * @param data - The script data.\n */\n setScript<T>(script: AbstractScriptRequest<T>, data: T) {\n this.scriptData = script.encodeScriptData(data);\n this.script = script.bytes;\n }\n\n /**\n * Adds variable outputs to the transaction request.\n *\n * @param numberOfVariables - The number of variables to add.\n * @returns The new length of the outputs array.\n */\n addVariableOutputs(numberOfVariables: number = 1) {\n let outputsNumber = numberOfVariables;\n\n while (outputsNumber) {\n this.pushOutput({\n type: OutputType.Variable,\n });\n outputsNumber -= 1;\n }\n\n return this.outputs.length - 1;\n }\n\n /**\n * Calculates the maximum gas for the transaction.\n *\n * @param chainInfo - The chain information.\n * @param minGas - The minimum gas.\n * @returns the maximum gas.\n */\n override calculateMaxGas(chainInfo: ChainInfo, minGas: BN): BN {\n const { consensusParameters } = chainInfo;\n const {\n feeParameters: { gasPerByte },\n txParameters: { maxGasPerTx },\n } = consensusParameters;\n\n const witnessesLength = this.toTransaction().witnesses.reduce(\n (acc, wit) => acc + wit.dataLength,\n 0\n );\n\n return getMaxGas({\n gasPerByte,\n minGas,\n witnessesLength,\n witnessLimit: this.witnessLimit,\n gasLimit: this.gasLimit,\n maxGasPerTx,\n });\n }\n\n /**\n * Adds a contract input and output to the transaction request.\n *\n * @param contract - The contract ID.\n * @returns The current instance of the `ScriptTransactionRequest`.\n */\n addContractInputAndOutput(contract: ContractIdLike): ScriptTransactionRequest {\n const contractAddress = addressify(contract);\n\n // Add only one input contract per contractId\n if (this.getContractInputs().find((i) => i.contractId === contractAddress.toB256())) {\n return this;\n }\n\n const inputIndex = super.pushInput({\n type: InputType.Contract,\n contractId: contractAddress.toB256(),\n txPointer: '0x00000000000000000000000000000000',\n });\n\n this.pushOutput({\n type: OutputType.Contract,\n inputIndex,\n });\n\n return this;\n }\n\n /**\n * Gets the Transaction Request by hashing the transaction.\n *\n * @param chainId - The chain ID.\n *\n * @returns - A hash of the transaction, which is the transaction ID.\n */\n getTransactionId(chainId: number): string {\n return hashTransaction(this, chainId);\n }\n\n /**\n * Sets the data for the transaction request.\n *\n * @param abi - Script JSON ABI.\n * @param args - The input arguments.\n * @returns The current instance of the `ScriptTransactionRequest`.\n */\n setData(abi: JsonAbi, args: InputValue[]): ScriptTransactionRequest {\n const abiInterface = new Interface(abi);\n this.scriptData = abiInterface.functions.main.encodeArguments(args);\n return this;\n }\n\n override metadataGas(gasCosts: GasCosts): BN {\n return calculateMetadataGasForTxScript({\n gasCosts,\n txBytesSize: this.byteSize(),\n });\n }\n}\n","import { arrayify } from '@fuel-ts/utils';\n\nimport type { AbstractScriptRequest } from './types';\n\n// We can't import this from `@fuel-ts/script` because it causes\n// cyclic dependency errors so we duplicate it here.\n/** @hidden */\nexport const returnZeroScript: AbstractScriptRequest<void> = {\n /*\n Opcode::RET(REG_ZERO)\n Opcode::NOOP\n */\n // TODO: Don't use hardcoded scripts: https://github.com/FuelLabs/fuels-ts/issues/281\n bytes: arrayify('0x24000000'),\n encodeScriptData: () => new Uint8Array(0),\n};\n\n/** @hidden */\nexport const withdrawScript: AbstractScriptRequest<void> = {\n /*\n The following code loads some basic values into registers and calls SMO to create an output message\n 5040C010 \t- ADDI r16 $is i16 [r16 now points to memory 16 bytes from the start of this program (start of receiver data)]\n 5D44C006\t- LW r17 $is i6 [r17 set to the 6th word in this program (6*8=48 bytes from the start of this program)]\n 4C400011\t- SMO r16 r0 r0 r17 [send message out to address starting at memory position r16 with amount in r17]\n 24000000\t- RET [return 0]\n 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [recipient address]\n 00000000 00000000 [amount value]\n */\n // TODO: Don't use hardcoded scripts: https://github.com/FuelLabs/fuels-ts/issues/281\n bytes: arrayify('0x5040C0105D44C0064C40001124000000'),\n encodeScriptData: () => new Uint8Array(0),\n};\n","import { FuelError } from '@fuel-ts/errors';\nimport { hash } from '@fuel-ts/hasher';\nimport type { BN } from '@fuel-ts/math';\nimport {\n TransactionType,\n type TransactionUpgrade,\n type UpgradePurpose,\n UpgradePurposeTypeEnum,\n} from '@fuel-ts/transactions';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { hexlify } from '@fuel-ts/utils';\nimport { clone } from 'ramda';\n\nimport type { GasCosts } from '../provider';\nimport { calculateMetadataGasForTxUpgrade } from '../utils';\n\nimport { hashTransaction } from './hash-transaction';\nimport { BaseTransactionRequest, type BaseTransactionRequestLike } from './transaction-request';\n\n/**\n * @hidden\n */\nexport type UpgradePurposeRequest =\n | {\n type: UpgradePurposeTypeEnum.ConsensusParameters;\n checksum: string;\n }\n | {\n type: UpgradePurposeTypeEnum.StateTransition;\n data: BytesLike;\n };\n\n/**\n * @hidden\n */\nexport interface UpgradeTransactionRequestLike extends BaseTransactionRequestLike {\n /** The upgrade purpose */\n upgradePurpose?: UpgradePurposeRequest;\n\n /** Witness index */\n bytecodeWitnessIndex?: number;\n}\n\nexport class UpgradeTransactionRequest extends BaseTransactionRequest {\n static from(obj: UpgradeTransactionRequestLike) {\n if (obj instanceof UpgradeTransactionRequest) {\n return obj;\n }\n return new this(clone(obj));\n }\n\n /** The type of transaction */\n type = TransactionType.Upgrade as const;\n /** The upgrade purpose */\n upgradePurpose: UpgradePurposeRequest;\n /** Witness index of consensus */\n bytecodeWitnessIndex: number;\n\n /**\n * Creates an instance `UpgradeTransactionRequest`.\n *\n * @param upgradeTransactionRequestLike - The initial values for the instance\n */\n constructor({\n upgradePurpose,\n bytecodeWitnessIndex,\n ...rest\n }: UpgradeTransactionRequestLike = {}) {\n super(rest);\n this.bytecodeWitnessIndex = bytecodeWitnessIndex ?? 0;\n this.upgradePurpose = upgradePurpose ?? {\n type: UpgradePurposeTypeEnum.ConsensusParameters,\n checksum: '0x',\n };\n }\n\n /**\n * Adds a consensus parameters upgrade purpose.\n *\n * @param consensus - The consensus bytecode.\n *\n * @returns - The current instance of `UpgradeTransactionRequest`.\n */\n addConsensusParametersUpgradePurpose(consensus: BytesLike) {\n this.bytecodeWitnessIndex = this.addWitness(consensus);\n this.upgradePurpose = {\n type: UpgradePurposeTypeEnum.ConsensusParameters,\n checksum: hash(consensus),\n };\n return this;\n }\n\n /**\n * Adds a state transition upgrade purpose.\n *\n * @param bytecodeRoot - The Merkle root of the state transition.\n *\n * @returns - The current instance of `UpgradeTransactionRequest`.\n */\n addStateTransitionUpgradePurpose(bytecodeRoot: BytesLike) {\n this.upgradePurpose = {\n type: UpgradePurposeTypeEnum.StateTransition,\n data: hexlify(bytecodeRoot),\n };\n return this;\n }\n\n /**\n * Adds an upgrade purpose.\n *\n * @param type - The upgrade purpose type.\n * @param data - The bytecode or merkle root of upgrade purpose\n *\n * @returns - The current instance of `UpgradeTransactionRequest`.\n */\n addUpgradePurpose(type: UpgradePurposeTypeEnum, data: BytesLike) {\n if (type === UpgradePurposeTypeEnum.ConsensusParameters) {\n this.addConsensusParametersUpgradePurpose(data);\n }\n\n if (type === UpgradePurposeTypeEnum.StateTransition) {\n this.addStateTransitionUpgradePurpose(data);\n }\n\n return this;\n }\n\n /**\n * Converts the transaction request to a `TransactionUpgrade`.\n *\n * @returns The transaction create object.\n */\n toTransaction(): TransactionUpgrade {\n let upgradePurpose: UpgradePurpose;\n\n if (this.upgradePurpose.type === UpgradePurposeTypeEnum.ConsensusParameters) {\n upgradePurpose = {\n type: UpgradePurposeTypeEnum.ConsensusParameters,\n data: {\n witnessIndex: this.bytecodeWitnessIndex,\n checksum: this.upgradePurpose.checksum,\n },\n };\n } else if (this.upgradePurpose.type === UpgradePurposeTypeEnum.StateTransition) {\n upgradePurpose = {\n type: UpgradePurposeTypeEnum.StateTransition,\n data: {\n bytecodeRoot: hexlify(this.upgradePurpose.data),\n },\n };\n } else {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Invalid upgrade purpose');\n }\n\n return {\n type: TransactionType.Upgrade,\n ...super.getBaseTransaction(),\n upgradePurpose,\n };\n }\n\n /**\n * Gets the Transaction ID by hashing the transaction\n *\n * @param chainId - The chain ID.\n *\n * @returns - A hash of the transaction, which is the transaction ID.\n */\n getTransactionId(chainId: number): string {\n return hashTransaction(this, chainId);\n }\n\n /**\n * Calculates the metadata gas cost for an upgrade transaction.\n *\n * @param gasCosts - gas costs passed from the chain.\n *\n * @returns metadata gas cost for the upgrade transaction.\n */\n override metadataGas(gasCosts: GasCosts): BN {\n const txBytesSize = this.byteSize();\n\n if (this.upgradePurpose.type === UpgradePurposeTypeEnum.ConsensusParameters) {\n const witnessIndex = this.bytecodeWitnessIndex;\n const consensusSize = this.witnesses[witnessIndex].length;\n return calculateMetadataGasForTxUpgrade({\n gasCosts,\n txBytesSize,\n consensusSize,\n });\n }\n\n if (this.upgradePurpose.type === UpgradePurposeTypeEnum.StateTransition) {\n return calculateMetadataGasForTxUpgrade({\n gasCosts,\n txBytesSize,\n });\n }\n\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Invalid upgrade purpose');\n }\n}\n","import { ZeroBytes32 } from '@fuel-ts/address/configs';\nimport type { BN } from '@fuel-ts/math';\nimport { type TransactionUpload, TransactionType } from '@fuel-ts/transactions';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { arrayify, hexlify } from '@fuel-ts/utils';\nimport { clone } from 'ramda';\n\nimport type { ChainInfo, GasCosts } from '../provider';\nimport { calculateMetadataGasForTxUpload, calculateMinGasForTxUpload } from '../utils';\n\nimport { hashTransaction } from './hash-transaction';\nimport { type BaseTransactionRequestLike, BaseTransactionRequest } from './transaction-request';\n\n/**\n * @hidden\n */\nexport interface UploadSubsectionRequest {\n /** The root of the Merkle tree is created over the bytecode. */\n root: BytesLike;\n\n /** The index of the subsection of the bytecode. */\n subsectionIndex: number;\n\n /** The total number of subsections on which bytecode was divided. */\n subsectionsNumber: number;\n\n /** The proof set helps to verify the connection of the subsection to the `root`. */\n proofSet: BytesLike[];\n\n /** The subsection bytecode. */\n subsection: BytesLike;\n}\n\n/**\n * @hidden\n */\nexport interface UploadTransactionRequestLike extends BaseTransactionRequestLike {\n /** The witness index of the subsection of the bytecode. */\n witnessIndex?: number;\n\n /** The subsection data. */\n subsection?: Omit<UploadSubsectionRequest, 'subsection'>;\n}\n\nexport class UploadTransactionRequest extends BaseTransactionRequest {\n static from(obj: UploadTransactionRequestLike): UploadTransactionRequest {\n if (obj instanceof UploadTransactionRequest) {\n return obj;\n }\n return new this(clone(obj));\n }\n\n /** Type of the transaction */\n type = TransactionType.Upload as const;\n /** The witness index of the subsection of the bytecode. */\n witnessIndex: number;\n /** The subsection data. */\n subsection: Omit<UploadSubsectionRequest, 'subsection'>;\n\n /**\n * Creates an instance `UploadTransactionRequest`.\n *\n * @param uploadTransactionRequestLike - The initial values for the instance\n */\n constructor({ witnessIndex, subsection, ...rest }: UploadTransactionRequestLike = {}) {\n super(rest);\n this.witnessIndex = witnessIndex ?? 0;\n this.subsection = subsection ?? {\n proofSet: [],\n root: ZeroBytes32,\n subsectionIndex: 0,\n subsectionsNumber: 0,\n };\n }\n\n /**\n * Adds the subsection.\n *\n * @param subsection - The subsection data.\n */\n addSubsection(subsection: UploadSubsectionRequest) {\n const { subsection: subsectionBytecode, ...rest } = subsection;\n this.subsection = rest;\n this.witnessIndex = this.addWitness(subsectionBytecode);\n }\n\n /**\n * Gets the Transaction Request by hashing the transaction.\n *\n * @param chainId - The chain ID.\n *\n * @returns - A hash of the transaction, which is the transaction ID.\n */\n getTransactionId(chainId: number): string {\n return hashTransaction(this, chainId);\n }\n\n /**\n * Converts the transaction request to a `TransactionUpload`.\n *\n * @returns The transaction create object.\n */\n toTransaction(): TransactionUpload {\n const baseTransaction = this.getBaseTransaction();\n const { subsectionIndex, subsectionsNumber, root, proofSet } = this.subsection;\n return {\n type: TransactionType.Upload,\n ...baseTransaction,\n subsectionIndex,\n subsectionsNumber,\n root: hexlify(root),\n proofSet: proofSet.map(hexlify),\n witnessIndex: this.witnessIndex,\n proofSetCount: proofSet.length,\n };\n }\n\n /**\n * Calculates the metadata gas cost for an upload transaction.\n *\n * @param gasCosts - gas costs passed from the chain.\n *\n * @returns metadata gas cost for the upload transaction.\n */\n override metadataGas(gasCosts: GasCosts): BN {\n return calculateMetadataGasForTxUpload({\n gasCosts,\n txBytesSize: this.byteSize(),\n subsectionSize: arrayify(this.witnesses[this.witnessIndex]).length,\n subsectionsSize: this.subsection.subsectionsNumber,\n });\n }\n\n /**\n * Calculates the minimum gas for an upload transaction.\n *\n * @param chainInfo - The chain information.\n *\n * @returns the minimum gas for the upload transaction\n */\n override calculateMinGas(chainInfo: ChainInfo): BN {\n const minGas = super.calculateMinGas(chainInfo);\n const { gasCosts } = chainInfo.consensusParameters;\n const bytecode = this.witnesses[this.witnessIndex] ?? ZeroBytes32;\n return calculateMinGasForTxUpload({\n gasCosts,\n baseMinGas: minGas.toNumber(),\n subsectionSize: arrayify(bytecode).length,\n });\n }\n}\n","import type { JsonAbi } from '@fuel-ts/abi-coder';\nimport type { TransactionType } from '@fuel-ts/transactions';\n\nimport type {\n BlobTransactionRequest,\n BlobTransactionRequestLike,\n} from './blob-transaction-request';\nimport type {\n CreateTransactionRequest,\n CreateTransactionRequestLike,\n} from './create-transaction-request';\nimport type {\n ScriptTransactionRequest,\n ScriptTransactionRequestLike,\n} from './script-transaction-request';\nimport type {\n UpgradeTransactionRequest,\n UpgradeTransactionRequestLike,\n} from './upgrade-transaction-request';\nimport type {\n UploadTransactionRequest,\n UploadTransactionRequestLike,\n} from './upload-transaction-request';\n\nexport type TransactionRequest =\n | ScriptTransactionRequest\n | CreateTransactionRequest\n | BlobTransactionRequest\n | UpgradeTransactionRequest\n | UploadTransactionRequest;\nexport type TransactionRequestLike =\n | ({ type: TransactionType.Script } & ScriptTransactionRequestLike)\n | ({ type: TransactionType.Create } & CreateTransactionRequestLike)\n | ({ type: TransactionType.Blob } & BlobTransactionRequestLike)\n | ({ type: TransactionType.Upgrade } & UpgradeTransactionRequestLike)\n | ({ type: TransactionType.Upload } & UploadTransactionRequestLike);\n\nexport type JsonAbisFromAllCalls = {\n main: JsonAbi;\n otherContractsAbis: Record<string, JsonAbi>;\n};\n\n/**\n * @hidden\n */\nexport abstract class AbstractScriptRequest<T> {\n abstract bytes: Uint8Array;\n abstract encodeScriptData: (data: T) => Uint8Array;\n}\n","import { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { TransactionType } from '@fuel-ts/transactions';\n\nimport { BlobTransactionRequest } from './blob-transaction-request';\nimport { CreateTransactionRequest } from './create-transaction-request';\nimport { ScriptTransactionRequest } from './script-transaction-request';\nimport type { TransactionRequestLike, TransactionRequest } from './types';\nimport { UpgradeTransactionRequest } from './upgrade-transaction-request';\nimport { UploadTransactionRequest } from './upload-transaction-request';\n\n/** @hidden */\nexport const transactionRequestify = (obj: TransactionRequestLike): TransactionRequest => {\n if (\n obj instanceof ScriptTransactionRequest ||\n obj instanceof CreateTransactionRequest ||\n obj instanceof BlobTransactionRequest ||\n obj instanceof UpgradeTransactionRequest ||\n obj instanceof UploadTransactionRequest\n ) {\n return obj;\n }\n\n const { type } = obj;\n\n switch (obj.type) {\n case TransactionType.Script: {\n return ScriptTransactionRequest.from(obj);\n }\n case TransactionType.Create: {\n return CreateTransactionRequest.from(obj);\n }\n case TransactionType.Blob: {\n return BlobTransactionRequest.from(obj);\n }\n case TransactionType.Upgrade: {\n return UpgradeTransactionRequest.from(obj);\n }\n case TransactionType.Upload: {\n return UploadTransactionRequest.from(obj);\n }\n default: {\n throw new FuelError(\n ErrorCode.UNSUPPORTED_TRANSACTION_TYPE,\n `Unsupported transaction type: ${type}.`\n );\n }\n }\n};\n\n/** @hidden */\nexport const isTransactionTypeScript = (\n request: TransactionRequestLike\n): request is ScriptTransactionRequest => request.type === TransactionType.Script;\n\n/** @hidden */\nexport const isTransactionTypeCreate = (\n request: TransactionRequestLike\n): request is CreateTransactionRequest => request.type === TransactionType.Create;\n\n/** @hidden */\nexport const isTransactionTypeBlob = (\n request: TransactionRequestLike\n): request is BlobTransactionRequest => request.type === TransactionType.Blob;\n\n/** @hidden */\nexport const isTransactionTypeUpgrade = (\n request: TransactionRequestLike\n): request is UpgradeTransactionRequest => request.type === TransactionType.Upgrade;\n\n/** @hidden */\nexport const isTransactionTypeUpload = (\n request: TransactionRequestLike\n): request is UploadTransactionRequest => request.type === TransactionType.Upload;\n","import { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport type { BN } from '@fuel-ts/math';\nimport { bn } from '@fuel-ts/math';\nimport type {\n ReceiptCall,\n ReceiptLog,\n ReceiptLogData,\n ReceiptPanic,\n ReceiptReturn,\n ReceiptReturnData,\n ReceiptRevert,\n ReceiptTransfer,\n ReceiptTransferOut,\n ReceiptScriptResult,\n ReceiptMessageOut,\n Transaction,\n ReceiptMint,\n ReceiptBurn,\n OutputCoin,\n OutputContract,\n OutputChange,\n OutputVariable,\n OutputContractCreated,\n Output,\n TransactionType,\n} from '@fuel-ts/transactions';\nimport { OutputType, TransactionCoder, TxPointerCoder } from '@fuel-ts/transactions';\nimport { arrayify, assertUnreachable } from '@fuel-ts/utils';\n\nimport type {\n GqlMalleableTransactionFieldsFragment,\n GqlStatusChangeSubscription,\n GqlSubmitAndAwaitStatusSubscription,\n} from '../__generated__/operations';\nimport type Provider from '../provider';\nimport type { JsonAbisFromAllCalls, TransactionRequest } from '../transaction-request';\nimport { assembleTransactionSummary } from '../transaction-summary/assemble-transaction-summary';\nimport { processGqlReceipt } from '../transaction-summary/receipt';\nimport { getTotalFeeFromStatus } from '../transaction-summary/status';\nimport type { TransactionSummary, GqlTransaction, AbiMap } from '../transaction-summary/types';\nimport { extractTxError } from '../utils';\n\nimport { getDecodedLogs } from './getDecodedLogs';\n\n/** @hidden */\nexport type TransactionResultCallReceipt = ReceiptCall;\n/** @hidden */\nexport type TransactionResultReturnReceipt = ReceiptReturn;\n/** @hidden */\nexport type TransactionResultReturnDataReceipt = ReceiptReturnData & { data: string };\n/** @hidden */\nexport type TransactionResultPanicReceipt = ReceiptPanic;\n/** @hidden */\nexport type TransactionResultRevertReceipt = ReceiptRevert;\n/** @hidden */\nexport type TransactionResultLogReceipt = ReceiptLog;\n/** @hidden */\nexport type TransactionResultLogDataReceipt = ReceiptLogData & { data: string };\n/** @hidden */\nexport type TransactionResultTransferReceipt = ReceiptTransfer;\n/** @hidden */\nexport type TransactionResultTransferOutReceipt = ReceiptTransferOut;\n/** @hidden */\nexport type TransactionResultScriptResultReceipt = ReceiptScriptResult;\n/** @hidden */\nexport type TransactionResultMessageOutReceipt = ReceiptMessageOut;\nexport type TransactionResultMintReceipt = ReceiptMint;\nexport type TransactionResultBurnReceipt = ReceiptBurn;\n\n/** @hidden */\nexport type TransactionResultReceipt =\n | ReceiptCall\n | ReceiptReturn\n | (ReceiptReturnData & { data: string })\n | ReceiptPanic\n | ReceiptRevert\n | ReceiptLog\n | (ReceiptLogData & { data: string })\n | ReceiptTransfer\n | ReceiptTransferOut\n | ReceiptScriptResult\n | ReceiptMessageOut\n | TransactionResultMintReceipt\n | TransactionResultBurnReceipt;\n\n/** @hidden */\nexport type TransactionResult<TTransactionType = void> = TransactionSummary<TTransactionType> & {\n logs?: Array<unknown>;\n};\n\nfunction mapGqlOutputsToTxOutputs(\n outputs: GqlMalleableTransactionFieldsFragment['outputs']\n): Output[] {\n return outputs.map((o) => {\n const obj = 'amount' in o ? { ...o, amount: bn(o.amount) } : o;\n switch (obj.type) {\n case 'CoinOutput':\n return { ...obj, type: OutputType.Coin } satisfies OutputCoin;\n case 'ContractOutput':\n return {\n ...obj,\n type: OutputType.Contract,\n inputIndex: parseInt(obj.inputIndex, 10),\n } satisfies OutputContract;\n case 'ChangeOutput':\n return {\n ...obj,\n type: OutputType.Change,\n } satisfies OutputChange;\n case 'VariableOutput':\n return { ...obj, type: OutputType.Variable } satisfies OutputVariable;\n case 'ContractCreated':\n return {\n ...obj,\n type: OutputType.ContractCreated,\n contractId: obj.contract,\n } satisfies OutputContractCreated;\n default:\n return assertUnreachable(obj);\n }\n });\n}\n\n/**\n * Represents a response for a transaction.\n */\nexport class TransactionResponse {\n /** Transaction ID */\n id: string;\n /** Current provider */\n provider: Provider;\n /** Gas used on the transaction */\n gasUsed: BN = bn(0);\n /** The graphql Transaction with receipts object. */\n private gqlTransaction?: GqlTransaction;\n private request?: TransactionRequest;\n private status?: GqlStatusChangeSubscription['statusChange'];\n abis?: JsonAbisFromAllCalls;\n\n /**\n * Constructor for `TransactionResponse`.\n *\n * @param tx - The transaction ID or TransactionRequest.\n * @param provider - The provider.\n */\n constructor(\n tx: string | TransactionRequest,\n provider: Provider,\n chainId: number,\n abis?: JsonAbisFromAllCalls,\n private submitTxSubscription?: AsyncIterable<GqlSubmitAndAwaitStatusSubscription>\n ) {\n this.id = typeof tx === 'string' ? tx : tx.getTransactionId(chainId);\n\n this.provider = provider;\n this.abis = abis;\n this.request = typeof tx === 'string' ? undefined : tx;\n\n this.waitForResult = this.waitForResult.bind(this);\n }\n\n /**\n * Async constructor for `TransactionResponse`. This method can be used to create\n * an instance of `TransactionResponse` and wait for the transaction to be fetched\n * from the chain, ensuring that the `gqlTransaction` property is set.\n *\n * @param id - The transaction ID.\n * @param provider - The provider.\n */\n static async create(\n id: string,\n provider: Provider,\n abis?: JsonAbisFromAllCalls\n ): Promise<TransactionResponse> {\n const chainId = await provider.getChainId();\n const response = new TransactionResponse(id, provider, chainId, abis);\n await response.fetch();\n return response;\n }\n\n private applyMalleableSubscriptionFields<TTransactionType = void>(\n transaction: Transaction<TTransactionType>\n ) {\n const status = this.status;\n if (!status) {\n return;\n }\n\n // The SDK currently submits only these\n const tx = transaction as Transaction<\n TransactionType.Script | TransactionType.Create | TransactionType.Blob\n >;\n\n if (status.type === 'SuccessStatus' || status.type === 'FailureStatus') {\n tx.inputs = tx.inputs.map((input, idx) => {\n if ('txPointer' in input) {\n const correspondingInput = status.transaction.inputs?.[idx] as { txPointer: string };\n return {\n ...input,\n txPointer: TxPointerCoder.decodeFromGqlScalar(correspondingInput.txPointer),\n };\n }\n return input;\n });\n\n tx.outputs = mapGqlOutputsToTxOutputs(status.transaction.outputs);\n\n if ('receiptsRoot' in status.transaction) {\n (tx as Transaction<TransactionType.Script>).receiptsRoot = status.transaction\n .receiptsRoot as string;\n }\n }\n }\n\n private async getTransaction<TTransactionType = void>(): Promise<{\n tx: Transaction<TTransactionType>;\n bytes: Uint8Array;\n }> {\n if (this.request) {\n const tx = this.request.toTransaction() as Transaction<TTransactionType>;\n this.applyMalleableSubscriptionFields(tx);\n return {\n tx,\n bytes: this.request.toTransactionBytes(),\n };\n }\n\n const gqlTransaction = this.gqlTransaction ?? (await this.fetch());\n return {\n tx: this.decodeTransaction(gqlTransaction) as Transaction<TTransactionType>,\n bytes: arrayify(gqlTransaction.rawPayload),\n };\n }\n\n private getReceipts(): TransactionResultReceipt[] {\n const status = this.status ?? this.gqlTransaction?.status;\n\n switch (status?.type) {\n case 'SuccessStatus':\n case 'FailureStatus':\n return status.receipts.map(processGqlReceipt);\n default:\n return [];\n }\n }\n\n /**\n * Fetch the transaction with receipts from the provider.\n *\n * @returns Transaction with receipts query result.\n */\n async fetch(): Promise<GqlTransaction> {\n const response = await this.provider.operations.getTransactionWithReceipts({\n transactionId: this.id,\n });\n\n if (!response.transaction) {\n const subscription = await this.provider.operations.statusChange({\n transactionId: this.id,\n });\n\n for await (const { statusChange } of subscription) {\n if (statusChange) {\n this.status = statusChange;\n break;\n }\n }\n\n return this.fetch();\n }\n\n this.gqlTransaction = response.transaction;\n\n return response.transaction;\n }\n\n /**\n * Decode the raw payload of the transaction.\n *\n * @param transactionWithReceipts - The transaction with receipts object.\n * @returns The decoded transaction.\n */\n decodeTransaction<TTransactionType = void>(transactionWithReceipts: GqlTransaction) {\n return new TransactionCoder().decode(\n arrayify(transactionWithReceipts.rawPayload),\n 0\n )?.[0] as Transaction<TTransactionType>;\n }\n\n /**\n * Retrieves the TransactionSummary. If the `gqlTransaction` is not set, it will\n * fetch it from the provider\n *\n * @param contractsAbiMap - The contracts ABI map.\n * @returns\n */\n async getTransactionSummary<TTransactionType = void>(\n contractsAbiMap?: AbiMap\n ): Promise<TransactionSummary<TTransactionType>> {\n const { tx: transaction, bytes: transactionBytes } =\n await this.getTransaction<TTransactionType>();\n\n const { gasPerByte, gasPriceFactor, gasCosts, maxGasPerTx } =\n await this.provider.getGasConfig();\n\n // If we have the total fee, we do not need to refetch the gas price\n const totalFee = getTotalFeeFromStatus(this.status ?? this.gqlTransaction?.status);\n const gasPrice = totalFee ? bn(0) : await this.provider.getLatestGasPrice();\n\n const maxInputs = (await this.provider.getChain()).consensusParameters.txParameters.maxInputs;\n const baseAssetId = await this.provider.getBaseAssetId();\n\n const transactionSummary = assembleTransactionSummary<TTransactionType>({\n id: this.id,\n receipts: this.getReceipts(),\n transaction,\n transactionBytes,\n gqlTransactionStatus: this.status ?? this.gqlTransaction?.status,\n gasPerByte,\n gasPriceFactor,\n abiMap: contractsAbiMap,\n maxInputs,\n gasCosts,\n maxGasPerTx,\n gasPrice,\n baseAssetId,\n });\n\n return transactionSummary;\n }\n\n private async waitForStatusChange() {\n const status = this.gqlTransaction?.status?.type;\n if (status && status !== 'SubmittedStatus') {\n return;\n }\n\n const subscription =\n this.submitTxSubscription ??\n (await this.provider.operations.statusChange({\n transactionId: this.id,\n }));\n\n for await (const sub of subscription) {\n const statusChange = 'statusChange' in sub ? sub.statusChange : sub.submitAndAwaitStatus;\n this.status = statusChange;\n if (statusChange.type === 'SqueezedOutStatus') {\n this.unsetResourceCache();\n throw new FuelError(\n ErrorCode.TRANSACTION_SQUEEZED_OUT,\n `Transaction Squeezed Out with reason: ${statusChange.reason}`\n );\n }\n if (statusChange.type !== 'SubmittedStatus') {\n break;\n }\n }\n }\n\n /**\n * Assembles the result of a transaction by retrieving the transaction summary,\n * decoding logs (if available), and handling transaction failure.\n *\n * This method can be used to obtain the result of a transaction that has just\n * been submitted or one that has already been processed.\n *\n * @template TTransactionType - The type of the transaction.\n * @param contractsAbiMap - The map of contract ABIs.\n * @returns - The assembled transaction result.\n * @throws If the transaction status is a failure.\n */\n async assembleResult<TTransactionType = void>(\n contractsAbiMap?: AbiMap\n ): Promise<TransactionResult<TTransactionType>> {\n const transactionSummary = await this.getTransactionSummary<TTransactionType>(contractsAbiMap);\n\n const transactionResult: TransactionResult<TTransactionType> = {\n ...transactionSummary,\n };\n\n let logs: Array<unknown> = [];\n\n if (this.abis) {\n logs = getDecodedLogs(\n transactionSummary.receipts,\n this.abis.main,\n this.abis.otherContractsAbis\n );\n\n transactionResult.logs = logs;\n }\n\n const { receipts } = transactionResult;\n\n const status = this.status ?? this.gqlTransaction?.status;\n if (status?.type === 'FailureStatus') {\n this.unsetResourceCache();\n const { reason } = status;\n throw extractTxError({\n receipts,\n statusReason: reason,\n logs,\n });\n }\n\n return transactionResult;\n }\n\n /**\n * Waits for transaction to complete and returns the result.\n *\n * @returns The completed transaction result\n */\n async waitForResult<TTransactionType = void>(\n contractsAbiMap?: AbiMap\n ): Promise<TransactionResult<TTransactionType>> {\n await this.waitForStatusChange();\n return this.assembleResult<TTransactionType>(contractsAbiMap);\n }\n\n /**\n * Waits for transaction to complete and returns the result.\n *\n * @param contractsAbiMap - The contracts ABI map.\n */\n async wait<TTransactionType = void>(\n contractsAbiMap?: AbiMap\n ): Promise<TransactionResult<TTransactionType>> {\n return this.waitForResult<TTransactionType>(contractsAbiMap);\n }\n\n private unsetResourceCache() {\n this.provider.cache?.unset(this.id);\n }\n}\n","import { bn, type BN } from '@fuel-ts/math';\nimport { PolicyType, type Transaction } from '@fuel-ts/transactions';\nimport { DateTime, hexlify } from '@fuel-ts/utils';\n\nimport type { GasCosts } from '../provider';\nimport type { TransactionResultReceipt } from '../transaction-response';\nimport { getGasUsedFromReceipts } from '../utils';\n\nimport { calculateTXFeeForSummary } from './calculate-tx-fee-for-summary';\nimport {\n getOperations,\n getTransactionTypeName,\n isTypeMint,\n isTypeCreate,\n isTypeScript,\n isTypeUpgrade,\n isTypeUpload,\n isTypeBlob,\n} from './operations';\nimport { extractBurnedAssetsFromReceipts, extractMintedAssetsFromReceipts } from './receipt';\nimport { processGraphqlStatus } from './status';\nimport type { AbiMap, GraphqlTransactionStatus, TransactionSummary } from './types';\n\nexport interface AssembleTransactionSummaryParams {\n gasPerByte: BN;\n gasPriceFactor: BN;\n transaction: Transaction;\n id: string;\n transactionBytes: Uint8Array;\n gqlTransactionStatus?: GraphqlTransactionStatus;\n receipts: TransactionResultReceipt[];\n abiMap?: AbiMap;\n maxInputs: BN;\n gasCosts: GasCosts;\n maxGasPerTx: BN;\n gasPrice: BN;\n baseAssetId: string;\n}\n\n/** @hidden */\nexport function assembleTransactionSummary<TTransactionType = void>(\n params: AssembleTransactionSummaryParams\n) {\n const {\n id,\n receipts,\n gasPerByte,\n gasPriceFactor,\n transaction,\n transactionBytes,\n gqlTransactionStatus,\n abiMap = {},\n maxInputs,\n gasCosts,\n maxGasPerTx,\n gasPrice,\n baseAssetId,\n } = params;\n\n const gasUsed = getGasUsedFromReceipts(receipts);\n\n const rawPayload = hexlify(transactionBytes);\n\n const operations = getOperations({\n transactionType: transaction.type,\n inputs: transaction.inputs || [],\n outputs: transaction.outputs || [],\n receipts,\n rawPayload,\n abiMap,\n maxInputs,\n baseAssetId,\n });\n\n const typeName = getTransactionTypeName(transaction.type);\n\n const tip = bn(transaction.policies?.find((policy) => policy.type === PolicyType.Tip)?.data);\n\n const { isStatusFailure, isStatusPending, isStatusSuccess, blockId, status, time, totalFee } =\n processGraphqlStatus(gqlTransactionStatus);\n\n const fee =\n totalFee ??\n calculateTXFeeForSummary({\n gasPrice,\n rawPayload,\n tip,\n consensusParameters: {\n gasCosts,\n maxGasPerTx,\n feeParams: {\n gasPerByte,\n gasPriceFactor,\n },\n },\n });\n\n const mintedAssets = extractMintedAssetsFromReceipts(receipts);\n const burnedAssets = extractBurnedAssetsFromReceipts(receipts);\n\n let date: DateTime | undefined;\n\n if (time) {\n date = DateTime.fromTai64(time);\n }\n\n const transactionSummary: TransactionSummary<TTransactionType> = {\n id,\n tip,\n fee,\n gasUsed,\n operations,\n type: typeName,\n blockId,\n time,\n status,\n receipts,\n mintedAssets,\n burnedAssets,\n isTypeMint: isTypeMint(transaction.type),\n isTypeCreate: isTypeCreate(transaction.type),\n isTypeScript: isTypeScript(transaction.type),\n isTypeUpgrade: isTypeUpgrade(transaction.type),\n isTypeUpload: isTypeUpload(transaction.type),\n isTypeBlob: isTypeBlob(transaction.type),\n isStatusFailure,\n isStatusSuccess,\n isStatusPending,\n date,\n transaction: transaction as Transaction<TTransactionType>,\n };\n\n return transactionSummary;\n}\n","import type { BN } from '@fuel-ts/math';\nimport { bn } from '@fuel-ts/math';\nimport type { TransactionCreate, TransactionScript } from '@fuel-ts/transactions';\nimport { PolicyType, TransactionCoder, TransactionType } from '@fuel-ts/transactions';\nimport { arrayify } from '@fuel-ts/utils';\n\nimport type { GqlFeeParameters } from '../__generated__/operations';\nimport type { ConsensusParameters } from '../provider';\nimport {\n calculateGasFee,\n calculateMetadataGasForTxCreate,\n calculateMetadataGasForTxScript,\n getMaxGas,\n getMinGas,\n} from '../utils/gas';\n\ntype FeeParams =\n | Pick<GqlFeeParameters, 'gasPerByte' | 'gasPriceFactor'>\n | {\n gasPerByte: BN | number;\n gasPriceFactor: BN | number;\n };\n\nexport type CalculateTXFeeForSummaryParams = {\n gasPrice: BN;\n rawPayload: string;\n tip: BN;\n consensusParameters: Pick<ConsensusParameters, 'gasCosts'> & {\n feeParams: FeeParams;\n maxGasPerTx: BN;\n };\n};\n\nexport const calculateTXFeeForSummary = (params: CalculateTXFeeForSummaryParams): BN => {\n const {\n gasPrice,\n rawPayload,\n tip,\n consensusParameters: { gasCosts, feeParams, maxGasPerTx },\n } = params;\n\n const gasPerByte = bn(feeParams.gasPerByte);\n const gasPriceFactor = bn(feeParams.gasPriceFactor);\n\n const transactionBytes = arrayify(rawPayload);\n\n const [transaction] = new TransactionCoder().decode(transactionBytes, 0);\n\n const { type, witnesses, inputs, policies } = transaction as\n | TransactionCreate\n | TransactionScript;\n\n let metadataGas = bn(0);\n let gasLimit = bn(0);\n\n if (type !== TransactionType.Create && type !== TransactionType.Script) {\n return bn(0);\n }\n\n if (type === TransactionType.Create) {\n const { bytecodeWitnessIndex, storageSlots } = transaction as TransactionCreate;\n\n const contractBytesSize = bn(arrayify(witnesses[bytecodeWitnessIndex].data).length);\n\n metadataGas = calculateMetadataGasForTxCreate({\n contractBytesSize,\n gasCosts,\n stateRootSize: storageSlots.length || 0,\n txBytesSize: transactionBytes.length,\n });\n } else {\n const { scriptGasLimit } = transaction;\n\n if (scriptGasLimit) {\n gasLimit = scriptGasLimit;\n }\n\n metadataGas = calculateMetadataGasForTxScript({\n gasCosts,\n txBytesSize: transactionBytes.length,\n });\n }\n\n const minGas = getMinGas({\n gasCosts,\n gasPerByte: bn(gasPerByte),\n inputs,\n metadataGas,\n txBytesSize: transactionBytes.length,\n });\n\n const witnessLimit = policies.find((policy) => policy.type === PolicyType.WitnessLimit)?.data as\n | BN\n | undefined;\n\n const witnessesLength = witnesses.reduce((acc, wit) => acc + wit.dataLength, 0);\n\n const maxGas = getMaxGas({\n gasPerByte,\n minGas,\n witnessesLength,\n gasLimit,\n witnessLimit,\n maxGasPerTx,\n });\n\n const maxFee = calculateGasFee({\n gasPrice,\n gas: maxGas,\n priceFactor: gasPriceFactor,\n tip,\n });\n\n return maxFee;\n};\n","import { ZeroBytes32 } from '@fuel-ts/address/configs';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport type { BN } from '@fuel-ts/math';\nimport { bn } from '@fuel-ts/math';\nimport { ReceiptType, TransactionType } from '@fuel-ts/transactions';\nimport type { InputContract, Output, OutputChange, Input } from '@fuel-ts/transactions';\n\nimport type {\n TransactionResultReceipt,\n TransactionResultCallReceipt,\n TransactionResultMessageOutReceipt,\n TransactionResultTransferOutReceipt,\n TransactionResultTransferReceipt,\n} from '../transaction-response';\n\nimport type { FunctionCall } from './call';\nimport { getFunctionCall } from './call';\nimport {\n getInputFromAssetId,\n getInputAccountAddress,\n getInputContractFromIndex,\n getInputsContract,\n getInputsCoinAndMessage,\n aggregateInputsAmountsByAssetAndOwner,\n} from './input';\nimport {\n getOutputsChange,\n getOutputsCoin,\n getOutputsContract,\n getOutputsContractCreated,\n} from './output';\nimport { AddressType, ChainName, OperationName, TransactionTypeName } from './types';\nimport type {\n InputOutputParam,\n InputParam,\n OperationCoin,\n RawPayloadParam,\n ReceiptParam,\n Operation,\n GetOperationParams,\n GetTransferOperationsParams,\n AbiMap,\n} from './types';\n\n/**\n * Extracts a specific type of receipt from a list of receipts.\n *\n * @param receipts - The list of receipts to filter.\n * @param type - The type of receipt to filter for.\n * @returns The filtered list of receipts.\n */\nexport function getReceiptsByType<T = TransactionResultReceipt>(\n receipts: TransactionResultReceipt[],\n type: ReceiptType\n) {\n return (receipts ?? []).filter((r) => r.type === type) as T[];\n}\n\n/**\n * Returns the transaction type's name based on the transaction type enum value.\n *\n * @param transactionType - The transaction type enum value.\n * @returns The transaction type's name.\n */\nexport function getTransactionTypeName(transactionType: TransactionType): TransactionTypeName {\n switch (transactionType) {\n case TransactionType.Mint:\n return TransactionTypeName.Mint;\n case TransactionType.Create:\n return TransactionTypeName.Create;\n case TransactionType.Script:\n return TransactionTypeName.Script;\n case TransactionType.Blob:\n return TransactionTypeName.Blob;\n case TransactionType.Upgrade:\n return TransactionTypeName.Upgrade;\n case TransactionType.Upload:\n return TransactionTypeName.Upload;\n default:\n throw new FuelError(\n ErrorCode.UNSUPPORTED_TRANSACTION_TYPE,\n `Unsupported transaction type: ${transactionType}.`\n );\n }\n}\n\n/** @hidden */\nexport function isType(transactionType: TransactionType, type: TransactionTypeName) {\n const txType = getTransactionTypeName(transactionType);\n\n return txType === type;\n}\n\n/** @hidden */\nexport function isTypeMint(transactionType: TransactionType) {\n return isType(transactionType, TransactionTypeName.Mint);\n}\n\n/** @hidden */\nexport function isTypeCreate(transactionType: TransactionType) {\n return isType(transactionType, TransactionTypeName.Create);\n}\n\n/** @hidden */\nexport function isTypeScript(transactionType: TransactionType) {\n return isType(transactionType, TransactionTypeName.Script);\n}\n\n/** @hidden */\nexport function isTypeUpgrade(transactionType: TransactionType) {\n return isType(transactionType, TransactionTypeName.Upgrade);\n}\n\n/** @hidden */\nexport function isTypeUpload(transactionType: TransactionType) {\n return isType(transactionType, TransactionTypeName.Upload);\n}\n\n/** @hidden */\nexport function isTypeBlob(transactionType: TransactionType) {\n return isType(transactionType, TransactionTypeName.Blob);\n}\n\n/** @hidden */\nexport function hasSameAssetId(a: OperationCoin) {\n return (b: OperationCoin) => a.assetId === b.assetId;\n}\n\n/** @hidden */\nexport function getReceiptsCall(receipts: TransactionResultReceipt[]) {\n return getReceiptsByType<TransactionResultCallReceipt>(receipts, ReceiptType.Call);\n}\n\n/** @hidden */\nexport function getReceiptsMessageOut(receipts: TransactionResultReceipt[]) {\n return getReceiptsByType<TransactionResultMessageOutReceipt>(receipts, ReceiptType.MessageOut);\n}\n\n/** @hidden */\nfunction mergeAssets(op1: Operation, op2: Operation): OperationCoin[] {\n const assets1 = op1.assetsSent || [];\n const assets2 = op2.assetsSent || [];\n\n const assetMap = new Map<string, OperationCoin>();\n\n // Merge assets from op1\n assets1.forEach((asset) => {\n assetMap.set(asset.assetId, { ...asset });\n });\n\n // Merge assets from op2, adding to existing assets or creating new ones\n assets2.forEach((asset) => {\n const existingAsset = assetMap.get(asset.assetId);\n if (existingAsset) {\n existingAsset.amount = bn(existingAsset.amount).add(asset.amount);\n } else {\n assetMap.set(asset.assetId, { ...asset });\n }\n });\n\n return Array.from(assetMap.values());\n}\n\n/** @hidden */\nfunction isSameOperation(a: Operation, b: Operation) {\n return (\n a.name === b.name &&\n a.from?.address === b.from?.address &&\n a.to?.address === b.to?.address &&\n a.from?.type === b.from?.type &&\n a.to?.type === b.to?.type\n );\n}\n\n/** @hidden */\nfunction mergeAssetsSent(existing: Operation, toAdd: Operation): Operation['assetsSent'] {\n if (!toAdd.assetsSent?.length) {\n return existing.assetsSent;\n }\n\n return existing.assetsSent?.length ? mergeAssets(existing, toAdd) : toAdd.assetsSent;\n}\n\n/** @hidden */\nfunction mergeCalls(existing: Operation, toAdd: Operation): Operation['calls'] {\n if (!toAdd.calls?.length) {\n return existing.calls;\n }\n\n return [...(existing.calls || []), ...toAdd.calls];\n}\n\n/** @hidden */\nfunction mergeOperations(existing: Operation, toAdd: Operation): Operation {\n return {\n ...existing,\n assetsSent: mergeAssetsSent(existing, toAdd),\n calls: mergeCalls(existing, toAdd),\n };\n}\n\n/** @hidden */\nexport function addOperation(operations: Operation[], toAdd: Operation): Operation[] {\n const existingIndex = operations.findIndex((op) => isSameOperation(op, toAdd));\n\n if (existingIndex === -1) {\n return [...operations, toAdd];\n }\n\n return operations.map((op, index) => (index === existingIndex ? mergeOperations(op, toAdd) : op));\n}\n\n/** @hidden */\nexport function getReceiptsTransferOut(receipts: TransactionResultReceipt[]) {\n return getReceiptsByType<TransactionResultTransferOutReceipt>(receipts, ReceiptType.TransferOut);\n}\n\n/**\n * Creates withdrawal operations from Fuel to Ethereum based on message out receipts\n *\n * @param inputs - Transaction inputs containing account information\n * @param receipts - Transaction receipts containing withdrawal details\n * @param baseAssetId - The ID of the asset being withdrawn\n * @returns Array of withdrawal operations with sender, recipient, and asset id.\n */\nexport function getWithdrawFromFuelOperations({\n inputs,\n receipts,\n baseAssetId,\n}: InputParam & ReceiptParam & { baseAssetId: string }): Operation[] {\n const messageOutReceipts = getReceiptsMessageOut(receipts);\n\n const withdrawFromFuelOperations = messageOutReceipts.reduce(\n (prevWithdrawFromFuelOps, receipt) => {\n const input = getInputFromAssetId(inputs, baseAssetId, true);\n if (input) {\n const inputAddress = getInputAccountAddress(input);\n const newWithdrawFromFuelOps = addOperation(prevWithdrawFromFuelOps, {\n name: OperationName.withdrawFromFuel,\n from: {\n type: AddressType.account,\n address: inputAddress,\n },\n to: {\n type: AddressType.account,\n address: receipt.recipient.toString(),\n chain: ChainName.ethereum,\n },\n assetsSent: [\n {\n amount: receipt.amount,\n assetId: baseAssetId,\n },\n ],\n });\n\n return newWithdrawFromFuelOps;\n }\n\n return prevWithdrawFromFuelOps;\n },\n [] as Operation[]\n );\n\n return withdrawFromFuelOperations;\n}\n\n/** @hidden */\nfunction getContractCalls(\n contractInput: InputContract,\n abiMap: AbiMap | undefined,\n receipt: TransactionResultCallReceipt,\n rawPayload: string,\n maxInputs: BN\n): FunctionCall[] {\n const abi = abiMap?.[contractInput.contractID];\n if (!abi) {\n return [];\n }\n\n return [\n getFunctionCall({\n abi,\n receipt,\n rawPayload,\n maxInputs,\n }),\n ];\n}\n\n/** @hidden */\nfunction getAssetsSent(receipt: TransactionResultCallReceipt): OperationCoin[] | undefined {\n return receipt.amount?.isZero()\n ? undefined\n : [\n {\n amount: receipt.amount,\n assetId: receipt.assetId,\n },\n ];\n}\n\n/** @hidden */\nfunction processCallReceipt(\n receipt: TransactionResultCallReceipt,\n contractInput: InputContract,\n inputs: Input[],\n abiMap: AbiMap | undefined,\n rawPayload: string,\n maxInputs: BN,\n baseAssetId: string\n): Operation[] {\n const assetId = receipt.assetId === ZeroBytes32 ? baseAssetId : receipt.assetId;\n const input = getInputFromAssetId(inputs, assetId, assetId === baseAssetId);\n if (!input) {\n return [];\n }\n\n const inputAddress = getInputAccountAddress(input);\n const calls = getContractCalls(contractInput, abiMap, receipt, rawPayload, maxInputs);\n\n return [\n {\n name: OperationName.contractCall,\n from: {\n type: AddressType.account,\n address: inputAddress,\n },\n to: {\n type: AddressType.contract,\n address: receipt.to,\n },\n assetsSent: getAssetsSent(receipt),\n calls,\n },\n ];\n}\n\n/** @hidden */\nexport function getContractCallOperations({\n inputs,\n outputs,\n receipts,\n abiMap,\n rawPayload,\n maxInputs,\n baseAssetId,\n}: InputOutputParam &\n ReceiptParam &\n Pick<GetOperationParams, 'abiMap' | 'maxInputs' | 'baseAssetId'> &\n RawPayloadParam): Operation[] {\n const contractCallReceipts = getReceiptsCall(receipts);\n const contractOutputs = getOutputsContract(outputs);\n\n return contractOutputs.flatMap((output) => {\n const contractInput = getInputContractFromIndex(inputs, output.inputIndex);\n if (!contractInput) {\n return [];\n }\n\n return contractCallReceipts\n .filter((receipt) => receipt.to === contractInput.contractID)\n .flatMap((receipt) =>\n processCallReceipt(\n receipt,\n contractInput,\n inputs,\n abiMap,\n rawPayload as string,\n maxInputs,\n baseAssetId\n )\n );\n });\n}\n\n/**\n * Extracts a transfer operation from a transaction receipt, determining the addresses and types\n * of the sender and receiver, along with the transferred asset details.\n *\n * @param receipt - The transaction receipt containing transfer information\n * @param contractInputs - Array of contract inputs to determine address types\n * @param changeOutputs - Array of change outputs to resolve zero addresses\n * @returns A transfer operation object with sender, receiver and asset details\n */\nfunction extractTransferOperationFromReceipt(\n receipt: TransactionResultTransferReceipt | TransactionResultTransferOutReceipt,\n contractInputs: InputContract[],\n changeOutputs: OutputChange[]\n) {\n const { to: toAddress, assetId, amount } = receipt;\n let { id: fromAddress } = receipt;\n\n const toType = contractInputs.some((input) => input.contractID === toAddress)\n ? AddressType.contract\n : AddressType.account;\n\n if (ZeroBytes32 === fromAddress) {\n const change = changeOutputs.find((output) => output.assetId === assetId);\n\n fromAddress = change?.to || fromAddress;\n }\n\n const fromType = contractInputs.some((input) => input.contractID === fromAddress)\n ? AddressType.contract\n : AddressType.account;\n\n return {\n name: OperationName.transfer,\n from: {\n type: fromType,\n address: fromAddress,\n },\n to: {\n type: toType,\n address: toAddress,\n },\n assetsSent: [\n {\n assetId: assetId.toString(),\n amount,\n },\n ],\n };\n}\n\n/** @hidden */\nexport function getTransferOperations({\n inputs,\n outputs,\n receipts,\n baseAssetId,\n}: GetTransferOperationsParams): Operation[] {\n let operations: Operation[] = [];\n\n const coinOutputs = getOutputsCoin(outputs);\n const contractInputs = getInputsContract(inputs);\n const changeOutputs = getOutputsChange(outputs);\n\n const aggregated = aggregateInputsAmountsByAssetAndOwner(inputs, baseAssetId);\n\n /**\n * Extracting transfer operations between wallets, as they do not produce receipts\n */\n coinOutputs.forEach(({ amount, assetId, to }) => {\n const txPayers = aggregated.get(assetId) || new Map<string, BN>();\n let selectedPayer: string | undefined;\n let fallbackPayer: string | undefined;\n\n for (const [address, payedAmount] of txPayers) {\n if (!fallbackPayer) {\n fallbackPayer = address; // Set the first payer as a fallback\n }\n\n if (payedAmount.gte(amount)) {\n selectedPayer = address;\n break; // Stop looping once a suitable payer is found\n }\n }\n\n // If no suitable payer is found, use the fallback payer\n selectedPayer = selectedPayer || fallbackPayer;\n\n if (selectedPayer) {\n operations = addOperation(operations, {\n name: OperationName.transfer,\n from: {\n type: AddressType.account,\n address: selectedPayer,\n },\n to: {\n type: AddressType.account,\n address: to,\n },\n assetsSent: [{ assetId, amount }],\n });\n }\n });\n\n /**\n * `Transfer` receipts are produced from transfers:\n * - Wallet to Contract\n * - Contract to Contract\n */\n const transferReceipts = getReceiptsByType<TransactionResultTransferReceipt>(\n receipts,\n ReceiptType.Transfer\n );\n\n /**\n * `TransferOut` receipts are produced from transfer:\n * - Contract to Wallet\n */\n const transferOutReceipts = getReceiptsByType<TransactionResultTransferOutReceipt>(\n receipts,\n ReceiptType.TransferOut\n );\n\n [...transferReceipts, ...transferOutReceipts].forEach((receipt) => {\n const operation = extractTransferOperationFromReceipt(receipt, contractInputs, changeOutputs);\n\n operations = addOperation(operations, operation);\n });\n\n return operations;\n}\n\n/** @hidden */\nexport function getPayProducerOperations(outputs: Output[]): Operation[] {\n const coinOutputs = getOutputsCoin(outputs);\n const payProducerOperations = coinOutputs.reduce((prev, output) => {\n const operations = addOperation(prev, {\n name: OperationName.payBlockProducer,\n from: {\n type: AddressType.account,\n address: 'Network',\n },\n to: {\n type: AddressType.account,\n address: output.to.toString(),\n },\n assetsSent: [\n {\n assetId: output.assetId.toString(),\n amount: output.amount,\n },\n ],\n });\n\n return operations;\n }, [] as Operation[]);\n\n return payProducerOperations;\n}\n\n/** @hidden */\nexport function getContractCreatedOperations({ inputs, outputs }: InputOutputParam): Operation[] {\n const contractCreatedOutputs = getOutputsContractCreated(outputs);\n const input = getInputsCoinAndMessage(inputs)[0];\n const fromAddress = getInputAccountAddress(input);\n const contractCreatedOperations = contractCreatedOutputs.reduce((prev, contractCreatedOutput) => {\n const operations = addOperation(prev, {\n name: OperationName.contractCreated,\n from: {\n type: AddressType.account,\n address: fromAddress,\n },\n to: {\n type: AddressType.contract,\n address: contractCreatedOutput?.contractId || '',\n },\n });\n\n return operations;\n }, [] as Operation[]);\n\n return contractCreatedOperations;\n}\n\n/** @hidden */\nexport function getOperations({\n transactionType,\n inputs,\n outputs,\n receipts,\n abiMap,\n rawPayload,\n maxInputs,\n baseAssetId,\n}: GetOperationParams): Operation[] {\n if (isTypeCreate(transactionType)) {\n return [...getContractCreatedOperations({ inputs, outputs })];\n }\n\n if (isTypeScript(transactionType)) {\n return [\n ...getTransferOperations({ inputs, outputs, receipts, baseAssetId }),\n ...getContractCallOperations({\n inputs,\n outputs,\n receipts,\n abiMap,\n rawPayload,\n maxInputs,\n baseAssetId,\n }),\n ...getWithdrawFromFuelOperations({ inputs, receipts, baseAssetId }),\n ];\n }\n // at this point we are sure it's a mint transaction\n return [...getPayProducerOperations(outputs)];\n}\n","import { Interface, type JsonAbi } from '@fuel-ts/abi-coder';\nimport type { BN } from '@fuel-ts/math';\nimport type { ReceiptCall } from '@fuel-ts/transactions';\n\ntype GetFunctionCallProps = {\n abi: JsonAbi;\n receipt: ReceiptCall;\n rawPayload?: string;\n maxInputs: BN;\n};\n\nexport interface FunctionCall {\n amount?: BN | undefined;\n assetId?: string | undefined;\n functionSignature: string;\n functionName: string;\n argumentsProvided: Record<string, unknown> | undefined;\n}\n\nexport const getFunctionCall = ({ abi, receipt }: GetFunctionCallProps): FunctionCall => {\n const abiInterface = new Interface(abi);\n const callFunctionSelector = receipt.param1.toHex(8);\n const functionFragment = abiInterface.getFunction(callFunctionSelector);\n const inputs = functionFragment.jsonFn.inputs;\n\n const encodedArgs = receipt.param2.toHex();\n let argumentsProvided;\n\n // use bytes got from rawPayload to decode function params\n const data = functionFragment.decodeArguments(encodedArgs);\n if (data) {\n // put together decoded data with input names from abi\n argumentsProvided = inputs.reduce((prev, input, index) => {\n const value = data[index];\n const name = input.name;\n\n if (name) {\n return {\n ...prev,\n // reparse to remove bn\n [name]: JSON.parse(JSON.stringify(value)),\n };\n }\n\n return prev;\n }, {});\n }\n\n const call = {\n functionSignature: functionFragment.signature,\n functionName: functionFragment.name,\n argumentsProvided,\n ...(receipt.amount?.isZero() ? {} : { amount: receipt.amount, assetId: receipt.assetId }),\n };\n\n return call;\n};\n","import { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { BN } from '@fuel-ts/math';\nimport type { Input, InputCoin, InputContract, InputMessage } from '@fuel-ts/transactions';\nimport { InputType } from '@fuel-ts/transactions';\n\n/** @hidden */\nexport function getInputsByTypes<T = Input>(inputs: Input[], types: Array<InputType>) {\n return inputs.filter((i) => types.includes(i.type)) as T[];\n}\n\n/** @hidden */\nexport function getInputsByType<T = Input>(inputs: Input[], type: InputType) {\n return inputs.filter((i) => i.type === type) as T[];\n}\n\n/** @hidden */\nexport function getInputsCoin(inputs: Input[]): InputCoin[] {\n return getInputsByType<InputCoin>(inputs, InputType.Coin);\n}\n\n/** @hidden */\nexport function getInputsMessage(inputs: Input[]) {\n return getInputsByType<InputMessage>(inputs, InputType.Message);\n}\n\n/** @hidden */\nexport function getInputsCoinAndMessage(inputs: Input[]) {\n return getInputsByTypes<InputCoin | InputMessage>(inputs, [InputType.Coin, InputType.Message]);\n}\n\n/** @hidden */\nexport function isInputCoin(input: Input): input is InputCoin {\n return input.type === InputType.Coin;\n}\n\n/** @hidden */\nexport function getInputsContract(inputs: Input[]) {\n return getInputsByType<InputContract>(inputs, InputType.Contract);\n}\n\n/** @hidden */\nfunction findCoinInput(inputs: Input[], assetId: string): InputCoin | undefined {\n const coinInputs = getInputsCoin(inputs);\n return coinInputs.find((i) => i.assetId === assetId);\n}\n\n/** @hidden */\nexport function aggregateInputsAmountsByAssetAndOwner(\n inputs: Input[],\n baseAssetId: string\n): Map<string, Map<string, BN>> {\n const aggregated = new Map<string, Map<string, BN>>();\n\n getInputsCoinAndMessage(inputs).forEach((input) => {\n const assetId = isInputCoin(input) ? input.assetId : baseAssetId;\n const owner = isInputCoin(input) ? input.owner : input.recipient;\n\n // Ensure that the map for the assetId exists\n let ownersMap = aggregated.get(assetId);\n if (!ownersMap) {\n ownersMap = new Map<string, BN>();\n aggregated.set(assetId, ownersMap);\n }\n\n // Ensure that the map for the owner exists\n let ownerBalance = ownersMap.get(owner);\n if (!ownerBalance) {\n ownerBalance = new BN(0);\n ownersMap.set(owner, ownerBalance);\n }\n\n // Update the balance\n ownersMap.set(owner, ownerBalance.add(input.amount));\n });\n\n return aggregated;\n}\n\n/** @hidden */\nfunction findMessageInput(inputs: Input[]): InputMessage | undefined {\n return getInputsMessage(inputs)?.[0];\n}\n/** @hidden */\nexport function getInputFromAssetId(\n inputs: Input[],\n assetId: string,\n isBaseAsset = false\n): InputCoin | InputMessage | undefined {\n const coinInput = findCoinInput(inputs, assetId);\n if (coinInput) {\n return coinInput;\n }\n\n if (isBaseAsset) {\n return findMessageInput(inputs);\n }\n\n // #TODO: we should throw an error here if we are unable to return a valid input\n return undefined;\n}\n\n/** @hidden */\nexport function getInputContractFromIndex(\n inputs: Input[],\n inputIndex: number\n): InputContract | undefined {\n if (inputIndex == null) {\n return undefined;\n }\n\n const contractInput = inputs?.[inputIndex];\n\n if (!contractInput) {\n return undefined;\n }\n if (contractInput.type !== InputType.Contract) {\n throw new FuelError(\n ErrorCode.INVALID_TRANSACTION_INPUT,\n `Contract input should be of type 'contract'.`\n );\n }\n\n return contractInput as InputContract;\n}\n\n/** @hidden */\nexport function getInputAccountAddress(input: Input) {\n if (input.type === InputType.Coin) {\n return input.owner.toString();\n }\n\n if (input.type === InputType.Message) {\n return input.recipient.toString();\n }\n\n return '';\n}\n","import type {\n Output,\n OutputChange,\n OutputCoin,\n OutputContract,\n OutputContractCreated,\n OutputVariable,\n} from '@fuel-ts/transactions';\nimport { OutputType } from '@fuel-ts/transactions';\n\n/** @hidden */\nexport function getOutputsByType<T = Output>(outputs: Output[], type: OutputType) {\n return outputs.filter((o) => o.type === type) as T[];\n}\n\n/** @hidden */\nexport function getOutputsContractCreated(outputs: Output[]) {\n return getOutputsByType<OutputContractCreated>(outputs, OutputType.ContractCreated);\n}\n\n/** @hidden */\nexport function getOutputsCoin(outputs: Output[]) {\n return getOutputsByType<OutputCoin>(outputs, OutputType.Coin);\n}\n\n/** @hidden */\nexport function getOutputsChange(outputs: Output[]) {\n return getOutputsByType<OutputChange>(outputs, OutputType.Change);\n}\n\n/** @hidden */\nexport function getOutputsContract(outputs: Output[]) {\n return getOutputsByType<OutputContract>(outputs, OutputType.Contract);\n}\n\n/** @hidden */\nexport function getOutputsVariable(outputs: Output[]) {\n return getOutputsByType<OutputVariable>(outputs, OutputType.Variable);\n}\n","import type { JsonAbi } from '@fuel-ts/abi-coder';\nimport type { B256Address } from '@fuel-ts/address';\nimport type { BN, BNInput } from '@fuel-ts/math';\nimport type { Input, Output, Transaction, TransactionType } from '@fuel-ts/transactions';\n\nimport type { GqlReceiptFragment, GqlSuccessStatusFragment } from '../__generated__/operations';\nimport type { TransactionResultReceipt } from '../transaction-response';\n\nexport type SubmittedStatus = {\n type: 'SubmittedStatus';\n time: string;\n};\n\nexport type SuccessStatus = {\n type: 'SuccessStatus';\n time: string;\n programState?: GqlSuccessStatusFragment['programState'];\n block?: {\n id: string;\n };\n receipts: GqlReceiptFragment[];\n totalGas: string;\n totalFee: string;\n};\n\nexport type FailureStatus = {\n type: 'FailureStatus';\n time: string;\n reason: string;\n block?: {\n id: string;\n };\n receipts: GqlReceiptFragment[];\n totalGas: string;\n totalFee: string;\n};\n\nexport type SqueezedOutStatus = {\n type: 'SqueezedOutStatus';\n reason: string;\n};\n\nexport type GraphqlTransactionStatus =\n | SubmittedStatus\n | SuccessStatus\n | FailureStatus\n | SqueezedOutStatus\n | null;\n\nexport type GqlTransaction = {\n id: string;\n rawPayload: string;\n status?: GraphqlTransactionStatus;\n};\n\nexport type Reason = FailureStatus['reason'];\nexport type ProgramState = SuccessStatus['programState'];\nexport type Time = SubmittedStatus['time'] | SuccessStatus['time'] | FailureStatus['time'];\nexport type BlockId = string;\n\n/**\n * @hidden\n */\nexport enum TransactionTypeName {\n Create = 'Create',\n Mint = 'Mint',\n Script = 'Script',\n Upgrade = 'Upgrade',\n Upload = 'Upload',\n Blob = 'Blob',\n}\n\n/**\n * @hidden\n */\nexport enum TransactionStatus {\n submitted = 'submitted',\n success = 'success',\n squeezedout = 'squeezedout',\n failure = 'failure',\n}\n\n/**\n * @hidden\n */\nexport type GqlTransactionStatusesNames =\n | 'FailureStatus'\n | 'SubmittedStatus'\n | 'SuccessStatus'\n | 'SqueezedOutStatus';\n\n/**\n * @hidden\n */\nexport enum OperationName {\n payBlockProducer = 'Pay network fee to block producer',\n contractCreated = 'Contract created',\n transfer = 'Transfer asset',\n contractCall = 'Contract call',\n receive = 'Receive asset',\n withdrawFromFuel = 'Withdraw from Fuel',\n}\n\nexport type OperationCoin = {\n assetId: string;\n amount: BNInput;\n};\n\nexport type OperationFunctionCall = {\n functionSignature: string;\n functionName: string;\n argumentsProvided?: Record<string, unknown>;\n} & Partial<OperationCoin>;\n\nexport type Operation = {\n name?: OperationName;\n from?: OperationTransactionAddress;\n to?: OperationTransactionAddress;\n assetsSent?: Array<OperationCoin>;\n calls?: Array<OperationFunctionCall>;\n};\n\n/**\n * @hidden\n */\nexport enum AddressType {\n contract,\n account,\n}\n\n/**\n * @hidden\n */\nexport enum ChainName {\n ethereum = 'ethereum',\n fuel = 'fuel',\n}\n\nexport type OperationTransactionAddress = {\n address: string;\n type: AddressType;\n chain?: ChainName;\n};\n\nexport type InputParam = {\n inputs: Input[];\n};\n\nexport type OutputParam = {\n outputs: Output[];\n};\n\nexport type ReceiptParam = {\n receipts: TransactionResultReceipt[];\n};\n\nexport type AbiMap = Record<string, JsonAbi>;\n\nexport type RawPayloadParam = {\n rawPayload?: string;\n};\n\nexport type InputOutputParam = InputParam & OutputParam;\n\nexport interface GetTransferOperationsParams extends InputOutputParam {\n receipts: TransactionResultReceipt[];\n baseAssetId: string;\n}\n\nexport type GetOperationParams = {\n transactionType: TransactionType;\n abiMap?: AbiMap;\n maxInputs: BN;\n baseAssetId: string;\n} & InputOutputParam &\n ReceiptParam &\n RawPayloadParam;\n\nexport interface MintedAsset {\n subId: B256Address;\n contractId: B256Address;\n assetId: B256Address;\n amount: BN;\n}\n\nexport type BurnedAsset = MintedAsset;\n\nexport type TransactionSummary<TTransactionType = void> = {\n id: string;\n time?: string;\n operations: Operation[];\n gasUsed: BN;\n tip: BN;\n fee: BN;\n type: TransactionTypeName;\n blockId?: BlockId;\n status?: TransactionStatus;\n isTypeMint: boolean;\n isTypeCreate: boolean;\n isTypeScript: boolean;\n isTypeUpgrade: boolean;\n isTypeUpload: boolean;\n isTypeBlob: boolean;\n isStatusPending: boolean;\n isStatusSuccess: boolean;\n isStatusFailure: boolean;\n mintedAssets: MintedAsset[];\n burnedAssets: BurnedAsset[];\n date?: Date;\n receipts: TransactionResultReceipt[];\n transaction: Transaction<TTransactionType>;\n};\n","import { ReceiptType } from '@fuel-ts/transactions';\n\nimport type { GqlReceiptFragment } from '../__generated__/operations';\nimport type { TransactionResultReceipt } from '../transaction-response';\nimport { assembleReceiptByType } from '../utils';\n\nimport type { BurnedAsset, MintedAsset } from './types';\n\nexport const processGqlReceipt = (gqlReceipt: GqlReceiptFragment): TransactionResultReceipt =>\n assembleReceiptByType(gqlReceipt);\n\nexport const extractMintedAssetsFromReceipts = (\n receipts: Array<TransactionResultReceipt>\n): MintedAsset[] => {\n const mintedAssets: MintedAsset[] = [];\n\n receipts.forEach((receipt) => {\n if (receipt.type === ReceiptType.Mint) {\n mintedAssets.push({\n subId: receipt.subId,\n contractId: receipt.contractId,\n assetId: receipt.assetId,\n amount: receipt.val,\n });\n }\n });\n\n return mintedAssets;\n};\n\nexport const extractBurnedAssetsFromReceipts = (\n receipts: Array<TransactionResultReceipt>\n): BurnedAsset[] => {\n const burnedAssets: BurnedAsset[] = [];\n\n receipts.forEach((receipt) => {\n if (receipt.type === ReceiptType.Burn) {\n burnedAssets.push({\n subId: receipt.subId,\n contractId: receipt.contractId,\n assetId: receipt.assetId,\n amount: receipt.val,\n });\n }\n });\n\n return burnedAssets;\n};\n","import { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport type { BN } from '@fuel-ts/math';\nimport { bn } from '@fuel-ts/math';\n\nimport { TransactionStatus } from './types';\nimport type {\n BlockId,\n GqlTransactionStatusesNames,\n GraphqlTransactionStatus,\n Time,\n TransactionSummary,\n} from './types';\n\n/** @hidden */\nexport const getTransactionStatusName = (gqlStatus: GqlTransactionStatusesNames) => {\n switch (gqlStatus) {\n case 'FailureStatus':\n return TransactionStatus.failure;\n case 'SuccessStatus':\n return TransactionStatus.success;\n case 'SubmittedStatus':\n return TransactionStatus.submitted;\n case 'SqueezedOutStatus':\n return TransactionStatus.squeezedout;\n default:\n throw new FuelError(\n ErrorCode.INVALID_TRANSACTION_STATUS,\n `Invalid transaction status: ${gqlStatus}.`\n );\n }\n};\n\ntype IProcessGraphqlStatusResponse = Pick<\n TransactionSummary,\n 'time' | 'blockId' | 'isStatusPending' | 'isStatusSuccess' | 'isStatusFailure' | 'status'\n> & { totalFee?: BN; totalGas?: BN };\n\n/** @hidden */\nexport const processGraphqlStatus = (gqlTransactionStatus?: GraphqlTransactionStatus) => {\n let time: Time | undefined;\n let blockId: BlockId | undefined;\n let status: TransactionStatus | undefined;\n let totalFee: BN | undefined;\n let totalGas: BN | undefined;\n\n let isStatusFailure = false;\n let isStatusSuccess = false;\n let isStatusPending = false;\n\n if (gqlTransactionStatus?.type) {\n status = getTransactionStatusName(gqlTransactionStatus.type);\n\n switch (gqlTransactionStatus.type) {\n case 'SuccessStatus':\n time = gqlTransactionStatus.time;\n blockId = gqlTransactionStatus.block?.id;\n isStatusSuccess = true;\n totalFee = bn(gqlTransactionStatus.totalFee);\n totalGas = bn(gqlTransactionStatus.totalGas);\n break;\n\n case 'FailureStatus':\n time = gqlTransactionStatus.time;\n blockId = gqlTransactionStatus.block?.id;\n isStatusFailure = true;\n totalFee = bn(gqlTransactionStatus.totalFee);\n totalGas = bn(gqlTransactionStatus.totalGas);\n break;\n\n case 'SubmittedStatus':\n time = gqlTransactionStatus.time;\n isStatusPending = true;\n break;\n default:\n }\n }\n\n const processedGraphqlStatus: IProcessGraphqlStatusResponse = {\n time,\n blockId,\n status,\n totalFee,\n totalGas,\n isStatusFailure,\n isStatusSuccess,\n isStatusPending,\n };\n\n return processedGraphqlStatus;\n};\n\n/**\n * Returns the total fee from the transaction status.\n *\n * @param status - The transaction status.\n * @returns The total fee from the transaction status or undefined.\n */\nexport const getTotalFeeFromStatus = (status?: GraphqlTransactionStatus): BN | undefined =>\n status && 'totalFee' in status ? bn(status.totalFee) : undefined;\n","import type { JsonAbi } from '@fuel-ts/abi-coder';\nimport { Interface, BigNumberCoder } from '@fuel-ts/abi-coder';\nimport { ReceiptType } from '@fuel-ts/transactions';\n\nimport type { TransactionResultReceipt } from './transaction-response';\n\n/** @hidden */\nexport function getDecodedLogs<T = unknown>(\n receipts: Array<TransactionResultReceipt>,\n mainAbi: JsonAbi,\n externalAbis: Record<string, JsonAbi> = {}\n): T[] {\n /**\n * This helper decodes logs from transaction receipts.\n * It loops through all receipts and decodes two types of logs:\n * - ReceiptType.LogData\n * - ReceiptType.Log\n *\n * The \"mainAbi\" parameter represents the ABI of the main contract used to create the transaction\n * or the ABI from a script used within a \"BaseInvocationScope\" context.\n * The \"externalAbis\" parameter is a record of contract ABIs that are also part of the transaction.\n * These ABIs were added using `contract.addContracts` or through a multicall with `contract.multiCall`.\n *\n * @param receipts - The array of transaction result receipts.\n * @param mainAbi - The ABI of the script or main contract.\n * @param externalAbis - The record of external contract ABIs.\n * @returns An array of decoded logs from Sway projects.\n */\n return receipts.reduce((logs: T[], receipt) => {\n if (receipt.type === ReceiptType.LogData || receipt.type === ReceiptType.Log) {\n const interfaceToUse = new Interface(externalAbis[receipt.id] || mainAbi);\n\n const data =\n receipt.type === ReceiptType.Log\n ? new BigNumberCoder('u64').encode(receipt.ra)\n : receipt.data;\n\n const [decodedLog] = interfaceToUse.decodeLog(data, receipt.rb.toString());\n logs.push(decodedLog);\n }\n\n return logs;\n }, []);\n}\n","import { sleep } from '@fuel-ts/utils';\n\nimport type { ProviderOptions } from '../provider';\n\ntype Backoff = 'linear' | 'exponential' | 'fixed';\n\n/**\n * Retry options scheme\n */\nexport type RetryOptions = {\n /**\n * Amount of attempts to retry before failing the call.\n */\n maxRetries: number;\n /**\n * Backoff strategy to use when retrying. Default is exponential.\n */\n backoff?: Backoff;\n /**\n * Starting delay for backoff strategy. Default is 150ms.\n */\n baseDelay?: number;\n};\n\n/**\n * Calculate the delay for the next retry attempt\n * @param options - Retry options configuration\n * @param retryAttemptNum - 1-based, tells which retry attempt is this\n * @returns Next wait delay\n */\nexport function getWaitDelay(options: RetryOptions, retryAttemptNum: number) {\n const duration = options.baseDelay ?? 150;\n\n switch (options.backoff) {\n case 'linear':\n return duration * retryAttemptNum;\n case 'fixed':\n return duration;\n case 'exponential':\n default:\n return 2 ** (retryAttemptNum - 1) * duration;\n }\n}\n\n/**\n * Returns a wrapped fetch function that will auto-execute itself in case of errors, until it succeeds\n * @param fetchFn - Function to be auto-retried\n * @param options - Retry options configuration\n * @param retryAttemptNum - ZERO=first call, ONE=first retry, TWO=second retry, etc.\n * @returns Whatever is the output of the `fetchFn` function\n */\nexport function autoRetryFetch(\n fetchFn: NonNullable<ProviderOptions['fetch']>,\n options?: RetryOptions,\n retryAttemptNum: number = 0\n): NonNullable<ProviderOptions['fetch']> {\n if (options === undefined) {\n return fetchFn;\n }\n\n return async (...args) => {\n try {\n return await fetchFn(...args);\n } catch (_error: unknown) {\n const error = _error as Error & { cause?: { code: string } };\n\n /**\n * So far, we are auto-retrying only for `ECONNREFUSED` error.\n * TODO: Investigate if we should consider more errors.\n */\n if (error.cause?.code !== 'ECONNREFUSED') {\n throw error;\n }\n const retryNum = retryAttemptNum + 1;\n\n if (retryNum > options.maxRetries) {\n throw error;\n }\n\n const delay = getWaitDelay(options, retryNum);\n\n await sleep(delay);\n\n return autoRetryFetch(fetchFn, options, retryNum)(...args);\n }\n };\n}\n","import { FuelError, ErrorCode } from '@fuel-ts/errors';\n\nimport type { CursorPaginationArgs } from '../provider';\n\n/**\n * @hidden\n */\nexport const validatePaginationArgs = (params: {\n inputArgs?: CursorPaginationArgs;\n paginationLimit: number;\n}): CursorPaginationArgs => {\n const { paginationLimit, inputArgs = {} } = params;\n const { first, last, after, before } = inputArgs;\n\n if (after && before) {\n throw new FuelError(\n ErrorCode.INVALID_INPUT_PARAMETERS,\n 'Pagination arguments \"after\" and \"before\" cannot be used together'\n );\n }\n\n if ((first || 0) > paginationLimit || (last || 0) > paginationLimit) {\n throw new FuelError(\n ErrorCode.INVALID_INPUT_PARAMETERS,\n `Pagination limit for this query cannot exceed ${paginationLimit} items`\n );\n }\n\n if (first && before) {\n throw new FuelError(\n ErrorCode.INVALID_INPUT_PARAMETERS,\n 'The use of pagination argument \"first\" with \"before\" is not supported'\n );\n }\n\n if (last && after) {\n throw new FuelError(\n ErrorCode.INVALID_INPUT_PARAMETERS,\n 'The use of pagination argument \"last\" with \"after\" is not supported'\n );\n }\n\n // If neither first nor last is provided, set a default first value\n if (!first && !last) {\n inputArgs.first = paginationLimit;\n }\n\n return inputArgs;\n};\n","import { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { bn } from '@fuel-ts/math';\nimport { TransactionCoder } from '@fuel-ts/transactions';\nimport { arrayify } from '@fuel-ts/utils';\n\nimport type {\n GqlGetTransactionsByOwnerQueryVariables,\n GqlReceiptFragment,\n} from '../__generated__/operations';\nimport type Provider from '../provider';\nimport { TRANSACTIONS_PAGE_SIZE_LIMIT, type PageInfo } from '../provider';\nimport type { TransactionRequest } from '../transaction-request';\nimport type { TransactionResult } from '../transaction-response';\nimport { validatePaginationArgs } from '../utils/validate-pagination-args';\n\nimport { assembleTransactionSummary } from './assemble-transaction-summary';\nimport { processGqlReceipt } from './receipt';\nimport { getTotalFeeFromStatus } from './status';\nimport type { AbiMap, TransactionSummary } from './types';\n/** @hidden */\nexport interface GetTransactionSummaryParams {\n id: string;\n provider: Provider;\n abiMap?: AbiMap;\n}\n\nexport async function getTransactionSummary<TTransactionType = void>(\n params: GetTransactionSummaryParams\n): Promise<TransactionResult> {\n const { id, provider, abiMap } = params;\n\n const { transaction: gqlTransaction } = await provider.operations.getTransactionWithReceipts({\n transactionId: id,\n });\n\n if (!gqlTransaction) {\n throw new FuelError(\n ErrorCode.TRANSACTION_NOT_FOUND,\n `Transaction not found for given id: ${id}.`\n );\n }\n\n const [decodedTransaction] = new TransactionCoder().decode(\n arrayify(gqlTransaction.rawPayload),\n 0\n );\n\n let txReceipts: GqlReceiptFragment[] = [];\n\n if (gqlTransaction?.status && 'receipts' in gqlTransaction.status) {\n txReceipts = gqlTransaction.status.receipts;\n }\n\n const receipts = txReceipts.map(processGqlReceipt);\n\n const {\n consensusParameters: {\n feeParameters: { gasPerByte, gasPriceFactor },\n txParameters: { maxInputs, maxGasPerTx },\n gasCosts,\n },\n } = await provider.getChain();\n\n // If we have the total fee, we do not need to refetch the gas price\n const totalFee = getTotalFeeFromStatus(gqlTransaction.status);\n const gasPrice = totalFee ? bn(0) : await provider.getLatestGasPrice();\n\n const baseAssetId = await provider.getBaseAssetId();\n\n const transactionInfo = assembleTransactionSummary<TTransactionType>({\n id: gqlTransaction.id,\n receipts,\n transaction: decodedTransaction,\n transactionBytes: arrayify(gqlTransaction.rawPayload),\n gqlTransactionStatus: gqlTransaction.status,\n gasPerByte: bn(gasPerByte),\n gasPriceFactor: bn(gasPriceFactor),\n abiMap,\n maxInputs,\n gasCosts,\n maxGasPerTx,\n gasPrice,\n baseAssetId,\n });\n\n return {\n ...transactionInfo,\n };\n}\n\nexport interface GetTransactionSummaryFromRequestParams {\n transactionRequest: TransactionRequest;\n provider: Provider;\n abiMap?: AbiMap;\n}\n\n/** @hidden */\nexport async function getTransactionSummaryFromRequest<TTransactionType = void>(\n params: GetTransactionSummaryFromRequestParams\n): Promise<TransactionSummary<TTransactionType>> {\n const { provider, transactionRequest, abiMap } = params;\n\n const { receipts } = await provider.dryRun(transactionRequest);\n\n const { gasPerByte, gasPriceFactor, gasCosts, maxGasPerTx } = await provider.getGasConfig();\n const maxInputs = (await provider.getChain()).consensusParameters.txParameters.maxInputs;\n\n const transaction = transactionRequest.toTransaction();\n const transactionBytes = transactionRequest.toTransactionBytes();\n\n const gasPrice = await provider.getLatestGasPrice();\n const baseAssetId = await provider.getBaseAssetId();\n\n const transactionSummary = assembleTransactionSummary<TTransactionType>({\n id: transactionRequest.getTransactionId(await provider.getChainId()),\n receipts,\n transaction,\n transactionBytes,\n abiMap,\n gasPerByte,\n gasPriceFactor,\n maxInputs,\n gasCosts,\n maxGasPerTx,\n gasPrice,\n baseAssetId,\n });\n\n return transactionSummary;\n}\n\nexport interface GetTransactionsSummariesParams {\n provider: Provider;\n filters: GqlGetTransactionsByOwnerQueryVariables;\n abiMap?: AbiMap;\n}\n\nexport interface GetTransactionsSummariesReturns {\n transactions: TransactionResult[];\n pageInfo: PageInfo;\n}\n\n/**\n * Gets transaction summaries for a given owner/address.\n *\n * @param params - The filters to apply to the query.\n * @returns The transaction summaries.\n */\nexport async function getTransactionsSummaries(\n params: GetTransactionsSummariesParams\n): Promise<GetTransactionsSummariesReturns> {\n const { filters, provider, abiMap } = params;\n\n const { owner, ...inputArgs } = filters;\n\n const validPaginationParams = validatePaginationArgs({\n inputArgs,\n paginationLimit: TRANSACTIONS_PAGE_SIZE_LIMIT,\n });\n\n const { transactionsByOwner } = await provider.operations.getTransactionsByOwner({\n ...validPaginationParams,\n owner,\n });\n\n const { edges, pageInfo } = transactionsByOwner;\n\n const {\n consensusParameters: {\n feeParameters: { gasPerByte, gasPriceFactor },\n txParameters: { maxInputs, maxGasPerTx },\n gasCosts,\n },\n } = await provider.getChain();\n\n const gasPrice = await provider.getLatestGasPrice();\n const baseAssetId = await provider.getBaseAssetId();\n\n const transactions = edges.map((edge) => {\n const { node: gqlTransaction } = edge;\n\n const { id, rawPayload, status } = gqlTransaction;\n\n const [decodedTransaction] = new TransactionCoder().decode(arrayify(rawPayload), 0);\n\n let txReceipts: GqlReceiptFragment[] = [];\n\n if (gqlTransaction?.status && 'receipts' in gqlTransaction.status) {\n txReceipts = gqlTransaction.status.receipts;\n }\n\n const receipts = txReceipts.map(processGqlReceipt);\n\n const transactionSummary = assembleTransactionSummary({\n id,\n receipts,\n transaction: decodedTransaction,\n transactionBytes: arrayify(rawPayload),\n gqlTransactionStatus: status,\n abiMap,\n gasPerByte,\n gasPriceFactor,\n maxInputs,\n gasCosts,\n maxGasPerTx,\n gasPrice,\n baseAssetId,\n });\n\n const output: TransactionResult = {\n ...transactionSummary,\n };\n\n return output;\n });\n\n return {\n transactions,\n pageInfo,\n };\n}\n","import type { BN } from '@fuel-ts/math';\n\nimport type { CoinQuantity } from '../coin-quantity';\n\nexport const mergeQuantities = (...coinQuantities: CoinQuantity[][]): CoinQuantity[] => {\n const resultMap: { [key: string]: BN } = {};\n\n function addToMap({ amount, assetId }: CoinQuantity) {\n if (resultMap[assetId]) {\n resultMap[assetId] = resultMap[assetId].add(amount);\n } else {\n resultMap[assetId] = amount;\n }\n }\n\n coinQuantities.forEach((arr) => arr.forEach(addToMap));\n\n // Convert the resultMap back to an array\n return Object.entries(resultMap).map(([assetId, amount]) => ({ assetId, amount }));\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { Address } from '@fuel-ts/address';\n\nexport abstract class AbstractAccount {\n abstract address: Address;\n abstract provider: unknown;\n abstract getResourcesToSpend(quantities: any[], options?: any): any;\n abstract sendTransaction(transactionRequest: any, options?: any): any;\n abstract simulateTransaction(transactionRequest: any, options?: any): any;\n abstract getTransactionCost(transactionRequest: any, options?: any): Promise<any>;\n abstract fund(transactionRequest: any, txCost: any): Promise<any>;\n}\n","import { ASSET_ID_LEN, BigNumberCoder, CONTRACT_ID_LEN, WORD_SIZE } from '@fuel-ts/abi-coder';\nimport { Address } from '@fuel-ts/address';\nimport type { BN } from '@fuel-ts/math';\nimport { arrayify, concat } from '@fuel-ts/utils';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport * as asm from '@fuels/vm-asm';\n\ninterface AssembleTransferToContractParams {\n contractId: string;\n assetId: BytesLike;\n amount: BN;\n}\n\nexport const formatTransferToContractScriptData = (\n transferParams: Array<AssembleTransferToContractParams>\n) => {\n const numberCoder = new BigNumberCoder('u64');\n return transferParams.reduce((acc, transferParam) => {\n const { assetId, amount, contractId } = transferParam;\n const encoded = numberCoder.encode(amount);\n const scriptData = concat([new Address(contractId).toBytes(), encoded, arrayify(assetId)]);\n return concat([acc, scriptData]);\n }, new Uint8Array());\n};\n\nexport const assembleTransferToContractScript = async (\n transferParams: Array<AssembleTransferToContractParams>\n) => {\n const scriptData = formatTransferToContractScriptData(transferParams);\n\n // @ts-expect-error method reference missing in DTS\n await asm.initWasm();\n\n let script = new Uint8Array();\n\n transferParams.forEach((_, i) => {\n const offset = (CONTRACT_ID_LEN + WORD_SIZE + ASSET_ID_LEN) * i;\n\n script = concat([\n script,\n // Load ScriptData into register 0x10.\n asm.gtf(0x10, 0x0, asm.GTFArgs.ScriptData).to_bytes(),\n // Add the offset to 0x10 so it will point to the current contract ID, store in 0x11.\n asm.addi(0x11, 0x10, offset).to_bytes(),\n // Add CONTRACT_ID_LEN to 0x11 to point to the amount in the ScriptData, store in 0x12.\n asm.addi(0x12, 0x11, CONTRACT_ID_LEN).to_bytes(),\n // Load word to the amount at 0x12 into register 0x13.\n asm.lw(0x13, 0x12, 0x0).to_bytes(),\n // Add WORD_SIZE to 0x12 to point to the asset ID in the ScriptData, store in 0x14.\n asm.addi(0x14, 0x12, WORD_SIZE).to_bytes(),\n // Perform the transfer using contract ID in 0x11, amount in 0x13, and asset ID in 0x14.\n asm.tr(0x11, 0x13, 0x14).to_bytes(),\n ]);\n });\n\n // Add return instruction at the end of the script\n script = concat([script, asm.ret(0x1).to_bytes()]);\n\n return { script, scriptData };\n};\n","import { hashMessage } from '@fuel-ts/hasher';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { hexlify } from '@fuel-ts/utils';\n\nimport { Account } from '../account';\nimport { transactionRequestify, validateTransactionForAssetBurn } from '../providers';\nimport type {\n TransactionRequestLike,\n CallResult,\n Provider,\n ProviderSendTxParams,\n EstimateTransactionParams,\n TransactionRequest,\n TransactionResponse,\n} from '../providers';\nimport { Signer } from '../signer';\n\nimport { encryptKeystoreWallet } from './keystore-wallet';\n\n/**\n * `BaseWalletUnlocked` provides the base functionalities for an unlocked wallet.\n */\nexport class BaseWalletUnlocked extends Account {\n /**\n * Default HDWallet path.\n */\n static defaultPath = \"m/44'/1179993420'/0'/0/0\";\n\n /**\n * A function that returns the wallet's signer.\n */\n signer: () => Signer;\n\n /**\n * Creates a new BaseWalletUnlocked instance.\n *\n * @param privateKey - The private key of the wallet.\n * @param provider - A Provider instance (optional).\n */\n constructor(privateKey: BytesLike, provider?: Provider) {\n const signer = new Signer(privateKey);\n super(signer.address, provider);\n this.signer = () => signer;\n }\n\n /**\n * Gets the private key of the wallet.\n *\n * @returns The private key of the wallet.\n */\n get privateKey(): string {\n return this.signer().privateKey;\n }\n\n /**\n * Gets the public key of the wallet.\n *\n * @returns\n */\n get publicKey(): string {\n return this.signer().publicKey;\n }\n\n /**\n * Signs a message with the wallet's private key.\n *\n * @param message - The message to sign.\n * @returns A promise that resolves to the signature as a ECDSA 64 bytes string.\n */\n override async signMessage(message: string): Promise<string> {\n const signedMessage = await this.signer().sign(hashMessage(message));\n return hexlify(signedMessage);\n }\n\n /**\n * Signs a transaction with the wallet's private key.\n *\n * @param transactionRequestLike - The transaction request to sign.\n * @returns A promise that resolves to the signature as a ECDSA 64 bytes string.\n */\n override async signTransaction(transactionRequestLike: TransactionRequestLike): Promise<string> {\n const transactionRequest = transactionRequestify(transactionRequestLike);\n const chainId = await this.provider.getChainId();\n const hashedTransaction = transactionRequest.getTransactionId(chainId);\n const signature = await this.signer().sign(hashedTransaction);\n return hexlify(signature);\n }\n\n /**\n * Populates a transaction with the witnesses signature.\n *\n * @param transactionRequestLike - The transaction request to populate.\n * @returns The populated transaction request.\n */\n async populateTransactionWitnessesSignature<T extends TransactionRequest>(\n transactionRequestLike: TransactionRequestLike\n ) {\n const transactionRequest = transactionRequestify(transactionRequestLike) as T;\n const signedTransaction = await this.signTransaction(transactionRequest);\n\n transactionRequest.updateWitnessByOwner(this.address, signedTransaction);\n\n return transactionRequest;\n }\n\n /**\n * Populates the witness signature for a transaction and sends it to the network using `provider.sendTransaction`.\n *\n * @param transactionRequestLike - The transaction request to send.\n * @param estimateTxDependencies - Whether to estimate the transaction dependencies.\n * @returns A promise that resolves to the TransactionResponse object.\n */\n override async sendTransaction(\n transactionRequestLike: TransactionRequestLike,\n { estimateTxDependencies = false, enableAssetBurn }: ProviderSendTxParams = {}\n ): Promise<TransactionResponse> {\n const transactionRequest = transactionRequestify(transactionRequestLike);\n validateTransactionForAssetBurn(\n await this.provider.getBaseAssetId(),\n transactionRequest,\n enableAssetBurn\n );\n if (estimateTxDependencies) {\n await this.provider.estimateTxDependencies(transactionRequest);\n }\n return this.provider.sendTransaction(\n await this.populateTransactionWitnessesSignature(transactionRequest),\n { estimateTxDependencies: false, enableAssetBurn }\n );\n }\n\n /**\n * Populates the witness signature for a transaction and sends a call to the network using `provider.dryRun`.\n *\n * @param transactionRequestLike - The transaction request to simulate.\n * @returns A promise that resolves to the CallResult object.\n */\n override async simulateTransaction(\n transactionRequestLike: TransactionRequestLike,\n { estimateTxDependencies = true }: EstimateTransactionParams = {}\n ): Promise<CallResult> {\n const transactionRequest = transactionRequestify(transactionRequestLike);\n if (estimateTxDependencies) {\n await this.provider.estimateTxDependencies(transactionRequest);\n }\n return this.provider.dryRun(\n await this.populateTransactionWitnessesSignature(transactionRequest),\n {\n utxoValidation: true,\n estimateTxDependencies: false,\n }\n );\n }\n\n /**\n * Encrypts an unlocked wallet with a password.\n *\n * @param password - the password to encrypt the wallet with.\n * @returns - the encrypted wallet.\n */\n async encrypt(password: string): Promise<string> {\n return encryptKeystoreWallet(this.privateKey, this.address, password);\n }\n}\n","import { Address } from '@fuel-ts/address';\nimport { randomBytes } from '@fuel-ts/crypto';\nimport { hash } from '@fuel-ts/hasher';\nimport { toBytes } from '@fuel-ts/math';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { hexlify, concat, arrayify } from '@fuel-ts/utils';\nimport { secp256k1 } from '@noble/curves/secp256k1';\n\nexport class Signer {\n readonly address: Address;\n\n readonly publicKey: string;\n\n readonly compressedPublicKey: string;\n\n readonly privateKey: string;\n\n /**\n * Create a Signer instance from a given private key\n *\n * @param privateKey - The private key to use for signing\n * @returns A new Signer instance\n */\n constructor(privateKey: BytesLike) {\n // A lot of common tools do not prefix private keys with a 0x\n if (typeof privateKey === 'string') {\n if (privateKey.match(/^[0-9a-f]*$/i) && privateKey.length === 64) {\n // eslint-disable-next-line no-param-reassign\n privateKey = `0x${privateKey}`;\n }\n }\n // Convert to byte array, normalize private key input allowing it to be BytesLike\n // like remove 0x prefix and accept array of bytes\n const privateKeyBytes = toBytes(privateKey, 32);\n\n this.privateKey = hexlify(privateKeyBytes);\n\n // Slice(1) removes the encoding scheme from the public key\n this.publicKey = hexlify(secp256k1.getPublicKey(privateKeyBytes, false).slice(1));\n this.compressedPublicKey = hexlify(secp256k1.getPublicKey(privateKeyBytes, true));\n this.address = new Address(this.publicKey);\n }\n\n /**\n * Sign data using the Signer instance\n *\n * Signature is a 64 byte array of the concatenated r and s values with the compressed recoveryParam byte.\n * @ignore\n * [Read more](FuelLabs/fuel-specs/specs/protocol/cryptographic_primitives.md#public-key-cryptography)\n *\n * @param data - The data to be sign\n * @returns hashed signature\n */\n sign(data: BytesLike) {\n const signature = secp256k1.sign(arrayify(data), arrayify(this.privateKey));\n\n const r = toBytes(`0x${signature.r.toString(16)}`, 32);\n const s = toBytes(`0x${signature.s.toString(16)}`, 32);\n\n // add recoveryParam to first s byte\n s[0] |= (signature.recovery || 0) << 7;\n\n return hexlify(concat([r, s]));\n }\n\n /**\n * Add point on the current elliptic curve\n *\n * @param point - Point to add on the curve\n * @returns compressed point on the curve\n */\n addPoint(point: BytesLike) {\n const p0 = secp256k1.ProjectivePoint.fromHex(arrayify(this.compressedPublicKey));\n const p1 = secp256k1.ProjectivePoint.fromHex(arrayify(point));\n const result = p0.add(p1);\n return `0x${result.toHex(true)}`;\n }\n\n /**\n * Recover the public key from a signature performed with [`sign`](#sign).\n *\n * @param data - Data\n * @param signature - hashed signature\n * @returns public key from signature from the\n */\n static recoverPublicKey(data: BytesLike, signature: BytesLike): string {\n const signedMessageBytes = arrayify(signature);\n const r = signedMessageBytes.slice(0, 32);\n const s = signedMessageBytes.slice(32, 64);\n const recoveryParam = (s[0] & 0x80) >> 7;\n\n // remove recoveryParam from s first byte\n s[0] &= 0x7f;\n\n const sig = new secp256k1.Signature(BigInt(hexlify(r)), BigInt(hexlify(s))).addRecoveryBit(\n recoveryParam\n );\n\n const publicKey = sig.recoverPublicKey(arrayify(data)).toRawBytes(false).slice(1);\n return hexlify(publicKey);\n }\n\n /**\n * Recover the address from a signature performed with [`sign`](#sign).\n *\n * @param data - Data\n * @param signature - Signature\n * @returns Address from signature\n */\n static recoverAddress(data: BytesLike, signature: BytesLike): Address {\n return new Address(Signer.recoverPublicKey(data, signature));\n }\n\n /**\n * Generate a random privateKey\n *\n * @param entropy - Adds extra entropy to generate the privateKey\n * @returns random 32-byte hashed\n */\n static generatePrivateKey(entropy?: BytesLike) {\n return entropy ? hash(concat([randomBytes(32), arrayify(entropy)])) : randomBytes(32);\n }\n\n /**\n * Extended publicKey from a compact publicKey\n *\n * @param publicKey - Compact publicKey\n * @returns extended publicKey\n */\n static extendPublicKey(publicKey: BytesLike) {\n const point = secp256k1.ProjectivePoint.fromHex(arrayify(publicKey));\n return hexlify(point.toRawBytes(false).slice(1));\n }\n}\n","import type { AddressInput } from '@fuel-ts/address';\nimport { Address } from '@fuel-ts/address';\nimport {\n bufferFromString,\n keccak256,\n randomBytes,\n scrypt,\n stringFromBuffer,\n decryptJsonWalletData,\n encryptJsonWalletData,\n randomUUID,\n} from '@fuel-ts/crypto';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { hexlify } from '@fuel-ts/utils';\n\nexport type KeystoreWallet = {\n id: string;\n version: number;\n address: string;\n crypto: KeystoreCrypto;\n};\n\ntype KeystoreCrypto = {\n cipher: 'aes-128-ctr';\n cipherparams: { iv: string };\n ciphertext: string;\n kdf: 'scrypt';\n mac: string;\n kdfparams: KDFParams;\n};\n\ntype KDFParams = {\n dklen: number;\n n: number;\n p: number;\n r: number;\n salt: string;\n};\n\n// Same values used in the Rust SDK\nexport const DEFAULT_KDF_PARAMS_LOG_N = 13;\nexport const DEFAULT_KDF_PARAMS_R = 8;\nexport const DEFAULT_KDF_PARAMS_P = 1;\nexport const DEFAULT_KEY_SIZE = 32;\nexport const DEFAULT_IV_SIZE = 16;\n\n/**\n * Removes the '0x' prefix from a hexadecimal string.\n * If the prefix does not exist, it returns the original string.\n */\nexport const removeHexPrefix = (hexString: string) => {\n if (/^0x/.test(hexString)) {\n return hexString.slice(2);\n }\n\n return hexString;\n};\n\nexport async function encryptKeystoreWallet(\n privateKey: string,\n address: AddressInput,\n password: string\n): Promise<string> {\n // Convert the hexlified private key string to a Buffer.\n const privateKeyBuffer = bufferFromString(removeHexPrefix(privateKey), 'hex');\n const ownerAddress = new Address(address);\n // Generate a random salt.\n const salt = randomBytes(DEFAULT_KEY_SIZE);\n\n const key = scrypt({\n password: bufferFromString(password),\n salt,\n dklen: DEFAULT_KEY_SIZE,\n n: 2 ** DEFAULT_KDF_PARAMS_LOG_N,\n r: DEFAULT_KDF_PARAMS_R,\n p: DEFAULT_KDF_PARAMS_P,\n });\n\n // Encrypt the private key using AES-128-CTR.\n const iv = randomBytes(DEFAULT_IV_SIZE);\n\n const ciphertext = await encryptJsonWalletData(privateKeyBuffer, key, iv);\n\n const data = Uint8Array.from([...key.subarray(16, 32), ...ciphertext]);\n\n // Calculate the MAC.\n const macHashUint8Array = keccak256(data);\n\n const mac = stringFromBuffer(macHashUint8Array, 'hex');\n\n // Construct keystore.\n const keystore: KeystoreWallet = {\n id: randomUUID(),\n version: 3,\n address: removeHexPrefix(ownerAddress.toHexString()),\n crypto: {\n cipher: 'aes-128-ctr',\n mac,\n cipherparams: { iv: stringFromBuffer(iv, 'hex') },\n ciphertext: stringFromBuffer(ciphertext, 'hex'),\n kdf: 'scrypt',\n kdfparams: {\n dklen: DEFAULT_KEY_SIZE,\n n: 2 ** DEFAULT_KDF_PARAMS_LOG_N,\n p: DEFAULT_KDF_PARAMS_P,\n r: DEFAULT_KDF_PARAMS_R,\n salt: stringFromBuffer(salt, 'hex'),\n },\n },\n };\n\n return JSON.stringify(keystore);\n}\n\nexport async function decryptKeystoreWallet(jsonWallet: string, password: string): Promise<string> {\n const keystoreWallet = JSON.parse(jsonWallet) as KeystoreWallet;\n\n // Extract the parameters needed for decryption.\n const {\n crypto: {\n mac,\n ciphertext,\n cipherparams: { iv },\n kdfparams: { dklen, n, r, p, salt },\n },\n } = keystoreWallet;\n\n const ciphertextBuffer = bufferFromString(ciphertext, 'hex');\n const ivBuffer = bufferFromString(iv, 'hex');\n const saltBuffer = bufferFromString(salt, 'hex');\n\n const passwordBuffer = bufferFromString(password);\n\n const key = scrypt({\n password: passwordBuffer,\n salt: saltBuffer,\n n,\n p,\n r,\n dklen,\n });\n\n // Verify the MAC. It should be the Keccak-256 hash of the concatenation of the second half of the derived key and the ciphertext.\n const data = Uint8Array.from([...key.subarray(16, 32), ...ciphertextBuffer]);\n\n const macHashUint8Array = keccak256(data);\n\n const macHash = stringFromBuffer(macHashUint8Array, 'hex');\n\n if (mac !== macHash) {\n throw new FuelError(\n ErrorCode.INVALID_PASSWORD,\n 'Failed to decrypt the keystore wallet, the provided password is incorrect.'\n );\n }\n\n // Decrypt the private key.\n const buffer = await decryptJsonWalletData(ciphertextBuffer, key, ivBuffer);\n\n const privateKey = hexlify(buffer);\n\n return privateKey;\n}\n","import { computeHmac, ripemd160 } from '@fuel-ts/crypto';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { sha256 } from '@fuel-ts/hasher';\nimport { bn, toBytes, toHex } from '@fuel-ts/math';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { arrayify, hexlify, concat, dataSlice, encodeBase58, decodeBase58 } from '@fuel-ts/utils';\n\nimport { Mnemonic } from '../mnemonic';\nimport { Signer } from '../signer';\n\n// \"Bitcoin seed\"\nconst HARDENED_INDEX = 0x80000000;\n\n// 4 byte: version bytes (mainnet: 0x0488B21E public, 0x0488ADE4 private; testnet: 0x043587CF public, 0x04358394 private)\nconst MainnetPRV = hexlify('0x0488ade4');\nconst MainnetPUB = hexlify('0x0488b21e');\nconst TestnetPRV = hexlify('0x04358394');\nconst TestnetPUB = hexlify('0x043587cf');\n\nfunction base58check(data: Uint8Array): string {\n return encodeBase58(concat([data, dataSlice(sha256(sha256(data)), 0, 4)]));\n}\n\nfunction getExtendedKeyPrefix(isPublic: boolean = false, testnet: boolean = false) {\n if (isPublic) {\n return testnet ? TestnetPUB : MainnetPUB;\n }\n return testnet ? TestnetPRV : MainnetPRV;\n}\n\nfunction isPublicExtendedKey(extendedKey: Uint8Array) {\n return [MainnetPUB, TestnetPUB].includes(hexlify(extendedKey.slice(0, 4)));\n}\n\nfunction isValidExtendedKey(extendedKey: Uint8Array) {\n return [MainnetPRV, TestnetPRV, MainnetPUB, TestnetPUB].includes(\n hexlify(extendedKey.slice(0, 4))\n );\n}\n\nfunction parsePath(path: string, depth: number = 0) {\n const components = path.split('/');\n\n if (components.length === 0 || (components[0] === 'm' && depth !== 0)) {\n throw new FuelError(ErrorCode.HD_WALLET_ERROR, `invalid path - ${path}`);\n }\n\n if (components[0] === 'm') {\n components.shift();\n }\n\n return components.map((p) =>\n ~p.indexOf(`'`) ? parseInt(p, 10) + HARDENED_INDEX : parseInt(p, 10)\n );\n}\n\ntype HDWalletConfig = {\n privateKey?: BytesLike;\n publicKey?: BytesLike;\n chainCode: BytesLike;\n depth?: number;\n index?: number;\n parentFingerprint?: string;\n};\n\nclass HDWallet {\n depth: number = 0;\n index: number = 0;\n fingerprint: string = hexlify('0x00000000');\n parentFingerprint: string = hexlify('0x00000000');\n privateKey?: string;\n publicKey: string;\n chainCode: BytesLike;\n\n /**\n * HDWallet is a implementation of the BIP-0044 and BIP-0032, Multi-Account Hierarchy for Deterministic Wallets\n *\n * @param config - Wallet configurations\n */\n constructor(config: HDWalletConfig) {\n // TODO: set some asserts here\n\n if (config.privateKey) {\n const signer = new Signer(config.privateKey);\n this.publicKey = hexlify(signer.compressedPublicKey);\n this.privateKey = hexlify(config.privateKey);\n } else {\n if (!config.publicKey) {\n throw new FuelError(\n ErrorCode.HD_WALLET_ERROR,\n 'Both public and private Key cannot be missing. At least one should be provided.'\n );\n }\n this.publicKey = hexlify(config.publicKey);\n }\n\n this.parentFingerprint = config.parentFingerprint || this.parentFingerprint;\n this.fingerprint = dataSlice(ripemd160(sha256(this.publicKey)), 0, 4);\n this.depth = config.depth || this.depth;\n this.index = config.index || this.index;\n this.chainCode = config.chainCode;\n }\n\n get extendedKey() {\n return this.toExtendedKey();\n }\n\n /**\n * Derive the current HDWallet instance navigating only on the index.\n * `Ex.: m/44'/0 -> Ex.: m/44'/1 -> m/44'/2`. [Learn more](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki)\n *\n * @param index - Index of the child HDWallet.\n * @returns A new instance of HDWallet on the derived index\n */\n deriveIndex(index: number) {\n const privateKey = this.privateKey && arrayify(this.privateKey);\n const publicKey = arrayify(this.publicKey);\n const chainCode = arrayify(this.chainCode);\n const data = new Uint8Array(37);\n\n if (index & HARDENED_INDEX) {\n if (!privateKey) {\n throw new FuelError(\n ErrorCode.HD_WALLET_ERROR,\n 'Cannot derive a hardened index without a private Key.'\n );\n }\n\n // 33 bytes: 0x00 || private key\n data.set(privateKey, 1);\n } else {\n data.set(arrayify(this.publicKey));\n }\n\n // child number: ser32(i)\n data.set(toBytes(index, 4), 33);\n\n const bytes = arrayify(computeHmac('sha512', chainCode, data));\n const IL = bytes.slice(0, 32);\n const IR = bytes.slice(32);\n\n if (privateKey) {\n const N = '0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141';\n // Child key ki is parse256(IL) + kpar (mod n).\n const ki = bn(IL).add(privateKey).mod(N).toBytes(32);\n\n return new HDWallet({\n privateKey: ki,\n chainCode: IR,\n index,\n depth: this.depth + 1,\n parentFingerprint: this.fingerprint,\n });\n }\n\n const signer = new Signer(hexlify(IL));\n const Ki = signer.addPoint(publicKey);\n\n return new HDWallet({\n publicKey: Ki,\n chainCode: IR,\n index,\n depth: this.depth + 1,\n parentFingerprint: this.fingerprint,\n });\n }\n\n /**\n * Derive the current HDWallet instance to the path. [Learn more](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki)\n *\n * @param path - The string representation of the child HDWallet. `Ex.: m/44'/0'/0'/0/0`\n * @returns A new instance of HDWallet on the derived path\n */\n derivePath(path: string) {\n const paths = parsePath(path, this.depth);\n\n return paths.reduce((hdwallet, index) => hdwallet.deriveIndex(index), <HDWallet>this);\n }\n\n /**\n * Get the extendKey as defined on BIP-32 from the provided seed\n *\n * @param isPublic - enable to export public extendedKey, it not required when HDWallet didn't have the privateKey.\n * @param testnet - Inform if should use testnet or mainnet prefix, default value is true (`mainnet`).\n * @returns BIP-32 extended private key\n */\n toExtendedKey(isPublic: boolean = false, testnet: boolean = false): string {\n if (this.depth >= 256) {\n throw new FuelError(\n ErrorCode.HD_WALLET_ERROR,\n `Exceeded max depth of 255. Current depth: ${this.depth}.`\n );\n }\n const prefix = getExtendedKeyPrefix(this.privateKey == null || isPublic, testnet);\n const depth = hexlify(Uint8Array.from([this.depth]));\n const parentFingerprint = this.parentFingerprint;\n const index = toHex(this.index, 4);\n // last 32 bites from the key\n const chainCode = this.chainCode;\n // first 32 bites from the key\n const key =\n this.privateKey != null && !isPublic ? concat(['0x00', this.privateKey]) : this.publicKey;\n const extendedKey = arrayify(concat([prefix, depth, parentFingerprint, index, chainCode, key]));\n\n return base58check(extendedKey);\n }\n\n /**\n * Create HDWallet instance from seed\n *\n * @param seed - Seed\n * @returns A new instance of HDWallet\n */\n static fromSeed(seed: string) {\n const masterKey = Mnemonic.masterKeysFromSeed(seed);\n\n return new HDWallet({\n chainCode: arrayify(masterKey.slice(32)),\n privateKey: arrayify(masterKey.slice(0, 32)),\n });\n }\n\n static fromExtendedKey(extendedKey: string) {\n const decoded = hexlify(toBytes(decodeBase58(extendedKey)));\n const bytes = arrayify(decoded);\n const validChecksum = base58check(bytes.slice(0, 78)) === extendedKey;\n\n if (bytes.length !== 82 || !isValidExtendedKey(bytes)) {\n throw new FuelError(ErrorCode.HD_WALLET_ERROR, 'Provided key is not a valid extended key.');\n }\n if (!validChecksum) {\n throw new FuelError(ErrorCode.HD_WALLET_ERROR, 'Provided key has an invalid checksum.');\n }\n\n const depth = bytes[4];\n const parentFingerprint = hexlify(bytes.slice(5, 9));\n const index = parseInt(hexlify(bytes.slice(9, 13)).substring(2), 16);\n const chainCode = hexlify(bytes.slice(13, 45));\n const key = bytes.slice(45, 78);\n\n if ((depth === 0 && parentFingerprint !== '0x00000000') || (depth === 0 && index !== 0)) {\n throw new FuelError(\n ErrorCode.HD_WALLET_ERROR,\n 'Inconsistency detected: Depth is zero but fingerprint/index is non-zero.'\n );\n }\n\n if (isPublicExtendedKey(bytes)) {\n if (key[0] !== 3) {\n throw new FuelError(ErrorCode.HD_WALLET_ERROR, 'Invalid public extended key.');\n }\n\n return new HDWallet({\n publicKey: key,\n chainCode,\n index,\n depth,\n parentFingerprint,\n });\n }\n\n if (key[0] !== 0) {\n throw new FuelError(ErrorCode.HD_WALLET_ERROR, 'Invalid private extended key.');\n }\n\n return new HDWallet({\n privateKey: key.slice(1),\n chainCode,\n index,\n depth,\n parentFingerprint,\n });\n }\n}\n\nexport default HDWallet;\n","import { randomBytes, pbkdf2, computeHmac } from '@fuel-ts/crypto';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { sha256 } from '@fuel-ts/hasher';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { arrayify, hexlify, concat, dataSlice, encodeBase58, toUtf8Bytes } from '@fuel-ts/utils';\n\nimport { english } from '../wordlists';\n\nimport type { MnemonicPhrase } from './utils';\nimport { entropyToMnemonicIndices, getWords, getPhrase, mnemonicWordsToEntropy } from './utils';\n\n//\n// Constants\n//\n// \"Bitcoin seed\"\nconst MasterSecret = toUtf8Bytes('Bitcoin seed');\n// 4 byte: version bytes (mainnet: 0x0488B21E public, 0x0488ADE4 private; testnet: 0x043587CF public, 0x04358394 private)\nconst MainnetPRV = '0x0488ade4';\nconst TestnetPRV = '0x04358394';\nexport const MNEMONIC_SIZES = [12, 15, 18, 21, 24];\n\nfunction assertWordList(wordlist: Array<string>) {\n if (wordlist.length !== 2048) {\n throw new FuelError(\n ErrorCode.INVALID_WORD_LIST,\n `Expected word list length of 2048, but got ${wordlist.length}.`\n );\n }\n}\n\nfunction assertEntropy(entropy: BytesLike) {\n if (entropy.length % 4 !== 0 || entropy.length < 16 || entropy.length > 32) {\n throw new FuelError(\n ErrorCode.INVALID_ENTROPY,\n `Entropy should be between 16 and 32 bytes and a multiple of 4, but got ${entropy.length} bytes.`\n );\n }\n}\n\nfunction assertMnemonic(words: Array<string>) {\n if (!MNEMONIC_SIZES.includes(words.length)) {\n const errorMsg = `Invalid mnemonic size. Expected one of [${MNEMONIC_SIZES.join(\n ', '\n )}] words, but got ${words.length}.`;\n\n throw new FuelError(ErrorCode.INVALID_MNEMONIC, errorMsg);\n }\n}\n\nclass Mnemonic {\n wordlist: Array<string>;\n\n /**\n *\n * @param wordlist - Provide a wordlist with the list of words used to generate the mnemonic phrase. The default value is the English list.\n * @returns Mnemonic instance\n */\n constructor(wordlist: Array<string> = english) {\n this.wordlist = wordlist;\n\n assertWordList(this.wordlist);\n }\n\n /**\n *\n * @param phrase - Mnemonic phrase composed by words from the provided wordlist\n * @returns Entropy hash\n */\n mnemonicToEntropy(phrase: MnemonicPhrase) {\n return Mnemonic.mnemonicToEntropy(phrase, this.wordlist);\n }\n\n /**\n *\n * @param entropy - Entropy source to the mnemonic phrase.\n * @returns Mnemonic phrase\n */\n entropyToMnemonic(entropy: BytesLike) {\n return Mnemonic.entropyToMnemonic(entropy, this.wordlist);\n }\n\n /**\n *\n * @param phrase - Mnemonic phrase composed by words from the provided wordlist\n * @param wordlist - Provide a wordlist with the list of words used to generate the mnemonic phrase. The default value is the English list.\n * @returns Mnemonic phrase\n */\n static mnemonicToEntropy(phrase: MnemonicPhrase, wordlist: Array<string> = english): string {\n const words = getWords(phrase);\n\n assertMnemonic(words);\n\n return hexlify(mnemonicWordsToEntropy(words, wordlist));\n }\n\n /**\n * @param entropy - Entropy source to the mnemonic phrase.\n * @param testnet - Inform if should use testnet or mainnet prefix, default value is true (`mainnet`).\n * @returns 64-byte array contains privateKey and chainCode as described on BIP39\n */\n static entropyToMnemonic(entropy: BytesLike, wordlist: Array<string> = english): string {\n const entropyBytes = arrayify(entropy);\n\n assertWordList(wordlist);\n assertEntropy(entropyBytes);\n\n return entropyToMnemonicIndices(entropyBytes)\n .map((i) => wordlist[i])\n .join(' ');\n }\n\n /**\n * @param phrase - Mnemonic phrase composed by words from the provided wordlist\n * @param passphrase - Add additional security to protect the generated seed with a memorized passphrase. `Note: if the owner forgot the passphrase, all wallets and accounts derive from the phrase will be lost.`\n * @returns 64-byte array contains privateKey and chainCode as described on BIP39\n */\n static mnemonicToSeed(phrase: MnemonicPhrase, passphrase: BytesLike = '') {\n assertMnemonic(getWords(phrase));\n\n const phraseBytes = toUtf8Bytes(getPhrase(phrase));\n const salt = toUtf8Bytes(`mnemonic${passphrase}`);\n\n return pbkdf2(phraseBytes, salt, 2048, 64, 'sha512');\n }\n\n /**\n * @param phrase - Mnemonic phrase composed by words from the provided wordlist\n * @param passphrase - Add additional security to protect the generated seed with a memorized passphrase. `Note: if the owner forgot the passphrase, all wallets and accounts derive from the phrase will be lost.`\n * @returns 64-byte array contains privateKey and chainCode as described on BIP39\n */\n static mnemonicToMasterKeys(phrase: MnemonicPhrase, passphrase: BytesLike = '') {\n const seed = Mnemonic.mnemonicToSeed(phrase, passphrase);\n return Mnemonic.masterKeysFromSeed(seed);\n }\n\n /**\n * Validates if given mnemonic is valid\n * @param phrase - Mnemonic phrase composed by words from the provided wordlist\n * @returns true if phrase is a valid mnemonic\n */\n static isMnemonicValid(phrase: string) {\n const words = getWords(phrase);\n\n let i: number = 0;\n\n try {\n assertMnemonic(words);\n } catch {\n return false;\n }\n\n while (i < words.length) {\n if (Mnemonic.binarySearch(words[i]) === false) {\n return false;\n }\n i += 1;\n }\n\n return true;\n }\n\n static binarySearch(target: string): boolean {\n const words = english;\n let left: number = 0;\n let right: number = words.length - 1;\n\n while (left <= right) {\n const mid: number = Math.floor((left + right) / 2);\n\n if (words[mid] === target) {\n return true;\n }\n if (target < words[mid]) {\n right = mid - 1;\n } else {\n left = mid + 1;\n }\n }\n\n return false;\n }\n\n /**\n * @param seed - BIP39 seed\n * @param testnet - Inform if should use testnet or mainnet prefix, the default value is true (`mainnet`).\n * @returns 64-byte array contains privateKey and chainCode as described on BIP39\n */\n static masterKeysFromSeed(seed: string): Uint8Array {\n const seedArray = arrayify(seed);\n\n if (seedArray.length < 16 || seedArray.length > 64) {\n throw new FuelError(\n ErrorCode.INVALID_SEED,\n `Seed length should be between 16 and 64 bytes, but received ${seedArray.length} bytes.`\n );\n }\n\n return arrayify(computeHmac('sha512', MasterSecret, seedArray));\n }\n\n /**\n * Get the extendKey as defined on BIP-32 from the provided seed\n *\n * @param seed - BIP39 seed\n * @param testnet - Inform if should use testnet or mainnet prefix, default value is true (`mainnet`).\n * @returns BIP-32 extended private key\n */\n static seedToExtendedKey(seed: string, testnet: boolean = false): string {\n const masterKey = Mnemonic.masterKeysFromSeed(seed);\n const prefix = arrayify(testnet ? TestnetPRV : MainnetPRV);\n const depth = '0x00';\n const fingerprint = '0x00000000';\n const index = '0x00000000';\n // last 32 bites from the key\n const chainCode = masterKey.slice(32);\n // first 32 bites from the key\n const privateKey = masterKey.slice(0, 32);\n const extendedKey = concat([\n prefix,\n depth,\n fingerprint,\n index,\n chainCode,\n concat(['0x00', privateKey]),\n ]);\n const checksum = dataSlice(sha256(sha256(extendedKey)), 0, 4);\n\n return encodeBase58(concat([extendedKey, checksum]));\n }\n\n /**\n * Create a new mnemonic using a randomly generated number as entropy.\n * As defined in BIP39, the entropy must be a multiple of 32 bits, and its size must be between 128 and 256 bits.\n * Therefore, the possible values for `strength` are 128, 160, 192, 224, and 256.\n * If not provided, the default entropy length will be set to 256 bits.\n * The return is a list of words that encodes the generated entropy.\n *\n *\n * @param size - Number of bytes used as an entropy\n * @param extraEntropy - Optional extra entropy to increase randomness\n * @returns A randomly generated mnemonic\n */\n static generate(size: number = 32, extraEntropy: BytesLike = '') {\n const entropy = extraEntropy\n ? sha256(concat([randomBytes(size), arrayify(extraEntropy)]))\n : randomBytes(size);\n return Mnemonic.entropyToMnemonic(entropy);\n }\n}\n\nexport default Mnemonic;\n","export const english = [\n 'abandon',\n 'ability',\n 'able',\n 'about',\n 'above',\n 'absent',\n 'absorb',\n 'abstract',\n 'absurd',\n 'abuse',\n 'access',\n 'accident',\n 'account',\n 'accuse',\n 'achieve',\n 'acid',\n 'acoustic',\n 'acquire',\n 'across',\n 'act',\n 'action',\n 'actor',\n 'actress',\n 'actual',\n 'adapt',\n 'add',\n 'addict',\n 'address',\n 'adjust',\n 'admit',\n 'adult',\n 'advance',\n 'advice',\n 'aerobic',\n 'affair',\n 'afford',\n 'afraid',\n 'again',\n 'age',\n 'agent',\n 'agree',\n 'ahead',\n 'aim',\n 'air',\n 'airport',\n 'aisle',\n 'alarm',\n 'album',\n 'alcohol',\n 'alert',\n 'alien',\n 'all',\n 'alley',\n 'allow',\n 'almost',\n 'alone',\n 'alpha',\n 'already',\n 'also',\n 'alter',\n 'always',\n 'amateur',\n 'amazing',\n 'among',\n 'amount',\n 'amused',\n 'analyst',\n 'anchor',\n 'ancient',\n 'anger',\n 'angle',\n 'angry',\n 'animal',\n 'ankle',\n 'announce',\n 'annual',\n 'another',\n 'answer',\n 'antenna',\n 'antique',\n 'anxiety',\n 'any',\n 'apart',\n 'apology',\n 'appear',\n 'apple',\n 'approve',\n 'april',\n 'arch',\n 'arctic',\n 'area',\n 'arena',\n 'argue',\n 'arm',\n 'armed',\n 'armor',\n 'army',\n 'around',\n 'arrange',\n 'arrest',\n 'arrive',\n 'arrow',\n 'art',\n 'artefact',\n 'artist',\n 'artwork',\n 'ask',\n 'aspect',\n 'assault',\n 'asset',\n 'assist',\n 'assume',\n 'asthma',\n 'athlete',\n 'atom',\n 'attack',\n 'attend',\n 'attitude',\n 'attract',\n 'auction',\n 'audit',\n 'august',\n 'aunt',\n 'author',\n 'auto',\n 'autumn',\n 'average',\n 'avocado',\n 'avoid',\n 'awake',\n 'aware',\n 'away',\n 'awesome',\n 'awful',\n 'awkward',\n 'axis',\n 'baby',\n 'bachelor',\n 'bacon',\n 'badge',\n 'bag',\n 'balance',\n 'balcony',\n 'ball',\n 'bamboo',\n 'banana',\n 'banner',\n 'bar',\n 'barely',\n 'bargain',\n 'barrel',\n 'base',\n 'basic',\n 'basket',\n 'battle',\n 'beach',\n 'bean',\n 'beauty',\n 'because',\n 'become',\n 'beef',\n 'before',\n 'begin',\n 'behave',\n 'behind',\n 'believe',\n 'below',\n 'belt',\n 'bench',\n 'benefit',\n 'best',\n 'betray',\n 'better',\n 'between',\n 'beyond',\n 'bicycle',\n 'bid',\n 'bike',\n 'bind',\n 'biology',\n 'bird',\n 'birth',\n 'bitter',\n 'black',\n 'blade',\n 'blame',\n 'blanket',\n 'blast',\n 'bleak',\n 'bless',\n 'blind',\n 'blood',\n 'blossom',\n 'blouse',\n 'blue',\n 'blur',\n 'blush',\n 'board',\n 'boat',\n 'body',\n 'boil',\n 'bomb',\n 'bone',\n 'bonus',\n 'book',\n 'boost',\n 'border',\n 'boring',\n 'borrow',\n 'boss',\n 'bottom',\n 'bounce',\n 'box',\n 'boy',\n 'bracket',\n 'brain',\n 'brand',\n 'brass',\n 'brave',\n 'bread',\n 'breeze',\n 'brick',\n 'bridge',\n 'brief',\n 'bright',\n 'bring',\n 'brisk',\n 'broccoli',\n 'broken',\n 'bronze',\n 'broom',\n 'brother',\n 'brown',\n 'brush',\n 'bubble',\n 'buddy',\n 'budget',\n 'buffalo',\n 'build',\n 'bulb',\n 'bulk',\n 'bullet',\n 'bundle',\n 'bunker',\n 'burden',\n 'burger',\n 'burst',\n 'bus',\n 'business',\n 'busy',\n 'butter',\n 'buyer',\n 'buzz',\n 'cabbage',\n 'cabin',\n 'cable',\n 'cactus',\n 'cage',\n 'cake',\n 'call',\n 'calm',\n 'camera',\n 'camp',\n 'can',\n 'canal',\n 'cancel',\n 'candy',\n 'cannon',\n 'canoe',\n 'canvas',\n 'canyon',\n 'capable',\n 'capital',\n 'captain',\n 'car',\n 'carbon',\n 'card',\n 'cargo',\n 'carpet',\n 'carry',\n 'cart',\n 'case',\n 'cash',\n 'casino',\n 'castle',\n 'casual',\n 'cat',\n 'catalog',\n 'catch',\n 'category',\n 'cattle',\n 'caught',\n 'cause',\n 'caution',\n 'cave',\n 'ceiling',\n 'celery',\n 'cement',\n 'census',\n 'century',\n 'cereal',\n 'certain',\n 'chair',\n 'chalk',\n 'champion',\n 'change',\n 'chaos',\n 'chapter',\n 'charge',\n 'chase',\n 'chat',\n 'cheap',\n 'check',\n 'cheese',\n 'chef',\n 'cherry',\n 'chest',\n 'chicken',\n 'chief',\n 'child',\n 'chimney',\n 'choice',\n 'choose',\n 'chronic',\n 'chuckle',\n 'chunk',\n 'churn',\n 'cigar',\n 'cinnamon',\n 'circle',\n 'citizen',\n 'city',\n 'civil',\n 'claim',\n 'clap',\n 'clarify',\n 'claw',\n 'clay',\n 'clean',\n 'clerk',\n 'clever',\n 'click',\n 'client',\n 'cliff',\n 'climb',\n 'clinic',\n 'clip',\n 'clock',\n 'clog',\n 'close',\n 'cloth',\n 'cloud',\n 'clown',\n 'club',\n 'clump',\n 'cluster',\n 'clutch',\n 'coach',\n 'coast',\n 'coconut',\n 'code',\n 'coffee',\n 'coil',\n 'coin',\n 'collect',\n 'color',\n 'column',\n 'combine',\n 'come',\n 'comfort',\n 'comic',\n 'common',\n 'company',\n 'concert',\n 'conduct',\n 'confirm',\n 'congress',\n 'connect',\n 'consider',\n 'control',\n 'convince',\n 'cook',\n 'cool',\n 'copper',\n 'copy',\n 'coral',\n 'core',\n 'corn',\n 'correct',\n 'cost',\n 'cotton',\n 'couch',\n 'country',\n 'couple',\n 'course',\n 'cousin',\n 'cover',\n 'coyote',\n 'crack',\n 'cradle',\n 'craft',\n 'cram',\n 'crane',\n 'crash',\n 'crater',\n 'crawl',\n 'crazy',\n 'cream',\n 'credit',\n 'creek',\n 'crew',\n 'cricket',\n 'crime',\n 'crisp',\n 'critic',\n 'crop',\n 'cross',\n 'crouch',\n 'crowd',\n 'crucial',\n 'cruel',\n 'cruise',\n 'crumble',\n 'crunch',\n 'crush',\n 'cry',\n 'crystal',\n 'cube',\n 'culture',\n 'cup',\n 'cupboard',\n 'curious',\n 'current',\n 'curtain',\n 'curve',\n 'cushion',\n 'custom',\n 'cute',\n 'cycle',\n 'dad',\n 'damage',\n 'damp',\n 'dance',\n 'danger',\n 'daring',\n 'dash',\n 'daughter',\n 'dawn',\n 'day',\n 'deal',\n 'debate',\n 'debris',\n 'decade',\n 'december',\n 'decide',\n 'decline',\n 'decorate',\n 'decrease',\n 'deer',\n 'defense',\n 'define',\n 'defy',\n 'degree',\n 'delay',\n 'deliver',\n 'demand',\n 'demise',\n 'denial',\n 'dentist',\n 'deny',\n 'depart',\n 'depend',\n 'deposit',\n 'depth',\n 'deputy',\n 'derive',\n 'describe',\n 'desert',\n 'design',\n 'desk',\n 'despair',\n 'destroy',\n 'detail',\n 'detect',\n 'develop',\n 'device',\n 'devote',\n 'diagram',\n 'dial',\n 'diamond',\n 'diary',\n 'dice',\n 'diesel',\n 'diet',\n 'differ',\n 'digital',\n 'dignity',\n 'dilemma',\n 'dinner',\n 'dinosaur',\n 'direct',\n 'dirt',\n 'disagree',\n 'discover',\n 'disease',\n 'dish',\n 'dismiss',\n 'disorder',\n 'display',\n 'distance',\n 'divert',\n 'divide',\n 'divorce',\n 'dizzy',\n 'doctor',\n 'document',\n 'dog',\n 'doll',\n 'dolphin',\n 'domain',\n 'donate',\n 'donkey',\n 'donor',\n 'door',\n 'dose',\n 'double',\n 'dove',\n 'draft',\n 'dragon',\n 'drama',\n 'drastic',\n 'draw',\n 'dream',\n 'dress',\n 'drift',\n 'drill',\n 'drink',\n 'drip',\n 'drive',\n 'drop',\n 'drum',\n 'dry',\n 'duck',\n 'dumb',\n 'dune',\n 'during',\n 'dust',\n 'dutch',\n 'duty',\n 'dwarf',\n 'dynamic',\n 'eager',\n 'eagle',\n 'early',\n 'earn',\n 'earth',\n 'easily',\n 'east',\n 'easy',\n 'echo',\n 'ecology',\n 'economy',\n 'edge',\n 'edit',\n 'educate',\n 'effort',\n 'egg',\n 'eight',\n 'either',\n 'elbow',\n 'elder',\n 'electric',\n 'elegant',\n 'element',\n 'elephant',\n 'elevator',\n 'elite',\n 'else',\n 'embark',\n 'embody',\n 'embrace',\n 'emerge',\n 'emotion',\n 'employ',\n 'empower',\n 'empty',\n 'enable',\n 'enact',\n 'end',\n 'endless',\n 'endorse',\n 'enemy',\n 'energy',\n 'enforce',\n 'engage',\n 'engine',\n 'enhance',\n 'enjoy',\n 'enlist',\n 'enough',\n 'enrich',\n 'enroll',\n 'ensure',\n 'enter',\n 'entire',\n 'entry',\n 'envelope',\n 'episode',\n 'equal',\n 'equip',\n 'era',\n 'erase',\n 'erode',\n 'erosion',\n 'error',\n 'erupt',\n 'escape',\n 'essay',\n 'essence',\n 'estate',\n 'eternal',\n 'ethics',\n 'evidence',\n 'evil',\n 'evoke',\n 'evolve',\n 'exact',\n 'example',\n 'excess',\n 'exchange',\n 'excite',\n 'exclude',\n 'excuse',\n 'execute',\n 'exercise',\n 'exhaust',\n 'exhibit',\n 'exile',\n 'exist',\n 'exit',\n 'exotic',\n 'expand',\n 'expect',\n 'expire',\n 'explain',\n 'expose',\n 'express',\n 'extend',\n 'extra',\n 'eye',\n 'eyebrow',\n 'fabric',\n 'face',\n 'faculty',\n 'fade',\n 'faint',\n 'faith',\n 'fall',\n 'false',\n 'fame',\n 'family',\n 'famous',\n 'fan',\n 'fancy',\n 'fantasy',\n 'farm',\n 'fashion',\n 'fat',\n 'fatal',\n 'father',\n 'fatigue',\n 'fault',\n 'favorite',\n 'feature',\n 'february',\n 'federal',\n 'fee',\n 'feed',\n 'feel',\n 'female',\n 'fence',\n 'festival',\n 'fetch',\n 'fever',\n 'few',\n 'fiber',\n 'fiction',\n 'field',\n 'figure',\n 'file',\n 'film',\n 'filter',\n 'final',\n 'find',\n 'fine',\n 'finger',\n 'finish',\n 'fire',\n 'firm',\n 'first',\n 'fiscal',\n 'fish',\n 'fit',\n 'fitness',\n 'fix',\n 'flag',\n 'flame',\n 'flash',\n 'flat',\n 'flavor',\n 'flee',\n 'flight',\n 'flip',\n 'float',\n 'flock',\n 'floor',\n 'flower',\n 'fluid',\n 'flush',\n 'fly',\n 'foam',\n 'focus',\n 'fog',\n 'foil',\n 'fold',\n 'follow',\n 'food',\n 'foot',\n 'force',\n 'forest',\n 'forget',\n 'fork',\n 'fortune',\n 'forum',\n 'forward',\n 'fossil',\n 'foster',\n 'found',\n 'fox',\n 'fragile',\n 'frame',\n 'frequent',\n 'fresh',\n 'friend',\n 'fringe',\n 'frog',\n 'front',\n 'frost',\n 'frown',\n 'frozen',\n 'fruit',\n 'fuel',\n 'fun',\n 'funny',\n 'furnace',\n 'fury',\n 'future',\n 'gadget',\n 'gain',\n 'galaxy',\n 'gallery',\n 'game',\n 'gap',\n 'garage',\n 'garbage',\n 'garden',\n 'garlic',\n 'garment',\n 'gas',\n 'gasp',\n 'gate',\n 'gather',\n 'gauge',\n 'gaze',\n 'general',\n 'genius',\n 'genre',\n 'gentle',\n 'genuine',\n 'gesture',\n 'ghost',\n 'giant',\n 'gift',\n 'giggle',\n 'ginger',\n 'giraffe',\n 'girl',\n 'give',\n 'glad',\n 'glance',\n 'glare',\n 'glass',\n 'glide',\n 'glimpse',\n 'globe',\n 'gloom',\n 'glory',\n 'glove',\n 'glow',\n 'glue',\n 'goat',\n 'goddess',\n 'gold',\n 'good',\n 'goose',\n 'gorilla',\n 'gospel',\n 'gossip',\n 'govern',\n 'gown',\n 'grab',\n 'grace',\n 'grain',\n 'grant',\n 'grape',\n 'grass',\n 'gravity',\n 'great',\n 'green',\n 'grid',\n 'grief',\n 'grit',\n 'grocery',\n 'group',\n 'grow',\n 'grunt',\n 'guard',\n 'guess',\n 'guide',\n 'guilt',\n 'guitar',\n 'gun',\n 'gym',\n 'habit',\n 'hair',\n 'half',\n 'hammer',\n 'hamster',\n 'hand',\n 'happy',\n 'harbor',\n 'hard',\n 'harsh',\n 'harvest',\n 'hat',\n 'have',\n 'hawk',\n 'hazard',\n 'head',\n 'health',\n 'heart',\n 'heavy',\n 'hedgehog',\n 'height',\n 'hello',\n 'helmet',\n 'help',\n 'hen',\n 'hero',\n 'hidden',\n 'high',\n 'hill',\n 'hint',\n 'hip',\n 'hire',\n 'history',\n 'hobby',\n 'hockey',\n 'hold',\n 'hole',\n 'holiday',\n 'hollow',\n 'home',\n 'honey',\n 'hood',\n 'hope',\n 'horn',\n 'horror',\n 'horse',\n 'hospital',\n 'host',\n 'hotel',\n 'hour',\n 'hover',\n 'hub',\n 'huge',\n 'human',\n 'humble',\n 'humor',\n 'hundred',\n 'hungry',\n 'hunt',\n 'hurdle',\n 'hurry',\n 'hurt',\n 'husband',\n 'hybrid',\n 'ice',\n 'icon',\n 'idea',\n 'identify',\n 'idle',\n 'ignore',\n 'ill',\n 'illegal',\n 'illness',\n 'image',\n 'imitate',\n 'immense',\n 'immune',\n 'impact',\n 'impose',\n 'improve',\n 'impulse',\n 'inch',\n 'include',\n 'income',\n 'increase',\n 'index',\n 'indicate',\n 'indoor',\n 'industry',\n 'infant',\n 'inflict',\n 'inform',\n 'inhale',\n 'inherit',\n 'initial',\n 'inject',\n 'injury',\n 'inmate',\n 'inner',\n 'innocent',\n 'input',\n 'inquiry',\n 'insane',\n 'insect',\n 'inside',\n 'inspire',\n 'install',\n 'intact',\n 'interest',\n 'into',\n 'invest',\n 'invite',\n 'involve',\n 'iron',\n 'island',\n 'isolate',\n 'issue',\n 'item',\n 'ivory',\n 'jacket',\n 'jaguar',\n 'jar',\n 'jazz',\n 'jealous',\n 'jeans',\n 'jelly',\n 'jewel',\n 'job',\n 'join',\n 'joke',\n 'journey',\n 'joy',\n 'judge',\n 'juice',\n 'jump',\n 'jungle',\n 'junior',\n 'junk',\n 'just',\n 'kangaroo',\n 'keen',\n 'keep',\n 'ketchup',\n 'key',\n 'kick',\n 'kid',\n 'kidney',\n 'kind',\n 'kingdom',\n 'kiss',\n 'kit',\n 'kitchen',\n 'kite',\n 'kitten',\n 'kiwi',\n 'knee',\n 'knife',\n 'knock',\n 'know',\n 'lab',\n 'label',\n 'labor',\n 'ladder',\n 'lady',\n 'lake',\n 'lamp',\n 'language',\n 'laptop',\n 'large',\n 'later',\n 'latin',\n 'laugh',\n 'laundry',\n 'lava',\n 'law',\n 'lawn',\n 'lawsuit',\n 'layer',\n 'lazy',\n 'leader',\n 'leaf',\n 'learn',\n 'leave',\n 'lecture',\n 'left',\n 'leg',\n 'legal',\n 'legend',\n 'leisure',\n 'lemon',\n 'lend',\n 'length',\n 'lens',\n 'leopard',\n 'lesson',\n 'letter',\n 'level',\n 'liar',\n 'liberty',\n 'library',\n 'license',\n 'life',\n 'lift',\n 'light',\n 'like',\n 'limb',\n 'limit',\n 'link',\n 'lion',\n 'liquid',\n 'list',\n 'little',\n 'live',\n 'lizard',\n 'load',\n 'loan',\n 'lobster',\n 'local',\n 'lock',\n 'logic',\n 'lonely',\n 'long',\n 'loop',\n 'lottery',\n 'loud',\n 'lounge',\n 'love',\n 'loyal',\n 'lucky',\n 'luggage',\n 'lumber',\n 'lunar',\n 'lunch',\n 'luxury',\n 'lyrics',\n 'machine',\n 'mad',\n 'magic',\n 'magnet',\n 'maid',\n 'mail',\n 'main',\n 'major',\n 'make',\n 'mammal',\n 'man',\n 'manage',\n 'mandate',\n 'mango',\n 'mansion',\n 'manual',\n 'maple',\n 'marble',\n 'march',\n 'margin',\n 'marine',\n 'market',\n 'marriage',\n 'mask',\n 'mass',\n 'master',\n 'match',\n 'material',\n 'math',\n 'matrix',\n 'matter',\n 'maximum',\n 'maze',\n 'meadow',\n 'mean',\n 'measure',\n 'meat',\n 'mechanic',\n 'medal',\n 'media',\n 'melody',\n 'melt',\n 'member',\n 'memory',\n 'mention',\n 'menu',\n 'mercy',\n 'merge',\n 'merit',\n 'merry',\n 'mesh',\n 'message',\n 'metal',\n 'method',\n 'middle',\n 'midnight',\n 'milk',\n 'million',\n 'mimic',\n 'mind',\n 'minimum',\n 'minor',\n 'minute',\n 'miracle',\n 'mirror',\n 'misery',\n 'miss',\n 'mistake',\n 'mix',\n 'mixed',\n 'mixture',\n 'mobile',\n 'model',\n 'modify',\n 'mom',\n 'moment',\n 'monitor',\n 'monkey',\n 'monster',\n 'month',\n 'moon',\n 'moral',\n 'more',\n 'morning',\n 'mosquito',\n 'mother',\n 'motion',\n 'motor',\n 'mountain',\n 'mouse',\n 'move',\n 'movie',\n 'much',\n 'muffin',\n 'mule',\n 'multiply',\n 'muscle',\n 'museum',\n 'mushroom',\n 'music',\n 'must',\n 'mutual',\n 'myself',\n 'mystery',\n 'myth',\n 'naive',\n 'name',\n 'napkin',\n 'narrow',\n 'nasty',\n 'nation',\n 'nature',\n 'near',\n 'neck',\n 'need',\n 'negative',\n 'neglect',\n 'neither',\n 'nephew',\n 'nerve',\n 'nest',\n 'net',\n 'network',\n 'neutral',\n 'never',\n 'news',\n 'next',\n 'nice',\n 'night',\n 'noble',\n 'noise',\n 'nominee',\n 'noodle',\n 'normal',\n 'north',\n 'nose',\n 'notable',\n 'note',\n 'nothing',\n 'notice',\n 'novel',\n 'now',\n 'nuclear',\n 'number',\n 'nurse',\n 'nut',\n 'oak',\n 'obey',\n 'object',\n 'oblige',\n 'obscure',\n 'observe',\n 'obtain',\n 'obvious',\n 'occur',\n 'ocean',\n 'october',\n 'odor',\n 'off',\n 'offer',\n 'office',\n 'often',\n 'oil',\n 'okay',\n 'old',\n 'olive',\n 'olympic',\n 'omit',\n 'once',\n 'one',\n 'onion',\n 'online',\n 'only',\n 'open',\n 'opera',\n 'opinion',\n 'oppose',\n 'option',\n 'orange',\n 'orbit',\n 'orchard',\n 'order',\n 'ordinary',\n 'organ',\n 'orient',\n 'original',\n 'orphan',\n 'ostrich',\n 'other',\n 'outdoor',\n 'outer',\n 'output',\n 'outside',\n 'oval',\n 'oven',\n 'over',\n 'own',\n 'owner',\n 'oxygen',\n 'oyster',\n 'ozone',\n 'pact',\n 'paddle',\n 'page',\n 'pair',\n 'palace',\n 'palm',\n 'panda',\n 'panel',\n 'panic',\n 'panther',\n 'paper',\n 'parade',\n 'parent',\n 'park',\n 'parrot',\n 'party',\n 'pass',\n 'patch',\n 'path',\n 'patient',\n 'patrol',\n 'pattern',\n 'pause',\n 'pave',\n 'payment',\n 'peace',\n 'peanut',\n 'pear',\n 'peasant',\n 'pelican',\n 'pen',\n 'penalty',\n 'pencil',\n 'people',\n 'pepper',\n 'perfect',\n 'permit',\n 'person',\n 'pet',\n 'phone',\n 'photo',\n 'phrase',\n 'physical',\n 'piano',\n 'picnic',\n 'picture',\n 'piece',\n 'pig',\n 'pigeon',\n 'pill',\n 'pilot',\n 'pink',\n 'pioneer',\n 'pipe',\n 'pistol',\n 'pitch',\n 'pizza',\n 'place',\n 'planet',\n 'plastic',\n 'plate',\n 'play',\n 'please',\n 'pledge',\n 'pluck',\n 'plug',\n 'plunge',\n 'poem',\n 'poet',\n 'point',\n 'polar',\n 'pole',\n 'police',\n 'pond',\n 'pony',\n 'pool',\n 'popular',\n 'portion',\n 'position',\n 'possible',\n 'post',\n 'potato',\n 'pottery',\n 'poverty',\n 'powder',\n 'power',\n 'practice',\n 'praise',\n 'predict',\n 'prefer',\n 'prepare',\n 'present',\n 'pretty',\n 'prevent',\n 'price',\n 'pride',\n 'primary',\n 'print',\n 'priority',\n 'prison',\n 'private',\n 'prize',\n 'problem',\n 'process',\n 'produce',\n 'profit',\n 'program',\n 'project',\n 'promote',\n 'proof',\n 'property',\n 'prosper',\n 'protect',\n 'proud',\n 'provide',\n 'public',\n 'pudding',\n 'pull',\n 'pulp',\n 'pulse',\n 'pumpkin',\n 'punch',\n 'pupil',\n 'puppy',\n 'purchase',\n 'purity',\n 'purpose',\n 'purse',\n 'push',\n 'put',\n 'puzzle',\n 'pyramid',\n 'quality',\n 'quantum',\n 'quarter',\n 'question',\n 'quick',\n 'quit',\n 'quiz',\n 'quote',\n 'rabbit',\n 'raccoon',\n 'race',\n 'rack',\n 'radar',\n 'radio',\n 'rail',\n 'rain',\n 'raise',\n 'rally',\n 'ramp',\n 'ranch',\n 'random',\n 'range',\n 'rapid',\n 'rare',\n 'rate',\n 'rather',\n 'raven',\n 'raw',\n 'razor',\n 'ready',\n 'real',\n 'reason',\n 'rebel',\n 'rebuild',\n 'recall',\n 'receive',\n 'recipe',\n 'record',\n 'recycle',\n 'reduce',\n 'reflect',\n 'reform',\n 'refuse',\n 'region',\n 'regret',\n 'regular',\n 'reject',\n 'relax',\n 'release',\n 'relief',\n 'rely',\n 'remain',\n 'remember',\n 'remind',\n 'remove',\n 'render',\n 'renew',\n 'rent',\n 'reopen',\n 'repair',\n 'repeat',\n 'replace',\n 'report',\n 'require',\n 'rescue',\n 'resemble',\n 'resist',\n 'resource',\n 'response',\n 'result',\n 'retire',\n 'retreat',\n 'return',\n 'reunion',\n 'reveal',\n 'review',\n 'reward',\n 'rhythm',\n 'rib',\n 'ribbon',\n 'rice',\n 'rich',\n 'ride',\n 'ridge',\n 'rifle',\n 'right',\n 'rigid',\n 'ring',\n 'riot',\n 'ripple',\n 'risk',\n 'ritual',\n 'rival',\n 'river',\n 'road',\n 'roast',\n 'robot',\n 'robust',\n 'rocket',\n 'romance',\n 'roof',\n 'rookie',\n 'room',\n 'rose',\n 'rotate',\n 'rough',\n 'round',\n 'route',\n 'royal',\n 'rubber',\n 'rude',\n 'rug',\n 'rule',\n 'run',\n 'runway',\n 'rural',\n 'sad',\n 'saddle',\n 'sadness',\n 'safe',\n 'sail',\n 'salad',\n 'salmon',\n 'salon',\n 'salt',\n 'salute',\n 'same',\n 'sample',\n 'sand',\n 'satisfy',\n 'satoshi',\n 'sauce',\n 'sausage',\n 'save',\n 'say',\n 'scale',\n 'scan',\n 'scare',\n 'scatter',\n 'scene',\n 'scheme',\n 'school',\n 'science',\n 'scissors',\n 'scorpion',\n 'scout',\n 'scrap',\n 'screen',\n 'script',\n 'scrub',\n 'sea',\n 'search',\n 'season',\n 'seat',\n 'second',\n 'secret',\n 'section',\n 'security',\n 'seed',\n 'seek',\n 'segment',\n 'select',\n 'sell',\n 'seminar',\n 'senior',\n 'sense',\n 'sentence',\n 'series',\n 'service',\n 'session',\n 'settle',\n 'setup',\n 'seven',\n 'shadow',\n 'shaft',\n 'shallow',\n 'share',\n 'shed',\n 'shell',\n 'sheriff',\n 'shield',\n 'shift',\n 'shine',\n 'ship',\n 'shiver',\n 'shock',\n 'shoe',\n 'shoot',\n 'shop',\n 'short',\n 'shoulder',\n 'shove',\n 'shrimp',\n 'shrug',\n 'shuffle',\n 'shy',\n 'sibling',\n 'sick',\n 'side',\n 'siege',\n 'sight',\n 'sign',\n 'silent',\n 'silk',\n 'silly',\n 'silver',\n 'similar',\n 'simple',\n 'since',\n 'sing',\n 'siren',\n 'sister',\n 'situate',\n 'six',\n 'size',\n 'skate',\n 'sketch',\n 'ski',\n 'skill',\n 'skin',\n 'skirt',\n 'skull',\n 'slab',\n 'slam',\n 'sleep',\n 'slender',\n 'slice',\n 'slide',\n 'slight',\n 'slim',\n 'slogan',\n 'slot',\n 'slow',\n 'slush',\n 'small',\n 'smart',\n 'smile',\n 'smoke',\n 'smooth',\n 'snack',\n 'snake',\n 'snap',\n 'sniff',\n 'snow',\n 'soap',\n 'soccer',\n 'social',\n 'sock',\n 'soda',\n 'soft',\n 'solar',\n 'soldier',\n 'solid',\n 'solution',\n 'solve',\n 'someone',\n 'song',\n 'soon',\n 'sorry',\n 'sort',\n 'soul',\n 'sound',\n 'soup',\n 'source',\n 'south',\n 'space',\n 'spare',\n 'spatial',\n 'spawn',\n 'speak',\n 'special',\n 'speed',\n 'spell',\n 'spend',\n 'sphere',\n 'spice',\n 'spider',\n 'spike',\n 'spin',\n 'spirit',\n 'split',\n 'spoil',\n 'sponsor',\n 'spoon',\n 'sport',\n 'spot',\n 'spray',\n 'spread',\n 'spring',\n 'spy',\n 'square',\n 'squeeze',\n 'squirrel',\n 'stable',\n 'stadium',\n 'staff',\n 'stage',\n 'stairs',\n 'stamp',\n 'stand',\n 'start',\n 'state',\n 'stay',\n 'steak',\n 'steel',\n 'stem',\n 'step',\n 'stereo',\n 'stick',\n 'still',\n 'sting',\n 'stock',\n 'stomach',\n 'stone',\n 'stool',\n 'story',\n 'stove',\n 'strategy',\n 'street',\n 'strike',\n 'strong',\n 'struggle',\n 'student',\n 'stuff',\n 'stumble',\n 'style',\n 'subject',\n 'submit',\n 'subway',\n 'success',\n 'such',\n 'sudden',\n 'suffer',\n 'sugar',\n 'suggest',\n 'suit',\n 'summer',\n 'sun',\n 'sunny',\n 'sunset',\n 'super',\n 'supply',\n 'supreme',\n 'sure',\n 'surface',\n 'surge',\n 'surprise',\n 'surround',\n 'survey',\n 'suspect',\n 'sustain',\n 'swallow',\n 'swamp',\n 'swap',\n 'swarm',\n 'swear',\n 'sweet',\n 'swift',\n 'swim',\n 'swing',\n 'switch',\n 'sword',\n 'symbol',\n 'symptom',\n 'syrup',\n 'system',\n 'table',\n 'tackle',\n 'tag',\n 'tail',\n 'talent',\n 'talk',\n 'tank',\n 'tape',\n 'target',\n 'task',\n 'taste',\n 'tattoo',\n 'taxi',\n 'teach',\n 'team',\n 'tell',\n 'ten',\n 'tenant',\n 'tennis',\n 'tent',\n 'term',\n 'test',\n 'text',\n 'thank',\n 'that',\n 'theme',\n 'then',\n 'theory',\n 'there',\n 'they',\n 'thing',\n 'this',\n 'thought',\n 'three',\n 'thrive',\n 'throw',\n 'thumb',\n 'thunder',\n 'ticket',\n 'tide',\n 'tiger',\n 'tilt',\n 'timber',\n 'time',\n 'tiny',\n 'tip',\n 'tired',\n 'tissue',\n 'title',\n 'toast',\n 'tobacco',\n 'today',\n 'toddler',\n 'toe',\n 'together',\n 'toilet',\n 'token',\n 'tomato',\n 'tomorrow',\n 'tone',\n 'tongue',\n 'tonight',\n 'tool',\n 'tooth',\n 'top',\n 'topic',\n 'topple',\n 'torch',\n 'tornado',\n 'tortoise',\n 'toss',\n 'total',\n 'tourist',\n 'toward',\n 'tower',\n 'town',\n 'toy',\n 'track',\n 'trade',\n 'traffic',\n 'tragic',\n 'train',\n 'transfer',\n 'trap',\n 'trash',\n 'travel',\n 'tray',\n 'treat',\n 'tree',\n 'trend',\n 'trial',\n 'tribe',\n 'trick',\n 'trigger',\n 'trim',\n 'trip',\n 'trophy',\n 'trouble',\n 'truck',\n 'true',\n 'truly',\n 'trumpet',\n 'trust',\n 'truth',\n 'try',\n 'tube',\n 'tuition',\n 'tumble',\n 'tuna',\n 'tunnel',\n 'turkey',\n 'turn',\n 'turtle',\n 'twelve',\n 'twenty',\n 'twice',\n 'twin',\n 'twist',\n 'two',\n 'type',\n 'typical',\n 'ugly',\n 'umbrella',\n 'unable',\n 'unaware',\n 'uncle',\n 'uncover',\n 'under',\n 'undo',\n 'unfair',\n 'unfold',\n 'unhappy',\n 'uniform',\n 'unique',\n 'unit',\n 'universe',\n 'unknown',\n 'unlock',\n 'until',\n 'unusual',\n 'unveil',\n 'update',\n 'upgrade',\n 'uphold',\n 'upon',\n 'upper',\n 'upset',\n 'urban',\n 'urge',\n 'usage',\n 'use',\n 'used',\n 'useful',\n 'useless',\n 'usual',\n 'utility',\n 'vacant',\n 'vacuum',\n 'vague',\n 'valid',\n 'valley',\n 'valve',\n 'van',\n 'vanish',\n 'vapor',\n 'various',\n 'vast',\n 'vault',\n 'vehicle',\n 'velvet',\n 'vendor',\n 'venture',\n 'venue',\n 'verb',\n 'verify',\n 'version',\n 'very',\n 'vessel',\n 'veteran',\n 'viable',\n 'vibrant',\n 'vicious',\n 'victory',\n 'video',\n 'view',\n 'village',\n 'vintage',\n 'violin',\n 'virtual',\n 'virus',\n 'visa',\n 'visit',\n 'visual',\n 'vital',\n 'vivid',\n 'vocal',\n 'voice',\n 'void',\n 'volcano',\n 'volume',\n 'vote',\n 'voyage',\n 'wage',\n 'wagon',\n 'wait',\n 'walk',\n 'wall',\n 'walnut',\n 'want',\n 'warfare',\n 'warm',\n 'warrior',\n 'wash',\n 'wasp',\n 'waste',\n 'water',\n 'wave',\n 'way',\n 'wealth',\n 'weapon',\n 'wear',\n 'weasel',\n 'weather',\n 'web',\n 'wedding',\n 'weekend',\n 'weird',\n 'welcome',\n 'west',\n 'wet',\n 'whale',\n 'what',\n 'wheat',\n 'wheel',\n 'when',\n 'where',\n 'whip',\n 'whisper',\n 'wide',\n 'width',\n 'wife',\n 'wild',\n 'will',\n 'win',\n 'window',\n 'wine',\n 'wing',\n 'wink',\n 'winner',\n 'winter',\n 'wire',\n 'wisdom',\n 'wise',\n 'wish',\n 'witness',\n 'wolf',\n 'woman',\n 'wonder',\n 'wood',\n 'wool',\n 'word',\n 'work',\n 'world',\n 'worry',\n 'worth',\n 'wrap',\n 'wreck',\n 'wrestle',\n 'wrist',\n 'write',\n 'wrong',\n 'yard',\n 'year',\n 'yellow',\n 'you',\n 'young',\n 'youth',\n 'zebra',\n 'zero',\n 'zone',\n 'zoo',\n];\n","export { english } from './words/english';\n\nexport enum Language {\n 'english' = 'english',\n}\n","import { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { sha256 } from '@fuel-ts/hasher';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { arrayify } from '@fuel-ts/utils';\n\n/* Mnemonic phrase composed by words from the provided wordlist it can be a text or a array of words */\nexport type MnemonicPhrase = string | Array<string>;\n\n// Returns a byte with the LSB bits set\nfunction getLowerMask(bits: number): number {\n return (1 << bits) - 1;\n}\n\n// Returns a byte with the MSB bits set\nfunction getUpperMask(bits: number): number {\n return ((1 << bits) - 1) << (8 - bits);\n}\n\nexport function getWords(mnemonic: MnemonicPhrase): Array<string> {\n if (!Array.isArray(mnemonic)) {\n return mnemonic.split(/\\s+/);\n }\n return mnemonic;\n}\n\nexport function getPhrase(mnemonic: MnemonicPhrase): string {\n if (Array.isArray(mnemonic)) {\n return mnemonic.join(' ');\n }\n return mnemonic;\n}\n\nexport function entropyToMnemonicIndices(entropy: Uint8Array): Array<number> {\n const indices: Array<number> = [0];\n\n let remainingBits = 11;\n for (let i = 0; i < entropy.length; i += 1) {\n if (remainingBits > 8) {\n indices[indices.length - 1] <<= 8;\n indices[indices.length - 1] |= entropy[i];\n\n remainingBits -= 8;\n // This byte will complete an 11-bit index\n } else {\n indices[indices.length - 1] <<= remainingBits;\n indices[indices.length - 1] |= entropy[i] >> (8 - remainingBits);\n\n // Start the next word\n indices.push(entropy[i] & getLowerMask(8 - remainingBits));\n\n remainingBits += 3;\n }\n }\n\n // Compute the checksum bits\n const checksumBits = entropy.length / 4;\n const checksum = arrayify(sha256(entropy))[0] & getUpperMask(checksumBits);\n\n // Shift the checksum into the word indices\n indices[indices.length - 1] <<= checksumBits;\n indices[indices.length - 1] |= checksum >> (8 - checksumBits);\n\n return indices;\n}\n\nexport function mnemonicWordsToEntropy(words: Array<string>, wordlist: Array<string>): BytesLike {\n const size = Math.ceil((11 * words.length) / 8);\n const entropy = arrayify(new Uint8Array(size));\n\n let offset = 0;\n for (let i = 0; i < words.length; i += 1) {\n const index = wordlist.indexOf(words[i].normalize('NFKD'));\n if (index === -1) {\n throw new FuelError(\n ErrorCode.INVALID_MNEMONIC,\n `Invalid mnemonic: the word '${words[i]}' is not found in the provided wordlist.`\n );\n }\n\n for (let bit = 0; bit < 11; bit += 1) {\n if (index & (1 << (10 - bit))) {\n entropy[offset >> 3] |= 1 << (7 - (offset % 8));\n }\n offset += 1;\n }\n }\n const entropyBits = (32 * words.length) / 3;\n const checksumBits = words.length / 3;\n const checksumMask = getUpperMask(checksumBits);\n const checksum = arrayify(sha256(entropy.slice(0, entropyBits / 8)))[0] & checksumMask;\n\n if (checksum !== (entropy[entropy.length - 1] & checksumMask)) {\n throw new FuelError(\n ErrorCode.INVALID_CHECKSUM,\n 'Checksum validation failed for the provided mnemonic.'\n );\n }\n\n return entropy.slice(0, entropyBits / 8);\n}\n","//\n// Because WalletLocked and WalletUnlocked has a cycle dependency\n// it's not possible to split the two classes in different files\n//\n/* eslint-disable max-classes-per-file */\nimport type { BytesLike } from '@fuel-ts/utils';\n\nimport { Account } from '../account';\nimport { HDWallet } from '../hdwallet';\nimport { Mnemonic } from '../mnemonic';\nimport type { Provider } from '../providers';\nimport { Signer } from '../signer';\n\nimport { BaseWalletUnlocked } from './base-wallet-unlocked';\nimport { decryptKeystoreWallet } from './keystore-wallet';\n\nexport interface GenerateOptions {\n /** Additional entropy for the random bytes */\n entropy?: BytesLike;\n provider?: Provider;\n}\n\n/**\n * `WalletLocked` provides the functionalities for a locked wallet.\n */\nexport class WalletLocked extends Account {\n /**\n * Unlocks the wallet using the provided private key and returns an instance of WalletUnlocked.\n *\n * @param privateKey - The private key used to unlock the wallet.\n * @returns An instance of WalletUnlocked.\n */\n unlock(privateKey: BytesLike): WalletUnlocked {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return new WalletUnlocked(privateKey, this._provider);\n }\n}\n\n/**\n * `WalletUnlocked` provides the functionalities for an unlocked wallet.\n */\nexport class WalletUnlocked extends BaseWalletUnlocked {\n /**\n * Locks the wallet and returns an instance of WalletLocked.\n *\n * @returns An instance of WalletLocked.\n */\n lock(): WalletLocked {\n this.signer = () => new Signer('0x00');\n return new WalletLocked(this.address, this._provider);\n }\n\n /**\n * Generate a new Wallet Unlocked with a random key pair.\n *\n * @param generateOptions - Options to customize the generation process (optional).\n * @returns An instance of WalletUnlocked.\n */\n static generate(generateOptions?: GenerateOptions): WalletUnlocked {\n const privateKey = Signer.generatePrivateKey(generateOptions?.entropy);\n\n return new WalletUnlocked(privateKey, generateOptions?.provider);\n }\n\n /**\n * Create a Wallet Unlocked from a seed.\n *\n * @param seed - The seed phrase.\n * @param provider - A Provider instance (optional).\n * @param path - The derivation path (optional).\n * @returns An instance of WalletUnlocked.\n */\n static fromSeed(seed: string, path?: string, provider?: Provider): WalletUnlocked {\n const hdWallet = HDWallet.fromSeed(seed);\n const childWallet = hdWallet.derivePath(path || WalletUnlocked.defaultPath);\n\n return new WalletUnlocked(<string>childWallet.privateKey, provider);\n }\n\n /**\n * Create a Wallet Unlocked from a mnemonic phrase.\n *\n * @param mnemonic - The mnemonic phrase.\n * @param provider - A Provider instance (optional).\n * @param path - The derivation path (optional).\n * @param passphrase - The passphrase for the mnemonic (optional).\n * @returns An instance of WalletUnlocked.\n */\n static fromMnemonic(\n mnemonic: string,\n path?: string,\n passphrase?: BytesLike,\n provider?: Provider\n ): WalletUnlocked {\n const seed = Mnemonic.mnemonicToSeed(mnemonic, passphrase);\n const hdWallet = HDWallet.fromSeed(seed);\n const childWallet = hdWallet.derivePath(path || WalletUnlocked.defaultPath);\n\n return new WalletUnlocked(<string>childWallet.privateKey, provider);\n }\n\n /**\n * Create a Wallet Unlocked from an extended key.\n *\n * @param extendedKey - The extended key.\n * @param provider - A Provider instance (optional).\n * @returns An instance of WalletUnlocked.\n */\n static fromExtendedKey(extendedKey: string, provider?: Provider): WalletUnlocked {\n const hdWallet = HDWallet.fromExtendedKey(extendedKey);\n\n return new WalletUnlocked(<string>hdWallet.privateKey, provider);\n }\n\n /**\n * Create a Wallet Unlocked from an encrypted JSON.\n *\n * @param jsonWallet - The encrypted JSON keystore.\n * @param password - The password to decrypt the JSON.\n * @param provider - A Provider instance (optional).\n * @returns An unlocked wallet instance.\n */\n static async fromEncryptedJson(\n jsonWallet: string,\n password: string,\n provider?: Provider\n ): Promise<WalletUnlocked> {\n const privateKey = await decryptKeystoreWallet(jsonWallet, password);\n\n return new WalletUnlocked(privateKey, provider);\n }\n}\n","import type { Address } from '@fuel-ts/address';\nimport type { BytesLike } from '@fuel-ts/utils';\n\nimport type { Provider } from '../providers';\n\nimport { WalletLocked, WalletUnlocked } from './wallets';\n\n/**\n * `Wallet` provides methods to create locked and unlocked wallet instances.\n */\nexport class Wallet {\n /**\n * Creates a locked wallet instance from an address and a provider.\n *\n * @param address - The address of the wallet.\n * @param provider - A Provider instance (optional).\n * @returns A locked wallet instance.\n */\n static fromAddress(address: string | Address, provider?: Provider): WalletLocked {\n return new WalletLocked(address, provider);\n }\n\n /**\n * Creates an unlocked wallet instance from a private key and a provider.\n *\n * @param privateKey - The private key of the wallet.\n * @param provider - A Provider instance (optional).\n * @returns An unlocked wallet instance.\n */\n static fromPrivateKey(privateKey: BytesLike, provider?: Provider) {\n return new WalletUnlocked(privateKey, provider);\n }\n\n /**\n * Generate a new Wallet Unlocked with a random key pair.\n *\n * @param generateOptions - Options to customize the generation process (optional).\n * @returns An unlocked wallet instance.\n */\n static generate = WalletUnlocked.generate;\n\n /**\n * Create a Wallet Unlocked from a seed.\n *\n * @param seed - The seed phrase.\n * @param provider - A Provider instance (optional).\n * @param path - The derivation path (optional).\n * @returns An unlocked wallet instance.\n */\n static fromSeed = WalletUnlocked.fromSeed;\n\n /**\n * Create a Wallet Unlocked from a mnemonic phrase.\n *\n * @param mnemonic - The mnemonic phrase.\n * @param provider - A Provider instance (optional).\n * @param path - The derivation path (optional).\n * @param passphrase - The passphrase for the mnemonic (optional).\n * @returns An unlocked wallet instance.\n */\n static fromMnemonic = WalletUnlocked.fromMnemonic;\n\n /**\n * Create a Wallet Unlocked from an extended key.\n *\n * @param extendedKey - The extended key.\n * @param provider - A Provider instance (optional).\n * @returns An unlocked wallet instance.\n */\n static fromExtendedKey = WalletUnlocked.fromExtendedKey;\n\n /**\n * Create a Wallet Unlocked from an encrypted JSON.\n *\n * @param jsonWallet - The encrypted JSON keystore.\n * @param password - The password to decrypt the JSON.\n * @param provider - A Provider instance (optional).\n * @returns An unlocked wallet instance.\n */\n static fromEncryptedJson = WalletUnlocked.fromEncryptedJson;\n}\n","import type { AddressInput } from '@fuel-ts/address';\nimport { Address } from '@fuel-ts/address';\nimport type { Keystore } from '@fuel-ts/crypto';\nimport { encrypt, decrypt } from '@fuel-ts/crypto';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { EventEmitter } from 'events';\n\nimport type { WalletUnlocked } from '../wallet';\n\nimport { MemoryStorage } from './storages/memory-storage';\nimport type {\n StorageAbstract,\n WalletManagerAccount,\n VaultConfig,\n VaultsState,\n WalletManagerOptions,\n WalletManagerState,\n Vault,\n} from './types';\nimport { MnemonicVault } from './vaults/mnemonic-vault';\nimport { PrivateKeyVault } from './vaults/privatekey-vault';\n\nconst ERROR_MESSAGES = {\n invalid_vault_type: 'The provided Vault type is invalid.',\n address_not_found: 'No private key found for address the specified wallet address.',\n vault_not_found: 'The specified vault was not found.',\n wallet_not_unlocked: 'The wallet is currently locked.',\n passphrase_not_match: 'The provided passphrase did not match the expected value.',\n};\n\n/**\n * Generic assert function to avoid undesirable errors\n */\nfunction assert(condition: unknown, message: string): asserts condition {\n if (!condition) {\n throw new FuelError(ErrorCode.WALLET_MANAGER_ERROR, message);\n }\n}\n\n/**\n * WalletManager is a upper package to manage multiple vaults like mnemonic and privateKeys.\n *\n * - VaultTypes can be add to `WalletManager.Vaults` enabling to add custom Vault types.\n * - Storage can be instantiate when initializing enabling custom storage types.\n */\nexport class WalletManager extends EventEmitter {\n /**\n * Vaults\n *\n * Vaults are responsible to store secret keys and return an `Wallet` instance,\n * to interact with the network.\n *\n * Each vault has access to its own state\n *\n */\n static Vaults = [MnemonicVault, PrivateKeyVault];\n /**\n * Storage\n *\n * Persistent encrypted data. `The default storage works only on memory`.\n */\n readonly storage: StorageAbstract = new MemoryStorage();\n /* Key name passed to the storage */\n readonly STORAGE_KEY: string = 'WalletManager';\n\n // `This variables are only accessible from inside the class`\n #vaults: VaultsState = [];\n #passphrase = '';\n #isLocked: boolean = true;\n\n constructor(options?: WalletManagerOptions) {\n super();\n this.storage = options?.storage || this.storage;\n }\n\n get isLocked(): boolean {\n return this.#isLocked;\n }\n\n /**\n * Return the vault serialized object containing all the privateKeys,\n * the format of the return depends on the Vault type.\n */\n exportVault<T extends Vault>(vaultId: number): ReturnType<T['serialize']> {\n assert(!this.#isLocked, ERROR_MESSAGES.wallet_not_unlocked);\n const vaultState = this.#vaults.find((_, idx) => idx === vaultId);\n assert(vaultState, ERROR_MESSAGES.vault_not_found);\n return vaultState.vault.serialize() as ReturnType<T['serialize']>;\n }\n\n /**\n * List all vaults on the Wallet Manager, this function not return secret's\n */\n getVaults(): Array<{ title?: string; type: string; vaultId: number }> {\n return this.#vaults.map((v, idx) => ({\n title: v.title,\n type: v.type,\n vaultId: idx,\n }));\n }\n\n /**\n * List all accounts on the Wallet Manager not vault information is revealed\n */\n getAccounts(): Array<WalletManagerAccount> {\n // Return all WalletManagerAccounts from vaults\n return this.#vaults.flatMap<WalletManagerAccount>((vaultState, vaultId) =>\n vaultState.vault.getAccounts().map((account) => ({ ...account, vaultId }))\n );\n }\n\n /**\n * Create a Wallet instance for the specific account\n */\n getWallet(address: AddressInput): WalletUnlocked {\n const ownerAddress = new Address(address);\n const vaultState = this.#vaults.find((vs) =>\n vs.vault.getAccounts().find((a) => a.address.equals(ownerAddress))\n );\n assert(vaultState, ERROR_MESSAGES.address_not_found);\n\n return vaultState.vault.getWallet(ownerAddress);\n }\n\n /**\n * Export specific account privateKey\n */\n exportPrivateKey(address: AddressInput) {\n const ownerAddress = new Address(address);\n assert(!this.#isLocked, ERROR_MESSAGES.wallet_not_unlocked);\n const vaultState = this.#vaults.find((vs) =>\n vs.vault.getAccounts().find((a) => a.address.equals(ownerAddress))\n );\n assert(vaultState, ERROR_MESSAGES.address_not_found);\n\n return vaultState.vault.exportAccount(ownerAddress);\n }\n\n /**\n * Add account to a selected vault or on the first vault as default.\n * If not vaults are adds it will return error\n */\n async addAccount(options?: { vaultId: number }) {\n // Make sure before add new vault state is fully loaded\n await this.loadState();\n // Get vault instance\n const vaultState = this.#vaults[options?.vaultId || 0];\n await assert(vaultState, ERROR_MESSAGES.vault_not_found);\n // Add account on vault\n const account = vaultState.vault.addAccount();\n // Save the accounts state\n await this.saveState();\n // Return account\n return account;\n }\n\n /**\n * Remove vault by index, by remove the vault you also remove all accounts\n * created by the vault.\n */\n async removeVault(index: number) {\n this.#vaults.splice(index, 1);\n await this.saveState();\n }\n\n /**\n * Add Vault, the `vaultConfig.type` will look for the Vaults supported if\n * didn't found it will throw.\n */\n async addVault(vaultConfig: VaultConfig) {\n // Make sure before add new vault state is fully loaded\n await this.loadState();\n // Check if vault is supported\n const Vault = this.getVaultClass(vaultConfig.type);\n // create Vault instance\n const vault = new Vault(vaultConfig);\n // Push vaults to state\n this.#vaults = this.#vaults.concat({\n title: vaultConfig.title,\n type: vaultConfig.type,\n vault,\n });\n // Persist data on storage\n await this.saveState();\n }\n\n /**\n * Lock wallet. It removes passphrase from class instance, encrypt and hide all address and\n * secrets.\n */\n lock() {\n this.#isLocked = true;\n // Clean state vaults from state\n this.#vaults = [];\n // Clean password from state\n this.#passphrase = '';\n // Emit event that wallet is locked\n this.emit('lock');\n }\n\n /**\n * Unlock wallet. It sets passphrase on WalletManger instance load all address from configured vaults.\n * Vaults with secrets are not unlocked or instantiated on this moment.\n */\n async unlock(passphrase: string) {\n // Set password on state\n this.#passphrase = passphrase;\n // Set locked state to false\n this.#isLocked = false;\n // Try to load state with passphrase\n try {\n // Load state with passphrase\n await this.loadState();\n // Emit event that wallet is unlocked\n this.emit('unlock');\n } catch (err) {\n // If passphrase is wrong lock wallet\n await this.lock();\n // Forward error\n throw err;\n }\n }\n\n /**\n * Update WalletManager encryption passphrase\n */\n async updatePassphrase(oldpass: string, newpass: string) {\n const isLocked = this.#isLocked;\n // Unlock wallet to decrypt data\n await this.unlock(oldpass);\n // Set new password on state\n this.#passphrase = newpass;\n // Persist data on storage\n await this.saveState();\n // Load state with new password\n await this.loadState();\n // If wallet was locked, lock the wallet again\n if (isLocked) {\n await this.lock();\n }\n }\n\n /**\n * Retrieve and decrypt WalletManager state from storage\n */\n async loadState() {\n await assert(!this.#isLocked, ERROR_MESSAGES.wallet_not_unlocked);\n\n const data = await this.storage.getItem(this.STORAGE_KEY);\n if (data) {\n const state = await decrypt<WalletManagerState>(this.#passphrase, <Keystore>JSON.parse(data));\n this.#vaults = this.#deserializeVaults(state.vaults);\n }\n }\n\n /**\n * Store encrypted WalletManager state on storage\n */\n private async saveState() {\n await assert(!this.#isLocked, ERROR_MESSAGES.wallet_not_unlocked);\n\n const encryptedData = await encrypt(this.#passphrase, {\n vaults: this.#serializeVaults(this.#vaults),\n });\n await this.storage.setItem(this.STORAGE_KEY, JSON.stringify(encryptedData));\n this.emit('update');\n }\n\n /**\n * Serialize all vaults to store\n *\n * `This is only accessible from inside the class`\n */\n #serializeVaults(vaults: VaultsState) {\n return vaults.map(({ title, type, vault }) => ({\n title,\n type,\n data: vault.serialize(),\n }));\n }\n\n /**\n * Deserialize all vaults to state\n *\n * `This is only accessible from inside the class`\n */\n #deserializeVaults(vaults: VaultsState) {\n return vaults.map(({ title, type, data: vaultConfig }) => {\n const VaultClass = this.getVaultClass(type);\n return {\n title,\n type,\n vault: new VaultClass(<VaultConfig>vaultConfig),\n };\n });\n }\n\n /**\n * Return a instantiable Class reference from `WalletManager.Vaults` supported list.\n */\n private getVaultClass(type: string) {\n const VaultClass = WalletManager.Vaults.find((v) => v.type === type);\n\n assert(VaultClass, ERROR_MESSAGES.invalid_vault_type);\n\n return VaultClass;\n }\n}\n","import type { StorageAbstract } from '../types';\n\nexport class MemoryStorage implements StorageAbstract {\n storage = new Map<string, unknown>();\n\n async getItem<T>(key: string): Promise<T | null> {\n const item = await this.storage.get(key);\n return item as T | null;\n }\n\n async setItem(key: string, value: string) {\n await this.storage.set(key, value);\n }\n\n async removeItem(key: string) {\n await this.storage.delete(key);\n }\n\n async clear() {\n await this.storage.clear();\n }\n}\n","import type { AddressInput } from '@fuel-ts/address';\nimport { Address } from '@fuel-ts/address';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\n\nimport { Mnemonic } from '../../mnemonic';\nimport type { WalletUnlocked } from '../../wallet';\nimport { Wallet } from '../../wallet';\nimport type { Vault } from '../types';\n\nexport interface MnemonicVaultOptions {\n secret?: string;\n rootPath?: string;\n numberOfAccounts?: number | null;\n}\n\nexport class MnemonicVault implements Vault<MnemonicVaultOptions> {\n static readonly type = 'mnemonic';\n readonly #secret: string;\n\n pathKey = '{}';\n rootPath: string = `m/44'/1179993420'/${this.pathKey}'/0/0`;\n numberOfAccounts: number = 0;\n\n constructor(options: MnemonicVaultOptions) {\n this.#secret = options.secret || Mnemonic.generate();\n this.rootPath = options.rootPath || this.rootPath;\n // On creating the vault also adds one account\n this.numberOfAccounts = options.numberOfAccounts || 1;\n }\n\n getDerivePath(index: number) {\n if (this.rootPath.includes(this.pathKey)) {\n return this.rootPath.replace(this.pathKey, String(index));\n }\n return `${this.rootPath}/${index}`;\n }\n\n serialize(): MnemonicVaultOptions {\n return {\n secret: this.#secret,\n rootPath: this.rootPath,\n numberOfAccounts: this.numberOfAccounts,\n };\n }\n\n getAccounts() {\n const accounts = [];\n let numberOfAccounts = 0;\n\n // Create all accounts to current vault\n do {\n const wallet = Wallet.fromMnemonic(this.#secret, this.getDerivePath(numberOfAccounts));\n accounts.push({\n publicKey: wallet.publicKey,\n address: wallet.address,\n });\n numberOfAccounts += 1;\n } while (numberOfAccounts < this.numberOfAccounts);\n\n return accounts;\n }\n\n addAccount() {\n this.numberOfAccounts += 1;\n const wallet = Wallet.fromMnemonic(this.#secret, this.getDerivePath(this.numberOfAccounts - 1));\n\n return {\n publicKey: wallet.publicKey,\n address: wallet.address,\n };\n }\n\n exportAccount(address: AddressInput): string {\n let numberOfAccounts = 0;\n const ownerAddress = new Address(address);\n // Look for the account that has the same address\n do {\n const wallet = Wallet.fromMnemonic(this.#secret, this.getDerivePath(numberOfAccounts));\n if (wallet.address.equals(ownerAddress)) {\n return wallet.privateKey;\n }\n numberOfAccounts += 1;\n } while (numberOfAccounts < this.numberOfAccounts);\n\n throw new FuelError(\n ErrorCode.WALLET_MANAGER_ERROR,\n `Account with address '${address}' not found in derived wallets.`\n );\n }\n\n getWallet(address: AddressInput): WalletUnlocked {\n const privateKey = this.exportAccount(address);\n return Wallet.fromPrivateKey(privateKey);\n }\n}\n","import type { AddressInput } from '@fuel-ts/address';\nimport { Address } from '@fuel-ts/address';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\n\nimport type { WalletUnlocked } from '../../wallet';\nimport { Wallet } from '../../wallet';\nimport type { WalletManagerAccount, Vault } from '../types';\n\nexport interface PkVaultOptions {\n secret?: string;\n accounts?: Array<string>;\n}\n\nexport class PrivateKeyVault implements Vault<PkVaultOptions> {\n static readonly type = 'privateKey';\n\n #privateKeys: Array<string> = [];\n\n /**\n * If privateKey vault is initialized with a secretKey, it creates\n * one account with the fallowing secret\n */\n constructor(options: PkVaultOptions = {}) {\n if (options.secret) {\n this.#privateKeys = [options.secret];\n } else {\n this.#privateKeys = options.accounts || [Wallet.generate().privateKey];\n }\n }\n\n serialize(): PkVaultOptions {\n return {\n accounts: this.#privateKeys,\n };\n }\n\n getPublicAccount(privateKey: string) {\n const wallet = Wallet.fromPrivateKey(privateKey);\n return {\n address: wallet.address,\n publicKey: wallet.publicKey,\n };\n }\n\n getAccounts(): WalletManagerAccount[] {\n return this.#privateKeys.map((pk) => this.getPublicAccount(pk));\n }\n\n addAccount() {\n const wallet = Wallet.generate();\n\n this.#privateKeys.push(wallet.privateKey);\n\n return this.getPublicAccount(wallet.privateKey);\n }\n\n exportAccount(address: AddressInput): string {\n const ownerAddress = new Address(address);\n const privateKey = this.#privateKeys.find((pk) =>\n Wallet.fromPrivateKey(pk).address.equals(ownerAddress)\n );\n\n if (!privateKey) {\n throw new FuelError(\n ErrorCode.WALLET_MANAGER_ERROR,\n `No private key found for address '${address}'.`\n );\n }\n\n return privateKey;\n }\n\n getWallet(address: string | Address): WalletUnlocked {\n const privateKey = this.exportAccount(address);\n return Wallet.fromPrivateKey(privateKey);\n }\n}\n","/* eslint-disable max-classes-per-file */\nimport type { Address } from '@fuel-ts/address';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\n\nimport type { WalletUnlocked } from '../wallet';\n\nexport type WalletManagerAccount = {\n address: Address;\n publicKey: string;\n vaultId?: number;\n};\n\nexport type WalletManagerOptions = {\n storage: StorageAbstract;\n};\n\nexport type VaultConfig = {\n type: string;\n title?: string;\n secret?: string;\n};\n\nexport type VaultsState = Array<{\n type: string;\n title?: string;\n data?: VaultConfig;\n vault: Vault;\n}>;\n\nexport interface WalletManagerState {\n vaults: VaultsState;\n}\n\nexport abstract class Vault<TOptions = { secret?: string }> {\n static readonly type: string;\n\n constructor(_options: TOptions) {\n throw new FuelError(ErrorCode.NOT_IMPLEMENTED, 'Not implemented.');\n }\n\n serialize(): TOptions {\n throw new FuelError(ErrorCode.NOT_IMPLEMENTED, 'Not implemented.');\n }\n\n getAccounts(): WalletManagerAccount[] {\n throw new FuelError(ErrorCode.NOT_IMPLEMENTED, 'Not implemented.');\n }\n\n addAccount(): WalletManagerAccount {\n throw new FuelError(ErrorCode.NOT_IMPLEMENTED, 'Not implemented.');\n }\n\n exportAccount(_address: Address): string {\n throw new FuelError(ErrorCode.NOT_IMPLEMENTED, 'Not implemented.');\n }\n\n getWallet(_address: Address): WalletUnlocked {\n throw new FuelError(ErrorCode.NOT_IMPLEMENTED, 'Not implemented.');\n }\n}\n\nexport abstract class StorageAbstract {\n abstract setItem(key: string, value: string): Promise<void>;\n abstract getItem(key: string): Promise<string | null | undefined>;\n abstract removeItem(key: string): Promise<void>;\n abstract clear(): Promise<void>;\n}\n","import type { JsonAbi, InputValue } from '@fuel-ts/abi-coder';\nimport { Interface } from '@fuel-ts/abi-coder';\nimport { Address } from '@fuel-ts/address';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport type { BytesLike } from '@fuel-ts/utils';\nimport { arrayify, hexlify } from '@fuel-ts/utils';\n\nimport type { FakeResources } from '../account';\nimport { Account } from '../account';\nimport {\n transactionRequestify,\n isRequestInputResource,\n isRequestInputResourceFromOwner,\n isRequestInputCoinOrMessage,\n} from '../providers';\nimport type {\n CallResult,\n CoinQuantityLike,\n ExcludeResourcesOption,\n Provider,\n Resource,\n TransactionRequest,\n TransactionRequestLike,\n TransactionResponse,\n} from '../providers';\nimport { deployScriptOrPredicate } from '../utils/deployScriptOrPredicate';\n\nimport { getPredicateRoot } from './utils';\n\nexport type PredicateParams<\n TData extends InputValue[] = InputValue[],\n TConfigurables extends { [name: string]: unknown } | undefined = { [name: string]: unknown },\n> = {\n bytecode: BytesLike;\n provider: Provider;\n abi: JsonAbi;\n data?: TData;\n configurableConstants?: TConfigurables;\n};\n\n/**\n * `Predicate` provides methods to populate transaction data with predicate information and sending transactions with them.\n */\nexport class Predicate<\n TData extends InputValue[] = InputValue[],\n TConfigurables extends { [name: string]: unknown } | undefined = { [name: string]: unknown },\n> extends Account {\n bytes: Uint8Array;\n predicateData: TData = [] as unknown as TData;\n interface: Interface;\n initialBytecode: Uint8Array;\n configurableConstants: TConfigurables | undefined;\n /**\n * Creates an instance of the Predicate class.\n *\n * @param bytecode - The bytecode of the predicate.\n * @param abi - The JSON ABI of the predicate.\n * @param provider - The provider used to interact with the blockchain.\n * @param data - The predicate input data (optional).\n * @param configurableConstants - Optional configurable constants for the predicate.\n */\n constructor({\n bytecode,\n abi,\n provider,\n data,\n configurableConstants,\n }: PredicateParams<TData, TConfigurables>) {\n const { predicateBytes, predicateInterface } = Predicate.processPredicateData(\n bytecode,\n abi,\n configurableConstants\n );\n const address = new Address(getPredicateRoot(predicateBytes));\n super(address, provider);\n\n this.initialBytecode = arrayify(bytecode);\n this.bytes = predicateBytes;\n this.interface = predicateInterface;\n this.configurableConstants = configurableConstants;\n if (data !== undefined && data.length > 0) {\n this.predicateData = data;\n }\n }\n\n /**\n * Populates the transaction data with predicate data.\n *\n * @param transactionRequestLike - The transaction request-like object.\n * @returns The transaction request with predicate data.\n */\n populateTransactionPredicateData<T extends TransactionRequest>(\n transactionRequestLike: TransactionRequestLike\n ) {\n const request = transactionRequestify(transactionRequestLike) as T;\n\n const placeholderIndex = this.getIndexFromPlaceholderWitness(request);\n\n if (placeholderIndex !== -1) {\n request.removeWitness(placeholderIndex);\n }\n\n request.inputs.filter(isRequestInputCoinOrMessage).forEach((input) => {\n if (isRequestInputResourceFromOwner(input, this.address)) {\n // eslint-disable-next-line no-param-reassign\n input.predicate = hexlify(this.bytes);\n // eslint-disable-next-line no-param-reassign\n input.predicateData = hexlify(this.getPredicateData());\n // eslint-disable-next-line no-param-reassign\n input.witnessIndex = 0;\n }\n });\n\n return request;\n }\n\n /**\n * Sends a transaction with the populated predicate data.\n *\n * @param transactionRequestLike - The transaction request-like object.\n * @returns A promise that resolves to the transaction response.\n */\n override sendTransaction(\n transactionRequestLike: TransactionRequestLike\n ): Promise<TransactionResponse> {\n const transactionRequest = transactionRequestify(transactionRequestLike);\n\n return super.sendTransaction(transactionRequest, { estimateTxDependencies: false });\n }\n\n /**\n * Simulates a transaction with the populated predicate data.\n *\n * @param transactionRequestLike - The transaction request-like object.\n * @returns A promise that resolves to the call result.\n */\n override simulateTransaction(\n transactionRequestLike: TransactionRequestLike\n ): Promise<CallResult> {\n const transactionRequest = transactionRequestify(transactionRequestLike);\n return super.simulateTransaction(transactionRequest, { estimateTxDependencies: false });\n }\n\n private getPredicateData(): Uint8Array {\n if (!this.predicateData.length) {\n return new Uint8Array();\n }\n\n const mainFn = this.interface?.functions.main;\n return mainFn?.encodeArguments(this.predicateData) || new Uint8Array();\n }\n\n /**\n * Creates a new Predicate instance from an existing Predicate instance.\n * @param overrides - The data and configurable constants to override.\n * @returns A new Predicate instance with the same bytecode, ABI and provider but with the ability to set the data and configurable constants.\n */\n toNewInstance(\n overrides: Pick<PredicateParams<TData, TConfigurables>, 'data' | 'configurableConstants'> = {}\n ) {\n return new Predicate<TData, TConfigurables>({\n bytecode: this.initialBytecode,\n abi: this.interface.jsonAbi,\n provider: this.provider,\n data: overrides.data ?? this.predicateData,\n configurableConstants: overrides.configurableConstants ?? this.configurableConstants,\n });\n }\n\n /**\n * Processes the predicate data and returns the altered bytecode and interface.\n *\n * @param bytes - The bytes of the predicate.\n * @param jsonAbi - The JSON ABI of the predicate.\n * @param configurableConstants - Optional configurable constants for the predicate.\n * @returns An object containing the new predicate bytes and interface.\n */\n private static processPredicateData(\n bytes: BytesLike,\n jsonAbi: JsonAbi,\n configurableConstants?: { [name: string]: unknown }\n ) {\n let predicateBytes = arrayify(bytes);\n const abiInterface: Interface = new Interface(jsonAbi);\n\n if (abiInterface.functions.main === undefined) {\n throw new FuelError(\n ErrorCode.ABI_MAIN_METHOD_MISSING,\n 'Cannot use ABI without \"main\" function.'\n );\n }\n\n if (configurableConstants && Object.keys(configurableConstants).length) {\n predicateBytes = Predicate.setConfigurableConstants(\n predicateBytes,\n configurableConstants,\n abiInterface\n );\n }\n\n return {\n predicateBytes,\n predicateInterface: abiInterface,\n };\n }\n\n /**\n * Retrieves resources satisfying the spend query for the account.\n *\n * @param quantities - IDs of coins to exclude.\n * @param excludedIds - IDs of resources to be excluded from the query.\n * @returns A promise that resolves to an array of Resources.\n */\n override async getResourcesToSpend(\n quantities: CoinQuantityLike[] /** IDs of coins to exclude */,\n excludedIds?: ExcludeResourcesOption\n ): Promise<Resource[]> {\n const resources = await this.provider.getResourcesToSpend(\n this.address,\n quantities,\n excludedIds\n );\n return resources.map((resource) => ({\n ...resource,\n predicate: hexlify(this.bytes),\n predicateData: hexlify(this.getPredicateData()),\n }));\n }\n\n /**\n * Generates an array of fake resources based on the provided coins.\n *\n * @param coins - An array of `FakeResources` objects representing the coins.\n * @returns An array of `Resource` objects with generated properties.\n */\n override generateFakeResources(coins: FakeResources[]): Array<Resource> {\n return super.generateFakeResources(coins).map((coin) => ({\n ...coin,\n predicate: hexlify(this.bytes),\n predicateData: hexlify(this.getPredicateData()),\n }));\n }\n\n /**\n * Sets the configurable constants for the predicate.\n *\n * @param bytes - The bytes of the predicate.\n * @param configurableConstants - Configurable constants to be set.\n * @param abiInterface - The ABI interface of the predicate.\n * @returns The mutated bytes with the configurable constants set.\n */\n private static setConfigurableConstants(\n bytes: Uint8Array,\n configurableConstants: { [name: string]: unknown },\n abiInterface: Interface\n ) {\n const mutatedBytes = bytes;\n\n try {\n if (Object.keys(abiInterface.configurables).length === 0) {\n throw new FuelError(\n ErrorCode.INVALID_CONFIGURABLE_CONSTANTS,\n 'Predicate has no configurable constants to be set'\n );\n }\n\n Object.entries(configurableConstants).forEach(([key, value]) => {\n if (!abiInterface?.configurables[key]) {\n throw new FuelError(\n ErrorCode.CONFIGURABLE_NOT_FOUND,\n `No configurable constant named '${key}' found in the Predicate`\n );\n }\n\n const { offset } = abiInterface.configurables[key];\n\n const encoded = abiInterface.encodeConfigurable(key, value as InputValue);\n\n mutatedBytes.set(encoded, offset);\n });\n } catch (err) {\n throw new FuelError(\n ErrorCode.INVALID_CONFIGURABLE_CONSTANTS,\n `Error setting configurable constants: ${(<Error>err).message}.`\n );\n }\n\n return mutatedBytes;\n }\n\n /**\n * Returns the index of the witness placeholder that was added to this predicate.\n * If no witness placeholder was added, it returns -1.\n * @param request - The transaction request.\n * @returns The index of the witness placeholder, or -1 if there is no witness placeholder.\n */\n private getIndexFromPlaceholderWitness(request: TransactionRequest): number {\n const predicateInputs = request.inputs\n .filter(isRequestInputResource)\n .filter((input) => isRequestInputResourceFromOwner(input, this.address));\n\n let index = -1;\n\n const hasEmptyPredicateInputs = predicateInputs.find((input) => !input.predicate);\n\n if (hasEmptyPredicateInputs) {\n index = hasEmptyPredicateInputs.witnessIndex;\n\n const allInputsAreEmpty = predicateInputs.every((input) => !input.predicate);\n\n if (!allInputsAreEmpty) {\n /**\n * If at least one resource was added as a predicate resource, we need to check if it was the\n * first one. If that is the case, we don't need to remove the witness placeholder\n * as this was added with the \"witnessIndex\" as 0 and without a placeholder witness. Later if\n * any resource without a predicate is added, it will have the same witnessIndex because it has the\n * same owner.\n */\n const wasFilledInputAddedFirst = !!predicateInputs[0]?.predicate;\n\n if (wasFilledInputAddedFirst) {\n index = -1;\n }\n }\n }\n\n return index;\n }\n\n /**\n *\n * @param account - The account used to pay the deployment costs.\n * @returns The _blobId_ and a _waitForResult_ callback that returns the deployed predicate\n * once the blob deployment transaction finishes.\n *\n * The returned loader predicate will have the same configurable constants\n * as the original predicate which was used to generate the loader predicate.\n */\n async deploy<T = this>(account: Account) {\n return deployScriptOrPredicate<T>({\n deployer: account,\n abi: this.interface.jsonAbi,\n bytecode: this.bytes,\n loaderInstanceCallback: (loaderBytecode, newAbi) =>\n new Predicate({\n bytecode: loaderBytecode,\n abi: newAbi,\n provider: this.provider,\n data: this.predicateData,\n }) as T,\n });\n }\n}\n","import type { JsonAbi } from '@fuel-ts/abi-coder';\nimport { FuelError, ErrorCode } from '@fuel-ts/errors';\nimport { bn } from '@fuel-ts/math';\nimport { arrayify } from '@fuel-ts/utils';\n\nimport type { Account } from '../account';\nimport { BlobTransactionRequest, calculateGasFee, TransactionStatus } from '../providers';\n\nimport {\n getBytecodeConfigurableOffset,\n getBytecodeId,\n getPredicateScriptLoaderInstructions,\n} from './predicate-script-loader-instructions';\n\nasync function fundBlobTx(deployer: Account, blobTxRequest: BlobTransactionRequest) {\n // Check the account can afford to deploy all chunks and loader\n let totalCost = bn(0);\n const chainInfo = await deployer.provider.getChain();\n const gasPrice = await deployer.provider.estimateGasPrice(10);\n const priceFactor = chainInfo.consensusParameters.feeParameters.gasPriceFactor;\n\n const minGas = blobTxRequest.calculateMinGas(chainInfo);\n\n const minFee = calculateGasFee({\n gasPrice,\n gas: minGas,\n priceFactor,\n tip: blobTxRequest.tip,\n }).add(1);\n\n totalCost = totalCost.add(minFee);\n\n if (totalCost.gt(await deployer.getBalance())) {\n throw new FuelError(ErrorCode.FUNDS_TOO_LOW, 'Insufficient balance to deploy predicate.');\n }\n\n const txCost = await deployer.getTransactionCost(blobTxRequest);\n // eslint-disable-next-line no-param-reassign\n blobTxRequest.maxFee = txCost.maxFee;\n return deployer.fund(blobTxRequest, txCost);\n}\n\nfunction adjustConfigurableOffsets(jsonAbi: JsonAbi, configurableOffsetDiff: number) {\n const { configurables: readOnlyConfigurables } = jsonAbi;\n const configurables: JsonAbi['configurables'] = [];\n readOnlyConfigurables.forEach((config) => {\n // @ts-expect-error shut up the read-only thing\n configurables.push({ ...config, offset: config.offset - configurableOffsetDiff });\n });\n return { ...jsonAbi, configurables } as JsonAbi;\n}\n\ninterface Deployer<T> {\n deployer: Account;\n bytecode: Uint8Array;\n abi: JsonAbi;\n loaderInstanceCallback: (loaderBytecode: Uint8Array, newAbi: JsonAbi) => T;\n}\n\nexport async function deployScriptOrPredicate<T>({\n deployer,\n bytecode,\n abi,\n loaderInstanceCallback,\n}: Deployer<T>) {\n const blobId = getBytecodeId(arrayify(bytecode));\n\n const configurableOffset = getBytecodeConfigurableOffset(arrayify(bytecode));\n const byteCodeWithoutConfigurableSection = bytecode.slice(0, configurableOffset);\n\n const blobTxRequest = new BlobTransactionRequest({\n blobId,\n witnessIndex: 0,\n witnesses: [byteCodeWithoutConfigurableSection],\n });\n\n const { loaderBytecode, blobOffset } = getPredicateScriptLoaderInstructions(\n arrayify(bytecode),\n arrayify(blobId)\n );\n\n const newConfigurableOffsetDiff = byteCodeWithoutConfigurableSection.length - (blobOffset || 0);\n const newAbi = adjustConfigurableOffsets(abi, newConfigurableOffsetDiff);\n\n const blobExists = (await deployer.provider.getBlobs([blobId])).length > 0;\n\n const loaderInstance = loaderInstanceCallback(loaderBytecode, newAbi);\n if (blobExists) {\n return {\n waitForResult: () => Promise.resolve(loaderInstance),\n blobId,\n };\n }\n\n const fundedBlobRequest = await fundBlobTx(deployer, blobTxRequest);\n\n // Transaction id is unset until we have funded the create tx, which is dependent on the blob tx\n const waitForResult = async () => {\n try {\n const blobTx = await deployer.sendTransaction(fundedBlobRequest);\n const result = await blobTx.waitForResult();\n\n if (result.status !== TransactionStatus.success) {\n throw new Error();\n }\n } catch (err: unknown) {\n throw new FuelError(ErrorCode.TRANSACTION_FAILED, 'Failed to deploy predicate chunk');\n }\n\n return loaderInstance;\n };\n\n return {\n waitForResult,\n blobId,\n };\n}\n","import { BigNumberCoder } from '@fuel-ts/abi-coder';\nimport { sha256 } from '@fuel-ts/hasher';\nimport { concat } from '@fuel-ts/utils';\nimport * as asm from '@fuels/vm-asm';\n\nconst BLOB_ID_SIZE = 32;\nconst REG_ADDRESS_OF_DATA_AFTER_CODE = 0x10;\nconst REG_START_OF_LOADED_CODE = 0x11;\nconst REG_GENERAL_USE = 0x12;\nconst WORD_SIZE = 8; // size in bytes\n\nexport const DATA_OFFSET_INDEX = 8;\nexport const CONFIGURABLE_OFFSET_INDEX = 16;\n\n/**\n * Get the offset of the data section in the bytecode\n *\n * @param bytecode - The bytecode to get the offset from\n * @returns The offset of the data section\n */\nexport function getBytecodeDataOffset(bytecode: Uint8Array): number {\n const [offset] = new BigNumberCoder('u64').decode(bytecode, DATA_OFFSET_INDEX);\n return offset.toNumber();\n}\n\n/**\n * Get the offset of the configurable section in the bytecode\n *\n * @param bytecode - The bytecode to get the offset from\n * @returns The offset of the configurable section\n */\nexport function getBytecodeConfigurableOffset(bytecode: Uint8Array): number {\n const [offset] = new BigNumberCoder('u64').decode(bytecode, CONFIGURABLE_OFFSET_INDEX);\n return offset.toNumber();\n}\n\n/**\n * Takes bytecode and generates it's associated bytecode ID.\n *\n * The bytecode ID is a hash of the bytecode when sliced at the configurable offset. This\n * superseded legacy blob IDs when uploading blobs for scripts and predicates so that\n * the bytecode ID is equal to the legacy blob ID. Therefore blobs can be used for ABI verification.\n *\n * @param bytecode - The bytecode to get the id from\n * @returns The id of the bytecode\n */\nexport function getBytecodeId(bytecode: Uint8Array): string {\n const configurableOffset = getBytecodeConfigurableOffset(bytecode);\n const byteCodeWithoutConfigurableSection = bytecode.slice(0, configurableOffset);\n\n return sha256(byteCodeWithoutConfigurableSection);\n}\n\n/**\n * Takes bytecode and generates it's associated legacy blob ID.\n *\n * The legacy blob ID is a hash of the bytecode when sliced at the data section offset.\n *\n * @param bytecode - The bytecode to get the id from\n * @returns The id of the bytecode\n */\nexport function getLegacyBlobId(bytecode: Uint8Array): string {\n const dataOffset = getBytecodeDataOffset(bytecode);\n const byteCodeWithoutDataSection = bytecode.slice(0, dataOffset);\n\n return sha256(byteCodeWithoutDataSection);\n}\n\nexport function getPredicateScriptLoaderInstructions(\n originalBinary: Uint8Array,\n blobId: Uint8Array\n) {\n // The final code is going to have this structure:\n // 1. loader instructions\n // 2. blob id\n // 3. length_of_data_section\n // 4. the data_section (updated with configurables as needed)\n\n const { RegId, Instruction } = asm;\n\n const REG_PC = RegId.pc().to_u8();\n const REG_SP = RegId.sp().to_u8();\n const REG_IS = RegId.is().to_u8();\n\n const getInstructions = (numOfInstructions: number) => [\n // 1. Load the blob content into memory\n // Find the start of the hardcoded blob ID, which is located after the loader code ends.\n asm.move_(REG_ADDRESS_OF_DATA_AFTER_CODE, REG_PC),\n // hold the address of the blob ID.\n asm.addi(\n REG_ADDRESS_OF_DATA_AFTER_CODE,\n REG_ADDRESS_OF_DATA_AFTER_CODE,\n numOfInstructions * Instruction.size()\n ),\n // The code is going to be loaded from the current value of SP onwards, save\n // the location into REG_START_OF_LOADED_CODE so we can jump into it at the end.\n asm.move_(REG_START_OF_LOADED_CODE, REG_SP),\n // REG_GENERAL_USE to hold the size of the blob.\n asm.bsiz(REG_GENERAL_USE, REG_ADDRESS_OF_DATA_AFTER_CODE),\n // Push the blob contents onto the stack.\n asm.ldc(REG_ADDRESS_OF_DATA_AFTER_CODE, 0, REG_GENERAL_USE, 1),\n // Move on to the data section length\n asm.addi(REG_ADDRESS_OF_DATA_AFTER_CODE, REG_ADDRESS_OF_DATA_AFTER_CODE, BLOB_ID_SIZE),\n // load the size of the data section into REG_GENERAL_USE\n asm.lw(REG_GENERAL_USE, REG_ADDRESS_OF_DATA_AFTER_CODE, 0),\n // after we have read the length of the data section, we move the pointer to the actual\n // data by skipping WORD_SIZE bytes.\n asm.addi(REG_ADDRESS_OF_DATA_AFTER_CODE, REG_ADDRESS_OF_DATA_AFTER_CODE, WORD_SIZE),\n // load the data section of the executable\n asm.ldc(REG_ADDRESS_OF_DATA_AFTER_CODE, 0, REG_GENERAL_USE, 2),\n // Jump into the memory where the contract is loaded.\n // What follows is called _jmp_mem by the sway compiler.\n // Subtract the address contained in IS because jmp will add it back.\n asm.sub(REG_START_OF_LOADED_CODE, REG_START_OF_LOADED_CODE, REG_IS),\n // jmp will multiply by 4, so we need to divide to cancel that out.\n asm.divi(REG_START_OF_LOADED_CODE, REG_START_OF_LOADED_CODE, 4),\n // Jump to the start of the contract we loaded.\n asm.jmp(REG_START_OF_LOADED_CODE),\n ];\n\n const getInstructionsNoDataSection = (numOfInstructions: number) => [\n // 1. Load the blob content into memory\n // Find the start of the hardcoded blob ID, which is located after the loader code ends.\n // 1. Load the blob content into memory\n // Find the start of the hardcoded blob ID, which is located after the loader code ends.\n asm.move_(REG_ADDRESS_OF_DATA_AFTER_CODE, REG_PC),\n // hold the address of the blob ID.\n asm.addi(\n REG_ADDRESS_OF_DATA_AFTER_CODE,\n REG_ADDRESS_OF_DATA_AFTER_CODE,\n numOfInstructions * Instruction.size()\n ),\n // The code is going to be loaded from the current value of SP onwards, save\n // the location into REG_START_OF_LOADED_CODE so we can jump into it at the end.\n asm.move_(REG_START_OF_LOADED_CODE, REG_SP),\n // REG_GENERAL_USE to hold the size of the blob.\n asm.bsiz(REG_GENERAL_USE, REG_ADDRESS_OF_DATA_AFTER_CODE),\n // Push the blob contents onto the stack.\n asm.ldc(REG_ADDRESS_OF_DATA_AFTER_CODE, 0, REG_GENERAL_USE, 1),\n // Jump into the memory where the contract is loaded.\n // What follows is called _jmp_mem by the sway compiler.\n // Subtract the address contained in IS because jmp will add it back.\n asm.sub(REG_START_OF_LOADED_CODE, REG_START_OF_LOADED_CODE, REG_IS),\n // jmp will multiply by 4, so we need to divide to cancel that out.\n asm.divi(REG_START_OF_LOADED_CODE, REG_START_OF_LOADED_CODE, 4),\n // Jump to the start of the contract we loaded.\n asm.jmp(REG_START_OF_LOADED_CODE),\n ];\n\n const offset = getBytecodeConfigurableOffset(originalBinary);\n\n // if the binary length is smaller than the offset\n if (originalBinary.length < offset) {\n throw new Error(\n `Data section offset is out of bounds, offset: ${offset}, binary length: ${originalBinary.length}`\n );\n }\n\n // Extract the configurable section from the binary (slice from the configurable offset onwards)\n const configurableSection = originalBinary.slice(offset);\n\n // Check if the configurable section is non-empty\n if (configurableSection.length > 0) {\n // Get the number of instructions (assuming it won't exceed u16::MAX)\n const numOfInstructions = getInstructions(0).length;\n if (numOfInstructions > 65535) {\n throw new Error('Too many instructions, exceeding u16::MAX.');\n }\n\n // Convert instructions to bytes\n const instructionBytes = new Uint8Array(\n getInstructions(numOfInstructions).flatMap((instruction) =>\n Array.from(instruction.to_bytes())\n )\n );\n\n // Convert blobId to bytes\n const blobBytes = new Uint8Array(blobId);\n\n // Convert data section length to big-endian 8-byte array\n const dataSectionLenBytes = new Uint8Array(8);\n const dataView = new DataView(dataSectionLenBytes.buffer);\n dataView.setBigUint64(0, BigInt(configurableSection.length), false); // false for big-endian\n\n // Combine the instruction bytes, blob bytes, data section length, and the data section\n const loaderBytecode = new Uint8Array([\n ...instructionBytes,\n ...blobBytes,\n ...dataSectionLenBytes,\n ]);\n\n return {\n loaderBytecode: concat([loaderBytecode, configurableSection]),\n blobOffset: loaderBytecode.length,\n };\n }\n // Handle case where there is no configurable section\n const numOfInstructions = getInstructionsNoDataSection(0).length;\n if (numOfInstructions > 65535) {\n throw new Error('Too many instructions, exceeding u16::MAX.');\n }\n\n // Convert instructions to bytes\n const instructionBytes = new Uint8Array(\n getInstructionsNoDataSection(numOfInstructions).flatMap((instruction) =>\n Array.from(instruction.to_bytes())\n )\n );\n\n // Convert blobId to bytes\n const blobBytes = new Uint8Array(blobId);\n\n // Combine the instruction bytes and blob bytes\n const loaderBytecode = new Uint8Array([...instructionBytes, ...blobBytes]);\n\n return { loaderBytecode };\n}\n","import { hash } from '@fuel-ts/hasher';\nimport { calcRoot } from '@fuel-ts/merkle';\nimport { chunkAndPadBytes, hexlify, concat, arrayify } from '@fuel-ts/utils';\nimport type { BytesLike } from '@fuel-ts/utils';\n\n/**\n * @hidden\n *\n * Calculates the predicate root for a given bytecode and chain ID.\n *\n * @param bytecode - The bytecode represented as a BytesLike object.\n * @param chainId - The ID of the chain associated with the bytecode.\n * @returns The predicate root as a string.\n */\nexport const getPredicateRoot = (bytecode: BytesLike): string => {\n const chunkSize = 16 * 1024;\n const bytes = arrayify(bytecode);\n const chunks = chunkAndPadBytes(bytes, chunkSize);\n const codeRoot = calcRoot(chunks.map((c) => hexlify(c)));\n\n const predicateRoot = hash(concat(['0x4655454C', codeRoot]));\n return predicateRoot;\n};\n","import type { Address } from '@fuel-ts/address';\nimport { ErrorCode, FuelError } from '@fuel-ts/errors';\n\nimport { Account } from '../account';\nimport { Provider } from '../providers';\nimport type { StorageAbstract } from '../wallet-manager';\n\nimport { FuelConnector } from './fuel-connector';\nimport {\n FuelConnectorMethods,\n FuelConnectorEventTypes,\n FuelConnectorEventType,\n LocalStorage,\n} from './types';\nimport type { Network, FuelConnectorEventsType, TargetObject } from './types';\nimport type { CacheFor } from './utils';\nimport { cacheFor, deferPromise, withTimeout } from './utils';\n\n// This is the time to wait for the connector\n// to be available before returning false for hasConnector.\nconst HAS_CONNECTOR_TIMEOUT = 2_000;\n// The time to cache the ping result, as is not\n// expected to change the availability of the connector to\n// change too often we can safely cache the result for 5 seconds\n// at minimum.\nconst PING_CACHE_TIME = 5_000;\n\nconst { warn } = console;\n\nexport type FuelConfig = {\n connectors?: Array<FuelConnector>;\n storage?: StorageAbstract | null;\n targetObject?: TargetObject;\n};\n\nexport type FuelConnectorSelectOptions = {\n emitEvents?: boolean;\n};\n\nexport type Status = {\n installed: boolean;\n connected: boolean;\n};\n\ninterface FuelSdk {\n // #region connector-manager-method-connectors\n connectors: () => Promise<Array<FuelConnector>>;\n // #endregion connector-manager-method-connectors\n // #region connector-manager-method-getConnector\n getConnector: (connector: FuelConnector | string) => FuelConnector | null;\n // #endregion connector-manager-method-getConnector\n // #region connector-manager-method-hasConnector\n hasConnector(): Promise<boolean>;\n // #endregion connector-manager-method-hasConnector\n // #region connector-manager-method-selectConnector\n selectConnector(connectorName: string, options: FuelConnectorSelectOptions): Promise<boolean>;\n // #endregion connector-manager-method-selectConnector\n // #region connector-manager-method-currentConnector\n currentConnector(): FuelConnector | null | undefined;\n // #endregion connector-manager-method-currentConnector\n // #region connector-manager-method-hasWallet\n hasWallet(): Promise<boolean>;\n // #endregion connector-manager-method-hasWallet\n // #region connector-manager-method-getWallet\n getWallet(address: string | Address, providerOrNetwork?: Provider | Network): Promise<Account>;\n // #endregion connector-manager-method-getWallet\n // #region connector-manager-method-unsubscribe\n unsubscribe(): void;\n // #endregion connector-manager-method-unsubscribe\n // #region connector-manager-method-clean\n clean(): Promise<void>;\n // #endregion connector-manager-method-clean\n // #region connector-manager-method-destroy\n destroy(): Promise<void>;\n // #endregion connector-manager-method-destroy\n}\n\nexport class Fuel extends FuelConnector implements FuelSdk {\n static STORAGE_KEY = 'fuel-current-connector';\n static defaultConfig: FuelConfig = {};\n private _storage?: StorageAbstract | null = null;\n private _connectors: Array<FuelConnector> = [];\n private _targetObject: TargetObject | null = null;\n private _unsubscribes: Array<() => void> = [];\n private _targetUnsubscribe = () => {};\n private _pingCache: CacheFor = {};\n private _currentConnector?: FuelConnector | null;\n private _initializationPromise: Promise<void> | null = null;\n\n constructor(config: FuelConfig = Fuel.defaultConfig) {\n super();\n // Increase the limit of listeners\n this.setMaxListeners(1_000);\n // Set all connectors\n this._connectors = config.connectors ?? [];\n // Set the target object to listen for global events\n this._targetObject = this.getTargetObject(config.targetObject);\n // Set default storage\n this._storage = config.storage === undefined ? this.getStorage() : config.storage;\n // Setup all methods\n this.setupMethods();\n this._initializationPromise = this.initialize();\n }\n\n private async initialize(): Promise<void> {\n try {\n const connectResponse = this.setDefaultConnector();\n this._targetUnsubscribe = this.setupConnectorListener();\n await connectResponse;\n } catch (error) {\n throw new FuelError(ErrorCode.INVALID_PROVIDER, 'Error initializing Fuel Connector');\n }\n }\n\n public async init(): Promise<Fuel> {\n await this._initializationPromise;\n return this;\n }\n\n /**\n * Return the target object to listen for global events.\n */\n private getTargetObject(targetObject?: TargetObject): TargetObject | null {\n if (targetObject) {\n return targetObject;\n }\n if (typeof window !== 'undefined') {\n return window;\n }\n if (typeof document !== 'undefined') {\n return document;\n }\n return null;\n }\n\n /**\n * Return the storage used.\n */\n private getStorage(): StorageAbstract | undefined {\n if (typeof window !== 'undefined') {\n return new LocalStorage(window.localStorage);\n }\n return undefined;\n }\n\n /**\n * Setup the default connector from the storage.\n */\n private async setDefaultConnector(): Promise<boolean | undefined> {\n const connectorName =\n (await this._storage?.getItem(Fuel.STORAGE_KEY)) || this._connectors[0]?.name;\n if (connectorName) {\n // Setup all events for the current connector\n return this.selectConnector(connectorName, {\n emitEvents: false,\n });\n }\n\n return undefined;\n }\n\n /**\n * Start listener for all the events of the current\n * connector and emit them to the Fuel instance\n */\n private setupConnectorEvents(events: string[]): void {\n if (!this._currentConnector) {\n return;\n }\n const currentConnector = this._currentConnector;\n this._unsubscribes.map((unSub) => unSub());\n this._unsubscribes = events.map((event) => {\n const handler = (...args: unknown[]) => this.emit(event, ...args);\n currentConnector.on(event as FuelConnectorEventsType, handler);\n return () => currentConnector.off(event, handler);\n });\n }\n\n /**\n * Call method from the current connector.\n */\n private async callMethod(method: string, ...args: unknown[]) {\n const hasConnector = await this.hasConnector();\n await this.pingConnector();\n if (!this._currentConnector || !hasConnector) {\n throw new FuelError(\n ErrorCode.MISSING_CONNECTOR,\n `No connector selected for calling ${method}. Use hasConnector before executing other methods.`\n );\n }\n if (typeof this._currentConnector[method as keyof FuelConnector] === 'function') {\n return (this._currentConnector[method as keyof FuelConnector] as CallableFunction)(...args);\n }\n\n return undefined;\n }\n\n /**\n * Create a method for each method proxy that is available on the Common interface\n * and call the method from the current connector.\n */\n private setupMethods(): void {\n Object.values(FuelConnectorMethods).forEach((method) => {\n this[method] = async (...args: unknown[]) => this.callMethod(method, ...args);\n });\n }\n\n /**\n * Fetch the status of a connector and set the installed and connected\n * status.\n */\n private async fetchConnectorStatus(\n connector: FuelConnector & { _latestUpdate?: number }\n ): Promise<Status> {\n // Control fetch status to avoid rewriting the status\n // on late responses in this way even if a response is\n // late we can avoid rewriting the status of the connector\n const requestTimestamp = Date.now();\n const [isConnected, ping] = await Promise.allSettled([\n withTimeout(connector.isConnected()),\n withTimeout(this.pingConnector(connector)),\n ]);\n // If the requestTimestamp is greater than the latest update\n // we can ignore the response as is treated as stale.\n const isStale = requestTimestamp < (connector._latestUpdate || 0);\n if (!isStale) {\n // eslint-disable-next-line no-param-reassign\n connector._latestUpdate = Date.now();\n // eslint-disable-next-line no-param-reassign\n connector.installed = ping.status === 'fulfilled' && ping.value;\n // eslint-disable-next-line no-param-reassign\n connector.connected = isConnected.status === 'fulfilled' && isConnected.value;\n }\n return {\n installed: connector.installed,\n connected: connector.connected,\n };\n }\n\n /**\n * Fetch the status of all connectors and set the installed and connected\n * status.\n */\n private async fetchConnectorsStatus(): Promise<Status[]> {\n return Promise.all(\n this._connectors.map(async (connector) => this.fetchConnectorStatus(connector))\n );\n }\n\n /**\n * Fetch the status of a connector and set the installed and connected\n * status. If no connector is provided it will ping the current connector.\n */\n private async pingConnector(connector?: FuelConnector) {\n const curConnector = connector || this._currentConnector;\n if (!curConnector) {\n return false;\n }\n // If finds a ping in the cache and the value is true\n // return from cache\n try {\n return await cacheFor(async () => withTimeout(curConnector.ping()), {\n key: curConnector.name,\n cache: this._pingCache,\n cacheTime: PING_CACHE_TIME,\n })();\n } catch {\n throw new FuelError(ErrorCode.INVALID_PROVIDER, 'Current connector is not available.');\n }\n }\n\n /**\n * Setup a listener for the FuelConnector event and add the connector\n * to the list of new connectors.\n */\n private setupConnectorListener = () => {\n const { _targetObject: targetObject } = this;\n const eventName = FuelConnectorEventType;\n if (targetObject?.on) {\n targetObject.on(eventName, this.addConnector);\n return () => {\n targetObject.off?.(eventName, this.addConnector);\n };\n }\n if (targetObject?.addEventListener) {\n const handler = (e: CustomEvent<FuelConnector>) => {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.addConnector(e.detail);\n };\n targetObject.addEventListener(eventName, handler);\n return () => {\n targetObject.removeEventListener?.(eventName, handler);\n };\n }\n return () => {};\n };\n\n /**\n * Add a new connector to the list of connectors.\n */\n private addConnector = async (connector: FuelConnector): Promise<void> => {\n if (!this.getConnector(connector)) {\n this._connectors.push(connector);\n }\n // Fetch the status of the new connector\n await this.fetchConnectorStatus(connector);\n // Emit connectors events once the connector list changes\n this.emit(this.events.connectors, this._connectors);\n // If the current connector is not set\n if (!this._currentConnector) {\n // set the new connector as currentConnector\n await this.selectConnector(connector.name, {\n emitEvents: false,\n });\n }\n };\n\n private triggerConnectorEvents = async () => {\n const [isConnected, networks, currentNetwork] = await Promise.all([\n this.isConnected(),\n this.networks(),\n this.currentNetwork(),\n ]);\n this.emit(this.events.connection, isConnected);\n this.emit(this.events.networks, networks);\n this.emit(this.events.currentNetwork, currentNetwork);\n if (isConnected) {\n const [accounts, currentAccount] = await Promise.all([\n this.accounts(),\n this.currentAccount(),\n ]);\n this.emit(this.events.accounts, accounts);\n this.emit(this.events.currentAccount, currentAccount);\n }\n };\n\n /**\n * Get a connector from the list of connectors.\n */\n getConnector = (connector: FuelConnector | string): FuelConnector | null =>\n this._connectors.find((c) => {\n const connectorName = typeof connector === 'string' ? connector : connector.name;\n return c.name === connectorName || c === connector;\n }) || null;\n\n /**\n * Return the list of connectors with the status of installed and connected.\n */\n async connectors(): Promise<Array<FuelConnector>> {\n await this.fetchConnectorsStatus();\n return this._connectors;\n }\n\n /**\n * Set the current connector to be used.\n */\n async selectConnector(\n connectorName: string,\n options: FuelConnectorSelectOptions = {\n emitEvents: true,\n }\n ): Promise<boolean> {\n const connector = this.getConnector(connectorName);\n if (!connector) {\n return false;\n }\n if (this._currentConnector?.name === connectorName) {\n return true;\n }\n const { installed } = await this.fetchConnectorStatus(connector);\n if (installed) {\n this._currentConnector = connector;\n this.emit(this.events.currentConnector, connector);\n this.setupConnectorEvents(Object.values(FuelConnectorEventTypes));\n await this._storage?.setItem(Fuel.STORAGE_KEY, connector.name);\n // If emitEvents is true we query all the data from the connector\n // and emit the events to the Fuel instance allowing the application to\n // react to changes in the connector state.\n if (options.emitEvents) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.triggerConnectorEvents();\n }\n return true;\n }\n return false;\n }\n\n /**\n * Return the current selected connector.\n */\n currentConnector(): FuelConnector | null | undefined {\n return this._currentConnector;\n }\n\n /**\n * Return true if any connector is available.\n */\n async hasConnector(): Promise<boolean> {\n // If there is a current connector return true\n // as the connector is ready\n if (this._currentConnector) {\n return true;\n }\n // If there is no current connector\n // wait for the current connector to be set\n // for 1 second and return false if is not set\n const defer = deferPromise<boolean>();\n this.once(this.events.currentConnector, () => {\n defer.resolve(true);\n });\n // As the max ping time is 1 second we wait for 2 seconds\n // to allow applications to react to the current connector\n return withTimeout(defer.promise, HAS_CONNECTOR_TIMEOUT)\n .then(() => true)\n .catch(() => false);\n }\n\n async hasWallet(): Promise<boolean> {\n return this.hasConnector();\n }\n\n /**\n * Return a Fuel Provider instance with extends features to work with\n * connectors.\n *\n * @deprecated getProvider is deprecated and is going to be removed in the future, use getWallet instead.\n */\n async getProvider(providerOrNetwork?: Provider | Network): Promise<Provider> {\n warn(\n 'getProvider is deprecated and is going to be removed in the future, use getWallet instead.'\n );\n return this._getProvider(providerOrNetwork);\n }\n\n /**\n * Return a Fuel Provider instance with extends features to work with\n * connectors.\n */\n private async _getProvider(providerOrNetwork?: Provider | Network): Promise<Provider> {\n // Decide which provider to use based on the providerOrNetwork\n let provider: Provider;\n // If provider is a valid instance of a Provider use it\n if (providerOrNetwork && 'getTransactionResponse' in providerOrNetwork) {\n provider = providerOrNetwork;\n // If the provided param is a valid network use it\n } else if (providerOrNetwork && 'chainId' in providerOrNetwork && 'url' in providerOrNetwork) {\n provider = new Provider(providerOrNetwork.url);\n // If nor provider or network is provided use the current network\n } else if (!providerOrNetwork) {\n const currentNetwork = await this.currentNetwork();\n provider = new Provider(currentNetwork.url);\n // If a provider or network was informed but is not valid\n // throw an error\n } else {\n throw new FuelError(ErrorCode.INVALID_PROVIDER, 'Provider is not valid.');\n }\n return provider;\n }\n\n /**\n * Return a Fuel Wallet Locked instance with extends features to work with\n * connectors.\n */\n async getWallet(\n address: string | Address,\n providerOrNetwork?: Provider | Network\n ): Promise<Account> {\n const provider = await this._getProvider(providerOrNetwork);\n return new Account(address, provider, this);\n }\n\n /**\n * Remove all open listeners this is useful when you want to\n * remove the Fuel instance and avoid memory leaks.\n */\n unsubscribe(): void {\n // Unsubscribe from all events\n this._unsubscribes.map((unSub) => unSub());\n this._targetUnsubscribe();\n // Remove all listeners from fuel instance\n this.removeAllListeners();\n }\n\n /**\n * Clean all the data from the storage.\n */\n async clean(): Promise<void> {\n await this._storage?.removeItem(Fuel.STORAGE_KEY);\n }\n\n /**\n * Removes all listeners and cleans the storage.\n */\n async destroy(): Promise<void> {\n this.unsubscribe();\n await this.clean();\n }\n}\n","/* eslint-disable @typescript-eslint/require-await */\nimport { FuelError } from '@fuel-ts/errors';\nimport { EventEmitter } from 'events';\n\nimport type { Asset } from '../assets/types';\nimport type { TransactionRequestLike } from '../providers';\n\nimport { FuelConnectorEventTypes } from './types';\nimport type {\n FuelConnectorEvents,\n ConnectorMetadata,\n FuelABI,\n Network,\n FuelEventArg,\n Version,\n SelectNetworkArguments,\n FuelConnectorSendTxParams,\n} from './types';\n\ninterface Connector {\n // #region fuel-connector-method-ping\n ping(): Promise<boolean>;\n // #endregion fuel-connector-method-ping\n // #region fuel-connector-method-version\n version(): Promise<Version>;\n // #endregion fuel-connector-method-version\n // #region fuel-connector-method-isConnected\n isConnected(): Promise<boolean>;\n // #endregion fuel-connector-method-isConnected\n // #region fuel-connector-method-accounts\n accounts(): Promise<Array<string>>;\n // #endregion fuel-connector-method-accounts\n // #region fuel-connector-method-connect\n connect(): Promise<boolean>;\n // #endregion fuel-connector-method-connect\n // #region fuel-connector-method-disconnect\n disconnect(): Promise<boolean>;\n // #endregion fuel-connector-method-disconnect\n // #region fuel-connector-method-signMessage\n signMessage(address: string, message: string): Promise<string>;\n // #endregion fuel-connector-method-signMessage\n // #region fuel-connector-method-signTransaction\n signTransaction(address: string, transaction: TransactionRequestLike): Promise<string>;\n // #endregion fuel-connector-method-signTransaction\n // #region fuel-connector-method-sendTransaction\n sendTransaction(\n address: string,\n transaction: TransactionRequestLike,\n params?: FuelConnectorSendTxParams\n ): Promise<string>;\n // #endregion fuel-connector-method-sendTransaction\n // #region fuel-connector-method-currentAccount\n currentAccount(): Promise<string | null>;\n // #endregion fuel-connector-method-currentAccount\n // #region fuel-connector-method-addAssets\n addAssets(assets: Array<Asset>): Promise<boolean>;\n // #endregion fuel-connector-method-addAssets\n // #region fuel-connector-method-addAsset\n addAsset(asset: Asset): Promise<boolean>;\n // #endregion fuel-connector-method-addAsset\n // #region fuel-connector-method-assets\n assets(): Promise<Array<Asset>>;\n // #endregion fuel-connector-method-assets\n // #region fuel-connector-method-addNetwork\n addNetwork(networkUrl: string): Promise<boolean>;\n // #endregion fuel-connector-method-addNetwork\n // #region fuel-connector-method-selectNetwork\n selectNetwork(network: SelectNetworkArguments): Promise<boolean>;\n // #endregion fuel-connector-method-selectNetwork\n // #region fuel-connector-method-networks\n networks(): Promise<Array<Network>>;\n // #endregion fuel-connector-method-networks\n // #region fuel-connector-method-currentNetwork\n currentNetwork(): Promise<Network>;\n // #endregion fuel-connector-method-currentNetwork\n // #region fuel-connector-method-addABI\n addABI(contractId: string, abi: FuelABI): Promise<boolean>;\n // #endregion fuel-connector-method-addABI\n // #region fuel-connector-method-getABI\n getABI(contractId: string): Promise<FuelABI | null>;\n // #endregion fuel-connector-method-getABI\n // #region fuel-connector-method-hasABI\n hasABI(contractId: string): Promise<boolean>;\n // #endregion fuel-connector-method-hasABI\n}\n\n/**\n * @name FuelConnector\n *\n * Wallet Connector is a interface that represents a Wallet Connector and all the methods\n * that should be implemented to be compatible with the Fuel SDK.\n */\nexport abstract class FuelConnector extends EventEmitter implements Connector {\n name: string = '';\n metadata: ConnectorMetadata = {} as ConnectorMetadata;\n connected: boolean = false;\n installed: boolean = false;\n external: boolean = true;\n events = FuelConnectorEventTypes;\n\n /**\n * Should return true if the connector is loaded\n * in less then one second.\n *\n * @returns Always true.\n */\n async ping(): Promise<boolean> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should return the current version of the connector\n * and the network version that is compatible.\n *\n * @returns boolean - connection status.\n */\n async version(): Promise<Version> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should return true if the connector is connected\n * to any of the accounts available.\n *\n * @returns The connection status.\n */\n async isConnected(): Promise<boolean> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should return all the accounts authorized for the\n * current connection.\n *\n * @returns The accounts addresses strings\n */\n async accounts(): Promise<Array<string>> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should start the connection process and return\n * true if the account authorize the connection.\n *\n * and return false if the user reject the connection.\n *\n * @emits accounts\n * @returns boolean - connection status.\n */\n async connect(): Promise<boolean> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should disconnect the current connection and\n * return false if the disconnection was successful.\n *\n * @emits assets connection\n * @returns The connection status.\n */\n async disconnect(): Promise<boolean> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should start the sign message process and return\n * the signed message.\n *\n * @param address - The address to sign the message\n * @param message - The message to sign all text will be treated as text utf-8\n *\n * @returns Message signature\n */\n async signMessage(_address: string, _message: string): Promise<string> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should start the sign transaction process and return\n * the signed transaction.\n *\n * @param address - The address to sign the transaction\n * @param transaction - The transaction to sign\n *\n * @returns Transaction signature\n */\n async signTransaction(_address: string, _transaction: TransactionRequestLike): Promise<string> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should start the send transaction process and return\n * the transaction id submitted to the network.\n *\n * If the network is not available for the connection\n * it should throw an error to avoid the transaction\n * to be sent to the wrong network and lost.\n *\n * @param address - The address to sign the transaction\n * @param transaction - The transaction to send\n * @param params - Optional parameters to send the transaction\n * @returns The transaction id\n */\n async sendTransaction(\n _address: string,\n _transaction: TransactionRequestLike,\n _params?: FuelConnectorSendTxParams\n ): Promise<string> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should return the current account selected inside the connector, if the account\n * is authorized for the connection.\n *\n * If the account is not authorized it should return null.\n *\n * @returns The current account selected otherwise null.\n */\n async currentAccount(): Promise<string | null> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should add the assets metadata to the connector and return true if the asset\n * was added successfully.\n *\n * If the asset already exists it should throw an error.\n *\n * @emits assets\n * @param assets - The assets to add the metadata to the connection.\n * @throws Error if the asset already exists\n * @returns True if the asset was added successfully\n */\n async addAssets(_assets: Array<Asset>): Promise<boolean> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should add the asset metadata to the connector and return true if the asset\n * was added successfully.\n *\n * If the asset already exists it should throw an error.\n *\n * @emits assets\n * @param asset - The asset to add the metadata to the connection.\n * @throws Error if the asset already exists\n * @returns True if the asset was added successfully\n */\n async addAsset(_asset: Asset): Promise<boolean> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should return all the assets added to the connector. If a connection is already established.\n *\n * @returns Array of assets metadata from the connector vinculated to the all accounts from a specific Wallet.\n */\n async assets(): Promise<Array<Asset>> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should start the add network process and return true if the network was added successfully.\n *\n * @emits networks\n * @throws Error if the network already exists\n * @param networkUrl - The URL of the network to be added.\n * @returns Return true if the network was added successfully\n */\n async addNetwork(_networkUrl: string): Promise<boolean> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should start the select network process and return true if the network has change successfully.\n *\n * @emits networks\n * @throws Error if the network already exists\n * @param network - The network to be selected.\n * @returns Return true if the network was added successfully\n */\n async selectNetwork(_network: SelectNetworkArguments): Promise<boolean> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should return all the networks available from the connector. If the connection is already established.\n *\n * @returns Return all the networks added to the connector.\n */\n async networks(): Promise<Array<Network>> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should return the current network selected inside the connector. Even if the connection is not established.\n *\n * @returns Return the current network selected inside the connector.\n */\n async currentNetwork(): Promise<Network> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should add the ABI to the connector and return true if the ABI was added successfully.\n *\n * @param contractId - The contract id to add the ABI.\n * @param abi - The JSON ABI that represents a contract.\n * @returns Return true if the ABI was added successfully.\n */\n async addABI(_contractId: string, _abi: FuelABI): Promise<boolean> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should return the ABI from the connector vinculated to the all accounts from a specific Wallet.\n *\n * @param id - The contract id to get the ABI.\n * @returns The ABI if it exists, otherwise return null.\n */\n async getABI(_id: string): Promise<FuelABI | null> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Should return true if the abi exists in the connector vinculated to the all accounts from a specific Wallet.\n *\n * @param id - The contract id to get the abi\n * @returns Returns true if the abi exists or false if not.\n */\n async hasABI(_id: string): Promise<boolean> {\n throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, 'Method not implemented.');\n }\n\n /**\n * Event listener for the connector.\n *\n * @param eventName - The event name to listen\n * @param listener - The listener function\n */\n override on<E extends FuelConnectorEvents['type'], D extends FuelEventArg<E>>(\n eventName: E,\n listener: (data: D) => void\n ): this {\n super.on(eventName, listener);\n return this;\n }\n}\n","export enum FuelConnectorMethods {\n // General methods\n ping = 'ping',\n version = 'version',\n // Connection methods\n connect = 'connect',\n disconnect = 'disconnect',\n isConnected = 'isConnected',\n // Account methods\n accounts = 'accounts',\n currentAccount = 'currentAccount',\n // Signature methods\n signMessage = 'signMessage',\n sendTransaction = 'sendTransaction',\n // Assets metadata methods\n assets = 'assets',\n addAsset = 'addAsset',\n addAssets = 'addAssets',\n // Network methods\n networks = 'networks',\n currentNetwork = 'currentNetwork',\n addNetwork = 'addNetwork',\n selectNetwork = 'selectNetwork',\n // ABI methods\n addABI = 'addABI',\n getABI = 'getABI',\n hasABI = 'hasABI',\n}\n\nexport enum FuelConnectorEventTypes {\n connectors = 'connectors',\n currentConnector = 'currentConnector',\n connection = 'connection',\n accounts = 'accounts',\n currentAccount = 'currentAccount',\n networks = 'networks',\n currentNetwork = 'currentNetwork',\n assets = 'assets',\n abis = 'abis',\n}\n\nexport const FuelConnectorEventType = 'FuelConnector';\n","/* eslint-disable @typescript-eslint/require-await */\nimport type { StorageAbstract } from '../../wallet-manager';\n\nexport class LocalStorage implements StorageAbstract {\n private storage: Storage;\n\n constructor(localStorage: Storage) {\n this.storage = localStorage;\n }\n\n async setItem(key: string, value: string): Promise<void> {\n this.storage.setItem(key, value);\n }\n\n async getItem(key: string): Promise<string | null | undefined> {\n return this.storage.getItem(key);\n }\n\n async removeItem(key: string): Promise<void> {\n this.storage.removeItem(key);\n }\n\n async clear(): Promise<void> {\n this.storage.clear();\n }\n}\n","/* eslint-disable no-param-reassign */\n\nexport type CacheFor = {\n [key: string]: {\n timeout: number;\n value: unknown;\n } | null;\n};\n\ntype CacheForOptions = {\n key: string;\n cache: CacheFor;\n cacheTime: number;\n};\n\nexport function cacheFor<F extends (...args: unknown[]) => Promise<unknown>>(\n fn: F,\n { cache, cacheTime, key }: CacheForOptions\n): F {\n return (async (...args: unknown[]) => {\n if (cache[key] && cache[key]?.value) {\n return cache[key]?.value as ReturnType<F>;\n }\n clearTimeout(cache[key]?.timeout);\n const result = await fn(...args);\n\n // Create cache auto clean\n\n cache[key] = {\n timeout: Number(\n setTimeout(() => {\n cache[key] = null;\n }, cacheTime)\n ),\n value: result,\n };\n\n return result;\n }) as F;\n}\n","import type { FuelConnector } from '../fuel-connector';\nimport { FuelConnectorEventType } from '../types';\n\n/**\n * Fuel Connector Event is a custom event that can be used by the connector to\n * inform the Fuel Connector Manager that a new connector is available.\n */\nexport function dispatchFuelConnectorEvent(connector: FuelConnector) {\n window.dispatchEvent(\n new CustomEvent(FuelConnectorEventType, {\n detail: connector,\n })\n );\n}\n","import { FuelError } from '@fuel-ts/errors';\n\n// eslint-disable-next-line eslint-comments/disable-enable-pair\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport type DeferPromise<R = unknown> = {\n promise: Promise<R>;\n resolve: (value: R) => void;\n reject: (error: unknown) => void;\n};\n\nexport function deferPromise<R = unknown>() {\n const defer: DeferPromise<R> = {} as any;\n\n defer.promise = new Promise((resolve, reject) => {\n defer.reject = reject;\n defer.resolve = resolve;\n });\n\n return defer;\n}\n\n// eslint-disable-next-line @typescript-eslint/require-await\nexport async function withTimeout<F extends Promise<unknown>, RT = Awaited<F>>(\n promise: F,\n timeout: number = 1050\n): Promise<RT> {\n const timeoutPromise = new Promise((resolve, reject) => {\n setTimeout(() => {\n reject(new FuelError(FuelError.CODES.TIMEOUT_EXCEEDED, 'Promise timed out'));\n }, timeout);\n });\n return Promise.race([timeoutPromise, promise]) as any;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,IAAM,YAAY;AAAA,EACvB,KAAK;AAAA,IACH,SAAS;AAAA,IACT,SAAS;AAAA,IACT,SAAS;AAAA,EACX;AAAA,EACA,MAAM;AAAA,IACJ,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,SAAS;AAAA,EACX;AACF;;;ACGO,IAAM,oBAAoB,CAAC,gBAAkD;AAClF,MAAI,gBAAgB,YAAY;AAC9B,WAAO,UAAU,IAAI;AAAA,EACvB;AACA,MAAI,gBAAgB,QAAQ;AAC1B,WAAO,UAAU,KAAK;AAAA,EACxB;AAEA,SAAO;AACT;AAYO,IAAM,kBAAkB,CAAqC;AAAA,EAClE;AAAA,EACA;AAAA,EACA;AACF,MAAyD;AACvD,QAAM,UAAU,MAAM,SAAS;AAAA,IAC7B,CAAC,SAAS,KAAK,YAAY,WAAW,KAAK,SAAS;AAAA,EACtD;AAEA,SAAO;AACT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EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;;;AC//DO,IAAK,WAAL,kBAAKC,cAA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A,cAAoB;AAElB,SAAK,cAAc,IAAI,CAAC,UAAU,MAAM,CAAC;AACzC,SAAK,mBAAmB;AAExB,SAAK,mBAAmB;AAAA,EAC1B;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,QAAuB;AAC3B,UAAM,KAAK,UAAU,WAAW,MAAK,WAAW;AAAA,EAClD;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,UAAyB;AAC7B,SAAK,YAAY;AACjB,UAAM,KAAK,MAAM;AAAA,EACnB;AACF;AApaO,IAAM,OAAN;AACL,cADW,MACJ,eAAc;AACrB,cAFW,MAEJ,iBAA4B,CAAC;","names":["assets","UTXO_ID_LEN","Address","randomBytes","ErrorCode","FuelError","bn","InputType","arrayify","hexlify","isDefined","clone","Address","ErrorCode","FuelError","BN","bn","InputType","InputMessageCoder","TransactionCoder","arrayify","hexlify","DateTime","isDefined","gql","clone","ErrorCode","FuelError","FuelError","ErrorCode","ErrorCode","FuelError","hexlify","ErrorCode","FuelError","bn","hexlify","ZeroBytes32","ErrorCode","FuelError","bn","hexlify","UTXO_ID_LEN","ZeroBytes32","FuelError","bn","InputType","OutputType","hexlify","ZeroBytes32","ErrorCode","FuelError","bn","arrayify","hexlify","ZeroBytes32","bn","arrayify","hexlify","FuelError","ErrorCode","ErrorCode","FuelError","bn","ReceiptType","arrayify","hexlify","ErrorCode","FuelError","bn","ReceiptType","FAILED_TRANSFER_TO_ADDRESS_SIGNAL","ErrorCode","FuelError","bn","InputType","OutputType","cache","arrayify","hexlify","bn","ZeroBytes32","InputType","OutputType","hexlify","FuelError","UTXO_ID_LEN","clone","ZeroBytes32","bn","TransactionType","InputType","OutputType","TransactionCoder","concat","clone","clone","ZeroBytes32","bn","TransactionType","OutputType","arrayify","hexlify","clone","arrayify","hexlify","clone","TransactionType","hexlify","ZeroBytes32","bn","OutputType","arrayify","addressify","ZeroBytes32","bn","InputType","OutputType","TransactionType","arrayify","hexlify","clone","arrayify","clone","TransactionType","bn","arrayify","ZeroBytes32","hexlify","InputType","OutputType","addressify","FuelError","TransactionType","hexlify","clone","clone","TransactionType","hexlify","FuelError","ZeroBytes32","TransactionType","arrayify","hexlify","clone","clone","TransactionType","ZeroBytes32","hexlify","arrayify","ErrorCode","FuelError","TransactionType","TransactionType","FuelError","ErrorCode","request","ErrorCode","FuelError","bn","OutputType","TransactionCoder","arrayify","bn","PolicyType","hexlify","bn","PolicyType","TransactionCoder","TransactionType","arrayify","bn","arrayify","TransactionCoder","TransactionType","PolicyType","ZeroBytes32","ErrorCode","FuelError","bn","ReceiptType","TransactionType","Interface","ErrorCode","FuelError","InputType","OutputType","TransactionTypeName","TransactionStatus","OperationName","AddressType","ChainName","TransactionType","FuelError","ErrorCode","ReceiptType","bn","ZeroBytes32","ReceiptType","ReceiptType","ErrorCode","FuelError","bn","FuelError","ErrorCode","bn","hexlify","bn","PolicyType","Interface","ReceiptType","bn","OutputType","arrayify","TransactionCoder","sub","FuelError","ErrorCode","FuelError","ErrorCode","bn","isDefined","request","FuelError","document","gql","ErrorCode","hexlify","arrayify","BN","Address","clone","TransactionCoder","InputMessageCoder","DateTime","InputType","ErrorCode","FuelError","bn","TransactionCoder","arrayify","FuelError","ErrorCode","TransactionCoder","arrayify","bn","BigNumberCoder","Address","arrayify","concat","Address","FuelError","ErrorCode","request","bn","isCoin","requestToReestimate","clone","hexlify","arrayify","InputType","randomBytes","UTXO_ID_LEN","isDefined","hexlify","Address","randomBytes","hash","hexlify","concat","arrayify","Address","randomBytes","ErrorCode","FuelError","hexlify","hexlify","computeHmac","ErrorCode","FuelError","sha256","bn","toBytes","arrayify","hexlify","concat","dataSlice","encodeBase58","randomBytes","ErrorCode","FuelError","sha256","arrayify","hexlify","concat","Language","ErrorCode","FuelError","sha256","arrayify","FuelError","ErrorCode","hexlify","arrayify","concat","sha256","randomBytes","MainnetPRV","hexlify","TestnetPRV","encodeBase58","concat","dataSlice","sha256","FuelError","ErrorCode","arrayify","toBytes","computeHmac","bn","Address","ErrorCode","FuelError","Address","ErrorCode","FuelError","Address","FuelError","ErrorCode","Address","ErrorCode","FuelError","Address","FuelError","ErrorCode","FuelError","ErrorCode","Address","Vault","ErrorCode","FuelError","FuelError","ErrorCode","Interface","Address","ErrorCode","FuelError","arrayify","hexlify","FuelError","ErrorCode","bn","arrayify","BigNumberCoder","sha256","concat","asm","WORD_SIZE","numOfInstructions","instructionBytes","blobBytes","loaderBytecode","bn","FuelError","ErrorCode","arrayify","hash","hexlify","concat","arrayify","Address","arrayify","request","hexlify","Interface","FuelError","ErrorCode","ErrorCode","FuelError","FuelError","EventEmitter","FuelConnectorMethods","FuelConnectorEventTypes","EventEmitter","FuelError","cache","FuelError","FuelError","ErrorCode","networks"]}
|