2 个不稳定版本
| 0.2.0 | 2024年1月1日 | 
|---|---|
| 0.1.0 | 2024年1月1日 | 
#7 在 #u256
917 每月下载量
用于 cargo-stylus-check
6KB
79 行
用于以太坊和合金类型之间安全类型转换的包
目前支持以下类型转换:
- ethers::types::H160到- alloy_primitives::Address
- alloy_primitives::Address到- ethers::types::H160
- ethers::types::U256到- alloy_primitives::U256
- alloy_primitives::U256到- ethers::types::U256
- ethers::types::Bytes到- alloy_primitives::Bytes
- alloy_primitives::Bytes到- ethers::types::Bytes
示例
let ethers_address: ethers::types::H160 = ethers::types::H160::random();
let alloy_address: alloy_primitives::Address = ethers_address_to_alloy(ethers_address);
let ethers_u256: ethers::types::U256 = ethers::types::U256::from_dec_str("126731272983");
let alloy_u256: alloy_primitives::U256 = ethers_u256_to_alloy(ethers_u256);
依赖项
~27–43MB
~810K SLoC