@coinbase/cdp-core 0.0.33 → 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 +40 -37
- package/dist/esm/index.native14.js +6 -5
- package/dist/esm/index.native15.js +12 -10
- package/dist/esm/index.native17.js +1 -0
- package/dist/esm/index.native54.js +1 -1
- package/dist/esm/index.native55.js +1 -1
- package/dist/esm/index.native57.js +2 -2
- package/dist/esm/index.native59.js +1 -1
- package/dist/esm/index.native6.js +188 -134
- package/dist/esm/index.native82.js +2 -21
- package/dist/esm/index.native83.js +21 -2
- package/dist/esm/index.native84.js +18 -102
- package/dist/esm/index.native85.js +80 -20
- package/dist/esm/index.native86.js +103 -79
- package/dist/esm/index.native95.js +1 -1
- package/dist/esm/index.web.js +41 -38
- 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 +188 -134
- package/dist/esm/index.web84.js +1 -1
- package/dist/esm/index.web93.js +10 -79
- package/dist/esm/index.web94.js +79 -10
- package/dist/native/index.native.js +40 -37
- package/dist/native/index.native14.js +6 -5
- package/dist/native/index.native15.js +12 -10
- package/dist/native/index.native17.js +1 -0
- package/dist/native/index.native54.js +1 -1
- package/dist/native/index.native55.js +1 -1
- package/dist/native/index.native57.js +2 -2
- package/dist/native/index.native59.js +1 -1
- package/dist/native/index.native6.js +188 -134
- package/dist/native/index.native82.js +2 -21
- package/dist/native/index.native83.js +21 -2
- package/dist/native/index.native84.js +18 -102
- package/dist/native/index.native85.js +80 -20
- package/dist/native/index.native86.js +103 -79
- package/dist/native/index.native95.js +1 -1
- package/dist/native-types/auth/withAuth.d.ts +3 -1
- package/dist/native-types/core.d.ts +3 -1
- package/dist/native-types/types.d.ts +20 -3
- package/dist/types/auth/withAuth.d.ts +3 -1
- package/dist/types/core.d.ts +3 -1
- package/dist/types/types.d.ts +20 -3
- package/dist/web/index.web.js +41 -38
- 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 +188 -134
- package/dist/web/index.web84.js +1 -1
- package/dist/web/index.web93.js +10 -79
- package/dist/web/index.web94.js +79 -10
- package/dist/web-types/auth/withAuth.d.ts +3 -1
- package/dist/web-types/core.d.ts +3 -1
- package/dist/web-types/types.d.ts +20 -3
- package/package.json +2 -2
package/dist/esm/index.web5.js
CHANGED
|
@@ -1,135 +1,156 @@
|
|
|
1
|
-
import { configureCdpApiClient as
|
|
1
|
+
import { configureCdpApiClient as h, setAuthManager as I, initiateAuthentication as A, createEndUserSolanaAccount as v, createEndUserEvmAccount as k, createEndUserEvmSmartAccount as d, verifyEmailAuthentication as S, verifySmsAuthentication as E, signEvmHashWithEndUserAccount as U, signEvmTransactionWithEndUserAccount as T, signSolanaTransactionWithEndUserAccount as M, sendEvmTransactionWithEndUserAccount as j, sendSolanaTransactionWithEndUserAccount as P, signEvmMessageWithEndUserAccount as O, signEvmTypedDataWithEndUserAccount as C, sendUserOperationWithEndUserAccount as x, getUserOperationWithEndUserAccount as W, exportEndUserEvmAccount as H } from "@coinbase/cdp-api-client";
|
|
2
2
|
import { AuthManager as b } from "./index.web6.js";
|
|
3
|
-
import { toAuthState as
|
|
4
|
-
import { withAuth as
|
|
3
|
+
import { toAuthState as u } from "./index.web12.js";
|
|
4
|
+
import { withAuth as o } from "./index.web13.js";
|
|
5
5
|
import { MockAuthManager as K } from "./index.web14.js";
|
|
6
|
-
import { mockUser as
|
|
7
|
-
import { getPlatformServices as
|
|
6
|
+
import { mockUser as g } from "./index.web15.js";
|
|
7
|
+
import { getPlatformServices as l, getPlatformCrypto as D } from "./index.web2.js";
|
|
8
8
|
import { isChainSupportedForCDPSends as _ } from "./index.web16.js";
|
|
9
|
-
import { getConfig as
|
|
9
|
+
import { getConfig as n, setCoreAuthManager as m, getCoreAuthManager as a, setConfig as N } from "./index.web17.js";
|
|
10
10
|
import "viem";
|
|
11
|
-
import { serializeTransaction as
|
|
12
|
-
const
|
|
11
|
+
import { serializeTransaction as w } from "./index.web18.js";
|
|
12
|
+
const R = async (e) => {
|
|
13
13
|
if (!e.projectId)
|
|
14
14
|
throw new Error("Project ID is required");
|
|
15
15
|
let r;
|
|
16
16
|
try {
|
|
17
|
-
r =
|
|
17
|
+
r = n().projectId !== e.projectId;
|
|
18
18
|
} catch {
|
|
19
19
|
r = !0;
|
|
20
20
|
}
|
|
21
|
-
if (
|
|
22
|
-
|
|
21
|
+
if (N(e), n().useMock) {
|
|
22
|
+
m(new K(n().projectId));
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
|
-
let
|
|
25
|
+
let t;
|
|
26
26
|
try {
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
getRefreshToken: () =>
|
|
30
|
-
setRefreshToken: (c) =>
|
|
31
|
-
removeRefreshToken: () =>
|
|
27
|
+
const s = l();
|
|
28
|
+
t = s.secureStorage ? {
|
|
29
|
+
getRefreshToken: () => s.secureStorage.getItem("cdp_refresh_token"),
|
|
30
|
+
setRefreshToken: (c) => s.secureStorage.setItem("cdp_refresh_token", c),
|
|
31
|
+
removeRefreshToken: () => s.secureStorage.removeItem("cdp_refresh_token")
|
|
32
32
|
} : void 0;
|
|
33
33
|
} catch {
|
|
34
|
-
|
|
34
|
+
t = void 0;
|
|
35
35
|
}
|
|
36
|
-
if (
|
|
37
|
-
debugging:
|
|
38
|
-
basePath:
|
|
39
|
-
refreshTokenStorage:
|
|
36
|
+
if (h({
|
|
37
|
+
debugging: n().debugging,
|
|
38
|
+
basePath: n().basePath,
|
|
39
|
+
refreshTokenStorage: t
|
|
40
40
|
}), r) {
|
|
41
|
-
const
|
|
42
|
-
|
|
41
|
+
const s = new b(n().projectId);
|
|
42
|
+
m(s), I(s);
|
|
43
43
|
}
|
|
44
|
-
await
|
|
45
|
-
},
|
|
44
|
+
await a().ensureInitialized();
|
|
45
|
+
}, ee = async (e) => p({
|
|
46
46
|
email: e.email,
|
|
47
47
|
type: "email"
|
|
48
|
-
}),
|
|
48
|
+
}), re = async (e) => p({
|
|
49
49
|
phoneNumber: e.phoneNumber,
|
|
50
50
|
type: "sms"
|
|
51
|
-
}), te = async (e) =>
|
|
51
|
+
}), te = async (e) => y(
|
|
52
52
|
e,
|
|
53
53
|
"Mock email OTP verified",
|
|
54
|
-
(r,
|
|
55
|
-
),
|
|
54
|
+
(r, t) => S(r, t)
|
|
55
|
+
), ne = async (e) => y(
|
|
56
56
|
e,
|
|
57
57
|
"Mock SMS OTP verified",
|
|
58
|
-
(r,
|
|
59
|
-
), se = async () =>
|
|
60
|
-
if (
|
|
61
|
-
await
|
|
58
|
+
(r, t) => E(r, t)
|
|
59
|
+
), se = async () => a().getUser(), ae = async () => a().isSignedIn(), ce = async () => {
|
|
60
|
+
if (n().useMock) {
|
|
61
|
+
await a().signOut();
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
|
-
if (!await
|
|
64
|
+
if (!await a().isSignedIn())
|
|
65
65
|
throw new Error("User not signed in");
|
|
66
|
-
await
|
|
66
|
+
await a().signOut();
|
|
67
67
|
try {
|
|
68
|
-
const r =
|
|
68
|
+
const r = l();
|
|
69
69
|
if (r.secureStorage)
|
|
70
70
|
try {
|
|
71
71
|
await r.secureStorage.removeItem("cdp_refresh_token");
|
|
72
|
-
} catch (
|
|
73
|
-
console.warn("Failed to clear stored refresh token:",
|
|
72
|
+
} catch (t) {
|
|
73
|
+
console.warn("Failed to clear stored refresh token:", t);
|
|
74
74
|
}
|
|
75
75
|
} catch {
|
|
76
76
|
}
|
|
77
|
-
},
|
|
78
|
-
|
|
79
|
-
},
|
|
80
|
-
signature: (await
|
|
77
|
+
}, oe = async () => a().getToken(), ie = (e) => {
|
|
78
|
+
a().addAuthStateChangeCallback(e);
|
|
79
|
+
}, ue = async (e) => n().useMock ? { signature: "0x0" } : o(e, a(), async ({ user: r, walletSecretId: t }) => ({
|
|
80
|
+
signature: (await U(n().projectId, r.userId, {
|
|
81
81
|
hash: e.hash,
|
|
82
82
|
address: e.evmAccount,
|
|
83
|
-
walletSecretId:
|
|
83
|
+
walletSecretId: t
|
|
84
84
|
})).signature
|
|
85
|
-
})),
|
|
86
|
-
const
|
|
85
|
+
})), de = async (e) => n().useMock ? { signedTransaction: "0x0" } : o(e, a(), async ({ user: r, walletSecretId: t }) => {
|
|
86
|
+
const s = w(e.transaction);
|
|
87
87
|
return {
|
|
88
|
-
signedTransaction: (await
|
|
89
|
-
|
|
88
|
+
signedTransaction: (await T(
|
|
89
|
+
n().projectId,
|
|
90
90
|
r.userId,
|
|
91
91
|
{
|
|
92
|
-
transaction:
|
|
92
|
+
transaction: s,
|
|
93
93
|
address: e.evmAccount,
|
|
94
|
-
walletSecretId:
|
|
94
|
+
walletSecretId: t
|
|
95
95
|
}
|
|
96
96
|
)).signedTransaction
|
|
97
97
|
};
|
|
98
|
-
}),
|
|
98
|
+
}), ge = async (e) => n().useMock ? { signedTransaction: "mock-signed-transaction" } : o(e, a(), async ({ user: r, walletSecretId: t }) => ({
|
|
99
|
+
signedTransaction: (await M(
|
|
100
|
+
n().projectId,
|
|
101
|
+
r.userId,
|
|
102
|
+
{
|
|
103
|
+
transaction: e.transaction,
|
|
104
|
+
address: e.solanaAccount,
|
|
105
|
+
walletSecretId: t
|
|
106
|
+
}
|
|
107
|
+
)).signedTransaction
|
|
108
|
+
})), me = async (e) => {
|
|
99
109
|
if (!_(e.network))
|
|
100
110
|
throw new Error(`Chain ${e.network} is not supported by the CDP Apis`);
|
|
101
|
-
if (
|
|
111
|
+
if (n().useMock)
|
|
102
112
|
return { transactionHash: "0x0" };
|
|
103
|
-
const r =
|
|
104
|
-
return
|
|
113
|
+
const r = w(e.transaction);
|
|
114
|
+
return o(e, a(), async ({ user: t, walletSecretId: s }) => ({
|
|
105
115
|
transactionHash: (await j(
|
|
106
|
-
|
|
107
|
-
|
|
116
|
+
n().projectId,
|
|
117
|
+
t.userId,
|
|
108
118
|
{
|
|
109
119
|
transaction: r,
|
|
110
120
|
address: e.evmAccount,
|
|
111
|
-
walletSecretId:
|
|
121
|
+
walletSecretId: s,
|
|
112
122
|
network: e.network
|
|
113
123
|
}
|
|
114
124
|
)).transactionHash
|
|
115
125
|
}));
|
|
116
|
-
},
|
|
117
|
-
|
|
126
|
+
}, le = async (e) => n().useMock ? { transactionSignature: "mock-signature" } : o(e, a(), async ({ user: r, walletSecretId: t }) => ({
|
|
127
|
+
transactionSignature: (await P(
|
|
128
|
+
n().projectId,
|
|
129
|
+
r.userId,
|
|
130
|
+
{
|
|
131
|
+
transaction: e.transaction,
|
|
132
|
+
address: e.solanaAccount,
|
|
133
|
+
walletSecretId: t,
|
|
134
|
+
network: e.network
|
|
135
|
+
}
|
|
136
|
+
)).transactionSignature
|
|
137
|
+
})), we = async (e) => n().useMock ? { signature: "0x0" } : o(e, a(), async ({ user: r, walletSecretId: t }) => ({
|
|
138
|
+
signature: (await O(n().projectId, r.userId, {
|
|
118
139
|
message: e.message,
|
|
119
140
|
address: e.evmAccount,
|
|
120
|
-
walletSecretId:
|
|
141
|
+
walletSecretId: t
|
|
121
142
|
})).signature
|
|
122
|
-
})),
|
|
123
|
-
signature: (await
|
|
143
|
+
})), pe = async (e) => n().useMock ? { signature: "0x0" } : o(e, a(), async ({ user: r, walletSecretId: t }) => ({
|
|
144
|
+
signature: (await C(n().projectId, r.userId, {
|
|
124
145
|
typedData: e.typedData,
|
|
125
146
|
address: e.evmAccount,
|
|
126
|
-
walletSecretId:
|
|
147
|
+
walletSecretId: t
|
|
127
148
|
})).signature
|
|
128
|
-
})),
|
|
149
|
+
})), ye = async (e) => n().useMock ? {
|
|
129
150
|
userOperationHash: "0x1234567890123456789012345678901234567890123456789012345678901234"
|
|
130
|
-
} :
|
|
151
|
+
} : o(e, a(), async ({ user: r, walletSecretId: t }) => ({
|
|
131
152
|
userOperationHash: (await x(
|
|
132
|
-
|
|
153
|
+
n().projectId,
|
|
133
154
|
r.userId,
|
|
134
155
|
e.evmSmartAccount,
|
|
135
156
|
{
|
|
@@ -139,12 +160,12 @@ const Y = async (e) => {
|
|
|
139
160
|
value: String(c.value ?? 0n),
|
|
140
161
|
data: c.data ?? "0x"
|
|
141
162
|
})),
|
|
142
|
-
walletSecretId:
|
|
163
|
+
walletSecretId: t,
|
|
143
164
|
useCdpPaymaster: e.useCdpPaymaster ?? !1,
|
|
144
165
|
paymasterUrl: e.paymasterUrl
|
|
145
166
|
}
|
|
146
167
|
)).userOpHash
|
|
147
|
-
})),
|
|
168
|
+
})), fe = async (e) => n().useMock ? {
|
|
148
169
|
userOpHash: e.userOperationHash,
|
|
149
170
|
network: e.network,
|
|
150
171
|
calls: [
|
|
@@ -157,122 +178,155 @@ const Y = async (e) => {
|
|
|
157
178
|
status: "complete",
|
|
158
179
|
transactionHash: "0x9876543210987654321098765432109876543210987654321098765432109876",
|
|
159
180
|
receipts: []
|
|
160
|
-
} :
|
|
161
|
-
|
|
181
|
+
} : o(e, a(), async ({ user: r }) => await W(
|
|
182
|
+
n().projectId,
|
|
162
183
|
r.userId,
|
|
163
184
|
e.evmSmartAccount,
|
|
164
185
|
e.userOperationHash
|
|
165
|
-
)),
|
|
166
|
-
if (
|
|
186
|
+
)), he = async (e) => {
|
|
187
|
+
if (n().useMock)
|
|
167
188
|
return {
|
|
168
189
|
privateKey: "mock-private-key"
|
|
169
190
|
};
|
|
170
|
-
const r = D(),
|
|
171
|
-
return
|
|
172
|
-
const
|
|
191
|
+
const r = D(), t = await r.createExportKeyPair();
|
|
192
|
+
return o(e, a(), async ({ user: s, walletSecretId: c }) => {
|
|
193
|
+
const i = await H(n().projectId, s.userId, {
|
|
173
194
|
address: e.evmAccount,
|
|
174
195
|
walletSecretId: c,
|
|
175
|
-
exportEncryptionKey:
|
|
196
|
+
exportEncryptionKey: t.publicKeyBase64
|
|
176
197
|
});
|
|
177
198
|
return {
|
|
178
199
|
privateKey: await r.decryptWithPrivateKey(
|
|
179
|
-
|
|
180
|
-
|
|
200
|
+
t.privateKey,
|
|
201
|
+
i.encryptedPrivateKey
|
|
181
202
|
)
|
|
182
203
|
};
|
|
183
204
|
});
|
|
184
|
-
},
|
|
185
|
-
if (
|
|
205
|
+
}, p = async (e) => {
|
|
206
|
+
if (n().useMock)
|
|
186
207
|
return {
|
|
187
208
|
message: "Mock sign in initiated",
|
|
188
209
|
flowId: "mock-flow-id"
|
|
189
210
|
};
|
|
190
|
-
if (await
|
|
211
|
+
if (await a().isSignedIn())
|
|
191
212
|
throw new Error("User is already authenticated. Please sign out first.");
|
|
192
|
-
const
|
|
213
|
+
const t = await A(n().projectId, e);
|
|
193
214
|
return {
|
|
194
|
-
flowId:
|
|
195
|
-
message:
|
|
215
|
+
flowId: t.flowId,
|
|
216
|
+
message: t.message
|
|
196
217
|
};
|
|
197
|
-
},
|
|
198
|
-
if (
|
|
199
|
-
return await
|
|
218
|
+
}, y = async (e, r, t) => {
|
|
219
|
+
if (n().useMock)
|
|
220
|
+
return await a().setAuthState({
|
|
200
221
|
accessToken: "mock-access-token",
|
|
201
222
|
expiresAt: Date.now() + 1e3 * 60 * 60 * 24,
|
|
202
|
-
user:
|
|
223
|
+
user: g
|
|
203
224
|
}), {
|
|
204
225
|
message: r,
|
|
205
|
-
user:
|
|
226
|
+
user: g,
|
|
206
227
|
isNewUser: !1
|
|
207
228
|
};
|
|
208
|
-
if (await
|
|
229
|
+
if (await a().isSignedIn())
|
|
209
230
|
throw new Error("User is already authenticated. Please sign out first.");
|
|
210
|
-
const c = await
|
|
231
|
+
const c = await t(n().projectId, {
|
|
211
232
|
flowId: e.flowId,
|
|
212
233
|
otp: e.otp
|
|
213
|
-
})
|
|
214
|
-
|
|
215
|
-
|
|
234
|
+
}), i = u(
|
|
235
|
+
c.accessToken,
|
|
236
|
+
c.validUntil,
|
|
237
|
+
c.endUser
|
|
238
|
+
);
|
|
239
|
+
return await a().setAuthState(i), n().createAccountOnLogin === "solana" ? F({ authResponse: c, authState: i }) : z({ authResponse: c, authState: i });
|
|
240
|
+
}, z = async ({
|
|
241
|
+
authResponse: e,
|
|
242
|
+
authState: r
|
|
243
|
+
}) => {
|
|
244
|
+
if (!r.user.evmAccounts || r.user.evmAccounts.length === 0)
|
|
216
245
|
try {
|
|
217
|
-
const
|
|
218
|
-
let
|
|
219
|
-
walletSecretId:
|
|
246
|
+
const s = await a().getWalletSecretId();
|
|
247
|
+
let c = await k(n().projectId, r.user.userId, {
|
|
248
|
+
walletSecretId: s
|
|
220
249
|
});
|
|
221
|
-
if (
|
|
222
|
-
const [
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
250
|
+
if (n().createAccountOnLogin === "evm-smart") {
|
|
251
|
+
const [i] = c.evmAccounts;
|
|
252
|
+
c = await d(
|
|
253
|
+
n().projectId,
|
|
254
|
+
r.user.userId,
|
|
226
255
|
{
|
|
227
|
-
owner:
|
|
256
|
+
owner: i,
|
|
228
257
|
enableSpendPermissions: !1
|
|
229
258
|
// Defaulting to false until the feature is ready.
|
|
230
259
|
}
|
|
231
260
|
);
|
|
232
261
|
}
|
|
233
|
-
|
|
234
|
-
} catch (
|
|
235
|
-
throw new Error(`Failed to create EVM account: ${
|
|
262
|
+
r = u(e.accessToken, e.validUntil, c), await a().setAuthState(r);
|
|
263
|
+
} catch (s) {
|
|
264
|
+
throw new Error(`Failed to create EVM account: ${s}`);
|
|
236
265
|
}
|
|
237
|
-
if (
|
|
266
|
+
if (n().createAccountOnLogin === "evm-smart" && (!r.user.evmSmartAccounts || r.user.evmSmartAccounts.length === 0))
|
|
238
267
|
try {
|
|
239
|
-
const [
|
|
240
|
-
|
|
241
|
-
|
|
268
|
+
const [s] = r.user.evmAccounts, c = await d(
|
|
269
|
+
n().projectId,
|
|
270
|
+
r.user.userId,
|
|
242
271
|
{
|
|
243
|
-
owner:
|
|
272
|
+
owner: s,
|
|
244
273
|
enableSpendPermissions: !1
|
|
245
274
|
// Defaulting to false until the feature is ready.
|
|
246
275
|
}
|
|
247
276
|
);
|
|
248
|
-
|
|
249
|
-
} catch (
|
|
250
|
-
throw new Error(`Failed to create EVM Smart Account: ${
|
|
277
|
+
r = u(e.accessToken, e.validUntil, c), await a().setAuthState(r);
|
|
278
|
+
} catch (s) {
|
|
279
|
+
throw new Error(`Failed to create EVM Smart Account: ${s}`);
|
|
251
280
|
}
|
|
252
|
-
const
|
|
281
|
+
const t = await a().getUser();
|
|
253
282
|
return {
|
|
254
|
-
message:
|
|
255
|
-
user:
|
|
256
|
-
isNewUser:
|
|
283
|
+
message: e.message,
|
|
284
|
+
user: t,
|
|
285
|
+
isNewUser: e.isNewEndUser
|
|
286
|
+
};
|
|
287
|
+
}, F = async ({
|
|
288
|
+
authResponse: e,
|
|
289
|
+
authState: r
|
|
290
|
+
}) => {
|
|
291
|
+
if (!r.user.solanaAccounts || r.user.solanaAccounts.length === 0)
|
|
292
|
+
try {
|
|
293
|
+
const s = await a().getWalletSecretId(), c = await v(
|
|
294
|
+
n().projectId,
|
|
295
|
+
r.user.userId,
|
|
296
|
+
{
|
|
297
|
+
walletSecretId: s
|
|
298
|
+
}
|
|
299
|
+
);
|
|
300
|
+
r = u(e.accessToken, e.validUntil, c), await a().setAuthState(r);
|
|
301
|
+
} catch (s) {
|
|
302
|
+
throw new Error(`Failed to create Solana account: ${s}`);
|
|
303
|
+
}
|
|
304
|
+
const t = await a().getUser();
|
|
305
|
+
return {
|
|
306
|
+
message: e.message,
|
|
307
|
+
user: t,
|
|
308
|
+
isNewUser: e.isNewEndUser
|
|
257
309
|
};
|
|
258
310
|
};
|
|
259
311
|
export {
|
|
260
|
-
|
|
261
|
-
|
|
312
|
+
he as exportEvmAccount,
|
|
313
|
+
oe as getAccessToken,
|
|
262
314
|
se as getCurrentUser,
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
ee as
|
|
275
|
-
|
|
315
|
+
fe as getUserOperation,
|
|
316
|
+
R as initialize,
|
|
317
|
+
ae as isSignedIn,
|
|
318
|
+
ie as onAuthStateChange,
|
|
319
|
+
me as sendEvmTransaction,
|
|
320
|
+
le as sendSolanaTransaction,
|
|
321
|
+
ye as sendUserOperation,
|
|
322
|
+
ue as signEvmHash,
|
|
323
|
+
we as signEvmMessage,
|
|
324
|
+
de as signEvmTransaction,
|
|
325
|
+
pe as signEvmTypedData,
|
|
326
|
+
ee as signInWithEmail,
|
|
327
|
+
re as signInWithSms,
|
|
328
|
+
ce as signOut,
|
|
329
|
+
ge as signSolanaTransaction,
|
|
276
330
|
te as verifyEmailOTP,
|
|
277
|
-
|
|
331
|
+
ne as verifySmsOTP
|
|
278
332
|
};
|
package/dist/esm/index.web84.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HashMD as D, SHA256_IV as b, Chi as g, Maj as p } from "./index.
|
|
1
|
+
import { HashMD as D, SHA256_IV as b, Chi as g, Maj as p } from "./index.web94.js";
|
|
2
2
|
import { createHasher as u, clean as C, rotr as i } from "./index.web83.js";
|
|
3
3
|
const B = /* @__PURE__ */ Uint32Array.from([
|
|
4
4
|
1116352408,
|
package/dist/esm/index.web93.js
CHANGED
|
@@ -1,81 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
function _(o, t, s) {
|
|
12
|
-
return o & t ^ o & s ^ t & s;
|
|
13
|
-
}
|
|
14
|
-
class m extends g {
|
|
15
|
-
constructor(t, s, n, i) {
|
|
16
|
-
super(), this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.blockLen = t, this.outputLen = s, this.padOffset = n, this.isLE = i, this.buffer = new Uint8Array(t), this.view = l(this.buffer);
|
|
17
|
-
}
|
|
18
|
-
update(t) {
|
|
19
|
-
b(this), t = a(t), d(t);
|
|
20
|
-
const { view: s, buffer: n, blockLen: i } = this, h = t.length;
|
|
21
|
-
for (let e = 0; e < h; ) {
|
|
22
|
-
const r = Math.min(i - this.pos, h - e);
|
|
23
|
-
if (r === i) {
|
|
24
|
-
const c = l(t);
|
|
25
|
-
for (; i <= h - e; e += i)
|
|
26
|
-
this.process(c, e);
|
|
27
|
-
continue;
|
|
28
|
-
}
|
|
29
|
-
n.set(t.subarray(e, e + r), this.pos), this.pos += r, e += r, this.pos === i && (this.process(s, 0), this.pos = 0);
|
|
30
|
-
}
|
|
31
|
-
return this.length += t.length, this.roundClean(), this;
|
|
32
|
-
}
|
|
33
|
-
digestInto(t) {
|
|
34
|
-
b(this), x(t, this), this.finished = !0;
|
|
35
|
-
const { buffer: s, view: n, blockLen: i, isLE: h } = this;
|
|
36
|
-
let { pos: e } = this;
|
|
37
|
-
s[e++] = 128, w(this.buffer.subarray(e)), this.padOffset > i - e && (this.process(n, 0), e = 0);
|
|
38
|
-
for (let f = e; f < i; f++)
|
|
39
|
-
s[f] = 0;
|
|
40
|
-
y(n, i - 8, BigInt(this.length * 8), h), this.process(n, 0);
|
|
41
|
-
const r = l(t), c = this.outputLen;
|
|
42
|
-
if (c % 4)
|
|
43
|
-
throw new Error("_sha2: outputLen should be aligned to 32bit");
|
|
44
|
-
const u = c / 4, p = this.get();
|
|
45
|
-
if (u > p.length)
|
|
46
|
-
throw new Error("_sha2: outputLen bigger than state");
|
|
47
|
-
for (let f = 0; f < u; f++)
|
|
48
|
-
r.setUint32(4 * f, p[f], h);
|
|
49
|
-
}
|
|
50
|
-
digest() {
|
|
51
|
-
const { buffer: t, outputLen: s } = this;
|
|
52
|
-
this.digestInto(t);
|
|
53
|
-
const n = t.slice(0, s);
|
|
54
|
-
return this.destroy(), n;
|
|
55
|
-
}
|
|
56
|
-
_cloneInto(t) {
|
|
57
|
-
t || (t = new this.constructor()), t.set(...this.get());
|
|
58
|
-
const { blockLen: s, buffer: n, length: i, finished: h, destroyed: e, pos: r } = this;
|
|
59
|
-
return t.destroyed = e, t.finished = h, t.length = i, t.pos = r, i % s && t.buffer.set(n), t;
|
|
60
|
-
}
|
|
61
|
-
clone() {
|
|
62
|
-
return this._cloneInto();
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
const B = /* @__PURE__ */ Uint32Array.from([
|
|
66
|
-
1779033703,
|
|
67
|
-
3144134277,
|
|
68
|
-
1013904242,
|
|
69
|
-
2773480762,
|
|
70
|
-
1359893119,
|
|
71
|
-
2600822924,
|
|
72
|
-
528734635,
|
|
73
|
-
1541459225
|
|
74
|
-
]);
|
|
1
|
+
import { contracts as o } from "./index.web104.js";
|
|
2
|
+
import { formatters as r } from "./index.web105.js";
|
|
3
|
+
import { serializers as t } from "./index.web106.js";
|
|
4
|
+
const e = {
|
|
5
|
+
blockTime: 2e3,
|
|
6
|
+
contracts: o,
|
|
7
|
+
formatters: r,
|
|
8
|
+
serializers: t
|
|
9
|
+
};
|
|
75
10
|
export {
|
|
76
|
-
|
|
77
|
-
m as HashMD,
|
|
78
|
-
_ as Maj,
|
|
79
|
-
B as SHA256_IV,
|
|
80
|
-
y as setBigUint64
|
|
11
|
+
e as chainConfig
|
|
81
12
|
};
|
package/dist/esm/index.web94.js
CHANGED
|
@@ -1,12 +1,81 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { Hash as g, createView as l, aexists as b, toBytes as a, abytes as d, aoutput as x, clean as w } from "./index.web83.js";
|
|
2
|
+
function y(o, t, s, n) {
|
|
3
|
+
if (typeof o.setBigUint64 == "function")
|
|
4
|
+
return o.setBigUint64(t, s, n);
|
|
5
|
+
const i = BigInt(32), h = BigInt(4294967295), e = Number(s >> i & h), r = Number(s & h), c = n ? 4 : 0, u = n ? 0 : 4;
|
|
6
|
+
o.setUint32(t + c, e, n), o.setUint32(t + u, r, n);
|
|
7
|
+
}
|
|
8
|
+
function U(o, t, s) {
|
|
9
|
+
return o & t ^ ~o & s;
|
|
10
|
+
}
|
|
11
|
+
function _(o, t, s) {
|
|
12
|
+
return o & t ^ o & s ^ t & s;
|
|
13
|
+
}
|
|
14
|
+
class m extends g {
|
|
15
|
+
constructor(t, s, n, i) {
|
|
16
|
+
super(), this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.blockLen = t, this.outputLen = s, this.padOffset = n, this.isLE = i, this.buffer = new Uint8Array(t), this.view = l(this.buffer);
|
|
17
|
+
}
|
|
18
|
+
update(t) {
|
|
19
|
+
b(this), t = a(t), d(t);
|
|
20
|
+
const { view: s, buffer: n, blockLen: i } = this, h = t.length;
|
|
21
|
+
for (let e = 0; e < h; ) {
|
|
22
|
+
const r = Math.min(i - this.pos, h - e);
|
|
23
|
+
if (r === i) {
|
|
24
|
+
const c = l(t);
|
|
25
|
+
for (; i <= h - e; e += i)
|
|
26
|
+
this.process(c, e);
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
n.set(t.subarray(e, e + r), this.pos), this.pos += r, e += r, this.pos === i && (this.process(s, 0), this.pos = 0);
|
|
30
|
+
}
|
|
31
|
+
return this.length += t.length, this.roundClean(), this;
|
|
32
|
+
}
|
|
33
|
+
digestInto(t) {
|
|
34
|
+
b(this), x(t, this), this.finished = !0;
|
|
35
|
+
const { buffer: s, view: n, blockLen: i, isLE: h } = this;
|
|
36
|
+
let { pos: e } = this;
|
|
37
|
+
s[e++] = 128, w(this.buffer.subarray(e)), this.padOffset > i - e && (this.process(n, 0), e = 0);
|
|
38
|
+
for (let f = e; f < i; f++)
|
|
39
|
+
s[f] = 0;
|
|
40
|
+
y(n, i - 8, BigInt(this.length * 8), h), this.process(n, 0);
|
|
41
|
+
const r = l(t), c = this.outputLen;
|
|
42
|
+
if (c % 4)
|
|
43
|
+
throw new Error("_sha2: outputLen should be aligned to 32bit");
|
|
44
|
+
const u = c / 4, p = this.get();
|
|
45
|
+
if (u > p.length)
|
|
46
|
+
throw new Error("_sha2: outputLen bigger than state");
|
|
47
|
+
for (let f = 0; f < u; f++)
|
|
48
|
+
r.setUint32(4 * f, p[f], h);
|
|
49
|
+
}
|
|
50
|
+
digest() {
|
|
51
|
+
const { buffer: t, outputLen: s } = this;
|
|
52
|
+
this.digestInto(t);
|
|
53
|
+
const n = t.slice(0, s);
|
|
54
|
+
return this.destroy(), n;
|
|
55
|
+
}
|
|
56
|
+
_cloneInto(t) {
|
|
57
|
+
t || (t = new this.constructor()), t.set(...this.get());
|
|
58
|
+
const { blockLen: s, buffer: n, length: i, finished: h, destroyed: e, pos: r } = this;
|
|
59
|
+
return t.destroyed = e, t.finished = h, t.length = i, t.pos = r, i % s && t.buffer.set(n), t;
|
|
60
|
+
}
|
|
61
|
+
clone() {
|
|
62
|
+
return this._cloneInto();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const B = /* @__PURE__ */ Uint32Array.from([
|
|
66
|
+
1779033703,
|
|
67
|
+
3144134277,
|
|
68
|
+
1013904242,
|
|
69
|
+
2773480762,
|
|
70
|
+
1359893119,
|
|
71
|
+
2600822924,
|
|
72
|
+
528734635,
|
|
73
|
+
1541459225
|
|
74
|
+
]);
|
|
10
75
|
export {
|
|
11
|
-
|
|
76
|
+
U as Chi,
|
|
77
|
+
m as HashMD,
|
|
78
|
+
_ as Maj,
|
|
79
|
+
B as SHA256_IV,
|
|
80
|
+
y as setBigUint64
|
|
12
81
|
};
|