@xoxno/types 1.0.402 → 1.0.404
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/enums/index.d.ts +1 -0
- package/dist/enums/index.js +1 -0
- package/dist/enums/lending.enum.d.ts +10 -0
- package/dist/enums/lending.enum.js +13 -1
- package/dist/enums/stellar-lending-topic.enum.d.ts +32 -0
- package/dist/enums/stellar-lending-topic.enum.js +36 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/requests/lending/stellar-lending-admin-args.dto.d.ts +77 -0
- package/dist/requests/lending/stellar-lending-admin-args.dto.js +318 -0
- package/dist/requests/lending/stellar-lending-args.dto.d.ts +5 -0
- package/dist/requests/lending/stellar-lending-args.dto.js +14 -0
- package/dist/requests/lending/stellar-lending-events.dto.d.ts +232 -0
- package/dist/requests/lending/stellar-lending-events.dto.js +649 -0
- package/package.json +1 -1
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { AssetConfigRawDto } from './stellar-lending-admin-args.dto';
|
|
2
|
+
import { StellarLendingOracleUpdateStruct } from '../../cosmos-db/documents/lending/lending-oracle';
|
|
3
|
+
/**
|
|
4
|
+
* Decoded payloads for the 21 XOXNO Stellar lending controller
|
|
5
|
+
* `#[contractevent]`s (see `rs-lending-xlm/common/src/events.rs`).
|
|
6
|
+
*
|
|
7
|
+
* These are the normalized shapes the `@xoxno/sdk-js` decoder registry
|
|
8
|
+
* produces after funnelling the Soroban event `data` through
|
|
9
|
+
* `scValToNative`: i128/u128/u64 ids and amounts are decimal strings,
|
|
10
|
+
* u32 counts/bps are numbers, addresses/symbols are strings, int-enums are
|
|
11
|
+
* mapped to their string enum, and absent Soroban `Option`s are `undefined`.
|
|
12
|
+
*
|
|
13
|
+
* Borrow-side position deltas carry no collateral risk parameters: the
|
|
14
|
+
* contract zeroes `liquidation_threshold`/`liquidation_bonus`/`loan_to_value`
|
|
15
|
+
* for debt positions, so the decoder surfaces them as `undefined` (not 0) to
|
|
16
|
+
* stop consumers recording a spurious 0% threshold. There is no
|
|
17
|
+
* `liquidationFeesBps` on the delta — that field does not exist on-chain.
|
|
18
|
+
*/
|
|
19
|
+
export declare class StellarMarketStateSnapshot {
|
|
20
|
+
asset: string;
|
|
21
|
+
timestamp: number;
|
|
22
|
+
supplyIndexRay: string;
|
|
23
|
+
borrowIndexRay: string;
|
|
24
|
+
reservesRay: string;
|
|
25
|
+
suppliedRay: string;
|
|
26
|
+
borrowedRay: string;
|
|
27
|
+
revenueRay: string;
|
|
28
|
+
assetPriceWad?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare class StellarEventAccountAttributes {
|
|
31
|
+
owner: string;
|
|
32
|
+
isIsolatedPosition: boolean;
|
|
33
|
+
eModeCategoryId: number;
|
|
34
|
+
mode: 'None' | 'Multiply' | 'Long' | 'Short';
|
|
35
|
+
isolatedToken?: string;
|
|
36
|
+
}
|
|
37
|
+
export declare class StellarEventPositionDelta {
|
|
38
|
+
action: string;
|
|
39
|
+
positionType: 'Deposit' | 'Borrow';
|
|
40
|
+
asset: string;
|
|
41
|
+
scaledAmountRay: string;
|
|
42
|
+
indexRay: string;
|
|
43
|
+
amount: string;
|
|
44
|
+
assetPriceWad?: string;
|
|
45
|
+
liquidationThresholdBps?: number;
|
|
46
|
+
liquidationBonusBps?: number;
|
|
47
|
+
loanToValueBps?: number;
|
|
48
|
+
}
|
|
49
|
+
export declare class StellarEventDebtCeilingEntry {
|
|
50
|
+
asset: string;
|
|
51
|
+
totalDebtUsdWad: string;
|
|
52
|
+
}
|
|
53
|
+
export declare class StellarEventEModeCategory {
|
|
54
|
+
categoryId: number;
|
|
55
|
+
loanToValueBps: number;
|
|
56
|
+
liquidationThresholdBps: number;
|
|
57
|
+
liquidationBonusBps: number;
|
|
58
|
+
isDeprecated: boolean;
|
|
59
|
+
}
|
|
60
|
+
export declare class StellarEModeAssetConfig {
|
|
61
|
+
isCollateralizable: boolean;
|
|
62
|
+
isBorrowable: boolean;
|
|
63
|
+
}
|
|
64
|
+
export declare class StellarCreateMarketEvent {
|
|
65
|
+
baseAsset: string;
|
|
66
|
+
maxBorrowRate: string;
|
|
67
|
+
baseBorrowRate: string;
|
|
68
|
+
slope1: string;
|
|
69
|
+
slope2: string;
|
|
70
|
+
slope3: string;
|
|
71
|
+
midUtilization: string;
|
|
72
|
+
optimalUtilization: string;
|
|
73
|
+
reserveFactor: number;
|
|
74
|
+
marketAddress: string;
|
|
75
|
+
config: AssetConfigRawDto;
|
|
76
|
+
}
|
|
77
|
+
export declare class StellarUpdateMarketParamsEvent {
|
|
78
|
+
asset: string;
|
|
79
|
+
maxBorrowRateRay: string;
|
|
80
|
+
baseBorrowRateRay: string;
|
|
81
|
+
slope1Ray: string;
|
|
82
|
+
slope2Ray: string;
|
|
83
|
+
slope3Ray: string;
|
|
84
|
+
midUtilizationRay: string;
|
|
85
|
+
optimalUtilizationRay: string;
|
|
86
|
+
reserveFactorBps: number;
|
|
87
|
+
}
|
|
88
|
+
export declare class StellarUpdateMarketStateBatchEvent {
|
|
89
|
+
updates: StellarMarketStateSnapshot[];
|
|
90
|
+
}
|
|
91
|
+
export declare class StellarUpdatePositionBatchEvent {
|
|
92
|
+
accountId: string;
|
|
93
|
+
accountAttributes: StellarEventAccountAttributes;
|
|
94
|
+
updates: StellarEventPositionDelta[];
|
|
95
|
+
}
|
|
96
|
+
export declare class StellarFlashLoanEvent {
|
|
97
|
+
asset: string;
|
|
98
|
+
receiver: string;
|
|
99
|
+
caller: string;
|
|
100
|
+
amount: string;
|
|
101
|
+
fee: string;
|
|
102
|
+
}
|
|
103
|
+
export declare class StellarUpdateAssetConfigEvent {
|
|
104
|
+
asset: string;
|
|
105
|
+
config: AssetConfigRawDto;
|
|
106
|
+
}
|
|
107
|
+
export declare class StellarUpdateAssetOracleEvent {
|
|
108
|
+
asset: string;
|
|
109
|
+
oracle: StellarLendingOracleUpdateStruct;
|
|
110
|
+
}
|
|
111
|
+
export declare class StellarUpdateEModeCategoryEvent {
|
|
112
|
+
category: StellarEventEModeCategory;
|
|
113
|
+
}
|
|
114
|
+
export declare class StellarUpdateEModeAssetEvent {
|
|
115
|
+
asset: string;
|
|
116
|
+
config: StellarEModeAssetConfig;
|
|
117
|
+
categoryId: number;
|
|
118
|
+
}
|
|
119
|
+
export declare class StellarRemoveEModeAssetEvent {
|
|
120
|
+
asset: string;
|
|
121
|
+
categoryId: number;
|
|
122
|
+
}
|
|
123
|
+
export declare class StellarUpdateDebtCeilingEvent {
|
|
124
|
+
asset: string;
|
|
125
|
+
totalDebtUsdWad: string;
|
|
126
|
+
}
|
|
127
|
+
export declare class StellarUpdateDebtCeilingBatchEvent {
|
|
128
|
+
updates: StellarEventDebtCeilingEntry[];
|
|
129
|
+
}
|
|
130
|
+
export declare class StellarCleanBadDebtEvent {
|
|
131
|
+
accountId: string;
|
|
132
|
+
totalBorrowUsdWad: string;
|
|
133
|
+
totalCollateralUsdWad: string;
|
|
134
|
+
}
|
|
135
|
+
export declare class StellarInitialMultiplyPaymentEvent {
|
|
136
|
+
token: string;
|
|
137
|
+
amount: string;
|
|
138
|
+
usdValueWad: string;
|
|
139
|
+
accountId: string;
|
|
140
|
+
}
|
|
141
|
+
export declare class StellarApproveTokenEvent {
|
|
142
|
+
wasmHash: string;
|
|
143
|
+
approved: boolean;
|
|
144
|
+
}
|
|
145
|
+
export declare class StellarUpdateAggregatorEvent {
|
|
146
|
+
aggregator: string;
|
|
147
|
+
}
|
|
148
|
+
export declare class StellarUpdateAccumulatorEvent {
|
|
149
|
+
accumulator: string;
|
|
150
|
+
}
|
|
151
|
+
export declare class StellarUpdatePoolTemplateEvent {
|
|
152
|
+
wasmHash: string;
|
|
153
|
+
}
|
|
154
|
+
export declare class StellarUpdatePositionLimitsEvent {
|
|
155
|
+
maxSupplyPositions: number;
|
|
156
|
+
maxBorrowPositions: number;
|
|
157
|
+
}
|
|
158
|
+
export declare class StellarOracleDisabledEvent {
|
|
159
|
+
asset: string;
|
|
160
|
+
}
|
|
161
|
+
export declare class StellarOracleTwapDegradedEvent {
|
|
162
|
+
oracle: string;
|
|
163
|
+
reasonCode: number;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Discriminated union of every decoded Stellar lending event, keyed by the
|
|
167
|
+
* `"<domain>:<action>"` topic. Narrow on `topic` to access the typed `data`.
|
|
168
|
+
*/
|
|
169
|
+
export type StellarLendingDecodedEvent = {
|
|
170
|
+
topic: 'market:create';
|
|
171
|
+
data: StellarCreateMarketEvent;
|
|
172
|
+
} | {
|
|
173
|
+
topic: 'market:params_update';
|
|
174
|
+
data: StellarUpdateMarketParamsEvent;
|
|
175
|
+
} | {
|
|
176
|
+
topic: 'market:batch_state_update';
|
|
177
|
+
data: StellarUpdateMarketStateBatchEvent;
|
|
178
|
+
} | {
|
|
179
|
+
topic: 'position:batch_update';
|
|
180
|
+
data: StellarUpdatePositionBatchEvent;
|
|
181
|
+
} | {
|
|
182
|
+
topic: 'position:flash_loan';
|
|
183
|
+
data: StellarFlashLoanEvent;
|
|
184
|
+
} | {
|
|
185
|
+
topic: 'config:asset';
|
|
186
|
+
data: StellarUpdateAssetConfigEvent;
|
|
187
|
+
} | {
|
|
188
|
+
topic: 'config:oracle';
|
|
189
|
+
data: StellarUpdateAssetOracleEvent;
|
|
190
|
+
} | {
|
|
191
|
+
topic: 'config:emode_category';
|
|
192
|
+
data: StellarUpdateEModeCategoryEvent;
|
|
193
|
+
} | {
|
|
194
|
+
topic: 'config:emode_asset';
|
|
195
|
+
data: StellarUpdateEModeAssetEvent;
|
|
196
|
+
} | {
|
|
197
|
+
topic: 'config:remove_emode_asset';
|
|
198
|
+
data: StellarRemoveEModeAssetEvent;
|
|
199
|
+
} | {
|
|
200
|
+
topic: 'debt:ceiling_update';
|
|
201
|
+
data: StellarUpdateDebtCeilingEvent;
|
|
202
|
+
} | {
|
|
203
|
+
topic: 'debt:ceiling_batch_update';
|
|
204
|
+
data: StellarUpdateDebtCeilingBatchEvent;
|
|
205
|
+
} | {
|
|
206
|
+
topic: 'debt:bad_debt';
|
|
207
|
+
data: StellarCleanBadDebtEvent;
|
|
208
|
+
} | {
|
|
209
|
+
topic: 'strategy:initial_payment';
|
|
210
|
+
data: StellarInitialMultiplyPaymentEvent;
|
|
211
|
+
} | {
|
|
212
|
+
topic: 'config:approve_token';
|
|
213
|
+
data: StellarApproveTokenEvent;
|
|
214
|
+
} | {
|
|
215
|
+
topic: 'config:aggregator';
|
|
216
|
+
data: StellarUpdateAggregatorEvent;
|
|
217
|
+
} | {
|
|
218
|
+
topic: 'config:accumulator';
|
|
219
|
+
data: StellarUpdateAccumulatorEvent;
|
|
220
|
+
} | {
|
|
221
|
+
topic: 'config:pool_template';
|
|
222
|
+
data: StellarUpdatePoolTemplateEvent;
|
|
223
|
+
} | {
|
|
224
|
+
topic: 'config:position_limits';
|
|
225
|
+
data: StellarUpdatePositionLimitsEvent;
|
|
226
|
+
} | {
|
|
227
|
+
topic: 'config:oracle_disabled';
|
|
228
|
+
data: StellarOracleDisabledEvent;
|
|
229
|
+
} | {
|
|
230
|
+
topic: 'oracle:twap_degraded';
|
|
231
|
+
data: StellarOracleTwapDegradedEvent;
|
|
232
|
+
};
|