ConstantContractMethod
A pure or view method on a Contract.
Extends
ContractMethod
<A
,R
,R
>
Type parameters
Type parameter | Value |
---|---|
A extends any [] | - |
R | any |
Call the contract method with arguments.
Parameters
Parameter | Type | Description |
---|---|---|
…args | ContractMethodArgs <A > | The arguments to call the method with. |
Returns
Promise
<R
>
A promise resolving to the result of the call.
Source
Properties
Property | Type | Description | Inherited from |
---|---|---|---|
fragment | FunctionFragment | The fragment of the Contract method. This will throw on ambiguous method names. | ContractMethod .fragment |
name | string | The name of the Contract method. | ContractMethod .name |
Methods
estimateGas()
Estimate the gas to send the contract method with args
.
Parameters
Parameter | Type | Description |
---|---|---|
…args | ContractMethodArgs <A > | The arguments to call the method with. |
Returns
Promise
<bigint
>
A promise resolving to the estimated gas.
Inherited from
Source
getFragment()
Returns the fragment constrained by args
. This can be used to resolve ambiguous method names.
Parameters
Parameter | Type | Description |
---|---|---|
…args | ContractMethodArgs <A > | The arguments to constrain the fragment by. |
Returns
The constrained fragment.
Inherited from
Source
populateTransaction()
Returns a populated transaction that can be used to perform the contract method with args
.
Parameters
Parameter | Type | Description |
---|---|---|
…args | ContractMethodArgs <A > | The arguments to populate the transaction with. |
Returns
Promise
<ContractTransaction
>
A promise resolving to the populated transaction.
Inherited from
ContractMethod
.populateTransaction
Source
send()
Send a transaction for the contract method with args
.
Parameters
Parameter | Type | Description |
---|---|---|
…args | ContractMethodArgs <A > | The arguments to call the method with. |
Returns
Promise
<ContractTransactionResponse
>
A promise resolving to the transaction response.
Inherited from
Source
staticCall()
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
Parameter | Type | Description |
---|---|---|
…args | ContractMethodArgs <A > | The arguments to call the method with. |
Returns
Promise
<R
>
A promise resolving to the result of the static call.
Inherited from
Source
staticCallResult()
Call the contract method with args
and return the Result without any dereferencing.
Parameters
Parameter | Type | Description |
---|---|---|
…args | ContractMethodArgs <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
Was this page helpful?