@coinbase/cdp-core 0.0.53 → 0.0.54

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 (299) 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 +1 -1
  29. package/dist/esm/index.native13.js +3 -3
  30. package/dist/esm/index.native132.js +3 -46
  31. package/dist/esm/index.native133.js +20 -3
  32. package/dist/esm/index.native134.js +10 -21
  33. package/dist/esm/index.native135.js +19 -9
  34. package/dist/esm/index.native136.js +89 -15
  35. package/dist/esm/index.native137.js +19 -92
  36. package/dist/esm/index.native138.js +115 -18
  37. package/dist/esm/index.native139.js +2 -118
  38. package/dist/esm/index.native14.js +3 -3
  39. package/dist/esm/index.native140.js +109 -2
  40. package/dist/esm/index.native141.js +2 -109
  41. package/dist/esm/index.native142.js +47 -2
  42. package/dist/esm/index.native15.js +3 -3
  43. package/dist/esm/index.native153.js +17 -14
  44. package/dist/esm/index.native154.js +28 -18
  45. package/dist/esm/index.native155.js +6 -26
  46. package/dist/esm/index.native156.js +9 -6
  47. package/dist/esm/index.native157.js +13 -11
  48. package/dist/esm/index.native158.js +8 -11
  49. package/dist/esm/index.native159.js +14 -7
  50. package/dist/esm/index.native16.js +3 -3
  51. package/dist/esm/index.native160.js +80 -16
  52. package/dist/esm/index.native161.js +14 -80
  53. package/dist/esm/index.native19.js +1 -1
  54. package/dist/esm/index.native22.js +28 -3
  55. package/dist/esm/index.native23.js +3 -51
  56. package/dist/esm/index.native24.js +53 -2
  57. package/dist/esm/index.native25.js +2 -86
  58. package/dist/esm/index.native26.js +87 -15
  59. package/dist/esm/index.native27.js +15 -17
  60. package/dist/esm/index.native28.js +15 -116
  61. package/dist/esm/index.native29.js +92 -34
  62. package/dist/esm/index.native3.js +48 -6
  63. package/dist/esm/index.native30.js +58 -12
  64. package/dist/esm/index.native31.js +15 -42
  65. package/dist/esm/index.native32.js +42 -28
  66. package/dist/esm/index.native44.js +1 -1
  67. package/dist/esm/index.native45.js +1 -1
  68. package/dist/esm/index.native46.js +3 -3
  69. package/dist/esm/index.native47.js +12 -12
  70. package/dist/esm/index.native48.js +12 -12
  71. package/dist/esm/index.native49.js +1 -1
  72. package/dist/esm/index.native51.js +4 -4
  73. package/dist/esm/index.native52.js +4 -2
  74. package/dist/esm/index.native53.js +2 -66
  75. package/dist/esm/index.native54.js +2 -367
  76. package/dist/esm/index.native55.js +66 -2
  77. package/dist/esm/index.native56.js +365 -2
  78. package/dist/esm/index.native7.js +11 -11
  79. package/dist/esm/index.native72.js +1 -1
  80. package/dist/esm/index.native8.js +4 -4
  81. package/dist/esm/index.native9.js +4 -4
  82. package/dist/esm/index.native96.js +54 -4
  83. package/dist/esm/index.native97.js +10 -18
  84. package/dist/esm/index.native98.js +2 -8
  85. package/dist/esm/index.native99.js +45 -4
  86. package/dist/esm/index.web100.js +8 -4
  87. package/dist/esm/index.web101.js +8 -2
  88. package/dist/esm/index.web102.js +71 -4
  89. package/dist/esm/index.web103.js +12 -12
  90. package/dist/esm/index.web104.js +3 -7
  91. package/dist/esm/index.web105.js +4 -3
  92. package/dist/esm/index.web106.js +4 -19
  93. package/dist/esm/index.web107.js +4 -8
  94. package/dist/esm/index.web108.js +19 -7
  95. package/dist/esm/index.web109.js +47 -66
  96. package/dist/esm/index.web110.js +17 -18
  97. package/dist/esm/index.web111.js +20 -3
  98. package/dist/esm/index.web112.js +8 -4
  99. package/dist/esm/index.web113.js +30 -4
  100. package/dist/esm/index.web114.js +7 -4
  101. package/dist/esm/index.web115.js +11 -10
  102. package/dist/esm/index.web116.js +4 -52
  103. package/dist/esm/index.web117.js +54 -17
  104. package/dist/esm/index.web118.js +10 -20
  105. package/dist/esm/index.web119.js +2 -9
  106. package/dist/esm/index.web120.js +44 -30
  107. package/dist/esm/index.web121.js +13 -7
  108. package/dist/esm/index.web122.js +2 -21
  109. package/dist/esm/index.web124.js +1 -1
  110. package/dist/esm/index.web127.js +1 -1
  111. package/dist/esm/index.web130.js +77 -19
  112. package/dist/esm/index.web131.js +4 -10
  113. package/dist/esm/index.web132.js +2 -20
  114. package/dist/esm/index.web133.js +104 -89
  115. package/dist/esm/index.web134.js +2 -21
  116. package/dist/esm/index.web135.js +20 -117
  117. package/dist/esm/index.web136.js +10 -2
  118. package/dist/esm/index.web137.js +18 -107
  119. package/dist/esm/index.web138.js +94 -2
  120. package/dist/esm/index.web139.js +20 -78
  121. package/dist/esm/index.web140.js +118 -4
  122. package/dist/esm/index.web141.js +1 -1
  123. package/dist/esm/index.web153.js +1 -1
  124. package/dist/esm/index.web158.js +1 -1
  125. package/dist/esm/index.web159.js +1 -1
  126. package/dist/esm/index.web24.js +33 -29
  127. package/dist/esm/index.web34.js +3 -3
  128. package/dist/esm/index.web40.js +2 -2
  129. package/dist/esm/index.web45.js +3 -3
  130. package/dist/esm/index.web46.js +31 -2
  131. package/dist/esm/index.web47.js +28 -65
  132. package/dist/esm/index.web48.js +2 -367
  133. package/dist/esm/index.web49.js +63 -14
  134. package/dist/esm/index.web50.js +360 -18
  135. package/dist/esm/index.web51.js +13 -47
  136. package/dist/esm/index.web52.js +22 -28
  137. package/dist/esm/index.web53.js +50 -28
  138. package/dist/esm/index.web71.js +1 -1
  139. package/dist/esm/index.web95.js +4 -54
  140. package/dist/esm/index.web96.js +18 -10
  141. package/dist/esm/index.web97.js +8 -2
  142. package/dist/esm/index.web98.js +4 -45
  143. package/dist/esm/index.web99.js +19 -13
  144. package/dist/native/index.native10.js +4 -4
  145. package/dist/native/index.native100.js +13 -19
  146. package/dist/native/index.native101.js +4 -8
  147. package/dist/native/index.native102.js +2 -8
  148. package/dist/native/index.native103.js +4 -71
  149. package/dist/native/index.native104.js +12 -12
  150. package/dist/native/index.native105.js +7 -3
  151. package/dist/native/index.native106.js +3 -4
  152. package/dist/native/index.native107.js +19 -4
  153. package/dist/native/index.native108.js +8 -4
  154. package/dist/native/index.native109.js +7 -19
  155. package/dist/native/index.native11.js +3 -3
  156. package/dist/native/index.native110.js +66 -47
  157. package/dist/native/index.native111.js +18 -17
  158. package/dist/native/index.native112.js +3 -20
  159. package/dist/native/index.native113.js +4 -8
  160. package/dist/native/index.native114.js +4 -30
  161. package/dist/native/index.native115.js +4 -7
  162. package/dist/native/index.native116.js +10 -11
  163. package/dist/native/index.native117.js +50 -52
  164. package/dist/native/index.native118.js +17 -10
  165. package/dist/native/index.native119.js +21 -2
  166. package/dist/native/index.native12.js +3 -3
  167. package/dist/native/index.native120.js +9 -45
  168. package/dist/native/index.native121.js +30 -13
  169. package/dist/native/index.native122.js +7 -4
  170. package/dist/native/index.native123.js +21 -2
  171. package/dist/native/index.native125.js +1 -1
  172. package/dist/native/index.native13.js +3 -3
  173. package/dist/native/index.native132.js +3 -46
  174. package/dist/native/index.native133.js +20 -3
  175. package/dist/native/index.native134.js +10 -21
  176. package/dist/native/index.native135.js +19 -9
  177. package/dist/native/index.native136.js +89 -15
  178. package/dist/native/index.native137.js +19 -92
  179. package/dist/native/index.native138.js +115 -18
  180. package/dist/native/index.native139.js +2 -118
  181. package/dist/native/index.native14.js +3 -3
  182. package/dist/native/index.native140.js +109 -2
  183. package/dist/native/index.native141.js +2 -109
  184. package/dist/native/index.native142.js +47 -2
  185. package/dist/native/index.native15.js +3 -3
  186. package/dist/native/index.native153.js +17 -14
  187. package/dist/native/index.native154.js +28 -18
  188. package/dist/native/index.native155.js +6 -26
  189. package/dist/native/index.native156.js +9 -6
  190. package/dist/native/index.native157.js +13 -11
  191. package/dist/native/index.native158.js +8 -11
  192. package/dist/native/index.native159.js +14 -7
  193. package/dist/native/index.native16.js +3 -3
  194. package/dist/native/index.native160.js +80 -16
  195. package/dist/native/index.native161.js +14 -80
  196. package/dist/native/index.native19.js +1 -1
  197. package/dist/native/index.native22.js +28 -3
  198. package/dist/native/index.native23.js +3 -51
  199. package/dist/native/index.native24.js +53 -2
  200. package/dist/native/index.native25.js +2 -86
  201. package/dist/native/index.native26.js +87 -15
  202. package/dist/native/index.native27.js +15 -17
  203. package/dist/native/index.native28.js +15 -116
  204. package/dist/native/index.native29.js +92 -34
  205. package/dist/native/index.native3.js +48 -6
  206. package/dist/native/index.native30.js +58 -12
  207. package/dist/native/index.native31.js +15 -42
  208. package/dist/native/index.native32.js +42 -28
  209. package/dist/native/index.native44.js +1 -1
  210. package/dist/native/index.native45.js +1 -1
  211. package/dist/native/index.native46.js +3 -3
  212. package/dist/native/index.native47.js +12 -12
  213. package/dist/native/index.native48.js +12 -12
  214. package/dist/native/index.native49.js +1 -1
  215. package/dist/native/index.native51.js +4 -4
  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 +1 -0
  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 +1 -0
  237. package/dist/web/index.web100.js +8 -4
  238. package/dist/web/index.web101.js +8 -2
  239. package/dist/web/index.web102.js +71 -4
  240. package/dist/web/index.web103.js +12 -12
  241. package/dist/web/index.web104.js +3 -7
  242. package/dist/web/index.web105.js +4 -3
  243. package/dist/web/index.web106.js +4 -19
  244. package/dist/web/index.web107.js +4 -8
  245. package/dist/web/index.web108.js +19 -7
  246. package/dist/web/index.web109.js +47 -66
  247. package/dist/web/index.web110.js +17 -18
  248. package/dist/web/index.web111.js +20 -3
  249. package/dist/web/index.web112.js +8 -4
  250. package/dist/web/index.web113.js +30 -4
  251. package/dist/web/index.web114.js +7 -4
  252. package/dist/web/index.web115.js +11 -10
  253. package/dist/web/index.web116.js +4 -52
  254. package/dist/web/index.web117.js +54 -17
  255. package/dist/web/index.web118.js +10 -20
  256. package/dist/web/index.web119.js +2 -9
  257. package/dist/web/index.web120.js +44 -30
  258. package/dist/web/index.web121.js +13 -7
  259. package/dist/web/index.web122.js +2 -21
  260. package/dist/web/index.web124.js +1 -1
  261. package/dist/web/index.web127.js +1 -1
  262. package/dist/web/index.web130.js +77 -19
  263. package/dist/web/index.web131.js +4 -10
  264. package/dist/web/index.web132.js +2 -20
  265. package/dist/web/index.web133.js +104 -89
  266. package/dist/web/index.web134.js +2 -21
  267. package/dist/web/index.web135.js +20 -117
  268. package/dist/web/index.web136.js +10 -2
  269. package/dist/web/index.web137.js +18 -107
  270. package/dist/web/index.web138.js +94 -2
  271. package/dist/web/index.web139.js +20 -78
  272. package/dist/web/index.web140.js +118 -4
  273. package/dist/web/index.web141.js +1 -1
  274. package/dist/web/index.web153.js +1 -1
  275. package/dist/web/index.web158.js +1 -1
  276. package/dist/web/index.web159.js +1 -1
  277. package/dist/web/index.web24.js +33 -29
  278. package/dist/web/index.web34.js +3 -3
  279. package/dist/web/index.web40.js +2 -2
  280. package/dist/web/index.web45.js +3 -3
  281. package/dist/web/index.web46.js +31 -2
  282. package/dist/web/index.web47.js +28 -65
  283. package/dist/web/index.web48.js +2 -367
  284. package/dist/web/index.web49.js +63 -14
  285. package/dist/web/index.web50.js +360 -18
  286. package/dist/web/index.web51.js +13 -47
  287. package/dist/web/index.web52.js +22 -28
  288. package/dist/web/index.web53.js +50 -28
  289. package/dist/web/index.web71.js +1 -1
  290. package/dist/web/index.web95.js +4 -54
  291. package/dist/web/index.web96.js +18 -10
  292. package/dist/web/index.web97.js +8 -2
  293. package/dist/web/index.web98.js +4 -45
  294. package/dist/web/index.web99.js +19 -13
  295. package/dist/web-types/auth/oAuthManager.d.ts +1 -1
  296. package/dist/web-types/auth/types.d.ts +1 -1
  297. package/dist/web-types/platform/types.d.ts +1 -1
  298. package/dist/web-types/types.d.ts +1 -0
  299. package/package.json +7 -3
