@xoxno/types 1.0.445 → 1.0.448

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.
@@ -102,6 +102,21 @@ export declare const CacheKeys: {
102
102
  LendingMarketAverageGraphData: (token: string) => CacheKeyConfig;
103
103
  LendingMarketQuery: (filterHash: string) => CacheKeyConfig;
104
104
  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;
105
120
  HatomUserInfo: (address: string) => CacheKeyConfig;
106
121
  UserUnreadNotificationCount: (address: string) => CacheKeyConfig;
107
122
  EventProfileDoc: (eventId: string) => CacheKeyConfig;
@@ -8,6 +8,11 @@ const ttl_1 = require("./ttl");
8
8
  function serializeChain(chain) {
9
9
  return (chain ?? []).sort().join(',');
10
10
  }
11
+ function serializeStellarFilter(value) {
12
+ return value === undefined || value === null || value === ''
13
+ ? ''
14
+ : `${value}`;
15
+ }
11
16
  /**
12
17
  * Cache key generators for commonly used patterns.
13
18
  * These ensure consistent key formats across repositories.
@@ -378,6 +383,66 @@ exports.CacheKeys = {
378
383
  key: `user:${address}:lending:positions${token ? `:${token}` : ''}`,
379
384
  ttl: ttl_1.TTLS.ONE_MINUTE / 2, // 30 seconds
380
385
  }),
386
+ StellarLendingContext: () => ({
387
+ key: 'sl:context',
388
+ ttl: ttl_1.TTLS.ONE_MINUTE / 2,
389
+ }),
390
+ StellarLendingAssetsList: () => ({
391
+ key: 'sl:list:assets',
392
+ ttl: ttl_1.TTLS.ONE_MINUTE / 2,
393
+ }),
394
+ StellarLendingHubsList: () => ({
395
+ key: 'sl:list:hubs',
396
+ ttl: ttl_1.TTLS.ONE_MINUTE / 2,
397
+ }),
398
+ StellarLendingSpokesList: () => ({
399
+ key: 'sl:list:spokes',
400
+ ttl: ttl_1.TTLS.ONE_MINUTE / 2,
401
+ }),
402
+ StellarLendingReservesList: (hubId, spokeId, asset) => ({
403
+ key: `sl:list:reserves:${serializeStellarFilter(hubId)}:${serializeStellarFilter(spokeId)}:${serializeStellarFilter(asset)}`,
404
+ ttl: ttl_1.TTLS.ONE_MINUTE / 2,
405
+ }),
406
+ StellarLendingReserve: (spokeId, hubId, asset) => ({
407
+ key: `sl:reserve:${spokeId}:${hubId}:${asset}`,
408
+ ttl: ttl_1.TTLS.ONE_MINUTE / 2,
409
+ }),
410
+ StellarLendingAsset: (asset) => ({
411
+ key: `sl:asset:${asset}`,
412
+ ttl: ttl_1.TTLS.ONE_MINUTE / 2,
413
+ }),
414
+ StellarLendingAssetPageBase: (asset) => ({
415
+ key: `sl:asset-page-base:${asset}`,
416
+ ttl: ttl_1.TTLS.ONE_MINUTE / 2,
417
+ }),
418
+ StellarLendingAssetMarkets: (asset, side) => ({
419
+ key: `sl:asset-markets:${asset}:${side}`,
420
+ ttl: ttl_1.TTLS.ONE_MINUTE / 2,
421
+ }),
422
+ StellarLendingHub: (hubId) => ({
423
+ key: `sl:hub:${hubId}`,
424
+ ttl: ttl_1.TTLS.ONE_MINUTE / 2,
425
+ }),
426
+ StellarLendingSpoke: (spokeId) => ({
427
+ key: `sl:spoke:${spokeId}`,
428
+ ttl: ttl_1.TTLS.ONE_MINUTE / 2,
429
+ }),
430
+ StellarLendingUserPositions: (owner) => ({
431
+ key: `sl:user-positions:${owner}`,
432
+ ttl: ttl_1.TTLS.ONE_MINUTE / 2,
433
+ }),
434
+ StellarLendingAccountPositions: (accountId) => ({
435
+ key: `sl:account-positions:${accountId}`,
436
+ ttl: ttl_1.TTLS.ONE_MINUTE / 2,
437
+ }),
438
+ StellarLendingGovernanceProposals: (top, continuationToken) => ({
439
+ key: `sl:gov-proposals:${top}:${continuationToken ?? ''}`,
440
+ ttl: ttl_1.TTLS.ONE_MINUTE / 2,
441
+ }),
442
+ StellarLendingLiveIndexes: (hash) => ({
443
+ key: `sl:live-indexes:${hash}`,
444
+ ttl: ttl_1.TTLS.ONE_SECOND * 3,
445
+ }),
381
446
  HatomUserInfo: (address) => ({
382
447
  key: `hatom:user:${address}:info`,
383
448
  ttl: ttl_1.TTLS.ONE_MINUTE / 2, // 30 seconds
@@ -31,6 +31,9 @@ export declare class BlendLegMigratability {
31
31
  export declare class BlendUserPosition {
32
32
  address: string;
33
33
  blendPool: string;
34
+ migrationAccountId: string;
35
+ migrationSpokeId: number;
36
+ migrationHubId: number;
34
37
  collateral: BlendLeg[];
35
38
  supply: BlendLeg[];
36
39
  debt: BlendLeg[];
@@ -47,7 +50,8 @@ export declare class BlendDebtCap {
47
50
  export declare class MigrateFromBlendArgs {
48
51
  blendPool: string;
49
52
  accountId: string;
50
- eModeCategory: number;
53
+ spokeId: number;
54
+ hubId: number;
51
55
  collateralTokens: string[];
52
56
  supplyTokens: string[];
53
57
  debtCaps: BlendDebtCap[];
@@ -87,6 +87,21 @@ __decorate([
87
87
  (0, swagger_1.ApiProperty)({ description: 'Blend pool contract address' }),
88
88
  __metadata("design:type", String)
89
89
  ], BlendUserPosition.prototype, "blendPool", void 0);
90
+ __decorate([
91
+ (0, swagger_1.ApiProperty)({
92
+ description: 'Existing XOXNO account id, or "0" create new account',
93
+ example: '0',
94
+ }),
95
+ __metadata("design:type", String)
96
+ ], BlendUserPosition.prototype, "migrationAccountId", void 0);
97
+ __decorate([
98
+ (0, swagger_1.ApiProperty)({ description: 'Selected XOXNO spoke id', example: 1 }),
99
+ __metadata("design:type", Number)
100
+ ], BlendUserPosition.prototype, "migrationSpokeId", void 0);
101
+ __decorate([
102
+ (0, swagger_1.ApiProperty)({ description: 'Selected XOXNO hub id', example: 1 }),
103
+ __metadata("design:type", Number)
104
+ ], BlendUserPosition.prototype, "migrationHubId", void 0);
90
105
  __decorate([
91
106
  (0, swagger_1.ApiProperty)({ type: () => BlendLeg, isArray: true }),
92
107
  __metadata("design:type", Array)
@@ -144,9 +159,13 @@ __decorate([
144
159
  __metadata("design:type", String)
145
160
  ], MigrateFromBlendArgs.prototype, "accountId", void 0);
146
161
  __decorate([
147
- (0, swagger_1.ApiProperty)({ description: 'eMode category to enter (0 = none)', example: 0 }),
162
+ (0, swagger_1.ApiProperty)({ description: 'Selected XOXNO spoke id', example: 1 }),
163
+ __metadata("design:type", Number)
164
+ ], MigrateFromBlendArgs.prototype, "spokeId", void 0);
165
+ __decorate([
166
+ (0, swagger_1.ApiProperty)({ description: 'Selected XOXNO hub id', example: 1 }),
148
167
  __metadata("design:type", Number)
149
- ], MigrateFromBlendArgs.prototype, "eModeCategory", void 0);
168
+ ], MigrateFromBlendArgs.prototype, "hubId", void 0);
150
169
  __decorate([
151
170
  (0, swagger_1.ApiProperty)({
152
171
  description: 'Collateral assets to withdraw from Blend and re-collateralize',
@@ -1,22 +1,14 @@
1
+ import type { StellarLendingContextDto, StellarReserveDetailItem } from './context';
1
2
  import type { StellarAssetListItem, StellarAssetPage, StellarAssetPageMarket, StellarHubListItem, StellarReserveListItem, StellarSpokeListItem, StellarUserActivityItem } from './list';
2
3
  export type StellarAssetListItemDto = StellarAssetListItem;
3
4
  export type StellarHubListItemDto = StellarHubListItem;
4
5
  export type StellarSpokeListItemDto = StellarSpokeListItem;
5
6
  export type StellarReserveListItemDto = StellarReserveListItem;
7
+ export type StellarLendingReadContextDto = StellarLendingContextDto;
6
8
  export type AssetDto = Omit<StellarAssetPage, 'depositMarkets' | 'borrowMarkets' | 'graphSeries'>;
7
9
  export type AssetPageDto = StellarAssetPage;
8
10
  export type AssetMarketDto = StellarAssetPageMarket;
9
- export interface ReserveDto extends StellarAssetPageMarket {
10
- supplyCapShort: number;
11
- borrowCapShort: number;
12
- isFlashloanable: boolean;
13
- flashloanFeeBps: number;
14
- liquidationPenaltyBps: number;
15
- liquidationFeesBps: number;
16
- useAsCollateral: boolean;
17
- targetHealthFactorWad: string;
18
- healthFactorForMaxBonusWad: string;
19
- liquidationBonusFactorBps: number;
11
+ export interface ReserveDto extends StellarReserveDetailItem {
20
12
  }
21
13
  export interface HubDto {
22
14
  hubId: number;
@@ -0,0 +1,28 @@
1
+ import type { StellarAssetListItem, StellarAssetPageMarket, StellarHubListItem, StellarReserveListItem, StellarSpokeListItem } from './list';
2
+ export type StellarReserveKey = `${number}:${number}:${string}`;
3
+ export interface StellarReserveKeyInput {
4
+ spokeId: number;
5
+ hubId: number;
6
+ asset: string;
7
+ }
8
+ export interface StellarReserveDetailItem extends StellarAssetPageMarket {
9
+ supplyCapShort: number;
10
+ borrowCapShort: number;
11
+ isFlashloanable: boolean;
12
+ flashloanFeeBps: number;
13
+ liquidationPenaltyBps: number;
14
+ liquidationFeesBps: number;
15
+ useAsCollateral: boolean;
16
+ targetHealthFactorWad: string;
17
+ healthFactorForMaxBonusWad: string;
18
+ liquidationBonusFactorBps: number;
19
+ }
20
+ export interface StellarLendingContext {
21
+ assets: StellarAssetListItem[];
22
+ hubs: StellarHubListItem[];
23
+ spokes: StellarSpokeListItem[];
24
+ reserves: StellarReserveListItem[];
25
+ reserveDetailsByKey: Record<string, StellarReserveDetailItem | null>;
26
+ }
27
+ export type StellarLendingContextDto = StellarLendingContext;
28
+ export declare function stellarReserveKey({ spokeId, hubId, asset, }: StellarReserveKeyInput): StellarReserveKey;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.stellarReserveKey = stellarReserveKey;
4
+ function stellarReserveKey({ spokeId, hubId, asset, }) {
5
+ return `${spokeId}:${hubId}:${asset}`;
6
+ }
@@ -2,5 +2,6 @@ export * from './enums';
2
2
  export * from './oracle-provider';
3
3
  export * from './documents';
4
4
  export * from './list';
5
+ export * from './context';
5
6
  export * from './api-dto';
6
7
  export * from './kusto';
@@ -18,5 +18,6 @@ __exportStar(require("./enums"), exports);
18
18
  __exportStar(require("./oracle-provider"), exports);
19
19
  __exportStar(require("./documents"), exports);
20
20
  __exportStar(require("./list"), exports);
21
+ __exportStar(require("./context"), exports);
21
22
  __exportStar(require("./api-dto"), exports);
22
23
  __exportStar(require("./kusto"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xoxno/types",
3
- "version": "1.0.445",
3
+ "version": "1.0.448",
4
4
  "description": "Shared types and utilities for XOXNO API.",
5
5
  "exports": {
6
6
  ".": {