@xoxno/types 1.0.383 → 1.0.384
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/cosmos-db/documents/lending/lending-account-pnl.d.ts +2 -0
- package/dist/cosmos-db/documents/lending/lending-account-pnl.js +13 -0
- package/dist/cosmos-db/documents/lending/lending-account-profile.d.ts +2 -0
- package/dist/cosmos-db/documents/lending/lending-account-profile.js +13 -0
- package/dist/cosmos-db/documents/lending/lending-account-summary.d.ts +2 -0
- package/dist/cosmos-db/documents/lending/lending-account-summary.js +13 -0
- package/dist/cosmos-db/documents/lending/lending-chain.d.ts +18 -0
- package/dist/cosmos-db/documents/lending/lending-chain.js +26 -0
- package/dist/cosmos-db/documents/lending/lending-emode-category-profile.doc.d.ts +2 -0
- package/dist/cosmos-db/documents/lending/lending-emode-category-profile.doc.js +13 -0
- 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 +13 -0
- package/dist/cosmos-db/documents/lending/lending-nft-attributes.d.ts +2 -0
- package/dist/cosmos-db/documents/lending/lending-nft-attributes.js +13 -0
- package/dist/cosmos-db/documents/lending/lending-token-emode-profile.doc.d.ts +2 -0
- package/dist/cosmos-db/documents/lending/lending-token-emode-profile.doc.js +13 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/requests/lending/lending-indexes.dto.d.ts +2 -0
- package/dist/requests/lending/lending-indexes.dto.js +10 -0
- package/dist/requests/lending/lending-market-profile.filter.d.ts +3 -0
- package/dist/requests/lending/lending-market-profile.filter.js +10 -0
- package/dist/requests/lending/stellar-lending-args.dto.d.ts +88 -0
- package/dist/requests/lending/stellar-lending-args.dto.js +351 -0
- package/package.json +3 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ActivityChain } from '../../../enums/common.enum';
|
|
1
2
|
export declare class LendingAccountPnl {
|
|
2
3
|
Token: string;
|
|
3
4
|
Identifier: string;
|
|
@@ -7,5 +8,6 @@ export declare class LendingAccountPnl {
|
|
|
7
8
|
DebtUSD: number;
|
|
8
9
|
Interest: number;
|
|
9
10
|
InterestUSD: number;
|
|
11
|
+
chain: ActivityChain;
|
|
10
12
|
constructor(props?: Partial<LendingAccountPnl>);
|
|
11
13
|
}
|
|
@@ -11,9 +11,13 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.LendingAccountPnl = void 0;
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const common_enum_1 = require("../../../enums/common.enum");
|
|
15
|
+
const lending_chain_1 = require("./lending-chain");
|
|
14
16
|
class LendingAccountPnl {
|
|
15
17
|
constructor(props) {
|
|
18
|
+
this.chain = common_enum_1.ActivityChain.MVX;
|
|
16
19
|
Object.assign(this, props);
|
|
20
|
+
this.chain = (0, lending_chain_1.normalizeLendingChain)(this.chain);
|
|
17
21
|
}
|
|
18
22
|
}
|
|
19
23
|
exports.LendingAccountPnl = LendingAccountPnl;
|
|
@@ -49,3 +53,12 @@ __decorate([
|
|
|
49
53
|
(0, swagger_1.ApiProperty)(),
|
|
50
54
|
__metadata("design:type", Number)
|
|
51
55
|
], LendingAccountPnl.prototype, "InterestUSD", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, swagger_1.ApiProperty)({
|
|
58
|
+
description: 'Blockchain network this PnL entry belongs to',
|
|
59
|
+
required: false,
|
|
60
|
+
enum: common_enum_1.ActivityChain,
|
|
61
|
+
example: common_enum_1.ActivityChain.MVX,
|
|
62
|
+
}),
|
|
63
|
+
__metadata("design:type", String)
|
|
64
|
+
], LendingAccountPnl.prototype, "chain", void 0);
|
|
@@ -2,6 +2,7 @@ import { LendingDataType } from '../../../enums/lending-data-type.enum';
|
|
|
2
2
|
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
|
+
import { ActivityChain } from '../../../enums/common.enum';
|
|
5
6
|
export declare class InitialPaymentMultiplier {
|
|
6
7
|
initialPaymentAmount: string;
|
|
7
8
|
initialPaymentToken: string;
|
|
@@ -24,6 +25,7 @@ export declare class LendingAccountProfileDoc {
|
|
|
24
25
|
address: string;
|
|
25
26
|
initialPaymentMultiplier?: InitialPaymentMultiplier;
|
|
26
27
|
isClassic?: boolean;
|
|
28
|
+
chain: ActivityChain;
|
|
27
29
|
id: string;
|
|
28
30
|
pk: string;
|
|
29
31
|
_ts: number;
|
|
@@ -15,6 +15,8 @@ const lending_data_type_enum_1 = require("../../../enums/lending-data-type.enum"
|
|
|
15
15
|
const lending_enum_1 = require("../../../enums/lending.enum");
|
|
16
16
|
const lending_emode_category_profile_doc_1 = require("./lending-emode-category-profile.doc");
|
|
17
17
|
const lending_market_profile_doc_1 = require("./lending-market-profile.doc");
|
|
18
|
+
const common_enum_1 = require("../../../enums/common.enum");
|
|
19
|
+
const lending_chain_1 = require("./lending-chain");
|
|
18
20
|
class InitialPaymentMultiplier {
|
|
19
21
|
}
|
|
20
22
|
exports.InitialPaymentMultiplier = InitialPaymentMultiplier;
|
|
@@ -44,9 +46,11 @@ class LendingAccountProfileDoc {
|
|
|
44
46
|
this.dataType = lending_data_type_enum_1.LendingDataType.ACCOUNT_PROFILE;
|
|
45
47
|
this.supplyAmountScaled = '0';
|
|
46
48
|
this.borrowAmountScaled = '0';
|
|
49
|
+
this.chain = common_enum_1.ActivityChain.MVX;
|
|
47
50
|
Object.assign(this, props);
|
|
48
51
|
this.pk = this.dataType;
|
|
49
52
|
this.id = `${this.identifier}_${this.token}`;
|
|
53
|
+
this.chain = (0, lending_chain_1.normalizeLendingChain)(this.chain);
|
|
50
54
|
}
|
|
51
55
|
}
|
|
52
56
|
exports.LendingAccountProfileDoc = LendingAccountProfileDoc;
|
|
@@ -165,6 +169,15 @@ __decorate([
|
|
|
165
169
|
(0, swagger_1.ApiProperty)(),
|
|
166
170
|
__metadata("design:type", Boolean)
|
|
167
171
|
], LendingAccountProfileDoc.prototype, "isClassic", void 0);
|
|
172
|
+
__decorate([
|
|
173
|
+
(0, swagger_1.ApiProperty)({
|
|
174
|
+
description: 'Blockchain network the account lives on',
|
|
175
|
+
required: false,
|
|
176
|
+
enum: common_enum_1.ActivityChain,
|
|
177
|
+
example: common_enum_1.ActivityChain.MVX,
|
|
178
|
+
}),
|
|
179
|
+
__metadata("design:type", String)
|
|
180
|
+
], LendingAccountProfileDoc.prototype, "chain", void 0);
|
|
168
181
|
__decorate([
|
|
169
182
|
(0, swagger_1.ApiProperty)({
|
|
170
183
|
description: 'Cosmos DB document identifier',
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ActivityChain } from '../../../enums/common.enum';
|
|
1
2
|
export declare class SingleLendingAccountToken {
|
|
2
3
|
amount: string;
|
|
3
4
|
amountShort: number;
|
|
@@ -18,4 +19,5 @@ export declare class LendingAccountSummary {
|
|
|
18
19
|
borrowedInEgld: string;
|
|
19
20
|
totalApy: string;
|
|
20
21
|
healthFactor: string;
|
|
22
|
+
chain: ActivityChain;
|
|
21
23
|
}
|
|
@@ -11,6 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.LendingAccountSummary = exports.SingleLendingAccountToken = void 0;
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const common_enum_1 = require("../../../enums/common.enum");
|
|
14
15
|
class SingleLendingAccountToken {
|
|
15
16
|
}
|
|
16
17
|
exports.SingleLendingAccountToken = SingleLendingAccountToken;
|
|
@@ -47,6 +48,9 @@ __decorate([
|
|
|
47
48
|
__metadata("design:type", String)
|
|
48
49
|
], SingleLendingAccountToken.prototype, "token", void 0);
|
|
49
50
|
class LendingAccountSummary {
|
|
51
|
+
constructor() {
|
|
52
|
+
this.chain = common_enum_1.ActivityChain.MVX;
|
|
53
|
+
}
|
|
50
54
|
}
|
|
51
55
|
exports.LendingAccountSummary = LendingAccountSummary;
|
|
52
56
|
__decorate([
|
|
@@ -85,3 +89,12 @@ __decorate([
|
|
|
85
89
|
(0, swagger_1.ApiProperty)(),
|
|
86
90
|
__metadata("design:type", String)
|
|
87
91
|
], LendingAccountSummary.prototype, "healthFactor", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, swagger_1.ApiProperty)({
|
|
94
|
+
description: 'Blockchain network the account summary belongs to',
|
|
95
|
+
required: false,
|
|
96
|
+
enum: common_enum_1.ActivityChain,
|
|
97
|
+
example: common_enum_1.ActivityChain.MVX,
|
|
98
|
+
}),
|
|
99
|
+
__metadata("design:type", String)
|
|
100
|
+
], LendingAccountSummary.prototype, "chain", void 0);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ActivityChain } from '../../../enums/common.enum';
|
|
2
|
+
/**
|
|
3
|
+
* Normalizes a raw `chain` value read off a lending document.
|
|
4
|
+
*
|
|
5
|
+
* Legacy MultiversX lending documents (written before the multi-chain
|
|
6
|
+
* rollout) have no `chain` field. Both API hydration and UI deserialization
|
|
7
|
+
* should funnel through this helper so they apply the same default
|
|
8
|
+
* (`ActivityChain.MVX`) and the document shape stays stable across chains.
|
|
9
|
+
*
|
|
10
|
+
* - `undefined` / `null` / empty string => `ActivityChain.MVX`
|
|
11
|
+
* - any non-empty string => cast as `ActivityChain`
|
|
12
|
+
*
|
|
13
|
+
* The cast is intentional: Cosmos stores strings, and any value we did not
|
|
14
|
+
* mint ourselves will still surface so downstream code (filters, SQL
|
|
15
|
+
* `c.chain IN (...)`) can match it. Add an explicit allow-list here only
|
|
16
|
+
* if a caller needs strict validation.
|
|
17
|
+
*/
|
|
18
|
+
export declare function normalizeLendingChain(raw?: string | null): ActivityChain;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeLendingChain = normalizeLendingChain;
|
|
4
|
+
const common_enum_1 = require("../../../enums/common.enum");
|
|
5
|
+
/**
|
|
6
|
+
* Normalizes a raw `chain` value read off a lending document.
|
|
7
|
+
*
|
|
8
|
+
* Legacy MultiversX lending documents (written before the multi-chain
|
|
9
|
+
* rollout) have no `chain` field. Both API hydration and UI deserialization
|
|
10
|
+
* should funnel through this helper so they apply the same default
|
|
11
|
+
* (`ActivityChain.MVX`) and the document shape stays stable across chains.
|
|
12
|
+
*
|
|
13
|
+
* - `undefined` / `null` / empty string => `ActivityChain.MVX`
|
|
14
|
+
* - any non-empty string => cast as `ActivityChain`
|
|
15
|
+
*
|
|
16
|
+
* The cast is intentional: Cosmos stores strings, and any value we did not
|
|
17
|
+
* mint ourselves will still surface so downstream code (filters, SQL
|
|
18
|
+
* `c.chain IN (...)`) can match it. Add an explicit allow-list here only
|
|
19
|
+
* if a caller needs strict validation.
|
|
20
|
+
*/
|
|
21
|
+
function normalizeLendingChain(raw) {
|
|
22
|
+
if (raw === undefined || raw === null || raw === '') {
|
|
23
|
+
return common_enum_1.ActivityChain.MVX;
|
|
24
|
+
}
|
|
25
|
+
return raw;
|
|
26
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LendingDataType } from '../../../enums/lending-data-type.enum';
|
|
2
2
|
import { LendingTokenEModeProfileDoc } from './lending-token-emode-profile.doc';
|
|
3
|
+
import { ActivityChain } from '../../../enums/common.enum';
|
|
3
4
|
export declare class LendingEModeCategoryProfileDoc {
|
|
4
5
|
dataType: LendingDataType;
|
|
5
6
|
name: string;
|
|
@@ -10,6 +11,7 @@ export declare class LendingEModeCategoryProfileDoc {
|
|
|
10
11
|
id: string;
|
|
11
12
|
pk: string;
|
|
12
13
|
_ts?: number;
|
|
14
|
+
chain: ActivityChain;
|
|
13
15
|
constructor(props?: Partial<LendingEModeCategoryProfileDoc>);
|
|
14
16
|
}
|
|
15
17
|
declare type ShortLendingTokenEModeProfileDoc_base = Pick<LendingTokenEModeProfileDoc, "token" | "canBeCollateral" | "canBeBorrowed" | "eModeCategory">;
|
|
@@ -13,11 +13,15 @@ exports.LendingEModeCategoryProfile = exports.ShortLendingTokenEModeProfileDoc =
|
|
|
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_token_emode_profile_doc_1 = require("./lending-token-emode-profile.doc");
|
|
16
|
+
const common_enum_1 = require("../../../enums/common.enum");
|
|
17
|
+
const lending_chain_1 = require("./lending-chain");
|
|
16
18
|
class LendingEModeCategoryProfileDoc {
|
|
17
19
|
constructor(props) {
|
|
18
20
|
this.dataType = lending_data_type_enum_1.LendingDataType.EMODE_CATEGORY_PROFILE;
|
|
21
|
+
this.chain = common_enum_1.ActivityChain.MVX;
|
|
19
22
|
Object.assign(this, props);
|
|
20
23
|
this.pk = this.dataType;
|
|
24
|
+
this.chain = (0, lending_chain_1.normalizeLendingChain)(this.chain);
|
|
21
25
|
}
|
|
22
26
|
}
|
|
23
27
|
exports.LendingEModeCategoryProfileDoc = LendingEModeCategoryProfileDoc;
|
|
@@ -68,6 +72,15 @@ __decorate([
|
|
|
68
72
|
}),
|
|
69
73
|
__metadata("design:type", Number)
|
|
70
74
|
], LendingEModeCategoryProfileDoc.prototype, "_ts", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, swagger_1.ApiProperty)({
|
|
77
|
+
description: 'Blockchain network the eMode category belongs to',
|
|
78
|
+
required: false,
|
|
79
|
+
enum: common_enum_1.ActivityChain,
|
|
80
|
+
example: common_enum_1.ActivityChain.MVX,
|
|
81
|
+
}),
|
|
82
|
+
__metadata("design:type", String)
|
|
83
|
+
], LendingEModeCategoryProfileDoc.prototype, "chain", void 0);
|
|
71
84
|
class ShortLendingTokenEModeProfileDoc extends (0, swagger_1.PickType)(lending_token_emode_profile_doc_1.LendingTokenEModeProfileDoc, ['token', 'canBeBorrowed', 'canBeCollateral', 'eModeCategory']) {
|
|
72
85
|
}
|
|
73
86
|
exports.ShortLendingTokenEModeProfileDoc = ShortLendingTokenEModeProfileDoc;
|
|
@@ -3,6 +3,7 @@ import { OwnerDto } from '../../../common/owner.dto';
|
|
|
3
3
|
import { LendingEModeCategoryProfileDoc } from './lending-emode-category-profile.doc';
|
|
4
4
|
import { LendingOracleUpdateStruct } from './lending-oracle';
|
|
5
5
|
import { LendingIndexesDto } from '../../../requests/lending/lending-indexes.dto';
|
|
6
|
+
import { ActivityChain } from '../../../enums/common.enum';
|
|
6
7
|
export declare class LendingMarketProfileDoc {
|
|
7
8
|
dataType: LendingDataType;
|
|
8
9
|
token: string;
|
|
@@ -53,6 +54,7 @@ export declare class LendingMarketProfileDoc {
|
|
|
53
54
|
flashLoanFee: string;
|
|
54
55
|
canBorrowInIsolation: boolean;
|
|
55
56
|
oracleProvider: LendingOracleUpdateStruct;
|
|
57
|
+
chain: ActivityChain;
|
|
56
58
|
id: string;
|
|
57
59
|
pk: string;
|
|
58
60
|
_ts: number;
|
|
@@ -17,6 +17,8 @@ const lending_emode_category_profile_doc_1 = require("./lending-emode-category-p
|
|
|
17
17
|
const cosmos_db_paginated_response_dto_1 = require("../../cosmos-db-paginated-response.dto");
|
|
18
18
|
const lending_oracle_1 = require("./lending-oracle");
|
|
19
19
|
const lending_indexes_dto_1 = require("../../../requests/lending/lending-indexes.dto");
|
|
20
|
+
const common_enum_1 = require("../../../enums/common.enum");
|
|
21
|
+
const lending_chain_1 = require("./lending-chain");
|
|
20
22
|
class LendingMarketProfileDoc {
|
|
21
23
|
constructor(props) {
|
|
22
24
|
this.dataType = lending_data_type_enum_1.LendingDataType.MARKET_PROFILE;
|
|
@@ -41,9 +43,11 @@ class LendingMarketProfileDoc {
|
|
|
41
43
|
this.maxDebtUsdShort = 0;
|
|
42
44
|
this.debtCeiling = '0';
|
|
43
45
|
this.debtCeilingShort = 0;
|
|
46
|
+
this.chain = common_enum_1.ActivityChain.MVX;
|
|
44
47
|
Object.assign(this, props);
|
|
45
48
|
this.pk = this.dataType;
|
|
46
49
|
this.id = `${this.token}_${this.dataType}`;
|
|
50
|
+
this.chain = (0, lending_chain_1.normalizeLendingChain)(this.chain);
|
|
47
51
|
}
|
|
48
52
|
}
|
|
49
53
|
exports.LendingMarketProfileDoc = LendingMarketProfileDoc;
|
|
@@ -296,6 +300,15 @@ __decorate([
|
|
|
296
300
|
}),
|
|
297
301
|
__metadata("design:type", lending_oracle_1.LendingOracleUpdateStruct)
|
|
298
302
|
], LendingMarketProfileDoc.prototype, "oracleProvider", void 0);
|
|
303
|
+
__decorate([
|
|
304
|
+
(0, swagger_1.ApiProperty)({
|
|
305
|
+
description: 'Blockchain network the market lives on',
|
|
306
|
+
required: false,
|
|
307
|
+
enum: common_enum_1.ActivityChain,
|
|
308
|
+
example: common_enum_1.ActivityChain.MVX,
|
|
309
|
+
}),
|
|
310
|
+
__metadata("design:type", String)
|
|
311
|
+
], LendingMarketProfileDoc.prototype, "chain", void 0);
|
|
299
312
|
__decorate([
|
|
300
313
|
(0, swagger_1.ApiProperty)({
|
|
301
314
|
description: 'Cosmos DB document identifier',
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { PositionMode } from '../../../enums/lending.enum';
|
|
2
|
+
import { ActivityChain } from '../../../enums/common.enum';
|
|
2
3
|
export declare class LendingNftAttributes {
|
|
3
4
|
isolated: boolean;
|
|
4
5
|
eModeCategory: string;
|
|
5
6
|
positionMode: PositionMode;
|
|
6
7
|
isolatedToken?: string;
|
|
8
|
+
chain: ActivityChain;
|
|
7
9
|
constructor(props?: Partial<LendingNftAttributes>);
|
|
8
10
|
}
|
|
@@ -12,9 +12,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.LendingNftAttributes = void 0;
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
14
|
const lending_enum_1 = require("../../../enums/lending.enum");
|
|
15
|
+
const common_enum_1 = require("../../../enums/common.enum");
|
|
16
|
+
const lending_chain_1 = require("./lending-chain");
|
|
15
17
|
class LendingNftAttributes {
|
|
16
18
|
constructor(props) {
|
|
19
|
+
this.chain = common_enum_1.ActivityChain.MVX;
|
|
17
20
|
Object.assign(this, props);
|
|
21
|
+
this.chain = (0, lending_chain_1.normalizeLendingChain)(this.chain);
|
|
18
22
|
}
|
|
19
23
|
}
|
|
20
24
|
exports.LendingNftAttributes = LendingNftAttributes;
|
|
@@ -49,3 +53,12 @@ __decorate([
|
|
|
49
53
|
}),
|
|
50
54
|
__metadata("design:type", String)
|
|
51
55
|
], LendingNftAttributes.prototype, "isolatedToken", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, swagger_1.ApiProperty)({
|
|
58
|
+
description: 'Blockchain network the NFT attributes belong to',
|
|
59
|
+
required: false,
|
|
60
|
+
enum: common_enum_1.ActivityChain,
|
|
61
|
+
example: common_enum_1.ActivityChain.MVX,
|
|
62
|
+
}),
|
|
63
|
+
__metadata("design:type", String)
|
|
64
|
+
], LendingNftAttributes.prototype, "chain", void 0);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LendingDataType } from '../../../enums/lending-data-type.enum';
|
|
2
|
+
import { ActivityChain } from '../../../enums/common.enum';
|
|
2
3
|
export declare class LendingTokenEModeProfileDoc {
|
|
3
4
|
dataType: LendingDataType;
|
|
4
5
|
token: string;
|
|
@@ -8,5 +9,6 @@ export declare class LendingTokenEModeProfileDoc {
|
|
|
8
9
|
id: string;
|
|
9
10
|
pk: string;
|
|
10
11
|
_ts: number;
|
|
12
|
+
chain: ActivityChain;
|
|
11
13
|
constructor(props?: Partial<LendingTokenEModeProfileDoc>);
|
|
12
14
|
}
|
|
@@ -12,12 +12,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.LendingTokenEModeProfileDoc = void 0;
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
14
|
const lending_data_type_enum_1 = require("../../../enums/lending-data-type.enum");
|
|
15
|
+
const common_enum_1 = require("../../../enums/common.enum");
|
|
16
|
+
const lending_chain_1 = require("./lending-chain");
|
|
15
17
|
class LendingTokenEModeProfileDoc {
|
|
16
18
|
constructor(props) {
|
|
17
19
|
this.dataType = lending_data_type_enum_1.LendingDataType.TOKEN_EMODE_PROFILE;
|
|
20
|
+
this.chain = common_enum_1.ActivityChain.MVX;
|
|
18
21
|
Object.assign(this, props);
|
|
19
22
|
this.pk = this.dataType;
|
|
20
23
|
this.id = `${this.token}_${this.eModeCategory}_${this.dataType}`;
|
|
24
|
+
this.chain = (0, lending_chain_1.normalizeLendingChain)(this.chain);
|
|
21
25
|
}
|
|
22
26
|
}
|
|
23
27
|
exports.LendingTokenEModeProfileDoc = LendingTokenEModeProfileDoc;
|
|
@@ -78,3 +82,12 @@ __decorate([
|
|
|
78
82
|
}),
|
|
79
83
|
__metadata("design:type", Number)
|
|
80
84
|
], LendingTokenEModeProfileDoc.prototype, "_ts", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, swagger_1.ApiProperty)({
|
|
87
|
+
description: 'Blockchain network the token eMode profile belongs to',
|
|
88
|
+
required: false,
|
|
89
|
+
enum: common_enum_1.ActivityChain,
|
|
90
|
+
example: common_enum_1.ActivityChain.MVX,
|
|
91
|
+
}),
|
|
92
|
+
__metadata("design:type", String)
|
|
93
|
+
], LendingTokenEModeProfileDoc.prototype, "chain", void 0);
|
package/dist/index.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ export * from './cosmos-db/documents/external-payment/xmoney-order';
|
|
|
43
43
|
export * from './cosmos-db/documents/lending/lending-account-pnl';
|
|
44
44
|
export * from './cosmos-db/documents/lending/lending-account-profile';
|
|
45
45
|
export * from './cosmos-db/documents/lending/lending-account-summary';
|
|
46
|
+
export * from './cosmos-db/documents/lending/lending-chain';
|
|
46
47
|
export * from './cosmos-db/documents/lending/lending-emode-category-profile.doc';
|
|
47
48
|
export * from './cosmos-db/documents/lending/lending-market-profile.doc';
|
|
48
49
|
export * from './cosmos-db/documents/lending/lending-nft-attributes';
|
|
@@ -209,6 +210,7 @@ export * from './requests/lending/hatom-info.dto';
|
|
|
209
210
|
export * from './requests/lending/lending-indexes.dto';
|
|
210
211
|
export * from './requests/lending/lending-market-profile.filter';
|
|
211
212
|
export * from './requests/lending/lending-token-price.dto';
|
|
213
|
+
export * from './requests/lending/stellar-lending-args.dto';
|
|
212
214
|
export * from './requests/nft-activity-data/analytics-overview';
|
|
213
215
|
export * from './requests/nft-activity-data/analytics-volume';
|
|
214
216
|
export * from './requests/nft-activity-data/nft-activity-data';
|
package/dist/index.js
CHANGED
|
@@ -59,6 +59,7 @@ __exportStar(require("./cosmos-db/documents/external-payment/xmoney-order"), exp
|
|
|
59
59
|
__exportStar(require("./cosmos-db/documents/lending/lending-account-pnl"), exports);
|
|
60
60
|
__exportStar(require("./cosmos-db/documents/lending/lending-account-profile"), exports);
|
|
61
61
|
__exportStar(require("./cosmos-db/documents/lending/lending-account-summary"), exports);
|
|
62
|
+
__exportStar(require("./cosmos-db/documents/lending/lending-chain"), exports);
|
|
62
63
|
__exportStar(require("./cosmos-db/documents/lending/lending-emode-category-profile.doc"), exports);
|
|
63
64
|
__exportStar(require("./cosmos-db/documents/lending/lending-market-profile.doc"), exports);
|
|
64
65
|
__exportStar(require("./cosmos-db/documents/lending/lending-nft-attributes"), exports);
|
|
@@ -298,6 +299,7 @@ __exportStar(require("./requests/lending/hatom-info.dto"), exports);
|
|
|
298
299
|
__exportStar(require("./requests/lending/lending-indexes.dto"), exports);
|
|
299
300
|
__exportStar(require("./requests/lending/lending-market-profile.filter"), exports);
|
|
300
301
|
__exportStar(require("./requests/lending/lending-token-price.dto"), exports);
|
|
302
|
+
__exportStar(require("./requests/lending/stellar-lending-args.dto"), exports);
|
|
301
303
|
__exportStar(require("./requests/nft-activity-data/analytics-overview"), exports);
|
|
302
304
|
__exportStar(require("./requests/nft-activity-data/analytics-volume"), exports);
|
|
303
305
|
__exportStar(require("./requests/nft-activity-data/nft-activity-data"), exports);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ActivityChain } from '../../enums/common.enum';
|
|
1
2
|
export declare class LendingIndexesDto {
|
|
2
3
|
supplyIndex: string;
|
|
3
4
|
supplyIndexShort: number;
|
|
@@ -17,4 +18,5 @@ export declare class LendingIndexesDto {
|
|
|
17
18
|
aggregatorPriceUsdShort: number;
|
|
18
19
|
withinFirstTolerance: boolean;
|
|
19
20
|
withinSecondTolerance: boolean;
|
|
21
|
+
chain?: ActivityChain;
|
|
20
22
|
}
|
|
@@ -11,6 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.LendingIndexesDto = void 0;
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const common_enum_1 = require("../../enums/common.enum");
|
|
14
15
|
class LendingIndexesDto {
|
|
15
16
|
}
|
|
16
17
|
exports.LendingIndexesDto = LendingIndexesDto;
|
|
@@ -158,3 +159,12 @@ __decorate([
|
|
|
158
159
|
}),
|
|
159
160
|
__metadata("design:type", Boolean)
|
|
160
161
|
], LendingIndexesDto.prototype, "withinSecondTolerance", void 0);
|
|
162
|
+
__decorate([
|
|
163
|
+
(0, swagger_1.ApiProperty)({
|
|
164
|
+
description: 'Blockchain network the indexes belong to (optional, defaults downstream to MVX when absent)',
|
|
165
|
+
required: false,
|
|
166
|
+
enum: common_enum_1.ActivityChain,
|
|
167
|
+
example: common_enum_1.ActivityChain.MVX,
|
|
168
|
+
}),
|
|
169
|
+
__metadata("design:type", String)
|
|
170
|
+
], LendingIndexesDto.prototype, "chain", void 0);
|
|
@@ -1,5 +1,6 @@
|
|
|
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
|
+
import { ActivityChain } from '../../enums/common.enum';
|
|
3
4
|
export declare class LendingMarketProfileFilterCriteriaDto {
|
|
4
5
|
token?: string[];
|
|
5
6
|
range?: RangeFilter<LendingMarketProfileDoc>[];
|
|
@@ -11,6 +12,7 @@ export declare class LendingMarketProfileFilterCriteriaDto {
|
|
|
11
12
|
canBeBorrowed?: boolean;
|
|
12
13
|
canBorrowInIsolation?: boolean;
|
|
13
14
|
isDebtCeilingReached?: boolean;
|
|
15
|
+
chain?: ActivityChain[];
|
|
14
16
|
}
|
|
15
17
|
export declare class LendingMarketProfileExtraProperties {
|
|
16
18
|
eModeCategoryProfile?: boolean;
|
|
@@ -30,6 +32,7 @@ export declare class LendingMarketProfileFilter extends CosmosDbGenericFilter<Le
|
|
|
30
32
|
canBorrowInIsolation?: boolean;
|
|
31
33
|
isDebtCeilingReached?: boolean;
|
|
32
34
|
pk?: string;
|
|
35
|
+
chain?: ActivityChain[];
|
|
33
36
|
};
|
|
34
37
|
strictSelect?: boolean;
|
|
35
38
|
includeCount?: boolean;
|
|
@@ -13,6 +13,7 @@ exports.LendingMarketProfileFilter = exports.LendingMarketProfileExtraProperties
|
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
14
|
const cosmos_db_generic_filter_1 = require("../../cosmos-db/cosmos-db-generic-filter");
|
|
15
15
|
const lending_data_type_enum_1 = require("../../enums/lending-data-type.enum");
|
|
16
|
+
const common_enum_1 = require("../../enums/common.enum");
|
|
16
17
|
class LendingMarketProfileFilterCriteriaDto {
|
|
17
18
|
}
|
|
18
19
|
exports.LendingMarketProfileFilterCriteriaDto = LendingMarketProfileFilterCriteriaDto;
|
|
@@ -56,6 +57,15 @@ __decorate([
|
|
|
56
57
|
(0, swagger_1.ApiProperty)({ required: false, type: Boolean }),
|
|
57
58
|
__metadata("design:type", Boolean)
|
|
58
59
|
], LendingMarketProfileFilterCriteriaDto.prototype, "isDebtCeilingReached", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, swagger_1.ApiProperty)({
|
|
62
|
+
required: false,
|
|
63
|
+
isArray: true,
|
|
64
|
+
enum: common_enum_1.ActivityChain,
|
|
65
|
+
description: 'Optional chain discriminator — when omitted, no chain clause is added and all chains are returned',
|
|
66
|
+
}),
|
|
67
|
+
__metadata("design:type", Array)
|
|
68
|
+
], LendingMarketProfileFilterCriteriaDto.prototype, "chain", void 0);
|
|
59
69
|
class LendingMarketProfileExtraProperties {
|
|
60
70
|
}
|
|
61
71
|
exports.LendingMarketProfileExtraProperties = LendingMarketProfileExtraProperties;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chain-agnostic argument DTOs for the lending protocol.
|
|
3
|
+
*
|
|
4
|
+
* These shapes mirror the Stellar controller entry points
|
|
5
|
+
* (see /rs-lending/stellar/controller/src/lib.rs) but are deliberately
|
|
6
|
+
* decoupled from any chain-specific types:
|
|
7
|
+
*
|
|
8
|
+
* - `token` is a string (MVX uses ESDT ticker, Stellar uses contract
|
|
9
|
+
* address, SUI uses coin type) — callers pass whatever their chain
|
|
10
|
+
* uses, the SDK builder interprets it.
|
|
11
|
+
* - `amount` is a string to preserve precision across u64 / u128 /
|
|
12
|
+
* i128 backends.
|
|
13
|
+
* - `steps`, `data` are `unknown` — the concrete swap-path / callback
|
|
14
|
+
* struct is chain-specific and encoded by the SDK transaction
|
|
15
|
+
* builder.
|
|
16
|
+
*
|
|
17
|
+
* MVX flows can reuse these via a thin adapter; Stellar flows consume
|
|
18
|
+
* them directly in the `@xoxno/sdk-js` Soroban transaction builders.
|
|
19
|
+
*/
|
|
20
|
+
export declare class SupplyArgs {
|
|
21
|
+
token: string;
|
|
22
|
+
amount: string;
|
|
23
|
+
eModeCategory?: number;
|
|
24
|
+
accountNonce?: number;
|
|
25
|
+
}
|
|
26
|
+
export declare class BorrowArgs {
|
|
27
|
+
token: string;
|
|
28
|
+
amount: string;
|
|
29
|
+
accountNonce: number;
|
|
30
|
+
}
|
|
31
|
+
export declare class RepayArgs {
|
|
32
|
+
token: string;
|
|
33
|
+
amount: string;
|
|
34
|
+
accountNonce: number;
|
|
35
|
+
}
|
|
36
|
+
export declare class WithdrawArgs {
|
|
37
|
+
token: string;
|
|
38
|
+
amount: string;
|
|
39
|
+
accountNonce: number;
|
|
40
|
+
}
|
|
41
|
+
export declare class LiquidateDebtPayment {
|
|
42
|
+
token: string;
|
|
43
|
+
amount: string;
|
|
44
|
+
}
|
|
45
|
+
export declare class LiquidateArgs {
|
|
46
|
+
accountNonce: number;
|
|
47
|
+
debtPayments: Array<{
|
|
48
|
+
token: string;
|
|
49
|
+
amount: string;
|
|
50
|
+
}>;
|
|
51
|
+
}
|
|
52
|
+
export declare class MultiplyArgs {
|
|
53
|
+
eModeCategory: number;
|
|
54
|
+
collateralToken: string;
|
|
55
|
+
debtToFlashLoan: string;
|
|
56
|
+
debtToken: string;
|
|
57
|
+
mode: number;
|
|
58
|
+
steps: unknown;
|
|
59
|
+
accountNonce?: number;
|
|
60
|
+
}
|
|
61
|
+
export declare class SwapDebtArgs {
|
|
62
|
+
accountNonce: number;
|
|
63
|
+
existingDebtToken: string;
|
|
64
|
+
newDebtAmount: string;
|
|
65
|
+
newDebtToken: string;
|
|
66
|
+
steps: unknown;
|
|
67
|
+
}
|
|
68
|
+
export declare class SwapCollateralArgs {
|
|
69
|
+
accountNonce: number;
|
|
70
|
+
currentCollateral: string;
|
|
71
|
+
fromAmount: string;
|
|
72
|
+
newCollateral: string;
|
|
73
|
+
steps: unknown;
|
|
74
|
+
}
|
|
75
|
+
export declare class RepayDebtWithCollateralArgs {
|
|
76
|
+
accountNonce: number;
|
|
77
|
+
collateralToken: string;
|
|
78
|
+
collateralAmount: string;
|
|
79
|
+
debtToken: string;
|
|
80
|
+
steps: unknown;
|
|
81
|
+
closePosition: boolean;
|
|
82
|
+
}
|
|
83
|
+
export declare class FlashLoanArgs {
|
|
84
|
+
asset: string;
|
|
85
|
+
amount: string;
|
|
86
|
+
receiver: string;
|
|
87
|
+
data: unknown;
|
|
88
|
+
}
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.FlashLoanArgs = exports.RepayDebtWithCollateralArgs = exports.SwapCollateralArgs = exports.SwapDebtArgs = exports.MultiplyArgs = exports.LiquidateArgs = exports.LiquidateDebtPayment = exports.WithdrawArgs = exports.RepayArgs = exports.BorrowArgs = exports.SupplyArgs = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
/**
|
|
15
|
+
* Chain-agnostic argument DTOs for the lending protocol.
|
|
16
|
+
*
|
|
17
|
+
* These shapes mirror the Stellar controller entry points
|
|
18
|
+
* (see /rs-lending/stellar/controller/src/lib.rs) but are deliberately
|
|
19
|
+
* decoupled from any chain-specific types:
|
|
20
|
+
*
|
|
21
|
+
* - `token` is a string (MVX uses ESDT ticker, Stellar uses contract
|
|
22
|
+
* address, SUI uses coin type) — callers pass whatever their chain
|
|
23
|
+
* uses, the SDK builder interprets it.
|
|
24
|
+
* - `amount` is a string to preserve precision across u64 / u128 /
|
|
25
|
+
* i128 backends.
|
|
26
|
+
* - `steps`, `data` are `unknown` — the concrete swap-path / callback
|
|
27
|
+
* struct is chain-specific and encoded by the SDK transaction
|
|
28
|
+
* builder.
|
|
29
|
+
*
|
|
30
|
+
* MVX flows can reuse these via a thin adapter; Stellar flows consume
|
|
31
|
+
* them directly in the `@xoxno/sdk-js` Soroban transaction builders.
|
|
32
|
+
*/
|
|
33
|
+
class SupplyArgs {
|
|
34
|
+
}
|
|
35
|
+
exports.SupplyArgs = SupplyArgs;
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, swagger_1.ApiProperty)({
|
|
38
|
+
description: 'Collateral token identifier (ESDT ticker on MVX, contract address on Stellar)',
|
|
39
|
+
example: 'USDC-c76f1f',
|
|
40
|
+
}),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], SupplyArgs.prototype, "token", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, swagger_1.ApiProperty)({
|
|
45
|
+
description: 'Amount to supply, as a decimal string in base units',
|
|
46
|
+
example: '1000000',
|
|
47
|
+
}),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], SupplyArgs.prototype, "amount", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, swagger_1.ApiProperty)({
|
|
52
|
+
description: 'Optional eMode category to enter on first supply',
|
|
53
|
+
required: false,
|
|
54
|
+
example: 1,
|
|
55
|
+
}),
|
|
56
|
+
__metadata("design:type", Number)
|
|
57
|
+
], SupplyArgs.prototype, "eModeCategory", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, swagger_1.ApiProperty)({
|
|
60
|
+
description: 'Optional existing account nonce / account id — when omitted, a new account is created',
|
|
61
|
+
required: false,
|
|
62
|
+
example: 42,
|
|
63
|
+
}),
|
|
64
|
+
__metadata("design:type", Number)
|
|
65
|
+
], SupplyArgs.prototype, "accountNonce", void 0);
|
|
66
|
+
class BorrowArgs {
|
|
67
|
+
}
|
|
68
|
+
exports.BorrowArgs = BorrowArgs;
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, swagger_1.ApiProperty)({
|
|
71
|
+
description: 'Debt token identifier',
|
|
72
|
+
example: 'USDC-c76f1f',
|
|
73
|
+
}),
|
|
74
|
+
__metadata("design:type", String)
|
|
75
|
+
], BorrowArgs.prototype, "token", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, swagger_1.ApiProperty)({
|
|
78
|
+
description: 'Amount to borrow, as a decimal string in base units',
|
|
79
|
+
example: '500000',
|
|
80
|
+
}),
|
|
81
|
+
__metadata("design:type", String)
|
|
82
|
+
], BorrowArgs.prototype, "amount", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, swagger_1.ApiProperty)({ description: 'Account nonce / account id', example: 42 }),
|
|
85
|
+
__metadata("design:type", Number)
|
|
86
|
+
], BorrowArgs.prototype, "accountNonce", void 0);
|
|
87
|
+
class RepayArgs {
|
|
88
|
+
}
|
|
89
|
+
exports.RepayArgs = RepayArgs;
|
|
90
|
+
__decorate([
|
|
91
|
+
(0, swagger_1.ApiProperty)({
|
|
92
|
+
description: 'Debt token identifier being repaid',
|
|
93
|
+
example: 'USDC-c76f1f',
|
|
94
|
+
}),
|
|
95
|
+
__metadata("design:type", String)
|
|
96
|
+
], RepayArgs.prototype, "token", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
(0, swagger_1.ApiProperty)({
|
|
99
|
+
description: 'Amount to repay, as a decimal string in base units',
|
|
100
|
+
example: '500000',
|
|
101
|
+
}),
|
|
102
|
+
__metadata("design:type", String)
|
|
103
|
+
], RepayArgs.prototype, "amount", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, swagger_1.ApiProperty)({ description: 'Account nonce / account id', example: 42 }),
|
|
106
|
+
__metadata("design:type", Number)
|
|
107
|
+
], RepayArgs.prototype, "accountNonce", void 0);
|
|
108
|
+
class WithdrawArgs {
|
|
109
|
+
}
|
|
110
|
+
exports.WithdrawArgs = WithdrawArgs;
|
|
111
|
+
__decorate([
|
|
112
|
+
(0, swagger_1.ApiProperty)({
|
|
113
|
+
description: 'Collateral token identifier being withdrawn',
|
|
114
|
+
example: 'USDC-c76f1f',
|
|
115
|
+
}),
|
|
116
|
+
__metadata("design:type", String)
|
|
117
|
+
], WithdrawArgs.prototype, "token", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
(0, swagger_1.ApiProperty)({
|
|
120
|
+
description: 'Amount to withdraw, as a decimal string in base units (0 = full position)',
|
|
121
|
+
example: '1000000',
|
|
122
|
+
}),
|
|
123
|
+
__metadata("design:type", String)
|
|
124
|
+
], WithdrawArgs.prototype, "amount", void 0);
|
|
125
|
+
__decorate([
|
|
126
|
+
(0, swagger_1.ApiProperty)({ description: 'Account nonce / account id', example: 42 }),
|
|
127
|
+
__metadata("design:type", Number)
|
|
128
|
+
], WithdrawArgs.prototype, "accountNonce", void 0);
|
|
129
|
+
class LiquidateDebtPayment {
|
|
130
|
+
}
|
|
131
|
+
exports.LiquidateDebtPayment = LiquidateDebtPayment;
|
|
132
|
+
__decorate([
|
|
133
|
+
(0, swagger_1.ApiProperty)({
|
|
134
|
+
description: 'Debt token identifier being repaid as part of liquidation',
|
|
135
|
+
example: 'USDC-c76f1f',
|
|
136
|
+
}),
|
|
137
|
+
__metadata("design:type", String)
|
|
138
|
+
], LiquidateDebtPayment.prototype, "token", void 0);
|
|
139
|
+
__decorate([
|
|
140
|
+
(0, swagger_1.ApiProperty)({
|
|
141
|
+
description: 'Amount of debt token provided by the liquidator',
|
|
142
|
+
example: '500000',
|
|
143
|
+
}),
|
|
144
|
+
__metadata("design:type", String)
|
|
145
|
+
], LiquidateDebtPayment.prototype, "amount", void 0);
|
|
146
|
+
class LiquidateArgs {
|
|
147
|
+
}
|
|
148
|
+
exports.LiquidateArgs = LiquidateArgs;
|
|
149
|
+
__decorate([
|
|
150
|
+
(0, swagger_1.ApiProperty)({
|
|
151
|
+
description: 'Target account nonce / account id being liquidated',
|
|
152
|
+
example: 42,
|
|
153
|
+
}),
|
|
154
|
+
__metadata("design:type", Number)
|
|
155
|
+
], LiquidateArgs.prototype, "accountNonce", void 0);
|
|
156
|
+
__decorate([
|
|
157
|
+
(0, swagger_1.ApiProperty)({
|
|
158
|
+
description: 'Debt payments supplied by the liquidator',
|
|
159
|
+
type: () => LiquidateDebtPayment,
|
|
160
|
+
isArray: true,
|
|
161
|
+
}),
|
|
162
|
+
__metadata("design:type", Array)
|
|
163
|
+
], LiquidateArgs.prototype, "debtPayments", void 0);
|
|
164
|
+
class MultiplyArgs {
|
|
165
|
+
}
|
|
166
|
+
exports.MultiplyArgs = MultiplyArgs;
|
|
167
|
+
__decorate([
|
|
168
|
+
(0, swagger_1.ApiProperty)({ description: 'eMode category to enter', example: 1 }),
|
|
169
|
+
__metadata("design:type", Number)
|
|
170
|
+
], MultiplyArgs.prototype, "eModeCategory", void 0);
|
|
171
|
+
__decorate([
|
|
172
|
+
(0, swagger_1.ApiProperty)({
|
|
173
|
+
description: 'Collateral token identifier',
|
|
174
|
+
example: 'USDC-c76f1f',
|
|
175
|
+
}),
|
|
176
|
+
__metadata("design:type", String)
|
|
177
|
+
], MultiplyArgs.prototype, "collateralToken", void 0);
|
|
178
|
+
__decorate([
|
|
179
|
+
(0, swagger_1.ApiProperty)({
|
|
180
|
+
description: 'Debt amount borrowed via flash loan to fund the leverage entry',
|
|
181
|
+
example: '2000000',
|
|
182
|
+
}),
|
|
183
|
+
__metadata("design:type", String)
|
|
184
|
+
], MultiplyArgs.prototype, "debtToFlashLoan", void 0);
|
|
185
|
+
__decorate([
|
|
186
|
+
(0, swagger_1.ApiProperty)({
|
|
187
|
+
description: 'Debt token identifier (the flash-loaned asset)',
|
|
188
|
+
example: 'USDC-c76f1f',
|
|
189
|
+
}),
|
|
190
|
+
__metadata("design:type", String)
|
|
191
|
+
], MultiplyArgs.prototype, "debtToken", void 0);
|
|
192
|
+
__decorate([
|
|
193
|
+
(0, swagger_1.ApiProperty)({
|
|
194
|
+
description: 'Strategy mode flag (long / short / native)',
|
|
195
|
+
example: 0,
|
|
196
|
+
}),
|
|
197
|
+
__metadata("design:type", Number)
|
|
198
|
+
], MultiplyArgs.prototype, "mode", void 0);
|
|
199
|
+
__decorate([
|
|
200
|
+
(0, swagger_1.ApiProperty)({
|
|
201
|
+
description: 'Chain-specific swap path encoded by the SDK transaction builder',
|
|
202
|
+
}),
|
|
203
|
+
__metadata("design:type", Object)
|
|
204
|
+
], MultiplyArgs.prototype, "steps", void 0);
|
|
205
|
+
__decorate([
|
|
206
|
+
(0, swagger_1.ApiProperty)({
|
|
207
|
+
description: 'Optional existing account nonce — when omitted, a new account is created',
|
|
208
|
+
required: false,
|
|
209
|
+
example: 42,
|
|
210
|
+
}),
|
|
211
|
+
__metadata("design:type", Number)
|
|
212
|
+
], MultiplyArgs.prototype, "accountNonce", void 0);
|
|
213
|
+
class SwapDebtArgs {
|
|
214
|
+
}
|
|
215
|
+
exports.SwapDebtArgs = SwapDebtArgs;
|
|
216
|
+
__decorate([
|
|
217
|
+
(0, swagger_1.ApiProperty)({ description: 'Account nonce / account id', example: 42 }),
|
|
218
|
+
__metadata("design:type", Number)
|
|
219
|
+
], SwapDebtArgs.prototype, "accountNonce", void 0);
|
|
220
|
+
__decorate([
|
|
221
|
+
(0, swagger_1.ApiProperty)({
|
|
222
|
+
description: 'Token identifier of the existing debt being swapped out',
|
|
223
|
+
example: 'USDC-c76f1f',
|
|
224
|
+
}),
|
|
225
|
+
__metadata("design:type", String)
|
|
226
|
+
], SwapDebtArgs.prototype, "existingDebtToken", void 0);
|
|
227
|
+
__decorate([
|
|
228
|
+
(0, swagger_1.ApiProperty)({
|
|
229
|
+
description: 'Amount of the new debt to take on',
|
|
230
|
+
example: '500000',
|
|
231
|
+
}),
|
|
232
|
+
__metadata("design:type", String)
|
|
233
|
+
], SwapDebtArgs.prototype, "newDebtAmount", void 0);
|
|
234
|
+
__decorate([
|
|
235
|
+
(0, swagger_1.ApiProperty)({
|
|
236
|
+
description: 'Token identifier of the new debt being taken on',
|
|
237
|
+
example: 'USDT-abcdef',
|
|
238
|
+
}),
|
|
239
|
+
__metadata("design:type", String)
|
|
240
|
+
], SwapDebtArgs.prototype, "newDebtToken", void 0);
|
|
241
|
+
__decorate([
|
|
242
|
+
(0, swagger_1.ApiProperty)({
|
|
243
|
+
description: 'Chain-specific swap path encoded by the SDK transaction builder',
|
|
244
|
+
}),
|
|
245
|
+
__metadata("design:type", Object)
|
|
246
|
+
], SwapDebtArgs.prototype, "steps", void 0);
|
|
247
|
+
class SwapCollateralArgs {
|
|
248
|
+
}
|
|
249
|
+
exports.SwapCollateralArgs = SwapCollateralArgs;
|
|
250
|
+
__decorate([
|
|
251
|
+
(0, swagger_1.ApiProperty)({ description: 'Account nonce / account id', example: 42 }),
|
|
252
|
+
__metadata("design:type", Number)
|
|
253
|
+
], SwapCollateralArgs.prototype, "accountNonce", void 0);
|
|
254
|
+
__decorate([
|
|
255
|
+
(0, swagger_1.ApiProperty)({
|
|
256
|
+
description: 'Current collateral token identifier being swapped out',
|
|
257
|
+
example: 'USDC-c76f1f',
|
|
258
|
+
}),
|
|
259
|
+
__metadata("design:type", String)
|
|
260
|
+
], SwapCollateralArgs.prototype, "currentCollateral", void 0);
|
|
261
|
+
__decorate([
|
|
262
|
+
(0, swagger_1.ApiProperty)({
|
|
263
|
+
description: 'Amount of the current collateral to swap',
|
|
264
|
+
example: '1000000',
|
|
265
|
+
}),
|
|
266
|
+
__metadata("design:type", String)
|
|
267
|
+
], SwapCollateralArgs.prototype, "fromAmount", void 0);
|
|
268
|
+
__decorate([
|
|
269
|
+
(0, swagger_1.ApiProperty)({
|
|
270
|
+
description: 'New collateral token identifier being received',
|
|
271
|
+
example: 'USDT-abcdef',
|
|
272
|
+
}),
|
|
273
|
+
__metadata("design:type", String)
|
|
274
|
+
], SwapCollateralArgs.prototype, "newCollateral", void 0);
|
|
275
|
+
__decorate([
|
|
276
|
+
(0, swagger_1.ApiProperty)({
|
|
277
|
+
description: 'Chain-specific swap path encoded by the SDK transaction builder',
|
|
278
|
+
}),
|
|
279
|
+
__metadata("design:type", Object)
|
|
280
|
+
], SwapCollateralArgs.prototype, "steps", void 0);
|
|
281
|
+
class RepayDebtWithCollateralArgs {
|
|
282
|
+
}
|
|
283
|
+
exports.RepayDebtWithCollateralArgs = RepayDebtWithCollateralArgs;
|
|
284
|
+
__decorate([
|
|
285
|
+
(0, swagger_1.ApiProperty)({ description: 'Account nonce / account id', example: 42 }),
|
|
286
|
+
__metadata("design:type", Number)
|
|
287
|
+
], RepayDebtWithCollateralArgs.prototype, "accountNonce", void 0);
|
|
288
|
+
__decorate([
|
|
289
|
+
(0, swagger_1.ApiProperty)({
|
|
290
|
+
description: 'Collateral token being unwound to repay debt',
|
|
291
|
+
example: 'USDC-c76f1f',
|
|
292
|
+
}),
|
|
293
|
+
__metadata("design:type", String)
|
|
294
|
+
], RepayDebtWithCollateralArgs.prototype, "collateralToken", void 0);
|
|
295
|
+
__decorate([
|
|
296
|
+
(0, swagger_1.ApiProperty)({
|
|
297
|
+
description: 'Amount of collateral to unwind',
|
|
298
|
+
example: '1000000',
|
|
299
|
+
}),
|
|
300
|
+
__metadata("design:type", String)
|
|
301
|
+
], RepayDebtWithCollateralArgs.prototype, "collateralAmount", void 0);
|
|
302
|
+
__decorate([
|
|
303
|
+
(0, swagger_1.ApiProperty)({
|
|
304
|
+
description: 'Debt token being repaid',
|
|
305
|
+
example: 'USDT-abcdef',
|
|
306
|
+
}),
|
|
307
|
+
__metadata("design:type", String)
|
|
308
|
+
], RepayDebtWithCollateralArgs.prototype, "debtToken", void 0);
|
|
309
|
+
__decorate([
|
|
310
|
+
(0, swagger_1.ApiProperty)({
|
|
311
|
+
description: 'Chain-specific swap path encoded by the SDK transaction builder',
|
|
312
|
+
}),
|
|
313
|
+
__metadata("design:type", Object)
|
|
314
|
+
], RepayDebtWithCollateralArgs.prototype, "steps", void 0);
|
|
315
|
+
__decorate([
|
|
316
|
+
(0, swagger_1.ApiProperty)({
|
|
317
|
+
description: 'When true the position is closed after the repay',
|
|
318
|
+
example: false,
|
|
319
|
+
}),
|
|
320
|
+
__metadata("design:type", Boolean)
|
|
321
|
+
], RepayDebtWithCollateralArgs.prototype, "closePosition", void 0);
|
|
322
|
+
class FlashLoanArgs {
|
|
323
|
+
}
|
|
324
|
+
exports.FlashLoanArgs = FlashLoanArgs;
|
|
325
|
+
__decorate([
|
|
326
|
+
(0, swagger_1.ApiProperty)({
|
|
327
|
+
description: 'Token identifier to borrow via flash loan',
|
|
328
|
+
example: 'USDC-c76f1f',
|
|
329
|
+
}),
|
|
330
|
+
__metadata("design:type", String)
|
|
331
|
+
], FlashLoanArgs.prototype, "asset", void 0);
|
|
332
|
+
__decorate([
|
|
333
|
+
(0, swagger_1.ApiProperty)({
|
|
334
|
+
description: 'Amount to borrow, as a decimal string in base units',
|
|
335
|
+
example: '2000000',
|
|
336
|
+
}),
|
|
337
|
+
__metadata("design:type", String)
|
|
338
|
+
], FlashLoanArgs.prototype, "amount", void 0);
|
|
339
|
+
__decorate([
|
|
340
|
+
(0, swagger_1.ApiProperty)({
|
|
341
|
+
description: 'Receiver contract / address that handles the callback',
|
|
342
|
+
example: 'erd1qqqqqq...',
|
|
343
|
+
}),
|
|
344
|
+
__metadata("design:type", String)
|
|
345
|
+
], FlashLoanArgs.prototype, "receiver", void 0);
|
|
346
|
+
__decorate([
|
|
347
|
+
(0, swagger_1.ApiProperty)({
|
|
348
|
+
description: 'Opaque callback payload forwarded to the receiver — shape is chain-specific',
|
|
349
|
+
}),
|
|
350
|
+
__metadata("design:type", Object)
|
|
351
|
+
], FlashLoanArgs.prototype, "data", void 0);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xoxno/types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.384",
|
|
4
4
|
"description": "Shared types and utilities for XOXNO API.",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"prepublishOnly": "npm run build",
|
|
28
28
|
"lint": "eslint 'src/**/*.ts'",
|
|
29
29
|
"lint:fix": "eslint 'src/**/*.ts' --fix",
|
|
30
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
30
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
31
|
+
"test:lending-chain": "npm run build && node test/lending-chain.test.mjs"
|
|
31
32
|
},
|
|
32
33
|
"repository": {
|
|
33
34
|
"type": "git",
|