Skip to main content
Version: 0.1

Examples in Rust

The examples for are located in the library's repository. To get access to them, clone the repository:

git clone -b production

You can list all available examples by running the following command:

cargo run --example # lists the available examples

To run an example, you can use the following command, replacing transfer with the desired example:

cargo run --example transfer # execute the `transfer` example

You can find all examples in the examples subfolder of the project.

Backup and Restore

  1. Create an account manager and set a password:
let manager = AccountManager::builder().finish().await.unwrap();

manager.store_mnemonic(SignerType::Stronghold, None).await.unwrap();
  1. Create your account:
let client_options = ClientOptionsBuilder::new()
let account_handle = manager
let id =;
  1. You can secure your account in a backup file:
// backup the stored accounts to ./backup/${backup_name}
let backup_path = manager.backup("./backup").await?;

  1. You can import the backup later, or in another application using the following snippet:
manager.import_accounts(backup_path, "password").await?;

let imported_account_handle = manager.get_account(&id).await?;

let account =;
let imported_account =;

That's it! You can now backup and restore your account!

You can see the full code for the example in the repository


You use the following example to generate an account and transfer funds.


Events library is able to listen to several supported event. As soon as the event occurs, a provided callback will be triggered.

You can use the following example to fetch an existing Account and listen to transaction events related to that Account :