Skip to content

Commit

Permalink
rename to seed-keeper-wallet
Browse files Browse the repository at this point in the history
used to be called seed-keeper-wit
but all of these components are wit, so that didn't make much sense
  • Loading branch information
DougAnderson444 committed Jan 10, 2024
1 parent b50c5a8 commit 4fa06d4
Show file tree
Hide file tree
Showing 22 changed files with 31 additions and 15 deletions.
4 changes: 3 additions & 1 deletion Cargo.lock

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

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Seed Keeper Workspace

- [seed-keeper-core](crates/seed-keeper-core/): Core functionality for Seed generation & encryption.
- [seed-keeper-wit](crates/seed-keeper-wit/): Wasm Interface Type (WIT) Component for using Seed-Keeper-Core in Apps.
- [seed-keeper-wallet](crates/seed-keeper-wallet/): Wasm Interface Type (WIT) Component for using Seed-Keeper-Core in Apps.
- [seed-keeper-wit-ui](crates/seed-keeper-wit-ui/): A User Interface built on top of Wasm Component Model for the Seed Keeper.

## Seed Keeper
Expand All @@ -16,7 +16,7 @@ cargo component build --workspace --release

## Compose

Compose the `seed-keeper-wit`, `seed-keeper-wit-ui`, and the seed consumers of your choice into a single Wasm component for use in an App using [`wasm-tools compose`](https://component-model.bytecodealliance.org/creating-and-consuming/composing.html):
Compose the `seed-keeper-wallet`, `seed-keeper-wit-ui`, and the seed consumers of your choice into a single Wasm component for use in an App using [`wasm-tools compose`](https://component-model.bytecodealliance.org/creating-and-consuming/composing.html):

```bash
wasm-tools compose ./target/wasm32-wasi/release/seed_keeper_wit_ui.wasm -d ./target/wasm32-wasi/release/seed_keeper_wit.wasm -o examples/composed-wallet.wasm
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "seed-keeper-wit"
name = "seed-keeper-wallet"
version = "0.1.0"
edition = "2021"

Expand All @@ -20,6 +20,6 @@ serde_json = "1.0"
crate-type = ["cdylib"]

[package.metadata.component]
package = "component:seed-keeper-wit"
package = "seed-keeper:wallet"

[package.metadata.component.dependencies]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion crates/seed-keeper-wit-ui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ package = "seed-keeper:wit-ui"
[package.metadata.component.dependencies]

[package.metadata.component.target.dependencies]
"seed-keeper:wallet" = { path = "../seed-keeper-wit/wit" }
"seed-keeper:wallet" = { path = "../seed-keeper-wallet/wit" }
2 changes: 1 addition & 1 deletion crates/seed-keeper-wit-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ cargo component build --release

# Use

To be useful, you compose the User Interface with the seed-keeper-wit component using `wasm-tools`
To be useful, you compose the User Interface with the seed-keeper-wallet component using `wasm-tools`
2 changes: 1 addition & 1 deletion examples/crates/aggregate-wit-ui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ package = "wallet:aggregate-wit-ui"
"example:edwards-ui" = { path = "../edwards-ui/wit" }

"component:edwards" = { path = "../edwards-wit/wit/deps/edwards" }
"seed-keeper:wallet" = { path = "../../../crates/seed-keeper-wit/wit" }
"seed-keeper:wallet" = { path = "../../../crates/seed-keeper-wallet/wit" }
2 changes: 1 addition & 1 deletion examples/crates/aggregate-wit-ui/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ search-paths:

dependencies:
seed-keeper:wit-ui/[email protected]: ../../../target/wasm32-wasi/release/seed_keeper_wit_ui.wasm
seed-keeper:wallet/[email protected]: ../../../target/wasm32-wasi/release/seed_keeper_wit.wasm
seed-keeper:wallet/[email protected]: ../../../target/wasm32-wasi/release/seed_keeper_wallet.wasm
example:edwards-ui/[email protected]: ../../../target/wasm32-wasi/release/edwards_ui.wasm
component:edwards/[email protected]: ../../../target/wasm32-wasi/release/edwards_wit.wasm
# instantiations:
Expand Down
1 change: 0 additions & 1 deletion examples/crates/aggregate-wit-ui/wit/world.wit
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ world example {
// requests to the DOM via jco
import wurbo-in;

// seed-keeper-wit-ui wurbo-out
import seed-keeper:wit-ui/wurbo-out@0.1.0;

// edwards-wit-ui wurbo-out
Expand Down
2 changes: 1 addition & 1 deletion examples/crates/edwards-wit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ package = "seed-keeper:edwards-wit"
"component:edwards" = { path = "wit/deps/edwards" }
# For some reason, the link below doesn't work fully, so we still need to copy the deps to
# ./wit/deps/wallet in ADDITION to the link below.
"seed-keeper:wallet" = { path = "../../../crates/seed-keeper-wit/wit" }
"seed-keeper:wallet" = { path = "../../../crates/seed-keeper-wallet/wit" }
4 changes: 2 additions & 2 deletions examples/crates/edwards-wit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ world yourworld {

```toml
[package.metadata.component.target.dependencies]
"seed-keeper:wallet" = { path = "../path/to/seed-keeper-wit/wit" } # directory containing the WIT package
"seed-keeper:wallet" = { path = "../path/to/seed-keeper-wallet/wit" } # directory containing the WIT package
```

4. Export an interface which defines a `sign` func which takes a message and returns a signature.
Expand All @@ -41,4 +41,4 @@ interface operations {

## Compose

Compose this plugin together with the `seed-keeper-wit` and the `seed-keeper-wit-ui` components.
Compose this plugin together with the `seed-keeper-wallet` and the `seed-keeper-wit-ui` components.
2 changes: 1 addition & 1 deletion examples/sveltekit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function buildCodeString(namespace) {
}
```

5. Wire up the exports of `seed-keeper-wit` to the imports of `seed-keeper-wit-ui` usign [`wasm-tools`](https://github.com/bytecodealliance/wasm-tools):
5. Wire up the exports of `seed-keeper-wallet` to the imports of `seed-keeper-wit-ui` usign [`wasm-tools`](https://github.com/bytecodealliance/wasm-tools):

```bash
cargo install wasm-tools
Expand Down
8 changes: 8 additions & 0 deletions examples/sveltekit/src/lib/Aggregate.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@
// lisen for events from the component
listener.listen(mod);
// Set up a broadcast channel to listen for updates from the Blob URLs
const bc = new BroadcastChannel(listener.namespace);
// Listen for messages from the Blob URLs
bc.onmessage = (event) => {
// console.log('Svelte BroadcastChannel evt', { event });
};
});
// Once the HTML is rendered and the module is loaded, we can activate the event emitters
Expand Down
9 changes: 8 additions & 1 deletion examples/sveltekit/src/routes/importables.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export function buildCodeString(namespace) {
return `
const bc = new BroadcastChannel('${namespace}');
export function addeventlistener({ selector, ty }) {
document.querySelector(selector).addEventListener(ty, (e) => {
Expand All @@ -27,7 +28,13 @@ export function buildCodeString(namespace) {
// console.log({ctx}, {rendered});
bc.postMessage(rendered);
});
}`;
}
// Enables the guest components to emit a broadcast message to all peers on the same domain origin browsing context
export function emit(message) {
bc.postMessage(message);
}
`;
}

/**
Expand Down

0 comments on commit 4fa06d4

Please sign in to comment.