Skip to content

PublicKey.validate

Validates a PublicKey.PublicKey. Returns true if valid, false otherwise.

Imports

Named
import { PublicKey } from 'ox'

Examples

import { PublicKey } from 'ox'
 
const valid = PublicKey.validate({
  prefix: 4,
  y: 49782753348462494199823712700004552394425719014458918871452329774910450607807n,
})
false

Definition

function validate(
  publicKey: ExactPartial<PublicKey>,
  options?: validate.Options,
): boolean

Source: src/PublicKey.ts

Parameters

publicKey

  • Type: ExactPartial<PublicKey>

The public key object to assert.

options

  • Type: validate.Options
  • Optional

options.compressed

  • Type: boolean
  • Optional

Whether or not the public key should be compressed.

Return Type

boolean