Skip to main content
Use the Chain enum to specify which blockchain you want to analyze. The SDK provides type-safe chain identifiers for all supported networks.

Chain Enum

import { Chain } from '@webacy-xyz/sdk';

// Use in API calls
const result = await client.addresses.analyze('0x...', {
  chain: Chain.ETH,
});

Supported Chains

ChainEnum ValueAPI ValueType
EthereumChain.ETHethEVM
SolanaChain.SOLsolSolana
BaseChain.BASEbaseEVM
BNB Smart ChainChain.BSCbscEVM
PolygonChain.POLpolEVM
ArbitrumChain.ARBarbEVM
OptimismChain.OPToptEVM
TONChain.TONtonTON
SuiChain.SUIsuiSui
StellarChain.STELLARstellarStellar
BitcoinChain.BTCbtcBitcoin
SeiChain.SEIseiSei
Sepolia (Testnet)Chain.SEPsepEVM

Default Chain

Set a default chain to avoid specifying it on every request.
Prerequisites:
  • SDK installed (npm install @webacy-xyz/sdk)
  • API key available (from your Webacy dashboard)
import { ThreatClient, Chain } from '@webacy-xyz/sdk';

const client = new ThreatClient({
  apiKey: process.env.WEBACY_API_KEY,
  defaultChain: Chain.ETH,
});

// No need to specify chain - uses ETH
const result = await client.addresses.analyze('0x742d35Cc...');

// Override for a specific request
const solResult = await client.addresses.analyze('So1ana...', {
  chain: Chain.SOL,
});

Chain Compatibility

The SDK provides utilities to check chain compatibility:
import { Chain, isEvmChain, getChainCompatibility, ChainCompatibility } from '@webacy-xyz/sdk';

// Check if chain is EVM-compatible
isEvmChain(Chain.ETH);  // true
isEvmChain(Chain.SOL);  // false

// Get compatibility group
getChainCompatibility(Chain.ETH);  // ChainCompatibility.EVM
getChainCompatibility(Chain.SOL);  // ChainCompatibility.SOLANA
getChainCompatibility(Chain.TON);  // ChainCompatibility.TON

Compatibility Groups

GroupChains
EVMETH, SEP, ARB, POL, OPT, BASE, BSC
SOLANASOL
TONTON
BTCBTC
SEISEI
SUISUI
STELLARSTELLAR

Chain IDs

For EVM chains, you can access the chain ID:
import { CHAIN_IDS, Chain } from '@webacy-xyz/sdk';

CHAIN_IDS[Chain.ETH];   // 1
CHAIN_IDS[Chain.BSC];   // 56
CHAIN_IDS[Chain.POL];   // 137
CHAIN_IDS[Chain.OPT];   // 10
CHAIN_IDS[Chain.ARB];   // 42161
CHAIN_IDS[Chain.BASE];  // 8453

Chain Names

Get human-readable chain names:
import { CHAIN_NAMES, Chain } from '@webacy-xyz/sdk';

CHAIN_NAMES[Chain.ETH];     // "Ethereum"
CHAIN_NAMES[Chain.SOL];     // "Solana"
CHAIN_NAMES[Chain.BSC];     // "BNB Smart Chain"
CHAIN_NAMES[Chain.STELLAR]; // "Stellar"

Address Validation

The SDK automatically validates addresses for the specified chain:
// Valid Ethereum address
await client.addresses.analyze('0x742d35Cc6634C0532925a3b844Bc454e4438f44e', {
  chain: Chain.ETH,
});

// Valid Solana address
await client.addresses.analyze('So11111111111111111111111111111111111111112', {
  chain: Chain.SOL,
});

// Invalid address throws ValidationError
try {
  await client.addresses.analyze('invalid', { chain: Chain.ETH });
} catch (error) {
  // ValidationError: Invalid Ethereum address format
}

Address Formats

Chain TypeFormatExample
EVM42-char hex with 0x prefix0x742d35Cc6634C0532925a3b844Bc454e4438f44e
SolanaBase58, 32-44 charsSo11111111111111111111111111111111111111112
BitcoinVarious formatsbc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq
TONBase64 or rawEQBvW8Z5huBkMJYdnfAEM5JqTNLuuFU8cAF7P2CvbXj8-E-t
Stellar56-char starting with GGCKV3Z7HN3WUT2WIOUM4SMAS5DN3X5LWQ6FQXVH7ZRMWKFU4Z5IPQWWN
Sui66-char hex with 0x prefix0x7d2f...
SeiBech32 with sei prefixsei1...

Endpoint Availability

Not all endpoints support all chains. See the API Reference for endpoint-specific chain support.

Supported Blockchains Guide

Complete chain support matrix with endpoint availability