@xoxno/types 1.0.472 → 1.0.473

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,4 +1,4 @@
1
- import { ExchangeSource, LendingOracleAssetRefKind, LendingOracleProviderKind, LendingOracleReadMode, LendingOracleStrategy, OracleType, PricingMethod } from '../../../enums/lending.enum';
1
+ import { ExchangeSource, LendingOracleAssetRefKind, LendingOracleProviderKind, LendingOracleReadMode, OracleType, PricingMethod } from '../../../enums/lending.enum';
2
2
  export declare class OraclePriceFluctuation {
3
3
  upperRatio: number;
4
4
  lowerRatio: number;
@@ -34,19 +34,20 @@ export declare class LendingOracleUpdateStruct {
34
34
  maxPriceStaleSeconds: number;
35
35
  constructor(init?: Partial<LendingOracleUpdateStruct>);
36
36
  }
37
+ /**
38
+ * API / swagger projection of on-chain `AssetOracle` for Stellar
39
+ * `config:asset_oracle`. Sources are opaque JSON objects matching
40
+ * {@link import('../../../stellar-lending/oracle-provider').StellarPriceSource}
41
+ * so swagger stays stable without nesting every provider variant.
42
+ */
37
43
  export declare class StellarLendingOracleUpdateStruct {
38
- baseTokenId: string;
39
- quoteTokenId: string;
40
- tolerance: OraclePriceFluctuation;
41
44
  assetDecimals: number;
42
45
  maxPriceStaleSeconds: number;
43
- strategy: LendingOracleStrategy;
44
- primary: LendingOracleSource;
45
- anchor?: LendingOracleSource;
46
- primaryQuoteToken?: string | null;
47
- anchorQuoteToken?: string | null;
48
- minSanityPriceWad?: string;
49
- maxSanityPriceWad?: string;
46
+ sources: Record<string, unknown>[];
47
+ tolerance: OraclePriceFluctuation;
48
+ independence: string | Record<string, unknown>;
49
+ minSanityPriceWad: string;
50
+ maxSanityPriceWad: string;
50
51
  constructor(init?: Partial<StellarLendingOracleUpdateStruct>);
51
52
  }
52
53
  export type LendingOracleProvider = LendingOracleUpdateStruct | StellarLendingOracleUpdateStruct;
@@ -215,101 +215,59 @@ __decorate([
215
215
  }),
216
216
  __metadata("design:type", Number)
217
217
  ], LendingOracleUpdateStruct.prototype, "maxPriceStaleSeconds", void 0);
218
+ /**
219
+ * API / swagger projection of on-chain `AssetOracle` for Stellar
220
+ * `config:asset_oracle`. Sources are opaque JSON objects matching
221
+ * {@link import('../../../stellar-lending/oracle-provider').StellarPriceSource}
222
+ * so swagger stays stable without nesting every provider variant.
223
+ */
218
224
  class StellarLendingOracleUpdateStruct {
219
225
  constructor(init) {
220
226
  Object.assign(this, init);
221
227
  if (init?.tolerance) {
222
228
  this.tolerance = new OraclePriceFluctuation(init.tolerance);
223
229
  }
224
- if (init?.primary) {
225
- this.primary = new LendingOracleSource(init.primary);
226
- }
227
- if (init?.anchor) {
228
- this.anchor = new LendingOracleSource(init.anchor);
229
- }
230
230
  }
231
231
  }
232
232
  exports.StellarLendingOracleUpdateStruct = StellarLendingOracleUpdateStruct;
233
- __decorate([
234
- (0, swagger_1.ApiProperty)({
235
- type: String,
236
- description: 'Base token identifier',
237
- }),
238
- __metadata("design:type", String)
239
- ], StellarLendingOracleUpdateStruct.prototype, "baseTokenId", void 0);
240
- __decorate([
241
- (0, swagger_1.ApiProperty)({
242
- type: String,
243
- description: 'Quote token identifier',
244
- }),
245
- __metadata("design:type", String)
246
- ], StellarLendingOracleUpdateStruct.prototype, "quoteTokenId", void 0);
247
- __decorate([
248
- (0, swagger_1.ApiProperty)({
249
- type: OraclePriceFluctuation,
250
- description: 'Price fluctuation tolerance thresholds',
251
- }),
252
- __metadata("design:type", OraclePriceFluctuation)
253
- ], StellarLendingOracleUpdateStruct.prototype, "tolerance", void 0);
254
233
  __decorate([
255
234
  (0, swagger_1.ApiProperty)({
256
235
  type: 'integer',
257
- description: 'Number of decimals for the asset',
236
+ description: 'Token decimals (0 for PriceKey::Ref). Matches on-chain asset_decimals.',
258
237
  }),
259
238
  __metadata("design:type", Number)
260
239
  ], StellarLendingOracleUpdateStruct.prototype, "assetDecimals", void 0);
261
240
  __decorate([
262
241
  (0, swagger_1.ApiProperty)({
263
242
  type: 'integer',
264
- description: 'Maximum seconds before price is considered stale',
243
+ description: 'Asset-level staleness ceiling in seconds',
265
244
  }),
266
245
  __metadata("design:type", Number)
267
246
  ], StellarLendingOracleUpdateStruct.prototype, "maxPriceStaleSeconds", void 0);
