@coinbase/cdp-core 0.0.58 → 0.0.60

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 (197) hide show
  1. package/dist/esm/index.native.js +55 -54
  2. package/dist/esm/index.native103.js +1 -1
  3. package/dist/esm/index.native115.js +1 -1
  4. package/dist/esm/index.native127.js +1 -1
  5. package/dist/esm/index.native141.js +46 -3
  6. package/dist/esm/index.native142.js +3 -46
  7. package/dist/esm/index.native16.js +8 -0
  8. package/dist/esm/index.native164.js +1 -1
  9. package/dist/esm/index.native29.js +10 -2
  10. package/dist/esm/index.native47.js +1 -1
  11. package/dist/esm/index.native7.js +52 -51
  12. package/dist/esm/index.web.js +59 -58
  13. package/dist/esm/index.web100.js +2 -4
  14. package/dist/esm/index.web101.js +44 -19
  15. package/dist/esm/index.web102.js +13 -8
  16. package/dist/esm/index.web103.js +2 -8
  17. package/dist/esm/index.web104.js +4 -71
  18. package/dist/esm/index.web105.js +12 -12
  19. package/dist/esm/index.web106.js +7 -3
  20. package/dist/esm/index.web107.js +3 -4
  21. package/dist/esm/index.web108.js +19 -4
  22. package/dist/esm/index.web109.js +8 -4
  23. package/dist/esm/index.web110.js +7 -19
  24. package/dist/esm/index.web111.js +66 -47
  25. package/dist/esm/index.web112.js +18 -17
  26. package/dist/esm/index.web113.js +3 -20
  27. package/dist/esm/index.web114.js +4 -8
  28. package/dist/esm/index.web115.js +4 -30
  29. package/dist/esm/index.web116.js +4 -7
  30. package/dist/esm/index.web117.js +10 -11
  31. package/dist/esm/index.web118.js +52 -4
  32. package/dist/esm/index.web119.js +17 -54
  33. package/dist/esm/index.web120.js +20 -10
  34. package/dist/esm/index.web121.js +9 -2
  35. package/dist/esm/index.web122.js +30 -44
  36. package/dist/esm/index.web123.js +7 -13
  37. package/dist/esm/index.web124.js +21 -2
  38. package/dist/esm/index.web126.js +2 -2
  39. package/dist/esm/index.web131.js +32 -6
  40. package/dist/esm/index.web132.js +6 -32
  41. package/dist/esm/index.web137.js +3 -46
  42. package/dist/esm/index.web138.js +20 -3
  43. package/dist/esm/index.web139.js +10 -21
  44. package/dist/esm/index.web140.js +19 -9
  45. package/dist/esm/index.web141.js +89 -15
  46. package/dist/esm/index.web142.js +19 -92
  47. package/dist/esm/index.web143.js +115 -18
  48. package/dist/esm/index.web144.js +44 -115
  49. package/dist/esm/index.web145.js +7 -38
  50. package/dist/esm/index.web147.js +375 -67
  51. package/dist/esm/index.web148.js +832 -34
  52. package/dist/esm/index.web149.js +38 -20
  53. package/dist/esm/index.web15.js +8 -0
  54. package/dist/esm/index.web150.js +2 -8
  55. package/dist/esm/index.web151.js +70 -2
  56. package/dist/esm/index.web152.js +30 -373
  57. package/dist/esm/index.web153.js +20 -832
  58. package/dist/esm/index.web155.js +17 -14
  59. package/dist/esm/index.web156.js +28 -18
  60. package/dist/esm/index.web157.js +6 -26
  61. package/dist/esm/index.web158.js +9 -6
  62. package/dist/esm/index.web159.js +13 -11
  63. package/dist/esm/index.web160.js +8 -11
  64. package/dist/esm/index.web161.js +14 -7
  65. package/dist/esm/index.web162.js +80 -16
  66. package/dist/esm/index.web163.js +14 -80
  67. package/dist/esm/index.web164.js +2 -2
  68. package/dist/esm/index.web165.js +2 -2
  69. package/dist/esm/index.web166.js +2 -2
  70. package/dist/esm/index.web23.js +1 -1
  71. package/dist/esm/index.web27.js +10 -2
  72. package/dist/esm/index.web40.js +1 -1
  73. package/dist/esm/index.web41.js +3 -3
  74. package/dist/esm/index.web46.js +377 -2
  75. package/dist/esm/index.web47.js +2 -379
  76. package/dist/esm/index.web48.js +65 -28
  77. package/dist/esm/index.web49.js +364 -28
  78. package/dist/esm/index.web50.js +4 -2
  79. package/dist/esm/index.web51.js +28 -65
  80. package/dist/esm/index.web52.js +28 -364
  81. package/dist/esm/index.web53.js +1 -1
  82. package/dist/esm/index.web55.js +4 -4
  83. package/dist/esm/index.web6.js +52 -51
  84. package/dist/esm/index.web73.js +1 -1
  85. package/dist/esm/index.web91.js +1 -1
  86. package/dist/esm/index.web92.js +1 -1
  87. package/dist/esm/index.web97.js +4 -4
  88. package/dist/esm/index.web98.js +53 -17
  89. package/dist/esm/index.web99.js +10 -7
  90. package/dist/native/index.native.js +55 -54
  91. package/dist/native/index.native103.js +1 -1
  92. package/dist/native/index.native115.js +1 -1
  93. package/dist/native/index.native127.js +1 -1
  94. package/dist/native/index.native141.js +46 -3
  95. package/dist/native/index.native142.js +3 -46
  96. package/dist/native/index.native16.js +8 -0
  97. package/dist/native/index.native164.js +1 -1
  98. package/dist/native/index.native29.js +10 -2
  99. package/dist/native/index.native47.js +1 -1
  100. package/dist/native/index.native7.js +52 -51
  101. package/dist/native-types/auth/authManager.d.ts +1 -0
  102. package/dist/native-types/auth/types.d.ts +1 -0
  103. package/dist/native-types/core.d.ts +1 -0
  104. package/dist/native-types/mocks/mockAuthManager.d.ts +1 -0
  105. package/dist/native-types/types.d.ts +4 -0
  106. package/dist/native-types/version.d.ts +1 -1
  107. package/dist/types/auth/authManager.d.ts +1 -0
  108. package/dist/types/auth/types.d.ts +1 -0
  109. package/dist/types/core.d.ts +1 -0
  110. package/dist/types/mocks/mockAuthManager.d.ts +1 -0
  111. package/dist/types/types.d.ts +4 -0
  112. package/dist/types/version.d.ts +1 -1
  113. package/dist/web/index.web.js +59 -58
  114. package/dist/web/index.web100.js +2 -4
  115. package/dist/web/index.web101.js +44 -19
  116. package/dist/web/index.web102.js +13 -8
  117. package/dist/web/index.web103.js +2 -8
  118. package/dist/web/index.web104.js +4 -71
  119. package/dist/web/index.web105.js +12 -12
  120. package/dist/web/index.web106.js +7 -3
  121. package/dist/web/index.web107.js +3 -4
  122. package/dist/web/index.web108.js +19 -4
  123. package/dist/web/index.web109.js +8 -4
  124. package/dist/web/index.web110.js +7 -19
  125. package/dist/web/index.web111.js +66 -47
  126. package/dist/web/index.web112.js +18 -17
  127. package/dist/web/index.web113.js +3 -20
  128. package/dist/web/index.web114.js +4 -8
  129. package/dist/web/index.web115.js +4 -30
  130. package/dist/web/index.web116.js +4 -7
  131. package/dist/web/index.web117.js +10 -11
  132. package/dist/web/index.web118.js +52 -4
  133. package/dist/web/index.web119.js +17 -54
  134. package/dist/web/index.web120.js +20 -10
  135. package/dist/web/index.web121.js +9 -2
  136. package/dist/web/index.web122.js +30 -44
  137. package/dist/web/index.web123.js +7 -13
  138. package/dist/web/index.web124.js +21 -2
  139. package/dist/web/index.web126.js +2 -2
  140. package/dist/web/index.web131.js +32 -6
  141. package/dist/web/index.web132.js +6 -32
  142. package/dist/web/index.web137.js +3 -46
  143. package/dist/web/index.web138.js +20 -3
  144. package/dist/web/index.web139.js +10 -21
  145. package/dist/web/index.web140.js +19 -9
  146. package/dist/web/index.web141.js +89 -15
  147. package/dist/web/index.web142.js +19 -92
  148. package/dist/web/index.web143.js +115 -18
  149. package/dist/web/index.web144.js +44 -115
  150. package/dist/web/index.web145.js +7 -38
  151. package/dist/web/index.web147.js +375 -67
  152. package/dist/web/index.web148.js +832 -34
  153. package/dist/web/index.web149.js +38 -20
  154. package/dist/web/index.web15.js +8 -0
  155. package/dist/web/index.web150.js +2 -8
  156. package/dist/web/index.web151.js +70 -2
  157. package/dist/web/index.web152.js +30 -373
  158. package/dist/web/index.web153.js +20 -832
  159. package/dist/web/index.web155.js +17 -14
  160. package/dist/web/index.web156.js +28 -18
  161. package/dist/web/index.web157.js +6 -26
  162. package/dist/web/index.web158.js +9 -6
  163. package/dist/web/index.web159.js +13 -11
  164. package/dist/web/index.web160.js +8 -11
  165. package/dist/web/index.web161.js +14 -7
  166. package/dist/web/index.web162.js +80 -16
  167. package/dist/web/index.web163.js +14 -80
  168. package/dist/web/index.web164.js +2 -2
  169. package/dist/web/index.web165.js +2 -2
  170. package/dist/web/index.web166.js +2 -2
  171. package/dist/web/index.web23.js +1 -1
  172. package/dist/web/index.web27.js +10 -2
  173. package/dist/web/index.web40.js +1 -1
  174. package/dist/web/index.web41.js +3 -3
  175. package/dist/web/index.web46.js +377 -2
  176. package/dist/web/index.web47.js +2 -379
  177. package/dist/web/index.web48.js +65 -28
  178. package/dist/web/index.web49.js +364 -28
  179. package/dist/web/index.web50.js +4 -2
  180. package/dist/web/index.web51.js +28 -65
  181. package/dist/web/index.web52.js +28 -364
  182. package/dist/web/index.web53.js +1 -1
  183. package/dist/web/index.web55.js +4 -4
  184. package/dist/web/index.web6.js +52 -51
  185. package/dist/web/index.web73.js +1 -1
  186. package/dist/web/index.web91.js +1 -1
  187. package/dist/web/index.web92.js +1 -1
  188. package/dist/web/index.web97.js +4 -4
  189. package/dist/web/index.web98.js +53 -17
  190. package/dist/web/index.web99.js +10 -7
  191. package/dist/web-types/auth/authManager.d.ts +1 -0
  192. package/dist/web-types/auth/types.d.ts +1 -0
  193. package/dist/web-types/core.d.ts +1 -0
  194. package/dist/web-types/mocks/mockAuthManager.d.ts +1 -0
  195. package/dist/web-types/types.d.ts +4 -0
  196. package/dist/web-types/version.d.ts +1 -1
  197. package/package.json +2 -2
