Skip to content

[SO-273] Sponsor Cash-Secured Put PTBs in Gas-Station Templates#275

Merged
ewitulsk merged 2 commits into
stagingfrom
SO-273-sponsor-put-ptbs
Jun 30, 2026
Merged

[SO-273] Sponsor Cash-Secured Put PTBs in Gas-Station Templates#275
ewitulsk merged 2 commits into
stagingfrom
SO-273-sponsor-put-ptbs

Conversation

@ewitulsk

Copy link
Copy Markdown
Owner

SO-273

PR #270 added frontend put PTB builders targeting the new put_bucket / session_put_bucket Move modules, but protocol_templates() in the gas-station service (rust-backend/crates/sui-tx/src/tx/template.rs) was never updated — so those PTBs matched no sponsored template and failed to sponsor.

Added the missing put templates, mirroring their call twins:

  • Wallet: put_write, put_buy (put_bucket::execute_write), put_exercise, put_redeem.
  • DeepBook: put_exercise_with_bm_withdraw — settle + withdraw the option coin out of the BM, then put_bucket::exercise.
  • Session: session_put_write, session_put_buy (session_put_bucket::execute_write_with_session), session_put_exercise, session_put_redeem.

Generalized the existing execute_write_flow / session_write_flow closures over the option module so calls and puts share one definition; added a small single_call helper for the exercise/redeem shapes.

Notes

  • The frontend builds no put burn_expired (wallet or session), so none is added — templates match exactly what the frontend emits.
  • Tests added/extended for every new shape (put_wallet_flows_match, plus put cases folded into the bm-withdraw and session-flow tests). cargo test -p sui-tx green (23 passing).

🤖 Generated with Claude Code

PR #270 added frontend put PTB builders (put_bucket / session_put_bucket)
but protocol_templates() was never updated, so those PTBs matched no
sponsored template.

- Wallet: put_write, put_buy, put_exercise, put_redeem.
- DeepBook: put_exercise_with_bm_withdraw.
- Session: session_put_write, session_put_buy, session_put_exercise,
  session_put_redeem (no put burn_expired — the frontend builds none).
- Generalized execute_write_flow / session_write_flow over the option
  module so calls and puts share one definition; tests for each shape.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sui-options Ready Ready Preview, Comment Jun 30, 2026 4:54am

Request Review

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ewitulsk ewitulsk merged commit c51ba6b into staging Jun 30, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant