@coinbase/cdp-core 0.0.119 → 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.
- package/dist/esm/index.web10.js +52 -51
- package/dist/esm/index.web110.js +2 -2
- package/dist/esm/index.web114.js +2 -2
- package/dist/esm/index.web126.js +12 -12
- package/dist/esm/index.web127.js +1 -1
- package/dist/esm/index.web129.js +4 -4
- package/dist/esm/index.web130.js +3 -3
- package/dist/esm/index.web131.js +31 -2
- package/dist/esm/index.web132.js +28 -65
- package/dist/esm/index.web133.js +2 -367
- package/dist/esm/index.web134.js +65 -28
- package/dist/esm/index.web135.js +364 -28
- package/dist/esm/index.web138.js +1 -1
- package/dist/esm/index.web139.js +1 -1
- package/dist/esm/index.web140.js +5 -13
- package/dist/esm/index.web141.js +47 -11
- package/dist/esm/index.web142.js +11 -53
- package/dist/esm/index.web143.js +11 -10
- package/dist/esm/index.web144.js +55 -2
- package/dist/esm/index.web145.js +11 -45
- package/dist/esm/index.web146.js +2 -14
- package/dist/esm/index.web147.js +45 -5
- package/dist/esm/index.web148.js +14 -5
- package/dist/esm/index.web149.js +4 -47
- package/dist/esm/index.web150.js +2 -14
- package/dist/esm/index.web151.js +2 -56
- package/dist/esm/index.web152.js +14 -6
- package/dist/esm/index.web153.js +27 -20
- package/dist/esm/index.web154.js +7 -17
- package/dist/esm/index.web155.js +3 -45
- package/dist/esm/index.web156.js +28 -3
- package/dist/esm/index.web157.js +8 -3
- package/dist/esm/index.web158.js +7 -34
- package/dist/esm/index.web159.js +79 -11
- package/dist/esm/index.web160.js +28 -4
- package/dist/esm/index.web161.js +3 -28
- package/dist/esm/index.web162.js +15 -6
- package/dist/esm/index.web163.js +4 -32
- package/dist/esm/index.web164.js +14 -12
- package/dist/esm/index.web165.js +18 -54
- package/dist/esm/index.web166.js +57 -38
- package/dist/esm/index.web167.js +17 -127
- package/dist/esm/index.web168.js +21 -102
- package/dist/esm/index.web169.js +8 -6
- package/dist/esm/index.web170.js +43 -3
- package/dist/esm/index.web171.js +7 -78
- package/dist/esm/index.web172.js +21 -2
- package/dist/esm/index.web173.js +14 -2
- package/dist/esm/index.web174.js +51 -33
- package/dist/esm/index.web175.js +6 -6
- package/dist/esm/index.web176.js +19 -32
- package/dist/esm/index.web177.js +17 -14
- package/dist/esm/index.web178.js +41 -30
- package/dist/esm/index.web179.js +3 -18
- package/dist/esm/index.web180.js +3 -8
- package/dist/esm/index.web181.js +33 -9
- package/dist/esm/index.web182.js +12 -11
- package/dist/esm/index.web183.js +4 -13
- package/dist/esm/index.web184.js +28 -5
- package/dist/esm/index.web185.js +7 -5
- package/dist/esm/index.web186.js +32 -10
- package/dist/esm/index.web187.js +13 -2
- package/dist/esm/index.web188.js +56 -2
- package/dist/esm/index.web189.js +42 -14
- package/dist/esm/index.web190.js +126 -27
- package/dist/esm/index.web191.js +104 -7
- package/dist/esm/index.web192.js +6 -3
- package/dist/esm/index.web193.js +3 -29
- package/dist/esm/index.web194.js +78 -8
- package/dist/esm/index.web195.js +2 -8
- package/dist/esm/index.web196.js +2 -81
- package/dist/esm/index.web197.js +35 -26
- package/dist/esm/index.web198.js +6 -3
- package/dist/esm/index.web199.js +34 -15
- package/dist/esm/index.web2.js +2 -2
- package/dist/esm/index.web200.js +14 -4
- package/dist/esm/index.web201.js +34 -14
- package/dist/esm/index.web202.js +17 -18
- package/dist/esm/index.web203.js +8 -61
- package/dist/esm/index.web204.js +10 -17
- package/dist/esm/index.web205.js +11 -23
- package/dist/esm/index.web206.js +13 -8
- package/dist/esm/index.web207.js +5 -42
- package/dist/esm/index.web208.js +5 -8
- package/dist/esm/index.web209.js +10 -20
- package/dist/esm/index.web210.js +7 -103
- package/dist/esm/index.web211.js +2 -79
- package/dist/esm/index.web212.js +360 -78
- package/dist/esm/index.web213.js +852 -20
- package/dist/esm/index.web214.js +39 -10
- package/dist/esm/index.web215.js +2 -20
- package/dist/esm/index.web216.js +70 -94
- package/dist/esm/index.web217.js +35 -21
- package/dist/esm/index.web218.js +13 -116
- package/dist/esm/index.web219.js +101 -106
- package/dist/esm/index.web220.js +79 -2
- package/dist/esm/index.web221.js +79 -2
- package/dist/esm/index.web222.js +17 -17
- package/dist/esm/index.web223.js +10 -2
- package/dist/esm/index.web224.js +19 -19
- package/dist/esm/index.web225.js +91 -30
- package/dist/esm/index.web226.js +21 -7
- package/dist/esm/index.web227.js +117 -38
- package/dist/esm/index.web228.js +2 -2
- package/dist/esm/index.web229.js +107 -68
- package/dist/esm/index.web230.js +2 -35
- package/dist/esm/index.web231.js +18 -12
- package/dist/esm/index.web232.js +2 -8
- package/dist/esm/index.web233.js +20 -2
- package/dist/esm/index.web234.js +28 -356
- package/dist/esm/index.web235.js +6 -852
- package/dist/esm/index.web236.js +3 -46
- package/dist/esm/index.web237.js +46 -3
- package/dist/esm/index.web238.js +2 -18
- package/dist/esm/index.web239.js +2 -28
- package/dist/esm/index.web240.js +2 -8
- package/dist/esm/index.web241.js +18 -11
- package/dist/esm/index.web242.js +28 -13
- package/dist/esm/index.web243.js +8 -10
- package/dist/esm/index.web244.js +11 -17
- package/dist/esm/index.web245.js +12 -80
- package/dist/esm/index.web246.js +10 -2
- package/dist/esm/index.web247.js +17 -2
- package/dist/esm/index.web248.js +81 -2
- package/dist/esm/index.web251.js +1 -1
- package/dist/esm/index.web3.js +1 -1
- package/dist/esm/index.web85.js +85 -64
- package/dist/esm/index.web9.js +1 -1
- package/dist/native/index.native109.js +3 -3
- package/dist/native/index.native11.js +1 -1
- package/dist/native/index.native112.js +2 -2
- package/dist/native/index.native116.js +2 -2
- package/dist/native/index.native12.js +51 -50
- package/dist/native/index.native128.js +12 -12
- package/dist/native/index.native131.js +1 -1
- package/dist/native/index.native133.js +2 -2
- package/dist/native/index.native134.js +16 -28
- package/dist/native/index.native135.js +22 -28
- package/dist/native/index.native136.js +47 -13
- package/dist/native/index.native137.js +28 -22
- package/dist/native/index.native138.js +28 -50
- package/dist/native/index.native141.js +1 -1
- package/dist/native/index.native142.js +1 -1
- package/dist/native/index.native143.js +5 -5
- package/dist/native/index.native144.js +11 -46
- package/dist/native/index.native145.js +11 -4
- package/dist/native/index.native146.js +5 -13
- package/dist/native/index.native147.js +47 -11
- package/dist/native/index.native148.js +36 -55
- package/dist/native/index.native149.js +67 -10
- package/dist/native/index.native150.js +55 -2
- package/dist/native/index.native151.js +11 -45
- package/dist/native/index.native152.js +2 -14
- package/dist/native/index.native153.js +45 -2
- package/dist/native/index.native154.js +14 -2
- package/dist/native/index.native155.js +14 -36
- package/dist/native/index.native156.js +49 -61
- package/dist/native/index.native157.js +6 -13
- package/dist/native/index.native158.js +20 -26
- package/dist/native/index.native159.js +17 -7
- package/dist/native/index.native160.js +45 -3
- package/dist/native/index.native161.js +3 -27
- package/dist/native/index.native162.js +3 -8
- package/dist/native/index.native163.js +34 -7
- package/dist/native/index.native164.js +11 -78
- package/dist/native/index.native165.js +4 -27
- package/dist/native/index.native166.js +28 -3
- package/dist/native/index.native167.js +6 -14
- package/dist/native/index.native168.js +32 -4
- package/dist/native/index.native169.js +12 -13
- package/dist/native/index.native170.js +54 -18
- package/dist/native/index.native171.js +38 -56
- package/dist/native/index.native172.js +127 -17
- package/dist/native/index.native173.js +102 -21
- package/dist/native/index.native174.js +6 -8
- package/dist/native/index.native175.js +3 -42
- package/dist/native/index.native176.js +78 -7
- package/dist/native/index.native177.js +2 -21
- package/dist/native/index.native178.js +2 -14
- package/dist/native/index.native179.js +33 -51
- package/dist/native/index.native180.js +6 -6
- package/dist/native/index.native181.js +32 -19
- package/dist/native/index.native182.js +14 -17
- package/dist/native/index.native183.js +30 -41
- package/dist/native/index.native184.js +18 -3
- package/dist/native/index.native185.js +8 -3
- package/dist/native/index.native186.js +9 -33
- package/dist/native/index.native187.js +11 -12
- package/dist/native/index.native188.js +13 -4
- package/dist/native/index.native189.js +5 -28
- package/dist/native/index.native190.js +5 -7
- package/dist/native/index.native191.js +10 -32
- package/dist/native/index.native192.js +2 -13
- package/dist/native/index.native193.js +2 -56
- package/dist/native/index.native194.js +13 -42
- package/dist/native/index.native195.js +26 -126
- package/dist/native/index.native196.js +7 -104
- package/dist/native/index.native197.js +3 -6
- package/dist/native/index.native198.js +28 -3
- package/dist/native/index.native199.js +8 -78
- package/dist/native/index.native2.js +2 -2
- package/dist/native/index.native200.js +8 -2
- package/dist/native/index.native201.js +80 -2
- package/dist/native/index.native202.js +25 -35
- package/dist/native/index.native203.js +3 -6
- package/dist/native/index.native204.js +14 -34
- package/dist/native/index.native205.js +4 -14
- package/dist/native/index.native206.js +13 -34
- package/dist/native/index.native207.js +18 -17
- package/dist/native/index.native208.js +60 -8
- package/dist/native/index.native209.js +17 -10
- package/dist/native/index.native210.js +23 -11
- package/dist/native/index.native211.js +8 -13
- package/dist/native/index.native212.js +41 -5
- package/dist/native/index.native213.js +8 -5
- package/dist/native/index.native214.js +20 -10
- package/dist/native/index.native221.js +1 -1
- package/dist/native/index.native225.js +1 -1
- package/dist/native/index.native229.js +1 -1
- package/dist/native/index.native234.js +1 -1
- package/dist/native/index.native235.js +1 -1
- package/dist/native/index.native236.js +1 -1
- package/dist/native/index.native239.js +5 -5
- package/dist/native/index.native240.js +2 -2
- package/dist/native/index.native241.js +3 -46
- package/dist/native/index.native242.js +46 -3
- package/dist/native/index.native243.js +2 -2
- package/dist/native/index.native244.js +2 -2
- package/dist/native/index.native245.js +2 -2
- package/dist/native/index.native247.js +1 -1
- package/dist/native/index.native252.js +1 -1
- package/dist/native/index.native253.js +1 -1
- package/dist/native/index.native256.js +1 -1
- package/dist/native/index.native87.js +85 -64
- package/dist/native-types/version.d.ts +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/web/index.web10.js +52 -51
- package/dist/web/index.web110.js +2 -2
- package/dist/web/index.web114.js +2 -2
- package/dist/web/index.web126.js +12 -12
- package/dist/web/index.web127.js +1 -1
- package/dist/web/index.web129.js +4 -4
- package/dist/web/index.web130.js +3 -3
- package/dist/web/index.web131.js +31 -2
- package/dist/web/index.web132.js +28 -65
- package/dist/web/index.web133.js +2 -367
- package/dist/web/index.web134.js +65 -28
- package/dist/web/index.web135.js +364 -28
- package/dist/web/index.web138.js +1 -1
- package/dist/web/index.web139.js +1 -1
- package/dist/web/index.web140.js +5 -13
- package/dist/web/index.web141.js +47 -11
- package/dist/web/index.web142.js +11 -53
- package/dist/web/index.web143.js +11 -10
- package/dist/web/index.web144.js +55 -2
- package/dist/web/index.web145.js +11 -45
- package/dist/web/index.web146.js +2 -14
- package/dist/web/index.web147.js +45 -5
- package/dist/web/index.web148.js +14 -5
- package/dist/web/index.web149.js +4 -47
- package/dist/web/index.web150.js +2 -14
- package/dist/web/index.web151.js +2 -56
- package/dist/web/index.web152.js +14 -6
- package/dist/web/index.web153.js +27 -20
- package/dist/web/index.web154.js +7 -17
- package/dist/web/index.web155.js +3 -45
- package/dist/web/index.web156.js +28 -3
- package/dist/web/index.web157.js +8 -3
- package/dist/web/index.web158.js +7 -34
- package/dist/web/index.web159.js +79 -11
- package/dist/web/index.web160.js +28 -4
- package/dist/web/index.web161.js +3 -28
- package/dist/web/index.web162.js +15 -6
- package/dist/web/index.web163.js +4 -32
- package/dist/web/index.web164.js +14 -12
- package/dist/web/index.web165.js +18 -54
- package/dist/web/index.web166.js +57 -38
- package/dist/web/index.web167.js +17 -127
- package/dist/web/index.web168.js +21 -102
- package/dist/web/index.web169.js +8 -6
- package/dist/web/index.web170.js +43 -3
- package/dist/web/index.web171.js +7 -78
- package/dist/web/index.web172.js +21 -2
- package/dist/web/index.web173.js +14 -2
- package/dist/web/index.web174.js +51 -33
- package/dist/web/index.web175.js +6 -6
- package/dist/web/index.web176.js +19 -32
- package/dist/web/index.web177.js +17 -14
- package/dist/web/index.web178.js +41 -30
- package/dist/web/index.web179.js +3 -18
- package/dist/web/index.web180.js +3 -8
- package/dist/web/index.web181.js +33 -9
- package/dist/web/index.web182.js +12 -11
- package/dist/web/index.web183.js +4 -13
- package/dist/web/index.web184.js +28 -5
- package/dist/web/index.web185.js +7 -5
- package/dist/web/index.web186.js +32 -10
- package/dist/web/index.web187.js +13 -2
- package/dist/web/index.web188.js +56 -2
- package/dist/web/index.web189.js +42 -14
- package/dist/web/index.web190.js +126 -27
- package/dist/web/index.web191.js +104 -7
- package/dist/web/index.web192.js +6 -3
- package/dist/web/index.web193.js +3 -29
- package/dist/web/index.web194.js +78 -8
- package/dist/web/index.web195.js +2 -8
- package/dist/web/index.web196.js +2 -81
- package/dist/web/index.web197.js +35 -26
- package/dist/web/index.web198.js +6 -3
- package/dist/web/index.web199.js +34 -15
- package/dist/web/index.web2.js +2 -2
- package/dist/web/index.web200.js +14 -4
- package/dist/web/index.web201.js +34 -14
- package/dist/web/index.web202.js +17 -18
- package/dist/web/index.web203.js +8 -61
- package/dist/web/index.web204.js +10 -17
- package/dist/web/index.web205.js +11 -23
- package/dist/web/index.web206.js +13 -8
- package/dist/web/index.web207.js +5 -42
- package/dist/web/index.web208.js +5 -8
- package/dist/web/index.web209.js +10 -20
- package/dist/web/index.web210.js +7 -103
- package/dist/web/index.web211.js +2 -79
- package/dist/web/index.web212.js +360 -78
- package/dist/web/index.web213.js +852 -20
- package/dist/web/index.web214.js +39 -10
- package/dist/web/index.web215.js +2 -20
- package/dist/web/index.web216.js +70 -94
- package/dist/web/index.web217.js +35 -21
- package/dist/web/index.web218.js +13 -116
- package/dist/web/index.web219.js +101 -106
- package/dist/web/index.web220.js +79 -2
- package/dist/web/index.web221.js +79 -2
- package/dist/web/index.web222.js +17 -17
- package/dist/web/index.web223.js +10 -2
- package/dist/web/index.web224.js +19 -19
- package/dist/web/index.web225.js +91 -30
- package/dist/web/index.web226.js +21 -7
- package/dist/web/index.web227.js +117 -38
- package/dist/web/index.web228.js +2 -2
- package/dist/web/index.web229.js +107 -68
- package/dist/web/index.web230.js +2 -35
- package/dist/web/index.web231.js +18 -12
- package/dist/web/index.web232.js +2 -8
- package/dist/web/index.web233.js +20 -2
- package/dist/web/index.web234.js +28 -356
- package/dist/web/index.web235.js +6 -852
- package/dist/web/index.web236.js +3 -46
- package/dist/web/index.web237.js +46 -3
- package/dist/web/index.web238.js +2 -18
- package/dist/web/index.web239.js +2 -28
- package/dist/web/index.web240.js +2 -8
- package/dist/web/index.web241.js +18 -11
- package/dist/web/index.web242.js +28 -13
- package/dist/web/index.web243.js +8 -10
- package/dist/web/index.web244.js +11 -17
- package/dist/web/index.web245.js +12 -80
- package/dist/web/index.web246.js +10 -2
- package/dist/web/index.web247.js +17 -2
- package/dist/web/index.web248.js +81 -2
- package/dist/web/index.web251.js +1 -1
- package/dist/web/index.web3.js +1 -1
- package/dist/web/index.web85.js +85 -64
- package/dist/web/index.web9.js +1 -1
- package/dist/web-types/version.d.ts +1 -1
- package/package.json +3 -3
package/dist/esm/index.web85.js
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { logOutEndUser as f, refreshAccessToken as d,
|
|
2
|
-
import { Analytics as
|
|
1
|
+
import { logOutEndUser as f, refreshAccessToken as d, isRefreshTokenUnavailableError as m, isTransientTokenReadError as S, registerTemporaryWalletSecret as w, APIError as y } from "@coinbase/cdp-api-client";
|
|
2
|
+
import { Analytics as i } from "./index.web2.js";
|
|
3
3
|
import "./index.web3.js";
|
|
4
4
|
import "jose";
|
|
5
|
-
import { SignJWT as
|
|
6
|
-
import { toAuthState as
|
|
5
|
+
import { SignJWT as _ } from "./index.web107.js";
|
|
6
|
+
import { toAuthState as k } from "./index.web101.js";
|
|
7
7
|
import "viem";
|
|
8
8
|
import { getPlatformCrypto as c } from "./index.web5.js";
|
|
9
9
|
import { sortKeys as p } from "./index.web98.js";
|
|
10
|
-
import { getCoreOAuthManager as
|
|
11
|
-
const l = 60 * 1e3,
|
|
10
|
+
import { getCoreOAuthManager as T } from "./index.web74.js";
|
|
11
|
+
const l = 60 * 1e3, R = {
|
|
12
12
|
maxRetries: 3,
|
|
13
13
|
baseDelayMs: 1e3,
|
|
14
14
|
maxDelayMs: 1e4
|
|
15
15
|
};
|
|
16
|
-
function
|
|
17
|
-
const n = e * Math.pow(2,
|
|
18
|
-
return Math.min(n +
|
|
16
|
+
function g(s, e, r) {
|
|
17
|
+
const n = e * Math.pow(2, s), o = Math.random() * 0.3 * n;
|
|
18
|
+
return Math.min(n + o, r);
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
return new Promise((e) => setTimeout(e,
|
|
20
|
+
function A(s) {
|
|
21
|
+
return new Promise((e) => setTimeout(e, s));
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
if (
|
|
23
|
+
function E(s) {
|
|
24
|
+
if (s instanceof TypeError && s.message.includes("fetch"))
|
|
25
25
|
return !0;
|
|
26
|
-
if (
|
|
27
|
-
if (
|
|
26
|
+
if (s instanceof y) {
|
|
27
|
+
if (s.statusCode >= 500 && s.statusCode < 600 || s.statusCode === 408 || s.statusCode === 429)
|
|
28
28
|
return !0;
|
|
29
|
-
if (
|
|
29
|
+
if (s.statusCode === 401)
|
|
30
30
|
return !1;
|
|
31
31
|
}
|
|
32
|
-
if (
|
|
33
|
-
const e =
|
|
32
|
+
if (s instanceof Error) {
|
|
33
|
+
const e = s.message.toLowerCase();
|
|
34
34
|
if (e.includes("network") || e.includes("timeout") || e.includes("econnrefused") || e.includes("enotfound") || e.includes("socket"))
|
|
35
35
|
return !0;
|
|
36
36
|
}
|
|
37
37
|
return !1;
|
|
38
38
|
}
|
|
39
|
-
class
|
|
39
|
+
class j {
|
|
40
40
|
projectId;
|
|
41
41
|
authState = null;
|
|
42
42
|
walletSecret = null;
|
|
@@ -139,14 +139,14 @@ class v {
|
|
|
139
139
|
if (!await this.isSignedIn())
|
|
140
140
|
throw new Error("Cannot get X-Wallet-Auth header if the user is not signed in");
|
|
141
141
|
this.shouldRefreshWalletSecret() && await this.refreshWalletSecret();
|
|
142
|
-
const
|
|
143
|
-
uris: [
|
|
142
|
+
const r = `${e.requestMethod} ${e.requestHost}${e.requestPath}`, n = Math.floor(Date.now() / 1e3), o = c(), a = {
|
|
143
|
+
uris: [r]
|
|
144
144
|
};
|
|
145
145
|
if (e.requestData && Object.keys(e.requestData).length > 0) {
|
|
146
|
-
const
|
|
147
|
-
|
|
146
|
+
const t = p(e.requestData);
|
|
147
|
+
a.reqHash = await o.hash(new TextEncoder().encode(JSON.stringify(t)));
|
|
148
148
|
}
|
|
149
|
-
return await new
|
|
149
|
+
return await new _(a).setProtectedHeader({ alg: "ES256", typ: "JWT" }).setIssuedAt(n).setNotBefore(n).setJti(o.generateRandomId()).sign(this.walletSecret.keyPair.privateKey);
|
|
150
150
|
}
|
|
151
151
|
/**
|
|
152
152
|
* Gets the authentication state.
|
|
@@ -162,13 +162,13 @@ class v {
|
|
|
162
162
|
* @param authState - The authentication state.
|
|
163
163
|
*/
|
|
164
164
|
async setAuthState(e) {
|
|
165
|
-
this.authState = e,
|
|
165
|
+
this.authState = e, i.endUserIdentifier = e.user.userId, this.authStateChangeCallbacks.forEach((r) => r(this.authState?.user ?? null)), this.scheduleTokenRefresh();
|
|
166
166
|
}
|
|
167
167
|
/**
|
|
168
168
|
* Clears the authentication state.
|
|
169
169
|
*/
|
|
170
170
|
async clearAuthState() {
|
|
171
|
-
this.authState = null, this.walletSecret = null,
|
|
171
|
+
this.authState = null, this.walletSecret = null, i.endUserIdentifier = "", this.cancelTokenRefresh(), this.authStateChangeCallbacks.forEach((e) => e(null));
|
|
172
172
|
}
|
|
173
173
|
/**
|
|
174
174
|
* Ensures the AuthManager is initialized before proceeding.
|
|
@@ -186,7 +186,7 @@ class v {
|
|
|
186
186
|
*/
|
|
187
187
|
async _doInitialize() {
|
|
188
188
|
try {
|
|
189
|
-
await this.refreshAccessToken("init"), await
|
|
189
|
+
await this.refreshAccessToken("init"), await T().handleOAuthCode();
|
|
190
190
|
} catch (e) {
|
|
191
191
|
console.warn("Failed to refresh access token during initialization:", e);
|
|
192
192
|
}
|
|
@@ -210,57 +210,78 @@ class v {
|
|
|
210
210
|
* @returns The new access token.
|
|
211
211
|
*/
|
|
212
212
|
async refreshAccessToken(e = "on_demand") {
|
|
213
|
-
const { maxRetries:
|
|
214
|
-
|
|
213
|
+
const { maxRetries: r, baseDelayMs: n, maxDelayMs: o } = R;
|
|
214
|
+
i.sendSessionRefreshEvent({
|
|
215
215
|
name: "refresh_token_start",
|
|
216
216
|
trigger: e
|
|
217
217
|
});
|
|
218
|
-
for (let
|
|
218
|
+
for (let a = 0; a <= r; a++)
|
|
219
219
|
try {
|
|
220
|
-
const
|
|
220
|
+
const t = await d(this.projectId, {
|
|
221
221
|
grantType: "refresh_token"
|
|
222
|
-
}),
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
222
|
+
}), h = k(
|
|
223
|
+
t.accessToken,
|
|
224
|
+
t.validUntil,
|
|
225
|
+
t.endUser
|
|
226
226
|
);
|
|
227
|
-
await this.setAuthState(
|
|
227
|
+
await this.setAuthState(h), i.sendSessionRefreshEvent({
|
|
228
228
|
name: "refresh_token_success",
|
|
229
229
|
trigger: e,
|
|
230
|
-
attempt:
|
|
230
|
+
attempt: a
|
|
231
231
|
});
|
|
232
232
|
return;
|
|
233
|
-
} catch (
|
|
234
|
-
const
|
|
235
|
-
if (
|
|
236
|
-
|
|
233
|
+
} catch (t) {
|
|
234
|
+
const h = t instanceof Error ? t.message : String(t);
|
|
235
|
+
if (m(t)) {
|
|
236
|
+
if (S(t)) {
|
|
237
|
+
i.sendSessionRefreshEvent({
|
|
238
|
+
name: "refresh_token_skipped_transient",
|
|
239
|
+
trigger: e,
|
|
240
|
+
attempt: a,
|
|
241
|
+
read_outcome: t.outcome,
|
|
242
|
+
error_message: h
|
|
243
|
+
});
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
i.sendSessionRefreshEvent({
|
|
237
247
|
name: "refresh_token_failure",
|
|
238
248
|
trigger: e,
|
|
239
|
-
attempt:
|
|
249
|
+
attempt: a,
|
|
240
250
|
error_type: "non_transient",
|
|
241
|
-
|
|
251
|
+
read_outcome: t.outcome,
|
|
252
|
+
error_message: h
|
|
242
253
|
}), await this.signOut();
|
|
243
254
|
return;
|
|
244
255
|
}
|
|
245
|
-
if (
|
|
246
|
-
|
|
256
|
+
if (!E(t)) {
|
|
257
|
+
i.sendSessionRefreshEvent({
|
|
258
|
+
name: "refresh_token_failure",
|
|
259
|
+
trigger: e,
|
|
260
|
+
attempt: a,
|
|
261
|
+
error_type: "non_transient",
|
|
262
|
+
error_message: h
|
|
263
|
+
}), await this.signOut();
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
if (a === r) {
|
|
267
|
+
i.sendSessionRefreshEvent({
|
|
247
268
|
name: "refresh_token_exhausted",
|
|
248
269
|
trigger: e,
|
|
249
|
-
attempt:
|
|
270
|
+
attempt: a,
|
|
250
271
|
error_type: "transient",
|
|
251
|
-
error_message:
|
|
272
|
+
error_message: h
|
|
252
273
|
});
|
|
253
274
|
return;
|
|
254
275
|
}
|
|
255
|
-
|
|
276
|
+
i.sendSessionRefreshEvent({
|
|
256
277
|
name: "refresh_token_retry",
|
|
257
278
|
trigger: e,
|
|
258
|
-
attempt:
|
|
279
|
+
attempt: a,
|
|
259
280
|
error_type: "transient",
|
|
260
|
-
error_message:
|
|
281
|
+
error_message: h
|
|
261
282
|
});
|
|
262
|
-
const u =
|
|
263
|
-
await
|
|
283
|
+
const u = g(a, n, o);
|
|
284
|
+
await A(u);
|
|
264
285
|
}
|
|
265
286
|
}
|
|
266
287
|
/**
|
|
@@ -270,13 +291,13 @@ class v {
|
|
|
270
291
|
scheduleTokenRefresh() {
|
|
271
292
|
if (this.cancelTokenRefresh(), !this.authState)
|
|
272
293
|
return;
|
|
273
|
-
const
|
|
274
|
-
|
|
294
|
+
const r = this.authState.expiresAt - l - Date.now();
|
|
295
|
+
r <= 0 || (i.sendSessionRefreshEvent({
|
|
275
296
|
name: "refresh_token_scheduled",
|
|
276
|
-
time_until_refresh_ms:
|
|
297
|
+
time_until_refresh_ms: r
|
|
277
298
|
}), this.refreshTimeout = setTimeout(async () => {
|
|
278
299
|
await this.refreshAccessToken("scheduled"), this.scheduleTokenRefresh();
|
|
279
|
-
},
|
|
300
|
+
}, r));
|
|
280
301
|
}
|
|
281
302
|
/**
|
|
282
303
|
* Cancels any scheduled token refresh.
|
|
@@ -313,23 +334,23 @@ class v {
|
|
|
313
334
|
* Internal wallet secret refresh logic.
|
|
314
335
|
*/
|
|
315
336
|
async _doRefreshWalletSecret() {
|
|
316
|
-
const e = c(),
|
|
317
|
-
this.walletSecret = { walletSecretId:
|
|
337
|
+
const e = c(), r = this.walletSecret?.walletSecretId ?? e.generateRandomId(), n = this.walletSecret?.keyPair ?? await e.createKeyPair(), o = this.authState.expiresAt, a = new Date(o).toISOString();
|
|
338
|
+
this.walletSecret = { walletSecretId: r, keyPair: n, expiresAt: o };
|
|
318
339
|
try {
|
|
319
|
-
await
|
|
340
|
+
await w(
|
|
320
341
|
this.authState.user.userId,
|
|
321
342
|
{
|
|
322
|
-
walletSecretId:
|
|
343
|
+
walletSecretId: r,
|
|
323
344
|
publicKey: n.publicKeyBase64,
|
|
324
|
-
validUntil:
|
|
345
|
+
validUntil: a
|
|
325
346
|
},
|
|
326
347
|
{ projectID: this.projectId }
|
|
327
348
|
);
|
|
328
|
-
} catch (
|
|
329
|
-
throw this.walletSecret = null,
|
|
349
|
+
} catch (t) {
|
|
350
|
+
throw this.walletSecret = null, t;
|
|
330
351
|
}
|
|
331
352
|
}
|
|
332
353
|
}
|
|
333
354
|
export {
|
|
334
|
-
|
|
355
|
+
j as AuthManager
|
|
335
356
|
};
|
package/dist/esm/index.web9.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CompactSign as i } from "./index.
|
|
2
|
-
import { JWTInvalid as r } from "./index.
|
|
3
|
-
import { JWTClaimsBuilder as n } from "./index.
|
|
1
|
+
import { CompactSign as i } from "./index.native134.js";
|
|
2
|
+
import { JWTInvalid as r } from "./index.native135.js";
|
|
3
|
+
import { JWTClaimsBuilder as n } from "./index.native136.js";
|
|
4
4
|
class d {
|
|
5
5
|
#s;
|
|
6
6
|
#t;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { InvalidAddressError as s } from "./index.
|
|
2
|
-
import { isAddress as a } from "./index.
|
|
1
|
+
import { InvalidAddressError as s } from "./index.native144.js";
|
|
2
|
+
import { isAddress as a } from "./index.native145.js";
|
|
3
3
|
function r(n) {
|
|
4
4
|
if (typeof n == "string") {
|
|
5
5
|
if (!a(n, { strict: !1 }))
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DisconnectedError as l, from as d } from "./index.native129.js";
|
|
2
2
|
import { validateRequest as h, EIP1193ProviderError as m, STANDARD_ERROR_CODES as _ } from "./index.native93.js";
|
|
3
|
-
import { createEOAHandlers as p } from "./index.
|
|
4
|
-
import { createSmartAccountHandlers as g } from "./index.
|
|
3
|
+
import { createEOAHandlers as p } from "./index.native137.js";
|
|
4
|
+
import { createSmartAccountHandlers as g } from "./index.native138.js";
|
|
5
5
|
import "viem";
|
|
6
6
|
import "zustand";
|
|
7
7
|
import "@coinbase/cdp-api-client";
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { configureCdpApiClient as
|
|
2
|
-
import { Analytics as
|
|
1
|
+
import { configureCdpApiClient as C, setAuthManager as M, getMfaConfig as v, APIError as m, getProjectConfig as S } from "@coinbase/cdp-api-client";
|
|
2
|
+
import { Analytics as d } from "./index.native2.js";
|
|
3
3
|
import "./index.native3.js";
|
|
4
|
-
import { createAuthManager as
|
|
5
|
-
import { OAuthManager as
|
|
6
|
-
import { MockAuthManager as
|
|
7
|
-
import { MockOAuthManager as
|
|
8
|
-
import { getAttestationModule as
|
|
9
|
-
import { getPlatformServices as
|
|
10
|
-
import { getConfig as i, setCoreAuthManager as
|
|
4
|
+
import { createAuthManager as y } from "./index.native117.js";
|
|
5
|
+
import { OAuthManager as w } from "./index.native118.js";
|
|
6
|
+
import { MockAuthManager as P } from "./index.native119.js";
|
|
7
|
+
import { MockOAuthManager as _ } from "./index.native120.js";
|
|
8
|
+
import { getAttestationModule as O } from "./index.native95.js";
|
|
9
|
+
import { getPlatformServices as h } from "./index.native10.js";
|
|
10
|
+
import { getConfig as i, setCoreAuthManager as I, setCoreOAuthManager as A, setMfaConfig as k, setProjectConfig as b, getCoreAuthManager as R, setConfig as E } from "./index.native76.js";
|
|
11
11
|
import "viem";
|
|
12
|
-
const
|
|
12
|
+
const V = async (t) => {
|
|
13
13
|
if (!t.projectId)
|
|
14
14
|
throw new Error("Project ID is required");
|
|
15
|
-
t.disableAnalytics === void 0 || t.disableAnalytics === !1 ? (
|
|
15
|
+
t.disableAnalytics === void 0 || t.disableAnalytics === !1 ? (d.developerIdentifier = t.projectId, d.isUsingMocks = t.useMock === !0, d.isProduction = !t.basePath || t.basePath === "https://api.cdp.coinbase.com/platform") : d.enabled = !1;
|
|
16
16
|
let a;
|
|
17
17
|
try {
|
|
18
18
|
a = i().projectId !== t.projectId;
|
|
19
19
|
} catch {
|
|
20
20
|
a = !0;
|
|
21
21
|
}
|
|
22
|
-
if (
|
|
23
|
-
|
|
22
|
+
if (E(t), i().useMock) {
|
|
23
|
+
I(new P(i().projectId)), A(new _()), k({
|
|
24
24
|
projectId: i().projectId,
|
|
25
25
|
enabled: !1,
|
|
26
26
|
totpConfig: { enabled: !1 },
|
|
@@ -30,7 +30,7 @@ const U = async (t) => {
|
|
|
30
30
|
requireVerificationOnLogin: !1,
|
|
31
31
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
32
32
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
33
|
-
}),
|
|
33
|
+
}), b({
|
|
34
34
|
projectId: i().projectId,
|
|
35
35
|
name: "Mock Project",
|
|
36
36
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -38,87 +38,88 @@ const U = async (t) => {
|
|
|
38
38
|
});
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
|
-
let o, s = !1;
|
|
41
|
+
let o, c = !1, s = !1;
|
|
42
42
|
try {
|
|
43
|
-
const e =
|
|
44
|
-
e.secureStorage ? (s = !0, o = {
|
|
43
|
+
const e = h();
|
|
44
|
+
e.secureStorage ? (c = !0, s = !0, o = {
|
|
45
45
|
getRefreshToken: () => e.secureStorage.getItem("cdp_refresh_token"),
|
|
46
|
-
getRefreshTokenWithOutcome: () =>
|
|
46
|
+
getRefreshTokenWithOutcome: () => j(e.secureStorage),
|
|
47
47
|
setRefreshToken: (n) => e.secureStorage.setItem("cdp_refresh_token", n),
|
|
48
48
|
removeRefreshToken: () => e.secureStorage.removeItem("cdp_refresh_token")
|
|
49
49
|
}) : o = {
|
|
50
50
|
getRefreshToken: () => e.storage.getItem("cdp_refresh_token"),
|
|
51
|
-
getRefreshTokenWithOutcome: () =>
|
|
51
|
+
getRefreshTokenWithOutcome: () => j(e.storage),
|
|
52
52
|
setRefreshToken: (n) => e.storage.setItem("cdp_refresh_token", n),
|
|
53
53
|
removeRefreshToken: () => e.storage.removeItem("cdp_refresh_token")
|
|
54
54
|
};
|
|
55
55
|
} catch {
|
|
56
|
-
|
|
56
|
+
d.sendSessionRefreshEvent({
|
|
57
57
|
name: "refresh_token_storage_not_initialized"
|
|
58
58
|
}), o = void 0;
|
|
59
59
|
}
|
|
60
|
-
let r,
|
|
60
|
+
let r, f, p;
|
|
61
61
|
try {
|
|
62
|
-
const e =
|
|
63
|
-
p = e.deviceInfo?.getPlatform?.(), e.attestation && (r = e.attestation,
|
|
62
|
+
const e = h();
|
|
63
|
+
p = e.deviceInfo?.getPlatform?.(), e.attestation && (r = e.attestation, f = e.deviceInfo?.getAppBundleId?.());
|
|
64
64
|
} catch {
|
|
65
65
|
r = void 0;
|
|
66
66
|
}
|
|
67
|
-
if (
|
|
67
|
+
if (C({
|
|
68
68
|
debugging: i().debugging,
|
|
69
69
|
basePath: i().basePath,
|
|
70
70
|
refreshTokenStorage: o,
|
|
71
|
-
retryTokenReads:
|
|
71
|
+
retryTokenReads: c,
|
|
72
|
+
failClosedOnMissingToken: s,
|
|
72
73
|
platform: p,
|
|
73
74
|
appAttestation: r && {
|
|
74
75
|
isEnabled: () => r.isEnabled,
|
|
75
|
-
appIdentifier:
|
|
76
|
+
appIdentifier: f,
|
|
76
77
|
generateAssertion: r.generateAssertion.bind(r)
|
|
77
78
|
}
|
|
78
79
|
}), a) {
|
|
79
|
-
const e = new
|
|
80
|
-
|
|
81
|
-
const n =
|
|
82
|
-
|
|
80
|
+
const e = new w();
|
|
81
|
+
A(e);
|
|
82
|
+
const n = y(i().projectId);
|
|
83
|
+
I(n), M(n);
|
|
83
84
|
}
|
|
84
|
-
const [,
|
|
85
|
-
|
|
85
|
+
const [, l, u] = await Promise.allSettled([
|
|
86
|
+
R().ensureInitialized(),
|
|
86
87
|
(async () => {
|
|
87
88
|
try {
|
|
88
|
-
return await
|
|
89
|
+
return await v(t.projectId);
|
|
89
90
|
} catch (e) {
|
|
90
|
-
return (!(e instanceof
|
|
91
|
+
return (!(e instanceof m) || e.statusCode !== 404) && console.warn("Failed to get MFA config", e), null;
|
|
91
92
|
}
|
|
92
93
|
})(),
|
|
93
94
|
(async () => {
|
|
94
95
|
try {
|
|
95
|
-
return await
|
|
96
|
+
return await S(t.projectId);
|
|
96
97
|
} catch (e) {
|
|
97
|
-
return (!(e instanceof
|
|
98
|
+
return (!(e instanceof m) || e.statusCode !== 404) && console.warn("Failed to get project config", e), null;
|
|
98
99
|
}
|
|
99
100
|
})()
|
|
100
101
|
]);
|
|
101
|
-
if (
|
|
102
|
-
const e =
|
|
103
|
-
if (
|
|
104
|
-
const n =
|
|
105
|
-
n !== null && (
|
|
102
|
+
if (l.status === "fulfilled" && l.value && k(l.value), u.status === "fulfilled" && u.value) {
|
|
103
|
+
const e = u.value;
|
|
104
|
+
if (b(e), e.appAttestation && r && f) {
|
|
105
|
+
const n = T(e.appAttestation, f);
|
|
106
|
+
n !== null && (O() || console.warn(
|
|
106
107
|
"[Attestation] Project config has attestation enabled for this app, but no attestation provider is registered. Install @coinbase/cdp-app-attest and add `import '@coinbase/cdp-app-attest'` to your app's entry point."
|
|
107
|
-
), r.isEnabled = !0, r.cloudProjectNumber = n.cloudProjectNumber, r.initialize().catch((
|
|
108
|
+
), r.isEnabled = !0, r.cloudProjectNumber = n.cloudProjectNumber, r.initialize().catch((g) => {
|
|
108
109
|
console.error(
|
|
109
110
|
"[Attestation] Background initialization failed:",
|
|
110
|
-
|
|
111
|
+
g instanceof Error ? g.message : String(g)
|
|
111
112
|
);
|
|
112
113
|
}));
|
|
113
114
|
}
|
|
114
115
|
}
|
|
115
|
-
},
|
|
116
|
-
const { value: a, outcome: o, errorMessage:
|
|
117
|
-
return { token: a, outcome: o, errorMessage:
|
|
118
|
-
},
|
|
119
|
-
const o = t.android?.find((
|
|
120
|
-
return o ? { cloudProjectNumber: o.googleProjectNumber } : t.ios?.find((
|
|
116
|
+
}, j = async (t) => {
|
|
117
|
+
const { value: a, outcome: o, errorMessage: c } = await t.getItemWithOutcome("cdp_refresh_token");
|
|
118
|
+
return { token: a, outcome: o, errorMessage: c };
|
|
119
|
+
}, T = (t, a) => {
|
|
120
|
+
const o = t.android?.find((s) => s.identifier === a);
|
|
121
|
+
return o ? { cloudProjectNumber: o.googleProjectNumber } : t.ios?.find((s) => s.identifier === a) ? {} : null;
|
|
121
122
|
};
|
|
122
123
|
export {
|
|
123
|
-
|
|
124
|
+
V as initialize
|
|
124
125
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { serializeAuthorizationList as v } from "./index.
|
|
2
|
-
import { blobsToCommitments as H } from "./index.
|
|
3
|
-
import { blobsToProofs as V } from "./index.
|
|
4
|
-
import { commitmentsToVersionedHashes as k } from "./index.
|
|
5
|
-
import { toBlobSidecars as B } from "./index.
|
|
6
|
-
import { concatHex as T } from "./index.
|
|
7
|
-
import { trim as F } from "./index.
|
|
8
|
-
import { numberToHex as s, bytesToHex as S } from "./index.
|
|
9
|
-
import { toRlp as b } from "./index.
|
|
10
|
-
import { assertTransactionEIP1559 as _, assertTransactionEIP2930 as C, assertTransactionEIP4844 as R, assertTransactionEIP7702 as Y, assertTransactionLegacy as j } from "./index.
|
|
11
|
-
import { getTransactionType as q } from "./index.
|
|
12
|
-
import { serializeAccessList as h } from "./index.
|
|
1
|
+
import { serializeAuthorizationList as v } from "./index.native159.js";
|
|
2
|
+
import { blobsToCommitments as H } from "./index.native185.js";
|
|
3
|
+
import { blobsToProofs as V } from "./index.native186.js";
|
|
4
|
+
import { commitmentsToVersionedHashes as k } from "./index.native187.js";
|
|
5
|
+
import { toBlobSidecars as B } from "./index.native188.js";
|
|
6
|
+
import { concatHex as T } from "./index.native161.js";
|
|
7
|
+
import { trim as F } from "./index.native167.js";
|
|
8
|
+
import { numberToHex as s, bytesToHex as S } from "./index.native160.js";
|
|
9
|
+
import { toRlp as b } from "./index.native171.js";
|
|
10
|
+
import { assertTransactionEIP1559 as _, assertTransactionEIP2930 as C, assertTransactionEIP4844 as R, assertTransactionEIP7702 as Y, assertTransactionLegacy as j } from "./index.native176.js";
|
|
11
|
+
import { getTransactionType as q } from "./index.native182.js";
|
|
12
|
+
import { serializeAccessList as h } from "./index.native184.js";
|
|
13
13
|
function re(e, t) {
|
|
14
14
|
const i = q(e);
|
|
15
15
|
return i === "eip1559" ? J(e, t) : i === "eip2930" ? K(e, t) : i === "eip4844" ? D(e, t) : i === "eip7702" ? w(e, t) : M(e);
|
|
@@ -9,8 +9,8 @@ import { getConfig as S } from "./index.native76.js";
|
|
|
9
9
|
import { getAccessToken as A } from "./index.native26.js";
|
|
10
10
|
import { getAccessTokenExpiration as j } from "./index.native27.js";
|
|
11
11
|
import { ensureMfaVerified as y } from "./index.native85.js";
|
|
12
|
-
import { DEFAULT_SECURE_IFRAME_BASE_PATH as w, SECURE_IFRAME_KEY_EXPORT_EVENT_TYPE as n, DEFAULT_SECURE_IFRAME_THEME as k } from "./index.
|
|
13
|
-
import { validateSecureIframeEnvironment as g, createIframe as x, calculateSecureIframeHeight as U, buildKeyExportIframeUrl as L, getSecureIframeOrigin as v, isSecureIframeKeyExportMessage as R, sendSecureIframeMessage as l } from "./index.
|
|
12
|
+
import { DEFAULT_SECURE_IFRAME_BASE_PATH as w, SECURE_IFRAME_KEY_EXPORT_EVENT_TYPE as n, DEFAULT_SECURE_IFRAME_THEME as k } from "./index.native148.js";
|
|
13
|
+
import { validateSecureIframeEnvironment as g, createIframe as x, calculateSecureIframeHeight as U, buildKeyExportIframeUrl as L, getSecureIframeOrigin as v, isSecureIframeKeyExportMessage as R, sendSecureIframeMessage as l } from "./index.native149.js";
|
|
14
14
|
import "./index.native101.js";
|
|
15
15
|
import "@solana/web3.js";
|
|
16
16
|
import "bs58";
|
|
@@ -1,31 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
eth_requestAccounts: r,
|
|
17
|
-
personal_sign: o,
|
|
18
|
-
eth_sendTransaction: l,
|
|
19
|
-
eth_signTypedData_v4: h,
|
|
20
|
-
wallet_disconnect: m,
|
|
21
|
-
wallet_switchEthereumChain: d,
|
|
22
|
-
eth_sign: e,
|
|
23
|
-
eth_chainId: s,
|
|
24
|
-
wallet_sendCalls: i,
|
|
25
|
-
wallet_getCallsStatus: a,
|
|
26
|
-
wallet_getCapabilities: n
|
|
27
|
-
};
|
|
1
|
+
import { FlattenedSign as n } from "./index.native150.js";
|
|
2
|
+
class o {
|
|
3
|
+
#e;
|
|
4
|
+
constructor(e) {
|
|
5
|
+
this.#e = new n(e);
|
|
6
|
+
}
|
|
7
|
+
setProtectedHeader(e) {
|
|
8
|
+
return this.#e.setProtectedHeader(e), this;
|
|
9
|
+
}
|
|
10
|
+
async sign(e, r) {
|
|
11
|
+
const t = await this.#e.sign(e, r);
|
|
12
|
+
if (t.payload === void 0)
|
|
13
|
+
throw new TypeError("use the flattened module for creating JWS with b64: false");
|
|
14
|
+
return `${t.protected}.${t.payload}.${t.signature}`;
|
|
15
|
+
}
|
|
28
16
|
}
|
|
29
17
|
export {
|
|
30
|
-
|
|
18
|
+
o as CompactSign
|
|
31
19
|
};
|
|
@@ -1,31 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
eth_signTypedData_v4: d,
|
|
20
|
-
wallet_disconnect: e,
|
|
21
|
-
wallet_switchEthereumChain: a,
|
|
22
|
-
eth_sign: o,
|
|
23
|
-
eth_chainId: t,
|
|
24
|
-
wallet_sendCalls: m,
|
|
25
|
-
wallet_getCallsStatus: r,
|
|
26
|
-
wallet_getCapabilities: i
|
|
27
|
-
};
|
|
1
|
+
class c extends Error {
|
|
2
|
+
static code = "ERR_JOSE_GENERIC";
|
|
3
|
+
code = "ERR_JOSE_GENERIC";
|
|
4
|
+
constructor(s, e) {
|
|
5
|
+
super(s, e), this.name = this.constructor.name, Error.captureStackTrace?.(this, this.constructor);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
class E extends c {
|
|
9
|
+
static code = "ERR_JOSE_NOT_SUPPORTED";
|
|
10
|
+
code = "ERR_JOSE_NOT_SUPPORTED";
|
|
11
|
+
}
|
|
12
|
+
class o extends c {
|
|
13
|
+
static code = "ERR_JWS_INVALID";
|
|
14
|
+
code = "ERR_JWS_INVALID";
|
|
15
|
+
}
|
|
16
|
+
class r extends c {
|
|
17
|
+
static code = "ERR_JWT_INVALID";
|
|
18
|
+
code = "ERR_JWT_INVALID";
|
|
28
19
|
}
|
|
29
20
|
export {
|
|
30
|
-
|
|
21
|
+
c as JOSEError,
|
|
22
|
+
E as JOSENotSupported,
|
|
23
|
+
o as JWSInvalid,
|
|
24
|
+
r as JWTInvalid
|
|
31
25
|
};
|