@@ -1,17 +1,20 @@
1
- import { SizeExceedsPaddingSizeError as a } from "./index.web137.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.web54.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.web54.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.web167.js";
2
+ import o from "./index.web159.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.web167.js";
2
- import o from "./index.web160.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.web102.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.web123.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.web54.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.web54.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.web144.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
  };
@@ -1,4 +1,4 @@
1
- var r = { exports: {} };
1
+ var r = {};
2
2
  export {
3
- r as __module
3
+ r as __exports
4
4
  };
@@ -1,4 +1,4 @@
1
- var r = {};
1
+ var e = { exports: {} };
2
2
  export {
3
- r as __exports
3
+ e as __module
4
4
  };
@@ -1,4 +1,4 @@
1
- var e = { exports: {} };
1
+ var r = { exports: {} };
2
2
  export {
3
- e as __module
3
+ r as __module
4
4
  };
@@ -1,2 +1,2 @@
1
- import { __require as r } from "./index.web150.js";
1
+ import { __require as r } from "./index.web145.js";
2
2
  r();
@@ -1,7 +1,7 @@
1
1
  import "@coinbase/cdp-api-client";
2
2
  import "viem";
3
3
  import { mockUser as e } from "./index.web29.js";
4
- class r {
4
+ class h {
5
5
  authState = null;
6
6
  authStateChangeCallback = null;
7
7
  /**
@@ -62,6 +62,14 @@ class r {
62
62
  async getToken() {
63
63
  return this.authState ? (this.authState.expiresAt <= Date.now() && await this.refreshToken(), this.authState?.accessToken ?? null) : null;
64
64
  }
65
+ /**
66
+ * Gets the expiration time of the access token, or null if the user is not signed in.
67
+ *
68
+ * @returns The expiration time of the access token.
69
+ */
70
+ async getTokenExpiration() {
71
+ return this.authState?.expiresAt ?? null;
72
+ }
65
73
  /**
66
74
  * Gets the currentlly registered wallet secret ID.
67
75
  *
@@ -117,5 +125,5 @@ class r {
117
125
  }
118
126
  }
119
127
  export {
120
- r as MockAuthManager
128
+ h as MockAuthManager
121
129
  };
@@ -1,6 +1,6 @@
1
1
  import { Analytics as r } from "./index.web22.js";
2
2
  import "./index.web23.js";
3
- import { VERSION as o } from "./index.web46.js";
3
+ import { VERSION as o } from "./index.web50.js";
4
4
  import "./index.web21.js";
5
5
  import { APIError as y, ErrorType as A, HttpErrorType as T, OAuth2ProviderType as S, SendEvmTransactionWithEndUserAccountBodyNetwork as f, SendSolanaTransactionWithEndUserAccountBodyNetwork as h } from "@coinbase/cdp-api-client";
6
6
  import "@solana/web3.js";
@@ -1,7 +1,7 @@
1
- import { DisconnectedError as l, from as d } from "./index.web47.js";
1
+ import { DisconnectedError as l, from as d } from "./index.web46.js";
2
2
  import { validateRequest as h, EIP1193ProviderError as m, STANDARD_ERROR_CODES as _ } from "./index.web19.js";
3
- import { createEOAHandlers as p } from "./index.web48.js";
4
- import { createSmartAccountHandlers as g } from "./index.web49.js";
3
+ import { createEOAHandlers as p } from "./index.web51.js";
4
+ import { createSmartAccountHandlers as g } from "./index.web52.js";
5
5
  import "viem";
6
6
  import "zustand";
7
7
  import "@coinbase/cdp-api-client";