@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,82 +1,96 @@
1
- /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
2
- function o(e) {
3
- return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array";
4
- }
5
- function w(e) {
6
- if (!Number.isSafeInteger(e) || e < 0)
7
- throw new Error("positive integer expected, got " + e);
8
- }
9
- function r(e, ...t) {
10
- if (!o(e))
11
- throw new Error("Uint8Array expected");
12
- if (t.length > 0 && !t.includes(e.length))
13
- throw new Error("Uint8Array expected of length " + t + ", got length=" + e.length);
14
- }
15
- function h(e, t = !0) {
16
- if (e.destroyed)
17
- throw new Error("Hash instance has been destroyed");
18
- if (t && e.finished)
19
- throw new Error("Hash#digest() has already been called");
20
- }
21
- function l(e, t) {
22
- r(e);
23
- const n = t.outputLen;
24
- if (e.length < n)
25
- throw new Error("digestInto() expects output buffer of length at least " + n);
26
- }
27
- function a(e) {
28
- return new Uint32Array(e.buffer, e.byteOffset, Math.floor(e.byteLength / 4));
29
- }
30
- function g(...e) {
31
- for (let t = 0; t < e.length; t++)
32
- e[t].fill(0);
33
- }
34
- function p(e) {
35
- return new DataView(e.buffer, e.byteOffset, e.byteLength);
36
- }
37
- function b(e, t) {
38
- return e << 32 - t | e >>> t;
39
- }
40
- const i = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
41
- function u(e) {
42
- return e << 24 & 4278190080 | e << 8 & 16711680 | e >>> 8 & 65280 | e >>> 24 & 255;
43
- }
44
- function c(e) {
45
- for (let t = 0; t < e.length; t++)
46
- e[t] = u(e[t]);
47
- return e;
48
- }
49
- const x = i ? (e) => e : c;
50
- function s(e) {
51
- if (typeof e != "string")
52
- throw new Error("string expected");
53
- return new Uint8Array(new TextEncoder().encode(e));
54
- }
55
- function y(e) {
56
- return typeof e == "string" && (e = s(e)), r(e), e;
57
- }
58
- class d {
59
- }
60
- function E(e) {
61
- const t = (f) => e().update(y(f)).digest(), n = e();
62
- return t.outputLen = n.outputLen, t.blockLen = n.blockLen, t.create = () => e(), t;
63
- }
1
+ import { withAlg as n } from "./index.web113.js";
2
+ import c from "./index.web114.js";
3
+ import { isJWK as p, isSecretJWK as a, isPublicJWK as y, isPrivateJWK as f } from "./index.web115.js";
4
+ const s = (r) => r?.[Symbol.toStringTag], o = (r, e, t) => {
5
+ if (e.use !== void 0) {
6
+ let i;
7
+ switch (t) {
8
+ case "sign":
9
+ case "verify":
10
+ i = "sig";
11
+ break;
12
+ case "encrypt":
13
+ case "decrypt":
14
+ i = "enc";
15
+ break;
16
+ }
17
+ if (e.use !== i)
18
+ throw new TypeError(`Invalid key for this operation, its "use" must be "${i}" when present`);
19
+ }
20
+ if (e.alg !== void 0 && e.alg !== r)
21
+ throw new TypeError(`Invalid key for this operation, its "alg" must be "${r}" when present`);
22
+ if (Array.isArray(e.key_ops)) {
23
+ let i;
24
+ switch (!0) {
25
+ case t === "sign":
26
+ case r === "dir":
27
+ case r.includes("CBC-HS"):
28
+ i = t;
29
+ break;
30
+ case r.startsWith("PBES2"):
31
+ i = "deriveBits";
32
+ break;
33
+ case /^A\d{3}(?:GCM)?(?:KW)?$/.test(r):
34
+ !r.includes("GCM") && r.endsWith("KW") ? i = "unwrapKey" : i = t;
35
+ break;
36
+ case t === "encrypt":
37
+ i = "wrapKey";
38
+ break;
39
+ case t === "decrypt":
40
+ i = r.startsWith("RSA") ? "unwrapKey" : "deriveBits";
41
+ break;
42
+ }
43
+ if (i && e.key_ops?.includes?.(i) === !1)
44
+ throw new TypeError(`Invalid key for this operation, its "key_ops" must include "${i}" when present`);
45
+ }
46
+ return !0;
47
+ }, h = (r, e, t) => {
48
+ if (!(e instanceof Uint8Array)) {
49
+ if (p(e)) {
50
+ if (a(e) && o(r, e, t))
51
+ return;
52
+ throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present');
53
+ }
54
+ if (!c(e))
55
+ throw new TypeError(n(r, e, "CryptoKey", "KeyObject", "JSON Web Key", "Uint8Array"));
56
+ if (e.type !== "secret")
57
+ throw new TypeError(`${s(e)} instances for symmetric algorithms must be of type "secret"`);
58
+ }
59
+ }, m = (r, e, t) => {
60
+ if (p(e))
61
+ switch (t) {
62
+ case "decrypt":
63
+ case "sign":
64
+ if (f(e) && o(r, e, t))
65
+ return;
66
+ throw new TypeError("JSON Web Key for this operation be a private JWK");
67
+ case "encrypt":
68
+ case "verify":
69
+ if (y(e) && o(r, e, t))
70
+ return;
71
+ throw new TypeError("JSON Web Key for this operation be a public JWK");
72
+ }
73
+ if (!c(e))
74
+ throw new TypeError(n(r, e, "CryptoKey", "KeyObject", "JSON Web Key"));
75
+ if (e.type === "secret")
76
+ throw new TypeError(`${s(e)} instances for asymmetric algorithms must not be of type "secret"`);
77
+ if (e.type === "public")
78
+ switch (t) {
79
+ case "sign":
80
+ throw new TypeError(`${s(e)} instances for asymmetric algorithm signing must be of type "private"`);
81
+ case "decrypt":
82
+ throw new TypeError(`${s(e)} instances for asymmetric algorithm decryption must be of type "private"`);
83
+ }
84
+ if (e.type === "private")
85
+ switch (t) {
86
+ case "verify":
87
+ throw new TypeError(`${s(e)} instances for asymmetric algorithm verifying must be of type "public"`);
88
+ case "encrypt":
89
+ throw new TypeError(`${s(e)} instances for asymmetric algorithm encryption must be of type "public"`);
90
+ }
91
+ }, d = (r, e, t) => {
92
+ r.startsWith("HS") || r === "dir" || r.startsWith("PBES2") || /^A(?:128|192|256)(?:GCM)?(?:KW)?$/.test(r) || /^A(?:128|192|256)CBC-HS(?:256|384|512)$/.test(r) ? h(r, e, t) : m(r, e, t);
93
+ };
64
94
  export {
65
- d as Hash,
66
- r as abytes,
67
- h as aexists,
68
- w as anumber,
69
- l as aoutput,
70
- u as byteSwap,
71
- c as byteSwap32,
72
- g as clean,
73
- E as createHasher,
74
- p as createView,
75
- o as isBytes,
76
- i as isLE,
77
- b as rotr,
78
- x as swap32IfBE,
79
- y as toBytes,
80
- a as u32,
81
- s as utf8ToBytes
95
+ d as default
82
96
  };
