@swype-org/react-sdk 0.1.102 → 0.1.103
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 +310 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +310 -38
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2555,36 +2555,160 @@ var KNOWN_LOGOS = {
|
|
|
2555
2555
|
base: BASE_LOGO,
|
|
2556
2556
|
"trust wallet": TRUST_WALLET_LOGO
|
|
2557
2557
|
};
|
|
2558
|
-
function
|
|
2558
|
+
function hasActiveWallet2(account) {
|
|
2559
|
+
return account.wallets.some((w) => w.status === "ACTIVE");
|
|
2560
|
+
}
|
|
2561
|
+
function SourceCard({
|
|
2562
|
+
name,
|
|
2563
|
+
address,
|
|
2564
|
+
verified,
|
|
2565
|
+
accounts,
|
|
2566
|
+
selectedAccountId,
|
|
2567
|
+
onSelectAccount,
|
|
2568
|
+
onAuthorizeAccount,
|
|
2569
|
+
onAddProvider
|
|
2570
|
+
}) {
|
|
2559
2571
|
const { tokens } = useSwypeConfig();
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2572
|
+
const [open, setOpen] = react.useState(false);
|
|
2573
|
+
const containerRef = react.useRef(null);
|
|
2574
|
+
const hasDropdown = accounts != null && accounts.length > 0;
|
|
2575
|
+
react.useEffect(() => {
|
|
2576
|
+
if (!open) return;
|
|
2577
|
+
const handleClick = (e) => {
|
|
2578
|
+
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
2579
|
+
setOpen(false);
|
|
2580
|
+
}
|
|
2581
|
+
};
|
|
2582
|
+
document.addEventListener("mousedown", handleClick);
|
|
2583
|
+
return () => document.removeEventListener("mousedown", handleClick);
|
|
2584
|
+
}, [open]);
|
|
2585
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: containerRef, style: { position: "relative" }, children: [
|
|
2586
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: cardContainerStyle(tokens), children: [
|
|
2587
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: leftStyle, children: [
|
|
2588
|
+
KNOWN_LOGOS[name.toLowerCase()] ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2589
|
+
"img",
|
|
2590
|
+
{
|
|
2591
|
+
src: KNOWN_LOGOS[name.toLowerCase()],
|
|
2592
|
+
alt: name,
|
|
2593
|
+
style: logoImgStyle
|
|
2594
|
+
}
|
|
2595
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: iconStyle3(tokens.textMuted), children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2596
|
+
"path",
|
|
2597
|
+
{
|
|
2598
|
+
d: "M21 7H3c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2zm0 8H3V9h18v6z",
|
|
2599
|
+
fill: "currentColor"
|
|
2600
|
+
}
|
|
2601
|
+
) }) }),
|
|
2602
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2603
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: nameRowStyle, children: [
|
|
2604
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: nameStyle(tokens.text), children: name }),
|
|
2605
|
+
verified && /* @__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: tokens.accent }) })
|
|
2606
|
+
] }),
|
|
2607
|
+
address && /* @__PURE__ */ jsxRuntime.jsx("span", { style: addressStyle(tokens.textMuted), children: address })
|
|
2608
|
+
] })
|
|
2609
|
+
] }),
|
|
2610
|
+
hasDropdown && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2611
|
+
"button",
|
|
2571
2612
|
{
|
|
2572
|
-
|
|
2573
|
-
|
|
2613
|
+
type: "button",
|
|
2614
|
+
onClick: () => setOpen(!open),
|
|
2615
|
+
style: changeStyle(tokens.accent),
|
|
2616
|
+
children: [
|
|
2617
|
+
"Change source",
|
|
2618
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2619
|
+
"svg",
|
|
2620
|
+
{
|
|
2621
|
+
width: "10",
|
|
2622
|
+
height: "10",
|
|
2623
|
+
viewBox: "0 0 24 24",
|
|
2624
|
+
fill: "none",
|
|
2625
|
+
style: {
|
|
2626
|
+
marginLeft: 4,
|
|
2627
|
+
transform: open ? "rotate(180deg)" : "rotate(0deg)",
|
|
2628
|
+
transition: "transform 0.15s ease"
|
|
2629
|
+
},
|
|
2630
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2631
|
+
"path",
|
|
2632
|
+
{
|
|
2633
|
+
d: "M7 10l5 5 5-5",
|
|
2634
|
+
stroke: tokens.accent,
|
|
2635
|
+
strokeWidth: "2.5",
|
|
2636
|
+
strokeLinecap: "round",
|
|
2637
|
+
strokeLinejoin: "round"
|
|
2638
|
+
}
|
|
2639
|
+
)
|
|
2640
|
+
}
|
|
2641
|
+
)
|
|
2642
|
+
]
|
|
2574
2643
|
}
|
|
2575
|
-
)
|
|
2576
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2577
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: nameRowStyle, children: [
|
|
2578
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { style: nameStyle(tokens.text), children: name }),
|
|
2579
|
-
verified && /* @__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: tokens.accent }) })
|
|
2580
|
-
] }),
|
|
2581
|
-
address && /* @__PURE__ */ jsxRuntime.jsx("span", { style: addressStyle(tokens.textMuted), children: address })
|
|
2582
|
-
] })
|
|
2644
|
+
)
|
|
2583
2645
|
] }),
|
|
2584
|
-
|
|
2646
|
+
open && hasDropdown && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: dropdownStyle(tokens), children: [
|
|
2647
|
+
accounts.map((account) => {
|
|
2648
|
+
const active = hasActiveWallet2(account);
|
|
2649
|
+
const isSelected = account.id === selectedAccountId;
|
|
2650
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2651
|
+
"button",
|
|
2652
|
+
{
|
|
2653
|
+
type: "button",
|
|
2654
|
+
onClick: () => {
|
|
2655
|
+
if (active) {
|
|
2656
|
+
onSelectAccount?.(account.id);
|
|
2657
|
+
} else {
|
|
2658
|
+
onAuthorizeAccount?.(account.id);
|
|
2659
|
+
}
|
|
2660
|
+
setOpen(false);
|
|
2661
|
+
},
|
|
2662
|
+
style: dropdownRowStyle(tokens, active, isSelected),
|
|
2663
|
+
children: [
|
|
2664
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: dropdownRowLeftStyle, children: [
|
|
2665
|
+
KNOWN_LOGOS[account.name.toLowerCase()] ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2666
|
+
"img",
|
|
2667
|
+
{
|
|
2668
|
+
src: KNOWN_LOGOS[account.name.toLowerCase()],
|
|
2669
|
+
alt: account.name,
|
|
2670
|
+
style: dropdownLogoStyle
|
|
2671
|
+
}
|
|
2672
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: dropdownFallbackIconStyle(active ? tokens.textMuted : tokens.border), children: account.name.charAt(0) }),
|
|
2673
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: dropdownNameStyle(active ? tokens.text : tokens.textMuted), children: account.name })
|
|
2674
|
+
] }),
|
|
2675
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: dropdownRowRightStyle, children: [
|
|
2676
|
+
active ? /* @__PURE__ */ jsxRuntime.jsx("span", { style: activeBadgeStyle(tokens), children: "Active" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { style: inactiveBadgeStyle(tokens), children: "Setup incomplete" }),
|
|
2677
|
+
isSelected && /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2678
|
+
"path",
|
|
2679
|
+
{
|
|
2680
|
+
d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z",
|
|
2681
|
+
fill: tokens.accent
|
|
2682
|
+
}
|
|
2683
|
+
) })
|
|
2684
|
+
] })
|
|
2685
|
+
]
|
|
2686
|
+
},
|
|
2687
|
+
account.id
|
|
2688
|
+
);
|
|
2689
|
+
}),
|
|
2690
|
+
onAddProvider && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2691
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: dropdownDividerStyle(tokens.border) }),
|
|
2692
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2693
|
+
"button",
|
|
2694
|
+
{
|
|
2695
|
+
type: "button",
|
|
2696
|
+
onClick: () => {
|
|
2697
|
+
onAddProvider();
|
|
2698
|
+
setOpen(false);
|
|
2699
|
+
},
|
|
2700
|
+
style: addProviderStyle(tokens),
|
|
2701
|
+
children: [
|
|
2702
|
+
/* @__PURE__ */ jsxRuntime.jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 5v14M5 12h14", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round" }) }),
|
|
2703
|
+
"Add Provider"
|
|
2704
|
+
]
|
|
2705
|
+
}
|
|
2706
|
+
)
|
|
2707
|
+
] })
|
|
2708
|
+
] })
|
|
2585
2709
|
] });
|
|
2586
2710
|
}
|
|
2587
|
-
var
|
|
2711
|
+
var cardContainerStyle = (tokens) => ({
|
|
2588
2712
|
display: "flex",
|
|
2589
2713
|
alignItems: "center",
|
|
2590
2714
|
justifyContent: "space-between",
|
|
@@ -2625,6 +2749,8 @@ var addressStyle = (color) => ({
|
|
|
2625
2749
|
fontFamily: '"SF Mono", "Fira Code", monospace'
|
|
2626
2750
|
});
|
|
2627
2751
|
var changeStyle = (color) => ({
|
|
2752
|
+
display: "flex",
|
|
2753
|
+
alignItems: "center",
|
|
2628
2754
|
background: "transparent",
|
|
2629
2755
|
border: "none",
|
|
2630
2756
|
color,
|
|
@@ -2634,6 +2760,117 @@ var changeStyle = (color) => ({
|
|
|
2634
2760
|
fontFamily: "inherit",
|
|
2635
2761
|
padding: 0
|
|
2636
2762
|
});
|
|
2763
|
+
var dropdownStyle = (tokens) => ({
|
|
2764
|
+
position: "absolute",
|
|
2765
|
+
top: "100%",
|
|
2766
|
+
left: 0,
|
|
2767
|
+
right: 0,
|
|
2768
|
+
marginTop: 4,
|
|
2769
|
+
background: tokens.bgCard,
|
|
2770
|
+
border: `1px solid ${tokens.border}`,
|
|
2771
|
+
borderRadius: tokens.radiusLg,
|
|
2772
|
+
boxShadow: tokens.shadowLg,
|
|
2773
|
+
zIndex: 50,
|
|
2774
|
+
overflow: "hidden"
|
|
2775
|
+
});
|
|
2776
|
+
var dropdownRowStyle = (tokens, active, isSelected) => ({
|
|
2777
|
+
display: "flex",
|
|
2778
|
+
alignItems: "center",
|
|
2779
|
+
justifyContent: "space-between",
|
|
2780
|
+
width: "100%",
|
|
2781
|
+
padding: "10px 14px",
|
|
2782
|
+
background: isSelected ? tokens.accent + "12" : "transparent",
|
|
2783
|
+
border: "none",
|
|
2784
|
+
borderBottom: `1px solid ${tokens.border}`,
|
|
2785
|
+
cursor: "pointer",
|
|
2786
|
+
fontFamily: "inherit",
|
|
2787
|
+
fontSize: "0.85rem",
|
|
2788
|
+
textAlign: "left",
|
|
2789
|
+
outline: "none",
|
|
2790
|
+
opacity: active ? 1 : 0.55,
|
|
2791
|
+
transition: "background 0.1s ease"
|
|
2792
|
+
});
|
|
2793
|
+
var dropdownRowLeftStyle = {
|
|
2794
|
+
display: "flex",
|
|
2795
|
+
alignItems: "center",
|
|
2796
|
+
gap: 10,
|
|
2797
|
+
minWidth: 0,
|
|
2798
|
+
flex: 1
|
|
2799
|
+
};
|
|
2800
|
+
var dropdownRowRightStyle = {
|
|
2801
|
+
display: "flex",
|
|
2802
|
+
alignItems: "center",
|
|
2803
|
+
gap: 8,
|
|
2804
|
+
flexShrink: 0
|
|
2805
|
+
};
|
|
2806
|
+
var dropdownLogoStyle = {
|
|
2807
|
+
width: 20,
|
|
2808
|
+
height: 20,
|
|
2809
|
+
borderRadius: "50%",
|
|
2810
|
+
objectFit: "contain",
|
|
2811
|
+
flexShrink: 0
|
|
2812
|
+
};
|
|
2813
|
+
var dropdownFallbackIconStyle = (color) => ({
|
|
2814
|
+
width: 20,
|
|
2815
|
+
height: 20,
|
|
2816
|
+
borderRadius: "50%",
|
|
2817
|
+
display: "flex",
|
|
2818
|
+
alignItems: "center",
|
|
2819
|
+
justifyContent: "center",
|
|
2820
|
+
fontSize: "0.72rem",
|
|
2821
|
+
fontWeight: 700,
|
|
2822
|
+
color,
|
|
2823
|
+
flexShrink: 0
|
|
2824
|
+
});
|
|
2825
|
+
var dropdownNameStyle = (color) => ({
|
|
2826
|
+
fontWeight: 500,
|
|
2827
|
+
color,
|
|
2828
|
+
whiteSpace: "nowrap",
|
|
2829
|
+
overflow: "hidden",
|
|
2830
|
+
textOverflow: "ellipsis"
|
|
2831
|
+
});
|
|
2832
|
+
var activeBadgeStyle = (tokens) => ({
|
|
2833
|
+
fontSize: "0.6rem",
|
|
2834
|
+
fontWeight: 600,
|
|
2835
|
+
color: tokens.success,
|
|
2836
|
+
background: tokens.successBg,
|
|
2837
|
+
padding: "2px 7px",
|
|
2838
|
+
borderRadius: 999,
|
|
2839
|
+
textTransform: "uppercase",
|
|
2840
|
+
letterSpacing: "0.03em",
|
|
2841
|
+
whiteSpace: "nowrap"
|
|
2842
|
+
});
|
|
2843
|
+
var inactiveBadgeStyle = (tokens) => ({
|
|
2844
|
+
fontSize: "0.6rem",
|
|
2845
|
+
fontWeight: 600,
|
|
2846
|
+
color: tokens.warning,
|
|
2847
|
+
background: tokens.warningBg ?? `${tokens.warning}1a`,
|
|
2848
|
+
padding: "2px 7px",
|
|
2849
|
+
borderRadius: 999,
|
|
2850
|
+
textTransform: "uppercase",
|
|
2851
|
+
letterSpacing: "0.03em",
|
|
2852
|
+
whiteSpace: "nowrap"
|
|
2853
|
+
});
|
|
2854
|
+
var dropdownDividerStyle = (borderColor) => ({
|
|
2855
|
+
height: 0,
|
|
2856
|
+
borderTop: `1px solid ${borderColor}`
|
|
2857
|
+
});
|
|
2858
|
+
var addProviderStyle = (tokens) => ({
|
|
2859
|
+
display: "flex",
|
|
2860
|
+
alignItems: "center",
|
|
2861
|
+
gap: 8,
|
|
2862
|
+
width: "100%",
|
|
2863
|
+
padding: "10px 14px",
|
|
2864
|
+
background: "transparent",
|
|
2865
|
+
border: "none",
|
|
2866
|
+
color: tokens.accent,
|
|
2867
|
+
fontWeight: 600,
|
|
2868
|
+
fontSize: "0.85rem",
|
|
2869
|
+
cursor: "pointer",
|
|
2870
|
+
fontFamily: "inherit",
|
|
2871
|
+
textAlign: "left",
|
|
2872
|
+
outline: "none"
|
|
2873
|
+
});
|
|
2637
2874
|
function StepList({ steps }) {
|
|
2638
2875
|
const { tokens } = useSwypeConfig();
|
|
2639
2876
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: listStyle, children: steps.map((step, i) => {
|
|
@@ -2711,13 +2948,13 @@ function SettingsMenu({ onLogout }) {
|
|
|
2711
2948
|
document.addEventListener("mousedown", handleClickOutside);
|
|
2712
2949
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
2713
2950
|
}, [open]);
|
|
2714
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: menuRef, style:
|
|
2951
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: menuRef, style: containerStyle6, children: [
|
|
2715
2952
|
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: toggle, style: triggerStyle(tokens.text), "aria-label": "Settings", children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", children: [
|
|
2716
2953
|
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "5", r: "2", fill: "currentColor" }),
|
|
2717
2954
|
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "2", fill: "currentColor" }),
|
|
2718
2955
|
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "19", r: "2", fill: "currentColor" })
|
|
2719
2956
|
] }) }),
|
|
2720
|
-
open && /* @__PURE__ */ jsxRuntime.jsx("div", { style:
|
|
2957
|
+
open && /* @__PURE__ */ jsxRuntime.jsx("div", { style: dropdownStyle2(tokens), children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2721
2958
|
"button",
|
|
2722
2959
|
{
|
|
2723
2960
|
type: "button",
|
|
@@ -2738,7 +2975,7 @@ function SettingsMenu({ onLogout }) {
|
|
|
2738
2975
|
) })
|
|
2739
2976
|
] });
|
|
2740
2977
|
}
|
|
2741
|
-
var
|
|
2978
|
+
var containerStyle6 = {
|
|
2742
2979
|
position: "relative"
|
|
2743
2980
|
};
|
|
2744
2981
|
var triggerStyle = (color) => ({
|
|
@@ -2751,7 +2988,7 @@ var triggerStyle = (color) => ({
|
|
|
2751
2988
|
alignItems: "center",
|
|
2752
2989
|
justifyContent: "center"
|
|
2753
2990
|
});
|
|
2754
|
-
var
|
|
2991
|
+
var dropdownStyle2 = (tokens) => ({
|
|
2755
2992
|
position: "absolute",
|
|
2756
2993
|
right: 0,
|
|
2757
2994
|
top: "100%",
|
|
@@ -3713,12 +3950,16 @@ function DepositScreen({
|
|
|
3713
3950
|
processing,
|
|
3714
3951
|
error,
|
|
3715
3952
|
onDeposit,
|
|
3716
|
-
onChangeSource,
|
|
3717
3953
|
onSwitchWallet,
|
|
3718
3954
|
onBack,
|
|
3719
3955
|
onLogout,
|
|
3720
3956
|
onIncreaseLimit,
|
|
3721
|
-
increasingLimit
|
|
3957
|
+
increasingLimit,
|
|
3958
|
+
accounts,
|
|
3959
|
+
selectedAccountId,
|
|
3960
|
+
onSelectAccount,
|
|
3961
|
+
onAuthorizeAccount,
|
|
3962
|
+
onAddProvider
|
|
3722
3963
|
}) {
|
|
3723
3964
|
const { tokens } = useSwypeConfig();
|
|
3724
3965
|
const amount = initialAmount;
|
|
@@ -3744,7 +3985,11 @@ function DepositScreen({
|
|
|
3744
3985
|
name: sourceName,
|
|
3745
3986
|
address: sourceAddress,
|
|
3746
3987
|
verified: sourceVerified,
|
|
3747
|
-
|
|
3988
|
+
accounts,
|
|
3989
|
+
selectedAccountId,
|
|
3990
|
+
onSelectAccount,
|
|
3991
|
+
onAuthorizeAccount,
|
|
3992
|
+
onAddProvider
|
|
3748
3993
|
}
|
|
3749
3994
|
),
|
|
3750
3995
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: amountDisplayStyle, children: /* @__PURE__ */ jsxRuntime.jsxs("span", { style: amountStyle({ ...tokens, dimmed: true }), children: [
|
|
@@ -3814,7 +4059,11 @@ function DepositScreen({
|
|
|
3814
4059
|
name: sourceName,
|
|
3815
4060
|
address: sourceAddress,
|
|
3816
4061
|
verified: sourceVerified,
|
|
3817
|
-
|
|
4062
|
+
accounts,
|
|
4063
|
+
selectedAccountId,
|
|
4064
|
+
onSelectAccount,
|
|
4065
|
+
onAuthorizeAccount,
|
|
4066
|
+
onAddProvider
|
|
3818
4067
|
}
|
|
3819
4068
|
),
|
|
3820
4069
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: amountDisplayStyle, children: /* @__PURE__ */ jsxRuntime.jsxs("span", { style: amountStyle(tokens), children: [
|
|
@@ -4947,12 +5196,16 @@ function StepRenderer({
|
|
|
4947
5196
|
processing: state.creatingTransfer,
|
|
4948
5197
|
error: state.error,
|
|
4949
5198
|
onDeposit: handlers.onPay,
|
|
4950
|
-
onChangeSource: () => handlers.onNavigate("wallet-picker"),
|
|
4951
5199
|
onSwitchWallet: () => handlers.onNavigate("wallet-picker"),
|
|
4952
5200
|
onBack: onBack ?? (() => handlers.onLogout()),
|
|
4953
5201
|
onLogout: handlers.onLogout,
|
|
4954
5202
|
onIncreaseLimit: handlers.onIncreaseLimit,
|
|
4955
|
-
increasingLimit: state.increasingLimit
|
|
5203
|
+
increasingLimit: state.increasingLimit,
|
|
5204
|
+
accounts: state.accounts,
|
|
5205
|
+
selectedAccountId: state.selectedAccountId,
|
|
5206
|
+
onSelectAccount: handlers.onSelectAccount,
|
|
5207
|
+
onAuthorizeAccount: handlers.onContinueConnection,
|
|
5208
|
+
onAddProvider: () => handlers.onNavigate("wallet-picker")
|
|
4956
5209
|
}
|
|
4957
5210
|
);
|
|
4958
5211
|
}
|
|
@@ -5021,10 +5274,14 @@ function StepRenderer({
|
|
|
5021
5274
|
processing: false,
|
|
5022
5275
|
error: state.error,
|
|
5023
5276
|
onDeposit: handlers.onPay,
|
|
5024
|
-
onChangeSource: () => handlers.onNavigate("wallet-picker"),
|
|
5025
5277
|
onSwitchWallet: () => handlers.onNavigate("wallet-picker"),
|
|
5026
5278
|
onBack: onBack ?? (() => handlers.onLogout()),
|
|
5027
|
-
onLogout: handlers.onLogout
|
|
5279
|
+
onLogout: handlers.onLogout,
|
|
5280
|
+
accounts: state.accounts,
|
|
5281
|
+
selectedAccountId: state.selectedAccountId,
|
|
5282
|
+
onSelectAccount: handlers.onSelectAccount,
|
|
5283
|
+
onAuthorizeAccount: handlers.onContinueConnection,
|
|
5284
|
+
onAddProvider: () => handlers.onNavigate("wallet-picker")
|
|
5028
5285
|
}
|
|
5029
5286
|
);
|
|
5030
5287
|
}
|
|
@@ -5049,7 +5306,7 @@ var PaymentErrorBoundary = class extends react.Component {
|
|
|
5049
5306
|
if (!this.state.hasError) {
|
|
5050
5307
|
return this.props.children;
|
|
5051
5308
|
}
|
|
5052
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style:
|
|
5309
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: containerStyle7, children: [
|
|
5053
5310
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: iconStyle4, children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "48", height: "48", viewBox: "0 0 24 24", fill: "none", children: [
|
|
5054
5311
|
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10", stroke: "#ef4444", strokeWidth: "1.5" }),
|
|
5055
5312
|
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 8v5", stroke: "#ef4444", strokeWidth: "1.5", strokeLinecap: "round" }),
|
|
@@ -5061,7 +5318,7 @@ var PaymentErrorBoundary = class extends react.Component {
|
|
|
5061
5318
|
] });
|
|
5062
5319
|
}
|
|
5063
5320
|
};
|
|
5064
|
-
var
|
|
5321
|
+
var containerStyle7 = {
|
|
5065
5322
|
display: "flex",
|
|
5066
5323
|
flexDirection: "column",
|
|
5067
5324
|
alignItems: "center",
|
|
@@ -5659,6 +5916,19 @@ function SwypePaymentInner({
|
|
|
5659
5916
|
},
|
|
5660
5917
|
[state.accounts, state.providers, handleSelectProvider]
|
|
5661
5918
|
);
|
|
5919
|
+
const handleSelectAccount = react.useCallback(
|
|
5920
|
+
(accountId) => {
|
|
5921
|
+
const acct = state.accounts.find((a) => a.id === accountId);
|
|
5922
|
+
if (!acct) return;
|
|
5923
|
+
const activeWallet = acct.wallets.find((w) => w.status === "ACTIVE") ?? null;
|
|
5924
|
+
dispatch({
|
|
5925
|
+
type: "SELECT_ACCOUNT",
|
|
5926
|
+
accountId,
|
|
5927
|
+
walletId: activeWallet?.id ?? null
|
|
5928
|
+
});
|
|
5929
|
+
},
|
|
5930
|
+
[state.accounts]
|
|
5931
|
+
);
|
|
5662
5932
|
const handleNewPayment = react.useCallback(() => {
|
|
5663
5933
|
clearMobileFlowState();
|
|
5664
5934
|
processingStartedAtRef.current = null;
|
|
@@ -6126,6 +6396,7 @@ function SwypePaymentInner({
|
|
|
6126
6396
|
onVerifyPasskeyViaPopup: handleVerifyPasskeyViaPopup,
|
|
6127
6397
|
onSelectProvider: handleSelectProvider,
|
|
6128
6398
|
onContinueConnection: handleContinueConnection,
|
|
6399
|
+
onSelectAccount: handleSelectAccount,
|
|
6129
6400
|
onPay: handlePay,
|
|
6130
6401
|
onIncreaseLimit: handleIncreaseLimit,
|
|
6131
6402
|
onConfirmSign: handleConfirmSign,
|
|
@@ -6150,6 +6421,7 @@ function SwypePaymentInner({
|
|
|
6150
6421
|
handleVerifyPasskeyViaPopup,
|
|
6151
6422
|
handleSelectProvider,
|
|
6152
6423
|
handleContinueConnection,
|
|
6424
|
+
handleSelectAccount,
|
|
6153
6425
|
handlePay,
|
|
6154
6426
|
handleIncreaseLimit,
|
|
6155
6427
|
handleConfirmSign,
|