@coinbase/cdp-core 0.0.118 → 0.0.120

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 +52 -51
  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 +3 -3
  5. package/dist/esm/index.web127.js +13 -373
  6. package/dist/esm/index.web128.js +22 -28
  7. package/dist/esm/index.web129.js +50 -28
  8. package/dist/esm/index.web130.js +373 -13
  9. package/dist/esm/index.web131.js +28 -22
  10. package/dist/esm/index.web132.js +28 -50
  11. package/dist/esm/index.web133.js +1 -1
  12. package/dist/esm/index.web134.js +1 -1
  13. package/dist/esm/index.web138.js +1 -1
  14. package/dist/esm/index.web139.js +1 -1
  15. package/dist/esm/index.web142.js +13 -2
  16. package/dist/esm/index.web143.js +12 -2
  17. package/dist/esm/index.web144.js +54 -14
  18. package/dist/esm/index.web145.js +10 -28
  19. package/dist/esm/index.web146.js +2 -8
  20. package/dist/esm/index.web147.js +45 -4
  21. package/dist/esm/index.web148.js +13 -28
  22. package/dist/esm/index.web149.js +4 -8
  23. package/dist/esm/index.web150.js +2 -8
  24. package/dist/esm/index.web151.js +2 -81
  25. package/dist/esm/index.web152.js +4 -18
  26. package/dist/esm/index.web153.js +28 -3
  27. package/dist/esm/index.web154.js +7 -15
  28. package/dist/esm/index.web155.js +3 -4
  29. package/dist/esm/index.web156.js +19 -5
  30. package/dist/esm/index.web157.js +8 -19
  31. package/dist/esm/index.web158.js +7 -61
  32. package/dist/esm/index.web159.js +79 -16
  33. package/dist/esm/index.web160.js +24 -19
  34. package/dist/esm/index.web161.js +3 -8
  35. package/dist/esm/index.web162.js +6 -33
  36. package/dist/esm/index.web163.js +4 -7
  37. package/dist/esm/index.web164.js +14 -20
  38. package/dist/esm/index.web165.js +18 -53
  39. package/dist/esm/index.web166.js +61 -10
  40. package/dist/esm/index.web167.js +18 -2
  41. package/dist/esm/index.web168.js +23 -44
  42. package/dist/esm/index.web169.js +8 -13
  43. package/dist/esm/index.web170.js +41 -11
  44. package/dist/esm/index.web171.js +7 -11
  45. package/dist/esm/index.web172.js +20 -4
  46. package/dist/esm/index.web191.js +1 -1
  47. package/dist/esm/index.web193.js +1 -1
  48. package/dist/esm/index.web194.js +2 -2
  49. package/dist/esm/index.web202.js +2 -2
  50. package/dist/esm/index.web21.js +16 -5
  51. package/dist/esm/index.web219.js +102 -19
  52. package/dist/esm/index.web220.js +79 -10
  53. package/dist/esm/index.web221.js +79 -20
  54. package/dist/esm/index.web222.js +20 -93
  55. package/dist/esm/index.web223.js +9 -20
  56. package/dist/esm/index.web224.js +16 -114
  57. package/dist/esm/index.web225.js +89 -99
  58. package/dist/esm/index.web226.js +20 -78
  59. package/dist/esm/index.web227.js +118 -79
  60. package/dist/esm/index.web228.js +2 -109
  61. package/dist/esm/index.web229.js +109 -2
  62. package/dist/esm/index.web230.js +2 -2
  63. package/dist/esm/index.web237.js +1 -1
  64. package/dist/esm/index.web242.js +1 -1
  65. package/dist/esm/index.web244.js +1 -1
  66. package/dist/esm/index.web247.js +1 -1
  67. package/dist/esm/index.web248.js +1 -1
  68. package/dist/esm/index.web250.js +78 -14
  69. package/dist/esm/index.web251.js +14 -78
  70. package/dist/esm/index.web64.js +24 -22
  71. package/dist/esm/index.web65.js +13 -17
  72. package/dist/esm/index.web85.js +85 -64
  73. package/dist/esm/index.web9.js +1 -1
  74. package/dist/native/index.native109.js +3 -3
  75. package/dist/native/index.native11.js +1 -1
  76. package/dist/native/index.native116.js +2 -2
  77. package/dist/native/index.native12.js +51 -50
  78. package/dist/native/index.native128.js +12 -12
  79. package/dist/native/index.native133.js +104 -27
  80. package/dist/native/index.native134.js +16 -28
  81. package/dist/native/index.native135.js +21 -15
  82. package/dist/native/index.native136.js +49 -21
  83. package/dist/native/index.native137.js +28 -50
  84. package/dist/native/index.native138.js +27 -104
  85. package/dist/native/index.native141.js +1 -1
  86. package/dist/native/index.native142.js +1 -1
  87. package/dist/native/index.native144.js +1 -1
  88. package/dist/native/index.native145.js +2 -2
  89. package/dist/native/index.native146.js +5 -55
  90. package/dist/native/index.native147.js +47 -10
  91. package/dist/native/index.native148.js +36 -2
  92. package/dist/native/index.native149.js +66 -43
  93. package/dist/native/index.native150.js +54 -13
  94. package/dist/native/index.native151.js +11 -5
  95. package/dist/native/index.native152.js +2 -48
  96. package/dist/native/index.native153.js +44 -35
  97. package/dist/native/index.native154.js +12 -66
  98. package/dist/native/index.native155.js +13 -13
  99. package/dist/native/index.native156.js +54 -26
  100. package/dist/native/index.native157.js +6 -7
  101. package/dist/native/index.native158.js +21 -3
  102. package/dist/native/index.native159.js +16 -26
  103. package/dist/native/index.native160.js +45 -8
  104. package/dist/native/index.native161.js +3 -7
  105. package/dist/native/index.native162.js +3 -79
  106. package/dist/native/index.native163.js +32 -25
  107. package/dist/native/index.native164.js +12 -3
  108. package/dist/native/index.native165.js +4 -14
  109. package/dist/native/index.native166.js +28 -4
  110. package/dist/native/index.native167.js +6 -13
  111. package/dist/native/index.native168.js +31 -18
  112. package/dist/native/index.native169.js +9 -57
  113. package/dist/native/index.native170.js +55 -17
  114. package/dist/native/index.native171.js +41 -22
  115. package/dist/native/index.native172.js +127 -8
  116. package/dist/native/index.native173.js +102 -39
  117. package/dist/native/index.native174.js +6 -7
  118. package/dist/native/index.native175.js +3 -21
  119. package/dist/native/index.native176.js +79 -2
  120. package/dist/native/index.native177.js +2 -2
  121. package/dist/native/index.native178.js +2 -14
  122. package/dist/native/index.native179.js +33 -51
  123. package/dist/native/index.native180.js +6 -6
  124. package/dist/native/index.native181.js +32 -19
  125. package/dist/native/index.native182.js +14 -17
  126. package/dist/native/index.native183.js +30 -41
  127. package/dist/native/index.native184.js +18 -3
  128. package/dist/native/index.native185.js +8 -3
  129. package/dist/native/index.native186.js +9 -33
  130. package/dist/native/index.native187.js +11 -12
  131. package/dist/native/index.native188.js +13 -4
  132. package/dist/native/index.native189.js +5 -28
  133. package/dist/native/index.native190.js +5 -7
  134. package/dist/native/index.native191.js +10 -32
  135. package/dist/native/index.native192.js +2 -13
  136. package/dist/native/index.native193.js +2 -56
  137. package/dist/native/index.native194.js +13 -42
  138. package/dist/native/index.native195.js +26 -126
  139. package/dist/native/index.native196.js +7 -104
  140. package/dist/native/index.native197.js +3 -6
  141. package/dist/native/index.native198.js +28 -3
  142. package/dist/native/index.native199.js +8 -78
  143. package/dist/native/index.native2.js +2 -2
  144. package/dist/native/index.native200.js +8 -2
  145. package/dist/native/index.native201.js +80 -2
  146. package/dist/native/index.native202.js +25 -35
  147. package/dist/native/index.native203.js +3 -6
  148. package/dist/native/index.native204.js +14 -34
  149. package/dist/native/index.native205.js +4 -14
  150. package/dist/native/index.native206.js +13 -34
  151. package/dist/native/index.native207.js +18 -17
  152. package/dist/native/index.native208.js +60 -8
  153. package/dist/native/index.native209.js +17 -10
  154. package/dist/native/index.native210.js +23 -11
  155. package/dist/native/index.native211.js +8 -13
  156. package/dist/native/index.native212.js +41 -5
  157. package/dist/native/index.native213.js +8 -5
  158. package/dist/native/index.native214.js +20 -10
  159. package/dist/native/index.native221.js +2 -2
  160. package/dist/native/index.native222.js +3 -3
  161. package/dist/native/index.native224.js +3 -3
  162. package/dist/native/index.native225.js +1 -1
  163. package/dist/native/index.native226.js +3 -3
  164. package/dist/native/index.native227.js +38 -7
  165. package/dist/native/index.native229.js +67 -358
  166. package/dist/native/index.native23.js +16 -5
  167. package/dist/native/index.native230.js +34 -852
  168. package/dist/native/index.native231.js +14 -38
  169. package/dist/native/index.native232.js +8 -2
  170. package/dist/native/index.native233.js +2 -70
  171. package/dist/native/index.native234.js +355 -29
  172. package/dist/native/index.native235.js +852 -14
  173. package/dist/native/index.native236.js +14 -40
  174. package/dist/native/index.native237.js +2 -21
  175. package/dist/native/index.native238.js +20 -2
  176. package/dist/native/index.native239.js +31 -18
  177. package/dist/native/index.native240.js +6 -32
  178. package/dist/native/index.native241.js +3 -6
  179. package/dist/native/index.native242.js +45 -16
  180. package/dist/native/index.native243.js +2 -28
  181. package/dist/native/index.native244.js +2 -8
  182. package/dist/native/index.native245.js +2 -11
  183. package/dist/native/index.native246.js +16 -11
  184. package/dist/native/index.native247.js +28 -10
  185. package/dist/native/index.native248.js +8 -17
  186. package/dist/native/index.native249.js +9 -79
  187. package/dist/native/index.native250.js +13 -2
  188. package/dist/native/index.native251.js +10 -2
  189. package/dist/native/index.native252.js +15 -2
  190. package/dist/native/index.native253.js +81 -2
  191. package/dist/native/index.native256.js +1 -1
  192. package/dist/native/index.native3.js +1 -1
  193. package/dist/native/index.native66.js +24 -22
  194. package/dist/native/index.native67.js +15 -19
  195. package/dist/native/index.native86.js +1 -1
  196. package/dist/native/index.native87.js +85 -64
  197. package/dist/native-types/actions/createBitcoinAccount.d.ts +5 -2
  198. package/dist/native-types/actions/getCurrentUser.d.ts +18 -1
  199. package/dist/native-types/actions/signBitcoinHash.d.ts +7 -5
  200. package/dist/native-types/core.d.ts +1 -1
  201. package/dist/native-types/types.d.ts +2 -2
  202. package/dist/native-types/version.d.ts +1 -1
  203. package/dist/types/actions/createBitcoinAccount.d.ts +5 -2
  204. package/dist/types/actions/getCurrentUser.d.ts +18 -1
  205. package/dist/types/actions/signBitcoinHash.d.ts +7 -5
  206. package/dist/types/core.d.ts +1 -1
  207. package/dist/types/types.d.ts +2 -2
  208. package/dist/types/version.d.ts +1 -1
  209. package/dist/web/index.web10.js +52 -51
  210. package/dist/web/index.web107.js +3 -3
  211. package/dist/web/index.web110.js +2 -2
  212. package/dist/web/index.web114.js +3 -3
  213. package/dist/web/index.web127.js +13 -373
  214. package/dist/web/index.web128.js +22 -28
  215. package/dist/web/index.web129.js +50 -28
  216. package/dist/web/index.web130.js +373 -13
  217. package/dist/web/index.web131.js +28 -22
  218. package/dist/web/index.web132.js +28 -50
  219. package/dist/web/index.web133.js +1 -1
  220. package/dist/web/index.web134.js +1 -1
  221. package/dist/web/index.web138.js +1 -1
  222. package/dist/web/index.web139.js +1 -1
  223. package/dist/web/index.web142.js +13 -2
  224. package/dist/web/index.web143.js +12 -2
  225. package/dist/web/index.web144.js +54 -14
  226. package/dist/web/index.web145.js +10 -28
  227. package/dist/web/index.web146.js +2 -8
  228. package/dist/web/index.web147.js +45 -4
  229. package/dist/web/index.web148.js +13 -28
  230. package/dist/web/index.web149.js +4 -8
  231. package/dist/web/index.web150.js +2 -8
  232. package/dist/web/index.web151.js +2 -81
  233. package/dist/web/index.web152.js +4 -18
  234. package/dist/web/index.web153.js +28 -3
  235. package/dist/web/index.web154.js +7 -15
  236. package/dist/web/index.web155.js +3 -4
  237. package/dist/web/index.web156.js +19 -5
  238. package/dist/web/index.web157.js +8 -19
  239. package/dist/web/index.web158.js +7 -61
  240. package/dist/web/index.web159.js +79 -16
  241. package/dist/web/index.web160.js +24 -19
  242. package/dist/web/index.web161.js +3 -8
  243. package/dist/web/index.web162.js +6 -33
  244. package/dist/web/index.web163.js +4 -7
  245. package/dist/web/index.web164.js +14 -20
  246. package/dist/web/index.web165.js +18 -53
  247. package/dist/web/index.web166.js +61 -10
  248. package/dist/web/index.web167.js +18 -2
  249. package/dist/web/index.web168.js +23 -44
  250. package/dist/web/index.web169.js +8 -13
  251. package/dist/web/index.web170.js +41 -11
  252. package/dist/web/index.web171.js +7 -11
  253. package/dist/web/index.web172.js +20 -4
  254. package/dist/web/index.web191.js +1 -1
  255. package/dist/web/index.web193.js +1 -1
  256. package/dist/web/index.web194.js +2 -2
  257. package/dist/web/index.web202.js +2 -2
  258. package/dist/web/index.web21.js +16 -5
  259. package/dist/web/index.web219.js +102 -19
  260. package/dist/web/index.web220.js +79 -10
  261. package/dist/web/index.web221.js +79 -20
  262. package/dist/web/index.web222.js +20 -93
  263. package/dist/web/index.web223.js +9 -20
  264. package/dist/web/index.web224.js +16 -114
  265. package/dist/web/index.web225.js +89 -99
  266. package/dist/web/index.web226.js +20 -78
  267. package/dist/web/index.web227.js +118 -79
  268. package/dist/web/index.web228.js +2 -109
  269. package/dist/web/index.web229.js +109 -2
  270. package/dist/web/index.web230.js +2 -2
  271. package/dist/web/index.web237.js +1 -1
  272. package/dist/web/index.web242.js +1 -1
  273. package/dist/web/index.web244.js +1 -1
  274. package/dist/web/index.web247.js +1 -1
  275. package/dist/web/index.web248.js +1 -1
  276. package/dist/web/index.web250.js +78 -14
  277. package/dist/web/index.web251.js +14 -78
  278. package/dist/web/index.web64.js +24 -22
  279. package/dist/web/index.web65.js +13 -17
  280. package/dist/web/index.web85.js +85 -64
  281. package/dist/web/index.web9.js +1 -1
  282. package/dist/web-types/actions/createBitcoinAccount.d.ts +5 -2
  283. package/dist/web-types/actions/getCurrentUser.d.ts +18 -1
  284. package/dist/web-types/actions/signBitcoinHash.d.ts +7 -5
  285. package/dist/web-types/core.d.ts +1 -1
  286. package/dist/web-types/types.d.ts +2 -2
  287. package/dist/web-types/version.d.ts +1 -1
  288. package/package.json +3 -3
