@coinbase/cdp-core 0.0.48 → 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 (271) hide show
  1. package/dist/esm/index.native102.js +19 -77
  2. package/dist/esm/index.native103.js +9 -9
  3. package/dist/esm/index.native104.js +19 -20
  4. package/dist/esm/index.native105.js +93 -9
  5. package/dist/esm/index.native106.js +19 -18
  6. package/dist/esm/index.native107.js +105 -81
  7. package/dist/esm/index.native108.js +9 -20
  8. package/dist/esm/index.native109.js +73 -112
  9. package/dist/esm/index.native111.js +18 -13
  10. package/dist/esm/index.native112.js +27 -35
  11. package/dist/esm/index.native113.js +7 -41
  12. package/dist/esm/index.native114.js +11 -18
  13. package/dist/esm/index.native115.js +13 -28
  14. package/dist/esm/index.native116.js +10 -8
  15. package/dist/esm/index.native117.js +17 -11
  16. package/dist/esm/index.native118.js +80 -12
  17. package/dist/esm/index.native119.js +13 -10
  18. package/dist/esm/index.native12.js +4 -4
  19. package/dist/esm/index.native120.js +36 -17
  20. package/dist/esm/index.native121.js +40 -79
  21. package/dist/esm/index.native17.js +1 -1
  22. package/dist/esm/index.native18.js +33 -24
  23. package/dist/esm/index.native2.js +8 -6
  24. package/dist/esm/index.native22.js +1 -1
  25. package/dist/esm/index.native3.js +2 -2
  26. package/dist/esm/index.native32.js +940 -149
  27. package/dist/esm/index.native33.js +2 -48
  28. package/dist/esm/index.native34.js +43 -244
  29. package/dist/esm/index.native35.js +27 -55
  30. package/dist/esm/index.native36.js +149 -940
  31. package/dist/esm/index.native37.js +48 -2
  32. package/dist/esm/index.native38.js +244 -43
  33. package/dist/esm/index.native39.js +55 -27
  34. package/dist/esm/index.native4.js +4 -2
  35. package/dist/esm/index.native5.js +19 -17
  36. package/dist/esm/index.native6.js +10 -8
  37. package/dist/esm/index.native90.js +6 -6
  38. package/dist/esm/index.native99.js +1 -1
  39. package/dist/esm/index.web100.js +2 -7
  40. package/dist/esm/index.web101.js +17 -17
  41. package/dist/esm/index.web102.js +20 -10
  42. package/dist/esm/index.web103.js +80 -20
  43. package/dist/esm/index.web104.js +99 -89
  44. package/dist/esm/index.web105.js +32 -20
  45. package/dist/esm/index.web106.js +7 -118
  46. package/dist/esm/index.web107.js +10 -79
  47. package/dist/esm/index.web108.js +79 -10
  48. package/dist/esm/index.web109.js +18 -5
  49. package/dist/esm/index.web110.js +28 -18
  50. package/dist/esm/index.web111.js +6 -26
  51. package/dist/esm/index.web112.js +9 -6
  52. package/dist/esm/index.web113.js +13 -11
  53. package/dist/esm/index.web114.js +8 -11
  54. package/dist/esm/index.web115.js +14 -7
  55. package/dist/esm/index.web116.js +80 -16
  56. package/dist/esm/index.web117.js +5 -81
  57. package/dist/esm/index.web119.js +4 -4
  58. package/dist/esm/index.web120.js +5 -5
  59. package/dist/esm/index.web16.js +1 -1
  60. package/dist/esm/index.web17.js +33 -24
  61. package/dist/esm/index.web2.js +10 -8
  62. package/dist/esm/index.web21.js +1 -1
  63. package/dist/esm/index.web25.js +13 -13
  64. package/dist/esm/index.web27.js +3 -3
  65. package/dist/esm/index.web3.js +4 -2
  66. package/dist/esm/index.web30.js +2 -2
  67. package/dist/esm/index.web34.js +2 -2
  68. package/dist/esm/index.web35.js +16 -950
  69. package/dist/esm/index.web36.js +23 -2
  70. package/dist/esm/index.web37.js +50 -49
  71. package/dist/esm/index.web38.js +950 -27
  72. package/dist/esm/index.web39.js +2 -17
  73. package/dist/esm/index.web4.js +12 -12
  74. package/dist/esm/index.web40.js +48 -21
  75. package/dist/esm/index.web41.js +27 -50
  76. package/dist/esm/index.web44.js +54 -8
  77. package/dist/esm/index.web45.js +9 -16
  78. package/dist/esm/index.web46.js +2 -46
  79. package/dist/esm/index.web47.js +45 -14
  80. package/dist/esm/index.web48.js +12 -54
  81. package/dist/esm/index.web49.js +8 -6
  82. package/dist/esm/index.web5.js +4 -2
  83. package/dist/esm/index.web50.js +16 -20
  84. package/dist/esm/index.web51.js +45 -11
  85. package/dist/esm/index.web52.js +13 -3
  86. package/dist/esm/index.web53.js +55 -3
  87. package/dist/esm/index.web54.js +6 -34
  88. package/dist/esm/index.web55.js +19 -10
  89. package/dist/esm/index.web56.js +11 -4
  90. package/dist/esm/index.web57.js +3 -28
  91. package/dist/esm/index.web58.js +3 -6
  92. package/dist/esm/index.web59.js +34 -24
  93. package/dist/esm/index.web60.js +12 -16
  94. package/dist/esm/index.web61.js +4 -54
  95. package/dist/esm/index.web62.js +25 -20
  96. package/dist/esm/index.web63.js +6 -11
  97. package/dist/esm/index.web64.js +23 -26
  98. package/dist/esm/index.web65.js +16 -42
  99. package/dist/esm/index.web66.js +52 -53
  100. package/dist/esm/index.web67.js +23 -127
  101. package/dist/esm/index.web68.js +11 -12
  102. package/dist/esm/index.web69.js +27 -104
  103. package/dist/esm/index.web70.js +42 -6
  104. package/dist/esm/index.web71.js +56 -3
  105. package/dist/esm/index.web72.js +127 -14
  106. package/dist/esm/index.web73.js +9 -39
  107. package/dist/esm/index.web74.js +100 -74
  108. package/dist/esm/index.web75.js +7 -2
  109. package/dist/esm/index.web76.js +3 -2
  110. package/dist/esm/index.web77.js +14 -12
  111. package/dist/esm/index.web78.js +34 -29
  112. package/dist/esm/index.web79.js +77 -5
  113. package/dist/esm/index.web80.js +2 -35
  114. package/dist/esm/index.web81.js +2 -9
  115. package/dist/esm/index.web82.js +11 -9
  116. package/dist/esm/index.web83.js +37 -11
  117. package/dist/esm/index.web84.js +6 -13
  118. package/dist/esm/index.web85.js +33 -17
  119. package/dist/esm/index.web86.js +8 -5
  120. package/dist/esm/index.web87.js +11 -5
  121. package/dist/esm/index.web88.js +11 -10
  122. package/dist/esm/index.web89.js +13 -54
  123. package/dist/esm/index.web90.js +18 -10
  124. package/dist/esm/index.web91.js +6 -2
  125. package/dist/esm/index.web92.js +4 -44
  126. package/dist/esm/index.web93.js +10 -13
  127. package/dist/esm/index.web94.js +21 -2
  128. package/dist/esm/index.web95.js +10 -21
  129. package/dist/esm/index.web96.js +19 -19
  130. package/dist/esm/index.web97.js +94 -80
  131. package/dist/esm/index.web98.js +20 -103
  132. package/dist/esm/index.web99.js +115 -30
  133. package/dist/native/index.native102.js +19 -77
  134. package/dist/native/index.native103.js +9 -9
  135. package/dist/native/index.native104.js +19 -20
  136. package/dist/native/index.native105.js +93 -9
  137. package/dist/native/index.native106.js +19 -18
  138. package/dist/native/index.native107.js +105 -81
  139. package/dist/native/index.native108.js +9 -20
  140. package/dist/native/index.native109.js +73 -112
  141. package/dist/native/index.native111.js +18 -13
  142. package/dist/native/index.native112.js +27 -35
  143. package/dist/native/index.native113.js +7 -41
  144. package/dist/native/index.native114.js +11 -18
  145. package/dist/native/index.native115.js +13 -28
  146. package/dist/native/index.native116.js +10 -8
  147. package/dist/native/index.native117.js +17 -11
  148. package/dist/native/index.native118.js +80 -12
  149. package/dist/native/index.native119.js +13 -10
  150. package/dist/native/index.native12.js +4 -4
  151. package/dist/native/index.native120.js +36 -17
  152. package/dist/native/index.native121.js +40 -79
  153. package/dist/native/index.native17.js +1 -1
  154. package/dist/native/index.native18.js +33 -24
  155. package/dist/native/index.native2.js +8 -6
  156. package/dist/native/index.native22.js +1 -1
  157. package/dist/native/index.native3.js +2 -2
  158. package/dist/native/index.native32.js +940 -149
  159. package/dist/native/index.native33.js +2 -48
  160. package/dist/native/index.native34.js +43 -244
  161. package/dist/native/index.native35.js +27 -55
  162. package/dist/native/index.native36.js +149 -940
  163. package/dist/native/index.native37.js +48 -2
  164. package/dist/native/index.native38.js +244 -43
  165. package/dist/native/index.native39.js +55 -27
  166. package/dist/native/index.native4.js +4 -2
  167. package/dist/native/index.native5.js +19 -17
  168. package/dist/native/index.native6.js +10 -8
  169. package/dist/native/index.native90.js +6 -6
  170. package/dist/native/index.native99.js +1 -1
  171. package/dist/native-types/platform/types.d.ts +3 -3
  172. package/dist/native-types/types.d.ts +5 -7
  173. package/dist/types/platform/types.d.ts +3 -3
  174. package/dist/types/types.d.ts +5 -7
  175. package/dist/web/index.web100.js +2 -7
  176. package/dist/web/index.web101.js +17 -17
  177. package/dist/web/index.web102.js +20 -10
  178. package/dist/web/index.web103.js +80 -20
  179. package/dist/web/index.web104.js +99 -89
  180. package/dist/web/index.web105.js +32 -20
  181. package/dist/web/index.web106.js +7 -118
  182. package/dist/web/index.web107.js +10 -79
  183. package/dist/web/index.web108.js +79 -10
  184. package/dist/web/index.web109.js +18 -5
  185. package/dist/web/index.web110.js +28 -18
  186. package/dist/web/index.web111.js +6 -26
  187. package/dist/web/index.web112.js +9 -6
  188. package/dist/web/index.web113.js +13 -11
  189. package/dist/web/index.web114.js +8 -11
  190. package/dist/web/index.web115.js +14 -7
  191. package/dist/web/index.web116.js +80 -16
  192. package/dist/web/index.web117.js +5 -81
  193. package/dist/web/index.web119.js +4 -4
  194. package/dist/web/index.web120.js +5 -5
  195. package/dist/web/index.web16.js +1 -1
  196. package/dist/web/index.web17.js +33 -24
  197. package/dist/web/index.web2.js +10 -8
  198. package/dist/web/index.web21.js +1 -1
  199. package/dist/web/index.web25.js +13 -13
  200. package/dist/web/index.web27.js +3 -3
  201. package/dist/web/index.web3.js +4 -2
  202. package/dist/web/index.web30.js +2 -2
  203. package/dist/web/index.web34.js +2 -2
  204. package/dist/web/index.web35.js +16 -950
  205. package/dist/web/index.web36.js +23 -2
  206. package/dist/web/index.web37.js +50 -49
  207. package/dist/web/index.web38.js +950 -27
  208. package/dist/web/index.web39.js +2 -17
  209. package/dist/web/index.web4.js +12 -12
  210. package/dist/web/index.web40.js +48 -21
  211. package/dist/web/index.web41.js +27 -50
  212. package/dist/web/index.web44.js +54 -8
  213. package/dist/web/index.web45.js +9 -16
  214. package/dist/web/index.web46.js +2 -46
  215. package/dist/web/index.web47.js +45 -14
  216. package/dist/web/index.web48.js +12 -54
  217. package/dist/web/index.web49.js +8 -6
  218. package/dist/web/index.web5.js +4 -2
  219. package/dist/web/index.web50.js +16 -20
  220. package/dist/web/index.web51.js +45 -11
  221. package/dist/web/index.web52.js +13 -3
  222. package/dist/web/index.web53.js +55 -3
  223. package/dist/web/index.web54.js +6 -34
  224. package/dist/web/index.web55.js +19 -10
  225. package/dist/web/index.web56.js +11 -4
  226. package/dist/web/index.web57.js +3 -28
  227. package/dist/web/index.web58.js +3 -6
  228. package/dist/web/index.web59.js +34 -24
  229. package/dist/web/index.web60.js +12 -16
  230. package/dist/web/index.web61.js +4 -54
  231. package/dist/web/index.web62.js +25 -20
  232. package/dist/web/index.web63.js +6 -11
  233. package/dist/web/index.web64.js +23 -26
  234. package/dist/web/index.web65.js +16 -42
  235. package/dist/web/index.web66.js +52 -53
  236. package/dist/web/index.web67.js +23 -127
  237. package/dist/web/index.web68.js +11 -12
  238. package/dist/web/index.web69.js +27 -104
  239. package/dist/web/index.web70.js +42 -6
  240. package/dist/web/index.web71.js +56 -3
  241. package/dist/web/index.web72.js +127 -14
  242. package/dist/web/index.web73.js +9 -39
  243. package/dist/web/index.web74.js +100 -74
  244. package/dist/web/index.web75.js +7 -2
  245. package/dist/web/index.web76.js +3 -2
  246. package/dist/web/index.web77.js +14 -12
  247. package/dist/web/index.web78.js +34 -29
  248. package/dist/web/index.web79.js +77 -5
  249. package/dist/web/index.web80.js +2 -35
  250. package/dist/web/index.web81.js +2 -9
  251. package/dist/web/index.web82.js +11 -9
  252. package/dist/web/index.web83.js +37 -11
  253. package/dist/web/index.web84.js +6 -13
  254. package/dist/web/index.web85.js +33 -17
  255. package/dist/web/index.web86.js +8 -5
  256. package/dist/web/index.web87.js +11 -5
  257. package/dist/web/index.web88.js +11 -10
  258. package/dist/web/index.web89.js +13 -54
  259. package/dist/web/index.web90.js +18 -10
  260. package/dist/web/index.web91.js +6 -2
  261. package/dist/web/index.web92.js +4 -44
  262. package/dist/web/index.web93.js +10 -13
  263. package/dist/web/index.web94.js +21 -2
  264. package/dist/web/index.web95.js +10 -21
  265. package/dist/web/index.web96.js +19 -19
  266. package/dist/web/index.web97.js +94 -80
  267. package/dist/web/index.web98.js +20 -103
  268. package/dist/web/index.web99.js +115 -30
  269. package/dist/web-types/platform/types.d.ts +3 -3
  270. package/dist/web-types/types.d.ts +5 -7
  271. package/package.json +2 -2
