Installation
npm install --save @types/cashaddrjs
Summary
This package contains type definitions for cashaddrjs (https://github.com/bitcoincashjs/cashaddrjs#readme).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cashaddrjs.
export as namespace cashaddr;
/**
* Encodes a hash from a given type into a Bitcoin Cash address with the given prefix.
*
* @param prefix Network prefix. E.g.: 'bitcoincash'.
* @param type Type of address to generate. Either 'P2PKH' or 'P2SH'.
* @param hash Hash to encode represented as an array of 8-bit integers.
* @throws {ValidationError}
*/
export function encode(prefix: string, type: string, hash: Uint8Array): string;
export function decode(address: string): { prefix: string; type: string; hash: Uint8Array };
export class ValidationError extends Error {
constructor(message: string);
}
Additional Details
- Last updated: Mon, 06 Nov 2023 22:41:05 GMT
- Dependencies: none
Credits
These definitions were written by Emilio Almansi.