@xoxno/types 1.0.483 → 1.0.485
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/cache/cache-keys.d.ts +16 -15
- package/dist/cache/cache-keys.js +30 -30
- package/dist/cosmos-db/documents/lending/lending-account-profile.d.ts +3 -1
- package/dist/cosmos-db/documents/lending/lending-account-profile.js +15 -2
- package/dist/cosmos-db/documents/lending/lending-governance-proposal.doc.d.ts +2 -0
- package/dist/cosmos-db/documents/lending/lending-governance-proposal.doc.js +7 -2
- package/dist/cosmos-db/documents/lending/lending-market-profile.doc.d.ts +2 -0
- package/dist/cosmos-db/documents/lending/lending-market-profile.doc.js +14 -2
- package/dist/requests/lending/lending-governance-proposal.filter.d.ts +3 -0
- package/dist/requests/lending/lending-market-profile.filter.d.ts +3 -0
- package/dist/requests/lending/stellar-lending-events.dto.d.ts +15 -0
- package/dist/requests/lending/stellar-lending-events.dto.js +17 -2
- package/dist/stellar-lending/context.d.ts +7 -0
- package/dist/stellar-lending/documents/account-delegate.doc.d.ts +2 -0
- package/dist/stellar-lending/documents/account-delegate.doc.js +2 -1
- package/dist/stellar-lending/documents/account-position.doc.d.ts +2 -0
- package/dist/stellar-lending/documents/account-position.doc.js +2 -1
- package/dist/stellar-lending/documents/asset.doc.d.ts +2 -0
- package/dist/stellar-lending/documents/asset.doc.js +2 -1
- package/dist/stellar-lending/documents/blend-pool.doc.d.ts +2 -0
- package/dist/stellar-lending/documents/blend-pool.doc.js +2 -1
- package/dist/stellar-lending/documents/contract-config.doc.d.ts +2 -0
- package/dist/stellar-lending/documents/contract-config.doc.js +2 -1
- package/dist/stellar-lending/documents/contract-role.doc.d.ts +2 -0
- package/dist/stellar-lending/documents/contract-role.doc.js +2 -1
- package/dist/stellar-lending/documents/cursor.doc.d.ts +2 -0
- package/dist/stellar-lending/documents/cursor.doc.js +2 -1
- package/dist/stellar-lending/documents/governance-proposal.doc.d.ts +2 -0
- package/dist/stellar-lending/documents/governance-proposal.doc.js +2 -1
- package/dist/stellar-lending/documents/hub-asset.doc.d.ts +2 -0
- package/dist/stellar-lending/documents/hub-asset.doc.js +2 -1
- package/dist/stellar-lending/documents/hub.doc.d.ts +2 -0
- package/dist/stellar-lending/documents/hub.doc.js +2 -1
- package/dist/stellar-lending/documents/spoke-asset.doc.d.ts +10 -0
- package/dist/stellar-lending/documents/spoke-asset.doc.js +10 -1
- package/dist/stellar-lending/documents/spoke.doc.d.ts +2 -0
- package/dist/stellar-lending/documents/spoke.doc.js +2 -1
- package/dist/stellar-lending/enums/activity.enum.d.ts +13 -0
- package/dist/stellar-lending/enums/activity.enum.js +13 -0
- package/dist/stellar-lending/index.d.ts +1 -0
- package/dist/stellar-lending/index.js +1 -0
- package/dist/stellar-lending/kusto/activity-data.d.ts +28 -8
- package/dist/stellar-lending/kusto/market-state-data.d.ts +2 -0
- package/dist/stellar-lending/list.d.ts +2 -0
- package/dist/stellar-lending/network.d.ts +4 -0
- package/dist/stellar-lending/network.js +10 -0
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { StellarNetwork } from '../stellar-lending/network';
|
|
1
2
|
/**
|
|
2
3
|
* Shared cache key definitions for use across xoxno-api-v2 and xoxno-az-functions.
|
|
3
4
|
* This ensures consistent cache keys and TTLs across all repositories.
|
|
@@ -102,21 +103,21 @@ export declare const CacheKeys: {
|
|
|
102
103
|
LendingMarketAverageGraphData: (token: string) => CacheKeyConfig;
|
|
103
104
|
LendingMarketQuery: (filterHash: string) => CacheKeyConfig;
|
|
104
105
|
UserLendingPositions: (address: string, token?: string) => CacheKeyConfig;
|
|
105
|
-
StellarLendingContext: () => CacheKeyConfig;
|
|
106
|
-
StellarLendingAssetsList: () => CacheKeyConfig;
|
|
107
|
-
StellarLendingHubsList: () => CacheKeyConfig;
|
|
108
|
-
StellarLendingSpokesList: () => CacheKeyConfig;
|
|
109
|
-
StellarLendingReservesList: (hubId?: string | number | null, spokeId?: string | number | null, asset?: string | null) => CacheKeyConfig;
|
|
110
|
-
StellarLendingReserve: (spokeId: number, hubId: number, asset: string) => CacheKeyConfig;
|
|
111
|
-
StellarLendingAsset: (asset: string) => CacheKeyConfig;
|
|
112
|
-
StellarLendingAssetPageBase: (asset: string) => CacheKeyConfig;
|
|
113
|
-
StellarLendingAssetMarkets: (asset: string, side: string) => CacheKeyConfig;
|
|
114
|
-
StellarLendingHub: (hubId: number) => CacheKeyConfig;
|
|
115
|
-
StellarLendingSpoke: (spokeId: number) => CacheKeyConfig;
|
|
116
|
-
StellarLendingUserPositions: (owner: string) => CacheKeyConfig;
|
|
117
|
-
StellarLendingAccountPositions: (accountId: string) => CacheKeyConfig;
|
|
118
|
-
StellarLendingGovernanceProposals: (top: number, continuationToken?: string | null) => CacheKeyConfig;
|
|
119
|
-
StellarLendingLiveIndexes: (hash: string) => CacheKeyConfig;
|
|
106
|
+
StellarLendingContext: (network: StellarNetwork) => CacheKeyConfig;
|
|
107
|
+
StellarLendingAssetsList: (network: StellarNetwork) => CacheKeyConfig;
|
|
108
|
+
StellarLendingHubsList: (network: StellarNetwork) => CacheKeyConfig;
|
|
109
|
+
StellarLendingSpokesList: (network: StellarNetwork) => CacheKeyConfig;
|
|
110
|
+
StellarLendingReservesList: (network: StellarNetwork, hubId?: string | number | null, spokeId?: string | number | null, asset?: string | null) => CacheKeyConfig;
|
|
111
|
+
StellarLendingReserve: (network: StellarNetwork, spokeId: number, hubId: number, asset: string) => CacheKeyConfig;
|
|
112
|
+
StellarLendingAsset: (network: StellarNetwork, asset: string) => CacheKeyConfig;
|
|
113
|
+
StellarLendingAssetPageBase: (network: StellarNetwork, asset: string) => CacheKeyConfig;
|
|
114
|
+
StellarLendingAssetMarkets: (network: StellarNetwork, asset: string, side: string) => CacheKeyConfig;
|
|
115
|
+
StellarLendingHub: (network: StellarNetwork, hubId: number) => CacheKeyConfig;
|
|
116
|
+
StellarLendingSpoke: (network: StellarNetwork, spokeId: number) => CacheKeyConfig;
|
|
117
|
+
StellarLendingUserPositions: (network: StellarNetwork, owner: string) => CacheKeyConfig;
|
|
118
|
+
StellarLendingAccountPositions: (network: StellarNetwork, accountId: string) => CacheKeyConfig;
|
|
119
|
+
StellarLendingGovernanceProposals: (network: StellarNetwork, top: number, continuationToken?: string | null) => CacheKeyConfig;
|
|
120
|
+
StellarLendingLiveIndexes: (network: StellarNetwork, hash: string) => CacheKeyConfig;
|
|
120
121
|
HatomUserInfo: (address: string) => CacheKeyConfig;
|
|
121
122
|
UserUnreadNotificationCount: (address: string) => CacheKeyConfig;
|
|
122
123
|
EventProfileDoc: (eventId: string) => CacheKeyConfig;
|
package/dist/cache/cache-keys.js
CHANGED
|
@@ -383,64 +383,64 @@ exports.CacheKeys = {
|
|
|
383
383
|
key: `user:${address}:lending:positions${token ? `:${token}` : ''}`,
|
|
384
384
|
ttl: ttl_1.TTLS.ONE_MINUTE / 2, // 30 seconds
|
|
385
385
|
}),
|
|
386
|
-
StellarLendingContext: () => ({
|
|
387
|
-
key:
|
|
386
|
+
StellarLendingContext: (network) => ({
|
|
387
|
+
key: `sl:${network}:context`,
|
|
388
388
|
ttl: ttl_1.TTLS.ONE_MINUTE / 2,
|
|
389
389
|
}),
|
|
390
|
-
StellarLendingAssetsList: () => ({
|
|
391
|
-
key:
|
|
390
|
+
StellarLendingAssetsList: (network) => ({
|
|
391
|
+
key: `sl:${network}:list:assets`,
|
|
392
392
|
ttl: ttl_1.TTLS.ONE_MINUTE / 2,
|
|
393
393
|
}),
|
|
394
|
-
StellarLendingHubsList: () => ({
|
|
395
|
-
key:
|
|
394
|
+
StellarLendingHubsList: (network) => ({
|
|
395
|
+
key: `sl:${network}:list:hubs`,
|
|
396
396
|
ttl: ttl_1.TTLS.ONE_MINUTE / 2,
|
|
397
397
|
}),
|
|
398
|
-
StellarLendingSpokesList: () => ({
|
|
399
|
-
key:
|
|
398
|
+
StellarLendingSpokesList: (network) => ({
|
|
399
|
+
key: `sl:${network}:list:spokes`,
|
|
400
400
|
ttl: ttl_1.TTLS.ONE_MINUTE / 2,
|
|
401
401
|
}),
|
|
402
|
-
StellarLendingReservesList: (hubId, spokeId, asset) => ({
|
|
403
|
-
key: `sl:list:reserves:${serializeStellarFilter(hubId)}:${serializeStellarFilter(spokeId)}:${serializeStellarFilter(asset)}`,
|
|
402
|
+
StellarLendingReservesList: (network, hubId, spokeId, asset) => ({
|
|
403
|
+
key: `sl:${network}:list:reserves:${serializeStellarFilter(hubId)}:${serializeStellarFilter(spokeId)}:${serializeStellarFilter(asset)}`,
|
|
404
404
|
ttl: ttl_1.TTLS.ONE_MINUTE / 2,
|
|
405
405
|
}),
|
|
406
|
-
StellarLendingReserve: (spokeId, hubId, asset) => ({
|
|
407
|
-
key: `sl:reserve:${spokeId}:${hubId}:${asset}`,
|
|
406
|
+
StellarLendingReserve: (network, spokeId, hubId, asset) => ({
|
|
407
|
+
key: `sl:${network}:reserve:${spokeId}:${hubId}:${asset}`,
|
|
408
408
|
ttl: ttl_1.TTLS.ONE_MINUTE / 2,
|
|
409
409
|
}),
|
|
410
|
-
StellarLendingAsset: (asset) => ({
|
|
411
|
-
key: `sl:asset:${asset}`,
|
|
410
|
+
StellarLendingAsset: (network, asset) => ({
|
|
411
|
+
key: `sl:${network}:asset:${asset}`,
|
|
412
412
|
ttl: ttl_1.TTLS.ONE_MINUTE / 2,
|
|
413
413
|
}),
|
|
414
|
-
StellarLendingAssetPageBase: (asset) => ({
|
|
415
|
-
key: `sl:asset-page-base:${asset}`,
|
|
414
|
+
StellarLendingAssetPageBase: (network, asset) => ({
|
|
415
|
+
key: `sl:${network}:asset-page-base:${asset}`,
|
|
416
416
|
ttl: ttl_1.TTLS.ONE_MINUTE / 2,
|
|
417
417
|
}),
|
|
418
|
-
StellarLendingAssetMarkets: (asset, side) => ({
|
|
419
|
-
key: `sl:asset-markets:${asset}:${side}`,
|
|
418
|
+
StellarLendingAssetMarkets: (network, asset, side) => ({
|
|
419
|
+
key: `sl:${network}:asset-markets:${asset}:${side}`,
|
|
420
420
|
ttl: ttl_1.TTLS.ONE_MINUTE / 2,
|
|
421
421
|
}),
|
|
422
|
-
StellarLendingHub: (hubId) => ({
|
|
423
|
-
key: `sl:hub:${hubId}`,
|
|
422
|
+
StellarLendingHub: (network, hubId) => ({
|
|
423
|
+
key: `sl:${network}:hub:${hubId}`,
|
|
424
424
|
ttl: ttl_1.TTLS.ONE_MINUTE / 2,
|
|
425
425
|
}),
|
|
426
|
-
StellarLendingSpoke: (spokeId) => ({
|
|
427
|
-
key: `sl:spoke:${spokeId}`,
|
|
426
|
+
StellarLendingSpoke: (network, spokeId) => ({
|
|
427
|
+
key: `sl:${network}:spoke:${spokeId}`,
|
|
428
428
|
ttl: ttl_1.TTLS.ONE_MINUTE / 2,
|
|
429
429
|
}),
|
|
430
|
-
StellarLendingUserPositions: (owner) => ({
|
|
431
|
-
key: `sl:user-positions:${owner}`,
|
|
430
|
+
StellarLendingUserPositions: (network, owner) => ({
|
|
431
|
+
key: `sl:${network}:user-positions:${owner}`,
|
|
432
432
|
ttl: ttl_1.TTLS.ONE_MINUTE / 2,
|
|
433
433
|
}),
|
|
434
|
-
StellarLendingAccountPositions: (accountId) => ({
|
|
435
|
-
key: `sl:account-positions:${accountId}`,
|
|
434
|
+
StellarLendingAccountPositions: (network, accountId) => ({
|
|
435
|
+
key: `sl:${network}:account-positions:${accountId}`,
|
|
436
436
|
ttl: ttl_1.TTLS.ONE_MINUTE / 2,
|
|
437
437
|
}),
|
|
438
|
-
StellarLendingGovernanceProposals: (top, continuationToken) => ({
|
|
439
|
-
key: `sl:gov-proposals:${top}:${continuationToken ?? ''}`,
|
|
438
|
+
StellarLendingGovernanceProposals: (network, top, continuationToken) => ({
|
|
439
|
+
key: `sl:${network}:gov-proposals:${top}:${continuationToken ?? ''}`,
|
|
440
440
|
ttl: ttl_1.TTLS.ONE_MINUTE / 2,
|
|
441
441
|
}),
|
|
442
|
-
StellarLendingLiveIndexes: (hash) => ({
|
|
443
|
-
key: `sl:live-indexes:${hash}`,
|
|
442
|
+
StellarLendingLiveIndexes: (network, hash) => ({
|
|
443
|
+
key: `sl:${network}:live-indexes:${hash}`,
|
|
444
444
|
ttl: ttl_1.TTLS.ONE_SECOND * 3,
|
|
445
445
|
}),
|
|
446
446
|
HatomUserInfo: (address) => ({
|
|
@@ -3,6 +3,7 @@ import { PositionMode } from '../../../enums/lending.enum';
|
|
|
3
3
|
import { LendingEModeCategoryProfileDoc } from './lending-emode-category-profile.doc';
|
|
4
4
|
import { LendingMarketProfile } from './lending-market-profile.doc';
|
|
5
5
|
import { ActivityChain } from '../../../enums/common.enum';
|
|
6
|
+
import { type StellarNetwork } from '../../../stellar-lending/network';
|
|
6
7
|
export declare class InitialPaymentMultiplier {
|
|
7
8
|
initialPaymentAmount: string;
|
|
8
9
|
initialPaymentToken: string;
|
|
@@ -26,13 +27,14 @@ export declare class LendingAccountProfileDoc {
|
|
|
26
27
|
initialPaymentMultiplier?: InitialPaymentMultiplier;
|
|
27
28
|
isClassic?: boolean;
|
|
28
29
|
chain: ActivityChain;
|
|
30
|
+
network?: StellarNetwork;
|
|
29
31
|
spokeId?: number;
|
|
30
32
|
id: string;
|
|
31
33
|
pk: string;
|
|
32
34
|
_ts: number;
|
|
33
35
|
constructor(props?: Partial<LendingAccountProfileDoc>);
|
|
34
36
|
}
|
|
35
|
-
declare const selectFields: readonly ["token", "name", "supplyApy", "borrowApy", "decimals", "reserves", "supplyCap", "borrowCap", "supplyAmount", "supplyAmountScaled", "borrowAmountScaled", "ltv", "liquidationThreshold", "liquidationBonus", "liquidationFee", "siloed", "rewardsReserve", "maxDebtUsd", "debtCeiling", "isolated", "canBeCollateral", "timestamp", "canBeBorrowed", "canBorrowInIsolation", "extraApy", "flashLoanFee", "utilizationRate", "borrowAmount", "optimalUsageRate", "slopeRate1", "slopeRate2", "slopeRate3", "midUsageRate", "baseRate", "maxBorrowRate", "reserveFactor", "maxUtilizationRay", "address", "flashLoan", "oracleProvider", "indexes", "chain"];
|
|
37
|
+
declare const selectFields: readonly ["token", "name", "supplyApy", "borrowApy", "decimals", "reserves", "supplyCap", "borrowCap", "supplyAmount", "supplyAmountScaled", "borrowAmountScaled", "ltv", "liquidationThreshold", "liquidationBonus", "liquidationFee", "siloed", "rewardsReserve", "maxDebtUsd", "debtCeiling", "isolated", "canBeCollateral", "timestamp", "canBeBorrowed", "canBorrowInIsolation", "extraApy", "flashLoanFee", "utilizationRate", "borrowAmount", "optimalUsageRate", "slopeRate1", "slopeRate2", "slopeRate3", "midUsageRate", "baseRate", "maxBorrowRate", "reserveFactor", "maxUtilizationRay", "address", "flashLoan", "oracleProvider", "indexes", "chain", "network"];
|
|
36
38
|
export declare class LendingAccountProfile extends LendingAccountProfileDoc {
|
|
37
39
|
supplyAmount: string;
|
|
38
40
|
borrowAmount: string;
|
|
@@ -17,6 +17,7 @@ const lending_emode_category_profile_doc_1 = require("./lending-emode-category-p
|
|
|
17
17
|
const lending_market_profile_doc_1 = require("./lending-market-profile.doc");
|
|
18
18
|
const common_enum_1 = require("../../../enums/common.enum");
|
|
19
19
|
const lending_chain_1 = require("./lending-chain");
|
|
20
|
+
const network_1 = require("../../../stellar-lending/network");
|
|
20
21
|
class InitialPaymentMultiplier {
|
|
21
22
|
}
|
|
22
23
|
exports.InitialPaymentMultiplier = InitialPaymentMultiplier;
|
|
@@ -48,9 +49,12 @@ class LendingAccountProfileDoc {
|
|
|
48
49
|
this.borrowAmountScaled = '0';
|
|
49
50
|
this.chain = common_enum_1.ActivityChain.MVX;
|
|
50
51
|
Object.assign(this, props);
|
|
51
|
-
this.pk = this.dataType;
|
|
52
|
-
this.id = `${this.identifier}_${this.token}`;
|
|
53
52
|
this.chain = (0, lending_chain_1.normalizeLendingChain)(this.chain);
|
|
53
|
+
this.pk =
|
|
54
|
+
this.chain === common_enum_1.ActivityChain.STELLAR
|
|
55
|
+
? (0, network_1.stellarLendingPartitionKey)(this.network, this.dataType)
|
|
56
|
+
: this.dataType;
|
|
57
|
+
this.id = `${this.identifier}_${this.token}`;
|
|
54
58
|
}
|
|
55
59
|
}
|
|
56
60
|
exports.LendingAccountProfileDoc = LendingAccountProfileDoc;
|
|
@@ -178,6 +182,14 @@ __decorate([
|
|
|
178
182
|
}),
|
|
179
183
|
__metadata("design:type", String)
|
|
180
184
|
], LendingAccountProfileDoc.prototype, "chain", void 0);
|
|
185
|
+
__decorate([
|
|
186
|
+
(0, swagger_1.ApiProperty)({
|
|
187
|
+
description: 'Stellar network discriminator; required for Stellar rows',
|
|
188
|
+
required: false,
|
|
189
|
+
enum: ['mainnet', 'testnet'],
|
|
190
|
+
}),
|
|
191
|
+
__metadata("design:type", String)
|
|
192
|
+
], LendingAccountProfileDoc.prototype, "network", void 0);
|
|
181
193
|
__decorate([
|
|
182
194
|
(0, swagger_1.ApiProperty)({
|
|
183
195
|
description: 'Stellar spoke the account belongs to (rs-lending-xlm `AccountMeta.spoke_id`). Always 0 for MVX.',
|
|
@@ -256,6 +268,7 @@ const selectFields = [
|
|
|
256
268
|
// to MVX, and Stellar users get the "Switch your Wallet" modal on
|
|
257
269
|
// Remove / Withdraw / Repay / Borrow / Swap / Liquidate.
|
|
258
270
|
'chain',
|
|
271
|
+
'network',
|
|
259
272
|
];
|
|
260
273
|
class LendingAccountProfile extends LendingAccountProfileDoc {
|
|
261
274
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LendingDataType } from '../../../enums/lending-data-type.enum';
|
|
2
2
|
import { GovernanceProposalKind, GovernanceProposalStatus, GovernanceProposalTarget } from '../../../enums/lending-governance.enum';
|
|
3
|
+
import { type StellarNetwork } from '../../../stellar-lending/network';
|
|
3
4
|
/**
|
|
4
5
|
* One decoded "what will change" row for a governance proposal, rendered as a
|
|
5
6
|
* label/value pair. The indexer formats these from the decoded operation args
|
|
@@ -25,6 +26,7 @@ export declare class GovernanceProposalField {
|
|
|
25
26
|
*/
|
|
26
27
|
export declare class LendingGovernanceProposalDoc {
|
|
27
28
|
dataType: LendingDataType;
|
|
29
|
+
network: StellarNetwork;
|
|
28
30
|
operationId: string;
|
|
29
31
|
kind: GovernanceProposalKind;
|
|
30
32
|
status: GovernanceProposalStatus;
|
|
@@ -13,6 +13,7 @@ exports.LendingGovernanceProposalQuery = exports.LendingGovernanceProposalDoc =
|
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
14
|
const lending_data_type_enum_1 = require("../../../enums/lending-data-type.enum");
|
|
15
15
|
const lending_governance_enum_1 = require("../../../enums/lending-governance.enum");
|
|
16
|
+
const network_1 = require("../../../stellar-lending/network");
|
|
16
17
|
const cosmos_db_paginated_response_dto_1 = require("../../cosmos-db-paginated-response.dto");
|
|
17
18
|
/**
|
|
18
19
|
* One decoded "what will change" row for a governance proposal, rendered as a
|
|
@@ -49,7 +50,7 @@ class LendingGovernanceProposalDoc {
|
|
|
49
50
|
this.dataType = lending_data_type_enum_1.LendingDataType.GOVERNANCE_PROPOSAL;
|
|
50
51
|
this.fields = [];
|
|
51
52
|
Object.assign(this, props);
|
|
52
|
-
this.pk = this.dataType;
|
|
53
|
+
this.pk = (0, network_1.stellarLendingPartitionKey)(this.network, this.dataType);
|
|
53
54
|
this.id = this.operationId;
|
|
54
55
|
}
|
|
55
56
|
}
|
|
@@ -62,6 +63,10 @@ __decorate([
|
|
|
62
63
|
}),
|
|
63
64
|
__metadata("design:type", Object)
|
|
64
65
|
], LendingGovernanceProposalDoc.prototype, "dataType", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, swagger_1.ApiProperty)({ enum: ['mainnet', 'testnet'] }),
|
|
68
|
+
__metadata("design:type", String)
|
|
69
|
+
], LendingGovernanceProposalDoc.prototype, "network", void 0);
|
|
65
70
|
__decorate([
|
|
66
71
|
(0, swagger_1.ApiProperty)({
|
|
67
72
|
description: 'Operation id (keccak256 content hash), hex string',
|
|
@@ -266,7 +271,7 @@ __decorate([
|
|
|
266
271
|
__decorate([
|
|
267
272
|
(0, swagger_1.ApiProperty)({
|
|
268
273
|
description: 'Cosmos DB partition key',
|
|
269
|
-
example: 'governanceProposal',
|
|
274
|
+
example: 'mainnet:governanceProposal',
|
|
270
275
|
}),
|
|
271
276
|
__metadata("design:type", String)
|
|
272
277
|
], LendingGovernanceProposalDoc.prototype, "pk", void 0);
|
|
@@ -5,6 +5,7 @@ import { LendingOracleProvider } from './lending-oracle';
|
|
|
5
5
|
import { LendingIndexesDto } from '../../../requests/lending/lending-indexes.dto';
|
|
6
6
|
import { ActivityChain } from '../../../enums/common.enum';
|
|
7
7
|
import { MarketStatus } from '../../../enums/lending.enum';
|
|
8
|
+
import { type StellarNetwork } from '../../../stellar-lending/network';
|
|
8
9
|
export declare class LendingMarketProfileDoc {
|
|
9
10
|
dataType: LendingDataType;
|
|
10
11
|
token: string;
|
|
@@ -56,6 +57,7 @@ export declare class LendingMarketProfileDoc {
|
|
|
56
57
|
canBorrowInIsolation: boolean;
|
|
57
58
|
oracleProvider: LendingOracleProvider;
|
|
58
59
|
chain: ActivityChain;
|
|
60
|
+
network?: StellarNetwork;
|
|
59
61
|
id: string;
|
|
60
62
|
pk: string;
|
|
61
63
|
_ts: number;
|
|
@@ -20,6 +20,7 @@ const lending_indexes_dto_1 = require("../../../requests/lending/lending-indexes
|
|
|
20
20
|
const common_enum_1 = require("../../../enums/common.enum");
|
|
21
21
|
const lending_enum_1 = require("../../../enums/lending.enum");
|
|
22
22
|
const lending_chain_1 = require("./lending-chain");
|
|
23
|
+
const network_1 = require("../../../stellar-lending/network");
|
|
23
24
|
let LendingMarketProfileDoc = class LendingMarketProfileDoc {
|
|
24
25
|
constructor(props) {
|
|
25
26
|
this.dataType = lending_data_type_enum_1.LendingDataType.MARKET_PROFILE;
|
|
@@ -46,9 +47,12 @@ let LendingMarketProfileDoc = class LendingMarketProfileDoc {
|
|
|
46
47
|
this.debtCeilingShort = 0;
|
|
47
48
|
this.chain = common_enum_1.ActivityChain.MVX;
|
|
48
49
|
Object.assign(this, props);
|
|
49
|
-
this.pk = this.dataType;
|
|
50
|
-
this.id = `${this.token}_${this.dataType}`;
|
|
51
50
|
this.chain = (0, lending_chain_1.normalizeLendingChain)(this.chain);
|
|
51
|
+
this.pk =
|
|
52
|
+
this.chain === common_enum_1.ActivityChain.STELLAR
|
|
53
|
+
? (0, network_1.stellarLendingPartitionKey)(this.network, this.dataType)
|
|
54
|
+
: this.dataType;
|
|
55
|
+
this.id = `${this.token}_${this.dataType}`;
|
|
52
56
|
}
|
|
53
57
|
};
|
|
54
58
|
exports.LendingMarketProfileDoc = LendingMarketProfileDoc;
|
|
@@ -313,6 +317,14 @@ __decorate([
|
|
|
313
317
|
}),
|
|
314
318
|
__metadata("design:type", String)
|
|
315
319
|
], LendingMarketProfileDoc.prototype, "chain", void 0);
|
|
320
|
+
__decorate([
|
|
321
|
+
(0, swagger_1.ApiProperty)({
|
|
322
|
+
description: 'Stellar network discriminator; required for Stellar rows',
|
|
323
|
+
required: false,
|
|
324
|
+
enum: ['mainnet', 'testnet'],
|
|
325
|
+
}),
|
|
326
|
+
__metadata("design:type", String)
|
|
327
|
+
], LendingMarketProfileDoc.prototype, "network", void 0);
|
|
316
328
|
__decorate([
|
|
317
329
|
(0, swagger_1.ApiProperty)({
|
|
318
330
|
description: 'Cosmos DB document identifier',
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CosmosDbGenericFilter } from '../../cosmos-db/cosmos-db-generic-filter';
|
|
2
2
|
import { GovernanceProposalKind, GovernanceProposalStatus } from '../../enums/lending-governance.enum';
|
|
3
|
+
import type { StellarNetwork } from '../../stellar-lending/network';
|
|
3
4
|
import { LendingGovernanceProposalDoc } from '../../cosmos-db/documents/lending/lending-governance-proposal.doc';
|
|
4
5
|
export declare class LendingGovernanceProposalFilterCriteriaDto {
|
|
5
6
|
status?: GovernanceProposalStatus[];
|
|
@@ -13,6 +14,8 @@ export declare class LendingGovernanceProposalFilter extends CosmosDbGenericFilt
|
|
|
13
14
|
kind?: GovernanceProposalKind[];
|
|
14
15
|
proposer?: string[];
|
|
15
16
|
assetAddress?: string[];
|
|
17
|
+
/** Server-owned isolation field; API callers must not choose it. */
|
|
18
|
+
network?: StellarNetwork;
|
|
16
19
|
pk?: string;
|
|
17
20
|
};
|
|
18
21
|
includeCount?: boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { RangeFilter, CosmosDbGenericFilter } from '../../cosmos-db/cosmos-db-generic-filter';
|
|
2
2
|
import { LendingMarketProfileDoc } from '../../cosmos-db/documents/lending/lending-market-profile.doc';
|
|
3
3
|
import { ActivityChain } from '../../enums/common.enum';
|
|
4
|
+
import type { StellarNetwork } from '../../stellar-lending/network';
|
|
4
5
|
export declare class LendingMarketProfileFilterCriteriaDto {
|
|
5
6
|
token?: string[];
|
|
6
7
|
range?: RangeFilter<LendingMarketProfileDoc>[];
|
|
@@ -33,6 +34,8 @@ export declare class LendingMarketProfileFilter extends CosmosDbGenericFilter<Le
|
|
|
33
34
|
isDebtCeilingReached?: boolean;
|
|
34
35
|
pk?: string;
|
|
35
36
|
chain?: ActivityChain[];
|
|
37
|
+
/** Server-owned isolation field; API callers must not choose it. */
|
|
38
|
+
network?: StellarNetwork;
|
|
36
39
|
};
|
|
37
40
|
strictSelect?: boolean;
|
|
38
41
|
includeCount?: boolean;
|
|
@@ -69,6 +69,21 @@ export declare class StellarUpdateMarketParamsBatchEvent {
|
|
|
69
69
|
export declare class StellarUpdateMarketStateBatchEvent {
|
|
70
70
|
updates: StellarMarketStateSnapshot[];
|
|
71
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* One account's net position deltas for a transaction.
|
|
74
|
+
*
|
|
75
|
+
* A transaction may emit MORE THAN ONE of these. A share-credit liquidation
|
|
76
|
+
* (`SeizeMode::Credit`) emits exactly two — the liquidated account first, then
|
|
77
|
+
* the liquidator's receiving account — and both precede any `debt:bad_debt`.
|
|
78
|
+
* A transfer-mode liquidation emits exactly one. Consumers must key on
|
|
79
|
+
* `accountId` per event rather than assuming one batch per transaction.
|
|
80
|
+
*
|
|
81
|
+
* The receiver's batch is supply-side only and omits any leg whose net credit
|
|
82
|
+
* rounds to zero. It is also the ONLY announcement of a `Credit(0)`-created
|
|
83
|
+
* account: there is no account-creation event, so an indexer that discovers
|
|
84
|
+
* accounts from a creation event alone will never see it — take the identity
|
|
85
|
+
* from `accountAttributes`.
|
|
86
|
+
*/
|
|
72
87
|
export declare class StellarUpdatePositionBatchEvent {
|
|
73
88
|
accountId: string;
|
|
74
89
|
accountAttributes: StellarEventAccountAttributes;
|
|
@@ -314,6 +314,21 @@ __decorate([
|
|
|
314
314
|
__metadata("design:type", Array)
|
|
315
315
|
], StellarUpdateMarketStateBatchEvent.prototype, "updates", void 0);
|
|
316
316
|
// ---------- topic: position:batch_update ----------
|
|
317
|
+
/**
|
|
318
|
+
* One account's net position deltas for a transaction.
|
|
319
|
+
*
|
|
320
|
+
* A transaction may emit MORE THAN ONE of these. A share-credit liquidation
|
|
321
|
+
* (`SeizeMode::Credit`) emits exactly two — the liquidated account first, then
|
|
322
|
+
* the liquidator's receiving account — and both precede any `debt:bad_debt`.
|
|
323
|
+
* A transfer-mode liquidation emits exactly one. Consumers must key on
|
|
324
|
+
* `accountId` per event rather than assuming one batch per transaction.
|
|
325
|
+
*
|
|
326
|
+
* The receiver's batch is supply-side only and omits any leg whose net credit
|
|
327
|
+
* rounds to zero. It is also the ONLY announcement of a `Credit(0)`-created
|
|
328
|
+
* account: there is no account-creation event, so an indexer that discovers
|
|
329
|
+
* accounts from a creation event alone will never see it — take the identity
|
|
330
|
+
* from `accountAttributes`.
|
|
331
|
+
*/
|
|
317
332
|
class StellarUpdatePositionBatchEvent {
|
|
318
333
|
}
|
|
319
334
|
exports.StellarUpdatePositionBatchEvent = StellarUpdatePositionBatchEvent;
|
|
@@ -616,13 +631,13 @@ __decorate([
|
|
|
616
631
|
], StellarLiquidationEvent.prototype, "accountId", void 0);
|
|
617
632
|
__decorate([
|
|
618
633
|
(0, swagger_1.ApiProperty)({
|
|
619
|
-
description: 'Aggregate debt repaid, USD WAD decimal string',
|
|
634
|
+
description: 'Aggregate debt actually repaid, USD WAD decimal string. Measured receipt — net of refunds and of any shortfall from an under-delivering debt token — so it agrees with the LiqRepay legs of the position batch, not with the liquidator requested payment',
|
|
620
635
|
}),
|
|
621
636
|
__metadata("design:type", String)
|
|
622
637
|
], StellarLiquidationEvent.prototype, "repaidUsdWad", void 0);
|
|
623
638
|
__decorate([
|
|
624
639
|
(0, swagger_1.ApiProperty)({
|
|
625
|
-
description: 'Applied liquidation bonus, bps decimal string;
|
|
640
|
+
description: 'Applied liquidation bonus, bps decimal string; gross seized USD is repaid * (1 + bonus), with the protocol fee still inside that figure',
|
|
626
641
|
}),
|
|
627
642
|
__metadata("design:type", String)
|
|
628
643
|
], StellarLiquidationEvent.prototype, "bonusBps", void 0);
|
|
@@ -50,6 +50,13 @@ export interface StellarReserveDetailItem {
|
|
|
50
50
|
isBorrowable: boolean;
|
|
51
51
|
paused: boolean;
|
|
52
52
|
frozen: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Spoke-asset `no_seize`: the reserve cannot be taken as liquidation
|
|
55
|
+
* collateral. Gates only the seizure leg — supply/borrow/withdraw/repay stay
|
|
56
|
+
* open, so a liquidator must exclude this reserve from expected proceeds or
|
|
57
|
+
* the call reverts (`SpokeError::SpokeAssetSeizureHalted`).
|
|
58
|
+
*/
|
|
59
|
+
noSeize: boolean;
|
|
53
60
|
useAsCollateral: boolean;
|
|
54
61
|
targetHealthFactorWad: string;
|
|
55
62
|
healthFactorForMaxBonusWad: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { StellarLendingDataType } from '../enums';
|
|
2
|
+
import type { StellarNetwork } from '../network';
|
|
2
3
|
/**
|
|
3
4
|
* One position-authorization grant, event-sourced from `account:delegate`.
|
|
4
5
|
*
|
|
@@ -12,6 +13,7 @@ import { StellarLendingDataType } from '../enums';
|
|
|
12
13
|
*/
|
|
13
14
|
export declare class StellarAccountDelegateDoc {
|
|
14
15
|
dataType: StellarLendingDataType;
|
|
16
|
+
network: StellarNetwork;
|
|
15
17
|
/** On-chain numeric account id the delegation applies to. */
|
|
16
18
|
accountId: number;
|
|
17
19
|
/** Wallet that owns the account. */
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StellarAccountDelegateDoc = void 0;
|
|
4
4
|
const enums_1 = require("../enums");
|
|
5
|
+
const network_1 = require("../network");
|
|
5
6
|
/**
|
|
6
7
|
* One position-authorization grant, event-sourced from `account:delegate`.
|
|
7
8
|
*
|
|
@@ -20,7 +21,7 @@ class StellarAccountDelegateDoc {
|
|
|
20
21
|
this.updatedAt = 0;
|
|
21
22
|
this.ledger = 0;
|
|
22
23
|
Object.assign(this, props);
|
|
23
|
-
this.pk = this.dataType;
|
|
24
|
+
this.pk = (0, network_1.stellarLendingPartitionKey)(this.network, this.dataType);
|
|
24
25
|
this.id = `accountDelegate:${this.accountId}:${this.delegate}`;
|
|
25
26
|
}
|
|
26
27
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { StellarLendingDataType } from '../enums';
|
|
2
|
+
import type { StellarNetwork } from '../network';
|
|
2
3
|
export interface StellarInitialPaymentMultiplier {
|
|
3
4
|
initialPaymentAmount: string;
|
|
4
5
|
initialPaymentToken: string;
|
|
@@ -11,6 +12,7 @@ export interface StellarInitialPaymentMultiplier {
|
|
|
11
12
|
*/
|
|
12
13
|
export declare class StellarAccountPositionDoc {
|
|
13
14
|
dataType: StellarLendingDataType;
|
|
15
|
+
network: StellarNetwork;
|
|
14
16
|
accountId: string;
|
|
15
17
|
owner: string;
|
|
16
18
|
spokeId: number;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StellarAccountPositionDoc = void 0;
|
|
4
4
|
const enums_1 = require("../enums");
|
|
5
|
+
const network_1 = require("../network");
|
|
5
6
|
/**
|
|
6
7
|
* One account's position in one reserve (`account:{accountId}:{hubId}:{asset}`).
|
|
7
8
|
* Partitioned by `accountId` so a full account loads single-partition. Entry
|
|
@@ -24,7 +25,7 @@ class StellarAccountPositionDoc {
|
|
|
24
25
|
this.updatedAt = 0;
|
|
25
26
|
this.ledger = 0;
|
|
26
27
|
Object.assign(this, props);
|
|
27
|
-
this.pk = this.accountId;
|
|
28
|
+
this.pk = (0, network_1.stellarLendingPartitionKey)(this.network, this.accountId);
|
|
28
29
|
this.id = `account:${this.accountId}:${this.hubId}:${this.asset}`;
|
|
29
30
|
}
|
|
30
31
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { StellarLendingDataType } from '../enums';
|
|
2
|
+
import type { StellarNetwork } from '../network';
|
|
2
3
|
import type { StellarAssetOracle } from '../oracle-provider';
|
|
3
4
|
export declare class StellarAssetDoc {
|
|
4
5
|
dataType: StellarLendingDataType;
|
|
6
|
+
network: StellarNetwork;
|
|
5
7
|
asset: string;
|
|
6
8
|
symbol: string;
|
|
7
9
|
name: string;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StellarAssetDoc = void 0;
|
|
4
4
|
const enums_1 = require("../enums");
|
|
5
|
+
const network_1 = require("../network");
|
|
5
6
|
class StellarAssetDoc {
|
|
6
7
|
constructor(props) {
|
|
7
8
|
this.dataType = enums_1.StellarLendingDataType.ASSET;
|
|
@@ -15,7 +16,7 @@ class StellarAssetDoc {
|
|
|
15
16
|
this.updatedAt = 0;
|
|
16
17
|
this.ledger = 0;
|
|
17
18
|
Object.assign(this, props);
|
|
18
|
-
this.pk = this.dataType;
|
|
19
|
+
this.pk = (0, network_1.stellarLendingPartitionKey)(this.network, this.dataType);
|
|
19
20
|
this.id = `asset:${this.asset}`;
|
|
20
21
|
}
|
|
21
22
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { StellarLendingDataType } from '../enums';
|
|
2
|
+
import type { StellarNetwork } from '../network';
|
|
2
3
|
/**
|
|
3
4
|
* Approval state for one Blend pool, event-sourced from
|
|
4
5
|
* `config:approve_blend_pool`.
|
|
@@ -10,6 +11,7 @@ import { StellarLendingDataType } from '../enums';
|
|
|
10
11
|
*/
|
|
11
12
|
export declare class StellarBlendPoolDoc {
|
|
12
13
|
dataType: StellarLendingDataType;
|
|
14
|
+
network: StellarNetwork;
|
|
13
15
|
/** Blend pool contract address. Also the `id` suffix. */
|
|
14
16
|
pool: string;
|
|
15
17
|
approved: boolean;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StellarBlendPoolDoc = void 0;
|
|
4
4
|
const enums_1 = require("../enums");
|
|
5
|
+
const network_1 = require("../network");
|
|
5
6
|
/**
|
|
6
7
|
* Approval state for one Blend pool, event-sourced from
|
|
7
8
|
* `config:approve_blend_pool`.
|
|
@@ -18,7 +19,7 @@ class StellarBlendPoolDoc {
|
|
|
18
19
|
this.updatedAt = 0;
|
|
19
20
|
this.ledger = 0;
|
|
20
21
|
Object.assign(this, props);
|
|
21
|
-
this.pk = this.dataType;
|
|
22
|
+
this.pk = (0, network_1.stellarLendingPartitionKey)(this.network, this.dataType);
|
|
22
23
|
this.id = `blendPool:${this.pool}`;
|
|
23
24
|
}
|
|
24
25
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { StellarLendingDataType } from '../enums';
|
|
2
|
+
import type { StellarNetwork } from '../network';
|
|
2
3
|
/**
|
|
3
4
|
* Config and admin state for one deployed contract, event-sourced from that
|
|
4
5
|
* contract's own `config:*`, pause, ownership and admin events.
|
|
@@ -15,6 +16,7 @@ import { StellarLendingDataType } from '../enums';
|
|
|
15
16
|
*/
|
|
16
17
|
export declare class StellarContractConfigDoc {
|
|
17
18
|
dataType: StellarLendingDataType;
|
|
19
|
+
network: StellarNetwork;
|
|
18
20
|
/** Contract this row describes. Also the `id` suffix. */
|
|
19
21
|
contractAddress: string;
|
|
20
22
|
/** Set when the deploy was observed via `governance:deploy_*`. */
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StellarContractConfigDoc = void 0;
|
|
4
4
|
const enums_1 = require("../enums");
|
|
5
|
+
const network_1 = require("../network");
|
|
5
6
|
/**
|
|
6
7
|
* Config and admin state for one deployed contract, event-sourced from that
|
|
7
8
|
* contract's own `config:*`, pause, ownership and admin events.
|
|
@@ -46,7 +47,7 @@ class StellarContractConfigDoc {
|
|
|
46
47
|
this.updatedAt = 0;
|
|
47
48
|
this.ledger = 0;
|
|
48
49
|
Object.assign(this, props);
|
|
49
|
-
this.pk = this.dataType;
|
|
50
|
+
this.pk = (0, network_1.stellarLendingPartitionKey)(this.network, this.dataType);
|
|
50
51
|
this.id = `contractConfig:${this.contractAddress}`;
|
|
51
52
|
}
|
|
52
53
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { StellarLendingDataType } from '../enums';
|
|
2
|
+
import type { StellarNetwork } from '../network';
|
|
2
3
|
/**
|
|
3
4
|
* One access-control grant, event-sourced from `role_granted` / `role_revoked`.
|
|
4
5
|
*
|
|
@@ -14,6 +15,7 @@ import { StellarLendingDataType } from '../enums';
|
|
|
14
15
|
*/
|
|
15
16
|
export declare class StellarContractRoleDoc {
|
|
16
17
|
dataType: StellarLendingDataType;
|
|
18
|
+
network: StellarNetwork;
|
|
17
19
|
/** Contract whose access control this grant belongs to. */
|
|
18
20
|
contractAddress: string;
|
|
19
21
|
/** On-chain role symbol, e.g. `ORACLE`, `PROPOSER`. */
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StellarContractRoleDoc = void 0;
|
|
4
4
|
const enums_1 = require("../enums");
|
|
5
|
+
const network_1 = require("../network");
|
|
5
6
|
/**
|
|
6
7
|
* One access-control grant, event-sourced from `role_granted` / `role_revoked`.
|
|
7
8
|
*
|
|
@@ -24,7 +25,7 @@ class StellarContractRoleDoc {
|
|
|
24
25
|
this.updatedAt = 0;
|
|
25
26
|
this.ledger = 0;
|
|
26
27
|
Object.assign(this, props);
|
|
27
|
-
this.pk = this.dataType;
|
|
28
|
+
this.pk = (0, network_1.stellarLendingPartitionKey)(this.network, this.dataType);
|
|
28
29
|
this.id = `contractRole:${this.contractAddress}:${this.role}:${this.account}`;
|
|
29
30
|
}
|
|
30
31
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { StellarLendingDataType } from '../enums';
|
|
2
|
+
import type { StellarNetwork } from '../network';
|
|
2
3
|
export declare class StellarLendingCursorDoc {
|
|
3
4
|
dataType: StellarLendingDataType;
|
|
5
|
+
network: StellarNetwork;
|
|
4
6
|
lastLedger: number;
|
|
5
7
|
lastPagingToken: string | null;
|
|
6
8
|
/**
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StellarLendingCursorDoc = void 0;
|
|
4
4
|
const enums_1 = require("../enums");
|
|
5
|
+
const network_1 = require("../network");
|
|
5
6
|
class StellarLendingCursorDoc {
|
|
6
7
|
constructor(props) {
|
|
7
8
|
this.dataType = enums_1.StellarLendingDataType.CURSOR;
|
|
@@ -29,7 +30,7 @@ class StellarLendingCursorDoc {
|
|
|
29
30
|
this.indexerVersion = null;
|
|
30
31
|
this.updatedAt = 0;
|
|
31
32
|
Object.assign(this, props);
|
|
32
|
-
this.pk = this.dataType;
|
|
33
|
+
this.pk = (0, network_1.stellarLendingPartitionKey)(this.network, this.dataType);
|
|
33
34
|
this.id = 'cursor:stellar-lending';
|
|
34
35
|
}
|
|
35
36
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { StellarGovernanceProposalKind, StellarGovernanceProposalStatus, StellarGovernanceProposalTarget, StellarLendingDataType } from '../enums';
|
|
2
|
+
import type { StellarNetwork } from '../network';
|
|
2
3
|
/**
|
|
3
4
|
* One decoded "what will change" row for a governance proposal, rendered as a
|
|
4
5
|
* label/value pair by the indexer.
|
|
@@ -16,6 +17,7 @@ export interface StellarGovernanceProposalField {
|
|
|
16
17
|
*/
|
|
17
18
|
export declare class StellarGovernanceProposalDoc {
|
|
18
19
|
dataType: StellarLendingDataType;
|
|
20
|
+
network: StellarNetwork;
|
|
19
21
|
operationId: string;
|
|
20
22
|
kind: StellarGovernanceProposalKind;
|
|
21
23
|
status: StellarGovernanceProposalStatus;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StellarGovernanceProposalDoc = void 0;
|
|
4
4
|
const enums_1 = require("../enums");
|
|
5
|
+
const network_1 = require("../network");
|
|
5
6
|
/**
|
|
6
7
|
* A timelock proposal on the Stellar lending governance contract. Persistence
|
|
7
8
|
* shape (no swagger decorators); api-v2 owns the response DTO.
|
|
@@ -15,7 +16,7 @@ class StellarGovernanceProposalDoc {
|
|
|
15
16
|
this.argsXdr = [];
|
|
16
17
|
this.fields = [];
|
|
17
18
|
Object.assign(this, props);
|
|
18
|
-
this.pk = this.dataType;
|
|
19
|
+
this.pk = (0, network_1.stellarLendingPartitionKey)(this.network, this.dataType);
|
|
19
20
|
this.id = this.operationId;
|
|
20
21
|
}
|
|
21
22
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { StellarLendingDataType } from '../enums';
|
|
2
|
+
import type { StellarNetwork } from '../network';
|
|
2
3
|
/**
|
|
3
4
|
* Liquidity truth for one asset on one hub (`hubAsset:{hubId}:{asset}`). IRM +
|
|
4
5
|
* state + derived APY/utilization are event-sourced from the pool contract.
|
|
@@ -9,6 +10,7 @@ import { StellarLendingDataType } from '../enums';
|
|
|
9
10
|
*/
|
|
10
11
|
export declare class StellarHubAssetDoc {
|
|
11
12
|
dataType: StellarLendingDataType;
|
|
13
|
+
network: StellarNetwork;
|
|
12
14
|
hubId: number;
|
|
13
15
|
asset: string;
|
|
14
16
|
assetDecimals: number;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StellarHubAssetDoc = void 0;
|
|
4
4
|
const enums_1 = require("../enums");
|
|
5
|
+
const network_1 = require("../network");
|
|
5
6
|
/**
|
|
6
7
|
* Liquidity truth for one asset on one hub (`hubAsset:{hubId}:{asset}`). IRM +
|
|
7
8
|
* state + derived APY/utilization are event-sourced from the pool contract.
|
|
@@ -38,7 +39,7 @@ class StellarHubAssetDoc {
|
|
|
38
39
|
this.updatedAt = 0;
|
|
39
40
|
this.ledger = 0;
|
|
40
41
|
Object.assign(this, props);
|
|
41
|
-
this.pk = this.dataType;
|
|
42
|
+
this.pk = (0, network_1.stellarLendingPartitionKey)(this.network, this.dataType);
|
|
42
43
|
this.id = `hubAsset:${this.hubId}:${this.asset}`;
|
|
43
44
|
}
|
|
44
45
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StellarHubDoc = void 0;
|
|
4
4
|
const enums_1 = require("../enums");
|
|
5
|
+
const network_1 = require("../network");
|
|
5
6
|
class StellarHubDoc {
|
|
6
7
|
constructor(props) {
|
|
7
8
|
this.dataType = enums_1.StellarLendingDataType.HUB;
|
|
@@ -11,7 +12,7 @@ class StellarHubDoc {
|
|
|
11
12
|
this.updatedAt = 0;
|
|
12
13
|
this.ledger = 0;
|
|
13
14
|
Object.assign(this, props);
|
|
14
|
-
this.pk = this.dataType;
|
|
15
|
+
this.pk = (0, network_1.stellarLendingPartitionKey)(this.network, this.dataType);
|
|
15
16
|
this.id = `hub:${this.hubId}`;
|
|
16
17
|
}
|
|
17
18
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { StellarLendingDataType } from '../enums';
|
|
2
|
+
import type { StellarNetwork } from '../network';
|
|
2
3
|
/**
|
|
3
4
|
* Risk truth for one asset in one spoke on one hub
|
|
4
5
|
* (`spokeAsset:{spokeId}:{hubId}:{asset}`). LTV, liquidation params, flags, and
|
|
@@ -8,6 +9,7 @@ import { StellarLendingDataType } from '../enums';
|
|
|
8
9
|
*/
|
|
9
10
|
export declare class StellarSpokeAssetDoc {
|
|
10
11
|
dataType: StellarLendingDataType;
|
|
12
|
+
network: StellarNetwork;
|
|
11
13
|
spokeId: number;
|
|
12
14
|
hubId: number;
|
|
13
15
|
asset: string;
|
|
@@ -15,6 +17,14 @@ export declare class StellarSpokeAssetDoc {
|
|
|
15
17
|
isBorrowable: boolean;
|
|
16
18
|
paused: boolean;
|
|
17
19
|
frozen: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* On-chain `SpokeAssetConfig.no_seize`. Gates ONLY the liquidation seizure
|
|
22
|
+
* leg — the asset stays fully usable for supply/borrow/withdraw/repay.
|
|
23
|
+
* Independent of `paused` (blocks every user verb) and `frozen` (blocks new
|
|
24
|
+
* exposure, permits exits); seizure is deliberately not gated by `paused`
|
|
25
|
+
* because it is pro-rata across the whole collateral set.
|
|
26
|
+
*/
|
|
27
|
+
noSeize: boolean;
|
|
18
28
|
loanToValueBps: number;
|
|
19
29
|
liquidationThresholdBps: number;
|
|
20
30
|
liquidationBonusBps: number;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StellarSpokeAssetDoc = void 0;
|
|
4
4
|
const enums_1 = require("../enums");
|
|
5
|
+
const network_1 = require("../network");
|
|
5
6
|
/**
|
|
6
7
|
* Risk truth for one asset in one spoke on one hub
|
|
7
8
|
* (`spokeAsset:{spokeId}:{hubId}:{asset}`). LTV, liquidation params, flags, and
|
|
@@ -16,6 +17,14 @@ class StellarSpokeAssetDoc {
|
|
|
16
17
|
this.isBorrowable = false;
|
|
17
18
|
this.paused = false;
|
|
18
19
|
this.frozen = false;
|
|
20
|
+
/**
|
|
21
|
+
* On-chain `SpokeAssetConfig.no_seize`. Gates ONLY the liquidation seizure
|
|
22
|
+
* leg — the asset stays fully usable for supply/borrow/withdraw/repay.
|
|
23
|
+
* Independent of `paused` (blocks every user verb) and `frozen` (blocks new
|
|
24
|
+
* exposure, permits exits); seizure is deliberately not gated by `paused`
|
|
25
|
+
* because it is pro-rata across the whole collateral set.
|
|
26
|
+
*/
|
|
27
|
+
this.noSeize = false;
|
|
19
28
|
this.loanToValueBps = 0;
|
|
20
29
|
this.liquidationThresholdBps = 0;
|
|
21
30
|
this.liquidationBonusBps = 0;
|
|
@@ -29,7 +38,7 @@ class StellarSpokeAssetDoc {
|
|
|
29
38
|
this.updatedAt = 0;
|
|
30
39
|
this.ledger = 0;
|
|
31
40
|
Object.assign(this, props);
|
|
32
|
-
this.pk = this.dataType;
|
|
41
|
+
this.pk = (0, network_1.stellarLendingPartitionKey)(this.network, this.dataType);
|
|
33
42
|
this.id = `spokeAsset:${this.spokeId}:${this.hubId}:${this.asset}`;
|
|
34
43
|
}
|
|
35
44
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { StellarLendingDataType } from '../enums';
|
|
2
|
+
import type { StellarNetwork } from '../network';
|
|
2
3
|
export declare class StellarSpokeDoc {
|
|
3
4
|
dataType: StellarLendingDataType;
|
|
5
|
+
network: StellarNetwork;
|
|
4
6
|
spokeId: number;
|
|
5
7
|
isDeprecated: boolean;
|
|
6
8
|
name: string | null;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StellarSpokeDoc = void 0;
|
|
4
4
|
const enums_1 = require("../enums");
|
|
5
|
+
const network_1 = require("../network");
|
|
5
6
|
class StellarSpokeDoc {
|
|
6
7
|
constructor(props) {
|
|
7
8
|
this.dataType = enums_1.StellarLendingDataType.SPOKE;
|
|
@@ -15,7 +16,7 @@ class StellarSpokeDoc {
|
|
|
15
16
|
this.updatedAt = 0;
|
|
16
17
|
this.ledger = 0;
|
|
17
18
|
Object.assign(this, props);
|
|
18
|
-
this.pk = this.dataType;
|
|
19
|
+
this.pk = (0, network_1.stellarLendingPartitionKey)(this.network, this.dataType);
|
|
19
20
|
this.id = `spoke:${this.spokeId}`;
|
|
20
21
|
}
|
|
21
22
|
}
|
|
@@ -13,6 +13,19 @@ export declare enum StellarLendingActivity {
|
|
|
13
13
|
RepayWithCollateral = "repayWithCollateral",
|
|
14
14
|
CloseWithdraw = "closeWithdraw",
|
|
15
15
|
Migrate = "migrate",
|
|
16
|
+
/**
|
|
17
|
+
* On-chain `PositionAction::LiqCredit` (15) — the collateral credited to a
|
|
18
|
+
* share-credit liquidator's receiving account. Emitted only under
|
|
19
|
+
* `SeizeMode::Credit`, on the second (receiver) position batch.
|
|
20
|
+
*
|
|
21
|
+
* Gross vs net, and the reason this is a separate tag from `LiqSeize`:
|
|
22
|
+
* `liqSeize` is the liquidated account's debit, **gross** of the protocol fee
|
|
23
|
+
* (in both seize modes); `liqCredit` is the receiver's credit, **net** of it.
|
|
24
|
+
* The fee is `liqSeize.amount - liqCredit.amount`. Summing both tags as one
|
|
25
|
+
* quantity double-counts the seizure, and reading the gross `liqSeize` figure
|
|
26
|
+
* as liquidator proceeds overstates them by the fee.
|
|
27
|
+
*/
|
|
28
|
+
LiqCredit = "liqCredit",
|
|
16
29
|
FlashLoan = "flashLoan",
|
|
17
30
|
BadDebt = "badDebt",
|
|
18
31
|
StrategyFee = "strategyFee",
|
|
@@ -17,6 +17,19 @@ var StellarLendingActivity;
|
|
|
17
17
|
StellarLendingActivity["RepayWithCollateral"] = "repayWithCollateral";
|
|
18
18
|
StellarLendingActivity["CloseWithdraw"] = "closeWithdraw";
|
|
19
19
|
StellarLendingActivity["Migrate"] = "migrate";
|
|
20
|
+
/**
|
|
21
|
+
* On-chain `PositionAction::LiqCredit` (15) — the collateral credited to a
|
|
22
|
+
* share-credit liquidator's receiving account. Emitted only under
|
|
23
|
+
* `SeizeMode::Credit`, on the second (receiver) position batch.
|
|
24
|
+
*
|
|
25
|
+
* Gross vs net, and the reason this is a separate tag from `LiqSeize`:
|
|
26
|
+
* `liqSeize` is the liquidated account's debit, **gross** of the protocol fee
|
|
27
|
+
* (in both seize modes); `liqCredit` is the receiver's credit, **net** of it.
|
|
28
|
+
* The fee is `liqSeize.amount - liqCredit.amount`. Summing both tags as one
|
|
29
|
+
* quantity double-counts the seizure, and reading the gross `liqSeize` figure
|
|
30
|
+
* as liquidator proceeds overstates them by the fee.
|
|
31
|
+
*/
|
|
32
|
+
StellarLendingActivity["LiqCredit"] = "liqCredit";
|
|
20
33
|
StellarLendingActivity["FlashLoan"] = "flashLoan";
|
|
21
34
|
StellarLendingActivity["BadDebt"] = "badDebt";
|
|
22
35
|
StellarLendingActivity["StrategyFee"] = "strategyFee";
|
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./enums"), exports);
|
|
18
|
+
__exportStar(require("./network"), exports);
|
|
18
19
|
__exportStar(require("./oracle-provider"), exports);
|
|
19
20
|
__exportStar(require("./documents"), exports);
|
|
20
21
|
__exportStar(require("./list"), exports);
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { StellarLendingActivity } from '../enums';
|
|
2
|
+
import type { StellarNetwork } from '../network';
|
|
2
3
|
/**
|
|
3
4
|
* Dynamic JSON written into the existing `NftActivityData.ActivityData` column
|
|
4
5
|
* for Stellar-lending activity (`Source='xoxnoLending'`, `Chain='STELLAR'`).
|
|
5
6
|
* Not a Cosmos document — rides the existing activity → Kusto change-feed.
|
|
6
7
|
*/
|
|
7
8
|
export interface StellarLendingActivityData {
|
|
9
|
+
network: StellarNetwork;
|
|
8
10
|
action: StellarLendingActivity;
|
|
9
11
|
hubId: number;
|
|
10
12
|
spokeId: number | null;
|
|
@@ -12,7 +14,14 @@ export interface StellarLendingActivityData {
|
|
|
12
14
|
accountId: string | null;
|
|
13
15
|
owner: string | null;
|
|
14
16
|
token: string;
|
|
15
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* Action delta amount (this tx), big-int string.
|
|
19
|
+
*
|
|
20
|
+
* Liquidation caveat: a share-credit liquidation emits BOTH a `liqSeize` leg
|
|
21
|
+
* on the liquidated account (gross of the protocol fee) and a `liqCredit` leg
|
|
22
|
+
* on the receiving account (net of it) for the same seizure. Summing the two
|
|
23
|
+
* tags double-counts it — pick one side per query.
|
|
24
|
+
*/
|
|
16
25
|
amount: string;
|
|
17
26
|
/**
|
|
18
27
|
* Display-unit delta. `null` when the asset header decimals are not yet
|
|
@@ -75,21 +84,32 @@ export interface StellarLendingActivityData {
|
|
|
75
84
|
loanToValueBps: number | null;
|
|
76
85
|
liquidationFeesBps: number | null;
|
|
77
86
|
/**
|
|
78
|
-
* Liquidator (caller) address on liquidation legs
|
|
79
|
-
* correlated by tx from the on-chain
|
|
80
|
-
* rows. Enables a top-liquidators
|
|
81
|
-
*
|
|
87
|
+
* Liquidator (caller) address on liquidation legs
|
|
88
|
+
* (`liqRepay`/`liqSeize`/`liqCredit`), correlated by tx from the on-chain
|
|
89
|
+
* `LiquidationEvent`. `null` on all other rows. Enables a top-liquidators
|
|
90
|
+
* leaderboard.
|
|
91
|
+
*
|
|
92
|
+
* Whose account the leg belongs to differs by tag: on `liqRepay`/`liqSeize`
|
|
93
|
+
* the `accountId`/`owner` are the liquidatee, on `liqCredit` they are the
|
|
94
|
+
* liquidator's own receiving account (share-credit mode). Do not treat
|
|
95
|
+
* `owner` as the liquidatee without filtering the tag.
|
|
82
96
|
*/
|
|
83
97
|
liquidator: string | null;
|
|
84
98
|
/**
|
|
85
99
|
* Aggregate debt repaid (USD WAD string) from `position:liquidation`, stamped
|
|
86
|
-
* onto same-tx `liqRepay`/`liqSeize` legs. `null` on
|
|
100
|
+
* onto same-tx `liqRepay`/`liqSeize`/`liqCredit` legs. `null` on
|
|
101
|
+
* non-liquidation rows.
|
|
102
|
+
*
|
|
103
|
+
* This is the MEASURED receipt — net of refunds and of any shortfall from an
|
|
104
|
+
* under-delivering debt token — so it agrees with the `liqRepay` legs, not
|
|
105
|
+
* with the liquidator's requested payment.
|
|
87
106
|
*/
|
|
88
107
|
repaidUsdWad?: string | null;
|
|
89
108
|
/**
|
|
90
109
|
* Applied liquidation bonus (bps string) from `position:liquidation`, stamped
|
|
91
|
-
* onto same-tx `liqRepay`/`liqSeize` legs.
|
|
92
|
-
* repaid * (1 + bonus / 10_000)
|
|
110
|
+
* onto same-tx `liqRepay`/`liqSeize`/`liqCredit` legs. Gross seized USD ≈
|
|
111
|
+
* repaid * (1 + bonus / 10_000) — the protocol fee is still inside that
|
|
112
|
+
* figure. `null` on non-liquidation rows.
|
|
93
113
|
*/
|
|
94
114
|
bonusBps?: string | null;
|
|
95
115
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { StellarNetwork } from '../network';
|
|
1
2
|
/**
|
|
2
3
|
* ActivityType for Stellar-lending market-state activity rows. Deliberately
|
|
3
4
|
* DISTINCT from the MVX `lendingUpdateMarketState` so the existing MVX Kusto
|
|
@@ -16,6 +17,7 @@ export declare const STELLAR_LENDING_MARKET_STATE_ACTIVITY = "stellarLendingUpda
|
|
|
16
17
|
* 27-dec RAY big-int strings.
|
|
17
18
|
*/
|
|
18
19
|
export interface StellarLendingMarketStateData {
|
|
20
|
+
network: StellarNetwork;
|
|
19
21
|
hubId: number;
|
|
20
22
|
spokeId: number | null;
|
|
21
23
|
token: string;
|
|
@@ -76,6 +76,8 @@ export interface StellarAssetPageMarket {
|
|
|
76
76
|
isBorrowable: boolean;
|
|
77
77
|
paused: boolean;
|
|
78
78
|
frozen: boolean;
|
|
79
|
+
/** Spoke-asset `no_seize`: cannot be taken as liquidation collateral. */
|
|
80
|
+
noSeize: boolean;
|
|
79
81
|
supplyCapShort: number;
|
|
80
82
|
borrowCapShort: number;
|
|
81
83
|
depositCapFilledPct: number;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Stellar network persisted on every lending document and activity payload. */
|
|
2
|
+
export type StellarNetwork = 'mainnet' | 'testnet';
|
|
3
|
+
/** Scope a shared Cosmos partition to one Stellar network. */
|
|
4
|
+
export declare function stellarLendingPartitionKey(network: StellarNetwork, key: string | number): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stellarLendingPartitionKey = stellarLendingPartitionKey;
|
|
4
|
+
/** Scope a shared Cosmos partition to one Stellar network. */
|
|
5
|
+
function stellarLendingPartitionKey(network, key) {
|
|
6
|
+
if (network !== 'mainnet' && network !== 'testnet') {
|
|
7
|
+
throw new Error('Invalid Stellar network');
|
|
8
|
+
}
|
|
9
|
+
return `${network}:${key}`;
|
|
10
|
+
}
|