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

Lykhoyda/dashboard #54

Merged
merged 9 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
448 changes: 226 additions & 222 deletions Cargo.lock

Large diffs are not rendered by default.

14 changes: 8 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[workspace]
resolver = "2"

members = [ "crates/webz-common",
"crates/webz-keys", "crates/webz-requests",
members = [
"crates/webz-common",
"crates/webz-keys",
"crates/webz-requests",
"crates/webz-wallet",
]

Expand All @@ -14,13 +16,13 @@ codegen-units = 1

[workspace.dependencies]
## Web dependencies
wasm-bindgen = "0.2.93"
wasm-bindgen = "0.2.99"
js-sys = "0.3.70"
wasm-bindgen-futures = "0.4.43"
wasm-bindgen-futures = "0.4.49"
web-sys = { version = "0.3.70", features = [
"console",
] }
wasm-bindgen-rayon = { version = "1.2.1" }
wasm-bindgen-rayon = { version = "1.2.2" }

# WASM specific dependencies
tracing-web = { version = "0.1.3" }
Expand Down Expand Up @@ -79,7 +81,7 @@ byte-unit = { version = "5.1.4", features = ["byte"] }


[patch.crates-io]
zip32 = { git = "https://github.com/zcash/zip32.git", branch = "diversifier_index_ord" }
zip32 = { git = "https://github.com/zcash/zip32.git" }
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

branch was merged into main zcash/zip32@ea6a62c

# TODO: See: https://github.com/RReverser/wasm-bindgen-rayon/pull/12
wasm-bindgen-rayon = { git = "https://github.com/9SMTM6/wasm-bindgen-rayon", rev = "d1816e5bc2bf928ff5442355c04500a381d66a41" }
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

# TODO: Remove these once the PRs are merged
Expand Down
2 changes: 0 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ build-keys *features:
build-requests *features:
cd crates/webz-requests && wasm-pack build -t web --release --scope webzjs --out-dir ../../packages/webz-requests --no-default-features --features="{{features}}" -Z build-std="panic_abort,std"


# All Wasm Tests
test-web *features:
WASM_BINDGEN_TEST_TIMEOUT=99999 wasm-pack test --release --firefox --no-default-features --features "wasm no-bundler {{features}}" -Z build-std="panic_abort,std"
Expand All @@ -28,7 +27,6 @@ test-message-board-web *features:
test-simple-web *features:
WASM_BINDGEN_TEST_TIMEOUT=99999 wasm-pack test --release --chrome --no-default-features --features "wasm no-bundler {{features}}" -Z build-std="panic_abort,std" --test simple-sync-and-send


# simple example: additional args:, sqlite-db
example-simple *features:
RUST_LOG="info,zcash_client_backend::sync=debug" cargo run -r --example simple-sync --features "native {{features}}"
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@metamask/eslint-config-nodejs": "^14.0.0",
"@metamask/eslint-config-typescript": "^14.0.0",
"@metamask/snaps-cli": "^6.5.2",
"@metamask/snaps-jest": "^8.6.0",
"@metamask/snaps-jest": "^8.8.1",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^5.42.1",
"eslint": "^9.14.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/template-snap-monorepo.git"
},
"source": {
"shasum": "+SKENP/6gsN0rziHiYtTQI27Cu1ssKsp6FUdW/pjriw=",
"shasum": "trfvzpmDcGt2TqfetqwfKPa8kHXQKGf4cytN7W+dHZU=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
1 change: 0 additions & 1 deletion packages/web-wallet/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>WebZjs Web Wallet</title>
</head>
Expand Down
11 changes: 9 additions & 2 deletions packages/web-wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@
},
"dependencies": {
"@metamask/providers": "^18.2.0",
"@webzjs/webz-keys": "workspace:^",
"@webzjs/webz-wallet": "workspace:^",
"idb-keyval": "^6.2.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.27.0"
"react-router-dom": "^6.27.0",
"usehooks-ts": "^3.1.0",
"vite-plugin-top-level-await": "^1.4.4"
},
"devDependencies": {
"@eslint/js": "^9.13.0",
Expand All @@ -32,6 +37,8 @@
"tailwindcss": "^3.4.14",
"typescript": "~5.6.2",
"typescript-eslint": "^8.11.0",
"vite": "^5.4.10"
"vite": "^5.4.10",
"vite-plugin-svgr": "^4.3.0",
"vite-plugin-wasm": "^3.3.0"
}
}
22 changes: 22 additions & 0 deletions packages/web-wallet/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { useInterval } from 'usehooks-ts';
import { useWebZjsActions } from '@hooks/useWebzjsActions.ts';
import Layout from '@components/Layout/Layout.tsx';
import { Outlet } from 'react-router-dom';
import { RESCAN_INTERVAL } from './config/constants.ts';

function App() {
const { triggerRescan } = useWebZjsActions();

// rescan the wallet periodically
useInterval(() => {
triggerRescan();
}, RESCAN_INTERVAL);

return (
<Layout>
<Outlet />
</Layout>
);
}

export default App;
3 changes: 3 additions & 0 deletions packages/web-wallet/src/assets/icons/arrow-receive.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/web-wallet/src/assets/icons/arrow-transfer.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/web-wallet/src/assets/icons/clock.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/web-wallet/src/assets/icons/coins.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/web-wallet/src/assets/icons/shield-divided.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/web-wallet/src/assets/icons/shield.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/web-wallet/src/assets/icons/summary.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions packages/web-wallet/src/assets/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,27 @@ import MetaMaskSnapsLogoSvg from './metamask-snaps-logo.svg';
import ZcashSvg from './zcash.svg';
import ZcashYellowSvg from './zcash-yellow.svg';

// Icons
import ArrowReceiveSvg from './icons/arrow-receive.svg';
import ArrowTransferSvg from './icons/arrow-transfer.svg';
import ClockSvg from './icons/clock.svg';
import ShieldSvg from './icons/shield.svg';
import ShieldDividedSvg from './icons/shield-divided.svg';
import SummarySvg from './icons/summary.svg';
import CoinsSvg from './icons/coins.svg';

export {
ChainsafeSvg,
MetaMaskLogoSvg,
MetaMaskSnapsLogoSvg,
ZcashSvg,
ZcashYellowSvg,
FormTransferSvg,
ArrowReceiveSvg,
ArrowTransferSvg,
ClockSvg,
ShieldSvg,
ShieldDividedSvg,
SummarySvg,
CoinsSvg,
};
8 changes: 3 additions & 5 deletions packages/web-wallet/src/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ const Footer = (): React.JSX.Element => {
href="https://chainsafe.io/"
target="_blank"
>
<img
src={ChainsafeSvg}
alt="Chainsafe Systems Logo"
className="inline-block w-6 h-6 mr-1"
/>
<div className="inline-block w-6 h-6 mr-1">
<ChainsafeSvg />
</div>
ChainSafe
</a>
</div>
Expand Down
Loading
Loading