@t2000/sdk 0.18.10 → 0.18.11
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 +17 -2
- package/dist/adapters/index.cjs +458 -1196
- package/dist/adapters/index.cjs.map +1 -1
- package/dist/adapters/index.d.cts +1 -1
- package/dist/adapters/index.d.ts +1 -1
- package/dist/adapters/index.js +458 -1196
- package/dist/adapters/index.js.map +1 -1
- package/dist/{index-Co0lp99l.d.cts → index-YBZIJANR.d.cts} +6 -20
- package/dist/{index-Co0lp99l.d.ts → index-YBZIJANR.d.ts} +6 -20
- package/dist/index.cjs +463 -1202
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +463 -1202
- package/dist/index.js.map +1 -1
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -384,11 +384,26 @@ try {
|
|
|
384
384
|
|
|
385
385
|
Common error codes: `INSUFFICIENT_BALANCE` · `INVALID_ADDRESS` · `INVALID_AMOUNT` · `HEALTH_FACTOR_TOO_LOW` · `NO_COLLATERAL` · `WALLET_NOT_FOUND` · `WALLET_LOCKED` · `WALLET_EXISTS` · `SIMULATION_FAILED` · `TRANSACTION_FAILED` · `PROTOCOL_PAUSED` · `INSUFFICIENT_GAS` · `SLIPPAGE_EXCEEDED` · `ASSET_NOT_SUPPORTED` · `WITHDRAW_WOULD_LIQUIDATE` · `AUTO_TOPUP_FAILED` · `GAS_STATION_UNAVAILABLE`
|
|
386
386
|
|
|
387
|
+
## Protocol SDKs
|
|
388
|
+
|
|
389
|
+
t2000 uses official protocol SDKs for reliable on-chain data. All position amounts, USD values, and rates come directly from the SDKs — no hand-rolled contract parsing.
|
|
390
|
+
|
|
391
|
+
| Protocol | SDK | Used for |
|
|
392
|
+
|----------|-----|----------|
|
|
393
|
+
| NAVI | `@naviprotocol/lending` | Lending positions, deposits, withdrawals, borrows, rewards |
|
|
394
|
+
| Suilend | `@suilend/sdk` | Lending positions, obligation management, rewards |
|
|
395
|
+
| Cetus | `@cetusprotocol/aggregator-sdk` (V3) | DEX aggregation, token swaps |
|
|
396
|
+
|
|
397
|
+
Each `PositionEntry` includes an `amountUsd` field populated by the SDK, giving accurate USD valuations for all assets including non-stablecoins (ETH, SUI, BTC, GOLD).
|
|
398
|
+
|
|
387
399
|
## Testing
|
|
388
400
|
|
|
389
401
|
```bash
|
|
390
|
-
# Run all SDK unit tests (
|
|
402
|
+
# Run all SDK unit tests (568 tests)
|
|
391
403
|
pnpm --filter @t2000/sdk test
|
|
404
|
+
|
|
405
|
+
# Run smoke tests against mainnet RPC (read-only, no transactions)
|
|
406
|
+
SMOKE=1 pnpm --filter @t2000/sdk test -- src/__smoke__
|
|
392
407
|
```
|
|
393
408
|
|
|
394
409
|
| Test File | Coverage |
|
|
@@ -406,7 +421,7 @@ pnpm --filter @t2000/sdk test
|
|
|
406
421
|
| `compliance.test.ts` | Adapter contract compliance (49 checks across all adapters) |
|
|
407
422
|
| `registry.test.ts` | Best rates, multi-protocol routing, quote aggregation |
|
|
408
423
|
| `cetus.test.ts` | Cetus swap adapter (metadata, quotes, transaction building) |
|
|
409
|
-
| `suilend.test.ts` | Suilend adapter (rates, positions,
|
|
424
|
+
| `suilend.test.ts` | Suilend adapter (rates, positions, health, SDK mocks) |
|
|
410
425
|
| `t2000.integration.test.ts` | End-to-end flows (save, withdraw, borrow, repay, rebalance, auto-swap) |
|
|
411
426
|
| `protocolFee.test.ts` | Protocol fee calculation and collection |
|
|
412
427
|
| `sentinel.test.ts` | Sentinel attack flow, listing, fee parsing |
|