@paladin-bladesmith/sdk
v0.1.6
Published
SDK for Paladin programs on Solana
Readme
Paladin SDK
A TypeScript SDK for interacting with Paladin Solana programs. Designed to work with any Solana wallet adapter.
Installation
npm install @paladin-bladesmith/sdk
# or
yarn add @paladin-bladesmith/sdkRequirements
- A Solana wallet adapter with sendTransaction capability
- Solana web3.js
Usage
The SDK provides a simple function-based API for interacting with Paladin protocols:
import { lockTokens } from "@paladin-bladesmith/sdk";
import { Connection, PublicKey } from "@solana/web3.js";
const connection = new Connection("https://api.mainnet-beta.solana.com");
const lockupForPubkey = new PublicKey("..."); // The pubkey to lock PAL for
const { signature, confirm } = await lockTokens(wallet, connection, lockupForPubkey, amount);API Reference
lockTokens(wallet, connection, lockupForPubkey, amount)
A function for locking tokens using any wallet adapter.
Parameters
wallet: A wallet adapter withpublicKeyandsendTransactionpropertiesconnection: A Solana Connection instancelockupForPubkey: The public key to lock PAL tokens foramount: Number of tokens to lock (in tokens, not raw units)
Returns
Promise that resolves to an object with:
signature: Transaction signatureconfirm: Function that returns a promise for transaction confirmation
License
Apache 2.0
