@dodoex/widgets 2.3.3 → 2.3.5-0

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 (137) hide show
  1. package/dist/608a45433384d12e.png +0 -0
  2. package/dist/b08d68f421a81726.png +0 -0
  3. package/dist/cjs/608a45433384d12e.png +0 -0
  4. package/dist/cjs/b08d68f421a81726.png +0 -0
  5. package/dist/cjs/e63d558f5364d137.svg +10 -0
  6. package/dist/cjs/index.cjs +9 -8
  7. package/dist/cjs/locales/en-US.js +1 -1
  8. package/dist/cjs/src/components/Bridge/BridgeRouteShortCard.d.ts +6 -0
  9. package/dist/cjs/src/components/Bridge/BridgeSummaryDialog/BridgeSummaryDetail.d.ts +5 -0
  10. package/dist/cjs/src/components/Bridge/BridgeSummaryDialog/index.d.ts +17 -0
  11. package/dist/cjs/src/components/Bridge/BridgeSummaryDialog/orderInfoModal/CrossStep.d.ts +16 -0
  12. package/dist/cjs/src/components/Bridge/BridgeSummaryDialog/orderInfoModal/EtherscanLinkButton.d.ts +6 -0
  13. package/dist/cjs/src/components/Bridge/BridgeSummaryDialog/orderInfoModal/RouteSteps.d.ts +6 -0
  14. package/dist/cjs/src/components/Bridge/BridgeSummaryDialog/orderInfoModal/SwapStep.d.ts +14 -0
  15. package/dist/cjs/src/components/Bridge/SelectBridgeDialog/BridgeLogo.d.ts +10 -0
  16. package/dist/cjs/src/components/Bridge/SelectBridgeDialog/DirectionLine.d.ts +4 -0
  17. package/dist/cjs/src/components/Bridge/SelectBridgeDialog/RouteCard.d.ts +21 -0
  18. package/dist/cjs/src/components/Bridge/SelectBridgeDialog/RouteTagList.d.ts +12 -0
  19. package/dist/cjs/src/components/Bridge/SelectBridgeDialog/TokenWithChain.d.ts +11 -0
  20. package/dist/cjs/src/components/Bridge/SelectBridgeDialog/index.d.ts +9 -0
  21. package/dist/cjs/src/components/Bridge/SelectBridgeDialog/productList.d.ts +5 -0
  22. package/dist/cjs/src/components/ErrorMessageDialog.d.ts +5 -0
  23. package/dist/cjs/src/components/Swap/components/SettingsDialog/index.d.ts +2 -1
  24. package/dist/cjs/src/components/Swap/components/TokenCard/TokenLogoCollapse.d.ts +2 -1
  25. package/dist/cjs/src/components/Swap/components/TokenCard/TokenPickerDialog.d.ts +2 -1
  26. package/dist/cjs/src/components/Swap/components/TokenCard/index.d.ts +4 -1
  27. package/dist/cjs/src/components/SwitchChainDialog/index.d.ts +7 -0
  28. package/dist/cjs/src/components/TokenLogo.d.ts +2 -1
  29. package/dist/cjs/src/components/TokenPicker/SelectChainItem.d.ts +7 -0
  30. package/dist/cjs/src/components/TokenPicker/index.d.ts +2 -1
  31. package/dist/cjs/src/constants/api.d.ts +3 -0
  32. package/dist/cjs/src/constants/chainList.d.ts +10 -0
  33. package/dist/cjs/src/constants/chains.d.ts +5 -70
  34. package/dist/cjs/src/constants/localstorage.d.ts +2 -0
  35. package/dist/cjs/src/constants/swap.d.ts +1 -0
  36. package/dist/cjs/src/hooks/Bridge/createBridgeOrder.d.ts +24 -0
  37. package/dist/cjs/src/hooks/Bridge/index.d.ts +4 -0
  38. package/dist/cjs/src/hooks/Bridge/useExecuteBridgeRoute.d.ts +6 -0
  39. package/dist/cjs/src/hooks/Bridge/useFetchRoutePriceBridge.d.ts +101 -0
  40. package/dist/cjs/src/hooks/Bridge/useFetchRoutePriceBridge.test.d.ts +1 -0
  41. package/dist/cjs/src/hooks/Bridge/useSendRoute.d.ts +16 -0
  42. package/dist/cjs/src/hooks/Bridge/useSwitchBridgeOrSwapSlippage.d.ts +1 -0
  43. package/dist/cjs/src/hooks/ConnectWallet/useSwitchChain.d.ts +10 -0
  44. package/dist/cjs/src/hooks/Submission/types.d.ts +2 -1
  45. package/dist/cjs/src/hooks/Submission/useExecution.d.ts +1 -1
  46. package/dist/cjs/src/hooks/Token/type.d.ts +1 -3
  47. package/dist/cjs/src/hooks/Token/useFetchTokenAllowance.d.ts +13 -0
  48. package/dist/cjs/src/hooks/Token/useGetCGTokenList.d.ts +6 -4
  49. package/dist/cjs/src/hooks/Token/useInitTokenList.d.ts +1 -1
  50. package/dist/cjs/src/hooks/Token/useSelectChainList.d.ts +77 -0
  51. package/dist/cjs/src/hooks/Token/useSelectChainList.test.d.ts +1 -0
  52. package/dist/cjs/src/hooks/Token/useTokenList.d.ts +5 -1
  53. package/dist/cjs/src/hooks/Token/useTokenListFetchBalance.d.ts +9 -0
  54. package/dist/cjs/src/hooks/Widget/useInitPropsToRedux.d.ts +1 -1
  55. package/dist/cjs/src/hooks/contract/contractConfig.d.ts +1 -26
  56. package/dist/cjs/src/hooks/contract/index.d.ts +1 -0
  57. package/dist/cjs/src/hooks/contract/token.d.ts +10 -0
  58. package/dist/cjs/src/hooks/contract/useFetchETHBalance.d.ts +1 -1
  59. package/dist/cjs/src/hooks/contract/useFetchTokens.d.ts +3 -1
  60. package/dist/cjs/src/hooks/contract/useMultiContract.d.ts +1 -21
  61. package/dist/cjs/src/store/actions/globals.d.ts +1 -0
  62. package/dist/cjs/src/store/actions/token.d.ts +1 -1
  63. package/dist/cjs/src/store/reducers/globals.d.ts +2 -0
  64. package/dist/cjs/src/store/reducers/token.d.ts +3 -1
  65. package/dist/cjs/src/store/selectors/globals.d.ts +1 -0
  66. package/dist/cjs/src/store/selectors/token.d.ts +3 -1
  67. package/dist/cjs/src/utils/address.d.ts +7 -0
  68. package/dist/cjs/src/utils/formatter.d.ts +2 -0
  69. package/dist/cjs/src/utils/time.d.ts +9 -0
  70. package/dist/cjs/src/utils/time.test.d.ts +1 -0
  71. package/dist/e63d558f5364d137.svg +10 -0
  72. package/dist/index.js +9 -8
  73. package/dist/locales/en-US.js +1 -1
  74. package/dist/src/components/Bridge/BridgeRouteShortCard.d.ts +6 -0
  75. package/dist/src/components/Bridge/BridgeSummaryDialog/BridgeSummaryDetail.d.ts +5 -0
  76. package/dist/src/components/Bridge/BridgeSummaryDialog/index.d.ts +17 -0
  77. package/dist/src/components/Bridge/BridgeSummaryDialog/orderInfoModal/CrossStep.d.ts +16 -0
  78. package/dist/src/components/Bridge/BridgeSummaryDialog/orderInfoModal/EtherscanLinkButton.d.ts +6 -0
  79. package/dist/src/components/Bridge/BridgeSummaryDialog/orderInfoModal/RouteSteps.d.ts +6 -0
  80. package/dist/src/components/Bridge/BridgeSummaryDialog/orderInfoModal/SwapStep.d.ts +14 -0
  81. package/dist/src/components/Bridge/SelectBridgeDialog/BridgeLogo.d.ts +10 -0
  82. package/dist/src/components/Bridge/SelectBridgeDialog/DirectionLine.d.ts +4 -0
  83. package/dist/src/components/Bridge/SelectBridgeDialog/RouteCard.d.ts +21 -0
  84. package/dist/src/components/Bridge/SelectBridgeDialog/RouteTagList.d.ts +12 -0
  85. package/dist/src/components/Bridge/SelectBridgeDialog/TokenWithChain.d.ts +11 -0
  86. package/dist/src/components/Bridge/SelectBridgeDialog/index.d.ts +9 -0
  87. package/dist/src/components/Bridge/SelectBridgeDialog/productList.d.ts +5 -0
  88. package/dist/src/components/ErrorMessageDialog.d.ts +5 -0
  89. package/dist/src/components/Swap/components/SettingsDialog/index.d.ts +2 -1
  90. package/dist/src/components/Swap/components/TokenCard/TokenLogoCollapse.d.ts +2 -1
  91. package/dist/src/components/Swap/components/TokenCard/TokenPickerDialog.d.ts +2 -1
  92. package/dist/src/components/Swap/components/TokenCard/index.d.ts +4 -1
  93. package/dist/src/components/SwitchChainDialog/index.d.ts +7 -0
  94. package/dist/src/components/TokenLogo.d.ts +2 -1
  95. package/dist/src/components/TokenPicker/SelectChainItem.d.ts +7 -0
  96. package/dist/src/components/TokenPicker/index.d.ts +2 -1
  97. package/dist/src/constants/api.d.ts +3 -0
  98. package/dist/src/constants/chainList.d.ts +10 -0
  99. package/dist/src/constants/chains.d.ts +5 -70
  100. package/dist/src/constants/localstorage.d.ts +2 -0
  101. package/dist/src/constants/swap.d.ts +1 -0
  102. package/dist/src/hooks/Bridge/createBridgeOrder.d.ts +24 -0
  103. package/dist/src/hooks/Bridge/index.d.ts +4 -0
  104. package/dist/src/hooks/Bridge/useExecuteBridgeRoute.d.ts +6 -0
  105. package/dist/src/hooks/Bridge/useFetchRoutePriceBridge.d.ts +101 -0
  106. package/dist/src/hooks/Bridge/useFetchRoutePriceBridge.test.d.ts +1 -0
  107. package/dist/src/hooks/Bridge/useSendRoute.d.ts +16 -0
  108. package/dist/src/hooks/Bridge/useSwitchBridgeOrSwapSlippage.d.ts +1 -0
  109. package/dist/src/hooks/ConnectWallet/useSwitchChain.d.ts +10 -0
  110. package/dist/src/hooks/Submission/types.d.ts +2 -1
  111. package/dist/src/hooks/Submission/useExecution.d.ts +1 -1
  112. package/dist/src/hooks/Token/type.d.ts +1 -3
  113. package/dist/src/hooks/Token/useFetchTokenAllowance.d.ts +13 -0
  114. package/dist/src/hooks/Token/useGetCGTokenList.d.ts +6 -4
  115. package/dist/src/hooks/Token/useInitTokenList.d.ts +1 -1
  116. package/dist/src/hooks/Token/useSelectChainList.d.ts +77 -0
  117. package/dist/src/hooks/Token/useSelectChainList.test.d.ts +1 -0
  118. package/dist/src/hooks/Token/useTokenList.d.ts +5 -1
  119. package/dist/src/hooks/Token/useTokenListFetchBalance.d.ts +9 -0
  120. package/dist/src/hooks/Widget/useInitPropsToRedux.d.ts +1 -1
  121. package/dist/src/hooks/contract/contractConfig.d.ts +1 -26
  122. package/dist/src/hooks/contract/index.d.ts +1 -0
  123. package/dist/src/hooks/contract/token.d.ts +10 -0
  124. package/dist/src/hooks/contract/useFetchETHBalance.d.ts +1 -1
  125. package/dist/src/hooks/contract/useFetchTokens.d.ts +3 -1
  126. package/dist/src/hooks/contract/useMultiContract.d.ts +1 -21
  127. package/dist/src/store/actions/globals.d.ts +1 -0
  128. package/dist/src/store/actions/token.d.ts +1 -1
  129. package/dist/src/store/reducers/globals.d.ts +2 -0
  130. package/dist/src/store/reducers/token.d.ts +3 -1
  131. package/dist/src/store/selectors/globals.d.ts +1 -0
  132. package/dist/src/store/selectors/token.d.ts +3 -1
  133. package/dist/src/utils/address.d.ts +7 -0
  134. package/dist/src/utils/formatter.d.ts +2 -0
  135. package/dist/src/utils/time.d.ts +9 -0
  136. package/dist/src/utils/time.test.d.ts +1 -0
  137. package/package.json +4 -6
