@etcswapv2/sdk-legacy 1.0.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/index.d.mts +214 -0
- package/dist/index.d.ts +214 -0
- package/dist/index.js +618 -0
- package/dist/index.mjs +570 -0
- package/package.json +55 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ETCswap SDK Legacy - Non-generic V2 SDK for Ethereum Classic
|
|
3
|
+
*
|
|
4
|
+
* This SDK provides a Uniswap V2-compatible API (non-generic classes) for
|
|
5
|
+
* ETCswap V2 protocol on Ethereum Classic chains.
|
|
6
|
+
*
|
|
7
|
+
* Use this SDK when migrating from the original Uniswap V2 interface or
|
|
8
|
+
* when you need the simpler non-generic API.
|
|
9
|
+
*
|
|
10
|
+
* For new projects, consider using @etcswapv2/sdk which provides a
|
|
11
|
+
* modern generics-based API.
|
|
12
|
+
*/
|
|
13
|
+
declare enum ChainId {
|
|
14
|
+
MAINNET = 1,
|
|
15
|
+
ROPSTEN = 3,
|
|
16
|
+
RINKEBY = 4,
|
|
17
|
+
GÖRLI = 5,
|
|
18
|
+
KOVAN = 42,
|
|
19
|
+
CLASSIC = 61,
|
|
20
|
+
MORDOR = 63
|
|
21
|
+
}
|
|
22
|
+
declare const SUPPORTED_CHAINS: readonly [ChainId.CLASSIC, ChainId.MORDOR];
|
|
23
|
+
declare class Ether {
|
|
24
|
+
readonly decimals = 18;
|
|
25
|
+
readonly symbol = "ETC";
|
|
26
|
+
readonly name = "Ether";
|
|
27
|
+
private constructor();
|
|
28
|
+
private static _instance;
|
|
29
|
+
static get Instance(): Ether;
|
|
30
|
+
}
|
|
31
|
+
declare const ETHER: Ether;
|
|
32
|
+
declare class Token {
|
|
33
|
+
readonly chainId: ChainId;
|
|
34
|
+
readonly address: string;
|
|
35
|
+
readonly decimals: number;
|
|
36
|
+
readonly symbol?: string;
|
|
37
|
+
readonly name?: string;
|
|
38
|
+
constructor(chainId: ChainId, address: string, decimals: number, symbol?: string, name?: string);
|
|
39
|
+
equals(other: Token): boolean;
|
|
40
|
+
sortsBefore(other: Token): boolean;
|
|
41
|
+
}
|
|
42
|
+
declare const WETC: {
|
|
43
|
+
[chainId in ChainId]?: Token;
|
|
44
|
+
};
|
|
45
|
+
declare const WETH: {
|
|
46
|
+
1?: Token | undefined;
|
|
47
|
+
3?: Token | undefined;
|
|
48
|
+
4?: Token | undefined;
|
|
49
|
+
5?: Token | undefined;
|
|
50
|
+
42?: Token | undefined;
|
|
51
|
+
61?: Token | undefined;
|
|
52
|
+
63?: Token | undefined;
|
|
53
|
+
};
|
|
54
|
+
type Currency = Token | typeof ETHER;
|
|
55
|
+
declare class Fraction {
|
|
56
|
+
readonly numerator: bigint;
|
|
57
|
+
readonly denominator: bigint;
|
|
58
|
+
constructor(numerator: bigint | number | string, denominator?: bigint | number | string);
|
|
59
|
+
get quotient(): bigint;
|
|
60
|
+
invert(): Fraction;
|
|
61
|
+
add(other: Fraction | bigint): Fraction;
|
|
62
|
+
subtract(other: Fraction | bigint): Fraction;
|
|
63
|
+
multiply(other: Fraction | bigint): Fraction;
|
|
64
|
+
divide(other: Fraction | bigint): Fraction;
|
|
65
|
+
lessThan(other: Fraction | bigint): boolean;
|
|
66
|
+
greaterThan(other: Fraction | bigint): boolean;
|
|
67
|
+
equalTo(other: Fraction | bigint): boolean;
|
|
68
|
+
toSignificant(significantDigits?: number): string;
|
|
69
|
+
toFixed(decimalPlaces?: number): string;
|
|
70
|
+
}
|
|
71
|
+
declare class Percent extends Fraction {
|
|
72
|
+
constructor(numerator: bigint | number | string, denominator?: bigint | number | string);
|
|
73
|
+
toFixed(decimalPlaces?: number): string;
|
|
74
|
+
toSignificant(significantDigits?: number): string;
|
|
75
|
+
add(other: Fraction | bigint): Percent;
|
|
76
|
+
subtract(other: Fraction | bigint): Percent;
|
|
77
|
+
multiply(other: Fraction | bigint): Percent;
|
|
78
|
+
}
|
|
79
|
+
declare class TokenAmount extends Fraction {
|
|
80
|
+
readonly token: Token;
|
|
81
|
+
readonly raw: bigint;
|
|
82
|
+
constructor(token: Token, amount: bigint | string | number);
|
|
83
|
+
get currency(): Token;
|
|
84
|
+
toExact(): string;
|
|
85
|
+
toSignificant(significantDigits?: number): string;
|
|
86
|
+
add(other: TokenAmount): TokenAmount;
|
|
87
|
+
subtract(other: TokenAmount | Fraction | bigint): TokenAmount;
|
|
88
|
+
greaterThan(other: TokenAmount | Fraction | bigint): boolean;
|
|
89
|
+
lessThan(other: TokenAmount | Fraction | bigint): boolean;
|
|
90
|
+
equalTo(other: TokenAmount | Fraction | bigint): boolean;
|
|
91
|
+
}
|
|
92
|
+
declare class CurrencyAmount extends Fraction {
|
|
93
|
+
readonly currency: Currency;
|
|
94
|
+
readonly raw: bigint;
|
|
95
|
+
constructor(currency: Currency, amount: bigint | string | number);
|
|
96
|
+
static ether(amount: bigint | string | number): CurrencyAmount;
|
|
97
|
+
toExact(): string;
|
|
98
|
+
toSignificant(significantDigits?: number): string;
|
|
99
|
+
add(other: CurrencyAmount): CurrencyAmount;
|
|
100
|
+
subtract(other: CurrencyAmount | Fraction | bigint): CurrencyAmount;
|
|
101
|
+
greaterThan(other: CurrencyAmount | Fraction | bigint): boolean;
|
|
102
|
+
}
|
|
103
|
+
declare class Price extends Fraction {
|
|
104
|
+
readonly baseCurrency: Currency;
|
|
105
|
+
readonly quoteCurrency: Currency;
|
|
106
|
+
readonly scalar: Fraction;
|
|
107
|
+
constructor(baseCurrency: Currency, quoteCurrency: Currency, denominator: bigint | string | number, numerator: bigint | string | number);
|
|
108
|
+
get raw(): Fraction;
|
|
109
|
+
get adjusted(): Fraction;
|
|
110
|
+
invert(): Price;
|
|
111
|
+
multiply(other: Price): Price;
|
|
112
|
+
quote(currencyAmount: CurrencyAmount): CurrencyAmount;
|
|
113
|
+
toSignificant(significantDigits?: number): string;
|
|
114
|
+
toFixed(decimalPlaces?: number): string;
|
|
115
|
+
}
|
|
116
|
+
declare class Pair {
|
|
117
|
+
readonly token0: Token;
|
|
118
|
+
readonly token1: Token;
|
|
119
|
+
readonly reserve0: TokenAmount;
|
|
120
|
+
readonly reserve1: TokenAmount;
|
|
121
|
+
readonly liquidityToken: Token;
|
|
122
|
+
constructor(tokenAmountA: TokenAmount, tokenAmountB: TokenAmount);
|
|
123
|
+
static getAddress(tokenA: Token, tokenB: Token): string;
|
|
124
|
+
get token0Price(): Price;
|
|
125
|
+
get token1Price(): Price;
|
|
126
|
+
priceOf(token: Token): Price;
|
|
127
|
+
reserveOf(token: Token): TokenAmount;
|
|
128
|
+
involvesToken(token: Token): boolean;
|
|
129
|
+
getLiquidityValue(token: Token, totalSupply: TokenAmount, liquidity: TokenAmount, _feeOn?: boolean): TokenAmount;
|
|
130
|
+
/**
|
|
131
|
+
* Returns the amount of liquidity tokens that would be minted given the deposited amounts
|
|
132
|
+
*/
|
|
133
|
+
getLiquidityMinted(totalSupply: TokenAmount, tokenAmountA: TokenAmount, tokenAmountB: TokenAmount): TokenAmount;
|
|
134
|
+
}
|
|
135
|
+
declare enum TradeType {
|
|
136
|
+
EXACT_INPUT = 0,
|
|
137
|
+
EXACT_OUTPUT = 1
|
|
138
|
+
}
|
|
139
|
+
declare class Route {
|
|
140
|
+
readonly pairs: Pair[];
|
|
141
|
+
readonly path: Token[];
|
|
142
|
+
readonly input: Currency;
|
|
143
|
+
readonly output: Currency;
|
|
144
|
+
constructor(pairs: Pair[], input: Currency, output?: Currency);
|
|
145
|
+
get midPrice(): Price;
|
|
146
|
+
}
|
|
147
|
+
declare class Trade {
|
|
148
|
+
readonly route: Route;
|
|
149
|
+
readonly tradeType: TradeType;
|
|
150
|
+
readonly inputAmount: CurrencyAmount;
|
|
151
|
+
readonly outputAmount: CurrencyAmount;
|
|
152
|
+
readonly priceImpact: Percent;
|
|
153
|
+
constructor(route: Route, amount: CurrencyAmount, tradeType: TradeType);
|
|
154
|
+
get executionPrice(): Price;
|
|
155
|
+
minimumAmountOut(slippageTolerance: Percent): CurrencyAmount;
|
|
156
|
+
maximumAmountIn(slippageTolerance: Percent): CurrencyAmount;
|
|
157
|
+
static exactIn(route: Route, amountIn: CurrencyAmount): Trade;
|
|
158
|
+
static exactOut(route: Route, amountOut: CurrencyAmount): Trade;
|
|
159
|
+
static bestTradeExactIn(pairs: Pair[], currencyAmountIn: CurrencyAmount, currencyOut: Currency, _options?: {
|
|
160
|
+
maxHops?: number;
|
|
161
|
+
maxNumResults?: number;
|
|
162
|
+
}): Trade[];
|
|
163
|
+
static bestTradeExactOut(pairs: Pair[], currencyIn: Currency, currencyAmountOut: CurrencyAmount, _options?: {
|
|
164
|
+
maxHops?: number;
|
|
165
|
+
maxNumResults?: number;
|
|
166
|
+
}): Trade[];
|
|
167
|
+
}
|
|
168
|
+
declare const JSBI: {
|
|
169
|
+
BigInt: (value: string | number | bigint) => bigint;
|
|
170
|
+
add: (a: bigint, b: bigint) => bigint;
|
|
171
|
+
subtract: (a: bigint, b: bigint) => bigint;
|
|
172
|
+
multiply: (a: bigint, b: bigint) => bigint;
|
|
173
|
+
divide: (a: bigint, b: bigint) => bigint;
|
|
174
|
+
remainder: (a: bigint, b: bigint) => bigint;
|
|
175
|
+
exponentiate: (a: bigint, b: bigint) => bigint;
|
|
176
|
+
greaterThan: (a: bigint, b: bigint) => boolean;
|
|
177
|
+
greaterThanOrEqual: (a: bigint, b: bigint) => boolean;
|
|
178
|
+
lessThan: (a: bigint, b: bigint) => boolean;
|
|
179
|
+
lessThanOrEqual: (a: bigint, b: bigint) => boolean;
|
|
180
|
+
equal: (a: bigint, b: bigint) => boolean;
|
|
181
|
+
notEqual: (a: bigint, b: bigint) => boolean;
|
|
182
|
+
};
|
|
183
|
+
declare enum Rounding {
|
|
184
|
+
ROUND_DOWN = 0,
|
|
185
|
+
ROUND_HALF_UP = 1,
|
|
186
|
+
ROUND_UP = 2
|
|
187
|
+
}
|
|
188
|
+
declare function currencyEquals(a: Currency, b: Currency): boolean;
|
|
189
|
+
declare const FACTORY_ADDRESS: {
|
|
190
|
+
[chainId in ChainId]?: string;
|
|
191
|
+
};
|
|
192
|
+
declare const ROUTER_ADDRESS: {
|
|
193
|
+
[chainId in ChainId]?: string;
|
|
194
|
+
};
|
|
195
|
+
declare const INIT_CODE_HASH: {
|
|
196
|
+
[chainId in ChainId]?: string;
|
|
197
|
+
};
|
|
198
|
+
declare const MINIMUM_LIQUIDITY = 1000n;
|
|
199
|
+
interface SwapParameters {
|
|
200
|
+
methodName: string;
|
|
201
|
+
args: (string | string[])[];
|
|
202
|
+
value: string;
|
|
203
|
+
}
|
|
204
|
+
declare class Router {
|
|
205
|
+
static swapCallParameters(trade: Trade, options: {
|
|
206
|
+
allowedSlippage: Percent;
|
|
207
|
+
recipient: string;
|
|
208
|
+
deadline: number;
|
|
209
|
+
ttl?: number;
|
|
210
|
+
feeOnTransfer?: boolean;
|
|
211
|
+
}): SwapParameters;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export { ChainId, type Currency, CurrencyAmount, ETHER, Ether, FACTORY_ADDRESS, Fraction, INIT_CODE_HASH, JSBI, MINIMUM_LIQUIDITY, Pair, Percent, Price, ROUTER_ADDRESS, Rounding, Route, Router, SUPPORTED_CHAINS, type SwapParameters, Token, TokenAmount, Trade, TradeType, WETC, WETH, currencyEquals };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ETCswap SDK Legacy - Non-generic V2 SDK for Ethereum Classic
|
|
3
|
+
*
|
|
4
|
+
* This SDK provides a Uniswap V2-compatible API (non-generic classes) for
|
|
5
|
+
* ETCswap V2 protocol on Ethereum Classic chains.
|
|
6
|
+
*
|
|
7
|
+
* Use this SDK when migrating from the original Uniswap V2 interface or
|
|
8
|
+
* when you need the simpler non-generic API.
|
|
9
|
+
*
|
|
10
|
+
* For new projects, consider using @etcswapv2/sdk which provides a
|
|
11
|
+
* modern generics-based API.
|
|
12
|
+
*/
|
|
13
|
+
declare enum ChainId {
|
|
14
|
+
MAINNET = 1,
|
|
15
|
+
ROPSTEN = 3,
|
|
16
|
+
RINKEBY = 4,
|
|
17
|
+
GÖRLI = 5,
|
|
18
|
+
KOVAN = 42,
|
|
19
|
+
CLASSIC = 61,
|
|
20
|
+
MORDOR = 63
|
|
21
|
+
}
|
|
22
|
+
declare const SUPPORTED_CHAINS: readonly [ChainId.CLASSIC, ChainId.MORDOR];
|
|
23
|
+
declare class Ether {
|
|
24
|
+
readonly decimals = 18;
|
|
25
|
+
readonly symbol = "ETC";
|
|
26
|
+
readonly name = "Ether";
|
|
27
|
+
private constructor();
|
|
28
|
+
private static _instance;
|
|
29
|
+
static get Instance(): Ether;
|
|
30
|
+
}
|
|
31
|
+
declare const ETHER: Ether;
|
|
32
|
+
declare class Token {
|
|
33
|
+
readonly chainId: ChainId;
|
|
34
|
+
readonly address: string;
|
|
35
|
+
readonly decimals: number;
|
|
36
|
+
readonly symbol?: string;
|
|
37
|
+
readonly name?: string;
|
|
38
|
+
constructor(chainId: ChainId, address: string, decimals: number, symbol?: string, name?: string);
|
|
39
|
+
equals(other: Token): boolean;
|
|
40
|
+
sortsBefore(other: Token): boolean;
|
|
41
|
+
}
|
|
42
|
+
declare const WETC: {
|
|
43
|
+
[chainId in ChainId]?: Token;
|
|
44
|
+
};
|
|
45
|
+
declare const WETH: {
|
|
46
|
+
1?: Token | undefined;
|
|
47
|
+
3?: Token | undefined;
|
|
48
|
+
4?: Token | undefined;
|
|
49
|
+
5?: Token | undefined;
|
|
50
|
+
42?: Token | undefined;
|
|
51
|
+
61?: Token | undefined;
|
|
52
|
+
63?: Token | undefined;
|
|
53
|
+
};
|
|
54
|
+
type Currency = Token | typeof ETHER;
|
|
55
|
+
declare class Fraction {
|
|
56
|
+
readonly numerator: bigint;
|
|
57
|
+
readonly denominator: bigint;
|
|
58
|
+
constructor(numerator: bigint | number | string, denominator?: bigint | number | string);
|
|
59
|
+
get quotient(): bigint;
|
|
60
|
+
invert(): Fraction;
|
|
61
|
+
add(other: Fraction | bigint): Fraction;
|
|
62
|
+
subtract(other: Fraction | bigint): Fraction;
|
|
63
|
+
multiply(other: Fraction | bigint): Fraction;
|
|
64
|
+
divide(other: Fraction | bigint): Fraction;
|
|
65
|
+
lessThan(other: Fraction | bigint): boolean;
|
|
66
|
+
greaterThan(other: Fraction | bigint): boolean;
|
|
67
|
+
equalTo(other: Fraction | bigint): boolean;
|
|
68
|
+
toSignificant(significantDigits?: number): string;
|
|
69
|
+
toFixed(decimalPlaces?: number): string;
|
|
70
|
+
}
|
|
71
|
+
declare class Percent extends Fraction {
|
|
72
|
+
constructor(numerator: bigint | number | string, denominator?: bigint | number | string);
|
|
73
|
+
toFixed(decimalPlaces?: number): string;
|
|
74
|
+
toSignificant(significantDigits?: number): string;
|
|
75
|
+
add(other: Fraction | bigint): Percent;
|
|
76
|
+
subtract(other: Fraction | bigint): Percent;
|
|
77
|
+
multiply(other: Fraction | bigint): Percent;
|
|
78
|
+
}
|
|
79
|
+
declare class TokenAmount extends Fraction {
|
|
80
|
+
readonly token: Token;
|
|
81
|
+
readonly raw: bigint;
|
|
82
|
+
constructor(token: Token, amount: bigint | string | number);
|
|
83
|
+
get currency(): Token;
|
|
84
|
+
toExact(): string;
|
|
85
|
+
toSignificant(significantDigits?: number): string;
|
|
86
|
+
add(other: TokenAmount): TokenAmount;
|
|
87
|
+
subtract(other: TokenAmount | Fraction | bigint): TokenAmount;
|
|
88
|
+
greaterThan(other: TokenAmount | Fraction | bigint): boolean;
|
|
89
|
+
lessThan(other: TokenAmount | Fraction | bigint): boolean;
|
|
90
|
+
equalTo(other: TokenAmount | Fraction | bigint): boolean;
|
|
91
|
+
}
|
|
92
|
+
declare class CurrencyAmount extends Fraction {
|
|
93
|
+
readonly currency: Currency;
|
|
94
|
+
readonly raw: bigint;
|
|
95
|
+
constructor(currency: Currency, amount: bigint | string | number);
|
|
96
|
+
static ether(amount: bigint | string | number): CurrencyAmount;
|
|
97
|
+
toExact(): string;
|
|
98
|
+
toSignificant(significantDigits?: number): string;
|
|
99
|
+
add(other: CurrencyAmount): CurrencyAmount;
|
|
100
|
+
subtract(other: CurrencyAmount | Fraction | bigint): CurrencyAmount;
|
|
101
|
+
greaterThan(other: CurrencyAmount | Fraction | bigint): boolean;
|
|
102
|
+
}
|
|
103
|
+
declare class Price extends Fraction {
|
|
104
|
+
readonly baseCurrency: Currency;
|
|
105
|
+
readonly quoteCurrency: Currency;
|
|
106
|
+
readonly scalar: Fraction;
|
|
107
|
+
constructor(baseCurrency: Currency, quoteCurrency: Currency, denominator: bigint | string | number, numerator: bigint | string | number);
|
|
108
|
+
get raw(): Fraction;
|
|
109
|
+
get adjusted(): Fraction;
|
|
110
|
+
invert(): Price;
|
|
111
|
+
multiply(other: Price): Price;
|
|
112
|
+
quote(currencyAmount: CurrencyAmount): CurrencyAmount;
|
|
113
|
+
toSignificant(significantDigits?: number): string;
|
|
114
|
+
toFixed(decimalPlaces?: number): string;
|
|
115
|
+
}
|
|
116
|
+
declare class Pair {
|
|
117
|
+
readonly token0: Token;
|
|
118
|
+
readonly token1: Token;
|
|
119
|
+
readonly reserve0: TokenAmount;
|
|
120
|
+
readonly reserve1: TokenAmount;
|
|
121
|
+
readonly liquidityToken: Token;
|
|
122
|
+
constructor(tokenAmountA: TokenAmount, tokenAmountB: TokenAmount);
|
|
123
|
+
static getAddress(tokenA: Token, tokenB: Token): string;
|
|
124
|
+
get token0Price(): Price;
|
|
125
|
+
get token1Price(): Price;
|
|
126
|
+
priceOf(token: Token): Price;
|
|
127
|
+
reserveOf(token: Token): TokenAmount;
|
|
128
|
+
involvesToken(token: Token): boolean;
|
|
129
|
+
getLiquidityValue(token: Token, totalSupply: TokenAmount, liquidity: TokenAmount, _feeOn?: boolean): TokenAmount;
|
|
130
|
+
/**
|
|
131
|
+
* Returns the amount of liquidity tokens that would be minted given the deposited amounts
|
|
132
|
+
*/
|
|
133
|
+
getLiquidityMinted(totalSupply: TokenAmount, tokenAmountA: TokenAmount, tokenAmountB: TokenAmount): TokenAmount;
|
|
134
|
+
}
|
|
135
|
+
declare enum TradeType {
|
|
136
|
+
EXACT_INPUT = 0,
|
|
137
|
+
EXACT_OUTPUT = 1
|
|
138
|
+
}
|
|
139
|
+
declare class Route {
|
|
140
|
+
readonly pairs: Pair[];
|
|
141
|
+
readonly path: Token[];
|
|
142
|
+
readonly input: Currency;
|
|
143
|
+
readonly output: Currency;
|
|
144
|
+
constructor(pairs: Pair[], input: Currency, output?: Currency);
|
|
145
|
+
get midPrice(): Price;
|
|
146
|
+
}
|
|
147
|
+
declare class Trade {
|
|
148
|
+
readonly route: Route;
|
|
149
|
+
readonly tradeType: TradeType;
|
|
150
|
+
readonly inputAmount: CurrencyAmount;
|
|
151
|
+
readonly outputAmount: CurrencyAmount;
|
|
152
|
+
readonly priceImpact: Percent;
|
|
153
|
+
constructor(route: Route, amount: CurrencyAmount, tradeType: TradeType);
|
|
154
|
+
get executionPrice(): Price;
|
|
155
|
+
minimumAmountOut(slippageTolerance: Percent): CurrencyAmount;
|
|
156
|
+
maximumAmountIn(slippageTolerance: Percent): CurrencyAmount;
|
|
157
|
+
static exactIn(route: Route, amountIn: CurrencyAmount): Trade;
|
|
158
|
+
static exactOut(route: Route, amountOut: CurrencyAmount): Trade;
|
|
159
|
+
static bestTradeExactIn(pairs: Pair[], currencyAmountIn: CurrencyAmount, currencyOut: Currency, _options?: {
|
|
160
|
+
maxHops?: number;
|
|
161
|
+
maxNumResults?: number;
|
|
162
|
+
}): Trade[];
|
|
163
|
+
static bestTradeExactOut(pairs: Pair[], currencyIn: Currency, currencyAmountOut: CurrencyAmount, _options?: {
|
|
164
|
+
maxHops?: number;
|
|
165
|
+
maxNumResults?: number;
|
|
166
|
+
}): Trade[];
|
|
167
|
+
}
|
|
168
|
+
declare const JSBI: {
|
|
169
|
+
BigInt: (value: string | number | bigint) => bigint;
|
|
170
|
+
add: (a: bigint, b: bigint) => bigint;
|
|
171
|
+
subtract: (a: bigint, b: bigint) => bigint;
|
|
172
|
+
multiply: (a: bigint, b: bigint) => bigint;
|
|
173
|
+
divide: (a: bigint, b: bigint) => bigint;
|
|
174
|
+
remainder: (a: bigint, b: bigint) => bigint;
|
|
175
|
+
exponentiate: (a: bigint, b: bigint) => bigint;
|
|
176
|
+
greaterThan: (a: bigint, b: bigint) => boolean;
|
|
177
|
+
greaterThanOrEqual: (a: bigint, b: bigint) => boolean;
|
|
178
|
+
lessThan: (a: bigint, b: bigint) => boolean;
|
|
179
|
+
lessThanOrEqual: (a: bigint, b: bigint) => boolean;
|
|
180
|
+
equal: (a: bigint, b: bigint) => boolean;
|
|
181
|
+
notEqual: (a: bigint, b: bigint) => boolean;
|
|
182
|
+
};
|
|
183
|
+
declare enum Rounding {
|
|
184
|
+
ROUND_DOWN = 0,
|
|
185
|
+
ROUND_HALF_UP = 1,
|
|
186
|
+
ROUND_UP = 2
|
|
187
|
+
}
|
|
188
|
+
declare function currencyEquals(a: Currency, b: Currency): boolean;
|
|
189
|
+
declare const FACTORY_ADDRESS: {
|
|
190
|
+
[chainId in ChainId]?: string;
|
|
191
|
+
};
|
|
192
|
+
declare const ROUTER_ADDRESS: {
|
|
193
|
+
[chainId in ChainId]?: string;
|
|
194
|
+
};
|
|
195
|
+
declare const INIT_CODE_HASH: {
|
|
196
|
+
[chainId in ChainId]?: string;
|
|
197
|
+
};
|
|
198
|
+
declare const MINIMUM_LIQUIDITY = 1000n;
|
|
199
|
+
interface SwapParameters {
|
|
200
|
+
methodName: string;
|
|
201
|
+
args: (string | string[])[];
|
|
202
|
+
value: string;
|
|
203
|
+
}
|
|
204
|
+
declare class Router {
|
|
205
|
+
static swapCallParameters(trade: Trade, options: {
|
|
206
|
+
allowedSlippage: Percent;
|
|
207
|
+
recipient: string;
|
|
208
|
+
deadline: number;
|
|
209
|
+
ttl?: number;
|
|
210
|
+
feeOnTransfer?: boolean;
|
|
211
|
+
}): SwapParameters;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export { ChainId, type Currency, CurrencyAmount, ETHER, Ether, FACTORY_ADDRESS, Fraction, INIT_CODE_HASH, JSBI, MINIMUM_LIQUIDITY, Pair, Percent, Price, ROUTER_ADDRESS, Rounding, Route, Router, SUPPORTED_CHAINS, type SwapParameters, Token, TokenAmount, Trade, TradeType, WETC, WETH, currencyEquals };
|