Getting Started
Getting Started
Section titled “Getting Started”1. Obtain an API Key
Section titled “1. Obtain an API Key”To use the VoidAI Bridge SDK, you must first register as a Tenant.
-
Contact the VoidAI team to register your tenant contract. The team will validate your request and register your tenant with a Primary Wallet (Bittensor).
-
Log in to the VoidAI Admin Panel using your Primary Wallet at app.voidai.com.
-
Navigate to the API Keys section to retrieve your
apiKey(Public) andsecretKey(Private).
Tenant Portal Features
Section titled “Tenant Portal Features”Once registered, the portal provides a full management dashboard:
| Feature | Description |
|---|---|
| Performance | View API key performance, rate limits, and quota usage. |
| Transaction History | Track transactions per key with status visibility. |
| Fee Management | Set your tenant fee percentage for bridge, swap, and CCIP operations. |
| Rewards | View your accumulated fees and request manual payouts. |
Claiming Fees
Section titled “Claiming Fees”2. Installation
Section titled “2. Installation”npm install @voidaisdk/bridge-sdkyarn add @voidaisdk/bridge-sdkIf you plan to use wallet integrations, install the relevant peer dependencies:
# Bittensor / Polkadotnpm install @polkadot/api @polkadot/extension-dapp
# EVMnpm install ethers# ornpm install viem wagmi
# Solananpm install @solana/web3.js @solana/wallet-adapter-react3. Initialization
Section titled “3. Initialization”The SDK supports two modes: Frontend (browser) and Backend (server). Choose based on your deployment context.
Use BridgeSDK for client-side applications. Only your apiKey is required.
import { BridgeSDK } from '@voidaisdk/bridge-sdk';
const sdk = new BridgeSDK({ apiKey: 'YOUR_PUBLIC_API_KEY', environment: 'mainnet', // 'devnet' | 'testnet' | 'mainnet'});
// Wait for authentication (JWT exchange) to completeawait sdk.ready;
console.log('Bridge SDK is ready!');Use BridgeSDKServer for server-side applications. Both apiKey and secretKey are required.
import { BridgeSDKServer } from '@voidaisdk/bridge-sdk';
const serverSdk = new BridgeSDKServer({ apiKey: 'YOUR_PUBLIC_API_KEY', secretKey: 'YOUR_SECRET_KEY', environment: 'mainnet',});
await serverSdk.ready;See Server-Side Usage for the full server integration guide.
4. Configuration
Section titled “4. Configuration”Environments
Section titled “Environments”| Environment | Base URL | Bridge Contract (EVM) | Purpose |
|---|---|---|---|
devnet | https://api-sdk-dev.voidai.envistudios.com/api | 0x6266ce15aC4f32F096Ff91881dd887a0F4bBa569 | Development & Testing |
testnet | https://sdk-backend.voidai.com/sdk | 0x4aA4396BfD6F268b427077079800F420dF947b63 | Staging / Pre-Production |
mainnet | https://sdk.voidai.com/sdk | 0x604e8Ef901C0E69E79463D997ba7D0724A909b84 | Production |
TypeScript Support
Section titled “TypeScript Support”The SDK ships with full TypeScript type definitions. Import types directly as needed:
import { BridgeSwapRequest, BridgeSwapResponse } from '@voidaisdk/bridge-sdk';5. Security Best Practices
Section titled “5. Security Best Practices”Frontend (Browser)
Section titled “Frontend (Browser)”- Initialize the SDK with only your public
apiKey. - Configure Domain Whitelisting in the VoidAI Tenant Portal. The backend validates the
Originheader — requests from non-whitelisted domains are rejected. - Only whitelist domains you control (e.g.
https://myapp.com,http://localhost:3000for development).
Backend (Server)
Section titled “Backend (Server)”- Use both
apiKeyandsecretKey. The SDK exchanges these credentials for a JWT Access Token viaPOST /api/v1/auth/login. - The JWT is automatically managed and refreshed by the SDK for all subsequent API calls.
- Always store keys in environment variables (e.g.
.envfiles) — never hardcode them in source files or commit them to version control.