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
- Rust
- Go
- Python
- Kotlin
- Swift
crates/iota-sdk/examples/prepare_send_iota.rs
loading...
bindings/go/examples/prepare_send_iota/main.go
loading...
bindings/python/examples/prepare_send_iota.py
loading...
bindings/kotlin/examples/PrepareSendIota.kt
loading...
bindings/swift/examples/PrepareSendIota.swift
loading...
2. Define the Sender and Recipient Addresses
- Rust
- Go
- Python
- Kotlin
- Swift
crates/iota-sdk/examples/prepare_send_iota.rs
loading...
bindings/go/examples/prepare_send_iota/main.go
loading...
bindings/python/examples/prepare_send_iota.py
loading...
bindings/kotlin/examples/PrepareSendIota.kt
loading...
bindings/swift/examples/PrepareSendIota.swift
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.
- Rust
- Go
- Python
- Kotlin
- Swift
crates/iota-sdk/examples/prepare_send_iota.rs
loading...
bindings/go/examples/prepare_send_iota/main.go
loading...
bindings/python/examples/prepare_send_iota.py
loading...
bindings/kotlin/examples/PrepareSendIota.kt
loading...
bindings/swift/examples/PrepareSendIota.swift
loading...
4. Inspect the Transaction
Print the signing digest and Base64-encoded transaction bytes for inspection before signing.
- Rust
- Go
- Python
- Kotlin
- Swift
crates/iota-sdk/examples/prepare_send_iota.rs
loading...
bindings/go/examples/prepare_send_iota/main.go
loading...
bindings/python/examples/prepare_send_iota.py
loading...
bindings/kotlin/examples/PrepareSendIota.kt
loading...
bindings/swift/examples/PrepareSendIota.swift
loading...
5. Dry-Run the Transaction
Dry-run the transaction to verify it will execute correctly without submitting it to the network.
- Rust
- Go
- Python
- Kotlin
- Swift
crates/iota-sdk/examples/prepare_send_iota.rs
loading...
bindings/go/examples/prepare_send_iota/main.go
loading...
bindings/python/examples/prepare_send_iota.py
loading...
bindings/kotlin/examples/PrepareSendIota.kt
loading...
bindings/swift/examples/PrepareSendIota.swift
loading...
Expected Output
Signing Digest: <hex-digest>
Txn Bytes: <base64-encoded-transaction>
Send IOTA dry run was successful!
Full Example
- Rust
- Go
- Python
- Kotlin
- Swift
crates/iota-sdk/examples/prepare_send_iota.rs
loading...
bindings/go/examples/prepare_send_iota/main.go
loading...
bindings/python/examples/prepare_send_iota.py
loading...
bindings/kotlin/examples/PrepareSendIota.kt
loading...
bindings/swift/examples/PrepareSendIota.swift
loading...