Skip to main content

Reference

Interfaces, signatures, parameters, and generated references.

Lookup friendly
TOC available

SDK Core Reference

The Ring SDK Core provides the foundational classes and utilities for working with the Ring protocol. This package contains essential primitives like currencies, amounts, and mathematical utilities that are used across all Ring SDK packages.

Overview

This reference documentation covers:

  • Classes - Core classes like Token, CurrencyAmount, Fraction, and Price
  • Enums - Supported chains, trade types, and other enumerations
  • Types - TypeScript type definitions and interfaces

Key Components

Currency Primitives

Mathematical Utilities

  • Fraction - Precise fractional arithmetic
  • Percent - Percentage calculations
  • Price - Exchange rates between currencies

Chain Support

  • ChainId - Supported blockchain networks
  • Network-specific configurations and constants

Getting Started

import { Token, CurrencyAmount, TradeType } from '@ring-protocol/sdk-core'

// Create a token
const USDC = new Token(1, '0xA0b86a33E6417c29C8F6e3b6E4E12A82aA4Ca8e9', 6, 'USDC', 'USD Coin')

// Create an amount
const amount = CurrencyAmount.fromRawAmount(USDC, '1000000') // 1 USDC

For practical integration examples, see the SDK v2 Overview and SDK v2 Guides.