@paraswap/dex-lib 4.7.5-unified-blacklist.2 → 4.7.5
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/dex/balancer-v2/balancer-v2.d.ts +1 -1
- package/build/dex/balancer-v2/balancer-v2.js +39 -37
- package/build/dex/balancer-v2/balancer-v2.js.map +1 -1
- package/build/dex/balancer-v2/constants.d.ts +1 -0
- package/build/dex/balancer-v2/constants.js +2 -1
- package/build/dex/balancer-v2/constants.js.map +1 -1
- package/build/dex/bebop/bebop.d.ts +5 -3
- package/build/dex/bebop/bebop.js +58 -17
- package/build/dex/bebop/bebop.js.map +1 -1
- package/build/dex/bebop/constants.d.ts +5 -0
- package/build/dex/bebop/constants.js +7 -1
- package/build/dex/bebop/constants.js.map +1 -1
- package/build/dex/cables/cables.d.ts +6 -3
- package/build/dex/cables/cables.js +51 -7
- package/build/dex/cables/cables.js.map +1 -1
- package/build/dex/cables/constants.d.ts +5 -0
- package/build/dex/cables/constants.js +6 -1
- package/build/dex/cables/constants.js.map +1 -1
- package/build/dex/cables/rate-fetcher.d.ts +3 -1
- package/build/dex/cables/rate-fetcher.js +8 -6
- package/build/dex/cables/rate-fetcher.js.map +1 -1
- package/build/dex/cables/types.d.ts +6 -1
- package/build/dex/curve-v1/config.js +21 -21
- package/build/dex/curve-v1/config.js.map +1 -1
- package/build/dex/curve-v1/curve-v1.d.ts +3 -1
- package/build/dex/curve-v1/curve-v1.js +26 -1
- package/build/dex/curve-v1/curve-v1.js.map +1 -1
- package/build/dex/curve-v1/types.d.ts +6 -0
- package/build/dex/dexalot/constants.d.ts +3 -0
- package/build/dex/dexalot/constants.js +4 -1
- package/build/dex/dexalot/constants.js.map +1 -1
- package/build/dex/dexalot/dexalot.d.ts +8 -2
- package/build/dex/dexalot/dexalot.js +43 -5
- package/build/dex/dexalot/dexalot.js.map +1 -1
- package/build/dex/dexalot/rate-fetcher.d.ts +3 -1
- package/build/dex/dexalot/rate-fetcher.js +8 -6
- package/build/dex/dexalot/rate-fetcher.js.map +1 -1
- package/build/dex/dexalot/types.d.ts +2 -1
- package/build/dex/generic-rfq/generic-rfq.d.ts +2 -0
- package/build/dex/generic-rfq/generic-rfq.js +8 -1
- package/build/dex/generic-rfq/generic-rfq.js.map +1 -1
- package/build/dex/generic-rfq/rate-fetcher.d.ts +10 -8
- package/build/dex/generic-rfq/rate-fetcher.js +11 -6
- package/build/dex/generic-rfq/rate-fetcher.js.map +1 -1
- package/build/dex/hashflow/hashflow.d.ts +5 -2
- package/build/dex/hashflow/hashflow.js +15 -4
- package/build/dex/hashflow/hashflow.js.map +1 -1
- package/build/dex/idex.d.ts +2 -12
- package/build/dex/idle-dao/idle-dao.d.ts +1 -0
- package/build/dex/idle-dao/idle-dao.js +23 -11
- package/build/dex/idle-dao/idle-dao.js.map +1 -1
- package/build/dex/limit-order-exchange.d.ts +2 -2
- package/build/dex/limit-order-exchange.js +2 -2
- package/build/dex/limit-order-exchange.js.map +1 -1
- package/build/dex/maker-psm/maker-psm-event-pool.d.ts +43 -0
- package/build/dex/maker-psm/maker-psm-event-pool.js +132 -0
- package/build/dex/maker-psm/maker-psm-event-pool.js.map +1 -0
- package/build/dex/maker-psm/maker-psm.d.ts +4 -41
- package/build/dex/maker-psm/maker-psm.js +40 -143
- package/build/dex/maker-psm/maker-psm.js.map +1 -1
- package/build/dex/paraswap-limit-orders/paraswap-limit-orders.d.ts +1 -0
- package/build/dex/paraswap-limit-orders/paraswap-limit-orders.js +8 -0
- package/build/dex/paraswap-limit-orders/paraswap-limit-orders.js.map +1 -1
- package/build/dex/simple-exchange-with-restrictions.d.ts +6 -0
- package/build/dex/simple-exchange-with-restrictions.js +14 -6
- package/build/dex/simple-exchange-with-restrictions.js.map +1 -1
- package/build/dex/swaap-v2/swaap-v2.d.ts +5 -2
- package/build/dex/swaap-v2/swaap-v2.js +16 -4
- package/build/dex/swaap-v2/swaap-v2.js.map +1 -1
- package/build/dex/uniswap-v4/contract-math/Position.d.ts +6 -0
- package/build/dex/uniswap-v4/contract-math/Position.js +29 -0
- package/build/dex/uniswap-v4/contract-math/Position.js.map +1 -1
- package/build/dex/uniswap-v4/liquidity.d.ts +9 -0
- package/build/dex/uniswap-v4/liquidity.js +74 -0
- package/build/dex/uniswap-v4/liquidity.js.map +1 -0
- package/build/dex/uniswap-v4/subgraph.js +6 -0
- package/build/dex/uniswap-v4/subgraph.js.map +1 -1
- package/build/dex/uniswap-v4/types.d.ts +3 -0
- package/build/dex/uniswap-v4/uniswap-v4-pool-manager.d.ts +5 -1
- package/build/dex/uniswap-v4/uniswap-v4-pool-manager.js +86 -0
- package/build/dex/uniswap-v4/uniswap-v4-pool-manager.js.map +1 -1
- package/build/dex/uniswap-v4/uniswap-v4.d.ts +1 -1
- package/build/dex/uniswap-v4/uniswap-v4.js +50 -36
- package/build/dex/uniswap-v4/uniswap-v4.js.map +1 -1
- package/build/dex-helper/dummy-dex-helper.js +1 -14
- package/build/dex-helper/dummy-dex-helper.js.map +1 -1
- package/build/dex-helper/icache.d.ts +0 -2
- package/build/pricing-helper.d.ts +0 -1
- package/build/pricing-helper.js +0 -34
- package/build/pricing-helper.js.map +1 -1
- package/package.json +1 -1
- package/build/abi/BProtocol.json +0 -1155
- package/build/abi/Jarvis.json +0 -1172
- package/build/abi/MStableAsset.json +0 -1545
- package/build/abi/OneInchLp.json +0 -1304
- package/build/abi/Onebit.json +0 -736
- package/build/abi/Shell.json +0 -1294
- package/build/abi/TraderJoeV2Router.json +0 -50
- package/build/abi/wUSDM.json +0 -757
- package/build/abi/zrx.v2.json +0 -1967
- package/build/abi/zrx.v3.json +0 -3454
- package/build/abi/zrx.v4.json +0 -2193
- package/build/dex/OneInchLp.d.ts +0 -24
- package/build/dex/OneInchLp.js +0 -43
- package/build/dex/OneInchLp.js.map +0 -1
- package/build/dex/bProtocol/bProtocol.d.ts +0 -15
- package/build/dex/bProtocol/bProtocol.js +0 -56
- package/build/dex/bProtocol/bProtocol.js.map +0 -1
- package/build/dex/bProtocol/types.d.ts +0 -11
- package/build/dex/bProtocol/types.js +0 -8
- package/build/dex/bProtocol/types.js.map +0 -1
- package/build/dex/jarvis.d.ts +0 -56
- package/build/dex/jarvis.js +0 -163
- package/build/dex/jarvis.js.map +0 -1
- package/build/dex/mStable.d.ts +0 -44
- package/build/dex/mStable.js +0 -75
- package/build/dex/mStable.js.map +0 -1
- package/build/dex/onebit/onebit.d.ts +0 -16
- package/build/dex/onebit/onebit.js +0 -61
- package/build/dex/onebit/onebit.js.map +0 -1
- package/build/dex/onebit/types.d.ts +0 -14
- package/build/dex/onebit/types.js +0 -8
- package/build/dex/onebit/types.js.map +0 -1
- package/build/dex/shell.d.ts +0 -25
- package/build/dex/shell.js +0 -41
- package/build/dex/shell.js.map +0 -1
- package/build/dex/trader-joe-v2.d.ts +0 -40
- package/build/dex/trader-joe-v2.js +0 -74
- package/build/dex/trader-joe-v2.js.map +0 -1
- package/build/dex/uniswap-v3/uniswap-v3-new.d.ts +0 -94
- package/build/dex/uniswap-v3/uniswap-v3-new.js +0 -923
- package/build/dex/uniswap-v3/uniswap-v3-new.js.map +0 -1
- package/build/dex/usual-bond/config.d.ts +0 -3
- package/build/dex/usual-bond/config.js +0 -13
- package/build/dex/usual-bond/config.js.map +0 -1
- package/build/dex/usual-bond/types.d.ts +0 -7
- package/build/dex/usual-bond/types.js +0 -3
- package/build/dex/usual-bond/types.js.map +0 -1
- package/build/dex/usual-bond/usual-bond.d.ts +0 -35
- package/build/dex/usual-bond/usual-bond.js +0 -176
- package/build/dex/usual-bond/usual-bond.js.map +0 -1
- package/build/dex/wusdm/config.d.ts +0 -3
- package/build/dex/wusdm/config.js +0 -43
- package/build/dex/wusdm/config.js.map +0 -1
- package/build/dex/wusdm/constants.d.ts +0 -2
- package/build/dex/wusdm/constants.js +0 -6
- package/build/dex/wusdm/constants.js.map +0 -1
- package/build/dex/wusdm/types.d.ts +0 -18
- package/build/dex/wusdm/types.js +0 -11
- package/build/dex/wusdm/types.js.map +0 -1
- package/build/dex/wusdm/wusdm-pool.d.ts +0 -21
- package/build/dex/wusdm/wusdm-pool.js +0 -74
- package/build/dex/wusdm/wusdm-pool.js.map +0 -1
- package/build/dex/wusdm/wusdm.d.ts +0 -46
- package/build/dex/wusdm/wusdm.js +0 -243
- package/build/dex/wusdm/wusdm.js.map +0 -1
- package/build/dex/zerox/config.d.ts +0 -2
- package/build/dex/zerox/config.js +0 -33
- package/build/dex/zerox/config.js.map +0 -1
- package/build/dex/zerox/index.d.ts +0 -22
- package/build/dex/zerox/index.js +0 -225
- package/build/dex/zerox/index.js.map +0 -1
- package/build/dex/zerox/order.d.ts +0 -88
- package/build/dex/zerox/order.js +0 -53
- package/build/dex/zerox/order.js.map +0 -1
- package/build/dex/zerox/types.d.ts +0 -73
- package/build/dex/zerox/types.js +0 -21
- package/build/dex/zerox/types.js.map +0 -1
package/build/dex/shell.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Interface } from '@ethersproject/abi';
|
|
2
|
-
import { SwapSide } from '../constants';
|
|
3
|
-
import { AdapterExchangeParam, Address, SimpleExchangeParam } from '../types';
|
|
4
|
-
import { IDexTxBuilder } from './idex';
|
|
5
|
-
import { SimpleExchange } from './simple-exchange';
|
|
6
|
-
import { IDexHelper } from '../dex-helper';
|
|
7
|
-
export declare type ShellData = {
|
|
8
|
-
exchange: Address;
|
|
9
|
-
deadline?: number;
|
|
10
|
-
};
|
|
11
|
-
declare type ShellParam = [
|
|
12
|
-
_origin: string,
|
|
13
|
-
_target: string,
|
|
14
|
-
_originAmount: string,
|
|
15
|
-
_minTargetAmount: string,
|
|
16
|
-
_deadline: string
|
|
17
|
-
];
|
|
18
|
-
export declare class Shell extends SimpleExchange implements IDexTxBuilder<ShellData, ShellParam> {
|
|
19
|
-
static dexKeys: string[];
|
|
20
|
-
exchangeRouterInterface: Interface;
|
|
21
|
-
constructor(dexHelper: IDexHelper);
|
|
22
|
-
getAdapterParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: ShellData, side: SwapSide): AdapterExchangeParam;
|
|
23
|
-
getSimpleParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: ShellData, side: SwapSide): Promise<SimpleExchangeParam>;
|
|
24
|
-
}
|
|
25
|
-
export {};
|
package/build/dex/shell.js
DELETED
|
@@ -1,41 +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.Shell = void 0;
|
|
7
|
-
const abi_1 = require("@ethersproject/abi");
|
|
8
|
-
const simple_exchange_1 = require("./simple-exchange");
|
|
9
|
-
const Shell_json_1 = __importDefault(require("../abi/Shell.json"));
|
|
10
|
-
var ShellFunctions;
|
|
11
|
-
(function (ShellFunctions) {
|
|
12
|
-
ShellFunctions["originSwap"] = "originSwap";
|
|
13
|
-
})(ShellFunctions || (ShellFunctions = {}));
|
|
14
|
-
class Shell extends simple_exchange_1.SimpleExchange {
|
|
15
|
-
constructor(dexHelper) {
|
|
16
|
-
super(dexHelper, 'shell');
|
|
17
|
-
this.exchangeRouterInterface = new abi_1.Interface(Shell_json_1.default);
|
|
18
|
-
}
|
|
19
|
-
getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
|
|
20
|
-
return {
|
|
21
|
-
targetExchange: data.exchange,
|
|
22
|
-
payload: '0x',
|
|
23
|
-
networkFee: '0',
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
async getSimpleParam(srcToken, destToken, srcAmount, destAmount, data, side) {
|
|
27
|
-
const swapFunction = ShellFunctions.originSwap;
|
|
28
|
-
const swapFunctionParams = [
|
|
29
|
-
srcToken,
|
|
30
|
-
destToken,
|
|
31
|
-
srcAmount,
|
|
32
|
-
destAmount,
|
|
33
|
-
(0, simple_exchange_1.getLocalDeadlineAsFriendlyPlaceholder)(),
|
|
34
|
-
];
|
|
35
|
-
const swapData = this.exchangeRouterInterface.encodeFunctionData(swapFunction, swapFunctionParams);
|
|
36
|
-
return this.buildSimpleParamWithoutWETHConversion(srcToken, srcAmount, destToken, destAmount, swapData, data.exchange);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
exports.Shell = Shell;
|
|
40
|
-
Shell.dexKeys = ['shell'];
|
|
41
|
-
//# sourceMappingURL=shell.js.map
|
package/build/dex/shell.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shell.js","sourceRoot":"","sources":["../../src/dex/shell.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA6D;AAI7D,uDAG2B;AAC3B,mEAAyC;AAczC,IAAK,cAEJ;AAFD,WAAK,cAAc;IACjB,2CAAyB,CAAA;AAC3B,CAAC,EAFI,cAAc,KAAd,cAAc,QAElB;AAED,MAAa,KACX,SAAQ,gCAAc;IAMtB,YAAY,SAAqB;QAC/B,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAC1B,IAAI,CAAC,uBAAuB,GAAG,IAAI,eAAS,CAAC,oBAA0B,CAAC,CAAC;IAC3E,CAAC;IAED,eAAe,CACb,QAAgB,EAChB,SAAiB,EACjB,SAAiB,EACjB,UAAkB,EAClB,IAAe,EACf,IAAc;QAEd,OAAO;YACL,cAAc,EAAE,IAAI,CAAC,QAAQ;YAC7B,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,GAAG;SAChB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,QAAgB,EAChB,SAAiB,EACjB,SAAiB,EACjB,UAAkB,EAClB,IAAe,EACf,IAAc;QAEd,MAAM,YAAY,GAAG,cAAc,CAAC,UAAU,CAAC;QAC/C,MAAM,kBAAkB,GAAe;YACrC,QAAQ;YACR,SAAS;YACT,SAAS;YACT,UAAU;YACV,IAAA,uDAAqC,GAAE;SACxC,CAAC;QACF,MAAM,QAAQ,GAAG,IAAI,CAAC,uBAAuB,CAAC,kBAAkB,CAC9D,YAAY,EACZ,kBAAkB,CACnB,CAAC;QAEF,OAAO,IAAI,CAAC,qCAAqC,CAC/C,QAAQ,EACR,SAAS,EACT,SAAS,EACT,UAAU,EACV,QAAQ,EACR,IAAI,CAAC,QAAQ,CACd,CAAC;IACJ,CAAC;;AAxDH,sBAyDC;AArDQ,aAAO,GAAG,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { SwapSide } from '../constants';
|
|
2
|
-
import { AdapterExchangeParam, Address, SimpleExchangeParam } from '../types';
|
|
3
|
-
import { IDexTxBuilder } from './idex';
|
|
4
|
-
import { IDexHelper } from '../dex-helper';
|
|
5
|
-
import { SimpleExchange } from './simple-exchange';
|
|
6
|
-
import { NumberAsString } from '@paraswap/core';
|
|
7
|
-
import { AsyncOrSync } from 'ts-essentials';
|
|
8
|
-
import { Interface } from '@ethersproject/abi';
|
|
9
|
-
declare type TraderJoeV2RouterSellParams = [
|
|
10
|
-
_amountIn: NumberAsString,
|
|
11
|
-
_amountOutMin: NumberAsString,
|
|
12
|
-
_pairBinSteps: NumberAsString[],
|
|
13
|
-
_tokenPath: Address[],
|
|
14
|
-
to: Address,
|
|
15
|
-
_deadline: number
|
|
16
|
-
];
|
|
17
|
-
declare type TraderJoeV2RouterBuyParams = [
|
|
18
|
-
_amountOut: NumberAsString,
|
|
19
|
-
_amountInMax: NumberAsString,
|
|
20
|
-
_pairBinSteps: NumberAsString[],
|
|
21
|
-
_tokenPath: Address[],
|
|
22
|
-
to: Address,
|
|
23
|
-
_deadline: string
|
|
24
|
-
];
|
|
25
|
-
declare type TraderJoeV2RouterParam = TraderJoeV2RouterSellParams | TraderJoeV2RouterBuyParams;
|
|
26
|
-
export declare type TraderJoeV2Data = {
|
|
27
|
-
tokenIn: string;
|
|
28
|
-
tokenOut: string;
|
|
29
|
-
binStep: string;
|
|
30
|
-
};
|
|
31
|
-
export declare class TraderJoeV2 extends SimpleExchange implements IDexTxBuilder<TraderJoeV2Data, TraderJoeV2RouterParam> {
|
|
32
|
-
static dexKeys: string[];
|
|
33
|
-
protected routerAddress: string;
|
|
34
|
-
exchangeRouterInterface: Interface;
|
|
35
|
-
needWrapNative: boolean;
|
|
36
|
-
constructor(dexHelper: IDexHelper);
|
|
37
|
-
getAdapterParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, data: TraderJoeV2Data, side: SwapSide): AdapterExchangeParam;
|
|
38
|
-
getSimpleParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, data: TraderJoeV2Data, side: SwapSide): AsyncOrSync<SimpleExchangeParam>;
|
|
39
|
-
}
|
|
40
|
-
export {};
|
|
@@ -1,74 +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.TraderJoeV2 = void 0;
|
|
7
|
-
const constants_1 = require("../constants");
|
|
8
|
-
const simple_exchange_1 = require("./simple-exchange");
|
|
9
|
-
const abi_1 = require("@ethersproject/abi");
|
|
10
|
-
const TraderJoeV2Router_json_1 = __importDefault(require("../abi/TraderJoeV2Router.json"));
|
|
11
|
-
const TRADERJOE_V2_ROUTER_ADDRESS = {
|
|
12
|
-
[constants_1.Network.AVALANCHE]: '0xE3Ffc583dC176575eEA7FD9dF2A7c65F7E23f4C3',
|
|
13
|
-
[constants_1.Network.ARBITRUM]: '0x7BFd7192E76D950832c77BB412aaE841049D8D9B',
|
|
14
|
-
[constants_1.Network.BSC]: '0xb66A2704a0dabC1660941628BE987B4418f7a9E8',
|
|
15
|
-
};
|
|
16
|
-
var TraderJoeV2RouterFunctions;
|
|
17
|
-
(function (TraderJoeV2RouterFunctions) {
|
|
18
|
-
TraderJoeV2RouterFunctions["swapExactTokensForTokens"] = "swapExactTokensForTokens";
|
|
19
|
-
TraderJoeV2RouterFunctions["swapTokensForExactTokens"] = "swapTokensForExactTokens";
|
|
20
|
-
})(TraderJoeV2RouterFunctions || (TraderJoeV2RouterFunctions = {}));
|
|
21
|
-
class TraderJoeV2 extends simple_exchange_1.SimpleExchange {
|
|
22
|
-
constructor(dexHelper) {
|
|
23
|
-
super(dexHelper, 'traderjoev2');
|
|
24
|
-
this.needWrapNative = true;
|
|
25
|
-
this.routerAddress =
|
|
26
|
-
TRADERJOE_V2_ROUTER_ADDRESS[dexHelper.config.data.network];
|
|
27
|
-
this.exchangeRouterInterface = new abi_1.Interface(TraderJoeV2Router_json_1.default);
|
|
28
|
-
}
|
|
29
|
-
getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
|
|
30
|
-
const payload = this.abiCoder.encodeParameter({
|
|
31
|
-
ParentStruct: {
|
|
32
|
-
_pairBinSteps: 'uint256[]',
|
|
33
|
-
_tokenPath: 'address[]',
|
|
34
|
-
_deadline: 'uint256',
|
|
35
|
-
},
|
|
36
|
-
}, {
|
|
37
|
-
_pairBinSteps: [data.binStep],
|
|
38
|
-
_tokenPath: [data.tokenIn, data.tokenOut],
|
|
39
|
-
_deadline: (0, simple_exchange_1.getLocalDeadlineAsFriendlyPlaceholder)(), // FIXME: more gas efficient to pass block.timestamp in adapter
|
|
40
|
-
});
|
|
41
|
-
return {
|
|
42
|
-
targetExchange: this.routerAddress,
|
|
43
|
-
payload,
|
|
44
|
-
networkFee: '0',
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
getSimpleParam(srcToken, destToken, srcAmount, destAmount, data, side) {
|
|
48
|
-
const swapFunction = side === constants_1.SwapSide.SELL
|
|
49
|
-
? TraderJoeV2RouterFunctions.swapExactTokensForTokens
|
|
50
|
-
: TraderJoeV2RouterFunctions.swapTokensForExactTokens;
|
|
51
|
-
const swapFunctionParams = side === constants_1.SwapSide.SELL
|
|
52
|
-
? [
|
|
53
|
-
srcAmount,
|
|
54
|
-
destAmount,
|
|
55
|
-
[data.binStep],
|
|
56
|
-
[srcToken, destToken],
|
|
57
|
-
this.augustusAddress,
|
|
58
|
-
(0, simple_exchange_1.getLocalDeadlineAsFriendlyPlaceholder)(),
|
|
59
|
-
]
|
|
60
|
-
: [
|
|
61
|
-
destAmount,
|
|
62
|
-
srcAmount,
|
|
63
|
-
[data.binStep],
|
|
64
|
-
[srcToken, destToken],
|
|
65
|
-
this.augustusAddress,
|
|
66
|
-
(0, simple_exchange_1.getLocalDeadlineAsFriendlyPlaceholder)(),
|
|
67
|
-
];
|
|
68
|
-
const swapData = this.exchangeRouterInterface.encodeFunctionData(swapFunction, swapFunctionParams);
|
|
69
|
-
return this.buildSimpleParamWithoutWETHConversion(srcToken, srcAmount, destToken, destAmount, swapData, this.routerAddress);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
exports.TraderJoeV2 = TraderJoeV2;
|
|
73
|
-
TraderJoeV2.dexKeys = ['traderjoev2'];
|
|
74
|
-
//# sourceMappingURL=trader-joe-v2.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trader-joe-v2.js","sourceRoot":"","sources":["../../src/dex/trader-joe-v2.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAiD;AAIjD,uDAG2B;AAG3B,4CAA6D;AAC7D,2FAAiE;AAEjE,MAAM,2BAA2B,GAAmC;IAClE,CAAC,mBAAO,CAAC,SAAS,CAAC,EAAE,4CAA4C;IACjE,CAAC,mBAAO,CAAC,QAAQ,CAAC,EAAE,4CAA4C;IAChE,CAAC,mBAAO,CAAC,GAAG,CAAC,EAAE,4CAA4C;CAC5D,CAAC;AA8BF,IAAK,0BAGJ;AAHD,WAAK,0BAA0B;IAC7B,mFAAqD,CAAA;IACrD,mFAAqD,CAAA;AACvD,CAAC,EAHI,0BAA0B,KAA1B,0BAA0B,QAG9B;AAED,MAAa,WACX,SAAQ,gCAAc;IAQtB,YAAY,SAAqB;QAC/B,KAAK,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;QAHlC,mBAAc,GAAG,IAAI,CAAC;QAKpB,IAAI,CAAC,aAAa;YAChB,2BAA2B,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAE7D,IAAI,CAAC,uBAAuB,GAAG,IAAI,eAAS,CAC1C,gCAAsC,CACvC,CAAC;IACJ,CAAC;IAED,eAAe,CACb,QAAiB,EACjB,SAAkB,EAClB,SAAyB,EACzB,UAA0B,EAC1B,IAAqB,EACrB,IAAc;QAEd,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,eAAe,CAC3C;YACE,YAAY,EAAE;gBACZ,aAAa,EAAE,WAAW;gBAC1B,UAAU,EAAE,WAAW;gBACvB,SAAS,EAAE,SAAS;aACrB;SACF,EACD;YACE,aAAa,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;YAC7B,UAAU,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC;YACzC,SAAS,EAAE,IAAA,uDAAqC,GAAE,EAAE,+DAA+D;SACpH,CACF,CAAC;QAEF,OAAO;YACL,cAAc,EAAE,IAAI,CAAC,aAAa;YAClC,OAAO;YACP,UAAU,EAAE,GAAG;SAChB,CAAC;IACJ,CAAC;IAED,cAAc,CACZ,QAAiB,EACjB,SAAkB,EAClB,SAAyB,EACzB,UAA0B,EAC1B,IAAqB,EACrB,IAAc;QAEd,MAAM,YAAY,GAChB,IAAI,KAAK,oBAAQ,CAAC,IAAI;YACpB,CAAC,CAAC,0BAA0B,CAAC,wBAAwB;YACrD,CAAC,CAAC,0BAA0B,CAAC,wBAAwB,CAAC;QAE1D,MAAM,kBAAkB,GACtB,IAAI,KAAK,oBAAQ,CAAC,IAAI;YACpB,CAAC,CAAC;gBACE,SAAS;gBACT,UAAU;gBACV,CAAC,IAAI,CAAC,OAAO,CAAC;gBACd,CAAC,QAAQ,EAAE,SAAS,CAAC;gBACrB,IAAI,CAAC,eAAe;gBACpB,IAAA,uDAAqC,GAAE;aACxC;YACH,CAAC,CAAC;gBACE,UAAU;gBACV,SAAS;gBACT,CAAC,IAAI,CAAC,OAAO,CAAC;gBACd,CAAC,QAAQ,EAAE,SAAS,CAAC;gBACrB,IAAI,CAAC,eAAe;gBACpB,IAAA,uDAAqC,GAAE;aACxC,CAAC;QACR,MAAM,QAAQ,GAAG,IAAI,CAAC,uBAAuB,CAAC,kBAAkB,CAC9D,YAAY,EACZ,kBAAkB,CACnB,CAAC;QAEF,OAAO,IAAI,CAAC,qCAAqC,CAC/C,QAAQ,EACR,SAAS,EACT,SAAS,EACT,UAAU,EACV,QAAQ,EACR,IAAI,CAAC,aAAa,CACnB,CAAC;IACJ,CAAC;;AA9FH,kCA+FC;AA3FQ,mBAAO,GAAG,CAAC,aAAa,CAAC,CAAC"}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { Interface } from '@ethersproject/abi';
|
|
2
|
-
import { AdapterExchangeParam, Address, DexExchangeParam, ExchangePrices, ExchangeTxInfo, Logger, NumberAsString, PoolLiquidity, PoolPrices, PreprocessTransactionOptions, SimpleExchangeParam, Token, TxInfo } from '../../types';
|
|
3
|
-
import { Network, SwapSide } from '../../constants';
|
|
4
|
-
import { IDex } from '../../dex/idex';
|
|
5
|
-
import { IDexHelper } from '../../dex-helper/idex-helper';
|
|
6
|
-
import { DexParams, OutputResult, PoolState, UniswapV3Data, UniswapV3Param, UniswapV3ParamsDirect } from './types';
|
|
7
|
-
import { SimpleExchange } from '../simple-exchange';
|
|
8
|
-
import { UniswapV3EventPool } from './uniswap-v3-pool';
|
|
9
|
-
import { DeepReadonly } from 'ts-essentials';
|
|
10
|
-
import { Contract } from 'web3-eth-contract';
|
|
11
|
-
import { OptimalSwapExchange } from '@paraswap/core';
|
|
12
|
-
import { OnPoolCreatedCallback, UniswapV3Factory } from './uniswap-v3-factory';
|
|
13
|
-
export declare const PoolsRegistryHashKey = "dl_poolsRegistry";
|
|
14
|
-
export declare const UNISWAPV3_CLEAN_NOT_EXISTING_POOL_TTL_MS: number;
|
|
15
|
-
export declare const UNISWAPV3_CLEAN_NOT_EXISTING_POOL_INTERVAL_MS: number;
|
|
16
|
-
export declare const UNISWAPV3_QUOTE_GASLIMIT = 200000;
|
|
17
|
-
export declare class UniswapV3 extends SimpleExchange implements IDex<UniswapV3Data, UniswapV3Param | UniswapV3ParamsDirect> {
|
|
18
|
-
protected network: Network;
|
|
19
|
-
protected dexHelper: IDexHelper;
|
|
20
|
-
protected adapters: import("../../types").AdapterMappings;
|
|
21
|
-
readonly routerIface: Interface;
|
|
22
|
-
readonly quoterIface: Interface;
|
|
23
|
-
protected config: DexParams;
|
|
24
|
-
protected poolsToPreload: {
|
|
25
|
-
token0: Address;
|
|
26
|
-
token1: Address;
|
|
27
|
-
}[];
|
|
28
|
-
protected readonly factory: UniswapV3Factory;
|
|
29
|
-
readonly isFeeOnTransferSupported: boolean;
|
|
30
|
-
readonly eventPools: Record<string, UniswapV3EventPool | null>;
|
|
31
|
-
readonly hasConstantPriceLargeAmounts = false;
|
|
32
|
-
readonly needWrapNative = true;
|
|
33
|
-
readonly directSwapIface: Interface;
|
|
34
|
-
intervalTask?: NodeJS.Timeout;
|
|
35
|
-
static dexKeysWithNetwork: {
|
|
36
|
-
key: string;
|
|
37
|
-
networks: Network[];
|
|
38
|
-
}[];
|
|
39
|
-
logger: Logger;
|
|
40
|
-
private uniswapMulti;
|
|
41
|
-
protected stateMultiContract: Contract;
|
|
42
|
-
protected notExistingPoolSetKey: string;
|
|
43
|
-
constructor(network: Network, dexKey: string, dexHelper: IDexHelper, adapters?: import("../../types").AdapterMappings, routerIface?: Interface, quoterIface?: Interface, config?: DexParams, poolsToPreload?: {
|
|
44
|
-
token0: Address;
|
|
45
|
-
token1: Address;
|
|
46
|
-
}[]);
|
|
47
|
-
get supportedFees(): bigint[];
|
|
48
|
-
getAdapters(side: SwapSide): {
|
|
49
|
-
name: string;
|
|
50
|
-
index: number;
|
|
51
|
-
}[] | null;
|
|
52
|
-
getPoolIdentifier(srcAddress: Address, destAddress: Address, fee: bigint, tickSpacing?: bigint): string;
|
|
53
|
-
initializePricing(blockNumber: number): Promise<void>;
|
|
54
|
-
protected onPoolCreatedDeleteFromNonExistingSet(): OnPoolCreatedCallback;
|
|
55
|
-
getPool(srcAddress: Address, destAddress: Address, fee: bigint, blockNumber: number, tickSpacing?: bigint): Promise<UniswapV3EventPool | null>;
|
|
56
|
-
protected getPoolInstance(token0: string, token1: string, fee: bigint, tickSpacing?: bigint): UniswapV3EventPool;
|
|
57
|
-
protected getFactoryInstance(): UniswapV3Factory;
|
|
58
|
-
addMasterPool(poolKey: string, blockNumber: number): Promise<boolean>;
|
|
59
|
-
getPoolIdentifiers(srcToken: Token, destToken: Token, side: SwapSide, blockNumber: number): Promise<string[]>;
|
|
60
|
-
protected getPoolsForIdentifiers(srcAddress: string, destAddress: string, blockNumber: number): Promise<(UniswapV3EventPool | null)[]>;
|
|
61
|
-
getPricingFromRpc(from: Token, to: Token, amounts: bigint[], side: SwapSide, pools: UniswapV3EventPool[], states: PoolState[]): Promise<ExchangePrices<UniswapV3Data> | null>;
|
|
62
|
-
protected getSelectedPools(srcAddress: string, destAddress: string, blockNumber: number): Promise<(UniswapV3EventPool | null)[]>;
|
|
63
|
-
getPricesVolume(srcToken: Token, destToken: Token, amounts: bigint[], side: SwapSide, blockNumber: number, limitPools?: string[]): Promise<null | ExchangePrices<UniswapV3Data>>;
|
|
64
|
-
protected prepareData(srcAddress: string, destAddress: string, pool: UniswapV3EventPool, state: PoolState): UniswapV3Data;
|
|
65
|
-
getCalldataGasCost(poolPrices: PoolPrices<UniswapV3Data>): number | number[];
|
|
66
|
-
getTokenFromAddress(address: Address): Token;
|
|
67
|
-
preProcessTransaction(optimalSwapExchange: OptimalSwapExchange<UniswapV3Data>, srcToken: Token, _0: Token, _1: SwapSide, options: PreprocessTransactionOptions): Promise<[OptimalSwapExchange<UniswapV3Data>, ExchangeTxInfo]>;
|
|
68
|
-
getDirectParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, expectedAmount: NumberAsString, data: UniswapV3Data, side: SwapSide, permit: string, uuid: string, feePercent: NumberAsString, deadline: NumberAsString, partner: string, beneficiary: string, contractMethod: string): TxInfo<UniswapV3Param>;
|
|
69
|
-
static getDirectFunctionName(): string[];
|
|
70
|
-
getDirectParamV6(srcToken: Address, destToken: Address, fromAmount: NumberAsString, toAmount: NumberAsString, quotedAmount: NumberAsString, data: UniswapV3Data, side: SwapSide, permit: string, uuid: string, partnerAndFee: string, beneficiary: string, blockNumber: number, contractMethod: string): {
|
|
71
|
-
params: UniswapV3ParamsDirect;
|
|
72
|
-
encoder: (...params: (string | UniswapV3ParamsDirect)[]) => string;
|
|
73
|
-
networkFee: string;
|
|
74
|
-
};
|
|
75
|
-
static getDirectFunctionNameV6(): string[];
|
|
76
|
-
getAdapterParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: UniswapV3Data, side: SwapSide): AdapterExchangeParam;
|
|
77
|
-
getDexParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, recipient: Address, data: UniswapV3Data, side: SwapSide): DexExchangeParam;
|
|
78
|
-
getSimpleParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: UniswapV3Data, side: SwapSide): Promise<SimpleExchangeParam>;
|
|
79
|
-
getTopPoolsForToken(tokenAddress: Address, limit: number): Promise<PoolLiquidity[]>;
|
|
80
|
-
private _getPoolsFromIdentifiers;
|
|
81
|
-
protected _getLoweredAddresses(srcToken: Token, destToken: Token): string[];
|
|
82
|
-
protected _sortTokens(srcAddress: Address, destAddress: Address): string[];
|
|
83
|
-
private _toLowerForAllConfigAddresses;
|
|
84
|
-
protected _getOutputs(state: DeepReadonly<PoolState>, amounts: bigint[], zeroForOne: boolean, side: SwapSide, destTokenBalance: bigint): OutputResult | null;
|
|
85
|
-
private _querySubgraph;
|
|
86
|
-
protected _encodePath(path: {
|
|
87
|
-
tokenIn: Address;
|
|
88
|
-
tokenOut: Address;
|
|
89
|
-
fee: NumberAsString;
|
|
90
|
-
}[], side: SwapSide): string;
|
|
91
|
-
private _encodePathV6;
|
|
92
|
-
private _encodePool;
|
|
93
|
-
releaseResources(): void;
|
|
94
|
-
}
|