@paraswap/dex-lib 2.37.7 → 2.38.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/build/abi/algebra/AlgebraPool.abi.json +727 -0
- package/build/dex/algebra/algebra-pool.d.ts +46 -0
- package/build/dex/algebra/algebra-pool.js +336 -0
- package/build/dex/algebra/algebra-pool.js.map +1 -0
- package/build/dex/gmx/config.js +1 -1
- package/build/dex/uniswap-v2/config.js +22 -0
- package/build/dex/uniswap-v2/config.js.map +1 -1
- package/package.json +1 -1
- package/src/dex/gmx/config.ts +1 -1
- package/src/dex/uniswap-v2/config.ts +23 -0
- package/build/abi/quickPerps/fast-price-events.json +0 -70
- package/build/abi/quickPerps/fast-price-feed.json +0 -748
- package/build/abi/quickPerps/reader.json +0 -313
- package/build/abi/quickPerps/vault-price-feed.json +0 -477
- package/build/abi/quickPerps/vault.json +0 -1953
- package/build/abi/uniswap-v3/pancakeswap-v3/PancakeswapV3QuoterV2.abi.json +0 -285
- package/build/abi/uniswap-v3/pancakeswap-v3/PancakeswapV3Router.abi.json +0 -583
- package/build/abi/woo-fi/WooFeeManager.abi.json +0 -318
- package/build/abi/woo-fi/WooPP.abi.json +0 -548
- package/build/abi/woo-fi/Wooracle.abi.json +0 -260
- package/build/dex/aave-v3/tokens/arbitrum.json +0 -50
- package/build/dex/aave-v3/tokens/avalanche.json +0 -74
- package/build/dex/aave-v3/tokens/fantom.json +0 -62
- package/build/dex/aave-v3/tokens/optimism.json +0 -50
- package/build/dex/aave-v3/tokens/polygon.json +0 -116
- package/build/dex/balancer-v2/LinearMath.d.ts +0 -19
- package/build/dex/balancer-v2/LinearMath.js +0 -179
- package/build/dex/balancer-v2/LinearMath.js.map +0 -1
- package/build/dex/balancer-v2/LinearPool.d.ts +0 -47
- package/build/dex/balancer-v2/LinearPool.js +0 -324
- package/build/dex/balancer-v2/LinearPool.js.map +0 -1
- package/build/dex/balancer-v2/PhantomStablePool.d.ts +0 -47
- package/build/dex/balancer-v2/PhantomStablePool.js +0 -294
- package/build/dex/balancer-v2/PhantomStablePool.js.map +0 -1
- package/build/dex/balancer-v2/StableMath.d.ts +0 -9
- package/build/dex/balancer-v2/StableMath.js +0 -272
- package/build/dex/balancer-v2/StableMath.js.map +0 -1
- package/build/dex/balancer-v2/balancer-v2-pool.d.ts +0 -75
- package/build/dex/balancer-v2/balancer-v2-pool.js +0 -417
- package/build/dex/balancer-v2/balancer-v2-pool.js.map +0 -1
- package/build/dex/maverick-v1/scripts/event-sequence.d.ts +0 -1
- package/build/dex/maverick-v1/scripts/event-sequence.js +0 -110
- package/build/dex/maverick-v1/scripts/event-sequence.js.map +0 -1
- package/build/dex/quickswap-v3.d.ts +0 -21
- package/build/dex/quickswap-v3.js +0 -40
- package/build/dex/quickswap-v3.js.map +0 -1
- package/build/dex/test-dex/config.d.ts +0 -4
- package/build/dex/test-dex/config.js +0 -15
- package/build/dex/test-dex/config.js.map +0 -1
- package/build/dex/test-dex/test-dex-pool.d.ts +0 -39
- package/build/dex/test-dex/test-dex-pool.js +0 -63
- package/build/dex/test-dex/test-dex-pool.js.map +0 -1
- package/build/dex/test-dex/test-dex.d.ts +0 -37
- package/build/dex/test-dex/test-dex.js +0 -126
- package/build/dex/test-dex/test-dex.js.map +0 -1
- package/build/dex/test-dex/types.d.ts +0 -6
- package/build/dex/test-dex/types.js +0 -3
- package/build/dex/test-dex/types.js.map +0 -1
- package/build/dex/uniswap-v3/forks/pancakeswap-v3/pancakeswap-v3.d.ts +0 -12
- package/build/dex/uniswap-v3/forks/pancakeswap-v3/pancakeswap-v3.js +0 -23
- package/build/dex/uniswap-v3/forks/pancakeswap-v3/pancakeswap-v3.js.map +0 -1
- package/build/dex/woo-fi/config.d.ts +0 -4
- package/build/dex/woo-fi/config.js +0 -141
- package/build/dex/woo-fi/config.js.map +0 -1
- package/build/dex/woo-fi/constants.d.ts +0 -5
- package/build/dex/woo-fi/constants.js +0 -20
- package/build/dex/woo-fi/constants.js.map +0 -1
- package/build/dex/woo-fi/types.d.ts +0 -48
- package/build/dex/woo-fi/types.js +0 -3
- package/build/dex/woo-fi/types.js.map +0 -1
- package/build/dex/woo-fi/woo-fi-decimal-math.d.ts +0 -14
- package/build/dex/woo-fi/woo-fi-decimal-math.js +0 -42
- package/build/dex/woo-fi/woo-fi-decimal-math.js.map +0 -1
- package/build/dex/woo-fi/woo-fi-math.d.ts +0 -31
- package/build/dex/woo-fi/woo-fi-math.js +0 -300
- package/build/dex/woo-fi/woo-fi-math.js.map +0 -1
- package/build/dex/woo-fi/woo-fi.d.ts +0 -65
- package/build/dex/woo-fi/woo-fi.js +0 -480
- package/build/dex/woo-fi/woo-fi.js.map +0 -1
- package/build/dex/woo-fi-v2/woo-fi-math.d.ts +0 -16
- package/build/dex/woo-fi-v2/woo-fi-math.js +0 -137
- package/build/dex/woo-fi-v2/woo-fi-math.js.map +0 -1
- package/build/workers.d.ts +0 -0
- package/build/workers.js +0 -2
- package/build/workers.js.map +0 -1
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { SwapSide } from '../constants';
|
|
2
|
-
import { Address } from '../types';
|
|
3
|
-
import { IDexTxBuilder } from './idex';
|
|
4
|
-
import { UniswapV3, UniswapV3Param } from './uniswap-v3';
|
|
5
|
-
import { IDexHelper } from '../dex-helper';
|
|
6
|
-
export declare type QuickSwapV3Data = {
|
|
7
|
-
deadline?: number;
|
|
8
|
-
path: {
|
|
9
|
-
tokenIn: Address;
|
|
10
|
-
tokenOut: Address;
|
|
11
|
-
}[];
|
|
12
|
-
};
|
|
13
|
-
export declare class QuickSwapV3 extends UniswapV3 implements IDexTxBuilder<QuickSwapV3Data, UniswapV3Param> {
|
|
14
|
-
static dexKeys: string[];
|
|
15
|
-
constructor(dexHelper: IDexHelper);
|
|
16
|
-
protected encodePath(path: {
|
|
17
|
-
tokenIn: Address;
|
|
18
|
-
tokenOut: Address;
|
|
19
|
-
fee: number;
|
|
20
|
-
}[], side: SwapSide): string;
|
|
21
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.QuickSwapV3 = void 0;
|
|
4
|
-
const constants_1 = require("../constants");
|
|
5
|
-
const uniswap_v3_1 = require("./uniswap-v3");
|
|
6
|
-
const solidity_1 = require("@ethersproject/solidity");
|
|
7
|
-
const QUICKSWAP_V3_ROUTER_ADDRESSES = {
|
|
8
|
-
[constants_1.Network.POLYGON]: '0xf5b509bb0909a69b1c207e495f687a596c168e12',
|
|
9
|
-
};
|
|
10
|
-
class QuickSwapV3 extends uniswap_v3_1.UniswapV3 {
|
|
11
|
-
constructor(dexHelper) {
|
|
12
|
-
super(dexHelper, 'quickswapv3', QUICKSWAP_V3_ROUTER_ADDRESSES[dexHelper.config.data.network]);
|
|
13
|
-
}
|
|
14
|
-
// override parent as QuickSwapV3 handles fees dynamically.
|
|
15
|
-
encodePath(path, side) {
|
|
16
|
-
if (path.length === 0) {
|
|
17
|
-
return '0x';
|
|
18
|
-
}
|
|
19
|
-
const { _path, types } = path.reduce(({ _path, types }, curr, index) => {
|
|
20
|
-
if (index === 0) {
|
|
21
|
-
return {
|
|
22
|
-
types: ['address', 'address'],
|
|
23
|
-
_path: [curr.tokenIn, curr.tokenOut],
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
return {
|
|
28
|
-
types: [...types, 'address'],
|
|
29
|
-
_path: [..._path, curr.tokenOut],
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
}, { _path: [], types: [] });
|
|
33
|
-
return side === constants_1.SwapSide.BUY
|
|
34
|
-
? (0, solidity_1.pack)(types.reverse(), _path.reverse())
|
|
35
|
-
: (0, solidity_1.pack)(types, _path);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
exports.QuickSwapV3 = QuickSwapV3;
|
|
39
|
-
QuickSwapV3.dexKeys = ['quickswapv3'];
|
|
40
|
-
//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I,EAAC,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;YACxC,CAAC,CAAC,IAAA,eAAI,EAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACzB,CAAC;;AAnDH,kCAoDC;AAhDQ,mBAAO,GAAG,CAAC,aAAa,CAAC,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Adapters = exports.TestDexConfig = void 0;
|
|
4
|
-
const constants_1 = require("../../constants");
|
|
5
|
-
exports.TestDexConfig = {
|
|
6
|
-
TestDex: {
|
|
7
|
-
// TODO: complete me!
|
|
8
|
-
},
|
|
9
|
-
};
|
|
10
|
-
exports.Adapters = {
|
|
11
|
-
// TODO: add adapters for each chain
|
|
12
|
-
// This is an example to copy
|
|
13
|
-
[constants_1.Network.MAINNET]: { [constants_1.SwapSide.SELL]: [{ name: '', index: 0 }] },
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/dex/test-dex/config.ts"],"names":[],"mappings":";;;AAEA,+CAAoD;AAEvC,QAAA,aAAa,GAA4B;IACpD,OAAO,EAAE;IACP,qBAAqB;KACtB;CACF,CAAC;AAEW,QAAA,QAAQ,GAAoC;IACvD,oCAAoC;IACpC,6BAA6B;IAC7B,CAAC,mBAAO,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,oBAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE;CACjE,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { Interface } from '@ethersproject/abi';
|
|
2
|
-
import { DeepReadonly } from 'ts-essentials';
|
|
3
|
-
import { Log, Logger } from '../../types';
|
|
4
|
-
import { StatefulEventSubscriber } from '../../stateful-event-subscriber';
|
|
5
|
-
import { IDexHelper } from '../../dex-helper/idex-helper';
|
|
6
|
-
import { PoolState } from './types';
|
|
7
|
-
export declare class TestDexEventPool extends StatefulEventSubscriber<PoolState> {
|
|
8
|
-
protected parentName: string;
|
|
9
|
-
protected network: number;
|
|
10
|
-
protected dexHelper: IDexHelper;
|
|
11
|
-
protected testDexIface: Interface;
|
|
12
|
-
handlers: {
|
|
13
|
-
[event: string]: (event: any, state: DeepReadonly<PoolState>, log: Readonly<Log>) => DeepReadonly<PoolState> | null;
|
|
14
|
-
};
|
|
15
|
-
logDecoder: (log: Log) => any;
|
|
16
|
-
addressesSubscribed: string[];
|
|
17
|
-
constructor(parentName: string, network: number, dexHelper: IDexHelper, logger: Logger, testDexIface?: Interface);
|
|
18
|
-
/**
|
|
19
|
-
* The function is called every time any of the subscribed
|
|
20
|
-
* addresses release log. The function accepts the current
|
|
21
|
-
* state, updates the state according to the log, and returns
|
|
22
|
-
* the updated state.
|
|
23
|
-
* @param state - Current state of event subscriber
|
|
24
|
-
* @param log - Log released by one of the subscribed addresses
|
|
25
|
-
* @returns Updates state of the event subscriber after the log
|
|
26
|
-
*/
|
|
27
|
-
protected processLog(state: DeepReadonly<PoolState>, log: Readonly<Log>): DeepReadonly<PoolState> | null;
|
|
28
|
-
/**
|
|
29
|
-
* The function generates state using on-chain calls. This
|
|
30
|
-
* function is called to regenerate state if the event based
|
|
31
|
-
* system fails to fetch events and the local state is no
|
|
32
|
-
* more correct.
|
|
33
|
-
* @param blockNumber - Blocknumber for which the state should
|
|
34
|
-
* should be generated
|
|
35
|
-
* @returns state of the event subscriber at blocknumber
|
|
36
|
-
*/
|
|
37
|
-
generateState(blockNumber: number): Promise<DeepReadonly<PoolState>>;
|
|
38
|
-
handleMyEvent(event: any, state: DeepReadonly<PoolState>, log: Readonly<Log>): DeepReadonly<PoolState> | null;
|
|
39
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TestDexEventPool = void 0;
|
|
4
|
-
const abi_1 = require("@ethersproject/abi");
|
|
5
|
-
const utils_1 = require("../../utils");
|
|
6
|
-
const stateful_event_subscriber_1 = require("../../stateful-event-subscriber");
|
|
7
|
-
class TestDexEventPool extends stateful_event_subscriber_1.StatefulEventSubscriber {
|
|
8
|
-
constructor(parentName, network, dexHelper, logger, testDexIface = new abi_1.Interface('' /* TODO: Import and put here TestDex ABI */)) {
|
|
9
|
-
super(parentName, logger);
|
|
10
|
-
this.parentName = parentName;
|
|
11
|
-
this.network = network;
|
|
12
|
-
this.dexHelper = dexHelper;
|
|
13
|
-
this.testDexIface = testDexIface;
|
|
14
|
-
this.handlers = {};
|
|
15
|
-
// TODO: make logDecoder decode logs that
|
|
16
|
-
this.logDecoder = (log) => this.testDexIface.parseLog(log);
|
|
17
|
-
this.addressesSubscribed = [
|
|
18
|
-
/* subscribed addresses */
|
|
19
|
-
];
|
|
20
|
-
// Add handlers
|
|
21
|
-
this.handlers['myEvent'] = this.handleMyEvent.bind(this);
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* The function is called every time any of the subscribed
|
|
25
|
-
* addresses release log. The function accepts the current
|
|
26
|
-
* state, updates the state according to the log, and returns
|
|
27
|
-
* the updated state.
|
|
28
|
-
* @param state - Current state of event subscriber
|
|
29
|
-
* @param log - Log released by one of the subscribed addresses
|
|
30
|
-
* @returns Updates state of the event subscriber after the log
|
|
31
|
-
*/
|
|
32
|
-
processLog(state, log) {
|
|
33
|
-
try {
|
|
34
|
-
const event = this.logDecoder(log);
|
|
35
|
-
if (event.name in this.handlers) {
|
|
36
|
-
return this.handlers[event.name](event, state, log);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
catch (e) {
|
|
40
|
-
(0, utils_1.catchParseLogError)(e, this.logger);
|
|
41
|
-
}
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* The function generates state using on-chain calls. This
|
|
46
|
-
* function is called to regenerate state if the event based
|
|
47
|
-
* system fails to fetch events and the local state is no
|
|
48
|
-
* more correct.
|
|
49
|
-
* @param blockNumber - Blocknumber for which the state should
|
|
50
|
-
* should be generated
|
|
51
|
-
* @returns state of the event subscriber at blocknumber
|
|
52
|
-
*/
|
|
53
|
-
async generateState(blockNumber) {
|
|
54
|
-
// TODO: complete me!
|
|
55
|
-
return {};
|
|
56
|
-
}
|
|
57
|
-
// Its just a dummy example
|
|
58
|
-
handleMyEvent(event, state, log) {
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
exports.TestDexEventPool = TestDexEventPool;
|
|
63
|
-
//# sourceMappingURL=test-dex-pool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test-dex-pool.js","sourceRoot":"","sources":["../../../src/dex/test-dex/test-dex-pool.ts"],"names":[],"mappings":";;;AAAA,4CAA+C;AAG/C,uCAAiD;AACjD,+EAA0E;AAI1E,MAAa,gBAAiB,SAAQ,mDAAkC;IAWtE,YACY,UAAkB,EAClB,OAAe,EACf,SAAqB,EAC/B,MAAc,EACJ,eAAe,IAAI,eAAS,CACpC,EAAE,CAAC,2CAA2C,CAC/C;QAED,KAAK,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QARhB,eAAU,GAAV,UAAU,CAAQ;QAClB,YAAO,GAAP,OAAO,CAAQ;QACf,cAAS,GAAT,SAAS,CAAY;QAErB,iBAAY,GAAZ,YAAY,CAErB;QAjBH,aAAQ,GAIJ,EAAE,CAAC;QAiBL,yCAAyC;QACzC,IAAI,CAAC,UAAU,GAAG,CAAC,GAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAChE,IAAI,CAAC,mBAAmB,GAAG;QACzB,0BAA0B;SAC3B,CAAC;QAEF,eAAe;QACf,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3D,CAAC;IAED;;;;;;;;OAQG;IACO,UAAU,CAClB,KAA8B,EAC9B,GAAkB;QAElB,IAAI;YACF,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;YACnC,IAAI,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE;gBAC/B,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;aACrD;SACF;QAAC,OAAO,CAAC,EAAE;YACV,IAAA,0BAAkB,EAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;SACpC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,aAAa,CAAC,WAAmB;QACrC,qBAAqB;QACrB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,2BAA2B;IAC3B,aAAa,CACX,KAAU,EACV,KAA8B,EAC9B,GAAkB;QAElB,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA/ED,4CA+EC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { AsyncOrSync } from 'ts-essentials';
|
|
2
|
-
import { Token, Address, ExchangePrices, PoolPrices, AdapterExchangeParam, SimpleExchangeParam, PoolLiquidity, Logger } from '../../types';
|
|
3
|
-
import { SwapSide, Network } from '../../constants';
|
|
4
|
-
import { IDex } from '../../dex/idex';
|
|
5
|
-
import { IDexHelper } from '../../dex-helper/idex-helper';
|
|
6
|
-
import { TestDexData } from './types';
|
|
7
|
-
import { SimpleExchange } from '../simple-exchange';
|
|
8
|
-
import { TestDexEventPool } from './test-dex-pool';
|
|
9
|
-
export declare class TestDex extends SimpleExchange implements IDex<TestDexData> {
|
|
10
|
-
readonly network: Network;
|
|
11
|
-
readonly dexKey: string;
|
|
12
|
-
readonly dexHelper: IDexHelper;
|
|
13
|
-
protected adapters: import("../../types").AdapterMappings;
|
|
14
|
-
protected eventPools: TestDexEventPool;
|
|
15
|
-
readonly hasConstantPriceLargeAmounts = false;
|
|
16
|
-
readonly needWrapNative = true;
|
|
17
|
-
readonly isFeeOnTransferSupported = false;
|
|
18
|
-
static dexKeysWithNetwork: {
|
|
19
|
-
key: string;
|
|
20
|
-
networks: Network[];
|
|
21
|
-
}[];
|
|
22
|
-
logger: Logger;
|
|
23
|
-
constructor(network: Network, dexKey: string, dexHelper: IDexHelper, adapters?: import("../../types").AdapterMappings);
|
|
24
|
-
initializePricing(blockNumber: number): Promise<void>;
|
|
25
|
-
getAdapters(side: SwapSide): {
|
|
26
|
-
name: string;
|
|
27
|
-
index: number;
|
|
28
|
-
}[] | null;
|
|
29
|
-
getPoolIdentifiers(srcToken: Token, destToken: Token, side: SwapSide, blockNumber: number): Promise<string[]>;
|
|
30
|
-
getPricesVolume(srcToken: Token, destToken: Token, amounts: bigint[], side: SwapSide, blockNumber: number, limitPools?: string[]): Promise<null | ExchangePrices<TestDexData>>;
|
|
31
|
-
getCalldataGasCost(poolPrices: PoolPrices<TestDexData>): number | number[];
|
|
32
|
-
getAdapterParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: TestDexData, side: SwapSide): AdapterExchangeParam;
|
|
33
|
-
getSimpleParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: TestDexData, side: SwapSide): Promise<SimpleExchangeParam>;
|
|
34
|
-
updatePoolState(): Promise<void>;
|
|
35
|
-
getTopPoolsForToken(tokenAddress: Address, limit: number): Promise<PoolLiquidity[]>;
|
|
36
|
-
releaseResources(): AsyncOrSync<void>;
|
|
37
|
-
}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.TestDex = void 0;
|
|
27
|
-
const CALLDATA_GAS_COST = __importStar(require("../../calldata-gas-cost"));
|
|
28
|
-
const utils_1 = require("../../utils");
|
|
29
|
-
const simple_exchange_1 = require("../simple-exchange");
|
|
30
|
-
const config_1 = require("./config");
|
|
31
|
-
const test_dex_pool_1 = require("./test-dex-pool");
|
|
32
|
-
class TestDex extends simple_exchange_1.SimpleExchange {
|
|
33
|
-
constructor(network, dexKey, dexHelper, adapters = config_1.Adapters[network] || {}) {
|
|
34
|
-
super(dexHelper, dexKey);
|
|
35
|
-
this.network = network;
|
|
36
|
-
this.dexKey = dexKey;
|
|
37
|
-
this.dexHelper = dexHelper;
|
|
38
|
-
this.adapters = adapters;
|
|
39
|
-
this.hasConstantPriceLargeAmounts = false;
|
|
40
|
-
// TODO: set true here if protocols works only with wrapped asset
|
|
41
|
-
this.needWrapNative = true;
|
|
42
|
-
this.isFeeOnTransferSupported = false;
|
|
43
|
-
this.logger = dexHelper.getLogger(dexKey);
|
|
44
|
-
this.eventPools = new test_dex_pool_1.TestDexEventPool(dexKey, network, dexHelper, this.logger);
|
|
45
|
-
}
|
|
46
|
-
// Initialize pricing is called once in the start of
|
|
47
|
-
// pricing service. It is intended to setup the integration
|
|
48
|
-
// for pricing requests. It is optional for a DEX to
|
|
49
|
-
// implement this function
|
|
50
|
-
async initializePricing(blockNumber) {
|
|
51
|
-
// TODO: complete me!
|
|
52
|
-
}
|
|
53
|
-
// Returns the list of contract adapters (name and index)
|
|
54
|
-
// for a buy/sell. Return null if there are no adapters.
|
|
55
|
-
getAdapters(side) {
|
|
56
|
-
return this.adapters[side] ? this.adapters[side] : null;
|
|
57
|
-
}
|
|
58
|
-
// Returns list of pool identifiers that can be used
|
|
59
|
-
// for a given swap. poolIdentifiers must be unique
|
|
60
|
-
// across DEXes. It is recommended to use
|
|
61
|
-
// ${dexKey}_${poolAddress} as a poolIdentifier
|
|
62
|
-
async getPoolIdentifiers(srcToken, destToken, side, blockNumber) {
|
|
63
|
-
// TODO: complete me!
|
|
64
|
-
return [];
|
|
65
|
-
}
|
|
66
|
-
// Returns pool prices for amounts.
|
|
67
|
-
// If limitPools is defined only pools in limitPools
|
|
68
|
-
// should be used. If limitPools is undefined then
|
|
69
|
-
// any pools can be used.
|
|
70
|
-
async getPricesVolume(srcToken, destToken, amounts, side, blockNumber, limitPools) {
|
|
71
|
-
// TODO: complete me!
|
|
72
|
-
return null;
|
|
73
|
-
}
|
|
74
|
-
// Returns estimated gas cost of calldata for this DEX in multiSwap
|
|
75
|
-
getCalldataGasCost(poolPrices) {
|
|
76
|
-
// TODO: update if there is any payload in getAdapterParam
|
|
77
|
-
return CALLDATA_GAS_COST.DEX_NO_PAYLOAD;
|
|
78
|
-
}
|
|
79
|
-
// Encode params required by the exchange adapter
|
|
80
|
-
// Used for multiSwap, buy & megaSwap
|
|
81
|
-
// Hint: abiCoder.encodeParameter() could be useful
|
|
82
|
-
getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
|
|
83
|
-
// TODO: complete me!
|
|
84
|
-
const { exchange } = data;
|
|
85
|
-
// Encode here the payload for adapter
|
|
86
|
-
const payload = '';
|
|
87
|
-
return {
|
|
88
|
-
targetExchange: exchange,
|
|
89
|
-
payload,
|
|
90
|
-
networkFee: '0',
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
// Encode call data used by simpleSwap like routers
|
|
94
|
-
// Used for simpleSwap & simpleBuy
|
|
95
|
-
// Hint: this.buildSimpleParamWithoutWETHConversion
|
|
96
|
-
// could be useful
|
|
97
|
-
async getSimpleParam(srcToken, destToken, srcAmount, destAmount, data, side) {
|
|
98
|
-
// TODO: complete me!
|
|
99
|
-
const { exchange } = data;
|
|
100
|
-
// Encode here the transaction arguments
|
|
101
|
-
const swapData = '';
|
|
102
|
-
return this.buildSimpleParamWithoutWETHConversion(srcToken, srcAmount, destToken, destAmount, swapData, exchange);
|
|
103
|
-
}
|
|
104
|
-
// This is called once before getTopPoolsForToken is
|
|
105
|
-
// called for multiple tokens. This can be helpful to
|
|
106
|
-
// update common state required for calculating
|
|
107
|
-
// getTopPoolsForToken. It is optional for a DEX
|
|
108
|
-
// to implement this
|
|
109
|
-
async updatePoolState() {
|
|
110
|
-
// TODO: complete me!
|
|
111
|
-
}
|
|
112
|
-
// Returns list of top pools based on liquidity. Max
|
|
113
|
-
// limit number pools should be returned.
|
|
114
|
-
async getTopPoolsForToken(tokenAddress, limit) {
|
|
115
|
-
//TODO: complete me!
|
|
116
|
-
return [];
|
|
117
|
-
}
|
|
118
|
-
// This is optional function in case if your implementation has acquired any resources
|
|
119
|
-
// you need to release for graceful shutdown. For example, it may be any interval timer
|
|
120
|
-
releaseResources() {
|
|
121
|
-
// TODO: complete me!
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
exports.TestDex = TestDex;
|
|
125
|
-
TestDex.dexKeysWithNetwork = (0, utils_1.getDexKeysWithNetwork)(config_1.TestDexConfig);
|
|
126
|
-
//# sourceMappingURL=test-dex.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test-dex.js","sourceRoot":"","sources":["../../../src/dex/test-dex/test-dex.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,2EAA6D;AAC7D,uCAAoD;AAIpD,wDAAoD;AACpD,qCAAmD;AACnD,mDAAmD;AAEnD,MAAa,OACX,SAAQ,gCAAc;IAgBtB,YACW,OAAgB,EAChB,MAAc,EACd,SAAqB,EACpB,WAAW,iBAAQ,CAAC,OAAO,CAAC,IAAI,EAAE;QAE5C,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QALhB,YAAO,GAAP,OAAO,CAAS;QAChB,WAAM,GAAN,MAAM,CAAQ;QACd,cAAS,GAAT,SAAS,CAAY;QACpB,aAAQ,GAAR,QAAQ,CAA0B;QAfrC,iCAA4B,GAAG,KAAK,CAAC;QAC9C,iEAAiE;QACxD,mBAAc,GAAG,IAAI,CAAC;QAEtB,6BAAwB,GAAG,KAAK,CAAC;QAcxC,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,UAAU,GAAG,IAAI,gCAAgB,CACpC,MAAM,EACN,OAAO,EACP,SAAS,EACT,IAAI,CAAC,MAAM,CACZ,CAAC;IACJ,CAAC;IAED,oDAAoD;IACpD,2DAA2D;IAC3D,oDAAoD;IACpD,0BAA0B;IAC1B,KAAK,CAAC,iBAAiB,CAAC,WAAmB;QACzC,qBAAqB;IACvB,CAAC;IAED,yDAAyD;IACzD,wDAAwD;IACxD,WAAW,CAAC,IAAc;QACxB,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI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,QAAQ,EACR,SAAS,EACT,SAAS,EACT,UAAU,EACV,QAAQ,EACR,QAAQ,CACT,CAAC;IACJ,CAAC;IAED,oDAAoD;IACpD,qDAAqD;IACrD,+CAA+C;IAC/C,gDAAgD;IAChD,oBAAoB;IACpB,KAAK,CAAC,eAAe;QACnB,qBAAqB;IACvB,CAAC;IAED,oDAAoD;IACpD,yCAAyC;IACzC,KAAK,CAAC,mBAAmB,CACvB,YAAqB,EACrB,KAAa;QAEb,oBAAoB;QACpB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,sFAAsF;IACtF,uFAAuF;IACvF,gBAAgB;QACd,qBAAqB;IACvB,CAAC;;AAhKH,0BAiKC;AArJe,0BAAkB,GAC9B,IAAA,6BAAqB,EAAC,sBAAa,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/dex/test-dex/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { UniswapV3 } from '../../uniswap-v3';
|
|
2
|
-
import { Network } from '../../../../constants';
|
|
3
|
-
import { IDexHelper } from '../../../../dex-helper';
|
|
4
|
-
export declare class PancakeswapV3 extends UniswapV3 {
|
|
5
|
-
protected network: Network;
|
|
6
|
-
protected dexHelper: IDexHelper;
|
|
7
|
-
static dexKeysWithNetwork: {
|
|
8
|
-
key: string;
|
|
9
|
-
networks: Network[];
|
|
10
|
-
}[];
|
|
11
|
-
constructor(network: Network, dexKey: string, dexHelper: IDexHelper);
|
|
12
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.PancakeswapV3 = void 0;
|
|
7
|
-
const uniswap_v3_1 = require("../../uniswap-v3");
|
|
8
|
-
const abi_1 = require("@ethersproject/abi");
|
|
9
|
-
const PancakeswapV3Router_abi_json_1 = __importDefault(require("../../../../abi/uniswap-v3/pancakeswap-v3/PancakeswapV3Router.abi.json"));
|
|
10
|
-
const PancakeswapV3QuoterV2_abi_json_1 = __importDefault(require("../../../../abi/uniswap-v3/pancakeswap-v3/PancakeswapV3QuoterV2.abi.json"));
|
|
11
|
-
const utils_1 = require("../../../../utils");
|
|
12
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
13
|
-
const config_1 = require("../../config");
|
|
14
|
-
class PancakeswapV3 extends uniswap_v3_1.UniswapV3 {
|
|
15
|
-
constructor(network, dexKey, dexHelper) {
|
|
16
|
-
super(network, dexKey, dexHelper, undefined, new abi_1.Interface(PancakeswapV3Router_abi_json_1.default), new abi_1.Interface(PancakeswapV3QuoterV2_abi_json_1.default));
|
|
17
|
-
this.network = network;
|
|
18
|
-
this.dexHelper = dexHelper;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
exports.PancakeswapV3 = PancakeswapV3;
|
|
22
|
-
PancakeswapV3.dexKeysWithNetwork = (0, utils_1.getDexKeysWithNetwork)(lodash_1.default.pick(config_1.UniswapV3Config, ['PancakeswapV3']));
|
|
23
|
-
//# sourceMappingURL=pancakeswap-v3.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pancakeswap-v3.js","sourceRoot":"","sources":["../../../../../src/dex/uniswap-v3/forks/pancakeswap-v3/pancakeswap-v3.ts"],"names":[],"mappings":";;;;;;AAAA,iDAA6C;AAG7C,4CAA+C;AAC/C,0IAA4G;AAC5G,8IAAgH;AAChH,6CAA0D;AAC1D,oDAAuB;AACvB,yCAA+C;AAE/C,MAAa,aAAc,SAAQ,sBAAS;IAG1C,YACY,OAAgB,EAC1B,MAAc,EACJ,SAAqB;QAE/B,KAAK,CACH,OAAO,EACP,MAAM,EACN,SAAS,EACT,SAAS,EACT,IAAI,eAAS,CAAC,sCAAsB,CAAC,EACrC,IAAI,eAAS,CAAC,wCAAwB,CAAC,CACxC,CAAC;QAXQ,YAAO,GAAP,OAAO,CAAS;QAEhB,cAAS,GAAT,SAAS,CAAY;IAUjC,CAAC;;AAhBH,sCAiBC;AAhBe,gCAAkB,GAC9B,IAAA,6BAAqB,EAAC,gBAAC,CAAC,IAAI,CAAC,wBAAe,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Adapters = exports.WooFiConfig = void 0;
|
|
4
|
-
const constants_1 = require("../../constants");
|
|
5
|
-
exports.WooFiConfig = {
|
|
6
|
-
WooFi: {
|
|
7
|
-
[constants_1.Network.BSC]: {
|
|
8
|
-
wooPPAddress: '0xbf365Ce9cFcb2d5855521985E351bA3bcf77FD3F',
|
|
9
|
-
wooOracleAddress: '0x6b6fBEc7934b104e81b2046D24A990e03e17afDC',
|
|
10
|
-
wooFeeManagerAddress: '0xaA6c60D638d34261B764fEDB551E50Ab02c34C90',
|
|
11
|
-
wooGuardianAddress: '0x910723e3c6a68276687b50613a1a9e42cc6589b4',
|
|
12
|
-
quoteToken: {
|
|
13
|
-
// USDT
|
|
14
|
-
address: '0x55d398326f99059ff775485246999027b3197955',
|
|
15
|
-
decimals: 18,
|
|
16
|
-
},
|
|
17
|
-
baseTokens: {
|
|
18
|
-
WBNB: {
|
|
19
|
-
address: '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c',
|
|
20
|
-
decimals: 18,
|
|
21
|
-
},
|
|
22
|
-
BTCB: {
|
|
23
|
-
address: '0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c',
|
|
24
|
-
decimals: 18,
|
|
25
|
-
},
|
|
26
|
-
ETH: {
|
|
27
|
-
address: '0x2170ed0880ac9a755fd29b2688956bd959f933f8',
|
|
28
|
-
decimals: 18,
|
|
29
|
-
},
|
|
30
|
-
WOO: {
|
|
31
|
-
address: '0x4691937a7508860f876c9c0a2a617e7d9e945d4b',
|
|
32
|
-
decimals: 18,
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
rebateTo: '0xcbb65ad3e64f404b5411486e15561bfb645ce642',
|
|
36
|
-
},
|
|
37
|
-
[constants_1.Network.AVALANCHE]: {
|
|
38
|
-
wooPPAddress: '0x1df3009c57a8B143c6246149F00B090Bce3b8f88',
|
|
39
|
-
wooOracleAddress: '0x25a4d4a094A084c7ad45Ac273cF7D6B6bfae7D4E',
|
|
40
|
-
wooFeeManagerAddress: '0x209102c0D2E34282494114ea76D5251c8e7Ea7ab',
|
|
41
|
-
wooGuardianAddress: '0x58c73f7e102bc6bcdc6b092ef0399b3e06d6b3e3',
|
|
42
|
-
quoteToken: {
|
|
43
|
-
// USDC
|
|
44
|
-
address: '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e',
|
|
45
|
-
decimals: 6,
|
|
46
|
-
},
|
|
47
|
-
baseTokens: {
|
|
48
|
-
WAVAX: {
|
|
49
|
-
address: '0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7',
|
|
50
|
-
decimals: 18,
|
|
51
|
-
},
|
|
52
|
-
['BTC.b']: {
|
|
53
|
-
address: '0x152b9d0FdC40C096757F570A51E494bd4b943E50',
|
|
54
|
-
decimals: 8,
|
|
55
|
-
},
|
|
56
|
-
['WETH.e']: {
|
|
57
|
-
address: '0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB',
|
|
58
|
-
decimals: 18,
|
|
59
|
-
},
|
|
60
|
-
['WOO.e']: {
|
|
61
|
-
address: '0xaBC9547B534519fF73921b1FBA6E672b5f58D083',
|
|
62
|
-
decimals: 18,
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
rebateTo: '0x1bf4c97384e7bdc609017305edb23fd28c13e76a',
|
|
66
|
-
},
|
|
67
|
-
[constants_1.Network.FANTOM]: {
|
|
68
|
-
wooPPAddress: '0x9503E7517D3C5bc4f9E4A1c6AE4f8B33AC2546f2',
|
|
69
|
-
wooOracleAddress: '0x209102c0D2E34282494114ea76D5251c8e7Ea7ab',
|
|
70
|
-
wooFeeManagerAddress: '0xBE1a0FccCFA9c9065152B7770B918f7C59914E8D',
|
|
71
|
-
wooGuardianAddress: '0x128758d0e909624841AB29D53919646BFBDa5dB2',
|
|
72
|
-
quoteToken: {
|
|
73
|
-
// USDC
|
|
74
|
-
address: '0x04068da6c83afcfa0e13ba15a6696662335d5b75',
|
|
75
|
-
decimals: 6,
|
|
76
|
-
},
|
|
77
|
-
baseTokens: {
|
|
78
|
-
WFTM: {
|
|
79
|
-
address: '0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83',
|
|
80
|
-
decimals: 18,
|
|
81
|
-
},
|
|
82
|
-
BTC: {
|
|
83
|
-
address: '0x321162Cd933E2Be498Cd2267a90534A804051b11',
|
|
84
|
-
decimals: 8,
|
|
85
|
-
},
|
|
86
|
-
ETH: {
|
|
87
|
-
address: '0x74b23882a30290451A17c44f4F05243b6b58C76d',
|
|
88
|
-
decimals: 18,
|
|
89
|
-
},
|
|
90
|
-
WOO: {
|
|
91
|
-
address: '0x6626c47c00F1D87902fc13EECfaC3ed06D5E8D8a',
|
|
92
|
-
decimals: 18,
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
rebateTo: '0xced122f9b99d224675eeda13f0c14639c5633f91',
|
|
96
|
-
},
|
|
97
|
-
[constants_1.Network.POLYGON]: {
|
|
98
|
-
wooPPAddress: '0x7400B665C8f4f3a951a99f1ee9872efb8778723d',
|
|
99
|
-
wooOracleAddress: '0x2Fe5E5D341cFFa606a5d9DA1B6B646a381B0f7ec',
|
|
100
|
-
wooFeeManagerAddress: '0x7214833BE05Ce39f6dCd97668e521162e6C18937',
|
|
101
|
-
wooGuardianAddress: '0xF5d215d9C84778F85746D15762DaF39B9E83a2d6',
|
|
102
|
-
quoteToken: {
|
|
103
|
-
// USDC
|
|
104
|
-
address: '0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174',
|
|
105
|
-
decimals: 6,
|
|
106
|
-
},
|
|
107
|
-
baseTokens: {
|
|
108
|
-
WMATIC: {
|
|
109
|
-
address: '0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270',
|
|
110
|
-
decimals: 18,
|
|
111
|
-
},
|
|
112
|
-
WBTC: {
|
|
113
|
-
address: '0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6',
|
|
114
|
-
decimals: 8,
|
|
115
|
-
},
|
|
116
|
-
WETH: {
|
|
117
|
-
address: '0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619',
|
|
118
|
-
decimals: 18,
|
|
119
|
-
},
|
|
120
|
-
WOO: {
|
|
121
|
-
address: '0x1B815d120B3eF02039Ee11dC2d33DE7aA4a8C603',
|
|
122
|
-
decimals: 18,
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
rebateTo: '0x0c84cd406b8a4e07df9a1b15ef348023a1dcd075',
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
};
|
|
129
|
-
exports.Adapters = {
|
|
130
|
-
[constants_1.Network.BSC]: { [constants_1.SwapSide.SELL]: [{ name: 'BscAdapter01', index: 13 }] },
|
|
131
|
-
[constants_1.Network.AVALANCHE]: {
|
|
132
|
-
[constants_1.SwapSide.SELL]: [{ name: 'AvalancheAdapter01', index: 12 }],
|
|
133
|
-
},
|
|
134
|
-
[constants_1.Network.FANTOM]: {
|
|
135
|
-
[constants_1.SwapSide.SELL]: [{ name: 'FantomAdapter01', index: 8 }],
|
|
136
|
-
},
|
|
137
|
-
[constants_1.Network.POLYGON]: {
|
|
138
|
-
[constants_1.SwapSide.SELL]: [{ name: 'PolygonAdapter02', index: 4 }],
|
|
139
|
-
},
|
|
140
|
-
};
|
|
141
|
-
//# sourceMappingURL=config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":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;gBACD,GAAG,EAAE;oBACH,OAAO,EAAE,4CAA4C;oBACrD,QAAQ,EAAE,EAAE;iBACb;aACF;YACD,QAAQ,EAAE,4CAA4C;SACvD;KACF;CACF,CAAC;AAEW,QAAA,QAAQ,GAAoC;IACvD,CAAC,mBAAO,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,oBAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,EAAE;IACzE,CAAC,mBAAO,CAAC,SAAS,CAAC,EAAE;QACnB,CAAC,oBAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,oBAAoB,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;KAC7D;IACD,CAAC,mBAAO,CAAC,MAAM,CAAC,EAAE;QAChB,CAAC,oBAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;KACzD;IACD,CAAC,mBAAO,CAAC,OAAO,CAAC,EAAE;QACjB,CAAC,oBAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;KAC1D;CACF,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NULL_STATE = exports.MIN_CONVERSION_RATE = exports.USD_PRECISION = exports.WOO_FI_GAS_COST = void 0;
|
|
4
|
-
exports.WOO_FI_GAS_COST = 270 * 1000;
|
|
5
|
-
exports.USD_PRECISION = 2;
|
|
6
|
-
exports.MIN_CONVERSION_RATE = 1;
|
|
7
|
-
exports.NULL_STATE = {
|
|
8
|
-
feeRates: {},
|
|
9
|
-
tokenInfos: {},
|
|
10
|
-
tokenStates: {},
|
|
11
|
-
oracleTimestamp: 0n,
|
|
12
|
-
isPaused: false,
|
|
13
|
-
guardian: {
|
|
14
|
-
globalBound: 0n,
|
|
15
|
-
refInfos: {},
|
|
16
|
-
},
|
|
17
|
-
chainlink: { latestRoundDatas: {} },
|
|
18
|
-
wooPPBalances: {},
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/dex/woo-fi/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,eAAe,GAAG,GAAG,GAAG,IAAI,CAAC;AAE7B,QAAA,aAAa,GAAG,CAAC,CAAC;AAElB,QAAA,mBAAmB,GAAG,CAAC,CAAC;AAExB,QAAA,UAAU,GAAc;IACnC,QAAQ,EAAE,EAAE;IACZ,UAAU,EAAE,EAAE;IACd,WAAW,EAAE,EAAE;IACf,eAAe,EAAE,EAAE;IACnB,QAAQ,EAAE,KAAK;IACf,QAAQ,EAAE;QACR,WAAW,EAAE,EAAE;QACf,QAAQ,EAAE,EAAE;KACb;IACD,SAAS,EAAE,EAAE,gBAAgB,EAAE,EAAE,EAAE;IACnC,aAAa,EAAE,EAAE;CAClB,CAAC"}
|