Skip to content

Integrate product core into identity.rs #1658

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d4e366c
Remove all resources that will be provided by product-core
chrisgitiota Apr 24, 2025
c051c49
Revert "Remove all resources that will be provided by product-core"
chrisgitiota Apr 24, 2025
a1f6c38
Removed all resources that shall be provided by product-core
chrisgitiota Apr 24, 2025
4f6ebed
Fixed cargo.toml issues and added product-core dependencies
chrisgitiota Apr 24, 2025
7c75698
First Rust buildable and e2e tested version using product_core
chrisgitiota Apr 25, 2025
00cc42c
First WASM32 (not NodeJS build) buildable untested version using prod…
chrisgitiota Apr 25, 2025
9e60199
iota_move_calls_ts buildable with build:nodejs
chrisgitiota Apr 25, 2025
2821f20
First attempt to accomplish build:nodejs for identity_wasm
chrisgitiota Apr 25, 2025
165887b
Switch product_core cargo dependencies from local neighboured folder …
chrisgitiota Apr 28, 2025
5d630ab
Switch product_core cargo dependencies from ssh to https
chrisgitiota Apr 29, 2025
124fb78
Merge branch 'main' into chore/product-core-integration
itsyaasir May 6, 2025
7d0e148
refactor: migrate transaction builder to product-core crate
itsyaasir May 6, 2025
7ca92da
refactor: reorganize imports and split multi-line imports into single…
itsyaasir May 6, 2025
b02f330
refactor: remove unused imports from identity_move_calls and client m…
itsyaasir May 6, 2025
c2e524b
chore: clean up commented code and update NetworkName imports
itsyaasir May 6, 2025
8828b4d
use published interactions
eike-hass May 6, 2025
ab93fcd
move move_calls sources to identity_wasm folder
eike-hass May 7, 2025
c5b4964
feat: add new move calls modules for asset, identity, and migration h…
itsyaasir May 7, 2025
ba3160a
refactor: migrate imports from identity_iota to product_core and remo…
itsyaasir May 7, 2025
a8c2928
refactor: remove unused move calls and related files from identity_wa…
itsyaasir May 7, 2025
aaf7961
fix: restore product-core dependency in Cargo.toml
itsyaasir May 7, 2025
fb7e8fc
Merge branch 'main' into chore/product-core-integration
itsyaasir May 7, 2025
110cc0b
refactor: update imports to use iota_interaction instead of identity_…
itsyaasir May 7, 2025
61cb298
refactor: clean up unused move_calls module and update imports in was…
itsyaasir May 7, 2025
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
16 changes: 0 additions & 16 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -260,14 +260,6 @@ jobs:
run: npm ci
working-directory: bindings/wasm/identity_wasm

- name: Install JS dependencies # This is problematic: @iota/iota-sdk seems to not get used from the identity_wasm package, that is why reinstall deps here
run: npm ci
working-directory: bindings/wasm/iota_interaction_ts

- name: Setup link
run: npm link ../iota_interaction_ts
working-directory: bindings/wasm/identity_wasm

- name: Run Wasm examples
run: npm run test:readme && npm run test:node
working-directory: bindings/wasm/identity_wasm
Expand Down Expand Up @@ -299,14 +291,6 @@ jobs:
name: identity-wasm-bindings-build
path: bindings/wasm/

- name: Install JS dependencies # This is problematic: @iota/iota-sdk seems to not get used from the identity_wasm package, that is why reinstall deps here
run: npm ci
working-directory: bindings/wasm/iota_interaction_ts

- name: Setup link
run: npm link ../iota_interaction_ts
working-directory: bindings/wasm/identity_wasm

- name: Start iota sandbox
uses: './.github/actions/iota-rebase-sandbox/setup'
with:
Expand Down
10 changes: 0 additions & 10 deletions .github/workflows/shared-build-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,6 @@ jobs:
with:
node-version: 20.x

- name: Install JS dependencies
run: npm ci
working-directory: bindings/wasm/iota_interaction_ts

- name: Build IOTA interaction bindings
run: npm run build
working-directory: bindings/wasm/iota_interaction_ts

- name: Install JS dependencies
run: npm ci
working-directory: bindings/wasm/identity_wasm
Expand Down Expand Up @@ -104,7 +96,5 @@ jobs:
bindings/wasm/identity_wasm/web
bindings/wasm/identity_wasm/examples/dist
bindings/wasm/identity_wasm/docs
bindings/wasm/iota_interaction_ts/node
bindings/wasm/iota_interaction_ts/web
if-no-files-found: error
retention-days: 1
23 changes: 18 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,33 @@ members = [
"identity_ecdsa_verifier",
"identity_eddsa_verifier",
"examples",
"identity_iota_interaction",
"bindings/wasm/iota_interaction_ts",
"identity_iota_move_calls",
]

exclude = ["bindings/wasm/identity_wasm", "bindings/grpc"]

[workspace.dependencies]
bls12_381_plus = { version = "0.8.17" }
serde = { version = "1.0", default-features = false, features = ["alloc", "derive"] }
iota_interaction = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/transaction-client-core-for-identity", package = "iota_interaction" }
# iota_interaction = { path = "../product-core/iota_interaction" }
iota_interaction_ts = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/transaction-client-core-for-identity", package = "iota_interaction_ts" }
# iota_interaction_ts = { path = "../product-core/bindings/wasm/iota_interaction_ts" }
product_common = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/transaction-client-core-for-identity", package = "product_common" }
# product_common = { path = "../product-core/product_common" }
serde = { version = "1.0", default-features = false, features = [
"alloc",
"derive",
] }
serde_json = { version = "1.0", default-features = false }
strum = { version = "0.25", default-features = false, features = ["std", "derive"] }
strum = { version = "0.25", default-features = false, features = [
"std",
"derive",
] }
thiserror = { version = "1.0", default-features = false }
json-proof-token = { version = "0.3.5" }
zkryptium = { version = "0.2.2", default-features = false, features = ["bbsplus"] }
zkryptium = { version = "0.2.2", default-features = false, features = [
"bbsplus",
] }

[workspace.lints.clippy]
result_large_err = "allow"
Expand Down
4 changes: 2 additions & 2 deletions bindings/wasm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Here is an overview of the existing artifacts:
* `identity_wasm`<br>
Exports the IdentityClient to TypeScript using wasm-bindgen generated wasm bindings

* `iota_interaction_ts`<br>
* `iota_move_calls_ts`<br>
Imports TypeScript IOTA Client SDK types using wasm-bindgen generated wasm bindings
and implements identity_iota_interaction traits (among others, IotaClient and MoveCall traits) for wasm32 platforms.
and implements identity_iota_move_calls traits for wasm32 platforms.

## Building an Artifact

Expand Down
15 changes: 9 additions & 6 deletions bindings/wasm/identity_wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ tokio = { version = "1.43", default-features = false, features = ["sync"] }
tsify = "0.4.5"
wasm-bindgen = { version = "0.2.100", features = ["serde-serialize"] }
wasm-bindgen-futures = { version = "0.4", default-features = false }
product-core = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/transaction-client-core-for-identity", package = "product_common", features = ["core-client", "transaction"] }
iota_interaction = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/transaction-client-core-for-identity", package = "iota_interaction", default-features = false, optional = true }

# dummy-client dependencies
iota_interaction_ts = { git = "https://github.com/iotaledger/product-core.git", branch = "feat/transaction-client-core-for-identity", package = "iota_interaction_ts", optional = true }

# iota_interaction_ts = { path = "../../../../product-core/bindings/wasm/iota_interaction_ts", optional = true }


[dependencies.identity_iota]
path = "../../../identity_iota"
Expand All @@ -53,11 +61,6 @@ features = [
"jpt-bbs-plus",
]

# dummy-client dependencies
[dependencies.iota_interaction_ts]
path = "../iota_interaction_ts"
optional = true

[target.'cfg(all(target_arch = "wasm32", not(target_os = "wasi")))'.dependencies]
getrandom = { version = "0.2", default-features = false, features = ["js"] }

Expand All @@ -81,5 +84,5 @@ unexpected_cfgs = { level = "warn", check-cfg = ['cfg(wasm_bindgen_unstable_test

[features]
default = ["dummy-client"]
dummy-client = ["dep:iota_interaction_ts"]
dummy-client = ["dep:iota_interaction_ts"] # TODO: Rename this feature or remove it
keytool = ["dep:iota_interaction_ts", "iota_interaction_ts/keytool", "identity_iota/keytool"]
5 changes: 3 additions & 2 deletions bindings/wasm/identity_wasm/cypress/app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions bindings/wasm/identity_wasm/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ export * from "./core_client";
export * from "./proposal";
export * from "./transaction_internal";

export * as move_calls from "./move_calls";

// keep this export last to override the original `Resolver` from `identity_wasm` in the exports
export { Resolver } from "./resolver";
4 changes: 2 additions & 2 deletions bindings/wasm/identity_wasm/lib/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"../node/identity_wasm",
"./identity_wasm.js"
],
"@iota/iota-interaction-ts/": [
"@iota/iota-interaction-ts/node/"
"@iota/iota-move-calls-identity/": [
"@iota/iota-move-calls-identity/node/"
],
"../lib": [
"."
Expand Down
4 changes: 2 additions & 2 deletions bindings/wasm/identity_wasm/lib/tsconfig.web.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"../web/identity_wasm",
"./identity_wasm.js"
],
"@iota/iota-interaction-ts/": [
"@iota/iota-interaction-ts/web/"
"@iota/iota-move-calls-identity/": [
"@iota/iota-move-calls-identity/web/"
],
"../lib": [
"."
Expand Down
47 changes: 35 additions & 12 deletions bindings/wasm/identity_wasm/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bindings/wasm/identity_wasm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"wasm-opt": "^1.4.0"
},
"dependencies": {
"@iota/iota-interaction-ts": "^0.3.0",
"@iota/iota-interaction-ts": "^0.4.1",
"@noble/ed25519": "^1.7.3",
"@noble/hashes": "^1.4.0",
"@types/node-fetch": "^2.6.2",
Expand Down
4 changes: 2 additions & 2 deletions bindings/wasm/identity_wasm/src/rebased/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use identity_iota::iota::rebased::migration::DelegateToken;
use identity_iota::iota::rebased::migration::DelegationToken;
use identity_iota::iota::rebased::migration::DelegationTokenRevocation;
use identity_iota::iota::rebased::migration::DeleteDelegationToken;
use identity_iota::iota::rebased::transaction_builder::Transaction as _;
use identity_iota::iota::rebased::transaction_builder::TransactionBuilder;
use product_core::transaction::transaction_builder::TransactionBuilder;
use product_core::transaction::transaction_builder::Transaction as _;
use iota_interaction_ts::bindings::WasmIotaTransactionBlockEffects;
use js_sys::Object;
use wasm_bindgen::prelude::wasm_bindgen;
Expand Down
12 changes: 6 additions & 6 deletions bindings/wasm/identity_wasm/src/rebased/core_client.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Copyright 2020-2025 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use identity_iota::iota::rebased::client::CoreClient;
use identity_iota::iota::rebased::client::CoreClientReadOnly;
use identity_iota::iota::NetworkName;
use product_core::core_client::CoreClient;
use product_core::core_client::CoreClientReadOnly;
use product_core::network_name::NetworkName;
use identity_iota::iota_interaction::types::base_types::IotaAddress;
use identity_iota::iota_interaction::types::base_types::ObjectID;
use identity_iota::iota_interaction::types::base_types::ObjectIDParseError;
use identity_iota::iota_interaction::types::crypto::PublicKey;
use iota_interaction::types::base_types::ObjectID;
use iota_interaction::types::base_types::ObjectIDParseError;
use iota_interaction::types::crypto::PublicKey;
use iota_interaction_ts::bindings::WasmIotaClient;
use iota_interaction_ts::IotaClientAdapter;
use iota_interaction_ts::WasmPublicKey;
Expand Down
2 changes: 1 addition & 1 deletion bindings/wasm/identity_wasm/src/rebased/identity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use identity_iota::iota::rebased::migration::ControllerToken;
use identity_iota::iota::rebased::migration::CreateIdentity;
use identity_iota::iota::rebased::migration::IdentityBuilder;
use identity_iota::iota::rebased::migration::OnChainIdentity;
use identity_iota::iota::rebased::transaction_builder::Transaction;
use product_core::transaction::transaction_builder::{Transaction};
use identity_iota::iota::IotaDocument;
use iota_interaction_ts::bindings::WasmIotaTransactionBlockEffects;
use iota_interaction_ts::error::WasmResult as _;
Expand Down
13 changes: 7 additions & 6 deletions bindings/wasm/identity_wasm/src/rebased/transaction_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ use anyhow::anyhow;
use anyhow::Context as _;
use async_trait::async_trait;
use fastcrypto::traits::EncodeDecodeBase64;
use identity_iota::iota::rebased::client::CoreClientReadOnly;
use identity_iota::iota::rebased::transaction::TransactionOutputInternal;
use identity_iota::iota::rebased::transaction_builder::MutGasDataRef;
use identity_iota::iota::rebased::transaction_builder::Transaction;
use identity_iota::iota::rebased::transaction_builder::TransactionBuilder;
use product_core::core_client::CoreClientReadOnly;
use product_core::transaction::TransactionOutputInternal;
use product_core::transaction::transaction_builder::MutGasDataRef;
use product_core::transaction::transaction_builder::Transaction;
use product_core::transaction::transaction_builder::TransactionBuilder;
use identity_iota::iota::rebased::Error as IotaError;
use identity_iota::iota_interaction::rpc_types::IotaTransactionBlockEffects;
use identity_iota::iota_interaction::types::crypto::Signature;
Expand Down Expand Up @@ -57,8 +57,9 @@ extern "C" {
#[async_trait(?Send)]
impl Transaction for WasmTransaction {
type Output = JsValue;
type Error = IotaError;

async fn build_programmable_transaction<C>(&self, client: &C) -> StdResult<ProgrammableTransaction, IotaError>
async fn build_programmable_transaction<C>(&self, client: &C) -> StdResult<ProgrammableTransaction, Self::Error>
where
C: CoreClientReadOnly,
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ use std::ops::Deref;
use std::rc::Rc;

use anyhow::anyhow;
use identity_iota::iota::rebased::client::CoreClient as _;
use product_core::core_client::CoreClient as _;
use identity_iota::iota::rebased::client::IdentityClient;
use identity_iota::iota::rebased::client::PublishDidDocument;
use identity_iota::iota::rebased::transaction::TransactionOutputInternal;
use product_core::transaction::TransactionOutputInternal;

use identity_iota::iota::rebased::transaction_builder::Transaction as _;
use product_core::transaction::transaction_builder::{Transaction};
use iota_interaction_ts::bindings::WasmExecutionStatus;
use iota_interaction_ts::bindings::WasmIotaClient;
use iota_interaction_ts::bindings::WasmIotaTransactionBlockEffects;
Expand Down
Loading
Loading