@xoxno/types 1.0.479 → 1.0.481
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/account-delegate.doc.d.ts +28 -0
- package/dist/stellar-lending/documents/account-delegate.doc.js +27 -0
- package/dist/stellar-lending/documents/blend-pool.doc.d.ts +22 -0
- package/dist/stellar-lending/documents/blend-pool.doc.js +25 -0
- package/dist/stellar-lending/documents/contract-config.doc.d.ts +47 -0
- package/dist/stellar-lending/documents/contract-config.doc.js +53 -0
- package/dist/stellar-lending/documents/contract-role.doc.d.ts +32 -0
- package/dist/stellar-lending/documents/contract-role.doc.js +31 -0
- package/dist/stellar-lending/documents/cursor.doc.d.ts +17 -3
- package/dist/stellar-lending/documents/cursor.doc.js +17 -3
- package/dist/stellar-lending/documents/index.d.ts +4 -0
- package/dist/stellar-lending/documents/index.js +4 -0
- package/dist/stellar-lending/enums/activity.enum.d.ts +29 -0
- package/dist/stellar-lending/enums/activity.enum.js +31 -1
- package/dist/stellar-lending/enums/data-type.enum.d.ts +14 -1
- package/dist/stellar-lending/enums/data-type.enum.js +14 -1
- package/dist/stellar-lending/list.d.ts +14 -0
- package/dist/stellar-lending/oracle-provider.d.ts +42 -23
- package/dist/stellar-lending/oracle-provider.js +11 -0
- package/package.json +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { StellarLendingDataType } from '../enums';
|
|
2
|
+
/**
|
|
3
|
+
* One position-authorization grant, event-sourced from `account:delegate`.
|
|
4
|
+
*
|
|
5
|
+
* A delegate may act on the owner's position, so this is security-relevant
|
|
6
|
+
* state, not display metadata. One document per `(accountId, delegate)` for the
|
|
7
|
+
* same reason as {@link StellarContractRoleDoc}: anyone can be delegated, so the
|
|
8
|
+
* set is externally sized and an array field would race under concurrent ticks.
|
|
9
|
+
*
|
|
10
|
+
* Revocation flips `granted` to `false` rather than deleting, so a revoke that
|
|
11
|
+
* arrives before its grant cannot be undone by a later replay.
|
|
12
|
+
*/
|
|
13
|
+
export declare class StellarAccountDelegateDoc {
|
|
14
|
+
dataType: StellarLendingDataType;
|
|
15
|
+
/** On-chain numeric account id the delegation applies to. */
|
|
16
|
+
accountId: number;
|
|
17
|
+
/** Wallet that owns the account. */
|
|
18
|
+
owner: string;
|
|
19
|
+
/** Wallet authorized to act on the account. */
|
|
20
|
+
delegate: string;
|
|
21
|
+
granted: boolean;
|
|
22
|
+
updatedAt: number;
|
|
23
|
+
ledger: number;
|
|
24
|
+
id: string;
|
|
25
|
+
pk: string;
|
|
26
|
+
_ts?: number;
|
|
27
|
+
constructor(props?: Partial<StellarAccountDelegateDoc>);
|
|
28
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StellarAccountDelegateDoc = void 0;
|
|
4
|
+
const enums_1 = require("../enums");
|
|
5
|
+
/**
|
|
6
|
+
* One position-authorization grant, event-sourced from `account:delegate`.
|
|
7
|
+
*
|
|
8
|
+
* A delegate may act on the owner's position, so this is security-relevant
|
|
9
|
+
* state, not display metadata. One document per `(accountId, delegate)` for the
|
|
10
|
+
* same reason as {@link StellarContractRoleDoc}: anyone can be delegated, so the
|
|
11
|
+
* set is externally sized and an array field would race under concurrent ticks.
|
|
12
|
+
*
|
|
13
|
+
* Revocation flips `granted` to `false` rather than deleting, so a revoke that
|
|
14
|
+
* arrives before its grant cannot be undone by a later replay.
|
|
15
|
+
*/
|
|
16
|
+
class StellarAccountDelegateDoc {
|
|
17
|
+
constructor(props) {
|
|
18
|
+
this.dataType = enums_1.StellarLendingDataType.ACCOUNT_DELEGATE;
|
|
19
|
+
this.granted = false;
|
|
20
|
+
this.updatedAt = 0;
|
|
21
|
+
this.ledger = 0;
|
|
22
|
+
Object.assign(this, props);
|
|
23
|
+
this.pk = this.dataType;
|
|
24
|
+
this.id = `accountDelegate:${this.accountId}:${this.delegate}`;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.StellarAccountDelegateDoc = StellarAccountDelegateDoc;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { StellarLendingDataType } from '../enums';
|
|
2
|
+
/**
|
|
3
|
+
* Approval state for one Blend pool, event-sourced from
|
|
4
|
+
* `config:approve_blend_pool`.
|
|
5
|
+
*
|
|
6
|
+
* Approval gates whether positions may migrate into that pool, so the row is
|
|
7
|
+
* kept after revocation with `approved: false` rather than deleted — a pool that
|
|
8
|
+
* was once approved and is no longer is materially different from one that never
|
|
9
|
+
* was, and the difference matters when auditing a migration after the fact.
|
|
10
|
+
*/
|
|
11
|
+
export declare class StellarBlendPoolDoc {
|
|
12
|
+
dataType: StellarLendingDataType;
|
|
13
|
+
/** Blend pool contract address. Also the `id` suffix. */
|
|
14
|
+
pool: string;
|
|
15
|
+
approved: boolean;
|
|
16
|
+
updatedAt: number;
|
|
17
|
+
ledger: number;
|
|
18
|
+
id: string;
|
|
19
|
+
pk: string;
|
|
20
|
+
_ts?: number;
|
|
21
|
+
constructor(props?: Partial<StellarBlendPoolDoc>);
|
|
22
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StellarBlendPoolDoc = void 0;
|
|
4
|
+
const enums_1 = require("../enums");
|
|
5
|
+
/**
|
|
6
|
+
* Approval state for one Blend pool, event-sourced from
|
|
7
|
+
* `config:approve_blend_pool`.
|
|
8
|
+
*
|
|
9
|
+
* Approval gates whether positions may migrate into that pool, so the row is
|
|
10
|
+
* kept after revocation with `approved: false` rather than deleted — a pool that
|
|
11
|
+
* was once approved and is no longer is materially different from one that never
|
|
12
|
+
* was, and the difference matters when auditing a migration after the fact.
|
|
13
|
+
*/
|
|
14
|
+
class StellarBlendPoolDoc {
|
|
15
|
+
constructor(props) {
|
|
16
|
+
this.dataType = enums_1.StellarLendingDataType.BLEND_POOL;
|
|
17
|
+
this.approved = false;
|
|
18
|
+
this.updatedAt = 0;
|
|
19
|
+
this.ledger = 0;
|
|
20
|
+
Object.assign(this, props);
|
|
21
|
+
this.pk = this.dataType;
|
|
22
|
+
this.id = `blendPool:${this.pool}`;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.StellarBlendPoolDoc = StellarBlendPoolDoc;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { StellarLendingDataType } from '../enums';
|
|
2
|
+
/**
|
|
3
|
+
* Config and admin state for one deployed contract, event-sourced from that
|
|
4
|
+
* contract's own `config:*`, pause, ownership and admin events.
|
|
5
|
+
*
|
|
6
|
+
* Keyed by contract address rather than being a singleton: the controller,
|
|
7
|
+
* governance and price-aggregator each emit `ownership_transfer` and each owns
|
|
8
|
+
* part of this surface, so one document per contract covers all three with a
|
|
9
|
+
* single materializer. A redeploy writes a new row instead of overwriting the
|
|
10
|
+
* previous deployment's final state.
|
|
11
|
+
*
|
|
12
|
+
* Every field is optional-by-absence: a contract only ever populates the fields
|
|
13
|
+
* its own events carry, so a governance row leaves the controller fields null
|
|
14
|
+
* and vice versa.
|
|
15
|
+
*/
|
|
16
|
+
export declare class StellarContractConfigDoc {
|
|
17
|
+
dataType: StellarLendingDataType;
|
|
18
|
+
/** Contract this row describes. Also the `id` suffix. */
|
|
19
|
+
contractAddress: string;
|
|
20
|
+
/** Set when the deploy was observed via `governance:deploy_*`. */
|
|
21
|
+
wasmHash: string | null;
|
|
22
|
+
accumulator: string | null;
|
|
23
|
+
swapAggregator: string | null;
|
|
24
|
+
priceAggregator: string | null;
|
|
25
|
+
maxSupplyPositions: number | null;
|
|
26
|
+
maxBorrowPositions: number | null;
|
|
27
|
+
/** Raw 18-decimal WAD from `config:min_borrow_collateral`. */
|
|
28
|
+
minBorrowCollateralUsdWad: string | null;
|
|
29
|
+
/** `true` between `paused` and `unpaused`; null until either is seen. */
|
|
30
|
+
paused: boolean | null;
|
|
31
|
+
/** Timelock delay in ledgers, from `min_delay_changed`. */
|
|
32
|
+
minDelayLedgers: number | null;
|
|
33
|
+
owner: string | null;
|
|
34
|
+
/** Set by `ownership_transfer`, cleared when the transfer completes. */
|
|
35
|
+
pendingOwner: string | null;
|
|
36
|
+
admin: string | null;
|
|
37
|
+
/** Set by `admin_transfer_initiated`, cleared when the transfer completes. */
|
|
38
|
+
pendingAdmin: string | null;
|
|
39
|
+
/** Ledger the pending admin transfer expires at, `0` when cancelled. */
|
|
40
|
+
pendingAdminLiveUntilLedger: number | null;
|
|
41
|
+
updatedAt: number;
|
|
42
|
+
ledger: number;
|
|
43
|
+
id: string;
|
|
44
|
+
pk: string;
|
|
45
|
+
_ts?: number;
|
|
46
|
+
constructor(props?: Partial<StellarContractConfigDoc>);
|
|
47
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StellarContractConfigDoc = void 0;
|
|
4
|
+
const enums_1 = require("../enums");
|
|
5
|
+
/**
|
|
6
|
+
* Config and admin state for one deployed contract, event-sourced from that
|
|
7
|
+
* contract's own `config:*`, pause, ownership and admin events.
|
|
8
|
+
*
|
|
9
|
+
* Keyed by contract address rather than being a singleton: the controller,
|
|
10
|
+
* governance and price-aggregator each emit `ownership_transfer` and each owns
|
|
11
|
+
* part of this surface, so one document per contract covers all three with a
|
|
12
|
+
* single materializer. A redeploy writes a new row instead of overwriting the
|
|
13
|
+
* previous deployment's final state.
|
|
14
|
+
*
|
|
15
|
+
* Every field is optional-by-absence: a contract only ever populates the fields
|
|
16
|
+
* its own events carry, so a governance row leaves the controller fields null
|
|
17
|
+
* and vice versa.
|
|
18
|
+
*/
|
|
19
|
+
class StellarContractConfigDoc {
|
|
20
|
+
constructor(props) {
|
|
21
|
+
this.dataType = enums_1.StellarLendingDataType.CONTRACT_CONFIG;
|
|
22
|
+
/** Set when the deploy was observed via `governance:deploy_*`. */
|
|
23
|
+
this.wasmHash = null;
|
|
24
|
+
// ── Controller (`config:*`, pausable) ──────────────────────────────────
|
|
25
|
+
this.accumulator = null;
|
|
26
|
+
this.swapAggregator = null;
|
|
27
|
+
this.priceAggregator = null;
|
|
28
|
+
this.maxSupplyPositions = null;
|
|
29
|
+
this.maxBorrowPositions = null;
|
|
30
|
+
/** Raw 18-decimal WAD from `config:min_borrow_collateral`. */
|
|
31
|
+
this.minBorrowCollateralUsdWad = null;
|
|
32
|
+
/** `true` between `paused` and `unpaused`; null until either is seen. */
|
|
33
|
+
this.paused = null;
|
|
34
|
+
// ── Governance (timelock) ──────────────────────────────────────────────
|
|
35
|
+
/** Timelock delay in ledgers, from `min_delay_changed`. */
|
|
36
|
+
this.minDelayLedgers = null;
|
|
37
|
+
// ── Ownable / access-control admin (any contract) ──────────────────────
|
|
38
|
+
this.owner = null;
|
|
39
|
+
/** Set by `ownership_transfer`, cleared when the transfer completes. */
|
|
40
|
+
this.pendingOwner = null;
|
|
41
|
+
this.admin = null;
|
|
42
|
+
/** Set by `admin_transfer_initiated`, cleared when the transfer completes. */
|
|
43
|
+
this.pendingAdmin = null;
|
|
44
|
+
/** Ledger the pending admin transfer expires at, `0` when cancelled. */
|
|
45
|
+
this.pendingAdminLiveUntilLedger = null;
|
|
46
|
+
this.updatedAt = 0;
|
|
47
|
+
this.ledger = 0;
|
|
48
|
+
Object.assign(this, props);
|
|
49
|
+
this.pk = this.dataType;
|
|
50
|
+
this.id = `contractConfig:${this.contractAddress}`;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.StellarContractConfigDoc = StellarContractConfigDoc;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { StellarLendingDataType } from '../enums';
|
|
2
|
+
/**
|
|
3
|
+
* One access-control grant, event-sourced from `role_granted` / `role_revoked`.
|
|
4
|
+
*
|
|
5
|
+
* One document per `(contract, role, account)` rather than a roster array on the
|
|
6
|
+
* contract: the set of accounts holding a role is externally influenced, so an
|
|
7
|
+
* array would mean read-modify-write on every event — a lost-update race between
|
|
8
|
+
* concurrent ticks — and unbounded document growth. As separate rows each event
|
|
9
|
+
* is a blind idempotent upsert.
|
|
10
|
+
*
|
|
11
|
+
* Revocation flips `granted` to `false` rather than deleting the row, so the
|
|
12
|
+
* grant history stays queryable and a revoke arriving before its grant (replay,
|
|
13
|
+
* out-of-order paging) cannot resurrect a stale `true`.
|
|
14
|
+
*/
|
|
15
|
+
export declare class StellarContractRoleDoc {
|
|
16
|
+
dataType: StellarLendingDataType;
|
|
17
|
+
/** Contract whose access control this grant belongs to. */
|
|
18
|
+
contractAddress: string;
|
|
19
|
+
/** On-chain role symbol, e.g. `ORACLE`, `PROPOSER`. */
|
|
20
|
+
role: string;
|
|
21
|
+
/** Account holding (or formerly holding) the role. */
|
|
22
|
+
account: string;
|
|
23
|
+
granted: boolean;
|
|
24
|
+
/** Account that performed the grant or revoke. */
|
|
25
|
+
caller: string | null;
|
|
26
|
+
updatedAt: number;
|
|
27
|
+
ledger: number;
|
|
28
|
+
id: string;
|
|
29
|
+
pk: string;
|
|
30
|
+
_ts?: number;
|
|
31
|
+
constructor(props?: Partial<StellarContractRoleDoc>);
|
|
32
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StellarContractRoleDoc = void 0;
|
|
4
|
+
const enums_1 = require("../enums");
|
|
5
|
+
/**
|
|
6
|
+
* One access-control grant, event-sourced from `role_granted` / `role_revoked`.
|
|
7
|
+
*
|
|
8
|
+
* One document per `(contract, role, account)` rather than a roster array on the
|
|
9
|
+
* contract: the set of accounts holding a role is externally influenced, so an
|
|
10
|
+
* array would mean read-modify-write on every event — a lost-update race between
|
|
11
|
+
* concurrent ticks — and unbounded document growth. As separate rows each event
|
|
12
|
+
* is a blind idempotent upsert.
|
|
13
|
+
*
|
|
14
|
+
* Revocation flips `granted` to `false` rather than deleting the row, so the
|
|
15
|
+
* grant history stays queryable and a revoke arriving before its grant (replay,
|
|
16
|
+
* out-of-order paging) cannot resurrect a stale `true`.
|
|
17
|
+
*/
|
|
18
|
+
class StellarContractRoleDoc {
|
|
19
|
+
constructor(props) {
|
|
20
|
+
this.dataType = enums_1.StellarLendingDataType.CONTRACT_ROLE;
|
|
21
|
+
this.granted = false;
|
|
22
|
+
/** Account that performed the grant or revoke. */
|
|
23
|
+
this.caller = null;
|
|
24
|
+
this.updatedAt = 0;
|
|
25
|
+
this.ledger = 0;
|
|
26
|
+
Object.assign(this, props);
|
|
27
|
+
this.pk = this.dataType;
|
|
28
|
+
this.id = `contractRole:${this.contractAddress}:${this.role}:${this.account}`;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.StellarContractRoleDoc = StellarContractRoleDoc;
|
|
@@ -4,11 +4,25 @@ export declare class StellarLendingCursorDoc {
|
|
|
4
4
|
lastLedger: number;
|
|
5
5
|
lastPagingToken: string | null;
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* Watch set the cursor position belongs to. A position is only valid for the
|
|
8
|
+
* exact set of contracts it was recorded against: any of them being
|
|
9
|
+
* redeployed or repointed leaves that contract's setup events behind the
|
|
10
|
+
* stored position, and the cursor only moves forward, so resuming would skip
|
|
11
|
+
* them permanently. The indexer discards a mismatched cursor and reseeds from
|
|
12
|
+
* the configured start ledger.
|
|
13
|
+
*
|
|
14
|
+
* Binding on the controller alone is what let a price-aggregator repoint slip
|
|
15
|
+
* through and leave every `StellarAssetDoc.oracleProvider` null.
|
|
10
16
|
*/
|
|
11
17
|
controllerAddress: string | null;
|
|
18
|
+
poolAddress: string | null;
|
|
19
|
+
priceAggregatorAddress: string | null;
|
|
20
|
+
governanceAddress: string | null;
|
|
21
|
+
/**
|
|
22
|
+
* Decode-logic version. Bumping it discards the cursor and replays everything
|
|
23
|
+
* within RPC retention, so a decoder fix reaches already-indexed events.
|
|
24
|
+
*/
|
|
25
|
+
indexerVersion: string | null;
|
|
12
26
|
updatedAt: number;
|
|
13
27
|
id: string;
|
|
14
28
|
pk: string;
|
|
@@ -8,11 +8,25 @@ class StellarLendingCursorDoc {
|
|
|
8
8
|
this.lastLedger = 0;
|
|
9
9
|
this.lastPagingToken = null;
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* Watch set the cursor position belongs to. A position is only valid for the
|
|
12
|
+
* exact set of contracts it was recorded against: any of them being
|
|
13
|
+
* redeployed or repointed leaves that contract's setup events behind the
|
|
14
|
+
* stored position, and the cursor only moves forward, so resuming would skip
|
|
15
|
+
* them permanently. The indexer discards a mismatched cursor and reseeds from
|
|
16
|
+
* the configured start ledger.
|
|
17
|
+
*
|
|
18
|
+
* Binding on the controller alone is what let a price-aggregator repoint slip
|
|
19
|
+
* through and leave every `StellarAssetDoc.oracleProvider` null.
|
|
14
20
|
*/
|
|
15
21
|
this.controllerAddress = null;
|
|
22
|
+
this.poolAddress = null;
|
|
23
|
+
this.priceAggregatorAddress = null;
|
|
24
|
+
this.governanceAddress = null;
|
|
25
|
+
/**
|
|
26
|
+
* Decode-logic version. Bumping it discards the cursor and replays everything
|
|
27
|
+
* within RPC retention, so a decoder fix reaches already-indexed events.
|
|
28
|
+
*/
|
|
29
|
+
this.indexerVersion = null;
|
|
16
30
|
this.updatedAt = 0;
|
|
17
31
|
Object.assign(this, props);
|
|
18
32
|
this.pk = this.dataType;
|
|
@@ -5,4 +5,8 @@ export * from './spoke.doc';
|
|
|
5
5
|
export * from './spoke-asset.doc';
|
|
6
6
|
export * from './account-position.doc';
|
|
7
7
|
export * from './governance-proposal.doc';
|
|
8
|
+
export * from './contract-config.doc';
|
|
9
|
+
export * from './contract-role.doc';
|
|
10
|
+
export * from './account-delegate.doc';
|
|
11
|
+
export * from './blend-pool.doc';
|
|
8
12
|
export * from './cursor.doc';
|
|
@@ -21,4 +21,8 @@ __exportStar(require("./spoke.doc"), exports);
|
|
|
21
21
|
__exportStar(require("./spoke-asset.doc"), exports);
|
|
22
22
|
__exportStar(require("./account-position.doc"), exports);
|
|
23
23
|
__exportStar(require("./governance-proposal.doc"), exports);
|
|
24
|
+
__exportStar(require("./contract-config.doc"), exports);
|
|
25
|
+
__exportStar(require("./contract-role.doc"), exports);
|
|
26
|
+
__exportStar(require("./account-delegate.doc"), exports);
|
|
27
|
+
__exportStar(require("./blend-pool.doc"), exports);
|
|
24
28
|
__exportStar(require("./cursor.doc"), exports);
|
|
@@ -19,3 +19,32 @@ export declare enum StellarLendingActivity {
|
|
|
19
19
|
InitialPayment = "initialPayment",
|
|
20
20
|
Unknown = "unknown"
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Protocol-level changes that alter contract config, access control or
|
|
24
|
+
* authorization rather than a user's position.
|
|
25
|
+
*
|
|
26
|
+
* Separate from {@link StellarLendingActivity} and Stellar-only by construction:
|
|
27
|
+
* MVX Kusto ingestion policies match on the position activity values, so these
|
|
28
|
+
* rows are never picked up by them. Same reasoning as
|
|
29
|
+
* `STELLAR_LENDING_MARKET_STATE_ACTIVITY` in the indexer.
|
|
30
|
+
*/
|
|
31
|
+
export declare enum StellarProtocolActivity {
|
|
32
|
+
AccumulatorSet = "stellarAccumulatorSet",
|
|
33
|
+
SwapAggregatorSet = "stellarSwapAggregatorSet",
|
|
34
|
+
PriceAggregatorSet = "stellarPriceAggregatorSet",
|
|
35
|
+
PositionLimitsSet = "stellarPositionLimitsSet",
|
|
36
|
+
MinBorrowCollateralSet = "stellarMinBorrowCollateralSet",
|
|
37
|
+
BlendPoolApprovalSet = "stellarBlendPoolApprovalSet",
|
|
38
|
+
Paused = "stellarPaused",
|
|
39
|
+
Unpaused = "stellarUnpaused",
|
|
40
|
+
OwnershipTransferStarted = "stellarOwnershipTransferStarted",
|
|
41
|
+
OwnershipTransferred = "stellarOwnershipTransferred",
|
|
42
|
+
AdminTransferStarted = "stellarAdminTransferStarted",
|
|
43
|
+
AdminTransferred = "stellarAdminTransferred",
|
|
44
|
+
RoleGranted = "stellarRoleGranted",
|
|
45
|
+
RoleRevoked = "stellarRoleRevoked",
|
|
46
|
+
DelegateGranted = "stellarDelegateGranted",
|
|
47
|
+
DelegateRevoked = "stellarDelegateRevoked",
|
|
48
|
+
MinDelayChanged = "stellarMinDelayChanged",
|
|
49
|
+
ContractDeployed = "stellarContractDeployed"
|
|
50
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StellarLendingActivity = void 0;
|
|
3
|
+
exports.StellarProtocolActivity = exports.StellarLendingActivity = void 0;
|
|
4
4
|
var StellarLendingActivity;
|
|
5
5
|
(function (StellarLendingActivity) {
|
|
6
6
|
StellarLendingActivity["Supply"] = "supply";
|
|
@@ -23,3 +23,33 @@ var StellarLendingActivity;
|
|
|
23
23
|
StellarLendingActivity["InitialPayment"] = "initialPayment";
|
|
24
24
|
StellarLendingActivity["Unknown"] = "unknown";
|
|
25
25
|
})(StellarLendingActivity || (exports.StellarLendingActivity = StellarLendingActivity = {}));
|
|
26
|
+
/**
|
|
27
|
+
* Protocol-level changes that alter contract config, access control or
|
|
28
|
+
* authorization rather than a user's position.
|
|
29
|
+
*
|
|
30
|
+
* Separate from {@link StellarLendingActivity} and Stellar-only by construction:
|
|
31
|
+
* MVX Kusto ingestion policies match on the position activity values, so these
|
|
32
|
+
* rows are never picked up by them. Same reasoning as
|
|
33
|
+
* `STELLAR_LENDING_MARKET_STATE_ACTIVITY` in the indexer.
|
|
34
|
+
*/
|
|
35
|
+
var StellarProtocolActivity;
|
|
36
|
+
(function (StellarProtocolActivity) {
|
|
37
|
+
StellarProtocolActivity["AccumulatorSet"] = "stellarAccumulatorSet";
|
|
38
|
+
StellarProtocolActivity["SwapAggregatorSet"] = "stellarSwapAggregatorSet";
|
|
39
|
+
StellarProtocolActivity["PriceAggregatorSet"] = "stellarPriceAggregatorSet";
|
|
40
|
+
StellarProtocolActivity["PositionLimitsSet"] = "stellarPositionLimitsSet";
|
|
41
|
+
StellarProtocolActivity["MinBorrowCollateralSet"] = "stellarMinBorrowCollateralSet";
|
|
42
|
+
StellarProtocolActivity["BlendPoolApprovalSet"] = "stellarBlendPoolApprovalSet";
|
|
43
|
+
StellarProtocolActivity["Paused"] = "stellarPaused";
|
|
44
|
+
StellarProtocolActivity["Unpaused"] = "stellarUnpaused";
|
|
45
|
+
StellarProtocolActivity["OwnershipTransferStarted"] = "stellarOwnershipTransferStarted";
|
|
46
|
+
StellarProtocolActivity["OwnershipTransferred"] = "stellarOwnershipTransferred";
|
|
47
|
+
StellarProtocolActivity["AdminTransferStarted"] = "stellarAdminTransferStarted";
|
|
48
|
+
StellarProtocolActivity["AdminTransferred"] = "stellarAdminTransferred";
|
|
49
|
+
StellarProtocolActivity["RoleGranted"] = "stellarRoleGranted";
|
|
50
|
+
StellarProtocolActivity["RoleRevoked"] = "stellarRoleRevoked";
|
|
51
|
+
StellarProtocolActivity["DelegateGranted"] = "stellarDelegateGranted";
|
|
52
|
+
StellarProtocolActivity["DelegateRevoked"] = "stellarDelegateRevoked";
|
|
53
|
+
StellarProtocolActivity["MinDelayChanged"] = "stellarMinDelayChanged";
|
|
54
|
+
StellarProtocolActivity["ContractDeployed"] = "stellarContractDeployed";
|
|
55
|
+
})(StellarProtocolActivity || (exports.StellarProtocolActivity = StellarProtocolActivity = {}));
|
|
@@ -5,6 +5,19 @@ export declare enum StellarLendingDataType {
|
|
|
5
5
|
SPOKE = "spoke",
|
|
6
6
|
SPOKE_ASSET = "spokeAsset",
|
|
7
7
|
ACCOUNT_POSITION = "accountPosition",
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Deliberately not `governanceProposal`: MVX lending uses that partition key
|
|
10
|
+
* with the same `operationId` document id and no chain discriminator, so the
|
|
11
|
+
* two chains' proposals would be indistinguishable in one partition.
|
|
12
|
+
*/
|
|
13
|
+
GOVERNANCE_PROPOSAL = "stellarGovernanceProposal",
|
|
14
|
+
/** Per-contract config + admin state, keyed by contract address. */
|
|
15
|
+
CONTRACT_CONFIG = "contractConfig",
|
|
16
|
+
/** One row per (contract, role, account) access-control grant. */
|
|
17
|
+
CONTRACT_ROLE = "contractRole",
|
|
18
|
+
/** One row per (account, delegate) position-authorization grant. */
|
|
19
|
+
ACCOUNT_DELEGATE = "accountDelegate",
|
|
20
|
+
/** One row per Blend pool the controller has approved or revoked. */
|
|
21
|
+
BLEND_POOL = "blendPool",
|
|
9
22
|
CURSOR = "cursor"
|
|
10
23
|
}
|
|
@@ -9,6 +9,19 @@ var StellarLendingDataType;
|
|
|
9
9
|
StellarLendingDataType["SPOKE"] = "spoke";
|
|
10
10
|
StellarLendingDataType["SPOKE_ASSET"] = "spokeAsset";
|
|
11
11
|
StellarLendingDataType["ACCOUNT_POSITION"] = "accountPosition";
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Deliberately not `governanceProposal`: MVX lending uses that partition key
|
|
14
|
+
* with the same `operationId` document id and no chain discriminator, so the
|
|
15
|
+
* two chains' proposals would be indistinguishable in one partition.
|
|
16
|
+
*/
|
|
17
|
+
StellarLendingDataType["GOVERNANCE_PROPOSAL"] = "stellarGovernanceProposal";
|
|
18
|
+
/** Per-contract config + admin state, keyed by contract address. */
|
|
19
|
+
StellarLendingDataType["CONTRACT_CONFIG"] = "contractConfig";
|
|
20
|
+
/** One row per (contract, role, account) access-control grant. */
|
|
21
|
+
StellarLendingDataType["CONTRACT_ROLE"] = "contractRole";
|
|
22
|
+
/** One row per (account, delegate) position-authorization grant. */
|
|
23
|
+
StellarLendingDataType["ACCOUNT_DELEGATE"] = "accountDelegate";
|
|
24
|
+
/** One row per Blend pool the controller has approved or revoked. */
|
|
25
|
+
StellarLendingDataType["BLEND_POOL"] = "blendPool";
|
|
13
26
|
StellarLendingDataType["CURSOR"] = "cursor";
|
|
14
27
|
})(StellarLendingDataType || (exports.StellarLendingDataType = StellarLendingDataType = {}));
|
|
@@ -38,7 +38,21 @@ export interface StellarAssetListItem {
|
|
|
38
38
|
hubCount: number;
|
|
39
39
|
/** Number of reserves (spoke,hub) for this asset. */
|
|
40
40
|
marketCount: number;
|
|
41
|
+
/**
|
|
42
|
+
* The two underlying token SACs when this asset is an AMM LP share, so
|
|
43
|
+
* clients can render the pair (both leg logos) instead of one unresolvable
|
|
44
|
+
* logo for the share itself.
|
|
45
|
+
*
|
|
46
|
+
* Projected from the asset's indexed `LpShare` price source
|
|
47
|
+
* (`StellarAssetOracle.sources[]`). Present only when BOTH legs are
|
|
48
|
+
* `{ Token }` price keys — a `{ Ref }` leg is registry-only and has no SAC,
|
|
49
|
+
* so there is nothing to render. Consumers may therefore treat "present" as
|
|
50
|
+
* "renderable pair" with no partial case to handle.
|
|
51
|
+
*/
|
|
52
|
+
lpUnderlying?: StellarLpUnderlying;
|
|
41
53
|
}
|
|
54
|
+
/** The two leg SACs of an LP share, in the pool's `[keyA, keyB]` order. */
|
|
55
|
+
export type StellarLpUnderlying = [tokenA: string, tokenB: string];
|
|
42
56
|
/** One (spoke, hub) market row for an asset detail page. */
|
|
43
57
|
export interface StellarAssetPageMarket {
|
|
44
58
|
spokeId: number;
|
|
@@ -5,6 +5,17 @@
|
|
|
5
5
|
* Mirrors on-chain `PriceKey` + `AssetOracle` (`sources`, independence,
|
|
6
6
|
* tolerance, sanity). `i128` → string; `u32/u64` → number. No Nest
|
|
7
7
|
* decorators — api-v2 owns swagger DTOs; this package owns wire shapes.
|
|
8
|
+
*
|
|
9
|
+
* These are the NORMALIZED shapes, not what `scValToNative` hands back. Soroban
|
|
10
|
+
* renders a payload-carrying enum variant as a `[variant, payload]` tuple and a
|
|
11
|
+
* unit variant as a one-element `[variant]` tuple, with snake_case fields. The
|
|
12
|
+
* indexer's decoders convert both into the object form below before persisting:
|
|
13
|
+
*
|
|
14
|
+
* ["AquariusLp", { key_a, … }] → { AquariusLp: { keyA, … } }
|
|
15
|
+
* ["RequireDisjoint"] → 'RequireDisjoint'
|
|
16
|
+
*
|
|
17
|
+
* Anything assigning raw `scValToNative` output to these types is a bug — the
|
|
18
|
+
* shapes differ and a type assertion will hide it.
|
|
8
19
|
*/
|
|
9
20
|
/** On-chain `PriceKey`: Token SAC or registry-only Ref symbol. */
|
|
10
21
|
export type StellarPriceKey = {
|
|
@@ -12,8 +23,6 @@ export type StellarPriceKey = {
|
|
|
12
23
|
} | {
|
|
13
24
|
Ref: string;
|
|
14
25
|
};
|
|
15
|
-
/** On-chain `ProviderKind`. */
|
|
16
|
-
export type StellarProviderKind = 'Reflector' | 'RedStone' | 'Xoxno';
|
|
17
26
|
/** On-chain `FeedNature`. */
|
|
18
27
|
export type StellarFeedNature = 'Market' | 'Fundamental';
|
|
19
28
|
/** On-chain `OracleAssetRef` for Reflector legs. */
|
|
@@ -38,17 +47,22 @@ export interface StellarReflectorFeedRef {
|
|
|
38
47
|
asset: StellarOracleAssetRef;
|
|
39
48
|
readMode: StellarOracleReadMode;
|
|
40
49
|
}
|
|
50
|
+
/** On-chain `MultiFeedRef`, shared by the RedStone and Xoxno legs. */
|
|
41
51
|
export interface StellarMultiFeedRef {
|
|
42
52
|
contract: string;
|
|
43
53
|
feedId: string;
|
|
44
|
-
kind: StellarProviderKind;
|
|
45
54
|
nature: StellarFeedNature;
|
|
46
55
|
}
|
|
47
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* On-chain `ProviderRef`. The provider kind IS the variant — RedStone and Xoxno
|
|
58
|
+
* both carry a `MultiFeedRef`, and are told apart by which key is present.
|
|
59
|
+
*/
|
|
48
60
|
export type StellarProviderRef = {
|
|
49
61
|
Reflector: StellarReflectorFeedRef;
|
|
50
62
|
} | {
|
|
51
|
-
|
|
63
|
+
RedStone: StellarMultiFeedRef;
|
|
64
|
+
} | {
|
|
65
|
+
Xoxno: StellarMultiFeedRef;
|
|
52
66
|
};
|
|
53
67
|
export interface StellarFeedSource {
|
|
54
68
|
provider: StellarProviderRef;
|
|
@@ -61,31 +75,42 @@ export interface StellarScaledSource {
|
|
|
61
75
|
minFactorWad: string;
|
|
62
76
|
maxFactorWad: string;
|
|
63
77
|
}
|
|
64
|
-
|
|
65
|
-
|
|
78
|
+
/**
|
|
79
|
+
* On-chain `AquariusLpSource` — prices an Aquarius LP share token from its two
|
|
80
|
+
* reserve legs. `plane` is the pool-info contract the aggregator reads reserves
|
|
81
|
+
* from; `minPoolValueWad` is the liquidity floor below which the source is
|
|
82
|
+
* rejected.
|
|
83
|
+
*/
|
|
84
|
+
export interface StellarAquariusLpSource {
|
|
66
85
|
pool: string;
|
|
67
|
-
|
|
86
|
+
plane: string;
|
|
87
|
+
tokenA: string;
|
|
88
|
+
tokenB: string;
|
|
68
89
|
keyA: StellarPriceKey;
|
|
69
90
|
keyB: StellarPriceKey;
|
|
70
91
|
reserveADecimals: number;
|
|
71
92
|
reserveBDecimals: number;
|
|
72
|
-
|
|
93
|
+
minPoolValueWad: string;
|
|
73
94
|
}
|
|
74
|
-
/**
|
|
95
|
+
/**
|
|
96
|
+
* On-chain `PriceSource`. Both Aquarius variants carry an `AquariusLpSource`;
|
|
97
|
+
* the stable variant differs only in the curve the aggregator prices against.
|
|
98
|
+
*/
|
|
75
99
|
export type StellarPriceSource = {
|
|
76
100
|
Feed: StellarFeedSource;
|
|
77
101
|
} | {
|
|
78
102
|
Scaled: StellarScaledSource;
|
|
79
103
|
} | {
|
|
80
|
-
|
|
104
|
+
AquariusLp: StellarAquariusLpSource;
|
|
105
|
+
} | {
|
|
106
|
+
AquariusStableLp: StellarAquariusLpSource;
|
|
81
107
|
};
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
/** On-chain `IndependencePolicy`. */
|
|
108
|
+
/**
|
|
109
|
+
* On-chain `IndependencePolicy`. `AllowShared` carries the provider contract
|
|
110
|
+
* addresses two legs are permitted to have in common.
|
|
111
|
+
*/
|
|
87
112
|
export type StellarIndependencePolicy = 'RequireDisjoint' | {
|
|
88
|
-
AllowShared:
|
|
113
|
+
AllowShared: string[];
|
|
89
114
|
};
|
|
90
115
|
/**
|
|
91
116
|
* On-chain `AssetOracle` — one or two independent opinions for a `PriceKey`.
|
|
@@ -101,9 +126,3 @@ export interface StellarAssetOracle {
|
|
|
101
126
|
minSanityPriceWad: string;
|
|
102
127
|
maxSanityPriceWad: string;
|
|
103
128
|
}
|
|
104
|
-
/**
|
|
105
|
-
* @deprecated Alias of {@link StellarAssetOracle}. Prefer `StellarAssetOracle`.
|
|
106
|
-
* Kept so existing imports continue to resolve while consumers migrate off the
|
|
107
|
-
* v1 primary/anchor flat projection.
|
|
108
|
-
*/
|
|
109
|
-
export type StellarOracleProvider = StellarAssetOracle;
|
|
@@ -6,5 +6,16 @@
|
|
|
6
6
|
* Mirrors on-chain `PriceKey` + `AssetOracle` (`sources`, independence,
|
|
7
7
|
* tolerance, sanity). `i128` → string; `u32/u64` → number. No Nest
|
|
8
8
|
* decorators — api-v2 owns swagger DTOs; this package owns wire shapes.
|
|
9
|
+
*
|
|
10
|
+
* These are the NORMALIZED shapes, not what `scValToNative` hands back. Soroban
|
|
11
|
+
* renders a payload-carrying enum variant as a `[variant, payload]` tuple and a
|
|
12
|
+
* unit variant as a one-element `[variant]` tuple, with snake_case fields. The
|
|
13
|
+
* indexer's decoders convert both into the object form below before persisting:
|
|
14
|
+
*
|
|
15
|
+
* ["AquariusLp", { key_a, … }] → { AquariusLp: { keyA, … } }
|
|
16
|
+
* ["RequireDisjoint"] → 'RequireDisjoint'
|
|
17
|
+
*
|
|
18
|
+
* Anything assigning raw `scValToNative` output to these types is a bug — the
|
|
19
|
+
* shapes differ and a type assertion will hide it.
|
|
9
20
|
*/
|
|
10
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|