@qidao/sdk 5.0.8 → 5.1.0
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/constants/addresses.d.ts +31 -0
- package/dist/constants/index.d.ts +20 -0
- package/dist/constants/kashi.d.ts +29 -0
- package/dist/constants/natives.d.ts +30 -0
- package/dist/constants/numbers.d.ts +11 -0
- package/dist/constants/tokens.d.ts +5 -0
- package/dist/entities/AbstractCurrency.d.ts +53 -0
- package/dist/entities/ConstantProductPool.d.ts +43 -0
- package/dist/entities/Currency.d.ts +3 -0
- package/dist/entities/CurrencyAmount.d.ts +38 -0
- package/dist/entities/Fraction.d.ts +25 -0
- package/dist/entities/MultiRouter.d.ts +59 -0
- package/dist/entities/Native/Avalanche.d.ts +10 -0
- package/dist/entities/Native/Binance.d.ts +10 -0
- package/dist/entities/Native/Celo.d.ts +10 -0
- package/dist/entities/Native/Ether.d.ts +13 -0
- package/dist/entities/Native/Fantom.d.ts +10 -0
- package/dist/entities/Native/Fuse.d.ts +10 -0
- package/dist/entities/Native/Harmony.d.ts +10 -0
- package/dist/entities/Native/Heco.d.ts +10 -0
- package/dist/entities/Native/Matic.d.ts +10 -0
- package/dist/entities/Native/Movr.d.ts +10 -0
- package/dist/entities/Native/Okex.d.ts +10 -0
- package/dist/entities/Native/Palm.d.ts +10 -0
- package/dist/entities/Native/Telos.d.ts +10 -0
- package/dist/entities/Native/index.d.ts +14 -0
- package/dist/entities/Native/xDai.d.ts +10 -0
- package/dist/entities/NativeCurrency.d.ts +8 -0
- package/dist/entities/Pair.d.ts +41 -0
- package/dist/entities/Percent.d.ts +15 -0
- package/dist/entities/Price.d.ts +39 -0
- package/dist/entities/Route.d.ts +14 -0
- package/dist/entities/Token.d.ts +33 -0
- package/dist/entities/{trade.d.ts → Trade.d.ts} +35 -34
- package/dist/entities/eip712.d.ts +78 -0
- package/dist/entities/index.d.ts +14 -6
- package/dist/enums/ChainId.d.ts +32 -0
- package/dist/enums/Fee.d.ts +3 -0
- package/dist/enums/KashiAction.d.ts +18 -0
- package/dist/enums/OrderStatus.d.ts +6 -0
- package/dist/enums/Rounding.d.ts +5 -0
- package/dist/enums/TradeType.d.ts +4 -0
- package/dist/enums/index.d.ts +6 -0
- package/dist/functions/bentobox.d.ts +3 -0
- package/dist/functions/computeConstantProductPoolAddress.d.ts +9 -0
- package/dist/functions/computePairAddress.d.ts +6 -0
- package/dist/functions/computePoolInitCodeHash.d.ts +5 -0
- package/dist/functions/computePriceImpact.d.ts +11 -0
- package/dist/functions/index.d.ts +8 -0
- package/dist/functions/kashi.d.ts +9 -0
- package/dist/functions/rebase.d.ts +4 -0
- package/dist/functions/sortedInsert.d.ts +1 -0
- package/dist/functions/sqrt.d.ts +7 -0
- package/dist/functions/validateAndParseAddress.d.ts +1 -0
- package/dist/functions/validateSolidityTypeInstance.d.ts +3 -0
- package/dist/index.d.ts +7 -2
- package/dist/index.js +2 -8
- package/dist/index.js.map +1 -0
- package/dist/index.modern.mjs +2 -0
- package/dist/index.modern.mjs.map +1 -0
- package/dist/index.module.js +2 -0
- package/dist/index.module.js.map +1 -0
- package/dist/index.umd.js +2 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/interfaces/AccrueInfo.d.ts +6 -0
- package/dist/interfaces/Rebase.d.ts +5 -0
- package/dist/interfaces/index.d.ts +2 -0
- package/dist/limitorder.d.ts +115 -0
- package/dist/router.d.ts +7 -2
- package/dist/sdk.cjs.development.js +4684 -1092
- package/dist/sdk.cjs.development.js.map +1 -1
- package/dist/sdk.cjs.production.min.js +1 -1
- package/dist/sdk.cjs.production.min.js.map +1 -1
- package/dist/sdk.esm.js +4567 -1086
- package/dist/sdk.esm.js.map +1 -1
- package/dist/{constants.d.ts → src/src/constants.d.ts} +3 -21
- package/dist/src/src/contracts/CrosschainNativeQiStablecoin.d.ts +978 -0
- package/dist/src/src/contracts/CrosschainQiStablecoin.d.ts +974 -0
- package/dist/src/src/contracts/CrosschainQiStablecoinSlim.d.ts +942 -0
- package/dist/src/src/contracts/CrosschainQiStablecoinSlimV2.d.ts +950 -0
- package/dist/src/src/contracts/CrosschainQiStablecoinV2.d.ts +910 -0
- package/dist/src/src/contracts/CrosschainQiStablecoinwbtc.d.ts +958 -0
- package/dist/src/src/contracts/Erc20QiStablecoincamwbtc.d.ts +986 -0
- package/dist/src/src/contracts/Erc20QiStablecoinwbtc.d.ts +994 -0
- package/dist/src/src/contracts/Erc20Stablecoin.d.ts +938 -0
- package/dist/src/src/contracts/StableQiVault.d.ts +1522 -0
- package/dist/src/src/contracts/common.d.ts +22 -0
- package/dist/src/src/contracts/factories/CrosschainNativeQiStablecoin__factory.d.ts +61 -0
- package/dist/src/src/contracts/factories/CrosschainQiStablecoinSlimV2__factory.d.ts +52 -0
- package/dist/src/src/contracts/factories/CrosschainQiStablecoinSlim__factory.d.ts +52 -0
- package/dist/src/src/contracts/factories/CrosschainQiStablecoinV2__factory.d.ts +52 -0
- package/dist/src/src/contracts/factories/CrosschainQiStablecoin__factory.d.ts +52 -0
- package/dist/src/src/contracts/factories/CrosschainQiStablecoinwbtc__factory.d.ts +52 -0
- package/dist/src/src/contracts/factories/Erc20QiStablecoincamwbtc__factory.d.ts +52 -0
- package/dist/src/src/contracts/factories/Erc20QiStablecoinwbtc__factory.d.ts +52 -0
- package/dist/src/src/contracts/factories/Erc20Stablecoin__factory.d.ts +52 -0
- package/dist/src/src/contracts/factories/StableQiVault__factory.d.ts +46 -0
- package/dist/src/src/contracts/factories/index.d.ts +10 -0
- package/dist/src/src/contracts/index.d.ts +21 -0
- package/dist/{entities → src/src/entities}/currency.d.ts +0 -0
- package/dist/{entities → src/src/entities}/fractions/currencyAmount.d.ts +0 -0
- package/dist/{entities → src/src/entities}/fractions/fraction.d.ts +0 -0
- package/dist/{entities → src/src/entities}/fractions/index.d.ts +0 -0
- package/dist/{entities → src/src/entities}/fractions/percent.d.ts +0 -0
- package/dist/{entities → src/src/entities}/fractions/price.d.ts +0 -2
- package/dist/{entities → src/src/entities}/fractions/tokenAmount.d.ts +0 -0
- package/dist/src/src/entities/index.d.ts +3 -0
- package/dist/{entities → src/src/entities}/token.d.ts +0 -0
- package/dist/src/src/errors.d.ts +16 -0
- package/dist/src/src/index.d.ts +7 -0
- package/dist/{utils.d.ts → src/src/utils.d.ts} +0 -0
- package/dist/src/src/vaultInfo.d.ts +27 -0
- package/dist/{test → src/test}/fraction.test.d.ts +0 -0
- package/dist/{test → src/test}/token.test.d.ts +0 -0
- package/dist/types/AddressMap.d.ts +3 -0
- package/dist/types/BigIntIsh.d.ts +2 -0
- package/dist/types/ChainTokenMap.d.ts +5 -0
- package/dist/types/LimitOrderTypes.d.ts +21 -0
- package/dist/types/MultiRouterTypes.d.ts +97 -0
- package/dist/types/TokenMap.d.ts +4 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/utils/MultiRouterMath.d.ts +15 -0
- package/package.json +39 -31
- package/dist/entities/pair.d.ts +0 -41
- package/dist/entities/route.d.ts +0 -14
- package/dist/fetcher.d.ts +0 -28
- package/dist/test/constants.test.d.ts +0 -1
- package/dist/test/data.test.d.ts +0 -1
- package/dist/test/entities.test.d.ts +0 -1
- package/dist/test/miscellaneous.test.d.ts +0 -1
- package/dist/test/pair.test.d.ts +0 -1
- package/dist/test/route.test.d.ts +0 -1
- package/dist/test/router.test.d.ts +0 -1
- package/dist/test/trade.test.d.ts +0 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Provider } from "@ethersproject/providers";
|
|
2
|
+
import { Signer } from 'ethers';
|
|
3
|
+
import { CrosschainNativeQiStablecoin, CrosschainQiStablecoin, CrosschainQiStablecoinSlim, CrosschainQiStablecoinSlimV2, CrosschainQiStablecoinV2, CrosschainQiStablecoinwbtc, Erc20QiStablecoincamwbtc, Erc20QiStablecoinwbtc, Erc20Stablecoin, StableQiVault } from "./contracts";
|
|
4
|
+
import { Token } from './entities';
|
|
5
|
+
import ERC20_STABLECOIN from './abis/toGenerate/erc20Stablecoin.json';
|
|
6
|
+
import STABLE_QI_VAULT from './abis/toGenerate/stableQiVault.json';
|
|
7
|
+
import { ChainId } from "./constants";
|
|
8
|
+
export declare type VaultContractAbi = typeof ERC20_STABLECOIN | typeof STABLE_QI_VAULT;
|
|
9
|
+
export default interface COLLATERAL {
|
|
10
|
+
aaveId?: string;
|
|
11
|
+
connect(address: string, signerOrProvider: Signer | Provider): Erc20Stablecoin | Erc20QiStablecoinwbtc | Erc20QiStablecoincamwbtc | StableQiVault | CrosschainQiStablecoin | CrosschainNativeQiStablecoin | CrosschainQiStablecoinV2 | CrosschainQiStablecoinSlim | CrosschainQiStablecoinSlimV2 | CrosschainQiStablecoinwbtc;
|
|
12
|
+
chainId: ChainId;
|
|
13
|
+
depreciated?: boolean;
|
|
14
|
+
infoUrl?: string;
|
|
15
|
+
minimumCDR: number;
|
|
16
|
+
native?: boolean;
|
|
17
|
+
subgraph?: string;
|
|
18
|
+
token: Token;
|
|
19
|
+
vaultAddress: string;
|
|
20
|
+
}
|
|
21
|
+
export interface COLLATERAL_V2 extends COLLATERAL {
|
|
22
|
+
contractAbi: VaultContractAbi;
|
|
23
|
+
}
|
|
24
|
+
export declare function isV2QiVault(collateral: COLLATERAL | COLLATERAL_V2): collateral is COLLATERAL_V2;
|
|
25
|
+
export declare const COLLATERALS: {
|
|
26
|
+
[chainId in ChainId]?: (COLLATERAL | COLLATERAL_V2)[];
|
|
27
|
+
};
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const types: {
|
|
2
|
+
EIP712Domain: {
|
|
3
|
+
name: string;
|
|
4
|
+
type: string;
|
|
5
|
+
}[];
|
|
6
|
+
LimitOrder: {
|
|
7
|
+
name: string;
|
|
8
|
+
type: string;
|
|
9
|
+
}[];
|
|
10
|
+
};
|
|
11
|
+
export declare const bentoTypes: {
|
|
12
|
+
EIP712Domain: {
|
|
13
|
+
name: string;
|
|
14
|
+
type: string;
|
|
15
|
+
}[];
|
|
16
|
+
SetMasterContractApproval: {
|
|
17
|
+
name: string;
|
|
18
|
+
type: string;
|
|
19
|
+
}[];
|
|
20
|
+
};
|
|
21
|
+
export declare const name = "LimitOrder";
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { BigNumber } from '@ethersproject/bignumber';
|
|
2
|
+
export interface RToken {
|
|
3
|
+
name: string;
|
|
4
|
+
address: string;
|
|
5
|
+
}
|
|
6
|
+
export declare enum PoolType {
|
|
7
|
+
ConstantProduct = "ConstantProduct",
|
|
8
|
+
Weighted = "Weighted",
|
|
9
|
+
Hybrid = "Hybrid",
|
|
10
|
+
ConcentratedLiquidity = "ConcentratedLiquidity"
|
|
11
|
+
}
|
|
12
|
+
export interface PoolInfo {
|
|
13
|
+
address: string;
|
|
14
|
+
token0: RToken;
|
|
15
|
+
token1: RToken;
|
|
16
|
+
type: PoolType;
|
|
17
|
+
reserve0: BigNumber;
|
|
18
|
+
reserve1: BigNumber;
|
|
19
|
+
fee: number;
|
|
20
|
+
minLiquidity: number;
|
|
21
|
+
swapGasCost: number;
|
|
22
|
+
}
|
|
23
|
+
declare type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
24
|
+
declare type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
25
|
+
declare type PoolInfoWithDefaults = PartialBy<PoolInfo, 'minLiquidity' | 'swapGasCost'>;
|
|
26
|
+
export declare class Pool {
|
|
27
|
+
address: string;
|
|
28
|
+
token0: RToken;
|
|
29
|
+
token1: RToken;
|
|
30
|
+
type: PoolType;
|
|
31
|
+
reserve0: BigNumber;
|
|
32
|
+
reserve1: BigNumber;
|
|
33
|
+
fee: number;
|
|
34
|
+
minLiquidity: number;
|
|
35
|
+
swapGasCost: number;
|
|
36
|
+
constructor(_info: PoolInfoWithDefaults);
|
|
37
|
+
}
|
|
38
|
+
declare type PoolInfoNoType = Omit<PoolInfoWithDefaults, 'type'>;
|
|
39
|
+
export declare class RConstantProductPool extends Pool {
|
|
40
|
+
constructor(info: PoolInfoNoType);
|
|
41
|
+
}
|
|
42
|
+
declare type HybridPoolInfo = PoolInfoNoType & {
|
|
43
|
+
A: number;
|
|
44
|
+
};
|
|
45
|
+
export declare class RHybridPool extends Pool {
|
|
46
|
+
A: number;
|
|
47
|
+
constructor(info: HybridPoolInfo);
|
|
48
|
+
}
|
|
49
|
+
declare type WeightedPoolInfo = PoolInfoNoType & {
|
|
50
|
+
weight0: number;
|
|
51
|
+
weight1: number;
|
|
52
|
+
};
|
|
53
|
+
export declare class RWeightedPool extends Pool {
|
|
54
|
+
weight0: number;
|
|
55
|
+
weight1: number;
|
|
56
|
+
constructor(info: WeightedPoolInfo);
|
|
57
|
+
}
|
|
58
|
+
export declare const CL_MIN_TICK = -887272;
|
|
59
|
+
export declare const CL_MAX_TICK: number;
|
|
60
|
+
interface CLTick {
|
|
61
|
+
index: number;
|
|
62
|
+
DLiquidity: number;
|
|
63
|
+
}
|
|
64
|
+
interface CLSpecific {
|
|
65
|
+
liquidity: number;
|
|
66
|
+
sqrtPrice: number;
|
|
67
|
+
nearestTick: number;
|
|
68
|
+
ticks: CLTick[];
|
|
69
|
+
}
|
|
70
|
+
declare type CLPoolInfo = Omit<PoolInfoNoType, 'reserve0' | 'reserve1'> & CLSpecific;
|
|
71
|
+
export declare class RConcentratedLiquidityPool extends Pool {
|
|
72
|
+
liquidity: number;
|
|
73
|
+
sqrtPrice: number;
|
|
74
|
+
nearestTick: number;
|
|
75
|
+
ticks: CLTick[];
|
|
76
|
+
constructor(info: CLPoolInfo);
|
|
77
|
+
}
|
|
78
|
+
export interface RouteLeg {
|
|
79
|
+
address: string;
|
|
80
|
+
token: RToken;
|
|
81
|
+
swapPortion: number;
|
|
82
|
+
absolutePortion: number;
|
|
83
|
+
}
|
|
84
|
+
export declare enum RouteStatus {
|
|
85
|
+
Success = "Success",
|
|
86
|
+
NoWay = "NoWay",
|
|
87
|
+
Partial = "Partial"
|
|
88
|
+
}
|
|
89
|
+
export interface MultiRoute {
|
|
90
|
+
status: RouteStatus;
|
|
91
|
+
amountIn: number;
|
|
92
|
+
amountOut: number;
|
|
93
|
+
legs: RouteLeg[];
|
|
94
|
+
gasSpent: number;
|
|
95
|
+
totalAmountOut: number;
|
|
96
|
+
}
|
|
97
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BigNumber } from '@ethersproject/bignumber';
|
|
2
|
+
import { Pool, RHybridPool } from '../types/MultiRouterTypes';
|
|
3
|
+
export declare function HybridComputeLiquidity(pool: RHybridPool): BigNumber;
|
|
4
|
+
export declare function HybridgetY(pool: RHybridPool, x: BigNumber): BigNumber;
|
|
5
|
+
export declare function calcOutByIn(pool: Pool, amountIn: number, direction?: boolean): number;
|
|
6
|
+
export declare class OutOfLiquidity extends Error {
|
|
7
|
+
}
|
|
8
|
+
export declare function calcInByOut(pool: Pool, amountOut: number, direction: boolean): number;
|
|
9
|
+
export declare function calcPrice(pool: Pool, amountIn: number, takeFeeIntoAccount?: boolean): number;
|
|
10
|
+
export declare function calcInputByPrice(pool: Pool, priceEffective: number, hint?: number): number;
|
|
11
|
+
export declare function ASSERT(f: () => boolean, t?: string): void;
|
|
12
|
+
export declare function closeValues(a: number, b: number, accuracy: number): boolean;
|
|
13
|
+
export declare function calcSquareEquation(a: number, b: number, c: number): [number, number];
|
|
14
|
+
export declare function revertPositive(f: (x: number) => number, out: number, hint?: number): number;
|
|
15
|
+
export declare function getBigNumber(valueBN: BigNumber | undefined, value: number): BigNumber;
|
package/package.json
CHANGED
|
@@ -1,52 +1,60 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qidao/sdk",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "5.0
|
|
4
|
+
"version": "5.1.0",
|
|
5
5
|
"description": "🛠 An SDK for building applications on top of QiDao Protocol.",
|
|
6
|
-
"main": "dist/index.js",
|
|
7
|
-
"
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"umd:main": "dist/index.umd.js",
|
|
8
|
+
"source": "./src/index.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
"require": "./dist/index.js",
|
|
11
|
+
"default": "./dist/index.modern.js"
|
|
12
|
+
},
|
|
13
|
+
"module": "./dist/index.module.js",
|
|
14
|
+
"unpkg": "./dist/index.umd.js",
|
|
15
|
+
"types": "./dist/src/index.d.ts",
|
|
8
16
|
"files": [
|
|
9
17
|
"dist"
|
|
10
18
|
],
|
|
11
19
|
"repository": "https://github.com/royalaid/sushiswap-sdk",
|
|
12
20
|
"keywords": [],
|
|
13
|
-
"module": "dist/sushiswap-sdk.esm.js",
|
|
14
21
|
"scripts": {
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"prepublishOnly": "tsdx build"
|
|
22
|
+
"build": "microbundle",
|
|
23
|
+
"start": "microbundle watch",
|
|
24
|
+
"prepublishOnly": "microbundle",
|
|
25
|
+
"postinstall": "typechain --discriminate-types --target ethers-v5 --out-dir src/contracts \"src/abis/toGenerate/**/*.json\""
|
|
20
26
|
},
|
|
21
27
|
"dependencies": {
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"jsbi": "
|
|
26
|
-
"tiny-invariant": "
|
|
27
|
-
"tiny-warning": "
|
|
28
|
-
"toformat": "
|
|
28
|
+
"big.js": "5.2.2",
|
|
29
|
+
"decimal.js-light": "2.5.1",
|
|
30
|
+
"ethers": "5.6.9",
|
|
31
|
+
"jsbi": "3.2.5",
|
|
32
|
+
"tiny-invariant": "1.2.0",
|
|
33
|
+
"tiny-warning": "1.0.3",
|
|
34
|
+
"toformat": "2.0.0"
|
|
29
35
|
},
|
|
30
36
|
"peerDependencies": {
|
|
31
|
-
"@ethersproject/address": "
|
|
32
|
-
"@ethersproject/contracts": "
|
|
33
|
-
"@ethersproject/networks": "
|
|
34
|
-
"@ethersproject/providers": "
|
|
35
|
-
"@ethersproject/solidity": "
|
|
37
|
+
"@ethersproject/address": "5.6.1",
|
|
38
|
+
"@ethersproject/contracts": "5.6.2",
|
|
39
|
+
"@ethersproject/networks": "5.6.4",
|
|
40
|
+
"@ethersproject/providers": "5.6.8",
|
|
41
|
+
"@ethersproject/solidity": "5.6.1"
|
|
36
42
|
},
|
|
37
43
|
"devDependencies": {
|
|
38
|
-
"@ethersproject/address": "
|
|
39
|
-
"@ethersproject/contracts": "
|
|
40
|
-
"@ethersproject/networks": "
|
|
41
|
-
"@ethersproject/providers": "
|
|
42
|
-
"@ethersproject/solidity": "
|
|
43
|
-
"@
|
|
44
|
-
"@types/
|
|
45
|
-
"
|
|
46
|
-
"
|
|
44
|
+
"@ethersproject/address": "5.6.1",
|
|
45
|
+
"@ethersproject/contracts": "5.6.2",
|
|
46
|
+
"@ethersproject/networks": "5.6.4",
|
|
47
|
+
"@ethersproject/providers": "5.6.8",
|
|
48
|
+
"@ethersproject/solidity": "5.6.1",
|
|
49
|
+
"@typechain/ethers-v5": "10.1.0",
|
|
50
|
+
"@types/big.js": "4.0.5",
|
|
51
|
+
"@types/jest": "28.1.6",
|
|
52
|
+
"microbundle": "0.15.1",
|
|
53
|
+
"typechain": "8.1.0",
|
|
54
|
+
"typescript": "4.7.4"
|
|
47
55
|
},
|
|
48
56
|
"engines": {
|
|
49
|
-
"node": ">=
|
|
57
|
+
"node": ">= 16"
|
|
50
58
|
},
|
|
51
59
|
"prettier": {
|
|
52
60
|
"printWidth": 120,
|
package/dist/entities/pair.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { Price } from './fractions/price';
|
|
2
|
-
import { TokenAmount } from './fractions/tokenAmount';
|
|
3
|
-
import { BigintIsh, ChainId } from '../constants';
|
|
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(tokenAmountA: TokenAmount, tokenAmountB: TokenAmount);
|
|
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;
|
|
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;
|
|
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;
|
|
28
|
-
/**
|
|
29
|
-
* Returns the chain ID of the tokens in the pair.
|
|
30
|
-
*/
|
|
31
|
-
get chainId(): ChainId;
|
|
32
|
-
get token0(): Token;
|
|
33
|
-
get token1(): Token;
|
|
34
|
-
get reserve0(): TokenAmount;
|
|
35
|
-
get reserve1(): TokenAmount;
|
|
36
|
-
reserveOf(token: Token): TokenAmount;
|
|
37
|
-
getOutputAmount(inputAmount: TokenAmount): [TokenAmount, Pair];
|
|
38
|
-
getInputAmount(outputAmount: TokenAmount): [TokenAmount, Pair];
|
|
39
|
-
getLiquidityMinted(totalSupply: TokenAmount, tokenAmountA: TokenAmount, tokenAmountB: TokenAmount): TokenAmount;
|
|
40
|
-
getLiquidityValue(token: Token, totalSupply: TokenAmount, liquidity: TokenAmount, feeOn?: boolean, kLast?: BigintIsh): TokenAmount;
|
|
41
|
-
}
|
package/dist/entities/route.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ChainId } from '../constants';
|
|
2
|
-
import { Currency } from './currency';
|
|
3
|
-
import { Token } from './token';
|
|
4
|
-
import { Pair } from './pair';
|
|
5
|
-
import { Price } from './fractions/price';
|
|
6
|
-
export declare class Route {
|
|
7
|
-
readonly pairs: Pair[];
|
|
8
|
-
readonly path: Token[];
|
|
9
|
-
readonly input: Currency;
|
|
10
|
-
readonly output: Currency;
|
|
11
|
-
readonly midPrice: Price;
|
|
12
|
-
constructor(pairs: Pair[], input: Currency, output?: Currency);
|
|
13
|
-
get chainId(): ChainId;
|
|
14
|
-
}
|
package/dist/fetcher.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Pair } from './entities/pair';
|
|
2
|
-
import { ChainId } from './constants';
|
|
3
|
-
import { Token } from './entities/token';
|
|
4
|
-
/**
|
|
5
|
-
* Contains methods for constructing instances of pairs and tokens from on-chain data.
|
|
6
|
-
*/
|
|
7
|
-
export declare abstract class Fetcher {
|
|
8
|
-
/**
|
|
9
|
-
* Cannot be constructed.
|
|
10
|
-
*/
|
|
11
|
-
private constructor();
|
|
12
|
-
/**
|
|
13
|
-
* Fetch information for a given token on the given chain, using the given ethers provider.
|
|
14
|
-
* @param chainId chain of the token
|
|
15
|
-
* @param address address of the token on the chain
|
|
16
|
-
* @param provider provider used to fetch the token
|
|
17
|
-
* @param symbol optional symbol of the token
|
|
18
|
-
* @param name optional name of the token
|
|
19
|
-
*/
|
|
20
|
-
static fetchTokenData(chainId: ChainId, address: string, provider?: import("@ethersproject/providers").BaseProvider, symbol?: string, name?: string): Promise<Token>;
|
|
21
|
-
/**
|
|
22
|
-
* Fetches information about a pair and constructs a pair from the given two tokens.
|
|
23
|
-
* @param tokenA first token
|
|
24
|
-
* @param tokenB second token
|
|
25
|
-
* @param provider the provider to use to fetch the data
|
|
26
|
-
*/
|
|
27
|
-
static fetchPairData(tokenA: Token, tokenB: Token, provider?: import("@ethersproject/providers").BaseProvider): Promise<Pair>;
|
|
28
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/test/data.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/test/pair.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|