@coinbase/cdp-core 0.0.67 → 0.0.69
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/README.md +149 -1
- package/dist/esm/index.native113.js +1 -1
- package/dist/esm/index.native137.js +2 -2
- package/dist/esm/index.native151.js +2 -4
- package/dist/esm/index.native152.js +109 -2
- package/dist/esm/index.native153.js +2 -109
- package/dist/esm/index.native154.js +4 -2
- package/dist/esm/index.native155.js +1 -1
- package/dist/esm/index.native156.js +7 -38
- package/dist/esm/index.native158.js +375 -67
- package/dist/esm/index.native159.js +832 -34
- package/dist/esm/index.native160.js +38 -20
- package/dist/esm/index.native161.js +2 -8
- package/dist/esm/index.native162.js +70 -2
- package/dist/esm/index.native163.js +30 -373
- package/dist/esm/index.native164.js +20 -832
- package/dist/esm/index.native175.js +2 -2
- package/dist/esm/index.native176.js +2 -2
- package/dist/esm/index.native177.js +2 -2
- package/dist/esm/index.native21.js +4 -2
- package/dist/esm/index.native31.js +1 -1
- package/dist/esm/index.native35.js +13 -12
- package/dist/esm/index.native37.js +4 -2
- package/dist/esm/index.native51.js +1 -1
- package/dist/esm/index.native52.js +3 -3
- package/dist/esm/index.native60.js +377 -2
- package/dist/esm/index.native61.js +2 -379
- package/dist/esm/index.native62.js +65 -28
- package/dist/esm/index.native63.js +364 -28
- package/dist/esm/index.native64.js +4 -2
- package/dist/esm/index.native65.js +28 -65
- package/dist/esm/index.native66.js +28 -364
- package/dist/esm/index.native7.js +6 -10
- package/dist/esm/index.web104.js +1 -1
- package/dist/esm/index.web107.js +6 -6
- package/dist/esm/index.web114.js +2 -2
- package/dist/esm/index.web118.js +1 -1
- package/dist/esm/index.web122.js +3 -20
- package/dist/esm/index.web123.js +21 -10
- package/dist/esm/index.web124.js +9 -19
- package/dist/esm/index.web125.js +15 -89
- package/dist/esm/index.web126.js +92 -19
- package/dist/esm/index.web127.js +18 -115
- package/dist/esm/index.web128.js +112 -73
- package/dist/esm/index.web150.js +7 -3
- package/dist/esm/index.web151.js +2 -39
- package/dist/esm/index.web152.js +378 -2
- package/dist/esm/index.web153.js +832 -69
- package/dist/esm/index.web154.js +37 -33
- package/dist/esm/index.web155.js +2 -21
- package/dist/esm/index.web156.js +69 -7
- package/dist/esm/index.web157.js +35 -2
- package/dist/esm/index.web158.js +17 -374
- package/dist/esm/index.web159.js +78 -832
- package/dist/esm/index.web20.js +4 -2
- package/dist/esm/index.web29.js +1 -1
- package/dist/esm/index.web33.js +13 -12
- package/dist/esm/index.web35.js +4 -2
- package/dist/esm/index.web6.js +6 -10
- package/dist/native/index.native113.js +1 -1
- package/dist/native/index.native137.js +2 -2
- package/dist/native/index.native151.js +2 -4
- package/dist/native/index.native152.js +109 -2
- package/dist/native/index.native153.js +2 -109
- package/dist/native/index.native154.js +4 -2
- package/dist/native/index.native155.js +1 -1
- package/dist/native/index.native156.js +7 -38
- package/dist/native/index.native158.js +375 -67
- package/dist/native/index.native159.js +832 -34
- package/dist/native/index.native160.js +38 -20
- package/dist/native/index.native161.js +2 -8
- package/dist/native/index.native162.js +70 -2
- package/dist/native/index.native163.js +30 -373
- package/dist/native/index.native164.js +20 -832
- package/dist/native/index.native175.js +2 -2
- package/dist/native/index.native176.js +2 -2
- package/dist/native/index.native177.js +2 -2
- package/dist/native/index.native21.js +4 -2
- package/dist/native/index.native31.js +1 -1
- package/dist/native/index.native35.js +13 -12
- package/dist/native/index.native37.js +4 -2
- package/dist/native/index.native51.js +1 -1
- package/dist/native/index.native52.js +3 -3
- package/dist/native/index.native60.js +377 -2
- package/dist/native/index.native61.js +2 -379
- package/dist/native/index.native62.js +65 -28
- package/dist/native/index.native63.js +364 -28
- package/dist/native/index.native64.js +4 -2
- package/dist/native/index.native65.js +28 -65
- package/dist/native/index.native66.js +28 -364
- package/dist/native/index.native7.js +6 -10
- package/dist/native-types/actions/initiateMfaEnrollment.d.ts +9 -0
- package/dist/native-types/actions/initiateMfaVerification.d.ts +2 -0
- package/dist/native-types/actions/submitMfaEnrollment.d.ts +10 -0
- package/dist/native-types/actions/submitMfaVerification.d.ts +6 -0
- package/dist/native-types/auth/authManager.d.ts +3 -1
- package/dist/native-types/auth/toAuthState.d.ts +10 -3
- package/dist/native-types/auth/types.d.ts +3 -1
- package/dist/native-types/auth/withAuth.d.ts +1 -1
- package/dist/native-types/core.d.ts +3 -1
- package/dist/native-types/index.d.ts +4 -0
- package/dist/native-types/mocks/mockAuthManager.d.ts +3 -1
- package/dist/native-types/shared/validators.d.ts +4 -0
- package/dist/native-types/types.d.ts +2 -1
- package/dist/native-types/version.d.ts +1 -1
- package/dist/types/actions/initiateMfaEnrollment.d.ts +9 -0
- package/dist/types/actions/initiateMfaVerification.d.ts +2 -0
- package/dist/types/actions/submitMfaEnrollment.d.ts +10 -0
- package/dist/types/actions/submitMfaVerification.d.ts +6 -0
- package/dist/types/auth/authManager.d.ts +3 -1
- package/dist/types/auth/toAuthState.d.ts +10 -3
- package/dist/types/auth/types.d.ts +3 -1
- package/dist/types/auth/withAuth.d.ts +1 -1
- package/dist/types/core.d.ts +3 -1
- package/dist/types/index.d.ts +4 -0
- package/dist/types/mocks/mockAuthManager.d.ts +3 -1
- package/dist/types/shared/validators.d.ts +4 -0
- package/dist/types/types.d.ts +2 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/web/index.web104.js +1 -1
- package/dist/web/index.web107.js +6 -6
- package/dist/web/index.web114.js +2 -2
- package/dist/web/index.web118.js +1 -1
- package/dist/web/index.web122.js +3 -20
- package/dist/web/index.web123.js +21 -10
- package/dist/web/index.web124.js +9 -19
- package/dist/web/index.web125.js +15 -89
- package/dist/web/index.web126.js +92 -19
- package/dist/web/index.web127.js +18 -115
- package/dist/web/index.web128.js +112 -73
- package/dist/web/index.web150.js +7 -3
- package/dist/web/index.web151.js +2 -39
- package/dist/web/index.web152.js +378 -2
- package/dist/web/index.web153.js +832 -69
- package/dist/web/index.web154.js +37 -33
- package/dist/web/index.web155.js +2 -21
- package/dist/web/index.web156.js +69 -7
- package/dist/web/index.web157.js +35 -2
- package/dist/web/index.web158.js +17 -374
- package/dist/web/index.web159.js +78 -832
- package/dist/web/index.web20.js +4 -2
- package/dist/web/index.web29.js +1 -1
- package/dist/web/index.web33.js +13 -12
- package/dist/web/index.web35.js +4 -2
- package/dist/web/index.web6.js +6 -10
- package/dist/web-types/actions/initiateMfaEnrollment.d.ts +9 -0
- package/dist/web-types/actions/initiateMfaVerification.d.ts +2 -0
- package/dist/web-types/actions/submitMfaEnrollment.d.ts +10 -0
- package/dist/web-types/actions/submitMfaVerification.d.ts +6 -0
- package/dist/web-types/auth/authManager.d.ts +3 -1
- package/dist/web-types/auth/toAuthState.d.ts +10 -3
- package/dist/web-types/auth/types.d.ts +3 -1
- package/dist/web-types/auth/withAuth.d.ts +1 -1
- package/dist/web-types/core.d.ts +3 -1
- package/dist/web-types/index.d.ts +4 -0
- package/dist/web-types/mocks/mockAuthManager.d.ts +3 -1
- package/dist/web-types/shared/validators.d.ts +4 -0
- package/dist/web-types/types.d.ts +2 -1
- package/dist/web-types/version.d.ts +1 -1
- package/package.json +3 -3
|
@@ -70,10 +70,12 @@ class R {
|
|
|
70
70
|
* Gets the access token, refreshing it if it is expired. Returns null if the user is not
|
|
71
71
|
* signed in.
|
|
72
72
|
*
|
|
73
|
+
* @param options - The options for getting the token.
|
|
74
|
+
* @param options.forceRefresh - Whether to force a refresh of the token.
|
|
73
75
|
* @returns The access token.
|
|
74
76
|
*/
|
|
75
|
-
async getToken() {
|
|
76
|
-
return this.shouldRefreshToken() && await this.refreshAccessToken(), this.authState?.accessToken ?? null;
|
|
77
|
+
async getToken(e) {
|
|
78
|
+
return (e?.forceRefresh || this.shouldRefreshToken()) && await this.refreshAccessToken(), this.authState?.accessToken ?? null;
|
|
77
79
|
}
|
|
78
80
|
/**
|
|
79
81
|
* Gets the expiration time of the access token, or null if the user is not signed in.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { __require as r } from "./index.
|
|
1
|
+
import { __require as r } from "./index.native156.js";
|
|
2
2
|
r();
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import "@coinbase/cdp-api-client";
|
|
2
|
-
const
|
|
3
|
-
const c = new Date(t).getTime(), s = u(o);
|
|
4
|
-
return {
|
|
5
|
-
accessToken: e,
|
|
6
|
-
expiresAt: c,
|
|
7
|
-
user: s
|
|
8
|
-
};
|
|
9
|
-
}, u = (e) => ({
|
|
2
|
+
const s = (e) => ({
|
|
10
3
|
userId: e.userId,
|
|
11
4
|
evmAccounts: e.evmAccounts?.map((t) => t) ?? [],
|
|
12
5
|
evmSmartAccounts: e.evmSmartAccounts?.map((t) => t) ?? [],
|
|
13
6
|
solanaAccounts: e.solanaAccounts?.map((t) => t) ?? [],
|
|
14
|
-
authenticationMethods: e.authenticationMethods.reduce((t, o) => (t[o.type] = o, t), {})
|
|
15
|
-
|
|
7
|
+
authenticationMethods: e.authenticationMethods.reduce((t, o) => (t[o.type] = o, t), {}),
|
|
8
|
+
mfaMethods: e.mfaMethods
|
|
9
|
+
}), c = (e, t, o) => {
|
|
10
|
+
const a = new Date(t).getTime();
|
|
11
|
+
return {
|
|
12
|
+
accessToken: e,
|
|
13
|
+
expiresAt: a,
|
|
14
|
+
user: s(o)
|
|
15
|
+
};
|
|
16
|
+
};
|
|
16
17
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
c as toAuthState,
|
|
19
|
+
s as toAuthStateUser
|
|
19
20
|
};
|
|
@@ -57,10 +57,12 @@ class n {
|
|
|
57
57
|
* Gets the access token. For mock, this always returns a valid token if signed in.
|
|
58
58
|
* If the current token is expired, it will be refreshed automatically.
|
|
59
59
|
*
|
|
60
|
+
* @param options - The options for getting the token.
|
|
61
|
+
* @param options.forceRefresh - Whether to force a refresh of the token.
|
|
60
62
|
* @returns The mock access token if signed in, null otherwise.
|
|
61
63
|
*/
|
|
62
|
-
async getToken() {
|
|
63
|
-
return this.authState ? (this.authState.expiresAt <= Date.now() && await this.refreshToken(), this.authState?.accessToken ?? null) : null;
|
|
64
|
+
async getToken(t) {
|
|
65
|
+
return this.authState ? ((t?.forceRefresh || this.authState.expiresAt <= Date.now()) && await this.refreshToken(), this.authState?.accessToken ?? null) : null;
|
|
64
66
|
}
|
|
65
67
|
/**
|
|
66
68
|
* Gets the expiration time of the access token, or null if the user is not signed in.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Analytics as r } from "./index.native30.js";
|
|
2
2
|
import "./index.native31.js";
|
|
3
|
-
import { VERSION as o } from "./index.
|
|
3
|
+
import { VERSION as o } from "./index.native64.js";
|
|
4
4
|
import "./index.native29.js";
|
|
5
5
|
import { APIError as T, ErrorType as S, HttpErrorType as f, OAuth2ProviderType as h, SendEvmTransactionWithEndUserAccountBodyNetwork as k, SendSolanaTransactionWithEndUserAccountBodyNetwork as u } from "@coinbase/cdp-api-client";
|
|
6
6
|
import "@solana/web3.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DisconnectedError as l, from as d } from "./index.
|
|
1
|
+
import { DisconnectedError as l, from as d } from "./index.native60.js";
|
|
2
2
|
import { validateRequest as h, EIP1193ProviderError as m, STANDARD_ERROR_CODES as _ } from "./index.native26.js";
|
|
3
|
-
import { createEOAHandlers as p } from "./index.
|
|
4
|
-
import { createSmartAccountHandlers as g } from "./index.
|
|
3
|
+
import { createEOAHandlers as p } from "./index.native65.js";
|
|
4
|
+
import { createSmartAccountHandlers as g } from "./index.native66.js";
|
|
5
5
|
import "viem";
|
|
6
6
|
import "zustand";
|
|
7
7
|
import "@coinbase/cdp-api-client";
|
|
@@ -1,4 +1,379 @@
|
|
|
1
|
-
|
|
1
|
+
import "./index.native61.js";
|
|
2
|
+
import { BaseError as P } from "./index.native62.js";
|
|
3
|
+
import { parse as y, parseError as j, InternalError as g } from "./index.native63.js";
|
|
4
|
+
class u extends Error {
|
|
5
|
+
constructor(e, t) {
|
|
6
|
+
super(t), Object.defineProperty(this, "name", {
|
|
7
|
+
enumerable: !0,
|
|
8
|
+
configurable: !0,
|
|
9
|
+
writable: !0,
|
|
10
|
+
value: "ProviderRpcError"
|
|
11
|
+
}), Object.defineProperty(this, "code", {
|
|
12
|
+
enumerable: !0,
|
|
13
|
+
configurable: !0,
|
|
14
|
+
writable: !0,
|
|
15
|
+
value: void 0
|
|
16
|
+
}), Object.defineProperty(this, "details", {
|
|
17
|
+
enumerable: !0,
|
|
18
|
+
configurable: !0,
|
|
19
|
+
writable: !0,
|
|
20
|
+
value: void 0
|
|
21
|
+
}), this.code = e, this.details = t;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
class n extends u {
|
|
25
|
+
constructor({ message: e = "The user rejected the request." } = {}) {
|
|
26
|
+
super(4001, e), Object.defineProperty(this, "code", {
|
|
27
|
+
enumerable: !0,
|
|
28
|
+
configurable: !0,
|
|
29
|
+
writable: !0,
|
|
30
|
+
value: 4001
|
|
31
|
+
}), Object.defineProperty(this, "name", {
|
|
32
|
+
enumerable: !0,
|
|
33
|
+
configurable: !0,
|
|
34
|
+
writable: !0,
|
|
35
|
+
value: "Provider.UserRejectedRequestError"
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
Object.defineProperty(n, "code", {
|
|
40
|
+
enumerable: !0,
|
|
41
|
+
configurable: !0,
|
|
42
|
+
writable: !0,
|
|
43
|
+
value: 4001
|
|
44
|
+
});
|
|
45
|
+
class a extends u {
|
|
46
|
+
constructor({ message: e = "The requested method and/or account has not been authorized by the user." } = {}) {
|
|
47
|
+
super(4100, e), Object.defineProperty(this, "code", {
|
|
48
|
+
enumerable: !0,
|
|
49
|
+
configurable: !0,
|
|
50
|
+
writable: !0,
|
|
51
|
+
value: 4100
|
|
52
|
+
}), Object.defineProperty(this, "name", {
|
|
53
|
+
enumerable: !0,
|
|
54
|
+
configurable: !0,
|
|
55
|
+
writable: !0,
|
|
56
|
+
value: "Provider.UnauthorizedError"
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
Object.defineProperty(a, "code", {
|
|
61
|
+
enumerable: !0,
|
|
62
|
+
configurable: !0,
|
|
63
|
+
writable: !0,
|
|
64
|
+
value: 4100
|
|
65
|
+
});
|
|
66
|
+
class i extends u {
|
|
67
|
+
constructor({ message: e = "The provider does not support the requested method." } = {}) {
|
|
68
|
+
super(4200, e), Object.defineProperty(this, "code", {
|
|
69
|
+
enumerable: !0,
|
|
70
|
+
configurable: !0,
|
|
71
|
+
writable: !0,
|
|
72
|
+
value: 4200
|
|
73
|
+
}), Object.defineProperty(this, "name", {
|
|
74
|
+
enumerable: !0,
|
|
75
|
+
configurable: !0,
|
|
76
|
+
writable: !0,
|
|
77
|
+
value: "Provider.UnsupportedMethodError"
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
Object.defineProperty(i, "code", {
|
|
82
|
+
enumerable: !0,
|
|
83
|
+
configurable: !0,
|
|
84
|
+
writable: !0,
|
|
85
|
+
value: 4200
|
|
86
|
+
});
|
|
87
|
+
class c extends u {
|
|
88
|
+
constructor({ message: e = "The provider is disconnected from all chains." } = {}) {
|
|
89
|
+
super(4900, e), Object.defineProperty(this, "code", {
|
|
90
|
+
enumerable: !0,
|
|
91
|
+
configurable: !0,
|
|
92
|
+
writable: !0,
|
|
93
|
+
value: 4900
|
|
94
|
+
}), Object.defineProperty(this, "name", {
|
|
95
|
+
enumerable: !0,
|
|
96
|
+
configurable: !0,
|
|
97
|
+
writable: !0,
|
|
98
|
+
value: "Provider.DisconnectedError"
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
Object.defineProperty(c, "code", {
|
|
103
|
+
enumerable: !0,
|
|
104
|
+
configurable: !0,
|
|
105
|
+
writable: !0,
|
|
106
|
+
value: 4900
|
|
107
|
+
});
|
|
108
|
+
class l extends u {
|
|
109
|
+
constructor({ message: e = "The provider is not connected to the requested chain." } = {}) {
|
|
110
|
+
super(4901, e), Object.defineProperty(this, "code", {
|
|
111
|
+
enumerable: !0,
|
|
112
|
+
configurable: !0,
|
|
113
|
+
writable: !0,
|
|
114
|
+
value: 4901
|
|
115
|
+
}), Object.defineProperty(this, "name", {
|
|
116
|
+
enumerable: !0,
|
|
117
|
+
configurable: !0,
|
|
118
|
+
writable: !0,
|
|
119
|
+
value: "Provider.ChainDisconnectedError"
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
Object.defineProperty(l, "code", {
|
|
124
|
+
enumerable: !0,
|
|
125
|
+
configurable: !0,
|
|
126
|
+
writable: !0,
|
|
127
|
+
value: 4901
|
|
128
|
+
});
|
|
129
|
+
class d extends u {
|
|
130
|
+
constructor({ message: e = "An error occurred when attempting to switch chain." } = {}) {
|
|
131
|
+
super(4902, e), Object.defineProperty(this, "code", {
|
|
132
|
+
enumerable: !0,
|
|
133
|
+
configurable: !0,
|
|
134
|
+
writable: !0,
|
|
135
|
+
value: 4902
|
|
136
|
+
}), Object.defineProperty(this, "name", {
|
|
137
|
+
enumerable: !0,
|
|
138
|
+
configurable: !0,
|
|
139
|
+
writable: !0,
|
|
140
|
+
value: "Provider.SwitchChainError"
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
Object.defineProperty(d, "code", {
|
|
145
|
+
enumerable: !0,
|
|
146
|
+
configurable: !0,
|
|
147
|
+
writable: !0,
|
|
148
|
+
value: 4902
|
|
149
|
+
});
|
|
150
|
+
class b extends u {
|
|
151
|
+
constructor({ message: e = "This Wallet does not support a capability that was not marked as optional." } = {}) {
|
|
152
|
+
super(5700, e), Object.defineProperty(this, "code", {
|
|
153
|
+
enumerable: !0,
|
|
154
|
+
configurable: !0,
|
|
155
|
+
writable: !0,
|
|
156
|
+
value: 5700
|
|
157
|
+
}), Object.defineProperty(this, "name", {
|
|
158
|
+
enumerable: !0,
|
|
159
|
+
configurable: !0,
|
|
160
|
+
writable: !0,
|
|
161
|
+
value: "Provider.UnsupportedNonOptionalCapabilityError"
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
Object.defineProperty(b, "code", {
|
|
166
|
+
enumerable: !0,
|
|
167
|
+
configurable: !0,
|
|
168
|
+
writable: !0,
|
|
169
|
+
value: 5700
|
|
170
|
+
});
|
|
171
|
+
class s extends u {
|
|
172
|
+
constructor({ message: e = "This Wallet does not support the requested chain ID." } = {}) {
|
|
173
|
+
super(5710, e), Object.defineProperty(this, "code", {
|
|
174
|
+
enumerable: !0,
|
|
175
|
+
configurable: !0,
|
|
176
|
+
writable: !0,
|
|
177
|
+
value: 5710
|
|
178
|
+
}), Object.defineProperty(this, "name", {
|
|
179
|
+
enumerable: !0,
|
|
180
|
+
configurable: !0,
|
|
181
|
+
writable: !0,
|
|
182
|
+
value: "Provider.UnsupportedChainIdError"
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
Object.defineProperty(s, "code", {
|
|
187
|
+
enumerable: !0,
|
|
188
|
+
configurable: !0,
|
|
189
|
+
writable: !0,
|
|
190
|
+
value: 5710
|
|
191
|
+
});
|
|
192
|
+
class f extends u {
|
|
193
|
+
constructor({ message: e = "There is already a bundle submitted with this ID." } = {}) {
|
|
194
|
+
super(5720, e), Object.defineProperty(this, "code", {
|
|
195
|
+
enumerable: !0,
|
|
196
|
+
configurable: !0,
|
|
197
|
+
writable: !0,
|
|
198
|
+
value: 5720
|
|
199
|
+
}), Object.defineProperty(this, "name", {
|
|
200
|
+
enumerable: !0,
|
|
201
|
+
configurable: !0,
|
|
202
|
+
writable: !0,
|
|
203
|
+
value: "Provider.DuplicateIdError"
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
Object.defineProperty(f, "code", {
|
|
208
|
+
enumerable: !0,
|
|
209
|
+
configurable: !0,
|
|
210
|
+
writable: !0,
|
|
211
|
+
value: 5720
|
|
212
|
+
});
|
|
213
|
+
class p extends u {
|
|
214
|
+
constructor({ message: e = "This bundle id is unknown / has not been submitted." } = {}) {
|
|
215
|
+
super(5730, e), Object.defineProperty(this, "code", {
|
|
216
|
+
enumerable: !0,
|
|
217
|
+
configurable: !0,
|
|
218
|
+
writable: !0,
|
|
219
|
+
value: 5730
|
|
220
|
+
}), Object.defineProperty(this, "name", {
|
|
221
|
+
enumerable: !0,
|
|
222
|
+
configurable: !0,
|
|
223
|
+
writable: !0,
|
|
224
|
+
value: "Provider.UnknownBundleIdError"
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
Object.defineProperty(p, "code", {
|
|
229
|
+
enumerable: !0,
|
|
230
|
+
configurable: !0,
|
|
231
|
+
writable: !0,
|
|
232
|
+
value: 5730
|
|
233
|
+
});
|
|
234
|
+
class h extends u {
|
|
235
|
+
constructor({ message: e = "The call bundle is too large for the Wallet to process." } = {}) {
|
|
236
|
+
super(5740, e), Object.defineProperty(this, "code", {
|
|
237
|
+
enumerable: !0,
|
|
238
|
+
configurable: !0,
|
|
239
|
+
writable: !0,
|
|
240
|
+
value: 5740
|
|
241
|
+
}), Object.defineProperty(this, "name", {
|
|
242
|
+
enumerable: !0,
|
|
243
|
+
configurable: !0,
|
|
244
|
+
writable: !0,
|
|
245
|
+
value: "Provider.BundleTooLargeError"
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
Object.defineProperty(h, "code", {
|
|
250
|
+
enumerable: !0,
|
|
251
|
+
configurable: !0,
|
|
252
|
+
writable: !0,
|
|
253
|
+
value: 5740
|
|
254
|
+
});
|
|
255
|
+
class m extends u {
|
|
256
|
+
constructor({ message: e = "The Wallet can support atomicity after an upgrade, but the user rejected the upgrade." } = {}) {
|
|
257
|
+
super(5750, e), Object.defineProperty(this, "code", {
|
|
258
|
+
enumerable: !0,
|
|
259
|
+
configurable: !0,
|
|
260
|
+
writable: !0,
|
|
261
|
+
value: 5750
|
|
262
|
+
}), Object.defineProperty(this, "name", {
|
|
263
|
+
enumerable: !0,
|
|
264
|
+
configurable: !0,
|
|
265
|
+
writable: !0,
|
|
266
|
+
value: "Provider.AtomicReadyWalletRejectedUpgradeError"
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
Object.defineProperty(m, "code", {
|
|
271
|
+
enumerable: !0,
|
|
272
|
+
configurable: !0,
|
|
273
|
+
writable: !0,
|
|
274
|
+
value: 5750
|
|
275
|
+
});
|
|
276
|
+
class w extends u {
|
|
277
|
+
constructor({ message: e = "The wallet does not support atomic execution but the request requires it." } = {}) {
|
|
278
|
+
super(5760, e), Object.defineProperty(this, "code", {
|
|
279
|
+
enumerable: !0,
|
|
280
|
+
configurable: !0,
|
|
281
|
+
writable: !0,
|
|
282
|
+
value: 5760
|
|
283
|
+
}), Object.defineProperty(this, "name", {
|
|
284
|
+
enumerable: !0,
|
|
285
|
+
configurable: !0,
|
|
286
|
+
writable: !0,
|
|
287
|
+
value: "Provider.AtomicityNotSupportedError"
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
Object.defineProperty(w, "code", {
|
|
292
|
+
enumerable: !0,
|
|
293
|
+
configurable: !0,
|
|
294
|
+
writable: !0,
|
|
295
|
+
value: 5760
|
|
296
|
+
});
|
|
297
|
+
function q(r, e = {}) {
|
|
298
|
+
const { includeEvents: t = !0 } = e;
|
|
299
|
+
if (!r)
|
|
300
|
+
throw new E();
|
|
301
|
+
return {
|
|
302
|
+
...t ? {
|
|
303
|
+
on: r.on?.bind(r),
|
|
304
|
+
removeListener: r.removeListener?.bind(r)
|
|
305
|
+
} : {},
|
|
306
|
+
async request(v) {
|
|
307
|
+
try {
|
|
308
|
+
const o = await r.request(v);
|
|
309
|
+
return o && typeof o == "object" && "jsonrpc" in o ? y(o) : o;
|
|
310
|
+
} catch (o) {
|
|
311
|
+
throw O(o);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
function O(r) {
|
|
317
|
+
const e = j(r);
|
|
318
|
+
if (e instanceof g) {
|
|
319
|
+
if (!e.data)
|
|
320
|
+
return e;
|
|
321
|
+
const { code: t } = e.data;
|
|
322
|
+
if (t === c.code)
|
|
323
|
+
return new c(e);
|
|
324
|
+
if (t === l.code)
|
|
325
|
+
return new l(e);
|
|
326
|
+
if (t === n.code)
|
|
327
|
+
return new n(e);
|
|
328
|
+
if (t === a.code)
|
|
329
|
+
return new a(e);
|
|
330
|
+
if (t === i.code)
|
|
331
|
+
return new i(e);
|
|
332
|
+
if (t === d.code)
|
|
333
|
+
return new d(e);
|
|
334
|
+
if (t === m.code)
|
|
335
|
+
return new m(e);
|
|
336
|
+
if (t === w.code)
|
|
337
|
+
return new w(e);
|
|
338
|
+
if (t === h.code)
|
|
339
|
+
return new h(e);
|
|
340
|
+
if (t === p.code)
|
|
341
|
+
return new p(e);
|
|
342
|
+
if (t === f.code)
|
|
343
|
+
return new f(e);
|
|
344
|
+
if (t === s.code)
|
|
345
|
+
return new s(e);
|
|
346
|
+
if (t === b.code)
|
|
347
|
+
return new b(e);
|
|
348
|
+
}
|
|
349
|
+
return e;
|
|
350
|
+
}
|
|
351
|
+
class E extends P {
|
|
352
|
+
constructor() {
|
|
353
|
+
super("`provider` is undefined."), Object.defineProperty(this, "name", {
|
|
354
|
+
enumerable: !0,
|
|
355
|
+
configurable: !0,
|
|
356
|
+
writable: !0,
|
|
357
|
+
value: "Provider.IsUndefinedError"
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
}
|
|
2
361
|
export {
|
|
3
|
-
|
|
362
|
+
m as AtomicReadyWalletRejectedUpgradeError,
|
|
363
|
+
w as AtomicityNotSupportedError,
|
|
364
|
+
h as BundleTooLargeError,
|
|
365
|
+
l as ChainDisconnectedError,
|
|
366
|
+
c as DisconnectedError,
|
|
367
|
+
f as DuplicateIdError,
|
|
368
|
+
E as IsUndefinedError,
|
|
369
|
+
u as ProviderRpcError,
|
|
370
|
+
d as SwitchChainError,
|
|
371
|
+
a as UnauthorizedError,
|
|
372
|
+
p as UnknownBundleIdError,
|
|
373
|
+
s as UnsupportedChainIdError,
|
|
374
|
+
i as UnsupportedMethodError,
|
|
375
|
+
b as UnsupportedNonOptionalCapabilityError,
|
|
376
|
+
n as UserRejectedRequestError,
|
|
377
|
+
q as from,
|
|
378
|
+
O as parseError
|
|
4
379
|
};
|