{"version":3,"sources":["../src/types/branded.ts","../src/types/transactions.ts","../src/types/proposals.ts","../src/errors.ts","../src/constants.ts","../src/format.ts","../src/environment.ts","../src/logger/index.ts"],"names":["CT","SCTXType","NetworkParamsIndexer"],"mappings":";;;;AA0EO,SAAS,gBAAgB,KAAA,EAAuC;AACrE,EAAA,IAAI,CAAC,KAAA,IAAS,OAAO,KAAA,KAAU,UAAU,OAAO,KAAA;AAGhD,EAAA,OAAO,oBAAA,CAAqB,KAAK,KAAK,CAAA;AACxC;AAEA,IAAM,qBAAA,GAAwB,KAAA;AAC9B,IAAM,qBAAA,GAAwB,EAAA;AAqBvB,SAAS,eAAe,OAAA,EAA0B;AACvD,EAAA,IAAI;AACF,IAAA,MAAM,EAAE,MAAA,EAAQ,IAAA,EAAK,GAAI,aAAa,OAAO,CAAA;AAC7C,IAAA,OAAO,MAAA,KAAW,qBAAA,IAAyB,IAAA,CAAK,MAAA,KAAW,qBAAA;AAAA,EAC7D,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,KAAA;AAAA,EACT;AACF;AAEA,IAAM,oCAAA,GAAuC,EAAA;AAC7C,IAAM,6BAAA,GAAgC,CAAA;AACtC,IAAM,eAAe,IAAI,UAAA,CAAW,CAAC,CAAA,EAAG,CAAC,CAAC,CAAA;AAE1C,SAAS,eAAe,IAAA,EAA2B;AACjD,EAAA,OAAO,IAAA,CAAK,KAAA,CAAM,CAAC,IAAA,KAAS,SAAS,CAAC,CAAA;AACxC;AAsBO,SAAS,uBAAuB,OAAA,EAA0B;AAC/D,EAAA,IAAI;AACF,IAAA,MAAM,EAAE,MAAA,EAAQ,IAAA,EAAK,GAAI,aAAa,OAAO,CAAA;AAE7C,IAAA,IAAI,MAAA,KAAW,qBAAA,IAAyB,IAAA,CAAK,MAAA,KAAW,qBAAA,EAAuB;AAC7E,MAAA,OAAO,KAAA;AAAA,IACT;AAEA,IAAA,IAAI,IAAA,CAAK,UAAU,oCAAA,EAAsC;AACvD,MAAA,OAAO,KAAA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,aAAA,GAAgB,EAAE,GAAG,aAAA,EAAe,GAAG,OAAA,EAAQ;AACjD;AAoBO,SAAS,kBAAkB,OAAA,EAAwC;AAExE,EAAA,MAAM,cAAc,iBAAA,EAAkB;AAGtC,EAAA,IAAI,OAAA,EAAS;AACX,IAAA,sBAAA,CAAuB,EAAE,GAAG,WAAA,EAAa,GAAG,SAAS,CAAA;AAAA,EACvD,CAAA,MAAO;AACL,IAAA,sBAAA,CAAuB,WAAW,CAAA;AAAA,EACpC;AACF;AAwBO,SAAS,gBAAgB,MAAA,EAAwB;AACtD,EAAA,OAAO,YAAA,CAAa,QAAQ,aAAa,CAAA;AAC3C;AASO,IAAM,UAAA,GAAa,gBAAgB,MAAM;AASzC,IAAM,cAAA,GAAiB,gBAAgB,UAAU;AASjD,IAAM,YAAA,GAAe,gBAAgB,QAAQ;AAS7C,IAAM,iBAAA,GAAoB,gBAAgB,aAAa;AASvD,IAAM,cAAA,GAAiB,gBAAgB,UAAU","file":"index.mjs","sourcesContent":["/**\n * Branded types for type-safe value handling\n */\nimport { bech32Decode } from '@klever/connect-encoding'\n\n/**\n * Brand type helper for creating nominal types\n * @internal\n */\ntype Brand<K, T> = K & { __brand: T }\n\n/**\n * A branded type representing a valid Klever address\n * Must start with 'klv1' and be exactly 62 characters long\n *\n * @example\n * ```typescript\n * const address: KleverAddress = createKleverAddress('klv1...')\n * ```\n */\nexport type KleverAddress = Brand<string, 'KleverAddress'>\n\n/**\n * A branded type representing a valid transaction hash\n * Must be exactly 64 hexadecimal characters\n *\n * @example\n * ```typescript\n * const hash: TransactionHash = createTransactionHash('0123456789abcdef...')\n * ```\n */\nexport type TransactionHash = Brand<string, 'TransactionHash'>\n\n/**\n * A branded type representing a asset amount in smallest units\n *\n * @example\n * ```typescript\n * const amount: AssetAmount = createAssetAmount(1000000n) // 1 KLV\n * ```\n */\nexport type AssetAmount = Brand<bigint, 'AssetAmount'>\n\nexport type AssetID = Brand<string, 'AssetID'>\n\n// Block Height\nexport type BlockHeight = Brand<number, 'BlockHeight'>\n\n// Block Hash\nexport type BlockHash = Brand<string, 'BlockHash'>\n\n// Nonce\nexport type Nonce = Brand<number, 'Nonce'>\n\nexport type PublicKey = Brand<string, 'PublicKey'>\nexport type PrivateKey = Brand<string, 'PrivateKey'>\nexport type Signature = Brand<string, 'Signature'>\n\nexport type HexString = Brand<string, 'HexString'>\nexport type Base58String = Brand<string, 'Base58String'>\n\n/**\n * Type guard to check if a string is a valid Klever address\n *\n * @param value - The string to check\n * @returns True if the string is a valid Klever address\n *\n * @example\n * ```typescript\n * if (isKleverAddress(input)) {\n *   // input is now typed as KleverAddress\n * }\n * ```\n */\nexport function isKleverAddress(value: string): value is KleverAddress {\n  if (!value || typeof value !== 'string') return false\n  // Klever addresses are bech32 encoded with 'klv1' prefix\n  // They should be 62 characters total: 'klv1' (4) + 58 characters\n  return /^klv1[a-z0-9]{58}$/.test(value)\n}\n\nconst KLEVER_ADDRESS_PREFIX = 'klv'\nconst KLEVER_ADDRESS_LENGTH = 32\n\n/**\n * Validates a Klever address using bech32 decoding\n *\n * This function performs full bech32 validation by decoding the address\n * and verifying both the prefix and data length. It's more thorough than\n * the regex-based `isKleverAddress()` function.\n *\n * @param address - The address string to validate\n * @returns True if the address is valid (correct prefix and data length)\n *\n * @example\n * ```typescript\n * if (isValidAddress('klv1qqqqqqqqqqqqqpgqxwklx...')) {\n *   console.log('Valid Klever address')\n * }\n * ```\n *\n * @see {@link isKleverAddress} for a faster regex-based validation\n */\nexport function isValidAddress(address: string): boolean {\n  try {\n    const { prefix, data } = bech32Decode(address)\n    return prefix === KLEVER_ADDRESS_PREFIX && data.length === KLEVER_ADDRESS_LENGTH\n  } catch {\n    return false\n  }\n}\n\nconst SMART_CONTRACT_ADDRESS_MARKER_LENGTH = 10\nconst SMART_CONTRACT_VM_TYPE_LENGTH = 2\nconst WASM_VM_TYPE = new Uint8Array([5, 0])\n\nfunction isEmptyAddress(data: Uint8Array): boolean {\n  return data.every((byte) => byte === 0)\n}\n\n/**\n * Validates if an address is a smart contract address.\n *\n * Mirrors klever-go core.IsSmartContractAddress:\n * - a valid all-zero Klever address is accepted\n * - otherwise bytes 0..7 must be zero\n * - bytes 8..9 must match the Wasm VM type (05 00)\n *\n * @param address - The address string to validate\n * @returns True if the address is a valid smart contract address\n *\n * @example\n * ```typescript\n * if (isValidContractAddress('klv1qqqqqqqqqqqqqpgqxwklx...')) {\n *   console.log('Valid smart contract address')\n * }\n * ```\n *\n * @see {@link isValidAddress} for general address validation\n */\nexport function isValidContractAddress(address: string): boolean {\n  try {\n    const { prefix, data } = bech32Decode(address)\n\n    if (prefix !== KLEVER_ADDRESS_PREFIX || data.length !== KLEVER_ADDRESS_LENGTH) {\n      return false\n    }\n\n    if (data.length <= SMART_CONTRACT_ADDRESS_MARKER_LENGTH) {\n      return false\n    }\n\n    if (isEmptyAddress(data)) {\n      return true\n    }\n\n    const zeroPrefixLength = SMART_CONTRACT_ADDRESS_MARKER_LENGTH - SMART_CONTRACT_VM_TYPE_LENGTH\n    for (let i = 0; i < zeroPrefixLength; i++) {\n      if (data[i] !== 0) {\n        return false\n      }\n    }\n\n    for (let i = 0; i < SMART_CONTRACT_VM_TYPE_LENGTH; i++) {\n      if (data[zeroPrefixLength + i] !== WASM_VM_TYPE[i]) {\n        return false\n      }\n    }\n\n    return true\n  } catch {\n    return false\n  }\n}\n\n/**\n * Type guard to check if a string is a valid transaction hash\n *\n * @param value - The string to check\n * @returns True if the string is a valid transaction hash\n *\n * @example\n * ```typescript\n * if (isTransactionHash(input)) {\n *   // input is now typed as TransactionHash\n * }\n * ```\n */\nexport function isTransactionHash(value: string): value is TransactionHash {\n  if (!value || typeof value !== 'string') return false\n  return /^[0-9a-fA-F]{64}$/.test(value)\n}\n\n/**\n * Creates a KleverAddress from a string with validation\n *\n * @param value - The address string to validate and convert\n * @returns A validated KleverAddress\n * @throws {Error} If the address is invalid\n *\n * @example\n * ```typescript\n * const address = createKleverAddress('klv1qqqqqqqqqqqqqpgqxwklx...')\n * ```\n */\nexport function createKleverAddress(value: string): KleverAddress {\n  if (!isKleverAddress(value)) {\n    throw new Error(`Invalid Klever address: ${value}`)\n  }\n  return value\n}\n\n/**\n * Creates a TransactionHash from a string with validation\n *\n * @param value - The hash string to validate and convert\n * @returns A validated TransactionHash\n * @throws {Error} If the hash is invalid\n *\n * @example\n * ```typescript\n * const hash = createTransactionHash('1234567890abcdef...')\n * ```\n */\nexport function createTransactionHash(value: string): TransactionHash {\n  if (!isTransactionHash(value)) {\n    throw new Error(`Invalid transaction hash: ${value}`)\n  }\n  return value\n}\n\n/**\n * Type guard to check if a string is a valid block hash\n *\n * @param value - The string to check\n * @returns True if the string is a valid block hash\n *\n * @example\n * ```typescript\n * if (isBlockHash(input)) {\n *   // input is now typed as BlockHash\n * }\n * ```\n */\nexport function isBlockHash(value: string): value is BlockHash {\n  // Block hash is a 64-character hex string\n  return /^[a-f0-9]{64}$/i.test(value)\n}\n\n/**\n * Creates a BlockHash from a string with validation\n *\n * @param value - The hash string to validate and convert\n * @returns A validated BlockHash\n * @throws {Error} If the hash is invalid\n *\n * @example\n * ```typescript\n * const hash = createBlockHash('1234567890abcdef...')\n * ```\n */\nexport function createBlockHash(value: string): BlockHash {\n  if (!isBlockHash(value)) {\n    throw new Error(`Invalid block hash: ${value}`)\n  }\n  return value\n}\n\n/**\n * Creates a AssetAmount from various numeric types\n *\n * @param value - The amount as bigint, string, or number\n * @param _decimals - The number of decimals (currently unused)\n * @returns A validated AssetAmount\n * @throws {Error} If the amount is negative\n *\n * @example\n * ```typescript\n * const amount1 = createAssetAmount(1000000n) // From bigint\n * const amount2 = createAssetAmount('1000000') // From string\n * const amount3 = createAssetAmount(1000000) // From number\n * ```\n */\nexport function createAssetAmount(value: bigint | string | number, _decimals = 6): AssetAmount {\n  const bigintValue = BigInt(value)\n  if (bigintValue < 0n) {\n    throw new Error('Asset amount cannot be negative')\n  }\n  return bigintValue as AssetAmount\n}\n\n/**\n * Formats a AssetAmount to a human-readable string\n *\n * @param amount - The asset amount in smallest units\n * @param decimals - The number of decimal places (default: 6 for KLV)\n * @returns A formatted string representation\n *\n * @example\n * ```typescript\n * formatAssetAmount(createAssetAmount(1000000n)) // '1'\n * formatAssetAmount(createAssetAmount(1500000n)) // '1.5'\n * formatAssetAmount(createAssetAmount(1234567n)) // '1.234567'\n * ```\n */\nexport function formatAssetAmount(amount: AssetAmount, decimals = 6): string {\n  const value = BigInt(amount)\n  const divisor = BigInt(10 ** decimals)\n  const whole = value / divisor\n  const fraction = value % divisor\n\n  if (fraction === 0n) {\n    return whole.toString()\n  }\n\n  const fractionStr = fraction.toString().padStart(decimals, '0').replace(/0+$/, '')\n  return `${whole}.${fractionStr}`\n}\n\n/**\n * Parses a human-readable string to a AssetAmount\n *\n * @param value - The string to parse (e.g., '1.5')\n * @param decimals - The number of decimal places (default: 6 for KLV)\n * @returns A AssetAmount in smallest units\n *\n * @example\n * ```typescript\n * parseAssetAmount('1') // 1000000n (1 KLV)\n * parseAssetAmount('1.5') // 1500000n (1.5 KLV)\n * parseAssetAmount('0.000001') // 1n (0.000001 KLV)\n * ```\n */\nexport function parseAssetAmount(value: string, decimals = 6): AssetAmount {\n  const [whole, fraction = ''] = value.split('.')\n  const wholeBigInt = BigInt(whole || 0) * BigInt(10 ** decimals)\n  const fractionBigInt = BigInt(fraction.padEnd(decimals, '0').slice(0, decimals))\n  return createAssetAmount(wholeBigInt + fractionBigInt, decimals)\n}\n","import { ContractType as CT } from '@klever/connect-encoding'\n\n// Re-export ContractType from encoding (source of truth from proto files)\nexport { ContractType } from '@klever/connect-encoding'\n\n/**\n * Transaction type constants for Klever blockchain operations\n *\n * This object provides developer-friendly shortcuts to transaction types\n * while maintaining compatibility with the underlying proto enum values.\n * Each transaction type represents a specific operation that can be performed on the blockchain.\n *\n * @example\n * ```typescript\n * import { TXType } from '@klever/connect-core'\n *\n * // Create a transfer transaction\n * const transferType = TXType.Transfer\n *\n * // Create a delegation transaction\n * const delegateType = TXType.Delegate\n * ```\n */\nexport const TXType = {\n  /**\n   * Transfer assets between accounts\n   * Used for sending KLV, KFI, or any other fungible tokens\n   */\n  Transfer: CT.TransferContractType as number,\n\n  /**\n   * Create a new asset (token) on the blockchain\n   * Allows creation of fungible tokens, NFTs, and other asset types\n   */\n  CreateAsset: CT.CreateAssetContractType as number,\n\n  /**\n   * Create a new validator node\n   * Requires minimum self-delegation and validator configuration\n   */\n  CreateValidator: CT.CreateValidatorContractType as number,\n\n  /**\n   * Update validator configuration\n   * Modify validator settings like commission rate, rewards destination, etc.\n   */\n  ValidatorConfig: CT.ValidatorConfigContractType as number,\n\n  /**\n   * Freeze assets for staking or other purposes\n   * Locks tokens to participate in bucket-based staking\n   */\n  Freeze: CT.FreezeContractType as number,\n\n  /**\n   * Unfreeze previously frozen assets\n   * Initiates the unbonding period for frozen tokens\n   */\n  Unfreeze: CT.UnfreezeContractType as number,\n\n  /**\n   * Delegate tokens to a validator\n   * Stake tokens with a validator to earn rewards\n   */\n  Delegate: CT.DelegateContractType as number,\n\n  /**\n   * Undelegate tokens from a validator\n   * Remove delegation and start the unbonding period (21 days)\n   */\n  Undelegate: CT.UndelegateContractType as number,\n\n  /**\n   * Withdraw unbonded tokens\n   * Claim tokens after the unbonding period has completed\n   */\n  Withdraw: CT.WithdrawContractType as number,\n\n  /**\n   * Claim staking rewards\n   * Collect accumulated rewards from delegation or validation\n   */\n  Claim: CT.ClaimContractType as number,\n\n  /**\n   * Unjail a validator\n   * Restore a jailed validator to active status\n   */\n  Unjail: CT.UnjailContractType as number,\n\n  /**\n   * Trigger asset-related operations\n   * Perform actions like minting, burning, pausing, or wiping assets\n   */\n  AssetTrigger: CT.AssetTriggerContractType as number,\n\n  /**\n   * Set or update account name\n   * Assign a human-readable name to an account address\n   */\n  SetAccountName: CT.SetAccountNameContractType as number,\n\n  /**\n   * Create a governance proposal\n   * Submit a proposal for community voting\n   */\n  Proposal: CT.ProposalContractType as number,\n\n  /**\n   * Vote on a governance proposal\n   * Cast a vote in favor or against a proposal\n   */\n  Vote: CT.VoteContractType as number,\n\n  /**\n   * Configure an Initial Token Offering (ITO)\n   * Set up parameters for a token sale\n   */\n  ConfigITO: CT.ConfigITOContractType as number,\n\n  /**\n   * Set ITO pricing information\n   * Define price tiers and sale conditions for an ITO\n   */\n  SetITOPrices: CT.SetITOPricesContractType as number,\n\n  /**\n   * Buy assets from an ITO or marketplace\n   * Purchase tokens or NFTs from available offers\n   */\n  Buy: CT.BuyContractType as number,\n\n  /**\n   * Sell assets on marketplace\n   * Create a sell order for assets\n   */\n  Sell: CT.SellContractType as number,\n\n  /**\n   * Cancel a marketplace order\n   * Remove an active buy or sell order\n   */\n  CancelMarketOrder: CT.CancelMarketOrderContractType as number,\n\n  /**\n   * Create a new marketplace\n   * Initialize a marketplace for trading assets\n   */\n  CreateMarketplace: CT.CreateMarketplaceContractType as number,\n\n  /**\n   * Configure marketplace settings\n   * Update marketplace parameters and rules\n   */\n  ConfigMarketplace: CT.ConfigMarketplaceContractType as number,\n\n  /**\n   * Update account permissions\n   * Modify account access control and multi-signature settings\n   */\n  UpdateAccountPermission: CT.UpdateAccountPermissionContractType as number,\n\n  /**\n   * Deposit assets\n   * Deposit tokens into a contract or liquidity pool\n   */\n  Deposit: CT.DepositContractType as number,\n\n  /**\n   * Trigger ITO-related operations\n   * Perform actions like starting, pausing, or finalizing an ITO\n   */\n  ITOTrigger: CT.ITOTriggerContractType as number,\n\n  /**\n   * Smart contract interaction\n   * Deploy or invoke smart contract functions\n   */\n  SmartContract: CT.SmartContractType as number,\n} as const\n\n/**\n * Type representing any valid transaction type value\n * Extracted from the TXType constant object\n */\nexport type TXTypeValue = (typeof TXType)[keyof typeof TXType]\n\n/**\n * Smart contract specific transaction types\n * Distinguishes between contract deployment and invocation\n *\n * @example\n * ```typescript\n * // Deploy a new contract\n * const deployType = SCTXType.SCDeploy\n *\n * // Invoke an existing contract\n * const invokeType = SCTXType.SCInvoke\n * ```\n */\nexport enum SCTXType {\n  /**\n   * Invoke a function on an existing smart contract\n   * Calls a method on a deployed contract\n   */\n  SCInvoke = 0,\n\n  /**\n   * Deploy a new smart contract\n   * Upload and initialize contract code on the blockchain\n   */\n  SCDeploy = 1,\n}\n","import { TXType } from './transactions'\n\nexport interface IProposalMapItem {\n  message: string\n  precision: number\n  unit: string\n}\n\nexport interface IProposalsMap {\n  FeePerDataByte: IProposalMapItem\n  KAppFeeCreateValidator: IProposalMapItem\n  KAppFeeCreateAsset: IProposalMapItem\n  MaxEpochsUnclaimed: IProposalMapItem\n  MinSelfDelegatedAmount: IProposalMapItem\n  MinTotalDelegatedAmount: IProposalMapItem\n  BlockRewards: IProposalMapItem\n  StakingRewards: IProposalMapItem\n  KAppFeeTransfer: IProposalMapItem\n  KAppFeeAssetTrigger: IProposalMapItem\n  KAppFeeValidatorConfig: IProposalMapItem\n  KAppFeeFreeze: IProposalMapItem\n  KAppFeeUnfreeze: IProposalMapItem\n  KAppFeeDelegate: IProposalMapItem\n  KAppFeeUndelegate: IProposalMapItem\n  KAppFeeWithdraw: IProposalMapItem\n  KAppFeeClaim: IProposalMapItem\n  KAppFeeUnjail: IProposalMapItem\n  KAppFeeSetAccountName: IProposalMapItem\n  KAppFeeProposal: IProposalMapItem\n  KAppFeeVote: IProposalMapItem\n  KAppFeeConfigITO: IProposalMapItem\n  KAppFeeSetITOPrices: IProposalMapItem\n  KAppFeeBuy: IProposalMapItem\n  KAppFeeSell: IProposalMapItem\n  KAppFeeCancelMarketOrder: IProposalMapItem\n  KAppFeeCreateMarketplace: IProposalMapItem\n  KAppFeeConfigMarketplace: IProposalMapItem\n  KAppFeeUpdateAccountPermission: IProposalMapItem\n  MaxNFTMintBatch: IProposalMapItem\n  MinKFIStakedToEnableProposals: IProposalMapItem\n  MinKLVBucketAmount: IProposalMapItem\n  MaxBucketSize: IProposalMapItem\n  LeaderValidatorRewardsPercentage: IProposalMapItem\n  ProposalMaxEpochsDuration: IProposalMapItem\n  KAppFeeDeposit: IProposalMapItem\n  KAppFeeITOTrigger: IProposalMapItem\n  KAppFeeSmartContract: IProposalMapItem\n}\n\nexport interface IParsedNetworkParam {\n  number: number\n  currentValue: string\n  parameterLabel: string\n}\n\nexport enum NetworkParamsIndexer {\n  FeePerDataByte = 0,\n  KAppFeeCreateValidator = 1,\n  KAppFeeCreateAsset = 2,\n  MaxEpochsUnclaimed = 3,\n  MinSelfDelegatedAmount = 4,\n  MinTotalDelegatedAmount = 5,\n  BlockRewards = 6,\n  StakingRewards = 7,\n  KAppFeeTransfer = 8,\n  KAppFeeAssetTrigger = 9,\n  KAppFeeValidatorConfig = 10,\n  KAppFeeFreeze = 11,\n  KAppFeeUnfreeze = 12,\n  KAppFeeDelegate = 13,\n  KAppFeeUndelegate = 14,\n  KAppFeeWithdraw = 15,\n  KAppFeeClaim = 16,\n  KAppFeeUnjail = 17,\n  KAppFeeSetAccountName = 18,\n  KAppFeeProposal = 19,\n  KAppFeeVote = 20,\n  KAppFeeConfigITO = 21,\n  KAppFeeSetITOPrices = 22,\n  KAppFeeBuy = 23,\n  KAppFeeSell = 24,\n  KAppFeeCancelMarketOrder = 25,\n  KAppFeeCreateMarketplace = 26,\n  KAppFeeConfigMarketplace = 27,\n  KAppFeeUpdateAccountPermission = 28,\n  MaxNFTMintBatch = 29,\n  MinKFIStakedToEnableProposals = 30,\n  MinKLVBucketAmount = 31,\n  MaxBucketSize = 32,\n  LeaderValidatorRewardsPercentage = 33,\n  ProposalMaxEpochsDuration = 34,\n  KAppFeeITOTrigger = 35,\n  KAppFeeDeposit = 36,\n  KAppFeeSmartContract = 37,\n}\n\nexport const ParamContractMap: Record<number, string> = {\n  [TXType.Transfer]: 'KAppFeeTransfer',\n  [TXType.CreateAsset]: 'KAppFeeCreateAsset',\n  [TXType.CreateValidator]: 'KAppFeeCreateValidator',\n  [TXType.AssetTrigger]: 'KAppFeeAssetTrigger',\n  [TXType.ValidatorConfig]: 'KAppFeeValidatorConfig',\n  [TXType.Freeze]: 'KAppFeeFreeze',\n  [TXType.Unfreeze]: 'KAppFeeUnfreeze',\n  [TXType.Delegate]: 'KAppFeeDelegate',\n  [TXType.Undelegate]: 'KAppFeeUndelegate',\n  [TXType.Withdraw]: 'KAppFeeWithdraw',\n  [TXType.Claim]: 'KAppFeeClaim',\n  [TXType.Unjail]: 'KAppFeeUnjail',\n  [TXType.SetAccountName]: 'KAppFeeSetAccountName',\n  [TXType.Proposal]: 'KAppFeeProposal',\n  [TXType.Vote]: 'KAppFeeVote',\n  [TXType.ConfigITO]: 'KAppFeeConfigITO',\n  [TXType.SetITOPrices]: 'KAppFeeSetITOPrices',\n  [TXType.Buy]: 'KAppFeeBuy',\n  [TXType.Sell]: 'KAppFeeSell',\n  [TXType.CancelMarketOrder]: 'KAppFeeCancelMarketOrder',\n  [TXType.CreateMarketplace]: 'KAppFeeCreateMarketplace',\n  [TXType.ConfigMarketplace]: 'KAppFeeConfigMarketplace',\n  [TXType.UpdateAccountPermission]: 'KAppFeeUpdateAccountPermission',\n  [TXType.Deposit]: 'KAppFeeDeposit',\n  [TXType.ITOTrigger]: 'KAppFeeITOTrigger',\n  [TXType.SmartContract]: 'KAppFeeSmartContract',\n}\n","/**\n * Base error class for all Klever SDK errors\n *\n * All custom errors in the SDK extend from this class, providing\n * a consistent interface with error codes and optional details.\n *\n * @example\n * ```typescript\n * try {\n *   // Some operation\n * } catch (error) {\n *   if (error instanceof KleverError) {\n *     console.error(`Error [${error.code}]: ${error.message}`)\n *     console.error('Details:', error.details)\n *   }\n * }\n * ```\n */\nexport class KleverError extends Error {\n  /** Error code for categorizing the error */\n  public readonly code: string\n  /** Additional error details (can be any type) */\n  public readonly details?: unknown\n\n  /**\n   * Creates a new KleverError instance\n   *\n   * @param message - Human-readable error description\n   * @param code - Error code identifier\n   * @param details - Optional additional error information\n   */\n  constructor(message: string, code: string, details?: unknown) {\n    super(message)\n    this.name = 'KleverError'\n    this.code = code\n    this.details = details\n    Object.setPrototypeOf(this, new.target.prototype)\n  }\n}\n\n/**\n * Error thrown when input validation fails\n *\n * Used for invalid addresses, amounts, transaction parameters, etc.\n *\n * @example\n * ```typescript\n * if (!isValidAddress(address)) {\n *   throw new ValidationError('Invalid Klever address', { address })\n * }\n * ```\n */\nexport class ValidationError extends KleverError {\n  /**\n   * Creates a new ValidationError\n   *\n   * @param message - Description of what validation failed\n   * @param details - Optional details about the invalid input\n   */\n  constructor(message: string, details?: unknown) {\n    super(message, 'VALIDATION_ERROR', details)\n    this.name = 'ValidationError'\n  }\n}\n\n/**\n * Error thrown when network/RPC operations fail\n *\n * Used for connection failures, timeout errors, API errors, etc.\n *\n * @example\n * ```typescript\n * try {\n *   await provider.getBalance(address)\n * } catch (error) {\n *   if (error instanceof NetworkError) {\n *     console.error('Network request failed:', error.message)\n *   }\n * }\n * ```\n */\nexport class NetworkError extends KleverError {\n  /**\n   * Creates a new NetworkError\n   *\n   * @param message - Description of the network failure\n   * @param details - Optional details (status code, response data, etc.)\n   */\n  constructor(message: string, details?: unknown) {\n    super(message, 'NETWORK_ERROR', details)\n    this.name = 'NetworkError'\n  }\n}\n\n/**\n * Error thrown when transaction operations fail\n *\n * Used for transaction building, signing, broadcasting, or execution failures.\n *\n * @example\n * ```typescript\n * try {\n *   await signer.sendTransaction(txRequest)\n * } catch (error) {\n *   if (error instanceof TransactionError) {\n *     console.error('Transaction failed:', error.message)\n *     console.error('Details:', error.details)\n *   }\n * }\n * ```\n */\nexport class TransactionError extends KleverError {\n  /**\n   * Creates a new TransactionError\n   *\n   * @param message - Description of the transaction failure\n   * @param details - Optional details (transaction data, blockchain response, etc.)\n   */\n  constructor(message: string, details?: unknown) {\n    super(message, 'TRANSACTION_ERROR', details)\n    this.name = 'TransactionError'\n  }\n}\n\n/**\n * Error thrown when smart contract operations fail\n *\n * Used for contract deployment, invocation, or ABI-related errors.\n *\n * @example\n * ```typescript\n * try {\n *   await contract.invoke('transfer', [recipient, amount])\n * } catch (error) {\n *   if (error instanceof ContractError) {\n *     console.error('Contract call failed:', error.message)\n *   }\n * }\n * ```\n */\nexport class ContractError extends KleverError {\n  /**\n   * Creates a new ContractError\n   *\n   * @param message - Description of the contract operation failure\n   * @param details - Optional details (method name, parameters, contract response, etc.)\n   */\n  constructor(message: string, details?: unknown) {\n    super(message, 'CONTRACT_ERROR', details)\n    this.name = 'ContractError'\n  }\n}\n\n/**\n * Error thrown when wallet operations fail\n *\n * Used for key management, signing, or wallet-related errors.\n *\n * @example\n * ```typescript\n * try {\n *   const wallet = new Wallet(privateKey)\n * } catch (error) {\n *   if (error instanceof WalletError) {\n *     console.error('Wallet initialization failed:', error.message)\n *   }\n * }\n * ```\n */\nexport class WalletError extends KleverError {\n  /**\n   * Creates a new WalletError\n   *\n   * @param message - Description of the wallet operation failure\n   * @param details - Optional details about the failure\n   */\n  constructor(message: string, details?: unknown) {\n    super(message, 'WALLET_ERROR', details)\n    this.name = 'WalletError'\n  }\n}\n\n/**\n * Error thrown when encoding/decoding operations fail\n *\n * Used for proto encoding/decoding, bech32, hex, or other format conversions.\n *\n * @example\n * ```typescript\n * try {\n *   const decoded = bech32Decode(address)\n * } catch (error) {\n *   if (error instanceof EncodingError) {\n *     console.error('Failed to decode address:', error.message)\n *   }\n * }\n * ```\n */\nexport class EncodingError extends KleverError {\n  /**\n   * Creates a new EncodingError\n   *\n   * @param message - Description of the encoding/decoding failure\n   * @param details - Optional details (input data, expected format, etc.)\n   */\n  constructor(message: string, details?: unknown) {\n    super(message, 'ENCODING_ERROR', details)\n    this.name = 'EncodingError'\n  }\n}\n\n/**\n * Error thrown when cryptographic operations fail\n *\n * Used for signing, verification, hashing, or other crypto operations.\n *\n * @example\n * ```typescript\n * try {\n *   const signature = await wallet.signMessage(message)\n * } catch (error) {\n *   if (error instanceof CryptoError) {\n *     console.error('Signing failed:', error.message)\n *   }\n * }\n * ```\n */\nexport class CryptoError extends KleverError {\n  /**\n   * Creates a new CryptoError\n   *\n   * @param message - Description of the cryptographic operation failure\n   * @param details - Optional details about the failure\n   */\n  constructor(message: string, details?: unknown) {\n    super(message, 'CRYPTO_ERROR', details)\n    this.name = 'CryptoError'\n  }\n}\n","/**\n * Core constants for Klever Connect SDK\n */\n\n// ==================== Native Asset Constants ====================\n\n/**\n * Asset ID for Klever's native token (KLV)\n * Used as the identifier for KLV in all transactions and balances\n * @example 'KLV'\n */\nexport const KLV_ASSET_ID = 'KLV'\n\n/**\n * Asset ID for Klever Finance token (KFI)\n * Used as the identifier for KFI in all transactions and balances\n * @example 'KFI'\n */\nexport const KFI_ASSET_ID = 'KFI'\n\n/**\n * Number of decimal places for KLV token\n * KLV uses 6 decimals, so 1 KLV = 1,000,000 smallest units\n * @example 6\n * @see {@link KLV_MULTIPLIER} for the multiplier value\n */\nexport const KLV_PRECISION = 6\n\n/**\n * Number of decimal places for KFI token\n * KFI uses 6 decimals, so 1 KFI = 1,000,000 smallest units\n * @example 6\n * @see {@link KFI_MULTIPLIER} for the multiplier value\n */\nexport const KFI_PRECISION = 6\n\n/**\n * Multiplier to convert KLV to smallest units\n * Equals 1,000,000 (10^6) since KLV has 6 decimal places\n * @example 1000000\n * @see {@link KLV_PRECISION}\n */\nexport const KLV_MULTIPLIER = 10 ** KLV_PRECISION\n\n/**\n * Multiplier to convert KFI to smallest units\n * Equals 1,000,000 (10^6) since KFI has 6 decimal places\n * @example 1000000\n * @see {@link KFI_PRECISION}\n */\nexport const KFI_MULTIPLIER = 10 ** KFI_PRECISION\n\n/**\n * Display name for Klever token\n * @example 'Klever'\n */\nexport const KLV_NAME = 'Klever'\n\n/**\n * Display name for Klever Finance token\n * @example 'Klever Finance'\n */\nexport const KFI_NAME = 'Klever Finance'\n\n/**\n * Base transaction size in bytes used for fee estimation\n * Represents the approximate minimum size of a transaction\n * @example 250\n */\nexport const BASE_TX_SIZE = 250\n\n/**\n * Common assets configuration on Klever blockchain\n * Provides metadata for the main native tokens (KLV and KFI)\n *\n * @example\n * ```typescript\n * const klvInfo = COMMON_ASSETS.KLV\n * console.log(klvInfo.id) // 'KLV'\n * console.log(klvInfo.precision) // 6\n * console.log(klvInfo.name) // 'Klever'\n * ```\n */\nexport const COMMON_ASSETS = {\n  KLV: {\n    id: KLV_ASSET_ID,\n    precision: KLV_PRECISION,\n    name: KLV_NAME,\n  },\n  KFI: {\n    id: KFI_ASSET_ID,\n    precision: KFI_PRECISION,\n    name: KFI_NAME,\n  },\n}\n\n// ==================== Address Constants ====================\n\n/**\n * Bech32 prefix for Klever addresses\n * All Klever addresses start with 'klv1'\n * @example 'klv'\n * @see {@link ADDRESS_LENGTH} for the full address length\n */\nexport const ADDRESS_PREFIX = 'klv'\n\n/**\n * Total length of a Klever address in characters\n * Klever addresses are exactly 62 characters long (including 'klv1' prefix)\n * Format: klv1 (4 chars) + 58 bech32 encoded chars = 62 total\n * @example 62\n * @see {@link ADDRESS_PREFIX}\n */\nexport const ADDRESS_LENGTH = 62\n\n// ==================== Transaction Constants ====================\n\n/**\n * Maximum size for transaction message/data field in bytes\n * Equals 100 KB (102,400 bytes)\n * @example 102400\n */\nexport const MAX_MESSAGE_SIZE = 100 * 1024 // 100 KB\n\n/**\n * Length of transaction signatures in bytes\n * Klever uses 64-byte signatures\n * @example 64\n */\nexport const SIGNATURE_LENGTH = 64\n\n// ==================== Staking Constants ====================\n\n/**\n * Minimum self-delegation required to create a validator\n * Equals 1,000,000 KLV (1,000,000,000,000 in smallest units)\n * @example 1000000000000n\n */\nexport const MIN_SELF_DELEGATION = 1000000000000n // 1,000,000 KLV\n\n/**\n * Time period in seconds for unbonding delegated tokens\n * Equals 21 days (1,814,400 seconds)\n * After undelegating, tokens are locked for this period before being available\n * @example 1814400\n */\nexport const UNBONDING_TIME = 21 * 24 * 60 * 60 // 21 days in seconds\n\n/**\n * Maximum number of delegators that can delegate to a single validator\n * @example 10000\n */\nexport const MAX_DELEGATORS_PER_VALIDATOR = 10000\n\n// ==================== Block Constants ====================\n\n/**\n * Average block time in seconds\n * Klever blockchain produces a new block approximately every 4 seconds\n * @example 4\n * @see {@link BLOCKS_PER_EPOCH}\n */\nexport const BLOCK_TIME = 4 // seconds\n\n/**\n * Number of blocks in one epoch\n * Equals 5,400 blocks (approximately 6 hours at 4 seconds per block)\n * @example 5400\n * @see {@link BLOCK_TIME}, {@link EPOCH_DURATION}\n */\nexport const BLOCKS_PER_EPOCH = 5400 // ~6 hours\n\n/**\n * Number of blocks produced in one year\n * Used for APY calculations and reward estimations\n * @example 7884000\n */\nexport const BLOCKS_PER_YEAR = 7884000\n\n// ==================== Size Limits ====================\n\n/**\n * Maximum transaction size in bytes\n * Equals 32 KB (32,768 bytes)\n * Transactions exceeding this size will be rejected\n * @example 32768\n */\nexport const MAX_TX_SIZE = 32768 // 32KB\n\n/**\n * Maximum length for asset names\n * Asset names cannot exceed 32 characters\n * @example 32\n * @see {@link MAX_TICKER_LENGTH}\n */\nexport const MAX_ASSET_NAME_LENGTH = 32\n\n/**\n * Maximum length for asset ticker symbols\n * Ticker symbols cannot exceed 8 characters\n * @example 8\n * @see {@link MAX_ASSET_NAME_LENGTH}\n */\nexport const MAX_TICKER_LENGTH = 8\n\n// ==================== Time Constants ====================\n\n/**\n * Duration of one epoch in seconds\n * Equals 6 hours (21,600 seconds)\n * @example 21600\n * @see {@link BLOCKS_PER_EPOCH}\n */\nexport const EPOCH_DURATION = 21600 // 6 hours in seconds\n\n/**\n * Number of milliseconds in one second\n * Utility constant for time conversions\n * @example 1000\n */\nexport const MILLISECONDS_PER_SECOND = 1000\n\n// ==================== API Limits ====================\n\n/**\n * Default number of items per page in paginated API responses\n * @example 100\n * @see {@link MAX_PAGE_SIZE}\n */\nexport const DEFAULT_PAGE_SIZE = 100\n\n/**\n * Maximum number of items per page in paginated API responses\n * @example 1000\n * @see {@link DEFAULT_PAGE_SIZE}\n */\nexport const MAX_PAGE_SIZE = 1000\n\n/**\n * Default timeout for API requests in milliseconds\n * Equals 30 seconds (30,000 milliseconds)\n * @example 30000\n */\nexport const DEFAULT_TIMEOUT = 30000 // 30 seconds\n\n/**\n * Default number of block confirmations to wait for transaction finality\n * @example 1\n */\nexport const DEFAULT_CONFIRMATIONS = 1\n\n// ==================== WebSocket Constants ====================\n\n/**\n * Delay in milliseconds before attempting to reconnect after WebSocket disconnect\n * @example 1000\n * @see {@link WS_MAX_RECONNECT_ATTEMPTS}\n */\nexport const WS_RECONNECT_DELAY = 1000\n\n/**\n * Maximum number of reconnection attempts for WebSocket connections\n * After this many failed attempts, the connection will be abandoned\n * @example 5\n * @see {@link WS_RECONNECT_DELAY}\n */\nexport const WS_MAX_RECONNECT_ATTEMPTS = 5\n\n/**\n * Interval in milliseconds between WebSocket ping messages\n * Used to keep the connection alive and detect disconnections\n * Equals 30 seconds (30,000 milliseconds)\n * @example 30000\n */\nexport const WS_PING_INTERVAL = 30000\n","/**\n * Formatting utilities for Klever amounts\n * Similar to ethers.js formatUnits/parseUnits\n *\n * These utilities help convert between human-readable amounts (like \"1.5 KLV\")\n * and the smallest units used internally (like 1500000).\n */\n\n/**\n * Format a value from its smallest unit to a human-readable string\n *\n * Converts amounts from blockchain smallest units to decimal representation.\n * Trailing zeros are automatically removed from the fractional part.\n *\n * @param value - The value in smallest units (e.g., 1000000 = 1 KLV)\n * @param decimals - The number of decimals (default: 6 for KLV/KFI)\n * @returns Formatted string representation\n *\n * @example\n * ```typescript\n * formatUnits(1000000n) // '1'\n * formatUnits(1500000n) // '1.5'\n * formatUnits(1234567n) // '1.234567'\n * formatUnits(500n) // '0.0005'\n * formatUnits('2000000', 6) // '2'\n * formatUnits(1000, 3) // '1' (with 3 decimals)\n * ```\n *\n * @see {@link parseUnits} for the reverse operation\n * @see {@link formatKLV} for KLV-specific formatting\n */\nexport function formatUnits(value: bigint | string | number, decimals = 6): string {\n  const val = typeof value === 'bigint' ? value : BigInt(value)\n  const divisor = 10n ** BigInt(decimals)\n  const quotient = val / divisor\n  const remainder = val % divisor\n\n  if (remainder === 0n) {\n    return quotient.toString()\n  }\n\n  const remainderStr = remainder.toString().padStart(decimals, '0')\n  const trimmed = remainderStr.replace(/0+$/, '')\n\n  return `${quotient}.${trimmed}`\n}\n\n/**\n * Parse a human-readable string to its smallest unit\n *\n * Converts decimal amounts to blockchain smallest units.\n * Throws an error if too many decimal places are provided.\n *\n * @param value - The string or number value (e.g., \"1.5\" or 1.5)\n * @param decimals - The number of decimals (default: 6 for KLV/KFI)\n * @returns Value in smallest units as bigint\n * @throws {Error} If the value has invalid decimal format or too many decimal places\n *\n * @example\n * ```typescript\n * parseUnits('1') // 1000000n\n * parseUnits('1.5') // 1500000n\n * parseUnits('0.000001') // 1n\n * parseUnits(2.5) // 2500000n\n * parseUnits('100', 3) // 100000n (with 3 decimals)\n *\n * // Throws error - too many decimals\n * parseUnits('1.1234567', 6) // Error: Too many decimal places (max 6)\n *\n * // Throws error - invalid format\n * parseUnits('1.2.3') // Error: Invalid decimal value\n * ```\n *\n * @see {@link formatUnits} for the reverse operation\n * @see {@link parseKLV} for KLV-specific parsing\n */\nexport function parseUnits(value: string | number, decimals = 6): bigint {\n  const str = value.toString()\n  const parts = str.split('.')\n\n  if (parts.length > 2) {\n    throw new Error('Invalid decimal value')\n  }\n\n  const [whole, fraction = ''] = parts\n\n  if (fraction.length > decimals) {\n    throw new Error(`Too many decimal places (max ${decimals})`)\n  }\n\n  const paddedFraction = fraction.padEnd(decimals, '0')\n  const combined = whole + paddedFraction\n\n  return BigInt(combined)\n}\n\n/**\n * Format KLV amount from smallest units to human-readable string\n *\n * Convenience function that calls `formatUnits` with 6 decimals (KLV precision).\n *\n * @param amount - Amount in smallest units\n * @returns Formatted KLV string\n *\n * @example\n * ```typescript\n * formatKLV(1000000n) // '1'\n * formatKLV(1500000n) // '1.5'\n * formatKLV('2000000') // '2'\n * ```\n *\n * @see {@link formatUnits} for the underlying implementation\n * @see {@link parseKLV} for the reverse operation\n */\nexport function formatKLV(amount: bigint | string | number): string {\n  return formatUnits(amount, 6)\n}\n\n/**\n * Parse KLV amount from human-readable string to smallest units\n *\n * Convenience function that calls `parseUnits` with 6 decimals (KLV precision).\n *\n * @param amount - Human-readable KLV amount\n * @returns Amount in smallest units as bigint\n * @throws {Error} If the amount has invalid format or too many decimals\n *\n * @example\n * ```typescript\n * parseKLV('1') // 1000000n (1 KLV)\n * parseKLV('1.5') // 1500000n (1.5 KLV)\n * parseKLV(2) // 2000000n (2 KLV)\n * parseKLV('0.000001') // 1n (smallest KLV unit)\n * ```\n *\n * @see {@link parseUnits} for the underlying implementation\n * @see {@link formatKLV} for the reverse operation\n */\nexport function parseKLV(amount: string | number): bigint {\n  return parseUnits(amount, 6)\n}\n","import type { Environment } from './types'\n\n/**\n * Detects the current JavaScript runtime environment\n *\n * Performs comprehensive checks to identify whether the code is running in:\n * - React Native (mobile app)\n * - Browser (web app)\n * - Node.js (server/CLI)\n * - Unknown environment\n *\n * This is useful for conditional behavior based on platform capabilities.\n *\n * @returns The detected environment type\n *\n * @example\n * ```typescript\n * const env = detectEnvironment()\n * if (env === 'browser') {\n *   // Use browser-specific APIs\n * } else if (env === 'node') {\n *   // Use Node.js-specific APIs\n * }\n * ```\n *\n * @see {@link isBrowser}, {@link isNode}, {@link isReactNative} for specific checks\n */\nexport function detectEnvironment(): Environment {\n  // Check for React Native\n  // Using multiple checks for better reliability\n  if (\n    // Modern React Native detection\n    (typeof global !== 'undefined' && '__DEV__' in (global as Record<string, unknown>)) ||\n    // Fallback to navigator userAgent\n    (typeof navigator !== 'undefined' &&\n      navigator.userAgent &&\n      navigator.userAgent.includes('ReactNative')) ||\n    // Legacy check for older RN versions\n    (typeof global !== 'undefined' &&\n      (global as Record<string, unknown>)['navigator'] &&\n      'product' in ((global as Record<string, unknown>)['navigator'] as Record<string, unknown>) &&\n      ((global as Record<string, unknown>)['navigator'] as Record<string, unknown>)['product'] ===\n        'ReactNative')\n  ) {\n    return 'react-native'\n  }\n\n  // Check for browser\n  if (typeof globalThis !== 'undefined' && 'window' in globalThis && 'document' in globalThis) {\n    return 'browser'\n  }\n\n  // Check for Node.js\n  if (typeof process !== 'undefined' && process.versions && process.versions.node) {\n    return 'node'\n  }\n\n  // Unknown environment\n  return 'unknown'\n}\n\n/**\n * Checks if the code is running in a browser environment\n *\n * @returns `true` if running in a browser, `false` otherwise\n *\n * @example\n * ```typescript\n * if (isBrowser()) {\n *   // Use localStorage, fetch, etc.\n *   window.localStorage.setItem('key', 'value')\n * }\n * ```\n *\n * @see {@link detectEnvironment} for full environment detection\n */\nexport function isBrowser(): boolean {\n  return detectEnvironment() === 'browser'\n}\n\n/**\n * Checks if the code is running in Node.js environment\n *\n * @returns `true` if running in Node.js, `false` otherwise\n *\n * @example\n * ```typescript\n * if (isNode()) {\n *   // Use Node.js-specific modules\n *   const fs = require('fs')\n * }\n * ```\n *\n * @see {@link detectEnvironment} for full environment detection\n */\nexport function isNode(): boolean {\n  return detectEnvironment() === 'node'\n}\n\n/**\n * Checks if the code is running in React Native environment\n *\n * @returns `true` if running in React Native, `false` otherwise\n *\n * @example\n * ```typescript\n * if (isReactNative()) {\n *   // Use React Native-specific modules\n *   import { AsyncStorage } from 'react-native'\n * }\n * ```\n *\n * @see {@link detectEnvironment} for full environment detection\n */\nexport function isReactNative(): boolean {\n  return detectEnvironment() === 'react-native'\n}\n","/**\n * Lightweight logging system with multiple levels and customizable output\n *\n * @example\n * ```typescript\n * import { createLogger } from '@klever/connect-core'\n *\n * const logger = createLogger('MyModule', {\n *   level: 'debug',\n *   prefix: true,\n *   timestamp: true\n * })\n *\n * logger.debug('Starting operation', { data: 123 })\n * logger.info('Operation complete')\n * logger.warn('Low balance detected')\n * logger.error('Failed to send transaction', error)\n * ```\n */\n\nexport type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent'\n\nexport interface LoggerOptions {\n  /** Minimum log level to output */\n  level?: LogLevel\n  /** Include timestamp in logs */\n  timestamp?: boolean\n  /** Include module prefix in logs */\n  prefix?: boolean\n  /** Custom log handler */\n  handler?: LogHandler\n  /** Enable color output (Node.js only) */\n  colors?: boolean\n}\n\nexport interface LogHandler {\n  debug(module: string, message: string, ...args: unknown[]): void\n  info(module: string, message: string, ...args: unknown[]): void\n  warn(module: string, message: string, ...args: unknown[]): void\n  error(module: string, message: string, ...args: unknown[]): void\n}\n\nexport interface Logger {\n  debug(message: string, ...args: unknown[]): void\n  info(message: string, ...args: unknown[]): void\n  warn(message: string, ...args: unknown[]): void\n  error(message: string, ...args: unknown[]): void\n  child(module: string): Logger\n  setLevel(level: LogLevel): void\n}\n\n// Log level priorities\nconst LOG_LEVELS: Record<LogLevel, number> = {\n  debug: 0,\n  info: 1,\n  warn: 2,\n  error: 3,\n  silent: 4,\n}\n\n// ANSI color codes for terminal output\nconst COLORS = {\n  reset: '\\x1b[0m',\n  bright: '\\x1b[1m',\n  dim: '\\x1b[2m',\n  red: '\\x1b[31m',\n  yellow: '\\x1b[33m',\n  blue: '\\x1b[34m',\n  gray: '\\x1b[90m',\n  cyan: '\\x1b[36m',\n} as const\n\n// Default console handler\nclass ConsoleHandler implements LogHandler {\n  constructor(private options: LoggerOptions = {}) {}\n\n  private format(level: LogLevel, module: string, message: string, ...args: unknown[]): unknown[] {\n    const parts: string[] = []\n\n    // Add timestamp\n    if (this.options.timestamp) {\n      const timestamp = new Date().toISOString()\n      parts.push(this.options.colors ? `${COLORS.gray}${timestamp}${COLORS.reset}` : timestamp)\n    }\n\n    // Add level\n    const levelStr = `[${level.toUpperCase()}]`\n    if (this.options.colors) {\n      const color =\n        {\n          debug: COLORS.gray,\n          info: COLORS.cyan,\n          warn: COLORS.yellow,\n          error: COLORS.red,\n          silent: COLORS.reset,\n        }[level] || COLORS.reset\n\n      parts.push(`${color}${levelStr}${COLORS.reset}`)\n    } else {\n      parts.push(levelStr)\n    }\n\n    // Add module prefix\n    if (this.options.prefix && module) {\n      const prefix = `[${module}]`\n      parts.push(this.options.colors ? `${COLORS.bright}${prefix}${COLORS.reset}` : prefix)\n    }\n\n    // Add message\n    parts.push(message)\n\n    return [parts.join(' '), ...args]\n  }\n\n  debug(module: string, message: string, ...args: unknown[]): void {\n    console.debug(...this.format('debug', module, message, ...args))\n  }\n\n  info(module: string, message: string, ...args: unknown[]): void {\n    console.info(...this.format('info', module, message, ...args))\n  }\n\n  warn(module: string, message: string, ...args: unknown[]): void {\n    console.warn(...this.format('warn', module, message, ...args))\n  }\n\n  error(module: string, message: string, ...args: unknown[]): void {\n    console.error(...this.format('error', module, message, ...args))\n  }\n}\n\n// Safe environment check for both browser and Node.js\nfunction getEnvVar(name: string): string | undefined {\n  // 1. Check process.env (Node.js)\n  if (typeof process !== 'undefined' && process.env) {\n    return process.env[name]\n  }\n\n  // 2. Check import.meta.env (Vite and other modern bundlers)\n  try {\n    if (typeof import.meta !== 'undefined' && import.meta.env) {\n      const env =\n        typeof import.meta === 'object' && 'env' in import.meta\n          ? (import.meta as unknown as { env: Record<string, string | undefined> }).env\n          : undefined\n      const value = env?.[name] || env?.[`VITE_${name}`]\n      if (value) return value\n    }\n  } catch {\n    // import.meta is not available in this environment\n  }\n\n  // 3. Check globalThis (works in both browser and Node.js)\n  if (typeof globalThis !== 'undefined' && (globalThis as Record<string, unknown>)[name]) {\n    return (globalThis as Record<string, unknown>)[name] as string | undefined\n  }\n\n  // 4. Check window object (browser only)\n  if (typeof globalThis !== 'undefined' && 'window' in globalThis) {\n    // Check window.__env__ (common pattern for runtime config)\n    const win = (globalThis as typeof globalThis & { window: Record<string, unknown> }).window\n    const envObj = win['__env__'] as Record<string, unknown> | undefined\n    if (envObj && typeof envObj === 'object' && name in envObj) {\n      return envObj[name] as string | undefined\n    }\n\n    // Check window directly\n    if (name in win) {\n      return win[name] as string | undefined\n    }\n  }\n\n  return undefined\n}\n\nfunction isProduction(): boolean {\n  return getEnvVar('NODE_ENV') === 'production'\n}\n\nfunction isTTY(): boolean {\n  if (typeof process !== 'undefined' && process.stdout?.isTTY) {\n    return process.stdout.isTTY\n  }\n  return false\n}\n\n/**\n * Creates a logger instance for a specific module\n *\n * Logger instances provide debug, info, warn, and error logging methods\n * with configurable levels, formatting, and output handling.\n *\n * @param module - The module name to prefix log messages with\n * @param options - Optional logger configuration\n * @returns A configured Logger instance\n *\n * @example\n * ```typescript\n * const logger = createLogger('MyModule', {\n *   level: 'debug',\n *   timestamp: true,\n *   colors: true\n * })\n *\n * logger.debug('Detailed debug info')\n * logger.info('Operation started')\n * logger.warn('Low memory warning')\n * logger.error('Operation failed', error)\n *\n * // Create child logger with nested module name\n * const childLogger = logger.child('SubModule')\n * childLogger.info('Message from MyModule:SubModule')\n * ```\n */\nexport function createLogger(module: string, options: LoggerOptions = {}): Logger {\n  const level = options.level || (isProduction() ? 'warn' : 'debug')\n  const handler = options.handler || new ConsoleHandler(options)\n  let currentLevel = LOG_LEVELS[level]\n\n  const shouldLog = (logLevel: LogLevel): boolean => {\n    return LOG_LEVELS[logLevel] >= currentLevel\n  }\n\n  return {\n    debug(message: string, ...args: unknown[]): void {\n      if (shouldLog('debug')) {\n        handler.debug(module, message, ...args)\n      }\n    },\n\n    info(message: string, ...args: unknown[]): void {\n      if (shouldLog('info')) {\n        handler.info(module, message, ...args)\n      }\n    },\n\n    warn(message: string, ...args: unknown[]): void {\n      if (shouldLog('warn')) {\n        handler.warn(module, message, ...args)\n      }\n    },\n\n    error(message: string, ...args: unknown[]): void {\n      if (shouldLog('error')) {\n        handler.error(module, message, ...args)\n      }\n    },\n\n    child(childModule: string): Logger {\n      return createLogger(`${module}:${childModule}`, options)\n    },\n\n    setLevel(newLevel: LogLevel): void {\n      currentLevel = LOG_LEVELS[newLevel]\n    },\n  }\n}\n\n// Initialize global options - can be overridden by browser config\nfunction initGlobalOptions(): LoggerOptions {\n  const defaultLevel = isProduction() ? 'warn' : 'info'\n  const envLevel = getEnvVar('KLEVER_LOG_LEVEL') as LogLevel\n\n  return {\n    level: envLevel || defaultLevel,\n    timestamp: true,\n    prefix: true,\n    colors: !isProduction() && isTTY(),\n  }\n}\n\n// Global logger configuration\nlet globalOptions: LoggerOptions = initGlobalOptions()\n\n/**\n * Sets global logger options that apply to all loggers created via `getGlobalLogger()`\n *\n * This allows you to configure logging behavior across the entire SDK from a single point.\n * Changes affect all future logger instances created with `getGlobalLogger()`.\n *\n * @param options - Partial logger options to merge with current global settings\n *\n * @example\n * ```typescript\n * // Set global log level to debug\n * setGlobalLoggerOptions({ level: 'debug' })\n *\n * // Disable timestamps and colors\n * setGlobalLoggerOptions({\n *   timestamp: false,\n *   colors: false\n * })\n *\n * // Use custom log handler\n * setGlobalLoggerOptions({\n *   handler: myCustomHandler\n * })\n * ```\n *\n * @see {@link getGlobalLogger}\n * @see {@link initBrowserLogger}\n */\nexport function setGlobalLoggerOptions(options: Partial<LoggerOptions>): void {\n  globalOptions = { ...globalOptions, ...options }\n}\n\n/**\n * Initialize logger configuration from browser environment\n * Call this in your app initialization to set up logging\n *\n * @example\n * ```typescript\n * // In your browser app initialization\n * initBrowserLogger({\n *   level: 'debug',\n *   timestamp: false,\n *   colors: false\n * })\n *\n * // Or load from window.__env__\n * window.__env__ = { KLEVER_LOG_LEVEL: 'debug' }\n * initBrowserLogger()\n * ```\n */\nexport function initBrowserLogger(options?: Partial<LoggerOptions>): void {\n  // Re-initialize to pick up any browser environment variables\n  const baseOptions = initGlobalOptions()\n\n  // Merge with provided options\n  if (options) {\n    setGlobalLoggerOptions({ ...baseOptions, ...options })\n  } else {\n    setGlobalLoggerOptions(baseOptions)\n  }\n}\n\n/**\n * Creates a logger instance using global configuration\n *\n * This is the recommended way to create loggers in the SDK, as it ensures\n * consistent configuration across all modules. The global options can be\n * set via `setGlobalLoggerOptions()` or `initBrowserLogger()`.\n *\n * @param module - The module name for the logger\n * @returns A Logger instance configured with global options\n *\n * @example\n * ```typescript\n * // In your module\n * const logger = getGlobalLogger('MyModule')\n *\n * logger.info('Module initialized')\n * logger.debug('Processing data', { count: 10 })\n * ```\n *\n * @see {@link setGlobalLoggerOptions} to configure global options\n * @see {@link createLogger} for creating loggers with custom options\n */\nexport function getGlobalLogger(module: string): Logger {\n  return createLogger(module, globalOptions)\n}\n\n/**\n * Pre-configured logger for core SDK operations\n * @example\n * ```typescript\n * coreLogger.info('SDK initialized')\n * ```\n */\nexport const coreLogger = getGlobalLogger('core')\n\n/**\n * Pre-configured logger for provider/network operations\n * @example\n * ```typescript\n * providerLogger.debug('Fetching account balance')\n * ```\n */\nexport const providerLogger = getGlobalLogger('provider')\n\n/**\n * Pre-configured logger for wallet operations\n * @example\n * ```typescript\n * walletLogger.info('Signing transaction')\n * ```\n */\nexport const walletLogger = getGlobalLogger('wallet')\n\n/**\n * Pre-configured logger for transaction operations\n * @example\n * ```typescript\n * transactionLogger.debug('Building transfer transaction')\n * ```\n */\nexport const transactionLogger = getGlobalLogger('transaction')\n\n/**\n * Pre-configured logger for smart contract operations\n * @example\n * ```typescript\n * contractLogger.info('Invoking contract method', { method: 'transfer' })\n * ```\n */\nexport const contractLogger = getGlobalLogger('contract')\n"]}