A contract method on a Contract.

Extends

Extended by

Type parameters

Type parameterValue
A extends any[]any[]
Rany
D extends R | ContractTransactionResponseR | ContractTransactionResponse
interface ContractMethod(...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:206

Properties

PropertyTypeDescriptionInherited from
fragmentFunctionFragmentThe fragment of the Contract method. This will throw on ambiguous method names.BaseContractMethod.fragment
namestringThe name of the Contract method.BaseContractMethod.name

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.

Inherited from

BaseContractMethod.estimateGas

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.

Inherited from

BaseContractMethod.getFragment

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.

Inherited from

BaseContractMethod.populateTransaction

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.

Inherited from

BaseContractMethod.send

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.

Inherited from

BaseContractMethod.staticCall

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.

Inherited from

BaseContractMethod.staticCallResult

Source

contract/types.ts:198