@coinbase/cdp-core 0.0.53 → 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 (267) hide show
  1. package/dist/esm/index.native10.js +4 -4
  2. package/dist/esm/index.native100.js +13 -19
  3. package/dist/esm/index.native101.js +4 -8
  4. package/dist/esm/index.native102.js +2 -8
  5. package/dist/esm/index.native103.js +4 -71
  6. package/dist/esm/index.native104.js +12 -12
  7. package/dist/esm/index.native105.js +7 -3
  8. package/dist/esm/index.native106.js +3 -4
  9. package/dist/esm/index.native107.js +19 -4
  10. package/dist/esm/index.native108.js +8 -4
  11. package/dist/esm/index.native109.js +7 -19
  12. package/dist/esm/index.native11.js +3 -3
  13. package/dist/esm/index.native110.js +66 -47
  14. package/dist/esm/index.native111.js +18 -17
  15. package/dist/esm/index.native112.js +3 -20
  16. package/dist/esm/index.native113.js +4 -8
  17. package/dist/esm/index.native114.js +4 -30
  18. package/dist/esm/index.native115.js +4 -7
  19. package/dist/esm/index.native116.js +10 -11
  20. package/dist/esm/index.native117.js +50 -52
  21. package/dist/esm/index.native118.js +17 -10
  22. package/dist/esm/index.native119.js +21 -2
  23. package/dist/esm/index.native12.js +3 -3
  24. package/dist/esm/index.native120.js +9 -45
  25. package/dist/esm/index.native121.js +30 -13
  26. package/dist/esm/index.native122.js +7 -4
  27. package/dist/esm/index.native123.js +21 -2
  28. package/dist/esm/index.native125.js +2 -2
  29. package/dist/esm/index.native128.js +1 -1
  30. package/dist/esm/index.native13.js +3 -3
  31. package/dist/esm/index.native131.js +19 -77
  32. package/dist/esm/index.native132.js +10 -47
  33. package/dist/esm/index.native133.js +20 -4
  34. package/dist/esm/index.native134.js +93 -20
  35. package/dist/esm/index.native135.js +20 -9
  36. package/dist/esm/index.native136.js +114 -16
  37. package/dist/esm/index.native137.js +75 -90
  38. package/dist/esm/index.native138.js +4 -21
  39. package/dist/esm/index.native139.js +2 -118
  40. package/dist/esm/index.native14.js +3 -3
  41. package/dist/esm/index.native140.js +109 -2
  42. package/dist/esm/index.native141.js +2 -109
  43. package/dist/esm/index.native142.js +47 -2
  44. package/dist/esm/index.native143.js +7 -38
  45. package/dist/esm/index.native145.js +375 -67
  46. package/dist/esm/index.native146.js +832 -34
  47. package/dist/esm/index.native147.js +38 -20
  48. package/dist/esm/index.native148.js +2 -8
  49. package/dist/esm/index.native149.js +70 -2
  50. package/dist/esm/index.native15.js +3 -3
  51. package/dist/esm/index.native150.js +30 -373
  52. package/dist/esm/index.native151.js +20 -832
  53. package/dist/esm/index.native153.js +17 -14
  54. package/dist/esm/index.native154.js +28 -18
  55. package/dist/esm/index.native155.js +6 -26
  56. package/dist/esm/index.native156.js +9 -6
  57. package/dist/esm/index.native157.js +13 -11
  58. package/dist/esm/index.native158.js +8 -11
  59. package/dist/esm/index.native159.js +14 -7
  60. package/dist/esm/index.native16.js +3 -3
  61. package/dist/esm/index.native160.js +80 -16
  62. package/dist/esm/index.native161.js +14 -80
  63. package/dist/esm/index.native162.js +2 -2
  64. package/dist/esm/index.native163.js +2 -2
  65. package/dist/esm/index.native164.js +2 -2
  66. package/dist/esm/index.native19.js +1 -1
  67. package/dist/esm/index.native22.js +28 -3
  68. package/dist/esm/index.native23.js +3 -51
  69. package/dist/esm/index.native24.js +53 -2
  70. package/dist/esm/index.native25.js +2 -86
  71. package/dist/esm/index.native26.js +87 -15
  72. package/dist/esm/index.native27.js +15 -17
  73. package/dist/esm/index.native28.js +15 -116
  74. package/dist/esm/index.native29.js +92 -34
  75. package/dist/esm/index.native3.js +48 -6
  76. package/dist/esm/index.native30.js +58 -12
  77. package/dist/esm/index.native31.js +15 -42
  78. package/dist/esm/index.native32.js +42 -28
  79. package/dist/esm/index.native35.js +3 -3
  80. package/dist/esm/index.native41.js +3 -3
  81. package/dist/esm/index.native44.js +1 -1
  82. package/dist/esm/index.native45.js +1 -1
  83. package/dist/esm/index.native46.js +13 -373
  84. package/dist/esm/index.native47.js +22 -28
  85. package/dist/esm/index.native48.js +50 -28
  86. package/dist/esm/index.native49.js +373 -13
  87. package/dist/esm/index.native50.js +28 -22
  88. package/dist/esm/index.native51.js +28 -50
  89. package/dist/esm/index.native52.js +4 -2
  90. package/dist/esm/index.native53.js +2 -66
  91. package/dist/esm/index.native54.js +2 -367
  92. package/dist/esm/index.native55.js +66 -2
  93. package/dist/esm/index.native56.js +365 -2
  94. package/dist/esm/index.native7.js +11 -11
  95. package/dist/esm/index.native72.js +1 -1
  96. package/dist/esm/index.native8.js +4 -4
  97. package/dist/esm/index.native9.js +4 -4
  98. package/dist/esm/index.native96.js +54 -4
  99. package/dist/esm/index.native97.js +10 -18
  100. package/dist/esm/index.native98.js +2 -8
  101. package/dist/esm/index.native99.js +45 -4
  102. package/dist/esm/index.web100.js +1 -1
  103. package/dist/esm/index.web127.js +1 -1
  104. package/dist/esm/index.web130.js +77 -19
  105. package/dist/esm/index.web131.js +21 -10
  106. package/dist/esm/index.web132.js +9 -19
  107. package/dist/esm/index.web133.js +15 -89
  108. package/dist/esm/index.web134.js +92 -19
  109. package/dist/esm/index.web135.js +18 -115
  110. package/dist/esm/index.web136.js +118 -2
  111. package/dist/esm/index.web137.js +2 -109
  112. package/dist/esm/index.web138.js +109 -2
  113. package/dist/esm/index.web139.js +2 -79
  114. package/dist/esm/index.web141.js +1 -1
  115. package/dist/esm/index.web153.js +1 -1
  116. package/dist/esm/index.web159.js +1 -1
  117. package/dist/esm/index.web24.js +33 -29
  118. package/dist/esm/index.web34.js +3 -3
  119. package/dist/esm/index.web40.js +1 -1
  120. package/dist/esm/index.web45.js +13 -373
  121. package/dist/esm/index.web46.js +25 -2
  122. package/dist/esm/index.web47.js +48 -63
  123. package/dist/esm/index.web48.js +189 -177
  124. package/dist/esm/index.web49.js +2 -19
  125. package/dist/esm/index.web50.js +63 -20
  126. package/dist/esm/index.web51.js +351 -37
  127. package/dist/esm/index.web95.js +7 -7
  128. package/dist/native/index.native10.js +4 -4
  129. package/dist/native/index.native100.js +13 -19
  130. package/dist/native/index.native101.js +4 -8
  131. package/dist/native/index.native102.js +2 -8
  132. package/dist/native/index.native103.js +4 -71
  133. package/dist/native/index.native104.js +12 -12
  134. package/dist/native/index.native105.js +7 -3
  135. package/dist/native/index.native106.js +3 -4
  136. package/dist/native/index.native107.js +19 -4
  137. package/dist/native/index.native108.js +8 -4
  138. package/dist/native/index.native109.js +7 -19
  139. package/dist/native/index.native11.js +3 -3
  140. package/dist/native/index.native110.js +66 -47
  141. package/dist/native/index.native111.js +18 -17
  142. package/dist/native/index.native112.js +3 -20
  143. package/dist/native/index.native113.js +4 -8
  144. package/dist/native/index.native114.js +4 -30
  145. package/dist/native/index.native115.js +4 -7
  146. package/dist/native/index.native116.js +10 -11
  147. package/dist/native/index.native117.js +50 -52
  148. package/dist/native/index.native118.js +17 -10
  149. package/dist/native/index.native119.js +21 -2
  150. package/dist/native/index.native12.js +3 -3
  151. package/dist/native/index.native120.js +9 -45
  152. package/dist/native/index.native121.js +30 -13
  153. package/dist/native/index.native122.js +7 -4
  154. package/dist/native/index.native123.js +21 -2
  155. package/dist/native/index.native125.js +2 -2
  156. package/dist/native/index.native128.js +1 -1
  157. package/dist/native/index.native13.js +3 -3
  158. package/dist/native/index.native131.js +19 -77
  159. package/dist/native/index.native132.js +10 -47
  160. package/dist/native/index.native133.js +20 -4
  161. package/dist/native/index.native134.js +93 -20
  162. package/dist/native/index.native135.js +20 -9
  163. package/dist/native/index.native136.js +114 -16
  164. package/dist/native/index.native137.js +75 -90
  165. package/dist/native/index.native138.js +4 -21
  166. package/dist/native/index.native139.js +2 -118
  167. package/dist/native/index.native14.js +3 -3
  168. package/dist/native/index.native140.js +109 -2
  169. package/dist/native/index.native141.js +2 -109
  170. package/dist/native/index.native142.js +47 -2
  171. package/dist/native/index.native143.js +7 -38
  172. package/dist/native/index.native145.js +375 -67
  173. package/dist/native/index.native146.js +832 -34
  174. package/dist/native/index.native147.js +38 -20
  175. package/dist/native/index.native148.js +2 -8
  176. package/dist/native/index.native149.js +70 -2
  177. package/dist/native/index.native15.js +3 -3
  178. package/dist/native/index.native150.js +30 -373
  179. package/dist/native/index.native151.js +20 -832
  180. package/dist/native/index.native153.js +17 -14
  181. package/dist/native/index.native154.js +28 -18
  182. package/dist/native/index.native155.js +6 -26
  183. package/dist/native/index.native156.js +9 -6
  184. package/dist/native/index.native157.js +13 -11
  185. package/dist/native/index.native158.js +8 -11
  186. package/dist/native/index.native159.js +14 -7
  187. package/dist/native/index.native16.js +3 -3
  188. package/dist/native/index.native160.js +80 -16
  189. package/dist/native/index.native161.js +14 -80
  190. package/dist/native/index.native162.js +2 -2
  191. package/dist/native/index.native163.js +2 -2
  192. package/dist/native/index.native164.js +2 -2
  193. package/dist/native/index.native19.js +1 -1
  194. package/dist/native/index.native22.js +28 -3
  195. package/dist/native/index.native23.js +3 -51
  196. package/dist/native/index.native24.js +53 -2
  197. package/dist/native/index.native25.js +2 -86
  198. package/dist/native/index.native26.js +87 -15
  199. package/dist/native/index.native27.js +15 -17
  200. package/dist/native/index.native28.js +15 -116
  201. package/dist/native/index.native29.js +92 -34
  202. package/dist/native/index.native3.js +48 -6
  203. package/dist/native/index.native30.js +58 -12
  204. package/dist/native/index.native31.js +15 -42
  205. package/dist/native/index.native32.js +42 -28
  206. package/dist/native/index.native35.js +3 -3
  207. package/dist/native/index.native41.js +3 -3
  208. package/dist/native/index.native44.js +1 -1
  209. package/dist/native/index.native45.js +1 -1
  210. package/dist/native/index.native46.js +13 -373
  211. package/dist/native/index.native47.js +22 -28
  212. package/dist/native/index.native48.js +50 -28
  213. package/dist/native/index.native49.js +373 -13
  214. package/dist/native/index.native50.js +28 -22
  215. package/dist/native/index.native51.js +28 -50
  216. package/dist/native/index.native52.js +4 -2
  217. package/dist/native/index.native53.js +2 -66
  218. package/dist/native/index.native54.js +2 -367
  219. package/dist/native/index.native55.js +66 -2
  220. package/dist/native/index.native56.js +365 -2
  221. package/dist/native/index.native7.js +11 -11
  222. package/dist/native/index.native72.js +1 -1
  223. package/dist/native/index.native8.js +4 -4
  224. package/dist/native/index.native9.js +4 -4
  225. package/dist/native/index.native96.js +54 -4
  226. package/dist/native/index.native97.js +10 -18
  227. package/dist/native/index.native98.js +2 -8
  228. package/dist/native/index.native99.js +45 -4
  229. package/dist/native-types/auth/oAuthManager.d.ts +1 -1
  230. package/dist/native-types/auth/types.d.ts +1 -1
  231. package/dist/native-types/platform/types.d.ts +1 -1
  232. package/dist/native-types/types.d.ts +4 -1
  233. package/dist/types/auth/oAuthManager.d.ts +1 -1
  234. package/dist/types/auth/types.d.ts +1 -1
  235. package/dist/types/platform/types.d.ts +1 -1
  236. package/dist/types/types.d.ts +4 -1
  237. package/dist/web/index.web100.js +1 -1
  238. package/dist/web/index.web127.js +1 -1
  239. package/dist/web/index.web130.js +77 -19
  240. package/dist/web/index.web131.js +21 -10
  241. package/dist/web/index.web132.js +9 -19
  242. package/dist/web/index.web133.js +15 -89
  243. package/dist/web/index.web134.js +92 -19
  244. package/dist/web/index.web135.js +18 -115
  245. package/dist/web/index.web136.js +118 -2
  246. package/dist/web/index.web137.js +2 -109
  247. package/dist/web/index.web138.js +109 -2
  248. package/dist/web/index.web139.js +2 -79
  249. package/dist/web/index.web141.js +1 -1
  250. package/dist/web/index.web153.js +1 -1
  251. package/dist/web/index.web159.js +1 -1
  252. package/dist/web/index.web24.js +33 -29
  253. package/dist/web/index.web34.js +3 -3
  254. package/dist/web/index.web40.js +1 -1
  255. package/dist/web/index.web45.js +13 -373
  256. package/dist/web/index.web46.js +25 -2
  257. package/dist/web/index.web47.js +48 -63
  258. package/dist/web/index.web48.js +189 -177
  259. package/dist/web/index.web49.js +2 -19
  260. package/dist/web/index.web50.js +63 -20
  261. package/dist/web/index.web51.js +351 -37
  262. package/dist/web/index.web95.js +7 -7
  263. package/dist/web-types/auth/oAuthManager.d.ts +1 -1
  264. package/dist/web-types/auth/types.d.ts +1 -1
  265. package/dist/web-types/platform/types.d.ts +1 -1
  266. package/dist/web-types/types.d.ts +4 -1
  267. package/package.json +7 -3
