Skip to content

encodePrincipalToEthAddress

encodePrincipalToEthAddress(principal): string

Defined in: packages/cketh/src/utils/minter.utils.ts:12

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

Principal

The principal to encode into a fixed 32-byte representation suitable for calling Ethereum smart contracts.

string