@coinbase/cdp-core 0.0.47 → 0.0.49

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 (229) hide show
  1. package/dist/esm/index.native12.js +4 -4
  2. package/dist/esm/index.native17.js +1 -1
  3. package/dist/esm/index.native18.js +33 -24
  4. package/dist/esm/index.native2.js +8 -6
  5. package/dist/esm/index.native22.js +1 -1
  6. package/dist/esm/index.native3.js +2 -2
  7. package/dist/esm/index.native32.js +940 -149
  8. package/dist/esm/index.native33.js +2 -48
  9. package/dist/esm/index.native34.js +43 -244
  10. package/dist/esm/index.native35.js +27 -55
  11. package/dist/esm/index.native36.js +149 -940
  12. package/dist/esm/index.native37.js +48 -2
  13. package/dist/esm/index.native38.js +244 -43
  14. package/dist/esm/index.native39.js +55 -27
  15. package/dist/esm/index.native4.js +4 -2
  16. package/dist/esm/index.native5.js +19 -17
  17. package/dist/esm/index.native6.js +10 -8
  18. package/dist/esm/index.web100.js +2 -7
  19. package/dist/esm/index.web101.js +17 -17
  20. package/dist/esm/index.web102.js +20 -10
  21. package/dist/esm/index.web103.js +80 -20
  22. package/dist/esm/index.web104.js +99 -89
  23. package/dist/esm/index.web105.js +32 -20
  24. package/dist/esm/index.web106.js +7 -118
  25. package/dist/esm/index.web107.js +10 -79
  26. package/dist/esm/index.web108.js +79 -10
  27. package/dist/esm/index.web109.js +18 -5
  28. package/dist/esm/index.web110.js +28 -18
  29. package/dist/esm/index.web111.js +6 -26
  30. package/dist/esm/index.web112.js +9 -6
  31. package/dist/esm/index.web113.js +13 -11
  32. package/dist/esm/index.web114.js +8 -11
  33. package/dist/esm/index.web115.js +14 -7
  34. package/dist/esm/index.web116.js +80 -16
  35. package/dist/esm/index.web117.js +5 -81
  36. package/dist/esm/index.web119.js +4 -4
  37. package/dist/esm/index.web120.js +5 -5
  38. package/dist/esm/index.web16.js +1 -1
  39. package/dist/esm/index.web17.js +33 -24
  40. package/dist/esm/index.web2.js +10 -8
  41. package/dist/esm/index.web21.js +1 -1
  42. package/dist/esm/index.web25.js +13 -13
  43. package/dist/esm/index.web27.js +3 -3
  44. package/dist/esm/index.web3.js +4 -2
  45. package/dist/esm/index.web30.js +2 -2
  46. package/dist/esm/index.web34.js +2 -2
  47. package/dist/esm/index.web35.js +16 -950
  48. package/dist/esm/index.web36.js +23 -2
  49. package/dist/esm/index.web37.js +50 -49
  50. package/dist/esm/index.web38.js +950 -27
  51. package/dist/esm/index.web39.js +2 -17
  52. package/dist/esm/index.web4.js +12 -12
  53. package/dist/esm/index.web40.js +48 -21
  54. package/dist/esm/index.web41.js +27 -50
  55. package/dist/esm/index.web44.js +54 -8
  56. package/dist/esm/index.web45.js +9 -16
  57. package/dist/esm/index.web46.js +2 -46
  58. package/dist/esm/index.web47.js +45 -14
  59. package/dist/esm/index.web48.js +12 -54
  60. package/dist/esm/index.web49.js +8 -6
  61. package/dist/esm/index.web5.js +4 -2
  62. package/dist/esm/index.web50.js +16 -20
  63. package/dist/esm/index.web51.js +45 -11
  64. package/dist/esm/index.web52.js +13 -3
  65. package/dist/esm/index.web53.js +55 -3
  66. package/dist/esm/index.web54.js +6 -34
  67. package/dist/esm/index.web55.js +19 -10
  68. package/dist/esm/index.web56.js +11 -4
  69. package/dist/esm/index.web57.js +3 -28
  70. package/dist/esm/index.web58.js +3 -6
  71. package/dist/esm/index.web59.js +34 -24
  72. package/dist/esm/index.web60.js +12 -16
  73. package/dist/esm/index.web61.js +4 -54
  74. package/dist/esm/index.web62.js +25 -20
  75. package/dist/esm/index.web63.js +6 -11
  76. package/dist/esm/index.web64.js +23 -26
  77. package/dist/esm/index.web65.js +16 -42
  78. package/dist/esm/index.web66.js +52 -53
  79. package/dist/esm/index.web67.js +23 -127
  80. package/dist/esm/index.web68.js +11 -12
  81. package/dist/esm/index.web69.js +27 -104
  82. package/dist/esm/index.web70.js +42 -6
  83. package/dist/esm/index.web71.js +56 -3
  84. package/dist/esm/index.web72.js +127 -14
  85. package/dist/esm/index.web73.js +9 -39
  86. package/dist/esm/index.web74.js +100 -74
  87. package/dist/esm/index.web75.js +7 -2
  88. package/dist/esm/index.web76.js +3 -2
  89. package/dist/esm/index.web77.js +14 -12
  90. package/dist/esm/index.web78.js +34 -29
  91. package/dist/esm/index.web79.js +77 -5
  92. package/dist/esm/index.web80.js +2 -35
  93. package/dist/esm/index.web81.js +2 -9
  94. package/dist/esm/index.web82.js +11 -9
  95. package/dist/esm/index.web83.js +37 -11
  96. package/dist/esm/index.web84.js +6 -13
  97. package/dist/esm/index.web85.js +33 -17
  98. package/dist/esm/index.web86.js +8 -5
  99. package/dist/esm/index.web87.js +11 -5
  100. package/dist/esm/index.web88.js +11 -10
  101. package/dist/esm/index.web89.js +13 -54
  102. package/dist/esm/index.web90.js +18 -10
  103. package/dist/esm/index.web91.js +6 -2
  104. package/dist/esm/index.web92.js +4 -44
  105. package/dist/esm/index.web93.js +10 -13
  106. package/dist/esm/index.web94.js +21 -2
  107. package/dist/esm/index.web95.js +10 -21
  108. package/dist/esm/index.web96.js +19 -19
  109. package/dist/esm/index.web97.js +94 -80
  110. package/dist/esm/index.web98.js +20 -103
  111. package/dist/esm/index.web99.js +115 -30
  112. package/dist/native/index.native12.js +4 -4
  113. package/dist/native/index.native17.js +1 -1
  114. package/dist/native/index.native18.js +33 -24
  115. package/dist/native/index.native2.js +8 -6
  116. package/dist/native/index.native22.js +1 -1
  117. package/dist/native/index.native3.js +2 -2
  118. package/dist/native/index.native32.js +940 -149
  119. package/dist/native/index.native33.js +2 -48
  120. package/dist/native/index.native34.js +43 -244
  121. package/dist/native/index.native35.js +27 -55
  122. package/dist/native/index.native36.js +149 -940
  123. package/dist/native/index.native37.js +48 -2
  124. package/dist/native/index.native38.js +244 -43
  125. package/dist/native/index.native39.js +55 -27
  126. package/dist/native/index.native4.js +4 -2
  127. package/dist/native/index.native5.js +19 -17
  128. package/dist/native/index.native6.js +10 -8
  129. package/dist/native-types/platform/types.d.ts +3 -3
  130. package/dist/native-types/types.d.ts +5 -7
  131. package/dist/types/platform/types.d.ts +3 -3
  132. package/dist/types/types.d.ts +5 -7
  133. package/dist/web/index.web100.js +2 -7
  134. package/dist/web/index.web101.js +17 -17
  135. package/dist/web/index.web102.js +20 -10
  136. package/dist/web/index.web103.js +80 -20
  137. package/dist/web/index.web104.js +99 -89
  138. package/dist/web/index.web105.js +32 -20
  139. package/dist/web/index.web106.js +7 -118
  140. package/dist/web/index.web107.js +10 -79
  141. package/dist/web/index.web108.js +79 -10
  142. package/dist/web/index.web109.js +18 -5
  143. package/dist/web/index.web110.js +28 -18
  144. package/dist/web/index.web111.js +6 -26
  145. package/dist/web/index.web112.js +9 -6
  146. package/dist/web/index.web113.js +13 -11
  147. package/dist/web/index.web114.js +8 -11
  148. package/dist/web/index.web115.js +14 -7
  149. package/dist/web/index.web116.js +80 -16
  150. package/dist/web/index.web117.js +5 -81
  151. package/dist/web/index.web119.js +4 -4
  152. package/dist/web/index.web120.js +5 -5
  153. package/dist/web/index.web16.js +1 -1
  154. package/dist/web/index.web17.js +33 -24
  155. package/dist/web/index.web2.js +10 -8
  156. package/dist/web/index.web21.js +1 -1
  157. package/dist/web/index.web25.js +13 -13
  158. package/dist/web/index.web27.js +3 -3
  159. package/dist/web/index.web3.js +4 -2
  160. package/dist/web/index.web30.js +2 -2
  161. package/dist/web/index.web34.js +2 -2
  162. package/dist/web/index.web35.js +16 -950
  163. package/dist/web/index.web36.js +23 -2
  164. package/dist/web/index.web37.js +50 -49
  165. package/dist/web/index.web38.js +950 -27
  166. package/dist/web/index.web39.js +2 -17
  167. package/dist/web/index.web4.js +12 -12
  168. package/dist/web/index.web40.js +48 -21
  169. package/dist/web/index.web41.js +27 -50
  170. package/dist/web/index.web44.js +54 -8
  171. package/dist/web/index.web45.js +9 -16
  172. package/dist/web/index.web46.js +2 -46
  173. package/dist/web/index.web47.js +45 -14
  174. package/dist/web/index.web48.js +12 -54
  175. package/dist/web/index.web49.js +8 -6
  176. package/dist/web/index.web5.js +4 -2
  177. package/dist/web/index.web50.js +16 -20
  178. package/dist/web/index.web51.js +45 -11
  179. package/dist/web/index.web52.js +13 -3
  180. package/dist/web/index.web53.js +55 -3
  181. package/dist/web/index.web54.js +6 -34
  182. package/dist/web/index.web55.js +19 -10
  183. package/dist/web/index.web56.js +11 -4
  184. package/dist/web/index.web57.js +3 -28
  185. package/dist/web/index.web58.js +3 -6
  186. package/dist/web/index.web59.js +34 -24
  187. package/dist/web/index.web60.js +12 -16
  188. package/dist/web/index.web61.js +4 -54
  189. package/dist/web/index.web62.js +25 -20
  190. package/dist/web/index.web63.js +6 -11
  191. package/dist/web/index.web64.js +23 -26
  192. package/dist/web/index.web65.js +16 -42
  193. package/dist/web/index.web66.js +52 -53
  194. package/dist/web/index.web67.js +23 -127
  195. package/dist/web/index.web68.js +11 -12
  196. package/dist/web/index.web69.js +27 -104
  197. package/dist/web/index.web70.js +42 -6
  198. package/dist/web/index.web71.js +56 -3
  199. package/dist/web/index.web72.js +127 -14
  200. package/dist/web/index.web73.js +9 -39
  201. package/dist/web/index.web74.js +100 -74
  202. package/dist/web/index.web75.js +7 -2
  203. package/dist/web/index.web76.js +3 -2
  204. package/dist/web/index.web77.js +14 -12
  205. package/dist/web/index.web78.js +34 -29
  206. package/dist/web/index.web79.js +77 -5
  207. package/dist/web/index.web80.js +2 -35
  208. package/dist/web/index.web81.js +2 -9
  209. package/dist/web/index.web82.js +11 -9
  210. package/dist/web/index.web83.js +37 -11
  211. package/dist/web/index.web84.js +6 -13
  212. package/dist/web/index.web85.js +33 -17
  213. package/dist/web/index.web86.js +8 -5
  214. package/dist/web/index.web87.js +11 -5
  215. package/dist/web/index.web88.js +11 -10
  216. package/dist/web/index.web89.js +13 -54
  217. package/dist/web/index.web90.js +18 -10
  218. package/dist/web/index.web91.js +6 -2
  219. package/dist/web/index.web92.js +4 -44
  220. package/dist/web/index.web93.js +10 -13
  221. package/dist/web/index.web94.js +21 -2
  222. package/dist/web/index.web95.js +10 -21
  223. package/dist/web/index.web96.js +19 -19
  224. package/dist/web/index.web97.js +94 -80
  225. package/dist/web/index.web98.js +20 -103
  226. package/dist/web/index.web99.js +115 -30
  227. package/dist/web-types/platform/types.d.ts +3 -3
  228. package/dist/web-types/types.d.ts +5 -7
  229. package/package.json +2 -2
