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
1,173 changes: 1,147 additions & 26 deletions bindings/go/iota_sdk_ffi/iota_sdk_ffi.go

Large diffs are not rendered by default.

395 changes: 395 additions & 0 deletions bindings/go/iota_sdk_ffi/iota_sdk_ffi.h

Large diffs are not rendered by default.

2,446 changes: 2,070 additions & 376 deletions bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt

Large diffs are not rendered by default.

1,512 changes: 1,512 additions & 0 deletions bindings/python/lib/iota_sdk_ffi.py

Large diffs are not rendered by default.

40 changes: 39 additions & 1 deletion bindings/python/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async def main():
PaginationFilter(direction=Direction.FORWARD, cursor=None, limit=None),
)
for coin in coins.data:
print(f"ID = 0x{coin.id().to_hex()} Balance = {coin.balance()}")
print(f"ID = {coin.id().to_hex()} Balance = {coin.balance()}")

balance = await client.balance(my_address)

Expand Down Expand Up @@ -90,6 +90,44 @@ async def main():
linkage_table={id: upgrade_info},
)

builder = TransactionBuilder()
framework_addr = Address.from_hex(
"0x0000000000000000000000000000000000000000000000000000000000000002"
)
builder.move_call(
Function(
package=framework_addr,
module=Identifier("coin"),
function=Identifier("value"),
type_args=[
TypeTag.new_struct(
StructTag(
framework_addr, Identifier("iota"), Identifier("IOTA"), []
)
)
],
),
[Argument.new_input(0)],
)
builder.set_sender(my_address)
builder.set_gas_budget(50000000)
builder.set_gas_price(await client.reference_gas_price() or 100)
coin_0 = await client.object(coins.data[0].id())
if coin_0 is None:
raise InternalError
coin_1 = await client.object(coins.data[1].id())
if coin_1 is None:
raise InternalError
builder.input(UnresolvedInput.from_object(coin_0).with_owned_kind())
builder.add_gas_objects([UnresolvedInput.from_object(coin_1).with_owned_kind()])
txn = builder.finish()

res = await client.dry_run_tx(txn)
if res.error is not None:
print(res.error)
elif res.effects is not None:
print(res.effects.as_v1())


if __name__ == "__main__":
asyncio.run(main())
2 changes: 1 addition & 1 deletion crates/iota-crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pem = [
]

[dependencies]
iota-sdk-types = { version = "0.0.1", path = "../iota-sdk-types", default-features = false, features = ["hash", "serde"] }
iota-sdk-types = { path = "../iota-sdk-types", default-features = false, features = ["hash", "serde"] }
signature = "2.2"

# RNG support
Expand Down
6 changes: 3 additions & 3 deletions crates/iota-graphql-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ chrono = "0.4.26"
cynic = "3.7.3"
derive_more = { version = "2.0", features = ["from"] }
futures = "0.3.29"
iota-types = { package = "iota-sdk-types", version = "0.0.1", path = "../iota-sdk-types", features = ["serde"] }
iota-types = { package = "iota-sdk-types", path = "../iota-sdk-types", features = ["serde"] }
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls", "json"] }
serde = { version = "1.0.144" }
serde_json = { version = "1.0.95" }
Expand All @@ -27,9 +27,9 @@ tracing = "0.1.37"
url = "2.5.3"

[dev-dependencies]
iota-types = { package = "iota-sdk-types", version = "0.0.1", path = "../iota-sdk-types", features = ["serde", "rand", "hash"] }
iota-types = { package = "iota-sdk-types", path = "../iota-sdk-types", features = ["serde", "rand", "hash"] }
rand = "0.8.5"
tokio = { version = "1.40.0", features = ["full"] }

[build-dependencies]
iota-graphql-client-build = { version = "0.0.1", path = "../iota-graphql-client-build" }
iota-graphql-client-build = { path = "../iota-graphql-client-build" }
7 changes: 4 additions & 3 deletions crates/iota-sdk-ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ serde_json = "1.0.95"
tokio = { version = "1.36.0", features = ["time"] }
uniffi = { version = "0.29", features = ["cli", "tokio"] }

iota-crypto = { version = "0.0.1", path = "../iota-crypto", features = ["ed25519", "secp256r1", "passkey", "secp256k1", "zklogin", "pem"] }
iota-graphql-client = { version = "0.0.1", path = "../iota-graphql-client" }
iota-types = { package = "iota-sdk-types", version = "0.0.1", path = "../iota-sdk-types", features = ["hash", "rand"] }
iota-crypto = { path = "../iota-crypto", features = ["ed25519", "secp256r1", "passkey", "secp256k1", "zklogin", "pem"] }
iota-graphql-client = { path = "../iota-graphql-client" }
iota-transaction-builder = { path = "../iota-transaction-builder" }
iota-types = { package = "iota-sdk-types", path = "../iota-sdk-types", features = ["hash", "rand"] }
1 change: 1 addition & 0 deletions crates/iota-sdk-ffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ mod crypto;
mod error;
mod faucet;
mod graphql;
mod transaction_builder;
mod types;
mod uniffi_helpers;

Expand Down
Loading