Skip to content

feat(client): add a Falcon signer's extra fees with signerType - #43

Merged
pbennett merged 1 commit into
mainfrom
feat/falcon-signer
Nov 8, 2026
Merged

pbennett merged 1 commit into
mainfrom
feat/falcon-signer

Conversation

@pbennett

@pbennett pbennett commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

A Falcon-1024 (post-quantum) signature costs 3 fee units instead of 1, so swaps from passkey accounts and Pera and Lute quantum accounts were rejected for their fee. newQuote() and fetchQuote() take signerType ('ed25519', the default, or 'falcon'), sent as the router's signerType parameter. With use-wallet, an account is Falcon when getSignatureType(account.emptySignature) === 'pqsig'.

For a Falcon signer, the SwapComposer adds 0.002 ALGO to the swap's input transfer's fee for each transaction sent from the swap's address whose fee the router's don't include: its app opt-ins, middleware's transactions, addTransaction() and addMethodCall() (and the method's transaction arguments). The fee goes on before the group ID is assigned, and no transaction is added.

It decides from fetchExecuteSwapTxns's signerType, not the quote's echo, so against a router that doesn't include them (an older one, or one mid-update) it adds them for every transaction the account sends. With fetchQuote(), pass signerType to newSwap() too. SwapQuote.signerType says which signer the quote is for. The user pays every fee.

The router side is TxnLab/haystack-router 44b1f4e: a mainnet simulate of swaps for a Falcon account passes with these fees, and the same swaps without them fail. The README, MIDDLEWARE.md and the API docs cover it.

A Falcon-1024 (post-quantum) signature costs 3 fee units instead of 1,
so swaps from passkey accounts and Pera and Lute quantum accounts were
rejected for their fee. newQuote() and fetchQuote() take signerType
('ed25519', the default, or 'falcon'), sent as the router's signerType
parameter; with use-wallet, an account is Falcon when
getSignatureType(account.emptySignature) === 'pqsig'.

For a Falcon signer the SwapComposer adds 0.002 ALGO to the swap's input
transfer's fee for each transaction sent from the swap's address whose
fee the router's don't include: its app opt-ins, middleware's
transactions, addTransaction() and addMethodCall() (and the method's
transaction arguments). It decides from fetchExecuteSwapTxns's
signerType, not the quote's echo, so against a router that doesn't
include them (an older one, or one mid-update) it adds them for every
transaction the account sends. The user pays every fee. With
fetchQuote(), pass signerType to newSwap() too. SwapQuote.signerType
says which signer the quote is for.
@pbennett
pbennett merged commit df476a9 into main Nov 8, 2026
1 check passed
@pbennett
pbennett deleted the feat/falcon-signer branch November 8, 2026 05:37
txnlab-release-bot Bot added a commit that referenced this pull request Nov 8, 2026
# [3.5.0](v3.4.0...v3.5.0) (2026-11-08)

### Features

* **client:** add a Falcon signer's extra fees with signerType ([#43](#43)) ([df476a9](df476a9))
@txnlab-release-bot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant