/** * @escapehub/token-creator-core * Framework-agnostic types for reading on-chain token data */ /** * Represents a distribution entry for initial token allocation. * Used when deploying tokens with pre-defined holder distributions. */ export interface DistributionEntry { /** Recipient wallet address (0x-prefixed) */ readonly address: string; /** Amount of tokens to distribute (in wei/smallest unit) */ readonly amount: bigint; } /** * Configuration for a blockchain network. * Contains all necessary information to interact with a specific chain. */ export interface ChainConfig { /** Unique chain identifier (e.g., 1 for Ethereum mainnet, 11155111 for Sepolia) */ readonly chainId: number; /** JSON-RPC endpoint URL for the chain */ readonly rpcUrl: string; /** * Multicall3 contract address for batching read calls. * Set to `false` if the chain doesn't have Multicall3 deployed. * Standard address on most chains: 0xcA11bde05977b3631167028862bE2a173976CA11 */ readonly multicall3Address: string | false; /** LaunchERC20Factory contract address on this chain */ readonly factoryAddress: string; /** Optional human-readable chain name */ readonly name?: string; /** Optional chain icon URL */ readonly icon?: string; /** Whether this chain is a testnet */ readonly isTestnet?: boolean; } /** * Identifies a specific token on a specific chain. * The combination of address + chainId uniquely identifies a token. */ export interface TokenIdentifier { /** Token contract address (0x-prefixed) */ readonly address: string; /** Chain ID where the token is deployed */ readonly chainId: number; } /** * Fee configuration for a LaunchERC20 token. * All fee values are in basis points (100 = 1%). */ export interface FeeConfig { /** Whether the fee module is enabled */ readonly enabled: boolean; /** Whether fee configuration is permanently frozen */ readonly frozen: boolean; /** Buy fee in basis points (max 2500 = 25%) */ readonly buyFee: number; /** Sell fee in basis points (max 2500 = 25%) */ readonly sellFee: number; /** Transfer fee in basis points (max 2500 = 25%) */ readonly transferFee: number; /** Address receiving collected fees */ readonly feeRecipient: string; /** Whether auto fee distribution is enabled */ readonly autoDistribute: boolean; /** Token threshold for auto distribution (in wei) */ readonly autoDistributeThreshold: bigint; } /** * Limit configuration for transaction and wallet limits. */ export interface LimitConfig { /** Whether the limits module is enabled */ readonly enabled: boolean; /** Whether limit configuration is permanently frozen */ readonly frozen: boolean; /** Maximum tokens a wallet can hold (0 = unlimited) */ readonly maxWallet: bigint; /** Maximum tokens per transaction (0 = unlimited) */ readonly maxTransaction: bigint; /** Cooldown period between transactions in seconds */ readonly cooldownPeriod: number; } /** * Blacklist module configuration. */ export interface BlacklistConfig { /** Whether the blacklist module is enabled */ readonly enabled: boolean; /** Whether the blacklist is permanently frozen (no new additions) */ readonly frozen: boolean; /** Number of addresses currently blacklisted */ readonly blacklistedCount: number; } /** * Whitelist module configuration. */ export interface WhitelistConfig { /** Whether the whitelist module is enabled */ readonly enabled: boolean; /** Whether whitelist configuration is permanently frozen */ readonly frozen: boolean; /** * Whitelist operating mode: * - 0: DISABLED - Whitelist not active * - 1: PRE_TRADING - Active until trading enabled, then auto-disables * - 2: ALWAYS - Always active, only whitelisted addresses can transact */ readonly mode: number; } /** * Anti-dump protection configuration. */ export interface AntiDumpConfig { /** Whether anti-dump protection is enabled */ readonly enabled: boolean; /** Whether anti-dump configuration is permanently frozen */ readonly frozen: boolean; /** * Anti-dump limit type: * - 0: ABSOLUTE - Fixed token amount limit * - 1: PERCENTAGE - Percentage of holder's balance */ readonly limitType: number; /** Limit value (tokens for ABSOLUTE, basis points for PERCENTAGE) */ readonly limitValue: bigint; /** Time period in seconds for the limit */ readonly period: number; } /** * Deadblock (anti-sniper) protection configuration. */ export interface DeadblockConfig { /** Whether deadblock protection is enabled */ readonly enabled: boolean; /** Number of blocks to protect after trading enabled */ readonly duration: number; /** * Deadblock mode: * - 0: BUYS - Only block buys * - 1: SELLS - Only block sells * - 2: BOTH - Block both buys and sells */ readonly mode: number; /** Block number when trading was enabled (0 if not yet enabled) */ readonly tradingEnabledBlock: number; } /** * Batch transfer configuration. */ export interface BatchTransferConfig { /** Whether batch transfers are enabled */ readonly enabled: boolean; /** * Who can use batch transfers: * - 0: OWNER_ONLY - Only contract owner * - 1: ANYONE - Any address */ readonly access: number; /** * How fees are applied to batch transfers: * - 0: NO_FEES - Exempt from fees * - 1: SINGLE_FEE - One fee for entire batch * - 2: PER_TRANSFER_FEE - Fee on each transfer in batch */ readonly feeMode: number; } /** * Complete on-chain state of a LaunchERC20 token. * Contains all readable data from the token contract. */ export interface TokenData { /** Token name (e.g., "My Token") */ readonly name: string; /** Token symbol (e.g., "MTK") */ readonly symbol: string; /** Number of decimal places (typically 18) */ readonly decimals: number; /** Total token supply in wei */ readonly totalSupply: bigint; /** Current contract owner address */ readonly owner: string; /** Whether ownership has been renounced (owner = zero address) */ readonly isRenounced: boolean; /** Whether new tokens can be minted */ readonly mintingEnabled: boolean; /** Whether minting has been permanently disabled */ readonly mintingFrozen: boolean; /** Whether tokens can be burned */ readonly burningEnabled: boolean; /** Whether the token can be paused */ readonly pausable: boolean; /** Whether the token is currently paused */ readonly paused: boolean; /** Whether trading is currently enabled */ readonly tradingEnabled: boolean; /** Block number when trading was enabled (0 if not enabled) */ readonly tradingEnabledBlock: number; /** Timestamp when trading was enabled (0 if not enabled) */ readonly tradingEnabledTime: number; /** Fee module configuration */ readonly fees: FeeConfig; /** Limits module configuration */ readonly limits: LimitConfig; /** Blacklist module configuration */ readonly blacklist: BlacklistConfig; /** Whitelist module configuration */ readonly whitelist: WhitelistConfig; /** Anti-dump module configuration */ readonly antiDump: AntiDumpConfig; /** Deadblock protection configuration */ readonly deadblock: DeadblockConfig; /** Batch transfer configuration */ readonly batchTransfer: BatchTransferConfig; /** Chain ID where this token is deployed */ readonly chainId: number; /** Token contract address */ readonly address: string; /** Timestamp when data was fetched */ readonly fetchedAt: number; } /** * Result of fetching multiple tokens. * Includes both successful reads and any errors encountered. */ export interface MultiTokenResult { /** Successfully fetched token data, keyed by address (lowercase) */ readonly tokens: Record; /** Errors encountered during fetch, keyed by address (lowercase) */ readonly errors: Record; /** Total number of tokens requested */ readonly requested: number; /** Number of tokens successfully fetched */ readonly succeeded: number; /** Number of tokens that failed to fetch */ readonly failed: number; } /** * Partial token data for list views where full data isn't needed. * Reduces RPC calls when displaying token lists. */ export interface TokenSummary { /** Token contract address */ readonly address: string; /** Chain ID */ readonly chainId: number; /** Token name */ readonly name: string; /** Token symbol */ readonly symbol: string; /** Number of decimals */ readonly decimals: number; /** Total supply in wei */ readonly totalSupply: bigint; /** Current owner address */ readonly owner: string; /** Whether trading is enabled */ readonly tradingEnabled: boolean; } /** * Flat token data structure returned by the token reader functions. * This mirrors the on-chain state exactly as it's read from the contract. * Use this for displaying detailed token information. */ export interface TokenDataFlat { /** Token contract address */ address: string; /** Token name */ name: string; /** Token symbol */ symbol: string; /** Token decimals */ decimals: number; /** Total supply in smallest units */ totalSupply: bigint; /** Total supply formatted as human-readable string */ totalSupplyFormatted: string; /** Current owner address */ owner: string; /** Whether token metadata (name, symbol) can be changed */ metadataMutable: boolean; /** Whether social links can be changed */ socialsMutable: boolean; /** Website URL */ website: string; /** Telegram link */ telegram: string; /** Twitter/X handle */ xHandle: string; /** Discord invite link */ discord: string; /** Whether minting is enabled */ mintingEnabled: boolean; /** Whether pause/unpause is enabled */ pausable: boolean; /** Whether rescue of stuck tokens is enabled */ rescueEnabled: boolean; /** Whether token burning is enabled */ burnEnabled: boolean; /** Hard cap for minting (0 = unlimited if minting enabled) */ hardCap: bigint; /** Hard cap formatted as human-readable string */ hardCapFormatted: string; /** Whether fees module is enabled */ feesModuleEnabled: boolean; /** Whether limits module is enabled */ limitsModuleEnabled: boolean; /** Whether cooldown module is enabled */ cooldownModuleEnabled: boolean; /** Whether blacklist module is enabled */ blacklistModuleEnabled: boolean; /** Whether whitelist module is enabled */ whitelistModuleEnabled: boolean; /** Whether anti-dump module is enabled */ antiDumpModuleEnabled: boolean; /** Whether deadblock protection is enabled */ deadblocksEnabled: boolean; /** Maximum buy fee in basis points (immutable cap) */ maxBuyFeeBps: number; /** Maximum sell fee in basis points (immutable cap) */ maxSellFeeBps: number; /** Maximum transfer fee in basis points (immutable cap) */ maxTransferFeeBps: number; /** Maximum cooldown in seconds (immutable cap) */ maxCooldownSeconds: number; /** Whether fee collection is currently enabled */ feesEnabled: boolean; /** Current buy fee in basis points */ buyFeeBps: number; /** Current sell fee in basis points */ sellFeeBps: number; /** Current transfer fee in basis points */ transferFeeBps: number; /** Address receiving collected fees */ feeRecipient: string; /** Percentage of fees to burn (basis points) */ feeBurnShareBps: number; /** Maximum tokens a wallet can hold */ maxWalletAmount: bigint; /** Maximum wallet formatted as human-readable string */ maxWalletFormatted: string; /** Maximum wallet as percentage of total supply */ maxWalletPercent: number; /** Maximum tokens per transaction */ maxTxAmount: bigint; /** Maximum transaction formatted as human-readable string */ maxTxFormatted: string; /** Maximum transaction as percentage of total supply */ maxTxPercent: number; /** Unix timestamp when limits expire (0 = never) */ limitsEndTime: number; /** Current cooldown period in seconds */ cooldownSeconds: number; /** Whether trading is enabled */ tradingEnabled: boolean; /** Unix timestamp when trading was enabled */ tradingEnabledAt: number; /** DEX router address for router protection */ router: string; /** Whether router-only trading is enabled */ routerProtectionEnabled: boolean; /** Whether blacklist is frozen (no modifications allowed) */ blacklistFrozen: boolean; /** Whitelist mode (0=disabled, 1=pre-trading, 2=always) */ whitelistMode: number; /** Whether whitelist auto-disables when trading starts */ whitelistAutoDisable: boolean; /** Whether whitelist can be modified */ whitelistMutable: boolean; /** Whether whitelist is currently active */ whitelistActive: boolean; /** Whether whitelist is frozen (derived from !whitelistMutable) */ whitelistFrozen: boolean; /** Anti-dump type (0=absolute, 1=percentage) */ antiDumpType: number; /** Anti-dump limit (amount or bps depending on type) */ antiDumpLimit: bigint; /** Anti-dump limit formatted as human-readable string */ antiDumpLimitFormatted: string; /** Anti-dump period in seconds */ antiDumpPeriod: number; /** Unix timestamp when anti-dump expires (0 = never) */ antiDumpEndTime: number; /** Number of deadblocks after trading starts */ deadBlocks: number; /** Deadblock mode (0=buys, 1=sells, 2=both) */ deadblockMode: number; /** Who can use batch transfer (0=anyone, 1=owner) */ batchTransferAccess: number; /** How fees apply to batch (0=normal, 1=none, 2=owner-none) */ batchTransferFees: number; /** Maximum recipients per batch */ maxBatchSize: number; /** Whether token is currently paused */ paused: boolean; /** Whether EIP-2612 permit is enabled */ permitEnabled: boolean; /** Whether fee configuration is frozen */ feesFrozen: boolean; /** Whether limits configuration is frozen */ limitsFrozen: boolean; /** Whether cooldown configuration is frozen */ cooldownFrozen: boolean; /** Whether anti-dump configuration is frozen */ antiDumpFrozen: boolean; /** Whether ownership transfer is blocked */ ownershipTransferBlocked: boolean; } /** * Detailed distribution entry from InitialDistribution event. * Includes formatted amounts and percentage calculations. */ export interface DistributionEntryDetailed { /** Recipient address */ recipient: string; /** Amount in smallest units */ amount: bigint; /** Amount formatted as human-readable string */ amountFormatted: string; /** Percentage of total supply */ percent: number; /** Label for this distribution (e.g., "Team", "Marketing") */ label: string; /** True if this is the auto-calculated owner remainder */ isOwnerRemainder?: boolean; } /** * Configuration for reading token data. */ export interface ReadConfig { /** Multicall3 contract address (if available on this chain) */ multicall3Address?: string; } //# sourceMappingURL=token-data.d.ts.map