@coinbase/cdp-core 0.0.80 → 0.0.81

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 (267) hide show
  1. package/dist/esm/index.native.js +15 -13
  2. package/dist/esm/index.native10.js +1 -1
  3. package/dist/esm/index.native11.js +1 -1
  4. package/dist/esm/index.native12.js +1 -1
  5. package/dist/esm/index.native122.js +1 -1
  6. package/dist/esm/index.native123.js +1 -1
  7. package/dist/esm/index.native125.js +6 -6
  8. package/dist/esm/index.native13.js +1 -1
  9. package/dist/esm/index.native14.js +1 -1
  10. package/dist/esm/index.native155.js +1 -1
  11. package/dist/esm/index.native16.js +1 -1
  12. package/dist/esm/index.native162.js +20 -4
  13. package/dist/esm/index.native163.js +10 -21
  14. package/dist/esm/index.native164.js +19 -9
  15. package/dist/esm/index.native165.js +89 -15
  16. package/dist/esm/index.native166.js +19 -92
  17. package/dist/esm/index.native167.js +115 -18
  18. package/dist/esm/index.native168.js +5 -118
  19. package/dist/esm/index.native17.js +1 -1
  20. package/dist/esm/index.native172.js +38 -7
  21. package/dist/esm/index.native174.js +67 -375
  22. package/dist/esm/index.native175.js +34 -835
  23. package/dist/esm/index.native176.js +20 -38
  24. package/dist/esm/index.native177.js +8 -2
  25. package/dist/esm/index.native178.js +2 -70
  26. package/dist/esm/index.native179.js +373 -30
  27. package/dist/esm/index.native18.js +1 -1
  28. package/dist/esm/index.native180.js +835 -20
  29. package/dist/esm/index.native182.js +18 -2
  30. package/dist/esm/index.native183.js +28 -109
  31. package/dist/esm/index.native184.js +8 -2
  32. package/dist/esm/index.native185.js +11 -18
  33. package/dist/esm/index.native186.js +13 -28
  34. package/dist/esm/index.native187.js +10 -8
  35. package/dist/esm/index.native188.js +17 -11
  36. package/dist/esm/index.native189.js +80 -12
  37. package/dist/esm/index.native19.js +1 -1
  38. package/dist/esm/index.native190.js +2 -10
  39. package/dist/esm/index.native191.js +108 -16
  40. package/dist/esm/index.native192.js +2 -81
  41. package/dist/esm/index.native194.js +2 -2
  42. package/dist/esm/index.native195.js +2 -2
  43. package/dist/esm/index.native196.js +2 -2
  44. package/dist/esm/index.native20.js +1 -1
  45. package/dist/esm/index.native21.js +1 -1
  46. package/dist/esm/index.native22.js +1 -1
  47. package/dist/esm/index.native23.js +1 -1
  48. package/dist/esm/index.native24.js +1 -1
  49. package/dist/esm/index.native25.js +1 -1
  50. package/dist/esm/index.native26.js +1 -1
  51. package/dist/esm/index.native28.js +1 -1
  52. package/dist/esm/index.native29.js +1 -1
  53. package/dist/esm/index.native3.js +1 -1
  54. package/dist/esm/index.native30.js +1 -1
  55. package/dist/esm/index.native31.js +1 -1
  56. package/dist/esm/index.native32.js +1 -1
  57. package/dist/esm/index.native33.js +1 -1
  58. package/dist/esm/index.native37.js +1 -1
  59. package/dist/esm/index.native39.js +1 -1
  60. package/dist/esm/index.native4.js +1 -1
  61. package/dist/esm/index.native46.js +27 -31
  62. package/dist/esm/index.native47.js +31 -27
  63. package/dist/esm/index.native49.js +1 -1
  64. package/dist/esm/index.native5.js +1 -1
  65. package/dist/esm/index.native50.js +1 -1
  66. package/dist/esm/index.native60.js +1 -1
  67. package/dist/esm/index.native69.js +3 -3
  68. package/dist/esm/index.native72.js +1 -1
  69. package/dist/esm/index.native73.js +1 -1
  70. package/dist/esm/index.native74.js +1 -1
  71. package/dist/esm/index.native78.js +377 -2
  72. package/dist/esm/index.native79.js +29 -2
  73. package/dist/esm/index.native80.js +26 -374
  74. package/dist/esm/index.native81.js +2 -29
  75. package/dist/esm/index.native82.js +2 -29
  76. package/dist/esm/index.native9.js +1 -1
  77. package/dist/esm/index.web.js +9 -7
  78. package/dist/esm/index.web10.js +2 -2
  79. package/dist/esm/index.web11.js +2 -2
  80. package/dist/esm/index.web12.js +2 -2
  81. package/dist/esm/index.web13.js +1 -1
  82. package/dist/esm/index.web15.js +1 -1
  83. package/dist/esm/index.web154.js +1 -1
  84. package/dist/esm/index.web16.js +1 -1
  85. package/dist/esm/index.web17.js +1 -1
  86. package/dist/esm/index.web171.js +38 -7
  87. package/dist/esm/index.web173.js +67 -375
  88. package/dist/esm/index.web174.js +34 -835
  89. package/dist/esm/index.web175.js +20 -38
  90. package/dist/esm/index.web176.js +8 -2
  91. package/dist/esm/index.web177.js +2 -70
  92. package/dist/esm/index.web178.js +373 -30
  93. package/dist/esm/index.web179.js +835 -20
  94. package/dist/esm/index.web18.js +1 -1
  95. package/dist/esm/index.web19.js +1 -1
  96. package/dist/esm/index.web193.js +2 -2
  97. package/dist/esm/index.web194.js +2 -2
  98. package/dist/esm/index.web195.js +2 -2
  99. package/dist/esm/index.web20.js +2 -2
  100. package/dist/esm/index.web21.js +2 -2
  101. package/dist/esm/index.web22.js +2 -2
  102. package/dist/esm/index.web23.js +2 -2
  103. package/dist/esm/index.web24.js +2 -2
  104. package/dist/esm/index.web25.js +2 -2
  105. package/dist/esm/index.web27.js +1 -1
  106. package/dist/esm/index.web28.js +2 -2
  107. package/dist/esm/index.web29.js +2 -2
  108. package/dist/esm/index.web3.js +1 -1
  109. package/dist/esm/index.web30.js +3 -3
  110. package/dist/esm/index.web31.js +2 -2
  111. package/dist/esm/index.web32.js +2 -2
  112. package/dist/esm/index.web36.js +1 -1
  113. package/dist/esm/index.web38.js +2 -2
  114. package/dist/esm/index.web47.js +1 -1
  115. package/dist/esm/index.web48.js +27 -31
  116. package/dist/esm/index.web49.js +32 -3
  117. package/dist/esm/index.web5.js +1 -1
  118. package/dist/esm/index.web50.js +3 -9
  119. package/dist/esm/index.web51.js +8 -64
  120. package/dist/esm/index.web52.js +47 -70
  121. package/dist/esm/index.web53.js +87 -23
  122. package/dist/esm/index.web54.js +23 -17
  123. package/dist/esm/index.web55.js +16 -26
  124. package/dist/esm/index.web62.js +1 -1
  125. package/dist/esm/index.web70.js +1 -1
  126. package/dist/esm/index.web8.js +1 -1
  127. package/dist/esm/index.web9.js +7 -7
  128. package/dist/native/index.native.js +15 -13
  129. package/dist/native/index.native10.js +1 -1
  130. package/dist/native/index.native11.js +1 -1
  131. package/dist/native/index.native12.js +1 -1
  132. package/dist/native/index.native122.js +1 -1
  133. package/dist/native/index.native123.js +1 -1
  134. package/dist/native/index.native125.js +6 -6
  135. package/dist/native/index.native13.js +1 -1
  136. package/dist/native/index.native14.js +1 -1
  137. package/dist/native/index.native155.js +1 -1
  138. package/dist/native/index.native16.js +1 -1
  139. package/dist/native/index.native162.js +20 -4
  140. package/dist/native/index.native163.js +10 -21
  141. package/dist/native/index.native164.js +19 -9
  142. package/dist/native/index.native165.js +89 -15
  143. package/dist/native/index.native166.js +19 -92
  144. package/dist/native/index.native167.js +115 -18
  145. package/dist/native/index.native168.js +5 -118
  146. package/dist/native/index.native17.js +1 -1
  147. package/dist/native/index.native172.js +38 -7
  148. package/dist/native/index.native174.js +67 -375
  149. package/dist/native/index.native175.js +34 -835
  150. package/dist/native/index.native176.js +20 -38
  151. package/dist/native/index.native177.js +8 -2
  152. package/dist/native/index.native178.js +2 -70
  153. package/dist/native/index.native179.js +373 -30
  154. package/dist/native/index.native18.js +1 -1
  155. package/dist/native/index.native180.js +835 -20
  156. package/dist/native/index.native182.js +18 -2
  157. package/dist/native/index.native183.js +28 -109
  158. package/dist/native/index.native184.js +8 -2
  159. package/dist/native/index.native185.js +11 -18
  160. package/dist/native/index.native186.js +13 -28
  161. package/dist/native/index.native187.js +10 -8
  162. package/dist/native/index.native188.js +17 -11
  163. package/dist/native/index.native189.js +80 -12
  164. package/dist/native/index.native19.js +1 -1
  165. package/dist/native/index.native190.js +2 -10
  166. package/dist/native/index.native191.js +108 -16
  167. package/dist/native/index.native192.js +2 -81
  168. package/dist/native/index.native194.js +2 -2
  169. package/dist/native/index.native195.js +2 -2
  170. package/dist/native/index.native196.js +2 -2
  171. package/dist/native/index.native20.js +1 -1
  172. package/dist/native/index.native21.js +1 -1
  173. package/dist/native/index.native22.js +1 -1
  174. package/dist/native/index.native23.js +1 -1
  175. package/dist/native/index.native24.js +1 -1
  176. package/dist/native/index.native25.js +1 -1
  177. package/dist/native/index.native26.js +1 -1
  178. package/dist/native/index.native28.js +1 -1
  179. package/dist/native/index.native29.js +1 -1
  180. package/dist/native/index.native3.js +1 -1
  181. package/dist/native/index.native30.js +1 -1
  182. package/dist/native/index.native31.js +1 -1
  183. package/dist/native/index.native32.js +1 -1
  184. package/dist/native/index.native33.js +1 -1
  185. package/dist/native/index.native37.js +1 -1
  186. package/dist/native/index.native39.js +1 -1
  187. package/dist/native/index.native4.js +1 -1
  188. package/dist/native/index.native46.js +27 -31
  189. package/dist/native/index.native47.js +31 -27
  190. package/dist/native/index.native49.js +1 -1
  191. package/dist/native/index.native5.js +1 -1
  192. package/dist/native/index.native50.js +1 -1
  193. package/dist/native/index.native60.js +1 -1
  194. package/dist/native/index.native69.js +3 -3
  195. package/dist/native/index.native72.js +1 -1
  196. package/dist/native/index.native73.js +1 -1
  197. package/dist/native/index.native74.js +1 -1
  198. package/dist/native/index.native78.js +377 -2
  199. package/dist/native/index.native79.js +29 -2
  200. package/dist/native/index.native80.js +26 -374
  201. package/dist/native/index.native81.js +2 -29
  202. package/dist/native/index.native82.js +2 -29
  203. package/dist/native/index.native9.js +1 -1
  204. package/dist/native-types/index.d.ts +1 -0
  205. package/dist/native-types/index.native.d.ts +1 -0
  206. package/dist/native-types/index.web.d.ts +1 -0
  207. package/dist/native-types/version.d.ts +1 -1
  208. package/dist/types/index.d.ts +1 -0
  209. package/dist/types/index.native.d.ts +1 -0
  210. package/dist/types/index.web.d.ts +1 -0
  211. package/dist/types/version.d.ts +1 -1
  212. package/dist/web/index.web.js +9 -7
  213. package/dist/web/index.web10.js +2 -2
  214. package/dist/web/index.web11.js +2 -2
  215. package/dist/web/index.web12.js +2 -2
  216. package/dist/web/index.web13.js +1 -1
  217. package/dist/web/index.web15.js +1 -1
  218. package/dist/web/index.web154.js +1 -1
  219. package/dist/web/index.web16.js +1 -1
  220. package/dist/web/index.web17.js +1 -1
  221. package/dist/web/index.web171.js +38 -7
  222. package/dist/web/index.web173.js +67 -375
  223. package/dist/web/index.web174.js +34 -835
  224. package/dist/web/index.web175.js +20 -38
  225. package/dist/web/index.web176.js +8 -2
  226. package/dist/web/index.web177.js +2 -70
  227. package/dist/web/index.web178.js +373 -30
  228. package/dist/web/index.web179.js +835 -20
  229. package/dist/web/index.web18.js +1 -1
  230. package/dist/web/index.web19.js +1 -1
  231. package/dist/web/index.web193.js +2 -2
  232. package/dist/web/index.web194.js +2 -2
  233. package/dist/web/index.web195.js +2 -2
  234. package/dist/web/index.web20.js +2 -2
  235. package/dist/web/index.web21.js +2 -2
  236. package/dist/web/index.web22.js +2 -2
  237. package/dist/web/index.web23.js +2 -2
  238. package/dist/web/index.web24.js +2 -2
  239. package/dist/web/index.web25.js +2 -2
  240. package/dist/web/index.web27.js +1 -1
  241. package/dist/web/index.web28.js +2 -2
  242. package/dist/web/index.web29.js +2 -2
  243. package/dist/web/index.web3.js +1 -1
  244. package/dist/web/index.web30.js +3 -3
  245. package/dist/web/index.web31.js +2 -2
  246. package/dist/web/index.web32.js +2 -2
  247. package/dist/web/index.web36.js +1 -1
  248. package/dist/web/index.web38.js +2 -2
  249. package/dist/web/index.web47.js +1 -1
  250. package/dist/web/index.web48.js +27 -31
  251. package/dist/web/index.web49.js +32 -3
  252. package/dist/web/index.web5.js +1 -1
  253. package/dist/web/index.web50.js +3 -9
  254. package/dist/web/index.web51.js +8 -64
  255. package/dist/web/index.web52.js +47 -70
  256. package/dist/web/index.web53.js +87 -23
  257. package/dist/web/index.web54.js +23 -17
  258. package/dist/web/index.web55.js +16 -26
  259. package/dist/web/index.web62.js +1 -1
  260. package/dist/web/index.web70.js +1 -1
  261. package/dist/web/index.web8.js +1 -1
  262. package/dist/web/index.web9.js +7 -7
  263. package/dist/web-types/index.d.ts +1 -0
  264. package/dist/web-types/index.native.d.ts +1 -0
  265. package/dist/web-types/index.web.d.ts +1 -0
  266. package/dist/web-types/version.d.ts +1 -1
  267. package/package.json +2 -2
