Skip to main content

tronz_primitives/
lib.rs

1#![doc = include_str!("../README.md")]
2#![forbid(unsafe_code)]
3#![warn(missing_docs)]
4#![cfg_attr(not(test), warn(unused_crate_dependencies))]
5#![cfg_attr(docsrs, feature(doc_cfg))]
6
7mod address;
8mod amount;
9mod error;
10mod log;
11mod message;
12mod resource;
13mod signature;
14
15pub use address::{ADDRESS_LEN, ADDRESS_PREFIX, Address, EVM_ADDRESS_LEN};
16/// Types re-used directly from `alloy-primitives`.
17pub use alloy_primitives::{B256, Bytes, U256, keccak256};
18pub use amount::{SUN_PER_TRX, Trx, format_trx, parse_trx};
19pub use error::{AddressError, AmountError, SignatureError, UnknownResourceCode};
20pub use log::Log;
21pub use message::{TRON_MESSAGE_PREFIX, hash_message, recover_message_address, verify_message};
22pub use resource::ResourceCode;
23pub use signature::{RecoverableSignature, SIGNATURE_LEN};
24
25/// A transaction id: `sha256` of the protobuf-encoded raw transaction.
26///
27/// Defined here so it can appear in both signer and provider signatures
28/// without a dependency cycle.
29pub type TxId = B256;