@spicenet-io/spiceflow-ui 3.2.1 → 3.2.2

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.
Files changed (92) hide show
  1. package/dist/Button-B--Fjq1m.js +2 -0
  2. package/dist/Button-dU4UsC56.js +2 -0
  3. package/dist/auth-dynamic.cjs.js +1 -1
  4. package/dist/auth-dynamic.js +1 -1
  5. package/dist/auth-privy.cjs.js +1 -1
  6. package/dist/auth-privy.js +1 -1
  7. package/dist/components/AssetSelector/AssetDropdown.d.ts +1 -12
  8. package/dist/components/AssetSelector/ChainIcon.d.ts +1 -7
  9. package/dist/components/AssetSelector/TokenIcon.d.ts +1 -7
  10. package/dist/components/AssetSelector/index.d.ts +1 -3
  11. package/dist/components/ExportWallet/ExportWalletButton.d.ts +2 -7
  12. package/dist/components/ProviderLogins/DynamicLogin.d.ts +2 -8
  13. package/dist/components/ProviderLogins/PrivyLogin.d.ts +2 -8
  14. package/dist/components/ProviderLogins/ProviderLogin.d.ts +2 -8
  15. package/dist/components/SpiceDeposit/DepositRecoveryPrompt.d.ts +1 -14
  16. package/dist/components/SpiceDeposit/DepositStatusModal.d.ts +4 -37
  17. package/dist/components/SpiceDeposit/SelectTokenModal.d.ts +1 -16
  18. package/dist/components/SpiceDeposit/SpiceDeposit.d.ts +2 -35
  19. package/dist/components/SpiceLockModal/LockSubComponents.d.ts +2 -45
  20. package/dist/components/SpicePay/SpicePay.d.ts +2 -29
  21. package/dist/components/SpiceSupply/SupplyEstimate.d.ts +2 -13
  22. package/dist/components/SpiceWithdraw/SelectPopover.d.ts +2 -7
  23. package/dist/components/SpiceWithdraw/SpiceWithdraw.d.ts +2 -26
  24. package/dist/components/StatusDisplay/StatusIcon.d.ts +1 -7
  25. package/dist/components/StatusDisplay/StatusPanel.d.ts +2 -31
  26. package/dist/components/StatusDisplay/StepItem.d.ts +1 -8
  27. package/dist/components/StatusDisplay/index.d.ts +1 -2
  28. package/dist/components/index.d.ts +0 -2
  29. package/dist/components/ui/AddFundsLink.d.ts +3 -0
  30. package/dist/components/ui/Button.d.ts +1 -11
  31. package/dist/components/ui/CloseIcon.d.ts +1 -6
  32. package/dist/components/ui/DetailRow.d.ts +3 -0
  33. package/dist/components/ui/FeeBreakdownCard.d.ts +2 -11
  34. package/dist/components/ui/Input.d.ts +1 -10
  35. package/dist/components/ui/Modal.d.ts +1 -10
  36. package/dist/components/ui/SearchInput.d.ts +15 -0
  37. package/dist/components/ui/SpiceModalShell.d.ts +1 -17
  38. package/dist/components/ui/Spinner.d.ts +1 -6
  39. package/dist/components/ui/StatusBanner.d.ts +1 -10
  40. package/dist/components/ui/icons.d.ts +13 -0
  41. package/dist/components/ui/index.d.ts +7 -8
  42. package/dist/index.cjs.js +31 -42
  43. package/dist/index.d.ts +10 -12
  44. package/dist/index.js +27 -38
  45. package/dist/providerWallet-DDywdl9_.js +2 -0
  46. package/dist/providerWallet-cDeDz-zR.js +2 -0
  47. package/dist/providers/custom.css +1 -1
  48. package/dist/types/assets.d.ts +22 -0
  49. package/dist/types/authorization.d.ts +5 -2
  50. package/dist/types/deposit.d.ts +94 -27
  51. package/dist/types/index.d.ts +2 -0
  52. package/dist/types/lock.d.ts +44 -0
  53. package/dist/types/pay.d.ts +30 -0
  54. package/dist/types/status.d.ts +41 -1
  55. package/dist/types/supply.d.ts +13 -0
  56. package/dist/types/ui.d.ts +95 -0
  57. package/dist/types/wallet.d.ts +31 -0
  58. package/dist/types/withdraw.d.ts +30 -0
  59. package/dist/utils/loadFonts.d.ts +1 -0
  60. package/dist/utils/relayer/index.d.ts +0 -20
  61. package/dist/utils/tokens.d.ts +43 -0
  62. package/package.json +1 -18
  63. package/dist/Button-D5zwqrrP.js +0 -2
  64. package/dist/Button-KtHGKIo6.js +0 -2
  65. package/dist/auth-starknet.cjs.js +0 -2
  66. package/dist/auth-starknet.d.ts +0 -6
  67. package/dist/auth-starknet.js +0 -2
  68. package/dist/components/Airdrop/Airdrop.d.ts +0 -28
  69. package/dist/components/Airdrop/index.d.ts +0 -2
  70. package/dist/components/DepositWidget/AssetInput.d.ts +0 -23
  71. package/dist/components/DepositWidget/CrossChainDepositModal.d.ts +0 -42
  72. package/dist/components/DepositWidget/DepositWidget.d.ts +0 -3
  73. package/dist/components/DepositWidget/DepositWidgetModal.d.ts +0 -11
  74. package/dist/components/DepositWidget/index.d.ts +0 -8
  75. package/dist/components/LpModal/AmountCard.d.ts +0 -11
  76. package/dist/components/LpModal/CompactAssetSelector.d.ts +0 -11
  77. package/dist/components/LpModal/LpModal.d.ts +0 -3
  78. package/dist/components/LpModal/PairInfoCard.d.ts +0 -14
  79. package/dist/components/LpModal/ProgressIndicators.d.ts +0 -4
  80. package/dist/components/LpModal/index.d.ts +0 -1
  81. package/dist/components/StarknetWallet/StarknetWalletButton.d.ts +0 -9
  82. package/dist/components/StarknetWallet/index.d.ts +0 -2
  83. package/dist/components/ui/Toast.d.ts +0 -10
  84. package/dist/hooks/useStarknetWallet.d.ts +0 -13
  85. package/dist/index-DJQ17ocQ.js +0 -2
  86. package/dist/index-WLbJouQ7.js +0 -2
  87. package/dist/providerWallet-DeNDXTJA.js +0 -2
  88. package/dist/providerWallet-DrwSLBof.js +0 -2
  89. package/dist/providers/StarknetWalletProvider.d.ts +0 -8
  90. package/dist/types/lp.d.ts +0 -43
  91. package/dist/useSpiceBrand-BBtUTOno.js +0 -2
  92. package/dist/useSpiceBrand-D-06ludX.js +0 -2
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{createWalletClient as l,custom as d}from"viem";import{g as c}from"./Button-dU4UsC56.js";const o=t=>{if(!t)return!1;const e=t.connector;if(!e)return!1;if(e.isEmbeddedWallet===!0)return!0;const r=(e.key||e.connectorKey||"").toLowerCase();if(r.includes("embedded")||r.includes("turnkey"))return!0;const n=(e.name||t.walletName||"").toLowerCase();return!!(n.includes("embedded")||n.includes("turnkey"))},u=t=>(t?.connectedWallets||[]).find(e=>o(e))||(o(t?.primaryWallet)?t.primaryWallet:null),f=t=>(t?.connectedWallets||[]).find(e=>e?.address&&e?.connector&&!o(e))||null,i=async(t,e)=>{if(!t?.address)throw new Error("Wallet not available");if(typeof t.getWalletClient=="function"){const r=e===void 0?[void 0]:[String(e),e,void 0];let n=null;for(const s of r)try{const a=await t.getWalletClient(s);if(a)return a}catch(a){n=a}if(n)throw n}if(typeof t.getEthereumProvider=="function"){const r=await t.getEthereumProvider(),n=e?c(e)?.viemChain:void 0;return l({account:t.address,chain:n,transport:d(r)})}throw new Error("Wallet client not available")},m=async(t,e)=>{if(!t?.address)throw new Error("Wallet not available");if(typeof t.getEthereumProvider=="function")return t.getEthereumProvider();const r=await i(t,e);return{request:n=>r.request(n)}},y=(t,e)=>({address:t?.address||e.address,chainId:Number(t?.chainId??e.chainId),contractAddress:t?.contractAddress||t?.delegate||e.contractAddress,nonce:BigInt(t?.nonce??e.nonce),r:t?.r,s:t?.s,yParity:(()=>{if(typeof t?.yParity=="number")return t.yParity;const r=Number(t?.v??27);return Number.isFinite(r)?r>=27?r-27:r:0})()});export{m as a,f as b,i as c,u as g,y as n};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";const o=require("viem"),c=require("./Button-B--Fjq1m.js"),a=e=>{if(!e)return!1;const t=e.connector;if(!t)return!1;if(t.isEmbeddedWallet===!0)return!0;const r=(t.key||t.connectorKey||"").toLowerCase();if(r.includes("embedded")||r.includes("turnkey"))return!0;const n=(t.name||e.walletName||"").toLowerCase();return!!(n.includes("embedded")||n.includes("turnkey"))},s=e=>(e?.connectedWallets||[]).find(t=>a(t))||(a(e?.primaryWallet)?e.primaryWallet:null),u=e=>(e?.connectedWallets||[]).find(t=>t?.address&&t?.connector&&!a(t))||null,l=async(e,t)=>{if(!e?.address)throw new Error("Wallet not available");if(typeof e.getWalletClient=="function"){const r=t===void 0?[void 0]:[String(t),t,void 0];let n=null;for(const d of r)try{const i=await e.getWalletClient(d);if(i)return i}catch(i){n=i}if(n)throw n}if(typeof e.getEthereumProvider=="function"){const r=await e.getEthereumProvider(),n=t?c.getChainConfig(t)?.viemChain:void 0;return o.createWalletClient({account:e.address,chain:n,transport:o.custom(r)})}throw new Error("Wallet client not available")},m=async(e,t)=>{if(!e?.address)throw new Error("Wallet not available");if(typeof e.getEthereumProvider=="function")return e.getEthereumProvider();const r=await l(e,t);return{request:n=>r.request(n)}},f=(e,t)=>({address:e?.address||t.address,chainId:Number(e?.chainId??t.chainId),contractAddress:e?.contractAddress||e?.delegate||t.contractAddress,nonce:BigInt(e?.nonce??t.nonce),r:e?.r,s:e?.s,yParity:(()=>{if(typeof e?.yParity=="number")return e.yParity;const r=Number(e?.v??27);return Number.isFinite(r)?r>=27?r-27:r:0})()});exports.getDynamicEmbeddedWallet=s,exports.getDynamicExternalWallet=u,exports.getProviderEthereumProvider=m,exports.getProviderWalletClient=l,exports.normalizeAuthorization=f;
@@ -1 +1 @@
1
- @import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@100;200;300;400;500;600;700&display=swap");@keyframes spiceflow-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.ibm-plex-mono-thin{font-weight:100}.ibm-plex-mono-extralight,.ibm-plex-mono-thin{font-family:IBM Plex Mono,monospace!important;font-style:normal}.ibm-plex-mono-extralight{font-weight:200}.ibm-plex-mono-light{font-weight:300}.ibm-plex-mono-light,.ibm-plex-mono-regular{font-family:IBM Plex Mono,monospace!important;font-style:normal}.ibm-plex-mono-regular{font-weight:400}.ibm-plex-mono-medium{font-weight:500}.ibm-plex-mono-medium,.ibm-plex-mono-semibold{font-family:IBM Plex Mono,monospace!important;font-style:normal}.ibm-plex-mono-semibold{font-weight:600}.ibm-plex-mono-bold{font-family:IBM Plex Mono,monospace!important;font-style:normal;font-weight:700}#privy-modal-content button{border-radius:6px;font-family:IBM Plex Mono,monospace!important;font-size:small;letter-spacing:-.5px;text-transform:uppercase}#privy-modal-content input{background:#fff;border-radius:6px;padding-top:5px!important}#privy-dialog-title{display:none!important;font-size:18px;padding-bottom:10px;padding-top:10px}.AppLogoContainer-sc-a206bd44-0{display:none}#privy-modal-content{background:var(--Neutral-0,#fafafa);border:6px solid var(--Neutral-1,#e9e9e9);box-shadow:inset 0 0 0 1px rgba(0,0,0,.15),0 330px 92px transparent,0 211px 84px rgba(0,0,0,.01),0 119px 71px rgba(0,0,0,.05),0 53px 53px rgba(0,0,0,.09),0 13px 29px rgba(0,0,0,.1);height:auto!important;padding-bottom:10px}.Subtitle-sc-ddbf22b4-4{font-size:12px;margin-top:-14px;opacity:.5}.StyledLink-sc-1c6127e5-0{background:none!important}.StyledLink-sc-c8577138-0,.login-method-button{font-family:IBM Plex Mono,monospace!important}.StyledLink-sc-c8577138-0{font-style:uppercase}#protected-by-privy{color:#000!important}
1
+ @keyframes spiceflow-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@media (prefers-reduced-motion:reduce){*,:after,:before{animation-duration:.001ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.001ms!important}}.spiceflow-focus-ring:focus-visible,[data-spiceflow-focus]:focus-visible{border-radius:4px;outline:2px solid currentColor;outline-offset:2px}@media (forced-colors:active){.spiceflow-focus-ring:focus-visible,[data-spiceflow-focus]:focus-visible{outline:2px solid Highlight}}.ibm-plex-mono-thin{font-weight:100}.ibm-plex-mono-extralight,.ibm-plex-mono-thin{font-family:IBM Plex Mono,monospace!important;font-style:normal}.ibm-plex-mono-extralight{font-weight:200}.ibm-plex-mono-light{font-weight:300}.ibm-plex-mono-light,.ibm-plex-mono-regular{font-family:IBM Plex Mono,monospace!important;font-style:normal}.ibm-plex-mono-regular{font-weight:400}.ibm-plex-mono-medium{font-weight:500}.ibm-plex-mono-medium,.ibm-plex-mono-semibold{font-family:IBM Plex Mono,monospace!important;font-style:normal}.ibm-plex-mono-semibold{font-weight:600}.ibm-plex-mono-bold{font-family:IBM Plex Mono,monospace!important;font-style:normal;font-weight:700}#privy-modal-content button{border-radius:6px;font-family:IBM Plex Mono,monospace!important;font-size:small;letter-spacing:-.5px;text-transform:uppercase}#privy-modal-content input{background:#fff;border-radius:6px;padding-top:5px!important}#privy-dialog-title{display:none!important;font-size:18px;padding-bottom:10px;padding-top:10px}.AppLogoContainer-sc-a206bd44-0{display:none}#privy-modal-content{background:var(--Neutral-0,#fafafa);border:6px solid var(--Neutral-1,#e9e9e9);box-shadow:inset 0 0 0 1px rgba(0,0,0,.15),0 330px 92px transparent,0 211px 84px rgba(0,0,0,.01),0 119px 71px rgba(0,0,0,.05),0 53px 53px rgba(0,0,0,.09),0 13px 29px rgba(0,0,0,.1);height:auto!important;padding-bottom:10px}.Subtitle-sc-ddbf22b4-4{font-size:12px;margin-top:-14px;opacity:.5}.StyledLink-sc-1c6127e5-0{background:none!important}.StyledLink-sc-c8577138-0,.login-method-button{font-family:IBM Plex Mono,monospace!important}.StyledLink-sc-c8577138-0{font-style:uppercase}#protected-by-privy{color:#000!important}
@@ -56,3 +56,25 @@ export interface AssetSelectorProps {
56
56
  dark?: boolean;
57
57
  onViewAllAssets?: () => void;
58
58
  }
