Skip to content

Feat(paymaster): Jito bundles SponsorBundle support - #185

Merged
thewuhxyz merged 4 commits into
mainfrom
wuh/paymaster-jito
Jul 23, 2026
Merged

Feat(paymaster): Jito bundles SponsorBundle support#185
thewuhxyz merged 4 commits into
mainfrom
wuh/paymaster-jito

Conversation

@thewuhxyz

Copy link
Copy Markdown
Collaborator

Summary

Adds Paymaster SDK support for sponsoring Jito bundles through the new /paymaster/sponsor/bundle endpoint.

Changes

  • Add sponsor-bundle API client/types.
  • Add SDK idempotency key support for submit operations.
  • Add Jito bundle helpers for:
    • creating paymaster-funded tip instructions
    • detecting existing Jito tips
    • validating minimum tip amounts
  • Add signAndSendBundle APIs for classic and kit clients.
  • Add serialized bundle submit helpers.
  • Add a jito-classic paymaster example.
  • Add .env.example for the Jito bundle example.
  • Improve API error handling for gRPC-transcoded responses.

Test Notes

  • bun --filter '@swig-wallet/paymaster-core' typecheck
  • bun --filter '@swig-wallet/paymaster-classic' typecheck
  • bun --filter '@swig-wallet/paymaster-kit' typecheck
  • bun --filter '@swig-wallet/paymaster-core' build
  • bun --filter '@swig-wallet/paymaster-classic' build
  • bun --filter '@swig-wallet/paymaster-kit' build

Manual E2E against local backend with Jito bundle flow completed successfully.

@thewuhxyz
thewuhxyz requested a review from edo-chan July 20, 2026 15:01
@thewuhxyz
thewuhxyz force-pushed the wuh/paymaster-jito branch from 005423b to 9225c99 Compare July 23, 2026 12:19

@edo-chan edo-chan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes on two bundle-contract blockers:

  1. packages/paymaster/kit/src/index.ts:263-289 treats an ALT-loaded paymaster-to-Jito transfer as an absent tip and appends a second static tip. The returned bundle still contains the original ALT-backed paymaster debit, which the merged backend rejects as disallowed paymaster debit. Please reject this input, or otherwise replace it safely before signing, instead of returning a bundle guaranteed to fail. Update packages/paymaster/kit/tests/jito.test.ts:37-50, which currently asserts the invalid two-instruction result.

  2. packages/paymaster/core/src/client.ts:215-220 trusts the success response without validating bundle cardinality or required fields. Please require non-empty request and bundle IDs, a string signature array with exactly one signature per submitted transaction, and a decimal u64 estimated_spent_by_paymaster. Add a true two-transaction ordered success test plus malformed-cardinality coverage; the current test at packages/paymaster/core/tests/client.test.ts:19-58 proves only a one-item response.

The endpoint and field names, unchanged signed-byte submission, and mainnet, tip, and fee-payer checks otherwise align with the merged backend contract.

@edo-chan edo-chan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving overall. The previously noted bundle preparation and response-validation items are non-blocking follow-ups.

@thewuhxyz
thewuhxyz merged commit 2ff790c into main Jul 23, 2026
5 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.

2 participants