@dodoex/widgets 3.0.2-zetachain.10 → 3.0.2-zetachain.101

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 (154) hide show
  1. package/dist/cjs/locales/en-US.js +1 -1
  2. package/dist/cjs/locales/zh-CN.js +1 -1
  3. package/dist/{helper-B-L9J5Wk.js → helper-D5chKXxT.js} +1 -1
  4. package/dist/{helper-DB7pJRlV.cjs → helper-pDdocGBD.cjs} +1 -1
  5. package/dist/{index-CnswmG4u.cjs → index-3hXSPpit.cjs} +2 -2
  6. package/dist/index-B5QSPl3T.js +12 -0
  7. package/dist/index-BzTel90q.js +31 -0
  8. package/dist/{index-D54mvRoh.js → index-CdQPafiH.js} +3 -3
  9. package/dist/{index-BGkMyf0r.cjs → index-jH8YZz2V.cjs} +4 -4
  10. package/dist/index-kl2v_NZL.cjs +31 -0
  11. package/dist/index.cjs +1 -1
  12. package/dist/index.js +1 -1
  13. package/dist/locales/en-US.js +1 -1
  14. package/dist/locales/zh-CN.js +1 -1
  15. package/dist/types/components/Bridge/BridgeRouteShortCard.d.ts +2 -4
  16. package/dist/types/components/Bridge/BridgeSummaryDialog/index.d.ts +2 -2
  17. package/dist/types/components/Bridge/CompareRoute.d.ts +4 -0
  18. package/dist/types/components/Bridge/RouteVision.d.ts +7 -0
  19. package/dist/types/components/Bridge/RouteVisionModal.d.ts +5 -0
  20. package/dist/types/components/CardWidgets.d.ts +11 -2
  21. package/dist/types/components/ErrorMessageDialog.d.ts +2 -1
  22. package/dist/types/components/Swap/SwapOrderHistory/CrossChainOrderList.d.ts +4 -0
  23. package/dist/types/components/Swap/SwapOrderHistory/CrossOrderCard.d.ts +7 -0
  24. package/dist/types/components/Swap/SwapOrderHistory/SameChainOrderList.d.ts +3 -0
  25. package/dist/types/components/Swap/SwapOrderHistory/index.d.ts +6 -5
  26. package/dist/types/components/Swap/components/Dialog.d.ts +1 -1
  27. package/dist/types/components/Swap/components/FiatEntryAndGasRefuel.d.ts +1 -0
  28. package/dist/types/components/Swap/components/ReceiveAddressInputModal.d.ts +10 -0
  29. package/dist/types/components/Swap/components/ReviewDialog.d.ts +2 -1
  30. package/dist/types/components/Swap/components/RouteVisionModal.d.ts +7 -0
  31. package/dist/types/components/Swap/components/SettingsDialog/index.d.ts +2 -1
  32. package/dist/types/components/Swap/components/SwapSettingsDialog/index.d.ts +2 -1
  33. package/dist/types/components/Swap/components/TokenCard/TokenCardSwap.d.ts +14 -4
  34. package/dist/types/components/Swap/components/TokenCard/TokenPickerDialog.d.ts +2 -0
  35. package/dist/types/components/Swap/components/TokenCard/WalletConnectBtn.d.ts +7 -1
  36. package/dist/types/components/Swap/components/TokenPairPriceWithToggle.d.ts +3 -2
  37. package/dist/types/components/Swap/index.d.ts +1 -1
  38. package/dist/types/components/TokenPicker/TokenItem.d.ts +3 -3
  39. package/dist/types/components/TokenPicker/index.d.ts +3 -3
  40. package/dist/types/components/Widget/index.d.ts +12 -10
  41. package/dist/types/constants/address.d.ts +4 -0
  42. package/dist/types/constants/api.d.ts +95 -4
  43. package/dist/types/constants/chainList.d.ts +6 -39
  44. package/dist/types/constants/chains.d.ts +1 -1
  45. package/dist/types/constants/sessionStorage.d.ts +1 -0
  46. package/dist/types/constants/tokenList.d.ts +5 -9
  47. package/dist/types/hooks/Bridge/createBridgeOrder.d.ts +5 -25
  48. package/dist/types/hooks/Bridge/useExecuteBridgeRoute.d.ts +1 -2
  49. package/dist/types/hooks/Bridge/useFeeList.d.ts +9 -0
  50. package/dist/types/hooks/Bridge/useFetchRoutePriceBridge.d.ts +134 -48
  51. package/dist/types/hooks/Bridge/useSendRoute.d.ts +1 -2
  52. package/dist/types/hooks/Bridge/useSwitchBridgeOrSwapSlippage.d.ts +4 -1
  53. package/dist/types/hooks/Bridge/utils.d.ts +6 -0
  54. package/dist/types/hooks/ConnectWallet/index.d.ts +0 -2
  55. package/dist/types/hooks/ConnectWallet/useBTCWalletStore.d.ts +1 -0
  56. package/dist/types/hooks/Submission/types.d.ts +29 -1
  57. package/dist/types/hooks/Submission/useExecution.d.ts +1 -1
  58. package/dist/types/hooks/Swap/useBridgeSlippage.d.ts +3 -0
  59. package/dist/types/hooks/Swap/useCrossSwapOrderList.d.ts +372 -0
  60. package/dist/types/hooks/Swap/useExecuteSwap.d.ts +2 -1
  61. package/dist/types/hooks/Swap/useFetchRoutePrice.d.ts +2 -4
  62. package/dist/types/hooks/Swap/useTradeSwapOrderList.d.ts +34 -36
  63. package/dist/types/hooks/Token/type.d.ts +3 -1
  64. package/dist/types/hooks/Token/useInitTokenList.d.ts +2 -2
  65. package/dist/types/hooks/Token/useSelectChainList.d.ts +2 -1
  66. package/dist/types/hooks/Token/useTokenList.d.ts +4 -7
  67. package/dist/types/hooks/Token/useTokenListDefaultToken.d.ts +2 -2
  68. package/dist/types/hooks/Token/useTokenListFetchBalance.d.ts +1 -4
  69. package/dist/types/hooks/Token/useTokenStatus.d.ts +23 -1
  70. package/dist/types/hooks/contract/useFetchETHBalance.d.ts +2 -1
  71. package/dist/types/hooks/contract/useFetchMultiTokensForSingleChain.d.ts +20 -0
  72. package/dist/types/hooks/contract/useFetchTokens.d.ts +9 -4
  73. package/dist/types/hooks/useAddressValidation.d.ts +2 -0
  74. package/dist/types/hooks/useGlobalState.d.ts +2 -0
  75. package/dist/types/hooks/useGraphQLRequests.d.ts +0 -1
  76. package/dist/types/hooks/useRouteVisionData.d.ts +17 -1
  77. package/dist/types/index.d.ts +26 -32
  78. package/dist/types/router/types.d.ts +5 -0
  79. package/dist/types/utils/address.d.ts +1 -1
  80. package/dist/types/utils/btc.d.ts +42 -0
  81. package/dist/types/utils/constants.d.ts +1 -0
  82. package/dist/types/utils/solana.d.ts +7 -0
  83. package/dist/types/utils/wallet.d.ts +2 -0
  84. package/dist/types/utils/zetachain_btc_test.d.ts +5 -0
  85. package/dist/types/widgets/MiningWidget/hooks/helper.d.ts +2 -2
  86. package/dist/types/widgets/MiningWidget/hooks/useReviewRewardToken.d.ts +2 -2
  87. package/dist/types/widgets/MiningWidget/hooks/useRewardListAmount.d.ts +1 -1
  88. package/dist/types/widgets/PoolWidget/AMMV3/components/LiquidityChartRangeInput/hooks.d.ts +3 -1
  89. package/dist/types/widgets/PoolWidget/AMMV3/components/LiquidityChartRangeInput/index.d.ts +3 -1
  90. package/dist/types/widgets/PoolWidget/AMMV3/components/RangeSetList.d.ts +4 -0
  91. package/dist/types/widgets/PoolWidget/AMMV3/components/TokenPairSelect.d.ts +3 -1
  92. package/dist/types/widgets/PoolWidget/AMMV3/hooks/usePoolTickData.d.ts +1 -1
  93. package/dist/types/widgets/PoolWidget/AMMV3/hooks/useV3DerivedMintInfo.d.ts +3 -1
  94. package/dist/types/widgets/PoolWidget/PoolCreate/hooks/useDefaultTokens.d.ts +2 -2
  95. package/dist/types/widgets/PoolWidget/PoolDetail/components/MoreDetail/ParametersTable.d.ts +1 -1
  96. package/dist/types/widgets/PoolWidget/PoolList/AddLiquidity.d.ts +2 -1
  97. package/dist/types/widgets/PoolWidget/PoolList/MyCreated.d.ts +2 -1
  98. package/dist/types/widgets/PoolWidget/PoolList/MyLiquidity.d.ts +2 -1
  99. package/dist/types/widgets/PoolWidget/PoolList/components/GoPoolDetailBtn.d.ts +3 -1
  100. package/dist/types/widgets/PoolWidget/PoolList/hooks/usePoolListFilterTokenAndPool.d.ts +12 -0
  101. package/dist/types/widgets/PoolWidget/PoolList/hooks/usePoolListTabs.d.ts +41 -7
  102. package/dist/types/widgets/PoolWidget/PoolList/index.d.ts +1 -2
  103. package/dist/types/widgets/PoolWidget/PoolOperate/RemovePoolOperate.d.ts +1 -1
  104. package/dist/types/widgets/PoolWidget/PoolOperate/hooks/useRemoveLiquidityTokenStatus.d.ts +43 -0
  105. package/dist/types/widgets/PoolWidget/PoolOperate/index.d.ts +2 -3
  106. package/dist/types/widgets/PoolWidget/curve/Add.d.ts +5 -0
  107. package/dist/types/widgets/PoolWidget/curve/AddOrRemove.d.ts +7 -0
  108. package/dist/types/widgets/PoolWidget/curve/AllPools.d.ts +13 -0
  109. package/dist/types/widgets/PoolWidget/curve/CurvePoolDetail.d.ts +5 -0
  110. package/dist/types/widgets/PoolWidget/curve/OperateDialog.d.ts +7 -0
  111. package/dist/types/widgets/PoolWidget/curve/Remove.d.ts +5 -0
  112. package/dist/types/widgets/PoolWidget/curve/components/ApyTooltip.d.ts +7 -0
  113. package/dist/types/widgets/PoolWidget/curve/components/CoinReservePieChart.d.ts +6 -0
  114. package/dist/types/widgets/PoolWidget/curve/components/CoinsLogoList.d.ts +7 -0
  115. package/dist/types/widgets/PoolWidget/curve/components/FilterAddressTags.d.ts +7 -0
  116. package/dist/types/widgets/PoolWidget/curve/components/LiquidityProvidersTable.d.ts +6 -0
  117. package/dist/types/widgets/PoolWidget/curve/components/OperateButtonContainer.d.ts +3 -0
  118. package/dist/types/widgets/PoolWidget/curve/components/ParametersTable.d.ts +5 -0
  119. package/dist/types/widgets/PoolWidget/curve/components/PoolTitle.d.ts +5 -0
  120. package/dist/types/widgets/PoolWidget/curve/components/PoolTotalStats.d.ts +5 -0
  121. package/dist/types/widgets/PoolWidget/curve/components/SlippageBonus.d.ts +3 -0
  122. package/dist/types/widgets/PoolWidget/curve/components/SwapsTable.d.ts +6 -0
  123. package/dist/types/widgets/PoolWidget/curve/components/TokenListPoolItem.d.ts +5 -0
  124. package/dist/types/widgets/PoolWidget/curve/hooks/useLiquidityProviders.d.ts +268 -0
  125. package/dist/types/widgets/PoolWidget/curve/hooks/useLpTokenBalances.d.ts +12 -0
  126. package/dist/types/widgets/PoolWidget/curve/hooks/usePoolDetail.d.ts +10 -0
  127. package/dist/types/widgets/PoolWidget/curve/hooks/usePoolListFilterTokenAndPool.d.ts +9 -0
  128. package/dist/types/widgets/PoolWidget/curve/hooks/usePoolSwapList.d.ts +310 -0
  129. package/dist/types/widgets/PoolWidget/curve/types.d.ts +44 -0
  130. package/dist/types/widgets/PoolWidget/curve/utils.d.ts +4 -0
  131. package/package.json +21 -27
  132. package/dist/28442382d977858a.svg +0 -9
  133. package/dist/assets/bundle-DSSoJu9z.css +0 -297
  134. package/dist/ed726d76d93d4899.svg +0 -10
  135. package/dist/index-BYYZxbt3.js +0 -263
  136. package/dist/index-CbzpdArY.cjs +0 -263
  137. package/dist/index-D8Yofu94.js +0 -12
  138. package/dist/types/components/ConnectWallet/ConnectWalletDialog.d.ts +0 -4
  139. package/dist/types/components/ConnectWallet/OpenConnectWalletInfo.d.ts +0 -2
  140. package/dist/types/components/Swap/components/ConnectWallet/index.d.ts +0 -5
  141. package/dist/types/components/SwitchChainDialog/index.d.ts +0 -6
  142. package/dist/types/hooks/Chain/useChainList.test.d.ts +0 -1
  143. package/dist/types/hooks/ConnectWallet/Connectors/JsonRpcConnector.d.ts +0 -9
  144. package/dist/types/hooks/ConnectWallet/useWalletInfo.d.ts +0 -14
  145. package/dist/types/hooks/ConnectWallet/useWeb3Connectors.d.ts +0 -17
  146. package/dist/types/hooks/ConnectWallet/web3.d.ts +0 -10
  147. package/dist/types/hooks/Swap/useFetchFiatPrice.test.d.ts +0 -1
  148. package/dist/types/hooks/Swap/useFetchRoutePrice.test.d.ts +0 -1
  149. package/dist/types/hooks/Swap/useMarginAmount.test.d.ts +0 -1
  150. package/dist/types/hooks/Token/useFindTokenByAddress.test.d.ts +0 -1
  151. package/dist/types/hooks/Token/useSelectChainList.test.d.ts +0 -1
  152. package/dist/types/hooks/Token/useTokenList.test.d.ts +0 -1
  153. package/dist/types/hooks/Token/useTokenStatus.test.d.ts +0 -1
  154. /package/dist/types/hooks/{Bridge/useFetchRoutePriceBridge.test.d.ts → useAddressValidation.test.d.ts} +0 -0
@@ -5,6 +5,7 @@ export interface TokenPickerDialogProps {
5
5
  title?: React.ReactNode | string;
6
6
  occupiedAddrs?: string[];
7
7
  hiddenAddrs?: string[];
8
+ showAddrs?: string[];
8
9
  occupiedChainId?: TokenPickerProps['occupiedChainId'];
9
10
  onClose: DialogProps['onClose'];
10
11
  value?: TokenPickerProps['value'];
@@ -16,5 +17,6 @@ export interface TokenPickerDialogProps {
16
17
  searchOtherAddress?: TokenPickerProps['searchOtherAddress'];
17
18
  chainId?: TokenPickerProps['chainId'];
18
19
  modal?: boolean;
20
+ filterBySupportTargetChain?: boolean;
19
21
  }
20
22
  export declare function TokenPickerDialog(props: TokenPickerDialogProps): import("react").JSX.Element;
@@ -1,5 +1,11 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ import { useWalletInfo } from '../../../../hooks/ConnectWallet/useWalletInfo';
1
3
  import { TokenInfo } from '../../../../hooks/Token/type';
2
4
  export interface Props {
3
5
  token: TokenInfo;
6
+ enterAddressEnabled?: boolean;
7
+ inputToAddress: string | null;
8
+ setInputToAddress: Dispatch<SetStateAction<string | null>>;
9
+ account: ReturnType<ReturnType<typeof useWalletInfo>['getAppKitAccountByChainId']>;
4
10
  }
5
- export declare const WalletConnectBtn: ({ token }: Props) => import("react").JSX.Element;
11
+ export declare const WalletConnectBtn: ({ token, enterAddressEnabled, inputToAddress, setInputToAddress, account, }: Props) => import("react").JSX.Element;
@@ -1,9 +1,10 @@
1
- import { TokenInfo } from '../../../hooks/Token';
2
1
  import { RoutePriceStatus } from '../../../hooks/Swap';
3
- export declare function TokenPairPriceWithToggle({ toToken, fromToken, priceStatus, pricePerToToken, pricePerFromToken, }: {
2
+ import { TokenInfo } from '../../../hooks/Token';
3
+ export declare function TokenPairPriceWithToggle({ toToken, fromToken, priceStatus, pricePerToToken, pricePerFromToken, routeInfo, }: {
4
4
  toToken: TokenInfo | null;
5
5
  fromToken: TokenInfo | null;
6
6
  priceStatus: RoutePriceStatus;
7
7
  pricePerToToken: number | null;
8
8
  pricePerFromToken: number | null;
9
+ routeInfo: string | null;
9
10
  }): import("react").JSX.Element;
@@ -1,5 +1,5 @@
1
- import { TokenInfo } from '../../hooks/Token/type';
2
1
  import { GetAutoSlippage } from '../../hooks/setting/useSetAutoSlippage';
2
+ import { TokenInfo } from '../../hooks/Token/type';
3
3
  export interface SwapProps {
4
4
  /** Higher priority setting slippage */
5
5
  getAutoSlippage?: GetAutoSlippage;
@@ -1,10 +1,10 @@
1
+ import BigNumber from 'bignumber.js';
1
2
  import { CSSProperties } from 'react';
2
3
  import { TokenInfo } from './../../hooks/Token';
3
- import BigNumber from 'bignumber.js';
4
- export default function TokenItem({ token, disabled, style, balance: balanceBigNumber, onClick, }: {
4
+ export default function TokenItem({ token, disabled, style, balance: balanceBigNumber, onSelect, }: {
5
5
  token: TokenInfo;
6
6
  disabled?: boolean;
7
7
  style?: CSSProperties;
8
8
  balance?: BigNumber;
9
- onClick: () => void;
9
+ onSelect: (token: TokenInfo) => void;
10
10
  }): import("react").JSX.Element;
@@ -1,7 +1,6 @@
1
+ import { ChainId } from '@dodoex/api';
1
2
  import { BoxProps } from '@dodoex/components';
2
- import React from 'react';
3
3
  import type { TokenInfo } from '../../hooks/Token';
4
- import { ChainId } from '@dodoex/api';
5
4
  export interface TokenPickerProps {
6
5
  chainId?: ChainId;
7
6
  value?: TokenInfo | null | Array<TokenInfo>;
@@ -22,5 +21,6 @@ export interface TokenPickerProps {
22
21
  /** like search pool address */
23
22
  searchOtherAddress?: (address: string) => Promise<JSX.Element | null>;
24
23
  sx?: BoxProps['sx'];
24
+ filterBySupportTargetChain?: boolean;
25
25
  }
26
- export default function TokenPicker({ chainId, value, onChange, occupiedAddrs, occupiedChainId, hiddenAddrs, showAddrs, visible, side, defaultLoadBalance, multiple, searchPlaceholder, searchOtherAddress, sx, }: TokenPickerProps): React.JSX.Element;
26
+ export default function TokenPicker({ chainId, value, onChange, occupiedAddrs, occupiedChainId, hiddenAddrs, showAddrs, visible, side, defaultLoadBalance, multiple, searchPlaceholder, searchOtherAddress, sx, filterBySupportTargetChain, }: TokenPickerProps): import("react").JSX.Element;
@@ -1,20 +1,23 @@
1
- import { ChainId, ContractRequests, GraphQLRequests } from '@dodoex/api';
1
+ import { ChainId, GraphQLRequests } from '@dodoex/api';
2
+ import type { WalletStore } from '@dodoex/btc-connect-react';
2
3
  import { EmptyDataIcon, PaletteMode, ThemeOptions } from '@dodoex/components';
4
+ import { Connection } from '@solana/web3.js';
3
5
  import { PropsWithChildren } from 'react';
4
6
  import { APIServices } from '../../constants/api';
5
7
  import { SupportedLang } from '../../constants/locales';
6
- import { Web3ConnectorsProps } from '../../hooks/ConnectWallet';
7
8
  import { ExecutionProps } from '../../hooks/Submission';
9
+ import { ExecutionCtx } from '../../hooks/Submission/types';
8
10
  import { DefaultTokenInfo, TokenInfo } from '../../hooks/Token/type';
9
11
  import { InitTokenListProps } from '../../hooks/Token/useInitTokenList';
12
+ import { Page } from '../../router';
10
13
  import { ConfirmProps } from '../Confirm';
11
14
  import { DialogProps } from '../Swap/components/Dialog';
12
- import { Page } from '../../router';
13
- import { ExecutionCtx } from '../../hooks/Submission/types';
14
15
  import { TokenPickerDialogProps } from '../Swap/components/TokenCard/TokenPickerDialog';
15
16
  export declare const WIDGET_CLASS_NAME = "dodo-widget-container";
16
- export interface WidgetProps extends Web3ConnectorsProps, InitTokenListProps, ExecutionProps {
17
+ export interface WidgetProps extends InitTokenListProps, ExecutionProps {
17
18
  apikey?: string;
19
+ GRAPHQL_URL: string;
20
+ IS_TEST_ENV: boolean;
18
21
  theme?: PartialDeep<ThemeOptions>;
19
22
  colorMode?: PaletteMode;
20
23
  defaultChainId: ChainId;
@@ -43,14 +46,11 @@ export interface WidgetProps extends Web3ConnectorsProps, InitTokenListProps, Ex
43
46
  notSupportPMM?: boolean;
44
47
  supportAMMV2?: boolean;
45
48
  supportAMMV3?: boolean;
49
+ supportCurve?: boolean;
46
50
  /** When the winding status changes, no pop-up window will be displayed. */
47
51
  noSubmissionDialog?: boolean;
48
- onProviderChanged?: (provider?: any) => void;
49
- getStaticJsonRpcProviderByChainId?: Exclude<ConstructorParameters<typeof ContractRequests>[0], undefined>['getProvider'];
52
+ submissionDialogModal?: boolean;
50
53
  widgetRef?: React.RefObject<HTMLDivElement>;
51
- /** If true is returned, the default wallet connection logic will not be executed */
52
- onConnectWalletClick?: () => boolean | Promise<boolean>;
53
- onSwitchChain?: (chainId?: ChainId) => Promise<boolean>;
54
54
  /** When the token balance is insufficient, users can purchase or swap callbacks */
55
55
  gotoBuyToken?: (params: {
56
56
  token: TokenInfo;
@@ -90,6 +90,8 @@ export interface WidgetProps extends Web3ConnectorsProps, InitTokenListProps, Ex
90
90
  /** Default deadLine when it cannot be set. Unit: seconds */
91
91
  deadLine?: number;
92
92
  submission?: ExecutionCtx;
93
+ solanaConnection?: Connection;
94
+ btcWalletStore?: WalletStore;
93
95
  }
94
96
  export { LangProvider } from '../../providers/i18n';
95
97
  export { default as Message } from '../Message';
@@ -1 +1,5 @@
1
+ import { ChainId } from '@dodoex/api';
1
2
  export declare const EmptyAddress = "0x0000000000000000000000000000000000000000";
3
+ export declare const solanaFallbackAddress = "CVVQYs9Pi3t4it4KFpm3hxk97uDA6AVzNVJvGQTPH17n";
4
+ export declare const btcFallbackAddress = "tb1qcrd8yvatjzpxl0ew29jsps2z595jpwtm5mj38v";
5
+ export declare const getFallbackAddress: (chainId: ChainId | undefined) => string;
@@ -1,6 +1,7 @@
1
- import { ContractRequests, TokenApi, ChainId } from '@dodoex/api';
1
+ import { ChainId, ContractRequests, TokenApi } from '@dodoex/api';
2
2
  export declare enum APIServiceKey {
3
3
  routePrice = "routePrice",
4
+ solanaRoutePrice = "solanaRoutePrice",
4
5
  fiatPrice = "fiatPrice",
5
6
  bridgeRoutePrice = "bridgeRoutePrice",
6
7
  bridgeEncode = "bridgeEncode",
@@ -11,9 +12,99 @@ export type APIServices = {
11
12
  };
12
13
  export declare const AppUrl = "https://app.dodoex.io";
13
14
  export declare const getCGTokenListAPI: (chainId: ChainId) => any;
14
- export declare const RoutePriceAPI = "https://api.dodoex.io/route-service/v2/widget/getdodoroute";
15
- export declare const FiatPriceAPI = "https://api.dodoex.io/frontend-price-api/current/batch";
15
+ /**
16
+ https://api.dodoex.io/route-service/zetachain/swap?apikey=d5f476a6fd58e5e989&slippage=5&chainId=7001&source=dodoMix&fromTokenAddress=0x4bC32034caCcc9B7e02536945eDbC286bACbA073&toTokenAddress=0xcC683A782f4B30c138787CB5576a86AF66fdc31d&fromAmount=100000&userAddr=0x996AF9757c4995A91E3A9b2fAd59e72eE4436382
17
+
18
+
19
+ {
20
+ "status": 200,
21
+ "data": {
22
+ "resAmount": 0.100184,
23
+ "resPricePerToToken": 0.9981633793819373,
24
+ "resPricePerFromToken": 1.0018399999999998,
25
+ "priceImpact": 0,
26
+ "useSource": "DODORoute",
27
+ "targetDecimals": 6,
28
+ "targetApproveAddr": "0x143bE32C854E4Ddce45aD48dAe3343821556D0c3",
29
+ "to": "0x026eea5c10f526153e7578E5257801f8610D1142",
30
+ "data": "0xff84aafa0000000000000000000000004bc32034caccc9b7e02536945edbc286bacba073000000000000000000000000cc683a782f4b30c138787cb5576a86af66fdc31d00000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000000000000001875800000000000000000000000000000000000000000000000000000000000173c6000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000026000000000000000000000000000000000000000000000000000000000000002e000000000000000000000000000000000000000000000000000000000682d987600000000000000000000000000000000000000000000000000000000000000010000000000000000000000000f9053e174c123098c17e60a2b1fab3b303f9e2900000000000000000000000000000000000000000000000000000000000000010000000000000000000000004f59b88556c1b133939b2655729ad53226ed5fad00000000000000000000000000000000000000000000000000000000000000020000000000000000000000004f59b88556c1b133939b2655729ad53226ed5fad000000000000000000000000026eea5c10f526153e7578e5257801f8610d11420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
31
+ "minReturnAmount": "95174",
32
+ "gasLimit": "0",
33
+ "routeInfo": {
34
+ "subRouteTotalPart": 100,
35
+ "subRoute": [
36
+ {
37
+ "midPathPart": 100,
38
+ "midPath": [
39
+ {
40
+ "fromToken": "0x4bc32034caccc9b7e02536945edbc286bacba073",
41
+ "toToken": "0xcc683a782f4b30c138787cb5576a86af66fdc31d",
42
+ "oneSplitTotalPart": 20,
43
+ "poolDetails": [
44
+ {
45
+ "poolName": "DODOV2",
46
+ "pool": "0x4f59b88556c1b133939b2655729ad53226ed5fad",
47
+ "poolPart": 20,
48
+ "poolInAmount": "100000",
49
+ "poolOutAmount": "100184"
50
+ }
51
+ ],
52
+ "fromAmount": "100000",
53
+ "toAmount": "100184"
54
+ }
55
+ ]
56
+ }
57
+ ]
58
+ },
59
+ "value": "0",
60
+ "id": "4767a82128f23ea114ae4f05c4faef21"
61
+ }
62
+ }
63
+
64
+ */
65
+ export declare const RoutePriceAPI = "https://api.dodoex.io/route-service/zetachain/swap";
66
+ /**
67
+ https://api.dodoex.io/route-service/zetachain/svm/swap?apikey=d5f476a6fd58e5e989&inputMint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&outputMint=Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB&amount=1000000&user=CjeWeg7Pfyq5VcakxaUwBHCZoEePKYuZTYgfkXaaiCw3&chainId=solana-mainnet&slippageBps=32&source=jupiter
68
+
69
+
70
+ {
71
+ "status": 200,
72
+ "data": {
73
+ "resAmount": 0.999554,
74
+ "priceImpact": 0.00010563595848026669,
75
+ "useSource": "Jupiter",
76
+ "inputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
77
+ "inAmount": "1000000",
78
+ "inputMintDecimal": 6,
79
+ "outputMint": "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",
80
+ "outAmount": "999554",
81
+ "outputMintDecimal": 6,
82
+ "minOutAmount": "996356",
83
+ "inAmountWithOutDecimals": 1,
84
+ "outAmountWithOutDecimals": 0.999554,
85
+ "slippageBps": 32,
86
+ "routePlan": [
87
+ {
88
+ "swapInfo": {
89
+ "ammKey": "5K7CHUbBYAh6wrantyJvDDqwT4VoKuZTi73CN1DTUUer",
90
+ "label": "Stabble Stable Swap",
91
+ "inputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
92
+ "outputMint": "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",
93
+ "inAmount": "1000000",
94
+ "outAmount": "999554",
95
+ "feeAmount": "10",
96
+ "feeMint": "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"
97
+ },
98
+ "percent": 100
99
+ }
100
+ ],
101
+ "data": "AIABAAgLrl1dPXkIuWhzYVhFtYxb+JQ3GoZqa2pq14bW0E52rOJp7jJXlYhamzIeZUst3brLJbcQ9ZMduX/Gud3GUE0+/6/x/V52dT9Bjl8YSwqdPxo1PUQ8QzrmBC38ogNXtRwqxvp6877brTo9ZfNqq8l0MbG75MLS9uDkfKYCA0UvXWHOAQ5gr+2yJxe9YxkvVBRaP5ZaM7uC0scCnrLOHiCCZIyXJY9OJInxuz0QKRSODYMLWhOZ2v8QhASOe9jb6fhZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEedVb8jHAbu50xW7OaBUH/bGy3qP0jlECsc2iVrwTj7Q/+if11/ZKdMCbHylYed5LCas238ndUUsyGqezjOXoAwZGb+UhFzL/7K26csOb57yM5bvF9xJrLEObOkAAAABynzuLbKQ30Ca3pj/0Wq5lWzvmdbFt2OddEbICsJmWXzN8dj2NJQ6itko+eogXWBEuAwQlfGA3cbUcKdhqHrdTAgkABQKcQBAACh4AAwQCAQ8FBg8AAgEHBAcIBxAAAgELDA0OERITFA9H4a81SdQvNO1AQg8AAAAAAIJADwAAAAAABDQPAAAAAAAjAAAA5RfLl3rjrSoBAAAAOGQAAUBCDwAAAAAAgkAPAAAAAAAgAAABWX05K6qoNBpFvohhQGiBxG4ZEV+GAgS6FrxyNTh9k9oETqYKoQYEERQMDQc=",
102
+ "lastValidBlockHeight": 319671584
103
+ }
104
+ }
105
+ */
106
+ export declare const SolanaRoutePriceAPI = "https://api.dodoex.io/route-service/zetachain/svm/swap";
107
+ export declare const FiatPriceAPI = "https://api.dodoex.io/frontend-price-api-v2/current/batch";
16
108
  export declare function getAPIService(key: APIServiceKey, serviceProps?: Partial<APIServices>): string;
17
109
  export declare const contractRequests: ContractRequests;
18
- export declare const tokenContractRequests: ContractRequests;
19
110
  export declare const tokenApi: TokenApi;
@@ -1,51 +1,18 @@
1
1
  import { ChainId } from '@dodoex/api';
2
2
  import { AppKitNetwork } from '@reown/appkit/networks';
3
3
  import { ReactComponent as ETHereumLogo } from '../assets/logo/networks/eth.svg';
4
- export declare const zetachainTestnet: {
5
- blockExplorers: {
6
- readonly default: {
7
- readonly name: "ZetaScan";
8
- readonly url: "https://zetachain-testnet.blockscout.com";
9
- };
10
- };
11
- contracts: {
12
- readonly multicall3: {
13
- readonly address: "0xcA11bde05977b3631167028862bE2a173976CA11";
14
- readonly blockCreated: 2715217;
15
- };
16
- };
17
- ensTlds?: readonly string[] | undefined;
18
- name: "ZetaChain testnet";
19
- nativeCurrency: {
20
- readonly decimals: 18;
21
- readonly name: "tZETA";
22
- readonly symbol: "tZETA";
23
- };
24
- rpcUrls: {
25
- readonly default: {
26
- readonly http: readonly ["https://zetachain-athens-evm.blockpi.network/v1/rpc/public"];
27
- };
28
- };
29
- sourceId?: number | undefined;
30
- testnet: true;
31
- custom?: Record<string, unknown> | undefined;
32
- fees?: import("viem").ChainFees<undefined> | undefined;
33
- formatters?: undefined;
34
- serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
35
- id: 7001;
36
- chainNamespace: "eip155";
37
- caipNetworkId: "eip155:7001";
38
- assets?: {
39
- imageId: string | undefined;
40
- imageUrl: string | undefined;
41
- } | undefined;
42
- };
43
4
  export interface ChainListItem {
44
5
  chainId: ChainId;
45
6
  logo: typeof ETHereumLogo;
46
7
  name: string;
47
8
  mainnet?: ChainId;
48
9
  caipNetwork: AppKitNetwork;
10
+ isEVMChain: boolean;
11
+ isSolanaChain: boolean;
12
+ isBTCChain: boolean;
13
+ isTestNet: boolean;
14
+ /** 未链接钱包时,使用该地址 */
15
+ fallbackAddress: string;
49
16
  }
50
17
  export declare const chainListMap: Map<ChainId, ChainListItem>;
51
18
  export declare const isTestNet: (chainId: ChainId) => boolean;
@@ -1,5 +1,5 @@
1
1
  import { ChainId } from '@dodoex/api';
2
- export { etherTokenAddress, basicTokenMap } from '@dodoex/api';
2
+ export { basicTokenMap, etherTokenAddress } from '@dodoex/api';
3
3
  export declare const rpcServerMap: {
4
4
  [key in ChainId]: Array<string>;
5
5
  };
@@ -1,2 +1,3 @@
1
+ export declare const POOLS_LIST_TOP_TAB = "DODO_WIDGET_POOL_LIST_TOP_TAB";
1
2
  export declare const POOLS_LIST_TAB = "DODO_WIDGET_POOL_LIST_TAB";
2
3
  export declare const POOLS_LIST_FILTER_CHAIN = "DODO_WIDGET_POOLS_LIST_FILTER_CHAIN";
@@ -1,12 +1,8 @@
1
- declare const _default: {
1
+ import { TokenInfo } from '../hooks/Token';
2
+ declare const tokenList: (TokenInfo & {
2
3
  id: number;
3
- name: string;
4
- address: string;
5
- symbol: string;
6
- decimals: number;
7
4
  logo: string;
8
- chainId: number;
9
5
  position: number;
10
- slippage: null;
11
- }[];
12
- export default _default;
6
+ slippage: number | null;
7
+ })[];
8
+ export default tokenList;
@@ -1,28 +1,8 @@
1
+ import { GraphQLRequests } from '@dodoex/api';
1
2
  import { BridgeRouteI } from './useFetchRoutePriceBridge';
2
- export interface BridgeOrderCreateParams {
3
- fromChainId: number;
4
- fromAmount: string;
5
- fromTokenAddress: string;
6
- toChainId: number;
7
- toAmount: string;
8
- toTokenAddress: string;
9
- fromAddress: string;
10
- toAddress: string;
11
- slippage: number;
12
- hash: string;
13
- product: string | null;
14
- extend: {
15
- lifiBridge: BridgeRouteI['sourceRoute']['step']['tool'];
16
- route: BridgeRouteI['sourceRoute'];
17
- productParams: BridgeRouteI['productParams'];
18
- encodeId: string;
19
- source: string;
20
- };
21
- }
22
- export declare function createBridgeOrder({ apikey, tx, route, bridgeCreateRouteAPI, encodeId, }: {
23
- apikey?: string;
3
+ export declare function createBridgeOrder({ graphQLRequests, tx, route, calldata, }: {
4
+ graphQLRequests: GraphQLRequests;
24
5
  tx: string;
25
6
  route: BridgeRouteI;
26
- bridgeCreateRouteAPI: string;
27
- encodeId: string;
28
- }): Promise<any>;
7
+ calldata: string;
8
+ }): Promise<boolean | null | undefined>;
@@ -1,7 +1,6 @@
1
1
  import { BridgeTXRequest } from '../../components/Bridge/BridgeSummaryDialog';
2
2
  import { BridgeRouteI } from './useFetchRoutePriceBridge';
3
- import { Metadata } from '../Submission/types';
4
3
  export default function useExecuteBridgeRoute({ route, bridgeOrderTxRequest, }: {
5
4
  route?: BridgeRouteI;
6
5
  bridgeOrderTxRequest?: BridgeTXRequest;
7
- }): (metadata?: Metadata) => Promise<import("../Submission/types").ExecutionResult> | undefined;
6
+ }): () => Promise<import("../Submission/types").ExecutionResult> | undefined;
@@ -0,0 +1,9 @@
1
+ import { BridgeRouteI } from './useFetchRoutePriceBridge';
2
+ export declare function useFeeList({ fees }: {
3
+ fees: BridgeRouteI['fees'];
4
+ }): {
5
+ key: "btcDepositFee" | "platformFee" | "destinationFee" | "protocolFees" | "svmRentFee";
6
+ title: string;
7
+ value: string | null;
8
+ isFree: boolean;
9
+ }[];
@@ -1,53 +1,81 @@
1
- import { TokenInfo } from '../Token';
1
+ import { Cross_Chain_Swap_Zetachain_RoutesQuery } from '@dodoex/api';
2
2
  import BigNumber from 'bignumber.js';
3
- export interface BridgeRouteI {
4
- /** update */
5
- key: string;
6
- /** only one */
7
- id: string;
8
- fromToken: TokenInfo;
9
- toToken: TokenInfo;
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
- toChainId: number;
12
- /** from parameter */
26
+ fromTokenAddress: string;
13
27
  fromAmount: string;
14
- toTokenAmount: BigNumber;
15
- /** from parameter */
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
- /** in seconds */
22
- roundedRouteCostTime: number;
23
- /** approve contract address */
24
- spenderContractAddress: string;
25
- /** USD */
26
- feeUSD: string | null;
27
- /** in seconds */
28
- executionDuration: number | null;
29
- /** one-click */
30
- step: BridgeStep;
31
- encodeParams: any;
32
- productParams: any;
33
- sourceRoute: {
34
- toAmount: string;
35
- feeUSD: string | null;
36
- executionDuration: number | null;
37
- step: {
38
- tool: string;
39
- toolDetails: {
40
- logoURI: string | null;
41
- name: string | null;
42
- key: string | null;
43
- };
44
- type: string | null;
45
- approvalAddress: string;
46
- includedSteps: any;
47
- };
48
- fee: any;
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: Pick<BridgeTokenI, 'address' | 'symbol' | 'chainId' | 'decimals'>;
68
- toToken: Pick<BridgeTokenI, 'address' | 'symbol' | 'chainId' | 'decimals'>;
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({ toToken, fromToken, fromAmount, }: FetchRoutePrice): {
182
+ export declare function useFetchRoutePriceBridge({ fromAccount, toAccount, fromToken, toToken, fromAmount, enabled, slippage, }: FetchRoutePrice): {
99
183
  status: RoutePriceStatus;
100
- refetch: () => Promise<void>;
101
- bridgeRouteList: BridgeRouteI[];
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): boolean;
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;