Add create-tap-with-borrowed-liquidity convenience function#11
Merged
obycode merged 1 commit intoobycode:mainfrom Mar 8, 2026
Merged
Conversation
Combines create-tap and borrow-liquidity into a single transaction so new participants can set up both their outgoing capacity (deposit) and incoming capacity (borrowed liquidity) atomically, reducing the on-chain footprint for the common mailbox setup case. Also adds two tests covering the happy path and invalid-signature error path for the new function.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
create-tap-with-borrowed-liquiditytocontracts/reservoir.clar, combiningcreate-tapandborrow-liquidityinto a single transactionMotivation
In the common setup flow for a new participant (e.g. a stackmail agent opening a mailbox), they need to:
Currently this requires two separate transactions. This convenience function combines them atomically, reducing the on-chain footprint and simplifying client-side setup code.
Parameters
Same as
create-tap+borrow-liquiditycombined:stackflow/token/tap-amount/tap-nonce→ forwarded tocreate-tapborrow-amount/borrow-fee/my-balance/reservoir-balance/my-signature/reservoir-signature/borrow-nonce→ forwarded toborrow-liquidityReturns
(ok expire-block)— the burn block height when the borrowed liquidity expires (same asborrow-liquidity).Test plan
(err u125)(InvalidSignature)🤖 Generated with Claude Code