@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.cjs CHANGED
@@ -14433,21 +14433,28 @@ const quickSwapIntegralConfig = (theGraphApiKey) => ({
14433
14433
  algebraHookSupportedChains: [Chain.Base],
14434
14434
  subgraph: {
14435
14435
  [Chain.Soneium]: getTheGraphResolverUrl("3GsT6AiuDiSzh2fXbFxUKtBxT8rBEGVdQCgHSsKMPHiu", false, theGraphApiKey),
14436
- [Chain.Base]: getTheGraphResolverUrl("U65NKb6BsDPGqugPAda58ebMLa1RqeMFT76fndB77oe", false, theGraphApiKey)
14436
+ [Chain.Base]: getTheGraphResolverUrl("U65NKb6BsDPGqugPAda58ebMLa1RqeMFT76fndB77oe", false, theGraphApiKey),
14437
+ [Chain.Polygon]: getTheGraphResolverUrl("5JUgNJk47FJRjKRzhZ8JtBpWQA4GyRFzNQFCKNpxkvCM", false, theGraphApiKey)
14437
14438
  },
14438
14439
  factoryAddress: {
14439
14440
  [Chain.Soneium]: "0x8Ff309F68F6Caf77a78E9C20d2Af7Ed4bE2D7093",
14440
- [Chain.Base]: "0xC5396866754799B9720125B104AE01d935Ab9C7b"
14441
+ [Chain.Base]: "0xC5396866754799B9720125B104AE01d935Ab9C7b",
14442
+ [Chain.Polygon]: "0x134c1dBE4860A9cAaf89002574fFe814772D9904"
14441
14443
  },
14442
14444
  TickLensAddress: {
14443
14445
  [Chain.Soneium]: "0x9AfA76331a01b1b25289306fbD72A4e032FDFe06",
14444
- [Chain.Base]: "0xC73e303fb323DDFB446E2Cc8c0f1B8199e7930f4"
14446
+ [Chain.Base]: "0xC73e303fb323DDFB446E2Cc8c0f1B8199e7930f4",
14447
+ [Chain.Polygon]: "0x28aDcf283d392e3902F49A7E9A78E40D64348290"
14445
14448
  },
14446
14449
  QuoterV2Address: {
14447
14450
  [Chain.Base]: "0x23E0583a3a000d567bB3848115065c1890D87fb5",
14448
- [Chain.Soneium]: "0x22e5195BcC9b0C87f330FbCE2755B263662578E2"
14451
+ [Chain.Soneium]: "0x22e5195BcC9b0C87f330FbCE2755B263662578E2",
14452
+ [Chain.Polygon]: "0xa062c2754864F67a259b346D0D7567b2ed406e6E"
14449
14453
  },
14450
- EntryPointAddress: { [Chain.Base]: "0xb9ce7698cE3dCf21cc88bf7dCc1fE20C85E4226E" }
14454
+ EntryPointAddress: {
14455
+ [Chain.Base]: "0xb9ce7698cE3dCf21cc88bf7dCc1fE20C85E4226E",
14456
+ [Chain.Polygon]: "0xfcfE065bc131Fa8Bb31A227b2fF4F0EC47D3F1a2"
14457
+ }
14451
14458
  });
14452
14459
  //#endregion
14453
14460
  //#region src/const/amm/configs/protocols/quickswap-univ3.ts
@@ -40688,6 +40695,76 @@ async function getSlot0(publicClient, poolAddress) {
40688
40695
  }
40689
40696
  }
