@coinbase/cdp-core 0.0.54 → 0.0.55

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 (180) hide show
  1. package/dist/esm/index.native125.js +2 -2
  2. package/dist/esm/index.native128.js +1 -1
  3. package/dist/esm/index.native131.js +19 -77
  4. package/dist/esm/index.native132.js +10 -4
  5. package/dist/esm/index.native133.js +19 -20
  6. package/dist/esm/index.native134.js +93 -9
  7. package/dist/esm/index.native135.js +19 -18
  8. package/dist/esm/index.native136.js +105 -81
  9. package/dist/esm/index.native137.js +78 -20
  10. package/dist/esm/index.native138.js +4 -118
  11. package/dist/esm/index.native143.js +7 -38
  12. package/dist/esm/index.native145.js +375 -67
  13. package/dist/esm/index.native146.js +832 -34
  14. package/dist/esm/index.native147.js +38 -20
  15. package/dist/esm/index.native148.js +2 -8
  16. package/dist/esm/index.native149.js +70 -2
  17. package/dist/esm/index.native150.js +30 -373
  18. package/dist/esm/index.native151.js +20 -832
  19. package/dist/esm/index.native154.js +1 -1
  20. package/dist/esm/index.native160.js +1 -1
  21. package/dist/esm/index.native162.js +2 -2
  22. package/dist/esm/index.native163.js +2 -2
  23. package/dist/esm/index.native164.js +2 -2
  24. package/dist/esm/index.native25.js +1 -1
  25. package/dist/esm/index.native35.js +3 -3
  26. package/dist/esm/index.native41.js +3 -3
  27. package/dist/esm/index.native46.js +13 -373
  28. package/dist/esm/index.native47.js +22 -28
  29. package/dist/esm/index.native48.js +50 -28
  30. package/dist/esm/index.native49.js +373 -13
  31. package/dist/esm/index.native50.js +28 -22
  32. package/dist/esm/index.native51.js +28 -50
  33. package/dist/esm/index.native96.js +7 -7
  34. package/dist/esm/index.web100.js +4 -8
  35. package/dist/esm/index.web101.js +2 -8
  36. package/dist/esm/index.web102.js +4 -71
  37. package/dist/esm/index.web103.js +12 -12
  38. package/dist/esm/index.web104.js +7 -3
  39. package/dist/esm/index.web105.js +3 -4
  40. package/dist/esm/index.web106.js +19 -4
  41. package/dist/esm/index.web107.js +8 -4
  42. package/dist/esm/index.web108.js +7 -19
  43. package/dist/esm/index.web109.js +66 -47
  44. package/dist/esm/index.web110.js +18 -17
  45. package/dist/esm/index.web111.js +3 -20
  46. package/dist/esm/index.web112.js +4 -8
  47. package/dist/esm/index.web113.js +4 -30
  48. package/dist/esm/index.web114.js +4 -7
  49. package/dist/esm/index.web115.js +10 -11
  50. package/dist/esm/index.web116.js +52 -4
  51. package/dist/esm/index.web117.js +17 -54
  52. package/dist/esm/index.web118.js +20 -10
  53. package/dist/esm/index.web119.js +9 -2
  54. package/dist/esm/index.web120.js +30 -44
  55. package/dist/esm/index.web121.js +7 -13
  56. package/dist/esm/index.web122.js +21 -2
  57. package/dist/esm/index.web124.js +1 -1
  58. package/dist/esm/index.web131.js +20 -3
  59. package/dist/esm/index.web132.js +10 -2
  60. package/dist/esm/index.web133.js +18 -107
  61. package/dist/esm/index.web134.js +94 -2
  62. package/dist/esm/index.web135.js +20 -20
  63. package/dist/esm/index.web136.js +117 -9
  64. package/dist/esm/index.web137.js +2 -20
  65. package/dist/esm/index.web138.js +104 -89
  66. package/dist/esm/index.web139.js +2 -21
  67. package/dist/esm/index.web140.js +4 -118
  68. package/dist/esm/index.web141.js +1 -1
  69. package/dist/esm/index.web153.js +1 -1
  70. package/dist/esm/index.web158.js +1 -1
  71. package/dist/esm/index.web159.js +1 -1
  72. package/dist/esm/index.web34.js +3 -3
  73. package/dist/esm/index.web40.js +3 -3
  74. package/dist/esm/index.web45.js +13 -373
  75. package/dist/esm/index.web46.js +22 -28
  76. package/dist/esm/index.web47.js +50 -28
  77. package/dist/esm/index.web48.js +379 -2
  78. package/dist/esm/index.web49.js +2 -68
  79. package/dist/esm/index.web50.js +37 -336
  80. package/dist/esm/index.web51.js +360 -12
  81. package/dist/esm/index.web52.js +28 -22
  82. package/dist/esm/index.web53.js +28 -50
  83. package/dist/esm/index.web71.js +1 -1
  84. package/dist/esm/index.web95.js +54 -4
  85. package/dist/esm/index.web96.js +10 -18
  86. package/dist/esm/index.web97.js +2 -8
  87. package/dist/esm/index.web98.js +45 -4
  88. package/dist/esm/index.web99.js +13 -19
  89. package/dist/native/index.native125.js +2 -2
  90. package/dist/native/index.native128.js +1 -1
  91. package/dist/native/index.native131.js +19 -77
  92. package/dist/native/index.native132.js +10 -4
  93. package/dist/native/index.native133.js +19 -20
  94. package/dist/native/index.native134.js +93 -9
  95. package/dist/native/index.native135.js +19 -18
  96. package/dist/native/index.native136.js +105 -81
  97. package/dist/native/index.native137.js +78 -20
  98. package/dist/native/index.native138.js +4 -118
  99. package/dist/native/index.native143.js +7 -38
  100. package/dist/native/index.native145.js +375 -67
  101. package/dist/native/index.native146.js +832 -34
  102. package/dist/native/index.native147.js +38 -20
  103. package/dist/native/index.native148.js +2 -8
  104. package/dist/native/index.native149.js +70 -2
  105. package/dist/native/index.native150.js +30 -373
  106. package/dist/native/index.native151.js +20 -832
  107. package/dist/native/index.native154.js +1 -1
  108. package/dist/native/index.native160.js +1 -1
  109. package/dist/native/index.native162.js +2 -2
  110. package/dist/native/index.native163.js +2 -2
  111. package/dist/native/index.native164.js +2 -2
  112. package/dist/native/index.native25.js +1 -1
  113. package/dist/native/index.native35.js +3 -3
  114. package/dist/native/index.native41.js +3 -3
  115. package/dist/native/index.native46.js +13 -373
  116. package/dist/native/index.native47.js +22 -28
  117. package/dist/native/index.native48.js +50 -28
  118. package/dist/native/index.native49.js +373 -13
  119. package/dist/native/index.native50.js +28 -22
  120. package/dist/native/index.native51.js +28 -50
  121. package/dist/native/index.native96.js +7 -7
  122. package/dist/native-types/types.d.ts +3 -1
  123. package/dist/types/types.d.ts +3 -1
  124. package/dist/web/index.web100.js +4 -8
  125. package/dist/web/index.web101.js +2 -8
  126. package/dist/web/index.web102.js +4 -71
  127. package/dist/web/index.web103.js +12 -12
  128. package/dist/web/index.web104.js +7 -3
  129. package/dist/web/index.web105.js +3 -4
  130. package/dist/web/index.web106.js +19 -4
  131. package/dist/web/index.web107.js +8 -4
  132. package/dist/web/index.web108.js +7 -19
  133. package/dist/web/index.web109.js +66 -47
  134. package/dist/web/index.web110.js +18 -17
  135. package/dist/web/index.web111.js +3 -20
  136. package/dist/web/index.web112.js +4 -8
  137. package/dist/web/index.web113.js +4 -30
  138. package/dist/web/index.web114.js +4 -7
  139. package/dist/web/index.web115.js +10 -11
  140. package/dist/web/index.web116.js +52 -4
  141. package/dist/web/index.web117.js +17 -54
  142. package/dist/web/index.web118.js +20 -10
  143. package/dist/web/index.web119.js +9 -2
  144. package/dist/web/index.web120.js +30 -44
  145. package/dist/web/index.web121.js +7 -13
  146. package/dist/web/index.web122.js +21 -2
  147. package/dist/web/index.web124.js +1 -1
  148. package/dist/web/index.web131.js +20 -3
  149. package/dist/web/index.web132.js +10 -2
  150. package/dist/web/index.web133.js +18 -107
  151. package/dist/web/index.web134.js +94 -2
  152. package/dist/web/index.web135.js +20 -20
  153. package/dist/web/index.web136.js +117 -9
  154. package/dist/web/index.web137.js +2 -20
  155. package/dist/web/index.web138.js +104 -89
  156. package/dist/web/index.web139.js +2 -21
  157. package/dist/web/index.web140.js +4 -118
  158. package/dist/web/index.web141.js +1 -1
  159. package/dist/web/index.web153.js +1 -1
  160. package/dist/web/index.web158.js +1 -1
  161. package/dist/web/index.web159.js +1 -1
  162. package/dist/web/index.web34.js +3 -3
  163. package/dist/web/index.web40.js +3 -3
  164. package/dist/web/index.web45.js +13 -373
  165. package/dist/web/index.web46.js +22 -28
  166. package/dist/web/index.web47.js +50 -28
  167. package/dist/web/index.web48.js +379 -2
  168. package/dist/web/index.web49.js +2 -68
  169. package/dist/web/index.web50.js +37 -336
  170. package/dist/web/index.web51.js +360 -12
  171. package/dist/web/index.web52.js +28 -22
  172. package/dist/web/index.web53.js +28 -50
  173. package/dist/web/index.web71.js +1 -1
  174. package/dist/web/index.web95.js +54 -4
  175. package/dist/web/index.web96.js +10 -18
  176. package/dist/web/index.web97.js +2 -8
  177. package/dist/web/index.web98.js +45 -4
  178. package/dist/web/index.web99.js +13 -19
  179. package/dist/web-types/types.d.ts +3 -1
  180. package/package.json +2 -2