59
+ export interface TokenIconProps {
60
+ symbol: string;
61
+ logoURI?: string;
62
+ size?: number;
63
+ theme?: Theme;
64
+ }
65
+ export interface ChainIconProps {
66
+ chainId?: number;
67
+ name?: string;
68
+ size?: number;
69
+ theme?: Theme;
70
+ }
71
+ export interface AssetDropdownProps {
72
+ selectedAsset?: SelectedAsset;
73
+ assets: Asset[];
74
+ onAssetSelect: (asset: Asset) => void;
75
+ showDropdown: boolean;
76
+ onToggleDropdown: () => void;
77
+ disabled?: boolean;
78
+ theme?: Theme;
79
+ onViewAllAssets?: () => void;
80
+ }
@@ -1,6 +1,9 @@
1
1
  import { Address } from "viem";
2
- import type { Call, TokenTransferConfig } from "@spicenet-io/spiceflow-core";
3
- export type { Call, SwapIntent, BatchEntry, TokenTransferConfig, } from "@spicenet-io/spiceflow-core";
2
+ import type { Call, TokenTransferConfig as CoreTokenTransferConfig } from "@spicenet-io/spiceflow-core";
3
+ export type { Call, SwapIntent, BatchEntry } from "@spicenet-io/spiceflow-core";
4
+ export type TokenTransferConfig = Omit<CoreTokenTransferConfig, "from"> & {
5
+ from: CoreTokenTransferConfig["from"] | "escrow";
6
+ };
4
7
  export interface Authorization {
5
8
  address: Address;
6
9
  chainId: number;
@@ -2,7 +2,10 @@ import { Address } from "viem";
2
2
  import { ChainBatch } from ".";
3
3
  import { UseAssetInputReturn } from "../hooks/useAssetInput";
4
4
  import { Asset } from "./assets";
5
- import { CustomStyles, ThemeMode } from "./theme";
5
+ import { CustomStyles, Theme } from "./theme";
6
+ import type { IntentStatus } from "./status";
7
+ import type { Network } from "@spicenet-io/spiceflow-core";
8
+ import type { VerifiedPendingDeposit } from "../hooks/usePendingDeposit";
6
9
  export interface PostDepositContext {
7
10
  sourceChainId: number;
8
11
  depositTokenAddress: Address;
@@ -30,31 +33,6 @@ export interface SpiceDepositResponse {
30
33
  message: string;
31
34
  };
32
35
  }
33
- export interface DepositWidgetProps {
34
- depositBatches: ChainBatch[];
35
- tokenAddress: Address;
36
- tokenDecimals: number;
37
- tokenTransferAmount?: bigint;
38
- supportedChains: number[];
39
- supportedTokens?: string[];
40
- theme?: ThemeMode;
41
- styles?: CustomStyles;
42
- className?: string;
43
- depositInputHook?: UseAssetInputReturn;
44
- onDepositSuccess?: (intentId: string) => void;
45
- onDepositError?: (error: string) => void;
46
- onTopUp?: () => void;
47
- onComplete?: () => void;
48
- submitButtonText?: string;
49
- maxAmount?: string;
50
- userToSolverTransfers?: Array<{
51
- token: Address;
52
- amount: bigint;
53
- }>;
54
- includeWalletAssets?: boolean;
55
- destinationTokenAddress?: Address;
56
- walletAssetChainId?: number;
57
- }
58
36
  export interface DepositModalProps {
59
37
  isOpen: boolean;
60
38
  onClose: () => void;
@@ -78,7 +56,6 @@ export interface DepositModalProps {
78
56
  onDepositExecute?: (bridgedAmount: string) => Promise<void> | void;
79
57
  depositActionLabel?: string;
80
58
  nativeChainId?: number;
81
- airdrop?: boolean;
82
59
  sponsorGas?: boolean;
83
60
  preSelectedAsset?: Asset;
84
61
  escrowOnly?: boolean;
@@ -96,3 +73,93 @@ export interface DepositModalProps {
96
73
  }) => void;
97
74
  onViewAllAssets?: () => void;
98
75
  }
76
+ export interface EscrowRecovery {
77
+ chainId: number;
78
+ tokenAddress: string;
79
+ tokenSymbol: string;
80
+ tokenDecimals: number;
81
+ amount: string;
82
+ }
83
+ export interface SpiceDepositProps {
84
+ isOpen: boolean;
85
+ onClose: () => void;
86
+ styles?: CustomStyles;
87
+ depositBatches?: ChainBatch[] | ((context: PostDepositContext) => Promise<ChainBatch[]>) | ((depositAmount: string, depositTokenAddress: string) => Promise<ChainBatch[]>);
88
+ allowedTokens?: string[];
89
+ onDepositAmountChange?: (amount: string) => void;
90
+ destinationChainId?: number;
91
+ destinationTokenAddress?: string;
92
+ onDepositExecute?: (bridgedAmount: string) => Promise<void> | void;
93
+ depositActionLabel?: string;
94
+ sponsorGas?: boolean;
95
+ escrowRecovery?: EscrowRecovery;
96
+ skipTokenSelection?: boolean;
97
+ onDepositSuccess?: (detail: {
98
+ type: "deposit";
99
+ status: "success";
100
+ amount?: string;
101
+ asset?: string;
102
+ sourceChain?: string;
103
+ txHash?: string;
104
+ }) => void;
105
+ skipRecovery?: boolean;
106
+ }
107
+ export interface SelectTokenModalProps {
108
+ isOpen: boolean;
109
+ onClose: () => void;
110
+ onTokenSelect: (asset: Asset) => void;
111
+ walletAddress: Address;
112
+ supportedChainIds?: number[];
113
+ network?: Network;
114
+ prefetchedAssets?: Asset[] | null;
115
+ styles?: CustomStyles;
116
+ dark?: boolean;
117
+ allowedTokens?: string[];
118
+ }
119
+ export interface DepositConfirmationData {
120
+ network: string;
121
+ amount: string;
122
+ symbol: string;
123
+ chainId?: number;
124
+ creditedAmount?: string;
125
+ spicenetFee?: string;
126
+ networkFee?: string;
127
+ quoteSource?: string;
128
+ }
129
+ export interface DepositConfirmationModalProps {
130
+ isOpen: boolean;
131
+ onClose: () => void;
132
+ onConfirm: () => void;
133
+ data: DepositConfirmationData | null;
134
+ isExecuting?: boolean;
135
+ error?: string | null;
136
+ theme: Theme;
137
+ styles?: CustomStyles;
138
+ intentStatus?: IntentStatus | null;
139
+ postDepositStatus?: "idle" | "executing" | "success" | "error";
140
+ hasPostDepositInstruction?: boolean;
141
+ }
142
+ export interface StatusToastProps {
143
+ intentStatus: IntentStatus | null;
144
+ postDepositSuccess?: boolean;
145
+ postDepositAmount?: string | null;
146
+ postDepositStatus?: "idle" | "executing" | "success" | "error";
147
+ depositActionLabel?: string;
148
+ sourceChainName?: string;
149
+ directDepositStatus?: "idle" | "processing" | "success";
150
+ directDepositTxHash?: string | null;
151
+ directDepositChainId?: number | null;
152
+ styles?: CustomStyles;
153
+ }
154
+ export interface DepositRecoveryPromptProps {
155
+ isOpen: boolean;
156
+ onClose: () => void;
157
+ deposits: VerifiedPendingDeposit[];
158
+ onComplete: (deposit: VerifiedPendingDeposit) => void;
159
+ onCancel: (deposit: VerifiedPendingDeposit) => void;
160
+ onSkip: () => void;
161
+ onChangeWallet?: () => void;
162
+ isProcessing: boolean;
163
+ error?: string | null;
164
+ styles?: CustomStyles;
165
+ }
@@ -8,3 +8,5 @@ export * from "./wallet";
8
8
  export * from "./balance";
9
9
  export * from "./unified";
10
10
  export * from "./rollup";
11
+ export * from "./ui";
12
+ export * from "./pay";
@@ -56,3 +56,47 @@ export interface SpiceLockModalProps {
56
56
  styles?: CustomStyles;
57
57
  dark?: boolean;
58
58
  }
59
+ export interface LockDurationSliderProps {
60
+ options: SpiceLockModalProps["durationOptions"];
61
+ selectedIndex: number;
62
+ onSelect: (index: number) => void;
63
+ primaryColor: string;
64
+ dark?: boolean;
65
+ textPrimary?: string;
66
+ textSecondary?: string;
67
+ trackColor?: string;
68
+ }
69
+ export interface LockExpiryRowProps {
70
+ durationMonths: number | undefined;
71
+ fontFamily: string;
72
+ dark?: boolean;
73
+ textPrimary?: string;
74
+ textSecondary?: string;
75
+ }
76
+ export interface VotingPowerRowProps {
77
+ votes: number | undefined;
78
+ fontFamily: string;
79
+ dark?: boolean;
80
+ textPrimary?: string;
81
+ textSecondary?: string;
82
+ }
83
+ export interface LockConfirmationData {
84
+ sourceNetwork: string;
85
+ depositedAmount: string;
86
+ depositedSymbol: string;
87
+ reppoReceived: string;
88
+ reppoSymbol: string;
89
+ txHash?: string;
90
+ explorerUrl?: string;
91
+ }
92
+ export interface LockConfirmationPanelProps {
93
+ isOpen: boolean;
94
+ data: LockConfirmationData | null;
95
+ isLocking: boolean;
96
+ lockError: string | null;
97
+ onContinue: () => void;
98
+ onClose: () => void;
99
+ primaryColor: string;
100
+ fontFamily: string;
101
+ dark?: boolean;
102
+ }
@@ -0,0 +1,30 @@
1
+ import type React from "react";
2
+ import type { Address } from "viem";
3
+ import type { Call } from "./authorization";
4
+ import type { CustomStyles } from "./theme";
5
+ import type { BuildActionCallsContext, SpiceSupplyProps } from "./supply";
6
+ export interface SpicePayProps {
7
+ isOpen: boolean;
8
+ onClose: () => void;
9
+ paymentTokenAddress: Address;
10
+ paymentTokenSymbol: string;
11
+ paymentTokenDecimals: number;
12
+ paymentTokenLogoURI?: string;
13
+ paymentChainId: number;
14
+ paymentAmount?: string;
15
+ amountInputMode?: "fixed" | "adjustable";
16
+ minPaymentAmount?: string;
17
+ maxPaymentAmount?: string;
18
+ onAmountChange?: (amount: string) => void;
19
+ buildActionCalls: (amount: bigint, ctx: BuildActionCallsContext) => Call[];
20
+ buildSpicenetBatch?: SpiceSupplyProps["buildSpicenetBatch"];
21
+ sourceChains?: number[];
22
+ onPaymentSuccess?: (txHash?: string) => void;
23
+ onPaymentError?: (error: Error) => void;
24
+ styles?: CustomStyles;
25
+ dark?: boolean;
26
+ title?: string;
27
+ subtitle?: React.ReactNode;
28
+ ctaLabel?: string;
29
+ onAddFunds?: () => void;
30
+ }
@@ -1,4 +1,4 @@
1
- import { Theme } from "./theme";
1
+ import { Theme, CustomStyles } from "./theme";
2
2
  export type StepStatus = "pending" | "processing" | "success" | "failed";
3
3
  export type OverallStatus = "processing" | "success" | "failed";
4
4
  export interface SwapStep {
@@ -23,3 +23,43 @@ export interface StatusDisplayProps {
23
23
  explorerUrlBuilder?: (chainId: number, txHash: string) => string;
24
24
  theme?: Theme;
25
25
  }
26
+ export interface StepItemProps {
27
+ step: SwapStep;
28
+ explorerUrlBuilder?: (chainId: number, txHash: string) => string;
29
+ animationDelay?: number;
30
+ theme?: Theme;
31
+ }
32
+ export interface StatusIconProps {
33
+ status: StepStatus | OverallStatus;
34
+ size?: number;
35
+ theme?: Theme;
36
+ }
37
+ export interface StatusResultItem {
38
+ asset: {
39
+ symbol: string;
40
+ address: string;
41
+ };
42
+ txHash: string;
43
+ success: boolean;
44
+ error?: string;
45
+ amount?: string;
46
+ }
47
+ export interface StatusPanelProps {
48
+ isOpen?: boolean;
49
+ onClose: () => void;
50
+ onComplete?: () => void;
51
+ closeOnComplete?: boolean;
52
+ type: "deposit" | "withdraw" | "payment";
53
+ results?: StatusResultItem[];
54
+ chainName?: string;
55
+ explorerUrl?: string;
56
+ theme?: Theme;
57
+ styles?: CustomStyles;
58
+ dark?: boolean;
59
+ intentStatus?: IntentStatus | null;
60
+ onRetry?: () => void;
61
+ onNewTx?: () => void;
62
+ onRetryTx?: () => void;
63
+ asOverlay?: boolean;
64
+ isProcessing?: boolean;
65
+ }
@@ -59,3 +59,16 @@ export interface SpiceSupplyProps {
59
59
  onSuccess?: (txHash: string) => void;
60
60
  onError?: (error: Error) => void;
61
61
  }
62
+ export interface SupplyEstimateProps {
63
+ isQuoting: boolean;
64
+ quoteError: string | null;
65
+ estimatedOutput: string | null;
66
+ destinationSymbol: string;
67
+ destinationLogoURI?: string;
68
+ textPrimary: string;
69
+ textSecondary: string;
70
+ cardBg: string;
71
+ cardBorder: string;
72
+ fontFamily: string;
73
+ primaryColor: string;
74
+ }
@@ -0,0 +1,95 @@
1
+ import type React from "react";
2
+ import type { Theme, CustomStyles } from "./theme";
3
+ import type { ResolvedDarkPalette } from "../utils/resolveTheme";
4
+ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
5
+ variant?: "primary" | "secondary" | "success" | "error" | "ghost" | "outline";
6
+ size?: "sm" | "md" | "lg";
7
+ loading?: boolean;
8
+ fullWidth?: boolean;
9
+ children: React.ReactNode;
10
+ theme?: Theme;
11
+ styles?: CustomStyles;
12
+ dark?: boolean;
13
+ }
14
+ export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
15
+ label?: string;
16
+ error?: string;
17
+ helper?: string;
18
+ fullWidth?: boolean;
19
+ startAdornment?: React.ReactNode;
20
+ endAdornment?: React.ReactNode;
21
+ theme?: Theme;
22
+ }
23
+ export interface ModalProps {
24
+ isOpen: boolean;
25
+ onClose: () => void;
26
+ title?: string;
27
+ children: React.ReactNode;
28
+ maxWidth?: string;
29
+ className?: string;
30
+ theme?: Theme;
31
+ }
32
+ export interface SpinnerProps {
33
+ size?: number;
34
+ borderWidth?: number;
35
+ color?: string;
36
+ style?: React.CSSProperties;
37
+ }
38
+ export interface CloseIconProps {
39
+ size?: number;
40
+ strokeWidth?: number;
41
+ color?: string;
42
+ style?: React.CSSProperties;
43
+ }
44
+ export type StatusVariant = "success" | "warning" | "error" | "info";
45
+ export type StatusBannerSize = "default" | "compact";
46
+ export interface StatusBannerProps {
47
+ variant: StatusVariant;
48
+ palette: ResolvedDarkPalette;
49
+ children: React.ReactNode;
50
+ icon?: React.ReactNode;
51
+ style?: React.CSSProperties;
52
+ fontFamily?: string;
53
+ size?: StatusBannerSize;
54
+ }
55
+ export interface DetailRowProps {
56
+ label: React.ReactNode;
57
+ value: React.ReactNode;
58
+ palette: ResolvedDarkPalette;
59
+ valueColor?: string;
60
+ labelColor?: string;
61
+ style?: React.CSSProperties;
62
+ }
63
+ export interface AddFundsLinkProps {
64
+ onClick: () => void;
65
+ label?: string;
66
+ color: string;
67
+ fontFamily?: string;
68
+ style?: React.CSSProperties;
69
+ }
70
+ export interface SpiceModalShellProps {
71
+ isOpen: boolean;
72
+ onClose: () => void;
73
+ title: string;
74
+ subtitle?: React.ReactNode;
75
+ children: React.ReactNode;
76
+ overlayContent?: React.ReactNode;
77
+ overlayDimmed?: boolean;
78
+ styles?: CustomStyles;
79
+ theme?: Theme;
80
+ maxWidth?: string;
81
+ dark?: boolean;
82
+ footerLinkText?: string;
83
+ bannerSrc?: string;
84
+ bannerAlt?: string;
85
+ }
86
+ export type FeePreview = {
87
+ symbol: string;
88
+ decimals: number;
89
+ grossAmount: bigint;
90
+ netAmount: bigint;
91
+ totalFee?: bigint;
92
+ gasFee: bigint;
93
+ spicenetFee: bigint;
94
+ gasQuoteSource: "estimated" | "configured_fallback" | "static_zero";
95
+ };
@@ -46,3 +46,34 @@ export interface WalletLoginProps {
46
46
  className?: string;
47
47
  buttonText?: string;
48
48
  }
