@dodoex/widgets 3.0.2-zetachain.11 → 3.0.2-zetachain.110.ton.1
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 +4 -0
- package/dist/cjs/locales/en-US.js +1 -1
- package/dist/cjs/locales/zh-CN.js +1 -1
- package/dist/{helper-Bh6_7gAw.js → helper-BTJpgu2t.js} +1 -1
- package/dist/{helper-DCJJEnV3.cjs → helper-DIkbm_U5.cjs} +1 -1
- package/dist/{index-DVLnDJLQ.cjs → index-6EYQJsAq.cjs} +4 -4
- package/dist/{index-CzpL7rfy.js → index-8hgb8akZ.js} +4 -4
- package/dist/index-BENIDbsM.js +34 -0
- package/dist/index-CpuninTL.cjs +34 -0
- package/dist/{index-CGy_7PS2.cjs → index-DR4KO5Dk.cjs} +2 -2
- package/dist/{index-Bg8rd10E.js → index-DwtxxFKB.js} +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/zh-CN.js +1 -1
- package/dist/types/components/Bridge/BridgeRouteShortCard.d.ts +2 -4
- package/dist/types/components/Bridge/BridgeSummaryDialog/index.d.ts +2 -2
- package/dist/types/components/Bridge/CompareRoute.d.ts +4 -0
- package/dist/types/components/Bridge/RouteVision.d.ts +7 -0
- package/dist/types/components/Bridge/RouteVisionModal.d.ts +5 -0
- package/dist/types/components/CardWidgets.d.ts +11 -2
- package/dist/types/components/ErrorMessageDialog.d.ts +2 -1
- package/dist/types/components/Swap/SwapOrderHistory/CrossChainOrderList.d.ts +4 -0
- package/dist/types/components/Swap/SwapOrderHistory/CrossOrderCard.d.ts +7 -0
- package/dist/types/components/Swap/SwapOrderHistory/SameChainOrderList.d.ts +3 -0
- package/dist/types/components/Swap/SwapOrderHistory/index.d.ts +6 -5
- package/dist/types/components/Swap/components/Dialog.d.ts +1 -1
- package/dist/types/components/Swap/components/FiatEntryAndGasRefuel.d.ts +1 -0
- package/dist/types/components/Swap/components/ReceiveAddressInputModal.d.ts +10 -0
- package/dist/types/components/Swap/components/ReviewDialog.d.ts +2 -1
- package/dist/types/components/Swap/components/RouteVisionModal.d.ts +7 -0
- package/dist/types/components/Swap/components/SettingsDialog/index.d.ts +2 -1
- package/dist/types/components/Swap/components/SwapSettingsDialog/index.d.ts +2 -1
- package/dist/types/components/Swap/components/TokenCard/TokenCardSwap.d.ts +14 -4
- package/dist/types/components/Swap/components/TokenCard/TokenPickerDialog.d.ts +2 -0
- package/dist/types/components/Swap/components/TokenCard/WalletConnectBtn.d.ts +7 -1
- package/dist/types/components/Swap/components/TokenPairPriceWithToggle.d.ts +3 -2
- package/dist/types/components/Swap/index.d.ts +1 -1
- package/dist/types/components/TokenPicker/TokenItem.d.ts +3 -3
- package/dist/types/components/TokenPicker/index.d.ts +3 -3
- package/dist/types/components/Widget/index.d.ts +12 -10
- package/dist/types/constants/address.d.ts +6 -0
- package/dist/types/constants/api.d.ts +95 -4
- package/dist/types/constants/chainList.d.ts +8 -39
- package/dist/types/constants/chains.d.ts +1 -1
- package/dist/types/constants/sessionStorage.d.ts +1 -0
- package/dist/types/constants/tokenList.d.ts +5 -9
- package/dist/types/hooks/Bridge/createBridgeOrder.d.ts +5 -25
- package/dist/types/hooks/Bridge/useExecuteBridgeRoute.d.ts +1 -2
- package/dist/types/hooks/Bridge/useFeeList.d.ts +9 -0
- package/dist/types/hooks/Bridge/useFetchRoutePriceBridge.d.ts +134 -48
- package/dist/types/hooks/Bridge/useSendRoute.d.ts +1 -2
- package/dist/types/hooks/Bridge/useSwitchBridgeOrSwapSlippage.d.ts +4 -1
- package/dist/types/hooks/Bridge/utils.d.ts +6 -0
- package/dist/types/hooks/ConnectWallet/index.d.ts +0 -2
- package/dist/types/hooks/ConnectWallet/useBTCWalletStore.d.ts +1 -0
- package/dist/types/hooks/Submission/types.d.ts +29 -1
- package/dist/types/hooks/Submission/useExecution.d.ts +1 -1
- package/dist/types/hooks/Swap/useBridgeSlippage.d.ts +3 -0
- package/dist/types/hooks/Swap/useCrossSwapOrderList.d.ts +372 -0
- package/dist/types/hooks/Swap/useExecuteSwap.d.ts +2 -1
- package/dist/types/hooks/Swap/useFetchRoutePrice.d.ts +2 -4
- package/dist/types/hooks/Swap/useTradeSwapOrderList.d.ts +34 -36
- package/dist/types/hooks/Token/type.d.ts +3 -1
- package/dist/types/hooks/Token/useInitTokenList.d.ts +2 -2
- package/dist/types/hooks/Token/useSelectChainList.d.ts +2 -1
- package/dist/types/hooks/Token/useTokenList.d.ts +4 -7
- package/dist/types/hooks/Token/useTokenListDefaultToken.d.ts +2 -2
- package/dist/types/hooks/Token/useTokenListFetchBalance.d.ts +1 -4
- package/dist/types/hooks/Token/useTokenStatus.d.ts +23 -1
- package/dist/types/hooks/contract/useFetchETHBalance.d.ts +2 -1
- package/dist/types/hooks/contract/useFetchMultiTokensForSingleChain.d.ts +20 -0
- package/dist/types/hooks/contract/useFetchTokens.d.ts +9 -4
- package/dist/types/hooks/useAddressValidation.d.ts +2 -0
- package/dist/types/hooks/useGlobalState.d.ts +2 -0
- package/dist/types/hooks/useGraphQLRequests.d.ts +0 -1
- package/dist/types/hooks/useRouteVisionData.d.ts +17 -1
- package/dist/types/index.d.ts +27 -32
- package/dist/types/router/types.d.ts +5 -0
- package/dist/types/utils/CaipNetworksUtil.d.ts +5 -0
- package/dist/types/utils/address.d.ts +1 -1
- package/dist/types/utils/btc.d.ts +42 -0
- package/dist/types/utils/constants.d.ts +1 -0
- package/dist/types/utils/index.d.ts +2 -2
- package/dist/types/utils/reown-types.d.ts +28 -0
- package/dist/types/utils/solana.d.ts +7 -0
- package/dist/types/utils/ton.d.ts +3 -0
- package/dist/types/utils/wallet.d.ts +2 -0
- package/dist/types/utils/zetachain_btc_test.d.ts +5 -0
- package/dist/types/widgets/MiningWidget/hooks/helper.d.ts +2 -2
- package/dist/types/widgets/MiningWidget/hooks/useReviewRewardToken.d.ts +2 -2
- package/dist/types/widgets/MiningWidget/hooks/useRewardListAmount.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/components/LiquidityChartRangeInput/hooks.d.ts +3 -1
- package/dist/types/widgets/PoolWidget/AMMV3/components/LiquidityChartRangeInput/index.d.ts +3 -1
- package/dist/types/widgets/PoolWidget/AMMV3/components/RangeSetList.d.ts +4 -0
- package/dist/types/widgets/PoolWidget/AMMV3/components/TokenPairSelect.d.ts +3 -1
- package/dist/types/widgets/PoolWidget/AMMV3/hooks/usePoolTickData.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/hooks/useV3DerivedMintInfo.d.ts +3 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/hooks/useDefaultTokens.d.ts +2 -2
- package/dist/types/widgets/PoolWidget/PoolCreate/utils.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolDetail/components/MoreDetail/ParametersTable.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolList/AddLiquidity.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/PoolList/MyCreated.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/PoolList/MyLiquidity.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/PoolList/components/GoPoolDetailBtn.d.ts +3 -1
- package/dist/types/widgets/PoolWidget/PoolList/hooks/usePoolListFilterTokenAndPool.d.ts +12 -0
- package/dist/types/widgets/PoolWidget/PoolList/hooks/usePoolListTabs.d.ts +41 -7
- package/dist/types/widgets/PoolWidget/PoolList/index.d.ts +1 -2
- package/dist/types/widgets/PoolWidget/PoolOperate/RemovePoolOperate.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolOperate/hooks/useRemoveLiquidityTokenStatus.d.ts +43 -0
- package/dist/types/widgets/PoolWidget/PoolOperate/index.d.ts +2 -3
- package/dist/types/widgets/PoolWidget/curve/Add.d.ts +5 -0
- package/dist/types/widgets/PoolWidget/curve/AddOrRemove.d.ts +7 -0
- package/dist/types/widgets/PoolWidget/curve/AllPools.d.ts +13 -0
- package/dist/types/widgets/PoolWidget/curve/CurvePoolDetail.d.ts +5 -0
- package/dist/types/widgets/PoolWidget/curve/OperateDialog.d.ts +7 -0
- package/dist/types/widgets/PoolWidget/curve/Remove.d.ts +5 -0
- package/dist/types/widgets/PoolWidget/curve/components/ApyTooltip.d.ts +7 -0
- package/dist/types/widgets/PoolWidget/curve/components/CoinReservePieChart.d.ts +6 -0
- package/dist/types/widgets/PoolWidget/curve/components/CoinsLogoList.d.ts +7 -0
- package/dist/types/widgets/PoolWidget/curve/components/FilterAddressTags.d.ts +7 -0
- package/dist/types/widgets/PoolWidget/curve/components/LiquidityProvidersTable.d.ts +6 -0
- package/dist/types/widgets/PoolWidget/curve/components/OperateButtonContainer.d.ts +3 -0
- package/dist/types/widgets/PoolWidget/curve/components/ParametersTable.d.ts +5 -0
- package/dist/types/widgets/PoolWidget/curve/components/PoolTitle.d.ts +5 -0
- package/dist/types/widgets/PoolWidget/curve/components/PoolTotalStats.d.ts +5 -0
- package/dist/types/widgets/PoolWidget/curve/components/SlippageBonus.d.ts +3 -0
- package/dist/types/widgets/PoolWidget/curve/components/SwapsTable.d.ts +6 -0
- package/dist/types/widgets/PoolWidget/curve/components/TokenListPoolItem.d.ts +5 -0
- package/dist/types/widgets/PoolWidget/curve/hooks/useLiquidityProviders.d.ts +268 -0
- package/dist/types/widgets/PoolWidget/curve/hooks/useLpTokenBalances.d.ts +12 -0
- package/dist/types/widgets/PoolWidget/curve/hooks/usePoolDetail.d.ts +10 -0
- package/dist/types/widgets/PoolWidget/curve/hooks/usePoolListFilterTokenAndPool.d.ts +9 -0
- package/dist/types/widgets/PoolWidget/curve/hooks/usePoolSwapList.d.ts +310 -0
- package/dist/types/widgets/PoolWidget/curve/types.d.ts +44 -0
- package/dist/types/widgets/PoolWidget/curve/utils.d.ts +4 -0
- package/package.json +30 -27
- package/dist/28442382d977858a.svg +0 -9
- package/dist/assets/bundle-DSSoJu9z.css +0 -297
- package/dist/ed726d76d93d4899.svg +0 -10
- package/dist/index-CEN1BcL7.cjs +0 -263
- package/dist/index-DjAOs16s.js +0 -263
- package/dist/types/components/ConnectWallet/ConnectWalletDialog.d.ts +0 -4
- package/dist/types/components/ConnectWallet/OpenConnectWalletInfo.d.ts +0 -2
- package/dist/types/components/Swap/components/ConnectWallet/index.d.ts +0 -5
- package/dist/types/components/SwitchChainDialog/index.d.ts +0 -6
- package/dist/types/hooks/ConnectWallet/Connectors/JsonRpcConnector.d.ts +0 -9
- package/dist/types/hooks/ConnectWallet/useWalletInfo.d.ts +0 -14
- package/dist/types/hooks/ConnectWallet/useWeb3Connectors.d.ts +0 -17
- package/dist/types/hooks/ConnectWallet/web3.d.ts +0 -10
- package/dist/types/hooks/Token/useFindTokenByAddress.test.d.ts +0 -1
- package/dist/types/hooks/Token/useSelectChainList.test.d.ts +0 -1
- package/dist/types/hooks/Token/useTokenList.test.d.ts +0 -1
- package/dist/types/hooks/Token/useTokenStatus.test.d.ts +0 -1
- /package/dist/types/hooks/{Bridge/useFetchRoutePriceBridge.test.d.ts → useAddressValidation.test.d.ts} +0 -0
- /package/dist/types/{hooks/Chain/useChainList.test.d.ts → tests/1-get-account-state.d.ts} +0 -0
- /package/dist/types/{hooks/Swap/useFetchFiatPrice.test.d.ts → tests/1-send-ton.d.ts} +0 -0
- /package/dist/types/{hooks/Swap/useFetchRoutePrice.test.d.ts → utils/sui_test.d.ts} +0 -0
- /package/dist/types/{hooks/Swap/useMarginAmount.test.d.ts → utils/ton_test.d.ts} +0 -0
|
@@ -1,53 +1,81 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Cross_Chain_Swap_Zetachain_RoutesQuery } from '@dodoex/api';
|
|
2
2
|
import BigNumber from 'bignumber.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
import { useWalletInfo } from '../ConnectWallet/useWalletInfo';
|
|
4
|
+
import { TokenInfo } from '../Token';
|
|
5
|
+
type Fee = {
|
|
6
|
+
/**
|
|
7
|
+
platformFee = zetachain fee
|
|
8
|
+
destinationFee = destination chain Fee
|
|
9
|
+
btcDepositFee = source chain Fee
|
|
10
|
+
11:58
|
|
11
|
+
btcDepositFee 只有btc 链为起始链才有
|
|
12
|
+
|
|
13
|
+
// https://www.notion.so/dodotopia/V2-8-solana-USDC-A-Z-swap-246080d974e780439da0cbcca8284a2d?source=copy_link
|
|
14
|
+
svmRentFee
|
|
15
|
+
*/
|
|
16
|
+
type: 'platformFee' | 'btcDepositFee' | 'destinationFee' | 'protocolFees' | 'svmRentFee';
|
|
17
|
+
chainId: number;
|
|
18
|
+
token: string;
|
|
19
|
+
amount: string | number;
|
|
20
|
+
amountWithOutDecimals: string;
|
|
21
|
+
amountUSD: string;
|
|
22
|
+
};
|
|
23
|
+
export type CrossChainSwapZetachainRoute = {
|
|
24
|
+
routeId: string;
|
|
10
25
|
fromChainId: number;
|
|
11
|
-
|
|
12
|
-
/** from parameter */
|
|
26
|
+
fromTokenAddress: string;
|
|
13
27
|
fromAmount: string;
|
|
14
|
-
|
|
15
|
-
|
|
28
|
+
fromAmountWithOutDecimals: string;
|
|
29
|
+
fromAmountUSD: string;
|
|
30
|
+
toChainId: number;
|
|
31
|
+
toTokenAddress: string;
|
|
32
|
+
toAmount: string;
|
|
33
|
+
toAmountWithOutDecimals: string;
|
|
34
|
+
toAmountUSD: string;
|
|
16
35
|
fromAddress: string;
|
|
17
36
|
toAddress: string;
|
|
18
|
-
/** from parameter */
|
|
19
|
-
product: string | null;
|
|
20
37
|
slippage: number;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
38
|
+
approveTarget: string | null;
|
|
39
|
+
fees: Array<Fee>;
|
|
40
|
+
omniPlan: Array<{
|
|
41
|
+
hash?: string | undefined;
|
|
42
|
+
type: string;
|
|
43
|
+
inChainType: string;
|
|
44
|
+
inChainId: number;
|
|
45
|
+
inToken: string;
|
|
46
|
+
inAmount: string;
|
|
47
|
+
inAmountWithOutDecimals: number;
|
|
48
|
+
outChainType: string;
|
|
49
|
+
outChainId: number;
|
|
50
|
+
hashChainId: string | undefined;
|
|
51
|
+
outToken: string;
|
|
52
|
+
outAmount: string;
|
|
53
|
+
outAmountWithOutDecimals: number;
|
|
54
|
+
feeChainType: string;
|
|
55
|
+
feeChainId: number;
|
|
56
|
+
feeToken: string;
|
|
57
|
+
feeAmount: string;
|
|
58
|
+
feeRateBps: number;
|
|
59
|
+
btcDepositFee?: number;
|
|
60
|
+
withdrawGasCostZrc20?: string;
|
|
61
|
+
withdrawGas?: string;
|
|
62
|
+
swapSteps?: Array<{
|
|
63
|
+
ammKey: string;
|
|
64
|
+
label: string;
|
|
65
|
+
percent: number;
|
|
66
|
+
inputToken: string;
|
|
67
|
+
inAmount: string;
|
|
68
|
+
outputToken: string;
|
|
69
|
+
outAmount: string;
|
|
70
|
+
feeToken: string;
|
|
71
|
+
feeAmount: string;
|
|
72
|
+
assembleArgs: any;
|
|
73
|
+
}>;
|
|
74
|
+
}>;
|
|
75
|
+
encodeParams: {
|
|
76
|
+
interfaceParams: string;
|
|
49
77
|
};
|
|
50
|
-
}
|
|
78
|
+
};
|
|
51
79
|
export interface BridgeTokenI {
|
|
52
80
|
id: number;
|
|
53
81
|
symbol: string;
|
|
@@ -64,11 +92,27 @@ export interface BridgeStepTool {
|
|
|
64
92
|
logoURI: string;
|
|
65
93
|
}
|
|
66
94
|
export interface BridgeStepEstimate {
|
|
67
|
-
fromToken:
|
|
68
|
-
toToken:
|
|
95
|
+
fromToken: TokenInfo;
|
|
96
|
+
toToken: TokenInfo;
|
|
69
97
|
fromTokenAmount: BigNumber;
|
|
70
98
|
toTokenAmount: BigNumber;
|
|
71
99
|
}
|
|
100
|
+
export interface BridgeStepSwapStep {
|
|
101
|
+
ammKey: string;
|
|
102
|
+
label: string;
|
|
103
|
+
percent: number;
|
|
104
|
+
inputToken: TokenInfo;
|
|
105
|
+
inAmount: string;
|
|
106
|
+
outputToken: TokenInfo;
|
|
107
|
+
outAmount: string;
|
|
108
|
+
assembleArgs?: {
|
|
109
|
+
baseToken: string;
|
|
110
|
+
quoteToken: string;
|
|
111
|
+
pairAddress: string;
|
|
112
|
+
pairName: string;
|
|
113
|
+
id: string;
|
|
114
|
+
};
|
|
115
|
+
}
|
|
72
116
|
export interface BridgeStep {
|
|
73
117
|
tool: string;
|
|
74
118
|
toolDetails: BridgeStepTool;
|
|
@@ -82,8 +126,44 @@ export interface BridgeStep {
|
|
|
82
126
|
toolDetails: BridgeStepTool;
|
|
83
127
|
type: string;
|
|
84
128
|
estimate: BridgeStepEstimate;
|
|
129
|
+
swapSteps?: Array<BridgeStepSwapStep>;
|
|
130
|
+
hash?: string;
|
|
131
|
+
hashChainId?: number;
|
|
85
132
|
}>;
|
|
86
133
|
}
|
|
134
|
+
export interface BridgeRouteI {
|
|
135
|
+
/** update */
|
|
136
|
+
key: string;
|
|
137
|
+
/** only one */
|
|
138
|
+
id: string;
|
|
139
|
+
fromToken: TokenInfo;
|
|
140
|
+
toToken: TokenInfo;
|
|
141
|
+
fromChainId: number;
|
|
142
|
+
toChainId: number;
|
|
143
|
+
/** from parameter */
|
|
144
|
+
fromAmount: string;
|
|
145
|
+
toTokenAmount: BigNumber;
|
|
146
|
+
/** from parameter */
|
|
147
|
+
fromAddress: string;
|
|
148
|
+
toAddress: string;
|
|
149
|
+
/** from parameter */
|
|
150
|
+
product: string | null;
|
|
151
|
+
slippage: number;
|
|
152
|
+
/** in seconds */
|
|
153
|
+
roundedRouteCostTime: number;
|
|
154
|
+
/** approve contract address */
|
|
155
|
+
spenderContractAddress: string | null;
|
|
156
|
+
/** USD */
|
|
157
|
+
feeUSD: string | null;
|
|
158
|
+
fees: Array<Fee>;
|
|
159
|
+
/** in seconds */
|
|
160
|
+
executionDuration: number | null;
|
|
161
|
+
/** one-click */
|
|
162
|
+
step: BridgeStep;
|
|
163
|
+
encodeParams: CrossChainSwapZetachainRoute['encodeParams'];
|
|
164
|
+
productParams: any;
|
|
165
|
+
sourceRoute: Cross_Chain_Swap_Zetachain_RoutesQuery['cross_chain_swap_zetachain_routes'];
|
|
166
|
+
}
|
|
87
167
|
export declare enum RoutePriceStatus {
|
|
88
168
|
Initial = "Initial",
|
|
89
169
|
Loading = "Loading",
|
|
@@ -91,12 +171,18 @@ export declare enum RoutePriceStatus {
|
|
|
91
171
|
Success = "Success"
|
|
92
172
|
}
|
|
93
173
|
export interface FetchRoutePrice {
|
|
174
|
+
fromAccount: ReturnType<ReturnType<typeof useWalletInfo>['getAppKitAccountByChainId']>;
|
|
175
|
+
toAccount: ReturnType<ReturnType<typeof useWalletInfo>['getAppKitAccountByChainId']>;
|
|
94
176
|
fromToken: TokenInfo | null;
|
|
95
177
|
toToken: TokenInfo | null;
|
|
96
178
|
fromAmount: string;
|
|
179
|
+
enabled: boolean;
|
|
180
|
+
slippage: string | number;
|
|
97
181
|
}
|
|
98
|
-
export declare function useFetchRoutePriceBridge({
|
|
182
|
+
export declare function useFetchRoutePriceBridge({ fromAccount, toAccount, fromToken, toToken, fromAmount, enabled, slippage, }: FetchRoutePrice): {
|
|
99
183
|
status: RoutePriceStatus;
|
|
100
|
-
|
|
101
|
-
|
|
184
|
+
failedReason: string | undefined;
|
|
185
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<any, Error>>;
|
|
186
|
+
bridgeRouteList: never[] | BridgeRouteI[];
|
|
102
187
|
};
|
|
188
|
+
export {};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import BigNumber from 'bignumber.js';
|
|
2
|
-
import { BridgeRouteI } from './useFetchRoutePriceBridge';
|
|
3
2
|
import { BridgeTXRequest } from '../../components/Bridge/BridgeSummaryDialog';
|
|
3
|
+
import { BridgeRouteI } from './useFetchRoutePriceBridge';
|
|
4
4
|
export declare function useSendRoute(): {
|
|
5
|
-
apikey: string | undefined;
|
|
6
5
|
sendRouteLoading: boolean;
|
|
7
6
|
sendRouteError: string;
|
|
8
7
|
setSendRouteError: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
export declare function useSwitchBridgeOrSwapSlippage(isBridge: boolean | undefined):
|
|
1
|
+
export declare function useSwitchBridgeOrSwapSlippage(isBridge: boolean | undefined): {
|
|
2
|
+
showSwitchSlippage: boolean;
|
|
3
|
+
setShowSwitchSlippage: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
4
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TokenList } from '../Token/type';
|
|
2
|
+
import { BridgeStep, CrossChainSwapZetachainRoute } from './useFetchRoutePriceBridge';
|
|
3
|
+
export declare function generateBridgeStep({ omniPlan, tokenList, }: {
|
|
4
|
+
omniPlan: CrossChainSwapZetachainRoute['omniPlan'];
|
|
5
|
+
tokenList: TokenList;
|
|
6
|
+
}): BridgeStep;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useBTCWalletStore(): import("@dodoex/btc-connect-react").WalletStore | undefined;
|
|
@@ -27,7 +27,11 @@ export declare enum MetadataFlag {
|
|
|
27
27
|
claimMining = "claimMining",
|
|
28
28
|
submissionCreateMetaKey = "submissionCreateMetaKey",
|
|
29
29
|
approve = "approve",
|
|
30
|
-
reset = "reset"
|
|
30
|
+
reset = "reset",
|
|
31
|
+
curveAddLiquidity = "curveAddLiquidity",
|
|
32
|
+
curveRemoveLiquidityOneCoin = "curveRemoveLiquidityOneCoin",
|
|
33
|
+
curveRemoveLiquidity = "curveRemoveLiquidity",
|
|
34
|
+
curveRemoveLiquidityImBalance = "curveRemoveLiquidityImBalance"
|
|
31
35
|
}
|
|
32
36
|
export type Metadata = Record<string, any>;
|
|
33
37
|
export type Request = {
|
|
@@ -58,7 +62,31 @@ export interface Showing {
|
|
|
58
62
|
spec: StepSpec;
|
|
59
63
|
submitState?: SubmitState;
|
|
60
64
|
}
|
|
65
|
+
export interface ExecuteCustomHandlerParameters {
|
|
66
|
+
onSubmit: (tx: string, params?: {
|
|
67
|
+
reportInfo?: Record<string, any>;
|
|
68
|
+
showing?: Partial<Showing> | null;
|
|
69
|
+
}) => void;
|
|
70
|
+
onSuccess: (tx: string, params?: {
|
|
71
|
+
reportInfo?: Record<string, any>;
|
|
72
|
+
notShowingDone?: boolean;
|
|
73
|
+
showing?: Partial<Showing>;
|
|
74
|
+
}) => Promise<void>;
|
|
75
|
+
onError: (e: any) => void;
|
|
76
|
+
setShowing: React.Dispatch<React.SetStateAction<Showing | null>>;
|
|
77
|
+
}
|
|
61
78
|
export type ExecutionCtx = {
|
|
79
|
+
executeCustom: (params: {
|
|
80
|
+
brief: string;
|
|
81
|
+
subtitle?: string | React.ReactNode | null;
|
|
82
|
+
early?: boolean;
|
|
83
|
+
mixpanelProps?: Record<string, any>;
|
|
84
|
+
submittedBack?: () => void;
|
|
85
|
+
submittedConfirmBack?: () => void;
|
|
86
|
+
metadata?: Record<string, any>;
|
|
87
|
+
successBack?: (tx: string, callback?: ExecutionProps['onTxSuccess']) => void;
|
|
88
|
+
handler: (params: ExecuteCustomHandlerParameters) => Promise<any>;
|
|
89
|
+
}) => Promise<ExecutionResult>;
|
|
62
90
|
/**
|
|
63
91
|
* Execute an on-chain operation
|
|
64
92
|
* @param breif: TX title. e.g.: "Swap"
|