Feat(paymaster): Jito bundles SponsorBundle support - #185
Conversation
005423b to
9225c99
Compare
edo-chan
left a comment
There was a problem hiding this comment.
Requesting changes on two bundle-contract blockers:
-
packages/paymaster/kit/src/index.ts:263-289treats 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 asdisallowed paymaster debit. Please reject this input, or otherwise replace it safely before signing, instead of returning a bundle guaranteed to fail. Updatepackages/paymaster/kit/tests/jito.test.ts:37-50, which currently asserts the invalid two-instruction result. -
packages/paymaster/core/src/client.ts:215-220trusts 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 u64estimated_spent_by_paymaster. Add a true two-transaction ordered success test plus malformed-cardinality coverage; the current test atpackages/paymaster/core/tests/client.test.ts:19-58proves 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
left a comment
There was a problem hiding this comment.
Approving overall. The previously noted bundle preparation and response-validation items are non-blocking follow-ups.
Summary
Adds Paymaster SDK support for sponsoring Jito bundles through the new
/paymaster/sponsor/bundleendpoint.Changes
signAndSendBundleAPIs for classic and kit clients.jito-classicpaymaster example..env.examplefor the Jito bundle example.Test Notes
bun --filter '@swig-wallet/paymaster-core' typecheckbun --filter '@swig-wallet/paymaster-classic' typecheckbun --filter '@swig-wallet/paymaster-kit' typecheckbun --filter '@swig-wallet/paymaster-core' buildbun --filter '@swig-wallet/paymaster-classic' buildbun --filter '@swig-wallet/paymaster-kit' buildManual E2E against local backend with Jito bundle flow completed successfully.