Icon HelpCircleForumIcon Link

⌘K

Icon HelpCircleForumIcon Link
FunctionInvocationScope

Icon LinkClass: FunctionInvocationScope<TArgs, TReturn>

@fuel-ts/program .FunctionInvocationScope

Represents a scope for invoking a function.

Icon LinkType parameters

NameTypeDescription
TArgsextends any[] = any[]The type of the function arguments.
TReturnanyThe type of the return value.

Icon LinkHierarchy

  • BaseInvocationScope<TReturn>

    FunctionInvocationScope

Icon LinkConstructors

Icon Linkconstructor

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

Constructs an instance of FunctionInvocationScope.

Icon LinkType parameters

NameType
TArgsextends any[] = any[]
TReturnany

Icon LinkParameters

NameTypeDescription
programAbstractProgramThe program.
funcFunctionFragment<JsonAbi, string>The function fragment.
argsTArgsThe arguments.

Icon LinkReturns

FunctionInvocationScope <TArgs, TReturn>

Icon LinkOverrides

BaseInvocationScope<TReturn&gt;.constructor

Icon LinkDefined in

packages/program/src/functions/invocation-scope.ts:34 Icon Link

Icon LinkProperties

Icon Linkargs

Protected args: TArgs

Icon LinkDefined in

packages/program/src/functions/invocation-scope.ts:25 Icon Link


Icon LinkcallParameters

Private Optional callParameters: Partial<{ forward: CoinQuantityLike ; gasLimit: BigNumberish }>

Icon LinkDefined in

packages/program/src/functions/invocation-scope.ts:23 Icon Link


Icon Linkforward

Private Optional forward: CoinQuantity

Icon LinkDefined in

packages/program/src/functions/invocation-scope.ts:24 Icon Link


Icon Linkfunc

Protected func: FunctionFragment<JsonAbi, string>

Icon LinkDefined in

packages/program/src/functions/invocation-scope.ts:22 Icon Link


Icon LinkfunctionInvocationScopes

Protected functionInvocationScopes: InvocationScopeLike [] = []

Icon LinkInherited from

BaseInvocationScope.functionInvocationScopes

Icon LinkDefined in

packages/program/src/functions/base-invocation-scope.ts:52 Icon Link


Icon LinkisMultiCall

Protected isMultiCall: boolean = false

Icon LinkInherited from

BaseInvocationScope.isMultiCall

Icon LinkDefined in

packages/program/src/functions/base-invocation-scope.ts:55 Icon Link


Icon Linkprogram

Protected program: AbstractProgram

Icon LinkInherited from

BaseInvocationScope.program

Icon LinkDefined in

packages/program/src/functions/base-invocation-scope.ts:51 Icon Link


Icon LinkrequiredCoins

Protected requiredCoins: CoinQuantity [] = []

Icon LinkInherited from

BaseInvocationScope.requiredCoins

Icon LinkDefined in

packages/program/src/functions/base-invocation-scope.ts:54 Icon Link


Icon LinktransactionRequest

Protected transactionRequest: ScriptTransactionRequest

Icon LinkInherited from

BaseInvocationScope.transactionRequest

Icon LinkDefined in

packages/program/src/functions/base-invocation-scope.ts:50 Icon Link


Icon LinktxParameters

Protected Optional txParameters: Partial<{ gasLimit: BigNumberish ; gasPrice: BigNumberish ; maturity?: number ; maxFee?: BigNumberish ; variableOutputs: number ; witnessLimit?: BigNumberish }>

Icon LinkInherited from

BaseInvocationScope.txParameters

Icon LinkDefined in

packages/program/src/functions/base-invocation-scope.ts:53 Icon Link

Icon LinkAccessors

Icon Linkcalls

get calls(): ContractCall []

Getter for the contract calls.

Icon LinkReturns

ContractCall []

An array of contract calls.

Icon LinkInherited from

BaseInvocationScope.calls

Icon LinkDefined in

packages/program/src/functions/base-invocation-scope.ts:75 Icon Link

Icon LinkMethods

Icon LinkaddCall

addCall(funcScope): FunctionInvocationScope <TArgs, TReturn>

Adds a single call to the invocation scope.

Icon LinkParameters

NameTypeDescription
funcScopeInvocationScopeLike The function scope to add.

Icon LinkReturns

FunctionInvocationScope <TArgs, TReturn>

The current instance of the class.

Icon LinkInherited from

BaseInvocationScope.addCall

Icon LinkDefined in

packages/program/src/functions/base-invocation-scope.ts:154 Icon Link


Icon LinkaddCalls

addCalls(funcScopes): FunctionInvocationScope <TArgs, TReturn>

Adds multiple calls to the invocation scope.

Icon LinkParameters

NameTypeDescription
funcScopesInvocationScopeLike []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

packages/program/src/functions/base-invocation-scope.ts:165 Icon Link


Icon LinkaddContracts

addContracts(contracts): FunctionInvocationScope <TArgs, TReturn>

Adds contracts to the invocation scope.

Icon LinkParameters

NameTypeDescription
contractsAbstractContract []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

packages/program/src/functions/base-invocation-scope.ts:268 Icon Link


Icon Linkcall

call<T>(): Promise<FunctionInvocationResult <T, void>>

Submits a transaction.

Icon LinkType parameters

NameType
TTReturn

Icon LinkReturns

Promise<FunctionInvocationResult <T, void>>

The result of the function invocation.

Icon LinkInherited from

BaseInvocationScope.call

Icon LinkDefined in

packages/program/src/functions/base-invocation-scope.ts:291 Icon Link


Icon LinkcallParams

callParams(callParams): FunctionInvocationScope <TArgs, TReturn>

Sets the call parameters for the function invocation.

