Developer SDK

Build on Xayerium with Type-Safe SDKs

Comprehensive developer tools for TypeScript, Rust, and Python. Get started in minutes with our intuitive APIs and extensive documentation.

View Docs

Quick Installation

NPM Installation

npm install @xayerium/sdk
import { XayeriumClient } from '@xayerium/sdk'

const client = new XayeriumClient({
  network: 'mainnet-beta',
  rpcUrl: process.env.RPC_URL
})

await client.connect(wallet)
console.log('Connected to Xayerium!')

SDK Features

Everything you need to build production-ready applications on Xayerium

High Performance

Optimized for speed with minimal overhead and efficient resource usage

Type Safety

Full TypeScript support with comprehensive type definitions

CLI Tools

Command-line interface for scaffolding and testing integrations

Code Examples

Extensive collection of examples and starter templates

Modular Design

Import only what you need with tree-shakeable modules

Open Source

MIT licensed with active community contributions

Code Examples

Add Liquidity to Pool

Provide liquidity and start earning real yield

import { XayeriumClient } from '@xayerium/sdk'

const client = new XayeriumClient({ network: 'mainnet-beta' })

// Add liquidity to SOL/USDC pool
const result = await client.liquidity.add({
  pool: 'SOL/USDC',
  tokenA: { amount: 100, mint: 'So11111111111111111111111111111111111111112' },
  tokenB: { amount: 10000, mint: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' },
  slippage: 0.5 // 0.5% slippage tolerance
})

console.log('LP Tokens received:', result.lpTokens)
console.log('Transaction:', result.signature)

Execute Optimized Swap

Leverage execution layer for best prices

import { XayeriumClient } from '@xayerium/sdk'

const client = new XayeriumClient({ network: 'mainnet-beta' })

// Execute optimized swap through execution layer
const swap = await client.execution.swap({
  inputToken: 'SOL',
  outputToken: 'USDC',
  amount: 50,
  maxSlippage: 0.5,
  route: 'auto' // Automatically find best route
})

console.log('Output amount:', swap.outputAmount)
console.log('Price impact:', swap.priceImpact)
console.log('Route taken:', swap.route)

Stake XYR Tokens

Participate in protocol governance

import { XayeriumClient } from '@xayerium/sdk'

const client = new XayeriumClient({ network: 'mainnet-beta' })

// Stake XYR tokens
const stake = await client.staking.stake({
  amount: 5000,
  lockPeriod: '30d' // Lock for 30 days
})

console.log('Staked amount:', stake.amount)
console.log('Expected APY:', stake.apy)
console.log('Unlock date:', stake.unlockDate)

// Check staking rewards
const rewards = await client.staking.getRewards()
console.log('Pending rewards:', rewards.pending)
console.log('Claimed rewards:', rewards.claimed)

API Reference

Client Methods

connect()

Connect wallet to the protocol

disconnect()

Disconnect wallet from protocol

getBalance()

Get token balance for address

getMetrics()

Fetch protocol metrics

Liquidity Methods

add()

Add liquidity to pools

remove()

Remove liquidity from pools

getPools()

List all available pools

getPoolInfo()

Get detailed pool information

Execution Methods

swap()

Execute optimized token swaps

getQuote()

Get swap quotes and routes

getRoute()

Find optimal execution route

estimateFees()

Estimate transaction fees

Staking Methods

stake()

Stake XYR tokens

unstake()

Unstake XYR tokens

getRewards()

Check staking rewards

claimRewards()

Claim pending rewards

Developer Resources

GitHub Repository

View source code and contribute

Visit GitHub

Documentation

Full API reference and guides

Read Docs

Example Projects

Starter templates and samples

View Examples

Ready to Start Building?

Install the SDK and build your first integration in minutes