Core utilities for Webacy SDK packages
npm install @rlajous/webacy-sdk-coreCore utilities and shared internals for Webacy SDK packages. This package is automatically installed as a dependency of @webacy/sdk-trading and @webacy/sdk-threat.
This package is typically not installed directly. Instead, install one of the SDK packages:
``bash`
npm install @webacy/sdk # Full SDK
npm install @webacy/sdk-trading # Trading analysis only
npm install @webacy/sdk-threat # Threat analysis only
`typescript
import { Chain, isEvmChain, CHAIN_IDS, CHAIN_NAMES } from '@webacy/sdk-core';
// Check if a chain is EVM-compatible
if (isEvmChain(Chain.ETH)) {
console.log('Using EVM chain');
}
// Get chain metadata
console.log(CHAIN_NAMES[Chain.SOL]); // "Solana"
console.log(CHAIN_IDS[Chain.ETH]); // 1
`
`typescript
import {
WebacyError,
AuthenticationError,
RateLimitError,
ValidationError,
NotFoundError,
NetworkError,
} from '@webacy/sdk-core';
try {
await client.addresses.analyze('0x...');
} catch (error) {
if (error instanceof RateLimitError) {
console.log(Retry after ${error.retryAfter} seconds);`
}
}
`typescript`
import type {
RiskTag,
RiskModule,
RiskCategory,
TokenMetadata,
OwnershipDistribution,
} from '@webacy/sdk-core';
`typescript
import {
isValidAddress,
isValidEvmAddress,
isValidSolanaAddress,
} from '@webacy/sdk-core';
isValidAddress('0x742d35Cc...', Chain.ETH); // true
isValidSolanaAddress('EPjFWdd5Aufq...'); // true
`
| Chain | Code | EVM |
|-------|------|-----|
| Ethereum | eth | Yes |base
| Base | | Yes |bsc
| BSC | | Yes |pol
| Polygon | | Yes |arb
| Arbitrum | | Yes |opt
| Optimism | | Yes |sol
| Solana | | No |ton
| TON | | No |sui
| Sui | | No |stellar
| Stellar | | No |btc` | No |
| Bitcoin |
MIT