Icon HelpCircleForumIcon Link

⌘K

Icon HelpCircleForumIcon Link
Nightly /
FunctionInvocationScope

@fuel-ts/program v0.96.1 • Docs


Icon LinkClass: FunctionInvocationScope<TArgs, TReturn>

Represents a scope for invoking a function.

Icon LinkExtends

  • BaseInvocationScope<TReturn>

Icon LinkType Parameters

• TArgs extends any[] = any[]

The type of the function arguments.

• TReturn = any

The type of the return value.

Icon LinkConstructors

Icon Linknew FunctionInvocationScope()

Icon InfoCircle

new FunctionInvocationScope<TArgs, TReturn>(program, func, args): FunctionInvocationScope <TArgs, TReturn>

Constructs an instance of FunctionInvocationScope.

Icon LinkParameters

• program: AbstractProgram

The program.

• func: FunctionFragment

The function fragment.

• args: TArgs

The arguments.

Icon LinkReturns

FunctionInvocationScope <TArgs, TReturn>

Icon LinkOverrides

BaseInvocationScope<TReturn>.constructor

Icon LinkDefined in

functions/invocation-scope.ts:34 Icon Link

Icon LinkProperties

Icon Linkargs

Icon InfoCircle

protected args: TArgs

Icon LinkDefined in

functions/invocation-scope.ts:25 Icon Link


Icon LinkexternalAbis

Icon InfoCircle

protected externalAbis: Record<string, JsonAbi> = {}

Icon LinkInherited from

BaseInvocationScope.externalAbis

Icon LinkDefined in

functions/base-invocation-scope.ts:67 Icon Link


Icon Linkfunc

Icon InfoCircle

protected func: FunctionFragment

Icon LinkDefined in

functions/invocation-scope.ts:22 Icon Link


Icon LinkfunctionInvocationScopes

Icon InfoCircle

protected functionInvocationScopes: InvocationScopeLike [] = []

Icon LinkInherited from

BaseInvocationScope.functionInvocationScopes

Icon LinkDefined in

functions/base-invocation-scope.ts:62 Icon Link


Icon LinkhasCallParamsGasLimit

Icon InfoCircle

protected hasCallParamsGasLimit: boolean = false

Icon LinkInherited from

BaseInvocationScope.hasCallParamsGasLimit

Icon LinkDefined in

functions/base-invocation-scope.ts:66 Icon Link


Icon LinkisMultiCall

Icon InfoCircle

protected isMultiCall: boolean = false

Icon LinkInherited from

BaseInvocationScope.isMultiCall

Icon LinkDefined in

functions/base-invocation-scope.ts:65 Icon Link


Icon Linkprogram

Icon InfoCircle

protected program: AbstractProgram

Icon LinkInherited from

BaseInvocationScope.program

Icon LinkDefined in

functions/base-invocation-scope.ts:61 Icon Link


Icon LinkrequiredCoins

Icon InfoCircle

protected requiredCoins: CoinQuantity [] = []

Icon LinkInherited from

BaseInvocationScope.requiredCoins

Icon LinkDefined in

functions/base-invocation-scope.ts:64 Icon Link


Icon LinktransactionRequest

Icon InfoCircle

protected transactionRequest: ScriptTransactionRequest

Icon LinkInherited from

BaseInvocationScope.transactionRequest

Icon LinkDefined in

functions/base-invocation-scope.ts:60 Icon Link


Icon LinktxParameters?

Icon InfoCircle

protected optional txParameters: Partial<object>

Icon LinkType declaration

Icon LinkgasLimit

Icon InfoCircle

gasLimit: BigNumberish

Icon Linkmaturity?

Icon InfoCircle

optional maturity: number

Icon LinkmaxFee?

Icon InfoCircle

optional maxFee: BigNumberish

Icon Linktip

Icon InfoCircle

tip: BigNumberish

Icon LinkvariableOutputs

Icon InfoCircle

variableOutputs: number

Icon LinkwitnessLimit?

Icon InfoCircle

optional witnessLimit: BigNumberish

Icon LinkInherited from

BaseInvocationScope.txParameters

Icon LinkDefined in

functions/base-invocation-scope.ts:63 Icon Link

Icon LinkAccessors

Icon Linkcalls

Icon InfoCircle

get protected calls(): ContractCall []

Getter for the contract calls.

Icon LinkReturns

ContractCall []

An array of contract calls.

Icon LinkInherited from

BaseInvocationScope.calls

Icon LinkDefined in

functions/base-invocation-scope.ts:89 Icon Link

Icon LinkMethods

Icon LinkaddBatchTransfer()

Icon InfoCircle

addBatchTransfer(transferParams): FunctionInvocationScope <TArgs, TReturn>

Adds multiple transfers to the contract call transaction request.

Icon LinkParameters

• transferParams: TransferParams []

An array of TransferParams objects representing the transfers to be made.

Icon LinkReturns

FunctionInvocationScope <TArgs, TReturn>

The current instance of the class.

Icon LinkInherited from

BaseInvocationScope.addBatchTransfer

Icon LinkDefined in

functions/base-invocation-scope.ts:337 Icon Link


