@ab-org/predicate-market-sdk 2.2.0-beta.3 → 2.2.0-beta.6
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/{account-F5Z2SMJE.js → account-6PGNCFOX.js} +13 -24
- package/dist/auth.d.ts +1 -1
- package/dist/auth.js +1 -1
- package/dist/{autoReconnect-UEPGLSA7.js → autoReconnect-STOYP7SX.js} +3 -3
- package/dist/{chunk-3AR6ZOML.js → chunk-63AEVWHE.js} +1 -1
- package/dist/{chunk-55FTUSW7.js → chunk-BWKDIOBB.js} +11 -17
- package/dist/{chunk-ITLN6GHC.js → chunk-CGP7TSLF.js} +2 -0
- package/dist/{chunk-AAFQWHHY.js → chunk-HNL3SLGU.js} +1 -1
- package/dist/{chunk-CFWENKGK.js → chunk-IVPLOLGZ.js} +380 -778
- package/dist/{chunk-6MMOYCWR.js → chunk-NTFBZNCV.js} +1 -1
- package/dist/{chunk-6YQEHB6P.js → chunk-SV3NR2LW.js} +1 -1
- package/dist/{chunk-FIDON2BY.js → chunk-UMSH3Z43.js} +3 -3
- package/dist/{chunk-WHTI52FI.js → chunk-UPMVYXZ6.js} +1 -1
- package/dist/{chunk-UAXKA6QC.js → chunk-ZS6FNG2D.js} +2 -5
- package/dist/core.d.ts +1 -1
- package/dist/core.js +5 -5
- package/dist/index.d.ts +2 -1
- package/dist/index.js +10 -10
- package/dist/merchant.js +4 -4
- package/dist/react.d.ts +6 -5
- package/dist/react.js +5 -5
- package/package.json +2 -2
- /package/dist/{signInTypes-DESvmgWG.d.ts → signInTypes.d-DESvmgWG.d.ts} +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { getExplorerUrl } from './chunk-XB2DFS2W.js';
|
|
2
|
-
import { getChains, registerPlatform, quote, getWithdrawOrder } from './chunk-
|
|
3
|
-
import { getEnv } from './chunk-
|
|
4
|
-
import { clientIds, stage } from './chunk-
|
|
5
|
-
import { getSDKConfig } from './chunk-
|
|
2
|
+
import { getChains, registerPlatform, quote, getWithdrawOrder } from './chunk-HNL3SLGU.js';
|
|
3
|
+
import { getEnv } from './chunk-CGP7TSLF.js';
|
|
4
|
+
import { clientIds, stage } from './chunk-SV3NR2LW.js';
|
|
5
|
+
import { getSDKConfig } from './chunk-UPMVYXZ6.js';
|
|
6
6
|
import { cache_exports } from './chunk-YX56ZGDB.js';
|
|
7
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
8
|
import { useEffect, useState, useRef, useMemo, useCallback } from 'react';
|
|
8
9
|
import { sessionStore, getSupportedChainFromEvmChainId, createSessionCapabilityPolicy, createChainContext, CUBIST_CAPABILITIES, createDefaultInjectedWalletRegistry, WalletConnector } from '@ab-org/sdk-core';
|
|
9
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
10
10
|
import qrcode from 'qrcode-generator';
|
|
11
11
|
|
|
12
|
-
// ../sign_in_sdk/
|
|
12
|
+
// ../sign_in_sdk/dist/ui/theme.js
|
|
13
13
|
var colors = {
|
|
14
14
|
card: "#121214",
|
|
15
15
|
cardRaised: "#151821",
|
|
@@ -24,47 +24,25 @@ var radii = {
|
|
|
24
24
|
var fonts = {
|
|
25
25
|
family: '"Switzer", "Inter", "SF Pro Display", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'
|
|
26
26
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
] });
|
|
33
|
-
var XIcon = () => /* @__PURE__ */ jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231 5.45-6.231Zm-1.161 17.52h1.833L7.084 4.126H5.117L17.083 19.77Z", fill: "white" }) });
|
|
34
|
-
var ExpandIcon = ({ expanded }) => /* @__PURE__ */ jsxs(
|
|
35
|
-
"svg",
|
|
36
|
-
{
|
|
37
|
-
width: "24",
|
|
38
|
-
height: "24",
|
|
39
|
-
viewBox: "0 0 24 24",
|
|
40
|
-
fill: "none",
|
|
41
|
-
style: { transform: expanded ? "rotate(180deg)" : void 0, transition: "transform 0.2s" },
|
|
42
|
-
children: [
|
|
43
|
-
/* @__PURE__ */ jsx("path", { d: "M5 9L9 13L13 9", stroke: colors.textSecondary, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
44
|
-
/* @__PURE__ */ jsx("path", { d: "M11 9L15 13L19 9", stroke: colors.textSecondary, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
45
|
-
]
|
|
46
|
-
}
|
|
47
|
-
);
|
|
48
|
-
var SpinnerIcon = () => /* @__PURE__ */ jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", style: { animation: "spin 1s linear infinite" }, children: [
|
|
49
|
-
/* @__PURE__ */ jsx("circle", { cx: "10", cy: "10", r: "8", stroke: "rgba(255,255,255,0.2)", strokeWidth: "2.5" }),
|
|
50
|
-
/* @__PURE__ */ jsx("path", { d: "M10 2a8 8 0 0 1 8 8", stroke: colors.textPrimary, strokeWidth: "2.5", strokeLinecap: "round" }),
|
|
51
|
-
/* @__PURE__ */ jsx("style", { children: `@keyframes spin { to { transform: rotate(360deg); } }` })
|
|
52
|
-
] });
|
|
27
|
+
|
|
28
|
+
// ../sign_in_sdk/dist/ui/SignInModal.shared.js
|
|
29
|
+
var GoogleIcon = () => jsxs("svg", { width: "21", height: "21", viewBox: "0 0 21 21", fill: "none", children: [jsx("path", { d: "M20.3 10.73c0-.79-.07-1.54-.19-2.27H10.5v4.51h5.5a4.69 4.69 0 0 1-2.04 3.09v2.57h3.3c1.93-1.78 3.04-4.4 3.04-7.9Z", fill: "#4285F4" }), jsx("path", { d: "M10.5 21c2.76 0 5.07-.91 6.76-2.47l-3.3-2.57c-.92.61-2.09.97-3.46.97-2.66 0-4.91-1.8-5.71-4.22H1.39v2.65A10.5 10.5 0 0 0 10.5 21Z", fill: "#34A853" }), jsx("path", { d: "M4.79 12.71A6.3 6.3 0 0 1 4.46 10.5c0-.77.13-1.51.33-2.21V5.64H1.39A10.5 10.5 0 0 0 0 10.5c0 1.7.41 3.3 1.39 4.86l3.4-2.65Z", fill: "#FBBC05" }), jsx("path", { d: "M10.5 4.07c1.5 0 2.84.51 3.9 1.52l2.92-2.92C15.56 1.02 13.26 0 10.5 0A10.5 10.5 0 0 0 1.39 5.64l3.4 2.65C5.59 5.87 7.84 4.07 10.5 4.07Z", fill: "#EA4335" })] });
|
|
30
|
+
var XIcon = () => jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: jsx("path", { d: "M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231 5.45-6.231Zm-1.161 17.52h1.833L7.084 4.126H5.117L17.083 19.77Z", fill: "white" }) });
|
|
31
|
+
var ExpandIcon = ({ expanded }) => jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", style: { transform: expanded ? "rotate(180deg)" : void 0, transition: "transform 0.2s" }, children: [jsx("path", { d: "M5 9L9 13L13 9", stroke: colors.textSecondary, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M11 9L15 13L19 9", stroke: colors.textSecondary, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] });
|
|
32
|
+
var SpinnerIcon = () => jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", style: { animation: "spin 1s linear infinite" }, children: [jsx("circle", { cx: "10", cy: "10", r: "8", stroke: "rgba(255,255,255,0.2)", strokeWidth: "2.5" }), jsx("path", { d: "M10 2a8 8 0 0 1 8 8", stroke: colors.textPrimary, strokeWidth: "2.5", strokeLinecap: "round" }), jsx("style", { children: `@keyframes spin { to { transform: rotate(360deg); } }` })] });
|
|
53
33
|
var defaultSocialProviders = [
|
|
54
|
-
{ id: "google", label: "Continue with Google", icon:
|
|
55
|
-
{ id: "x", label: "Continue with X", icon:
|
|
34
|
+
{ id: "google", label: "Continue with Google", icon: jsx(GoogleIcon, {}) },
|
|
35
|
+
{ id: "x", label: "Continue with X", icon: jsx(XIcon, {}) }
|
|
56
36
|
];
|
|
57
37
|
function resolveWalletItems(wallets, defaultWalletRegistry) {
|
|
58
|
-
const walletMap = new Map(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
])
|
|
67
|
-
);
|
|
38
|
+
const walletMap = new Map(defaultWalletRegistry.map((item) => [
|
|
39
|
+
item.id,
|
|
40
|
+
{
|
|
41
|
+
name: item.title,
|
|
42
|
+
installed: item.installed,
|
|
43
|
+
installUrl: item.installUrl
|
|
44
|
+
}
|
|
45
|
+
]));
|
|
68
46
|
if (wallets === void 0) {
|
|
69
47
|
return defaultWalletRegistry.map((item) => ({
|
|
70
48
|
id: item.id,
|
|
@@ -94,9 +72,7 @@ function resolveSocialProviders(socialProviders) {
|
|
|
94
72
|
if (socialProviders.length === 0) {
|
|
95
73
|
return [];
|
|
96
74
|
}
|
|
97
|
-
const defaultProviderMap = new Map(
|
|
98
|
-
defaultSocialProviders.map((provider) => [provider.id, provider])
|
|
99
|
-
);
|
|
75
|
+
const defaultProviderMap = new Map(defaultSocialProviders.map((provider) => [provider.id, provider]));
|
|
100
76
|
return socialProviders.map((provider) => {
|
|
101
77
|
const fallback = defaultProviderMap.get(provider.id);
|
|
102
78
|
return {
|
|
@@ -106,211 +82,78 @@ function resolveSocialProviders(socialProviders) {
|
|
|
106
82
|
};
|
|
107
83
|
});
|
|
108
84
|
}
|
|
109
|
-
var IconFrame = ({
|
|
85
|
+
var IconFrame = ({ background, children }) => jsx("div", { style: {
|
|
86
|
+
width: 48,
|
|
87
|
+
height: 48,
|
|
88
|
+
borderRadius: 12,
|
|
110
89
|
background,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
"
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
/* @__PURE__ */ jsx("rect", { x: "2", y: "11", width: "8", height: "8", rx: "2", fill: "#050608" }),
|
|
141
|
-
/* @__PURE__ */ jsx("rect", { x: "20", y: "11", width: "8", height: "8", rx: "2", fill: "#050608" }),
|
|
142
|
-
/* @__PURE__ */ jsx("rect", { x: "2", y: "20", width: "8", height: "8", rx: "2", fill: "#050608" }),
|
|
143
|
-
/* @__PURE__ */ jsx("rect", { x: "11", y: "20", width: "8", height: "8", rx: "2", fill: "#050608" }),
|
|
144
|
-
/* @__PURE__ */ jsx("rect", { x: "20", y: "20", width: "8", height: "8", rx: "2", fill: "#050608" })
|
|
145
|
-
] }) });
|
|
146
|
-
var CoinbaseWalletIcon = () => /* @__PURE__ */ jsx(IconFrame, { background: "#0052FF", children: /* @__PURE__ */ jsxs("svg", { width: "30", height: "30", viewBox: "0 0 30 30", fill: "none", children: [
|
|
147
|
-
/* @__PURE__ */ jsx("circle", { cx: "15", cy: "15", r: "10", stroke: "white", strokeWidth: "4" }),
|
|
148
|
-
/* @__PURE__ */ jsx("rect", { x: "9", y: "13", width: "12", height: "4", rx: "2", fill: "white" })
|
|
149
|
-
] }) });
|
|
150
|
-
var TrustWalletIcon = () => /* @__PURE__ */ jsx(IconFrame, { background: "#3375FF", children: /* @__PURE__ */ jsxs("svg", { width: "28", height: "28", viewBox: "0 0 28 28", fill: "none", children: [
|
|
151
|
-
/* @__PURE__ */ jsx("path", { d: "M14 4L21 6.6V12.8C21 17.1 18.1 20.9 14 22.4C9.9 20.9 7 17.1 7 12.8V6.6L14 4Z", fill: "white" }),
|
|
152
|
-
/* @__PURE__ */ jsx("path", { d: "M14 8L17 9.1V12.3C17 14.7 15.7 16.8 14 17.6C12.3 16.8 11 14.7 11 12.3V9.1L14 8Z", fill: "#3375FF" })
|
|
153
|
-
] }) });
|
|
154
|
-
var PhantomWalletIcon = () => /* @__PURE__ */ jsx(IconFrame, { background: "linear-gradient(135deg, #6C47FF 0%, #9B6BFF 100%)", children: /* @__PURE__ */ jsxs("svg", { width: "30", height: "30", viewBox: "0 0 30 30", fill: "none", children: [
|
|
155
|
-
/* @__PURE__ */ jsx("path", { d: "M8 18.5C8 14.4 11.2 11 15.3 11H20.4C21.8 11 23 12.2 23 13.6C23 15 21.8 16.2 20.4 16.2H14.7", stroke: "white", strokeWidth: "3", strokeLinecap: "round" }),
|
|
156
|
-
/* @__PURE__ */ jsx("path", { d: "M10.5 14H19.5", stroke: "white", strokeWidth: "3", strokeLinecap: "round" }),
|
|
157
|
-
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "20", r: "1.4", fill: "white" }),
|
|
158
|
-
/* @__PURE__ */ jsx("circle", { cx: "18", cy: "20", r: "1.4", fill: "white" })
|
|
159
|
-
] }) });
|
|
160
|
-
var RabbyWalletIcon = () => /* @__PURE__ */ jsx(IconFrame, { background: "#EBF2FF", children: /* @__PURE__ */ jsxs("svg", { width: "30", height: "30", viewBox: "0 0 30 30", fill: "none", children: [
|
|
161
|
-
/* @__PURE__ */ jsx("path", { d: "M11 7L13.5 13", stroke: "#7084FF", strokeWidth: "3", strokeLinecap: "round" }),
|
|
162
|
-
/* @__PURE__ */ jsx("path", { d: "M19 7L16.5 13", stroke: "#7084FF", strokeWidth: "3", strokeLinecap: "round" }),
|
|
163
|
-
/* @__PURE__ */ jsx("rect", { x: "8", y: "12", width: "14", height: "11", rx: "6", fill: "#7084FF" }),
|
|
164
|
-
/* @__PURE__ */ jsx("circle", { cx: "13", cy: "17", r: "1.4", fill: "white" }),
|
|
165
|
-
/* @__PURE__ */ jsx("circle", { cx: "17", cy: "17", r: "1.4", fill: "white" }),
|
|
166
|
-
/* @__PURE__ */ jsx("path", { d: "M13 20C13.6 20.4 14.3 20.6 15 20.6C15.7 20.6 16.4 20.4 17 20", stroke: "white", strokeWidth: "1.8", strokeLinecap: "round" })
|
|
167
|
-
] }) });
|
|
168
|
-
var RainbowWalletIcon = () => /* @__PURE__ */ jsx(IconFrame, { background: "linear-gradient(180deg, #174299 0%, #001E59 100%)", children: /* @__PURE__ */ jsxs("svg", { width: "32", height: "32", viewBox: "0 0 120 120", fill: "none", style: { overflow: "hidden", borderRadius: 12 }, children: [
|
|
169
|
-
/* @__PURE__ */ jsxs("defs", { children: [
|
|
170
|
-
/* @__PURE__ */ jsxs("radialGradient", { id: "rainbow_r1", cx: "0", cy: "0", r: "1", gradientUnits: "userSpaceOnUse", gradientTransform: "translate(26 94) rotate(-90) scale(74)", children: [
|
|
171
|
-
/* @__PURE__ */ jsx("stop", { offset: "0.770277", stopColor: "#FF4000" }),
|
|
172
|
-
/* @__PURE__ */ jsx("stop", { offset: "1", stopColor: "#8754C9" })
|
|
173
|
-
] }),
|
|
174
|
-
/* @__PURE__ */ jsxs("linearGradient", { id: "rainbow_l2", x1: "83", y1: "97", x2: "100", y2: "97", gradientUnits: "userSpaceOnUse", children: [
|
|
175
|
-
/* @__PURE__ */ jsx("stop", { stopColor: "#FF4000" }),
|
|
176
|
-
/* @__PURE__ */ jsx("stop", { offset: "1", stopColor: "#8754C9" })
|
|
177
|
-
] }),
|
|
178
|
-
/* @__PURE__ */ jsxs("linearGradient", { id: "rainbow_l3", x1: "23", y1: "20", x2: "23", y2: "37", gradientUnits: "userSpaceOnUse", children: [
|
|
179
|
-
/* @__PURE__ */ jsx("stop", { stopColor: "#8754C9" }),
|
|
180
|
-
/* @__PURE__ */ jsx("stop", { offset: "1", stopColor: "#FF4000" })
|
|
181
|
-
] }),
|
|
182
|
-
/* @__PURE__ */ jsxs("radialGradient", { id: "rainbow_r4", cx: "0", cy: "0", r: "1", gradientUnits: "userSpaceOnUse", gradientTransform: "translate(26 94) rotate(-90) scale(58)", children: [
|
|
183
|
-
/* @__PURE__ */ jsx("stop", { offset: "0.723929", stopColor: "#FFF700" }),
|
|
184
|
-
/* @__PURE__ */ jsx("stop", { offset: "1", stopColor: "#FF9901" })
|
|
185
|
-
] }),
|
|
186
|
-
/* @__PURE__ */ jsxs("linearGradient", { id: "rainbow_l5", x1: "68", y1: "97", x2: "84", y2: "97", gradientUnits: "userSpaceOnUse", children: [
|
|
187
|
-
/* @__PURE__ */ jsx("stop", { stopColor: "#FFF700" }),
|
|
188
|
-
/* @__PURE__ */ jsx("stop", { offset: "1", stopColor: "#FF9901" })
|
|
189
|
-
] }),
|
|
190
|
-
/* @__PURE__ */ jsxs("linearGradient", { id: "rainbow_l6", x1: "23", y1: "52", x2: "23", y2: "36", gradientUnits: "userSpaceOnUse", children: [
|
|
191
|
-
/* @__PURE__ */ jsx("stop", { stopColor: "#FFF700" }),
|
|
192
|
-
/* @__PURE__ */ jsx("stop", { offset: "1", stopColor: "#FF9901" })
|
|
193
|
-
] }),
|
|
194
|
-
/* @__PURE__ */ jsxs("radialGradient", { id: "rainbow_r7", cx: "0", cy: "0", r: "1", gradientUnits: "userSpaceOnUse", gradientTransform: "translate(26 94) rotate(-90) scale(42)", children: [
|
|
195
|
-
/* @__PURE__ */ jsx("stop", { offset: "0.59513", stopColor: "#00AAFF" }),
|
|
196
|
-
/* @__PURE__ */ jsx("stop", { offset: "1", stopColor: "#01DA40" })
|
|
197
|
-
] }),
|
|
198
|
-
/* @__PURE__ */ jsxs("radialGradient", { id: "rainbow_r8", cx: "0", cy: "0", r: "1", gradientUnits: "userSpaceOnUse", gradientTransform: "translate(51 97) scale(17 45.3333)", children: [
|
|
199
|
-
/* @__PURE__ */ jsx("stop", { stopColor: "#00AAFF" }),
|
|
200
|
-
/* @__PURE__ */ jsx("stop", { offset: "1", stopColor: "#01DA40" })
|
|
201
|
-
] }),
|
|
202
|
-
/* @__PURE__ */ jsxs("radialGradient", { id: "rainbow_r9", cx: "0", cy: "0", r: "1", gradientUnits: "userSpaceOnUse", gradientTransform: "translate(23 69) rotate(-90) scale(17 322.37)", children: [
|
|
203
|
-
/* @__PURE__ */ jsx("stop", { stopColor: "#00AAFF" }),
|
|
204
|
-
/* @__PURE__ */ jsx("stop", { offset: "1", stopColor: "#01DA40" })
|
|
205
|
-
] })
|
|
206
|
-
] }),
|
|
207
|
-
/* @__PURE__ */ jsx("path", { d: "M20 38H26C56.9279 38 82 63.0721 82 94V100H94C97.3137 100 100 97.3137 100 94C100 53.1309 66.8691 20 26 20C22.6863 20 20 22.6863 20 26V38Z", fill: "url(#rainbow_r1)" }),
|
|
208
|
-
/* @__PURE__ */ jsx("path", { d: "M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z", fill: "url(#rainbow_l2)" }),
|
|
209
|
-
/* @__PURE__ */ jsx("path", { d: "M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z", fill: "url(#rainbow_l3)" }),
|
|
210
|
-
/* @__PURE__ */ jsx("path", { d: "M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z", fill: "url(#rainbow_r4)" }),
|
|
211
|
-
/* @__PURE__ */ jsx("path", { d: "M68 94H84V100H68V94Z", fill: "url(#rainbow_l5)" }),
|
|
212
|
-
/* @__PURE__ */ jsx("path", { d: "M20 52L20 36L26 36L26 52H20Z", fill: "url(#rainbow_l6)" }),
|
|
213
|
-
/* @__PURE__ */ jsx("path", { d: "M20 62C20 65.3137 22.6863 68 26 68C40.3594 68 52 79.6406 52 94C52 97.3137 54.6863 100 58 100H68V94C68 70.804 49.196 52 26 52H20V62Z", fill: "url(#rainbow_r7)" }),
|
|
214
|
-
/* @__PURE__ */ jsx("path", { d: "M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z", fill: "url(#rainbow_r8)" }),
|
|
215
|
-
/* @__PURE__ */ jsx("path", { d: "M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z", fill: "url(#rainbow_r9)" })
|
|
216
|
-
] }) });
|
|
217
|
-
var ZerionWalletIcon = () => /* @__PURE__ */ jsx(IconFrame, { background: "#2962EF", children: /* @__PURE__ */ jsx("svg", { width: "28", height: "28", viewBox: "0 0 28 28", fill: "none", children: /* @__PURE__ */ jsx("path", { fill: "#fff", d: "M6.073 7c-.48 0-.665.593-.262.841l10.073 6.074a.577.577 0 0 0 .758-.139l4.43-5.814c.3-.404-.004-.962-.525-.962H6.073ZM21.904 21c.48 0 .67-.596.267-.844l-10.075-6.073a.569.569 0 0 0-.751.146l-4.437 5.813c-.301.404.012.958.534.958h14.462Z" }) }) });
|
|
218
|
-
var BraveWalletIcon = () => /* @__PURE__ */ jsx(IconFrame, { background: "#FFF", children: /* @__PURE__ */ jsxs("svg", { width: "32", height: "32", viewBox: "-100 -100 2970 2970", fill: "none", style: { overflow: "hidden", borderRadius: 12 }, children: [
|
|
219
|
-
/* @__PURE__ */ jsxs("defs", { children: [
|
|
220
|
-
/* @__PURE__ */ jsxs("linearGradient", { id: "brave_a", y1: "51%", y2: "51%", children: [
|
|
221
|
-
/* @__PURE__ */ jsx("stop", { offset: "0.4", stopColor: "#f50" }),
|
|
222
|
-
/* @__PURE__ */ jsx("stop", { offset: "0.6", stopColor: "#ff2000" })
|
|
223
|
-
] }),
|
|
224
|
-
/* @__PURE__ */ jsxs("linearGradient", { id: "brave_b", x1: "2%", y1: "51%", x2: "51%", y2: "51%", children: [
|
|
225
|
-
/* @__PURE__ */ jsx("stop", { offset: "0", stopColor: "#ff452a" }),
|
|
226
|
-
/* @__PURE__ */ jsx("stop", { offset: "1", stopColor: "#ff2000" })
|
|
227
|
-
] })
|
|
228
|
-
] }),
|
|
229
|
-
/* @__PURE__ */ jsx("path", { fill: "url(#brave_a)", d: "m2395 723 60-147-170-176c-92-92-288-38-288-38l-222-252H992L769 363s-196-53-288 37L311 575l60 147-75 218 250 953c52 204 87 283 234 387l457 310c44 27 98 74 147 74s103-47 147-74l457-310c147-104 182-183 234-387l250-953z" }),
|
|
230
|
-
/* @__PURE__ */ jsx("path", { fill: "#fff", d: "M1935 524s287 347 287 420c0 75-36 94-72 133l-215 230c-20 20-63 54-38 113 25 60 60 134 20 210-40 77-110 128-155 120a820 820 0 0 1-190-90c-38-25-160-126-160-165s126-110 150-124c23-16 130-78 132-102s2-30-30-90-88-140-80-192c10-52 100-80 167-105l207-78c16-8 12-15-36-20-48-4-183-22-244-5s-163 43-173 57c-8 14-16 14-7 62l58 315c4 40 12 67-30 77-44 10-117 27-142 27s-99-17-142-27-35-37-30-77c4-40 48-268 57-315 10-48 1-48-7-62-10-14-113-40-174-57-60-17-196 1-244 6-48 4-52 10-36 20l207 77c66 25 158 53 167 105 10 53-47 132-80 192s-32 66-30 90 110 86 132 102c24 15 150 85 150 124s-119 140-159 165a820 820 0 0 1-190 90c-45 8-115-43-156-120-40-76-4-150 20-210 25-60-17-92-38-113l-215-230c-35-37-71-57-71-131s287-420 287-420l273 44c32 0 103-27 168-50 65-20 110-22 110-22s44 0 110 22 136 50 168 50c33 0 275-47 275-47zm-215 1328c18 10 7 32-10 44l-254 198c-20 20-52 50-73 50s-52-30-73-50a13200 13200 0 0 0-255-198c-16-12-27-33-10-44l150-80a870 870 0 0 1 188-73c15 0 110 34 187 73l150 80z" }),
|
|
231
|
-
/* @__PURE__ */ jsx("path", { fill: "url(#brave_b)", d: "m1999 363-224-253H992L769 363s-196-53-288 37c0 0 260-23 350 123l276 47c32 0 103-27 168-50 65-20 110-22 110-22s44 0 110 22 136 50 168 50c33 0 275-47 275-47 90-146 350-123 350-123-92-92-288-38-288-38" })
|
|
232
|
-
] }) });
|
|
233
|
-
var BitgetWalletIcon = () => /* @__PURE__ */ jsx(IconFrame, { background: "#001F29", children: /* @__PURE__ */ jsx("svg", { width: "28", height: "28", viewBox: "0 0 512 512", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M219.948 95.7022C201.623 95.6929 183.33 95.6835 164.941 95.7116C153.822 95.7116 149.651 109.671 157.921 117.939L283.098 243.117C287.004 246.69 289.441 250.574 289.53 255.693C289.441 260.812 287.004 264.696 283.098 268.269L157.921 393.446C149.651 401.715 153.822 415.674 164.941 415.674C183.33 415.702 201.623 415.693 219.948 415.683C229.122 415.679 238.305 415.674 247.511 415.674C259.555 415.674 266.72 409.24 273.154 402.805L386.047 289.912C395.057 280.902 403.119 268.939 403.009 255.693C403.119 242.447 395.057 230.484 386.047 221.474L273.154 108.58C266.72 102.146 259.555 95.7116 247.511 95.7116C238.305 95.7116 229.122 95.7069 219.948 95.7022Z", fill: "#00F0FF" }) }) });
|
|
234
|
-
var WalletPlaceholder = ({ name }) => /* @__PURE__ */ jsx(
|
|
235
|
-
"div",
|
|
236
|
-
{
|
|
237
|
-
style: {
|
|
238
|
-
width: 48,
|
|
239
|
-
height: 48,
|
|
240
|
-
borderRadius: 10,
|
|
241
|
-
background: colors.cardRaised,
|
|
242
|
-
display: "flex",
|
|
243
|
-
alignItems: "center",
|
|
244
|
-
justifyContent: "center",
|
|
245
|
-
fontSize: 16,
|
|
246
|
-
fontWeight: 600,
|
|
247
|
-
color: colors.textSecondary,
|
|
248
|
-
fontFamily: fonts.family
|
|
249
|
-
},
|
|
250
|
-
children: name.slice(0, 2).toUpperCase()
|
|
251
|
-
}
|
|
252
|
-
);
|
|
253
|
-
var DefaultWalletIcon = ({
|
|
254
|
-
walletId,
|
|
255
|
-
name
|
|
256
|
-
}) => {
|
|
90
|
+
display: "flex",
|
|
91
|
+
alignItems: "center",
|
|
92
|
+
justifyContent: "center",
|
|
93
|
+
overflow: "hidden"
|
|
94
|
+
}, children });
|
|
95
|
+
var MetaMaskWalletIcon = () => jsx(IconFrame, { background: "#1A0F07", children: jsxs("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", children: [jsx("path", { d: "M8 6L15 11L12 14L8 6Z", fill: "#E17726" }), jsx("path", { d: "M24 6L17 11L20 14L24 6Z", fill: "#E27625" }), jsx("path", { d: "M11 19L15 22V17L11 19Z", fill: "#F6851B" }), jsx("path", { d: "M21 19L17 22V17L21 19Z", fill: "#F6851B" }), jsx("path", { d: "M12 14L15 11V17L11 19L12 14Z", fill: "#763D16" }), jsx("path", { d: "M20 14L17 11V17L21 19L20 14Z", fill: "#763D16" })] }) });
|
|
96
|
+
var OKXWalletIcon = () => jsx(IconFrame, { background: "#FFFFFF", children: jsxs("svg", { width: "30", height: "30", viewBox: "0 0 30 30", fill: "none", children: [jsx("rect", { x: "2", y: "2", width: "8", height: "8", rx: "2", fill: "#050608" }), jsx("rect", { x: "11", y: "2", width: "8", height: "8", rx: "2", fill: "#050608" }), jsx("rect", { x: "20", y: "2", width: "8", height: "8", rx: "2", fill: "#050608" }), jsx("rect", { x: "2", y: "11", width: "8", height: "8", rx: "2", fill: "#050608" }), jsx("rect", { x: "20", y: "11", width: "8", height: "8", rx: "2", fill: "#050608" }), jsx("rect", { x: "2", y: "20", width: "8", height: "8", rx: "2", fill: "#050608" }), jsx("rect", { x: "11", y: "20", width: "8", height: "8", rx: "2", fill: "#050608" }), jsx("rect", { x: "20", y: "20", width: "8", height: "8", rx: "2", fill: "#050608" })] }) });
|
|
97
|
+
var CoinbaseWalletIcon = () => jsx(IconFrame, { background: "#0052FF", children: jsxs("svg", { width: "30", height: "30", viewBox: "0 0 30 30", fill: "none", children: [jsx("circle", { cx: "15", cy: "15", r: "10", stroke: "white", strokeWidth: "4" }), jsx("rect", { x: "9", y: "13", width: "12", height: "4", rx: "2", fill: "white" })] }) });
|
|
98
|
+
var TrustWalletIcon = () => jsx(IconFrame, { background: "#3375FF", children: jsxs("svg", { width: "28", height: "28", viewBox: "0 0 28 28", fill: "none", children: [jsx("path", { d: "M14 4L21 6.6V12.8C21 17.1 18.1 20.9 14 22.4C9.9 20.9 7 17.1 7 12.8V6.6L14 4Z", fill: "white" }), jsx("path", { d: "M14 8L17 9.1V12.3C17 14.7 15.7 16.8 14 17.6C12.3 16.8 11 14.7 11 12.3V9.1L14 8Z", fill: "#3375FF" })] }) });
|
|
99
|
+
var PhantomWalletIcon = () => jsx(IconFrame, { background: "linear-gradient(135deg, #6C47FF 0%, #9B6BFF 100%)", children: jsxs("svg", { width: "30", height: "30", viewBox: "0 0 30 30", fill: "none", children: [jsx("path", { d: "M8 18.5C8 14.4 11.2 11 15.3 11H20.4C21.8 11 23 12.2 23 13.6C23 15 21.8 16.2 20.4 16.2H14.7", stroke: "white", strokeWidth: "3", strokeLinecap: "round" }), jsx("path", { d: "M10.5 14H19.5", stroke: "white", strokeWidth: "3", strokeLinecap: "round" }), jsx("circle", { cx: "12", cy: "20", r: "1.4", fill: "white" }), jsx("circle", { cx: "18", cy: "20", r: "1.4", fill: "white" })] }) });
|
|
100
|
+
var RabbyWalletIcon = () => jsx(IconFrame, { background: "#EBF2FF", children: jsxs("svg", { width: "30", height: "30", viewBox: "0 0 30 30", fill: "none", children: [jsx("path", { d: "M11 7L13.5 13", stroke: "#7084FF", strokeWidth: "3", strokeLinecap: "round" }), jsx("path", { d: "M19 7L16.5 13", stroke: "#7084FF", strokeWidth: "3", strokeLinecap: "round" }), jsx("rect", { x: "8", y: "12", width: "14", height: "11", rx: "6", fill: "#7084FF" }), jsx("circle", { cx: "13", cy: "17", r: "1.4", fill: "white" }), jsx("circle", { cx: "17", cy: "17", r: "1.4", fill: "white" }), jsx("path", { d: "M13 20C13.6 20.4 14.3 20.6 15 20.6C15.7 20.6 16.4 20.4 17 20", stroke: "white", strokeWidth: "1.8", strokeLinecap: "round" })] }) });
|
|
101
|
+
var RainbowWalletIcon = () => jsx(IconFrame, { background: "linear-gradient(180deg, #174299 0%, #001E59 100%)", children: jsxs("svg", { width: "32", height: "32", viewBox: "0 0 120 120", fill: "none", style: { overflow: "hidden", borderRadius: 12 }, children: [jsxs("defs", { children: [jsxs("radialGradient", { id: "rainbow_r1", cx: "0", cy: "0", r: "1", gradientUnits: "userSpaceOnUse", gradientTransform: "translate(26 94) rotate(-90) scale(74)", children: [jsx("stop", { offset: "0.770277", stopColor: "#FF4000" }), jsx("stop", { offset: "1", stopColor: "#8754C9" })] }), jsxs("linearGradient", { id: "rainbow_l2", x1: "83", y1: "97", x2: "100", y2: "97", gradientUnits: "userSpaceOnUse", children: [jsx("stop", { stopColor: "#FF4000" }), jsx("stop", { offset: "1", stopColor: "#8754C9" })] }), jsxs("linearGradient", { id: "rainbow_l3", x1: "23", y1: "20", x2: "23", y2: "37", gradientUnits: "userSpaceOnUse", children: [jsx("stop", { stopColor: "#8754C9" }), jsx("stop", { offset: "1", stopColor: "#FF4000" })] }), jsxs("radialGradient", { id: "rainbow_r4", cx: "0", cy: "0", r: "1", gradientUnits: "userSpaceOnUse", gradientTransform: "translate(26 94) rotate(-90) scale(58)", children: [jsx("stop", { offset: "0.723929", stopColor: "#FFF700" }), jsx("stop", { offset: "1", stopColor: "#FF9901" })] }), jsxs("linearGradient", { id: "rainbow_l5", x1: "68", y1: "97", x2: "84", y2: "97", gradientUnits: "userSpaceOnUse", children: [jsx("stop", { stopColor: "#FFF700" }), jsx("stop", { offset: "1", stopColor: "#FF9901" })] }), jsxs("linearGradient", { id: "rainbow_l6", x1: "23", y1: "52", x2: "23", y2: "36", gradientUnits: "userSpaceOnUse", children: [jsx("stop", { stopColor: "#FFF700" }), jsx("stop", { offset: "1", stopColor: "#FF9901" })] }), jsxs("radialGradient", { id: "rainbow_r7", cx: "0", cy: "0", r: "1", gradientUnits: "userSpaceOnUse", gradientTransform: "translate(26 94) rotate(-90) scale(42)", children: [jsx("stop", { offset: "0.59513", stopColor: "#00AAFF" }), jsx("stop", { offset: "1", stopColor: "#01DA40" })] }), jsxs("radialGradient", { id: "rainbow_r8", cx: "0", cy: "0", r: "1", gradientUnits: "userSpaceOnUse", gradientTransform: "translate(51 97) scale(17 45.3333)", children: [jsx("stop", { stopColor: "#00AAFF" }), jsx("stop", { offset: "1", stopColor: "#01DA40" })] }), jsxs("radialGradient", { id: "rainbow_r9", cx: "0", cy: "0", r: "1", gradientUnits: "userSpaceOnUse", gradientTransform: "translate(23 69) rotate(-90) scale(17 322.37)", children: [jsx("stop", { stopColor: "#00AAFF" }), jsx("stop", { offset: "1", stopColor: "#01DA40" })] })] }), jsx("path", { d: "M20 38H26C56.9279 38 82 63.0721 82 94V100H94C97.3137 100 100 97.3137 100 94C100 53.1309 66.8691 20 26 20C22.6863 20 20 22.6863 20 26V38Z", fill: "url(#rainbow_r1)" }), jsx("path", { d: "M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z", fill: "url(#rainbow_l2)" }), jsx("path", { d: "M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z", fill: "url(#rainbow_l3)" }), jsx("path", { d: "M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z", fill: "url(#rainbow_r4)" }), jsx("path", { d: "M68 94H84V100H68V94Z", fill: "url(#rainbow_l5)" }), jsx("path", { d: "M20 52L20 36L26 36L26 52H20Z", fill: "url(#rainbow_l6)" }), jsx("path", { d: "M20 62C20 65.3137 22.6863 68 26 68C40.3594 68 52 79.6406 52 94C52 97.3137 54.6863 100 58 100H68V94C68 70.804 49.196 52 26 52H20V62Z", fill: "url(#rainbow_r7)" }), jsx("path", { d: "M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z", fill: "url(#rainbow_r8)" }), jsx("path", { d: "M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z", fill: "url(#rainbow_r9)" })] }) });
|
|
102
|
+
var ZerionWalletIcon = () => jsx(IconFrame, { background: "#2962EF", children: jsx("svg", { width: "28", height: "28", viewBox: "0 0 28 28", fill: "none", children: jsx("path", { fill: "#fff", d: "M6.073 7c-.48 0-.665.593-.262.841l10.073 6.074a.577.577 0 0 0 .758-.139l4.43-5.814c.3-.404-.004-.962-.525-.962H6.073ZM21.904 21c.48 0 .67-.596.267-.844l-10.075-6.073a.569.569 0 0 0-.751.146l-4.437 5.813c-.301.404.012.958.534.958h14.462Z" }) }) });
|
|
103
|
+
var BraveWalletIcon = () => jsx(IconFrame, { background: "#FFF", children: jsxs("svg", { width: "32", height: "32", viewBox: "-100 -100 2970 2970", fill: "none", style: { overflow: "hidden", borderRadius: 12 }, children: [jsxs("defs", { children: [jsxs("linearGradient", { id: "brave_a", y1: "51%", y2: "51%", children: [jsx("stop", { offset: "0.4", stopColor: "#f50" }), jsx("stop", { offset: "0.6", stopColor: "#ff2000" })] }), jsxs("linearGradient", { id: "brave_b", x1: "2%", y1: "51%", x2: "51%", y2: "51%", children: [jsx("stop", { offset: "0", stopColor: "#ff452a" }), jsx("stop", { offset: "1", stopColor: "#ff2000" })] })] }), jsx("path", { fill: "url(#brave_a)", d: "m2395 723 60-147-170-176c-92-92-288-38-288-38l-222-252H992L769 363s-196-53-288 37L311 575l60 147-75 218 250 953c52 204 87 283 234 387l457 310c44 27 98 74 147 74s103-47 147-74l457-310c147-104 182-183 234-387l250-953z" }), jsx("path", { fill: "#fff", d: "M1935 524s287 347 287 420c0 75-36 94-72 133l-215 230c-20 20-63 54-38 113 25 60 60 134 20 210-40 77-110 128-155 120a820 820 0 0 1-190-90c-38-25-160-126-160-165s126-110 150-124c23-16 130-78 132-102s2-30-30-90-88-140-80-192c10-52 100-80 167-105l207-78c16-8 12-15-36-20-48-4-183-22-244-5s-163 43-173 57c-8 14-16 14-7 62l58 315c4 40 12 67-30 77-44 10-117 27-142 27s-99-17-142-27-35-37-30-77c4-40 48-268 57-315 10-48 1-48-7-62-10-14-113-40-174-57-60-17-196 1-244 6-48 4-52 10-36 20l207 77c66 25 158 53 167 105 10 53-47 132-80 192s-32 66-30 90 110 86 132 102c24 15 150 85 150 124s-119 140-159 165a820 820 0 0 1-190 90c-45 8-115-43-156-120-40-76-4-150 20-210 25-60-17-92-38-113l-215-230c-35-37-71-57-71-131s287-420 287-420l273 44c32 0 103-27 168-50 65-20 110-22 110-22s44 0 110 22 136 50 168 50c33 0 275-47 275-47zm-215 1328c18 10 7 32-10 44l-254 198c-20 20-52 50-73 50s-52-30-73-50a13200 13200 0 0 0-255-198c-16-12-27-33-10-44l150-80a870 870 0 0 1 188-73c15 0 110 34 187 73l150 80z" }), jsx("path", { fill: "url(#brave_b)", d: "m1999 363-224-253H992L769 363s-196-53-288 37c0 0 260-23 350 123l276 47c32 0 103-27 168-50 65-20 110-22 110-22s44 0 110 22 136 50 168 50c33 0 275-47 275-47 90-146 350-123 350-123-92-92-288-38-288-38" })] }) });
|
|
104
|
+
var BitgetWalletIcon = () => jsx(IconFrame, { background: "#001F29", children: jsx("svg", { width: "28", height: "28", viewBox: "0 0 512 512", fill: "none", children: jsx("path", { d: "M219.948 95.7022C201.623 95.6929 183.33 95.6835 164.941 95.7116C153.822 95.7116 149.651 109.671 157.921 117.939L283.098 243.117C287.004 246.69 289.441 250.574 289.53 255.693C289.441 260.812 287.004 264.696 283.098 268.269L157.921 393.446C149.651 401.715 153.822 415.674 164.941 415.674C183.33 415.702 201.623 415.693 219.948 415.683C229.122 415.679 238.305 415.674 247.511 415.674C259.555 415.674 266.72 409.24 273.154 402.805L386.047 289.912C395.057 280.902 403.119 268.939 403.009 255.693C403.119 242.447 395.057 230.484 386.047 221.474L273.154 108.58C266.72 102.146 259.555 95.7116 247.511 95.7116C238.305 95.7116 229.122 95.7069 219.948 95.7022Z", fill: "#00F0FF" }) }) });
|
|
105
|
+
var WalletPlaceholder = ({ name }) => jsx("div", { style: {
|
|
106
|
+
width: 48,
|
|
107
|
+
height: 48,
|
|
108
|
+
borderRadius: 10,
|
|
109
|
+
background: colors.cardRaised,
|
|
110
|
+
display: "flex",
|
|
111
|
+
alignItems: "center",
|
|
112
|
+
justifyContent: "center",
|
|
113
|
+
fontSize: 16,
|
|
114
|
+
fontWeight: 600,
|
|
115
|
+
color: colors.textSecondary,
|
|
116
|
+
fontFamily: fonts.family
|
|
117
|
+
}, children: name.slice(0, 2).toUpperCase() });
|
|
118
|
+
var DefaultWalletIcon = ({ walletId, name }) => {
|
|
257
119
|
switch (walletId) {
|
|
258
120
|
case "metamask":
|
|
259
|
-
return
|
|
121
|
+
return jsx(MetaMaskWalletIcon, {});
|
|
260
122
|
case "okx":
|
|
261
|
-
return
|
|
123
|
+
return jsx(OKXWalletIcon, {});
|
|
262
124
|
case "coinbase":
|
|
263
|
-
return
|
|
125
|
+
return jsx(CoinbaseWalletIcon, {});
|
|
264
126
|
case "trust":
|
|
265
|
-
return
|
|
127
|
+
return jsx(TrustWalletIcon, {});
|
|
266
128
|
case "phantom":
|
|
267
|
-
return
|
|
129
|
+
return jsx(PhantomWalletIcon, {});
|
|
268
130
|
case "rabby":
|
|
269
|
-
return
|
|
131
|
+
return jsx(RabbyWalletIcon, {});
|
|
270
132
|
case "rainbow":
|
|
271
|
-
return
|
|
133
|
+
return jsx(RainbowWalletIcon, {});
|
|
272
134
|
case "zerion":
|
|
273
|
-
return
|
|
135
|
+
return jsx(ZerionWalletIcon, {});
|
|
274
136
|
case "brave":
|
|
275
|
-
return
|
|
137
|
+
return jsx(BraveWalletIcon, {});
|
|
276
138
|
case "bitget":
|
|
277
|
-
return
|
|
139
|
+
return jsx(BitgetWalletIcon, {});
|
|
278
140
|
default:
|
|
279
|
-
return
|
|
141
|
+
return jsx(WalletPlaceholder, { name });
|
|
280
142
|
}
|
|
281
143
|
};
|
|
282
|
-
var CloseButton = ({ onClick }) =>
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
cursor: "pointer",
|
|
296
|
-
display: "flex",
|
|
297
|
-
alignItems: "center",
|
|
298
|
-
justifyContent: "center",
|
|
299
|
-
padding: 0,
|
|
300
|
-
flexShrink: 0
|
|
301
|
-
},
|
|
302
|
-
children: /* @__PURE__ */ jsx("svg", { className: "absdk-predicate-close-button__icon", width: "17", height: "17", viewBox: "0 0 17 17", fill: "none", children: /* @__PURE__ */ jsx(
|
|
303
|
-
"path",
|
|
304
|
-
{
|
|
305
|
-
className: "absdk-predicate-close-button__icon-path",
|
|
306
|
-
d: "M4.25 4.25L12.75 12.75M12.75 4.25L4.25 12.75",
|
|
307
|
-
stroke: colors.textPrimary,
|
|
308
|
-
strokeWidth: "1.5",
|
|
309
|
-
strokeLinecap: "round"
|
|
310
|
-
}
|
|
311
|
-
) })
|
|
312
|
-
}
|
|
313
|
-
);
|
|
144
|
+
var CloseButton = ({ onClick }) => jsx("button", { className: "absdk-predicate-close-button", type: "button", onClick, "aria-label": "Close", style: {
|
|
145
|
+
width: 30,
|
|
146
|
+
height: 30,
|
|
147
|
+
borderRadius: "50%",
|
|
148
|
+
background: colors.card,
|
|
149
|
+
border: "none",
|
|
150
|
+
cursor: "pointer",
|
|
151
|
+
display: "flex",
|
|
152
|
+
alignItems: "center",
|
|
153
|
+
justifyContent: "center",
|
|
154
|
+
padding: 0,
|
|
155
|
+
flexShrink: 0
|
|
156
|
+
}, children: jsx("svg", { className: "absdk-predicate-close-button__icon", width: "17", height: "17", viewBox: "0 0 17 17", fill: "none", children: jsx("path", { className: "absdk-predicate-close-button__icon-path", d: "M4.25 4.25L12.75 12.75M12.75 4.25L4.25 12.75", stroke: colors.textPrimary, strokeWidth: "1.5", strokeLinecap: "round" }) }) });
|
|
314
157
|
var MOBILE_BREAKPOINT_PX = 720;
|
|
315
158
|
var MOBILE_MODAL_WIDTH_PX = 375;
|
|
316
159
|
var MOBILE_MODAL_GUTTER_PX = 16;
|
|
@@ -318,11 +161,10 @@ function isMobileViewport(width) {
|
|
|
318
161
|
return width < MOBILE_BREAKPOINT_PX;
|
|
319
162
|
}
|
|
320
163
|
function useIsMobileViewport() {
|
|
321
|
-
const [isMobile, setIsMobile] = useState(
|
|
322
|
-
() => typeof window !== "undefined" ? isMobileViewport(window.innerWidth) : false
|
|
323
|
-
);
|
|
164
|
+
const [isMobile, setIsMobile] = useState(() => typeof window !== "undefined" ? isMobileViewport(window.innerWidth) : false);
|
|
324
165
|
useEffect(() => {
|
|
325
|
-
if (typeof window === "undefined")
|
|
166
|
+
if (typeof window === "undefined")
|
|
167
|
+
return;
|
|
326
168
|
const handleResize = () => {
|
|
327
169
|
setIsMobile(isMobileViewport(window.innerWidth));
|
|
328
170
|
};
|
|
@@ -332,335 +174,132 @@ function useIsMobileViewport() {
|
|
|
332
174
|
}, []);
|
|
333
175
|
return isMobile;
|
|
334
176
|
}
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
cardStyle,
|
|
339
|
-
contentStyle,
|
|
340
|
-
children
|
|
341
|
-
}) => {
|
|
177
|
+
|
|
178
|
+
// ../sign_in_sdk/dist/ui/components/ModalFrame.js
|
|
179
|
+
var ModalFrame = ({ onClose, width = 500, cardStyle, contentStyle, children }) => {
|
|
342
180
|
const isMobile = useIsMobileViewport();
|
|
343
|
-
return
|
|
344
|
-
"
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
{
|
|
384
|
-
className: "absdk-predicate-modal-frame__card",
|
|
385
|
-
style: {
|
|
386
|
-
width: isMobile ? "100%" : width,
|
|
387
|
-
maxWidth: "100%",
|
|
388
|
-
maxHeight: isMobile ? "90vh" : void 0,
|
|
389
|
-
background: colors.card,
|
|
390
|
-
borderRadius: radii.card,
|
|
391
|
-
overflow: "hidden",
|
|
392
|
-
...cardStyle
|
|
393
|
-
},
|
|
394
|
-
children: /* @__PURE__ */ jsx(
|
|
395
|
-
"div",
|
|
396
|
-
{
|
|
397
|
-
className: "absdk-predicate-modal-frame__content",
|
|
398
|
-
style: {
|
|
399
|
-
display: "flex",
|
|
400
|
-
flexDirection: "column",
|
|
401
|
-
minHeight: 0,
|
|
402
|
-
maxHeight: isMobile ? "90vh" : void 0,
|
|
403
|
-
overflowY: isMobile ? "auto" : void 0,
|
|
404
|
-
overflowX: "hidden",
|
|
405
|
-
WebkitOverflowScrolling: "touch",
|
|
406
|
-
fontFamily: fonts.family,
|
|
407
|
-
color: colors.textPrimary,
|
|
408
|
-
boxSizing: "border-box",
|
|
409
|
-
...contentStyle
|
|
410
|
-
},
|
|
411
|
-
children
|
|
412
|
-
}
|
|
413
|
-
)
|
|
414
|
-
}
|
|
415
|
-
)
|
|
416
|
-
]
|
|
417
|
-
}
|
|
418
|
-
)
|
|
419
|
-
}
|
|
420
|
-
);
|
|
181
|
+
return jsx("div", { className: `absdk-predicate-modal-frame ${isMobile ? "absdk-predicate-modal-frame--mobile" : "absdk-predicate-modal-frame--desktop"}`, style: {
|
|
182
|
+
display: "flex",
|
|
183
|
+
flexDirection: "column",
|
|
184
|
+
alignItems: "center",
|
|
185
|
+
justifyContent: "center",
|
|
186
|
+
width: "100%",
|
|
187
|
+
maxHeight: isMobile ? "90vh" : void 0
|
|
188
|
+
}, children: jsxs("div", { className: "absdk-predicate-modal-frame__layout", style: {
|
|
189
|
+
display: "flex",
|
|
190
|
+
flexDirection: isMobile ? "column" : "row",
|
|
191
|
+
gap: isMobile ? 10 : 14,
|
|
192
|
+
alignItems: isMobile ? "stretch" : "flex-start",
|
|
193
|
+
width: isMobile ? `min(${MOBILE_MODAL_WIDTH_PX}px, calc(100vw - ${MOBILE_MODAL_GUTTER_PX * 2}px))` : "auto"
|
|
194
|
+
}, children: [onClose ? jsx("div", { className: "absdk-predicate-modal-frame__close", style: {
|
|
195
|
+
display: "flex",
|
|
196
|
+
justifyContent: isMobile ? "flex-end" : "flex-start",
|
|
197
|
+
order: isMobile ? -1 : 1,
|
|
198
|
+
paddingTop: isMobile ? 13 : 0,
|
|
199
|
+
paddingRight: isMobile ? 2 : 0
|
|
200
|
+
}, children: jsx(CloseButton, { onClick: onClose }) }) : null, jsx("div", { className: "absdk-predicate-modal-frame__card", style: {
|
|
201
|
+
width: isMobile ? "100%" : width,
|
|
202
|
+
maxWidth: "100%",
|
|
203
|
+
maxHeight: isMobile ? "90vh" : void 0,
|
|
204
|
+
background: colors.card,
|
|
205
|
+
borderRadius: radii.card,
|
|
206
|
+
overflow: "hidden",
|
|
207
|
+
...cardStyle
|
|
208
|
+
}, children: jsx("div", { className: "absdk-predicate-modal-frame__content", style: {
|
|
209
|
+
display: "flex",
|
|
210
|
+
flexDirection: "column",
|
|
211
|
+
minHeight: 0,
|
|
212
|
+
maxHeight: isMobile ? "90vh" : void 0,
|
|
213
|
+
overflowY: isMobile ? "auto" : void 0,
|
|
214
|
+
overflowX: "hidden",
|
|
215
|
+
WebkitOverflowScrolling: "touch",
|
|
216
|
+
fontFamily: fonts.family,
|
|
217
|
+
color: colors.textPrimary,
|
|
218
|
+
boxSizing: "border-box",
|
|
219
|
+
...contentStyle
|
|
220
|
+
}, children }) })] }) });
|
|
421
221
|
};
|
|
222
|
+
|
|
223
|
+
// ../sign_in_sdk/dist/ui/SignInModal.sections.js
|
|
422
224
|
async function loadWalletAccount() {
|
|
423
|
-
return import('./account-
|
|
225
|
+
return import('./account-6PGNCFOX.js');
|
|
424
226
|
}
|
|
425
227
|
async function loadOidcAuth() {
|
|
426
228
|
return import('./dist-Q2PDXT2F.js');
|
|
427
229
|
}
|
|
428
|
-
var SignInModalFrame = ({
|
|
429
|
-
id,
|
|
430
|
-
title,
|
|
431
|
-
onClose,
|
|
432
|
-
footer,
|
|
433
|
-
children
|
|
434
|
-
}) => {
|
|
230
|
+
var SignInModalFrame = ({ id, title, onClose, footer, children }) => {
|
|
435
231
|
const isMobile = useIsMobileViewport();
|
|
436
|
-
return
|
|
437
|
-
ModalFrame,
|
|
438
|
-
{
|
|
439
|
-
onClose,
|
|
440
|
-
cardStyle: { padding: isMobile ? "24px 16px" : "32px 24px" },
|
|
441
|
-
contentStyle: { alignItems: "center" },
|
|
442
|
-
children: /* @__PURE__ */ jsxs(
|
|
443
|
-
"div",
|
|
444
|
-
{
|
|
445
|
-
style: { width: "100%", display: "flex", flexDirection: "column", gap: isMobile ? 20 : 24, alignItems: "center" },
|
|
446
|
-
id,
|
|
447
|
-
className: `absdk-predicate-signin-modal ${isMobile ? "absdk-predicate-signin-modal--mobile" : "absdk-predicate-signin-modal--desktop"}`,
|
|
448
|
-
children: [
|
|
449
|
-
/* @__PURE__ */ jsx(
|
|
450
|
-
"h2",
|
|
451
|
-
{
|
|
452
|
-
className: "absdk-predicate-signin-modal__title",
|
|
453
|
-
style: { margin: 0, fontSize: isMobile ? 22 : 24, fontWeight: 600, lineHeight: 1.4, textAlign: "center" },
|
|
454
|
-
children: title
|
|
455
|
-
}
|
|
456
|
-
),
|
|
457
|
-
/* @__PURE__ */ jsx("div", { className: "absdk-predicate-signin-modal__content", style: { width: "100%", display: "flex", flexDirection: "column", gap: 12, alignItems: "center" }, children }),
|
|
458
|
-
footer
|
|
459
|
-
]
|
|
460
|
-
}
|
|
461
|
-
)
|
|
462
|
-
}
|
|
463
|
-
);
|
|
232
|
+
return jsx(ModalFrame, { onClose, cardStyle: { padding: isMobile ? "24px 16px" : "32px 24px" }, contentStyle: { alignItems: "center" }, children: jsxs("div", { style: { width: "100%", display: "flex", flexDirection: "column", gap: isMobile ? 20 : 24, alignItems: "center" }, id, className: `absdk-predicate-signin-modal ${isMobile ? "absdk-predicate-signin-modal--mobile" : "absdk-predicate-signin-modal--desktop"}`, children: [jsx("h2", { className: "absdk-predicate-signin-modal__title", style: { margin: 0, fontSize: isMobile ? 22 : 24, fontWeight: 600, lineHeight: 1.4, textAlign: "center" }, children: title }), jsx("div", { className: "absdk-predicate-signin-modal__content", style: { width: "100%", display: "flex", flexDirection: "column", gap: 12, alignItems: "center" }, children }), footer] }) });
|
|
464
233
|
};
|
|
465
234
|
var SignInWithEmailSection = () => {
|
|
466
235
|
const [email, setEmail] = useState("");
|
|
467
236
|
const [partialOidcToken, setPartialOidcToken] = useState("");
|
|
468
237
|
const [emailCode, setEmailCode] = useState("");
|
|
469
|
-
return
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
" "
|
|
484
|
-
] }),
|
|
485
|
-
/* @__PURE__ */ jsx("button", { disabled: !email, onClick: async () => {
|
|
486
|
-
const { OidcAuth } = await loadOidcAuth();
|
|
487
|
-
const { loginByEmail } = OidcAuth({
|
|
488
|
-
stage: "dev",
|
|
489
|
-
xClientId: clientIds.x ?? "",
|
|
490
|
-
googleClientId: clientIds.google ?? ""
|
|
491
|
-
});
|
|
492
|
-
const { partialOidcToken: partialOidcToken2 } = await loginByEmail(email);
|
|
493
|
-
setPartialOidcToken(partialOidcToken2);
|
|
494
|
-
}, children: "send code" }),
|
|
495
|
-
/* @__PURE__ */ jsx("button", { disabled: !partialOidcToken || !emailCode, onClick: async () => {
|
|
496
|
-
const oidcToken = `${partialOidcToken}${emailCode}`;
|
|
497
|
-
const { default: WalletAccount2 } = await loadWalletAccount();
|
|
498
|
-
await WalletAccount2.getInstance(oidcToken);
|
|
499
|
-
}, children: "sign in" })
|
|
500
|
-
] });
|
|
238
|
+
return jsxs("div", { style: { width: "100%", display: "flex", flexDirection: "column", gap: 24 }, children: [jsx("div", { style: { display: "flex", flexDirection: "column", gap: 16 }, children: jsx("input", { type: "email", placeholder: "Email", value: email, onChange: (e) => setEmail(e.target.value), style: { color: "black" } }) }), jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 16 }, children: [jsx("input", { type: "text", className: "absdk-predicate-signin-modal__email-code-input", style: { color: "black" }, value: emailCode, placeholder: "emailCode", onChange: (e) => setEmailCode(e.target.value) }), " "] }), jsx("button", { disabled: !email, onClick: async () => {
|
|
239
|
+
const { OidcAuth } = await loadOidcAuth();
|
|
240
|
+
const { loginByEmail } = OidcAuth({
|
|
241
|
+
stage: "dev",
|
|
242
|
+
xClientId: clientIds.x ?? "",
|
|
243
|
+
googleClientId: clientIds.google ?? ""
|
|
244
|
+
});
|
|
245
|
+
const { partialOidcToken: partialOidcToken2 } = await loginByEmail(email);
|
|
246
|
+
setPartialOidcToken(partialOidcToken2);
|
|
247
|
+
}, children: "send code" }), jsx("button", { disabled: !partialOidcToken || !emailCode, onClick: async () => {
|
|
248
|
+
const oidcToken = `${partialOidcToken}${emailCode}`;
|
|
249
|
+
const { default: WalletAccount2 } = await loadWalletAccount();
|
|
250
|
+
await WalletAccount2.getInstance(oidcToken);
|
|
251
|
+
}, children: "sign in" })] });
|
|
501
252
|
};
|
|
502
|
-
var SignInModalSocialSection = ({
|
|
503
|
-
id
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
type: "button",
|
|
523
|
-
disabled: isBusy,
|
|
524
|
-
onClick: () => onSocialClick(provider.id),
|
|
525
|
-
style: {
|
|
526
|
-
width: "100%",
|
|
527
|
-
height: 48,
|
|
528
|
-
borderRadius: radii.pill,
|
|
529
|
-
border: `1px solid ${colors.border}`,
|
|
530
|
-
background: "transparent",
|
|
531
|
-
display: "flex",
|
|
532
|
-
alignItems: "center",
|
|
533
|
-
justifyContent: "center",
|
|
534
|
-
gap: 12,
|
|
535
|
-
cursor: isBusy ? "wait" : "pointer",
|
|
536
|
-
padding: 12,
|
|
537
|
-
boxSizing: "border-box",
|
|
538
|
-
opacity: isLoading ? 0.6 : isBusy ? 0.8 : 1,
|
|
539
|
-
transition: "opacity .15s"
|
|
540
|
-
},
|
|
541
|
-
children: [
|
|
542
|
-
isLoading ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : provider.icon,
|
|
543
|
-
/* @__PURE__ */ jsx("span", { style: { fontSize: 16, fontWeight: 500, lineHeight: 1.4, color: colors.textPrimary, fontFamily: fonts.family }, children: isLoading ? "Signing in..." : provider.label })
|
|
544
|
-
]
|
|
545
|
-
},
|
|
546
|
-
provider.id
|
|
547
|
-
);
|
|
548
|
-
}) }),
|
|
549
|
-
typeof window !== "undefined" && window.location.href.indexOf("emailSignIn") !== -1 && /* @__PURE__ */ jsx(SignInWithEmailSection, {}),
|
|
550
|
-
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 20, width: "100%" }, children: [
|
|
551
|
-
/* @__PURE__ */ jsx("div", { style: { flex: 1, height: 1, background: colors.border } }),
|
|
552
|
-
/* @__PURE__ */ jsx("span", { style: { fontSize: 14, lineHeight: 1.4, color: colors.textPrimary, opacity: 0.4, whiteSpace: "nowrap" }, children: "Or connect a wallet" }),
|
|
553
|
-
/* @__PURE__ */ jsx("div", { style: { flex: 1, height: 1, background: colors.border } })
|
|
554
|
-
] })
|
|
555
|
-
]
|
|
556
|
-
}
|
|
557
|
-
);
|
|
558
|
-
var SignInModalWalletGrid = ({
|
|
559
|
-
wallets,
|
|
560
|
-
isBusy,
|
|
561
|
-
loadingWalletId,
|
|
562
|
-
expanded,
|
|
563
|
-
showExpandToggle,
|
|
564
|
-
onWalletClick,
|
|
565
|
-
onToggleExpanded
|
|
566
|
-
}) => {
|
|
253
|
+
var SignInModalSocialSection = ({ id, socialProviders, isBusy, loadingProvider, onSocialClick }) => jsxs("div", { style: { width: "100%", display: "flex", flexDirection: "column", gap: 24 }, id, className: "absdk-predicate-signin-modal__social", children: [jsx("div", { style: { display: "flex", flexDirection: "column", gap: 16 }, children: socialProviders.map((provider) => {
|
|
254
|
+
const isLoading = loadingProvider === provider.id;
|
|
255
|
+
return jsxs("button", { id: `absdk-predicate-signin-modal-social-provider-${provider.id}`, className: `absdk-predicate-signin-modal__social-button absdk-predicate-signin-modal__social-button--${provider.id}`, type: "button", disabled: isBusy, onClick: () => onSocialClick(provider.id), style: {
|
|
256
|
+
width: "100%",
|
|
257
|
+
height: 48,
|
|
258
|
+
borderRadius: radii.pill,
|
|
259
|
+
border: `1px solid ${colors.border}`,
|
|
260
|
+
background: "transparent",
|
|
261
|
+
display: "flex",
|
|
262
|
+
alignItems: "center",
|
|
263
|
+
justifyContent: "center",
|
|
264
|
+
gap: 12,
|
|
265
|
+
cursor: isBusy ? "wait" : "pointer",
|
|
266
|
+
padding: 12,
|
|
267
|
+
boxSizing: "border-box",
|
|
268
|
+
opacity: isLoading ? 0.6 : isBusy ? 0.8 : 1,
|
|
269
|
+
transition: "opacity .15s"
|
|
270
|
+
}, children: [isLoading ? jsx(SpinnerIcon, {}) : provider.icon, jsx("span", { style: { fontSize: 16, fontWeight: 500, lineHeight: 1.4, color: colors.textPrimary, fontFamily: fonts.family }, children: isLoading ? "Signing in..." : provider.label })] }, provider.id);
|
|
271
|
+
}) }), typeof window !== "undefined" && window.location.href.indexOf("emailSignIn") !== -1 && jsx(SignInWithEmailSection, {}), jsxs("div", { style: { display: "flex", alignItems: "center", gap: 20, width: "100%" }, children: [jsx("div", { style: { flex: 1, height: 1, background: colors.border } }), jsx("span", { style: { fontSize: 14, lineHeight: 1.4, color: colors.textPrimary, opacity: 0.4, whiteSpace: "nowrap" }, children: "Or connect a wallet" }), jsx("div", { style: { flex: 1, height: 1, background: colors.border } })] })] });
|
|
272
|
+
var SignInModalWalletGrid = ({ wallets, isBusy, loadingWalletId, expanded, showExpandToggle, onWalletClick, onToggleExpanded }) => {
|
|
567
273
|
const isMobile = useIsMobileViewport();
|
|
568
|
-
return
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
},
|
|
589
|
-
children: [
|
|
590
|
-
/* @__PURE__ */ jsx("div", { style: { width: 56, height: 56, display: "flex", alignItems: "center", justifyContent: "center" }, children: loadingWalletId === wallet.id ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : wallet.icon ?? /* @__PURE__ */ jsx(DefaultWalletIcon, { walletId: wallet.id, name: wallet.name }) }),
|
|
591
|
-
/* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", width: "100%" }, children: [
|
|
592
|
-
/* @__PURE__ */ jsx("span", { style: { fontSize: 12, fontWeight: 500, lineHeight: 1.4, color: colors.textPrimary, fontFamily: fonts.family, textAlign: "center", whiteSpace: "nowrap" }, children: wallet.name }),
|
|
593
|
-
loadingWalletId === wallet.id ? /* @__PURE__ */ jsx("span", { style: { fontSize: 10, lineHeight: 1.4, color: colors.textSecondary, fontFamily: fonts.family }, children: "Connecting..." }) : wallet.installed ? /* @__PURE__ */ jsx("span", { style: { fontSize: 10, lineHeight: 1.4, color: colors.accent, fontFamily: fonts.family }, children: "Installed" }) : wallet.installUrl ? /* @__PURE__ */ jsx(
|
|
594
|
-
"a",
|
|
595
|
-
{
|
|
596
|
-
href: wallet.installUrl,
|
|
597
|
-
target: "_blank",
|
|
598
|
-
rel: "noopener noreferrer",
|
|
599
|
-
onClick: (event) => event.stopPropagation(),
|
|
600
|
-
style: { fontSize: 10, lineHeight: 1.4, color: colors.textSecondary, fontFamily: fonts.family, textDecoration: "underline" },
|
|
601
|
-
children: "Install"
|
|
602
|
-
}
|
|
603
|
-
) : null
|
|
604
|
-
] })
|
|
605
|
-
]
|
|
606
|
-
},
|
|
607
|
-
wallet.id
|
|
608
|
-
)) }),
|
|
609
|
-
showExpandToggle && /* @__PURE__ */ jsx(
|
|
610
|
-
"button",
|
|
611
|
-
{
|
|
612
|
-
id: "absdk-predicate-signin-modal-expand-button",
|
|
613
|
-
className: "absdk-predicate-signin-modal__expand-button",
|
|
614
|
-
type: "button",
|
|
615
|
-
onClick: onToggleExpanded,
|
|
616
|
-
style: {
|
|
617
|
-
background: "transparent",
|
|
618
|
-
border: "none",
|
|
619
|
-
cursor: "pointer",
|
|
620
|
-
display: "flex",
|
|
621
|
-
alignItems: "center",
|
|
622
|
-
justifyContent: "center",
|
|
623
|
-
padding: 4
|
|
624
|
-
},
|
|
625
|
-
children: /* @__PURE__ */ jsx(ExpandIcon, { expanded })
|
|
626
|
-
}
|
|
627
|
-
)
|
|
628
|
-
] });
|
|
274
|
+
return jsxs("div", { className: "absdk-predicate-signin-modal__wallets", style: { width: "100%", display: "flex", flexDirection: "column", gap: 8, alignItems: "center", paddingTop: 12 }, children: [jsx("div", { className: "absdk-predicate-signin-modal__wallet-grid", style: { width: "100%", display: "flex", flexWrap: "wrap", gap: "14px 0" }, children: wallets.map((wallet) => jsxs("button", { id: `absdk-predicate-signin-modal-wallet-${wallet.id}`, className: `absdk-predicate-signin-modal__wallet-button absdk-predicate-signin-modal__wallet-button--${wallet.id}`, type: "button", disabled: isBusy, onClick: () => onWalletClick(wallet.id), style: {
|
|
275
|
+
width: isMobile ? "33.3333%" : "25%",
|
|
276
|
+
display: "flex",
|
|
277
|
+
flexDirection: "column",
|
|
278
|
+
alignItems: "center",
|
|
279
|
+
gap: 4,
|
|
280
|
+
background: "transparent",
|
|
281
|
+
border: "none",
|
|
282
|
+
cursor: isBusy ? "wait" : "pointer",
|
|
283
|
+
padding: 0,
|
|
284
|
+
opacity: loadingWalletId === wallet.id ? 0.7 : isBusy ? 0.85 : 1
|
|
285
|
+
}, children: [jsx("div", { style: { width: 56, height: 56, display: "flex", alignItems: "center", justifyContent: "center" }, children: loadingWalletId === wallet.id ? jsx(SpinnerIcon, {}) : wallet.icon ?? jsx(DefaultWalletIcon, { walletId: wallet.id, name: wallet.name }) }), jsxs("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", width: "100%" }, children: [jsx("span", { style: { fontSize: 12, fontWeight: 500, lineHeight: 1.4, color: colors.textPrimary, fontFamily: fonts.family, textAlign: "center", whiteSpace: "nowrap" }, children: wallet.name }), loadingWalletId === wallet.id ? jsx("span", { style: { fontSize: 10, lineHeight: 1.4, color: colors.textSecondary, fontFamily: fonts.family }, children: "Connecting..." }) : wallet.installed ? jsx("span", { style: { fontSize: 10, lineHeight: 1.4, color: colors.accent, fontFamily: fonts.family }, children: "Installed" }) : wallet.installUrl ? jsx("a", { href: wallet.installUrl, target: "_blank", rel: "noopener noreferrer", onClick: (event) => event.stopPropagation(), style: { fontSize: 10, lineHeight: 1.4, color: colors.textSecondary, fontFamily: fonts.family, textDecoration: "underline" }, children: "Install" }) : null] })] }, wallet.id)) }), showExpandToggle && jsx("button", { id: "absdk-predicate-signin-modal-expand-button", className: "absdk-predicate-signin-modal__expand-button", type: "button", onClick: onToggleExpanded, style: {
|
|
286
|
+
background: "transparent",
|
|
287
|
+
border: "none",
|
|
288
|
+
cursor: "pointer",
|
|
289
|
+
display: "flex",
|
|
290
|
+
alignItems: "center",
|
|
291
|
+
justifyContent: "center",
|
|
292
|
+
padding: 4
|
|
293
|
+
}, children: jsx(ExpandIcon, { expanded }) })] });
|
|
629
294
|
};
|
|
630
|
-
var SignInModalFooter = ({
|
|
631
|
-
|
|
632
|
-
termsOfUseUrl
|
|
633
|
-
}) => /* @__PURE__ */ jsx("div", { className: "absdk-predicate-signin-modal__footer", style: { padding: "12px 0", display: "flex", justifyContent: "center", width: "100%" }, children: /* @__PURE__ */ jsxs("p", { style: { margin: 0, fontSize: 14, lineHeight: 1.4, color: colors.textSecondary, fontFamily: fonts.family, textAlign: "center" }, children: [
|
|
634
|
-
"By continuing, I agree to the",
|
|
635
|
-
" ",
|
|
636
|
-
/* @__PURE__ */ jsx("a", { href: privacyPolicyUrl, style: { color: colors.textPrimary, textDecoration: "underline" }, target: "_blank", rel: "noopener noreferrer", children: "Privacy Policy" }),
|
|
637
|
-
" ",
|
|
638
|
-
"and",
|
|
639
|
-
" ",
|
|
640
|
-
/* @__PURE__ */ jsx("a", { href: termsOfUseUrl, style: { color: colors.textPrimary, textDecoration: "underline" }, target: "_blank", rel: "noopener noreferrer", children: "Terms of Use" })
|
|
641
|
-
] }) });
|
|
642
|
-
var useSignInModalController = ({
|
|
643
|
-
wallets,
|
|
644
|
-
initialVisibleCount,
|
|
645
|
-
onGoogleLogin: _onGoogleLogin,
|
|
646
|
-
onTwitterLogin: _onTwitterLogin,
|
|
647
|
-
onCubeSignerSession: _onCubeSignerSession,
|
|
648
|
-
onWalletConnected,
|
|
649
|
-
onSocialLogin: _onSocialLogin,
|
|
650
|
-
onWalletSelect
|
|
651
|
-
}) => {
|
|
295
|
+
var SignInModalFooter = ({ privacyPolicyUrl, termsOfUseUrl }) => jsx("div", { className: "absdk-predicate-signin-modal__footer", style: { padding: "12px 0", display: "flex", justifyContent: "center", width: "100%" }, children: jsxs("p", { style: { margin: 0, fontSize: 14, lineHeight: 1.4, color: colors.textSecondary, fontFamily: fonts.family, textAlign: "center" }, children: ["By continuing, I agree to the", " ", jsx("a", { href: privacyPolicyUrl, style: { color: colors.textPrimary, textDecoration: "underline" }, target: "_blank", rel: "noopener noreferrer", children: "Privacy Policy" }), " ", "and", " ", jsx("a", { href: termsOfUseUrl, style: { color: colors.textPrimary, textDecoration: "underline" }, target: "_blank", rel: "noopener noreferrer", children: "Terms of Use" })] }) });
|
|
296
|
+
var useSignInModalController = ({ wallets, initialVisibleCount, onGoogleLogin: _onGoogleLogin, onTwitterLogin: _onTwitterLogin, onCubeSignerSession: _onCubeSignerSession, onWalletConnected, onSocialLogin: _onSocialLogin, onWalletSelect }) => {
|
|
652
297
|
const [expanded, setExpanded] = useState(false);
|
|
653
298
|
const [loadingProvider, setLoadingProvider] = useState(null);
|
|
654
299
|
const [loadingWalletId, setLoadingWalletId] = useState(null);
|
|
655
300
|
const defaultWalletRegistry = useMemo(() => createDefaultInjectedWalletRegistry(), []);
|
|
656
|
-
const defaultWalletConnector = useMemo(
|
|
657
|
-
|
|
658
|
-
[defaultWalletRegistry]
|
|
659
|
-
);
|
|
660
|
-
const resolvedWallets = useMemo(
|
|
661
|
-
() => resolveWalletItems(wallets, defaultWalletRegistry),
|
|
662
|
-
[defaultWalletRegistry, wallets]
|
|
663
|
-
);
|
|
301
|
+
const defaultWalletConnector = useMemo(() => new WalletConnector(defaultWalletRegistry.map((item) => item.provider)), [defaultWalletRegistry]);
|
|
302
|
+
const resolvedWallets = useMemo(() => resolveWalletItems(wallets, defaultWalletRegistry), [defaultWalletRegistry, wallets]);
|
|
664
303
|
const showExpandToggle = resolvedWallets.length > initialVisibleCount;
|
|
665
304
|
const visibleWallets = expanded ? resolvedWallets : resolvedWallets.slice(0, initialVisibleCount);
|
|
666
305
|
const isBusy = !!loadingProvider || !!loadingWalletId;
|
|
@@ -691,10 +330,13 @@ var useSignInModalController = ({
|
|
|
691
330
|
};
|
|
692
331
|
const clearSocialLoading = () => setLoadingProvider(null);
|
|
693
332
|
const handleWalletClick = async (walletId) => {
|
|
694
|
-
if (isBusy)
|
|
333
|
+
if (isBusy)
|
|
334
|
+
return;
|
|
695
335
|
const targetWallet = resolvedWallets.find((wallet) => wallet.id === walletId);
|
|
696
|
-
if (!targetWallet)
|
|
697
|
-
|
|
336
|
+
if (!targetWallet)
|
|
337
|
+
return;
|
|
338
|
+
if (targetWallet.installed === false && targetWallet.installUrl)
|
|
339
|
+
return;
|
|
698
340
|
setLoadingWalletId(walletId);
|
|
699
341
|
try {
|
|
700
342
|
if (onWalletSelect) {
|
|
@@ -702,7 +344,8 @@ var useSignInModalController = ({
|
|
|
702
344
|
return;
|
|
703
345
|
}
|
|
704
346
|
const builtInWallet = defaultWalletRegistry.find((item) => item.id === walletId);
|
|
705
|
-
if (!builtInWallet || !builtInWallet.installed)
|
|
347
|
+
if (!builtInWallet || !builtInWallet.installed)
|
|
348
|
+
return;
|
|
706
349
|
const session = await defaultWalletConnector.connect(walletId);
|
|
707
350
|
onWalletConnected?.(session, walletId);
|
|
708
351
|
} catch (err) {
|
|
@@ -737,80 +380,45 @@ var Toast = ({ message, variant = "info", duration, onClose }) => {
|
|
|
737
380
|
return () => clearTimeout(t);
|
|
738
381
|
}
|
|
739
382
|
}, [duration, onClose]);
|
|
740
|
-
return
|
|
741
|
-
"
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
},
|
|
775
|
-
children: [
|
|
776
|
-
/* @__PURE__ */ jsx("span", { className: "absdk-predicate-toast__message", style: { flex: 1 }, children: message }),
|
|
777
|
-
onClose && /* @__PURE__ */ jsx(
|
|
778
|
-
"button",
|
|
779
|
-
{
|
|
780
|
-
className: "absdk-predicate-toast__dismiss",
|
|
781
|
-
type: "button",
|
|
782
|
-
"aria-label": "Dismiss",
|
|
783
|
-
onClick: onClose,
|
|
784
|
-
style: {
|
|
785
|
-
padding: 4,
|
|
786
|
-
margin: -4,
|
|
787
|
-
border: "none",
|
|
788
|
-
background: "transparent",
|
|
789
|
-
color: colors.textSecondary,
|
|
790
|
-
cursor: "pointer",
|
|
791
|
-
borderRadius: 4,
|
|
792
|
-
lineHeight: 1
|
|
793
|
-
},
|
|
794
|
-
children: /* @__PURE__ */ jsx("svg", { className: "absdk-predicate-toast__dismiss-icon", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: /* @__PURE__ */ jsx(
|
|
795
|
-
"path",
|
|
796
|
-
{
|
|
797
|
-
className: "absdk-predicate-toast__dismiss-icon-path",
|
|
798
|
-
d: "M3.5 3.5L10.5 10.5M10.5 3.5L3.5 10.5",
|
|
799
|
-
stroke: "currentColor",
|
|
800
|
-
strokeWidth: "1.5",
|
|
801
|
-
strokeLinecap: "round"
|
|
802
|
-
}
|
|
803
|
-
) })
|
|
804
|
-
}
|
|
805
|
-
)
|
|
806
|
-
]
|
|
807
|
-
}
|
|
808
|
-
)
|
|
809
|
-
}
|
|
810
|
-
);
|
|
383
|
+
return jsx("div", { className: "absdk-predicate-toast", style: {
|
|
384
|
+
position: "fixed",
|
|
385
|
+
top: 0,
|
|
386
|
+
left: 0,
|
|
387
|
+
right: 0,
|
|
388
|
+
display: "flex",
|
|
389
|
+
justifyContent: "center",
|
|
390
|
+
paddingTop: 16,
|
|
391
|
+
zIndex: 1e4,
|
|
392
|
+
pointerEvents: "none"
|
|
393
|
+
}, children: jsxs("div", { className: `absdk-predicate-toast__content absdk-predicate-toast__content--${variant}`, role: "alert", style: {
|
|
394
|
+
pointerEvents: "auto",
|
|
395
|
+
display: "flex",
|
|
396
|
+
alignItems: "center",
|
|
397
|
+
gap: 10,
|
|
398
|
+
padding: "12px 16px",
|
|
399
|
+
borderRadius: radii.card,
|
|
400
|
+
background: style.bg,
|
|
401
|
+
border: `1px solid ${style.border}`,
|
|
402
|
+
color: colors.textPrimary,
|
|
403
|
+
fontSize: 14,
|
|
404
|
+
lineHeight: 1.4,
|
|
405
|
+
maxWidth: 360,
|
|
406
|
+
boxSizing: "border-box"
|
|
407
|
+
}, children: [jsx("span", { className: "absdk-predicate-toast__message", style: { flex: 1 }, children: message }), onClose && jsx("button", { className: "absdk-predicate-toast__dismiss", type: "button", "aria-label": "Dismiss", onClick: onClose, style: {
|
|
408
|
+
padding: 4,
|
|
409
|
+
margin: -4,
|
|
410
|
+
border: "none",
|
|
411
|
+
background: "transparent",
|
|
412
|
+
color: colors.textSecondary,
|
|
413
|
+
cursor: "pointer",
|
|
414
|
+
borderRadius: 4,
|
|
415
|
+
lineHeight: 1
|
|
416
|
+
}, children: jsx("svg", { className: "absdk-predicate-toast__dismiss-icon", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: jsx("path", { className: "absdk-predicate-toast__dismiss-icon-path", d: "M3.5 3.5L10.5 10.5M10.5 3.5L3.5 10.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) }) })] }) });
|
|
811
417
|
};
|
|
418
|
+
|
|
419
|
+
// ../sign_in_sdk/dist/ui/SignInModal.js
|
|
812
420
|
async function loadWalletAccount2() {
|
|
813
|
-
return import('./account-
|
|
421
|
+
return import('./account-6PGNCFOX.js');
|
|
814
422
|
}
|
|
815
423
|
var SOCIAL_ADAPTER_ID = "cubist";
|
|
816
424
|
function persistSocialAdapterId() {
|
|
@@ -820,42 +428,14 @@ function persistSocialAdapterId() {
|
|
|
820
428
|
} catch {
|
|
821
429
|
}
|
|
822
430
|
}
|
|
823
|
-
var SignInModal = ({
|
|
824
|
-
title = "Welcome to PredicateMarket",
|
|
825
|
-
socialProviders,
|
|
826
|
-
wallets,
|
|
827
|
-
initialVisibleCount,
|
|
828
|
-
privacyPolicyUrl = "#",
|
|
829
|
-
termsOfUseUrl = "#",
|
|
830
|
-
onGoogleLogin,
|
|
831
|
-
onTwitterLogin,
|
|
832
|
-
onCubeSignerSession,
|
|
833
|
-
onWalletConnected,
|
|
834
|
-
onSocialLogin,
|
|
835
|
-
onWalletSelect,
|
|
836
|
-
onDismiss,
|
|
837
|
-
onSuccess
|
|
838
|
-
}) => {
|
|
431
|
+
var SignInModal = ({ title = "Welcome to PredicateMarket", socialProviders, wallets, initialVisibleCount, privacyPolicyUrl = "#", termsOfUseUrl = "#", onGoogleLogin, onTwitterLogin, onCubeSignerSession, onWalletConnected, onSocialLogin, onWalletSelect, onDismiss, onSuccess }) => {
|
|
839
432
|
const sdkConfig = getSDKConfig();
|
|
840
|
-
const effectiveSocialProviders = resolveSocialProviders(
|
|
841
|
-
socialProviders ?? sdkConfig.signIn?.socialProviders
|
|
842
|
-
);
|
|
433
|
+
const effectiveSocialProviders = resolveSocialProviders(socialProviders ?? sdkConfig.signIn?.socialProviders);
|
|
843
434
|
const effectiveWallets = wallets ?? sdkConfig.signIn?.wallets;
|
|
844
435
|
const effectiveInitialVisibleCount = initialVisibleCount ?? sdkConfig.signIn?.initialVisibleCount ?? 5;
|
|
845
436
|
const [toastError, setToastError] = useState(null);
|
|
846
437
|
const [socialLoadingProvider, setSocialLoadingProvider] = useState(null);
|
|
847
|
-
const {
|
|
848
|
-
expanded,
|
|
849
|
-
loadingProvider,
|
|
850
|
-
loadingWalletId,
|
|
851
|
-
visibleWallets,
|
|
852
|
-
showExpandToggle,
|
|
853
|
-
isBusy,
|
|
854
|
-
handleSocialClick,
|
|
855
|
-
handleWalletClick,
|
|
856
|
-
clearSocialLoading,
|
|
857
|
-
toggleExpanded
|
|
858
|
-
} = useSignInModalController({
|
|
438
|
+
const { expanded, loadingProvider, loadingWalletId, visibleWallets, showExpandToggle, isBusy, handleSocialClick, handleWalletClick, clearSocialLoading, toggleExpanded } = useSignInModalController({
|
|
859
439
|
wallets: effectiveWallets,
|
|
860
440
|
initialVisibleCount: effectiveInitialVisibleCount,
|
|
861
441
|
onGoogleLogin,
|
|
@@ -865,100 +445,54 @@ var SignInModal = ({
|
|
|
865
445
|
onSocialLogin,
|
|
866
446
|
onWalletSelect
|
|
867
447
|
});
|
|
868
|
-
return
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
)
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
if (!address) {
|
|
915
|
-
throw new Error("Social wallet did not return an account");
|
|
916
|
-
}
|
|
917
|
-
const chainId = await walletAccount.eth_chainId();
|
|
918
|
-
const chain = getSupportedChainFromEvmChainId(chainId);
|
|
919
|
-
const authSource = providerId === "x" ? "twitter" : providerId;
|
|
920
|
-
const capabilityPolicy = sdkConfig.cubeSigner?.defaultSessionPolicy ? createSessionCapabilityPolicy(sdkConfig.cubeSigner.defaultSessionPolicy) : void 0;
|
|
921
|
-
const session = {
|
|
922
|
-
address,
|
|
923
|
-
chain,
|
|
924
|
-
provider: walletAccount,
|
|
925
|
-
walletType: "social",
|
|
926
|
-
authSource,
|
|
927
|
-
sessionId: `${authSource}:${address.toLowerCase()}`,
|
|
928
|
-
expiresAt: capabilityPolicy?.expiresAt,
|
|
929
|
-
capabilities: CUBIST_CAPABILITIES,
|
|
930
|
-
sessionData: cubeSignerSession.sessionData,
|
|
931
|
-
chainContext: createChainContext(chain),
|
|
932
|
-
capabilityPolicy
|
|
933
|
-
};
|
|
934
|
-
persistSocialAdapterId();
|
|
935
|
-
sessionStore.setSession(session);
|
|
936
|
-
onSuccess?.(session);
|
|
937
|
-
} catch (error) {
|
|
938
|
-
setToastError(error?.message ?? "Failed to get wallet account, please try again");
|
|
939
|
-
return;
|
|
940
|
-
} finally {
|
|
941
|
-
setSocialLoadingProvider(null);
|
|
942
|
-
clearSocialLoading();
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
|
-
}
|
|
946
|
-
),
|
|
947
|
-
/* @__PURE__ */ jsx(
|
|
948
|
-
SignInModalWalletGrid,
|
|
949
|
-
{
|
|
950
|
-
wallets: visibleWallets,
|
|
951
|
-
isBusy,
|
|
952
|
-
loadingWalletId,
|
|
953
|
-
expanded,
|
|
954
|
-
showExpandToggle,
|
|
955
|
-
onWalletClick: handleWalletClick,
|
|
956
|
-
onToggleExpanded: toggleExpanded
|
|
957
|
-
}
|
|
958
|
-
)
|
|
959
|
-
]
|
|
448
|
+
return jsxs(SignInModalFrame, { id: "absdk-predicate-signin-modal-frame", title, onClose: onDismiss, footer: jsx(SignInModalFooter, { privacyPolicyUrl, termsOfUseUrl }), children: [toastError && jsx(Toast, { message: toastError, variant: "error", duration: 5e3, onClose: () => setToastError(null) }), jsx(SignInModalSocialSection, { id: "absdk-predicate-signin-modal-social", socialProviders: effectiveSocialProviders, isBusy: isBusy || !!socialLoadingProvider, loadingProvider: loadingProvider ?? socialLoadingProvider, onSocialClick: async (providerId) => {
|
|
449
|
+
setSocialLoadingProvider(providerId);
|
|
450
|
+
sessionStore.clearSession();
|
|
451
|
+
try {
|
|
452
|
+
const { default: WalletAccount2 } = await loadWalletAccount2();
|
|
453
|
+
WalletAccount2.clearInstance();
|
|
454
|
+
const oidcToken = await handleSocialClick(providerId);
|
|
455
|
+
if (!oidcToken) {
|
|
456
|
+
setToastError("Social login failed, please try again");
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
459
|
+
const walletAccount = await WalletAccount2.getInstance(oidcToken);
|
|
460
|
+
const cubeSignerSession = walletAccount.getCubeSignerSession();
|
|
461
|
+
onCubeSignerSession?.(cubeSignerSession);
|
|
462
|
+
cache_exports.set("oidcToken", oidcToken, false);
|
|
463
|
+
const [address] = await walletAccount.eth_accounts();
|
|
464
|
+
if (!address) {
|
|
465
|
+
throw new Error("Social wallet did not return an account");
|
|
466
|
+
}
|
|
467
|
+
const chainId = await walletAccount.eth_chainId();
|
|
468
|
+
const chain = getSupportedChainFromEvmChainId(chainId);
|
|
469
|
+
const authSource = providerId === "x" ? "twitter" : providerId;
|
|
470
|
+
const capabilityPolicy = sdkConfig.cubeSigner?.defaultSessionPolicy ? createSessionCapabilityPolicy(sdkConfig.cubeSigner.defaultSessionPolicy) : void 0;
|
|
471
|
+
const session = {
|
|
472
|
+
address,
|
|
473
|
+
chain,
|
|
474
|
+
provider: walletAccount,
|
|
475
|
+
walletType: "social",
|
|
476
|
+
authSource,
|
|
477
|
+
sessionId: `${authSource}:${address.toLowerCase()}`,
|
|
478
|
+
expiresAt: capabilityPolicy?.expiresAt,
|
|
479
|
+
capabilities: CUBIST_CAPABILITIES,
|
|
480
|
+
sessionData: cubeSignerSession.sessionData,
|
|
481
|
+
chainContext: createChainContext(chain),
|
|
482
|
+
capabilityPolicy,
|
|
483
|
+
userInfo: cubeSignerSession.userInfo
|
|
484
|
+
};
|
|
485
|
+
persistSocialAdapterId();
|
|
486
|
+
sessionStore.setSession(session);
|
|
487
|
+
onSuccess?.(session);
|
|
488
|
+
} catch (error) {
|
|
489
|
+
setToastError(error?.message ?? "Failed to get wallet account, please try again");
|
|
490
|
+
return;
|
|
491
|
+
} finally {
|
|
492
|
+
setSocialLoadingProvider(null);
|
|
493
|
+
clearSocialLoading();
|
|
960
494
|
}
|
|
961
|
-
);
|
|
495
|
+
} }), jsx(SignInModalWalletGrid, { wallets: visibleWallets, isBusy, loadingWalletId, expanded, showExpandToggle, onWalletClick: handleWalletClick, onToggleExpanded: toggleExpanded })] });
|
|
962
496
|
};
|
|
963
497
|
|
|
964
498
|
// src/ui/theme.ts
|
|
@@ -1335,7 +869,7 @@ var DropdownField = ({
|
|
|
1335
869
|
placeholder,
|
|
1336
870
|
value,
|
|
1337
871
|
icon,
|
|
1338
|
-
focused,
|
|
872
|
+
focused: _focused,
|
|
1339
873
|
options,
|
|
1340
874
|
onSelect,
|
|
1341
875
|
wrapperClassName,
|
|
@@ -2713,9 +2247,12 @@ function chainsToTokenOptions2(chains) {
|
|
|
2713
2247
|
function chainsToChainOptionsForToken2(chains, tokenSymbol) {
|
|
2714
2248
|
return chains.filter((c) => c.tokens.some((t) => t.symbol === tokenSymbol)).map((c) => ({ id: c.chain_id, label: c.network, subtitle: c.chain_id }));
|
|
2715
2249
|
}
|
|
2716
|
-
function
|
|
2250
|
+
function getTokenMetaForChain(chains, chainId, tokenSymbol) {
|
|
2717
2251
|
const chain = chains.find((c) => c.chain_id === chainId);
|
|
2718
|
-
return chain?.tokens.find((t) => t.symbol === tokenSymbol)
|
|
2252
|
+
return chain?.tokens.find((t) => t.symbol === tokenSymbol);
|
|
2253
|
+
}
|
|
2254
|
+
function getTokenAddressForChain2(chains, chainId, tokenSymbol) {
|
|
2255
|
+
return getTokenMetaForChain(chains, chainId, tokenSymbol)?.address;
|
|
2719
2256
|
}
|
|
2720
2257
|
function parseBalanceNumber(balance) {
|
|
2721
2258
|
const match = balance.trim().match(/^(\d*\.?\d*)/);
|
|
@@ -2733,17 +2270,45 @@ function formatBalanceTo2Decimals(balance) {
|
|
|
2733
2270
|
const formatted = n.toFixed(2);
|
|
2734
2271
|
return formatted + suffix;
|
|
2735
2272
|
}
|
|
2736
|
-
function
|
|
2737
|
-
const
|
|
2273
|
+
function formatBaseUnitAmount(value, decimals = 18) {
|
|
2274
|
+
const trimmed = (value || "0").trim();
|
|
2275
|
+
if (!/^\d+$/.test(trimmed)) return value;
|
|
2276
|
+
const s = trimmed.replace(/^0+/, "") || "0";
|
|
2738
2277
|
if (s === "0") return "0";
|
|
2739
|
-
|
|
2740
|
-
const
|
|
2741
|
-
const
|
|
2742
|
-
const
|
|
2743
|
-
const
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2278
|
+
if (decimals <= 0) return s;
|
|
2279
|
+
const padded = s.padStart(decimals + 1, "0");
|
|
2280
|
+
const splitIndex = padded.length - decimals;
|
|
2281
|
+
const intPart = padded.slice(0, splitIndex).replace(/^0+(?=\d)/, "") || "0";
|
|
2282
|
+
const decPart = padded.slice(splitIndex).replace(/0+$/, "");
|
|
2283
|
+
const visibleDecimals = decPart.slice(0, 6).replace(/0+$/, "");
|
|
2284
|
+
return visibleDecimals ? `${intPart}.${visibleDecimals}` : intPart;
|
|
2285
|
+
}
|
|
2286
|
+
function formatDecimalAmount(value, maxDecimals = 6) {
|
|
2287
|
+
if (!Number.isFinite(value)) return "";
|
|
2288
|
+
if (value === 0) return "0";
|
|
2289
|
+
return value.toFixed(maxDecimals).replace(/\.?0+$/, "");
|
|
2290
|
+
}
|
|
2291
|
+
function multiplyDecimalStringsToBaseUnits(left, right, decimals) {
|
|
2292
|
+
const normalize = (input) => {
|
|
2293
|
+
const trimmed = input.trim();
|
|
2294
|
+
const match = trimmed.match(/^(\d+)(?:\.(\d+))?$/);
|
|
2295
|
+
if (!match) return null;
|
|
2296
|
+
const intPart = match[1] ?? "0";
|
|
2297
|
+
const fracPart = match[2] ?? "";
|
|
2298
|
+
return {
|
|
2299
|
+
digits: BigInt(`${intPart}${fracPart}`),
|
|
2300
|
+
scale: fracPart.length
|
|
2301
|
+
};
|
|
2302
|
+
};
|
|
2303
|
+
const a = normalize(left);
|
|
2304
|
+
const b = normalize(right);
|
|
2305
|
+
if (!a || !b || decimals < 0) return void 0;
|
|
2306
|
+
const product = a.digits * b.digits;
|
|
2307
|
+
const totalScale = a.scale + b.scale;
|
|
2308
|
+
if (decimals >= totalScale) {
|
|
2309
|
+
return (product * 10n ** BigInt(decimals - totalScale)).toString();
|
|
2310
|
+
}
|
|
2311
|
+
return (product / 10n ** BigInt(totalScale - decimals)).toString();
|
|
2747
2312
|
}
|
|
2748
2313
|
function findScrollableAncestor(node) {
|
|
2749
2314
|
let current = node?.parentElement ?? null;
|
|
@@ -2811,6 +2376,14 @@ var WithdrawModal = ({
|
|
|
2811
2376
|
if (!apiChains?.length || !token || !chain) return void 0;
|
|
2812
2377
|
return getTokenAddressForChain2(apiChains, chain, token);
|
|
2813
2378
|
}, [apiChains, token, chain]);
|
|
2379
|
+
const destinationTokenDecimals = useMemo(() => {
|
|
2380
|
+
if (!token) return apiQuote?.token_decimals ?? 18;
|
|
2381
|
+
const targetChainId = withdrawOrder?.target_chain_id ?? chain;
|
|
2382
|
+
if (apiChains?.length && targetChainId) {
|
|
2383
|
+
return getTokenMetaForChain(apiChains, targetChainId, token)?.decimals ?? apiQuote?.token_decimals ?? 18;
|
|
2384
|
+
}
|
|
2385
|
+
return apiQuote?.token_decimals ?? 18;
|
|
2386
|
+
}, [apiChains, apiQuote?.token_decimals, chain, token, withdrawOrder?.target_chain_id]);
|
|
2814
2387
|
const [directActive, setDirectActive] = useState(false);
|
|
2815
2388
|
useEffect(() => {
|
|
2816
2389
|
setDirectActive(withdrawMode === "direct" && Boolean(withdrawDirectResult));
|
|
@@ -2849,7 +2422,7 @@ var WithdrawModal = ({
|
|
|
2849
2422
|
direction: "withdraw",
|
|
2850
2423
|
chain_id: chain,
|
|
2851
2424
|
token_address: tokenAddress,
|
|
2852
|
-
|
|
2425
|
+
token_amount: amountWei
|
|
2853
2426
|
}).then((q) => setApiQuote(q ?? null)).catch(() => {
|
|
2854
2427
|
setApiQuote({
|
|
2855
2428
|
token_address: tokenAddress,
|
|
@@ -2858,6 +2431,7 @@ var WithdrawModal = ({
|
|
|
2858
2431
|
rate: "1",
|
|
2859
2432
|
chain_id: Number(chain) || 56,
|
|
2860
2433
|
token_amount: amountWei,
|
|
2434
|
+
dst_token_amount: amountWei,
|
|
2861
2435
|
expires_at: new Date(Date.now() + 6e4).toISOString()
|
|
2862
2436
|
});
|
|
2863
2437
|
}).finally(() => setLoadingQuote(false));
|
|
@@ -2900,6 +2474,15 @@ var WithdrawModal = ({
|
|
|
2900
2474
|
if (!orderId && directActive) {
|
|
2901
2475
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
2902
2476
|
const inferredAmountWei = (() => {
|
|
2477
|
+
if (apiQuote?.dst_token_amount) return apiQuote.dst_token_amount;
|
|
2478
|
+
if (amount && apiQuote?.rate) {
|
|
2479
|
+
const quotedAmountWei = multiplyDecimalStringsToBaseUnits(
|
|
2480
|
+
amount,
|
|
2481
|
+
apiQuote.rate,
|
|
2482
|
+
apiQuote.token_decimals ?? 18
|
|
2483
|
+
);
|
|
2484
|
+
if (quotedAmountWei) return quotedAmountWei;
|
|
2485
|
+
}
|
|
2903
2486
|
if (withdrawDirectResult?.dst_token_amount) return withdrawDirectResult.dst_token_amount;
|
|
2904
2487
|
const n = Number(amount || "0");
|
|
2905
2488
|
return String(n > 0 ? BigInt(Math.floor(n * 1e18)) : 0n);
|
|
@@ -2923,7 +2506,7 @@ var WithdrawModal = ({
|
|
|
2923
2506
|
return;
|
|
2924
2507
|
}
|
|
2925
2508
|
setWithdrawOrder(null);
|
|
2926
|
-
}, [orderId, directActive, withdrawDirectResult, amount, feeDisplay, chain, address, txHash, fundingChainId, onShowToast, mockWithdrawOrderState]);
|
|
2509
|
+
}, [orderId, directActive, withdrawDirectResult, amount, apiQuote, feeDisplay, chain, address, txHash, fundingChainId, onShowToast, mockWithdrawOrderState]);
|
|
2927
2510
|
const completedKeyRef = useRef(null);
|
|
2928
2511
|
const successToastKeyRef = useRef(null);
|
|
2929
2512
|
useEffect(() => {
|
|
@@ -2952,11 +2535,33 @@ var WithdrawModal = ({
|
|
|
2952
2535
|
if (!Number.isNaN(n)) return n.toFixed(2);
|
|
2953
2536
|
return receiveAmountProp;
|
|
2954
2537
|
}
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
const formatted =
|
|
2958
|
-
return `\u2248 ${formatted}
|
|
2538
|
+
const rawAmount = apiQuote?.dst_token_amount ?? apiQuote?.token_amount;
|
|
2539
|
+
if (!rawAmount || !apiQuote?.token_symbol) return void 0;
|
|
2540
|
+
const formatted = formatBaseUnitAmount(rawAmount, apiQuote.token_decimals ?? 18);
|
|
2541
|
+
return `\u2248 ${formatted} ${apiQuote.token_symbol}`;
|
|
2959
2542
|
}, [receiveAmountProp, apiQuote]);
|
|
2543
|
+
const displayReceiveAmount = useMemo(() => {
|
|
2544
|
+
if (receiveAmount) return receiveAmount;
|
|
2545
|
+
if (!amount || !apiQuote?.token_symbol || !apiQuote?.rate) return void 0;
|
|
2546
|
+
const fundingAmount = Number(amount);
|
|
2547
|
+
const rate = Number(apiQuote.rate);
|
|
2548
|
+
if (!Number.isFinite(fundingAmount) || fundingAmount <= 0 || !Number.isFinite(rate) || rate <= 0) {
|
|
2549
|
+
return void 0;
|
|
2550
|
+
}
|
|
2551
|
+
return `\u2248 ${formatDecimalAmount(fundingAmount * rate)} ${apiQuote.token_symbol}`;
|
|
2552
|
+
}, [amount, apiQuote?.rate, apiQuote?.token_symbol, receiveAmount]);
|
|
2553
|
+
const successAmountDisplay = useMemo(() => {
|
|
2554
|
+
if (displayReceiveAmount) {
|
|
2555
|
+
return displayReceiveAmount.replace(/^≈\s*/, "");
|
|
2556
|
+
}
|
|
2557
|
+
if (!withdrawOrder?.dst_token_amount) return void 0;
|
|
2558
|
+
return `${formatBaseUnitAmount(withdrawOrder.dst_token_amount, destinationTokenDecimals)} ${tokenSymbol}`;
|
|
2559
|
+
}, [
|
|
2560
|
+
destinationTokenDecimals,
|
|
2561
|
+
displayReceiveAmount,
|
|
2562
|
+
tokenSymbol,
|
|
2563
|
+
withdrawOrder?.dst_token_amount
|
|
2564
|
+
]);
|
|
2960
2565
|
const quoteExpired = useMemo(() => {
|
|
2961
2566
|
if (!apiQuote?.expires_at) return false;
|
|
2962
2567
|
try {
|
|
@@ -2976,7 +2581,7 @@ var WithdrawModal = ({
|
|
|
2976
2581
|
direction: "withdraw",
|
|
2977
2582
|
chain_id: chain,
|
|
2978
2583
|
token_address: tokenAddress,
|
|
2979
|
-
|
|
2584
|
+
token_amount: amountWei
|
|
2980
2585
|
}).then((q) => setApiQuote(q ?? null)).catch(() => {
|
|
2981
2586
|
setApiQuote({
|
|
2982
2587
|
token_address: tokenAddress,
|
|
@@ -2985,6 +2590,7 @@ var WithdrawModal = ({
|
|
|
2985
2590
|
rate: "1",
|
|
2986
2591
|
chain_id: Number(chain) || 56,
|
|
2987
2592
|
token_amount: amountWei,
|
|
2593
|
+
dst_token_amount: amountWei,
|
|
2988
2594
|
expires_at: new Date(Date.now() + 6e4).toISOString()
|
|
2989
2595
|
});
|
|
2990
2596
|
}).finally(() => setLoadingQuote(false));
|
|
@@ -3235,11 +2841,7 @@ var WithdrawModal = ({
|
|
|
3235
2841
|
children: [
|
|
3236
2842
|
/* @__PURE__ */ jsxs("div", { className: "absdk-predicate-withdraw-modal__summary-row absdk-predicate-withdraw-modal__summary-row--amount", style: { display: "flex", justifyContent: "space-between", alignItems: "center", padding: isMobile ? "6px 0" : "8px 0", height: isMobile ? 29 : 36 }, children: [
|
|
3237
2843
|
/* @__PURE__ */ jsx("span", { className: "absdk-predicate-withdraw-modal__summary-label", style: { fontSize: 14, lineHeight: 1.4, color: colors2.textSecondary }, children: "Amount" }),
|
|
3238
|
-
/* @__PURE__ */
|
|
3239
|
-
weiToEtherDisplay(withdrawOrder.dst_token_amount),
|
|
3240
|
-
" ",
|
|
3241
|
-
tokenSymbol
|
|
3242
|
-
] })
|
|
2844
|
+
/* @__PURE__ */ jsx("span", { className: "absdk-predicate-withdraw-modal__summary-value", style: { fontSize: 14, lineHeight: 1.4, color: colors2.textPrimary }, children: successAmountDisplay ?? "\u2014" })
|
|
3243
2845
|
] }),
|
|
3244
2846
|
/* @__PURE__ */ jsxs("div", { className: "absdk-predicate-withdraw-modal__summary-row absdk-predicate-withdraw-modal__summary-row--fee", style: { display: "flex", justifyContent: "space-between", alignItems: "center", padding: isMobile ? "6px 0" : "8px 0", height: isMobile ? 29 : 36 }, children: [
|
|
3245
2847
|
/* @__PURE__ */ jsx("span", { className: "absdk-predicate-withdraw-modal__summary-label", style: { fontSize: 14, lineHeight: 1.4, color: colors2.textSecondary }, children: "Fee" }),
|
|
@@ -3594,10 +3196,10 @@ var WithdrawModal = ({
|
|
|
3594
3196
|
]
|
|
3595
3197
|
}
|
|
3596
3198
|
),
|
|
3597
|
-
!orderSucceeded && /* @__PURE__ */ jsxs("span", { className: "absdk-predicate-withdraw-modal__receive-amount", style: { fontSize: 14, lineHeight: 1.4, color: colors2.textPrimary, opacity: !trackingWithdraw &&
|
|
3199
|
+
!orderSucceeded && /* @__PURE__ */ jsxs("span", { className: "absdk-predicate-withdraw-modal__receive-amount", style: { fontSize: 14, lineHeight: 1.4, color: colors2.textPrimary, opacity: !trackingWithdraw && displayReceiveAmount ? 1 : 0 }, children: [
|
|
3598
3200
|
/* @__PURE__ */ jsx("span", { className: "absdk-predicate-withdraw-modal__receive-amount-label", children: "You will receive :" }),
|
|
3599
3201
|
" ",
|
|
3600
|
-
/* @__PURE__ */ jsx("span", { className: "absdk-predicate-withdraw-modal__receive-amount-value", children:
|
|
3202
|
+
/* @__PURE__ */ jsx("span", { className: "absdk-predicate-withdraw-modal__receive-amount-value", children: displayReceiveAmount })
|
|
3601
3203
|
] })
|
|
3602
3204
|
] }) })
|
|
3603
3205
|
]
|
|
@@ -3748,7 +3350,7 @@ var SubmitButton = ({ id, className, disabled, status, onClick }) => {
|
|
|
3748
3350
|
|
|
3749
3351
|
// src/react.ts
|
|
3750
3352
|
async function loadWalletAccountModule() {
|
|
3751
|
-
return import('./account-
|
|
3353
|
+
return import('./account-6PGNCFOX.js');
|
|
3752
3354
|
}
|
|
3753
3355
|
var WalletAccount = {
|
|
3754
3356
|
async getInstance(oidcToken) {
|