@@ -1,4 +1,50 @@
1
- var r = {};
1
+ class n {
2
+ events = {};
3
+ /**
4
+ * Add an event listener.
5
+ *
6
+ * @param event - The name of the event to listen for.
7
+ * @param listener - The function to call when the event is emitted.
8
+ */
9
+ on(e, s) {
10
+ this.events[e] || (this.events[e] = []), this.events[e].push(s);
11
+ }
12
+ /**
13
+ * Remove an event listener.
14
+ *
15
+ * @param event - The name of the event to remove the listener from.
16
+ * @param listener - The function to remove from the event listeners.
17
+ */
18
+ removeListener(e, s) {
19
+ if (!this.events[e])
20
+ return;
21
+ const t = this.events[e].indexOf(s);
22
+ t > -1 && this.events[e].splice(t, 1);
23
+ }
24
+ /**
25
+ * Emit an event.
26
+ *
27
+ * @param event - The name of the event to emit.
28
+ * @param args - The arguments to pass to the event listeners.
29
+ */
30
+ emit(e, ...s) {
31
+ this.events[e] && this.events[e].forEach((t) => {
32
+ try {
33
+ t(...s);
34
+ } catch (i) {
35
+ console.error(`Error in event listener for ${e}:`, i);
36
+ }
37
+ });
38
+ }
39
+ /**
40
+ * Remove all listeners for an event.
41
+ *
42
+ * @param event - The name of the event to remove all listeners from. If not provided, removes all listeners for all events.
43
+ */
44
+ removeAllListeners(e) {
45
+ e ? delete this.events[e] : this.events = {};
46
+ }
47
+ }
2
48
  export {
3
- r as __exports
49
+ n as EventEmitter
4
50
  };
