Rest API

Generating a Signature for API Requests

Before making a call to the Nami API, you need to generate a signature using your API secret. The signature ensures the integrity and authenticity of your request. Follow the steps below to generate the signature in JavaScript:

  1. Add Timestamp: Generate a timestamp to include in your request parameters.

    paramsObject['timestamp'] = Date.now();
  2. Prepare the Query String: Convert the parameters object to a query string.

    const queryString = new URLSearchParams(paramsObject).toString();
  3. Generate the Signature: Use the CryptoJS library or any other library to generate an HMAC SHA-256 signature using your query string and API secret.

    const signature = CryptoJS.HmacSHA256(queryString, nami_api_secret).toString();
  4. Set the Signature in Environment Variables:

    paramsObject['signature'] = signature;

Dive into the specifics of each API endpoint by checking out our complete documentation.

Close Orderchevron-rightClose All Orderchevron-rightGet Order Openchevron-rightGet Order Historychevron-rightGet Order Trade Historychevron-rightGet 24h ticker pricechevron-rightGet Market Depthchevron-right
circle-info

If you receive an error, please check the table below to understand the error code and its meaning

Error Codechevron-right

Last updated