@coinbase/cdp-core 0.0.57 → 0.0.60
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.native.js +55 -54
- package/dist/esm/index.native103.js +1 -1
- package/dist/esm/index.native115.js +1 -1
- package/dist/esm/index.native127.js +1 -1
- package/dist/esm/index.native131.js +1 -1
- package/dist/esm/index.native140.js +74 -42
- package/dist/esm/index.native141.js +42 -74
- package/dist/esm/index.native146.js +7 -38
- package/dist/esm/index.native148.js +375 -67
- package/dist/esm/index.native149.js +832 -34
- package/dist/esm/index.native150.js +38 -20
- package/dist/esm/index.native151.js +2 -8
- package/dist/esm/index.native152.js +70 -2
- package/dist/esm/index.native153.js +30 -373
- package/dist/esm/index.native154.js +20 -832
- package/dist/esm/index.native16.js +8 -0
- package/dist/esm/index.native164.js +1 -1
- package/dist/esm/index.native165.js +2 -2
- package/dist/esm/index.native166.js +2 -2
- package/dist/esm/index.native167.js +2 -2
- package/dist/esm/index.native25.js +1 -1
- package/dist/esm/index.native29.js +10 -2
- package/dist/esm/index.native47.js +1 -1
- package/dist/esm/index.native7.js +52 -51
- package/dist/esm/index.web.js +59 -58
- package/dist/esm/index.web126.js +1 -1
- package/dist/esm/index.web130.js +1 -1
- package/dist/esm/index.web133.js +2 -79
- package/dist/esm/index.web134.js +109 -2
- package/dist/esm/index.web135.js +2 -109
- package/dist/esm/index.web136.js +79 -2
- package/dist/esm/index.web144.js +1 -1
- package/dist/esm/index.web145.js +7 -38
- package/dist/esm/index.web147.js +375 -67
- package/dist/esm/index.web148.js +832 -34
- package/dist/esm/index.web149.js +38 -20
- package/dist/esm/index.web15.js +8 -0
- package/dist/esm/index.web150.js +2 -8
- package/dist/esm/index.web151.js +70 -2
- package/dist/esm/index.web152.js +30 -373
- package/dist/esm/index.web153.js +20 -832
- package/dist/esm/index.web164.js +2 -2
- package/dist/esm/index.web165.js +2 -2
- package/dist/esm/index.web166.js +2 -2
- package/dist/esm/index.web23.js +1 -1
- package/dist/esm/index.web27.js +10 -2
- package/dist/esm/index.web40.js +1 -1
- package/dist/esm/index.web41.js +3 -3
- package/dist/esm/index.web46.js +377 -2
- package/dist/esm/index.web47.js +2 -379
- package/dist/esm/index.web48.js +65 -28
- package/dist/esm/index.web49.js +364 -28
- package/dist/esm/index.web50.js +4 -2
- package/dist/esm/index.web51.js +28 -65
- package/dist/esm/index.web52.js +28 -364
- package/dist/esm/index.web6.js +52 -51
- package/dist/esm/index.web97.js +1 -1
- package/dist/native/index.native.js +55 -54
- package/dist/native/index.native103.js +1 -1
- package/dist/native/index.native115.js +1 -1
- package/dist/native/index.native127.js +1 -1
- package/dist/native/index.native131.js +1 -1
- package/dist/native/index.native140.js +74 -42
- package/dist/native/index.native141.js +42 -74
- package/dist/native/index.native146.js +7 -38
- package/dist/native/index.native148.js +375 -67
- package/dist/native/index.native149.js +832 -34
- package/dist/native/index.native150.js +38 -20
- package/dist/native/index.native151.js +2 -8
- package/dist/native/index.native152.js +70 -2
- package/dist/native/index.native153.js +30 -373
- package/dist/native/index.native154.js +20 -832
- package/dist/native/index.native16.js +8 -0
- package/dist/native/index.native164.js +1 -1
- package/dist/native/index.native165.js +2 -2
- package/dist/native/index.native166.js +2 -2
- package/dist/native/index.native167.js +2 -2
- package/dist/native/index.native25.js +1 -1
- package/dist/native/index.native29.js +10 -2
- package/dist/native/index.native47.js +1 -1
- package/dist/native/index.native7.js +52 -51
- package/dist/native-types/auth/authManager.d.ts +1 -0
- package/dist/native-types/auth/types.d.ts +1 -0
- package/dist/native-types/core.d.ts +1 -0
- package/dist/native-types/mocks/mockAuthManager.d.ts +1 -0
- package/dist/native-types/types.d.ts +4 -0
- package/dist/native-types/version.d.ts +1 -1
- package/dist/types/auth/authManager.d.ts +1 -0
- package/dist/types/auth/types.d.ts +1 -0
- package/dist/types/core.d.ts +1 -0
- package/dist/types/mocks/mockAuthManager.d.ts +1 -0
- package/dist/types/types.d.ts +4 -0
- package/dist/types/version.d.ts +1 -1
- package/dist/web/index.web.js +59 -58
- package/dist/web/index.web126.js +1 -1
- package/dist/web/index.web130.js +1 -1
- package/dist/web/index.web133.js +2 -79
- package/dist/web/index.web134.js +109 -2
- package/dist/web/index.web135.js +2 -109
- package/dist/web/index.web136.js +79 -2
- package/dist/web/index.web144.js +1 -1
- package/dist/web/index.web145.js +7 -38
- package/dist/web/index.web147.js +375 -67
- package/dist/web/index.web148.js +832 -34
- package/dist/web/index.web149.js +38 -20
- package/dist/web/index.web15.js +8 -0
- package/dist/web/index.web150.js +2 -8
- package/dist/web/index.web151.js +70 -2
- package/dist/web/index.web152.js +30 -373
- package/dist/web/index.web153.js +20 -832
- package/dist/web/index.web164.js +2 -2
- package/dist/web/index.web165.js +2 -2
- package/dist/web/index.web166.js +2 -2
- package/dist/web/index.web23.js +1 -1
- package/dist/web/index.web27.js +10 -2
- package/dist/web/index.web40.js +1 -1
- package/dist/web/index.web41.js +3 -3
- package/dist/web/index.web46.js +377 -2
- package/dist/web/index.web47.js +2 -379
- package/dist/web/index.web48.js +65 -28
- package/dist/web/index.web49.js +364 -28
- package/dist/web/index.web50.js +4 -2
- package/dist/web/index.web51.js +28 -65
- package/dist/web/index.web52.js +28 -364
- package/dist/web/index.web6.js +52 -51
- package/dist/web/index.web97.js +1 -1
- package/dist/web-types/auth/authManager.d.ts +1 -0
- package/dist/web-types/auth/types.d.ts +1 -0
- package/dist/web-types/core.d.ts +1 -0
- package/dist/web-types/mocks/mockAuthManager.d.ts +1 -0
- package/dist/web-types/types.d.ts +4 -0
- package/dist/web-types/version.d.ts +1 -1
- package/package.json +2 -2
package/dist/web/index.web52.js
CHANGED
|
@@ -1,367 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { handleChainId as t } from "./index.web113.js";
|
|
2
|
+
import { handleDisconnect as e } from "./index.web114.js";
|
|
3
|
+
import { handleSwitchEthereumChain as a } from "./index.web115.js";
|
|
4
|
+
import { handleAccounts as n } from "./index.web116.js";
|
|
5
|
+
import { handleEthSign as o } from "./index.web117.js";
|
|
6
|
+
import { handleGetCallsStatus as r } from "./index.web118.js";
|
|
7
|
+
import { handleGetCapabilities as i } from "./index.web119.js";
|
|
8
|
+
import { handlePersonalSign as l } from "./index.web120.js";
|
|
9
|
+
import { handleRequestAccounts as h } from "./index.web121.js";
|
|
10
|
+
import { handleSendCalls as m } from "./index.web122.js";
|
|
11
|
+
import { handleSendTransaction as s } from "./index.web123.js";
|
|
12
|
+
import { handleSignTypedData as d } from "./index.web124.js";
|
|
13
|
+
function E() {
|
|
14
|
+
return {
|
|
15
|
+
eth_accounts: n,
|
|
16
|
+
eth_requestAccounts: h,
|
|
17
|
+
personal_sign: l,
|
|
18
|
+
eth_sendTransaction: s,
|
|
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
|
+
};
|
|
8
28
|
}
|
|
9
|
-
function P(a) {
|
|
10
|
-
const e = a;
|
|
11
|
-
if (e instanceof Error && !("code" in e))
|
|
12
|
-
return new u({
|
|
13
|
-
cause: e,
|
|
14
|
-
data: e,
|
|
15
|
-
message: e.message
|
|
16
|
-
});
|
|
17
|
-
const { code: r } = e;
|
|
18
|
-
return r === u.code ? new u(e) : r === n.code ? new n(e) : r === m.code ? new m(e) : r === f.code ? new f(e) : r === d.code ? new d(e) : r === p.code ? new p(e) : r === l.code ? new l(e) : r === g.code ? new g(e) : r === c.code ? new c(e) : r === s.code ? new s(e) : r === i.code ? new i(e) : r === b.code ? new b(e) : new u({
|
|
19
|
-
cause: e instanceof Error ? e : void 0,
|
|
20
|
-
data: e,
|
|
21
|
-
message: e.message
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
class t extends Error {
|
|
25
|
-
constructor(e) {
|
|
26
|
-
const { cause: r, code: o, message: w, data: v } = e;
|
|
27
|
-
super(w, { cause: r }), Object.defineProperty(this, "name", {
|
|
28
|
-
enumerable: !0,
|
|
29
|
-
configurable: !0,
|
|
30
|
-
writable: !0,
|
|
31
|
-
value: "RpcResponse.BaseError"
|
|
32
|
-
}), Object.defineProperty(this, "cause", {
|
|
33
|
-
enumerable: !0,
|
|
34
|
-
configurable: !0,
|
|
35
|
-
writable: !0,
|
|
36
|
-
value: void 0
|
|
37
|
-
}), Object.defineProperty(this, "code", {
|
|
38
|
-
enumerable: !0,
|
|
39
|
-
configurable: !0,
|
|
40
|
-
writable: !0,
|
|
41
|
-
value: void 0
|
|
42
|
-
}), Object.defineProperty(this, "data", {
|
|
43
|
-
enumerable: !0,
|
|
44
|
-
configurable: !0,
|
|
45
|
-
writable: !0,
|
|
46
|
-
value: void 0
|
|
47
|
-
}), this.cause = r, this.code = o, this.data = v;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
class n extends t {
|
|
51
|
-
constructor(e = {}) {
|
|
52
|
-
super({
|
|
53
|
-
code: n.code,
|
|
54
|
-
data: e.data,
|
|
55
|
-
message: e.message ?? "Missing or invalid parameters."
|
|
56
|
-
}), Object.defineProperty(this, "code", {
|
|
57
|
-
enumerable: !0,
|
|
58
|
-
configurable: !0,
|
|
59
|
-
writable: !0,
|
|
60
|
-
value: -32e3
|
|
61
|
-
}), Object.defineProperty(this, "name", {
|
|
62
|
-
enumerable: !0,
|
|
63
|
-
configurable: !0,
|
|
64
|
-
writable: !0,
|
|
65
|
-
value: "RpcResponse.InvalidInputError"
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
Object.defineProperty(n, "code", {
|
|
70
|
-
enumerable: !0,
|
|
71
|
-
configurable: !0,
|
|
72
|
-
writable: !0,
|
|
73
|
-
value: -32e3
|
|
74
|
-
});
|
|
75
|
-
class c extends t {
|
|
76
|
-
constructor(e = {}) {
|
|
77
|
-
super({
|
|
78
|
-
code: c.code,
|
|
79
|
-
data: e.data,
|
|
80
|
-
message: e.message ?? "Requested resource not found."
|
|
81
|
-
}), Object.defineProperty(this, "code", {
|
|
82
|
-
enumerable: !0,
|
|
83
|
-
configurable: !0,
|
|
84
|
-
writable: !0,
|
|
85
|
-
value: -32001
|
|
86
|
-
}), Object.defineProperty(this, "name", {
|
|
87
|
-
enumerable: !0,
|
|
88
|
-
configurable: !0,
|
|
89
|
-
writable: !0,
|
|
90
|
-
value: "RpcResponse.ResourceNotFoundError"
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
Object.defineProperty(c, "code", {
|
|
95
|
-
enumerable: !0,
|
|
96
|
-
configurable: !0,
|
|
97
|
-
writable: !0,
|
|
98
|
-
value: -32001
|
|
99
|
-
});
|
|
100
|
-
class s extends t {
|
|
101
|
-
constructor(e = {}) {
|
|
102
|
-
super({
|
|
103
|
-
code: s.code,
|
|
104
|
-
data: e.data,
|
|
105
|
-
message: e.message ?? "Requested resource not available."
|
|
106
|
-
}), Object.defineProperty(this, "code", {
|
|
107
|
-
enumerable: !0,
|
|
108
|
-
configurable: !0,
|
|
109
|
-
writable: !0,
|
|
110
|
-
value: -32002
|
|
111
|
-
}), Object.defineProperty(this, "name", {
|
|
112
|
-
enumerable: !0,
|
|
113
|
-
configurable: !0,
|
|
114
|
-
writable: !0,
|
|
115
|
-
value: "RpcResponse.ResourceUnavailableError"
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
Object.defineProperty(s, "code", {
|
|
120
|
-
enumerable: !0,
|
|
121
|
-
configurable: !0,
|
|
122
|
-
writable: !0,
|
|
123
|
-
value: -32002
|
|
124
|
-
});
|
|
125
|
-
class i extends t {
|
|
126
|
-
constructor(e = {}) {
|
|
127
|
-
super({
|
|
128
|
-
code: i.code,
|
|
129
|
-
data: e.data,
|
|
130
|
-
message: e.message ?? "Transaction creation failed."
|
|
131
|
-
}), Object.defineProperty(this, "code", {
|
|
132
|
-
enumerable: !0,
|
|
133
|
-
configurable: !0,
|
|
134
|
-
writable: !0,
|
|
135
|
-
value: -32003
|
|
136
|
-
}), Object.defineProperty(this, "name", {
|
|
137
|
-
enumerable: !0,
|
|
138
|
-
configurable: !0,
|
|
139
|
-
writable: !0,
|
|
140
|
-
value: "RpcResponse.TransactionRejectedError"
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
Object.defineProperty(i, "code", {
|
|
145
|
-
enumerable: !0,
|
|
146
|
-
configurable: !0,
|
|
147
|
-
writable: !0,
|
|
148
|
-
value: -32003
|
|
149
|
-
});
|
|
150
|
-
class l extends t {
|
|
151
|
-
constructor(e = {}) {
|
|
152
|
-
super({
|
|
153
|
-
code: l.code,
|
|
154
|
-
data: e.data,
|
|
155
|
-
message: e.message ?? "Method is not implemented."
|
|
156
|
-
}), Object.defineProperty(this, "code", {
|
|
157
|
-
enumerable: !0,
|
|
158
|
-
configurable: !0,
|
|
159
|
-
writable: !0,
|
|
160
|
-
value: -32004
|
|
161
|
-
}), Object.defineProperty(this, "name", {
|
|
162
|
-
enumerable: !0,
|
|
163
|
-
configurable: !0,
|
|
164
|
-
writable: !0,
|
|
165
|
-
value: "RpcResponse.MethodNotSupportedError"
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
Object.defineProperty(l, "code", {
|
|
170
|
-
enumerable: !0,
|
|
171
|
-
configurable: !0,
|
|
172
|
-
writable: !0,
|
|
173
|
-
value: -32004
|
|
174
|
-
});
|
|
175
|
-
class d extends t {
|
|
176
|
-
constructor(e = {}) {
|
|
177
|
-
super({
|
|
178
|
-
code: d.code,
|
|
179
|
-
data: e.data,
|
|
180
|
-
message: e.message ?? "Rate limit exceeded."
|
|
181
|
-
}), Object.defineProperty(this, "code", {
|
|
182
|
-
enumerable: !0,
|
|
183
|
-
configurable: !0,
|
|
184
|
-
writable: !0,
|
|
185
|
-
value: -32005
|
|
186
|
-
}), Object.defineProperty(this, "name", {
|
|
187
|
-
enumerable: !0,
|
|
188
|
-
configurable: !0,
|
|
189
|
-
writable: !0,
|
|
190
|
-
value: "RpcResponse.LimitExceededError"
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
Object.defineProperty(d, "code", {
|
|
195
|
-
enumerable: !0,
|
|
196
|
-
configurable: !0,
|
|
197
|
-
writable: !0,
|
|
198
|
-
value: -32005
|
|
199
|
-
});
|
|
200
|
-
class b extends t {
|
|
201
|
-
constructor(e = {}) {
|
|
202
|
-
super({
|
|
203
|
-
code: b.code,
|
|
204
|
-
data: e.data,
|
|
205
|
-
message: e.message ?? "JSON-RPC version not supported."
|
|
206
|
-
}), Object.defineProperty(this, "code", {
|
|
207
|
-
enumerable: !0,
|
|
208
|
-
configurable: !0,
|
|
209
|
-
writable: !0,
|
|
210
|
-
value: -32006
|
|
211
|
-
}), Object.defineProperty(this, "name", {
|
|
212
|
-
enumerable: !0,
|
|
213
|
-
configurable: !0,
|
|
214
|
-
writable: !0,
|
|
215
|
-
value: "RpcResponse.VersionNotSupportedError"
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
Object.defineProperty(b, "code", {
|
|
220
|
-
enumerable: !0,
|
|
221
|
-
configurable: !0,
|
|
222
|
-
writable: !0,
|
|
223
|
-
value: -32006
|
|
224
|
-
});
|
|
225
|
-
class f extends t {
|
|
226
|
-
constructor(e = {}) {
|
|
227
|
-
super({
|
|
228
|
-
code: f.code,
|
|
229
|
-
data: e.data,
|
|
230
|
-
message: e.message ?? "Input is not a valid JSON-RPC request."
|
|
231
|
-
}), Object.defineProperty(this, "code", {
|
|
232
|
-
enumerable: !0,
|
|
233
|
-
configurable: !0,
|
|
234
|
-
writable: !0,
|
|
235
|
-
value: -32600
|
|
236
|
-
}), Object.defineProperty(this, "name", {
|
|
237
|
-
enumerable: !0,
|
|
238
|
-
configurable: !0,
|
|
239
|
-
writable: !0,
|
|
240
|
-
value: "RpcResponse.InvalidRequestError"
|
|
241
|
-
});
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
Object.defineProperty(f, "code", {
|
|
245
|
-
enumerable: !0,
|
|
246
|
-
configurable: !0,
|
|
247
|
-
writable: !0,
|
|
248
|
-
value: -32600
|
|
249
|
-
});
|
|
250
|
-
class p extends t {
|
|
251
|
-
constructor(e = {}) {
|
|
252
|
-
super({
|
|
253
|
-
code: p.code,
|
|
254
|
-
data: e.data,
|
|
255
|
-
message: e.message ?? "Method does not exist."
|
|
256
|
-
}), Object.defineProperty(this, "code", {
|
|
257
|
-
enumerable: !0,
|
|
258
|
-
configurable: !0,
|
|
259
|
-
writable: !0,
|
|
260
|
-
value: -32601
|
|
261
|
-
}), Object.defineProperty(this, "name", {
|
|
262
|
-
enumerable: !0,
|
|
263
|
-
configurable: !0,
|
|
264
|
-
writable: !0,
|
|
265
|
-
value: "RpcResponse.MethodNotFoundError"
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
Object.defineProperty(p, "code", {
|
|
270
|
-
enumerable: !0,
|
|
271
|
-
configurable: !0,
|
|
272
|
-
writable: !0,
|
|
273
|
-
value: -32601
|
|
274
|
-
});
|
|
275
|
-
class m extends t {
|
|
276
|
-
constructor(e = {}) {
|
|
277
|
-
super({
|
|
278
|
-
code: m.code,
|
|
279
|
-
data: e.data,
|
|
280
|
-
message: e.message ?? "Invalid method parameters."
|
|
281
|
-
}), Object.defineProperty(this, "code", {
|
|
282
|
-
enumerable: !0,
|
|
283
|
-
configurable: !0,
|
|
284
|
-
writable: !0,
|
|
285
|
-
value: -32602
|
|
286
|
-
}), Object.defineProperty(this, "name", {
|
|
287
|
-
enumerable: !0,
|
|
288
|
-
configurable: !0,
|
|
289
|
-
writable: !0,
|
|
290
|
-
value: "RpcResponse.InvalidParamsError"
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
Object.defineProperty(m, "code", {
|
|
295
|
-
enumerable: !0,
|
|
296
|
-
configurable: !0,
|
|
297
|
-
writable: !0,
|
|
298
|
-
value: -32602
|
|
299
|
-
});
|
|
300
|
-
class u extends t {
|
|
301
|
-
constructor(e = {}) {
|
|
302
|
-
super({
|
|
303
|
-
cause: e.cause,
|
|
304
|
-
code: u.code,
|
|
305
|
-
data: e.data,
|
|
306
|
-
message: e.message ?? "Internal JSON-RPC error."
|
|
307
|
-
}), Object.defineProperty(this, "code", {
|
|
308
|
-
enumerable: !0,
|
|
309
|
-
configurable: !0,
|
|
310
|
-
writable: !0,
|
|
311
|
-
value: -32603
|
|
312
|
-
}), Object.defineProperty(this, "name", {
|
|
313
|
-
enumerable: !0,
|
|
314
|
-
configurable: !0,
|
|
315
|
-
writable: !0,
|
|
316
|
-
value: "RpcResponse.InternalError"
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
Object.defineProperty(u, "code", {
|
|
321
|
-
enumerable: !0,
|
|
322
|
-
configurable: !0,
|
|
323
|
-
writable: !0,
|
|
324
|
-
value: -32603
|
|
325
|
-
});
|
|
326
|
-
class g extends t {
|
|
327
|
-
constructor(e = {}) {
|
|
328
|
-
super({
|
|
329
|
-
code: g.code,
|
|
330
|
-
data: e.data,
|
|
331
|
-
message: e.message ?? "Failed to parse JSON-RPC response."
|
|
332
|
-
}), Object.defineProperty(this, "code", {
|
|
333
|
-
enumerable: !0,
|
|
334
|
-
configurable: !0,
|
|
335
|
-
writable: !0,
|
|
336
|
-
value: -32700
|
|
337
|
-
}), Object.defineProperty(this, "name", {
|
|
338
|
-
enumerable: !0,
|
|
339
|
-
configurable: !0,
|
|
340
|
-
writable: !0,
|
|
341
|
-
value: "RpcResponse.ParseError"
|
|
342
|
-
});
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
Object.defineProperty(g, "code", {
|
|
346
|
-
enumerable: !0,
|
|
347
|
-
configurable: !0,
|
|
348
|
-
writable: !0,
|
|
349
|
-
value: -32700
|
|
350
|
-
});
|
|
351
29
|
export {
|
|
352
|
-
|
|
353
|
-
u as InternalError,
|
|
354
|
-
n as InvalidInputError,
|
|
355
|
-
m as InvalidParamsError,
|
|
356
|
-
f as InvalidRequestError,
|
|
357
|
-
d as LimitExceededError,
|
|
358
|
-
p as MethodNotFoundError,
|
|
359
|
-
l as MethodNotSupportedError,
|
|
360
|
-
g as ParseError,
|
|
361
|
-
c as ResourceNotFoundError,
|
|
362
|
-
s as ResourceUnavailableError,
|
|
363
|
-
i as TransactionRejectedError,
|
|
364
|
-
b as VersionNotSupportedError,
|
|
365
|
-
O as parse,
|
|
366
|
-
P as parseError
|
|
30
|
+
E as createSmartAccountHandlers
|
|
367
31
|
};
|
package/dist/web/index.web6.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { b as m } from "./index.web21.js";
|
|
2
|
-
import { configureCdpApiClient as C, setAuthManager as M, initiateAuthentication as
|
|
2
|
+
import { configureCdpApiClient as C, setAuthManager as M, initiateAuthentication as T, createEndUserEvmAccount as O, createEndUserEvmSmartAccount as A, createEndUserSolanaAccount as P, verifyEmailAuthentication as b, verifySmsAuthentication as x, verifyOAuthCode as j, signEvmHashWithEndUserAccount as K, signEvmTransactionWithEndUserAccount as W, signSolanaTransactionWithEndUserAccount as H, sendEvmTransactionWithEndUserAccount as B, sendSolanaTransactionWithEndUserAccount as D, signEvmMessageWithEndUserAccount as L, signSolanaMessageWithEndUserAccount as N, signEvmTypedDataWithEndUserAccount as F, sendUserOperationWithEndUserAccount as z, getUserOperationWithEndUserAccount as R, exportEndUserEvmAccount as $, exportEndUserSolanaAccount as V } from "@coinbase/cdp-api-client";
|
|
3
3
|
import { Analytics as c } from "./index.web22.js";
|
|
4
4
|
import "./index.web23.js";
|
|
5
5
|
import { Keypair as v } from "@solana/web3.js";
|
|
6
6
|
import w from "bs58";
|
|
7
7
|
import { AuthManager as q } from "./index.web15.js";
|
|
8
8
|
import { OAuthManager as G } from "./index.web24.js";
|
|
9
|
-
import { toAuthState as
|
|
9
|
+
import { toAuthState as p } from "./index.web25.js";
|
|
10
10
|
import { withAuth as u } from "./index.web26.js";
|
|
11
11
|
import { MockAuthManager as J } from "./index.web27.js";
|
|
12
12
|
import { MockOAuthManager as Q } from "./index.web28.js";
|
|
13
13
|
import { mockUser as k } from "./index.web29.js";
|
|
14
14
|
import { getPlatformServices as g, getPlatformCrypto as _ } from "./index.web2.js";
|
|
15
15
|
import { isChainSupportedForCDPSends as X } from "./index.web30.js";
|
|
16
|
-
import { getConfig as a, setCoreAuthManager as
|
|
16
|
+
import { getConfig as a, setCoreAuthManager as E, setCoreOAuthManager as I, getCoreAuthManager as o, getCoreOAuthManager as Y, setConfig as Z } from "./index.web31.js";
|
|
17
17
|
import "viem";
|
|
18
18
|
import { serializeTransaction as U } from "./index.web32.js";
|
|
19
19
|
const we = async (e) => {
|
|
@@ -27,7 +27,7 @@ const we = async (e) => {
|
|
|
27
27
|
r = !0;
|
|
28
28
|
}
|
|
29
29
|
if (Z(e), a().useMock) {
|
|
30
|
-
|
|
30
|
+
E(new J(a().projectId)), I(new Q());
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
33
|
let n;
|
|
@@ -54,18 +54,18 @@ const we = async (e) => {
|
|
|
54
54
|
refreshTokenStorage: n
|
|
55
55
|
}), r) {
|
|
56
56
|
const t = new G();
|
|
57
|
-
|
|
57
|
+
I(t);
|
|
58
58
|
const s = new q(a().projectId);
|
|
59
|
-
|
|
59
|
+
E(s), M(s);
|
|
60
60
|
}
|
|
61
61
|
await o().ensureInitialized();
|
|
62
62
|
}, ke = async (e) => (c.sendActionCallEvent({ name: "sign_in_with_email" }), f({
|
|
63
63
|
email: e.email,
|
|
64
64
|
type: "email"
|
|
65
|
-
})),
|
|
65
|
+
})), Ee = async (e) => (c.sendActionCallEvent({ name: "sign_in_with_sms" }), f({
|
|
66
66
|
phoneNumber: e.phoneNumber,
|
|
67
67
|
type: "sms"
|
|
68
|
-
})),
|
|
68
|
+
})), Ie = async (e) => {
|
|
69
69
|
c.sendActionCallEvent({ name: "sign_in_with_oauth" });
|
|
70
70
|
const r = g().oauth.getRedirectUrl();
|
|
71
71
|
if (a().useMock) {
|
|
@@ -85,12 +85,12 @@ const we = async (e) => {
|
|
|
85
85
|
)), _e = async (e) => (c.sendActionCallEvent({ name: "verify_sms_otp" }), y(
|
|
86
86
|
e,
|
|
87
87
|
"Mock SMS OTP verified",
|
|
88
|
-
(r, n) =>
|
|
88
|
+
(r, n) => x(r, n)
|
|
89
89
|
)), Ue = async (e) => (c.sendActionCallEvent({ name: "verify_oauth" }), y(
|
|
90
90
|
e,
|
|
91
91
|
"Mock OAuth code verified",
|
|
92
|
-
(r, n) =>
|
|
93
|
-
)), Ce = async () => (c.sendActionCallEvent({ name: "get_current_user" }), o().getUser()), Me = async () => (c.sendActionCallEvent({ name: "is_signed_in" }), o().isSignedIn()),
|
|
92
|
+
(r, n) => j(r, n.providerType, n)
|
|
93
|
+
)), Ce = async () => (c.sendActionCallEvent({ name: "get_current_user" }), o().getUser()), Me = async () => (c.sendActionCallEvent({ name: "is_signed_in" }), o().isSignedIn()), Te = async () => {
|
|
94
94
|
if (c.sendActionCallEvent({ name: "sign_out" }), a().useMock) {
|
|
95
95
|
await o().signOut();
|
|
96
96
|
return;
|
|
@@ -98,9 +98,9 @@ const we = async (e) => {
|
|
|
98
98
|
if (!await o().isSignedIn())
|
|
99
99
|
throw new Error("User not signed in");
|
|
100
100
|
await o().signOut();
|
|
101
|
-
},
|
|
101
|
+
}, Oe = async () => (c.sendActionCallEvent({ name: "get_access_token" }), o().getToken()), Pe = async () => (c.sendActionCallEvent({ name: "get_access_token_expiration" }), o().getTokenExpiration()), be = (e) => {
|
|
102
102
|
o().addAuthStateChangeCallback(e);
|
|
103
|
-
},
|
|
103
|
+
}, xe = (e) => {
|
|
104
104
|
Y().addOAuthStateChangeCallback(e);
|
|
105
105
|
}, je = async (e) => (c.sendActionCallEvent({ name: "sign_evm_hash" }), a().useMock ? { signature: "0x0" } : u(e, o(), async ({ user: r, walletSecretId: n }) => ({
|
|
106
106
|
signature: (await K(a().projectId, r.userId, {
|
|
@@ -108,7 +108,7 @@ const we = async (e) => {
|
|
|
108
108
|
address: e.evmAccount,
|
|
109
109
|
walletSecretId: n
|
|
110
110
|
})).signature
|
|
111
|
-
}))),
|
|
111
|
+
}))), Ke = async (e) => (c.sendActionCallEvent({ name: "sign_evm_transaction" }), a().useMock ? { signedTransaction: "0x0" } : u(e, o(), async ({ user: r, walletSecretId: n }) => {
|
|
112
112
|
const t = U(e.transaction);
|
|
113
113
|
return {
|
|
114
114
|
signedTransaction: (await W(
|
|
@@ -121,7 +121,7 @@ const we = async (e) => {
|
|
|
121
121
|
}
|
|
122
122
|
)).signedTransaction
|
|
123
123
|
};
|
|
124
|
-
})),
|
|
124
|
+
})), We = async (e) => (c.sendActionCallEvent({ name: "sign_solana_transaction" }), a().useMock ? { signedTransaction: "mock-signed-transaction" } : u(e, o(), async ({ user: r, walletSecretId: n }) => ({
|
|
125
125
|
signedTransaction: (await H(
|
|
126
126
|
a().projectId,
|
|
127
127
|
r.userId,
|
|
@@ -131,7 +131,7 @@ const we = async (e) => {
|
|
|
131
131
|
walletSecretId: n
|
|
132
132
|
}
|
|
133
133
|
)).signedTransaction
|
|
134
|
-
}))),
|
|
134
|
+
}))), He = async (e) => {
|
|
135
135
|
if (c.sendActionCallEvent({ name: "send_evm_transaction" }), !X(e.network))
|
|
136
136
|
throw new Error(`Chain ${e.network} is not supported by the CDP Apis`);
|
|
137
137
|
if (a().useMock)
|
|
@@ -149,7 +149,7 @@ const we = async (e) => {
|
|
|
149
149
|
}
|
|
150
150
|
)).transactionHash
|
|
151
151
|
}));
|
|
152
|
-
},
|
|
152
|
+
}, Be = async (e) => (c.sendActionCallEvent({ name: "send_solana_transaction" }), a().useMock ? { transactionSignature: "mock-signature" } : u(e, o(), async ({ user: r, walletSecretId: n }) => ({
|
|
153
153
|
transactionSignature: (await D(
|
|
154
154
|
a().projectId,
|
|
155
155
|
r.userId,
|
|
@@ -160,13 +160,13 @@ const we = async (e) => {
|
|
|
160
160
|
network: e.network
|
|
161
161
|
}
|
|
162
162
|
)).transactionSignature
|
|
163
|
-
}))),
|
|
163
|
+
}))), De = async (e) => (c.sendActionCallEvent({ name: "sign_evm_message" }), a().useMock ? { signature: "0x0" } : u(e, o(), async ({ user: r, walletSecretId: n }) => ({
|
|
164
164
|
signature: (await L(a().projectId, r.userId, {
|
|
165
165
|
message: e.message,
|
|
166
166
|
address: e.evmAccount,
|
|
167
167
|
walletSecretId: n
|
|
168
168
|
})).signature
|
|
169
|
-
}))),
|
|
169
|
+
}))), Le = async (e) => (c.sendActionCallEvent({ name: "sign_solana_message" }), a().useMock ? { signature: "mockSignature" } : u(e, o(), async ({ user: r, walletSecretId: n }) => ({
|
|
170
170
|
signature: (await N(
|
|
171
171
|
a().projectId,
|
|
172
172
|
r.userId,
|
|
@@ -176,13 +176,13 @@ const we = async (e) => {
|
|
|
176
176
|
walletSecretId: n
|
|
177
177
|
}
|
|
178
178
|
)).signature
|
|
179
|
-
}))),
|
|
179
|
+
}))), Ne = async (e) => (c.sendActionCallEvent({ name: "sign_evm_typed_data" }), a().useMock ? { signature: "0x0" } : u(e, o(), async ({ user: r, walletSecretId: n }) => ({
|
|
180
180
|
signature: (await F(a().projectId, r.userId, {
|
|
181
181
|
typedData: e.typedData,
|
|
182
182
|
address: e.evmAccount,
|
|
183
183
|
walletSecretId: n
|
|
184
184
|
})).signature
|
|
185
|
-
}))),
|
|
185
|
+
}))), Fe = async (e) => (c.sendActionCallEvent({ name: "send_user_operation" }), a().useMock ? {
|
|
186
186
|
userOperationHash: "0x1234567890123456789012345678901234567890123456789012345678901234"
|
|
187
187
|
} : u(e, o(), async ({ user: r, walletSecretId: n }) => ({
|
|
188
188
|
userOperationHash: (await z(
|
|
@@ -201,7 +201,7 @@ const we = async (e) => {
|
|
|
201
201
|
paymasterUrl: e.paymasterUrl
|
|
202
202
|
}
|
|
203
203
|
)).userOpHash
|
|
204
|
-
}))),
|
|
204
|
+
}))), ze = async (e) => (c.sendActionCallEvent({ name: "get_user_operation" }), a().useMock ? {
|
|
205
205
|
userOpHash: e.userOperationHash,
|
|
206
206
|
network: e.network,
|
|
207
207
|
calls: [
|
|
@@ -219,7 +219,7 @@ const we = async (e) => {
|
|
|
219
219
|
r.userId,
|
|
220
220
|
e.evmSmartAccount,
|
|
221
221
|
e.userOperationHash
|
|
222
|
-
))),
|
|
222
|
+
))), Re = async (e) => {
|
|
223
223
|
if (c.sendActionCallEvent({ name: "export_evm_account" }), a().useMock)
|
|
224
224
|
return {
|
|
225
225
|
privateKey: m.Buffer.from("mock-private-key").toString("hex")
|
|
@@ -238,7 +238,7 @@ const we = async (e) => {
|
|
|
238
238
|
privateKey: m.Buffer.from(d).toString("hex")
|
|
239
239
|
};
|
|
240
240
|
});
|
|
241
|
-
},
|
|
241
|
+
}, $e = async (e) => {
|
|
242
242
|
if (c.sendActionCallEvent({ name: "export_solana_account" }), a().useMock) {
|
|
243
243
|
const t = m.Buffer.from("mock-private-key").subarray(0, 32), s = m.Buffer.alloc(32);
|
|
244
244
|
t.copy(s);
|
|
@@ -256,9 +256,9 @@ const we = async (e) => {
|
|
|
256
256
|
}), d = await r.decryptWithPrivateKey(
|
|
257
257
|
n.privateKey,
|
|
258
258
|
i.encryptedPrivateKey
|
|
259
|
-
), l = v.fromSeed(new Uint8Array(d)),
|
|
259
|
+
), l = v.fromSeed(new Uint8Array(d)), h = m.Buffer.concat([l.secretKey.subarray(0, 32), l.publicKey.toBytes()]);
|
|
260
260
|
return {
|
|
261
|
-
privateKey: w.encode(
|
|
261
|
+
privateKey: w.encode(h)
|
|
262
262
|
};
|
|
263
263
|
});
|
|
264
264
|
}, f = async (e) => {
|
|
@@ -272,7 +272,7 @@ const we = async (e) => {
|
|
|
272
272
|
};
|
|
273
273
|
if (await o().isSignedIn())
|
|
274
274
|
throw new Error("User is already authenticated. Please sign out first.");
|
|
275
|
-
const n = await
|
|
275
|
+
const n = await T(a().projectId, e);
|
|
276
276
|
return "authUrl" in n ? {
|
|
277
277
|
flowId: n.flowId,
|
|
278
278
|
authUrl: n.authUrl
|
|
@@ -292,7 +292,7 @@ const we = async (e) => {
|
|
|
292
292
|
isNewUser: !1
|
|
293
293
|
};
|
|
294
294
|
const t = await n(a().projectId, e);
|
|
295
|
-
let s =
|
|
295
|
+
let s = p(
|
|
296
296
|
t.accessToken,
|
|
297
297
|
t.validUntil,
|
|
298
298
|
t.endUser
|
|
@@ -315,22 +315,22 @@ const we = async (e) => {
|
|
|
315
315
|
if (!r.user.evmAccounts || r.user.evmAccounts.length === 0)
|
|
316
316
|
try {
|
|
317
317
|
const s = await o().getWalletSecretId();
|
|
318
|
-
let i = await
|
|
318
|
+
let i = await O(a().projectId, r.user.userId, {
|
|
319
319
|
walletSecretId: s
|
|
320
320
|
}), d = !1;
|
|
321
321
|
const l = a().ethereum;
|
|
322
322
|
if (l?.createOnLogin === "smart" && (d = l.enableSpendPermissions ?? !1), n === "smart") {
|
|
323
|
-
const [
|
|
323
|
+
const [h] = i.evmAccounts;
|
|
324
324
|
i = await A(
|
|
325
325
|
a().projectId,
|
|
326
326
|
r.user.userId,
|
|
327
327
|
{
|
|
328
|
-
owner:
|
|
328
|
+
owner: h,
|
|
329
329
|
enableSpendPermissions: d
|
|
330
330
|
}
|
|
331
331
|
);
|
|
332
332
|
}
|
|
333
|
-
t =
|
|
333
|
+
t = p(e.accessToken, e.validUntil, i), await o().setAuthState(t);
|
|
334
334
|
} catch (s) {
|
|
335
335
|
throw new Error(`Failed to create EVM account: ${s}`);
|
|
336
336
|
}
|
|
@@ -345,7 +345,7 @@ const we = async (e) => {
|
|
|
345
345
|
// Defaulting to false until the feature is ready.
|
|
346
346
|
}
|
|
347
347
|
);
|
|
348
|
-
t =
|
|
348
|
+
t = p(e.accessToken, e.validUntil, i), await o().setAuthState(t);
|
|
349
349
|
} catch (s) {
|
|
350
350
|
throw new Error(`Failed to create EVM Smart Account: ${s}`);
|
|
351
351
|
}
|
|
@@ -361,35 +361,36 @@ const we = async (e) => {
|
|
|
361
361
|
walletSecretId: t
|
|
362
362
|
}
|
|
363
363
|
);
|
|
364
|
-
n =
|
|
364
|
+
n = p(e.accessToken, e.validUntil, s), await o().setAuthState(n);
|
|
365
365
|
} catch (t) {
|
|
366
366
|
throw new Error(`Failed to create Solana account: ${t}`);
|
|
367
367
|
}
|
|
368
368
|
return n;
|
|
369
369
|
};
|
|
370
370
|
export {
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
371
|
+
Re as exportEvmAccount,
|
|
372
|
+
$e as exportSolanaAccount,
|
|
373
|
+
Oe as getAccessToken,
|
|
374
|
+
Pe as getAccessTokenExpiration,
|
|
374
375
|
Ce as getCurrentUser,
|
|
375
|
-
|
|
376
|
+
ze as getUserOperation,
|
|
376
377
|
we as initialize,
|
|
377
378
|
Me as isSignedIn,
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
379
|
+
be as onAuthStateChange,
|
|
380
|
+
xe as onOAuthStateChange,
|
|
381
|
+
He as sendEvmTransaction,
|
|
382
|
+
Be as sendSolanaTransaction,
|
|
383
|
+
Fe as sendUserOperation,
|
|
383
384
|
je as signEvmHash,
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
385
|
+
De as signEvmMessage,
|
|
386
|
+
Ke as signEvmTransaction,
|
|
387
|
+
Ne as signEvmTypedData,
|
|
387
388
|
ke as signInWithEmail,
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
389
|
+
Ie as signInWithOAuth,
|
|
390
|
+
Ee as signInWithSms,
|
|
391
|
+
Te as signOut,
|
|
392
|
+
Le as signSolanaMessage,
|
|
393
|
+
We as signSolanaTransaction,
|
|
393
394
|
Se as verifyEmailOTP,
|
|
394
395
|
Ue as verifyOAuth,
|
|
395
396
|
_e as verifySmsOTP
|
package/dist/web/index.web97.js
CHANGED