@@ -1,5 +1,5 @@
1
1
  /*eslint-disable*/
2
2
 
3
- var enUS={messages:{"Additional Fee":"Additional Fee","Additional routing fees set by the Widget user":"Additional routing fees set by the Widget user","Approve":"Approve","Approving":"Approving","Attention: High slippage tolerance will increase the success rate of transaction, but might not get the best quote.":"Attention: High slippage tolerance will increase the success rate of transaction, but might not get the best quote.","Balance:":"Balance:","Basic Fee":"Basic Fee","Close":"Close","Confirm swap":"Confirm swap","Confirming":"Confirming","Connect to a wallet":"Connect to a wallet","Connect to your wallet":"Connect to your wallet","Connect to your {0} Wallet":["Connect to your ",["0"]," Wallet"],"Current price impact":"Current price impact","Dismiss":"Dismiss","Due to the market condition, market price and estimated price may have a slight difference":"Due to the market condition, market price and estimated price may have a slight difference","Enter an amount":"Enter an amount","Enter the token symbol or address":"Enter the token symbol or address","Estimated service provider fees":"Estimated service provider fees","Fetching Price...":"Fetching Price...","Fetching best price...":"Fetching best price...","ForceStop exception":"ForceStop exception","Gas price is too low, please adjust in your wallet and try again":"Gas price is too low, please adjust in your wallet and try again","High slippage tolerance will increase the success rate of transaction, but might not get the best quote.":"High slippage tolerance will increase the success rate of transaction, but might not get the best quote.","If your transaction time exceeds the deadline, your transaction will be rescinded.":"If your transaction time exceeds the deadline, your transaction will be rescinded.","Insufficient balance":"Insufficient balance","Insufficient funds - Please retry after depositing more {EtherTokenSymbol} into your wallet":["Insufficient funds - Please retry after depositing more ",["EtherTokenSymbol"]," into your wallet"],"Max":"Max","Maximum slippage do not exceed 50%":"Maximum slippage do not exceed 50%","No ForceStop access":"No ForceStop access","Powered by DODO protocol":"Powered by DODO protocol","Price Impact":"Price Impact","Price impact exceeds the slippage tolerance you set. Try increasing the slippage tolerance.":"Price impact exceeds the slippage tolerance you set. Try increasing the slippage tolerance.","Price impact reaches <0>{priceImpact}</0>%, accept the quote":["Price impact reaches <0>",["priceImpact"],"</0>%, accept the quote"],"Quote not available":"Quote not available","RPC node data exception":"RPC node data exception","Reset":"Reset","Review Swap":"Review Swap","SELECT TOKEN":"SELECT TOKEN","SafeERC20: low-level call failed. Please contact the DODO team.":"SafeERC20: low-level call failed. Please contact the DODO team.","SafeERC20: low-level call failed. Please log a Zendesk support ticket or contact the DODO team.":"SafeERC20: low-level call failed. Please log a Zendesk support ticket or contact the DODO team.","Select Tokens":"Select Tokens","Select a token":"Select a token","Service update, please wait and try again":"Service update, please wait and try again","Settings":"Settings","Slippage":"Slippage","Slippage Tolerance":"Slippage Tolerance","Something went wrong.":"Something went wrong.","Swap":"Swap","Swap Detail":"Swap Detail","Swap summary":"Swap summary","This CP has been settled by other addrs":"This CP has been settled by other addrs","Transaction Deadline":"Transaction Deadline","Transaction Pending":"Transaction Pending","Transaction Time:":"Transaction Time:","Transaction rejected.":"Transaction rejected.","Tx":"Tx","Unable to SETTLE during the cooling-off period":"Unable to SETTLE during the cooling-off period","Unsupported network - switch to trade":"Unsupported network - switch to trade","User denied transaction signature.":"User denied transaction signature.","View on Etherscan":"View on Etherscan","Wallet incompatibility":"Wallet incompatibility","{0} confirmed":[["0"]," confirmed"],"{0} pending":[["0"]," pending"],"{DEFAULT_SWAP_DDL} minutes":[["DEFAULT_SWAP_DDL"]," minutes"]}};
3
+ var enUS={messages:{".":".","Additional Fee":"Additional Fee","Additional routing fees set by the Widget user":"Additional routing fees set by the Widget user","Approve":"Approve","Approving":"Approving","Are you sure swapping to another chain?":"Are you sure swapping to another chain?","Attention: High slippage tolerance will increase the success rate of transaction, but might not get the best quote.":"Attention: High slippage tolerance will increase the success rate of transaction, but might not get the best quote.","Auto switch network":"Auto switch network","Balance:":"Balance:","Basic Fee":"Basic Fee","Best offer":"Best offer","Bridge":"Bridge","Bridge Summary":"Bridge Summary","Cancel":"Cancel","Close":"Close","Confirm":"Confirm","Confirm Bridge":"Confirm Bridge","Confirm swap":"Confirm swap","Confirming":"Confirming","Connect to a wallet":"Connect to a wallet","Connect to your wallet":"Connect to your wallet","Connect to your {0} Wallet":["Connect to your ",["0"]," Wallet"],"Current price impact":"Current price impact","Day":"Day","Days":"Days","Destination":"Destination","Detail":"Detail","Dismiss":"Dismiss","Due to the market condition, market price and estimated price may have a slight difference":"Due to the market condition, market price and estimated price may have a slight difference","Enter an amount":"Enter an amount","Enter the token symbol or address":"Enter the token symbol or address","Estimated Time":"Estimated Time","Estimated service provider fees":"Estimated service provider fees","Estimated transaction time":"Estimated transaction time","Fee":"Fee","Fee includes: Bridge fees + Swap fees. Gas fee not included.":"Fee includes: Bridge fees + Swap fees. Gas fee not included.","Fetching Price...":"Fetching Price...","Fetching best price...":"Fetching best price...","For":"For","ForceStop exception":"ForceStop exception","Gas price is too low, please adjust in your wallet and try again":"Gas price is too low, please adjust in your wallet and try again","High slippage tolerance will increase the success rate of transaction, but might not get the best quote.":"High slippage tolerance will increase the success rate of transaction, but might not get the best quote.","Hour":"Hour","Hours":"Hours","If your transaction time exceeds the deadline, your transaction will be rescinded.":"If your transaction time exceeds the deadline, your transaction will be rescinded.","Insufficient balance":"Insufficient balance","Insufficient cross-chain fees, need at least {0} {1}":["Insufficient cross-chain fees, need at least ",["0"]," ",["1"]],"Insufficient funds - Please retry after depositing more {EtherTokenSymbol} into your wallet":["Insufficient funds - Please retry after depositing more ",["EtherTokenSymbol"]," into your wallet"],"Max":"Max","Maximum slippage do not exceed 50%":"Maximum slippage do not exceed 50%","Min":"Min","Mins":"Mins","Minute":"Minute","Minutes":"Minutes","No ForceStop access":"No ForceStop access","On":"On","Powered by DODO protocol":"Powered by DODO protocol","Price Impact":"Price Impact","Price impact exceeds the slippage tolerance you set. Try increasing the slippage tolerance.":"Price impact exceeds the slippage tolerance you set. Try increasing the slippage tolerance.","Price impact reaches <0>{priceImpact}</0>%, accept the quote":["Price impact reaches <0>",["priceImpact"],"</0>%, accept the quote"],"Quote not available":"Quote not available","RPC node data exception":"RPC node data exception","Reset":"Reset","Review Bridge":"Review Bridge","Review Swap":"Review Swap","SELECT TOKEN":"SELECT TOKEN","SafeERC20: low-level call failed. Please contact the DODO team.":"SafeERC20: low-level call failed. Please contact the DODO team.","SafeERC20: low-level call failed. Please log a Zendesk support ticket or contact the DODO team.":"SafeERC20: low-level call failed. Please log a Zendesk support ticket or contact the DODO team.","Second":"Second","Seconds":"Seconds","Select Bridge":"Select Bridge","Select Tokens":"Select Tokens","Select a token":"Select a token","Send to:":"Send to:","Service update, please wait and try again":"Service update, please wait and try again","Settings":"Settings","Slippage":"Slippage","Slippage Tolerance":"Slippage Tolerance","Something went wrong.":"Something went wrong.","Source":"Source","Swap":"Swap","Swap Detail":"Swap Detail","Swap summary":"Swap summary","The current network is inconsistent with the wallet - please switch in wallet":"The current network is inconsistent with the wallet - please switch in wallet","The setting has been switched to bridge mode":"The setting has been switched to bridge mode","The setting has been switched to swap mode":"The setting has been switched to swap mode","This CP has been settled by other addrs":"This CP has been settled by other addrs","This token is on":"This token is on","To":"To","Transaction Deadline":"Transaction Deadline","Transaction Pending":"Transaction Pending","Transaction Time:":"Transaction Time:","Transaction rejected.":"Transaction rejected.","Tx":"Tx","Unable to SETTLE during the cooling-off period":"Unable to SETTLE during the cooling-off period","Unapproved":"Unapproved","Unsupported network - switch to trade":"Unsupported network - switch to trade","User denied transaction signature.":"User denied transaction signature.","View on Etherscan":"View on Etherscan","Wallet incompatibility":"Wallet incompatibility","on":"on","s":"s","{0} confirmed":[["0"]," confirmed"],"{0} pending":[["0"]," pending"],"{DEFAULT_SWAP_DDL} minutes":[["DEFAULT_SWAP_DDL"]," minutes"]}};
4
4
 
