diff --git a/web-wallet/.eslintrc.cjs b/web-wallet/.eslintrc.cjs index 496a8229ac..495bac4d4b 100644 --- a/web-wallet/.eslintrc.cjs +++ b/web-wallet/.eslintrc.cjs @@ -1,73 +1,72 @@ module.exports = { - "env": { - "browser": true, - "es2022": true, - "node": true + env: { + browser: true, + es2022: true, + node: true, }, - "extends": [ + extends: [ "@dusk-network/eslint-config/js", - "@dusk-network/eslint-config/svelte" + "@dusk-network/eslint-config/svelte", ], - "globals": { - "CONFIG": false + globals: { + CONFIG: false, }, - "overrides": [{ - "files": ["*.svelte"], - "rules": { - "no-undef-init": 0, - "svelte/require-optimized-style-attribute": 0 - } - }, { - "files": ["*.spec.js", "*.test.js"], - "rules": { - "brace-style": [ - "error", - "1tbs", - { "allowSingleLine": true } - ], - "jsdoc/require-jsdoc": 0, - "max-len": [ - "error", { - "code": 110, - "comments": 110, - "ignorePattern": "^\\s*it\\(", - "ignoreUrls": true - } - ], - "max-nested-callbacks": [ - "error", - 5 - ], - "max-statements": 0, - "max-statements-per-line": [ - "error", { - "max": 2 - } - ], - "object-curly-newline": 0, - "quote-props": [ - "error", - "consistent" - ], - "sort-keys": 0 - } - }], - "root": true, - "settings": { + overrides: [ + { + files: ["*.svelte"], + rules: { + "no-undef-init": 0, + "svelte/require-optimized-style-attribute": 0, + }, + }, + { + files: ["*.spec.js", "*.test.js"], + rules: { + "brace-style": ["error", "1tbs", {allowSingleLine: true}], + "jsdoc/require-jsdoc": 0, + "max-len": [ + "error", + { + code: 110, + comments: 110, + ignorePattern: "^\\s*it\\(", + ignoreUrls: true, + }, + ], + "max-nested-callbacks": ["error", 5], + "max-statements": 0, + "max-statements-per-line": [ + "error", + { + max: 2, + }, + ], + "object-curly-newline": 0, + "sort-keys": 0, + }, + }, + ], + root: true, + settings: { "import/resolver": { "eslint-import-resolver-custom-alias": { - "alias": { - "$app": "node_modules/@sveltejs/kit/src/runtime/app", - "$config": "./src/config", - "$lib": "./src/lib", - "@sveltejs/kit": "node_modules/@sveltejs/kit/src/exports/index.js", - "@testing-library/svelte": "node_modules/@testing-library/svelte/src/index.js", - "svelte/motion": "node_modules/svelte/src/runtime/motion/index.js", - "svelte/store": "node_modules/svelte/src/runtime/store/index.js", - "svelte/transition": "node_modules/svelte/src/runtime/transition/index.js" + alias: { + $app: "node_modules/@sveltejs/kit/src/runtime/app", + $config: "./src/config", + $lib: "./src/lib", + "@sveltejs/kit": + "node_modules/@sveltejs/kit/src/exports/index.js", + "@testing-library/svelte": + "node_modules/@testing-library/svelte/src/index.js", + "svelte/motion": + "node_modules/svelte/src/runtime/motion/index.js", + "svelte/store": + "node_modules/svelte/src/runtime/store/index.js", + "svelte/transition": + "node_modules/svelte/src/runtime/transition/index.js", }, - "extensions": [".cjs", ".js", ".json", ".svelte"] - } - } - } + extensions: [".cjs", ".js", ".json", ".svelte"], + }, + }, + }, }; diff --git a/web-wallet/.prettierrc.js b/web-wallet/.prettierrc.js new file mode 100644 index 0000000000..0f6fa53016 --- /dev/null +++ b/web-wallet/.prettierrc.js @@ -0,0 +1,11 @@ +import duskJsPrettierConfig from "@dusk-network/prettier-config/js/index.js"; +import duskSveltePrettierConfig from "@dusk-network/prettier-config/svelte/index.js"; + +export default { + plugins: ["prettier-plugin-svelte"], + overrides: [{files: "*.svelte", options: {parser: "svelte"}}], + ...duskJsPrettierConfig, + ...duskSveltePrettierConfig, + arrowParens: "avoid", + bracketSpacing: false, +}; diff --git a/web-wallet/CHANGELOG.md b/web-wallet/CHANGELOG.md index d954a0cb78..5bf9f141ac 100644 --- a/web-wallet/CHANGELOG.md +++ b/web-wallet/CHANGELOG.md @@ -8,83 +8,85 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added -- Add Create Wallet flow tests [#1443] -- Add visible version, commit hash and build date [#1441] -- Add Address validation (Transfer flow) [#1377] + +- Add Create Wallet flow tests [#1443] +- Add visible version, commit hash and build date [#1441] +- Add Address validation (Transfer flow) [#1377] ### Changed -- Change Get Quote API Endpoint to env variable [#1311] +- Change Get Quote API Endpoint to env variable [#1311] ### Removed -- Remove the use of `checkValidity()` in Send and Stake flow amounts validity checks [#1391] +- Remove the use of `checkValidity()` in Send and Stake flow amounts validity checks [#1391] ### Fixed -- Fix typo in routes/welcome/\_\_tests\_\_/page.spec.js [#1445] -- Fix missing whitespace when Transaction list is empty [#1460] +- Fix typo in routes/welcome/\_\_tests\_\_/page.spec.js [#1445] +- Fix missing whitespace when Transaction list is empty [#1460] ## [0.2.1] - 2024-02-20 ### Added -- Add wallet restore flow tests [#1416] -- Add missing login flow tests [#1423] +- Add wallet restore flow tests [#1416] +- Add missing login flow tests [#1423] ### Fixed -- Fix restore flow allowing invalid mnemonic to be used to log in [#1416] -- Fix can't unlock the wallet with upper case words [#1417] +- Fix restore flow allowing invalid mnemonic to be used to log in [#1416] +- Fix can't unlock the wallet with upper case words [#1417] ## [0.2.0] - 2024-02-15 ### Added -- Add running node requirement notice in Staking flow [#1359] -- Add `fiatPrice` optional property to Balance component [#1323] -- Add ability to revert words when entering the mnemonic phrase [#1290] -- Add missing error handling when querying the quote API [#1322] -- Add gas settings validation to settings page [#1352] -- Add forced log out on inactive tabs [#1373] -- Add gas settings validation to block Send and Stake operations if invalid gas settings [#1354] -- Add abortable sync [#1401] -- Add `existing wallet notice` to wallet create, restore and login flows [#1360] -- Add `userId` value to localStorage preferences object during wallet create and restore [#1360] +- Add running node requirement notice in Staking flow [#1359] +- Add `fiatPrice` optional property to Balance component [#1323] +- Add ability to revert words when entering the mnemonic phrase [#1290] +- Add missing error handling when querying the quote API [#1322] +- Add gas settings validation to settings page [#1352] +- Add forced log out on inactive tabs [#1373] +- Add gas settings validation to block Send and Stake operations if invalid gas settings [#1354] +- Add abortable sync [#1401] +- Add `existing wallet notice` to wallet create, restore and login flows [#1360] +- Add `userId` value to localStorage preferences object during wallet create and restore [#1360] ### Changed -- Change Holdings component design [#1361] -- Change `fiatCurrency`, `locale`, `tokenCurrency`, `token` to required properties in Balance component [#1323] -- Change `package.json` fields to reflect repo change [#1367] -- Change `walletStore.js` to receive gasPrice and gasLimit when `transfer` , `stake`, `unstake` and `withdrawRewards` are called [#1353] -- Update deprecated Node actions in CI [#1343] -- Change `setGasSettings` event to `gasSettings` and include `isValidGas` property in event data [#1354] -- Change "withdraw stake" label to "unstake" [#1403] -- Change logout flow to abort a sync if in progress [#1401] -- Update dusk-wallet-js to from 0.3.2 to 0.4.2 [#1401] +- Change Holdings component design [#1361] +- Change `fiatCurrency`, `locale`, `tokenCurrency`, `token` to required properties in Balance component [#1323] +- Change `package.json` fields to reflect repo change [#1367] +- Change `walletStore.js` to receive gasPrice and gasLimit when `transfer` , `stake`, `unstake` and `withdrawRewards` are called [#1353] +- Update deprecated Node actions in CI [#1343] +- Change `setGasSettings` event to `gasSettings` and include `isValidGas` property in event data [#1354] +- Change "withdraw stake" label to "unstake" [#1403] +- Change logout flow to abort a sync if in progress [#1401] +- Update dusk-wallet-js to from 0.3.2 to 0.4.2 [#1401] ### Removed -- Remove `fiat` property from Balance component [#1323] -- Remove `gasSettings` store update from `dashboard/+page.svelte.js` [#1353] +- Remove `fiat` property from Balance component [#1323] +- Remove `gasSettings` store update from `dashboard/+page.svelte.js` [#1353] ### Fixed -- Fix Transactions table remains hidden for some screen resolutions [#1412] -- Fix Stake button is always disabled [#1410] -- Fix wizard progression on Stake flow [#1398] -- Fix Seed Phrase words size [#1335] -- Fix colors on red background [#1334] -- Fix Transactions table design [#1309] +- Fix Transactions table remains hidden for some screen resolutions [#1412] +- Fix Stake button is always disabled [#1410] +- Fix wizard progression on Stake flow [#1398] +- Fix Seed Phrase words size [#1335] +- Fix colors on red background [#1334] +- Fix Transactions table design [#1309] ## [0.1.0-beta] - 2024-02-02 ### Added -- Add initial commit +- Add initial commit + [#1359]: https://github.com/dusk-network/rusk/issues/1359 [#1311]: https://github.com/dusk-network/rusk/issues/1311 [#1323]: https://github.com/dusk-network/rusk/issues/1323 @@ -117,6 +119,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [#1443]: https://github.com/dusk-network/rusk/issues/1443 + [Unreleased]: https://github.com/dusk-network/rusk/tree/master/web-wallet [0.2.1]: https://github.com/dusk-network/rusk/tree/web-wallet-0.2.1 [0.2.0]: https://github.com/dusk-network/rusk/tree/web-wallet-0.2.0 diff --git a/web-wallet/README.md b/web-wallet/README.md index 1c4a749d54..59ff82ecd4 100644 --- a/web-wallet/README.md +++ b/web-wallet/README.md @@ -4,12 +4,12 @@ Web Wallet website. ## TOC -- [Web Wallet](#web-wallet) - - [TOC](#toc) - - [Build system and dev environment](#build-system-and-dev-environment) - - [Environment variables](#environment-variables) - - [NPM scripts](#npm-scripts) - - [Running a local Rusk node](#running-a-local-rusk-node) +- [Web Wallet](#web-wallet) + - [TOC](#toc) + - [Build system and dev environment](#build-system-and-dev-environment) + - [Environment variables](#environment-variables) + - [NPM scripts](#npm-scripts) + - [Running a local Rusk node](#running-a-local-rusk-node) ## Build system and dev environment @@ -23,6 +23,7 @@ As the application uses the [Web Crypto API](https://developer.mozilla.org/en-US The staging environment is at https://web-wallet-staging-oxs3z.ondigitalocean.app/ ## Environment variables + The `dusk-wallet-js` library uses some [environment variables](https://github.com/dusk-network/dusk-wallet-js/blob/main/.env). The application defines these variables by reading a local `.env` file containing the same variables used in the `dusk-wallet-js`, with the addition of the `VITE_` prefix. @@ -53,19 +54,19 @@ To run a local node different steps are needed, so please read the [related sect ## NPM scripts -- `npm run build` generates the production build -- `npm run checks` runs all checks (lint, typecheck and test) -- `npm run dev` generates the development build and starts the dev server -- `npm run dev:host` generates the development build, starts the dev server and exposes it to the local network -- `npm run lint`: performs the linting checks -- `npm run lint:fix`: runs ESLint with the `--fix` flag to fix formatting errors -- `npm run preview` previews the production build -- `npm test` runs the test suite -- `npm run test:coverage` runs the test suite and generate the code coverage report in the `coverage` folder -- `npm run test:watch` runs the test suite in watch mode -- `npm run typecheck` runs the type checker -- `npm run typecheck:watch` runs the type checker in watch mode +- `npm run build` generates the production build +- `npm run checks` runs all checks (lint, typecheck and test) +- `npm run dev` generates the development build and starts the dev server +- `npm run dev:host` generates the development build, starts the dev server and exposes it to the local network +- `npm run lint`: performs the linting checks +- `npm run lint:fix`: runs ESLint with the `--fix` flag to fix formatting errors +- `npm run preview` previews the production build +- `npm test` runs the test suite +- `npm run test:coverage` runs the test suite and generate the code coverage report in the `coverage` folder +- `npm run test:watch` runs the test suite in watch mode +- `npm run typecheck` runs the type checker +- `npm run typecheck:watch` runs the type checker in watch mode ## Running a local Rusk node -To run a local node, follow the instructions outlined in the [Rusk's readme](https://github.com/dusk-network/rusk). \ No newline at end of file +To run a local node, follow the instructions outlined in the [Rusk's readme](https://github.com/dusk-network/rusk). diff --git a/web-wallet/__mocks__/Wallet.js b/web-wallet/__mocks__/Wallet.js index 96c610d579..338ead1e6e 100644 --- a/web-wallet/__mocks__/Wallet.js +++ b/web-wallet/__mocks__/Wallet.js @@ -1,5 +1,5 @@ class Wallet { - constructor (seed, gasLimit = 2900000000, gasPrice = 1) { + constructor(seed, gasLimit = 2900000000, gasPrice = 1) { this.gasLimit = gasLimit; this.gasPrice = gasPrice; this.seed = seed; @@ -11,17 +11,17 @@ class Wallet { seed; wasm; - async history () {} - async getBalance () {} - async getPsks () {} - async stake () {} - async stakeAllow () {} - async stakeInfo () {} - async reset () {} - async sync () {} - async transfer () {} - async unstake () {} - async withdrawReward () {} + async history() {} + async getBalance() {} + async getPsks() {} + async stake() {} + async stakeAllow() {} + async stakeInfo() {} + async reset() {} + async sync() {} + async transfer() {} + async unstake() {} + async withdrawReward() {} } export default Wallet; diff --git a/web-wallet/jsconfig.json b/web-wallet/jsconfig.json index 0f45dc0b32..902fa25d46 100644 --- a/web-wallet/jsconfig.json +++ b/web-wallet/jsconfig.json @@ -14,8 +14,6 @@ "$lib": ["./src/lib"], "$lib/*": ["./src/lib/*"] }, - "types": [ - "./node_modules/@testing-library/jest-dom/types/vitest.d.ts" - ] + "types": ["./node_modules/@testing-library/jest-dom/types/vitest.d.ts"] } } diff --git a/web-wallet/package-lock.json b/web-wallet/package-lock.json index 483cd1eb08..73c5dcbf93 100644 --- a/web-wallet/package-lock.json +++ b/web-wallet/package-lock.json @@ -20,7 +20,8 @@ "svelte-persisted-store": "0.7.0" }, "devDependencies": { - "@dusk-network/eslint-config": "2.1.0", + "@dusk-network/eslint-config": "3.0.2", + "@dusk-network/prettier-config": "1.0.0", "@sveltejs/adapter-static": "2.0.3", "@sveltejs/kit": "1.27.6", "@testing-library/jest-dom": "6.1.4", @@ -30,7 +31,7 @@ "@vitest/coverage-v8": "0.34.6", "@zerodevx/svelte-toast": "^0.9.5", "autoprefixer": "10.4.16", - "eslint": "8.54.0", + "eslint": "8.57.0", "eslint-import-resolver-custom-alias": "1.3.2", "eslint-plugin-svelte": "2.35.1", "jsdom": "23.0.0", @@ -282,19 +283,32 @@ } }, "node_modules/@dusk-network/eslint-config": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@dusk-network/eslint-config/-/eslint-config-2.1.0.tgz", - "integrity": "sha512-A9qT+pg0MFJnWFZtQOBK2jdIyufg1nxPSxuFHThGJN+yqRSYV3GYQA7HkfkSJLGHSqxgfqhKz/FTYNzSjoJWhw==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@dusk-network/eslint-config/-/eslint-config-3.0.2.tgz", + "integrity": "sha512-e2CpuIH3/bcYZ5ViSG6rcYTRXrImWCqYoS5oJZODDPWVssbehefmffIw8VyDhA4uQcj9K01EK6fmetOoq/IKsQ==", "dev": true, "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" }, "optionalDependencies": { - "eslint-plugin-svelte": ">=2.31.0" + "eslint-plugin-svelte": ">=2.35.1" }, "peerDependencies": { - "eslint": ">=8.0.0", - "eslint-plugin-import": ">=2.0.0" + "eslint": ">=8.56.0", + "eslint-config-prettier": ">=9.1.0", + "eslint-plugin-import": ">=2.29.1" + } + }, + "node_modules/@dusk-network/prettier-config": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@dusk-network/prettier-config/-/prettier-config-1.0.0.tgz", + "integrity": "sha512-tEmXgJ1MFqz6W0cTPq5o8TLBZBmAUeJM56gWh/0Ssh7Ol2uc1qXtB/EhylPagBPcbCwcR67XCteELQ12aFvgDw==", + "dev": true, + "engines": { + "node": ">=16.0.0" + }, + "optionalDependencies": { + "prettier-plugin-svelte": ">=3.2.1" } }, "node_modules/@esbuild/android-arm": { @@ -697,9 +711,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.54.0.tgz", - "integrity": "sha512-ut5V+D+fOoWPgGGNj83GGjnntO39xDy6DWxO0wb7Jp3DcMX0TfIqdzHF85VTQkerdyGmuuMD9AKAo5KiNlf/AQ==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -2880,16 +2894,16 @@ } }, "node_modules/eslint": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.54.0.tgz", - "integrity": "sha512-NY0DfAkM8BIZDVl6PgSa1ttZbx3xHgJzSNJKYcQglem6CppHyMhRIQkBVSSMaSRnLhig3jsDbEzOjwCVt4AmmA==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.3", - "@eslint/js": "8.54.0", - "@humanwhocodes/config-array": "^0.11.13", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "@ungap/structured-clone": "^1.2.0", @@ -2946,6 +2960,19 @@ "eslint": ">=6.0.0" } }, + "node_modules/eslint-config-prettier": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", + "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", + "dev": true, + "peer": true, + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, "node_modules/eslint-import-resolver-custom-alias": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/eslint-import-resolver-custom-alias/-/eslint-import-resolver-custom-alias-1.3.2.tgz", @@ -5443,6 +5470,34 @@ "node": ">= 0.8.0" } }, + "node_modules/prettier": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "dev": true, + "optional": true, + "peer": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-plugin-svelte": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/prettier-plugin-svelte/-/prettier-plugin-svelte-3.2.1.tgz", + "integrity": "sha512-ENAPbIxASf2R79IZwgkG5sBdeNA9kLRlXVvKKmTXh79zWTy0KKoT86XO2pHrTitUPINd+iXWy12MRmgzKGVckA==", + "dev": true, + "optional": true, + "peerDependencies": { + "prettier": "^3.0.0", + "svelte": "^3.2.0 || ^4.0.0-next.0 || ^5.0.0-next.0" + } + }, "node_modules/pretty-format": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", diff --git a/web-wallet/package.json b/web-wallet/package.json index 99578ce0a2..94e1f1910f 100644 --- a/web-wallet/package.json +++ b/web-wallet/package.json @@ -18,9 +18,11 @@ }, "scripts": { "build": "vite build", - "checks": "npm run lint && npm run typecheck && npm test", + "checks": "npm run format && npm run lint && npm run typecheck && npm test", "dev": "vite dev", "dev:host": "vite dev --host", + "format": "prettier . --check", + "format:fix": "prettier . --write", "lint": "eslint .", "lint:fix": "eslint . --fix", "preview": "vite preview", @@ -44,7 +46,8 @@ "svelte-persisted-store": "0.7.0" }, "devDependencies": { - "@dusk-network/eslint-config": "2.1.0", + "@dusk-network/eslint-config": "3.0.2", + "@dusk-network/prettier-config": "1.0.0", "@sveltejs/adapter-static": "2.0.3", "@sveltejs/kit": "1.27.6", "@testing-library/jest-dom": "6.1.4", @@ -54,7 +57,7 @@ "@vitest/coverage-v8": "0.34.6", "@zerodevx/svelte-toast": "^0.9.5", "autoprefixer": "10.4.16", - "eslint": "8.54.0", + "eslint": "8.57.0", "eslint-import-resolver-custom-alias": "1.3.2", "eslint-plugin-svelte": "2.35.1", "jsdom": "23.0.0", diff --git a/web-wallet/src/app.html b/web-wallet/src/app.html index bb6bc7f624..961f8c05dd 100644 --- a/web-wallet/src/app.html +++ b/web-wallet/src/app.html @@ -1,14 +1,25 @@ - + Dusk Web Wallet - v%sveltekit.env.PUBLIC_APP_VERSION% - - - - + + + + %sveltekit.head% - +
%sveltekit.body%
diff --git a/web-wallet/src/env.d.ts b/web-wallet/src/env.d.ts index 14218c023e..26127e98ce 100644 --- a/web-wallet/src/env.d.ts +++ b/web-wallet/src/env.d.ts @@ -1,3 +1,3 @@ declare const CONFIG: { - LOCAL_STORAGE_APP_KEY: string + LOCAL_STORAGE_APP_KEY: string; }; diff --git a/web-wallet/src/error.html b/web-wallet/src/error.html index ccbc754e74..f4b656c508 100644 --- a/web-wallet/src/error.html +++ b/web-wallet/src/error.html @@ -1,12 +1,12 @@ - + - - - %sveltekit.error.message% - - -

Error

-

Status: %sveltekit.status%

-

Message: %sveltekit.error.message%

- + + + %sveltekit.error.message% + + +

Error

+

Status: %sveltekit.status%

+

Message: %sveltekit.error.message%

+ diff --git a/web-wallet/src/lamb.d.ts b/web-wallet/src/lamb.d.ts index 5f2c390f24..ac7e625f3f 100644 --- a/web-wallet/src/lamb.d.ts +++ b/web-wallet/src/lamb.d.ts @@ -8,19 +8,19 @@ declare module "lamb" { type FoldAccumulatorCallback< L extends ArrayLike, R, - I extends keyof L & number = any + I extends keyof L & number = any, > = (result: R, current: L[I], idx: I, list: L) => R; type ListIteratorCallback< L extends ArrayLike, R, - I extends keyof L & number = any + I extends keyof L & number = any, > = (element: L[I], idx: I, list: L) => R; type ObjectIteratorCallback< S extends Record, R, - K extends keyof S & string = any + K extends keyof S & string = any, > = (value: S[K], key: K, source: S) => R; type Ord = Number | number | String | string | Boolean | boolean | Date; @@ -28,8 +28,8 @@ declare module "lamb" { /** @see https://dev.to/ecyrbe/how-to-use-advanced-typescript-to-define-a-pipe-function-381h */ type PipeArgs< Fns extends AnyFunction[], - AccFns extends AnyFunction[] = [] - > = Fns extends [(...args: infer A) => infer B] + AccFns extends AnyFunction[] = [], + > = Fns extends [(...args: infer A) => infer B] ? [...AccFns, (...args: A) => B] : Fns extends [(...args: infer A) => any, ...infer Tail] ? Tail extends [(arg: infer B) => any, ...any[]] @@ -39,7 +39,7 @@ declare module "lamb" { type PipeArgsLastReturnType< Fns extends AnyFunction[], - Else = never + Else = never, > = Fns extends [...any[], (...args: any) => infer R] ? R : Else; type Predicate = (v: T) => v is U; @@ -47,7 +47,7 @@ declare module "lamb" { type ReduceAccumulatorCallback< T, L extends ArrayLike, - I extends keyof L & number = any + I extends keyof L & number = any, > = (prev: T, current: L[I], idx: I, list: L) => T; type Sorter = { @@ -65,338 +65,341 @@ declare module "lamb" { * ***** ARRAY ***** * * ------------------------- */ - function append (value: T): (arrayLike: ArrayLike) => Array; + function append(value: T): (arrayLike: ArrayLike) => Array; - function appendTo (arrayLike: ArrayLike, value: T): Array; + function appendTo(arrayLike: ArrayLike, value: T): Array; - function contains (value: T): (arrayLike: ArrayLike) => boolean; + function contains(value: T): (arrayLike: ArrayLike) => boolean; function count< R extends string, L extends ArrayLike, - F extends ListIteratorCallback - > (arrayLike: L, iteratee: F): Record; + F extends ListIteratorCallback, + >(arrayLike: L, iteratee: F): Record; function countBy< R extends string, L extends ArrayLike, - F extends ListIteratorCallback - > (iteratee: F): (arrayLike: L) => Record; + F extends ListIteratorCallback, + >(iteratee: F): (arrayLike: L) => Record; - function difference (a: ArrayLike, b: ArrayLike): Array; + function difference(a: ArrayLike, b: ArrayLike): Array; - function drop (n: number): (arrayLike: ArrayLike) => Array; + function drop(n: number): (arrayLike: ArrayLike) => Array; - function dropFrom (arrayLike: ArrayLike, n: number): Array; + function dropFrom(arrayLike: ArrayLike, n: number): Array; function dropLastWhile< T, L extends ArrayLike, - P extends ListIteratorCallback - > (predicate: P): (arrayLike: L) => Array; + P extends ListIteratorCallback, + >(predicate: P): (arrayLike: L) => Array; function dropWhile< T, L extends ArrayLike, - P extends ListIteratorCallback - > (predicate: P): (arrayLike: L) => Array; + P extends ListIteratorCallback, + >(predicate: P): (arrayLike: L) => Array; function every< T, L extends ArrayLike, - P extends ListIteratorCallback - > (predicate: P): (arrayLike: L) => boolean; + P extends ListIteratorCallback, + >(predicate: P): (arrayLike: L) => boolean; function everyIn< T, L extends ArrayLike, - P extends ListIteratorCallback - > (arrayLike: L, predicate: P): boolean; + P extends ListIteratorCallback, + >(arrayLike: L, predicate: P): boolean; function filter< T, L extends ArrayLike, - P extends ListIteratorCallback - > (arrayLike: L, predicate: P): Array; + P extends ListIteratorCallback, + >(arrayLike: L, predicate: P): Array; function filterWith< T, L extends ArrayLike, - P extends ListIteratorCallback - > (predicate: P): (arrayLike: L) => Array; + P extends ListIteratorCallback, + >(predicate: P): (arrayLike: L) => Array; function find< T, L extends ArrayLike, - P extends ListIteratorCallback - > (arrayLike: L, predicate: P): T | undefined; + P extends ListIteratorCallback, + >(arrayLike: L, predicate: P): T | undefined; function findIndex< T, L extends ArrayLike, - P extends ListIteratorCallback - > (arrayLike: L, predicate: P): number; + P extends ListIteratorCallback, + >(arrayLike: L, predicate: P): number; function findIndexWhere< T, L extends ArrayLike, - P extends ListIteratorCallback - > (predicate: P): (arrayLike: L) => number; + P extends ListIteratorCallback, + >(predicate: P): (arrayLike: L) => number; function findLast< T, L extends ArrayLike, - P extends ListIteratorCallback - > (arrayLike: L, predicate: P): T | undefined; + P extends ListIteratorCallback, + >(arrayLike: L, predicate: P): T | undefined; function findLastIndex< T, L extends ArrayLike, - P extends ListIteratorCallback - > (arrayLike: L, predicate: P): number; + P extends ListIteratorCallback, + >(arrayLike: L, predicate: P): number; function findLastIndexWhere< T, L extends ArrayLike, - P extends ListIteratorCallback - > (predicate: P): (arrayLike: L) => number; + P extends ListIteratorCallback, + >(predicate: P): (arrayLike: L) => number; function findLastWhere< T, L extends ArrayLike, - P extends ListIteratorCallback - > (predicate: P): (arrayLike: L) => T | undefined; + P extends ListIteratorCallback, + >(predicate: P): (arrayLike: L) => T | undefined; function findWhere< T, L extends ArrayLike, - P extends ListIteratorCallback - > (predicate: P): (arrayLike: L) => T | undefined; + P extends ListIteratorCallback, + >(predicate: P): (arrayLike: L) => T | undefined; function flatMap< T extends any | any[], R, A extends Array, - F extends ListIteratorCallback - > (array: A, iteratee: F): Array; + F extends ListIteratorCallback, + >(array: A, iteratee: F): Array; function flatMapWith< T extends any | any[], R, A extends Array, - F extends ListIteratorCallback - > (iteratee: F): (array: A) => Array; + F extends ListIteratorCallback, + >(iteratee: F): (array: A) => Array; - function flatten< - T, - U extends T | T[], - A extends Array - > (array: A): Array; + function flatten>( + array: A + ): Array; - function getAt (index: number): (arrayLike: ArrayLike) => T | undefined; + function getAt( + index: number + ): (arrayLike: ArrayLike) => T | undefined; - function getIndex (arrayLike: ArrayLike, index: number): T | undefined; + function getIndex(arrayLike: ArrayLike, index: number): T | undefined; function group< T extends Record, V extends T[keyof T], L extends ArrayLike, - F extends ListIteratorCallback - > (arrayLike: L, iteratee: F): Record>; + F extends ListIteratorCallback, + >(arrayLike: L, iteratee: F): Record>; function groupBy< T extends Record, V extends T[keyof T], L extends ArrayLike, F extends ListIteratorCallback, - > (iteratee: F): (arrayLike: L) => Record>; + >(iteratee: F): (arrayLike: L) => Record>; - function head> (arrayLike: L): L["length"] extends 0 ? undefined : L[0]; + function head>( + arrayLike: L + ): L["length"] extends 0 ? undefined : L[0]; function index< T extends Record, V extends T[keyof T], L extends ArrayLike, - F extends ListIteratorCallback - > (arrayLike: L, iteratee: F): Record; + F extends ListIteratorCallback, + >(arrayLike: L, iteratee: F): Record; function indexBy< T extends Record, V extends T[keyof T], L extends ArrayLike, - F extends ListIteratorCallback - > (iteratee: F): (arrayLike: L) => Record; + F extends ListIteratorCallback, + >(iteratee: F): (arrayLike: L) => Record; - function init (arrayLike: ArrayLike): Array; + function init(arrayLike: ArrayLike): Array; - function insert (arrayLike: ArrayLike, index: number, element: T): Array; + function insert( + arrayLike: ArrayLike, + index: number, + element: T + ): Array; - function insertAt (index: number, element: T): (arrayLike: ArrayLike) => Array; + function insertAt( + index: number, + element: T + ): (arrayLike: ArrayLike) => Array; - function intersection (a: ArrayLike, b: ArrayLike): Array; + function intersection(a: ArrayLike, b: ArrayLike): Array; - function isIn (arrayLike: ArrayLike, value: T): boolean; + function isIn(arrayLike: ArrayLike, value: T): boolean; - function join (arrayLike: ArrayLike, separator: string): string; + function join(arrayLike: ArrayLike, separator: string): string; - function joinWith (separator: string): (arrayLike: ArrayLike) => string; + function joinWith( + separator: string + ): (arrayLike: ArrayLike) => string; - function last> (arrayLike: L): L["length"] extends 0 ? undefined : L[-1]; + function last>( + arrayLike: L + ): L["length"] extends 0 ? undefined : L[-1]; - function list (...values: T[]): Array; + function list(...values: T[]): Array; - function map< - T, - L extends ArrayLike, - R - > (arrayLike: L, iteratee: ListIteratorCallback): Array; + function map, R>( + arrayLike: L, + iteratee: ListIteratorCallback + ): Array; - function mapWith< - T, - L extends ArrayLike, - R - > (iteratee: ListIteratorCallback): (arrayLike: L) => Array; + function mapWith, R>( + iteratee: ListIteratorCallback + ): (arrayLike: L) => Array; function partition< T, L extends ArrayLike, - P extends ListIteratorCallback - > (arrayLike: L, predicate: P): [Array, Array]; + P extends ListIteratorCallback, + >(arrayLike: L, predicate: P): [Array, Array]; function partitionWith< T, L extends ArrayLike, - P extends ListIteratorCallback - > (predicate: P): (arrayLike: L) => [Array, Array]; + P extends ListIteratorCallback, + >(predicate: P): (arrayLike: L) => [Array, Array]; - function pluck< - T, - U extends Record, - K extends keyof U - > (key: K): (arrayLike: ArrayLike) => Array; + function pluck, K extends keyof U>( + key: K + ): (arrayLike: ArrayLike) => Array; - function pluckFrom< - T, - U extends Record, - K extends keyof U - > (arrayLike: ArrayLike, key: K): Array; + function pluckFrom, K extends keyof U>( + arrayLike: ArrayLike, + key: K + ): Array; - function pullFrom< - T, - L extends ArrayLike, - V extends ArrayLike - > (arrayLike: L, values: V): Array; + function pullFrom, V extends ArrayLike>( + arrayLike: L, + values: V + ): Array; - function pull< - T, - L extends ArrayLike, - V extends ArrayLike - > (values: V): (arrayLike: L) => Array; + function pull, V extends ArrayLike>( + values: V + ): (arrayLike: L) => Array; function reduceRight< T, L extends ArrayLike, - Acc extends ReduceAccumulatorCallback - > (arrayLike: L, accumulator: Acc): T; + Acc extends ReduceAccumulatorCallback, + >(arrayLike: L, accumulator: Acc): T; function reduceRight< R, L extends ArrayLike, - Acc extends FoldAccumulatorCallback - > (arrayLike: L, accumulator: Acc, initialValue: R): R; + Acc extends FoldAccumulatorCallback, + >(arrayLike: L, accumulator: Acc, initialValue: R): R; function reduceRightWith< T, L extends ArrayLike, - Acc extends ReduceAccumulatorCallback - > (accumulator: Acc): (arrayLike: L) => T; + Acc extends ReduceAccumulatorCallback, + >(accumulator: Acc): (arrayLike: L) => T; function reduceRightWith< R, L extends ArrayLike, - Acc extends FoldAccumulatorCallback - > (accumulator: Acc, initialValue: R): (list: L) => R; + Acc extends FoldAccumulatorCallback, + >(accumulator: Acc, initialValue: R): (list: L) => R; - function reverse< - T, - L extends ArrayLike - > (arrayLike: L): Array; + function reverse>(arrayLike: L): Array; - function rotate< - T, - L extends ArrayLike - > (arrayLike: L, amount: number): Array; + function rotate>( + arrayLike: L, + amount: number + ): Array; - function rotateBy< - T, - L extends ArrayLike - > (amount: number): (arrayLike: L) => Array; + function rotateBy>( + amount: number + ): (arrayLike: L) => Array; - function setAt< - T, - L extends ArrayLike - > (index: number, value: T): (arrayLike: L) => Array; + function setAt>( + index: number, + value: T + ): (arrayLike: L) => Array; - function setIndex< - T, - L extends ArrayLike - > (arrayLike: L, index: number, value: T): Array; + function setIndex>( + arrayLike: L, + index: number, + value: T + ): Array; - function shallowFlatten< - T, - U extends T | T[] - > (array: Array): Array; + function shallowFlatten(array: Array): Array; function some< T, L extends ArrayLike, - P extends ListIteratorCallback - > (predicate: P): (arrayLike: L) => boolean; + P extends ListIteratorCallback, + >(predicate: P): (arrayLike: L) => boolean; function someIn< T, L extends ArrayLike, - P extends ListIteratorCallback - > (arrayLike: L, predicate: P): boolean; + P extends ListIteratorCallback, + >(arrayLike: L, predicate: P): boolean; function sort< T, L extends ArrayLike, - S extends Array | SorterReader> = [Sorter] - > (arrayLike: L, sorters?: S): Array; + S extends Array | SorterReader> = [ + Sorter, + ], + >(arrayLike: L, sorters?: S): Array; function sortedInsert< T, L extends ArrayLike, - S extends Array | SorterReader> = [Sorter] - > (arrayLike: L, element: T, sorters?: S): Array; + S extends Array | SorterReader> = [ + Sorter, + ], + >(arrayLike: L, element: T, sorters?: S): Array; - function sorter< - T, - RD extends SorterReader = (value: T) => T, - > (reader?: RD, comparer?: SorterComparer): Sorter; + function sorter = (value: T) => T>( + reader?: RD, + comparer?: SorterComparer + ): Sorter; - function sorterDesc< - T, - RD extends SorterReader = (value: T) => T, - > (reader?: RD, comparer?: SorterComparer): Sorter; + function sorterDesc = (value: T) => T>( + reader?: RD, + comparer?: SorterComparer + ): Sorter; function sortWith< T, L extends ArrayLike, - S extends Array | SorterReader> = [Sorter] - > (sorters?: S): (arrayLike: L) => Array; + S extends Array | SorterReader> = [ + Sorter, + ], + >(sorters?: S): (arrayLike: L) => Array; - function take< - T, - L extends ArrayLike - > (amount: number): (arrayLike: L) => Array; + function take>( + amount: number + ): (arrayLike: L) => Array; - function uniques (arrayLike: ArrayLike): Array; + function uniques(arrayLike: ArrayLike): Array; function uniquesBy< T, L extends ArrayLike, - F extends ListIteratorCallback - > (iteratee: F): (arrayLike: L) => Array; + F extends ListIteratorCallback, + >(iteratee: F): (arrayLike: L) => Array; /* ------------------------- * * ***** CORE ***** * @@ -404,69 +407,71 @@ declare module "lamb" { type __ = {}; - function always (value: T): (...args: unknown[]) => T; + function always(value: T): (...args: unknown[]) => T; - function areSVZ (a: any, b: any): boolean; + function areSVZ(a: any, b: any): boolean; - function binary< - A, - B, - R, - F extends (...args: [A, B, ...any[]]) => R - > (fn: F): (a: A, b: B) => R; - - function clamp (n: number, min: number, max: number): number; - - function clampWithin (min: number, max: number): (n: number) => number; - - function compose< - A, - B, - C - > (f: UnaryFunction, g: UnaryFunction): (value: A) => C; - function compose< - A extends any[], - B, - C - > (f: UnaryFunction, g: (...args: A) => B): (...values: A) => C; - - function partial< - Args extends (any | __)[], - F extends AnyFunction - > (fn: F, args: Args): (...args: any[]) => ReturnType; - - function partialRight< - Args extends (any | __)[], - F extends AnyFunction - > (fn: F, args: Args): (...args: any[]) => ReturnType; + function binary R>( + fn: F + ): (a: A, b: B) => R; + + function clamp(n: number, min: number, max: number): number; + + function clampWithin(min: number, max: number): (n: number) => number; + + function compose( + f: UnaryFunction, + g: UnaryFunction + ): (value: A) => C; + function compose( + f: UnaryFunction, + g: (...args: A) => B + ): (...values: A) => C; + + function partial( + fn: F, + args: Args + ): (...args: any[]) => ReturnType; + + function partialRight( + fn: F, + args: Args + ): (...args: any[]) => ReturnType; function reduce< T, L extends ArrayLike, - Acc extends ReduceAccumulatorCallback - > (arrayLike: L, accumulator: Acc): T; + Acc extends ReduceAccumulatorCallback, + >(arrayLike: L, accumulator: Acc): T; function reduce< R, L extends ArrayLike, - Acc extends FoldAccumulatorCallback - > (arrayLike: L, accumulator: Acc, initialValue: R): R; + Acc extends FoldAccumulatorCallback, + >(arrayLike: L, accumulator: Acc, initialValue: R): R; function reduceWith< T, L extends ArrayLike, - Acc extends ReduceAccumulatorCallback - > (accumulator: Acc): (arrayLike: L) => T; + Acc extends ReduceAccumulatorCallback, + >(accumulator: Acc): (arrayLike: L) => T; function reduceWith< R, L extends ArrayLike, - Acc extends FoldAccumulatorCallback - > (accumulator: Acc, initialValue: R): (list: L) => R; + Acc extends FoldAccumulatorCallback, + >(accumulator: Acc, initialValue: R): (list: L) => R; - function slice (arrayLike: ArrayLike, start: number, end: number): Array; + function slice( + arrayLike: ArrayLike, + start: number, + end: number + ): Array; - function sliceAt (start: number, end: number): (arrayLike: ArrayLike) => Array; + function sliceAt( + start: number, + end: number + ): (arrayLike: ArrayLike) => Array; - function type (value: any): string; + function type(value: any): string; /* ------------------------- * * ***** FUNCTION ***** * @@ -476,90 +481,91 @@ declare module "lamb" { T, Args extends any[], Fns extends Array<(...args: Args) => T>, - > (functions: Fns): (...args: Args) => T[]; - - function invokeOn< - TG extends Object - > (target: TG): (method: M, ...args: any[]) => M extends keyof TG + >(functions: Fns): (...args: Args) => T[]; + + function invokeOn( + target: TG + ): ( + method: M, + ...args: any[] + ) => M extends keyof TG ? TG[M] extends AnyFunction ? ReturnType : never : undefined; - function pipe (functions: []): (...args: Args) => Args["length"] extends 0 ? undefined : typeof args[0]; + function pipe( + functions: [] + ): ( + ...args: Args + ) => Args["length"] extends 0 ? undefined : (typeof args)[0]; function pipe< Fns extends AnyFunction[], Args extends Parameters, - R extends PipeArgsLastReturnType> - > (functions: PipeArgs extends Fns ? Fns : PipeArgs): (...args: Args) => R; + R extends PipeArgsLastReturnType>, + >( + functions: PipeArgs extends Fns ? Fns : PipeArgs + ): (...args: Args) => R; - function unary (fn: (a: T, ...args: any[]) => R): UnaryFunction; + function unary(fn: (a: T, ...args: any[]) => R): UnaryFunction; /* ------------------------- * * ***** LOGIC ***** * * ------------------------- */ - function allOf< - T, - P extends (value: T) => boolean - > (predicates: Array

): P; + function allOf boolean>(predicates: Array

): P; - function anyOf< - T, - P extends (value: T) => boolean - > (predicates: Array

): P; + function anyOf boolean>(predicates: Array

): P; - function condition< - T, - U extends T, - TR, - FR, - P extends Predicate - > (predicate: P, trueFn: (value: U) => TR, falseFn: (value: Exclude) => FR): (value: T) => U extends T ? TR : FR; + function condition>( + predicate: P, + trueFn: (value: U) => TR, + falseFn: (value: Exclude) => FR + ): (value: T) => U extends T ? TR : FR; - function gt (a: Ord, b: Ord): boolean; + function gt(a: Ord, b: Ord): boolean; - function gte (a: Ord, b: Ord): boolean; + function gte(a: Ord, b: Ord): boolean; - function lt (a: Ord, b: Ord): boolean; + function lt(a: Ord, b: Ord): boolean; - function lte (a: Ord, b: Ord): boolean; + function lte(a: Ord, b: Ord): boolean; - function isGT (b: Ord): (a: Ord) => boolean; + function isGT(b: Ord): (a: Ord) => boolean; - function isGTE (b: Ord): (a: Ord) => boolean; + function isGTE(b: Ord): (a: Ord) => boolean; - function isLT (b: Ord): (a: Ord) => boolean; + function isLT(b: Ord): (a: Ord) => boolean; - function isLTE (b: Ord): (a: Ord) => boolean; + function isLTE(b: Ord): (a: Ord) => boolean; function unless< R, T, U extends T, P extends Predicate, - F extends UnaryFunction, R> - > (predicate: P, fn: F): (value: T | U) => U extends T ? T : R; + F extends UnaryFunction, R>, + >(predicate: P, fn: F): (value: T | U) => U extends T ? T : R; function unless< R, T, P extends UnaryFunction, - F extends UnaryFunction - > (predicate: P, fn: F): (value: T) => ReturnType

extends true ? T : R; + F extends UnaryFunction, + >(predicate: P, fn: F): (value: T) => ReturnType

extends true ? T : R; function when< R, T, U extends T, P extends Predicate, - F extends UnaryFunction, R> - > (predicate: P, fn: F): (value: T | U) => U extends T ? T : T; + F extends UnaryFunction, R>, + >(predicate: P, fn: F): (value: T | U) => U extends T ? T : T; function when< R, T, P extends UnaryFunction, - F extends UnaryFunction - > (predicate: P, fn: F): (value: T) => ReturnType

extends true ? R : T; + F extends UnaryFunction, + >(predicate: P, fn: F): (value: T) => ReturnType

extends true ? R : T; /* ------------------------- * * ***** MATH ***** * @@ -571,99 +577,98 @@ declare module "lamb" { * ***** OBJECT ***** * * ------------------------- */ - function enumerables< - K extends PropertyKey, - S extends Record - > (source: S): Array; + function enumerables>( + source: S + ): Array; - function getKey< - K extends PropertyKey, - S extends Record - > (key: K): (source: S) => K extends keyof S ? S[K] : undefined; + function getKey>( + key: K + ): (source: S) => K extends keyof S ? S[K] : undefined; - function getPath< - T, - S extends Record - > (path: string, separator?: string): (source: S) => T | undefined; + function getPath>( + path: string, + separator?: string + ): (source: S) => T | undefined; - function getPathIn< - T, - S extends Record - > (source: S, path: string, separator?: string): T | undefined; + function getPathIn>( + source: S, + path: string, + separator?: string + ): T | undefined; - function hasKeyValue< - K extends PropertyKey, - T, - S extends Record - > (key: K, value: T): (source: S) => boolean; + function hasKeyValue>( + key: K, + value: T + ): (source: S) => boolean; - function hasPathValue< - T, - S extends Record - > (path: string, value: T): (source: S) => boolean; + function hasPathValue>( + path: string, + value: T + ): (source: S) => boolean; - function keys, K extends keyof S> (source: S): Array; + function keys, K extends keyof S>( + source: S + ): Array; function mapValues< T, U, S extends Record, - F extends ObjectIteratorCallback - > (source: S, fn: F): Record; + F extends ObjectIteratorCallback, + >(source: S, fn: F): Record; function mapValuesWith< T, U, S extends Record, - F extends ObjectIteratorCallback - > (fn: F): (source: S) => Record; + F extends ObjectIteratorCallback, + >(fn: F): (source: S) => Record; function ownPairs< S extends Record, - K extends keyof S & string - > (source: S): Array<[K, S[K]]>; + K extends keyof S & string, + >(source: S): Array<[K, S[K]]>; - function pick< - S extends Record, - K extends string - > (whitelist: K[]): (source: S) => Pick; + function pick, K extends string>( + whitelist: K[] + ): (source: S) => Pick; function pickIf< S extends Record, - P extends ObjectIteratorCallback - > (predicate: P): (source: S) => Partial; + P extends ObjectIteratorCallback, + >(predicate: P): (source: S) => Partial; - function pickIn< - S extends Record, - K extends string - > (source: S, whitelist: K[]): Pick; + function pickIn, K extends string>( + source: S, + whitelist: K[] + ): Pick; function rename< DK extends string, KM extends Record, - S extends Record - > (keyMap: KM): (source: S) => { [K in keyof S as K extends keyof KM ? KM[K] : K]: S[K] }; + S extends Record, + >( + keyMap: KM + ): (source: S) => {[K in keyof S as K extends keyof KM ? KM[K] : K]: S[K]}; - function setKey< - S extends Record, - T, - K extends string - > (key: K, value: T): (source: S) => S & { [k in K]: T }; + function setKey, T, K extends string>( + key: K, + value: T + ): (source: S) => S & {[k in K]: T}; - function skip< - S extends Record, - K extends string - > (blacklist: K[]): (source: S) => Omit; + function skip, K extends string>( + blacklist: K[] + ): (source: S) => Omit; function skipIf< S extends Record, - P extends ObjectIteratorCallback - > (predicate: P): (source: S) => Partial; + P extends ObjectIteratorCallback, + >(predicate: P): (source: S) => Partial; - function skipIn< - S extends Record, - K extends string - > (source: S, blacklist: K[]): Omit; + function skipIn, K extends string>( + source: S, + blacklist: K[] + ): Omit; /* ------------------------- * * ***** PRIVATES ***** * @@ -677,11 +682,11 @@ declare module "lamb" { * ***** TYPE ***** * * ------------------------- */ - function isNil (value: any): value is null | undefined; + function isNil(value: any): value is null | undefined; - function isNull (value: any): value is null; + function isNull(value: any): value is null; - function isUndefined (value: any): value is undefined; + function isUndefined(value: any): value is undefined; - function isType (typeName: string): Predicate; + function isType(typeName: string): Predicate; } diff --git a/web-wallet/src/lib/components/AddressPicker/AddressPicker.css b/web-wallet/src/lib/components/AddressPicker/AddressPicker.css index 4d7cc9adef..79a6d67bdf 100644 --- a/web-wallet/src/lib/components/AddressPicker/AddressPicker.css +++ b/web-wallet/src/lib/components/AddressPicker/AddressPicker.css @@ -1,103 +1,105 @@ .address-picker { - position: relative; - background-color: var(--surface-color); - padding: 1em; - border-radius: 1.25rem; - user-select: none; - z-index: 2; + position: relative; + background-color: var(--surface-color); + padding: 1em; + border-radius: 1.25rem; + user-select: none; + z-index: 2; } .address-picker__current-address { - width: 100%; - text-align: center; - font-family: monospace; + width: 100%; + text-align: center; + font-family: monospace; } .address-picker__copy-address-button-wrapper { - background-color: var(--secondary-color); - border-radius: 50%; + background-color: var(--secondary-color); + border-radius: 50%; } .address-picker__copy-address-button { - aspect-ratio: 1/1; - width: 1.5em; + aspect-ratio: 1/1; + width: 1.5em; } .address-picker__copy-address-button:hover { - cursor: copy; + cursor: copy; } -.address-picker__copy-address-button, .address-picker__copy-address-button:hover { - color: var(--primary-color) !important; +.address-picker__copy-address-button, +.address-picker__copy-address-button:hover { + color: var(--primary-color) !important; } .address-picker__address { - max-width: 100%; - all: unset; + max-width: 100%; + all: unset; } -.address-picker__address:hover, .address-picker__address--selected { - color: var(--secondary-color); +.address-picker__address:hover, +.address-picker__address--selected { + color: var(--secondary-color); } .address-picker__address:hover { - cursor: pointer; + cursor: pointer; } .address-picker__trigger { - display: flex; - justify-content: center; - align-items: center; - gap: var(--default-gap); + display: flex; + justify-content: center; + align-items: center; + gap: var(--default-gap); } .address-picker__drop-down { - display: flex; - position: absolute; - top: 100%; - left: 0; - z-index: 2; + display: flex; + position: absolute; + top: 100%; + left: 0; + z-index: 2; - background-color: var(--surface-color); - padding: 0 1em 1em 1em; - border-bottom-left-radius: 1.25rem; - border-bottom-right-radius: 1.25rem; + background-color: var(--surface-color); + padding: 0 1em 1em 1em; + border-bottom-left-radius: 1.25rem; + border-bottom-right-radius: 1.25rem; - flex-direction: column; - gap: var(--default-gap); - align-items: center; - width: 100%; + flex-direction: column; + gap: var(--default-gap); + align-items: center; + width: 100%; } .address-picker__address-options { - overflow-y: auto; - width: 100%; - max-height: 20svh; + overflow-y: auto; + width: 100%; + max-height: 20svh; } .address-picker__address-option-button { - all: unset; - text-overflow: ellipsis; - overflow: hidden; - width: 100%; - display: block; - text-align: center; - padding: .5em 0; + all: unset; + text-overflow: ellipsis; + overflow: hidden; + width: 100%; + display: block; + text-align: center; + padding: 0.5em 0; } .address-picker__generating-address-wrapper { - display: flex; - flex-direction: row; - align-self: flex-start; - gap: var(--small-gap) + display: flex; + flex-direction: row; + align-self: flex-start; + gap: var(--small-gap); } .address-picker--expanded { - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; } .address-picker__generate-address-button { - text-align: left; - width: 100% + text-align: left; + width: 100%; } diff --git a/web-wallet/src/lib/components/AddressPicker/AddressPicker.svelte b/web-wallet/src/lib/components/AddressPicker/AddressPicker.svelte index 8322224a93..8b4fc12db7 100644 --- a/web-wallet/src/lib/components/AddressPicker/AddressPicker.svelte +++ b/web-wallet/src/lib/components/AddressPicker/AddressPicker.svelte @@ -1,16 +1,26 @@ - + {#if expanded} - + {/if}

- + class:address-picker--expanded={expanded} +>
- - + on:keydown={handleDropDownKeyDown} + > + + -

{middleEllipsis( - currentAddress, - calculateAdaptiveCharCount(screenWidth) - )}

+

+ {middleEllipsis( + currentAddress, + calculateAdaptiveCharCount(screenWidth) + )} +

+ }}>{address} {/each} -
+
{#if isAddingAddress}
- +

Generating Address

- + {:else}
{/if} diff --git a/web-wallet/src/lib/components/Balance/Balance.svelte b/web-wallet/src/lib/components/Balance/Balance.svelte index 2f2122c4fa..c607a4afd0 100644 --- a/web-wallet/src/lib/components/Balance/Balance.svelte +++ b/web-wallet/src/lib/components/Balance/Balance.svelte @@ -1,10 +1,10 @@ - + -
+

Your Balance:

@@ -60,5 +54,5 @@

{/if} - +
diff --git a/web-wallet/src/lib/components/ContractOperations/ContractOperations.svelte b/web-wallet/src/lib/components/ContractOperations/ContractOperations.svelte index 27c346b52e..6258cdab23 100644 --- a/web-wallet/src/lib/components/ContractOperations/ContractOperations.svelte +++ b/web-wallet/src/lib/components/ContractOperations/ContractOperations.svelte @@ -1,16 +1,16 @@ - + @@ -35,9 +35,11 @@ disabled={operation.disabled} icon={{ path: operationIcons[operation.id] ?? mdiHelpCircleOutline, - size: "normal" + size: "normal", + }} + on:click={() => { + dispatch("operationChange", operation.id); }} - on:click={() => { dispatch("operationChange", operation.id); }} text={operation.label} variant={operation.primary ? "secondary" : "tertiary"} /> @@ -49,7 +51,8 @@ .contract-operations { list-style-type: none; - &, &__operation { + &, + &__operation { width: 100%; } diff --git a/web-wallet/src/lib/components/ContractStatusesList/ContractStatusesList.svelte b/web-wallet/src/lib/components/ContractStatusesList/ContractStatusesList.svelte index c0fbd74f0d..f9a2a909dc 100644 --- a/web-wallet/src/lib/components/ContractStatusesList/ContractStatusesList.svelte +++ b/web-wallet/src/lib/components/ContractStatusesList/ContractStatusesList.svelte @@ -1,8 +1,8 @@ - +
- diff --git a/web-wallet/src/lib/components/GasSettings/GasSettings.svelte b/web-wallet/src/lib/components/GasSettings/GasSettings.svelte index 73f40b0c00..a2106f81f0 100644 --- a/web-wallet/src/lib/components/GasSettings/GasSettings.svelte +++ b/web-wallet/src/lib/components/GasSettings/GasSettings.svelte @@ -1,7 +1,7 @@
- + -
+
{address}
@@ -44,15 +47,17 @@ {#if !hideBackButton}
- +
+ : "dusk-mnemonic__validate-actions-wrapper"} + > {#if type === "authenticate" && enteredWordIndex.includes("")} handleKeyDownOnAuthenticateTextbox(e, currentIndex.toString())} + on:keydown={e => + handleKeyDownOnAuthenticateTextbox( + e, + currentIndex.toString() + )} maxlength={8} type="text" - bind:value={currentInput}/> + bind:value={currentInput} + /> {#if suggestions.length}
{#each suggestions as suggestion, index (`${suggestion}-${index}`)} @@ -153,7 +165,8 @@ variant="tertiary" text={suggestion} data-value={suggestion} - on:click={handleWordButtonClick}/> + on:click={handleWordButtonClick} + /> {/each}
{/if} @@ -163,9 +176,9 @@ variant="tertiary" text={word} data-value={word} - disabled={enteredWordIndex.includes(index.toString())} - on:click={(e) => handleWordButtonClick(e, index.toString())}/> + on:click={e => handleWordButtonClick(e, index.toString())} + /> {/each} {/if}
diff --git a/web-wallet/src/lib/dusk/components/ProgressBar/ProgressBar.svelte b/web-wallet/src/lib/dusk/components/ProgressBar/ProgressBar.svelte index 8ed1366d4d..0d004030c5 100644 --- a/web-wallet/src/lib/dusk/components/ProgressBar/ProgressBar.svelte +++ b/web-wallet/src/lib/dusk/components/ProgressBar/ProgressBar.svelte @@ -1,5 +1,4 @@ @@ -9,8 +8,8 @@ style={currentPercentage !== undefined ? `width: ${currentPercentage}%` : undefined} - class:dusk-progress-bar__filler--undetermined={currentPercentage - === undefined} + class:dusk-progress-bar__filler--undetermined={currentPercentage === + undefined} class="dusk-progress-bar__filler" /> diff --git a/web-wallet/src/lib/dusk/components/QrCode/QrCode.svelte b/web-wallet/src/lib/dusk/components/QrCode/QrCode.svelte index 268175c380..4d76b3c7ee 100644 --- a/web-wallet/src/lib/dusk/components/QrCode/QrCode.svelte +++ b/web-wallet/src/lib/dusk/components/QrCode/QrCode.svelte @@ -1,7 +1,7 @@ -
+
@@ -3147,9 +3148,10 @@ exports[`Create > should render the Existing Wallet notice step of the Create fl class="flex flex-col gap-1" >

- Logging in to a new wallet will overwrite the current local wallet cache, - meaning that when you log in again with the previous mnemonic/account - you will need to wait for the wallet to sync. + Logging in to a new wallet will overwrite the current local + wallet cache, meaning that when you log in again with the + previous mnemonic/account you will need to wait for the wallet + to sync.

should render the Terms of Service step of the Create flow if Terms & Privacy Policy - govern your use of our services, - including data handling and user responsibilities. - Your privacy and security are our top priorities. + govern your use of our services, including data handling and user + responsibilities. Your privacy and security are our top priorities.

} */ -const fireInput = (input, value) => fireEvent.input(input, { target: { value } }); +const fireInput = (input, value) => fireEvent.input(input, {target: {value}}); /** @param {HTMLElement} element */ -function asInput (element) { +function asInput(element) { // eslint-disable-next-line no-extra-parens return /** @type {HTMLInputElement} */ (element); } describe("Create", async () => { - const walletGetPsksSpy = vi.spyOn(Wallet.prototype, "getPsks").mockResolvedValue(addresses); - const mnemonic = "cart dad sail wreck robot grit combine noble rap farm slide sad"; - const mnemonicShuffled = ["grit", "wreck", "cart", "dad", "rap", - "sail", "robot", "combine", "noble", "slide", "sad", "farm"]; + const walletGetPsksSpy = vi + .spyOn(Wallet.prototype, "getPsks") + .mockResolvedValue(addresses); + const mnemonic = + "cart dad sail wreck robot grit combine noble rap farm slide sad"; + const mnemonicShuffled = [ + "grit", + "wreck", + "cart", + "dad", + "rap", + "sail", + "robot", + "combine", + "noble", + "slide", + "sad", + "farm", + ]; const pwd = "passwordpassword"; const seed = getSeedFromMnemonic(mnemonic); const userId = (await new Wallet(seed).getPsks())[0]; - const generateMnemonicSpy = vi.spyOn(bip39, "generateMnemonic").mockReturnValue(mnemonic); - const shuffleArraySpy = vi.spyOn(shuffleArray, "shuffleArray").mockReturnValue(mnemonicShuffled); + const generateMnemonicSpy = vi + .spyOn(bip39, "generateMnemonic") + .mockReturnValue(mnemonic); + const shuffleArraySpy = vi + .spyOn(shuffleArray, "shuffleArray") + .mockReturnValue(mnemonicShuffled); const getWalletSpy = vi.spyOn(walletService, "getWallet"); const gotoSpy = vi.spyOn(appNavigation, "goto"); const settingsResetSpy = vi.spyOn(settingsStore, "reset"); @@ -73,23 +85,23 @@ describe("Create", async () => { it("should render the Existing Wallet notice step of the Create flow if there is a userId saved in localStorage", () => { settingsStore.update(setKey("userId", userId)); - const { container } = render(Create); + const {container} = render(Create); expect(container.firstChild).toMatchSnapshot(); }); it("should render the Terms of Service step of the Create flow if there is no userId saved in localStorage", () => { - const { container } = render(Create); + const {container} = render(Create); expect(container.firstChild).toMatchSnapshot(); }); it("should render the `Securely store your seed phrase!` agreement step after the ToS", async () => { - const { container, getByRole } = render(Create); + const {container, getByRole} = render(Create); const mathRandomSpy = vi.spyOn(Math, "random").mockReturnValue(42); - await fireEvent.click(getByRole("button", { name: "Accept" })); + await fireEvent.click(getByRole("button", {name: "Accept"})); expect(container.firstChild).toMatchSnapshot(); @@ -97,13 +109,13 @@ describe("Create", async () => { }); it("should not allow the user proceed unless both agreement checks are selected on the `Securely store your seed phrase!` step", async () => { - const { getByRole, getAllByRole } = render(Create); + const {getByRole, getAllByRole} = render(Create); - await fireEvent.click(getByRole("button", { name: "Accept" })); + await fireEvent.click(getByRole("button", {name: "Accept"})); const firstCheckbox = getAllByRole("checkbox")[0]; const secondCheckbox = getAllByRole("checkbox")[1]; - const nextButton = getByRole("button", { name: "Next" }); + const nextButton = getByRole("button", {name: "Next"}); // Select the first checkbox await fireEvent.click(firstCheckbox); @@ -118,7 +130,7 @@ describe("Create", async () => { await fireEvent.click(secondCheckbox); // Ensure Next is disabled - expect(getByRole("button", { name: "Next" })).toBeDisabled(); + expect(getByRole("button", {name: "Next"})).toBeDisabled(); // Select first checkbox too await fireEvent.click(firstCheckbox); @@ -128,45 +140,46 @@ describe("Create", async () => { }); it("correctly renders the Mnemonic Preview page", async () => { - const { container, getByRole, getAllByRole } = render(Create); + const {container, getByRole, getAllByRole} = render(Create); - await fireEvent.click(getByRole("button", { name: "Accept" })); + await fireEvent.click(getByRole("button", {name: "Accept"})); await fireEvent.click(getAllByRole("checkbox")[0]); await fireEvent.click(getAllByRole("checkbox")[1]); - await fireEvent.click(getByRole("button", { name: "Next" })); + await fireEvent.click(getByRole("button", {name: "Next"})); expect(container.firstChild).toMatchSnapshot(); }); it("correctly renders the Mnemonic Verification page", async () => { - const { container, getByRole, getAllByRole } = render(Create); + const {container, getByRole, getAllByRole} = render(Create); - await fireEvent.click(getByRole("button", { name: "Accept" })); + await fireEvent.click(getByRole("button", {name: "Accept"})); await fireEvent.click(getAllByRole("checkbox")[0]); await fireEvent.click(getAllByRole("checkbox")[1]); - await fireEvent.click(getByRole("button", { name: "Next" })); - await fireEvent.click(getByRole("button", { name: "Next" })); + await fireEvent.click(getByRole("button", {name: "Next"})); + await fireEvent.click(getByRole("button", {name: "Next"})); expect(container.firstChild).toMatchSnapshot(); }); it("doesn't let the user proceed if they have entered mismatching Mnemonic", async () => { - const { container, getByRole, getAllByRole } = render(Create); + const {container, getByRole, getAllByRole} = render(Create); - await fireEvent.click(getByRole("button", { name: "Accept" })); + await fireEvent.click(getByRole("button", {name: "Accept"})); await fireEvent.click(getAllByRole("checkbox")[0]); await fireEvent.click(getAllByRole("checkbox")[1]); - await fireEvent.click(getByRole("button", { name: "Next" })); - await fireEvent.click(getByRole("button", { name: "Next" })); + await fireEvent.click(getByRole("button", {name: "Next"})); + await fireEvent.click(getByRole("button", {name: "Next"})); - const wordButtonsWrapper = - container.getElementsByClassName("dusk-mnemonic__validate-actions-wrapper")[0]; + const wordButtonsWrapper = container.getElementsByClassName( + "dusk-mnemonic__validate-actions-wrapper" + )[0]; const wordButtons = Array.from(wordButtonsWrapper.children); @@ -178,79 +191,79 @@ describe("Create", async () => { expect(container.firstChild).toMatchSnapshot(); - expect(getByRole("button", { name: "Next" })).toBeDisabled(); + expect(getByRole("button", {name: "Next"})).toBeDisabled(); }); it("lets the user proceed if they have entered a matching Mnemonic", async () => { - const { container, getByRole, getAllByRole } = render(Create); + const {container, getByRole, getAllByRole} = render(Create); - await fireEvent.click(getByRole("button", { name: "Accept" })); + await fireEvent.click(getByRole("button", {name: "Accept"})); await fireEvent.click(getAllByRole("checkbox")[0]); await fireEvent.click(getAllByRole("checkbox")[1]); - await fireEvent.click(getByRole("button", { name: "Next" })); - await fireEvent.click(getByRole("button", { name: "Next" })); + await fireEvent.click(getByRole("button", {name: "Next"})); + await fireEvent.click(getByRole("button", {name: "Next"})); const mnemonicSplit = mnemonic.split(" "); mnemonicSplit.forEach(async word => { - await fireEvent.click(getByRole("button", { name: word })); + await fireEvent.click(getByRole("button", {name: word})); }); await tick(); expect(container.firstChild).toMatchSnapshot(); - expect(getByRole("button", { name: "Next" })).toBeEnabled(); + expect(getByRole("button", {name: "Next"})).toBeEnabled(); }); it("ensures that the Undo button on the Mnemonic Validate step works as expected", async () => { - const { container, getByRole, getAllByRole } = render(Create); + const {container, getByRole, getAllByRole} = render(Create); - await fireEvent.click(getByRole("button", { name: "Accept" })); + await fireEvent.click(getByRole("button", {name: "Accept"})); await fireEvent.click(getAllByRole("checkbox")[0]); await fireEvent.click(getAllByRole("checkbox")[1]); - await fireEvent.click(getByRole("button", { name: "Next" })); - await fireEvent.click(getByRole("button", { name: "Next" })); + await fireEvent.click(getByRole("button", {name: "Next"})); + await fireEvent.click(getByRole("button", {name: "Next"})); const mnemonicSplit = mnemonic.split(" "); mnemonicSplit.forEach(async word => { - await fireEvent.click(getByRole("button", { name: word })); + await fireEvent.click(getByRole("button", {name: word})); }); await tick(); - await fireEvent.click(getByRole("button", { name: "Undo" })); + await fireEvent.click(getByRole("button", {name: "Undo"})); expect(container.firstChild).toMatchSnapshot(); - expect(getByRole("button", { name: "Next" })).toBeDisabled(); + expect(getByRole("button", {name: "Next"})).toBeDisabled(); }); it("ensures the Password step renders as expected", async () => { - const { container, getByRole, getAllByRole } = render(Create); + const {container, getByRole, getAllByRole} = render(Create); - await fireEvent.click(getByRole("button", { name: "Accept" })); + await fireEvent.click(getByRole("button", {name: "Accept"})); await fireEvent.click(getAllByRole("checkbox")[0]); await fireEvent.click(getAllByRole("checkbox")[1]); - await fireEvent.click(getByRole("button", { name: "Next" })); - await fireEvent.click(getByRole("button", { name: "Next" })); + await fireEvent.click(getByRole("button", {name: "Next"})); + await fireEvent.click(getByRole("button", {name: "Next"})); const mnemonicSplit = mnemonic.split(" "); mnemonicSplit.forEach(async word => { - await fireEvent.click(getByRole("button", { name: word })); + await fireEvent.click(getByRole("button", {name: word})); }); await tick(); - await fireEvent.click(getByRole("button", { name: "Next" })); + await fireEvent.click(getByRole("button", {name: "Next"})); // Password disabled expect(container.firstChild).toMatchSnapshot(); @@ -262,91 +275,91 @@ describe("Create", async () => { }); it("ensures the Swap To Native Dusk step renders as expected", async () => { - const { container, getByRole, getAllByRole } = render(Create); + const {container, getByRole, getAllByRole} = render(Create); - await fireEvent.click(getByRole("button", { name: "Accept" })); + await fireEvent.click(getByRole("button", {name: "Accept"})); await fireEvent.click(getAllByRole("checkbox")[0]); await fireEvent.click(getAllByRole("checkbox")[1]); - await fireEvent.click(getByRole("button", { name: "Next" })); - await fireEvent.click(getByRole("button", { name: "Next" })); + await fireEvent.click(getByRole("button", {name: "Next"})); + await fireEvent.click(getByRole("button", {name: "Next"})); const mnemonicSplit = mnemonic.split(" "); mnemonicSplit.forEach(async word => { - await fireEvent.click(getByRole("button", { name: word })); + await fireEvent.click(getByRole("button", {name: word})); }); await tick(); - await fireEvent.click(getByRole("button", { name: "Next" })); - await fireEvent.click(getByRole("button", { name: "Next" })); + await fireEvent.click(getByRole("button", {name: "Next"})); + await fireEvent.click(getByRole("button", {name: "Next"})); expect(container.firstChild).toMatchSnapshot(); }); it("ensures the All Done step renders as expected", async () => { - const { container, getByRole, getAllByRole } = render(Create); + const {container, getByRole, getAllByRole} = render(Create); - await fireEvent.click(getByRole("button", { name: "Accept" })); + await fireEvent.click(getByRole("button", {name: "Accept"})); await fireEvent.click(getAllByRole("checkbox")[0]); await fireEvent.click(getAllByRole("checkbox")[1]); - await fireEvent.click(getByRole("button", { name: "Next" })); - await fireEvent.click(getByRole("button", { name: "Next" })); + await fireEvent.click(getByRole("button", {name: "Next"})); + await fireEvent.click(getByRole("button", {name: "Next"})); const mnemonicSplit = mnemonic.split(" "); mnemonicSplit.forEach(async word => { - await fireEvent.click(getByRole("button", { name: word })); + await fireEvent.click(getByRole("button", {name: word})); }); await tick(); - await fireEvent.click(getByRole("button", { name: "Next" })); - await fireEvent.click(getByRole("button", { name: "Next" })); - await fireEvent.click(getByRole("button", { name: "Next" })); + await fireEvent.click(getByRole("button", {name: "Next"})); + await fireEvent.click(getByRole("button", {name: "Next"})); + await fireEvent.click(getByRole("button", {name: "Next"})); expect(container.firstChild).toMatchSnapshot(); }); it("should initialize the wallet without setting a password", async () => { - const { getByRole, getAllByRole } = render(Create); + const {getByRole, getAllByRole} = render(Create); // ToS step - await fireEvent.click(getByRole("button", { name: "Accept" })); + await fireEvent.click(getByRole("button", {name: "Accept"})); // Mnemonic Agreement step await fireEvent.click(getAllByRole("checkbox")[0]); await fireEvent.click(getAllByRole("checkbox")[1]); - await fireEvent.click(getByRole("button", { name: "Next" })); + await fireEvent.click(getByRole("button", {name: "Next"})); // Mnemonic Generate step - await fireEvent.click(getByRole("button", { name: "Next" })); + await fireEvent.click(getByRole("button", {name: "Next"})); // Mnemonic Validate step const mnemonicSplit = mnemonic.split(" "); mnemonicSplit.forEach(async word => { - await fireEvent.click(getByRole("button", { name: word })); + await fireEvent.click(getByRole("button", {name: word})); }); await tick(); - await fireEvent.click(getByRole("button", { name: "Next" })); + await fireEvent.click(getByRole("button", {name: "Next"})); // Set Password step - await fireEvent.click(getByRole("button", { name: "Next" })); + await fireEvent.click(getByRole("button", {name: "Next"})); expect(loginInfoStorage.get()).toBeNull(); // Swap ERC20 to Native Dusk step - await fireEvent.click(getByRole("button", { name: "Next" })); + await fireEvent.click(getByRole("button", {name: "Next"})); // All Done step - await fireEvent.click(getByRole("button", { name: "Next" })); + await fireEvent.click(getByRole("button", {name: "Next"})); await vi.waitUntil(() => gotoSpy.mock.calls.length > 0); @@ -360,30 +373,30 @@ describe("Create", async () => { }); it("should initialize the wallet encrypted mnemonic saved in localStorage", async () => { - const { getByPlaceholderText, getByRole, getAllByRole } = render(Create); + const {getByPlaceholderText, getByRole, getAllByRole} = render(Create); // ToS step - await fireEvent.click(getByRole("button", { name: "Accept" })); + await fireEvent.click(getByRole("button", {name: "Accept"})); // Mnemonic Agreement step await fireEvent.click(getAllByRole("checkbox")[0]); await fireEvent.click(getAllByRole("checkbox")[1]); - await fireEvent.click(getByRole("button", { name: "Next" })); + await fireEvent.click(getByRole("button", {name: "Next"})); // Mnemonic Generate step - await fireEvent.click(getByRole("button", { name: "Next" })); + await fireEvent.click(getByRole("button", {name: "Next"})); // Mnemonic Validate step const mnemonicSplit = mnemonic.split(" "); mnemonicSplit.forEach(async word => { - await fireEvent.click(getByRole("button", { name: word })); + await fireEvent.click(getByRole("button", {name: word})); }); await tick(); - await fireEvent.click(getByRole("button", { name: "Next" })); + await fireEvent.click(getByRole("button", {name: "Next"})); // Set Password step expect(loginInfoStorage.get()).toBeNull(); @@ -394,16 +407,16 @@ describe("Create", async () => { await fireInput(asInput(getByPlaceholderText("Confirm Password")), pwd); expect(loginInfoStorage.get()).toBeNull(); - await fireEvent.click(getByRole("button", { name: "Next" })); + await fireEvent.click(getByRole("button", {name: "Next"})); await vi.waitFor(() => { expect(loginInfoStorage.get()).not.toBeNull(); }); // Swap ERC20 to Native Dusk step - await fireEvent.click(getByRole("button", { name: "Next" })); + await fireEvent.click(getByRole("button", {name: "Next"})); // All Done step - await fireEvent.click(getByRole("button", { name: "Next" })); + await fireEvent.click(getByRole("button", {name: "Next"})); await vi.waitUntil(() => gotoSpy.mock.calls.length > 0); diff --git a/web-wallet/src/routes/(welcome)/setup/restore/+page.svelte b/web-wallet/src/routes/(welcome)/setup/restore/+page.svelte index 37d37817cb..70e74dead5 100644 --- a/web-wallet/src/routes/(welcome)/setup/restore/+page.svelte +++ b/web-wallet/src/routes/(welcome)/setup/restore/+page.svelte @@ -1,16 +1,19 @@ - +
diff --git a/web-wallet/src/routes/+layout.svelte b/web-wallet/src/routes/+layout.svelte index e5eade4ec5..b2ba69e61c 100644 --- a/web-wallet/src/routes/+layout.svelte +++ b/web-wallet/src/routes/+layout.svelte @@ -1,15 +1,15 @@

Dusk Web Wallet

- +
- - + + diff --git a/web-wallet/src/routes/components-showcase/IconButtons.svelte b/web-wallet/src/routes/components-showcase/IconButtons.svelte index 79c47ff61a..81d49d4d51 100644 --- a/web-wallet/src/routes/components-showcase/IconButtons.svelte +++ b/web-wallet/src/routes/components-showcase/IconButtons.svelte @@ -1,97 +1,51 @@
-
-
-
-
diff --git a/web-wallet/src/routes/components-showcase/LabeledButtons.svelte b/web-wallet/src/routes/components-showcase/LabeledButtons.svelte index 9b3b3b305c..0284374322 100644 --- a/web-wallet/src/routes/components-showcase/LabeledButtons.svelte +++ b/web-wallet/src/routes/components-showcase/LabeledButtons.svelte @@ -1,82 +1,74 @@
-
-