UNPKG

@pokt-network/pocket-js

Version:

Pocket-js core package with the main functionalities to interact with the Pocket Network.

32 lines (31 loc) 1.33 kB
/// <reference types="node" /> /** * @description Calculates the address from a given public key * @param {Buffer} publicKey - Public key from which we're going to calculate the address for * @returns {Buffer} - Address buffer. */ export declare function addressFromPublickey(publicKey: Buffer): Buffer; /** * Extracts the public key from a 64-byte long ed25519 private key * @param {Buffer} privateKey - Private key buffer. * @returns {Buffer} - Public Key buffer. */ export declare function publicKeyFromPrivate(privateKey: Buffer): Buffer; /** * Validates an ed25519 private key structure * @param {Buffer} privateKey - Private key buffer. * @returns {boolean} - True or false if the private key is valid. */ export declare function validatePrivateKey(privateKey: Buffer): boolean; /** * Validates the address for a hex string encoded representing an ed25519 keypair * @param {string} addressHex - Address hex. * @returns {Error | undefined} - Address buffer. */ export declare function validateAddressHex(addressHex: string): Error | undefined; /** * Validates an ed25519 public key structure * @param {Buffer | string} pubKey - Public key buffer or string. * @returns {boolean} - True or false if the public key is valid. */ export declare function validatePublicKey(pubKey: Buffer | string): boolean;