@xoxno/sdk-js 1.0.212 → 1.0.214

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.
Files changed (52) hide show
  1. package/README.md +73 -42
  2. package/dist/cjs/index.d.ts +3 -3
  3. package/dist/cjs/sdk/index.d.ts +4 -4
  4. package/dist/cjs/sdk/stellar/__tests__/integration.test.d.ts +1 -0
  5. package/dist/cjs/sdk/stellar/admin.d.ts +28 -28
  6. package/dist/cjs/sdk/stellar/cctp.d.ts +2 -2
  7. package/dist/cjs/sdk/stellar/contracts.d.ts +98 -61
  8. package/dist/cjs/sdk/stellar/events/index.d.ts +2 -2
  9. package/dist/cjs/sdk/stellar/governance.d.ts +50 -49
  10. package/dist/cjs/sdk/stellar/index.d.ts +22 -14
  11. package/dist/cjs/sdk/stellar/lending-api-types.d.ts +943 -0
  12. package/dist/cjs/sdk/stellar/lending-read-types.d.ts +54 -269
  13. package/dist/cjs/sdk/stellar/lending-read.d.ts +279 -131
  14. package/dist/cjs/sdk/stellar/lending.d.ts +134 -63
  15. package/dist/cjs/sdk/stellar/prepare.d.ts +27 -7
  16. package/dist/cjs/sdk/stellar/quote.d.ts +16 -9
  17. package/dist/cjs/sdk/stellar/swap.d.ts +4 -5
  18. package/dist/cjs/sdk/stellar-schema.d.ts +5 -0
  19. package/dist/cjs/sdk/swagger.d.ts +96 -51
  20. package/dist/cjs/sdk/types.d.ts +2 -2
  21. package/dist/cjs/utils/api.d.ts +14 -4
  22. package/dist/cjs/utils/const.d.ts +0 -2
  23. package/dist/index.cjs +2 -1
  24. package/dist/index.cjs.LICENSE.txt +8 -0
  25. package/dist/index.d.ts +3 -3
  26. package/dist/index.esm.js +2 -1
  27. package/dist/index.esm.js.LICENSE.txt +8 -0
  28. package/dist/sdk/index.d.ts +4 -4
  29. package/dist/sdk/stellar/__tests__/integration.test.d.ts +1 -0
  30. package/dist/sdk/stellar/admin.d.ts +28 -28
  31. package/dist/sdk/stellar/cctp.d.ts +2 -2
  32. package/dist/sdk/stellar/contracts.d.ts +98 -61
  33. package/dist/sdk/stellar/events/index.d.ts +2 -2
  34. package/dist/sdk/stellar/governance.d.ts +50 -49
  35. package/dist/sdk/stellar/index.cjs +2 -1
  36. package/dist/sdk/stellar/index.cjs.LICENSE.txt +8 -0
  37. package/dist/sdk/stellar/index.d.ts +22 -14
  38. package/dist/sdk/stellar/index.esm.js +2 -1
  39. package/dist/sdk/stellar/index.esm.js.LICENSE.txt +8 -0
  40. package/dist/sdk/stellar/lending-api-types.d.ts +943 -0
  41. package/dist/sdk/stellar/lending-read-types.d.ts +54 -269
  42. package/dist/sdk/stellar/lending-read.d.ts +279 -131
  43. package/dist/sdk/stellar/lending.d.ts +134 -63
  44. package/dist/sdk/stellar/prepare.d.ts +27 -7
  45. package/dist/sdk/stellar/quote.d.ts +16 -9
  46. package/dist/sdk/stellar/swap.d.ts +4 -5
  47. package/dist/sdk/stellar-schema.d.ts +5 -0
  48. package/dist/sdk/swagger.d.ts +96 -51
  49. package/dist/sdk/types.d.ts +2 -2
  50. package/dist/utils/api.d.ts +14 -4
  51. package/dist/utils/const.d.ts +0 -2
  52. package/package.json +9 -4
