A pure or view method on a Contract.

Extends

Type parameters

Type parameterValue
A extends any[]-
Rany
interface ConstantContractMethod(...args): Promise<R>

Call the contract method with arguments.

Parameters

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

Returns

Promise<R>

A promise resolving to the result of the call.

Source

contract/types.ts:217

Properties

PropertyTypeDescriptionInherited from
fragmentFunctionFragmentThe fragment of the Contract method. This will throw on ambiguous method names.ContractMethod.fragment
namestringThe name of the Contract method.ContractMethod.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

ContractMethod.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

ContractMethod.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

ContractMethod.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

ContractMethod.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

ContractMethod.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

ContractMethod.staticCallResult

Source

contract/types.ts:198