@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,7 +1,20 @@
1
- const e = 32, s = 4096, t = 131072, l = 761855;
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
+ }
2
17
  export {
3
- t as bytesPerBlob,
4
- e as bytesPerFieldElement,
5
- s as fieldElementsPerBlob,
6
- l as maxBytesPerTransaction
18
+ a as decodeBase64,
19
+ o as encodeBase64
7
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.web36.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.web40.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.web121.js";
2
+ import o from "./index.web113.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.web121.js";
2
- import o from "./index.web114.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.web48.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,19 +1,83 @@
1
- import n from "./index.web93.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.web36.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,7 @@
1
- import { JOSENotSupported as s } from "./index.web40.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 };
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
- };
1
+ const e = 32, s = 4096, t = 131072, l = 761855;
81
2
  export {
82
- i as default
3
+ t as bytesPerBlob,
4
+ e as bytesPerFieldElement,
5
+ s as fieldElementsPerBlob,
6
+ l as maxBytesPerTransaction
83
7
  };
@@ -1,7 +1,7 @@
1
- import { hexToBigInt as n } from "./index.web62.js";
2
- import { defineBlock as r } from "./index.web59.js";
3
- import { defineTransaction as s, formatTransaction as m } from "./index.web61.js";
4
- import { defineTransactionReceipt as l } from "./index.web64.js";
1
+ import { hexToBigInt as n } from "./index.web67.js";
2
+ import { defineBlock as r } from "./index.web64.js";
3
+ import { defineTransaction as s, formatTransaction as m } from "./index.web66.js";
4
+ import { defineTransactionReceipt as l } from "./index.web69.js";
5
5
  const p = {
6
6
  block: /* @__PURE__ */ r({
7
7
  format(e) {
@@ -1,8 +1,8 @@
1
- import { InvalidAddressError as a } from "./index.web77.js";
2
- import { isAddress as f } from "./index.web51.js";
3
- import { concatHex as p } from "./index.web52.js";
4
- import { toHex as i } from "./index.web46.js";
5
- import { toRlp as x } from "./index.web65.js";
1
+ import { InvalidAddressError as a } from "./index.web82.js";
2
+ import { isAddress as f } from "./index.web56.js";
3
+ import { concatHex as p } from "./index.web57.js";
4
+ import { toHex as i } from "./index.web51.js";
5
+ import { toRlp as x } from "./index.web70.js";
6
6
  import { serializeTransaction as l } from "./index.web25.js";
7
7
  function T(r, e) {
8
8
  return h(r) ? z(r) : l(r, e);
@@ -1,4 +1,4 @@
1
- import { __require as r } from "./index.web35.js";
1
+ import { __require as r } from "./index.web38.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.web6.js";
2
- import { getPlatformOAuth as r } from "./index.web2.js";
3
- import { getCoreAuthManager as u } from "./index.web24.js";
1
+ import { verifyOAuth as u } from "./index.web6.js";
2
+ import { getPlatformOAuth as s } from "./index.web2.js";
3
+ import { getCoreAuthManager as i } from "./index.web24.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,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
  };
@@ -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",
@@ -1,16 +1,16 @@
1
- import { InvalidLegacyVError as H } from "./index.web73.js";
2
- import { serializeAuthorizationList as g } from "./index.web45.js";
3
- import { blobsToCommitments as B } from "./index.web81.js";
4
- import { blobsToProofs as V } from "./index.web82.js";
5
- import { commitmentsToVersionedHashes as C } from "./index.web83.js";
6
- import { toBlobSidecars as k } from "./index.web84.js";
7
- import { concatHex as h } from "./index.web52.js";
8
- import { trim as T } from "./index.web58.js";
9
- import { numberToHex as o, bytesToHex as w } from "./index.web46.js";
10
- import { toRlp as b } from "./index.web65.js";
11
- import { assertTransactionEIP1559 as S, assertTransactionEIP2930 as _, assertTransactionEIP4844 as R, assertTransactionEIP7702 as Y, assertTransactionLegacy as j } from "./index.web74.js";
12
- import { getTransactionType as q } from "./index.web72.js";
13
- import { serializeAccessList as v } from "./index.web85.js";
1
+ import { InvalidLegacyVError as H } from "./index.web78.js";
2
+ import { serializeAuthorizationList as g } from "./index.web50.js";
3
+ import { blobsToCommitments as B } from "./index.web86.js";
4
+ import { blobsToProofs as V } from "./index.web87.js";
5
+ import { commitmentsToVersionedHashes as C } from "./index.web88.js";
6
+ import { toBlobSidecars as k } from "./index.web89.js";
7
+ import { concatHex as h } from "./index.web57.js";
8
+ import { trim as T } from "./index.web63.js";
9
+ import { numberToHex as o, bytesToHex as w } from "./index.web51.js";
10
+ import { toRlp as b } from "./index.web70.js";
11
+ import { assertTransactionEIP1559 as S, assertTransactionEIP2930 as _, assertTransactionEIP4844 as R, assertTransactionEIP7702 as Y, assertTransactionLegacy as j } from "./index.web79.js";
12
+ import { getTransactionType as q } from "./index.web77.js";
13
+ import { serializeAccessList as v } from "./index.web90.js";
14
14
  function te(e, r) {
15
15
  const i = q(e);
16
16
  return i === "eip1559" ? K(e, r) : i === "eip2930" ? M(e, r) : i === "eip4844" ? J(e, r) : i === "eip7702" ? D(e, r) : N(e, r);
@@ -1,6 +1,6 @@
1
- import { CompactSign as i } from "./index.web39.js";
2
- import { JWTInvalid as r } from "./index.web40.js";
3
- import { JWTClaimsBuilder as n } from "./index.web41.js";
1
+ import { CompactSign as i } from "./index.web35.js";
2
+ import { JWTInvalid as r } from "./index.web36.js";
3
+ import { JWTClaimsBuilder as n } from "./index.web37.js";
4
4
  class d {
5
5
  #s;
6
6
  #t;
@@ -1,5 +1,7 @@
1
1
  import { decodeBase64 as y, encodeBase64 as a } from "./index.web15.js";
2
- const s = {
2
+ import "@coinbase/cdp-api-client";
3
+ import "viem";
4
+ const p = {
3
5
  /**
4
6
  * Creates a secp256r1 key pair for the browser.
5
7
  *
@@ -87,5 +89,5 @@ const s = {
87
89
  }
88
90
  };
89
91
  export {
90
- s as webCrypto
92
+ p as webCrypto
91
93
  };
@@ -1,5 +1,5 @@
1
- import { InvalidAddressError as s } from "./index.web77.js";
2
- import { isAddress as a } from "./index.web51.js";
1
+ import { InvalidAddressError as s } from "./index.web82.js";
2
+ import { isAddress as a } from "./index.web56.js";
3
3
  function r(n) {
4
4
  if (typeof n == "string") {
5
5
  if (!a(n, { strict: !1 }))
@@ -1,5 +1,5 @@
1
- import { chainConfig as a } from "./index.web108.js";
2
- import { defineChain as t } from "./index.web44.js";
1
+ import { chainConfig as a } from "./index.web107.js";
2
+ import { defineChain as t } from "./index.web49.js";
3
3
  const e = 11155111, r = /* @__PURE__ */ t({
4
4
  ...a,
5
5
  id: 84532,