1
+ export type Abi = readonly Abi . Item [ ]
2
+
1
3
/**
2
4
* `Abi` represents the structure of an Ethereum contract's Application Binary Interface (ABI),
3
5
* which defines the functions, events, and errors that can be interacted with in the contract.
30
32
* ];
31
33
* ```
32
34
*/
33
- export type Abi = readonly Abi . Item [ ]
34
-
35
35
export namespace Abi {
36
36
/**
37
37
* `Abi.Item` represents a single item in an ABI, which can be either a function, event, or error.
38
38
*/
39
39
export type Item = FunctionItem | EventItem | ErrorItem
40
40
41
- /**
42
- * `Abi.FunctionItem` defines a function in a contract's ABI, including its name, inputs, outputs,
43
- * and state mutability.
44
- */
45
41
export type FunctionItem =
46
42
| {
47
43
type : "function"
@@ -57,9 +53,8 @@ export namespace Abi {
57
53
}
58
54
59
55
/**
60
- * `Abi.FunctionItem.Input` and `Abi.FunctionItem.Output` represent the arguments and return values of a function.
61
- * They both share the same structure, defined by `Abi.Argument`, which includes the argument's type, name,
62
- * and internal type used in Solidity.
56
+ * `Abi.FunctionItem` defines a function in a contract's ABI, including its name, inputs, outputs,
57
+ * and state mutability.
63
58
*/
64
59
export namespace FunctionItem {
65
60
export type Input = Argument & { }
@@ -81,17 +76,17 @@ export namespace Abi {
81
76
| "payable"
82
77
}
83
78
84
- /**
85
- * `Abi.EventItem` defines an event in the contract's ABI, which can be emitted by the contract.
86
- * Each event has a name, inputs, and an `anonymous` flag indicating whether the event is anonymous.
87
- */
88
79
export type EventItem = {
89
80
type : "event"
90
81
name : string
91
82
inputs : readonly EventItem . Input [ ]
92
83
anonymous : boolean
93
84
}
94
85
86
+ /**
87
+ * `Abi.EventItem` defines an event in the contract's ABI, which can be emitted by the contract.
88
+ * Each event has a name, inputs, and an `anonymous` flag indicating whether the event is anonymous.
89
+ */
95
90
export namespace EventItem {
96
91
/**
97
92
* `Abi.EventItem.Input` represents an argument to an event, with an additional `indexed` flag
@@ -100,15 +95,15 @@ export namespace Abi {
100
95
export type Input = Argument & { indexed : boolean }
101
96
}
102
97
103
- /**
104
- * `Abi.ErrorItem` defines an error in the contract's ABI, which can be used for custom error handling.
105
- */
106
98
export type ErrorItem = {
107
99
type : "error"
108
100
name : string
109
101
inputs : readonly ErrorItem . Input [ ]
110
102
}
111
103
104
+ /**
105
+ * `Abi.ErrorItem` defines an error in the contract's ABI, which can be used for custom error handling.
106
+ */
112
107
export namespace ErrorItem {
113
108
/**
114
109
* `Abi.ErrorItem.Input` represents an argument to an error.
0 commit comments