@swype-org/react-sdk 0.1.204 → 0.1.206
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 +14 -88
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +14 -88
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3891,50 +3891,6 @@ function DepositScreen({
|
|
|
3891
3891
|
const isLowBalance = availableBalance < MIN_DEPOSIT;
|
|
3892
3892
|
const exceedsLimit = remainingLimit != null && amount > remainingLimit && !isLowBalance;
|
|
3893
3893
|
const canDeposit = amount >= MIN_DEPOSIT && !exceedsLimit && !isLowBalance && !processing;
|
|
3894
|
-
const headerTitle = merchantName ? `Deposit to ${merchantName}` : "Deposit";
|
|
3895
|
-
if (isLowBalance) {
|
|
3896
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3897
|
-
ScreenLayout,
|
|
3898
|
-
{
|
|
3899
|
-
footer: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3900
|
-
/* @__PURE__ */ jsxRuntime.jsx(PrimaryButton, { onClick: onSwitchWallet, children: "Switch wallet" }),
|
|
3901
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { style: switchHintStyle(tokens.textMuted), children: "Use a different wallet with more balance" }),
|
|
3902
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: outlineBtnWrapStyle, children: /* @__PURE__ */ jsxRuntime.jsx(OutlineButton, { onClick: onBack, children: "Back to deposit options" }) }),
|
|
3903
|
-
/* @__PURE__ */ jsxRuntime.jsx(PoweredByFooter, {})
|
|
3904
|
-
] }),
|
|
3905
|
-
children: [
|
|
3906
|
-
/* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { title: headerTitle, onBack, onLogout }),
|
|
3907
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: lowBalanceAmountDisplayStyle, children: /* @__PURE__ */ jsxRuntime.jsxs("span", { style: lowBalanceAmountStyle, children: [
|
|
3908
|
-
"$",
|
|
3909
|
-
amount.toFixed(2)
|
|
3910
|
-
] }) }),
|
|
3911
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: lowBalanceRowStyle, children: [
|
|
3912
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: lowBalanceLeftStyle, children: [
|
|
3913
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: lowBalanceCoinStyle(tokens.warning), children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", children: [
|
|
3914
|
-
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10", fill: "currentColor" }),
|
|
3915
|
-
/* @__PURE__ */ jsxRuntime.jsx("text", { x: "12", y: "16", textAnchor: "middle", fontSize: "12", fill: "#fff", fontWeight: "700", children: "$" })
|
|
3916
|
-
] }) }),
|
|
3917
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
3918
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: lowBalanceLabelStyle(tokens.textMuted), children: selectedSourceLabel ?? "Available" }),
|
|
3919
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: "1rem", fontWeight: 700, color: tokens.warning }, children: [
|
|
3920
|
-
"$",
|
|
3921
|
-
availableBalance.toFixed(2)
|
|
3922
|
-
] })
|
|
3923
|
-
] })
|
|
3924
|
-
] }),
|
|
3925
|
-
/* @__PURE__ */ jsxRuntime.jsx("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z", fill: tokens.warning }) })
|
|
3926
|
-
] }),
|
|
3927
|
-
/* @__PURE__ */ jsxRuntime.jsxs(WarningBanner, { title: "Not enough funds", children: [
|
|
3928
|
-
"Your wallet balance is $",
|
|
3929
|
-
availableBalance.toFixed(2),
|
|
3930
|
-
" \u2014 you need at least $",
|
|
3931
|
-
MIN_DEPOSIT.toFixed(2),
|
|
3932
|
-
" to deposit via One-Tap."
|
|
3933
|
-
] })
|
|
3934
|
-
]
|
|
3935
|
-
}
|
|
3936
|
-
);
|
|
3937
|
-
}
|
|
3938
3894
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3939
3895
|
ScreenLayout,
|
|
3940
3896
|
{
|
|
@@ -4065,6 +4021,13 @@ function DepositScreen({
|
|
|
4065
4021
|
". Increase your limit to continue."
|
|
4066
4022
|
] })
|
|
4067
4023
|
] }),
|
|
4024
|
+
!accountPickerOpen && isLowBalance && /* @__PURE__ */ jsxRuntime.jsxs(WarningBanner, { title: "Not enough funds", children: [
|
|
4025
|
+
"Your wallet balance is $",
|
|
4026
|
+
availableBalance.toFixed(2),
|
|
4027
|
+
" \u2014 you need at least $",
|
|
4028
|
+
MIN_DEPOSIT.toFixed(2),
|
|
4029
|
+
" to deposit via One-Tap."
|
|
4030
|
+
] }),
|
|
4068
4031
|
error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorBannerStyle5(tokens), children: error })
|
|
4069
4032
|
]
|
|
4070
4033
|
}
|
|
@@ -4268,46 +4231,6 @@ var limitExceededHintStyle = (color) => ({
|
|
|
4268
4231
|
margin: "12px 0 2px",
|
|
4269
4232
|
lineHeight: 1.5
|
|
4270
4233
|
});
|
|
4271
|
-
var switchHintStyle = (color) => ({
|
|
4272
|
-
textAlign: "center",
|
|
4273
|
-
fontSize: "0.8rem",
|
|
4274
|
-
color,
|
|
4275
|
-
margin: "10px 0"
|
|
4276
|
-
});
|
|
4277
|
-
var outlineBtnWrapStyle = {
|
|
4278
|
-
marginBottom: 8
|
|
4279
|
-
};
|
|
4280
|
-
var lowBalanceAmountDisplayStyle = {
|
|
4281
|
-
textAlign: "center",
|
|
4282
|
-
padding: "20px 0 8px"
|
|
4283
|
-
};
|
|
4284
|
-
var lowBalanceAmountStyle = {
|
|
4285
|
-
fontSize: "2.5rem",
|
|
4286
|
-
fontWeight: 700,
|
|
4287
|
-
color: "#ccc",
|
|
4288
|
-
letterSpacing: "-0.02em"
|
|
4289
|
-
};
|
|
4290
|
-
var lowBalanceRowStyle = {
|
|
4291
|
-
display: "flex",
|
|
4292
|
-
alignItems: "center",
|
|
4293
|
-
justifyContent: "space-between",
|
|
4294
|
-
marginBottom: 16
|
|
4295
|
-
};
|
|
4296
|
-
var lowBalanceLeftStyle = {
|
|
4297
|
-
display: "flex",
|
|
4298
|
-
alignItems: "center",
|
|
4299
|
-
gap: 10
|
|
4300
|
-
};
|
|
4301
|
-
var lowBalanceCoinStyle = (color) => ({
|
|
4302
|
-
color,
|
|
4303
|
-
display: "flex",
|
|
4304
|
-
alignItems: "center"
|
|
4305
|
-
});
|
|
4306
|
-
var lowBalanceLabelStyle = (color) => ({
|
|
4307
|
-
fontSize: "0.72rem",
|
|
4308
|
-
color,
|
|
4309
|
-
fontWeight: 500
|
|
4310
|
-
});
|
|
4311
4234
|
function SuccessScreen({
|
|
4312
4235
|
amount,
|
|
4313
4236
|
currency,
|
|
@@ -5246,7 +5169,8 @@ function TokenPickerScreen({
|
|
|
5246
5169
|
onBack,
|
|
5247
5170
|
onLogout,
|
|
5248
5171
|
depositAmount,
|
|
5249
|
-
selectedTokenSymbol
|
|
5172
|
+
selectedTokenSymbol,
|
|
5173
|
+
selectedWalletId
|
|
5250
5174
|
}) {
|
|
5251
5175
|
const { tokens: t } = useSwypeConfig();
|
|
5252
5176
|
const entries = [];
|
|
@@ -5302,6 +5226,7 @@ function TokenPickerScreen({
|
|
|
5302
5226
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: sectionLabelStyle(t.textMuted), children: "Choose token" }),
|
|
5303
5227
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: tokenListStyle2, children: entries.map((entry) => {
|
|
5304
5228
|
const authorized = entry.status === "AUTHORIZED";
|
|
5229
|
+
const isSelected = entry.walletId === selectedWalletId && entry.tokenSymbol === selectedTokenSymbol;
|
|
5305
5230
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5306
5231
|
"button",
|
|
5307
5232
|
{
|
|
@@ -5324,7 +5249,7 @@ function TokenPickerScreen({
|
|
|
5324
5249
|
!authorized && /* @__PURE__ */ jsxRuntime.jsx("span", { style: notAuthorizedStyle(t.textMuted), children: "Not authorized" })
|
|
5325
5250
|
] })
|
|
5326
5251
|
] }),
|
|
5327
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style:
|
|
5252
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: isSelected ? selectCircleSelectedStyle(t.accent) : selectCircleStyle(t.border), children: isSelected && /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "14", height: "14", 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: "#fff" }) }) })
|
|
5328
5253
|
]
|
|
5329
5254
|
},
|
|
5330
5255
|
`${entry.walletId}-${entry.tokenSymbol}-${entry.chainName}`
|
|
@@ -5660,7 +5585,7 @@ function StepRendererContent({
|
|
|
5660
5585
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5661
5586
|
SetupScreen,
|
|
5662
5587
|
{
|
|
5663
|
-
availableBalance: selectedSource ? selectedSource.balance.available.amount : selectedAccount ? selectedAccount.wallets.reduce((sum, w) => sum + w.balance.available.amount, 0) :
|
|
5588
|
+
availableBalance: selectedSource ? selectedSource.balance.available.amount : selectSourceAvailableBalance > 0 ? selectSourceAvailableBalance : selectedAccount ? selectedAccount.wallets.reduce((sum, w) => sum + w.balance.available.amount, 0) : maxSourceBalance,
|
|
5664
5589
|
tokenCount: effectiveTokenCount,
|
|
5665
5590
|
sourceName,
|
|
5666
5591
|
onSetupOneTap: handlers.onSetupOneTap,
|
|
@@ -5733,7 +5658,8 @@ function StepRendererContent({
|
|
|
5733
5658
|
onBack: () => handlers.onNavigate(state.previousStep === "setup" ? "setup" : "deposit"),
|
|
5734
5659
|
onLogout: handlers.onLogout,
|
|
5735
5660
|
depositAmount: depositAmount ?? void 0,
|
|
5736
|
-
selectedTokenSymbol: selectedSource?.token.symbol
|
|
5661
|
+
selectedTokenSymbol: selectedSource?.token.symbol,
|
|
5662
|
+
selectedWalletId: state.selectedWalletId
|
|
5737
5663
|
}
|
|
5738
5664
|
);
|
|
5739
5665
|
}
|