@spicenet-io/spiceflow-ui 1.9.3 → 1.9.4
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.
|
@@ -23,6 +23,8 @@ export interface CrossChainDepositModalProps {
|
|
|
23
23
|
isOpen: boolean;
|
|
24
24
|
onClose: () => void;
|
|
25
25
|
onComplete: () => void;
|
|
26
|
+
title?: string;
|
|
27
|
+
description?: string;
|
|
26
28
|
chainId: 11155111 | 421614 | 84532 | undefined;
|
|
27
29
|
externalWalletAddress: string;
|
|
28
30
|
escrowAddress?: string;
|
|
@@ -4,7 +4,7 @@ export interface DepositWidgetModalProps extends DepositWidgetProps {
|
|
|
4
4
|
isOpen: boolean;
|
|
5
5
|
onClose: () => void;
|
|
6
6
|
title?: string;
|
|
7
|
-
|
|
7
|
+
description?: React.ReactNode;
|
|
8
8
|
maxWidth?: string;
|
|
9
9
|
}
|
|
10
10
|
export declare const DepositWidgetModal: React.FC<DepositWidgetModalProps>;
|
package/dist/index.cjs.js
CHANGED
|
@@ -4405,7 +4405,8 @@ const DepositWidget = ({
|
|
|
4405
4405
|
className = "",
|
|
4406
4406
|
depositInputHook,
|
|
4407
4407
|
onDepositSuccess,
|
|
4408
|
-
onDepositError
|
|
4408
|
+
onDepositError,
|
|
4409
|
+
onTopUp
|
|
4409
4410
|
}) => {
|
|
4410
4411
|
const baseTheme = Button.createTheme(themeMode);
|
|
4411
4412
|
const theme = {
|
|
@@ -4429,13 +4430,14 @@ const DepositWidget = ({
|
|
|
4429
4430
|
provider,
|
|
4430
4431
|
actions
|
|
4431
4432
|
} = wallet;
|
|
4432
|
-
|
|
4433
|
+
React.useContext(SpiceFlowProviderContext);
|
|
4433
4434
|
const [selectedDepositAsset, setSelectedDepositAsset] = React.useState(null);
|
|
4434
4435
|
const [isPending, startTransition] = React.useTransition();
|
|
4435
4436
|
const {
|
|
4436
4437
|
assets: spiceAssets,
|
|
4437
4438
|
loading: loadingSpiceAssets,
|
|
4438
4439
|
error: spiceAssetsError,
|
|
4440
|
+
hasBalance: hasSpiceBalance,
|
|
4439
4441
|
refetch: refreshSpiceAssets
|
|
4440
4442
|
} = useSpiceAssets({
|
|
4441
4443
|
address,
|
|
@@ -4617,124 +4619,48 @@ const DepositWidget = ({
|
|
|
4617
4619
|
) });
|
|
4618
4620
|
}
|
|
4619
4621
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: containerStyles, className, children: [
|
|
4620
|
-
|
|
4622
|
+
!loadingSpiceAssets && !hasSpiceBalance && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4621
4623
|
"div",
|
|
4622
4624
|
{
|
|
4623
4625
|
style: {
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4626
|
+
backgroundColor: theme.mode === "light" ? "#fef3c7" : `${theme.colors.warning || "#f59e0b"}20`,
|
|
4627
|
+
border: `1px solid ${theme.mode === "light" ? "#fcd34d" : theme.colors.warning || "#f59e0b"}`,
|
|
4628
|
+
borderRadius: theme.borderRadius.md,
|
|
4629
|
+
padding: theme.spacing.md,
|
|
4630
|
+
marginBottom: theme.spacing.md,
|
|
4631
|
+
textAlign: "center"
|
|
4628
4632
|
},
|
|
4629
|
-
children:
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
{
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
style: {
|
|
4659
|
-
fontSize: styles?.statusDisplay?.text?.fontSize || theme.typography.fontSize.xs,
|
|
4660
|
-
padding: `2px ${theme.spacing.xs}`,
|
|
4661
|
-
borderRadius: theme.borderRadius.sm,
|
|
4662
|
-
border: `1px solid ${isConnected ? styles?.statusDisplay?.successColor || theme.colors.success : styles?.statusDisplay?.warningColor || theme.colors.warning}`,
|
|
4663
|
-
backgroundColor: isConnected ? theme.mode === "light" ? "#dcfce7" : `${styles?.statusDisplay?.successColor || theme.colors.success}20` : theme.mode === "light" ? "#fef3c7" : `${styles?.statusDisplay?.warningColor || theme.colors.warning}20`,
|
|
4664
|
-
color: isConnected ? styles?.statusDisplay?.successColor || theme.colors.success : styles?.statusDisplay?.warningColor || theme.colors.warning,
|
|
4665
|
-
fontFamily: styles?.statusDisplay?.text?.fontFamily || theme.typography.fontFamily
|
|
4666
|
-
},
|
|
4667
|
-
children: isConnected ? "Connected" : "Disconnected"
|
|
4668
|
-
}
|
|
4669
|
-
)
|
|
4670
|
-
]
|
|
4671
|
-
}
|
|
4672
|
-
),
|
|
4673
|
-
isConnected && address && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4674
|
-
"div",
|
|
4675
|
-
{
|
|
4676
|
-
className: "ibm-plex-mono",
|
|
4677
|
-
style: {
|
|
4678
|
-
marginTop: "6px",
|
|
4679
|
-
backgroundColor: styles?.addressDisplay?.backgroundColor || (theme.mode === "light" ? "#f3f4f6" : theme.colors.secondary),
|
|
4680
|
-
border: `1px solid ${styles?.addressDisplay?.borderColor || (theme.mode === "light" ? "#d1d5db" : theme.colors.borderHover)}`,
|
|
4681
|
-
borderRadius: styles?.addressDisplay?.borderRadius || theme.borderRadius.sm,
|
|
4682
|
-
padding: styles?.addressDisplay?.padding || `${theme.spacing.xs} ${theme.spacing.sm}`,
|
|
4683
|
-
fontSize: styles?.addressDisplay?.fontSize || theme.typography.fontSize.xs,
|
|
4684
|
-
fontFamily: styles?.addressDisplay?.fontFamily || (styles?.fontFamily ? `${styles.fontFamily}, IBM Plex Mono` : "IBM Plex Mono"),
|
|
4685
|
-
color: styles?.addressDisplay?.color || theme.colors.text,
|
|
4686
|
-
display: "flex",
|
|
4687
|
-
alignItems: "center",
|
|
4688
|
-
gap: theme.spacing.sm
|
|
4689
|
-
},
|
|
4690
|
-
children: [
|
|
4691
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { style: { flex: 1 }, children: [
|
|
4692
|
-
address.slice(0, 6),
|
|
4693
|
-
"...",
|
|
4694
|
-
address.slice(-4)
|
|
4695
|
-
] }),
|
|
4696
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4697
|
-
"button",
|
|
4698
|
-
{
|
|
4699
|
-
style: {
|
|
4700
|
-
fontSize: styles?.addressDisplay?.copyButton?.fontSize || theme.typography.fontSize.xs,
|
|
4701
|
-
padding: styles?.addressDisplay?.copyButton?.padding || `${theme.spacing.xs} ${theme.spacing.sm}`,
|
|
4702
|
-
backgroundColor: styles?.addressDisplay?.copyButton?.backgroundColor || (theme.mode === "light" ? "#e5e7eb" : theme.colors.surfaceHover),
|
|
4703
|
-
border: `1px solid ${styles?.addressDisplay?.copyButton?.borderColor || (theme.mode === "light" ? "#d1d5db" : theme.colors.border)}`,
|
|
4704
|
-
borderRadius: styles?.addressDisplay?.copyButton?.borderRadius || theme.borderRadius.sm,
|
|
4705
|
-
color: styles?.addressDisplay?.copyButton?.color || theme.colors.text,
|
|
4706
|
-
fontFamily: styles?.addressDisplay?.copyButton?.fontFamily || theme.typography.fontFamily,
|
|
4707
|
-
cursor: "pointer",
|
|
4708
|
-
transition: `background-color ${theme.animation.normal}`
|
|
4709
|
-
},
|
|
4710
|
-
onClick: () => copyToClipboard(address),
|
|
4711
|
-
title: "Copy address",
|
|
4712
|
-
children: "Copy"
|
|
4713
|
-
}
|
|
4714
|
-
)
|
|
4715
|
-
]
|
|
4716
|
-
}
|
|
4717
|
-
),
|
|
4718
|
-
!ready && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4719
|
-
"div",
|
|
4720
|
-
{
|
|
4721
|
-
style: {
|
|
4722
|
-
marginTop: "6px",
|
|
4723
|
-
fontSize: theme.typography.fontSize.xs,
|
|
4724
|
-
color: theme.colors.textSecondary,
|
|
4725
|
-
fontFamily: theme.typography.fontFamily
|
|
4726
|
-
},
|
|
4727
|
-
children: [
|
|
4728
|
-
"Loading",
|
|
4729
|
-
" ",
|
|
4730
|
-
spiceFlowContext?.provider === "privy" ? "Privy" : spiceFlowContext?.provider === "dynamic" ? "Dynamic" : "Wallet",
|
|
4731
|
-
"..."
|
|
4732
|
-
]
|
|
4733
|
-
}
|
|
4734
|
-
)
|
|
4735
|
-
]
|
|
4633
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4634
|
+
"p",
|
|
4635
|
+
{
|
|
4636
|
+
style: {
|
|
4637
|
+
color: theme.mode === "light" ? "#92400e" : "#fbbf24",
|
|
4638
|
+
fontSize: theme.typography.fontSize.sm,
|
|
4639
|
+
fontFamily: theme.typography.fontFamily,
|
|
4640
|
+
margin: 0,
|
|
4641
|
+
lineHeight: 1.5
|
|
4642
|
+
},
|
|
4643
|
+
children: [
|
|
4644
|
+
"You do not have any cross-chain balance.",
|
|
4645
|
+
" ",
|
|
4646
|
+
onTopUp && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4647
|
+
"span",
|
|
4648
|
+
{
|
|
4649
|
+
onClick: onTopUp,
|
|
4650
|
+
style: {
|
|
4651
|
+
color: theme.colors.primary,
|
|
4652
|
+
textDecoration: "underline",
|
|
4653
|
+
cursor: "pointer",
|
|
4654
|
+
fontWeight: 600
|
|
4655
|
+
},
|
|
4656
|
+
children: "Top-up here."
|
|
4657
|
+
}
|
|
4658
|
+
)
|
|
4659
|
+
]
|
|
4660
|
+
}
|
|
4661
|
+
)
|
|
4736
4662
|
}
|
|
4737
|
-
)
|
|
4663
|
+
),
|
|
4738
4664
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginBottom: theme.spacing.sm }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4739
4665
|
AssetSelector,
|
|
4740
4666
|
{
|
|
@@ -4750,50 +4676,6 @@ const DepositWidget = ({
|
|
|
4750
4676
|
styles
|
|
4751
4677
|
}
|
|
4752
4678
|
) }),
|
|
4753
|
-
depositBatches.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginBottom: theme.spacing.sm }, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4754
|
-
"div",
|
|
4755
|
-
{
|
|
4756
|
-
style: {
|
|
4757
|
-
backgroundColor: styles?.infoCard?.backgroundColor || styles?.tertiaryBackground || (theme.mode === "light" ? "#f9fafb" : theme.colors.surface),
|
|
4758
|
-
border: `1px solid ${styles?.infoCard?.borderColor || (theme.mode === "light" ? "#e5e7eb" : theme.colors.border)}`,
|
|
4759
|
-
borderRadius: styles?.infoCard?.borderRadius || theme.borderRadius.md,
|
|
4760
|
-
padding: styles?.infoCard?.padding || theme.spacing.sm
|
|
4761
|
-
},
|
|
4762
|
-
children: [
|
|
4763
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4764
|
-
"div",
|
|
4765
|
-
{
|
|
4766
|
-
style: {
|
|
4767
|
-
fontSize: styles?.infoCard?.title?.fontSize || theme.typography.fontSize.xs,
|
|
4768
|
-
fontWeight: styles?.infoCard?.title?.fontWeight || theme.typography.fontWeight.medium,
|
|
4769
|
-
color: styles?.infoCard?.title?.color || theme.colors.text,
|
|
4770
|
-
fontFamily: styles?.infoCard?.title?.fontFamily || theme.typography.fontFamily,
|
|
4771
|
-
marginBottom: "4px"
|
|
4772
|
-
},
|
|
4773
|
-
children: "Deposit Batches Ready"
|
|
4774
|
-
}
|
|
4775
|
-
),
|
|
4776
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4777
|
-
"div",
|
|
4778
|
-
{
|
|
4779
|
-
style: {
|
|
4780
|
-
fontSize: styles?.infoCard?.description?.fontSize || theme.typography.fontSize.xs,
|
|
4781
|
-
color: styles?.infoCard?.description?.color || theme.colors.textSecondary,
|
|
4782
|
-
fontFamily: styles?.infoCard?.description?.fontFamily || theme.typography.fontFamily
|
|
4783
|
-
},
|
|
4784
|
-
children: [
|
|
4785
|
-
depositBatches.length,
|
|
4786
|
-
" deposit batch",
|
|
4787
|
-
depositBatches.length > 1 ? "es" : "",
|
|
4788
|
-
" across chains:",
|
|
4789
|
-
" ",
|
|
4790
|
-
[...new Set(depositBatches.map((b) => b.chainId))].join(", ")
|
|
4791
|
-
]
|
|
4792
|
-
}
|
|
4793
|
-
)
|
|
4794
|
-
]
|
|
4795
|
-
}
|
|
4796
|
-
) }),
|
|
4797
4679
|
displayError && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4798
4680
|
"div",
|
|
4799
4681
|
{
|
|
@@ -4830,7 +4712,7 @@ const DepositWidget = ({
|
|
|
4830
4712
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4831
4713
|
Button.Button,
|
|
4832
4714
|
{
|
|
4833
|
-
variant: "
|
|
4715
|
+
variant: "outline",
|
|
4834
4716
|
fullWidth: true,
|
|
4835
4717
|
onClick: handleDeposit,
|
|
4836
4718
|
loading: isExecuting,
|
|
@@ -5061,7 +4943,7 @@ const DepositWidgetModal = ({
|
|
|
5061
4943
|
isOpen,
|
|
5062
4944
|
onClose,
|
|
5063
4945
|
title = "Deposit",
|
|
5064
|
-
|
|
4946
|
+
description = "Deposit funds to execute chain batches across multiple networks.",
|
|
5065
4947
|
maxWidth = "480px",
|
|
5066
4948
|
// Pass through all DepositWidget props
|
|
5067
4949
|
depositBatches,
|
|
@@ -5077,7 +4959,7 @@ const DepositWidgetModal = ({
|
|
|
5077
4959
|
onDepositError
|
|
5078
4960
|
}) => {
|
|
5079
4961
|
const theme = Button.createTheme(themeMode);
|
|
5080
|
-
const
|
|
4962
|
+
const defaultDescription = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5081
4963
|
"div",
|
|
5082
4964
|
{
|
|
5083
4965
|
style: {
|
|
@@ -5109,7 +4991,7 @@ const DepositWidgetModal = ({
|
|
|
5109
4991
|
lineHeight: "1.4",
|
|
5110
4992
|
fontFamily: "system-ui, -apple-system, sans-serif"
|
|
5111
4993
|
},
|
|
5112
|
-
children:
|
|
4994
|
+
children: description
|
|
5113
4995
|
}
|
|
5114
4996
|
)
|
|
5115
4997
|
]
|
|
@@ -5124,7 +5006,7 @@ const DepositWidgetModal = ({
|
|
|
5124
5006
|
isOpen,
|
|
5125
5007
|
onClose,
|
|
5126
5008
|
title,
|
|
5127
|
-
subtitle:
|
|
5009
|
+
subtitle: description || defaultDescription,
|
|
5128
5010
|
styles,
|
|
5129
5011
|
theme,
|
|
5130
5012
|
maxWidth,
|
|
@@ -5399,6 +5281,8 @@ const CrossChainDepositModal = ({
|
|
|
5399
5281
|
isOpen,
|
|
5400
5282
|
onClose,
|
|
5401
5283
|
onComplete,
|
|
5284
|
+
title = "Deposit to Spicenet",
|
|
5285
|
+
description = "Select tokens and enter amounts to deposit to your Spicenet Account",
|
|
5402
5286
|
chainId,
|
|
5403
5287
|
externalWalletAddress,
|
|
5404
5288
|
escrowAddress = "0xeee2b52e7CFe6e2168341a34cEB783b68FEdf1A2",
|
|
@@ -5629,7 +5513,7 @@ const CrossChainDepositModal = ({
|
|
|
5629
5513
|
}
|
|
5630
5514
|
}
|
|
5631
5515
|
),
|
|
5632
|
-
/* @__PURE__ */ jsxRuntime.
|
|
5516
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5633
5517
|
"p",
|
|
5634
5518
|
{
|
|
5635
5519
|
style: {
|
|
@@ -5638,12 +5522,7 @@ const CrossChainDepositModal = ({
|
|
|
5638
5522
|
margin: 0,
|
|
5639
5523
|
lineHeight: "1.5"
|
|
5640
5524
|
},
|
|
5641
|
-
children:
|
|
5642
|
-
"Select tokens and enter amounts to deposit to your Spicenet Account on",
|
|
5643
|
-
" ",
|
|
5644
|
-
chainConfig?.displayName || `Chain ${chainId}`,
|
|
5645
|
-
"."
|
|
5646
|
-
]
|
|
5525
|
+
children: description
|
|
5647
5526
|
}
|
|
5648
5527
|
)
|
|
5649
5528
|
]
|
|
@@ -5801,7 +5680,7 @@ const CrossChainDepositModal = ({
|
|
|
5801
5680
|
{
|
|
5802
5681
|
isOpen,
|
|
5803
5682
|
onClose,
|
|
5804
|
-
title
|
|
5683
|
+
title,
|
|
5805
5684
|
subtitle,
|
|
5806
5685
|
theme,
|
|
5807
5686
|
maxWidth: "480px",
|
|
@@ -5928,7 +5807,6 @@ const CrossChainDepositModal = ({
|
|
|
5928
5807
|
variant: "outline",
|
|
5929
5808
|
fullWidth: true,
|
|
5930
5809
|
onClick: executeDeposit,
|
|
5931
|
-
loading: isExecuting,
|
|
5932
5810
|
disabled: !canDeposit,
|
|
5933
5811
|
theme,
|
|
5934
5812
|
style: {
|
package/dist/index.js
CHANGED
|
@@ -4403,7 +4403,8 @@ const DepositWidget = ({
|
|
|
4403
4403
|
className = "",
|
|
4404
4404
|
depositInputHook,
|
|
4405
4405
|
onDepositSuccess,
|
|
4406
|
-
onDepositError
|
|
4406
|
+
onDepositError,
|
|
4407
|
+
onTopUp
|
|
4407
4408
|
}) => {
|
|
4408
4409
|
const baseTheme = createTheme(themeMode);
|
|
4409
4410
|
const theme = {
|
|
@@ -4427,13 +4428,14 @@ const DepositWidget = ({
|
|
|
4427
4428
|
provider,
|
|
4428
4429
|
actions
|
|
4429
4430
|
} = wallet;
|
|
4430
|
-
|
|
4431
|
+
useContext(SpiceFlowProviderContext);
|
|
4431
4432
|
const [selectedDepositAsset, setSelectedDepositAsset] = useState(null);
|
|
4432
4433
|
const [isPending, startTransition] = useTransition();
|
|
4433
4434
|
const {
|
|
4434
4435
|
assets: spiceAssets,
|
|
4435
4436
|
loading: loadingSpiceAssets,
|
|
4436
4437
|
error: spiceAssetsError,
|
|
4438
|
+
hasBalance: hasSpiceBalance,
|
|
4437
4439
|
refetch: refreshSpiceAssets
|
|
4438
4440
|
} = useSpiceAssets({
|
|
4439
4441
|
address,
|
|
@@ -4615,124 +4617,48 @@ const DepositWidget = ({
|
|
|
4615
4617
|
) });
|
|
4616
4618
|
}
|
|
4617
4619
|
return /* @__PURE__ */ jsxs("div", { style: containerStyles, className, children: [
|
|
4618
|
-
|
|
4620
|
+
!loadingSpiceAssets && !hasSpiceBalance && /* @__PURE__ */ jsx(
|
|
4619
4621
|
"div",
|
|
4620
4622
|
{
|
|
4621
4623
|
style: {
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4624
|
+
backgroundColor: theme.mode === "light" ? "#fef3c7" : `${theme.colors.warning || "#f59e0b"}20`,
|
|
4625
|
+
border: `1px solid ${theme.mode === "light" ? "#fcd34d" : theme.colors.warning || "#f59e0b"}`,
|
|
4626
|
+
borderRadius: theme.borderRadius.md,
|
|
4627
|
+
padding: theme.spacing.md,
|
|
4628
|
+
marginBottom: theme.spacing.md,
|
|
4629
|
+
textAlign: "center"
|
|
4626
4630
|
},
|
|
4627
|
-
children:
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
{
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
style: {
|
|
4657
|
-
fontSize: styles?.statusDisplay?.text?.fontSize || theme.typography.fontSize.xs,
|
|
4658
|
-
padding: `2px ${theme.spacing.xs}`,
|
|
4659
|
-
borderRadius: theme.borderRadius.sm,
|
|
4660
|
-
border: `1px solid ${isConnected ? styles?.statusDisplay?.successColor || theme.colors.success : styles?.statusDisplay?.warningColor || theme.colors.warning}`,
|
|
4661
|
-
backgroundColor: isConnected ? theme.mode === "light" ? "#dcfce7" : `${styles?.statusDisplay?.successColor || theme.colors.success}20` : theme.mode === "light" ? "#fef3c7" : `${styles?.statusDisplay?.warningColor || theme.colors.warning}20`,
|
|
4662
|
-
color: isConnected ? styles?.statusDisplay?.successColor || theme.colors.success : styles?.statusDisplay?.warningColor || theme.colors.warning,
|
|
4663
|
-
fontFamily: styles?.statusDisplay?.text?.fontFamily || theme.typography.fontFamily
|
|
4664
|
-
},
|
|
4665
|
-
children: isConnected ? "Connected" : "Disconnected"
|
|
4666
|
-
}
|
|
4667
|
-
)
|
|
4668
|
-
]
|
|
4669
|
-
}
|
|
4670
|
-
),
|
|
4671
|
-
isConnected && address && /* @__PURE__ */ jsxs(
|
|
4672
|
-
"div",
|
|
4673
|
-
{
|
|
4674
|
-
className: "ibm-plex-mono",
|
|
4675
|
-
style: {
|
|
4676
|
-
marginTop: "6px",
|
|
4677
|
-
backgroundColor: styles?.addressDisplay?.backgroundColor || (theme.mode === "light" ? "#f3f4f6" : theme.colors.secondary),
|
|
4678
|
-
border: `1px solid ${styles?.addressDisplay?.borderColor || (theme.mode === "light" ? "#d1d5db" : theme.colors.borderHover)}`,
|
|
4679
|
-
borderRadius: styles?.addressDisplay?.borderRadius || theme.borderRadius.sm,
|
|
4680
|
-
padding: styles?.addressDisplay?.padding || `${theme.spacing.xs} ${theme.spacing.sm}`,
|
|
4681
|
-
fontSize: styles?.addressDisplay?.fontSize || theme.typography.fontSize.xs,
|
|
4682
|
-
fontFamily: styles?.addressDisplay?.fontFamily || (styles?.fontFamily ? `${styles.fontFamily}, IBM Plex Mono` : "IBM Plex Mono"),
|
|
4683
|
-
color: styles?.addressDisplay?.color || theme.colors.text,
|
|
4684
|
-
display: "flex",
|
|
4685
|
-
alignItems: "center",
|
|
4686
|
-
gap: theme.spacing.sm
|
|
4687
|
-
},
|
|
4688
|
-
children: [
|
|
4689
|
-
/* @__PURE__ */ jsxs("span", { style: { flex: 1 }, children: [
|
|
4690
|
-
address.slice(0, 6),
|
|
4691
|
-
"...",
|
|
4692
|
-
address.slice(-4)
|
|
4693
|
-
] }),
|
|
4694
|
-
/* @__PURE__ */ jsx(
|
|
4695
|
-
"button",
|
|
4696
|
-
{
|
|
4697
|
-
style: {
|
|
4698
|
-
fontSize: styles?.addressDisplay?.copyButton?.fontSize || theme.typography.fontSize.xs,
|
|
4699
|
-
padding: styles?.addressDisplay?.copyButton?.padding || `${theme.spacing.xs} ${theme.spacing.sm}`,
|
|
4700
|
-
backgroundColor: styles?.addressDisplay?.copyButton?.backgroundColor || (theme.mode === "light" ? "#e5e7eb" : theme.colors.surfaceHover),
|
|
4701
|
-
border: `1px solid ${styles?.addressDisplay?.copyButton?.borderColor || (theme.mode === "light" ? "#d1d5db" : theme.colors.border)}`,
|
|
4702
|
-
borderRadius: styles?.addressDisplay?.copyButton?.borderRadius || theme.borderRadius.sm,
|
|
4703
|
-
color: styles?.addressDisplay?.copyButton?.color || theme.colors.text,
|
|
4704
|
-
fontFamily: styles?.addressDisplay?.copyButton?.fontFamily || theme.typography.fontFamily,
|
|
4705
|
-
cursor: "pointer",
|
|
4706
|
-
transition: `background-color ${theme.animation.normal}`
|
|
4707
|
-
},
|
|
4708
|
-
onClick: () => copyToClipboard(address),
|
|
4709
|
-
title: "Copy address",
|
|
4710
|
-
children: "Copy"
|
|
4711
|
-
}
|
|
4712
|
-
)
|
|
4713
|
-
]
|
|
4714
|
-
}
|
|
4715
|
-
),
|
|
4716
|
-
!ready && /* @__PURE__ */ jsxs(
|
|
4717
|
-
"div",
|
|
4718
|
-
{
|
|
4719
|
-
style: {
|
|
4720
|
-
marginTop: "6px",
|
|
4721
|
-
fontSize: theme.typography.fontSize.xs,
|
|
4722
|
-
color: theme.colors.textSecondary,
|
|
4723
|
-
fontFamily: theme.typography.fontFamily
|
|
4724
|
-
},
|
|
4725
|
-
children: [
|
|
4726
|
-
"Loading",
|
|
4727
|
-
" ",
|
|
4728
|
-
spiceFlowContext?.provider === "privy" ? "Privy" : spiceFlowContext?.provider === "dynamic" ? "Dynamic" : "Wallet",
|
|
4729
|
-
"..."
|
|
4730
|
-
]
|
|
4731
|
-
}
|
|
4732
|
-
)
|
|
4733
|
-
]
|
|
4631
|
+
children: /* @__PURE__ */ jsxs(
|
|
4632
|
+
"p",
|
|
4633
|
+
{
|
|
4634
|
+
style: {
|
|
4635
|
+
color: theme.mode === "light" ? "#92400e" : "#fbbf24",
|
|
4636
|
+
fontSize: theme.typography.fontSize.sm,
|
|
4637
|
+
fontFamily: theme.typography.fontFamily,
|
|
4638
|
+
margin: 0,
|
|
4639
|
+
lineHeight: 1.5
|
|
4640
|
+
},
|
|
4641
|
+
children: [
|
|
4642
|
+
"You do not have any cross-chain balance.",
|
|
4643
|
+
" ",
|
|
4644
|
+
onTopUp && /* @__PURE__ */ jsx(
|
|
4645
|
+
"span",
|
|
4646
|
+
{
|
|
4647
|
+
onClick: onTopUp,
|
|
4648
|
+
style: {
|
|
4649
|
+
color: theme.colors.primary,
|
|
4650
|
+
textDecoration: "underline",
|
|
4651
|
+
cursor: "pointer",
|
|
4652
|
+
fontWeight: 600
|
|
4653
|
+
},
|
|
4654
|
+
children: "Top-up here."
|
|
4655
|
+
}
|
|
4656
|
+
)
|
|
4657
|
+
]
|
|
4658
|
+
}
|
|
4659
|
+
)
|
|
4734
4660
|
}
|
|
4735
|
-
)
|
|
4661
|
+
),
|
|
4736
4662
|
/* @__PURE__ */ jsx("div", { style: { marginBottom: theme.spacing.sm }, children: /* @__PURE__ */ jsx(
|
|
4737
4663
|
AssetSelector,
|
|
4738
4664
|
{
|
|
@@ -4748,50 +4674,6 @@ const DepositWidget = ({
|
|
|
4748
4674
|
styles
|
|
4749
4675
|
}
|
|
4750
4676
|
) }),
|
|
4751
|
-
depositBatches.length > 0 && /* @__PURE__ */ jsx("div", { style: { marginBottom: theme.spacing.sm }, children: /* @__PURE__ */ jsxs(
|
|
4752
|
-
"div",
|
|
4753
|
-
{
|
|
4754
|
-
style: {
|
|
4755
|
-
backgroundColor: styles?.infoCard?.backgroundColor || styles?.tertiaryBackground || (theme.mode === "light" ? "#f9fafb" : theme.colors.surface),
|
|
4756
|
-
border: `1px solid ${styles?.infoCard?.borderColor || (theme.mode === "light" ? "#e5e7eb" : theme.colors.border)}`,
|
|
4757
|
-
borderRadius: styles?.infoCard?.borderRadius || theme.borderRadius.md,
|
|
4758
|
-
padding: styles?.infoCard?.padding || theme.spacing.sm
|
|
4759
|
-
},
|
|
4760
|
-
children: [
|
|
4761
|
-
/* @__PURE__ */ jsx(
|
|
4762
|
-
"div",
|
|
4763
|
-
{
|
|
4764
|
-
style: {
|
|
4765
|
-
fontSize: styles?.infoCard?.title?.fontSize || theme.typography.fontSize.xs,
|
|
4766
|
-
fontWeight: styles?.infoCard?.title?.fontWeight || theme.typography.fontWeight.medium,
|
|
4767
|
-
color: styles?.infoCard?.title?.color || theme.colors.text,
|
|
4768
|
-
fontFamily: styles?.infoCard?.title?.fontFamily || theme.typography.fontFamily,
|
|
4769
|
-
marginBottom: "4px"
|
|
4770
|
-
},
|
|
4771
|
-
children: "Deposit Batches Ready"
|
|
4772
|
-
}
|
|
4773
|
-
),
|
|
4774
|
-
/* @__PURE__ */ jsxs(
|
|
4775
|
-
"div",
|
|
4776
|
-
{
|
|
4777
|
-
style: {
|
|
4778
|
-
fontSize: styles?.infoCard?.description?.fontSize || theme.typography.fontSize.xs,
|
|
4779
|
-
color: styles?.infoCard?.description?.color || theme.colors.textSecondary,
|
|
4780
|
-
fontFamily: styles?.infoCard?.description?.fontFamily || theme.typography.fontFamily
|
|
4781
|
-
},
|
|
4782
|
-
children: [
|
|
4783
|
-
depositBatches.length,
|
|
4784
|
-
" deposit batch",
|
|
4785
|
-
depositBatches.length > 1 ? "es" : "",
|
|
4786
|
-
" across chains:",
|
|
4787
|
-
" ",
|
|
4788
|
-
[...new Set(depositBatches.map((b) => b.chainId))].join(", ")
|
|
4789
|
-
]
|
|
4790
|
-
}
|
|
4791
|
-
)
|
|
4792
|
-
]
|
|
4793
|
-
}
|
|
4794
|
-
) }),
|
|
4795
4677
|
displayError && /* @__PURE__ */ jsx(
|
|
4796
4678
|
"div",
|
|
4797
4679
|
{
|
|
@@ -4828,7 +4710,7 @@ const DepositWidget = ({
|
|
|
4828
4710
|
children: /* @__PURE__ */ jsx(
|
|
4829
4711
|
Button,
|
|
4830
4712
|
{
|
|
4831
|
-
variant: "
|
|
4713
|
+
variant: "outline",
|
|
4832
4714
|
fullWidth: true,
|
|
4833
4715
|
onClick: handleDeposit,
|
|
4834
4716
|
loading: isExecuting,
|
|
@@ -5059,7 +4941,7 @@ const DepositWidgetModal = ({
|
|
|
5059
4941
|
isOpen,
|
|
5060
4942
|
onClose,
|
|
5061
4943
|
title = "Deposit",
|
|
5062
|
-
|
|
4944
|
+
description = "Deposit funds to execute chain batches across multiple networks.",
|
|
5063
4945
|
maxWidth = "480px",
|
|
5064
4946
|
// Pass through all DepositWidget props
|
|
5065
4947
|
depositBatches,
|
|
@@ -5075,7 +4957,7 @@ const DepositWidgetModal = ({
|
|
|
5075
4957
|
onDepositError
|
|
5076
4958
|
}) => {
|
|
5077
4959
|
const theme = createTheme(themeMode);
|
|
5078
|
-
const
|
|
4960
|
+
const defaultDescription = /* @__PURE__ */ jsxs(
|
|
5079
4961
|
"div",
|
|
5080
4962
|
{
|
|
5081
4963
|
style: {
|
|
@@ -5107,7 +4989,7 @@ const DepositWidgetModal = ({
|
|
|
5107
4989
|
lineHeight: "1.4",
|
|
5108
4990
|
fontFamily: "system-ui, -apple-system, sans-serif"
|
|
5109
4991
|
},
|
|
5110
|
-
children:
|
|
4992
|
+
children: description
|
|
5111
4993
|
}
|
|
5112
4994
|
)
|
|
5113
4995
|
]
|
|
@@ -5122,7 +5004,7 @@ const DepositWidgetModal = ({
|
|
|
5122
5004
|
isOpen,
|
|
5123
5005
|
onClose,
|
|
5124
5006
|
title,
|
|
5125
|
-
subtitle:
|
|
5007
|
+
subtitle: description || defaultDescription,
|
|
5126
5008
|
styles,
|
|
5127
5009
|
theme,
|
|
5128
5010
|
maxWidth,
|
|
@@ -5397,6 +5279,8 @@ const CrossChainDepositModal = ({
|
|
|
5397
5279
|
isOpen,
|
|
5398
5280
|
onClose,
|
|
5399
5281
|
onComplete,
|
|
5282
|
+
title = "Deposit to Spicenet",
|
|
5283
|
+
description = "Select tokens and enter amounts to deposit to your Spicenet Account",
|
|
5400
5284
|
chainId,
|
|
5401
5285
|
externalWalletAddress,
|
|
5402
5286
|
escrowAddress = "0xeee2b52e7CFe6e2168341a34cEB783b68FEdf1A2",
|
|
@@ -5627,7 +5511,7 @@ const CrossChainDepositModal = ({
|
|
|
5627
5511
|
}
|
|
5628
5512
|
}
|
|
5629
5513
|
),
|
|
5630
|
-
/* @__PURE__ */
|
|
5514
|
+
/* @__PURE__ */ jsx(
|
|
5631
5515
|
"p",
|
|
5632
5516
|
{
|
|
5633
5517
|
style: {
|
|
@@ -5636,12 +5520,7 @@ const CrossChainDepositModal = ({
|
|
|
5636
5520
|
margin: 0,
|
|
5637
5521
|
lineHeight: "1.5"
|
|
5638
5522
|
},
|
|
5639
|
-
children:
|
|
5640
|
-
"Select tokens and enter amounts to deposit to your Spicenet Account on",
|
|
5641
|
-
" ",
|
|
5642
|
-
chainConfig?.displayName || `Chain ${chainId}`,
|
|
5643
|
-
"."
|
|
5644
|
-
]
|
|
5523
|
+
children: description
|
|
5645
5524
|
}
|
|
5646
5525
|
)
|
|
5647
5526
|
]
|
|
@@ -5799,7 +5678,7 @@ const CrossChainDepositModal = ({
|
|
|
5799
5678
|
{
|
|
5800
5679
|
isOpen,
|
|
5801
5680
|
onClose,
|
|
5802
|
-
title
|
|
5681
|
+
title,
|
|
5803
5682
|
subtitle,
|
|
5804
5683
|
theme,
|
|
5805
5684
|
maxWidth: "480px",
|
|
@@ -5926,7 +5805,6 @@ const CrossChainDepositModal = ({
|
|
|
5926
5805
|
variant: "outline",
|
|
5927
5806
|
fullWidth: true,
|
|
5928
5807
|
onClick: executeDeposit,
|
|
5929
|
-
loading: isExecuting,
|
|
5930
5808
|
disabled: !canDeposit,
|
|
5931
5809
|
theme,
|
|
5932
5810
|
style: {
|
package/dist/types/deposit.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export interface DepositWidgetProps {
|
|
|
29
29
|
depositInputHook?: UseDepositInputReturn;
|
|
30
30
|
onDepositSuccess?: (intentId: string) => void;
|
|
31
31
|
onDepositError?: (error: string) => void;
|
|
32
|
+
onTopUp?: () => void;
|
|
32
33
|
}
|
|
33
34
|
export interface DepositModalProps {
|
|
34
35
|
isOpen: boolean;
|