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

Feature/example app #35

Closed
wants to merge 2 commits into from

Conversation

riverKanies
Copy link
Contributor

Description

Add an example app that is touches on all the wasm specific stuff

(this pr builds on the previous one that just updated the readme)

Notes to the reviewers

Changelog notice

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

Copy link

socket-security bot commented Feb 19, 2025

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/[email protected] network 0 3.75 MB dario_nakamoto
npm/[email protected] environment, filesystem, unsafe Transitive: eval, shell +40 1.1 MB evilebottnawi
npm/[email protected] environment, eval, network Transitive: filesystem, unsafe +194 14.2 MB evilebottnawi
npm/[email protected] Transitive: environment, eval, filesystem, shell, unsafe +76 18.5 MB evilebottnawi, jhnns, sokra, ...1 more

View full report↗︎

Copy link

socket-security bot commented Feb 19, 2025

Report is too large to display inline.
View full report↗︎

Next steps

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all

@@ -0,0 +1,3 @@
[env]
Copy link
Contributor

Choose a reason for hiding this comment

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

hi!
This file should be gitignore as it is environment specific.

@@ -1,9 +1,7 @@
/target
**/*.rs.bk
/.vscode
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment. .vscode and .cargo should not be part of the repo.

@@ -0,0 +1,7 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here.

let client = new EsploraClient("https://mutinynet.com/api");
if (!walletDataString) {
console.log("Creating new wallet");
wallet = Wallet.create(
Copy link
Contributor

Choose a reason for hiding this comment

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

this if would constitute an example test showcasing create

walletDataString = stagedDataString;
} else {
console.log("Loading wallet");
let changeSet = ChangeSet.from_json(walletDataString);
Copy link
Contributor

Choose a reason for hiding this comment

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

this else would constitute an example test showcasing load

);

console.log("Performing Full Scan...");
let full_scan_request = wallet.start_full_scan();
Copy link
Contributor

Choose a reason for hiding this comment

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

example to showcase full_scan using Esplora.


console.log("Syncing...");
let sync_request = wallet.start_sync_with_revealed_spks();
let update = await client.sync(sync_request, 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

example to showcase sync using Esplora.

console.log("Update:", updateChangeSet.to_json());
let currentChangeSet = ChangeSet.from_json(walletDataString);
console.log("Current:", currentChangeSet.to_json());
currentChangeSet.merge(updateChangeSet);
Copy link
Contributor

Choose a reason for hiding this comment

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

example of merge.

console.log("Current:", currentChangeSet.to_json());
currentChangeSet.merge(updateChangeSet);
console.log("Merged:", currentChangeSet.to_json());
Store.save(currentChangeSet.to_json());
Copy link
Contributor

Choose a reason for hiding this comment

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

we can drop the Store IMO but that could be an example of storage, even though I don't see the need for it since the users will get a ChangeSet an can do with it what they like.

@riverKanies
Copy link
Contributor Author

Ok, this should be converted to js tests rather than an app

@riverKanies riverKanies marked this pull request as draft February 19, 2025 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants