@dodoex/widgets 2.6.12 → 2.6.13

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 (35) hide show
  1. package/dist/cjs/index.cjs +2 -2
  2. package/dist/cjs/locales/zh-CN.js +1 -1
  3. package/dist/cjs/src/constants/api.d.ts +1 -1
  4. package/dist/cjs/src/constants/locales.d.ts +1 -1
  5. package/dist/cjs/src/hooks/ConnectWallet/web3.d.ts +1 -1
  6. package/dist/cjs/src/hooks/Submission/spec.d.ts +6 -6
  7. package/dist/cjs/src/hooks/Submission/types.d.ts +3 -3
  8. package/dist/cjs/src/hooks/Token/type.d.ts +1 -1
  9. package/dist/cjs/src/hooks/contract/batch.d.ts +3 -3
  10. package/dist/cjs/src/hooks/contract/useFetchTokens.d.ts +1 -1
  11. package/dist/cjs/src/hooks/contract/wallet.d.ts +1 -1
  12. package/dist/cjs/src/hooks/setting/useSetAutoSlippage.d.ts +1 -1
  13. package/dist/cjs/src/index.d.ts +1 -1
  14. package/dist/cjs/src/store/actions/index.d.ts +2 -2
  15. package/dist/cjs/src/store/reducers/settings.d.ts +4 -4
  16. package/dist/cjs/src/store/reducers/token.d.ts +4 -4
  17. package/dist/cjs/src/store/reducers/wallet.d.ts +1 -1
  18. package/dist/index.js +2 -2
  19. package/dist/locales/zh-CN.js +1 -1
  20. package/dist/src/constants/api.d.ts +1 -1
  21. package/dist/src/constants/locales.d.ts +1 -1
  22. package/dist/src/hooks/ConnectWallet/web3.d.ts +1 -1
  23. package/dist/src/hooks/Submission/spec.d.ts +6 -6
  24. package/dist/src/hooks/Submission/types.d.ts +3 -3
  25. package/dist/src/hooks/Token/type.d.ts +1 -1
  26. package/dist/src/hooks/contract/batch.d.ts +3 -3
  27. package/dist/src/hooks/contract/useFetchTokens.d.ts +1 -1
  28. package/dist/src/hooks/contract/wallet.d.ts +1 -1
  29. package/dist/src/hooks/setting/useSetAutoSlippage.d.ts +1 -1
  30. package/dist/src/index.d.ts +1 -1
  31. package/dist/src/store/actions/index.d.ts +2 -2
  32. package/dist/src/store/reducers/settings.d.ts +4 -4
  33. package/dist/src/store/reducers/token.d.ts +4 -4
  34. package/dist/src/store/reducers/wallet.d.ts +1 -1
  35. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
1
  /*eslint-disable*/
2
2
 
