Docs
TypeScript SDK
The public package is @gundrink/light-wire. It is maintained in packages/sdk so it can be published on its own, separate from the private app and API.
Package
Source, tests, README, and the MIT license all live in packages/sdk. The package has no dependency on the Express app.
Publish access is public. Build with pnpm --filter @gundrink/light-wire build, which writes dist/ for npm.
import { LightWire } from "@gundrink/light-wire";
const lightWire = new LightWire({
baseUrl: process.env.LIGHT_WIRE_API_URL!,
apiKey: process.env.LIGHT_WIRE_API_KEY,
});
const quote = await lightWire.createQuote({
cluster: "devnet",
inputMint: "INPUT_MINT_ADDRESS",
outputMint: "OUTPUT_MINT_ADDRESS",
amount: "1000000",
slippageBps: 50,
});Split it into a public GitHub repository
The SDK history can be published without the rest of the monorepo. Create an empty public repository, then push the subtree branch. Review the branch before the first push.
git subtree split --prefix=packages/sdk -b public-sdk
git push git@github.com:gundrink/light-wire-sdk.git public-sdk:main