diff --git a/examples/refund/reclaim-funds.ts b/examples/refund/reclaim-funds.ts new file mode 100644 index 0000000..1b44635 --- /dev/null +++ b/examples/refund/reclaim-funds.ts @@ -0,0 +1,22 @@ +import { SUI_CLOCK_OBJECT_ID } from "@mysten/sui.js/utils"; +import { RefundManagerSingleton } from "../../src"; +import { RefundPoolPhase } from "../../src/managers/refund/utils"; +import { keypair, provider, signAndExecuteTransaction, suiProviderUrl, user } from "../common"; +import { delegateeKeypair, delegateeUser } from "../dca/common"; + +// yarn ts-node examples/refund/reclaim-funds.ts +(async () => { + const txData = RefundManagerSingleton.getReclaimFundsTransaction({ + poolObjectId: RefundManagerSingleton.REFUND_POOL_OBJECT_ID, + }); + + // const res = await provider.devInspectTransactionBlock({ + // sender: delegateeUser, + // transactionBlock: txData.tx, + // }); + + const res = await signAndExecuteTransaction(txData.tx, delegateeKeypair); + + console.debug("txData: ", txData); + console.debug("res: ", res); +})(); diff --git a/examples/refund/start-reclaim-phase.ts b/examples/refund/start-reclaim-phase.ts new file mode 100644 index 0000000..2361e9b --- /dev/null +++ b/examples/refund/start-reclaim-phase.ts @@ -0,0 +1,23 @@ +import { SUI_CLOCK_OBJECT_ID } from "@mysten/sui.js/utils"; +import { RefundManagerSingleton } from "../../src"; +import { RefundPoolPhase } from "../../src/managers/refund/utils"; +import { keypair, provider, signAndExecuteTransaction, suiProviderUrl, user } from "../common"; +import { delegateeKeypair, delegateeUser } from "../dca/common"; + +// yarn ts-node examples/refund/start-reclaim-phase.ts +(async () => { + const txData = RefundManagerSingleton.startReclaimPhase({ + poolObjectId: RefundManagerSingleton.REFUND_POOL_OBJECT_ID, + clock: SUI_CLOCK_OBJECT_ID, + }); + + // const res = await provider.devInspectTransactionBlock({ + // sender: delegateeUser, + // transactionBlock: txData.tx, + // }); + + const res = await signAndExecuteTransaction(txData.tx, delegateeKeypair); + + console.debug("txData: ", txData); + console.debug("res: ", res); +})();