SDK Reference
Official TypeScript SDK for Solana-native integration with Teranium Protocol. Built with Anchor compatibility and wallet adapter support.
SDK Under Development
Our team is working hard to perfect this SDK and deliver the best developer experience for integrating with Teranium Protocol. We appreciate your patience and support as we build something exceptional. Stay tuned for updates and feel free to reach out with any questions or feedback.
SDK Examples
import { TeraniumClient } from "@teranium/sdk";
import { Connection } from "@solana/web3.js";
// Initialize connection
const connection = new Connection(
"https://api.mainnet-beta.solana.com"
);
// Create client instance
const client = new TeraniumClient({
connection,
wallet
});
// Client is ready to use
console.log("Teranium client initialized");Parameters
connection- Solana RPC connection instancewallet- Connected wallet adapter
API Reference
client.vault.deposit()Deposit tokens into vault
client.vault.withdraw()Withdraw tokens from vault
client.vault.getPosition()Query user position details
client.vault.getVaultInfo()Get vault stats and APY
client.swap.execute()Execute oracle-priced swap
client.swap.getDetails()Get swap quote and pricing
client.swap.getOraclePrice()Fetch current oracle price
client.oracle.getPrice()Get oracle price for asset pair
client.oracle.getPriceWithConfidence()Get price with confidence interval
client.utils.getVaultPDA()Derive vault PDA for mint
client.utils.getPositionPDA()Derive position PDA for user
client.utils.parseTransaction()Parse transaction details
Additional Resources
Full Documentation
Complete protocol docs and guides
Example Apps
Integration examples and demos