@@ -1,12 +1,81 @@
1
- import { contracts as o } from "./index.web118.js";
2
- import { formatters as r } from "./index.web119.js";
3
- import { serializers as t } from "./index.web120.js";
4
- const e = {
5
- blockTime: 2e3,
6
- contracts: o,
7
- formatters: r,
8
- serializers: t
9
- };
1
+ import { Hash as g, createView as l, aexists as b, toBytes as a, abytes as d, aoutput as x, clean as w } from "./index.web103.js";
2
+ function y(o, t, s, n) {
3
+ if (typeof o.setBigUint64 == "function")
4
+ return o.setBigUint64(t, s, n);
5
+ const i = BigInt(32), h = BigInt(4294967295), e = Number(s >> i & h), r = Number(s & h), c = n ? 4 : 0, u = n ? 0 : 4;
6
+ o.setUint32(t + c, e, n), o.setUint32(t + u, r, n);
7
+ }
8
+ function U(o, t, s) {
9
+ return o & t ^ ~o & s;
10
+ }
11
+ function _(o, t, s) {
12
+ return o & t ^ o & s ^ t & s;
13
+ }
14
+ class m extends g {
15
+ constructor(t, s, n, i) {
16
+ super(), this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.blockLen = t, this.outputLen = s, this.padOffset = n, this.isLE = i, this.buffer = new Uint8Array(t), this.view = l(this.buffer);
17
+ }
18
+ update(t) {
19
+ b(this), t = a(t), d(t);
20
+ const { view: s, buffer: n, blockLen: i } = this, h = t.length;
21
+ for (let e = 0; e < h; ) {
22
+ const r = Math.min(i - this.pos, h - e);
23
+ if (r === i) {
24
+ const c = l(t);
25
+ for (; i <= h - e; e += i)
26
+ this.process(c, e);
27
+ continue;
28
+ }
29
+ n.set(t.subarray(e, e + r), this.pos), this.pos += r, e += r, this.pos === i && (this.process(s, 0), this.pos = 0);
30
+ }
31
+ return this.length += t.length, this.roundClean(), this;
32
+ }
33
+ digestInto(t) {
34
+ b(this), x(t, this), this.finished = !0;
35
+ const { buffer: s, view: n, blockLen: i, isLE: h } = this;
36
+ let { pos: e } = this;
37
+ s[e++] = 128, w(this.buffer.subarray(e)), this.padOffset > i - e && (this.process(n, 0), e = 0);
38
+ for (let f = e; f < i; f++)
39
+ s[f] = 0;
40
+ y(n, i - 8, BigInt(this.length * 8), h), this.process(n, 0);
41
+ const r = l(t), c = this.outputLen;
42
+ if (c % 4)
43
+ throw new Error("_sha2: outputLen should be aligned to 32bit");
44
+ const u = c / 4, p = this.get();
45
+ if (u > p.length)
46
+ throw new Error("_sha2: outputLen bigger than state");
47
+ for (let f = 0; f < u; f++)
48
+ r.setUint32(4 * f, p[f], h);
49
+ }
50
+ digest() {
51
+ const { buffer: t, outputLen: s } = this;
52
+ this.digestInto(t);
53
+ const n = t.slice(0, s);
54
+ return this.destroy(), n;
55
+ }
56
+ _cloneInto(t) {
57
+ t || (t = new this.constructor()), t.set(...this.get());
58
+ const { blockLen: s, buffer: n, length: i, finished: h, destroyed: e, pos: r } = this;
59
+ return t.destroyed = e, t.finished = h, t.length = i, t.pos = r, i % s && t.buffer.set(n), t;
60
+ }
61
+ clone() {
62
+ return this._cloneInto();
63
+ }
64
+ }
65
+ const B = /* @__PURE__ */ Uint32Array.from([
66
+ 1779033703,
67
+ 3144134277,
68
+ 1013904242,
69
+ 2773480762,
70
+ 1359893119,
71
+ 2600822924,
72
+ 528734635,
73
+ 1541459225
74
+ ]);
10
75
  export {
11
- e as chainConfig
76
+ U as Chi,
77
+ m as HashMD,
78
+ _ as Maj,
79
+ B as SHA256_IV,
80
+ y as setBigUint64
12
81
  };
@@ -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",