Introduction
Authentication
To access the MoreSwap API you need to generate an API key. You can get one by emailing us at[email protected]
Rate limits
Here are the rate limits for our API endpoints:- 600 calls per minute
- 10 calls per second
Common
All requests must include the following headers:
x-api-key: string
- You api key.x-api-time: string
- Current utc timestamp.
Methods
GET /api/v1/queryCurrencies
Fetches a list of all supported currencies.
Returns:
CurrencyData[]
GET /api/v1/getCurrency
Fetches detailed information for a specific currency by its symbol.
Parameters:
symbol: string
- The symbol of the currency.
Returns:
CurrencyData
GET /api/v1/queryPairs
Fetches exchangeable pairs for a given currency and optional network.
Parameters:
fromCurrency: string
- The base currency for the pairs.
Returns:
CurrencyData[]
GET /api/v1/queryRange
Fetches the exchange range for a currency pair.
Parameters:
fromCurrency: string
- The source currency.toCurrency: string
- The target currency.
Returns:
ExchangeRange
POST /api/v1/createExchange
Creates an exchange transaction.
Parameters:
fromCurrency: string
- The source currency.toCurrency: string
- The target currency.amount: string
- The amount to exchange.address: string
- The recipient address.extraId?: string
- Optional extra identifier for the transaction.
Returns:
Result<StatusInfo>
GET /api/v1/queryStatus
Fetches the status of a transaction.
Parameters:
id: string
- The transaction ID.
Returns:
StatusInfo
GET /api/v1/queryEstimatedAmount
Fetches the estimated amount for a given exchange.
Parameters:
amount: string
- The amount to be exchanged.fromCurrency: string
- The source currency.toCurrency: string
- The target currency.
Returns:
EstimatedAmount
GET /api/v1/checkAddress
Validates a given address for a specific network.
network: string
- The network of the address.address: string
- The address to validate.
Returns:
boolean
Models
Result Interface
Field Type Description code number Status code of the API response error string (optional) Error details if the request fails message string (optional) Human-readable message about the result data T (generic) The actual data returned from the API CurrencyData Interface
Field Type Description symbol string Ticker + network identifier name string Full name of the cryptocurrency image string URL to the cryptocurrency image externalId boolean Indicates if there is an external ID network string Blockchain network ticker string Ticker symbol ExchangeRange Interface
Field Type Description minAmount string Minimum exchangeable amount maxAmount string | undefined Maximum exchangeable amount EstimatedAmount Interface
Field Type Description amount string Estimated amount received speed string (optional) Transaction speed (e.g., fast, normal, slow) message string (optional) Additional information StatusInfo interface
Field Type Description status Status The current transaction status payinAddress string Blockchain address to send funds payoutAddress string Blockchain address to receive funds payinExtraId string (optional) Memo or payment ID for the pay-in payoutExtraId string (optional) Memo or payment ID for the pay-out fromCurrency string Ticker of the currency being sent toCurrency string Ticker of the currency being received fromNetwork string (optional) Blockchain network of the sent currency toNetwork string (optional) Blockchain network of the received currency id string Unique transaction identifier expectedSendAmount string Amount expected to be sent expectedReceiveAmount string Amount expected to be received updatedAt string Timestamp of the last update createdAt string Timestamp when the transaction was created payinHash string (optional) Blockchain transaction hash for the pay-in payoutHash string (optional) Blockchain transaction hash for the pay-out Status Enum
Status Description new Transaction created but not yet initiated. waiting Waiting for the user to send cryptocurrency. confirming Blockchain is confirming the pay-in transaction. exchanging Cryptocurrency exchange is in progress. sending Funds are being sent to the payout address. finished Transaction completed successfully. failed Transaction failed due to an error. refunded Transaction was refunded to the user. verifying Transaction details are being verified.