@qidao/sdk 5.0.10 → 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.
- 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/src/src/constants.d.ts +69 -0
- 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/src/src/entities/currency.d.ts +83 -0
- package/dist/src/src/entities/fractions/currencyAmount.d.ts +19 -0
- package/dist/{entities/Fraction.d.ts → src/src/entities/fractions/fraction.d.ts} +1 -7
- package/dist/src/src/entities/fractions/index.d.ts +5 -0
- package/dist/src/src/entities/fractions/percent.d.ts +6 -0
- package/dist/src/src/entities/fractions/price.d.ts +17 -0
- package/dist/src/src/entities/fractions/tokenAmount.d.ts +9 -0
- package/dist/src/src/entities/index.d.ts +3 -0
- package/dist/{entities/Token.d.ts → src/src/entities/token.d.ts} +40 -11
- package/dist/{errors.d.ts → src/src/errors.d.ts} +0 -0
- package/dist/src/src/index.d.ts +7 -0
- package/dist/src/src/utils.d.ts +7 -0
- package/dist/src/src/vaultInfo.d.ts +27 -0
- package/dist/src/test/fraction.test.d.ts +1 -0
- package/dist/src/test/token.test.d.ts +1 -0
- package/package.json +47 -66
- package/dist/constants/addresses.d.ts +0 -31
- package/dist/constants/index.d.ts +0 -20
- package/dist/constants/kashi.d.ts +0 -29
- package/dist/constants/natives.d.ts +0 -30
- package/dist/constants/numbers.d.ts +0 -11
- package/dist/constants/tokens.d.ts +0 -5
- package/dist/entities/AbstractCurrency.d.ts +0 -53
- package/dist/entities/ConstantProductPool.d.ts +0 -43
- package/dist/entities/Currency.d.ts +0 -3
- package/dist/entities/CurrencyAmount.d.ts +0 -38
- package/dist/entities/MultiRouter.d.ts +0 -59
- package/dist/entities/Native/Avalanche.d.ts +0 -10
- package/dist/entities/Native/Binance.d.ts +0 -10
- package/dist/entities/Native/Celo.d.ts +0 -10
- package/dist/entities/Native/Ether.d.ts +0 -13
- package/dist/entities/Native/Fantom.d.ts +0 -10
- package/dist/entities/Native/Fuse.d.ts +0 -10
- package/dist/entities/Native/Harmony.d.ts +0 -10
- package/dist/entities/Native/Heco.d.ts +0 -10
- package/dist/entities/Native/Matic.d.ts +0 -10
- package/dist/entities/Native/Movr.d.ts +0 -10
- package/dist/entities/Native/Okex.d.ts +0 -10
- package/dist/entities/Native/Palm.d.ts +0 -10
- package/dist/entities/Native/Telos.d.ts +0 -10
- package/dist/entities/Native/index.d.ts +0 -14
- package/dist/entities/Native/xDai.d.ts +0 -10
- package/dist/entities/NativeCurrency.d.ts +0 -8
- package/dist/entities/Pair.d.ts +0 -41
- package/dist/entities/Percent.d.ts +0 -15
- package/dist/entities/Price.d.ts +0 -39
- package/dist/entities/Route.d.ts +0 -14
- package/dist/entities/Trade.d.ts +0 -107
- package/dist/entities/eip712.d.ts +0 -78
- package/dist/entities/index.d.ts +0 -14
- package/dist/enums/ChainId.d.ts +0 -32
- package/dist/enums/Fee.d.ts +0 -3
- package/dist/enums/KashiAction.d.ts +0 -18
- package/dist/enums/OrderStatus.d.ts +0 -6
- package/dist/enums/Rounding.d.ts +0 -5
- package/dist/enums/TradeType.d.ts +0 -4
- package/dist/enums/index.d.ts +0 -6
- package/dist/functions/bentobox.d.ts +0 -3
- package/dist/functions/computeConstantProductPoolAddress.d.ts +0 -9
- package/dist/functions/computePairAddress.d.ts +0 -6
- package/dist/functions/computePoolInitCodeHash.d.ts +0 -5
- package/dist/functions/computePriceImpact.d.ts +0 -11
- package/dist/functions/index.d.ts +0 -8
- package/dist/functions/kashi.d.ts +0 -9
- package/dist/functions/rebase.d.ts +0 -4
- package/dist/functions/sortedInsert.d.ts +0 -1
- package/dist/functions/sqrt.d.ts +0 -7
- package/dist/functions/validateAndParseAddress.d.ts +0 -1
- package/dist/functions/validateSolidityTypeInstance.d.ts +0 -3
- package/dist/index.d.ts +0 -12
- package/dist/interfaces/AccrueInfo.d.ts +0 -6
- package/dist/interfaces/Rebase.d.ts +0 -5
- package/dist/interfaces/index.d.ts +0 -2
- package/dist/limitorder.d.ts +0 -115
- package/dist/router.d.ts +0 -68
- package/dist/sdk.cjs.development.js +0 -5301
- package/dist/sdk.cjs.development.js.map +0 -1
- package/dist/sdk.cjs.production.min.js +0 -2
- package/dist/sdk.cjs.production.min.js.map +0 -1
- package/dist/sdk.esm.js +0 -5162
- package/dist/sdk.esm.js.map +0 -1
- package/dist/types/AddressMap.d.ts +0 -3
- package/dist/types/BigIntIsh.d.ts +0 -2
- package/dist/types/ChainTokenMap.d.ts +0 -5
- package/dist/types/LimitOrderTypes.d.ts +0 -21
- package/dist/types/MultiRouterTypes.d.ts +0 -97
- package/dist/types/TokenMap.d.ts +0 -4
- package/dist/types/index.d.ts +0 -4
- package/dist/utils/MultiRouterMath.d.ts +0 -15
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Currency } from '../currency';
|
|
2
|
+
import JSBI from 'jsbi';
|
|
3
|
+
import { BigintIsh, Rounding } from '../../constants';
|
|
4
|
+
import { Fraction } from './fraction';
|
|
5
|
+
export declare class CurrencyAmount extends Fraction {
|
|
6
|
+
readonly currency: Currency;
|
|
7
|
+
/**
|
|
8
|
+
* Helper that calls the constructor with the ETHER currency
|
|
9
|
+
* @param amount ether amount in wei
|
|
10
|
+
*/
|
|
11
|
+
static ether(amount: BigintIsh): CurrencyAmount;
|
|
12
|
+
protected constructor(currency: Currency, amount: BigintIsh);
|
|
13
|
+
get raw(): JSBI;
|
|
14
|
+
add(other: CurrencyAmount): CurrencyAmount;
|
|
15
|
+
subtract(other: CurrencyAmount): CurrencyAmount;
|
|
16
|
+
toSignificant(significantDigits?: number, format?: object, rounding?: Rounding): string;
|
|
17
|
+
toFixed(decimalPlaces?: number, format?: object, rounding?: Rounding): string;
|
|
18
|
+
toExact(format?: object): string;
|
|
19
|
+
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { BigintIsh } from '../types';
|
|
2
1
|
import JSBI from 'jsbi';
|
|
3
|
-
import { Rounding } from '
|
|
2
|
+
import { BigintIsh, Rounding } from '../../constants';
|
|
4
3
|
export declare class Fraction {
|
|
5
4
|
readonly numerator: JSBI;
|
|
6
5
|
readonly denominator: JSBI;
|
|
7
6
|
constructor(numerator: BigintIsh, denominator?: BigintIsh);
|
|
8
|
-
private static tryParseFraction;
|
|
9
7
|
get quotient(): JSBI;
|
|
10
8
|
get remainder(): Fraction;
|
|
11
9
|
invert(): Fraction;
|
|
@@ -18,8 +16,4 @@ export declare class Fraction {
|
|
|
18
16
|
divide(other: Fraction | BigintIsh): Fraction;
|
|
19
17
|
toSignificant(significantDigits: number, format?: object, rounding?: Rounding): string;
|
|
20
18
|
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
19
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Rounding } from '../../constants';
|
|
2
|
+
import { Fraction } from './fraction';
|
|
3
|
+
export declare class Percent extends Fraction {
|
|
4
|
+
toSignificant(significantDigits?: number, format?: object, rounding?: Rounding): string;
|
|
5
|
+
toFixed(decimalPlaces?: number, format?: object, rounding?: Rounding): string;
|
|
6
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BigintIsh, Rounding } from '../../constants';
|
|
2
|
+
import { Currency } from '../currency';
|
|
3
|
+
import { Fraction } from './fraction';
|
|
4
|
+
import { CurrencyAmount } from './currencyAmount';
|
|
5
|
+
export declare class Price extends Fraction {
|
|
6
|
+
readonly baseCurrency: Currency;
|
|
7
|
+
readonly quoteCurrency: Currency;
|
|
8
|
+
readonly scalar: Fraction;
|
|
9
|
+
constructor(baseCurrency: Currency, quoteCurrency: Currency, denominator: BigintIsh, numerator: BigintIsh);
|
|
10
|
+
get raw(): Fraction;
|
|
11
|
+
get adjusted(): Fraction;
|
|
12
|
+
invert(): Price;
|
|
13
|
+
multiply(other: Price): Price;
|
|
14
|
+
quote(currencyAmount: CurrencyAmount): CurrencyAmount;
|
|
15
|
+
toSignificant(significantDigits?: number, format?: object, rounding?: Rounding): string;
|
|
16
|
+
toFixed(decimalPlaces?: number, format?: object, rounding?: Rounding): string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CurrencyAmount } from './currencyAmount';
|
|
2
|
+
import { Token } from '../token';
|
|
3
|
+
import { BigintIsh } from '../../constants';
|
|
4
|
+
export declare class TokenAmount extends CurrencyAmount {
|
|
5
|
+
readonly token: Token;
|
|
6
|
+
constructor(token: Token, amount: BigintIsh);
|
|
7
|
+
add(other: TokenAmount): TokenAmount;
|
|
8
|
+
subtract(other: TokenAmount): TokenAmount;
|
|
9
|
+
}
|
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Currency } from './Currency';
|
|
1
|
+
import { ChainId } from '../constants';
|
|
2
|
+
import { Currency } from './currency';
|
|
4
3
|
/**
|
|
5
4
|
* Represents an ERC20 token with a unique address and some metadata.
|
|
6
5
|
*/
|
|
7
|
-
export declare class Token extends
|
|
6
|
+
export declare class Token extends Currency {
|
|
8
7
|
readonly chainId: ChainId;
|
|
9
8
|
readonly address: string;
|
|
10
|
-
readonly isNative: false;
|
|
11
|
-
readonly isToken: true;
|
|
12
9
|
constructor(chainId: ChainId, address: string, decimals: number, symbol?: string, name?: string);
|
|
13
10
|
/**
|
|
14
11
|
* Returns true if the two tokens are equivalent, i.e. have the same chainId and address.
|
|
15
12
|
* @param other other token to compare
|
|
16
13
|
*/
|
|
17
|
-
equals(other:
|
|
14
|
+
equals(other: Token): boolean;
|
|
18
15
|
/**
|
|
19
16
|
* Returns true if the address of this token sorts before the address of the other token
|
|
20
17
|
* @param other other token to compare
|
|
@@ -22,12 +19,44 @@ export declare class Token extends AbstractCurrency {
|
|
|
22
19
|
* @throws if the tokens are on different chains
|
|
23
20
|
*/
|
|
24
21
|
sortsBefore(other: Token): boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Return this token, which does not need to be wrapped
|
|
27
|
-
*/
|
|
28
|
-
get wrapped(): Token;
|
|
29
22
|
}
|
|
30
23
|
/**
|
|
31
24
|
* Compares two currencies for equality
|
|
32
25
|
*/
|
|
33
26
|
export declare function currencyEquals(currencyA: Currency, currencyB: Currency): boolean;
|
|
27
|
+
export declare const WETH: {
|
|
28
|
+
1: Token;
|
|
29
|
+
3: Token;
|
|
30
|
+
4: Token;
|
|
31
|
+
5: Token;
|
|
32
|
+
42: Token;
|
|
33
|
+
250: Token;
|
|
34
|
+
4002: Token;
|
|
35
|
+
137: Token;
|
|
36
|
+
80001: Token;
|
|
37
|
+
100: Token;
|
|
38
|
+
56: Token;
|
|
39
|
+
97: Token;
|
|
40
|
+
42161: Token;
|
|
41
|
+
1287: Token;
|
|
42
|
+
43114: Token;
|
|
43
|
+
43113: Token;
|
|
44
|
+
128: Token;
|
|
45
|
+
256: Token;
|
|
46
|
+
1666600000: Token;
|
|
47
|
+
1666700000: Token;
|
|
48
|
+
1285: Token;
|
|
49
|
+
25: Token;
|
|
50
|
+
10: Token;
|
|
51
|
+
57: Token;
|
|
52
|
+
1088: Token;
|
|
53
|
+
1284: Token;
|
|
54
|
+
2001: Token;
|
|
55
|
+
2222: Token;
|
|
56
|
+
4689: Token;
|
|
57
|
+
8217: Token;
|
|
58
|
+
42220: Token;
|
|
59
|
+
1313161554: Token;
|
|
60
|
+
288: Token;
|
|
61
|
+
1818: Token;
|
|
62
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import JSBI from 'jsbi';
|
|
2
|
+
export { JSBI };
|
|
3
|
+
export { BigintIsh, ChainId, TradeType, Rounding, INIT_CODE_HASH, MINIMUM_LIQUIDITY } from './constants';
|
|
4
|
+
export * from './errors';
|
|
5
|
+
export * from './entities';
|
|
6
|
+
export * from './vaultInfo';
|
|
7
|
+
export * from './contracts';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import JSBI from 'jsbi';
|
|
2
|
+
import { BigintIsh, SolidityType } from './constants';
|
|
3
|
+
export declare function validateSolidityTypeInstance(value: JSBI, solidityType: SolidityType): void;
|
|
4
|
+
export declare function validateAndParseAddress(address: string): string;
|
|
5
|
+
export declare function parseBigintIsh(bigintIsh: BigintIsh): JSBI;
|
|
6
|
+
export declare function sqrt(y: JSBI): JSBI;
|
|
7
|
+
export declare function sortedInsert<T>(items: T[], add: T, maxSize: number, comparator: (a: T, b: T) => number): T | null;
|
|
@@ -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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,82 +1,63 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qidao/sdk",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.1.2",
|
|
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
|
-
"repository":
|
|
12
|
-
|
|
13
|
-
"url": "git+https://github.com/publu/qidao-sdk.git"
|
|
14
|
-
},
|
|
15
|
-
"keywords": [
|
|
16
|
-
"qidao",
|
|
17
|
-
"mai",
|
|
18
|
-
"polygon",
|
|
19
|
-
"sdk"
|
|
20
|
-
],
|
|
21
|
-
"module": "dist/sdk.esm.js",
|
|
19
|
+
"repository": "https://github.com/royalaid/sushiswap-sdk",
|
|
20
|
+
"keywords": [],
|
|
22
21
|
"scripts": {
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"test": "tsdx test",
|
|
27
|
-
"prepublish": "tsdx build",
|
|
28
|
-
"prepare": "husky install",
|
|
29
|
-
"prettier": "prettier --write 'src/**/*.ts' 'test/**/*.ts'"
|
|
30
|
-
},
|
|
31
|
-
"lint-staged": {
|
|
32
|
-
"*.{js,jsx,ts,tsx}": [
|
|
33
|
-
"yarn lint",
|
|
34
|
-
"yarn test --bail --passWithNoTests --findRelatedTests",
|
|
35
|
-
"prettier --write"
|
|
36
|
-
],
|
|
37
|
-
"*.md": "prettier --write"
|
|
22
|
+
"build": "microbundle",
|
|
23
|
+
"start": "microbundle watch",
|
|
24
|
+
"prepublishOnly": "typechain --discriminate-types --target ethers-v5 --out-dir src/contracts \"src/abis/toGenerate/**/*.json\" && microbundle"
|
|
38
25
|
},
|
|
39
26
|
"dependencies": {
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"@ethersproject/
|
|
50
|
-
"@ethersproject/
|
|
51
|
-
"@ethersproject/
|
|
52
|
-
"@
|
|
53
|
-
"
|
|
54
|
-
"decimal.js-light": "^2.5.0",
|
|
55
|
-
"eip-712": "^0.4.3",
|
|
56
|
-
"isomorphic-unfetch": "^3.1.0",
|
|
57
|
-
"jsbi": "^4.1.0",
|
|
58
|
-
"tiny-invariant": "^1.1.0",
|
|
59
|
-
"tiny-warning": "^1.0.3",
|
|
60
|
-
"toformat": "^2.0.0"
|
|
27
|
+
"big.js": "5.2.2",
|
|
28
|
+
"decimal.js-light": "2.5.1",
|
|
29
|
+
"ethers": "5.6.9",
|
|
30
|
+
"jsbi": "3.2.5",
|
|
31
|
+
"tiny-invariant": "1.2.0",
|
|
32
|
+
"tiny-warning": "1.0.3",
|
|
33
|
+
"toformat": "2.0.0"
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"@ethersproject/address": "5.6.1",
|
|
37
|
+
"@ethersproject/contracts": "5.6.2",
|
|
38
|
+
"@ethersproject/networks": "5.6.4",
|
|
39
|
+
"@ethersproject/providers": "5.6.8",
|
|
40
|
+
"@ethersproject/solidity": "5.6.1"
|
|
61
41
|
},
|
|
62
42
|
"devDependencies": {
|
|
63
|
-
"@
|
|
64
|
-
"@
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
43
|
+
"@ethersproject/address": "5.6.1",
|
|
44
|
+
"@ethersproject/contracts": "5.6.2",
|
|
45
|
+
"@ethersproject/networks": "5.6.4",
|
|
46
|
+
"@ethersproject/providers": "5.6.8",
|
|
47
|
+
"@ethersproject/solidity": "5.6.1",
|
|
48
|
+
"@typechain/ethers-v5": "10.1.0",
|
|
49
|
+
"@types/big.js": "4.0.5",
|
|
50
|
+
"@types/jest": "28.1.6",
|
|
51
|
+
"microbundle": "0.15.1",
|
|
52
|
+
"typechain": "8.1.0",
|
|
53
|
+
"typescript": "4.7.4"
|
|
70
54
|
},
|
|
71
55
|
"engines": {
|
|
72
|
-
"node": ">=
|
|
73
|
-
},
|
|
74
|
-
"bugs": {
|
|
75
|
-
"url": "https://github.com/publu/qidao-sdk/issues"
|
|
76
|
-
},
|
|
77
|
-
"homepage": "https://github.com/publu/qidao-sdk#readme",
|
|
78
|
-
"directories": {
|
|
79
|
-
"test": "test"
|
|
56
|
+
"node": ">= 16"
|
|
80
57
|
},
|
|
81
|
-
"
|
|
58
|
+
"prettier": {
|
|
59
|
+
"printWidth": 120,
|
|
60
|
+
"semi": false,
|
|
61
|
+
"singleQuote": true
|
|
62
|
+
}
|
|
82
63
|
}
|
|
@@ -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,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,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
|
-
}
|