@coinbase/cdp-core 0.0.80 → 0.0.81
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 +15 -13
- package/dist/esm/index.native10.js +1 -1
- package/dist/esm/index.native11.js +1 -1
- package/dist/esm/index.native12.js +1 -1
- package/dist/esm/index.native122.js +1 -1
- package/dist/esm/index.native123.js +1 -1
- package/dist/esm/index.native125.js +6 -6
- package/dist/esm/index.native13.js +1 -1
- package/dist/esm/index.native14.js +1 -1
- package/dist/esm/index.native155.js +1 -1
- package/dist/esm/index.native16.js +1 -1
- package/dist/esm/index.native162.js +20 -4
- package/dist/esm/index.native163.js +10 -21
- package/dist/esm/index.native164.js +19 -9
- package/dist/esm/index.native165.js +89 -15
- package/dist/esm/index.native166.js +19 -92
- package/dist/esm/index.native167.js +115 -18
- package/dist/esm/index.native168.js +5 -118
- package/dist/esm/index.native17.js +1 -1
- package/dist/esm/index.native172.js +38 -7
- package/dist/esm/index.native174.js +67 -375
- package/dist/esm/index.native175.js +34 -835
- package/dist/esm/index.native176.js +20 -38
- package/dist/esm/index.native177.js +8 -2
- package/dist/esm/index.native178.js +2 -70
- package/dist/esm/index.native179.js +373 -30
- package/dist/esm/index.native18.js +1 -1
- package/dist/esm/index.native180.js +835 -20
- package/dist/esm/index.native182.js +18 -2
- package/dist/esm/index.native183.js +28 -109
- package/dist/esm/index.native184.js +8 -2
- package/dist/esm/index.native185.js +11 -18
- package/dist/esm/index.native186.js +13 -28
- package/dist/esm/index.native187.js +10 -8
- package/dist/esm/index.native188.js +17 -11
- package/dist/esm/index.native189.js +80 -12
- package/dist/esm/index.native19.js +1 -1
- package/dist/esm/index.native190.js +2 -10
- package/dist/esm/index.native191.js +108 -16
- package/dist/esm/index.native192.js +2 -81
- package/dist/esm/index.native194.js +2 -2
- package/dist/esm/index.native195.js +2 -2
- package/dist/esm/index.native196.js +2 -2
- package/dist/esm/index.native20.js +1 -1
- package/dist/esm/index.native21.js +1 -1
- package/dist/esm/index.native22.js +1 -1
- package/dist/esm/index.native23.js +1 -1
- package/dist/esm/index.native24.js +1 -1
- package/dist/esm/index.native25.js +1 -1
- package/dist/esm/index.native26.js +1 -1
- package/dist/esm/index.native28.js +1 -1
- package/dist/esm/index.native29.js +1 -1
- package/dist/esm/index.native3.js +1 -1
- package/dist/esm/index.native30.js +1 -1
- package/dist/esm/index.native31.js +1 -1
- package/dist/esm/index.native32.js +1 -1
- package/dist/esm/index.native33.js +1 -1
- package/dist/esm/index.native37.js +1 -1
- package/dist/esm/index.native39.js +1 -1
- package/dist/esm/index.native4.js +1 -1
- package/dist/esm/index.native46.js +27 -31
- package/dist/esm/index.native47.js +31 -27
- package/dist/esm/index.native49.js +1 -1
- package/dist/esm/index.native5.js +1 -1
- package/dist/esm/index.native50.js +1 -1
- package/dist/esm/index.native60.js +1 -1
- package/dist/esm/index.native69.js +3 -3
- package/dist/esm/index.native72.js +1 -1
- package/dist/esm/index.native73.js +1 -1
- package/dist/esm/index.native74.js +1 -1
- package/dist/esm/index.native78.js +377 -2
- package/dist/esm/index.native79.js +29 -2
- package/dist/esm/index.native80.js +26 -374
- package/dist/esm/index.native81.js +2 -29
- package/dist/esm/index.native82.js +2 -29
- package/dist/esm/index.native9.js +1 -1
- package/dist/esm/index.web.js +9 -7
- package/dist/esm/index.web10.js +2 -2
- package/dist/esm/index.web11.js +2 -2
- package/dist/esm/index.web12.js +2 -2
- package/dist/esm/index.web13.js +1 -1
- package/dist/esm/index.web15.js +1 -1
- package/dist/esm/index.web154.js +1 -1
- package/dist/esm/index.web16.js +1 -1
- package/dist/esm/index.web17.js +1 -1
- package/dist/esm/index.web171.js +38 -7
- package/dist/esm/index.web173.js +67 -375
- package/dist/esm/index.web174.js +34 -835
- package/dist/esm/index.web175.js +20 -38
- package/dist/esm/index.web176.js +8 -2
- package/dist/esm/index.web177.js +2 -70
- package/dist/esm/index.web178.js +373 -30
- package/dist/esm/index.web179.js +835 -20
- package/dist/esm/index.web18.js +1 -1
- package/dist/esm/index.web19.js +1 -1
- package/dist/esm/index.web193.js +2 -2
- package/dist/esm/index.web194.js +2 -2
- package/dist/esm/index.web195.js +2 -2
- package/dist/esm/index.web20.js +2 -2
- package/dist/esm/index.web21.js +2 -2
- package/dist/esm/index.web22.js +2 -2
- package/dist/esm/index.web23.js +2 -2
- package/dist/esm/index.web24.js +2 -2
- package/dist/esm/index.web25.js +2 -2
- package/dist/esm/index.web27.js +1 -1
- package/dist/esm/index.web28.js +2 -2
- package/dist/esm/index.web29.js +2 -2
- package/dist/esm/index.web3.js +1 -1
- package/dist/esm/index.web30.js +3 -3
- package/dist/esm/index.web31.js +2 -2
- package/dist/esm/index.web32.js +2 -2
- package/dist/esm/index.web36.js +1 -1
- package/dist/esm/index.web38.js +2 -2
- package/dist/esm/index.web47.js +1 -1
- package/dist/esm/index.web48.js +27 -31
- package/dist/esm/index.web49.js +32 -3
- package/dist/esm/index.web5.js +1 -1
- package/dist/esm/index.web50.js +3 -9
- package/dist/esm/index.web51.js +8 -64
- package/dist/esm/index.web52.js +47 -70
- package/dist/esm/index.web53.js +87 -23
- package/dist/esm/index.web54.js +23 -17
- package/dist/esm/index.web55.js +16 -26
- package/dist/esm/index.web62.js +1 -1
- package/dist/esm/index.web70.js +1 -1
- package/dist/esm/index.web8.js +1 -1
- package/dist/esm/index.web9.js +7 -7
- package/dist/native/index.native.js +15 -13
- package/dist/native/index.native10.js +1 -1
- package/dist/native/index.native11.js +1 -1
- package/dist/native/index.native12.js +1 -1
- package/dist/native/index.native122.js +1 -1
- package/dist/native/index.native123.js +1 -1
- package/dist/native/index.native125.js +6 -6
- package/dist/native/index.native13.js +1 -1
- package/dist/native/index.native14.js +1 -1
- package/dist/native/index.native155.js +1 -1
- package/dist/native/index.native16.js +1 -1
- package/dist/native/index.native162.js +20 -4
- package/dist/native/index.native163.js +10 -21
- package/dist/native/index.native164.js +19 -9
- package/dist/native/index.native165.js +89 -15
- package/dist/native/index.native166.js +19 -92
- package/dist/native/index.native167.js +115 -18
- package/dist/native/index.native168.js +5 -118
- package/dist/native/index.native17.js +1 -1
- package/dist/native/index.native172.js +38 -7
- package/dist/native/index.native174.js +67 -375
- package/dist/native/index.native175.js +34 -835
- package/dist/native/index.native176.js +20 -38
- package/dist/native/index.native177.js +8 -2
- package/dist/native/index.native178.js +2 -70
- package/dist/native/index.native179.js +373 -30
- package/dist/native/index.native18.js +1 -1
- package/dist/native/index.native180.js +835 -20
- package/dist/native/index.native182.js +18 -2
- package/dist/native/index.native183.js +28 -109
- package/dist/native/index.native184.js +8 -2
- package/dist/native/index.native185.js +11 -18
- package/dist/native/index.native186.js +13 -28
- package/dist/native/index.native187.js +10 -8
- package/dist/native/index.native188.js +17 -11
- package/dist/native/index.native189.js +80 -12
- package/dist/native/index.native19.js +1 -1
- package/dist/native/index.native190.js +2 -10
- package/dist/native/index.native191.js +108 -16
- package/dist/native/index.native192.js +2 -81
- package/dist/native/index.native194.js +2 -2
- package/dist/native/index.native195.js +2 -2
- package/dist/native/index.native196.js +2 -2
- package/dist/native/index.native20.js +1 -1
- package/dist/native/index.native21.js +1 -1
- package/dist/native/index.native22.js +1 -1
- package/dist/native/index.native23.js +1 -1
- package/dist/native/index.native24.js +1 -1
- package/dist/native/index.native25.js +1 -1
- package/dist/native/index.native26.js +1 -1
- package/dist/native/index.native28.js +1 -1
- package/dist/native/index.native29.js +1 -1
- package/dist/native/index.native3.js +1 -1
- package/dist/native/index.native30.js +1 -1
- package/dist/native/index.native31.js +1 -1
- package/dist/native/index.native32.js +1 -1
- package/dist/native/index.native33.js +1 -1
- package/dist/native/index.native37.js +1 -1
- package/dist/native/index.native39.js +1 -1
- package/dist/native/index.native4.js +1 -1
- package/dist/native/index.native46.js +27 -31
- package/dist/native/index.native47.js +31 -27
- package/dist/native/index.native49.js +1 -1
- package/dist/native/index.native5.js +1 -1
- package/dist/native/index.native50.js +1 -1
- package/dist/native/index.native60.js +1 -1
- package/dist/native/index.native69.js +3 -3
- package/dist/native/index.native72.js +1 -1
- package/dist/native/index.native73.js +1 -1
- package/dist/native/index.native74.js +1 -1
- package/dist/native/index.native78.js +377 -2
- package/dist/native/index.native79.js +29 -2
- package/dist/native/index.native80.js +26 -374
- package/dist/native/index.native81.js +2 -29
- package/dist/native/index.native82.js +2 -29
- package/dist/native/index.native9.js +1 -1
- package/dist/native-types/index.d.ts +1 -0
- package/dist/native-types/index.native.d.ts +1 -0
- package/dist/native-types/index.web.d.ts +1 -0
- package/dist/native-types/version.d.ts +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.native.d.ts +1 -0
- package/dist/types/index.web.d.ts +1 -0
- package/dist/types/version.d.ts +1 -1
- package/dist/web/index.web.js +9 -7
- package/dist/web/index.web10.js +2 -2
- package/dist/web/index.web11.js +2 -2
- package/dist/web/index.web12.js +2 -2
- package/dist/web/index.web13.js +1 -1
- package/dist/web/index.web15.js +1 -1
- package/dist/web/index.web154.js +1 -1
- package/dist/web/index.web16.js +1 -1
- package/dist/web/index.web17.js +1 -1
- package/dist/web/index.web171.js +38 -7
- package/dist/web/index.web173.js +67 -375
- package/dist/web/index.web174.js +34 -835
- package/dist/web/index.web175.js +20 -38
- package/dist/web/index.web176.js +8 -2
- package/dist/web/index.web177.js +2 -70
- package/dist/web/index.web178.js +373 -30
- package/dist/web/index.web179.js +835 -20
- package/dist/web/index.web18.js +1 -1
- package/dist/web/index.web19.js +1 -1
- package/dist/web/index.web193.js +2 -2
- package/dist/web/index.web194.js +2 -2
- package/dist/web/index.web195.js +2 -2
- package/dist/web/index.web20.js +2 -2
- package/dist/web/index.web21.js +2 -2
- package/dist/web/index.web22.js +2 -2
- package/dist/web/index.web23.js +2 -2
- package/dist/web/index.web24.js +2 -2
- package/dist/web/index.web25.js +2 -2
- package/dist/web/index.web27.js +1 -1
- package/dist/web/index.web28.js +2 -2
- package/dist/web/index.web29.js +2 -2
- package/dist/web/index.web3.js +1 -1
- package/dist/web/index.web30.js +3 -3
- package/dist/web/index.web31.js +2 -2
- package/dist/web/index.web32.js +2 -2
- package/dist/web/index.web36.js +1 -1
- package/dist/web/index.web38.js +2 -2
- package/dist/web/index.web47.js +1 -1
- package/dist/web/index.web48.js +27 -31
- package/dist/web/index.web49.js +32 -3
- package/dist/web/index.web5.js +1 -1
- package/dist/web/index.web50.js +3 -9
- package/dist/web/index.web51.js +8 -64
- package/dist/web/index.web52.js +47 -70
- package/dist/web/index.web53.js +87 -23
- package/dist/web/index.web54.js +23 -17
- package/dist/web/index.web55.js +16 -26
- package/dist/web/index.web62.js +1 -1
- package/dist/web/index.web70.js +1 -1
- package/dist/web/index.web8.js +1 -1
- package/dist/web/index.web9.js +7 -7
- package/dist/web-types/index.d.ts +1 -0
- package/dist/web-types/index.native.d.ts +1 -0
- package/dist/web-types/index.web.d.ts +1 -0
- package/dist/web-types/version.d.ts +1 -1
- package/package.json +2 -2
package/dist/esm/index.web53.js
CHANGED
|
@@ -1,26 +1,90 @@
|
|
|
1
|
+
import { verifyOAuth as i } from "./index.web9.js";
|
|
2
|
+
import { getPlatformOAuth as h } from "./index.web4.js";
|
|
1
3
|
import "@coinbase/cdp-api-client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
4
|
+
import "viem";
|
|
5
|
+
class A {
|
|
6
|
+
oauthFlowState = null;
|
|
7
|
+
oauthStateChangeCallbacks = [];
|
|
8
|
+
/**
|
|
9
|
+
* Adds a callback to be called when the OAuth state changes.
|
|
10
|
+
*
|
|
11
|
+
* @param callback - The function to call when the OAuth state changes.
|
|
12
|
+
*/
|
|
13
|
+
async addOAuthStateChangeCallback(t) {
|
|
14
|
+
this.oauthStateChangeCallbacks.push(t), t(this.oauthFlowState);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Sets the OAuth flow state.
|
|
18
|
+
*
|
|
19
|
+
* @param oauthFlowState - The OAuth flow state.
|
|
20
|
+
*/
|
|
21
|
+
async setOAuthFlowState(t) {
|
|
22
|
+
this.oauthFlowState = t, this.oauthStateChangeCallbacks.forEach((a) => a(this.oauthFlowState));
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Clears the OAuth flow state.
|
|
26
|
+
*/
|
|
27
|
+
async clearOAuthFlowState() {
|
|
28
|
+
this.oauthFlowState = null, this.oauthStateChangeCallbacks.forEach((t) => t(null));
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Gets the OAuth flow state.
|
|
32
|
+
*
|
|
33
|
+
* @returns The OAuth flow state.
|
|
34
|
+
*/
|
|
35
|
+
async getOAuthFlowState() {
|
|
36
|
+
return this.oauthFlowState;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Handles the OAuth code.
|
|
40
|
+
*
|
|
41
|
+
* @param url - The URL to handle.
|
|
42
|
+
* @returns A promise that resolves when the OAuth code is handled.
|
|
43
|
+
* @throws An error if the URL is required and not provided.
|
|
44
|
+
*/
|
|
45
|
+
async handleOAuthCode(t) {
|
|
46
|
+
try {
|
|
47
|
+
const a = await h().getOAuthParams(t);
|
|
48
|
+
if (await h().cleanupOAuthParams(), !a)
|
|
49
|
+
return;
|
|
50
|
+
const { providerType: e, code: r, flowId: o, error: s, errorDescription: u } = a;
|
|
51
|
+
if (s || u) {
|
|
52
|
+
await this.setOAuthFlowState({
|
|
53
|
+
providerType: e,
|
|
54
|
+
status: "error",
|
|
55
|
+
errorDescription: s ?? u,
|
|
56
|
+
code: r,
|
|
57
|
+
flowId: o,
|
|
58
|
+
error: s
|
|
59
|
+
});
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
if (!r || !e || !o)
|
|
63
|
+
return;
|
|
64
|
+
await this.setOAuthFlowState({
|
|
65
|
+
providerType: e,
|
|
66
|
+
status: "pending",
|
|
67
|
+
code: r,
|
|
68
|
+
flowId: o
|
|
69
|
+
}), await i({
|
|
70
|
+
code: r,
|
|
71
|
+
providerType: e,
|
|
72
|
+
flowId: o
|
|
73
|
+
}), await this.setOAuthFlowState({
|
|
74
|
+
providerType: e,
|
|
75
|
+
status: "success",
|
|
76
|
+
code: r,
|
|
77
|
+
flowId: o
|
|
78
|
+
});
|
|
79
|
+
} catch (a) {
|
|
80
|
+
const e = a instanceof Error ? a.message : "Unknown error";
|
|
81
|
+
await h().cleanupOAuthParams(), await this.setOAuthFlowState({
|
|
82
|
+
status: "error",
|
|
83
|
+
errorDescription: e
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
23
88
|
export {
|
|
24
|
-
|
|
25
|
-
e as toAuthStateUser
|
|
89
|
+
A as OAuthManager
|
|
26
90
|
};
|
package/dist/esm/index.web54.js
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
import "@coinbase/cdp-api-client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
const e = (t) => ({
|
|
3
|
+
userId: t.userId,
|
|
4
|
+
// Deprecated fields - keep for backward compatibility
|
|
5
|
+
evmAccounts: t.evmAccounts?.map((c) => c) ?? [],
|
|
6
|
+
evmSmartAccounts: t.evmSmartAccounts?.map((c) => c) ?? [],
|
|
7
|
+
solanaAccounts: t.solanaAccounts?.map((c) => c) ?? [],
|
|
8
|
+
// New account object fields
|
|
9
|
+
evmAccountObjects: t.evmAccountObjects,
|
|
10
|
+
evmSmartAccountObjects: t.evmSmartAccountObjects,
|
|
11
|
+
solanaAccountObjects: t.solanaAccountObjects,
|
|
12
|
+
authenticationMethods: t.authenticationMethods.reduce((c, a) => (c[a.type] = a, c), {}),
|
|
13
|
+
mfaMethods: t.mfaMethods,
|
|
14
|
+
lastAuthenticatedAt: t.lastAuthenticatedAt
|
|
15
|
+
}), s = (t, c, a) => {
|
|
16
|
+
const o = new Date(c).getTime();
|
|
17
|
+
return {
|
|
18
|
+
accessToken: t,
|
|
19
|
+
expiresAt: o,
|
|
20
|
+
user: e(a)
|
|
21
|
+
};
|
|
22
|
+
};
|
|
17
23
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
24
|
+
s as toAuthState,
|
|
25
|
+
e as toAuthStateUser
|
|
20
26
|
};
|
package/dist/esm/index.web55.js
CHANGED
|
@@ -1,30 +1,20 @@
|
|
|
1
1
|
import "@coinbase/cdp-api-client";
|
|
2
2
|
import "viem";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return
|
|
16
|
-
}
|
|
17
|
-
e = t;
|
|
18
|
-
}, s = () => {
|
|
19
|
-
if (!e)
|
|
20
|
-
throw new Error("SDK not initialized");
|
|
21
|
-
return e;
|
|
22
|
-
};
|
|
3
|
+
const u = async (c) => await c.isSignedIn();
|
|
4
|
+
async function A(c, a, r) {
|
|
5
|
+
if (!await u(a))
|
|
6
|
+
throw new Error("User not signed in");
|
|
7
|
+
const t = a.getUser();
|
|
8
|
+
if ("evmAccount" in c && !(t.evmAccounts?.find((n) => n === c.evmAccount) || t.evmAccountObjects?.find((n) => n.address === c.evmAccount)))
|
|
9
|
+
throw new Error("EVM account not found");
|
|
10
|
+
if ("evmSmartAccount" in c && !(t.evmSmartAccounts?.find((n) => n === c.evmSmartAccount) || t.evmSmartAccountObjects?.find((n) => n.address === c.evmSmartAccount)))
|
|
11
|
+
throw new Error("EVM Smart Account not found");
|
|
12
|
+
if ("solanaAccount" in c && !(t.solanaAccounts?.find((n) => n === c.solanaAccount) || t.solanaAccountObjects?.find((n) => n.address === c.solanaAccount)))
|
|
13
|
+
throw new Error("Solana account not found");
|
|
14
|
+
const e = await a.getWalletSecretId();
|
|
15
|
+
return r({ ...c, user: t, walletSecretId: e });
|
|
16
|
+
}
|
|
23
17
|
export {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
s as getCoreOAuthManager,
|
|
27
|
-
a as setConfig,
|
|
28
|
-
l as setCoreAuthManager,
|
|
29
|
-
h as setCoreOAuthManager
|
|
18
|
+
u as isSignedIn,
|
|
19
|
+
A as withAuth
|
|
30
20
|
};
|
package/dist/esm/index.web62.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getTransactionEncoder as u, getTransactionDecoder as f, address as g } from "@solana/kit";
|
|
2
2
|
import { getCurrentUserSync as l } from "./index.web13.js";
|
|
3
3
|
import { signSolanaTransaction as m } from "./index.web9.js";
|
|
4
|
-
import { encodeBase64 as T, decodeBase64 as h } from "./index.
|
|
4
|
+
import { encodeBase64 as T, decodeBase64 as h } from "./index.web49.js";
|
|
5
5
|
function E(n) {
|
|
6
6
|
const o = l();
|
|
7
7
|
if (!o || !o.solanaAccountObjects?.length)
|
package/dist/esm/index.web70.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Analytics as E } from "./index.web2.js";
|
|
2
2
|
import "./index.web3.js";
|
|
3
3
|
import { VERSION as r } from "./index.web8.js";
|
|
4
|
-
import "./index.
|
|
4
|
+
import "./index.web50.js";
|
|
5
5
|
import { APIError as c, ErrorType as P, HttpErrorType as U, OAuth2ProviderType as F, SendEvmTransactionWithEndUserAccountBodyNetwork as I, SendSolanaTransactionWithEndUserAccountBodyNetwork as d } from "@coinbase/cdp-api-client";
|
|
6
6
|
import "@solana/web3.js";
|
|
7
7
|
import "bs58";
|
package/dist/esm/index.web8.js
CHANGED
package/dist/esm/index.web9.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { b as l } from "./index.
|
|
1
|
+
import { b as l } from "./index.web50.js";
|
|
2
2
|
import { configureCdpApiClient as b, setAuthManager as j, authenticateUserWithCustomAuth as P, initiateAuthentication as x, createEndUserEvmAccount as K, createEndUserEvmSmartAccount as E, createEndUserSolanaAccount as W, verifyEmailAuthentication as H, verifySmsAuthentication as R, verifyOAuthCode as B, signEvmHashWithEndUserAccount as D, signEvmTransactionWithEndUserAccount as N, signSolanaTransactionWithEndUserAccount as F, sendEvmTransactionWithEndUserAccount as J, sendSolanaTransactionWithEndUserAccount as L, signEvmMessageWithEndUserAccount as z, signSolanaMessageWithEndUserAccount as $, signEvmTypedDataWithEndUserAccount as V, sendUserOperationWithEndUserAccount as q, getUserOperationWithEndUserAccount as G, exportEndUserEvmAccount as Q, exportEndUserSolanaAccount as X } from "@coinbase/cdp-api-client";
|
|
3
3
|
import { Analytics as c } from "./index.web2.js";
|
|
4
4
|
import "./index.web3.js";
|
|
5
5
|
import { Keypair as S } from "@solana/web3.js";
|
|
6
6
|
import I from "bs58";
|
|
7
|
-
import { createAuthManager as Y } from "./index.
|
|
8
|
-
import { CUSTOM_AUTH_REFRESH_BUFFER_MS as Z } from "./index.
|
|
9
|
-
import { OAuthManager as ee } from "./index.
|
|
10
|
-
import { toAuthState as h } from "./index.
|
|
11
|
-
import { withAuth as d } from "./index.
|
|
7
|
+
import { createAuthManager as Y } from "./index.web51.js";
|
|
8
|
+
import { CUSTOM_AUTH_REFRESH_BUFFER_MS as Z } from "./index.web52.js";
|
|
9
|
+
import { OAuthManager as ee } from "./index.web53.js";
|
|
10
|
+
import { toAuthState as h } from "./index.web54.js";
|
|
11
|
+
import { withAuth as d } from "./index.web55.js";
|
|
12
12
|
import { CustomAuthError as y } from "./index.web39.js";
|
|
13
13
|
import { withMfa as m } from "./index.web36.js";
|
|
14
|
-
import { getConfig as a, setCoreAuthManager as _, setCoreOAuthManager as U, getCoreAuthManager as o, getCoreOAuthManager as te, setConfig as ne } from "./index.
|
|
14
|
+
import { getConfig as a, setCoreAuthManager as _, setCoreOAuthManager as U, getCoreAuthManager as o, getCoreOAuthManager as te, setConfig as ne } from "./index.web48.js";
|
|
15
15
|
import { MockAuthManager as re } from "./index.web56.js";
|
|
16
16
|
import { MockOAuthManager as se } from "./index.web57.js";
|
|
17
17
|
import { mockUser as w } from "./index.web58.js";
|
|
@@ -6,7 +6,7 @@ import { nativeSecureStorage as t } from "./index.native6.js";
|
|
|
6
6
|
import { nativeStorage as n } from "./index.native7.js";
|
|
7
7
|
import { setPlatformServices as i } from "./index.native8.js";
|
|
8
8
|
import { VERSION as a } from "./index.native9.js";
|
|
9
|
-
import { authenticateWithJWT as A, exportEvmAccount as h, exportSolanaAccount as v, getAccessToken as T, getAccessTokenExpiration as M, getCurrentUser as O, getUserOperation as P, initialize as
|
|
9
|
+
import { authenticateWithJWT as A, exportEvmAccount as h, exportSolanaAccount as v, getAccessToken as T, getAccessTokenExpiration as M, getCurrentUser as O, getUserOperation as P, initialize as C, isSignedIn as y, onAuthStateChange as I, onOAuthStateChange as k, sendEvmTransaction as U, sendSolanaTransaction as R, sendUserOperation as W, signEvmHash as N, signEvmMessage as V, signEvmTransaction as D, signEvmTypedData as _, signInWithEmail as b, signInWithOAuth as F, signInWithSms as w, signOut as B, signSolanaMessage as H, signSolanaTransaction as q, verifyEmailOTP as z, verifyOAuth as G, verifySmsOTP as J } from "./index.native10.js";
|
|
10
10
|
import { createSpendPermission as X } from "./index.native11.js";
|
|
11
11
|
import { listSpendPermissions as K } from "./index.native12.js";
|
|
12
12
|
import { APIError as Y, ErrorType as Z, HttpErrorType as $, OAuth2ProviderType as rr, SendEvmTransactionWithEndUserAccountBodyNetwork as or, SendSolanaTransactionWithEndUserAccountBodyNetwork as er } from "@coinbase/cdp-api-client";
|
|
@@ -15,13 +15,13 @@ import { getCurrentUserSync as ar } from "./index.native14.js";
|
|
|
15
15
|
import { fetchWithX402 as sr } from "./index.native15.js";
|
|
16
16
|
import { linkGoogle as pr } from "./index.native16.js";
|
|
17
17
|
import { linkSms as Er } from "./index.native17.js";
|
|
18
|
-
import { linkEmail as
|
|
19
|
-
import { linkOAuth as
|
|
18
|
+
import { linkEmail as lr } from "./index.native18.js";
|
|
19
|
+
import { linkOAuth as gr } from "./index.native19.js";
|
|
20
20
|
import { linkApple as Sr } from "./index.native20.js";
|
|
21
21
|
import { createEvmEoaAccount as hr } from "./index.native21.js";
|
|
22
22
|
import { createEvmSmartAccount as Tr } from "./index.native22.js";
|
|
23
23
|
import { createSolanaAccount as Or } from "./index.native23.js";
|
|
24
|
-
import { sendEvmEoaUsdc as
|
|
24
|
+
import { sendEvmEoaUsdc as Cr } from "./index.native24.js";
|
|
25
25
|
import { sendEvmSmartAccountUsdc as Ir } from "./index.native25.js";
|
|
26
26
|
import { sendSolanaUsdc as Ur } from "./index.native26.js";
|
|
27
27
|
import { sendUsdc as Wr } from "./index.native27.js";
|
|
@@ -39,12 +39,13 @@ import { MFA_PROTECTED_ACTIONS as oo, MFA_PROTECTED_FUNCTIONS as eo, isMfaProtec
|
|
|
39
39
|
import { AuthManager as io } from "./index.native39.js";
|
|
40
40
|
import { CustomAuthError as mo } from "./index.native40.js";
|
|
41
41
|
import { toViemAccount as fo } from "./index.native41.js";
|
|
42
|
-
import { InputValidationError as co, InternalError as Eo, MfaError as
|
|
42
|
+
import { InputValidationError as co, InternalError as Eo, MfaError as xo, ModuleResolutionError as lo, ValidationError as go } from "./index.native42.js";
|
|
43
43
|
import { validatePhoneNumber as So } from "./index.native43.js";
|
|
44
44
|
import { createCDPEmbeddedWallet as ho } from "./index.native44.js";
|
|
45
45
|
import { EIP1193ProviderError as To, STANDARD_ERROR_CODES as Mo } from "./index.native45.js";
|
|
46
46
|
import "viem";
|
|
47
47
|
import "zustand";
|
|
48
|
+
import { getConfig as Po } from "./index.native46.js";
|
|
48
49
|
r.registerPackageVersion("core", a);
|
|
49
50
|
i({
|
|
50
51
|
crypto: o,
|
|
@@ -63,13 +64,13 @@ export {
|
|
|
63
64
|
Eo as InternalError,
|
|
64
65
|
oo as MFA_PROTECTED_ACTIONS,
|
|
65
66
|
eo as MFA_PROTECTED_FUNCTIONS,
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
xo as MfaError,
|
|
68
|
+
lo as ModuleResolutionError,
|
|
68
69
|
rr as OAuth2ProviderType,
|
|
69
70
|
Mo as STANDARD_ERROR_CODES,
|
|
70
71
|
or as SendEvmTransactionWithEndUserAccountBodyNetwork,
|
|
71
72
|
er as SendSolanaTransactionWithEndUserAccountBodyNetwork,
|
|
72
|
-
|
|
73
|
+
go as ValidationError,
|
|
73
74
|
A as authenticateWithJWT,
|
|
74
75
|
Lr as cancelMfaVerification,
|
|
75
76
|
ho as createCDPEmbeddedWallet,
|
|
@@ -82,22 +83,23 @@ export {
|
|
|
82
83
|
sr as fetchWithX402,
|
|
83
84
|
T as getAccessToken,
|
|
84
85
|
M as getAccessTokenExpiration,
|
|
86
|
+
Po as getConfig,
|
|
85
87
|
O as getCurrentUser,
|
|
86
88
|
ar as getCurrentUserSync,
|
|
87
89
|
Qr as getEnrolledMfaMethods,
|
|
88
90
|
Vr as getMfaConfig,
|
|
89
91
|
P as getUserOperation,
|
|
90
|
-
|
|
92
|
+
C as initialize,
|
|
91
93
|
Fr as initiateMfaEnrollment,
|
|
92
94
|
qr as initiateMfaVerification,
|
|
93
95
|
Yr as isEnrolledInMfa,
|
|
94
96
|
to as isMfaProtectedAction,
|
|
95
97
|
$r as isMfaRequired,
|
|
96
|
-
|
|
98
|
+
y as isSignedIn,
|
|
97
99
|
Sr as linkApple,
|
|
98
|
-
|
|
100
|
+
lr as linkEmail,
|
|
99
101
|
pr as linkGoogle,
|
|
100
|
-
|
|
102
|
+
gr as linkOAuth,
|
|
101
103
|
Er as linkSms,
|
|
102
104
|
K as listSpendPermissions,
|
|
103
105
|
I as onAuthStateChange,
|
|
@@ -105,7 +107,7 @@ export {
|
|
|
105
107
|
_r as recordMfaEnrollmentPrompted,
|
|
106
108
|
jr as registerMfaListener,
|
|
107
109
|
nr as revokeSpendPermission,
|
|
108
|
-
|
|
110
|
+
Cr as sendEvmEoaUsdc,
|
|
109
111
|
Ir as sendEvmSmartAccountUsdc,
|
|
110
112
|
U as sendEvmTransaction,
|
|
111
113
|
R as sendSolanaTransaction,
|
|
@@ -11,7 +11,7 @@ import { toAuthState as h } from "./index.native52.js";
|
|
|
11
11
|
import { withAuth as d } from "./index.native53.js";
|
|
12
12
|
import { CustomAuthError as y } from "./index.native40.js";
|
|
13
13
|
import { withMfa as m } from "./index.native37.js";
|
|
14
|
-
import { getConfig as a, setCoreAuthManager as _, setCoreOAuthManager as U, getCoreAuthManager as o, getCoreOAuthManager as te, setConfig as ne } from "./index.
|
|
14
|
+
import { getConfig as a, setCoreAuthManager as _, setCoreOAuthManager as U, getCoreAuthManager as o, getCoreOAuthManager as te, setConfig as ne } from "./index.native46.js";
|
|
15
15
|
import { MockAuthManager as re } from "./index.native54.js";
|
|
16
16
|
import { MockOAuthManager as se } from "./index.native55.js";
|
|
17
17
|
import { mockUser as w } from "./index.native56.js";
|
|
@@ -3,7 +3,7 @@ import { Analytics as o } from "./index.native2.js";
|
|
|
3
3
|
import "./index.native3.js";
|
|
4
4
|
import { withAuth as i } from "./index.native53.js";
|
|
5
5
|
import { toSpendPermission as m } from "./index.native59.js";
|
|
6
|
-
import { getConfig as t, getCoreAuthManager as c } from "./index.
|
|
6
|
+
import { getConfig as t, getCoreAuthManager as c } from "./index.native46.js";
|
|
7
7
|
const h = async (e) => (o.sendActionCallEvent({ name: "create_spend_permission" }), t().useMock ? {
|
|
8
8
|
userOperationHash: "0x1234567890123456789012345678901234567890123456789012345678901234"
|
|
9
9
|
} : i(e, c(), async ({ user: n, walletSecretId: s }) => {
|
|
@@ -2,7 +2,7 @@ import { listSpendPermissionsWithEndUserAccount as a } from "@coinbase/cdp-api-c
|
|
|
2
2
|
import { Analytics as i } from "./index.native2.js";
|
|
3
3
|
import "./index.native3.js";
|
|
4
4
|
import { withAuth as o } from "./index.native53.js";
|
|
5
|
-
import { getConfig as r, getCoreAuthManager as m } from "./index.
|
|
5
|
+
import { getConfig as r, getCoreAuthManager as m } from "./index.native46.js";
|
|
6
6
|
const k = async (e) => (i.sendActionCallEvent({ name: "list_spend_permissions" }), r().useMock ? {
|
|
7
7
|
spendPermissions: [
|
|
8
8
|
{
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { __require as e } from "./index.
|
|
1
|
+
import { __require as e } from "./index.native191.js";
|
|
2
2
|
e();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { encode as d } from "./index.
|
|
2
|
-
import y from "./index.
|
|
3
|
-
import b from "./index.
|
|
1
|
+
import { encode as d } from "./index.native162.js";
|
|
2
|
+
import y from "./index.native163.js";
|
|
3
|
+
import b from "./index.native164.js";
|
|
4
4
|
import { JWSInvalid as r } from "./index.native76.js";
|
|
5
5
|
import { encoder as s, concat as u, decoder as h } from "./index.native126.js";
|
|
6
|
-
import g from "./index.
|
|
7
|
-
import H from "./index.
|
|
8
|
-
import P from "./index.
|
|
6
|
+
import g from "./index.native165.js";
|
|
7
|
+
import H from "./index.native166.js";
|
|
8
|
+
import P from "./index.native167.js";
|
|
9
9
|
class x {
|
|
10
10
|
#r;
|
|
11
11
|
#e;
|
|
@@ -2,7 +2,7 @@ import { revokeSpendPermissionWithEndUserAccount as a } from "@coinbase/cdp-api-
|
|
|
2
2
|
import { Analytics as n } from "./index.native2.js";
|
|
3
3
|
import "./index.native3.js";
|
|
4
4
|
import { withAuth as o } from "./index.native53.js";
|
|
5
|
-
import { getConfig as r, getCoreAuthManager as m } from "./index.
|
|
5
|
+
import { getConfig as r, getCoreAuthManager as m } from "./index.native46.js";
|
|
6
6
|
const f = async (e) => (n.sendActionCallEvent({ name: "revoke_spend_permission" }), r().useMock ? {
|
|
7
7
|
userOperationHash: "0x1234567890123456789012345678901234567890123456789012345678901234"
|
|
8
8
|
} : o(e, m(), async ({ user: s, walletSecretId: t }) => ({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Analytics as r } from "./index.native2.js";
|
|
2
2
|
import "./index.native3.js";
|
|
3
|
-
import { getCoreAuthManager as t } from "./index.
|
|
3
|
+
import { getCoreAuthManager as t } from "./index.native46.js";
|
|
4
4
|
import "@coinbase/cdp-api-client";
|
|
5
5
|
import "viem";
|
|
6
6
|
const s = () => (r.sendActionCallEvent({ name: "get_current_user_sync" }), t().getUser());
|
|
@@ -2,7 +2,7 @@ import { initiateAuthentication as o } from "@coinbase/cdp-api-client";
|
|
|
2
2
|
import { Analytics as e } from "./index.native2.js";
|
|
3
3
|
import "./index.native3.js";
|
|
4
4
|
import { getPlatformOAuth as i } from "./index.native8.js";
|
|
5
|
-
import { getCoreAuthManager as n, getConfig as r } from "./index.
|
|
5
|
+
import { getCoreAuthManager as n, getConfig as r } from "./index.native46.js";
|
|
6
6
|
async function u() {
|
|
7
7
|
if (e.sendActionCallEvent({ name: "link_google" }), !await n().isSignedIn())
|
|
8
8
|
throw new Error("User must be signed in to link a Google account");
|
|
@@ -1,7 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { encoder as t, decoder as o } from "./index.native126.js";
|
|
2
|
+
import { encodeBase64 as c, decodeBase64 as a } from "./index.native182.js";
|
|
3
|
+
function i(r) {
|
|
4
|
+
if (Uint8Array.fromBase64)
|
|
5
|
+
return Uint8Array.fromBase64(typeof r == "string" ? r : o.decode(r), {
|
|
6
|
+
alphabet: "base64url"
|
|
7
|
+
});
|
|
8
|
+
let e = r;
|
|
9
|
+
e instanceof Uint8Array && (e = o.decode(e)), e = e.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "");
|
|
10
|
+
try {
|
|
11
|
+
return a(e);
|
|
12
|
+
} catch {
|
|
13
|
+
throw new TypeError("The input to be decoded is not correctly encoded.");
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function p(r) {
|
|
17
|
+
let e = r;
|
|
18
|
+
return typeof e == "string" && (e = t.encode(e)), Uint8Array.prototype.toBase64 ? e.toBase64({ alphabet: "base64url", omitPadding: !0 }) : c(e).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
|
|
4
19
|
}
|
|
5
20
|
export {
|
|
6
|
-
|
|
21
|
+
i as decode,
|
|
22
|
+
p as encode
|
|
7
23
|
};
|
|
@@ -1,23 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
try {
|
|
11
|
-
return a(e);
|
|
12
|
-
} catch {
|
|
13
|
-
throw new TypeError("The input to be decoded is not correctly encoded.");
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
function p(r) {
|
|
17
|
-
let e = r;
|
|
18
|
-
return typeof e == "string" && (e = t.encode(e)), Uint8Array.prototype.toBase64 ? e.toBase64({ alphabet: "base64url", omitPadding: !0 }) : c(e).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
|
|
19
|
-
}
|
|
1
|
+
import n from "./index.native183.js";
|
|
2
|
+
import s from "./index.native184.js";
|
|
3
|
+
import a from "./index.native185.js";
|
|
4
|
+
const y = async (t, o, e) => {
|
|
5
|
+
const r = await a(t, o, "sign");
|
|
6
|
+
s(t, r);
|
|
7
|
+
const i = await crypto.subtle.sign(n(t, r.algorithm), r, e);
|
|
8
|
+
return new Uint8Array(i);
|
|
9
|
+
};
|
|
20
10
|
export {
|
|
21
|
-
|
|
22
|
-
p as encode
|
|
11
|
+
y as default
|
|
23
12
|
};
|
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
s
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
const a = (...o) => {
|
|
2
|
+
const t = o.filter(Boolean);
|
|
3
|
+
if (t.length === 0 || t.length === 1)
|
|
4
|
+
return !0;
|
|
5
|
+
let e;
|
|
6
|
+
for (const s of t) {
|
|
7
|
+
const r = Object.keys(s);
|
|
8
|
+
if (!e || e.size === 0) {
|
|
9
|
+
e = new Set(r);
|
|
10
|
+
continue;
|
|
11
|
+
}
|
|
12
|
+
for (const n of r) {
|
|
13
|
+
if (e.has(n))
|
|
14
|
+
return !1;
|
|
15
|
+
e.add(n);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return !0;
|
|
9
19
|
};
|
|
10
20
|
export {
|
|
11
|
-
|
|
21
|
+
a as default
|
|
12
22
|
};
|