Skip to main content

Crate aelf_sdk

Crate aelf_sdk 

Source
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§

dto

Structs§

AElfClient
High-level async client that mirrors the main entry point of the other AElf SDKs.
AedposContract
Typed wrapper for the AEDPoS consensus contract.
BasicAuth
HTTP basic authentication credentials.
ClientConfig
Configuration used to build an AElfClient or HttpProvider.
CrossChainContract
Typed wrapper for the cross-chain contract.
DynamicContract
Contract handle backed by a descriptor pool fetched from chain.
ElectionContract
Typed wrapper for the election contract.
HttpProvider
Default HTTP transport backed by reqwest.
KeyPairInfo
Basic key material derived from a wallet.
Keystore
Serializable keystore compatible with aelf-web3.js.
KeystoreEncryptOptions
Options for JS-compatible keystore encryption.
RetryPolicy
Retry policy for transient HTTP transport failures.
TokenContract
Typed wrapper for the token contract.
TransactionBuilder
Builder for unsigned or signed AElf protobuf transactions.
UnlockedKeystore
Decrypted keystore contents.
VoteContract
Typed wrapper for the vote contract.
Wallet
Wallet created from a mnemonic or raw private key.
ZeroContract
Typed wrapper for the genesis zero contract.

Enums§

AElfError
ContractError
Errors returned by typed and dynamic contract operations.
CryptoError
Errors returned by wallet, address and signing helpers.
KeystoreError
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 Address to 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.