@t2000/sdk 0.21.15 → 0.21.16
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.d.cts +89 -4
- package/dist/adapters/index.d.ts +89 -4
- package/dist/browser.cjs +769 -0
- package/dist/browser.cjs.map +1 -0
- package/dist/browser.d.cts +11 -0
- package/dist/browser.d.ts +11 -0
- package/dist/index.d.cts +7 -339
- package/dist/index.d.ts +7 -339
- package/dist/token-registry-CVba8FI2.d.ts +341 -0
- package/dist/token-registry-DIl3H4Jh.d.cts +341 -0
- package/dist/{index-BwknZes_.d.ts → types-XWEUAS-X.d.cts} +1 -87
- package/dist/{index-HeR6WZTF.d.cts → types-XWEUAS-X.d.ts} +1 -87
- package/package.json +1 -1
|
@@ -1,4 +1,89 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
import '
|
|
4
|
-
import '@mysten/sui/jsonRpc';
|
|
1
|
+
import { L as LendingAdapter, a as LendingRates, b as AdapterPositions, A as AdapterCapability, H as HealthInfo, c as AdapterTxResult, e as PendingReward } from '../descriptors-Be4FAgN5.cjs';
|
|
2
|
+
export { P as ProtocolDescriptor, d as allDescriptors, n as naviDescriptor } from '../descriptors-Be4FAgN5.cjs';
|
|
3
|
+
import { c as MaxWithdrawResult, M as MaxBorrowResult } from '../types-XWEUAS-X.cjs';
|
|
4
|
+
import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
|
|
5
|
+
import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
|
|
6
|
+
|
|
7
|
+
declare class ProtocolRegistry {
|
|
8
|
+
private lending;
|
|
9
|
+
registerLending(adapter: LendingAdapter): void;
|
|
10
|
+
bestSaveRate(asset: string): Promise<{
|
|
11
|
+
adapter: LendingAdapter;
|
|
12
|
+
rate: LendingRates;
|
|
13
|
+
}>;
|
|
14
|
+
bestBorrowRate(asset: string, opts?: {
|
|
15
|
+
requireSameAssetBorrow?: boolean;
|
|
16
|
+
}): Promise<{
|
|
17
|
+
adapter: LendingAdapter;
|
|
18
|
+
rate: LendingRates;
|
|
19
|
+
}>;
|
|
20
|
+
bestSaveRateAcrossAssets(): Promise<{
|
|
21
|
+
adapter: LendingAdapter;
|
|
22
|
+
rate: LendingRates;
|
|
23
|
+
asset: string;
|
|
24
|
+
}>;
|
|
25
|
+
allRatesAcrossAssets(): Promise<Array<{
|
|
26
|
+
protocol: string;
|
|
27
|
+
protocolId: string;
|
|
28
|
+
asset: string;
|
|
29
|
+
rates: LendingRates;
|
|
30
|
+
}>>;
|
|
31
|
+
allRates(asset: string): Promise<Array<{
|
|
32
|
+
protocol: string;
|
|
33
|
+
protocolId: string;
|
|
34
|
+
rates: LendingRates;
|
|
35
|
+
}>>;
|
|
36
|
+
allPositions(address: string): Promise<Array<{
|
|
37
|
+
protocol: string;
|
|
38
|
+
protocolId: string;
|
|
39
|
+
positions: AdapterPositions;
|
|
40
|
+
}>>;
|
|
41
|
+
getLending(id: string): LendingAdapter | undefined;
|
|
42
|
+
listLending(): LendingAdapter[];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
declare class NaviAdapter implements LendingAdapter {
|
|
46
|
+
readonly id = "navi";
|
|
47
|
+
readonly name = "NAVI Protocol";
|
|
48
|
+
readonly version = "1.0.0";
|
|
49
|
+
readonly capabilities: readonly AdapterCapability[];
|
|
50
|
+
readonly supportedAssets: readonly string[];
|
|
51
|
+
readonly supportsSameAssetBorrow = true;
|
|
52
|
+
private client;
|
|
53
|
+
init(client: SuiJsonRpcClient): Promise<void>;
|
|
54
|
+
initSync(client: SuiJsonRpcClient): void;
|
|
55
|
+
getRates(asset: string): Promise<LendingRates>;
|
|
56
|
+
getPositions(address: string): Promise<AdapterPositions>;
|
|
57
|
+
getHealth(address: string): Promise<HealthInfo>;
|
|
58
|
+
buildSaveTx(address: string, amount: number, asset: string, options?: {
|
|
59
|
+
collectFee?: boolean;
|
|
60
|
+
sponsored?: boolean;
|
|
61
|
+
}): Promise<AdapterTxResult>;
|
|
62
|
+
buildWithdrawTx(address: string, amount: number, asset: string, options?: {
|
|
63
|
+
sponsored?: boolean;
|
|
64
|
+
}): Promise<AdapterTxResult & {
|
|
65
|
+
effectiveAmount: number;
|
|
66
|
+
}>;
|
|
67
|
+
buildBorrowTx(address: string, amount: number, asset: string, options?: {
|
|
68
|
+
collectFee?: boolean;
|
|
69
|
+
sponsored?: boolean;
|
|
70
|
+
}): Promise<AdapterTxResult>;
|
|
71
|
+
buildRepayTx(address: string, amount: number, asset: string, options?: {
|
|
72
|
+
sponsored?: boolean;
|
|
73
|
+
skipOracle?: boolean;
|
|
74
|
+
}): Promise<AdapterTxResult>;
|
|
75
|
+
maxWithdraw(address: string, _asset: string): Promise<MaxWithdrawResult>;
|
|
76
|
+
maxBorrow(address: string, _asset: string): Promise<MaxBorrowResult>;
|
|
77
|
+
addWithdrawToTx(tx: Transaction, address: string, amount: number, asset: string): Promise<{
|
|
78
|
+
coin: TransactionObjectArgument;
|
|
79
|
+
effectiveAmount: number;
|
|
80
|
+
}>;
|
|
81
|
+
addSaveToTx(tx: Transaction, address: string, coin: TransactionObjectArgument, asset: string, options?: {
|
|
82
|
+
collectFee?: boolean;
|
|
83
|
+
}): Promise<void>;
|
|
84
|
+
addRepayToTx(tx: Transaction, address: string, coin: TransactionObjectArgument, asset: string): Promise<void>;
|
|
85
|
+
getPendingRewards(address: string): Promise<PendingReward[]>;
|
|
86
|
+
addClaimRewardsToTx(tx: Transaction, address: string): Promise<PendingReward[]>;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export { AdapterCapability, AdapterPositions, AdapterTxResult, HealthInfo, LendingAdapter, LendingRates, NaviAdapter, ProtocolRegistry };
|
package/dist/adapters/index.d.ts
CHANGED
|
@@ -1,4 +1,89 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
import '
|
|
4
|
-
import '@mysten/sui/jsonRpc';
|
|
1
|
+
import { L as LendingAdapter, a as LendingRates, b as AdapterPositions, A as AdapterCapability, H as HealthInfo, c as AdapterTxResult, e as PendingReward } from '../descriptors-Be4FAgN5.js';
|
|
2
|
+
export { P as ProtocolDescriptor, d as allDescriptors, n as naviDescriptor } from '../descriptors-Be4FAgN5.js';
|
|
3
|
+
import { c as MaxWithdrawResult, M as MaxBorrowResult } from '../types-XWEUAS-X.js';
|
|
4
|
+
import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
|
|
5
|
+
import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
|
|
6
|
+
|
|
7
|
+
declare class ProtocolRegistry {
|
|
8
|
+
private lending;
|
|
9
|
+
registerLending(adapter: LendingAdapter): void;
|
|
10
|
+
bestSaveRate(asset: string): Promise<{
|
|
11
|
+
adapter: LendingAdapter;
|
|
12
|
+
rate: LendingRates;
|
|
13
|
+
}>;
|
|
14
|
+
bestBorrowRate(asset: string, opts?: {
|
|
15
|
+
requireSameAssetBorrow?: boolean;
|
|
16
|
+
}): Promise<{
|
|
17
|
+
adapter: LendingAdapter;
|
|
18
|
+
rate: LendingRates;
|
|
19
|
+
}>;
|
|
20
|
+
bestSaveRateAcrossAssets(): Promise<{
|
|
21
|
+
adapter: LendingAdapter;
|
|
22
|
+
rate: LendingRates;
|
|
23
|
+
asset: string;
|
|
24
|
+
}>;
|
|
25
|
+
allRatesAcrossAssets(): Promise<Array<{
|
|
26
|
+
protocol: string;
|
|
27
|
+
protocolId: string;
|
|
28
|
+
asset: string;
|
|
29
|
+
rates: LendingRates;
|
|
30
|
+
}>>;
|
|
31
|
+
allRates(asset: string): Promise<Array<{
|
|
32
|
+
protocol: string;
|
|
33
|
+
protocolId: string;
|
|
34
|
+
rates: LendingRates;
|
|
35
|
+
}>>;
|
|
36
|
+
allPositions(address: string): Promise<Array<{
|
|
37
|
+
protocol: string;
|
|
38
|
+
protocolId: string;
|
|
39
|
+
positions: AdapterPositions;
|
|
40
|
+
}>>;
|
|
41
|
+
getLending(id: string): LendingAdapter | undefined;
|
|
42
|
+
listLending(): LendingAdapter[];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
declare class NaviAdapter implements LendingAdapter {
|
|
46
|
+
readonly id = "navi";
|
|
47
|
+
readonly name = "NAVI Protocol";
|
|
48
|
+
readonly version = "1.0.0";
|
|
49
|
+
readonly capabilities: readonly AdapterCapability[];
|
|
50
|
+
readonly supportedAssets: readonly string[];
|
|
51
|
+
readonly supportsSameAssetBorrow = true;
|
|
52
|
+
private client;
|
|
53
|
+
init(client: SuiJsonRpcClient): Promise<void>;
|
|
54
|
+
initSync(client: SuiJsonRpcClient): void;
|
|
55
|
+
getRates(asset: string): Promise<LendingRates>;
|
|
56
|
+
getPositions(address: string): Promise<AdapterPositions>;
|
|
57
|
+
getHealth(address: string): Promise<HealthInfo>;
|
|
58
|
+
buildSaveTx(address: string, amount: number, asset: string, options?: {
|
|
59
|
+
collectFee?: boolean;
|
|
60
|
+
sponsored?: boolean;
|
|
61
|
+
}): Promise<AdapterTxResult>;
|
|
62
|
+
buildWithdrawTx(address: string, amount: number, asset: string, options?: {
|
|
63
|
+
sponsored?: boolean;
|
|
64
|
+
}): Promise<AdapterTxResult & {
|
|
65
|
+
effectiveAmount: number;
|
|
66
|
+
}>;
|
|
67
|
+
buildBorrowTx(address: string, amount: number, asset: string, options?: {
|
|
68
|
+
collectFee?: boolean;
|
|
69
|
+
sponsored?: boolean;
|
|
70
|
+
}): Promise<AdapterTxResult>;
|
|
71
|
+
buildRepayTx(address: string, amount: number, asset: string, options?: {
|
|
72
|
+
sponsored?: boolean;
|
|
73
|
+
skipOracle?: boolean;
|
|
74
|
+
}): Promise<AdapterTxResult>;
|
|
75
|
+
maxWithdraw(address: string, _asset: string): Promise<MaxWithdrawResult>;
|
|
76
|
+
maxBorrow(address: string, _asset: string): Promise<MaxBorrowResult>;
|
|
77
|
+
addWithdrawToTx(tx: Transaction, address: string, amount: number, asset: string): Promise<{
|
|
78
|
+
coin: TransactionObjectArgument;
|
|
79
|
+
effectiveAmount: number;
|
|
80
|
+
}>;
|
|
81
|
+
addSaveToTx(tx: Transaction, address: string, coin: TransactionObjectArgument, asset: string, options?: {
|
|
82
|
+
collectFee?: boolean;
|
|
83
|
+
}): Promise<void>;
|
|
84
|
+
addRepayToTx(tx: Transaction, address: string, coin: TransactionObjectArgument, asset: string): Promise<void>;
|
|
85
|
+
getPendingRewards(address: string): Promise<PendingReward[]>;
|
|
86
|
+
addClaimRewardsToTx(tx: Transaction, address: string): Promise<PendingReward[]>;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export { AdapterCapability, AdapterPositions, AdapterTxResult, HealthInfo, LendingAdapter, LendingRates, NaviAdapter, ProtocolRegistry };
|