obliq-sdk
v0.2.0
Published
OBLIQ TypeScript SDK for Solana paymaster RPC.
Downloads
248
Maintainers
Readme
OBLIQ SDK
OBLIQ SDK is a TypeScript SDK for Solana paymaster RPC servers. It implements the JSON-RPC client directly, with OBLIQ-first names for app code.
Install
bun add obliq-sdk @solana/kitInstall the peer packages used by the full Kit client:
bun add @solana-program/compute-budget @solana-program/token \
@solana/kit-plugin-instruction-plan @solana/kit-plugin-rpc \
@solana/kit-plugin-signerStandalone Client
import { ObliqClient } from "obliq-sdk";
const obliq = new ObliqClient({ rpcUrl: "http://localhost:8080" });
const config = await obliq.getConfig();
const signed = await obliq.signTransaction({
transaction: "base64EncodedTransaction",
});You can also pass the endpoint directly:
import { createObliqClient } from "obliq-sdk";
const obliq = createObliqClient("http://localhost:8080");
const tokens = await obliq.getSupportedTokens();Kit Plugin
import { createEmptyClient } from "@solana/kit";
import { obliqPlugin } from "obliq-sdk";
const client = createEmptyClient().use(
obliqPlugin({ endpoint: "http://localhost:8080" }),
);
const blockhash = await client.obliq.getBlockhash();Kit Client
import { address } from "@solana/kit";
import { createKitObliqClient } from "obliq-sdk";
const client = await createKitObliqClient({
endpoint: "http://localhost:8080",
feePayerWallet: userSigner,
feeToken: address("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"),
rpcUrl: "https://api.mainnet-beta.solana.com",
});Development
bun install
bun test
bun run build
bun run checkHusky runs bun run check before commits. GitHub Actions runs the same build
check on pushes to main and pull requests.
License
MIT
