@xoxno/sdk-js 1.0.225 → 1.0.226

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.
@@ -0,0 +1,158 @@
1
+ // Inline OpenAPI 3 schemas shared with servers; no decorators or runtime dependencies.
2
+ const string = {
3
+ type: 'string'
4
+ };
5
+ const number = {
6
+ type: 'number'
7
+ };
8
+ const boolean = {
9
+ type: 'boolean'
10
+ };
11
+ const nullableString = {
12
+ ...string,
13
+ nullable: true
14
+ };
15
+ const nullableNumber = {
16
+ ...number,
17
+ nullable: true
18
+ };
19
+ const network = {
20
+ ...string,
21
+ enum: [
22
+ 'mainnet',
23
+ 'testnet'
24
+ ]
25
+ };
26
+ const dataStatus = {
27
+ ...string,
28
+ enum: [
29
+ 'ready',
30
+ 'stale',
31
+ 'incomplete'
32
+ ]
33
+ };
34
+ function object(properties) {
35
+ return {
36
+ type: 'object',
37
+ required: Object.keys(properties),
38
+ properties
39
+ };
40
+ }
41
+ const token = {
42
+ sac: string,
43
+ symbol: string,
44
+ name: string,
45
+ decimals: nullableNumber,
46
+ logoUrl: nullableString
47
+ };
48
+ const priceStatus = object({
49
+ valid: boolean,
50
+ stale: boolean,
51
+ deviation: boolean,
52
+ timestamp: nullableNumber
53
+ });
54
+ const positionAsset = object({
55
+ ...token,
56
+ hubId: number,
57
+ hubName: string,
58
+ amountRaw: {
59
+ ...nullableString,
60
+ description: 'Integer token base units, never scaled shares.'
61
+ },
62
+ amount: nullableString,
63
+ apy: {
64
+ ...nullableNumber,
65
+ description: 'Fraction: 0.05 means 5%.'
66
+ },
67
+ priceUsd: nullableNumber,
68
+ valueUsd: nullableNumber,
69
+ priceStatus,
70
+ indexRay: nullableString,
71
+ indexedAt: number,
72
+ indexedLedger: number
73
+ });
74
+ const capacity = object({
75
+ amountRaw: nullableString,
76
+ amount: nullableString,
77
+ usd: nullableNumber
78
+ });
79
+ const spoke = object({
80
+ spokeId: number,
81
+ spokeName: string,
82
+ ltvBps: number,
83
+ supplyCapacity: capacity,
84
+ borrowCapacity: capacity,
85
+ canSupply: boolean,
86
+ canBeCollateral: boolean,
87
+ canBorrow: boolean,
88
+ canOpenAccount: {
89
+ ...boolean,
90
+ description: 'Spoke admits new accounts; other entry gates still apply.'
91
+ }
92
+ });
93
+ /** OpenAPI response schema for LendingPosition[]. Every property is required; nullable data remains explicit. */ export const lendingPositionsSchema = {
94
+ type: 'array',
95
+ items: object({
96
+ accountId: string,
97
+ nftContract: string,
98
+ network,
99
+ spokeId: nullableNumber,
100
+ spokeName: nullableString,
101
+ supplied: {
102
+ type: 'array',
103
+ items: positionAsset
104
+ },
105
+ borrow: {
106
+ type: 'array',
107
+ items: positionAsset
108
+ },
109
+ hasDebt: {
110
+ ...boolean,
111
+ nullable: true,
112
+ description: 'Null when account rows are unavailable.'
113
+ },
114
+ healthFactor: {
115
+ ...nullableNumber,
116
+ description: 'Null without debt or when risk inputs are unavailable.'
117
+ },
118
+ borrowLimitUsd: nullableNumber,
119
+ availableBorrowUsd: {
120
+ ...nullableNumber,
121
+ description: 'Account headroom, before per-market constraints.'
122
+ },
123
+ netApy: {
124
+ ...nullableNumber,
125
+ description: 'Net annual yield divided by positive net equity; fraction.'
126
+ },
127
+ dataStatus
128
+ })
129
+ };
130
+ /** OpenAPI response schema for LendingAsset[]. Capacities are indexed estimates. */ export const lendingAssetsSchema = {
131
+ type: 'array',
132
+ items: object({
133
+ ...token,
134
+ hubId: number,
135
+ hubName: string,
136
+ network,
137
+ supplyApy: {
138
+ ...nullableNumber,
139
+ description: 'Fraction: 0.05 means 5%.'
140
+ },
141
+ borrowApy: {
142
+ ...nullableNumber,
143
+ description: 'Fraction: 0.05 means 5%.'
144
+ },
145
+ priceUsd: nullableNumber,
146
+ priceStatus,
147
+ spokes: {
148
+ type: 'array',
149
+ items: spoke
150
+ },
151
+ dataStatus,
152
+ indexedAt: {
153
+ ...number,
154
+ description: 'Pool state timestamp. Capacities are indexed snapshot estimates; prepare/simulate before signing.'
155
+ },
156
+ indexedLedger: number
157
+ })
158
+ };
@@ -0,0 +1 @@
1
+ /** Render-ready REST data. Null means unavailable, never an inferred zero. */ export { };