Skip to main content

Supported Environments

Ekiden supports the following environments:
EnvironmentNetwork KeyREST URLWebSocket URL
Testnettestnethttps://api.ekiden.fi/api/v1wss://api.ekiden.fi/ws
Use the network parameter during client initialization to select your target environment.

Initialization Parameters

ParameterDescriptionRequiredDefault
networkmainnet or testnetNomainnet
api_keyFor private endpointsYes (if API key auth)
private_keyAlternative for signature-based authYes (if no API key)
subaccount_idOptional subaccount IDNo0
use_websocketEnable WS connectionsNotrue

Examples

TypeScript

import { Ed25519Account, Ed25519PrivateKey } from "@aptos-labs/ts-sdk";

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

const ekiden = new EkidenClient(TESTNET);

const privateKey = new Ed25519PrivateKey(ENV.PRIVATE_KEY);
const account = new Ed25519Account({ privateKey });

const publicKey = account.publicKey.toString();

const nowMs = Date.now();
const nonce = crypto.getRandomValues(new Uint8Array(16))
  .reduce((acc, b) => acc + String.fromCharCode(b), "");
const nonceB64Url = btoa(nonce).replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
const signed = `AUTHORIZE|${nowMs}|${nonceB64Url}`;
const messageBytes = new TextEncoder().encode(signed);
const signature = account.sign(messageBytes).toString();


// Authorize (get JWT)
const { token } = await ekiden.authorize({
  signature,
  public_key: publicKey,
  timestamp_ms: nowMs,
  nonce: nonceB64Url
});

Rust

use ekiden_sdk::{ClientBuilder, Network};

#[tokio::main]
async fn main() {
    let client = ClientBuilder::new(Network::Mainnet)
        .with_subaccount(0)
        .enable_websocket(true)
        .build()
        .unwrap();
}