Class: MultiCallInvocationScope<TReturn>
@fuel-ts/program.MultiCallInvocationScope
Represents a scope for invoking multiple calls.
Type parameters
Name | Type | Description |
---|---|---|
TReturn | any | The type of the return value. |
Hierarchy
BaseInvocationScope
<TReturn
>↳
MultiCallInvocationScope
Constructors
constructor
• new MultiCallInvocationScope<TReturn
>(contract
, funcScopes
): MultiCallInvocationScope
<TReturn
>
Constructs an instance of MultiCallInvocationScope.
Type parameters
Name | Type |
---|---|
TReturn | any |
Parameters
Name | Type | Description |
---|---|---|
contract | AbstractContract | The contract. |
funcScopes | FunctionInvocationScope <any [], any >[] | An array of function invocation scopes. |
Returns
MultiCallInvocationScope
<TReturn
>
Overrides
BaseInvocationScope<TReturn>.constructor
Defined in
functions/multicall-scope.ts:19
Properties
externalAbis
• Protected
externalAbis: Record
<string
, JsonAbi
> = {}
Inherited from
BaseInvocationScope.externalAbis
Defined in
functions/base-invocation-scope.ts:66
functionInvocationScopes
• Protected
functionInvocationScopes: InvocationScopeLike
[] = []
Inherited from
BaseInvocationScope.functionInvocationScopes
Defined in
functions/base-invocation-scope.ts:61
hasCallParamsGasLimit
• Protected
hasCallParamsGasLimit: boolean
= false
Inherited from
BaseInvocationScope.hasCallParamsGasLimit
Defined in
functions/base-invocation-scope.ts:65
isMultiCall
• Protected
isMultiCall: boolean
= false
Inherited from
BaseInvocationScope.isMultiCall
Defined in
functions/base-invocation-scope.ts:64
program
• Protected
program: AbstractProgram
Inherited from
BaseInvocationScope.program
Defined in
functions/base-invocation-scope.ts:60
requiredCoins
• Protected
requiredCoins: CoinQuantity
[] = []
Inherited from
BaseInvocationScope.requiredCoins
Defined in
functions/base-invocation-scope.ts:63
transactionRequest
• Protected
transactionRequest: ScriptTransactionRequest
Inherited from
BaseInvocationScope.transactionRequest
Defined in
functions/base-invocation-scope.ts:59
txParameters
• Protected
Optional
txParameters: Partial
<{ gasLimit
: BigNumberish
; maturity?
: number
; maxFee?
: BigNumberish
; tip
: BigNumberish
; variableOutputs
: number
; witnessLimit?
: BigNumberish
}>
Inherited from
BaseInvocationScope.txParameters
Defined in
functions/base-invocation-scope.ts:62
Accessors
calls
• get
calls(): ContractCall
[]
Getter for the contract calls.
Returns
An array of contract calls.
Inherited from
BaseInvocationScope.calls
Defined in
functions/base-invocation-scope.ts:88
Methods
addBatchTransfer
▸ addBatchTransfer(transferParams
): MultiCallInvocationScope
<TReturn
>
Adds multiple transfers to the contract call transaction request.
Parameters
Name | Type | Description |
---|---|---|
transferParams | TransferParams [] | An array of TransferParams objects representing the transfers to be made. |
Returns
MultiCallInvocationScope
<TReturn
>
The current instance of the class.
Inherited from
BaseInvocationScope.addBatchTransfer
Defined in
functions/base-invocation-scope.ts:339
addCall
▸ addCall(funcScope
): MultiCallInvocationScope
<TReturn
>
Adds a single function invocation scope to the multi-call invocation scope.
Parameters
Name | Type | Description |
---|---|---|
funcScope | FunctionInvocationScope <any [], any > | The function invocation scope. |
Returns
MultiCallInvocationScope
<TReturn
>
The instance of MultiCallInvocationScope.
Overrides
BaseInvocationScope.addCall
Defined in
functions/multicall-scope.ts:30
addCalls
▸ addCalls(funcScopes
): MultiCallInvocationScope
<TReturn
>
Adds multiple function invocation scopes to the multi-call invocation scope.
Parameters
Name | Type | Description |
---|---|---|
funcScopes | FunctionInvocationScope <any [], any >[] | An array of function invocation scopes. |
Returns
MultiCallInvocationScope
<TReturn
>
The instance of MultiCallInvocationScope.
Overrides
BaseInvocationScope.addCalls
Defined in
functions/multicall-scope.ts:40
addContracts
▸ addContracts(contracts
): MultiCallInvocationScope
<TReturn
>
Adds contracts to the invocation scope.
Parameters
Name | Type | Description |
---|---|---|
contracts | AbstractContract [] | An array of contracts to add. |
Returns
MultiCallInvocationScope
<TReturn
>
The current instance of the class.
Inherited from
BaseInvocationScope.addContracts
Defined in
functions/base-invocation-scope.ts:307
addSigners
▸ addSigners(signers
): MultiCallInvocationScope
<TReturn
>
Parameters
Name | Type |
---|---|
signers | Account | Account [] |
Returns
MultiCallInvocationScope
<TReturn
>
Inherited from
BaseInvocationScope.addSigners
Defined in
functions/base-invocation-scope.ts:352
addTransfer
▸ addTransfer(transferParams
): MultiCallInvocationScope
<TReturn
>
Adds an asset transfer to an Account on the contract call transaction request.
Parameters
Name | Type | Description |
---|---|---|
transferParams | TransferParams | The object representing the transfer to be made. |
Returns
MultiCallInvocationScope
<TReturn
>
The current instance of the class.
Inherited from
BaseInvocationScope.addTransfer
Defined in
functions/base-invocation-scope.ts:321
call
▸ call<T
>(): Promise
<{ transactionId
: string
; waitForResult
: () => Promise
<FunctionResult
<T
>> }>
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.
Type parameters
Name | Type | Description |
---|---|---|
T | TReturn | The type of the return value. |
Returns
Promise
<{ transactionId
: string
; waitForResult
: () => Promise
<FunctionResult
<T
>> }>
A promise that resolves to an object containing:
transactionId
: The ID of the submitted transaction.waitForResult
: A function that waits for the transaction result.
Inherited from
BaseInvocationScope.call
Defined in
functions/base-invocation-scope.ts:379
checkGasLimitTotal
▸ checkGasLimitTotal(): void
Checks if the total gas limit is within the acceptable range.
Returns
void
Inherited from
BaseInvocationScope.checkGasLimitTotal
Defined in
functions/base-invocation-scope.ts:217
dryRun
▸ dryRun<T
>(): Promise
<DryRunResult
<T
>>
Executes a transaction in dry run mode.
Type parameters
Name | Type |
---|---|
T | TReturn |
Returns
Promise
<DryRunResult
<T
>>
The result of the invocation call.
Inherited from
BaseInvocationScope.dryRun
Defined in
functions/base-invocation-scope.ts:438
fundWithRequiredCoins
▸ fundWithRequiredCoins(): Promise
<ScriptTransactionRequest
>
Funds the transaction with the required coins.
Returns
Promise
<ScriptTransactionRequest
>
The current instance of the class.
Inherited from
BaseInvocationScope.fundWithRequiredCoins
Defined in
functions/base-invocation-scope.ts:254
get
▸ get<T
>(): Promise
<DryRunResult
<T
>>
Type parameters
Name | Type |
---|---|
T | TReturn |
Returns
Promise
<DryRunResult
<T
>>
Inherited from
BaseInvocationScope.get
Defined in
functions/base-invocation-scope.ts:452
getProvider
▸ getProvider(): Provider
Returns
Inherited from
BaseInvocationScope.getProvider
Defined in
functions/base-invocation-scope.ts:466
getRequiredCoins
▸ getRequiredCoins(): CoinQuantity
[]
Gets the required coins for the transaction.
Returns
An array of required coin quantities.
Inherited from
BaseInvocationScope.getRequiredCoins
Defined in
functions/base-invocation-scope.ts:137
getTransactionCost
▸ getTransactionCost(): Promise
<TransactionCost
>
Gets the transaction cost ny dry running the transaction.
Returns
Promise
<TransactionCost
>
The transaction cost details.
Inherited from
BaseInvocationScope.getTransactionCost
Defined in
functions/base-invocation-scope.ts:236
getTransactionId
▸ getTransactionId(chainId?
): Promise
<string
>
Obtains the ID of a transaction.
Parameters
Name | Type | Description |
---|---|---|
chainId? | number | the chainId to use to hash the transaction with |
Returns
Promise
<string
>
the ID of the transaction.
Inherited from
BaseInvocationScope.getTransactionId
Defined in
functions/base-invocation-scope.ts:478
getTransactionRequest
▸ getTransactionRequest(): Promise
<ScriptTransactionRequest
>
Prepares and returns the transaction request object.
Returns
Promise
<ScriptTransactionRequest
>
The prepared transaction request.
Inherited from
BaseInvocationScope.getTransactionRequest
Defined in
functions/base-invocation-scope.ts:364
prepareTransaction
▸ prepareTransaction(): Promise
<void
>
Prepares the transaction by updating the script request, required coins, and checking the gas limit.
Returns
Promise
<void
>
Inherited from
BaseInvocationScope.prepareTransaction
Defined in
functions/base-invocation-scope.ts:195
simulate
▸ simulate<T
>(): Promise
<DryRunResult
<T
>>
Simulates a transaction.
Type parameters
Name | Type |
---|---|
T | TReturn |
Returns
Promise
<DryRunResult
<T
>>
The result of the invocation call.
Inherited from
BaseInvocationScope.simulate
Defined in
functions/base-invocation-scope.ts:411
txParams
▸ txParams(txParams
): MultiCallInvocationScope
<TReturn
>
Sets the transaction parameters.
Parameters
Name | Type | Description |
---|---|---|
txParams | Partial <{ gasLimit : BigNumberish ; maturity? : number ; maxFee? : BigNumberish ; tip : BigNumberish ; variableOutputs : number ; witnessLimit? : BigNumberish }> | The transaction parameters to set. |
Returns
MultiCallInvocationScope
<TReturn
>
The current instance of the class.
Inherited from
BaseInvocationScope.txParams
Defined in
functions/base-invocation-scope.ts:286
updateContractInputAndOutput
▸ updateContractInputAndOutput(): void
Updates the transaction request with the current input/output.
Returns
void
Inherited from
BaseInvocationScope.updateContractInputAndOutput
Defined in
functions/base-invocation-scope.ts:118
updateRequiredCoins
▸ updateRequiredCoins(): void
Updates the required coins for the transaction.
Returns
void
Inherited from
BaseInvocationScope.updateRequiredCoins
Defined in
functions/base-invocation-scope.ts:150
updateScriptRequest
▸ updateScriptRequest(): void
Updates the script request with the current contract calls.
Returns
void
Inherited from
BaseInvocationScope.updateScriptRequest
Defined in
functions/base-invocation-scope.ts:104