3
- var zhCN={messages:JSON.parse("{\"+Jkdiu\":\"交易时长:\",\"+uZnU3\":\"跨链桥\",\"//95jS\":[\"当前滑点保护系数设置超过\",[\"maxSlippageWarning\"],\"%,可能会造成损失。\"],\"/Ak0Fw\":[\"连接 \",[\"0\"],\"...\"],\"/jQctM\":\"至\",\"/nzjSF\":[[\"0\"],\" 等待中\"],\"0QDjxt\":\"余额:\",\"1+P9RR\":[\"Switch to \",[\"0\"]],\"1QfxQT\":\"忽略\",\"4kY4C4\":\"由于市场情况不同,市场价格与估算价格可能略有差异。\",\"4xbbt/\":[[\"0\"],\" 已确认\"],\"54ffaC\":\"当前网络与钱包不一致,请在钱包中切换\",\"6+mYrD\":\"当前价格冲击\",\"6UYTy8\":\"分钟\",\"6XgEPi\":\"小时\",\"72/M0o\":\"输入代币符号或地址\",\"7IKPTP\":\"费用包括过跨链桥和交易的手续费,不包括 gas 费。\",\"7VpPHA\":\"确认\",\"7X+IbB\":\"Powered by DODO protocol\",\"7rpoXw\":\"该代币在\",\"8Z29ZO\":\"预计服务供应商费用\",\"93m8jT\":\"基础手续费\",\"AghcDJ\":\"价格冲击超过了你设置的滑点, 请提高滑点后重试\",\"B0/2ea\":\"秒\",\"C1mcuF\":\"此众筹池已被其他地址结算\",\"CK1KXz\":\"全部\",\"CMHmbm\":\"滑点\",\"CkfzUf\":[\"余额不足 - 请在钱包充值\",[\"EtherTokenSymbol\"],\"后重试\"],\"EUBGvH\":\"是否确认切换到另一个链?\",\"Enslfm\":\"目标\",\"F+sxb9\":\"未授权\",\"F9xwHA\":[\"跨链费用不足,至少需要 \",[\"0\"],\" \",[\"1\"],\" \"],\"FRBvjQ\":\"交易进行中\",\"Fdp03t\":\"在\",\"GAypnX\":\"滑点越高,交易的成功率越高,但是交易的价格可能不会是最好的市场价格。请谨慎调整滑点。\",\"H7OUPr\":\"天\",\"HuVZMK\":\"天\",\"J28zul\":\"连接中...\",\"J39pAJ\":\"额外手续费\",\"JdNn1Y\":\"获取最优价格中...\",\"K/Ay/d\":\"预览交易\",\"K/PgcA\":\"选择跨链桥\",\"KAmxpM\":\"注意:滑点越高,交易的成功率越高,但是交易的价格可能不会是最好的市场价格。请谨慎调整滑点。\",\"KlvBGJ\":\"选择代币\",\"NSCBTb\":\"设置已切换至闪兑模式\",\"NVAuTg\":\"没有报价\",\"OauUE6\":\"获取价格中...\",\"OfhWJH\":\"重置\",\"OgKD6h\":\"最优价格\",\"P+K/3O\":\"确认中\",\"PC9Biq\":[[\"DEFAULT_SWAP_DDL\"],\" 分钟\"],\"PLUB/s\":\"手续费\",\"PZqJog\":\"确认跨链交易\",\"Price impact reaches <0>{priceImpact}</0>%, accept the quote\":[\"价格冲击为<0>\",[\"priceImpact\"],\"</0>%, 仍接受此报价\"],\"QNWt8A\":\"预计时间\",\"QR4/RH\":\"交易预览\",\"S3piC2\":\"交易哈希:\",\"SXnevP\":\"预览跨链交易\",\"T+qgFw\":\"价格冲击\",\"T0Y2+3\":\"选择代币\",\"TFOxRM\":\"分钟\",\"TizaRy\":\"钱包不兼容\",\"Tz0i8g\":\"设置\",\"Uzr1HF\":[\"连接你的\",[\"0\"],\"钱包\"],\"V+rJKF\":\"秒\",\"XeovX3\":\"交易详情\",\"Xpkm7d\":\"No ForceStop access\",\"YHpbe1\":\"对于\",\"Z5HWHd\":\"在\",\"Z7ZXbT\":\"代币授权\",\"ZXvy7b\":\"由 Widget 设置的额外路由费用\",\"Zm56FI\":\"最大滑点不能超过50%\",\"agRWc1\":\"分钟\",\"dEgA5A\":\"取消\",\"dI46oG\":\"自动切换网络\",\"eTUF28\":\"分钟\",\"em6LzM\":\"交易被拒绝.\",\"g3x+cF\":\"服务升级中, 请等待或重试\",\"gz+9Rb\":\"Gas 价格过低, 请调整后重试\",\"h4RLFN\":\"RPC节点异常\",\"h5FVz1\":\"预计交易时长\",\"h7LgzN\":\"连接钱包\",\"iPMIoT\":\"输入代币数量\",\"j2Uisd\":\"授权中\",\"kf83Ld\":\"发生异常错误.\",\"ku//5b\":\"秒\",\"lQ6r7x\":\"确认交易\",\"lqTDfd\":\"滑点\",\"lt8yMa\":\"发送至:\",\"qK7wuW\":\"在冷静期无法进行清算\",\"qLkska\":\"设置已切换到跨链桥交易模式\",\"r7ScnQ\":\"连接钱包\",\"rFbNvu\":\"如果你的交易被确认的时间超过这个时间,你的交易将被退回。 \",\"rRDi3Y\":\"详情\",\"sIPJGT\":\"选择代币\",\"tKE4Ak\":\"跨链桥概览\",\"tMVAXL\":\"SafeERC20:low-level call failed,请联系DODO团队解决。\",\"udsWDJ\":\"未支持网络 - 请切换后进行交易\",\"vH2C/2\":\"交易\",\"wdxz7K\":\"源\",\"xEbi+8\":\"用户拒绝交易签名.\",\"yM82Jw\":\"ForceStop 异常\",\"yY8wAv\":\"小时\",\"yz7wBu\":\"关闭\",\"zSMRJ/\":\"交易截止时间\",\"znqB4T\":\"余额不足\"}")};
3
+ var zhCN={messages:JSON.parse("{\"+Jkdiu\":\"交易时长:\",\"+uZnU3\":\"跨链桥\",\"//95jS\":[\"当前滑点保护系数设置超过\",[\"maxSlippageWarning\"],\"%,可能会造成损失。\"],\"/Ak0Fw\":[\"连接 \",[\"0\"],\"...\"],\"/jQctM\":\"至\",\"/nzjSF\":[[\"0\"],\" 等待中\"],\"0QDjxt\":\"余额:\",\"1+P9RR\":[\"切换到 \",[\"0\"]],\"1QfxQT\":\"忽略\",\"4kY4C4\":\"由于市场情况不同,市场价格与估算价格可能略有差异。\",\"4xbbt/\":[[\"0\"],\" 已确认\"],\"54ffaC\":\"当前网络与钱包不一致,请在钱包中切换\",\"6+mYrD\":\"当前价格冲击\",\"6UYTy8\":\"分钟\",\"6XgEPi\":\"小时\",\"72/M0o\":\"输入代币符号或地址\",\"7IKPTP\":\"费用包括过跨链桥和交易的手续费,不包括 gas 费。\",\"7VpPHA\":\"确认\",\"7X+IbB\":\"Powered by DODO protocol\",\"7rpoXw\":\"该代币在\",\"8Z29ZO\":\"预计服务供应商费用\",\"93m8jT\":\"基础手续费\",\"AghcDJ\":\"价格冲击超过了你设置的滑点, 请提高滑点后重试\",\"B0/2ea\":\"秒\",\"C1mcuF\":\"此众筹池已被其他地址结算\",\"CK1KXz\":\"全部\",\"CMHmbm\":\"滑点\",\"CkfzUf\":[\"余额不足 - 请在钱包充值\",[\"EtherTokenSymbol\"],\"后重试\"],\"EUBGvH\":\"是否确认切换到另一个链?\",\"Enslfm\":\"目标\",\"F+sxb9\":\"未授权\",\"F9xwHA\":[\"跨链费用不足,至少需要 \",[\"0\"],\" \",[\"1\"],\" \"],\"FRBvjQ\":\"交易进行中\",\"Fdp03t\":\"在\",\"GAypnX\":\"滑点越高,交易的成功率越高,但是交易的价格可能不会是最好的市场价格。请谨慎调整滑点。\",\"H7OUPr\":\"天\",\"HuVZMK\":\"天\",\"J28zul\":\"连接中...\",\"J39pAJ\":\"额外手续费\",\"JdNn1Y\":\"获取最优价格中...\",\"K/Ay/d\":\"预览交易\",\"K/PgcA\":\"选择跨链桥\",\"KAmxpM\":\"注意:滑点越高,交易的成功率越高,但是交易的价格可能不会是最好的市场价格。请谨慎调整滑点。\",\"KlvBGJ\":\"选择代币\",\"NSCBTb\":\"设置已切换至闪兑模式\",\"NVAuTg\":\"没有报价\",\"OauUE6\":\"获取价格中...\",\"OfhWJH\":\"重置\",\"OgKD6h\":\"最优价格\",\"P+K/3O\":\"确认中\",\"PC9Biq\":[[\"DEFAULT_SWAP_DDL\"],\" 分钟\"],\"PLUB/s\":\"手续费\",\"PZqJog\":\"确认跨链交易\",\"Price impact reaches <0>{priceImpact}</0>%, accept the quote\":[\"价格冲击为<0>\",[\"priceImpact\"],\"</0>%, 仍接受此报价\"],\"QNWt8A\":\"预计时间\",\"QR4/RH\":\"交易预览\",\"S3piC2\":\"交易哈希:\",\"SXnevP\":\"预览跨链交易\",\"T+qgFw\":\"价格冲击\",\"T0Y2+3\":\"选择代币\",\"TFOxRM\":\"分钟\",\"TizaRy\":\"钱包不兼容\",\"Tz0i8g\":\"设置\",\"Uzr1HF\":[\"连接你的\",[\"0\"],\"钱包\"],\"V+rJKF\":\"秒\",\"XeovX3\":\"交易详情\",\"Xpkm7d\":\"No ForceStop access\",\"YHpbe1\":\"对于\",\"Z5HWHd\":\"在\",\"Z7ZXbT\":\"代币授权\",\"ZXvy7b\":\"由 Widget 设置的额外路由费用\",\"Zm56FI\":\"最大滑点不能超过50%\",\"agRWc1\":\"分钟\",\"dEgA5A\":\"取消\",\"dI46oG\":\"自动切换网络\",\"eTUF28\":\"分钟\",\"em6LzM\":\"交易被拒绝.\",\"g3x+cF\":\"服务升级中, 请等待或重试\",\"gz+9Rb\":\"Gas 价格过低, 请调整后重试\",\"h4RLFN\":\"RPC节点异常\",\"h5FVz1\":\"预计交易时长\",\"h7LgzN\":\"连接钱包\",\"iPMIoT\":\"输入代币数量\",\"j2Uisd\":\"授权中\",\"kf83Ld\":\"发生异常错误.\",\"ku//5b\":\"秒\",\"lQ6r7x\":\"确认交易\",\"lqTDfd\":\"滑点\",\"lt8yMa\":\"发送至:\",\"qK7wuW\":\"在冷静期无法进行清算\",\"qLkska\":\"设置已切换到跨链桥交易模式\",\"r7ScnQ\":\"连接钱包\",\"rFbNvu\":\"如果你的交易被确认的时间超过这个时间,你的交易将被退回。 \",\"rRDi3Y\":\"详情\",\"sIPJGT\":\"选择代币\",\"tKE4Ak\":\"跨链桥概览\",\"tMVAXL\":\"SafeERC20:low-level call failed,请联系DODO团队解决。\",\"udsWDJ\":\"未支持网络 - 请切换后进行交易\",\"vH2C/2\":\"交易\",\"wdxz7K\":\"源\",\"xEbi+8\":\"用户拒绝交易签名.\",\"yM82Jw\":\"ForceStop 异常\",\"yY8wAv\":\"小时\",\"yz7wBu\":\"关闭\",\"zSMRJ/\":\"交易截止时间\",\"znqB4T\":\"余额不足\"}")};
4
4
 