@@ -1,52 +1,253 @@
1
- import { __exports as F } from "./index.native43.js";
2
- var A;
3
- function _() {
4
- if (A) return F;
5
- A = 1, F.byteLength = y, F.toByteArray = C, F.fromByteArray = B;
6
- for (var c = [], n = [], l = typeof Uint8Array < "u" ? Uint8Array : Array, d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", s = 0, p = d.length; s < p; ++s)
7
- c[s] = d[s], n[d.charCodeAt(s)] = s;
8
- n[45] = 62, n[95] = 63;
9
- function x(r) {
10
- var e = r.length;
11
- if (e % 4 > 0)
12
- throw new Error("Invalid string. Length must be a multiple of 4");
13
- var a = r.indexOf("=");
14
- a === -1 && (a = e);
15
- var o = a === e ? 0 : 4 - a % 4;
16
- return [a, o];
17
- }
18
- function y(r) {
19
- var e = x(r), a = e[0], o = e[1];
20
- return (a + o) * 3 / 4 - o;
1
+ import { Hex as E } from "ox";
2
+ import { toHex as T, createWalletClient as P } from "viem";
3
+ import { getUserOperation as R, sendUserOperation as b, signEvmTypedData as U, signEvmHash as x, getCurrentUser as w, signOut as H, sendEvmTransaction as O, signEvmTransaction as D, signEvmMessage as N } from "./index.native7.js";
4
+ import "@coinbase/cdp-api-client";
5
+ import "./index.native12.js";
6
+ import { validateUserConnected as v, validateUserHasEvmSmartAccount as S, RPCRequestError as u, STANDARD_ERROR_CODES as o, validateIsUsingEOA as h, validateUserOwnsAddress as p, EIP1193ProviderError as g } from "./index.native13.js";
7
+ import "zustand";
8
+ import { userOperationChainIdToNameMapping as m, isChainIdSupportedForCDPUserOps as I, isChainIdSupportedForCDPSends as F, sendTransactionChainIdToNameMapping as j, userOperationNameToChainIdMapping as k } from "./index.native24.js";
9
+ function f(t) {
10
+ return {
11
+ to: t.to,
12
+ data: t.data,
13
+ value: t.value ? BigInt(t.value) : void 0,
14
+ nonce: t.nonce ? Number(t.nonce) : void 0,
15
+ gas: t.gas ? BigInt(t.gas) : void 0,
16
+ maxFeePerGas: t.maxFeePerGas ? BigInt(t.maxFeePerGas) : void 0,
17
+ maxPriorityFeePerGas: t.maxPriorityFeePerGas ? BigInt(t.maxPriorityFeePerGas) : void 0,
18
+ type: "eip1559"
19
+ };
20
+ }
21
+ function q(t) {
22
+ return t.map((e) => ({
23
+ to: e.to,
24
+ data: e.data,
25
+ value: e.value ? BigInt(e.value) : void 0
26
+ }));
27
+ }
28
+ function B(t) {
29
+ return {
30
+ atomic: !0,
31
+ chainId: k[t.network] ?? 0,
32
+ receipts: t.receipts?.map((e) => ({
33
+ transactionHash: e.transactionHash,
34
+ blockHash: e.blockHash,
35
+ blockNumber: BigInt(e.blockNumber ?? 0),
36
+ gasUsed: BigInt(e.gasUsed ?? 0),
37
+ logs: [],
38
+ status: ""
39
+ })),
40
+ id: t.userOpHash,
41
+ status: G(t.status),
42
+ version: "1"
43
+ };
44
+ }
45
+ function G(t) {
46
+ switch (t) {
47
+ case "dropped":
48
+ case "failed":
49
+ return 400;
50
+ case "complete":
51
+ return 200;
52
+ default:
53
+ return 100;
21
54
  }
22
- function i(r, e, a) {
23
- return (e + a) * 3 / 4 - a;
55
+ }
56
+ async function Q() {
57
+ const t = await w();
58
+ return t?.evmSmartAccounts && t.evmSmartAccounts.length > 0 ? t.evmSmartAccounts : t?.evmAccounts || [];
59
+ }
60
+ async function X(t, e) {
61
+ const a = await v();
62
+ return t.emit("connect", {
63
+ chainId: E.fromNumber(e.getState().chainId)
64
+ }), a.evmSmartAccounts && a.evmSmartAccounts.length > 0 ? a.evmSmartAccounts : a.evmAccounts || [];
65
+ }
66
+ async function Y(t) {
67
+ await h();
68
+ const [e, a] = t;
69
+ await p(a);
70
+ const r = Buffer.from(e.slice(2), "hex").toString();
71
+ try {
72
+ return (await N({
73
+ evmAccount: a,
74
+ message: r
75
+ })).signature;
76
+ } catch (n) {
77
+ throw new g(
78
+ o.provider.userRejectedRequest,
79
+ n instanceof Error ? n.message : "Signing failed"
80
+ );
24
81
  }
25
- function C(r) {
26
- var e, a = x(r), o = a[0], v = a[1], t = new l(i(r, o, v)), h = 0, u = v > 0 ? o - 4 : o, f;
27
- for (f = 0; f < u; f += 4)
28
- e = n[r.charCodeAt(f)] << 18 | n[r.charCodeAt(f + 1)] << 12 | n[r.charCodeAt(f + 2)] << 6 | n[r.charCodeAt(f + 3)], t[h++] = e >> 16 & 255, t[h++] = e >> 8 & 255, t[h++] = e & 255;
29
- return v === 2 && (e = n[r.charCodeAt(f)] << 2 | n[r.charCodeAt(f + 1)] >> 4, t[h++] = e & 255), v === 1 && (e = n[r.charCodeAt(f)] << 10 | n[r.charCodeAt(f + 1)] << 4 | n[r.charCodeAt(f + 2)] >> 2, t[h++] = e >> 8 & 255, t[h++] = e & 255), t;
82
+ }
83
+ async function Z(t) {
84
+ await h();
85
+ const [e, a] = t;
86
+ await p(e);
87
+ try {
88
+ return (await U({
89
+ evmAccount: e,
90
+ typedData: JSON.parse(a)
91
+ })).signature;
92
+ } catch (r) {
93
+ throw new g(
94
+ o.provider.userRejectedRequest,
95
+ r instanceof Error ? r.message : "Signing failed"
96
+ );
30
97
  }
31
- function L(r) {
32
- return c[r >> 18 & 63] + c[r >> 12 & 63] + c[r >> 6 & 63] + c[r & 63];
98
+ }
99
+ async function tt(t, e, a) {
100
+ const r = await h({
101
+ errorMessage: "sendTransaction with a smart account is not supported. Use sendCalls instead."
102
+ }), [n] = t;
103
+ if (!n || typeof n != "object")
104
+ throw new u(
105
+ o.rpc.invalidParams,
106
+ "Transaction parameter must be an object"
107
+ );
108
+ if (!n.to)
109
+ throw new u(
110
+ o.rpc.invalidParams,
111
+ "Transaction must include 'to' field"
112
+ );
113
+ const d = r.evmAccounts?.[0], i = e.getState(), s = n.chainId ? Number(n.chainId) : i.chainId;
114
+ if (!d)
115
+ throw new u(
116
+ o.rpc.invalidParams,
117
+ "User does not have an EVM account"
118
+ );
119
+ if (F(s))
120
+ try {
121
+ return (await O({
122
+ evmAccount: d,
123
+ transaction: { ...f(n), chainId: s },
124
+ network: j[s]
125
+ })).transactionHash;
126
+ } catch (c) {
127
+ throw console.log("Transaction failed", c), new u(
128
+ o.rpc.transactionRejected,
129
+ c instanceof Error ? c.message : "Transaction failed"
130
+ );
131
+ }
132
+ else
133
+ try {
134
+ const c = P({
135
+ // Safe as we check before calling this handler that chainId is configured
136
+ chain: i.chains.find((l) => l.id === s),
137
+ transport: a[s],
138
+ account: d
139
+ }), y = i.chains.find((l) => l.id === s), A = await c.prepareTransactionRequest({
140
+ ...f(n),
141
+ chain: y
142
+ }), C = await D({
143
+ evmAccount: d,
144
+ transaction: {
145
+ ...A,
146
+ type: "eip1559"
147
+ }
148
+ });
149
+ return await c.sendRawTransaction({
150
+ serializedTransaction: C.signedTransaction
151
+ });
152
+ } catch (c) {
153
+ throw new u(
154
+ o.rpc.transactionRejected,
155
+ c instanceof Error ? c.message : "Transaction failed"
156
+ );
157
+ }
158
+ }
159
+ async function et(t) {
160
+ await h();
161
+ const [e, a] = t;
162
+ await p(a);
163
+ try {
164
+ return (await x({
165
+ evmAccount: a,
166
+ hash: e
167
+ })).signature;
168
+ } catch (r) {
169
+ throw new g(
170
+ o.provider.userRejectedRequest,
171
+ r instanceof Error ? r.message : "Signing failed"
172
+ );
33
173
  }
34
- function g(r, e, a) {
35
- for (var o, v = [], t = e; t < a; t += 3)
36
- o = (r[t] << 16 & 16711680) + (r[t + 1] << 8 & 65280) + (r[t + 2] & 255), v.push(L(o));
37
- return v.join("");
174
+ }
175
+ async function at(t) {
176
+ return `0x${t.getState().chainId.toString(16)}`;
177
+ }
178
+ async function nt() {
179
+ await w() && await H();
180
+ }
181
+ function rt(t, e) {
182
+ const a = Number.parseInt(t[0].chainId, 16);
183
+ e.getState().setChainId(a);
184
+ }
185
+ async function st(t, e) {
186
+ const a = t[0].calls, n = (await S()).evmSmartAccounts?.[0], i = e.getState().chainId;
187
+ if (!I(i))
188
+ throw new u(
189
+ o.rpc.invalidParams,
190
+ "Chain ID is not supported for user operations"
191
+ );
192
+ try {
193
+ return (await b({
194
+ evmSmartAccount: n,
195
+ calls: q(a),
196
+ network: m[i]
197
+ })).userOperationHash;
198
+ } catch (s) {
199
+ throw console.log("User operation failed", s), new u(
200
+ o.rpc.transactionRejected,
201
+ s instanceof Error ? s.message : "User operation failed"
202
+ );
38
203
  }
39
- function B(r) {
40
- for (var e, a = r.length, o = a % 3, v = [], t = 16383, h = 0, u = a - o; h < u; h += t)
41
- v.push(g(r, h, h + t > u ? u : h + t));
42
- return o === 1 ? (e = r[a - 1], v.push(
43
- c[e >> 2] + c[e << 4 & 63] + "=="
44
- )) : o === 2 && (e = (r[a - 2] << 8) + r[a - 1], v.push(
45
- c[e >> 10] + c[e >> 4 & 63] + c[e << 2 & 63] + "="
46
- )), v.join("");
204
+ }
205
+ async function ot(t, e) {
206
+ const a = t[0], n = (await S()).evmSmartAccounts?.[0], i = e.getState().chainId;
207
+ if (!I(i) || !m[i])
208
+ throw new u(
209
+ o.rpc.invalidParams,
210
+ "Chain ID is not supported for user operations"
211
+ );
212
+ try {
213
+ const s = await R({
214
+ userOperationHash: a,
215
+ evmSmartAccount: n,
216
+ network: m[i]
217
+ });
218
+ return B(s);
219
+ } catch (s) {
220
+ throw console.log("Failed to get user operation status", s), new u(
221
+ o.rpc.internal,
222
+ "Failed to get user operation status"
223
+ );
47
224
  }
48
- return F;
225
+ }
226
+ async function it() {
227
+ return !(await v()).evmSmartAccounts?.length ? {} : Object.keys(m).reduce(
228
+ (r, n) => {
229
+ const d = T(Number(n));
230
+ return r[d] = {
231
+ atomic: { status: "supported" },
232
+ paymasterService: { supported: !0 }
233
+ }, r;
234
+ },
235
+ {}
236
+ );
49
237
  }
50
238
  export {
51
- _ as __require
239
+ Q as handleAccounts,
240
+ at as handleChainId,
241
+ nt as handleDisconnect,
242
+ et as handleEthSign,
243
+ ot as handleGetCallsStatus,
244
+ it as handleGetCapabilities,
245
+ Y as handlePersonalSign,
246
+ X as handleRequestAccounts,
247
+ st as handleSendCalls,
248
+ tt as handleSendTransaction,
249
+ Z as handleSignTypedData,
250
+ rt as handleSwitchEthereumChain,
251
+ q as shimProviderCallsRequest,
252
+ f as shimProviderTxRequest
52
253
  };
@@ -1,30 +1,58 @@
1
- import { __exports as n } from "./index.native44.js";
2
- /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
3
- var d;
4
- function q() {
5
- return d ? n : (d = 1, n.read = function(s, a, N, w, M) {
6
- var t, r, h = M * 8 - w - 1, e = (1 << h) - 1, f = e >> 1, i = -7, o = N ? M - 1 : 0, x = N ? -1 : 1, p = s[a + o];
7
- for (o += x, t = p & (1 << -i) - 1, p >>= -i, i += h; i > 0; t = t * 256 + s[a + o], o += x, i -= 8)
8
- ;
9
- for (r = t & (1 << -i) - 1, t >>= -i, i += w; i > 0; r = r * 256 + s[a + o], o += x, i -= 8)
10
- ;
11
- if (t === 0)
12
- t = 1 - f;
13
- else {
14
- if (t === e)
15
- return r ? NaN : (p ? -1 : 1) * (1 / 0);
16
- r = r + Math.pow(2, w), t = t - f;
1
+ import { chainConfig as a } from "./index.native108.js";
2
+ import { defineChain as t } from "./index.native45.js";
3
+ const e = 11155111, r = /* @__PURE__ */ t({
4
+ ...a,
5
+ id: 84532,
6
+ network: "base-sepolia",
7
+ name: "Base Sepolia",
8
+ nativeCurrency: { name: "Sepolia Ether", symbol: "ETH", decimals: 18 },
9
+ rpcUrls: {
10
+ default: {
11
+ http: ["https://sepolia.base.org"]
17
12
  }
18
- return (p ? -1 : 1) * r * Math.pow(2, t - w);
19
- }, n.write = function(s, a, N, w, M, t) {
20
- var r, h, e, f = t * 8 - M - 1, i = (1 << f) - 1, o = i >> 1, x = M === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, p = w ? 0 : t - 1, c = w ? 1 : -1, I = a < 0 || a === 0 && 1 / a < 0 ? 1 : 0;
21
- for (a = Math.abs(a), isNaN(a) || a === 1 / 0 ? (h = isNaN(a) ? 1 : 0, r = i) : (r = Math.floor(Math.log(a) / Math.LN2), a * (e = Math.pow(2, -r)) < 1 && (r--, e *= 2), r + o >= 1 ? a += x / e : a += x * Math.pow(2, 1 - o), a * e >= 2 && (r++, e /= 2), r + o >= i ? (h = 0, r = i) : r + o >= 1 ? (h = (a * e - 1) * Math.pow(2, M), r = r + o) : (h = a * Math.pow(2, o - 1) * Math.pow(2, M), r = 0)); M >= 8; s[N + p] = h & 255, p += c, h /= 256, M -= 8)
22
- ;
23
- for (r = r << M | h, f += M; f > 0; s[N + p] = r & 255, p += c, r /= 256, f -= 8)
24
- ;
25
- s[N + p - c] |= I * 128;
26
- }, n);
27
- }
13
+ },
14
+ blockExplorers: {
15
+ default: {
16
+ name: "Basescan",
17
+ url: "https://sepolia.basescan.org",
18
+ apiUrl: "https://api-sepolia.basescan.org/api"
19
+ }
20
+ },
21
+ contracts: {
22
+ ...a.contracts,
23
+ disputeGameFactory: {
24
+ [e]: {
25
+ address: "0xd6E6dBf4F7EA0ac412fD8b65ED297e64BB7a06E1"
26
+ }
27
+ },
28
+ l2OutputOracle: {
29
+ [e]: {
30
+ address: "0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254"
31
+ }
32
+ },
33
+ portal: {
34
+ [e]: {
35
+ address: "0x49f53e41452c74589e85ca1677426ba426459e85",
36
+ blockCreated: 4446677
37
+ }
38
+ },
39
+ l1StandardBridge: {
40
+ [e]: {
41
+ address: "0xfd0Bf71F60660E2f608ed56e1659C450eB113120",
42
+ blockCreated: 4446677
43
+ }
44
+ },
45
+ multicall3: {
46
+ address: "0xca11bde05977b3631167028862be2a173976ca11",
47
+ blockCreated: 1059647
48
+ }
49
+ },
50
+ testnet: !0,
51
+ sourceId: e
52
+ });
53
+ ({
54
+ ...r
55
+ });
28
56
  export {
29
- q as __require
57
+ r as baseSepolia
30
58
  };
@@ -1,4 +1,6 @@
1
- const o = {
1
+ import "@coinbase/cdp-api-client";
2
+ import "viem";
3
+ const n = {
2
4
  /**
3
5
  * Retrieves a value from secure storage.
4
6
  *
@@ -75,5 +77,5 @@ const o = {
75
77
  }
76
78
  };
77
79
  export {
78
- o as nativeSecureStorage
80
+ n as nativeSecureStorage
79
81
  };
@@ -1,14 +1,16 @@
1
- const r = {
1
+ import "@coinbase/cdp-api-client";
2
+ import "viem";
3
+ const n = {
2
4
  /**
3
5
  * Retrieves a value from AsyncStorage.
4
6
  *
5
7
  * @param key - The storage key.
6
8
  * @returns Promise that resolves to the value.
7
9
  */
8
- async getItem(a) {
10
+ async getItem(t) {
9
11
  try {
10
12
  const { default: e } = await import("@react-native-async-storage/async-storage");
11
- return await e.getItem(a);
13
+ return await e.getItem(t);
12
14
  } catch (e) {
13
15
  if (e instanceof Error && e.message.includes("Cannot resolve module"))
14
16
  throw new Error(
@@ -23,14 +25,14 @@ const r = {
23
25
  * @param key - The storage key.
24
26
  * @param value - The value to store.
25
27
  */
26
- async setItem(a, e) {
28
+ async setItem(t, e) {
27
29
  try {
28
- const { default: t } = await import("@react-native-async-storage/async-storage");
29
- await t.setItem(a, e);
30
- } catch (t) {
31
- throw t instanceof Error && t.message.includes("Cannot resolve module") ? new Error(
30
+ const { default: a } = await import("@react-native-async-storage/async-storage");
31
+ await a.setItem(t, e);
32
+ } catch (a) {
33
+ throw a instanceof Error && a.message.includes("Cannot resolve module") ? new Error(
32
34
  "AsyncStorage is not available. Please install @react-native-async-storage/async-storage and ensure it's properly linked in your React Native project."
33
- ) : (console.warn(`Failed to set item in AsyncStorage: ${t}`), t);
35
+ ) : (console.warn(`Failed to set item in AsyncStorage: ${a}`), a);
34
36
  }
35
37
  },
36
38
  /**
@@ -38,10 +40,10 @@ const r = {
38
40
  *
39
41
  * @param key - The storage key.
40
42
  */
41
- async removeItem(a) {
43
+ async removeItem(t) {
42
44
  try {
43
45
  const { default: e } = await import("@react-native-async-storage/async-storage");
44
- await e.removeItem(a);
46
+ await e.removeItem(t);
45
47
  } catch (e) {
46
48
  throw e instanceof Error && e.message.includes("Cannot resolve module") ? new Error(
47
49
  "AsyncStorage is not available. Please install @react-native-async-storage/async-storage and ensure it's properly linked in your React Native project."
@@ -55,15 +57,15 @@ const r = {
55
57
  */
56
58
  async clear() {
57
59
  try {
58
- const { default: a } = await import("@react-native-async-storage/async-storage");
59
- await a.clear();
60
- } catch (a) {
61
- throw a instanceof Error && a.message.includes("Cannot resolve module") ? new Error(
60
+ const { default: t } = await import("@react-native-async-storage/async-storage");
61
+ await t.clear();
62
+ } catch (t) {
63
+ throw t instanceof Error && t.message.includes("Cannot resolve module") ? new Error(
62
64
  "AsyncStorage is not available. Please install @react-native-async-storage/async-storage and ensure it's properly linked in your React Native project."
63
- ) : (console.warn(`Failed to clear AsyncStorage: ${a}`), a);
65
+ ) : (console.warn(`Failed to clear AsyncStorage: ${t}`), t);
64
66
  }
65
67
  }
66
68
  };
67
69
  export {
68
- r as nativeStorage
70
+ n as nativeStorage
69
71
  };
@@ -1,5 +1,7 @@
1
+ import "@coinbase/cdp-api-client";
2
+ import "viem";
1
3
  let r = null;
2
- function o(t) {
4
+ function n(t) {
3
5
  r = t;
4
6
  }
5
7
  function e() {
@@ -9,19 +11,19 @@ function e() {
9
11
  );
10
12
  return r;
11
13
  }
12
- function a() {
14
+ function i() {
13
15
  return e().crypto;
14
16
  }
15
- function n() {
17
+ function u() {
16
18
  return e().storage;
17
19
  }
18
- function i() {
20
+ function p() {
19
21
  return e().oauth;
20
22
  }
21
23
  export {
22
- a as getPlatformCrypto,
23
- i as getPlatformOAuth,
24
+ i as getPlatformCrypto,
25
+ p as getPlatformOAuth,
24
26
  e as getPlatformServices,
25
- n as getPlatformStorage,
26
- o as setPlatformServices
27
+ u as getPlatformStorage,
28
+ n as setPlatformServices
27
29
  };
@@ -1,9 +1,4 @@
1
- import { bytesToHex as i } from "./index.web46.js";
2
- import { sha256 as m } from "./index.web70.js";
3
- function f(t) {
4
- const { commitment: e, version: s = 1 } = t, n = t.to ?? (typeof e == "string" ? "hex" : "bytes"), o = m(e);
5
- return o.set([s], 0), n === "bytes" ? o : i(o);
6
- }
1
+ const o = "2.33.0";
7
2
  export {
8
- f as commitmentToVersionedHash
3
+ o as version
9
4
  };
@@ -1,23 +1,23 @@
1
- import { encoder as t, decoder as o } from "./index.web90.js";
2
- import { encodeBase64 as c, decodeBase64 as a } from "./index.web110.js";
3
- function i(r) {
4
- if (Uint8Array.fromBase64)
5
- return Uint8Array.fromBase64(typeof r == "string" ? r : o.decode(r), {
6
- alphabet: "base64url"
1
+ import { BaseError as o } from "./index.web71.js";
2
+ class i extends o {
3
+ constructor({ offset: e }) {
4
+ super(`Offset \`${e}\` cannot be negative.`, {
5
+ name: "NegativeOffsetError"
7
6
  });
8
- let e = r;
9
- e instanceof Uint8Array && (e = o.decode(e)), e = e.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "");
10
- try {
11
- return a(e);
12
- } catch {
13
- throw new TypeError("The input to be decoded is not correctly encoded.");
14
7
  }
15
8
  }
16
- function p(r) {
17
- let e = r;
18
- return typeof e == "string" && (e = t.encode(e)), Uint8Array.prototype.toBase64 ? e.toBase64({ alphabet: "base64url", omitPadding: !0 }) : c(e).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
9
+ class n extends o {
10
+ constructor({ length: e, position: r }) {
11
+ super(`Position \`${r}\` is out of bounds (\`0 < position < ${e}\`).`, { name: "PositionOutOfBoundsError" });
12
+ }
13
+ }
14
+ class c extends o {
15
+ constructor({ count: e, limit: r }) {
16
+ super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${e}\`).`, { name: "RecursiveReadLimitExceededError" });
17
+ }
19
18
  }
20
19
  export {
21
- i as decode,
22
- p as encode
20
+ i as NegativeOffsetError,
21
+ n as PositionOutOfBoundsError,
22
+ c as RecursiveReadLimitExceededError
23
23
  };
@@ -1,12 +1,22 @@
1
- import n from "./index.web111.js";
2
- import s from "./index.web112.js";
3
- import a from "./index.web113.js";
4
- const y = async (t, o, e) => {
5
- const r = await a(t, o, "sign");
6
- s(t, r);
7
- const i = await crypto.subtle.sign(n(t, r.algorithm), r, e);
8
- return new Uint8Array(i);
9
- };
1
+ const o = /* @__PURE__ */ BigInt(4294967295), i = /* @__PURE__ */ BigInt(32);
2
+ function s(t, r = !1) {
3
+ return r ? { h: Number(t & o), l: Number(t >> i & o) } : { h: Number(t >> i & o) | 0, l: Number(t & o) | 0 };
4
+ }
5
+ function h(t, r = !1) {
6
+ const n = t.length;
7
+ let l = new Uint32Array(n), c = new Uint32Array(n);
8
+ for (let e = 0; e < n; e++) {
9
+ const { h: u, l: f } = s(t[e], r);
10
+ [l[e], c[e]] = [u, f];
11
+ }
12
+ return [l, c];
13
+ }
14
+ const m = (t, r, n) => t << n | r >>> 32 - n, A = (t, r, n) => r << n | t >>> 32 - n, B = (t, r, n) => r << n - 32 | t >>> 64 - n, a = (t, r, n) => t << n - 32 | r >>> 64 - n;
10
15
  export {
11
- y as default
16
+ s as fromBig,
17
+ B as rotlBH,
18
+ a as rotlBL,
19
+ m as rotlSH,
20
+ A as rotlSL,
21
+ h as split
12
22
  };