@dodoex/widgets 3.0.0 → 3.0.1-taiko.2

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 (41) 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-HiRq90.js → helper-C6hUKVMF.js} +1 -1
  4. package/dist/{helper-BKVBNDjK.cjs → helper-C8Tb3Ej9.cjs} +1 -1
  5. package/dist/index-BOIqRT-e.js +31 -0
  6. package/dist/{index-B15VIhJF.cjs → index-BPhapw5N.cjs} +2 -2
  7. package/dist/{index-DcodV9tV.cjs → index-CNWyiyoP.cjs} +1 -1
  8. package/dist/index-CkMsZ9ps.cjs +31 -0
  9. package/dist/{index-C7igC0ot.js → index-D9NszOQh.js} +2 -2
  10. package/dist/{index-B_LP5IWI.js → index-DNFGjGXP.js} +1 -1
  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/SpaceBetweenItem.d.ts +5 -0
  16. package/dist/types/components/Swap/components/SwitchBox.d.ts +3 -2
  17. package/dist/types/components/TokenLogo.d.ts +1 -1
  18. package/dist/types/components/TokenPairStatusButton.d.ts +6 -0
  19. package/dist/types/components/TokenSelect.d.ts +21 -0
  20. package/dist/types/constants/pool.d.ts +1 -0
  21. package/dist/types/constants/testId.d.ts +1 -0
  22. package/dist/types/hooks/Submission/types.d.ts +2 -0
  23. package/dist/types/hooks/Token/useTokenStatus.d.ts +1 -0
  24. package/dist/types/index.d.ts +1 -0
  25. package/dist/types/router/types.d.ts +3 -1
  26. package/dist/types/utils/address.d.ts +9 -0
  27. package/dist/types/widgets/PoolWidget/AMMV2Create/ConfirmDialog.d.ts +17 -0
  28. package/dist/types/widgets/PoolWidget/AMMV2Create/CreateItem.d.ts +5 -0
  29. package/dist/types/widgets/PoolWidget/AMMV2Create/FeeEdit.d.ts +7 -0
  30. package/dist/types/widgets/PoolWidget/AMMV2Create/MyLiqidity.d.ts +6 -0
  31. package/dist/types/widgets/PoolWidget/AMMV2Create/Ratio.d.ts +18 -0
  32. package/dist/types/widgets/PoolWidget/AMMV2Create/Setting.d.ts +16 -0
  33. package/dist/types/widgets/PoolWidget/AMMV2Create/index.d.ts +1 -0
  34. package/dist/types/widgets/PoolWidget/PoolOperate/hooks/useRemoveLiquidityTokenStatus.d.ts +2 -0
  35. package/dist/types/widgets/PoolWidget/hooks/useAMMV2AddLiquidity.d.ts +11 -0
  36. package/dist/types/widgets/PoolWidget/hooks/useAMMV2Balance.d.ts +13 -0
  37. package/dist/types/widgets/PoolWidget/hooks/useUniV2Pairs.d.ts +19 -0
  38. package/dist/types/widgets/PoolWidget/utils.d.ts +6 -5
  39. package/package.json +6 -4
  40. package/dist/index-BHHF0NMg.js +0 -31
  41. package/dist/index-lpcUFCfi.cjs +0 -31