Throws

If the function is not payable and forward is set.

Icon LinkParameters

NameTypeDescription
callParamsPartial<{ forward: CoinQuantityLike ; gasLimit: BigNumberish }>The call parameters.

Icon LinkReturns

FunctionInvocationScope <TArgs, TReturn>

The instance of FunctionInvocationScope.

Icon LinkDefined in

packages/program/src/functions/invocation-scope.ts:76 Icon Link


Icon LinkcheckGasLimitTotal

checkGasLimitTotal(): void

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

Icon LinkReturns

void

Icon LinkInherited from

BaseInvocationScope.checkGasLimitTotal

Icon LinkDefined in

packages/program/src/functions/base-invocation-scope.ts:193 Icon Link


Icon LinkdryRun

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

Executes a transaction in dry run mode.

Icon LinkType parameters

NameType
TTReturn

Icon LinkReturns

Promise<InvocationCallResult<T>>

The result of the invocation call.

Icon LinkInherited from

BaseInvocationScope.dryRun

Icon LinkDefined in

packages/program/src/functions/base-invocation-scope.ts:349 Icon Link


Icon LinkfundWithRequiredCoins

fundWithRequiredCoins(fee): Promise<FunctionInvocationScope <TArgs, TReturn>>

Funds the transaction with the required coins.

Icon LinkParameters

NameType
feeBN

Icon LinkReturns

Promise<FunctionInvocationScope <TArgs, TReturn>>

The current instance of the class.

Icon LinkInherited from

BaseInvocationScope.fundWithRequiredCoins

Icon LinkDefined in

packages/program/src/functions/base-invocation-scope.ts:227 Icon Link


Icon LinkgetCallConfig

getCallConfig(): CallConfig <TArgs>

Gets the call configuration.

Icon LinkReturns

CallConfig <TArgs>

The call configuration.

Icon LinkDefined in

packages/program/src/functions/invocation-scope.ts:47 Icon Link


Icon LinkgetProvider

getProvider(): Provider

Icon LinkReturns

Provider

Icon LinkInherited from

BaseInvocationScope.getProvider

Icon LinkDefined in

packages/program/src/functions/base-invocation-scope.ts:373 Icon Link


Icon LinkgetRequiredCoins

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

packages/program/src/functions/base-invocation-scope.ts:117 Icon Link


Icon LinkgetTransactionCost

getTransactionCost(options?): Promise<TransactionCost >

Gets the transaction cost ny dry running the transaction.

Icon LinkParameters

NameTypeDescription
options?Partial<{ fundTransaction: boolean ; gasPrice: BigNumberish }>Optional transaction cost options.

Icon LinkReturns

Promise<TransactionCost >

The transaction cost details.

Icon LinkInherited from

BaseInvocationScope.getTransactionCost

Icon LinkDefined in

packages/program/src/functions/base-invocation-scope.ts:212 Icon Link


Icon LinkgetTransactionId

getTransactionId(chainId?): Promise<string>

Obtains the ID of a transaction.

Icon LinkParameters

NameTypeDescription
chainId?numberthe 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

packages/program/src/functions/base-invocation-scope.ts:385 Icon Link


Icon LinkgetTransactionRequest

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

packages/program/src/functions/base-invocation-scope.ts:281 Icon Link


Icon LinkprepareTransaction

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

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


Icon LinksetArguments

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

Sets the arguments for the function invocation.

Icon LinkParameters

NameTypeDescription
...argsTArgsThe arguments.

Icon LinkReturns

FunctionInvocationScope <TArgs, TReturn>

The instance of FunctionInvocationScope.

Icon LinkDefined in

packages/program/src/functions/invocation-scope.ts:64 Icon Link


Icon Linksimulate

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

Simulates a transaction.

Icon LinkType parameters

NameType
TTReturn

Icon LinkReturns

Promise<InvocationCallResult<T>>

The result of the invocation call.

Icon LinkInherited from

BaseInvocationScope.simulate

Icon LinkDefined in

packages/program/src/functions/base-invocation-scope.ts:317 Icon Link


Icon LinktxParams

txParams(txParams): FunctionInvocationScope <TArgs, TReturn>

Sets the transaction parameters.

Icon LinkParameters

NameTypeDescription
txParamsPartial<{ gasLimit: BigNumberish ; gasPrice: BigNumberish ; maturity?: number ; maxFee?: BigNumberish ; variableOutputs: number ; witnessLimit?: BigNumberish }>The transaction parameters to set.

Icon LinkReturns

FunctionInvocationScope <TArgs, TReturn>

The current instance of the class.

Icon LinkInherited from

BaseInvocationScope.txParams

Icon LinkDefined in

packages/program/src/functions/base-invocation-scope.ts:244 Icon Link


Icon LinkupdateContractInputAndOutput

updateContractInputAndOutput(): void

Updates the transaction request with the current input/output.

Icon LinkReturns

void

Icon LinkInherited from

BaseInvocationScope.updateContractInputAndOutput

Icon LinkDefined in

packages/program/src/functions/base-invocation-scope.ts:103 Icon Link


Icon LinkupdateRequiredCoins

updateRequiredCoins(): void

Updates the required coins for the transaction.

Icon LinkReturns

void

Icon LinkInherited from

BaseInvocationScope.updateRequiredCoins

Icon LinkDefined in

packages/program/src/functions/base-invocation-scope.ts:130 Icon Link


Icon LinkupdateScriptRequest

updateScriptRequest(): void

Updates the script request with the current contract calls.

Icon LinkReturns

void

Icon LinkInherited from

BaseInvocationScope.updateScriptRequest

Icon LinkDefined in

packages/program/src/functions/base-invocation-scope.ts:94 Icon Link