Skip to main content

Prepare and Send IOTA

Alpha Software

The IOTA SDK is currently in alpha. APIs, interfaces, and behavior may change without notice between releases. It is not yet recommended for production use.

This how-to demonstrates how to build, inspect, and dry-run an IOTA transfer transaction before submission.

Prerequisites

  • The IOTA SDK installed for your target language
  • A valid sender address with sufficient balance on the testnet
  • A valid recipient address

Steps

1. Initialize the GraphQL Client

crates/iota-sdk/examples/prepare_send_iota.rs
loading...

2. Define the Sender and Recipient Addresses

crates/iota-sdk/examples/prepare_send_iota.rs
loading...

3. Build the Transaction

Set the transfer amount in nanos (1 IOTA = 1,000,000,000 nanos) and build the transaction with the sender, recipient, and amount.

crates/iota-sdk/examples/prepare_send_iota.rs
loading...

4. Inspect the Transaction

Print the signing digest and Base64-encoded transaction bytes for inspection before signing.

crates/iota-sdk/examples/prepare_send_iota.rs
loading...

5. Dry-Run the Transaction

Dry-run the transaction to verify it will execute correctly without submitting it to the network.

crates/iota-sdk/examples/prepare_send_iota.rs
loading...

Expected Output

Signing Digest: <hex-digest>
Txn Bytes: <base64-encoded-transaction>
Send IOTA dry run was successful!

Full Example

crates/iota-sdk/examples/prepare_send_iota.rs
loading...