@swype-org/react-sdk 0.1.93 → 0.1.95
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 +62 -134
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +62 -134
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3187,72 +3187,6 @@ var errorBannerStyle2 = (tokens) => ({
|
|
|
3187
3187
|
width: "100%",
|
|
3188
3188
|
textAlign: "left"
|
|
3189
3189
|
});
|
|
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
3190
|
var WALLET_EMOJIS = {
|
|
3257
3191
|
rabby: "\u{1F430}",
|
|
3258
3192
|
ora: "\u2666\uFE0F",
|
|
@@ -3295,8 +3229,8 @@ function WalletPickerScreen({
|
|
|
3295
3229
|
children: [
|
|
3296
3230
|
/* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { title: "Set up Swype", onBack }),
|
|
3297
3231
|
hasPending && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3298
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { style:
|
|
3299
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { style:
|
|
3232
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle4(tokens.text), children: "Continue where you left off" }),
|
|
3233
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle4(tokens.textSecondary), children: "You have a wallet that still needs setup" }),
|
|
3300
3234
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: pendingListStyle, children: pendingConnections.map((acct) => {
|
|
3301
3235
|
const wallet = acct.wallets[0];
|
|
3302
3236
|
const address = wallet ? truncateAddress(wallet.name) : void 0;
|
|
@@ -3336,8 +3270,8 @@ function WalletPickerScreen({
|
|
|
3336
3270
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: dividerStyle2(tokens.border), children: /* @__PURE__ */ jsxRuntime.jsx("span", { style: dividerTextStyle(tokens.textMuted), children: "Or connect a new wallet" }) })
|
|
3337
3271
|
] }),
|
|
3338
3272
|
!hasPending && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3339
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { style:
|
|
3340
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { style:
|
|
3273
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle4(tokens.text), children: "Where are your stablecoins?" }),
|
|
3274
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle4(tokens.textSecondary), children: "Select the wallet you want to deposit from" })
|
|
3341
3275
|
] }),
|
|
3342
3276
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: gridStyle, children: [
|
|
3343
3277
|
displayProviders.map((p) => {
|
|
@@ -3390,14 +3324,14 @@ function WalletPickerScreen({
|
|
|
3390
3324
|
}
|
|
3391
3325
|
);
|
|
3392
3326
|
}
|
|
3393
|
-
var
|
|
3327
|
+
var headingStyle4 = (color) => ({
|
|
3394
3328
|
fontSize: "1.35rem",
|
|
3395
3329
|
fontWeight: 700,
|
|
3396
3330
|
letterSpacing: "-0.02em",
|
|
3397
3331
|
color,
|
|
3398
3332
|
margin: "8px 0 4px"
|
|
3399
3333
|
});
|
|
3400
|
-
var
|
|
3334
|
+
var subtitleStyle4 = (color) => ({
|
|
3401
3335
|
fontSize: "0.88rem",
|
|
3402
3336
|
color,
|
|
3403
3337
|
margin: "0 0 24px"
|
|
@@ -3573,9 +3507,9 @@ function SetupScreen({
|
|
|
3573
3507
|
] }),
|
|
3574
3508
|
children: [
|
|
3575
3509
|
/* @__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:
|
|
3510
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle5(tokens.text), children: "Set up One-Tap deposits" }),
|
|
3511
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle5(tokens.textSecondary), children: "Set your limit for instant deposits. Like a contactless card \u2014 you choose the max." }),
|
|
3512
|
+
error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorBannerStyle3(tokens), children: error }),
|
|
3579
3513
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: balanceRowStyle, children: [
|
|
3580
3514
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: balanceLeftStyle, children: [
|
|
3581
3515
|
/* @__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 +3587,20 @@ function SetupScreen({
|
|
|
3653
3587
|
}
|
|
3654
3588
|
);
|
|
3655
3589
|
}
|
|
3656
|
-
var
|
|
3590
|
+
var headingStyle5 = (color) => ({
|
|
3657
3591
|
fontSize: "1.3rem",
|
|
3658
3592
|
fontWeight: 700,
|
|
3659
3593
|
letterSpacing: "-0.02em",
|
|
3660
3594
|
color,
|
|
3661
3595
|
margin: "8px 0 4px"
|
|
3662
3596
|
});
|
|
3663
|
-
var
|
|
3597
|
+
var subtitleStyle5 = (color) => ({
|
|
3664
3598
|
fontSize: "0.86rem",
|
|
3665
3599
|
color,
|
|
3666
3600
|
margin: "0 0 24px",
|
|
3667
3601
|
lineHeight: 1.5
|
|
3668
3602
|
});
|
|
3669
|
-
var
|
|
3603
|
+
var errorBannerStyle3 = (tokens) => ({
|
|
3670
3604
|
background: tokens.errorBg,
|
|
3671
3605
|
border: `1px solid ${tokens.error}66`,
|
|
3672
3606
|
borderRadius: 16,
|
|
@@ -3934,7 +3868,7 @@ function DepositScreen({
|
|
|
3934
3868
|
"%)"
|
|
3935
3869
|
] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: detailRowStyle(tokens.textMuted), children: "Fees calculated at time of transfer" })
|
|
3936
3870
|
] }),
|
|
3937
|
-
error && /* @__PURE__ */ jsxRuntime.jsx("div", { style:
|
|
3871
|
+
error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorBannerStyle4(tokens), children: error })
|
|
3938
3872
|
]
|
|
3939
3873
|
}
|
|
3940
3874
|
);
|
|
@@ -4002,7 +3936,7 @@ var detailRowStyle = (color) => ({
|
|
|
4002
3936
|
color,
|
|
4003
3937
|
marginBottom: 4
|
|
4004
3938
|
});
|
|
4005
|
-
var
|
|
3939
|
+
var errorBannerStyle4 = (tokens) => ({
|
|
4006
3940
|
background: tokens.errorBg,
|
|
4007
3941
|
border: `1px solid ${tokens.error}66`,
|
|
4008
3942
|
borderRadius: 16,
|
|
@@ -4101,22 +4035,22 @@ function SuccessScreen({
|
|
|
4101
4035
|
right: /* @__PURE__ */ jsxRuntime.jsx(SettingsMenu, { onLogout })
|
|
4102
4036
|
}
|
|
4103
4037
|
),
|
|
4104
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style:
|
|
4038
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle4, children: [
|
|
4105
4039
|
succeeded ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4106
4040
|
/* @__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:
|
|
4041
|
+
/* @__PURE__ */ jsxRuntime.jsxs("h2", { style: headingStyle6(tokens.text), children: [
|
|
4108
4042
|
"$",
|
|
4109
4043
|
amount.toFixed(2),
|
|
4110
4044
|
" deposited"
|
|
4111
4045
|
] }),
|
|
4112
|
-
merchantName && /* @__PURE__ */ jsxRuntime.jsxs("p", { style:
|
|
4046
|
+
merchantName && /* @__PURE__ */ jsxRuntime.jsxs("p", { style: subtitleStyle6(tokens.textSecondary), children: [
|
|
4113
4047
|
"to ",
|
|
4114
4048
|
merchantName
|
|
4115
4049
|
] })
|
|
4116
4050
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4117
4051
|
/* @__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:
|
|
4052
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle6(tokens.text), children: "Transfer failed" }),
|
|
4053
|
+
error && /* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle6(tokens.error), children: error })
|
|
4120
4054
|
] }),
|
|
4121
4055
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: summaryCardStyle(tokens), children: [
|
|
4122
4056
|
sourceName && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: summaryRowStyle, children: [
|
|
@@ -4148,21 +4082,21 @@ function SuccessScreen({
|
|
|
4148
4082
|
}
|
|
4149
4083
|
);
|
|
4150
4084
|
}
|
|
4151
|
-
var
|
|
4085
|
+
var contentStyle4 = {
|
|
4152
4086
|
flex: 1,
|
|
4153
4087
|
display: "flex",
|
|
4154
4088
|
flexDirection: "column",
|
|
4155
4089
|
alignItems: "center",
|
|
4156
4090
|
paddingTop: 16
|
|
4157
4091
|
};
|
|
4158
|
-
var
|
|
4092
|
+
var headingStyle6 = (color) => ({
|
|
4159
4093
|
fontSize: "1.5rem",
|
|
4160
4094
|
fontWeight: 700,
|
|
4161
4095
|
letterSpacing: "-0.02em",
|
|
4162
4096
|
color,
|
|
4163
4097
|
margin: "20px 0 4px"
|
|
4164
4098
|
});
|
|
4165
|
-
var
|
|
4099
|
+
var subtitleStyle6 = (color) => ({
|
|
4166
4100
|
fontSize: "0.9rem",
|
|
4167
4101
|
color,
|
|
4168
4102
|
margin: "0 0 20px"
|
|
@@ -4268,7 +4202,7 @@ function SelectSourceScreen({
|
|
|
4268
4202
|
right: /* @__PURE__ */ jsxRuntime.jsx(SettingsMenu, { onLogout })
|
|
4269
4203
|
}
|
|
4270
4204
|
),
|
|
4271
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { style:
|
|
4205
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle7(tokens.textMuted), children: "Choose which chain and token to pay from." }),
|
|
4272
4206
|
/* @__PURE__ */ jsxRuntime.jsx("label", { style: labelStyle2(tokens.textSecondary), children: "Chain" }),
|
|
4273
4207
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: optionListStyle, children: choices.map((chain) => {
|
|
4274
4208
|
const isSelected = chain.chainName === selectedChainName;
|
|
@@ -4325,7 +4259,7 @@ function SelectSourceScreen({
|
|
|
4325
4259
|
}
|
|
4326
4260
|
);
|
|
4327
4261
|
}
|
|
4328
|
-
var
|
|
4262
|
+
var subtitleStyle7 = (color) => ({
|
|
4329
4263
|
fontSize: "0.85rem",
|
|
4330
4264
|
color,
|
|
4331
4265
|
margin: "0 0 20px",
|
|
@@ -4440,8 +4374,8 @@ function AdvancedSourceScreen({
|
|
|
4440
4374
|
right: /* @__PURE__ */ jsxRuntime.jsx("span", { style: advancedBadgeStyle(tokens.accent), children: "Advanced" })
|
|
4441
4375
|
}
|
|
4442
4376
|
),
|
|
4443
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { style:
|
|
4444
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { style:
|
|
4377
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle7(tokens.text), children: "Set up One-Tap deposits" }),
|
|
4378
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle8(tokens.textSecondary), children: "Select a token source for your One-Tap deposits." }),
|
|
4445
4379
|
/* @__PURE__ */ jsxRuntime.jsx("label", { style: labelStyle3(tokens.textSecondary), children: "Select tokens to approve" }),
|
|
4446
4380
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: chainListStyle, children: choices.map((chain) => {
|
|
4447
4381
|
const isExpanded = expandedChain === chain.chainName;
|
|
@@ -4504,14 +4438,14 @@ var advancedBadgeStyle = (color) => ({
|
|
|
4504
4438
|
padding: "3px 10px",
|
|
4505
4439
|
letterSpacing: "0.02em"
|
|
4506
4440
|
});
|
|
4507
|
-
var
|
|
4441
|
+
var headingStyle7 = (color) => ({
|
|
4508
4442
|
fontSize: "1.3rem",
|
|
4509
4443
|
fontWeight: 700,
|
|
4510
4444
|
letterSpacing: "-0.02em",
|
|
4511
4445
|
color,
|
|
4512
4446
|
margin: "8px 0 4px"
|
|
4513
4447
|
});
|
|
4514
|
-
var
|
|
4448
|
+
var subtitleStyle8 = (color) => ({
|
|
4515
4449
|
fontSize: "0.86rem",
|
|
4516
4450
|
color,
|
|
4517
4451
|
margin: "0 0 20px",
|
|
@@ -4639,16 +4573,16 @@ function TransferStatusScreen({
|
|
|
4639
4573
|
const steps = buildSteps(phase);
|
|
4640
4574
|
return /* @__PURE__ */ jsxRuntime.jsxs(ScreenLayout, { children: [
|
|
4641
4575
|
/* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { right: /* @__PURE__ */ jsxRuntime.jsx(SettingsMenu, { onLogout }) }),
|
|
4642
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style:
|
|
4576
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle5, children: [
|
|
4643
4577
|
/* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 48 }),
|
|
4644
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { style:
|
|
4645
|
-
error && /* @__PURE__ */ jsxRuntime.jsx("div", { style:
|
|
4578
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle8(tokens.text), children: "Processing Transfer..." }),
|
|
4579
|
+
error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorBannerStyle5(tokens), children: error }),
|
|
4646
4580
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: stepsWrapStyle, children: /* @__PURE__ */ jsxRuntime.jsx(StepList, { steps }) }),
|
|
4647
4581
|
/* @__PURE__ */ jsxRuntime.jsx("p", { style: waitHintStyle(tokens.textMuted), children: "Usually takes a few seconds" })
|
|
4648
4582
|
] })
|
|
4649
4583
|
] });
|
|
4650
4584
|
}
|
|
4651
|
-
var
|
|
4585
|
+
var contentStyle5 = {
|
|
4652
4586
|
flex: 1,
|
|
4653
4587
|
display: "flex",
|
|
4654
4588
|
flexDirection: "column",
|
|
@@ -4657,14 +4591,14 @@ var contentStyle6 = {
|
|
|
4657
4591
|
textAlign: "center",
|
|
4658
4592
|
padding: "0 24px"
|
|
4659
4593
|
};
|
|
4660
|
-
var
|
|
4594
|
+
var headingStyle8 = (color) => ({
|
|
4661
4595
|
fontSize: "1.45rem",
|
|
4662
4596
|
fontWeight: 700,
|
|
4663
4597
|
letterSpacing: "-0.02em",
|
|
4664
4598
|
color,
|
|
4665
4599
|
margin: "20px 0 16px"
|
|
4666
4600
|
});
|
|
4667
|
-
var
|
|
4601
|
+
var errorBannerStyle5 = (tokens) => ({
|
|
4668
4602
|
background: tokens.errorBg,
|
|
4669
4603
|
border: `1px solid ${tokens.error}66`,
|
|
4670
4604
|
borderRadius: 16,
|
|
@@ -4724,10 +4658,10 @@ function OpenWalletScreen({
|
|
|
4724
4658
|
] }),
|
|
4725
4659
|
children: [
|
|
4726
4660
|
/* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { right: /* @__PURE__ */ jsxRuntime.jsx(SettingsMenu, { onLogout }) }),
|
|
4727
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style:
|
|
4661
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle6, children: [
|
|
4728
4662
|
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:
|
|
4663
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle9(tokens.text), children: loading ? "Connecting..." : `Open ${displayName}` }),
|
|
4664
|
+
/* @__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
4665
|
!loading && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: waitingBadgeStyle(tokens), children: [
|
|
4732
4666
|
/* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 14 }),
|
|
4733
4667
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Waiting for authorization..." })
|
|
@@ -4737,7 +4671,7 @@ function OpenWalletScreen({
|
|
|
4737
4671
|
}
|
|
4738
4672
|
);
|
|
4739
4673
|
}
|
|
4740
|
-
var
|
|
4674
|
+
var contentStyle6 = {
|
|
4741
4675
|
flex: 1,
|
|
4742
4676
|
display: "flex",
|
|
4743
4677
|
flexDirection: "column",
|
|
@@ -4757,14 +4691,14 @@ var logoStyle = {
|
|
|
4757
4691
|
borderRadius: 14,
|
|
4758
4692
|
objectFit: "contain"
|
|
4759
4693
|
};
|
|
4760
|
-
var
|
|
4694
|
+
var headingStyle9 = (color) => ({
|
|
4761
4695
|
fontSize: "1.45rem",
|
|
4762
4696
|
fontWeight: 700,
|
|
4763
4697
|
letterSpacing: "-0.02em",
|
|
4764
4698
|
color,
|
|
4765
4699
|
margin: "20px 0 8px"
|
|
4766
4700
|
});
|
|
4767
|
-
var
|
|
4701
|
+
var subtitleStyle9 = (color) => ({
|
|
4768
4702
|
fontSize: "0.9rem",
|
|
4769
4703
|
color,
|
|
4770
4704
|
margin: "0 0 24px",
|
|
@@ -4808,10 +4742,10 @@ function ConfirmSignScreen({
|
|
|
4808
4742
|
] }),
|
|
4809
4743
|
children: [
|
|
4810
4744
|
/* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { right: /* @__PURE__ */ jsxRuntime.jsx(SettingsMenu, { onLogout }) }),
|
|
4811
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style:
|
|
4745
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle7, children: [
|
|
4812
4746
|
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:
|
|
4747
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle10(tokens.text), children: "Wallet authorized" }),
|
|
4748
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { style: subtitleStyle10(tokens.textSecondary), children: [
|
|
4815
4749
|
displayName,
|
|
4816
4750
|
" approved the connection. Tap below to confirm your payment."
|
|
4817
4751
|
] }),
|
|
@@ -4824,7 +4758,7 @@ function ConfirmSignScreen({
|
|
|
4824
4758
|
}
|
|
4825
4759
|
);
|
|
4826
4760
|
}
|
|
4827
|
-
var
|
|
4761
|
+
var contentStyle7 = {
|
|
4828
4762
|
flex: 1,
|
|
4829
4763
|
display: "flex",
|
|
4830
4764
|
flexDirection: "column",
|
|
@@ -4839,14 +4773,14 @@ var logoStyle2 = {
|
|
|
4839
4773
|
borderRadius: 14,
|
|
4840
4774
|
objectFit: "contain"
|
|
4841
4775
|
};
|
|
4842
|
-
var
|
|
4776
|
+
var headingStyle10 = (color) => ({
|
|
4843
4777
|
fontSize: "1.45rem",
|
|
4844
4778
|
fontWeight: 700,
|
|
4845
4779
|
letterSpacing: "-0.02em",
|
|
4846
4780
|
color,
|
|
4847
4781
|
margin: "20px 0 8px"
|
|
4848
4782
|
});
|
|
4849
|
-
var
|
|
4783
|
+
var subtitleStyle10 = (color) => ({
|
|
4850
4784
|
fontSize: "0.9rem",
|
|
4851
4785
|
color,
|
|
4852
4786
|
margin: "0 0 24px",
|
|
@@ -4948,20 +4882,6 @@ function StepRenderer({
|
|
|
4948
4882
|
}
|
|
4949
4883
|
);
|
|
4950
4884
|
}
|
|
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
4885
|
if (step === "create-passkey") {
|
|
4966
4886
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4967
4887
|
CreatePasskeyScreen,
|
|
@@ -5142,7 +5062,7 @@ var PaymentErrorBoundary = class extends react.Component {
|
|
|
5142
5062
|
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 8v5", stroke: "#ef4444", strokeWidth: "1.5", strokeLinecap: "round" }),
|
|
5143
5063
|
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "16", r: "0.75", fill: "#ef4444" })
|
|
5144
5064
|
] }) }),
|
|
5145
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { style:
|
|
5065
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle11, children: "Something went wrong" }),
|
|
5146
5066
|
/* @__PURE__ */ jsxRuntime.jsx("p", { style: messageStyle, children: "An unexpected error occurred. Please try again." }),
|
|
5147
5067
|
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: this.handleReset, style: buttonStyle3, children: "Try again" })
|
|
5148
5068
|
] });
|
|
@@ -5162,7 +5082,7 @@ var containerStyle8 = {
|
|
|
5162
5082
|
var iconStyle4 = {
|
|
5163
5083
|
marginBottom: 20
|
|
5164
5084
|
};
|
|
5165
|
-
var
|
|
5085
|
+
var headingStyle11 = {
|
|
5166
5086
|
fontSize: "1.25rem",
|
|
5167
5087
|
fontWeight: 700,
|
|
5168
5088
|
color: "#1a1a1a",
|
|
@@ -5237,6 +5157,8 @@ function SwypePaymentInner({
|
|
|
5237
5157
|
const onCompleteRef = react.useRef(onComplete);
|
|
5238
5158
|
onCompleteRef.current = onComplete;
|
|
5239
5159
|
const pollingRef = react.useRef(null);
|
|
5160
|
+
const getAccessTokenRef = react.useRef(getAccessToken);
|
|
5161
|
+
getAccessTokenRef.current = getAccessToken;
|
|
5240
5162
|
const handleAuthorizedMobileReturnRef = react.useRef(
|
|
5241
5163
|
null
|
|
5242
5164
|
);
|
|
@@ -5924,7 +5846,7 @@ function SwypePaymentInner({
|
|
|
5924
5846
|
try {
|
|
5925
5847
|
let token = null;
|
|
5926
5848
|
for (let attempt = 0; attempt < 3; attempt++) {
|
|
5927
|
-
token = await
|
|
5849
|
+
token = await getAccessTokenRef.current();
|
|
5928
5850
|
if (token || cancelled) break;
|
|
5929
5851
|
await new Promise((r) => setTimeout(r, 1e3));
|
|
5930
5852
|
}
|
|
@@ -5950,12 +5872,18 @@ function SwypePaymentInner({
|
|
|
5950
5872
|
return;
|
|
5951
5873
|
}
|
|
5952
5874
|
if (cancelled) return;
|
|
5875
|
+
const credentialIds = allPasskeys.map((p) => p.credentialId);
|
|
5876
|
+
let matched = null;
|
|
5953
5877
|
if (isSafari() && isInCrossOriginIframe()) {
|
|
5954
|
-
|
|
5955
|
-
|
|
5878
|
+
matched = await findDevicePasskeyViaPopup({
|
|
5879
|
+
credentialIds,
|
|
5880
|
+
rpId: resolvePasskeyRpId(),
|
|
5881
|
+
authToken: token ?? void 0,
|
|
5882
|
+
apiBaseUrl
|
|
5883
|
+
});
|
|
5884
|
+
} else {
|
|
5885
|
+
matched = await findDevicePasskey(credentialIds);
|
|
5956
5886
|
}
|
|
5957
|
-
const credentialIds = allPasskeys.map((p) => p.credentialId);
|
|
5958
|
-
const matched = await findDevicePasskey(credentialIds);
|
|
5959
5887
|
if (cancelled) return;
|
|
5960
5888
|
if (matched) {
|
|
5961
5889
|
dispatch({ type: "PASSKEY_ACTIVATED", credentialId: matched });
|
|
@@ -5974,7 +5902,7 @@ function SwypePaymentInner({
|
|
|
5974
5902
|
return () => {
|
|
5975
5903
|
cancelled = true;
|
|
5976
5904
|
};
|
|
5977
|
-
}, [ready, authenticated, state.step, apiBaseUrl,
|
|
5905
|
+
}, [ready, authenticated, state.step, apiBaseUrl, state.activeCredentialId]);
|
|
5978
5906
|
react.useEffect(() => {
|
|
5979
5907
|
const loadAction = resolveDataLoadAction({
|
|
5980
5908
|
authenticated,
|