Currency & Amounts
Amounts in the ParaSta API are always integers in the smallest unit of the currency. There are no floats. This avoids rounding errors.
Decimals by currency
Section titled “Decimals by currency”| Currency | Decimals | 1 unit equals |
|---|---|---|
USDT | 6 | 1000000 |
USDC | 6 | 1000000 |
ETH | 18 | 1000000000000000000 |
SOL | 9 | 1000000000 |
KRW | 0 | 1 |
Examples
Section titled “Examples”To charge 10 USDT:
{ "amount": 10000000, "currency": "USDT" }To charge 0.05 ETH:
{ "amount": 50000000000000000, "currency": "ETH" }Display formatting
Section titled “Display formatting”Convert to a human-readable string with the helper of your choice. Example:
function format(amount, decimals) { const s = amount.toString().padStart(decimals + 1, '0'); return `${s.slice(0, -decimals)}.${s.slice(-decimals).replace(/0+$/, '') || '0'}`;}format(10000000n, 6); // "10"Currency conversion (Settlement)
Section titled “Currency conversion (Settlement)”When settlement_mode: "krw", ParaSta exchanges the received crypto to KRW at the rate quoted at confirmation time. See Settlement and GET /v1/exchange_rates.