npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ramestta/sdk

v1.0.0

Published

Official SDK for interacting with Ramestta Network - L2 Blockchain

Readme

@ramestta/sdk

Official JavaScript/TypeScript SDK for interacting with Ramestta Network - L3 Blockchain

npm version License: MIT

Forked from Polygon's matic.js and customized for Ramestta Network

Network Architecture

L1: Ethereum (Root Chain)
     ↓
L2: Polygon (Parent Chain) - Root contracts deployed here
     ↓
L3: Ramestta (Child Chain) - Application chain

Important: All root/bridge contracts are deployed on Polygon L2 (not Ethereum directly).

Installation

npm install @ramestta/sdk
# or
yarn add @ramestta/sdk
# or
pnpm add @ramestta/sdk

Web3.js Plugin

npm install @ramestta/sdk-web3

Ethers.js Plugin

npm install @ramestta/sdk-ethers

Quick Start

Using with Ethers.js

import { POSClient, use } from "@ramestta/sdk";
import { Web3ClientPlugin } from "@ramestta/sdk-ethers";

// Install ethers plugin
use(Web3ClientPlugin);

const posClient = new POSClient();

await posClient.init({
    network: "mainnet",  // or "testnet"
    version: "v1",
    parent: {
        provider: parentProvider,  // Polygon L2 provider (where root contracts are)
        defaultConfig: {
            from: userAddress
        }
    },
    child: {
        provider: childProvider,   // Ramestta L3 provider
        defaultConfig: {
            from: userAddress
        }
    }
});

Using with Web3.js

import { POSClient, use } from "@ramestta/sdk";
import { Web3ClientPlugin } from "@ramestta/sdk-web3";

// Install web3 plugin
use(Web3ClientPlugin);

const posClient = new POSClient();

await posClient.init({
    network: "mainnet",
    version: "v1",
    parent: {
        provider: parentProvider,
        defaultConfig: {
            from: userAddress
        }
    },
    child: {
        provider: childProvider,
        defaultConfig: {
            from: userAddress
        }
    }
});

Network Configuration

Ramestta Mainnet

  • Chain ID: 1370
  • RPC URL: https://blockchain.ramestta.com
  • Explorer: https://ramascan.com
  • Native Token: RAMA

Ramestta Testnet

  • Chain ID: 1371
  • RPC URL: https://testnet.ramestta.com
  • Explorer: https://testnet.ramascan.com

Features

ERC20 Token Operations

// Get ERC20 token instance
const erc20Token = posClient.erc20('<token-address>', true);  // true for parent chain

// Get balance
const balance = await erc20Token.getBalance(userAddress);
console.log('Balance:', balance);

// Approve
const approveTx = await erc20Token.approve('1000000000000000000');
const txHash = await approveTx.getTransactionHash();
const receipt = await approveTx.getReceipt();

// Deposit (L1 -> L2)
const depositTx = await erc20Token.deposit('1000000000000000000', userAddress);
await depositTx.getReceipt();

MRC20 (Native RAMA Token)

The patched MRC20 contract is deployed at 0x0000000000000000000000000000000000001010:

// Get native RAMA balance on Ramestta
const ramaBalance = await posClient.child.provider.getBalance(userAddress);

// For MRC20 contract operations
const mrc20 = posClient.erc20('0x0000000000000000000000000000000000001010', false);
const balance = await mrc20.getBalance(userAddress);

MRC20 Contract Features (Patched Version):

  • name() returns "Ramestta"
  • symbol() returns "RAMA"
  • decimals() returns 18
  • totalSupply() returns 1,000,000,000 RAMA
  • balanceOf(address) returns native balance
  • transfer(to, value) - payable transfer
  • withdraw(amount) - withdraw to L1
  • deposit(user, amount) - deposit from L1

ERC721 NFT Operations

const erc721Token = posClient.erc721('<token-address>', true);

// Get token balance
const balance = await erc721Token.getBalance(userAddress);

