@1delta/data-sdk 0.0.20 → 0.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.js CHANGED
@@ -40,8 +40,8 @@ globalThis[GLOBAL_LENDER_DATA_KEY] = {
40
40
  eulerConfigs: {},
41
41
  eulerVaults: {},
42
42
  aaveV4Spokes: {},
43
- aaveV4Reserves: {},
44
- aaveV4Oracles: {}
43
+ aaveV4Oracles: {},
44
+ aaveV4Peripherals: {}
45
45
  };
46
46
  function getGlobalData2() {
47
47
  return globalThis[GLOBAL_LENDER_DATA_KEY];
@@ -73,8 +73,8 @@ function initializeLenderData({
73
73
  eulerConfigsOverride,
74
74
  eulerVaultsOverride,
75
75
  aaveV4SpokesOverride,
76
- aaveV4ReservesOverride,
77
- aaveV4OraclesOverride
76
+ aaveV4OraclesOverride,
77
+ aaveV4PeripheralsOverride
78
78
  }) {
79
79
  const data = getGlobalData2();
80
80
  if (aaveTokensOverride) data.aaveTokens = aaveTokensOverride;
@@ -103,8 +103,9 @@ function initializeLenderData({
103
103
  if (eulerConfigsOverride) data.eulerConfigs = eulerConfigsOverride;
104
104
  if (eulerVaultsOverride) data.eulerVaults = eulerVaultsOverride;
105
105
  if (aaveV4SpokesOverride) data.aaveV4Spokes = aaveV4SpokesOverride;
106
- if (aaveV4ReservesOverride) data.aaveV4Reserves = aaveV4ReservesOverride;
107
106
  if (aaveV4OraclesOverride) data.aaveV4Oracles = aaveV4OraclesOverride;
107
+ if (aaveV4PeripheralsOverride)
108
+ data.aaveV4Peripherals = aaveV4PeripheralsOverride;
108
109
  }
109
110
  var aaveTokens = () => getGlobalData2()?.aaveTokens;
110
111
  var aavePools = () => getGlobalData2()?.aavePools;
@@ -132,8 +133,57 @@ var compoundV3Bulker = () => getGlobalData2()?.compoundV3Bulker;
132
133
  var eulerConfigs = () => getGlobalData2()?.eulerConfigs;
133
134
  var eulerVaults = () => getGlobalData2()?.eulerVaults;
134
135
  var aaveV4Spokes = () => getGlobalData2()?.aaveV4Spokes;
135
- var aaveV4Reserves = () => getGlobalData2()?.aaveV4Reserves;
136
136
  var aaveV4Oracles = () => getGlobalData2()?.aaveV4Oracles;
137
+ var aaveV4Peripherals = () => getGlobalData2()?.aaveV4Peripherals;
138
+ function getAaveV4SpokeEntry(chainId, lenderKey) {
139
+ const parsed = parseAaveV4SpokeLenderKey(lenderKey);
140
+ if (!parsed) return void 0;
141
+ return getGlobalData2()?.aaveV4Spokes?.[chainId]?.[parsed.spokeAddrLower];
142
+ }
143
+ function getAaveV4GatewayAddresses(chainId, lender, hubOverride) {
144
+ const c = getGlobalData2()?.aaveV4Peripherals?.[chainId];
145
+ if (!c) return {};
146
+ let hubAddr = hubOverride?.toLowerCase();
147
+ if (!hubAddr) {
148
+ const spokeEntry = getAaveV4SpokeEntry(chainId, lender);
149
+ hubAddr = spokeEntry?.reserves?.[0]?.hub?.toLowerCase();
150
+ }
151
+ const perHub = hubAddr && c.perHub?.[hubAddr] || void 0;
152
+ return {
153
+ nativeGateway: perHub?.nativeGateway ?? c.nativeGateway,
154
+ signatureGateway: perHub?.signatureGateway ?? c.signatureGateway
155
+ };
156
+ }
157
+ function getAaveV4SpokePeripherals(chainId, lenderKey) {
158
+ const parsed = parseAaveV4SpokeLenderKey(lenderKey);
159
+ if (!parsed) return void 0;
160
+ return getGlobalData2()?.aaveV4Peripherals?.[chainId]?.perSpoke?.[parsed.spokeAddrLower];
161
+ }
162
+ function getAaveV4PositionManagers(chainId, lenderKey) {
163
+ const meta = getAaveV4SpokePeripherals(chainId, lenderKey);
164
+ if (!meta?.positionManagers) return [];
165
+ return meta.positionManagers.filter((pm) => pm.active !== false && pm.address).map((pm) => pm.address.toLowerCase());
166
+ }
167
+ function findAaveV4PositionManager(chainId, lenderKey, nameQuery) {
168
+ const meta = getAaveV4SpokePeripherals(chainId, lenderKey);
169
+ if (!meta?.positionManagers) return void 0;
170
+ const q = nameQuery.toLowerCase();
171
+ const hit = meta.positionManagers.find(
172
+ (pm) => pm.active !== false && pm.address && (pm.name ?? "").toLowerCase().includes(q)
173
+ );
174
+ return hit?.address?.toLowerCase();
175
+ }
176
+ function aaveV4SpokeLenderKey(spoke) {
177
+ if (!spoke || !spoke.startsWith("0x") || spoke.length !== 42) {
178
+ throw new Error(`aaveV4SpokeLenderKey: invalid spoke address ${spoke}`);
179
+ }
180
+ return `AAVE_V4_${spoke.slice(2).toUpperCase()}`;
181
+ }
182
+ function parseAaveV4SpokeLenderKey(lenderKey) {
183
+ const match = lenderKey.match(/^AAVE_V4_([0-9A-F]{40})$/);
184
+ if (!match) return void 0;
185
+ return { spokeAddrLower: "0x" + match[1].toLowerCase() };
186
+ }
137
187
 
138
188
  // src/tokens.ts
139
189
  var getListUrl = (chainId) => `https://raw.githubusercontent.com/1delta-DAO/token-lists/main/${chainId}.json`;
@@ -157,7 +207,8 @@ exports.aavePools = aavePools;
157
207
  exports.aaveReserves = aaveReserves;
158
208
  exports.aaveTokens = aaveTokens;
159
209
  exports.aaveV4Oracles = aaveV4Oracles;
160
- exports.aaveV4Reserves = aaveV4Reserves;
210
+ exports.aaveV4Peripherals = aaveV4Peripherals;
211
+ exports.aaveV4SpokeLenderKey = aaveV4SpokeLenderKey;
161
212
  exports.aaveV4Spokes = aaveV4Spokes;
162
213
  exports.aaveWethGateway = aaveWethGateway;
163
214
  exports.chains = chains;
@@ -175,6 +226,11 @@ exports.eulerConfigs = eulerConfigs;
175
226
  exports.eulerVaults = eulerVaults;
176
227
  exports.fetchTokenList = fetchTokenList;
177
228
  exports.fetchTokenLists = fetchTokenLists;
229
+ exports.findAaveV4PositionManager = findAaveV4PositionManager;
230
+ exports.getAaveV4GatewayAddresses = getAaveV4GatewayAddresses;
231
+ exports.getAaveV4PositionManagers = getAaveV4PositionManagers;
232
+ exports.getAaveV4SpokeEntry = getAaveV4SpokeEntry;
233
+ exports.getAaveV4SpokePeripherals = getAaveV4SpokePeripherals;
178
234
  exports.initConfig = initConfig;
179
235
  exports.initializeChainData = initializeChainData;
180
236
  exports.initializeLenderData = initializeLenderData;
@@ -184,3 +240,4 @@ exports.morphoOracles = morphoOracles;
184
240
  exports.morphoPools = morphoPools;
185
241
  exports.morphoTypeMarkets = morphoTypeMarkets;
186
242
  exports.morphoTypeOracles = morphoTypeOracles;
243
+ exports.parseAaveV4SpokeLenderKey = parseAaveV4SpokeLenderKey;
package/dist/index.mjs CHANGED
@@ -38,8 +38,8 @@ globalThis[GLOBAL_LENDER_DATA_KEY] = {
38
38
  eulerConfigs: {},
39
39
  eulerVaults: {},
40
40
  aaveV4Spokes: {},
41
- aaveV4Reserves: {},
42
- aaveV4Oracles: {}
41
+ aaveV4Oracles: {},
42
+ aaveV4Peripherals: {}
43
43
  };
44
44
  function getGlobalData2() {
45
45
  return globalThis[GLOBAL_LENDER_DATA_KEY];
@@ -71,8 +71,8 @@ function initializeLenderData({
71
71
  eulerConfigsOverride,
72
72
  eulerVaultsOverride,
73
73
  aaveV4SpokesOverride,
74
- aaveV4ReservesOverride,
75
- aaveV4OraclesOverride
74
+ aaveV4OraclesOverride,
75
+ aaveV4PeripheralsOverride
76
76
  }) {
77
77
  const data = getGlobalData2();
78
78
  if (aaveTokensOverride) data.aaveTokens = aaveTokensOverride;
@@ -101,8 +101,9 @@ function initializeLenderData({
101
101
  if (eulerConfigsOverride) data.eulerConfigs = eulerConfigsOverride;
102
102
  if (eulerVaultsOverride) data.eulerVaults = eulerVaultsOverride;
103
103
  if (aaveV4SpokesOverride) data.aaveV4Spokes = aaveV4SpokesOverride;
104
- if (aaveV4ReservesOverride) data.aaveV4Reserves = aaveV4ReservesOverride;
105
104
  if (aaveV4OraclesOverride) data.aaveV4Oracles = aaveV4OraclesOverride;
105
+ if (aaveV4PeripheralsOverride)
106
+ data.aaveV4Peripherals = aaveV4PeripheralsOverride;
106
107
  }
107
108
  var aaveTokens = () => getGlobalData2()?.aaveTokens;
108
109
  var aavePools = () => getGlobalData2()?.aavePools;
@@ -130,8 +131,57 @@ var compoundV3Bulker = () => getGlobalData2()?.compoundV3Bulker;
130
131
  var eulerConfigs = () => getGlobalData2()?.eulerConfigs;
131
132
  var eulerVaults = () => getGlobalData2()?.eulerVaults;
132
133
  var aaveV4Spokes = () => getGlobalData2()?.aaveV4Spokes;
133
- var aaveV4Reserves = () => getGlobalData2()?.aaveV4Reserves;
134
134
  var aaveV4Oracles = () => getGlobalData2()?.aaveV4Oracles;
135
+ var aaveV4Peripherals = () => getGlobalData2()?.aaveV4Peripherals;
136
+ function getAaveV4SpokeEntry(chainId, lenderKey) {
137
+ const parsed = parseAaveV4SpokeLenderKey(lenderKey);
138
+ if (!parsed) return void 0;
139
+ return getGlobalData2()?.aaveV4Spokes?.[chainId]?.[parsed.spokeAddrLower];
140
+ }
141
+ function getAaveV4GatewayAddresses(chainId, lender, hubOverride) {
142
+ const c = getGlobalData2()?.aaveV4Peripherals?.[chainId];
143
+ if (!c) return {};
144
+ let hubAddr = hubOverride?.toLowerCase();
145
+ if (!hubAddr) {
146
+ const spokeEntry = getAaveV4SpokeEntry(chainId, lender);
147
+ hubAddr = spokeEntry?.reserves?.[0]?.hub?.toLowerCase();
148
+ }
149
+ const perHub = hubAddr && c.perHub?.[hubAddr] || void 0;
150
+ return {
151
+ nativeGateway: perHub?.nativeGateway ?? c.nativeGateway,
152
+ signatureGateway: perHub?.signatureGateway ?? c.signatureGateway
153
+ };
154
+ }
155
+ function getAaveV4SpokePeripherals(chainId, lenderKey) {
156
+ const parsed = parseAaveV4SpokeLenderKey(lenderKey);
157
+ if (!parsed) return void 0;
158
+ return getGlobalData2()?.aaveV4Peripherals?.[chainId]?.perSpoke?.[parsed.spokeAddrLower];
159
+ }
160
+ function getAaveV4PositionManagers(chainId, lenderKey) {
161
+ const meta = getAaveV4SpokePeripherals(chainId, lenderKey);
162
+ if (!meta?.positionManagers) return [];
163
+ return meta.positionManagers.filter((pm) => pm.active !== false && pm.address).map((pm) => pm.address.toLowerCase());
164
+ }
165
+ function findAaveV4PositionManager(chainId, lenderKey, nameQuery) {
166
+ const meta = getAaveV4SpokePeripherals(chainId, lenderKey);
167
+ if (!meta?.positionManagers) return void 0;
168
+ const q = nameQuery.toLowerCase();
169
+ const hit = meta.positionManagers.find(
170
+ (pm) => pm.active !== false && pm.address && (pm.name ?? "").toLowerCase().includes(q)
171
+ );
172
+ return hit?.address?.toLowerCase();
173
+ }
174
+ function aaveV4SpokeLenderKey(spoke) {
175
+ if (!spoke || !spoke.startsWith("0x") || spoke.length !== 42) {
176
+ throw new Error(`aaveV4SpokeLenderKey: invalid spoke address ${spoke}`);
177
+ }
178
+ return `AAVE_V4_${spoke.slice(2).toUpperCase()}`;
179
+ }
180
+ function parseAaveV4SpokeLenderKey(lenderKey) {
181
+ const match = lenderKey.match(/^AAVE_V4_([0-9A-F]{40})$/);
182
+ if (!match) return void 0;
183
+ return { spokeAddrLower: "0x" + match[1].toLowerCase() };
184
+ }
135
185
 
136
186
  // src/tokens.ts
137
187
  var getListUrl = (chainId) => `https://raw.githubusercontent.com/1delta-DAO/token-lists/main/${chainId}.json`;
@@ -149,4 +199,4 @@ async function fetchTokenLists(chainIds) {
149
199
  return Object.fromEntries(results);
150
200
  }
151
201
 
152
- export { aaveOracles, aaveOraclesConfig, aavePools, aaveReserves, aaveTokens, aaveV4Oracles, aaveV4Reserves, aaveV4Spokes, aaveWethGateway, chains, compoundV2Oracles, compoundV2Pools, compoundV2Reserves, compoundV2TokenArray, compoundV2Tokens, compoundV3BaseData, compoundV3Bulker, compoundV3OraclesData, compoundV3Pools, compoundV3Reserves, eulerConfigs, eulerVaults, fetchTokenList, fetchTokenLists, initConfig, initializeChainData, initializeLenderData, listaNativeProvider, morphoBundler3, morphoOracles, morphoPools, morphoTypeMarkets, morphoTypeOracles };
202
+ export { aaveOracles, aaveOraclesConfig, aavePools, aaveReserves, aaveTokens, aaveV4Oracles, aaveV4Peripherals, aaveV4SpokeLenderKey, aaveV4Spokes, aaveWethGateway, chains, compoundV2Oracles, compoundV2Pools, compoundV2Reserves, compoundV2TokenArray, compoundV2Tokens, compoundV3BaseData, compoundV3Bulker, compoundV3OraclesData, compoundV3Pools, compoundV3Reserves, eulerConfigs, eulerVaults, fetchTokenList, fetchTokenLists, findAaveV4PositionManager, getAaveV4GatewayAddresses, getAaveV4PositionManagers, getAaveV4SpokeEntry, getAaveV4SpokePeripherals, initConfig, initializeChainData, initializeLenderData, listaNativeProvider, morphoBundler3, morphoOracles, morphoPools, morphoTypeMarkets, morphoTypeOracles, parseAaveV4SpokeLenderKey };
package/dist/lending.d.ts CHANGED
@@ -174,18 +174,39 @@ type EulerVaultsType = {
174
174
  [chainId: string]: EulerVaultEntry[];
175
175
  };
176
176
  };
177
- type AaveV4SpokeEntry = {
177
+ export type AaveV4ReserveEntry = {
178
+ reserveId: number;
179
+ /** Hub-side asset id (scoped to the entry's `hub`) */
180
+ assetId: number;
181
+ underlying: string;
182
+ /**
183
+ * Per-reserve hub address. Set at reserve init on-chain — different
184
+ * reserves on the same spoke can have different hubs.
185
+ */
186
+ hub: string;
187
+ /** Optional per-reserve oracle override (defaults to spoke.oracle) */
188
+ oracle?: string;
189
+ oracleDecimals?: number;
190
+ };
191
+ export type AaveV4SpokeEntry = {
178
192
  spoke: string;
179
193
  oracle: string;
180
194
  label: string;
181
- hub?: string;
182
- };
183
- type AaveV4SpokesType = {
184
- [fork: string]: {
185
- [chainId: string]: AaveV4SpokeEntry[];
195
+ dynamicConfigKeyMax?: number;
196
+ /**
197
+ * UI/grouping hint only (`AAVE_V4_CORE` / `AAVE_V4_PLUS` / `AAVE_V4_PRIME`).
198
+ * NOT used for routing or lender keying.
199
+ */
200
+ baseHubAttribution?: string;
201
+ reserves: AaveV4ReserveEntry[];
202
+ };
203
+ /** Top-level: chainId → spokeAddrLower → entry */
204
+ export type AaveV4SpokesType = {
205
+ [chainId: string]: {
206
+ [spokeAddrLower: string]: AaveV4SpokeEntry;
186
207
  };
187
208
  };
188
- type AaveV4OracleEntry = {
209
+ export type AaveV4OracleEntry = {
189
210
  underlying: string;
190
211
  spoke: string;
191
212
  reserveId: number;
@@ -193,25 +214,48 @@ type AaveV4OracleEntry = {
193
214
  decimals?: number;
194
215
  source?: string;
195
216
  };
196
- type AaveV4OraclesType = {
197
- [fork: string]: {
198
- [chainId: string]: AaveV4OracleEntry[];
217
+ /** Top-level chainId only — no fork dimension. */
218
+ export type AaveV4OraclesType = {
219
+ [chainId: string]: AaveV4OracleEntry[];
220
+ };
221
+ export type AaveV4PerHubGateways = {
222
+ nativeGateway?: string;
223
+ signatureGateway?: string;
224
+ };
225
+ /**
226
+ * Per-spoke peripherals — extra metadata the lender-metadata repo carries
227
+ * for spoke-scoped concerns (curated names, position manager registry, …).
228
+ * Opaque to the data-sdk; surfaced as `any` so consumers (worker-api,
229
+ * frontend) can read it without dragging the schema into this package.
230
+ */
231
+ export type AaveV4PerSpokeMeta = {
232
+ spokeName?: string;
233
+ spokeId?: string;
234
+ positionManagers?: Array<{
235
+ name?: string;
236
+ address: string;
237
+ active?: boolean;
238
+ }>;
239
+ [k: string]: unknown;
240
+ };
241
+ export type AaveV4ChainPeripherals = {
242
+ /** Chain-wide fallback gateway addresses */
243
+ nativeGateway?: string;
244
+ signatureGateway?: string;
245
+ /** Per-hub gateway overrides (keyed by lowercase hub address) */
246
+ perHub?: {
247
+ [hubAddrLower: string]: AaveV4PerHubGateways;
199
248
  };
200
- };
201
- type AaveV4ReserveEntry = {
202
- reserveId: number;
203
- assetId: number;
204
- underlying: string;
205
- };
206
- type AaveV4ReservesType = {
207
- [fork: string]: {
208
- [chainId: string]: {
209
- [spokeAddress: string]: AaveV4ReserveEntry[];
210
- };
249
+ /** Per-spoke metadata (curated names, position managers, …) */
250
+ perSpoke?: {
251
+ [spokeAddrLower: string]: AaveV4PerSpokeMeta;
211
252
  };
212
253
  };
254
+ export type AaveV4PeripheralsType = {
255
+ [chainId: string]: AaveV4ChainPeripherals;
256
+ };
213
257
  /** Override datas used in the SDK - works across all module instances */
214
- export declare function initializeLenderData({ aaveTokensOverride, aavePoolsOverride, aaveOraclesOverride, compoundV2OraclesOverride, compoundV3OraclesDataOverride, compoundV3PoolsOverride, compoundV3BaseDataOverride, morphoPoolsOverride, compoundV2TokensOverride, compoundV2TokenArrayOverride, compoundV2PoolsOverride, initConfigOverride, aaveReservesOverride, compoundV3ReservesOverride, compoundV2ReservesOverride, morphoOraclesOverride, morphoTypeOraclesOverride, morphoTypeMarketsOverride, aaveOraclesConfigOverride, aaveWethGatewayOverride, morphoBundler3Override, listaNativeProviderOverride, compoundV3BulkerOverride, eulerConfigsOverride, eulerVaultsOverride, aaveV4SpokesOverride, aaveV4ReservesOverride, aaveV4OraclesOverride, }: {
258
+ export declare function initializeLenderData({ aaveTokensOverride, aavePoolsOverride, aaveOraclesOverride, compoundV2OraclesOverride, compoundV3OraclesDataOverride, compoundV3PoolsOverride, compoundV3BaseDataOverride, morphoPoolsOverride, compoundV2TokensOverride, compoundV2TokenArrayOverride, compoundV2PoolsOverride, initConfigOverride, aaveReservesOverride, compoundV3ReservesOverride, compoundV2ReservesOverride, morphoOraclesOverride, morphoTypeOraclesOverride, morphoTypeMarketsOverride, aaveOraclesConfigOverride, aaveWethGatewayOverride, morphoBundler3Override, listaNativeProviderOverride, compoundV3BulkerOverride, eulerConfigsOverride, eulerVaultsOverride, aaveV4SpokesOverride, aaveV4OraclesOverride, aaveV4PeripheralsOverride, }: {
215
259
  aaveTokensOverride?: AaveTokensType;
216
260
  aavePoolsOverride?: AavePoolsType;
217
261
  aaveOraclesOverride?: OracleMap;
@@ -238,8 +282,8 @@ export declare function initializeLenderData({ aaveTokensOverride, aavePoolsOver
238
282
  eulerConfigsOverride?: EulerConfigsType;
239
283
  eulerVaultsOverride?: EulerVaultsType;
240
284
  aaveV4SpokesOverride?: AaveV4SpokesType;
241
- aaveV4ReservesOverride?: AaveV4ReservesType;
242
285
  aaveV4OraclesOverride?: AaveV4OraclesType;
286
+ aaveV4PeripheralsOverride?: AaveV4PeripheralsType;
243
287
  }): void;
244
288
  export declare const aaveTokens: () => AaveTokensType;
245
289
  export declare const aavePools: () => AavePoolsType;
@@ -267,6 +311,91 @@ export declare const compoundV3Bulker: () => CompoundV3BulkerType;
267
311
  export declare const eulerConfigs: () => EulerConfigsType;
268
312
  export declare const eulerVaults: () => EulerVaultsType;
269
313
  export declare const aaveV4Spokes: () => AaveV4SpokesType;
270
- export declare const aaveV4Reserves: () => AaveV4ReservesType;
271
314
  export declare const aaveV4Oracles: () => AaveV4OraclesType;
315
+ export declare const aaveV4Peripherals: () => AaveV4PeripheralsType;
316
+ /**
317
+ * Look up the spoke entry for a per-spoke V4 lender key (`AAVE_V4_<HEX>`).
318
+ * Returns `undefined` if no entry exists for that chain/spoke.
319
+ */
320
+ export declare function getAaveV4SpokeEntry(chainId: string, lenderKey: string): AaveV4SpokeEntry | undefined;
321
+ /**
322
+ * Native / signature gateway addresses for Aave V4.
323
+ *
324
+ * Resolves the spoke from the per-spoke lender key (`AAVE_V4_<HEX>`),
325
+ * picks the spoke's first reserve to learn its hub, and looks up
326
+ * `peripherals[chainId].perHub[hub]`. Falls back to the chain-level
327
+ * default gateways if no per-hub override is set.
328
+ *
329
+ * If the caller passes a hub address directly via `hubOverride`, that
330
+ * takes precedence.
331
+ */
332
+ export declare function getAaveV4GatewayAddresses(chainId: string, lender: string, hubOverride?: string): {
333
+ nativeGateway?: string;
334
+ signatureGateway?: string;
335
+ };
336
+ /**
337
+ * Look up the per-spoke peripherals metadata for a V4 spoke.
338
+ *
339
+ * Sourced from `aave-v4-peripherals.json` `perSpoke[<spokeAddrLower>]`.
340
+ * Carries curated extras the metadata team maintains alongside the core
341
+ * registry — most usefully the position-manager registry. Returns
342
+ * `undefined` if no entry exists for the spoke or if the lender key is
343
+ * not a per-spoke V4 key.
344
+ *
345
+ * Note: the spoke's `label` (curated UI name) lives directly on the
346
+ * `AaveV4SpokeEntry` from `aaveV4Spokes()` — `perSpoke.spokeName` is a
347
+ * duplicate of that and is intentionally not surfaced through the public-
348
+ * data normalizer. Read it through this helper if a consumer needs the
349
+ * exact value from the peripherals file.
350
+ */
351
+ export declare function getAaveV4SpokePeripherals(chainId: string, lenderKey: string): AaveV4PerSpokeMeta | undefined;
352
+ /**
353
+ * Active position-manager addresses for an Aave V4 spoke.
354
+ *
355
+ * Returns the lowercase addresses of every entry in
356
+ * `perSpoke[<spoke>].positionManagers` whose `active` flag is truthy.
357
+ * Empty array if the spoke has no peripherals entry or no active PMs.
358
+ *
359
+ * Use the `byName` lookup form when you need a specific PM (e.g. the
360
+ * native gateway). Names are matched case-insensitively against the
361
+ * curated `name` field; partial matches are accepted.
362
+ */
363
+ export declare function getAaveV4PositionManagers(chainId: string, lenderKey: string): string[];
364
+ /**
365
+ * Look up a single position-manager address by curated name (partial,
366
+ * case-insensitive). Returns `undefined` if no match. Useful for
367
+ * targeting specific PMs like `"native gateway"` or `"signature gateway"`
368
+ * without hardcoding the addresses.
369
+ */
370
+ export declare function findAaveV4PositionManager(chainId: string, lenderKey: string, nameQuery: string): string | undefined;
371
+ /**
372
+ * Synthesize the per-spoke lender key for an Aave V4 spoke.
373
+ *
374
+ * Mirrors the Morpho `MORPHO_BLUE_<HEX_NO_0X_UPPER>` convention so the rest
375
+ * of the codebase can treat each spoke as an isolated market — exactly like a
376
+ * Morpho Blue market or a Compound V3 Comet — without any V4-specific logic.
377
+ *
378
+ * Format: `AAVE_V4_${spokeAddr.slice(2).toUpperCase()}`
379
+ *
380
+ * Example:
381
+ * spoke = "0x94e7a5dcbe816e498b89ab752661904e2f56c485"
382
+ * → = "AAVE_V4_94E7A5DCBE816E498B89AB752661904E2F56C485"
383
+ *
384
+ * The full spoke address is preserved (no truncation) so the key is globally
385
+ * unique and stable across spoke implementation upgrades (proxy address).
386
+ * Note: chainId is intentionally NOT in the lender token — the same spoke
387
+ * address can in principle exist on multiple chains via deterministic
388
+ * deploys, and chain scoping happens at the marketUid level instead.
389
+ *
390
+ * `isAaveV4Type()` continues to work because it uses `startsWith('AAVE_V4')`.
391
+ */
392
+ export declare function aaveV4SpokeLenderKey(spoke: string): string;
393
+ /**
394
+ * Inverse of `aaveV4SpokeLenderKey`: given a per-spoke lender key, return
395
+ * `{ spokeAddrLower }`. Returns `undefined` if the key isn't a per-spoke V4
396
+ * key (e.g. someone passed the bare prefix `AAVE_V4`).
397
+ */
398
+ export declare function parseAaveV4SpokeLenderKey(lenderKey: string): {
399
+ spokeAddrLower: string;
400
+ } | undefined;
272
401
  export {};
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.0.20",
7
+ "version": "0.0.21",
8
8
  "description": "Hold and initialize lending protocol data across a stack",
9
9
  "files": [
10
10
  "dist"