@paraswap/dex-lib 3.8.32-inception → 3.8.32-inception.3

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.
@@ -1,4 +1,109 @@
1
1
  [
2
+ { "inputs": [], "name": "EnforcedPause", "type": "error" },
3
+ { "inputs": [], "name": "ExpectedPause", "type": "error" },
4
+ { "inputs": [], "name": "InconsistentInputData", "type": "error" },
5
+ {
6
+ "inputs": [{ "internalType": "uint256", "name": "day", "type": "uint256" }],
7
+ "name": "IncorrectDay",
8
+ "type": "error"
9
+ },
10
+ {
11
+ "inputs": [
12
+ { "internalType": "address", "name": "token", "type": "address" }
13
+ ],
14
+ "name": "IncorrectToken",
15
+ "type": "error"
16
+ },
17
+ { "inputs": [], "name": "InvalidInitialization", "type": "error" },
18
+ { "inputs": [], "name": "NewRatioThresholdInvalid", "type": "error" },
19
+ { "inputs": [], "name": "NotInitializing", "type": "error" },
20
+ { "inputs": [], "name": "NullParams", "type": "error" },
21
+ {
22
+ "inputs": [
23
+ { "internalType": "address", "name": "account", "type": "address" }
24
+ ],
25
+ "name": "OperatorUnauthorizedAccount",
26
+ "type": "error"
27
+ },
28
+ {
29
+ "inputs": [
30
+ { "internalType": "address", "name": "owner", "type": "address" }
31
+ ],
32
+ "name": "OwnableInvalidOwner",
33
+ "type": "error"
34
+ },
35
+ {
36
+ "inputs": [
37
+ { "internalType": "address", "name": "account", "type": "address" }
38
+ ],
39
+ "name": "OwnableUnauthorizedAccount",
40
+ "type": "error"
41
+ },
42
+ { "inputs": [], "name": "RatioThresholdNotSet", "type": "error" },
43
+ {
44
+ "anonymous": false,
45
+ "inputs": [
46
+ {
47
+ "indexed": false,
48
+ "internalType": "uint64",
49
+ "name": "version",
50
+ "type": "uint64"
51
+ }
52
+ ],
53
+ "name": "Initialized",
54
+ "type": "event"
55
+ },
56
+ {
57
+ "anonymous": false,
58
+ "inputs": [
59
+ {
60
+ "indexed": false,
61
+ "internalType": "address",
62
+ "name": "prevValue",
63
+ "type": "address"
64
+ },
65
+ {
66
+ "indexed": false,
67
+ "internalType": "address",
68
+ "name": "newValue",
69
+ "type": "address"
70
+ }
71
+ ],
72
+ "name": "OperatorUpdated",
73
+ "type": "event"
74
+ },
75
+ {
76
+ "anonymous": false,
77
+ "inputs": [
78
+ {
79
+ "indexed": true,
80
+ "internalType": "address",
81
+ "name": "previousOwner",
82
+ "type": "address"
83
+ },
84
+ {
85
+ "indexed": true,
86
+ "internalType": "address",
87
+ "name": "newOwner",
88
+ "type": "address"
89
+ }
90
+ ],
91
+ "name": "OwnershipTransferred",
92
+ "type": "event"
93
+ },
94
+ {
95
+ "anonymous": false,
96
+ "inputs": [
97
+ {
98
+ "indexed": false,
99
+ "internalType": "address",
100
+ "name": "account",
101
+ "type": "address"
102
+ }
103
+ ],
104
+ "name": "Paused",
105
+ "type": "event"
106
+ },
2
107
  {
3
108
  "anonymous": false,
4
109
  "inputs": [
@@ -11,19 +116,76 @@
11
116
  {
12
117
  "indexed": false,
13
118
  "internalType": "uint256",
14
- "name": "oldRatio",
119
+ "name": "failedRatio",
120
+ "type": "uint256"
121
+ },
122
+ {
123
+ "indexed": false,
124
+ "internalType": "string",
125
+ "name": "reason",
126
+ "type": "string"
127
+ }
128
+ ],
129
+ "name": "RatioNotUpdated",
130
+ "type": "event"
131
+ },
132
+ {
133
+ "anonymous": false,
134
+ "inputs": [
135
+ {
136
+ "indexed": false,
137
+ "internalType": "uint256",
138
+ "name": "prevValue",
15
139
  "type": "uint256"
16
140
  },
17
141
  {
18
142
  "indexed": false,
19
143
  "internalType": "uint256",
20
- "name": "newRatio",
144
+ "name": "newValue",
145
+ "type": "uint256"
146
+ }
147
+ ],
148
+ "name": "RatioThresholdChanged",
149
+ "type": "event"
150
+ },
151
+ {
152
+ "anonymous": false,
153
+ "inputs": [
154
+ {
155
+ "indexed": true,
156
+ "internalType": "address",
157
+ "name": "tokenAddress",
158
+ "type": "address"
159
+ },
160
+ {
161
+ "indexed": false,
162
+ "internalType": "uint256",
163
+ "name": "prevValue",
164
+ "type": "uint256"
165
+ },
166
+ {
167
+ "indexed": false,
168
+ "internalType": "uint256",
169
+ "name": "newValue",
21
170
  "type": "uint256"
22
171
  }
23
172
  ],
24
173
  "name": "RatioUpdated",
25
174
  "type": "event"
26
175
  },
176
+ {
177
+ "anonymous": false,
178
+ "inputs": [
179
+ {
180
+ "indexed": false,
181
+ "internalType": "address",
182
+ "name": "account",
183
+ "type": "address"
184
+ }
185
+ ],
186
+ "name": "Unpaused",
187
+ "type": "event"
188
+ },
27
189
  {
28
190
  "inputs": [],
29
191
  "name": "MAX_THRESHOLD",
@@ -67,12 +229,35 @@
67
229
  "type": "function"
68
230
  },
69
231
  {
70
- "inputs": [],
232
+ "inputs": [
233
+ { "internalType": "address", "name": "operator", "type": "address" }
234
+ ],
71
235
  "name": "initialize",
72
236
  "outputs": [],
73
237
  "stateMutability": "nonpayable",
74
238
  "type": "function"
75
239
  },
240
+ {
241
+ "inputs": [],
242
+ "name": "owner",
243
+ "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
244
+ "stateMutability": "view",
245
+ "type": "function"
246
+ },
247
+ {
248
+ "inputs": [],
249
+ "name": "pause",
250
+ "outputs": [],
251
+ "stateMutability": "nonpayable",
252
+ "type": "function"
253
+ },
254
+ {
255
+ "inputs": [],
256
+ "name": "paused",
257
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
258
+ "stateMutability": "view",
259
+ "type": "function"
260
+ },
76
261
  {
77
262
  "inputs": [],
78
263
  "name": "ratioThreshold",
@@ -80,6 +265,57 @@
80
265
  "stateMutability": "view",
81
266
  "type": "function"
82
267
  },
268
+ {
269
+ "inputs": [],
270
+ "name": "renounceOwnership",
271
+ "outputs": [],
272
+ "stateMutability": "nonpayable",
273
+ "type": "function"
274
+ },
275
+ {
276
+ "inputs": [
277
+ { "internalType": "address", "name": "token", "type": "address" },
278
+ { "internalType": "uint256", "name": "ratio", "type": "uint256" }
279
+ ],
280
+ "name": "repairRatioFor",
281
+ "outputs": [],
282
+ "stateMutability": "nonpayable",
283
+ "type": "function"
284
+ },
285
+ {
286
+ "inputs": [
287
+ { "internalType": "address", "name": "newOperator", "type": "address" }
288
+ ],
289
+ "name": "setInceptionOperator",
290
+ "outputs": [],
291
+ "stateMutability": "nonpayable",
292
+ "type": "function"
293
+ },
294
+ {
295
+ "inputs": [
296
+ { "internalType": "uint256", "name": "newValue", "type": "uint256" }
297
+ ],
298
+ "name": "setRatioThreshold",
299
+ "outputs": [],
300
+ "stateMutability": "nonpayable",
301
+ "type": "function"
302
+ },
303
+ {
304
+ "inputs": [
305
+ { "internalType": "address", "name": "newOwner", "type": "address" }
306
+ ],
307
+ "name": "transferOwnership",
308
+ "outputs": [],
309
+ "stateMutability": "nonpayable",
310
+ "type": "function"
311
+ },
312
+ {
313
+ "inputs": [],
314
+ "name": "unpause",
315
+ "outputs": [],
316
+ "stateMutability": "nonpayable",
317
+ "type": "function"
318
+ },
83
319
  {
84
320
  "inputs": [
85
321
  { "internalType": "address[]", "name": "addresses", "type": "address[]" },
@@ -1,16 +1,16 @@
1
1
  import { AsyncOrSync, DeepReadonly } from 'ts-essentials';
2
- import { BlockHeader, Log, Logger } from '../../types';
2
+ import { Address, BlockHeader, Log, Logger } from '../../types';
3
3
  import { StatefulEventSubscriber } from '../../stateful-event-subscriber';
4
4
  import { IDexHelper } from '../../dex-helper/idex-helper';
5
- import { PoolConfig, PoolState } from './types';
5
+ import { PoolState } from './types';
6
6
  import { Interface } from '@ethersproject/abi';
7
7
  export declare class InceptionEventPool extends StatefulEventSubscriber<PoolState> {
8
8
  protected network: number;
9
9
  protected dexHelper: IDexHelper;
10
- poolConfig: PoolConfig;
10
+ protected ratioFeedAddress: Address;
11
11
  poolInterface: Interface;
12
12
  protected ratioFeedInterface: Interface;
13
- constructor(parentName: string, network: number, dexHelper: IDexHelper, logger: Logger, poolConfig: PoolConfig, poolInterface: Interface);
13
+ constructor(parentName: string, network: number, dexHelper: IDexHelper, logger: Logger, ratioFeedAddress: Address, poolInterface: Interface);
14
14
  protected processLog(state: DeepReadonly<PoolState>, log: Readonly<Log>, blockHeader: Readonly<BlockHeader>): AsyncOrSync<DeepReadonly<PoolState> | null>;
15
15
  generateState(blockNumber: number): Promise<Readonly<PoolState>>;
16
16
  }
@@ -11,13 +11,14 @@ const abi_1 = require("@ethersproject/abi");
11
11
  const inception_ratio_feed_json_1 = __importDefault(require("../../abi/inception/inception-ratio-feed.json"));
12
12
  const tokens_1 = require("./tokens");
13
13
  class InceptionEventPool extends stateful_event_subscriber_1.StatefulEventSubscriber {
14
- constructor(parentName, network, dexHelper, logger, poolConfig, poolInterface) {
15
- super(parentName, 'pool', dexHelper, logger);
14
+ constructor(parentName, network, dexHelper, logger, ratioFeedAddress, poolInterface) {
15
+ super(parentName, ratioFeedAddress, dexHelper, logger);
16
16
  this.network = network;
17
17
  this.dexHelper = dexHelper;
18
- this.poolConfig = poolConfig;
18
+ this.ratioFeedAddress = ratioFeedAddress;
19
19
  this.poolInterface = poolInterface;
20
20
  this.ratioFeedInterface = new abi_1.Interface(inception_ratio_feed_json_1.default);
21
+ this.addressesSubscribed = [ratioFeedAddress];
21
22
  }
22
23
  processLog(state, log, blockHeader) {
23
24
  try {
@@ -26,9 +27,11 @@ class InceptionEventPool extends stateful_event_subscriber_1.StatefulEventSubscr
26
27
  switch (parsed.name) {
27
28
  case 'RatioUpdated': {
28
29
  const tokenInfo = (0, tokens_1.getTokenFromAddress)(this.network, parsed.args[0]);
29
- _state[tokenInfo.symbol.toLowerCase()] = {
30
- ratio: BigInt(parsed.args[2].toString()),
31
- };
30
+ if (tokenInfo) {
31
+ _state[tokenInfo.symbol.toLowerCase()] = {
32
+ ratio: BigInt(parsed.args[2].toString()),
33
+ };
34
+ }
32
35
  return _state;
33
36
  }
34
37
  default:
@@ -1 +1 @@
1
- {"version":3,"file":"inception-event-pool.js","sourceRoot":"","sources":["../../../src/dex/inception/inception-event-pool.ts"],"names":[],"mappings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,OAAO,IAAI,CAAC;SACb;IACH,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,WAAmB;QACrC,OAAO,IAAA,uBAAe,EACpB,IAAI,CAAC,SAAS,CAAC,aAAa,EAC5B,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,OAAO,EACZ,WAAW,CACZ,CAAC;IACJ,CAAC;CACF;AA9CD,gDA8CC"}
1
+ {"version":3,"file":"inception-event-pool.js","sourceRoot":"","sources":["../../../src/dex/inception/inception-event-pool.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AAGvB,+EAA0E;AAG1E,mCAA0C;AAC1C,4CAA+C;AAC/C,8GAAiF;AACjF,qCAA+C;AAE/C,MAAa,kBAAmB,SAAQ,mDAAkC;IAExE,YACE,UAAkB,EACR,OAAe,EACf,SAAqB,EAC/B,MAAc,EACJ,gBAAyB,EAC5B,aAAwB;QAE/B,KAAK,CAAC,UAAU,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;QAN7C,YAAO,GAAP,OAAO,CAAQ;QACf,cAAS,GAAT,SAAS,CAAY;QAErB,qBAAgB,GAAhB,gBAAgB,CAAS;QAC5B,kBAAa,GAAb,aAAa,CAAW;QAPvB,uBAAkB,GAAc,IAAI,eAAS,CAAC,mCAAoB,CAAC,CAAC;QAW5E,IAAI,CAAC,mBAAmB,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAChD,CAAC;IAES,UAAU,CAClB,KAA8B,EAC9B,GAAkB,EAClB,WAAkC;QAElC,IAAI;YACF,MAAM,MAAM,GAAG,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;YACrD,MAAM,MAAM,GAAc,gBAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YAC7C,QAAQ,MAAM,CAAC,IAAI,EAAE;gBACnB,KAAK,cAAc,CAAC,CAAC;oBACnB,MAAM,SAAS,GAAG,IAAA,4BAAmB,EAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;oBACpE,IAAI,SAAS,EAAE;wBACb,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,GAAG;4BACvC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;yBACzC,CAAC;qBACH;oBACD,OAAO,MAAM,CAAC;iBACf;gBACD;oBACE,OAAO,MAAM,CAAC;aACjB;SACF;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,qBAAqB,EAAE,CAAC,CAAC,CAAC;YAC5C,OAAO,IAAI,CAAC;SACb;IACH,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,WAAmB;QACrC,OAAO,IAAA,uBAAe,EACpB,IAAI,CAAC,SAAS,CAAC,aAAa,EAC5B,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,OAAO,EACZ,WAAW,CACZ,CAAC;IACJ,CAAC;CACF;AAlDD,gDAkDC"}
@@ -1,30 +1,30 @@
1
1
  import { Interface } from '@ethersproject/abi';
2
2
  import { AsyncOrSync } from 'ts-essentials';
3
3
  import { NumberAsString, SwapSide } from '@paraswap/core';
4
- import { AdapterExchangeParam, Address, DexExchangeParam, ExchangePrices, Logger, PoolLiquidity, PoolPrices, Token } from '../../types';
4
+ import { AdapterExchangeParam, Address, DexExchangeParam, ExchangePrices, Logger, PoolLiquidity, PoolPrices, Token, TransferFeeParams } from '../../types';
5
5
  import { Network } from '../../constants';
6
6
  import { IDex } from '../../dex/idex';
7
7
  import { IDexHelper } from '../../dex-helper/idex-helper';
8
- import { DexParams, InceptionDexData, PoolState } from './types';
8
+ import { InceptionDexData, PoolState } from './types';
9
9
  import { SimpleExchange } from '../simple-exchange';
10
10
  import { InceptionEventPool } from './inception-event-pool';
11
11
  export declare class Inception extends SimpleExchange implements IDex<InceptionDexData> {
12
12
  readonly network: Network;
13
13
  readonly dexKey: string;
14
14
  readonly dexHelper: IDexHelper;
15
- protected config: DexParams[];
15
+ protected config: import("./types").DexParams[];
16
16
  protected vaultInterface: Interface;
17
17
  protected poolInterface: Interface;
18
18
  readonly hasConstantPriceLargeAmounts = false;
19
19
  readonly needWrapNative = false;
20
- readonly isFeeOnTransferSupported = false;
20
+ readonly isFeeOnTransferSupported = true;
21
21
  static dexKeysWithNetwork: {
22
22
  key: string;
23
23
  networks: Network[];
24
24
  }[];
25
25
  logger: Logger;
26
26
  private eventPool;
27
- constructor(network: Network, dexKey: string, dexHelper: IDexHelper, config?: DexParams[]);
27
+ constructor(network: Network, dexKey: string, dexHelper: IDexHelper, config?: import("./types").DexParams[]);
28
28
  initializePricing(blockNumber: number): Promise<void>;
29
29
  initializeTokens(): Promise<void>;
30
30
  getAdapters(side: SwapSide): {
@@ -33,7 +33,7 @@ export declare class Inception extends SimpleExchange implements IDex<InceptionD
33
33
  }[] | null;
34
34
  getPoolIdentifiers(srcToken: Token, destToken: Token, side: SwapSide, blockNumber: number): Promise<string[]>;
35
35
  getPoolState(pool: InceptionEventPool, blockNumber: number): Promise<PoolState>;
36
- getPricesVolume(srcToken: Token, destToken: Token, amounts: bigint[], side: SwapSide, blockNumber: number, limitPools?: string[]): Promise<null | ExchangePrices<InceptionDexData>>;
36
+ getPricesVolume(srcToken: Token, destToken: Token, amounts: bigint[], side: SwapSide, blockNumber: number, limitPools?: string[], transferFees?: TransferFeeParams): Promise<null | ExchangePrices<InceptionDexData>>;
37
37
  getCalldataGasCost(poolPrices: PoolPrices<InceptionDexData>): number | number[];
38
38
  getAdapterParam(): AdapterExchangeParam;
39
39
  getDexParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, recipient: Address, data: InceptionDexData, side: SwapSide): DexExchangeParam;
@@ -39,6 +39,7 @@ const config_1 = require("./config");
39
39
  const tokens_1 = require("./tokens");
40
40
  const utils_2 = require("./utils");
41
41
  const inception_event_pool_1 = require("./inception-event-pool");
42
+ const token_transfer_fee_1 = require("../../lib/token-transfer-fee");
42
43
  const DECIMALS = BigInt(1e18);
43
44
  class Inception extends simple_exchange_1.SimpleExchange {
44
45
  constructor(network, dexKey, dexHelper, config = config_1.InceptionConfig[dexKey][network]) {
@@ -49,14 +50,11 @@ class Inception extends simple_exchange_1.SimpleExchange {
49
50
  this.config = config;
50
51
  this.hasConstantPriceLargeAmounts = false;
51
52
  this.needWrapNative = false;
52
- this.isFeeOnTransferSupported = false;
53
+ this.isFeeOnTransferSupported = true;
53
54
  this.logger = dexHelper.getLogger(dexKey);
54
55
  this.vaultInterface = new abi_1.Interface(inception_vault_json_1.default);
55
56
  this.poolInterface = new abi_1.Interface(inception_ineth_pool_json_1.default);
56
- this.eventPool = new inception_event_pool_1.InceptionEventPool(dexKey, network, dexHelper, this.logger, {
57
- ratioFeedAddress: config_1.InceptionPricePoolConfig[dexKey][network].ratioFeed,
58
- initState: {},
59
- }, this.poolInterface);
57
+ this.eventPool = new inception_event_pool_1.InceptionEventPool(dexKey, network, dexHelper, this.logger, config_1.InceptionPricePoolConfig[dexKey][network].ratioFeed, this.poolInterface);
60
58
  }
61
59
  async initializePricing(blockNumber) {
62
60
  const poolState = await (0, utils_2.getOnChainState)(this.dexHelper.multiContract, this.vaultInterface, this.network, blockNumber);
@@ -89,31 +87,41 @@ class Inception extends simple_exchange_1.SimpleExchange {
89
87
  pool.setState(onChainState, blockNumber);
90
88
  return onChainState;
91
89
  }
92
- async getPricesVolume(srcToken, destToken, amounts, side, blockNumber, limitPools) {
90
+ async getPricesVolume(srcToken, destToken, amounts, side, blockNumber, limitPools, transferFees = {
91
+ srcFee: 0,
92
+ destFee: 0,
93
+ srcDexFee: 0,
94
+ destDexFee: 0,
95
+ }) {
93
96
  if (side === core_1.SwapSide.BUY) {
94
97
  return null;
95
98
  }
96
99
  const src = (0, tokens_1.getTokenFromAddress)(this.network, srcToken.address);
97
100
  const dest = (0, tokens_1.getTokenFromAddress)(this.network, destToken.address);
98
- if (src !== dest) {
101
+ if (!src || !dest || src !== dest) {
99
102
  return null;
100
103
  }
101
104
  const poolState = await this.getPoolState(this.eventPool, blockNumber);
102
105
  if (!poolState)
103
106
  return null;
107
+ const unitPrice = DECIMALS;
108
+ const prices = amounts.map(amount => {
109
+ const ratio = poolState[src.symbol.toLowerCase()].ratio;
110
+ return (ratio * amount) / DECIMALS;
111
+ });
112
+ const [unitPriceWithFee, ...pricesWithFee] = (0, token_transfer_fee_1.applyTransferFee)([unitPrice, ...prices], side, side === core_1.SwapSide.SELL ? transferFees.srcFee : transferFees.destFee, side === core_1.SwapSide.SELL
113
+ ? constants_1.SRC_TOKEN_PARASWAP_TRANSFERS
114
+ : constants_1.DEST_TOKEN_PARASWAP_TRANSFERS);
104
115
  return [
105
116
  {
106
- prices: amounts.map(amount => {
107
- const ratio = poolState[src.symbol.toLowerCase()].ratio;
108
- return (ratio * amount) / DECIMALS;
109
- }),
110
- unit: DECIMALS,
117
+ prices: pricesWithFee,
118
+ unit: unitPriceWithFee,
111
119
  gasCost: 120000,
112
120
  exchange: this.dexKey,
113
121
  data: {
114
122
  exchange: dest.vault,
115
123
  },
116
- poolAddresses: [src.token.toLowerCase()],
124
+ poolAddresses: [dest.vault],
117
125
  },
118
126
  ];
119
127
  }
@@ -129,12 +137,17 @@ class Inception extends simple_exchange_1.SimpleExchange {
129
137
  }
130
138
  getDexParam(srcToken, destToken, srcAmount, destAmount, recipient, data, side) {
131
139
  const dexParams = (0, tokens_1.getTokenFromAddress)(this.network, srcToken);
140
+ if (!dexParams) {
141
+ throw new Error('Unknown token');
142
+ }
132
143
  const isNative = dexParams.baseTokenSlug === 'ETH';
133
144
  let swapData;
134
145
  let dexFuncHasRecipient;
146
+ let swappedAmountNotPresentInExchangeData;
135
147
  if (isNative) {
136
148
  swapData = this.poolInterface.encodeFunctionData('stake()', []);
137
149
  dexFuncHasRecipient = false;
150
+ swappedAmountNotPresentInExchangeData = true;
138
151
  }
139
152
  else {
140
153
  swapData = this.vaultInterface.encodeFunctionData('deposit', [
@@ -142,13 +155,14 @@ class Inception extends simple_exchange_1.SimpleExchange {
142
155
  recipient,
143
156
  ]);
144
157
  dexFuncHasRecipient = true;
158
+ swappedAmountNotPresentInExchangeData = false;
145
159
  }
146
160
  return {
147
161
  needWrapNative: false,
148
162
  dexFuncHasRecipient,
149
163
  exchangeData: swapData,
150
164
  targetExchange: dexParams.vault,
151
- swappedAmountNotPresentInExchangeData: true,
165
+ swappedAmountNotPresentInExchangeData,
152
166
  returnAmountPos: undefined,
153
167
  };
154
168
  }
@@ -164,7 +178,9 @@ class Inception extends simple_exchange_1.SimpleExchange {
164
178
  address: token.vault,
165
179
  connectorTokens: [
166
180
  {
167
- address: token.token,
181
+ address: tokenAddress.toLowerCase() === token.token.toLowerCase()
182
+ ? token.baseToken
183
+ : token.token,
168
184
  decimals: 1e18,
169
185
  },
170
186
  ],
@@ -1 +1 @@
1
- {"version":3,"file":"inception.js","sourceRoot":"","sources":["../../../src/dex/inception/inception.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA6D;AAE7D,yCAA0D;AAW1D,oGAAqE;AACrE,8GAA+E;AAC/E,+CAAwD;AACxD,2EAA6D;AAC7D,uCAA2D;AAI3D,wDAAoD;AACpD,qCAAqE;AACrE,qCAA2E;AAC3E,mCAAwD;AACxD,iEAA4D;AAE5D,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;AAE9B,MAAa,SACX,SAAQ,gCAAc;IAiBtB,YACW,OAAgB,EAChB,MAAc,EACd,SAAqB,EACpB,SAAS,wBAAe,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;QAEnD,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QALhB,YAAO,GAAP,OAAO,CAAS;QAChB,WAAM,GAAN,MAAM,CAAQ;QACd,cAAS,GAAT,SAAS,CAAY;QACpB,WAAM,GAAN,MAAM,CAAmC;QAf5C,iCAA4B,GA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I,CAAC,cAAc,CAAC,kBAAkB,CAAC,SAAS,EAAE;gBAC3D,SAAS;gBACT,SAAS;aACV,CAAC,CAAC;YACH,mBAAmB,GAAG,IAAI,CAAC;SAC5B;QAED,OAAO;YACL,cAAc,EAAE,KAAK;YACrB,mBAAmB;YACnB,YAAY,EAAE,QAAQ;YACtB,cAAc,EAAE,SAAS,CAAC,KAAK;YAC/B,qCAAqC,EAAE,IAAI;YAC3C,eAAe,EAAE,SAAS;SAC3B,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,eAAe,KAAmB,CAAC;IAEzC,KAAK,CAAC,mBAAmB,CACvB,YAAqB,EACrB,KAAa;QAEb,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAE9B,MAAM,KAAK,GAAc,IAAA,4BAAmB,EAAC,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QAEzE,IAAI,KAAK,EAAE;YACT,OAAO;gBACL;oBACE,YAAY,EAAE,GAAG;oBACjB,QAAQ,EAAE,IAAI,CAAC,MAAM;oBACrB,OAAO,EAAE,KAAK,CAAC,KAAK;oBACpB,eAAe,EAAE;wBACf;4BACE,OAAO,EAAE,KAAK,CAAC,KAAK;4BACpB,QAAQ,EAAE,IAAI;yBACf;qBACF;iBACF;aACF,CAAC;SACH;QACD,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,gBAAgB,KAAuB,CAAC;;AA/M1C,8BAgNC;AArMe,4BAAkB,GAC9B,IAAA,6BAAqB,EAAC,wBAAe,CAAC,CAAC"}
1
+ {"version":3,"file":"inception.js","sourceRoot":"","sources":["../../../src/dex/inception/inception.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA6D;AAE7D,yCAA0D;AAY1D,oGAAqE;AACrE,8GAA+E;AAC/E,+CAKyB;AACzB,2EAA6D;AAC7D,uCAAoD;AAIpD,wDAAoD;AACpD,qCAAqE;AACrE,qCAAmE;AACnE,mCAAwD;AACxD,iEAA4D;A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,mBAAmB;YACnB,YAAY,EAAE,QAAQ;YACtB,cAAc,EAAE,SAAS,CAAC,KAAK;YAC/B,qCAAqC;YACrC,eAAe,EAAE,SAAS;SAC3B,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,eAAe,KAAmB,CAAC;IAEzC,KAAK,CAAC,mBAAmB,CACvB,YAAqB,EACrB,KAAa;QAEb,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAE9B,MAAM,KAAK,GAAG,IAAA,4BAAmB,EAAC,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QAE9D,IAAI,KAAK,EAAE;YACT,OAAO;gBACL;oBACE,YAAY,EAAE,GAAG;oBACjB,QAAQ,EAAE,IAAI,CAAC,MAAM;oBACrB,OAAO,EAAE,KAAK,CAAC,KAAK;oBACpB,eAAe,EAAE;wBACf;4BACE,OAAO,EACL,YAAY,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE;gCACtD,CAAC,CAAC,KAAK,CAAC,SAAS;gCACjB,CAAC,CAAC,KAAK,CAAC,KAAK;4BACjB,QAAQ,EAAE,IAAI;yBACf;qBACF;iBACF;aACF,CAAC;SACH;QACD,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,gBAAgB,KAAuB,CAAC;;AAxO1C,8BAyOC;AA9Ne,4BAAkB,GAC9B,IAAA,6BAAqB,EAAC,wBAAe,CAAC,CAAC"}
@@ -6,4 +6,4 @@ export declare const Tokens: {
6
6
  };
7
7
  };
8
8
  export declare function setTokensOnNetwork(network: Network, tokens: DexParams[]): void;
9
- export declare function getTokenFromAddress(network: Network, address: string): DexParams;
9
+ export declare function getTokenFromAddress(network: Network, address: string): DexParams | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraswap/dex-lib",
3
- "version": "3.8.32-inception",
3
+ "version": "3.8.32-inception.3",
4
4
  "main": "build/index.js",
5
5
  "types": "build/index.d.ts",
6
6
  "repository": "https://github.com/paraswap/paraswap-dex-lib",