@gnolang/tm2-js-client
Version:
Tendermint2 JS / TS Client
37 lines (36 loc) • 1.32 kB
TypeScript
import { HdPath } from '@cosmjs/crypto';
/**
* Generates the HD path, for the specified index, in the form 'm/44'/118'/0'/0/i',
* where 'i' is the account index
* @param {number} [index=0] the account index
*/
export declare const generateHDPath: (index?: number) => HdPath;
/**
* Generates random entropy of the specified size (in B)
* @param {number} [size=32] the entropy size in bytes
*/
export declare const generateEntropy: (size?: number) => Uint8Array;
interface keyPair {
privateKey: Uint8Array;
publicKey: Uint8Array;
}
/**
* Generates a new Secp256k1 key-pair using
* the provided English mnemonic and account index
* @param {string} mnemonic the English mnemonic
* @param {number} [accountIndex=0] the account index
*/
export declare const generateKeyPair: (mnemonic: string, accountIndex?: number) => Promise<keyPair>;
export declare const defaultAddressPrefix = "g";
/**
* Encodes a string into a Uint8Array
* @param {string} str the string to be encoded
*/
export declare const stringToUTF8: (str: string) => Uint8Array;
/**
* Escapes <,>,& in string.
* Golang's json marshaller escapes <,>,& by default.
* https://cs.opensource.google/go/go/+/refs/tags/go1.20.6:src/encoding/json/encode.go;l=46-53
*/
export declare function encodeCharacterSet(data: string): string;
export {};