@@ -1,8 +1,8 @@
1
1
  import { initiateAuthentication as e } from "@coinbase/cdp-api-client";
2
- import { Analytics as n } from "./index.native23.js";
3
- import "./index.native24.js";
2
+ import { Analytics as n } from "./index.native24.js";
3
+ import "./index.native25.js";
4
4
  import { getPlatformOAuth as i } from "./index.native6.js";
5
- import { getCoreAuthManager as r, getConfig as o } from "./index.native32.js";
5
+ import { getCoreAuthManager as r, getConfig as o } from "./index.native22.js";
6
6
  async function g() {
7
7
  if (n.sendActionCallEvent({ name: "link_apple" }), !await r().isSignedIn())
8
8
  throw new Error("User must be signed in to link an Apple account");
@@ -1,17 +1,20 @@
1
- import { SizeExceedsPaddingSizeError as a } from "./index.native132.js";
2
- function o(r, i = {}) {
3
- const { dir: n, size: e = 32 } = i;
4
- if (e === 0)
5
- return r;
6
- const t = r.replace("0x", "");
7
- if (t.length > e * 2)
8
- throw new a({
9
- size: Math.ceil(t.length / 2),
10
- targetSize: e,
11
- type: "Hex"
12
- });
13
- return `0x${t[n === "right" ? "padEnd" : "padStart"](e * 2, "0")}`;
1
+ function o(t) {
2
+ if (Uint8Array.prototype.toBase64)
3
+ return t.toBase64();
4
+ const e = 32768, n = [];
5
+ for (let r = 0; r < t.length; r += e)
6
+ n.push(String.fromCharCode.apply(null, t.subarray(r, r + e)));
7
+ return btoa(n.join(""));
8
+ }
9
+ function a(t) {
10
+ if (Uint8Array.fromBase64)
11
+ return Uint8Array.fromBase64(t);
12
+ const e = atob(t), n = new Uint8Array(e.length);
13
+ for (let r = 0; r < e.length; r++)
14
+ n[r] = e.charCodeAt(r);
15
+ return n;
14
16
  }
15
17
  export {
16
- o as pad
18
+ a as decodeBase64,
19
+ o as encodeBase64
17
20
  };
@@ -1,20 +1,30 @@
1
- function o(t) {
2
- if (Uint8Array.prototype.toBase64)
3
- return t.toBase64();
4
- const e = 32768, n = [];
5
- for (let r = 0; r < t.length; r += e)
6
- n.push(String.fromCharCode.apply(null, t.subarray(r, r + e)));
7
- return btoa(n.join(""));
8
- }
9
- function a(t) {
10
- if (Uint8Array.fromBase64)
11
- return Uint8Array.fromBase64(t);
12
- const e = atob(t), n = new Uint8Array(e.length);
13
- for (let r = 0; r < e.length; r++)
14
- n[r] = e.charCodeAt(r);
15
- return n;
16
- }
1
+ import { JOSENotSupported as r } from "./index.native50.js";
2
+ const S = (e, s) => {
3
+ const a = `SHA-${e.slice(-3)}`;
4
+ switch (e) {
5
+ case "HS256":
6
+ case "HS384":
7
+ case "HS512":
8
+ return { hash: a, name: "HMAC" };
9
+ case "PS256":
10
+ case "PS384":
11
+ case "PS512":
12
+ return { hash: a, name: "RSA-PSS", saltLength: parseInt(e.slice(-3), 10) >> 3 };
13
+ case "RS256":
14
+ case "RS384":
15
+ case "RS512":
16
+ return { hash: a, name: "RSASSA-PKCS1-v1_5" };
17
+ case "ES256":
18
+ case "ES384":
19
+ case "ES512":
20
+ return { hash: a, name: "ECDSA", namedCurve: s.namedCurve };
21
+ case "Ed25519":
22
+ case "EdDSA":
23
+ return { name: "Ed25519" };
24
+ default:
25
+ throw new r(`alg ${e} is not supported either by JOSE or your javascript runtime`);
26
+ }
27
+ };
17
28
  export {
18
- a as decodeBase64,
19
- o as encodeBase64
29
+ S as default
20
30
  };
@@ -1,30 +1,10 @@
1
- import { JOSENotSupported as r } from "./index.native50.js";
2
- const S = (e, s) => {
3
- const a = `SHA-${e.slice(-3)}`;
4
- switch (e) {
5
- case "HS256":
6
- case "HS384":
7
- case "HS512":
8
- return { hash: a, name: "HMAC" };
9
- case "PS256":
10
- case "PS384":
11
- case "PS512":
12
- return { hash: a, name: "RSA-PSS", saltLength: parseInt(e.slice(-3), 10) >> 3 };
13
- case "RS256":
14
- case "RS384":
15
- case "RS512":
16
- return { hash: a, name: "RSASSA-PKCS1-v1_5" };
17
- case "ES256":
18
- case "ES384":
19
- case "ES512":
20
- return { hash: a, name: "ECDSA", namedCurve: s.namedCurve };
21
- case "Ed25519":
22
- case "EdDSA":
23
- return { name: "Ed25519" };
24
- default:
25
- throw new r(`alg ${e} is not supported either by JOSE or your javascript runtime`);
1
+ const o = (t, r) => {
2
+ if (t.startsWith("RS") || t.startsWith("PS")) {
3
+ const { modulusLength: e } = r.algorithm;
4
+ if (typeof e != "number" || e < 2048)
5
+ throw new TypeError(`${t} requires key modulusLength to be 2048 bits or larger`);
26
6
  }
27
7
  };
28
8
  export {
29
- S as default
9
+ o as default
30
10
  };
@@ -1,10 +1,13 @@
1
- const o = (t, r) => {
2
- if (t.startsWith("RS") || t.startsWith("PS")) {
3
- const { modulusLength: e } = r.algorithm;
4
- if (typeof e != "number" || e < 2048)
5
- throw new TypeError(`${t} requires key modulusLength to be 2048 bits or larger`);
1
+ import { checkSigCryptoKey as i } from "./index.native165.js";
2
+ import o from "./index.native157.js";
3
+ const s = async (t, r, e) => {
4
+ if (r instanceof Uint8Array) {
5
+ if (!t.startsWith("HS"))
6
+ throw new TypeError(o(r, "CryptoKey", "KeyObject", "JSON Web Key"));
7
+ return crypto.subtle.importKey("raw", r, { hash: `SHA-${t.slice(-3)}`, name: "HMAC" }, !1, [e]);
6
8
  }
9
+ return i(r, t, e), r;
7
10
  };
8
11
  export {
9
- o as default
12
+ s as default
10
13
  };
@@ -1,13 +1,15 @@
1
- import { checkSigCryptoKey as i } from "./index.native165.js";
2
- import o from "./index.native158.js";
3
- const s = async (t, r, e) => {
4
- if (r instanceof Uint8Array) {
5
- if (!t.startsWith("HS"))
6
- throw new TypeError(o(r, "CryptoKey", "KeyObject", "JSON Web Key"));
7
- return crypto.subtle.importKey("raw", r, { hash: `SHA-${t.slice(-3)}`, name: "HMAC" }, !1, [e]);
8
- }
9
- return i(r, t, e), r;
10
- };
1
+ function i(n, e, ...o) {
2
+ if (o = o.filter(Boolean), o.length > 2) {
3
+ const f = o.pop();
4
+ n += `one of type ${o.join(", ")}, or ${f}.`;
5
+ } else o.length === 2 ? n += `one of type ${o[0]} or ${o[1]}.` : n += `of type ${o[0]}.`;
6
+ return e == null ? n += ` Received ${e}` : typeof e == "function" && e.name ? n += ` Received function ${e.name}` : typeof e == "object" && e != null && e.constructor?.name && (n += ` Received an instance of ${e.constructor.name}`), n;
7
+ }
8
+ const r = (n, ...e) => i("Key must be ", n, ...e);
9
+ function t(n, e, ...o) {
10
+ return i(`Key for the ${n} algorithm must be `, e, ...o);
11
+ }
11
12
  export {
12
- s as default
13
+ r as default,
14
+ t as withAlg
13
15
  };
@@ -1,15 +1,12 @@
1
- function i(n, e, ...o) {
2
- if (o = o.filter(Boolean), o.length > 2) {
3
- const f = o.pop();
4
- n += `one of type ${o.join(", ")}, or ${f}.`;
5
- } else o.length === 2 ? n += `one of type ${o[0]} or ${o[1]}.` : n += `of type ${o[0]}.`;
6
- return e == null ? n += ` Received ${e}` : typeof e == "function" && e.name ? n += ` Received function ${e.name}` : typeof e == "object" && e != null && e.constructor?.name && (n += ` Received an instance of ${e.constructor.name}`), n;
1
+ function e(t) {
2
+ return t?.[Symbol.toStringTag] === "CryptoKey";
7
3
  }
8
- const r = (n, ...e) => i("Key must be ", n, ...e);
9
- function t(n, e, ...o) {
10
- return i(`Key for the ${n} algorithm must be `, e, ...o);
4
+ function r(t) {
5
+ return t?.[Symbol.toStringTag] === "KeyObject";
11
6
  }
7
+ const n = (t) => e(t) || r(t);
12
8
  export {
13
- r as default,
14
- t as withAlg
9
+ n as default,
10
+ e as isCryptoKey,
11
+ r as isKeyObject
15
12
  };
@@ -1,12 +1,19 @@
1
+ import n from "./index.native100.js";
2
+ function r(t) {
3
+ return n(t) && typeof t.kty == "string";
4
+ }
5
+ function o(t) {
6
+ return t.kty !== "oct" && typeof t.d == "string";
7
+ }
1
8
  function e(t) {
2
- return t?.[Symbol.toStringTag] === "CryptoKey";
9
+ return t.kty !== "oct" && typeof t.d > "u";
3
10
  }
4
- function r(t) {
5
- return t?.[Symbol.toStringTag] === "KeyObject";
11
+ function c(t) {
12
+ return t.kty === "oct" && typeof t.k == "string";
6
13
  }
7
- const n = (t) => e(t) || r(t);
8
14
  export {
9
- n as default,
10
- e as isCryptoKey,
11
- r as isKeyObject
15
+ r as isJWK,
16
+ o as isPrivateJWK,
17
+ e as isPublicJWK,
18
+ c as isSecretJWK
12
19
  };
@@ -1,10 +1,10 @@
1
1
  import { logOutEndUser as l, refreshAccessToken as o, registerTemporaryWalletSecret as c } from "@coinbase/cdp-api-client";
2
2
  import { SignJWT as u } from "./index.native35.js";
3
- import { toAuthState as f } from "./index.native26.js";
3
+ import { toAuthState as f } from "./index.native27.js";
4
4
  import "viem";
5
5
  import { getPlatformCrypto as n } from "./index.native6.js";
6
- import { sortKeys as S } from "./index.native31.js";
7
- import { getCoreOAuthManager as w } from "./index.native32.js";
6
+ import { sortKeys as S } from "./index.native32.js";
7
+ import { getCoreOAuthManager as w } from "./index.native22.js";
8
8
  const i = 60 * 1e3;
9
9
  class I {
10
10
  projectId;
@@ -1,19 +1,83 @@
1
- import n from "./index.native121.js";
2
- function r(t) {
3
- return n(t) && typeof t.kty == "string";
4
- }
5
- function o(t) {
6
- return t.kty !== "oct" && typeof t.d == "string";
7
- }
8
- function e(t) {
9
- return t.kty !== "oct" && typeof t.d > "u";
10
- }
11
- function c(t) {
12
- return t.kty === "oct" && typeof t.k == "string";
1
+ import { JOSENotSupported as s } from "./index.native50.js";
2
+ function n(e) {
3
+ let a, r;
4
+ switch (e.kty) {
5
+ case "RSA": {
6
+ switch (e.alg) {
7
+ case "PS256":
8
+ case "PS384":
9
+ case "PS512":
10
+ a = { name: "RSA-PSS", hash: `SHA-${e.alg.slice(-3)}` }, r = e.d ? ["sign"] : ["verify"];
11
+ break;
12
+ case "RS256":
13
+ case "RS384":
14
+ case "RS512":
15
+ a = { name: "RSASSA-PKCS1-v1_5", hash: `SHA-${e.alg.slice(-3)}` }, r = e.d ? ["sign"] : ["verify"];
16
+ break;
17
+ case "RSA-OAEP":
18
+ case "RSA-OAEP-256":
19
+ case "RSA-OAEP-384":
20
+ case "RSA-OAEP-512":
21
+ a = {
22
+ name: "RSA-OAEP",
23
+ hash: `SHA-${parseInt(e.alg.slice(-3), 10) || 1}`
24
+ }, r = e.d ? ["decrypt", "unwrapKey"] : ["encrypt", "wrapKey"];
25
+ break;
26
+ default:
27
+ throw new s('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
28
+ }
29
+ break;
30
+ }
31
+ case "EC": {
32
+ switch (e.alg) {
33
+ case "ES256":
34
+ a = { name: "ECDSA", namedCurve: "P-256" }, r = e.d ? ["sign"] : ["verify"];
35
+ break;
36
+ case "ES384":
37
+ a = { name: "ECDSA", namedCurve: "P-384" }, r = e.d ? ["sign"] : ["verify"];
38
+ break;
39
+ case "ES512":
40
+ a = { name: "ECDSA", namedCurve: "P-521" }, r = e.d ? ["sign"] : ["verify"];
41
+ break;
42
+ case "ECDH-ES":
43
+ case "ECDH-ES+A128KW":
44
+ case "ECDH-ES+A192KW":
45
+ case "ECDH-ES+A256KW":
46
+ a = { name: "ECDH", namedCurve: e.crv }, r = e.d ? ["deriveBits"] : [];
47
+ break;
48
+ default:
49
+ throw new s('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
50
+ }
51
+ break;
52
+ }
53
+ case "OKP": {
54
+ switch (e.alg) {
55
+ case "Ed25519":
56
+ case "EdDSA":
57
+ a = { name: "Ed25519" }, r = e.d ? ["sign"] : ["verify"];
58
+ break;
59
+ case "ECDH-ES":
60
+ case "ECDH-ES+A128KW":
61
+ case "ECDH-ES+A192KW":
62
+ case "ECDH-ES+A256KW":
63
+ a = { name: e.crv }, r = e.d ? ["deriveBits"] : [];
64
+ break;
65
+ default:
66
+ throw new s('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
67
+ }
68
+ break;
69
+ }
70
+ default:
71
+ throw new s('Invalid or unsupported JWK "kty" (Key Type) Parameter value');
72
+ }
73
+ return { algorithm: a, keyUsages: r };
13
74
  }
75
+ const i = async (e) => {
76
+ if (!e.alg)
77
+ throw new TypeError('"alg" argument is required when "jwk.alg" is not present');
78
+ const { algorithm: a, keyUsages: r } = n(e), t = { ...e };
79
+ return delete t.alg, delete t.use, crypto.subtle.importKey("jwk", t, a, e.ext ?? !e.d, e.key_ops ?? r);
80
+ };
14
81
  export {
15
- r as isJWK,
16
- o as isPrivateJWK,
17
- e as isPublicJWK,
18
- c as isSecretJWK
82
+ i as default
19
83
  };
@@ -1,83 +1,17 @@
1
- import { JOSENotSupported as s } from "./index.native50.js";
2
- function n(e) {
3
- let a, r;
4
- switch (e.kty) {
5
- case "RSA": {
6
- switch (e.alg) {
7
- case "PS256":
8
- case "PS384":
9
- case "PS512":
10
- a = { name: "RSA-PSS", hash: `SHA-${e.alg.slice(-3)}` }, r = e.d ? ["sign"] : ["verify"];
11
- break;
12
- case "RS256":
13
- case "RS384":
14
- case "RS512":
15
- a = { name: "RSASSA-PKCS1-v1_5", hash: `SHA-${e.alg.slice(-3)}` }, r = e.d ? ["sign"] : ["verify"];
16
- break;
17
- case "RSA-OAEP":
18
- case "RSA-OAEP-256":
19
- case "RSA-OAEP-384":
20
- case "RSA-OAEP-512":
21
- a = {
22
- name: "RSA-OAEP",
23
- hash: `SHA-${parseInt(e.alg.slice(-3), 10) || 1}`
24
- }, r = e.d ? ["decrypt", "unwrapKey"] : ["encrypt", "wrapKey"];
25
- break;
26
- default:
27
- throw new s('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
28
- }
29
- break;
30
- }
31
- case "EC": {
32
- switch (e.alg) {
33
- case "ES256":
34
- a = { name: "ECDSA", namedCurve: "P-256" }, r = e.d ? ["sign"] : ["verify"];
35
- break;
36
- case "ES384":
37
- a = { name: "ECDSA", namedCurve: "P-384" }, r = e.d ? ["sign"] : ["verify"];
38
- break;
39
- case "ES512":
40
- a = { name: "ECDSA", namedCurve: "P-521" }, r = e.d ? ["sign"] : ["verify"];
41
- break;
42
- case "ECDH-ES":
43
- case "ECDH-ES+A128KW":
44
- case "ECDH-ES+A192KW":
45
- case "ECDH-ES+A256KW":
46
- a = { name: "ECDH", namedCurve: e.crv }, r = e.d ? ["deriveBits"] : [];
47
- break;
48
- default:
49
- throw new s('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
50
- }
51
- break;
52
- }
53
- case "OKP": {
54
- switch (e.alg) {
55
- case "Ed25519":
56
- case "EdDSA":
57
- a = { name: "Ed25519" }, r = e.d ? ["sign"] : ["verify"];
58
- break;
59
- case "ECDH-ES":
60
- case "ECDH-ES+A128KW":
61
- case "ECDH-ES+A192KW":
62
- case "ECDH-ES+A256KW":
63
- a = { name: e.crv }, r = e.d ? ["deriveBits"] : [];
64
- break;
65
- default:
66
- throw new s('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
67
- }
68
- break;
69
- }
70
- default:
71
- throw new s('Invalid or unsupported JWK "kty" (Key Type) Parameter value');
72
- }
73
- return { algorithm: a, keyUsages: r };
1
+ import { SizeExceedsPaddingSizeError as a } from "./index.native142.js";
2
+ function o(r, i = {}) {
3
+ const { dir: n, size: e = 32 } = i;
4
+ if (e === 0)
5
+ return r;
6
+ const t = r.replace("0x", "");
7
+ if (t.length > e * 2)
8
+ throw new a({
9
+ size: Math.ceil(t.length / 2),
10
+ targetSize: e,
11
+ type: "Hex"
12
+ });
13
+ return `0x${t[n === "right" ? "padEnd" : "padStart"](e * 2, "0")}`;
74
14
  }
75
- const i = async (e) => {
76
- if (!e.alg)
77
- throw new TypeError('"alg" argument is required when "jwk.alg" is not present');
78
- const { algorithm: a, keyUsages: r } = n(e), t = { ...e };
79
- return delete t.alg, delete t.use, crypto.subtle.importKey("jwk", t, a, e.ext ?? !e.d, e.key_ops ?? r);
80
- };
81
15
  export {
82
- i as default
16
+ o as pad
83
17
  };
@@ -3,8 +3,8 @@ import { subscribeWithSelector as p, persist as d, createJSONStorage as h } from
3
3
  import { EventEmitter as f } from "./index.native40.js";
4
4
  import { onAuthStateChange as u } from "./index.native7.js";
5
5
  import "@coinbase/cdp-api-client";
6
- import "./index.native23.js";
7
6
  import "./index.native24.js";
7
+ import "./index.native25.js";
8
8
  import "viem";
9
9
  import { getPlatformStorage as g } from "./index.native6.js";
10
10
  import { createProvider as l } from "./index.native41.js";
@@ -1,5 +1,30 @@
1
- import { __require as r } from "./index.native42.js";
2
- var f = r();
1
+ import "@coinbase/cdp-api-client";
2
+ import "viem";
3
+ let r = null, n = null, e = null;
4
+ const a = (t) => {
5
+ r = t;
6
+ }, g = () => {
7
+ if (!r)
8
+ throw new Error("SDK not initialized");
9
+ return r;
10
+ }, l = (t) => {
11
+ n = t;
12
+ }, u = () => {
13
+ if (!n)
14
+ throw new Error("SDK not initialized");
15
+ return n;
16
+ }, h = (t) => {
17
+ e = t;
18
+ }, s = () => {
19
+ if (!e)
20
+ throw new Error("SDK not initialized");
21
+ return e;
22
+ };
3
23
  export {
4
- f as b
24
+ g as getConfig,
25
+ u as getCoreAuthManager,
26
+ s as getCoreOAuthManager,
27
+ a as setConfig,
28
+ l as setCoreAuthManager,
29
+ h as setCoreOAuthManager
5
30
  };
@@ -1,53 +1,5 @@
1
- import f from "./index.native125.js";
2
- const p = "1f8d3e558f493e38a037dbfadb8ba344", m = "d473b1dcc969105adab157226cd9cf63", i = Symbol.for("@coinbase/cdp-analytics");
3
- function u() {
4
- const t = globalThis;
5
- return t[i] || (t[i] = {
6
- identifier: "",
7
- enabled: !0,
8
- isProduction: !1,
9
- isUsingMocks: !1,
10
- sendEvent: o,
11
- sendActionCallEvent: (n) => o({ ...n, type: "action_call" }),
12
- sendHookCallEvent: (n) => o({ ...n, type: "hook_call" }),
13
- sendComponentCallEvent: (n) => o({ ...n, type: "component_call" })
14
- }), t[i];
15
- }
16
- const e = u();
17
- async function o(t) {
18
- if (!e.enabled || !e.identifier)
19
- return;
20
- const n = Date.now(), a = [{
21
- user_id: e.identifier,
22
- event_type: t.type,
23
- platform: s() ? "web" : "native",
24
- timestamp: n,
25
- event_properties: {
26
- project_name: "cdp-embedded-wallet",
27
- isLocalHost: y(),
28
- isUsingMocks: e.isUsingMocks,
29
- ...t
30
- }
31
- }], c = JSON.stringify(a), d = n.toString(), l = f(c + d), r = {
32
- client: e.isProduction ? m : p,
33
- e: c,
34
- checksum: l
35
- };
36
- await fetch("https://cca-lite.coinbase.com/amp", {
37
- method: "POST",
38
- mode: "no-cors",
39
- headers: {
40
- "Content-Type": "application/json"
41
- },
42
- body: JSON.stringify(r)
43
- });
44
- }
45
- function s() {
46
- return typeof window < "u" && typeof document < "u";
47
- }
48
- function y() {
49
- return s() ? window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" : !1;
50
- }
1
+ import { __require as r } from "./index.native42.js";
2
+ var f = r();
51
3
  export {
52
- e as Analytics
4
+ f as b
53
5
  };
@@ -1,2 +1,53 @@
1
- import { __require as r } from "./index.native148.js";
2
- r();
1
+ import f from "./index.native125.js";
2
+ const p = "1f8d3e558f493e38a037dbfadb8ba344", m = "d473b1dcc969105adab157226cd9cf63", i = Symbol.for("@coinbase/cdp-analytics");
3
+ function u() {
4
+ const t = globalThis;
5
+ return t[i] || (t[i] = {
6
+ identifier: "",
7
+ enabled: !0,
8
+ isProduction: !1,
9
+ isUsingMocks: !1,
10
+ sendEvent: o,
11
+ sendActionCallEvent: (n) => o({ ...n, type: "action_call" }),
12
+ sendHookCallEvent: (n) => o({ ...n, type: "hook_call" }),
13
+ sendComponentCallEvent: (n) => o({ ...n, type: "component_call" })
14
+ }), t[i];
15
+ }
16
+ const e = u();
17
+ async function o(t) {
18
+ if (!e.enabled || !e.identifier)
19
+ return;
20
+ const n = Date.now(), a = [{
21
+ user_id: e.identifier,
22
+ event_type: t.type,
23
+ platform: s() ? "web" : "native",
24
+ timestamp: n,
25
+ event_properties: {
26
+ project_name: "cdp-embedded-wallet",
27
+ isLocalHost: y(),
28
+ isUsingMocks: e.isUsingMocks,
29
+ ...t
30
+ }
31
+ }], c = JSON.stringify(a), d = n.toString(), l = f(c + d), r = {
32
+ client: e.isProduction ? m : p,
33
+ e: c,
34
+ checksum: l
35
+ };
36
+ await fetch("https://cca-lite.coinbase.com/amp", {
37
+ method: "POST",
38
+ mode: "no-cors",
39
+ headers: {
40
+ "Content-Type": "application/json"
41
+ },
42
+ body: JSON.stringify(r)
43
+ });
44
+ }
45
+ function s() {
46
+ return typeof window < "u" && typeof document < "u";
47
+ }
48
+ function y() {
49
+ return s() ? window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" : !1;
50
+ }
51
+ export {
52
+ e as Analytics
53
+ };