@@ -1,31 +1,53 @@
1
- import { handleChainId as t } from "./index.native105.js";
2
- import { handleDisconnect as e } from "./index.native106.js";
3
- import { handleSwitchEthereumChain as a } from "./index.native107.js";
4
- import { handleAccounts as n } from "./index.native108.js";
5
- import { handleEthSign as o } from "./index.native109.js";
6
- import { handleGetCallsStatus as r } from "./index.native110.js";
7
- import { handleGetCapabilities as i } from "./index.native111.js";
8
- import { handlePersonalSign as l } from "./index.native112.js";
9
- import { handleRequestAccounts as h } from "./index.native113.js";
10
- import { handleSendCalls as m } from "./index.native114.js";
11
- import { handleSendTransaction as s } from "./index.native115.js";
12
- import { handleSignTypedData as d } from "./index.native116.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
- };
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
+ }
28
50
  }
29
51
  export {
30
- E as createSmartAccountHandlers
52
+ d as JWTClaimsBuilder
31
53
  };
@@ -1,19 +1,379 @@
1
- import { FlattenedSign as n } from "./index.native117.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.native118.js";
2
- import e from "./index.native119.js";
3
- import i from "./index.native120.js";
4
- import o from "./index.native121.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,2 +1,4 @@
1
- import { __require as e } from "./index.native141.js";
2
- e();
1
+ var s = {};
2
+ export {
3
+ s as __exports
4
+ };
@@ -1,68 +1,4 @@
1
- import { getVersion as n } from "./index.native122.js";
2
- class s extends Error {
3
- constructor(r, e = {}) {
4
- const a = (() => {
5
- if (e.cause instanceof s) {
6
- if (e.cause.details)
7
- return e.cause.details;
8
- if (e.cause.shortMessage)
9
- return e.cause.shortMessage;
10
- }
11
- return e.cause && "details" in e.cause && typeof e.cause.details == "string" ? e.cause.details : e.cause?.message ? e.cause.message : e.details;
12
- })(), u = e.cause instanceof s && e.cause.docsPath || e.docsPath, c = `https://oxlib.sh${u ?? ""}`, l = [
13
- r || "An error occurred.",
14
- ...e.metaMessages ? ["", ...e.metaMessages] : [],
15
- ...a || u ? [
16
- "",
17
- a ? `Details: ${a}` : void 0,
18
- u ? `See: ${c}` : void 0
19
- ] : []
20
- ].filter((d) => typeof d == "string").join(`
21
- `);
22
- super(l, e.cause ? { cause: e.cause } : void 0), Object.defineProperty(this, "details", {
23
- enumerable: !0,
24
- configurable: !0,
25
- writable: !0,
26
- value: void 0
27
- }), Object.defineProperty(this, "docs", {
28
- enumerable: !0,
29
- configurable: !0,
30
- writable: !0,
31
- value: void 0
32
- }), Object.defineProperty(this, "docsPath", {
33
- enumerable: !0,
34
- configurable: !0,
35
- writable: !0,
36
- value: void 0
37
- }), Object.defineProperty(this, "shortMessage", {
38
- enumerable: !0,
39
- configurable: !0,
40
- writable: !0,
41
- value: void 0
42
- }), Object.defineProperty(this, "cause", {
43
- enumerable: !0,
44
- configurable: !0,
45
- writable: !0,
46
- value: void 0
47
- }), Object.defineProperty(this, "name", {
48
- enumerable: !0,
49
- configurable: !0,
50
- writable: !0,
51
- value: "BaseError"
52
- }), Object.defineProperty(this, "version", {
53
- enumerable: !0,
54
- configurable: !0,
55
- writable: !0,
56
- value: `ox@${n()}`
57
- }), this.cause = e.cause, this.details = a, this.docs = c, this.docsPath = u, this.shortMessage = r;
58
- }
59
- walk(r) {
60
- return i(this, r);
61
- }
62
- }
63
- function i(t, r) {
64
- return r?.(t) ? t : t && typeof t == "object" && "cause" in t && t.cause ? i(t.cause, r) : r ? null : t;
65
- }
1
+ var e = {};
66
2
  export {
67
- s as BaseError
3
+ e as __exports
68
4
  };