@xoxno/sdk-js 1.0.225 → 1.0.227
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/README.md +39 -0
- package/dist/cjs/sdk/stellar/index.d.ts +1 -0
- package/dist/cjs/sdk/stellar/read/__tests__/client.test.d.ts +1 -0
- package/dist/cjs/sdk/stellar/read/client.d.ts +19 -0
- package/dist/cjs/sdk/stellar/read/index.d.ts +4 -0
- package/dist/cjs/sdk/stellar/read/schemas.d.ts +375 -0
- package/dist/cjs/sdk/stellar/read/types.d.ts +85 -0
- package/dist/esm/sdk/stellar/index.js +1 -0
- package/dist/esm/sdk/stellar/read/client.js +82 -0
- package/dist/esm/sdk/stellar/read/index.js +3 -0
- package/dist/esm/sdk/stellar/read/schemas.js +163 -0
- package/dist/esm/sdk/stellar/read/types.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/sdk/stellar/index.cjs +1 -1
- package/dist/sdk/stellar/index.d.ts +1 -0
- package/dist/sdk/stellar/index.esm.js +1 -1
- package/dist/sdk/stellar/read/__tests__/client.test.d.ts +1 -0
- package/dist/sdk/stellar/read/client.d.ts +19 -0
- package/dist/sdk/stellar/read/index.cjs +1 -0
- package/dist/sdk/stellar/read/index.d.ts +4 -0
- package/dist/sdk/stellar/read/index.esm.js +1 -0
- package/dist/sdk/stellar/read/schemas.d.ts +375 -0
- package/dist/sdk/stellar/read/types.d.ts +85 -0
- package/package.json +19 -3
|
@@ -0,0 +1,163 @@
|
|
|
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
|
+
nftImage: {
|
|
99
|
+
...string,
|
|
100
|
+
format: 'uri',
|
|
101
|
+
description: 'Dynamic position SVG served by the network\'s XOXNO API.'
|
|
102
|
+
},
|
|
103
|
+
network,
|
|
104
|
+
spokeId: nullableNumber,
|
|
105
|
+
spokeName: nullableString,
|
|
106
|
+
supplied: {
|
|
107
|
+
type: 'array',
|
|
108
|
+
items: positionAsset
|
|
109
|
+
},
|
|
110
|
+
borrow: {
|
|
111
|
+
type: 'array',
|
|
112
|
+
items: positionAsset
|
|
113
|
+
},
|
|
114
|
+
hasDebt: {
|
|
115
|
+
...boolean,
|
|
116
|
+
nullable: true,
|
|
117
|
+
description: 'Null when account rows are unavailable.'
|
|
118
|
+
},
|
|
119
|
+
healthFactor: {
|
|
120
|
+
...nullableNumber,
|
|
121
|
+
description: 'Null without debt or when risk inputs are unavailable.'
|
|
122
|
+
},
|
|
123
|
+
borrowLimitUsd: nullableNumber,
|
|
124
|
+
availableBorrowUsd: {
|
|
125
|
+
...nullableNumber,
|
|
126
|
+
description: 'Account headroom, before per-market constraints.'
|
|
127
|
+
},
|
|
128
|
+
netApy: {
|
|
129
|
+
...nullableNumber,
|
|
130
|
+
description: 'Net annual yield divided by positive net equity; fraction.'
|
|
131
|
+
},
|
|
132
|
+
dataStatus
|
|
133
|
+
})
|
|
134
|
+
};
|
|
135
|
+
/** OpenAPI response schema for LendingAsset[]. Capacities are indexed estimates. */ export const lendingAssetsSchema = {
|
|
136
|
+
type: 'array',
|
|
137
|
+
items: object({
|
|
138
|
+
...token,
|
|
139
|
+
hubId: number,
|
|
140
|
+
hubName: string,
|
|
141
|
+
network,
|
|
142
|
+
supplyApy: {
|
|
143
|
+
...nullableNumber,
|
|
144
|
+
description: 'Fraction: 0.05 means 5%.'
|
|
145
|
+
},
|
|
146
|
+
borrowApy: {
|
|
147
|
+
...nullableNumber,
|
|
148
|
+
description: 'Fraction: 0.05 means 5%.'
|
|
149
|
+
},
|
|
150
|
+
priceUsd: nullableNumber,
|
|
151
|
+
priceStatus,
|
|
152
|
+
spokes: {
|
|
153
|
+
type: 'array',
|
|
154
|
+
items: spoke
|
|
155
|
+
},
|
|
156
|
+
dataStatus,
|
|
157
|
+
indexedAt: {
|
|
158
|
+
...number,
|
|
159
|
+
description: 'Pool state timestamp. Capacities are indexed snapshot estimates; prepare/simulate before signing.'
|
|
160
|
+
},
|
|
161
|
+
indexedLedger: number
|
|
162
|
+
})
|
|
163
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/** Render-ready REST data. Null means unavailable, never an inferred zero. */ export { };
|