5
5
  export { enUS as default };
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { BridgeRouteI } from '../../hooks/Bridge';
3
+ export default function BridgeRouteShortCard({ route, onClick, }: {
4
+ route?: BridgeRouteI;
5
+ onClick: () => void;
6
+ }): JSX.Element | null;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { BridgeRouteI } from '../../../hooks/Bridge/useFetchRoutePriceBridge';
3
+ export default function BridgeSummaryDetail({ route, }: {
4
+ route: BridgeRouteI;
5
+ }): JSX.Element;
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ import { BridgeRouteI } from '../../../hooks/Bridge/useFetchRoutePriceBridge';
3
+ export interface BridgeTXRequest {
4
+ data: string;
5
+ to: string;
6
+ value: string;
7
+ from: string;
8
+ chainId: number;
9
+ }
10
+ export default function BridgeSummaryDialog({ open, onClose, route, bridgeOrderTxRequest, clearToAmt, clearFromAmt, }: {
11
+ open: boolean;
12
+ onClose: () => void;
13
+ route?: BridgeRouteI;
14
+ bridgeOrderTxRequest?: BridgeTXRequest;
15
+ clearToAmt: () => void;
16
+ clearFromAmt: () => void;
17
+ }): JSX.Element;
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ import BigNumber from 'bignumber.js';
3
+ import { BridgeStepTool } from '../../../../hooks/Bridge/useFetchRoutePriceBridge';
4
+ export declare function CrossStep({ fromChainId, toChainId, fromTokenAmount, toTokenAmount, fromTokenDecimals, fromTokenSymbol, toTokenDecimals, toTokenSymbol, fromHash, toHash, toolDetails, }: {
5
+ fromChainId: number;
6
+ toChainId: number;
7
+ fromTokenAmount: BigNumber;
8
+ toTokenAmount: BigNumber;
9
+ fromTokenSymbol: string;
10
+ fromTokenDecimals: number;
11
+ toTokenSymbol: string;
12
+ toTokenDecimals: number;
13
+ fromHash: string | null;
14
+ toHash: string | null;
15
+ toolDetails: BridgeStepTool;
16
+ }): JSX.Element;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ export declare function EtherscanLinkButton({ chainId, address, children, }: {
3
+ chainId: number;
4
+ address: string | null;
5
+ children: React.ReactNode;
6
+ }): JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { CSSProperties } from 'react';
2
+ import { BridgeRouteI } from '../../../../hooks/Bridge';
3
+ export declare function RouteSteps({ marginTop, route, }: {
4
+ marginTop?: CSSProperties['marginTop'];
5
+ route: BridgeRouteI;
6
+ }): JSX.Element;
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ import BigNumber from 'bignumber.js';
3
+ import { BridgeStepTool } from '../../../../hooks/Bridge/useFetchRoutePriceBridge';
4
+ export declare function SwapStep({ chainId, fromTokenAmount, toTokenAmount, fromTokenDecimals, fromTokenSymbol, toTokenDecimals, toTokenSymbol, hash, toolDetails, }: {
5
+ chainId: number;
6
+ fromTokenAmount: BigNumber;
7
+ toTokenAmount: BigNumber;
8
+ fromTokenSymbol: string;
9
+ fromTokenDecimals: number;
10
+ toTokenSymbol: string;
11
+ toTokenDecimals: number;
12
+ hash: string | null;
13
+ toolDetails: BridgeStepTool;
14
+ }): JSX.Element;
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { BoxProps } from '@dodoex/components';
3
+ import { BridgeStep } from '../../../hooks/Bridge/useFetchRoutePriceBridge';
4
+ export declare function BridgeLogo({ size, toolDetails, nameMarginLeft, logoMarginLeft, nameSx, }: {
5
+ size: 'small' | 'medium' | 'large';
6
+ toolDetails: BridgeStep['toolDetails'] | null | undefined;
7
+ nameMarginLeft?: number;
8
+ logoMarginLeft?: number;
9
+ nameSx?: BoxProps['sx'];
10
+ }): JSX.Element | null;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export declare function DirectionLine({ children }: {
3
+ children: React.ReactNode;
4
+ }): JSX.Element;
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ import BigNumber from 'bignumber.js';
3
+ import { BridgeRouteI } from '../../../hooks/Bridge/useFetchRoutePriceBridge';
4
+ import { TokenInfo } from '../../../hooks/Token/type';
5
+ export default function RouteCard({ fromToken, toToken, fromChainId, toChainId, fromAmount, fromTokenBalance, toTokenAmount, toolDetails, product, executionDuration, feeUSD, selected, setSelected, spenderContractAddress, isBestPrice, }: {
6
+ fromToken?: TokenInfo;
7
+ toToken?: TokenInfo;
8
+ fromChainId: number;
9
+ toChainId: number;
10
+ fromAmount?: BridgeRouteI['fromAmount'];
11
+ fromTokenBalance: BigNumber | null;
12
+ toTokenAmount?: BigNumber | null;
13
+ toolDetails: BridgeRouteI['step']['toolDetails'];
14
+ product: BridgeRouteI['product'];
15
+ executionDuration: BridgeRouteI['executionDuration'];
16
+ feeUSD: BridgeRouteI['feeUSD'];
17
+ selected: boolean;
18
+ setSelected: () => void;
19
+ spenderContractAddress: string;
20
+ isBestPrice?: boolean;
21
+ }): JSX.Element;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { BridgeStep } from '../../../hooks/Bridge/useFetchRoutePriceBridge';
3
+ export interface RouteTag {
4
+ type: 'best-price' | 'no-approve';
5
+ toolDetails?: BridgeStep['toolDetails'] | null;
6
+ }
7
+ /**
8
+ * 路径 tag 列表
9
+ */
10
+ export declare function RouteTagList({ routeTagList }: {
11
+ routeTagList: RouteTag[];
12
+ }): JSX.Element;
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import BigNumber from 'bignumber.js';
3
+ import { TokenInfo } from '../../../hooks/Token';
4
+ /**
5
+ * token 数量附带有 chain 名称和 logo
6
+ */
7
+ export declare function TokenWithChain({ chainId, token, amount, }: {
8
+ chainId: number;
9
+ token?: TokenInfo;
10
+ amount?: string | null | BigNumber;
11
+ }): JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ import { BridgeRouteI } from '../../../hooks/Bridge/useFetchRoutePriceBridge';
3
+ export default function SelectBridgeDialog({ open, onClose, selectedRouteId, setSelectRouteId, bridgeRouteList, }: {
4
+ open: boolean;
5
+ onClose: () => void;
6
+ selectedRouteId: string;
7
+ setSelectRouteId: Dispatch<SetStateAction<string>>;
8
+ bridgeRouteList: Array<BridgeRouteI>;
9
+ }): JSX.Element;
@@ -0,0 +1,5 @@
1
+ export declare const productList: {
2
+ id: string;
3
+ logoURI: string;
4
+ name: string;
5
+ }[];
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export default function ErrorMessageDialog({ message, onClose, }: {
3
+ message?: string;
4
+ onClose: () => void;
5
+ }): JSX.Element;
@@ -2,5 +2,6 @@
2
2
  export interface SettingsDialogProps {
3
3
  open: boolean;
4
4
  onClose: () => void;
5
+ isBridge: boolean;
5
6
  }
