A Contract method can be called directly, or used in various ways.

Extended by

Type parameters

Type parameterValue
A extends any[]any[]
Rany
D extends R | ContractTransactionResponseR | ContractTransactionResponse
interface BaseContractMethod(...args): Promise<D>

Call the contract method with arguments.

Parameters

ParameterTypeDescription
argsContractMethodArgs<A>The arguments to call the method with.

Returns

Promise<D>

A promise resolving to the result of the call.

Source

contract/types.ts:137

Properties

PropertyTypeDescription
fragmentFunctionFragmentThe fragment of the Contract method. This will throw on ambiguous method names.
namestringThe name of the Contract method.

Methods

estimateGas()

estimateGas(...args): Promise<bigint>

Estimate the gas to send the contract method with args.

Parameters

ParameterTypeDescription
argsContractMethodArgs<A>The arguments to call the method with.

Returns

Promise<bigint>

A promise resolving to the estimated gas.

Source

contract/types.ts:190


getFragment()

getFragment(...args): FunctionFragment

Returns the fragment constrained by args. This can be used to resolve ambiguous method names.

Parameters

ParameterTypeDescription
argsContractMethodArgs<A>The arguments to constrain the fragment by.

Returns

FunctionFragment

The constrained fragment.

Source

contract/types.ts:155


populateTransaction()

populateTransaction(...args): Promise<ContractTransaction>

Returns a populated transaction that can be used to perform the contract method with args.

Parameters

ParameterTypeDescription
argsContractMethodArgs<A>The arguments to populate the transaction with.

Returns

Promise<ContractTransaction>

A promise resolving to the populated transaction.

Source

contract/types.ts:163


send()

send(...args): Promise<ContractTransactionResponse>

Send a transaction for the contract method with args.

Parameters

ParameterTypeDescription
argsContractMethodArgs<A>The arguments to call the method with.

Returns

Promise<ContractTransactionResponse>

A promise resolving to the transaction response.

Source

contract/types.ts:182


staticCall()

staticCall(...args): Promise<R>

Call the contract method with args and return the value.

If the return value is a single type, it will be dereferenced and returned directly, otherwise the full Result will be returned.

Parameters

ParameterTypeDescription
argsContractMethodArgs<A>The arguments to call the method with.

Returns

Promise<R>

A promise resolving to the result of the static call.

Source

contract/types.ts:174


staticCallResult()

staticCallResult(...args): Promise<Result>

Call the contract method with args and return the Result without any dereferencing.

Parameters

ParameterTypeDescription
argsContractMethodArgs<A>The arguments to call the method with.

Returns

Promise<Result>

A promise resolving to the Result of the static call.

Source

contract/types.ts:198