A contract method on a Contract.
BaseContractMethod
<A
, R
, D
>Type parameter | Value |
---|---|
A extends any [] | any [] |
R | any |
D extends R | ContractTransactionResponse | R | ContractTransactionResponse |
Call the contract method with arguments.
Parameter | Type | Description |
---|---|---|
…args | ContractMethodArgs <A > | The arguments to call the method with. |
Promise
<D
>
A promise resolving to the result of the call.
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 |
Estimate the gas to send the contract method with args
.
Parameter | Type | Description |
---|---|---|
…args | ContractMethodArgs <A > | The arguments to call the method with. |
Promise
<bigint
>
A promise resolving to the estimated gas.
BaseContractMethod
.estimateGas
Returns the fragment constrained by args
. This can be used to resolve ambiguous method names.
Parameter | Type | Description |
---|---|---|
…args | ContractMethodArgs <A > | The arguments to constrain the fragment by. |
The constrained fragment.
BaseContractMethod
.getFragment
Returns a populated transaction that can be used to perform the contract method with args
.
Parameter | Type | Description |
---|---|---|
…args | ContractMethodArgs <A > | The arguments to populate the transaction with. |
Promise
<ContractTransaction
>
A promise resolving to the populated transaction.
BaseContractMethod
.populateTransaction
Send a transaction for the contract method with args
.
Parameter | Type | Description |
---|---|---|
…args | ContractMethodArgs <A > | The arguments to call the method with. |
Promise
<ContractTransactionResponse
>
A promise resolving to the transaction response.
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.
Parameter | Type | Description |
---|---|---|
…args | ContractMethodArgs <A > | The arguments to call the method with. |
Promise
<R
>
A promise resolving to the result of the static call.
Call the contract method with args
and return the Result without any dereferencing.
Parameter | Type | Description |
---|---|---|
…args | ContractMethodArgs <A > | The arguments to call the method with. |
Promise
<Result
>
A promise resolving to the Result of the static call.
BaseContractMethod
.staticCallResult
A contract method on a Contract.
BaseContractMethod
<A
, R
, D
>Type parameter | Value |
---|---|
A extends any [] | any [] |
R | any |
D extends R | ContractTransactionResponse | R | ContractTransactionResponse |
Call the contract method with arguments.
Parameter | Type | Description |
---|---|---|
…args | ContractMethodArgs <A > | The arguments to call the method with. |
Promise
<D
>
A promise resolving to the result of the call.
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 |
Estimate the gas to send the contract method with args
.
Parameter | Type | Description |
---|---|---|
…args | ContractMethodArgs <A > | The arguments to call the method with. |
Promise
<bigint
>
A promise resolving to the estimated gas.
BaseContractMethod
.estimateGas
Returns the fragment constrained by args
. This can be used to resolve ambiguous method names.
Parameter | Type | Description |
---|---|---|
…args | ContractMethodArgs <A > | The arguments to constrain the fragment by. |
The constrained fragment.
BaseContractMethod
.getFragment
Returns a populated transaction that can be used to perform the contract method with args
.
Parameter | Type | Description |
---|---|---|
…args | ContractMethodArgs <A > | The arguments to populate the transaction with. |
Promise
<ContractTransaction
>
A promise resolving to the populated transaction.
BaseContractMethod
.populateTransaction
Send a transaction for the contract method with args
.
Parameter | Type | Description |
---|---|---|
…args | ContractMethodArgs <A > | The arguments to call the method with. |
Promise
<ContractTransactionResponse
>
A promise resolving to the transaction response.
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.
Parameter | Type | Description |
---|---|---|
…args | ContractMethodArgs <A > | The arguments to call the method with. |
Promise
<R
>
A promise resolving to the result of the static call.
Call the contract method with args
and return the Result without any dereferencing.
Parameter | Type | Description |
---|---|---|
…args | ContractMethodArgs <A > | The arguments to call the method with. |
Promise
<Result
>
A promise resolving to the Result of the static call.
BaseContractMethod
.staticCallResult