ContractMethod
A contract method on a Contract.
Extends
BaseContractMethod
<A
,R
,D
>
Extended by
Type parameters
Type parameter | Value |
---|---|
A extends any [] | any [] |
R | any |
D extends R | ContractTransactionResponse | R | ContractTransactionResponse |
Call the contract method with arguments.
Parameters
Parameter | Type | Description |
---|---|---|
…args | ContractMethodArgs <A > | The arguments to call the method with. |
Returns
Promise
<D
>
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. | BaseContractMethod .fragment |
name | string | The name of the Contract method. | BaseContractMethod .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
BaseContractMethod
.estimateGas
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
BaseContractMethod
.getFragment
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
BaseContractMethod
.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
BaseContractMethod
.staticCallResult
Source
Was this page helpful?