/**
* Codec class
*/
///
declare class Codec {
private readonly _sha256;
private readonly _alphabet;
private readonly _codec;
constructor(options: {
sha256: (bytes: Uint8Array) => Buffer;
alphabet: string;
});
/**
* Encoder.
*
* @param bytes - Buffer of data to encode.
* @param opts - Options object including the version bytes and the expected length of the data to encode.
*/
encode(bytes: Buffer, opts: {
versions: number[];
expectedLength: number;
}): string;
/**
* Decoder.
*
* @param base58string - Base58Check-encoded string to decode.
* @param opts - Options object including the version byte(s) and the expected length of the data after decoding.
*/
decode(base58string: string, opts: {
versions: Array;
expectedLength?: number;
versionTypes?: ['ed25519', 'secp256k1'];
}): {
version: number[];
bytes: Buffer;
type: 'ed25519' | 'secp256k1' | null;
};
encodeChecked(buffer: Buffer): string;
decodeChecked(base58string: string): Buffer;
private _encodeVersioned;
private _encodeRaw;
private _decodeRaw;
private _verifyCheckSum;
}
export declare const codec: Codec;
export declare function encodeSeed(entropy: Buffer, type: 'ed25519' | 'secp256k1'): string;
export declare function decodeSeed(seed: string, opts?: {
versionTypes: ['ed25519', 'secp256k1'];
versions: Array;
expectedLength: number;
}): {
version: number[];
bytes: Buffer;
type: 'ed25519' | 'secp256k1' | null;
};
export declare function encodeAccountID(bytes: Buffer): string;
export declare const encodeAddress: typeof encodeAccountID;
export declare function decodeAccountID(accountId: string): Buffer;
export declare const decodeAddress: typeof decodeAccountID;
export declare function decodeNodePublic(base58string: string): Buffer;
export declare function encodeNodePublic(bytes: Buffer): string;
export declare function encodeAccountPublic(bytes: Buffer): string;
export declare function decodeAccountPublic(base58string: string): Buffer;
export declare function isValidClassicAddress(address: string): boolean;
export {};