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

@oraichain/oraidex-evm-sdk

v0.2.5

Published

Oraidex EVM SDK

Readme

Oraichain EVM SDK

npm version License: MIT

A TypeScript SDK for interacting with ORAIDEX on EVM-compatible blockchains through precompile Wasmd module in blockchain. All messages here were build in cosmwasm format.

Installation

npm install @oraichain/oraichain-evm-sdk
# or
yarn add @oraichain/oraichain-evm-sdk

Features

  • OSOR (Oraichain Smart Order Router): Optimized routing for token swaps on ORAIDEX
  • API Client: Simplified HTTP requests with built-in error handling
  • Utilities: Helper functions for common operations with Cosmos and EVM compatibility
  • CosmWasm Integration: Built-in support for CosmWasm message formats

Usage

Basic Setup

import { Osor } from '@oraichain/oraichain-evm-sdk';

// Initialize the OSOR client with the API URL
const osorUrl = 'https://api.oraidex.io';
const osor = new Osor(osorUrl);

Return ExecuteMsg Swap

import { 
  Osor, 
  CurrencyAmount, 
  Currency, 
  TradeType 
} from '@oraichain/oraichain-evm-sdk';

// Initialize the OSOR client
const osor = new Osor('https://api.oraidex.io');

// Define the swap parameters
const inputAmount = new CurrencyAmount({
  amount: '1000000', // Amount in smallest unit
  currency: {
    address: 'orai1k0y373yxqne22pc9g7jvnr4qulw5gfwyw0k7sp',  // Token address in bech32 format
    decimals: 6,
    symbol: 'USDT',
    chainId: 1
  }
});

const outputCurrency = new Currency({
  address: 'orai',  // Native ORAI coin
  decimals: 6,
  symbol: 'ORAI',
  chainId: 1
});

// Generate swap messages
const swapMsg = await osor.getSwapOraidexMsg(
  inputAmount,
  outputCurrency,
  TradeType.EXACT_INPUT,
  {}, // Swap options
  1, // Slippage tolerance (%)
  [] // Affiliates
);

// Use the generated message in your transaction
console.log(swapMsg);

Using the API Client

import { ApiClient } from '@oraichain/oraichain-evm-sdk';

const apiClient = new ApiClient({
  baseURL: 'https://api.oraidex.io',
});

// Make a GET request
const response = await apiClient.get('/path/to/endpoint');
console.log(response.data);

// Make a POST request with CosmWasm message
const postResponse = await apiClient.post('/path/to/endpoint', {
  token: 'orai1k0y373yxqne22pc9g7jvnr4qulw5gfwyw0k7sp',
  amount: '1000000'
});
console.log(postResponse.data);

API Reference

Osor Class

The main class for interacting with the ORAIDEX Smart Order Router through CosmWasm messages.

Methods

  • getSwapOraidexMsg(amount, quoteCurrency, swapType, swapOptions, slippageTolerance, affiliates): Generates CosmWasm-formatted swap messages for ORAIDEX using the OSOR router.

OsorRouter Class

Handles routing logic for finding optimal swap paths on ORAIDEX.

OsorMsgComposer Class

Composes CosmWasm-formatted messages for different types of operations on ORAIDEX.

ApiClient Class

A wrapper around Axios for making HTTP requests with standardized error handling and CosmWasm message support.

Methods

  • get(url, config): Make a GET request
  • post(url, data, config): Make a POST request
  • put(url, data, config): Make a PUT request
  • delete(url, config): Make a DELETE request
  • patch(url, data, config): Make a PATCH request

Development

# Install dependencies
npm install

# Build the package
npm run build

# Run tests
npm test

# Lint the code
npm run lint

# Format the code
npm run format

License

MIT