@fuel-ts/program v0.94.9 • Docs
Represents a scope for invoking multiple calls.
BaseInvocationScope
<TReturn
> • TReturn = any
The type of the return value.
new MultiCallInvocationScope<
TReturn
>(contract
,funcScopes
):MultiCallInvocationScope
<TReturn
>
Constructs an instance of MultiCallInvocationScope.
• contract: AbstractContract
The contract.
• funcScopes: FunctionInvocationScope
<any
[], any
>[]
An array of function invocation scopes.
MultiCallInvocationScope
<TReturn
>
BaseInvocationScope<TReturn>.constructor
functions/multicall-scope.ts:19
protected
externalAbis:Record
<string
,JsonAbi
> ={}
BaseInvocationScope.externalAbis
functions/base-invocation-scope.ts:67
protected
functionInvocationScopes:InvocationScopeLike
[] =[]
BaseInvocationScope.functionInvocationScopes
functions/base-invocation-scope.ts:62
protected
hasCallParamsGasLimit:boolean
=false
BaseInvocationScope.hasCallParamsGasLimit
functions/base-invocation-scope.ts:66
protected
isMultiCall:boolean
=false
BaseInvocationScope.isMultiCall
functions/base-invocation-scope.ts:65
protected
program:AbstractProgram
BaseInvocationScope.program
functions/base-invocation-scope.ts:61
protected
requiredCoins:CoinQuantity
[] =[]
BaseInvocationScope.requiredCoins
functions/base-invocation-scope.ts:64
protected
transactionRequest:ScriptTransactionRequest
BaseInvocationScope.transactionRequest
functions/base-invocation-scope.ts:60
protected
optional
txParameters:Partial
<object
>
gasLimit:
BigNumberish
optional
maturity:number
optional
maxFee:BigNumberish
tip:
BigNumberish
variableOutputs:
number
optional
witnessLimit:BigNumberish
BaseInvocationScope.txParameters
functions/base-invocation-scope.ts:63
get
protected
calls():ContractCall
[]
Getter for the contract calls.
ContractCall
[]
An array of contract calls.
BaseInvocationScope.calls
functions/base-invocation-scope.ts:89
addBatchTransfer(
transferParams
):MultiCallInvocationScope
<TReturn
>
Adds multiple transfers to the contract call transaction request.
• transferParams: TransferParams
[]
An array of TransferParams
objects representing the transfers to be made.
MultiCallInvocationScope
<TReturn
>
The current instance of the class.
BaseInvocationScope.addBatchTransfer
functions/base-invocation-scope.ts:337
addCall(
funcScope
):MultiCallInvocationScope
<TReturn
>
Adds a single function invocation scope to the multi-call invocation scope.
• funcScope: FunctionInvocationScope
<any
[], any
>
The function invocation scope.
MultiCallInvocationScope
<TReturn
>
The instance of MultiCallInvocationScope.
BaseInvocationScope.addCall
functions/multicall-scope.ts:30
addCalls(
funcScopes
):MultiCallInvocationScope
<TReturn
>
Adds multiple function invocation scopes to the multi-call invocation scope.
• funcScopes: FunctionInvocationScope
<any
[], any
>[]
An array of function invocation scopes.
MultiCallInvocationScope
<TReturn
>
The instance of MultiCallInvocationScope.
BaseInvocationScope.addCalls
functions/multicall-scope.ts:40
addContracts(
contracts
):MultiCallInvocationScope
<TReturn
>
Adds contracts to the invocation scope.
• contracts: AbstractContract
[]
An array of contracts to add.
MultiCallInvocationScope
<TReturn
>
The current instance of the class.
BaseInvocationScope.addContracts
functions/base-invocation-scope.ts:305
addSigners(
signers
):MultiCallInvocationScope
<TReturn
>
• signers: Account
| Account
[]
MultiCallInvocationScope
<TReturn
>
BaseInvocationScope.addSigners
functions/base-invocation-scope.ts:350
addTransfer(
transferParams
):MultiCallInvocationScope
<TReturn
>
Adds an asset transfer to an Account on the contract call transaction request.
• transferParams: TransferParams
The object representing the transfer to be made.
MultiCallInvocationScope
<TReturn
>
The current instance of the class.
BaseInvocationScope.addTransfer
functions/base-invocation-scope.ts:319
call<
T
>():Promise
<object
>
Submits the contract call transaction and returns a promise that resolves to an object containing the transaction ID and a function to wait for the result. The promise will resolve as soon as the transaction is submitted to the node.
• T = TReturn
The type of the return value.
Promise
<object
>
A promise that resolves to an object containing:
transactionId
: The ID of the submitted transaction. waitForResult
: A function that waits for the transaction result. transactionId:
string
waitForResult: () =>
Promise
<FunctionResult
<T
>>
Promise
<FunctionResult
<T
>>
BaseInvocationScope.call
functions/base-invocation-scope.ts:377
protected
checkGasLimitTotal():void
Checks if the total gas limit is within the acceptable range.
void
BaseInvocationScope.checkGasLimitTotal
functions/base-invocation-scope.ts:218
dryRun<
T
>():Promise
<DryRunResult
<T
>>
Executes a transaction in dry run mode.
• T = TReturn
Promise
<DryRunResult
<T
>>
The result of the invocation call.
BaseInvocationScope.dryRun
functions/base-invocation-scope.ts:435
fundWithRequiredCoins():
Promise
<ScriptTransactionRequest
>
Funds the transaction with the required coins.
Promise
<ScriptTransactionRequest
>
The current instance of the class.
BaseInvocationScope.fundWithRequiredCoins
functions/base-invocation-scope.ts:252
get<
T
>():Promise
<DryRunResult
<T
>>
• T = TReturn
Promise
<DryRunResult
<T
>>
BaseInvocationScope.get
functions/base-invocation-scope.ts:449
getProvider():
Provider
BaseInvocationScope.getProvider
functions/base-invocation-scope.ts:463
protected
getRequiredCoins():CoinQuantity
[]
Gets the required coins for the transaction.
CoinQuantity
[]
An array of required coin quantities.
BaseInvocationScope.getRequiredCoins
functions/base-invocation-scope.ts:138
getTransactionCost():
Promise
<TransactionCost
>
Gets the transaction cost for dry running the transaction.
Promise
<TransactionCost
>
The transaction cost details.
BaseInvocationScope.getTransactionCost
functions/base-invocation-scope.ts:237
getTransactionId(
chainId
?):Promise
<string
>
Obtains the ID of a transaction.
• chainId?: number
the chainId to use to hash the transaction with
Promise
<string
>
the ID of the transaction.
BaseInvocationScope.getTransactionId
functions/base-invocation-scope.ts:475
getTransactionRequest():
Promise
<ScriptTransactionRequest
>
Prepares and returns the transaction request object.
Promise
<ScriptTransactionRequest
>
The prepared transaction request.
BaseInvocationScope.getTransactionRequest
functions/base-invocation-scope.ts:362
protected
prepareTransaction():Promise
<void
>
Prepares the transaction by updating the script request, required coins, and checking the gas limit.
Promise
<void
>
BaseInvocationScope.prepareTransaction
functions/base-invocation-scope.ts:196
simulate<
T
>():Promise
<DryRunResult
<T
>>
Simulates a transaction.
• T = TReturn
Promise
<DryRunResult
<T
>>
The result of the invocation call.
BaseInvocationScope.simulate
functions/base-invocation-scope.ts:408
txParams(
txParams
):MultiCallInvocationScope
<TReturn
>
Sets the transaction parameters.
• txParams: Partial
<object
>
The transaction parameters to set.
MultiCallInvocationScope
<TReturn
>
The current instance of the class.
BaseInvocationScope.txParams
functions/base-invocation-scope.ts:284
protected
updateContractInputAndOutput():void
Updates the transaction request with the current input/output.
void
BaseInvocationScope.updateContractInputAndOutput
functions/base-invocation-scope.ts:119
protected
updateRequiredCoins():void
Updates the required coins for the transaction.
void
BaseInvocationScope.updateRequiredCoins
functions/base-invocation-scope.ts:151
protected
updateScriptRequest():void
Updates the script request with the current contract calls.
void
BaseInvocationScope.updateScriptRequest