@fuel-ts/account .Provider
A provider for connecting to a node
• Optional
cache: MemoryCache
packages/account/src/providers/provider.ts:348
• operations: Object
Name | Type |
---|---|
dryRun | (variables : Exact <{ encodedTransactions : string | string [] ; utxoValidation? : InputMaybe <boolean > }>, options? : unknown ) => Promise <GqlDryRunMutation > |
estimateGasPrice | (variables : Exact <{ blockHorizon : string }>, options? : unknown ) => Promise <GqlEstimateGasPriceQuery > |
estimatePredicates | (variables : Exact <{ encodedTransaction : string }>, options? : unknown ) => Promise <GqlEstimatePredicatesQuery > |
getBalance | (variables : Exact <{ assetId : string ; owner : string }>, options? : unknown ) => Promise <GqlGetBalanceQuery > |
getBalances | (variables : Exact <{ after? : InputMaybe <string > ; before? : InputMaybe <string > ; filter : GqlBalanceFilterInput ; first? : InputMaybe <number > ; last? : InputMaybe <number > }>, options? : unknown ) => Promise <GqlGetBalancesQuery > |
getBlock | (variables? : Exact <{ blockId? : InputMaybe <string > ; height? : InputMaybe <string > }>, options? : unknown ) => Promise <GqlGetBlockQuery > |
getBlockWithTransactions | (variables? : Exact <{ blockHeight? : InputMaybe <string > ; blockId? : InputMaybe <string > }>, options? : unknown ) => Promise <GqlGetBlockWithTransactionsQuery > |
getBlocks | (variables? : Exact <{ after? : InputMaybe <string > ; before? : InputMaybe <string > ; first? : InputMaybe <number > ; last? : InputMaybe <number > }>, options? : unknown ) => Promise <GqlGetBlocksQuery > |
getChain | (variables? : Exact <{ [key: string] : never ; }>, options? : unknown ) => Promise <GqlGetChainQuery > |
getCoin | (variables : Exact <{ coinId : string }>, options? : unknown ) => Promise <GqlGetCoinQuery > |
getCoins | (variables : Exact <{ after? : InputMaybe <string > ; before? : InputMaybe <string > ; filter : GqlCoinFilterInput ; first? : InputMaybe <number > ; last? : InputMaybe <number > }>, options? : unknown ) => Promise <GqlGetCoinsQuery > |
getCoinsToSpend | (variables : Exact <{ excludedIds? : InputMaybe <GqlExcludeInput > ; owner : string ; queryPerAsset : GqlSpendQueryElementInput | GqlSpendQueryElementInput [] }>, options? : unknown ) => Promise <GqlGetCoinsToSpendQuery > |
getContract | (variables : Exact <{ contractId : string }>, options? : unknown ) => Promise <GqlGetContractQuery > |
getContractBalance | (variables : Exact <{ asset : string ; contract : string }>, options? : unknown ) => Promise <GqlGetContractBalanceQuery > |
getLatestGasPrice | (variables? : Exact <{ [key: string] : never ; }>, options? : unknown ) => Promise <GqlGetLatestGasPriceQuery > |
getMessageByNonce | (variables : Exact <{ nonce : string }>, options? : unknown ) => Promise <GqlGetMessageByNonceQuery > |
getMessageProof | (variables : Exact <{ commitBlockHeight? : InputMaybe <string > ; commitBlockId? : InputMaybe <string > ; nonce : string ; transactionId : string }>, options? : unknown ) => Promise <GqlGetMessageProofQuery > |
getMessageStatus | (variables : Exact <{ nonce : string }>, options? : unknown ) => Promise <GqlGetMessageStatusQuery > |
getMessages | (variables : Exact <{ after? : InputMaybe <string > ; before? : InputMaybe <string > ; first? : InputMaybe <number > ; last? : InputMaybe <number > ; owner : string }>, options? : unknown ) => Promise <GqlGetMessagesQuery > |
getNodeInfo | (variables? : Exact <{ [key: string] : never ; }>, options? : unknown ) => Promise <GqlGetNodeInfoQuery > |
getRelayedTransactionStatus | (variables : Exact <{ relayedTransactionId : string }>, options? : unknown ) => Promise <GqlGetRelayedTransactionStatusQuery > |
getTransaction | (variables : Exact <{ transactionId : string }>, options? : unknown ) => Promise <GqlGetTransactionQuery > |
getTransactionWithReceipts | (variables : Exact <{ transactionId : string }>, options? : unknown ) => Promise <GqlGetTransactionWithReceiptsQuery > |
getTransactions | (variables? : Exact <{ after? : InputMaybe <string > ; before? : InputMaybe <string > ; first? : InputMaybe <number > ; last? : InputMaybe <number > }>, options? : unknown ) => Promise <GqlGetTransactionsQuery > |
getTransactionsByOwner | (variables : Exact <{ after? : InputMaybe <string > ; before? : InputMaybe <string > ; first? : InputMaybe <number > ; last? : InputMaybe <number > ; owner : string }>, options? : unknown ) => Promise <GqlGetTransactionsByOwnerQuery > |
getVersion | (variables? : Exact <{ [key: string] : never ; }>, options? : unknown ) => Promise <GqlGetVersionQuery > |
produceBlocks | (variables : Exact <{ blocksToProduce : string ; startTimestamp? : InputMaybe <string > }>, options? : unknown ) => Promise <GqlProduceBlocksMutation > |
statusChange | (variables : Exact <{ transactionId : string }>, options? : unknown ) => AsyncIterable <GqlStatusChangeSubscription > |
submit | (variables : Exact <{ encodedTransaction : string }>, options? : unknown ) => Promise <GqlSubmitMutation > |
submitAndAwait | (variables : Exact <{ encodedTransaction : string }>, options? : unknown ) => AsyncIterable <GqlSubmitAndAwaitSubscription > |
packages/account/src/providers/provider.ts:347
• options: ProviderOptions
packages/account/src/providers/provider.ts:358
• url: string
GraphQL endpoint of the Fuel node
packages/account/src/providers/provider.ts:393
▪ Private
Static
chainInfoCache: ChainInfoCache
= {}
packages/account/src/providers/provider.ts:355
▪ Private
Static
nodeInfoCache: NodeInfoCache
= {}
packages/account/src/providers/provider.ts:356
▸ call(transactionRequestLike
, utxoValidation?
): Promise
<CallResult
>
Executes a transaction without actually submitting it to the chain.
If the transaction is missing any dependencies, the transaction will be mutated and those dependencies will be added.
Name | Type | Description |
---|---|---|
transactionRequestLike | TransactionRequestLike | The transaction request object. |
utxoValidation | ProviderCallParams | Additional provider call parameters. |
Promise
<CallResult
>
A promise that resolves to the call result object.
packages/account/src/providers/provider.ts:709
▸ connect(url
, options?
): Promise
<void
>
Updates the URL for the provider and fetches the consensus parameters for the new URL, if needed.
Name | Type |
---|---|
url | string |
options? | ProviderOptions |
Promise
<void
>
packages/account/src/providers/provider.ts:464
▸ createOperations(): Object
Create GraphQL client and set operations.
Object
The operation SDK object
Name | Type |
---|---|
dryRun | (variables : Exact <{ encodedTransactions : string | string [] ; utxoValidation? : InputMaybe <boolean > }>, options? : unknown ) => Promise <GqlDryRunMutation > |
estimateGasPrice | (variables : Exact <{ blockHorizon : string }>, options? : unknown ) => Promise <GqlEstimateGasPriceQuery > |
estimatePredicates | (variables : Exact <{ encodedTransaction : string }>, options? : unknown ) => Promise <GqlEstimatePredicatesQuery > |
getBalance | (variables : Exact <{ assetId : string ; owner : string }>, options? : unknown ) => Promise <GqlGetBalanceQuery > |
getBalances | (variables : Exact <{ after? : InputMaybe <string > ; before? : InputMaybe <string > ; filter : GqlBalanceFilterInput ; first? : InputMaybe <number > ; last? : InputMaybe <number > }>, options? : unknown ) => Promise <GqlGetBalancesQuery > |
getBlock | (variables? : Exact <{ blockId? : InputMaybe <string > ; height? : InputMaybe <string > }>, options? : unknown ) => Promise <GqlGetBlockQuery > |
getBlockWithTransactions | (variables? : Exact <{ blockHeight? : InputMaybe <string > ; blockId? : InputMaybe <string > }>, options? : unknown ) => Promise <GqlGetBlockWithTransactionsQuery > |
getBlocks | (variables? : Exact <{ after? : InputMaybe <string > ; before? : InputMaybe <string > ; first? : InputMaybe <number > ; last? : InputMaybe <number > }>, options? : unknown ) => Promise <GqlGetBlocksQuery > |
getChain | (variables? : Exact <{ [key: string] : never ; }>, options? : unknown ) => Promise <GqlGetChainQuery > |
getCoin | (variables : Exact <{ coinId : string }>, options? : unknown ) => Promise <GqlGetCoinQuery > |
getCoins | (variables : Exact <{ after? : InputMaybe <string > ; before? : InputMaybe <string > ; filter : GqlCoinFilterInput ; first? : InputMaybe <number > ; last? : InputMaybe <number > }>, options? : unknown ) => Promise <GqlGetCoinsQuery > |
getCoinsToSpend | (variables : Exact <{ excludedIds? : InputMaybe <GqlExcludeInput > ; owner : string ; queryPerAsset : GqlSpendQueryElementInput | GqlSpendQueryElementInput [] }>, options? : unknown ) => Promise <GqlGetCoinsToSpendQuery > |
getContract | (variables : Exact <{ contractId : string }>, options? : unknown ) => Promise <GqlGetContractQuery > |
getContractBalance | (variables : Exact <{ asset : string ; contract : string }>, options? : unknown ) => Promise <GqlGetContractBalanceQuery > |
getLatestGasPrice | (variables? : Exact <{ [key: string] : never ; }>, options? : unknown ) => Promise <GqlGetLatestGasPriceQuery > |
getMessageByNonce | (variables : Exact <{ nonce : string }>, options? : unknown ) => Promise <GqlGetMessageByNonceQuery > |
getMessageProof | (variables : Exact <{ commitBlockHeight? : InputMaybe <string > ; commitBlockId? : InputMaybe <string > ; nonce : string ; transactionId : string }>, options? : unknown ) => Promise <GqlGetMessageProofQuery > |
getMessageStatus | (variables : Exact <{ nonce : string }>, options? : unknown ) => Promise <GqlGetMessageStatusQuery > |
getMessages | (variables : Exact <{ after? : InputMaybe <string > ; before? : InputMaybe <string > ; first? : InputMaybe <number > ; last? : InputMaybe <number > ; owner : string }>, options? : unknown ) => Promise <GqlGetMessagesQuery > |
getNodeInfo | (variables? : Exact <{ [key: string] : never ; }>, options? : unknown ) => Promise <GqlGetNodeInfoQuery > |
getRelayedTransactionStatus | (variables : Exact <{ relayedTransactionId : string }>, options? : unknown ) => Promise <GqlGetRelayedTransactionStatusQuery > |
getTransaction | (variables : Exact <{ transactionId : string }>, options? : unknown ) => Promise <GqlGetTransactionQuery > |
getTransactionWithReceipts | (variables : Exact <{ transactionId : string }>, options? : unknown ) => Promise <GqlGetTransactionWithReceiptsQuery > |
getTransactions | (variables? : Exact <{ after? : InputMaybe <string > ; before? : InputMaybe <string > ; first? : InputMaybe <number > ; last? : InputMaybe <number > }>, options? : unknown ) => Promise <GqlGetTransactionsQuery > |
getTransactionsByOwner | (variables : Exact <{ after? : InputMaybe <string > ; before? : InputMaybe <string > ; first? : InputMaybe <number > ; last? : InputMaybe <number > ; owner : string }>, options? : unknown ) => Promise <GqlGetTransactionsByOwnerQuery > |
getVersion | (variables? : Exact <{ [key: string] : never ; }>, options? : unknown ) => Promise <GqlGetVersionQuery > |
produceBlocks | (variables : Exact <{ blocksToProduce : string ; startTimestamp? : InputMaybe <string > }>, options? : unknown ) => Promise <GqlProduceBlocksMutation > |
statusChange | (variables : Exact <{ transactionId : string }>, options? : unknown ) => AsyncIterable <GqlStatusChangeSubscription > |
submit | (variables : Exact <{ encodedTransaction : string }>, options? : unknown ) => Promise <GqlSubmitMutation > |
submitAndAwait | (variables : Exact <{ encodedTransaction : string }>, options? : unknown ) => AsyncIterable <GqlSubmitAndAwaitSubscription > |
packages/account/src/providers/provider.ts:508
▸ dryRunMultipleTransactions(transactionRequests
, «destructured»?
): Promise
<CallResult
[]>
Name | Type |
---|---|
transactionRequests | TransactionRequest [] |
«destructured» | ProviderCallParams |
Promise
<CallResult
[]>
packages/account/src/providers/provider.ts:922
▸ estimateGasPrice(blockHorizon
): Promise
<BN
>
Name | Type |
---|---|
blockHorizon | number |
Promise
<BN
>
packages/account/src/providers/provider.ts:1649
▸ estimateMultipleTxDependencies(transactionRequests
): Promise
<EstimateTxDependenciesReturns
[]>
Dry runs multiple transactions and checks for missing dependencies in batches.
Transactions are dry run in batches. After each dry run, transactions requiring further modifications are identified. The method iteratively updates these transactions and performs subsequent dry runs until all dependencies for each transaction are satisfied.
Name | Type | Description |
---|---|---|
transactionRequests | TransactionRequest [] | Array of transaction request objects. |
Promise
<EstimateTxDependenciesReturns
[]>
A promise that resolves to an array of results for each transaction.
packages/account/src/providers/provider.ts:849
▸ estimatePredicates<T
>(transactionRequest
): Promise
<T
>
Verifies whether enough gas is available to complete transaction.
Name | Type |
---|---|
T | extends TransactionRequest |
Name | Type | Description |
---|---|---|
transactionRequest | T | The transaction request object. |
Promise
<T
>
A promise that resolves to the estimated transaction request object.
packages/account/src/providers/provider.ts:734
▸ estimateTxDependencies(transactionRequest
): Promise
<EstimateTxDependenciesReturns
>
Will dryRun a transaction and check for missing dependencies.
If there are missing variable outputs,
addVariableOutputs
is called on the transaction.
Name | Type | Description |
---|---|---|
transactionRequest | TransactionRequest | The transaction request object. |
Promise
<EstimateTxDependenciesReturns
>
A promise.
packages/account/src/providers/provider.ts:779
▸ estimateTxGasAndFee(params
): Promise
<{ gasLimit
: BN
; gasPrice
: BN
; maxFee
: BN
; maxGas
: BN
; minFee
: BN
; minGas
: BN
}>
Estimates the transaction gas and fee based on the provided transaction request.
Name | Type |
---|---|
params | Object |
params.gasPrice? | BN |
params.transactionRequest | TransactionRequest |
Promise
<{ gasLimit
: BN
; gasPrice
: BN
; maxFee
: BN
; maxGas
: BN
; minFee
: BN
; minGas
: BN
}>
An object containing the estimated minimum gas, minimum fee, maximum gas, and maximum fee.
packages/account/src/providers/provider.ts:948
▸ extractDryRunError(transactionRequest
, receipts
, dryRunStatus
): FuelError
Name | Type |
---|---|
transactionRequest | ScriptTransactionRequest |
receipts | TransactionResultReceipt [] |
dryRunStatus | DryRunStatus |
FuelError
packages/account/src/providers/provider.ts:1720
▸ fetchChain(): Promise
<ChainInfo
>
Fetches the chainInfo
for the given node URL.
Promise
<ChainInfo
>
ChainInfo object
packages/account/src/providers/provider.ts:594
▸ fetchChainAndNodeInfo(): Promise
<{ chain
: ChainInfo
; nodeInfo
: NodeInfo
}>
Fetches both the chain and node information, saves it to the cache, and return it.
Promise
<{ chain
: ChainInfo
; nodeInfo
: NodeInfo
}>
NodeInfo and Chain
packages/account/src/providers/provider.ts:476
▸ fetchNode(): Promise
<NodeInfo
>
Returns the chain information.
Promise
<NodeInfo
>
NodeInfo object
packages/account/src/providers/provider.ts:573
▸ getBalance(owner
, assetId
): Promise
<BN
>
Returns the balance for the given owner for the given asset ID.
Name | Type | Description |
---|---|---|
owner | string | AbstractAddress | The address to get coins for. |
assetId | BytesLike | The asset ID of coins to get. |
Promise
<BN
>
A promise that resolves to the balance.
packages/account/src/providers/provider.ts:1451
▸ getBalances(owner
, paginationArgs?
): Promise
<CoinQuantity
[]>
Returns balances for the given owner.
Name | Type | Description |
---|---|---|
owner | string | AbstractAddress | The address to get coins for. |
paginationArgs? | CursorPaginationArgs | Pagination arguments. |
Promise
<CoinQuantity
[]>
A promise that resolves to the balances.
packages/account/src/providers/provider.ts:1471
▸ getBaseAssetId(): string
Returns the base asset ID for the current provider network
string
the base asset ID
packages/account/src/providers/provider.ts:620
▸ getBlock(idOrHeight
): Promise
<null
| Block
>
Returns block matching the given ID or height.
Name | Type | Description |
---|---|---|
idOrHeight | string | number | ID or height of the block. |
Promise
<null
| Block
>
A promise that resolves to the block.
packages/account/src/providers/provider.ts:1307
▸ getBlockNumber(): Promise
<BN
>
Returns the block number.
Promise
<BN
>
A promise that resolves to the block number
packages/account/src/providers/provider.ts:563
▸ getBlockWithTransactions(idOrHeight
): Promise
<null
| Block
& { transactions
: Partial
<Omit
<TransactionScript
, "type"
>> & Partial
<Omit
<TransactionCreate
, "type"
>> & Partial
<Omit
<TransactionMint
, "type"
>> & Partial
<Omit
<TransactionUpgrade
, "type"
>> & Partial
<Omit
<TransactionUpload
, "type"
>> & { type
: TransactionType
}[] }>
Returns block matching the given ID or type, including transaction data.
Name | Type | Description |
---|---|---|
idOrHeight | string | number | ID or height of the block. |
Promise
<null
| Block
& { transactions
: Partial
<Omit
<TransactionScript
, "type"
>> & Partial
<Omit
<TransactionCreate
, "type"
>> & Partial
<Omit
<TransactionMint
, "type"
>> & Partial
<Omit
<TransactionUpgrade
, "type"
>> & Partial
<Omit
<TransactionUpload
, "type"
>> & { type
: TransactionType
}[] }>
A promise that resolves to the block.
packages/account/src/providers/provider.ts:1361
▸ getBlocks(params
): Promise
<Block
[]>
Returns all the blocks matching the given parameters.
Name | Type | Description |
---|---|---|
params | Exact <{ after? : InputMaybe <string > ; before? : InputMaybe <string > ; first? : InputMaybe <number > ; last? : InputMaybe <number > }> | The parameters to query blocks. |
Promise
<Block
[]>
A promise that resolves to the blocks.
packages/account/src/providers/provider.ts:1342
▸ getChain(): ChainInfo
Returns the cached chainInfo for the current URL.
packages/account/src/providers/provider.ts:417
▸ getChainId(): number
Returns the chain ID
number
A promise that resolves to the chain ID number
packages/account/src/providers/provider.ts:608
▸ getCoins(owner
, assetId?
, paginationArgs?
): Promise
<Coin
[]>
Returns coins for the given owner.
Name | Type | Description |
---|---|---|
owner | string | AbstractAddress | The address to get coins for |
assetId? | BytesLike | The asset ID of coins to get |
paginationArgs? | CursorPaginationArgs | Pagination arguments |
Promise
<Coin
[]>
packages/account/src/providers/provider.ts:1201
▸ getContract(contractId
): Promise
<null
| ContractResult
>
Get deployed contract with the given ID.
Name | Type | Description |
---|---|---|
contractId | string | ID of the contract. |
Promise
<null
| ContractResult
>
A promise that resolves to the contract.
packages/account/src/providers/provider.ts:1416
▸ getContractBalance(contractId
, assetId
): Promise
<BN
>
Returns the balance for the given contract for the given asset ID.
Name | Type | Description |
---|---|---|
contractId | string | AbstractAddress | The contract ID to get the balance for. |
assetId | BytesLike | The asset ID of coins to get. |
Promise
<BN
>
A promise that resolves to the balance.
packages/account/src/providers/provider.ts:1431
▸ getGasConfig(): Object
Returns some helpful parameters related to gas fees.
Object
Name | Type |
---|---|
gasCosts | GasCosts |
gasPerByte | BN |
gasPriceFactor | BN |
maxGasPerPredicate | BN |
maxGasPerTx | BN |
packages/account/src/providers/provider.ts:445
▸ getLatestGasPrice(): Promise
<BN
>
Promise
<BN
>
packages/account/src/providers/provider.ts:1644
▸ getMessageByNonce(nonce
): Promise
<null
| GqlMessage
>
Returns Message for given nonce.
Name | Type | Description |
---|---|---|
nonce | string | The nonce of the message to retrieve. |
Promise
<null
| GqlMessage
>
A promise that resolves to the Message object.
packages/account/src/providers/provider.ts:1696
▸ getMessageProof(transactionId
, nonce
, commitBlockId?
, commitBlockHeight?
): Promise
<null
| MessageProof
>
Returns Message Proof for given transaction id and the message id from MessageOut receipt.
Name | Type | Description |
---|---|---|
transactionId | string | The transaction to get message from. |
nonce | string | - |
commitBlockId? | string | The commit block id. |
commitBlockHeight? | BN | The commit block height. |
Promise
<null
| MessageProof
>
A promise that resolves to the message proof.
packages/account/src/providers/provider.ts:1538
▸ getMessageStatus(nonce
): Promise
<MessageStatus
>
Returns Message Proof for given transaction id and the message id from MessageOut receipt.
Name | Type | Description |
---|---|---|
nonce | string | The nonce of the message to get status from. |
Promise
<MessageStatus
>
A promise that resolves to the message status
packages/account/src/providers/provider.ts:1662
▸ getMessages(address
, paginationArgs?
): Promise
<Message
[]>
Returns message for the given address.
Name | Type | Description |
---|---|---|
address | string | AbstractAddress | The address to get message from. |
paginationArgs? | CursorPaginationArgs | Pagination arguments. |
Promise
<Message
[]>
A promise that resolves to the messages.
packages/account/src/providers/provider.ts:1498
▸ getNode(): NodeInfo
Returns the cached nodeInfo for the current URL.
packages/account/src/providers/provider.ts:431
▸ getRelayedTransactionStatus(relayedTransactionId
): Promise
<null
| GqlRelayedTransactionFailed
>
Name | Type |
---|---|
relayedTransactionId | string |
Promise
<null
| GqlRelayedTransactionFailed
>
packages/account/src/providers/provider.ts:1706
▸ getResourcesForTransaction(owner
, transactionRequestLike
, quantitiesToContract?
): Promise
<{ addedSignatures
: number
; dryRunStatus?
: DryRunStatus
; estimatedPredicates
: TransactionRequestInput
[] ; gasPrice
: BN
; gasUsed
: BN
; maxFee
: BN
; maxGas
: BN
; minFee
: BN
; minGas
: BN
; missingContractIds
: string
[] ; outputVariables
: number
; receipts
: TransactionResultReceipt
[] ; requiredQuantities
: CoinQuantity
[] ; resources
: Resource
[] ; updateMaxFee?
: boolean
}>
Name | Type | Default value |
---|---|---|
owner | string | AbstractAddress | undefined |
transactionRequestLike | TransactionRequestLike | undefined |
quantitiesToContract | CoinQuantity [] | [] |
Promise
<{ addedSignatures
: number
; dryRunStatus?
: DryRunStatus
; estimatedPredicates
: TransactionRequestInput
[] ; gasPrice
: BN
; gasUsed
: BN
; maxFee
: BN
; maxGas
: BN
; minFee
: BN
; minGas
: BN
; missingContractIds
: string
[] ; outputVariables
: number
; receipts
: TransactionResultReceipt
[] ; requiredQuantities
: CoinQuantity
[] ; resources
: Resource
[] ; updateMaxFee?
: boolean
}>
packages/account/src/providers/provider.ts:1165
▸ getResourcesToSpend(owner
, quantities
, excludedIds?
): Promise
<Resource
[]>
Returns resources for the given owner satisfying the spend query.
Name | Type | Description |
---|---|---|
owner | string | AbstractAddress | The address to get resources for. |
quantities | CoinQuantityLike [] | The quantities to get. |
excludedIds? | ExcludeResourcesOption | IDs of excluded resources from the selection. |
Promise
<Resource
[]>
A promise that resolves to the resources.
packages/account/src/providers/provider.ts:1236
▸ getTransaction<TTransactionType
>(transactionId
): Promise
<null
| Transaction
<TTransactionType
>>
Get transaction with the given ID.
Name | Type |
---|---|
TTransactionType | void |
Name | Type | Description |
---|---|---|
transactionId | string | ID of the transaction. |
Promise
<null
| Transaction
<TTransactionType
>>
A promise that resolves to the transaction.
packages/account/src/providers/provider.ts:1397
▸ getTransactionCost(transactionRequestLike
, tolerance?
): Promise
<TransactionCost
>
Returns a transaction cost to enable user to set gasLimit and also reserve balance amounts on the the transaction.
Name | Type | Description |
---|---|---|
transactionRequestLike | TransactionRequestLike | The transaction request object. |
tolerance | TransactionCostParams | The tolerance to add on top of the gasUsed. |
Promise
<TransactionCost
>
A promise that resolves to the transaction cost object.
packages/account/src/providers/provider.ts:1064
▸ getTransactionResponse(transactionId
): Promise
<TransactionResponse
>
Name | Type |
---|---|
transactionId | string |
Promise
<TransactionResponse
>
packages/account/src/providers/provider.ts:1686
▸ getVersion(): Promise
<string
>
Returns the version of the connected node.
Promise
<string
>
A promise that resolves to the version string.
packages/account/src/providers/provider.ts:551
▸ produceBlocks(amount
, startTime?
): Promise
<BN
>
Lets you produce blocks with custom timestamps and the block number of the last block produced.
Name | Type | Description |
---|---|---|
amount | number | The amount of blocks to produce |
startTime? | number | The UNIX timestamp (milliseconds) to set for the first produced block |
Promise
<BN
>
A promise that resolves to the block number of the last produced block.
packages/account/src/providers/provider.ts:1677
▸ sendTransaction(transactionRequestLike
, «destructured»?
): Promise
<TransactionResponse
>
Submits a transaction to the chain to be executed.
If the transaction is missing any dependencies, the transaction will be mutated and those dependencies will be added.
Name | Type | Description |
---|---|---|
transactionRequestLike | TransactionRequestLike | The transaction request object. |
«destructured» | ProviderSendTxParams | - |
Promise
<TransactionResponse
>
A promise that resolves to the transaction response object.
packages/account/src/providers/provider.ts:652
▸ simulate(transactionRequestLike
, «destructured»?
): Promise
<CallResult
>
Executes a signed transaction without applying the states changes on the chain.
If the transaction is missing any dependencies, the transaction will be mutated and those dependencies will be added
Name | Type | Description |
---|---|---|
transactionRequestLike | TransactionRequestLike | The transaction request object. |
«destructured» | EstimateTransactionParams | - |
Promise
<CallResult
>
A promise that resolves to the call result object.
packages/account/src/providers/provider.ts:1023
▸ clearChainAndNodeCaches(): void
void
packages/account/src/providers/provider.ts:350
▸ create(url
, options?
): Promise
<Provider
>
Creates a new instance of the Provider class. This is the recommended way to initialize a Provider.
Name | Type | Description |
---|---|---|
url | string | GraphQL endpoint of the Fuel node |
options | ProviderOptions | Additional options for the provider |
Promise
<Provider
>
packages/account/src/providers/provider.ts:408
▸ ensureClientVersionIsSupported(nodeInfo
): void
Name | Type |
---|---|
nodeInfo | NodeInfo |
void
packages/account/src/providers/provider.ts:488
▸ getFetchFn(options
): (url
: string
, requestInit?
: RequestInit
, providerOptions?
: Omit
<ProviderOptions
, "fetch"
>) => Promise
<Response
>
Name | Type |
---|---|
options | ProviderOptions |
fn
▸ (url
, requestInit?
, providerOptions?
): Promise
<Response
>
Custom fetch function to use for making requests.
Name | Type |
---|---|
url | string |
requestInit? | RequestInit |
providerOptions? | Omit <ProviderOptions , "fetch" > |
Promise
<Response
>