Awesome
tidext
A library to submit tifi extrinsics to a tidechain node via RPC.
This project is currently under active development.
Usage
Take a look in the examples folder for various tidext
usage examples.
cargo run --example local
Initializing the API client
let client = ClientBuilder::new()
.set_signer(signer)
.build()
.await?;
client.total_supply_for(CurrencyId::Tdfy).await?;
Submitting Extrinsics
Submit an extrinsic, returning success once the transaction is accepted into the pool:
client.swap(
CurrencyId::Tdfy,
1_000_000_000_000,
CurrencyId::Wrapped(4),
1_000_000,
SwapType::Limit,
None,
).await?;
Documentation
The package is not published to crates.io yet, but you can find the documentation here.
Generate node metadata
cargo install --git https://github.com/tidelabs/subxt --branch=tidechain --force
subxt metadata > tidext/res/tidechain_metadata.scale --format bytes
Integration Testing
Most tests require a running tidechain node to communicate with. This is done by spawning an instance of the substrate node per test.
TIDECHAIN_NODE_PATH=~/.bin/tidechain cargo test