@dodoex/api 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.
@@ -20,6 +20,9 @@ declare const contractMap: {
20
20
  DODO_V1_PAIR_PROXY?: string;
21
21
  /** DODOMineV3Proxy */
22
22
  DODO_MINEV3_PROXY: string;
23
+ /** UniswapV2Factory */
24
+ AMM_V2_FACTORY_ADDRESS?: string;
25
+ AMM_V2_ROUTER_ADDRESS?: string;
23
26
  };
24
27
  };
25
28
  export default contractMap;
@@ -25,11 +25,11 @@ export declare function graphql(source: '\n query FetchPoolList(\n $firs
25
25
  /**
26
26
  * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
27
27
  */
28
- export declare function graphql(source: '\n query FetchLiquidityList($where: Liquiditylist_filter) {\n liquidity_list(where: $where) {\n currentPage\n pageSize\n totalCount\n lqList {\n id\n pair {\n id\n chainId\n type\n lpFeeRate\n creator\n baseLpToken {\n id\n }\n quoteLpToken {\n id\n }\n baseToken {\n id\n symbol\n name\n decimals\n logoImg\n }\n quoteToken {\n id\n symbol\n name\n decimals\n logoImg\n }\n tvl\n apy {\n miningBaseApy\n miningQuoteApy\n transactionBaseApy\n transactionQuoteApy\n }\n miningAddress\n }\n }\n }\n }\n '): typeof import('./graphql').FetchLiquidityListDocument;
28
+ export declare function graphql(source: '\n query FetchLiquidityList($where: Liquiditylist_filter) {\n liquidity_list(where: $where) {\n currentPage\n pageSize\n totalCount\n lqList {\n id\n pair {\n id\n chainId\n type\n lpFeeRate\n mtFeeRate\n creator\n baseLpToken {\n id\n }\n quoteLpToken {\n id\n }\n baseToken {\n id\n symbol\n name\n decimals\n logoImg\n }\n quoteToken {\n id\n symbol\n name\n decimals\n logoImg\n }\n tvl\n apy {\n miningBaseApy\n miningQuoteApy\n transactionBaseApy\n transactionQuoteApy\n }\n miningAddress\n volume24H\n }\n }\n }\n }\n '): typeof import('./graphql').FetchLiquidityListDocument;
29
29
  /**
30
30
  * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
31
31
  */
32
- export declare function graphql(source: '\n query FetchMyLiquidityList($where: Liquiditylist_filter) {\n liquidity_list(where: $where) {\n lqList {\n id\n liquidityPositions {\n id\n liquidityTokenBalance\n }\n pair {\n id\n chainId\n type\n lpFeeRate\n creator\n baseLpToken {\n id\n }\n quoteLpToken {\n id\n }\n baseToken {\n id\n symbol\n name\n decimals\n logoImg\n }\n quoteToken {\n id\n symbol\n name\n decimals\n logoImg\n }\n tvl\n apy {\n miningBaseApy\n miningQuoteApy\n transactionBaseApy\n transactionQuoteApy\n }\n miningAddress\n }\n }\n }\n }\n '): typeof import('./graphql').FetchMyLiquidityListDocument;
32
+ export declare function graphql(source: '\n query FetchMyLiquidityList($where: Liquiditylist_filter) {\n liquidity_list(where: $where) {\n lqList {\n id\n liquidityPositions {\n id\n liquidityTokenBalance\n poolShare\n }\n pair {\n id\n chainId\n type\n lpFeeRate\n mtFeeRate\n creator\n baseLpToken {\n id\n }\n quoteLpToken {\n id\n }\n baseToken {\n id\n symbol\n name\n decimals\n logoImg\n }\n quoteToken {\n id\n symbol\n name\n decimals\n logoImg\n }\n tvl\n apy {\n miningBaseApy\n miningQuoteApy\n transactionBaseApy\n transactionQuoteApy\n }\n miningAddress\n volume24H\n }\n }\n }\n }\n '): typeof import('./graphql').FetchMyLiquidityListDocument;
33
33
  /**
34
34
  * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
35
35
  */
@@ -7448,6 +7448,8 @@ export type LiquidityLp = {
7448
7448
  id?: Maybe<Scalars['String']['output']>;
7449
7449
  liquidityTokenBalance?: Maybe<Scalars['String']['output']>;
7450
7450
  liquidityTokenInMining?: Maybe<Scalars['String']['output']>;
7451
+ /** Share in the pool */
7452
+ poolShare?: Maybe<Scalars['String']['output']>;
7451
7453
  };
7452
7454
  export type LiquidityListInfo = {
7453
7455
  chainIds?: Maybe<Array<Maybe<Scalars['Int']['output']>>>;
@@ -7581,6 +7583,8 @@ export type LiquidityPair = {
7581
7583
  untrackedBaseVolume: Scalars['BigDecimal']['output'];
7582
7584
  /** untracked quote volume */
7583
7585
  untrackedQuoteVolume: Scalars['BigDecimal']['output'];
7586
+ /** Trading volume in the last 24 hours */
7587
+ volume24H?: Maybe<Scalars['BigDecimal']['output']>;
7584
7588
  /** trade volume of basetoken */
7585
7589
  volumeBaseToken: Scalars['BigDecimal']['output'];
7586
7590
  /** trade volume of quotetoken */
@@ -20567,9 +20571,11 @@ export type FetchLiquidityListQuery = {
20567
20571
  chainId: number;
20568
20572
  type: string;
20569
20573
  lpFeeRate: any;
20574
+ mtFeeRate: any;
20570
20575
  creator: any;
20571
20576
  tvl?: any | null;
20572
20577
  miningAddress?: Array<string | null> | null;
20578
+ volume24H?: any | null;
20573
20579
  baseLpToken?: {
20574
20580
  id: string;
20575
20581
  } | null;
@@ -20610,15 +20616,18 @@ export type FetchMyLiquidityListQuery = {
20610
20616
  liquidityPositions?: Array<{
20611
20617
  id?: string | null;
20612
20618
  liquidityTokenBalance?: string | null;
20619
+ poolShare?: string | null;
20613
20620
  } | null> | null;
20614
20621
  pair?: {
20615
20622
  id: string;
20616
20623
  chainId: number;
20617
20624
  type: string;
20618
20625
  lpFeeRate: any;
20626
+ mtFeeRate: any;
20619
20627
  creator: any;
20620
20628
  tvl?: any | null;
20621
20629
  miningAddress?: Array<string | null> | null;
20630
+ volume24H?: any | null;
20622
20631
  baseLpToken?: {
20623
20632
  id: string;
20624
20633
  } | null;
@@ -0,0 +1,42 @@
1
+ declare const _default: ({
2
+ inputs: never[];
3
+ payable: boolean;
4
+ stateMutability: string;
5
+ type: string;
6
+ anonymous?: undefined;
7
+ name?: undefined;
8
+ constant?: undefined;
9
+ outputs?: undefined;
10
+ } | {
11
+ anonymous: boolean;
12
+ inputs: {
13
+ indexed: boolean;
14
+ internalType: string;
15
+ name: string;
16
+ type: string;
17
+ }[];
18
+ name: string;
19
+ type: string;
20
+ payable?: undefined;
21
+ stateMutability?: undefined;
22
+ constant?: undefined;
23
+ outputs?: undefined;
24
+ } | {
25
+ constant: boolean;
26
+ inputs: {
27
+ internalType: string;
28
+ name: string;
29
+ type: string;
30
+ }[];
31
+ name: string;
32
+ outputs: {
33
+ internalType: string;
34
+ name: string;
35
+ type: string;
36
+ }[];
37
+ payable: boolean;
38
+ stateMutability: string;
39
+ type: string;
40
+ anonymous?: undefined;
41
+ })[];
42
+ export default _default;
@@ -0,0 +1,51 @@
1
+ declare const _default: ({
2
+ inputs: {
3
+ internalType: string;
4
+ name: string;
5
+ type: string;
6
+ }[];
7
+ stateMutability: string;
8
+ type: string;
9
+ name?: undefined;
10
+ outputs?: undefined;
11
+ } | {
12
+ inputs: {
13
+ internalType: string;
14
+ name: string;
15
+ type: string;
16
+ }[];
17
+ name: string;
18
+ outputs: {
19
+ internalType: string;
20
+ name: string;
21
+ type: string;
22
+ }[];
23
+ stateMutability: string;
24
+ type: string;
25
+ } | {
26
+ inputs: {
27
+ components: {
28
+ internalType: string;
29
+ name: string;
30
+ type: string;
31
+ }[];
32
+ internalType: string;
33
+ name: string;
34
+ type: string;
35
+ }[];
36
+ name: string;
37
+ outputs: {
38
+ internalType: string;
39
+ name: string;
40
+ type: string;
41
+ }[];
42
+ stateMutability: string;
43
+ type: string;
44
+ } | {
45
+ stateMutability: string;
46
+ type: string;
47
+ inputs?: undefined;
48
+ name?: undefined;
49
+ outputs?: undefined;
50
+ })[];
51
+ export default _default;
@@ -68,5 +68,7 @@ export declare enum ABIName {
68
68
  dodoMineV3ProxyOld = "dodoMineV3ProxyOld",
69
69
  LockedTokenVaultABI = "LockedTokenVaultABI",
70
70
  DODOV1PmmHelperABI = "DODOV1PmmHelperABI",
71
- D3MM_READ_ABI = "D3MM_READ_ABI"
71
+ D3MM_READ_ABI = "D3MM_READ_ABI",
72
+ IUniswapV2Pair = "IUniswapV2Pair",
73
+ IUniswapV2Router02 = "IUniswapV2Router02"
72
74
  }
@@ -1,4 +1,5 @@
1
1
  export { ChainId, etherTokenAddress, basicTokenMap, contractConfig, platformIdMap, } from './chainConfig';
2
+ export { setContractRequests } from '@dodoex/dodo-contract-request';
2
3
  export { default as RestApiRequests } from './helper/RestApiRequests';
3
4
  export { default as GraphQLRequests } from './helper/GraphQLRequests';
4
5
  export { default as ContractRequests, ABIName, CONTRACT_QUERY_KEY, } from './helper/ContractRequests';
@@ -12,4 +13,5 @@ export type { MiningMiningInfo } from './services/mining';
12
13
  export { TokenApi } from './services/TokenApi';
13
14
  export { SwapApi } from './services/swap/SwapApi';
14
15
  export { SystemApi } from './services/system/SystemApi';
15
- export type ExcludeNone<T> = Exclude<Exclude<T, undefined>, null>;
16
+ export { UniPoolV2Api } from './services/UniPoolV2Api';
17
+ export type ExcludeNone<T> = NonNullable<T>;
@@ -0,0 +1,40 @@
1
+ import { ChainId } from '../chainConfig';
2
+ import ContractRequests, { ContractRequestsConfig } from '../helper/ContractRequests';
3
+ import { BigNumber as BigNumberEther } from '@ethersproject/bignumber';
4
+ export interface UniPoolV2ApiProps {
5
+ contractRequests?: ContractRequests;
6
+ contractRequestsConfig?: ContractRequestsConfig;
7
+ }
8
+ export declare class UniPoolV2Api {
9
+ contractRequests: ContractRequests;
10
+ constructor(config: UniPoolV2ApiProps);
11
+ static encode: {
12
+ addLiquidityABI(chainId: ChainId, tokenA: string, tokenB: string, baseInAmount: string, quoteInAmount: string, baseInAmountMin: string, quoteInAmountMin: string, account: string, deadline: number, fee?: string): Promise<{
13
+ data: string;
14
+ to: string;
15
+ }>;
16
+ addLiquidityETHABI(chainId: ChainId, tokenAddress: string, tokenInAmount: string, tokenInAmountMin: string, ethAmountMin: string, account: string, deadline: number, fee?: string): Promise<{
17
+ data: string;
18
+ to: string;
19
+ }>;
20
+ };
21
+ getReserves(chainId: number | undefined, address: string | undefined): {
22
+ queryKey: (string | number | undefined)[];
23
+ enabled: boolean;
24
+ queryFn: () => Promise<{
25
+ _reserve0: BigNumberEther;
26
+ _reserve1: BigNumberEther;
27
+ _blockTimestampLast: number;
28
+ } | null>;
29
+ };
30
+ getTotalSupply(chainId: number | undefined, address: string | undefined): {
31
+ queryKey: (string | number | undefined)[];
32
+ enabled: boolean;
33
+ queryFn: () => Promise<BigNumberEther | null>;
34
+ };
35
+ getBalance(chainId: number | undefined, address: string | undefined, account: string | undefined): {
36
+ queryKey: (string | number | undefined)[];
37
+ enabled: boolean;
38
+ queryFn: () => Promise<BigNumberEther | null>;
39
+ };
40
+ }
@@ -333,6 +333,7 @@ export declare class PoolApi {
333
333
  };
334
334
  /**
335
335
  * Get the total deposited lp balance
336
+ * The base and quote of the AMM pool should be passed in in order
336
337
  */
337
338
  getReserveLpQuery(chainId: number | undefined, poolAddress: string | undefined, type: PoolType | undefined, baseDecimals: number | undefined, quoteDecimals: number | undefined): {
338
339
  queryKey: any[];
@@ -1 +1 @@
1
- export type PoolType = 'DVM' | 'DSP' | 'GSP' | 'LPTOKEN' | 'CLASSICAL' | 'V3CLASSICAL' | 'DPP';
1
+ export type PoolType = 'DVM' | 'DSP' | 'GSP' | 'LPTOKEN' | 'CLASSICAL' | 'V3CLASSICAL' | 'DPP' | 'AMMV2' | 'AMMV3';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dodoex/api",
3
- "version": "3.0.0",
3
+ "version": "3.0.1-taiko.2",
4
4
  "description": "DODO API Kit",
5
5
  "source": "src/index.ts",
6
6
  "types": "dist/types/index.d.ts",
@@ -52,6 +52,8 @@
52
52
  ]
53
53
  },
54
54
  "peerDependencies": {
55
+ "@dodoex/contract-request": "^1.0.1",
56
+ "@dodoex/dodo-contract-request": "1.3.1",
55
57
  "bignumber.js": ">=9",
56
58
  "lodash": ">=4"
57
59
  },
@@ -101,4 +103,4 @@
101
103
  "ts-jest": "^29.0.1",
102
104
  "typescript": "^5.6.3"
103
105
  }
104
- }
106
+ }