@dodoex/widgets 2.1.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/cjs/index.cjs +1 -1
  2. package/dist/cjs/locales/en-US.js +1 -1
  3. package/dist/cjs/src/components/Swap/components/ReviewDialog.d.ts +4 -3
  4. package/dist/cjs/src/components/Swap/components/TokenCard/NumberInput.d.ts +2 -1
  5. package/dist/cjs/src/components/Swap/components/TokenCard/index.d.ts +3 -1
  6. package/dist/cjs/src/hooks/Swap/useExecuteSwap.d.ts +2 -4
  7. package/dist/cjs/src/hooks/Swap/useFetchRoutePrice.d.ts +3 -2
  8. package/dist/cjs/src/hooks/Swap/useMarginAmount.d.ts +3 -3
  9. package/dist/cjs/src/store/index.d.ts +1 -1
  10. package/dist/cjs/src/store/reducers/globals.d.ts +12 -2
  11. package/dist/cjs/src/store/reducers/index.d.ts +1 -1
  12. package/dist/cjs/src/store/reducers/token.d.ts +5 -2
  13. package/dist/cjs/src/store/selectors/globals.d.ts +1 -1
  14. package/dist/cjs/src/store/selectors/token.d.ts +5 -5
  15. package/dist/index.js +1 -1
  16. package/dist/locales/en-US.js +1 -1
  17. package/dist/src/components/Swap/components/ReviewDialog.d.ts +4 -3
  18. package/dist/src/components/Swap/components/TokenCard/NumberInput.d.ts +2 -1
  19. package/dist/src/components/Swap/components/TokenCard/index.d.ts +3 -1
  20. package/dist/src/hooks/Swap/useExecuteSwap.d.ts +2 -4
  21. package/dist/src/hooks/Swap/useFetchRoutePrice.d.ts +3 -2
  22. package/dist/src/hooks/Swap/useMarginAmount.d.ts +3 -3
  23. package/dist/src/store/index.d.ts +1 -1
  24. package/dist/src/store/reducers/globals.d.ts +12 -2
  25. package/dist/src/store/reducers/index.d.ts +1 -1
  26. package/dist/src/store/reducers/token.d.ts +5 -2
  27. package/dist/src/store/selectors/globals.d.ts +1 -1
  28. package/dist/src/store/selectors/token.d.ts +5 -5
  29. package/package.json +1 -1
@@ -1,6 +1,16 @@
1
1
  import { AnyAction } from 'redux';
2
2
  import { SwapWidgetProps } from '../..';
3
- export declare type State = SwapWidgetProps;
3
+ export declare enum ContractStatus {
4
+ Initial = "Initial",
5
+ Pending = "Pending",
6
+ ApproveSuccess = "ApproveSuccess",
7
+ TxSuccess = "TxSuccess",
8
+ Failed = "Failed"
9
+ }
10
+ export interface State extends SwapWidgetProps {
11
+ isReverseRouting?: boolean;
12
+ contractStatus?: ContractStatus;
13
+ }
4
14
  export declare const initialState: State;
5
- declare const _default: (state: import("../../components/Widget").WidgetProps | undefined, action: AnyAction) => State;
15
+ declare const _default: (state: State | undefined, action: AnyAction) => State;
6
16
  export default _default;
@@ -12,6 +12,6 @@ declare const _default: () => import("redux").Reducer<import("redux").CombinedSt
12
12
  settings: settingsState;
13
13
  wallet: walletState;
14
14
  token: tokenState;
15
- globals: import("../../components/Widget").WidgetProps;
15
+ globals: globalState;
16
16
  }>, import("redux").AnyAction>;
17
17
  export default _default;
@@ -12,6 +12,9 @@ export declare type SlippageWithToken = {
12
12
  slippage: string;
13
13
  tokens: string[];
14
14
  };
15
+ export interface DefaultTokenInfo extends TokenInfo {
16
+ amount?: number;
17
+ }
15
18
  export declare type State = {
16
19
  tokenList: TokenList;
17
20
  popularTokenList: TokenList;
@@ -21,8 +24,8 @@ export declare type State = {
21
24
  [key in string]: boolean;
22
25
  };
23
26
  slippageWithTokens: SlippageWithToken[];
24
- defaultFromToken?: TokenInfo;
25
- defaultToToken?: TokenInfo;
27
+ defaultFromToken?: DefaultTokenInfo;
28
+ defaultToToken?: DefaultTokenInfo;
26
29
  };
27
30
  export declare const initialState: State;
28
31
  declare const _default: (state: State | undefined, action: AnyAction) => State;
@@ -1,2 +1,2 @@
1
1
  import { RootState } from '../reducers';
2
- export declare const getGlobalProps: (state?: RootState) => import("../../components/Widget").WidgetProps;
2
+ export declare const getGlobalProps: (state?: RootState) => import("../reducers/globals").State;
@@ -1,14 +1,14 @@
1
1
  import BigNumber from 'bignumber.js';
2
2
  import { ChainId } from '../../constants/chains';
3
- import { TokenInfo } from '../../hooks/Token/type';
3
+ import { DefaultTokenInfo } from '../reducers/token';
4
4
  import { RootState } from '../reducers';
5
- export declare const getTokenList: (state?: RootState) => import("../../hooks/Token/type").TokenList;
6
- export declare const getPopularTokenList: (chainId: ChainId, state?: RootState) => TokenInfo[];
5
+ export declare const getTokenList: (state?: RootState) => import("../../hooks/Token").TokenList;
6
+ export declare const getPopularTokenList: (chainId: ChainId, state?: RootState) => import("../../hooks/Token").TokenInfo[];
7
7
  export declare const getSlippageWithTokens: (state?: RootState) => import("../reducers/token").SlippageWithToken[];
8
8
  export declare const getAccountBalances: (state?: RootState) => import("../reducers/token").AccountBalances;
9
9
  export declare const getEthBalance: (state?: RootState) => BigNumber;
10
- export declare const getDefaultFromToken: (state?: RootState) => TokenInfo | undefined;
11
- export declare const getDefaultToToken: (state?: RootState) => TokenInfo | undefined;
10
+ export declare const getDefaultFromToken: (state?: RootState) => DefaultTokenInfo | undefined;
11
+ export declare const getDefaultToToken: (state?: RootState) => DefaultTokenInfo | undefined;
12
12
  export declare const getTokenBalance: (tokenAddress: string, state?: RootState) => BigNumber;
13
13
  export declare const getTokenAllowance: (tokenAddress: string, state?: RootState) => void;
14
14
  export declare const getBalanceLoadings: (state?: RootState) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dodoex/widgets",
3
- "version": "2.1.0",
3
+ "version": "2.2.1",
4
4
  "description": "DODO Widgets",
5
5
  "source": "src/index.tsx",
6
6
  "types": "dist/src/index.d.ts",