Skip to content

Files

Latest commit

51edb79 · Jun 28, 2022

History

History
45 lines (29 loc) · 665 Bytes

Base API.md

File metadata and controls

45 lines (29 loc) · 665 Bytes

🚧 Base API

Encoding and Decoding Helpers

  1. Converts a hex string to a integer.

    iex> Web3.to_hex(10)
    "0xA"
    
    iex> Web3.to_hex("0xa")
    "0xa"
    
    iex> Web3.to_hex(true)
    "0x1"
  2. Converts a integer to hex.

    iex> Web3.to_hex(10)
    "0xA"
    
    iex> Web3.to_hex("0xa")
    "0xa"
    
    iex> Web3.to_hex(true)
    "0x1"

Address Helpers

  • Web3.is_address/1
  • Web3.is_checksum_address/1

Currency Conversions

  • Web3.to_wei/1
  • Web3.from_wei/1

Cryptographic Hashing

  • Web3.keccak256/1

More details found here