@t2000/sdk 0.18.0 → 0.18.4
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/adapters/index.cjs +6 -1
- package/dist/adapters/index.cjs.map +1 -1
- package/dist/adapters/index.js +6 -1
- package/dist/adapters/index.js.map +1 -1
- package/dist/index.cjs +24 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +24 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/adapters/index.js
CHANGED
|
@@ -210,15 +210,20 @@ var ProtocolRegistry = class {
|
|
|
210
210
|
}
|
|
211
211
|
async allPositions(address) {
|
|
212
212
|
const results = [];
|
|
213
|
+
const errors = [];
|
|
213
214
|
for (const adapter of this.lending.values()) {
|
|
214
215
|
try {
|
|
215
216
|
const positions = await adapter.getPositions(address);
|
|
216
217
|
if (positions.supplies.length > 0 || positions.borrows.length > 0) {
|
|
217
218
|
results.push({ protocol: adapter.name, protocolId: adapter.id, positions });
|
|
218
219
|
}
|
|
219
|
-
} catch {
|
|
220
|
+
} catch (err) {
|
|
221
|
+
errors.push(`${adapter.name}: ${err instanceof Error ? err.message : String(err)}`);
|
|
220
222
|
}
|
|
221
223
|
}
|
|
224
|
+
if (results.length === 0 && errors.length > 0) {
|
|
225
|
+
throw new T2000Error("PROTOCOL_UNAVAILABLE", `Protocol queries failed (${errors.length}/${this.lending.size}): ${errors.join("; ")}`);
|
|
226
|
+
}
|
|
222
227
|
return results;
|
|
223
228
|
}
|
|
224
229
|
getLending(id) {
|