@@ -1,4 +1,20 @@
1
- const o = "0.1.1";
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
- o as version
18
+ a as decodeBase64,
19
+ o as encodeBase64
4
20
  };
@@ -1,111 +1,30 @@
1
- import { __module as x } from "./index.native184.js";
2
- var w;
3
- function O() {
4
- return w ? x.exports : (w = 1, function(d) {
5
- var g = Object.prototype.hasOwnProperty, c = "~";
6
- function h() {
7
- }
8
- Object.create && (h.prototype = /* @__PURE__ */ Object.create(null), new h().__proto__ || (c = !1));
9
- function b(s, t, n) {
10
- this.fn = s, this.context = t, this.once = n || !1;
11
- }
12
- function m(s, t, n, r, l) {
13
- if (typeof n != "function")
14
- throw new TypeError("The listener must be a function");
15
- var u = new b(n, r || s, l), o = c ? c + t : t;
16
- return s._events[o] ? s._events[o].fn ? s._events[o] = [s._events[o], u] : s._events[o].push(u) : (s._events[o] = u, s._eventsCount++), s;
17
- }
18
- function y(s, t) {
19
- --s._eventsCount === 0 ? s._events = new h() : delete s._events[t];
20
- }
21
- function f() {
22
- this._events = new h(), this._eventsCount = 0;
23
- }
24
- f.prototype.eventNames = function() {
25
- var t = [], n, r;
26
- if (this._eventsCount === 0) return t;
27
- for (r in n = this._events)
28
- g.call(n, r) && t.push(c ? r.slice(1) : r);
29
- return Object.getOwnPropertySymbols ? t.concat(Object.getOwnPropertySymbols(n)) : t;
30
- }, f.prototype.listeners = function(t) {
31
- var n = c ? c + t : t, r = this._events[n];
32
- if (!r) return [];
33
- if (r.fn) return [r.fn];
34
- for (var l = 0, u = r.length, o = new Array(u); l < u; l++)
35
- o[l] = r[l].fn;
36
- return o;
37
- }, f.prototype.listenerCount = function(t) {
38
- var n = c ? c + t : t, r = this._events[n];
39
- return r ? r.fn ? 1 : r.length : 0;
40
- }, f.prototype.emit = function(t, n, r, l, u, o) {
41
- var a = c ? c + t : t;
42
- if (!this._events[a]) return !1;
43
- var e = this._events[a], p = arguments.length, v, i;
44
- if (e.fn) {
45
- switch (e.once && this.removeListener(t, e.fn, void 0, !0), p) {
46
- case 1:
47
- return e.fn.call(e.context), !0;
48
- case 2:
49
- return e.fn.call(e.context, n), !0;
50
- case 3:
51
- return e.fn.call(e.context, n, r), !0;
52
- case 4:
53
- return e.fn.call(e.context, n, r, l), !0;
54
- case 5:
55
- return e.fn.call(e.context, n, r, l, u), !0;
56
- case 6:
57
- return e.fn.call(e.context, n, r, l, u, o), !0;
58
- }
59
- for (i = 1, v = new Array(p - 1); i < p; i++)
60
- v[i - 1] = arguments[i];
61
- e.fn.apply(e.context, v);
62
- } else {
63
- var E = e.length, _;
64
- for (i = 0; i < E; i++)
65
- switch (e[i].once && this.removeListener(t, e[i].fn, void 0, !0), p) {
66
- case 1:
67
- e[i].fn.call(e[i].context);
68
- break;
69
- case 2:
70
- e[i].fn.call(e[i].context, n);
71
- break;
72
- case 3:
73
- e[i].fn.call(e[i].context, n, r);
74
- break;
75
- case 4:
76
- e[i].fn.call(e[i].context, n, r, l);
77
- break;
78
- default:
79
- if (!v) for (_ = 1, v = new Array(p - 1); _ < p; _++)
80
- v[_ - 1] = arguments[_];
81
- e[i].fn.apply(e[i].context, v);
82
- }
83
- }
84
- return !0;
85
- }, f.prototype.on = function(t, n, r) {
86
- return m(this, t, n, r, !1);
87
- }, f.prototype.once = function(t, n, r) {
88
- return m(this, t, n, r, !0);
89
- }, f.prototype.removeListener = function(t, n, r, l) {
90
- var u = c ? c + t : t;
91
- if (!this._events[u]) return this;
92
- if (!n)
93
- return y(this, u), this;
94
- var o = this._events[u];
95
- if (o.fn)
96
- o.fn === n && (!l || o.once) && (!r || o.context === r) && y(this, u);
97
- else {
98
- for (var a = 0, e = [], p = o.length; a < p; a++)
99
- (o[a].fn !== n || l && !o[a].once || r && o[a].context !== r) && e.push(o[a]);
100
- e.length ? this._events[u] = e.length === 1 ? e[0] : e : y(this, u);
101
- }
102
- return this;
103
- }, f.prototype.removeAllListeners = function(t) {
104
- var n;
105
- return t ? (n = c ? c + t : t, this._events[n] && y(this, n)) : (this._events = new h(), this._eventsCount = 0), this;
106
- }, f.prototype.off = f.prototype.removeListener, f.prototype.addListener = f.prototype.on, f.prefixed = c, f.EventEmitter = f, d.exports = f;
107
- }(x), x.exports);
108
- }
1
+ import { JOSENotSupported as r } from "./index.native76.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
+ };
109
28
  export {
110
- O as __require
29
+ S as default
111
30
  };
