@tgrospic/rnode-grpc-js
Version:
RNode gRPC helpers
41 lines (40 loc) • 1.37 kB
TypeScript
/**
* Represents REV address with different _sources_.
*
* REV address is derived from private key but not directly.
* Public key is derived from private key, ETH address is derived from public key and
* REV address is derived from ETH address.
*
* Private key -> public key -> ETH address -> REV address.
*/
export interface RevAddress {
revAddr: string;
ethAddr?: string;
pubKey?: string;
privKey?: string;
}
/**
* Parses REV address from ETH address.
*/
export declare function getAddrFromEth(ethAddrRaw: string): string | undefined;
/**
* Parses REV address (with ETH address) from public key.
*/
export declare function getAddrFromPublicKey(publicKeyRaw: string): RevAddress | undefined;
/**
* Parses REV address (with ETH address and public key) from private key.
*/
export declare function getAddrFromPrivateKey(privateKeyRaw: string): RevAddress | undefined;
/**
* Verifes REV address as hex string.
*/
export declare function verifyRevAddr(revAddr: string): boolean;
/**
* Generates a new REV address with corresponding private, public key and ETH address.
*/
export declare function newRevAddress(): RevAddress;
/**
* Parses REV address from different sources in string hex format.
* (private key -> public key -> ETH address -> REV address)
*/
export declare function parseRevAddress(text: string): RevAddress | undefined;