@xoxno/types 1.0.446 → 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.
- package/dist/cache/cache-keys.d.ts +15 -0
- package/dist/cache/cache-keys.js +65 -0
- package/dist/stellar-lending/api-dto.d.ts +3 -11
- package/dist/stellar-lending/context.d.ts +28 -0
- package/dist/stellar-lending/context.js +6 -0
- package/dist/stellar-lending/index.d.ts +1 -0
- package/dist/stellar-lending/index.js +1 -0
- package/package.json +1 -1
|
@@ -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;
|
package/dist/cache/cache-keys.js
CHANGED
|
@@ -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
|
|
@@ -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
|
|
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;
|
|
@@ -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);
|