@steerprotocol/sdk 3.0.19 → 3.0.21
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/index.browser.mjs +95 -8
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.cjs +95 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +95 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.browser.mjs
CHANGED
|
@@ -14431,21 +14431,28 @@ const quickSwapIntegralConfig = (theGraphApiKey) => ({
|
|
|
14431
14431
|
algebraHookSupportedChains: [Chain.Base],
|
|
14432
14432
|
subgraph: {
|
|
14433
14433
|
[Chain.Soneium]: getTheGraphResolverUrl("3GsT6AiuDiSzh2fXbFxUKtBxT8rBEGVdQCgHSsKMPHiu", false, theGraphApiKey),
|
|
14434
|
-
[Chain.Base]: getTheGraphResolverUrl("U65NKb6BsDPGqugPAda58ebMLa1RqeMFT76fndB77oe", false, theGraphApiKey)
|
|
14434
|
+
[Chain.Base]: getTheGraphResolverUrl("U65NKb6BsDPGqugPAda58ebMLa1RqeMFT76fndB77oe", false, theGraphApiKey),
|
|
14435
|
+
[Chain.Polygon]: getTheGraphResolverUrl("5JUgNJk47FJRjKRzhZ8JtBpWQA4GyRFzNQFCKNpxkvCM", false, theGraphApiKey)
|
|
14435
14436
|
},
|
|
14436
14437
|
factoryAddress: {
|
|
14437
14438
|
[Chain.Soneium]: "0x8Ff309F68F6Caf77a78E9C20d2Af7Ed4bE2D7093",
|
|
14438
|
-
[Chain.Base]: "0xC5396866754799B9720125B104AE01d935Ab9C7b"
|
|
14439
|
+
[Chain.Base]: "0xC5396866754799B9720125B104AE01d935Ab9C7b",
|
|
14440
|
+
[Chain.Polygon]: "0x134c1dBE4860A9cAaf89002574fFe814772D9904"
|
|
14439
14441
|
},
|
|
14440
14442
|
TickLensAddress: {
|
|
14441
14443
|
[Chain.Soneium]: "0x9AfA76331a01b1b25289306fbD72A4e032FDFe06",
|
|
14442
|
-
[Chain.Base]: "0xC73e303fb323DDFB446E2Cc8c0f1B8199e7930f4"
|
|
14444
|
+
[Chain.Base]: "0xC73e303fb323DDFB446E2Cc8c0f1B8199e7930f4",
|
|
14445
|
+
[Chain.Polygon]: "0x28aDcf283d392e3902F49A7E9A78E40D64348290"
|
|
14443
14446
|
},
|
|
14444
14447
|
QuoterV2Address: {
|
|
14445
14448
|
[Chain.Base]: "0x23E0583a3a000d567bB3848115065c1890D87fb5",
|
|
14446
|
-
[Chain.Soneium]: "0x22e5195BcC9b0C87f330FbCE2755B263662578E2"
|
|
14449
|
+
[Chain.Soneium]: "0x22e5195BcC9b0C87f330FbCE2755B263662578E2",
|
|
14450
|
+
[Chain.Polygon]: "0xa062c2754864F67a259b346D0D7567b2ed406e6E"
|
|
14447
14451
|
},
|
|
14448
|
-
EntryPointAddress: {
|
|
14452
|
+
EntryPointAddress: {
|
|
14453
|
+
[Chain.Base]: "0xb9ce7698cE3dCf21cc88bf7dCc1fE20C85E4226E",
|
|
14454
|
+
[Chain.Polygon]: "0xfcfE065bc131Fa8Bb31A227b2fF4F0EC47D3F1a2"
|
|
14455
|
+
}
|
|
14449
14456
|
});
|
|
14450
14457
|
//#endregion
|
|
14451
14458
|
//#region src/const/amm/configs/protocols/quickswap-univ3.ts
|
|
@@ -17350,6 +17357,76 @@ async function getSlot0(publicClient, poolAddress) {
|
|
|
17350
17357
|
}
|
|
17351
17358
|
}
|
|
17352
17359
|
/**
|
|
17360
|
+
* Gets slot0 data from an Aerodrome V3 pool
|
|
17361
|
+
* @param poolAddress The pool address
|
|
17362
|
+
*/
|
|
17363
|
+
async function getAerodromeSlot0(publicClient, poolAddress) {
|
|
17364
|
+
try {
|
|
17365
|
+
const slot0 = await publicClient.readContract({
|
|
17366
|
+
address: poolAddress,
|
|
17367
|
+
abi: [{
|
|
17368
|
+
inputs: [],
|
|
17369
|
+
name: "slot0",
|
|
17370
|
+
outputs: [
|
|
17371
|
+
{
|
|
17372
|
+
internalType: "uint160",
|
|
17373
|
+
name: "sqrtPriceX96",
|
|
17374
|
+
type: "uint160"
|
|
17375
|
+
},
|
|
17376
|
+
{
|
|
17377
|
+
internalType: "int24",
|
|
17378
|
+
name: "tick",
|
|
17379
|
+
type: "int24"
|
|
17380
|
+
},
|
|
17381
|
+
{
|
|
17382
|
+
internalType: "uint16",
|
|
17383
|
+
name: "observationIndex",
|
|
17384
|
+
type: "uint16"
|
|
17385
|
+
},
|
|
17386
|
+
{
|
|
17387
|
+
internalType: "uint16",
|
|
17388
|
+
name: "observationCardinality",
|
|
17389
|
+
type: "uint16"
|
|
17390
|
+
},
|
|
17391
|
+
{
|
|
17392
|
+
internalType: "uint16",
|
|
17393
|
+
name: "observationCardinalityNext",
|
|
17394
|
+
type: "uint16"
|
|
17395
|
+
},
|
|
17396
|
+
{
|
|
17397
|
+
internalType: "bool",
|
|
17398
|
+
name: "unlocked",
|
|
17399
|
+
type: "bool"
|
|
17400
|
+
}
|
|
17401
|
+
],
|
|
17402
|
+
stateMutability: "view",
|
|
17403
|
+
type: "function"
|
|
17404
|
+
}],
|
|
17405
|
+
functionName: "slot0"
|
|
17406
|
+
});
|
|
17407
|
+
return {
|
|
17408
|
+
data: {
|
|
17409
|
+
sqrtPriceX96: slot0[0],
|
|
17410
|
+
tick: Number(slot0[1]),
|
|
17411
|
+
observationIndex: slot0[2],
|
|
17412
|
+
observationCardinality: slot0[3],
|
|
17413
|
+
observationCardinalityNext: slot0[4],
|
|
17414
|
+
feeProtocol: 0,
|
|
17415
|
+
unlocked: slot0[5]
|
|
17416
|
+
},
|
|
17417
|
+
status: 200,
|
|
17418
|
+
success: true
|
|
17419
|
+
};
|
|
17420
|
+
} catch (error) {
|
|
17421
|
+
return {
|
|
17422
|
+
data: null,
|
|
17423
|
+
status: 500,
|
|
17424
|
+
success: false,
|
|
17425
|
+
error: error instanceof Error ? error.message : "Unknown error occurred"
|
|
17426
|
+
};
|
|
17427
|
+
}
|
|
17428
|
+
}
|
|
17429
|
+
/**
|
|
17353
17430
|
* Gets global state from an Algebra pool
|
|
17354
17431
|
* @param poolAddress The pool address
|
|
17355
17432
|
* @param isDirectional Whether the pool is directional
|
|
@@ -17574,6 +17651,7 @@ async function getPoolState(publicClient, params) {
|
|
|
17574
17651
|
error: poolSharkResponse.error
|
|
17575
17652
|
};
|
|
17576
17653
|
} else if (params.isAlgebraPool) stateResponse = await getGlobalState(publicClient, params.poolAddress, params.isAlgebraDirectionPool || false);
|
|
17654
|
+
else if (params.isAerodromePool) stateResponse = await getAerodromeSlot0(publicClient, params.poolAddress);
|
|
17577
17655
|
else stateResponse = await getSlot0(publicClient, params.poolAddress);
|
|
17578
17656
|
if (!stateResponse.success || !stateResponse.data) throw new Error(stateResponse.error || "Failed to read pool state");
|
|
17579
17657
|
return {
|
|
@@ -17928,6 +18006,7 @@ var VaultDepositClient = class {
|
|
|
17928
18006
|
const poolInstanceResponse = await this.getPoolInstance({
|
|
17929
18007
|
vaultAddress,
|
|
17930
18008
|
chain: { id: chainId },
|
|
18009
|
+
isAerodromePool: isAerodromeVault(protocol),
|
|
17931
18010
|
isAlgebraPool: isAlgebraProtocol(protocol),
|
|
17932
18011
|
isPoolSharkPool: isPoolSharkProtocol(protocol),
|
|
17933
18012
|
isAlgebraIntegralPool: isAlgebraIntegralProtocol(protocol),
|
|
@@ -18018,9 +18097,14 @@ var VaultDepositClient = class {
|
|
|
18018
18097
|
unlocked: poolSharkResponse.data.unlocked === 1
|
|
18019
18098
|
}
|
|
18020
18099
|
};
|
|
18021
|
-
else slot0Response =
|
|
18022
|
-
|
|
18023
|
-
|
|
18100
|
+
else slot0Response = {
|
|
18101
|
+
data: null,
|
|
18102
|
+
status: poolSharkResponse.status,
|
|
18103
|
+
success: false,
|
|
18104
|
+
error: poolSharkResponse.error
|
|
18105
|
+
};
|
|
18106
|
+
} else if (params.isAlgebraPool) slot0Response = await getGlobalState(this.publicClient, poolData.data.id, params.isAlgebraDirectionPool);
|
|
18107
|
+
else if (params.isAerodromePool) slot0Response = await getAerodromeSlot0(this.publicClient, poolData.data.id);
|
|
18024
18108
|
else slot0Response = await getSlot0(this.publicClient, poolData.data.id);
|
|
18025
18109
|
if (!slot0Response.success || !slot0Response.data) throw new Error("Failed to read pool state");
|
|
18026
18110
|
const slot0 = slot0Response.data;
|
|
@@ -18345,6 +18429,7 @@ async function calculateLimitPrice(publicClient, params) {
|
|
|
18345
18429
|
try {
|
|
18346
18430
|
const slot0Data = await getPoolState(publicClient, {
|
|
18347
18431
|
poolAddress: params.pool,
|
|
18432
|
+
isAerodromePool: params.ammType === AMMType.Aerodrome,
|
|
18348
18433
|
isAlgebraPool: params.ammType === AMMType.Algebra,
|
|
18349
18434
|
isAlgebraIntegralPool: params.ammType === AMMType.AlgebraIntegral,
|
|
18350
18435
|
isAlgebraDirectionPool: params.ammType === AMMType.AlgebraDirectional,
|
|
@@ -18352,6 +18437,7 @@ async function calculateLimitPrice(publicClient, params) {
|
|
|
18352
18437
|
});
|
|
18353
18438
|
if (!slot0Data.success || !slot0Data.data) throw new Error(slot0Data.error || "Failed to get pool state");
|
|
18354
18439
|
const sqrtPriceX96BigInt = getPoolPrice(slot0Data.data, {
|
|
18440
|
+
isAerodromePool: params.ammType === AMMType.Aerodrome,
|
|
18355
18441
|
isAlgebraPool: params.ammType === AMMType.Algebra,
|
|
18356
18442
|
isAlgebraIntegralPool: params.ammType === AMMType.AlgebraIntegral,
|
|
18357
18443
|
isPoolSharkPool: false
|
|
@@ -18384,6 +18470,7 @@ async function getPoolSlot0(publicClient, poolAddress, ammType) {
|
|
|
18384
18470
|
try {
|
|
18385
18471
|
const poolState = await getPoolStateWithPrice(publicClient, {
|
|
18386
18472
|
poolAddress,
|
|
18473
|
+
isAerodromePool: ammType === AMMType.Aerodrome,
|
|
18387
18474
|
isAlgebraPool: ammType === AMMType.Algebra,
|
|
18388
18475
|
isAlgebraIntegralPool: ammType === AMMType.AlgebraIntegral,
|
|
18389
18476
|
isAlgebraDirectionPool: ammType === AMMType.AlgebraDirectional,
|