@paraswap/dex-lib 4.0.3 → 4.0.4
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/.idea/aws.xml +17 -0
- package/.idea/codeStyles/Project.xml +19 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/paraswap-dex-lib.iml +9 -0
- package/.idea/prettier.xml +7 -0
- package/.idea/vcs.xml +6 -0
- package/build/abi/integral/factory.json +333 -0
- package/build/abi/integral/oracle.json +501 -0
- package/build/abi/{inception/inception-ineth-pool.json → integral/pool.json} +522 -543
- package/build/abi/{wombat/pool.json → integral/relayer.json} +720 -473
- package/build/dex/aave-v1/aave-v1.d.ts +1 -2
- package/build/dex/aave-v1/aave-v1.js +0 -23
- package/build/dex/aave-v1/aave-v1.js.map +1 -1
- package/build/dex/bebop/bebop.js +1 -1
- package/build/dex/bebop/bebop.js.map +1 -1
- package/build/dex/cables/cables.d.ts +4 -2
- package/build/dex/cables/cables.js +90 -155
- package/build/dex/cables/cables.js.map +1 -1
- package/build/dex/cables/constants.d.ts +0 -1
- package/build/dex/cables/constants.js +2 -3
- package/build/dex/cables/constants.js.map +1 -1
- package/build/dex/cables/rate-fetcher.js +26 -10
- package/build/dex/cables/rate-fetcher.js.map +1 -1
- package/build/dex/cables/types.d.ts +15 -28
- package/build/dex/cables/types.js +2 -13
- package/build/dex/cables/types.js.map +1 -1
- package/build/dex/dexalot/dexalot.js.map +1 -1
- package/build/dex/fluid-dex/fluid-dex-generate-pool.d.ts +49 -0
- package/build/dex/fluid-dex/fluid-dex-generate-pool.js +104 -0
- package/build/dex/fluid-dex/fluid-dex-generate-pool.js.map +1 -0
- package/build/dex/index.js +2 -0
- package/build/dex/index.js.map +1 -1
- package/build/dex/integral/config.d.ts +4 -0
- package/build/dex/integral/config.js +20 -0
- package/build/dex/integral/config.js.map +1 -0
- package/build/dex/integral/context.d.ts +40 -0
- package/build/dex/integral/context.js +158 -0
- package/build/dex/integral/context.js.map +1 -0
- package/build/dex/integral/integral-factory.d.ts +24 -0
- package/build/dex/integral/integral-factory.js +95 -0
- package/build/dex/integral/integral-factory.js.map +1 -0
- package/build/dex/integral/integral-pool.d.ts +50 -0
- package/build/dex/integral/integral-pool.js +149 -0
- package/build/dex/integral/integral-pool.js.map +1 -0
- package/build/dex/integral/integral-pricing.d.ts +18 -0
- package/build/dex/integral/integral-pricing.js +114 -0
- package/build/dex/integral/integral-pricing.js.map +1 -0
- package/build/dex/integral/integral-relayer.d.ts +42 -0
- package/build/dex/integral/integral-relayer.js +192 -0
- package/build/dex/integral/integral-relayer.js.map +1 -0
- package/build/dex/integral/integral-token.d.ts +27 -0
- package/build/dex/integral/integral-token.js +59 -0
- package/build/dex/integral/integral-token.js.map +1 -0
- package/build/dex/integral/integral.d.ts +41 -0
- package/build/dex/integral/integral.js +376 -0
- package/build/dex/integral/integral.js.map +1 -0
- package/build/dex/integral/types.d.ts +85 -0
- package/build/dex/integral/types.js +9 -0
- package/build/dex/integral/types.js.map +1 -0
- package/build/dex/integral/utils-e2e.d.ts +9 -0
- package/build/dex/integral/utils-e2e.js +131 -0
- package/build/dex/integral/utils-e2e.js.map +1 -0
- package/build/dex/integral/utils.d.ts +17 -0
- package/build/dex/integral/utils.js +94 -0
- package/build/dex/integral/utils.js.map +1 -0
- package/build/dex/jarvis.d.ts +1 -2
- package/build/dex/jarvis.js +0 -58
- package/build/dex/jarvis.js.map +1 -1
- package/build/dex/platypus/platypus.d.ts +1 -2
- package/build/dex/platypus/platypus.js +0 -45
- package/build/dex/platypus/platypus.js.map +1 -1
- package/build/dex/stable-pool.js +8 -1
- package/build/dex/stable-pool.js.map +1 -1
- package/build/dex/swaap-v1/swaap-v1.d.ts +1 -2
- package/build/dex/swaap-v1/swaap-v1.js +0 -14
- package/build/dex/swaap-v1/swaap-v1.js.map +1 -1
- package/build/dex/trader-joe-v2.1/optimizer.d.ts +2 -0
- package/build/dex/trader-joe-v2.1/optimizer.js +47 -0
- package/build/dex/trader-joe-v2.1/optimizer.js.map +1 -0
- package/build/dex/zerox/index.d.ts +26 -4
- package/build/dex/zerox/index.js +42 -50
- package/build/dex/zerox/index.js.map +1 -1
- package/build/dex/zerox/types.d.ts +0 -29
- package/build/dex/zerox/types.js +1 -8
- package/build/dex/zerox/types.js.map +1 -1
- package/build/executor/Executor01BytecodeBuilder.js +11 -6
- package/build/executor/Executor01BytecodeBuilder.js.map +1 -1
- package/build/executor/Executor02BytecodeBuilder.js +11 -6
- package/build/executor/Executor02BytecodeBuilder.js.map +1 -1
- package/build/executor/Executor03BytecodeBuilder.js +11 -6
- package/build/executor/Executor03BytecodeBuilder.js.map +1 -1
- package/build/types.d.ts +1 -0
- package/package.json +1 -1
- package/src/abi/cables/CablesMainnetRFQ.json +1083 -0
- package/src/dex/bebop/bebop.ts +1 -1
- package/src/dex/cables/cables-e2e.test.ts +207 -0
- package/src/dex/cables/cables-integration.test.ts +391 -0
- package/src/dex/cables/cables.ts +823 -0
- package/src/dex/cables/config.ts +13 -0
- package/src/dex/cables/constants.ts +33 -0
- package/src/dex/cables/rate-fetcher.ts +212 -0
- package/src/dex/cables/types.ts +113 -0
- package/src/dex/cables/validators.test.ts +151 -0
- package/src/dex/cables/validators.ts +61 -0
- package/src/dex/dexalot/dexalot.ts +1 -0
- package/src/dex/index.ts +2 -0
- package/src/executor/Executor01BytecodeBuilder.ts +15 -11
- package/src/executor/Executor02BytecodeBuilder.ts +13 -9
- package/src/executor/Executor03BytecodeBuilder.ts +16 -9
- package/src/types.ts +1 -0
- package/tests/constants-e2e.ts +2 -2
- package/.vscode/launch.json +0 -53
- package/.vscode/settings.json +0 -2
- package/.vscode/tasks.json +0 -15
- package/build/abi/inception/inception-ratio-feed.json +0 -329
- package/build/abi/inception/inception-vault.json +0 -991
- package/build/abi/uniswap-v3/AlienBaseV3Router.abi.json +0 -52
- package/build/abi/usual-m-smart-m/usualM.abi.json +0 -483
- package/build/abi/usual-m-usd0/usualCollateralDao.abi.json +0 -681
- package/build/abi/usual-m-wrapped-m/usualM.abi.json +0 -509
- package/build/dex/aave-v2/tokens-avalanche.json +0 -44
- package/build/dex/aave-v2/tokens-mainnet.json +0 -188
- package/build/dex/aave-v2/tokens-polygon.json +0 -44
- package/build/dex/balancer-v3/abi/balancerBatchRouter.d.ts +0 -729
- package/build/dex/balancer-v3/abi/balancerBatchRouter.js +0 -732
- package/build/dex/balancer-v3/abi/balancerBatchRouter.js.map +0 -1
- package/build/dex/balancer-v3/abi/balancerRouter.d.ts +0 -1406
- package/build/dex/balancer-v3/abi/balancerRouter.js +0 -1175
- package/build/dex/balancer-v3/abi/balancerRouter.js.map +0 -1
- package/build/dex/balancer-v3/abi/vaultExtension.V3.d.ts +0 -2081
- package/build/dex/balancer-v3/abi/vaultExtension.V3.js +0 -1851
- package/build/dex/balancer-v3/abi/vaultExtension.V3.js.map +0 -1
- package/build/dex/balancer-v3/balancer-v3-sepolia-pools.d.ts +0 -34
- package/build/dex/balancer-v3/balancer-v3-sepolia-pools.js +0 -406
- package/build/dex/balancer-v3/balancer-v3-sepolia-pools.js.map +0 -1
- package/build/dex/inception/config.d.ts +0 -4
- package/build/dex/inception/config.js +0 -109
- package/build/dex/inception/config.js.map +0 -1
- package/build/dex/inception/inception-event-pool.d.ts +0 -16
- package/build/dex/inception/inception-event-pool.js +0 -49
- package/build/dex/inception/inception-event-pool.js.map +0 -1
- package/build/dex/inception/inception.d.ts +0 -43
- package/build/dex/inception/inception.js +0 -180
- package/build/dex/inception/inception.js.map +0 -1
- package/build/dex/inception/tokens.d.ts +0 -9
- package/build/dex/inception/tokens.js +0 -28
- package/build/dex/inception/tokens.js.map +0 -1
- package/build/dex/inception/types.d.ts +0 -22
- package/build/dex/inception/types.js +0 -3
- package/build/dex/inception/types.js.map +0 -1
- package/build/dex/inception/utils.d.ts +0 -7
- package/build/dex/inception/utils.js +0 -58
- package/build/dex/inception/utils.js.map +0 -1
- package/build/dex/maker-psm/scripts/gem.abi.json +0 -136
- package/build/dex/maker-psm/scripts/validate-state.d.ts +0 -0
- package/build/dex/maker-psm/scripts/validate-state.js +0 -185
- package/build/dex/maker-psm/scripts/validate-state.js.map +0 -1
- package/build/dex/maker-psm/scripts/vat.abi.json +0 -243
- package/build/dex/solidly-v3/scripts/check-event-pool-event.d.ts +0 -1
- package/build/dex/solidly-v3/scripts/check-event-pool-event.js +0 -53
- package/build/dex/solidly-v3/scripts/check-event-pool-event.js.map +0 -1
- package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.d.ts +0 -17
- package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.js +0 -64
- package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.js.map +0 -1
- package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.d.ts +0 -17
- package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.js +0 -79
- package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.js.map +0 -1
- package/build/dex/uniswap-v3/uniswap-v3-pricing.d.ts +0 -4
- package/build/dex/uniswap-v3/uniswap-v3-pricing.js +0 -43
- package/build/dex/uniswap-v3/uniswap-v3-pricing.js.map +0 -1
- package/build/dex/uniswap-v3/uniswap-v3-worker.d.ts +0 -1
- package/build/dex/uniswap-v3/uniswap-v3-worker.js +0 -10
- package/build/dex/uniswap-v3/uniswap-v3-worker.js.map +0 -1
- package/build/dex/usual/types.d.ts +0 -13
- package/build/dex/usual/types.js +0 -3
- package/build/dex/usual/types.js.map +0 -1
- package/build/dex/usual/usual-bond.d.ts +0 -18
- package/build/dex/usual/usual-bond.js +0 -52
- package/build/dex/usual/usual-bond.js.map +0 -1
- package/build/dex/usual/usual-m-smart-m.d.ts +0 -17
- package/build/dex/usual/usual-m-smart-m.js +0 -50
- package/build/dex/usual/usual-m-smart-m.js.map +0 -1
- package/build/dex/usual/usual-m-usd0.d.ts +0 -17
- package/build/dex/usual/usual-m-usd0.js +0 -51
- package/build/dex/usual/usual-m-usd0.js.map +0 -1
- package/build/dex/usual/usual-m-wrapped-m.d.ts +0 -17
- package/build/dex/usual/usual-m-wrapped-m.js +0 -50
- package/build/dex/usual/usual-m-wrapped-m.js.map +0 -1
- package/build/dex/usual/usual.d.ts +0 -27
- package/build/dex/usual/usual.js +0 -125
- package/build/dex/usual/usual.js.map +0 -1
- package/build/dex/usual-m-smart-m/config.d.ts +0 -3
- package/build/dex/usual-m-smart-m/config.js +0 -13
- package/build/dex/usual-m-smart-m/config.js.map +0 -1
- package/build/dex/usual-m-smart-m/types.d.ts +0 -7
- package/build/dex/usual-m-smart-m/types.js +0 -3
- package/build/dex/usual-m-smart-m/types.js.map +0 -1
- package/build/dex/usual-m-smart-m/usual-m-smart-m.d.ts +0 -35
- package/build/dex/usual-m-smart-m/usual-m-smart-m.js +0 -161
- package/build/dex/usual-m-smart-m/usual-m-smart-m.js.map +0 -1
- package/build/dex/usual-m-usd0/config.d.ts +0 -3
- package/build/dex/usual-m-usd0/config.js +0 -14
- package/build/dex/usual-m-usd0/config.js.map +0 -1
- package/build/dex/usual-m-usd0/types.d.ts +0 -8
- package/build/dex/usual-m-usd0/types.js +0 -3
- package/build/dex/usual-m-usd0/types.js.map +0 -1
- package/build/dex/usual-m-usd0/usual-m-usd0.d.ts +0 -35
- package/build/dex/usual-m-usd0/usual-m-usd0.js +0 -159
- package/build/dex/usual-m-usd0/usual-m-usd0.js.map +0 -1
- package/build/lib/pub-sub.d.ts +0 -35
- package/build/lib/pub-sub.js +0 -106
- package/build/lib/pub-sub.js.map +0 -1
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UsualMSmartMConfig = void 0;
|
|
4
|
-
const constants_1 = require("../../constants");
|
|
5
|
-
exports.UsualMSmartMConfig = {
|
|
6
|
-
UsualMSmartM: {
|
|
7
|
-
[constants_1.Network.MAINNET]: {
|
|
8
|
-
smartMAddress: '0x437cc33344a0B27A429f795ff6B469C72698B291',
|
|
9
|
-
usualMAddress: '0xFe274C305b365dC38e188E8f01c4FAe2171ce927',
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/dex/usual-m-smart-m/config.ts"],"names":[],"mappings":";;;AAEA,+CAAoD;AAEvC,QAAA,kBAAkB,GAA4B;IACzD,YAAY,EAAE;QACZ,CAAC,mBAAO,CAAC,OAAO,CAAC,EAAE;YACjB,aAAa,EAAE,4CAA4C;YAC3D,aAAa,EAAE,4CAA4C;SAC5D;KACF;CACF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/dex/usual-m-smart-m/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Token, Address, ExchangePrices, PoolPrices, AdapterExchangeParam, Logger, NumberAsString, DexExchangeParam, PoolLiquidity } from '../../types';
|
|
2
|
-
import { SwapSide, Network } from '../../constants';
|
|
3
|
-
import { IDex } from '../idex';
|
|
4
|
-
import { IDexHelper } from '../../dex-helper/idex-helper';
|
|
5
|
-
import { UsualMSmartMData, DexParams } from './types';
|
|
6
|
-
import { SimpleExchange } from '../simple-exchange';
|
|
7
|
-
import { Interface } from '@ethersproject/abi';
|
|
8
|
-
export declare class UsualMSmartM1 extends SimpleExchange implements IDex<UsualMSmartMData> {
|
|
9
|
-
readonly network: Network;
|
|
10
|
-
readonly dexKey: string;
|
|
11
|
-
readonly dexHelper: IDexHelper;
|
|
12
|
-
protected config: DexParams;
|
|
13
|
-
readonly hasConstantPriceLargeAmounts = true;
|
|
14
|
-
readonly needWrapNative = false;
|
|
15
|
-
readonly isFeeOnTransferSupported = false;
|
|
16
|
-
static dexKeysWithNetwork: {
|
|
17
|
-
key: string;
|
|
18
|
-
networks: Network[];
|
|
19
|
-
}[];
|
|
20
|
-
usualMIface: Interface;
|
|
21
|
-
logger: Logger;
|
|
22
|
-
constructor(network: Network, dexKey: string, dexHelper: IDexHelper);
|
|
23
|
-
initializePricing(blockNumber: number): Promise<void>;
|
|
24
|
-
getConfig(): DexParams;
|
|
25
|
-
is_smartM(token: string): boolean;
|
|
26
|
-
is_usualM(token: string): boolean;
|
|
27
|
-
is_usualM_swap_token(srcToken: string, destToken: string): boolean;
|
|
28
|
-
getAdapters(): 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<UsualMSmartMData>>;
|
|
31
|
-
getCalldataGasCost(poolPrices: PoolPrices<UsualMSmartMData>): number | number[];
|
|
32
|
-
getAdapterParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: UsualMSmartMData, side: SwapSide): AdapterExchangeParam;
|
|
33
|
-
getDexParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, recipient: Address, data: UsualMSmartMData, side: SwapSide): Promise<DexExchangeParam>;
|
|
34
|
-
getTopPoolsForToken(tokenAddress: Address, limit: number): Promise<PoolLiquidity[]>;
|
|
35
|
-
}
|
|
@@ -1,161 +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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.UsualMSmartM1 = void 0;
|
|
30
|
-
const constants_1 = require("../../constants");
|
|
31
|
-
const CALLDATA_GAS_COST = __importStar(require("../../calldata-gas-cost"));
|
|
32
|
-
const utils_1 = require("../../utils");
|
|
33
|
-
const simple_exchange_1 = require("../simple-exchange");
|
|
34
|
-
const config_1 = require("./config");
|
|
35
|
-
const abi_1 = require("@ethersproject/abi");
|
|
36
|
-
const usualM_abi_json_1 = __importDefault(require("../../abi/usual-m-smart-m/usualM.abi.json"));
|
|
37
|
-
const bigint_constants_1 = require("../../bigint-constants");
|
|
38
|
-
class UsualMSmartM1 extends simple_exchange_1.SimpleExchange {
|
|
39
|
-
constructor(network, dexKey, dexHelper) {
|
|
40
|
-
super(dexHelper, dexKey);
|
|
41
|
-
this.network = network;
|
|
42
|
-
this.dexKey = dexKey;
|
|
43
|
-
this.dexHelper = dexHelper;
|
|
44
|
-
this.hasConstantPriceLargeAmounts = true;
|
|
45
|
-
this.needWrapNative = false;
|
|
46
|
-
this.isFeeOnTransferSupported = false;
|
|
47
|
-
const config = config_1.UsualMSmartMConfig[dexKey][network];
|
|
48
|
-
this.usualMIface = new abi_1.Interface(usualM_abi_json_1.default);
|
|
49
|
-
this.config = {
|
|
50
|
-
smartMAddress: config.smartMAddress.toLowerCase(),
|
|
51
|
-
usualMAddress: config.usualMAddress.toLowerCase(),
|
|
52
|
-
};
|
|
53
|
-
this.logger = dexHelper.getLogger(dexKey);
|
|
54
|
-
}
|
|
55
|
-
async initializePricing(blockNumber) {
|
|
56
|
-
// No initialization needed for constant price
|
|
57
|
-
}
|
|
58
|
-
getConfig() {
|
|
59
|
-
return this.config;
|
|
60
|
-
}
|
|
61
|
-
is_smartM(token) {
|
|
62
|
-
return token.toLowerCase() === this.config.smartMAddress.toLowerCase();
|
|
63
|
-
}
|
|
64
|
-
is_usualM(token) {
|
|
65
|
-
return token.toLowerCase() === this.config.usualMAddress.toLowerCase();
|
|
66
|
-
}
|
|
67
|
-
is_usualM_swap_token(srcToken, destToken) {
|
|
68
|
-
return this.is_smartM(srcToken) && this.is_usualM(destToken);
|
|
69
|
-
}
|
|
70
|
-
getAdapters() {
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
async getPoolIdentifiers(srcToken, destToken, side, blockNumber) {
|
|
74
|
-
if (!srcToken || !destToken) {
|
|
75
|
-
this.logger.error('Source or destination token is undefined');
|
|
76
|
-
return [];
|
|
77
|
-
}
|
|
78
|
-
const srcTokenAddress = srcToken.address?.toLowerCase();
|
|
79
|
-
const destTokenAddress = destToken.address?.toLowerCase();
|
|
80
|
-
if (!srcTokenAddress || !destTokenAddress) {
|
|
81
|
-
this.logger.error('Source or destination token address is undefined');
|
|
82
|
-
return [];
|
|
83
|
-
}
|
|
84
|
-
if (this.is_usualM_swap_token(srcTokenAddress, destTokenAddress)) {
|
|
85
|
-
return [`${this.dexKey}_${this.config.usualMAddress}`];
|
|
86
|
-
}
|
|
87
|
-
return [];
|
|
88
|
-
}
|
|
89
|
-
async getPricesVolume(srcToken, destToken, amounts, side, blockNumber, limitPools) {
|
|
90
|
-
if (side === constants_1.SwapSide.BUY) {
|
|
91
|
-
return null;
|
|
92
|
-
}
|
|
93
|
-
const isUsualMSwapToken = this.is_usualM_swap_token(srcToken.address, destToken.address);
|
|
94
|
-
if (!isUsualMSwapToken) {
|
|
95
|
-
return null;
|
|
96
|
-
}
|
|
97
|
-
const unitOut = bigint_constants_1.BI_POWS[18]; // 1:1 swap
|
|
98
|
-
const amountsOut = amounts; // 1:1 swap, so output amounts are the same as input
|
|
99
|
-
return [
|
|
100
|
-
{
|
|
101
|
-
unit: unitOut,
|
|
102
|
-
prices: amountsOut,
|
|
103
|
-
data: {},
|
|
104
|
-
poolAddresses: [this.config.usualMAddress],
|
|
105
|
-
exchange: this.dexKey,
|
|
106
|
-
gasCost: 70000,
|
|
107
|
-
poolIdentifier: this.dexKey,
|
|
108
|
-
},
|
|
109
|
-
];
|
|
110
|
-
}
|
|
111
|
-
getCalldataGasCost(poolPrices) {
|
|
112
|
-
return CALLDATA_GAS_COST.DEX_NO_PAYLOAD;
|
|
113
|
-
}
|
|
114
|
-
getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
|
|
115
|
-
const payload = '0x';
|
|
116
|
-
return {
|
|
117
|
-
targetExchange: this.config.usualMAddress,
|
|
118
|
-
payload,
|
|
119
|
-
networkFee: '0',
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
async getDexParam(srcToken, destToken, srcAmount, destAmount, recipient, data, side) {
|
|
123
|
-
if (this.is_smartM(srcToken) && this.is_usualM(destToken)) {
|
|
124
|
-
const exchangeData = this.usualMIface.encodeFunctionData('wrap', [
|
|
125
|
-
recipient,
|
|
126
|
-
srcAmount,
|
|
127
|
-
]);
|
|
128
|
-
return {
|
|
129
|
-
needWrapNative: false,
|
|
130
|
-
dexFuncHasRecipient: true,
|
|
131
|
-
exchangeData,
|
|
132
|
-
targetExchange: this.config.usualMAddress,
|
|
133
|
-
returnAmountPos: undefined,
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
throw new Error('LOGIC ERROR');
|
|
137
|
-
}
|
|
138
|
-
async getTopPoolsForToken(tokenAddress, limit) {
|
|
139
|
-
const isSmartM = this.is_smartM(tokenAddress);
|
|
140
|
-
if (!isSmartM && !this.is_usualM(tokenAddress))
|
|
141
|
-
return [];
|
|
142
|
-
return [
|
|
143
|
-
{
|
|
144
|
-
exchange: this.dexKey,
|
|
145
|
-
address: this.config.usualMAddress,
|
|
146
|
-
connectorTokens: [
|
|
147
|
-
{
|
|
148
|
-
decimals: 6,
|
|
149
|
-
address: isSmartM
|
|
150
|
-
? this.config.usualMAddress
|
|
151
|
-
: this.config.smartMAddress,
|
|
152
|
-
},
|
|
153
|
-
],
|
|
154
|
-
liquidityUSD: 1000000000, // Just returning a big number so this DEX will be preferred
|
|
155
|
-
},
|
|
156
|
-
];
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
exports.UsualMSmartM1 = UsualMSmartM1;
|
|
160
|
-
UsualMSmartM1.dexKeysWithNetwork = (0, utils_1.getDexKeysWithNetwork)(config_1.UsualMSmartMConfig);
|
|
161
|
-
//# sourceMappingURL=usual-m-smart-m.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usual-m-smart-m.js","sourceRoot":"","sources":["../../../src/dex/usual-m-smart-m/usual-m-smart-m.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,+CAAoD;AACpD,2EAA6D;AAC7D,uCAAoD;AAIpD,wDAAoD;AACpD,qCAA8C;AAC9C,4CAA6D;AAC7D,gGAAmE;AACnE,6DAAiD;AAEjD,MAAa,aACX,SAAQ,gCAAc;IAetB,YACW,OAAgB,EAChB,MAAc,EACd,SAAqB;QAE9B,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAJhB,YAAO,GAAP,OAAO,CAAS;QAChB,WAAM,G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MAAM;gBACrB,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa;gBAClC,eAAe,EAAE;oBACf;wBACE,QAAQ,EAAE,CAAC;wBACX,OAAO,EAAE,QAAQ;4BACf,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa;4BAC3B,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa;qBAC9B;iBACF;gBACD,YAAY,EAAE,UAAU,EAAE,4DAA4D;aACvF;SACF,CAAC;IACJ,CAAC;;AA9LH,sCA+LC;AArLe,gCAAkB,GAC9B,IAAA,6BAAqB,EAAC,2BAAkB,CAAC,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UsualMUsd0Config = void 0;
|
|
4
|
-
const constants_1 = require("../../constants");
|
|
5
|
-
exports.UsualMUsd0Config = {
|
|
6
|
-
UsualMUsd0: {
|
|
7
|
-
[constants_1.Network.MAINNET]: {
|
|
8
|
-
usualMAddress: '0xFe274C305b365dC38e188E8f01c4FAe2171ce927',
|
|
9
|
-
usd0Address: '0x73A15FeD60Bf67631dC6cd7Bc5B6e8da8190aCF5',
|
|
10
|
-
usualDaoCollateralAddress: '0xde6e1F680C4816446C8D515989E2358636A38b04',
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/dex/usual-m-usd0/config.ts"],"names":[],"mappings":";;;AAEA,+CAAoD;AAEvC,QAAA,gBAAgB,GAA4B;IACvD,UAAU,EAAE;QACV,CAAC,mBAAO,CAAC,OAAO,CAAC,EAAE;YACjB,aAAa,EAAE,4CAA4C;YAC3D,WAAW,EAAE,4CAA4C;YACzD,yBAAyB,EAAE,4CAA4C;SACxE;KACF;CACF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/dex/usual-m-usd0/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Token, Address, ExchangePrices, PoolPrices, AdapterExchangeParam, Logger, NumberAsString, DexExchangeParam, PoolLiquidity } from '../../types';
|
|
2
|
-
import { SwapSide, Network } from '../../constants';
|
|
3
|
-
import { IDex } from '../idex';
|
|
4
|
-
import { IDexHelper } from '../../dex-helper/idex-helper';
|
|
5
|
-
import { UsualMUsd0Data, DexParams } from './types';
|
|
6
|
-
import { SimpleExchange } from '../simple-exchange';
|
|
7
|
-
import { Interface } from '@ethersproject/abi';
|
|
8
|
-
export declare class UsualMUsd01 extends SimpleExchange implements IDex<UsualMUsd0Data> {
|
|
9
|
-
readonly network: Network;
|
|
10
|
-
readonly dexKey: string;
|
|
11
|
-
readonly dexHelper: IDexHelper;
|
|
12
|
-
protected config: DexParams;
|
|
13
|
-
readonly hasConstantPriceLargeAmounts = true;
|
|
14
|
-
readonly needWrapNative = false;
|
|
15
|
-
readonly isFeeOnTransferSupported = false;
|
|
16
|
-
static dexKeysWithNetwork: {
|
|
17
|
-
key: string;
|
|
18
|
-
networks: Network[];
|
|
19
|
-
}[];
|
|
20
|
-
usualDaoCollateralIface: Interface;
|
|
21
|
-
logger: Logger;
|
|
22
|
-
constructor(network: Network, dexKey: string, dexHelper: IDexHelper);
|
|
23
|
-
initializePricing(blockNumber: number): Promise<void>;
|
|
24
|
-
getConfig(): DexParams;
|
|
25
|
-
is_usualM(token: string): boolean;
|
|
26
|
-
is_usd0(token: string): boolean;
|
|
27
|
-
is_usd0_swap_token(srcToken: string, destToken: string): boolean;
|
|
28
|
-
getAdapters(): 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<UsualMUsd0Data>>;
|
|
31
|
-
getCalldataGasCost(poolPrices: PoolPrices<UsualMUsd0Data>): number | number[];
|
|
32
|
-
getAdapterParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: UsualMUsd0Data, side: SwapSide): AdapterExchangeParam;
|
|
33
|
-
getDexParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, recipient: Address, data: UsualMUsd0Data, side: SwapSide): Promise<DexExchangeParam>;
|
|
34
|
-
getTopPoolsForToken(tokenAddress: Address, limit: number): Promise<PoolLiquidity[]>;
|
|
35
|
-
}
|
|
@@ -1,159 +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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.UsualMUsd01 = void 0;
|
|
30
|
-
const constants_1 = require("../../constants");
|
|
31
|
-
const CALLDATA_GAS_COST = __importStar(require("../../calldata-gas-cost"));
|
|
32
|
-
const utils_1 = require("../../utils");
|
|
33
|
-
const simple_exchange_1 = require("../simple-exchange");
|
|
34
|
-
const config_1 = require("./config");
|
|
35
|
-
const abi_1 = require("@ethersproject/abi");
|
|
36
|
-
const usualCollateralDao_abi_json_1 = __importDefault(require("../../abi/usual-m-usd0/usualCollateralDao.abi.json"));
|
|
37
|
-
const bigint_constants_1 = require("../../bigint-constants");
|
|
38
|
-
class UsualMUsd01 extends simple_exchange_1.SimpleExchange {
|
|
39
|
-
constructor(network, dexKey, dexHelper) {
|
|
40
|
-
super(dexHelper, dexKey);
|
|
41
|
-
this.network = network;
|
|
42
|
-
this.dexKey = dexKey;
|
|
43
|
-
this.dexHelper = dexHelper;
|
|
44
|
-
this.hasConstantPriceLargeAmounts = true;
|
|
45
|
-
this.needWrapNative = false;
|
|
46
|
-
this.isFeeOnTransferSupported = false;
|
|
47
|
-
const config = config_1.UsualMUsd0Config[dexKey][network];
|
|
48
|
-
this.usualDaoCollateralIface = new abi_1.Interface(usualCollateralDao_abi_json_1.default);
|
|
49
|
-
this.config = {
|
|
50
|
-
usualMAddress: config.usualMAddress.toLowerCase(),
|
|
51
|
-
usd0Address: config.usd0Address.toLowerCase(),
|
|
52
|
-
usualDaoCollateralAddress: config.usualDaoCollateralAddress.toLowerCase(),
|
|
53
|
-
};
|
|
54
|
-
this.logger = dexHelper.getLogger(dexKey);
|
|
55
|
-
}
|
|
56
|
-
async initializePricing(blockNumber) {
|
|
57
|
-
// No initialization needed for constant price
|
|
58
|
-
}
|
|
59
|
-
getConfig() {
|
|
60
|
-
return this.config;
|
|
61
|
-
}
|
|
62
|
-
is_usualM(token) {
|
|
63
|
-
return token.toLowerCase() === this.config.usualMAddress.toLowerCase();
|
|
64
|
-
}
|
|
65
|
-
is_usd0(token) {
|
|
66
|
-
return token.toLowerCase() === this.config.usd0Address.toLowerCase();
|
|
67
|
-
}
|
|
68
|
-
is_usd0_swap_token(srcToken, destToken) {
|
|
69
|
-
return this.is_usualM(srcToken) && this.is_usd0(destToken);
|
|
70
|
-
}
|
|
71
|
-
getAdapters() {
|
|
72
|
-
return null;
|
|
73
|
-
}
|
|
74
|
-
async getPoolIdentifiers(srcToken, destToken, side, blockNumber) {
|
|
75
|
-
if (!srcToken || !destToken) {
|
|
76
|
-
this.logger.error('Source or destination token is undefined');
|
|
77
|
-
return [];
|
|
78
|
-
}
|
|
79
|
-
const srcTokenAddress = srcToken.address?.toLowerCase();
|
|
80
|
-
const destTokenAddress = destToken.address?.toLowerCase();
|
|
81
|
-
if (!srcTokenAddress || !destTokenAddress) {
|
|
82
|
-
this.logger.error('Source or destination token address is undefined');
|
|
83
|
-
return [];
|
|
84
|
-
}
|
|
85
|
-
if (this.is_usd0_swap_token(srcTokenAddress, destTokenAddress)) {
|
|
86
|
-
return [`${this.dexKey}_${this.config.usd0Address}`];
|
|
87
|
-
}
|
|
88
|
-
return [];
|
|
89
|
-
}
|
|
90
|
-
async getPricesVolume(srcToken, destToken, amounts, side, blockNumber, limitPools) {
|
|
91
|
-
if (side === constants_1.SwapSide.BUY) {
|
|
92
|
-
return null;
|
|
93
|
-
}
|
|
94
|
-
const isUsd0SwapToken = this.is_usd0_swap_token(srcToken.address, destToken.address);
|
|
95
|
-
if (!isUsd0SwapToken) {
|
|
96
|
-
return null;
|
|
97
|
-
}
|
|
98
|
-
const unitOut = bigint_constants_1.BI_POWS[18]; // 1:1 swap
|
|
99
|
-
const amountsOut = amounts; // 1:1 swap, so output amounts are the same as input
|
|
100
|
-
return [
|
|
101
|
-
{
|
|
102
|
-
unit: unitOut,
|
|
103
|
-
prices: amountsOut,
|
|
104
|
-
data: {},
|
|
105
|
-
poolAddresses: [this.config.usd0Address],
|
|
106
|
-
exchange: this.dexKey,
|
|
107
|
-
gasCost: 70000,
|
|
108
|
-
poolIdentifier: this.dexKey,
|
|
109
|
-
},
|
|
110
|
-
];
|
|
111
|
-
}
|
|
112
|
-
getCalldataGasCost(poolPrices) {
|
|
113
|
-
return CALLDATA_GAS_COST.DEX_NO_PAYLOAD;
|
|
114
|
-
}
|
|
115
|
-
getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
|
|
116
|
-
const payload = '0x';
|
|
117
|
-
return {
|
|
118
|
-
targetExchange: this.config.usualMAddress,
|
|
119
|
-
payload,
|
|
120
|
-
networkFee: '0',
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
async getDexParam(srcToken, destToken, srcAmount, destAmount, recipient, data, side) {
|
|
124
|
-
if (this.is_usualM(srcToken) && this.is_usd0(destToken)) {
|
|
125
|
-
const exchangeData = this.usualDaoCollateralIface.encodeFunctionData('swap', [srcToken, srcAmount, destAmount]);
|
|
126
|
-
return {
|
|
127
|
-
needWrapNative: false,
|
|
128
|
-
dexFuncHasRecipient: false,
|
|
129
|
-
exchangeData,
|
|
130
|
-
targetExchange: this.config.usualDaoCollateralAddress,
|
|
131
|
-
returnAmountPos: undefined,
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
throw new Error('LOGIC ERROR');
|
|
135
|
-
}
|
|
136
|
-
async getTopPoolsForToken(tokenAddress, limit) {
|
|
137
|
-
const isUsualM = this.is_usualM(tokenAddress);
|
|
138
|
-
if (!isUsualM && !this.is_usd0(tokenAddress))
|
|
139
|
-
return [];
|
|
140
|
-
return [
|
|
141
|
-
{
|
|
142
|
-
exchange: this.dexKey,
|
|
143
|
-
address: this.config.usualMAddress,
|
|
144
|
-
connectorTokens: [
|
|
145
|
-
{
|
|
146
|
-
decimals: isUsualM ? 6 : 18,
|
|
147
|
-
address: isUsualM
|
|
148
|
-
? this.config.usd0Address
|
|
149
|
-
: this.config.usualMAddress,
|
|
150
|
-
},
|
|
151
|
-
],
|
|
152
|
-
liquidityUSD: 1000000000, // Just returning a big number so this DEX will be preferred
|
|
153
|
-
},
|
|
154
|
-
];
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
exports.UsualMUsd01 = UsualMUsd01;
|
|
158
|
-
UsualMUsd01.dexKeysWithNetwork = (0, utils_1.getDexKeysWithNetwork)(config_1.UsualMUsd0Config);
|
|
159
|
-
//# sourceMappingURL=usual-m-usd0.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usual-m-usd0.js","sourceRoot":"","sources":["../../../src/dex/usual-m-usd0/usual-m-usd0.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,+CAAoD;AACpD,2EAA6D;AAC7D,uCAAoD;AAIpD,wDAAoD;AACpD,qCAA4C;AAC5C,4CAA6D;AAC7D,qHAA0F;AAC1F,6DAAiD;AAEjD,MAAa,WAAY,SAAQ,gCAAc;IAa7C,YACW,OAAgB,EAChB,MAAc,EACd,SAAqB;QAE9B,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAJhB,YAAO,GAAP,OAAO,CAAS;QAChB,WAAM,GAAN,MAAM,CAAQ;QACd,cAAS,GAAT,SAAS,CAAY;QAbvB,iCAA4B,GAAG,IAAI,CAAC;QACpC,mBAAc,GAAG,KAAK,CAAC;QACvB,6BAAwB,GAAG,KAAK,CAAC;QAcxC,MAAM,MAAM,GAAG,yBAAgB,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC;QACjD,IAAI,CAAC,uBAAuB,GAAG,IAAI,eAAS,CAC1C,qCAA0C,CAC3C,CAAC;QACF,IAAI,CAAC,MAAM,GAAG;YACZ,aAAa,EAAE,MAAM,CAAC,aAAa,CAAC,WAAW,EAAE;YACjD,WAAW,EAAE,MAAM,CAAC,WAAW,C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F;SACF,CAAC;IACJ,CAAC;;AA9LH,kCA+LC;AAxLe,8BAAkB,GAC9B,IAAA,6BAAqB,EAAC,yBAAgB,CAAC,CAAC"}
|
package/build/lib/pub-sub.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import NodeCache from 'node-cache';
|
|
2
|
-
import { Network } from '../constants';
|
|
3
|
-
import { IDexHelper } from '../dex-helper';
|
|
4
|
-
type JsonPubSubMsg = {
|
|
5
|
-
expiresAt: number;
|
|
6
|
-
data: Record<string, unknown>;
|
|
7
|
-
};
|
|
8
|
-
type SetPubSubMsg = string[];
|
|
9
|
-
export declare class JsonPubSub {
|
|
10
|
-
private dexHelper;
|
|
11
|
-
private dexKey;
|
|
12
|
-
channel: string;
|
|
13
|
-
network: Network;
|
|
14
|
-
localCache: NodeCache;
|
|
15
|
-
constructor(dexHelper: IDexHelper, dexKey: string, channel: string);
|
|
16
|
-
initialize(): void;
|
|
17
|
-
subscribe(): void;
|
|
18
|
-
publish(data: Record<string, unknown>, ttl: number): void;
|
|
19
|
-
handleSubscription(json: JsonPubSubMsg): void;
|
|
20
|
-
getAndCache<T>(key: string): Promise<T | null>;
|
|
21
|
-
}
|
|
22
|
-
export declare class SetPubSub {
|
|
23
|
-
private dexHelper;
|
|
24
|
-
private dexKey;
|
|
25
|
-
channel: string;
|
|
26
|
-
network: Network;
|
|
27
|
-
set: Set<string>;
|
|
28
|
-
constructor(dexHelper: IDexHelper, dexKey: string, channel: string);
|
|
29
|
-
initialize(key: string): Promise<void>;
|
|
30
|
-
subscribe(): void;
|
|
31
|
-
publish(set: SetPubSubMsg): void;
|
|
32
|
-
handleSubscription(set: SetPubSubMsg): void;
|
|
33
|
-
has(key: string): Promise<boolean>;
|
|
34
|
-
}
|
|
35
|
-
export {};
|
package/build/lib/pub-sub.js
DELETED
|
@@ -1,106 +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.SetPubSub = exports.JsonPubSub = void 0;
|
|
7
|
-
const node_cache_1 = __importDefault(require("node-cache"));
|
|
8
|
-
class JsonPubSub {
|
|
9
|
-
dexHelper;
|
|
10
|
-
dexKey;
|
|
11
|
-
channel;
|
|
12
|
-
network;
|
|
13
|
-
localCache = new node_cache_1.default();
|
|
14
|
-
constructor(dexHelper, dexKey, channel) {
|
|
15
|
-
this.dexHelper = dexHelper;
|
|
16
|
-
this.dexKey = dexKey;
|
|
17
|
-
this.network = this.dexHelper.config.data.network;
|
|
18
|
-
this.channel = `${this.network}_${this.dexKey}_${channel}`;
|
|
19
|
-
}
|
|
20
|
-
initialize() {
|
|
21
|
-
this.subscribe();
|
|
22
|
-
}
|
|
23
|
-
subscribe() {
|
|
24
|
-
this.dexHelper.cache.subscribe(this.channel, (_, msg) => {
|
|
25
|
-
const decodedMsg = JSON.parse(msg);
|
|
26
|
-
this.handleSubscription(decodedMsg);
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
publish(data, ttl) {
|
|
30
|
-
const expiresAt = Math.round(Date.now() / 1000) + ttl;
|
|
31
|
-
this.dexHelper.cache.publish(this.channel, JSON.stringify({ expiresAt, data }));
|
|
32
|
-
}
|
|
33
|
-
handleSubscription(json) {
|
|
34
|
-
const { expiresAt, data } = json;
|
|
35
|
-
const now = Math.round(Date.now() / 1000);
|
|
36
|
-
// calculating ttl as message might come with the delay
|
|
37
|
-
const ttl = expiresAt - now;
|
|
38
|
-
const keys = Object.keys(data);
|
|
39
|
-
for (const key of keys) {
|
|
40
|
-
this.localCache.set(key, data[key], ttl);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
async getAndCache(key) {
|
|
44
|
-
const localValue = this.localCache.get(key);
|
|
45
|
-
if (localValue) {
|
|
46
|
-
return localValue;
|
|
47
|
-
}
|
|
48
|
-
const [value, ttl] = await Promise.all([
|
|
49
|
-
this.dexHelper.cache.get(this.dexKey, this.network, key),
|
|
50
|
-
this.dexHelper.cache.ttl(this.dexKey, this.network, key),
|
|
51
|
-
]);
|
|
52
|
-
if (value) {
|
|
53
|
-
// setting ttl same as in cache
|
|
54
|
-
// TODO-ps: check if ttl is not null
|
|
55
|
-
const parsedValue = JSON.parse(value);
|
|
56
|
-
this.localCache.set(key, parsedValue, Number(ttl));
|
|
57
|
-
return parsedValue;
|
|
58
|
-
}
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
exports.JsonPubSub = JsonPubSub;
|
|
63
|
-
class SetPubSub {
|
|
64
|
-
dexHelper;
|
|
65
|
-
dexKey;
|
|
66
|
-
channel;
|
|
67
|
-
network;
|
|
68
|
-
set = new Set();
|
|
69
|
-
constructor(dexHelper, dexKey, channel) {
|
|
70
|
-
this.dexHelper = dexHelper;
|
|
71
|
-
this.dexKey = dexKey;
|
|
72
|
-
this.network = this.dexHelper.config.data.network;
|
|
73
|
-
this.channel = `${this.network}_${this.dexKey}_${channel}`;
|
|
74
|
-
}
|
|
75
|
-
async initialize(key) {
|
|
76
|
-
// as there's no lazy load, we need to initialize the set
|
|
77
|
-
const initSet = await this.dexHelper.cache.smembers(key);
|
|
78
|
-
for (const member of initSet) {
|
|
79
|
-
this.set.add(member);
|
|
80
|
-
}
|
|
81
|
-
this.subscribe();
|
|
82
|
-
}
|
|
83
|
-
subscribe() {
|
|
84
|
-
this.dexHelper.cache.subscribe(this.channel, (_, msg) => {
|
|
85
|
-
const decodedMsg = JSON.parse(msg);
|
|
86
|
-
this.handleSubscription(decodedMsg);
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
publish(set) {
|
|
90
|
-
// as there's no lazy load, also store locally
|
|
91
|
-
for (const key of set) {
|
|
92
|
-
this.set.add(key);
|
|
93
|
-
}
|
|
94
|
-
this.dexHelper.cache.publish(this.channel, JSON.stringify(set));
|
|
95
|
-
}
|
|
96
|
-
handleSubscription(set) {
|
|
97
|
-
for (const key of set) {
|
|
98
|
-
this.set.add(key);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
async has(key) {
|
|
102
|
-
return this.set.has(key);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
exports.SetPubSub = SetPubSub;
|
|
106
|
-
//# sourceMappingURL=pub-sub.js.map
|
package/build/lib/pub-sub.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pub-sub.js","sourceRoot":"","sources":["../../src/lib/pub-sub.ts"],"names":[],"mappings":";;;;;;AAAA,4DAAmC;AAWnC,MAAa,UAAU;IAMX;IACA;IANV,OAAO,CAAS;IAChB,OAAO,CAAU;IACjB,UAAU,GAAc,IAAI,oBAAS,EAAE,CAAC;IAExC,YACU,SAAqB,EACrB,MAAc,EACtB,OAAe;QAFP,cAAS,GAAT,SAAS,CAAY;QACrB,WAAM,GAAN,MAAM,CAAQ;QAGtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;QAClD,IAAI,CAAC,OAAO,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,MAAM,IAAI,OAAO,EAAE,CAAC;IAC7D,CAAC;IAED,UAAU;QACR,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAED,SAAS;QACP,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE;YACtD,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAkB,CAAC;YACpD,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,CAAC,IAA6B,EAAE,GAAW;QAChD,MAAM,SAAS,GAAG,IAAI,CAAC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