@swype-org/react-sdk 0.1.208 → 0.1.209
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/index.cjs +96 -96
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +31 -31
- package/dist/index.d.ts +31 -31
- package/dist/index.js +89 -89
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -75,7 +75,7 @@ var lightTheme = {
|
|
|
75
75
|
function getTheme(mode) {
|
|
76
76
|
return mode === "dark" ? darkTheme : lightTheme;
|
|
77
77
|
}
|
|
78
|
-
var
|
|
78
|
+
var BLINK_PRIVY_APP_ID = "cmlil87uv004n0ck0blwumwek";
|
|
79
79
|
var wagmiConfig = wagmi.createConfig({
|
|
80
80
|
chains: [chains.mainnet, chains.arbitrum, chains.base, chains.polygon, chains.bsc],
|
|
81
81
|
connectors: [connectors.injected({ shimDisconnect: true, unstable_shimAsyncInject: 2e3 })],
|
|
@@ -87,8 +87,8 @@ var wagmiConfig = wagmi.createConfig({
|
|
|
87
87
|
[chains.bsc.id]: wagmi.http()
|
|
88
88
|
}
|
|
89
89
|
});
|
|
90
|
-
var
|
|
91
|
-
function
|
|
90
|
+
var BlinkContext = react.createContext(null);
|
|
91
|
+
function BlinkProvider({
|
|
92
92
|
apiBaseUrl,
|
|
93
93
|
theme = "dark",
|
|
94
94
|
children
|
|
@@ -114,7 +114,7 @@ function SwypeProvider({
|
|
|
114
114
|
return /* @__PURE__ */ jsxRuntime.jsx(reactQuery.QueryClientProvider, { client: queryClientRef.current, children: /* @__PURE__ */ jsxRuntime.jsx(wagmi.WagmiProvider, { config: wagmiConfig, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
115
115
|
reactAuth.PrivyProvider,
|
|
116
116
|
{
|
|
117
|
-
appId:
|
|
117
|
+
appId: BLINK_PRIVY_APP_ID,
|
|
118
118
|
config: {
|
|
119
119
|
appearance: {
|
|
120
120
|
theme,
|
|
@@ -127,25 +127,25 @@ function SwypeProvider({
|
|
|
127
127
|
showWalletUIs: false
|
|
128
128
|
}
|
|
129
129
|
},
|
|
130
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
130
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(BlinkContext.Provider, { value, children })
|
|
131
131
|
}
|
|
132
132
|
) }) });
|
|
133
133
|
}
|
|
134
|
-
function
|
|
135
|
-
const ctx = react.useContext(
|
|
134
|
+
function useBlinkConfig() {
|
|
135
|
+
const ctx = react.useContext(BlinkContext);
|
|
136
136
|
if (!ctx) {
|
|
137
|
-
throw new Error("
|
|
137
|
+
throw new Error("useBlinkConfig must be used within a <BlinkProvider>");
|
|
138
138
|
}
|
|
139
139
|
return ctx;
|
|
140
140
|
}
|
|
141
|
-
function
|
|
142
|
-
return react.useContext(
|
|
141
|
+
function useOptionalBlinkConfig() {
|
|
142
|
+
return react.useContext(BlinkContext);
|
|
143
143
|
}
|
|
144
|
-
function
|
|
145
|
-
const ctx = react.useContext(
|
|
144
|
+
function useBlinkDepositAmount() {
|
|
145
|
+
const ctx = react.useContext(BlinkContext);
|
|
146
146
|
if (!ctx) {
|
|
147
147
|
throw new Error(
|
|
148
|
-
"
|
|
148
|
+
"useBlinkDepositAmount must be used within a <BlinkProvider>"
|
|
149
149
|
);
|
|
150
150
|
}
|
|
151
151
|
return {
|
|
@@ -773,7 +773,7 @@ function createPasskeyViaPopup(options) {
|
|
|
773
773
|
const payload = { ...options, verificationToken };
|
|
774
774
|
const encoded = btoa(JSON.stringify(payload));
|
|
775
775
|
const popupUrl = `${window.location.origin}/passkey-register#${encoded}`;
|
|
776
|
-
const popup = window.open(popupUrl, "
|
|
776
|
+
const popup = window.open(popupUrl, "blink-passkey");
|
|
777
777
|
if (!popup) {
|
|
778
778
|
reject(new Error("Pop-up blocked. Please allow pop-ups for this site and try again."));
|
|
779
779
|
return;
|
|
@@ -823,7 +823,7 @@ function findDevicePasskeyViaPopup(options) {
|
|
|
823
823
|
};
|
|
824
824
|
const encoded = btoa(JSON.stringify(payload));
|
|
825
825
|
const popupUrl = `${window.location.origin}/passkey-verify#${encoded}`;
|
|
826
|
-
const popup = window.open(popupUrl, "
|
|
826
|
+
const popup = window.open(popupUrl, "blink-passkey-verify");
|
|
827
827
|
if (!popup) {
|
|
828
828
|
reject(new Error("Pop-up blocked. Please allow pop-ups for this site and try again."));
|
|
829
829
|
return;
|
|
@@ -942,7 +942,7 @@ function readEnvValue(name) {
|
|
|
942
942
|
return void 0;
|
|
943
943
|
}
|
|
944
944
|
function resolvePasskeyRpId() {
|
|
945
|
-
const configuredDomain = readEnvValue("VITE_DOMAIN") ?? readEnvValue("
|
|
945
|
+
const configuredDomain = readEnvValue("VITE_DOMAIN") ?? readEnvValue("BLINK_DOMAIN");
|
|
946
946
|
if (configuredDomain) {
|
|
947
947
|
return normalizeConfiguredDomain(configuredDomain);
|
|
948
948
|
}
|
|
@@ -996,7 +996,7 @@ async function createPasskeyCredential(params) {
|
|
|
996
996
|
const rpId = resolvePasskeyRpId();
|
|
997
997
|
const publicKeyOptions = {
|
|
998
998
|
challenge,
|
|
999
|
-
rp: { name: "
|
|
999
|
+
rp: { name: "Blink", id: rpId },
|
|
1000
1000
|
user: {
|
|
1001
1001
|
id: new TextEncoder().encode(params.userId),
|
|
1002
1002
|
name: params.displayName,
|
|
@@ -1053,7 +1053,7 @@ function buildPasskeyPopupOptions(params) {
|
|
|
1053
1053
|
return {
|
|
1054
1054
|
challenge: toBase64(challenge),
|
|
1055
1055
|
rpId,
|
|
1056
|
-
rpName: "
|
|
1056
|
+
rpName: "Blink",
|
|
1057
1057
|
userId: toBase64(new TextEncoder().encode(params.userId)),
|
|
1058
1058
|
userName: params.displayName,
|
|
1059
1059
|
userDisplayName: params.displayName,
|
|
@@ -1100,7 +1100,7 @@ async function findDevicePasskey(credentialIds) {
|
|
|
1100
1100
|
}
|
|
1101
1101
|
}
|
|
1102
1102
|
function useTransferPolling(intervalMs = 3e3) {
|
|
1103
|
-
const { apiBaseUrl } =
|
|
1103
|
+
const { apiBaseUrl } = useBlinkConfig();
|
|
1104
1104
|
const { getAccessToken } = reactAuth.usePrivy();
|
|
1105
1105
|
const [transfer, setTransfer] = react.useState(null);
|
|
1106
1106
|
const [error, setError] = react.useState(null);
|
|
@@ -1291,7 +1291,7 @@ async function executeApprovePermit2(action, wagmiConfig2) {
|
|
|
1291
1291
|
}]
|
|
1292
1292
|
});
|
|
1293
1293
|
console.info(
|
|
1294
|
-
`[
|
|
1294
|
+
`[blink-sdk][approve-permit2] ERC-20 approve tx sent. token=${tokenSymbol ?? to}, txHash=${txHash}`
|
|
1295
1295
|
);
|
|
1296
1296
|
return actionSuccess(
|
|
1297
1297
|
action,
|
|
@@ -1345,7 +1345,7 @@ async function executeSignPermit2(action, wagmiConfig2, apiBaseUrl, sessionId) {
|
|
|
1345
1345
|
}
|
|
1346
1346
|
const parsed = parseSignTypedDataPayload(typedData);
|
|
1347
1347
|
console.info(
|
|
1348
|
-
`[
|
|
1348
|
+
`[blink-sdk][sign-permit2] Signing typed data. expectedOwner=${expectedWallet ?? "N/A"}, senderParam=${sender}, connectedAddress=${connectedAddress ?? "N/A"}, primaryType=${parsed.primaryType}, domainChainId=${String(parsed.domain.chainId ?? "N/A")}, verifyingContract=${String(parsed.domain.verifyingContract ?? "N/A")}`
|
|
1349
1349
|
);
|
|
1350
1350
|
const rawSignature = await walletClient.signTypedData({
|
|
1351
1351
|
account: sender,
|
|
@@ -1357,7 +1357,7 @@ async function executeSignPermit2(action, wagmiConfig2, apiBaseUrl, sessionId) {
|
|
|
1357
1357
|
const signature = ownerIsSCA ? rawSignature.startsWith("0x") ? rawSignature : `0x${rawSignature}` : normalizeSignature(rawSignature);
|
|
1358
1358
|
if (ownerIsSCA) {
|
|
1359
1359
|
console.info(
|
|
1360
|
-
`[
|
|
1360
|
+
`[blink-sdk][sign-permit2] Owner is SCA \u2014 preserving raw signature (${rawSignature.length / 2 - 1}B). Server will validate via EIP-1271.`
|
|
1361
1361
|
);
|
|
1362
1362
|
} else {
|
|
1363
1363
|
const recoverInput = {
|
|
@@ -1370,7 +1370,7 @@ async function executeSignPermit2(action, wagmiConfig2, apiBaseUrl, sessionId) {
|
|
|
1370
1370
|
const recoveredSigner = await viem.recoverTypedDataAddress(recoverInput);
|
|
1371
1371
|
const expectedSigner = (expectedWallet ?? sender).toLowerCase();
|
|
1372
1372
|
console.info(
|
|
1373
|
-
`[
|
|
1373
|
+
`[blink-sdk][sign-permit2] Signature recovered. recoveredSigner=${recoveredSigner}, expectedSigner=${expectedSigner}`
|
|
1374
1374
|
);
|
|
1375
1375
|
if (recoveredSigner.toLowerCase() !== expectedSigner) {
|
|
1376
1376
|
return actionError(
|
|
@@ -1380,7 +1380,7 @@ async function executeSignPermit2(action, wagmiConfig2, apiBaseUrl, sessionId) {
|
|
|
1380
1380
|
}
|
|
1381
1381
|
}
|
|
1382
1382
|
console.info(
|
|
1383
|
-
`[
|
|
1383
|
+
`[blink-sdk][sign-permit2] Permit2 EIP-712 signature obtained. token=${tokenSymbol ?? "unknown"}`
|
|
1384
1384
|
);
|
|
1385
1385
|
return actionSuccess(
|
|
1386
1386
|
action,
|
|
@@ -1396,8 +1396,8 @@ async function executeSignPermit2(action, wagmiConfig2, apiBaseUrl, sessionId) {
|
|
|
1396
1396
|
}
|
|
1397
1397
|
}
|
|
1398
1398
|
function useAuthorizationExecutor(options) {
|
|
1399
|
-
const
|
|
1400
|
-
const apiBaseUrl = options?.apiBaseUrl ??
|
|
1399
|
+
const blinkConfig = useOptionalBlinkConfig();
|
|
1400
|
+
const apiBaseUrl = options?.apiBaseUrl ?? blinkConfig?.apiBaseUrl;
|
|
1401
1401
|
const wagmiConfig2 = wagmi.useConfig();
|
|
1402
1402
|
const { connectAsync, connectors } = wagmi.useConnect();
|
|
1403
1403
|
const { switchChainAsync } = wagmi.useSwitchChain();
|
|
@@ -1481,7 +1481,7 @@ function useAuthorizationExecutor(options) {
|
|
|
1481
1481
|
}
|
|
1482
1482
|
if (!apiBaseUrl) {
|
|
1483
1483
|
executingRef.current = false;
|
|
1484
|
-
throw new Error("Missing apiBaseUrl. Provide useAuthorizationExecutor({ apiBaseUrl }) or wrap in <
|
|
1484
|
+
throw new Error("Missing apiBaseUrl. Provide useAuthorizationExecutor({ apiBaseUrl }) or wrap in <BlinkProvider>.");
|
|
1485
1485
|
}
|
|
1486
1486
|
sessionIdRef.current = sessionId;
|
|
1487
1487
|
setExecuting(true);
|
|
@@ -1546,8 +1546,8 @@ function useAuthorizationExecutor(options) {
|
|
|
1546
1546
|
};
|
|
1547
1547
|
}
|
|
1548
1548
|
function useTransferSigning(pollIntervalMs = 2e3, options) {
|
|
1549
|
-
const
|
|
1550
|
-
const apiBaseUrl = options?.apiBaseUrl ??
|
|
1549
|
+
const blinkConfig = useOptionalBlinkConfig();
|
|
1550
|
+
const apiBaseUrl = options?.apiBaseUrl ?? blinkConfig?.apiBaseUrl;
|
|
1551
1551
|
const authorizationSessionToken = options?.authorizationSessionToken;
|
|
1552
1552
|
let privyGetAccessToken;
|
|
1553
1553
|
try {
|
|
@@ -1566,7 +1566,7 @@ function useTransferSigning(pollIntervalMs = 2e3, options) {
|
|
|
1566
1566
|
setSignPayload(null);
|
|
1567
1567
|
try {
|
|
1568
1568
|
if (!apiBaseUrl) {
|
|
1569
|
-
throw new Error("Missing apiBaseUrl. Provide useTransferSigning(_, { apiBaseUrl }) or wrap in <
|
|
1569
|
+
throw new Error("Missing apiBaseUrl. Provide useTransferSigning(_, { apiBaseUrl }) or wrap in <BlinkProvider>.");
|
|
1570
1570
|
}
|
|
1571
1571
|
if (!getAccessToken && !authorizationSessionToken) {
|
|
1572
1572
|
throw new Error("Missing getAccessToken provider. Provide useTransferSigning(_, { getAccessToken }).");
|
|
@@ -1644,8 +1644,8 @@ function useTransferSigning(pollIntervalMs = 2e3, options) {
|
|
|
1644
1644
|
}
|
|
1645
1645
|
|
|
1646
1646
|
// src/paymentHelpers.ts
|
|
1647
|
-
var ACTIVE_CREDENTIAL_STORAGE_KEY = "
|
|
1648
|
-
var MOBILE_FLOW_STORAGE_KEY = "
|
|
1647
|
+
var ACTIVE_CREDENTIAL_STORAGE_KEY = "blink_active_credential_id";
|
|
1648
|
+
var MOBILE_FLOW_STORAGE_KEY = "blink_mobile_flow";
|
|
1649
1649
|
var MIN_SEND_AMOUNT_USD = 0.25;
|
|
1650
1650
|
function persistMobileFlowState(data) {
|
|
1651
1651
|
try {
|
|
@@ -2125,7 +2125,7 @@ function shouldUseWalletConnector(options) {
|
|
|
2125
2125
|
}
|
|
2126
2126
|
var MUTED = "#7fa4b0";
|
|
2127
2127
|
var LOGO_SIZE = 48;
|
|
2128
|
-
function
|
|
2128
|
+
function BlinkLoadingScreen() {
|
|
2129
2129
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: containerStyle, children: [
|
|
2130
2130
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2131
2131
|
"svg",
|
|
@@ -2137,23 +2137,23 @@ function SwypeLoadingScreen() {
|
|
|
2137
2137
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2138
2138
|
style: { borderRadius: 10 },
|
|
2139
2139
|
children: [
|
|
2140
|
-
/* @__PURE__ */ jsxRuntime.jsxs("g", { clipPath: "url(#
|
|
2140
|
+
/* @__PURE__ */ jsxRuntime.jsxs("g", { clipPath: "url(#blink-loading-clip)", children: [
|
|
2141
2141
|
/* @__PURE__ */ jsxRuntime.jsx("rect", { width: "100", height: "100", rx: "18.5874", fill: "white" }),
|
|
2142
2142
|
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M64.0138 36.6191C68.3952 36.7025 70.2512 42.3038 65.1932 44.0399C61.4251 44.2617 60.8419 41.8557 61.3059 38.6113C62.3258 37.4916 62.6562 37.2326 64.0138 36.6191Z", fill: "white" }),
|
|
2143
2143
|
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M34.7441 36.6714C36.6646 36.3309 38.4839 37.6898 38.813 39.71C39.1407 41.7302 37.8542 43.6499 35.9352 43.9994C34.7427 44.2169 33.5274 43.7774 32.7154 42.8325C31.8492 41.8262 31.5728 40.4029 31.9959 39.1191C32.419 37.8367 33.4719 36.8979 34.7441 36.6714Z", fill: "white" }),
|
|
2144
|
-
/* @__PURE__ */ jsxRuntime.jsx("g", { style: { transformOrigin: "50px 62px", animation: "
|
|
2144
|
+
/* @__PURE__ */ jsxRuntime.jsx("g", { style: { transformOrigin: "50px 62px", animation: "blink-legs-walk 0.8s ease-in-out infinite" }, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M37.719 72.0299C39.0372 70.605 40.611 68.9843 41.7888 67.4312L50.1528 61.6651L57.6601 61.4468C57.4965 63.5289 61.7342 75.3729 61.6981 77.5158C62.154 77.0628 63.0658 76.3318 63.567 75.9876C65.9954 74.3365 68.8384 73.8223 71.4833 74.5554C72.8167 74.9328 73.9331 75.9251 74.58 77.3075C75.2967 78.8451 75.3771 80.3207 74.9127 82.0281C73.8912 85.7844 71.5792 88.6365 68.624 90.5357C66.125 92.1415 61.7077 93.9276 58.9822 93.0828C58.078 92.7956 56.4567 92.015 55.9204 91.1399C55.1385 89.8648 54.5613 88.8907 54.1469 87.3736C53.3686 84.4709 53.3459 86.0793 52.7439 77.9085C52.8102 75.0919 52.9961 69.1199 52.9088 66.782C52.1044 67.8121 48.6686 72.1053 47.7896 73.7937L43.7186 79.5555C45.2316 79.4947 47.0626 79.5314 48.354 80.4535C49.2813 81.1277 49.9192 82.2144 50.1273 83.4755C50.2332 83.8294 50.3132 84.6855 50.3258 85.0634C50.4307 88.2051 49.4337 91.7462 46.8974 93.4764C45.8189 94.2126 44.2654 94.598 43.01 94.7341C37.9909 95.3115 33.0817 93.5835 29.3502 89.9257C28.3222 88.8994 27.4875 87.705 27.4333 86.0333C27.4046 85.1165 27.6099 84.1963 28.0241 83.3859C28.6301 82.2147 30.2471 80.3005 31.0794 79.3156C33.2057 76.7997 35.4975 74.4306 37.719 72.0299Z", fill: "black" }) }),
|
|
2145
2145
|
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M25.2815 30.5666C25.6441 30.6182 25.869 30.0928 25.5864 29.8598C23.1701 27.868 21.5484 25.4469 21.0444 22.6545C20.3641 19.1251 21.516 15.5212 24.2422 12.6488C26.8514 9.91783 30.7518 8.12575 35.0552 7.68041C40.5681 7.11357 44.9544 9.44386 49.0355 11.908C49.1016 11.9479 49.1793 11.964 49.2559 11.9535L49.6641 11.8975C49.7772 11.882 49.8729 11.8099 49.9313 11.7118C50.7042 10.4132 53.3609 9.13558 54.9428 8.55183C63.274 5.47733 72.1015 8.67608 75.6217 15.0543C77.4169 18.3043 77.4637 21.9922 75.7515 25.2845C74.8719 26.99 73.8277 28.1868 72.3742 29.4156C72.1074 29.6412 72.3057 30.099 72.652 30.0534C78.3434 29.3036 83.6958 29.6535 88.1602 33.0995C88.1743 33.1104 88.1896 33.1204 88.2051 33.1289C94.9326 36.8336 95.4063 45.4019 90.8735 50.5016C88.6438 53.0434 85.3883 54.9193 81.641 55.8268C81.4786 55.8662 81.3675 56.017 81.3778 56.1837C81.627 60.2197 80.6407 63.7049 77.0957 66.8558C74.3594 69.31 72.2572 70.905 68.1242 71.1594C66.1317 71.2671 64.5824 71.0823 61.0405 69.4728C57.7759 67.9894 53.6996 61.9918 52.509 57.7058C52.4204 57.3871 51.9326 57.3204 51.7644 57.6052C49.4075 61.5961 43.2088 67.6787 38.7227 69.4728C35.1404 70.8919 32.2895 71.8779 28.5005 70.8789C24.3706 69.7951 20.9698 67.4623 19.0499 64.3964C18.0021 62.7282 16.7577 59.3144 17.4723 57.5087C17.4921 57.4587 17.5023 57.4056 17.4951 57.3522C17.4647 57.1259 17.359 56.7067 17.1377 56.6504C8.17592 54.367 2.58735 48.0815 5.03045 40.4013C6.14562 36.9784 8.95444 34.0395 12.8321 32.2381C16.7957 30.3763 20.9323 29.9475 25.2815 30.5666Z", fill: "black" }),
|
|
2146
2146
|
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "44.3433", y: "56.4863", width: "10.1195", height: "9.10751", fill: "black" }),
|
|
2147
2147
|
/* @__PURE__ */ jsxRuntime.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M45.6929 25.6221C49.2323 25.6223 52.1021 31.512 52.1021 38.7773C52.102 46.0426 49.2323 51.9323 45.6929 51.9326C42.2373 51.9326 39.4213 46.3188 39.2896 39.292C41.4308 38.8166 43.9097 38.7264 46.1079 39.1299C47.0121 39.2956 47.8949 38.5389 47.4956 37.7109C46.0273 34.6668 42.4111 34.0327 39.686 34.1816C40.5942 29.1824 42.9408 25.6221 45.6929 25.6221Z", fill: "white" }),
|
|
2148
2148
|
/* @__PURE__ */ jsxRuntime.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M63.2471 25.6216C66.7865 25.6219 69.6562 31.5116 69.6562 38.7769C69.6562 46.0422 66.7865 51.9319 63.2471 51.9321C59.7916 51.9321 56.9756 46.319 56.8438 39.2925C58.985 38.8171 61.4639 38.7259 63.6621 39.1294C64.5663 39.2952 65.4491 38.5394 65.0498 37.7114C63.5816 34.6669 59.9654 34.0322 57.2402 34.1812C58.1484 29.1821 60.4951 25.6216 63.2471 25.6216Z", fill: "white" })
|
|
2149
2149
|
] }),
|
|
2150
|
-
/* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: "
|
|
2150
|
+
/* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: "blink-loading-clip", children: /* @__PURE__ */ jsxRuntime.jsx("rect", { width: "100", height: "100", rx: "18.5874", fill: "white" }) }) })
|
|
2151
2151
|
]
|
|
2152
2152
|
}
|
|
2153
2153
|
),
|
|
2154
2154
|
/* @__PURE__ */ jsxRuntime.jsx("span", { style: labelStyle, children: "Loading..." }),
|
|
2155
2155
|
/* @__PURE__ */ jsxRuntime.jsx("style", { children: `
|
|
2156
|
-
@keyframes
|
|
2156
|
+
@keyframes blink-legs-walk {
|
|
2157
2157
|
0%, 100% { transform: rotate(0deg); }
|
|
2158
2158
|
25% { transform: rotate(5deg); }
|
|
2159
2159
|
75% { transform: rotate(-5deg); }
|
|
@@ -2208,7 +2208,7 @@ var TRUST_WALLET_SVG = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="729 341
|
|
|
2208
2208
|
<path fill="#0500ff" d="m738.71,423.41l221.45-72.3v500.52c-158.18-66.74-221.45-194.65-221.45-266.94v-161.28Z"/>
|
|
2209
2209
|
<path fill="url(#tw-grad)" d="m1181.62,423.41l-221.45-72.3v500.52c158.18-66.74,221.45-194.65,221.45-266.94v-161.28Z"/>
|
|
2210
2210
|
</svg>`;
|
|
2211
|
-
var
|
|
2211
|
+
var BLINK_SVG = `<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2212
2212
|
<g clip-path="url(#clip0_125_480)">
|
|
2213
2213
|
<rect width="100" height="100" rx="18.5874" fill="black"/>
|
|
2214
2214
|
<path d="M64.0138 36.6191C68.3952 36.7025 70.2512 42.3038 65.1932 44.0399C61.4251 44.2617 60.8419 41.8557 61.3059 38.6113C62.3258 37.4916 62.6562 37.2326 64.0138 36.6191Z" fill="black"/>
|
|
@@ -2234,8 +2234,8 @@ var TETHER_SVG = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 800">
|
|
|
2234
2234
|
<circle fill="#009393" cx="400" cy="400" r="400"/>
|
|
2235
2235
|
<path fill="#fff" fill-rule="evenodd" d="M400.49,428.59c68.79,0,126.28-11.63,140.33-27.17-11.93-13.18-55.08-23.56-109.88-26.4v32.83c-9.81.51-20.01.76-30.46.76s-20.65-.25-30.48-.76v-32.83c-54.78,2.84-97.95,13.22-109.88,26.4,14.07,15.54,71.57,27.17,140.36,27.17ZM522.71,274.06v45.21h-91.77v31.35c64.46,3.35,112.83,17.13,113.19,33.62v34.38c-.36,16.49-48.73,30.24-113.19,33.6v76.94h-60.93v-76.94c-64.46-3.35-112.81-17.11-113.17-33.6v-34.38c.36-16.49,48.71-30.27,113.17-33.62v-31.35h-91.77v-45.21h244.48ZM242.15,202.11h322.16c7.7,0,14.79,4.05,18.63,10.63l93.85,161.16c4.86,8.36,3.42,18.91-3.52,25.68l-258.34,252.18c-8.38,8.17-21.84,8.17-30.2,0L126.71,399.92c-7.09-6.94-8.43-17.79-3.2-26.19l100.33-161.49c3.91-6.28,10.85-10.12,18.32-10.12Z"/>
|
|
2236
2236
|
</svg>`;
|
|
2237
|
-
var
|
|
2238
|
-
var
|
|
2237
|
+
var BLINK_LOGO = svgToDataUri(BLINK_SVG);
|
|
2238
|
+
var BLINK_MASCOT = BLINK_LOGO;
|
|
2239
2239
|
var BASE_LOGO = svgToDataUri(BASE_SVG);
|
|
2240
2240
|
var METAMASK_LOGO = svgToDataUri(METAMASK_SVG);
|
|
2241
2241
|
var TRUST_WALLET_LOGO = svgToDataUri(TRUST_WALLET_SVG);
|
|
@@ -2252,14 +2252,14 @@ var TOKEN_LOGOS = {
|
|
|
2252
2252
|
USDT: TETHER_LOGO
|
|
2253
2253
|
};
|
|
2254
2254
|
var FOOTER_CSS = `
|
|
2255
|
-
.
|
|
2255
|
+
.blink-screen-footer {
|
|
2256
2256
|
padding-bottom: max(32px, env(safe-area-inset-bottom, 32px));
|
|
2257
2257
|
}`;
|
|
2258
2258
|
function ScreenLayout({ children, footer }) {
|
|
2259
|
-
const { tokens } =
|
|
2259
|
+
const { tokens } = useBlinkConfig();
|
|
2260
2260
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: containerStyle2(tokens.bgCard), children: [
|
|
2261
2261
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: bodyStyle, children }),
|
|
2262
|
-
footer && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "
|
|
2262
|
+
footer && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "blink-screen-footer", style: footerStyle, children: footer }),
|
|
2263
2263
|
/* @__PURE__ */ jsxRuntime.jsx("style", { children: FOOTER_CSS })
|
|
2264
2264
|
] });
|
|
2265
2265
|
}
|
|
@@ -2299,9 +2299,9 @@ function useFlowPhase() {
|
|
|
2299
2299
|
return react.useContext(FlowPhaseContext);
|
|
2300
2300
|
}
|
|
2301
2301
|
function StepProgress({ phase }) {
|
|
2302
|
-
const { tokens } =
|
|
2302
|
+
const { tokens } = useBlinkConfig();
|
|
2303
2303
|
if (phase === "deposit") {
|
|
2304
|
-
return /* @__PURE__ */ jsxRuntime.jsx("img", { src:
|
|
2304
|
+
return /* @__PURE__ */ jsxRuntime.jsx("img", { src: BLINK_LOGO, alt: "Blink", style: mascotStyle });
|
|
2305
2305
|
}
|
|
2306
2306
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: containerStyle3, children: [
|
|
2307
2307
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: sectionStyle("flex-end"), children: [
|
|
@@ -2353,7 +2353,7 @@ var mascotStyle = {
|
|
|
2353
2353
|
height: 28
|
|
2354
2354
|
};
|
|
2355
2355
|
function SettingsMenu({ onLogout }) {
|
|
2356
|
-
const { tokens } =
|
|
2356
|
+
const { tokens } = useBlinkConfig();
|
|
2357
2357
|
const [open, setOpen] = react.useState(false);
|
|
2358
2358
|
const menuRef = react.useRef(null);
|
|
2359
2359
|
const toggle = react.useCallback(() => setOpen((prev) => !prev), []);
|
|
@@ -2434,7 +2434,7 @@ var menuItemStyle = (tokens) => ({
|
|
|
2434
2434
|
color: tokens.error
|
|
2435
2435
|
});
|
|
2436
2436
|
function ScreenHeader({ title, right, onBack, badge, onLogout }) {
|
|
2437
|
-
const { tokens } =
|
|
2437
|
+
const { tokens } = useBlinkConfig();
|
|
2438
2438
|
const flowPhase = useFlowPhase();
|
|
2439
2439
|
const rightContent = onLogout ? /* @__PURE__ */ jsxRuntime.jsx(SettingsMenu, { onLogout }) : right;
|
|
2440
2440
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: headerStyle, children: [
|
|
@@ -2483,7 +2483,7 @@ var badgeStyle = (color) => ({
|
|
|
2483
2483
|
color
|
|
2484
2484
|
});
|
|
2485
2485
|
function PoweredByFooter() {
|
|
2486
|
-
const { tokens } =
|
|
2486
|
+
const { tokens } = useBlinkConfig();
|
|
2487
2487
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: containerStyle5(tokens.textMuted), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: rowStyle, children: [
|
|
2488
2488
|
/* @__PURE__ */ jsxRuntime.jsx("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2489
2489
|
"path",
|
|
@@ -2511,7 +2511,7 @@ var rowStyle = {
|
|
|
2511
2511
|
gap: 6
|
|
2512
2512
|
};
|
|
2513
2513
|
function PrimaryButton({ children, onClick, disabled, loading, icon }) {
|
|
2514
|
-
const { tokens } =
|
|
2514
|
+
const { tokens } = useBlinkConfig();
|
|
2515
2515
|
const isDisabled = disabled || loading;
|
|
2516
2516
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2517
2517
|
"button",
|
|
@@ -2551,7 +2551,7 @@ var iconWrapStyle = {
|
|
|
2551
2551
|
alignItems: "center"
|
|
2552
2552
|
};
|
|
2553
2553
|
function OutlineButton({ children, onClick, disabled }) {
|
|
2554
|
-
const { tokens } =
|
|
2554
|
+
const { tokens } = useBlinkConfig();
|
|
2555
2555
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2556
2556
|
"button",
|
|
2557
2557
|
{
|
|
@@ -2585,7 +2585,7 @@ var defaultIcon = /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "18", height: "
|
|
|
2585
2585
|
}
|
|
2586
2586
|
) });
|
|
2587
2587
|
function InfoBanner({ children, icon }) {
|
|
2588
|
-
const { tokens } =
|
|
2588
|
+
const { tokens } = useBlinkConfig();
|
|
2589
2589
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: containerStyle6(tokens.accent), children: [
|
|
2590
2590
|
/* @__PURE__ */ jsxRuntime.jsx("span", { style: iconStyle, children: icon ?? defaultIcon }),
|
|
2591
2591
|
/* @__PURE__ */ jsxRuntime.jsx("span", { style: textStyle, children })
|
|
@@ -2637,7 +2637,7 @@ var headerStyle2 = {
|
|
|
2637
2637
|
var iconStyle2 = { flexShrink: 0 };
|
|
2638
2638
|
var bodyStyle2 = { color: "#6D4C41" };
|
|
2639
2639
|
function IconCircle({ children, variant = "accent", size = 56 }) {
|
|
2640
|
-
const { tokens } =
|
|
2640
|
+
const { tokens } = useBlinkConfig();
|
|
2641
2641
|
const bgMap = {
|
|
2642
2642
|
accent: `${tokens.accent}18`,
|
|
2643
2643
|
success: tokens.successBg,
|
|
@@ -2657,7 +2657,7 @@ var circleStyle = (bg, size) => ({
|
|
|
2657
2657
|
flexShrink: 0
|
|
2658
2658
|
});
|
|
2659
2659
|
function OtpInput({ value, onChange, length = 6, disabled }) {
|
|
2660
|
-
const { tokens } =
|
|
2660
|
+
const { tokens } = useBlinkConfig();
|
|
2661
2661
|
const inputsRef = react.useRef([]);
|
|
2662
2662
|
const digits = value.padEnd(length).split("").slice(0, length);
|
|
2663
2663
|
const focusInput = react.useCallback((index) => {
|
|
@@ -2741,7 +2741,7 @@ var inputStyle = (tokens, filled) => ({
|
|
|
2741
2741
|
transition: "border-color 0.15s ease"
|
|
2742
2742
|
});
|
|
2743
2743
|
function StepList({ steps }) {
|
|
2744
|
-
const { tokens } =
|
|
2744
|
+
const { tokens } = useBlinkConfig();
|
|
2745
2745
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: listStyle, children: steps.map((step, i) => {
|
|
2746
2746
|
const isComplete = step.status === "complete";
|
|
2747
2747
|
const isActive = step.status === "active";
|
|
@@ -2817,7 +2817,7 @@ function LoginScreen({
|
|
|
2817
2817
|
merchantInitials,
|
|
2818
2818
|
onSocialLogin
|
|
2819
2819
|
}) {
|
|
2820
|
-
const { tokens } =
|
|
2820
|
+
const { tokens } = useBlinkConfig();
|
|
2821
2821
|
const disabled = authInput.trim().length === 0 || sending;
|
|
2822
2822
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2823
2823
|
ScreenLayout,
|
|
@@ -2852,13 +2852,13 @@ function LoginScreen({
|
|
|
2852
2852
|
}
|
|
2853
2853
|
),
|
|
2854
2854
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle, children: [
|
|
2855
|
-
/* @__PURE__ */ jsxRuntime.jsx("img", { src:
|
|
2855
|
+
/* @__PURE__ */ jsxRuntime.jsx("img", { src: BLINK_LOGO, alt: "Blink", style: logoStyle }),
|
|
2856
2856
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle(tokens.text), children: "Your Money. Any App.\nOne Tap." }),
|
|
2857
2857
|
error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorStyle(tokens), children: error }),
|
|
2858
2858
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2859
2859
|
"input",
|
|
2860
2860
|
{
|
|
2861
|
-
id: "
|
|
2861
|
+
id: "blink-login-identifier",
|
|
2862
2862
|
type: "text",
|
|
2863
2863
|
inputMode: "text",
|
|
2864
2864
|
autoComplete: "username",
|
|
@@ -2985,7 +2985,7 @@ function OtpVerifyScreen({
|
|
|
2985
2985
|
verifying,
|
|
2986
2986
|
error
|
|
2987
2987
|
}) {
|
|
2988
|
-
const { tokens } =
|
|
2988
|
+
const { tokens } = useBlinkConfig();
|
|
2989
2989
|
const disabled = otpCode.trim().length !== 6 || verifying;
|
|
2990
2990
|
const [cooldown, setCooldown] = react.useState(RESEND_COOLDOWN_SECONDS);
|
|
2991
2991
|
const intervalRef = react.useRef(null);
|
|
@@ -3104,7 +3104,7 @@ function PasskeyScreen({
|
|
|
3104
3104
|
popupFallback = false,
|
|
3105
3105
|
onCreatePasskeyViaPopup
|
|
3106
3106
|
}) {
|
|
3107
|
-
const { tokens } =
|
|
3107
|
+
const { tokens } = useBlinkConfig();
|
|
3108
3108
|
const handleCreate = popupFallback && onCreatePasskeyViaPopup ? onCreatePasskeyViaPopup : onCreatePasskey;
|
|
3109
3109
|
const buttonLabel = popupFallback ? "Open Passkey Window" : "Verify Passkey";
|
|
3110
3110
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -3159,7 +3159,7 @@ var errorBannerStyle2 = (tokens) => ({
|
|
|
3159
3159
|
textAlign: "left"
|
|
3160
3160
|
});
|
|
3161
3161
|
function Spinner({ size = 40, label }) {
|
|
3162
|
-
const { tokens } =
|
|
3162
|
+
const { tokens } = useBlinkConfig();
|
|
3163
3163
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3164
3164
|
"div",
|
|
3165
3165
|
{
|
|
@@ -3181,13 +3181,13 @@ function Spinner({ size = 40, label }) {
|
|
|
3181
3181
|
borderRightColor: tokens.accent + "66",
|
|
3182
3182
|
borderRadius: "50%",
|
|
3183
3183
|
boxShadow: "inset 0 0 0 1px rgba(255,255,255,0.1)",
|
|
3184
|
-
animation: "
|
|
3184
|
+
animation: "blink-spin 0.9s linear infinite"
|
|
3185
3185
|
}
|
|
3186
3186
|
}
|
|
3187
3187
|
),
|
|
3188
3188
|
label && /* @__PURE__ */ jsxRuntime.jsx("p", { style: { color: tokens.textSecondary, fontSize: "0.875rem", margin: 0 }, children: label }),
|
|
3189
3189
|
/* @__PURE__ */ jsxRuntime.jsx("style", { children: `
|
|
3190
|
-
@keyframes
|
|
3190
|
+
@keyframes blink-spin {
|
|
3191
3191
|
to { transform: rotate(360deg); }
|
|
3192
3192
|
}
|
|
3193
3193
|
` })
|
|
@@ -3215,7 +3215,7 @@ function WalletPickerScreen({
|
|
|
3215
3215
|
onBack,
|
|
3216
3216
|
onLogout
|
|
3217
3217
|
}) {
|
|
3218
|
-
const { tokens } =
|
|
3218
|
+
const { tokens } = useBlinkConfig();
|
|
3219
3219
|
const [hoveredId, setHoveredId] = react.useState(null);
|
|
3220
3220
|
const [selectedProviderId, setSelectedProviderId] = react.useState(null);
|
|
3221
3221
|
const [cryptoExpanded, setCryptoExpanded] = react.useState(false);
|
|
@@ -3250,7 +3250,7 @@ function WalletPickerScreen({
|
|
|
3250
3250
|
const selectedProvider = displayProviders.find((p) => p.id === selectedProviderId);
|
|
3251
3251
|
if (loading) {
|
|
3252
3252
|
return /* @__PURE__ */ jsxRuntime.jsxs(ScreenLayout, { children: [
|
|
3253
|
-
/* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { title: "Set up
|
|
3253
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { title: "Set up Blink", onBack, onLogout }),
|
|
3254
3254
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { textAlign: "center", padding: "48px 0", flex: 1, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ jsxRuntime.jsx(Spinner, { label: "Connecting..." }) })
|
|
3255
3255
|
] });
|
|
3256
3256
|
}
|
|
@@ -3280,7 +3280,7 @@ function WalletPickerScreen({
|
|
|
3280
3280
|
/* @__PURE__ */ jsxRuntime.jsx(PoweredByFooter, {})
|
|
3281
3281
|
] }),
|
|
3282
3282
|
children: [
|
|
3283
|
-
/* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { title: "Set up
|
|
3283
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { title: "Set up Blink", onBack, onLogout }),
|
|
3284
3284
|
hasPending && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3285
3285
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle4(tokens.text), children: "Continue where you left off" }),
|
|
3286
3286
|
/* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle3(tokens.textSecondary), children: "You have a wallet that still needs setup" }),
|
|
@@ -3554,7 +3554,7 @@ function SetupScreen({
|
|
|
3554
3554
|
error,
|
|
3555
3555
|
selectedTokenSymbol
|
|
3556
3556
|
}) {
|
|
3557
|
-
const { tokens } =
|
|
3557
|
+
const { tokens } = useBlinkConfig();
|
|
3558
3558
|
const effectiveMax = DEFAULT_MAX;
|
|
3559
3559
|
const effectiveMin = Math.min(ABSOLUTE_MIN, effectiveMax);
|
|
3560
3560
|
const [limit, setLimit] = react.useState(() => Math.min(availableBalance, effectiveMax));
|
|
@@ -3772,12 +3772,12 @@ function SetupStatusScreen({
|
|
|
3772
3772
|
onLogout,
|
|
3773
3773
|
error
|
|
3774
3774
|
}) {
|
|
3775
|
-
const { tokens } =
|
|
3775
|
+
const { tokens } = useBlinkConfig();
|
|
3776
3776
|
if (complete) {
|
|
3777
3777
|
return /* @__PURE__ */ jsxRuntime.jsxs(ScreenLayout, { footer: /* @__PURE__ */ jsxRuntime.jsx(PoweredByFooter, {}), children: [
|
|
3778
3778
|
/* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onBack: onContinue }),
|
|
3779
3779
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle4, children: [
|
|
3780
|
-
/* @__PURE__ */ jsxRuntime.jsx("img", { src:
|
|
3780
|
+
/* @__PURE__ */ jsxRuntime.jsx("img", { src: BLINK_LOGO, alt: "Blink", style: mascotStyle2 }),
|
|
3781
3781
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle6(tokens.text), children: "Done!" }),
|
|
3782
3782
|
/* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle4(tokens.textSecondary), children: "Return to the app to try one-tap deposits." })
|
|
3783
3783
|
] })
|
|
@@ -3872,7 +3872,7 @@ function DepositScreen({
|
|
|
3872
3872
|
selectedSourceLabel,
|
|
3873
3873
|
selectedTokenSymbol
|
|
3874
3874
|
}) {
|
|
3875
|
-
const { tokens } =
|
|
3875
|
+
const { tokens } = useBlinkConfig();
|
|
3876
3876
|
const amount = initialAmount;
|
|
3877
3877
|
const [accountPickerOpen, setAccountPickerOpen] = react.useState(false);
|
|
3878
3878
|
const pickerRef = react.useRef(null);
|
|
@@ -4247,7 +4247,7 @@ function SuccessScreen({
|
|
|
4247
4247
|
onManageAccount,
|
|
4248
4248
|
autoCloseSeconds
|
|
4249
4249
|
}) {
|
|
4250
|
-
const { tokens } =
|
|
4250
|
+
const { tokens } = useBlinkConfig();
|
|
4251
4251
|
const effectiveAutoClose = succeeded ? autoCloseSeconds : void 0;
|
|
4252
4252
|
const [countdown, setCountdown] = react.useState(effectiveAutoClose ?? 0);
|
|
4253
4253
|
const doneCalledRef = react.useRef(false);
|
|
@@ -4284,7 +4284,7 @@ function SuccessScreen({
|
|
|
4284
4284
|
countdown,
|
|
4285
4285
|
"s\u2026"
|
|
4286
4286
|
] }),
|
|
4287
|
-
onManageAccount && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: onManageAccount, style: manageStyle(tokens.textMuted), children: "Manage
|
|
4287
|
+
onManageAccount && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: onManageAccount, style: manageStyle(tokens.textMuted), children: "Manage Blink account \u2192" }),
|
|
4288
4288
|
/* @__PURE__ */ jsxRuntime.jsx(PoweredByFooter, {})
|
|
4289
4289
|
] }),
|
|
4290
4290
|
children: [
|
|
@@ -4438,7 +4438,7 @@ function SelectSourceScreen({
|
|
|
4438
4438
|
onBack,
|
|
4439
4439
|
onLogout
|
|
4440
4440
|
}) {
|
|
4441
|
-
const { tokens } =
|
|
4441
|
+
const { tokens } = useBlinkConfig();
|
|
4442
4442
|
const selectedChain = choices.find((c) => c.chainName === selectedChainName) ?? choices[0];
|
|
4443
4443
|
const tokenChoices = selectedChain?.tokens ?? [];
|
|
4444
4444
|
const canConfirm = !!selectedChainName && !!selectedTokenSymbol;
|
|
@@ -4623,7 +4623,7 @@ function AdvancedSourceScreen({
|
|
|
4623
4623
|
onSelectSource,
|
|
4624
4624
|
onBack
|
|
4625
4625
|
}) {
|
|
4626
|
-
const { tokens } =
|
|
4626
|
+
const { tokens } = useBlinkConfig();
|
|
4627
4627
|
const [expandedChain, setExpandedChain] = react.useState(
|
|
4628
4628
|
selectedChainName || (choices[0]?.chainName ?? null)
|
|
4629
4629
|
);
|
|
@@ -4656,7 +4656,7 @@ function AdvancedSourceScreen({
|
|
|
4656
4656
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4657
4657
|
ScreenHeader,
|
|
4658
4658
|
{
|
|
4659
|
-
title: "
|
|
4659
|
+
title: "Blink Setup",
|
|
4660
4660
|
onBack,
|
|
4661
4661
|
right: /* @__PURE__ */ jsxRuntime.jsx("span", { style: advancedBadgeStyle(tokens.accent), children: "Advanced" })
|
|
4662
4662
|
}
|
|
@@ -4856,7 +4856,7 @@ function TransferStatusScreen({
|
|
|
4856
4856
|
error,
|
|
4857
4857
|
onLogout
|
|
4858
4858
|
}) {
|
|
4859
|
-
const { tokens } =
|
|
4859
|
+
const { tokens } = useBlinkConfig();
|
|
4860
4860
|
const steps = buildSteps(phase);
|
|
4861
4861
|
return /* @__PURE__ */ jsxRuntime.jsxs(ScreenLayout, { footer: /* @__PURE__ */ jsxRuntime.jsx(PoweredByFooter, {}), children: [
|
|
4862
4862
|
/* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onLogout }),
|
|
@@ -4934,7 +4934,7 @@ function OpenWalletScreen({
|
|
|
4934
4934
|
onBack,
|
|
4935
4935
|
onLogout
|
|
4936
4936
|
}) {
|
|
4937
|
-
const { tokens } =
|
|
4937
|
+
const { tokens } = useBlinkConfig();
|
|
4938
4938
|
const displayName = walletName ?? "your wallet";
|
|
4939
4939
|
const logoSrc = walletName ? KNOWN_LOGOS[walletName.toLowerCase()] : void 0;
|
|
4940
4940
|
const autoOpenedRef = react.useRef(null);
|
|
@@ -5078,7 +5078,7 @@ function ConfirmSignScreen({
|
|
|
5078
5078
|
onSign,
|
|
5079
5079
|
onLogout
|
|
5080
5080
|
}) {
|
|
5081
|
-
const { tokens } =
|
|
5081
|
+
const { tokens } = useBlinkConfig();
|
|
5082
5082
|
const displayName = walletName ?? "your wallet";
|
|
5083
5083
|
const logoSrc = walletName ? KNOWN_LOGOS[walletName.toLowerCase()] : void 0;
|
|
5084
5084
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -5174,7 +5174,7 @@ function TokenPickerScreen({
|
|
|
5174
5174
|
selectedTokenSymbol,
|
|
5175
5175
|
selectedWalletId
|
|
5176
5176
|
}) {
|
|
5177
|
-
const { tokens: t } =
|
|
5177
|
+
const { tokens: t } = useBlinkConfig();
|
|
5178
5178
|
const entries = [];
|
|
5179
5179
|
for (const wallet of account.wallets) {
|
|
5180
5180
|
for (const source of wallet.sources) {
|
|
@@ -5462,11 +5462,11 @@ function StepRendererContent({
|
|
|
5462
5462
|
const selectedWallet = selectedAccount?.wallets.find((w) => w.id === state.selectedWalletId);
|
|
5463
5463
|
const selectedSourceLabel = selectedSource && selectedWallet ? `${selectedSource.token.symbol} on ${selectedWallet.chain.name}` : void 0;
|
|
5464
5464
|
if (!ready) {
|
|
5465
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5465
|
+
return /* @__PURE__ */ jsxRuntime.jsx(BlinkLoadingScreen, {});
|
|
5466
5466
|
}
|
|
5467
5467
|
if (step === "login") {
|
|
5468
5468
|
if (authenticated) {
|
|
5469
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5469
|
+
return /* @__PURE__ */ jsxRuntime.jsx(BlinkLoadingScreen, {});
|
|
5470
5470
|
}
|
|
5471
5471
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5472
5472
|
LoginScreen,
|
|
@@ -5616,7 +5616,7 @@ function StepRendererContent({
|
|
|
5616
5616
|
}
|
|
5617
5617
|
if (step === "deposit") {
|
|
5618
5618
|
if (state.loadingData) {
|
|
5619
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5619
|
+
return /* @__PURE__ */ jsxRuntime.jsx(BlinkLoadingScreen, {});
|
|
5620
5620
|
}
|
|
5621
5621
|
const parsedAmt = depositAmount != null ? depositAmount : 5;
|
|
5622
5622
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5648,7 +5648,7 @@ function StepRendererContent({
|
|
|
5648
5648
|
}
|
|
5649
5649
|
if (step === "token-picker") {
|
|
5650
5650
|
if (!selectedAccount) {
|
|
5651
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5651
|
+
return /* @__PURE__ */ jsxRuntime.jsx(BlinkLoadingScreen, {});
|
|
5652
5652
|
}
|
|
5653
5653
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5654
5654
|
TokenPickerScreen,
|
|
@@ -6074,7 +6074,7 @@ function usePasskeyHandlers(dispatch, apiBaseUrl, accounts, knownCredentialIds,
|
|
|
6074
6074
|
return;
|
|
6075
6075
|
}
|
|
6076
6076
|
}
|
|
6077
|
-
const passkeyDisplayName = user?.email?.address ?? user?.google?.name ?? user?.id ?? "
|
|
6077
|
+
const passkeyDisplayName = user?.email?.address ?? user?.google?.name ?? user?.id ?? "Blink User";
|
|
6078
6078
|
const { credentialId, publicKey } = await createPasskeyCredential({
|
|
6079
6079
|
userId: user?.id ?? "unknown",
|
|
6080
6080
|
displayName: passkeyDisplayName
|
|
@@ -6116,7 +6116,7 @@ function usePasskeyHandlers(dispatch, apiBaseUrl, accounts, knownCredentialIds,
|
|
|
6116
6116
|
return;
|
|
6117
6117
|
}
|
|
6118
6118
|
}
|
|
6119
|
-
const passkeyDisplayName = user?.email?.address ?? user?.google?.name ?? user?.id ?? "
|
|
6119
|
+
const passkeyDisplayName = user?.email?.address ?? user?.google?.name ?? user?.id ?? "Blink User";
|
|
6120
6120
|
const popupOptions = buildPasskeyPopupOptions({
|
|
6121
6121
|
userId: user?.id ?? "unknown",
|
|
6122
6122
|
displayName: passkeyDisplayName,
|
|
@@ -7504,14 +7504,14 @@ function usePaymentEffects(deps) {
|
|
|
7504
7504
|
}
|
|
7505
7505
|
}, [pendingOneTapSetupAction, state.step, reloadAccounts, authExecutor, dispatch, oneTapLimitSavedDuringSetupRef]);
|
|
7506
7506
|
}
|
|
7507
|
-
function
|
|
7507
|
+
function BlinkPayment(props) {
|
|
7508
7508
|
const resetKey = react.useRef(0);
|
|
7509
7509
|
const handleBoundaryReset = react.useCallback(() => {
|
|
7510
7510
|
resetKey.current += 1;
|
|
7511
7511
|
}, []);
|
|
7512
|
-
return /* @__PURE__ */ jsxRuntime.jsx(PaymentErrorBoundary, { onReset: handleBoundaryReset, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7512
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PaymentErrorBoundary, { onReset: handleBoundaryReset, children: /* @__PURE__ */ jsxRuntime.jsx(BlinkPaymentInner, { ...props }) }, resetKey.current);
|
|
7513
7513
|
}
|
|
7514
|
-
function
|
|
7514
|
+
function BlinkPaymentInner({
|
|
7515
7515
|
destination,
|
|
7516
7516
|
onComplete,
|
|
7517
7517
|
onError,
|
|
@@ -7523,7 +7523,7 @@ function SwypePaymentInner({
|
|
|
7523
7523
|
onDismiss,
|
|
7524
7524
|
autoCloseSeconds
|
|
7525
7525
|
}) {
|
|
7526
|
-
const { apiBaseUrl, depositAmount } =
|
|
7526
|
+
const { apiBaseUrl, depositAmount } = useBlinkConfig();
|
|
7527
7527
|
const { ready, authenticated, logout, getAccessToken } = reactAuth.usePrivy();
|
|
7528
7528
|
reactAuth.useLoginWithOAuth();
|
|
7529
7529
|
const [state, dispatch] = react.useReducer(
|
|
@@ -7764,6 +7764,11 @@ function SwypePaymentInner({
|
|
|
7764
7764
|
}
|
|
7765
7765
|
|
|
7766
7766
|
exports.AdvancedSourceScreen = AdvancedSourceScreen;
|
|
7767
|
+
exports.BLINK_LOGO = BLINK_LOGO;
|
|
7768
|
+
exports.BLINK_MASCOT = BLINK_MASCOT;
|
|
7769
|
+
exports.BlinkLoadingScreen = BlinkLoadingScreen;
|
|
7770
|
+
exports.BlinkPayment = BlinkPayment;
|
|
7771
|
+
exports.BlinkProvider = BlinkProvider;
|
|
7767
7772
|
exports.FlowPhaseProvider = FlowPhaseProvider;
|
|
7768
7773
|
exports.IconCircle = IconCircle;
|
|
7769
7774
|
exports.InfoBanner = InfoBanner;
|
|
@@ -7772,8 +7777,6 @@ exports.PasskeyIframeBlockedError = PasskeyIframeBlockedError;
|
|
|
7772
7777
|
exports.PasskeyScreen = PasskeyScreen;
|
|
7773
7778
|
exports.PoweredByFooter = PoweredByFooter;
|
|
7774
7779
|
exports.PrimaryButton = PrimaryButton;
|
|
7775
|
-
exports.SWYPE_LOGO = SWYPE_LOGO;
|
|
7776
|
-
exports.SWYPE_MASCOT = SWYPE_MASCOT;
|
|
7777
7780
|
exports.ScreenHeader = ScreenHeader;
|
|
7778
7781
|
exports.ScreenLayout = ScreenLayout;
|
|
7779
7782
|
exports.SelectSourceScreen = SelectSourceScreen;
|
|
@@ -7781,10 +7784,8 @@ exports.SettingsMenu = SettingsMenu;
|
|
|
7781
7784
|
exports.SetupScreen = SetupScreen;
|
|
7782
7785
|
exports.Spinner = Spinner;
|
|
7783
7786
|
exports.StepList = StepList;
|
|
7784
|
-
exports.SwypeLoadingScreen = SwypeLoadingScreen;
|
|
7785
|
-
exports.SwypePayment = SwypePayment;
|
|
7786
|
-
exports.SwypeProvider = SwypeProvider;
|
|
7787
7787
|
exports.TokenPickerScreen = TokenPickerScreen;
|
|
7788
|
+
exports.blinkApi = api_exports;
|
|
7788
7789
|
exports.buildPasskeyPopupOptions = buildPasskeyPopupOptions;
|
|
7789
7790
|
exports.createPasskeyCredential = createPasskeyCredential;
|
|
7790
7791
|
exports.createPasskeyViaPopup = createPasskeyViaPopup;
|
|
@@ -7795,10 +7796,9 @@ exports.findDevicePasskeyViaPopup = findDevicePasskeyViaPopup;
|
|
|
7795
7796
|
exports.getTheme = getTheme;
|
|
7796
7797
|
exports.lightTheme = lightTheme;
|
|
7797
7798
|
exports.resolvePasskeyRpId = resolvePasskeyRpId;
|
|
7798
|
-
exports.swypeApi = api_exports;
|
|
7799
7799
|
exports.useAuthorizationExecutor = useAuthorizationExecutor;
|
|
7800
|
-
exports.
|
|
7801
|
-
exports.
|
|
7800
|
+
exports.useBlinkConfig = useBlinkConfig;
|
|
7801
|
+
exports.useBlinkDepositAmount = useBlinkDepositAmount;
|
|
7802
7802
|
exports.useTransferPolling = useTransferPolling;
|
|
7803
7803
|
exports.useTransferSigning = useTransferSigning;
|
|
7804
7804
|
//# sourceMappingURL=index.cjs.map
|