did-sdk-js
Version:
js sdk for did and vc according to mcps did spec
35 lines (34 loc) • 1.19 kB
TypeScript
/**
* Utilities for address operations
*/
export declare class AddressUtils {
/**
* Decodes an address in bech32 format.
* @param address The bech32 address to decode
* @returns The decoded address buffer
*/
/**
* Encodes an address from input data bytes.
* @param pubkeyHash The public key to encode
* @param hrp The address prefix
* @param type The output type (default: hex)
* @returns Bech32 address
*/
/**
* ConvertAndEncode converts from a base64 encoded byte array to bach32 encoded byte string and then to bech32
* @param hrp The address prefix
* @param data Base64 encoded byte array
* @returns Bech32 address
*/
static convertAndEncode(hrp: string, data: Uint8Array): any;
/**
* Copy from https://github.com/sipa/bech32/blob/master/ref/javascript/segwit_addr.js
*/
private static convertBits;
/**
* DecodeAndConvert decodes a bech32 encoded string and converts to base64 encoded bytes
* @param address Bech32 address
* @returns Base64 encoded bytes
*/
static decodeAndConvert(address: string): number[];
}