@@ -1,4 +1,10 @@
1
- var e = { exports: {} };
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`);
6
+ }
7
+ };
2
8
  export {
3
- e as __module
9
+ o as default
4
10
  };
@@ -1,20 +1,13 @@
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 { checkSigCryptoKey as i } from "./index.native197.js";
2
+ import o from "./index.native186.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
+ };
17
11
  export {
18
- a as decodeBase64,
19
- o as encodeBase64
12
+ s as default
20
13
  };
@@ -1,30 +1,15 @@
1
- import { JOSENotSupported as r } from "./index.native76.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
- };
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
+ }
28
12
  export {
29
- S as default
13
+ r as default,
14
+ t as withAlg
30
15
  };
@@ -1,10 +1,12 @@
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`);
6
- }
7
- };
1
+ function e(t) {
2
+ return t?.[Symbol.toStringTag] === "CryptoKey";
3
+ }
4
+ function r(t) {
5
+ return t?.[Symbol.toStringTag] === "KeyObject";
6
+ }
7
+ const n = (t) => e(t) || r(t);
8
8
  export {
9
- o as default
9
+ n as default,
10
+ e as isCryptoKey,
11
+ r as isKeyObject
10
12
  };
@@ -1,13 +1,19 @@
1
- import { checkSigCryptoKey as i } from "./index.native197.js";
2
- import o from "./index.native189.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
+ import n from "./index.native129.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";
13
+ }
11
14
  export {
12
- s as default
15
+ r as isJWK,
16
+ o as isPrivateJWK,
17
+ e as isPublicJWK,
18
+ c as isSecretJWK
13
19
  };
