Function validatePublicKey

  • Parameters

    • value: string

    Returns ValidationResult

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

    Used to check if a public key is valid.

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