Description
Context
During the WASM32-Binding development, generic parameters have been introduced on the wasm32-develop
branch to abstract away platform specific adapter types used in our platform agnostic Identity code.
Example: IdentityClient<S, C: Clone, M: Send>
where the generic parameter M abstracts away the platform specific AssetMoveCalls or IdentityMoveCalls.
These generic parameters have been introduced to avoid circular dependencies. The new generic parameters led to several new problems with Send
and Sync
trait constraints. We needed to address these problems by feature switches which increased code complexity and efforts a lot.
Task Description
The dependency structure between the Identity crates needs to be redesigned so that circular dependencies can be avoided without the need for generic parameters.
Following modules need to be located in new or existing crates:
-
identity_iota_interaction
Formerly known asiota_sdk_abstraction
. Trait definitions and a wasm32 compatible subset of code, copied from IOTA Client Rust SDK, used to replace the IOTA Client Rust SDK for wasm32 builds. -
iota_interaction_ts
Formerly known asts_sdk_adapter
. 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. -
iota_interaction_rust
Formerly known asrust_sdk_adapter
. Implements identity_iota_interaction traits for the NON wasm32 platforms using the IOTA Client Rust SDK -
identity_iota_core/src/rebased
Implements the IdentityClient for IOTA Rebased usingiota_interaction_rust
oriota_interaction_ts
depending on the build platform -
identity_wasm
Exports the IdentityClient to Typescript using wasm-bindgen generated wasm bindings
Following diagram visualizes a proposed structure for the Identity crates and folders. The structure needs to be discussed before starting this task:

The folder structure to locate the above shown crates and folders, would look like this:
- bindings
- wasm
identity_wasm
- Crate
Contains the existing identity_wasm crate currently located inbindings/wasm
.iota_interaction_ts
- Crate
- wasm
identity_iota_interaction
- Crate
The import path inside theidentity_iota_core::rebased
module would be 'identity_iota::iota_interaction'.identity_iota_core
- Crate- src
rebased
The import path for theiota_interaction_rust
resp.iota_interaction_ts
would be 'crate::iota_interaction_adapter'.
The import path for theIOTA Client Rust SDK
resp.identity_iota_interaction
would be 'identity_iota::iota_interaction'.iota_interaction_rust
There would be no new crate foriota_interaction_rust
.
The folder iota_interaction_rust contains the adapter code as described above.
The module is not accesses directly but via the iota_interaction_adapter (see below.)- iota_interaction_adapter.rs
Contains platform specific compile switches, managing the import module paths foriota_interaction_rust
andiota_interaction_ts
.
- src
Metadata
Metadata
Assignees
Labels
Type
Projects
Status