49
+ export interface ProviderLoginProps {
50
+ onAuthSuccess?: (address: string) => void;
51
+ onAuthError?: (error: string) => void;
52
+ theme?: "light" | "dark";
53
+ className?: string;
54
+ buttonText?: string;
55
+ autoTrigger?: boolean;
56
+ }
57
+ export interface PrivyLoginProps {
58
+ onAuthSuccess?: (address: string) => void;
59
+ onAuthError?: (error: string) => void;
60
+ theme?: "light" | "dark";
61
+ className?: string;
62
+ buttonText?: string;
63
+ autoTrigger?: boolean;
64
+ }
65
+ export interface DynamicLoginProps {
66
+ onAuthSuccess?: (address: string) => void;
67
+ onAuthError?: (error: string) => void;
68
+ theme?: "light" | "dark";
69
+ className?: string;
70
+ buttonText?: string;
71
+ autoTrigger?: boolean;
72
+ }
73
+ export interface ExportWalletButtonProps {
74
+ label?: string;
75
+ style?: React.CSSProperties;
76
+ className?: string;
77
+ onExport?: () => void;
78
+ onError?: (error: string) => void;
79
+ }
@@ -1,4 +1,6 @@
1
1
  import { Address } from "viem";
2
+ import type { CustomStyles } from "./theme";
3
+ import type { ChainBatch } from "./authorization";
2
4
  export interface DestinationToken {
3
5
  address: Address;
4
6
  symbol: string;
@@ -6,6 +8,34 @@ export interface DestinationToken {
6
8
  decimals: number;
7
9
  logoURI?: string;
8
10
  }
11
+ export interface SpiceWithdrawProps {
12
+ isOpen: boolean;
13
+ onClose: () => void;
14
+ styles?: CustomStyles;
15
+ onWithdrawExecute?: (withdrawnAmount: string) => Promise<void> | void;
16
+ withdrawActionLabel?: string;
17
+ onWithdrawSuccess?: (data: {
18
+ token: string;
19
+ amount: string;
20
+ chainId: number;
21
+ }) => void;
22
+ onWithdrawError?: (error: string) => void;
23
+ autoCloseDelay?: number;
24
+ supportedChains?: number[];
25
+ availableTokens?: Record<number, DestinationToken[]>;
26
+ buildSpicenetBatch?: (params: {
27
+ destinationChainId: number;
28
+ deliveryToken: Address;
29
+ deliveryAmount: bigint;
30
+ deliveryRecipient: Address;
31
+ }) => ChainBatch | null;
32
+ }
33
+ export interface SelectPopoverItem {
34
+ id: string;
35
+ label: string;
36
+ icon?: string;
37
+ detail?: string;
38
+ }
9
39
  export interface SpiceWithdrawRequest {
10
40
  user: string;
11
41
  txHash: string;
@@ -0,0 +1 @@
1
+ export declare function injectFontStylesheet(): void;
@@ -42,26 +42,6 @@ export declare class RelayerService {
42
42
  transactionHash?: string;
43
43
  };
44
44
  }>;
45
- requestSpiceUsdAirdrop(params: {
46
- chainId: number;
47
- address: string;
48
- }): Promise<{
49
- success: boolean;
50
- txHash?: string;
51
- amount?: string;
52
- errorMessage?: string;
53
- }>;
54
- requestAirdrop(params: {
55
- chainId: number;
56
- tokenId: string;
57
- wallet: string;
58
- amount?: string;
59
- tag: string;
60
- }): Promise<{
61
- success: boolean;
62
- txHash?: string;
63
- errorMessage?: string;
64
- }>;
65
45
  createWallet(address: string, request: CreateWalletRequest): Promise<WalletInfo>;
66
46
  getWallet(address: string): Promise<WalletInfo>;
67
47
  createWithdrawal(request: CreateWithdrawalRequest): Promise<CreateWithdrawalResponse>;
@@ -0,0 +1,43 @@
1
+ export declare const z: {
2
+ readonly base: 0;
3
+ readonly raised: 1;
4
+ readonly sticky: 10;
5
+ readonly overlay: 20;
6
+ readonly popover: 40;
7
+ readonly modal: 1000;
8
+ readonly dropdown: 1100;
9
+ readonly toast: 1200;
10
+ readonly tooltip: 1300;
11
+ };
12
+ export type ZIndex = (typeof z)[keyof typeof z];
13
+ export declare const radius: {
14
+ readonly none: "0";
15
+ readonly sm: "4px";
16
+ readonly md: "6px";
17
+ readonly card: "8px";
18
+ readonly input: "10px";
19
+ readonly shell: "9px";
20
+ readonly modal: "12px";
21
+ readonly pill: "9999px";
22
+ readonly circle: "50%";
23
+ };
24
+ export declare const easing: {
25
+ readonly out: "cubic-bezier(0.22, 1, 0.36, 1)";
26
+ readonly inOut: "cubic-bezier(0.65, 0, 0.35, 1)";
27
+ readonly linear: "linear";
28
+ };
29
+ export declare const duration: {
30
+ readonly fast: "120ms";
31
+ readonly normal: "150ms";
32
+ readonly slow: "300ms";
33
+ readonly progress: "400ms";
34
+ };
35
+ export declare const transition: {
36
+ readonly interactive: "transform 150ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 150ms cubic-bezier(0.22, 1, 0.36, 1), background-color 150ms cubic-bezier(0.22, 1, 0.36, 1), border-color 150ms cubic-bezier(0.22, 1, 0.36, 1), color 150ms cubic-bezier(0.22, 1, 0.36, 1)";
37
+ readonly color: "background-color 150ms cubic-bezier(0.22, 1, 0.36, 1), border-color 150ms cubic-bezier(0.22, 1, 0.36, 1), color 150ms cubic-bezier(0.22, 1, 0.36, 1)";
38
+ readonly popover: "opacity 150ms cubic-bezier(0.22, 1, 0.36, 1), transform 150ms cubic-bezier(0.22, 1, 0.36, 1)";
39
+ };
40
+ export declare const font: {
41
+ readonly ui: "\"Helvetica Neue\", sans-serif";
42
+ readonly mono: "\"IBM Plex Mono\", monospace";
43
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spicenet-io/spiceflow-ui",
3
- "version": "3.2.1",
3
+ "version": "3.2.2",
4
4
  "description": "Spiceflow UI SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",
@@ -22,11 +22,6 @@
22
22
  "import": "./dist/auth-dynamic.js",
23
23
  "require": "./dist/auth-dynamic.cjs.js"
24
24
  },
25
- "./auth/starknet": {
26
- "types": "./dist/auth-starknet.d.ts",
27
- "import": "./dist/auth-starknet.js",
28
- "require": "./dist/auth-starknet.cjs.js"
29
- },
30
25
  "./styles.css": "./dist/providers/custom.css"
31
26
  },
