@coinbase/cdp-core 0.0.32 → 0.0.34
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 +74 -8
- package/dist/esm/index.native.js +41 -36
- package/dist/esm/index.native10.js +115 -21
- package/dist/esm/index.native100.js +6 -9
- package/dist/esm/index.native101.js +11 -13
- package/dist/esm/index.native102.js +11 -8
- package/dist/esm/index.native103.js +7 -14
- package/dist/esm/index.native104.js +16 -80
- package/dist/esm/index.native105.js +79 -11
- package/dist/esm/index.native106.js +12 -35
- package/dist/esm/index.native107.js +35 -41
- package/dist/esm/index.native108.js +38 -75
- package/dist/esm/index.native109.js +81 -0
- package/dist/esm/index.native11.js +20 -30
- package/dist/esm/index.native12.js +30 -7
- package/dist/esm/index.native13.js +9 -15
- package/dist/esm/index.native14.js +15 -15
- package/dist/esm/index.native15.js +15 -116
- package/dist/esm/index.native16.js +116 -11
- package/dist/esm/index.native17.js +15 -42
- package/dist/esm/index.native18.js +42 -20
- package/dist/esm/index.native19.js +20 -172
- package/dist/esm/index.native2.js +3 -3
- package/dist/esm/index.native20.js +170 -39
- package/dist/esm/index.native21.js +41 -49
- package/dist/esm/index.native22.js +47 -70
- package/dist/esm/index.native23.js +69 -23
- package/dist/esm/index.native24.js +22 -156
- package/dist/esm/index.native25.js +157 -45
- package/dist/esm/index.native26.js +43 -245
- package/dist/esm/index.native27.js +247 -53
- package/dist/esm/index.native28.js +56 -17
- package/dist/esm/index.native29.js +15 -21
- package/dist/esm/index.native3.js +40 -30
- package/dist/esm/index.native30.js +21 -49
- package/dist/esm/index.native31.js +50 -8
- package/dist/esm/index.native32.js +8 -17
- package/dist/esm/index.native33.js +16 -44
- package/dist/esm/index.native34.js +45 -13
- package/dist/esm/index.native35.js +13 -55
- package/dist/esm/index.native36.js +55 -6
- package/dist/esm/index.native37.js +6 -21
- package/dist/esm/index.native38.js +21 -11
- package/dist/esm/index.native39.js +11 -3
- package/dist/esm/index.native4.js +67 -21
- package/dist/esm/index.native40.js +3 -3
- package/dist/esm/index.native41.js +3 -34
- package/dist/esm/index.native42.js +32 -10
- package/dist/esm/index.native43.js +12 -4
- package/dist/esm/index.native44.js +4 -28
- package/dist/esm/index.native45.js +28 -6
- package/dist/esm/index.native46.js +6 -24
- package/dist/esm/index.native47.js +24 -16
- package/dist/esm/index.native48.js +16 -54
- package/dist/esm/index.native49.js +53 -22
- package/dist/esm/index.native5.js +21 -254
- package/dist/esm/index.native50.js +23 -11
- package/dist/esm/index.native51.js +10 -26
- package/dist/esm/index.native52.js +26 -41
- package/dist/esm/index.native53.js +41 -54
- package/dist/esm/index.native54.js +54 -126
- package/dist/esm/index.native55.js +126 -11
- package/dist/esm/index.native56.js +9 -101
- package/dist/esm/index.native57.js +104 -6
- package/dist/esm/index.native58.js +7 -3
- package/dist/esm/index.native59.js +3 -15
- package/dist/esm/index.native6.js +314 -174
- package/dist/esm/index.native60.js +14 -42
- package/dist/esm/index.native61.js +38 -74
- package/dist/esm/index.native62.js +79 -2
- package/dist/esm/index.native63.js +2 -2
- package/dist/esm/index.native64.js +2 -13
- package/dist/esm/index.native65.js +8 -33
- package/dist/esm/index.native66.js +36 -5
- package/dist/esm/index.native67.js +5 -33
- package/dist/esm/index.native68.js +34 -8
- package/dist/esm/index.native69.js +8 -10
- package/dist/esm/index.native7.js +213 -115
- package/dist/esm/index.native70.js +10 -11
- package/dist/esm/index.native71.js +11 -13
- package/dist/esm/index.native72.js +13 -18
- package/dist/esm/index.native73.js +18 -5
- package/dist/esm/index.native74.js +6 -5
- package/dist/esm/index.native75.js +5 -11
- package/dist/esm/index.native76.js +10 -54
- package/dist/esm/index.native77.js +54 -10
- package/dist/esm/index.native78.js +11 -2
- package/dist/esm/index.native79.js +2 -45
- package/dist/esm/index.native8.js +115 -137
- package/dist/esm/index.native80.js +44 -13
- package/dist/esm/index.native81.js +14 -2
- package/dist/esm/index.native82.js +2 -21
- package/dist/esm/index.native83.js +18 -17
- package/dist/esm/index.native84.js +20 -80
- package/dist/esm/index.native85.js +79 -103
- package/dist/esm/index.native86.js +101 -30
- package/dist/esm/index.native87.js +32 -6
- package/dist/esm/index.native88.js +6 -78
- package/dist/esm/index.native89.js +2 -2
- package/dist/esm/index.native9.js +138 -113
- package/dist/esm/index.native90.js +3 -3
- package/dist/esm/index.native92.js +3 -3
- package/dist/esm/index.native93.js +1 -1
- package/dist/esm/index.native94.js +3 -3
- package/dist/esm/index.native95.js +79 -10
- package/dist/esm/index.native96.js +10 -5
- package/dist/esm/index.native97.js +5 -18
- package/dist/esm/index.native98.js +18 -28
- package/dist/esm/index.native99.js +26 -6
- package/dist/esm/index.web.js +41 -38
- package/dist/esm/index.web100.js +13 -28
- package/dist/esm/index.web101.js +10 -8
- package/dist/esm/index.web102.js +17 -11
- package/dist/esm/index.web103.js +80 -12
- package/dist/esm/index.web104.js +13 -10
- package/dist/esm/index.web105.js +36 -17
- package/dist/esm/index.web106.js +40 -79
- package/dist/esm/index.web12.js +6 -5
- package/dist/esm/index.web13.js +12 -10
- package/dist/esm/index.web15.js +1 -0
- package/dist/esm/index.web26.js +1 -1
- package/dist/esm/index.web5.js +217 -141
- package/dist/esm/index.web6.js +65 -38
- package/dist/esm/index.web75.js +6 -6
- package/dist/esm/index.web84.js +1 -1
- package/dist/esm/index.web87.js +21 -10
- package/dist/esm/index.web88.js +10 -79
- package/dist/esm/index.web89.js +19 -20
- package/dist/esm/index.web90.js +93 -9
- package/dist/esm/index.web91.js +19 -18
- package/dist/esm/index.web92.js +105 -81
- package/dist/esm/index.web93.js +9 -20
- package/dist/esm/index.web94.js +73 -112
- package/dist/esm/index.web96.js +18 -13
- package/dist/esm/index.web97.js +27 -35
- package/dist/esm/index.web98.js +7 -41
- package/dist/esm/index.web99.js +11 -18
- package/dist/native/index.native.js +41 -36
- package/dist/native/index.native10.js +115 -21
- package/dist/native/index.native100.js +6 -9
- package/dist/native/index.native101.js +11 -13
- package/dist/native/index.native102.js +11 -8
- package/dist/native/index.native103.js +7 -14
- package/dist/native/index.native104.js +16 -80
- package/dist/native/index.native105.js +79 -11
- package/dist/native/index.native106.js +12 -35
- package/dist/native/index.native107.js +35 -41
- package/dist/native/index.native108.js +38 -75
- package/dist/native/index.native109.js +81 -0
- package/dist/native/index.native11.js +20 -30
- package/dist/native/index.native12.js +30 -7
- package/dist/native/index.native13.js +9 -15
- package/dist/native/index.native14.js +15 -15
- package/dist/native/index.native15.js +15 -116
- package/dist/native/index.native16.js +116 -11
- package/dist/native/index.native17.js +15 -42
- package/dist/native/index.native18.js +42 -20
- package/dist/native/index.native19.js +20 -172
- package/dist/native/index.native2.js +3 -3
- package/dist/native/index.native20.js +170 -39
- package/dist/native/index.native21.js +41 -49
- package/dist/native/index.native22.js +47 -70
- package/dist/native/index.native23.js +69 -23
- package/dist/native/index.native24.js +22 -156
- package/dist/native/index.native25.js +157 -45
- package/dist/native/index.native26.js +43 -245
- package/dist/native/index.native27.js +247 -53
- package/dist/native/index.native28.js +56 -17
- package/dist/native/index.native29.js +15 -21
- package/dist/native/index.native3.js +40 -30
- package/dist/native/index.native30.js +21 -49
- package/dist/native/index.native31.js +50 -8
- package/dist/native/index.native32.js +8 -17
- package/dist/native/index.native33.js +16 -44
- package/dist/native/index.native34.js +45 -13
- package/dist/native/index.native35.js +13 -55
- package/dist/native/index.native36.js +55 -6
- package/dist/native/index.native37.js +6 -21
- package/dist/native/index.native38.js +21 -11
- package/dist/native/index.native39.js +11 -3
- package/dist/native/index.native4.js +67 -21
- package/dist/native/index.native40.js +3 -3
- package/dist/native/index.native41.js +3 -34
- package/dist/native/index.native42.js +32 -10
- package/dist/native/index.native43.js +12 -4
- package/dist/native/index.native44.js +4 -28
- package/dist/native/index.native45.js +28 -6
- package/dist/native/index.native46.js +6 -24
- package/dist/native/index.native47.js +24 -16
- package/dist/native/index.native48.js +16 -54
- package/dist/native/index.native49.js +53 -22
- package/dist/native/index.native5.js +21 -254
- package/dist/native/index.native50.js +23 -11
- package/dist/native/index.native51.js +10 -26
- package/dist/native/index.native52.js +26 -41
- package/dist/native/index.native53.js +41 -54
- package/dist/native/index.native54.js +54 -126
- package/dist/native/index.native55.js +126 -11
- package/dist/native/index.native56.js +9 -101
- package/dist/native/index.native57.js +104 -6
- package/dist/native/index.native58.js +7 -3
- package/dist/native/index.native59.js +3 -15
- package/dist/native/index.native6.js +314 -174
- package/dist/native/index.native60.js +14 -42
- package/dist/native/index.native61.js +38 -74
- package/dist/native/index.native62.js +79 -2
- package/dist/native/index.native63.js +2 -2
- package/dist/native/index.native64.js +2 -13
- package/dist/native/index.native65.js +8 -33
- package/dist/native/index.native66.js +36 -5
- package/dist/native/index.native67.js +5 -33
- package/dist/native/index.native68.js +34 -8
- package/dist/native/index.native69.js +8 -10
- package/dist/native/index.native7.js +213 -115
- package/dist/native/index.native70.js +10 -11
- package/dist/native/index.native71.js +11 -13
- package/dist/native/index.native72.js +13 -18
- package/dist/native/index.native73.js +18 -5
- package/dist/native/index.native74.js +6 -5
- package/dist/native/index.native75.js +5 -11
- package/dist/native/index.native76.js +10 -54
- package/dist/native/index.native77.js +54 -10
- package/dist/native/index.native78.js +11 -2
- package/dist/native/index.native79.js +2 -45
- package/dist/native/index.native8.js +115 -137
- package/dist/native/index.native80.js +44 -13
- package/dist/native/index.native81.js +14 -2
- package/dist/native/index.native82.js +2 -21
- package/dist/native/index.native83.js +18 -17
- package/dist/native/index.native84.js +20 -80
- package/dist/native/index.native85.js +79 -103
- package/dist/native/index.native86.js +101 -30
- package/dist/native/index.native87.js +32 -6
- package/dist/native/index.native88.js +6 -78
- package/dist/native/index.native89.js +2 -2
- package/dist/native/index.native9.js +138 -113
- package/dist/native/index.native90.js +3 -3
- package/dist/native/index.native92.js +3 -3
- package/dist/native/index.native93.js +1 -1
- package/dist/native/index.native94.js +3 -3
- package/dist/native/index.native95.js +79 -10
- package/dist/native/index.native96.js +10 -5
- package/dist/native/index.native97.js +5 -18
- package/dist/native/index.native98.js +18 -28
- package/dist/native/index.native99.js +26 -6
- package/dist/native-types/auth/authManager.d.ts +3 -0
- package/dist/native-types/auth/withAuth.d.ts +3 -1
- package/dist/native-types/core.d.ts +3 -1
- package/dist/native-types/platform/native/secureStorage.d.ts +2 -0
- package/dist/native-types/platform/types.d.ts +7 -0
- package/dist/native-types/types.d.ts +20 -3
- package/dist/types/auth/authManager.d.ts +3 -0
- package/dist/types/auth/withAuth.d.ts +3 -1
- package/dist/types/core.d.ts +3 -1
- package/dist/types/platform/native/secureStorage.d.ts +2 -0
- package/dist/types/platform/types.d.ts +7 -0
- package/dist/types/types.d.ts +20 -3
- package/dist/web/index.web.js +41 -38
- package/dist/web/index.web100.js +13 -28
- package/dist/web/index.web101.js +10 -8
- package/dist/web/index.web102.js +17 -11
- package/dist/web/index.web103.js +80 -12
- package/dist/web/index.web104.js +13 -10
- package/dist/web/index.web105.js +36 -17
- package/dist/web/index.web106.js +40 -79
- package/dist/web/index.web12.js +6 -5
- package/dist/web/index.web13.js +12 -10
- package/dist/web/index.web15.js +1 -0
- package/dist/web/index.web26.js +1 -1
- package/dist/web/index.web5.js +217 -141
- package/dist/web/index.web6.js +65 -38
- package/dist/web/index.web75.js +6 -6
- package/dist/web/index.web84.js +1 -1
- package/dist/web/index.web87.js +21 -10
- package/dist/web/index.web88.js +10 -79
- package/dist/web/index.web89.js +19 -20
- package/dist/web/index.web90.js +93 -9
- package/dist/web/index.web91.js +19 -18
- package/dist/web/index.web92.js +105 -81
- package/dist/web/index.web93.js +9 -20
- package/dist/web/index.web94.js +73 -112
- package/dist/web/index.web96.js +18 -13
- package/dist/web/index.web97.js +27 -35
- package/dist/web/index.web98.js +7 -41
- package/dist/web/index.web99.js +11 -18
- package/dist/web-types/auth/authManager.d.ts +3 -0
- package/dist/web-types/auth/withAuth.d.ts +3 -1
- package/dist/web-types/core.d.ts +3 -1
- package/dist/web-types/platform/native/secureStorage.d.ts +2 -0
- package/dist/web-types/platform/types.d.ts +7 -0
- package/dist/web-types/types.d.ts +20 -3
- package/package.json +8 -4
|
@@ -1,256 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
} catch {
|
|
19
|
-
n = !0;
|
|
20
|
-
}
|
|
21
|
-
if (z(e), t().useMock) {
|
|
22
|
-
w(new b(t().projectId));
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
if (A({
|
|
26
|
-
debugging: t().debugging,
|
|
27
|
-
basePath: t().basePath
|
|
28
|
-
}), n) {
|
|
29
|
-
const r = new W(t().projectId);
|
|
30
|
-
w(r), v(r);
|
|
31
|
-
}
|
|
32
|
-
await s().ensureInitialized();
|
|
33
|
-
}, Z = async (e) => l({
|
|
34
|
-
email: e.email,
|
|
35
|
-
type: "email"
|
|
36
|
-
}), _ = async (e) => l({
|
|
37
|
-
phoneNumber: e.phoneNumber,
|
|
38
|
-
type: "sms"
|
|
39
|
-
}), ee = async (e) => f(
|
|
40
|
-
e,
|
|
41
|
-
"Mock email OTP verified",
|
|
42
|
-
(n, r) => k(n, r)
|
|
43
|
-
), te = async (e) => f(
|
|
44
|
-
e,
|
|
45
|
-
"Mock SMS OTP verified",
|
|
46
|
-
(n, r) => U(n, r)
|
|
47
|
-
), re = async () => s().getUser(), ne = async () => s().isSignedIn(), se = async () => {
|
|
48
|
-
if (t().useMock) {
|
|
49
|
-
await s().signOut();
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
if (!await s().isSignedIn())
|
|
53
|
-
throw new Error("User not signed in");
|
|
54
|
-
await s().signOut();
|
|
55
|
-
}, ae = async () => s().getToken(), ce = (e) => {
|
|
56
|
-
s().addAuthStateChangeCallback(e);
|
|
57
|
-
}, ie = async (e) => t().useMock ? { signature: "0x0" } : o(e, s(), async ({ user: n, walletSecretId: r }) => ({
|
|
58
|
-
signature: (await M(t().projectId, n.userId, {
|
|
59
|
-
hash: e.hash,
|
|
60
|
-
address: e.evmAccount,
|
|
61
|
-
walletSecretId: r
|
|
62
|
-
})).signature
|
|
63
|
-
})), oe = async (e) => t().useMock ? { signedTransaction: "0x0" } : o(e, s(), async ({ user: n, walletSecretId: r }) => {
|
|
64
|
-
const i = y(e.transaction);
|
|
65
|
-
return {
|
|
66
|
-
signedTransaction: (await T(
|
|
67
|
-
t().projectId,
|
|
68
|
-
n.userId,
|
|
69
|
-
{
|
|
70
|
-
transaction: i,
|
|
71
|
-
address: e.evmAccount,
|
|
72
|
-
walletSecretId: r
|
|
73
|
-
}
|
|
74
|
-
)).signedTransaction
|
|
75
|
-
};
|
|
76
|
-
}), ue = async (e) => {
|
|
77
|
-
if (!D(e.network))
|
|
78
|
-
throw new Error(`Chain ${e.network} is not supported by the CDP Apis`);
|
|
79
|
-
if (t().useMock)
|
|
80
|
-
return { transactionHash: "0x0" };
|
|
81
|
-
const n = y(e.transaction);
|
|
82
|
-
return o(e, s(), async ({ user: r, walletSecretId: i }) => ({
|
|
83
|
-
transactionHash: (await P(
|
|
84
|
-
t().projectId,
|
|
85
|
-
r.userId,
|
|
86
|
-
{
|
|
87
|
-
transaction: n,
|
|
88
|
-
address: e.evmAccount,
|
|
89
|
-
walletSecretId: i,
|
|
90
|
-
network: e.network
|
|
91
|
-
}
|
|
92
|
-
)).transactionHash
|
|
93
|
-
}));
|
|
94
|
-
}, de = async (e) => t().useMock ? { signature: "0x0" } : o(e, s(), async ({ user: n, walletSecretId: r }) => ({
|
|
95
|
-
signature: (await j(t().projectId, n.userId, {
|
|
96
|
-
message: e.message,
|
|
97
|
-
address: e.evmAccount,
|
|
98
|
-
walletSecretId: r
|
|
99
|
-
})).signature
|
|
100
|
-
})), me = async (e) => t().useMock ? { signature: "0x0" } : o(e, s(), async ({ user: n, walletSecretId: r }) => ({
|
|
101
|
-
signature: (await C(t().projectId, n.userId, {
|
|
102
|
-
typedData: e.typedData,
|
|
103
|
-
address: e.evmAccount,
|
|
104
|
-
walletSecretId: r
|
|
105
|
-
})).signature
|
|
106
|
-
})), ge = async (e) => t().useMock ? {
|
|
107
|
-
userOperationHash: "0x1234567890123456789012345678901234567890123456789012345678901234"
|
|
108
|
-
} : o(e, s(), async ({ user: n, walletSecretId: r }) => ({
|
|
109
|
-
userOperationHash: (await O(
|
|
110
|
-
t().projectId,
|
|
111
|
-
n.userId,
|
|
112
|
-
e.evmSmartAccount,
|
|
113
|
-
{
|
|
114
|
-
network: e.network,
|
|
115
|
-
calls: e.calls.map((a) => ({
|
|
116
|
-
to: a.to,
|
|
117
|
-
value: String(a.value ?? 0n),
|
|
118
|
-
data: a.data ?? "0x"
|
|
119
|
-
})),
|
|
120
|
-
walletSecretId: r,
|
|
121
|
-
useCdpPaymaster: e.useCdpPaymaster ?? !1,
|
|
122
|
-
paymasterUrl: e.paymasterUrl
|
|
123
|
-
}
|
|
124
|
-
)).userOpHash
|
|
125
|
-
})), pe = async (e) => t().useMock ? {
|
|
126
|
-
userOpHash: e.userOperationHash,
|
|
127
|
-
network: e.network,
|
|
128
|
-
calls: [
|
|
129
|
-
{
|
|
130
|
-
to: "0x1234567890123456789012345678901234567890",
|
|
131
|
-
value: "0",
|
|
132
|
-
data: "0x"
|
|
133
|
-
}
|
|
134
|
-
],
|
|
135
|
-
status: "complete",
|
|
136
|
-
transactionHash: "0x9876543210987654321098765432109876543210987654321098765432109876",
|
|
137
|
-
receipts: []
|
|
138
|
-
} : o(e, s(), async ({ user: n }) => await x(
|
|
139
|
-
t().projectId,
|
|
140
|
-
n.userId,
|
|
141
|
-
e.evmSmartAccount,
|
|
142
|
-
e.userOperationHash
|
|
143
|
-
)), he = async (e) => {
|
|
144
|
-
if (t().useMock)
|
|
145
|
-
return {
|
|
146
|
-
privateKey: "mock-private-key"
|
|
147
|
-
};
|
|
148
|
-
const n = K(), r = await n.createExportKeyPair();
|
|
149
|
-
return o(e, s(), async ({ user: i, walletSecretId: a }) => {
|
|
150
|
-
const c = await H(t().projectId, i.userId, {
|
|
151
|
-
address: e.evmAccount,
|
|
152
|
-
walletSecretId: a,
|
|
153
|
-
exportEncryptionKey: r.publicKeyBase64
|
|
154
|
-
});
|
|
155
|
-
return {
|
|
156
|
-
privateKey: await n.decryptWithPrivateKey(
|
|
157
|
-
r.privateKey,
|
|
158
|
-
c.encryptedPrivateKey
|
|
159
|
-
)
|
|
160
|
-
};
|
|
161
|
-
});
|
|
162
|
-
}, l = async (e) => {
|
|
163
|
-
if (t().useMock)
|
|
164
|
-
return {
|
|
165
|
-
message: "Mock sign in initiated",
|
|
166
|
-
flowId: "mock-flow-id"
|
|
167
|
-
};
|
|
168
|
-
if (await s().isSignedIn())
|
|
169
|
-
throw new Error("User is already authenticated. Please sign out first.");
|
|
170
|
-
const r = await S(t().projectId, e);
|
|
171
|
-
return {
|
|
172
|
-
flowId: r.flowId,
|
|
173
|
-
message: r.message
|
|
174
|
-
};
|
|
175
|
-
}, f = async (e, n, r) => {
|
|
176
|
-
if (t().useMock)
|
|
177
|
-
return await s().setAuthState({
|
|
178
|
-
accessToken: "mock-access-token",
|
|
179
|
-
expiresAt: Date.now() + 1e3 * 60 * 60 * 24,
|
|
180
|
-
user: h
|
|
181
|
-
}), {
|
|
182
|
-
message: n,
|
|
183
|
-
user: h,
|
|
184
|
-
isNewUser: !1
|
|
185
|
-
};
|
|
186
|
-
if (await s().isSignedIn())
|
|
187
|
-
throw new Error("User is already authenticated. Please sign out first.");
|
|
188
|
-
const a = await r(t().projectId, {
|
|
189
|
-
flowId: e.flowId,
|
|
190
|
-
otp: e.otp
|
|
191
|
-
});
|
|
192
|
-
let c = m(a.accessToken, a.validUntil, a.endUser);
|
|
193
|
-
if (await s().setAuthState(c), !c.user.evmAccounts || c.user.evmAccounts.length === 0)
|
|
194
|
-
try {
|
|
195
|
-
const u = await s().getWalletSecretId();
|
|
196
|
-
let d = await E(t().projectId, c.user.userId, {
|
|
197
|
-
walletSecretId: u
|
|
198
|
-
});
|
|
199
|
-
if (t().createAccountOnLogin === "evm-smart") {
|
|
200
|
-
const [I] = d.evmAccounts;
|
|
201
|
-
d = await p(
|
|
202
|
-
t().projectId,
|
|
203
|
-
c.user.userId,
|
|
204
|
-
{
|
|
205
|
-
owner: I,
|
|
206
|
-
enableSpendPermissions: !1
|
|
207
|
-
// Defaulting to false until the feature is ready.
|
|
208
|
-
}
|
|
209
|
-
);
|
|
210
|
-
}
|
|
211
|
-
c = m(a.accessToken, a.validUntil, d), await s().setAuthState(c);
|
|
212
|
-
} catch (u) {
|
|
213
|
-
throw new Error(`Failed to create EVM account: ${u}`);
|
|
214
|
-
}
|
|
215
|
-
if (t().createAccountOnLogin === "evm-smart" && (!c.user.evmSmartAccounts || c.user.evmSmartAccounts.length === 0))
|
|
216
|
-
try {
|
|
217
|
-
const [u] = c.user.evmAccounts, d = await p(
|
|
218
|
-
t().projectId,
|
|
219
|
-
c.user.userId,
|
|
220
|
-
{
|
|
221
|
-
owner: u,
|
|
222
|
-
enableSpendPermissions: !1
|
|
223
|
-
// Defaulting to false until the feature is ready.
|
|
224
|
-
}
|
|
225
|
-
);
|
|
226
|
-
c = m(a.accessToken, a.validUntil, d), await s().setAuthState(c);
|
|
227
|
-
} catch (u) {
|
|
228
|
-
throw new Error(`Failed to create EVM Smart Account: ${u}`);
|
|
229
|
-
}
|
|
230
|
-
const g = await s().getUser();
|
|
231
|
-
return {
|
|
232
|
-
message: a.message,
|
|
233
|
-
user: g,
|
|
234
|
-
isNewUser: a.isNewEndUser
|
|
235
|
-
};
|
|
236
|
-
};
|
|
1
|
+
let r = null;
|
|
2
|
+
function t(o) {
|
|
3
|
+
r = o;
|
|
4
|
+
}
|
|
5
|
+
function e() {
|
|
6
|
+
if (!r)
|
|
7
|
+
throw new Error(
|
|
8
|
+
"Platform services not initialized. This usually means the core package was not properly imported for your platform. For web apps, make sure you're importing from '@coinbase/cdp-core'. For React Native apps, ensure you have the proper platform resolution configured."
|
|
9
|
+
);
|
|
10
|
+
return r;
|
|
11
|
+
}
|
|
12
|
+
function a() {
|
|
13
|
+
return e().crypto;
|
|
14
|
+
}
|
|
15
|
+
function n() {
|
|
16
|
+
return e().storage;
|
|
17
|
+
}
|
|
237
18
|
export {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
Y as initialize,
|
|
243
|
-
ne as isSignedIn,
|
|
244
|
-
ce as onAuthStateChange,
|
|
245
|
-
ue as sendEvmTransaction,
|
|
246
|
-
ge as sendUserOperation,
|
|
247
|
-
ie as signEvmHash,
|
|
248
|
-
de as signEvmMessage,
|
|
249
|
-
oe as signEvmTransaction,
|
|
250
|
-
me as signEvmTypedData,
|
|
251
|
-
Z as signInWithEmail,
|
|
252
|
-
_ as signInWithSms,
|
|
253
|
-
se as signOut,
|
|
254
|
-
ee as verifyEmailOTP,
|
|
255
|
-
te as verifySmsOTP
|
|
19
|
+
a as getPlatformCrypto,
|
|
20
|
+
e as getPlatformServices,
|
|
21
|
+
n as getPlatformStorage,
|
|
22
|
+
t as setPlatformServices
|
|
256
23
|
};
|
|
@@ -1,14 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { SizeOverflowError as u } from "./index.native56.js";
|
|
2
|
+
import { size as t } from "./index.native44.js";
|
|
3
|
+
function s(n, { size: i }) {
|
|
4
|
+
if (t(n) > i)
|
|
5
|
+
throw new u({
|
|
6
|
+
givenSize: t(n),
|
|
7
|
+
maxSize: i
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
function z(n, i = {}) {
|
|
11
|
+
const { signed: o } = i;
|
|
12
|
+
i.size && s(n, { size: i.size });
|
|
13
|
+
const e = BigInt(n);
|
|
14
|
+
if (!o)
|
|
15
|
+
return e;
|
|
16
|
+
const r = (n.length - 2) / 2, f = (1n << BigInt(r) * 8n - 1n) - 1n;
|
|
17
|
+
return e <= f ? e : e - BigInt(`0x${"f".padStart(r * 2, "f")}`) - 1n;
|
|
18
|
+
}
|
|
19
|
+
function g(n, i = {}) {
|
|
20
|
+
return Number(z(n, i));
|
|
11
21
|
}
|
|
12
22
|
export {
|
|
13
|
-
|
|
23
|
+
s as assertSize,
|
|
24
|
+
z as hexToBigInt,
|
|
25
|
+
g as hexToNumber
|
|
14
26
|
};
|
|
@@ -1,30 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const s = {
|
|
11
|
-
...l,
|
|
12
|
-
blockNumber: l.blockNumber ? BigInt(l.blockNumber) : null,
|
|
13
|
-
contractAddress: l.contractAddress ? l.contractAddress : null,
|
|
14
|
-
cumulativeGasUsed: l.cumulativeGasUsed ? BigInt(l.cumulativeGasUsed) : null,
|
|
15
|
-
effectiveGasPrice: l.effectiveGasPrice ? BigInt(l.effectiveGasPrice) : null,
|
|
16
|
-
gasUsed: l.gasUsed ? BigInt(l.gasUsed) : null,
|
|
17
|
-
logs: l.logs ? l.logs.map((u) => m(u)) : null,
|
|
18
|
-
to: l.to ? l.to : null,
|
|
19
|
-
transactionIndex: l.transactionIndex ? d(l.transactionIndex) : null,
|
|
20
|
-
status: l.status ? f[l.status] : null,
|
|
21
|
-
type: l.type ? o[l.type] || l.type : null
|
|
1
|
+
function r(n, { args: t, eventName: a } = {}) {
|
|
2
|
+
return {
|
|
3
|
+
...n,
|
|
4
|
+
blockHash: n.blockHash ? n.blockHash : null,
|
|
5
|
+
blockNumber: n.blockNumber ? BigInt(n.blockNumber) : null,
|
|
6
|
+
logIndex: n.logIndex ? Number(n.logIndex) : null,
|
|
7
|
+
transactionHash: n.transactionHash ? n.transactionHash : null,
|
|
8
|
+
transactionIndex: n.transactionIndex ? Number(n.transactionIndex) : null,
|
|
9
|
+
...a ? { args: t, eventName: a } : {}
|
|
22
10
|
};
|
|
23
|
-
return l.blobGasPrice && (s.blobGasPrice = BigInt(l.blobGasPrice)), l.blobGasUsed && (s.blobGasUsed = BigInt(l.blobGasUsed)), s;
|
|
24
11
|
}
|
|
25
|
-
const U = /* @__PURE__ */ b("transactionReceipt", r);
|
|
26
12
|
export {
|
|
27
|
-
|
|
28
|
-
r as formatTransactionReceipt,
|
|
29
|
-
f as receiptStatuses
|
|
13
|
+
r as formatLog
|
|
30
14
|
};
|
|
@@ -1,45 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
function y(n) {
|
|
24
|
-
const e = typeof n == "string" ? g(n) : n, i = o(e.length);
|
|
25
|
-
return {
|
|
26
|
-
length: e.length === 1 && e[0] < 128 ? 1 : e.length <= 55 ? 1 + e.length : 1 + i + e.length,
|
|
27
|
-
encode(t) {
|
|
28
|
-
e.length === 1 && e[0] < 128 ? t.pushBytes(e) : e.length <= 55 ? (t.pushByte(128 + e.length), t.pushBytes(e)) : (t.pushByte(183 + i), i === 1 ? t.pushUint8(e.length) : i === 2 ? t.pushUint16(e.length) : i === 3 ? t.pushUint24(e.length) : t.pushUint32(e.length), t.pushBytes(e));
|
|
29
|
-
}
|
|
1
|
+
import { hexToNumber as d } from "./index.native50.js";
|
|
2
|
+
import { defineFormatter as b } from "./index.native48.js";
|
|
3
|
+
import { formatLog as m } from "./index.native51.js";
|
|
4
|
+
import { transactionType as o } from "./index.native49.js";
|
|
5
|
+
const f = {
|
|
6
|
+
"0x0": "reverted",
|
|
7
|
+
"0x1": "success"
|
|
8
|
+
};
|
|
9
|
+
function r(l) {
|
|
10
|
+
const s = {
|
|
11
|
+
...l,
|
|
12
|
+
blockNumber: l.blockNumber ? BigInt(l.blockNumber) : null,
|
|
13
|
+
contractAddress: l.contractAddress ? l.contractAddress : null,
|
|
14
|
+
cumulativeGasUsed: l.cumulativeGasUsed ? BigInt(l.cumulativeGasUsed) : null,
|
|
15
|
+
effectiveGasPrice: l.effectiveGasPrice ? BigInt(l.effectiveGasPrice) : null,
|
|
16
|
+
gasUsed: l.gasUsed ? BigInt(l.gasUsed) : null,
|
|
17
|
+
logs: l.logs ? l.logs.map((u) => m(u)) : null,
|
|
18
|
+
to: l.to ? l.to : null,
|
|
19
|
+
transactionIndex: l.transactionIndex ? d(l.transactionIndex) : null,
|
|
20
|
+
status: l.status ? f[l.status] : null,
|
|
21
|
+
type: l.type ? o[l.type] || l.type : null
|
|
30
22
|
};
|
|
23
|
+
return l.blobGasPrice && (s.blobGasPrice = BigInt(l.blobGasPrice)), l.blobGasUsed && (s.blobGasUsed = BigInt(l.blobGasUsed)), s;
|
|
31
24
|
}
|
|
32
|
-
|
|
33
|
-
if (n < 2 ** 8)
|
|
34
|
-
return 1;
|
|
35
|
-
if (n < 2 ** 16)
|
|
36
|
-
return 2;
|
|
37
|
-
if (n < 2 ** 24)
|
|
38
|
-
return 3;
|
|
39
|
-
if (n < 2 ** 32)
|
|
40
|
-
return 4;
|
|
41
|
-
throw new l("Length is too large.");
|
|
42
|
-
}
|
|
25
|
+
const U = /* @__PURE__ */ b("transactionReceipt", r);
|
|
43
26
|
export {
|
|
44
|
-
|
|
27
|
+
U as defineTransactionReceipt,
|
|
28
|
+
r as formatTransactionReceipt,
|
|
29
|
+
f as receiptStatuses
|
|
45
30
|
};
|
|
@@ -1,58 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
value: void 0
|
|
32
|
-
}), Object.defineProperty(this, "shortMessage", {
|
|
33
|
-
enumerable: !0,
|
|
34
|
-
configurable: !0,
|
|
35
|
-
writable: !0,
|
|
36
|
-
value: void 0
|
|
37
|
-
}), Object.defineProperty(this, "version", {
|
|
38
|
-
enumerable: !0,
|
|
39
|
-
configurable: !0,
|
|
40
|
-
writable: !0,
|
|
41
|
-
value: void 0
|
|
42
|
-
}), Object.defineProperty(this, "name", {
|
|
43
|
-
enumerable: !0,
|
|
44
|
-
configurable: !0,
|
|
45
|
-
writable: !0,
|
|
46
|
-
value: "BaseError"
|
|
47
|
-
}), this.details = i, this.docsPath = n, this.metaMessages = e.metaMessages, this.name = e.name ?? this.name, this.shortMessage = t, this.version = o;
|
|
48
|
-
}
|
|
49
|
-
walk(t) {
|
|
50
|
-
return c(this, t);
|
|
51
|
-
}
|
|
1
|
+
import { BaseError as l } from "./index.native54.js";
|
|
2
|
+
import { createCursor as r } from "./index.native55.js";
|
|
3
|
+
import { hexToBytes as g } from "./index.native36.js";
|
|
4
|
+
import { bytesToHex as u } from "./index.native34.js";
|
|
5
|
+
function m(n, e = "hex") {
|
|
6
|
+
const i = s(n), h = r(new Uint8Array(i.length));
|
|
7
|
+
return i.encode(h), e === "hex" ? u(h.bytes) : h.bytes;
|
|
8
|
+
}
|
|
9
|
+
function s(n) {
|
|
10
|
+
return Array.isArray(n) ? p(n.map((e) => s(e))) : y(n);
|
|
11
|
+
}
|
|
12
|
+
function p(n) {
|
|
13
|
+
const e = n.reduce((t, f) => t + f.length, 0), i = o(e);
|
|
14
|
+
return {
|
|
15
|
+
length: e <= 55 ? 1 + e : 1 + i + e,
|
|
16
|
+
encode(t) {
|
|
17
|
+
e <= 55 ? t.pushByte(192 + e) : (t.pushByte(247 + i), i === 1 ? t.pushUint8(e) : i === 2 ? t.pushUint16(e) : i === 3 ? t.pushUint24(e) : t.pushUint32(e));
|
|
18
|
+
for (const { encode: f } of n)
|
|
19
|
+
f(t);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function y(n) {
|
|
24
|
+
const e = typeof n == "string" ? g(n) : n, i = o(e.length);
|
|
25
|
+
return {
|
|
26
|
+
length: e.length === 1 && e[0] < 128 ? 1 : e.length <= 55 ? 1 + e.length : 1 + i + e.length,
|
|
27
|
+
encode(t) {
|
|
28
|
+
e.length === 1 && e[0] < 128 ? t.pushBytes(e) : e.length <= 55 ? (t.pushByte(128 + e.length), t.pushBytes(e)) : (t.pushByte(183 + i), i === 1 ? t.pushUint8(e.length) : i === 2 ? t.pushUint16(e.length) : i === 3 ? t.pushUint24(e.length) : t.pushUint32(e.length), t.pushBytes(e));
|
|
29
|
+
}
|
|
30
|
+
};
|
|
52
31
|
}
|
|
53
|
-
function
|
|
54
|
-
|
|
32
|
+
function o(n) {
|
|
33
|
+
if (n < 2 ** 8)
|
|
34
|
+
return 1;
|
|
35
|
+
if (n < 2 ** 16)
|
|
36
|
+
return 2;
|
|
37
|
+
if (n < 2 ** 24)
|
|
38
|
+
return 3;
|
|
39
|
+
if (n < 2 ** 32)
|
|
40
|
+
return 4;
|
|
41
|
+
throw new l("Length is too large.");
|
|
55
42
|
}
|
|
56
43
|
export {
|
|
57
|
-
|
|
44
|
+
m as toRlp
|
|
58
45
|
};
|