Tradehub.Wallet.address_from_private_key
You're seeing just the function
address_from_private_key
, go back to Tradehub.Wallet module for more information.
Specs
address_from_private_key(String.t() | bitstring(), atom()) :: {:ok, String.t()} | {:error, String.t()}
Look for the wallet address based on the given public key within a network.
Examples
iex> Tradehub.Wallet.address_from_private_key("151f85d41358f56d14bec4846c5370a3ae4f34decba71d48feac75ecbf6c8ca1")
{:ok, "tswth174cz08dmgluavwcz2suztvydlptp4a8f8t5h4t"}
iex> Tradehub.Wallet.address_from_private_key(<<21, 31, 133, 212, 19, 88, 245, 109, 20, 190, 196, 132, 108, 83, 112, 163, 174, 79, 52, 222, 203, 167, 29, 72, 254, 172, 117, 236, 191, 108, 140, 161>>)
{:ok, "tswth174cz08dmgluavwcz2suztvydlptp4a8f8t5h4t"}
iex> Tradehub.Wallet.address_from_private_key("151f85d41358f56d14bec4846c5370a3ae4f34decba71d48feac75ecbf6c8ca1", :mainnet)
{:ok, "swth174cz08dmgluavwcz2suztvydlptp4a8fru98vw"}