6
- export declare function SettingsDialog({ open, onClose }: SettingsDialogProps): JSX.Element;
7
+ export declare function SettingsDialog({ open, onClose, isBridge, }: SettingsDialogProps): JSX.Element;
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { TokenPickerProps } from '../../../TokenPicker';
3
- export declare function TokenLogoCollapse({ token, onClick, }: {
3
+ export declare function TokenLogoCollapse({ token, onClick, showChainLogo, }: {
4
4
  token?: TokenPickerProps['value'];
5
5
  onClick?: React.MouseEventHandler<HTMLButtonElement>;
6
+ showChainLogo?: boolean;
6
7
  }): JSX.Element;
@@ -1,11 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { TokenPickerProps } from '../../../TokenPicker';
3
3
  import { DialogProps } from '../Dialog';
4
- export declare function TokenPickerDialog({ open, value, onClose, occupiedAddrs, onTokenChange, side, }: {
4
+ export declare function TokenPickerDialog({ open, value, onClose, occupiedAddrs, onTokenChange, side, defaultLoadBalance, }: {
5
5
  open: boolean;
6
6
  occupiedAddrs?: string[];
7
7
  onClose: DialogProps['onClose'];
8
8
  value?: TokenPickerProps['value'];
9
9
  onTokenChange: TokenPickerProps['onChange'];
10
10
  side?: TokenPickerProps['side'];
11
+ defaultLoadBalance?: boolean;
11
12
  }): JSX.Element;
@@ -15,5 +15,8 @@ export interface TokenCardProps {
15
15
  onTokenClick?: () => void;
16
16
  onTokenChange: TokenPickerProps['onChange'];
17
17
  side?: TokenPickerProps['side'];
18
+ showChainLogo?: boolean;
19
+ onlyCurrentChain?: boolean;
20
+ defaultLoadBalance?: boolean;
18
21
  }
19
- export declare function TokenCard({ sx, amt, token, readOnly, showMaxBtn, onMaxClick, fiatPriceTxt, occupiedAddrs, onInputFocus, onTokenClick, onInputChange, onTokenChange, side, }: TokenCardProps): JSX.Element;
22
+ export declare function TokenCard({ sx, amt, token, readOnly, showMaxBtn, onMaxClick, fiatPriceTxt, occupiedAddrs, onInputFocus, onTokenClick, onInputChange, onTokenChange, side, showChainLogo, onlyCurrentChain, defaultLoadBalance, }: TokenCardProps): JSX.Element;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { ChainId } from '../../constants/chains';
3
+ export default function SwitchChainDialog({ chainId, open, onClose, }: {
4
+ chainId?: ChainId;
5
+ open: boolean;
6
+ onClose: () => void;
7
+ }): JSX.Element;
@@ -11,5 +11,6 @@ export interface TokenLogoProps {
11
11
  zIndex?: number;
12
12
  cross?: boolean;
13
13
  sx?: BoxProps['sx'];
14
+ chainId?: number;
14
15
  }
15
- export default function TokenLogo({ width, height, marginRight, url, zIndex, cross, address: addressProps, token: tokenProps, sx, }: TokenLogoProps): React.ReactElement;
16
+ export default function TokenLogo({ width, height, marginRight, url, zIndex, cross, address: addressProps, token: tokenProps, sx, chainId, }: TokenLogoProps): React.ReactElement;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { chainListMap } from '../../constants/chainList';
3
+ export default function SelectChainItem({ chain, active, onClick, }: {
4
+ chain: typeof chainListMap[keyof typeof chainListMap];
5
+ active: boolean;
6
+ onClick?: () => void;
7
+ }): JSX.Element;
@@ -11,5 +11,6 @@ export interface TokenPickerProps {
11
11
  showAddrs?: string[];
12
12
  visible?: boolean;
13
13
  side?: 'from' | 'to';
14
+ defaultLoadBalance?: boolean;
14
15
  }
15
- export default function TokenPicker({ value, onChange, occupiedAddrs, hiddenAddrs, showAddrs, visible, side, }: TokenPickerProps): JSX.Element;
16
+ export default function TokenPicker({ value, onChange, occupiedAddrs, hiddenAddrs, showAddrs, visible, side, defaultLoadBalance, }: TokenPickerProps): JSX.Element;
@@ -3,3 +3,6 @@ export declare const RoutePriceAPI = "https://api.dodoex.io/route-service/v2/wid
3
3
  export declare const FiatPriceAPI = "https://api.dodoex.io/frontend-price-api";
4
4
  export declare const AppUrl = "https://app.dodoex.io";
5
5
  export declare const getCGTokenListAPI: (chainId: ChainId) => any;
6
+ export declare const BridgeRoutePriceAPI: string;
7
+ export declare const BridgeEncodeAPI: string;
8
+ export declare const BridgeCreateRouteAPI: string;
@@ -0,0 +1,10 @@
1
+ import { ChainId } from './chains';
2
+ import { ReactComponent as ETHereumLogo } from '../assets/logo/networks/eth.svg';
3
+ export declare const chainListMap: {
4
+ [key in ChainId]: {
5
+ chainId: ChainId;
6
+ logo: typeof ETHereumLogo;
7
+ name: string;
8
+ mainnet?: ChainId;
9
+ };
10
+ };
@@ -1,36 +1,26 @@
1
1
  export declare enum ChainId {
2
2
  MAINNET = 1,
3
- RINKEBY = 4,
4
3
  GOERLI = 5,
5
4
  BSC = 56,
6
- HECO = 128,
7
5
  POLYGON = 137,
8
6
  ARBITRUM_ONE = 42161,
9
- ARBITRUM_RINKEBY = 421611,
10
7
  AURORA = 1313161554,
11
- MOONRIVER = 1285,
12
8
  OKCHAIN = 66,
13
9
  OPTIMISM = 10,
14
- BOBA = 288,
15
10
  AVALANCHE = 43114,
16
- CRONOS = 25
11
+ CONFLUX = 1030
17
12
  }
18
13
  export declare const rpcServerMap: {
19
14
  1: string[];
20
- 4: string[];
21
15
  5: string[];
22
16
  56: string[];
23
- 128: string[];
24
17
  137: string[];
25
18
  42161: string[];
26
- 421611: string[];
27
19
  1313161554: string[];
28
- 1285: string[];
29
20
  66: string[];
30
21
  10: string[];
31
- 288: string[];
32
22
  43114: string[];
33
- 25: string[];
23
+ 1030: string[];
34
24
  };
35
25
  export declare const basicTokenMap: {
36
26
  1: {
@@ -42,15 +32,6 @@ export declare const basicTokenMap: {
42
32
  showDecimals: number;
43
33
  wrappedTokenSymbol: string;
44
34
  };
45
- 4: {
46
- wrappedTokenAddress: string;
47
- symbol: string;
48
- address: string;
49
- name: string;
50
- decimals: number;
51
- showDecimals: number;
52
- wrappedTokenSymbol: string;
53
- };
54
35
  5: {
55
36
  wrappedTokenAddress: string;
56
37
  symbol: string;
@@ -69,7 +50,7 @@ export declare const basicTokenMap: {
69
50
  showDecimals: number;
70
51
  wrappedTokenSymbol: string;
71
52
  };
72
- 25: {
53
+ 1030: {
73
54
  symbol: string;
74
55
  name: string;
75
56
  wrappedTokenSymbol: string;
@@ -78,15 +59,6 @@ export declare const basicTokenMap: {
78
59
  decimals: number;
79
60
  showDecimals: number;
80
61
  };
81
- 288: {
82
- wrappedTokenAddress: string;
83
- symbol: string;
84
- address: string;
85
- name: string;
86
- decimals: number;
87
- showDecimals: number;
88
- wrappedTokenSymbol: string;
89
- };
90
62
  56: {
91
63
  symbol: string;
92
64
  name: string;
@@ -105,15 +77,6 @@ export declare const basicTokenMap: {
105
77
  decimals: number;
106
78
  showDecimals: number;
107
79
  };
108
- 128: {
109
- symbol: string;
110
- name: string;
111
- showDecimals: number;
112
- wrappedTokenSymbol: string;
113
- wrappedTokenAddress: string;
114
- address: string;
115
- decimals: number;
116
- };
117
80
  137: {
118
81
  symbol: string;
119
82
  name: string;
@@ -123,15 +86,6 @@ export declare const basicTokenMap: {
123
86
  address: string;
124
87
  decimals: number;
125
88
  };
126
- 1285: {
127
- symbol: string;
128
- name: string;
129
- showDecimals: number;
130
- wrappedTokenSymbol: string;
131
- wrappedTokenAddress: string;
132
- address: string;
133
- decimals: number;
134
- };
135
89
  42161: {
136
90
  name: string;
137
91
  showDecimals: number;
@@ -141,15 +95,6 @@ export declare const basicTokenMap: {
141
95
  decimals: number;
142
96
  wrappedTokenSymbol: string;
143
97
  };
144
- 421611: {
145
- name: string;
146
- showDecimals: number;
147
- wrappedTokenAddress: string;
148
- symbol: string;
149
- address: string;
150
- decimals: number;
151
- wrappedTokenSymbol: string;
152
- };
153
98
  1313161554: {
154
99
  name: string;
155
100
  showDecimals: number;
@@ -171,35 +116,25 @@ export declare const basicTokenMap: {
171
116
  };
172
117
  export declare const platformIdMap: {
173
118
  1: string;
174
- 4: string;
175
119
  5: string;
176
120
  10: string;
177
- 25: string;
178
- 288: string;
121
+ 1030: string;
179
122
  56: string;
180
123
  66: string;
181
- 128: string;
182
124
  137: string;
183
- 1285: string;
184
125
  42161: string;
185
- 421611: string;
186
126
  1313161554: string;
187
127
  43114: string;
188
128
  };
189
129
  export declare const scanUrlDomainMap: {
190
130
  1: string;
191
- 4: string;
192
131
  5: string;
193
132
  10: string;
194
- 25: string;
195
- 288: string;
133
+ 1030: string;
196
134
  56: string;
197
135
  66: string;
198
- 128: string;
199
136
  137: string;
200
- 1285: string;
201
137
  42161: string;
202
- 421611: string;
203
138
  1313161554: string;
204
139
  43114: string;
205
140
  };
@@ -0,0 +1,2 @@
1
+ export declare function getAuthSwitchCache(): boolean;
2
+ export declare function setAuthSwitchCache(isAuto: boolean): void;
@@ -4,3 +4,4 @@ export declare const DEFAULT_SWAP_SLIPPAGE = 3;
4
4
  export declare const MAX_SWAP_SLIPPAGE = 50;
5
5
  export declare const DEFAULT_SWAP_DDL = 20;
6
6
  export declare const MIN_GAS_LIMIT = 30000;
7
+ export declare const DEFAULT_BRIDGE_SLIPPAGE = 0.5;
@@ -0,0 +1,24 @@
1
+ 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
+ };
19
+ }
20
+ export declare function createBridgeOrder({ apikey, tx, route, }: {
21
+ apikey: string;
22
+ tx: string;
23
+ route: BridgeRouteI;
24
+ }): Promise<any>;
@@ -0,0 +1,4 @@
1
+ export * from './createBridgeOrder';
2
+ export * from './useExecuteBridgeRoute';
3
+ export * from './useFetchRoutePriceBridge';
4
+ export * from './useSendRoute';
@@ -0,0 +1,6 @@
1
+ import { BridgeTXRequest } from '../../components/Bridge/BridgeSummaryDialog';
2
+ import { BridgeRouteI } from './useFetchRoutePriceBridge';
3
+ export default function useExecuteBridgeRoute({ route, bridgeOrderTxRequest, }: {
4
+ route?: BridgeRouteI;
5
+ bridgeOrderTxRequest?: BridgeTXRequest;
6
+ }): () => Promise<import("../Submission/types").ExecutionResult> | undefined;
@@ -0,0 +1,101 @@
1
+ import { TokenInfo } from '../Token';
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;
10
+ fromChainId: number;
11
+ toChainId: number;
12
+ /** from parameter */
13
+ fromAmount: string;
14
+ toTokenAmount: BigNumber;
15
+ /** from parameter */
16
+ fromAddress: string;
17
+ toAddress: string;
18
+ /** from parameter */
19
+ product: string | null;
20
+ 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
+ };
49
+ }
50
+ export interface BridgeTokenI {
51
+ id: number;
52
+ symbol: string;
53
+ name: string;
54
+ address: string;
55
+ decimals: number;
56
+ logoUrl: string;
57
+ chainId: number;
58
+ stableCurrencyToken: boolean;
59
+ mainCurrencyToken: boolean;
60
+ }
61
+ export interface BridgeStepTool {
62
+ name: string;
63
+ logoURI: string;
64
+ }
65
+ export interface BridgeStepEstimate {
66
+ fromToken: Pick<BridgeTokenI, 'address' | 'symbol' | 'chainId' | 'decimals'>;
67
+ toToken: Pick<BridgeTokenI, 'address' | 'symbol' | 'chainId' | 'decimals'>;
68
+ fromTokenAmount: BigNumber;
69
+ toTokenAmount: BigNumber;
70
+ }
71
+ export interface BridgeStep {
72
+ tool: string;
73
+ toolDetails: BridgeStepTool;
74
+ type: string | null;
75
+ includedSteps: Array<{
76
+ id: string;
77
+ /**
78
+ * bridge or swap
79
+ */
80
+ tool: string;
81
+ toolDetails: BridgeStepTool;
82
+ type: string;
83
+ estimate: BridgeStepEstimate;
84
+ }>;
85
+ }
86
+ export declare enum RoutePriceStatus {
87
+ Initial = "Initial",
88
+ Loading = "Loading",
89
+ Failed = "Failed",
90
+ Success = "Success"
91
+ }
92
+ export interface FetchRoutePrice {
93
+ fromToken: TokenInfo | null;
94
+ toToken: TokenInfo | null;
95
+ fromAmount: string;
96
+ }
97
+ export declare function useFetchRoutePriceBridge({ toToken, fromToken, fromAmount, }: FetchRoutePrice): {
98
+ status: RoutePriceStatus;
99
+ refetch: () => Promise<void>;
100
+ bridgeRouteList: BridgeRouteI[];
101
+ };
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ import BigNumber from 'bignumber.js';
3
+ import { BridgeRouteI } from './useFetchRoutePriceBridge';
4
+ import { BridgeTXRequest } from '../../components/Bridge/BridgeSummaryDialog';
5
+ export declare function useSendRoute(): {
6
+ apikey: string;
7
+ sendRouteLoading: boolean;
8
+ sendRouteError: string;
9
+ setSendRouteError: import("react").Dispatch<import("react").SetStateAction<string>>;
10
+ bridgeOrderTxRequest: BridgeTXRequest | undefined;
11
+ handleClickSend: ({ selectedRoute, fromEtherTokenBalance, goNext, }: {
12
+ selectedRoute?: BridgeRouteI | undefined;
13
+ fromEtherTokenBalance: BigNumber | null;
14
+ goNext: () => void;
15
+ }) => Promise<void>;
16
+ };
@@ -0,0 +1 @@
1
+ export declare function useSwitchBridgeOrSwapSlippage(isBridge: boolean): boolean;