// Approve
const approveTx = await erc721Token.approve(tokenId);

// Deposit NFT (L1 -> L2)
const depositTx = await erc721Token.deposit(tokenId, userAddress);

ERC1155 Operations

const erc1155Token = posClient.erc1155('<token-address>', true);

// Get balance
const balance = await erc1155Token.getBalance(userAddress, tokenId);

// Deposit
const depositTx = await erc1155Token.deposit({
    amount: 10,
    tokenId: tokenId,
    userAddress: userAddress
});

Withdraw (L2 -> L1)

Withdrawals from Ramestta to Ethereum require a checkpoint:

// Step 1: Initiate withdraw on L2
const erc20Child = posClient.erc20('<token-address>', false);
const withdrawTx = await erc20Child.withdrawStart('1000000000000000000');
const txHash = await withdrawTx.getTransactionHash();

// Step 2: Wait for checkpoint (usually ~30 mins)
const isCheckpointed = await posClient.isCheckPointed(txHash);

// Step 3: Exit on L1
const erc20Parent = posClient.erc20('<token-address>', true);
const exitTx = await erc20Parent.withdrawExit(txHash);
await exitTx.getReceipt();

Check if Exit is Processed

const isExited = await erc20Parent.isWithdrawExited(txHash);
console.log('Exit processed:', isExited);

Contract Addresses

Ramestta Mainnet (Chain ID: 1370)

| Contract | Address | |----------|---------| | MRC20 (Native RAMA) | 0x0000000000000000000000000000000000001010 | | Child Chain | 0x0000000000000000000000000000000000001001 | | State Receiver | 0x0000000000000000000000000000000000001001 |

Ethereum Mainnet (Parent Chain)

Contract addresses for the parent chain will be updated after deployment.

Error Handling

try {
    const tx = await erc20Token.deposit(amount, userAddress);
    await tx.getReceipt();
} catch (error) {
    if (error.type === 'insufficient_balance') {
        console.log('Insufficient balance');
    } else if (error.type === 'insufficient_allowance') {
        console.log('Please approve tokens first');
    } else {
        console.error('Transaction failed:', error.message);
    }
}

TypeScript Support

The SDK is written in TypeScript and provides full type definitions:

import { POSClient, ERC20, setProofApi } from "@ramestta/sdk";
import type { 
    IPOSClientConfig, 
    ITransactionOption,
    ITransactionWriteResult 
} from "@ramestta/sdk";

Browser Usage

<script src="https://cdn.jsdelivr.net/npm/@ramestta/sdk/dist/ramestta.umd.min.js"></script>
<script>
    const { POSClient } = window.Ramestta;
    // Use SDK...
</script>

Examples

See the examples folder for more detailed usage examples.

Migration from Polygon matic.js

If you're migrating from Polygon's matic.js:

  1. Replace package: @maticnetwork/maticjs@ramestta/sdk
  2. Update network config to use Ramestta RPC URLs
  3. Update contract addresses to Ramestta contracts
  4. MRC20 (native token) is at 0x0000000000000000000000000000000000001010

API Reference

POSClient

| Method | Description | |--------|-------------| | init(config) | Initialize the client | | erc20(address, isParent) | Get ERC20 token instance | | erc721(address, isParent) | Get ERC721 token instance | | erc1155(address, isParent) | Get ERC1155 token instance | | isCheckPointed(txHash) | Check if transaction is checkpointed | | isDeposited(txHash) | Check if deposit is completed |

ERC20

| Method | Description | |--------|-------------| | getBalance(address) | Get token balance | | getAllowance(address) | Get allowance for spender | | approve(amount) | Approve tokens | | approveMax() | Approve max tokens | | deposit(amount, address) | Deposit to L2 | | withdrawStart(amount) | Start withdrawal on L2 | | withdrawExit(txHash) | Complete withdrawal on L1 |

Contributing

Contributions are welcome! Please read our contributing guidelines.

License

MIT © Ramestta Tech Team

Links

Support