@qidao/sdk 5.1.1 → 5.1.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 (84) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/index.js.map +1 -1
  3. package/dist/index.modern.mjs.map +1 -1
  4. package/dist/index.module.js +1 -1
  5. package/dist/index.module.js.map +1 -1
  6. package/dist/index.umd.js +1 -1
  7. package/dist/index.umd.js.map +1 -1
  8. package/package.json +1 -1
  9. package/dist/constants/addresses.d.ts +0 -31
  10. package/dist/constants/index.d.ts +0 -20
  11. package/dist/constants/kashi.d.ts +0 -29
  12. package/dist/constants/natives.d.ts +0 -30
  13. package/dist/constants/numbers.d.ts +0 -11
  14. package/dist/constants/tokens.d.ts +0 -5
  15. package/dist/entities/AbstractCurrency.d.ts +0 -53
  16. package/dist/entities/ConstantProductPool.d.ts +0 -43
  17. package/dist/entities/Currency.d.ts +0 -3
  18. package/dist/entities/CurrencyAmount.d.ts +0 -38
  19. package/dist/entities/Fraction.d.ts +0 -25
  20. package/dist/entities/MultiRouter.d.ts +0 -59
  21. package/dist/entities/Native/Avalanche.d.ts +0 -10
  22. package/dist/entities/Native/Binance.d.ts +0 -10
  23. package/dist/entities/Native/Celo.d.ts +0 -10
  24. package/dist/entities/Native/Ether.d.ts +0 -13
  25. package/dist/entities/Native/Fantom.d.ts +0 -10
  26. package/dist/entities/Native/Fuse.d.ts +0 -10
  27. package/dist/entities/Native/Harmony.d.ts +0 -10
  28. package/dist/entities/Native/Heco.d.ts +0 -10
  29. package/dist/entities/Native/Matic.d.ts +0 -10
  30. package/dist/entities/Native/Movr.d.ts +0 -10
  31. package/dist/entities/Native/Okex.d.ts +0 -10
  32. package/dist/entities/Native/Palm.d.ts +0 -10
  33. package/dist/entities/Native/Telos.d.ts +0 -10
  34. package/dist/entities/Native/index.d.ts +0 -14
  35. package/dist/entities/Native/xDai.d.ts +0 -10
  36. package/dist/entities/NativeCurrency.d.ts +0 -8
  37. package/dist/entities/Pair.d.ts +0 -41
  38. package/dist/entities/Percent.d.ts +0 -15
  39. package/dist/entities/Price.d.ts +0 -39
  40. package/dist/entities/Route.d.ts +0 -14
  41. package/dist/entities/Token.d.ts +0 -33
  42. package/dist/entities/Trade.d.ts +0 -107
  43. package/dist/entities/eip712.d.ts +0 -78
  44. package/dist/entities/index.d.ts +0 -14
  45. package/dist/enums/ChainId.d.ts +0 -32
  46. package/dist/enums/Fee.d.ts +0 -3
  47. package/dist/enums/KashiAction.d.ts +0 -18
  48. package/dist/enums/OrderStatus.d.ts +0 -6
  49. package/dist/enums/Rounding.d.ts +0 -5
  50. package/dist/enums/TradeType.d.ts +0 -4
  51. package/dist/enums/index.d.ts +0 -6
  52. package/dist/errors.d.ts +0 -16
  53. package/dist/functions/bentobox.d.ts +0 -3
  54. package/dist/functions/computeConstantProductPoolAddress.d.ts +0 -9
  55. package/dist/functions/computePairAddress.d.ts +0 -6
  56. package/dist/functions/computePoolInitCodeHash.d.ts +0 -5
  57. package/dist/functions/computePriceImpact.d.ts +0 -11
  58. package/dist/functions/index.d.ts +0 -8
  59. package/dist/functions/kashi.d.ts +0 -9
  60. package/dist/functions/rebase.d.ts +0 -4
  61. package/dist/functions/sortedInsert.d.ts +0 -1
  62. package/dist/functions/sqrt.d.ts +0 -7
  63. package/dist/functions/validateAndParseAddress.d.ts +0 -1
  64. package/dist/functions/validateSolidityTypeInstance.d.ts +0 -3
  65. package/dist/index.d.ts +0 -12
  66. package/dist/interfaces/AccrueInfo.d.ts +0 -6
  67. package/dist/interfaces/Rebase.d.ts +0 -5
  68. package/dist/interfaces/index.d.ts +0 -2
  69. package/dist/limitorder.d.ts +0 -115
  70. package/dist/router.d.ts +0 -68
  71. package/dist/sdk.cjs.development.js +0 -5301
  72. package/dist/sdk.cjs.development.js.map +0 -1
  73. package/dist/sdk.cjs.production.min.js +0 -2
  74. package/dist/sdk.cjs.production.min.js.map +0 -1
  75. package/dist/sdk.esm.js +0 -5162
  76. package/dist/sdk.esm.js.map +0 -1
  77. package/dist/types/AddressMap.d.ts +0 -3
  78. package/dist/types/BigIntIsh.d.ts +0 -2
  79. package/dist/types/ChainTokenMap.d.ts +0 -5
  80. package/dist/types/LimitOrderTypes.d.ts +0 -21
  81. package/dist/types/MultiRouterTypes.d.ts +0 -97
  82. package/dist/types/TokenMap.d.ts +0 -4
  83. package/dist/types/index.d.ts +0 -4
  84. package/dist/utils/MultiRouterMath.d.ts +0 -15
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@qidao/sdk",
3
3
  "license": "MIT",