@@ -1,106 +1,23 @@
1
- import { HashMD as D, SHA256_IV as b, Chi as g, Maj as p } from "./index.web107.js";
2
- import { createHasher as u, clean as C, rotr as i } from "./index.web97.js";
3
- const B = /* @__PURE__ */ Uint32Array.from([
4
- 1116352408,
5
- 1899447441,
6
- 3049323471,
7
- 3921009573,
8
- 961987163,
9
- 1508970993,
10
- 2453635748,
11
- 2870763221,
12
- 3624381080,
13
- 310598401,
14
- 607225278,
15
- 1426881987,
16
- 1925078388,
17
- 2162078206,
18
- 2614888103,
19
- 3248222580,
20
- 3835390401,
21
- 4022224774,
22
- 264347078,
23
- 604807628,
24
- 770255983,
25
- 1249150122,
26
- 1555081692,
27
- 1996064986,
28
- 2554220882,
29
- 2821834349,
30
- 2952996808,
31
- 3210313671,
32
- 3336571891,
33
- 3584528711,
34
- 113926993,
35
- 338241895,
36
- 666307205,
37
- 773529912,
38
- 1294757372,
39
- 1396182291,
40
- 1695183700,
41
- 1986661051,
42
- 2177026350,
43
- 2456956037,
44
- 2730485921,
45
- 2820302411,
46
- 3259730800,
47
- 3345764771,
48
- 3516065817,
49
- 3600352804,
50
- 4094571909,
51
- 275423344,
52
- 430227734,
53
- 506948616,
54
- 659060556,
55
- 883997877,
56
- 958139571,
57
- 1322822218,
58
- 1537002063,
59
- 1747873779,
60
- 1955562222,
61
- 2024104815,
62
- 2227730452,
63
- 2361852424,
64
- 2428436474,
65
- 2756734187,
66
- 3204031479,
67
- 3329325298
68
- ]), h = /* @__PURE__ */ new Uint32Array(64);
69
- class E extends D {
70
- constructor(o = 32) {
71
- super(64, o, 8, !1), this.A = b[0] | 0, this.B = b[1] | 0, this.C = b[2] | 0, this.D = b[3] | 0, this.E = b[4] | 0, this.F = b[5] | 0, this.G = b[6] | 0, this.H = b[7] | 0;
1
+ import { JOSENotSupported as f } from "./index.web36.js";
2
+ const w = (n, r, a, e, s) => {
3
+ if (s.crit !== void 0 && e?.crit === void 0)
4
+ throw new n('"crit" (Critical) Header Parameter MUST be integrity protected');
5
+ if (!e || e.crit === void 0)
6
+ return /* @__PURE__ */ new Set();
7
+ if (!Array.isArray(e.crit) || e.crit.length === 0 || e.crit.some((i) => typeof i != "string" || i.length === 0))
8
+ throw new n('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');
9
+ let t;
10
+ a !== void 0 ? t = new Map([...Object.entries(a), ...r.entries()]) : t = r;
11
+ for (const i of e.crit) {
12
+ if (!t.has(i))
13
+ throw new f(`Extension Header Parameter "${i}" is not recognized`);
14
+ if (s[i] === void 0)
15
+ throw new n(`Extension Header Parameter "${i}" is missing`);
16
+ if (t.get(i) && e[i] === void 0)
17
+ throw new n(`Extension Header Parameter "${i}" MUST be integrity protected`);
72
18
  }
73
- get() {
74
- const { A: o, B: r, C: t, D: s, E: a, F: f, G: c, H: e } = this;
75
- return [o, r, t, s, a, f, c, e];
76
- }
77
- // prettier-ignore
78
- set(o, r, t, s, a, f, c, e) {
79
- this.A = o | 0, this.B = r | 0, this.C = t | 0, this.D = s | 0, this.E = a | 0, this.F = f | 0, this.G = c | 0, this.H = e | 0;
80
- }
81
- process(o, r) {
82
- for (let x = 0; x < 16; x++, r += 4)
83
- h[x] = o.getUint32(r, !1);
84
- for (let x = 16; x < 64; x++) {
85
- const H = h[x - 15], d = h[x - 2], m = i(H, 7) ^ i(H, 18) ^ H >>> 3, l = i(d, 17) ^ i(d, 19) ^ d >>> 10;
86
- h[x] = l + h[x - 7] + m + h[x - 16] | 0;
87
- }
88
- let { A: t, B: s, C: a, D: f, E: c, F: e, G: n, H: A } = this;
89
- for (let x = 0; x < 64; x++) {
90
- const H = i(c, 6) ^ i(c, 11) ^ i(c, 25), d = A + H + g(c, e, n) + B[x] + h[x] | 0, l = (i(t, 2) ^ i(t, 13) ^ i(t, 22)) + p(t, s, a) | 0;
91
- A = n, n = e, e = c, c = f + d | 0, f = a, a = s, s = t, t = d + l | 0;
92
- }
93
- t = t + this.A | 0, s = s + this.B | 0, a = a + this.C | 0, f = f + this.D | 0, c = c + this.E | 0, e = e + this.F | 0, n = n + this.G | 0, A = A + this.H | 0, this.set(t, s, a, f, c, e, n, A);
94
- }
95
- roundClean() {
96
- C(h);
97
- }
98
- destroy() {
99
- this.set(0, 0, 0, 0, 0, 0, 0, 0), C(this.buffer);
100
- }
101
- }
102
- const y = /* @__PURE__ */ u(() => new E());
19
+ return new Set(e.crit);
20
+ };
103
21
  export {
104
- E as SHA256,
105
- y as sha256
22
+ w as default
106
23
  };
@@ -1,35 +1,120 @@
1
- import { maxBytesPerTransaction as y, bytesPerBlob as a, fieldElementsPerBlob as f, bytesPerFieldElement as p } from "./index.web109.js";
2
- import { EmptyBlobError as c, BlobSizeTooLargeError as h } from "./index.web78.js";
3
- import { createCursor as B } from "./index.web67.js";
4
- import { size as u } from "./index.web56.js";
5
- import { hexToBytes as x } from "./index.web48.js";
6
- import { bytesToHex as d } from "./index.web46.js";
7
- function S(e) {
8
- const m = e.to ?? (typeof e.data == "string" ? "hex" : "bytes"), i = typeof e.data == "string" ? x(e.data) : e.data, o = u(i);
9
- if (!o)
10
- throw new c();
11
- if (o > y)
12
- throw new h({
13
- maxSize: y,
14
- size: o
15
- });
16
- const s = [];
17
- let n = !0, r = 0;
18
- for (; n; ) {
19
- const t = B(new Uint8Array(a));
20
- let l = 0;
21
- for (; l < f; ) {
22
- const b = i.slice(r, r + (p - 1));
23
- if (t.pushByte(0), t.pushBytes(b), b.length < 31) {
24
- t.pushByte(128), n = !1;
1
+ import { isJWK as p } from "./index.web115.js";
2
+ import { decode as m } from "./index.web94.js";
3
+ import y from "./index.web116.js";
4
+ import { isCryptoKey as S, isKeyObject as K } from "./index.web114.js";
5
+ let c;
6
+ const f = async (e, r, s, i = !1) => {
7
+ c ||= /* @__PURE__ */ new WeakMap();
8
+ let n = c.get(e);
9
+ if (n?.[s])
10
+ return n[s];
11
+ const t = await y({ ...r, alg: s });
12
+ return i && Object.freeze(e), n ? n[s] = t : c.set(e, { [s]: t }), t;
13
+ }, E = (e, r) => {
14
+ c ||= /* @__PURE__ */ new WeakMap();
15
+ let s = c.get(e);
16
+ if (s?.[r])
17
+ return s[r];
18
+ const i = e.type === "public", n = !!i;
19
+ let t;
20
+ if (e.asymmetricKeyType === "x25519") {
21
+ switch (r) {
22
+ case "ECDH-ES":
23
+ case "ECDH-ES+A128KW":
24
+ case "ECDH-ES+A192KW":
25
+ case "ECDH-ES+A256KW":
25
26
  break;
26
- }
27
- l++, r += 31;
27
+ default:
28
+ throw new TypeError("given KeyObject instance cannot be used for this algorithm");
29
+ }
30
+ t = e.toCryptoKey(e.asymmetricKeyType, n, i ? [] : ["deriveBits"]);
31
+ }
32
+ if (e.asymmetricKeyType === "ed25519") {
33
+ if (r !== "EdDSA" && r !== "Ed25519")
34
+ throw new TypeError("given KeyObject instance cannot be used for this algorithm");
35
+ t = e.toCryptoKey(e.asymmetricKeyType, n, [
36
+ i ? "verify" : "sign"
37
+ ]);
38
+ }
39
+ if (e.asymmetricKeyType === "rsa") {
40
+ let a;
41
+ switch (r) {
42
+ case "RSA-OAEP":
43
+ a = "SHA-1";
44
+ break;
45
+ case "RS256":
46
+ case "PS256":
47
+ case "RSA-OAEP-256":
48
+ a = "SHA-256";
49
+ break;
50
+ case "RS384":
51
+ case "PS384":
52
+ case "RSA-OAEP-384":
53
+ a = "SHA-384";
54
+ break;
55
+ case "RS512":
56
+ case "PS512":
57
+ case "RSA-OAEP-512":
58
+ a = "SHA-512";
59
+ break;
60
+ default:
61
+ throw new TypeError("given KeyObject instance cannot be used for this algorithm");
28
62
  }
29
- s.push(t);
63
+ if (r.startsWith("RSA-OAEP"))
64
+ return e.toCryptoKey({
65
+ name: "RSA-OAEP",
66
+ hash: a
67
+ }, n, i ? ["encrypt"] : ["decrypt"]);
68
+ t = e.toCryptoKey({
69
+ name: r.startsWith("PS") ? "RSA-PSS" : "RSASSA-PKCS1-v1_5",
70
+ hash: a
71
+ }, n, [i ? "verify" : "sign"]);
72
+ }
73
+ if (e.asymmetricKeyType === "ec") {
74
+ const o = (/* @__PURE__ */ new Map([
75
+ ["prime256v1", "P-256"],
76
+ ["secp384r1", "P-384"],
77
+ ["secp521r1", "P-521"]
78
+ ])).get(e.asymmetricKeyDetails?.namedCurve);
79
+ if (!o)
80
+ throw new TypeError("given KeyObject instance cannot be used for this algorithm");
81
+ r === "ES256" && o === "P-256" && (t = e.toCryptoKey({
82
+ name: "ECDSA",
83
+ namedCurve: o
84
+ }, n, [i ? "verify" : "sign"])), r === "ES384" && o === "P-384" && (t = e.toCryptoKey({
85
+ name: "ECDSA",
86
+ namedCurve: o
87
+ }, n, [i ? "verify" : "sign"])), r === "ES512" && o === "P-521" && (t = e.toCryptoKey({
88
+ name: "ECDSA",
89
+ namedCurve: o
90
+ }, n, [i ? "verify" : "sign"])), r.startsWith("ECDH-ES") && (t = e.toCryptoKey({
91
+ name: "ECDH",
92
+ namedCurve: o
93
+ }, n, i ? [] : ["deriveBits"]));
30
94
  }
31
- return m === "bytes" ? s.map((t) => t.bytes) : s.map((t) => d(t.bytes));
32
- }
95
+ if (!t)
96
+ throw new TypeError("given KeyObject instance cannot be used for this algorithm");
97
+ return s ? s[r] = t : c.set(e, { [r]: t }), t;
98
+ }, d = async (e, r) => {
99
+ if (e instanceof Uint8Array || S(e))
100
+ return e;
101
+ if (K(e)) {
102
+ if (e.type === "secret")
103
+ return e.export();
104
+ if ("toCryptoKey" in e && typeof e.toCryptoKey == "function")
105
+ try {
106
+ return E(e, r);
107
+ } catch (i) {
108
+ if (i instanceof TypeError)
109
+ throw i;
110
+ }
111
+ let s = e.export({ format: "jwk" });
112
+ return f(e, s, r);
113
+ }
114
+ if (p(e))
115
+ return e.k ? m(e.k) : f(e, e, r, !0);
116
+ throw new Error("unreachable");
117
+ };
33
118
  export {
34
- S as toBlobs
119
+ d as default
35
120
  };
@@ -1,14 +1,14 @@
1
1
  import { Provider as h } from "ox";
2
2
  import { http as m } from "viem";
3
3
  import { createStore as p } from "zustand";
4
- import { subscribeWithSelector as g, persist as f, createJSONStorage as S } from "./index.native32.js";
4
+ import { subscribeWithSelector as g, persist as f, createJSONStorage as S } from "./index.native36.js";
5
5
  import { validateRequest as I, EIP1193ProviderError as w, STANDARD_ERROR_CODES as C } from "./index.native13.js";
6
- import { EventEmitter as b } from "./index.native33.js";
6
+ import { EventEmitter as b } from "./index.native37.js";
7
7
  import { getPlatformStorage as _ } from "./index.native6.js";
8
8
  import "@coinbase/cdp-api-client";
9
- import { handleGetCapabilities as A, handleGetCallsStatus as v, handleSendCalls as D, handleChainId as P, handleSignTypedData as E, handleEthSign as R, handleSwitchEthereumChain as y, handleDisconnect as T, handleSendTransaction as q, handlePersonalSign as N, handleRequestAccounts as O, handleAccounts as G } from "./index.native34.js";
9
+ import { handleGetCapabilities as A, handleGetCallsStatus as v, handleSendCalls as D, handleChainId as P, handleSignTypedData as E, handleEthSign as R, handleSwitchEthereumChain as y, handleDisconnect as T, handleSendTransaction as q, handlePersonalSign as N, handleRequestAccounts as O, handleAccounts as G } from "./index.native38.js";
10
10
  import { onAuthStateChange as L } from "./index.native7.js";
11
- import { baseSepolia as l } from "./index.native35.js";
11
+ import { baseSepolia as l } from "./index.native39.js";
12
12
  function M(r, n, s) {
13
13
  n.subscribe(
14
14
  (t) => t.chainId,
@@ -1,4 +1,4 @@
1
- import { __require as r } from "./index.native36.js";
1
+ import { __require as r } from "./index.native32.js";
2
2
  var f = r();
3
3
  export {
4
4
  f as b
@@ -1,6 +1,6 @@
1
- import { verifyOAuth as h } from "./index.native7.js";
2
- import { getPlatformOAuth as r } from "./index.native6.js";
3
- import { getCoreAuthManager as u } from "./index.native25.js";
1
+ import { verifyOAuth as u } from "./index.native7.js";
2
+ import { getPlatformOAuth as s } from "./index.native6.js";
3
+ import { getCoreAuthManager as i } from "./index.native25.js";
4
4
  import "@coinbase/cdp-api-client";
5
5
  import "viem";
6
6
  class p {
@@ -40,36 +40,45 @@ class p {
40
40
  * Handles the OAuth code.
41
41
  */
42
42
  async handleOAuthCode() {
43
- let t, a, e;
44
- a = null, t = null, e = null;
45
43
  try {
46
- const o = await r().getOAuthCode() ?? {
47
- code: null,
48
- providerType: null,
49
- flowId: null
50
- };
51
- if (t = o.code, a = o.providerType, e = o.flowId, await r().cleanupOAuthCode(), !t || !a || !e || await u().isSignedIn())
44
+ const t = await s().getOAuthParams();
45
+ if (await s().cleanupOAuthParams(), !t || await i().isSignedIn())
46
+ return;
47
+ const { providerType: a, code: e, flowId: r, error: o, errorDescription: h } = t;
48
+ if (o || h) {
49
+ await this.setOAuthFlowState({
50
+ providerType: a,
51
+ status: "error",
52
+ errorDescription: o ?? h,
53
+ code: e,
54
+ flowId: r,
55
+ error: o
56
+ });
57
+ return;
58
+ }
59
+ if (!e || !a || !r)
52
60
  return;
53
61
  await this.setOAuthFlowState({
54
62
  providerType: a,
55
63
  status: "pending",
56
- code: t,
57
- flowId: e
58
- }), await h({ code: t, providerType: a, flowId: e }), await this.setOAuthFlowState({
64
+ code: e,
65
+ flowId: r
66
+ }), await u({
67
+ code: e,
68
+ providerType: a,
69
+ flowId: r
70
+ }), await this.setOAuthFlowState({
59
71
  providerType: a,
60
72
  status: "success",
61
- code: t,
62
- flowId: e
73
+ code: e,
74
+ flowId: r
63
75
  });
64
- } catch (o) {
65
- const l = o instanceof Error ? o.message : "Unknown error";
66
- await r().cleanupOAuthCode(), await this.setOAuthFlowState({
67
- providerType: a ?? null,
76
+ } catch (t) {
77
+ const a = t instanceof Error ? t.message : "Unknown error";
78
+ await s().cleanupOAuthParams(), await this.setOAuthFlowState({
68
79
  status: "error",
69
- errorDescription: l,
70
- code: t,
71
- flowId: e
72
- }), console.error("Error handling OAuth param change:", o);
80
+ errorDescription: a
81
+ });
73
82
  }
74
83
  }
75
84
  }
@@ -1,6 +1,8 @@
1
1
  import { ModuleResolutionError as n } from "./index.native15.js";
2
- import { decodeBase64 as c, encodeBase64 as o } from "./index.native16.js";
3
- const s = {
2
+ import { decodeBase64 as c, encodeBase64 as a } from "./index.native16.js";
3
+ import "@coinbase/cdp-api-client";
4
+ import "viem";
5
+ const l = {
4
6
  /**
5
7
  * Creates a secp256r1 key pair for React Native.
6
8
  *
@@ -19,7 +21,7 @@ const s = {
19
21
  // Do not allow key export for security
20
22
  ["sign", "verify"]
21
23
  // Key usages
22
- ), t = await crypto.subtle.exportKey("spki", e.publicKey), r = new Uint8Array(t), a = o(r);
24
+ ), t = await crypto.subtle.exportKey("spki", e.publicKey), r = new Uint8Array(t), o = a(r);
23
25
  return e.privateKey[Symbol.toStringTag] || Object.defineProperty(e.privateKey, Symbol.toStringTag, {
24
26
  value: "CryptoKey",
25
27
  configurable: !1,
@@ -27,7 +29,7 @@ const s = {
27
29
  writable: !1
28
30
  }), {
29
31
  privateKey: e.privateKey,
30
- publicKeyBase64: a
32
+ publicKeyBase64: o
31
33
  };
32
34
  },
33
35
  /**
@@ -48,7 +50,7 @@ const s = {
48
50
  !0,
49
51
  // Allow key export
50
52
  ["encrypt", "decrypt"]
51
- ), t = await crypto.subtle.exportKey("spki", e.publicKey), r = o(new Uint8Array(t));
53
+ ), t = await crypto.subtle.exportKey("spki", e.publicKey), r = a(new Uint8Array(t));
52
54
  return { privateKey: e.privateKey, publicKeyBase64: r };
53
55
  },
54
56
  /**
@@ -104,5 +106,5 @@ const s = {
104
106
  }
105
107
  };
106
108
  export {
107
- s as nativeCrypto
109
+ l as nativeCrypto
108
110
  };
@@ -45,7 +45,7 @@ class i {
45
45
  * Awaitable method whose promise only resolves when the OAuth manager is ready to be used.
46
46
  */
47
47
  async handleOAuthCode() {
48
- await e()?.cleanupOAuthCode(), await this.setOAuthFlowState({
48
+ await e()?.cleanupOAuthParams(), await this.setOAuthFlowState({
49
49
  providerType: "google",
50
50
  status: "pending",
51
51
  code: "mock-oauth-code",
@@ -2,8 +2,8 @@ const t = {
2
2
  getRedirectUrl: () => {
3
3
  throw new Error("OAuth is not supported in this platform");
4
4
  },
5
- getOAuthCode: () => null,
6
- cleanupOAuthCode: () => {
5
+ getOAuthParams: () => null,
6
+ cleanupOAuthParams: () => {
7
7
  },
8
8
  initiateOAuthFlow: () => {
9
9
  throw new Error("OAuth is not supported in this platform");