32
27
  "sideEffects": [
@@ -36,8 +31,6 @@
36
31
  "./dist/auth-privy.cjs.js",
37
32
  "./dist/auth-dynamic.js",
38
33
  "./dist/auth-dynamic.cjs.js",
39
- "./dist/auth-starknet.js",
40
- "./dist/auth-starknet.cjs.js",
41
34
  "./dist/providers/custom.css"
42
35
  ],
43
36
  "files": [
@@ -76,10 +69,8 @@
76
69
  "@privy-io/react-auth": ">=2.24.0 <4.0.0",
77
70
  "@tanstack/react-query": ">=5.0.0",
78
71
  "axios": ">=1.0.0",
79
- "get-starknet-core": ">=4.0.0",
80
72
  "react": "^18.0.0",
81
73
  "react-dom": "^18.0.0",
82
- "starknet": ">=6.0.0",
83
74
  "viem": ">=2.21.0",
84
75
  "wagmi": ">=2.12.0"
85
76
  },
@@ -95,12 +86,6 @@
95
86
  },
96
87
  "@privy-io/react-auth": {
97
88
  "optional": true
98
- },
99
- "starknet": {
100
- "optional": true
101
- },
102
- "get-starknet-core": {
103
- "optional": true
104
89
  }
105
90
  },
106
91
  "devDependencies": {
@@ -126,7 +111,6 @@
126
111
  "eslint-config-prettier": "^10.1.8",
127
112
  "eslint-plugin-react": "^7.33.0",
128
113
  "eslint-plugin-react-hooks": "^4.6.0",
129
- "get-starknet-core": "^4.0.0",
130
114
  "husky": "^9.1.7",
131
115
  "jest": "^29.6.0",
132
116
  "lint-staged": "^16.2.5",
@@ -141,7 +125,6 @@
141
125
  "rollup-plugin-peer-deps-external": "^2.2.4",
142
126
  "rollup-plugin-postcss": "^4.0.2",
143
127
  "sharp": "^0.34.5",
144
- "starknet": "^9.4.2",
145
128
  "ts-node": "^10.9.2",
146
129
  "typescript": "^5.9.2",
147
130
  "viem": "2.33.1",