# Banxa

### Introduction

Banxa powers the largest digital asset platforms by providing payments infrastructure and regulatory compliance across global markets. Our mission and vision is to build the bridge that provides people in every part of the world access to a fairer and more equitable financial system. Visit the [Banxa](https://docs.banxa.com/docs) documentation to find out more.

### API Host

<table><thead><tr><th width="166">Environment</th><th>API Host</th></tr></thead><tbody><tr><td>Sandbox</td><td>https://cronos.banxa-sandbox.com</td></tr><tr><td>Production</td><td>https://cronos.banxa.com</td></tr></tbody></table>

### NodeJS Examples

#### Generate HMAC Token

```typescript
const generateHmac = (signature: string, nonce: number): string => {
  const crypto = require("crypto");
  const key = "YOUR_BANXA_KEY";
  const secret = "YOUR_BANXA_SECRET_TOKEN";

  const localSignature = crypto
    .createHmac("SHA256", secret)
    .update(signature)
    .digest("hex");
  return `${key}:${localSignature}:${nonce}`;
};
```

{% hint style="info" %}
To get started using the Banxa APIs, please get in touch [here](https://banxa.com/talk-to-our-team/) with the Banxa team in order to get a user key and secret token.
{% endhint %}

#### Send Request

```typescript
const sendGetRequest = (query: string): void => {
  const hostname = "cronos.banxa-sandbox.com";
  const nonce = Date.now();
  const method = "GET";
  let data = method + "\n" + query + "\n" + nonce;

  const hmac = generateHmac(data, nonce);
  const https = require("https");
  const options = {
    hostname: hostname,
    path: query,
    method: method,
    headers: {
      "Content-Type": "application/json",
      Authorization: `Bearer ${hmac}`,
    },
  };

  const req = https.get(
    options,
    (res: {
      statusCode: string;
      headers: string;
      setEncoding: (arg0: string) => void;
      on: (arg0: string, arg1: { (chunk: string): void }) => void;
    }) => {
      console.log(`STATUS: ${res.statusCode}`);
      console.log(`HEADERS: ${JSON.stringify(res.headers)}`);
      res.setEncoding("utf8");
      res.on("data", (chunk: string) => {
        console.log(`BODY: ${chunk}`);
      });
      res.on("end", () => {
        console.log("No more data in response.");
      });
    }
  );

  req.on("error", (e: { message: string }) => {
    console.error(`problem with request: ${e.message}`);
  });
};
```

### **Resources**

Here are additional resources to help you get started with Banxa:

* [Introduction and how to get started with Banxa](https://docs.banxa.com/docs)
* [Generating HMAC Auth](https://docs.banxa.com/docs/step-1-prerequisites#authentication)
* [API References](https://docs.banxa.com/reference/get-fiat-currencies)
* [Changelog](https://docs.banxa.com/changelog)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cronos.org/for-dapp-developers/dev-tools-and-integrations/banxa.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
