@t2000/sdk 0.4.3 → 0.5.0
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 +1 -1
- package/dist/adapters/index.cjs +485 -228
- package/dist/adapters/index.cjs.map +1 -1
- package/dist/adapters/index.d.cts +2 -2
- package/dist/adapters/index.d.ts +2 -2
- package/dist/adapters/index.js +485 -228
- package/dist/adapters/index.js.map +1 -1
- package/dist/{index-BuaGAa6b.d.cts → index-DMDq8uxe.d.cts} +18 -24
- package/dist/{index-BuaGAa6b.d.ts → index-DMDq8uxe.d.ts} +18 -24
- package/dist/index.cjs +488 -233
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -16
- package/dist/index.d.ts +16 -16
- package/dist/index.js +488 -233
- package/dist/index.js.map +1 -1
- package/package.json +2 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
|
|
2
|
-
import {
|
|
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:
|
|
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:
|
|
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:
|
|
304
|
-
initSync(client:
|
|
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:
|
|
329
|
-
initSync(client:
|
|
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 —
|
|
344
|
-
*
|
|
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 = "
|
|
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
|
|
360
|
-
private
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
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
|
|
361
|
+
private fetchObligationCaps;
|
|
362
|
+
private fetchObligation;
|
|
369
363
|
private resolveSymbol;
|
|
370
364
|
getRates(asset: string): Promise<LendingRates>;
|
|
371
365
|
getPositions(address: string): Promise<AdapterPositions>;
|