@t2000/sdk 4.4.0 → 5.1.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 +3 -3
- package/dist/browser.cjs +333 -161
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +4 -4
- package/dist/browser.d.ts +4 -4
- package/dist/browser.js +333 -150
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +802 -6702
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -541
- package/dist/index.d.ts +29 -541
- package/dist/index.js +805 -6677
- package/dist/index.js.map +1 -1
- package/dist/types-C01EGu76.d.cts +1222 -0
- package/dist/types-C01EGu76.d.ts +1222 -0
- package/package.json +3 -16
- package/dist/adapters/descriptors.cjs +0 -48
- package/dist/adapters/descriptors.cjs.map +0 -1
- package/dist/adapters/descriptors.d.cts +0 -3
- package/dist/adapters/descriptors.d.ts +0 -3
- package/dist/adapters/descriptors.js +0 -45
- package/dist/adapters/descriptors.js.map +0 -1
- package/dist/adapters/index.cjs +0 -4815
- package/dist/adapters/index.cjs.map +0 -1
- package/dist/adapters/index.d.cts +0 -91
- package/dist/adapters/index.d.ts +0 -91
- package/dist/adapters/index.js +0 -4810
- package/dist/adapters/index.js.map +0 -1
- package/dist/descriptors-DqIb4AnV.d.cts +0 -134
- package/dist/descriptors-DqIb4AnV.d.ts +0 -134
- package/dist/types-CFV4VcJJ.d.cts +0 -667
- package/dist/types-Ch0zVUpC.d.cts +0 -727
- package/dist/types-Ch0zVUpC.d.ts +0 -727
- package/dist/types-DqRLGfOC.d.ts +0 -667
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { L as LendingAdapter, a as LendingRates, b as AdapterPositions, A as AdapterCapability, H as HealthInfo, c as AdapterTxResult, P as PendingReward } from '../descriptors-DqIb4AnV.cjs';
|
|
2
|
-
export { d as ProtocolDescriptor, e as allDescriptors, n as naviDescriptor } from '../descriptors-DqIb4AnV.cjs';
|
|
3
|
-
import { b as MaxWithdrawResult, M as MaxBorrowResult } from '../types-Ch0zVUpC.cjs';
|
|
4
|
-
import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
|
|
5
|
-
import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
|
|
6
|
-
import '@cetusprotocol/aggregator-sdk';
|
|
7
|
-
|
|
8
|
-
declare class ProtocolRegistry {
|
|
9
|
-
private lending;
|
|
10
|
-
registerLending(adapter: LendingAdapter): 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
|
-
bestSaveRateAcrossAssets(): Promise<{
|
|
22
|
-
adapter: LendingAdapter;
|
|
23
|
-
rate: LendingRates;
|
|
24
|
-
asset: string;
|
|
25
|
-
}>;
|
|
26
|
-
allRatesAcrossAssets(): Promise<Array<{
|
|
27
|
-
protocol: string;
|
|
28
|
-
protocolId: string;
|
|
29
|
-
asset: string;
|
|
30
|
-
rates: LendingRates;
|
|
31
|
-
}>>;
|
|
32
|
-
allRates(asset: string): Promise<Array<{
|
|
33
|
-
protocol: string;
|
|
34
|
-
protocolId: string;
|
|
35
|
-
rates: LendingRates;
|
|
36
|
-
}>>;
|
|
37
|
-
allPositions(address: string): Promise<Array<{
|
|
38
|
-
protocol: string;
|
|
39
|
-
protocolId: string;
|
|
40
|
-
positions: AdapterPositions;
|
|
41
|
-
}>>;
|
|
42
|
-
getLending(id: string): LendingAdapter | undefined;
|
|
43
|
-
listLending(): LendingAdapter[];
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
declare class NaviAdapter implements LendingAdapter {
|
|
47
|
-
readonly id = "navi";
|
|
48
|
-
readonly name = "NAVI Protocol";
|
|
49
|
-
readonly version = "1.0.0";
|
|
50
|
-
readonly capabilities: readonly AdapterCapability[];
|
|
51
|
-
readonly supportedAssets: readonly string[];
|
|
52
|
-
readonly supportsSameAssetBorrow = true;
|
|
53
|
-
private client;
|
|
54
|
-
init(client: SuiJsonRpcClient): Promise<void>;
|
|
55
|
-
initSync(client: SuiJsonRpcClient): void;
|
|
56
|
-
getRates(asset: string): Promise<LendingRates>;
|
|
57
|
-
getPositions(address: string): Promise<AdapterPositions>;
|
|
58
|
-
getHealth(address: string): Promise<HealthInfo>;
|
|
59
|
-
buildSaveTx(address: string, amount: number, asset: string): Promise<AdapterTxResult>;
|
|
60
|
-
buildWithdrawTx(address: string, amount: number, asset: string, options?: {
|
|
61
|
-
skipPythUpdate?: boolean;
|
|
62
|
-
}): Promise<AdapterTxResult & {
|
|
63
|
-
effectiveAmount: number;
|
|
64
|
-
}>;
|
|
65
|
-
buildBorrowTx(address: string, amount: number, asset: string, options?: {
|
|
66
|
-
skipPythUpdate?: boolean;
|
|
67
|
-
}): Promise<AdapterTxResult>;
|
|
68
|
-
buildRepayTx(address: string, amount: number, asset: string, options?: {
|
|
69
|
-
skipOracle?: boolean;
|
|
70
|
-
skipPythUpdate?: boolean;
|
|
71
|
-
}): Promise<AdapterTxResult>;
|
|
72
|
-
maxWithdraw(address: string, _asset: string): Promise<MaxWithdrawResult>;
|
|
73
|
-
maxBorrow(address: string, _asset: string): Promise<MaxBorrowResult>;
|
|
74
|
-
addWithdrawToTx(tx: Transaction, address: string, amount: number, asset: string, options?: {
|
|
75
|
-
skipPythUpdate?: boolean;
|
|
76
|
-
}): Promise<{
|
|
77
|
-
coin: TransactionObjectArgument;
|
|
78
|
-
effectiveAmount: number;
|
|
79
|
-
}>;
|
|
80
|
-
addSaveToTx(tx: Transaction, address: string, coin: TransactionObjectArgument, asset: string): Promise<void>;
|
|
81
|
-
addBorrowToTx(tx: Transaction, address: string, amount: number, asset: string, options?: {
|
|
82
|
-
skipPythUpdate?: boolean;
|
|
83
|
-
}): Promise<TransactionObjectArgument>;
|
|
84
|
-
addRepayToTx(tx: Transaction, address: string, coin: TransactionObjectArgument, asset: string, options?: {
|
|
85
|
-
skipPythUpdate?: boolean;
|
|
86
|
-
}): Promise<void>;
|
|
87
|
-
getPendingRewards(address: string): Promise<PendingReward[]>;
|
|
88
|
-
addClaimRewardsToTx(tx: Transaction, address: string): Promise<PendingReward[]>;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export { AdapterCapability, AdapterPositions, AdapterTxResult, HealthInfo, LendingAdapter, LendingRates, NaviAdapter, ProtocolRegistry };
|
package/dist/adapters/index.d.ts
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { L as LendingAdapter, a as LendingRates, b as AdapterPositions, A as AdapterCapability, H as HealthInfo, c as AdapterTxResult, P as PendingReward } from '../descriptors-DqIb4AnV.js';
|
|
2
|
-
export { d as ProtocolDescriptor, e as allDescriptors, n as naviDescriptor } from '../descriptors-DqIb4AnV.js';
|
|
3
|
-
import { b as MaxWithdrawResult, M as MaxBorrowResult } from '../types-Ch0zVUpC.js';
|
|
4
|
-
import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
|
|
5
|
-
import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
|
|
6
|
-
import '@cetusprotocol/aggregator-sdk';
|
|
7
|
-
|
|
8
|
-
declare class ProtocolRegistry {
|
|
9
|
-
private lending;
|
|
10
|
-
registerLending(adapter: LendingAdapter): 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
|
-
bestSaveRateAcrossAssets(): Promise<{
|
|
22
|
-
adapter: LendingAdapter;
|
|
23
|
-
rate: LendingRates;
|
|
24
|
-
asset: string;
|
|
25
|
-
}>;
|
|
26
|
-
allRatesAcrossAssets(): Promise<Array<{
|
|
27
|
-
protocol: string;
|
|
28
|
-
protocolId: string;
|
|
29
|
-
asset: string;
|
|
30
|
-
rates: LendingRates;
|
|
31
|
-
}>>;
|
|
32
|
-
allRates(asset: string): Promise<Array<{
|
|
33
|
-
protocol: string;
|
|
34
|
-
protocolId: string;
|
|
35
|
-
rates: LendingRates;
|
|
36
|
-
}>>;
|
|
37
|
-
allPositions(address: string): Promise<Array<{
|
|
38
|
-
protocol: string;
|
|
39
|
-
protocolId: string;
|
|
40
|
-
positions: AdapterPositions;
|
|
41
|
-
}>>;
|
|
42
|
-
getLending(id: string): LendingAdapter | undefined;
|
|
43
|
-
listLending(): LendingAdapter[];
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
declare class NaviAdapter implements LendingAdapter {
|
|
47
|
-
readonly id = "navi";
|
|
48
|
-
readonly name = "NAVI Protocol";
|
|
49
|
-
readonly version = "1.0.0";
|
|
50
|
-
readonly capabilities: readonly AdapterCapability[];
|
|
51
|
-
readonly supportedAssets: readonly string[];
|
|
52
|
-
readonly supportsSameAssetBorrow = true;
|
|
53
|
-
private client;
|
|
54
|
-
init(client: SuiJsonRpcClient): Promise<void>;
|
|
55
|
-
initSync(client: SuiJsonRpcClient): void;
|
|
56
|
-
getRates(asset: string): Promise<LendingRates>;
|
|
57
|
-
getPositions(address: string): Promise<AdapterPositions>;
|
|
58
|
-
getHealth(address: string): Promise<HealthInfo>;
|
|
59
|
-
buildSaveTx(address: string, amount: number, asset: string): Promise<AdapterTxResult>;
|
|
60
|
-
buildWithdrawTx(address: string, amount: number, asset: string, options?: {
|
|
61
|
-
skipPythUpdate?: boolean;
|
|
62
|
-
}): Promise<AdapterTxResult & {
|
|
63
|
-
effectiveAmount: number;
|
|
64
|
-
}>;
|
|
65
|
-
buildBorrowTx(address: string, amount: number, asset: string, options?: {
|
|
66
|
-
skipPythUpdate?: boolean;
|
|
67
|
-
}): Promise<AdapterTxResult>;
|
|
68
|
-
buildRepayTx(address: string, amount: number, asset: string, options?: {
|
|
69
|
-
skipOracle?: boolean;
|
|
70
|
-
skipPythUpdate?: boolean;
|
|
71
|
-
}): Promise<AdapterTxResult>;
|
|
72
|
-
maxWithdraw(address: string, _asset: string): Promise<MaxWithdrawResult>;
|
|
73
|
-
maxBorrow(address: string, _asset: string): Promise<MaxBorrowResult>;
|
|
74
|
-
addWithdrawToTx(tx: Transaction, address: string, amount: number, asset: string, options?: {
|
|
75
|
-
skipPythUpdate?: boolean;
|
|
76
|
-
}): Promise<{
|
|
77
|
-
coin: TransactionObjectArgument;
|
|
78
|
-
effectiveAmount: number;
|
|
79
|
-
}>;
|
|
80
|
-
addSaveToTx(tx: Transaction, address: string, coin: TransactionObjectArgument, asset: string): Promise<void>;
|
|
81
|
-
addBorrowToTx(tx: Transaction, address: string, amount: number, asset: string, options?: {
|
|
82
|
-
skipPythUpdate?: boolean;
|
|
83
|
-
}): Promise<TransactionObjectArgument>;
|
|
84
|
-
addRepayToTx(tx: Transaction, address: string, coin: TransactionObjectArgument, asset: string, options?: {
|
|
85
|
-
skipPythUpdate?: boolean;
|
|
86
|
-
}): Promise<void>;
|
|
87
|
-
getPendingRewards(address: string): Promise<PendingReward[]>;
|
|
88
|
-
addClaimRewardsToTx(tx: Transaction, address: string): Promise<PendingReward[]>;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export { AdapterCapability, AdapterPositions, AdapterTxResult, HealthInfo, LendingAdapter, LendingRates, NaviAdapter, ProtocolRegistry };
|