Skip to content

Commit

Permalink
return group transaction for register online (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
gidonkatten authored Dec 24, 2024
1 parent df19732 commit 30119c7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/calm-cobras-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@folks-finance/algorand-sdk": patch
---

return group transaction for register online
13 changes: 6 additions & 7 deletions src/algo-liquid-governance/v2/governance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -622,7 +621,7 @@ export {
prepareUnmintPremintTransaction,
prepareUnmintTransactions,
prepareClaimPremintTransaction,
prepareRegisterEscrowOnlineTransaction,
prepareRegisterEscrowOnlineTransactions,
prepareRegisterEscrowOfflineTransaction,
prepareCommitOrVoteTransaction,
prepareRemoveLiquidGovernanceEscrowTransactions,
Expand Down

0 comments on commit 30119c7

Please sign in to comment.