/tidext

A library to submit extrinsics (transactions) to a tidechain node via RPC.

Primary LanguageRustGNU General Public License v3.0GPL-3.0

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::Tifi).await?;

Submitting Extrinsics

Submit an extrinsic, returning success once the transaction is accepted into the pool:

client.swap(
  CurrencyId::Tifi,
  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

License

The entire code within this repository is licensed under the GPLv3.