@@ -1,4 +1,111 @@
1
- var e = { exports: {} };
1
+ import { __module as x } from "./index.web230.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
+ }
2
109
  export {
3
- e as __module
110
+ O as __require
4
111
  };
@@ -1,4 +1,4 @@
1
- const o = "0.1.1";
1
+ var e = { exports: {} };
2
2
  export {
3
- o as version
3
+ e as __module
4
4
  };
@@ -1,5 +1,5 @@
1
1
  import { BaseError as f } from "./index.web134.js";
2
- import { pad as g } from "./index.web250.js";
2
+ import { pad as g } from "./index.web251.js";
3
3
  function m(t, i = {}) {
4
4
  const { signed: r, size: e } = i, o = BigInt(t);
5
5
  let n;
@@ -1,4 +1,4 @@
1
- import { JOSENotSupported as r } from "./index.web131.js";
1
+ import { JOSENotSupported as r } from "./index.web128.js";
2
2
  const S = (e, s) => {
3
3
  const a = `SHA-${e.slice(-3)}`;
4
4
  switch (e) {
@@ -1,4 +1,4 @@
1
- import { checkSigCryptoKey as i } from "./index.web251.js";
1
+ import { checkSigCryptoKey as i } from "./index.web250.js";
2
2
  import o from "./index.web245.js";
3
3
  const s = async (t, r, e) => {
4
4
  if (r instanceof Uint8Array) {
@@ -1,4 +1,4 @@
1
- import n from "./index.web169.js";
1
+ import n from "./index.web148.js";
2
2
  function r(t) {
3
3
  return n(t) && typeof t.kty == "string";
4
4
  }
@@ -1,4 +1,4 @@
1
- import { JOSENotSupported as s } from "./index.web131.js";
1
+ import { JOSENotSupported as s } from "./index.web128.js";
2
2
  function n(e) {
3
3
  let a, r;
4
4
  switch (e.kty) {
@@ -1,17 +1,81 @@
1
- import { SizeExceedsPaddingSizeError as a } from "./index.web237.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.web237.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,37 +1,39 @@
1
- import { createEndUserBtcAccount as u } from "@coinbase/cdp-api-client";
2
- import { Analytics as d } from "./index.web2.js";
1
+ import { createEndUserBtcAccount as h } from "@coinbase/cdp-api-client";
2
+ import { Analytics as p } from "./index.web2.js";
3
3
  import "./index.web3.js";
4
4
  import { toAuthStateUser as m } from "./index.web101.js";
5
- import { InternalError as l } from "./index.web88.js";
6
- import { validateUserAuthState as p } from "./index.web102.js";
7
- import { getCoreAuthManager as w, getConfig as h } from "./index.web74.js";
8
- async function U(e) {
9
- d.sendActionCallEvent({ name: "create_bitcoin_account" });
10
- const t = w(), { user: c, authState: a } = p(
5
+ import { InternalError as o } from "./index.web88.js";
6
+ import { validateUserAuthState as w } from "./index.web102.js";
7
+ import { getCoreAuthManager as b, getConfig as A } from "./index.web74.js";
8
+ async function U(r) {
9
+ p.sendActionCallEvent({ name: "create_bitcoin_account" });
10
+ const t = b(), { user: c, authState: s } = w(
11
11
  t.getUser(),
12
12
  t.getAuthState()
13
- ), i = await u(
13
+ ), n = await h(
14
14
  c.userId,
15
15
  {
16
16
  walletSecretId: await t.getWalletSecretId(),
17
- addressType: e?.addressType ?? "segwit",
18
- network: e?.network ?? "bitcoin-testnet"
17
+ addressType: r?.addressType ?? "segwit",
18
+ network: r?.network ?? "bitcoin-testnet"
19
19
  },
20
- { projectID: h().projectId },
21
- e?.idempotencyKey
22
- ), n = m(i);
20
+ { projectID: A().projectId },
21
+ r?.idempotencyKey
22
+ ), i = m(n), u = t.getAuthState() ?? s;
23
23
  await t.setAuthState({
24
- ...a,
25
- user: n
24
+ ...u,
25
+ user: i
26
26
  });
27
- const s = new Set(c.btcAccountObjects?.map((r) => r.extendedPublicKey) ?? []), o = n.btcAccountObjects?.find(
28
- (r) => !s.has(r.extendedPublicKey)
29
- );
30
- if (!o)
31
- throw new l(
27
+ const d = new Set(c.btcAccountObjects?.map((a) => a.xpubHash) ?? []), e = (n.btcAccountObjects ?? []).find((a) => !d.has(a.xpubHash));
28
+ if (!e)
29
+ throw new o(
32
30
  "Bitcoin account was not created. Check the network log for more details."
33
31
  );
34
- return o;
32
+ if (!e.xpub)
33
+ throw new o(
34
+ "Bitcoin account was created but the server did not return its extended public key (xpub)."
35
+ );
36
+ return { ...e, xpub: e.xpub };
35
37
  }
36
38
  export {
37
39
  U as createBitcoinAccount
@@ -1,10 +1,10 @@
1
- import { signBtcHashWithEndUserAccount as i } from "@coinbase/cdp-api-client";
2
- import { Analytics as c } from "./index.web2.js";
1
+ import { signBtcHashWithEndUserAccount as c } from "@coinbase/cdp-api-client";
2
+ import { Analytics as i } from "./index.web2.js";
3
3
  import "./index.web3.js";
4
- import { withAuth as h } from "./index.web97.js";
5
- import { getConfig as o, getCoreAuthManager as d } from "./index.web74.js";
4
+ import { withAuth as s } from "./index.web97.js";
5
+ import { getConfig as e, getCoreAuthManager as o } from "./index.web74.js";
6
6
  import "viem";
7
- import { withMfa as m } from "./index.web82.js";
7
+ import { withMfa as h } from "./index.web82.js";
8
8
  import "jose";
9
9
  import "./index.web98.js";
10
10
  import "./index.web99.js";
@@ -12,26 +12,22 @@ import "@solana/web3.js";
12
12
  import "bs58";
13
13
  import "./index.web93.js";
14
14
  const j = async (t) => {
15
- if (c.sendActionCallEvent({ name: "sign_bitcoin_hash" }), !/^[0-9a-fA-F]{64}$/.test(t.hash))
15
+ if (i.sendActionCallEvent({ name: "sign_bitcoin_hash" }), !/^[0-9a-fA-F]{64}$/.test(t.hash))
16
16
  throw new Error("hash must be a 64-character hex string with no 0x prefix");
17
- return o().useMock ? { signature: "3045022100" + "a".repeat(64) + "0220" + "b".repeat(64) } : m(
18
- () => h(t, d(), async ({ user: e, walletSecretId: a }) => {
19
- const r = t.network ?? "bitcoin-testnet", n = t.addressType ?? "segwit";
20
- if (!e.btcAccountObjects?.find(
21
- (s) => s.network === r && s.addressType === n
22
- ))
17
+ return e().useMock ? { signature: "3045022100" + "a".repeat(64) + "0220" + "b".repeat(64) } : h(
18
+ () => s(t, o(), async ({ user: r, walletSecretId: a }) => {
19
+ if (!r.btcAccountObjects?.find((n) => n.xpubHash === t.xpubHash))
23
20
  throw new Error("Bitcoin account not found");
24
- return { signature: (await i(
25
- e.userId,
21
+ return { signature: (await c(
22
+ r.userId,
26
23
  {
27
24
  walletSecretId: a,
28
- addressType: n,
29
- network: r,
25
+ xpubHash: t.xpubHash,
30
26
  change: t.change,
31
27
  addressIndex: t.addressIndex,
32
28
  hash: t.hash
33
29
  },
34
- { projectID: o().projectId },
30
+ { projectID: e().projectId },
35
31
  t.idempotencyKey
36
32
  )).signature };
37
33
  })