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