xdc3_rust-0.1.0 is not a library.
Visit the last successful build:
xdc3_rust-0.1.4
xdc3_rust
xdc3_rust API with support for smart contracts and XRC20.
Usage
First, add this to your Cargo.toml
:
[]
= "0.1.0"
before Running The File enable cargo Extension in your file. EX: run Command -----(cargo init) in Command Line Terminal after That Copy The Path And Goto The File.
Available Operations in XRC20:- 1.getName 2.getSymbol 3.getDecimal 4.getTotalSupply 5.getBalanceOf 6.getAllowance 7.getApprove 8.increaseAllowance 9.decreaseAllowance 10.transferfrom 11.transferToken 12.transferXdc
Example
use std::io::stdin;
mod xrc20;
use xrc20::name::token_name; fn main() { let mut token_address = String::new(); println!("enter token address: "); stdin().read_line(&mut token_address);
let name = token_name(token_address).unwrap();
println!("token name: {}", name);
}
Transports
- HTTP transport
- IPC transport
- WebSockets transport
Types
- Types for
U256,H256,Address(H160)
- Index type (numeric, encoded to hex)
- Transaction type (
Transaction
from Parity)
Cargo Features
The library supports following features:
http
- Enables HTTP transport (requirestokio
runtime, because ofhyper
).http-tls
- Enables TLS support viareqwest/default-tls
for HTTP transport (implieshttp
; default).http-native-tls
- Enables TLS support viareqwest/native-tls
for HTTP transport (implieshttp
).http-rustls-tls
- Enables TLS support viareqwest/rustls-tls
for HTTP transport (implieshttp
).ws-tokio
- Enables WS transport usingtokio
runtime.ws-tls-tokio
- Enables TLS support for WS transport (impliesws-tokio
; default).ws-async-std
- Enables WS transport usingasync-std
runtime.ws-tls-async-std
- Enables TLS support for WS transport (impliesws-async-std
).ipc-tokio
- Enables IPC transport usingtokio
runtime (default).signing
- Enable account namespace and local-signing support (default).eip-1193
- Enable EIP-1193 support.arbitrary_precision
- Enablearbitrary_precision
inserde_json
.