@paraswap/dex-lib 4.6.3-bunniv2-pricing.0 → 4.6.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/build/abi/BProtocol.json +1155 -0
- package/build/abi/Jarvis.json +1172 -0
- package/build/abi/MStableAsset.json +1545 -0
- package/build/abi/OneInchLp.json +1304 -0
- package/build/abi/Onebit.json +736 -0
- package/build/abi/Shell.json +1294 -0
- package/build/abi/TraderJoeV2Router.json +50 -0
- package/build/abi/miro-migrator/MiroMigrator.abi.json +36 -19
- package/build/abi/wUSDM.json +757 -0
- package/build/abi/zrx.v2.json +1967 -0
- package/build/abi/zrx.v3.json +3454 -0
- package/build/abi/zrx.v4.json +2193 -0
- package/build/dex/OneInchLp.d.ts +24 -0
- package/build/dex/OneInchLp.js +43 -0
- package/build/dex/OneInchLp.js.map +1 -0
- package/build/dex/algebra/lib/AlgebraMath.js +3 -13
- package/build/dex/algebra/lib/AlgebraMath.js.map +1 -1
- package/build/dex/algebra/lib/TickManager.js +0 -5
- package/build/dex/algebra/lib/TickManager.js.map +1 -1
- package/build/dex/bProtocol/bProtocol.d.ts +15 -0
- package/build/dex/bProtocol/bProtocol.js +56 -0
- package/build/dex/bProtocol/bProtocol.js.map +1 -0
- package/build/dex/bProtocol/types.d.ts +11 -0
- package/build/dex/bProtocol/types.js +8 -0
- package/build/dex/bProtocol/types.js.map +1 -0
- package/build/dex/balancer-v3/getPoolsApi.js +6 -3
- package/build/dex/balancer-v3/getPoolsApi.js.map +1 -1
- package/build/dex/bunni-v2/bunni-v2-pool.d.ts +1 -2
- package/build/dex/bunni-v2/bunni-v2-pool.js +4 -14
- package/build/dex/bunni-v2/bunni-v2-pool.js.map +1 -1
- package/build/dex/bunni-v2/bunni-v2.d.ts +2 -4
- package/build/dex/bunni-v2/bunni-v2.js +22 -54
- package/build/dex/bunni-v2/bunni-v2.js.map +1 -1
- package/build/dex/bunni-v2/getOnChainState.d.ts +2 -3
- package/build/dex/bunni-v2/getOnChainState.js +2 -39
- package/build/dex/bunni-v2/getOnChainState.js.map +1 -1
- package/build/dex/bunni-v2/lib/Constants.d.ts +0 -1
- package/build/dex/bunni-v2/lib/Constants.js +1 -2
- package/build/dex/bunni-v2/lib/Constants.js.map +1 -1
- package/build/dex/bunni-v2/types.d.ts +0 -1
- package/build/dex/bunni-v2/utils.js +0 -1
- package/build/dex/bunni-v2/utils.js.map +1 -1
- package/build/dex/jarvis.d.ts +56 -0
- package/build/dex/jarvis.js +163 -0
- package/build/dex/jarvis.js.map +1 -0
- package/build/dex/mStable.d.ts +44 -0
- package/build/dex/mStable.js +75 -0
- package/build/dex/mStable.js.map +1 -0
- package/build/dex/miro-migrator/config.js +3 -10
- package/build/dex/miro-migrator/config.js.map +1 -1
- package/build/dex/miro-migrator/constants.d.ts +1 -0
- package/build/dex/miro-migrator/constants.js +2 -1
- package/build/dex/miro-migrator/constants.js.map +1 -1
- package/build/dex/miro-migrator/miro-migrator-pool.d.ts +8 -5
- package/build/dex/miro-migrator/miro-migrator-pool.js +48 -30
- package/build/dex/miro-migrator/miro-migrator-pool.js.map +1 -1
- package/build/dex/miro-migrator/miro-migrator.d.ts +5 -4
- package/build/dex/miro-migrator/miro-migrator.js +40 -83
- package/build/dex/miro-migrator/miro-migrator.js.map +1 -1
- package/build/dex/miro-migrator/types.d.ts +2 -4
- package/build/dex/miro-migrator/types.js +1 -2
- package/build/dex/miro-migrator/types.js.map +1 -1
- package/build/dex/onebit/onebit.d.ts +16 -0
- package/build/dex/onebit/onebit.js +61 -0
- package/build/dex/onebit/onebit.js.map +1 -0
- package/build/dex/onebit/types.d.ts +14 -0
- package/build/dex/onebit/types.js +8 -0
- package/build/dex/onebit/types.js.map +1 -0
- package/build/dex/pancakeswap-v3/contract-math/Tick.d.ts +1 -1
- package/build/dex/pancakeswap-v3/contract-math/Tick.js +1 -10
- package/build/dex/pancakeswap-v3/contract-math/Tick.js.map +1 -1
- package/build/dex/pancakeswap-v3/contract-math/pancakeswap-v3-math.js +3 -11
- package/build/dex/pancakeswap-v3/contract-math/pancakeswap-v3-math.js.map +1 -1
- package/build/dex/shell.d.ts +25 -0
- package/build/dex/shell.js +41 -0
- package/build/dex/shell.js.map +1 -0
- package/build/dex/trader-joe-v2.d.ts +40 -0
- package/build/dex/trader-joe-v2.js +74 -0
- package/build/dex/trader-joe-v2.js.map +1 -0
- package/build/dex/uniswap-v3/contract-math/Tick.d.ts +1 -1
- package/build/dex/uniswap-v3/contract-math/Tick.js +1 -10
- package/build/dex/uniswap-v3/contract-math/Tick.js.map +1 -1
- package/build/dex/uniswap-v3/contract-math/uniswap-v3-math.js +3 -11
- package/build/dex/uniswap-v3/contract-math/uniswap-v3-math.js.map +1 -1
- package/build/dex/uniswap-v3/contract-math/utils.js +0 -3
- package/build/dex/uniswap-v3/contract-math/utils.js.map +1 -1
- package/build/dex/uniswap-v3/types.d.ts +0 -3
- package/build/dex/uniswap-v3/types.js.map +1 -1
- package/build/dex/uniswap-v3/uniswap-v3-new.d.ts +94 -0
- package/build/dex/uniswap-v3/uniswap-v3-new.js +923 -0
- package/build/dex/uniswap-v3/uniswap-v3-new.js.map +1 -0
- package/build/dex/uniswap-v4/contract-math/Position.d.ts +0 -6
- package/build/dex/uniswap-v4/contract-math/Position.js +0 -29
- package/build/dex/uniswap-v4/contract-math/Position.js.map +1 -1
- package/build/dex/uniswap-v4/contract-math/Tick.d.ts +1 -1
- package/build/dex/uniswap-v4/contract-math/Tick.js +2 -17
- package/build/dex/uniswap-v4/contract-math/Tick.js.map +1 -1
- package/build/dex/uniswap-v4/contract-math/uniswap-v4-pool-math.d.ts +3 -8
- package/build/dex/uniswap-v4/contract-math/uniswap-v4-pool-math.js +8 -57
- package/build/dex/uniswap-v4/contract-math/uniswap-v4-pool-math.js.map +1 -1
- package/build/dex/uniswap-v4/types.d.ts +0 -10
- package/build/dex/uniswap-v4/uniswap-v4-pool.d.ts +4 -5
- package/build/dex/uniswap-v4/uniswap-v4-pool.js +4 -42
- package/build/dex/uniswap-v4/uniswap-v4-pool.js.map +1 -1
- package/build/dex/uniswap-v4/uniswap-v4.d.ts +2 -2
- package/build/dex/uniswap-v4/uniswap-v4.js +4 -17
- package/build/dex/uniswap-v4/uniswap-v4.js.map +1 -1
- package/build/dex/usual-bond/config.d.ts +3 -0
- package/build/dex/usual-bond/config.js +13 -0
- package/build/dex/usual-bond/config.js.map +1 -0
- package/build/dex/usual-bond/types.d.ts +7 -0
- package/build/dex/usual-bond/types.js +3 -0
- package/build/dex/usual-bond/types.js.map +1 -0
- package/build/dex/usual-bond/usual-bond.d.ts +35 -0
- package/build/dex/usual-bond/usual-bond.js +176 -0
- package/build/dex/usual-bond/usual-bond.js.map +1 -0
- package/build/dex/wusdm/config.d.ts +3 -0
- package/build/dex/wusdm/config.js +43 -0
- package/build/dex/wusdm/config.js.map +1 -0
- package/build/dex/wusdm/constants.d.ts +2 -0
- package/build/dex/wusdm/constants.js +6 -0
- package/build/dex/wusdm/constants.js.map +1 -0
- package/build/dex/wusdm/types.d.ts +18 -0
- package/build/dex/wusdm/types.js +11 -0
- package/build/dex/wusdm/types.js.map +1 -0
- package/build/dex/wusdm/wusdm-pool.d.ts +21 -0
- package/build/dex/wusdm/wusdm-pool.js +74 -0
- package/build/dex/wusdm/wusdm-pool.js.map +1 -0
- package/build/dex/wusdm/wusdm.d.ts +46 -0
- package/build/dex/wusdm/wusdm.js +243 -0
- package/build/dex/wusdm/wusdm.js.map +1 -0
- package/build/dex/zerox/config.d.ts +2 -0
- package/build/dex/zerox/config.js +33 -0
- package/build/dex/zerox/config.js.map +1 -0
- package/build/dex/zerox/index.d.ts +22 -0
- package/build/dex/zerox/index.js +225 -0
- package/build/dex/zerox/index.js.map +1 -0
- package/build/dex/zerox/order.d.ts +88 -0
- package/build/dex/zerox/order.js +53 -0
- package/build/dex/zerox/order.js.map +1 -0
- package/build/dex/zerox/types.d.ts +73 -0
- package/build/dex/zerox/types.js +21 -0
- package/build/dex/zerox/types.js.map +1 -0
- package/package.json +1 -1
- package/build/abi/pangolin-v3/PangolinV3StateMulticall.abi.json +0 -796
- package/build/abi/ring-v2/few-wrapped-token.json +0 -587
- package/build/abi/ring-v2/ring-v2-factory.json +0 -125
- package/build/abi/ring-v2/ring-v2-pool.json +0 -461
- package/build/abi/ring-v2/ring-v2-router.json +0 -332
- package/build/abi/uniswap-v4/hooks/cabalcoin-hook.abi.json +0 -682
- package/build/abi/uniswap-v4/hooks/fee-hook.abi.json +0 -1335
- package/build/dex/miro-migrator/miro-migrator-state.d.ts +0 -27
- package/build/dex/miro-migrator/miro-migrator-state.js +0 -89
- package/build/dex/miro-migrator/miro-migrator-state.js.map +0 -1
- package/build/dex/uniswap-v3/forks/pangolin-v3/utils.d.ts +0 -4
- package/build/dex/uniswap-v3/forks/pangolin-v3/utils.js +0 -56
- package/build/dex/uniswap-v3/forks/pangolin-v3/utils.js.map +0 -1
- package/build/dex/uniswap-v4/hooks/cabalcoin-hook/cabalcoin-hook-pool.d.ts +0 -7
- package/build/dex/uniswap-v4/hooks/cabalcoin-hook/cabalcoin-hook-pool.js +0 -28
- package/build/dex/uniswap-v4/hooks/cabalcoin-hook/cabalcoin-hook-pool.js.map +0 -1
- package/build/dex/uniswap-v4/hooks/cabalcoin-hook/types.d.ts +0 -0
- package/build/dex/uniswap-v4/hooks/cabalcoin-hook/types.js +0 -2
- package/build/dex/uniswap-v4/hooks/cabalcoin-hook/types.js.map +0 -1
- package/build/dex/uniswap-v4/hooks/fee-hook/fee-hook-pool.d.ts +0 -7
- package/build/dex/uniswap-v4/hooks/fee-hook/fee-hook-pool.js +0 -28
- package/build/dex/uniswap-v4/hooks/fee-hook/fee-hook-pool.js.map +0 -1
- package/build/dex/uniswap-v4/hooks/fee-hook/types.d.ts +0 -0
- package/build/dex/uniswap-v4/hooks/fee-hook/types.js +0 -2
- package/build/dex/uniswap-v4/hooks/fee-hook/types.js.map +0 -1
- package/build/dex/uniswap-v4/hooks/index.d.ts +0 -2
- package/build/dex/uniswap-v4/hooks/index.js +0 -8
- package/build/dex/uniswap-v4/hooks/index.js.map +0 -1
- package/build/dex/usdc-transmuter/usdc-transmuter-pool.d.ts +0 -26
- package/build/dex/usdc-transmuter/usdc-transmuter-pool.js +0 -75
- package/build/dex/usdc-transmuter/usdc-transmuter-pool.js.map +0 -1
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Interface } from '@ethersproject/abi';
|
|
2
|
-
import { DeepReadonly } from 'ts-essentials';
|
|
3
|
-
import { Log, Logger } from '../../types';
|
|
4
|
-
import { StatefulEventSubscriber } from '../../stateful-event-subscriber';
|
|
5
|
-
import { IDexHelper } from '../../dex-helper/idex-helper';
|
|
6
|
-
import { MiroMigratorState } from './types';
|
|
7
|
-
export declare class MiroMigratorEventState extends StatefulEventSubscriber<MiroMigratorState> {
|
|
8
|
-
readonly parentName: string;
|
|
9
|
-
protected network: number;
|
|
10
|
-
protected dexHelper: IDexHelper;
|
|
11
|
-
protected migratorAddress: string;
|
|
12
|
-
protected xyzAddress: string;
|
|
13
|
-
protected transferTopic: string;
|
|
14
|
-
protected migratorInterface: Interface;
|
|
15
|
-
protected xyzInterface: Interface;
|
|
16
|
-
handlers: {
|
|
17
|
-
[event: string]: (event: any, state: DeepReadonly<MiroMigratorState>, log: Readonly<Log>) => DeepReadonly<MiroMigratorState> | null;
|
|
18
|
-
};
|
|
19
|
-
logDecoder: (log: Log) => any;
|
|
20
|
-
addressesSubscribed: string[];
|
|
21
|
-
constructor(parentName: string, network: number, dexHelper: IDexHelper, logger: Logger, migratorAddress: string, xyzAddress: string, transferTopic: string, migratorInterface?: Interface, xyzInterface?: Interface);
|
|
22
|
-
protected processLog(state: DeepReadonly<MiroMigratorState>, log: Readonly<Log>): Promise<DeepReadonly<MiroMigratorState> | null>;
|
|
23
|
-
generateState(blockNumber?: number | 'latest'): Promise<DeepReadonly<MiroMigratorState>>;
|
|
24
|
-
getOrGenerateState(blockNumber: number): Promise<MiroMigratorState>;
|
|
25
|
-
handleTransferTo(event: any, state: DeepReadonly<MiroMigratorState>, log: Readonly<Log>): Promise<DeepReadonly<MiroMigratorState>>;
|
|
26
|
-
handleTransferFrom(event: any, state: DeepReadonly<MiroMigratorState>, log: Readonly<Log>): Promise<DeepReadonly<MiroMigratorState>>;
|
|
27
|
-
}
|
|
@@ -1,89 +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.MiroMigratorEventState = void 0;
|
|
7
|
-
const abi_1 = require("@ethersproject/abi");
|
|
8
|
-
const utils_1 = require("../../utils");
|
|
9
|
-
const stateful_event_subscriber_1 = require("../../stateful-event-subscriber");
|
|
10
|
-
const decoders_1 = require("../../lib/decoders");
|
|
11
|
-
const MiroMigrator_abi_json_1 = __importDefault(require("../../abi/miro-migrator/MiroMigrator.abi.json"));
|
|
12
|
-
const erc20_json_1 = __importDefault(require("../../abi/erc20.json"));
|
|
13
|
-
class MiroMigratorEventState extends stateful_event_subscriber_1.StatefulEventSubscriber {
|
|
14
|
-
parentName;
|
|
15
|
-
network;
|
|
16
|
-
dexHelper;
|
|
17
|
-
migratorAddress;
|
|
18
|
-
xyzAddress;
|
|
19
|
-
transferTopic;
|
|
20
|
-
migratorInterface;
|
|
21
|
-
xyzInterface;
|
|
22
|
-
handlers = {};
|
|
23
|
-
logDecoder;
|
|
24
|
-
addressesSubscribed;
|
|
25
|
-
constructor(parentName, network, dexHelper, logger, migratorAddress, xyzAddress, transferTopic, migratorInterface = new abi_1.Interface(MiroMigrator_abi_json_1.default), xyzInterface = new abi_1.Interface(erc20_json_1.default)) {
|
|
26
|
-
super(parentName, 'state', dexHelper, logger);
|
|
27
|
-
this.parentName = parentName;
|
|
28
|
-
this.network = network;
|
|
29
|
-
this.dexHelper = dexHelper;
|
|
30
|
-
this.migratorAddress = migratorAddress;
|
|
31
|
-
this.xyzAddress = xyzAddress;
|
|
32
|
-
this.transferTopic = transferTopic;
|
|
33
|
-
this.migratorInterface = migratorInterface;
|
|
34
|
-
this.xyzInterface = xyzInterface;
|
|
35
|
-
this.logDecoder = (log) => this.migratorInterface.parseLog(log);
|
|
36
|
-
this.addressesSubscribed = [xyzAddress];
|
|
37
|
-
}
|
|
38
|
-
async processLog(state, log) {
|
|
39
|
-
try {
|
|
40
|
-
const event = this.logDecoder(log);
|
|
41
|
-
if (log.topics[0] === this.transferTopic &&
|
|
42
|
-
event.args.to.toLowerCase() === this.migratorAddress.toLowerCase()) {
|
|
43
|
-
return this.handleTransferTo(event, state, log);
|
|
44
|
-
}
|
|
45
|
-
if (log.topics[0] === this.transferTopic &&
|
|
46
|
-
event.args.from.toLowerCase() === this.migratorAddress.toLowerCase()) {
|
|
47
|
-
return this.handleTransferFrom(event, state, log);
|
|
48
|
-
}
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
51
|
-
catch (e) {
|
|
52
|
-
(0, utils_1.catchParseLogError)(e, this.logger);
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
async generateState(blockNumber = 'latest') {
|
|
57
|
-
const calls = [
|
|
58
|
-
{
|
|
59
|
-
target: this.xyzAddress,
|
|
60
|
-
callData: this.xyzInterface.encodeFunctionData('balanceOf', [
|
|
61
|
-
this.migratorAddress,
|
|
62
|
-
]),
|
|
63
|
-
decodeFunction: decoders_1.uint256ToBigInt,
|
|
64
|
-
},
|
|
65
|
-
];
|
|
66
|
-
const [balance] = await this.dexHelper.multiWrapper.tryAggregate(true, calls, blockNumber);
|
|
67
|
-
return { balance: balance.returnData };
|
|
68
|
-
}
|
|
69
|
-
async getOrGenerateState(blockNumber) {
|
|
70
|
-
let state = this.getState(blockNumber);
|
|
71
|
-
if (!state) {
|
|
72
|
-
state = await this.generateState(blockNumber);
|
|
73
|
-
this.setState(state, blockNumber);
|
|
74
|
-
}
|
|
75
|
-
return state;
|
|
76
|
-
}
|
|
77
|
-
async handleTransferTo(event, state, log) {
|
|
78
|
-
return {
|
|
79
|
-
balance: state.balance + BigInt(event.args.value),
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
async handleTransferFrom(event, state, log) {
|
|
83
|
-
return {
|
|
84
|
-
balance: state.balance - BigInt(event.args.value),
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
exports.MiroMigratorEventState = MiroMigratorEventState;
|
|
89
|
-
//# sourceMappingURL=miro-migrator-state.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"miro-migrator-state.js","sourceRoot":"","sources":["../../../src/dex/miro-migrator/miro-migrator-state.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA+C;AAG/C,uCAAiD;AACjD,+EAA0E;AAG1E,iDAAqD;AACrD,0GAA4E;AAC5E,sEAA4C;AAE5C,MAAa,sBAAuB,SAAQ,mDAA0C;IAczE;IACC;IACA;IAEA;IACA;IACA;IACA;IACA;IArBZ,QAAQ,GAMJ,EAAE,CAAC;IAEP,UAAU,CAAoB;IAE9B,mBAAmB,CAAW;IAE9B,YACW,UAAkB,EACjB,OAAe,EACf,SAAqB,EAC/B,MAAc,EACJ,eAAuB,EACvB,UAAkB,EAClB,aAAqB,EACrB,oBAA+B,IAAI,eAAS,CAAC,+BAAe,CAAC,EAC7D,eAA0B,IAAI,eAAS,CAAC,oBAAQ,CAAC;QAE3D,KAAK,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;QAVrC,eAAU,GAAV,UAAU,CAAQ;QACjB,YAAO,GAAP,OAAO,CAAQ;QACf,cAAS,GAAT,SAAS,CAAY;QAErB,oBAAe,GAAf,eAAe,CAAQ;QACvB,eAAU,GAAV,UAAU,CAAQ;QAClB,kBAAa,GAAb,aAAa,CAAQ;QACrB,sBAAiB,GAAjB,iBAAiB,CAA4C;QAC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kBAAkB,CAAC,WAAW,EAAE;oBAC1D,IAAI,CAAC,eAAe;iBACrB,CAAC;gBACF,cAAc,EAAE,0BAAe;aAChC;SACF,CAAC;QAEF,MAAM,CAAC,OAAO,CAAC,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,YAAY,CAC9D,IAAI,EACJ,KAAK,EACL,WAAW,CACZ,CAAC;QAEF,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,WAAmB;QAC1C,IAAI,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QACvC,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,KAAK,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;YAC9C,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QACpC,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,KAAK,CAAC,gBAAgB,CACpB,KAAU,EACV,KAAsC,EACtC,GAAkB;QAElB,OAAO;YACL,OAAO,EAAE,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;SAClD,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,kBAAkB,CACtB,KAAU,EACV,KAAsC,EACtC,GAAkB;QAElB,OAAO;YACL,OAAO,EAAE,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;SAClD,CAAC;IACJ,CAAC;CACF;AA3GD,wDA2GC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { MultiResult } from '../../../../lib/multi-wrapper';
|
|
2
|
-
import { BytesLike } from 'ethers';
|
|
3
|
-
import { DecodedStateMultiCallResultWithRelativeBitmaps } from '../../types';
|
|
4
|
-
export declare function decodeStateMultiCallResultWithRelativeBitmaps(result: MultiResult<BytesLike> | BytesLike): DecodedStateMultiCallResultWithRelativeBitmaps;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.decodeStateMultiCallResultWithRelativeBitmaps = decodeStateMultiCallResultWithRelativeBitmaps;
|
|
4
|
-
const ethers_1 = require("ethers");
|
|
5
|
-
const decoders_1 = require("../../../../lib/decoders");
|
|
6
|
-
const ts_essentials_1 = require("ts-essentials");
|
|
7
|
-
function decodeStateMultiCallResultWithRelativeBitmaps(result) {
|
|
8
|
-
const [isSuccess, toDecode] = (0, decoders_1.extractSuccessAndValue)(result);
|
|
9
|
-
(0, ts_essentials_1.assert)(isSuccess && toDecode !== '0x', `decodeStateMultiCallResultWithRelativeBitmaps failed to get decodable result: ${result}`);
|
|
10
|
-
const decoded = ethers_1.ethers.utils.defaultAbiCoder.decode([
|
|
11
|
-
// I don't want to pass here any interface, so I just use it in ethers format
|
|
12
|
-
`
|
|
13
|
-
tuple(
|
|
14
|
-
address pool,
|
|
15
|
-
uint256 blockTimestamp,
|
|
16
|
-
tuple(
|
|
17
|
-
uint160 sqrtPriceX96,
|
|
18
|
-
int24 tick,
|
|
19
|
-
uint16 observationIndex,
|
|
20
|
-
uint16 observationCardinality,
|
|
21
|
-
uint16 observationCardinalityNext,
|
|
22
|
-
uint8 feeProtocol,
|
|
23
|
-
bool unlocked
|
|
24
|
-
) slot0,
|
|
25
|
-
uint128 liquidity,
|
|
26
|
-
int24 tickSpacing,
|
|
27
|
-
uint128 maxLiquidityPerTick,
|
|
28
|
-
tuple(
|
|
29
|
-
uint32 blockTimestamp,
|
|
30
|
-
int56 tickCumulative,
|
|
31
|
-
uint160 secondsPerLiquidityCumulativeX128,
|
|
32
|
-
bool initialized
|
|
33
|
-
) observation,
|
|
34
|
-
tuple(
|
|
35
|
-
int16 index,
|
|
36
|
-
uint256 value
|
|
37
|
-
)[] tickBitmap,
|
|
38
|
-
tuple(
|
|
39
|
-
int24 index,
|
|
40
|
-
tuple(
|
|
41
|
-
uint128 liquidityGross,
|
|
42
|
-
int128 liquidityNet,
|
|
43
|
-
int56 tickCumulativeOutside,
|
|
44
|
-
uint160 secondsPerLiquidityOutsideX128,
|
|
45
|
-
uint32 secondsOutside,
|
|
46
|
-
bool initialized
|
|
47
|
-
) value
|
|
48
|
-
)[] ticks
|
|
49
|
-
)
|
|
50
|
-
`,
|
|
51
|
-
], toDecode)[0];
|
|
52
|
-
// This conversion is not precise, because when we decode, we have more values
|
|
53
|
-
// But I typed only the ones that are used later
|
|
54
|
-
return decoded;
|
|
55
|
-
}
|
|
56
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/dex/uniswap-v3/forks/pangolin-v3/utils.ts"],"names":[],"mappings":";;AAMA,sGA2DC;AAhED,mCAA2C;AAE3C,uDAAkE;AAClE,iDAAuC;AAEvC,SAAgB,6CAA6C,CAC3D,MAA0C;IAE1C,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,GAAG,IAAA,iCAAsB,EAAC,MAAM,CAAC,CAAC;IAE7D,IAAA,sBAAM,EACJ,SAAS,IAAI,QAAQ,KAAK,IAAI,EAC9B,iFAAiF,MAAM,EAAE,CAC1F,CAAC;IAEF,MAAM,OAAO,GAAG,eAAM,CAAC,KAAK,CAAC,eAAe,CAAC,MAAM,CACjD;QACE,6EAA6E;QAC7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAsCD;KACA,EACD,QAAQ,CACT,CAAC,CAAC,CAAC,CAAC;IAEL,8EAA8E;IAC9E,gDAAgD;IAChD,OAAO,OAAyD,CAAC;AACnE,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { UniswapV4Pool } from '../../uniswap-v4-pool';
|
|
2
|
-
import { PoolState } from '../../types';
|
|
3
|
-
export declare class CabalcoinHookPool extends UniswapV4Pool {
|
|
4
|
-
private hookInterface;
|
|
5
|
-
constructor(...args: ConstructorParameters<typeof UniswapV4Pool>);
|
|
6
|
-
handleCustomFeeChangedEvent(event: any, poolState: PoolState): Promise<PoolState>;
|
|
7
|
-
}
|
|
@@ -1,28 +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.CabalcoinHookPool = void 0;
|
|
7
|
-
const abi_1 = require("@ethersproject/abi");
|
|
8
|
-
const uniswap_v4_pool_1 = require("../../uniswap-v4-pool");
|
|
9
|
-
const uniswap_v4_pool_math_1 = require("../../contract-math/uniswap-v4-pool-math");
|
|
10
|
-
const cabalcoin_hook_abi_json_1 = __importDefault(require("../../../../abi/uniswap-v4/hooks/cabalcoin-hook.abi.json"));
|
|
11
|
-
class CabalcoinHookPool extends uniswap_v4_pool_1.UniswapV4Pool {
|
|
12
|
-
hookInterface = new abi_1.Interface(cabalcoin_hook_abi_json_1.default);
|
|
13
|
-
constructor(...args) {
|
|
14
|
-
super(...args);
|
|
15
|
-
this.addressesSubscribed.push(this.hooks);
|
|
16
|
-
this.logDecoders.push((log) => this.hookInterface.parseLog(log));
|
|
17
|
-
this.handlers['CustomFeeChanged'] =
|
|
18
|
-
this.handleCustomFeeChangedEvent.bind(this);
|
|
19
|
-
}
|
|
20
|
-
async handleCustomFeeChangedEvent(event, poolState) {
|
|
21
|
-
const id = event.args.id.toLowerCase();
|
|
22
|
-
uniswap_v4_pool_math_1.uniswapV4PoolMath.checkPoolInitialized(poolState);
|
|
23
|
-
poolState.fee = event.args.newFee.toString();
|
|
24
|
-
return poolState;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
exports.CabalcoinHookPool = CabalcoinHookPool;
|
|
28
|
-
//# sourceMappingURL=cabalcoin-hook-pool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cabalcoin-hook-pool.js","sourceRoot":"","sources":["../../../../../src/dex/uniswap-v4/hooks/cabalcoin-hook/cabalcoin-hook-pool.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA+C;AAC/C,2DAAsD;AAEtD,mFAA6E;AAE7E,uHAAwF;AAExF,MAAa,iBAAkB,SAAQ,+BAAa;IAC1C,aAAa,GAAG,IAAI,eAAS,CAAC,iCAAgB,CAAC,CAAC;IAExD,YAAY,GAAG,IAAiD;QAC9D,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;QAEf,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC1C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,GAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;QAEtE,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC;YAC/B,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;IAED,KAAK,CAAC,2BAA2B,CAAC,KAAU,EAAE,SAAoB;QAChE,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC;QACvC,wCAAiB,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAElD,SAAS,CAAC,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QAE7C,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AArBD,8CAqBC"}
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/dex/uniswap-v4/hooks/cabalcoin-hook/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { UniswapV4Pool } from '../../uniswap-v4-pool';
|
|
2
|
-
import { PoolState } from '../../types';
|
|
3
|
-
export declare class FeeHookPool extends UniswapV4Pool {
|
|
4
|
-
private hookInterface;
|
|
5
|
-
constructor(...args: ConstructorParameters<typeof UniswapV4Pool>);
|
|
6
|
-
handleCustomFeeChangedEvent(event: any, poolState: PoolState): Promise<PoolState>;
|
|
7
|
-
}
|
|
@@ -1,28 +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.FeeHookPool = void 0;
|
|
7
|
-
const abi_1 = require("@ethersproject/abi");
|
|
8
|
-
const uniswap_v4_pool_1 = require("../../uniswap-v4-pool");
|
|
9
|
-
const uniswap_v4_pool_math_1 = require("../../contract-math/uniswap-v4-pool-math");
|
|
10
|
-
const fee_hook_abi_json_1 = __importDefault(require("../../../../abi/uniswap-v4/hooks/fee-hook.abi.json"));
|
|
11
|
-
class FeeHookPool extends uniswap_v4_pool_1.UniswapV4Pool {
|
|
12
|
-
hookInterface = new abi_1.Interface(fee_hook_abi_json_1.default);
|
|
13
|
-
constructor(...args) {
|
|
14
|
-
super(...args);
|
|
15
|
-
this.addressesSubscribed.push(this.hooks);
|
|
16
|
-
this.logDecoders.push((log) => this.hookInterface.parseLog(log));
|
|
17
|
-
this.handlers['CustomFeeChanged'] =
|
|
18
|
-
this.handleCustomFeeChangedEvent.bind(this);
|
|
19
|
-
}
|
|
20
|
-
async handleCustomFeeChangedEvent(event, poolState) {
|
|
21
|
-
const id = event.args.id.toLowerCase();
|
|
22
|
-
uniswap_v4_pool_math_1.uniswapV4PoolMath.checkPoolInitialized(poolState);
|
|
23
|
-
poolState.fee = event.args.newFee.toString();
|
|
24
|
-
return poolState;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
exports.FeeHookPool = FeeHookPool;
|
|
28
|
-
//# sourceMappingURL=fee-hook-pool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fee-hook-pool.js","sourceRoot":"","sources":["../../../../../src/dex/uniswap-v4/hooks/fee-hook/fee-hook-pool.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA+C;AAC/C,2DAAsD;AAEtD,mFAA6E;AAE7E,2GAA4E;AAE5E,MAAa,WAAY,SAAQ,+BAAa;IACpC,aAAa,GAAG,IAAI,eAAS,CAAC,2BAAU,CAAC,CAAC;IAElD,YAAY,GAAG,IAAiD;QAC9D,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;QAEf,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC1C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,GAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;QAEtE,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC;YAC/B,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;IAED,KAAK,CAAC,2BAA2B,CAAC,KAAU,EAAE,SAAoB;QAChE,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC;QACvC,wCAAiB,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAElD,SAAS,CAAC,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QAE7C,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AArBD,kCAqBC"}
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/dex/uniswap-v4/hooks/fee-hook/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CabalcoinHookPool = exports.FeeHookPool = void 0;
|
|
4
|
-
var fee_hook_pool_1 = require("./fee-hook/fee-hook-pool");
|
|
5
|
-
Object.defineProperty(exports, "FeeHookPool", { enumerable: true, get: function () { return fee_hook_pool_1.FeeHookPool; } });
|
|
6
|
-
var cabalcoin_hook_pool_1 = require("./cabalcoin-hook/cabalcoin-hook-pool");
|
|
7
|
-
Object.defineProperty(exports, "CabalcoinHookPool", { enumerable: true, get: function () { return cabalcoin_hook_pool_1.CabalcoinHookPool; } });
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/dex/uniswap-v4/hooks/index.ts"],"names":[],"mappings":";;;AAAA,0DAAuD;AAA9C,4GAAA,WAAW,OAAA;AACpB,4EAAyE;AAAhE,wHAAA,iBAAiB,OAAA"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Interface } from '@ethersproject/abi';
|
|
2
|
-
import { DeepReadonly } from 'ts-essentials';
|
|
3
|
-
import { Log, Logger } from '../../types';
|
|
4
|
-
import { StatefulEventSubscriber } from '../../stateful-event-subscriber';
|
|
5
|
-
import { IDexHelper } from '../../dex-helper/idex-helper';
|
|
6
|
-
import { PoolState } from './types';
|
|
7
|
-
import { Contract } from 'ethers';
|
|
8
|
-
export declare class UsdcTransmuterEventPool extends StatefulEventSubscriber<PoolState> {
|
|
9
|
-
readonly parentName: string;
|
|
10
|
-
protected network: number;
|
|
11
|
-
protected dexHelper: IDexHelper;
|
|
12
|
-
protected usdcTransmuterAddress: string;
|
|
13
|
-
protected usdcAddress: string;
|
|
14
|
-
protected usdcTransmuterIface: Interface;
|
|
15
|
-
protected usdcContract: Contract;
|
|
16
|
-
handlers: {
|
|
17
|
-
[event: string]: (event: any, state: DeepReadonly<PoolState>, log: Readonly<Log>) => DeepReadonly<PoolState> | null;
|
|
18
|
-
};
|
|
19
|
-
logDecoder: (log: Log) => any;
|
|
20
|
-
constructor(parentName: string, network: number, dexHelper: IDexHelper, logger: Logger, usdcTransmuterAddress: string, usdcAddress: string, usdcTransmuterIface?: Interface, usdcContract?: Contract);
|
|
21
|
-
protected processLog(state: DeepReadonly<PoolState>, log: Readonly<Log>): DeepReadonly<PoolState> | null;
|
|
22
|
-
generateState(blockNumber?: number | 'latest'): Promise<DeepReadonly<PoolState>>;
|
|
23
|
-
getOrGenerateState(blockNumber: number): Promise<PoolState>;
|
|
24
|
-
handleDeposit(event: any, state: DeepReadonly<PoolState>, log: Readonly<Log>): DeepReadonly<PoolState> | null;
|
|
25
|
-
handleWithdrawal(event: any, state: DeepReadonly<PoolState>, log: Readonly<Log>): DeepReadonly<PoolState> | null;
|
|
26
|
-
}
|
|
@@ -1,75 +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.UsdcTransmuterEventPool = void 0;
|
|
7
|
-
const abi_1 = require("@ethersproject/abi");
|
|
8
|
-
const utils_1 = require("../../utils");
|
|
9
|
-
const stateful_event_subscriber_1 = require("../../stateful-event-subscriber");
|
|
10
|
-
const usdc_transmuter_abi_json_1 = __importDefault(require("../../abi/usdc-transmuter/usdc-transmuter.abi.json"));
|
|
11
|
-
const utils_2 = require("../../lib/tokens/utils");
|
|
12
|
-
const ethers_1 = require("ethers");
|
|
13
|
-
class UsdcTransmuterEventPool extends stateful_event_subscriber_1.StatefulEventSubscriber {
|
|
14
|
-
parentName;
|
|
15
|
-
network;
|
|
16
|
-
dexHelper;
|
|
17
|
-
usdcTransmuterAddress;
|
|
18
|
-
usdcAddress;
|
|
19
|
-
usdcTransmuterIface;
|
|
20
|
-
usdcContract;
|
|
21
|
-
handlers = {};
|
|
22
|
-
logDecoder;
|
|
23
|
-
constructor(parentName, network, dexHelper, logger, usdcTransmuterAddress, usdcAddress, usdcTransmuterIface = new abi_1.Interface(usdc_transmuter_abi_json_1.default), usdcContract = new ethers_1.Contract(usdcAddress, utils_2.erc20Iface, dexHelper.provider)) {
|
|
24
|
-
super(parentName, 'usdc', dexHelper, logger);
|
|
25
|
-
this.parentName = parentName;
|
|
26
|
-
this.network = network;
|
|
27
|
-
this.dexHelper = dexHelper;
|
|
28
|
-
this.usdcTransmuterAddress = usdcTransmuterAddress;
|
|
29
|
-
this.usdcAddress = usdcAddress;
|
|
30
|
-
this.usdcTransmuterIface = usdcTransmuterIface;
|
|
31
|
-
this.usdcContract = usdcContract;
|
|
32
|
-
this.logDecoder = (log) => this.usdcTransmuterIface.parseLog(log);
|
|
33
|
-
this.addressesSubscribed = [usdcTransmuterAddress];
|
|
34
|
-
this.handlers['Deposit'] = this.handleDeposit.bind(this);
|
|
35
|
-
this.handlers['Withdraw'] = this.handleWithdrawal.bind(this);
|
|
36
|
-
}
|
|
37
|
-
processLog(state, log) {
|
|
38
|
-
try {
|
|
39
|
-
const event = this.logDecoder(log);
|
|
40
|
-
if (event.name in this.handlers) {
|
|
41
|
-
return this.handlers[event.name](event, state, log);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
catch (e) {
|
|
45
|
-
(0, utils_1.catchParseLogError)(e, this.logger);
|
|
46
|
-
}
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
49
|
-
async generateState(blockNumber = 'latest') {
|
|
50
|
-
const balance = await this.usdcContract.balanceOf(this.usdcTransmuterAddress, { blockTag: blockNumber });
|
|
51
|
-
return {
|
|
52
|
-
balance: balance.toBigInt(),
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
async getOrGenerateState(blockNumber) {
|
|
56
|
-
let state = this.getState(blockNumber);
|
|
57
|
-
if (!state) {
|
|
58
|
-
state = await this.generateState(blockNumber);
|
|
59
|
-
this.setState(state, blockNumber);
|
|
60
|
-
}
|
|
61
|
-
return state;
|
|
62
|
-
}
|
|
63
|
-
handleDeposit(event, state, log) {
|
|
64
|
-
return {
|
|
65
|
-
balance: state.balance + event.args.amount.toBigInt(),
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
handleWithdrawal(event, state, log) {
|
|
69
|
-
return {
|
|
70
|
-
balance: state.balance - event.args.amount.toBigInt(),
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
exports.UsdcTransmuterEventPool = UsdcTransmuterEventPool;
|
|
75
|
-
//# sourceMappingURL=usdc-transmuter-pool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usdc-transmuter-pool.js","sourceRoot":"","sources":["../../../src/dex/usdc-transmuter/usdc-transmuter-pool.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA+C;AAG/C,uCAAiD;AACjD,+EAA0E;AAG1E,kHAAmF;AACnF,kDAAoD;AACpD,mCAAkC;AAElC,MAAa,uBAAwB,SAAQ,mDAAkC;IAYlE;IACC;IACA;IAEA;IACA;IACA;IACA;IAlBZ,QAAQ,GAMJ,EAAE,CAAC;IAEP,UAAU,CAAoB;IAE9B,YACW,UAAkB,EACjB,OAAe,EACf,SAAqB,EAC/B,MAAc,EACJ,qBAA6B,EAC7B,WAAmB,EACnB,sBAAsB,IAAI,eAAS,CAAC,kCAAiB,CAAC,EACtD,eAAe,IAAI,iBAAQ,CACnC,WAAW,EACX,kBAAU,EACV,SAAS,CAAC,QAAQ,CACnB;QAED,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;QAbpC,eAAU,GAAV,UAAU,CAAQ;QACjB,YAAO,GAAP,OAAO,CAAQ;QACf,cAAS,GAAT,SAAS,CAAY;QAErB,0BAAqB,GAArB,qBAAqB,CAAQ;QAC7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