Skip to content
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

Add wasm32 identity client implementation #1517

Open
wants to merge 36 commits into
base: feat/identity-rebased-alpha
Choose a base branch
from

Conversation

wulfraem
Copy link
Contributor

@wulfraem wulfraem commented Feb 5, 2025

Description of change

Adds implementation for wasm32 identity client, therefore enabling using the Rebased identity API in TypeScript.

Copy link
Contributor

@UMR1352 UMR1352 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still very rough around the edges but we are getting there. Thank you Sebastian for taking care of this. Great job!

wulfraem and others added 7 commits February 7, 2025 14:06
- update name from `@iota/iota.js` to `@iota/iota-sdk`
- switch to published version
- remove unnecessary `js_name` renaming

Co-authored-by: Enrico Marconi <[email protected]>
- remove unnecessary result wrapping
- more readable error conversion (`JsError::from`)
- wasm binding header cleanup
@wulfraem wulfraem requested a review from UMR1352 February 7, 2025 15:10
wulfraem and others added 16 commits February 10, 2025 08:51
* Kinesis renaming

* Update bindings/wasm/identity_wasm/examples/src/0_basic/0_create_did.ts

Co-authored-by: wulfraem <[email protected]>

* Update bindings/wasm/identity_wasm/examples/src/0_basic/1_update_did.ts

Co-authored-by: wulfraem <[email protected]>

* Update bindings/wasm/identity_wasm/examples/src/0_basic/3_deactivate_did.ts

Co-authored-by: wulfraem <[email protected]>

* Update bindings/wasm/identity_wasm/src/lib.rs

Co-authored-by: wulfraem <[email protected]>

---------

Co-authored-by: wulfraem <[email protected]>
* add 2_resolve_did example

* add custom resolver example

* add include custom resolution example in main

* fix outdated wording in examples

* update examples to use a more natural order of calls, remove unused variables

* update resolver logic

- resolver can be created with read-only and with write capable clients
- `IotaDocument` now serialize to full serialized `IotaDocument` intead of just the `CoreDocument` part when calling `.to_json()`/`.toJSON()`
- this affects the documents resolved via `Resolver` as well
- `Resolver` class now accepts generic type parameter to specify the type of the resolved documents

* fix missing imports in examples

* update `actions/cache` version

see https://github.blog/changelog/2024-12-05-notice-of-upcoming-releases-and-breaking-changes-for-github-actions/#actions-cache-v1-v2-and-actions-toolkit-cache-package-closing-down

* Update bindings/wasm/identity_wasm/examples/src/0_basic/2_resolve_did.ts

Co-authored-by: Enrico Marconi <[email protected]>

* fix typo found in review

---------

Co-authored-by: Enrico Marconi <[email protected]>
* add 2_resolve_did example

* add custom resolver example

* add include custom resolution example in main

* fix outdated wording in examples

* update examples to use a more natural order of calls, remove unused variables

* update and re-add wasm examples as used in rust code

* replace `util` helper with updated variant for rebased

* update resolver logic

- resolver can be created with read-only and with write capable clients
- `IotaDocument` now serialize to full serialized `IotaDocument` intead of just the `CoreDocument` part when calling `.to_json()`/`.toJSON()`
- this affects the documents resolved via `Resolver` as well
- `Resolver` class now accepts generic type parameter to specify the type of the resolved documents

* fix missing imports in examples

* update `actions/cache` version

see https://github.blog/changelog/2024-12-05-notice-of-upcoming-releases-and-breaking-changes-for-github-actions/#actions-cache-v1-v2-and-actions-toolkit-cache-package-closing-down

* Update bindings/wasm/identity_wasm/examples/src/0_basic/2_resolve_did.ts

Co-authored-by: Enrico Marconi <[email protected]>

* fix typo found in review

* update resolver in examples to use read-only identity client

* align example/test helper functions

* remove api tests from WASM examples

- most parts covered by them should be covered by actual examples by now

* update readme for WASM examples

* Apply suggestions from code review

