@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
|
@@ -74,6 +74,14 @@ class I {
|
|
|
74
74
|
async getToken() {
|
|
75
75
|
return this.shouldRefreshToken() && await this.refreshAccessToken(), this.authState?.accessToken ?? null;
|
|
76
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Gets the expiration time of the access token, or null if the user is not signed in.
|
|
79
|
+
*
|
|
80
|
+
* @returns The expiration time of the access token.
|
|
81
|
+
*/
|
|
82
|
+
async getTokenExpiration() {
|
|
83
|
+
return this.authState?.expiresAt ?? null;
|
|
84
|
+
}
|
|
77
85
|
/**
|
|
78
86
|
* Gets the currently registered wallet secret ID. Rejects if the user is not signed in.
|
|
79
87
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { __require as r } from "./index.
|
|
1
|
+
import { __require as r } from "./index.native146.js";
|
|
2
2
|
r();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "@coinbase/cdp-api-client";
|
|
2
2
|
import "viem";
|
|
3
3
|
import { mockUser as e } from "./index.native31.js";
|
|
4
|
-
class
|
|
4
|
+
class h {
|
|
5
5
|
authState = null;
|
|
6
6
|
authStateChangeCallback = null;
|
|
7
7
|
/**
|
|
@@ -62,6 +62,14 @@ class r {
|
|
|
62
62
|
async getToken() {
|
|
63
63
|
return this.authState ? (this.authState.expiresAt <= Date.now() && await this.refreshToken(), this.authState?.accessToken ?? null) : null;
|
|
64
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Gets the expiration time of the access token, or null if the user is not signed in.
|
|
67
|
+
*
|
|
68
|
+
* @returns The expiration time of the access token.
|
|
69
|
+
*/
|
|
70
|
+
async getTokenExpiration() {
|
|
71
|
+
return this.authState?.expiresAt ?? null;
|
|
72
|
+
}
|
|
65
73
|
/**
|
|
66
74
|
* Gets the currentlly registered wallet secret ID.
|
|
67
75
|
*
|
|
@@ -117,5 +125,5 @@ class r {
|
|
|
117
125
|
}
|
|
118
126
|
}
|
|
119
127
|
export {
|
|
120
|
-
|
|
128
|
+
h as MockAuthManager
|
|
121
129
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { b as m } from "./index.native23.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.native24.js";
|
|
4
4
|
import "./index.native25.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.native16.js";
|
|
8
8
|
import { OAuthManager as G } from "./index.native26.js";
|
|
9
|
-
import { toAuthState as
|
|
9
|
+
import { toAuthState as p } from "./index.native27.js";
|
|
10
10
|
import { withAuth as u } from "./index.native28.js";
|
|
11
11
|
import { MockAuthManager as J } from "./index.native29.js";
|
|
12
12
|
import { MockOAuthManager as Q } from "./index.native30.js";
|
|
13
13
|
import { mockUser as k } from "./index.native31.js";
|
|
14
14
|
import { getPlatformServices as g, getPlatformCrypto as _ } from "./index.native6.js";
|
|
15
15
|
import { isChainSupportedForCDPSends as X } from "./index.native32.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.native22.js";
|
|
17
17
|
import "viem";
|
|
18
18
|
import { serializeTransaction as U } from "./index.native33.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/esm/index.web.js
CHANGED
|
@@ -2,22 +2,22 @@ import { setPlatformServices as r } from "./index.web2.js";
|
|
|
2
2
|
import { webCrypto as o } from "./index.web3.js";
|
|
3
3
|
import { webOAuth as e } from "./index.web4.js";
|
|
4
4
|
import { webStorage as t } from "./index.web5.js";
|
|
5
|
-
import { exportEvmAccount as
|
|
6
|
-
import { createSpendPermission as
|
|
7
|
-
import { listSpendPermissions as
|
|
8
|
-
import { APIError as
|
|
9
|
-
import { revokeSpendPermission as
|
|
10
|
-
import { linkGoogle as
|
|
11
|
-
import { linkSms as
|
|
12
|
-
import { linkEmail as
|
|
13
|
-
import { linkOAuth as
|
|
14
|
-
import { linkApple as
|
|
15
|
-
import { AuthManager as
|
|
5
|
+
import { exportEvmAccount as g, exportSolanaAccount as l, getAccessToken as E, getAccessTokenExpiration as d, getCurrentUser as S, getUserOperation as u, initialize as A, isSignedIn as x, onAuthStateChange as h, onOAuthStateChange as T, sendEvmTransaction as v, sendSolanaTransaction as O, sendUserOperation as y, signEvmHash as P, signEvmMessage as k, signEvmTransaction as I, signEvmTypedData as C, signInWithEmail as W, signInWithOAuth as w, signInWithSms as D, signOut as R, signSolanaMessage as U, signSolanaTransaction as b, verifyEmailOTP as M, verifyOAuth as N, verifySmsOTP as B } from "./index.web6.js";
|
|
6
|
+
import { createSpendPermission as V } from "./index.web7.js";
|
|
7
|
+
import { listSpendPermissions as z } from "./index.web8.js";
|
|
8
|
+
import { APIError as j, ErrorType as q, HttpErrorType as F, OAuth2ProviderType as J, SendEvmTransactionWithEndUserAccountBodyNetwork as K, SendSolanaTransactionWithEndUserAccountBodyNetwork as L } from "@coinbase/cdp-api-client";
|
|
9
|
+
import { revokeSpendPermission as X } from "./index.web9.js";
|
|
10
|
+
import { linkGoogle as Z } from "./index.web10.js";
|
|
11
|
+
import { linkSms as rr } from "./index.web11.js";
|
|
12
|
+
import { linkEmail as er } from "./index.web12.js";
|
|
13
|
+
import { linkOAuth as nr } from "./index.web13.js";
|
|
14
|
+
import { linkApple as ar } from "./index.web14.js";
|
|
15
|
+
import { AuthManager as mr } from "./index.web15.js";
|
|
16
16
|
import "viem";
|
|
17
|
-
import { toViemAccount as
|
|
18
|
-
import { InputValidationError as
|
|
19
|
-
import { createCDPEmbeddedWallet as
|
|
20
|
-
import { EIP1193ProviderError as
|
|
17
|
+
import { toViemAccount as cr } from "./index.web16.js";
|
|
18
|
+
import { InputValidationError as gr, ModuleResolutionError as lr } from "./index.web17.js";
|
|
19
|
+
import { createCDPEmbeddedWallet as dr } from "./index.web18.js";
|
|
20
|
+
import { EIP1193ProviderError as ur, STANDARD_ERROR_CODES as Ar } from "./index.web19.js";
|
|
21
21
|
import "zustand";
|
|
22
22
|
r({
|
|
23
23
|
crypto: o,
|
|
@@ -25,50 +25,51 @@ r({
|
|
|
25
25
|
oauth: e
|
|
26
26
|
});
|
|
27
27
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
28
|
+
j as APIError,
|
|
29
|
+
mr as AuthManager,
|
|
30
|
+
ur as EIP1193ProviderError,
|
|
31
|
+
q as ErrorType,
|
|
32
|
+
F as HttpErrorType,
|
|
33
|
+
gr as InputValidationError,
|
|
34
|
+
lr as ModuleResolutionError,
|
|
35
|
+
J as OAuth2ProviderType,
|
|
36
|
+
Ar as STANDARD_ERROR_CODES,
|
|
37
|
+
K as SendEvmTransactionWithEndUserAccountBodyNetwork,
|
|
38
|
+
L as SendSolanaTransactionWithEndUserAccountBodyNetwork,
|
|
39
|
+
dr as createCDPEmbeddedWallet,
|
|
40
|
+
V as createSpendPermission,
|
|
41
|
+
g as exportEvmAccount,
|
|
42
|
+
l as exportSolanaAccount,
|
|
43
43
|
E as getAccessToken,
|
|
44
|
-
d as
|
|
45
|
-
S as
|
|
46
|
-
u as
|
|
47
|
-
A as
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
d as getAccessTokenExpiration,
|
|
45
|
+
S as getCurrentUser,
|
|
46
|
+
u as getUserOperation,
|
|
47
|
+
A as initialize,
|
|
48
|
+
x as isSignedIn,
|
|
49
|
+
ar as linkApple,
|
|
50
|
+
er as linkEmail,
|
|
51
|
+
Z as linkGoogle,
|
|
52
|
+
nr as linkOAuth,
|
|
53
|
+
rr as linkSms,
|
|
54
|
+
z as listSpendPermissions,
|
|
54
55
|
h as onAuthStateChange,
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
T as onOAuthStateChange,
|
|
57
|
+
X as revokeSpendPermission,
|
|
57
58
|
v as sendEvmTransaction,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
59
|
+
O as sendSolanaTransaction,
|
|
60
|
+
y as sendUserOperation,
|
|
61
|
+
P as signEvmHash,
|
|
62
|
+
k as signEvmMessage,
|
|
63
|
+
I as signEvmTransaction,
|
|
64
|
+
C as signEvmTypedData,
|
|
65
|
+
W as signInWithEmail,
|
|
66
|
+
w as signInWithOAuth,
|
|
67
|
+
D as signInWithSms,
|
|
68
|
+
R as signOut,
|
|
69
|
+
U as signSolanaMessage,
|
|
70
|
+
b as signSolanaTransaction,
|
|
71
|
+
cr as toViemAccount,
|
|
72
|
+
M as verifyEmailOTP,
|
|
73
|
+
N as verifyOAuth,
|
|
74
|
+
B as verifySmsOTP
|
|
74
75
|
};
|
package/dist/esm/index.web126.js
CHANGED
package/dist/esm/index.web130.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.web136.js";
|
|
2
2
|
import { createHasher as u, clean as C, rotr as i } from "./index.web129.js";
|
|
3
3
|
const B = /* @__PURE__ */ Uint32Array.from([
|
|
4
4
|
1116352408,
|
package/dist/esm/index.web133.js
CHANGED
|
@@ -1,81 +1,4 @@
|
|
|
1
|
-
|
|
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
|
-
]);
|
|
1
|
+
const o = "0.1.1";
|
|
75
2
|
export {
|
|
76
|
-
|
|
77
|
-
m as HashMD,
|
|
78
|
-
_ as Maj,
|
|
79
|
-
B as SHA256_IV,
|
|
80
|
-
y as setBigUint64
|
|
3
|
+
o as version
|
|
81
4
|
};
|