• Public
  • Public/Protected
  • All

Atomex SDK

Atomex SDK

npm version Tests License: MIT

Please read the following documents prior to start building on this SDK:

  1. Overview of the Atomex protocol and roles
  2. Atomex protocol entities and API guide
  3. Atomex integration tutorial

In order to run the interactive tutorial:

  1. Install IJavacript
  2. Make sure all dependencies are installed make install
  3. Run make tutorial

Check out the typedoc reference at sdk.atomex.me


Latest version is available on NPM:

npm install atomex-sdk

SDK components

The Atomex SDK has mainly 2 components:

  • Atomex REST API wrapper Atomex
  • Various helpers for each supported currency/token (derived from Helpers class)

Currently SDK supports the following currencies/tokens:

  • XTZ (tez) — TezosHelpers
  • ETH (ether) — EthereumHelpers


Atomex API

Start working with Atomex API by creating an instance of the wrapper class.

const atomex = Atomex.create("testnet")

There are several predefined configs:

  • mainnet — for production use
  • testnet — for testing purposes, on-chain operations tracked in:
    • Ethereum: Goerli
    • Tezos: Carthagenet
  • localhost — for Atomex developers only (debugging purposes)

Public methods

Market data can be queried without authentication.

There is also a helper for estimating order price:


Atomex uses simple JWT scheme (without refresh tokens). Client is responsible for tracking the expiration and requesting new tokens.
Read more about the authentication process in the overview.

await atomex.getAuthToken({ 
timeStamp: 1606227074301,
message: 'Signing in ',
algorithm: 'Ed25519:Blake2b'

The following structure is returned if everything is ok:

{ "id":
"expires": 1606326394064

Assign the token to the Atomex instance:


Private methods

With auth token assigned we can work with orders:

And swaps:


For each currency create an according helper class instance:

const tez = await TezosHelpers.create("testnet");

You can also specify custom RPC endpoint:

cosnt eth = await EthereumHelpers.create("testnet", "https://goerli.infura.io/v3/12345");

Helpers classes implement a single interface providing methods for interacting with Atomex contracts:

Encoding/decoding crypto primitives:

Generating data for Atomex.getAuthToken request:

Estimating fees:

Tracking transaction confirmations and validating parameters:

Currency-specific helpers


Install dependencies

make install

Run linter and compile the library


Run unit tests

make test

In order to update the OpenAPI specification:

make spec-update

Generate TypeDoc

make typedoc

Publish to NPM

Bump version in package.json, commit & push

make release

Generated using TypeDoc