ox 0.4.4 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/_cjs/erc4337/EntryPoint.js +1320 -0
- package/_cjs/erc4337/EntryPoint.js.map +1 -0
- package/_cjs/erc4337/RpcSchema.js +3 -0
- package/_cjs/erc4337/RpcSchema.js.map +1 -0
- package/_cjs/erc4337/UserOperation.js +152 -0
- package/_cjs/erc4337/UserOperation.js.map +1 -0
- package/_cjs/erc4337/UserOperationGas.js +31 -0
- package/_cjs/erc4337/UserOperationGas.js.map +1 -0
- package/_cjs/erc4337/UserOperationReceipt.js +35 -0
- package/_cjs/erc4337/UserOperationReceipt.js.map +1 -0
- package/_cjs/erc4337/index.js +9 -0
- package/_cjs/erc4337/index.js.map +1 -0
- package/_cjs/index.docs.js +1 -0
- package/_cjs/index.docs.js.map +1 -1
- package/_cjs/version.js +1 -1
- package/_esm/erc4337/EntryPoint.js +1321 -0
- package/_esm/erc4337/EntryPoint.js.map +1 -0
- package/_esm/erc4337/RpcSchema.js +2 -0
- package/_esm/erc4337/RpcSchema.js.map +1 -0
- package/_esm/erc4337/UserOperation.js +324 -0
- package/_esm/erc4337/UserOperation.js.map +1 -0
- package/_esm/erc4337/UserOperationGas.js +61 -0
- package/_esm/erc4337/UserOperationGas.js.map +1 -0
- package/_esm/erc4337/UserOperationReceipt.js +79 -0
- package/_esm/erc4337/UserOperationReceipt.js.map +1 -0
- package/_esm/erc4337/index.js +31 -0
- package/_esm/erc4337/index.js.map +1 -0
- package/_esm/index.docs.js +1 -0
- package/_esm/index.docs.js.map +1 -1
- package/_esm/version.js +1 -1
- package/_types/erc4337/EntryPoint.d.ts +1480 -0
- package/_types/erc4337/EntryPoint.d.ts.map +1 -0
- package/_types/erc4337/RpcSchema.d.ts +159 -0
- package/_types/erc4337/RpcSchema.d.ts.map +1 -0
- package/_types/erc4337/UserOperation.d.ts +330 -0
- package/_types/erc4337/UserOperation.d.ts.map +1 -0
- package/_types/erc4337/UserOperationGas.d.ts +62 -0
- package/_types/erc4337/UserOperationGas.d.ts.map +1 -0
- package/_types/erc4337/UserOperationReceipt.d.ts +87 -0
- package/_types/erc4337/UserOperationReceipt.d.ts.map +1 -0
- package/_types/erc4337/index.d.ts +33 -0
- package/_types/erc4337/index.d.ts.map +1 -0
- package/_types/index.docs.d.ts +1 -0
- package/_types/index.docs.d.ts.map +1 -1
- package/_types/version.d.ts +1 -1
- package/erc4337/EntryPoint/package.json +6 -0
- package/erc4337/EntryPoint.ts +1419 -0
- package/erc4337/RpcSchema/package.json +6 -0
- package/erc4337/RpcSchema.ts +179 -0
- package/erc4337/UserOperation/package.json +6 -0
- package/erc4337/UserOperation.ts +617 -0
- package/erc4337/UserOperationGas/package.json +6 -0
- package/erc4337/UserOperationGas.ts +109 -0
- package/erc4337/UserOperationReceipt/package.json +6 -0
- package/erc4337/UserOperationReceipt.ts +139 -0
- package/erc4337/index.ts +38 -0
- package/erc4337/package.json +6 -0
- package/index.docs.ts +1 -0
- package/package.json +31 -1
- package/version.ts +1 -1
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import type * as Address from '../core/Address.js'
|
|
2
|
+
import type * as Hex from '../core/Hex.js'
|
|
3
|
+
import type * as RpcSchema from '../core/RpcSchema.js'
|
|
4
|
+
import type * as EntryPoint from './EntryPoint.js'
|
|
5
|
+
import type * as UserOperation from './UserOperation.js'
|
|
6
|
+
import type * as UserOperationGas from './UserOperationGas.js'
|
|
7
|
+
import type * as UserOperationReceipt from './UserOperationReceipt.js'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Union of all JSON-RPC Methods for ERC-4337 Bundlers.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts twoslash
|
|
14
|
+
* import { RpcSchema } from 'ox'
|
|
15
|
+
*
|
|
16
|
+
* type Schema = RpcSchema.Bundler
|
|
17
|
+
* // ^?
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
*
|
|
21
|
+
*
|
|
22
|
+
*
|
|
23
|
+
*
|
|
24
|
+
*
|
|
25
|
+
*
|
|
26
|
+
*
|
|
27
|
+
*
|
|
28
|
+
*
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export type Bundler<
|
|
32
|
+
entryPointVersion extends EntryPoint.Version = EntryPoint.Version,
|
|
33
|
+
> = RpcSchema.From<
|
|
34
|
+
| {
|
|
35
|
+
Request: {
|
|
36
|
+
method: 'eth_chainId'
|
|
37
|
+
params?: undefined
|
|
38
|
+
}
|
|
39
|
+
ReturnType: Hex.Hex
|
|
40
|
+
}
|
|
41
|
+
| {
|
|
42
|
+
Request: {
|
|
43
|
+
method: 'eth_estimateUserOperationGas'
|
|
44
|
+
params:
|
|
45
|
+
| [
|
|
46
|
+
userOperation: UserOperation.Rpc<entryPointVersion>,
|
|
47
|
+
entrypoint: Address.Address,
|
|
48
|
+
]
|
|
49
|
+
| [
|
|
50
|
+
userOperation: UserOperation.Rpc<entryPointVersion>,
|
|
51
|
+
entrypoint: Address.Address,
|
|
52
|
+
/** TODO: Add type. */
|
|
53
|
+
stateOverrides: unknown,
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
ReturnType: UserOperationGas.Rpc<entryPointVersion>
|
|
57
|
+
}
|
|
58
|
+
| {
|
|
59
|
+
Request: {
|
|
60
|
+
method: 'eth_getUserOperationByHash'
|
|
61
|
+
params: [hash: Hex.Hex]
|
|
62
|
+
}
|
|
63
|
+
ReturnType: UserOperation.Rpc<entryPointVersion> | null
|
|
64
|
+
}
|
|
65
|
+
| {
|
|
66
|
+
Request: {
|
|
67
|
+
method: 'eth_getUserOperationReceipt'
|
|
68
|
+
params: [hash: Hex.Hex]
|
|
69
|
+
}
|
|
70
|
+
ReturnType: UserOperationReceipt.Rpc<entryPointVersion> | null
|
|
71
|
+
}
|
|
72
|
+
| {
|
|
73
|
+
Request: {
|
|
74
|
+
method: 'eth_sendUserOperation'
|
|
75
|
+
params: [
|
|
76
|
+
userOperation: UserOperation.Rpc<entryPointVersion>,
|
|
77
|
+
entrypoint: Address.Address,
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
ReturnType: Hex.Hex
|
|
81
|
+
}
|
|
82
|
+
| {
|
|
83
|
+
Request: {
|
|
84
|
+
method: 'eth_supportedEntryPoints'
|
|
85
|
+
params?: undefined
|
|
86
|
+
}
|
|
87
|
+
ReturnType: readonly Address.Address[]
|
|
88
|
+
}
|
|
89
|
+
>
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Union of all JSON-RPC Methods for the debug methods of ERC-4337 Bundlers.
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```ts twoslash
|
|
96
|
+
* import { RpcSchema } from 'ox'
|
|
97
|
+
*
|
|
98
|
+
* type Schema = RpcSchema.BundlerDebug
|
|
99
|
+
* // ^?
|
|
100
|
+
*
|
|
101
|
+
*
|
|
102
|
+
*
|
|
103
|
+
*
|
|
104
|
+
*
|
|
105
|
+
*
|
|
106
|
+
*
|
|
107
|
+
*
|
|
108
|
+
*
|
|
109
|
+
*
|
|
110
|
+
*
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
export type BundlerDebug<
|
|
114
|
+
entryPointVersion extends EntryPoint.Version = EntryPoint.Version,
|
|
115
|
+
> = RpcSchema.From<
|
|
116
|
+
| {
|
|
117
|
+
Request: {
|
|
118
|
+
method: 'debug_bundler_clearState'
|
|
119
|
+
params?: undefined
|
|
120
|
+
}
|
|
121
|
+
ReturnType: undefined
|
|
122
|
+
}
|
|
123
|
+
| {
|
|
124
|
+
Request: {
|
|
125
|
+
method: 'debug_bundler_dumpMempool'
|
|
126
|
+
params: [entryPoint: Address.Address]
|
|
127
|
+
}
|
|
128
|
+
ReturnType: readonly { userOp: UserOperation.Rpc }[]
|
|
129
|
+
}
|
|
130
|
+
| {
|
|
131
|
+
Request: {
|
|
132
|
+
method: 'debug_bundler_sendBundleNow'
|
|
133
|
+
params?: undefined
|
|
134
|
+
}
|
|
135
|
+
ReturnType: Hex.Hex
|
|
136
|
+
}
|
|
137
|
+
| {
|
|
138
|
+
Request: {
|
|
139
|
+
method: 'debug_bundler_setBundlingMode'
|
|
140
|
+
params: [mode: 'auto' | 'manual']
|
|
141
|
+
}
|
|
142
|
+
ReturnType: undefined
|
|
143
|
+
}
|
|
144
|
+
| {
|
|
145
|
+
Request: {
|
|
146
|
+
method: 'debug_bundler_setReputation'
|
|
147
|
+
params: [
|
|
148
|
+
reputations: readonly {
|
|
149
|
+
address: Address.Address
|
|
150
|
+
opsSeen: Hex.Hex
|
|
151
|
+
opsIncluded: Hex.Hex
|
|
152
|
+
}[],
|
|
153
|
+
entryPoint: Address.Address,
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
ReturnType: undefined
|
|
157
|
+
}
|
|
158
|
+
| {
|
|
159
|
+
Request: {
|
|
160
|
+
method: 'debug_bundler_dumpReputation'
|
|
161
|
+
params: [entryPoint: Address.Address]
|
|
162
|
+
}
|
|
163
|
+
ReturnType: readonly {
|
|
164
|
+
address: Address.Address
|
|
165
|
+
opsSeen: Hex.Hex
|
|
166
|
+
opsIncluded: Hex.Hex
|
|
167
|
+
}[]
|
|
168
|
+
}
|
|
169
|
+
| {
|
|
170
|
+
Request: {
|
|
171
|
+
method: 'debug_bundler_addUserOps'
|
|
172
|
+
params: [
|
|
173
|
+
userOps: readonly UserOperation.Rpc<entryPointVersion>[],
|
|
174
|
+
entryPoint: Address.Address,
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
ReturnType: undefined
|
|
178
|
+
}
|
|
179
|
+
>
|