@edgex-web/components 0.1.0-beta.5 → 0.1.0-beta.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ccip-DsdBVVHB.mjs +150 -0
- package/dist/ccip-DsdBVVHB.mjs.map +1 -0
- package/dist/components/Deposit/index.d.ts +1 -10
- package/dist/components/Deposit/index.d.ts.map +1 -1
- package/dist/components/Deposit/src/DepositManager.d.ts +2 -0
- package/dist/components/Deposit/src/DepositManager.d.ts.map +1 -1
- package/dist/components/Deposit/src/components/evm/hooks/index.d.ts +3 -0
- package/dist/components/Deposit/src/components/evm/hooks/index.d.ts.map +1 -0
- package/dist/components/Deposit/src/components/evm/hooks/useApprove.d.ts +4 -0
- package/dist/components/Deposit/src/components/evm/hooks/useApprove.d.ts.map +1 -0
- package/dist/components/Deposit/src/components/evm/hooks/useDepositButtonState.d.ts +14 -0
- package/dist/components/Deposit/src/components/evm/hooks/useDepositButtonState.d.ts.map +1 -0
- package/dist/components/Deposit/src/components/evm/index.d.ts +6 -0
- package/dist/components/Deposit/src/components/evm/index.d.ts.map +1 -0
- package/dist/components/Deposit/src/components/evm/types/approve.d.ts +15 -0
- package/dist/components/Deposit/src/components/evm/types/approve.d.ts.map +1 -0
- package/dist/components/Deposit/src/components/evm/types/index.d.ts +15 -0
- package/dist/components/Deposit/src/components/evm/types/index.d.ts.map +1 -0
- package/dist/components/Deposit/src/components/evm/utils/format.d.ts +12 -0
- package/dist/components/Deposit/src/components/evm/utils/format.d.ts.map +1 -0
- package/dist/components/Deposit/src/components/evm/utils/index.d.ts +8 -0
- package/dist/components/Deposit/src/components/evm/utils/index.d.ts.map +1 -0
- package/dist/components/Deposit/src/components/mpc/index.d.ts +6 -0
- package/dist/components/Deposit/src/components/mpc/index.d.ts.map +1 -0
- package/dist/components/Deposit/src/components/mpc/types/index.d.ts +16 -0
- package/dist/components/Deposit/src/components/mpc/types/index.d.ts.map +1 -0
- package/dist/components/Deposit/src/constants/index.d.ts +4 -0
- package/dist/components/Deposit/src/constants/index.d.ts.map +1 -0
- package/dist/components/Deposit/src/hooks/useErc20BalanceOfWatcher.d.ts +14 -0
- package/dist/components/Deposit/src/hooks/useErc20BalanceOfWatcher.d.ts.map +1 -0
- package/dist/components/Deposit/src/hooks/useMulticallBalance.d.ts +68 -0
- package/dist/components/Deposit/src/hooks/useMulticallBalance.d.ts.map +1 -0
- package/dist/components/Deposit/src/index.d.ts +2 -2
- package/dist/components/Deposit/src/index.d.ts.map +1 -1
- package/dist/components/Deposit/src/utils.d.ts +57 -36
- package/dist/components/Deposit/src/utils.d.ts.map +1 -1
- package/dist/components/Deposit/types/index.d.ts +35 -34
- package/dist/components/Deposit/types/index.d.ts.map +1 -1
- package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +19 -0
- package/dist/components/LoadingSpinner/LoadingSpinner.d.ts.map +1 -0
- package/dist/components/LoadingSpinner/index.d.ts +4 -0
- package/dist/components/LoadingSpinner/index.d.ts.map +1 -0
- package/dist/components/Provider/index.d.ts +6 -1
- package/dist/components/Provider/index.d.ts.map +1 -1
- package/dist/components/Tabs/index.d.ts +6 -0
- package/dist/components/Tabs/index.d.ts.map +1 -0
- package/dist/components/Tabs/src/Tab.d.ts +5 -0
- package/dist/components/Tabs/src/Tab.d.ts.map +1 -0
- package/dist/components/Tabs/src/Tabs.d.ts +5 -0
- package/dist/components/Tabs/src/Tabs.d.ts.map +1 -0
- package/dist/components/Tabs/src/TabsList.d.ts +5 -0
- package/dist/components/Tabs/src/TabsList.d.ts.map +1 -0
- package/dist/components/Tabs/src/TabsPanel.d.ts +5 -0
- package/dist/components/Tabs/src/TabsPanel.d.ts.map +1 -0
- package/dist/components/Tabs/src/context.d.ts +16 -0
- package/dist/components/Tabs/src/context.d.ts.map +1 -0
- package/dist/components/Tabs/src/index.d.ts +6 -0
- package/dist/components/Tabs/src/index.d.ts.map +1 -0
- package/dist/components/Tabs/types/index.d.ts +28 -0
- package/dist/components/Tabs/types/index.d.ts.map +1 -0
- package/dist/components/Tooltip/index.d.ts +3 -0
- package/dist/components/Tooltip/index.d.ts.map +1 -0
- package/dist/components/Tooltip/src/Tooltip.d.ts +5 -0
- package/dist/components/Tooltip/src/Tooltip.d.ts.map +1 -0
- package/dist/components/Tooltip/src/TooltipArrow.d.ts +5 -0
- package/dist/components/Tooltip/src/TooltipArrow.d.ts.map +1 -0
- package/dist/components/Tooltip/src/index.d.ts +3 -0
- package/dist/components/Tooltip/src/index.d.ts.map +1 -0
- package/dist/components/Tooltip/types/index.d.ts +52 -0
- package/dist/components/Tooltip/types/index.d.ts.map +1 -0
- package/dist/components/Withdraw/constants/index.d.ts +7 -0
- package/dist/components/Withdraw/constants/index.d.ts.map +1 -0
- package/dist/components/Withdraw/index.d.ts +6 -10
- package/dist/components/Withdraw/index.d.ts.map +1 -1
- package/dist/components/Withdraw/src/Speed.d.ts +10 -0
- package/dist/components/Withdraw/src/Speed.d.ts.map +1 -0
- package/dist/components/Withdraw/src/WithdrawManager.d.ts +12 -0
- package/dist/components/Withdraw/src/WithdrawManager.d.ts.map +1 -0
- package/dist/components/Withdraw/src/constants.d.ts +24 -0
- package/dist/components/Withdraw/src/constants.d.ts.map +1 -0
- package/dist/components/Withdraw/src/evm/WalletView.d.ts +25 -0
- package/dist/components/Withdraw/src/evm/WalletView.d.ts.map +1 -0
- package/dist/components/Withdraw/src/evm/index.d.ts +35 -0
- package/dist/components/Withdraw/src/evm/index.d.ts.map +1 -0
- package/dist/components/Withdraw/src/index.d.ts +5 -0
- package/dist/components/Withdraw/src/index.d.ts.map +1 -0
- package/dist/components/Withdraw/types/index.d.ts +74 -0
- package/dist/components/Withdraw/types/index.d.ts.map +1 -0
- package/dist/components/shared/components/SpeedLevel/ActiveSpeed.d.ts +5 -0
- package/dist/components/shared/components/SpeedLevel/ActiveSpeed.d.ts.map +1 -0
- package/dist/components/shared/components/SpeedLevel/InactiveSpeed.d.ts +5 -0
- package/dist/components/shared/components/SpeedLevel/InactiveSpeed.d.ts.map +1 -0
- package/dist/components/shared/components/SpeedLevel/index.d.ts +6 -0
- package/dist/components/shared/components/SpeedLevel/index.d.ts.map +1 -0
- package/dist/components/shared/components/SpeedLevel/types/index.d.ts +6 -0
- package/dist/components/shared/components/SpeedLevel/types/index.d.ts.map +1 -0
- package/dist/components/shared/components/selector/AssetTabs.d.ts +5 -0
- package/dist/components/shared/components/selector/AssetTabs.d.ts.map +1 -0
- package/dist/components/shared/components/selector/Chain.d.ts +5 -0
- package/dist/components/shared/components/selector/Chain.d.ts.map +1 -0
- package/dist/components/shared/components/selector/index.d.ts +5 -0
- package/dist/components/shared/components/selector/index.d.ts.map +1 -0
- package/dist/components/shared/components/selector/types/index.d.ts +38 -0
- package/dist/components/shared/components/selector/types/index.d.ts.map +1 -0
- package/dist/components/shared/constants/index.d.ts +3 -0
- package/dist/components/shared/constants/index.d.ts.map +1 -0
- package/dist/components/shared/hooks/index.d.ts +1 -0
- package/dist/components/shared/hooks/index.d.ts.map +1 -0
- package/dist/components/shared/types/index.d.ts +10 -0
- package/dist/components/shared/types/index.d.ts.map +1 -0
- package/dist/components/shared/utils/index.d.ts +23 -0
- package/dist/components/shared/utils/index.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/usePoolBalance.d.ts +19 -0
- package/dist/hooks/usePoolBalance.d.ts.map +1 -0
- package/dist/hooks/useTranslation.d.ts +147 -0
- package/dist/hooks/useTranslation.d.ts.map +1 -0
- package/dist/index-Cz4ArvXu.mjs +20228 -0
- package/dist/index-Cz4ArvXu.mjs.map +1 -0
- package/dist/index.d.ts +10 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +30 -6970
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +84 -55
- package/dist/index.umd.js.map +1 -1
- package/dist/locales/en-US.d.ts +56 -0
- package/dist/locales/en-US.d.ts.map +1 -0
- package/dist/locales/index.d.ts +16 -0
- package/dist/locales/index.d.ts.map +1 -0
- package/dist/locales/ja-JP.d.ts +56 -0
- package/dist/locales/ja-JP.d.ts.map +1 -0
- package/dist/locales/ru-RU.d.ts +56 -0
- package/dist/locales/ru-RU.d.ts.map +1 -0
- package/dist/locales/zh-CN.d.ts +57 -0
- package/dist/locales/zh-CN.d.ts.map +1 -0
- package/dist/locales/zh-TW.d.ts +56 -0
- package/dist/locales/zh-TW.d.ts.map +1 -0
- package/dist/style.css +1 -0
- package/dist/types/index.d.ts +12 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/index.d.ts +14 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/package.json +14 -5
- package/dist/components/Deposit/src/Deposit.d.ts +0 -15
- package/dist/components/Deposit/src/Deposit.d.ts.map +0 -1
- package/dist/components/Deposit/src/WalletProvider.d.ts +0 -23
- package/dist/components/Deposit/src/WalletProvider.d.ts.map +0 -1
- package/dist/components/Deposit/src/components.d.ts +0 -89
- package/dist/components/Deposit/src/components.d.ts.map +0 -1
- package/dist/components/Deposit/src/evm/WalletView.d.ts +0 -17
- package/dist/components/Deposit/src/evm/WalletView.d.ts.map +0 -1
- package/dist/components/Deposit/src/evm/index.d.ts +0 -18
- package/dist/components/Deposit/src/evm/index.d.ts.map +0 -1
- package/dist/components/Deposit/src/mpc/WalletView.d.ts +0 -12
- package/dist/components/Deposit/src/mpc/WalletView.d.ts.map +0 -1
- package/dist/components/Deposit/src/mpc/index.d.ts +0 -18
- package/dist/components/Deposit/src/mpc/index.d.ts.map +0 -1
- package/dist/components/Deposit/src/selector/Asset.d.ts +0 -19
- package/dist/components/Deposit/src/selector/Asset.d.ts.map +0 -1
- package/dist/components/Deposit/src/selector/Chain.d.ts +0 -15
- package/dist/components/Deposit/src/selector/Chain.d.ts.map +0 -1
- package/dist/components/Deposit/src/selector/index.d.ts +0 -13
- package/dist/components/Deposit/src/selector/index.d.ts.map +0 -1
- package/dist/components/Deposit/src/walletAdapters.d.ts +0 -67
- package/dist/components/Deposit/src/walletAdapters.d.ts.map +0 -1
- package/dist/components/Deposit/types/wallet-hooks.d.ts +0 -78
- package/dist/components/Deposit/types/wallet-hooks.d.ts.map +0 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { WithdrawConfig, ChainInfo } from '../../../types';
|
|
2
|
+
import { Account } from '../../shared/types';
|
|
3
|
+
|
|
4
|
+
export interface WithdrawResult {
|
|
5
|
+
chainId: number;
|
|
6
|
+
tokenAddress: string;
|
|
7
|
+
amount: string;
|
|
8
|
+
txHash?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface WithdrawProps {
|
|
11
|
+
isOpen: boolean;
|
|
12
|
+
isLoading?: boolean;
|
|
13
|
+
onClose: () => void;
|
|
14
|
+
config: WithdrawConfig;
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
currentActiveAccount: Account;
|
|
17
|
+
chains: ChainInfo[];
|
|
18
|
+
defaultChainId?: number;
|
|
19
|
+
defaultTokenAddress?: string;
|
|
20
|
+
defaultAmount?: string;
|
|
21
|
+
metadata?: {
|
|
22
|
+
multiChain?: {
|
|
23
|
+
minWithdraw: number;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
currentEquity?: number;
|
|
27
|
+
platformBalance?: string;
|
|
28
|
+
fee?: string;
|
|
29
|
+
wagmiHooks?: {
|
|
30
|
+
useBalance: any;
|
|
31
|
+
useReadContract: any;
|
|
32
|
+
useAccount: any;
|
|
33
|
+
};
|
|
34
|
+
onWithdraw?: (withdrawInfo: {
|
|
35
|
+
amount: string;
|
|
36
|
+
chainId: number;
|
|
37
|
+
tokenAddress: string;
|
|
38
|
+
tokenSymbol: string;
|
|
39
|
+
receiverAddress?: string;
|
|
40
|
+
}) => void;
|
|
41
|
+
onChainChange?: (chainId: number) => void;
|
|
42
|
+
onTokenChange?: (tokenSymbol: string) => void;
|
|
43
|
+
onAmountChanged?: (amount: string) => void;
|
|
44
|
+
}
|
|
45
|
+
export interface OpenWithdrawOptions {
|
|
46
|
+
config?: WithdrawConfig;
|
|
47
|
+
currentActiveAccount: WithdrawProps['currentActiveAccount'];
|
|
48
|
+
chains: ChainInfo[];
|
|
49
|
+
defaultChainId?: number;
|
|
50
|
+
defaultTokenAddress?: string;
|
|
51
|
+
defaultAmount?: string;
|
|
52
|
+
metadata?: WithdrawProps['metadata'];
|
|
53
|
+
currentEquity?: number;
|
|
54
|
+
platformBalance?: string;
|
|
55
|
+
fee?: string;
|
|
56
|
+
wagmiHooks?: WithdrawProps['wagmiHooks'];
|
|
57
|
+
curSelectToken?: string;
|
|
58
|
+
currentActiveChain?: any;
|
|
59
|
+
withdrawAmount?: string;
|
|
60
|
+
onWithdraw?: WithdrawProps['onWithdraw'];
|
|
61
|
+
onChainChange?: (chainId: number) => void;
|
|
62
|
+
onTokenChange?: (tokenSymbol: string) => void;
|
|
63
|
+
onAmountChanged?: (amount: string) => void;
|
|
64
|
+
onClose?: () => void;
|
|
65
|
+
}
|
|
66
|
+
export interface WithdrawAPI {
|
|
67
|
+
openWithdraw: (options?: OpenWithdrawOptions) => void;
|
|
68
|
+
closeWithdraw: () => void;
|
|
69
|
+
updateWithdrawOptions: (options: Partial<OpenWithdrawOptions>) => void;
|
|
70
|
+
setWithdrawLoading: (loading: boolean) => void;
|
|
71
|
+
isOpen: () => boolean;
|
|
72
|
+
isLoading: () => boolean;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Withdraw/types/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAGnD,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM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|
|
1
|
+
{"version":3,"file":"ActiveSpeed.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/components/SpeedLevel/ActiveSpeed.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAE1B,QAAA,MAAM,eAAe,EAAE,EA2BtB,CAAA;AAED,eAAe,eAAe,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InactiveSpeed.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/components/SpeedLevel/InactiveSpeed.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAE1B,QAAA,MAAM,iBAAiB,EAAE,EA2BxB,CAAA;AAED,eAAe,iBAAiB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/components/SpeedLevel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAK1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAE5C,QAAA,MAAM,UAAU,EAAE,EAAE,CAAC,kBAAkB,CAoBtC,CAAA;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/shared/components/SpeedLevel/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AssetTabs.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/components/selector/AssetTabs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAA;AAE9E,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CA0BxC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chain.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/components/selector/Chain.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,EAAE,EAAE,MAAM,OAAO,CAAA;AAUpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAE5C,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CA8LhD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/components/selector/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAmC,MAAM,OAAO,CAAA;AAI3D,OAAO,EACL,aAAa,EAEd,MAAM,+CAA+C,CAAA;AAOtD,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CA4MtC,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ChainInfo } from '../../../../../types';
|
|
2
|
+
import { WalletType } from '../../../types';
|
|
3
|
+
|
|
4
|
+
/******************** Asset *********************/
|
|
5
|
+
export interface Asset {
|
|
6
|
+
token: string;
|
|
7
|
+
iconUrl?: string;
|
|
8
|
+
decimals: number;
|
|
9
|
+
tokenAddress: string;
|
|
10
|
+
symbol?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface AssetTabsProps {
|
|
13
|
+
tokens: Asset[];
|
|
14
|
+
selectedToken: Asset;
|
|
15
|
+
onTokenChange: (token: Asset) => void;
|
|
16
|
+
}
|
|
17
|
+
/******************** Chain *********************/
|
|
18
|
+
export interface ChainSelectorProps {
|
|
19
|
+
chains: ChainInfo[];
|
|
20
|
+
selectedChain: ChainInfo;
|
|
21
|
+
onChainChange: (chain: ChainInfo) => void;
|
|
22
|
+
chainPoolBalances?: Record<number, string>;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
className?: string;
|
|
25
|
+
walletType?: WalletType;
|
|
26
|
+
}
|
|
27
|
+
/******************** SelectorProps *********************/
|
|
28
|
+
export interface SelectorProps {
|
|
29
|
+
currentActiveChain: ChainInfo;
|
|
30
|
+
chainList: ChainInfo[];
|
|
31
|
+
onChainChange: (chainId: number) => void;
|
|
32
|
+
curSelectToken: string;
|
|
33
|
+
onTokenChange: (token: string) => void;
|
|
34
|
+
walletType?: WalletType;
|
|
35
|
+
chainPoolBalances?: Record<number, string>;
|
|
36
|
+
txType?: string;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/shared/components/selector/types/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAEtD,kDAAkD;AAClD,MAAM,WAAW,KAAK;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,aAAa,EAAE,KAAK,CAAA;IACpB,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;CACtC;AAED,kDAAkD;AAClD,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,SAAS,EAAE,CAAA;IACnB,aAAa,EAAE,SAAS,CAAA;IACxB,aAAa,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAA;IACzC,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,UAAU,CAAA;CACxB;AAED,0DAA0D;AAC1D,MAAM,WAAW,aAAa;IAC5B,kBAAkB,EAAE,SAAS,CAAA;IAC7B,SAAS,EAAE,SAAS,EAAE,CAAA;IACtB,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAExC,cAAc,EAAE,MAAM,CAAA;IACtB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAEtC,UAAU,CAAC,EAAE,UAAU,CAAA;IAEvB,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAE1C,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/constants/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,GAAG,EAAG,KAAc,CAAA;AAEjC,eAAO,MAAM,GAAG,EAAG,KAAc,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/hooks/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MPC, EVM } from '../constants';
|
|
2
|
+
|
|
3
|
+
export type WalletType = typeof MPC | typeof EVM;
|
|
4
|
+
export interface Account {
|
|
5
|
+
wallet: WalletType;
|
|
6
|
+
ethAddress: string;
|
|
7
|
+
accountId: string;
|
|
8
|
+
smartWalletAddress: string;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AAExD,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,GAAG,OAAO,GAAG,CAAA;AAEhD,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,UAAU,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,kBAAkB,EAAE,MAAM,CAAA;CAC3B"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { WalletType, Account } from '../types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Normalize an incoming wallet type to the canonical constant (MPC or EVM).
|
|
5
|
+
* Case-insensitive by design: adjust the normalization to match constants' casing.
|
|
6
|
+
* If constants MPC/EVM are lowercase, prefer `wallet.toLowerCase()` here.
|
|
7
|
+
* @param wallet WalletType value to normalize
|
|
8
|
+
* @returns WalletType - canonical constant (MPC or EVM)
|
|
9
|
+
*/
|
|
10
|
+
export declare const getWalletType: (wallet: WalletType) => WalletType;
|
|
11
|
+
/**
|
|
12
|
+
* Convenience predicate: whether the given account is an MPC wallet
|
|
13
|
+
* @param account Account
|
|
14
|
+
* @returns boolean
|
|
15
|
+
*/
|
|
16
|
+
export declare const isMpcWalletType: (account: Account) => boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Convenience predicate: whether the given account is an EVM wallet
|
|
19
|
+
* @param account Account
|
|
20
|
+
* @returns boolean
|
|
21
|
+
*/
|
|
22
|
+
export declare const isEvmWalletType: (account: Account) => boolean;
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/utils/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAI/D;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,UAAU,KAAG,UAElD,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,SAAS,OAAO,YAE/C,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,SAAS,OAAO,YAE/C,CAAA"}
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { DepositConfig, WithdrawConfig } from '../types';
|
|
2
2
|
|
|
3
|
+
export { useTranslation, useTranslationWithLocale } from './useTranslation';
|
|
3
4
|
export declare const useDeposit: () => {
|
|
4
5
|
openDeposit: (config: DepositConfig) => void;
|
|
5
6
|
};
|
|
6
7
|
export declare const useWithdraw: () => {
|
|
7
8
|
openWithdraw: (config: WithdrawConfig) => void;
|
|
8
9
|
};
|
|
10
|
+
export * from './usePoolBalance';
|
|
9
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAGvD,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;AAS3E,eAAO,MAAM,UAAU;0BACoB,aAAa;CAKvD,CAAA;AAED,eAAO,MAAM,WAAW;2BACoB,cAAc;CAKzD,CAAA;AAED,cAAc,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface UsePoolBalanceParams {
|
|
2
|
+
bscRpcUrl?: string;
|
|
3
|
+
arbitrumRpcUrl?: string;
|
|
4
|
+
pollingInterval?: number;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* usePoolBalance
|
|
8
|
+
* Reads pool balances for:
|
|
9
|
+
* - BNB_USDT (USDT on BSC, holder = BSC_POOL)
|
|
10
|
+
* - ARB_USDT (USDT on Arbitrum, holder = ARB_POOL_USDT)
|
|
11
|
+
* - ARB_USDC (USDC on Arbitrum, holder = ARB_POOL_USDC)
|
|
12
|
+
* Returns formatted strings; defaults to '0' if not available yet.
|
|
13
|
+
*/
|
|
14
|
+
export declare function usePoolBalance(params?: UsePoolBalanceParams): {
|
|
15
|
+
BNB_USDT_BALANCE: string;
|
|
16
|
+
ARB_USDT_BALANCE: string;
|
|
17
|
+
ARB_USDC_BALANCE: string;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=usePoolBalance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePoolBalance.d.ts","sourceRoot":"","sources":["../../src/hooks/usePoolBalance.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,oBAAoB;IACnC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AAaD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,MAAM,GAAE,oBAAyB;;;;EAuE/D"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 多语言翻译 Hook
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```tsx
|
|
6
|
+
* const { t, locale } = useTranslation()
|
|
7
|
+
*
|
|
8
|
+
* // 基础用法
|
|
9
|
+
* const title = t('deposit.title') // "充值" 或 "Deposit"
|
|
10
|
+
*
|
|
11
|
+
* // 参数化翻译(字符串参数)
|
|
12
|
+
* const enableText = t('deposit.enableSystemProWithToken', {
|
|
13
|
+
* token: 'USDT',
|
|
14
|
+
* network: 'Ethereum'
|
|
15
|
+
* }) // "Enable USDT on Ethereum" 或 "在Ethereum上启用USDT"
|
|
16
|
+
*
|
|
17
|
+
* // 参数化翻译(数字参数)
|
|
18
|
+
* const arrivalText = t('deposit.arrivaltimeTooltip1', {
|
|
19
|
+
* v: 10, // 数字会自动转换为字符串
|
|
20
|
+
* v1: 12
|
|
21
|
+
* }) // "您可以在约 10 分钟 (达到 12 个区块确认后) 提走已到账的资金"
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare const useTranslation: () => {
|
|
25
|
+
t: (key: string, params?: Record<string, string | number>) => string;
|
|
26
|
+
translations: {
|
|
27
|
+
deposit: {
|
|
28
|
+
title: string;
|
|
29
|
+
chain: string;
|
|
30
|
+
asset: string;
|
|
31
|
+
amount: string;
|
|
32
|
+
available: string;
|
|
33
|
+
equity: string;
|
|
34
|
+
confirmDeposit: string;
|
|
35
|
+
switchNetwork: string;
|
|
36
|
+
max: string;
|
|
37
|
+
arrivalTime: string;
|
|
38
|
+
minDeposit: string;
|
|
39
|
+
minDepositParsed: string;
|
|
40
|
+
maxDeposit: string;
|
|
41
|
+
depositTipFor25w: string;
|
|
42
|
+
depositAllTip: string;
|
|
43
|
+
enableSystemProWithToken: string;
|
|
44
|
+
enableTokenDesc: string;
|
|
45
|
+
enableWithToken: string;
|
|
46
|
+
arrivaltimeTooltip1: string;
|
|
47
|
+
arrivaltimeTooltip2: string;
|
|
48
|
+
arrivalEstimated: string;
|
|
49
|
+
availableDesc: string;
|
|
50
|
+
noPrivateKeyWalletWarning: string;
|
|
51
|
+
layerZeroDepositTip: string;
|
|
52
|
+
layerZeroDepositTipExceedPool: string;
|
|
53
|
+
layerZeroDepositTipGte200k: string;
|
|
54
|
+
layerZeroDepositButton: string;
|
|
55
|
+
};
|
|
56
|
+
withdraw: {
|
|
57
|
+
noticeDesc: string;
|
|
58
|
+
crossChainTips: string;
|
|
59
|
+
commonWithdraw: string;
|
|
60
|
+
withdraw: string;
|
|
61
|
+
speed: string;
|
|
62
|
+
confirmWithdraw: string;
|
|
63
|
+
speedNote: string;
|
|
64
|
+
speedNoteSpeed1: string;
|
|
65
|
+
speedNoteSpeed2: string;
|
|
66
|
+
speedNoteSpeed3: string;
|
|
67
|
+
receiverAddress: string;
|
|
68
|
+
fee: string;
|
|
69
|
+
feeRate: string;
|
|
70
|
+
withdrawlAmount: string;
|
|
71
|
+
amountToReceive: string;
|
|
72
|
+
invalidReceiverAddress: string;
|
|
73
|
+
availableDesc: string;
|
|
74
|
+
feeCalculationTip: string;
|
|
75
|
+
crossChainPoolBalance: string;
|
|
76
|
+
poolBalance: string;
|
|
77
|
+
poolBalanceInsufficientTip: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
locale: "en-US" | "ja-JP" | "ru-RU" | "zh-CN" | "zh-TW";
|
|
81
|
+
getTranslationObject: (key: string) => Record<string, any>;
|
|
82
|
+
hasTranslation: (key: string) => boolean;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* 用于局部覆盖语言的 Hook
|
|
86
|
+
* @param localLocale - 局部语言设置
|
|
87
|
+
*/
|
|
88
|
+
export declare const useTranslationWithLocale: (localLocale?: string) => {
|
|
89
|
+
t: (key: string, params?: Record<string, string | number>) => string;
|
|
90
|
+
translations: {
|
|
91
|
+
deposit: {
|
|
92
|
+
title: string;
|
|
93
|
+
chain: string;
|
|
94
|
+
asset: string;
|
|
95
|
+
amount: string;
|
|
96
|
+
available: string;
|
|
97
|
+
equity: string;
|
|
98
|
+
confirmDeposit: string;
|
|
99
|
+
switchNetwork: string;
|
|
100
|
+
max: string;
|
|
101
|
+
arrivalTime: string;
|
|
102
|
+
minDeposit: string;
|
|
103
|
+
minDepositParsed: string;
|
|
104
|
+
maxDeposit: string;
|
|
105
|
+
depositTipFor25w: string;
|
|
106
|
+
depositAllTip: string;
|
|
107
|
+
enableSystemProWithToken: string;
|
|
108
|
+
enableTokenDesc: string;
|
|
109
|
+
enableWithToken: string;
|
|
110
|
+
arrivaltimeTooltip1: string;
|
|
111
|
+
arrivaltimeTooltip2: string;
|
|
112
|
+
arrivalEstimated: string;
|
|
113
|
+
availableDesc: string;
|
|
114
|
+
noPrivateKeyWalletWarning: string;
|
|
115
|
+
layerZeroDepositTip: string;
|
|
116
|
+
layerZeroDepositTipExceedPool: string;
|
|
117
|
+
layerZeroDepositTipGte200k: string;
|
|
118
|
+
layerZeroDepositButton: string;
|
|
119
|
+
};
|
|
120
|
+
withdraw: {
|
|
121
|
+
noticeDesc: string;
|
|
122
|
+
crossChainTips: string;
|
|
123
|
+
commonWithdraw: string;
|
|
124
|
+
withdraw: string;
|
|
125
|
+
speed: string;
|
|
126
|
+
confirmWithdraw: string;
|
|
127
|
+
speedNote: string;
|
|
128
|
+
speedNoteSpeed1: string;
|
|
129
|
+
speedNoteSpeed2: string;
|
|
130
|
+
speedNoteSpeed3: string;
|
|
131
|
+
receiverAddress: string;
|
|
132
|
+
fee: string;
|
|
133
|
+
feeRate: string;
|
|
134
|
+
withdrawlAmount: string;
|
|
135
|
+
amountToReceive: string;
|
|
136
|
+
invalidReceiverAddress: string;
|
|
137
|
+
availableDesc: string;
|
|
138
|
+
feeCalculationTip: string;
|
|
139
|
+
crossChainPoolBalance: string;
|
|
140
|
+
poolBalance: string;
|
|
141
|
+
poolBalanceInsufficientTip: string;
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
locale: string;
|
|
145
|
+
};
|
|
146
|
+
export default useTranslation;
|
|
147
|
+
//# sourceMappingURL=useTranslation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTranslation.d.ts","sourceRoot":"","sources":["../../src/hooks/useTranslation.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,cAAc;aAST,MAAM,WAAW,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAyCtC,MAAM,KAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;0BAyBlC,MAAM,KAAG,OAAO;CA0B9C,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,wBAAwB,GAAI,cAAc,MAAM;aAW3C,MAAM,WAAW,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuC1E,CAAA;AAED,eAAe,cAAc,CAAA"}
|