@swype-org/react-sdk 0.1.109 → 0.1.112
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 +217 -45
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +217 -45
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2207,7 +2207,7 @@ var containerStyle = {
|
|
|
2207
2207
|
display: "flex",
|
|
2208
2208
|
alignItems: "center",
|
|
2209
2209
|
justifyContent: "center",
|
|
2210
|
-
|
|
2210
|
+
height: "100%",
|
|
2211
2211
|
flex: 1,
|
|
2212
2212
|
background: "transparent"
|
|
2213
2213
|
};
|
|
@@ -2249,7 +2249,7 @@ function ScreenLayout({ children, footer }) {
|
|
|
2249
2249
|
var containerStyle2 = (bg) => ({
|
|
2250
2250
|
display: "flex",
|
|
2251
2251
|
flexDirection: "column",
|
|
2252
|
-
|
|
2252
|
+
height: "100%",
|
|
2253
2253
|
maxWidth: 420,
|
|
2254
2254
|
width: "100%",
|
|
2255
2255
|
margin: "0 auto",
|
|
@@ -3816,7 +3816,7 @@ var dividerTextStyle = (color) => ({
|
|
|
3816
3816
|
whiteSpace: "nowrap"
|
|
3817
3817
|
});
|
|
3818
3818
|
var DEFAULT_MAX = 500;
|
|
3819
|
-
var ABSOLUTE_MIN =
|
|
3819
|
+
var ABSOLUTE_MIN = 0.01;
|
|
3820
3820
|
function SetupScreen({
|
|
3821
3821
|
availableBalance,
|
|
3822
3822
|
tokenCount,
|
|
@@ -3830,7 +3830,7 @@ function SetupScreen({
|
|
|
3830
3830
|
error
|
|
3831
3831
|
}) {
|
|
3832
3832
|
const { tokens } = useSwypeConfig();
|
|
3833
|
-
const effectiveMax =
|
|
3833
|
+
const effectiveMax = DEFAULT_MAX;
|
|
3834
3834
|
const effectiveMin = Math.min(ABSOLUTE_MIN, effectiveMax);
|
|
3835
3835
|
const [limit, setLimit] = react.useState(() => effectiveMax);
|
|
3836
3836
|
const [editing, setEditing] = react.useState(false);
|
|
@@ -3924,11 +3924,15 @@ function SetupScreen({
|
|
|
3924
3924
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3925
3925
|
"div",
|
|
3926
3926
|
{
|
|
3927
|
-
style:
|
|
3927
|
+
style: editableLimitStyle(tokens.text),
|
|
3928
3928
|
onClick: startEditing,
|
|
3929
3929
|
children: [
|
|
3930
3930
|
"$",
|
|
3931
|
-
limit.toFixed(2)
|
|
3931
|
+
limit.toFixed(2),
|
|
3932
|
+
/* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", style: pencilIconStyle(tokens.textMuted), children: [
|
|
3933
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16.474 5.408l2.118 2.117m-.756-3.982L12.109 9.27a2.118 2.118 0 00-.58 1.082L11 13l2.648-.53c.41-.082.786-.283 1.082-.579l5.727-5.727a1.853 1.853 0 10-2.621-2.621z", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
3934
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M19 15v3a2 2 0 01-2 2H5a2 2 0 01-2-2V6a2 2 0 012-2h3", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
3935
|
+
] })
|
|
3932
3936
|
]
|
|
3933
3937
|
}
|
|
3934
3938
|
)
|
|
@@ -4036,6 +4040,18 @@ var limitValueStyle = (color) => ({
|
|
|
4036
4040
|
color,
|
|
4037
4041
|
marginBottom: 12
|
|
4038
4042
|
});
|
|
4043
|
+
var editableLimitStyle = (color) => ({
|
|
4044
|
+
...limitValueStyle(color),
|
|
4045
|
+
cursor: "pointer",
|
|
4046
|
+
display: "inline-flex",
|
|
4047
|
+
alignItems: "center",
|
|
4048
|
+
gap: 6
|
|
4049
|
+
});
|
|
4050
|
+
var pencilIconStyle = (color) => ({
|
|
4051
|
+
color,
|
|
4052
|
+
opacity: 0.6,
|
|
4053
|
+
flexShrink: 0
|
|
4054
|
+
});
|
|
4039
4055
|
var limitInputStyle = (color) => ({
|
|
4040
4056
|
fontSize: "2.2rem",
|
|
4041
4057
|
fontWeight: 700,
|
|
@@ -4063,6 +4079,108 @@ var linkStyle = (color) => ({
|
|
|
4063
4079
|
padding: 0,
|
|
4064
4080
|
marginBottom: 16
|
|
4065
4081
|
});
|
|
4082
|
+
function SetupStatusScreen({
|
|
4083
|
+
complete,
|
|
4084
|
+
limit,
|
|
4085
|
+
tokensApproved,
|
|
4086
|
+
merchantName,
|
|
4087
|
+
onContinue,
|
|
4088
|
+
onLogout,
|
|
4089
|
+
error
|
|
4090
|
+
}) {
|
|
4091
|
+
const { tokens } = useSwypeConfig();
|
|
4092
|
+
const steps = complete ? [
|
|
4093
|
+
{
|
|
4094
|
+
label: "One-Tap ready",
|
|
4095
|
+
detail: `$${limit} limit \xB7 ${tokensApproved} token${tokensApproved !== 1 ? "s" : ""} approved`,
|
|
4096
|
+
status: "complete"
|
|
4097
|
+
},
|
|
4098
|
+
{ label: "Done", status: "complete" }
|
|
4099
|
+
] : [
|
|
4100
|
+
{
|
|
4101
|
+
label: "Setting up Wallet",
|
|
4102
|
+
status: "active"
|
|
4103
|
+
},
|
|
4104
|
+
{ label: "Done", status: "pending" }
|
|
4105
|
+
];
|
|
4106
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4107
|
+
ScreenLayout,
|
|
4108
|
+
{
|
|
4109
|
+
footer: complete ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4110
|
+
/* @__PURE__ */ jsxRuntime.jsx(PrimaryButton, { onClick: onContinue, children: merchantName ? `Return to ${merchantName}` : "Continue" }),
|
|
4111
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: swipeHintStyle(tokens.textMuted), children: "Swipe to deposit \u2014 no approvals needed." })
|
|
4112
|
+
] }) : void 0,
|
|
4113
|
+
children: [
|
|
4114
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { right: /* @__PURE__ */ jsxRuntime.jsx(SettingsMenu, { onLogout }) }),
|
|
4115
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle5, children: [
|
|
4116
|
+
complete ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4117
|
+
/* @__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 }) }) }),
|
|
4118
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle6(tokens.text), children: "You're all set!" })
|
|
4119
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4120
|
+
/* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 48 }),
|
|
4121
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle6(tokens.text), children: "Setting up One-Tap..." })
|
|
4122
|
+
] }),
|
|
4123
|
+
error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorBannerStyle4(tokens), children: error }),
|
|
4124
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: stepsWrapStyle, children: /* @__PURE__ */ jsxRuntime.jsx(StepList, { steps }) }),
|
|
4125
|
+
!complete && /* @__PURE__ */ jsxRuntime.jsx("p", { style: waitHintStyle(tokens.textMuted), children: "Usually takes a few seconds" }),
|
|
4126
|
+
complete && /* @__PURE__ */ jsxRuntime.jsx("p", { style: readyHintStyle(tokens.textSecondary), children: "You can now deposit instantly from any partner app." })
|
|
4127
|
+
] })
|
|
4128
|
+
]
|
|
4129
|
+
}
|
|
4130
|
+
);
|
|
4131
|
+
}
|
|
4132
|
+
var contentStyle5 = {
|
|
4133
|
+
flex: 1,
|
|
4134
|
+
display: "flex",
|
|
4135
|
+
flexDirection: "column",
|
|
4136
|
+
alignItems: "center",
|
|
4137
|
+
justifyContent: "center",
|
|
4138
|
+
textAlign: "center",
|
|
4139
|
+
padding: "0 24px 32px"
|
|
4140
|
+
};
|
|
4141
|
+
var headingStyle6 = (color) => ({
|
|
4142
|
+
fontSize: "1.45rem",
|
|
4143
|
+
fontWeight: 700,
|
|
4144
|
+
letterSpacing: "-0.02em",
|
|
4145
|
+
color,
|
|
4146
|
+
margin: "20px 0 16px"
|
|
4147
|
+
});
|
|
4148
|
+
var errorBannerStyle4 = (tokens) => ({
|
|
4149
|
+
background: tokens.errorBg,
|
|
4150
|
+
border: `1px solid ${tokens.error}66`,
|
|
4151
|
+
borderRadius: 16,
|
|
4152
|
+
padding: "11px 14px",
|
|
4153
|
+
color: tokens.error,
|
|
4154
|
+
fontSize: "0.84rem",
|
|
4155
|
+
marginBottom: 14,
|
|
4156
|
+
lineHeight: 1.5,
|
|
4157
|
+
width: "100%",
|
|
4158
|
+
textAlign: "left"
|
|
4159
|
+
});
|
|
4160
|
+
var stepsWrapStyle = {
|
|
4161
|
+
width: "100%",
|
|
4162
|
+
maxWidth: 280,
|
|
4163
|
+
textAlign: "left",
|
|
4164
|
+
marginBottom: 16
|
|
4165
|
+
};
|
|
4166
|
+
var waitHintStyle = (color) => ({
|
|
4167
|
+
fontSize: "0.82rem",
|
|
4168
|
+
color,
|
|
4169
|
+
margin: 0
|
|
4170
|
+
});
|
|
4171
|
+
var readyHintStyle = (color) => ({
|
|
4172
|
+
fontSize: "0.88rem",
|
|
4173
|
+
color,
|
|
4174
|
+
margin: "8px 0 0",
|
|
4175
|
+
lineHeight: 1.5,
|
|
4176
|
+
maxWidth: 280
|
|
4177
|
+
});
|
|
4178
|
+
var swipeHintStyle = (color) => ({
|
|
4179
|
+
textAlign: "center",
|
|
4180
|
+
fontSize: "0.8rem",
|
|
4181
|
+
color,
|
|
4182
|
+
margin: "12px 0 0"
|
|
4183
|
+
});
|
|
4066
4184
|
var MIN_DEPOSIT = 0.25;
|
|
4067
4185
|
function DepositScreen({
|
|
4068
4186
|
merchantName,
|
|
@@ -4240,7 +4358,7 @@ function DepositScreen({
|
|
|
4240
4358
|
"%)"
|
|
4241
4359
|
] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: detailRowStyle(tokens.textMuted), children: "Fees calculated at time of transfer" })
|
|
4242
4360
|
] }),
|
|
4243
|
-
error && /* @__PURE__ */ jsxRuntime.jsx("div", { style:
|
|
4361
|
+
error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorBannerStyle5(tokens), children: error })
|
|
4244
4362
|
]
|
|
4245
4363
|
}
|
|
4246
4364
|
);
|
|
@@ -4308,7 +4426,7 @@ var detailRowStyle = (color) => ({
|
|
|
4308
4426
|
color,
|
|
4309
4427
|
marginBottom: 4
|
|
4310
4428
|
});
|
|
4311
|
-
var
|
|
4429
|
+
var errorBannerStyle5 = (tokens) => ({
|
|
4312
4430
|
background: tokens.errorBg,
|
|
4313
4431
|
border: `1px solid ${tokens.error}66`,
|
|
4314
4432
|
borderRadius: 16,
|
|
@@ -4407,10 +4525,10 @@ function SuccessScreen({
|
|
|
4407
4525
|
right: /* @__PURE__ */ jsxRuntime.jsx(SettingsMenu, { onLogout })
|
|
4408
4526
|
}
|
|
4409
4527
|
),
|
|
4410
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style:
|
|
4528
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle6, children: [
|
|
4411
4529
|
succeeded ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4412
4530
|
/* @__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 }) }) }),
|
|
4413
|
-
/* @__PURE__ */ jsxRuntime.jsxs("h2", { style:
|
|
4531
|
+
/* @__PURE__ */ jsxRuntime.jsxs("h2", { style: headingStyle7(tokens.text), children: [
|
|
4414
4532
|
"$",
|
|
4415
4533
|
amount.toFixed(2),
|
|
4416
4534
|
" deposited"
|
|
@@ -4421,7 +4539,7 @@ function SuccessScreen({
|
|
|
4421
4539
|
] })
|
|
4422
4540
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4423
4541
|
/* @__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 }) }) }),
|
|
4424
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { style:
|
|
4542
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle7(tokens.text), children: "Transfer failed" }),
|
|
4425
4543
|
error && /* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle6(tokens.error), children: error })
|
|
4426
4544
|
] }),
|
|
4427
4545
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: summaryCardStyle(tokens), children: [
|
|
@@ -4454,14 +4572,14 @@ function SuccessScreen({
|
|
|
4454
4572
|
}
|
|
4455
4573
|
);
|
|
4456
4574
|
}
|
|
4457
|
-
var
|
|
4575
|
+
var contentStyle6 = {
|
|
4458
4576
|
flex: 1,
|
|
4459
4577
|
display: "flex",
|
|
4460
4578
|
flexDirection: "column",
|
|
4461
4579
|
alignItems: "center",
|
|
4462
4580
|
paddingTop: 16
|
|
4463
4581
|
};
|
|
4464
|
-
var
|
|
4582
|
+
var headingStyle7 = (color) => ({
|
|
4465
4583
|
fontSize: "1.5rem",
|
|
4466
4584
|
fontWeight: 700,
|
|
4467
4585
|
letterSpacing: "-0.02em",
|
|
@@ -4746,7 +4864,7 @@ function AdvancedSourceScreen({
|
|
|
4746
4864
|
right: /* @__PURE__ */ jsxRuntime.jsx("span", { style: advancedBadgeStyle(tokens.accent), children: "Advanced" })
|
|
4747
4865
|
}
|
|
4748
4866
|
),
|
|
4749
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { style:
|
|
4867
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle8(tokens.text), children: "Set up One-Tap deposits" }),
|
|
4750
4868
|
/* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle8(tokens.textSecondary), children: "Select a token source for your One-Tap deposits." }),
|
|
4751
4869
|
/* @__PURE__ */ jsxRuntime.jsx("label", { style: labelStyle3(tokens.textSecondary), children: "Select tokens to approve" }),
|
|
4752
4870
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: chainListStyle, children: choices.map((chain) => {
|
|
@@ -4810,7 +4928,7 @@ var advancedBadgeStyle = (color) => ({
|
|
|
4810
4928
|
padding: "3px 10px",
|
|
4811
4929
|
letterSpacing: "0.02em"
|
|
4812
4930
|
});
|
|
4813
|
-
var
|
|
4931
|
+
var headingStyle8 = (color) => ({
|
|
4814
4932
|
fontSize: "1.3rem",
|
|
4815
4933
|
fontWeight: 700,
|
|
4816
4934
|
letterSpacing: "-0.02em",
|
|
@@ -4945,16 +5063,16 @@ function TransferStatusScreen({
|
|
|
4945
5063
|
const steps = buildSteps(phase);
|
|
4946
5064
|
return /* @__PURE__ */ jsxRuntime.jsxs(ScreenLayout, { children: [
|
|
4947
5065
|
/* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { right: /* @__PURE__ */ jsxRuntime.jsx(SettingsMenu, { onLogout }) }),
|
|
4948
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style:
|
|
5066
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle7, children: [
|
|
4949
5067
|
/* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 48 }),
|
|
4950
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { style:
|
|
4951
|
-
error && /* @__PURE__ */ jsxRuntime.jsx("div", { style:
|
|
4952
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style:
|
|
4953
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { style:
|
|
5068
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle9(tokens.text), children: "Processing Transfer..." }),
|
|
5069
|
+
error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorBannerStyle6(tokens), children: error }),
|
|
5070
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: stepsWrapStyle2, children: /* @__PURE__ */ jsxRuntime.jsx(StepList, { steps }) }),
|
|
5071
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: waitHintStyle2(tokens.textMuted), children: "Usually takes a few seconds" })
|
|
4954
5072
|
] })
|
|
4955
5073
|
] });
|
|
4956
5074
|
}
|
|
4957
|
-
var
|
|
5075
|
+
var contentStyle7 = {
|
|
4958
5076
|
flex: 1,
|
|
4959
5077
|
display: "flex",
|
|
4960
5078
|
flexDirection: "column",
|
|
@@ -4963,14 +5081,14 @@ var contentStyle6 = {
|
|
|
4963
5081
|
textAlign: "center",
|
|
4964
5082
|
padding: "0 24px"
|
|
4965
5083
|
};
|
|
4966
|
-
var
|
|
5084
|
+
var headingStyle9 = (color) => ({
|
|
4967
5085
|
fontSize: "1.45rem",
|
|
4968
5086
|
fontWeight: 700,
|
|
4969
5087
|
letterSpacing: "-0.02em",
|
|
4970
5088
|
color,
|
|
4971
5089
|
margin: "20px 0 16px"
|
|
4972
5090
|
});
|
|
4973
|
-
var
|
|
5091
|
+
var errorBannerStyle6 = (tokens) => ({
|
|
4974
5092
|
background: tokens.errorBg,
|
|
4975
5093
|
border: `1px solid ${tokens.error}66`,
|
|
4976
5094
|
borderRadius: 16,
|
|
@@ -4982,13 +5100,13 @@ var errorBannerStyle5 = (tokens) => ({
|
|
|
4982
5100
|
width: "100%",
|
|
4983
5101
|
textAlign: "left"
|
|
4984
5102
|
});
|
|
4985
|
-
var
|
|
5103
|
+
var stepsWrapStyle2 = {
|
|
4986
5104
|
width: "100%",
|
|
4987
5105
|
maxWidth: 280,
|
|
4988
5106
|
textAlign: "left",
|
|
4989
5107
|
marginBottom: 16
|
|
4990
5108
|
};
|
|
4991
|
-
var
|
|
5109
|
+
var waitHintStyle2 = (color) => ({
|
|
4992
5110
|
fontSize: "0.82rem",
|
|
4993
5111
|
color,
|
|
4994
5112
|
margin: 0
|
|
@@ -5030,9 +5148,9 @@ function OpenWalletScreen({
|
|
|
5030
5148
|
] }),
|
|
5031
5149
|
children: [
|
|
5032
5150
|
/* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { right: /* @__PURE__ */ jsxRuntime.jsx(SettingsMenu, { onLogout }) }),
|
|
5033
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style:
|
|
5151
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle8, children: [
|
|
5034
5152
|
logoSrc ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: logoSrc, alt: displayName, style: logoStyle }) : /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 48 }),
|
|
5035
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { style:
|
|
5153
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle10(tokens.text), children: loading ? "Connecting..." : `Open ${displayName}` }),
|
|
5036
5154
|
/* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle9(tokens.textSecondary), children: loading ? "Creating transfer and preparing your wallet link..." : `Continue in ${displayName} to authorize this connection.` }),
|
|
5037
5155
|
!loading && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: waitingBadgeStyle(tokens), children: [
|
|
5038
5156
|
/* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 14 }),
|
|
@@ -5043,7 +5161,7 @@ function OpenWalletScreen({
|
|
|
5043
5161
|
}
|
|
5044
5162
|
);
|
|
5045
5163
|
}
|
|
5046
|
-
var
|
|
5164
|
+
var contentStyle8 = {
|
|
5047
5165
|
flex: 1,
|
|
5048
5166
|
display: "flex",
|
|
5049
5167
|
flexDirection: "column",
|
|
@@ -5063,7 +5181,7 @@ var logoStyle = {
|
|
|
5063
5181
|
borderRadius: 14,
|
|
5064
5182
|
objectFit: "contain"
|
|
5065
5183
|
};
|
|
5066
|
-
var
|
|
5184
|
+
var headingStyle10 = (color) => ({
|
|
5067
5185
|
fontSize: "1.45rem",
|
|
5068
5186
|
fontWeight: 700,
|
|
5069
5187
|
letterSpacing: "-0.02em",
|
|
@@ -5114,9 +5232,9 @@ function ConfirmSignScreen({
|
|
|
5114
5232
|
] }),
|
|
5115
5233
|
children: [
|
|
5116
5234
|
/* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { right: /* @__PURE__ */ jsxRuntime.jsx(SettingsMenu, { onLogout }) }),
|
|
5117
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style:
|
|
5235
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle9, children: [
|
|
5118
5236
|
logoSrc ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: logoSrc, alt: displayName, style: logoStyle2 }) : /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 48 }),
|
|
5119
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { style:
|
|
5237
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle11(tokens.text), children: "Wallet authorized" }),
|
|
5120
5238
|
/* @__PURE__ */ jsxRuntime.jsxs("p", { style: subtitleStyle10(tokens.textSecondary), children: [
|
|
5121
5239
|
displayName,
|
|
5122
5240
|
" approved the connection. Tap below to confirm your payment."
|
|
@@ -5130,7 +5248,7 @@ function ConfirmSignScreen({
|
|
|
5130
5248
|
}
|
|
5131
5249
|
);
|
|
5132
5250
|
}
|
|
5133
|
-
var
|
|
5251
|
+
var contentStyle9 = {
|
|
5134
5252
|
flex: 1,
|
|
5135
5253
|
display: "flex",
|
|
5136
5254
|
flexDirection: "column",
|
|
@@ -5145,7 +5263,7 @@ var logoStyle2 = {
|
|
|
5145
5263
|
borderRadius: 14,
|
|
5146
5264
|
objectFit: "contain"
|
|
5147
5265
|
};
|
|
5148
|
-
var
|
|
5266
|
+
var headingStyle11 = (color) => ({
|
|
5149
5267
|
fontSize: "1.45rem",
|
|
5150
5268
|
fontWeight: 700,
|
|
5151
5269
|
letterSpacing: "-0.02em",
|
|
@@ -5221,7 +5339,10 @@ function StepRenderer({
|
|
|
5221
5339
|
if (!ready) {
|
|
5222
5340
|
return /* @__PURE__ */ jsxRuntime.jsx(SwypeLoadingScreen, {});
|
|
5223
5341
|
}
|
|
5224
|
-
if (step === "login"
|
|
5342
|
+
if (step === "login") {
|
|
5343
|
+
if (authenticated) {
|
|
5344
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SwypeLoadingScreen, {});
|
|
5345
|
+
}
|
|
5225
5346
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5226
5347
|
LoginScreen,
|
|
5227
5348
|
{
|
|
@@ -5292,6 +5413,35 @@ function StepRenderer({
|
|
|
5292
5413
|
}
|
|
5293
5414
|
);
|
|
5294
5415
|
}
|
|
5416
|
+
if (step === "setup-status") {
|
|
5417
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5418
|
+
SetupStatusScreen,
|
|
5419
|
+
{
|
|
5420
|
+
complete: false,
|
|
5421
|
+
limit: state.oneTapLimit,
|
|
5422
|
+
tokensApproved: 0,
|
|
5423
|
+
merchantName,
|
|
5424
|
+
onContinue: () => handlers.onNavigate("setup"),
|
|
5425
|
+
onLogout: handlers.onLogout,
|
|
5426
|
+
error: state.error || authExecutorError
|
|
5427
|
+
}
|
|
5428
|
+
);
|
|
5429
|
+
}
|
|
5430
|
+
if (step === "setup") {
|
|
5431
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5432
|
+
SetupScreen,
|
|
5433
|
+
{
|
|
5434
|
+
availableBalance: selectedAccount ? selectedAccount.wallets.reduce((sum, w) => sum + w.balance.available.amount, 0) : maxSourceBalance,
|
|
5435
|
+
tokenCount,
|
|
5436
|
+
sourceName,
|
|
5437
|
+
onSetupOneTap: handlers.onSetupOneTap,
|
|
5438
|
+
onBack: () => handlers.onNavigate("deposit"),
|
|
5439
|
+
onLogout: handlers.onLogout,
|
|
5440
|
+
loading: state.creatingTransfer,
|
|
5441
|
+
error: state.error
|
|
5442
|
+
}
|
|
5443
|
+
);
|
|
5444
|
+
}
|
|
5295
5445
|
if (step === "confirm-sign") {
|
|
5296
5446
|
const providerName = state.providers.find((p) => p.id === state.selectedProviderId)?.name ?? null;
|
|
5297
5447
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5440,7 +5590,7 @@ var PaymentErrorBoundary = class extends react.Component {
|
|
|
5440
5590
|
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 8v5", stroke: "#ef4444", strokeWidth: "1.5", strokeLinecap: "round" }),
|
|
5441
5591
|
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "16", r: "0.75", fill: "#ef4444" })
|
|
5442
5592
|
] }) }),
|
|
5443
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { style:
|
|
5593
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle12, children: "Something went wrong" }),
|
|
5444
5594
|
/* @__PURE__ */ jsxRuntime.jsx("p", { style: messageStyle, children: "An unexpected error occurred. Please try again." }),
|
|
5445
5595
|
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: this.handleReset, style: buttonStyle3, children: "Try again" })
|
|
5446
5596
|
] });
|
|
@@ -5460,7 +5610,7 @@ var containerStyle8 = {
|
|
|
5460
5610
|
var iconStyle4 = {
|
|
5461
5611
|
marginBottom: 20
|
|
5462
5612
|
};
|
|
5463
|
-
var
|
|
5613
|
+
var headingStyle12 = {
|
|
5464
5614
|
fontSize: "1.25rem",
|
|
5465
5615
|
fontWeight: 700,
|
|
5466
5616
|
color: "#1a1a1a",
|
|
@@ -5996,7 +6146,16 @@ function SwypePaymentInner({
|
|
|
5996
6146
|
}
|
|
5997
6147
|
const provider = state.providers.find((p) => p.id === providerId);
|
|
5998
6148
|
const providerName = provider?.name ?? "Wallet";
|
|
5999
|
-
|
|
6149
|
+
const isMobile = !shouldUseWalletConnector({
|
|
6150
|
+
useWalletConnector: useWalletConnectorProp,
|
|
6151
|
+
userAgent: typeof navigator === "undefined" ? void 0 : navigator.userAgent
|
|
6152
|
+
});
|
|
6153
|
+
if (isMobile) {
|
|
6154
|
+
dispatch({ type: "PAY_STARTED", isSetupRedirect: true });
|
|
6155
|
+
} else {
|
|
6156
|
+
dispatch({ type: "PAY_STARTED", isSetupRedirect: false });
|
|
6157
|
+
dispatch({ type: "NAVIGATE", step: "setup-status" });
|
|
6158
|
+
}
|
|
6000
6159
|
try {
|
|
6001
6160
|
const token = await getAccessToken();
|
|
6002
6161
|
if (!token) throw new Error("Not authenticated");
|
|
@@ -6009,10 +6168,6 @@ function SwypePaymentInner({
|
|
|
6009
6168
|
});
|
|
6010
6169
|
const session = account.authorizationSessions?.[0];
|
|
6011
6170
|
if (!session) throw new Error("No authorization session returned.");
|
|
6012
|
-
const isMobile = !shouldUseWalletConnector({
|
|
6013
|
-
useWalletConnector: useWalletConnectorProp,
|
|
6014
|
-
userAgent: typeof navigator === "undefined" ? void 0 : navigator.userAgent
|
|
6015
|
-
});
|
|
6016
6171
|
if (isMobile) {
|
|
6017
6172
|
handlingMobileReturnRef.current = false;
|
|
6018
6173
|
mobileSetupFlowRef.current = true;
|
|
@@ -6029,7 +6184,7 @@ function SwypePaymentInner({
|
|
|
6029
6184
|
} else {
|
|
6030
6185
|
await authExecutor.executeSessionById(session.id);
|
|
6031
6186
|
await reloadAccounts();
|
|
6032
|
-
dispatch({ type: "NAVIGATE", step: "
|
|
6187
|
+
dispatch({ type: "NAVIGATE", step: "setup" });
|
|
6033
6188
|
}
|
|
6034
6189
|
} catch (err) {
|
|
6035
6190
|
captureException(err);
|
|
@@ -6073,6 +6228,20 @@ function SwypePaymentInner({
|
|
|
6073
6228
|
},
|
|
6074
6229
|
[state.accounts, depositAmount]
|
|
6075
6230
|
);
|
|
6231
|
+
const handleSetupOneTap = react.useCallback(async (limit) => {
|
|
6232
|
+
try {
|
|
6233
|
+
const token = await getAccessToken();
|
|
6234
|
+
if (!token) throw new Error("Not authenticated");
|
|
6235
|
+
await updateUserConfig(apiBaseUrl, token, { defaultAllowance: limit });
|
|
6236
|
+
dispatch({ type: "NAVIGATE", step: "deposit" });
|
|
6237
|
+
} catch (err) {
|
|
6238
|
+
captureException(err);
|
|
6239
|
+
dispatch({
|
|
6240
|
+
type: "SET_ERROR",
|
|
6241
|
+
error: err instanceof Error ? err.message : "Failed to save One-Tap limit"
|
|
6242
|
+
});
|
|
6243
|
+
}
|
|
6244
|
+
}, [getAccessToken, apiBaseUrl]);
|
|
6076
6245
|
const handleNewPayment = react.useCallback(() => {
|
|
6077
6246
|
clearMobileFlowState();
|
|
6078
6247
|
processingStartedAtRef.current = null;
|
|
@@ -6309,6 +6478,7 @@ function SwypePaymentInner({
|
|
|
6309
6478
|
checkPasskey();
|
|
6310
6479
|
return () => {
|
|
6311
6480
|
cancelled = true;
|
|
6481
|
+
checkingPasskeyRef.current = false;
|
|
6312
6482
|
};
|
|
6313
6483
|
}, [ready, authenticated, state.step, apiBaseUrl, state.activeCredentialId]);
|
|
6314
6484
|
react.useEffect(() => {
|
|
@@ -6520,7 +6690,7 @@ function SwypePaymentInner({
|
|
|
6520
6690
|
initializedSelectSourceActionRef.current = pendingSelectSourceAction.id;
|
|
6521
6691
|
}, [pendingSelectSourceAction, selectSourceChoices, selectSourceRecommended]);
|
|
6522
6692
|
react.useEffect(() => {
|
|
6523
|
-
if (pendingSelectSourceAction && (state.step === "processing" || state.step === "open-wallet")) {
|
|
6693
|
+
if (pendingSelectSourceAction && (state.step === "processing" || state.step === "open-wallet" || state.step === "setup-status")) {
|
|
6524
6694
|
preSelectSourceStepRef.current = state.step;
|
|
6525
6695
|
dispatch({ type: "NAVIGATE", step: "select-source" });
|
|
6526
6696
|
} else if (!pendingSelectSourceAction && state.step === "select-source") {
|
|
@@ -6556,7 +6726,8 @@ function SwypePaymentInner({
|
|
|
6556
6726
|
},
|
|
6557
6727
|
onSelectSourceChainChange: handleSelectSourceChainChange,
|
|
6558
6728
|
onSetSelectSourceTokenSymbol: setSelectSourceTokenSymbol,
|
|
6559
|
-
onConfirmSelectSource: handleConfirmSelectSource
|
|
6729
|
+
onConfirmSelectSource: handleConfirmSelectSource,
|
|
6730
|
+
onSetupOneTap: handleSetupOneTap
|
|
6560
6731
|
}), [
|
|
6561
6732
|
handleSendLoginCode,
|
|
6562
6733
|
handleVerifyLoginCode,
|
|
@@ -6574,7 +6745,8 @@ function SwypePaymentInner({
|
|
|
6574
6745
|
handleLogout,
|
|
6575
6746
|
handleNewPayment,
|
|
6576
6747
|
handleSelectSourceChainChange,
|
|
6577
|
-
handleConfirmSelectSource
|
|
6748
|
+
handleConfirmSelectSource,
|
|
6749
|
+
handleSetupOneTap
|
|
6578
6750
|
]);
|
|
6579
6751
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6580
6752
|
StepRenderer,
|