From 4a421b7962491bcd7df84f2044663de1862720a0 Mon Sep 17 00:00:00 2001 From: gidonkatten Date: Tue, 24 Dec 2024 17:00:52 +0000 Subject: [PATCH] return group transaction for register online --- .changeset/calm-cobras-fetch.md | 5 +++++ src/algo-liquid-governance/v2/governance.ts | 13 ++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 .changeset/calm-cobras-fetch.md diff --git a/.changeset/calm-cobras-fetch.md b/.changeset/calm-cobras-fetch.md new file mode 100644 index 00000000..1961814e --- /dev/null +++ b/.changeset/calm-cobras-fetch.md @@ -0,0 +1,5 @@ +--- +"@folks-finance/algorand-sdk": patch +--- + +return group transaction for register online diff --git a/src/algo-liquid-governance/v2/governance.ts b/src/algo-liquid-governance/v2/governance.ts index 0a0af7a5..54d3e42b 100644 --- a/src/algo-liquid-governance/v2/governance.ts +++ b/src/algo-liquid-governance/v2/governance.ts @@ -391,7 +391,7 @@ function prepareClaimPremintTransaction( /** * - * Returns a transaction to register escrow online. + * Returns a group transaction to register an escrow online. * * @param distributor - distributor that has escrow * @param senderAddr - account address for the sender @@ -405,7 +405,7 @@ function prepareClaimPremintTransaction( * @param params - suggested params for the transactions with the fees overwritten * @returns Transaction register online transaction */ -function prepareRegisterEscrowOnlineTransaction( +function prepareRegisterEscrowOnlineTransactions( distributor: Distributor, senderAddr: string, registerFeeAmount: number | bigint, @@ -416,7 +416,7 @@ function prepareRegisterEscrowOnlineTransaction( voteLastRound: number | bigint, voteKeyDilution: number | bigint, params: SuggestedParams, -): Transaction { +): Transaction[] { const escrowAddr = getDistributorLogicSig(senderAddr).address(); // check register fee is either 0 ALGO or 0.2 ALGO @@ -446,16 +446,15 @@ function prepareRegisterEscrowOnlineTransaction( ], suggestedParams: { ...params, flatFee: true, fee: 3000 }, }); - const txns = atc.buildGroup().map(({ txn }) => { + return atc.buildGroup().map(({ txn }) => { txn.group = undefined; return txn; }); - return txns[0]; } /** * - * Returns a transaction to register escrow offline. + * Returns a transaction to register an escrow offline. * * @param distributor - distributor that has escrow * @param senderAddr - account address for the sender @@ -622,7 +621,7 @@ export { prepareUnmintPremintTransaction, prepareUnmintTransactions, prepareClaimPremintTransaction, - prepareRegisterEscrowOnlineTransaction, + prepareRegisterEscrowOnlineTransactions, prepareRegisterEscrowOfflineTransaction, prepareCommitOrVoteTransaction, prepareRemoveLiquidGovernanceEscrowTransactions,