From db84ce079ce68d755f36078183a4ed06ef4ba8d7 Mon Sep 17 00:00:00 2001 From: Aaron Choo Date: Tue, 12 Dec 2023 11:39:59 +0800 Subject: [PATCH] feat: implement sign mode direct for non-ledger users (#29) - Add timeout height params to Tx class - Add sign mode direct for browser extensions - Add sign mode direct for wallet connect - Automatically use sign mode amino for ledger users --- CHANGELOG.md | 11 +- README.md | 4 +- examples/solid-vite/pnpm-lock.yaml | 821 +++++++++--------- package.json | 2 +- src/client/apis/broadcastTx.ts | 7 +- src/client/clients/RpcClient.ts | 5 +- src/client/index.ts | 1 + src/client/models/Tx.ts | 72 +- src/codec/index.ts | 2 +- src/codec/sign.ts | 32 +- src/wallet/utils/tx.ts | 31 - src/wallet/walletconnect/WalletConnectV2.ts | 49 +- src/wallet/wallets/ConnectedWallet.ts | 1 + .../cosmostation/CosmostationController.ts | 32 +- .../cosmostation/CosmostationExtension.ts | 107 +-- .../CosmostationWalletConnectV2.ts | 84 +- src/wallet/wallets/cosmostation/constants.ts | 23 - src/wallet/wallets/cosmostation/types.ts | 59 +- src/wallet/wallets/keplr/KeplrController.ts | 30 +- src/wallet/wallets/keplr/KeplrExtension.ts | 56 +- .../wallets/keplr/KeplrWalletConnectV2.ts | 70 +- src/wallet/wallets/keplr/constants.ts | 21 - src/wallet/wallets/keplr/types.ts | 5 - src/wallet/wallets/leap/LeapController.ts | 30 +- src/wallet/wallets/leap/LeapExtension.ts | 89 +- .../wallets/leap/LeapWalletConnectV2.ts | 84 +- src/wallet/wallets/leap/constants.ts | 6 - src/wallet/wallets/mnemonic/MnemonicWallet.ts | 29 +- 28 files changed, 731 insertions(+), 1032 deletions(-) delete mode 100644 src/wallet/utils/tx.ts delete mode 100644 src/wallet/wallets/cosmostation/constants.ts delete mode 100644 src/wallet/wallets/keplr/constants.ts delete mode 100644 src/wallet/wallets/keplr/types.ts delete mode 100644 src/wallet/wallets/leap/constants.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 12aed5f7..db7b7233 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,19 @@ # Changelog +## `v0.0.43` + +### Improvements + +- Added `timeout_height` parameter when simulating or broadcasting txs +- Use sign mode direct (instead of legacy amino) for non-ledger extension wallets and `MnemonicWallet` +- Added support for sign mode direct for `WalletConnectV2` (although no mobile wallets support it currently) +- Reduced bundle size by combining Keplr-like wallets into the same interface (`examples/solid-vite` reduced from 509kb to 487kb minified) + ## `v0.0.42` ### Features -- Added support for Injective +- Added support for Injective chain (both mainnet and testnet) ## `v0.0.40` diff --git a/README.md b/README.md index 8a9b4af8..b39fbdfb 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ A tree-shakeable, framework agnostic, [pure ESM](https://gist.github.com/sindres - **Fully tree-shakeable**: import and bundle only the modules you need - **Framework agnostic**: integrate with any web framework (React, Vue, Svelte, Solid, etc.) -- **Lightweight and minimal**: 145 KB gzipped to connect a React app to Keplr via browser extension or WalletConnect, 10x smaller than Cosmos Kit (see [benchmarks](#benchmarks)) +- **Lightweight and minimal**: 146 KB gzipped to connect a React app to Keplr via browser extension or WalletConnect, 10x smaller than Cosmos Kit (see [benchmarks](#benchmarks)) - **Uses modern web APIs**: no dependencies on Node.js and minimal dependencies on third-party libraries where possible - **Supports modern bundlers**: works with Vite, SWC, Rollup, etc. - **Fully typed**: written in TypeScript and ships with type definitions @@ -145,7 +145,7 @@ See the [`benchmarks`](./benchmarks) folder, where the JS bundle size of CosmES | Package | Minified | Gzipped | |---------------|----------|---------| -| CosmES | 536 KB | 145 KB | +| CosmES | 540 KB | 146 KB | | Cosmos Kit v1 | 6004 KB | 1392 KB | | Cosmos Kit v2 | 6273 KB | 1453 KB | diff --git a/examples/solid-vite/pnpm-lock.yaml b/examples/solid-vite/pnpm-lock.yaml index fb9847dd..9f591400 100644 --- a/examples/solid-vite/pnpm-lock.yaml +++ b/examples/solid-vite/pnpm-lock.yaml @@ -1,5 +1,9 @@ lockfileVersion: '6.0' +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + dependencies: buffer: specifier: ^6.0.3 @@ -9,24 +13,24 @@ dependencies: version: link:../.. solid-js: specifier: ^1.7.3 - version: 1.7.3 + version: 1.8.7 devDependencies: autoprefixer: specifier: ^10.4.14 - version: 10.4.14(postcss@8.4.23) + version: 10.4.16(postcss@8.4.32) postcss: specifier: ^8.4.23 - version: 8.4.23 + version: 8.4.32 tailwindcss: specifier: ^3.3.2 - version: 3.3.2 + version: 3.3.6 vite: specifier: ^4.3.5 - version: 4.3.5 + version: 4.5.1 vite-plugin-solid: specifier: ^2.7.0 - version: 2.7.0(solid-js@1.7.3)(vite@4.3.5) + version: 2.8.0(solid-js@1.8.7)(vite@4.5.1) packages: @@ -40,345 +44,331 @@ packages: engines: {node: '>=6.0.0'} dependencies: '@jridgewell/gen-mapping': 0.3.3 - '@jridgewell/trace-mapping': 0.3.18 + '@jridgewell/trace-mapping': 0.3.20 dev: true - /@babel/code-frame@7.21.4: - resolution: {integrity: sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==} + /@babel/code-frame@7.23.5: + resolution: {integrity: sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/highlight': 7.18.6 + '@babel/highlight': 7.23.4 + chalk: 2.4.2 dev: true - /@babel/compat-data@7.21.7: - resolution: {integrity: sha512-KYMqFYTaenzMK4yUtf4EW9wc4N9ef80FsbMtkwool5zpwl4YrT1SdWYSTRcT94KO4hannogdS+LxY7L+arP3gA==} + /@babel/compat-data@7.23.5: + resolution: {integrity: sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw==} engines: {node: '>=6.9.0'} dev: true - /@babel/core@7.21.8: - resolution: {integrity: sha512-YeM22Sondbo523Sz0+CirSPnbj9bG3P0CdHcBZdqUuaeOaYEFbOLoGU7lebvGP6P5J/WE9wOn7u7C4J9HvS1xQ==} + /@babel/core@7.23.6: + resolution: {integrity: sha512-FxpRyGjrMJXh7X3wGLGhNDCRiwpWEF74sKjTLDJSG5Kyvow3QZaG0Adbqzi9ZrVjTWpsX+2cxWXD71NMg93kdw==} engines: {node: '>=6.9.0'} dependencies: '@ampproject/remapping': 2.2.1 - '@babel/code-frame': 7.21.4 - '@babel/generator': 7.21.5 - '@babel/helper-compilation-targets': 7.21.5(@babel/core@7.21.8) - '@babel/helper-module-transforms': 7.21.5 - '@babel/helpers': 7.21.5 - '@babel/parser': 7.21.8 - '@babel/template': 7.20.7 - '@babel/traverse': 7.21.5 - '@babel/types': 7.21.5 - convert-source-map: 1.9.0 + '@babel/code-frame': 7.23.5 + '@babel/generator': 7.23.6 + '@babel/helper-compilation-targets': 7.23.6 + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.6) + '@babel/helpers': 7.23.6 + '@babel/parser': 7.23.6 + '@babel/template': 7.22.15 + '@babel/traverse': 7.23.6 + '@babel/types': 7.23.6 + convert-source-map: 2.0.0 debug: 4.3.4 gensync: 1.0.0-beta.2 json5: 2.2.3 - semver: 6.3.0 + semver: 6.3.1 transitivePeerDependencies: - supports-color dev: true - /@babel/generator@7.21.5: - resolution: {integrity: sha512-SrKK/sRv8GesIW1bDagf9cCG38IOMYZusoe1dfg0D8aiUe3Amvoj1QtjTPAWcfrZFvIwlleLb0gxzQidL9w14w==} + /@babel/generator@7.23.6: + resolution: {integrity: sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.5 + '@babel/types': 7.23.6 '@jridgewell/gen-mapping': 0.3.3 - '@jridgewell/trace-mapping': 0.3.18 + '@jridgewell/trace-mapping': 0.3.20 jsesc: 2.5.2 dev: true - /@babel/helper-annotate-as-pure@7.18.6: - resolution: {integrity: sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA==} + /@babel/helper-annotate-as-pure@7.22.5: + resolution: {integrity: sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.5 + '@babel/types': 7.23.6 dev: true - /@babel/helper-compilation-targets@7.21.5(@babel/core@7.21.8): - resolution: {integrity: sha512-1RkbFGUKex4lvsB9yhIfWltJM5cZKUftB2eNajaDv3dCMEp49iBG0K14uH8NnX9IPux2+mK7JGEOB0jn48/J6w==} + /@babel/helper-compilation-targets@7.23.6: + resolution: {integrity: sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ==} engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 dependencies: - '@babel/compat-data': 7.21.7 - '@babel/core': 7.21.8 - '@babel/helper-validator-option': 7.21.0 - browserslist: 4.21.5 + '@babel/compat-data': 7.23.5 + '@babel/helper-validator-option': 7.23.5 + browserslist: 4.22.2 lru-cache: 5.1.1 - semver: 6.3.0 + semver: 6.3.1 dev: true - /@babel/helper-create-class-features-plugin@7.21.8(@babel/core@7.21.8): - resolution: {integrity: sha512-+THiN8MqiH2AczyuZrnrKL6cAxFRRQDKW9h1YkBvbgKmAm6mwiacig1qT73DHIWMGo40GRnsEfN3LA+E6NtmSw==} + /@babel/helper-create-class-features-plugin@7.23.6(@babel/core@7.23.6): + resolution: {integrity: sha512-cBXU1vZni/CpGF29iTu4YRbOZt3Wat6zCoMDxRF1MayiEc4URxOj31tT65HUM0CRpMowA3HCJaAOVOUnMf96cw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.21.8 - '@babel/helper-annotate-as-pure': 7.18.6 - '@babel/helper-environment-visitor': 7.21.5 - '@babel/helper-function-name': 7.21.0 - '@babel/helper-member-expression-to-functions': 7.21.5 - '@babel/helper-optimise-call-expression': 7.18.6 - '@babel/helper-replace-supers': 7.21.5 - '@babel/helper-skip-transparent-expression-wrappers': 7.20.0 - '@babel/helper-split-export-declaration': 7.18.6 - semver: 6.3.0 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.23.6 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-function-name': 7.23.0 + '@babel/helper-member-expression-to-functions': 7.23.0 + '@babel/helper-optimise-call-expression': 7.22.5 + '@babel/helper-replace-supers': 7.22.20(@babel/core@7.23.6) + '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + semver: 6.3.1 dev: true - /@babel/helper-environment-visitor@7.21.5: - resolution: {integrity: sha512-IYl4gZ3ETsWocUWgsFZLM5i1BYx9SoemminVEXadgLBa9TdeorzgLKm8wWLA6J1N/kT3Kch8XIk1laNzYoHKvQ==} + /@babel/helper-environment-visitor@7.22.20: + resolution: {integrity: sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==} engines: {node: '>=6.9.0'} dev: true - /@babel/helper-function-name@7.21.0: - resolution: {integrity: sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==} + /@babel/helper-function-name@7.23.0: + resolution: {integrity: sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/template': 7.20.7 - '@babel/types': 7.21.5 + '@babel/template': 7.22.15 + '@babel/types': 7.23.6 dev: true - /@babel/helper-hoist-variables@7.18.6: - resolution: {integrity: sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==} + /@babel/helper-hoist-variables@7.22.5: + resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.5 + '@babel/types': 7.23.6 dev: true - /@babel/helper-member-expression-to-functions@7.21.5: - resolution: {integrity: sha512-nIcGfgwpH2u4n9GG1HpStW5Ogx7x7ekiFHbjjFRKXbn5zUvqO9ZgotCO4x1aNbKn/x/xOUaXEhyNHCwtFCpxWg==} + /@babel/helper-member-expression-to-functions@7.23.0: + resolution: {integrity: sha512-6gfrPwh7OuT6gZyJZvd6WbTfrqAo7vm4xCzAXOusKqq/vWdKXphTpj5klHKNmRUU6/QRGlBsyU9mAIPaWHlqJA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.5 + '@babel/types': 7.23.6 dev: true /@babel/helper-module-imports@7.18.6: resolution: {integrity: sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.5 + '@babel/types': 7.23.6 dev: true - /@babel/helper-module-imports@7.21.4: - resolution: {integrity: sha512-orajc5T2PsRYUN3ZryCEFeMDYwyw09c/pZeaQEZPH0MpKzSvn3e0uXsDBu3k03VI+9DBiRo+l22BfKTpKwa/Wg==} + /@babel/helper-module-imports@7.22.15: + resolution: {integrity: sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.5 + '@babel/types': 7.23.6 dev: true - /@babel/helper-module-transforms@7.21.5: - resolution: {integrity: sha512-bI2Z9zBGY2q5yMHoBvJ2a9iX3ZOAzJPm7Q8Yz6YeoUjU/Cvhmi2G4QyTNyPBqqXSgTjUxRg3L0xV45HvkNWWBw==} + /@babel/helper-module-transforms@7.23.3(@babel/core@7.23.6): + resolution: {integrity: sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==} engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 dependencies: - '@babel/helper-environment-visitor': 7.21.5 - '@babel/helper-module-imports': 7.21.4 - '@babel/helper-simple-access': 7.21.5 - '@babel/helper-split-export-declaration': 7.18.6 - '@babel/helper-validator-identifier': 7.19.1 - '@babel/template': 7.20.7 - '@babel/traverse': 7.21.5 - '@babel/types': 7.21.5 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.23.6 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-module-imports': 7.22.15 + '@babel/helper-simple-access': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + '@babel/helper-validator-identifier': 7.22.20 dev: true - /@babel/helper-optimise-call-expression@7.18.6: - resolution: {integrity: sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA==} + /@babel/helper-optimise-call-expression@7.22.5: + resolution: {integrity: sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.5 + '@babel/types': 7.23.6 dev: true - /@babel/helper-plugin-utils@7.21.5: - resolution: {integrity: sha512-0WDaIlXKOX/3KfBK/dwP1oQGiPh6rjMkT7HIRv7i5RR2VUMwrx5ZL0dwBkKx7+SW1zwNdgjHd34IMk5ZjTeHVg==} + /@babel/helper-plugin-utils@7.22.5: + resolution: {integrity: sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==} engines: {node: '>=6.9.0'} dev: true - /@babel/helper-replace-supers@7.21.5: - resolution: {integrity: sha512-/y7vBgsr9Idu4M6MprbOVUfH3vs7tsIfnVWv/Ml2xgwvyH6LTngdfbf5AdsKwkJy4zgy1X/kuNrEKvhhK28Yrg==} + /@babel/helper-replace-supers@7.22.20(@babel/core@7.23.6): + resolution: {integrity: sha512-qsW0In3dbwQUbK8kejJ4R7IHVGwHJlV6lpG6UA7a9hSa2YEiAib+N1T2kr6PEeUT+Fl7najmSOS6SmAwCHK6Tw==} engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 dependencies: - '@babel/helper-environment-visitor': 7.21.5 - '@babel/helper-member-expression-to-functions': 7.21.5 - '@babel/helper-optimise-call-expression': 7.18.6 - '@babel/template': 7.20.7 - '@babel/traverse': 7.21.5 - '@babel/types': 7.21.5 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.23.6 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-member-expression-to-functions': 7.23.0 + '@babel/helper-optimise-call-expression': 7.22.5 dev: true - /@babel/helper-simple-access@7.21.5: - resolution: {integrity: sha512-ENPDAMC1wAjR0uaCUwliBdiSl1KBJAVnMTzXqi64c2MG8MPR6ii4qf7bSXDqSFbr4W6W028/rf5ivoHop5/mkg==} + /@babel/helper-simple-access@7.22.5: + resolution: {integrity: sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.5 + '@babel/types': 7.23.6 dev: true - /@babel/helper-skip-transparent-expression-wrappers@7.20.0: - resolution: {integrity: sha512-5y1JYeNKfvnT8sZcK9DVRtpTbGiomYIHviSP3OQWmDPU3DeH4a1ZlT/N2lyQ5P8egjcRaT/Y9aNqUxK0WsnIIg==} + /@babel/helper-skip-transparent-expression-wrappers@7.22.5: + resolution: {integrity: sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.5 + '@babel/types': 7.23.6 dev: true - /@babel/helper-split-export-declaration@7.18.6: - resolution: {integrity: sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==} + /@babel/helper-split-export-declaration@7.22.6: + resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.5 + '@babel/types': 7.23.6 dev: true - /@babel/helper-string-parser@7.21.5: - resolution: {integrity: sha512-5pTUx3hAJaZIdW99sJ6ZUUgWq/Y+Hja7TowEnLNMm1VivRgZQL3vpBY3qUACVsvw+yQU6+YgfBVmcbLaZtrA1w==} + /@babel/helper-string-parser@7.23.4: + resolution: {integrity: sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==} engines: {node: '>=6.9.0'} dev: true - /@babel/helper-validator-identifier@7.19.1: - resolution: {integrity: sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==} + /@babel/helper-validator-identifier@7.22.20: + resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} engines: {node: '>=6.9.0'} dev: true - /@babel/helper-validator-option@7.21.0: - resolution: {integrity: sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ==} + /@babel/helper-validator-option@7.23.5: + resolution: {integrity: sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==} engines: {node: '>=6.9.0'} dev: true - /@babel/helpers@7.21.5: - resolution: {integrity: sha512-BSY+JSlHxOmGsPTydUkPf1MdMQ3M81x5xGCOVgWM3G8XH77sJ292Y2oqcp0CbbgxhqBuI46iUz1tT7hqP7EfgA==} + /@babel/helpers@7.23.6: + resolution: {integrity: sha512-wCfsbN4nBidDRhpDhvcKlzHWCTlgJYUUdSJfzXb2NuBssDSIjc3xcb+znA7l+zYsFljAcGM0aFkN40cR3lXiGA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/template': 7.20.7 - '@babel/traverse': 7.21.5 - '@babel/types': 7.21.5 + '@babel/template': 7.22.15 + '@babel/traverse': 7.23.6 + '@babel/types': 7.23.6 transitivePeerDependencies: - supports-color dev: true - /@babel/highlight@7.18.6: - resolution: {integrity: sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==} + /@babel/highlight@7.23.4: + resolution: {integrity: sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-validator-identifier': 7.19.1 + '@babel/helper-validator-identifier': 7.22.20 chalk: 2.4.2 js-tokens: 4.0.0 dev: true - /@babel/parser@7.21.8: - resolution: {integrity: sha512-6zavDGdzG3gUqAdWvlLFfk+36RilI+Pwyuuh7HItyeScCWP3k6i8vKclAQ0bM/0y/Kz/xiwvxhMv9MgTJP5gmA==} + /@babel/parser@7.23.6: + resolution: {integrity: sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ==} engines: {node: '>=6.0.0'} hasBin: true dependencies: - '@babel/types': 7.21.5 + '@babel/types': 7.23.6 dev: true - /@babel/plugin-syntax-jsx@7.21.4(@babel/core@7.21.8): - resolution: {integrity: sha512-5hewiLct5OKyh6PLKEYaFclcqtIgCb6bmELouxjF6up5q3Sov7rOayW4RwhbaBL0dit8rA80GNfY+UuDp2mBbQ==} + /@babel/plugin-syntax-jsx@7.23.3(@babel/core@7.23.6): + resolution: {integrity: sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.21.8 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-typescript@7.21.4(@babel/core@7.21.8): - resolution: {integrity: sha512-xz0D39NvhQn4t4RNsHmDnnsaQizIlUkdtYvLs8La1BlfjQ6JEwxkJGeqJMW2tAXx+q6H+WFuUTXNdYVpEya0YA==} + /@babel/plugin-syntax-typescript@7.23.3(@babel/core@7.23.6): + resolution: {integrity: sha512-9EiNjVJOMwCO+43TqoTrgQ8jMwcAd0sWyXi9RPfIsLTj4R2MADDDQXELhffaUx/uJv2AYcxBgPwH6j4TIA4ytQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.21.8 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-modules-commonjs@7.21.5(@babel/core@7.21.8): - resolution: {integrity: sha512-OVryBEgKUbtqMoB7eG2rs6UFexJi6Zj6FDXx+esBLPTCxCNxAY9o+8Di7IsUGJ+AVhp5ncK0fxWUBd0/1gPhrQ==} + /@babel/plugin-transform-modules-commonjs@7.23.3(@babel/core@7.23.6): + resolution: {integrity: sha512-aVS0F65LKsdNOtcz6FRCpE4OgsP2OFnW46qNxNIX9h3wuzaNcSQsJysuMwqSibC98HPrf2vCgtxKNwS0DAlgcA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.21.8 - '@babel/helper-module-transforms': 7.21.5 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/helper-simple-access': 7.21.5 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.23.6 + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.6) + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-simple-access': 7.22.5 dev: true - /@babel/plugin-transform-typescript@7.21.3(@babel/core@7.21.8): - resolution: {integrity: sha512-RQxPz6Iqt8T0uw/WsJNReuBpWpBqs/n7mNo18sKLoTbMp+UrEekhH+pKSVC7gWz+DNjo9gryfV8YzCiT45RgMw==} + /@babel/plugin-transform-typescript@7.23.6(@babel/core@7.23.6): + resolution: {integrity: sha512-6cBG5mBvUu4VUD04OHKnYzbuHNP8huDsD3EDqqpIpsswTDoqHCjLoHb6+QgsV1WsT2nipRqCPgxD3LXnEO7XfA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.21.8 - '@babel/helper-annotate-as-pure': 7.18.6 - '@babel/helper-create-class-features-plugin': 7.21.8(@babel/core@7.21.8) - '@babel/helper-plugin-utils': 7.21.5 - '@babel/plugin-syntax-typescript': 7.21.4(@babel/core@7.21.8) - transitivePeerDependencies: - - supports-color + '@babel/core': 7.23.6 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-create-class-features-plugin': 7.23.6(@babel/core@7.23.6) + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-typescript': 7.23.3(@babel/core@7.23.6) dev: true - /@babel/preset-typescript@7.21.5(@babel/core@7.21.8): - resolution: {integrity: sha512-iqe3sETat5EOrORXiQ6rWfoOg2y68Cs75B9wNxdPW4kixJxh7aXQE1KPdWLDniC24T/6dSnguF33W9j/ZZQcmA==} + /@babel/preset-typescript@7.23.3(@babel/core@7.23.6): + resolution: {integrity: sha512-17oIGVlqz6CchO9RFYn5U6ZpWRZIngayYCtrPRSgANSwC2V1Jb+iP74nVxzzXJte8b8BYxrL1yY96xfhTBrNNQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.21.8 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/helper-validator-option': 7.21.0 - '@babel/plugin-syntax-jsx': 7.21.4(@babel/core@7.21.8) - '@babel/plugin-transform-modules-commonjs': 7.21.5(@babel/core@7.21.8) - '@babel/plugin-transform-typescript': 7.21.3(@babel/core@7.21.8) - transitivePeerDependencies: - - supports-color + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-validator-option': 7.23.5 + '@babel/plugin-syntax-jsx': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-modules-commonjs': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-typescript': 7.23.6(@babel/core@7.23.6) dev: true - /@babel/template@7.20.7: - resolution: {integrity: sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==} + /@babel/template@7.22.15: + resolution: {integrity: sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.21.4 - '@babel/parser': 7.21.8 - '@babel/types': 7.21.5 + '@babel/code-frame': 7.23.5 + '@babel/parser': 7.23.6 + '@babel/types': 7.23.6 dev: true - /@babel/traverse@7.21.5: - resolution: {integrity: sha512-AhQoI3YjWi6u/y/ntv7k48mcrCXmus0t79J9qPNlk/lAsFlCiJ047RmbfMOawySTHtywXhbXgpx/8nXMYd+oFw==} + /@babel/traverse@7.23.6: + resolution: {integrity: sha512-czastdK1e8YByZqezMPFiZ8ahwVMh/ESl9vPgvgdB9AmFMGP5jfpFax74AQgl5zj4XHzqeYAg2l8PuUeRS1MgQ==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.21.4 - '@babel/generator': 7.21.5 - '@babel/helper-environment-visitor': 7.21.5 - '@babel/helper-function-name': 7.21.0 - '@babel/helper-hoist-variables': 7.18.6 - '@babel/helper-split-export-declaration': 7.18.6 - '@babel/parser': 7.21.8 - '@babel/types': 7.21.5 + '@babel/code-frame': 7.23.5 + '@babel/generator': 7.23.6 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-function-name': 7.23.0 + '@babel/helper-hoist-variables': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + '@babel/parser': 7.23.6 + '@babel/types': 7.23.6 debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: - supports-color dev: true - /@babel/types@7.21.5: - resolution: {integrity: sha512-m4AfNvVF2mVC/F7fDEdH2El3HzUg9It/XsCxZiOTTA3m3qYfcSVSbTfM6Q9xG+hYDniZssYhlXKKUMD5m8tF4Q==} + /@babel/types@7.23.6: + resolution: {integrity: sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-string-parser': 7.21.5 - '@babel/helper-validator-identifier': 7.19.1 + '@babel/helper-string-parser': 7.23.4 + '@babel/helper-validator-identifier': 7.22.20 to-fast-properties: 2.0.0 dev: true - /@esbuild/android-arm64@0.17.18: - resolution: {integrity: sha512-/iq0aK0eeHgSC3z55ucMAHO05OIqmQehiGay8eP5l/5l+iEr4EIbh4/MI8xD9qRFjqzgkc0JkX0LculNC9mXBw==} + /@esbuild/android-arm64@0.18.20: + resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -386,8 +376,8 @@ packages: dev: true optional: true - /@esbuild/android-arm@0.17.18: - resolution: {integrity: sha512-EmwL+vUBZJ7mhFCs5lA4ZimpUH3WMAoqvOIYhVQwdIgSpHC8ImHdsRyhHAVxpDYUSm0lWvd63z0XH1IlImS2Qw==} + /@esbuild/android-arm@0.18.20: + resolution: {integrity: sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==} engines: {node: '>=12'} cpu: [arm] os: [android] @@ -395,8 +385,8 @@ packages: dev: true optional: true - /@esbuild/android-x64@0.17.18: - resolution: {integrity: sha512-x+0efYNBF3NPW2Xc5bFOSFW7tTXdAcpfEg2nXmxegm4mJuVeS+i109m/7HMiOQ6M12aVGGFlqJX3RhNdYM2lWg==} + /@esbuild/android-x64@0.18.20: + resolution: {integrity: sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -404,8 +394,8 @@ packages: dev: true optional: true - /@esbuild/darwin-arm64@0.17.18: - resolution: {integrity: sha512-6tY+djEAdF48M1ONWnQb1C+6LiXrKjmqjzPNPWXhu/GzOHTHX2nh8Mo2ZAmBFg0kIodHhciEgUBtcYCAIjGbjQ==} + /@esbuild/darwin-arm64@0.18.20: + resolution: {integrity: sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -413,8 +403,8 @@ packages: dev: true optional: true - /@esbuild/darwin-x64@0.17.18: - resolution: {integrity: sha512-Qq84ykvLvya3dO49wVC9FFCNUfSrQJLbxhoQk/TE1r6MjHo3sFF2tlJCwMjhkBVq3/ahUisj7+EpRSz0/+8+9A==} + /@esbuild/darwin-x64@0.18.20: + resolution: {integrity: sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -422,8 +412,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-arm64@0.17.18: - resolution: {integrity: sha512-fw/ZfxfAzuHfaQeMDhbzxp9mc+mHn1Y94VDHFHjGvt2Uxl10mT4CDavHm+/L9KG441t1QdABqkVYwakMUeyLRA==} + /@esbuild/freebsd-arm64@0.18.20: + resolution: {integrity: sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -431,8 +421,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-x64@0.17.18: - resolution: {integrity: sha512-FQFbRtTaEi8ZBi/A6kxOC0V0E9B/97vPdYjY9NdawyLd4Qk5VD5g2pbWN2VR1c0xhzcJm74HWpObPszWC+qTew==} + /@esbuild/freebsd-x64@0.18.20: + resolution: {integrity: sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -440,8 +430,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm64@0.17.18: - resolution: {integrity: sha512-R7pZvQZFOY2sxUG8P6A21eq6q+eBv7JPQYIybHVf1XkQYC+lT7nDBdC7wWKTrbvMXKRaGudp/dzZCwL/863mZQ==} + /@esbuild/linux-arm64@0.18.20: + resolution: {integrity: sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -449,8 +439,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm@0.17.18: - resolution: {integrity: sha512-jW+UCM40LzHcouIaqv3e/oRs0JM76JfhHjCavPxMUti7VAPh8CaGSlS7cmyrdpzSk7A+8f0hiedHqr/LMnfijg==} + /@esbuild/linux-arm@0.18.20: + resolution: {integrity: sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -458,8 +448,8 @@ packages: dev: true optional: true - /@esbuild/linux-ia32@0.17.18: - resolution: {integrity: sha512-ygIMc3I7wxgXIxk6j3V00VlABIjq260i967Cp9BNAk5pOOpIXmd1RFQJQX9Io7KRsthDrQYrtcx7QCof4o3ZoQ==} + /@esbuild/linux-ia32@0.18.20: + resolution: {integrity: sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -467,8 +457,8 @@ packages: dev: true optional: true - /@esbuild/linux-loong64@0.17.18: - resolution: {integrity: sha512-bvPG+MyFs5ZlwYclCG1D744oHk1Pv7j8psF5TfYx7otCVmcJsEXgFEhQkbhNW8otDHL1a2KDINW20cfCgnzgMQ==} + /@esbuild/linux-loong64@0.18.20: + resolution: {integrity: sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==} engines: {node: '>=12'} cpu: [loong64] os: [linux] @@ -476,8 +466,8 @@ packages: dev: true optional: true - /@esbuild/linux-mips64el@0.17.18: - resolution: {integrity: sha512-oVqckATOAGuiUOa6wr8TXaVPSa+6IwVJrGidmNZS1cZVx0HqkTMkqFGD2HIx9H1RvOwFeWYdaYbdY6B89KUMxA==} + /@esbuild/linux-mips64el@0.18.20: + resolution: {integrity: sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -485,8 +475,8 @@ packages: dev: true optional: true - /@esbuild/linux-ppc64@0.17.18: - resolution: {integrity: sha512-3dLlQO+b/LnQNxgH4l9rqa2/IwRJVN9u/bK63FhOPB4xqiRqlQAU0qDU3JJuf0BmaH0yytTBdoSBHrb2jqc5qQ==} + /@esbuild/linux-ppc64@0.18.20: + resolution: {integrity: sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -494,8 +484,8 @@ packages: dev: true optional: true - /@esbuild/linux-riscv64@0.17.18: - resolution: {integrity: sha512-/x7leOyDPjZV3TcsdfrSI107zItVnsX1q2nho7hbbQoKnmoeUWjs+08rKKt4AUXju7+3aRZSsKrJtaRmsdL1xA==} + /@esbuild/linux-riscv64@0.18.20: + resolution: {integrity: sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -503,8 +493,8 @@ packages: dev: true optional: true - /@esbuild/linux-s390x@0.17.18: - resolution: {integrity: sha512-cX0I8Q9xQkL/6F5zWdYmVf5JSQt+ZfZD2bJudZrWD+4mnUvoZ3TDDXtDX2mUaq6upMFv9FlfIh4Gfun0tbGzuw==} + /@esbuild/linux-s390x@0.18.20: + resolution: {integrity: sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -512,8 +502,8 @@ packages: dev: true optional: true - /@esbuild/linux-x64@0.17.18: - resolution: {integrity: sha512-66RmRsPlYy4jFl0vG80GcNRdirx4nVWAzJmXkevgphP1qf4dsLQCpSKGM3DUQCojwU1hnepI63gNZdrr02wHUA==} + /@esbuild/linux-x64@0.18.20: + resolution: {integrity: sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -521,8 +511,8 @@ packages: dev: true optional: true - /@esbuild/netbsd-x64@0.17.18: - resolution: {integrity: sha512-95IRY7mI2yrkLlTLb1gpDxdC5WLC5mZDi+kA9dmM5XAGxCME0F8i4bYH4jZreaJ6lIZ0B8hTrweqG1fUyW7jbg==} + /@esbuild/netbsd-x64@0.18.20: + resolution: {integrity: sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -530,8 +520,8 @@ packages: dev: true optional: true - /@esbuild/openbsd-x64@0.17.18: - resolution: {integrity: sha512-WevVOgcng+8hSZ4Q3BKL3n1xTv5H6Nb53cBrtzzEjDbbnOmucEVcZeGCsCOi9bAOcDYEeBZbD2SJNBxlfP3qiA==} + /@esbuild/openbsd-x64@0.18.20: + resolution: {integrity: sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -539,8 +529,8 @@ packages: dev: true optional: true - /@esbuild/sunos-x64@0.17.18: - resolution: {integrity: sha512-Rzf4QfQagnwhQXVBS3BYUlxmEbcV7MY+BH5vfDZekU5eYpcffHSyjU8T0xucKVuOcdCsMo+Ur5wmgQJH2GfNrg==} + /@esbuild/sunos-x64@0.18.20: + resolution: {integrity: sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -548,8 +538,8 @@ packages: dev: true optional: true - /@esbuild/win32-arm64@0.17.18: - resolution: {integrity: sha512-Kb3Ko/KKaWhjeAm2YoT/cNZaHaD1Yk/pa3FTsmqo9uFh1D1Rfco7BBLIPdDOozrObj2sahslFuAQGvWbgWldAg==} + /@esbuild/win32-arm64@0.18.20: + resolution: {integrity: sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -557,8 +547,8 @@ packages: dev: true optional: true - /@esbuild/win32-ia32@0.17.18: - resolution: {integrity: sha512-0/xUMIdkVHwkvxfbd5+lfG7mHOf2FRrxNbPiKWg9C4fFrB8H0guClmaM3BFiRUYrznVoyxTIyC/Ou2B7QQSwmw==} + /@esbuild/win32-ia32@0.18.20: + resolution: {integrity: sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -566,8 +556,8 @@ packages: dev: true optional: true - /@esbuild/win32-x64@0.17.18: - resolution: {integrity: sha512-qU25Ma1I3NqTSHJUOKi9sAH1/Mzuvlke0ioMJRthLXKm7JiSKVwFghlGbDLOO2sARECGhja4xYfRAZNPAkooYg==} + /@esbuild/win32-x64@0.18.20: + resolution: {integrity: sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -581,11 +571,11 @@ packages: dependencies: '@jridgewell/set-array': 1.1.2 '@jridgewell/sourcemap-codec': 1.4.15 - '@jridgewell/trace-mapping': 0.3.18 + '@jridgewell/trace-mapping': 0.3.20 dev: true - /@jridgewell/resolve-uri@3.1.0: - resolution: {integrity: sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==} + /@jridgewell/resolve-uri@3.1.1: + resolution: {integrity: sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==} engines: {node: '>=6.0.0'} dev: true @@ -594,19 +584,15 @@ packages: engines: {node: '>=6.0.0'} dev: true - /@jridgewell/sourcemap-codec@1.4.14: - resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==} - dev: true - /@jridgewell/sourcemap-codec@1.4.15: resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} dev: true - /@jridgewell/trace-mapping@0.3.18: - resolution: {integrity: sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==} + /@jridgewell/trace-mapping@0.3.20: + resolution: {integrity: sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==} dependencies: - '@jridgewell/resolve-uri': 3.1.0 - '@jridgewell/sourcemap-codec': 1.4.14 + '@jridgewell/resolve-uri': 3.1.1 + '@jridgewell/sourcemap-codec': 1.4.15 dev: true /@nodelib/fs.scandir@2.1.5: @@ -630,33 +616,33 @@ packages: fastq: 1.15.0 dev: true - /@types/babel__core@7.20.0: - resolution: {integrity: sha512-+n8dL/9GWblDO0iU6eZAwEIJVr5DWigtle+Q6HLOrh/pdbXOhOtqzq8VPPE2zvNJzSKY4vH/z3iT3tn0A3ypiQ==} + /@types/babel__core@7.20.5: + resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} dependencies: - '@babel/parser': 7.21.8 - '@babel/types': 7.21.5 - '@types/babel__generator': 7.6.4 - '@types/babel__template': 7.4.1 - '@types/babel__traverse': 7.18.5 + '@babel/parser': 7.23.6 + '@babel/types': 7.23.6 + '@types/babel__generator': 7.6.7 + '@types/babel__template': 7.4.4 + '@types/babel__traverse': 7.20.4 dev: true - /@types/babel__generator@7.6.4: - resolution: {integrity: sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==} + /@types/babel__generator@7.6.7: + resolution: {integrity: sha512-6Sfsq+EaaLrw4RmdFWE9Onp63TOUue71AWb4Gpa6JxzgTYtimbM086WnYTy2U67AofR++QKCo08ZP6pwx8YFHQ==} dependencies: - '@babel/types': 7.21.5 + '@babel/types': 7.23.6 dev: true - /@types/babel__template@7.4.1: - resolution: {integrity: sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==} + /@types/babel__template@7.4.4: + resolution: {integrity: sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==} dependencies: - '@babel/parser': 7.21.8 - '@babel/types': 7.21.5 + '@babel/parser': 7.23.6 + '@babel/types': 7.23.6 dev: true - /@types/babel__traverse@7.18.5: - resolution: {integrity: sha512-enCvTL8m/EHS/zIvJno9nE+ndYPh1/oNFzRYRmtUqJICG2VnCSBzMLW5VN2KCQU91f23tsNKR8v7VJJQMatl7Q==} + /@types/babel__traverse@7.20.4: + resolution: {integrity: sha512-mSM/iKUk5fDDrEV/e83qY+Cr3I1+Q3qqTuEn++HAWYjEa1+NxZr6CNrcJGf2ZTnq4HoFGC3zaTPZTobCzCFukA==} dependencies: - '@babel/types': 7.21.5 + '@babel/types': 7.23.6 dev: true /ansi-styles@3.2.1: @@ -682,42 +668,42 @@ packages: resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==} dev: true - /autoprefixer@10.4.14(postcss@8.4.23): - resolution: {integrity: sha512-FQzyfOsTlwVzjHxKEqRIAdJx9niO6VCBCoEwax/VLSoQF29ggECcPuBqUMZ+u8jCZOPSy8b8/8KnuFbp0SaFZQ==} + /autoprefixer@10.4.16(postcss@8.4.32): + resolution: {integrity: sha512-7vd3UC6xKp0HLfua5IjZlcXvGAGy7cBAXTg2lyQ/8WpNhd6SiZ8Be+xm3FyBSYJx5GKcpRCzBh7RH4/0dnY+uQ==} engines: {node: ^10 || ^12 || >=14} hasBin: true peerDependencies: postcss: ^8.1.0 dependencies: - browserslist: 4.21.5 - caniuse-lite: 1.0.30001486 - fraction.js: 4.2.0 + browserslist: 4.22.2 + caniuse-lite: 1.0.30001568 + fraction.js: 4.3.7 normalize-range: 0.1.2 picocolors: 1.0.0 - postcss: 8.4.23 + postcss: 8.4.32 postcss-value-parser: 4.2.0 dev: true - /babel-plugin-jsx-dom-expressions@0.36.10(@babel/core@7.21.8): - resolution: {integrity: sha512-QA2k/14WGw+RgcGGnEuLWwnu4em6CGhjeXtjvgOYyFHYS2a+CzPeaVQHDOlfuiBcjq/3hWMspHMIMnPEOIzdBg==} + /babel-plugin-jsx-dom-expressions@0.37.9(@babel/core@7.23.6): + resolution: {integrity: sha512-6w+zs2i14fVanj4e1hXCU5cp+x0U0LJ5jScknpMZZUteHhwFRGJflHMVJ+xAcW7ku41FYjr7DgtK9mnc2SXlJg==} peerDependencies: '@babel/core': ^7.20.12 dependencies: - '@babel/core': 7.21.8 + '@babel/core': 7.23.6 '@babel/helper-module-imports': 7.18.6 - '@babel/plugin-syntax-jsx': 7.21.4(@babel/core@7.21.8) - '@babel/types': 7.21.5 + '@babel/plugin-syntax-jsx': 7.23.3(@babel/core@7.23.6) + '@babel/types': 7.23.6 html-entities: 2.3.3 validate-html-nesting: 1.2.2 dev: true - /babel-preset-solid@1.7.4(@babel/core@7.21.8): - resolution: {integrity: sha512-0mbHNYkbOVYhH6L95VlHVkBEVQjOXSzUqLDiFxUcsg/tU4yTM/qx7FI8C+kmos9LHckQBSm3wtwoe1BZLNJR1w==} + /babel-preset-solid@1.8.6(@babel/core@7.23.6): + resolution: {integrity: sha512-Ened42CHjU4EFkvNeS042/3Pm21yvMWn8p4G4ddzQTlKaMwSGGD1VciA/e7EshBVHJCcBj9vHiUd/r3A4qLPZA==} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.21.8 - babel-plugin-jsx-dom-expressions: 0.36.10(@babel/core@7.21.8) + '@babel/core': 7.23.6 + babel-plugin-jsx-dom-expressions: 0.37.9(@babel/core@7.23.6) dev: true /balanced-match@1.0.2: @@ -747,15 +733,15 @@ packages: fill-range: 7.0.1 dev: true - /browserslist@4.21.5: - resolution: {integrity: sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==} + /browserslist@4.22.2: + resolution: {integrity: sha512-0UgcrvQmBDvZHFGdYUehrCNIazki7/lUP3kkoi/r3YB2amZbFM9J43ZRkJTXBUZK4gmx56+Sqk9+Vs9mwZx9+A==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001486 - electron-to-chromium: 1.4.392 - node-releases: 2.0.10 - update-browserslist-db: 1.0.11(browserslist@4.21.5) + caniuse-lite: 1.0.30001568 + electron-to-chromium: 1.4.610 + node-releases: 2.0.14 + update-browserslist-db: 1.0.13(browserslist@4.22.2) dev: true /buffer@6.0.3: @@ -770,8 +756,8 @@ packages: engines: {node: '>= 6'} dev: true - /caniuse-lite@1.0.30001486: - resolution: {integrity: sha512-uv7/gXuHi10Whlj0pp5q/tsK/32J2QSqVRKQhs2j8VsDCjgyruAh/eEXHF822VqO9yT6iZKw3nRwZRSPBE9OQg==} + /caniuse-lite@1.0.30001568: + resolution: {integrity: sha512-vSUkH84HontZJ88MiNrOau1EBrCqEQYgkC5gIySiDlpsm8sGVrhU7Kx4V6h0tnqaHzIHZv08HlJIwPbL4XL9+A==} dev: true /chalk@2.4.2: @@ -795,7 +781,7 @@ packages: normalize-path: 3.0.0 readdirp: 3.6.0 optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true /color-convert@1.9.3: @@ -817,8 +803,8 @@ packages: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} dev: true - /convert-source-map@1.9.0: - resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==} + /convert-source-map@2.0.0: + resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} dev: true /cssesc@3.0.0: @@ -827,8 +813,8 @@ packages: hasBin: true dev: true - /csstype@3.1.1: - resolution: {integrity: sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==} + /csstype@3.1.3: + resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} /debug@4.3.4: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} @@ -850,38 +836,38 @@ packages: resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==} dev: true - /electron-to-chromium@1.4.392: - resolution: {integrity: sha512-TXQOMW9tnhIms3jGy/lJctLjICOgyueZFJ1KUtm6DTQ+QpxX3p7ZBwB6syuZ9KBuT5S4XX7bgY1ECPgfxKUdOg==} + /electron-to-chromium@1.4.610: + resolution: {integrity: sha512-mqi2oL1mfeHYtOdCxbPQYV/PL7YrQlxbvFEZ0Ee8GbDdShimqt2/S6z2RWqysuvlwdOrQdqvE0KZrBTipAeJzg==} dev: true - /esbuild@0.17.18: - resolution: {integrity: sha512-z1lix43jBs6UKjcZVKOw2xx69ffE2aG0PygLL5qJ9OS/gy0Ewd1gW/PUQIOIQGXBHWNywSc0floSKoMFF8aK2w==} + /esbuild@0.18.20: + resolution: {integrity: sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - '@esbuild/android-arm': 0.17.18 - '@esbuild/android-arm64': 0.17.18 - '@esbuild/android-x64': 0.17.18 - '@esbuild/darwin-arm64': 0.17.18 - '@esbuild/darwin-x64': 0.17.18 - '@esbuild/freebsd-arm64': 0.17.18 - '@esbuild/freebsd-x64': 0.17.18 - '@esbuild/linux-arm': 0.17.18 - '@esbuild/linux-arm64': 0.17.18 - '@esbuild/linux-ia32': 0.17.18 - '@esbuild/linux-loong64': 0.17.18 - '@esbuild/linux-mips64el': 0.17.18 - '@esbuild/linux-ppc64': 0.17.18 - '@esbuild/linux-riscv64': 0.17.18 - '@esbuild/linux-s390x': 0.17.18 - '@esbuild/linux-x64': 0.17.18 - '@esbuild/netbsd-x64': 0.17.18 - '@esbuild/openbsd-x64': 0.17.18 - '@esbuild/sunos-x64': 0.17.18 - '@esbuild/win32-arm64': 0.17.18 - '@esbuild/win32-ia32': 0.17.18 - '@esbuild/win32-x64': 0.17.18 + '@esbuild/android-arm': 0.18.20 + '@esbuild/android-arm64': 0.18.20 + '@esbuild/android-x64': 0.18.20 + '@esbuild/darwin-arm64': 0.18.20 + '@esbuild/darwin-x64': 0.18.20 + '@esbuild/freebsd-arm64': 0.18.20 + '@esbuild/freebsd-x64': 0.18.20 + '@esbuild/linux-arm': 0.18.20 + '@esbuild/linux-arm64': 0.18.20 + '@esbuild/linux-ia32': 0.18.20 + '@esbuild/linux-loong64': 0.18.20 + '@esbuild/linux-mips64el': 0.18.20 + '@esbuild/linux-ppc64': 0.18.20 + '@esbuild/linux-riscv64': 0.18.20 + '@esbuild/linux-s390x': 0.18.20 + '@esbuild/linux-x64': 0.18.20 + '@esbuild/netbsd-x64': 0.18.20 + '@esbuild/openbsd-x64': 0.18.20 + '@esbuild/sunos-x64': 0.18.20 + '@esbuild/win32-arm64': 0.18.20 + '@esbuild/win32-ia32': 0.18.20 + '@esbuild/win32-x64': 0.18.20 dev: true /escalade@3.1.1: @@ -894,8 +880,8 @@ packages: engines: {node: '>=0.8.0'} dev: true - /fast-glob@3.2.12: - resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==} + /fast-glob@3.3.2: + resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} engines: {node: '>=8.6.0'} dependencies: '@nodelib/fs.stat': 2.0.5 @@ -918,24 +904,24 @@ packages: to-regex-range: 5.0.1 dev: true - /fraction.js@4.2.0: - resolution: {integrity: sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA==} + /fraction.js@4.3.7: + resolution: {integrity: sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==} dev: true /fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} dev: true - /fsevents@2.3.2: - resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} + /fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] requiresBuild: true dev: true optional: true - /function-bind@1.1.1: - resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} + /function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} dev: true /gensync@1.0.0-beta.2: @@ -978,11 +964,11 @@ packages: engines: {node: '>=4'} dev: true - /has@1.0.3: - resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} - engines: {node: '>= 0.4.0'} + /hasown@2.0.0: + resolution: {integrity: sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==} + engines: {node: '>= 0.4'} dependencies: - function-bind: 1.1.1 + function-bind: 1.1.2 dev: true /html-entities@2.3.3: @@ -1011,10 +997,10 @@ packages: binary-extensions: 2.2.0 dev: true - /is-core-module@2.12.0: - resolution: {integrity: sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ==} + /is-core-module@2.13.1: + resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==} dependencies: - has: 1.0.3 + hasown: 2.0.0 dev: true /is-extglob@2.1.1: @@ -1034,13 +1020,13 @@ packages: engines: {node: '>=0.12.0'} dev: true - /is-what@4.1.9: - resolution: {integrity: sha512-I3FU0rkVvwhgLLEs6iITwZ/JaLXe7tQcHyzupXky8jigt1vu4KM0UOqDr963j36JRvJ835EATVIm6MnGz/i1/g==} + /is-what@4.1.16: + resolution: {integrity: sha512-ZhMwEosbFJkA0YhFnNDgTM4ZxDRsS6HqTo7qsZM08fehyRYIYa0yHu5R6mgo1n/8MgaPBXiPimPD77baVFYg+A==} engines: {node: '>=12.13'} dev: true - /jiti@1.18.2: - resolution: {integrity: sha512-QAdOptna2NYiSSpv0O/BwoHBSmz4YhpzJHyi+fnMRTXFjp7B8i/YG5Z8IfusxB1ufjcD2Sre1F3R+nX3fvy7gg==} + /jiti@1.21.0: + resolution: {integrity: sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==} hasBin: true dev: true @@ -1065,6 +1051,11 @@ packages: engines: {node: '>=10'} dev: true + /lilconfig@3.0.0: + resolution: {integrity: sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g==} + engines: {node: '>=14'} + dev: true + /lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} dev: true @@ -1075,11 +1066,11 @@ packages: yallist: 3.1.1 dev: true - /merge-anything@5.1.6: - resolution: {integrity: sha512-0SIP3417t0sOL6/crPb6oC+ZNSMrjJeWkydlddgZVzsjQA86l8v3+f3WwvKanbsHxVF80QouJIdSh+Q249bu0g==} + /merge-anything@5.1.7: + resolution: {integrity: sha512-eRtbOb1N5iyH0tkQDAoQ4Ipsp/5qSR79Dzrz8hEPxRX10RWWR/iQXdoKmBSRCThY1Fh5EhISDtpSc93fpxUniQ==} engines: {node: '>=12.13'} dependencies: - is-what: 4.1.9 + is-what: 4.1.16 dev: true /merge2@1.4.1: @@ -1113,14 +1104,14 @@ packages: thenify-all: 1.6.0 dev: true - /nanoid@3.3.6: - resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==} + /nanoid@3.3.7: + resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true dev: true - /node-releases@2.0.10: - resolution: {integrity: sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==} + /node-releases@2.0.14: + resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==} dev: true /normalize-path@3.0.0: @@ -1172,35 +1163,35 @@ packages: engines: {node: '>=0.10.0'} dev: true - /pirates@4.0.5: - resolution: {integrity: sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==} + /pirates@4.0.6: + resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==} engines: {node: '>= 6'} dev: true - /postcss-import@15.1.0(postcss@8.4.23): + /postcss-import@15.1.0(postcss@8.4.32): resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==} engines: {node: '>=14.0.0'} peerDependencies: postcss: ^8.0.0 dependencies: - postcss: 8.4.23 + postcss: 8.4.32 postcss-value-parser: 4.2.0 read-cache: 1.0.0 - resolve: 1.22.2 + resolve: 1.22.8 dev: true - /postcss-js@4.0.1(postcss@8.4.23): + /postcss-js@4.0.1(postcss@8.4.32): resolution: {integrity: sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==} engines: {node: ^12 || ^14 || >= 16} peerDependencies: postcss: ^8.4.21 dependencies: camelcase-css: 2.0.1 - postcss: 8.4.23 + postcss: 8.4.32 dev: true - /postcss-load-config@4.0.1(postcss@8.4.23): - resolution: {integrity: sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==} + /postcss-load-config@4.0.2(postcss@8.4.32): + resolution: {integrity: sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==} engines: {node: '>= 14'} peerDependencies: postcss: '>=8.0.9' @@ -1211,23 +1202,23 @@ packages: ts-node: optional: true dependencies: - lilconfig: 2.1.0 - postcss: 8.4.23 - yaml: 2.2.2 + lilconfig: 3.0.0 + postcss: 8.4.32 + yaml: 2.3.4 dev: true - /postcss-nested@6.0.1(postcss@8.4.23): + /postcss-nested@6.0.1(postcss@8.4.32): resolution: {integrity: sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==} engines: {node: '>=12.0'} peerDependencies: postcss: ^8.2.14 dependencies: - postcss: 8.4.23 - postcss-selector-parser: 6.0.12 + postcss: 8.4.32 + postcss-selector-parser: 6.0.13 dev: true - /postcss-selector-parser@6.0.12: - resolution: {integrity: sha512-NdxGCAZdRrwVI1sy59+Wzrh+pMMHxapGnpfenDVlMEXoOcvt4pGE0JLK9YY2F5dLxcFYA/YbVQKhcGU+FtSYQg==} + /postcss-selector-parser@6.0.13: + resolution: {integrity: sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ==} engines: {node: '>=4'} dependencies: cssesc: 3.0.0 @@ -1238,11 +1229,11 @@ packages: resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} dev: true - /postcss@8.4.23: - resolution: {integrity: sha512-bQ3qMcpF6A/YjR55xtoTr0jGOlnPOKAIMdOWiv0EIT6HVPEaJiJB4NLljSbiHoC2RX7DN5Uvjtpbg1NPdwv1oA==} + /postcss@8.4.32: + resolution: {integrity: sha512-D/kj5JNu6oo2EIy+XL/26JEDTlIbB8hw85G8StOE6L74RQAVVP5rej6wxCNqyMbR4RkPfqvezVbPw81Ngd6Kcw==} engines: {node: ^10 || ^12 || >=14} dependencies: - nanoid: 3.3.6 + nanoid: 3.3.7 picocolors: 1.0.0 source-map-js: 1.0.2 dev: true @@ -1264,11 +1255,11 @@ packages: picomatch: 2.3.1 dev: true - /resolve@1.22.2: - resolution: {integrity: sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==} + /resolve@1.22.8: + resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} hasBin: true dependencies: - is-core-module: 2.12.0 + is-core-module: 2.13.1 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 dev: true @@ -1278,12 +1269,12 @@ packages: engines: {iojs: '>=1.0.0', node: '>=0.10.0'} dev: true - /rollup@3.21.6: - resolution: {integrity: sha512-SXIICxvxQxR3D4dp/3LDHZIJPC8a4anKMHd4E3Jiz2/JnY+2bEjqrOokAauc5ShGVNFHlEFjBXAXlaxkJqIqSg==} + /rollup@3.29.4: + resolution: {integrity: sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==} engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true /run-parallel@1.2.0: @@ -1292,30 +1283,30 @@ packages: queue-microtask: 1.2.3 dev: true - /semver@6.3.0: - resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==} + /semver@6.3.1: + resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true dev: true - /seroval@0.5.1: - resolution: {integrity: sha512-ZfhQVB59hmIauJG5Ydynupy8KHyr5imGNtdDhbZG68Ufh1Ynkv9KOYOAABf71oVbQxJ8VkWnMHAjEHE7fWkH5g==} + /seroval@0.15.1: + resolution: {integrity: sha512-OPVtf0qmeC7RW+ScVX+7aOS+xoIM7pWcZ0jOWg2aTZigCydgRB04adfteBRbecZnnrO1WuGQ+C3tLeBBzX2zSQ==} engines: {node: '>=10'} - /solid-js@1.7.3: - resolution: {integrity: sha512-4hwaF/zV/xbNeBBIYDyu3dcReOZBECbO//mrra6GqOrKy4Soyo+fnKjpZSa0nODm6j1aL0iQRh/7ofYowH+jzw==} + /solid-js@1.8.7: + resolution: {integrity: sha512-9dzrSVieh2zj3SnJ02II6xZkonR6c+j/91b7XZUNcC6xSaldlqjjGh98F1fk5cRJ8ZTkzqF5fPIWDxEOs6QZXA==} dependencies: - csstype: 3.1.1 - seroval: 0.5.1 + csstype: 3.1.3 + seroval: 0.15.1 - /solid-refresh@0.5.2(solid-js@1.7.3): - resolution: {integrity: sha512-I69HmFj0LsGRJ3n8CEMVjyQFgVtuM2bSjznu2hCnsY+i5oOxh8ioWj00nnHBv0UYD3WpE/Sq4Q3TNw2IKmKN7A==} + /solid-refresh@0.5.3(solid-js@1.8.7): + resolution: {integrity: sha512-Otg5it5sjOdZbQZJnvo99TEBAr6J7PQ5AubZLNU6szZzg3RQQ5MX04oteBIIGDs0y2Qv8aXKm9e44V8z+UnFdw==} peerDependencies: solid-js: ^1.3 dependencies: - '@babel/generator': 7.21.5 - '@babel/helper-module-imports': 7.21.4 - '@babel/types': 7.21.5 - solid-js: 1.7.3 + '@babel/generator': 7.23.6 + '@babel/helper-module-imports': 7.22.15 + '@babel/types': 7.23.6 + solid-js: 1.8.7 dev: true /source-map-js@1.0.2: @@ -1323,8 +1314,8 @@ packages: engines: {node: '>=0.10.0'} dev: true - /sucrase@3.32.0: - resolution: {integrity: sha512-ydQOU34rpSyj2TGyz4D2p8rbktIOZ8QY9s+DGLvFU1i5pWJE8vkpruCjGCMHsdXwnD7JDcS+noSwM/a7zyNFDQ==} + /sucrase@3.34.0: + resolution: {integrity: sha512-70/LQEZ07TEcxiU2dz51FKaE6hCTWC6vr7FOk3Gr0U60C3shtAN+H+BFr9XlYe5xqf3RA8nrc+VIwzCfnxuXJw==} engines: {node: '>=8'} hasBin: true dependencies: @@ -1333,7 +1324,7 @@ packages: glob: 7.1.6 lines-and-columns: 1.2.4 mz: 2.7.0 - pirates: 4.0.5 + pirates: 4.0.6 ts-interface-checker: 0.1.13 dev: true @@ -1349,8 +1340,8 @@ packages: engines: {node: '>= 0.4'} dev: true - /tailwindcss@3.3.2: - resolution: {integrity: sha512-9jPkMiIBXvPc2KywkraqsUfbfj+dHDb+JPWtSJa9MLFdrPyazI7q6WX2sUrm7R9eVR7qqv3Pas7EvQFzxKnI6w==} + /tailwindcss@3.3.6: + resolution: {integrity: sha512-AKjF7qbbLvLaPieoKeTjG1+FyNZT6KaJMJPFeQyLfIp7l82ggH1fbHJSsYIvnbTFQOlkh+gBYpyby5GT1LIdLw==} engines: {node: '>=14.0.0'} hasBin: true dependencies: @@ -1359,24 +1350,23 @@ packages: chokidar: 3.5.3 didyoumean: 1.2.2 dlv: 1.1.3 - fast-glob: 3.2.12 + fast-glob: 3.3.2 glob-parent: 6.0.2 is-glob: 4.0.3 - jiti: 1.18.2 + jiti: 1.21.0 lilconfig: 2.1.0 micromatch: 4.0.5 normalize-path: 3.0.0 object-hash: 3.0.0 picocolors: 1.0.0 - postcss: 8.4.23 - postcss-import: 15.1.0(postcss@8.4.23) - postcss-js: 4.0.1(postcss@8.4.23) - postcss-load-config: 4.0.1(postcss@8.4.23) - postcss-nested: 6.0.1(postcss@8.4.23) - postcss-selector-parser: 6.0.12 - postcss-value-parser: 4.2.0 - resolve: 1.22.2 - sucrase: 3.32.0 + postcss: 8.4.32 + postcss-import: 15.1.0(postcss@8.4.32) + postcss-js: 4.0.1(postcss@8.4.32) + postcss-load-config: 4.0.2(postcss@8.4.32) + postcss-nested: 6.0.1(postcss@8.4.32) + postcss-selector-parser: 6.0.13 + resolve: 1.22.8 + sucrase: 3.34.0 transitivePeerDependencies: - ts-node dev: true @@ -1410,13 +1400,13 @@ packages: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} dev: true - /update-browserslist-db@1.0.11(browserslist@4.21.5): - resolution: {integrity: sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==} + /update-browserslist-db@1.0.13(browserslist@4.22.2): + resolution: {integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==} hasBin: true peerDependencies: browserslist: '>= 4.21.0' dependencies: - browserslist: 4.21.5 + browserslist: 4.22.2 escalade: 3.1.1 picocolors: 1.0.0 dev: true @@ -1429,32 +1419,33 @@ packages: resolution: {integrity: sha512-hGdgQozCsQJMyfK5urgFcWEqsSSrK63Awe0t/IMR0bZ0QMtnuaiHzThW81guu3qx9abLi99NEuiaN6P9gVYsNg==} dev: true - /vite-plugin-solid@2.7.0(solid-js@1.7.3)(vite@4.3.5): - resolution: {integrity: sha512-avp/Jl5zOp/Itfo67xtDB2O61U7idviaIp4mLsjhCa13PjKNasz+IID0jYTyqUp9SFx6/PmBr6v4KgDppqompg==} + /vite-plugin-solid@2.8.0(solid-js@1.8.7)(vite@4.5.1): + resolution: {integrity: sha512-n5FAm7ZmTl94VWUoiJCgG7bouF2NlC9CA1wY/qbVnkFbYDWk++bFWyNoU48aLJ+lMtzNeYzJypJXOHzFKxL9xA==} peerDependencies: solid-js: ^1.7.2 - vite: ^3.0.0 || ^4.0.0 - dependencies: - '@babel/core': 7.21.8 - '@babel/preset-typescript': 7.21.5(@babel/core@7.21.8) - '@types/babel__core': 7.20.0 - babel-preset-solid: 1.7.4(@babel/core@7.21.8) - merge-anything: 5.1.6 - solid-js: 1.7.3 - solid-refresh: 0.5.2(solid-js@1.7.3) - vite: 4.3.5 - vitefu: 0.2.4(vite@4.3.5) + vite: ^3.0.0 || ^4.0.0 || ^5.0.0 + dependencies: + '@babel/core': 7.23.6 + '@babel/preset-typescript': 7.23.3(@babel/core@7.23.6) + '@types/babel__core': 7.20.5 + babel-preset-solid: 1.8.6(@babel/core@7.23.6) + merge-anything: 5.1.7 + solid-js: 1.8.7 + solid-refresh: 0.5.3(solid-js@1.8.7) + vite: 4.5.1 + vitefu: 0.2.5(vite@4.5.1) transitivePeerDependencies: - supports-color dev: true - /vite@4.3.5: - resolution: {integrity: sha512-0gEnL9wiRFxgz40o/i/eTBwm+NEbpUeTWhzKrZDSdKm6nplj+z4lKz8ANDgildxHm47Vg8EUia0aicKbawUVVA==} + /vite@4.5.1: + resolution: {integrity: sha512-AXXFaAJ8yebyqzoNB9fu2pHoo/nWX+xZlaRwoeYUxEqBO+Zj4msE5G+BhGBll9lYEKv9Hfks52PAF2X7qDYXQA==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true peerDependencies: '@types/node': '>= 14' less: '*' + lightningcss: ^1.21.0 sass: '*' stylus: '*' sugarss: '*' @@ -1464,6 +1455,8 @@ packages: optional: true less: optional: true + lightningcss: + optional: true sass: optional: true stylus: @@ -1473,22 +1466,22 @@ packages: terser: optional: true dependencies: - esbuild: 0.17.18 - postcss: 8.4.23 - rollup: 3.21.6 + esbuild: 0.18.20 + postcss: 8.4.32 + rollup: 3.29.4 optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true - /vitefu@0.2.4(vite@4.3.5): - resolution: {integrity: sha512-fanAXjSaf9xXtOOeno8wZXIhgia+CZury481LsDaV++lSvcU2R9Ch2bPh3PYFyoHW+w9LqAeYRISVQjUIew14g==} + /vitefu@0.2.5(vite@4.5.1): + resolution: {integrity: sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==} peerDependencies: - vite: ^3.0.0 || ^4.0.0 + vite: ^3.0.0 || ^4.0.0 || ^5.0.0 peerDependenciesMeta: vite: optional: true dependencies: - vite: 4.3.5 + vite: 4.5.1 dev: true /wrappy@1.0.2: @@ -1499,7 +1492,7 @@ packages: resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} dev: true - /yaml@2.2.2: - resolution: {integrity: sha512-CBKFWExMn46Foo4cldiChEzn7S7SRV+wqiluAb6xmueD/fGyRHIhX8m14vVGgeFWjN540nKCNVj6P21eQjgTuA==} + /yaml@2.3.4: + resolution: {integrity: sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==} engines: {node: '>= 14'} dev: true diff --git a/package.json b/package.json index 76273909..24bf3ba0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cosmes", - "version": "0.0.42", + "version": "0.0.43", "private": false, "packageManager": "pnpm@8.3.0", "sideEffects": false, diff --git a/src/client/apis/broadcastTx.ts b/src/client/apis/broadcastTx.ts index 6bf82158..9e6d5d32 100644 --- a/src/client/apis/broadcastTx.ts +++ b/src/client/apis/broadcastTx.ts @@ -1,5 +1,3 @@ -import { base64 } from "cosmes/codec"; - import { Prettify } from "../../typeutils/prettify"; import { RpcClient } from "../clients/RpcClient"; import { ToSignedProtoParams, Tx } from "../models/Tx"; @@ -17,8 +15,5 @@ export async function broadcastTx( endpoint: string, { tx, ...params }: BroadcastTxParams ) { - return RpcClient.broadcastTx( - endpoint, - base64.encode(tx.toSignedProto(params).toBinary()) - ); + return RpcClient.broadcastTx(endpoint, tx.toSignedProto(params)); } diff --git a/src/client/clients/RpcClient.ts b/src/client/clients/RpcClient.ts index 54040623..17030db5 100644 --- a/src/client/clients/RpcClient.ts +++ b/src/client/clients/RpcClient.ts @@ -1,5 +1,6 @@ import { JsonValue, Message, PartialMessage } from "@bufbuild/protobuf"; import { base16, base64 } from "cosmes/codec"; +import { CosmosTxV1beta1TxRaw as TxRaw } from "cosmes/protobufs"; import { FetchClient } from "./FetchClient"; @@ -107,13 +108,13 @@ export class RpcClient { */ public static async broadcastTx( endpoint: string, - base64EncodedTx: string + txRaw: TxRaw ): Promise { const { code, log, hash } = await this.doRequest( endpoint, "broadcast_tx_sync", { - tx: base64EncodedTx, + tx: base64.encode(txRaw.toBinary()), } ); if (code !== 0) { diff --git a/src/client/index.ts b/src/client/index.ts index 3e5c79b1..0ac43a8e 100644 --- a/src/client/index.ts +++ b/src/client/index.ts @@ -34,6 +34,7 @@ export { MsgSwapExactAmountIn } from "./models/MsgSwapExactAmountIn"; export { Secp256k1PubKey } from "./models/Secp256k1PubKey"; export { Tx, + type ToSignDocParams, type ToSignedProtoParams, type ToStdSignDocParams, type ToUnsignedProtoParams, diff --git a/src/client/models/Tx.ts b/src/client/models/Tx.ts index 91c91c02..b5c07388 100644 --- a/src/client/models/Tx.ts +++ b/src/client/models/Tx.ts @@ -1,14 +1,15 @@ import { PlainMessage } from "@bufbuild/protobuf"; +import { base64 } from "@scure/base"; import { CosmosTxV1beta1AuthInfo as ProtoAuthInfo, CosmosTxV1beta1Fee as ProtoFee, + CosmosTxV1beta1SignDoc as ProtoSignDoc, CosmosTxSigningV1beta1SignMode as ProtoSignMode, CosmosTxV1beta1SignerInfo as ProtoSignerInfo, CosmosTxV1beta1TxBody as ProtoTxBody, CosmosTxV1beta1TxRaw as ProtoTxRaw, - CosmosTxV1beta1SignDoc as SignDoc, } from "cosmes/protobufs"; -import { StdSignDoc } from "cosmes/registry"; +import { SignDoc, StdSignDoc } from "cosmes/registry"; import { toAny } from "../utils/toAny"; import { Adapter } from "./Adapter"; @@ -26,11 +27,12 @@ export type ToSignedProtoParams = { signMode: ProtoSignMode; signature: Uint8Array; memo?: string | undefined; + timeoutHeight?: bigint | undefined; }; export type ToUnsignedProtoParams = Pick< ToSignedProtoParams, - "sequence" | "memo" + "sequence" | "memo" | "timeoutHeight" >; export type ToSignDocParams = { @@ -38,6 +40,7 @@ export type ToSignDocParams = { sequence: bigint; fee: ProtoFee; memo?: string | undefined; + timeoutHeight?: bigint | undefined; }; export type ToStdSignDocParams = ToSignDocParams; @@ -50,7 +53,7 @@ export class Tx { } /** - * Returns the signed, proto encoded tx ready to be broadcasted. To create an + * Returns the signed, proto-encoded tx, ready to be broadcasted. To create an * unsigned tx for the purpose of simulating it, use {@link toUnsignedProto}. */ public toSignedProto({ @@ -59,6 +62,7 @@ export class Tx { signMode, signature, memo, + timeoutHeight, }: ToSignedProtoParams): ProtoTxRaw { return new ProtoTxRaw({ authInfoBytes: new ProtoAuthInfo({ @@ -68,13 +72,14 @@ export class Tx { bodyBytes: new ProtoTxBody({ messages: this.data.msgs.map((m) => toAny(m.toProto())), memo: memo, + timeoutHeight: timeoutHeight, }).toBinary(), signatures: [signature], }); } /** - * Returns the proto encoded tx with the sign mode set to UNSPECIFIED, useful + * Returns the proto-encoded tx with the sign mode set to `UNSPECIFIED`, useful * for simulating the tx. To create a signed tx, use {@link toSignedProto}. */ public toUnsignedProto(info: ToUnsignedProtoParams): ProtoTxRaw { @@ -87,15 +92,61 @@ export class Tx { } /** - * Returns the unsigned, proto encoded tx ready to be signed by a wallet. + * Combines the given `StdSignDoc` and `signature` and returns the proto-encoded + * tx with sign mode set to `LEGACY_AMINO_JSON`, ready to be broadcasted. + * + * @param signature Must be a base64 encoded string or an `Uint8Array` + */ + public toSignedAmino( + { sequence, fee, memo, timeout_height }: StdSignDoc, + signature: string | Uint8Array + ): ProtoTxRaw { + return this.toSignedProto({ + sequence: BigInt(sequence), + fee: new ProtoFee({ + amount: fee.amount.slice(), + gasLimit: BigInt(fee.gas), + payer: fee.payer, + granter: fee.granter, + }), + signMode: ProtoSignMode.LEGACY_AMINO_JSON, + signature: + typeof signature === "string" ? base64.decode(signature) : signature, + memo: memo, + timeoutHeight: timeout_height ? BigInt(timeout_height) : undefined, + }); + } + + /** + * Combines the given `SignDoc` and `signature` and returns the proto-encoded tx, + * ready to be broadcasted. + * + * @param signature Must be a base64 encoded string or an `Uint8Array` + */ + public toSignedDirect( + { bodyBytes, authInfoBytes }: SignDoc, + signature: string | Uint8Array + ): ProtoTxRaw { + return new ProtoTxRaw({ + authInfoBytes, + bodyBytes, + signatures: [ + typeof signature === "string" ? base64.decode(signature) : signature, + ], + }); + } + + /** + * Returns the unsigned, proto-encoded tx ready to be signed by a wallet. */ public toSignDoc({ accountNumber, sequence, fee, memo, - }: ToSignDocParams): SignDoc { - return new SignDoc({ + timeoutHeight, + }: ToSignDocParams): ProtoSignDoc { + return new ProtoSignDoc({ chainId: this.data.chainId, accountNumber: accountNumber, authInfoBytes: new ProtoAuthInfo({ @@ -105,18 +156,20 @@ export class Tx { bodyBytes: new ProtoTxBody({ messages: this.data.msgs.map((m) => toAny(m.toProto())), memo: memo, + timeoutHeight: timeoutHeight, }).toBinary(), }); } /** - * Returns the unsigned, amino encoded tx ready to be signed by a wallet. + * Returns the unsigned, amino-encoded tx ready to be signed by a wallet. */ public toStdSignDoc({ accountNumber, sequence, fee, memo, + timeoutHeight, }: ToStdSignDocParams): StdSignDoc { return { chain_id: this.data.chainId, @@ -128,6 +181,7 @@ export class Tx { }, msgs: this.data.msgs.map((m) => m.toAmino()), memo: memo ?? "", + timeout_height: timeoutHeight?.toString(), }; } diff --git a/src/codec/index.ts b/src/codec/index.ts index 541f24b6..3f224ccd 100644 --- a/src/codec/index.ts +++ b/src/codec/index.ts @@ -4,4 +4,4 @@ export * from "@scure/base"; export { resolveBech32Address } from "./address"; export { resolveKeyPair } from "./key"; export { serialiseSignDoc } from "./serialise"; -export { signAmino } from "./sign"; +export { signAmino, signDirect } from "./sign"; diff --git a/src/codec/sign.ts b/src/codec/sign.ts index 169d0301..810f5db4 100644 --- a/src/codec/sign.ts +++ b/src/codec/sign.ts @@ -1,24 +1,38 @@ import { hmac } from "@noble/hashes/hmac"; import { sha256 } from "@noble/hashes/sha256"; import * as secp256k1 from "@noble/secp256k1"; +import { CosmosTxV1beta1SignDoc as SignDoc } from "cosmes/protobufs"; import { StdSignDoc } from "cosmes/registry"; import { serialiseSignDoc } from "./serialise"; +function sign(bytes: Uint8Array, privateKey: Uint8Array): Uint8Array { + // Required polyfills for secp256k1 that must be called before any sign ops. + // See: https://github.com/paulmillr/noble-secp256k1?tab=readme-ov-file#usage + secp256k1.etc.hmacSha256Sync = (k, ...m) => + hmac(sha256, k, secp256k1.etc.concatBytes(...m)); + + return secp256k1.sign(sha256(bytes), privateKey).toCompactRawBytes(); +} + /** - * Signs the given `stdSignDoc` with the given `privateKey` using secp256k1, and - * returns the signature bytes. + * Signs the given amino-encoded `stdSignDoc` with the given `privateKey` using + * secp256k1, and returns the signature bytes. */ export function signAmino( stdSignDoc: StdSignDoc, privateKey: Uint8Array ): Uint8Array { - // Required polyfills for secp256k1. - // See: https://github.com/paulmillr/noble-secp256k1?tab=readme-ov-file#usage - secp256k1.etc.hmacSha256Sync = (k, ...m) => - hmac(sha256, k, secp256k1.etc.concatBytes(...m)); + return sign(serialiseSignDoc(stdSignDoc), privateKey); +} - return secp256k1 - .sign(sha256(serialiseSignDoc(stdSignDoc)), privateKey) - .toCompactRawBytes(); +/** + * Signs the given proto-encoded `signDoc` with the given `privateKey` using + * secp256k1, and returns the signature bytes. + */ +export function signDirect( + signDoc: SignDoc, + privateKey: Uint8Array +): Uint8Array { + return sign(signDoc.toBinary(), privateKey); } diff --git a/src/wallet/utils/tx.ts b/src/wallet/utils/tx.ts deleted file mode 100644 index c8b1d0df..00000000 --- a/src/wallet/utils/tx.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { Tx } from "cosmes/client"; -import { base64 } from "cosmes/codec"; -import { - CosmosTxV1beta1Fee as Fee, - CosmosTxSigningV1beta1SignMode as SignMode, - CosmosTxV1beta1TxRaw as TxRaw, -} from "cosmes/protobufs"; -import type { Coin, StdSignDoc } from "cosmes/registry"; - -/** - * Returns the signed, proto encoded tx by combining the given `tx`, `signature`, - * and `stdSignDoc`. This function can be used across all Keplr-like wallets. - */ -export function stdSignDocToSignedProto( - tx: Tx, - signature: string, - { sequence, fee, memo }: StdSignDoc -): TxRaw { - return tx.toSignedProto({ - sequence: BigInt(sequence), - fee: new Fee({ - amount: fee.amount as Coin[], - gasLimit: BigInt(fee.gas), - payer: fee.payer, - granter: fee.granter, - }), - signMode: SignMode.LEGACY_AMINO_JSON, // TODO: support other sign modes (?) - signature: base64.decode(signature), - memo: memo, - }); -} diff --git a/src/wallet/walletconnect/WalletConnectV2.ts b/src/wallet/walletconnect/WalletConnectV2.ts index fcb607f4..bdcdb636 100644 --- a/src/wallet/walletconnect/WalletConnectV2.ts +++ b/src/wallet/walletconnect/WalletConnectV2.ts @@ -1,7 +1,7 @@ import SignClient from "@walletconnect/sign-client"; +import { SignDoc, StdSignDoc } from "cosmes/registry"; import { debounce } from "lodash-es"; -import { StdSignDoc } from "cosmes/registry"; import { isAndroid, isMobile } from "../utils/os"; import { MobileAppDetails, QRCodeModal } from "./QRCodeModal"; @@ -19,21 +19,29 @@ type GetAccountResponse = { pubkey: string; }; -type SignAminoResponse = { - signature: string; - signed: StdSignDoc; +/** + * The data returned by the `cosmos_signAmino` method. `signed` is optional + * because some wallets (like Cosmostation) may not return it. + */ +type WcSignAminoResponse = { + signature: { + signature: string; + }; + signed?: StdSignDoc | undefined; }; +type SignAminoResponse = Required; /** - * The data returned by the `cosmos_signAmino` for keplr-like wallets. `signed` is - * optional because some wallets (like cosmostation) do not return it. + * The data returned by the `cosmos_signDirect` method. `signed` is optional + * because some wallets (like Cosmostation) may not return it. */ -type PartialSignAminoResponse = { +type WcSignDirectResponse = { signature: { signature: string; }; - signed?: StdSignDoc | undefined; + signed?: SignDoc | undefined; }; +type SignDirectResponse = Required; const Method = { GET_ACCOUNTS: "cosmos_getAccounts", @@ -175,18 +183,37 @@ export class WalletConnectV2 { public async signAmino( chainId: string, signerAddress: string, - signDoc: StdSignDoc + stdSignDoc: StdSignDoc ): Promise { - const { signature, signed } = await this.request( + const { signature, signed } = await this.request( chainId, Method.SIGN_AMINO, + { + signerAddress, + signDoc: stdSignDoc, + } + ); + return { + signature: signature, + signed: signed ?? stdSignDoc, // simply return the original sign doc if `signed` is not returned + }; + } + + public async signDirect( + chainId: string, + signerAddress: string, + signDoc: SignDoc + ): Promise { + const { signature, signed } = await this.request( + chainId, + Method.SIGN_DIRECT, { signerAddress, signDoc, } ); return { - signature: signature.signature, + signature: signature, signed: signed ?? signDoc, // simply return the original sign doc if `signed` is not returned }; } diff --git a/src/wallet/wallets/ConnectedWallet.ts b/src/wallet/wallets/ConnectedWallet.ts index 62ee2399..074c7323 100644 --- a/src/wallet/wallets/ConnectedWallet.ts +++ b/src/wallet/wallets/ConnectedWallet.ts @@ -22,6 +22,7 @@ import type { WalletType } from "../constants/WalletType"; export type UnsignedTx = { msgs: Adapter[]; memo?: string | undefined; + timeoutHeight?: bigint | undefined; }; export type PollTxOptions = Pick< diff --git a/src/wallet/wallets/cosmostation/CosmostationController.ts b/src/wallet/wallets/cosmostation/CosmostationController.ts index 8a9b7c02..f198d77f 100644 --- a/src/wallet/wallets/cosmostation/CosmostationController.ts +++ b/src/wallet/wallets/cosmostation/CosmostationController.ts @@ -9,7 +9,6 @@ import { ConnectedWallet } from "../ConnectedWallet"; import { ChainInfo, WalletController } from "../WalletController"; import { CosmostationExtension } from "./CosmostationExtension"; import { CosmostationWalletConnectV2 } from "./CosmostationWalletConnectV2"; -import { CosmostationExtMethod, CosmostationWcUri } from "./constants"; export class CosmostationController extends WalletController { private readonly wc: WalletConnectV2; @@ -19,8 +18,9 @@ export class CosmostationController extends WalletController { this.wc = new WalletConnectV2(wcProjectId, { // https://github.com/cosmostation/cosmostation-wc-modal/blob/main/src/modal.tsx#L22-L34 name: "Cosmostation", - android: CosmostationWcUri.ANDROID, - ios: CosmostationWcUri.IOS, + android: + "intent://wc#Intent;package=wannabit.io.cosmostaion;scheme=cosmostation;end;", + ios: "cosmostation://wc", }); this.registerAccountChangeHandlers(); } @@ -43,12 +43,14 @@ export class CosmostationController extends WalletController { wallets.set( chainId, new CosmostationWalletConnectV2( + this.id, this.wc, chainId, key, address, rpc, - gasPrice + gasPrice, + true // TODO: use sign mode direct when supported ) ); } @@ -57,22 +59,28 @@ export class CosmostationController extends WalletController { protected async connectExtension(chains: ChainInfo[]) { const wallets = new Map(); - const ext = window.cosmostation; + const ext = window.cosmostation.providers.keplr; if (!ext) { throw new Error("Cosmostation extension is not installed"); } + await ext.enable(chains.map(({ chainId }) => chainId)); for (const { chainId, rpc, gasPrice } of Object.values(chains)) { - // https://docs.cosmostation.io/integration-extension/cosmos/accounts#vanilla-code-1 - const res = await window.cosmostation.cosmos.request({ - method: CosmostationExtMethod.REQUEST_ACCOUNT, - params: { chainName: chainId }, - }); + const { bech32Address, pubKey, isNanoLedger } = await ext.getKey(chainId); const key = new Secp256k1PubKey({ - key: res.publicKey, + key: pubKey, }); wallets.set( chainId, - new CosmostationExtension(ext, chainId, key, res.address, rpc, gasPrice) + new CosmostationExtension( + this.id, + ext, + chainId, + key, + bech32Address, + rpc, + gasPrice, + isNanoLedger + ) ); } return wallets; diff --git a/src/wallet/wallets/cosmostation/CosmostationExtension.ts b/src/wallet/wallets/cosmostation/CosmostationExtension.ts index f1c9341d..55b0947e 100644 --- a/src/wallet/wallets/cosmostation/CosmostationExtension.ts +++ b/src/wallet/wallets/cosmostation/CosmostationExtension.ts @@ -1,104 +1,5 @@ -import { PlainMessage } from "@bufbuild/protobuf"; -import { Secp256k1PubKey, Tx } from "cosmes/client"; -import { base64 } from "cosmes/codec"; -import { - CosmosBaseV1beta1Coin as Coin, - CosmosTxV1beta1Fee as Fee, -} from "cosmes/protobufs"; +import { KeplrExtension } from "../keplr/KeplrExtension"; -import { WalletName } from "../../constants/WalletName"; -import { WalletType } from "../../constants/WalletType"; -import { stdSignDocToSignedProto } from "../../utils/tx"; -import { - ConnectedWallet, - SignArbitraryResponse, - UnsignedTx, -} from "../ConnectedWallet"; -import { CosmostationExtMethod } from "./constants"; -import { - Cosmostation, - ExtSignArbitraryResponse, - SendTransactionResponse, - SignAminoResponse, -} from "./types"; - -export class CosmostationExtension extends ConnectedWallet { - private readonly ext: Cosmostation; - - constructor( - ext: Cosmostation, - chainId: string, - pubKey: Secp256k1PubKey, - address: string, - rpc: string, - gasPrice: PlainMessage - ) { - super( - WalletName.COSMOSTATION, - WalletType.EXTENSION, - chainId, - pubKey, - address, - rpc, - gasPrice - ); - this.ext = ext; - } - - public async signArbitrary(data: string): Promise { - // https://docs.cosmostation.io/integration-extension/cosmos/sign-message#vanilla-code - const res: ExtSignArbitraryResponse = await this.ext.cosmos.request({ - method: CosmostationExtMethod.SIGN_ARBITRARY, - params: { - chainName: this.chainId, - signer: this.address, - message: data, - }, - }); - return { - data, - pubKey: res.pub_key.value, - signature: res.signature, - }; - } - - public async signAndBroadcastTx( - { msgs, memo }: UnsignedTx, - fee: Fee, - accountNumber: bigint, - sequence: bigint - ): Promise { - const tx = new Tx({ - chainId: this.chainId, - pubKey: this.pubKey, - msgs: msgs, - }); - // https://docs.cosmostation.io/integration-extension/cosmos/sign-tx#vanilla-code - const { signature, signed_doc }: SignAminoResponse = - await this.ext.cosmos.request({ - method: CosmostationExtMethod.SIGN_AMINO, - params: { - chainName: this.chainId, - doc: tx.toStdSignDoc({ - accountNumber, - sequence, - fee, - memo, - }), - }, - }); - // https://docs.cosmostation.io/integration-extension/cosmos/send-tx#vanilla-code - const { tx_response }: SendTransactionResponse = - await this.ext.cosmos.request({ - method: CosmostationExtMethod.SEND_TX, - params: { - chainName: this.chainId, - txBytes: base64.encode( - stdSignDocToSignedProto(tx, signature, signed_doc).toBinary() - ), - mode: 2, // for SYNC mode - }, - }); - return tx_response.txhash; - } -} +// Cosmostation's API is similar to Keplr. +// See: https://docs.cosmostation.io/extension/integration/cosmos/integrate-keplr +export const CosmostationExtension = KeplrExtension; diff --git a/src/wallet/wallets/cosmostation/CosmostationWalletConnectV2.ts b/src/wallet/wallets/cosmostation/CosmostationWalletConnectV2.ts index ee8f6fea..ebff062d 100644 --- a/src/wallet/wallets/cosmostation/CosmostationWalletConnectV2.ts +++ b/src/wallet/wallets/cosmostation/CosmostationWalletConnectV2.ts @@ -1,82 +1,4 @@ -import { PlainMessage } from "@bufbuild/protobuf"; -import { Secp256k1PubKey, Tx, broadcastTx } from "cosmes/client"; -import { base64 } from "cosmes/codec"; -import { - CosmosBaseV1beta1Coin as Coin, - CosmosTxV1beta1Fee as Fee, - CosmosTxSigningV1beta1SignMode as SignMode, -} from "cosmes/protobufs"; -import { WalletName, WalletType } from "cosmes/wallet"; +import { KeplrWalletConnectV2 } from "../keplr/KeplrWalletConnectV2"; -import { WalletConnectV2 } from "../../walletconnect/WalletConnectV2"; -import { - ConnectedWallet, - SignArbitraryResponse, - UnsignedTx, -} from "../ConnectedWallet"; - -export class CosmostationWalletConnectV2 extends ConnectedWallet { - private readonly wc: WalletConnectV2; - - constructor( - wc: WalletConnectV2, - chainId: string, - pubKey: Secp256k1PubKey, - address: string, - rpc: string, - gasPrice: PlainMessage - ) { - super( - WalletName.COSMOSTATION, - WalletType.WALLETCONNECT, - chainId, - pubKey, - address, - rpc, - gasPrice - ); - this.wc = wc; - } - - public async signArbitrary(_data: string): Promise { - // ! Not implemented by Cosmostation - throw new Error("Method not implemented."); - } - - public async signAndBroadcastTx( - { msgs, memo }: UnsignedTx, - fee: Fee, - accountNumber: bigint, - sequence: bigint - ): Promise { - const tx = new Tx({ - chainId: this.chainId, - pubKey: this.pubKey, - msgs: msgs, - }); - const { signature, signed } = await this.wc.signAmino( - this.chainId, - this.address, - tx.toStdSignDoc({ - accountNumber, - sequence, - fee, - memo, - }) - ); - // Since `sendTx` on WC isn't implemented yet, we have to broadcast manually - return broadcastTx(this.rpc, { - tx, - sequence: BigInt(signed.sequence), - fee: new Fee({ - amount: signed.fee.amount as Coin[], - gasLimit: BigInt(signed.fee.gas), - payer: signed.fee.payer, - granter: signed.fee.granter, - }), - signMode: SignMode.LEGACY_AMINO_JSON, - signature: base64.decode(signature), - memo: signed.memo, - }); - } -} +// Cosmostation's API is similar to Keplr. +export const CosmostationWalletConnectV2 = KeplrWalletConnectV2; diff --git a/src/wallet/wallets/cosmostation/constants.ts b/src/wallet/wallets/cosmostation/constants.ts deleted file mode 100644 index 4c9e5efc..00000000 --- a/src/wallet/wallets/cosmostation/constants.ts +++ /dev/null @@ -1,23 +0,0 @@ -export const CosmostationWcUri = { - ANDROID: - "intent://wc#Intent;package=wannabit.io.cosmostaion;scheme=cosmostation;end;", - IOS: "cosmostation://wc", -} as const; -export type CosmostationWcUri = - (typeof CosmostationWcUri)[keyof typeof CosmostationWcUri]; - -export const CosmostationWcV1Method = { - GET_ACCOUNTS: "cosmostation_wc_accounts_v1", - SIGN_AMINO: "cosmostation_wc_sign_tx_v1", -} as const; -export type CosmostationWcV1Method = - (typeof CosmostationWcV1Method)[keyof typeof CosmostationWcV1Method]; - -export const CosmostationExtMethod = { - REQUEST_ACCOUNT: "cos_requestAccount", - SIGN_ARBITRARY: "cos_signMessage", - SIGN_AMINO: "cos_signAmino", - SEND_TX: "cos_sendTransaction", -} as const; -export type CosmostationExtMethod = - (typeof CosmostationExtMethod)[keyof typeof CosmostationExtMethod]; diff --git a/src/wallet/wallets/cosmostation/types.ts b/src/wallet/wallets/cosmostation/types.ts index 9153c032..4aa4847f 100644 --- a/src/wallet/wallets/cosmostation/types.ts +++ b/src/wallet/wallets/cosmostation/types.ts @@ -1,57 +1,12 @@ -import { StdSignDoc } from "cosmes/registry"; +import { Keplr } from "cosmes/registry"; -/** - * Adapted from https://github.com/cosmostation/cosmostation-chrome-extension-client/blob/main/src/types/d.ts/window.d.ts - */ -export type Cosmostation = { - ethereum: { - request: (message: { method: string; params?: unknown }) => Promise; - on: (eventName: string, eventHandler: (event?: unknown) => void) => unknown; - off: (handler: unknown) => void; - sendAsync: () => null; - }; - cosmos: { - request: (message: { method: string; params?: unknown }) => Promise; - on: (eventName: string, eventHandler: (event?: unknown) => void) => unknown; - off: (handler: unknown) => void; - }; - aptos: { - request: (message: { method: string; params?: unknown }) => Promise; - on: (eventName: string, eventHandler: (event?: any) => void) => void; - off: (eventName: string, eventHandler: (event?: any) => void) => void; - }; - tendermint: { - request: (message: { method: string; params?: unknown }) => Promise; - on: (eventName: string, eventHandler: (event?: unknown) => void) => unknown; - off: (handler: unknown) => void; - }; -}; +// Type is similar to Keplr +export type Cosmostation = Keplr; export type Window = { - cosmostation: Cosmostation; -}; - -export type ExtSignArbitraryResponse = { - pub_key: { - type: string; - value: string; + cosmostation: { + providers: { + keplr: Cosmostation; + }; }; - signature: string; }; - -export type SignAminoResponse = { - signature: string; - signed_doc: StdSignDoc; -}; - -export type SendTransactionResponse = { - tx_response: { - txhash: string; - }; -}; - -export type WcSignAminoResponse = { - signature: { - signature: string; - }; -}[]; diff --git a/src/wallet/wallets/keplr/KeplrController.ts b/src/wallet/wallets/keplr/KeplrController.ts index 9ba6e623..bba1ddcb 100644 --- a/src/wallet/wallets/keplr/KeplrController.ts +++ b/src/wallet/wallets/keplr/KeplrController.ts @@ -9,7 +9,6 @@ import { ConnectedWallet } from "../ConnectedWallet"; import { ChainInfo, WalletController } from "../WalletController"; import { KeplrExtension } from "./KeplrExtension"; import { KeplrWalletConnectV2 } from "./KeplrWalletConnectV2"; -import { KeplrWcV2Uri } from "./constants"; export class KeplrController extends WalletController { private readonly wc: WalletConnectV2; @@ -19,8 +18,9 @@ export class KeplrController extends WalletController { this.wc = new WalletConnectV2(wcProjectId, { // https://github.com/chainapsis/keplr-wallet/blob/master/packages/wc-qrcode-modal/src/modal.tsx#L61-L75 name: "Keplr", - android: KeplrWcV2Uri.ANDROID, - ios: KeplrWcV2Uri.IOS, + android: + "intent://wcV2#Intent;package=com.chainapsis.keplr;scheme=keplrwallet;end;", + ios: "keplrwallet://wcV2", }); this.registerAccountChangeHandlers(); } @@ -42,7 +42,16 @@ export class KeplrController extends WalletController { }); wallets.set( chainId, - new KeplrWalletConnectV2(this.wc, chainId, key, address, rpc, gasPrice) + new KeplrWalletConnectV2( + this.id, + this.wc, + chainId, + key, + address, + rpc, + gasPrice, + true // TODO: use sign mode direct when supported + ) ); } return { wallets, wc: this.wc }; @@ -56,13 +65,22 @@ export class KeplrController extends WalletController { } await ext.enable(chains.map(({ chainId }) => chainId)); for (const { chainId, rpc, gasPrice } of Object.values(chains)) { - const { bech32Address, pubKey } = await ext.getKey(chainId); + const { bech32Address, pubKey, isNanoLedger } = await ext.getKey(chainId); const key = new Secp256k1PubKey({ key: pubKey, }); wallets.set( chainId, - new KeplrExtension(ext, chainId, key, bech32Address, rpc, gasPrice) + new KeplrExtension( + this.id, + ext, + chainId, + key, + bech32Address, + rpc, + gasPrice, + isNanoLedger + ) ); } return wallets; diff --git a/src/wallet/wallets/keplr/KeplrExtension.ts b/src/wallet/wallets/keplr/KeplrExtension.ts index 161050d8..cdf0d693 100644 --- a/src/wallet/wallets/keplr/KeplrExtension.ts +++ b/src/wallet/wallets/keplr/KeplrExtension.ts @@ -1,15 +1,20 @@ import { PlainMessage } from "@bufbuild/protobuf"; -import { Secp256k1PubKey, Tx } from "cosmes/client"; +import { + Secp256k1PubKey, + ToSignDocParams, + ToStdSignDocParams, + Tx, +} from "cosmes/client"; import { base16 } from "cosmes/codec"; import { CosmosBaseV1beta1Coin as Coin, CosmosTxV1beta1Fee as Fee, + CosmosTxV1beta1TxRaw as TxRaw, } from "cosmes/protobufs"; import type { BroadcastMode, Keplr } from "cosmes/registry"; import { WalletName } from "../../constants/WalletName"; import { WalletType } from "../../constants/WalletType"; -import { stdSignDocToSignedProto } from "../../utils/tx"; import { ConnectedWallet, SignArbitraryResponse, @@ -18,17 +23,20 @@ import { export class KeplrExtension extends ConnectedWallet { private readonly ext: Keplr; + private readonly useAmino: boolean; constructor( + walletName: WalletName, ext: Keplr, chainId: string, pubKey: Secp256k1PubKey, address: string, rpc: string, - gasPrice: PlainMessage + gasPrice: PlainMessage, + useAmino: boolean ) { super( - WalletName.KEPLR, + walletName, WalletType.EXTENSION, chainId, pubKey, @@ -43,6 +51,7 @@ export class KeplrExtension extends ConnectedWallet { preferNoSetMemo: true, }, }; + this.useAmino = useAmino; } public async signArbitrary(data: string): Promise { @@ -55,7 +64,7 @@ export class KeplrExtension extends ConnectedWallet { } protected async signAndBroadcastTx( - { msgs, memo }: UnsignedTx, + { msgs, memo, timeoutHeight }: UnsignedTx, fee: Fee, accountNumber: bigint, sequence: bigint @@ -65,19 +74,34 @@ export class KeplrExtension extends ConnectedWallet { pubKey: this.pubKey, msgs: msgs, }); - const { signature, signed } = await this.ext.signAmino( - this.chainId, - this.address, - tx.toStdSignDoc({ - accountNumber, - sequence, - fee, - memo, - }) - ); + + const params: ToStdSignDocParams | ToSignDocParams = { + accountNumber, + sequence, + fee, + memo, + timeoutHeight, + }; + let txRaw: TxRaw; + if (this.useAmino) { + const { signed, signature } = await this.ext.signAmino( + this.chainId, + this.address, + tx.toStdSignDoc(params) + ); + txRaw = tx.toSignedAmino(signed, signature.signature); + } else { + const { signed, signature } = await this.ext.signDirect( + this.chainId, + this.address, + tx.toSignDoc(params) + ); + txRaw = tx.toSignedDirect(signed, signature.signature); + } + const txHash = await this.ext.sendTx( this.chainId, - stdSignDocToSignedProto(tx, signature.signature, signed).toBinary(), + txRaw.toBinary(), "sync" as BroadcastMode ); return base16.encode(txHash); diff --git a/src/wallet/wallets/keplr/KeplrWalletConnectV2.ts b/src/wallet/wallets/keplr/KeplrWalletConnectV2.ts index df337082..d9538941 100644 --- a/src/wallet/wallets/keplr/KeplrWalletConnectV2.ts +++ b/src/wallet/wallets/keplr/KeplrWalletConnectV2.ts @@ -1,10 +1,15 @@ import { PlainMessage } from "@bufbuild/protobuf"; -import { Secp256k1PubKey, Tx, broadcastTx } from "cosmes/client"; -import { base64 } from "cosmes/codec"; +import { + RpcClient, + Secp256k1PubKey, + ToSignDocParams, + ToStdSignDocParams, + Tx, +} from "cosmes/client"; import { CosmosBaseV1beta1Coin as Coin, CosmosTxV1beta1Fee as Fee, - CosmosTxSigningV1beta1SignMode as SignMode, + CosmosTxV1beta1TxRaw as TxRaw, } from "cosmes/protobufs"; import { WalletName, WalletType } from "cosmes/wallet"; @@ -17,17 +22,20 @@ import { export class KeplrWalletConnectV2 extends ConnectedWallet { private readonly wc: WalletConnectV2; + private readonly useAmino: boolean; constructor( + walletName: WalletName, wc: WalletConnectV2, chainId: string, pubKey: Secp256k1PubKey, address: string, rpc: string, - gasPrice: PlainMessage + gasPrice: PlainMessage, + useAmino: boolean ) { super( - WalletName.KEPLR, + walletName, WalletType.WALLETCONNECT, chainId, pubKey, @@ -36,6 +44,7 @@ export class KeplrWalletConnectV2 extends ConnectedWallet { gasPrice ); this.wc = wc; + this.useAmino = useAmino; } public async signArbitrary(_data: string): Promise { @@ -45,7 +54,7 @@ export class KeplrWalletConnectV2 extends ConnectedWallet { } public async signAndBroadcastTx( - { msgs, memo }: UnsignedTx, + { msgs, memo, timeoutHeight }: UnsignedTx, fee: Fee, accountNumber: bigint, sequence: bigint @@ -55,29 +64,32 @@ export class KeplrWalletConnectV2 extends ConnectedWallet { pubKey: this.pubKey, msgs: msgs, }); - const { signature, signed } = await this.wc.signAmino( - this.chainId, - this.address, - tx.toStdSignDoc({ - accountNumber, - sequence, - fee, - memo, - }) - ); + + const params: ToStdSignDocParams | ToSignDocParams = { + accountNumber, + sequence, + fee, + memo, + timeoutHeight, + }; + let txRaw: TxRaw; + if (this.useAmino) { + const { signed, signature } = await this.wc.signAmino( + this.chainId, + this.address, + tx.toStdSignDoc(params) + ); + txRaw = tx.toSignedAmino(signed, signature.signature); + } else { + const { signed, signature } = await this.wc.signDirect( + this.chainId, + this.address, + tx.toSignDoc(params) + ); + txRaw = tx.toSignedDirect(signed, signature.signature); + } + // Since `sendTx` on WC isn't implemented yet, we have to broadcast manually - return broadcastTx(this.rpc, { - tx, - sequence: BigInt(signed.sequence), - fee: new Fee({ - amount: signed.fee.amount as Coin[], - gasLimit: BigInt(signed.fee.gas), - payer: signed.fee.payer, - granter: signed.fee.granter, - }), - signMode: SignMode.LEGACY_AMINO_JSON, - signature: base64.decode(signature), - memo: signed.memo, - }); + return RpcClient.broadcastTx(this.rpc, txRaw); } } diff --git a/src/wallet/wallets/keplr/constants.ts b/src/wallet/wallets/keplr/constants.ts deleted file mode 100644 index 91ff50a3..00000000 --- a/src/wallet/wallets/keplr/constants.ts +++ /dev/null @@ -1,21 +0,0 @@ -export const KeplrWcV1Uri = { - ANDROID: - "intent://wcV1#Intent;package=com.chainapsis.keplr;scheme=keplrwallet;end;", - IOS: "keplrwallet://wcV1", -} as const; -export type KeplrWcV1Uri = (typeof KeplrWcV1Uri)[keyof typeof KeplrWcV1Uri]; - -export const KeplrWcV1Method = { - ENABLE: "keplr_enable_wallet_connect_v1", - GET_KEY: "keplr_get_key_wallet_connect_v1", - SIGN_AMINO: "keplr_sign_amino_wallet_connect_v1", -} as const; -export type KeplrWcV1Method = - (typeof KeplrWcV1Method)[keyof typeof KeplrWcV1Method]; - -export const KeplrWcV2Uri = { - ANDROID: - "intent://wcV2#Intent;package=com.chainapsis.keplr;scheme=keplrwallet;end;", - IOS: "keplrwallet://wcV2", -} as const; -export type KeplrWcV2Uri = (typeof KeplrWcV2Uri)[keyof typeof KeplrWcV2Uri]; diff --git a/src/wallet/wallets/keplr/types.ts b/src/wallet/wallets/keplr/types.ts deleted file mode 100644 index 3f7399e7..00000000 --- a/src/wallet/wallets/keplr/types.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type SignAminoResponse = { - signature: { - signature: string; - }; -}[]; diff --git a/src/wallet/wallets/leap/LeapController.ts b/src/wallet/wallets/leap/LeapController.ts index 5b2b9702..4acbf2ae 100644 --- a/src/wallet/wallets/leap/LeapController.ts +++ b/src/wallet/wallets/leap/LeapController.ts @@ -9,7 +9,6 @@ import { ConnectedWallet } from "../ConnectedWallet"; import { ChainInfo, WalletController } from "../WalletController"; import { LeapExtension } from "./LeapExtension"; import { LeapWalletConnectV2 } from "./LeapWalletConnectV2"; -import { LeapWcUri } from "./constants"; export class LeapController extends WalletController { private readonly wc: WalletConnectV2; @@ -18,8 +17,9 @@ export class LeapController extends WalletController { super(WalletName.LEAP); this.wc = new WalletConnectV2(wcProjectId, { name: "Leap", - android: LeapWcUri.ANDROID, - ios: LeapWcUri.IOS, + android: + "intent://wcV2#Intent;package=io.leapwallet.cosmos;scheme=leapwallet;end;", + ios: "leapcosmos://wcV2", }); this.registerAccountChangeHandlers(); } @@ -41,7 +41,16 @@ export class LeapController extends WalletController { }); wallets.set( chainId, - new LeapWalletConnectV2(this.wc, chainId, key, address, rpc, gasPrice) + new LeapWalletConnectV2( + this.id, + this.wc, + chainId, + key, + address, + rpc, + gasPrice, + true // TODO: use sign mode direct when supported + ) ); } return { wallets, wc: this.wc }; @@ -55,13 +64,22 @@ export class LeapController extends WalletController { } await ext.enable(chains.map(({ chainId }) => chainId)); for (const { chainId, rpc, gasPrice } of Object.values(chains)) { - const { bech32Address, pubKey } = await ext.getKey(chainId); + const { bech32Address, pubKey, isNanoLedger } = await ext.getKey(chainId); const key = new Secp256k1PubKey({ key: pubKey, }); wallets.set( chainId, - new LeapExtension(ext, chainId, key, bech32Address, rpc, gasPrice) + new LeapExtension( + this.id, + ext, + chainId, + key, + bech32Address, + rpc, + gasPrice, + isNanoLedger + ) ); } return wallets; diff --git a/src/wallet/wallets/leap/LeapExtension.ts b/src/wallet/wallets/leap/LeapExtension.ts index 70e71f85..40ca75ec 100644 --- a/src/wallet/wallets/leap/LeapExtension.ts +++ b/src/wallet/wallets/leap/LeapExtension.ts @@ -1,86 +1,5 @@ -import { PlainMessage } from "@bufbuild/protobuf"; -import { Secp256k1PubKey, Tx } from "cosmes/client"; -import { base16 } from "cosmes/codec"; -import { - CosmosBaseV1beta1Coin as Coin, - CosmosTxV1beta1Fee as Fee, -} from "cosmes/protobufs"; -import type { BroadcastMode } from "cosmes/registry"; +import { KeplrExtension } from "../keplr/KeplrExtension"; -import { WalletName } from "../../constants/WalletName"; -import { WalletType } from "../../constants/WalletType"; -import { stdSignDocToSignedProto } from "../../utils/tx"; -import { - ConnectedWallet, - SignArbitraryResponse, - UnsignedTx, -} from "../ConnectedWallet"; -import { Leap } from "./types"; - -export class LeapExtension extends ConnectedWallet { - private readonly ext: Leap; - - constructor( - ext: Leap, - chainId: string, - pubKey: Secp256k1PubKey, - address: string, - rpc: string, - gasPrice: PlainMessage - ) { - super( - WalletName.LEAP, - WalletType.EXTENSION, - chainId, - pubKey, - address, - rpc, - gasPrice - ); - this.ext = ext; - this.ext.defaultOptions = { - sign: { - preferNoSetFee: true, - preferNoSetMemo: true, - }, - }; - } - - public async signArbitrary(data: string): Promise { - const res = await this.ext.signArbitrary(this.chainId, this.address, data); - return { - data, - pubKey: res.pub_key.value, - signature: res.signature, - }; - } - - protected async signAndBroadcastTx( - { msgs, memo }: UnsignedTx, - fee: Fee, - accountNumber: bigint, - sequence: bigint - ): Promise { - const tx = new Tx({ - chainId: this.chainId, - pubKey: this.pubKey, - msgs: msgs, - }); - const { signature, signed } = await this.ext.signAmino( - this.chainId, - this.address, - tx.toStdSignDoc({ - accountNumber, - sequence, - fee, - memo, - }) - ); - const txHash = await this.ext.sendTx( - this.chainId, - stdSignDocToSignedProto(tx, signature.signature, signed).toBinary(), - "sync" as BroadcastMode - ); - return base16.encode(txHash); - } -} +// Leap's API is similar to Keplr. +// See: https://docs.leapwallet.io/cosmos/for-dapps-connect-to-leap/add-leap-to-existing-keplr-integration +export const LeapExtension = KeplrExtension; diff --git a/src/wallet/wallets/leap/LeapWalletConnectV2.ts b/src/wallet/wallets/leap/LeapWalletConnectV2.ts index 8d6c5f55..8e650d0c 100644 --- a/src/wallet/wallets/leap/LeapWalletConnectV2.ts +++ b/src/wallet/wallets/leap/LeapWalletConnectV2.ts @@ -1,82 +1,4 @@ -import { PlainMessage } from "@bufbuild/protobuf"; -import { Secp256k1PubKey, Tx, broadcastTx } from "cosmes/client"; -import { base64 } from "cosmes/codec"; -import { - CosmosBaseV1beta1Coin as Coin, - CosmosTxV1beta1Fee as Fee, - CosmosTxSigningV1beta1SignMode as SignMode, -} from "cosmes/protobufs"; -import { WalletName, WalletType } from "cosmes/wallet"; +import { KeplrWalletConnectV2 } from "../keplr/KeplrWalletConnectV2"; -import { WalletConnectV2 } from "../../walletconnect/WalletConnectV2"; -import { - ConnectedWallet, - SignArbitraryResponse, - UnsignedTx, -} from "../ConnectedWallet"; - -export class LeapWalletConnectV2 extends ConnectedWallet { - private readonly wc: WalletConnectV2; - - constructor( - wc: WalletConnectV2, - chainId: string, - pubKey: Secp256k1PubKey, - address: string, - rpc: string, - gasPrice: PlainMessage - ) { - super( - WalletName.LEAP, - WalletType.WALLETCONNECT, - chainId, - pubKey, - address, - rpc, - gasPrice - ); - this.wc = wc; - } - - public async signArbitrary(_data: string): Promise { - // ! Not implemented by Leap - throw new Error("Method not implemented."); - } - - public async signAndBroadcastTx( - { msgs, memo }: UnsignedTx, - fee: Fee, - accountNumber: bigint, - sequence: bigint - ): Promise { - const tx = new Tx({ - chainId: this.chainId, - pubKey: this.pubKey, - msgs: msgs, - }); - const { signature, signed } = await this.wc.signAmino( - this.chainId, - this.address, - tx.toStdSignDoc({ - accountNumber, - sequence, - fee, - memo, - }) - ); - // Since `sendTx` on WC isn't implemented yet, we have to broadcast manually - return broadcastTx(this.rpc, { - tx, - sequence: BigInt(signed.sequence), - fee: new Fee({ - amount: signed.fee.amount as Coin[], - gasLimit: BigInt(signed.fee.gas), - payer: signed.fee.payer, - granter: signed.fee.granter, - }), - signMode: SignMode.LEGACY_AMINO_JSON, - signature: base64.decode(signature), - memo: signed.memo, - }); - } -} +// Leap's API is similar to Keplr. +export const LeapWalletConnectV2 = KeplrWalletConnectV2; diff --git a/src/wallet/wallets/leap/constants.ts b/src/wallet/wallets/leap/constants.ts deleted file mode 100644 index df014870..00000000 --- a/src/wallet/wallets/leap/constants.ts +++ /dev/null @@ -1,6 +0,0 @@ -export const LeapWcUri = { - ANDROID: - "intent://wcV2#Intent;package=io.leapwallet.cosmos;scheme=leapwallet;end;", - IOS: "leapcosmos://wcV2", -} as const; -export type LeapWcUri = (typeof LeapWcUri)[keyof typeof LeapWcUri]; diff --git a/src/wallet/wallets/mnemonic/MnemonicWallet.ts b/src/wallet/wallets/mnemonic/MnemonicWallet.ts index 88a8d2e9..4997a44c 100644 --- a/src/wallet/wallets/mnemonic/MnemonicWallet.ts +++ b/src/wallet/wallets/mnemonic/MnemonicWallet.ts @@ -1,15 +1,13 @@ -import { Secp256k1PubKey, Tx, broadcastTx } from "cosmes/client"; +import { RpcClient, Secp256k1PubKey, Tx } from "cosmes/client"; import { base64, resolveBech32Address, resolveKeyPair, signAmino, + signDirect, utf8, } from "cosmes/codec"; -import { - CosmosTxV1beta1Fee as Fee, - CosmosTxSigningV1beta1SignMode as SignMode, -} from "cosmes/protobufs"; +import { CosmosTxV1beta1Fee as Fee } from "cosmes/protobufs"; import { StdSignDoc } from "cosmes/registry"; import { Prettify } from "../../../typeutils/prettify"; @@ -77,8 +75,8 @@ export type ConnectMnemonicWalletOptions = Prettify< * ``` */ export class MnemonicWallet extends ConnectedWallet { - private readonly publicKey: string; - private readonly privateKey: Uint8Array; + public readonly publicKey: string; + public readonly privateKey: Uint8Array; constructor({ mnemonic, @@ -141,7 +139,7 @@ export class MnemonicWallet extends ConnectedWallet { } public async signAndBroadcastTx( - { msgs, memo }: UnsignedTx, + { msgs, memo, timeoutHeight }: UnsignedTx, fee: Fee, accountNumber: bigint, sequence: bigint @@ -151,21 +149,14 @@ export class MnemonicWallet extends ConnectedWallet { pubKey: this.pubKey, msgs: msgs, }); - const doc = tx.toStdSignDoc({ + const doc = tx.toSignDoc({ accountNumber, sequence, fee, memo, + timeoutHeight, }); - const signature = signAmino(doc, this.privateKey); - return broadcastTx(this.rpc, { - tx, - sequence, - fee, - // TODO: use SignMode.DIRECT - signMode: SignMode.LEGACY_AMINO_JSON, - signature, - memo, - }); + const signature = signDirect(doc, this.privateKey); + return RpcClient.broadcastTx(this.rpc, tx.toSignedDirect(doc, signature)); } }