Network endpoint configuration.

Pass a custom NetworkConfig to O2Client or O2Api to connect to a private or custom O2 Exchange deployment.

const config: NetworkConfig = {
apiBase: "https://my-gateway.example.com",
wsUrl: "wss://my-gateway.example.com/v1/ws",
fuelRpc: "https://mainnet.fuel.network/v1/graphql",
faucetUrl: null,
};
const client = new O2Client({ config });
interface NetworkConfig {
    apiBase: string;
    faucetUrl: null | string;
    fuelRpc: string;
    wsUrl: string;
}

Properties

apiBase: string

Base URL for REST API endpoints (e.g., "https://api.testnet.o2.app").

faucetUrl: null | string

Faucet URL for minting test tokens, or null if unavailable (mainnet).

fuelRpc: string

Fuel Network GraphQL RPC endpoint.

wsUrl: string

WebSocket URL for real-time data (e.g., "wss://api.testnet.o2.app/v1/ws").