@t2000/sdk 0.5.4 → 0.5.6
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 +6 -23
- package/dist/adapters/index.cjs.map +1 -1
- package/dist/adapters/index.js +6 -23
- package/dist/adapters/index.js.map +1 -1
- package/dist/index.cjs +6 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -23
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -588,8 +588,8 @@ async function buildWithdrawTx(client, address, amount) {
|
|
|
588
588
|
const rawAmount = Number(usdcToRaw(effectiveAmount));
|
|
589
589
|
const tx = new transactions.Transaction();
|
|
590
590
|
tx.setSender(address);
|
|
591
|
-
|
|
592
|
-
target: `${config.package}::incentive_v3::
|
|
591
|
+
tx.moveCall({
|
|
592
|
+
target: `${config.package}::incentive_v3::entry_withdraw_v2`,
|
|
593
593
|
arguments: [
|
|
594
594
|
tx.object(CLOCK),
|
|
595
595
|
tx.object(config.oracle.priceOracle),
|
|
@@ -600,15 +600,8 @@ async function buildWithdrawTx(client, address, amount) {
|
|
|
600
600
|
tx.object(config.incentiveV2),
|
|
601
601
|
tx.object(config.incentiveV3),
|
|
602
602
|
tx.object(SUI_SYSTEM_STATE)
|
|
603
|
-
]
|
|
604
|
-
typeArguments: [pool.suiCoinType]
|
|
605
|
-
});
|
|
606
|
-
const [coin] = tx.moveCall({
|
|
607
|
-
target: "0x2::coin::from_balance",
|
|
608
|
-
arguments: [balance],
|
|
609
|
-
typeArguments: [pool.suiCoinType]
|
|
603
|
+
]
|
|
610
604
|
});
|
|
611
|
-
tx.transferObjects([coin], address);
|
|
612
605
|
return { tx, effectiveAmount };
|
|
613
606
|
}
|
|
614
607
|
async function buildBorrowTx(client, address, amount, options = {}) {
|
|
@@ -616,8 +609,8 @@ async function buildBorrowTx(client, address, amount, options = {}) {
|
|
|
616
609
|
const [config, pool] = await Promise.all([getConfig(), getUsdcPool()]);
|
|
617
610
|
const tx = new transactions.Transaction();
|
|
618
611
|
tx.setSender(address);
|
|
619
|
-
|
|
620
|
-
target: `${config.package}::incentive_v3::
|
|
612
|
+
tx.moveCall({
|
|
613
|
+
target: `${config.package}::incentive_v3::entry_borrow_v2`,
|
|
621
614
|
arguments: [
|
|
622
615
|
tx.object(CLOCK),
|
|
623
616
|
tx.object(config.oracle.priceOracle),
|
|
@@ -628,18 +621,8 @@ async function buildBorrowTx(client, address, amount, options = {}) {
|
|
|
628
621
|
tx.object(config.incentiveV2),
|
|
629
622
|
tx.object(config.incentiveV3),
|
|
630
623
|
tx.object(SUI_SYSTEM_STATE)
|
|
631
|
-
]
|
|
632
|
-
typeArguments: [pool.suiCoinType]
|
|
633
|
-
});
|
|
634
|
-
const [borrowedCoin] = tx.moveCall({
|
|
635
|
-
target: "0x2::coin::from_balance",
|
|
636
|
-
arguments: [balance],
|
|
637
|
-
typeArguments: [pool.suiCoinType]
|
|
624
|
+
]
|
|
638
625
|
});
|
|
639
|
-
if (options.collectFee) {
|
|
640
|
-
addCollectFeeToTx(tx, borrowedCoin, "borrow");
|
|
641
|
-
}
|
|
642
|
-
tx.transferObjects([borrowedCoin], address);
|
|
643
626
|
return tx;
|
|
644
627
|
}
|
|
645
628
|
async function buildRepayTx(client, address, amount) {
|