@@ -0,0 +1,18 @@
1
+ import { BoxProps } from '@dodoex/components';
2
+ import BigNumber from 'bignumber.js';
3
+ import { TokenInfo } from '../../../hooks/Token';
4
+ export declare function RatioPrice({ baseToken, quoteToken, midPrice, loading, disabled, }: {
5
+ baseToken?: TokenInfo;
6
+ quoteToken?: TokenInfo;
7
+ midPrice?: BigNumber | null;
8
+ loading?: boolean;
9
+ disabled?: boolean;
10
+ }): JSX.Element;
11
+ export default function Ratio({ baseToken, quoteToken, loading, midPrice, shareOfPool, sx, }: {
12
+ baseToken?: TokenInfo;
13
+ quoteToken?: TokenInfo;
14
+ loading?: boolean;
15
+ midPrice?: BigNumber | null;
16
+ shareOfPool?: string;
17
+ sx?: BoxProps['sx'];
18
+ }): JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { BoxProps } from '@dodoex/components';
2
+ import { AUTO_SWAP_SLIPPAGE_PROTECTION } from '../../../constants/pool';
3
+ export declare const useSlipper: ({ address }: {
4
+ address?: string;
5
+ }) => {
6
+ slipper: number | "auto";
7
+ setSlipper: import("react").Dispatch<import("react").SetStateAction<number | "auto">>;
8
+ slipperValue: number;
9
+ resetSlipper: () => void;
10
+ };
11
+ export default function Setting({ sx, disabled, slippage, onChangeSlippage, }: {
12
+ sx?: BoxProps['sx'];
13
+ disabled?: boolean;
14
+ slippage: number | typeof AUTO_SWAP_SLIPPAGE_PROTECTION;
15
+ onChangeSlippage: (val: number | typeof AUTO_SWAP_SLIPPAGE_PROTECTION) => void;
16
+ }): JSX.Element;
@@ -0,0 +1 @@
1
+ export default function AMMV2Create(): JSX.Element;
@@ -7,6 +7,7 @@ export declare function useRemoveLiquidityTokenStatus({ pool, baseAmount, quoteA
7
7
  balanceInfo: ReturnType<typeof usePoolBalanceInfo>;
8
8
  }): {
9
9
  baseTokenStatus: {
10
+ token: import("../../../..").TokenInfo | null | undefined;
10
11
  isApproving: boolean;
11
12
  isGetApproveLoading: boolean;
12
13
  needApprove: boolean;
@@ -19,6 +20,7 @@ export declare function useRemoveLiquidityTokenStatus({ pool, baseAmount, quoteA
19
20
  getMaxBalance: () => string;
20
21
  };
21
22
  quoteTokenStatus: {
23
+ token: import("../../../..").TokenInfo | null | undefined;
22
24
  isApproving: boolean;
23
25
  isGetApproveLoading: boolean;
24
26
  needApprove: boolean;
@@ -0,0 +1,11 @@
1
+ import { TokenInfo } from '../../../hooks/Token';
2
+ export declare function useAMMV2AddLiquidity({ baseToken, quoteToken, baseAmount, quoteAmount, slippage, fee, isExists, successBack, }: {
3
+ baseToken: TokenInfo | undefined;
4
+ quoteToken: TokenInfo | undefined;
5
+ baseAmount: string;
6
+ quoteAmount: string;
7
+ slippage: number;
8
+ fee: number;
9
+ isExists?: boolean;
10
+ successBack?: () => void;
11
+ }): import("@tanstack/react-query").UseMutationResult<import("../../../hooks/Submission/types").ExecutionResult, Error, void, unknown>;
@@ -0,0 +1,13 @@
1
+ import { Pair } from '@uniswap/v2-sdk';
2
+ import BigNumber from 'bignumber.js';
3
+ export declare function useAMMV2Balance({ pairAddress, pair, }: {
4
+ pairAddress?: string;
5
+ pair?: Pair | null;
6
+ }): {
7
+ isBalanceLoading: boolean;
8
+ isDepositedLoading: boolean;
9
+ balance: BigNumber | undefined;
10
+ poolTokenPercentage: BigNumber | undefined;
11
+ token0Deposited: BigNumber | undefined;
12
+ token1Deposited: BigNumber | undefined;
13
+ };
@@ -0,0 +1,19 @@
1
+ import { Pair } from '@uniswap/v2-sdk';
2
+ import { TokenInfo } from '../../../hooks/Token';
3
+ import BigNumber from 'bignumber.js';
4
+ export declare function useUniV2Pairs({ baseToken, quoteToken, baseAmount, quoteAmount, fee, }: {
5
+ baseToken: TokenInfo | undefined;
6
+ quoteToken: TokenInfo | undefined;
7
+ baseAmount: string;
8
+ quoteAmount: string;
9
+ fee: number;
10
+ }): {
11
+ pairAddress: string | undefined;
12
+ pair: Pair | null;
13
+ price: BigNumber | null;
14
+ invertedPrice: BigNumber | null;
15
+ priceLoading: boolean;
16
+ liquidityMinted: BigNumber | undefined;
17
+ poolTokenPercentage: BigNumber | undefined;
18
+ isExists: boolean;
19
+ };
@@ -1,12 +1,13 @@
1
- import { PoolApi, ExcludeNone } from '@dodoex/api';
1
+ import { PoolApi, ExcludeNone, UniPoolV2Api } from '@dodoex/api';
2
2
  import { ChainId } from '@dodoex/api';
3
3
  import { TokenInfo } from '../../hooks/Token';
4
4
  import { OperatePool } from './PoolOperate/types';
5
5
  export declare const poolApi: PoolApi;
6
- export type FetchLiquidityListLqList = ExcludeNone<ReturnType<Exclude<typeof PoolApi.graphql.fetchLiquidityList['__apiType'], undefined>>['liquidity_list']>['lqList'];
7
- export type FetchMyLiquidityListLqList = ExcludeNone<ReturnType<Exclude<typeof PoolApi.graphql.fetchMyLiquidityList['__apiType'], undefined>>['liquidity_list']>['lqList'];
8
- export type FetchMyCreateListLqList = ExcludeNone<ReturnType<Exclude<typeof PoolApi.graphql.fetchDashboardPairList['__apiType'], undefined>>['dashboard_pairs_list']>['list'];
9
- export type FetchPoolList = ExcludeNone<ReturnType<Exclude<typeof PoolApi.graphql.fetchPoolList['__apiType'], undefined>>['pairs']>;
6
+ export declare const uniPoolV2Api: UniPoolV2Api;
7
+ export type FetchLiquidityListLqList = ExcludeNone<ReturnType<Exclude<(typeof PoolApi.graphql.fetchLiquidityList)['__apiType'], undefined>>['liquidity_list']>['lqList'];
8
+ export type FetchMyLiquidityListLqList = ExcludeNone<ReturnType<Exclude<(typeof PoolApi.graphql.fetchMyLiquidityList)['__apiType'], undefined>>['liquidity_list']>['lqList'];
9
+ export type FetchMyCreateListLqList = ExcludeNone<ReturnType<Exclude<(typeof PoolApi.graphql.fetchDashboardPairList)['__apiType'], undefined>>['dashboard_pairs_list']>['list'];
10
+ export type FetchPoolList = ExcludeNone<ReturnType<Exclude<(typeof PoolApi.graphql.fetchPoolList)['__apiType'], undefined>>['pairs']>;
10
11
  export declare function convertLiquidityTokenToTokenInfo(token: {
11
12
  id: string;
12
13
  symbol: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dodoex/widgets",
3
- "version": "3.0.0",
3
+ "version": "3.0.1-taiko.2",
4
4
  "description": "DODO Widgets",
5
5
  "source": "src/index.tsx",
6
6
  "types": "dist/types/index.d.ts",
@@ -58,8 +58,8 @@
58
58
  },
59
59
  "dependencies": {
60
60
  "@babel/runtime": "^7.17.0",
61
- "@dodoex/api": "3.0.0",
62
- "@dodoex/components": "3.0.0",
61
+ "@dodoex/api": "3.0.1-taiko.1",
62
+ "@dodoex/components": "3.0.1-taiko-1",
63
63
  "@dodoex/icons": "^2.0.2",
64
64
  "@emotion/react": "^11.10.0",
65
65
  "@emotion/styled": "^11.10.0",
@@ -72,6 +72,8 @@
72
72
  "@semantic-release/changelog": "^6.0.1",
73
73
  "@semantic-release/git": "^10.0.1",
74
74
  "@tanstack/react-query": "^5.18.1",
75
+ "@uniswap/sdk-core": "^5.9.0",
76
+ "@uniswap/v2-sdk": "^4.6.2",
75
77
  "@web3-react/core": "8.2.0",
76
78
  "@web3-react/eip1193": "8.2.0",
77
79
  "@web3-react/metamask": "8.2.1",
@@ -147,4 +149,4 @@
147
149
  "ts-jest": "^29.0.1",
148
150
  "typescript": "^5.6.3"
149
151
  }
150
- }
152
+ }