chaingate
Version:
Multi-chain cryptocurrency SDK for TypeScript — unified API for Bitcoin, Ethereum, Litecoin, Dogecoin, Bitcoin Cash, Polygon, Arbitrum, and any EVM-compatible chain. Create wallets, query balances, send transactions, and manage tokens and NFTs across UTXO
32 lines (31 loc) • 1.23 kB
TypeScript
/**
* Returns the compressed public key for a given private key.
*
* @param privateKey - The private key bytes.
* @returns The compressed public key bytes.
*/
export declare function privateKeyToPublicKey(privateKey: Uint8Array): Uint8Array;
/**
* Compresses a public key to its short form. Accepts both compressed and uncompressed keys.
*
* @param raw - The public key bytes (compressed or uncompressed).
* @returns The compressed public key bytes.
*/
export declare function compressPublicKey(raw: Uint8Array): Uint8Array;
/**
* Derives an EIP-55 checksummed Ethereum address from a compressed or uncompressed public key.
*
* @param publicKey - The public key bytes (compressed or uncompressed).
* @returns The checksummed Ethereum address (e.g. `"0xAb5801a7..."`).
*/
export declare function publicKeyToEthAddress(publicKey: Uint8Array): string;
/**
* Checks whether a string is a valid EVM address.
*
* Accepts both checksummed and all-lowercase/all-uppercase forms.
* When the address uses mixed case, the EIP-55 checksum is verified.
*
* @param address - The address string to validate.
* @returns `true` if the address is valid.
*/
export declare function isValidEvmAddress(address: string): boolean;