@@ -1,19 +1,379 @@
1
- import { FlattenedSign as n } from "./index.native96.js";
2
- class o {
3
- #e;
4
- constructor(e) {
5
- this.#e = new n(e);
1
+ import "./index.native54.js";
2
+ import { BaseError as P } from "./index.native55.js";
3
+ import { parse as y, parseError as j, InternalError as g } from "./index.native56.js";
4
+ class u extends Error {
5
+ constructor(e, t) {
6
+ super(t), Object.defineProperty(this, "name", {
7
+ enumerable: !0,
8
+ configurable: !0,
9
+ writable: !0,
10
+ value: "ProviderRpcError"
11
+ }), Object.defineProperty(this, "code", {
12
+ enumerable: !0,
13
+ configurable: !0,
14
+ writable: !0,
15
+ value: void 0
16
+ }), Object.defineProperty(this, "details", {
17
+ enumerable: !0,
18
+ configurable: !0,
19
+ writable: !0,
20
+ value: void 0
21
+ }), this.code = e, this.details = t;
6
22
  }
7
- setProtectedHeader(e) {
8
- return this.#e.setProtectedHeader(e), this;
23
+ }
24
+ class n extends u {
25
+ constructor({ message: e = "The user rejected the request." } = {}) {
26
+ super(4001, e), Object.defineProperty(this, "code", {
27
+ enumerable: !0,
28
+ configurable: !0,
29
+ writable: !0,
30
+ value: 4001
31
+ }), Object.defineProperty(this, "name", {
32
+ enumerable: !0,
33
+ configurable: !0,
34
+ writable: !0,
35
+ value: "Provider.UserRejectedRequestError"
36
+ });
37
+ }
38
+ }
39
+ Object.defineProperty(n, "code", {
40
+ enumerable: !0,
41
+ configurable: !0,
42
+ writable: !0,
43
+ value: 4001
44
+ });
45
+ class a extends u {
46
+ constructor({ message: e = "The requested method and/or account has not been authorized by the user." } = {}) {
47
+ super(4100, e), Object.defineProperty(this, "code", {
48
+ enumerable: !0,
49
+ configurable: !0,
50
+ writable: !0,
51
+ value: 4100
52
+ }), Object.defineProperty(this, "name", {
53
+ enumerable: !0,
54
+ configurable: !0,
55
+ writable: !0,
56
+ value: "Provider.UnauthorizedError"
57
+ });
58
+ }
59
+ }
60
+ Object.defineProperty(a, "code", {
61
+ enumerable: !0,
62
+ configurable: !0,
63
+ writable: !0,
64
+ value: 4100
65
+ });
66
+ class i extends u {
67
+ constructor({ message: e = "The provider does not support the requested method." } = {}) {
68
+ super(4200, e), Object.defineProperty(this, "code", {
69
+ enumerable: !0,
70
+ configurable: !0,
71
+ writable: !0,
72
+ value: 4200
73
+ }), Object.defineProperty(this, "name", {
74
+ enumerable: !0,
75
+ configurable: !0,
76
+ writable: !0,
77
+ value: "Provider.UnsupportedMethodError"
78
+ });
79
+ }
80
+ }
81
+ Object.defineProperty(i, "code", {
82
+ enumerable: !0,
83
+ configurable: !0,
84
+ writable: !0,
85
+ value: 4200
86
+ });
87
+ class c extends u {
88
+ constructor({ message: e = "The provider is disconnected from all chains." } = {}) {
89
+ super(4900, e), Object.defineProperty(this, "code", {
90
+ enumerable: !0,
91
+ configurable: !0,
92
+ writable: !0,
93
+ value: 4900
94
+ }), Object.defineProperty(this, "name", {
95
+ enumerable: !0,
96
+ configurable: !0,
97
+ writable: !0,
98
+ value: "Provider.DisconnectedError"
99
+ });
100
+ }
101
+ }
102
+ Object.defineProperty(c, "code", {
103
+ enumerable: !0,
104
+ configurable: !0,
105
+ writable: !0,
106
+ value: 4900
107
+ });
108
+ class l extends u {
109
+ constructor({ message: e = "The provider is not connected to the requested chain." } = {}) {
110
+ super(4901, e), Object.defineProperty(this, "code", {
111
+ enumerable: !0,
112
+ configurable: !0,
113
+ writable: !0,
114
+ value: 4901
115
+ }), Object.defineProperty(this, "name", {
116
+ enumerable: !0,
117
+ configurable: !0,
118
+ writable: !0,
119
+ value: "Provider.ChainDisconnectedError"
120
+ });
121
+ }
122
+ }
123
+ Object.defineProperty(l, "code", {
124
+ enumerable: !0,
125
+ configurable: !0,
126
+ writable: !0,
127
+ value: 4901
128
+ });
129
+ class d extends u {
130
+ constructor({ message: e = "An error occurred when attempting to switch chain." } = {}) {
131
+ super(4902, e), Object.defineProperty(this, "code", {
132
+ enumerable: !0,
133
+ configurable: !0,
134
+ writable: !0,
135
+ value: 4902
136
+ }), Object.defineProperty(this, "name", {
137
+ enumerable: !0,
138
+ configurable: !0,
139
+ writable: !0,
140
+ value: "Provider.SwitchChainError"
141
+ });
142
+ }
143
+ }
144
+ Object.defineProperty(d, "code", {
145
+ enumerable: !0,
146
+ configurable: !0,
147
+ writable: !0,
148
+ value: 4902
149
+ });
150
+ class b extends u {
151
+ constructor({ message: e = "This Wallet does not support a capability that was not marked as optional." } = {}) {
152
+ super(5700, e), Object.defineProperty(this, "code", {
153
+ enumerable: !0,
154
+ configurable: !0,
155
+ writable: !0,
156
+ value: 5700
157
+ }), Object.defineProperty(this, "name", {
158
+ enumerable: !0,
159
+ configurable: !0,
160
+ writable: !0,
161
+ value: "Provider.UnsupportedNonOptionalCapabilityError"
162
+ });
163
+ }
164
+ }
165
+ Object.defineProperty(b, "code", {
166
+ enumerable: !0,
167
+ configurable: !0,
168
+ writable: !0,
169
+ value: 5700
170
+ });
171
+ class s extends u {
172
+ constructor({ message: e = "This Wallet does not support the requested chain ID." } = {}) {
173
+ super(5710, e), Object.defineProperty(this, "code", {
174
+ enumerable: !0,
175
+ configurable: !0,
176
+ writable: !0,
177
+ value: 5710
178
+ }), Object.defineProperty(this, "name", {
179
+ enumerable: !0,
180
+ configurable: !0,
181
+ writable: !0,
182
+ value: "Provider.UnsupportedChainIdError"
183
+ });
9
184
  }
10
- async sign(e, r) {
11
- const t = await this.#e.sign(e, r);
12
- if (t.payload === void 0)
13
- throw new TypeError("use the flattened module for creating JWS with b64: false");
14
- return `${t.protected}.${t.payload}.${t.signature}`;
185
+ }
186
+ Object.defineProperty(s, "code", {
187
+ enumerable: !0,
188
+ configurable: !0,
189
+ writable: !0,
190
+ value: 5710
191
+ });
192
+ class f extends u {
193
+ constructor({ message: e = "There is already a bundle submitted with this ID." } = {}) {
194
+ super(5720, e), Object.defineProperty(this, "code", {
195
+ enumerable: !0,
196
+ configurable: !0,
197
+ writable: !0,
198
+ value: 5720
199
+ }), Object.defineProperty(this, "name", {
200
+ enumerable: !0,
201
+ configurable: !0,
202
+ writable: !0,
203
+ value: "Provider.DuplicateIdError"
204
+ });
205
+ }
206
+ }
207
+ Object.defineProperty(f, "code", {
208
+ enumerable: !0,
209
+ configurable: !0,
210
+ writable: !0,
211
+ value: 5720
212
+ });
213
+ class p extends u {
214
+ constructor({ message: e = "This bundle id is unknown / has not been submitted." } = {}) {
215
+ super(5730, e), Object.defineProperty(this, "code", {
216
+ enumerable: !0,
217
+ configurable: !0,
218
+ writable: !0,
219
+ value: 5730
220
+ }), Object.defineProperty(this, "name", {
221
+ enumerable: !0,
222
+ configurable: !0,
223
+ writable: !0,
224
+ value: "Provider.UnknownBundleIdError"
225
+ });
226
+ }
227
+ }
228
+ Object.defineProperty(p, "code", {
229
+ enumerable: !0,
230
+ configurable: !0,
231
+ writable: !0,
232
+ value: 5730
233
+ });
234
+ class h extends u {
235
+ constructor({ message: e = "The call bundle is too large for the Wallet to process." } = {}) {
236
+ super(5740, e), Object.defineProperty(this, "code", {
237
+ enumerable: !0,
238
+ configurable: !0,
239
+ writable: !0,
240
+ value: 5740
241
+ }), Object.defineProperty(this, "name", {
242
+ enumerable: !0,
243
+ configurable: !0,
244
+ writable: !0,
245
+ value: "Provider.BundleTooLargeError"
246
+ });
247
+ }
248
+ }
249
+ Object.defineProperty(h, "code", {
250
+ enumerable: !0,
251
+ configurable: !0,
252
+ writable: !0,
253
+ value: 5740
254
+ });
255
+ class m extends u {
256
+ constructor({ message: e = "The Wallet can support atomicity after an upgrade, but the user rejected the upgrade." } = {}) {
257
+ super(5750, e), Object.defineProperty(this, "code", {
258
+ enumerable: !0,
259
+ configurable: !0,
260
+ writable: !0,
261
+ value: 5750
262
+ }), Object.defineProperty(this, "name", {
263
+ enumerable: !0,
264
+ configurable: !0,
265
+ writable: !0,
266
+ value: "Provider.AtomicReadyWalletRejectedUpgradeError"
267
+ });
268
+ }
269
+ }
270
+ Object.defineProperty(m, "code", {
271
+ enumerable: !0,
272
+ configurable: !0,
273
+ writable: !0,
274
+ value: 5750
275
+ });
276
+ class w extends u {
277
+ constructor({ message: e = "The wallet does not support atomic execution but the request requires it." } = {}) {
278
+ super(5760, e), Object.defineProperty(this, "code", {
279
+ enumerable: !0,
280
+ configurable: !0,
281
+ writable: !0,
282
+ value: 5760
283
+ }), Object.defineProperty(this, "name", {
284
+ enumerable: !0,
285
+ configurable: !0,
286
+ writable: !0,
287
+ value: "Provider.AtomicityNotSupportedError"
288
+ });
289
+ }
290
+ }
291
+ Object.defineProperty(w, "code", {
292
+ enumerable: !0,
293
+ configurable: !0,
294
+ writable: !0,
295
+ value: 5760
296
+ });
297
+ function q(r, e = {}) {
298
+ const { includeEvents: t = !0 } = e;
299
+ if (!r)
300
+ throw new E();
301
+ return {
302
+ ...t ? {
303
+ on: r.on?.bind(r),
304
+ removeListener: r.removeListener?.bind(r)
305
+ } : {},
306
+ async request(v) {
307
+ try {
308
+ const o = await r.request(v);
309
+ return o && typeof o == "object" && "jsonrpc" in o ? y(o) : o;
310
+ } catch (o) {
311
+ throw O(o);
312
+ }
313
+ }
314
+ };
315
+ }
316
+ function O(r) {
317
+ const e = j(r);
318
+ if (e instanceof g) {
319
+ if (!e.data)
320
+ return e;
321
+ const { code: t } = e.data;
322
+ if (t === c.code)
323
+ return new c(e);
324
+ if (t === l.code)
325
+ return new l(e);
326
+ if (t === n.code)
327
+ return new n(e);
328
+ if (t === a.code)
329
+ return new a(e);
330
+ if (t === i.code)
331
+ return new i(e);
332
+ if (t === d.code)
333
+ return new d(e);
334
+ if (t === m.code)
335
+ return new m(e);
336
+ if (t === w.code)
337
+ return new w(e);
338
+ if (t === h.code)
339
+ return new h(e);
340
+ if (t === p.code)
341
+ return new p(e);
342
+ if (t === f.code)
343
+ return new f(e);
344
+ if (t === s.code)
345
+ return new s(e);
346
+ if (t === b.code)
347
+ return new b(e);
348
+ }
349
+ return e;
350
+ }
351
+ class E extends P {
352
+ constructor() {
353
+ super("`provider` is undefined."), Object.defineProperty(this, "name", {
354
+ enumerable: !0,
355
+ configurable: !0,
356
+ writable: !0,
357
+ value: "Provider.IsUndefinedError"
358
+ });
15
359
  }
16
360
  }
17
361
  export {
18
- o as CompactSign
362
+ m as AtomicReadyWalletRejectedUpgradeError,
363
+ w as AtomicityNotSupportedError,
364
+ h as BundleTooLargeError,
365
+ l as ChainDisconnectedError,
366
+ c as DisconnectedError,
367
+ f as DuplicateIdError,
368
+ E as IsUndefinedError,
369
+ u as ProviderRpcError,
370
+ d as SwitchChainError,
371
+ a as UnauthorizedError,
372
+ p as UnknownBundleIdError,
373
+ s as UnsupportedChainIdError,
374
+ i as UnsupportedMethodError,
375
+ b as UnsupportedNonOptionalCapabilityError,
376
+ n as UserRejectedRequestError,
377
+ q as from,
378
+ O as parseError
19
379
  };
@@ -1,25 +1,31 @@
1
- class c extends Error {
2
- static code = "ERR_JOSE_GENERIC";
3
- code = "ERR_JOSE_GENERIC";
4
- constructor(s, e) {
5
- super(s, e), this.name = this.constructor.name, Error.captureStackTrace?.(this, this.constructor);
6
- }
7
- }
8
- class E extends c {
9
- static code = "ERR_JOSE_NOT_SUPPORTED";
10
- code = "ERR_JOSE_NOT_SUPPORTED";
11
- }
12
- class o extends c {
13
- static code = "ERR_JWS_INVALID";
14
- code = "ERR_JWS_INVALID";
15
- }
16
- class r extends c {
17
- static code = "ERR_JWT_INVALID";
18
- code = "ERR_JWT_INVALID";
1
+ import { handleAccounts as t } from "./index.native103.js";
2
+ import { handleEthSign as e } from "./index.native104.js";
3
+ import { handleGetCallsStatus as a } from "./index.native105.js";
4
+ import { handleGetCapabilities as n } from "./index.native106.js";
5
+ import { handlePersonalSign as o } from "./index.native107.js";
6
+ import { handleRequestAccounts as r } from "./index.native108.js";
7
+ import { handleSendCalls as i } from "./index.native109.js";
8
+ import { handleSendTransaction as l } from "./index.native110.js";
9
+ import { handleSignTypedData as h } from "./index.native111.js";
10
+ import { handleChainId as s } from "./index.native112.js";
11
+ import { handleDisconnect as m } from "./index.native113.js";
12
+ import { handleSwitchEthereumChain as d } from "./index.native114.js";
13
+ function D() {
14
+ return {
15
+ eth_accounts: t,
16
+ eth_requestAccounts: r,
17
+ personal_sign: o,
18
+ eth_sendTransaction: l,
19
+ eth_signTypedData_v4: h,
20
+ wallet_disconnect: m,
21
+ wallet_switchEthereumChain: d,
22
+ eth_sign: e,
23
+ eth_chainId: s,
24
+ wallet_sendCalls: i,
25
+ wallet_getCallsStatus: a,
26
+ wallet_getCapabilities: n
27
+ };
19
28
  }
20
29
  export {
21
- c as JOSEError,
22
- E as JOSENotSupported,
23
- o as JWSInvalid,
24
- r as JWTInvalid
30
+ D as createEOAHandlers
25
31
  };
@@ -1,53 +1,31 @@
1
- import { encoder as n } from "./index.native97.js";
2
- import e from "./index.native98.js";
3
- import i from "./index.native99.js";
4
- import o from "./index.native100.js";
5
- function s(r, t) {
6
- if (!Number.isFinite(t))
7
- throw new TypeError(`Invalid ${r} input`);
8
- return t;
9
- }
10
- class d {
11
- #t;
12
- constructor(t) {
13
- if (!o(t))
14
- throw new TypeError("JWT Claims Set MUST be an object");
15
- this.#t = structuredClone(t);
16
- }
17
- data() {
18
- return n.encode(JSON.stringify(this.#t));
19
- }
20
- get iss() {
21
- return this.#t.iss;
22
- }
23
- set iss(t) {
24
- this.#t.iss = t;
25
- }
26
- get sub() {
27
- return this.#t.sub;
28
- }
29
- set sub(t) {
30
- this.#t.sub = t;
31
- }
32
- get aud() {
33
- return this.#t.aud;
34
- }
35
- set aud(t) {
36
- this.#t.aud = t;
37
- }
38
- set jti(t) {
39
- this.#t.jti = t;
40
- }
41
- set nbf(t) {
42
- typeof t == "number" ? this.#t.nbf = s("setNotBefore", t) : t instanceof Date ? this.#t.nbf = s("setNotBefore", e(t)) : this.#t.nbf = e(/* @__PURE__ */ new Date()) + i(t);
43
- }
44
- set exp(t) {
45
- typeof t == "number" ? this.#t.exp = s("setExpirationTime", t) : t instanceof Date ? this.#t.exp = s("setExpirationTime", e(t)) : this.#t.exp = e(/* @__PURE__ */ new Date()) + i(t);
46
- }
47
- set iat(t) {
48
- typeof t > "u" ? this.#t.iat = e(/* @__PURE__ */ new Date()) : t instanceof Date ? this.#t.iat = s("setIssuedAt", e(t)) : typeof t == "string" ? this.#t.iat = s("setIssuedAt", e(/* @__PURE__ */ new Date()) + i(t)) : this.#t.iat = s("setIssuedAt", t);
49
- }
1
+ import { handleChainId as t } from "./index.native112.js";
2
+ import { handleDisconnect as e } from "./index.native113.js";
3
+ import { handleSwitchEthereumChain as a } from "./index.native114.js";
4
+ import { handleAccounts as n } from "./index.native115.js";
5
+ import { handleEthSign as o } from "./index.native116.js";
6
+ import { handleGetCallsStatus as r } from "./index.native117.js";
7
+ import { handleGetCapabilities as i } from "./index.native118.js";
8
+ import { handlePersonalSign as l } from "./index.native119.js";
9
+ import { handleRequestAccounts as h } from "./index.native120.js";
10
+ import { handleSendCalls as m } from "./index.native121.js";
11
+ import { handleSendTransaction as s } from "./index.native122.js";
12
+ import { handleSignTypedData as d } from "./index.native123.js";
13
+ function E() {
14
+ return {
15
+ eth_accounts: n,
16
+ eth_requestAccounts: h,
17
+ personal_sign: l,
18
+ eth_sendTransaction: s,
19
+ eth_signTypedData_v4: d,
20
+ wallet_disconnect: e,
21
+ wallet_switchEthereumChain: a,
22
+ eth_sign: o,
23
+ eth_chainId: t,
24
+ wallet_sendCalls: m,
25
+ wallet_getCallsStatus: r,
26
+ wallet_getCapabilities: i
27
+ };
50
28
  }
51
29
  export {
52
- d as JWTClaimsBuilder
30
+ E as createSmartAccountHandlers
53
31
  };
@@ -1,11 +1,11 @@
1
- import { encode as d } from "./index.native133.js";
2
- import y from "./index.native134.js";
3
- import b from "./index.native135.js";
4
- import { JWSInvalid as r } from "./index.native50.js";
1
+ import { encode as d } from "./index.native131.js";
2
+ import y from "./index.native132.js";
3
+ import b from "./index.native133.js";
4
+ import { JWSInvalid as r } from "./index.native47.js";
5
5
  import { encoder as s, concat as u, decoder as h } from "./index.native97.js";
6
- import g from "./index.native136.js";
7
- import H from "./index.native137.js";
8
- import P from "./index.native138.js";
6
+ import g from "./index.native134.js";
7
+ import H from "./index.native135.js";
8
+ import P from "./index.native136.js";
9
9
  class x {
10
10
  #r;
11
11
  #e;
@@ -1,11 +1,7 @@
1
- import { fromNumber as c } from "./index.web141.js";
2
- import { validateUserConnected as o } from "./index.web19.js";
3
- async function i(t, e) {
4
- const n = await o();
5
- return t.emit("connect", {
6
- chainId: c(e.getState().chainId)
7
- }), n.evmAccounts || [];
1
+ import { version as r } from "./index.web137.js";
2
+ function e() {
3
+ return r;
8
4
  }
9
5
  export {
10
- i as handleRequestAccounts
6
+ e as getVersion
11
7
  };
@@ -1,10 +1,4 @@
1
- import { EIP1193ProviderError as r, STANDARD_ERROR_CODES as o } from "./index.web19.js";
2
- async function n(e, t) {
3
- throw new r(
4
- o.provider.unsupportedMethod,
5
- "wallet_sendCalls is not supported with EOAs"
6
- );
7
- }
1
+ const o = "2.33.0";
8
2
  export {
9
- n as handleSendCalls
3
+ o as version
10
4
  };
@@ -1,74 +1,7 @@
1
- import { createWalletClient as u } from "viem";
2
- import { sendEvmTransaction as l, signEvmTransaction as w } from "./index.web6.js";
3
- import { isChainIdSupportedForCDPSends as v, sendTransactionChainIdToNameMapping as T } from "./index.web30.js";
4
- import { RPCRequestError as t, STANDARD_ERROR_CODES as i, validateUserOwnsEOA as P } from "./index.web19.js";
5
- async function E(e, d, m) {
6
- const [a] = e;
7
- if (!a || typeof a != "object")
8
- throw new t(
9
- i.rpc.invalidParams,
10
- "Transaction parameter must be an object"
11
- );
12
- if (!a.to)
13
- throw new t(
14
- i.rpc.invalidParams,
15
- "Transaction must include 'to' field"
16
- );
17
- await P(a.from);
18
- const o = d.getState(), r = a.chainId ? Number(a.chainId) : o.chainId;
19
- if (v(r))
20
- try {
21
- const { transactionHash: n } = await l({
22
- evmAccount: a.from,
23
- transaction: { ...c(a), chainId: r },
24
- network: T[r]
25
- });
26
- return n;
27
- } catch (n) {
28
- throw new t(
29
- i.rpc.transactionRejected,
30
- n instanceof Error ? n.message : "Transaction failed"
31
- );
32
- }
33
- else
34
- try {
35
- const n = u({
36
- // Safe as we check before calling this handler that chainId is configured
37
- chain: o.chains.find((s) => s.id === r),
38
- transport: m[r],
39
- account: a.from
40
- }), p = o.chains.find((s) => s.id === r), h = await n.prepareTransactionRequest({
41
- ...c(a),
42
- chain: p
43
- }), { signedTransaction: f } = await w({
44
- evmAccount: a.from,
45
- transaction: {
46
- ...h,
47
- type: "eip1559"
48
- }
49
- });
50
- return await n.sendRawTransaction({
51
- serializedTransaction: f
52
- });
53
- } catch (n) {
54
- throw new t(
55
- i.rpc.transactionRejected,
56
- n instanceof Error ? n.message : "Transaction failed"
57
- );
58
- }
59
- }
60
- function c(e) {
61
- return {
62
- to: e.to,
63
- data: e.data,
64
- value: e.value ? BigInt(e.value) : void 0,
65
- nonce: e.nonce ? Number(e.nonce) : void 0,
66
- gas: e.gas ? BigInt(e.gas) : void 0,
67
- maxFeePerGas: e.maxFeePerGas ? BigInt(e.maxFeePerGas) : void 0,
68
- maxPriorityFeePerGas: e.maxPriorityFeePerGas ? BigInt(e.maxPriorityFeePerGas) : void 0,
69
- type: "eip1559"
70
- };
1
+ import { getCurrentUser as r } from "./index.web6.js";
2
+ async function n() {
3
+ return (await r())?.evmAccounts || [];
71
4
  }
72
5
  export {
73
- E as handleSendTransaction
6
+ n as handleAccounts
74
7
  };
@@ -1,21 +1,21 @@
1
- import { signEvmTypedData as n } from "./index.web6.js";
2
- import { validateUserOwnsEOA as o, EIP1193ProviderError as i, STANDARD_ERROR_CODES as s } from "./index.web19.js";
3
- async function p(t) {
4
- const [r, a] = t;
5
- await o(r);
1
+ import { signEvmHash as o } from "./index.web6.js";
2
+ import { validateUserOwnsEOA as a, EIP1193ProviderError as i, STANDARD_ERROR_CODES as s } from "./index.web19.js";
3
+ async function h(t) {
4
+ const [n, e] = t;
5
+ await a(e);
6
6
  try {
7
- const { signature: e } = await n({
8
- evmAccount: r,
9
- typedData: JSON.parse(a)
7
+ const { signature: r } = await o({
8
+ evmAccount: e,
9
+ hash: n
10
10
  });
11
- return e;
12
- } catch (e) {
11
+ return r;
12
+ } catch (r) {
13
13
  throw new i(
14
14
  s.provider.userRejectedRequest,
15
- e instanceof Error ? e.message : "Signing failed"
15
+ r instanceof Error ? r.message : "Signing failed"
16
16
  );
17
17
  }
18
18
  }
19
19
  export {
20
- p as handleSignTypedData
20
+ h as handleEthSign
21
21
  };