feat(sdk): Vector TypeScript SDK — facade, per-scheme entrypoints, inspection, migration scanner#9
Open
L0STE wants to merge 14 commits into
Open
feat(sdk): Vector TypeScript SDK — facade, per-scheme entrypoints, inspection, migration scanner#9L0STE wants to merge 14 commits into
L0STE wants to merge 14 commits into
Conversation
…mmarize bounds, doc limits, feePayer/unsupported-scheme tests
… advance); offline verify now covers all 5 schemes
…ulls no per-scheme crypto); native HKDF; offline verify via registry
Move @noble/post-quantum and @blueshift-gg/hawk512 from dependencies to optional peerDependencies (with peerDependenciesMeta optional: true) and devDependencies. ed25519 / secp256k1 / eip191 users now install zero post-quantum code; falcon512 / hawk512 users add the one library their subpath needs. README documents the install model.
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
A TypeScript SDK for Vector: a scheme-agnostic
Vectorfacade plus offline artifact inspection and fund-in-PDA migration tooling. You authorize work in plain Solana instructions; the SDK wires theadvance+passthroughand the transaction layout.Modular by scheme — install/bundle only what you use
The default
vector-sdkentrypoint is scheme-agnostic and pulls no per-scheme crypto (only@noble/curves/ed25519for PDA derivation + nativecrypto). Construct aVectorfrom its scheme's subpath:vector-sdk/ed25519vectorEd25519(seed)@noble/curves/ed25519vector-sdk/secp256k1vectorSecp256k1(privKey)@noble/curves/secp256k1vector-sdk/eip191vectorEip191(privKey)vector-sdk/falcon512vectorFalcon512(keypair)@noble/post-quantum(optional peer dep)vector-sdk/hawk512vectorHawk512(keypair)@blueshift-gg/hawk512(optional peer dep)Importing a scheme subpath also registers its offline verifier. SHA-256/HKDF use native
crypto(no@noble/hashesfor those). Dependency isolation is verified in the builtdist.The post-quantum libraries (
@noble/post-quantum,@blueshift-gg/hawk512) are optional peer dependencies — a base install pulls neither. ed25519 / secp256k1 / eip191 users install zero post-quantum code; add@noble/post-quantumonly forvector-sdk/falcon512and@blueshift-gg/hawk512only forvector-sdk/hawk512.Surface
Facade (
Vector):authorize(nonce, op)(op = Instruction | Instruction[],[]= revoke),chain(ordered, forward-secure),branch(sign N, execute one),withdraw/close,derive(independent sub-accounts),register/initialize,status,nonce(the only async call). Signing is synchronous and offline (air-gapped friendly).Inspection (core):
serializeArtifact/deserializeArtifact,decodeOps,summarize,review,verifyArtifact— offline verification for all five schemes via a registry the scheme subpaths populate on import.Migration (
wallet/migrate/scan): fund-in-PDA helpers + migration builders +scanMigration— audits whether an old authority's native SOL, SPL + Token-2022 accounts, stake accounts, and declared mint/freeze authorities have moved to the PDA;report.completegates the deprecation cutoff.Low-level chain engine:
vector-sdk/branching.Tests
solana-test-validator(ed25519 / secp256k1 / eip191 / hawk512 programs): forward-secrecy ordering, branch exclusivity, sub-account independence, the secp256k1 / eip191 / Hawk-512 facade flows, Hawk's 3-tx registration, fund-in-PDA SOL spend,scanMigrationagainst live RPC, and offline verify across all five schemes.tsc --noEmitclean.Notes / follow-ups
register()returns the ordered groups); its advance carries a compute-budget bump committed to by the digest.deriveis available for the 32-byte-key schemes; post-quantum sub-accounts are built from their own keypairs.Usage guide:
sdk/ts/README.md.