@t2000/sdk 0.4.3 → 0.5.1

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.
@@ -1,5 +1,5 @@
1
1
  import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
2
- import { SuiClient } from '@mysten/sui/client';
2
+ import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
3
3
 
4
4
  type AdapterCapability = 'save' | 'withdraw' | 'borrow' | 'repay' | 'swap';
5
5
  interface AdapterTxResult {
@@ -43,7 +43,7 @@ interface LendingAdapter {
43
43
  readonly capabilities: readonly AdapterCapability[];
44
44
  readonly supportedAssets: readonly string[];
45
45
  readonly supportsSameAssetBorrow: boolean;
46
- init(client: SuiClient): Promise<void>;
46
+ init(client: SuiJsonRpcClient): Promise<void>;
47
47
  getRates(asset: string): Promise<LendingRates>;
48
48
  getPositions(address: string): Promise<AdapterPositions>;
49
49
  getHealth(address: string): Promise<HealthInfo>;
@@ -73,7 +73,7 @@ interface SwapAdapter {
73
73
  readonly name: string;
74
74
  readonly version: string;
75
75
  readonly capabilities: readonly AdapterCapability[];
76
- init(client: SuiClient): Promise<void>;
76
+ init(client: SuiJsonRpcClient): Promise<void>;
77
77
  getQuote(from: string, to: string, amount: number): Promise<SwapQuote>;
78
78
  buildSwapTx(address: string, from: string, to: string, amount: number, maxSlippageBps?: number): Promise<AdapterTxResult & {
79
79
  estimatedOut: number;
@@ -300,8 +300,8 @@ declare class NaviAdapter implements LendingAdapter {
300
300
  readonly supportedAssets: readonly string[];
301
301
  readonly supportsSameAssetBorrow = true;
302
302
  private client;
303
- init(client: SuiClient): Promise<void>;
304
- initSync(client: SuiClient): void;
303
+ init(client: SuiJsonRpcClient): Promise<void>;
304
+ initSync(client: SuiJsonRpcClient): void;
305
305
  getRates(asset: string): Promise<LendingRates>;
306
306
  getPositions(address: string): Promise<AdapterPositions>;
307
307
  getHealth(address: string): Promise<HealthInfo>;
@@ -325,8 +325,8 @@ declare class CetusAdapter implements SwapAdapter {
325
325
  readonly version = "1.0.0";
326
326
  readonly capabilities: readonly AdapterCapability[];
327
327
  private client;
328
- init(client: SuiClient): Promise<void>;
329
- initSync(client: SuiClient): void;
328
+ init(client: SuiJsonRpcClient): Promise<void>;
329
+ initSync(client: SuiJsonRpcClient): void;
330
330
  getQuote(from: string, to: string, amount: number): Promise<SwapQuote>;
331
331
  buildSwapTx(address: string, from: string, to: string, amount: number, maxSlippageBps?: number): Promise<AdapterTxResult & {
332
332
  estimatedOut: number;
@@ -340,32 +340,26 @@ declare class CetusAdapter implements SwapAdapter {
340
340
  }
341
341
 
342
342
  /**
343
- * Suilend adapter — save + withdraw for USDC.
344
- * Borrow/repay deferred to Phase 10 (requires multi-stable support).
345
- *
346
- * Uses the @suilend/sdk package (optional peer dependency). Users must
347
- * install it separately: `npm install @suilend/sdk@^1`
348
- *
349
- * @see https://docs.suilend.fi/ecosystem/suilend-sdk-guide
343
+ * Suilend adapter — contract-first, no SDK dependency.
344
+ * Interacts directly with Suilend Move contracts via RPC + PTB moveCall.
350
345
  */
351
346
  declare class SuilendAdapter implements LendingAdapter {
352
347
  readonly id = "suilend";
353
348
  readonly name = "Suilend";
354
- readonly version = "1.0.0";
349
+ readonly version = "2.0.0";
355
350
  readonly capabilities: readonly AdapterCapability[];
356
351
  readonly supportedAssets: readonly string[];
357
352
  readonly supportsSameAssetBorrow = false;
358
353
  private client;
359
- private suilend;
360
- private lendingMarketType;
361
- private initialized;
362
- private initPromise;
363
- init(client: SuiClient): Promise<void>;
364
- initSync(client: SuiClient): void;
365
- private lazyInit;
366
- private ensureInit;
354
+ private publishedAt;
355
+ private reserveCache;
356
+ init(client: SuiJsonRpcClient): Promise<void>;
357
+ initSync(client: SuiJsonRpcClient): void;
358
+ private resolvePackage;
359
+ private loadReserves;
367
360
  private findReserve;
368
- private getObligationCaps;
361
+ private fetchObligationCaps;
362
+ private fetchObligation;
369
363
  private resolveSymbol;
370
364
  getRates(asset: string): Promise<LendingRates>;
371
365
  getPositions(address: string): Promise<AdapterPositions>;