참고: 이 페이지는 아직 한국어로 번역되지 않았습니다. 아래는 영어 원문입니다.An Interface abstracts many of the low-level details for encoding and decoding the data on the blockchain. An ABI provides information on how to encode data to send to a Contract, how to decode the results and events and how to interpret revert errors. The ABI can be specified by any supported format.
Parameter | Type | Description |
---|---|---|
fragments | InterfaceAbi | The ABI fragments. |
Interface
Property | Modifier | Type | Description |
---|---|---|---|
deploy | readonly | ConstructorFragment | The Contract constructor. |
fallback | readonly | null | FallbackFragment | The Fallback method, if any. |
fragments | readonly | readonly Fragment [] | All the Contract ABI members (i.e. methods, events, errors, etc). |
receive | readonly | boolean | If receiving ether is supported. |
data
(e.g. from an quai_call
) for the specified error (see getError
for valid values for key
).
Most developers should prefer the parseCallResult | parseCallResult method instead, which will
automatically detect a CALL_EXCEPTION
and throw the corresponding error.
Parameter | Type |
---|---|
fragment | string | ErrorFragment |
data | BytesLike |
Result
data
from a transaction tx.data
for the function specified (see
getFunction for valid values for fragment
).
Most developers should prefer the parseTransaction method instead, which will
automatically detect the fragment.
Parameter | Type |
---|---|
fragment | string | FunctionFragment |
data | BytesLike |
Result
data
(e.g. from an quai_call
) for the specified function (see
getFunction for valid values for key
).
Most developers should prefer the parseCallResult | parseCallResult method instead, which will
automatically detect a CALL_EXCEPTION
and throw the corresponding error.
Parameter | Type |
---|---|
fragment | string | FunctionFragment |
data | BytesLike |
Result
tx.data
object for deploying the Contract with the values
as the constructor arguments.
Parameter | Type |
---|---|
values ? | readonly any [] |
string
error
(see getError for valid values for fragment
) with the values
.
This is generally not used by most developers, unless trying to mock a result from a Contract.
Parameter | Type |
---|---|
fragment | string | ErrorFragment |
values ? | readonly any [] |
string
tx.data
for a transaction that calls the function specified (see
getFunction for valid values for fragment
) with the values
.
Parameter | Type |
---|---|
fragment | string | FunctionFragment |
values ? | readonly any [] |
string
quai_call
) for the specified function (see
getFunction for valid values for fragment
) with values
.
This is generally not used by most developers, unless trying to mock a result from a Contract.
Parameter | Type |
---|---|
fragment | string | FunctionFragment |
values ? | readonly any [] |
string
callback
, sorted by their name.
Parameter | Type |
---|---|
callback | (func , index ) => void |
void
callback
, sorted by their name.
Parameter | Type |
---|---|
callback | (func , index ) => void |
void
callback
, sorted by their name.
Parameter | Type |
---|---|
callback | (func , index ) => void |
void
minimal
strings, which removes
parameter names and unneceesary spaces.
Parameter | Type |
---|---|
minimal ? | boolean |
string
[]
string
AbiCoder
key
, which may be an error selector, error name or error
signature that belongs to the ABI.
If values
is provided, it will use the Typed API to handle ambiguous cases where multiple errors match by name.
If the key
and values
do not refine to a single error in the ABI, this will throw.
Parameter | Type |
---|---|
key | string |
values ? | any [] |
null
| ErrorFragment
key
, which may be a topic hash, event name or event
signature that belongs to the ABI.
If values
is provided, it will use the Typed API to handle ambiguous cases where multiple events match by name.
If the key
and values
do not refine to a single event in the ABI, this will throw.
Parameter | Type |
---|---|
key | string |
values ? | any [] |
null
| EventFragment
key
, which may be a topic hash, event name or event signature that belongs to the ABI.
Parameter | Type |
---|---|
key | string |
string
key
, which may be a function selector, function name
or function signature that belongs to the ABI.
If values
is provided, it will use the Typed API to handle ambiguous cases where multiple functions match by
name.
If the key
and values
do not refine to a single function in the ABI, this will throw.
Parameter | Type |
---|---|
key | string |
values ? | any [] |
null
| FunctionFragment
key
, which may be a function selector, function name or function signature that
belongs to the ABI.
Parameter | Type |
---|---|
key | string |
string
key
(an event topic hash, event name or event signature) is present in the ABI.
In the case of an event name, the name may be ambiguous, so accessing the
EventFragment may require refinement.
Parameter | Type |
---|---|
key | string |
boolean
key
(a function selector, function name or function signature) is present in the ABI.
In the case of a function name, the name may be ambiguous, so accessing the
FunctionFragment may require refinement.
Parameter | Type |
---|---|
key | string |
boolean
Parameter | Type |
---|---|
data | BytesLike |
null
| ErrorDescription
Parameter | Type |
---|---|
log | object |
log.data | string |
log.topics | string [] |
null
| LogDescription
Parameter | Type |
---|---|
tx | object |
tx.data | string |
tx.value ? | BigNumberish |
null
| TransactionDescription
value
.
The value
may be provided as an existing Interface object, a JSON-encoded ABI or any
Human-Readable ABI format.
Parameter | Type |
---|---|
value | Interface | InterfaceAbi |
Interface