@t2000/sdk 0.9.1 → 0.9.4
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.cjs +256 -0
- package/dist/adapters/index.cjs.map +1 -1
- package/dist/adapters/index.d.cts +1 -1
- package/dist/adapters/index.d.ts +1 -1
- package/dist/adapters/index.js +256 -0
- package/dist/adapters/index.js.map +1 -1
- package/dist/{index-C7W686z2.d.cts → index-CrLRqDFL.d.cts} +34 -0
- package/dist/{index-C7W686z2.d.ts → index-CrLRqDFL.d.ts} +34 -0
- package/dist/index.cjs +580 -133
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +580 -133
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -98,6 +98,14 @@ interface LendingAdapter {
|
|
|
98
98
|
healthFactorAfter: number;
|
|
99
99
|
currentHF: number;
|
|
100
100
|
}>;
|
|
101
|
+
addWithdrawToTx?(tx: Transaction, address: string, amount: number, asset: string): Promise<{
|
|
102
|
+
coin: TransactionObjectArgument;
|
|
103
|
+
effectiveAmount: number;
|
|
104
|
+
}>;
|
|
105
|
+
addSaveToTx?(tx: Transaction, address: string, coin: TransactionObjectArgument, asset: string, options?: {
|
|
106
|
+
collectFee?: boolean;
|
|
107
|
+
}): Promise<void>;
|
|
108
|
+
addRepayToTx?(tx: Transaction, address: string, coin: TransactionObjectArgument, asset: string): Promise<void>;
|
|
101
109
|
}
|
|
102
110
|
interface SwapAdapter {
|
|
103
111
|
readonly id: string;
|
|
@@ -115,6 +123,11 @@ interface SwapAdapter {
|
|
|
115
123
|
to: string;
|
|
116
124
|
}>;
|
|
117
125
|
getPoolPrice(): Promise<number>;
|
|
126
|
+
addSwapToTx?(tx: Transaction, address: string, inputCoin: TransactionObjectArgument, from: string, to: string, amount: number, maxSlippageBps?: number): Promise<{
|
|
127
|
+
outputCoin: TransactionObjectArgument;
|
|
128
|
+
estimatedOut: number;
|
|
129
|
+
toDecimals: number;
|
|
130
|
+
}>;
|
|
118
131
|
}
|
|
119
132
|
|
|
120
133
|
interface T2000Options {
|
|
@@ -386,6 +399,14 @@ declare class NaviAdapter implements LendingAdapter {
|
|
|
386
399
|
buildRepayTx(address: string, amount: number, asset: string): Promise<AdapterTxResult>;
|
|
387
400
|
maxWithdraw(address: string, _asset: string): Promise<MaxWithdrawResult>;
|
|
388
401
|
maxBorrow(address: string, _asset: string): Promise<MaxBorrowResult>;
|
|
402
|
+
addWithdrawToTx(tx: Transaction, address: string, amount: number, asset: string): Promise<{
|
|
403
|
+
coin: TransactionObjectArgument;
|
|
404
|
+
effectiveAmount: number;
|
|
405
|
+
}>;
|
|
406
|
+
addSaveToTx(tx: Transaction, address: string, coin: TransactionObjectArgument, asset: string, options?: {
|
|
407
|
+
collectFee?: boolean;
|
|
408
|
+
}): Promise<void>;
|
|
409
|
+
addRepayToTx(tx: Transaction, address: string, coin: TransactionObjectArgument, asset: string): Promise<void>;
|
|
389
410
|
}
|
|
390
411
|
|
|
391
412
|
declare const descriptor$2: ProtocolDescriptor;
|
|
@@ -407,6 +428,11 @@ declare class CetusAdapter implements SwapAdapter {
|
|
|
407
428
|
to: string;
|
|
408
429
|
}>;
|
|
409
430
|
getPoolPrice(): Promise<number>;
|
|
431
|
+
addSwapToTx(tx: Transaction, address: string, inputCoin: TransactionObjectArgument, from: string, to: string, amount: number, maxSlippageBps?: number): Promise<{
|
|
432
|
+
outputCoin: TransactionObjectArgument;
|
|
433
|
+
estimatedOut: number;
|
|
434
|
+
toDecimals: number;
|
|
435
|
+
}>;
|
|
410
436
|
}
|
|
411
437
|
|
|
412
438
|
declare const descriptor$1: ProtocolDescriptor;
|
|
@@ -441,10 +467,18 @@ declare class SuilendAdapter implements LendingAdapter {
|
|
|
441
467
|
buildWithdrawTx(address: string, amount: number, asset: string): Promise<AdapterTxResult & {
|
|
442
468
|
effectiveAmount: number;
|
|
443
469
|
}>;
|
|
470
|
+
addWithdrawToTx(tx: Transaction, address: string, amount: number, asset: string): Promise<{
|
|
471
|
+
coin: TransactionObjectArgument;
|
|
472
|
+
effectiveAmount: number;
|
|
473
|
+
}>;
|
|
474
|
+
addSaveToTx(tx: Transaction, address: string, coin: TransactionObjectArgument, asset: string, options?: {
|
|
475
|
+
collectFee?: boolean;
|
|
476
|
+
}): Promise<void>;
|
|
444
477
|
buildBorrowTx(address: string, amount: number, asset: string, options?: {
|
|
445
478
|
collectFee?: boolean;
|
|
446
479
|
}): Promise<AdapterTxResult>;
|
|
447
480
|
buildRepayTx(address: string, amount: number, asset: string): Promise<AdapterTxResult>;
|
|
481
|
+
addRepayToTx(tx: Transaction, address: string, coin: TransactionObjectArgument, asset: string): Promise<void>;
|
|
448
482
|
maxWithdraw(address: string, _asset: string): Promise<{
|
|
449
483
|
maxAmount: number;
|
|
450
484
|
healthFactorAfter: number;
|
|
@@ -98,6 +98,14 @@ interface LendingAdapter {
|
|
|
98
98
|
healthFactorAfter: number;
|
|
99
99
|
currentHF: number;
|
|
100
100
|
}>;
|
|
101
|
+
addWithdrawToTx?(tx: Transaction, address: string, amount: number, asset: string): Promise<{
|
|
102
|
+
coin: TransactionObjectArgument;
|
|
103
|
+
effectiveAmount: number;
|
|
104
|
+
}>;
|
|
105
|
+
addSaveToTx?(tx: Transaction, address: string, coin: TransactionObjectArgument, asset: string, options?: {
|
|
106
|
+
collectFee?: boolean;
|
|
107
|
+
}): Promise<void>;
|
|
108
|
+
addRepayToTx?(tx: Transaction, address: string, coin: TransactionObjectArgument, asset: string): Promise<void>;
|
|
101
109
|
}
|
|
102
110
|
interface SwapAdapter {
|
|
103
111
|
readonly id: string;
|
|
@@ -115,6 +123,11 @@ interface SwapAdapter {
|
|
|
115
123
|
to: string;
|
|
116
124
|
}>;
|
|
117
125
|
getPoolPrice(): Promise<number>;
|
|
126
|
+
addSwapToTx?(tx: Transaction, address: string, inputCoin: TransactionObjectArgument, from: string, to: string, amount: number, maxSlippageBps?: number): Promise<{
|
|
127
|
+
outputCoin: TransactionObjectArgument;
|
|
128
|
+
estimatedOut: number;
|
|
129
|
+
toDecimals: number;
|
|
130
|
+
}>;
|
|
118
131
|
}
|
|
119
132
|
|
|
120
133
|
interface T2000Options {
|
|
@@ -386,6 +399,14 @@ declare class NaviAdapter implements LendingAdapter {
|
|
|
386
399
|
buildRepayTx(address: string, amount: number, asset: string): Promise<AdapterTxResult>;
|
|
387
400
|
maxWithdraw(address: string, _asset: string): Promise<MaxWithdrawResult>;
|
|
388
401
|
maxBorrow(address: string, _asset: string): Promise<MaxBorrowResult>;
|
|
402
|
+
addWithdrawToTx(tx: Transaction, address: string, amount: number, asset: string): Promise<{
|
|
403
|
+
coin: TransactionObjectArgument;
|
|
404
|
+
effectiveAmount: number;
|
|
405
|
+
}>;
|
|
406
|
+
addSaveToTx(tx: Transaction, address: string, coin: TransactionObjectArgument, asset: string, options?: {
|
|
407
|
+
collectFee?: boolean;
|
|
408
|
+
}): Promise<void>;
|
|
409
|
+
addRepayToTx(tx: Transaction, address: string, coin: TransactionObjectArgument, asset: string): Promise<void>;
|
|
389
410
|
}
|
|
390
411
|
|
|
391
412
|
declare const descriptor$2: ProtocolDescriptor;
|
|
@@ -407,6 +428,11 @@ declare class CetusAdapter implements SwapAdapter {
|
|
|
407
428
|
to: string;
|
|
408
429
|
}>;
|
|
409
430
|
getPoolPrice(): Promise<number>;
|
|
431
|
+
addSwapToTx(tx: Transaction, address: string, inputCoin: TransactionObjectArgument, from: string, to: string, amount: number, maxSlippageBps?: number): Promise<{
|
|
432
|
+
outputCoin: TransactionObjectArgument;
|
|
433
|
+
estimatedOut: number;
|
|
434
|
+
toDecimals: number;
|
|
435
|
+
}>;
|
|
410
436
|
}
|
|
411
437
|
|
|
412
438
|
declare const descriptor$1: ProtocolDescriptor;
|
|
@@ -441,10 +467,18 @@ declare class SuilendAdapter implements LendingAdapter {
|
|
|
441
467
|
buildWithdrawTx(address: string, amount: number, asset: string): Promise<AdapterTxResult & {
|
|
442
468
|
effectiveAmount: number;
|
|
443
469
|
}>;
|
|
470
|
+
addWithdrawToTx(tx: Transaction, address: string, amount: number, asset: string): Promise<{
|
|
471
|
+
coin: TransactionObjectArgument;
|
|
472
|
+
effectiveAmount: number;
|
|
473
|
+
}>;
|
|
474
|
+
addSaveToTx(tx: Transaction, address: string, coin: TransactionObjectArgument, asset: string, options?: {
|
|
475
|
+
collectFee?: boolean;
|
|
476
|
+
}): Promise<void>;
|
|
444
477
|
buildBorrowTx(address: string, amount: number, asset: string, options?: {
|
|
445
478
|
collectFee?: boolean;
|
|
446
479
|
}): Promise<AdapterTxResult>;
|
|
447
480
|
buildRepayTx(address: string, amount: number, asset: string): Promise<AdapterTxResult>;
|
|
481
|
+
addRepayToTx(tx: Transaction, address: string, coin: TransactionObjectArgument, asset: string): Promise<void>;
|
|
448
482
|
maxWithdraw(address: string, _asset: string): Promise<{
|
|
449
483
|
maxAmount: number;
|
|
450
484
|
healthFactorAfter: number;
|