Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return group transaction for register online #69

Merged
merged 1 commit into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading