This guide will help you install and set up the Ekiden SDK for TypeScript. It covers all the steps from prerequisites to making your first API call, with clear placeholders for you to insert your own values. Python and Rust SDKs will be added later.

Prerequisites

Before installing the Ekiden SDK, make sure you have the following in place:

  • Account Access: An Ekiden account or testnet credentials
  • Node.js: Version 14 or higher
  • Package Manager: npm, yarn, pnpm, or bun
  • System Clock: Must be synchronized (e.g., using NTP)

Installation

Install the Ekiden TypeScript SDK using your preferred package manager:

pnpm add @ekiden/ts-sdk
npm install @ekiden/ts-sdk
yarn add @ekiden/ts-sdk
bun add @ekiden/ts-sdk

Quick Start

Import and initialize the client, authorize via wallet signature, and make a test call:

import { EkidenClient, TESTNET } from '@ekiden/ts-sdk';

const ekiden = new EkidenClient(TESTNET);

const { token } = await ekiden.authorize({
  signature: '0x...',
  public_key: '0x...',
});

ekiden.setToken(token);

const markets = await ekiden.getMarkets();
console.log("Markets:", markets);

Configuration

  • Endpoints: Defaults to mainnet. Use TESTNET when initializing the client for testing.
  • Proxies: Set HTTP_PROXY / HTTPS_PROXY if your environment requires it.
  • Rate Limits: For high-volume access, contact the Ekiden team for rate limit upgrades.
  • Time Sync: Ensure your system clock is synced or authentication may fail.

Authentication

To use authenticated endpoints, sign a message with your Aptos-compatible wallet and pass it to authorize() along with your public key. A valid token will be returned and must be set with setToken().

const { token } = await ekiden.authorize({
  signature: '0x...',
  public_key: '0x...',
});

ekiden.setToken(token);

Example: Fetch Market Data

const markets = await ekiden.getMarkets();
console.log("Available markets:", markets);

Troubleshooting

  • Install errors: Check Node.js version, network connection, and package manager
  • Invalid signature: Ensure the signature and public key are valid and not expired
  • Clock drift: Sync your local machine’s time using NTP
  • API failures: Retry authorization and recheck the endpoint environment (TESTNET, MAINNET)
  • Other issues: Open an issue on GitHub or reach out via Discord

Learn More

➡️ Ekiden TypeScript SDK on GitHub

For questions or integration help, join the Ekiden Discord or raise an issue in the GitHub repository.