From 06806544173b4b540fd655c3203830ae75751cff Mon Sep 17 00:00:00 2001 From: jeff <113397187+cyberhorsey@users.noreply.github.com> Date: Mon, 27 Feb 2023 18:05:53 -0800 Subject: [PATCH] feat(bridge-ui): add a starter dapp so we can make future small dapps easily (#13223) --- packages/starter-dapp/.babelrc | 8 + packages/starter-dapp/.default.env | 8 + packages/starter-dapp/.eslintignore | 6 + packages/starter-dapp/.eslintrc.cjs | 81 +++ packages/starter-dapp/.gitignore | 30 ++ packages/starter-dapp/README.md | 30 ++ packages/starter-dapp/index.html | 31 ++ packages/starter-dapp/jest.config.js | 55 ++ packages/starter-dapp/package.json | 74 +++ packages/starter-dapp/postcss.config.cjs | 6 + .../starter-dapp/public/taiko-favicon.png | Bin 0 -> 7618 bytes packages/starter-dapp/src/App.svelte | 113 ++++ packages/starter-dapp/src/app.css | 107 ++++ packages/starter-dapp/src/assets/erc20.png | Bin 0 -> 1555 bytes .../src/assets/lottie/loader.json | 1 + .../starter-dapp/src/assets/taiko-banner.svg | 15 + .../src/components/AddressDropdown.svelte | 118 +++++ .../src/components/ButtonWithTooltip.svelte | 15 + .../src/components/ChainDropdown.svelte | 69 +++ .../starter-dapp/src/components/Loader.svelte | 4 + .../components/MessageStatusTooltip.svelte | 40 ++ .../starter-dapp/src/components/Navbar.svelte | 65 +++ .../src/components/Tooltip.svelte | 11 + .../src/components/buttons/Connect.svelte | 106 ++++ .../components/icons/CoinbaseWallet.svelte | 5 + .../src/components/icons/ERC20.svelte | 6 + .../src/components/icons/ETH.svelte | 39 ++ .../src/components/icons/Horse.svelte | 59 +++ .../src/components/icons/Loader.svelte | 16 + .../src/components/icons/MetaMask.svelte | 57 ++ .../src/components/icons/TKO.svelte | 19 + .../src/components/icons/TaikoLight.svelte | 5 + .../src/components/icons/TaikoLogo.svelte | 62 +++ .../src/components/icons/TaikoLogoFluo.svelte | 5 + .../src/components/icons/WalletConnect.svelte | 1 + .../src/components/modals/Modal.svelte | 47 ++ .../modals/SwitchEthereumChainModal.svelte | 57 ++ .../src/components/modals/TooltipModal.svelte | 17 + .../components/providers/BaseQueries.svelte | 1 + .../components/providers/QueryProvider.svelte | 13 + packages/starter-dapp/src/domain/bridge.ts | 58 ++ packages/starter-dapp/src/domain/chain.ts | 121 +++++ packages/starter-dapp/src/i18n.js | 42 ++ packages/starter-dapp/src/main.ts | 12 + .../starter-dapp/src/pages/home/Home.svelte | 9 + packages/starter-dapp/src/store/chain.ts | 5 + packages/starter-dapp/src/store/modal.ts | 4 + packages/starter-dapp/src/store/providers.ts | 6 + packages/starter-dapp/src/store/signer.ts | 4 + packages/starter-dapp/src/store/wagmi.ts | 3 + .../src/utils/addressAvatar.spec.ts | 16 + .../starter-dapp/src/utils/addressAvatar.ts | 21 + .../src/utils/addressSubsection.spec.ts | 13 + .../src/utils/addressSubsection.ts | 4 + .../src/utils/remove0xPrefixIfPresent.spec.ts | 7 + .../src/utils/remove0xPrefixIfPresent.ts | 12 + .../src/utils/switchEthereumChain.ts | 40 ++ packages/starter-dapp/src/utils/toast.spec.ts | 24 + packages/starter-dapp/src/utils/toast.ts | 36 ++ .../src/utils/truncateString.spec.ts | 20 + .../starter-dapp/src/utils/truncateString.ts | 4 + packages/starter-dapp/src/vite-env.d.ts | 2 + packages/starter-dapp/svelte.config.cjs | 7 + packages/starter-dapp/tailwind.config.cjs | 93 ++++ packages/starter-dapp/tsconfig.json | 21 + packages/starter-dapp/tsconfig.node.json | 8 + packages/starter-dapp/vite.config.ts | 26 + pnpm-lock.yaml | 494 +++++++++++++++++- 68 files changed, 2486 insertions(+), 28 deletions(-) create mode 100644 packages/starter-dapp/.babelrc create mode 100644 packages/starter-dapp/.default.env create mode 100644 packages/starter-dapp/.eslintignore create mode 100644 packages/starter-dapp/.eslintrc.cjs create mode 100644 packages/starter-dapp/.gitignore create mode 100644 packages/starter-dapp/README.md create mode 100644 packages/starter-dapp/index.html create mode 100644 packages/starter-dapp/jest.config.js create mode 100644 packages/starter-dapp/package.json create mode 100644 packages/starter-dapp/postcss.config.cjs create mode 100644 packages/starter-dapp/public/taiko-favicon.png create mode 100644 packages/starter-dapp/src/App.svelte create mode 100644 packages/starter-dapp/src/app.css create mode 100644 packages/starter-dapp/src/assets/erc20.png create mode 100644 packages/starter-dapp/src/assets/lottie/loader.json create mode 100644 packages/starter-dapp/src/assets/taiko-banner.svg create mode 100644 packages/starter-dapp/src/components/AddressDropdown.svelte create mode 100644 packages/starter-dapp/src/components/ButtonWithTooltip.svelte create mode 100644 packages/starter-dapp/src/components/ChainDropdown.svelte create mode 100644 packages/starter-dapp/src/components/Loader.svelte create mode 100644 packages/starter-dapp/src/components/MessageStatusTooltip.svelte create mode 100644 packages/starter-dapp/src/components/Navbar.svelte create mode 100644 packages/starter-dapp/src/components/Tooltip.svelte create mode 100644 packages/starter-dapp/src/components/buttons/Connect.svelte create mode 100644 packages/starter-dapp/src/components/icons/CoinbaseWallet.svelte create mode 100644 packages/starter-dapp/src/components/icons/ERC20.svelte create mode 100644 packages/starter-dapp/src/components/icons/ETH.svelte create mode 100644 packages/starter-dapp/src/components/icons/Horse.svelte create mode 100644 packages/starter-dapp/src/components/icons/Loader.svelte create mode 100644 packages/starter-dapp/src/components/icons/MetaMask.svelte create mode 100644 packages/starter-dapp/src/components/icons/TKO.svelte create mode 100644 packages/starter-dapp/src/components/icons/TaikoLight.svelte create mode 100644 packages/starter-dapp/src/components/icons/TaikoLogo.svelte create mode 100644 packages/starter-dapp/src/components/icons/TaikoLogoFluo.svelte create mode 100644 packages/starter-dapp/src/components/icons/WalletConnect.svelte create mode 100644 packages/starter-dapp/src/components/modals/Modal.svelte create mode 100644 packages/starter-dapp/src/components/modals/SwitchEthereumChainModal.svelte create mode 100644 packages/starter-dapp/src/components/modals/TooltipModal.svelte create mode 100644 packages/starter-dapp/src/components/providers/BaseQueries.svelte create mode 100644 packages/starter-dapp/src/components/providers/QueryProvider.svelte create mode 100644 packages/starter-dapp/src/domain/bridge.ts create mode 100644 packages/starter-dapp/src/domain/chain.ts create mode 100644 packages/starter-dapp/src/i18n.js create mode 100644 packages/starter-dapp/src/main.ts create mode 100644 packages/starter-dapp/src/pages/home/Home.svelte create mode 100644 packages/starter-dapp/src/store/chain.ts create mode 100644 packages/starter-dapp/src/store/modal.ts create mode 100644 packages/starter-dapp/src/store/providers.ts create mode 100644 packages/starter-dapp/src/store/signer.ts create mode 100644 packages/starter-dapp/src/store/wagmi.ts create mode 100644 packages/starter-dapp/src/utils/addressAvatar.spec.ts create mode 100644 packages/starter-dapp/src/utils/addressAvatar.ts create mode 100644 packages/starter-dapp/src/utils/addressSubsection.spec.ts create mode 100644 packages/starter-dapp/src/utils/addressSubsection.ts create mode 100644 packages/starter-dapp/src/utils/remove0xPrefixIfPresent.spec.ts create mode 100644 packages/starter-dapp/src/utils/remove0xPrefixIfPresent.ts create mode 100644 packages/starter-dapp/src/utils/switchEthereumChain.ts create mode 100644 packages/starter-dapp/src/utils/toast.spec.ts create mode 100644 packages/starter-dapp/src/utils/toast.ts create mode 100644 packages/starter-dapp/src/utils/truncateString.spec.ts create mode 100644 packages/starter-dapp/src/utils/truncateString.ts create mode 100644 packages/starter-dapp/src/vite-env.d.ts create mode 100644 packages/starter-dapp/svelte.config.cjs create mode 100644 packages/starter-dapp/tailwind.config.cjs create mode 100644 packages/starter-dapp/tsconfig.json create mode 100644 packages/starter-dapp/tsconfig.node.json create mode 100644 packages/starter-dapp/vite.config.ts diff --git a/packages/starter-dapp/.babelrc b/packages/starter-dapp/.babelrc new file mode 100644 index 00000000000..7ae1eb65a8f --- /dev/null +++ b/packages/starter-dapp/.babelrc @@ -0,0 +1,8 @@ +{ + "presets": [["@babel/preset-env", {"targets": {"node": "current"}}]], + "env": { + "test": { + "plugins": ["transform-es2015-modules-commonjs"] + } + } + } \ No newline at end of file diff --git a/packages/starter-dapp/.default.env b/packages/starter-dapp/.default.env new file mode 100644 index 00000000000..99fbcadf90c --- /dev/null +++ b/packages/starter-dapp/.default.env @@ -0,0 +1,8 @@ +VITE_NODE_ENV=dev +VITE_L1_RPC_URL="" +VITE_L2_RPC_URL="" +VITE_MAINNET_CHAIN_ID= +VITE_TAIKO_CHAIN_ID= +VITE_MAINNET_CHAIN_NAME= +VITE_TAIKO_CHAIN_NAME= +VITE_APP_NAME=Starter \ No newline at end of file diff --git a/packages/starter-dapp/.eslintignore b/packages/starter-dapp/.eslintignore new file mode 100644 index 00000000000..4f8aac2c914 --- /dev/null +++ b/packages/starter-dapp/.eslintignore @@ -0,0 +1,6 @@ +build +coverage +node_modules +example +LICENSES +public \ No newline at end of file diff --git a/packages/starter-dapp/.eslintrc.cjs b/packages/starter-dapp/.eslintrc.cjs new file mode 100644 index 00000000000..93f2f346d30 --- /dev/null +++ b/packages/starter-dapp/.eslintrc.cjs @@ -0,0 +1,81 @@ +module.exports = { + env: { + node: true, + browser: true, + es2021: true, + webextensions: true, + }, + extends: ["eslint:recommended"], + parser: "@typescript-eslint/parser", + parserOptions: { + ecmaVersion: "latest", + sourceType: "module", + extraFileExtensions: [".svelte"], + }, + plugins: ["svelte3", "@typescript-eslint"], + rules: { + "linebreak-style": ["error", "unix"], + quotes: ["error", "double"], + semi: ["error", "always"], + }, + ignorePatterns: ["node_modules"], // todo: lets lint that separately, or move it to its own package + settings: { + "svelte3/typescript": require("typescript"), + }, + overrides: [ + { + files: ["*.ts", "*.svelte"], + extends: [ + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking", + ], + parserOptions: { + project: ["./tsconfig.json"], + tsconfigRootDir: __dirname, + }, + rules: { + "@typescript-eslint/no-inferrable-types": 0, + "@typescript-eslint/unbound-method": "off", + "@typescript-eslint/no-empty-interface": "off", + }, + }, + { + files: ["*.svelte"], + processor: "svelte3/svelte3", + // typescript and svelte dont work with template handlers yet. + // https://stackoverflow.com/questions/63337868/svelte-typescript-unexpected-tokensvelteparse-error-when-adding-type-to-an-ev + // we need these 3 rules to be able to do: + // on:change=(e) => anyFunctionHere(). + // when svelte is updated, we can remove these 5 rules for svelte files. + rules: { + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-implicit-any": "off", + "@typescript-eslint/no-unsafe-assignment": "off", + "@typescript-eslint/no-unsafe-member-access": "off", + "@typescript-eslint/no-unsafe-argument": "off", + "@typescript-eslint/no-unsafe-call": "off", + "@typescript-eslint/restrict-template-expressions": [ + "warn", + { + allowNumber: true, + allowBoolean: true, + allowNullish: true, + allowAny: true, + }, + ], + }, + }, + { + files: ["*.spec.ts"], + plugins: ["jest"], + rules: { + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/no-unused-vars": "off", + "@typescript-eslint/no-unsafe-assignment": "off", + "@typescript-eslint/unbound-method": "off", + "jest/unbound-method": "error", + }, + }, + ], +}; diff --git a/packages/starter-dapp/.gitignore b/packages/starter-dapp/.gitignore new file mode 100644 index 00000000000..d99f7853c92 --- /dev/null +++ b/packages/starter-dapp/.gitignore @@ -0,0 +1,30 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? +.env +.a1.env +.s.env + +# vite +vite.config.ts.timestamp-*.mjs \ No newline at end of file diff --git a/packages/starter-dapp/README.md b/packages/starter-dapp/README.md new file mode 100644 index 00000000000..359614619ad --- /dev/null +++ b/packages/starter-dapp/README.md @@ -0,0 +1,30 @@ +# Starter dapp + +## Installation + +`pnpm install` + +## Usage + +`pnpm start` + +## Environment Variables + +You can use the following values in the `.env` file to spin up the Bridge UI locally. + +``` +VITE_NODE_ENV=dev +VITE_L1_RPC_URL="https://l1rpc.internal.taiko.xyz/" +VITE_L2_RPC_URL="https://l2rpc.internal.taiko.xyz/" +VITE_L1_EXPLORER_URL="https://l1explorer.internal.taiko.xyz/" +VITE_L2_EXPLORER_URL="https://l2explorer.internal.taiko.xyz/" +VITE_MAINNET_CHAIN_ID=31336 +VITE_TAIKO_CHAIN_ID=167001 +VITE_MAINNET_CHAIN_NAME="Ethereum A2" +VITE_TAIKO_CHAIN_NAME="Taiko A2" +VITE_APP_NAME="Starter" +``` + +## Purpose + +A starter dapp set up ready to go to make frontends in Svelte for the Taiko network. diff --git a/packages/starter-dapp/index.html b/packages/starter-dapp/index.html new file mode 100644 index 00000000000..4d9cbfdaadd --- /dev/null +++ b/packages/starter-dapp/index.html @@ -0,0 +1,31 @@ + + + + + + + + + + + Bridge + + +
+ + + + + diff --git a/packages/starter-dapp/jest.config.js b/packages/starter-dapp/jest.config.js new file mode 100644 index 00000000000..8a0c0adcfea --- /dev/null +++ b/packages/starter-dapp/jest.config.js @@ -0,0 +1,55 @@ +/** @type {import('@ts-jest/dist/types').InitialOptionsTsJest} */ +export default { + transform: { + "^.+\\.js$": "babel-jest", + "^.+\\.ts$": "ts-jest", + "^.+\\.svelte$": [ + "svelte-jester", + { + preprocess: true, + }, + ], + }, + globals: { + 'ts-jest': { + diagnostics: { + ignoreCodes: [1343] + }, + astTransformers: { + before: [ + { + path: 'node_modules/ts-jest-mock-import-meta', + } + ], + } + } + }, + transformIgnorePatterns: ["node_modules/(?!(svelte-i18n)/)"], + moduleFileExtensions: ["ts", "js", "svelte", "json"], + collectCoverage: true, + coverageDirectory: "coverage", + coverageReporters: [ + "lcov", + "text", + "cobertura", + "json-summary", + "json", + "text-summary", + "json", + ], + coverageThreshold: { + global: { + statements: 95, + branches: 72, + functions: 89, + lines: 95, + }, + }, + modulePathIgnorePatterns: ["/public/build/"], + preset: "ts-jest", + testEnvironment: "jsdom", + testPathIgnorePatterns: ["/node_modules/"], + coveragePathIgnorePatterns: ["/src/components/"], + testTimeout: 40 * 1000, + watchPathIgnorePatterns: ["node_modules"], +}; diff --git a/packages/starter-dapp/package.json b/packages/starter-dapp/package.json new file mode 100644 index 00000000000..ed09e68ee8c --- /dev/null +++ b/packages/starter-dapp/package.json @@ -0,0 +1,74 @@ +{ + "name": "@taiko/starter-dapp", + "version": "0.1.2", + "private": true, + "type": "module", + "scripts": { + "start": "pnpm run dev", + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "check": "svelte-check --tsconfig ./tsconfig.json", + "test": "pnpm exec jest", + "prettier": "pnpm exec prettier '**/*.{ts,svelte}'", + "prettier:write": "pnpm run prettier -- --write", + "prettier:check": "pnpm run prettier -- --check", + "svelte:check": "npx svelte-check --ignore test-app", + "lint": "pnpm exec eslint './**/*.{ts,svelte}' --ignore-path .eslintignore", + "lint:fix": "pnpm exec eslint --fix './**/*.{ts,svelte}' --ignore-path .eslintignore" + }, + "devDependencies": { + "@babel/preset-env": "^7.16.0", + "@sveltejs/vite-plugin-svelte": "^1.0.1", + "@tsconfig/svelte": "^3.0.0", + "@types/eslint": "^8.2.1", + "@types/estree": "^0.0.50", + "@types/jest": "^27.0.2", + "@types/mixpanel": "^2.14.3", + "@types/sanitize-html": "^2.6.2", + "@typescript-eslint/eslint-plugin": "^5.16.0", + "@typescript-eslint/parser": "^5.16.0", + "@zerodevx/svelte-toast": "^0.6.3", + "autoprefixer": "^10.4.13", + "babel-jest": "^27.3.1", + "babel-plugin-transform-es2015-modules-commonjs": "^6.26.2", + "daisyui": "1.16.6", + "jest": "^27.5.1", + "node-sass": "^7.0.1", + "postcss": "^8.4.19", + "postcss-cli": "^7.1.2", + "postcss-loader": "^6.2.0", + "prettier": "2.7.1", + "rollup-plugin-node-builtins": "^2.0.0", + "rollup-plugin-polyfill-node": "^0.10.2", + "svelte": "^3.53.1", + "svelte-check": "^2.8.0", + "svelte-heros-v2": "^0.3.10", + "svelte-jester": "^2.1.5", + "svelte-loader": "^3.1.2", + "svelte-preprocess": "^4.10.7", + "tailwindcss": "^3.2.4", + "theme-change": "^2.2.0", + "ts-jest": "^27.0.7", + "ts-jest-mock-import-meta": "^0.12.0", + "ts-loader": "^9.2.6", + "tslib": "^2.4.0", + "typescript": "^4.6.4", + "vite": "^3.0.0", + "vite-plugin-static-copy": "^0.12.0" + }, + "dependencies": { + "@coinbase/wallet-sdk": "^3.6.3", + "@ethersproject/experimental": "^5.7.0", + "@lottiefiles/svelte-lottie-player": "^0.2.0", + "@sveltestack/svelte-query": "^1.6.0", + "@wagmi/connectors": "^0.1.1", + "@wagmi/core": "^0.8.0", + "axios": "^1.2.0", + "buffer": "^6.0.3", + "ethers": "^5.7.1", + "identicon.js": "^2.3.3", + "svelte-i18n": "^3.5.1", + "svelte-spa-router": "^3.2.0" + } +} diff --git a/packages/starter-dapp/postcss.config.cjs b/packages/starter-dapp/postcss.config.cjs new file mode 100644 index 00000000000..e2dc47804ed --- /dev/null +++ b/packages/starter-dapp/postcss.config.cjs @@ -0,0 +1,6 @@ +module.exports = { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + } +} \ No newline at end of file diff --git a/packages/starter-dapp/public/taiko-favicon.png b/packages/starter-dapp/public/taiko-favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..28da6ff13433ccad107f8fc90e7003be222957ad GIT binary patch literal 7618 zcmb_hXH*kix1NL^Ku|+(0g>K&2LUNclOk0Ngn*F}dT)Y)iWF%gf>ddOlt>Z8(7OZ# zF*Ji92!eo!givq%zW4p^{c+#>>&}|B=Ik@OJiDASXC7FX88SjRApig{8XM_b0sx5I z1Oc?v0RR+2C~Lbw zJ5v)i1ln857o6RFl8xONra4y3`|*73hCw|=PK{+f{=j8$;in{%aU(pNm*qzIe9f% zRoGvb0NJ3wo4cB&zQJGS$dsnQt-wHEHEHRPkPxX5c`3BNhqSD!s;ab%oV1*rB$-1p zAj~JwB~;QU;KJV;^pODwf0S<^3he{?qtV3`9Tcc3KnDA7FT8#Kqt++juSk(&CLQYH zD=jM}^T(^d8BI<9Z&q*b|8NHcS|a}&@BgYez&gwqDQ$@iKnM9F$hmXB@W+&|nw~$> zB@pdzjYfO@9Y~8?=s+32R=&H!bC@U)%D9K(@F!)_1+8g#SpVd(Rj79z*_5CI5_Rm-p{!vz%3`Y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eA6*l? zk^cF;eyJmz7;b%4vV2O3@{Lp0rY`P*L)BA)h-pNxa_yWkHli%Eep!~E*D?E7qax|b z16+;ec2qS9r>@hO^tPs-NDo{K>SshbAbFYh#8F<%U~ha~Q6OwZ5^ z%|oGvoG!KtZiiCVGon=qnAfh#-?0IWi%SG#Brk2{Q>mGBBWi{7enzdl6uaNd9EjVC zec!RHAwPYBY~i{_@9gf`>yZBxFq03Q?^*z~ + import { wrap } from "svelte-spa-router/wrap"; + import QueryProvider from "./components/providers/QueryProvider.svelte"; + import Router from "svelte-spa-router"; + import { SvelteToast } from "@zerodevx/svelte-toast"; + import type { SvelteToastOptions } from "@zerodevx/svelte-toast"; + import { configureChains, createClient } from "@wagmi/core"; + import { publicProvider } from "@wagmi/core/providers/public"; + import { jsonRpcProvider } from "@wagmi/core/providers/jsonRpc"; + import { CoinbaseWalletConnector } from "@wagmi/core/connectors/coinbaseWallet"; + import { WalletConnectConnector } from "@wagmi/core/connectors/walletConnect"; + import { MetaMaskConnector } from "@wagmi/core/connectors/metaMask"; + + import Home from "./pages/home/Home.svelte"; + import { setupI18n } from "./i18n"; + import Navbar from "./components/Navbar.svelte"; + import { wagmiClient } from "./store/wagmi"; + + setupI18n({ withLocale: "en" }); + import { + CHAIN_ID_MAINNET, + CHAIN_ID_TAIKO, + mainnet, + taiko, + } from "./domain/chain"; + import SwitchEthereumChainModal from "./components/modals/SwitchEthereumChainModal.svelte"; + import { ethers } from "ethers"; + import { providers } from "./store/providers"; + + const providerMap: Map = new Map< + number, + ethers.providers.JsonRpcProvider + >(); + + providerMap.set( + CHAIN_ID_MAINNET, + new ethers.providers.JsonRpcProvider(import.meta.env.VITE_L1_RPC_URL) + ); + providerMap.set( + CHAIN_ID_TAIKO, + new ethers.providers.JsonRpcProvider(import.meta.env.VITE_L2_RPC_URL) + ); + providers.set(providerMap); + + const { chains: wagmiChains, provider } = configureChains( + [mainnet, taiko], + [ + publicProvider(), + jsonRpcProvider({ + rpc: (chain) => ({ + http: providerMap.get(chain.id).connection.url, + }), + }), + ] + ); + + $wagmiClient = createClient({ + autoConnect: true, + provider, + connectors: [ + new MetaMaskConnector({ + chains: wagmiChains, + }), + new CoinbaseWalletConnector({ + chains: wagmiChains, + options: { + appName: import.meta.env.VITE_APP_NAME, + }, + }), + new WalletConnectConnector({ + chains: wagmiChains, + options: { + qrcode: true, + }, + }), + ], + }); + + providers.set(providerMap); + + const toastOptions: SvelteToastOptions = { + dismissable: false, + duration: 4000, + pausable: false, + }; + + const routes = { + "/": wrap({ + component: Home, + props: {}, + userData: {}, + }), + }; + + + +
+ + +
+ + +
+ + diff --git a/packages/starter-dapp/src/app.css b/packages/starter-dapp/src/app.css new file mode 100644 index 00000000000..fc03aeddba9 --- /dev/null +++ b/packages/starter-dapp/src/app.css @@ -0,0 +1,107 @@ +.btn.btn-wide { + width: 194px; + height: 56px; +} + +@media (min-width: 768px) { + .btn.md\:btn-wide { + width: 194px; + height: 56px; + } +} + +.btn.btn-token-select { + width: 140px; + height: 60px; +} + +.btn.btn-square { + border-radius: 4px; +} + +/* Invert accent button colors */ +.btn.btn-accent { + background-color: hsla(var(--af) / var(--tw-bg-opacity, 1)); + border-color: hsla(var(--af) / var(--tw-bg-opacity, 1)); + height: 60px; +} + +.btn.btn-accent:hover { + background-color: hsla(var(--a) / var(--tw-bg-opacity, 1)); + border-color: hsla(var(--a) / var(--tw-bg-opacity, 1)); +} + +.dropdown .dropdown-content { + border-radius: 0 0 var(--rounded-box) var(--rounded-box); +} + +.input-group .input.input-primary { + border-radius: 0.5rem; +} + +.form-control .input-group :first-child { + border-radius: 0.5rem; +} + +.form-control .input-group :last-child { + border-radius: 0.5rem; +} + +ul.token-dropdown li.cursor-pointer:last-child, ul.token-dropdown li.cursor-pointer:first-child { + border-radius: 0; +} + +.taiko-banner { + background-image: url('assets/taiko-banner.svg'); + background-repeat: no-repeat; +} + +.dropdown-content.address-dropdown-content { + border-radius: 6px; +} + +input[type=number]::-webkit-outer-spin-button, +input[type=number]::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; +} + +input[type=number] { + -moz-appearance: textfield; +} + +.taiko-logo { + display: none; +} + +[data-theme="dark"] .taiko-logo { + display: inline; +} + +[data-theme="dark"] .taiko-light-logo { + display: none; +} + +[data-theme="dark"] .switch-to-dark-mode { + display: none; +} + +[data-theme="light"] .switch-to-light-mode { + display: none; +} + +[data-theme="light"] .toggle-chain.btn[disabled] { + color: #1f2937; + background-color: #d4d4d4; + opacity: 0.4; +} + +@media screen and (max-width: 768px) { + [data-theme="dark"] .taiko-logo { + display: none; + } + + [data-theme="light"] .taiko-light-logo { + display: none; + } +} diff --git a/packages/starter-dapp/src/assets/erc20.png b/packages/starter-dapp/src/assets/erc20.png new file mode 100644 index 0000000000000000000000000000000000000000..902ed2b9c87be61df453f8950266513d02cbf021 GIT binary patch literal 1555 zcmV+u2JHEXP)tU^a~_4fGa>F(j; z=+4pJy}!-c+v9R~nL0pkm7BLwScIXZxqN`2vbW2eqP^4A-oeGyGdXLHlB}q$#Y<9w zg^H#jDPn$sn<+46W@?L4SADClz|MG3JOBU%O-V#SRCt{2n`@JzIuM2p5+Q*g2!beh zKf62r{~x%-3xr(I9g!e)VFb_k%O>TVARri5B&S6gf@wwG;ClqK zb>x~4gA4(ny+MSH-~<_hNktw+C&&;C){(JIQ~4p$h@jBo&h>z|m@gMZ8V#cHWwVxP5$-(t^&5owd^z`J z3>R%VQl>?igNOg`2-J{Fk-DxcQHw1AgRq=`8B?U7#YTgj0$T)1vGDkMT8|>PeFUmO z_Cpv13egt@x#}S3-_aZZk3i!=0Q=rgH6XA6odlE!)Dw&-Ja;@n);a;_o+Js02-Fj0 zD~j=oOkP63d;|s%ddehY75U7If&|_nG`1iQgpoONkB0$<5MIY)Tpbx;nucT&_ymE9 z0s+?}V{YvO#F9hsIl?_>dSrwmlRO{%_zw^$#NzUOMTV!#unRsxm@ohPHRe$4cjZWg z+qYj-(KBgytMDP5E?$AhI*_pAW92LX{)*Vvt-%wcu)e=!)Rr zM#KXuK`55n&hzmNjhmu|4&JcQxC#eUKv)(#HU>EYBMXLob_-+VT2>h1YatNV=>D5RVe^(rd^TSg(*aKh)_fm>g>>kAne74kz;2)lF{ zZ+)(kFtb#0<{NMA<&^=xo-(x05sU3dylJAb77IFKyQs2(0Iar>myYg1KxdVt6^$iz zwaJk&zd7JY=Mlu@{y_5Cz*y%HKrl%=T0k(pTOS!eHs%qG zE-yT-!b1pFR)M+MbsxdZtXi-Hs}YdV^VnIc-1M`v;zq4j>^oXq&kq#{o{b&5r|spt zuR4Z6A6s`aI|R!=770WzXnr=lw{{o1MJO$u$IcG?TE2nhm3LP6ew<+Zew10#|9yn@ zFi_h^9m2)xdF + + + + + + + + + + + + + + diff --git a/packages/starter-dapp/src/components/AddressDropdown.svelte b/packages/starter-dapp/src/components/AddressDropdown.svelte new file mode 100644 index 00000000000..37d6f8e6045 --- /dev/null +++ b/packages/starter-dapp/src/components/AddressDropdown.svelte @@ -0,0 +1,118 @@ + + + diff --git a/packages/starter-dapp/src/components/ButtonWithTooltip.svelte b/packages/starter-dapp/src/components/ButtonWithTooltip.svelte new file mode 100644 index 00000000000..d065c599256 --- /dev/null +++ b/packages/starter-dapp/src/components/ButtonWithTooltip.svelte @@ -0,0 +1,15 @@ + + +
+ + +
diff --git a/packages/starter-dapp/src/components/ChainDropdown.svelte b/packages/starter-dapp/src/components/ChainDropdown.svelte new file mode 100644 index 00000000000..ec6430e01f2 --- /dev/null +++ b/packages/starter-dapp/src/components/ChainDropdown.svelte @@ -0,0 +1,69 @@ + + + diff --git a/packages/starter-dapp/src/components/Loader.svelte b/packages/starter-dapp/src/components/Loader.svelte new file mode 100644 index 00000000000..a70c8626cac --- /dev/null +++ b/packages/starter-dapp/src/components/Loader.svelte @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/packages/starter-dapp/src/components/MessageStatusTooltip.svelte b/packages/starter-dapp/src/components/MessageStatusTooltip.svelte new file mode 100644 index 00000000000..d4e6be85d74 --- /dev/null +++ b/packages/starter-dapp/src/components/MessageStatusTooltip.svelte @@ -0,0 +1,40 @@ + + + + +
+ A bridge message will pass through various states: +

+
    +
  • + Pending: Your asset is not ready to be bridged. Taiko + A1 => {import.meta.env + ? import.meta.env.VITE_MAINNET_CHAIN_NAME + : "Ethereum A2"} bridging can take several hours before being ready. + {import.meta.env + ? import.meta.env.VITE_MAINNET_CHAIN_NAME + : "Ethereum A2"} => {import.meta.env ? import.meta.env.VITE_TAIKO_CHAIN_NAME : "Taiko A2"} should be available to claim within minutes. +
  • +
  • + Claimable: Your asset is ready to be claimed on the + destination chain and requires a transaction. +
  • +
  • + Claimed: Your asset has finished bridging and is + available to you on the destination chain. +
  • +
  • + Retry: The relayer has failed to process this + message, and you must retry the processing yourself. +
  • +
  • + Release: Your bridged asset is unable to be processed + and is available to you on the source chain. +
  • +
+
+
+
diff --git a/packages/starter-dapp/src/components/Navbar.svelte b/packages/starter-dapp/src/components/Navbar.svelte new file mode 100644 index 00000000000..a31761b00b4 --- /dev/null +++ b/packages/starter-dapp/src/components/Navbar.svelte @@ -0,0 +1,65 @@ + + + diff --git a/packages/starter-dapp/src/components/Tooltip.svelte b/packages/starter-dapp/src/components/Tooltip.svelte new file mode 100644 index 00000000000..1ccae3a0157 --- /dev/null +++ b/packages/starter-dapp/src/components/Tooltip.svelte @@ -0,0 +1,11 @@ + + + (isOpen = true)} + size="18" + variation="outline" +/> diff --git a/packages/starter-dapp/src/components/buttons/Connect.svelte b/packages/starter-dapp/src/components/buttons/Connect.svelte new file mode 100644 index 00000000000..9c9cc8e819e --- /dev/null +++ b/packages/starter-dapp/src/components/buttons/Connect.svelte @@ -0,0 +1,106 @@ + + + + + ($isConnectWalletModalOpen = false)} +> +
+ {#each $wagmiClient.connectors as connector} + + {/each} +
+
diff --git a/packages/starter-dapp/src/components/icons/CoinbaseWallet.svelte b/packages/starter-dapp/src/components/icons/CoinbaseWallet.svelte new file mode 100644 index 00000000000..01c8968d129 --- /dev/null +++ b/packages/starter-dapp/src/components/icons/CoinbaseWallet.svelte @@ -0,0 +1,5 @@ +Coinbase Wallet diff --git a/packages/starter-dapp/src/components/icons/ERC20.svelte b/packages/starter-dapp/src/components/icons/ERC20.svelte new file mode 100644 index 00000000000..3a46357b121 --- /dev/null +++ b/packages/starter-dapp/src/components/icons/ERC20.svelte @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/packages/starter-dapp/src/components/icons/ETH.svelte b/packages/starter-dapp/src/components/icons/ETH.svelte new file mode 100644 index 00000000000..e6175b1b4ca --- /dev/null +++ b/packages/starter-dapp/src/components/icons/ETH.svelte @@ -0,0 +1,39 @@ + + + + + + + + + + + diff --git a/packages/starter-dapp/src/components/icons/Horse.svelte b/packages/starter-dapp/src/components/icons/Horse.svelte new file mode 100644 index 00000000000..a85f98f06ab --- /dev/null +++ b/packages/starter-dapp/src/components/icons/Horse.svelte @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/starter-dapp/src/components/icons/Loader.svelte b/packages/starter-dapp/src/components/icons/Loader.svelte new file mode 100644 index 00000000000..a342c73fe82 --- /dev/null +++ b/packages/starter-dapp/src/components/icons/Loader.svelte @@ -0,0 +1,16 @@ + + + + diff --git a/packages/starter-dapp/src/components/icons/MetaMask.svelte b/packages/starter-dapp/src/components/icons/MetaMask.svelte new file mode 100644 index 00000000000..3650b83c3b0 --- /dev/null +++ b/packages/starter-dapp/src/components/icons/MetaMask.svelte @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/starter-dapp/src/components/icons/TKO.svelte b/packages/starter-dapp/src/components/icons/TKO.svelte new file mode 100644 index 00000000000..ea41b411a3b --- /dev/null +++ b/packages/starter-dapp/src/components/icons/TKO.svelte @@ -0,0 +1,19 @@ + + + + + + diff --git a/packages/starter-dapp/src/components/icons/TaikoLight.svelte b/packages/starter-dapp/src/components/icons/TaikoLight.svelte new file mode 100644 index 00000000000..1dbbdba2285 --- /dev/null +++ b/packages/starter-dapp/src/components/icons/TaikoLight.svelte @@ -0,0 +1,5 @@ + + + \ No newline at end of file diff --git a/packages/starter-dapp/src/components/icons/TaikoLogo.svelte b/packages/starter-dapp/src/components/icons/TaikoLogo.svelte new file mode 100644 index 00000000000..26595968c90 --- /dev/null +++ b/packages/starter-dapp/src/components/icons/TaikoLogo.svelte @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + diff --git a/packages/starter-dapp/src/components/icons/TaikoLogoFluo.svelte b/packages/starter-dapp/src/components/icons/TaikoLogoFluo.svelte new file mode 100644 index 00000000000..4bf4baf9348 --- /dev/null +++ b/packages/starter-dapp/src/components/icons/TaikoLogoFluo.svelte @@ -0,0 +1,5 @@ + + + \ No newline at end of file diff --git a/packages/starter-dapp/src/components/icons/WalletConnect.svelte b/packages/starter-dapp/src/components/icons/WalletConnect.svelte new file mode 100644 index 00000000000..474cecf5e9c --- /dev/null +++ b/packages/starter-dapp/src/components/icons/WalletConnect.svelte @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/starter-dapp/src/components/modals/Modal.svelte b/packages/starter-dapp/src/components/modals/Modal.svelte new file mode 100644 index 00000000000..89a1027679d --- /dev/null +++ b/packages/starter-dapp/src/components/modals/Modal.svelte @@ -0,0 +1,47 @@ + + + + + + + diff --git a/packages/starter-dapp/src/components/modals/SwitchEthereumChainModal.svelte b/packages/starter-dapp/src/components/modals/SwitchEthereumChainModal.svelte new file mode 100644 index 00000000000..71da1440788 --- /dev/null +++ b/packages/starter-dapp/src/components/modals/SwitchEthereumChainModal.svelte @@ -0,0 +1,57 @@ + + + +
+ {$_("switchChainModal.subtitle")} +
+ + +
+
+
diff --git a/packages/starter-dapp/src/components/modals/TooltipModal.svelte b/packages/starter-dapp/src/components/modals/TooltipModal.svelte new file mode 100644 index 00000000000..a7ea557e7f7 --- /dev/null +++ b/packages/starter-dapp/src/components/modals/TooltipModal.svelte @@ -0,0 +1,17 @@ + + + +
+
+ +
+ +
+
diff --git a/packages/starter-dapp/src/components/providers/BaseQueries.svelte b/packages/starter-dapp/src/components/providers/BaseQueries.svelte new file mode 100644 index 00000000000..4fa864ce7aa --- /dev/null +++ b/packages/starter-dapp/src/components/providers/BaseQueries.svelte @@ -0,0 +1 @@ + diff --git a/packages/starter-dapp/src/components/providers/QueryProvider.svelte b/packages/starter-dapp/src/components/providers/QueryProvider.svelte new file mode 100644 index 00000000000..91774c4acb8 --- /dev/null +++ b/packages/starter-dapp/src/components/providers/QueryProvider.svelte @@ -0,0 +1,13 @@ + + + + + + + diff --git a/packages/starter-dapp/src/domain/bridge.ts b/packages/starter-dapp/src/domain/bridge.ts new file mode 100644 index 00000000000..437337a51c5 --- /dev/null +++ b/packages/starter-dapp/src/domain/bridge.ts @@ -0,0 +1,58 @@ +import type { BigNumber, ethers, Transaction } from "ethers"; +import type { Message } from "./message"; + +enum BridgeType { + ERC20 = "ERC20", + ETH = "ETH", + ERC721 = "ERC721", + ERC1155 = "ERC1155", +} + +type ApproveOpts = { + amountInWei: BigNumber; + contractAddress: string; + signer: ethers.Signer; + spenderAddress: string; +}; + +type BridgeOpts = { + amountInWei: BigNumber; + signer: ethers.Signer; + tokenAddress: string; + fromChainId: number; + toChainId: number; + tokenVaultAddress: string; + processingFeeInWei?: BigNumber; + tokenId?: string; + memo?: string; + isBridgedTokenAlreadyDeployed?: boolean; +}; + +type ClaimOpts = { + message: Message; + msgHash: string; + signer: ethers.Signer; + destBridgeAddress: string; + srcBridgeAddress: string; +}; + +type ReleaseOpts = { + message: Message; + msgHash: string; + signer: ethers.Signer; + destBridgeAddress: string; + srcBridgeAddress: string; + destProvider: ethers.providers.JsonRpcProvider; + srcTokenVaultAddress: string; +}; + +interface Bridge { + RequiresAllowance(opts: ApproveOpts): Promise; + Approve(opts: ApproveOpts): Promise; + Bridge(opts: BridgeOpts): Promise; + EstimateGas(opts: BridgeOpts): Promise; + Claim(opts: ClaimOpts): Promise; + ReleaseTokens(opts: ReleaseOpts): Promise; +} + +export { ApproveOpts, BridgeOpts, BridgeType, Bridge, ClaimOpts, ReleaseOpts }; diff --git a/packages/starter-dapp/src/domain/chain.ts b/packages/starter-dapp/src/domain/chain.ts new file mode 100644 index 00000000000..8ec816ddc30 --- /dev/null +++ b/packages/starter-dapp/src/domain/chain.ts @@ -0,0 +1,121 @@ +import type { Chain as WagmiChain } from "@wagmi/core"; +import { BigNumber } from "ethers"; +import type { ComponentType } from "svelte"; + +import Eth from "../components/icons/ETH.svelte"; +import Taiko from "../components/icons/TKO.svelte"; + +export const CHAIN_ID_MAINNET = import.meta.env + ? BigNumber.from(import.meta.env.VITE_MAINNET_CHAIN_ID).toNumber() + : 31336; + +export const CHAIN_ID_TAIKO = import.meta.env + ? BigNumber.from(import.meta.env.VITE_TAIKO_CHAIN_ID).toNumber() + : 167001; + +const L1_RPC = import.meta?.env?.VITE_L1_RPC_URL ?? "https://l1rpc.internal.taiko.xyz/"; + +const L2_RPC = import.meta?.env?.VITE_L2_RPC_URL ?? "https://l2rpc.internal.taiko.xyz/"; + +const L1_BRIDGE_ADDRESS = import.meta?.env?.VITE_MAINNET_BRIDGE_ADDRESS ?? "0x0237443359aB0b11EcDC41A7aF1C90226a88c70f"; + +const L2_BRIDGE_ADDRESS = import.meta?.env?.VITE_TAIKO_BRIDGE_ADDRESS ?? "0x0000777700000000000000000000000000000004"; + +const L1_HEADER_SYNC_ADDRESS = import.meta?.env?.VITE_MAINNET_HEADER_SYNC_ADDRESS ?? "0xa6421A7f48498cee3aEb6428a8A2DD5fAA3AcE2f"; + +const L2_HEADER_SYNC_ADDRESS = import.meta?.env?.VITE_TAIKO_HEADER_SYNC_ADDRESS ?? "0x0000777700000000000000000000000000000001"; + +const L1_SIGNAL_SERVICE_ADDRESS = import.meta?.env?.VITE_MAINNET_SIGNAL_SERVICE_ADDRESS ?? "0x403cc7802725928652a3d116Bb1781005e2e76d3"; + +const L2_SIGNAL_SERVICE_ADDRESS = import.meta?.env?.VITE_TAIKO_SIGNAL_SERVICE_ADDRESS ?? "0x0000777700000000000000000000000000000007"; + +const L1_EXPLORER_URL = import.meta?.env?.VITE_L1_EXPLORER_URL ?? "https://l1explorer.internal.taiko.xyz/"; + +const L2_EXPLORER_URL = import.meta?.env?.VITE_L2_EXPLORER_URL ?? "https://l2explorer.internal.taiko.xyz/"; + +export type Chain = { + id: number; + name: string; + rpc: string; + enabled?: boolean; + icon?: ComponentType; + bridgeAddress: string; + headerSyncAddress: string; + explorerUrl: string; + signalServiceAddress: string, +}; + +export const CHAIN_MAINNET = { + id: CHAIN_ID_MAINNET, + name: import.meta.env + ? import.meta.env.VITE_MAINNET_CHAIN_NAME + : "Ethereum A1", + rpc: L1_RPC, + enabled: true, + icon: Eth, + bridgeAddress: L1_BRIDGE_ADDRESS, + headerSyncAddress: L1_HEADER_SYNC_ADDRESS, + explorerUrl: L1_EXPLORER_URL, + signalServiceAddress: L1_SIGNAL_SERVICE_ADDRESS +}; + +export const CHAIN_TKO = { + id: CHAIN_ID_TAIKO, + name: import.meta.env ? import.meta.env.VITE_TAIKO_CHAIN_NAME : "Taiko A2", + rpc: L2_RPC, + enabled: true, + icon: Taiko, + bridgeAddress: L2_BRIDGE_ADDRESS, + headerSyncAddress: L2_HEADER_SYNC_ADDRESS, + explorerUrl: L2_EXPLORER_URL, + signalServiceAddress: L2_SIGNAL_SERVICE_ADDRESS, +}; + +export const chains: Record = { + [CHAIN_ID_MAINNET]: CHAIN_MAINNET, + [CHAIN_ID_TAIKO]: CHAIN_TKO, +}; + +export const mainnet: WagmiChain = { + id: CHAIN_ID_MAINNET, + name: import.meta.env + ? import.meta.env.VITE_MAINNET_CHAIN_NAME + : "Ethereum A2", + network: "", + nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 }, + rpcUrls: { + default: { + http: [L1_RPC], + }, + }, + blockExplorers: { + default: { + name: "Main", + url: L1_EXPLORER_URL, + }, + }, + // ens: { + // address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e", + // }, +}; + +export const taiko: WagmiChain = { + id: CHAIN_ID_TAIKO, + name: import.meta.env ? import.meta.env.VITE_TAIKO_CHAIN_NAME : "Taiko A2", + network: "", + nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 }, + rpcUrls: { + default: { + http: [L2_RPC], + }, + }, + blockExplorers: { + default: { + name: "Main", + url: L2_EXPLORER_URL, + }, + }, + // ens: { + // address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e", + // }, +}; diff --git a/packages/starter-dapp/src/i18n.js b/packages/starter-dapp/src/i18n.js new file mode 100644 index 00000000000..0b74a127e59 --- /dev/null +++ b/packages/starter-dapp/src/i18n.js @@ -0,0 +1,42 @@ +import { _, dictionary, locale } from "svelte-i18n"; + +function setupI18n({ withLocale: _locale } = { withLocale: "en" }) { + dictionary.set({ + en: { + home: { + title: "Taiko Bridge", + selectToken: "Select Token", + to: "To", + bridge: "Bridge", + approve: "Approve", + }, + bridgeForm: { + fieldLabel: "Amount", + maxLabel: "Max", + balance: "Balance", + processingFeeLabel: "Processing Fee", + bridge: "Bridge", + approve: "Approve", + }, + nav: { + connect: "Connect Wallet", + }, + toast: { + transactionSent: "Transaction sent", + errorSendingTransaction: "Error sending transaction", + errorDisconneting: "Could not disconnect", + }, + switchChainModal: { + title: "Not on the right network", + subtitle: "Your current network is not supported. Please select one:", + }, + connectModal: { + title: "Connect Wallet", + }, + }, + }); + + locale.set(_locale); +} + +export { _, setupI18n }; diff --git a/packages/starter-dapp/src/main.ts b/packages/starter-dapp/src/main.ts new file mode 100644 index 00000000000..3bbaf7b1fe4 --- /dev/null +++ b/packages/starter-dapp/src/main.ts @@ -0,0 +1,12 @@ +import "./app.css"; +import App from "./App.svelte"; +import {Buffer} from 'buffer'; + +const app = new App({ + target: document.getElementById("app"), +}); + +// @ts-ignore +window.Buffer = Buffer; + +export default app; diff --git a/packages/starter-dapp/src/pages/home/Home.svelte b/packages/starter-dapp/src/pages/home/Home.svelte new file mode 100644 index 00000000000..da2cde01636 --- /dev/null +++ b/packages/starter-dapp/src/pages/home/Home.svelte @@ -0,0 +1,9 @@ + + +
+
+ Starter Dapp +
+
diff --git a/packages/starter-dapp/src/store/chain.ts b/packages/starter-dapp/src/store/chain.ts new file mode 100644 index 00000000000..43940d29a27 --- /dev/null +++ b/packages/starter-dapp/src/store/chain.ts @@ -0,0 +1,5 @@ +import { writable } from "svelte/store"; +import type { Chain } from "../domain/chain"; + +export const fromChain = writable(); +export const toChain = writable(); diff --git a/packages/starter-dapp/src/store/modal.ts b/packages/starter-dapp/src/store/modal.ts new file mode 100644 index 00000000000..276e90bd41f --- /dev/null +++ b/packages/starter-dapp/src/store/modal.ts @@ -0,0 +1,4 @@ +import { writable } from "svelte/store"; + +export const isSwitchEthereumChainModalOpen = writable(); +export const isConnectWalletModalOpen = writable(); diff --git a/packages/starter-dapp/src/store/providers.ts b/packages/starter-dapp/src/store/providers.ts new file mode 100644 index 00000000000..10ee6e0c90a --- /dev/null +++ b/packages/starter-dapp/src/store/providers.ts @@ -0,0 +1,6 @@ +import type { ethers } from "ethers"; +import { writable } from "svelte/store"; + +export const providers = writable< + Map +>(new Map()); diff --git a/packages/starter-dapp/src/store/signer.ts b/packages/starter-dapp/src/store/signer.ts new file mode 100644 index 00000000000..52cd28d8363 --- /dev/null +++ b/packages/starter-dapp/src/store/signer.ts @@ -0,0 +1,4 @@ +import { writable } from "svelte/store"; +import type { Signer } from "ethers"; + +export const signer = writable(); diff --git a/packages/starter-dapp/src/store/wagmi.ts b/packages/starter-dapp/src/store/wagmi.ts new file mode 100644 index 00000000000..2bcfd78871a --- /dev/null +++ b/packages/starter-dapp/src/store/wagmi.ts @@ -0,0 +1,3 @@ +import { writable } from "svelte/store"; +import type { Client } from "@wagmi/core"; +export const wagmiClient = writable(); diff --git a/packages/starter-dapp/src/utils/addressAvatar.spec.ts b/packages/starter-dapp/src/utils/addressAvatar.spec.ts new file mode 100644 index 00000000000..42f316a3653 --- /dev/null +++ b/packages/starter-dapp/src/utils/addressAvatar.spec.ts @@ -0,0 +1,16 @@ +import Identicon from 'identicon.js'; + +import { DEFAULT_IDENTICON, getAddressAvatarFromIdenticon } from "./addressAvatar"; + +it("should return a base64 avatar string", () => { + const dummyAddress = "0x63FaC9201494f0bd17B9892B9fae4d52fe3BD377"; + const expectedIdenticonString = new Identicon(dummyAddress, 420).toString(); + + expect(getAddressAvatarFromIdenticon(dummyAddress)).toStrictEqual(expectedIdenticonString); +}); + +it("should return default base64 avatar when no address is passed", () => { + const dummyAddress = ""; + + expect(getAddressAvatarFromIdenticon("")).toStrictEqual(DEFAULT_IDENTICON); +}); diff --git a/packages/starter-dapp/src/utils/addressAvatar.ts b/packages/starter-dapp/src/utils/addressAvatar.ts new file mode 100644 index 00000000000..132fb8fe3e5 --- /dev/null +++ b/packages/starter-dapp/src/utils/addressAvatar.ts @@ -0,0 +1,21 @@ +import Identicon from "identicon.js"; +import { ethers } from "ethers"; + +export const DEFAULT_IDENTICON = new Identicon( + "c157a79031e1c40f85931829bc5fc552", + { + foreground: [0, 0, 0, 255], + background: [255, 255, 255, 255], + margin: 0.2, + size: 420, + } +).toString(); + +export const getAddressAvatarFromIdenticon = (address: string): string => { + if (!address || !ethers.utils.isAddress(address)) { + return DEFAULT_IDENTICON; + } + + const data = new Identicon(address, 420).toString(); + return data; +}; diff --git a/packages/starter-dapp/src/utils/addressSubsection.spec.ts b/packages/starter-dapp/src/utils/addressSubsection.spec.ts new file mode 100644 index 00000000000..d9b26eca0a9 --- /dev/null +++ b/packages/starter-dapp/src/utils/addressSubsection.spec.ts @@ -0,0 +1,13 @@ +import { addressSubsection } from "./addressSubsection"; + +it("should return string with prefix and suffix", () => { + const dummyAddress = "0x63FaC9201494f0bd17B9892B9fae4d52fe3BD377"; + + expect(addressSubsection(dummyAddress)).toStrictEqual("0x63F...D377"); +}); + +it("should return 0x if empty", () => { + const dummyAddress = ""; + + expect(addressSubsection("")).toStrictEqual("0x"); +}); diff --git a/packages/starter-dapp/src/utils/addressSubsection.ts b/packages/starter-dapp/src/utils/addressSubsection.ts new file mode 100644 index 00000000000..5d4b7e201a1 --- /dev/null +++ b/packages/starter-dapp/src/utils/addressSubsection.ts @@ -0,0 +1,4 @@ +export const addressSubsection = (address: string) => { + if (!address) return "0x"; + return `${address.substring(0, 5)}...${address.substring(38, 42)}`; +}; diff --git a/packages/starter-dapp/src/utils/remove0xPrefixIfPresent.spec.ts b/packages/starter-dapp/src/utils/remove0xPrefixIfPresent.spec.ts new file mode 100644 index 00000000000..fbf1f658f7a --- /dev/null +++ b/packages/starter-dapp/src/utils/remove0xPrefixIfPresent.spec.ts @@ -0,0 +1,7 @@ +import { remove0xPrefixIfPresent } from "./remove0xPrefixIfPresent"; + +it("Should remove 0x if it is present (for 1-n sets of '0x'), and leave string alone if not", () => { + expect(remove0xPrefixIfPresent("0x555")).toStrictEqual("555"); + expect(remove0xPrefixIfPresent("0x0x0x555")).toStrictEqual("555"); + expect(remove0xPrefixIfPresent("555")).toStrictEqual("555"); +}); diff --git a/packages/starter-dapp/src/utils/remove0xPrefixIfPresent.ts b/packages/starter-dapp/src/utils/remove0xPrefixIfPresent.ts new file mode 100644 index 00000000000..d5cc971dc0c --- /dev/null +++ b/packages/starter-dapp/src/utils/remove0xPrefixIfPresent.ts @@ -0,0 +1,12 @@ +function remove0xPrefixIfPresent(s: string): string { + if (!s.startsWith("0x")) { + return s; + } + + while (s.startsWith("0x")) { + s = s.slice(2); + } + return s; +} + +export { remove0xPrefixIfPresent }; diff --git a/packages/starter-dapp/src/utils/switchEthereumChain.ts b/packages/starter-dapp/src/utils/switchEthereumChain.ts new file mode 100644 index 00000000000..189a3a3ba19 --- /dev/null +++ b/packages/starter-dapp/src/utils/switchEthereumChain.ts @@ -0,0 +1,40 @@ +import type { Ethereum } from "@wagmi/core"; +import { ethers } from "ethers"; +import type { Chain } from "../domain/chain"; + +export const switchEthereumChain = async (ethereum: Ethereum, chain: Chain) => { + try { + await ethereum.request({ + method: "wallet_switchEthereumChain", + params: [{ chainId: ethers.utils.hexValue(chain.id) }], + }); + } catch (switchError) { + // This error code indicates that the chain has not been added to MetaMask. + if ( + switchError.code === 4902 || + switchError?.data?.originalError?.code === 4902 + ) { + try { + await ethereum.request({ + method: "wallet_addEthereumChain", + params: [ + { + chainId: ethers.utils.hexValue(chain.id), + chainName: chain.name, + rpcUrls: [chain.rpc], + nativeCurrency: { + symbol: "ETH", + decimals: 18, + name: "Ethereum", + }, + }, + ], + }); + } catch (addError) { + throw addError; + } + } else { + throw switchError; + } + } +}; diff --git a/packages/starter-dapp/src/utils/toast.spec.ts b/packages/starter-dapp/src/utils/toast.spec.ts new file mode 100644 index 00000000000..b6ba65d8d8c --- /dev/null +++ b/packages/starter-dapp/src/utils/toast.spec.ts @@ -0,0 +1,24 @@ +const mockPush = jest.fn(); + +jest.mock("@zerodevx/svelte-toast", () => ({ + ...(jest.requireActual("@zerodevx/svelte-toast") as object), + toast: { + push: mockPush, + }, +})); + +import { successToast, errorToast, successOpts, errorOpts } from "./toast"; +describe("toasts", function () { + beforeEach(() => { + jest.resetAllMocks(); + }); + it("should call successToast with msg and opts", () => { + successToast("msg"); + expect(mockPush).toHaveBeenCalledWith("msg", successOpts); + }); + + it("should call errorToast with msg and opts", () => { + errorToast("msg"); + expect(mockPush).toHaveBeenCalledWith("msg", errorOpts); + }); +}); diff --git a/packages/starter-dapp/src/utils/toast.ts b/packages/starter-dapp/src/utils/toast.ts new file mode 100644 index 00000000000..acc3ace9fa1 --- /dev/null +++ b/packages/starter-dapp/src/utils/toast.ts @@ -0,0 +1,36 @@ +import { toast } from "@zerodevx/svelte-toast"; +import type { SvelteToastOptions } from "@zerodevx/svelte-toast"; + +export const errorOpts: SvelteToastOptions = { + theme: { + "--toastBackground": "#FF0000", + "--toastColor": "#e3e3e3", + "--toastHeight": "50px", + "--toastContainerTop": "auto", + "--toastContainerRight": "auto", + "--toastContainerBottom": "2rem", + "--toastContainerLeft": "auto", + "--toastBorderRadius": "0.9rem", + }, +}; + +export const successOpts: SvelteToastOptions = { + theme: { + "--toastBackground": "#008000", + "--toastColor": "#e3e3e3", + "--toastHeight": "50px", + "--toastContainerTop": "auto", + "--toastContainerRight": "auto", + "--toastContainerBottom": "2rem", + "--toastContainerLeft": "auto", + "--toastBorderRadius": "0.9rem", + }, +}; + +export const errorToast = (msg: string) => { + toast.push(msg, errorOpts); +}; + +export const successToast = (msg: string) => { + toast.push(msg, successOpts); +}; diff --git a/packages/starter-dapp/src/utils/truncateString.spec.ts b/packages/starter-dapp/src/utils/truncateString.spec.ts new file mode 100644 index 00000000000..1aee7850d6d --- /dev/null +++ b/packages/starter-dapp/src/utils/truncateString.spec.ts @@ -0,0 +1,20 @@ +import { truncateString } from "./truncateString"; + +it("should truncate when string > maxLength", () => { + const dummyBalance = + "148234732894732894723894432847328947.42384732894732894732894"; + + expect(truncateString(dummyBalance)).toStrictEqual("1482347328"); +}); + +it("should return string when < maxLength", () => { + const dummyBalance = "1"; + + expect(truncateString(dummyBalance, 2)).toStrictEqual(dummyBalance); +}); + +it("should return empty string if empty", () => { + const dummyAddress = ""; + + expect(truncateString("")).toStrictEqual(""); +}); diff --git a/packages/starter-dapp/src/utils/truncateString.ts b/packages/starter-dapp/src/utils/truncateString.ts new file mode 100644 index 00000000000..3e969178e2d --- /dev/null +++ b/packages/starter-dapp/src/utils/truncateString.ts @@ -0,0 +1,4 @@ +export const truncateString = (str: string, maxLength: number = 10) => { + if (!str) return ""; + return str.length > maxLength ? `${str.substring(0, maxLength)}` : str; +}; diff --git a/packages/starter-dapp/src/vite-env.d.ts b/packages/starter-dapp/src/vite-env.d.ts new file mode 100644 index 00000000000..4078e7476a2 --- /dev/null +++ b/packages/starter-dapp/src/vite-env.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/packages/starter-dapp/svelte.config.cjs b/packages/starter-dapp/svelte.config.cjs new file mode 100644 index 00000000000..8bf5d4b3f50 --- /dev/null +++ b/packages/starter-dapp/svelte.config.cjs @@ -0,0 +1,7 @@ +const sveltePreprocess = require('svelte-preprocess'); + +module.exports = { + // Consult https://github.com/sveltejs/svelte-preprocess + // for more information about preprocessors + preprocess: sveltePreprocess() +} diff --git a/packages/starter-dapp/tailwind.config.cjs b/packages/starter-dapp/tailwind.config.cjs new file mode 100644 index 00000000000..d5c19f5be03 --- /dev/null +++ b/packages/starter-dapp/tailwind.config.cjs @@ -0,0 +1,93 @@ +const colors = require("tailwindcss/colors"); +module.exports = { + content: ["./src/**/*.{html,js,svelte,ts}"], + plugins: [require("daisyui")], + darkMode: ['[data-theme="dark"]'], + theme: { + extend: { + colors: { + "dark-1": "var(--color-dark-1)", + "dark-2": "var(--color-dark-2)", + "dark-3": "var(--color-dark-3)", + "dark-4": "var(--color-dark-4)", + "dark-5": "var(--color-dark-5)", + "dark-6": "var(--color-dark-6)", + "transaction-table": "var(--color-transaction-table)", + "bridge-form": "var(--color-bridge-form)", + }, + keyframes: { + rise: { + '0%': { position: 'absolute', bottom: '-10px' }, + // '100%': { position: 'static' }, + } + }, + animation: { + rise: 'rise 0.5s ease-in-out', + } + } + }, + daisyui: { + styled: true, + themes: true, + base: true, + utils: true, + logs: true, + rtl: false, + prefix: "", + darkTheme: "dark", + themes: [ + { + dark: { + ...require("daisyui/colors/themes")["[data-theme=black]"], + "primary": "#242424", + "secondary": "#181818", + "accent": "#FC0FC0", + "accent-focus": "#E30EAD", + "accent-content": "#F3F3F3", + "neutral": "#242424", + "base-100": "#0F0F0F", + "info": "#373737", + "success": "#008000", + "warning": "#FFFF00", + "error": "#FF0000", + "--color-dark-1": "#000000", + "--color-dark-2": "#181818", + "--color-dark-3": "#0F0F0F", + "--color-dark-4": "#242424", + "--color-dark-5": "#373737", + "--color-dark-6": "#4F4F4F", + "--color-transaction-table": "#FFFFFF", + "--rounded-btn": "1rem", + "--btn-text-case": "capitalize", + "--rounded-box": "18px", + "--color-bridge-form": colors.zinc[800], + }, + light: { + ...require("daisyui/colors/themes")["[data-theme=light]"], + "accent": "#FC0FC0", + "accent-focus": "#E30EAD", + "accent-content": "#F3F3F3", + "neutral": "#d4d4d4", + "neutral-focus": "#a3a3a3", + "neutral-content": "#181818", + "base-100": "#FAFAFA", + "info": "#373737", + "success": "#008000", + "warning": "#FFFF00", + "error": "#FF0000", + "--color-dark-1": "#000000", + "--color-dark-2": "#FFFFFF", + "--color-dark-3": "#FAFAFA", + "--color-dark-4": "#242424", + "--color-dark-5": "#CDCDCD", + "--color-dark-6": "#4F4F4F", + "--color-transaction-table": "#1F2937", + "--rounded-btn": "1rem", + "--btn-text-case": "capitalize", + "--rounded-box": "18px", + "--color-bridge-form": colors.zinc[200], + }, + }, + ], + } +}; diff --git a/packages/starter-dapp/tsconfig.json b/packages/starter-dapp/tsconfig.json new file mode 100644 index 00000000000..9094dab45e5 --- /dev/null +++ b/packages/starter-dapp/tsconfig.json @@ -0,0 +1,21 @@ +{ + "extends": "@tsconfig/svelte/tsconfig.json", + "compilerOptions": { + "target": "es2022", + "useDefineForClassFields": true, + "module": "es2022", + "resolveJsonModule": true, + "baseUrl": ".", + /** + * Typecheck JS in `.svelte` and `.js` files by default. + * Disable checkJs if you'd like to use dynamic types in JS. + * Note that setting allowJs false does not prevent the use + * of JS in `.svelte` files. + */ + "allowJs": true, + "checkJs": true, + "isolatedModules": false + }, + "include": ["src/**/*.d.ts", "src/**/*.ts", "src/**/*.js", "src/**/*.svelte"], + "references": [{ "path": "./tsconfig.node.json" }] +} diff --git a/packages/starter-dapp/tsconfig.node.json b/packages/starter-dapp/tsconfig.node.json new file mode 100644 index 00000000000..65dbdb96ae5 --- /dev/null +++ b/packages/starter-dapp/tsconfig.node.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "composite": true, + "module": "ESNext", + "moduleResolution": "Node" + }, + "include": ["vite.config.ts"] +} diff --git a/packages/starter-dapp/vite.config.ts b/packages/starter-dapp/vite.config.ts new file mode 100644 index 00000000000..e90bff74dde --- /dev/null +++ b/packages/starter-dapp/vite.config.ts @@ -0,0 +1,26 @@ +import { defineConfig } from "vite"; +import { svelte } from "@sveltejs/vite-plugin-svelte"; +import polyfillNode from "rollup-plugin-polyfill-node"; +import { viteStaticCopy } from "vite-plugin-static-copy"; + +// https://vitejs.dev/config/ +export default defineConfig({ + define: { + global: 'globalThis', + 'process.env.NODE_DEBUG': false, + 'process.env.LINK_API_URL': false, + 'process.env.SDK_VERSION': "'unknown'" + }, + plugins: [ + svelte(), + polyfillNode(), + viteStaticCopy({ + targets: [ + { + src: "src/assets/lottie/loader.json", + dest: "lottie", + }, + ], + }), + ], +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4423aa5bec6..91ccb367d46 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -218,6 +218,111 @@ importers: packages/relayer: specifiers: {} + packages/starter-dapp: + specifiers: + '@babel/preset-env': ^7.16.0 + '@coinbase/wallet-sdk': ^3.6.3 + '@ethersproject/experimental': ^5.7.0 + '@lottiefiles/svelte-lottie-player': ^0.2.0 + '@sveltejs/vite-plugin-svelte': ^1.0.1 + '@sveltestack/svelte-query': ^1.6.0 + '@tsconfig/svelte': ^3.0.0 + '@types/eslint': ^8.2.1 + '@types/estree': ^0.0.50 + '@types/jest': ^27.0.2 + '@types/mixpanel': ^2.14.3 + '@types/sanitize-html': ^2.6.2 + '@typescript-eslint/eslint-plugin': ^5.16.0 + '@typescript-eslint/parser': ^5.16.0 + '@wagmi/connectors': ^0.1.1 + '@wagmi/core': ^0.8.0 + '@zerodevx/svelte-toast': ^0.6.3 + autoprefixer: ^10.4.13 + axios: ^1.2.0 + babel-jest: ^27.3.1 + babel-plugin-transform-es2015-modules-commonjs: ^6.26.2 + buffer: ^6.0.3 + daisyui: 1.16.6 + ethers: ^5.7.1 + identicon.js: ^2.3.3 + jest: ^27.5.1 + node-sass: ^7.0.1 + postcss: ^8.4.19 + postcss-cli: ^7.1.2 + postcss-loader: ^6.2.0 + prettier: 2.7.1 + rollup-plugin-node-builtins: ^2.0.0 + rollup-plugin-polyfill-node: ^0.10.2 + svelte: ^3.53.1 + svelte-check: ^2.8.0 + svelte-heros-v2: ^0.3.10 + svelte-i18n: ^3.5.1 + svelte-jester: ^2.1.5 + svelte-loader: ^3.1.2 + svelte-preprocess: ^4.10.7 + svelte-spa-router: ^3.2.0 + tailwindcss: ^3.2.4 + theme-change: ^2.2.0 + ts-jest: ^27.0.7 + ts-jest-mock-import-meta: ^0.12.0 + ts-loader: ^9.2.6 + tslib: ^2.4.0 + typescript: ^4.6.4 + vite: ^3.0.0 + vite-plugin-static-copy: ^0.12.0 + dependencies: + '@coinbase/wallet-sdk': 3.6.3_@babel+core@7.20.2 + '@ethersproject/experimental': 5.7.0 + '@lottiefiles/svelte-lottie-player': 0.2.0 + '@sveltestack/svelte-query': 1.6.0 + '@wagmi/connectors': 0.1.1_wklos3touta4goq4ye6zjwurtq + '@wagmi/core': 0.8.4_gexomxxtwfnmlvmj4reuwmegee + axios: 1.2.0 + buffer: 6.0.3 + ethers: 5.7.2 + identicon.js: 2.3.3 + svelte-i18n: 3.5.2_svelte@3.53.1 + svelte-spa-router: 3.3.0 + devDependencies: + '@babel/preset-env': 7.20.2_@babel+core@7.20.2 + '@sveltejs/vite-plugin-svelte': 1.3.1_svelte@3.53.1+vite@3.2.4 + '@tsconfig/svelte': 3.0.0 + '@types/eslint': 8.4.10 + '@types/estree': 0.0.50 + '@types/jest': 27.5.2 + '@types/mixpanel': 2.14.4 + '@types/sanitize-html': 2.6.2 + '@typescript-eslint/eslint-plugin': 5.44.0_wn2lldm33jszzpptq7r22sqksi + '@typescript-eslint/parser': 5.44.0_jofidmxrjzhj7l6vknpw5ecvfe + '@zerodevx/svelte-toast': 0.6.3 + autoprefixer: 10.4.13_postcss@8.4.21 + babel-jest: 27.5.1_@babel+core@7.20.2 + babel-plugin-transform-es2015-modules-commonjs: 6.26.2 + daisyui: 1.16.6 + jest: 27.5.1 + node-sass: 7.0.3 + postcss: 8.4.21 + postcss-cli: 7.1.2 + postcss-loader: 6.2.1_6jdsrmfenkuhhw3gx4zvjlznce + prettier: 2.7.1 + rollup-plugin-node-builtins: 2.1.2 + rollup-plugin-polyfill-node: 0.10.2_rollup@2.79.1 + svelte: 3.53.1 + svelte-check: 2.9.2_qusgu27jzmoklr7jjlsel7vazu + svelte-heros-v2: 0.3.10 + svelte-jester: 2.3.2_jest@27.5.1+svelte@3.53.1 + svelte-loader: 3.1.4_svelte@3.53.1 + svelte-preprocess: 4.10.7_y4sunccvtjgz4dr3g3pzi7kmze + tailwindcss: 3.2.6_postcss@8.4.21 + theme-change: 2.2.0 + ts-jest: 27.1.5_tr6btbnawl4wz6is4v2fl47ayu + ts-jest-mock-import-meta: 0.12.0_ts-jest@27.1.5 + ts-loader: 9.4.1_hhrrucqyg4eysmfpujvov2ym5u + tslib: 2.5.0 + typescript: 4.9.5 + vite: 3.2.4 + vite-plugin-static-copy: 0.12.0_vite@3.2.4 + packages/status-page: specifiers: '@babel/preset-env': ^7.16.0 @@ -443,7 +548,7 @@ packages: '@babel/compat-data': 7.20.1 '@babel/core': 7.20.2 '@babel/helper-validator-option': 7.18.6 - browserslist: 4.21.4 + browserslist: 4.21.5 semver: 6.3.0 /@babel/helper-create-class-features-plugin/7.20.2_@babel+core@7.20.2: @@ -1503,13 +1608,6 @@ packages: engines: {node: '>=6.9.0'} dependencies: regenerator-runtime: 0.13.11 - dev: false - - /@babel/runtime/7.20.7: - resolution: {integrity: sha512-UF0tvkUtxwAgZ5W/KrkHf0Rn0fdnLDU9ScxBrEVNUprE/MzirjK4MJUX1/BVDv00Sv8cljtukVK1aky++X1SjQ==} - engines: {node: '>=6.9.0'} - dependencies: - regenerator-runtime: 0.13.11 /@babel/template/7.18.10: resolution: {integrity: sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA==} @@ -3335,7 +3433,7 @@ packages: resolution: {integrity: sha512-9JAFXAWB3yhUHnoahzemTz4TcsGqmITPArNlm9795e+LA/DYkIEJIXIosV4ImzDMfqolymZeRgG3O8ewNgYTTA==} engines: {node: '>=12.20.0'} dependencies: - '@babel/runtime': 7.20.7 + '@babel/runtime': 7.20.13 '@noble/ed25519': 1.7.1 '@noble/hashes': 1.1.2 '@noble/secp256k1': 1.6.3 @@ -3954,6 +4052,33 @@ packages: - supports-color dev: true + /@typescript-eslint/eslint-plugin/5.44.0_wn2lldm33jszzpptq7r22sqksi: + resolution: {integrity: sha512-j5ULd7FmmekcyWeArx+i8x7sdRHzAtXTkmDPthE4amxZOWKFK7bomoJ4r7PJ8K7PoMzD16U8MmuZFAonr1ERvw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + '@typescript-eslint/parser': ^5.0.0 + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/parser': 5.44.0_jofidmxrjzhj7l6vknpw5ecvfe + '@typescript-eslint/scope-manager': 5.44.0 + '@typescript-eslint/type-utils': 5.44.0_jofidmxrjzhj7l6vknpw5ecvfe + '@typescript-eslint/utils': 5.44.0_jofidmxrjzhj7l6vknpw5ecvfe + debug: 4.3.4 + eslint: 7.32.0 + ignore: 5.2.0 + natural-compare-lite: 1.4.0 + regexpp: 3.2.0 + semver: 7.3.8 + tsutils: 3.21.0_typescript@4.9.5 + typescript: 4.9.5 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/experimental-utils/4.33.0_77fvizpdb3y4icyeo2mf4eo7em: resolution: {integrity: sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q==} engines: {node: ^10.12.0 || >=12.0.0} @@ -4012,6 +4137,26 @@ packages: - supports-color dev: true + /@typescript-eslint/parser/5.44.0_jofidmxrjzhj7l6vknpw5ecvfe: + resolution: {integrity: sha512-H7LCqbZnKqkkgQHaKLGC6KUjt3pjJDx8ETDqmwncyb6PuoigYajyAwBGz08VU/l86dZWZgI4zm5k2VaKqayYyA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/scope-manager': 5.44.0 + '@typescript-eslint/types': 5.44.0 + '@typescript-eslint/typescript-estree': 5.44.0_typescript@4.9.5 + debug: 4.3.4 + eslint: 7.32.0 + typescript: 4.9.5 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/scope-manager/4.33.0: resolution: {integrity: sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ==} engines: {node: ^8.10.0 || ^10.13.0 || >=11.10.1} @@ -4048,6 +4193,26 @@ packages: - supports-color dev: true + /@typescript-eslint/type-utils/5.44.0_jofidmxrjzhj7l6vknpw5ecvfe: + resolution: {integrity: sha512-A1u0Yo5wZxkXPQ7/noGkRhV4J9opcymcr31XQtOzcc5nO/IHN2E2TPMECKWYpM3e6olWEM63fq/BaL1wEYnt/w==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: '*' + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/typescript-estree': 5.44.0_typescript@4.9.5 + '@typescript-eslint/utils': 5.44.0_jofidmxrjzhj7l6vknpw5ecvfe + debug: 4.3.4 + eslint: 7.32.0 + tsutils: 3.21.0_typescript@4.9.5 + typescript: 4.9.5 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/types/4.33.0: resolution: {integrity: sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ==} engines: {node: ^8.10.0 || ^10.13.0 || >=11.10.1} @@ -4100,6 +4265,27 @@ packages: - supports-color dev: true + /@typescript-eslint/typescript-estree/5.44.0_typescript@4.9.5: + resolution: {integrity: sha512-M6Jr+RM7M5zeRj2maSfsZK2660HKAJawv4Ud0xT+yauyvgrsHu276VtXlKDFnEmhG+nVEd0fYZNXGoAgxwDWJw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 5.44.0 + '@typescript-eslint/visitor-keys': 5.44.0 + debug: 4.3.4 + globby: 11.1.0 + is-glob: 4.0.3 + semver: 7.3.8 + tsutils: 3.21.0_typescript@4.9.5 + typescript: 4.9.5 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/utils/5.44.0_77fvizpdb3y4icyeo2mf4eo7em: resolution: {integrity: sha512-fMzA8LLQ189gaBjS0MZszw5HBdZgVwxVFShCO3QN+ws3GlPkcy9YuS3U4wkT6su0w+Byjq3mS3uamy9HE4Yfjw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -4120,6 +4306,26 @@ packages: - typescript dev: true + /@typescript-eslint/utils/5.44.0_jofidmxrjzhj7l6vknpw5ecvfe: + resolution: {integrity: sha512-fMzA8LLQ189gaBjS0MZszw5HBdZgVwxVFShCO3QN+ws3GlPkcy9YuS3U4wkT6su0w+Byjq3mS3uamy9HE4Yfjw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + dependencies: + '@types/json-schema': 7.0.11 + '@types/semver': 7.3.13 + '@typescript-eslint/scope-manager': 5.44.0 + '@typescript-eslint/types': 5.44.0 + '@typescript-eslint/typescript-estree': 5.44.0_typescript@4.9.5 + eslint: 7.32.0 + eslint-scope: 5.1.1 + eslint-utils: 3.0.0_eslint@7.32.0 + semver: 7.3.8 + transitivePeerDependencies: + - supports-color + - typescript + dev: true + /@typescript-eslint/visitor-keys/4.33.0: resolution: {integrity: sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg==} engines: {node: ^8.10.0 || ^10.13.0 || >=11.10.1} @@ -4243,6 +4449,64 @@ packages: - utf-8-validate dev: false + /@wagmi/connectors/0.1.1_wklos3touta4goq4ye6zjwurtq: + resolution: {integrity: sha512-W9w73o9HCYzuBsDHuujwBT/nGGIu5qLBSqVqslXf/S1Q9OiWoudmuIs3opuYqxgw5MpWbMqhq6QaxA7Qcd6NrA==} + peerDependencies: + '@wagmi/core': 0.8.x + ethers: ^5.0.0 + peerDependenciesMeta: + '@wagmi/core': + optional: true + dependencies: + '@coinbase/wallet-sdk': 3.6.3_@babel+core@7.20.2 + '@ledgerhq/connect-kit-loader': 1.0.1 + '@wagmi/core': 0.8.4_gexomxxtwfnmlvmj4reuwmegee + '@walletconnect/ethereum-provider': 1.8.0 + abitype: 0.1.8_typescript@4.9.5 + ethers: 5.7.2 + eventemitter3: 4.0.7 + transitivePeerDependencies: + - '@babel/core' + - bufferutil + - debug + - encoding + - supports-color + - typescript + - utf-8-validate + dev: false + + /@wagmi/core/0.8.4_gexomxxtwfnmlvmj4reuwmegee: + resolution: {integrity: sha512-orFRGOei+ixH8fIU9DitjKFSnv7sEv4j0A32gin2aADLuyBsAqG7xD+5LzfVD8EarHzU98Mk9d4hmmIkMg8bXw==} + peerDependencies: + '@coinbase/wallet-sdk': '>=3.6.0' + '@walletconnect/ethereum-provider': '>=1.7.5' + ethers: '>=5.5.1' + peerDependenciesMeta: + '@coinbase/wallet-sdk': + optional: true + '@walletconnect/ethereum-provider': + optional: true + dependencies: + '@coinbase/wallet-sdk': 3.6.3_@babel+core@7.20.2 + '@wagmi/chains': 0.1.3 + '@wagmi/connectors': 0.1.1_wklos3touta4goq4ye6zjwurtq + abitype: 0.2.5_typescript@4.9.5 + ethers: 5.7.2 + eventemitter3: 4.0.7 + zustand: 4.1.4_react@18.2.0 + transitivePeerDependencies: + - '@babel/core' + - bufferutil + - debug + - encoding + - immer + - react + - supports-color + - typescript + - utf-8-validate + - zod + dev: false + /@wagmi/core/0.8.4_xvrh6f4niupavonwizjzh3wv4q: resolution: {integrity: sha512-orFRGOei+ixH8fIU9DitjKFSnv7sEv4j0A32gin2aADLuyBsAqG7xD+5LzfVD8EarHzU98Mk9d4hmmIkMg8bXw==} peerDependencies: @@ -4287,6 +4551,7 @@ packages: /@walletconnect/client/1.8.0: resolution: {integrity: sha512-svyBQ14NHx6Cs2j4TpkQaBI/2AF4+LXz64FojTjMtV4VMMhl81jSO1vNeg+yYhQzvjcGH/GpSwixjyCW0xFBOQ==} + deprecated: 'WalletConnect''s v1 SDKs are now deprecated. Please upgrade to a v2 SDK. For details see: https://docs.walletconnect.com/' dependencies: '@walletconnect/core': 1.8.0 '@walletconnect/iso-crypto': 1.8.0 @@ -4400,6 +4665,7 @@ packages: /@walletconnect/qrcode-modal/1.8.0: resolution: {integrity: sha512-BueaFefaAi8mawE45eUtztg3ZFbsAH4DDXh1UNwdUlsvFMjqcYzLUG0xZvDd6z2eOpbgDg2N3bl6gF0KONj1dg==} + deprecated: 'WalletConnect''s v1 SDKs are now deprecated. Please upgrade to a v2 SDK. For details see: https://docs.walletconnect.com/' dependencies: '@walletconnect/browser-utils': 1.8.0 '@walletconnect/mobile-registry': 1.4.0 @@ -4455,6 +4721,7 @@ packages: /@walletconnect/types/1.8.0: resolution: {integrity: sha512-Cn+3I0V0vT9ghMuzh1KzZvCkiAxTq+1TR2eSqw5E5AVWfmCtECFkVZBP6uUJZ8YjwLqXheI+rnjqPy7sVM4Fyg==} + deprecated: 'WalletConnect''s v1 SDKs are now deprecated. Please upgrade to a v2 SDK. For details see: https://docs.walletconnect.com/' dev: false /@walletconnect/utils/1.8.0: @@ -4632,6 +4899,15 @@ packages: typescript: 4.9.3 dev: false + /abitype/0.1.8_typescript@4.9.5: + resolution: {integrity: sha512-2pde0KepTzdfu19ZrzYTYVIWo69+6UbBCY4B1RDiwWgo2XZtFSJhF6C+XThuRXbbZ823J0Rw1Y5cP0NXYVcCdQ==} + engines: {pnpm: '>=7'} + peerDependencies: + typescript: '>=4.7.4' + dependencies: + typescript: 4.9.5 + dev: false + /abitype/0.2.5_typescript@4.9.3: resolution: {integrity: sha512-t1iiokWYpkrziu4WL2Gb6YdGvaP9ZKs7WnA39TI8TsW2E99GVRgDPW/xOKhzoCdyxOYt550CNYEFluCwGaFHaA==} engines: {pnpm: '>=7'} @@ -4645,6 +4921,19 @@ packages: typescript: 4.9.3 dev: false + /abitype/0.2.5_typescript@4.9.5: + resolution: {integrity: sha512-t1iiokWYpkrziu4WL2Gb6YdGvaP9ZKs7WnA39TI8TsW2E99GVRgDPW/xOKhzoCdyxOYt550CNYEFluCwGaFHaA==} + engines: {pnpm: '>=7'} + peerDependencies: + typescript: '>=4.7.4' + zod: '>=3.19.1' + peerDependenciesMeta: + zod: + optional: true + dependencies: + typescript: 4.9.5 + dev: false + /abort-controller/3.0.0: resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} engines: {node: '>=6.5'} @@ -5213,8 +5502,8 @@ packages: peerDependencies: postcss: ^8.1.0 dependencies: - browserslist: 4.21.5 - caniuse-lite: 1.0.30001451 + browserslist: 4.21.4 + caniuse-lite: 1.0.30001434 fraction.js: 4.2.0 normalize-range: 0.1.2 picocolors: 1.0.0 @@ -6161,8 +6450,8 @@ packages: resolution: {integrity: sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ==} hasBin: true dependencies: - caniuse-lite: 1.0.30001444 - electron-to-chromium: 1.4.284 + caniuse-lite: 1.0.30001451 + electron-to-chromium: 1.4.291 dev: true /browserslist/4.21.4: @@ -6184,7 +6473,6 @@ packages: electron-to-chromium: 1.4.291 node-releases: 2.0.10 update-browserslist-db: 1.0.10_browserslist@4.21.5 - dev: true /bs-logger/0.2.6: resolution: {integrity: sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==} @@ -6459,10 +6747,6 @@ packages: resolution: {integrity: sha512-aOBHrLmTQw//WFa2rcF1If9fa3ypkC1wzqqiKHgfdrXTWcU8C4gKVZT77eQAPWN1APys3+uQ0Df07rKauXGEYA==} dev: true - /caniuse-lite/1.0.30001444: - resolution: {integrity: sha512-ecER9xgJQVMqcrxThKptsW0pPxSae8R2RB87LNa+ivW9ppNWRHEplXcDzkCOP4LYWGj8hunXLqaiC41iBATNyg==} - dev: true - /caniuse-lite/1.0.30001447: resolution: {integrity: sha512-bdKU1BQDPeEXe9A39xJnGtY0uRq/z5osrnXUw0TcK+EYno45Y+U7QU9HhHEyzvMDffpYadFXi3idnSNkcwLkTw==} @@ -7960,7 +8244,6 @@ packages: /electron-to-chromium/1.4.291: resolution: {integrity: sha512-8vk4rSMBh9LRfZKE6wcxOLmlfA4Xsa4v0RRwB6VJkAH703klC9XfZIocmTk2gLBzW31P6XbuNeMt1aB5aAu/2g==} - dev: true /elliptic/6.5.4: resolution: {integrity: sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==} @@ -8799,7 +9082,7 @@ packages: resolution: {integrity: sha512-A8tG4Z4iNg4mw5tP1Vung9N9IjgMNqpiMoJ/FouSFwNCGHv2X0mmOYwtQOJzki6XN7r7Tyo01S29p7b224I4jw==} dependencies: '@babel/plugin-transform-runtime': 7.19.6_@babel+core@7.20.2 - '@babel/runtime': 7.20.7 + '@babel/runtime': 7.20.13 eth-query: 2.1.2 json-rpc-random-id: 1.0.1 pify: 3.0.0 @@ -11058,7 +11341,7 @@ packages: '@formatjs/ecma402-abstract': 1.11.4 '@formatjs/fast-memoize': 1.2.1 '@formatjs/icu-messageformat-parser': 2.1.0 - tslib: 2.4.1 + tslib: 2.5.0 dev: false /invariant/2.2.4: @@ -14468,7 +14751,6 @@ packages: /node-releases/2.0.10: resolution: {integrity: sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==} - dev: true /node-releases/2.0.8: resolution: {integrity: sha512-dFSmB8fFHEH/s81Xi+Y/15DQY6VHW81nXRj86EMSL3lmuTmK1e+aT4wrFCkTbm+gSwkw4KpX+rT/pMM2c1mF+A==} @@ -15306,6 +15588,20 @@ packages: yaml: 1.10.2 dev: true + /postcss-loader/6.2.1_6jdsrmfenkuhhw3gx4zvjlznce: + resolution: {integrity: sha512-WbbYpmAaKcux/P66bZ40bpWsBucjx/TTgVVzRZ9yUO8yQfVBlameJ0ZGVaPfH64hNSBh63a+ICP5nqOpBA0w+Q==} + engines: {node: '>= 12.13.0'} + peerDependencies: + postcss: ^7.0.0 || ^8.0.1 + webpack: ^5.0.0 + dependencies: + cosmiconfig: 7.1.0 + klona: 2.0.5 + postcss: 8.4.21 + semver: 7.3.8 + webpack: 5.75.0 + dev: true + /postcss-loader/6.2.1_upg3rk2kpasnbk27hkqapxaxfq: resolution: {integrity: sha512-WbbYpmAaKcux/P66bZ40bpWsBucjx/TTgVVzRZ9yUO8yQfVBlameJ0ZGVaPfH64hNSBh63a+ICP5nqOpBA0w+Q==} engines: {node: '>= 12.13.0'} @@ -15993,7 +16289,7 @@ packages: /regenerator-transform/0.15.1: resolution: {integrity: sha512-knzmNAcuyxV+gQCufkYcvOqX/qIIfHLv0u5x79kRxuGojfYVky1f15TzZEu2Avte8QGepvUNTnLskf8E6X6Vyg==} dependencies: - '@babel/runtime': 7.20.7 + '@babel/runtime': 7.20.13 dev: true /regex-not/1.0.2: @@ -16443,7 +16739,7 @@ packages: /rpc-websockets/7.5.0: resolution: {integrity: sha512-9tIRi1uZGy7YmDjErf1Ax3wtqdSSLIlnmL5OtOzgd5eqPKbsPpwDP5whUDO2LQay3Xp0CcHlcNSGzacNRluBaQ==} dependencies: - '@babel/runtime': 7.20.7 + '@babel/runtime': 7.20.13 eventemitter3: 4.0.7 uuid: 8.3.2 ws: 8.11.0_3cxu5zja4e2r5wmvge7mdcljwq @@ -16478,7 +16774,7 @@ packages: /rxjs/7.5.7: resolution: {integrity: sha512-z9MzKh/UcOqB3i20H6rtrlaE/CgjLOvheWK/9ILrbhROGTweAi1BaFsTT9FbwZi5Trr1qNRs+MXkhmR06awzQA==} dependencies: - tslib: 2.4.1 + tslib: 2.5.0 dev: true /sade/1.8.1: @@ -17587,6 +17883,34 @@ packages: - sugarss dev: true + /svelte-check/2.9.2_qusgu27jzmoklr7jjlsel7vazu: + resolution: {integrity: sha512-DRi8HhnCiqiGR2YF9ervPGvtoYrheE09cXieCTEqeTPOTJzfoa54Py8rovIBv4bH4n5HgZYIyTQ3DDLHQLl2uQ==} + hasBin: true + peerDependencies: + svelte: ^3.24.0 + dependencies: + '@jridgewell/trace-mapping': 0.3.17 + chokidar: 3.5.3 + fast-glob: 3.2.12 + import-fresh: 3.3.0 + picocolors: 1.0.0 + sade: 1.8.1 + svelte: 3.53.1 + svelte-preprocess: 4.10.7_y4sunccvtjgz4dr3g3pzi7kmze + typescript: 4.9.5 + transitivePeerDependencies: + - '@babel/core' + - coffeescript + - less + - node-sass + - postcss + - postcss-load-config + - pug + - sass + - stylus + - sugarss + dev: true + /svelte-dev-helper/1.1.9: resolution: {integrity: sha512-oU+Xv7Dl4kRU2kdFjsoPLfJfnt5hUhsFUZtuzI3Ku/f2iAFZqBoEuXOqK3N9ngD4dxQOmN4OKWPHVi3NeAeAfQ==} dev: true @@ -17705,6 +18029,60 @@ packages: typescript: 4.9.3 dev: true + /svelte-preprocess/4.10.7_y4sunccvtjgz4dr3g3pzi7kmze: + resolution: {integrity: sha512-sNPBnqYD6FnmdBrUmBCaqS00RyCsCpj2BG58A1JBswNF7b0OKviwxqVrOL/CKyJrLSClrSeqQv5BXNg2RUbPOw==} + engines: {node: '>= 9.11.2'} + requiresBuild: true + peerDependencies: + '@babel/core': ^7.10.2 + coffeescript: ^2.5.1 + less: ^3.11.3 || ^4.0.0 + node-sass: '*' + postcss: ^7 || ^8 + postcss-load-config: ^2.1.0 || ^3.0.0 || ^4.0.0 + pug: ^3.0.0 + sass: ^1.26.8 + stylus: ^0.55.0 + sugarss: ^2.0.0 + svelte: ^3.23.0 + typescript: ^3.9.5 || ^4.0.0 + peerDependenciesMeta: + '@babel/core': + optional: true + coffeescript: + optional: true + less: + optional: true + node-sass: + optional: true + postcss: + optional: true + postcss-load-config: + optional: true + pug: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + typescript: + optional: true + dependencies: + '@babel/core': 7.20.2 + '@types/pug': 2.0.6 + '@types/sass': 1.43.1 + detect-indent: 6.1.0 + magic-string: 0.25.9 + node-sass: 7.0.3 + postcss: 8.4.21 + sorcery: 0.10.0 + strip-indent: 3.0.0 + svelte: 3.53.1 + typescript: 4.9.5 + dev: true + /svelte-spa-router/3.3.0: resolution: {integrity: sha512-cwRNe7cxD43sCvSfEeaKiNZg3FCizGxeMcf7CPiWRP3jKXjEma3vxyyuDtPOam6nWbVxl9TNM3hlE/i87ZlqcQ==} dependencies: @@ -18253,6 +18631,57 @@ packages: yargs-parser: 20.2.4 dev: true + /ts-jest/27.1.5_tr6btbnawl4wz6is4v2fl47ayu: + resolution: {integrity: sha512-Xv6jBQPoBEvBq/5i2TeSG9tt/nqkbpcurrEG1b+2yfBrcJelOZF9Ml6dmyMh7bcW9JyFbRYpR5rxROSlBLTZHA==} + engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} + hasBin: true + peerDependencies: + '@babel/core': '>=7.0.0-beta.0 <8' + '@types/jest': ^27.0.0 + babel-jest: '>=27.0.0 <28' + esbuild: '*' + jest: ^27.0.0 + typescript: '>=3.8 <5.0' + peerDependenciesMeta: + '@babel/core': + optional: true + '@types/jest': + optional: true + babel-jest: + optional: true + esbuild: + optional: true + dependencies: + '@babel/core': 7.20.2 + '@types/jest': 27.5.2 + babel-jest: 27.5.1_@babel+core@7.20.2 + bs-logger: 0.2.6 + fast-json-stable-stringify: 2.1.0 + jest: 27.5.1 + jest-util: 27.5.1 + json5: 2.2.1 + lodash.memoize: 4.1.2 + make-error: 1.3.6 + semver: 7.3.8 + typescript: 4.9.5 + yargs-parser: 20.2.4 + dev: true + + /ts-loader/9.4.1_hhrrucqyg4eysmfpujvov2ym5u: + resolution: {integrity: sha512-384TYAqGs70rn9F0VBnh6BPTfhga7yFNdC5gXbQpDrBj9/KsT4iRkGqKXhziofHOlE2j6YEaiTYVGKKvPhGWvw==} + engines: {node: '>=12.0.0'} + peerDependencies: + typescript: '*' + webpack: ^5.0.0 + dependencies: + chalk: 4.1.2 + enhanced-resolve: 5.12.0 + micromatch: 4.0.5 + semver: 7.3.8 + typescript: 4.9.5 + webpack: 5.75.0 + dev: true + /ts-loader/9.4.1_vfotqvx6lgcbf3upbs6hgaza4q: resolution: {integrity: sha512-384TYAqGs70rn9F0VBnh6BPTfhga7yFNdC5gXbQpDrBj9/KsT4iRkGqKXhziofHOlE2j6YEaiTYVGKKvPhGWvw==} engines: {node: '>=12.0.0'} @@ -18313,6 +18742,7 @@ packages: /tslib/2.4.1: resolution: {integrity: sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==} + dev: true /tslib/2.5.0: resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==} @@ -18331,6 +18761,16 @@ packages: typescript: 4.9.3 dev: true + /tsutils/3.21.0_typescript@4.9.5: + resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} + engines: {node: '>= 6'} + peerDependencies: + typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' + dependencies: + tslib: 1.14.1 + typescript: 4.9.5 + dev: true + /tunnel-agent/0.6.0: resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==} dependencies: @@ -18476,7 +18916,6 @@ packages: resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==} engines: {node: '>=4.2.0'} hasBin: true - dev: true /typewise-core/1.2.0: resolution: {integrity: sha512-2SCC/WLzj2SbUwzFOzqMCkz5amXLlxtJqDKTICqg30x+2DZxcfZN2MvQZmGfXWKNWaKK9pBPsvkcwv8bF/gxKg==} @@ -18717,7 +19156,6 @@ packages: browserslist: 4.21.5 escalade: 3.1.1 picocolors: 1.0.0 - dev: true /uri-js/4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} @@ -19503,7 +19941,7 @@ packages: '@webassemblyjs/wasm-parser': 1.11.1 acorn: 8.8.1 acorn-import-assertions: 1.8.0_acorn@8.8.1 - browserslist: 4.21.4 + browserslist: 4.21.5 chrome-trace-event: 1.0.3 enhanced-resolve: 5.12.0 es-module-lexer: 0.9.3