@coinbase/cdp-core 0.0.117 → 0.0.118

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 (288) hide show
  1. package/dist/esm/index.web10.js +49 -44
  2. package/dist/esm/index.web107.js +3 -3
  3. package/dist/esm/index.web110.js +2 -2
  4. package/dist/esm/index.web114.js +2 -2
  5. package/dist/esm/index.web127.js +3 -3
  6. package/dist/esm/index.web128.js +31 -2
  7. package/dist/esm/index.web129.js +28 -65
  8. package/dist/esm/index.web130.js +12 -360
  9. package/dist/esm/index.web131.js +22 -28
  10. package/dist/esm/index.web132.js +50 -28
  11. package/dist/esm/index.web133.js +2 -19
  12. package/dist/esm/index.web134.js +63 -20
  13. package/dist/esm/index.web135.js +351 -37
  14. package/dist/esm/index.web138.js +1 -1
  15. package/dist/esm/index.web139.js +1 -1
  16. package/dist/esm/index.web140.js +5 -5
  17. package/dist/esm/index.web141.js +43 -50
  18. package/dist/esm/index.web142.js +2 -11
  19. package/dist/esm/index.web143.js +2 -2
  20. package/dist/esm/index.web144.js +15 -45
  21. package/dist/esm/index.web145.js +28 -13
  22. package/dist/esm/index.web146.js +7 -12
  23. package/dist/esm/index.web147.js +3 -11
  24. package/dist/esm/index.web148.js +29 -5
  25. package/dist/esm/index.web149.js +8 -47
  26. package/dist/esm/index.web150.js +7 -14
  27. package/dist/esm/index.web151.js +70 -18
  28. package/dist/esm/index.web152.js +28 -7
  29. package/dist/esm/index.web153.js +3 -3
  30. package/dist/esm/index.web154.js +6 -19
  31. package/dist/esm/index.web155.js +4 -8
  32. package/dist/esm/index.web156.js +14 -7
  33. package/dist/esm/index.web157.js +18 -79
  34. package/dist/esm/index.web158.js +48 -15
  35. package/dist/esm/index.web159.js +17 -3
  36. package/dist/esm/index.web160.js +23 -15
  37. package/dist/esm/index.web161.js +8 -4
  38. package/dist/esm/index.web162.js +33 -5
  39. package/dist/esm/index.web163.js +7 -19
  40. package/dist/esm/index.web164.js +16 -57
  41. package/dist/esm/index.web165.js +54 -17
  42. package/dist/esm/index.web166.js +10 -23
  43. package/dist/esm/index.web167.js +2 -9
  44. package/dist/esm/index.web168.js +44 -42
  45. package/dist/esm/index.web169.js +13 -7
  46. package/dist/esm/index.web170.js +10 -18
  47. package/dist/esm/index.web171.js +12 -2
  48. package/dist/esm/index.web172.js +5 -2
  49. package/dist/esm/index.web191.js +1 -1
  50. package/dist/esm/index.web193.js +1 -1
  51. package/dist/esm/index.web194.js +2 -2
  52. package/dist/esm/index.web2.js +2 -2
  53. package/dist/esm/index.web202.js +2 -2
  54. package/dist/esm/index.web210.js +8 -2
  55. package/dist/esm/index.web211.js +2 -109
  56. package/dist/esm/index.web212.js +361 -2
  57. package/dist/esm/index.web213.js +852 -20
  58. package/dist/esm/index.web214.js +39 -10
  59. package/dist/esm/index.web215.js +2 -20
  60. package/dist/esm/index.web216.js +70 -94
  61. package/dist/esm/index.web217.js +35 -21
  62. package/dist/esm/index.web218.js +13 -116
  63. package/dist/esm/index.web219.js +19 -102
  64. package/dist/esm/index.web220.js +10 -79
  65. package/dist/esm/index.web221.js +20 -79
  66. package/dist/esm/index.web222.js +94 -8
  67. package/dist/esm/index.web223.js +21 -2
  68. package/dist/esm/index.web224.js +110 -353
  69. package/dist/esm/index.web225.js +103 -852
  70. package/dist/esm/index.web226.js +77 -37
  71. package/dist/esm/index.web227.js +79 -2
  72. package/dist/esm/index.web228.js +107 -68
  73. package/dist/esm/index.web229.js +2 -35
  74. package/dist/esm/index.web230.js +2 -15
  75. package/dist/esm/index.web236.js +3 -46
  76. package/dist/esm/index.web237.js +46 -3
  77. package/dist/esm/index.web238.js +2 -18
  78. package/dist/esm/index.web239.js +2 -28
  79. package/dist/esm/index.web240.js +2 -8
  80. package/dist/esm/index.web241.js +18 -11
  81. package/dist/esm/index.web242.js +28 -13
  82. package/dist/esm/index.web243.js +8 -10
  83. package/dist/esm/index.web244.js +11 -17
  84. package/dist/esm/index.web245.js +12 -80
  85. package/dist/esm/index.web246.js +10 -2
  86. package/dist/esm/index.web247.js +17 -2
  87. package/dist/esm/index.web248.js +81 -2
  88. package/dist/esm/index.web250.js +14 -78
  89. package/dist/esm/index.web251.js +78 -14
  90. package/dist/esm/index.web3.js +1 -1
  91. package/dist/esm/index.web8.js +26 -12
  92. package/dist/esm/index.web9.js +1 -1
  93. package/dist/native/index.native109.js +3 -3
  94. package/dist/native/index.native11.js +1 -1
  95. package/dist/native/index.native112.js +2 -2
  96. package/dist/native/index.native116.js +3 -3
  97. package/dist/native/index.native12.js +50 -45
  98. package/dist/native/index.native129.js +371 -100
  99. package/dist/native/index.native130.js +2 -379
  100. package/dist/native/index.native131.js +65 -28
  101. package/dist/native/index.native132.js +364 -28
  102. package/dist/native/index.native133.js +31 -2
  103. package/dist/native/index.native134.js +28 -65
  104. package/dist/native/index.native135.js +12 -360
  105. package/dist/native/index.native136.js +21 -15
  106. package/dist/native/index.native137.js +49 -21
  107. package/dist/native/index.native138.js +104 -49
  108. package/dist/native/index.native141.js +1 -1
  109. package/dist/native/index.native142.js +1 -1
  110. package/dist/native/index.native143.js +5 -5
  111. package/dist/native/index.native144.js +11 -46
  112. package/dist/native/index.native145.js +12 -2
  113. package/dist/native/index.native146.js +55 -2
  114. package/dist/native/index.native147.js +10 -4
  115. package/dist/native/index.native148.js +2 -13
  116. package/dist/native/index.native149.js +45 -12
  117. package/dist/native/index.native150.js +13 -54
  118. package/dist/native/index.native151.js +5 -11
  119. package/dist/native/index.native152.js +48 -2
  120. package/dist/native/index.native153.js +35 -44
  121. package/dist/native/index.native154.js +66 -12
  122. package/dist/native/index.native155.js +14 -36
  123. package/dist/native/index.native156.js +25 -65
  124. package/dist/native/index.native157.js +7 -13
  125. package/dist/native/index.native158.js +3 -27
  126. package/dist/native/index.native159.js +27 -7
  127. package/dist/native/index.native160.js +8 -3
  128. package/dist/native/index.native161.js +7 -27
  129. package/dist/native/index.native162.js +79 -8
  130. package/dist/native/index.native163.js +27 -7
  131. package/dist/native/index.native164.js +3 -79
  132. package/dist/native/index.native165.js +5 -18
  133. package/dist/native/index.native166.js +4 -3
  134. package/dist/native/index.native167.js +3 -4
  135. package/dist/native/index.native168.js +19 -4
  136. package/dist/native/index.native169.js +52 -5
  137. package/dist/native/index.native170.js +17 -19
  138. package/dist/native/index.native171.js +18 -55
  139. package/dist/native/index.native172.js +8 -17
  140. package/dist/native/index.native173.js +37 -19
  141. package/dist/native/index.native174.js +7 -8
  142. package/dist/native/index.native175.js +17 -38
  143. package/dist/native/index.native176.js +2 -8
  144. package/dist/native/index.native177.js +2 -21
  145. package/dist/native/index.native193.js +1 -1
  146. package/dist/native/index.native195.js +1 -1
  147. package/dist/native/index.native196.js +1 -1
  148. package/dist/native/index.native199.js +2 -2
  149. package/dist/native/index.native2.js +2 -2
  150. package/dist/native/index.native207.js +2 -2
  151. package/dist/native/index.native210.js +1 -1
  152. package/dist/native/index.native211.js +1 -1
  153. package/dist/native/index.native221.js +2 -2
  154. package/dist/native/index.native222.js +3 -3
  155. package/dist/native/index.native224.js +3 -3
  156. package/dist/native/index.native225.js +1 -1
  157. package/dist/native/index.native226.js +3 -3
  158. package/dist/native/index.native227.js +7 -38
  159. package/dist/native/index.native229.js +358 -67
  160. package/dist/native/index.native230.js +852 -34
  161. package/dist/native/index.native231.js +38 -14
  162. package/dist/native/index.native232.js +2 -8
  163. package/dist/native/index.native233.js +70 -2
  164. package/dist/native/index.native234.js +29 -355
  165. package/dist/native/index.native235.js +14 -852
  166. package/dist/native/index.native236.js +40 -14
  167. package/dist/native/index.native237.js +21 -2
  168. package/dist/native/index.native238.js +2 -20
  169. package/dist/native/index.native239.js +18 -31
  170. package/dist/native/index.native240.js +32 -6
  171. package/dist/native/index.native241.js +6 -3
  172. package/dist/native/index.native242.js +16 -45
  173. package/dist/native/index.native243.js +28 -2
  174. package/dist/native/index.native244.js +8 -2
  175. package/dist/native/index.native245.js +11 -2
  176. package/dist/native/index.native246.js +11 -16
  177. package/dist/native/index.native247.js +10 -28
  178. package/dist/native/index.native248.js +17 -8
  179. package/dist/native/index.native249.js +79 -9
  180. package/dist/native/index.native250.js +2 -13
  181. package/dist/native/index.native251.js +2 -10
  182. package/dist/native/index.native252.js +2 -15
  183. package/dist/native/index.native253.js +2 -81
  184. package/dist/native/index.native255.js +78 -14
  185. package/dist/native/index.native256.js +14 -78
  186. package/dist/native/index.native3.js +1 -1
  187. package/dist/native/index.native8.js +16 -3
  188. package/dist/native/index.native86.js +1 -1
  189. package/dist/native/index.native9.js +21 -8
  190. package/dist/native-types/platform/types.d.ts +25 -0
  191. package/dist/native-types/version.d.ts +1 -1
  192. package/dist/types/platform/types.d.ts +25 -0
  193. package/dist/types/version.d.ts +1 -1
  194. package/dist/web/index.web10.js +49 -44
  195. package/dist/web/index.web107.js +3 -3
  196. package/dist/web/index.web110.js +2 -2
  197. package/dist/web/index.web114.js +2 -2
  198. package/dist/web/index.web127.js +3 -3
  199. package/dist/web/index.web128.js +31 -2
  200. package/dist/web/index.web129.js +28 -65
  201. package/dist/web/index.web130.js +12 -360
  202. package/dist/web/index.web131.js +22 -28
  203. package/dist/web/index.web132.js +50 -28
  204. package/dist/web/index.web133.js +2 -19
  205. package/dist/web/index.web134.js +63 -20
  206. package/dist/web/index.web135.js +351 -37
  207. package/dist/web/index.web138.js +1 -1
  208. package/dist/web/index.web139.js +1 -1
  209. package/dist/web/index.web140.js +5 -5
  210. package/dist/web/index.web141.js +43 -50
  211. package/dist/web/index.web142.js +2 -11
  212. package/dist/web/index.web143.js +2 -2
  213. package/dist/web/index.web144.js +15 -45
  214. package/dist/web/index.web145.js +28 -13
  215. package/dist/web/index.web146.js +7 -12
  216. package/dist/web/index.web147.js +3 -11
  217. package/dist/web/index.web148.js +29 -5
  218. package/dist/web/index.web149.js +8 -47
  219. package/dist/web/index.web150.js +7 -14
  220. package/dist/web/index.web151.js +70 -18
  221. package/dist/web/index.web152.js +28 -7
  222. package/dist/web/index.web153.js +3 -3
  223. package/dist/web/index.web154.js +6 -19
  224. package/dist/web/index.web155.js +4 -8
  225. package/dist/web/index.web156.js +14 -7
  226. package/dist/web/index.web157.js +18 -79
  227. package/dist/web/index.web158.js +48 -15
  228. package/dist/web/index.web159.js +17 -3
  229. package/dist/web/index.web160.js +23 -15
  230. package/dist/web/index.web161.js +8 -4
  231. package/dist/web/index.web162.js +33 -5
  232. package/dist/web/index.web163.js +7 -19
  233. package/dist/web/index.web164.js +16 -57
  234. package/dist/web/index.web165.js +54 -17
  235. package/dist/web/index.web166.js +10 -23
  236. package/dist/web/index.web167.js +2 -9
  237. package/dist/web/index.web168.js +44 -42
  238. package/dist/web/index.web169.js +13 -7
  239. package/dist/web/index.web170.js +10 -18
  240. package/dist/web/index.web171.js +12 -2
  241. package/dist/web/index.web172.js +5 -2
  242. package/dist/web/index.web191.js +1 -1
  243. package/dist/web/index.web193.js +1 -1
  244. package/dist/web/index.web194.js +2 -2
  245. package/dist/web/index.web2.js +2 -2
  246. package/dist/web/index.web202.js +2 -2
  247. package/dist/web/index.web210.js +8 -2
  248. package/dist/web/index.web211.js +2 -109
  249. package/dist/web/index.web212.js +361 -2
  250. package/dist/web/index.web213.js +852 -20
  251. package/dist/web/index.web214.js +39 -10
  252. package/dist/web/index.web215.js +2 -20
  253. package/dist/web/index.web216.js +70 -94
  254. package/dist/web/index.web217.js +35 -21
  255. package/dist/web/index.web218.js +13 -116
  256. package/dist/web/index.web219.js +19 -102
  257. package/dist/web/index.web220.js +10 -79
  258. package/dist/web/index.web221.js +20 -79
  259. package/dist/web/index.web222.js +94 -8
  260. package/dist/web/index.web223.js +21 -2
  261. package/dist/web/index.web224.js +110 -353
  262. package/dist/web/index.web225.js +103 -852
  263. package/dist/web/index.web226.js +77 -37
  264. package/dist/web/index.web227.js +79 -2
  265. package/dist/web/index.web228.js +107 -68
  266. package/dist/web/index.web229.js +2 -35
  267. package/dist/web/index.web230.js +2 -15
  268. package/dist/web/index.web236.js +3 -46
  269. package/dist/web/index.web237.js +46 -3
  270. package/dist/web/index.web238.js +2 -18
  271. package/dist/web/index.web239.js +2 -28
  272. package/dist/web/index.web240.js +2 -8
  273. package/dist/web/index.web241.js +18 -11
  274. package/dist/web/index.web242.js +28 -13
  275. package/dist/web/index.web243.js +8 -10
  276. package/dist/web/index.web244.js +11 -17
  277. package/dist/web/index.web245.js +12 -80
  278. package/dist/web/index.web246.js +10 -2
  279. package/dist/web/index.web247.js +17 -2
  280. package/dist/web/index.web248.js +81 -2
  281. package/dist/web/index.web250.js +14 -78
  282. package/dist/web/index.web251.js +78 -14
  283. package/dist/web/index.web3.js +1 -1
  284. package/dist/web/index.web8.js +26 -12
  285. package/dist/web/index.web9.js +1 -1
  286. package/dist/web-types/platform/types.d.ts +25 -0
  287. package/dist/web-types/version.d.ts +1 -1
  288. package/package.json +2 -2
