@reef-chain/react-lib 2.0.2-alpha1 → 2.0.2-alpha2
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.
- package/dist/components/AccountSelector/AccountSelector.d.ts +1 -1
- package/dist/components/common/Icons/index.d.ts +6 -1
- package/dist/graphql/pools.d.ts +7 -2
- package/dist/graphql/utils.d.ts +2 -2
- package/dist/hooks/poolHooks.d.ts +2 -8
- package/dist/hooks/useAddLiquidity.d.ts +1 -1
- package/dist/hooks/useAllPools.d.ts +2 -4
- package/dist/hooks/useInitReefState.d.ts +1 -0
- package/dist/hooks/useLoadPool.d.ts +3 -9
- package/dist/hooks/useLoadPools.d.ts +1 -1
- package/dist/hooks/usePoolData.d.ts +1 -1
- package/dist/hooks/usePoolLists.d.ts +3 -3
- package/dist/hooks/usePoolStats.d.ts +1 -1
- package/dist/hooks/useRemoveLiquidity.d.ts +1 -1
- package/dist/hooks/useSwapState.d.ts +1 -1
- package/dist/hooks/useTransactionHistory.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +4 -4
- package/dist/index.modern.js.map +1 -1
- package/dist/state/network.d.ts +5 -12
- package/dist/state/token.d.ts +1 -1
- package/dist/utils/utils.d.ts +0 -6
- package/package.json +4 -3
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const DEFAULT_TOKEN_ICONS: string[];
|
|
3
2
|
interface BaseIcon {
|
|
4
3
|
small?: boolean;
|
|
5
4
|
}
|
|
@@ -26,6 +25,12 @@ interface TokenIcon extends BaseIcon {
|
|
|
26
25
|
src: string;
|
|
27
26
|
address?: string;
|
|
28
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Returns icon url if exists, otherwise return sample icon based on calculated
|
|
30
|
+
* checksum from provided address. Returned sample icon is svg encoded to base64
|
|
31
|
+
* and prefixed with data string, so it can be used directly with <img /> tag.
|
|
32
|
+
*/
|
|
33
|
+
export declare const getIconUrl: (tokenAddress?: string) => string;
|
|
29
34
|
export declare const TokenIcon: ({ src, address }: TokenIcon) => JSX.Element;
|
|
30
35
|
interface ReefAddressIcon {
|
|
31
36
|
address: string;
|
package/dist/graphql/pools.d.ts
CHANGED
|
@@ -291,6 +291,11 @@ export interface PoolTransactionVar extends PoolBasicTransactionVar, OffsetVar,
|
|
|
291
291
|
export interface PoolsListVar extends PoolSearchVar, PaginationVar {
|
|
292
292
|
}
|
|
293
293
|
export type PoolsListCountVar = PoolSearchVar;
|
|
294
|
+
export type PoolQueryType = 'User' | 'All';
|
|
295
|
+
export type PoolQueryObject = {
|
|
296
|
+
query: string;
|
|
297
|
+
variables: any;
|
|
298
|
+
};
|
|
294
299
|
export declare const POOLS_TOTAL_VALUE_LOCKED = "\n query totalSupply($toTime: String!) {\n totalSupply(toTime: $toTime) {\n pool {\n address\n token1\n token2\n }\n reserved1\n reserved2\n }\n }\n";
|
|
295
300
|
export declare const POOL_24H_VOLUME = "\n query volume($fromTime: String!) {\n volume(fromTime: $fromTime) {\n pool {\n address\n token1\n token2\n }\n amount1\n amount2\n }\n }\n";
|
|
296
301
|
export declare const POOL_SUPPLY_GQL = "\n query poolSupply($address: String!) {\n poolMinuteSupplies(\n where: { poolId_eq: $address }\n orderBy: timeframe_DESC\n limit: 1\n ) {\n totalSupply\n supply\n }\n }\n";
|
|
@@ -302,8 +307,8 @@ export declare const POOL_FEES_GQL = "\n query poolFee(\n $address: String!\
|
|
|
302
307
|
export declare const POOL_GQL = "\n query pool($address: String!) {\n poolById(id: $address) {\n id\n token1 {\n id\n decimals\n name\n symbol\n iconUrl\n }\n token2 {\n id\n decimals\n name\n symbol\n iconUrl\n }\n decimals\n }\n }\n";
|
|
303
308
|
export declare const POOL_CURRENT_RESERVES_GQL = "\n query poolEvent($address: String!) {\n poolEvents(\n where: { pool: { id_eq: $address }, type_eq: Sync }\n orderBy: timestamp_DESC\n limit: 1\n ) {\n reserved1\n reserved2\n }\n }\n";
|
|
304
309
|
export declare const POOLS_RESERVES_GQL = "\n query poolsReserves($tokens: [String!]!) {\n poolsReserves(tokens: $tokens) {\n token1\n token2\n reserved1\n reserved2\n }\n }\n";
|
|
305
|
-
export declare const POOL_TRANSACTIONS_GQL = "\n query transactions(\n $search: String!\n $type: [PoolType!]\n $offset: Int!\n $limit: Int!\n ) {\n poolEvents(\n limit: $limit
|
|
306
|
-
export declare const POOL_TRANSACTION_COUNT_GQL = "\n query transactionCount(\n $search: String!\n $type: [PoolType!]\n ) {\n poolEventsConnection(\n orderBy: timestamp_DESC
|
|
310
|
+
export declare const POOL_TRANSACTIONS_GQL = "\n query transactions(\n $search: String!\n $type: [PoolType!]\n $offset: Int!\n $limit: Int!\n ) {\n poolEvents(\n limit: $limit,\n offset: $offset,\n orderBy: timestamp_DESC,\n where: {\n pool: {\n id_containsInsensitive: $search,\n AND: { verified_eq: true }\n },\n AND: {type_in: $type}\n }\n ) {\n id\n amount1\n amount2\n amountIn1\n amountIn2\n senderAddress\n toAddress\n blockHeight\n indexInBlock\n timestamp\n type\n pool {\n token1 {\n decimals\n symbol\n }\n token2 {\n decimals\n symbol\n }\n }\n signerAddress\n }\n }\n";
|
|
311
|
+
export declare const POOL_TRANSACTION_COUNT_GQL = "\n query transactionCount(\n $search: String!\n $type: [PoolType!]\n ) {\n poolEventsConnection(\n orderBy: timestamp_DESC,\n where: {\n pool: {\n id_containsInsensitive: $search,\n AND: { verified_eq: true }\n },\n AND: {type_in: $type}\n }\n ) {\n totalCount\n }\n }\n";
|
|
307
312
|
type Time = 'Day' | 'Hour' | 'Minute';
|
|
308
313
|
export declare const POOL_DAY_TVL_GQL: string;
|
|
309
314
|
export declare const POOL_HOUR_TVL_GQL: string;
|
package/dist/graphql/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AxiosInstance } from
|
|
1
|
+
import { AxiosInstance, AxiosResponse } from 'axios';
|
|
2
2
|
export declare const graphqlRequest: (httpClient: AxiosInstance, queryObj: {
|
|
3
3
|
query: string;
|
|
4
4
|
variables: any;
|
|
5
|
-
}, isExplorer?: boolean) => Promise<
|
|
5
|
+
}, isExplorer?: boolean) => Promise<AxiosResponse>;
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
import { PoolDayFeeQuery, PoolDayVolumeQuery, PoolFeeQuery, PoolQuery, PoolReservesQuery, PoolSupplyQuery, PoolTransactionCountQuery, PoolTransactionQuery, PoolDayTvlQuery, PoolVolumeAggregateQuery, TransactionTypes } from '../graphql/pools';
|
|
2
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { PoolDayFeeQuery, PoolDayVolumeQuery, PoolFeeQuery, PoolQuery, PoolReservesQuery, PoolSupplyQuery, PoolTransactionCountQuery, PoolTransactionQuery, PoolDayTvlQuery, PoolVolumeAggregateQuery, TransactionTypes, PoolQueryObject } from '../graphql/pools';
|
|
3
3
|
export declare const useDayVolume: (address: string, fromTime: string, toTime: string) => PoolVolumeAggregateQuery;
|
|
4
4
|
export declare const useCurrentPoolSupply: (address: string) => PoolSupplyQuery;
|
|
5
|
-
export declare const getPoolFeesQuery: (address: string, fromTime: string) =>
|
|
6
|
-
query: string;
|
|
7
|
-
variables: {
|
|
8
|
-
address: string;
|
|
9
|
-
fromTime: string;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
5
|
+
export declare const getPoolFeesQuery: (address: string, fromTime: string) => PoolQueryObject;
|
|
12
6
|
export declare const useDayFee: (address: string, fromTime: string) => PoolFeeQuery;
|
|
13
7
|
export declare const usePoolQuery: (address: string) => PoolQuery;
|
|
14
8
|
export declare const useCurrentPoolReserve: (address: string) => PoolReservesQuery;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Dispatch } from 'react';
|
|
2
|
+
import { AxiosInstance } from 'axios';
|
|
2
3
|
import { AddressToNumber, Network, NotifyFun, ReefSigner, Token } from '../state';
|
|
3
4
|
import { AddLiquidityActions } from '../store/actions/addLiquidity';
|
|
4
5
|
import { AddLiquidityState } from '../store/reducers/addLiquidity';
|
|
5
|
-
import { AxiosInstance } from 'axios';
|
|
6
6
|
interface UseAddLiquidityState {
|
|
7
7
|
address1: string;
|
|
8
8
|
address2: string;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { PoolQueryObject } from '../graphql/pools';
|
|
2
3
|
import { PoolWithReserves } from '../state';
|
|
3
|
-
export declare const getAllPoolsQuery: () =>
|
|
4
|
-
query: string;
|
|
5
|
-
variables: {};
|
|
6
|
-
};
|
|
4
|
+
export declare const getAllPoolsQuery: () => PoolQueryObject;
|
|
7
5
|
export declare const useAllPools: (httpClient: AxiosInstance) => PoolWithReserves[];
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
import { Pool, Token } from '..';
|
|
2
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { Pool, Token } from '..';
|
|
3
|
+
import { PoolQueryObject } from '../graphql/pools';
|
|
3
4
|
type LoadingPool = Pool | undefined;
|
|
4
|
-
export declare const getUserPoolSupply: (token1: string, token2: string, signerAddress: string) =>
|
|
5
|
-
query: string;
|
|
6
|
-
variables: {
|
|
7
|
-
token1: string;
|
|
8
|
-
token2: string;
|
|
9
|
-
signerAddress: string;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
5
|
+
export declare const getUserPoolSupply: (token1: string, token2: string, signerAddress: string) => PoolQueryObject;
|
|
12
6
|
export declare const loadPool: (token1: Token, token2: Token, signerAddress: string, httpClient: AxiosInstance) => Promise<Pool>;
|
|
13
7
|
export declare const useLoadPool: (token1: Token, token2: Token, userAddress: string, httpClient?: AxiosInstance, disable?: boolean) => [LoadingPool, boolean];
|
|
14
8
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Token, Pool } from '..';
|
|
2
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { Token, Pool } from '..';
|
|
3
3
|
export declare const loadPools: (tokens: Token[], userAddress: string, httpClient: AxiosInstance) => Promise<Pool[]>;
|
|
4
4
|
export declare const useLoadPools: (tokens: Token[], userAddress: string, httpClient?: AxiosInstance) => [Pool[], boolean];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PoolsListVar } from '../graphql/pools';
|
|
2
|
-
import { TokenPrices } from '../state';
|
|
3
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { PoolsListVar, PoolQueryType } from '../graphql/pools';
|
|
3
|
+
import { TokenPrices } from '../state';
|
|
4
4
|
interface PoolItem {
|
|
5
5
|
address: string;
|
|
6
6
|
tvl: string;
|
|
@@ -19,7 +19,7 @@ interface PoolItem {
|
|
|
19
19
|
interface UsePoolsList extends PoolsListVar {
|
|
20
20
|
tokenPrices: TokenPrices;
|
|
21
21
|
httpClient: AxiosInstance;
|
|
22
|
-
queryType:
|
|
22
|
+
queryType: PoolQueryType;
|
|
23
23
|
}
|
|
24
24
|
export declare const usePoolsList: ({ limit, offset, search, signerAddress, tokenPrices, queryType, httpClient, }: UsePoolsList) => [PoolItem[], boolean, number];
|
|
25
25
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TokenPrices } from '../state';
|
|
2
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { TokenPrices } from '../state';
|
|
3
3
|
export declare const useTotalSupply: (tokenPrices: TokenPrices, httpClient: AxiosInstance, previous?: boolean) => string;
|
|
4
4
|
export declare const usePoolVolume: (tokenPrices: TokenPrices, httpClient: AxiosInstance) => string;
|
|
5
5
|
export interface TokenStats {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Dispatch } from 'react';
|
|
2
|
+
import { AxiosInstance } from 'axios';
|
|
2
3
|
import { AddressToNumber, Network, NotifyFun, ReefSigner, Token } from '../state';
|
|
3
4
|
import { RemoveLiquidityActions, RemoveLiquidityState } from '../store';
|
|
4
|
-
import { AxiosInstance } from 'axios';
|
|
5
5
|
interface OnRemoveLiquidity {
|
|
6
6
|
network?: Network;
|
|
7
7
|
signer?: ReefSigner;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Dispatch } from 'react';
|
|
2
|
+
import { AxiosInstance } from 'axios';
|
|
2
3
|
import { AddressToNumber, Network, NotifyFun, Pool, ReefSigner, Token } from '../state';
|
|
3
4
|
import { SwapAction } from '../store';
|
|
4
5
|
import { SwapState } from '../store/reducers/swap';
|
|
5
|
-
import { AxiosInstance } from 'axios';
|
|
6
6
|
interface UseSwapState {
|
|
7
7
|
address1: string;
|
|
8
8
|
address2: string;
|