ox 0.4.3 → 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.
Files changed (66) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/_cjs/core/Siwe.js +1 -1
  3. package/_cjs/core/Siwe.js.map +1 -1
  4. package/_cjs/erc4337/EntryPoint.js +1320 -0
  5. package/_cjs/erc4337/EntryPoint.js.map +1 -0
  6. package/_cjs/erc4337/RpcSchema.js +3 -0
  7. package/_cjs/erc4337/RpcSchema.js.map +1 -0
  8. package/_cjs/erc4337/UserOperation.js +152 -0
  9. package/_cjs/erc4337/UserOperation.js.map +1 -0
  10. package/_cjs/erc4337/UserOperationGas.js +31 -0
  11. package/_cjs/erc4337/UserOperationGas.js.map +1 -0
  12. package/_cjs/erc4337/UserOperationReceipt.js +35 -0
  13. package/_cjs/erc4337/UserOperationReceipt.js.map +1 -0
  14. package/_cjs/erc4337/index.js +9 -0
  15. package/_cjs/erc4337/index.js.map +1 -0
  16. package/_cjs/index.docs.js +1 -0
  17. package/_cjs/index.docs.js.map +1 -1
  18. package/_cjs/version.js +1 -1
  19. package/_esm/core/Siwe.js +1 -1
  20. package/_esm/core/Siwe.js.map +1 -1
  21. package/_esm/erc4337/EntryPoint.js +1321 -0
  22. package/_esm/erc4337/EntryPoint.js.map +1 -0
  23. package/_esm/erc4337/RpcSchema.js +2 -0
  24. package/_esm/erc4337/RpcSchema.js.map +1 -0
  25. package/_esm/erc4337/UserOperation.js +324 -0
  26. package/_esm/erc4337/UserOperation.js.map +1 -0
  27. package/_esm/erc4337/UserOperationGas.js +61 -0
  28. package/_esm/erc4337/UserOperationGas.js.map +1 -0
  29. package/_esm/erc4337/UserOperationReceipt.js +79 -0
  30. package/_esm/erc4337/UserOperationReceipt.js.map +1 -0
  31. package/_esm/erc4337/index.js +31 -0
  32. package/_esm/erc4337/index.js.map +1 -0
  33. package/_esm/index.docs.js +1 -0
  34. package/_esm/index.docs.js.map +1 -1
  35. package/_esm/version.js +1 -1
  36. package/_types/erc4337/EntryPoint.d.ts +1480 -0
  37. package/_types/erc4337/EntryPoint.d.ts.map +1 -0
  38. package/_types/erc4337/RpcSchema.d.ts +159 -0
  39. package/_types/erc4337/RpcSchema.d.ts.map +1 -0
  40. package/_types/erc4337/UserOperation.d.ts +330 -0
  41. package/_types/erc4337/UserOperation.d.ts.map +1 -0
  42. package/_types/erc4337/UserOperationGas.d.ts +62 -0
  43. package/_types/erc4337/UserOperationGas.d.ts.map +1 -0
  44. package/_types/erc4337/UserOperationReceipt.d.ts +87 -0
  45. package/_types/erc4337/UserOperationReceipt.d.ts.map +1 -0
  46. package/_types/erc4337/index.d.ts +33 -0
  47. package/_types/erc4337/index.d.ts.map +1 -0
  48. package/_types/index.docs.d.ts +1 -0
  49. package/_types/index.docs.d.ts.map +1 -1
  50. package/_types/version.d.ts +1 -1
  51. package/core/Siwe.ts +1 -1
  52. package/erc4337/EntryPoint/package.json +6 -0
  53. package/erc4337/EntryPoint.ts +1419 -0
  54. package/erc4337/RpcSchema/package.json +6 -0
  55. package/erc4337/RpcSchema.ts +179 -0
  56. package/erc4337/UserOperation/package.json +6 -0
  57. package/erc4337/UserOperation.ts +617 -0
  58. package/erc4337/UserOperationGas/package.json +6 -0
  59. package/erc4337/UserOperationGas.ts +109 -0
  60. package/erc4337/UserOperationReceipt/package.json +6 -0
  61. package/erc4337/UserOperationReceipt.ts +139 -0
  62. package/erc4337/index.ts +38 -0
  63. package/erc4337/package.json +6 -0
  64. package/index.docs.ts +1 -0
  65. package/package.json +31 -1
  66. package/version.ts +1 -1
@@ -0,0 +1,6 @@
1
+ {
2
+ "type": "module",
3
+ "types": "../../_types/erc4337/RpcSchema.d.ts",
4
+ "main": "../../_cjs/erc4337/RpcSchema.js",
5
+ "module": "../../_esm/erc4337/RpcSchema.js"
6
+ }
@@ -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
+ >
@@ -0,0 +1,6 @@
1
+ {
2
+ "type": "module",
3
+ "types": "../../_types/erc4337/UserOperation.d.ts",
4
+ "main": "../../_cjs/erc4337/UserOperation.js",
5
+ "module": "../../_esm/erc4337/UserOperation.js"
6
+ }