268
247
  __decorate([
269
248
  (0, swagger_1.ApiProperty)({
270
- enum: lending_enum_1.LendingOracleStrategy,
271
- enumName: 'LendingOracleStrategy',
272
- description: 'Oracle composition strategy',
273
- }),
274
- __metadata("design:type", String)
275
- ], StellarLendingOracleUpdateStruct.prototype, "strategy", void 0);
276
- __decorate([
277
- (0, swagger_1.ApiProperty)({
278
- type: LendingOracleSource,
279
- description: 'Primary oracle source',
280
- }),
281
- __metadata("design:type", LendingOracleSource)
282
- ], StellarLendingOracleUpdateStruct.prototype, "primary", void 0);
283
- __decorate([
284
- (0, swagger_1.ApiProperty)({
285
- type: LendingOracleSource,
286
- required: false,
287
- description: 'Optional anchor oracle source',
249
+ type: 'array',
250
+ items: { type: 'object', additionalProperties: true },
251
+ description: 'One or two PriceSource variants (Feed / Scaled / LpShare) as decoded from chain',
288
252
  }),
289
- __metadata("design:type", LendingOracleSource)
290
- ], StellarLendingOracleUpdateStruct.prototype, "anchor", void 0);
253
+ __metadata("design:type", Array)
254
+ ], StellarLendingOracleUpdateStruct.prototype, "sources", void 0);
291
255
  __decorate([
292
256
  (0, swagger_1.ApiProperty)({
293
- type: String,
294
- nullable: true,
295
- required: false,
296
- description: 'Quote currency of the primary oracle feed. null = USD-quoted (common case) or RedStone source; non-null = Stellar quote token (e.g. USDC SAC) repriced to USD on-chain',
257
+ type: OraclePriceFluctuation,
258
+ description: 'Dual-source agreement band (BPS); ignored for single source',
297
259
  }),
298
- __metadata("design:type", Object)
299
- ], StellarLendingOracleUpdateStruct.prototype, "primaryQuoteToken", void 0);
260
+ __metadata("design:type", OraclePriceFluctuation)
261
+ ], StellarLendingOracleUpdateStruct.prototype, "tolerance", void 0);
300
262
  __decorate([
301
263
  (0, swagger_1.ApiProperty)({
302
- type: String,
303
- nullable: true,
304
- required: false,
305
- description: 'Quote currency of the anchor oracle feed. null = no anchor, USD-quoted, or RedStone source; non-null = Stellar quote token (e.g. USDC SAC) repriced to USD on-chain',
264
+ description: 'Independence policy: string "RequireDisjoint" or object AllowShared domains',
306
265
  }),
307
266
  __metadata("design:type", Object)
308
- ], StellarLendingOracleUpdateStruct.prototype, "anchorQuoteToken", void 0);
267
+ ], StellarLendingOracleUpdateStruct.prototype, "independence", void 0);
309
268
  __decorate([
310
269
  (0, swagger_1.ApiProperty)({
311
270
  type: String,
312
- required: false,
313
271
  description: 'Inclusive lower sanity bound, USD WAD decimal string',
314
272
  }),
315
273
  __metadata("design:type", String)
@@ -317,7 +275,6 @@ __decorate([
317
275
  __decorate([
318
276
  (0, swagger_1.ApiProperty)({
319
277
  type: String,
320
- required: false,
321
278
  description: 'Inclusive upper sanity bound, USD WAD decimal string',
322
279
  }),
323
280
  __metadata("design:type", String)
@@ -1,16 +1,15 @@
1
1
  /**
2
2
  * Stellar lending governance (timelock) proposal taxonomy.
3
3
  *
4
- * `GovernanceProposalKind` mirrors the `AdminOperation` variants the governance
5
- * contract schedules; the indexer maps a scheduled operation's invoked function
6
- * symbol to one of these so the dashboard can title and group proposals.
4
+ * Mirrors live `AdminOperation` variants. Shared with MVX-era names kept only
5
+ * as deprecated aliases where the old string matched a renamed variant.
7
6
  */
8
7
  export declare enum GovernanceProposalKind {
9
- SetAggregator = "SetAggregator",
8
+ SetSwapAggregator = "SetSwapAggregator",
9
+ SetPriceAggregator = "SetPriceAggregator",
10
10
  SetAccumulator = "SetAccumulator",
11
- SetPoolTemplate = "SetPoolTemplate",
12
11
  SetPositionLimits = "SetPositionLimits",
13
- SetMinBorrowCollateral = "SetMinBorrowCollateral",
12
+ SetMinBorrowCollateralUsd = "SetMinBorrowCollateralUsd",
14
13
  SetPositionManager = "SetPositionManager",
15
14
  CreateHub = "CreateHub",
16
15
  AddSpoke = "AddSpoke",
@@ -19,8 +18,6 @@ export declare enum GovernanceProposalKind {
19
18
  EditAssetInSpoke = "EditAssetInSpoke",
20
19
  RemoveAssetFromSpoke = "RemoveAssetFromSpoke",
21
20
  SetSpokeLiquidationCurve = "SetSpokeLiquidationCurve",
22
- ApproveToken = "ApproveToken",
23
- RevokeToken = "RevokeToken",
24
21
  ApproveBlendPool = "ApproveBlendPool",
25
22
  RevokeBlendPool = "RevokeBlendPool",
26
23
  CreateLiquidityPool = "CreateLiquidityPool",
@@ -29,36 +26,36 @@ export declare enum GovernanceProposalKind {
29
26
  UpgradePool = "UpgradePool",
30
27
  UpgradeController = "UpgradeController",
31
28
  MigrateController = "MigrateController",
32
- TransferControllerOwnership = "TransferControllerOwnership",
33
- ConfigureMarketOracle = "ConfigureMarketOracle",
29
+ TransferCtrlOwnership = "TransferCtrlOwnership",
34
30
  EditOracleTolerance = "EditOracleTolerance",
35
- GovernanceUpgrade = "GovernanceUpgrade",
36
- UpdateDelay = "UpdateDelay",
37
- GrantGovernanceRole = "GrantGovernanceRole",
38
- RevokeGovernanceRole = "RevokeGovernanceRole",
39
- TransferGovernanceOwnership = "TransferGovernanceOwnership",
40
- /**
41
- * Owner-only, non-vetoable Recovery-tier council reset (`reset_cancellers`).
42
- * Scheduled at the ~30-day Recovery delay to replace a captured canceller set.
43
- */
31
+ ForceSocializeBadDebt = "ForceSocializeBadDebt",
32
+ Unpause = "Unpause",
33
+ UpgradeGov = "UpgradeGov",
34
+ UpdateGovDelay = "UpdateGovDelay",
35
+ GrantGovRole = "GrantGovRole",
36
+ RevokeGovRole = "RevokeGovRole",
37
+ TransferGovOwnership = "TransferGovOwnership",
38
+ ConfigureAssetOracle = "ConfigureAssetOracle",
44
39
  CancellerReset = "CancellerReset",
40
+ /** @deprecated Use `SetSwapAggregator`. */
41
+ SetAggregator = "SetSwapAggregator",
42
+ /** @deprecated Use `ConfigureAssetOracle`. */
43
+ ConfigureMarketOracle = "ConfigureAssetOracle",
44
+ /** @deprecated Use `ApproveBlendPool`. */
45
+ ApproveToken = "ApproveBlendPool",
46
+ /** @deprecated Removed from live AdminOperation. */
47
+ SetPoolTemplate = "SetPoolTemplate",
48
+ /** @deprecated Removed from live AdminOperation. */
49
+ RevokeToken = "RevokeToken",
45
50
  Unknown = "Unknown"
46
51
  }
47
- /**
48
- * Coarse, event-derived proposal status. `Waiting`/`Ready`/`Expired` are NOT
49
- * stored on-chain — clients derive them from `readyLedger`, `expiresLedger`,
50
- * and the current ledger.
51
- */
52
52
  export declare enum GovernanceProposalStatus {
53
53
  Pending = "Pending",
54
54
  Executed = "Executed",
55
55
  Cancelled = "Cancelled"
56
56
  }
57
- /**
58
- * Whether executing the proposal invokes the lending controller (generic
59
- * `execute`) or the governance contract itself (`execute_self`).
60
- */
61
57
  export declare enum GovernanceProposalTarget {
62
58
  Controller = "Controller",
63
- Governance = "Governance"
59
+ Governance = "Governance",
60
+ PriceAggregator = "PriceAggregator"
64
61
  }
@@ -4,17 +4,16 @@ exports.GovernanceProposalTarget = exports.GovernanceProposalStatus = exports.Go
4
4
  /**
5
5
  * Stellar lending governance (timelock) proposal taxonomy.
6
6
  *
7
- * `GovernanceProposalKind` mirrors the `AdminOperation` variants the governance
8
- * contract schedules; the indexer maps a scheduled operation's invoked function
9
- * symbol to one of these so the dashboard can title and group proposals.
7
+ * Mirrors live `AdminOperation` variants. Shared with MVX-era names kept only
8
+ * as deprecated aliases where the old string matched a renamed variant.
10
9
  */
11
10
  var GovernanceProposalKind;
12
11
  (function (GovernanceProposalKind) {
13
- GovernanceProposalKind["SetAggregator"] = "SetAggregator";
12
+ GovernanceProposalKind["SetSwapAggregator"] = "SetSwapAggregator";
13
+ GovernanceProposalKind["SetPriceAggregator"] = "SetPriceAggregator";
14
14
  GovernanceProposalKind["SetAccumulator"] = "SetAccumulator";
15
- GovernanceProposalKind["SetPoolTemplate"] = "SetPoolTemplate";
16
15
  GovernanceProposalKind["SetPositionLimits"] = "SetPositionLimits";
17
- GovernanceProposalKind["SetMinBorrowCollateral"] = "SetMinBorrowCollateral";
16
+ GovernanceProposalKind["SetMinBorrowCollateralUsd"] = "SetMinBorrowCollateralUsd";
18
17
  GovernanceProposalKind["SetPositionManager"] = "SetPositionManager";
19
18
  GovernanceProposalKind["CreateHub"] = "CreateHub";
20
19
  GovernanceProposalKind["AddSpoke"] = "AddSpoke";
@@ -23,8 +22,6 @@ var GovernanceProposalKind;
23
22
  GovernanceProposalKind["EditAssetInSpoke"] = "EditAssetInSpoke";
24
23
  GovernanceProposalKind["RemoveAssetFromSpoke"] = "RemoveAssetFromSpoke";
25
24
  GovernanceProposalKind["SetSpokeLiquidationCurve"] = "SetSpokeLiquidationCurve";
26
- GovernanceProposalKind["ApproveToken"] = "ApproveToken";
27
- GovernanceProposalKind["RevokeToken"] = "RevokeToken";
28
25
  GovernanceProposalKind["ApproveBlendPool"] = "ApproveBlendPool";
29
26
  GovernanceProposalKind["RevokeBlendPool"] = "RevokeBlendPool";
30
27
  GovernanceProposalKind["CreateLiquidityPool"] = "CreateLiquidityPool";
@@ -33,38 +30,38 @@ var GovernanceProposalKind;
33
30
  GovernanceProposalKind["UpgradePool"] = "UpgradePool";
34
31
  GovernanceProposalKind["UpgradeController"] = "UpgradeController";
35
32
  GovernanceProposalKind["MigrateController"] = "MigrateController";
36
- GovernanceProposalKind["TransferControllerOwnership"] = "TransferControllerOwnership";
37
- GovernanceProposalKind["ConfigureMarketOracle"] = "ConfigureMarketOracle";
33
+ GovernanceProposalKind["TransferCtrlOwnership"] = "TransferCtrlOwnership";
38
34
  GovernanceProposalKind["EditOracleTolerance"] = "EditOracleTolerance";
39
- GovernanceProposalKind["GovernanceUpgrade"] = "GovernanceUpgrade";
40
- GovernanceProposalKind["UpdateDelay"] = "UpdateDelay";
41
- GovernanceProposalKind["GrantGovernanceRole"] = "GrantGovernanceRole";
42
- GovernanceProposalKind["RevokeGovernanceRole"] = "RevokeGovernanceRole";
43
- GovernanceProposalKind["TransferGovernanceOwnership"] = "TransferGovernanceOwnership";
44
- /**
45
- * Owner-only, non-vetoable Recovery-tier council reset (`reset_cancellers`).
46
- * Scheduled at the ~30-day Recovery delay to replace a captured canceller set.
47
- */
35
+ GovernanceProposalKind["ForceSocializeBadDebt"] = "ForceSocializeBadDebt";
36
+ GovernanceProposalKind["Unpause"] = "Unpause";
37
+ GovernanceProposalKind["UpgradeGov"] = "UpgradeGov";
38
+ GovernanceProposalKind["UpdateGovDelay"] = "UpdateGovDelay";
39
+ GovernanceProposalKind["GrantGovRole"] = "GrantGovRole";
40
+ GovernanceProposalKind["RevokeGovRole"] = "RevokeGovRole";
41
+ GovernanceProposalKind["TransferGovOwnership"] = "TransferGovOwnership";
42
+ GovernanceProposalKind["ConfigureAssetOracle"] = "ConfigureAssetOracle";
48
43
  GovernanceProposalKind["CancellerReset"] = "CancellerReset";
44
+ /** @deprecated Use `SetSwapAggregator`. */
45
+ GovernanceProposalKind["SetAggregator"] = "SetSwapAggregator";
46
+ /** @deprecated Use `ConfigureAssetOracle`. */
47
+ GovernanceProposalKind["ConfigureMarketOracle"] = "ConfigureAssetOracle";
48
+ /** @deprecated Use `ApproveBlendPool`. */
49
+ GovernanceProposalKind["ApproveToken"] = "ApproveBlendPool";
50
+ /** @deprecated Removed from live AdminOperation. */
51
+ GovernanceProposalKind["SetPoolTemplate"] = "SetPoolTemplate";
52
+ /** @deprecated Removed from live AdminOperation. */
53
+ GovernanceProposalKind["RevokeToken"] = "RevokeToken";
49
54
  GovernanceProposalKind["Unknown"] = "Unknown";
50
55
  })(GovernanceProposalKind || (exports.GovernanceProposalKind = GovernanceProposalKind = {}));
51
- /**
52
- * Coarse, event-derived proposal status. `Waiting`/`Ready`/`Expired` are NOT
53
- * stored on-chain — clients derive them from `readyLedger`, `expiresLedger`,
54
- * and the current ledger.
55
- */
56
56
  var GovernanceProposalStatus;
57
57
  (function (GovernanceProposalStatus) {
58
58
  GovernanceProposalStatus["Pending"] = "Pending";
59
59
  GovernanceProposalStatus["Executed"] = "Executed";
60
60
  GovernanceProposalStatus["Cancelled"] = "Cancelled";
61
61
  })(GovernanceProposalStatus || (exports.GovernanceProposalStatus = GovernanceProposalStatus = {}));
62
- /**
63
- * Whether executing the proposal invokes the lending controller (generic
64
- * `execute`) or the governance contract itself (`execute_self`).
65
- */
66
62
  var GovernanceProposalTarget;
67
63
  (function (GovernanceProposalTarget) {
68
64
  GovernanceProposalTarget["Controller"] = "Controller";
69
65
  GovernanceProposalTarget["Governance"] = "Governance";
66
+ GovernanceProposalTarget["PriceAggregator"] = "PriceAggregator";
70
67
  })(GovernanceProposalTarget || (exports.GovernanceProposalTarget = GovernanceProposalTarget = {}));
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Soroban event dispatch keys for the XOXNO Stellar lending controller,
3
- * each value joined as `"<domain>:<action>"`.
2
+ * Soroban event dispatch keys for XOXNO Stellar lending contracts
3
+ * (`"<domain>:<action>"`).
4
4
  *
5
- * Keep in parity with az-functions `StellarV2DispatchKey` plus known-but-
6
- * unindexed config topics (approve_token, aggregator, accumulator, …).
7
- * Governance schedulable fn names like `approve_blend_pool` are NOT topics.
5
+ * Keep in parity with az-functions `StellarV2DispatchKey` and live
6
+ * `#[contractevent]` topics on pool, controller, and price-aggregator.
7
+ * Legacy topics retained for historical ledger replay are marked deprecated.
8
8
  */
9
9
  export declare enum StellarLendingTopic {
10
10
  MarketCreate = "market:create",
@@ -15,7 +15,19 @@ export declare enum StellarLendingTopic {
15
15
  PositionFlashLoan = "position:flash_loan",
16
16
  PositionLiquidation = "position:liquidation",
17
17
  ConfigHub = "config:hub",
18
+ /**
19
+ * Live price-aggregator write topic (`set_oracle` / `set_sanity_band` /
20
+ * `set_tolerance`). Payload `{ key: PriceKey, oracle: AssetOracle }`.
21
+ */
22
+ ConfigAssetOracle = "config:asset_oracle",
23
+ /**
24
+ * @deprecated Pre-composable aggregator topic. Keep for historical ledger
25
+ * replay only; live chain emits `config:asset_oracle`.
26
+ */
18
27
  ConfigOracle = "config:oracle",
28
+ /**
29
+ * @deprecated Never emitted by the composable aggregator. Historical only.
30
+ */
19
31
  ConfigOracleDisabled = "config:oracle_disabled",
20
32
  ConfigSpoke = "config:spoke",
21
33
  ConfigSpokeAsset = "config:spoke_asset",
@@ -24,18 +36,24 @@ export declare enum StellarLendingTopic {
24
36
  StrategyInitialPayment = "strategy:initial_payment",
25
37
  StrategyFee = "strategy:fee",
26
38
  StrategyBlendMigration = "strategy:blend_migration",
27
- /** Known topic; currently skipped by the indexer (governance surface). */
39
+ /** Live controller: blend pool approve/revoke. */
40
+ ConfigApproveBlendPool = "config:approve_blend_pool",
41
+ /**
42
+ * @deprecated Replaced by `config:approve_blend_pool`. Historical only.
43
+ */
28
44
  ConfigApproveToken = "config:approve_token",
29
- /** Known topic; currently skipped by the indexer. */
45
+ /**
46
+ * @deprecated Replaced by `config:swap_aggregator` /
47
+ * `config:price_aggregator`. Historical only.
48
+ */
30
49
  ConfigAggregator = "config:aggregator",
31
- /** Known topic; currently skipped by the indexer. */
32
50
  ConfigAccumulator = "config:accumulator",
33
- /** Known topic; currently skipped by the indexer. */
51
+ /**
52
+ * @deprecated No longer emitted by the controller. Historical only.
53
+ */
34
54
  ConfigPoolTemplate = "config:pool_template",
35
- /** Known topic; currently skipped by the indexer. */
36
55
  ConfigPositionLimits = "config:position_limits",
37
- /** Known topic; currently skipped by the indexer. */
56
+ ConfigMinBorrowCollateral = "config:min_borrow_collateral",
38
57
  ConfigSwapAggregator = "config:swap_aggregator",
39
- /** Known topic; currently skipped by the indexer. */
40
58
  ConfigPriceAggregator = "config:price_aggregator"
41
59
  }
@@ -2,12 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.StellarLendingTopic = void 0;
4
4
  /**
5
- * Soroban event dispatch keys for the XOXNO Stellar lending controller,
6
- * each value joined as `"<domain>:<action>"`.
5
+ * Soroban event dispatch keys for XOXNO Stellar lending contracts
6
+ * (`"<domain>:<action>"`).
7
7
  *
8
- * Keep in parity with az-functions `StellarV2DispatchKey` plus known-but-
9
- * unindexed config topics (approve_token, aggregator, accumulator, …).
10
- * Governance schedulable fn names like `approve_blend_pool` are NOT topics.
8
+ * Keep in parity with az-functions `StellarV2DispatchKey` and live
9
+ * `#[contractevent]` topics on pool, controller, and price-aggregator.
10
+ * Legacy topics retained for historical ledger replay are marked deprecated.
11
11
  */
12
12
  var StellarLendingTopic;
13
13
  (function (StellarLendingTopic) {
@@ -19,7 +19,19 @@ var StellarLendingTopic;
19
19
  StellarLendingTopic["PositionFlashLoan"] = "position:flash_loan";
20
20
  StellarLendingTopic["PositionLiquidation"] = "position:liquidation";
21
21
  StellarLendingTopic["ConfigHub"] = "config:hub";
22
+ /**
23
+ * Live price-aggregator write topic (`set_oracle` / `set_sanity_band` /
24
+ * `set_tolerance`). Payload `{ key: PriceKey, oracle: AssetOracle }`.
25
+ */
26
+ StellarLendingTopic["ConfigAssetOracle"] = "config:asset_oracle";
27
+ /**
28
+ * @deprecated Pre-composable aggregator topic. Keep for historical ledger
29
+ * replay only; live chain emits `config:asset_oracle`.
30
+ */
22
31
  StellarLendingTopic["ConfigOracle"] = "config:oracle";
32
+ /**
33
+ * @deprecated Never emitted by the composable aggregator. Historical only.
34
+ */
23
35
  StellarLendingTopic["ConfigOracleDisabled"] = "config:oracle_disabled";
24
36
  StellarLendingTopic["ConfigSpoke"] = "config:spoke";
25
37
  StellarLendingTopic["ConfigSpokeAsset"] = "config:spoke_asset";
@@ -28,18 +40,24 @@ var StellarLendingTopic;
28
40
  StellarLendingTopic["StrategyInitialPayment"] = "strategy:initial_payment";
29
41
  StellarLendingTopic["StrategyFee"] = "strategy:fee";
30
42
  StellarLendingTopic["StrategyBlendMigration"] = "strategy:blend_migration";
31
- /** Known topic; currently skipped by the indexer (governance surface). */
43
+ /** Live controller: blend pool approve/revoke. */
44
+ StellarLendingTopic["ConfigApproveBlendPool"] = "config:approve_blend_pool";
45
+ /**
46
+ * @deprecated Replaced by `config:approve_blend_pool`. Historical only.
47
+ */
32
48
  StellarLendingTopic["ConfigApproveToken"] = "config:approve_token";
33
- /** Known topic; currently skipped by the indexer. */
49
+ /**
50
+ * @deprecated Replaced by `config:swap_aggregator` /
51
+ * `config:price_aggregator`. Historical only.
52
+ */
34
53
  StellarLendingTopic["ConfigAggregator"] = "config:aggregator";
35
- /** Known topic; currently skipped by the indexer. */
36
54
  StellarLendingTopic["ConfigAccumulator"] = "config:accumulator";
37
- /** Known topic; currently skipped by the indexer. */
55
+ /**
56
+ * @deprecated No longer emitted by the controller. Historical only.
57
+ */
38
58
  StellarLendingTopic["ConfigPoolTemplate"] = "config:pool_template";
39
- /** Known topic; currently skipped by the indexer. */
40
59
  StellarLendingTopic["ConfigPositionLimits"] = "config:position_limits";
41
- /** Known topic; currently skipped by the indexer. */
60
+ StellarLendingTopic["ConfigMinBorrowCollateral"] = "config:min_borrow_collateral";
42
61
  StellarLendingTopic["ConfigSwapAggregator"] = "config:swap_aggregator";
43
- /** Known topic; currently skipped by the indexer. */
44
62
  StellarLendingTopic["ConfigPriceAggregator"] = "config:price_aggregator";
45
63
  })(StellarLendingTopic || (exports.StellarLendingTopic = StellarLendingTopic = {}));
@@ -83,6 +83,11 @@ export declare class StellarFlashLoanEvent {
83
83
  fee: string;
84
84
  }
85
85
  export declare class StellarUpdateAssetOracleEvent {
86
+ key: Record<string, string>;
87
+ oracle: StellarLendingOracleUpdateStruct;
88
+ }
89
+ /** @deprecated Live chain emits `config:asset_oracle`. */
90
+ export declare class StellarLegacyUpdateOracleEvent {
86
91
  asset: string;
87
92
  oracle: StellarLendingOracleUpdateStruct;
88
93
  }
@@ -104,10 +109,22 @@ export declare class StellarInitialMultiplyPaymentEvent {
104
109
  usdValueWad: string;
105
110
  accountId: string;
106
111
  }
112
+ export declare class StellarApproveBlendPoolEvent {
113
+ pool: string;
114
+ approved: boolean;
115
+ }
116
+ /** @deprecated Use StellarApproveBlendPoolEvent / config:approve_blend_pool. */
107
117
  export declare class StellarApproveTokenEvent {
108
118
  wasmHash: string;
109
119
  approved: boolean;
110
120
  }
121
+ export declare class StellarUpdateSwapAggregatorEvent {
122
+ aggregator: string;
123
+ }
124
+ export declare class StellarUpdatePriceAggregatorEvent {
125
+ aggregator: string;
126
+ }
127
+ /** @deprecated Split into swap / price aggregator events. */
111
128
  export declare class StellarUpdateAggregatorEvent {
112
129
  aggregator: string;
113
130
  }
@@ -121,6 +138,10 @@ export declare class StellarUpdatePositionLimitsEvent {
121
138
  maxSupplyPositions: number;
122
139
  maxBorrowPositions: number;
123
140
  }
141
+ export declare class StellarUpdateMinBorrowCollateralEvent {
142
+ minBorrowCollateralUsdWad: string;
143
+ }
144
+ /** @deprecated Not emitted by the composable price-aggregator. */
124
145
  export declare class StellarOracleDisabledEvent {
125
146
  asset: string;
126
147
  }
@@ -160,8 +181,11 @@ export type StellarLendingDecodedEvent = {
160
181
  topic: 'position:flash_loan';
161
182
  data: StellarFlashLoanEvent;
162
183
  } | {
163
- topic: 'config:oracle';
184
+ topic: 'config:asset_oracle';
164
185
  data: StellarUpdateAssetOracleEvent;
186
+ } | {
187
+ topic: 'config:oracle';
188
+ data: StellarLegacyUpdateOracleEvent;
165
189
  } | {
166
190
  topic: 'position:liquidation';
167
191
  data: StellarLiquidationEvent;
@@ -174,9 +198,18 @@ export type StellarLendingDecodedEvent = {
174
198
  } | {
175
199
  topic: 'strategy:fee';
176
200
  data: StellarStrategyFeeEvent;
201
+ } | {
202
+ topic: 'config:approve_blend_pool';
203
+ data: StellarApproveBlendPoolEvent;
177
204
  } | {
178
205
  topic: 'config:approve_token';
179
206
  data: StellarApproveTokenEvent;
207
+ } | {
208
+ topic: 'config:swap_aggregator';
209
+ data: StellarUpdateSwapAggregatorEvent;
210
+ } | {
211
+ topic: 'config:price_aggregator';
212
+ data: StellarUpdatePriceAggregatorEvent;
180
213
  } | {
181
214
  topic: 'config:aggregator';
182
215
  data: StellarUpdateAggregatorEvent;
@@ -189,6 +222,9 @@ export type StellarLendingDecodedEvent = {
189
222
  } | {
190
223
  topic: 'config:position_limits';
191
224
  data: StellarUpdatePositionLimitsEvent;
225
+ } | {
226
+ topic: 'config:min_borrow_collateral';
227
+ data: StellarUpdateMinBorrowCollateralEvent;
192
228
  } | {
193
229
  topic: 'config:oracle_disabled';
194
230
  data: StellarOracleDisabledEvent;
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.StellarUpdateSpokeEvent = exports.StellarLiquidationEvent = exports.StellarOracleDisabledEvent = exports.StellarUpdatePositionLimitsEvent = exports.StellarUpdatePoolTemplateEvent = exports.StellarUpdateAccumulatorEvent = exports.StellarUpdateAggregatorEvent = exports.StellarApproveTokenEvent = exports.StellarInitialMultiplyPaymentEvent = exports.StellarStrategyFeeEvent = exports.StellarCleanBadDebtEvent = exports.StellarUpdateAssetOracleEvent = exports.StellarFlashLoanEvent = exports.StellarUpdatePositionBatchEvent = exports.StellarUpdateMarketStateBatchEvent = exports.StellarUpdateMarketParamsBatchEvent = exports.StellarPoolMarketParamsUpdate = exports.StellarUpdateMarketParamsEvent = exports.StellarCreateMarketEvent = exports.StellarEventPositionDelta = exports.StellarEventAccountAttributes = exports.StellarMarketStateSnapshot = void 0;
12
+ exports.StellarUpdateSpokeEvent = exports.StellarLiquidationEvent = exports.StellarOracleDisabledEvent = exports.StellarUpdateMinBorrowCollateralEvent = exports.StellarUpdatePositionLimitsEvent = exports.StellarUpdatePoolTemplateEvent = exports.StellarUpdateAccumulatorEvent = exports.StellarUpdateAggregatorEvent = exports.StellarUpdatePriceAggregatorEvent = exports.StellarUpdateSwapAggregatorEvent = exports.StellarApproveTokenEvent = exports.StellarApproveBlendPoolEvent = exports.StellarInitialMultiplyPaymentEvent = exports.StellarStrategyFeeEvent = exports.StellarCleanBadDebtEvent = exports.StellarLegacyUpdateOracleEvent = exports.StellarUpdateAssetOracleEvent = exports.StellarFlashLoanEvent = exports.StellarUpdatePositionBatchEvent = exports.StellarUpdateMarketStateBatchEvent = exports.StellarUpdateMarketParamsBatchEvent = exports.StellarPoolMarketParamsUpdate = exports.StellarUpdateMarketParamsEvent = exports.StellarCreateMarketEvent = exports.StellarEventPositionDelta = exports.StellarEventAccountAttributes = exports.StellarMarketStateSnapshot = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
14
  const lending_enum_1 = require("../../enums/lending.enum");
15
15
  const stellar_lending_admin_args_dto_1 = require("./stellar-lending-admin-args.dto");
@@ -371,21 +371,39 @@ __decorate([
371
371
  }),
372
372
  __metadata("design:type", String)
373
373
  ], StellarFlashLoanEvent.prototype, "fee", void 0);
374
- // ---------- topic: config:oracle ----------
374
+ // ---------- topic: config:asset_oracle ----------
375
375
  class StellarUpdateAssetOracleEvent {
376
376
  }
377
377
  exports.StellarUpdateAssetOracleEvent = StellarUpdateAssetOracleEvent;
378
378
  __decorate([
379
- (0, swagger_1.ApiProperty)({ type: String, description: 'Asset address' }),
380
- __metadata("design:type", String)
381
- ], StellarUpdateAssetOracleEvent.prototype, "asset", void 0);
379
+ (0, swagger_1.ApiProperty)({
380
+ description: 'PriceKey as decoded from chain: `{ Token: "C…" }` or `{ Ref: "BTC" }`',
381
+ }),
382
+ __metadata("design:type", Object)
383
+ ], StellarUpdateAssetOracleEvent.prototype, "key", void 0);
382
384
  __decorate([
383
385
  (0, swagger_1.ApiProperty)({
384
386
  type: lending_oracle_1.StellarLendingOracleUpdateStruct,
385
- description: 'Resolved oracle provider configuration. Sanity bounds and per-source quote tokens live on this nested struct, matching the contract event wire layout.',
387
+ description: 'Composable AssetOracle (`sources`, independence, tolerance, sanity). Emitted by set_oracle / set_sanity_band / set_tolerance.',
386
388
  }),
387
389
  __metadata("design:type", lending_oracle_1.StellarLendingOracleUpdateStruct)
388
390
  ], StellarUpdateAssetOracleEvent.prototype, "oracle", void 0);
391
+ // ---------- topic: config:oracle (legacy historical) ----------
392
+ /** @deprecated Live chain emits `config:asset_oracle`. */
393
+ class StellarLegacyUpdateOracleEvent {
394
+ }
395
+ exports.StellarLegacyUpdateOracleEvent = StellarLegacyUpdateOracleEvent;
396
+ __decorate([
397
+ (0, swagger_1.ApiProperty)({ type: String, description: 'Asset address (legacy payload)' }),
398
+ __metadata("design:type", String)
399
+ ], StellarLegacyUpdateOracleEvent.prototype, "asset", void 0);
400
+ __decorate([
401
+ (0, swagger_1.ApiProperty)({
402
+ type: lending_oracle_1.StellarLendingOracleUpdateStruct,
403
+ description: 'Legacy flat oracle config',
404
+ }),
405
+ __metadata("design:type", lending_oracle_1.StellarLendingOracleUpdateStruct)
406
+ ], StellarLegacyUpdateOracleEvent.prototype, "oracle", void 0);
389
407
  // ---------- topic: debt:bad_debt ----------
390
408
  class StellarCleanBadDebtEvent {
391
409
  }
@@ -466,24 +484,57 @@ __decorate([
466
484
  }),
467
485
  __metadata("design:type", String)
468
486
  ], StellarInitialMultiplyPaymentEvent.prototype, "accountId", void 0);
469
- // ---------- topic: config:approve_token ----------
487
+ // ---------- topic: config:approve_blend_pool ----------
488
+ class StellarApproveBlendPoolEvent {
489
+ }
490
+ exports.StellarApproveBlendPoolEvent = StellarApproveBlendPoolEvent;
491
+ __decorate([
492
+ (0, swagger_1.ApiProperty)({ type: String, description: 'Blend pool contract address' }),
493
+ __metadata("design:type", String)
494
+ ], StellarApproveBlendPoolEvent.prototype, "pool", void 0);
495
+ __decorate([
496
+ (0, swagger_1.ApiProperty)({
497
+ description: 'Whether the pool was approved (true) or revoked (false)',
498
+ }),
499
+ __metadata("design:type", Boolean)
500
+ ], StellarApproveBlendPoolEvent.prototype, "approved", void 0);
501
+ /** @deprecated Use StellarApproveBlendPoolEvent / config:approve_blend_pool. */
470
502
  class StellarApproveTokenEvent {
471
503
  }
472
504
  exports.StellarApproveTokenEvent = StellarApproveTokenEvent;
473
505
  __decorate([
474
506
  (0, swagger_1.ApiProperty)({
475
507
  type: String,
476
- description: 'Approved WASM hash, 32-byte hex string',
508
+ description: 'Approved WASM hash or pool address (legacy)',
477
509
  }),
478
510
  __metadata("design:type", String)
479
511
  ], StellarApproveTokenEvent.prototype, "wasmHash", void 0);
480
512
  __decorate([
481
513
  (0, swagger_1.ApiProperty)({
482
- description: 'Whether the hash was approved (true) or revoked (false)',
514
+ description: 'Whether approved (true) or revoked (false)',
483
515
  }),
484
516
  __metadata("design:type", Boolean)
485
517
  ], StellarApproveTokenEvent.prototype, "approved", void 0);
486
- // ---------- topic: config:aggregator ----------
518
+ // ---------- topic: config:swap_aggregator ----------
519
+ class StellarUpdateSwapAggregatorEvent {
520
+ }
521
+ exports.StellarUpdateSwapAggregatorEvent = StellarUpdateSwapAggregatorEvent;
522
+ __decorate([
523
+ (0, swagger_1.ApiProperty)({ type: String, description: 'Swap aggregator contract address' }),
524
+ __metadata("design:type", String)
525
+ ], StellarUpdateSwapAggregatorEvent.prototype, "aggregator", void 0);
526
+ // ---------- topic: config:price_aggregator ----------
527
+ class StellarUpdatePriceAggregatorEvent {
528
+ }
529
+ exports.StellarUpdatePriceAggregatorEvent = StellarUpdatePriceAggregatorEvent;
530
+ __decorate([
531
+ (0, swagger_1.ApiProperty)({
532
+ type: String,
533
+ description: 'Price aggregator (oracle authority) contract address',
534
+ }),
535
+ __metadata("design:type", String)
536
+ ], StellarUpdatePriceAggregatorEvent.prototype, "aggregator", void 0);
537
+ /** @deprecated Split into swap / price aggregator events. */
487
538
  class StellarUpdateAggregatorEvent {
488
539
  }
489
540
  exports.StellarUpdateAggregatorEvent = StellarUpdateAggregatorEvent;
@@ -528,7 +579,19 @@ __decorate([
528
579
  }),
529
580
  __metadata("design:type", Number)
530
581
  ], StellarUpdatePositionLimitsEvent.prototype, "maxBorrowPositions", void 0);
531
- // ---------- topic: config:oracle_disabled ----------
582
+ // ---------- topic: config:min_borrow_collateral ----------
583
+ class StellarUpdateMinBorrowCollateralEvent {
584
+ }
585
+ exports.StellarUpdateMinBorrowCollateralEvent = StellarUpdateMinBorrowCollateralEvent;
586
+ __decorate([
587
+ (0, swagger_1.ApiProperty)({
588
+ type: String,
589
+ description: 'Minimum borrow collateral floor, USD WAD decimal string',
590
+ }),
591
+ __metadata("design:type", String)
592
+ ], StellarUpdateMinBorrowCollateralEvent.prototype, "minBorrowCollateralUsdWad", void 0);
593
+ // ---------- topic: config:oracle_disabled (legacy historical) ----------
594
+ /** @deprecated Not emitted by the composable price-aggregator. */
532
595
  class StellarOracleDisabledEvent {
533
596
  }
534
597
  exports.StellarOracleDisabledEvent = StellarOracleDisabledEvent;
@@ -1,12 +1,16 @@
1
1
  import { StellarLendingDataType } from '../enums';
2
- import type { StellarOracleProvider } from '../oracle-provider';
2
+ import type { StellarAssetOracle } from '../oracle-provider';
3
3
  export declare class StellarAssetDoc {
4
4
  dataType: StellarLendingDataType;
5
5
  asset: string;
6
6
  symbol: string;
7
7
  name: string;
8
8
  decimals: number;
9
- oracleProvider: StellarOracleProvider | null;
9
+ /**
10
+ * Price-aggregator `AssetOracle` for `PriceKey::Token(asset)`, event-sourced
11
+ * from `config:asset_oracle`. Null until first configure.
12
+ */
13
+ oracleProvider: StellarAssetOracle | null;
10
14
  hubCount: number;
11
15
  reserveCount: number;
12
16
  updatedAt: number;
@@ -5,6 +5,10 @@ const enums_1 = require("../enums");
5
5
  class StellarAssetDoc {
6
6
  constructor(props) {
7
7
  this.dataType = enums_1.StellarLendingDataType.ASSET;
8
+ /**
9
+ * Price-aggregator `AssetOracle` for `PriceKey::Token(asset)`, event-sourced
10
+ * from `config:asset_oracle`. Null until first configure.
11
+ */
8
12
  this.oracleProvider = null;
9
13
  this.hubCount = 0;
10
14
  this.reserveCount = 0;
@@ -1,9 +1,10 @@
1
1
  import { StellarLendingDataType } from '../enums';
2
- import type { StellarOracleProvider } from '../oracle-provider';
3
2
  /**
4
3
  * Risk truth for one asset in one spoke on one hub
5
4
  * (`spokeAsset:{spokeId}:{hubId}:{asset}`). LTV, liquidation params, flags, and
6
5
  * per-spoke usage are event-sourced from the controller contract.
6
+ * Oracle config is asset-level on the price-aggregator (`StellarAssetDoc`), not
7
+ * per-spoke — there is no on-chain `oracle_override`.
7
8
  */
8
9
  export declare class StellarSpokeAssetDoc {
9
10
  dataType: StellarLendingDataType;
@@ -22,7 +23,6 @@ export declare class StellarSpokeAssetDoc {
22
23
  borrowCap: string;
23
24
  supplyCapShort: number;
24
25
  borrowCapShort: number;
25
- oracleOverride: StellarOracleProvider | null;
26
26
  suppliedScaledRay: string;
27
27
  borrowedScaledRay: string;
28
28
  updatedAt: number;
@@ -6,6 +6,8 @@ const enums_1 = require("../enums");
6
6
  * Risk truth for one asset in one spoke on one hub
7
7
  * (`spokeAsset:{spokeId}:{hubId}:{asset}`). LTV, liquidation params, flags, and
8
8
  * per-spoke usage are event-sourced from the controller contract.
9
+ * Oracle config is asset-level on the price-aggregator (`StellarAssetDoc`), not
10
+ * per-spoke — there is no on-chain `oracle_override`.
9
11
  */
10
12
  class StellarSpokeAssetDoc {
11
13
  constructor(props) {
@@ -22,7 +24,6 @@ class StellarSpokeAssetDoc {
22
24
  this.borrowCap = '0';
23
25
  this.supplyCapShort = 0;
24
26
  this.borrowCapShort = 0;
25
- this.oracleOverride = null;
26
27
  this.suppliedScaledRay = '0';
27
28
  this.borrowedScaledRay = '0';
28
29
  this.updatedAt = 0;
@@ -2,46 +2,50 @@
2
2
  * Stellar lending governance (timelock) proposal taxonomy. Self-contained copy
3
3
  * for the independent Stellar-lending subtree (no MVX coupling).
4
4
  *
5
- * `StellarGovernanceProposalKind` mirrors the `AdminOperation` variants the
6
- * governance contract schedules; the indexer maps a scheduled operation's
7
- * invoked function symbol to one of these.
5
+ * Mirrors live `AdminOperation` variants the governance contract schedules.
8
6
  */
9
7
  export declare enum StellarGovernanceProposalKind {
10
- SetAggregator = "SetAggregator",
8
+ SetSwapAggregator = "SetSwapAggregator",
9
+ SetPriceAggregator = "SetPriceAggregator",
11
10
  SetAccumulator = "SetAccumulator",
12
- SetPoolTemplate = "SetPoolTemplate",
13
- EditAssetConfig = "EditAssetConfig",
14
11
  SetPositionLimits = "SetPositionLimits",
15
- SetMinBorrowCollateral = "SetMinBorrowCollateral",
16
- AddEModeCategory = "AddEModeCategory",
17
- RemoveEModeCategory = "RemoveEModeCategory",
18
- AddAssetToEModeCategory = "AddAssetToEModeCategory",
19
- EditAssetInEModeCategory = "EditAssetInEModeCategory",
20
- RemoveAssetFromEMode = "RemoveAssetFromEMode",
21
- ApproveToken = "ApproveToken",
22
- RevokeToken = "RevokeToken",
12
+ SetMinBorrowCollateralUsd = "SetMinBorrowCollateralUsd",
13
+ CreateHub = "CreateHub",
14
+ AddSpoke = "AddSpoke",
15
+ RemoveSpoke = "RemoveSpoke",
16
+ AddAssetToSpoke = "AddAssetToSpoke",
17
+ EditAssetInSpoke = "EditAssetInSpoke",
18
+ RemoveAssetFromSpoke = "RemoveAssetFromSpoke",
23
19
  ApproveBlendPool = "ApproveBlendPool",
24
20
  RevokeBlendPool = "RevokeBlendPool",
25
21
  CreateLiquidityPool = "CreateLiquidityPool",
26
22
  UpgradeLiquidityPoolParams = "UpgradeLiquidityPoolParams",
27
23
  DeployPool = "DeployPool",
28
24
  UpgradePool = "UpgradePool",
25
+ SetPositionManager = "SetPositionManager",
29
26
  UpgradeController = "UpgradeController",
30
27
  MigrateController = "MigrateController",
31
- TransferControllerOwnership = "TransferControllerOwnership",
32
- ConfigureMarketOracle = "ConfigureMarketOracle",
28
+ TransferCtrlOwnership = "TransferCtrlOwnership",
33
29
  EditOracleTolerance = "EditOracleTolerance",
34
30
  SetSpokeLiquidationCurve = "SetSpokeLiquidationCurve",
35
- GovernanceUpgrade = "GovernanceUpgrade",
36
- UpdateDelay = "UpdateDelay",
37
- GrantGovernanceRole = "GrantGovernanceRole",
38
- RevokeGovernanceRole = "RevokeGovernanceRole",
39
- TransferGovernanceOwnership = "TransferGovernanceOwnership",
31
+ ForceSocializeBadDebt = "ForceSocializeBadDebt",
32
+ Unpause = "Unpause",
33
+ UpgradeGov = "UpgradeGov",
34
+ UpdateGovDelay = "UpdateGovDelay",
35
+ GrantGovRole = "GrantGovRole",
36
+ RevokeGovRole = "RevokeGovRole",
37
+ TransferGovOwnership = "TransferGovOwnership",
38
+ ConfigureAssetOracle = "ConfigureAssetOracle",
40
39
  /**
41
40
  * Owner-only, non-vetoable Recovery-tier council reset (`reset_cancellers`).
42
- * Scheduled at the ~30-day Recovery delay to replace a captured canceller set.
43
41
  */
44
42
  CancellerReset = "CancellerReset",
43
+ /** @deprecated Alias — use `SetSwapAggregator`. */
44
+ SetAggregator = "SetSwapAggregator",
45
+ /** @deprecated Alias — use `ConfigureAssetOracle`. */
46
+ ConfigureMarketOracle = "ConfigureAssetOracle",
47
+ /** @deprecated Alias — use `ApproveBlendPool`. */
48
+ ApproveToken = "ApproveBlendPool",
45
49
  Unknown = "Unknown"
46
50
  }
47
51
  /**
@@ -60,5 +64,6 @@ export declare enum StellarGovernanceProposalStatus {
60
64
  */
61
65
  export declare enum StellarGovernanceProposalTarget {
62
66
  Controller = "Controller",
63
- Governance = "Governance"
67
+ Governance = "Governance",
68
+ PriceAggregator = "PriceAggregator"
64
69
  }
@@ -5,47 +5,51 @@ exports.StellarGovernanceProposalTarget = exports.StellarGovernanceProposalStatu
5
5
  * Stellar lending governance (timelock) proposal taxonomy. Self-contained copy
6
6
  * for the independent Stellar-lending subtree (no MVX coupling).
7
7
  *
8
- * `StellarGovernanceProposalKind` mirrors the `AdminOperation` variants the
9
- * governance contract schedules; the indexer maps a scheduled operation's
10
- * invoked function symbol to one of these.
8
+ * Mirrors live `AdminOperation` variants the governance contract schedules.
11
9
  */
12
10
  var StellarGovernanceProposalKind;
13
11
  (function (StellarGovernanceProposalKind) {
14
- StellarGovernanceProposalKind["SetAggregator"] = "SetAggregator";
12
+ StellarGovernanceProposalKind["SetSwapAggregator"] = "SetSwapAggregator";
13
+ StellarGovernanceProposalKind["SetPriceAggregator"] = "SetPriceAggregator";
15
14
  StellarGovernanceProposalKind["SetAccumulator"] = "SetAccumulator";
16
- StellarGovernanceProposalKind["SetPoolTemplate"] = "SetPoolTemplate";
17
- StellarGovernanceProposalKind["EditAssetConfig"] = "EditAssetConfig";
18
15
  StellarGovernanceProposalKind["SetPositionLimits"] = "SetPositionLimits";
19
- StellarGovernanceProposalKind["SetMinBorrowCollateral"] = "SetMinBorrowCollateral";
20
- StellarGovernanceProposalKind["AddEModeCategory"] = "AddEModeCategory";
21
- StellarGovernanceProposalKind["RemoveEModeCategory"] = "RemoveEModeCategory";
22
- StellarGovernanceProposalKind["AddAssetToEModeCategory"] = "AddAssetToEModeCategory";
23
- StellarGovernanceProposalKind["EditAssetInEModeCategory"] = "EditAssetInEModeCategory";
24
- StellarGovernanceProposalKind["RemoveAssetFromEMode"] = "RemoveAssetFromEMode";
25
- StellarGovernanceProposalKind["ApproveToken"] = "ApproveToken";
26
- StellarGovernanceProposalKind["RevokeToken"] = "RevokeToken";
16
+ StellarGovernanceProposalKind["SetMinBorrowCollateralUsd"] = "SetMinBorrowCollateralUsd";
17
+ StellarGovernanceProposalKind["CreateHub"] = "CreateHub";
18
+ StellarGovernanceProposalKind["AddSpoke"] = "AddSpoke";
19
+ StellarGovernanceProposalKind["RemoveSpoke"] = "RemoveSpoke";
20
+ StellarGovernanceProposalKind["AddAssetToSpoke"] = "AddAssetToSpoke";
21
+ StellarGovernanceProposalKind["EditAssetInSpoke"] = "EditAssetInSpoke";
22
+ StellarGovernanceProposalKind["RemoveAssetFromSpoke"] = "RemoveAssetFromSpoke";
27
23
  StellarGovernanceProposalKind["ApproveBlendPool"] = "ApproveBlendPool";
28
24
  StellarGovernanceProposalKind["RevokeBlendPool"] = "RevokeBlendPool";
29
25
  StellarGovernanceProposalKind["CreateLiquidityPool"] = "CreateLiquidityPool";
30
26
  StellarGovernanceProposalKind["UpgradeLiquidityPoolParams"] = "UpgradeLiquidityPoolParams";
31
27
  StellarGovernanceProposalKind["DeployPool"] = "DeployPool";
32
28
  StellarGovernanceProposalKind["UpgradePool"] = "UpgradePool";
29
+ StellarGovernanceProposalKind["SetPositionManager"] = "SetPositionManager";
33
30
  StellarGovernanceProposalKind["UpgradeController"] = "UpgradeController";
34
31
  StellarGovernanceProposalKind["MigrateController"] = "MigrateController";
35
- StellarGovernanceProposalKind["TransferControllerOwnership"] = "TransferControllerOwnership";
36
- StellarGovernanceProposalKind["ConfigureMarketOracle"] = "ConfigureMarketOracle";
32
+ StellarGovernanceProposalKind["TransferCtrlOwnership"] = "TransferCtrlOwnership";
37
33
  StellarGovernanceProposalKind["EditOracleTolerance"] = "EditOracleTolerance";
38
34
  StellarGovernanceProposalKind["SetSpokeLiquidationCurve"] = "SetSpokeLiquidationCurve";
39
- StellarGovernanceProposalKind["GovernanceUpgrade"] = "GovernanceUpgrade";
40
- StellarGovernanceProposalKind["UpdateDelay"] = "UpdateDelay";
41
- StellarGovernanceProposalKind["GrantGovernanceRole"] = "GrantGovernanceRole";
42
- StellarGovernanceProposalKind["RevokeGovernanceRole"] = "RevokeGovernanceRole";
43
- StellarGovernanceProposalKind["TransferGovernanceOwnership"] = "TransferGovernanceOwnership";
35
+ StellarGovernanceProposalKind["ForceSocializeBadDebt"] = "ForceSocializeBadDebt";
36
+ StellarGovernanceProposalKind["Unpause"] = "Unpause";
37
+ StellarGovernanceProposalKind["UpgradeGov"] = "UpgradeGov";
38
+ StellarGovernanceProposalKind["UpdateGovDelay"] = "UpdateGovDelay";
39
+ StellarGovernanceProposalKind["GrantGovRole"] = "GrantGovRole";
40
+ StellarGovernanceProposalKind["RevokeGovRole"] = "RevokeGovRole";
41
+ StellarGovernanceProposalKind["TransferGovOwnership"] = "TransferGovOwnership";
42
+ StellarGovernanceProposalKind["ConfigureAssetOracle"] = "ConfigureAssetOracle";
44
43
  /**
45
44
  * Owner-only, non-vetoable Recovery-tier council reset (`reset_cancellers`).
46
- * Scheduled at the ~30-day Recovery delay to replace a captured canceller set.
47
45
  */
48
46
  StellarGovernanceProposalKind["CancellerReset"] = "CancellerReset";
47
+ /** @deprecated Alias — use `SetSwapAggregator`. */
48
+ StellarGovernanceProposalKind["SetAggregator"] = "SetSwapAggregator";
49
+ /** @deprecated Alias — use `ConfigureAssetOracle`. */
50
+ StellarGovernanceProposalKind["ConfigureMarketOracle"] = "ConfigureAssetOracle";
51
+ /** @deprecated Alias — use `ApproveBlendPool`. */
52
+ StellarGovernanceProposalKind["ApproveToken"] = "ApproveBlendPool";
49
53
  StellarGovernanceProposalKind["Unknown"] = "Unknown";
50
54
  })(StellarGovernanceProposalKind || (exports.StellarGovernanceProposalKind = StellarGovernanceProposalKind = {}));
51
55
  /**
@@ -67,4 +71,5 @@ var StellarGovernanceProposalTarget;
67
71
  (function (StellarGovernanceProposalTarget) {
68
72
  StellarGovernanceProposalTarget["Controller"] = "Controller";
69
73
  StellarGovernanceProposalTarget["Governance"] = "Governance";
74
+ StellarGovernanceProposalTarget["PriceAggregator"] = "PriceAggregator";
70
75
  })(StellarGovernanceProposalTarget || (exports.StellarGovernanceProposalTarget = StellarGovernanceProposalTarget = {}));
@@ -1,5 +1,10 @@
1
1
  import type { ActivityChain } from '../enums/common.enum';
2
- /** Live controller index for one Stellar `(hub, asset)` market. */
2
+ /**
3
+ * Live controller `MarketIndexView` for one hub market, plus client short
4
+ * scales. `hubId` is client-attached (view has no hub field); price legs keep
5
+ * historical ABI names (`safe_price_wad` / `aggregator_price_wad`) as
6
+ * primary/anchor short aliases for wire compatibility.
7
+ */
3
8
  export interface StellarMarketIndexByHub {
4
9
  hubId: number;
5
10
  asset: string;
@@ -7,12 +12,27 @@ export interface StellarMarketIndexByHub {
7
12
  supplyIndexShort: number;
8
13
  borrowIndex: string;
9
14
  borrowIndexShort: number;
15
+ /** Final composed USD WAD (`price_wad`). */
10
16
  usdPrice: string;
11
17
  usdPriceShort: number;
18
+ /**
19
+ * Primary/first oracle leg WAD (`safe_price_wad` — historical ABI name, not a
20
+ * safety flag).
21
+ */
12
22
  primaryPriceUsd: string;
13
23
  primaryPriceUsdShort: number;
24
+ /**
25
+ * Secondary/second oracle leg WAD (`aggregator_price_wad` — historical ABI
26
+ * name, not the swap aggregator).
27
+ */
14
28
  anchorPriceUsd: string;
15
29
  anchorPriceUsdShort: number;
30
+ /** Freshness timestamp of the final blend (seconds). */
31
+ priceTimestamp: number;
32
+ stale: boolean;
33
+ deviation: boolean;
34
+ /** True when the price would pass the fail-closed solvency path. */
35
+ valid: boolean;
16
36
  chain: ActivityChain;
17
37
  }
18
38
  /** Live controller state needed by Stellar lending clients. */
@@ -1,40 +1,109 @@
1
1
  /**
2
- * TS mirror of the on-chain `controller::events::EventOracleProvider`. All
3
- * `i128` string, `u32/u64` → number, `Option<T>` → `T | null`. Persistence
4
- * shape only (no swagger decorators); api-v2 owns the response DTOs.
2
+ * Persistence / event shapes for the Stellar price-aggregator composable
3
+ * oracle model (`config:asset_oracle`).
4
+ *
5
+ * Mirrors on-chain `PriceKey` + `AssetOracle` (`sources`, independence,
6
+ * tolerance, sanity). `i128` → string; `u32/u64` → number. No Nest
7
+ * decorators — api-v2 owns swagger DTOs; this package owns wire shapes.
5
8
  */
6
- export interface StellarOracleProvider {
7
- baseTokenId: string;
8
- quoteTokenSymbol: string;
9
- toleranceUpperBps: number;
10
- toleranceLowerBps: number;
11
- pricingMethod: number;
12
- oracleType: number;
13
- strategy: number;
9
+ /** On-chain `PriceKey`: Token SAC or registry-only Ref symbol. */
10
+ export type StellarPriceKey = {
11
+ Token: string;
12
+ } | {
13
+ Ref: string;
14
+ };
15
+ /** On-chain `ProviderKind`. */
16
+ export type StellarProviderKind = 'Reflector' | 'RedStone' | 'Xoxno';
17
+ /** On-chain `FeedNature`. */
18
+ export type StellarFeedNature = 'Market' | 'Fundamental';
19
+ /** On-chain `OracleAssetRef` for Reflector legs. */
20
+ export type StellarOracleAssetRef = {
21
+ Stellar: string;
22
+ } | {
23
+ Symbol: string;
24
+ } | {
25
+ String: string;
26
+ };
27
+ /** On-chain `OracleReadMode`. */
28
+ export type StellarOracleReadMode = 'Spot' | {
29
+ Twap: number;
30
+ };
31
+ /** On-chain `OracleTolerance` (BPS band around 10000). */
32
+ export interface StellarOracleTolerance {
33
+ upperRatioBps: number;
34
+ lowerRatioBps: number;
35
+ }
36
+ export interface StellarReflectorFeedRef {
37
+ contract: string;
38
+ asset: StellarOracleAssetRef;
39
+ readMode: StellarOracleReadMode;
40
+ }
41
+ export interface StellarMultiFeedRef {
42
+ contract: string;
43
+ feedId: string;
44
+ kind: StellarProviderKind;
45
+ nature: StellarFeedNature;
46
+ }
47
+ /** On-chain `ProviderRef`. */
48
+ export type StellarProviderRef = {
49
+ Reflector: StellarReflectorFeedRef;
50
+ } | {
51
+ MultiFeed: StellarMultiFeedRef;
52
+ };
53
+ export interface StellarFeedSource {
54
+ provider: StellarProviderRef;
55
+ decimals: number;
56
+ maxStaleSeconds: number;
57
+ }
58
+ export interface StellarScaledSource {
59
+ factor: StellarFeedSource;
60
+ quote: StellarPriceKey;
61
+ minFactorWad: string;
62
+ maxFactorWad: string;
63
+ }
64
+ export type StellarPoolKind = 'ConstantProduct';
65
+ export interface StellarLpShareSource {
66
+ pool: string;
67
+ kind: StellarPoolKind;
68
+ keyA: StellarPriceKey;
69
+ keyB: StellarPriceKey;
70
+ reserveADecimals: number;
71
+ reserveBDecimals: number;
72
+ shareDecimals: number;
73
+ }
74
+ /** On-chain `PriceSource`. */
75
+ export type StellarPriceSource = {
76
+ Feed: StellarFeedSource;
77
+ } | {
78
+ Scaled: StellarScaledSource;
79
+ } | {
80
+ LpShare: StellarLpShareSource;
81
+ };
82
+ export interface StellarTrustDomain {
83
+ kind: StellarProviderKind;
84
+ contract: string;
85
+ }
86
+ /** On-chain `IndependencePolicy`. */
87
+ export type StellarIndependencePolicy = 'RequireDisjoint' | {
88
+ AllowShared: StellarTrustDomain[];
89
+ };
90
+ /**
91
+ * On-chain `AssetOracle` — one or two independent opinions for a `PriceKey`.
92
+ * Stored on `StellarAssetDoc.oracleProvider` and carried by
93
+ * `config:asset_oracle` events.
94
+ */
95
+ export interface StellarAssetOracle {
14
96
  assetDecimals: number;
15
97
  maxPriceStaleSeconds: number;
16
- primaryProvider: number;
17
- primaryContract: string;
18
- primaryAsset: string | null;
19
- primarySymbol: string | null;
20
- primaryFeedId: string | null;
21
- primaryQuoteToken: string | null;
22
- primaryReadMode: number;
23
- primaryTwapRecords: number;
24
- primaryDecimals: number;
25
- primaryResolutionSeconds: number;
26
- primaryMaxStaleSeconds: number;
27
- anchorProvider: number | null;
28
- anchorContract: string | null;
29
- anchorAsset: string | null;
30
- anchorSymbol: string | null;
31
- anchorFeedId: string | null;
32
- anchorQuoteToken: string | null;
33
- anchorReadMode: number;
34
- anchorTwapRecords: number;
35
- anchorDecimals: number;
36
- anchorResolutionSeconds: number;
37
- anchorMaxStaleSeconds: number;
98
+ sources: StellarPriceSource[];
99
+ tolerance: StellarOracleTolerance;
100
+ independence: StellarIndependencePolicy;
38
101
  minSanityPriceWad: string;
39
102
  maxSanityPriceWad: string;
40
103
  }
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;
@@ -1,2 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Persistence / event shapes for the Stellar price-aggregator composable
4
+ * oracle model (`config:asset_oracle`).
5
+ *
6
+ * Mirrors on-chain `PriceKey` + `AssetOracle` (`sources`, independence,
7
+ * tolerance, sanity). `i128` → string; `u32/u64` → number. No Nest
8
+ * decorators — api-v2 owns swagger DTOs; this package owns wire shapes.
9
+ */
2
10
  Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xoxno/types",
3
- "version": "1.0.472",
3
+ "version": "1.0.473",
4
4
  "description": "Shared types and utilities for XOXNO API.",
5
5
  "exports": {
6
6
  ".": {