@spicenet-io/spiceflow-ui 3.2.1 → 3.2.3
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/README.md +7 -7
- package/dist/Button-B1aDv3aK.js +2 -0
- package/dist/Button-Hm-OAnzQ.js +2 -0
- package/dist/auth-dynamic.cjs.js +1 -1
- package/dist/auth-dynamic.js +1 -1
- package/dist/auth-privy.cjs.js +1 -1
- package/dist/auth-privy.js +1 -1
- package/dist/components/AssetSelector/AssetDropdown.d.ts +1 -12
- package/dist/components/AssetSelector/ChainIcon.d.ts +1 -7
- package/dist/components/AssetSelector/TokenIcon.d.ts +1 -7
- package/dist/components/AssetSelector/index.d.ts +1 -3
- package/dist/components/ExportWallet/ExportWalletButton.d.ts +2 -7
- package/dist/components/ProviderLogins/DynamicLogin.d.ts +2 -8
- package/dist/components/ProviderLogins/PrivyLogin.d.ts +2 -8
- package/dist/components/ProviderLogins/ProviderLogin.d.ts +2 -8
- package/dist/components/SpiceDeposit/DepositRecoveryPrompt.d.ts +1 -14
- package/dist/components/SpiceDeposit/DepositStatusModal.d.ts +4 -37
- package/dist/components/SpiceDeposit/SelectTokenModal.d.ts +1 -16
- package/dist/components/SpiceDeposit/SpiceDeposit.d.ts +2 -35
- package/dist/components/SpiceLockModal/LockSubComponents.d.ts +2 -45
- package/dist/components/SpicePay/SpicePay.d.ts +2 -29
- package/dist/components/SpiceSupply/SupplyEstimate.d.ts +2 -13
- package/dist/components/SpiceWithdraw/SelectPopover.d.ts +2 -7
- package/dist/components/SpiceWithdraw/SpiceWithdraw.d.ts +2 -26
- package/dist/components/StatusDisplay/StatusIcon.d.ts +1 -7
- package/dist/components/StatusDisplay/StatusPanel.d.ts +2 -31
- package/dist/components/StatusDisplay/StepItem.d.ts +1 -8
- package/dist/components/StatusDisplay/index.d.ts +1 -2
- package/dist/components/index.d.ts +0 -2
- package/dist/components/ui/AddFundsLink.d.ts +3 -0
- package/dist/components/ui/Button.d.ts +1 -11
- package/dist/components/ui/CloseIcon.d.ts +1 -6
- package/dist/components/ui/DetailRow.d.ts +3 -0
- package/dist/components/ui/FeeBreakdownCard.d.ts +2 -11
- package/dist/components/ui/Input.d.ts +1 -10
- package/dist/components/ui/Modal.d.ts +1 -10
- package/dist/components/ui/SearchInput.d.ts +15 -0
- package/dist/components/ui/SpiceModalShell.d.ts +1 -17
- package/dist/components/ui/Spinner.d.ts +1 -6
- package/dist/components/ui/StatusBanner.d.ts +1 -10
- package/dist/components/ui/icons.d.ts +13 -0
- package/dist/components/ui/index.d.ts +7 -8
- package/dist/index.cjs.js +29 -40
- package/dist/index.d.ts +12 -12
- package/dist/index.js +31 -42
- package/dist/providerWallet-Ca-gOLIW.js +2 -0
- package/dist/providerWallet-uz6t-bDC.js +2 -0
- package/dist/providers/custom.css +1 -1
- package/dist/types/assets.d.ts +22 -0
- package/dist/types/authorization.d.ts +5 -2
- package/dist/types/deposit.d.ts +94 -27
- package/dist/types/index.d.ts +2 -0
- package/dist/types/lock.d.ts +44 -0
- package/dist/types/pay.d.ts +30 -0
- package/dist/types/status.d.ts +41 -1
- package/dist/types/supply.d.ts +15 -1
- package/dist/types/ui.d.ts +95 -0
- package/dist/types/wallet.d.ts +31 -0
- package/dist/types/withdraw.d.ts +30 -0
- package/dist/utils/abis/spicenet.d.ts +66 -0
- package/dist/utils/loadFonts.d.ts +1 -0
- package/dist/utils/rebalancing/index.d.ts +70 -0
- package/dist/utils/relayer/index.d.ts +5 -20
- package/dist/utils/tokenResolution.d.ts +1 -1
- package/dist/utils/tokens.d.ts +43 -0
- package/package.json +46 -63
- package/dist/Button-D5zwqrrP.js +0 -2
- package/dist/Button-KtHGKIo6.js +0 -2
- package/dist/auth-starknet.cjs.js +0 -2
- package/dist/auth-starknet.d.ts +0 -6
- package/dist/auth-starknet.js +0 -2
- package/dist/components/Airdrop/Airdrop.d.ts +0 -28
- package/dist/components/Airdrop/index.d.ts +0 -2
- package/dist/components/DepositWidget/AssetInput.d.ts +0 -23
- package/dist/components/DepositWidget/CrossChainDepositModal.d.ts +0 -42
- package/dist/components/DepositWidget/DepositWidget.d.ts +0 -3
- package/dist/components/DepositWidget/DepositWidgetModal.d.ts +0 -11
- package/dist/components/DepositWidget/index.d.ts +0 -8
- package/dist/components/LpModal/AmountCard.d.ts +0 -11
- package/dist/components/LpModal/CompactAssetSelector.d.ts +0 -11
- package/dist/components/LpModal/LpModal.d.ts +0 -3
- package/dist/components/LpModal/PairInfoCard.d.ts +0 -14
- package/dist/components/LpModal/ProgressIndicators.d.ts +0 -4
- package/dist/components/LpModal/index.d.ts +0 -1
- package/dist/components/StarknetWallet/StarknetWalletButton.d.ts +0 -9
- package/dist/components/StarknetWallet/index.d.ts +0 -2
- package/dist/components/ui/Toast.d.ts +0 -10
- package/dist/hooks/useStarknetWallet.d.ts +0 -13
- package/dist/index-DJQ17ocQ.js +0 -2
- package/dist/index-WLbJouQ7.js +0 -2
- package/dist/providerWallet-DeNDXTJA.js +0 -2
- package/dist/providerWallet-DrwSLBof.js +0 -2
- package/dist/providers/StarknetWalletProvider.d.ts +0 -8
- package/dist/types/lp.d.ts +0 -43
- package/dist/useSpiceBrand-BBtUTOno.js +0 -2
- package/dist/useSpiceBrand-D-06ludX.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";const o=require("viem"),c=require("./Button-Hm-OAnzQ.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;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{createWalletClient as l,custom as d}from"viem";import{g as c}from"./Button-B1aDv3aK.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
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}
|
package/dist/types/assets.d.ts
CHANGED
|
@@ -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
|
|
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;
|
package/dist/types/deposit.d.ts
CHANGED
|
@@ -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,
|
|
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
|
+
}
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/lock.d.ts
CHANGED
|
@@ -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
|
+
}
|
package/dist/types/status.d.ts
CHANGED
|
@@ -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
|
+
}
|
package/dist/types/supply.d.ts
CHANGED
|
@@ -38,7 +38,8 @@ export interface SpiceSupplyProps {
|
|
|
38
38
|
deliveryToken: Address;
|
|
39
39
|
deliveryAmount: bigint;
|
|
40
40
|
deliveryRecipient: Address;
|
|
41
|
-
|
|
41
|
+
sourceAsset?: Asset;
|
|
42
|
+
}) => ChainBatch | null | Promise<ChainBatch | null>;
|
|
42
43
|
onPayExecute?: (ctx: PayExecuteContext) => Promise<string | void>;
|
|
43
44
|
actionLabel: string;
|
|
44
45
|
amountDirection?: "input" | "output";
|
|
@@ -59,3 +60,16 @@ export interface SpiceSupplyProps {
|
|
|
59
60
|
onSuccess?: (txHash: string) => void;
|
|
60
61
|
onError?: (error: Error) => void;
|
|
61
62
|
}
|
|
63
|
+
export interface SupplyEstimateProps {
|
|
64
|
+
isQuoting: boolean;
|
|
65
|
+
quoteError: string | null;
|
|
66
|
+
estimatedOutput: string | null;
|
|
67
|
+
destinationSymbol: string;
|
|
68
|
+
destinationLogoURI?: string;
|
|
69
|
+
textPrimary: string;
|
|
70
|
+
textSecondary: string;
|
|
71
|
+
cardBg: string;
|
|
72
|
+
cardBorder: string;
|
|
73
|
+
fontFamily: string;
|
|
74
|
+
primaryColor: string;
|
|
75
|
+
}
|
|
@@ -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
|
+
};
|
package/dist/types/wallet.d.ts
CHANGED
|
@@ -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
|
+
}
|
package/dist/types/withdraw.d.ts
CHANGED
|
@@ -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;
|
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
export declare const spicenetAbi: readonly [{
|
|
2
|
+
readonly type: "function";
|
|
3
|
+
readonly name: "closeRebalancingRequest";
|
|
4
|
+
readonly inputs: readonly [{
|
|
5
|
+
readonly name: "args";
|
|
6
|
+
readonly type: "tuple";
|
|
7
|
+
readonly internalType: "struct Spicenet.CloseRebalancingRequestArgs";
|
|
8
|
+
readonly components: readonly [{
|
|
9
|
+
readonly name: "idempotenceKey";
|
|
10
|
+
readonly type: "bytes32";
|
|
11
|
+
readonly internalType: "bytes32";
|
|
12
|
+
}, {
|
|
13
|
+
readonly name: "repaymentChainTokenAmount";
|
|
14
|
+
readonly type: "uint256";
|
|
15
|
+
readonly internalType: "uint256";
|
|
16
|
+
}];
|
|
17
|
+
}];
|
|
18
|
+
readonly outputs: readonly [];
|
|
19
|
+
readonly stateMutability: "nonpayable";
|
|
20
|
+
}, {
|
|
2
21
|
readonly type: "function";
|
|
3
22
|
readonly name: "createWithdrawalRequest";
|
|
4
23
|
readonly inputs: readonly [{
|
|
@@ -46,4 +65,51 @@ export declare const spicenetAbi: readonly [{
|
|
|
46
65
|
}];
|
|
47
66
|
readonly outputs: readonly [];
|
|
48
67
|
readonly stateMutability: "nonpayable";
|
|
68
|
+
}, {
|
|
69
|
+
readonly type: "function";
|
|
70
|
+
readonly name: "createRebalancingRequest";
|
|
71
|
+
readonly inputs: readonly [{
|
|
72
|
+
readonly name: "request";
|
|
73
|
+
readonly type: "tuple";
|
|
74
|
+
readonly internalType: "struct Spicenet.CreateRebalancingRequestArgs";
|
|
75
|
+
readonly components: readonly [{
|
|
76
|
+
readonly name: "idempotenceKey";
|
|
77
|
+
readonly type: "bytes32";
|
|
78
|
+
readonly internalType: "bytes32";
|
|
79
|
+
}, {
|
|
80
|
+
readonly name: "nbf";
|
|
81
|
+
readonly type: "uint256";
|
|
82
|
+
readonly internalType: "uint256";
|
|
83
|
+
}, {
|
|
84
|
+
readonly name: "exp";
|
|
85
|
+
readonly type: "uint256";
|
|
86
|
+
readonly internalType: "uint256";
|
|
87
|
+
}, {
|
|
88
|
+
readonly name: "metadata";
|
|
89
|
+
readonly type: "string";
|
|
90
|
+
readonly internalType: "string";
|
|
91
|
+
}, {
|
|
92
|
+
readonly name: "recipient";
|
|
93
|
+
readonly type: "string";
|
|
94
|
+
readonly internalType: "string";
|
|
95
|
+
}, {
|
|
96
|
+
readonly name: "fromChainToken";
|
|
97
|
+
readonly type: "string";
|
|
98
|
+
readonly internalType: "string";
|
|
99
|
+
}, {
|
|
100
|
+
readonly name: "fromChainTokenAmount";
|
|
101
|
+
readonly type: "uint256";
|
|
102
|
+
readonly internalType: "uint256";
|
|
103
|
+
}, {
|
|
104
|
+
readonly name: "toChainToken";
|
|
105
|
+
readonly type: "string";
|
|
106
|
+
readonly internalType: "string";
|
|
107
|
+
}, {
|
|
108
|
+
readonly name: "toChainTokenAmountMin";
|
|
109
|
+
readonly type: "uint256";
|
|
110
|
+
readonly internalType: "uint256";
|
|
111
|
+
}];
|
|
112
|
+
}];
|
|
113
|
+
readonly outputs: readonly [];
|
|
114
|
+
readonly stateMutability: "nonpayable";
|
|
49
115
|
}];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function injectFontStylesheet(): void;
|