@steerprotocol/sdk 3.0.24 → 3.0.27
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 +32 -10
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.cjs +32 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +3 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +32 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.browser.mjs
CHANGED
|
@@ -256,9 +256,15 @@ let MultiPositionManagers = /* @__PURE__ */ function(MultiPositionManagers) {
|
|
|
256
256
|
MultiPositionManagers["MultiPositionBittensorUniV3"] = "MultiPositionBittensorUniV3";
|
|
257
257
|
MultiPositionManagers["MultiPositionReserveV4"] = "MultiPositionReserveV4";
|
|
258
258
|
MultiPositionManagers["TestCypherAlgebraIntegralHook"] = "TestCypherAlgebraIntegralHook";
|
|
259
|
+
MultiPositionManagers["TestQuickswapAlgebraIntegralHook"] = "TestQuickswapAlgebraIntegralHook";
|
|
259
260
|
return MultiPositionManagers;
|
|
260
261
|
}({});
|
|
261
|
-
const AlgebgraHookBeacons = [
|
|
262
|
+
const AlgebgraHookBeacons = [
|
|
263
|
+
MultiPositionManagers.MultiPositionHenjinAlgebraHook,
|
|
264
|
+
MultiPositionManagers.AlgebraHook,
|
|
265
|
+
MultiPositionManagers.TestCypherAlgebraIntegralHook,
|
|
266
|
+
MultiPositionManagers.TestQuickswapAlgebraIntegralHook
|
|
267
|
+
];
|
|
262
268
|
const UniswapHookBeacons = [
|
|
263
269
|
MultiPositionManagers.MultiPositionUniswapV4Hook,
|
|
264
270
|
MultiPositionManagers.MultiPositionUniswapV4HookOld,
|
|
@@ -14429,7 +14435,11 @@ const quickSwapAlgebraConfig = () => ({
|
|
|
14429
14435
|
const quickSwapIntegralConfig = (theGraphApiKey) => ({
|
|
14430
14436
|
beaconContract: MultiPositionManagers.MultiPositionQuickSwapIntegral,
|
|
14431
14437
|
beaconAlgebraHook: MultiPositionManagers.AlgebraHook,
|
|
14432
|
-
algebraHookSupportedChains: [Chain.Base],
|
|
14438
|
+
algebraHookSupportedChains: [Chain.Base, Chain.Polygon],
|
|
14439
|
+
algebraHookBeaconsByChain: {
|
|
14440
|
+
[Chain.Base]: [MultiPositionManagers.AlgebraHook],
|
|
14441
|
+
[Chain.Polygon]: [MultiPositionManagers.TestQuickswapAlgebraIntegralHook]
|
|
14442
|
+
},
|
|
14433
14443
|
subgraph: {
|
|
14434
14444
|
[Chain.Soneium]: getTheGraphResolverUrl("3GsT6AiuDiSzh2fXbFxUKtBxT8rBEGVdQCgHSsKMPHiu", false, theGraphApiKey),
|
|
14435
14445
|
[Chain.Base]: getTheGraphResolverUrl("U65NKb6BsDPGqugPAda58ebMLa1RqeMFT76fndB77oe", false, theGraphApiKey),
|
|
@@ -14975,10 +14985,12 @@ const cypherConfig = (theGraphApiKey) => ({
|
|
|
14975
14985
|
beaconContract: MultiPositionManagers.MultiPositionCypher,
|
|
14976
14986
|
algebraHookSupportedChains: [Chain.Mainnet],
|
|
14977
14987
|
beaconAlgebraHook: MultiPositionManagers.TestCypherAlgebraIntegralHook,
|
|
14988
|
+
algebraHookBeaconsByChain: { [Chain.Mainnet]: [MultiPositionManagers.TestCypherAlgebraIntegralHook] },
|
|
14978
14989
|
subgraph: { [Chain.Mainnet]: getTheGraphResolverUrl("8knsFRJjoEtsRECVSdxhfbvidipCMdBjXx1hQmMRujHx", false, theGraphApiKey) },
|
|
14979
14990
|
factoryAddress: { [Chain.Mainnet]: "0xfb8Ed3485EfA29a0e4bed93351dD51B59fC4b0f0" },
|
|
14980
14991
|
TickLensAddress: { [Chain.Mainnet]: "0x4DA465E96E586B127ac0c8d02871Aa73F226cCC4" },
|
|
14981
|
-
Quoter: { [Chain.Mainnet]: "0xeae871C4a8dD267146558C362c86805FB7e3Fd2F" }
|
|
14992
|
+
Quoter: { [Chain.Mainnet]: "0xeae871C4a8dD267146558C362c86805FB7e3Fd2F" },
|
|
14993
|
+
EntryPointAddress: { [Chain.Mainnet]: "0x79616564DB0294ecBa5912f1cE985FD1c11eeF51" }
|
|
14982
14994
|
});
|
|
14983
14995
|
//#endregion
|
|
14984
14996
|
//#region src/const/amm/configs/protocols/spark-integral.ts
|
|
@@ -15289,8 +15301,10 @@ const CUSTOM_BEACON_TO_PROTOCOL_MAP = {
|
|
|
15289
15301
|
[MultiPositionManagers.MultiPositionBittensorUniV3]: Protocol.BittensorUniV3,
|
|
15290
15302
|
[MultiPositionManagers.MultiPositionAerodromeV3]: Protocol.AerodromeV3,
|
|
15291
15303
|
[MultiPositionManagers.MultiPositionReserveV4]: Protocol.UniswapV4,
|
|
15292
|
-
[MultiPositionManagers.TestCypherAlgebraIntegralHook]: Protocol.Cypher
|
|
15304
|
+
[MultiPositionManagers.TestCypherAlgebraIntegralHook]: Protocol.Cypher,
|
|
15305
|
+
[MultiPositionManagers.TestQuickswapAlgebraIntegralHook]: Protocol.QuickSwapIntegral
|
|
15293
15306
|
};
|
|
15307
|
+
const getCustomProtocolByBeacon = (beacon) => CUSTOM_BEACON_TO_PROTOCOL_MAP[beacon] || Object.entries(CUSTOM_BEACON_TO_PROTOCOL_MAP).find(([customBeacon]) => customBeacon.toLowerCase() === beacon.toLowerCase())?.[1];
|
|
15294
15308
|
/**`
|
|
15295
15309
|
* Retrieves the beacon name associated with a given protocol.
|
|
15296
15310
|
*
|
|
@@ -15318,10 +15332,13 @@ function getBeaconNameByProtocol(protocol) {
|
|
|
15318
15332
|
*/
|
|
15319
15333
|
const getProtocolConfigByBeacon = (beacon, theGraphApiKey) => {
|
|
15320
15334
|
if (!beacon) return null;
|
|
15335
|
+
const protocolConfig = getAmmConfig(theGraphApiKey);
|
|
15336
|
+
const customProtocol = getCustomProtocolByBeacon(beacon);
|
|
15337
|
+
if (customProtocol) return protocolConfig[customProtocol];
|
|
15321
15338
|
const beaconLower = beacon.toLowerCase();
|
|
15322
15339
|
const matchedProtocol = Object.entries(BEACON_TO_PROTOCOL_MAP).find(([key]) => beaconLower.includes(key));
|
|
15323
15340
|
if (!matchedProtocol) return null;
|
|
15324
|
-
return
|
|
15341
|
+
return protocolConfig[matchedProtocol[1]];
|
|
15325
15342
|
};
|
|
15326
15343
|
/**
|
|
15327
15344
|
* Determines the protocol type from a given beacon identifier.
|
|
@@ -15336,7 +15353,8 @@ const getProtocolConfigByBeacon = (beacon, theGraphApiKey) => {
|
|
|
15336
15353
|
*/
|
|
15337
15354
|
function getProtocolTypeByBeacon(beacon) {
|
|
15338
15355
|
if (!beacon) return null;
|
|
15339
|
-
|
|
15356
|
+
const customProtocol = getCustomProtocolByBeacon(beacon);
|
|
15357
|
+
if (customProtocol) return customProtocol;
|
|
15340
15358
|
const beaconLower = beacon.toLowerCase();
|
|
15341
15359
|
const matchedProtocol = Object.entries(BEACON_TO_SUPPORTED_PROTOCOL_MAP).sort(([a], [b]) => b.length - a.length).find(([key]) => beaconLower.includes(key));
|
|
15342
15360
|
return matchedProtocol ? matchedProtocol[1] : null;
|
|
@@ -19621,14 +19639,18 @@ var VaultClient = class extends SubgraphClient {
|
|
|
19621
19639
|
const normalizedProtocol = this.normalizeProtocolValue(protocol);
|
|
19622
19640
|
return Object.values(Protocol).find((protocolValue) => this.normalizeProtocolValue(protocolValue) === normalizedProtocol) || null;
|
|
19623
19641
|
}
|
|
19624
|
-
getProtocolBeaconNames(protocol) {
|
|
19642
|
+
getProtocolBeaconNames(protocol, chainId) {
|
|
19625
19643
|
const resolvedProtocol = this.resolveProtocolEnum(protocol);
|
|
19626
19644
|
if (!resolvedProtocol) return [];
|
|
19627
19645
|
const protocolConfig = getAmmConfig(this.subgraphStudioKey)[resolvedProtocol];
|
|
19628
19646
|
const beaconNames = [];
|
|
19647
|
+
const chain = chainId ? chainIdToName(chainId) : void 0;
|
|
19629
19648
|
if (protocolConfig?.beaconContract) beaconNames.push(protocolConfig.beaconContract);
|
|
19630
19649
|
if (protocolConfig?.additionalBeaconContracts?.length) beaconNames.push(...protocolConfig.additionalBeaconContracts);
|
|
19631
19650
|
if (protocolConfig?.beaconContractSushiManaged) beaconNames.push(protocolConfig.beaconContractSushiManaged);
|
|
19651
|
+
if (protocolConfig?.algebraHookBeaconsByChain) if (chain) beaconNames.push(...protocolConfig.algebraHookBeaconsByChain[chain] || []);
|
|
19652
|
+
else beaconNames.push(...Object.values(protocolConfig.algebraHookBeaconsByChain).flat());
|
|
19653
|
+
if (protocolConfig?.beaconAlgebraHook && (!chain || protocolConfig.algebraHookSupportedChains?.includes(chain) && !protocolConfig.algebraHookBeaconsByChain?.[chain]?.length)) beaconNames.push(protocolConfig.beaconAlgebraHook);
|
|
19632
19654
|
if (resolvedProtocol === Protocol.Blackhole) beaconNames.push(MultiPositionManagers.MultiPositionBlackholeOld);
|
|
19633
19655
|
const beaconAlias = getBeaconNameByProtocol(resolvedProtocol);
|
|
19634
19656
|
if (beaconAlias) beaconNames.push(beaconAlias);
|
|
@@ -19670,7 +19692,7 @@ var VaultClient = class extends SubgraphClient {
|
|
|
19670
19692
|
const normalizedExpectedBeacon = this.normalizeProtocolValue(expectedBeacon);
|
|
19671
19693
|
if (normalizedExpectedBeacon.length > 0 && normalizedBeaconName.includes(normalizedExpectedBeacon)) return true;
|
|
19672
19694
|
if (!resolvedProtocol) return false;
|
|
19673
|
-
return this.getProtocolBeaconNames(resolvedProtocol).some((beacon) => {
|
|
19695
|
+
return this.getProtocolBeaconNames(resolvedProtocol, vault.chainId).some((beacon) => {
|
|
19674
19696
|
const normalizedBeacon = this.normalizeProtocolValue(beacon);
|
|
19675
19697
|
return normalizedBeacon.length > 0 && normalizedBeaconName === normalizedBeacon;
|
|
19676
19698
|
});
|
|
@@ -19974,7 +19996,7 @@ var VaultClient = class extends SubgraphClient {
|
|
|
19974
19996
|
if (!chain) throw new Error(`Unsupported chainId: ${chainId}`);
|
|
19975
19997
|
const subgraphUrl = steerSubgraphConfig[chain];
|
|
19976
19998
|
if (!subgraphUrl) throw new Error(`No subgraph configured for chain: ${chain}`);
|
|
19977
|
-
const beaconNames = this.getProtocolBeaconNames(filter?.protocol);
|
|
19999
|
+
const beaconNames = this.getProtocolBeaconNames(filter?.protocol, chainId);
|
|
19978
20000
|
if (filter?.beaconName) beaconNames.push(filter.beaconName);
|
|
19979
20001
|
const uniqueBeaconNames = [...new Set(beaconNames.filter((name) => name.length > 0))];
|
|
19980
20002
|
const subgraphVaults = await this.subgraphVaultClient.getAllVaultsFromSubgraph({
|
|
@@ -20094,7 +20116,7 @@ var VaultClient = class extends SubgraphClient {
|
|
|
20094
20116
|
if (!chain) throw new Error(`Unsupported chainId: ${chainId}`);
|
|
20095
20117
|
const subgraphUrl = steerSubgraphConfig[chain];
|
|
20096
20118
|
if (!subgraphUrl) throw new Error(`No subgraph configured for chain: ${chain}`);
|
|
20097
|
-
const beaconNames = this.getProtocolBeaconNames(filter?.protocol);
|
|
20119
|
+
const beaconNames = this.getProtocolBeaconNames(filter?.protocol, chainId);
|
|
20098
20120
|
if (filter?.beaconName) beaconNames.push(filter.beaconName);
|
|
20099
20121
|
const uniqueBeaconNames = [...new Set(beaconNames.filter((name) => name.length > 0))];
|
|
20100
20122
|
const subgraphVaults = await this.subgraphVaultClient.getAllVaultsFromSubgraph({
|