Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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 .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: doctests
run: |
cargo test --doc
make test-docs
- name: rustdoc
run: |
cargo doc --all-features --workspace --no-deps
6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ serde_json = "1.0.128"
test-strategy = "0.4.0"
thiserror = "2.0"
tokio = "1.40.0"

iota-crypto = { version = "0.0.1", package = "iota-sdk-crypto", path = "crates/iota-sdk-crypto", default-features = false }
iota-graphql-client = { version = "0.0.1", package = "iota-sdk-graphql-client", path = "crates/iota-sdk-graphql-client", default-features = false }
iota-graphql-client-build = { version = "0.0.1", package = "iota-sdk-graphql-client-build", path = "crates/iota-sdk-graphql-client-build", default-features = false }
iota-transaction-builder = { version = "0.0.1", package = "iota-sdk-transaction-builder", path = "crates/iota-sdk-transaction-builder", default-features = false }
iota-types = { version = "0.0.1", package = "iota-sdk-types", path = "crates/iota-sdk-types", default-features = false }
23 changes: 15 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ all:: ci ## Default target, runs the CI process
.PHONY: check-features
check-features: ## Check feature flags for crates
$(MAKE) -C crates/iota-sdk-types check-features
$(MAKE) -C crates/iota-crypto check-features
$(MAKE) -C crates/iota-sdk-crypto check-features

.PHONY: check-fmt
check-fmt: ## Check code formatting
Expand All @@ -21,22 +21,29 @@ clippy: ## Run Clippy linter

.PHONY: test
test: ## Run unit tests
cargo nextest run --all-features -p iota-sdk-types -p iota-crypto
cargo nextest run --all-features -p iota-sdk-types -p iota-sdk-crypto

.PHONY: test-docs
test-docs: ## Run doc tests
cargo test --all-features --doc

