Expand description
Various utilities
Re-exports§
Modules§
- moonbeam
- Moonbeam utils Moonbeam utilities
Structs§
- Anvil
Non-WebAssembly - Builder for launching
anvil
. - Anvil
Instance Non-WebAssembly - An anvil CLI instance. Will close the instance when dropped.
- Chain
Config - Represents a node’s chain configuration.
- Clique
Config - Consensus configuration for Clique.
- Ethash
Config - Empty consensus configuration for proof-of-work networks.
- Ganache
Non-WebAssembly - Builder for launching
ganache-cli
. - Ganache
Instance Non-WebAssembly - A ganache CLI instance. Will close the instance when dropped.
- Genesis
- This represents the chain configuration, specifying the genesis block, header fields, and hard fork switch blocks.
- Genesis
Account - An account in the state of the genesis block.
- Geth
Non-WebAssembly - Builder for launching
geth
. - Geth
Instance Non-WebAssembly - A geth instance. Will close the instance when dropped.
Enums§
- Conversion
Error - Parse
Units - This enum holds the numeric types that a possible to be returned by
parse_units
and that are taken byformat_units
. - Units
- Common Ethereum unit types.
Constants§
- EIP1559_
FEE_ ESTIMATION_ DEFAULT_ PRIORITY_ FEE - The default max priority fee per gas, used in case the base fee is within a threshold.
- EIP1559_
FEE_ ESTIMATION_ PAST_ BLOCKS - The number of blocks from the past for which the fee rewards are fetched for fee estimation.
- EIP1559_
FEE_ ESTIMATION_ PRIORITY_ FEE_ TRIGGER - The threshold for base fee below which we use the default priority fee, and beyond which we estimate an appropriate value for priority fee.
- EIP1559_
FEE_ ESTIMATION_ REWARD_ PERCENTILE - The default percentile of gas premiums that are fetched for fee estimation.
- EIP1559_
FEE_ ESTIMATION_ THRESHOLD_ MAX_ CHANGE - The threshold max change/difference (in %) at which we will ignore the fee history values under it.
- WEI_
IN_ ETHER - 1 Ether = 1e18 Wei == 0x0de0b6b3a7640000 Wei
Functions§
- eip1559_
default_ estimator - The default EIP-1559 fee estimator which is based on the work by MyCrypto
- format_
bytes32_ string - Returns a bytes32 string representation of text. If the length of text exceeds 32 bytes, an error is returned.
- format_
ether - Format the output for the user which prefer to see values in ether (instead of wei)
- format_
units - Divides the provided amount with 10^{units} provided.
- from_
bytes_ to_ h256 - Converts a Bytes value into a H256, accepting inputs that are less than 32 bytes long. These inputs will be left padded with zeros.
- from_
unformatted_ hex_ map - Deserializes the input into an Option<HashMap<H256, H256>>, using from_unformatted_hex to deserialize the keys and values.
- get_
contract_ address - The address for an Ethereum contract is deterministically computed from the address of its creator (sender) and how many transactions the creator has sent (nonce). The sender and nonce are RLP encoded and then hashed with Keccak-256.
- get_
create2_ address - Returns the CREATE2 address of a smart contract as specified in EIP1014
- get_
create2_ address_ from_ hash - Returns the CREATE2 address of a smart contract as specified in EIP1014, taking the pre-computed hash of the init code as input.
- hash_
message - Hash a message according to EIP-191 (version
0x01
). - id
- Calculate the function selector as per the contract ABI specification. This is defined as the first 4 bytes of the Keccak256 hash of the function signature.
- keccak256
- Compute the Keccak-256 hash of input bytes.
- parse_
bytes32_ string - Returns the decoded string represented by the bytes32 encoded data.
- parse_
checksummed - Parses an EIP-1191 checksum address.
- parse_
ether - Converts the input to a U256 and converts from Ether to Wei.
- parse_
units - Multiplies the provided amount with 10^{units} provided.
- public_
key_ to_ address - Converts an public key, in compressed or uncompressed form to an Ethereum address
- raw_
public_ key_ to_ address - Convert a raw, uncompressed public key to an address.
- secret_
key_ to_ address - Converts a K256 SigningKey to an Ethereum Address
- serialize
- Serialize a type.
- to_
checksum - Encodes an Ethereum address to its EIP-55 checksum.