Co-authored-by: Eike Haß <[email protected]>

* reactivate tests for WASM build

* update example in readme, use testnet identity package as example

* update sccache action to also run on any ubuntu version

* add dedicated working directory to `npm ci` step for wasm

* update workflows to use local reusable workflows

* update wasm-bindgen-cli in ci to use fixed version

* remove unused dependency in web build file

* disable wasm unit and browser tests for now

* disable wasm tests in ci for now

* disable firefox and chrome tests as well

---------

Co-authored-by: Enrico Marconi <[email protected]>
Co-authored-by: Eike Haß <[email protected]>
* update_did and deactivate_did wasm

* DeactivateDid proposal

* WASM Update DID Document proposal

* WASM send assets proposal

* fix WASM Send proposal

* update TS example to use proposals

* config change proposal

* use deactivate_did proposal in examples

* rename IDENTITY_IOTA_PACKAGE_ID to IDENTITY_IOTA_PKG_ID

* use proposal API and fix WasmOnChainIdentity::didDocument

* fix pkg name

* Update identity_iota_core/src/rebased/proposals/config_change.rs

Co-authored-by: wulfraem <[email protected]>

* remove unused type

---------

Co-authored-by: wulfraem <[email protected]>
…ute_transaction` (#1539)

* add `wait_for_transaction` to ts impl for `execute_transaction`

* add missing impl for new digest function to rust trait impl
* add `wait_for_transaction` to ts impl for `execute_transaction`

* fix consuming of document arg when publishing document updates in wasm
* remove stardust sdk and client

* remove stardust sdk from interactions

* update package-lock

* remove stardust related deps, update comments

* fix outdated comment

---------

Co-authored-by: Sebastian Wolfram <[email protected]>
@wulfraem wulfraem marked this pull request as ready for review February 21, 2025 16:59
@wulfraem wulfraem requested a review from a team as a code owner February 21, 2025 16:59
@wulfraem wulfraem added Wasm Related to Wasm bindings. Becomes part of the Wasm changelog Breaking change A change to the API that requires a major release. Part of "Changed" section in changelog Rust Related to the core Rust code. Becomes part of the Rust changelog. labels Feb 21, 2025
wulfraem and others added 8 commits February 21, 2025 18:27
This reverts commit 18e9226.

changes will be move to a separate PR
* signer: support keys other than ed25519

* remove unused dependency

* fix failing doc test

* dprint

* StorageSigner receives TxData instead of raw bytes

* Use IotaSignature as Signer output, let signer handle all signing logic

* Keytool signer

* Keytool signer

* Keytool signer tests

* fmt

* re-export KeytoolSigner

* KeytoolSignerBuilder

* WASM KeytoolSigner

* fmt

* buildable wasm

* Make WasmKeytoolSigner work

* ensures WASM keytool signer implements Signer TS interface

* wasm keytoolsigner

* fix serialization/deserialization of Signature

* temp commit

* update to latest version of bindgen

* update storage singer to use Uint8Array for public key internally

* cleanup

* make KeytoolSigner work with keytool version 0.8.1

* update CI to use wasm-bindgen version 0.2.100

* use node 20 in CI

* dprint fmt

* use latest toolchain for identity_wasm

* add missing licence header

* use node 20 in all CI actions

* avoid fauceting if address already has enough funds

* use binding/wasm/target to store WASM compilation artifacts

* Update bindings/wasm/iota_interaction_ts/Cargo.toml

Co-authored-by: wulfraem <[email protected]>

* avoid casting to any

---------

Co-authored-by: Sebastian Wolfram <[email protected]>
* re-add typedoc fixes

* update docs fix to set `globstar` before running

* update typedoc path pattern to start from $PWD/ instead of ./

* update fix docs to locate files via find command

* use find command for both typedoc fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking change A change to the API that requires a major release. Part of "Changed" section in changelog Rust Related to the core Rust code. Becomes part of the Rust changelog. Wasm Related to Wasm bindings. Becomes part of the Wasm changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants