@xoxno/types 1.0.465 → 1.0.467
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/stellar-lending/documents/hub-asset.doc.d.ts +7 -6
- package/dist/stellar-lending/documents/hub-asset.doc.js +7 -6
- package/dist/stellar-lending/index.d.ts +1 -0
- package/dist/stellar-lending/index.js +1 -0
- package/dist/stellar-lending/list.d.ts +2 -0
- package/dist/stellar-lending/live-state.d.ts +23 -0
- package/dist/stellar-lending/live-state.js +2 -0
- package/package.json +2 -2
|
@@ -2,6 +2,10 @@ import { StellarLendingDataType } from '../enums';
|
|
|
2
2
|
/**
|
|
3
3
|
* Liquidity truth for one asset on one hub (`hubAsset:{hubId}:{asset}`). IRM +
|
|
4
4
|
* state + derived APY/utilization are event-sourced from the pool contract.
|
|
5
|
+
* `suppliedScaledRay`/`borrowedScaledRay`/`revenueScaledRay` hold the RAY-scaled
|
|
6
|
+
* shares straight from the event; multiply by the live supply/borrow index and
|
|
7
|
+
* denominate on read to recover token amounts. `cash` is the plain token
|
|
8
|
+
* base-unit balance (not index-scaled).
|
|
5
9
|
*/
|
|
6
10
|
export declare class StellarHubAssetDoc {
|
|
7
11
|
dataType: StellarLendingDataType;
|
|
@@ -21,12 +25,9 @@ export declare class StellarHubAssetDoc {
|
|
|
21
25
|
supplyIndexRay: string;
|
|
22
26
|
borrowIndexRay: string;
|
|
23
27
|
cash: string;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
suppliedShort: number;
|
|
28
|
-
borrowedShort: number;
|
|
29
|
-
cashShort: number;
|
|
28
|
+
suppliedScaledRay: string;
|
|
29
|
+
borrowedScaledRay: string;
|
|
30
|
+
revenueScaledRay: string;
|
|
30
31
|
supplyApy: number;
|
|
31
32
|
borrowApy: number;
|
|
32
33
|
utilization: number;
|
|
@@ -5,6 +5,10 @@ const enums_1 = require("../enums");
|
|
|
5
5
|
/**
|
|
6
6
|
* Liquidity truth for one asset on one hub (`hubAsset:{hubId}:{asset}`). IRM +
|
|
7
7
|
* state + derived APY/utilization are event-sourced from the pool contract.
|
|
8
|
+
* `suppliedScaledRay`/`borrowedScaledRay`/`revenueScaledRay` hold the RAY-scaled
|
|
9
|
+
* shares straight from the event; multiply by the live supply/borrow index and
|
|
10
|
+
* denominate on read to recover token amounts. `cash` is the plain token
|
|
11
|
+
* base-unit balance (not index-scaled).
|
|
8
12
|
*/
|
|
9
13
|
class StellarHubAssetDoc {
|
|
10
14
|
constructor(props) {
|
|
@@ -23,12 +27,9 @@ class StellarHubAssetDoc {
|
|
|
23
27
|
this.supplyIndexRay = '0';
|
|
24
28
|
this.borrowIndexRay = '0';
|
|
25
29
|
this.cash = '0';
|
|
26
|
-
this.
|
|
27
|
-
this.
|
|
28
|
-
this.
|
|
29
|
-
this.suppliedShort = 0;
|
|
30
|
-
this.borrowedShort = 0;
|
|
31
|
-
this.cashShort = 0;
|
|
30
|
+
this.suppliedScaledRay = '0';
|
|
31
|
+
this.borrowedScaledRay = '0';
|
|
32
|
+
this.revenueScaledRay = '0';
|
|
32
33
|
this.supplyApy = 0;
|
|
33
34
|
this.borrowApy = 0;
|
|
34
35
|
this.utilization = 0;
|
|
@@ -20,4 +20,5 @@ __exportStar(require("./documents"), exports);
|
|
|
20
20
|
__exportStar(require("./list"), exports);
|
|
21
21
|
__exportStar(require("./context"), exports);
|
|
22
22
|
__exportStar(require("./api-dto"), exports);
|
|
23
|
+
__exportStar(require("./live-state"), exports);
|
|
23
24
|
__exportStar(require("./kusto"), exports);
|
|
@@ -131,6 +131,8 @@ export interface StellarSpokeListItem {
|
|
|
131
131
|
name: string | null;
|
|
132
132
|
/** Primary connected hub (`connectedHubIds[0]`); a spoke may span hubs. */
|
|
133
133
|
hubId: number;
|
|
134
|
+
/** Every hub connected to the spoke. */
|
|
135
|
+
connectedHubIds: number[];
|
|
134
136
|
/** Total value locked (USD); equals total deposits across reserves. */
|
|
135
137
|
tvlUsd: number;
|
|
136
138
|
totalBorrowsUsd: number;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ActivityChain } from '../enums/common.enum';
|
|
2
|
+
/** Live controller index for one Stellar `(hub, asset)` market. */
|
|
3
|
+
export interface StellarMarketIndexByHub {
|
|
4
|
+
hubId: number;
|
|
5
|
+
asset: string;
|
|
6
|
+
supplyIndex: string;
|
|
7
|
+
supplyIndexShort: number;
|
|
8
|
+
borrowIndex: string;
|
|
9
|
+
borrowIndexShort: number;
|
|
10
|
+
usdPrice: string;
|
|
11
|
+
usdPriceShort: number;
|
|
12
|
+
primaryPriceUsd: string;
|
|
13
|
+
primaryPriceUsdShort: number;
|
|
14
|
+
anchorPriceUsd: string;
|
|
15
|
+
anchorPriceUsdShort: number;
|
|
16
|
+
chain: ActivityChain;
|
|
17
|
+
}
|
|
18
|
+
/** Live controller state needed by Stellar lending clients. */
|
|
19
|
+
export interface StellarLendingLiveStateDto {
|
|
20
|
+
indexes: StellarMarketIndexByHub[];
|
|
21
|
+
/** Raw 18-decimal WAD returned by `get_min_borrow_collateral_usd`. */
|
|
22
|
+
minBorrowCollateralUsdWad: string | null;
|
|
23
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xoxno/types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.467",
|
|
4
4
|
"description": "Shared types and utilities for XOXNO API.",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"lint:fix": "eslint 'src/**/*.ts' --fix",
|
|
35
35
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
36
36
|
"test:lending-chain": "npm run build && node test/lending-chain.test.mjs",
|
|
37
|
-
"test:stellar-lending": "npm run build && node test/stellar-lending.test.mjs"
|
|
37
|
+
"test:stellar-lending": "npm run build && tsc --noEmit --target ES2020 --module commonjs --moduleResolution node --strict --skipLibCheck test/stellar-lending-live-state.types.ts && node test/stellar-lending.test.mjs"
|
|
38
38
|
},
|
|
39
39
|
"repository": {
|
|
40
40
|
"type": "git",
|