@1delta/margin-fetcher 0.0.329 → 0.0.331

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.
@@ -1,21 +1,28 @@
1
1
  import { MorphoGeneralPublicResponse } from '../../../types/lender/morpho-types';
2
2
  import { AdditionalYields, GenericTokenList } from '../../../types';
3
3
  import type { LiquityMarketsRaw } from './types';
4
- /** Synthesized per-branch lender key, e.g. `LIQUITY_V2_1` (= wstETH branch). */
5
- export declare function liquityLenderKey(lender: string, collIndex: number): string;
6
4
  /**
7
- * Recover `{ lender, collIndex }` from a per-branch key (or undefined for a
8
- * bare deployment key / non-family key). Fork brands share no prefix, so this
9
- * matches against the family list.
5
+ * Synthesized per-branch lender key, e.g. `LIQUITY_V2_1_1` (= mainnet wstETH
6
+ * branch). The CHAIN ID is part of the key (Fluid convention,
7
+ * `FLUID_<chainId>_<vaultId>`) so keys stay GLOBALLY unique for multi-chain
8
+ * deployments (Ebisu spans Ethereum + Plasma) — labels, yield-tracer rows and
9
+ * anything else keyed by lender_key alone would collide otherwise.
10
+ */
11
+ export declare function liquityLenderKey(lender: string, chainId: string | number, collIndex: number): string;
12
+ /**
13
+ * Recover `{ lender, chainId, collIndex }` from a per-branch key (or
14
+ * undefined for a bare deployment key / non-family key). Fork brands share no
15
+ * prefix, so this matches against the family list.
10
16
  */
11
17
  export declare function liquityKeyParts(key: string): {
12
18
  lender: string;
19
+ chainId: string;
13
20
  collIndex: number;
14
21
  } | undefined;
15
22
  /**
16
23
  * Map one deployment's on-chain branch batch into the shared
17
24
  * `MorphoGeneralPublicResponse` shape (identical to Midnight/Term/Exactly),
18
- * keyed by `<LENDER>_<COLL_INDEX>` — one key per collateral branch.
25
+ * keyed by `<LENDER>_<chainId>_<COLL_INDEX>` — one key per collateral branch.
19
26
  *
20
27
  * Per branch:
21
28
  * - the COLLATERAL entry (branch coll token): totals = branch collateral;
@@ -1 +1 @@
1
- {"version":3,"file":"convertPublic.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/liquity/convertPublic.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAA;AAChF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAGnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAEhD,gFAAgF;AAChF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAE1E;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,GACV;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAMnD;AAkBD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,+BAA+B,CAC7C,GAAG,EAAE,iBAAiB,EACtB,OAAO,EAAE,MAAM,EACf,MAAM,GAAE;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAO,EACxC,iBAAiB,GAAE,gBAIlB,EACD,MAAM,GAAE,gBAAqB,GAC5B;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,2BAA2B,CAAA;CAAE,CA4O9C"}
1
+ {"version":3,"file":"convertPublic.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/liquity/convertPublic.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAA;AAChF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAGnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAEhD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,SAAS,EAAE,MAAM,GAChB,MAAM,CAER;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,GACV;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAOpE;AAkBD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,+BAA+B,CAC7C,GAAG,EAAE,iBAAiB,EACtB,OAAO,EAAE,MAAM,EACf,MAAM,GAAE;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAO,EACxC,iBAAiB,GAAE,gBAIlB,EACD,MAAM,GAAE,gBAAqB,GAC5B;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,2BAA2B,CAAA;CAAE,CA4O9C"}
@@ -1,16 +1,22 @@
1
1
  import { MorphoGeneralPublicResponse } from '../../../types/lender/morpho-types';
2
2
  import { AdditionalYields, GenericTokenList } from '../../../types';
3
3
  import type { RiverMarketsRaw } from './types';
4
- /** Synthesized per-TroveManager lender key, e.g. `RIVER_2`. */
5
- export declare function riverLenderKey(lender: string, index: number): string;
6
- /** Recover `{ lender, index }` from a per-market key (or undefined). */
4
+ /**
5
+ * Synthesized per-TroveManager lender key, e.g. `RIVER_8453_2` (= Base cbBTC
6
+ * market). The CHAIN ID is part of the key (Fluid convention) so keys stay
7
+ * GLOBALLY unique — River deploys the same factory indexes on BNB, Base and
8
+ * Hemi with different collaterals.
9
+ */
10
+ export declare function riverLenderKey(lender: string, chainId: string | number, index: number): string;
11
+ /** Recover `{ lender, chainId, index }` from a per-market key (or undefined). */
7
12
  export declare function riverKeyParts(key: string): {
8
13
  lender: string;
14
+ chainId: string;
9
15
  index: number;
10
16
  } | undefined;
11
17
  /**
12
18
  * Map one River deployment's on-chain batch into the shared
13
- * `MorphoGeneralPublicResponse` shape, keyed by `RIVER_<TM_INDEX>` — one key
19
+ * `MorphoGeneralPublicResponse` shape, keyed by `RIVER_<chainId>_<TM_INDEX>` — one key
14
20
  * per TroveManager (collateral market).
15
21
  *
16
22
  * Per market:
@@ -1 +1 @@
1
- {"version":3,"file":"convertPublic.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/river/convertPublic.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAA;AAChF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAGnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,+DAA+D;AAC/D,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED,wEAAwE;AACxE,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,GACV;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAK/C;AAkBD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,6BAA6B,CAC3C,GAAG,EAAE,eAAe,EACpB,OAAO,EAAE,MAAM,EACf,MAAM,GAAE;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAO,EACxC,iBAAiB,GAAE,gBAIlB,EACD,MAAM,GAAE,gBAAqB,GAC5B;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,2BAA2B,CAAA;CAAE,CA6M9C"}
1
+ {"version":3,"file":"convertPublic.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/river/convertPublic.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAA;AAChF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAGnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,KAAK,EAAE,MAAM,GACZ,MAAM,CAER;AAED,iFAAiF;AACjF,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,GACV;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAMhE;AAkBD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,6BAA6B,CAC3C,GAAG,EAAE,eAAe,EACpB,OAAO,EAAE,MAAM,EACf,MAAM,GAAE;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAO,EACxC,iBAAiB,GAAE,gBAIlB,EACD,MAAM,GAAE,gBAAqB,GAC5B;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,2BAA2B,CAAA;CAAE,CA6M9C"}
@@ -1 +1 @@
1
- {"version":3,"file":"userCallParse.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/exactly/userCallParse.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,2BAA2B,EAC3B,QAAQ,EACT,MAAM,gBAAgB,CAAA;AASvB,iFAAiF;AACjF,MAAM,WAAW,wBAAwB;IACvC,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,2BAA2B;IAC3B,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAA;IAC1B,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAA;IACjB,sDAAsD;IACtD,GAAG,EAAE,MAAM,CAAA;IACX;yDACqD;IACrD,YAAY,EAAE,MAAM,CAAA;IACpB;oDACgD;IAChD,OAAO,EAAE,OAAO,CAAA;CACjB;AAqBD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,2BAA2B,GACtC,SAAS,MAAM,EACf,SAAS,MAAM,EACf,SAAS,MAAM,EACf,OAAO,2BAA2B,KACjC,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK;IAAE,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAA;CAAE,GAAG,SAAS,EAAE,MAAM,CAkItE,CAAA"}
1
+ {"version":3,"file":"userCallParse.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/exactly/userCallParse.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,2BAA2B,EAC3B,QAAQ,EACT,MAAM,gBAAgB,CAAA;AASvB,iFAAiF;AACjF,MAAM,WAAW,wBAAwB;IACvC,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,2BAA2B;IAC3B,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAA;IAC1B,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAA;IACjB,sDAAsD;IACtD,GAAG,EAAE,MAAM,CAAA;IACX;yDACqD;IACrD,YAAY,EAAE,MAAM,CAAA;IACpB;oDACgD;IAChD,OAAO,EAAE,OAAO,CAAA;CACjB;AAqBD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,2BAA2B,GACtC,SAAS,MAAM,EACf,SAAS,MAAM,EACf,SAAS,MAAM,EACf,OAAO,2BAA2B,KACjC,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK;IAAE,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAA;CAAE,GAAG,SAAS,EAAE,MAAM,CAgLtE,CAAA"}
@@ -35,7 +35,7 @@ export interface LiquitySpInfo {
35
35
  *
36
36
  * Layout mirrors `buildLiquityUserCall` (reconstructed from the discovery
37
37
  * cache + branch config — both deterministic within the request). Emits one
38
- * `UserData` per BRANCH key `<LENDER>_<COLL_INDEX>`, each containing:
38
+ * `UserData` per BRANCH key `<LENDER>_<chainId>_<COLL_INDEX>`, each containing:
39
39
  *
40
40
  * - one sub-account PER TROVE (`accountId` = decimal troveId): collateral
41
41
  * row (`entireColl`) + stable debt row (`entireDebt`, incl. accrued
@@ -11,7 +11,7 @@ export interface RiverPositionInfo {
11
11
  *
12
12
  * Layout mirrors `buildRiverUserCall` (deterministic from config — no
13
13
  * discovery cache needed). Emits one `UserData` per market key
14
- * `RIVER_<TM_INDEX>`, each with a single sub-account `'0'` (troves are
14
+ * `RIVER_<chainId>_<TM_INDEX>`, each with a single sub-account `'0'` (troves are
15
15
  * address-keyed: at most ONE per user per market): collateral row
16
16
  * (entire coll incl. pending redistribution) + satUSD debt row (entire debt)
17
17
  * with `riverInfo` (collateral surplus). The single per-chain StabilityPool
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAI9C,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,MAAM,EACN,YAAY,EACZ,UAAU,EACV,MAAM,EACN,SAAS,EACT,WAAW,EACX,eAAe,EACf,OAAO,EACP,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,MAAM,EACN,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,cAAc,EACd,WAAW,EACX,aAAa,EACb,aAAa,EACb,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,OAAO,EACP,WAAW,EACX,UAAU,GACX,MAAM,yBAAyB,CAAA;AAgDhC,eAAO,MAAM,uBAAuB,EAAE,MAAM,EAgB3C,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,GAAG,MAAM,aAuH3C,CAAA;AAED,sCAAsC;AACtC,eAAO,MAAM,uBAAuB,GAClC,YAAY,MAAM,EAAE,EACpB,eAAe,MAAM,EAAE,KACtB,MAAM,EA4BR,CAAA;AAED,mCAAmC;AACnC,eAAO,MAAM,gBAAgB;;CAS5B,CAAA;AAED,eAAO,MAAM,eAAe,GAC1B,SAAS,MAAM,GAAG,MAAM,GAAG,SAAS,EACpC,kBAAiB,MAAuB,KACvC,MAAM,EAOR,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAI9C,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,MAAM,EACN,YAAY,EACZ,UAAU,EACV,MAAM,EACN,SAAS,EACT,WAAW,EACX,eAAe,EACf,OAAO,EACP,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,MAAM,EACN,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,cAAc,EACd,WAAW,EACX,aAAa,EACb,aAAa,EACb,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,OAAO,EACP,WAAW,EACX,UAAU,GACX,MAAM,yBAAyB,CAAA;AAgDhC,eAAO,MAAM,uBAAuB,EAAE,MAAM,EAgB3C,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,GAAG,MAAM,aAkI3C,CAAA;AAED,sCAAsC;AACtC,eAAO,MAAM,uBAAuB,GAClC,YAAY,MAAM,EAAE,EACpB,eAAe,MAAM,EAAE,KACtB,MAAM,EA4BR,CAAA;AAED,mCAAmC;AACnC,eAAO,MAAM,gBAAgB;;CAS5B,CAAA;AAED,eAAO,MAAM,eAAe,GAC1B,SAAS,MAAM,GAAG,MAAM,GAAG,SAAS,EACpC,kBAAiB,MAAuB,KACvC,MAAM,EAOR,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1delta/margin-fetcher",
3
- "version": "0.0.329",
3
+ "version": "0.0.331",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "files": [
@@ -23,12 +23,12 @@
23
23
  "async-retry": "^1.3.3",
24
24
  "lodash": "^4.17.23",
25
25
  "@1delta/abis": "0.0.24",
26
- "@1delta/lender-registry": "0.0.35",
27
- "@1delta/dex-registry": "0.0.104",
28
26
  "@1delta/calldata-sdk": "0.0.159",
27
+ "@1delta/data-sdk": "0.0.32",
28
+ "@1delta/dex-registry": "0.0.104",
29
29
  "@1delta/providers": "0.0.62",
30
- "@1delta/proxy-fetch": "0.0.1",
31
- "@1delta/data-sdk": "0.0.32"
30
+ "@1delta/lender-registry": "0.0.35",
31
+ "@1delta/proxy-fetch": "0.0.1"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/async-retry": "^1.4.9",