Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bindings/go/examples/transactions_with_shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func main() {
log.Fatalf("Failed to create object ID: %v", err)
}

transactions, err := client.Transactions(nil, &sdk.TransactionsFilter{InputObject: &sharedObjId})
transactions, err := client.Transactions(&sdk.TransactionsFilter{InputObject: &sharedObjId}, nil)
if !isNilError(err) {
log.Fatalf("Failed to get transactions: %v", err)
}
Expand Down
56 changes: 28 additions & 28 deletions bindings/go/iota_sdk_ffi/iota_sdk_ffi.go

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions bindings/go/iota_sdk_ffi/iota_sdk_ffi.h
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@ uint64_t uniffi_iota_sdk_ffi_fn_method_graphqlclient_epoch_total_transaction_blo
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_GRAPHQLCLIENT_EVENTS
#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_GRAPHQLCLIENT_EVENTS
uint64_t uniffi_iota_sdk_ffi_fn_method_graphqlclient_events(void* ptr, RustBuffer pagination_filter, RustBuffer filter
uint64_t uniffi_iota_sdk_ffi_fn_method_graphqlclient_events(void* ptr, RustBuffer filter, RustBuffer pagination_filter
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_GRAPHQLCLIENT_EXECUTE_TX
Expand Down Expand Up @@ -1738,7 +1738,7 @@ uint64_t uniffi_iota_sdk_ffi_fn_method_graphqlclient_object_bcs(void* ptr, void*
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_GRAPHQLCLIENT_OBJECTS
#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_GRAPHQLCLIENT_OBJECTS
uint64_t uniffi_iota_sdk_ffi_fn_method_graphqlclient_objects(void* ptr, RustBuffer pagination_filter, RustBuffer filter
uint64_t uniffi_iota_sdk_ffi_fn_method_graphqlclient_objects(void* ptr, RustBuffer filter, RustBuffer pagination_filter
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_GRAPHQLCLIENT_PACKAGE
Expand All @@ -1753,12 +1753,12 @@ uint64_t uniffi_iota_sdk_ffi_fn_method_graphqlclient_package_latest(void* ptr, v
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_GRAPHQLCLIENT_PACKAGE_VERSIONS
#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_GRAPHQLCLIENT_PACKAGE_VERSIONS
uint64_t uniffi_iota_sdk_ffi_fn_method_graphqlclient_package_versions(void* ptr, void* address, RustBuffer pagination_filter, RustBuffer after_version, RustBuffer before_version
uint64_t uniffi_iota_sdk_ffi_fn_method_graphqlclient_package_versions(void* ptr, void* address, RustBuffer after_version, RustBuffer before_version, RustBuffer pagination_filter
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_GRAPHQLCLIENT_PACKAGES
#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_GRAPHQLCLIENT_PACKAGES
uint64_t uniffi_iota_sdk_ffi_fn_method_graphqlclient_packages(void* ptr, RustBuffer pagination_filter, RustBuffer after_checkpoint, RustBuffer before_checkpoint
uint64_t uniffi_iota_sdk_ffi_fn_method_graphqlclient_packages(void* ptr, RustBuffer after_checkpoint, RustBuffer before_checkpoint, RustBuffer pagination_filter
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_GRAPHQLCLIENT_PROTOCOL_CONFIG
Expand Down Expand Up @@ -1818,17 +1818,17 @@ uint64_t uniffi_iota_sdk_ffi_fn_method_graphqlclient_transaction_effects(void* p
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_GRAPHQLCLIENT_TRANSACTIONS
#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_GRAPHQLCLIENT_TRANSACTIONS
uint64_t uniffi_iota_sdk_ffi_fn_method_graphqlclient_transactions(void* ptr, RustBuffer pagination_filter, RustBuffer filter
uint64_t uniffi_iota_sdk_ffi_fn_method_graphqlclient_transactions(void* ptr, RustBuffer filter, RustBuffer pagination_filter
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_GRAPHQLCLIENT_TRANSACTIONS_DATA_EFFECTS
#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_GRAPHQLCLIENT_TRANSACTIONS_DATA_EFFECTS
uint64_t uniffi_iota_sdk_ffi_fn_method_graphqlclient_transactions_data_effects(void* ptr, RustBuffer pagination_filter, RustBuffer filter
uint64_t uniffi_iota_sdk_ffi_fn_method_graphqlclient_transactions_data_effects(void* ptr, RustBuffer filter, RustBuffer pagination_filter
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_GRAPHQLCLIENT_TRANSACTIONS_EFFECTS
#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_GRAPHQLCLIENT_TRANSACTIONS_EFFECTS
uint64_t uniffi_iota_sdk_ffi_fn_method_graphqlclient_transactions_effects(void* ptr, RustBuffer pagination_filter, RustBuffer filter
uint64_t uniffi_iota_sdk_ffi_fn_method_graphqlclient_transactions_effects(void* ptr, RustBuffer filter, RustBuffer pagination_filter
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_IDENTIFIER
Expand Down
1 change: 0 additions & 1 deletion bindings/kotlin/examples/ChainId.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ fun main() = runBlocking {
val client = GraphQlClient.newDevnet()
val chainId = client.chainId()
println("Chain ID: $chainId")

} catch (e: Exception) {
e.printStackTrace()
}
Expand Down
2 changes: 0 additions & 2 deletions bindings/kotlin/examples/Example.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
// SPDX-License-Identifier: Apache-2.0

import iota_sdk.Address
import iota_sdk.Direction
import iota_sdk.EventFilter
import iota_sdk.GraphQlClient
import iota_sdk.ObjectId
import iota_sdk.PaginationFilter
import iota_sdk.TransactionsFilter
import kotlinx.coroutines.runBlocking

Expand Down
39 changes: 21 additions & 18 deletions bindings/kotlin/examples/GetObject.kt
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
// Copyright (c) 2025 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

import iota_sdk.Address
import iota_sdk.Direction
import iota_sdk.EventFilter
import iota_sdk.GraphQlClient
import iota_sdk.ObjectId
import iota_sdk.PaginationFilter
import iota_sdk.TransactionsFilter
import kotlinx.coroutines.runBlocking

fun main() = runBlocking {
try {
val client = GraphQlClient.newDevnet()

val objectId = ObjectId.fromHex("0x20c056090c3dd1604fcfd7ea759781de650aa45323738e799365d0c28bebeb1e")
val objectId =
ObjectId.fromHex(
"0x20c056090c3dd1604fcfd7ea759781de650aa45323738e799365d0c28bebeb1e"
)

val obj = client.`object`(objectId)!!

val objType = if (obj.objectType().isPackage()) { "Package"} else { obj.objectType().asStruct().toString() };

val objOwner = if (obj.owner().isAddress()) {
"Address(${obj.owner().asAddress().toHex()})"
} else if (obj.owner().isObject()) {
"Object(${obj.owner().asObject().toHex()})"
} else if (obj.owner().isShared()) {
"Shared(${obj.owner().asShared()})"
} else {
"Immutable"
};
val objType =
if (obj.objectType().isPackage()) {
"Package"
} else {
obj.objectType().asStruct().toString()
}

val objOwner =
if (obj.owner().isAddress()) {
"Address(${obj.owner().asAddress().toHex()})"
} else if (obj.owner().isObject()) {
"Object(${obj.owner().asObject().toHex()})"
} else if (obj.owner().isShared()) {
"Shared(${obj.owner().asShared()})"
} else {
"Immutable"
}

println("Object ID: ${obj.objectId().toHex()}")
println("Version: ${obj.version()}")
Expand All @@ -38,7 +42,6 @@ fun main() = runBlocking {
println("Type: $objType")
@OptIn(kotlin.ExperimentalStdlibApi::class)
println("BCS bytes: ${obj.asStruct().contents.toHexString()}")

} catch (e: Exception) {
e.printStackTrace()
}
Expand Down
15 changes: 9 additions & 6 deletions bindings/kotlin/examples/MoveFunctions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ fun main() = runBlocking {
try {
val client = GraphQlClient.newDevnet()

val packageAddress = Address.fromHex("0x3ec4826f1d6e0d9f00680b2e9a7a41f03788ee610b3d11c24f41ab0ae71da39f")
val packageAddress =
Address.fromHex(
"0x3ec4826f1d6e0d9f00680b2e9a7a41f03788ee610b3d11c24f41ab0ae71da39f"
)

val pkg = client.`package`(packageAddress, null)
if (pkg == null) {
Expand All @@ -18,10 +21,11 @@ fun main() = runBlocking {
}

for ((moduleId, _) in pkg.modules()) {
var module = client.normalizedMoveModule(
packageAddress,
moduleId.asStr(),
)
var module =
client.normalizedMoveModule(
packageAddress,
moduleId.asStr(),
)
if (module == null) {
println("module `${moduleId.asStr()}` not found")
return@runBlocking
Expand All @@ -35,7 +39,6 @@ fun main() = runBlocking {
println()
}
}

} catch (e: Exception) {
e.printStackTrace()
}
Expand Down
12 changes: 6 additions & 6 deletions bindings/kotlin/examples/TransactionsWithShared.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@

import iota_sdk.GraphQlClient
import iota_sdk.ObjectId
import iota_sdk.PaginationFilter
import iota_sdk.Direction
import iota_sdk.TransactionsFilter
import kotlinx.coroutines.runBlocking

fun main() = runBlocking {
try {
val client = GraphQlClient.newDevnet()

val sharedObjId = ObjectId.fromHex("0x07c59b37bd7d036bf78fa30561a2ab9f7a970837487656ec29466e817f879342")
val transactions = client.transactions(PaginationFilter(Direction.FORWARD), TransactionsFilter(inputObject = sharedObjId))

val sharedObjId =
ObjectId.fromHex(
"0x07c59b37bd7d036bf78fa30561a2ab9f7a970837487656ec29466e817f879342"
)
val transactions = client.transactions(TransactionsFilter(inputObject = sharedObjId))

for (transaction in transactions.data) {
println("Digest: ${transaction.transaction.digest().toBase58()}")
}

} catch (e: Exception) {
e.printStackTrace()
}
Expand Down
Loading