@@ -1,276 +1,61 @@
1
- /**
2
- * Stellar lending read-API response shapes.
3
- *
4
- * These interfaces mirror the api-v2 `stellar-lending` response DTOs 1:1. The
5
- * SDK never imports from api-v2, so the shapes are duplicated here by hand. Doc
6
- * field types that already live in `@xoxno/types/stellar-lending` (governance
7
- * enums + proposal fields, the initial-payment multiplier) are imported rather
8
- * than re-declared.
9
- *
10
- * Numeric `*Wad`/`*Ray`/`*ScaledRay` fields cross the wire as decimal strings
11
- * (1e18 / 1e27 fixed-point); `*Short` fields are already human-readable numbers.
12
- */
13
- import type { AssetDto, ReserveDto, StellarAssetOracle, StellarGovernanceProposalField, StellarGovernanceProposalKind, StellarGovernanceProposalStatus, StellarGovernanceProposalTarget, StellarInitialPaymentMultiplier } from '@xoxno/types/stellar-lending';
14
- export type { StellarLendingContext, StellarAssetPage, StellarAssetPageGraphPoint, StellarAssetPageGraphSeries, StellarAssetPageMarket, } from '@xoxno/types/stellar-lending';
15
- /** Side selector for an asset's markets table. */
1
+ /** Public reader aliases. All response fields come from the generated API contract. */
2
+ import type * as Api from './lending-api-types.js';
3
+ import type { endpoints } from '../swagger.js';
4
+ export * from './lending-api-types.js';
5
+ export type { StellarApyRange } from '@xoxno/types/stellar-lending';
6
+ export type { StellarAssetOracle as StellarAssetOracleConfig } from '@xoxno/types/stellar-lending';
7
+ export type StellarLendingContext = Api.StellarLendingContextDto;
8
+ export type StellarAsset = Api.AssetDto;
9
+ export type StellarAssetMarket = Api.AssetMarketDto;
10
+ export type StellarHubAssetRow = Api.HubAssetDto;
11
+ export type StellarHub = Api.HubDto;
12
+ export type StellarSpokeMarket = Api.SpokeMarketDto;
13
+ export type StellarSpoke = Api.SpokeDto;
14
+ export type StellarReserveIrmCurve = Api.ReserveIrmCurveDto;
15
+ export type StellarReserve = Api.ReserveDto;
16
+ export type StellarTopHolder = Api.TopHolderDto;
17
+ export type StellarTopHolders = Api.TopHoldersDto;
18
+ export type StellarAccountPosition = Api.AccountPositionDto;
19
+ export type StellarAccountPositions = Api.AccountPositionsDto;
20
+ export type StellarGovernanceProposal = Api.GovernanceProposalDto;
21
+ export type StellarGovernanceProposalsPage = Api.GovernanceProposalsPageDto;
22
+ export type StellarMarketGraphPoint = Api.MarketGraphPointDto;
23
+ export type StellarFeeGraphPoint = Api.FeeGraphPointDto;
24
+ export type StellarMarketGraph = Api.MarketGraphDto;
25
+ export type StellarSpokeGraph = Api.SpokeGraphDto;
26
+ export type StellarSpokeGraphPoint = Api.SpokeGraphPointDto;
27
+ export type StellarAssetPage = Api.AssetPageDto;
28
+ export type StellarAssetPageMarket = Api.AssetMarketDto;
29
+ export type StellarAssetPageGraphPoint = Api.AssetPageGraphPointDto;
30
+ export type StellarAssetPageGraphSeries = Api.AssetPageGraphSeriesDto;
31
+ export type StellarAssetListItem = Api.StellarAssetListItemDto;
32
+ export type StellarHubListItem = Api.StellarHubListItemDto;
33
+ export type StellarSpokeListItem = Api.StellarSpokeListItemDto;
34
+ export type StellarReserveListItem = Api.StellarReserveListItemDto;
35
+ export type StellarUserActivityItem = Api.StellarUserActivityItemDto;
36
+ /** Asset-market action selector. */
16
37
  export type StellarLendingMarketSide = 'deposit' | 'borrow';
17
- /** Side selector for a reserve's top-holders list. */
38
+ /** Holder-list balance selector. Also used by holder distribution. */
18
39
  export type StellarLendingHoldersSide = 'deposits' | 'borrows';
19
- /** Composable AssetOracle persisted on an asset (from @xoxno/types). */
20
- export type StellarAssetOracleConfig = StellarAssetOracle;
21
- /** One (spoke, hub) market row for an asset's markets table. */
22
- export interface StellarAssetMarket {
23
- spokeId: number;
24
- hubId: number;
25
- asset: string;
26
- supplyApy: number;
27
- borrowApy: number;
28
- utilization: number;
29
- suppliedShort: number;
30
- borrowedShort: number;
31
- availableLiquidityShort: number;
32
- collateralFactorBps: number;
33
- liquidationThresholdBps: number;
34
- isCollateralizable: boolean;
35
- isBorrowable: boolean;
36
- }
37
- /** Asset overview header: shared API contract. */
38
- export type StellarAsset = AssetDto;
39
- /** One asset's liquidity on a hub, rendered as a hub opportunity row. */
40
- export interface StellarHubAssetRow {
41
- hubId: number;
42
- asset: string;
43
- supplyApy: number;
44
- borrowApy: number;
45
- utilization: number;
46
- suppliedShort: number;
47
- borrowedShort: number;
48
- availableLiquidityShort: number;
49
- isFlashloanable: boolean;
50
- }
51
- /** Hub overview: header totals + per-asset liquidity opportunities. */
52
- export interface StellarHub {
53
- hubId: number;
54
- isActive: boolean;
55
- name: string | null;
56
- totalDepositsUsd: string;
57
- totalBorrowsUsd: string;
58
- availableLiquidityUsd: string;
59
- utilization: number;
60
- assetCount: number;
61
- assets: StellarHubAssetRow[];
62
- }
63
- /** One reserve row within a spoke (risk truth joined with hub liquidity). */
64
- export interface StellarSpokeMarket {
65
- spokeId: number;
66
- hubId: number;
67
- asset: string;
68
- supplyApy: number;
69
- borrowApy: number;
70
- utilization: number;
71
- availableLiquidityShort: number;
72
- collateralFactorBps: number;
73
- liquidationThresholdBps: number;
74
- isCollateralizable: boolean;
75
- isBorrowable: boolean;
76
- paused: boolean;
77
- frozen: boolean;
78
- }
79
- /** Spoke overview: header totals, connected hubs, and per-reserve market table. */
80
- export interface StellarSpoke {
81
- spokeId: number;
82
- isDeprecated: boolean;
83
- name: string | null;
84
- totalDepositsUsd: string;
85
- totalBorrowsUsd: string;
86
- assetCount: number;
87
- connectedHubIds: number[];
88
- connectedHubCount: number;
89
- liquidationTargetHfWad: string;
90
- healthFactorForMaxBonusWad: string;
91
- liquidationBonusFactorBps: number;
92
- markets: StellarSpokeMarket[];
93
- }
94
- /** Interest-rate-model curve (ray-scaled), sourced from the HubAsset doc. */
95
- export interface StellarReserveIrmCurve {
96
- baseRateRay: string;
97
- slope1Ray: string;
98
- slope2Ray: string;
99
- slope3Ray: string;
100
- optimalUtilizationRay: string;
101
- midUtilizationRay: string;
102
- maxUtilizationRay: string;
103
- maxBorrowRateRay: string;
104
- reserveFactorBps: number;
105
- }
106
- /** Reserve detail page: shared API contract. */
107
- export type StellarReserve = ReserveDto;
108
- export interface StellarTopHolder {
109
- owner: string;
110
- accountId: string;
111
- scaledRay: string;
112
- amountShort: number;
113
- sharePct: number;
114
- }
115
- /** Top holders of a reserve, for one side (deposits or borrows). */
116
- export interface StellarTopHolders {
117
- spokeId: number;
118
- hubId: number;
119
- asset: string;
120
- side: StellarLendingHoldersSide;
121
- totalScaledRay: string;
122
- holders: StellarTopHolder[];
123
- }
124
- /** One account's position in one reserve. */
125
- export interface StellarAccountPosition {
126
- accountId: string;
127
- owner: string;
128
- spokeId: number;
129
- hubId: number;
130
- asset: string;
131
- positionMode: number;
132
- supplyScaledRay: string;
133
- borrowScaledRay: string;
134
- supplyIndexRay: string | null;
135
- borrowIndexRay: string | null;
136
- entryLtvBps: number;
137
- entryLiquidationThresholdBps: number;
138
- entryLiquidationBonusBps: number;
139
- entryLiquidationFeesBps: number;
140
- initialPaymentMultiplier: StellarInitialPaymentMultiplier | null;
141
- updatedAt: number;
142
- ledger: number;
143
- }
144
- /** All positions for an owner (cross-spoke/hub portfolio) or one account. */
145
- export interface StellarAccountPositions {
146
- positions: StellarAccountPosition[];
147
- }
148
- /** A timelock governance proposal on the Stellar lending governance contract. */
149
- export interface StellarGovernanceProposal {
150
- operationId: string;
151
- kind: StellarGovernanceProposalKind;
152
- status: StellarGovernanceProposalStatus;
153
- target: StellarGovernanceProposalTarget;
154
- targetAddress: string;
155
- functionName: string;
156
- summary: string;
157
- fields: StellarGovernanceProposalField[];
158
- assetAddress?: string;
159
- assetSymbol?: string;
160
- proposer: string;
161
- scheduledLedger: number;
162
- readyLedger: number;
163
- delayLedgers: number;
164
- expiresLedger: number;
165
- executedLedger?: number;
166
- cancelledLedger?: number;
167
- scheduledAt: number;
168
- executedAt?: number;
169
- cancelledAt?: number;
170
- scheduledTxHash: string;
171
- executedTxHash?: string;
172
- cancelledTxHash?: string;
173
- }
174
- /** Cursor-paginated page of governance proposals. */
175
- export interface StellarGovernanceProposalsPage {
176
- resources: StellarGovernanceProposal[];
177
- hasMoreResults: boolean;
178
- continuationToken: string;
179
- }
180
- /** One binned market-snapshot point for a graph series. */
181
- export interface StellarMarketGraphPoint {
182
- timestamp: string;
183
- hubId: number;
184
- spokeId: number | null;
185
- token: string;
186
- supplyApy: number;
187
- borrowApy: number;
188
- utilization: number;
189
- totalDepositsUsd: number;
190
- totalBorrowsUsd: number;
191
- availableLiquidityUsd: number;
192
- usdPrice: number;
193
- }
194
- /** One binned activity-derived fee/flash point. */
195
- export interface StellarFeeGraphPoint {
196
- timestamp: string;
197
- feeShort: number;
198
- usd: number;
199
- }
200
- /** A market-history graph: binned snapshot points (+ optional fee series). */
201
- export interface StellarMarketGraph {
202
- points: StellarMarketGraphPoint[];
203
- fees?: StellarFeeGraphPoint[];
204
- }
205
- /** Time-window + bin selector shared by every graph read. */
40
+ /** Time window for API charts. Dates are ISO-8601; bin examples: 1h, 1d. */
206
41
  export interface StellarMarketGraphQuery {
207
- /** Inclusive window start (ISO-8601). */
42
+ /** Window start. */
208
43
  from: string;
209
- /** Exclusive window end (ISO-8601). */
44
+ /** Window end. */
210
45
  to: string;
211
- /** Bin width as a timespan string (e.g. `1h`, `1d`). */
46
+ /** Kusto timespan, for example 1h or 1d. */
212
47
  bin: string;
213
48
  }
214
- /**
215
- * Config and admin state for one deployed contract, event-sourced by the
216
- * indexer from that contract's own config, pause, ownership and admin events.
217
- *
218
- * Every field is optional-by-absence: a contract only populates what its own
219
- * events carry, so a governance row leaves the controller fields null and vice
220
- * versa. `paused` is null until a pause or unpause has actually been observed,
221
- * which is materially different from a confirmed `false`.
222
- */
223
- export interface StellarContractConfig {
224
- contractAddress: string;
225
- wasmHash: string | null;
226
- accumulator: string | null;
227
- swapAggregator: string | null;
228
- priceAggregator: string | null;
229
- maxSupplyPositions: number | null;
230
- maxBorrowPositions: number | null;
231
- /** Raw 18-decimal WAD. */
232
- minBorrowCollateralUsdWad: string | null;
233
- paused: boolean | null;
234
- /** Governance timelock delay, in ledgers. */
235
- minDelayLedgers: number | null;
236
- owner: string | null;
237
- pendingOwner: string | null;
238
- admin: string | null;
239
- pendingAdmin: string | null;
240
- pendingAdminLiveUntilLedger: number | null;
241
- ledger: number;
242
- updatedAt: number;
243
- }
244
- /**
245
- * One access-control grant. Revocation flips `granted` rather than removing the
246
- * row, so a revoked grant stays queryable.
247
- */
248
- export interface StellarContractRole {
249
- contractAddress: string;
250
- /** On-chain role symbol, e.g. `ORACLE`, `PROPOSER`. */
251
- role: string;
252
- account: string;
253
- granted: boolean;
254
- caller: string | null;
255
- ledger: number;
256
- updatedAt: number;
257
- }
258
- /**
259
- * One position-authorization grant. A delegate may act on the owner's position,
260
- * so this is security-relevant state rather than display metadata.
261
- */
262
- export interface StellarAccountDelegate {
263
- accountId: number;
264
- owner: string;
265
- delegate: string;
266
- granted: boolean;
267
- ledger: number;
268
- updatedAt: number;
269
- }
270
- /** Approval state for one Blend pool, kept after revocation as `approved: false`. */
271
- export interface StellarBlendPool {
272
- pool: string;
273
- approved: boolean;
274
- ledger: number;
275
- updatedAt: number;
276
- }
49
+ export type StellarReservesParams = (typeof endpoints)['/stellar-lending/reserves']['input'];
50
+ export type StellarActivityQuery = (typeof endpoints)['/stellar-lending/users/:owner/activity']['input'];
51
+ export type StellarActivityPageQuery = (typeof endpoints)['/stellar-lending/users/:owner/activity/page']['input'];
52
+ export type StellarGovernanceQuery = (typeof endpoints)['/stellar-lending/governance/proposals']['input'];
53
+ export type StellarPositionsQuery = (typeof endpoints)['/stellar-lending/positions']['input'];
54
+ export type StellarRevenueQuery = (typeof endpoints)['/stellar-lending/revenue']['input'];
55
+ export type StellarFeeRevenueQuery = (typeof endpoints)['/stellar-lending/revenue/fees']['input'];
56
+ export type StellarParticipantsQuery = (typeof endpoints)['/stellar-lending/participants']['input'];
57
+ export type StellarLiquidationsQuery = (typeof endpoints)['/stellar-lending/liquidations']['input'];
58
+ export type StellarLiquidationsLeaderboardQuery = (typeof endpoints)['/stellar-lending/liquidations/leaderboard']['input'];
59
+ export type StellarVolumeQuery = (typeof endpoints)['/stellar-lending/volume']['input'];
60
+ export type StellarDistributionQuery = (typeof endpoints)['/stellar-lending/distribution']['input'];
61
+ export type StellarRateSpreadQuery = (typeof endpoints)['/stellar-lending/rate-spread']['input'];