5
5
  export { zhCN as default };
@@ -6,7 +6,7 @@ export declare enum APIServiceKey {
6
6
  bridgeEncode = "bridgeEncode",
7
7
  bridgeCreateRoute = "bridgeCreateRoute"
8
8
  }
9
- export declare type APIServices = {
9
+ export type APIServices = {
10
10
  [key in APIServiceKey]: string;
11
11
  };
12
12
  export declare const AppUrl = "https://app.dodoex.io";
@@ -1,3 +1,3 @@
1
1
  export declare const supportedLang: string[];
2
- export declare type SupportedLang = typeof supportedLang[number];
2
+ export type SupportedLang = typeof supportedLang[number];
3
3
  export declare const defaultLang: SupportedLang;
@@ -2,7 +2,7 @@ import { Web3ReactHooks } from '@web3-react/core';
2
2
  import { Connector, Provider as Eip1193Provider } from '@web3-react/types';
3
3
  import { JsonRpcProvider } from '@ethersproject/providers';
4
4
  import type { ChainId } from '../../constants/chains';
5
- export declare type Web3Connection = [Connector, Web3ReactHooks];
5
+ export type Web3Connection = [Connector, Web3ReactHooks];
6
6
  export declare function getConnectionFromProvider(onError: (error: Error) => void, provider?: JsonRpcProvider | Eip1193Provider): Web3Connection | undefined;
7
7
  export declare function getConnectionFromWalletConnect(useDefault: boolean, jsonRpcUrlMap: {
8
8
  [chainId: number]: string[];
@@ -17,10 +17,10 @@ export declare enum SwapType {
17
17
  LimitOrder = "LimitOrder",
18
18
  RFQ = "RFQ"
19
19
  }
20
- export declare type TokenData = {
20
+ export type TokenData = {
21
21
  address: string;
22
22
  };
23
- export declare type ApprovalStep = {
23
+ export type ApprovalStep = {
24
24
  opcode: OpCode.Approval;
25
25
  /**
26
26
  * The address of the token
@@ -36,7 +36,7 @@ export declare type ApprovalStep = {
36
36
  */
37
37
  amt?: BigNumber;
38
38
  };
39
- export declare type TXStep = {
39
+ export type TXStep = {
40
40
  opcode: OpCode.TX;
41
41
  value: number | string;
42
42
  to: string;
@@ -46,11 +46,11 @@ export declare type TXStep = {
46
46
  gasPrice?: number;
47
47
  ddlSecRel?: number;
48
48
  };
49
- export declare type TypedSignStep = {
49
+ export type TypedSignStep = {
50
50
  opcode: OpCode.TypedSign;
51
51
  swapType?: SwapType;
52
52
  signer?: string;
53
53
  typedData: Record<string, unknown>;
54
54
  };
55
- export declare type Step = ApprovalStep | TXStep | TypedSignStep;
56
- export declare type Steps = Step[];
55
+ export type Step = ApprovalStep | TXStep | TypedSignStep;
56
+ export type Steps = Step[];
@@ -7,14 +7,14 @@ export declare enum State {
7
7
  Failed = 2,
8
8
  Warning = 3
9
9
  }
10
- export declare type Request = {
10
+ export type Request = {
11
11
  brief: string;
12
12
  spec: StepSpec;
13
13
  subtitle?: string | React.ReactNode | null;
14
14
  tx: string;
15
15
  nonce?: number;
16
16
  };
17
- export declare type Requests = Map<string, [Request, State]>;
17
+ export type Requests = Map<string, [Request, State]>;
18
18
  export declare enum ExecutionResult {
19
19
  Canceled = "canceled",
20
20
  Failed = "failed",
@@ -26,7 +26,7 @@ export interface Showing {
26
26
  subtitle?: string | React.ReactNode;
27
27
  spec: StepSpec;
28
28
  }
29
- export declare type ExecutionCtx = {
29
+ export type ExecutionCtx = {
30
30
  /**
31
31
  * Execute an on-chain operation
32
32
  * @param breif: TX title. e.g.: "Swap"
@@ -12,7 +12,7 @@ export interface TokenInfo {
12
12
  export interface DefaultTokenInfo extends TokenInfo {
13
13
  amount?: number;
14
14
  }
15
- export declare type TokenList = TokenInfo[];
15
+ export type TokenList = TokenInfo[];
16
16
  export declare enum TokenListType {
17
17
  All = "all"
18
18
  }
@@ -7,11 +7,11 @@ interface RequestThunk<T> {
7
7
  callData: Web3CallData | null;
8
8
  processor: (_: any, index: number) => T;
9
9
  }
10
- export declare type BatchThunk<T> = RequestThunk<T>[];
11
- declare type BatchThunkAll<Ts extends any[]> = {
10
+ export type BatchThunk<T> = RequestThunk<T>[];
11
+ type BatchThunkAll<Ts extends any[]> = {
12
12
  [Tidx in keyof Ts]: Ts[Tidx] extends Ts[number] ? BatchThunk<Ts[Tidx]> : never;
13
13
  };
14
- declare type BatchThunkAllResult<Ts extends any[]> = {
14
+ type BatchThunkAllResult<Ts extends any[]> = {
15
15
  [Tidx in keyof Ts]: Ts[Tidx] extends Ts[number] ? Array<Ts[Tidx]> : never;
16
16
  };
17
17
  export declare function runAll<Ts extends any[]>(contract: Contract, contractAddress: string, ...batches: BatchThunkAll<Ts>): Promise<BatchThunkAllResult<Ts>>;
@@ -1,6 +1,6 @@
1
1
  import BigNumber from 'bignumber.js';
2
2
  import { TokenList } from '../Token';
3
- declare type TokenResult = {
3
+ type TokenResult = {
4
4
  address: string;
5
5
  balance: BigNumber;
6
6
  allowance: BigNumber;
@@ -2,7 +2,7 @@ import { JsonRpcProvider } from '@ethersproject/providers';
2
2
  import type { TransactionRequest } from '@ethersproject/abstract-provider';
3
3
  import { BigNumber as EthersBigNumber } from '@ethersproject/bignumber';
4
4
  import BigNumber from 'bignumber.js';
5
- export declare type Deferrable<T> = {
5
+ export type Deferrable<T> = {
6
6
  [K in keyof T]: T[K] | Promise<T[K]>;
7
7
  };
8
8
  export declare enum WatchResult {
@@ -1,5 +1,5 @@
1
1
  import { TokenInfo } from '../Token';
2
- export declare type GetAutoSlippage = (options: {
2
+ export type GetAutoSlippage = (options: {
3
3
  fromToken: TokenInfo | null;
4
4
  toToken: TokenInfo | null;
5
5
  }) => Promise<number | undefined> | number | undefined;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { WidgetProps } from './components/Widget';
3
- export declare type SwapWidgetProps = WidgetProps;
3
+ export type SwapWidgetProps = WidgetProps;
4
4
  export type { TokenInfo } from './hooks/Token/type';
5
5
  export declare function SwapWidget(props: SwapWidgetProps): JSX.Element;
6
6
  export declare function InitSwapWidget(props: SwapWidgetProps): void;
@@ -1,4 +1,4 @@
1
1
  import { Action, ThunkAction, ThunkDispatch } from '@reduxjs/toolkit';
2
2
  import { RootState } from '../reducers';
3
- export declare type AppThunkAction<Ret = void> = ThunkAction<Ret, RootState, unknown, Action<string>>;
4
- export declare type AppThunkDispatch = ThunkDispatch<RootState, unknown, Action<string>>;
3
+ export type AppThunkAction<Ret = void> = ThunkAction<Ret, RootState, unknown, Action<string>>;
4
+ export type AppThunkDispatch = ThunkDispatch<RootState, unknown, Action<string>>;
@@ -1,9 +1,9 @@
1
1
  import { AnyAction } from 'redux';
2
2
  import { PaletteMode } from '@dodoex/components';
3
- export declare type ColorMode = PaletteMode | 'system';
4
- export declare type Slippage = string | null;
5
- export declare type TxDdl = number | '';
6
- export declare type State = {
3
+ export type ColorMode = PaletteMode | 'system';
4
+ export type Slippage = string | null;
5
+ export type TxDdl = number | '';
6
+ export type State = {
7
7
  colorMode: ColorMode;
8
8
  slippage: Slippage;
9
9
  ddl: TxDdl;
@@ -1,18 +1,18 @@
1
1
  import BigNumber from 'bignumber.js';
2
2
  import { AnyAction } from 'redux';
3
3
  import type { TokenList, DefaultTokenInfo } from '../../hooks/Token';
4
- export declare type AccountBalance = {
4
+ export type AccountBalance = {
5
5
  tokenBalances?: BigNumber;
6
6
  tokenAllowances?: BigNumber;
7
7
  };
8
- export declare type AccountBalances = {
8
+ export type AccountBalances = {
9
9
  [key in string]: AccountBalance;
10
10
  };
11
- export declare type SlippageWithToken = {
11
+ export type SlippageWithToken = {
12
12
  slippage: string;
13
13
  tokens: string[];
14
14
  };
15
- export declare type State = {
15
+ export type State = {
16
16
  tokenList: TokenList;
17
17
  popularTokenList: TokenList;
18
18
  ethBalance: {
@@ -1,6 +1,6 @@
1
1
  import { AnyAction } from 'redux';
2
2
  import { ChainId } from '../../constants/chains';
3
- export declare type State = {
3
+ export type State = {
4
4
  chainId: ChainId;
5
5
  fromTokenChainId?: ChainId;
6
6
  latestBlockNumber: number;