Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use std::collections::HashMap;

use iota_sdk_types::{Jwk, JwkId, UserSignature, ZkLoginAuthenticator};
use iota_types::{Jwk, JwkId, UserSignature, ZkLoginAuthenticator};
use poseidon::POSEIDON;
use signature::Verifier;

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::{PersonalMessage, ZkLoginInputs};
use iota_types::{PersonalMessage, ZkLoginInputs};
use signature::Signer;

use super::*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::str::FromStr;
use ark_bn254::{Fq, Fq2, Fr, G1Affine, G1Projective, G2Affine, G2Projective};
use ark_ff::PrimeField;
use ark_groth16::{PreparedVerifyingKey, Proof};
use iota_sdk_types::{
use iota_types::{
Bn254FieldElement, CircomG1, CircomG2, Ed25519PublicKey, Jwk, Secp256k1PublicKey,
Secp256r1PublicKey, SimpleSignature, ZkLoginInputs, ZkLoginProof,
};
Expand Down Expand Up @@ -511,7 +511,7 @@ pub(crate) fn gen_address_seed_with_salt_hash(

#[cfg(test)]
mod tests {
use iota_sdk_types::Ed25519Signature;
use iota_types::Ed25519Signature;
#[cfg(test)]
#[cfg(target_arch = "wasm32")]
use wasm_bindgen_test::wasm_bindgen_test as test;
Expand Down
6 changes: 2 additions & 4 deletions crates/iota-sdk-ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ version = "0.0.1"
authors = ["IOTA Foundation <[email protected]>"]
edition = "2024"
license = "Apache-2.0"
publish = false

[[bin]]
name = "iota_sdk_bindings"
Expand All @@ -27,7 +28,4 @@ serde_json.workspace = true
tokio = { workspace = true, features = ["time"] }
uniffi = { version = "0.29", features = ["cli", "tokio"] }

iota-crypto = { path = "../iota-crypto", features = ["bls12381", "ed25519", "secp256r1", "passkey", "secp256k1", "zklogin", "pem", "bech32"] }
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"] }
iota-sdk = { version = "3.0.0", path = "../iota-sdk" }
2 changes: 1 addition & 1 deletion crates/iota-sdk-ffi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ These methods set various metadata which may be needed for the execution.

### Finalization and Execution

There are several ways to finish the builder. First, the [finish](transaction_builder::TransactionBuilder::finish) method can be used to return the resulting [Transaction](iota_types::Transaction), which can be manually serialized, executed, etc.
There are several ways to finish the builder. First, the [finish](transaction_builder::TransactionBuilder::finish) method can be used to return the resulting [Transaction](iota_sdk::types::Transaction), which can be manually serialized, executed, etc.

Additionally, the builder can directly [dry_run](transaction_builder::TransactionBuilder::dry_run) or [execute](transaction_builder::TransactionBuilder::execute) the transaction.

Expand Down
Loading