@xoxno/types 1.0.420 → 1.0.422
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/index.d.ts
CHANGED
|
@@ -210,6 +210,7 @@ export * from './requests/collection/listings';
|
|
|
210
210
|
export * from './requests/collection/pinned-collections';
|
|
211
211
|
export * from './requests/collection/ranks';
|
|
212
212
|
export * from './requests/collection/shareholder.dto';
|
|
213
|
+
export * from './requests/lending/blend.dto';
|
|
213
214
|
export * from './requests/lending/hatom-info.dto';
|
|
214
215
|
export * from './requests/lending/lending-governance-proposal.filter';
|
|
215
216
|
export * from './requests/lending/lending-indexes.dto';
|
package/dist/index.js
CHANGED
|
@@ -301,6 +301,7 @@ __exportStar(require("./requests/collection/listings"), exports);
|
|
|
301
301
|
__exportStar(require("./requests/collection/pinned-collections"), exports);
|
|
302
302
|
__exportStar(require("./requests/collection/ranks"), exports);
|
|
303
303
|
__exportStar(require("./requests/collection/shareholder.dto"), exports);
|
|
304
|
+
__exportStar(require("./requests/lending/blend.dto"), exports);
|
|
304
305
|
__exportStar(require("./requests/lending/hatom-info.dto"), exports);
|
|
305
306
|
__exportStar(require("./requests/lending/lending-governance-proposal.filter"), exports);
|
|
306
307
|
__exportStar(require("./requests/lending/lending-indexes.dto"), exports);
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Blend V2 → XOXNO migration detection types.
|
|
3
|
+
*
|
|
4
|
+
* A live read of a user's Blend pool position (`get_positions` → shares,
|
|
5
|
+
* converted to underlying via each reserve's 12-decimal `b_rate`/`d_rate`),
|
|
6
|
+
* annotated with whether each leg can migrate into the XOXNO controller.
|
|
7
|
+
*
|
|
8
|
+
* A debt leg is migratable only when the XOXNO market can flash-borrow it
|
|
9
|
+
* (zero-fee `create_strategy`): the asset is a borrowable market here AND the
|
|
10
|
+
* pool has enough free liquidity within its borrow cap / max utilization.
|
|
11
|
+
*/
|
|
12
|
+
/** Why a position leg cannot migrate into XOXNO. */
|
|
13
|
+
export type BlendMigrateBlockReason = 'not_a_market' | 'market_inactive' | 'not_collateralizable' | 'not_borrowable' | 'insufficient_liquidity' | 'borrow_cap' | 'max_utilization';
|
|
14
|
+
/** One asset leg of a Blend position, in underlying token units. */
|
|
15
|
+
export declare class BlendLeg {
|
|
16
|
+
token: string;
|
|
17
|
+
symbol: string;
|
|
18
|
+
decimals: number;
|
|
19
|
+
amount: string;
|
|
20
|
+
amountShort: number;
|
|
21
|
+
usd: number;
|
|
22
|
+
}
|
|
23
|
+
/** Per-leg migratability verdict. */
|
|
24
|
+
export declare class BlendLegMigratability {
|
|
25
|
+
token: string;
|
|
26
|
+
role: 'collateral' | 'supply' | 'debt';
|
|
27
|
+
migratable: boolean;
|
|
28
|
+
reason?: BlendMigrateBlockReason;
|
|
29
|
+
}
|
|
30
|
+
/** A user's full Blend position + XOXNO migratability annotations. */
|
|
31
|
+
export declare class BlendUserPosition {
|
|
32
|
+
address: string;
|
|
33
|
+
blendPool: string;
|
|
34
|
+
collateral: BlendLeg[];
|
|
35
|
+
supply: BlendLeg[];
|
|
36
|
+
debt: BlendLeg[];
|
|
37
|
+
legs: BlendLegMigratability[];
|
|
38
|
+
migratable: boolean;
|
|
39
|
+
empty: boolean;
|
|
40
|
+
}
|
|
41
|
+
/** One debt asset the migration repays via a zero-fee XOXNO flash borrow. */
|
|
42
|
+
export declare class BlendDebtCap {
|
|
43
|
+
token: string;
|
|
44
|
+
cap: string;
|
|
45
|
+
}
|
|
46
|
+
/** Chain-agnostic args for `migrate_from_blend`. */
|
|
47
|
+
export declare class MigrateFromBlendArgs {
|
|
48
|
+
blendPool: string;
|
|
49
|
+
accountId: string;
|
|
50
|
+
eModeCategory: number;
|
|
51
|
+
collateralTokens: string[];
|
|
52
|
+
supplyTokens: string[];
|
|
53
|
+
debtCaps: BlendDebtCap[];
|
|
54
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
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.MigrateFromBlendArgs = exports.BlendDebtCap = exports.BlendUserPosition = exports.BlendLegMigratability = exports.BlendLeg = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const BLEND_BLOCK_REASONS = [
|
|
15
|
+
'not_a_market',
|
|
16
|
+
'market_inactive',
|
|
17
|
+
'not_collateralizable',
|
|
18
|
+
'not_borrowable',
|
|
19
|
+
'insufficient_liquidity',
|
|
20
|
+
'borrow_cap',
|
|
21
|
+
'max_utilization',
|
|
22
|
+
];
|
|
23
|
+
/** One asset leg of a Blend position, in underlying token units. */
|
|
24
|
+
class BlendLeg {
|
|
25
|
+
}
|
|
26
|
+
exports.BlendLeg = BlendLeg;
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, swagger_1.ApiProperty)({ description: 'Underlying asset contract address (SAC/SEP-41)' }),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], BlendLeg.prototype, "token", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, swagger_1.ApiProperty)({ description: 'Asset symbol', example: 'XLM' }),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], BlendLeg.prototype, "symbol", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, swagger_1.ApiProperty)({ description: 'Asset decimals', example: 7 }),
|
|
37
|
+
__metadata("design:type", Number)
|
|
38
|
+
], BlendLeg.prototype, "decimals", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, swagger_1.ApiProperty)({
|
|
41
|
+
description: 'Underlying amount in base units (decimal string)',
|
|
42
|
+
example: '5000000000',
|
|
43
|
+
}),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], BlendLeg.prototype, "amount", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, swagger_1.ApiProperty)({ description: 'Underlying amount, human-readable', example: 500 }),
|
|
48
|
+
__metadata("design:type", Number)
|
|
49
|
+
], BlendLeg.prototype, "amountShort", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, swagger_1.ApiProperty)({ description: 'USD value of the leg', example: 106.6 }),
|
|
52
|
+
__metadata("design:type", Number)
|
|
53
|
+
], BlendLeg.prototype, "usd", void 0);
|
|
54
|
+
/** Per-leg migratability verdict. */
|
|
55
|
+
class BlendLegMigratability {
|
|
56
|
+
}
|
|
57
|
+
exports.BlendLegMigratability = BlendLegMigratability;
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, swagger_1.ApiProperty)({ description: 'Underlying asset contract address' }),
|
|
60
|
+
__metadata("design:type", String)
|
|
61
|
+
], BlendLegMigratability.prototype, "token", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, swagger_1.ApiProperty)({ description: 'Position role on Blend', enum: ['collateral', 'supply', 'debt'] }),
|
|
64
|
+
__metadata("design:type", String)
|
|
65
|
+
], BlendLegMigratability.prototype, "role", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, swagger_1.ApiProperty)({ description: 'Whether this leg can migrate into XOXNO' }),
|
|
68
|
+
__metadata("design:type", Boolean)
|
|
69
|
+
], BlendLegMigratability.prototype, "migratable", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, swagger_1.ApiProperty)({
|
|
72
|
+
description: 'Why the leg is blocked (absent when migratable)',
|
|
73
|
+
enum: BLEND_BLOCK_REASONS,
|
|
74
|
+
required: false,
|
|
75
|
+
}),
|
|
76
|
+
__metadata("design:type", String)
|
|
77
|
+
], BlendLegMigratability.prototype, "reason", void 0);
|
|
78
|
+
/** A user's full Blend position + XOXNO migratability annotations. */
|
|
79
|
+
class BlendUserPosition {
|
|
80
|
+
}
|
|
81
|
+
exports.BlendUserPosition = BlendUserPosition;
|
|
82
|
+
__decorate([
|
|
83
|
+
(0, swagger_1.ApiProperty)({ description: 'User address (Stellar G…)' }),
|
|
84
|
+
__metadata("design:type", String)
|
|
85
|
+
], BlendUserPosition.prototype, "address", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, swagger_1.ApiProperty)({ description: 'Blend pool contract address' }),
|
|
88
|
+
__metadata("design:type", String)
|
|
89
|
+
], BlendUserPosition.prototype, "blendPool", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
(0, swagger_1.ApiProperty)({ type: () => BlendLeg, isArray: true }),
|
|
92
|
+
__metadata("design:type", Array)
|
|
93
|
+
], BlendUserPosition.prototype, "collateral", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
(0, swagger_1.ApiProperty)({ type: () => BlendLeg, isArray: true }),
|
|
96
|
+
__metadata("design:type", Array)
|
|
97
|
+
], BlendUserPosition.prototype, "supply", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, swagger_1.ApiProperty)({ type: () => BlendLeg, isArray: true }),
|
|
100
|
+
__metadata("design:type", Array)
|
|
101
|
+
], BlendUserPosition.prototype, "debt", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, swagger_1.ApiProperty)({ type: () => BlendLegMigratability, isArray: true }),
|
|
104
|
+
__metadata("design:type", Array)
|
|
105
|
+
], BlendUserPosition.prototype, "legs", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
(0, swagger_1.ApiProperty)({
|
|
108
|
+
description: 'True when ≥1 leg is migratable AND every debt leg is flash-borrowable by XOXNO',
|
|
109
|
+
}),
|
|
110
|
+
__metadata("design:type", Boolean)
|
|
111
|
+
], BlendUserPosition.prototype, "migratable", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
(0, swagger_1.ApiProperty)({ description: 'True when the user holds no Blend position' }),
|
|
114
|
+
__metadata("design:type", Boolean)
|
|
115
|
+
], BlendUserPosition.prototype, "empty", void 0);
|
|
116
|
+
/** One debt asset the migration repays via a zero-fee XOXNO flash borrow. */
|
|
117
|
+
class BlendDebtCap {
|
|
118
|
+
}
|
|
119
|
+
exports.BlendDebtCap = BlendDebtCap;
|
|
120
|
+
__decorate([
|
|
121
|
+
(0, swagger_1.ApiProperty)({ description: 'Debt asset contract address' }),
|
|
122
|
+
__metadata("design:type", String)
|
|
123
|
+
], BlendDebtCap.prototype, "token", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
(0, swagger_1.ApiProperty)({
|
|
126
|
+
description: 'Repay cap in base units (decimal string); excess is refunded on-chain',
|
|
127
|
+
example: '200500000',
|
|
128
|
+
}),
|
|
129
|
+
__metadata("design:type", String)
|
|
130
|
+
], BlendDebtCap.prototype, "cap", void 0);
|
|
131
|
+
/** Chain-agnostic args for `migrate_from_blend`. */
|
|
132
|
+
class MigrateFromBlendArgs {
|
|
133
|
+
}
|
|
134
|
+
exports.MigrateFromBlendArgs = MigrateFromBlendArgs;
|
|
135
|
+
__decorate([
|
|
136
|
+
(0, swagger_1.ApiProperty)({ description: 'Blend pool contract address' }),
|
|
137
|
+
__metadata("design:type", String)
|
|
138
|
+
], MigrateFromBlendArgs.prototype, "blendPool", void 0);
|
|
139
|
+
__decorate([
|
|
140
|
+
(0, swagger_1.ApiProperty)({
|
|
141
|
+
description: 'Existing XOXNO account id, or "0" to create a new account',
|
|
142
|
+
example: '0',
|
|
143
|
+
}),
|
|
144
|
+
__metadata("design:type", String)
|
|
145
|
+
], MigrateFromBlendArgs.prototype, "accountId", void 0);
|
|
146
|
+
__decorate([
|
|
147
|
+
(0, swagger_1.ApiProperty)({ description: 'eMode category to enter (0 = none)', example: 0 }),
|
|
148
|
+
__metadata("design:type", Number)
|
|
149
|
+
], MigrateFromBlendArgs.prototype, "eModeCategory", void 0);
|
|
150
|
+
__decorate([
|
|
151
|
+
(0, swagger_1.ApiProperty)({
|
|
152
|
+
description: 'Collateral assets to withdraw from Blend and re-collateralize',
|
|
153
|
+
type: () => String,
|
|
154
|
+
isArray: true,
|
|
155
|
+
}),
|
|
156
|
+
__metadata("design:type", Array)
|
|
157
|
+
], MigrateFromBlendArgs.prototype, "collateralTokens", void 0);
|
|
158
|
+
__decorate([
|
|
159
|
+
(0, swagger_1.ApiProperty)({
|
|
160
|
+
description: 'Non-collateral supply assets to withdraw from Blend and re-supply',
|
|
161
|
+
type: () => String,
|
|
162
|
+
isArray: true,
|
|
163
|
+
}),
|
|
164
|
+
__metadata("design:type", Array)
|
|
165
|
+
], MigrateFromBlendArgs.prototype, "supplyTokens", void 0);
|
|
166
|
+
__decorate([
|
|
167
|
+
(0, swagger_1.ApiProperty)({ type: () => BlendDebtCap, isArray: true }),
|
|
168
|
+
__metadata("design:type", Array)
|
|
169
|
+
], MigrateFromBlendArgs.prototype, "debtCaps", void 0);
|