Icon LinkaddCall()

Icon InfoCircle

protected addCall(funcScope): FunctionInvocationScope <TArgs, TReturn>

Adds a single call to the invocation scope.

Icon LinkParameters

• funcScope: InvocationScopeLike

The function scope to add.

Icon LinkReturns

FunctionInvocationScope <TArgs, TReturn>

The current instance of the class.

Icon LinkInherited from

BaseInvocationScope.addCall

Icon LinkDefined in

functions/base-invocation-scope.ts:175 Icon Link


Icon LinkaddCalls()

Icon InfoCircle

protected addCalls(funcScopes): FunctionInvocationScope <TArgs, TReturn>

Adds multiple calls to the invocation scope.

Icon LinkParameters

• funcScopes: InvocationScopeLike []

An array of function scopes to add.

Icon LinkReturns

FunctionInvocationScope <TArgs, TReturn>

The current instance of the class.

Icon LinkInherited from

BaseInvocationScope.addCalls

Icon LinkDefined in

functions/base-invocation-scope.ts:186 Icon Link


Icon LinkaddContracts()

Icon InfoCircle

addContracts(contracts): FunctionInvocationScope <TArgs, TReturn>

Adds contracts to the invocation scope.

Icon LinkParameters

• contracts: AbstractContract []

An array of contracts to add.

Icon LinkReturns

FunctionInvocationScope <TArgs, TReturn>

The current instance of the class.

Icon LinkInherited from

BaseInvocationScope.addContracts

Icon LinkDefined in

functions/base-invocation-scope.ts:305 Icon Link


Icon LinkaddSigners()

Icon InfoCircle

addSigners(signers): FunctionInvocationScope <TArgs, TReturn>

Icon LinkParameters

• signers: Account | Account []

Icon LinkReturns

FunctionInvocationScope <TArgs, TReturn>

Icon LinkInherited from

BaseInvocationScope.addSigners

Icon LinkDefined in

functions/base-invocation-scope.ts:350 Icon Link


Icon LinkaddTransfer()

Icon InfoCircle

addTransfer(transferParams): FunctionInvocationScope <TArgs, TReturn>

Adds an asset transfer to an Account on the contract call transaction request.

Icon LinkParameters

• transferParams: TransferParams

The object representing the transfer to be made.

Icon LinkReturns

FunctionInvocationScope <TArgs, TReturn>

The current instance of the class.

Icon LinkInherited from

BaseInvocationScope.addTransfer

Icon LinkDefined in

functions/base-invocation-scope.ts:319 Icon Link


Icon Linkcall()

Icon InfoCircle

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.

Icon LinkType Parameters

• T = TReturn

The type of the return value.

Icon LinkReturns

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.

Icon LinktransactionId

Icon InfoCircle

transactionId: string

Icon LinkwaitForResult()

Icon InfoCircle

waitForResult: () => Promise<FunctionResult <T>>

Icon LinkReturns

Promise<FunctionResult <T>>

Icon LinkInherited from

BaseInvocationScope.call

Icon LinkDefined in

functions/base-invocation-scope.ts:377 Icon Link


Icon LinkcallParams()

Icon InfoCircle

callParams(callParams): FunctionInvocationScope <TArgs, TReturn>

Sets the call parameters for the function invocation.

Icon LinkParameters

• callParams: Partial<object>

The call parameters.

Icon LinkReturns

FunctionInvocationScope <TArgs, TReturn>

The instance of FunctionInvocationScope.

Icon LinkThrows

If the function is not payable and forward is set.

Icon LinkDefined in

functions/invocation-scope.ts:77 Icon Link


Icon LinkcheckGasLimitTotal()

Icon InfoCircle

protected checkGasLimitTotal(): void

Checks if the total gas limit is within the acceptable range.

Icon LinkReturns

void

Icon LinkInherited from

BaseInvocationScope.checkGasLimitTotal

Icon LinkDefined in

functions/base-invocation-scope.ts:218 Icon Link


Icon LinkdryRun()

Icon InfoCircle

dryRun<T>(): Promise<DryRunResult <T>>

Executes a transaction in dry run mode.

Icon LinkType Parameters

• T = TReturn

Icon LinkReturns

Promise<DryRunResult <T>>

The result of the invocation call.

Icon LinkInherited from

BaseInvocationScope.dryRun

Icon LinkDefined in

functions/base-invocation-scope.ts:435 Icon Link


Icon LinkfundWithRequiredCoins()

Icon InfoCircle

fundWithRequiredCoins(): Promise<ScriptTransactionRequest >

Funds the transaction with the required coins.

Icon LinkReturns

Promise<ScriptTransactionRequest >

The current instance of the class.

Icon LinkInherited from

BaseInvocationScope.fundWithRequiredCoins

Icon LinkDefined in

functions/base-invocation-scope.ts:252 Icon Link


Icon Linkget()

Icon InfoCircle

get<T>(): Promise<DryRunResult <T>>

Icon LinkType Parameters

• T = TReturn

Icon LinkReturns

Promise<DryRunResult <T>>

Icon LinkInherited from

