Query Transactions by Function
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 query transactions filtered by a specific Move function call using the IOTA SDK's GraphQL client.
Prerequisites
- The IOTA SDK installed for your target language
Steps
1. Initialize the GraphQL Client
- Rust
- Go
- Python
- Kotlin
- Swift
crates/iota-sdk/examples/transactions_with_function.rs
loading...
bindings/go/examples/transactions_with_function/main.go
loading...
bindings/python/examples/transactions_with_function.py
loading...
bindings/kotlin/examples/TransactionsWithFunction.kt
loading...
bindings/swift/examples/TransactionsWithFunction.swift
loading...
2. Query Transactions Filtered by Function
Pass a TransactionsFilter with the fully-qualified Move function identifier to fetch matching transactions.
- Rust
- Go
- Python
- Kotlin
- Swift
crates/iota-sdk/examples/transactions_with_function.rs
loading...
bindings/go/examples/transactions_with_function/main.go
loading...
bindings/python/examples/transactions_with_function.py
loading...
bindings/kotlin/examples/TransactionsWithFunction.kt
loading...
bindings/swift/examples/TransactionsWithFunction.swift
loading...
3. Print the Transaction Digests
Iterate over the results and print each transaction digest.
- Rust
- Go
- Python
- Kotlin
- Swift
crates/iota-sdk/examples/transactions_with_function.rs
loading...
bindings/go/examples/transactions_with_function/main.go
loading...
bindings/python/examples/transactions_with_function.py
loading...
bindings/kotlin/examples/TransactionsWithFunction.kt
loading...
bindings/swift/examples/TransactionsWithFunction.swift
loading...
Expected Output
Digest: <base58-transaction-digest>
Digest: <base58-transaction-digest>
...
note
The function identifier format is <package>::<module>::<function>.
Full Example
- Rust
- Go
- Python
- Kotlin
- Swift
crates/iota-sdk/examples/transactions_with_function.rs
loading...
bindings/go/examples/transactions_with_function/main.go
loading...
bindings/python/examples/transactions_with_function.py
loading...
bindings/kotlin/examples/TransactionsWithFunction.kt
loading...
bindings/swift/examples/TransactionsWithFunction.swift
loading...