@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.js
CHANGED
|
@@ -830,8 +830,8 @@ async function checkServerForPasskeyByToken(authToken, apiBaseUrl, verificationT
|
|
|
830
830
|
}
|
|
831
831
|
|
|
832
832
|
// src/hooks.ts
|
|
833
|
-
var WALLET_CLIENT_MAX_ATTEMPTS =
|
|
834
|
-
var WALLET_CLIENT_POLL_MS =
|
|
833
|
+
var WALLET_CLIENT_MAX_ATTEMPTS = 25;
|
|
834
|
+
var WALLET_CLIENT_POLL_MS = 400;
|
|
835
835
|
var ACTION_POLL_INTERVAL_MS = 500;
|
|
836
836
|
var ACTION_POLL_MAX_RETRIES = 20;
|
|
837
837
|
var SIGN_PERMIT2_POLL_MS = 1e3;
|
|
@@ -912,7 +912,9 @@ function resolvePasskeyRpId() {
|
|
|
912
912
|
async function waitForWalletClient(wagmiConfig2, params = {}) {
|
|
913
913
|
for (let i = 0; i < WALLET_CLIENT_MAX_ATTEMPTS; i++) {
|
|
914
914
|
try {
|
|
915
|
-
|
|
915
|
+
const account = getAccount(wagmiConfig2);
|
|
916
|
+
const enrichedParams = account.connector ? { ...params, connector: account.connector } : params;
|
|
917
|
+
return await getWalletClient(wagmiConfig2, enrichedParams);
|
|
916
918
|
} catch {
|
|
917
919
|
if (i === WALLET_CLIENT_MAX_ATTEMPTS - 1) {
|
|
918
920
|
throw new Error("Wallet not ready. Please try again.");
|
|
@@ -3184,72 +3186,6 @@ var errorBannerStyle2 = (tokens) => ({
|
|
|
3184
3186
|
width: "100%",
|
|
3185
3187
|
textAlign: "left"
|
|
3186
3188
|
});
|
|
3187
|
-
function VerifyPasskeyScreen({
|
|
3188
|
-
onVerify,
|
|
3189
|
-
onBack,
|
|
3190
|
-
verifying,
|
|
3191
|
-
error
|
|
3192
|
-
}) {
|
|
3193
|
-
const { tokens } = useSwypeConfig();
|
|
3194
|
-
return /* @__PURE__ */ jsxs(
|
|
3195
|
-
ScreenLayout,
|
|
3196
|
-
{
|
|
3197
|
-
footer: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3198
|
-
/* @__PURE__ */ jsx(PrimaryButton, { onClick: onVerify, disabled: verifying, loading: verifying, children: "Verify passkey" }),
|
|
3199
|
-
/* @__PURE__ */ jsx(PoweredByFooter, {})
|
|
3200
|
-
] }),
|
|
3201
|
-
children: [
|
|
3202
|
-
/* @__PURE__ */ jsx(ScreenHeader, { onBack }),
|
|
3203
|
-
/* @__PURE__ */ jsxs("div", { style: contentStyle4, children: [
|
|
3204
|
-
/* @__PURE__ */ jsx(IconCircle, { variant: "accent", size: 64, children: /* @__PURE__ */ jsxs("svg", { width: "36", height: "36", viewBox: "0 0 24 24", fill: "none", children: [
|
|
3205
|
-
/* @__PURE__ */ jsx("rect", { x: "4", y: "4", width: "16", height: "16", rx: "3", stroke: tokens.accent, strokeWidth: "1.5", strokeDasharray: "3 2" }),
|
|
3206
|
-
/* @__PURE__ */ jsx("circle", { cx: "9", cy: "10", r: "1", fill: tokens.accent }),
|
|
3207
|
-
/* @__PURE__ */ jsx("circle", { cx: "15", cy: "10", r: "1", fill: tokens.accent }),
|
|
3208
|
-
/* @__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" })
|
|
3209
|
-
] }) }),
|
|
3210
|
-
/* @__PURE__ */ jsx("h2", { style: headingStyle4(tokens.text), children: "Verify your passkey" }),
|
|
3211
|
-
/* @__PURE__ */ jsx("p", { style: subtitleStyle4(tokens.textSecondary), children: "Your browser requires a separate window to verify your passkey. Tap the button below to continue." }),
|
|
3212
|
-
error && /* @__PURE__ */ jsx("div", { style: errorBannerStyle3(tokens), children: error }),
|
|
3213
|
-
/* @__PURE__ */ jsx(InfoBanner, { children: "Your passkey is stored securely on your device. Swype never sees your biometric data." })
|
|
3214
|
-
] })
|
|
3215
|
-
]
|
|
3216
|
-
}
|
|
3217
|
-
);
|
|
3218
|
-
}
|
|
3219
|
-
var contentStyle4 = {
|
|
3220
|
-
textAlign: "center",
|
|
3221
|
-
flex: 1,
|
|
3222
|
-
display: "flex",
|
|
3223
|
-
flexDirection: "column",
|
|
3224
|
-
alignItems: "center",
|
|
3225
|
-
paddingTop: 32
|
|
3226
|
-
};
|
|
3227
|
-
var headingStyle4 = (color) => ({
|
|
3228
|
-
fontSize: "1.45rem",
|
|
3229
|
-
fontWeight: 700,
|
|
3230
|
-
letterSpacing: "-0.02em",
|
|
3231
|
-
color,
|
|
3232
|
-
margin: "24px 0 8px"
|
|
3233
|
-
});
|
|
3234
|
-
var subtitleStyle4 = (color) => ({
|
|
3235
|
-
fontSize: "0.9rem",
|
|
3236
|
-
color,
|
|
3237
|
-
margin: "0 0 28px",
|
|
3238
|
-
lineHeight: 1.5,
|
|
3239
|
-
maxWidth: 280
|
|
3240
|
-
});
|
|
3241
|
-
var errorBannerStyle3 = (tokens) => ({
|
|
3242
|
-
background: tokens.errorBg,
|
|
3243
|
-
border: `1px solid ${tokens.error}66`,
|
|
3244
|
-
borderRadius: 16,
|
|
3245
|
-
padding: "11px 14px",
|
|
3246
|
-
color: tokens.error,
|
|
3247
|
-
fontSize: "0.84rem",
|
|
3248
|
-
marginBottom: 14,
|
|
3249
|
-
lineHeight: 1.5,
|
|
3250
|
-
width: "100%",
|
|
3251
|
-
textAlign: "left"
|
|
3252
|
-
});
|
|
3253
3189
|
var WALLET_EMOJIS = {
|
|
3254
3190
|
rabby: "\u{1F430}",
|
|
3255
3191
|
ora: "\u2666\uFE0F",
|
|
@@ -3292,8 +3228,8 @@ function WalletPickerScreen({
|
|
|
3292
3228
|
children: [
|
|
3293
3229
|
/* @__PURE__ */ jsx(ScreenHeader, { title: "Set up Swype", onBack }),
|
|
3294
3230
|
hasPending && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3295
|
-
/* @__PURE__ */ jsx("h2", { style:
|
|
3296
|
-
/* @__PURE__ */ jsx("p", { style:
|
|
3231
|
+
/* @__PURE__ */ jsx("h2", { style: headingStyle4(tokens.text), children: "Continue where you left off" }),
|
|
3232
|
+
/* @__PURE__ */ jsx("p", { style: subtitleStyle4(tokens.textSecondary), children: "You have a wallet that still needs setup" }),
|
|
3297
3233
|
/* @__PURE__ */ jsx("div", { style: pendingListStyle, children: pendingConnections.map((acct) => {
|
|
3298
3234
|
const wallet = acct.wallets[0];
|
|
3299
3235
|
const address = wallet ? truncateAddress(wallet.name) : void 0;
|
|
@@ -3333,8 +3269,8 @@ function WalletPickerScreen({
|
|
|
3333
3269
|
/* @__PURE__ */ jsx("div", { style: dividerStyle2(tokens.border), children: /* @__PURE__ */ jsx("span", { style: dividerTextStyle(tokens.textMuted), children: "Or connect a new wallet" }) })
|
|
3334
3270
|
] }),
|
|
3335
3271
|
!hasPending && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3336
|
-
/* @__PURE__ */ jsx("h2", { style:
|
|
3337
|
-
/* @__PURE__ */ jsx("p", { style:
|
|
3272
|
+
/* @__PURE__ */ jsx("h2", { style: headingStyle4(tokens.text), children: "Where are your stablecoins?" }),
|
|
3273
|
+
/* @__PURE__ */ jsx("p", { style: subtitleStyle4(tokens.textSecondary), children: "Select the wallet you want to deposit from" })
|
|
3338
3274
|
] }),
|
|
3339
3275
|
/* @__PURE__ */ jsxs("div", { style: gridStyle, children: [
|
|
3340
3276
|
displayProviders.map((p) => {
|
|
@@ -3387,14 +3323,14 @@ function WalletPickerScreen({
|
|
|
3387
3323
|
}
|
|
3388
3324
|
);
|
|
3389
3325
|
}
|
|
3390
|
-
var
|
|
3326
|
+
var headingStyle4 = (color) => ({
|
|
3391
3327
|
fontSize: "1.35rem",
|
|
3392
3328
|
fontWeight: 700,
|
|
3393
3329
|
letterSpacing: "-0.02em",
|
|
3394
3330
|
color,
|
|
3395
3331
|
margin: "8px 0 4px"
|
|
3396
3332
|
});
|
|
3397
|
-
var
|
|
3333
|
+
var subtitleStyle4 = (color) => ({
|
|
3398
3334
|
fontSize: "0.88rem",
|
|
3399
3335
|
color,
|
|
3400
3336
|
margin: "0 0 24px"
|
|
@@ -3570,9 +3506,9 @@ function SetupScreen({
|
|
|
3570
3506
|
] }),
|
|
3571
3507
|
children: [
|
|
3572
3508
|
/* @__PURE__ */ jsx(ScreenHeader, { title: "Swype Setup", onBack, right: /* @__PURE__ */ jsx(SettingsMenu, { onLogout }) }),
|
|
3573
|
-
/* @__PURE__ */ jsx("h2", { style:
|
|
3574
|
-
/* @__PURE__ */ jsx("p", { style:
|
|
3575
|
-
error && /* @__PURE__ */ jsx("div", { style:
|
|
3509
|
+
/* @__PURE__ */ jsx("h2", { style: headingStyle5(tokens.text), children: "Set up One-Tap deposits" }),
|
|
3510
|
+
/* @__PURE__ */ jsx("p", { style: subtitleStyle5(tokens.textSecondary), children: "Set your limit for instant deposits. Like a contactless card \u2014 you choose the max." }),
|
|
3511
|
+
error && /* @__PURE__ */ jsx("div", { style: errorBannerStyle3(tokens), children: error }),
|
|
3576
3512
|
/* @__PURE__ */ jsxs("div", { style: balanceRowStyle, children: [
|
|
3577
3513
|
/* @__PURE__ */ jsxs("div", { style: balanceLeftStyle, children: [
|
|
3578
3514
|
/* @__PURE__ */ jsx("div", { style: coinIconStyle(tokens.accent), children: /* @__PURE__ */ jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", children: [
|
|
@@ -3650,20 +3586,20 @@ function SetupScreen({
|
|
|
3650
3586
|
}
|
|
3651
3587
|
);
|
|
3652
3588
|
}
|
|
3653
|
-
var
|
|
3589
|
+
var headingStyle5 = (color) => ({
|
|
3654
3590
|
fontSize: "1.3rem",
|
|
3655
3591
|
fontWeight: 700,
|
|
3656
3592
|
letterSpacing: "-0.02em",
|
|
3657
3593
|
color,
|
|
3658
3594
|
margin: "8px 0 4px"
|
|
3659
3595
|
});
|
|
3660
|
-
var
|
|
3596
|
+
var subtitleStyle5 = (color) => ({
|
|
3661
3597
|
fontSize: "0.86rem",
|
|
3662
3598
|
color,
|
|
3663
3599
|
margin: "0 0 24px",
|
|
3664
3600
|
lineHeight: 1.5
|
|
3665
3601
|
});
|
|
3666
|
-
var
|
|
3602
|
+
var errorBannerStyle3 = (tokens) => ({
|
|
3667
3603
|
background: tokens.errorBg,
|
|
3668
3604
|
border: `1px solid ${tokens.error}66`,
|
|
3669
3605
|
borderRadius: 16,
|
|
@@ -3931,7 +3867,7 @@ function DepositScreen({
|
|
|
3931
3867
|
"%)"
|
|
3932
3868
|
] }) : /* @__PURE__ */ jsx("div", { style: detailRowStyle(tokens.textMuted), children: "Fees calculated at time of transfer" })
|
|
3933
3869
|
] }),
|
|
3934
|
-
error && /* @__PURE__ */ jsx("div", { style:
|
|
3870
|
+
error && /* @__PURE__ */ jsx("div", { style: errorBannerStyle4(tokens), children: error })
|
|
3935
3871
|
]
|
|
3936
3872
|
}
|
|
3937
3873
|
);
|
|
@@ -3999,7 +3935,7 @@ var detailRowStyle = (color) => ({
|
|
|
3999
3935
|
color,
|
|
4000
3936
|
marginBottom: 4
|
|
4001
3937
|
});
|
|
4002
|
-
var
|
|
3938
|
+
var errorBannerStyle4 = (tokens) => ({
|
|
4003
3939
|
background: tokens.errorBg,
|
|
4004
3940
|
border: `1px solid ${tokens.error}66`,
|
|
4005
3941
|
borderRadius: 16,
|
|
@@ -4098,22 +4034,22 @@ function SuccessScreen({
|
|
|
4098
4034
|
right: /* @__PURE__ */ jsx(SettingsMenu, { onLogout })
|
|
4099
4035
|
}
|
|
4100
4036
|
),
|
|
4101
|
-
/* @__PURE__ */ jsxs("div", { style:
|
|
4037
|
+
/* @__PURE__ */ jsxs("div", { style: contentStyle4, children: [
|
|
4102
4038
|
succeeded ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4103
4039
|
/* @__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 }) }) }),
|
|
4104
|
-
/* @__PURE__ */ jsxs("h2", { style:
|
|
4040
|
+
/* @__PURE__ */ jsxs("h2", { style: headingStyle6(tokens.text), children: [
|
|
4105
4041
|
"$",
|
|
4106
4042
|
amount.toFixed(2),
|
|
4107
4043
|
" deposited"
|
|
4108
4044
|
] }),
|
|
4109
|
-
merchantName && /* @__PURE__ */ jsxs("p", { style:
|
|
4045
|
+
merchantName && /* @__PURE__ */ jsxs("p", { style: subtitleStyle6(tokens.textSecondary), children: [
|
|
4110
4046
|
"to ",
|
|
4111
4047
|
merchantName
|
|
4112
4048
|
] })
|
|
4113
4049
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4114
4050
|
/* @__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 }) }) }),
|
|
4115
|
-
/* @__PURE__ */ jsx("h2", { style:
|
|
4116
|
-
error && /* @__PURE__ */ jsx("p", { style:
|
|
4051
|
+
/* @__PURE__ */ jsx("h2", { style: headingStyle6(tokens.text), children: "Transfer failed" }),
|
|
4052
|
+
error && /* @__PURE__ */ jsx("p", { style: subtitleStyle6(tokens.error), children: error })
|
|
4117
4053
|
] }),
|
|
4118
4054
|
/* @__PURE__ */ jsxs("div", { style: summaryCardStyle(tokens), children: [
|
|
4119
4055
|
sourceName && /* @__PURE__ */ jsxs("div", { style: summaryRowStyle, children: [
|
|
@@ -4145,21 +4081,21 @@ function SuccessScreen({
|
|
|
4145
4081
|
}
|
|
4146
4082
|
);
|
|
4147
4083
|
}
|
|
4148
|
-
var
|
|
4084
|
+
var contentStyle4 = {
|
|
4149
4085
|
flex: 1,
|
|
4150
4086
|
display: "flex",
|
|
4151
4087
|
flexDirection: "column",
|
|
4152
4088
|
alignItems: "center",
|
|
4153
4089
|
paddingTop: 16
|
|
4154
4090
|
};
|
|
4155
|
-
var
|
|
4091
|
+
var headingStyle6 = (color) => ({
|
|
4156
4092
|
fontSize: "1.5rem",
|
|
4157
4093
|
fontWeight: 700,
|
|
4158
4094
|
letterSpacing: "-0.02em",
|
|
4159
4095
|
color,
|
|
4160
4096
|
margin: "20px 0 4px"
|
|
4161
4097
|
});
|
|
4162
|
-
var
|
|
4098
|
+
var subtitleStyle6 = (color) => ({
|
|
4163
4099
|
fontSize: "0.9rem",
|
|
4164
4100
|
color,
|
|
4165
4101
|
margin: "0 0 20px"
|
|
@@ -4265,7 +4201,7 @@ function SelectSourceScreen({
|
|
|
4265
4201
|
right: /* @__PURE__ */ jsx(SettingsMenu, { onLogout })
|
|
4266
4202
|
}
|
|
4267
4203
|
),
|
|
4268
|
-
/* @__PURE__ */ jsx("p", { style:
|
|
4204
|
+
/* @__PURE__ */ jsx("p", { style: subtitleStyle7(tokens.textMuted), children: "Choose which chain and token to pay from." }),
|
|
4269
4205
|
/* @__PURE__ */ jsx("label", { style: labelStyle2(tokens.textSecondary), children: "Chain" }),
|
|
4270
4206
|
/* @__PURE__ */ jsx("div", { style: optionListStyle, children: choices.map((chain) => {
|
|
4271
4207
|
const isSelected = chain.chainName === selectedChainName;
|
|
@@ -4322,7 +4258,7 @@ function SelectSourceScreen({
|
|
|
4322
4258
|
}
|
|
4323
4259
|
);
|
|
4324
4260
|
}
|
|
4325
|
-
var
|
|
4261
|
+
var subtitleStyle7 = (color) => ({
|
|
4326
4262
|
fontSize: "0.85rem",
|
|
4327
4263
|
color,
|
|
4328
4264
|
margin: "0 0 20px",
|
|
@@ -4437,8 +4373,8 @@ function AdvancedSourceScreen({
|
|
|
4437
4373
|
right: /* @__PURE__ */ jsx("span", { style: advancedBadgeStyle(tokens.accent), children: "Advanced" })
|
|
4438
4374
|
}
|
|
4439
4375
|
),
|
|
4440
|
-
/* @__PURE__ */ jsx("h2", { style:
|
|
4441
|
-
/* @__PURE__ */ jsx("p", { style:
|
|
4376
|
+
/* @__PURE__ */ jsx("h2", { style: headingStyle7(tokens.text), children: "Set up One-Tap deposits" }),
|
|
4377
|
+
/* @__PURE__ */ jsx("p", { style: subtitleStyle8(tokens.textSecondary), children: "Select a token source for your One-Tap deposits." }),
|
|
4442
4378
|
/* @__PURE__ */ jsx("label", { style: labelStyle3(tokens.textSecondary), children: "Select tokens to approve" }),
|
|
4443
4379
|
/* @__PURE__ */ jsx("div", { style: chainListStyle, children: choices.map((chain) => {
|
|
4444
4380
|
const isExpanded = expandedChain === chain.chainName;
|
|
@@ -4501,14 +4437,14 @@ var advancedBadgeStyle = (color) => ({
|
|
|
4501
4437
|
padding: "3px 10px",
|
|
4502
4438
|
letterSpacing: "0.02em"
|
|
4503
4439
|
});
|
|
4504
|
-
var
|
|
4440
|
+
var headingStyle7 = (color) => ({
|
|
4505
4441
|
fontSize: "1.3rem",
|
|
4506
4442
|
fontWeight: 700,
|
|
4507
4443
|
letterSpacing: "-0.02em",
|
|
4508
4444
|
color,
|
|
4509
4445
|
margin: "8px 0 4px"
|
|
4510
4446
|
});
|
|
4511
|
-
var
|
|
4447
|
+
var subtitleStyle8 = (color) => ({
|
|
4512
4448
|
fontSize: "0.86rem",
|
|
4513
4449
|
color,
|
|
4514
4450
|
margin: "0 0 20px",
|
|
@@ -4636,16 +4572,16 @@ function TransferStatusScreen({
|
|
|
4636
4572
|
const steps = buildSteps(phase);
|
|
4637
4573
|
return /* @__PURE__ */ jsxs(ScreenLayout, { children: [
|
|
4638
4574
|
/* @__PURE__ */ jsx(ScreenHeader, { right: /* @__PURE__ */ jsx(SettingsMenu, { onLogout }) }),
|
|
4639
|
-
/* @__PURE__ */ jsxs("div", { style:
|
|
4575
|
+
/* @__PURE__ */ jsxs("div", { style: contentStyle5, children: [
|
|
4640
4576
|
/* @__PURE__ */ jsx(Spinner, { size: 48 }),
|
|
4641
|
-
/* @__PURE__ */ jsx("h2", { style:
|
|
4642
|
-
error && /* @__PURE__ */ jsx("div", { style:
|
|
4577
|
+
/* @__PURE__ */ jsx("h2", { style: headingStyle8(tokens.text), children: "Processing Transfer..." }),
|
|
4578
|
+
error && /* @__PURE__ */ jsx("div", { style: errorBannerStyle5(tokens), children: error }),
|
|
4643
4579
|
/* @__PURE__ */ jsx("div", { style: stepsWrapStyle, children: /* @__PURE__ */ jsx(StepList, { steps }) }),
|
|
4644
4580
|
/* @__PURE__ */ jsx("p", { style: waitHintStyle(tokens.textMuted), children: "Usually takes a few seconds" })
|
|
4645
4581
|
] })
|
|
4646
4582
|
] });
|
|
4647
4583
|
}
|
|
4648
|
-
var
|
|
4584
|
+
var contentStyle5 = {
|
|
4649
4585
|
flex: 1,
|
|
4650
4586
|
display: "flex",
|
|
4651
4587
|
flexDirection: "column",
|
|
@@ -4654,14 +4590,14 @@ var contentStyle6 = {
|
|
|
4654
4590
|
textAlign: "center",
|
|
4655
4591
|
padding: "0 24px"
|
|
4656
4592
|
};
|
|
4657
|
-
var
|
|
4593
|
+
var headingStyle8 = (color) => ({
|
|
4658
4594
|
fontSize: "1.45rem",
|
|
4659
4595
|
fontWeight: 700,
|
|
4660
4596
|
letterSpacing: "-0.02em",
|
|
4661
4597
|
color,
|
|
4662
4598
|
margin: "20px 0 16px"
|
|
4663
4599
|
});
|
|
4664
|
-
var
|
|
4600
|
+
var errorBannerStyle5 = (tokens) => ({
|
|
4665
4601
|
background: tokens.errorBg,
|
|
4666
4602
|
border: `1px solid ${tokens.error}66`,
|
|
4667
4603
|
borderRadius: 16,
|
|
@@ -4721,10 +4657,10 @@ function OpenWalletScreen({
|
|
|
4721
4657
|
] }),
|
|
4722
4658
|
children: [
|
|
4723
4659
|
/* @__PURE__ */ jsx(ScreenHeader, { right: /* @__PURE__ */ jsx(SettingsMenu, { onLogout }) }),
|
|
4724
|
-
/* @__PURE__ */ jsxs("div", { style:
|
|
4660
|
+
/* @__PURE__ */ jsxs("div", { style: contentStyle6, children: [
|
|
4725
4661
|
logoSrc ? /* @__PURE__ */ jsx("img", { src: logoSrc, alt: displayName, style: logoStyle }) : /* @__PURE__ */ jsx(Spinner, { size: 48 }),
|
|
4726
|
-
/* @__PURE__ */ jsx("h2", { style:
|
|
4727
|
-
/* @__PURE__ */ jsx("p", { style:
|
|
4662
|
+
/* @__PURE__ */ jsx("h2", { style: headingStyle9(tokens.text), children: loading ? "Connecting..." : `Open ${displayName}` }),
|
|
4663
|
+
/* @__PURE__ */ jsx("p", { style: subtitleStyle9(tokens.textSecondary), children: loading ? "Creating transfer and preparing your wallet link..." : `Continue in ${displayName} to authorize this connection.` }),
|
|
4728
4664
|
!loading && /* @__PURE__ */ jsxs("div", { style: waitingBadgeStyle(tokens), children: [
|
|
4729
4665
|
/* @__PURE__ */ jsx(Spinner, { size: 14 }),
|
|
4730
4666
|
/* @__PURE__ */ jsx("span", { children: "Waiting for authorization..." })
|
|
@@ -4734,7 +4670,7 @@ function OpenWalletScreen({
|
|
|
4734
4670
|
}
|
|
4735
4671
|
);
|
|
4736
4672
|
}
|
|
4737
|
-
var
|
|
4673
|
+
var contentStyle6 = {
|
|
4738
4674
|
flex: 1,
|
|
4739
4675
|
display: "flex",
|
|
4740
4676
|
flexDirection: "column",
|
|
@@ -4754,14 +4690,14 @@ var logoStyle = {
|
|
|
4754
4690
|
borderRadius: 14,
|
|
4755
4691
|
objectFit: "contain"
|
|
4756
4692
|
};
|
|
4757
|
-
var
|
|
4693
|
+
var headingStyle9 = (color) => ({
|
|
4758
4694
|
fontSize: "1.45rem",
|
|
4759
4695
|
fontWeight: 700,
|
|
4760
4696
|
letterSpacing: "-0.02em",
|
|
4761
4697
|
color,
|
|
4762
4698
|
margin: "20px 0 8px"
|
|
4763
4699
|
});
|
|
4764
|
-
var
|
|
4700
|
+
var subtitleStyle9 = (color) => ({
|
|
4765
4701
|
fontSize: "0.9rem",
|
|
4766
4702
|
color,
|
|
4767
4703
|
margin: "0 0 24px",
|
|
@@ -4805,10 +4741,10 @@ function ConfirmSignScreen({
|
|
|
4805
4741
|
] }),
|
|
4806
4742
|
children: [
|
|
4807
4743
|
/* @__PURE__ */ jsx(ScreenHeader, { right: /* @__PURE__ */ jsx(SettingsMenu, { onLogout }) }),
|
|
4808
|
-
/* @__PURE__ */ jsxs("div", { style:
|
|
4744
|
+
/* @__PURE__ */ jsxs("div", { style: contentStyle7, children: [
|
|
4809
4745
|
logoSrc ? /* @__PURE__ */ jsx("img", { src: logoSrc, alt: displayName, style: logoStyle2 }) : /* @__PURE__ */ jsx(Spinner, { size: 48 }),
|
|
4810
|
-
/* @__PURE__ */ jsx("h2", { style:
|
|
4811
|
-
/* @__PURE__ */ jsxs("p", { style:
|
|
4746
|
+
/* @__PURE__ */ jsx("h2", { style: headingStyle10(tokens.text), children: "Wallet authorized" }),
|
|
4747
|
+
/* @__PURE__ */ jsxs("p", { style: subtitleStyle10(tokens.textSecondary), children: [
|
|
4812
4748
|
displayName,
|
|
4813
4749
|
" approved the connection. Tap below to confirm your payment."
|
|
4814
4750
|
] }),
|
|
@@ -4821,7 +4757,7 @@ function ConfirmSignScreen({
|
|
|
4821
4757
|
}
|
|
4822
4758
|
);
|
|
4823
4759
|
}
|
|
4824
|
-
var
|
|
4760
|
+
var contentStyle7 = {
|
|
4825
4761
|
flex: 1,
|
|
4826
4762
|
display: "flex",
|
|
4827
4763
|
flexDirection: "column",
|
|
@@ -4836,14 +4772,14 @@ var logoStyle2 = {
|
|
|
4836
4772
|
borderRadius: 14,
|
|
4837
4773
|
objectFit: "contain"
|
|
4838
4774
|
};
|
|
4839
|
-
var
|
|
4775
|
+
var headingStyle10 = (color) => ({
|
|
4840
4776
|
fontSize: "1.45rem",
|
|
4841
4777
|
fontWeight: 700,
|
|
4842
4778
|
letterSpacing: "-0.02em",
|
|
4843
4779
|
color,
|
|
4844
4780
|
margin: "20px 0 8px"
|
|
4845
4781
|
});
|
|
4846
|
-
var
|
|
4782
|
+
var subtitleStyle10 = (color) => ({
|
|
4847
4783
|
fontSize: "0.9rem",
|
|
4848
4784
|
color,
|
|
4849
4785
|
margin: "0 0 24px",
|
|
@@ -4945,20 +4881,6 @@ function StepRenderer({
|
|
|
4945
4881
|
}
|
|
4946
4882
|
);
|
|
4947
4883
|
}
|
|
4948
|
-
if ((step === "login" || step === "otp-verify") && authenticated) {
|
|
4949
|
-
return /* @__PURE__ */ jsx(CenteredSpinner, { label: "Verifying your passkey...test2" });
|
|
4950
|
-
}
|
|
4951
|
-
if (step === "verify-passkey") {
|
|
4952
|
-
return /* @__PURE__ */ jsx(
|
|
4953
|
-
VerifyPasskeyScreen,
|
|
4954
|
-
{
|
|
4955
|
-
onVerify: handlers.onVerifyPasskeyViaPopup,
|
|
4956
|
-
onBack: handlers.onLogout,
|
|
4957
|
-
verifying: state.verifyingPasskeyPopup,
|
|
4958
|
-
error: state.error
|
|
4959
|
-
}
|
|
4960
|
-
);
|
|
4961
|
-
}
|
|
4962
4884
|
if (step === "create-passkey") {
|
|
4963
4885
|
return /* @__PURE__ */ jsx(
|
|
4964
4886
|
CreatePasskeyScreen,
|
|
@@ -5139,7 +5061,7 @@ var PaymentErrorBoundary = class extends Component {
|
|
|
5139
5061
|
/* @__PURE__ */ jsx("path", { d: "M12 8v5", stroke: "#ef4444", strokeWidth: "1.5", strokeLinecap: "round" }),
|
|
5140
5062
|
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "16", r: "0.75", fill: "#ef4444" })
|
|
5141
5063
|
] }) }),
|
|
5142
|
-
/* @__PURE__ */ jsx("h2", { style:
|
|
5064
|
+
/* @__PURE__ */ jsx("h2", { style: headingStyle11, children: "Something went wrong" }),
|
|
5143
5065
|
/* @__PURE__ */ jsx("p", { style: messageStyle, children: "An unexpected error occurred. Please try again." }),
|
|
5144
5066
|
/* @__PURE__ */ jsx("button", { type: "button", onClick: this.handleReset, style: buttonStyle3, children: "Try again" })
|
|
5145
5067
|
] });
|
|
@@ -5159,7 +5081,7 @@ var containerStyle8 = {
|
|
|
5159
5081
|
var iconStyle4 = {
|
|
5160
5082
|
marginBottom: 20
|
|
5161
5083
|
};
|
|
5162
|
-
var
|
|
5084
|
+
var headingStyle11 = {
|
|
5163
5085
|
fontSize: "1.25rem",
|
|
5164
5086
|
fontWeight: 700,
|
|
5165
5087
|
color: "#1a1a1a",
|
|
@@ -5234,6 +5156,8 @@ function SwypePaymentInner({
|
|
|
5234
5156
|
const onCompleteRef = useRef(onComplete);
|
|
5235
5157
|
onCompleteRef.current = onComplete;
|
|
5236
5158
|
const pollingRef = useRef(null);
|
|
5159
|
+
const getAccessTokenRef = useRef(getAccessToken);
|
|
5160
|
+
getAccessTokenRef.current = getAccessToken;
|
|
5237
5161
|
const handleAuthorizedMobileReturnRef = useRef(
|
|
5238
5162
|
null
|
|
5239
5163
|
);
|
|
@@ -5921,7 +5845,7 @@ function SwypePaymentInner({
|
|
|
5921
5845
|
try {
|
|
5922
5846
|
let token = null;
|
|
5923
5847
|
for (let attempt = 0; attempt < 3; attempt++) {
|
|
5924
|
-
token = await
|
|
5848
|
+
token = await getAccessTokenRef.current();
|
|
5925
5849
|
if (token || cancelled) break;
|
|
5926
5850
|
await new Promise((r) => setTimeout(r, 1e3));
|
|
5927
5851
|
}
|
|
@@ -5977,7 +5901,7 @@ function SwypePaymentInner({
|
|
|
5977
5901
|
return () => {
|
|
5978
5902
|
cancelled = true;
|
|
5979
5903
|
};
|
|
5980
|
-
}, [ready, authenticated, state.step, apiBaseUrl,
|
|
5904
|
+
}, [ready, authenticated, state.step, apiBaseUrl, state.activeCredentialId]);
|
|
5981
5905
|
useEffect(() => {
|
|
5982
5906
|
const loadAction = resolveDataLoadAction({
|
|
5983
5907
|
authenticated,
|