@swype-org/react-sdk 0.1.94 → 0.1.96
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 +57 -133
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +57 -133
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -833,8 +833,8 @@ async function checkServerForPasskeyByToken(authToken, apiBaseUrl, verificationT
|
|
|
833
833
|
}
|
|
834
834
|
|
|
835
835
|
// src/hooks.ts
|
|
836
|
-
var WALLET_CLIENT_MAX_ATTEMPTS =
|
|
837
|
-
var WALLET_CLIENT_POLL_MS =
|
|
836
|
+
var WALLET_CLIENT_MAX_ATTEMPTS = 25;
|
|
837
|
+
var WALLET_CLIENT_POLL_MS = 400;
|
|
838
838
|
var ACTION_POLL_INTERVAL_MS = 500;
|
|
839
839
|
var ACTION_POLL_MAX_RETRIES = 20;
|
|
840
840
|
var SIGN_PERMIT2_POLL_MS = 1e3;
|
|
@@ -915,7 +915,9 @@ function resolvePasskeyRpId() {
|
|
|
915
915
|
async function waitForWalletClient(wagmiConfig2, params = {}) {
|
|
916
916
|
for (let i = 0; i < WALLET_CLIENT_MAX_ATTEMPTS; i++) {
|
|
917
917
|
try {
|
|
918
|
-
|
|
918
|
+
const account = getAccount(wagmiConfig2);
|
|
919
|
+
const enrichedParams = account.connector ? { ...params, connector: account.connector } : params;
|
|
920
|
+
return await getWalletClient(wagmiConfig2, enrichedParams);
|
|
919
921
|
} catch {
|
|
920
922
|
if (i === WALLET_CLIENT_MAX_ATTEMPTS - 1) {
|
|
921
923
|
throw new Error("Wallet not ready. Please try again.");
|
|
@@ -3187,72 +3189,6 @@ var errorBannerStyle2 = (tokens) => ({
|
|
|
3187
3189
|
width: "100%",
|
|
3188
3190
|
textAlign: "left"
|
|
3189
3191
|
});
|
|
3190
|
-
function VerifyPasskeyScreen({
|
|
3191
|
-
onVerify,
|
|
3192
|
-
onBack,
|
|
3193
|
-
verifying,
|
|
3194
|
-
error
|
|
3195
|
-
}) {
|
|
3196
|
-
const { tokens } = useSwypeConfig();
|
|
3197
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3198
|
-
ScreenLayout,
|
|
3199
|
-
{
|
|
3200
|
-
footer: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3201
|
-
/* @__PURE__ */ jsxRuntime.jsx(PrimaryButton, { onClick: onVerify, disabled: verifying, loading: verifying, children: "Verify passkey" }),
|
|
3202
|
-
/* @__PURE__ */ jsxRuntime.jsx(PoweredByFooter, {})
|
|
3203
|
-
] }),
|
|
3204
|
-
children: [
|
|
3205
|
-
/* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onBack }),
|
|
3206
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle4, children: [
|
|
3207
|
-
/* @__PURE__ */ jsxRuntime.jsx(IconCircle, { variant: "accent", size: 64, children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "36", height: "36", viewBox: "0 0 24 24", fill: "none", children: [
|
|
3208
|
-
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "4", y: "4", width: "16", height: "16", rx: "3", stroke: tokens.accent, strokeWidth: "1.5", strokeDasharray: "3 2" }),
|
|
3209
|
-
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "9", cy: "10", r: "1", fill: tokens.accent }),
|
|
3210
|
-
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "15", cy: "10", r: "1", fill: tokens.accent }),
|
|
3211
|
-
/* @__PURE__ */ jsxRuntime.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" })
|
|
3212
|
-
] }) }),
|
|
3213
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle4(tokens.text), children: "Verify your passkey" }),
|
|
3214
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle4(tokens.textSecondary), children: "Your browser requires a separate window to verify your passkey. Tap the button below to continue." }),
|
|
3215
|
-
error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorBannerStyle3(tokens), children: error }),
|
|
3216
|
-
/* @__PURE__ */ jsxRuntime.jsx(InfoBanner, { children: "Your passkey is stored securely on your device. Swype never sees your biometric data." })
|
|
3217
|
-
] })
|
|
3218
|
-
]
|
|
3219
|
-
}
|
|
3220
|
-
);
|
|
3221
|
-
}
|
|
3222
|
-
var contentStyle4 = {
|
|
3223
|
-
textAlign: "center",
|
|
3224
|
-
flex: 1,
|
|
3225
|
-
display: "flex",
|
|
3226
|
-
flexDirection: "column",
|
|
3227
|
-
alignItems: "center",
|
|
3228
|
-
paddingTop: 32
|
|
3229
|
-
};
|
|
3230
|
-
var headingStyle4 = (color) => ({
|
|
3231
|
-
fontSize: "1.45rem",
|
|
3232
|
-
fontWeight: 700,
|
|
3233
|
-
letterSpacing: "-0.02em",
|
|
3234
|
-
color,
|
|
3235
|
-
margin: "24px 0 8px"
|
|
3236
|
-
});
|
|
3237
|
-
var subtitleStyle4 = (color) => ({
|
|
3238
|
-
fontSize: "0.9rem",
|
|
3239
|
-
color,
|
|
3240
|
-
margin: "0 0 28px",
|
|
3241
|
-
lineHeight: 1.5,
|
|
3242
|
-
maxWidth: 280
|
|
3243
|
-
});
|
|
3244
|
-
var errorBannerStyle3 = (tokens) => ({
|
|
3245
|
-
background: tokens.errorBg,
|
|
3246
|
-
border: `1px solid ${tokens.error}66`,
|
|
3247
|
-
borderRadius: 16,
|
|
3248
|
-
padding: "11px 14px",
|
|
3249
|
-
color: tokens.error,
|
|
3250
|
-
fontSize: "0.84rem",
|
|
3251
|
-
marginBottom: 14,
|
|
3252
|
-
lineHeight: 1.5,
|
|
3253
|
-
width: "100%",
|
|
3254
|
-
textAlign: "left"
|
|
3255
|
-
});
|
|
3256
3192
|
var WALLET_EMOJIS = {
|
|
3257
3193
|
rabby: "\u{1F430}",
|
|
3258
3194
|
ora: "\u2666\uFE0F",
|
|
@@ -3295,8 +3231,8 @@ function WalletPickerScreen({
|
|
|
3295
3231
|
children: [
|
|
3296
3232
|
/* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { title: "Set up Swype", onBack }),
|
|
3297
3233
|
hasPending && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3298
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { style:
|
|
3299
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { style:
|
|
3234
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle4(tokens.text), children: "Continue where you left off" }),
|
|
3235
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle4(tokens.textSecondary), children: "You have a wallet that still needs setup" }),
|
|
3300
3236
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: pendingListStyle, children: pendingConnections.map((acct) => {
|
|
3301
3237
|
const wallet = acct.wallets[0];
|
|
3302
3238
|
const address = wallet ? truncateAddress(wallet.name) : void 0;
|
|
@@ -3336,8 +3272,8 @@ function WalletPickerScreen({
|
|
|
3336
3272
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: dividerStyle2(tokens.border), children: /* @__PURE__ */ jsxRuntime.jsx("span", { style: dividerTextStyle(tokens.textMuted), children: "Or connect a new wallet" }) })
|
|
3337
3273
|
] }),
|
|
3338
3274
|
!hasPending && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3339
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { style:
|
|
3340
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { style:
|
|
3275
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle4(tokens.text), children: "Where are your stablecoins?" }),
|
|
3276
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle4(tokens.textSecondary), children: "Select the wallet you want to deposit from" })
|
|
3341
3277
|
] }),
|
|
3342
3278
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: gridStyle, children: [
|
|
3343
3279
|
displayProviders.map((p) => {
|
|
@@ -3390,14 +3326,14 @@ function WalletPickerScreen({
|
|
|
3390
3326
|
}
|
|
3391
3327
|
);
|
|
3392
3328
|
}
|
|
3393
|
-
var
|
|
3329
|
+
var headingStyle4 = (color) => ({
|
|
3394
3330
|
fontSize: "1.35rem",
|
|
3395
3331
|
fontWeight: 700,
|
|
3396
3332
|
letterSpacing: "-0.02em",
|
|
3397
3333
|
color,
|
|
3398
3334
|
margin: "8px 0 4px"
|
|
3399
3335
|
});
|
|
3400
|
-
var
|
|
3336
|
+
var subtitleStyle4 = (color) => ({
|
|
3401
3337
|
fontSize: "0.88rem",
|
|
3402
3338
|
color,
|
|
3403
3339
|
margin: "0 0 24px"
|
|
@@ -3573,9 +3509,9 @@ function SetupScreen({
|
|
|
3573
3509
|
] }),
|
|
3574
3510
|
children: [
|
|
3575
3511
|
/* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { title: "Swype Setup", onBack, right: /* @__PURE__ */ jsxRuntime.jsx(SettingsMenu, { onLogout }) }),
|
|
3576
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { style:
|
|
3577
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { style:
|
|
3578
|
-
error && /* @__PURE__ */ jsxRuntime.jsx("div", { style:
|
|
3512
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle5(tokens.text), children: "Set up One-Tap deposits" }),
|
|
3513
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle5(tokens.textSecondary), children: "Set your limit for instant deposits. Like a contactless card \u2014 you choose the max." }),
|
|
3514
|
+
error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorBannerStyle3(tokens), children: error }),
|
|
3579
3515
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: balanceRowStyle, children: [
|
|
3580
3516
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: balanceLeftStyle, children: [
|
|
3581
3517
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: coinIconStyle(tokens.accent), children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", children: [
|
|
@@ -3653,20 +3589,20 @@ function SetupScreen({
|
|
|
3653
3589
|
}
|
|
3654
3590
|
);
|
|
3655
3591
|
}
|
|
3656
|
-
var
|
|
3592
|
+
var headingStyle5 = (color) => ({
|
|
3657
3593
|
fontSize: "1.3rem",
|
|
3658
3594
|
fontWeight: 700,
|
|
3659
3595
|
letterSpacing: "-0.02em",
|
|
3660
3596
|
color,
|
|
3661
3597
|
margin: "8px 0 4px"
|
|
3662
3598
|
});
|
|
3663
|
-
var
|
|
3599
|
+
var subtitleStyle5 = (color) => ({
|
|
3664
3600
|
fontSize: "0.86rem",
|
|
3665
3601
|
color,
|
|
3666
3602
|
margin: "0 0 24px",
|
|
3667
3603
|
lineHeight: 1.5
|
|
3668
3604
|
});
|
|
3669
|
-
var
|
|
3605
|
+
var errorBannerStyle3 = (tokens) => ({
|
|
3670
3606
|
background: tokens.errorBg,
|
|
3671
3607
|
border: `1px solid ${tokens.error}66`,
|
|
3672
3608
|
borderRadius: 16,
|
|
@@ -3934,7 +3870,7 @@ function DepositScreen({
|
|
|
3934
3870
|
"%)"
|
|
3935
3871
|
] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: detailRowStyle(tokens.textMuted), children: "Fees calculated at time of transfer" })
|
|
3936
3872
|
] }),
|
|
3937
|
-
error && /* @__PURE__ */ jsxRuntime.jsx("div", { style:
|
|
3873
|
+
error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorBannerStyle4(tokens), children: error })
|
|
3938
3874
|
]
|
|
3939
3875
|
}
|
|
3940
3876
|
);
|
|
@@ -4002,7 +3938,7 @@ var detailRowStyle = (color) => ({
|
|
|
4002
3938
|
color,
|
|
4003
3939
|
marginBottom: 4
|
|
4004
3940
|
});
|
|
4005
|
-
var
|
|
3941
|
+
var errorBannerStyle4 = (tokens) => ({
|
|
4006
3942
|
background: tokens.errorBg,
|
|
4007
3943
|
border: `1px solid ${tokens.error}66`,
|
|
4008
3944
|
borderRadius: 16,
|
|
@@ -4101,22 +4037,22 @@ function SuccessScreen({
|
|
|
4101
4037
|
right: /* @__PURE__ */ jsxRuntime.jsx(SettingsMenu, { onLogout })
|
|
4102
4038
|
}
|
|
4103
4039
|
),
|
|
4104
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style:
|
|
4040
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle4, children: [
|
|
4105
4041
|
succeeded ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4106
4042
|
/* @__PURE__ */ jsxRuntime.jsx(IconCircle, { variant: "success", size: 64, children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z", fill: tokens.success }) }) }),
|
|
4107
|
-
/* @__PURE__ */ jsxRuntime.jsxs("h2", { style:
|
|
4043
|
+
/* @__PURE__ */ jsxRuntime.jsxs("h2", { style: headingStyle6(tokens.text), children: [
|
|
4108
4044
|
"$",
|
|
4109
4045
|
amount.toFixed(2),
|
|
4110
4046
|
" deposited"
|
|
4111
4047
|
] }),
|
|
4112
|
-
merchantName && /* @__PURE__ */ jsxRuntime.jsxs("p", { style:
|
|
4048
|
+
merchantName && /* @__PURE__ */ jsxRuntime.jsxs("p", { style: subtitleStyle6(tokens.textSecondary), children: [
|
|
4113
4049
|
"to ",
|
|
4114
4050
|
merchantName
|
|
4115
4051
|
] })
|
|
4116
4052
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4117
4053
|
/* @__PURE__ */ jsxRuntime.jsx(IconCircle, { variant: "error", size: 64, children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.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 }) }) }),
|
|
4118
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { style:
|
|
4119
|
-
error && /* @__PURE__ */ jsxRuntime.jsx("p", { style:
|
|
4054
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle6(tokens.text), children: "Transfer failed" }),
|
|
4055
|
+
error && /* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle6(tokens.error), children: error })
|
|
4120
4056
|
] }),
|
|
4121
4057
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: summaryCardStyle(tokens), children: [
|
|
4122
4058
|
sourceName && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: summaryRowStyle, children: [
|
|
@@ -4148,21 +4084,21 @@ function SuccessScreen({
|
|
|
4148
4084
|
}
|
|
4149
4085
|
);
|
|
4150
4086
|
}
|
|
4151
|
-
var
|
|
4087
|
+
var contentStyle4 = {
|
|
4152
4088
|
flex: 1,
|
|
4153
4089
|
display: "flex",
|
|
4154
4090
|
flexDirection: "column",
|
|
4155
4091
|
alignItems: "center",
|
|
4156
4092
|
paddingTop: 16
|
|
4157
4093
|
};
|
|
4158
|
-
var
|
|
4094
|
+
var headingStyle6 = (color) => ({
|
|
4159
4095
|
fontSize: "1.5rem",
|
|
4160
4096
|
fontWeight: 700,
|
|
4161
4097
|
letterSpacing: "-0.02em",
|
|
4162
4098
|
color,
|
|
4163
4099
|
margin: "20px 0 4px"
|
|
4164
4100
|
});
|
|
4165
|
-
var
|
|
4101
|
+
var subtitleStyle6 = (color) => ({
|
|
4166
4102
|
fontSize: "0.9rem",
|
|
4167
4103
|
color,
|
|
4168
4104
|
margin: "0 0 20px"
|
|
@@ -4268,7 +4204,7 @@ function SelectSourceScreen({
|
|
|
4268
4204
|
right: /* @__PURE__ */ jsxRuntime.jsx(SettingsMenu, { onLogout })
|
|
4269
4205
|
}
|
|
4270
4206
|
),
|
|
4271
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { style:
|
|
4207
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle7(tokens.textMuted), children: "Choose which chain and token to pay from." }),
|
|
4272
4208
|
/* @__PURE__ */ jsxRuntime.jsx("label", { style: labelStyle2(tokens.textSecondary), children: "Chain" }),
|
|
4273
4209
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: optionListStyle, children: choices.map((chain) => {
|
|
4274
4210
|
const isSelected = chain.chainName === selectedChainName;
|
|
@@ -4325,7 +4261,7 @@ function SelectSourceScreen({
|
|
|
4325
4261
|
}
|
|
4326
4262
|
);
|
|
4327
4263
|
}
|
|
4328
|
-
var
|
|
4264
|
+
var subtitleStyle7 = (color) => ({
|
|
4329
4265
|
fontSize: "0.85rem",
|
|
4330
4266
|
color,
|
|
4331
4267
|
margin: "0 0 20px",
|
|
@@ -4440,8 +4376,8 @@ function AdvancedSourceScreen({
|
|
|
4440
4376
|
right: /* @__PURE__ */ jsxRuntime.jsx("span", { style: advancedBadgeStyle(tokens.accent), children: "Advanced" })
|
|
4441
4377
|
}
|
|
4442
4378
|
),
|
|
4443
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { style:
|
|
4444
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { style:
|
|
4379
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle7(tokens.text), children: "Set up One-Tap deposits" }),
|
|
4380
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle8(tokens.textSecondary), children: "Select a token source for your One-Tap deposits." }),
|
|
4445
4381
|
/* @__PURE__ */ jsxRuntime.jsx("label", { style: labelStyle3(tokens.textSecondary), children: "Select tokens to approve" }),
|
|
4446
4382
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: chainListStyle, children: choices.map((chain) => {
|
|
4447
4383
|
const isExpanded = expandedChain === chain.chainName;
|
|
@@ -4504,14 +4440,14 @@ var advancedBadgeStyle = (color) => ({
|
|
|
4504
4440
|
padding: "3px 10px",
|
|
4505
4441
|
letterSpacing: "0.02em"
|
|
4506
4442
|
});
|
|
4507
|
-
var
|
|
4443
|
+
var headingStyle7 = (color) => ({
|
|
4508
4444
|
fontSize: "1.3rem",
|
|
4509
4445
|
fontWeight: 700,
|
|
4510
4446
|
letterSpacing: "-0.02em",
|
|
4511
4447
|
color,
|
|
4512
4448
|
margin: "8px 0 4px"
|
|
4513
4449
|
});
|
|
4514
|
-
var
|
|
4450
|
+
var subtitleStyle8 = (color) => ({
|
|
4515
4451
|
fontSize: "0.86rem",
|
|
4516
4452
|
color,
|
|
4517
4453
|
margin: "0 0 20px",
|
|
@@ -4639,16 +4575,16 @@ function TransferStatusScreen({
|
|
|
4639
4575
|
const steps = buildSteps(phase);
|
|
4640
4576
|
return /* @__PURE__ */ jsxRuntime.jsxs(ScreenLayout, { children: [
|
|
4641
4577
|
/* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { right: /* @__PURE__ */ jsxRuntime.jsx(SettingsMenu, { onLogout }) }),
|
|
4642
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style:
|
|
4578
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle5, children: [
|
|
4643
4579
|
/* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 48 }),
|
|
4644
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { style:
|
|
4645
|
-
error && /* @__PURE__ */ jsxRuntime.jsx("div", { style:
|
|
4580
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle8(tokens.text), children: "Processing Transfer..." }),
|
|
4581
|
+
error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorBannerStyle5(tokens), children: error }),
|
|
4646
4582
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: stepsWrapStyle, children: /* @__PURE__ */ jsxRuntime.jsx(StepList, { steps }) }),
|
|
4647
4583
|
/* @__PURE__ */ jsxRuntime.jsx("p", { style: waitHintStyle(tokens.textMuted), children: "Usually takes a few seconds" })
|
|
4648
4584
|
] })
|
|
4649
4585
|
] });
|
|
4650
4586
|
}
|
|
4651
|
-
var
|
|
4587
|
+
var contentStyle5 = {
|
|
4652
4588
|
flex: 1,
|
|
4653
4589
|
display: "flex",
|
|
4654
4590
|
flexDirection: "column",
|
|
@@ -4657,14 +4593,14 @@ var contentStyle6 = {
|
|
|
4657
4593
|
textAlign: "center",
|
|
4658
4594
|
padding: "0 24px"
|
|
4659
4595
|
};
|
|
4660
|
-
var
|
|
4596
|
+
var headingStyle8 = (color) => ({
|
|
4661
4597
|
fontSize: "1.45rem",
|
|
4662
4598
|
fontWeight: 700,
|
|
4663
4599
|
letterSpacing: "-0.02em",
|
|
4664
4600
|
color,
|
|
4665
4601
|
margin: "20px 0 16px"
|
|
4666
4602
|
});
|
|
4667
|
-
var
|
|
4603
|
+
var errorBannerStyle5 = (tokens) => ({
|
|
4668
4604
|
background: tokens.errorBg,
|
|
4669
4605
|
border: `1px solid ${tokens.error}66`,
|
|
4670
4606
|
borderRadius: 16,
|
|
@@ -4724,10 +4660,10 @@ function OpenWalletScreen({
|
|
|
4724
4660
|
] }),
|
|
4725
4661
|
children: [
|
|
4726
4662
|
/* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { right: /* @__PURE__ */ jsxRuntime.jsx(SettingsMenu, { onLogout }) }),
|
|
4727
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style:
|
|
4663
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle6, children: [
|
|
4728
4664
|
logoSrc ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: logoSrc, alt: displayName, style: logoStyle }) : /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 48 }),
|
|
4729
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { style:
|
|
4730
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { style:
|
|
4665
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle9(tokens.text), children: loading ? "Connecting..." : `Open ${displayName}` }),
|
|
4666
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle9(tokens.textSecondary), children: loading ? "Creating transfer and preparing your wallet link..." : `Continue in ${displayName} to authorize this connection.` }),
|
|
4731
4667
|
!loading && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: waitingBadgeStyle(tokens), children: [
|
|
4732
4668
|
/* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 14 }),
|
|
4733
4669
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Waiting for authorization..." })
|
|
@@ -4737,7 +4673,7 @@ function OpenWalletScreen({
|
|
|
4737
4673
|
}
|
|
4738
4674
|
);
|
|
4739
4675
|
}
|
|
4740
|
-
var
|
|
4676
|
+
var contentStyle6 = {
|
|
4741
4677
|
flex: 1,
|
|
4742
4678
|
display: "flex",
|
|
4743
4679
|
flexDirection: "column",
|
|
@@ -4757,14 +4693,14 @@ var logoStyle = {
|
|
|
4757
4693
|
borderRadius: 14,
|
|
4758
4694
|
objectFit: "contain"
|
|
4759
4695
|
};
|
|
4760
|
-
var
|
|
4696
|
+
var headingStyle9 = (color) => ({
|
|
4761
4697
|
fontSize: "1.45rem",
|
|
4762
4698
|
fontWeight: 700,
|
|
4763
4699
|
letterSpacing: "-0.02em",
|
|
4764
4700
|
color,
|
|
4765
4701
|
margin: "20px 0 8px"
|
|
4766
4702
|
});
|
|
4767
|
-
var
|
|
4703
|
+
var subtitleStyle9 = (color) => ({
|
|
4768
4704
|
fontSize: "0.9rem",
|
|
4769
4705
|
color,
|
|
4770
4706
|
margin: "0 0 24px",
|
|
@@ -4808,10 +4744,10 @@ function ConfirmSignScreen({
|
|
|
4808
4744
|
] }),
|
|
4809
4745
|
children: [
|
|
4810
4746
|
/* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { right: /* @__PURE__ */ jsxRuntime.jsx(SettingsMenu, { onLogout }) }),
|
|
4811
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style:
|
|
4747
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle7, children: [
|
|
4812
4748
|
logoSrc ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: logoSrc, alt: displayName, style: logoStyle2 }) : /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 48 }),
|
|
4813
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { style:
|
|
4814
|
-
/* @__PURE__ */ jsxRuntime.jsxs("p", { style:
|
|
4749
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle10(tokens.text), children: "Wallet authorized" }),
|
|
4750
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { style: subtitleStyle10(tokens.textSecondary), children: [
|
|
4815
4751
|
displayName,
|
|
4816
4752
|
" approved the connection. Tap below to confirm your payment."
|
|
4817
4753
|
] }),
|
|
@@ -4824,7 +4760,7 @@ function ConfirmSignScreen({
|
|
|
4824
4760
|
}
|
|
4825
4761
|
);
|
|
4826
4762
|
}
|
|
4827
|
-
var
|
|
4763
|
+
var contentStyle7 = {
|
|
4828
4764
|
flex: 1,
|
|
4829
4765
|
display: "flex",
|
|
4830
4766
|
flexDirection: "column",
|
|
@@ -4839,14 +4775,14 @@ var logoStyle2 = {
|
|
|
4839
4775
|
borderRadius: 14,
|
|
4840
4776
|
objectFit: "contain"
|
|
4841
4777
|
};
|
|
4842
|
-
var
|
|
4778
|
+
var headingStyle10 = (color) => ({
|
|
4843
4779
|
fontSize: "1.45rem",
|
|
4844
4780
|
fontWeight: 700,
|
|
4845
4781
|
letterSpacing: "-0.02em",
|
|
4846
4782
|
color,
|
|
4847
4783
|
margin: "20px 0 8px"
|
|
4848
4784
|
});
|
|
4849
|
-
var
|
|
4785
|
+
var subtitleStyle10 = (color) => ({
|
|
4850
4786
|
fontSize: "0.9rem",
|
|
4851
4787
|
color,
|
|
4852
4788
|
margin: "0 0 24px",
|
|
@@ -4948,20 +4884,6 @@ function StepRenderer({
|
|
|
4948
4884
|
}
|
|
4949
4885
|
);
|
|
4950
4886
|
}
|
|
4951
|
-
if ((step === "login" || step === "otp-verify") && authenticated) {
|
|
4952
|
-
return /* @__PURE__ */ jsxRuntime.jsx(CenteredSpinner, { label: "Verifying your passkey...test2" });
|
|
4953
|
-
}
|
|
4954
|
-
if (step === "verify-passkey") {
|
|
4955
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4956
|
-
VerifyPasskeyScreen,
|
|
4957
|
-
{
|
|
4958
|
-
onVerify: handlers.onVerifyPasskeyViaPopup,
|
|
4959
|
-
onBack: handlers.onLogout,
|
|
4960
|
-
verifying: state.verifyingPasskeyPopup,
|
|
4961
|
-
error: state.error
|
|
4962
|
-
}
|
|
4963
|
-
);
|
|
4964
|
-
}
|
|
4965
4887
|
if (step === "create-passkey") {
|
|
4966
4888
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4967
4889
|
CreatePasskeyScreen,
|
|
@@ -5142,7 +5064,7 @@ var PaymentErrorBoundary = class extends react.Component {
|
|
|
5142
5064
|
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 8v5", stroke: "#ef4444", strokeWidth: "1.5", strokeLinecap: "round" }),
|
|
5143
5065
|
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "16", r: "0.75", fill: "#ef4444" })
|
|
5144
5066
|
] }) }),
|
|
5145
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { style:
|
|
5067
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle11, children: "Something went wrong" }),
|
|
5146
5068
|
/* @__PURE__ */ jsxRuntime.jsx("p", { style: messageStyle, children: "An unexpected error occurred. Please try again." }),
|
|
5147
5069
|
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: this.handleReset, style: buttonStyle3, children: "Try again" })
|
|
5148
5070
|
] });
|
|
@@ -5162,7 +5084,7 @@ var containerStyle8 = {
|
|
|
5162
5084
|
var iconStyle4 = {
|
|
5163
5085
|
marginBottom: 20
|
|
5164
5086
|
};
|
|
5165
|
-
var
|
|
5087
|
+
var headingStyle11 = {
|
|
5166
5088
|
fontSize: "1.25rem",
|
|
5167
5089
|
fontWeight: 700,
|
|
5168
5090
|
color: "#1a1a1a",
|
|
@@ -5237,6 +5159,8 @@ function SwypePaymentInner({
|
|
|
5237
5159
|
const onCompleteRef = react.useRef(onComplete);
|
|
5238
5160
|
onCompleteRef.current = onComplete;
|
|
5239
5161
|
const pollingRef = react.useRef(null);
|
|
5162
|
+
const getAccessTokenRef = react.useRef(getAccessToken);
|
|
5163
|
+
getAccessTokenRef.current = getAccessToken;
|
|
5240
5164
|
const handleAuthorizedMobileReturnRef = react.useRef(
|
|
5241
5165
|
null
|
|
5242
5166
|
);
|
|
@@ -5924,7 +5848,7 @@ function SwypePaymentInner({
|
|
|
5924
5848
|
try {
|
|
5925
5849
|
let token = null;
|
|
5926
5850
|
for (let attempt = 0; attempt < 3; attempt++) {
|
|
5927
|
-
token = await
|
|
5851
|
+
token = await getAccessTokenRef.current();
|
|
5928
5852
|
if (token || cancelled) break;
|
|
5929
5853
|
await new Promise((r) => setTimeout(r, 1e3));
|
|
5930
5854
|
}
|
|
@@ -5980,7 +5904,7 @@ function SwypePaymentInner({
|
|
|
5980
5904
|
return () => {
|
|
5981
5905
|
cancelled = true;
|
|
5982
5906
|
};
|
|
5983
|
-
}, [ready, authenticated, state.step, apiBaseUrl,
|
|
5907
|
+
}, [ready, authenticated, state.step, apiBaseUrl, state.activeCredentialId]);
|
|
5984
5908
|
react.useEffect(() => {
|
|
5985
5909
|
const loadAction = resolveDataLoadAction({
|
|
5986
5910
|
authenticated,
|