BaseInvocationScope.get

Icon LinkDefined in

functions/base-invocation-scope.ts:449 Icon Link


Icon LinkgetCallConfig()

Icon InfoCircle

getCallConfig(): CallConfig <TArgs>

Gets the call configuration.

Icon LinkReturns

CallConfig <TArgs>

The call configuration.

Icon LinkDefined in

functions/invocation-scope.ts:47 Icon Link


Icon LinkgetProvider()

Icon InfoCircle

getProvider(): Provider

Icon LinkReturns

Provider

Icon LinkInherited from

BaseInvocationScope.getProvider

Icon LinkDefined in

functions/base-invocation-scope.ts:463 Icon Link


Icon LinkgetRequiredCoins()

Icon InfoCircle

protected getRequiredCoins(): CoinQuantity []

Gets the required coins for the transaction.

Icon LinkReturns

CoinQuantity []

An array of required coin quantities.

Icon LinkInherited from

BaseInvocationScope.getRequiredCoins

Icon LinkDefined in

functions/base-invocation-scope.ts:138 Icon Link


Icon LinkgetTransactionCost()

Icon InfoCircle

getTransactionCost(): Promise<TransactionCost >

Gets the transaction cost for dry running the transaction.

Icon LinkReturns

Promise<TransactionCost >

The transaction cost details.

Icon LinkInherited from

BaseInvocationScope.getTransactionCost

Icon LinkDefined in

functions/base-invocation-scope.ts:237 Icon Link


Icon LinkgetTransactionId()

Icon InfoCircle

getTransactionId(chainId?): Promise<string>

Obtains the ID of a transaction.

Icon LinkParameters

• chainId?: number

the chainId to use to hash the transaction with

Icon LinkReturns

Promise<string>

the ID of the transaction.

Icon LinkInherited from

BaseInvocationScope.getTransactionId

Icon LinkDefined in

functions/base-invocation-scope.ts:475 Icon Link


Icon LinkgetTransactionRequest()

Icon InfoCircle

getTransactionRequest(): Promise<ScriptTransactionRequest >

Prepares and returns the transaction request object.

Icon LinkReturns

Promise<ScriptTransactionRequest >

The prepared transaction request.

Icon LinkInherited from

BaseInvocationScope.getTransactionRequest

Icon LinkDefined in

functions/base-invocation-scope.ts:362 Icon Link


Icon LinkprepareTransaction()

Icon InfoCircle

protected prepareTransaction(): Promise<void>

Prepares the transaction by updating the script request, required coins, and checking the gas limit.

Icon LinkReturns

Promise<void>

Icon LinkInherited from

BaseInvocationScope.prepareTransaction

Icon LinkDefined in

functions/base-invocation-scope.ts:196 Icon Link


Icon LinksetArguments()

Icon InfoCircle

setArguments(...args): FunctionInvocationScope <TArgs, TReturn>

Sets the arguments for the function invocation.

Icon LinkParameters

• ...args: TArgs

The arguments.

Icon LinkReturns

FunctionInvocationScope <TArgs, TReturn>

The instance of FunctionInvocationScope.

Icon LinkDefined in

functions/invocation-scope.ts:65 Icon Link


Icon Linksimulate()

Icon InfoCircle

simulate<T>(): Promise<DryRunResult <T>>

Simulates a transaction.

Icon LinkType Parameters

• T = TReturn

Icon LinkReturns

Promise<DryRunResult <T>>

The result of the invocation call.

Icon LinkInherited from

BaseInvocationScope.simulate

Icon LinkDefined in

functions/base-invocation-scope.ts:408 Icon Link


Icon LinktxParams()

Icon InfoCircle

txParams(txParams): FunctionInvocationScope <TArgs, TReturn>

Sets the transaction parameters.

Icon LinkParameters

• txParams: Partial<object>

The transaction parameters to set.

Icon LinkReturns

FunctionInvocationScope <TArgs, TReturn>

The current instance of the class.

Icon LinkInherited from

BaseInvocationScope.txParams

Icon LinkDefined in

functions/base-invocation-scope.ts:284 Icon Link


Icon LinkupdateContractInputAndOutput()

Icon InfoCircle

protected updateContractInputAndOutput(): void

Updates the transaction request with the current input/output.

Icon LinkReturns

void

Icon LinkInherited from

BaseInvocationScope.updateContractInputAndOutput

Icon LinkDefined in

functions/base-invocation-scope.ts:119 Icon Link


Icon LinkupdateRequiredCoins()

Icon InfoCircle

protected updateRequiredCoins(): void

Updates the required coins for the transaction.

Icon LinkReturns

void

Icon LinkInherited from

BaseInvocationScope.updateRequiredCoins

Icon LinkDefined in

functions/base-invocation-scope.ts:151 Icon Link


Icon LinkupdateScriptRequest()

Icon InfoCircle

protected updateScriptRequest(): void

Updates the script request with the current contract calls.

Icon LinkReturns

void

Icon LinkInherited from

BaseInvocationScope.updateScriptRequest

Icon LinkDefined in

functions/base-invocation-scope.ts:105 Icon Link