Skip to content

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

License

Notifications You must be signed in to change notification settings

tidelabs/tidext

Folders and files

NameName
Last commit message
Last commit date

Latest commit

28ca470 · Aug 17, 2023
Apr 8, 2022
Aug 17, 2023
Apr 13, 2023
Mar 6, 2023
Mar 6, 2023
Mar 3, 2023
Apr 17, 2023
Mar 6, 2023
Mar 3, 2023
Mar 30, 2022
Jun 24, 2022
Mar 3, 2023
Mar 24, 2022
May 2, 2022
Apr 8, 2022
Mar 3, 2023

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

License

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