@t2000/sdk 0.19.24 → 0.20.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.
- package/README.md +34 -150
- package/dist/adapters/descriptors.cjs +1 -42
- package/dist/adapters/descriptors.cjs.map +1 -1
- package/dist/adapters/descriptors.d.cts +1 -1
- package/dist/adapters/descriptors.d.ts +1 -1
- package/dist/adapters/descriptors.js +2 -41
- package/dist/adapters/descriptors.js.map +1 -1
- package/dist/adapters/index.cjs +3 -745
- package/dist/adapters/index.cjs.map +1 -1
- package/dist/adapters/index.d.cts +4 -171
- package/dist/adapters/index.d.ts +4 -171
- package/dist/adapters/index.js +4 -742
- package/dist/adapters/index.js.map +1 -1
- package/dist/browser.js +20 -178
- package/dist/browser.js.map +1 -1
- package/dist/descriptors-Be4FAgN5.d.cts +127 -0
- package/dist/descriptors-Be4FAgN5.d.ts +127 -0
- package/dist/index-D1DxZ1DK.d.ts +292 -0
- package/dist/index-MP_J_nSO.d.cts +292 -0
- package/dist/index.cjs +711 -3456
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +42 -313
- package/dist/index.d.ts +42 -313
- package/dist/index.js +642 -3375
- package/dist/index.js.map +1 -1
- package/package.json +5 -8
- package/dist/descriptors-B6qt_mwi.d.cts +0 -584
- package/dist/descriptors-B6qt_mwi.d.ts +0 -584
|
@@ -1,171 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
declare class ProtocolRegistry {
|
|
7
|
-
private lending;
|
|
8
|
-
private swap;
|
|
9
|
-
registerLending(adapter: LendingAdapter): void;
|
|
10
|
-
registerSwap(adapter: SwapAdapter): void;
|
|
11
|
-
bestSaveRate(asset: string): Promise<{
|
|
12
|
-
adapter: LendingAdapter;
|
|
13
|
-
rate: LendingRates;
|
|
14
|
-
}>;
|
|
15
|
-
bestBorrowRate(asset: string, opts?: {
|
|
16
|
-
requireSameAssetBorrow?: boolean;
|
|
17
|
-
}): Promise<{
|
|
18
|
-
adapter: LendingAdapter;
|
|
19
|
-
rate: LendingRates;
|
|
20
|
-
}>;
|
|
21
|
-
bestSwapQuote(from: string, to: string, amount: number): Promise<{
|
|
22
|
-
adapter: SwapAdapter;
|
|
23
|
-
quote: SwapQuote;
|
|
24
|
-
}>;
|
|
25
|
-
bestSaveRateAcrossAssets(): Promise<{
|
|
26
|
-
adapter: LendingAdapter;
|
|
27
|
-
rate: LendingRates;
|
|
28
|
-
asset: string;
|
|
29
|
-
}>;
|
|
30
|
-
allRatesAcrossAssets(): Promise<Array<{
|
|
31
|
-
protocol: string;
|
|
32
|
-
protocolId: string;
|
|
33
|
-
asset: string;
|
|
34
|
-
rates: LendingRates;
|
|
35
|
-
}>>;
|
|
36
|
-
allRates(asset: string): Promise<Array<{
|
|
37
|
-
protocol: string;
|
|
38
|
-
protocolId: string;
|
|
39
|
-
rates: LendingRates;
|
|
40
|
-
}>>;
|
|
41
|
-
allPositions(address: string): Promise<Array<{
|
|
42
|
-
protocol: string;
|
|
43
|
-
protocolId: string;
|
|
44
|
-
positions: AdapterPositions;
|
|
45
|
-
}>>;
|
|
46
|
-
getLending(id: string): LendingAdapter | undefined;
|
|
47
|
-
getSwap(id: string): SwapAdapter | undefined;
|
|
48
|
-
listLending(): LendingAdapter[];
|
|
49
|
-
listSwap(): SwapAdapter[];
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
declare class NaviAdapter implements LendingAdapter {
|
|
53
|
-
readonly id = "navi";
|
|
54
|
-
readonly name = "NAVI Protocol";
|
|
55
|
-
readonly version = "1.0.0";
|
|
56
|
-
readonly capabilities: readonly AdapterCapability[];
|
|
57
|
-
readonly supportedAssets: readonly string[];
|
|
58
|
-
readonly supportsSameAssetBorrow = true;
|
|
59
|
-
private client;
|
|
60
|
-
init(client: SuiJsonRpcClient): Promise<void>;
|
|
61
|
-
initSync(client: SuiJsonRpcClient): void;
|
|
62
|
-
getRates(asset: string): Promise<LendingRates>;
|
|
63
|
-
getPositions(address: string): Promise<AdapterPositions>;
|
|
64
|
-
getHealth(address: string): Promise<HealthInfo>;
|
|
65
|
-
buildSaveTx(address: string, amount: number, asset: string, options?: {
|
|
66
|
-
collectFee?: boolean;
|
|
67
|
-
sponsored?: boolean;
|
|
68
|
-
}): Promise<AdapterTxResult>;
|
|
69
|
-
buildWithdrawTx(address: string, amount: number, asset: string, options?: {
|
|
70
|
-
sponsored?: boolean;
|
|
71
|
-
}): Promise<AdapterTxResult & {
|
|
72
|
-
effectiveAmount: number;
|
|
73
|
-
}>;
|
|
74
|
-
buildBorrowTx(address: string, amount: number, asset: string, options?: {
|
|
75
|
-
collectFee?: boolean;
|
|
76
|
-
sponsored?: boolean;
|
|
77
|
-
}): Promise<AdapterTxResult>;
|
|
78
|
-
buildRepayTx(address: string, amount: number, asset: string, options?: {
|
|
79
|
-
sponsored?: boolean;
|
|
80
|
-
skipOracle?: boolean;
|
|
81
|
-
}): Promise<AdapterTxResult>;
|
|
82
|
-
maxWithdraw(address: string, _asset: string): Promise<MaxWithdrawResult>;
|
|
83
|
-
maxBorrow(address: string, _asset: string): Promise<MaxBorrowResult>;
|
|
84
|
-
addWithdrawToTx(tx: Transaction, address: string, amount: number, asset: string): Promise<{
|
|
85
|
-
coin: TransactionObjectArgument;
|
|
86
|
-
effectiveAmount: number;
|
|
87
|
-
}>;
|
|
88
|
-
addSaveToTx(tx: Transaction, address: string, coin: TransactionObjectArgument, asset: string, options?: {
|
|
89
|
-
collectFee?: boolean;
|
|
90
|
-
}): Promise<void>;
|
|
91
|
-
addRepayToTx(tx: Transaction, address: string, coin: TransactionObjectArgument, asset: string): Promise<void>;
|
|
92
|
-
getPendingRewards(address: string): Promise<PendingReward[]>;
|
|
93
|
-
addClaimRewardsToTx(tx: Transaction, address: string): Promise<PendingReward[]>;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
declare class CetusAdapter implements SwapAdapter {
|
|
97
|
-
readonly id = "cetus";
|
|
98
|
-
readonly name = "Cetus";
|
|
99
|
-
readonly version = "1.0.0";
|
|
100
|
-
readonly capabilities: readonly AdapterCapability[];
|
|
101
|
-
private client;
|
|
102
|
-
init(client: SuiJsonRpcClient): Promise<void>;
|
|
103
|
-
initSync(client: SuiJsonRpcClient): void;
|
|
104
|
-
getQuote(from: string, to: string, amount: number): Promise<SwapQuote>;
|
|
105
|
-
buildSwapTx(address: string, from: string, to: string, amount: number, maxSlippageBps?: number): Promise<AdapterTxResult & {
|
|
106
|
-
estimatedOut: number;
|
|
107
|
-
toDecimals: number;
|
|
108
|
-
}>;
|
|
109
|
-
getSupportedPairs(): Array<{
|
|
110
|
-
from: string;
|
|
111
|
-
to: string;
|
|
112
|
-
}>;
|
|
113
|
-
getPoolPrice(): Promise<number>;
|
|
114
|
-
addSwapToTx(tx: Transaction, address: string, inputCoin: TransactionObjectArgument, from: string, to: string, amount: number, maxSlippageBps?: number): Promise<{
|
|
115
|
-
outputCoin: TransactionObjectArgument;
|
|
116
|
-
estimatedOut: number;
|
|
117
|
-
toDecimals: number;
|
|
118
|
-
}>;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
declare class SuilendAdapter implements LendingAdapter {
|
|
122
|
-
readonly id = "suilend";
|
|
123
|
-
readonly name = "Suilend";
|
|
124
|
-
readonly version = "3.0.0";
|
|
125
|
-
readonly capabilities: readonly AdapterCapability[];
|
|
126
|
-
readonly supportedAssets: readonly string[];
|
|
127
|
-
readonly supportsSameAssetBorrow = false;
|
|
128
|
-
private client;
|
|
129
|
-
private sdkClient;
|
|
130
|
-
init(client: SuiJsonRpcClient): Promise<void>;
|
|
131
|
-
initSync(client: SuiJsonRpcClient): void;
|
|
132
|
-
private getSdkClient;
|
|
133
|
-
private resolveSymbol;
|
|
134
|
-
getRates(asset: string): Promise<LendingRates>;
|
|
135
|
-
getPositions(address: string): Promise<AdapterPositions>;
|
|
136
|
-
getHealth(address: string): Promise<HealthInfo>;
|
|
137
|
-
buildSaveTx(address: string, amount: number, asset: string, options?: {
|
|
138
|
-
collectFee?: boolean;
|
|
139
|
-
}): Promise<AdapterTxResult>;
|
|
140
|
-
buildWithdrawTx(address: string, amount: number, asset: string): Promise<AdapterTxResult & {
|
|
141
|
-
effectiveAmount: number;
|
|
142
|
-
}>;
|
|
143
|
-
addWithdrawToTx(tx: Transaction, address: string, amount: number, asset: string): Promise<{
|
|
144
|
-
coin: TransactionObjectArgument;
|
|
145
|
-
effectiveAmount: number;
|
|
146
|
-
}>;
|
|
147
|
-
addSaveToTx(tx: Transaction, address: string, coin: TransactionObjectArgument, asset: string, options?: {
|
|
148
|
-
collectFee?: boolean;
|
|
149
|
-
}): Promise<void>;
|
|
150
|
-
buildBorrowTx(address: string, amount: number, asset: string, options?: {
|
|
151
|
-
collectFee?: boolean;
|
|
152
|
-
}): Promise<AdapterTxResult>;
|
|
153
|
-
buildRepayTx(address: string, amount: number, asset: string): Promise<AdapterTxResult>;
|
|
154
|
-
addRepayToTx(tx: Transaction, address: string, coin: TransactionObjectArgument, asset: string): Promise<void>;
|
|
155
|
-
private resolveWithdrawCTokens;
|
|
156
|
-
maxWithdraw(address: string, _asset: string): Promise<{
|
|
157
|
-
maxAmount: number;
|
|
158
|
-
healthFactorAfter: number;
|
|
159
|
-
currentHF: number;
|
|
160
|
-
}>;
|
|
161
|
-
maxBorrow(address: string, _asset: string): Promise<{
|
|
162
|
-
maxAmount: number;
|
|
163
|
-
healthFactorAfter: number;
|
|
164
|
-
currentHF: number;
|
|
165
|
-
}>;
|
|
166
|
-
private fetchAllCoins;
|
|
167
|
-
getPendingRewards(address: string): Promise<PendingReward[]>;
|
|
168
|
-
addClaimRewardsToTx(tx: Transaction, address: string): Promise<PendingReward[]>;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
export { AdapterCapability, AdapterPositions, AdapterTxResult, CetusAdapter, HealthInfo, LendingAdapter, LendingRates, NaviAdapter, ProtocolRegistry, SuilendAdapter, SwapAdapter, SwapQuote };
|
|
1
|
+
export { A as AdapterCapability, b as AdapterPositions, c as AdapterTxResult, H as HealthInfo, L as LendingAdapter, a as LendingRates, P as ProtocolDescriptor, d as allDescriptors, n as naviDescriptor } from '../descriptors-Be4FAgN5.cjs';
|
|
2
|
+
export { N as NaviAdapter, n as ProtocolRegistry } from '../index-MP_J_nSO.cjs';
|
|
3
|
+
import '@mysten/sui/transactions';
|
|
4
|
+
import '@mysten/sui/jsonRpc';
|
package/dist/adapters/index.d.ts
CHANGED
|
@@ -1,171 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
declare class ProtocolRegistry {
|
|
7
|
-
private lending;
|
|
8
|
-
private swap;
|
|
9
|
-
registerLending(adapter: LendingAdapter): void;
|
|
10
|
-
registerSwap(adapter: SwapAdapter): void;
|
|
11
|
-
bestSaveRate(asset: string): Promise<{
|
|
12
|
-
adapter: LendingAdapter;
|
|
13
|
-
rate: LendingRates;
|
|
14
|
-
}>;
|
|
15
|
-
bestBorrowRate(asset: string, opts?: {
|
|
16
|
-
requireSameAssetBorrow?: boolean;
|
|
17
|
-
}): Promise<{
|
|
18
|
-
adapter: LendingAdapter;
|
|
19
|
-
rate: LendingRates;
|
|
20
|
-
}>;
|
|
21
|
-
bestSwapQuote(from: string, to: string, amount: number): Promise<{
|
|
22
|
-
adapter: SwapAdapter;
|
|
23
|
-
quote: SwapQuote;
|
|
24
|
-
}>;
|
|
25
|
-
bestSaveRateAcrossAssets(): Promise<{
|
|
26
|
-
adapter: LendingAdapter;
|
|
27
|
-
rate: LendingRates;
|
|
28
|
-
asset: string;
|
|
29
|
-
}>;
|
|
30
|
-
allRatesAcrossAssets(): Promise<Array<{
|
|
31
|
-
protocol: string;
|
|
32
|
-
protocolId: string;
|
|
33
|
-
asset: string;
|
|
34
|
-
rates: LendingRates;
|
|
35
|
-
}>>;
|
|
36
|
-
allRates(asset: string): Promise<Array<{
|
|
37
|
-
protocol: string;
|
|
38
|
-
protocolId: string;
|
|
39
|
-
rates: LendingRates;
|
|
40
|
-
}>>;
|
|
41
|
-
allPositions(address: string): Promise<Array<{
|
|
42
|
-
protocol: string;
|
|
43
|
-
protocolId: string;
|
|
44
|
-
positions: AdapterPositions;
|
|
45
|
-
}>>;
|
|
46
|
-
getLending(id: string): LendingAdapter | undefined;
|
|
47
|
-
getSwap(id: string): SwapAdapter | undefined;
|
|
48
|
-
listLending(): LendingAdapter[];
|
|
49
|
-
listSwap(): SwapAdapter[];
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
declare class NaviAdapter implements LendingAdapter {
|
|
53
|
-
readonly id = "navi";
|
|
54
|
-
readonly name = "NAVI Protocol";
|
|
55
|
-
readonly version = "1.0.0";
|
|
56
|
-
readonly capabilities: readonly AdapterCapability[];
|
|
57
|
-
readonly supportedAssets: readonly string[];
|
|
58
|
-
readonly supportsSameAssetBorrow = true;
|
|
59
|
-
private client;
|
|
60
|
-
init(client: SuiJsonRpcClient): Promise<void>;
|
|
61
|
-
initSync(client: SuiJsonRpcClient): void;
|
|
62
|
-
getRates(asset: string): Promise<LendingRates>;
|
|
63
|
-
getPositions(address: string): Promise<AdapterPositions>;
|
|
64
|
-
getHealth(address: string): Promise<HealthInfo>;
|
|
65
|
-
buildSaveTx(address: string, amount: number, asset: string, options?: {
|
|
66
|
-
collectFee?: boolean;
|
|
67
|
-
sponsored?: boolean;
|
|
68
|
-
}): Promise<AdapterTxResult>;
|
|
69
|
-
buildWithdrawTx(address: string, amount: number, asset: string, options?: {
|
|
70
|
-
sponsored?: boolean;
|
|
71
|
-
}): Promise<AdapterTxResult & {
|
|
72
|
-
effectiveAmount: number;
|
|
73
|
-
}>;
|
|
74
|
-
buildBorrowTx(address: string, amount: number, asset: string, options?: {
|
|
75
|
-
collectFee?: boolean;
|
|
76
|
-
sponsored?: boolean;
|
|
77
|
-
}): Promise<AdapterTxResult>;
|
|
78
|
-
buildRepayTx(address: string, amount: number, asset: string, options?: {
|
|
79
|
-
sponsored?: boolean;
|
|
80
|
-
skipOracle?: boolean;
|
|
81
|
-
}): Promise<AdapterTxResult>;
|
|
82
|
-
maxWithdraw(address: string, _asset: string): Promise<MaxWithdrawResult>;
|
|
83
|
-
maxBorrow(address: string, _asset: string): Promise<MaxBorrowResult>;
|
|
84
|
-
addWithdrawToTx(tx: Transaction, address: string, amount: number, asset: string): Promise<{
|
|
85
|
-
coin: TransactionObjectArgument;
|
|
86
|
-
effectiveAmount: number;
|
|
87
|
-
}>;
|
|
88
|
-
addSaveToTx(tx: Transaction, address: string, coin: TransactionObjectArgument, asset: string, options?: {
|
|
89
|
-
collectFee?: boolean;
|
|
90
|
-
}): Promise<void>;
|
|
91
|
-
addRepayToTx(tx: Transaction, address: string, coin: TransactionObjectArgument, asset: string): Promise<void>;
|
|
92
|
-
getPendingRewards(address: string): Promise<PendingReward[]>;
|
|
93
|
-
addClaimRewardsToTx(tx: Transaction, address: string): Promise<PendingReward[]>;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
declare class CetusAdapter implements SwapAdapter {
|
|
97
|
-
readonly id = "cetus";
|
|
98
|
-
readonly name = "Cetus";
|
|
99
|
-
readonly version = "1.0.0";
|
|
100
|
-
readonly capabilities: readonly AdapterCapability[];
|
|
101
|
-
private client;
|
|
102
|
-
init(client: SuiJsonRpcClient): Promise<void>;
|
|
103
|
-
initSync(client: SuiJsonRpcClient): void;
|
|
104
|
-
getQuote(from: string, to: string, amount: number): Promise<SwapQuote>;
|
|
105
|
-
buildSwapTx(address: string, from: string, to: string, amount: number, maxSlippageBps?: number): Promise<AdapterTxResult & {
|
|
106
|
-
estimatedOut: number;
|
|
107
|
-
toDecimals: number;
|
|
108
|
-
}>;
|
|
109
|
-
getSupportedPairs(): Array<{
|
|
110
|
-
from: string;
|
|
111
|
-
to: string;
|
|
112
|
-
}>;
|
|
113
|
-
getPoolPrice(): Promise<number>;
|
|
114
|
-
addSwapToTx(tx: Transaction, address: string, inputCoin: TransactionObjectArgument, from: string, to: string, amount: number, maxSlippageBps?: number): Promise<{
|
|
115
|
-
outputCoin: TransactionObjectArgument;
|
|
116
|
-
estimatedOut: number;
|
|
117
|
-
toDecimals: number;
|
|
118
|
-
}>;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
declare class SuilendAdapter implements LendingAdapter {
|
|
122
|
-
readonly id = "suilend";
|
|
123
|
-
readonly name = "Suilend";
|
|
124
|
-
readonly version = "3.0.0";
|
|
125
|
-
readonly capabilities: readonly AdapterCapability[];
|
|
126
|
-
readonly supportedAssets: readonly string[];
|
|
127
|
-
readonly supportsSameAssetBorrow = false;
|
|
128
|
-
private client;
|
|
129
|
-
private sdkClient;
|
|
130
|
-
init(client: SuiJsonRpcClient): Promise<void>;
|
|
131
|
-
initSync(client: SuiJsonRpcClient): void;
|
|
132
|
-
private getSdkClient;
|
|
133
|
-
private resolveSymbol;
|
|
134
|
-
getRates(asset: string): Promise<LendingRates>;
|
|
135
|
-
getPositions(address: string): Promise<AdapterPositions>;
|
|
136
|
-
getHealth(address: string): Promise<HealthInfo>;
|
|
137
|
-
buildSaveTx(address: string, amount: number, asset: string, options?: {
|
|
138
|
-
collectFee?: boolean;
|
|
139
|
-
}): Promise<AdapterTxResult>;
|
|
140
|
-
buildWithdrawTx(address: string, amount: number, asset: string): Promise<AdapterTxResult & {
|
|
141
|
-
effectiveAmount: number;
|
|
142
|
-
}>;
|
|
143
|
-
addWithdrawToTx(tx: Transaction, address: string, amount: number, asset: string): Promise<{
|
|
144
|
-
coin: TransactionObjectArgument;
|
|
145
|
-
effectiveAmount: number;
|
|
146
|
-
}>;
|
|
147
|
-
addSaveToTx(tx: Transaction, address: string, coin: TransactionObjectArgument, asset: string, options?: {
|
|
148
|
-
collectFee?: boolean;
|
|
149
|
-
}): Promise<void>;
|
|
150
|
-
buildBorrowTx(address: string, amount: number, asset: string, options?: {
|
|
151
|
-
collectFee?: boolean;
|
|
152
|
-
}): Promise<AdapterTxResult>;
|
|
153
|
-
buildRepayTx(address: string, amount: number, asset: string): Promise<AdapterTxResult>;
|
|
154
|
-
addRepayToTx(tx: Transaction, address: string, coin: TransactionObjectArgument, asset: string): Promise<void>;
|
|
155
|
-
private resolveWithdrawCTokens;
|
|
156
|
-
maxWithdraw(address: string, _asset: string): Promise<{
|
|
157
|
-
maxAmount: number;
|
|
158
|
-
healthFactorAfter: number;
|
|
159
|
-
currentHF: number;
|
|
160
|
-
}>;
|
|
161
|
-
maxBorrow(address: string, _asset: string): Promise<{
|
|
162
|
-
maxAmount: number;
|
|
163
|
-
healthFactorAfter: number;
|
|
164
|
-
currentHF: number;
|
|
165
|
-
}>;
|
|
166
|
-
private fetchAllCoins;
|
|
167
|
-
getPendingRewards(address: string): Promise<PendingReward[]>;
|
|
168
|
-
addClaimRewardsToTx(tx: Transaction, address: string): Promise<PendingReward[]>;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
export { AdapterCapability, AdapterPositions, AdapterTxResult, CetusAdapter, HealthInfo, LendingAdapter, LendingRates, NaviAdapter, ProtocolRegistry, SuilendAdapter, SwapAdapter, SwapQuote };
|
|
1
|
+
export { A as AdapterCapability, b as AdapterPositions, c as AdapterTxResult, H as HealthInfo, L as LendingAdapter, a as LendingRates, P as ProtocolDescriptor, d as allDescriptors, n as naviDescriptor } from '../descriptors-Be4FAgN5.js';
|
|
2
|
+
export { N as NaviAdapter, n as ProtocolRegistry } from '../index-D1DxZ1DK.js';
|
|
3
|
+
import '@mysten/sui/transactions';
|
|
4
|
+
import '@mysten/sui/jsonRpc';
|