Skip to content

Commit

Permalink
fix(liquid-restake): Wait for all promises to be resolved before send…
Browse files Browse the repository at this point in the history
…ing txn array
  • Loading branch information
gulcinuras committed Dec 3, 2024
1 parent 5b0d11c commit 57140dc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/liquid-stake/stAlgoClient.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ declare class TinymanSTAlgoClient extends TinymanBaseClient {
private getUserStateBoxName;
private getApplyRateChangeTxnIfNeeded;
private getUserBoxPaymentTxnIfNeeded;
private getUserBoxPaymentTxn;
private shouldApplyRateChange;
private getApplyRateChangeTxn;
}
Expand Down
14 changes: 8 additions & 6 deletions src/liquid-stake/stAlgoClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ class TinymanSTAlgoClient extends TinymanBaseClient {
})
];

return this.setupTxnFeeAndAssignGroupId({
txns,
additionalFeeCount: 2
});
return Promise.all(
this.setupTxnFeeAndAssignGroupId({
txns,
additionalFeeCount: 2
})
);
}

async decreaseStake(amount: number, userAddress: string) {
Expand All @@ -81,7 +83,7 @@ class TinymanSTAlgoClient extends TinymanBaseClient {
})
];

return this.setupTxnFeeAndAssignGroupId({txns, additionalFeeCount: 2});
return Promise.all(this.setupTxnFeeAndAssignGroupId({txns, additionalFeeCount: 2}));
}

async claimRewards(userAddress: string) {
Expand All @@ -105,7 +107,7 @@ class TinymanSTAlgoClient extends TinymanBaseClient {
})
];

return this.setupTxnFeeAndAssignGroupId({txns, additionalFeeCount: 3});
return Promise.all(this.setupTxnFeeAndAssignGroupId({txns, additionalFeeCount: 3}));
}

async calculateIncreaseStakeFee(accountAddress: string) {
Expand Down

0 comments on commit 57140dc

Please sign in to comment.