@coinbase/cdp-core 0.0.117 → 0.0.119
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.
- package/dist/esm/index.web10.js +49 -44
- package/dist/esm/index.web107.js +3 -3
- package/dist/esm/index.web110.js +2 -2
- package/dist/esm/index.web114.js +3 -3
- package/dist/esm/index.web126.js +12 -12
- package/dist/esm/index.web127.js +13 -373
- package/dist/esm/index.web128.js +25 -2
- package/dist/esm/index.web129.js +48 -63
- package/dist/esm/index.web130.js +189 -177
- package/dist/esm/index.web131.js +2 -31
- package/dist/esm/index.web132.js +65 -28
- package/dist/esm/index.web133.js +360 -12
- package/dist/esm/index.web134.js +28 -22
- package/dist/esm/index.web135.js +28 -50
- package/dist/esm/index.web138.js +1 -1
- package/dist/esm/index.web139.js +1 -1
- package/dist/esm/index.web140.js +12 -4
- package/dist/esm/index.web141.js +11 -54
- package/dist/esm/index.web142.js +54 -10
- package/dist/esm/index.web143.js +11 -2
- package/dist/esm/index.web144.js +2 -45
- package/dist/esm/index.web145.js +44 -13
- package/dist/esm/index.web146.js +13 -12
- package/dist/esm/index.web147.js +4 -11
- package/dist/esm/index.web148.js +1 -1
- package/dist/esm/index.web150.js +13 -14
- package/dist/esm/index.web151.js +54 -27
- package/dist/esm/index.web152.js +6 -7
- package/dist/esm/index.web153.js +21 -3
- package/dist/esm/index.web154.js +16 -27
- package/dist/esm/index.web155.js +45 -8
- package/dist/esm/index.web156.js +3 -7
- package/dist/esm/index.web157.js +3 -80
- package/dist/esm/index.web158.js +32 -26
- package/dist/esm/index.web159.js +12 -3
- package/dist/esm/index.web160.js +4 -15
- package/dist/esm/index.web161.js +28 -4
- package/dist/esm/index.web162.js +6 -14
- package/dist/esm/index.web163.js +31 -18
- package/dist/esm/index.web164.js +9 -58
- package/dist/esm/index.web165.js +55 -17
- package/dist/esm/index.web166.js +41 -22
- package/dist/esm/index.web167.js +127 -8
- package/dist/esm/index.web168.js +102 -40
- package/dist/esm/index.web169.js +6 -7
- package/dist/esm/index.web170.js +3 -21
- package/dist/esm/index.web171.js +79 -2
- package/dist/esm/index.web172.js +2 -2
- package/dist/esm/index.web173.js +2 -14
- package/dist/esm/index.web174.js +33 -51
- package/dist/esm/index.web175.js +6 -6
- package/dist/esm/index.web176.js +32 -19
- package/dist/esm/index.web177.js +14 -17
- package/dist/esm/index.web178.js +30 -41
- package/dist/esm/index.web179.js +18 -3
- package/dist/esm/index.web180.js +8 -3
- package/dist/esm/index.web181.js +9 -33
- package/dist/esm/index.web182.js +11 -12
- package/dist/esm/index.web183.js +13 -4
- package/dist/esm/index.web184.js +5 -28
- package/dist/esm/index.web185.js +5 -7
- package/dist/esm/index.web186.js +10 -32
- package/dist/esm/index.web187.js +2 -13
- package/dist/esm/index.web188.js +2 -56
- package/dist/esm/index.web189.js +14 -42
- package/dist/esm/index.web190.js +27 -126
- package/dist/esm/index.web191.js +7 -104
- package/dist/esm/index.web192.js +3 -6
- package/dist/esm/index.web193.js +29 -3
- package/dist/esm/index.web194.js +8 -78
- package/dist/esm/index.web195.js +8 -2
- package/dist/esm/index.web196.js +81 -2
- package/dist/esm/index.web197.js +26 -35
- package/dist/esm/index.web198.js +3 -6
- package/dist/esm/index.web199.js +15 -34
- package/dist/esm/index.web200.js +4 -14
- package/dist/esm/index.web201.js +14 -34
- package/dist/esm/index.web202.js +18 -17
- package/dist/esm/index.web203.js +61 -8
- package/dist/esm/index.web204.js +17 -10
- package/dist/esm/index.web205.js +23 -11
- package/dist/esm/index.web206.js +8 -13
- package/dist/esm/index.web207.js +42 -5
- package/dist/esm/index.web208.js +8 -5
- package/dist/esm/index.web209.js +20 -10
- package/dist/esm/index.web21.js +16 -5
- package/dist/esm/index.web210.js +104 -2
- package/dist/esm/index.web211.js +77 -107
- package/dist/esm/index.web212.js +79 -2
- package/dist/esm/index.web213.js +1 -1
- package/dist/esm/index.web217.js +1 -1
- package/dist/esm/index.web219.js +106 -101
- package/dist/esm/index.web220.js +2 -79
- package/dist/esm/index.web221.js +2 -79
- package/dist/esm/index.web222.js +20 -7
- package/dist/esm/index.web223.js +2 -2
- package/dist/esm/index.web224.js +19 -360
- package/dist/esm/index.web225.js +32 -852
- package/dist/esm/index.web226.js +6 -38
- package/dist/esm/index.web227.js +39 -2
- package/dist/esm/index.web228.js +2 -70
- package/dist/esm/index.web229.js +66 -31
- package/dist/esm/index.web230.js +33 -13
- package/dist/esm/index.web231.js +12 -18
- package/dist/esm/index.web232.js +8 -2
- package/dist/esm/index.web233.js +2 -20
- package/dist/esm/index.web234.js +356 -28
- package/dist/esm/index.web235.js +852 -6
- package/dist/esm/index.web236.js +1 -1
- package/dist/esm/index.web239.js +1 -1
- package/dist/esm/index.web244.js +1 -1
- package/dist/esm/index.web245.js +1 -1
- package/dist/esm/index.web246.js +2 -2
- package/dist/esm/index.web247.js +2 -2
- package/dist/esm/index.web248.js +2 -2
- package/dist/esm/index.web3.js +1 -1
- package/dist/esm/index.web64.js +24 -22
- package/dist/esm/index.web65.js +13 -17
- package/dist/esm/index.web8.js +26 -12
- package/dist/esm/index.web9.js +1 -1
- package/dist/native/index.native11.js +1 -1
- package/dist/native/index.native112.js +2 -2
- package/dist/native/index.native116.js +3 -3
- package/dist/native/index.native12.js +50 -45
- package/dist/native/index.native129.js +371 -100
- package/dist/native/index.native130.js +2 -379
- package/dist/native/index.native131.js +65 -28
- package/dist/native/index.native132.js +364 -28
- package/dist/native/index.native133.js +108 -2
- package/dist/native/index.native134.js +28 -65
- package/dist/native/index.native135.js +28 -364
- package/dist/native/index.native136.js +1 -1
- package/dist/native/index.native138.js +4 -4
- package/dist/native/index.native141.js +1 -1
- package/dist/native/index.native142.js +1 -1
- package/dist/native/index.native143.js +1 -1
- package/dist/native/index.native145.js +5 -2
- package/dist/native/index.native146.js +13 -2
- package/dist/native/index.native147.js +11 -4
- package/dist/native/index.native148.js +53 -11
- package/dist/native/index.native149.js +10 -11
- package/dist/native/index.native150.js +2 -55
- package/dist/native/index.native151.js +45 -11
- package/dist/native/index.native152.js +14 -2
- package/dist/native/index.native153.js +2 -45
- package/dist/native/index.native154.js +2 -14
- package/dist/native/index.native162.js +1 -1
- package/dist/native/index.native174.js +1 -1
- package/dist/native/index.native199.js +2 -2
- package/dist/native/index.native207.js +2 -2
- package/dist/native/index.native221.js +1 -1
- package/dist/native/index.native23.js +16 -5
- package/dist/native/index.native241.js +46 -3
- package/dist/native/index.native242.js +3 -46
- package/dist/native/index.native249.js +1 -1
- package/dist/native/index.native252.js +1 -1
- package/dist/native/index.native255.js +78 -14
- package/dist/native/index.native256.js +14 -78
- package/dist/native/index.native66.js +24 -22
- package/dist/native/index.native67.js +15 -19
- package/dist/native/index.native8.js +16 -3
- package/dist/native/index.native86.js +1 -1
- package/dist/native/index.native9.js +21 -8
- package/dist/native-types/actions/createBitcoinAccount.d.ts +5 -2
- package/dist/native-types/actions/getCurrentUser.d.ts +18 -1
- package/dist/native-types/actions/signBitcoinHash.d.ts +7 -5
- package/dist/native-types/core.d.ts +1 -1
- package/dist/native-types/platform/types.d.ts +25 -0
- package/dist/native-types/types.d.ts +2 -2
- package/dist/native-types/version.d.ts +1 -1
- package/dist/types/actions/createBitcoinAccount.d.ts +5 -2
- package/dist/types/actions/getCurrentUser.d.ts +18 -1
- package/dist/types/actions/signBitcoinHash.d.ts +7 -5
- package/dist/types/core.d.ts +1 -1
- package/dist/types/platform/types.d.ts +25 -0
- package/dist/types/types.d.ts +2 -2
- package/dist/types/version.d.ts +1 -1
- package/dist/web/index.web10.js +49 -44
- package/dist/web/index.web107.js +3 -3
- package/dist/web/index.web110.js +2 -2
- package/dist/web/index.web114.js +3 -3
- package/dist/web/index.web126.js +12 -12
- package/dist/web/index.web127.js +13 -373
- package/dist/web/index.web128.js +25 -2
- package/dist/web/index.web129.js +48 -63
- package/dist/web/index.web130.js +189 -177
- package/dist/web/index.web131.js +2 -31
- package/dist/web/index.web132.js +65 -28
- package/dist/web/index.web133.js +360 -12
- package/dist/web/index.web134.js +28 -22
- package/dist/web/index.web135.js +28 -50
- package/dist/web/index.web138.js +1 -1
- package/dist/web/index.web139.js +1 -1
- package/dist/web/index.web140.js +12 -4
- package/dist/web/index.web141.js +11 -54
- package/dist/web/index.web142.js +54 -10
- package/dist/web/index.web143.js +11 -2
- package/dist/web/index.web144.js +2 -45
- package/dist/web/index.web145.js +44 -13
- package/dist/web/index.web146.js +13 -12
- package/dist/web/index.web147.js +4 -11
- package/dist/web/index.web148.js +1 -1
- package/dist/web/index.web150.js +13 -14
- package/dist/web/index.web151.js +54 -27
- package/dist/web/index.web152.js +6 -7
- package/dist/web/index.web153.js +21 -3
- package/dist/web/index.web154.js +16 -27
- package/dist/web/index.web155.js +45 -8
- package/dist/web/index.web156.js +3 -7
- package/dist/web/index.web157.js +3 -80
- package/dist/web/index.web158.js +32 -26
- package/dist/web/index.web159.js +12 -3
- package/dist/web/index.web160.js +4 -15
- package/dist/web/index.web161.js +28 -4
- package/dist/web/index.web162.js +6 -14
- package/dist/web/index.web163.js +31 -18
- package/dist/web/index.web164.js +9 -58
- package/dist/web/index.web165.js +55 -17
- package/dist/web/index.web166.js +41 -22
- package/dist/web/index.web167.js +127 -8
- package/dist/web/index.web168.js +102 -40
- package/dist/web/index.web169.js +6 -7
- package/dist/web/index.web170.js +3 -21
- package/dist/web/index.web171.js +79 -2
- package/dist/web/index.web172.js +2 -2
- package/dist/web/index.web173.js +2 -14
- package/dist/web/index.web174.js +33 -51
- package/dist/web/index.web175.js +6 -6
- package/dist/web/index.web176.js +32 -19
- package/dist/web/index.web177.js +14 -17
- package/dist/web/index.web178.js +30 -41
- package/dist/web/index.web179.js +18 -3
- package/dist/web/index.web180.js +8 -3
- package/dist/web/index.web181.js +9 -33
- package/dist/web/index.web182.js +11 -12
- package/dist/web/index.web183.js +13 -4
- package/dist/web/index.web184.js +5 -28
- package/dist/web/index.web185.js +5 -7
- package/dist/web/index.web186.js +10 -32
- package/dist/web/index.web187.js +2 -13
- package/dist/web/index.web188.js +2 -56
- package/dist/web/index.web189.js +14 -42
- package/dist/web/index.web190.js +27 -126
- package/dist/web/index.web191.js +7 -104
- package/dist/web/index.web192.js +3 -6
- package/dist/web/index.web193.js +29 -3
- package/dist/web/index.web194.js +8 -78
- package/dist/web/index.web195.js +8 -2
- package/dist/web/index.web196.js +81 -2
- package/dist/web/index.web197.js +26 -35
- package/dist/web/index.web198.js +3 -6
- package/dist/web/index.web199.js +15 -34
- package/dist/web/index.web200.js +4 -14
- package/dist/web/index.web201.js +14 -34
- package/dist/web/index.web202.js +18 -17
- package/dist/web/index.web203.js +61 -8
- package/dist/web/index.web204.js +17 -10
- package/dist/web/index.web205.js +23 -11
- package/dist/web/index.web206.js +8 -13
- package/dist/web/index.web207.js +42 -5
- package/dist/web/index.web208.js +8 -5
- package/dist/web/index.web209.js +20 -10
- package/dist/web/index.web21.js +16 -5
- package/dist/web/index.web210.js +104 -2
- package/dist/web/index.web211.js +77 -107
- package/dist/web/index.web212.js +79 -2
- package/dist/web/index.web213.js +1 -1
- package/dist/web/index.web217.js +1 -1
- package/dist/web/index.web219.js +106 -101
- package/dist/web/index.web220.js +2 -79
- package/dist/web/index.web221.js +2 -79
- package/dist/web/index.web222.js +20 -7
- package/dist/web/index.web223.js +2 -2
- package/dist/web/index.web224.js +19 -360
- package/dist/web/index.web225.js +32 -852
- package/dist/web/index.web226.js +6 -38
- package/dist/web/index.web227.js +39 -2
- package/dist/web/index.web228.js +2 -70
- package/dist/web/index.web229.js +66 -31
- package/dist/web/index.web230.js +33 -13
- package/dist/web/index.web231.js +12 -18
- package/dist/web/index.web232.js +8 -2
- package/dist/web/index.web233.js +2 -20
- package/dist/web/index.web234.js +356 -28
- package/dist/web/index.web235.js +852 -6
- package/dist/web/index.web236.js +1 -1
- package/dist/web/index.web239.js +1 -1
- package/dist/web/index.web244.js +1 -1
- package/dist/web/index.web245.js +1 -1
- package/dist/web/index.web246.js +2 -2
- package/dist/web/index.web247.js +2 -2
- package/dist/web/index.web248.js +2 -2
- package/dist/web/index.web3.js +1 -1
- package/dist/web/index.web64.js +24 -22
- package/dist/web/index.web65.js +13 -17
- package/dist/web/index.web8.js +26 -12
- package/dist/web/index.web9.js +1 -1
- package/dist/web-types/actions/createBitcoinAccount.d.ts +5 -2
- package/dist/web-types/actions/getCurrentUser.d.ts +18 -1
- package/dist/web-types/actions/signBitcoinHash.d.ts +7 -5
- package/dist/web-types/core.d.ts +1 -1
- package/dist/web-types/platform/types.d.ts +25 -0
- package/dist/web-types/types.d.ts +2 -2
- package/dist/web-types/version.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,13 +1,47 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
const o = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i, t = (c) => {
|
|
2
|
+
const s = o.exec(c);
|
|
3
|
+
if (!s || s[4] && s[1])
|
|
4
|
+
throw new TypeError("Invalid time period format");
|
|
5
|
+
const a = parseFloat(s[2]), r = s[3].toLowerCase();
|
|
6
|
+
let e;
|
|
7
|
+
switch (r) {
|
|
8
|
+
case "sec":
|
|
9
|
+
case "secs":
|
|
10
|
+
case "second":
|
|
11
|
+
case "seconds":
|
|
12
|
+
case "s":
|
|
13
|
+
e = Math.round(a);
|
|
14
|
+
break;
|
|
15
|
+
case "minute":
|
|
16
|
+
case "minutes":
|
|
17
|
+
case "min":
|
|
18
|
+
case "mins":
|
|
19
|
+
case "m":
|
|
20
|
+
e = Math.round(a * 60);
|
|
21
|
+
break;
|
|
22
|
+
case "hour":
|
|
23
|
+
case "hours":
|
|
24
|
+
case "hr":
|
|
25
|
+
case "hrs":
|
|
26
|
+
case "h":
|
|
27
|
+
e = Math.round(a * 3600);
|
|
28
|
+
break;
|
|
29
|
+
case "day":
|
|
30
|
+
case "days":
|
|
31
|
+
case "d":
|
|
32
|
+
e = Math.round(a * 86400);
|
|
33
|
+
break;
|
|
34
|
+
case "week":
|
|
35
|
+
case "weeks":
|
|
36
|
+
case "w":
|
|
37
|
+
e = Math.round(a * 604800);
|
|
38
|
+
break;
|
|
39
|
+
default:
|
|
40
|
+
e = Math.round(a * 31557600);
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
return s[1] === "-" || s[4] === "ago" ? -e : e;
|
|
44
|
+
};
|
|
9
45
|
export {
|
|
10
|
-
|
|
11
|
-
s as decoder,
|
|
12
|
-
d as encoder
|
|
46
|
+
t as default
|
|
13
47
|
};
|
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
function o(t) {
|
|
2
|
+
return typeof t == "object" && t !== null;
|
|
3
|
+
}
|
|
4
|
+
const r = (t) => {
|
|
5
|
+
if (!o(t) || Object.prototype.toString.call(t) !== "[object Object]")
|
|
6
|
+
return !1;
|
|
7
|
+
if (Object.getPrototypeOf(t) === null)
|
|
8
|
+
return !0;
|
|
9
|
+
let e = t;
|
|
10
|
+
for (; Object.getPrototypeOf(e) !== null; )
|
|
11
|
+
e = Object.getPrototypeOf(e);
|
|
12
|
+
return Object.getPrototypeOf(t) === e;
|
|
13
|
+
};
|
|
2
14
|
export {
|
|
3
|
-
|
|
15
|
+
r as default
|
|
4
16
|
};
|
|
@@ -1,47 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
const s = o.exec(c);
|
|
3
|
-
if (!s || s[4] && s[1])
|
|
4
|
-
throw new TypeError("Invalid time period format");
|
|
5
|
-
const a = parseFloat(s[2]), r = s[3].toLowerCase();
|
|
6
|
-
let e;
|
|
7
|
-
switch (r) {
|
|
8
|
-
case "sec":
|
|
9
|
-
case "secs":
|
|
10
|
-
case "second":
|
|
11
|
-
case "seconds":
|
|
12
|
-
case "s":
|
|
13
|
-
e = Math.round(a);
|
|
14
|
-
break;
|
|
15
|
-
case "minute":
|
|
16
|
-
case "minutes":
|
|
17
|
-
case "min":
|
|
18
|
-
case "mins":
|
|
19
|
-
case "m":
|
|
20
|
-
e = Math.round(a * 60);
|
|
21
|
-
break;
|
|
22
|
-
case "hour":
|
|
23
|
-
case "hours":
|
|
24
|
-
case "hr":
|
|
25
|
-
case "hrs":
|
|
26
|
-
case "h":
|
|
27
|
-
e = Math.round(a * 3600);
|
|
28
|
-
break;
|
|
29
|
-
case "day":
|
|
30
|
-
case "days":
|
|
31
|
-
case "d":
|
|
32
|
-
e = Math.round(a * 86400);
|
|
33
|
-
break;
|
|
34
|
-
case "week":
|
|
35
|
-
case "weeks":
|
|
36
|
-
case "w":
|
|
37
|
-
e = Math.round(a * 604800);
|
|
38
|
-
break;
|
|
39
|
-
default:
|
|
40
|
-
e = Math.round(a * 31557600);
|
|
41
|
-
break;
|
|
42
|
-
}
|
|
43
|
-
return s[1] === "-" || s[4] === "ago" ? -e : e;
|
|
44
|
-
};
|
|
1
|
+
var s = {};
|
|
45
2
|
export {
|
|
46
|
-
|
|
3
|
+
s as __exports
|
|
47
4
|
};
|
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
return typeof t == "object" && t !== null;
|
|
3
|
-
}
|
|
4
|
-
const r = (t) => {
|
|
5
|
-
if (!o(t) || Object.prototype.toString.call(t) !== "[object Object]")
|
|
6
|
-
return !1;
|
|
7
|
-
if (Object.getPrototypeOf(t) === null)
|
|
8
|
-
return !0;
|
|
9
|
-
let e = t;
|
|
10
|
-
for (; Object.getPrototypeOf(e) !== null; )
|
|
11
|
-
e = Object.getPrototypeOf(e);
|
|
12
|
-
return Object.getPrototypeOf(t) === e;
|
|
13
|
-
};
|
|
1
|
+
var e = {};
|
|
14
2
|
export {
|
|
15
|
-
|
|
3
|
+
e as __exports
|
|
16
4
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { versionedHashVersionKzg as c } from "./index.native200.js";
|
|
2
2
|
import { maxUint256 as m } from "./index.native201.js";
|
|
3
|
-
import { InvalidAddressError as s } from "./index.
|
|
3
|
+
import { InvalidAddressError as s } from "./index.native146.js";
|
|
4
4
|
import { BaseError as h } from "./index.native193.js";
|
|
5
5
|
import { EmptyBlobError as P, InvalidVersionedHashSizeError as p, InvalidVersionedHashVersionError as x } from "./index.native202.js";
|
|
6
6
|
import { InvalidChainIdError as n } from "./index.native203.js";
|
|
7
7
|
import { FeeCapTooHighError as w, TipAboveFeeCapError as E } from "./index.native204.js";
|
|
8
|
-
import { isAddress as f } from "./index.
|
|
8
|
+
import { isAddress as f } from "./index.native147.js";
|
|
9
9
|
import { size as F } from "./index.native188.js";
|
|
10
10
|
import { slice as I } from "./index.native189.js";
|
|
11
11
|
import { hexToNumber as G } from "./index.native191.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { InvalidAddressError as s } from "./index.
|
|
1
|
+
import { InvalidAddressError as s } from "./index.native146.js";
|
|
2
2
|
import { InvalidStorageKeySizeError as l } from "./index.native206.js";
|
|
3
|
-
import { isAddress as f } from "./index.
|
|
3
|
+
import { isAddress as f } from "./index.native147.js";
|
|
4
4
|
function a(r) {
|
|
5
5
|
if (!r || r.length === 0)
|
|
6
6
|
return [];
|
|
@@ -1,9 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getAuthenticatedEndUser as n } from "@coinbase/cdp-api-client";
|
|
2
|
+
import { Analytics as o } from "./index.native2.js";
|
|
2
3
|
import "./index.native3.js";
|
|
3
|
-
import {
|
|
4
|
-
import "
|
|
4
|
+
import { toAuthStateUser as s } from "./index.native103.js";
|
|
5
|
+
import { getCoreAuthManager as u, getConfig as a } from "./index.native76.js";
|
|
5
6
|
import "viem";
|
|
6
|
-
const
|
|
7
|
+
const h = async (e) => {
|
|
8
|
+
o.sendActionCallEvent({ name: "get_current_user" });
|
|
9
|
+
const t = u().getUser();
|
|
10
|
+
if (!e?.includeBtcXpubs || !t)
|
|
11
|
+
return t;
|
|
12
|
+
const r = await n(t.userId, {
|
|
13
|
+
projectID: a().projectId,
|
|
14
|
+
includeBtcXpubs: !0
|
|
15
|
+
});
|
|
16
|
+
return s(r);
|
|
17
|
+
};
|
|
7
18
|
export {
|
|
8
|
-
|
|
19
|
+
h as getCurrentUser
|
|
9
20
|
};
|
|
@@ -1,6 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { BaseError as f } from "./index.native131.js";
|
|
2
|
+
import { pad as g } from "./index.native256.js";
|
|
3
|
+
function m(t, i = {}) {
|
|
4
|
+
const { signed: r, size: e } = i, o = BigInt(t);
|
|
5
|
+
let n;
|
|
6
|
+
e ? r ? n = (1n << BigInt(e) * 8n - 1n) - 1n : n = 2n ** (BigInt(e) * 8n) - 1n : typeof t == "number" && (n = BigInt(Number.MAX_SAFE_INTEGER));
|
|
7
|
+
const u = typeof n == "bigint" && r ? -n - 1n : 0;
|
|
8
|
+
if (n && o > n || o < u) {
|
|
9
|
+
const s = typeof t == "bigint" ? "n" : "";
|
|
10
|
+
throw new d({
|
|
11
|
+
max: n ? `${n}${s}` : void 0,
|
|
12
|
+
min: `${u}${s}`,
|
|
13
|
+
signed: r,
|
|
14
|
+
size: e,
|
|
15
|
+
value: `${t}${s}`
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
const a = `0x${(r && o < 0 ? (1n << BigInt(e * 8)) + BigInt(o) : o).toString(16)}`;
|
|
19
|
+
return e ? c(a, e) : a;
|
|
20
|
+
}
|
|
21
|
+
function c(t, i) {
|
|
22
|
+
return g(t, { dir: "left", size: i });
|
|
23
|
+
}
|
|
24
|
+
class d extends f {
|
|
25
|
+
constructor({ max: i, min: r, signed: e, size: o, value: n }) {
|
|
26
|
+
super(`Number \`${n}\` is not in safe${o ? ` ${o * 8}-bit` : ""}${e ? " signed" : " unsigned"} integer range ${i ? `(\`${r}\` to \`${i}\`)` : `(above \`${r}\`)`}`), Object.defineProperty(this, "name", {
|
|
27
|
+
enumerable: !0,
|
|
28
|
+
configurable: !0,
|
|
29
|
+
writable: !0,
|
|
30
|
+
value: "Hex.IntegerOutOfRangeError"
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
class p extends f {
|
|
35
|
+
constructor({ size: i, targetSize: r, type: e }) {
|
|
36
|
+
super(`${e.charAt(0).toUpperCase()}${e.slice(1).toLowerCase()} size (\`${i}\`) exceeds padding size (\`${r}\`).`), Object.defineProperty(this, "name", {
|
|
37
|
+
enumerable: !0,
|
|
38
|
+
configurable: !0,
|
|
39
|
+
writable: !0,
|
|
40
|
+
value: "Hex.SizeExceedsPaddingSizeError"
|
|
41
|
+
});
|
|
42
|
+
}
|
|
3
43
|
}
|
|
4
44
|
export {
|
|
5
|
-
|
|
45
|
+
d as IntegerOutOfRangeError,
|
|
46
|
+
p as SizeExceedsPaddingSizeError,
|
|
47
|
+
m as fromNumber,
|
|
48
|
+
c as padLeft
|
|
6
49
|
};
|
|
@@ -1,49 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function m(t, i = {}) {
|
|
4
|
-
const { signed: r, size: e } = i, o = BigInt(t);
|
|
5
|
-
let n;
|
|
6
|
-
e ? r ? n = (1n << BigInt(e) * 8n - 1n) - 1n : n = 2n ** (BigInt(e) * 8n) - 1n : typeof t == "number" && (n = BigInt(Number.MAX_SAFE_INTEGER));
|
|
7
|
-
const u = typeof n == "bigint" && r ? -n - 1n : 0;
|
|
8
|
-
if (n && o > n || o < u) {
|
|
9
|
-
const s = typeof t == "bigint" ? "n" : "";
|
|
10
|
-
throw new d({
|
|
11
|
-
max: n ? `${n}${s}` : void 0,
|
|
12
|
-
min: `${u}${s}`,
|
|
13
|
-
signed: r,
|
|
14
|
-
size: e,
|
|
15
|
-
value: `${t}${s}`
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
const a = `0x${(r && o < 0 ? (1n << BigInt(e * 8)) + BigInt(o) : o).toString(16)}`;
|
|
19
|
-
return e ? c(a, e) : a;
|
|
20
|
-
}
|
|
21
|
-
function c(t, i) {
|
|
22
|
-
return g(t, { dir: "left", size: i });
|
|
23
|
-
}
|
|
24
|
-
class d extends f {
|
|
25
|
-
constructor({ max: i, min: r, signed: e, size: o, value: n }) {
|
|
26
|
-
super(`Number \`${n}\` is not in safe${o ? ` ${o * 8}-bit` : ""}${e ? " signed" : " unsigned"} integer range ${i ? `(\`${r}\` to \`${i}\`)` : `(above \`${r}\`)`}`), Object.defineProperty(this, "name", {
|
|
27
|
-
enumerable: !0,
|
|
28
|
-
configurable: !0,
|
|
29
|
-
writable: !0,
|
|
30
|
-
value: "Hex.IntegerOutOfRangeError"
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
class p extends f {
|
|
35
|
-
constructor({ size: i, targetSize: r, type: e }) {
|
|
36
|
-
super(`${e.charAt(0).toUpperCase()}${e.slice(1).toLowerCase()} size (\`${i}\`) exceeds padding size (\`${r}\`).`), Object.defineProperty(this, "name", {
|
|
37
|
-
enumerable: !0,
|
|
38
|
-
configurable: !0,
|
|
39
|
-
writable: !0,
|
|
40
|
-
value: "Hex.SizeExceedsPaddingSizeError"
|
|
41
|
-
});
|
|
42
|
-
}
|
|
1
|
+
function e(t) {
|
|
2
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
43
3
|
}
|
|
44
4
|
export {
|
|
45
|
-
|
|
46
|
-
p as SizeExceedsPaddingSizeError,
|
|
47
|
-
m as fromNumber,
|
|
48
|
-
c as padLeft
|
|
5
|
+
e as getDefaultExportFromCjs
|
|
49
6
|
};
|
|
@@ -1,17 +1,81 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
80
|
+
u as checkSigCryptoKey
|
|
17
81
|
};
|
|
@@ -1,81 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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.native241.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
|
-
|
|
16
|
+
o as pad
|
|
81
17
|
};
|
|
@@ -1,37 +1,39 @@
|
|
|
1
|
-
import { createEndUserBtcAccount as
|
|
2
|
-
import { Analytics as
|
|
1
|
+
import { createEndUserBtcAccount as h } from "@coinbase/cdp-api-client";
|
|
2
|
+
import { Analytics as p } from "./index.native2.js";
|
|
3
3
|
import "./index.native3.js";
|
|
4
4
|
import { toAuthStateUser as m } from "./index.native103.js";
|
|
5
|
-
import { InternalError as
|
|
6
|
-
import { validateUserAuthState as
|
|
7
|
-
import { getCoreAuthManager as
|
|
8
|
-
async function U(
|
|
9
|
-
|
|
10
|
-
const t =
|
|
5
|
+
import { InternalError as o } from "./index.native90.js";
|
|
6
|
+
import { validateUserAuthState as w } from "./index.native104.js";
|
|
7
|
+
import { getCoreAuthManager as b, getConfig as A } from "./index.native76.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
|
-
),
|
|
13
|
+
), n = await h(
|
|
14
14
|
c.userId,
|
|
15
15
|
{
|
|
16
16
|
walletSecretId: await t.getWalletSecretId(),
|
|
17
|
-
addressType:
|
|
18
|
-
network:
|
|
17
|
+
addressType: r?.addressType ?? "segwit",
|
|
18
|
+
network: r?.network ?? "bitcoin-testnet"
|
|
19
19
|
},
|
|
20
|
-
{ projectID:
|
|
21
|
-
|
|
22
|
-
),
|
|
20
|
+
{ projectID: A().projectId },
|
|
21
|
+
r?.idempotencyKey
|
|
22
|
+
), i = m(n), u = t.getAuthState() ?? s;
|
|
23
23
|
await t.setAuthState({
|
|
24
|
-
...
|
|
25
|
-
user:
|
|
24
|
+
...u,
|
|
25
|
+
user: i
|
|
26
26
|
});
|
|
27
|
-
const
|
|
28
|
-
|
|
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
|
-
|
|
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,41 +1,37 @@
|
|
|
1
|
-
import { signBtcHashWithEndUserAccount as
|
|
2
|
-
import { Analytics as
|
|
1
|
+
import { signBtcHashWithEndUserAccount as c } from "@coinbase/cdp-api-client";
|
|
2
|
+
import { Analytics as s } from "./index.native2.js";
|
|
3
3
|
import "./index.native3.js";
|
|
4
|
-
import { withAuth as
|
|
5
|
-
import { getConfig as
|
|
4
|
+
import { withAuth as i } from "./index.native99.js";
|
|
5
|
+
import { getConfig as e, getCoreAuthManager as o } from "./index.native76.js";
|
|
6
6
|
import "viem";
|
|
7
|
-
import { withMfa as
|
|
7
|
+
import { withMfa as h } from "./index.native85.js";
|
|
8
8
|
import "jose";
|
|
9
9
|
import "./index.native100.js";
|
|
10
10
|
import "./index.native101.js";
|
|
11
11
|
import "@solana/web3.js";
|
|
12
12
|
import "bs58";
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
13
|
+
const E = async (t) => {
|
|
14
|
+
if (s.sendActionCallEvent({ name: "sign_bitcoin_hash" }), !/^[0-9a-fA-F]{64}$/.test(t.hash))
|
|
15
15
|
throw new Error("hash must be a 64-character hex string with no 0x prefix");
|
|
16
|
-
return
|
|
17
|
-
() =>
|
|
18
|
-
|
|
19
|
-
if (!e.btcAccountObjects?.find(
|
|
20
|
-
(s) => s.network === r && s.addressType === n
|
|
21
|
-
))
|
|
16
|
+
return e().useMock ? { signature: "3045022100" + "a".repeat(64) + "0220" + "b".repeat(64) } : h(
|
|
17
|
+
() => i(t, o(), async ({ user: r, walletSecretId: a }) => {
|
|
18
|
+
if (!r.btcAccountObjects?.find((n) => n.xpubHash === t.xpubHash))
|
|
22
19
|
throw new Error("Bitcoin account not found");
|
|
23
|
-
return { signature: (await
|
|
24
|
-
|
|
20
|
+
return { signature: (await c(
|
|
21
|
+
r.userId,
|
|
25
22
|
{
|
|
26
23
|
walletSecretId: a,
|
|
27
|
-
|
|
28
|
-
network: r,
|
|
24
|
+
xpubHash: t.xpubHash,
|
|
29
25
|
change: t.change,
|
|
30
26
|
addressIndex: t.addressIndex,
|
|
31
27
|
hash: t.hash
|
|
32
28
|
},
|
|
33
|
-
{ projectID:
|
|
29
|
+
{ projectID: e().projectId },
|
|
34
30
|
t.idempotencyKey
|
|
35
31
|
)).signature };
|
|
36
32
|
})
|
|
37
33
|
);
|
|
38
34
|
};
|
|
39
35
|
export {
|
|
40
|
-
|
|
36
|
+
E as signBitcoinHash
|
|
41
37
|
};
|