@whetstone-research/doppler-sdk 1.0.27 → 1.0.29
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/dist/{chunk-U6B52TBT.cjs → chunk-4CI2M2F6.cjs} +27 -2
- package/dist/chunk-4CI2M2F6.cjs.map +1 -0
- package/dist/{chunk-XTL2GBZ4.cjs → chunk-7PXLEMBJ.cjs} +439 -91
- package/dist/chunk-7PXLEMBJ.cjs.map +1 -0
- package/dist/{chunk-WD5VOZGI.js → chunk-AFXFT3BD.js} +24 -3
- package/dist/chunk-AFXFT3BD.js.map +1 -0
- package/dist/{chunk-RVDRWCJN.js → chunk-PSLY7M7C.js} +392 -63
- package/dist/chunk-PSLY7M7C.js.map +1 -0
- package/dist/evm/index.cjs +243 -175
- package/dist/evm/index.cjs.map +1 -1
- package/dist/evm/index.d.cts +36 -60
- package/dist/evm/index.d.ts +36 -60
- package/dist/evm/index.js +244 -176
- package/dist/evm/index.js.map +1 -1
- package/dist/{pda-H6VMGONM.cjs → pda-44IHEORD.cjs} +21 -17
- package/dist/pda-44IHEORD.cjs.map +1 -0
- package/dist/{pda-UJLXCO6I.js → pda-WJVDXQPW.js} +3 -3
- package/dist/pda-WJVDXQPW.js.map +1 -0
- package/dist/solana/index.cjs +1664 -925
- package/dist/solana/index.cjs.map +1 -1
- package/dist/solana/index.d.cts +748 -159
- package/dist/solana/index.d.ts +748 -159
- package/dist/solana/index.js +1311 -577
- package/dist/solana/index.js.map +1 -1
- package/dist/solana/react/index.cjs +45 -45
- package/dist/solana/react/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-RVDRWCJN.js.map +0 -1
- package/dist/chunk-U6B52TBT.cjs.map +0 -1
- package/dist/chunk-WD5VOZGI.js.map +0 -1
- package/dist/chunk-XTL2GBZ4.cjs.map +0 -1
- package/dist/pda-H6VMGONM.cjs.map +0 -1
- package/dist/pda-UJLXCO6I.js.map +0 -1
package/dist/evm/index.cjs
CHANGED
|
@@ -6779,11 +6779,14 @@ function computeOptimalGamma(startTick, endTick, duration, epochLength, tickSpac
|
|
|
6779
6779
|
|
|
6780
6780
|
// src/evm/utils/gasEstimate.ts
|
|
6781
6781
|
async function resolveGasEstimate(request, fallback) {
|
|
6782
|
-
if (
|
|
6782
|
+
if (isGasEstimateRequest(request)) {
|
|
6783
6783
|
return request.gas;
|
|
6784
6784
|
}
|
|
6785
6785
|
return await fallback();
|
|
6786
6786
|
}
|
|
6787
|
+
function isGasEstimateRequest(request) {
|
|
6788
|
+
return typeof request === "object" && request !== null && "gas" in request && typeof request.gas === "bigint";
|
|
6789
|
+
}
|
|
6787
6790
|
|
|
6788
6791
|
// src/evm/utils/isToken0Expected.ts
|
|
6789
6792
|
function isToken0Expected(numeraire) {
|
|
@@ -12128,6 +12131,214 @@ var DopplerFactory = class {
|
|
|
12128
12131
|
}
|
|
12129
12132
|
};
|
|
12130
12133
|
var MULTICURVE_BUNDLER_SELECTORS = ["0xe2e9faa1", "0x07087b06"];
|
|
12134
|
+
function parseAirlockPoolOrHook(rawAssetData, context = "Airlock getAssetData") {
|
|
12135
|
+
const rawPoolOrHook = readContractResultField(
|
|
12136
|
+
rawAssetData,
|
|
12137
|
+
["poolOrHook", "pool"],
|
|
12138
|
+
5,
|
|
12139
|
+
context
|
|
12140
|
+
);
|
|
12141
|
+
return parseAddress(rawPoolOrHook, context, "poolOrHook");
|
|
12142
|
+
}
|
|
12143
|
+
function parseAirlockLiquidityMigrator(rawAssetData, context = "Airlock getAssetData") {
|
|
12144
|
+
const rawLiquidityMigrator = readContractResultField(
|
|
12145
|
+
rawAssetData,
|
|
12146
|
+
["liquidityMigrator"],
|
|
12147
|
+
3,
|
|
12148
|
+
context
|
|
12149
|
+
);
|
|
12150
|
+
return parseAddress(rawLiquidityMigrator, context, "liquidityMigrator");
|
|
12151
|
+
}
|
|
12152
|
+
function normalizeDynamicHookState(rawState, context = "DopplerHook state") {
|
|
12153
|
+
return {
|
|
12154
|
+
totalTokensSold: parseBigIntField(rawState, "totalTokensSold", 2, context),
|
|
12155
|
+
totalProceeds: parseBigIntField(rawState, "totalProceeds", 3, context)
|
|
12156
|
+
};
|
|
12157
|
+
}
|
|
12158
|
+
function normalizeRehypeFeeDistributionInfo(rawInfo, context = "Rehype getFeeDistributionInfo") {
|
|
12159
|
+
return {
|
|
12160
|
+
assetFeesToAssetBuybackWad: parseBigIntField(
|
|
12161
|
+
rawInfo,
|
|
12162
|
+
"assetFeesToAssetBuybackWad",
|
|
12163
|
+
0,
|
|
12164
|
+
context
|
|
12165
|
+
),
|
|
12166
|
+
assetFeesToNumeraireBuybackWad: parseBigIntField(
|
|
12167
|
+
rawInfo,
|
|
12168
|
+
"assetFeesToNumeraireBuybackWad",
|
|
12169
|
+
1,
|
|
12170
|
+
context
|
|
12171
|
+
),
|
|
12172
|
+
assetFeesToBeneficiaryWad: parseBigIntField(
|
|
12173
|
+
rawInfo,
|
|
12174
|
+
"assetFeesToBeneficiaryWad",
|
|
12175
|
+
2,
|
|
12176
|
+
context
|
|
12177
|
+
),
|
|
12178
|
+
assetFeesToLpWad: parseBigIntField(rawInfo, "assetFeesToLpWad", 3, context),
|
|
12179
|
+
numeraireFeesToAssetBuybackWad: parseBigIntField(
|
|
12180
|
+
rawInfo,
|
|
12181
|
+
"numeraireFeesToAssetBuybackWad",
|
|
12182
|
+
4,
|
|
12183
|
+
context
|
|
12184
|
+
),
|
|
12185
|
+
numeraireFeesToNumeraireBuybackWad: parseBigIntField(
|
|
12186
|
+
rawInfo,
|
|
12187
|
+
"numeraireFeesToNumeraireBuybackWad",
|
|
12188
|
+
5,
|
|
12189
|
+
context
|
|
12190
|
+
),
|
|
12191
|
+
numeraireFeesToBeneficiaryWad: parseBigIntField(
|
|
12192
|
+
rawInfo,
|
|
12193
|
+
"numeraireFeesToBeneficiaryWad",
|
|
12194
|
+
6,
|
|
12195
|
+
context
|
|
12196
|
+
),
|
|
12197
|
+
numeraireFeesToLpWad: parseBigIntField(
|
|
12198
|
+
rawInfo,
|
|
12199
|
+
"numeraireFeesToLpWad",
|
|
12200
|
+
7,
|
|
12201
|
+
context
|
|
12202
|
+
)
|
|
12203
|
+
};
|
|
12204
|
+
}
|
|
12205
|
+
function normalizeRehypeFeeSchedule(rawSchedule, context = "Rehype getFeeSchedule") {
|
|
12206
|
+
return {
|
|
12207
|
+
startingTime: parseNumberField(rawSchedule, "startingTime", 0, context),
|
|
12208
|
+
startFee: parseNumberField(rawSchedule, "startFee", 1, context),
|
|
12209
|
+
endFee: parseNumberField(rawSchedule, "endFee", 2, context),
|
|
12210
|
+
lastFee: parseNumberField(rawSchedule, "lastFee", 3, context),
|
|
12211
|
+
durationSeconds: parseNumberField(
|
|
12212
|
+
rawSchedule,
|
|
12213
|
+
"durationSeconds",
|
|
12214
|
+
4,
|
|
12215
|
+
context
|
|
12216
|
+
)
|
|
12217
|
+
};
|
|
12218
|
+
}
|
|
12219
|
+
function normalizeRehypeHookFees(rawFees, context = "Rehype getHookFees") {
|
|
12220
|
+
return {
|
|
12221
|
+
fees0: parseBigIntField(rawFees, "fees0", 0, context),
|
|
12222
|
+
fees1: parseBigIntField(rawFees, "fees1", 1, context),
|
|
12223
|
+
beneficiaryFees0: parseBigIntField(rawFees, "beneficiaryFees0", 2, context),
|
|
12224
|
+
beneficiaryFees1: parseBigIntField(rawFees, "beneficiaryFees1", 3, context),
|
|
12225
|
+
airlockOwnerFees0: parseBigIntField(
|
|
12226
|
+
rawFees,
|
|
12227
|
+
"airlockOwnerFees0",
|
|
12228
|
+
4,
|
|
12229
|
+
context
|
|
12230
|
+
),
|
|
12231
|
+
airlockOwnerFees1: parseBigIntField(
|
|
12232
|
+
rawFees,
|
|
12233
|
+
"airlockOwnerFees1",
|
|
12234
|
+
5,
|
|
12235
|
+
context
|
|
12236
|
+
),
|
|
12237
|
+
customFee: parseNumberField(rawFees, "customFee", 6, context)
|
|
12238
|
+
};
|
|
12239
|
+
}
|
|
12240
|
+
function normalizeRehypePoolInfo(rawInfo, context = "Rehype getPoolInfo") {
|
|
12241
|
+
return {
|
|
12242
|
+
asset: parseAddressField(rawInfo, "asset", 0, context),
|
|
12243
|
+
numeraire: parseAddressField(rawInfo, "numeraire", 1, context),
|
|
12244
|
+
buybackDst: parseAddressField(rawInfo, "buybackDst", 2, context)
|
|
12245
|
+
};
|
|
12246
|
+
}
|
|
12247
|
+
function normalizeRehypePosition(rawPosition, context = "Rehype getPosition") {
|
|
12248
|
+
return {
|
|
12249
|
+
tickLower: parseNumberField(rawPosition, "tickLower", 0, context),
|
|
12250
|
+
tickUpper: parseNumberField(rawPosition, "tickUpper", 1, context),
|
|
12251
|
+
liquidity: parseBigIntField(rawPosition, "liquidity", 2, context),
|
|
12252
|
+
salt: parseHexField(rawPosition, "salt", 3, context)
|
|
12253
|
+
};
|
|
12254
|
+
}
|
|
12255
|
+
function parseAddressField(rawResult, fieldName, tupleIndex, context) {
|
|
12256
|
+
const rawField = readContractResultField(
|
|
12257
|
+
rawResult,
|
|
12258
|
+
[fieldName],
|
|
12259
|
+
tupleIndex,
|
|
12260
|
+
context
|
|
12261
|
+
);
|
|
12262
|
+
return parseAddress(rawField, context, fieldName);
|
|
12263
|
+
}
|
|
12264
|
+
function parseBigIntField(rawResult, fieldName, tupleIndex, context) {
|
|
12265
|
+
const rawField = readContractResultField(
|
|
12266
|
+
rawResult,
|
|
12267
|
+
[fieldName],
|
|
12268
|
+
tupleIndex,
|
|
12269
|
+
context
|
|
12270
|
+
);
|
|
12271
|
+
if (typeof rawField === "bigint") {
|
|
12272
|
+
return rawField;
|
|
12273
|
+
}
|
|
12274
|
+
if (typeof rawField === "number" && Number.isSafeInteger(rawField)) {
|
|
12275
|
+
return BigInt(rawField);
|
|
12276
|
+
}
|
|
12277
|
+
if (typeof rawField === "string" && rawField.trim() !== "") {
|
|
12278
|
+
try {
|
|
12279
|
+
return BigInt(rawField);
|
|
12280
|
+
} catch {
|
|
12281
|
+
throw new Error(`${context}: ${fieldName} must be bigint-compatible`);
|
|
12282
|
+
}
|
|
12283
|
+
}
|
|
12284
|
+
throw new Error(`${context}: ${fieldName} must be bigint-compatible`);
|
|
12285
|
+
}
|
|
12286
|
+
function parseNumberField(rawResult, fieldName, tupleIndex, context) {
|
|
12287
|
+
const rawField = readContractResultField(
|
|
12288
|
+
rawResult,
|
|
12289
|
+
[fieldName],
|
|
12290
|
+
tupleIndex,
|
|
12291
|
+
context
|
|
12292
|
+
);
|
|
12293
|
+
const numericField = typeof rawField === "bigint" || typeof rawField === "number" ? Number(rawField) : Number.NaN;
|
|
12294
|
+
if (!Number.isSafeInteger(numericField)) {
|
|
12295
|
+
throw new Error(`${context}: ${fieldName} must be a safe integer`);
|
|
12296
|
+
}
|
|
12297
|
+
return numericField;
|
|
12298
|
+
}
|
|
12299
|
+
function parseHexField(rawResult, fieldName, tupleIndex, context) {
|
|
12300
|
+
const rawField = readContractResultField(
|
|
12301
|
+
rawResult,
|
|
12302
|
+
[fieldName],
|
|
12303
|
+
tupleIndex,
|
|
12304
|
+
context
|
|
12305
|
+
);
|
|
12306
|
+
if (typeof rawField === "string" && viem.isHex(rawField)) {
|
|
12307
|
+
return rawField;
|
|
12308
|
+
}
|
|
12309
|
+
throw new Error(`${context}: ${fieldName} must be hex`);
|
|
12310
|
+
}
|
|
12311
|
+
function parseAddress(rawField, context, fieldName) {
|
|
12312
|
+
if (typeof rawField === "string" && viem.isAddress(rawField, { strict: false })) {
|
|
12313
|
+
return rawField;
|
|
12314
|
+
}
|
|
12315
|
+
throw new Error(`${context}: ${fieldName} must be an address`);
|
|
12316
|
+
}
|
|
12317
|
+
function readContractResultField(rawResult, fieldNames, tupleIndex, context) {
|
|
12318
|
+
if (Array.isArray(rawResult)) {
|
|
12319
|
+
if (tupleIndex < rawResult.length && rawResult[tupleIndex] !== void 0) {
|
|
12320
|
+
return rawResult[tupleIndex];
|
|
12321
|
+
}
|
|
12322
|
+
throw new Error(
|
|
12323
|
+
`${context}: missing tuple field ${fieldNames.join("/")} at index ${tupleIndex}`
|
|
12324
|
+
);
|
|
12325
|
+
}
|
|
12326
|
+
if (isRecord(rawResult)) {
|
|
12327
|
+
for (const fieldName of fieldNames) {
|
|
12328
|
+
const rawField = rawResult[fieldName];
|
|
12329
|
+
if (rawField !== void 0) {
|
|
12330
|
+
return rawField;
|
|
12331
|
+
}
|
|
12332
|
+
}
|
|
12333
|
+
throw new Error(`${context}: missing field ${fieldNames.join("/")}`);
|
|
12334
|
+
}
|
|
12335
|
+
throw new Error(`${context}: expected tuple or object result`);
|
|
12336
|
+
}
|
|
12337
|
+
function isRecord(rawResult) {
|
|
12338
|
+
return typeof rawResult === "object" && rawResult !== null;
|
|
12339
|
+
}
|
|
12340
|
+
|
|
12341
|
+
// src/evm/entities/auction/StaticAuction.ts
|
|
12131
12342
|
var StaticAuction = class {
|
|
12132
12343
|
client;
|
|
12133
12344
|
poolAddress;
|
|
@@ -12183,13 +12394,7 @@ var StaticAuction = class {
|
|
|
12183
12394
|
functionName: "getAssetData",
|
|
12184
12395
|
args: [token0]
|
|
12185
12396
|
});
|
|
12186
|
-
|
|
12187
|
-
if (Array.isArray(assetData)) {
|
|
12188
|
-
poolOrHook0 = assetData[5];
|
|
12189
|
-
} else if (assetData && typeof assetData === "object") {
|
|
12190
|
-
poolOrHook0 = assetData.poolOrHook ?? assetData.pool;
|
|
12191
|
-
}
|
|
12192
|
-
const isToken0AuctionToken = poolOrHook0 && poolOrHook0 !== viem.zeroAddress;
|
|
12397
|
+
const isToken0AuctionToken = this.isRegisteredAirlockAsset(assetData);
|
|
12193
12398
|
return {
|
|
12194
12399
|
address: this.poolAddress,
|
|
12195
12400
|
tokenAddress: isToken0AuctionToken ? token0 : token1,
|
|
@@ -12220,7 +12425,7 @@ var StaticAuction = class {
|
|
|
12220
12425
|
functionName: "getAssetData",
|
|
12221
12426
|
args: [tokenAddress]
|
|
12222
12427
|
});
|
|
12223
|
-
const liquidityMigrator =
|
|
12428
|
+
const liquidityMigrator = parseAirlockLiquidityMigrator(assetData);
|
|
12224
12429
|
return liquidityMigrator === viem.zeroAddress;
|
|
12225
12430
|
}
|
|
12226
12431
|
/**
|
|
@@ -12229,18 +12434,11 @@ var StaticAuction = class {
|
|
|
12229
12434
|
*/
|
|
12230
12435
|
async getCurrentPrice() {
|
|
12231
12436
|
const poolInfo = await this.getPoolInfo();
|
|
12232
|
-
const
|
|
12233
|
-
this.
|
|
12234
|
-
|
|
12235
|
-
|
|
12236
|
-
|
|
12237
|
-
}),
|
|
12238
|
-
this.rpc.readContract({
|
|
12239
|
-
address: this.poolAddress,
|
|
12240
|
-
abi: uniswapV3PoolAbi,
|
|
12241
|
-
functionName: "token1"
|
|
12242
|
-
})
|
|
12243
|
-
]);
|
|
12437
|
+
const token0 = await this.rpc.readContract({
|
|
12438
|
+
address: this.poolAddress,
|
|
12439
|
+
abi: uniswapV3PoolAbi,
|
|
12440
|
+
functionName: "token0"
|
|
12441
|
+
});
|
|
12244
12442
|
const sqrtPriceX96 = poolInfo.sqrtPriceX96;
|
|
12245
12443
|
const Q962 = BigInt(2) ** BigInt(96);
|
|
12246
12444
|
const sqrtPriceX96Squared = sqrtPriceX96 * sqrtPriceX96;
|
|
@@ -12262,6 +12460,13 @@ var StaticAuction = class {
|
|
|
12262
12460
|
functionName: "liquidity"
|
|
12263
12461
|
});
|
|
12264
12462
|
}
|
|
12463
|
+
isRegisteredAirlockAsset(assetData) {
|
|
12464
|
+
try {
|
|
12465
|
+
return parseAirlockPoolOrHook(assetData) !== viem.zeroAddress;
|
|
12466
|
+
} catch {
|
|
12467
|
+
return false;
|
|
12468
|
+
}
|
|
12469
|
+
}
|
|
12265
12470
|
};
|
|
12266
12471
|
var DynamicAuction = class {
|
|
12267
12472
|
client;
|
|
@@ -12347,11 +12552,11 @@ var DynamicAuction = class {
|
|
|
12347
12552
|
const currentTime = BigInt(Math.floor(Date.now() / 1e3));
|
|
12348
12553
|
const elapsedTime = currentTime > startingTime ? currentTime - startingTime : BigInt(0);
|
|
12349
12554
|
const currentEpoch = epochLength > 0n ? Number(elapsedTime / epochLength) : 0;
|
|
12350
|
-
const poolKey =
|
|
12555
|
+
const poolKey = normalizePoolKey(poolKeyRaw);
|
|
12351
12556
|
const isToken0 = poolKey.currency0 !== viem.zeroAddress;
|
|
12352
12557
|
const tokenAddress = isToken0 ? poolKey.currency0 : poolKey.currency1;
|
|
12353
12558
|
const numeraireAddress = isToken0 ? poolKey.currency1 : poolKey.currency0;
|
|
12354
|
-
const poolId =
|
|
12559
|
+
const poolId = computePoolId(poolKey);
|
|
12355
12560
|
return {
|
|
12356
12561
|
hookAddress: this.hookAddress,
|
|
12357
12562
|
tokenAddress,
|
|
@@ -12378,7 +12583,7 @@ var DynamicAuction = class {
|
|
|
12378
12583
|
abi: dopplerHookAbi,
|
|
12379
12584
|
functionName: "poolKey"
|
|
12380
12585
|
});
|
|
12381
|
-
const poolKey =
|
|
12586
|
+
const poolKey = normalizePoolKey(poolKeyRaw);
|
|
12382
12587
|
const isToken0 = await this.rpc.readContract({
|
|
12383
12588
|
address: this.hookAddress,
|
|
12384
12589
|
abi: dopplerHookAbi,
|
|
@@ -12395,8 +12600,8 @@ var DynamicAuction = class {
|
|
|
12395
12600
|
abi: dopplerHookAbi,
|
|
12396
12601
|
functionName: "poolKey"
|
|
12397
12602
|
});
|
|
12398
|
-
const poolKey =
|
|
12399
|
-
return
|
|
12603
|
+
const poolKey = normalizePoolKey(poolKeyRaw);
|
|
12604
|
+
return computePoolId(poolKey);
|
|
12400
12605
|
}
|
|
12401
12606
|
/**
|
|
12402
12607
|
* Check if the auction has graduated (ready for migration)
|
|
@@ -12411,7 +12616,7 @@ var DynamicAuction = class {
|
|
|
12411
12616
|
functionName: "getAssetData",
|
|
12412
12617
|
args: [tokenAddress]
|
|
12413
12618
|
});
|
|
12414
|
-
const liquidityMigrator =
|
|
12619
|
+
const liquidityMigrator = parseAirlockLiquidityMigrator(assetData);
|
|
12415
12620
|
return liquidityMigrator === viem.zeroAddress;
|
|
12416
12621
|
}
|
|
12417
12622
|
/**
|
|
@@ -12439,8 +12644,7 @@ var DynamicAuction = class {
|
|
|
12439
12644
|
* Returns the current tick based on the epoch and gamma parameters
|
|
12440
12645
|
*/
|
|
12441
12646
|
async getCurrentPrice() {
|
|
12442
|
-
const [
|
|
12443
|
-
this.readHookState(),
|
|
12647
|
+
const [startingTick, endingTick, gamma, startingTime, epochLength] = await Promise.all([
|
|
12444
12648
|
this.rpc.readContract({
|
|
12445
12649
|
address: this.hookAddress,
|
|
12446
12650
|
abi: dopplerHookAbi,
|
|
@@ -12492,64 +12696,13 @@ var DynamicAuction = class {
|
|
|
12492
12696
|
functionName: "earlyExit"
|
|
12493
12697
|
});
|
|
12494
12698
|
}
|
|
12495
|
-
/**
|
|
12496
|
-
* Compute V4 pool ID from pool key components
|
|
12497
|
-
*/
|
|
12498
|
-
computePoolId(poolKey) {
|
|
12499
|
-
const encoded = viem.encodeAbiParameters(
|
|
12500
|
-
[
|
|
12501
|
-
{ type: "address" },
|
|
12502
|
-
{ type: "address" },
|
|
12503
|
-
{ type: "uint24" },
|
|
12504
|
-
{ type: "int24" },
|
|
12505
|
-
{ type: "address" }
|
|
12506
|
-
],
|
|
12507
|
-
[
|
|
12508
|
-
poolKey.currency0,
|
|
12509
|
-
poolKey.currency1,
|
|
12510
|
-
poolKey.fee,
|
|
12511
|
-
poolKey.tickSpacing,
|
|
12512
|
-
poolKey.hooks
|
|
12513
|
-
]
|
|
12514
|
-
);
|
|
12515
|
-
return viem.keccak256(encoded);
|
|
12516
|
-
}
|
|
12517
|
-
/**
|
|
12518
|
-
* Read hook state with backward-compatible decoding.
|
|
12519
|
-
* Falls back to legacy state() ABI if the latest ABI fails to decode.
|
|
12520
|
-
*/
|
|
12521
12699
|
async readHookState() {
|
|
12522
|
-
const
|
|
12700
|
+
const rawState = await this.rpc.readContract({
|
|
12523
12701
|
address: this.hookAddress,
|
|
12524
12702
|
abi: dopplerHookAbi,
|
|
12525
12703
|
functionName: "state"
|
|
12526
12704
|
});
|
|
12527
|
-
|
|
12528
|
-
const [
|
|
12529
|
-
lastEpoch,
|
|
12530
|
-
tickAccumulator,
|
|
12531
|
-
totalTokensSold,
|
|
12532
|
-
totalProceeds,
|
|
12533
|
-
totalTokensSoldLastEpoch,
|
|
12534
|
-
feesAccrued
|
|
12535
|
-
] = result;
|
|
12536
|
-
return {
|
|
12537
|
-
lastEpoch,
|
|
12538
|
-
tickAccumulator,
|
|
12539
|
-
totalTokensSold,
|
|
12540
|
-
totalProceeds,
|
|
12541
|
-
totalTokensSoldLastEpoch,
|
|
12542
|
-
feesAccrued
|
|
12543
|
-
};
|
|
12544
|
-
}
|
|
12545
|
-
return result;
|
|
12546
|
-
}
|
|
12547
|
-
normalizePoolKey(value) {
|
|
12548
|
-
if (Array.isArray(value)) {
|
|
12549
|
-
const [currency0, currency1, fee, tickSpacing, hooks] = value;
|
|
12550
|
-
return { currency0, currency1, fee, tickSpacing, hooks };
|
|
12551
|
-
}
|
|
12552
|
-
return value;
|
|
12705
|
+
return normalizeDynamicHookState(rawState);
|
|
12553
12706
|
}
|
|
12554
12707
|
};
|
|
12555
12708
|
var ABSENT_POOL_ERROR_ABI = [
|
|
@@ -13304,29 +13457,7 @@ var RehypeDopplerHook = class {
|
|
|
13304
13457
|
functionName: "getFeeDistributionInfo",
|
|
13305
13458
|
args: [poolId]
|
|
13306
13459
|
});
|
|
13307
|
-
|
|
13308
|
-
return {
|
|
13309
|
-
assetFeesToAssetBuybackWad: BigInt(
|
|
13310
|
-
info.assetFeesToAssetBuybackWad ?? info[0]
|
|
13311
|
-
),
|
|
13312
|
-
assetFeesToNumeraireBuybackWad: BigInt(
|
|
13313
|
-
info.assetFeesToNumeraireBuybackWad ?? info[1]
|
|
13314
|
-
),
|
|
13315
|
-
assetFeesToBeneficiaryWad: BigInt(
|
|
13316
|
-
info.assetFeesToBeneficiaryWad ?? info[2]
|
|
13317
|
-
),
|
|
13318
|
-
assetFeesToLpWad: BigInt(info.assetFeesToLpWad ?? info[3]),
|
|
13319
|
-
numeraireFeesToAssetBuybackWad: BigInt(
|
|
13320
|
-
info.numeraireFeesToAssetBuybackWad ?? info[4]
|
|
13321
|
-
),
|
|
13322
|
-
numeraireFeesToNumeraireBuybackWad: BigInt(
|
|
13323
|
-
info.numeraireFeesToNumeraireBuybackWad ?? info[5]
|
|
13324
|
-
),
|
|
13325
|
-
numeraireFeesToBeneficiaryWad: BigInt(
|
|
13326
|
-
info.numeraireFeesToBeneficiaryWad ?? info[6]
|
|
13327
|
-
),
|
|
13328
|
-
numeraireFeesToLpWad: BigInt(info.numeraireFeesToLpWad ?? info[7])
|
|
13329
|
-
};
|
|
13460
|
+
return normalizeRehypeFeeDistributionInfo(result);
|
|
13330
13461
|
}
|
|
13331
13462
|
async getFeeRoutingMode(poolId) {
|
|
13332
13463
|
const mode = await this.rpc.readContract({
|
|
@@ -13344,14 +13475,7 @@ var RehypeDopplerHook = class {
|
|
|
13344
13475
|
functionName: "getFeeSchedule",
|
|
13345
13476
|
args: [poolId]
|
|
13346
13477
|
});
|
|
13347
|
-
|
|
13348
|
-
return {
|
|
13349
|
-
startingTime: Number(schedule.startingTime ?? schedule[0] ?? 0),
|
|
13350
|
-
startFee: Number(schedule.startFee ?? schedule[1] ?? 0),
|
|
13351
|
-
endFee: Number(schedule.endFee ?? schedule[2] ?? 0),
|
|
13352
|
-
lastFee: Number(schedule.lastFee ?? schedule[3] ?? 0),
|
|
13353
|
-
durationSeconds: Number(schedule.durationSeconds ?? schedule[4] ?? 0)
|
|
13354
|
-
};
|
|
13478
|
+
return normalizeRehypeFeeSchedule(result);
|
|
13355
13479
|
}
|
|
13356
13480
|
async getHookFees(poolId) {
|
|
13357
13481
|
const result = await this.rpc.readContract({
|
|
@@ -13360,16 +13484,7 @@ var RehypeDopplerHook = class {
|
|
|
13360
13484
|
functionName: "getHookFees",
|
|
13361
13485
|
args: [poolId]
|
|
13362
13486
|
});
|
|
13363
|
-
|
|
13364
|
-
return {
|
|
13365
|
-
fees0: BigInt(fees.fees0 ?? fees[0] ?? 0),
|
|
13366
|
-
fees1: BigInt(fees.fees1 ?? fees[1] ?? 0),
|
|
13367
|
-
beneficiaryFees0: BigInt(fees.beneficiaryFees0 ?? fees[2] ?? 0),
|
|
13368
|
-
beneficiaryFees1: BigInt(fees.beneficiaryFees1 ?? fees[3] ?? 0),
|
|
13369
|
-
airlockOwnerFees0: BigInt(fees.airlockOwnerFees0 ?? fees[4] ?? 0),
|
|
13370
|
-
airlockOwnerFees1: BigInt(fees.airlockOwnerFees1 ?? fees[5] ?? 0),
|
|
13371
|
-
customFee: Number(fees.customFee ?? fees[6] ?? 0)
|
|
13372
|
-
};
|
|
13487
|
+
return normalizeRehypeHookFees(result);
|
|
13373
13488
|
}
|
|
13374
13489
|
async getPoolInfo(poolId) {
|
|
13375
13490
|
const result = await this.rpc.readContract({
|
|
@@ -13378,12 +13493,7 @@ var RehypeDopplerHook = class {
|
|
|
13378
13493
|
functionName: "getPoolInfo",
|
|
13379
13494
|
args: [poolId]
|
|
13380
13495
|
});
|
|
13381
|
-
|
|
13382
|
-
return {
|
|
13383
|
-
asset: info.asset ?? info[0],
|
|
13384
|
-
numeraire: info.numeraire ?? info[1],
|
|
13385
|
-
buybackDst: info.buybackDst ?? info[2]
|
|
13386
|
-
};
|
|
13496
|
+
return normalizeRehypePoolInfo(result);
|
|
13387
13497
|
}
|
|
13388
13498
|
};
|
|
13389
13499
|
|
|
@@ -13471,29 +13581,7 @@ var RehypeDopplerHookMigrator = class {
|
|
|
13471
13581
|
functionName: "getFeeDistributionInfo",
|
|
13472
13582
|
args: [poolId]
|
|
13473
13583
|
});
|
|
13474
|
-
|
|
13475
|
-
return {
|
|
13476
|
-
assetFeesToAssetBuybackWad: BigInt(
|
|
13477
|
-
info.assetFeesToAssetBuybackWad ?? info[0]
|
|
13478
|
-
),
|
|
13479
|
-
assetFeesToNumeraireBuybackWad: BigInt(
|
|
13480
|
-
info.assetFeesToNumeraireBuybackWad ?? info[1]
|
|
13481
|
-
),
|
|
13482
|
-
assetFeesToBeneficiaryWad: BigInt(
|
|
13483
|
-
info.assetFeesToBeneficiaryWad ?? info[2]
|
|
13484
|
-
),
|
|
13485
|
-
assetFeesToLpWad: BigInt(info.assetFeesToLpWad ?? info[3]),
|
|
13486
|
-
numeraireFeesToAssetBuybackWad: BigInt(
|
|
13487
|
-
info.numeraireFeesToAssetBuybackWad ?? info[4]
|
|
13488
|
-
),
|
|
13489
|
-
numeraireFeesToNumeraireBuybackWad: BigInt(
|
|
13490
|
-
info.numeraireFeesToNumeraireBuybackWad ?? info[5]
|
|
13491
|
-
),
|
|
13492
|
-
numeraireFeesToBeneficiaryWad: BigInt(
|
|
13493
|
-
info.numeraireFeesToBeneficiaryWad ?? info[6]
|
|
13494
|
-
),
|
|
13495
|
-
numeraireFeesToLpWad: BigInt(info.numeraireFeesToLpWad ?? info[7])
|
|
13496
|
-
};
|
|
13584
|
+
return normalizeRehypeFeeDistributionInfo(result);
|
|
13497
13585
|
}
|
|
13498
13586
|
async getFeeRoutingMode(poolId) {
|
|
13499
13587
|
const mode = await this.rpc.readContract({
|
|
@@ -13511,16 +13599,7 @@ var RehypeDopplerHookMigrator = class {
|
|
|
13511
13599
|
functionName: "getHookFees",
|
|
13512
13600
|
args: [poolId]
|
|
13513
13601
|
});
|
|
13514
|
-
|
|
13515
|
-
return {
|
|
13516
|
-
fees0: BigInt(fees.fees0 ?? fees[0] ?? 0),
|
|
13517
|
-
fees1: BigInt(fees.fees1 ?? fees[1] ?? 0),
|
|
13518
|
-
beneficiaryFees0: BigInt(fees.beneficiaryFees0 ?? fees[2] ?? 0),
|
|
13519
|
-
beneficiaryFees1: BigInt(fees.beneficiaryFees1 ?? fees[3] ?? 0),
|
|
13520
|
-
airlockOwnerFees0: BigInt(fees.airlockOwnerFees0 ?? fees[4] ?? 0),
|
|
13521
|
-
airlockOwnerFees1: BigInt(fees.airlockOwnerFees1 ?? fees[5] ?? 0),
|
|
13522
|
-
customFee: Number(fees.customFee ?? fees[6] ?? 0)
|
|
13523
|
-
};
|
|
13602
|
+
return normalizeRehypeHookFees(result);
|
|
13524
13603
|
}
|
|
13525
13604
|
async getPoolInfo(poolId) {
|
|
13526
13605
|
const result = await this.rpc.readContract({
|
|
@@ -13529,12 +13608,7 @@ var RehypeDopplerHookMigrator = class {
|
|
|
13529
13608
|
functionName: "getPoolInfo",
|
|
13530
13609
|
args: [poolId]
|
|
13531
13610
|
});
|
|
13532
|
-
|
|
13533
|
-
return {
|
|
13534
|
-
asset: info.asset ?? info[0],
|
|
13535
|
-
numeraire: info.numeraire ?? info[1],
|
|
13536
|
-
buybackDst: info.buybackDst ?? info[2]
|
|
13537
|
-
};
|
|
13611
|
+
return normalizeRehypePoolInfo(result);
|
|
13538
13612
|
}
|
|
13539
13613
|
async getPosition(poolId) {
|
|
13540
13614
|
const result = await this.rpc.readContract({
|
|
@@ -13543,13 +13617,7 @@ var RehypeDopplerHookMigrator = class {
|
|
|
13543
13617
|
functionName: "getPosition",
|
|
13544
13618
|
args: [poolId]
|
|
13545
13619
|
});
|
|
13546
|
-
|
|
13547
|
-
return {
|
|
13548
|
-
tickLower: Number(position.tickLower ?? position[0] ?? 0),
|
|
13549
|
-
tickUpper: Number(position.tickUpper ?? position[1] ?? 0),
|
|
13550
|
-
liquidity: BigInt(position.liquidity ?? position[2] ?? 0),
|
|
13551
|
-
salt: position.salt ?? position[3]
|
|
13552
|
-
};
|
|
13620
|
+
return normalizeRehypePosition(result);
|
|
13553
13621
|
}
|
|
13554
13622
|
};
|
|
13555
13623
|
var OpeningAuctionPositionManager = class _OpeningAuctionPositionManager {
|