Function validateContractAddress

  • Parameters

    • value: string

    Returns ValidationResult

    0 (NO_PREFIX_MATCHED), 1 (INVALID_CHECKSUM), 2 (INVALID_LENGTH) or 3 (VALID).

    Used to check if a contract address is valid.

    import { validateContractAddress } from '@taquito/utils';
    const contractAddress = 'KT1JVErLYTgtY8uGGZ4mso2npTSxqVLDRVbC'
    const validation = validateContractAddress(contractAddress)
    console.log(validation)
    // This example return 3 which correspond to VALID