40690
40697
  /**
40698
+ * Gets slot0 data from an Aerodrome V3 pool
40699
+ * @param poolAddress The pool address
40700
+ */
40701
+ async function getAerodromeSlot0(publicClient, poolAddress) {
40702
+ try {
40703
+ const slot0 = await publicClient.readContract({
40704
+ address: poolAddress,
40705
+ abi: [{
40706
+ inputs: [],
40707
+ name: "slot0",
40708
+ outputs: [
40709
+ {
40710
+ internalType: "uint160",
40711
+ name: "sqrtPriceX96",
40712
+ type: "uint160"
40713
+ },
40714
+ {
40715
+ internalType: "int24",
40716
+ name: "tick",
40717
+ type: "int24"
40718
+ },
40719
+ {
40720
+ internalType: "uint16",
40721
+ name: "observationIndex",
40722
+ type: "uint16"
40723
+ },
40724
+ {
40725
+ internalType: "uint16",
40726
+ name: "observationCardinality",
40727
+ type: "uint16"
40728
+ },
40729
+ {
40730
+ internalType: "uint16",
40731
+ name: "observationCardinalityNext",
40732
+ type: "uint16"
40733
+ },
40734
+ {
40735
+ internalType: "bool",
40736
+ name: "unlocked",
40737
+ type: "bool"
40738
+ }
40739
+ ],
40740
+ stateMutability: "view",
40741
+ type: "function"
40742
+ }],
40743
+ functionName: "slot0"
40744
+ });
40745
+ return {
40746
+ data: {
40747
+ sqrtPriceX96: slot0[0],
40748
+ tick: Number(slot0[1]),
40749
+ observationIndex: slot0[2],
40750
+ observationCardinality: slot0[3],
40751
+ observationCardinalityNext: slot0[4],
40752
+ feeProtocol: 0,
40753
+ unlocked: slot0[5]
40754
+ },
40755
+ status: 200,
40756
+ success: true
40757
+ };
40758
+ } catch (error) {
40759
+ return {
40760
+ data: null,
40761
+ status: 500,
40762
+ success: false,
40763
+ error: error instanceof Error ? error.message : "Unknown error occurred"
40764
+ };
40765
+ }
40766
+ }
40767
+ /**
40691
40768
  * Gets global state from an Algebra pool
40692
40769
  * @param poolAddress The pool address
40693
40770
  * @param isDirectional Whether the pool is directional
@@ -40912,6 +40989,7 @@ async function getPoolState(publicClient, params) {
40912
40989
  error: poolSharkResponse.error
40913
40990
  };
40914
40991
  } else if (params.isAlgebraPool) stateResponse = await getGlobalState(publicClient, params.poolAddress, params.isAlgebraDirectionPool || false);
40992
+ else if (params.isAerodromePool) stateResponse = await getAerodromeSlot0(publicClient, params.poolAddress);
40915
40993
  else stateResponse = await getSlot0(publicClient, params.poolAddress);
40916
40994
  if (!stateResponse.success || !stateResponse.data) throw new Error(stateResponse.error || "Failed to read pool state");
40917
40995
  return {
@@ -41266,6 +41344,7 @@ var VaultDepositClient = class {
41266
41344
  const poolInstanceResponse = await this.getPoolInstance({
41267
41345
  vaultAddress,
41268
41346
  chain: { id: chainId },
41347
+ isAerodromePool: isAerodromeVault(protocol),
41269
41348
  isAlgebraPool: isAlgebraProtocol(protocol),
41270
41349
  isPoolSharkPool: isPoolSharkProtocol(protocol),
41271
41350
  isAlgebraIntegralPool: isAlgebraIntegralProtocol(protocol),
@@ -41356,9 +41435,14 @@ var VaultDepositClient = class {
41356
41435
  unlocked: poolSharkResponse.data.unlocked === 1
41357
41436
  }
41358
41437
  };
41359
- else slot0Response = poolSharkResponse;
41360
- }
41361
- if (params.isAlgebraPool) slot0Response = await getGlobalState(this.publicClient, poolData.data.id, params.isAlgebraDirectionPool);
41438
+ else slot0Response = {
41439
+ data: null,
41440
+ status: poolSharkResponse.status,
41441
+ success: false,
41442
+ error: poolSharkResponse.error
41443
+ };
41444
+ } else if (params.isAlgebraPool) slot0Response = await getGlobalState(this.publicClient, poolData.data.id, params.isAlgebraDirectionPool);
41445
+ else if (params.isAerodromePool) slot0Response = await getAerodromeSlot0(this.publicClient, poolData.data.id);
41362
41446
  else slot0Response = await getSlot0(this.publicClient, poolData.data.id);
41363
41447
  if (!slot0Response.success || !slot0Response.data) throw new Error("Failed to read pool state");
41364
41448
  const slot0 = slot0Response.data;
@@ -41683,6 +41767,7 @@ async function calculateLimitPrice(publicClient, params) {
41683
41767
  try {
41684
41768
  const slot0Data = await getPoolState(publicClient, {
41685
41769
  poolAddress: params.pool,
41770
+ isAerodromePool: params.ammType === AMMType.Aerodrome,
41686
41771
  isAlgebraPool: params.ammType === AMMType.Algebra,
41687
41772
  isAlgebraIntegralPool: params.ammType === AMMType.AlgebraIntegral,
41688
41773
  isAlgebraDirectionPool: params.ammType === AMMType.AlgebraDirectional,
@@ -41690,6 +41775,7 @@ async function calculateLimitPrice(publicClient, params) {
41690
41775
  });
41691
41776
  if (!slot0Data.success || !slot0Data.data) throw new Error(slot0Data.error || "Failed to get pool state");
41692
41777
  const sqrtPriceX96BigInt = getPoolPrice(slot0Data.data, {
41778
+ isAerodromePool: params.ammType === AMMType.Aerodrome,
41693
41779
  isAlgebraPool: params.ammType === AMMType.Algebra,
41694
41780
  isAlgebraIntegralPool: params.ammType === AMMType.AlgebraIntegral,
41695
41781
  isPoolSharkPool: false
@@ -41722,6 +41808,7 @@ async function getPoolSlot0(publicClient, poolAddress, ammType) {
41722
41808
  try {
41723
41809
  const poolState = await getPoolStateWithPrice(publicClient, {
41724
41810
  poolAddress,
41811
+ isAerodromePool: ammType === AMMType.Aerodrome,
41725
41812
  isAlgebraPool: ammType === AMMType.Algebra,
41726
41813
  isAlgebraIntegralPool: ammType === AMMType.AlgebraIntegral,
41727
41814
  isAlgebraDirectionPool: ammType === AMMType.AlgebraDirectional,