@neutral-trade/sdk
v1.0.12
Published
Neutral Trade vault registry and Codama-generated ntbundle client for @solana/kit
Maintainers
Readme
@neutral-trade/sdk
TypeScript SDK for Neutral Trade vaults on Solana — the vault registry plus a Codama-generated client for the ntbundle program, built on @solana/kit.
📚 API reference: https://sdk.neutral.trade
Installation
npm install @neutral-trade/sdk @solana/kit@solana/kit v6 is a peer dependency. Node 20+ is required.
Migrating from 0.x? The 1.x line is a full rewrite on
@solana/kit—PublicKey→Address,BN→bigint, instruction builders return plainInstructionobjects, and theNeutralTradeclass is gone. The 0.x (anchor/web3.js v1) line lives on thelegacy-v0branch.
Usage
import { createSolanaRpc } from "@solana/kit";
import { fetchBundle, getVaultById, vaults } from "@neutral-trade/sdk";
const rpc = createSolanaRpc("https://api.mainnet-beta.solana.com");
const vault = getVaultById(1); // vault registry, bundled
const bundle = await fetchBundle(rpc, vault.address);Build deposit instructions (extensions layer):
import { buildDepositInstructions } from "@neutral-trade/sdk";
const instructions = await buildDepositInstructions(rpc, {
user, // TransactionSigner
bundleAccount: bundleAddress,
amountRaw: 1_000_000n,
});
// Assemble and send with your own transaction pipeline.Low-level generated bindings are also available from the ./generated subpath.
Repo layout & contributing
src/registry/**,src/constants/**,src/types/**— the vault registry. PRs welcome (new vault listings land here).src/generated/**,src/extensions/**,test/client/**— bot-owned: replaced wholesale by automated client drops from the (private) program monorepo, verified byclient-drop.manifest+ CI. Don't edit by hand — changes there belong upstream.packages/widget-sdk/**- embeddable host SDK with Wallet Standard signing, strict transaction verification, vanilla mounting, and a React entry point.examples/widget-vanilla/**,examples/widget-react/**- devnet widget integrations using Wallet Standard discovery.
