NodeRailsCRYPTO PAYMENT INFRASTRUCTURE
DocumentationAPI Reference
Dashboard

Prices

Convert between fiat and crypto amounts in real time. This is a public API, no authentication required.

Convert fiat to crypto

Fiat to cryptotypescript
const quote = await noderails.prices.convert({
  symbol: 'ETH',
        currency: 'USD',
        amountFiat: 100,
});

console.log(quote.tokenAmount); // "0.0421"
      console.log(quote.priceFiat);   // "2374.12"
      console.log(quote.currency);    // "USD"
console.log(quote.cachedAt);    // ISO timestamp

Convert crypto to fiat

Crypto to USDtypescript
const reverse = await noderails.prices.convert({
  symbol: 'USDC',
  currency: 'USD',
  tokenAmount: 500,
});

console.log(reverse.amountFiat); // "500.00"
console.log(reverse.currency);   // "USD"

Get token price

Get current pricetypescript
const ethPrice = await noderails.prices.getPrice('ETH', 'EUR');
console.log(ethPrice.priceFiat); // "2190.44"
console.log(ethPrice.currency);  // "EUR"

Methods reference

MethodDescription
convert(params)Convert between fiat and crypto amounts
getPrice(symbol, currency?)Get the current token price in a fiat currency (default USD)

TypeScript types

Type importstypescript
import type {
  PriceConversion,
  PriceConvertParams,
} from '@noderails/sdk';

Response body reference

All responses are wrapped in { success: true, data: ... }. The fields below describe what's inside data.

getPrice() response

Token Price

symbolstringToken symbol (uppercased), e.g. "ETH"
currencystringFiat currency code, e.g. "USD" or "EUR"
priceFiatstringCurrent token price in the selected fiat currency
cachedAtstringISO 8601 timestamp of when the price was cached

convert() with amountFiat

Fiat → Crypto

symbolstringToken symbol
currencystringFiat currency code
priceFiatstringCurrent token price in selected fiat
cachedAtstringISO 8601 cache timestamp
amountFiatnumberFiat amount you provided
tokenAmountstringCrypto amount (18-decimal string, e.g. "0.030810000000000000")

convert() with tokenAmount

Crypto → Fiat

symbolstringToken symbol
currencystringFiat currency code
priceFiatstringCurrent token price in selected fiat
cachedAtstringISO 8601 cache timestamp
tokenAmountnumberToken amount you provided
amountFiatstringFiat value (8-decimal string, e.g. "4868.50500000")