Expand description
High-level facade for the AElf Rust SDK.
This crate re-exports the most commonly used client, wallet, keystore and contract APIs behind a single dependency.
Re-exports§
pub use aelf_proto as proto;
Modules§
Structs§
- AElf
Client - High-level async client that mirrors the main entry point of the other AElf SDKs.
- Aedpos
Contract - Typed wrapper for the AEDPoS consensus contract.
- Basic
Auth - HTTP basic authentication credentials.
- Client
Config - Configuration used to build an
AElfClientorHttpProvider. - Cross
Chain Contract - Typed wrapper for the cross-chain contract.
- Dynamic
Contract - Contract handle backed by a descriptor pool fetched from chain.
- Election
Contract - Typed wrapper for the election contract.
- Http
Provider - Default HTTP transport backed by
reqwest. - KeyPair
Info - Basic key material derived from a wallet.
- Keystore
- Serializable keystore compatible with
aelf-web3.js. - Keystore
Encrypt Options - Options for JS-compatible keystore encryption.
- Retry
Policy - Retry policy for transient HTTP transport failures.
- Token
Contract - Typed wrapper for the token contract.
- Transaction
Builder - Builder for unsigned or signed AElf protobuf transactions.
- Unlocked
Keystore - Decrypted keystore contents.
- Vote
Contract - Typed wrapper for the vote contract.
- Wallet
- Wallet created from a mnemonic or raw private key.
- Zero
Contract - Typed wrapper for the genesis zero contract.
Enums§
- AElf
Error - Contract
Error - Errors returned by typed and dynamic contract operations.
- Crypto
Error - Errors returned by wallet, address and signing helpers.
- Keystore
Error - Errors returned while encoding or decoding AElf keystores.
Constants§
- DEFAULT_
BIP44_ PATH - Default BIP44 derivation path used by the reference AElf SDKs.
Traits§
- Provider
- Abstract transport used by the SDK client.
Functions§
- address_
from_ public_ key - Converts an uncompressed public key to an AElf base58 address.
- address_
to_ pb - Converts a base58 or formatted AElf address into protobuf
Address. - base58_
to_ chain_ id - Converts a base58 chain id string returned by node APIs to its numeric form.
- chain_
id_ to_ base58 - Converts a numeric chain id into the base58 string used by node APIs.
- decode_
address - Decodes a base58 or formatted AElf address into its raw bytes.
- format_
token_ amount - Formats a raw token amount using the token’s decimals.
- hash_
to_ pb - Wraps raw bytes in protobuf
Hash. - parse_
aelf_ address - Extracts the raw base58 address from either a plain address or a formatted
address such as
ELF_<address>_AELF. - pb_
to_ address - Converts protobuf
Addressto an AElf base58 address. - sign_
transaction - Signs a protobuf transaction with an existing wallet.
- sign_
transaction_ with_ private_ key - Signs a protobuf transaction with a raw private key.
- transaction_
hash - Calculates the protobuf transaction hash used by AElf.