@@ -1,15 +1,83 @@
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);
1
+ import { JOSENotSupported as s } from "./index.native76.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 };
11
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
+ };
12
81
  export {
13
- r as default,
14
- t as withAlg
82
+ i as default
15
83
  };
@@ -2,7 +2,7 @@ import { initiateAuthentication as e } from "@coinbase/cdp-api-client";
2
2
  import { Analytics as o } from "./index.native2.js";
3
3
  import "./index.native3.js";
4
4
  import { getPlatformOAuth as n } from "./index.native8.js";
5
- import { getCoreAuthManager as r, getConfig as a } from "./index.native47.js";
5
+ import { getCoreAuthManager as r, getConfig as a } from "./index.native46.js";
6
6
  async function g(t) {
7
7
  if (o.sendActionCallEvent({ name: "link_oauth" }), !await r().isSignedIn())
8
8
  throw new Error("User must be signed in to link an OAuth account");
@@ -1,12 +1,4 @@
1
- function e(t) {
2
- return t?.[Symbol.toStringTag] === "CryptoKey";
3
- }
4
- function r(t) {
5
- return t?.[Symbol.toStringTag] === "KeyObject";
6
- }
7
- const n = (t) => e(t) || r(t);
1
+ const o = "0.1.1";
8
2
  export {
9
- n as default,
10
- e as isCryptoKey,
11
- r as isKeyObject
3
+ o as version
12
4
  };
@@ -1,19 +1,111 @@
1
- import n from "./index.native129.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 { __module as x } from "./index.native192.js";
2
+ var w;
3
+ function O() {
4
+ return w ? x.exports : (w = 1, function(d) {
5
+ var g = Object.prototype.hasOwnProperty, c = "~";
6
+ function h() {
7
+ }
8
+ Object.create && (h.prototype = /* @__PURE__ */ Object.create(null), new h().__proto__ || (c = !1));
9
+ function b(s, t, n) {
10
+ this.fn = s, this.context = t, this.once = n || !1;
11
+ }
12
+ function m(s, t, n, r, l) {
13
+ if (typeof n != "function")
14
+ throw new TypeError("The listener must be a function");
15
+ var u = new b(n, r || s, l), o = c ? c + t : t;
16
+ return s._events[o] ? s._events[o].fn ? s._events[o] = [s._events[o], u] : s._events[o].push(u) : (s._events[o] = u, s._eventsCount++), s;
17
+ }
18
+ function y(s, t) {
19
+ --s._eventsCount === 0 ? s._events = new h() : delete s._events[t];
20
+ }
21
+ function f() {
22
+ this._events = new h(), this._eventsCount = 0;
23
+ }
24
+ f.prototype.eventNames = function() {
25
+ var t = [], n, r;
26
+ if (this._eventsCount === 0) return t;
27
+ for (r in n = this._events)
28
+ g.call(n, r) && t.push(c ? r.slice(1) : r);
29
+ return Object.getOwnPropertySymbols ? t.concat(Object.getOwnPropertySymbols(n)) : t;
30
+ }, f.prototype.listeners = function(t) {
31
+ var n = c ? c + t : t, r = this._events[n];
32
+ if (!r) return [];
33
+ if (r.fn) return [r.fn];
34
+ for (var l = 0, u = r.length, o = new Array(u); l < u; l++)
35
+ o[l] = r[l].fn;
36
+ return o;
37
+ }, f.prototype.listenerCount = function(t) {
38
+ var n = c ? c + t : t, r = this._events[n];
39
+ return r ? r.fn ? 1 : r.length : 0;
40
+ }, f.prototype.emit = function(t, n, r, l, u, o) {
41
+ var a = c ? c + t : t;
42
+ if (!this._events[a]) return !1;
43
+ var e = this._events[a], p = arguments.length, v, i;
44
+ if (e.fn) {
45
+ switch (e.once && this.removeListener(t, e.fn, void 0, !0), p) {
46
+ case 1:
47
+ return e.fn.call(e.context), !0;
48
+ case 2:
49
+ return e.fn.call(e.context, n), !0;
50
+ case 3:
51
+ return e.fn.call(e.context, n, r), !0;
52
+ case 4:
53
+ return e.fn.call(e.context, n, r, l), !0;
54
+ case 5:
55
+ return e.fn.call(e.context, n, r, l, u), !0;
56
+ case 6:
57
+ return e.fn.call(e.context, n, r, l, u, o), !0;
58
+ }
59
+ for (i = 1, v = new Array(p - 1); i < p; i++)
60
+ v[i - 1] = arguments[i];
61
+ e.fn.apply(e.context, v);
62
+ } else {
63
+ var E = e.length, _;
64
+ for (i = 0; i < E; i++)
65
+ switch (e[i].once && this.removeListener(t, e[i].fn, void 0, !0), p) {
66
+ case 1:
67
+ e[i].fn.call(e[i].context);
68
+ break;
69
+ case 2:
70
+ e[i].fn.call(e[i].context, n);
71
+ break;
72
+ case 3:
73
+ e[i].fn.call(e[i].context, n, r);
74
+ break;
75
+ case 4:
76
+ e[i].fn.call(e[i].context, n, r, l);
77
+ break;
78
+ default:
79
+ if (!v) for (_ = 1, v = new Array(p - 1); _ < p; _++)
80
+ v[_ - 1] = arguments[_];
81
+ e[i].fn.apply(e[i].context, v);
82
+ }
83
+ }
84
+ return !0;
85
+ }, f.prototype.on = function(t, n, r) {
86
+ return m(this, t, n, r, !1);
87
+ }, f.prototype.once = function(t, n, r) {
88
+ return m(this, t, n, r, !0);
89
+ }, f.prototype.removeListener = function(t, n, r, l) {
90
+ var u = c ? c + t : t;
91
+ if (!this._events[u]) return this;
92
+ if (!n)
93
+ return y(this, u), this;
94
+ var o = this._events[u];
95
+ if (o.fn)
96
+ o.fn === n && (!l || o.once) && (!r || o.context === r) && y(this, u);
97
+ else {
98
+ for (var a = 0, e = [], p = o.length; a < p; a++)
99
+ (o[a].fn !== n || l && !o[a].once || r && o[a].context !== r) && e.push(o[a]);
100
+ e.length ? this._events[u] = e.length === 1 ? e[0] : e : y(this, u);
101
+ }
102
+ return this;
103
+ }, f.prototype.removeAllListeners = function(t) {
104
+ var n;
105
+ return t ? (n = c ? c + t : t, this._events[n] && y(this, n)) : (this._events = new h(), this._eventsCount = 0), this;
106
+ }, f.prototype.off = f.prototype.removeListener, f.prototype.addListener = f.prototype.on, f.prefixed = c, f.EventEmitter = f, d.exports = f;
107
+ }(x), x.exports);
13
108
  }
14
109
  export {
15
- r as isJWK,
16
- o as isPrivateJWK,
17
- e as isPublicJWK,
18
- c as isSecretJWK
110
+ O as __require
19
111
  };
@@ -1,83 +1,4 @@
1
- import { JOSENotSupported as s } from "./index.native76.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 e = { exports: {} };
81
2
  export {
82
- i as default
3
+ e as __module
83
4
  };
@@ -1,4 +1,4 @@
1
- var r = {};
1
+ var r = { exports: {} };
2
2
  export {
3
- r as __exports
3
+ r as __module
4
4
  };
@@ -1,4 +1,4 @@
1
- var e = { exports: {} };
1
+ var r = {};
2
2
  export {
3
- e as __module
3
+ r as __exports
4
4
  };