Application Binary Interface
FunctionFragment
A Fragment which represents a method.
Extends
Properties
Property | Modifier | Type | Description | Inherited from |
---|---|---|---|---|
constant | readonly | boolean | If the function is constant (e.g. pure or view functions). | - |
gas | readonly | null | bigint | The recommended gas limit to send when calling this function. | - |
inputs | readonly | readonly ParamType [] | The inputs for the fragment. | NamedFragment .inputs |
name | readonly | string | The name of the fragment. | NamedFragment .name |
outputs | readonly | readonly ParamType [] | The returned types for the result of calling this function. | - |
payable | readonly | boolean | If the function can be sent value during invocation. | - |
stateMutability | readonly | "payable" | "nonpayable" | "view" | "pure" | The state mutability (e.g. payable , nonpayable , view or pure ) | - |
type | readonly | FragmentType | The type of the fragment. | NamedFragment .type |
Accessors
selector
The Function selector.
Returns
string
Source
Methods
format()
Returns a string representation of this function as format
.
Parameters
Parameter | Type |
---|---|
format ? | FormatType |
Returns
string
Overrides
Source
from()
Returns a new FunctionFragment for obj
.
Parameters
Parameter | Type |
---|---|
obj | any |
Returns
Overrides
Source
getSelector()
Return the selector for a function with name
and params
.
Parameters
Parameter | Type |
---|---|
name | string |
params ? | any [] |
Returns
string
Source
isConstructor()
Returns true if value
is a ConstructorFragment.
Parameters
Parameter | Type |
---|---|
value | any |
Returns
value is ConstructorFragment
Inherited from
Source
isError()
Returns true if value
is an ErrorFragment.
Parameters
Parameter | Type |
---|---|
value | any |
Returns
value is ErrorFragment
Inherited from
Source
isEvent()
Returns true if value
is an EventFragment.
Parameters
Parameter | Type |
---|---|
value | any |
Returns
value is EventFragment
Inherited from
Source
isFragment()
Returns true
and provides a type guard if value
is a FunctionFragment.
Parameters
Parameter | Type |
---|---|
value | any |
Returns
value is FunctionFragment
Source
isFunction()
Returns true if value
is a FunctionFragment.
Parameters
Parameter | Type |
---|---|
value | any |
Returns
value is FunctionFragment
Inherited from
Source
isStruct()
Returns true if value
is a StructFragment.
Parameters
Parameter | Type |
---|---|
value | any |
Returns
value is StructFragment