/Docs/SDK Reference/SDK Overview

SDK Overview

StableTypeScriptTree-shakable

The Ramestta SDK is a modular TypeScript library for building applications on the Ramestta network. It provides a clean, intuitive API for common blockchain operations with optional plugins for popular web3 libraries.

â„šī¸Design Philosophy
The SDK follows a plugin architecture - install only what you need. The core package is lightweight (~20KB gzipped), with optional plugins for ethers.js and web3.js integration.

Available Packages

PackageVersionDescriptionSize
@ramestta/sdk1.0.0Core SDK with essential features~20KB
@ramestta/sdk-ethers1.0.3ethers.js v6 integration plugin~8KB
@ramestta/sdk-web31.0.0web3.js v4 integration plugin~8KB
@ramestta/sdk-react1.0.0React hooks & components~15KB
@ramestta/contracts1.1.0Smart contract ABIs & addresses~12KB
@ramestta/staking-sdk1.0.1Staking operations SDK~18KB
@ramestta/bridge-sdk1.0.1Cross-chain bridge SDK~22KB
✅npm Organization
All packages are published under the @ramestta organization. View all packages at npmjs.com/org/ramestta

Quick Start

Installation

npm install @ramestta/sdk

Basic Usage

basic-usage.tstypescript
import { RamaPay } from '@ramestta/sdk';

// Initialize SDK
const ramaPay = new RamaPay({
  network: 'mainnet', // or 'testnet'
});

// Get provider
const provider = ramaPay.getProvider();

// Check balance
const balance = await ramaPay.getBalance('0x742d35Cc...');
console.log('Balance:', balance.formatted, 'RAMA');

With ethers.js Plugin

with-ethers.tstypescript
import { RamaPay } from '@ramestta/sdk';
import { EthersPlugin } from '@ramestta/sdk-ethers';
import { ethers } from 'ethers';

// Initialize with ethers.js plugin
const ramaPay = new RamaPay({
  network: 'mainnet',
  plugins: [new EthersPlugin()]
});

// Access ethers provider
const provider = ramaPay.ethers.provider;
const signer = ramaPay.ethers.signer;

// Use ethers.js features
const contract = new ethers.Contract(address, abi, signer);

With web3.js Plugin

with-web3.tstypescript
import { RamaPay } from '@ramestta/sdk';
import { Web3Plugin } from '@ramestta/sdk-web3';
import Web3 from 'web3';

// Initialize with web3.js plugin
const ramaPay = new RamaPay({
  network: 'mainnet',
  plugins: [new Web3Plugin()]
});

// Access web3 instance
const web3 = ramaPay.web3.instance;

// Use web3.js features
const contract = new web3.eth.Contract(abi, address);

Core Features

🔗

Network Connection

Easy connection to mainnet and testnet with automatic RPC failover

💰

Balance & Transfers

Query balances and send transactions with a simple API

📜

Contract Interaction

Deploy and interact with smart contracts easily

🔐

Wallet Integration

Connect to MetaMask, RamaPay, and other wallets

🌉

Bridge Support

Built-in support for RamaBridge operations

📊

Utilities

Format conversions, gas estimation, and more

Plugin System

The SDK uses a plugin system to extend functionality. Plugins are loaded at initialization and can add new features or integrate with external libraries.

Built-in Plugins

PluginPackageFeatures
EthersPlugin@ramestta/sdk-ethersethers.js provider, signers, contracts
Web3Plugin@ramestta/sdk-web3web3.js instance, accounts, contracts
✅Choose Your Library
Use the plugin that matches your preferred web3 library. Both plugins provide full access to the underlying library while maintaining SDK conventions.

TypeScript Support

The SDK is written in TypeScript and provides complete type definitions. This enables excellent IDE support with autocomplete, type checking, and documentation.

  • Full type definitions for all APIs
  • Generic types for custom contract ABIs
  • Strict null checks and error handling
  • IntelliSense support in VS Code

Browser & Node.js Support

EnvironmentSupportNotes
Node.js✅ v18+Full support
Browser✅ ModernES2020+ required
React Native✅With polyfills
Electron✅Full support

Error Handling

The SDK provides typed errors for common failure scenarios:

error-handling.tstypescript
import { RamaPay, RamaError, NetworkError, InsufficientFundsError } from '@ramestta/sdk';

try {
  await ramaPay.sendTransaction({...});
} catch (error) {
  if (error instanceof InsufficientFundsError) {
    console.log('Not enough RAMA for transaction');
  } else if (error instanceof NetworkError) {
    console.log('Network connection failed');
  } else if (error instanceof RamaError) {
    console.log('SDK error:', error.message);
  }
}

Resources

Found an issue with this page? Report on GitHub