Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.radixagent.com/llms.txt

Use this file to discover all available pages before exploring further.

API Reference

Complete TypeScript API documentation for all classes, interfaces, and utilities in Radix Agent Kit.

Core Classes

🤖 AI Agent

RadixAgent

Main AI agent class with natural language blockchain interface

🌐 Network & Gateway

RadixGatewayClient

Gateway API client for Radix network communication

🔧 Transaction Building

RadixTransactionBuilder

Low-level transaction construction and signing

Wallet Management

RadixMnemonicWallet

24-word BIP-39 mnemonic wallet implementation

VaultWallet

Hardware wallet interface and support

RadixAccount

Account operations and management

RadixWallet Interface

Base wallet interface and types

Blockchain Operations

Token

Token creation, minting, and transfer operations

DeFi

Staking, liquidity pools, and token swapping

Component

Smart contract interactions and state queries

Tools

All 16 AI tools for blockchain operations

Security & Utilities

TransactionSecurity

Transaction validation and rate limiting

SecureKeyStorage

Encrypted storage for sensitive data

FaucetHelper

Testnet funding utilities and methods

Quick Start

Installation

npm install radix-agent-kit

Basic Usage

import { RadixAgent, RadixNetwork } from "radix-agent-kit";

const agent = new RadixAgent({
  networkId: RadixNetwork.Stokenet,
  openaiApiKey: process.env.OPENAI_API_KEY,
  mnemonic: process.env.RADIX_MNEMONIC
});

await agent.run("What's my XRD balance?");

Direct API Usage

import { 
  RadixGatewayClient,
  RadixMnemonicWallet,
  Token,
  DeFi 
} from "radix-agent-kit";

const gateway = new RadixGatewayClient({ 
  networkId: RadixNetwork.Stokenet 
});

const wallet = RadixMnemonicWallet.fromMnemonic(mnemonic, {
  networkId: 2
});

Type Definitions

Networks

enum RadixNetwork {
  Mainnet = 'mainnet',
  Stokenet = 'stokenet'
}

Common Types

interface WalletConfig {
  networkId: number;
  applicationName?: string;
  accountIndex?: number;
}

interface TransferOptions {
  fromAccount: string;
  toAccount: string;
  resourceAddress: string;
  amount: string;
}

Error Handling

All API methods follow consistent error handling patterns:
try {
  const result = await api.method(params);
  // Handle success
} catch (error) {
  if (error instanceof RadixError) {
    // Handle specific Radix errors
  }
  // Handle general errors
}

Network Support

NetworkNetworkIdGateway URL
Stokenet2https://stokenet.radixdlt.com
Mainnet1https://mainnet.radixdlt.com

TypeScript Support: All classes and methods include full TypeScript type definitions for enhanced developer experience.