@swype-org/react-sdk 0.1.287 → 0.1.293
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 +641 -174
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +290 -13
- package/dist/index.d.ts +290 -13
- package/dist/index.js +627 -175
- package/dist/index.js.map +1 -1
- package/package.json +4 -9
package/dist/index.js
CHANGED
|
@@ -485,13 +485,14 @@ __export(api_exports, {
|
|
|
485
485
|
fetchAuthorizationSessionByToken: () => fetchAuthorizationSessionByToken,
|
|
486
486
|
fetchChains: () => fetchChains,
|
|
487
487
|
fetchGuestAccount: () => fetchGuestAccount,
|
|
488
|
-
fetchGuestTransferBalances: () => fetchGuestTransferBalances,
|
|
489
488
|
fetchMerchantPublicKey: () => fetchMerchantPublicKey,
|
|
490
489
|
fetchProviders: () => fetchProviders,
|
|
491
490
|
fetchTransfer: () => fetchTransfer,
|
|
492
491
|
fetchUserConfig: () => fetchUserConfig,
|
|
493
492
|
getGuestTransfer: () => getGuestTransfer,
|
|
494
493
|
getTransferByGuestToken: () => getTransferByGuestToken,
|
|
494
|
+
postGuestTransferFeeQuote: () => postGuestTransferFeeQuote,
|
|
495
|
+
putGuestTransferSender: () => putGuestTransferSender,
|
|
495
496
|
registerPasskey: () => registerPasskey,
|
|
496
497
|
reportActionCompletion: () => reportActionCompletion,
|
|
497
498
|
reportPasskeyActivity: () => reportPasskeyActivity,
|
|
@@ -746,18 +747,37 @@ async function getTransferByGuestToken(apiBaseUrl, guestToken) {
|
|
|
746
747
|
if (!res.ok) await throwApiError(res);
|
|
747
748
|
return await res.json();
|
|
748
749
|
}
|
|
749
|
-
async function
|
|
750
|
+
async function postGuestTransferFeeQuote(apiBaseUrl, transferId, guestSessionToken, senderAddress, sourceChainId, sourceToken) {
|
|
751
|
+
const res = await fetch(`${apiBaseUrl}/v1/transfers/${transferId}/quotes`, {
|
|
752
|
+
method: "POST",
|
|
753
|
+
headers: {
|
|
754
|
+
"Content-Type": "application/json",
|
|
755
|
+
"x-guest-session-token": guestSessionToken
|
|
756
|
+
},
|
|
757
|
+
body: JSON.stringify({ senderAddress, sourceChainId, sourceToken })
|
|
758
|
+
});
|
|
759
|
+
if (!res.ok) await throwApiError(res);
|
|
760
|
+
return await res.json();
|
|
761
|
+
}
|
|
762
|
+
async function putGuestTransferSender(apiBaseUrl, transferId, guestSessionToken, body) {
|
|
750
763
|
const res = await fetch(`${apiBaseUrl}/v1/transfers/${transferId}/sender`, {
|
|
751
764
|
method: "PUT",
|
|
752
765
|
headers: {
|
|
753
766
|
"Content-Type": "application/json",
|
|
754
767
|
"x-guest-session-token": guestSessionToken
|
|
755
768
|
},
|
|
756
|
-
body: JSON.stringify(
|
|
769
|
+
body: JSON.stringify(body)
|
|
757
770
|
});
|
|
758
771
|
if (!res.ok) await throwApiError(res);
|
|
759
772
|
return await res.json();
|
|
760
773
|
}
|
|
774
|
+
async function setTransferSender(apiBaseUrl, transferId, guestSessionToken, senderAddress, sourceChainId, sourceToken) {
|
|
775
|
+
return putGuestTransferSender(apiBaseUrl, transferId, guestSessionToken, {
|
|
776
|
+
senderAddress,
|
|
777
|
+
sourceChainId,
|
|
778
|
+
sourceToken
|
|
779
|
+
});
|
|
780
|
+
}
|
|
761
781
|
async function signGuestTransfer(apiBaseUrl, transferId, guestSessionToken, originTxHash) {
|
|
762
782
|
const res = await fetch(`${apiBaseUrl}/v1/transfers/${transferId}`, {
|
|
763
783
|
method: "PATCH",
|
|
@@ -779,20 +799,6 @@ async function getGuestTransfer(apiBaseUrl, transferId, guestSessionToken) {
|
|
|
779
799
|
if (!res.ok) await throwApiError(res);
|
|
780
800
|
return await res.json();
|
|
781
801
|
}
|
|
782
|
-
async function fetchGuestTransferBalances(apiBaseUrl, transferId, guestSessionToken, walletAddress) {
|
|
783
|
-
const params = new URLSearchParams({ walletAddress });
|
|
784
|
-
const res = await fetch(
|
|
785
|
-
`${apiBaseUrl}/v1/transfers/${transferId}/balances?${params.toString()}`,
|
|
786
|
-
{
|
|
787
|
-
headers: {
|
|
788
|
-
"x-guest-session-token": guestSessionToken
|
|
789
|
-
}
|
|
790
|
-
}
|
|
791
|
-
);
|
|
792
|
-
if (!res.ok) await throwApiError(res);
|
|
793
|
-
const data = await res.json();
|
|
794
|
-
return data.items;
|
|
795
|
-
}
|
|
796
802
|
async function fetchGuestAccount(apiBaseUrl, guestToken) {
|
|
797
803
|
const params = new URLSearchParams({ guestToken });
|
|
798
804
|
const res = await fetch(`${apiBaseUrl}/v1/accounts?${params.toString()}`);
|
|
@@ -3510,10 +3516,15 @@ function LoginScreen({
|
|
|
3510
3516
|
error,
|
|
3511
3517
|
onBack,
|
|
3512
3518
|
merchantInitials,
|
|
3513
|
-
onSocialLogin
|
|
3519
|
+
onSocialLogin,
|
|
3520
|
+
heroTitle,
|
|
3521
|
+
heroSubtitle,
|
|
3522
|
+
inputPlaceholder
|
|
3514
3523
|
}) {
|
|
3515
3524
|
const { tokens } = useBlinkConfig();
|
|
3516
3525
|
const disabled = authInput.trim().length === 0 || sending;
|
|
3526
|
+
const heading = heroTitle ?? "Your Money. Any App.\nOne Tap.";
|
|
3527
|
+
const placeholder = inputPlaceholder ?? "Email or phone number";
|
|
3517
3528
|
return /* @__PURE__ */ jsxs(
|
|
3518
3529
|
ScreenLayout,
|
|
3519
3530
|
{
|
|
@@ -3548,7 +3559,8 @@ function LoginScreen({
|
|
|
3548
3559
|
),
|
|
3549
3560
|
/* @__PURE__ */ jsxs("div", { style: contentStyle, children: [
|
|
3550
3561
|
/* @__PURE__ */ jsx("img", { src: BLINK_LOGO, alt: "Blink", style: logoStyle }),
|
|
3551
|
-
/* @__PURE__ */ jsx("h2", { style: headingStyle(tokens.text), children:
|
|
3562
|
+
/* @__PURE__ */ jsx("h2", { style: headingStyle(tokens.text), children: heading }),
|
|
3563
|
+
heroSubtitle ? /* @__PURE__ */ jsx("p", { style: subtitleStyle(tokens.textMuted), children: heroSubtitle }) : null,
|
|
3552
3564
|
error && /* @__PURE__ */ jsx("div", { style: errorStyle(tokens), children: error }),
|
|
3553
3565
|
/* @__PURE__ */ jsx(
|
|
3554
3566
|
"input",
|
|
@@ -3557,7 +3569,7 @@ function LoginScreen({
|
|
|
3557
3569
|
type: "text",
|
|
3558
3570
|
inputMode: "text",
|
|
3559
3571
|
autoComplete: "username",
|
|
3560
|
-
placeholder
|
|
3572
|
+
placeholder,
|
|
3561
3573
|
value: authInput,
|
|
3562
3574
|
onChange: (e) => onAuthInputChange(e.target.value),
|
|
3563
3575
|
onKeyDown: (e) => {
|
|
@@ -3602,6 +3614,14 @@ var headingStyle = (color) => ({
|
|
|
3602
3614
|
margin: "20px 0 8px",
|
|
3603
3615
|
whiteSpace: "pre-line"
|
|
3604
3616
|
});
|
|
3617
|
+
var subtitleStyle = (color) => ({
|
|
3618
|
+
fontSize: "0.9rem",
|
|
3619
|
+
fontWeight: 500,
|
|
3620
|
+
lineHeight: 1.45,
|
|
3621
|
+
color,
|
|
3622
|
+
margin: "0 0 16px",
|
|
3623
|
+
maxWidth: 320
|
|
3624
|
+
});
|
|
3605
3625
|
var inputStyle2 = (tokens) => ({
|
|
3606
3626
|
width: "100%",
|
|
3607
3627
|
padding: "15px 16px",
|
|
@@ -3724,7 +3744,7 @@ function OtpVerifyScreen({
|
|
|
3724
3744
|
/* @__PURE__ */ jsx(ScreenHeader, { onBack }),
|
|
3725
3745
|
/* @__PURE__ */ jsxs("div", { style: contentStyle2, children: [
|
|
3726
3746
|
/* @__PURE__ */ jsx("h2", { style: headingStyle2(tokens.text), children: "Confirm it is you" }),
|
|
3727
|
-
/* @__PURE__ */ jsxs("p", { style:
|
|
3747
|
+
/* @__PURE__ */ jsxs("p", { style: subtitleStyle2(tokens.textSecondary), children: [
|
|
3728
3748
|
"We sent a 6-digit code to",
|
|
3729
3749
|
"\n",
|
|
3730
3750
|
/* @__PURE__ */ jsx("strong", { children: maskedIdentifier })
|
|
@@ -3760,7 +3780,7 @@ var headingStyle2 = (color) => ({
|
|
|
3760
3780
|
color,
|
|
3761
3781
|
margin: "20px 0 8px"
|
|
3762
3782
|
});
|
|
3763
|
-
var
|
|
3783
|
+
var subtitleStyle2 = (color) => ({
|
|
3764
3784
|
fontSize: "0.88rem",
|
|
3765
3785
|
color,
|
|
3766
3786
|
margin: "0 0 28px",
|
|
@@ -3813,7 +3833,7 @@ function PasskeyScreen({
|
|
|
3813
3833
|
/* @__PURE__ */ jsx(ScreenHeader, { onBack, onLogout }),
|
|
3814
3834
|
/* @__PURE__ */ jsxs("div", { style: contentStyle3, children: [
|
|
3815
3835
|
/* @__PURE__ */ jsx("h2", { style: headingStyle3(tokens.text), children: "Secure your account with a passkey" }),
|
|
3816
|
-
/* @__PURE__ */ jsx("p", { style:
|
|
3836
|
+
/* @__PURE__ */ jsx("p", { style: subtitleStyle3(tokens.textSecondary), children: "This enables secure one-tap deposits on this device" }),
|
|
3817
3837
|
error && /* @__PURE__ */ jsx("div", { style: errorBannerStyle2(tokens), children: error })
|
|
3818
3838
|
] })
|
|
3819
3839
|
]
|
|
@@ -3835,7 +3855,7 @@ var headingStyle3 = (color) => ({
|
|
|
3835
3855
|
color,
|
|
3836
3856
|
margin: "24px 0 8px"
|
|
3837
3857
|
});
|
|
3838
|
-
var
|
|
3858
|
+
var subtitleStyle3 = (color) => ({
|
|
3839
3859
|
fontSize: "0.86rem",
|
|
3840
3860
|
color,
|
|
3841
3861
|
margin: "0 0 20px",
|
|
@@ -3853,6 +3873,72 @@ var errorBannerStyle2 = (tokens) => ({
|
|
|
3853
3873
|
width: "100%",
|
|
3854
3874
|
textAlign: "left"
|
|
3855
3875
|
});
|
|
3876
|
+
function VerifyPasskeyScreen({
|
|
3877
|
+
onVerify,
|
|
3878
|
+
onBack,
|
|
3879
|
+
verifying,
|
|
3880
|
+
error
|
|
3881
|
+
}) {
|
|
3882
|
+
const { tokens } = useBlinkConfig();
|
|
3883
|
+
return /* @__PURE__ */ jsxs(
|
|
3884
|
+
ScreenLayout,
|
|
3885
|
+
{
|
|
3886
|
+
footer: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3887
|
+
/* @__PURE__ */ jsx(PrimaryButton, { onClick: onVerify, disabled: verifying, loading: verifying, children: "Verify passkey" }),
|
|
3888
|
+
/* @__PURE__ */ jsx(PoweredByFooter, {})
|
|
3889
|
+
] }),
|
|
3890
|
+
children: [
|
|
3891
|
+
/* @__PURE__ */ jsx(ScreenHeader, { onBack }),
|
|
3892
|
+
/* @__PURE__ */ jsxs("div", { style: contentStyle4, children: [
|
|
3893
|
+
/* @__PURE__ */ jsx(IconCircle, { variant: "accent", size: 64, children: /* @__PURE__ */ jsxs("svg", { width: "36", height: "36", viewBox: "0 0 24 24", fill: "none", children: [
|
|
3894
|
+
/* @__PURE__ */ jsx("rect", { x: "4", y: "4", width: "16", height: "16", rx: "3", stroke: tokens.accent, strokeWidth: "1.5", strokeDasharray: "3 2" }),
|
|
3895
|
+
/* @__PURE__ */ jsx("circle", { cx: "9", cy: "10", r: "1", fill: tokens.accent }),
|
|
3896
|
+
/* @__PURE__ */ jsx("circle", { cx: "15", cy: "10", r: "1", fill: tokens.accent }),
|
|
3897
|
+
/* @__PURE__ */ jsx("path", { d: "M9 14c0 1.5 1.34 2.5 3 2.5s3-1 3-2.5", stroke: tokens.accent, strokeWidth: "1.2", strokeLinecap: "round" })
|
|
3898
|
+
] }) }),
|
|
3899
|
+
/* @__PURE__ */ jsx("h2", { style: headingStyle4(tokens.text), children: "Verify your passkey" }),
|
|
3900
|
+
/* @__PURE__ */ jsx("p", { style: subtitleStyle4(tokens.textSecondary), children: "Your browser requires a separate window to verify your passkey. Tap the button below to continue." }),
|
|
3901
|
+
error && /* @__PURE__ */ jsx("div", { style: errorBannerStyle3(tokens), children: error }),
|
|
3902
|
+
/* @__PURE__ */ jsx(InfoBanner, { children: "Your passkey is stored securely on your device. Blink never sees your biometric data." })
|
|
3903
|
+
] })
|
|
3904
|
+
]
|
|
3905
|
+
}
|
|
3906
|
+
);
|
|
3907
|
+
}
|
|
3908
|
+
var contentStyle4 = {
|
|
3909
|
+
textAlign: "center",
|
|
3910
|
+
flex: 1,
|
|
3911
|
+
display: "flex",
|
|
3912
|
+
flexDirection: "column",
|
|
3913
|
+
alignItems: "center",
|
|
3914
|
+
paddingTop: 32
|
|
3915
|
+
};
|
|
3916
|
+
var headingStyle4 = (color) => ({
|
|
3917
|
+
fontSize: "1.45rem",
|
|
3918
|
+
fontWeight: 700,
|
|
3919
|
+
letterSpacing: "-0.02em",
|
|
3920
|
+
color,
|
|
3921
|
+
margin: "24px 0 8px"
|
|
3922
|
+
});
|
|
3923
|
+
var subtitleStyle4 = (color) => ({
|
|
3924
|
+
fontSize: "0.9rem",
|
|
3925
|
+
color,
|
|
3926
|
+
margin: "0 0 28px",
|
|
3927
|
+
lineHeight: 1.5,
|
|
3928
|
+
maxWidth: 280
|
|
3929
|
+
});
|
|
3930
|
+
var errorBannerStyle3 = (tokens) => ({
|
|
3931
|
+
background: tokens.errorBg,
|
|
3932
|
+
border: `1px solid ${tokens.error}66`,
|
|
3933
|
+
borderRadius: 16,
|
|
3934
|
+
padding: "11px 14px",
|
|
3935
|
+
color: tokens.error,
|
|
3936
|
+
fontSize: "0.84rem",
|
|
3937
|
+
marginBottom: 14,
|
|
3938
|
+
lineHeight: 1.5,
|
|
3939
|
+
width: "100%",
|
|
3940
|
+
textAlign: "left"
|
|
3941
|
+
});
|
|
3856
3942
|
function Spinner({ size = 40, label }) {
|
|
3857
3943
|
const { tokens } = useBlinkConfig();
|
|
3858
3944
|
return /* @__PURE__ */ jsxs(
|
|
@@ -3996,8 +4082,8 @@ function WalletPickerScreen({
|
|
|
3996
4082
|
children: [
|
|
3997
4083
|
/* @__PURE__ */ jsx(ScreenHeader, { title: "Set up Blink", onBack, onLogout }),
|
|
3998
4084
|
hasPending && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3999
|
-
/* @__PURE__ */ jsx("h2", { style:
|
|
4000
|
-
/* @__PURE__ */ jsx("p", { style:
|
|
4085
|
+
/* @__PURE__ */ jsx("h2", { style: headingStyle5(tokens.text), children: "Continue where you left off" }),
|
|
4086
|
+
/* @__PURE__ */ jsx("p", { style: subtitleStyle5(tokens.textSecondary), children: "You have a wallet that still needs setup" }),
|
|
4001
4087
|
/* @__PURE__ */ jsx("div", { style: pendingListStyle, children: pendingConnections.map((acct) => {
|
|
4002
4088
|
const wallet = acct.wallets[0];
|
|
4003
4089
|
const address = wallet ? truncateAddress(wallet.name) : void 0;
|
|
@@ -4036,7 +4122,7 @@ function WalletPickerScreen({
|
|
|
4036
4122
|
}) }),
|
|
4037
4123
|
/* @__PURE__ */ jsx("div", { style: dividerStyle2(tokens.border), children: /* @__PURE__ */ jsx("span", { style: dividerTextStyle(tokens.textMuted), children: "Or connect a new wallet" }) })
|
|
4038
4124
|
] }),
|
|
4039
|
-
!hasPending && /* @__PURE__ */ jsx("h2", { style:
|
|
4125
|
+
!hasPending && /* @__PURE__ */ jsx("h2", { style: headingStyle5(tokens.text), children: "Where is your money?" }),
|
|
4040
4126
|
/* @__PURE__ */ jsxs(
|
|
4041
4127
|
"button",
|
|
4042
4128
|
{
|
|
@@ -4107,14 +4193,14 @@ function WalletPickerScreen({
|
|
|
4107
4193
|
}
|
|
4108
4194
|
);
|
|
4109
4195
|
}
|
|
4110
|
-
var
|
|
4196
|
+
var headingStyle5 = (color) => ({
|
|
4111
4197
|
fontSize: "1.35rem",
|
|
4112
4198
|
fontWeight: 700,
|
|
4113
4199
|
letterSpacing: "-0.02em",
|
|
4114
4200
|
color,
|
|
4115
4201
|
margin: "8px 0 4px"
|
|
4116
4202
|
});
|
|
4117
|
-
var
|
|
4203
|
+
var subtitleStyle5 = (color) => ({
|
|
4118
4204
|
fontSize: "0.88rem",
|
|
4119
4205
|
color,
|
|
4120
4206
|
margin: "0 0 24px"
|
|
@@ -4350,8 +4436,8 @@ function SetupScreen({
|
|
|
4350
4436
|
] }),
|
|
4351
4437
|
children: [
|
|
4352
4438
|
/* @__PURE__ */ jsx(ScreenHeader, { onBack, onLogout }),
|
|
4353
|
-
/* @__PURE__ */ jsx("h2", { style:
|
|
4354
|
-
error && /* @__PURE__ */ jsx("div", { style:
|
|
4439
|
+
/* @__PURE__ */ jsx("h2", { style: headingStyle6(tokens.text), children: "Set Spending Limit" }),
|
|
4440
|
+
error && /* @__PURE__ */ jsx("div", { style: errorBannerStyle4(tokens), children: error }),
|
|
4355
4441
|
/* @__PURE__ */ jsxs("div", { style: amountRowStyle, children: [
|
|
4356
4442
|
/* @__PURE__ */ jsx("div", { style: { flex: 1 }, children: editing ? /* @__PURE__ */ jsxs("div", { style: limitValueStyle(tokens.text), children: [
|
|
4357
4443
|
"$",
|
|
@@ -4426,7 +4512,7 @@ function SetupScreen({
|
|
|
4426
4512
|
}
|
|
4427
4513
|
);
|
|
4428
4514
|
}
|
|
4429
|
-
var
|
|
4515
|
+
var headingStyle6 = (color) => ({
|
|
4430
4516
|
fontSize: "1.1rem",
|
|
4431
4517
|
fontWeight: 700,
|
|
4432
4518
|
letterSpacing: "-0.02em",
|
|
@@ -4434,7 +4520,7 @@ var headingStyle5 = (color) => ({
|
|
|
4434
4520
|
margin: "8px 0 24px",
|
|
4435
4521
|
textAlign: "center"
|
|
4436
4522
|
});
|
|
4437
|
-
var
|
|
4523
|
+
var errorBannerStyle4 = (tokens) => ({
|
|
4438
4524
|
background: tokens.errorBg,
|
|
4439
4525
|
border: `1px solid ${tokens.error}66`,
|
|
4440
4526
|
borderRadius: 16,
|
|
@@ -4525,10 +4611,10 @@ function SetupStatusScreen({
|
|
|
4525
4611
|
if (complete) {
|
|
4526
4612
|
return /* @__PURE__ */ jsxs(ScreenLayout, { footer: /* @__PURE__ */ jsx(PoweredByFooter, {}), children: [
|
|
4527
4613
|
/* @__PURE__ */ jsx(ScreenHeader, { onBack: onContinue }),
|
|
4528
|
-
/* @__PURE__ */ jsxs("div", { style:
|
|
4614
|
+
/* @__PURE__ */ jsxs("div", { style: contentStyle5, children: [
|
|
4529
4615
|
/* @__PURE__ */ jsx("img", { src: BLINK_LOGO, alt: "Blink", style: mascotStyle2 }),
|
|
4530
|
-
/* @__PURE__ */ jsx("h2", { style:
|
|
4531
|
-
/* @__PURE__ */ jsx("p", { style:
|
|
4616
|
+
/* @__PURE__ */ jsx("h2", { style: headingStyle7(tokens.text), children: "Done!" }),
|
|
4617
|
+
/* @__PURE__ */ jsx("p", { style: subtitleStyle6(tokens.textSecondary), children: "Return to the app to try one-tap deposits." })
|
|
4532
4618
|
] })
|
|
4533
4619
|
] });
|
|
4534
4620
|
}
|
|
@@ -4538,16 +4624,16 @@ function SetupStatusScreen({
|
|
|
4538
4624
|
];
|
|
4539
4625
|
return /* @__PURE__ */ jsxs(ScreenLayout, { children: [
|
|
4540
4626
|
/* @__PURE__ */ jsx(ScreenHeader, { onLogout }),
|
|
4541
|
-
/* @__PURE__ */ jsxs("div", { style:
|
|
4627
|
+
/* @__PURE__ */ jsxs("div", { style: contentStyle5, children: [
|
|
4542
4628
|
/* @__PURE__ */ jsx(Spinner, { size: 48 }),
|
|
4543
|
-
/* @__PURE__ */ jsx("h2", { style:
|
|
4544
|
-
error && /* @__PURE__ */ jsx("div", { style:
|
|
4629
|
+
/* @__PURE__ */ jsx("h2", { style: headingStyle7(tokens.text), children: "Setting up One-Tap..." }),
|
|
4630
|
+
error && /* @__PURE__ */ jsx("div", { style: errorBannerStyle5(tokens), children: error }),
|
|
4545
4631
|
/* @__PURE__ */ jsx("div", { style: stepsWrapStyle, children: /* @__PURE__ */ jsx(StepList, { steps }) }),
|
|
4546
4632
|
/* @__PURE__ */ jsx("p", { style: waitHintStyle(tokens.textMuted), children: "Usually takes a few seconds" })
|
|
4547
4633
|
] })
|
|
4548
4634
|
] });
|
|
4549
4635
|
}
|
|
4550
|
-
var
|
|
4636
|
+
var contentStyle5 = {
|
|
4551
4637
|
flex: 1,
|
|
4552
4638
|
display: "flex",
|
|
4553
4639
|
flexDirection: "column",
|
|
@@ -4560,21 +4646,21 @@ var mascotStyle2 = {
|
|
|
4560
4646
|
width: 56,
|
|
4561
4647
|
height: 56
|
|
4562
4648
|
};
|
|
4563
|
-
var
|
|
4649
|
+
var headingStyle7 = (color) => ({
|
|
4564
4650
|
fontSize: "1.45rem",
|
|
4565
4651
|
fontWeight: 700,
|
|
4566
4652
|
letterSpacing: "-0.02em",
|
|
4567
4653
|
color,
|
|
4568
4654
|
margin: "20px 0 8px"
|
|
4569
4655
|
});
|
|
4570
|
-
var
|
|
4656
|
+
var subtitleStyle6 = (color) => ({
|
|
4571
4657
|
fontSize: "0.9rem",
|
|
4572
4658
|
color,
|
|
4573
4659
|
margin: "0 0 28px",
|
|
4574
4660
|
lineHeight: 1.5,
|
|
4575
4661
|
maxWidth: 260
|
|
4576
4662
|
});
|
|
4577
|
-
var
|
|
4663
|
+
var errorBannerStyle5 = (tokens) => ({
|
|
4578
4664
|
background: tokens.errorBg,
|
|
4579
4665
|
border: `1px solid ${tokens.error}66`,
|
|
4580
4666
|
borderRadius: 16,
|
|
@@ -4779,7 +4865,7 @@ function DepositScreen({
|
|
|
4779
4865
|
minDepositFloor.toFixed(2),
|
|
4780
4866
|
" to deposit via One-Tap."
|
|
4781
4867
|
] }),
|
|
4782
|
-
error && /* @__PURE__ */ jsx("div", { style:
|
|
4868
|
+
error && /* @__PURE__ */ jsx("div", { style: errorBannerStyle6(tokens), children: error })
|
|
4783
4869
|
]
|
|
4784
4870
|
}
|
|
4785
4871
|
);
|
|
@@ -4965,7 +5051,7 @@ var spendingLimitStyle = (color) => ({
|
|
|
4965
5051
|
color,
|
|
4966
5052
|
marginBottom: 8
|
|
4967
5053
|
});
|
|
4968
|
-
var
|
|
5054
|
+
var errorBannerStyle6 = (tokens) => ({
|
|
4969
5055
|
background: tokens.errorBg,
|
|
4970
5056
|
border: `1px solid ${tokens.error}66`,
|
|
4971
5057
|
borderRadius: 16,
|
|
@@ -5010,22 +5096,22 @@ function SuccessScreen({
|
|
|
5010
5096
|
] }),
|
|
5011
5097
|
children: [
|
|
5012
5098
|
/* @__PURE__ */ jsx(ScreenHeader, { onLogout }),
|
|
5013
|
-
/* @__PURE__ */ jsxs("div", { style:
|
|
5099
|
+
/* @__PURE__ */ jsxs("div", { style: contentStyle6, children: [
|
|
5014
5100
|
succeeded ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5015
5101
|
/* @__PURE__ */ jsx(IconCircle, { variant: "success", size: 64, children: /* @__PURE__ */ jsx("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z", fill: tokens.success }) }) }),
|
|
5016
|
-
/* @__PURE__ */ jsxs("h2", { style:
|
|
5102
|
+
/* @__PURE__ */ jsxs("h2", { style: headingStyle8(tokens.text), children: [
|
|
5017
5103
|
"$",
|
|
5018
5104
|
amount.toFixed(2),
|
|
5019
5105
|
" deposited"
|
|
5020
5106
|
] }),
|
|
5021
|
-
merchantName && /* @__PURE__ */ jsxs("p", { style:
|
|
5107
|
+
merchantName && /* @__PURE__ */ jsxs("p", { style: subtitleStyle7(tokens.textSecondary), children: [
|
|
5022
5108
|
"to ",
|
|
5023
5109
|
merchantName
|
|
5024
5110
|
] })
|
|
5025
5111
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5026
5112
|
/* @__PURE__ */ jsx(IconCircle, { variant: "error", size: 64, children: /* @__PURE__ */ jsx("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z", fill: tokens.error }) }) }),
|
|
5027
|
-
/* @__PURE__ */ jsx("h2", { style:
|
|
5028
|
-
error && /* @__PURE__ */ jsx("p", { style:
|
|
5113
|
+
/* @__PURE__ */ jsx("h2", { style: headingStyle8(tokens.text), children: "Transfer failed" }),
|
|
5114
|
+
error && /* @__PURE__ */ jsx("p", { style: subtitleStyle7(tokens.error), children: error })
|
|
5029
5115
|
] }),
|
|
5030
5116
|
/* @__PURE__ */ jsxs("div", { style: summaryCardStyle(tokens), children: [
|
|
5031
5117
|
sourceName && /* @__PURE__ */ jsxs("div", { style: summaryRowStyle, children: [
|
|
@@ -5057,21 +5143,21 @@ function SuccessScreen({
|
|
|
5057
5143
|
}
|
|
5058
5144
|
);
|
|
5059
5145
|
}
|
|
5060
|
-
var
|
|
5146
|
+
var contentStyle6 = {
|
|
5061
5147
|
flex: 1,
|
|
5062
5148
|
display: "flex",
|
|
5063
5149
|
flexDirection: "column",
|
|
5064
5150
|
alignItems: "center",
|
|
5065
5151
|
paddingTop: 16
|
|
5066
5152
|
};
|
|
5067
|
-
var
|
|
5153
|
+
var headingStyle8 = (color) => ({
|
|
5068
5154
|
fontSize: "1.5rem",
|
|
5069
5155
|
fontWeight: 700,
|
|
5070
5156
|
letterSpacing: "-0.02em",
|
|
5071
5157
|
color,
|
|
5072
5158
|
margin: "20px 0 4px"
|
|
5073
5159
|
});
|
|
5074
|
-
var
|
|
5160
|
+
var subtitleStyle7 = (color) => ({
|
|
5075
5161
|
fontSize: "0.9rem",
|
|
5076
5162
|
color,
|
|
5077
5163
|
margin: "0 0 20px"
|
|
@@ -5185,7 +5271,7 @@ function SelectSourceScreen({
|
|
|
5185
5271
|
onLogout
|
|
5186
5272
|
}
|
|
5187
5273
|
),
|
|
5188
|
-
/* @__PURE__ */ jsx("p", { style:
|
|
5274
|
+
/* @__PURE__ */ jsx("p", { style: subtitleStyle8(tokens.textMuted), children: "Choose which chain and token to pay from." }),
|
|
5189
5275
|
/* @__PURE__ */ jsx("label", { style: labelStyle4(tokens.textSecondary), children: "Chain" }),
|
|
5190
5276
|
/* @__PURE__ */ jsx("div", { style: optionListStyle, children: choices.map((chain) => {
|
|
5191
5277
|
const isSelected = chain.chainName === selectedChainName;
|
|
@@ -5246,7 +5332,7 @@ function SelectSourceScreen({
|
|
|
5246
5332
|
}
|
|
5247
5333
|
);
|
|
5248
5334
|
}
|
|
5249
|
-
var
|
|
5335
|
+
var subtitleStyle8 = (color) => ({
|
|
5250
5336
|
fontSize: "0.85rem",
|
|
5251
5337
|
color,
|
|
5252
5338
|
margin: "0 0 20px",
|
|
@@ -5388,8 +5474,8 @@ function AdvancedSourceScreen({
|
|
|
5388
5474
|
right: /* @__PURE__ */ jsx("span", { style: advancedBadgeStyle(tokens.accent), children: "Advanced" })
|
|
5389
5475
|
}
|
|
5390
5476
|
),
|
|
5391
|
-
/* @__PURE__ */ jsx("h2", { style:
|
|
5392
|
-
/* @__PURE__ */ jsx("p", { style:
|
|
5477
|
+
/* @__PURE__ */ jsx("h2", { style: headingStyle9(tokens.text), children: "Set up One-Tap deposits" }),
|
|
5478
|
+
/* @__PURE__ */ jsx("p", { style: subtitleStyle9(tokens.textSecondary), children: "Select a token source for your One-Tap deposits." }),
|
|
5393
5479
|
/* @__PURE__ */ jsx("label", { style: labelStyle5(tokens.textSecondary), children: "Select tokens to approve" }),
|
|
5394
5480
|
/* @__PURE__ */ jsx("div", { style: chainListStyle, children: choices.map((chain) => {
|
|
5395
5481
|
const isExpanded = expandedChain === chain.chainName;
|
|
@@ -5452,14 +5538,14 @@ var advancedBadgeStyle = (color) => ({
|
|
|
5452
5538
|
padding: "3px 10px",
|
|
5453
5539
|
letterSpacing: "0.02em"
|
|
5454
5540
|
});
|
|
5455
|
-
var
|
|
5541
|
+
var headingStyle9 = (color) => ({
|
|
5456
5542
|
fontSize: "1.3rem",
|
|
5457
5543
|
fontWeight: 700,
|
|
5458
5544
|
letterSpacing: "-0.02em",
|
|
5459
5545
|
color,
|
|
5460
5546
|
margin: "8px 0 4px"
|
|
5461
5547
|
});
|
|
5462
|
-
var
|
|
5548
|
+
var subtitleStyle9 = (color) => ({
|
|
5463
5549
|
fontSize: "0.86rem",
|
|
5464
5550
|
color,
|
|
5465
5551
|
margin: "0 0 20px",
|
|
@@ -5587,15 +5673,15 @@ function TransferStatusScreen({
|
|
|
5587
5673
|
const steps = buildSteps(phase);
|
|
5588
5674
|
return /* @__PURE__ */ jsxs(ScreenLayout, { footer: /* @__PURE__ */ jsx(PoweredByFooter, {}), children: [
|
|
5589
5675
|
/* @__PURE__ */ jsx(ScreenHeader, { onLogout }),
|
|
5590
|
-
/* @__PURE__ */ jsxs("div", { style:
|
|
5676
|
+
/* @__PURE__ */ jsxs("div", { style: contentStyle7, children: [
|
|
5591
5677
|
/* @__PURE__ */ jsx(Spinner, { size: 64 }),
|
|
5592
|
-
/* @__PURE__ */ jsx("h2", { style:
|
|
5593
|
-
error && /* @__PURE__ */ jsx("div", { style:
|
|
5678
|
+
/* @__PURE__ */ jsx("h2", { style: headingStyle10(tokens.text), children: "Depositing your money..." }),
|
|
5679
|
+
error && /* @__PURE__ */ jsx("div", { style: errorBannerStyle7(tokens), children: error }),
|
|
5594
5680
|
/* @__PURE__ */ jsx("div", { style: stepsWrapStyle2, children: /* @__PURE__ */ jsx(StepList, { steps }) })
|
|
5595
5681
|
] })
|
|
5596
5682
|
] });
|
|
5597
5683
|
}
|
|
5598
|
-
var
|
|
5684
|
+
var contentStyle7 = {
|
|
5599
5685
|
flex: 1,
|
|
5600
5686
|
display: "flex",
|
|
5601
5687
|
flexDirection: "column",
|
|
@@ -5604,14 +5690,14 @@ var contentStyle6 = {
|
|
|
5604
5690
|
textAlign: "center",
|
|
5605
5691
|
padding: "0 24px"
|
|
5606
5692
|
};
|
|
5607
|
-
var
|
|
5693
|
+
var headingStyle10 = (color) => ({
|
|
5608
5694
|
fontSize: "1.45rem",
|
|
5609
5695
|
fontWeight: 700,
|
|
5610
5696
|
letterSpacing: "-0.02em",
|
|
5611
5697
|
color,
|
|
5612
5698
|
margin: "20px 0 16px"
|
|
5613
5699
|
});
|
|
5614
|
-
var
|
|
5700
|
+
var errorBannerStyle7 = (tokens) => ({
|
|
5615
5701
|
background: tokens.errorBg,
|
|
5616
5702
|
border: `1px solid ${tokens.error}66`,
|
|
5617
5703
|
borderRadius: 16,
|
|
@@ -5665,14 +5751,14 @@ function OpenWalletScreen({
|
|
|
5665
5751
|
] }),
|
|
5666
5752
|
children: [
|
|
5667
5753
|
/* @__PURE__ */ jsx(ScreenHeader, { onLogout }),
|
|
5668
|
-
/* @__PURE__ */ jsxs("div", { style:
|
|
5754
|
+
/* @__PURE__ */ jsxs("div", { style: contentStyle8, children: [
|
|
5669
5755
|
/* @__PURE__ */ jsx("div", { style: logoCircleStyle(tokens.bgInput), children: logoSrc ? /* @__PURE__ */ jsx("img", { src: logoSrc, alt: displayName, style: logoStyle2 }) : /* @__PURE__ */ jsx(Spinner, { size: 32 }) }),
|
|
5670
|
-
/* @__PURE__ */ jsxs("h2", { style:
|
|
5756
|
+
/* @__PURE__ */ jsxs("h2", { style: headingStyle11(tokens.text), children: [
|
|
5671
5757
|
"Setting up ",
|
|
5672
5758
|
displayName,
|
|
5673
5759
|
"..."
|
|
5674
5760
|
] }),
|
|
5675
|
-
/* @__PURE__ */ jsx("p", { style:
|
|
5761
|
+
/* @__PURE__ */ jsx("p", { style: subtitleStyle10(tokens.textSecondary), children: "Approve the connection in your wallet extension." }),
|
|
5676
5762
|
/* @__PURE__ */ jsxs("div", { style: waitingBadgeStyle(tokens), children: [
|
|
5677
5763
|
/* @__PURE__ */ jsx(Spinner, { size: 14 }),
|
|
5678
5764
|
/* @__PURE__ */ jsx("span", { children: "Waiting for authorization..." })
|
|
@@ -5698,10 +5784,10 @@ function OpenWalletScreen({
|
|
|
5698
5784
|
] }),
|
|
5699
5785
|
children: [
|
|
5700
5786
|
/* @__PURE__ */ jsx(ScreenHeader, { onBack, onLogout }),
|
|
5701
|
-
/* @__PURE__ */ jsxs("div", { style:
|
|
5787
|
+
/* @__PURE__ */ jsxs("div", { style: contentStyle8, children: [
|
|
5702
5788
|
/* @__PURE__ */ jsx("div", { style: logoCircleStyle(tokens.bgInput), children: logoSrc ? /* @__PURE__ */ jsx("img", { src: logoSrc, alt: displayName, style: logoStyle2 }) : /* @__PURE__ */ jsx(Spinner, { size: 32 }) }),
|
|
5703
|
-
/* @__PURE__ */ jsx("h2", { style:
|
|
5704
|
-
/* @__PURE__ */ jsx("p", { style:
|
|
5789
|
+
/* @__PURE__ */ jsx("h2", { style: headingStyle11(tokens.text), children: loading ? "Connecting..." : `Open ${displayName}` }),
|
|
5790
|
+
/* @__PURE__ */ jsx("p", { style: subtitleStyle10(tokens.textSecondary), children: loading ? "Creating transfer and preparing your wallet link..." : `Continue in ${displayName} to authorize this connection.` }),
|
|
5705
5791
|
!loading && /* @__PURE__ */ jsxs("div", { style: waitingBadgeStyle(tokens), children: [
|
|
5706
5792
|
/* @__PURE__ */ jsx(Spinner, { size: 14 }),
|
|
5707
5793
|
/* @__PURE__ */ jsx("span", { children: "Waiting for authorization..." })
|
|
@@ -5711,7 +5797,7 @@ function OpenWalletScreen({
|
|
|
5711
5797
|
}
|
|
5712
5798
|
);
|
|
5713
5799
|
}
|
|
5714
|
-
var
|
|
5800
|
+
var contentStyle8 = {
|
|
5715
5801
|
flex: 1,
|
|
5716
5802
|
display: "flex",
|
|
5717
5803
|
flexDirection: "column",
|
|
@@ -5741,14 +5827,14 @@ var logoStyle2 = {
|
|
|
5741
5827
|
borderRadius: 12,
|
|
5742
5828
|
objectFit: "contain"
|
|
5743
5829
|
};
|
|
5744
|
-
var
|
|
5830
|
+
var headingStyle11 = (color) => ({
|
|
5745
5831
|
fontSize: "1.45rem",
|
|
5746
5832
|
fontWeight: 700,
|
|
5747
5833
|
letterSpacing: "-0.02em",
|
|
5748
5834
|
color,
|
|
5749
5835
|
margin: "20px 0 8px"
|
|
5750
5836
|
});
|
|
5751
|
-
var
|
|
5837
|
+
var subtitleStyle10 = (color) => ({
|
|
5752
5838
|
fontSize: "0.9rem",
|
|
5753
5839
|
color,
|
|
5754
5840
|
margin: "0 0 24px",
|
|
@@ -5797,10 +5883,10 @@ function ConfirmSignScreen({
|
|
|
5797
5883
|
] }),
|
|
5798
5884
|
children: [
|
|
5799
5885
|
/* @__PURE__ */ jsx(ScreenHeader, { onLogout }),
|
|
5800
|
-
/* @__PURE__ */ jsxs("div", { style:
|
|
5886
|
+
/* @__PURE__ */ jsxs("div", { style: contentStyle9, children: [
|
|
5801
5887
|
logoSrc ? /* @__PURE__ */ jsx("img", { src: logoSrc, alt: displayName, style: logoStyle3 }) : /* @__PURE__ */ jsx(Spinner, { size: 48 }),
|
|
5802
|
-
/* @__PURE__ */ jsx("h2", { style:
|
|
5803
|
-
/* @__PURE__ */ jsxs("p", { style:
|
|
5888
|
+
/* @__PURE__ */ jsx("h2", { style: headingStyle12(tokens.text), children: "Wallet authorized" }),
|
|
5889
|
+
/* @__PURE__ */ jsxs("p", { style: subtitleStyle11(tokens.textSecondary), children: [
|
|
5804
5890
|
displayName,
|
|
5805
5891
|
" approved the connection. Tap below to confirm your payment."
|
|
5806
5892
|
] }),
|
|
@@ -5813,7 +5899,7 @@ function ConfirmSignScreen({
|
|
|
5813
5899
|
}
|
|
5814
5900
|
);
|
|
5815
5901
|
}
|
|
5816
|
-
var
|
|
5902
|
+
var contentStyle9 = {
|
|
5817
5903
|
flex: 1,
|
|
5818
5904
|
display: "flex",
|
|
5819
5905
|
flexDirection: "column",
|
|
@@ -5828,14 +5914,14 @@ var logoStyle3 = {
|
|
|
5828
5914
|
borderRadius: 14,
|
|
5829
5915
|
objectFit: "contain"
|
|
5830
5916
|
};
|
|
5831
|
-
var
|
|
5917
|
+
var headingStyle12 = (color) => ({
|
|
5832
5918
|
fontSize: "1.45rem",
|
|
5833
5919
|
fontWeight: 700,
|
|
5834
5920
|
letterSpacing: "-0.02em",
|
|
5835
5921
|
color,
|
|
5836
5922
|
margin: "20px 0 8px"
|
|
5837
5923
|
});
|
|
5838
|
-
var
|
|
5924
|
+
var subtitleStyle11 = (color) => ({
|
|
5839
5925
|
fontSize: "0.9rem",
|
|
5840
5926
|
color,
|
|
5841
5927
|
margin: "0 0 24px",
|
|
@@ -6105,60 +6191,232 @@ var selectCircleSelectedStyle = (color) => ({
|
|
|
6105
6191
|
justifyContent: "center",
|
|
6106
6192
|
flexShrink: 0
|
|
6107
6193
|
});
|
|
6194
|
+
function entryKey(entry) {
|
|
6195
|
+
return `${entry.sourceChainId}-${entry.tokenAddress.toLowerCase()}`;
|
|
6196
|
+
}
|
|
6197
|
+
function formatPreciseMoneyForDisplay(fee) {
|
|
6198
|
+
const raw = fee.value.trim();
|
|
6199
|
+
if (fee.currency === "USD") {
|
|
6200
|
+
if (!/^\d+(\.\d*)?$/.test(raw)) {
|
|
6201
|
+
return `$${raw}`;
|
|
6202
|
+
}
|
|
6203
|
+
const [whole, frac = ""] = raw.split(".");
|
|
6204
|
+
const dec = `${frac}00`.slice(0, 2);
|
|
6205
|
+
const intFmt = whole.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
6206
|
+
return `$${intFmt}.${dec}`;
|
|
6207
|
+
}
|
|
6208
|
+
return `${raw} ${fee.currency}`;
|
|
6209
|
+
}
|
|
6108
6210
|
function GuestTokenPickerScreen({
|
|
6109
6211
|
entries,
|
|
6110
6212
|
loading,
|
|
6111
6213
|
setting,
|
|
6112
6214
|
depositAmount,
|
|
6113
6215
|
error,
|
|
6216
|
+
pendingEntry,
|
|
6217
|
+
quoteFee,
|
|
6218
|
+
quoteLoading,
|
|
6114
6219
|
onSelect,
|
|
6115
|
-
|
|
6220
|
+
onConfirm,
|
|
6221
|
+
onBack,
|
|
6222
|
+
defaultTokenListExpanded = false
|
|
6116
6223
|
}) {
|
|
6117
6224
|
const { tokens: t } = useBlinkConfig();
|
|
6225
|
+
const pendingKey = pendingEntry ? entryKey(pendingEntry) : null;
|
|
6226
|
+
const [tokenListOpen, setTokenListOpen] = useState(defaultTokenListExpanded);
|
|
6227
|
+
const pickerRef = useRef(null);
|
|
6228
|
+
useEffect(() => {
|
|
6229
|
+
if (!tokenListOpen) return;
|
|
6230
|
+
const handleMouseDown = (e) => {
|
|
6231
|
+
if (pickerRef.current && !pickerRef.current.contains(e.target)) {
|
|
6232
|
+
setTokenListOpen(false);
|
|
6233
|
+
}
|
|
6234
|
+
};
|
|
6235
|
+
document.addEventListener("mousedown", handleMouseDown);
|
|
6236
|
+
return () => document.removeEventListener("mousedown", handleMouseDown);
|
|
6237
|
+
}, [tokenListOpen]);
|
|
6118
6238
|
if (loading) {
|
|
6119
6239
|
return /* @__PURE__ */ jsxs(ScreenLayout, { children: [
|
|
6120
|
-
/* @__PURE__ */ jsx(ScreenHeader, {
|
|
6240
|
+
/* @__PURE__ */ jsx(ScreenHeader, { onBack }),
|
|
6121
6241
|
/* @__PURE__ */ jsx("div", { style: loadingWrapStyle, children: /* @__PURE__ */ jsx(Spinner, { label: "Loading balances..." }) })
|
|
6122
6242
|
] });
|
|
6123
6243
|
}
|
|
6124
|
-
|
|
6125
|
-
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
|
|
6150
|
-
/* @__PURE__ */
|
|
6151
|
-
|
|
6152
|
-
|
|
6244
|
+
const rowBusy = setting || quoteLoading;
|
|
6245
|
+
const displayEntry = pendingEntry ?? entries[0] ?? null;
|
|
6246
|
+
const canConfirm = Boolean(quoteFee && pendingEntry && !quoteLoading);
|
|
6247
|
+
const feeLine = (() => {
|
|
6248
|
+
if (quoteLoading && pendingEntry) {
|
|
6249
|
+
return /* @__PURE__ */ jsx("div", { style: feeRowStyle(t.textMuted), "aria-live": "polite", children: "Estimating fee\u2026" });
|
|
6250
|
+
}
|
|
6251
|
+
if (quoteFee) {
|
|
6252
|
+
return /* @__PURE__ */ jsxs("div", { style: feeRowStyle(t.textMuted), "aria-live": "polite", children: [
|
|
6253
|
+
"Estimated fee ",
|
|
6254
|
+
formatPreciseMoneyForDisplay(quoteFee)
|
|
6255
|
+
] });
|
|
6256
|
+
}
|
|
6257
|
+
return null;
|
|
6258
|
+
})();
|
|
6259
|
+
return /* @__PURE__ */ jsxs(
|
|
6260
|
+
ScreenLayout,
|
|
6261
|
+
{
|
|
6262
|
+
footer: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6263
|
+
canConfirm && /* @__PURE__ */ jsx(PrimaryButton, { onClick: () => void onConfirm(), loading: setting, disabled: setting, children: "Continue" }),
|
|
6264
|
+
/* @__PURE__ */ jsx(PoweredByFooter, {})
|
|
6265
|
+
] }),
|
|
6266
|
+
children: [
|
|
6267
|
+
/* @__PURE__ */ jsx(ScreenHeader, { onBack }),
|
|
6268
|
+
/* @__PURE__ */ jsxs("div", { ref: pickerRef, children: [
|
|
6269
|
+
/* @__PURE__ */ jsxs("div", { style: depositCardSurfaceStyle(t, tokenListOpen), children: [
|
|
6270
|
+
/* @__PURE__ */ jsx("div", { style: depositLabelStyle3(t.textMuted), children: "Deposit" }),
|
|
6271
|
+
/* @__PURE__ */ jsxs("div", { style: amountBandStyle, children: [
|
|
6272
|
+
/* @__PURE__ */ jsxs("div", { style: amountLeftColStyle, children: [
|
|
6273
|
+
depositAmount != null && /* @__PURE__ */ jsxs("div", { style: depositAmountStyle2(t.text), children: [
|
|
6274
|
+
"$",
|
|
6275
|
+
depositAmount.toLocaleString("en-US", {
|
|
6276
|
+
minimumFractionDigits: 0,
|
|
6277
|
+
maximumFractionDigits: 2
|
|
6278
|
+
})
|
|
6279
|
+
] }),
|
|
6280
|
+
feeLine
|
|
6281
|
+
] }),
|
|
6282
|
+
/* @__PURE__ */ jsxs(
|
|
6283
|
+
"button",
|
|
6284
|
+
{
|
|
6285
|
+
type: "button",
|
|
6286
|
+
onClick: () => entries.length > 0 && setTokenListOpen((o) => !o),
|
|
6287
|
+
disabled: entries.length === 0 || rowBusy,
|
|
6288
|
+
style: tokenTriggerStyle(t, entries.length > 0 && !rowBusy),
|
|
6289
|
+
"aria-expanded": tokenListOpen,
|
|
6290
|
+
"aria-haspopup": "listbox",
|
|
6291
|
+
children: [
|
|
6292
|
+
/* @__PURE__ */ jsx("div", { style: tokenTriggerIconsStyle, children: pendingEntry && TOKEN_LOGOS[pendingEntry.tokenSymbol] ? /* @__PURE__ */ jsx(
|
|
6293
|
+
"img",
|
|
6294
|
+
{
|
|
6295
|
+
src: TOKEN_LOGOS[pendingEntry.tokenSymbol],
|
|
6296
|
+
alt: "",
|
|
6297
|
+
width: 28,
|
|
6298
|
+
height: 28,
|
|
6299
|
+
style: triggerLogoStyle(0)
|
|
6300
|
+
}
|
|
6301
|
+
) : entries[0] && entries[1] && TOKEN_LOGOS[entries[0].tokenSymbol] && TOKEN_LOGOS[entries[1].tokenSymbol] ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6302
|
+
/* @__PURE__ */ jsx(
|
|
6303
|
+
"img",
|
|
6304
|
+
{
|
|
6305
|
+
src: TOKEN_LOGOS[entries[0].tokenSymbol],
|
|
6306
|
+
alt: "",
|
|
6307
|
+
width: 28,
|
|
6308
|
+
height: 28,
|
|
6309
|
+
style: triggerLogoStyle(0)
|
|
6310
|
+
}
|
|
6311
|
+
),
|
|
6312
|
+
/* @__PURE__ */ jsx(
|
|
6313
|
+
"img",
|
|
6314
|
+
{
|
|
6315
|
+
src: TOKEN_LOGOS[entries[1].tokenSymbol],
|
|
6316
|
+
alt: "",
|
|
6317
|
+
width: 28,
|
|
6318
|
+
height: 28,
|
|
6319
|
+
style: triggerLogoStyle(14)
|
|
6320
|
+
}
|
|
6321
|
+
)
|
|
6322
|
+
] }) : displayEntry && TOKEN_LOGOS[displayEntry.tokenSymbol] ? /* @__PURE__ */ jsx(
|
|
6323
|
+
"img",
|
|
6324
|
+
{
|
|
6325
|
+
src: TOKEN_LOGOS[displayEntry.tokenSymbol],
|
|
6326
|
+
alt: "",
|
|
6327
|
+
width: 28,
|
|
6328
|
+
height: 28,
|
|
6329
|
+
style: triggerLogoStyle(0)
|
|
6330
|
+
}
|
|
6331
|
+
) : null }),
|
|
6332
|
+
/* @__PURE__ */ jsx("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", style: { opacity: 0.5 }, children: tokenListOpen ? /* @__PURE__ */ jsx(
|
|
6333
|
+
"path",
|
|
6334
|
+
{
|
|
6335
|
+
d: "M18 15l-6-6-6 6",
|
|
6336
|
+
stroke: t.textMuted,
|
|
6337
|
+
strokeWidth: "2.5",
|
|
6338
|
+
strokeLinecap: "round",
|
|
6339
|
+
strokeLinejoin: "round"
|
|
6340
|
+
}
|
|
6341
|
+
) : /* @__PURE__ */ jsx(
|
|
6342
|
+
"path",
|
|
6343
|
+
{
|
|
6344
|
+
d: "M6 9l6 6 6-6",
|
|
6345
|
+
stroke: t.textMuted,
|
|
6346
|
+
strokeWidth: "2.5",
|
|
6347
|
+
strokeLinecap: "round",
|
|
6348
|
+
strokeLinejoin: "round"
|
|
6349
|
+
}
|
|
6350
|
+
) })
|
|
6351
|
+
]
|
|
6352
|
+
}
|
|
6353
|
+
)
|
|
6153
6354
|
] })
|
|
6154
6355
|
] }),
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
|
|
6356
|
+
tokenListOpen && entries.length > 0 && /* @__PURE__ */ jsxs("div", { style: tokenDropdownOuterStyle(t), children: [
|
|
6357
|
+
/* @__PURE__ */ jsx("div", { style: accountDropdownLabelStyle2(t.textMuted), children: "Choose token" }),
|
|
6358
|
+
/* @__PURE__ */ jsx("div", { style: tokenDropdownInnerStyle(t), children: entries.map((entry, index) => {
|
|
6359
|
+
const selected = pendingKey === entryKey(entry);
|
|
6360
|
+
const isLast = index === entries.length - 1;
|
|
6361
|
+
return /* @__PURE__ */ jsxs(
|
|
6362
|
+
"button",
|
|
6363
|
+
{
|
|
6364
|
+
type: "button",
|
|
6365
|
+
onClick: () => {
|
|
6366
|
+
void onSelect(entry);
|
|
6367
|
+
},
|
|
6368
|
+
disabled: rowBusy,
|
|
6369
|
+
style: pickerRowStyle(t, selected, isLast),
|
|
6370
|
+
children: [
|
|
6371
|
+
/* @__PURE__ */ jsxs("div", { style: pickerRowLeftStyle, children: [
|
|
6372
|
+
/* @__PURE__ */ jsx("div", { style: tokenIconCircleStyle3(t, !!TOKEN_LOGOS[entry.tokenSymbol]), children: TOKEN_LOGOS[entry.tokenSymbol] ? /* @__PURE__ */ jsx(
|
|
6373
|
+
"img",
|
|
6374
|
+
{
|
|
6375
|
+
src: TOKEN_LOGOS[entry.tokenSymbol],
|
|
6376
|
+
alt: entry.tokenSymbol,
|
|
6377
|
+
style: tokenLogoImgStyle3
|
|
6378
|
+
}
|
|
6379
|
+
) : /* @__PURE__ */ jsx("span", { style: tokenIconTextStyle3(t.textMuted), children: "$" }) }),
|
|
6380
|
+
/* @__PURE__ */ jsxs("div", { style: pickerRowInfoStyle, children: [
|
|
6381
|
+
/* @__PURE__ */ jsxs("div", { style: tokenNameRowStyle2, children: [
|
|
6382
|
+
/* @__PURE__ */ jsx("span", { style: tokenSymbolTextStyle2(t.text), children: entry.tokenSymbol }),
|
|
6383
|
+
/* @__PURE__ */ jsx("span", { style: tokenChainDotStyle2(t.textMuted), children: "\xB7" }),
|
|
6384
|
+
/* @__PURE__ */ jsx("span", { style: tokenChainTextStyle2(t.textMuted), children: entry.chainName })
|
|
6385
|
+
] }),
|
|
6386
|
+
/* @__PURE__ */ jsxs("span", { style: tokenBalanceStyle2(t.textMuted), children: [
|
|
6387
|
+
"$",
|
|
6388
|
+
entry.balance.toLocaleString("en-US", {
|
|
6389
|
+
minimumFractionDigits: 2,
|
|
6390
|
+
maximumFractionDigits: 2
|
|
6391
|
+
})
|
|
6392
|
+
] })
|
|
6393
|
+
] })
|
|
6394
|
+
] }),
|
|
6395
|
+
selected ? /* @__PURE__ */ jsxs("svg", { width: "22", height: "22", viewBox: "0 0 22 22", fill: "none", children: [
|
|
6396
|
+
/* @__PURE__ */ jsx("circle", { cx: "11", cy: "11", r: "11", fill: t.success }),
|
|
6397
|
+
/* @__PURE__ */ jsx(
|
|
6398
|
+
"path",
|
|
6399
|
+
{
|
|
6400
|
+
d: "M7 11l3 3 5-5",
|
|
6401
|
+
stroke: "#fff",
|
|
6402
|
+
strokeWidth: "2",
|
|
6403
|
+
strokeLinecap: "round",
|
|
6404
|
+
strokeLinejoin: "round"
|
|
6405
|
+
}
|
|
6406
|
+
)
|
|
6407
|
+
] }) : /* @__PURE__ */ jsx("div", { style: radioEmptyStyle2(t.border) })
|
|
6408
|
+
]
|
|
6409
|
+
},
|
|
6410
|
+
entryKey(entry)
|
|
6411
|
+
);
|
|
6412
|
+
}) })
|
|
6413
|
+
] })
|
|
6414
|
+
] }),
|
|
6415
|
+
error && /* @__PURE__ */ jsx("p", { style: errorStyle3(t.error), children: error }),
|
|
6416
|
+
entries.length === 0 && /* @__PURE__ */ jsx("p", { style: emptyStyle(t.textMuted), children: "No supported tokens found in your wallet. Please ensure you have USDC or USDT." })
|
|
6417
|
+
]
|
|
6418
|
+
}
|
|
6419
|
+
);
|
|
6162
6420
|
}
|
|
6163
6421
|
var loadingWrapStyle = {
|
|
6164
6422
|
textAlign: "center",
|
|
@@ -6168,52 +6426,129 @@ var loadingWrapStyle = {
|
|
|
6168
6426
|
alignItems: "center",
|
|
6169
6427
|
justifyContent: "center"
|
|
6170
6428
|
};
|
|
6171
|
-
var
|
|
6172
|
-
|
|
6173
|
-
}
|
|
6429
|
+
var depositCardSurfaceStyle = (tokens, listOpen) => ({
|
|
6430
|
+
background: tokens.bgCard,
|
|
6431
|
+
border: `1px solid ${tokens.border}`,
|
|
6432
|
+
borderRadius: tokens.radiusLg,
|
|
6433
|
+
padding: "16px 20px",
|
|
6434
|
+
marginBottom: listOpen ? 4 : 16
|
|
6435
|
+
});
|
|
6174
6436
|
var depositLabelStyle3 = (color) => ({
|
|
6175
6437
|
fontSize: "0.75rem",
|
|
6176
6438
|
fontWeight: 500,
|
|
6177
6439
|
color,
|
|
6178
6440
|
marginBottom: 4
|
|
6179
6441
|
});
|
|
6442
|
+
var amountBandStyle = {
|
|
6443
|
+
display: "flex",
|
|
6444
|
+
alignItems: "flex-start",
|
|
6445
|
+
justifyContent: "space-between",
|
|
6446
|
+
gap: 12
|
|
6447
|
+
};
|
|
6448
|
+
var amountLeftColStyle = {
|
|
6449
|
+
flex: 1,
|
|
6450
|
+
minWidth: 0
|
|
6451
|
+
};
|
|
6180
6452
|
var depositAmountStyle2 = (color) => ({
|
|
6181
6453
|
fontSize: "2.4rem",
|
|
6182
6454
|
fontWeight: 700,
|
|
6183
6455
|
letterSpacing: "-0.02em",
|
|
6184
|
-
color
|
|
6185
|
-
});
|
|
6186
|
-
var errorStyle3 = (color) => ({
|
|
6187
|
-
fontSize: "0.84rem",
|
|
6188
6456
|
color,
|
|
6189
|
-
|
|
6190
|
-
lineHeight: 1.5
|
|
6457
|
+
lineHeight: 1.05
|
|
6191
6458
|
});
|
|
6192
|
-
var
|
|
6459
|
+
var feeRowStyle = (color) => ({
|
|
6193
6460
|
fontSize: "0.84rem",
|
|
6194
6461
|
fontWeight: 500,
|
|
6195
6462
|
color,
|
|
6196
|
-
|
|
6463
|
+
marginTop: 6
|
|
6197
6464
|
});
|
|
6198
|
-
var
|
|
6465
|
+
var tokenTriggerStyle = (tokens, interactive) => ({
|
|
6199
6466
|
display: "flex",
|
|
6200
|
-
|
|
6201
|
-
gap:
|
|
6467
|
+
alignItems: "center",
|
|
6468
|
+
gap: 6,
|
|
6469
|
+
flexShrink: 0,
|
|
6470
|
+
marginTop: 4,
|
|
6471
|
+
padding: "6px 10px",
|
|
6472
|
+
background: tokens.bgInput,
|
|
6473
|
+
border: `1px solid ${tokens.border}`,
|
|
6474
|
+
borderRadius: 999,
|
|
6475
|
+
cursor: interactive ? "pointer" : "default",
|
|
6476
|
+
fontFamily: "inherit"
|
|
6477
|
+
});
|
|
6478
|
+
var tokenTriggerIconsStyle = {
|
|
6479
|
+
position: "relative",
|
|
6480
|
+
width: 40,
|
|
6481
|
+
height: 28
|
|
6202
6482
|
};
|
|
6203
|
-
var
|
|
6483
|
+
var triggerLogoStyle = (left) => ({
|
|
6484
|
+
position: "absolute",
|
|
6485
|
+
left,
|
|
6486
|
+
top: 0,
|
|
6487
|
+
borderRadius: "50%",
|
|
6488
|
+
objectFit: "cover",
|
|
6489
|
+
border: "2px solid rgba(255,255,255,0.9)",
|
|
6490
|
+
boxSizing: "content-box"
|
|
6491
|
+
});
|
|
6492
|
+
var tokenDropdownOuterStyle = (tokens) => ({
|
|
6493
|
+
marginTop: 4,
|
|
6494
|
+
marginBottom: 16,
|
|
6495
|
+
background: tokens.bgCard,
|
|
6496
|
+
border: `1px solid ${tokens.border}`,
|
|
6497
|
+
borderRadius: tokens.radiusLg,
|
|
6498
|
+
boxShadow: tokens.shadowLg,
|
|
6499
|
+
padding: "12px 14px 14px"
|
|
6500
|
+
});
|
|
6501
|
+
var accountDropdownLabelStyle2 = (color) => ({
|
|
6502
|
+
fontSize: "0.78rem",
|
|
6503
|
+
fontWeight: 500,
|
|
6504
|
+
color,
|
|
6505
|
+
marginBottom: 8
|
|
6506
|
+
});
|
|
6507
|
+
var tokenDropdownInnerStyle = (tokens) => ({
|
|
6508
|
+
background: tokens.bgInput,
|
|
6509
|
+
border: `1px solid ${tokens.border}`,
|
|
6510
|
+
borderRadius: tokens.radiusLg,
|
|
6511
|
+
overflow: "hidden"
|
|
6512
|
+
});
|
|
6513
|
+
var pickerRowStyle = (tokens, isSelected, isLast) => ({
|
|
6204
6514
|
display: "flex",
|
|
6205
6515
|
alignItems: "center",
|
|
6206
|
-
|
|
6516
|
+
justifyContent: "space-between",
|
|
6517
|
+
width: "100%",
|
|
6207
6518
|
padding: "14px 16px",
|
|
6208
|
-
background: tokens.
|
|
6209
|
-
border:
|
|
6210
|
-
|
|
6211
|
-
cursor:
|
|
6519
|
+
background: isSelected ? `${tokens.accent}18` : "transparent",
|
|
6520
|
+
border: "none",
|
|
6521
|
+
borderBottom: isLast ? "none" : `1px solid ${tokens.border}`,
|
|
6522
|
+
cursor: "pointer",
|
|
6212
6523
|
fontFamily: "inherit",
|
|
6213
6524
|
textAlign: "left",
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
|
|
6525
|
+
outline: "none"
|
|
6526
|
+
});
|
|
6527
|
+
var pickerRowLeftStyle = {
|
|
6528
|
+
display: "flex",
|
|
6529
|
+
alignItems: "center",
|
|
6530
|
+
gap: 12,
|
|
6531
|
+
minWidth: 0,
|
|
6532
|
+
flex: 1
|
|
6533
|
+
};
|
|
6534
|
+
var pickerRowInfoStyle = {
|
|
6535
|
+
display: "flex",
|
|
6536
|
+
flexDirection: "column",
|
|
6537
|
+
gap: 2,
|
|
6538
|
+
minWidth: 0
|
|
6539
|
+
};
|
|
6540
|
+
var radioEmptyStyle2 = (borderColor) => ({
|
|
6541
|
+
width: 22,
|
|
6542
|
+
height: 22,
|
|
6543
|
+
borderRadius: "50%",
|
|
6544
|
+
border: `2px solid ${borderColor}`,
|
|
6545
|
+
flexShrink: 0
|
|
6546
|
+
});
|
|
6547
|
+
var errorStyle3 = (color) => ({
|
|
6548
|
+
fontSize: "0.84rem",
|
|
6549
|
+
color,
|
|
6550
|
+
margin: "0 0 12px",
|
|
6551
|
+
lineHeight: 1.5
|
|
6217
6552
|
});
|
|
6218
6553
|
var tokenIconCircleStyle3 = (tokens, hasLogo) => ({
|
|
6219
6554
|
width: 36,
|
|
@@ -6237,13 +6572,6 @@ var tokenIconTextStyle3 = (color) => ({
|
|
|
6237
6572
|
fontWeight: 700,
|
|
6238
6573
|
color
|
|
6239
6574
|
});
|
|
6240
|
-
var tokenInfoStyle3 = {
|
|
6241
|
-
display: "flex",
|
|
6242
|
-
flexDirection: "column",
|
|
6243
|
-
gap: 2,
|
|
6244
|
-
flex: 1,
|
|
6245
|
-
minWidth: 0
|
|
6246
|
-
};
|
|
6247
6575
|
var tokenNameRowStyle2 = {
|
|
6248
6576
|
display: "flex",
|
|
6249
6577
|
alignItems: "center",
|
|
@@ -6267,10 +6595,6 @@ var tokenBalanceStyle2 = (color) => ({
|
|
|
6267
6595
|
fontSize: "0.78rem",
|
|
6268
6596
|
color
|
|
6269
6597
|
});
|
|
6270
|
-
var chevronStyle = {
|
|
6271
|
-
flexShrink: 0,
|
|
6272
|
-
opacity: 0.4
|
|
6273
|
-
};
|
|
6274
6598
|
var emptyStyle = (color) => ({
|
|
6275
6599
|
fontSize: "0.88rem",
|
|
6276
6600
|
color,
|
|
@@ -6292,7 +6616,7 @@ function GuestPreauthSetupCompleteScreen({
|
|
|
6292
6616
|
] }),
|
|
6293
6617
|
children: [
|
|
6294
6618
|
/* @__PURE__ */ jsx(ScreenHeader, { onLogout }),
|
|
6295
|
-
/* @__PURE__ */ jsxs("div", { style:
|
|
6619
|
+
/* @__PURE__ */ jsxs("div", { style: contentStyle10, children: [
|
|
6296
6620
|
/* @__PURE__ */ jsx(IconCircle, { variant: "success", size: 64, children: /* @__PURE__ */ jsx("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx(
|
|
6297
6621
|
"path",
|
|
6298
6622
|
{
|
|
@@ -6300,14 +6624,14 @@ function GuestPreauthSetupCompleteScreen({
|
|
|
6300
6624
|
fill: tokens.success
|
|
6301
6625
|
}
|
|
6302
6626
|
) }) }),
|
|
6303
|
-
/* @__PURE__ */ jsx("h2", { style:
|
|
6304
|
-
/* @__PURE__ */ jsx("p", { style:
|
|
6627
|
+
/* @__PURE__ */ jsx("h2", { style: headingStyle13(tokens.text), children: "Setup complete" }),
|
|
6628
|
+
/* @__PURE__ */ jsx("p", { style: subtitleStyle12(tokens.textSecondary), children: "Your account is linked and ready. You can close this window or make another deposit." })
|
|
6305
6629
|
] })
|
|
6306
6630
|
]
|
|
6307
6631
|
}
|
|
6308
6632
|
);
|
|
6309
6633
|
}
|
|
6310
|
-
var
|
|
6634
|
+
var contentStyle10 = {
|
|
6311
6635
|
display: "flex",
|
|
6312
6636
|
flexDirection: "column",
|
|
6313
6637
|
alignItems: "center",
|
|
@@ -6315,7 +6639,7 @@ var contentStyle9 = {
|
|
|
6315
6639
|
gap: 12,
|
|
6316
6640
|
paddingTop: 8
|
|
6317
6641
|
};
|
|
6318
|
-
function
|
|
6642
|
+
function headingStyle13(color) {
|
|
6319
6643
|
return {
|
|
6320
6644
|
margin: 0,
|
|
6321
6645
|
fontSize: 22,
|
|
@@ -6323,7 +6647,7 @@ function headingStyle12(color) {
|
|
|
6323
6647
|
color
|
|
6324
6648
|
};
|
|
6325
6649
|
}
|
|
6326
|
-
function
|
|
6650
|
+
function subtitleStyle12(color) {
|
|
6327
6651
|
return {
|
|
6328
6652
|
margin: 0,
|
|
6329
6653
|
fontSize: 15,
|
|
@@ -6336,14 +6660,14 @@ function GuestPreauthLinkingScreen({ onLogout }) {
|
|
|
6336
6660
|
const { tokens } = useBlinkConfig();
|
|
6337
6661
|
return /* @__PURE__ */ jsxs(ScreenLayout, { children: [
|
|
6338
6662
|
/* @__PURE__ */ jsx(ScreenHeader, { onLogout }),
|
|
6339
|
-
/* @__PURE__ */ jsxs("div", { style:
|
|
6663
|
+
/* @__PURE__ */ jsxs("div", { style: contentStyle11, children: [
|
|
6340
6664
|
/* @__PURE__ */ jsx(Spinner, { size: 48 }),
|
|
6341
|
-
/* @__PURE__ */ jsx("h2", { style:
|
|
6342
|
-
/* @__PURE__ */ jsx("p", { style:
|
|
6665
|
+
/* @__PURE__ */ jsx("h2", { style: headingStyle14(tokens.text), children: "Setting up your account..." }),
|
|
6666
|
+
/* @__PURE__ */ jsx("p", { style: subtitleStyle13(tokens.textSecondary), children: "Linking your wallet to your Blink account. This usually takes a few seconds." })
|
|
6343
6667
|
] })
|
|
6344
6668
|
] });
|
|
6345
6669
|
}
|
|
6346
|
-
var
|
|
6670
|
+
var contentStyle11 = {
|
|
6347
6671
|
flex: 1,
|
|
6348
6672
|
display: "flex",
|
|
6349
6673
|
flexDirection: "column",
|
|
@@ -6352,7 +6676,7 @@ var contentStyle10 = {
|
|
|
6352
6676
|
textAlign: "center",
|
|
6353
6677
|
padding: "0 24px 32px"
|
|
6354
6678
|
};
|
|
6355
|
-
function
|
|
6679
|
+
function headingStyle14(color) {
|
|
6356
6680
|
return {
|
|
6357
6681
|
margin: "20px 0 8px",
|
|
6358
6682
|
fontSize: "1.45rem",
|
|
@@ -6361,7 +6685,7 @@ function headingStyle13(color) {
|
|
|
6361
6685
|
color
|
|
6362
6686
|
};
|
|
6363
6687
|
}
|
|
6364
|
-
function
|
|
6688
|
+
function subtitleStyle13(color) {
|
|
6365
6689
|
return {
|
|
6366
6690
|
margin: 0,
|
|
6367
6691
|
fontSize: "0.9rem",
|
|
@@ -6453,6 +6777,9 @@ function StepRendererContent({
|
|
|
6453
6777
|
guestTokenEntries,
|
|
6454
6778
|
guestLoadingBalances,
|
|
6455
6779
|
guestSettingSender,
|
|
6780
|
+
guestPendingEntry,
|
|
6781
|
+
guestQuoteFee,
|
|
6782
|
+
guestQuoteLoading,
|
|
6456
6783
|
authInput,
|
|
6457
6784
|
otpCode,
|
|
6458
6785
|
selectSourceChainName,
|
|
@@ -6690,7 +7017,11 @@ function StepRendererContent({
|
|
|
6690
7017
|
setting: guestSettingSender,
|
|
6691
7018
|
depositAmount: depositAmount ?? void 0,
|
|
6692
7019
|
error: state.error,
|
|
7020
|
+
pendingEntry: forms.guestPendingEntry,
|
|
7021
|
+
quoteFee: forms.guestQuoteFee,
|
|
7022
|
+
quoteLoading: forms.guestQuoteLoading,
|
|
6693
7023
|
onSelect: handlers.onSelectGuestToken,
|
|
7024
|
+
onConfirm: handlers.onConfirmGuestToken,
|
|
6694
7025
|
onBack: handlers.onGuestBackFromTokenPicker
|
|
6695
7026
|
}
|
|
6696
7027
|
);
|
|
@@ -6795,7 +7126,7 @@ var PaymentErrorBoundary = class extends Component {
|
|
|
6795
7126
|
/* @__PURE__ */ jsx("path", { d: "M12 8v5", stroke: "#ef4444", strokeWidth: "1.5", strokeLinecap: "round" }),
|
|
6796
7127
|
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "16", r: "0.75", fill: "#ef4444" })
|
|
6797
7128
|
] }) }),
|
|
6798
|
-
/* @__PURE__ */ jsx("h2", { style:
|
|
7129
|
+
/* @__PURE__ */ jsx("h2", { style: headingStyle15, children: "Something went wrong" }),
|
|
6799
7130
|
/* @__PURE__ */ jsx("p", { style: messageStyle, children: "An unexpected error occurred. Please try again." }),
|
|
6800
7131
|
/* @__PURE__ */ jsx("button", { type: "button", onClick: this.handleReset, style: buttonStyle3, children: "Try again" })
|
|
6801
7132
|
] });
|
|
@@ -6815,7 +7146,7 @@ var containerStyle9 = {
|
|
|
6815
7146
|
var iconStyle3 = {
|
|
6816
7147
|
marginBottom: 20
|
|
6817
7148
|
};
|
|
6818
|
-
var
|
|
7149
|
+
var headingStyle15 = {
|
|
6819
7150
|
fontSize: "1.25rem",
|
|
6820
7151
|
fontWeight: 700,
|
|
6821
7152
|
color: "#1a1a1a",
|
|
@@ -7994,8 +8325,8 @@ function useProviderHandlers(deps) {
|
|
|
7994
8325
|
}
|
|
7995
8326
|
|
|
7996
8327
|
// src/guestTokens.ts
|
|
7997
|
-
function
|
|
7998
|
-
|
|
8328
|
+
function mapGuestPickerEntries(options) {
|
|
8329
|
+
const mapped = options.map((opt) => ({
|
|
7999
8330
|
chainId: opt.chainId,
|
|
8000
8331
|
sourceChainId: opt.sourceChainId,
|
|
8001
8332
|
chainName: opt.chainName,
|
|
@@ -8004,7 +8335,26 @@ function mapBalancesToGuestTokenEntries(options) {
|
|
|
8004
8335
|
decimals: opt.decimals,
|
|
8005
8336
|
rawBalance: opt.rawBalance,
|
|
8006
8337
|
balance: Number(opt.rawBalance) / 10 ** opt.decimals
|
|
8007
|
-
}))
|
|
8338
|
+
}));
|
|
8339
|
+
const positive = mapped.filter((e) => e.balance > 0).sort((a, b) => b.balance - a.balance);
|
|
8340
|
+
if (positive.length > 0) return positive;
|
|
8341
|
+
return mapped.sort((a, b) => b.balance - a.balance);
|
|
8342
|
+
}
|
|
8343
|
+
function guestEntryMatchingRecommended(balances, recommended) {
|
|
8344
|
+
const raw = balances.find(
|
|
8345
|
+
(b) => b.sourceChainId === recommended.sourceChainId && b.tokenAddress.toLowerCase() === recommended.tokenAddress.toLowerCase()
|
|
8346
|
+
);
|
|
8347
|
+
if (!raw) return null;
|
|
8348
|
+
return {
|
|
8349
|
+
chainId: raw.chainId,
|
|
8350
|
+
sourceChainId: raw.sourceChainId,
|
|
8351
|
+
chainName: raw.chainName,
|
|
8352
|
+
tokenSymbol: raw.tokenSymbol,
|
|
8353
|
+
tokenAddress: raw.tokenAddress,
|
|
8354
|
+
decimals: raw.decimals,
|
|
8355
|
+
rawBalance: raw.rawBalance,
|
|
8356
|
+
balance: Number(raw.rawBalance) / 10 ** raw.decimals
|
|
8357
|
+
};
|
|
8008
8358
|
}
|
|
8009
8359
|
|
|
8010
8360
|
// src/hooks/useGuestTransferHandlers.ts
|
|
@@ -8031,6 +8381,9 @@ function useGuestTransferHandlers(deps) {
|
|
|
8031
8381
|
const [guestTokenEntries, setGuestTokenEntries] = useState([]);
|
|
8032
8382
|
const [loadingBalances, setLoadingBalances] = useState(false);
|
|
8033
8383
|
const [settingSender, setSettingSender] = useState(false);
|
|
8384
|
+
const [pendingGuestEntry, setPendingGuestEntry] = useState(null);
|
|
8385
|
+
const [guestFee, setGuestFee] = useState(null);
|
|
8386
|
+
const [guestQuoteLoading, setGuestQuoteLoading] = useState(false);
|
|
8034
8387
|
const executingBridgeRef = useRef(false);
|
|
8035
8388
|
const fetchedRef = useRef(false);
|
|
8036
8389
|
const selectedGuestTokenRef = useRef(null);
|
|
@@ -8040,21 +8393,65 @@ function useGuestTransferHandlers(deps) {
|
|
|
8040
8393
|
if (!account.address) return;
|
|
8041
8394
|
fetchedRef.current = true;
|
|
8042
8395
|
setLoadingBalances(true);
|
|
8043
|
-
|
|
8396
|
+
putGuestTransferSender(apiBaseUrl, guestTransferId, guestSessionToken, {
|
|
8397
|
+
senderAddress: account.address
|
|
8398
|
+
}).then(async (res) => {
|
|
8399
|
+
const balances = res.source?.balances;
|
|
8400
|
+
if (!balances?.length) {
|
|
8401
|
+
dispatch({ type: "SET_ERROR", error: "No supported tokens found for this transfer." });
|
|
8402
|
+
return;
|
|
8403
|
+
}
|
|
8404
|
+
const entries = mapGuestPickerEntries(balances);
|
|
8044
8405
|
setGuestTokenEntries(entries);
|
|
8045
8406
|
if (entries.length === 0) {
|
|
8046
8407
|
dispatch({ type: "SET_ERROR", error: "No supported tokens found in your wallet." });
|
|
8408
|
+
return;
|
|
8409
|
+
}
|
|
8410
|
+
const recommended = res.source?.recommended;
|
|
8411
|
+
const autoEntry = recommended ? guestEntryMatchingRecommended(balances, recommended) : null;
|
|
8412
|
+
const pick = autoEntry && entries.some(
|
|
8413
|
+
(e) => e.sourceChainId === autoEntry.sourceChainId && e.tokenAddress.toLowerCase() === autoEntry.tokenAddress.toLowerCase()
|
|
8414
|
+
) ? autoEntry : entries[0];
|
|
8415
|
+
setPendingGuestEntry(pick);
|
|
8416
|
+
setGuestFee(null);
|
|
8417
|
+
if (res.fee?.quote != null) {
|
|
8418
|
+
setGuestFee(res.fee);
|
|
8419
|
+
return;
|
|
8420
|
+
}
|
|
8421
|
+
setGuestQuoteLoading(true);
|
|
8422
|
+
try {
|
|
8423
|
+
const quote = await postGuestTransferFeeQuote(
|
|
8424
|
+
apiBaseUrl,
|
|
8425
|
+
guestTransferId,
|
|
8426
|
+
guestSessionToken,
|
|
8427
|
+
account.address,
|
|
8428
|
+
pick.sourceChainId,
|
|
8429
|
+
pick.tokenAddress
|
|
8430
|
+
);
|
|
8431
|
+
setGuestFee(quote);
|
|
8432
|
+
} catch (err) {
|
|
8433
|
+
captureException(err);
|
|
8434
|
+
setPendingGuestEntry(null);
|
|
8435
|
+
setGuestFee(null);
|
|
8436
|
+
const msg = err instanceof Error ? err.message : "Failed to load fee estimate";
|
|
8437
|
+
dispatch({ type: "SET_ERROR", error: msg });
|
|
8438
|
+
onError?.(msg);
|
|
8439
|
+
} finally {
|
|
8440
|
+
setGuestQuoteLoading(false);
|
|
8047
8441
|
}
|
|
8048
8442
|
}).catch((err) => {
|
|
8049
8443
|
captureException(err);
|
|
8050
|
-
dispatch({ type: "SET_ERROR", error: "Failed to
|
|
8444
|
+
dispatch({ type: "SET_ERROR", error: "Failed to load payment sources." });
|
|
8051
8445
|
}).finally(() => setLoadingBalances(false));
|
|
8052
|
-
}, [isGuestFlow, guestTransferId, guestSessionToken, apiBaseUrl, wagmiConfig2, dispatch]);
|
|
8446
|
+
}, [isGuestFlow, guestTransferId, guestSessionToken, apiBaseUrl, wagmiConfig2, dispatch, onError]);
|
|
8053
8447
|
useEffect(() => {
|
|
8054
8448
|
if (!isGuestFlow) {
|
|
8055
8449
|
fetchedRef.current = false;
|
|
8056
8450
|
selectedGuestTokenRef.current = null;
|
|
8057
8451
|
setGuestTokenEntries([]);
|
|
8452
|
+
setPendingGuestEntry(null);
|
|
8453
|
+
setGuestFee(null);
|
|
8454
|
+
setGuestQuoteLoading(false);
|
|
8058
8455
|
}
|
|
8059
8456
|
}, [isGuestFlow]);
|
|
8060
8457
|
const handleSelectGuestToken = useCallback(async (entry) => {
|
|
@@ -8064,7 +8461,44 @@ function useGuestTransferHandlers(deps) {
|
|
|
8064
8461
|
dispatch({ type: "SET_ERROR", error: "Wallet not connected." });
|
|
8065
8462
|
return;
|
|
8066
8463
|
}
|
|
8464
|
+
setGuestQuoteLoading(true);
|
|
8465
|
+
dispatch({ type: "SET_ERROR", error: null });
|
|
8466
|
+
setPendingGuestEntry(entry);
|
|
8467
|
+
setGuestFee(null);
|
|
8468
|
+
try {
|
|
8469
|
+
console.info(
|
|
8470
|
+
`[blink-sdk] type=guest Fee quote preview: address=${account.address}, chain=${entry.sourceChainId}, token=${entry.tokenSymbol}`
|
|
8471
|
+
);
|
|
8472
|
+
const quote = await postGuestTransferFeeQuote(
|
|
8473
|
+
apiBaseUrl,
|
|
8474
|
+
guestTransferId,
|
|
8475
|
+
guestSessionToken,
|
|
8476
|
+
account.address,
|
|
8477
|
+
entry.sourceChainId,
|
|
8478
|
+
entry.tokenAddress
|
|
8479
|
+
);
|
|
8480
|
+
setGuestFee(quote);
|
|
8481
|
+
} catch (err) {
|
|
8482
|
+
captureException(err);
|
|
8483
|
+
setPendingGuestEntry(null);
|
|
8484
|
+
setGuestFee(null);
|
|
8485
|
+
const msg = err instanceof Error ? err.message : "Failed to load fee estimate";
|
|
8486
|
+
dispatch({ type: "SET_ERROR", error: msg });
|
|
8487
|
+
onError?.(msg);
|
|
8488
|
+
} finally {
|
|
8489
|
+
setGuestQuoteLoading(false);
|
|
8490
|
+
}
|
|
8491
|
+
}, [guestTransferId, guestSessionToken, wagmiConfig2, apiBaseUrl, dispatch, onError]);
|
|
8492
|
+
const handleConfirmGuestToken = useCallback(async () => {
|
|
8493
|
+
if (!guestTransferId || !guestSessionToken || !pendingGuestEntry) return;
|
|
8494
|
+
const account = getAccount(wagmiConfig2);
|
|
8495
|
+
if (!account.address) {
|
|
8496
|
+
dispatch({ type: "SET_ERROR", error: "Wallet not connected." });
|
|
8497
|
+
return;
|
|
8498
|
+
}
|
|
8499
|
+
const entry = pendingGuestEntry;
|
|
8067
8500
|
setSettingSender(true);
|
|
8501
|
+
dispatch({ type: "SET_ERROR", error: null });
|
|
8068
8502
|
try {
|
|
8069
8503
|
console.info(
|
|
8070
8504
|
`[blink-sdk] type=guest Setting sender: address=${account.address}, chain=${entry.sourceChainId}, token=${entry.tokenSymbol}`
|
|
@@ -8086,7 +8520,15 @@ function useGuestTransferHandlers(deps) {
|
|
|
8086
8520
|
} finally {
|
|
8087
8521
|
setSettingSender(false);
|
|
8088
8522
|
}
|
|
8089
|
-
}, [
|
|
8523
|
+
}, [
|
|
8524
|
+
guestTransferId,
|
|
8525
|
+
guestSessionToken,
|
|
8526
|
+
pendingGuestEntry,
|
|
8527
|
+
wagmiConfig2,
|
|
8528
|
+
apiBaseUrl,
|
|
8529
|
+
dispatch,
|
|
8530
|
+
onError
|
|
8531
|
+
]);
|
|
8090
8532
|
useEffect(() => {
|
|
8091
8533
|
if (!isGuestFlow || !guestTransferId || !guestSessionToken || !selectedGuestTokenRef.current) return;
|
|
8092
8534
|
if (executingBridgeRef.current) return;
|
|
@@ -8194,13 +8636,19 @@ function useGuestTransferHandlers(deps) {
|
|
|
8194
8636
|
execute();
|
|
8195
8637
|
}, [isGuestFlow, guestTransferId, guestSessionToken, settingSender, apiBaseUrl, wagmiConfig2, switchChainAsync, dispatch, onComplete, onError]);
|
|
8196
8638
|
const handleGuestBackFromTokenPicker = useCallback(() => {
|
|
8639
|
+
setPendingGuestEntry(null);
|
|
8640
|
+
setGuestFee(null);
|
|
8197
8641
|
dispatch({ type: "GUEST_BACK_FROM_TOKEN_PICKER" });
|
|
8198
8642
|
}, [dispatch]);
|
|
8199
8643
|
return {
|
|
8200
8644
|
guestTokenEntries,
|
|
8201
8645
|
loadingBalances,
|
|
8202
8646
|
settingSender,
|
|
8647
|
+
pendingGuestEntry,
|
|
8648
|
+
guestFee,
|
|
8649
|
+
guestQuoteLoading,
|
|
8203
8650
|
handleSelectGuestToken,
|
|
8651
|
+
handleConfirmGuestToken,
|
|
8204
8652
|
handleGuestBackFromTokenPicker
|
|
8205
8653
|
};
|
|
8206
8654
|
}
|
|
@@ -9950,6 +10398,7 @@ function BlinkPaymentInner({
|
|
|
9950
10398
|
onSelectAuthorizedToken: provider.handleSelectAuthorizedToken,
|
|
9951
10399
|
onAuthorizeToken: provider.handleAuthorizeToken,
|
|
9952
10400
|
onSelectGuestToken: guestTransfer.handleSelectGuestToken,
|
|
10401
|
+
onConfirmGuestToken: guestTransfer.handleConfirmGuestToken,
|
|
9953
10402
|
onGuestBackFromTokenPicker: guestTransfer.handleGuestBackFromTokenPicker,
|
|
9954
10403
|
onLogin: () => dispatch({ type: "REQUEST_LOGIN" }),
|
|
9955
10404
|
onPreauthorize: provider.handlePreauthorize,
|
|
@@ -10015,13 +10464,16 @@ function BlinkPaymentInner({
|
|
|
10015
10464
|
savingOneTapLimit: oneTapSetup.savingOneTapLimit,
|
|
10016
10465
|
guestTokenEntries: guestTransfer.guestTokenEntries,
|
|
10017
10466
|
guestLoadingBalances: guestTransfer.loadingBalances,
|
|
10018
|
-
guestSettingSender: guestTransfer.settingSender
|
|
10467
|
+
guestSettingSender: guestTransfer.settingSender,
|
|
10468
|
+
guestPendingEntry: guestTransfer.pendingGuestEntry,
|
|
10469
|
+
guestQuoteFee: guestTransfer.guestFee?.quote ?? null,
|
|
10470
|
+
guestQuoteLoading: guestTransfer.guestQuoteLoading
|
|
10019
10471
|
},
|
|
10020
10472
|
handlers
|
|
10021
10473
|
}
|
|
10022
10474
|
);
|
|
10023
10475
|
}
|
|
10024
10476
|
|
|
10025
|
-
export { AdvancedSourceScreen, BLINK_LOGO, BLINK_MASCOT, BlinkLoadingScreen, BlinkPayment, BlinkProvider, FlowPhaseProvider, IconCircle, InfoBanner, OutlineButton, PasskeyIframeBlockedError, PasskeyScreen, PoweredByFooter, PrimaryButton, ScreenHeader, ScreenLayout, SelectSourceScreen, SettingsMenu, SetupScreen, Spinner, StepList, TokenPickerScreen, api_exports as blinkApi, buildPasskeyPopupOptions, createPasskeyCredential, createPasskeyViaPopup, darkTheme, deviceHasPasskey, findDevicePasskey, findDevicePasskeyViaPopup, getTheme, lightTheme, resolvePasskeyRpId, screenForPhase, useAuthorizationExecutor, useBlinkConfig, useBlinkDepositAmount, useTransferPolling, useTransferSigning };
|
|
10477
|
+
export { AdvancedSourceScreen, BLINK_LOGO, BLINK_MASCOT, BlinkLoadingScreen, BlinkPayment, BlinkProvider, ConfirmSignScreen, DepositScreen, FlowPhaseProvider, GuestPreauthLinkingScreen, GuestPreauthSetupCompleteScreen, GuestTokenPickerScreen, IconCircle, InfoBanner, LoginScreen, OpenWalletScreen, OtpVerifyScreen, OutlineButton, PasskeyIframeBlockedError, PasskeyScreen, PoweredByFooter, PrimaryButton, ScreenHeader, ScreenLayout, SelectSourceScreen, SettingsMenu, SetupScreen, SetupStatusScreen, Spinner, StepList, SuccessScreen, TokenPickerScreen, TransferStatusScreen, VerifyPasskeyScreen, WalletPickerScreen, api_exports as blinkApi, buildPasskeyPopupOptions, createPasskeyCredential, createPasskeyViaPopup, darkTheme, deviceHasPasskey, findDevicePasskey, findDevicePasskeyViaPopup, getTheme, guestEntryMatchingRecommended, lightTheme, mapGuestPickerEntries, resolvePasskeyRpId, screenForPhase, useAuthorizationExecutor, useBlinkConfig, useBlinkDepositAmount, useTransferPolling, useTransferSigning };
|
|
10026
10478
|
//# sourceMappingURL=index.js.map
|
|
10027
10479
|
//# sourceMappingURL=index.js.map
|