UNPKG

@edgex-web/components

Version:

EdgeX Universal UI Components Library - Reusable React components for deposit, withdraw and other common UI patterns

82 lines (81 loc) 2.53 kB
import { WithdrawConfig, ChainInfo } from '../../../types'; import { Account } from '../../shared/types'; export interface WithdrawResult { chainId: number; tokenAddress: string; amount: string; txHash?: string; } export interface WithdrawProps { isOpen: boolean; isLoading?: boolean; onClose: () => void; config: WithdrawConfig; children?: React.ReactNode; currentActiveAccount: Account; chains: ChainInfo[]; spotChains?: ChainInfo[]; defaultChainId?: number; defaultTokenAddress?: string; defaultAmount?: string; defaultAccountType?: 'perpetual' | 'spot'; balances?: { spot?: Record<string, string>; perpetual?: Record<string, string>; }; currentEquity?: number; platformBalance?: string; fee?: string; wagmiHooks?: { useBalance: any; useReadContract: any; useAccount: any; }; onWithdraw?: (withdrawInfo: { amount: string; chainId: number; coinId?: string; accountType: 'spot' | 'perpetual'; tokenAddress: string; tokenSymbol: string; receiverAddress?: string; }) => void; onChainChange?: (chainId: number) => void; onTokenChange?: (tokenSymbol: string) => void; onAmountChanged?: (amount: string) => void; } export interface OpenWithdrawOptions { config?: WithdrawConfig; currentActiveAccount: WithdrawProps['currentActiveAccount']; chains: ChainInfo[]; spotChains?: ChainInfo[]; defaultChainId?: number; defaultTokenAddress?: string; defaultAmount?: string; defaultAccountType?: 'perpetual' | 'spot'; balances?: { spot?: Record<string, string>; perpetual?: Record<string, string>; }; currentEquity?: number; platformBalance?: string; fee?: string; wagmiHooks?: WithdrawProps['wagmiHooks']; curSelectToken?: string; currentActiveChain?: any; withdrawAmount?: string; onWithdraw?: WithdrawProps['onWithdraw']; onChainChange?: (chainId: number) => void; onTokenChange?: (tokenSymbol: string) => void; onAmountChanged?: (amount: string) => void; onClose?: () => void; } export interface WithdrawAPI { openWithdraw: (options?: OpenWithdrawOptions) => void; closeWithdraw: () => void; updateWithdrawOptions: (options: Partial<OpenWithdrawOptions>) => void; setWithdrawLoading: (loading: boolean) => void; isOpen: () => boolean; isLoading: () => boolean; } //# sourceMappingURL=index.d.ts.map