Skip to content

Commit

Permalink
Add rekey and close remainder to checks (#25)
Browse files Browse the repository at this point in the history
* Add rekey and close remainder to checks

* Changed to patch
gidonkatten authored Nov 22, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 686bd81 commit cb40737
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/mighty-bananas-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@folks-router/js-sdk": patch
---

Add additional checks for rekey and close remainder to for pay/asset transaction
2 changes: 2 additions & 0 deletions packages/folks-router-js-sdk/src/FolksRouterClient.ts
Original file line number Diff line number Diff line change
@@ -99,6 +99,8 @@ export class FolksRouterClient {
const swapEndTxn = unsignedTxns[unsignedTxns.length - 1]!;

// send algo/asset
if (sendAssetTxn.reKeyTo !== undefined) throw Error("Unexpected rekey");
if (sendAssetTxn.closeRemainderTo !== undefined) throw Error("Unexpected close remainder to");
if (encodeAddress(sendAssetTxn.to.publicKey) !== folksRouterAddr) throw Error("Incorrect receiver");
if (
!(fromAssetId === 0 && sendAssetTxn.type == TransactionType.pay) &&

0 comments on commit cb40737

Please sign in to comment.