feat(sdk-kit): typed @solana/kit plugin with ts-rs generated types#602
Draft
amilz wants to merge 1 commit intosolana-foundation:feat/sdkfrom
Draft
feat(sdk-kit): typed @solana/kit plugin with ts-rs generated types#602amilz wants to merge 1 commit intosolana-foundation:feat/sdkfrom
amilz wants to merge 1 commit intosolana-foundation:feat/sdkfrom
Conversation
Add ts-rs derives to Rust types in crates/types and crates/core to auto-generate TypeScript param/response types for the Surfnet cheatcode RPC methods. Introduces crates/sdk-kit as a @solana/kit plugin package with 29 passing integration tests. - ts-rs v12 as optional dep behind `ts` feature flag - 26 generated .ts files from Rust source of truth - surfpool() kit plugin + createSurfpoolClient() factory - requestTransformer adds surfnet_ prefix on the wire - Full test suite covering all 22 cheatcode methods
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
ts-rsderives to Rust types incrates/typesandcrates/coreto auto-generate TypeScript param/response types from the Rust source of truthcrates/sdk-kit— a typed@solana/kitplugin for all 22 Surfnet cheatcode RPC methodsWhat's in
crates/sdk-kitsurfpool()kit plugin that addsclient.surfnet.*cheatcodescreateSurfpoolClient()batteries-included factory (rpc + subscriptions + surfnet + airdrop + payer + tx pipeline)requestTransformeraddssurfnet_prefix on the wire so consumer code is clean:client.surfnet.timeTravel().tstype files from Rust viats-rsSurfnetCheatcodesApiintersection type mapping method names to generated param/response typesHow type generation works
Generates
.tsfiles from#[derive(ts_rs::TS)]annotations behind thetsfeature flag. A post-gen script patches missing imports. Seecrates/sdk-kit/DEVELOPING.mdfor full details.Test plan
cargo check -p surfpool-types -p surfpool-core— clean build withouttsfeaturecargo test --features ts -p surfpool-types— 68 tests pass (binding exports + existing)bunx tsc --noEmit— zero type errorsbun test— 29 pass, 1 skip (writeProgramknown surfpool crash), 0 fail