@@ -1,83 +1,4 @@
1
- import { JOSENotSupported as s } from "./index.native137.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
+ var r = { exports: {} };
81
2
  export {
82
- i as default
3
+ r as __module
83
4
  };
@@ -1,17 +1,81 @@
1
- import { SizeExceedsPaddingSizeError as a } from "./index.native242.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 r(t, e = "algorithm.name") {
2
+ return new TypeError(`CryptoKey does not support this operation, its ${e} must be ${t}`);
3
+ }
4
+ function o(t, e) {
5
+ return t.name === e;
6
+ }
7
+ function c(t) {
8
+ return parseInt(t.name.slice(4), 10);
9
+ }
10
+ function h(t) {
11
+ switch (t) {
12
+ case "ES256":
13
+ return "P-256";
14
+ case "ES384":
15
+ return "P-384";
16
+ case "ES512":
17
+ return "P-521";
18
+ default:
19
+ throw new Error("unreachable");
20
+ }
21
+ }
22
+ function i(t, e) {
23
+ if (!t.usages.includes(e))
24
+ throw new TypeError(`CryptoKey does not support this operation, its usages must include ${e}.`);
25
+ }
26
+ function u(t, e, n) {
27
+ switch (e) {
28
+ case "HS256":
29
+ case "HS384":
30
+ case "HS512": {
31
+ if (!o(t.algorithm, "HMAC"))
32
+ throw r("HMAC");
33
+ const a = parseInt(e.slice(2), 10);
34
+ if (c(t.algorithm.hash) !== a)
35
+ throw r(`SHA-${a}`, "algorithm.hash");
36
+ break;
37
+ }
38
+ case "RS256":
39
+ case "RS384":
40
+ case "RS512": {
41
+ if (!o(t.algorithm, "RSASSA-PKCS1-v1_5"))
42
+ throw r("RSASSA-PKCS1-v1_5");
43
+ const a = parseInt(e.slice(2), 10);
44
+ if (c(t.algorithm.hash) !== a)
45
+ throw r(`SHA-${a}`, "algorithm.hash");
46
+ break;
47
+ }
48
+ case "PS256":
49
+ case "PS384":
50
+ case "PS512": {
51
+ if (!o(t.algorithm, "RSA-PSS"))
52
+ throw r("RSA-PSS");
53
+ const a = parseInt(e.slice(2), 10);
54
+ if (c(t.algorithm.hash) !== a)
55
+ throw r(`SHA-${a}`, "algorithm.hash");
56
+ break;
57
+ }
58
+ case "Ed25519":
59
+ case "EdDSA": {
60
+ if (!o(t.algorithm, "Ed25519"))
61
+ throw r("Ed25519");
62
+ break;
63
+ }
64
+ case "ES256":
65
+ case "ES384":
66
+ case "ES512": {
67
+ if (!o(t.algorithm, "ECDSA"))
68
+ throw r("ECDSA");
69
+ const a = h(e);
70
+ if (t.algorithm.namedCurve !== a)
71
+ throw r(a, "algorithm.namedCurve");
72
+ break;
73
+ }
74
+ default:
75
+ throw new TypeError("CryptoKey does not support this operation");
76
+ }
77
+ i(t, n);
14
78
  }
15
79
  export {
16
- o as pad
80
+ u as checkSigCryptoKey
17
81
  };
@@ -1,81 +1,17 @@
1
- function r(t, e = "algorithm.name") {
2
- return new TypeError(`CryptoKey does not support this operation, its ${e} must be ${t}`);
3
- }
4
- function o(t, e) {
5
- return t.name === e;
6
- }
7
- function c(t) {
8
- return parseInt(t.name.slice(4), 10);
9
- }
10
- function h(t) {
11
- switch (t) {
12
- case "ES256":
13
- return "P-256";
14
- case "ES384":
15
- return "P-384";
16
- case "ES512":
17
- return "P-521";
18
- default:
19
- throw new Error("unreachable");
20
- }
21
- }
22
- function i(t, e) {
23
- if (!t.usages.includes(e))
24
- throw new TypeError(`CryptoKey does not support this operation, its usages must include ${e}.`);
25
- }
26
- function u(t, e, n) {
27
- switch (e) {
28
- case "HS256":
29
- case "HS384":
30
- case "HS512": {
31
- if (!o(t.algorithm, "HMAC"))
32
- throw r("HMAC");
33
- const a = parseInt(e.slice(2), 10);
34
- if (c(t.algorithm.hash) !== a)
35
- throw r(`SHA-${a}`, "algorithm.hash");
36
- break;
37
- }
38
- case "RS256":
39
- case "RS384":
40
- case "RS512": {
41
- if (!o(t.algorithm, "RSASSA-PKCS1-v1_5"))
42
- throw r("RSASSA-PKCS1-v1_5");
43
- const a = parseInt(e.slice(2), 10);
44
- if (c(t.algorithm.hash) !== a)
45
- throw r(`SHA-${a}`, "algorithm.hash");
46
- break;
47
- }
48
- case "PS256":
49
- case "PS384":
50
- case "PS512": {
51
- if (!o(t.algorithm, "RSA-PSS"))
52
- throw r("RSA-PSS");
53
- const a = parseInt(e.slice(2), 10);
54
- if (c(t.algorithm.hash) !== a)
55
- throw r(`SHA-${a}`, "algorithm.hash");
56
- break;
57
- }
58
- case "Ed25519":
59
- case "EdDSA": {
60
- if (!o(t.algorithm, "Ed25519"))
61
- throw r("Ed25519");
62
- break;
63
- }
64
- case "ES256":
65
- case "ES384":
66
- case "ES512": {
67
- if (!o(t.algorithm, "ECDSA"))
68
- throw r("ECDSA");
69
- const a = h(e);
70
- if (t.algorithm.namedCurve !== a)
71
- throw r(a, "algorithm.namedCurve");
72
- break;
73
- }
74
- default:
75
- throw new TypeError("CryptoKey does not support this operation");
76
- }
77
- i(t, n);
1
+ import { SizeExceedsPaddingSizeError as a } from "./index.native236.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")}`;
78
14
  }
79
15
  export {
80
- u as checkSigCryptoKey
16
+ o as pad
81
17
  };
@@ -1,2 +1,2 @@
1
- import { __require as r } from "./index.native232.js";
1
+ import { __require as r } from "./index.native227.js";
2
2
  r();
@@ -8,15 +8,28 @@ const n = {
8
8
  * @returns Promise that resolves to the stored value or null if not found.
9
9
  */
10
10
  async getItem(t) {
11
+ return (await this.getItemWithOutcome(t)).value;
12
+ },
13
+ /**
14
+ * Retrieves a value from secure storage with read outcome metadata.
15
+ *
16
+ * @param key - The storage key.
17
+ * @returns Promise that resolves to the stored value and read outcome.
18
+ */
19
+ async getItemWithOutcome(t) {
11
20
  try {
12
- const { getItemAsync: e } = await import("expo-secure-store");
13
- return await e(t);
21
+ const { getItemAsync: e } = await import("expo-secure-store"), r = await e(t);
22
+ return r === null ? { value: null, outcome: "not_found" } : { value: r, outcome: "found" };
14
23
  } catch (e) {
15
24
  if (e instanceof Error && e.message.includes("Cannot resolve module"))
16
25
  throw new Error(
17
26
  "SecureStore is not available. Please install expo-secure-store and ensure it's properly configured in your React Native project."
18
27
  );
19
- return console.warn(`Failed to get item from SecureStore: ${e}`), null;
28
+ return console.warn(`Failed to get item from SecureStore: ${e}`), {
29
+ value: null,
30
+ outcome: "error",
31
+ errorMessage: e instanceof Error ? e.message : String(e)
32
+ };
20
33
  }
21
34
  },
22
35
  /**
@@ -1,4 +1,4 @@
1
- import { createSolanaKeyExportIframe as t, createEvmKeyExportIframe as m } from "./index.native129.js";
1
+ import { createSolanaKeyExportIframe as t, createEvmKeyExportIframe as m } from "./index.native138.js";
2
2
  import { signBitcoinHash as i } from "./index.native67.js";
3
3
  import "@coinbase/cdp-api-client";
4
4
  import "./index.native2.js";
@@ -8,15 +8,28 @@ const n = {
8
8
  * @returns Promise that resolves to the value.
9
9
  */
10
10
  async getItem(t) {
11
+ return (await this.getItemWithOutcome(t)).value;
12
+ },
13
+ /**
14
+ * Retrieves a value from AsyncStorage with read outcome metadata.
15
+ *
16
+ * @param key - The storage key.
17
+ * @returns Promise that resolves to the stored value and read outcome.
18
+ */
19
+ async getItemWithOutcome(t) {
11
20
  try {
12
- const { default: e } = await import("@react-native-async-storage/async-storage");
13
- return await e.getItem(t);
21
+ const { default: e } = await import("@react-native-async-storage/async-storage"), r = await e.getItem(t);
22
+ return r === null ? { value: null, outcome: "not_found" } : { value: r, outcome: "found" };
14
23
  } catch (e) {
15
24
  if (e instanceof Error && e.message.includes("Cannot resolve module"))
16
25
  throw new Error(
17
26
  "AsyncStorage is not available. Please install @react-native-async-storage/async-storage and ensure it's properly linked in your React Native project."
18
27
  );
19
- return console.warn(`Failed to get item from AsyncStorage: ${e}`), null;
28
+ return console.warn(`Failed to get item from AsyncStorage: ${e}`), {
29
+ value: null,
30
+ outcome: "error",
31
+ errorMessage: e instanceof Error ? e.message : String(e)
32
+ };
20
33
  }
21
34
  },
22
35
  /**
@@ -27,12 +40,12 @@ const n = {
27
40
  */
28
41
  async setItem(t, e) {
29
42
  try {
30
- const { default: a } = await import("@react-native-async-storage/async-storage");
31
- await a.setItem(t, e);
32
- } catch (a) {
33
- throw a instanceof Error && a.message.includes("Cannot resolve module") ? new Error(
43
+ const { default: r } = await import("@react-native-async-storage/async-storage");
44
+ await r.setItem(t, e);
45
+ } catch (r) {
46
+ throw r instanceof Error && r.message.includes("Cannot resolve module") ? new Error(
34
47
  "AsyncStorage is not available. Please install @react-native-async-storage/async-storage and ensure it's properly linked in your React Native project."
35
- ) : (console.warn(`Failed to set item in AsyncStorage: ${a}`), a);
48
+ ) : (console.warn(`Failed to set item in AsyncStorage: ${r}`), r);
36
49
  }
37
50
  },
38
51
  /**
@@ -58,6 +58,13 @@ export interface PlatformStorage {
58
58
  * @returns Promise that resolves to the stored value or null if not found.
59
59
  */
60
60
  getItem(key: string): Promise<string | null>;
61
+ /**
62
+ * Retrieves a value from storage with read outcome metadata.
63
+ *
64
+ * @param key - The storage key.
65
+ * @returns Promise that resolves to the stored value and read outcome.
66
+ */
67
+ getItemWithOutcome(key: string): Promise<StorageReadResult>;
61
68
  /**
62
69
  * Stores a value in storage.
63
70
  *
@@ -94,6 +101,13 @@ export interface PlatformSecureStorage {
94
101
  * @returns Promise that resolves to the stored value or null if not found.
95
102
  */
96
103
  getItem(key: string): Promise<string | null>;
104
+ /**
105
+ * Retrieves a value from secure storage with read outcome metadata.
106
+ *
107
+ * @param key - The storage key.
108
+ * @returns Promise that resolves to the stored value and read outcome.
109
+ */
110
+ getItemWithOutcome(key: string): Promise<StorageReadResult>;
97
111
  /**
98
112
  * Stores a value in secure storage.
99
113
  *
@@ -116,6 +130,17 @@ export interface PlatformSecureStorage {
116
130
  */
117
131
  clear(): Promise<void>;
118
132
  }
133
+ /**
134
+ * Result of reading a value from storage.
135
+ */
136
+ export interface StorageReadResult {
137
+ /** The stored value, or null if not found or on error. */
138
+ value: string | null;
139
+ /** The outcome of the read: found, not found, or error. */
140
+ outcome: "found" | "not_found" | "error";
141
+ /** The error message when the read failed. */
142
+ errorMessage?: string;
143
+ }
119
144
  /**
120
145
  * Credential returned by a native Apple Sign In flow.
121
146
  */
@@ -2,4 +2,4 @@
2
2
  * Current version of @coinbase/cdp-core package.
3
3
  * This file is auto-generated by scripts/sync-versions.js
4
4
  */
5
- export declare const VERSION = "0.0.117";
5
+ export declare const VERSION = "0.0.118";
@@ -58,6 +58,13 @@ export interface PlatformStorage {
58
58
  * @returns Promise that resolves to the stored value or null if not found.
59
59
  */
60
60
  getItem(key: string): Promise<string | null>;
61
+ /**
62
+ * Retrieves a value from storage with read outcome metadata.
63
+ *
64
+ * @param key - The storage key.
65
+ * @returns Promise that resolves to the stored value and read outcome.
66
+ */
67
+ getItemWithOutcome(key: string): Promise<StorageReadResult>;
61
68
  /**
62
69
  * Stores a value in storage.
63
70
  *
@@ -94,6 +101,13 @@ export interface PlatformSecureStorage {
94
101
  * @returns Promise that resolves to the stored value or null if not found.
95
102
  */
96
103
  getItem(key: string): Promise<string | null>;
104
+ /**
105
+ * Retrieves a value from secure storage with read outcome metadata.
106
+ *
107
+ * @param key - The storage key.
108
+ * @returns Promise that resolves to the stored value and read outcome.
109
+ */
110
+ getItemWithOutcome(key: string): Promise<StorageReadResult>;
97
111
  /**
98
112
  * Stores a value in secure storage.
99
113
  *
@@ -116,6 +130,17 @@ export interface PlatformSecureStorage {
116
130
  */
117
131
  clear(): Promise<void>;
118
132
  }
133
+ /**
134
+ * Result of reading a value from storage.
135
+ */
136
+ export interface StorageReadResult {
137
+ /** The stored value, or null if not found or on error. */
138
+ value: string | null;
139
+ /** The outcome of the read: found, not found, or error. */
140
+ outcome: "found" | "not_found" | "error";
141
+ /** The error message when the read failed. */
142
+ errorMessage?: string;
143
+ }
119
144
  /**
120
145
  * Credential returned by a native Apple Sign In flow.
121
146
  */
@@ -2,4 +2,4 @@
2
2
  * Current version of @coinbase/cdp-core package.
3
3
  * This file is auto-generated by scripts/sync-versions.js
4
4
  */
5
- export declare const VERSION = "0.0.117";
5
+ export declare const VERSION = "0.0.118";
@@ -1,26 +1,26 @@
1
- import { configureCdpApiClient as j, setAuthManager as k, getMfaConfig as C, APIError as g, getProjectConfig as v } from "@coinbase/cdp-api-client";
2
- import { Analytics as s } from "./index.web2.js";
1
+ import { configureCdpApiClient as j, setAuthManager as v, getMfaConfig as C, APIError as g, getProjectConfig as S } from "@coinbase/cdp-api-client";
2
+ import { Analytics as c } from "./index.web2.js";
3
3
  import "./index.web3.js";
4
- import { createAuthManager as S } from "./index.web115.js";
5
- import { OAuthManager as y } from "./index.web116.js";
6
- import { MockAuthManager as M } from "./index.web117.js";
4
+ import { createAuthManager as y } from "./index.web115.js";
5
+ import { OAuthManager as M } from "./index.web116.js";
6
+ import { MockAuthManager as w } from "./index.web117.js";
7
7
  import { MockOAuthManager as P } from "./index.web118.js";
8
8
  import { getPlatformServices as m } from "./index.web5.js";
9
- import { getConfig as n, setCoreAuthManager as h, setCoreOAuthManager as I, setMfaConfig as A, setProjectConfig as b, getCoreAuthManager as w, setConfig as _ } from "./index.web74.js";
9
+ import { getConfig as i, setCoreAuthManager as h, setCoreOAuthManager as I, setMfaConfig as A, setProjectConfig as k, getCoreAuthManager as _, setConfig as O } from "./index.web74.js";
10
10
  import "viem";
11
11
  const x = async (t) => {
12
12
  if (!t.projectId)
13
13
  throw new Error("Project ID is required");
14
- t.disableAnalytics === void 0 || t.disableAnalytics === !1 ? (s.developerIdentifier = t.projectId, s.isUsingMocks = t.useMock === !0, s.isProduction = !t.basePath || t.basePath === "https://api.cdp.coinbase.com/platform") : s.enabled = !1;
15
- let i;
14
+ t.disableAnalytics === void 0 || t.disableAnalytics === !1 ? (c.developerIdentifier = t.projectId, c.isUsingMocks = t.useMock === !0, c.isProduction = !t.basePath || t.basePath === "https://api.cdp.coinbase.com/platform") : c.enabled = !1;
15
+ let a;
16
16
  try {
17
- i = n().projectId !== t.projectId;
17
+ a = i().projectId !== t.projectId;
18
18
  } catch {
19
- i = !0;
19
+ a = !0;
20
20
  }
21
- if (_(t), n().useMock) {
22
- h(new M(n().projectId)), I(new P()), A({
23
- projectId: n().projectId,
21
+ if (O(t), i().useMock) {
22
+ h(new w(i().projectId)), I(new P()), A({
23
+ projectId: i().projectId,
24
24
  enabled: !1,
25
25
  totpConfig: { enabled: !1 },
26
26
  smsConfig: { enabled: !1 },
@@ -29,57 +29,59 @@ const x = async (t) => {
29
29
  requireVerificationOnLogin: !1,
30
30
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
31
31
  updatedAt: (/* @__PURE__ */ new Date()).toISOString()
32
- }), b({
33
- projectId: n().projectId,
32
+ }), k({
33
+ projectId: i().projectId,
34
34
  name: "Mock Project",
35
35
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
36
36
  updatedAt: (/* @__PURE__ */ new Date()).toISOString()
37
37
  });
38
38
  return;
39
39
  }
40
- let a, d = !1;
40
+ let o, s = !1;
41
41
  try {
42
42
  const e = m();
43
- e.secureStorage ? (d = !0, a = {
43
+ e.secureStorage ? (s = !0, o = {
44
44
  getRefreshToken: () => e.secureStorage.getItem("cdp_refresh_token"),
45
- setRefreshToken: (o) => e.secureStorage.setItem("cdp_refresh_token", o),
45
+ getRefreshTokenWithOutcome: () => b(e.secureStorage),
46
+ setRefreshToken: (n) => e.secureStorage.setItem("cdp_refresh_token", n),
46
47
  removeRefreshToken: () => e.secureStorage.removeItem("cdp_refresh_token")
47
- }) : a = {
48
+ }) : o = {
48
49
  getRefreshToken: () => e.storage.getItem("cdp_refresh_token"),
49
- setRefreshToken: (o) => e.storage.setItem("cdp_refresh_token", o),
50
+ getRefreshTokenWithOutcome: () => b(e.storage),
51
+ setRefreshToken: (n) => e.storage.setItem("cdp_refresh_token", n),
50
52
  removeRefreshToken: () => e.storage.removeItem("cdp_refresh_token")
51
53
  };
52
54
  } catch {
53
- s.sendSessionRefreshEvent({
55
+ c.sendSessionRefreshEvent({
54
56
  name: "refresh_token_storage_not_initialized"
55
- }), a = void 0;
57
+ }), o = void 0;
56
58
  }
57
- let r, c, u;
59
+ let r, d, p;
58
60
  try {
59
61
  const e = m();
60
- u = e.deviceInfo?.getPlatform?.(), e.attestation && (r = e.attestation, c = e.deviceInfo?.getAppBundleId?.());
62
+ p = e.deviceInfo?.getPlatform?.(), e.attestation && (r = e.attestation, d = e.deviceInfo?.getAppBundleId?.());
61
63
  } catch {
62
64
  r = void 0;
63
65
  }
64
66
  if (j({
65
- debugging: n().debugging,
66
- basePath: n().basePath,
67
- refreshTokenStorage: a,
68
- retryTokenReads: d,
69
- platform: u,
67
+ debugging: i().debugging,
68
+ basePath: i().basePath,
69
+ refreshTokenStorage: o,
70
+ retryTokenReads: s,
71
+ platform: p,
70
72
  appAttestation: r && {
71
73
  isEnabled: () => r.isEnabled,
72
- appIdentifier: c,
74
+ appIdentifier: d,
73
75
  generateAssertion: r.generateAssertion.bind(r)
74
76
  }
75
- }), i) {
76
- const e = new y();
77
+ }), a) {
78
+ const e = new M();
77
79
  I(e);
78
- const o = S(n().projectId);
79
- h(o), k(o);
80
+ const n = y(i().projectId);
81
+ h(n), v(n);
80
82
  }
81
83
  const [, f, l] = await Promise.allSettled([
82
- w().ensureInitialized(),
84
+ _().ensureInitialized(),
83
85
  (async () => {
84
86
  try {
85
87
  return await C(t.projectId);
@@ -89,7 +91,7 @@ const x = async (t) => {
89
91
  })(),
90
92
  (async () => {
91
93
  try {
92
- return await v(t.projectId);
94
+ return await S(t.projectId);
93
95
  } catch (e) {
94
96
  return (!(e instanceof g) || e.statusCode !== 404) && console.warn("Failed to get project config", e), null;
95
97
  }
@@ -97,21 +99,24 @@ const x = async (t) => {
97
99
  ]);
98
100
  if (f.status === "fulfilled" && f.value && A(f.value), l.status === "fulfilled" && l.value) {
99
101
  const e = l.value;
100
- if (b(e), e.appAttestation && r && c) {
101
- const o = E(e.appAttestation, c);
102
- o !== null && (console.warn(
102
+ if (k(e), e.appAttestation && r && d) {
103
+ const n = R(e.appAttestation, d);
104
+ n !== null && (console.warn(
103
105
  "[Attestation] Project config has attestation enabled for this app, but no attestation provider is registered. Install @coinbase/cdp-app-attest and add `import '@coinbase/cdp-app-attest'` to your app's entry point."
104
- ), r.isEnabled = !0, r.cloudProjectNumber = o.cloudProjectNumber, r.initialize().catch((p) => {
106
+ ), r.isEnabled = !0, r.cloudProjectNumber = n.cloudProjectNumber, r.initialize().catch((u) => {
105
107
  console.error(
106
108
  "[Attestation] Background initialization failed:",
107
- p instanceof Error ? p.message : String(p)
109
+ u instanceof Error ? u.message : String(u)
108
110
  );
109
111
  }));
110
112
  }
111
113
  }
112
- }, E = (t, i) => {
113
- const a = t.android?.find((r) => r.identifier === i);
114
- return a ? { cloudProjectNumber: a.googleProjectNumber } : t.ios?.find((r) => r.identifier === i) ? {} : null;
114
+ }, b = async (t) => {
115
+ const { value: a, outcome: o, errorMessage: s } = await t.getItemWithOutcome("cdp_refresh_token");
116
+ return { token: a, outcome: o, errorMessage: s };
117
+ }, R = (t, a) => {
118
+ const o = t.android?.find((r) => r.identifier === a);
119
+ return o ? { cloudProjectNumber: o.googleProjectNumber } : t.ios?.find((r) => r.identifier === a) ? {} : null;
115
120
  };
116
121
  export {
117
122
  x as initialize
@@ -1,6 +1,6 @@
1
- import { CompactSign as i } from "./index.web133.js";
2
- import { JWTInvalid as r } from "./index.web134.js";
3
- import { JWTClaimsBuilder as n } from "./index.web135.js";
1
+ import { CompactSign as i } from "./index.web130.js";
2
+ import { JWTInvalid as r } from "./index.web131.js";
3
+ import { JWTClaimsBuilder as n } from "./index.web132.js";
4
4
  class d {
5
5
  #s;
6
6
  #t;
@@ -1,5 +1,5 @@
1
- import { InvalidAddressError as s } from "./index.web146.js";
2
- import { isAddress as a } from "./index.web147.js";
1
+ import { InvalidAddressError as s } from "./index.web170.js";
2
+ import { isAddress as a } from "./index.web171.js";
3
3
  function r(n) {
4
4
  if (typeof n == "string") {
5
5
  if (!a(n, { strict: !1 }))