4
- "version": "5.1.1",
4
+ "version": "5.1.2",
5
5
  "description": "🛠 An SDK for building applications on top of QiDao Protocol.",
6
6
  "main": "./dist/index.js",
7
7
  "umd:main": "dist/index.umd.js",
@@ -1,31 +0,0 @@
1
- import { AddressMap } from '../types';
2
- export declare const USDC_ADDRESS: AddressMap;
3
- export declare const USD_ADDRESS: AddressMap;
4
- export declare const FACTORY_ADDRESS: AddressMap;
5
- export declare const ROUTER_ADDRESS: AddressMap;
6
- export declare const SUSHI_ADDRESS: AddressMap;
7
- export declare const MASTERCHEF_ADDRESS: AddressMap;
8
- export declare const BAR_ADDRESS: AddressMap;
9
- export declare const MAKER_ADDRESS: AddressMap;
10
- export declare const TIMELOCK_ADDRESS: AddressMap;
11
- export declare const BENTOBOX_ADDRESS: AddressMap;
12
- export declare const KASHI_ADDRESS: AddressMap;
13
- export declare const SUSHISWAP_SWAPPER_ADDRESS: AddressMap;
14
- export declare const SUSHISWAP_MULTISWAPPER_ADDRESS: AddressMap;
15
- export declare const SUSHISWAP_MULTI_EXACT_SWAPPER_ADDRESS: AddressMap;
16
- export declare const PEGGED_ORACLE_ADDRESS = "0x6cbfbB38498Df0E1e7A4506593cDB02db9001564";
17
- export declare const SUSHISWAP_TWAP_0_ORACLE_ADDRESS = "0x66F03B0d30838A3fee971928627ea6F59B236065";
18
- export declare const SUSHISWAP_TWAP_1_ORACLE_ADDRESS = "0x0D51b575591F8f74a2763Ade75D3CDCf6789266f";
19
- export declare const CHAINLINK_ORACLE_ADDRESS: AddressMap;
20
- export declare const BORING_HELPER_ADDRESS: AddressMap;
21
- export declare const STOP_LIMIT_ORDER_ADDRESS: AddressMap;
22
- export declare const ARCHER_ROUTER_ADDRESS: AddressMap;
23
- export declare const MINICHEF_ADDRESS: AddressMap;
24
- export declare const OLD_FARMS: AddressMap;
25
- export declare const WETH9_ADDRESS: AddressMap;
26
- export declare const WNATIVE_ADDRESS: AddressMap;
27
- export declare const MASTERCHEF_V2_ADDRESS: AddressMap;
28
- export declare const ENS_REGISTRAR_ADDRESS: AddressMap;
29
- export declare const ZAPPER_ADDRESS: AddressMap;
30
- export declare const MERKLE_DISTRIBUTOR_ADDRESS: AddressMap;
31
- export declare const MULTICALL2_ADDRESS: AddressMap;
@@ -1,20 +0,0 @@
1
- import JSBI from 'jsbi';
2
- export * from './addresses';
3
- export * from './kashi';
4
- export * from './natives';
5
- export * from './numbers';
6
- export * from './tokens';
7
- export declare const INIT_CODE_HASH: {
8
- [chainId: number]: string;
9
- };
10
- export declare const MINIMUM_LIQUIDITY: JSBI;
11
- export declare enum SolidityType {
12
- uint8 = "uint8",
13
- uint256 = "uint256"
14
- }
15
- export declare const SOLIDITY_TYPE_MAXIMA: {
16
- uint8: JSBI;
17
- uint256: JSBI;
18
- };
19
- export declare const LAMBDA_URL = "https://9epjsvomc4.execute-api.us-east-1.amazonaws.com/dev";
20
- export declare const SOCKET_URL = "wss://hfimt374ge.execute-api.us-east-1.amazonaws.com/dev";
@@ -1,29 +0,0 @@
1
- import { BigNumber } from '@ethersproject/bignumber';
2
- export declare const ACTION_ADD_ASSET = 1;
3
- export declare const ACTION_REPAY = 2;
4
- export declare const ACTION_REMOVE_ASSET = 3;
5
- export declare const ACTION_REMOVE_COLLATERAL = 4;
6
- export declare const ACTION_BORROW = 5;
7
- export declare const ACTION_GET_REPAY_SHARE = 6;
8
- export declare const ACTION_GET_REPAY_PART = 7;
9
- export declare const ACTION_ACCRUE = 8;
10
- export declare const ACTION_ADD_COLLATERAL = 10;
11
- export declare const ACTION_UPDATE_EXCHANGE_RATE = 11;
12
- export declare const ACTION_BENTO_DEPOSIT = 20;
13
- export declare const ACTION_BENTO_WITHDRAW = 21;
14
- export declare const ACTION_BENTO_TRANSFER = 22;
15
- export declare const ACTION_BENTO_TRANSFER_MULTIPLE = 23;
16
- export declare const ACTION_BENTO_SETAPPROVAL = 24;
17
- export declare const ACTION_CALL = 30;
18
- export declare const MINIMUM_TARGET_UTILIZATION: BigNumber;
19
- export declare const MAXIMUM_TARGET_UTILIZATION: BigNumber;
20
- export declare const UTILIZATION_PRECISION: BigNumber;
21
- export declare const FULL_UTILIZATION: BigNumber;
22
- export declare const FULL_UTILIZATION_MINUS_MAX: BigNumber;
23
- export declare const STARTING_INTEREST_PER_YEAR: BigNumber;
24
- export declare const MINIMUM_INTEREST_PER_YEAR: BigNumber;
25
- export declare const MAXIMUM_INTEREST_PER_YEAR: BigNumber;
26
- export declare const INTEREST_ELASTICITY: BigNumber;
27
- export declare const FACTOR_PRECISION: BigNumber;
28
- export declare const PROTOCOL_FEE: BigNumber;
29
- export declare const PROTOCOL_FEE_DIVISOR: BigNumber;
@@ -1,30 +0,0 @@
1
- import { Avalanche, Binance, Celo, Ether, Fantom, Fuse, Harmony, Heco, Matic, Movr, Okex, Palm, xDai, Telos } from '../entities/Native';
2
- import { ChainId } from '../enums';
3
- export declare const NATIVE: {
4
- 1: Ether;
5
- 3: Ether;
6
- 4: Ether;
7
- 5: Ether;
8
- 42: Ether;
9
- 250: Fantom;
10
- 4002: Fantom;
11
- 137: Matic;
12
- 80001: Matic;
13
- 100: xDai;
14
- 56: Binance;
15
- 97: Binance;
16
- 42161: Ether;
17
- 43114: Avalanche;
18
- 43113: Avalanche;
19
- 128: Heco;
20
- 256: Heco;
21
- 1666600000: Harmony;
22
- 1666700000: Harmony;
23
- 66: Okex;
24
- 65: Okex;
25
- 42220: Celo;
26
- 11297108109: Palm;
27
- 1285: Movr;
28
- 122: Fuse;
29
- 40: Telos;
30
- };
@@ -1,11 +0,0 @@
1
- import JSBI from 'jsbi';
2
- export declare const MaxUint256: JSBI;
3
- export declare const ZERO: JSBI;
4
- export declare const ONE: JSBI;
5
- export declare const TWO: JSBI;
6
- export declare const THREE: JSBI;
7
- export declare const FIVE: JSBI;
8
- export declare const TEN: JSBI;
9
- export declare const _100: JSBI;
10
- export declare const _997: JSBI;
11
- export declare const _1000: JSBI;
@@ -1,5 +0,0 @@
1
- import { TokenMap } from '../types/TokenMap';
2
- export declare const USDC: TokenMap;
3
- export declare const USD: TokenMap;
4
- export declare const WETH9: TokenMap;
5
- export declare const WNATIVE: TokenMap;
@@ -1,53 +0,0 @@
1
- import { Currency } from './Currency';
2
- import { Token } from './Token';
3
- /**
4
- * A currency is any fungible financial instrument, including Ether, all ERC20 tokens, and other chain-native currencies
5
- */
6
- export declare abstract class AbstractCurrency {
7
- /**
8
- * Returns whether the currency is native to the chain and must be wrapped (e.g. Ether)
9
- */
10
- abstract readonly isNative: boolean;
11
- /**
12
- * Returns whether the currency is a token that is usable in Uniswap without wrapping
13
- */
14
- abstract readonly isToken: boolean;
15
- /**
16
- * The chain ID on which this currency resides
17
- */
18
- readonly chainId: number;
19
- /**
20
- * The decimals used in representing currency amounts
21
- */
22
- readonly decimals: number;
23
- /**
24
- * The symbol of the currency, i.e. a short textual non-unique identifier
25
- */
26
- readonly symbol?: string;
27
- /**
28
- * The name of the currency, i.e. a descriptive textual non-unique identifier
29
- */
30
- readonly name?: string;
31
- /**
32
- * Constructs an instance of the base class `BaseCurrency`.
33
- * @param chainId the chain ID on which this currency resides
34
- * @param decimals decimals of the currency
35
- * @param symbol symbol of the currency
36
- * @param name of the currency
37
- */
38
- protected constructor(chainId: number, decimals: number, symbol?: string, name?: string);
39
- /**
40
- * Returns whether this currency is functionally equivalent to the other currency
41
- * @param other the other currency
42
- */
43
- abstract equals(other: Currency): boolean;
44
- /**
45
- * Return the wrapped version of this currency that can be used with the Uniswap contracts. Currencies must
46
- * implement this to be used in Uniswap
47
- */
48
- abstract get wrapped(): Token;
49
- /**
50
- * Returns token address. Useful in cases where a dependency is needed to detect changes (e.g. useEffect).
51
- */
52
- serialize(): string;
53
- }
@@ -1,43 +0,0 @@
1
- import { CurrencyAmount } from './CurrencyAmount';
2
- import { Fee } from '../enums';
3
- import { Price } from './Price';
4
- import { Token } from './Token';
5
- export declare class ConstantProductPool {
6
- readonly liquidityToken: Token;
7
- readonly fee: Fee;
8
- readonly twap: boolean;
9
- private readonly tokenAmounts;
10
- static getAddress(tokenA: Token, tokenB: Token, fee?: Fee, twap?: boolean): string;
11
- constructor(currencyAmountA: CurrencyAmount<Token>, currencyAmountB: CurrencyAmount<Token>, fee?: Fee, twap?: boolean);
12
- /**
13
- * Returns true if the token is either token0 or token1
14
- * @param token to check
15
- */
16
- involvesToken(token: Token): boolean;
17
- /**
18
- * Returns the current mid price of the pair in terms of token0, i.e. the ratio of reserve1 to reserve0
19
- */
20
- get token0Price(): Price<Token, Token>;
21
- /**
22
- * Returns the current mid price of the pair in terms of token1, i.e. the ratio of reserve0 to reserve1
23
- */
24
- get token1Price(): Price<Token, Token>;
25
- /**
26
- * Return the price of the given token in terms of the other token in the pair.
27
- * @param token token to return price of
28
- */
29
- priceOf(token: Token): Price<Token, Token>;
30
- /**
31
- * Returns the chain ID of the tokens in the pair.
32
- */
33
- get chainId(): number;
34
- get token0(): Token;
35
- get token1(): Token;
36
- get reserve0(): CurrencyAmount<Token>;
37
- get reserve1(): CurrencyAmount<Token>;
38
- reserveOf(token: Token): CurrencyAmount<Token>;
39
- getOutputAmount(inputAmount: CurrencyAmount<Token>): [CurrencyAmount<Token>, ConstantProductPool];
40
- getInputAmount(outputAmount: CurrencyAmount<Token>): [CurrencyAmount<Token>, ConstantProductPool];
41
- getLiquidityMinted(totalSupply: CurrencyAmount<Token>, tokenAmountA: CurrencyAmount<Token>, tokenAmountB: CurrencyAmount<Token>): CurrencyAmount<Token>;
42
- getLiquidityValue(token: Token, totalSupply: CurrencyAmount<Token>, liquidity: CurrencyAmount<Token>): CurrencyAmount<Token>;
43
- }
@@ -1,3 +0,0 @@
1
- import { NativeCurrency } from './NativeCurrency';
2
- import { Token } from './Token';
3
- export declare type Currency = NativeCurrency | Token;
@@ -1,38 +0,0 @@
1
- import { BigintIsh } from '../types';
2
- import { Currency } from './Currency';
3
- import { Fraction } from './Fraction';
4
- import JSBI from 'jsbi';
5
- import { Rounding } from '../enums';
6
- import { Token } from './Token';
7
- export declare class CurrencyAmount<T extends Currency> extends Fraction {
8
- readonly currency: T;
9
- readonly decimalScale: JSBI;
10
- /**
11
- * Returns a new currency amount instance from the unitless amount of token, i.e. the raw amount
12
- * @param currency the currency in the amount
13
- * @param rawAmount the raw token or ether amount
14
- */
15
- static fromRawAmount<T extends Currency>(currency: T, rawAmount: BigintIsh): CurrencyAmount<T>;
16
- /**
17
- * Construct a currency amount with a denominator that is not equal to 1
18
- * @param currency the currency
19
- * @param numerator the numerator of the fractional token amount
20
- * @param denominator the denominator of the fractional token amount
21
- */
22
- static fromFractionalAmount<T extends Currency>(currency: T, numerator: BigintIsh, denominator: BigintIsh): CurrencyAmount<T>;
23
- protected constructor(currency: T, numerator: BigintIsh, denominator?: BigintIsh);
24
- add(other: CurrencyAmount<T>): CurrencyAmount<T>;
25
- subtract(other: CurrencyAmount<T>): CurrencyAmount<T>;
26
- multiply(other: Fraction | BigintIsh): CurrencyAmount<T>;
27
- divide(other: Fraction | BigintIsh): CurrencyAmount<T>;
28
- toSignificant(significantDigits?: number, format?: object, rounding?: Rounding): string;
29
- toFixed(decimalPlaces?: number, format?: object, rounding?: Rounding): string;
30
- toExact(format?: object): string;
31
- get wrapped(): CurrencyAmount<Token>;
32
- /**
33
- * Returns a string representation of the address and currency amount.
34
- * Useful in cases where a dependency is needed to detect changes (e.g. useEffect).
35
- * @return string [0x6B3595068778DD592e39A122f4f5a5cF09C90fE2 - 1323.94]
36
- */
37
- serialize(): string;
38
- }
@@ -1,25 +0,0 @@
1
- import { BigintIsh } from '../types';
2
- import JSBI from 'jsbi';
3
- import { Rounding } from '../enums';
4
- export declare class Fraction {
5
- readonly numerator: JSBI;
6
- readonly denominator: JSBI;
7
- constructor(numerator: BigintIsh, denominator?: BigintIsh);
8
- private static tryParseFraction;
9
- get quotient(): JSBI;
10
- get remainder(): Fraction;
11
- invert(): Fraction;
12
- add(other: Fraction | BigintIsh): Fraction;
13
- subtract(other: Fraction | BigintIsh): Fraction;
14
- lessThan(other: Fraction | BigintIsh): boolean;
15
- equalTo(other: Fraction | BigintIsh): boolean;
16
- greaterThan(other: Fraction | BigintIsh): boolean;
17
- multiply(other: Fraction | BigintIsh): Fraction;
18
- divide(other: Fraction | BigintIsh): Fraction;
19
- toSignificant(significantDigits: number, format?: object, rounding?: Rounding): string;
20
- toFixed(decimalPlaces: number, format?: object, rounding?: Rounding): string;
21
- /**
22
- * Helper method for converting any super class back to a fraction
23
- */
24
- get asFraction(): Fraction;
25
- }
@@ -1,59 +0,0 @@
1
- import { BigNumber } from '@ethersproject/bignumber';
2
- import { Pool, RToken, RouteLeg, MultiRoute } from '../types/MultiRouterTypes';
3
- export declare class Edge {
4
- readonly GasConsumption = 40000;
5
- readonly MINIMUM_LIQUIDITY = 1000;
6
- pool: Pool;
7
- vert0: Vertice;
8
- vert1: Vertice;
9
- canBeUsed: boolean;
10
- direction: boolean;
11
- amountInPrevious: number;
12
- amountOutPrevious: number;
13
- bestEdgeIncome: number;
14
- constructor(p: Pool, v0: Vertice, v1: Vertice);
15
- reserve(v: Vertice): BigNumber;
16
- calcOutput(v: Vertice, amountIn: number): number[];
17
- checkMinimalLiquidityExceededAfterSwap(from: Vertice, amountOut: number): boolean;
18
- testApply(from: Vertice, amountIn: number, amountOut: number): boolean;
19
- applySwap(from: Vertice): void;
20
- }
21
- export declare class Vertice {
22
- token: RToken;
23
- edges: Edge[];
24
- price: number;
25
- gasPrice: number;
26
- bestIncome: number;
27
- gasSpent: number;
28
- bestTotal: number;
29
- bestSource?: Edge;
30
- checkLine: number;
31
- constructor(t: RToken);
32
- getNeibour(e?: Edge): Vertice | undefined;
33
- }
34
- export declare class Graph {
35
- vertices: Vertice[];
36
- edges: Edge[];
37
- tokens: Map<RToken, Vertice>;
38
- constructor(pools: Pool[], baseToken: RToken, gasPrice: number);
39
- setPrices(from: Vertice, price: number, gasPrice: number): void;
40
- getOrCreateVertice(token: RToken): Vertice;
41
- findBestPath(from: RToken, to: RToken, amountIn: number): {
42
- path: Edge[];
43
- output: number;
44
- gasSpent: number;
45
- totalOutput: number;
46
- } | undefined;
47
- addPath(from: Vertice | undefined, to: Vertice | undefined, path: Edge[]): void;
48
- findBestRoute(from: RToken, to: RToken, amountIn: number, mode: number | number[]): MultiRoute;
49
- getRouteLegs(from: Vertice, to: Vertice): [RouteLeg[], number, boolean];
50
- edgeFrom(e: Edge): [Vertice, number] | undefined;
51
- getOutputEdges(v: Vertice): Edge[];
52
- getInputEdges(v: Vertice): Edge[];
53
- calcLegsAmountOut(legs: RouteLeg[], amountIn: number, to: RToken): number;
54
- cleanTopology(from: Vertice, to: Vertice): [Vertice[], boolean];
55
- removeDeadEnds(verts: Vertice[]): void;
56
- removeWeakestEdge(verts: Vertice[]): void;
57
- topologySort(from: Vertice, to: Vertice): [number, Vertice[]];
58
- }
59
- export declare function findMultiRouting(from: RToken, to: RToken, amountIn: number, pools: Pool[], baseToken: RToken, gasPrice: number, steps?: number | number[]): MultiRoute;
@@ -1,10 +0,0 @@
1
- import { Currency } from '../Currency';
2
- import { NativeCurrency } from '../NativeCurrency';
3
- import { Token } from '../Token';
4
- export declare class Avalanche extends NativeCurrency {
5
- protected constructor(chainId: number);
6
- get wrapped(): Token;
7
- private static _cache;
8
- static onChain(chainId: number): Avalanche;
9
- equals(other: Currency): boolean;
10
- }
@@ -1,10 +0,0 @@
1
- import { Currency } from '../Currency';
2
- import { NativeCurrency } from '../NativeCurrency';
3
- import { Token } from '../Token';
4
- export declare class Binance extends NativeCurrency {
5
- protected constructor(chainId: number);
6
- get wrapped(): Token;
7
- private static _cache;
8
- static onChain(chainId: number): Binance;
9
- equals(other: Currency): boolean;
10
- }
@@ -1,10 +0,0 @@
1
- import { Currency } from '../Currency';
2
- import { NativeCurrency } from '../NativeCurrency';
3
- import { Token } from '../Token';
4
- export declare class Celo extends NativeCurrency {
5
- protected constructor(chainId: number);
6
- get wrapped(): Token;
7
- private static _cache;
8
- static onChain(chainId: number): Celo;
9
- equals(other: Currency): boolean;
10
- }
@@ -1,13 +0,0 @@
1
- import { Currency } from '../Currency';
2
- import { NativeCurrency } from '../NativeCurrency';
3
- import { Token } from '../Token';
4
- /**
5
- * Ether is the main usage of a 'native' currency, i.e. for Ethereum mainnet and all testnets
6
- */
7
- export declare class Ether extends NativeCurrency {
8
- protected constructor(chainId: number);
9
- get wrapped(): Token;
10
- private static _etherCache;
11
- static onChain(chainId: number): Ether;
12
- equals(other: Currency): boolean;
13
- }
@@ -1,10 +0,0 @@
1
- import { Currency } from '../Currency';
2
- import { NativeCurrency } from '../NativeCurrency';
3
- import { Token } from '../Token';
4
- export declare class Fantom extends NativeCurrency {
5
- protected constructor(chainId: number);
6
- get wrapped(): Token;
7
- private static _cache;
8
- static onChain(chainId: number): Fantom;
9
- equals(other: Currency): boolean;
10
- }
@@ -1,10 +0,0 @@
1
- import { Currency } from '../Currency';
2
- import { NativeCurrency } from '../NativeCurrency';
3
- import { Token } from '../Token';
4
- export declare class Fuse extends NativeCurrency {
5
- protected constructor(chainId: number);
6
- get wrapped(): Token;
7
- private static _cache;
8
- static onChain(chainId: number): Fuse;
9
- equals(other: Currency): boolean;
10
- }
@@ -1,10 +0,0 @@
1
- import { Currency } from '../Currency';
2
- import { NativeCurrency } from '../NativeCurrency';
3
- import { Token } from '../Token';
4
- export declare class Harmony extends NativeCurrency {
5
- protected constructor(chainId: number);
6
- get wrapped(): Token;
7
- private static _cache;
8
- static onChain(chainId: number): Harmony;
9
- equals(other: Currency): boolean;
10
- }
@@ -1,10 +0,0 @@
1
- import { Currency } from '../Currency';
2
- import { NativeCurrency } from '../NativeCurrency';
3
- import { Token } from '../Token';
4
- export declare class Heco extends NativeCurrency {
5
- protected constructor(chainId: number);
6
- get wrapped(): Token;
7
- private static _cache;
8
- static onChain(chainId: number): Heco;
9
- equals(other: Currency): boolean;
10
- }
@@ -1,10 +0,0 @@
1
- import { Currency } from '../Currency';
2
- import { NativeCurrency } from '../NativeCurrency';
3
- import { Token } from '../Token';
4
- export declare class Matic extends NativeCurrency {
5
- protected constructor(chainId: number);
6
- get wrapped(): Token;
7
- private static _cache;
8
- static onChain(chainId: number): Matic;
9
- equals(other: Currency): boolean;
10
- }
@@ -1,10 +0,0 @@
1
- import { Currency } from '../Currency';
2
- import { NativeCurrency } from '../NativeCurrency';
3
- import { Token } from '../Token';
4
- export declare class Movr extends NativeCurrency {
5
- protected constructor(chainId: number);
6
- get wrapped(): Token;
7
- private static _cache;
8
- static onChain(chainId: number): Movr;
9
- equals(other: Currency): boolean;
10
- }
@@ -1,10 +0,0 @@
1
- import { Currency } from '../Currency';
2
- import { NativeCurrency } from '../NativeCurrency';
3
- import { Token } from '../Token';
4
- export declare class Okex extends NativeCurrency {
5
- protected constructor(chainId: number);
6
- get wrapped(): Token;
7
- private static _cache;
8
- static onChain(chainId: number): Okex;
9
- equals(other: Currency): boolean;
10
- }
@@ -1,10 +0,0 @@
1
- import { Currency } from '../Currency';
2
- import { NativeCurrency } from '../NativeCurrency';
3
- import { Token } from '../Token';
4
- export declare class Palm extends NativeCurrency {
5
- protected constructor(chainId: number);
6
- get wrapped(): Token;
7
- private static _cache;
8
- static onChain(chainId: number): Palm;
9
- equals(other: Currency): boolean;
10
- }
@@ -1,10 +0,0 @@
1
- import { Currency } from '../Currency';
2
- import { NativeCurrency } from '../NativeCurrency';
3
- import { Token } from '../Token';
4
- export declare class Telos extends NativeCurrency {
5
- protected constructor(chainId: number);
6
- get wrapped(): Token;
7
- private static _cache;
8
- static onChain(chainId: number): Telos;
9
- equals(other: Currency): boolean;
10
- }
@@ -1,14 +0,0 @@
1
- export { Avalanche } from './Avalanche';
2
- export { Binance } from './Binance';
3
- export { Celo } from './Celo';
4
- export { Ether } from './Ether';
5
- export { Fantom } from './Fantom';
6
- export { Harmony } from './Harmony';
7
- export { Heco } from './Heco';
8
- export { Matic } from './Matic';
9
- export { Movr } from './Movr';
10
- export { Okex } from './Okex';
11
- export { xDai } from './xDai';
12
- export { Palm } from './Palm';
13
- export { Fuse } from './Fuse';
14
- export { Telos } from './Telos';
@@ -1,10 +0,0 @@
1
- import { Currency } from '../Currency';
2
- import { NativeCurrency } from '../NativeCurrency';
3
- import { Token } from '../Token';
4
- export declare class xDai extends NativeCurrency {
5
- protected constructor(chainId: number);
6
- get wrapped(): Token;
7
- private static _cache;
8
- static onChain(chainId: number): xDai;
9
- equals(other: Currency): boolean;
10
- }
@@ -1,8 +0,0 @@
1
- import { AbstractCurrency } from './AbstractCurrency';
2
- /**
3
- * Represents the native currency of the chain on which it resides, e.g.
4
- */
5
- export declare abstract class NativeCurrency extends AbstractCurrency {
6
- readonly isNative: true;
7
- readonly isToken: false;
8
- }
@@ -1,41 +0,0 @@
1
- import { BigintIsh } from '../types';
2
- import { CurrencyAmount } from './CurrencyAmount';
3
- import { Price } from './Price';
4
- import { Token } from './Token';
5
- export declare class Pair {
6
- readonly liquidityToken: Token;
7
- private readonly tokenAmounts;
8
- static getAddress(tokenA: Token, tokenB: Token): string;
9
- constructor(currencyAmountA: CurrencyAmount<Token>, currencyAmountB: CurrencyAmount<Token>);
10
- /**
11
- * Returns true if the token is either token0 or token1
12
- * @param token to check
13
- */
14
- involvesToken(token: Token): boolean;
15
- /**
16
- * Returns the current mid price of the pair in terms of token0, i.e. the ratio of reserve1 to reserve0
17
- */
18
- get token0Price(): Price<Token, Token>;
19
- /**
20
- * Returns the current mid price of the pair in terms of token1, i.e. the ratio of reserve0 to reserve1
21
- */
22
- get token1Price(): Price<Token, Token>;
23
- /**
24
- * Return the price of the given token in terms of the other token in the pair.
25
- * @param token token to return price of
26
- */
27
- priceOf(token: Token): Price<Token, Token>;
28
- /**
29
- * Returns the chain ID of the tokens in the pair.
30
- */
31
- get chainId(): number;
32
- get token0(): Token;
33
- get token1(): Token;
34
- get reserve0(): CurrencyAmount<Token>;
35
- get reserve1(): CurrencyAmount<Token>;
36
- reserveOf(token: Token): CurrencyAmount<Token>;
37
- getOutputAmount(inputAmount: CurrencyAmount<Token>): [CurrencyAmount<Token>, Pair];
38
- getInputAmount(outputAmount: CurrencyAmount<Token>): [CurrencyAmount<Token>, Pair];
39
- getLiquidityMinted(totalSupply: CurrencyAmount<Token>, tokenAmountA: CurrencyAmount<Token>, tokenAmountB: CurrencyAmount<Token>): CurrencyAmount<Token>;
40
- getLiquidityValue(token: Token, totalSupply: CurrencyAmount<Token>, liquidity: CurrencyAmount<Token>, feeOn?: boolean, kLast?: BigintIsh): CurrencyAmount<Token>;
41
- }
@@ -1,15 +0,0 @@
1
- import { BigintIsh } from '../types';
2
- import { Fraction } from './Fraction';
3
- import { Rounding } from '../enums';
4
- export declare class Percent extends Fraction {
5
- /**
6
- * This boolean prevents a fraction from being interpreted as a Percent
7
- */
8
- readonly isPercent: true;
9
- add(other: Fraction | BigintIsh): Percent;
10
- subtract(other: Fraction | BigintIsh): Percent;
11
- multiply(other: Fraction | BigintIsh): Percent;
12
- divide(other: Fraction | BigintIsh): Percent;
13
- toSignificant(significantDigits?: number, format?: object, rounding?: Rounding): string;
14
- toFixed(decimalPlaces?: number, format?: object, rounding?: Rounding): string;
15
- }