near-ca
Version:
An SDK for controlling Ethereum Accounts from a Near Account.
26 lines (25 loc) • 1.17 kB
TypeScript
import { Address } from "viem";
/**
* Converts a NEAR account public key string to an uncompressed hex point
*
* @param najPublicKeyStr - The NEAR account public key string
* @returns Uncompressed hex point string prefixed with "04"
*/
export declare function najPublicKeyStrToUncompressedHexPoint(najPublicKeyStr: string): string;
/**
* Derives a child public key using elliptic curve operations
*
* @param parentUncompressedPublicKeyHex - Parent public key as uncompressed hex
* @param signerId - The signer's identifier
* @param path - Optional derivation path (defaults to empty string)
* @returns Derived child public key as uncompressed hex string
*/
export declare function deriveChildPublicKey(parentUncompressedPublicKeyHex: string, signerId: string, path?: string): string;
/**
* Converts an uncompressed hex point to an Ethereum address
*
* @param uncompressedHexPoint - The uncompressed hex point string
* @returns Ethereum address derived from the public key
* @remarks Takes the last 20 bytes of the keccak256 hash of the public key
*/
export declare function uncompressedHexPointToEvmAddress(uncompressedHexPoint: string): Address;