Module ergo_headless_dapp_framework::encoding
source · [−]Enums
Functions
Takes an Ergo address (either P2PK or P2S) as a Base58 String and returns
the ErgoTree
if it is a valid address.
Builds a Token
struct using the provided token_id
and token_amount
.
Useful when manually constructing transaction logic and requiring
building Token
s when dealing with the id as a String and the amount
as a u64.
Builds a TokenAmount
struct
Builds a TokenId
struct
Deserialize ErgoTree inside of a Constant
acquired from a register of an ErgoBox
into a P2S Base58 String.
Acquire the ErgoTree
of the P2S Base58 String.
Convert from Erg to nanoErg
Given a P2S address, extract its ErgoTree
, serialize it into hex-encoded
bytes, hash it with blake2b_256, and then prepare it to be used
in a register as a Constant
Convert from nanoErg to Erg
Attempts to acquire the Base58 encoded P2S or P2PK Address from an ErgoTree
Decodes a hex-encoded string into bytes and then serializes it into a properly formatted signed hex-encoded string and converted into a Constant
Acquires the Base58 encoded P2S Address from an ErgoTree
Serialize a String
value into a signed hex-encoded byte string
and then convert it into a Constant
to be used in registers.
Takes the blake2b hash of a String, then converted into/represented as hex as a String
Unwraps a hex-encoded String which is inside of a Constant
acquired from a register of an ErgoBox
.
Unwraps a hex-encoded i32
Int inside of a Constant
acquired from a register of an ErgoBox
Unwrap a hex-encoded i64
Long inside of a Constant
acquired from a register of an ErgoBox
Unwrap a String which is inside of a Constant
acquired from a register of an ErgoBox