/** * @escapehub/token-creator-core * Framework-agnostic types for deploying LaunchERC20 tokens */ /** * Ethereum address type (0x-prefixed 40-character hex string). * @example "0x742d35Cc6634C0532925a3b844Bc9e7595f1E6aB" */ export type Address = `0x${string}`; /** * Transaction hash type (0x-prefixed 64-character hex string). * @example "0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b" */ export type TxHash = `0x${string}`; /** * The zero address, used to represent "no address" or burned tokens. */ export declare const ZERO_ADDRESS: Address; /** * 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; } /** * Deadblock protection mode. * Determines which transaction types are blocked during the deadblock period. */ export declare enum DeadblockMode { /** Block buy transactions only */ BUYS = 0, /** Block sell transactions only */ SELLS = 1, /** Block both buy and sell transactions */ BOTH = 2 } /** * Whitelist operating mode. * Controls when whitelist restrictions are applied. */ export declare enum WhitelistMode { /** Whitelist is disabled, no restrictions */ DISABLED = 0, /** Whitelist active until trading enabled, then auto-disables */ PRE_TRADING = 1, /** Whitelist always active, only whitelisted addresses can transact */ ALWAYS = 2 } /** * Anti-dump limit type. * Determines how the anti-dump limit is calculated. */ export declare enum AntiDumpType { /** Fixed token amount limit per period */ ABSOLUTE = 0, /** Percentage of holder's balance limit per period */ PERCENTAGE = 1 } /** * Batch transfer access control. * Determines who can use the batch transfer function. */ export declare enum BatchTransferAccess { /** Only the contract owner can batch transfer */ OWNER_ONLY = 0, /** Anyone can batch transfer */ ANYONE = 1 } /** * Batch transfer fee mode. * Determines how fees are applied to batch transfers. */ export declare enum BatchTransferFees { /** Batch transfers are exempt from fees */ NO_FEES = 0, /** One fee for the entire batch */ SINGLE_FEE = 1, /** Fee applied to each individual transfer in the batch */ PER_TRANSFER_FEE = 2 } /** * Fee recipient share configuration. * Used when distributing fees to multiple recipients. */ export interface FeeRecipientShare { /** Recipient address */ readonly address: Address; /** Share in basis points (total of all shares must equal 10000) */ readonly share: number; } /** * Initial token distribution entry. * Tokens are transferred to these addresses on deployment. */ export interface DistributionConfig { /** Recipient address */ readonly address: Address; /** Amount to distribute (in wei/smallest unit) */ readonly amount: bigint; } /** * Complete configuration for deploying a LaunchERC20 token. * This interface matches the CreateParams struct expected by the factory contract. */ export interface TokenConfig { /** Token name (e.g., "My Token") - max 32 characters */ readonly name: string; /** Token symbol (e.g., "MTK") - max 8 characters */ readonly symbol: string; /** Number of decimal places (typically 18) */ readonly decimals: number; /** Total token supply in human-readable format (e.g., "1000000") */ readonly totalSupplyHuman: string; /** Address that will own the token after deployment */ readonly finalOwner: Address; /** Enable minting capability (default: false) */ readonly mintable?: boolean; /** Hard cap for minting in human-readable format (0 = unlimited if minting enabled) */ readonly hardCapHuman?: string; /** Enable burning capability (default: false) */ readonly burnEnabled?: boolean; /** Enable pause capability (default: false) */ readonly pausable?: boolean; /** Enable rescue of stuck tokens (default: false) */ readonly rescueEnabled?: boolean; /** Whether token metadata (name, symbol) can be changed */ readonly metadataMutable?: boolean; /** Whether social links can be changed */ readonly socialsMutable?: boolean; /** Website URL */ readonly website?: string; /** Telegram link */ readonly telegram?: string; /** Twitter/X handle */ readonly xHandle?: string; /** Discord invite link */ readonly discord?: string; /** Enable fees module (default: false) */ readonly feesModuleEnabled?: boolean; /** Enable limits module (default: false) */ readonly limitsModuleEnabled?: boolean; /** Enable cooldown module (default: false) */ readonly cooldownModuleEnabled?: boolean; /** Enable blacklist module (default: false) */ readonly blacklistModuleEnabled?: boolean; /** Enable whitelist module (default: false) */ readonly whitelistModuleEnabled?: boolean; /** Enable anti-dump module (default: false) */ readonly antiDumpModuleEnabled?: boolean; /** Enable fee collection (default: false) */ readonly feesEnabled?: boolean; /** Maximum buy fee in basis points (immutable cap) */ readonly maxBuyFeeBps?: number; /** Maximum sell fee in basis points (immutable cap) */ readonly maxSellFeeBps?: number; /** Maximum transfer fee in basis points (immutable cap) */ readonly maxTransferFeeBps?: number; /** Current buy fee in basis points */ readonly buyFeeBps?: number; /** Current sell fee in basis points */ readonly sellFeeBps?: number; /** Current transfer fee in basis points */ readonly transferFeeBps?: number; /** Percentage of fees to burn (basis points) */ readonly feeBurnShareBps?: number; /** Address to receive collected fees */ readonly feeRecipient?: Address; /** Freeze fees after deployment */ readonly freezeFeesAfterDeploy?: boolean; /** Maximum tokens a wallet can hold (string, in smallest units) */ readonly maxWalletAmount?: string; /** Maximum tokens per transaction (string, in smallest units) */ readonly maxTxAmount?: string; /** Unix timestamp when limits expire (0 = never) */ readonly limitsEndTime?: number; /** Exempt initial distribution recipients from limits */ readonly exemptRecipientsFromLimits?: boolean; /** Additional addresses exempt from limits */ readonly additionalLimitExempt?: readonly Address[]; /** Freeze limits after deployment */ readonly freezeLimitsAfterDeploy?: boolean; /** Maximum cooldown in seconds (immutable cap) */ readonly maxCooldownSeconds?: number; /** Current cooldown period in seconds */ readonly cooldownSeconds?: number; /** Freeze cooldown after deployment */ readonly freezeCooldownAfterDeploy?: boolean; /** Recipient addresses for initial distribution */ readonly initialRecipients?: readonly Address[]; /** Amounts for initial distribution (strings, in smallest units) */ readonly initialAmounts?: readonly string[]; /** Labels for initial distribution entries */ readonly initialLabels?: readonly string[]; /** Unix timestamp for scheduled trading start (0 = manual) */ readonly tradingSchedule?: number; /** Enable trading immediately after deployment */ readonly enableTradingImmediately?: boolean; /** DEX router address for router protection */ readonly router?: Address; /** Enable router-only trading protection */ readonly routerProtectionEnabled?: boolean; /** Initial addresses to blacklist */ readonly initialBlacklist?: readonly Address[]; /** Freeze blacklist after deployment (no new additions) */ readonly freezeBlacklistAfterDeploy?: boolean; /** Renounce ownership after deployment */ readonly renounceOwnership?: boolean; /** Block ownership transfers after deployment */ readonly blockOwnershipTransferAfterDeploy?: boolean; /** Enable deadblock protection (default: false) */ readonly deadblocksEnabled?: boolean; /** Number of blocks to protect after trading enabled */ readonly deadBlocks?: number; /** Deadblock protection mode (0=buys, 1=sells, 2=both) */ readonly deadblockMode?: number; /** Exempt limit-exempt addresses from deadblock protection */ readonly deadblockExemptLimitExempt?: boolean; /** Whitelist mode (0=disabled, 1=pre-trading, 2=always) */ readonly whitelistMode?: number; /** Auto-disable whitelist when trading starts */ readonly whitelistAutoDisable?: boolean; /** Whitelist bypasses router protection */ readonly whitelistBypassesRouter?: boolean; /** Whitelist can be modified */ readonly whitelistMutable?: boolean; /** Initial addresses to whitelist */ readonly initialWhitelist?: readonly Address[]; /** Freeze whitelist after deployment */ readonly freezeWhitelistAfterDeploy?: boolean; /** Anti-dump type (0=absolute, 1=percentage) */ readonly antiDumpType?: number; /** Maximum anti-dump limit (string, tokens or bps depending on type) */ readonly maxAntiDumpLimit?: string; /** Maximum anti-dump period in seconds */ readonly maxAntiDumpPeriod?: number; /** Current anti-dump limit (string, tokens or bps depending on type) */ readonly antiDumpLimit?: string; /** Current anti-dump period in seconds */ readonly antiDumpPeriod?: number; /** Unix timestamp when anti-dump expires (0 = never) */ readonly antiDumpEndTime?: number; /** Freeze anti-dump after deployment */ readonly freezeAntiDumpAfterDeploy?: boolean; /** Batch transfer access (0=anyone, 1=owner only) */ readonly batchTransferAccess?: number; /** Batch transfer fee mode (0=normal, 1=none, 2=owner-none) */ readonly batchTransferFees?: number; /** Maximum recipients per batch */ readonly maxBatchSize?: number; /** Enable EIP-2612 permit (default: true) */ readonly permitEnabled?: boolean; } /** * Result of a successful token deployment. */ export interface DeploymentResult { /** Transaction hash of the deployment */ readonly txHash: TxHash; /** Deployed token contract address */ readonly tokenAddress: Address; } /** * Gas estimation for a token deployment. */ export interface GasEstimation { /** Estimated gas limit */ readonly gasLimit: bigint; /** Factory creation fee in wei */ readonly creationFee: bigint; } /** * Deployment status for tracking multi-step deployments. */ export interface DeploymentStatus { /** Current deployment step */ readonly step: 'preparing' | 'signing' | 'broadcasting' | 'confirming' | 'complete' | 'failed'; /** Transaction hash (available after broadcasting) */ readonly txHash?: TxHash; /** Error message (if failed) */ readonly error?: string; /** Number of confirmations received */ readonly confirmations?: number; } /** * Validation error for token configuration. */ export interface ValidationError { /** Field that failed validation */ readonly field: keyof TokenConfig; /** Error message */ readonly message: string; /** Error code for programmatic handling */ readonly code: string; } /** * Result of validating a token configuration. */ export interface ValidationResult { /** Whether the configuration is valid */ readonly valid: boolean; /** List of validation errors (empty if valid) */ readonly errors: readonly ValidationError[]; /** List of warnings (non-blocking issues) */ readonly warnings: readonly ValidationError[]; } /** * Creates a default token configuration with sensible defaults. * Override specific fields as needed. * * @param name - Token name * @param symbol - Token symbol * @param totalSupplyHuman - Total supply in human-readable format (e.g., "1000000") * @param finalOwner - Address that will own the token * @param overrides - Optional partial configuration to override defaults * @returns Complete token configuration with defaults applied * * @example * ```typescript * const config = createDefaultConfig( * 'My Token', * 'MTK', * '1000000', * '0x742d35Cc6634C0532925a3b844Bc9e7595f1E6aB' * ); * ``` */ export declare function createDefaultConfig(name: string, symbol: string, totalSupplyHuman: string, finalOwner: Address, overrides?: Partial): TokenConfig; /** * Type guard to check if a string is a valid Ethereum address. * * @param value - String to check * @returns True if the value is a valid address */ export declare function isAddress(value: string): value is Address; /** * Type guard to check if a string is a valid transaction hash. * * @param value - String to check * @returns True if the value is a valid transaction hash */ export declare function isTxHash(value: string): value is TxHash; //# sourceMappingURL=deploy-config.d.ts.map