Repository navigation
feat(examples): add SOL v1 payment send examples - #10120
Open
bhavidhingra wants to merge 1 commit into
Open
bhavidhingra wants to merge 1 commit into
bhavidhingra wants to merge 1 commit into
Conversation
v1-payment-bitgo-send.ts drives the BitGo API path (prebuild version:1 -> sign -> /tx/send -> confirm) and asserts the 0x81 prefix and intent.version at prebuild, so a silent v0 fallback cannot read as success. v1-payment-broadcast.ts covers the SDK-direct counterpart through V1PaymentBuilder with wire, 4096-byte, round-trip and on-chain version assertions, plus DRY_RUN. Both proven on staging 2026-11-03: 411-byte v1 wire, /tx/send 200, devnet reports version 1 (txid 4hp72wPr...Er53t). Refs: CHALO-1940
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
Contributor
This branch has not been deployed
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.
Description
Two runnable examples for Solana v1 (SIMD-0296/0385) native SOL payments. They cover the two different claims that keep getting conflated:
examples/ts/sol/v1-payment-bitgo-send.tsversion: 1, wallet platform produces the0x81wire, the SDK signs the txRequest,POST /wallet/{id}/tx/sendaccepts the signed wire.examples/ts/sol/v1-payment-broadcast.tsV1PaymentBuilderproduces a valid v1 wire, the parser round-trips it byte-for-byte, and a node accepts it.examples/ts/sol/sdk-ct-v1-broadcast.tsalready covers the CT variant; there was no plain v1 payment example in the tree (an earlier ad-hoc one was kept untracked and lost).Both examples assert the things that make a silent v0 fallback impossible:
wire[0] === 0x81and (SDK)wire.length <= 4096txRequest.intent.version === 1on the intent-bearing prebuildfromRawTransaction→toBroadcastFormatbyte-identical (SDK)version: 1for the landed transaction, read through raw JSON-RPC (web3.js rejectsmaxSupportedTransactionVersion: 1client-side)They also report per stage (
PREBUILD/SIGN/SEND/CONFIRM) so a failure names the leg that broke, andv1-payment-broadcast.tssupportsDRY_RUN=1to build and assert without broadcasting.No production code changes — these are examples under
examples/ts/sol/, using the repo's existing conventions (repo-root.envvia dotenv,tsx, no hardcoded passphrases).Issue Number
CHALO-1940 — v1 (0x81) wire could not be deserialized in the
/tx/sendpath. The examples are the reproducible proof for that fix.Type of change
How Has This Been Tested?
Static checks on both files:
End-to-end on BitGo staging (
tsol= devnet), 2026-11-03, after BitGo/bitgo-microservices#63793 reached staging:Independently confirmed with raw
getTransaction(maxSupportedTransactionVersion: 1):4hp72wPr5eKrj6NzAamCRUgkMpE7ukJQD94pMJVftDv82Jsa77AyYMBcAaLc6U8HN6CxhKSNyD2p7x5enkvEr53tversion: 1,slot: 518234581,err: null, fee 10,000 lamports[-11000, 0, 0, +1000, 0, 0]— 1,000 lamports transferred, fee exactTo reproduce, see the header of either file. Required env:
SOL_WALLET_ID,SOL_WALLET_PASSPHRASE,RECIPIENT(andSOL_DEVNET_RPCfor the confirm stage). Note wallet permissions are per-wallet (users[]) — an enterprise token withwallet_spend_allstill gets 403missing required wallet permissionon a wallet where the user isview.Checklist
tsx)