UNPKG

@dfinity/cketh

Version:

A library for interfacing with ckETH.

11 lines (10 loc) 594 B
import type { Principal } from "@dfinity/principal"; /** * Encode a principal to a byte array as Ethereum data hex (staring with 0x). * Such a conversion is required to deposit ETH to the ckETH helper contract. * * Code adapted from the ckETH minter dashboard JS function: https://github.com/dfinity/ic/blob/master/rs/ethereum/cketh/minter/templates/principal_to_bytes.js * * @param principal The principal to encode into a fixed 32-byte representation suitable for calling Ethereum smart contracts. */ export declare const encodePrincipalToEthAddress: (principal: Principal) => string;