package_%.json: crates/iota-transaction-builder/tests/%/Move.toml crates/iota-transaction-builder/tests/%/sources/*.move ## Generate JSON files for tests
cd crates/iota-transaction-builder/tests/$(*F) && iota move build --ignore-chain --dump-bytecode-as-base64 > ../../$@
.PHONY: build-docs
build-docs: ## Build docs
cargo doc --all-features --workspace --no-deps

package_%.json: crates/iota-sdk-transaction-builder/tests/%/Move.toml crates/iota-sdk-transaction-builder/tests/%/sources/*.move ## Generate JSON files for tests
cd crates/iota-sdk-transaction-builder/tests/$(*F) && iota move build --ignore-chain --dump-bytecode-as-base64 > ../../$@

.PHONY: test-with-localnet
test-with-localnet: package_test_example_v1.json package_test_example_v2.json ## Run tests with localnet
cargo nextest run -p iota-graphql-client -p iota-transaction-builder
cargo nextest run -p iota-sdk-graphql-client -p iota-sdk-transaction-builder

.PHONY: wasm
wasm: ## Build WASM modules
$(MAKE) -C crates/iota-crypto wasm
$(MAKE) -C crates/iota-graphql-client wasm
$(MAKE) -C crates/iota-sdk-crypto wasm
$(MAKE) -C crates/iota-sdk-graphql-client wasm
$(MAKE) -C crates/iota-sdk-types wasm
$(MAKE) -C crates/iota-transaction-builder wasm
$(MAKE) -C crates/iota-sdk-transaction-builder wasm

.PHONY: doc
doc: ## Generate documentation
Expand Down
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,24 @@ A few of the project's high-level goals are as follows:

## Crates

In an effort to be modular, functionality is split between a number of crates.
In an effort to be modular, functionality is split between a number of crates. The main crate, `iota-sdk`, contains the others.

- [`iota-sdk`](crates/iota-sdk)
[![iota-sdk on crates.io](https://img.shields.io/crates/v/iota-sdk)](https://crates.io/crates/iota-sdk)
[![Documentation (latest release)](https://img.shields.io/badge/docs-latest-brightgreen)](https://docs.rs/iota-sdk)
[![Documentation (develop)](https://img.shields.io/badge/docs-develop-59f)](https://github.com/iotaledger/iota-rust-sdk/iota_sdk_types/)
- [`iota-sdk-types`](crates/iota-sdk-types)
[![iota-sdk-types on crates.io](https://img.shields.io/crates/v/iota-sdk-types)](https://crates.io/crates/iota-sdk-types)
[![Documentation (latest release)](https://img.shields.io/badge/docs-latest-brightgreen)](https://docs.rs/iota-sdk-types)
[![Documentation (develop)](https://img.shields.io/badge/docs-develop-59f)](https://github.com/iotaledger/iota-rust-sdk/iota_sdk_types/)
- [`iota-crypto`](crates/iota-crypto)
[![iota-crypto on crates.io](https://img.shields.io/crates/v/iota-crypto)](https://crates.io/crates/iota-crypto)
[![Documentation (latest release)](https://img.shields.io/badge/docs-latest-brightgreen)](https://docs.rs/iota-crypto)
[![Documentation (develop)](https://img.shields.io/badge/docs-develop-59f)](https://github.com/iotaledger/iota-rust-sdk/iota_crypto/)
- [`iota-graphql-client`](crates/iota-crypto)
[![iota-graphql-client on crates.io](https://img.shields.io/crates/v/iota-graphql-client)](https://crates.io/crates/iota-graphql-client)
[![Documentation (latest release)](https://img.shields.io/badge/docs-latest-brightgreen)](https://docs.rs/iota-graphql-client)
[![Documentation (develop)](https://img.shields.io/badge/docs-develop-59f)](https://github.com/iotaledger/iota-rust-sdk/iota-graphql-client/)
- [`iota-sdk-crypto`](crates/iota-sdk-crypto)
[![iota-sdk-crypto on crates.io](https://img.shields.io/crates/v/iota-sdk-crypto)](https://crates.io/crates/iota-sdk-crypto)
[![Documentation (latest release)](https://img.shields.io/badge/docs-latest-brightgreen)](https://docs.rs/iota-sdk-crypto)
- [`iota-sdk-graphql-client`](crates/iota-sdk-graphql-client)
[![iota-sdk-graphql-client on crates.io](https://img.shields.io/crates/v/iota-sdk-graphql-client)](https://crates.io/crates/iota-sdk-graphql-client)
[![Documentation (latest release)](https://img.shields.io/badge/docs-latest-brightgreen)](https://docs.rs/iota-sdk-graphql-client)
- [`iota-sdk-transaction-builder`](crates/iota-sdk-transaction-builder)
[![iota-sdk-transaction-builder on crates.io](https://img.shields.io/crates/v/iota-sdk-transaction-builder)](https://crates.io/crates/iota-sdk-transaction-builder)
[![Documentation (latest release)](https://img.shields.io/badge/docs-latest-brightgreen)](https://docs.rs/iota-sdk-transaction-builder)

## License

Expand Down
6 changes: 3 additions & 3 deletions bindings/go/iota_sdk_ffi/iota_sdk_ffi.go
Original file line number Diff line number Diff line change
Expand Up @@ -3332,7 +3332,7 @@ func uniffiCheckChecksums() {
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
return C.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_field()
})
if checksum != 28380 {
if checksum != 43486 {
// If this happens try cleaning and rebuilding your project
panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_field: UniFFI API checksum mismatch")
}
Expand Down Expand Up @@ -14353,7 +14353,7 @@ type GraphQlClientInterface interface {
// # Example
// ```rust,ignore
//
// let client = iota_graphql_client::Client::new_devnet();
// let client = iota_sdk::graphql_client::Client::new_devnet();
// let address = ObjectId::SYSTEM.into();
// let df = client.dynamic_field_with_name(address, "u64", 2u64).await.unwrap();
//
Expand Down Expand Up @@ -14892,7 +14892,7 @@ func (_self *GraphQlClient) DryRunTxKind(txKind *TransactionKind, txMeta Transac
// # Example
// ```rust,ignore
//
// let client = iota_graphql_client::Client::new_devnet();
// let client = iota_sdk::graphql_client::Client::new_devnet();
// let address = ObjectId::SYSTEM.into();
// let df = client.dynamic_field_with_name(address, "u64", 2u64).await.unwrap();
//
Expand Down
6 changes: 3 additions & 3 deletions bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8412,7 +8412,7 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) {
if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx_kind() != 37663.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_field() != 28380.toShort()) {
if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_field() != 43486.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_fields() != 14745.toShort()) {
Expand Down Expand Up @@ -21821,7 +21821,7 @@ public interface GraphQlClientInterface {
* # Example
* ```rust,ignore
*
* let client = iota_graphql_client::Client::new_devnet();
* let client = iota_sdk::graphql_client::Client::new_devnet();
* let address = ObjectId::SYSTEM.into();
* let df = client.dynamic_field_with_name(address, "u64", 2u64).await.unwrap();
*
Expand Down Expand Up @@ -22454,7 +22454,7 @@ open class GraphQlClient: Disposable, AutoCloseable, GraphQlClientInterface
* # Example
* ```rust,ignore
*
* let client = iota_graphql_client::Client::new_devnet();
* let client = iota_sdk::graphql_client::Client::new_devnet();
* let address = ObjectId::SYSTEM.into();
* let df = client.dynamic_field_with_name(address, "u64", 2u64).await.unwrap();
*
Expand Down
6 changes: 3 additions & 3 deletions bindings/python/lib/iota_sdk_ffi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ def _uniffi_check_api_checksums(lib):
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx_kind() != 37663:
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_field() != 28380:
if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_field() != 43486:
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_fields() != 14745:
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
Expand Down Expand Up @@ -30276,7 +30276,7 @@ def dynamic_field(self, address: "Address",type_tag: "TypeTag",name: "Value"):
# Example
```rust,ignore

let client = iota_graphql_client::Client::new_devnet();
let client = iota_sdk::graphql_client::Client::new_devnet();
let address = ObjectId::SYSTEM.into();
let df = client.dynamic_field_with_name(address, "u64", 2u64).await.unwrap();

Expand Down Expand Up @@ -30979,7 +30979,7 @@ async def dynamic_field(self, address: "Address",type_tag: "TypeTag",name: "Valu
# Example
```rust,ignore

let client = iota_graphql_client::Client::new_devnet();
let client = iota_sdk::graphql_client::Client::new_devnet();
let address = ObjectId::SYSTEM.into();
let df = client.dynamic_field_with_name(address, "u64", 2u64).await.unwrap();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "iota-crypto"
name = "iota-sdk-crypto"
version = "0.0.1"
authors = ["IOTA Foundation <[email protected]>"]
edition = "2021"
Expand Down Expand Up @@ -56,7 +56,7 @@ pem = [
bls12381 = ["dep:blst", "dep:rand_core", "dep:roaring", "signature/std"]

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

Expand Down Expand Up @@ -106,8 +106,8 @@ rand.workspace = true
serde_json.workspace = true

# proptest support in tests
iota-sdk-types = { path = "../iota-sdk-types", default-features = false, features = ["proptest"] }
proptest = { workspace = true, default-features = false, features = ["std"] }
iota-types = { workspace = true, features = ["proptest"] }
proptest = { workspace = true, features = ["std"] }
test-strategy.workspace = true

[target.wasm32-unknown-unknown.dev-dependencies]
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// SPDX-License-Identifier: Apache-2.0

use blst::min_sig::{PublicKey, SecretKey, Signature};
use iota_sdk_types::{
use iota_types::{
Bls12381PublicKey, Bls12381Signature, CheckpointSummary, SignatureScheme, ValidatorSignature,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Modifications Copyright (c) 2025 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use iota_sdk_types::{
use iota_types::{
Ed25519PublicKey, Ed25519Signature, SignatureScheme, SimpleSignature, UserSignature,
};

Expand Down Expand Up @@ -290,7 +290,7 @@ impl Verifier<UserSignature> for Ed25519Verifier {

#[cfg(test)]
mod tests {
use iota_sdk_types::{PersonalMessage, Transaction};
use iota_types::{PersonalMessage, Transaction};
use test_strategy::proptest;

use super::*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#![cfg_attr(doc_cfg, feature(doc_cfg))]

use iota_sdk_types::{PersonalMessage, Transaction, UserSignature};
use iota_types::{PersonalMessage, Transaction, UserSignature};
pub use signature::{Error as SignatureError, Signer, Verifier};

/// Error type for private key encoding/decoding operations
Expand Down Expand Up @@ -185,10 +185,10 @@ pub const IOTA_PRIV_KEY_PREFIX: &str = "iotaprivkey";
/// Extension trait for private key types
pub trait PrivateKeyExt {
/// The signature scheme for this key type
const SCHEME: iota_sdk_types::SignatureScheme;
const SCHEME: iota_types::SignatureScheme;

/// Returns the signature scheme for this private key
fn scheme(&self) -> iota_sdk_types::SignatureScheme {
fn scheme(&self) -> iota_types::SignatureScheme {
Self::SCHEME
}

Expand Down Expand Up @@ -218,7 +218,7 @@ pub trait PrivateKeyExt {
return Err(PrivateKeyError::EmptyData("flagged bytes".to_string()));
}

let flag = iota_sdk_types::SignatureScheme::from_byte(bytes[0])
let flag = iota_types::SignatureScheme::from_byte(bytes[0])
.map_err(|e| PrivateKeyError::InvalidScheme(format!("{e:?}")))?;

if flag != Self::SCHEME {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Modifications Copyright (c) 2025 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use iota_sdk_types::{
use iota_types::{
MultisigAggregatedSignature, MultisigCommittee, MultisigMemberPublicKey,
MultisigMemberSignature, UserSignature,
};
Expand Down Expand Up @@ -263,7 +263,7 @@ pub struct MultisigAggregator {
impl MultisigAggregator {
pub fn new_with_transaction(
committee: MultisigCommittee,
transaction: &iota_sdk_types::Transaction,
transaction: &iota_types::Transaction,
) -> Self {
Self {
committee,
Expand All @@ -276,7 +276,7 @@ impl MultisigAggregator {

pub fn new_with_message(
committee: MultisigCommittee,
message: &iota_sdk_types::PersonalMessage<'_>,
message: &iota_types::PersonalMessage<'_>,
) -> Self {
Self {
committee,
Expand Down Expand Up @@ -356,7 +356,7 @@ impl MultisigAggregator {
fn multisig_pubkey_and_signature_from_user_signature(
signature: UserSignature,
) -> Result<(MultisigMemberPublicKey, MultisigMemberSignature), SignatureError> {
use iota_sdk_types::SimpleSignature;
use iota_types::SimpleSignature;
match signature {
UserSignature::Simple(SimpleSignature::Ed25519 {
signature,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Modifications Copyright (c) 2025 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use iota_sdk_types::{PasskeyAuthenticator, SimpleSignature, UserSignature};
use iota_types::{PasskeyAuthenticator, SimpleSignature, UserSignature};
use signature::Verifier;

use crate::{SignatureError, secp256r1::Secp256r1VerifyingKey};
Expand Down Expand Up @@ -66,7 +66,7 @@ impl Verifier<UserSignature> for PasskeyVerifier {

#[cfg(test)]
mod tests {
use iota_sdk_types::Transaction;
use iota_types::Transaction;
#[cfg(target_arch = "wasm32")]
use wasm_bindgen_test::wasm_bindgen_test as test;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Modifications Copyright (c) 2025 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use iota_sdk_types::{
use iota_types::{
Secp256k1PublicKey, Secp256k1Signature, SignatureScheme, SimpleSignature, UserSignature,
};
use k256::{
Expand Down Expand Up @@ -293,7 +293,7 @@ impl Verifier<UserSignature> for Secp256k1Verifier {

#[cfg(test)]
mod tests {
use iota_sdk_types::PersonalMessage;
use iota_types::PersonalMessage;
use test_strategy::proptest;
#[cfg(target_arch = "wasm32")]
use wasm_bindgen_test::wasm_bindgen_test as test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Modifications Copyright (c) 2025 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use iota_sdk_types::{
use iota_types::{
Secp256r1PublicKey, Secp256r1Signature, SignatureScheme, SimpleSignature, UserSignature,
};
use p256::{
Expand Down Expand Up @@ -293,7 +293,7 @@ impl Verifier<UserSignature> for Secp256r1Verifier {

#[cfg(test)]
mod tests {
use iota_sdk_types::PersonalMessage;
use iota_types::PersonalMessage;
use test_strategy::proptest;
#[cfg(target_arch = "wasm32")]
use wasm_bindgen_test::wasm_bindgen_test as test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Modifications Copyright (c) 2025 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use iota_sdk_types::{SimpleSignature, UserSignature};
use iota_types::{SimpleSignature, UserSignature};
use signature::Verifier;

use crate::SignatureError;
Expand Down Expand Up @@ -77,7 +77,7 @@ pub use keypair::{SimpleKeypair, SimpleVerifyingKey};
doc(cfg(any(feature = "ed25519", feature = "secp256r1", feature = "secp256k1",)))
)]
mod keypair {
use iota_sdk_types::{
use iota_types::{
MultisigMemberPublicKey, PublicKeyExt, SignatureScheme, SimpleSignature, UserSignature,
};
use signature::{Signer, Verifier};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use std::collections::HashMap;

use blst::min_sig::{AggregatePublicKey, AggregateSignature, Signature};
use iota_sdk_types::{
use iota_types::{
Bls12381PublicKey, Bls12381Signature, CheckpointSummary, ValidatorAggregatedSignature,
ValidatorCommittee, ValidatorSignature,
};
Expand Down Expand Up @@ -320,7 +320,7 @@ impl ValidatorCommitteeSignatureAggregator {

#[cfg(test)]
mod tests {
use iota_sdk_types::ValidatorCommitteeMember;
use iota_types::ValidatorCommitteeMember;
use test_strategy::proptest;

use super::*;
Expand Down
Loading