diff --git a/.github/workflows/bot-xrp-mere-denis.yml b/.github/workflows/bot-xrp-mere-denis.yml new file mode 100644 index 0000000000..0f0ba64cd9 --- /dev/null +++ b/.github/workflows/bot-xrp-mere-denis.yml @@ -0,0 +1,79 @@ +name: Bot 'XRP on Mère Denis' +on: + push: + branches: + - family/ripple + +jobs: + start-runner: + name: "start ec2 instance (Linux)" + if: ${{ always() }} + uses: ledgerhq/actions/.github/workflows/start-linux-runner.yml@main + secrets: + CI_BOT_TOKEN: ${{ secrets.CI_BOT_TOKEN }} + + stop-runner: + name: "stop ec2 instance (Linux)" + needs: [start-runner, run-bot] + uses: ledgerhq/actions/.github/workflows/stop-linux-runner.yml@main + if: ${{ always() }} + with: + label: ${{ needs.start-runner.outputs.label }} + ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }} + secrets: + CI_BOT_TOKEN: ${{ secrets.CI_BOT_TOKEN }} + + run-bot: + needs: [start-runner] + runs-on: ${{ needs.start-runner.outputs.label }} + steps: + - name: prepare runner + run: | + sudo growpart /dev/nvme0n1 1 + sudo resize2fs /dev/nvme0n1p1 + - uses: actions/checkout@v2 + - name: Retrieving coin apps + uses: actions/checkout@v2 + with: + repository: LedgerHQ/coin-apps + token: ${{ secrets.PAT }} + path: coin-apps + - uses: actions/setup-node@master + with: + node-version: 14.x + - name: install yarn + run: npm i -g yarn + - name: pull docker image + run: docker pull ghcr.io/ledgerhq/speculos + - name: kill apt-get + run: sudo killall -w apt-get apt || echo OK + - name: Install linux deps + run: sudo apt-get install -y libusb-1.0-0-dev jq + - name: Install dependencies + run: | + yarn global add yalc + yarn --frozen-lockfile + yarn ci-setup-cli + - name: BOT + env: + SEED: ${{ secrets.SEED1 }} + VERBOSE_FILE: bot-tests.txt + GITHUB_SHA: ${GITHUB_SHA} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_RUN_ID: ${{ github.run_id }} + GITHUB_WORKFLOW: ${{ github.workflow }} + SLACK_API_TOKEN: ${{ secrets.SLACK_API_TOKEN }} + SLACK_CHANNEL: ci-xrp-ll + BOT_FILTER_FAMILY: ripple + EXPERIMENTAL_CURRENCIES_JS_BRIDGE: ripple + run: COINAPPS=$PWD/coin-apps yarn ci-test-bot + timeout-minutes: 120 + - name: Run coverage + if: failure() || success() + run: CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} npx codecov + - name: upload logs + if: failure() || success() + uses: actions/upload-artifact@v1 + with: + name: bot-tests.txt + path: bot-tests.txt \ No newline at end of file diff --git a/cli/package.json b/cli/package.json index 46203453e3..58392c178a 100644 --- a/cli/package.json +++ b/cli/package.json @@ -24,17 +24,17 @@ "@ledgerhq/hw-transport-node-ble": "5.7.0" }, "optionalDependencies": { - "@ledgerhq/hw-transport-node-ble": "^6.24.1" + "@ledgerhq/hw-transport-node-ble": "^6.27.1" }, "dependencies": { - "@ledgerhq/cryptoassets": "6.24.1", + "@ledgerhq/cryptoassets": "6.28.2", "@ledgerhq/errors": "6.10.0", - "@ledgerhq/hw-app-btc": "6.24.1", - "@ledgerhq/hw-transport-http": "6.24.1", - "@ledgerhq/hw-transport-mocker": "6.24.1", - "@ledgerhq/hw-transport-node-hid": "6.24.1", - "@ledgerhq/hw-transport-node-speculos": "6.24.1", - "@ledgerhq/live-common": "22.0.0", + "@ledgerhq/hw-app-btc": "6.27.1", + "@ledgerhq/hw-transport-http": "6.27.1", + "@ledgerhq/hw-transport-mocker": "6.27.1", + "@ledgerhq/hw-transport-node-hid": "6.27.1", + "@ledgerhq/hw-transport-node-speculos": "6.27.1", + "@ledgerhq/live-common": "22.0.3", "@ledgerhq/logs": "6.10.0", "@walletconnect/client": "^1.7.1", "asciichart": "^1.5.25", diff --git a/cli/yarn.lock b/cli/yarn.lock index 438f614dda..60cff0eaec 100644 --- a/cli/yarn.lock +++ b/cli/yarn.lock @@ -820,31 +820,24 @@ dependencies: commander "^2.20.0" -"@ledgerhq/cryptoassets@6.24.1": - version "6.24.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/cryptoassets/-/cryptoassets-6.24.1.tgz#edac116eaa2d5da5e7c0cda3bc039aa6aedfd7d5" - integrity sha512-RCl2T5Qeu4fch5O+6pgT9s9AWs0ATWdBDwN2MSUuLxj7BfwdXig5+hcSObM3OIJPryNeDCtIYNK3z0blgxfTiA== +"@ledgerhq/cryptoassets@6.28.1": + version "6.28.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/cryptoassets/-/cryptoassets-6.28.1.tgz#a053cea8354a070b6303e5c7430152fb8ff76d36" + integrity sha512-FMbgurSw2YUIL7Ypdf/t6VSlt0gNYS9W3LTB3CQeneo7ZLtryJaPo093tu+afbDPXpZcR4W5D5sTRMBJHr9jKA== dependencies: invariant "2" -"@ledgerhq/cryptoassets@6.28.0": - version "6.28.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/cryptoassets/-/cryptoassets-6.28.0.tgz#218a41c5184a176ceb3ec16dc21b37589f673c08" - integrity sha512-j3fBnjsOi2qijWO7p/PNoiEHdzjxP849pO02Q4YWW4Ms4lByv7ysmNLMwrset91We2yyVrdHsjdWY8X5JE97qQ== +"@ledgerhq/cryptoassets@6.28.2", "@ledgerhq/cryptoassets@^6.28.1": + version "6.28.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/cryptoassets/-/cryptoassets-6.28.2.tgz#fabc77c46830348d121452976cdcc19908e0acb2" + integrity sha512-i+33VVNE+54HrC0mHly6JXWO6Th+/7n7vNpxjhUQq+1IL3K/ex1HUCwB61O/siDInjq7OZ1Roq9CEx7tAsED2Q== dependencies: invariant "2" -"@ledgerhq/cryptoassets@^6.27.0": - version "6.27.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/cryptoassets/-/cryptoassets-6.27.0.tgz#1a4efdef07858e8cb1b2dd4c1b9e110f1ed60f3f" - integrity sha512-fM1tm+xJSkbgEB73RtWeTeogcWRkpAcgZX+hBGbvq7anhbRwF2jD4EL897SRNwDuvCKFfpSMxpSUaSvEmj9Lcw== - dependencies: - invariant "2" - -"@ledgerhq/devices@6.24.1", "@ledgerhq/devices@^6.24.1": - version "6.24.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-6.24.1.tgz#9696d7831aa1a1a8204cdfa55df13f892b7da162" - integrity sha512-6SNXWXxojUF6WKXMVIbRs15Mveg+9k0RKJK/PKlwZh929Lnr/NcbONWdwPjWKZAp1g82eEPT4jIkG6qc4QXlcA== +"@ledgerhq/devices@6.27.1", "@ledgerhq/devices@^6.27.1": + version "6.27.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-6.27.1.tgz#3b13ab1d1ba8201e9e74a08f390560483978c962" + integrity sha512-jX++oy89jtv7Dp2X6gwt3MMkoajel80JFWcdc0HCouwDsV1mVJ3SQdwl/bQU0zd8HI6KebvUP95QTwbQLLK/RQ== dependencies: "@ledgerhq/errors" "^6.10.0" "@ledgerhq/logs" "^6.10.0" @@ -871,24 +864,24 @@ resolved "https://registry.yarnpkg.com/@ledgerhq/errors/-/errors-5.50.0.tgz#e3a6834cb8c19346efca214c1af84ed28e69dad9" integrity sha512-gu6aJ/BHuRlpU7kgVpy2vcYk6atjB4iauP2ymF7Gk0ez0Y/6VSMVSJvubeEQN+IV60+OBK0JgeIZG7OiHaw8ow== -"@ledgerhq/hw-app-algorand@6.24.1": - version "6.24.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-algorand/-/hw-app-algorand-6.24.1.tgz#f2eb5a39bfc188a1ef02186b1c41dca18e2a2755" - integrity sha512-1HpUJM67kmDRuPpHg1BeoX5pFWaowpm6BrAqbTsXT0n5vyxGWN/7YVL2Gn7lhFxkssICptnjNcOHN5Eb1XEEBA== +"@ledgerhq/hw-app-algorand@6.27.1": + version "6.27.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-algorand/-/hw-app-algorand-6.27.1.tgz#e8c0b0b7864f1372d24f487bcd8a17af496a248d" + integrity sha512-bYXn1wBm0muDrCGOG+9ofrDQZ7MUkvZY+pcPGPthg/CwuGR9m9rwid934yEy+IwW5BUzvGvs6aorgL2reyKyDg== dependencies: "@ledgerhq/errors" "^6.10.0" - "@ledgerhq/hw-transport" "^6.24.1" + "@ledgerhq/hw-transport" "^6.27.1" bip32-path "^0.4.2" hi-base32 "^0.5.1" js-sha512 "^0.8.0" tweetnacl "^1.0.3" -"@ledgerhq/hw-app-btc@6.24.1": - version "6.24.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-btc/-/hw-app-btc-6.24.1.tgz#50591ec34c9c2c73fe6a03975cde64b6c4d24af7" - integrity sha512-01LlJemkOBoHA0LxZb/NNlw7EIAja27kbUZ5zIC7KgtTuxXgteVxoZWUb4RaX2AuczR2Y/FBvz1HBEwa67hUvA== +"@ledgerhq/hw-app-btc@6.27.1": + version "6.27.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-btc/-/hw-app-btc-6.27.1.tgz#5f7258f8a61532e14d6720678a80133320fc5666" + integrity sha512-2XOH5jtso4QsPYjXldwdcXw6amb8kCyiHtXw1NySA1QP/xBjxN8JLEXEPFsaK6l2zz55I8kKUtVoEGz7bpg0lg== dependencies: - "@ledgerhq/hw-transport" "^6.24.1" + "@ledgerhq/hw-transport" "^6.27.1" "@ledgerhq/logs" "^6.10.0" bip32-path "^0.4.2" bitcoinjs-lib "^5.2.0" @@ -900,25 +893,25 @@ tiny-secp256k1 "1.1.6" varuint-bitcoin "1.1.2" -"@ledgerhq/hw-app-cosmos@6.24.1": - version "6.24.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-cosmos/-/hw-app-cosmos-6.24.1.tgz#00b31c446e2902f5cca68a62e812164864e0ffe7" - integrity sha512-rIqPuHVL0AAeW3cmXZdcEALf91cGLLCxUnz5DE55TDhE3BMj/ej2H+RaYq+2ahlLERXlZCJ4cJhRjoSfKbbRQw== +"@ledgerhq/hw-app-cosmos@6.27.1": + version "6.27.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-cosmos/-/hw-app-cosmos-6.27.1.tgz#834df28568dfd59304103c7d4222a16c554a1d10" + integrity sha512-UJDQmsv5Fb3Owyem/d5mLJLAVIr3yKJjuYArZ3ui6n7zsx+MGtJgUIXUhpEVIk+FrDKnZGa0sqcbvoXW09NIXQ== dependencies: "@ledgerhq/errors" "^6.10.0" - "@ledgerhq/hw-transport" "^6.24.1" + "@ledgerhq/hw-transport" "^6.27.1" bip32-path "^0.4.2" -"@ledgerhq/hw-app-eth@6.27.0": - version "6.27.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-eth/-/hw-app-eth-6.27.0.tgz#944f901a95ed3d82759e3fb011859b1b357620a9" - integrity sha512-7uyXu7dCsFmgGWSaXqasxb9Cegrw54HtCeMcZIkq1yqR9ik0ipQIPG1/qW+TqWfS6VYNkorUSsnKc67Cc+0MwA== +"@ledgerhq/hw-app-eth@6.28.1": + version "6.28.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-eth/-/hw-app-eth-6.28.1.tgz#5c5220a9b9354418ef446064a89303745e926918" + integrity sha512-GEB9TPCaJsObotRe5ADKrSxdFftwT97tJ4fZGXw1eoi1TZQyyki+v95cb//EsWyw3CxqqJVpYvGmL/AHEMdDrw== dependencies: "@ethersproject/abi" "^5.5.0" "@ethersproject/rlp" "^5.5.0" - "@ledgerhq/cryptoassets" "^6.27.0" + "@ledgerhq/cryptoassets" "^6.28.1" "@ledgerhq/errors" "^6.10.0" - "@ledgerhq/hw-transport" "^6.24.1" + "@ledgerhq/hw-transport" "^6.27.1" "@ledgerhq/logs" "^6.10.0" axios "^0.26.1" bignumber.js "^9.0.2" @@ -931,134 +924,134 @@ "@ledgerhq/errors" "^5.11.0" "@ledgerhq/hw-transport" "^5.11.0" -"@ledgerhq/hw-app-polkadot@6.24.1": - version "6.24.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-polkadot/-/hw-app-polkadot-6.24.1.tgz#43d2c8149d42186ec1466caebd143d3ed102f57a" - integrity sha512-u5ZTLud2w3BP10t7rYpW/W7Ar3jDzeKrpwKsaWPk9vbuvc38puuj899iAoqRBjcM5T12y2KuoVcQ17n3cxe3Sg== +"@ledgerhq/hw-app-polkadot@6.27.1": + version "6.27.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-polkadot/-/hw-app-polkadot-6.27.1.tgz#bf253a6c58a44c97c406087dfce70438c3d213e1" + integrity sha512-LkRIDITOv3FNfGB4xldaGz62wgZHLlWA6zd/neE3FxqsCogZia28ieRYdSuin7J4LtDU+GahuyJ9tBXAxuUWKw== dependencies: "@ledgerhq/errors" "^6.10.0" - "@ledgerhq/hw-transport" "^6.24.1" + "@ledgerhq/hw-transport" "^6.27.1" bip32-path "^0.4.2" -"@ledgerhq/hw-app-solana@^6.27.0": - version "6.27.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-solana/-/hw-app-solana-6.27.0.tgz#6d6b52d04919d2725b402f4d3f5ffe2dfe7b3aef" - integrity sha512-DFaoJU/2y4RIivLeqlG1L0LhtcDulFcFKuwrw6M2+b6BO5y3bxjRoLMDjBrmAHaZmkUDRZYxqnTLvOeYRLIU2A== +"@ledgerhq/hw-app-solana@^6.27.1": + version "6.27.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-solana/-/hw-app-solana-6.27.1.tgz#9df40918f4175b597bf7f144732615da076f6375" + integrity sha512-mibdrbqW8cnu+cWBpdsfbVM0GOn5sundzlVyQ9Aydddkr45NtnjHsz7Yf+/S3idLxXRE64Kat1Jkb0XYnXPHwA== dependencies: "@ledgerhq/errors" "^6.10.0" - "@ledgerhq/hw-transport" "^6.24.1" + "@ledgerhq/hw-transport" "^6.27.1" "@ledgerhq/logs" "^6.10.0" bip32-path "^0.4.2" -"@ledgerhq/hw-app-str@6.24.1": - version "6.24.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-str/-/hw-app-str-6.24.1.tgz#aaecc30132831886b6a0eb30fe1e05143ecfaf2a" - integrity sha512-Xe/7b2xIerY5fQ/soE9mp+drbcWxF486xpmjZaX4w55NWwf7BR7mQ/HqcXvHqIiIvX1DrQhU31Iip926b/8k3g== +"@ledgerhq/hw-app-str@6.27.1": + version "6.27.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-str/-/hw-app-str-6.27.1.tgz#274aef6627b323e2f0bd630c69cd57bddd11c908" + integrity sha512-cAtl6UKdD/KThcEnsCDn99XZtNxMNcMc6Wcbk7L7h/lmF8zgl6b8fjaA9yPvEZZgOfu6CQ8NTjf4Mp6BHMx4lQ== dependencies: - "@ledgerhq/hw-transport" "^6.24.1" + "@ledgerhq/hw-transport" "^6.27.1" base32.js "^0.1.0" sha.js "^2.3.6" tweetnacl "^1.0.3" -"@ledgerhq/hw-app-tezos@6.24.1": - version "6.24.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-tezos/-/hw-app-tezos-6.24.1.tgz#891abd61d075f5b86d47fdb3e88adf6bfc4e7ac8" - integrity sha512-avGyuiWIIPm3bUY1C3xAMD90qQu7jlw7zv62hYtFnhgdo6uL/7yn1OmbU/uQsbA8QTrBYV6LyaXmhZMo7X7bHQ== +"@ledgerhq/hw-app-tezos@6.27.1": + version "6.27.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-tezos/-/hw-app-tezos-6.27.1.tgz#9150433b6aa5abb9bca4490bfd323a8b1217b730" + integrity sha512-rSR2fF3jrezbbCLprOxyfQwJ2A14d5VI4KpOsTsNY3RRrDUwtXwPXIlQ0lqQM6suNbJ9L9Z/QRGrubWZcPt4Yg== dependencies: - "@ledgerhq/hw-transport" "^6.24.1" + "@ledgerhq/hw-transport" "^6.27.1" blake2b "^2.1.4" bs58check "^2.1.2" invariant "^2.2.4" -"@ledgerhq/hw-app-trx@6.24.1": - version "6.24.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-trx/-/hw-app-trx-6.24.1.tgz#3b39a538e8bdd8ee193f0469d85384b344411101" - integrity sha512-5afQ05qYfNwFmYwluEwOP4qFMsuk/RJmFQ6UuQj1bweu1SKbHNHbPYXaKVk0Ba6YH6P7dwjuBLq5BZeqlgMxUg== +"@ledgerhq/hw-app-trx@6.27.1": + version "6.27.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-trx/-/hw-app-trx-6.27.1.tgz#ad804ff9e17b0867fc618ec8e32fe79f80afc06b" + integrity sha512-n4J5EO2a09bJVPEUWM1mzl+zbl9wZyEuX/yto/u8i64CFYT+nqF2Hf/XjkCMxIZ0Fvhh8/vh8jc/vyyYHR6dMg== dependencies: "@ledgerhq/errors" "^6.10.0" - "@ledgerhq/hw-transport" "^6.24.1" + "@ledgerhq/hw-transport" "^6.27.1" -"@ledgerhq/hw-app-xrp@6.24.1": - version "6.24.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-xrp/-/hw-app-xrp-6.24.1.tgz#875a31d46cb14c306ee630a3a54384e904f8be85" - integrity sha512-+WCzG7oUdUhO8EK1VOoW5oqMIvgsAS/o8mtZUvYroFaHF2wLiGrFAS/3qnj6f2r6WXGktgsz57HqkxmeysLN8w== +"@ledgerhq/hw-app-xrp@6.27.1": + version "6.27.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-xrp/-/hw-app-xrp-6.27.1.tgz#b89d6906f448438ad9c2df97c7bc69a7c90c7f41" + integrity sha512-A3pe31Uu7VXfXPy2nha9uhB1d6RJFPeuqAF1I8YCXXz8JRxExhFcWTUEAbZ5tXAE1L/KJeleFSuCO62U7obHqQ== dependencies: - "@ledgerhq/hw-transport" "^6.24.1" + "@ledgerhq/hw-transport" "^6.27.1" bip32-path "0.4.2" -"@ledgerhq/hw-transport-http@6.24.1": - version "6.24.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-http/-/hw-transport-http-6.24.1.tgz#f1e3d10d532396b05e230fc0b860443e75f9ac72" - integrity sha512-LGKL8Su1VBDiZehoNMCqvFPJGpgKaEv2QHRXUlPK8/vUsC+7ooY+M36esvCQo3PfnFISUIndZBaY/x96ksOp0A== +"@ledgerhq/hw-transport-http@6.27.1": + version "6.27.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-http/-/hw-transport-http-6.27.1.tgz#25c6cf02c4b464fae416d163f9ab4fda7b6198ff" + integrity sha512-494Zk5jvHcasa5xjZW7l5g+QqJqLlZpuV/RvlIWnKHdVdrBWYvG/1VukQfJQPgbK3WHtt/9WhrnJoLI+xv2PrA== dependencies: "@ledgerhq/errors" "^6.10.0" - "@ledgerhq/hw-transport" "^6.24.1" + "@ledgerhq/hw-transport" "^6.27.1" "@ledgerhq/logs" "^6.10.0" - axios "^0.24.0" - ws "7" + axios "^0.26.1" + ws "8.5.0" -"@ledgerhq/hw-transport-mocker@6.24.1": - version "6.24.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-mocker/-/hw-transport-mocker-6.24.1.tgz#68091a98bea9f6a790253fb2256bf9407e2f4de8" - integrity sha512-4bv1nkdv1ZOXnudwIMub9A+2nRX7mwUgb1Na+E8GiaqssLUpqOEZdekM/VURszku75BKp0so+5k7yfIZdECUNQ== +"@ledgerhq/hw-transport-mocker@6.27.1": + version "6.27.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-mocker/-/hw-transport-mocker-6.27.1.tgz#2ace1f2decba6c3d3d98c47795d0fa136b5a3f73" + integrity sha512-rCpI8RUBMSO/JFGAZ2JTkBaL0sXN1qBREvSmZLprRxNaZU0Sd2cHZhxL9rzAEHBRLrDx83Z1Lov8SDDZqSVFVQ== dependencies: - "@ledgerhq/hw-transport" "^6.24.1" + "@ledgerhq/hw-transport" "^6.27.1" "@ledgerhq/logs" "^6.10.0" -"@ledgerhq/hw-transport-node-ble@^6.24.1": - version "6.24.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-node-ble/-/hw-transport-node-ble-6.24.1.tgz#528f2aa2529871cac8c3378514c5f4ab05f2dd7e" - integrity sha512-orBfRFxZ/p7W4p6sndvM7HMm91zFy1L1dAo5bf5T0ooV8VSuDzSxQVzz3hDc3gosjDSq+jrk3PBEtJMDmeTynA== +"@ledgerhq/hw-transport-node-ble@^6.27.1": + version "6.27.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-node-ble/-/hw-transport-node-ble-6.27.1.tgz#e381f3e36ed6fc45b0317fc0c120f8355553349a" + integrity sha512-Qy36HcZjau1GuimZrpiABS/CuXhMoD5X/8kaoMzDz1VjgrSGiIlB8IyA6r/q0lI1YlBA9gXKoZ6AO/F6D3bIKw== dependencies: "@abandonware/noble" "1.9.2-15" - "@ledgerhq/devices" "^6.24.1" + "@ledgerhq/devices" "^6.27.1" "@ledgerhq/errors" "^6.10.0" - "@ledgerhq/hw-transport" "^6.24.1" + "@ledgerhq/hw-transport" "^6.27.1" "@ledgerhq/logs" "^6.10.0" invariant "^2.2.4" rxjs "6" -"@ledgerhq/hw-transport-node-hid-noevents@^6.24.1": - version "6.24.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-node-hid-noevents/-/hw-transport-node-hid-noevents-6.24.1.tgz#22ca8e650fd262de9c9a6fe1f917fce4ccbfa6ef" - integrity sha512-z3uXCU13oayRX51MOaTREdrn83ujrBkccdXn3ljdMy4H3pmAvG6QGn4m30gursEUUJkogA6dkcXs3G8IRfOdxA== +"@ledgerhq/hw-transport-node-hid-noevents@^6.27.1": + version "6.27.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-node-hid-noevents/-/hw-transport-node-hid-noevents-6.27.1.tgz#f5bb720402978ed7ecf679d3cd8d07d466e0bca7" + integrity sha512-nsPo491bslP7QySXIB2asILxws7+t2V/0F4Hjc3IBEkHexH3iS+TmeegE5A72vDXhXKI4wskJ8Pp8Odcz9TN1A== dependencies: - "@ledgerhq/devices" "^6.24.1" + "@ledgerhq/devices" "^6.27.1" "@ledgerhq/errors" "^6.10.0" - "@ledgerhq/hw-transport" "^6.24.1" + "@ledgerhq/hw-transport" "^6.27.1" "@ledgerhq/logs" "^6.10.0" node-hid "2.1.1" -"@ledgerhq/hw-transport-node-hid@6.24.1": - version "6.24.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-node-hid/-/hw-transport-node-hid-6.24.1.tgz#5374a831575c9152c89abc736eb4523ff7b945f9" - integrity sha512-onbxunq8FsiY2sVRR+jRCjC1nx376ANuAtnQsmoHsgxONOVTb5asXWWOV4Cjm8y7RZTCtDw3d1fbziEGRhwiqA== +"@ledgerhq/hw-transport-node-hid@6.27.1": + version "6.27.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-node-hid/-/hw-transport-node-hid-6.27.1.tgz#550b56b741fbdeb07ceb66082cf9500844f3d0a1" + integrity sha512-H3kGFU6lDAZM7ef17nVGTCpgwPzDcbO8dwqvGoIDTopvlNgNqmzw95GT3aCosJMp04C9yYGyMPSF5UFjRX8ckg== dependencies: - "@ledgerhq/devices" "^6.24.1" + "@ledgerhq/devices" "^6.27.1" "@ledgerhq/errors" "^6.10.0" - "@ledgerhq/hw-transport" "^6.24.1" - "@ledgerhq/hw-transport-node-hid-noevents" "^6.24.1" + "@ledgerhq/hw-transport" "^6.27.1" + "@ledgerhq/hw-transport-node-hid-noevents" "^6.27.1" "@ledgerhq/logs" "^6.10.0" lodash "^4.17.21" node-hid "2.1.1" usb "^1.7.0" -"@ledgerhq/hw-transport-node-speculos@6.24.1": - version "6.24.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-node-speculos/-/hw-transport-node-speculos-6.24.1.tgz#735617a70ec162fb7bb9401ebdcd95e74e7c0cfe" - integrity sha512-xkOqK7m1HOALqnwxMTxrBU8N54/PnQJpGx9Xg9RRUpLVEU7m84LAI9uXemx4AKfs6CEL8D5EP51WIRlQlnhdCQ== +"@ledgerhq/hw-transport-node-speculos@6.27.1": + version "6.27.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-node-speculos/-/hw-transport-node-speculos-6.27.1.tgz#46539775a3a871aed1ee9dc4314afb8c6fbb7889" + integrity sha512-HOf1Oy6DBaoFdr0HkRAgyICILfL1rNUoy3v17ui+W5ftIKoRivxw8OhvFSWN8SnflqKlVfRU5hQmH26fpmVh0w== dependencies: "@ledgerhq/errors" "^6.10.0" - "@ledgerhq/hw-transport" "^6.24.1" + "@ledgerhq/hw-transport" "^6.27.1" "@ledgerhq/logs" "^6.10.0" rxjs "6" -"@ledgerhq/hw-transport@6.24.1", "@ledgerhq/hw-transport@^6.24.1": - version "6.24.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-6.24.1.tgz#5e787268e6d5ce4f9f0d53b0d520c1f071c2d1ae" - integrity sha512-cOhxkQJrN7DvPFLLXAS2nqAZ7NIDaFqnbgu9ugTccgbJm2/z7ClRZX/uQoI4FscswZ47MuJQdXqz4nK48phteQ== +"@ledgerhq/hw-transport@6.27.1", "@ledgerhq/hw-transport@^6.27.1": + version "6.27.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-6.27.1.tgz#88072278f69c279cb6569352acd4ae2fec33ace3" + integrity sha512-hnE4/Fq1YzQI4PA1W0H8tCkI99R3UWDb3pJeZd6/Xs4Qw/q1uiQO+vNLC6KIPPhK0IajUfuI/P2jk0qWcMsuAQ== dependencies: - "@ledgerhq/devices" "^6.24.1" + "@ledgerhq/devices" "^6.27.1" "@ledgerhq/errors" "^6.10.0" events "^3.3.0" @@ -1087,18 +1080,18 @@ dependencies: bignumber.js "^9.0.1" -"@ledgerhq/live-app-sdk@^0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/live-app-sdk/-/live-app-sdk-0.2.0.tgz#d50ca7ddd07eeeb564728a1998bf0fb154533315" - integrity sha512-OwyEu/Ue/D/mw/Fgc4HrXm4jlzD43r7nfLXC913U+YprPapUcT9e6cc28xIEYXnJqY0GVV/ISdP7ODGfJC21Xg== +"@ledgerhq/live-app-sdk@^0.6.1": + version "0.6.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/live-app-sdk/-/live-app-sdk-0.6.1.tgz#e5841668cb0c7092ec0f0cc8d3fa662b153754ae" + integrity sha512-pGSNsTIg/K3P5xrj9n50Lmb6/sILh/7XrZjMsJA5HDTOYfbhWuYNOXtmDgaSjEO5vkI2YrU2I49VoE2XbwpEwg== dependencies: - bignumber.js "^9.0.1" - json-rpc-2.0 "^0.2.16" + bignumber.js "^9.0.2" + json-rpc-2.0 "^1.0.0" -"@ledgerhq/live-common@22.0.0": - version "22.0.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/live-common/-/live-common-22.0.0.tgz#2717701fc8ba63b4befdd3cb1400527c2922335f" - integrity sha512-BUMgPMWmavlFip0LwMVzr+TABG1o77nLZepGSmxZWIcyLUvsmRRDtCEasVJCW60g0Cd0BhvbtUOo8l0NdDZ+/A== +"@ledgerhq/live-common@22.0.3": + version "22.0.3" + resolved "https://registry.yarnpkg.com/@ledgerhq/live-common/-/live-common-22.0.3.tgz#d25ed7de09212fb4be4c139f037070ace78de81b" + integrity sha512-ypP6nLopyD/uDh8JqvPTdUkCzsfq/cFDxW8RklULrYch0dm9Fnw2L7qRKrlg63GBbUFOl3w6i7nIctz+n4QStA== dependencies: "@celo/contractkit" "^1.5.2" "@celo/wallet-base" "^1.5.2" @@ -1111,24 +1104,24 @@ "@ethereumjs/common" "^2.6.2" "@ethereumjs/tx" "^3.5.0" "@ledgerhq/compressjs" "1.3.2" - "@ledgerhq/cryptoassets" "6.28.0" - "@ledgerhq/devices" "6.24.1" + "@ledgerhq/cryptoassets" "6.28.1" + "@ledgerhq/devices" "6.27.1" "@ledgerhq/errors" "6.10.0" - "@ledgerhq/hw-app-algorand" "6.24.1" - "@ledgerhq/hw-app-btc" "6.24.1" - "@ledgerhq/hw-app-cosmos" "6.24.1" - "@ledgerhq/hw-app-eth" "6.27.0" - "@ledgerhq/hw-app-polkadot" "6.24.1" - "@ledgerhq/hw-app-solana" "^6.27.0" - "@ledgerhq/hw-app-str" "6.24.1" - "@ledgerhq/hw-app-tezos" "6.24.1" - "@ledgerhq/hw-app-trx" "6.24.1" - "@ledgerhq/hw-app-xrp" "6.24.1" - "@ledgerhq/hw-transport" "6.24.1" - "@ledgerhq/hw-transport-mocker" "6.24.1" - "@ledgerhq/hw-transport-node-speculos" "6.24.1" + "@ledgerhq/hw-app-algorand" "6.27.1" + "@ledgerhq/hw-app-btc" "6.27.1" + "@ledgerhq/hw-app-cosmos" "6.27.1" + "@ledgerhq/hw-app-eth" "6.28.1" + "@ledgerhq/hw-app-polkadot" "6.27.1" + "@ledgerhq/hw-app-solana" "^6.27.1" + "@ledgerhq/hw-app-str" "6.27.1" + "@ledgerhq/hw-app-tezos" "6.27.1" + "@ledgerhq/hw-app-trx" "6.27.1" + "@ledgerhq/hw-app-xrp" "6.27.1" + "@ledgerhq/hw-transport" "6.27.1" + "@ledgerhq/hw-transport-mocker" "6.27.1" + "@ledgerhq/hw-transport-node-speculos" "6.27.1" "@ledgerhq/json-bignumber" "^1.1.0" - "@ledgerhq/live-app-sdk" "^0.2.0" + "@ledgerhq/live-app-sdk" "^0.6.1" "@ledgerhq/logs" "6.10.0" "@polkadot/types" "7.8.1" "@polkadot/types-known" "7.8.1" @@ -2388,13 +2381,6 @@ axios@^0.21.1, axios@^0.21.2: dependencies: follow-redirects "^1.14.0" -axios@^0.24.0: - version "0.24.0" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.24.0.tgz#804e6fa1e4b9c5288501dd9dff56a7a0940d20d6" - integrity sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA== - dependencies: - follow-redirects "^1.14.4" - b4a@^1.0.1: version "1.3.1" resolved "https://registry.yarnpkg.com/b4a/-/b4a-1.3.1.tgz#5ead1402bd4a2dcfea35cc83928815d53315ff32" @@ -3943,7 +3929,7 @@ fn.name@1.x.x: resolved "https://registry.yarnpkg.com/fn.name/-/fn.name-1.1.0.tgz#26cad8017967aea8731bc42961d04a3d5988accc" integrity sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw== -follow-redirects@^1.10.0, follow-redirects@^1.14.0, follow-redirects@^1.14.4, follow-redirects@^1.14.7, follow-redirects@^1.14.8: +follow-redirects@^1.10.0, follow-redirects@^1.14.0, follow-redirects@^1.14.7, follow-redirects@^1.14.8: version "1.14.9" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.9.tgz#dd4ea157de7bfaf9ea9b3fbd85aa16951f78d8d7" integrity sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w== @@ -4755,11 +4741,16 @@ json-buffer@3.0.0: resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg= -json-rpc-2.0@^0.2.16, json-rpc-2.0@^0.2.19: +json-rpc-2.0@^0.2.19: version "0.2.19" resolved "https://registry.yarnpkg.com/json-rpc-2.0/-/json-rpc-2.0-0.2.19.tgz#082957f0d22d22f03473dbf5ffeeb20dcdeb1faa" integrity sha512-tegZKneDQjWintJS5Zlw8xNvJK0/xq4sct2M5AgfFmcCJFMjvrLgk1noH7OPfFgEQ+ScueuWdaGfikCPr+qBtg== +json-rpc-2.0@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/json-rpc-2.0/-/json-rpc-2.0-1.1.0.tgz#891eb5fd89de6a909444a2d81ae804655b757c29" + integrity sha512-A4v62rLgwC2U+G3hA1PKRgAXKS55ItTtjUJVbIq68yccD+AUJZSdjayxd0PLQD8i3ustyLvvaYKW6+DglScrjA== + json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" @@ -7408,16 +7399,16 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= -ws@7, ws@^7, ws@^7.2.0, ws@^7.4.5: - version "7.5.6" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.6.tgz#e59fc509fb15ddfb65487ee9765c5a51dec5fe7b" - integrity sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA== - ws@7.5.3: version "7.5.3" resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.3.tgz#160835b63c7d97bfab418fc1b8a9fced2ac01a74" integrity sha512-kQ/dHIzuLrS6Je9+uv81ueZomEwH0qVYstcAQ4/Z93K8zeko9gtAbttJWzoC5ukqXY1PpoouV3+VSOqEAFt5wg== +ws@8.5.0: + version "8.5.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.5.0.tgz#bfb4be96600757fe5382de12c670dab984a1ed4f" + integrity sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg== + ws@^3.0.0: version "3.3.3" resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2" @@ -7427,6 +7418,11 @@ ws@^3.0.0: safe-buffer "~5.1.0" ultron "~1.1.0" +ws@^7, ws@^7.2.0, ws@^7.4.5: + version "7.5.6" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.6.tgz#e59fc509fb15ddfb65487ee9765c5a51dec5fe7b" + integrity sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA== + xhr-request-promise@^0.1.2: version "0.1.3" resolved "https://registry.yarnpkg.com/xhr-request-promise/-/xhr-request-promise-0.1.3.tgz#2d5f4b16d8c6c893be97f1a62b0ed4cf3ca5f96c" diff --git a/dependencies.md b/dependencies.md index f225122b87..70854f815c 100644 --- a/dependencies.md +++ b/dependencies.md @@ -14,8 +14,8 @@ yarn upgrade-interactive -i --latest |@celo/contractkit | Celo coin integration | monthly | |@celo/wallet-base | Celo coin integration | monthly | |@celo/wallet-ledger | Celo coin integration | monthly | +|@cosmjs/amino | Cosmos coin integration | monthly | |@cosmjs/crypto | Cosmos coin integration | monthly | -|@cosmjs/ledger-amino | Cosmos coin integration | monthly | |@cosmjs/proto-signing | Cosmos coin integration | monthly | |@cosmjs/stargate | Cosmos coin integration | monthly | |@crypto-com/chain-jslib | Crypto.com coin integration | monthly | @@ -37,12 +37,12 @@ yarn upgrade-interactive -i --latest |@ledgerhq/hw-app-xrp | XRP coin integration | weekly | |@ledgerhq/hw-transport | device communication | weekly | |@ledgerhq/hw-transport-mocker| used by tests | weekly | -|@ledgerhq/hw-transport-node-speculos| used by bot tests | weekly | +|@ledgerhq/hw-transport-node-speculos| used by bot tests | weekly | |@ledgerhq/json-bignumber| workaround for Ledger explorers who don't give String in some API | stable | |@ledgerhq/live-app-sdk | utils for live apps feature | ??? | |@ledgerhq/logs | logs | weekly | -|@polkadot/types | Polkadot coin integration | **BLOCKED BY LLM (ticket missing)** | -|@polkadot/types-known | Polkadot coin integration | **BLOCKED BY LLM (ticket missing)** | +|@polkadot/types | Polkadot coin integration | monthly | +|@polkadot/types-known | Polkadot coin integration | monthly | |@solana/spl-token | Solana coin integration | monthly | |@solana/web3.js | Solana coin integration | monthly | |@taquito/ledger-signer | Tezos coin integration | **BLOCKED BY LLM (ticket missing)** | @@ -105,3 +105,4 @@ yarn upgrade-interactive -i --latest |winston | logs | monthly | |xstate | generic helper for React | **TBD why it's needed.** | |zcash-bitcore-lib | Bitcoin coin integration | monthly | +|varuint-bitcoin | Bitcoin coin integration | monthly | \ No newline at end of file diff --git a/jest.config.ts b/jest.config.ts index 7a3493b912..183e79427e 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -25,43 +25,38 @@ export default { "test-helpers/", ], moduleNameMapper: { - "^@polkadot/metadata/(.*)/(.*)": "@polkadot/metadata/$1/$2.cjs", - "^@polkadot/metadata/decorate$": "@polkadot/metadata/decorate/index.cjs", - "^@polkadot/metadata/(.*)": "@polkadot/metadata/$1.cjs", - "^@polkadot/metadata$": "@polkadot/metadata/index.cjs", - "^@polkadot/networks/(.*).cjs$": "@polkadot/networks/$1.cjs", - "^@polkadot/networks/(.*)": "@polkadot/networks/$1.cjs", - "^@polkadot/networks$": "@polkadot/networks/index.cjs", - "^@polkadot/types/codec$": "@polkadot/types/codec/index.cjs", - "^@polkadot/types/primitive$": "@polkadot/types/primitive/index.cjs", - "^@polkadot/types/augment$": "@polkadot/types/augment/index.cjs", - "^@polkadot/types/metadata$": "@polkadot/types/metadata/index.cjs", + "^@polkadot/networks/(.*)": "@polkadot/networks/$1.js", + "^@polkadot/networks$": "@polkadot/networks/cjs/index.js", + "^@polkadot/types/codec$": "@polkadot/types/cjs/codec/index.js", + "^@polkadot/types/primitive$": "@polkadot/types/cjs/primitive/index.js", + "^@polkadot/types/augment$": "@polkadot/types/cjs/augment/index.js", + "^@polkadot/types/metadata$": "@polkadot/types/cjs/metadata/index.js", "^@polkadot/types/metadata/decorate$": - "@polkadot/types/metadata/decorate/index.cjs", - "^@polkadot/types/types$": "@polkadot/types/types/index.cjs", - "^@polkadot/types/(.*)/(.*)": "@polkadot/types/$1/$2.cjs", - "^@polkadot/types/(.*).cjs$": "@polkadot/types/$1.cjs", + "@polkadot/types/cjs/metadata/decorate/index.js", + "^@polkadot/types/types$": "@polkadot/types/cjs/types/index.js", + "^@polkadot/types/(.*)/(.*)": "@polkadot/types/$1/$2.js", + "^@polkadot/types/(.*).js$": "@polkadot/types/$1.js", "^@polkadot/types/(.*)": "@polkadot/types/$1.cjs", - "^@polkadot/types$": "@polkadot/types/index.cjs", - "^@polkadot/types-known/(.*)": "@polkadot/types-known/$1.cjs", - "^@polkadot/types-known$": "@polkadot/types-known/index.cjs", - "^@polkadot/util/(.*).cjs$": "@polkadot/util/$1.cjs", - "^@polkadot/util$": "@polkadot/util/index.cjs", - "^@polkadot/util-crypto$": "@polkadot/util-crypto/index.cjs", - "^@polkadot/wasm-crypto$": "@polkadot/wasm-crypto/index.cjs", - "^@polkadot/wasm-crypto-asmjs/(.*)": "@polkadot/wasm-crypto-asmjs/$1.cjs", - "^@polkadot/wasm-crypto-asmjs$": "@polkadot/wasm-crypto-asmjs/empty.cjs", - "^@polkadot/wasm-crypto-wasm/(.*)": "@polkadot/wasm-crypto-wasm/$1.cjs", - "^@polkadot/wasm-crypto-wasm$": "@polkadot/wasm-crypto-wasm/data.cjs", - "^@polkadot/x-global$": "@polkadot/x-global/index.cjs", - "^@polkadot/x-randomvalues$": "@polkadot/x-randomvalues/node.cjs", - "^@polkadot/x-textdecoder$": "@polkadot/x-textdecoder/node.cjs", - "^@polkadot/x-textencoder$": "@polkadot/x-textencoder/node.cjs", - "^@polkadot/x-bigint/(.*)": "@polkadot/x-bigint/$1.cjs", - "^@polkadot/x-bigint$": "@polkadot/x-bigint/index.cjs", - "^@polkadot/x-noble-secp256k1$": "@polkadot/x-noble-secp256k1/index.cjs", - "^@polkadot/x-noble-hashes/(.*)": "@polkadot/x-noble-hashes/$1.cjs", - "^@polkadot/x-noble-hashes$": "@polkadot/x-noble-hashes/index.cjs", + "^@polkadot/types$": "@polkadot/types/cjs/index.js", + "^@polkadot/types-known/(.*)": "@polkadot/types-known/$1.js", + "^@polkadot/types-known$": "@polkadot/types-known/cjs/index.js", + "^@polkadot/util/(.*).js$": "@polkadot/util/$1.js", + "^@polkadot/util$": "@polkadot/util/cjs/index.js", + "^@polkadot/util-crypto$": "@polkadot/util-crypto/cjs/index.js", + "^@polkadot/wasm-crypto$": "@polkadot/wasm-crypto/cjs/index.js", + "^@polkadot/wasm-crypto-asmjs/(.*)": "@polkadot/wasm-crypto-asmjs/$1.js", + "^@polkadot/wasm-crypto-asmjs$": "@polkadot/wasm-crypto-asmjs/cjs/index.js", + "^@polkadot/wasm-crypto-wasm/(.*)": "@polkadot/wasm-crypto-wasm/$1.js", + "^@polkadot/wasm-crypto-wasm$": "@polkadot/wasm-crypto-wasm/cjs/index.js", + "^@polkadot/x-global$": "@polkadot/x-global/cjs/index.js", + "^@polkadot/x-randomvalues$": "@polkadot/x-randomvalues/cjs/node.js", + "^@polkadot/x-textdecoder$": "@polkadot/x-textdecoder/cjs/node.js", + "^@polkadot/x-textencoder$": "@polkadot/x-textencoder/cjs/node.js", + "^@polkadot/x-bigint/(.*)": "@polkadot/x-bigint/$1.js", + "^@polkadot/x-bigint$": "@polkadot/x-bigint/cjs/index.js", + "^@polkadot/x-noble-secp256k1$": "@polkadot/x-noble-secp256k1/cjs/index.js", + "^@polkadot/x-noble-hashes/(.*)": "@polkadot/x-noble-hashes/$1.js", + "^@polkadot/x-noble-hashes$": "@polkadot/x-noble-hashes/cjs/index.js", }, transformIgnorePatterns: [ "/node_modules/(?!@polkadot|@babel/runtime/helpers/esm/)", diff --git a/mobile-test-app/yarn.lock b/mobile-test-app/yarn.lock index f730612e0c..5f9f9a5d18 100644 --- a/mobile-test-app/yarn.lock +++ b/mobile-test-app/yarn.lock @@ -1760,9 +1760,9 @@ async-limiter@~1.0.0: integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== async@^2.4.0: - version "2.6.3" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" - integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg== + version "2.6.4" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.4.tgz#706b7ff6084664cd7eae713f6f965433b5504221" + integrity sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA== dependencies: lodash "^4.17.14" diff --git a/package.json b/package.json index 78c2ad1922..5daf78fb13 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "type": "git", "url": "https://github.com/LedgerHQ/ledger-live-common" }, - "version": "22.0.3", + "version": "22.1.0", "main": "lib/index.js", "types": "lib/index.d.ts", "license": "Apache-2.0", @@ -44,21 +44,21 @@ "@celo/contractkit": "^1.5.2", "@celo/wallet-base": "^1.5.2", "@celo/wallet-ledger": "^1.5.2", + "@cosmjs/amino": "^0.28.4", "@cosmjs/crypto": "^0.26.5", - "@cosmjs/ledger-amino": "^0.26.5", "@cosmjs/proto-signing": "^0.26.5", "@cosmjs/stargate": "^0.26.5", "@crypto-com/chain-jslib": "0.0.19", "@ethereumjs/common": "^2.6.2", "@ethereumjs/tx": "^3.5.0", "@ledgerhq/compressjs": "1.3.2", - "@ledgerhq/cryptoassets": "6.28.1", + "@ledgerhq/cryptoassets": "6.28.2", "@ledgerhq/devices": "6.27.1", "@ledgerhq/errors": "6.10.0", "@ledgerhq/hw-app-algorand": "6.27.1", "@ledgerhq/hw-app-btc": "6.27.1", "@ledgerhq/hw-app-cosmos": "6.27.1", - "@ledgerhq/hw-app-eth": "6.28.1", + "@ledgerhq/hw-app-eth": "6.28.2", "@ledgerhq/hw-app-polkadot": "6.27.1", "@ledgerhq/hw-app-solana": "^6.27.1", "@ledgerhq/hw-app-str": "6.27.1", @@ -71,8 +71,8 @@ "@ledgerhq/json-bignumber": "^1.1.0", "@ledgerhq/live-app-sdk": "^0.6.1", "@ledgerhq/logs": "6.10.0", - "@polkadot/types": "7.8.1", - "@polkadot/types-known": "7.8.1", + "@polkadot/types": "8.1.1", + "@polkadot/types-known": "8.1.1", "@solana/spl-token": "^0.1.8", "@solana/web3.js": "^1.32.0", "@taquito/ledger-signer": "stablelib", @@ -123,7 +123,6 @@ "ripemd160": "^2.0.2", "ripple-binary-codec": "^1.3.0", "ripple-bs58check": "^2.0.2", - "ripple-lib": "1.10.0", "rlp": "^3.0.0", "rxjs": "6", "rxjs-compat": "^6.6.7", @@ -133,6 +132,7 @@ "stellar-sdk": "^10.0.1", "superstruct": "^0.14.2", "triple-beam": "^1.3.0", + "varuint-bitcoin": "1.1.2", "winston": "^3.4.0", "xstate": "^4.28.1" }, diff --git a/src/__tests__/families/bitcoin/wallet-btc/xpub.txs.dogecoin.test.ts b/src/__tests__/families/bitcoin/wallet-btc/xpub.txs.dogecoin.test.ts new file mode 100644 index 0000000000..7b8a6b0374 --- /dev/null +++ b/src/__tests__/families/bitcoin/wallet-btc/xpub.txs.dogecoin.test.ts @@ -0,0 +1,96 @@ +import coininfo from "coininfo"; +import BigNumber from "bignumber.js"; +import { DerivationModes } from "../../../../families/bitcoin/wallet-btc/types"; +import Xpub from "../../../../families/bitcoin/wallet-btc/xpub"; +import Doge from "../../../../families/bitcoin/wallet-btc/crypto/doge"; +import BitcoinLikeExplorer from "../../../../families/bitcoin/wallet-btc/explorer"; +import BitcoinLikeStorage from "../../../../families/bitcoin/wallet-btc/storage"; +import { Merge } from "../../../../families/bitcoin/wallet-btc/pickingstrategies/Merge"; +import BitcoinLikeWallet from "../../../../families/bitcoin/wallet-btc/wallet"; +import MockBtc from "../../../../mock/Btc"; + +describe("testing dogecoin transactions", () => { + const wallet = new BitcoinLikeWallet(); + const explorer = new BitcoinLikeExplorer({ + explorerURI: "https://explorers.api.vault.ledger.com/blockchain/v3/doge", + explorerVersion: "v3", + disableBatchSize: true, + }); + + const network = coininfo.dogecoin.main.toBitcoinJS(); + const crypto = new Doge({ network }); + + const storage = new BitcoinLikeStorage(); + const xpub = new Xpub({ + storage, + explorer, + crypto, + xpub: "dgub8rBf7BYsf5YoMezYuPaEhc2tsr7sQA2v2xNCj4mt1czF1m4hRiBdjYeAq5xDVQhN5HqYQnxv2DwyfmDvp1QEfmi44b8uynPL45KXQJrsoi8", + derivationMode: DerivationModes.LEGACY, + }); + it("testing dogecoin transactions with huge amount", async () => { + const utxoPickingStrategy = new Merge(xpub.crypto, xpub.derivationMode, []); + const changeAddress = await xpub.getNewAddress(1, 0); + xpub.storage.appendTxs([ + { + id: "c4ee70c30b9c5c5fed60c37ce86046156af3623f32aa5be94556b35dcf0af147", + inputs: [], + outputs: [ + { + output_index: 0, + value: "500000000000000000", // huge utxo + address: "mwXTtHo8Yy3aNKUUZLkBDrTcKT9qG9TqLb", + output_hash: + "c4ee70c30b9c5c5fed60c37ce86046156af3623f32aa5be94556b35dcf0af147", + block_height: 1, + rbf: false, + }, + { + output_index: 1, + value: "0", + address: "", + output_hash: + "c4ee70c30b9c5c5fed60c37ce86046156af3623f32aa5be94556b35dcf0af147", + block_height: 1, + rbf: false, + }, + ], + block: { + hash: "73c565a6f226978df23480e440b27eb02f307855f50aa3bc72ebb586938f23e0", + height: 1, + time: "2021-07-28T13:34:17Z", + }, + account: 0, + index: 0, + address: "mwXTtHo8Yy3aNKUUZLkBDrTcKT9qG9TqLb", + received_at: "2021-07-28T13:34:17Z", + }, + ]); + + const txInfo = await xpub.buildTx({ + destAddress: "D9fSjc6zAyjdRgSfbfMLv5z5FpuacvguUi", + amount: new BigNumber(200000000000000000), + feePerByte: 100, + changeAddress, + utxoPickingStrategy, + sequence: 0, + }); + const account = await wallet.generateAccount({ + xpub: xpub.xpub, + path: "44'/0'", + index: 0, + currency: "dogecoin", + network: "mainnet", + derivationMode: DerivationModes.LEGACY, + explorer: "ledgerv3", + explorerURI: "https://explorers.api.vault.ledger.com/blockchain/v3/doge", + storage: "mock", + storageParams: [], + }); + await wallet.signAccountTx({ + btc: new MockBtc(), + fromAccount: account, + txInfo, + }); + }, 100000); +}); diff --git a/src/api/Ripple.ts b/src/api/Ripple.ts index 4ded77b3ba..80e8455c46 100644 --- a/src/api/Ripple.ts +++ b/src/api/Ripple.ts @@ -1,185 +1,120 @@ import { BigNumber } from "bignumber.js"; -import { - parseCurrencyUnit, - getCryptoCurrencyById, - formatCurrencyUnit, -} from "../currencies"; import { getEnv } from "../env"; -import { RippleAPI } from "ripple-lib"; -import { Payment } from "ripple-lib/dist/npm/transaction/payment"; -import { TransactionsOptions } from "ripple-lib/dist/npm/ledger/transactions"; +import network from "../network"; +import { parseCurrencyUnit, getCryptoCurrencyById } from "../currencies"; -type AsyncApiFunction = (api: RippleAPI) => Promise; - -type XRPInstruction = { - fee: string; - maxLedgerVersionOffset: number; -}; - -const rippleUnit = getCryptoCurrencyById("ripple").units[0]; - -const defaultEndpoint = () => getEnv("API_RIPPLE_WS"); +const defaultEndpoint = () => getEnv("API_RIPPLE_RPC"); export const connectionTimeout = 30 * 1000; // default connectionTimeout is 2s and make the specs bot failed -const WEBSOCKET_DEBOUNCE_DELAY = 30000; -let api; -let pendingQueries: Promise[] = []; -let apiDisconnectTimeout; - -/** - * Connects to Substrate Node, executes calls then disconnects - * - * @param {*} execute - the calls to execute on api - */ -async function withApi( - execute: AsyncApiFunction, - endpointConfig: string | null | undefined = null -): Promise { - const server = endpointConfig || defaultEndpoint(); - - // If client is instanciated already, ensure it is connected & ready - if (api) { - try { - if (!(await api.isConnected)) { - throw new Error("XRP WS is not connected"); - } - } catch (err) { - // definitely not connected... - api = null; - pendingQueries = []; - } - } - - if (!api) { - api = new RippleAPI({ - server, - }); - // https://github.com/ripple/ripple-lib/issues/1196#issuecomment-583156895 - // We can't add connectionTimeout to the constructor - // We need to add this config to allow the bot to not timeout on github action - // but it will throw a 'additionalProperty "connectionTimeout" exists' - // during the preparePayment - api.connection._config.connectionTimeout = connectionTimeout; - api.on("error", (errorCode, errorMessage) => { - console.warn(`Ripple API error: ${errorCode}: ${errorMessage}`); - }); - await api.connect(); - } - - cancelDebouncedDisconnect(); - - try { - const query = execute(api); - pendingQueries.push(query.catch((err) => err)); - const res = await query; - return res; - } finally { - debouncedDisconnect(); - } -} - -/** - * Disconnects Websocket API client after all pending queries are flushed. - */ -export const disconnect = async (): Promise => { - cancelDebouncedDisconnect(); - - if (api) { - const disconnecting = api; - const pending = pendingQueries; - api = undefined; - pendingQueries = []; - await Promise.all(pending); - await disconnecting.disconnect(); - } -}; - -const cancelDebouncedDisconnect = () => { - if (apiDisconnectTimeout) { - clearTimeout(apiDisconnectTimeout); - apiDisconnectTimeout = null; - } -}; - -/** - * Disconnects Websocket client after a delay. - */ -const debouncedDisconnect = () => { - cancelDebouncedDisconnect(); - apiDisconnectTimeout = setTimeout(disconnect, WEBSOCKET_DEBOUNCE_DELAY); -}; +const rippleUnit = getCryptoCurrencyById("ripple").units[0]; export const parseAPIValue = (value: string): BigNumber => parseCurrencyUnit(rippleUnit, value); -export const parseAPICurrencyObject = ({ - currency, - value, -}: { - currency: string; - value: string; -}): BigNumber => { - if (currency !== "XRP") { - console.warn(`RippleJS: attempt to parse unknown currency ${currency}`); - return new BigNumber(0); - } - - return parseAPIValue(value); +export const submit = async (signature: string): Promise => { + const res = await network({ + method: "POST", + url: `${defaultEndpoint()}`, + data: { + method: "submit", + params: [ + { + tx_blob: signature, + }, + ], + }, + }); + return res.data.result; }; -export const formatAPICurrencyXRP = ( - amount: BigNumber -): { currency: "XRP"; value: string } => { - const value = formatCurrencyUnit(rippleUnit, amount, { - showAllDigits: true, - disableRounding: true, - useGrouping: false, - }); - return { - currency: "XRP", - value, +type AccountInfo = { + account_data: { + Account: string; + Balance: string; + Flags: number; + LedgerEntryType: string; + OwnerCount: number; + PreviousTxnID: string; + PreviousTxnLgrSeq: number; + Sequence: number; + index: string; }; + error: string; }; -export const preparePayment = async ( - address: string, - payment: Payment, - instruction: XRPInstruction -): Promise => - withApi(async (api: RippleAPI) => { - return api.preparePayment(address, payment, instruction); - }); - -export const submit = async (signature: string): Promise => - withApi(async (api: RippleAPI) => { - return api.request("submit", { - tx_blob: signature, - }); - }); -// endpointConfig does not seem to be undestood by linter - export const getAccountInfo = async ( recipient: string, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - endpointConfig?: string | null | undefined -): Promise => - withApi(async (api: RippleAPI) => { - return api.getAccountInfo(recipient); + current?: boolean +): Promise => { + const res = await network({ + method: "POST", + url: `${defaultEndpoint()}`, + data: { + method: "account_info", + params: [ + { + account: recipient, + ledger_index: current ? "current" : "validated", + }, + ], + }, }); + return res.data.result; +}; + export const getServerInfo = async ( - // eslint-disable-next-line @typescript-eslint/no-unused-vars endpointConfig?: string | null | undefined -): Promise => - withApi(async (api: RippleAPI) => { - return api.getServerInfo(); +): Promise => { + const res = await network({ + method: "POST", + url: endpointConfig ?? `${defaultEndpoint()}`, + data: { + method: "server_info", + params: [ + { + ledger_index: "validated", + }, + ], + }, }); -/* eslint-enable no-unused-vars */ + return res.data.result; +}; + export const getTransactions = async ( address: string, - options: TransactionsOptions | undefined -): Promise => - withApi(async (api: RippleAPI) => { - return api.getTransactions(address, options); + options: any | undefined +): Promise => { + const res = await network({ + method: "POST", + url: `${defaultEndpoint()}`, + data: { + method: "account_tx", + params: [ + { + account: address, + ledger_index: "validated", + ...options, + }, + ], + }, }); + return res.data.result.transactions; +}; + +export default async function getLedgerIndex(): Promise { + const ledgerResponse = await network({ + method: "POST", + url: `${defaultEndpoint()}`, + data: { + method: "ledger", + params: [ + { + ledger_index: "validated", + }, + ], + }, + }); + return ledgerResponse.data.result.ledger_index; +} diff --git a/src/api/index.ts b/src/api/index.ts index 53f908c83d..1031da3a6c 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,7 +1,5 @@ -import { disconnect as rippleApiDisconnect } from "./Ripple"; import { disconnect as polkadotApiDisconnect } from "../families/polkadot/api"; export async function disconnectAll(): Promise { - await rippleApiDisconnect(); await polkadotApiDisconnect(); } diff --git a/src/currencies/__snapshots__/sortByMarketcap.test.ts.snap b/src/currencies/__snapshots__/sortByMarketcap.test.ts.snap index 23c4bd9608..82f0ab9e23 100644 --- a/src/currencies/__snapshots__/sortByMarketcap.test.ts.snap +++ b/src/currencies/__snapshots__/sortByMarketcap.test.ts.snap @@ -684,6 +684,7 @@ Array [ "ethereum/erc20/mark", "ethereum/erc20/flip_token", "ethereum/erc20/team", + "polygon/erc20/ig_orb_(pos)", "ethereum/erc20/syncfab_manufacturing", "ethereum/erc20/niobium", "ethereum/erc20/bob_s_repair", @@ -716,7 +717,7 @@ Array [ "ethereum/erc20/coinus", "ethereum/erc20/rating", "ethereum/erc20/uptrennd", - "ethereum/erc20/stoxtoken", + "stacks", "ethereum/erc20/smartshare_token", "ethereum/erc20/fti", "ethereum/erc20/neurochain_clausius", @@ -1060,6 +1061,7 @@ Array [ "ethereum/erc20/bnc_token", "ethereum/erc20/stakehouse_batch", "ethereum/erc20/micromines", + "ethereum/erc20/wrapped_luna_token", "ethereum/erc20/tokendesk", "akroma", "ethereum/erc20/delta_financial_-_deep_defi_derivatives", @@ -1351,7 +1353,6 @@ Array [ "songbird", "reosc", "resistance", - "stacks", "ethereum/erc20/$aapl", "ethereum/erc20/$based", "ethereum/erc20/$die", @@ -1560,6 +1561,7 @@ Array [ "ethereum/erc20/ape_stax", "ethereum/erc20/apebullinu", "ethereum/erc20/apecoin", + "ethereum/erc20/apecoin_dev", "ethereum/erc20/apehaven", "ethereum/erc20/apenft", "ethereum/erc20/api3", @@ -1805,6 +1807,7 @@ Array [ "ethereum/erc20/bitboost", "ethereum/erc20/bitcar_token", "ethereum/erc20/bitcashpay", + "ethereum/erc20/bitcci_cash", "ethereum/erc20/bitcloud_token", "ethereum/erc20/bitcoin_boutique", "ethereum/erc20/bitcoin_zero", @@ -2017,6 +2020,7 @@ Array [ "ethereum/erc20/capital_finance", "ethereum/erc20/capitalsharetoken", "ethereum/erc20/capsule_coin", + "ethereum/erc20/captain_inu", "ethereum/erc20/car_coin", "ethereum/erc20/car_sharing_community", "ethereum/erc20/carbcoin", @@ -2041,6 +2045,7 @@ Array [ "ethereum/erc20/cat__blockcat_", "ethereum/erc20/cat_trade", "ethereum/erc20/catcoin", + "ethereum/erc20/catecoin", "ethereum/erc20/cavapoo", "ethereum/erc20/cavo", "ethereum/erc20/cbdao", @@ -2079,6 +2084,7 @@ Array [ "ethereum/erc20/cherry_token", "ethereum/erc20/chi_gastoken_by_1inch", "ethereum/erc20/chicken", + "ethereum/erc20/chihiro_inu", "ethereum/erc20/chihua_token", "ethereum/erc20/chipz", "ethereum/erc20/chonk", @@ -2221,6 +2227,7 @@ Array [ "ethereum/erc20/creedtoken", "ethereum/erc20/cremit", "ethereum/erc20/crespo", + "ethereum/erc20/creverse", "ethereum/erc20/criptoro_coin", "ethereum/erc20/cro", "ethereum/erc20/crossfi", @@ -2644,6 +2651,7 @@ Array [ "ethereum/erc20/enkronostoken", "ethereum/erc20/enreachdao", "ethereum/erc20/entanmo", + "ethereum/erc20/enter_governance_token", "ethereum/erc20/entone", "ethereum/erc20/entropy", "ethereum/erc20/envicoin", @@ -2977,6 +2985,7 @@ Array [ "ethereum/erc20/gera", "ethereum/erc20/gerowallet", "ethereum/erc20/geyser", + "ethereum/erc20/gg_token", "ethereum/erc20/ggcoin", "ethereum/erc20/ggtoken", "ethereum/erc20/ghoul", @@ -3059,6 +3068,7 @@ Array [ "ethereum/erc20/grearn's_token", "ethereum/erc20/green", "ethereum/erc20/green_light_erc20", + "ethereum/erc20/green_metaverse_token", "ethereum/erc20/green_token", "ethereum/erc20/greenmed", "ethereum/erc20/grey_token", @@ -3140,6 +3150,7 @@ Array [ "ethereum/erc20/hiz_finance", "ethereum/erc20/hkg", "ethereum/erc20/hlandtoken", + "ethereum/erc20/hmmm", "ethereum/erc20/hoard_token", "ethereum/erc20/hobonickels", "ethereum/erc20/hodlcoin", @@ -3448,6 +3459,7 @@ Array [ "ethereum/erc20/libartysharetoken", "ethereum/erc20/libera", "ethereum/erc20/libereum", + "ethereum/erc20/libero_financial_freedom", "ethereum/erc20/libertas", "ethereum/erc20/libfx", "ethereum/erc20/libratoken", @@ -3518,6 +3530,7 @@ Array [ "ethereum/erc20/ludena_protocol", "ethereum/erc20/ludos_protocol", "ethereum/erc20/luffy_inu", + "ethereum/erc20/lugh", "ethereum/erc20/lulz", "ethereum/erc20/lumino_coin", "ethereum/erc20/lung_protocol", @@ -3609,6 +3622,7 @@ Array [ "ethereum/erc20/metadium", "ethereum/erc20/metafabric", "ethereum/erc20/metafactory", + "ethereum/erc20/metafluence", "ethereum/erc20/metaverse_index", "ethereum/erc20/metaverse_nft_index", "ethereum/erc20/metawhale_btc", @@ -3908,6 +3922,7 @@ Array [ "ethereum/erc20/orbicularv2", "ethereum/erc20/orbit_chain", "ethereum/erc20/orca_token", + "ethereum/erc20/orica", "ethereum/erc20/orient", "ethereum/erc20/orientum_plus", "ethereum/erc20/orion_protocol", @@ -4182,6 +4197,7 @@ Array [ "ethereum/erc20/quannabu", "ethereum/erc20/quantfury_data_token", "ethereum/erc20/quantfury_token", + "ethereum/erc20/quarashi", "ethereum/erc20/quickmining_token", "ethereum/erc20/quickswap", "ethereum/erc20/quiverx", @@ -4237,6 +4253,7 @@ Array [ "ethereum/erc20/reditoken", "ethereum/erc20/reef_finance", "ethereum/erc20/reeth_token", + "ethereum/erc20/refi", "ethereum/erc20/refine_medium_token", "ethereum/erc20/reflect_finance", "ethereum/erc20/reflector_finance", @@ -4337,6 +4354,7 @@ Array [ "ethereum/erc20/safemoon_inu", "ethereum/erc20/safemusk", "ethereum/erc20/safeswap", + "ethereum/erc20/safuu", "ethereum/erc20/saitama_inu", "ethereum/erc20/saito", "ethereum/erc20/saja", @@ -4364,6 +4382,7 @@ Array [ "ethereum/erc20/savetoken", "ethereum/erc20/savix", "ethereum/erc20/scaleswaptoken", + "ethereum/erc20/scallop", "ethereum/erc20/scandiweb_coin", "ethereum/erc20/scatter_cx", "ethereum/erc20/scdstoken", @@ -4372,12 +4391,14 @@ Array [ "ethereum/erc20/scifitoken", "ethereum/erc20/scoobi-doge", "ethereum/erc20/scott", + "ethereum/erc20/scratchtoken", "ethereum/erc20/scrl", "ethereum/erc20/sdog", "ethereum/erc20/sea_cucumber_chain", "ethereum/erc20/sealblock_token", "ethereum/erc20/sechain", "ethereum/erc20/secret_finance", + "ethereum/erc20/sector", "ethereum/erc20/secure_pad", "ethereum/erc20/securypto", "ethereum/erc20/seed", @@ -4634,6 +4655,7 @@ Array [ "ethereum/erc20/store-of-value_token", "ethereum/erc20/storh", "ethereum/erc20/storichain", + "ethereum/erc20/stoxtoken", "ethereum/erc20/stpc", "ethereum/erc20/strain", "ethereum/erc20/stratos_token", @@ -4644,6 +4666,7 @@ Array [ "ethereum/erc20/street_cred", "ethereum/erc20/strike_token", "ethereum/erc20/strikecoin_token", + "ethereum/erc20/strikex", "ethereum/erc20/strong", "ethereum/erc20/stronghold", "ethereum/erc20/strudel_finance", @@ -4761,6 +4784,7 @@ Array [ "ethereum/erc20/taklimakan_network", "ethereum/erc20/talao", "ethereum/erc20/talent_coin", + "ethereum/erc20/talkado", "ethereum/erc20/tama_egg_niftygotchi", "ethereum/erc20/tamy_token", "ethereum/erc20/tangguotao_token", @@ -4851,6 +4875,7 @@ Array [ "ethereum/erc20/tingles", "ethereum/erc20/tinku", "ethereum/erc20/tio", + "ethereum/erc20/titano", "ethereum/erc20/titanswap", "ethereum/erc20/tixl_token", "ethereum/erc20/tknt", @@ -5232,7 +5257,6 @@ Array [ "ethereum/erc20/wrapped_ilcoin", "ethereum/erc20/wrapped_leo", "ethereum/erc20/wrapped_lotto_token", - "ethereum/erc20/wrapped_luna_token", "ethereum/erc20/wrapped_mir_token", "ethereum/erc20/wrapped_mirror_aapl_token", "ethereum/erc20/wrapped_mirror_amzn_token", @@ -5614,6 +5638,7 @@ Array [ "polygon/erc20/gravity_finance", "polygon/erc20/grumpy_cat", "polygon/erc20/guaranteed_entrance_token", + "polygon/erc20/guppy_treat_token", "polygon/erc20/hashgard", "polygon/erc20/hex", "polygon/erc20/holotoken", @@ -5626,6 +5651,10 @@ Array [ "polygon/erc20/injective_token", "polygon/erc20/internxt", "polygon/erc20/inverse", + "polygon/erc20/invictus_bitcoin_alpha", + "polygon/erc20/invictus_crypto10_hedged", + "polygon/erc20/invictus_crypto20", + "polygon/erc20/invictus_stable_growth", "polygon/erc20/iron_finance_ice_token", "polygon/erc20/iron_stablecoin", "polygon/erc20/iron_titanium_token", @@ -5657,6 +5686,7 @@ Array [ "polygon/erc20/moonwolf.io", "polygon/erc20/mover", "polygon/erc20/mysterium_(pos)", + "polygon/erc20/nakamoto.games", "polygon/erc20/napoleonx", "polygon/erc20/neighbourhoods_token", "polygon/erc20/neos_credits_(pos)", @@ -5710,6 +5740,7 @@ Array [ "polygon/erc20/sand", "polygon/erc20/sand_old", "polygon/erc20/sapien_network", + "polygon/erc20/sekuritance_(pos)", "polygon/erc20/sentinel", "polygon/erc20/serum", "polygon/erc20/shopping.io", @@ -5798,6 +5829,7 @@ Array [ "bsc/bep20/ariva", "bsc/bep20/arpa_token", "bsc/bep20/arrano", + "bsc/bep20/aurox_token", "bsc/bep20/autocrypto", "bsc/bep20/automata", "bsc/bep20/autov2", @@ -5900,6 +5932,7 @@ Array [ "bsc/bep20/car", "bsc/bep20/cartesi_token", "bsc/bep20/catecoin", + "bsc/bep20/catecoin_old", "bsc/bep20/ceek", "bsc/bep20/cerby_token", "bsc/bep20/certik_token", @@ -5970,6 +6003,7 @@ Array [ "bsc/bep20/fantom", "bsc/bep20/faracrystal", "bsc/bep20/fegtoken", + "bsc/bep20/ferrum_network_token", "bsc/bep20/finnexus", "bsc/bep20/firo", "bsc/bep20/flashx_ultra", @@ -5978,6 +6012,7 @@ Array [ "bsc/bep20/flokimooni", "bsc/bep20/formation_finance", "bsc/bep20/free_coin_bsc", + "bsc/bep20/frmx_token", "bsc/bep20/frontier_token", "bsc/bep20/fry.ketchupv2", "bsc/bep20/fry.world", @@ -5988,12 +6023,14 @@ Array [ "bsc/bep20/gamyfi", "bsc/bep20/genta", "bsc/bep20/gforce", + "bsc/bep20/gg_token", "bsc/bep20/gomining_token", "bsc/bep20/goose_coin", "bsc/bep20/goose_golden_egg", "bsc/bep20/gorilladiamond", "bsc/bep20/goswapp", "bsc/bep20/gourmetgalaxy", + "bsc/bep20/green_metaverse_token", "bsc/bep20/gummy_bull_token", "bsc/bep20/hacken_token", "bsc/bep20/hakka_finance_on_xdai_on_bsc", @@ -6048,6 +6085,7 @@ Array [ "bsc/bep20/mcontent", "bsc/bep20/measurable_data_token", "bsc/bep20/mercor_token", + "bsc/bep20/metafluence", "bsc/bep20/metahero", "bsc/bep20/micropets", "bsc/bep20/milk_protocol", @@ -6085,6 +6123,7 @@ Array [ "bsc/bep20/open_governance_token", "bsc/bep20/orbs", "bsc/bep20/oreo", + "bsc/bep20/orica", "bsc/bep20/ovr", "bsc/bep20/paid_network", "bsc/bep20/pancakeswap_token", @@ -6117,6 +6156,7 @@ Array [ "bsc/bep20/puli_inu", "bsc/bep20/qian_governance_token", "bsc/bep20/qian_second_generation_dollar", + "bsc/bep20/quarashi", "bsc/bep20/quarkchain_token", "bsc/bep20/qusd_stablecoin", "bsc/bep20/rabbit_coin", @@ -6142,6 +6182,8 @@ Array [ "bsc/bep20/safepal_token", "bsc/bep20/safuu", "bsc/bep20/saketoken", + "bsc/bep20/scallop", + "bsc/bep20/sector", "bsc/bep20/seedifyfund", "bsc/bep20/seven_up_token", "bsc/bep20/shambala", @@ -6175,6 +6217,7 @@ Array [ "bsc/bep20/swipe", "bsc/bep20/switcheo_token", "bsc/bep20/taco", + "bsc/bep20/talkado", "bsc/bep20/tbitcoin", "bsc/bep20/tdogecoin", "bsc/bep20/tenet", @@ -6232,6 +6275,7 @@ Array [ "bsc/bep20/venus_xrp", "bsc/bep20/venus_xvs", "bsc/bep20/vfox", + "bsc/bep20/volt_inu", "bsc/bep20/vswap.fi", "bsc/bep20/wall_street_games", "bsc/bep20/wanaka_farm", diff --git a/src/env.ts b/src/env.ts index 249ce97565..5ed20036d1 100644 --- a/src/env.ts +++ b/src/env.ts @@ -70,10 +70,10 @@ const envDefinitions = { parser: stringParser, desc: "Node API to use for cosmos_testnet (COSMOS_NODE or STARGATE_NODE are known)", }, - API_RIPPLE_WS: { + API_RIPPLE_RPC: { parser: stringParser, - def: "wss://xrplcluster.com/ledgerlive", - desc: "XRP Ledger full history open WebSocket endpoint", + def: "https://xrplcluster.com/ledgerlive", + desc: "XRP Ledger full history open JSON-RPC endpoint", }, API_FILECOIN_ENDPOINT: { parser: stringParser, diff --git a/src/errors.ts b/src/errors.ts index b51e92f367..98128a749d 100644 --- a/src/errors.ts +++ b/src/errors.ts @@ -205,6 +205,10 @@ export const FreshAddressIndexInvalid = createCustomErrorClass( "FreshAddressIndexInvalid" ); +export const BluetoothNotSupportedError = createCustomErrorClass( + "FwUpdateBluetoothNotSupported" +); + export const UnsupportedDerivation = createCustomErrorClass( "UnsupportedDerivation" ); diff --git a/src/families/bitcoin/getAccountNetworkInfo.ts b/src/families/bitcoin/getAccountNetworkInfo.ts index d13cb34c91..ac8b75490e 100644 --- a/src/families/bitcoin/getAccountNetworkInfo.ts +++ b/src/families/bitcoin/getAccountNetworkInfo.ts @@ -47,10 +47,12 @@ export async function getAccountNetworkInfo( } // Fix fees if suggested fee is too low, this is only for viacoin/decred because the fees backend endpoint is broken if ( - (account.currency.id === "viacoin" || account.currency.id === "decred") && + (account.currency.id === "viacoin" || + account.currency.id === "decred" || + account.currency.id === "qtum") && feesPerByte[2].toNumber() < Math.ceil(relayFee * 100000) ) { - feesPerByte[2] = new BigNumber(Math.ceil(relayFee * 100000)).plus(1); + feesPerByte[2] = new BigNumber(Math.ceil(relayFee * 100000)).plus(2); feesPerByte[1] = feesPerByte[2].plus(1); if (feesPerByte[1].plus(1).gt(feesPerByte[0])) { feesPerByte[0] = feesPerByte[1].plus(1); diff --git a/src/families/bitcoin/specs.ts b/src/families/bitcoin/specs.ts index d4600d42b4..e2098bc913 100644 --- a/src/families/bitcoin/specs.ts +++ b/src/families/bitcoin/specs.ts @@ -10,11 +10,7 @@ import { pickSiblings } from "../../bot/specs"; import { bitcoinPickingStrategy } from "./types"; import type { MutationSpec, AppSpec } from "../../bot/types"; import { LowerThanMinimumRelayFee } from "../../errors"; -import { - getMinRelayFee, - getUTXOStatus, - bchToCashaddrAddressWithoutPrefix, -} from "./logic"; +import { getMinRelayFee, getUTXOStatus } from "./logic"; import { DeviceModelId } from "@ledgerhq/devices"; type Arg = Partial<{ minimalAmount: BigNumber; @@ -316,6 +312,9 @@ const bitcoinGold: AppSpec = { mutations: bitcoinLikeMutations(), }; +const bchToCashaddrAddressWithoutPrefix = (recipient) => + bchaddrjs.toCashAddress(recipient).split(":")[1]; + const bitcoinCash: AppSpec = { name: "Bitcoin Cash", currency: getCryptoCurrencyById("bitcoin_cash"), diff --git a/src/families/bitcoin/wallet-btc/utils.ts b/src/families/bitcoin/wallet-btc/utils.ts index 972ca92e95..0dcbc48455 100644 --- a/src/families/bitcoin/wallet-btc/utils.ts +++ b/src/families/bitcoin/wallet-btc/utils.ts @@ -7,6 +7,7 @@ import { Currency, ICrypto } from "./crypto/types"; import cryptoFactory from "./crypto/factory"; import { fallbackValidateAddress } from "./crypto/base"; import { UnsupportedDerivation } from "../../../errors"; +import varuint from "varuint-bitcoin"; export function parseHexString(str: any) { const result: Array = []; @@ -261,3 +262,10 @@ export function isTaprootAddress(address: string, currency?: Currency) { return false; } } + +export function writeVarInt(buffer: Buffer, i: number, offset: number) { + // refer to https://github.com/bitcoinjs/bitcoinjs-lib/blob/1f44f722d30cd14a1861c8546e6b455f73862c1e/src/bufferutils.js#L78 + varuint.encode(i, buffer, offset); + offset += varuint.encode.bytes; + return offset; +} diff --git a/src/families/bitcoin/wallet-btc/wallet.ts b/src/families/bitcoin/wallet-btc/wallet.ts index bbd3cbca27..4379938eb8 100644 --- a/src/families/bitcoin/wallet-btc/wallet.ts +++ b/src/families/bitcoin/wallet-btc/wallet.ts @@ -2,15 +2,10 @@ // @ts-ignore import { flatten } from "lodash"; import BigNumber from "bignumber.js"; -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-ignore -import { BufferWriter } from "bitcoinjs-lib/src/bufferutils"; - import Btc from "@ledgerhq/hw-app-btc"; import { log } from "@ledgerhq/logs"; import { Transaction } from "@ledgerhq/hw-app-btc/lib/types"; import { Currency } from "./crypto/types"; - import { TransactionInfo, DerivationModes } from "./types"; import { Account, SerializedAccount } from "./account"; import Xpub from "./xpub"; @@ -246,16 +241,33 @@ class BitcoinLikeWallet { length += 2 * txInfo.outputs.length; } const buffer = Buffer.allocUnsafe(length); - const bufferWriter = new BufferWriter(buffer, 0); - bufferWriter.writeVarInt(txInfo.outputs.length); + let bufferOffset = 0; + bufferOffset = utils.writeVarInt( + buffer, + txInfo.outputs.length, + bufferOffset + ); txInfo.outputs.forEach((txOut) => { - // xpub splits output into smaller outputs than SAFE_MAX_INT anyway - bufferWriter.writeUInt64(txOut.value.toNumber()); + // refer to https://github.com/bitcoinjs/bitcoinjs-lib/blob/59b21162a2c4645c64271ca004c7a3755a3d72fb/ts_src/bufferutils.ts#L26 + buffer.writeUInt32LE( + txOut.value.modulo(new BigNumber(0x100000000)).toNumber(), + bufferOffset + ); + buffer.writeUInt32LE( + txOut.value.dividedToIntegerBy(new BigNumber(0x100000000)).toNumber(), + bufferOffset + 4 + ); + bufferOffset += 8; if (additionals && additionals.includes("decred")) { - bufferWriter.writeVarInt(0); - bufferWriter.writeVarInt(0); + bufferOffset = utils.writeVarInt(buffer, 0, bufferOffset); + bufferOffset = utils.writeVarInt(buffer, 0, bufferOffset); } - bufferWriter.writeVarSlice(txOut.script); + bufferOffset = utils.writeVarInt( + buffer, + txOut.script.length, + bufferOffset + ); + bufferOffset += txOut.script.copy(buffer, bufferOffset); }); const outputScriptHex = buffer.toString("hex"); const associatedKeysets = txInfo.associatedDerivations.map( diff --git a/src/families/cosmos/__snapshots__/bridge.test.ts.snap b/src/families/cosmos/__snapshots__/bridge.test.ts.snap index 1ec247e79a..0d892e7221 100644 --- a/src/families/cosmos/__snapshots__/bridge.test.ts.snap +++ b/src/families/cosmos/__snapshots__/bridge.test.ts.snap @@ -3,7 +3,7 @@ exports[`cosmos currency bridge scanAccounts cosmos seed 1 1`] = ` Array [ Object { - "balance": "2467871", + "balance": "2264526", "cosmosResources": Object { "delegatedBalance": "2139044", "withdrawAddress": "cosmos1g84934jpu3v5de5yqukkkhxmcvsw3u2ajxvpdl", @@ -22,7 +22,7 @@ Array [ "index": 0, "name": "Cosmos 1", "nfts": undefined, - "operationsCount": 22, + "operationsCount": 23, "pendingOperations": Array [], "seedIdentifier": "0388459b2653519948b12492f1a0b464720110c147a8155d23d423a5cc3c21d89a", "starred": false, @@ -33,7 +33,7 @@ Array [ "xpub": "cosmos1g84934jpu3v5de5yqukkkhxmcvsw3u2ajxvpdl", }, Object { - "balance": "0", + "balance": "300000", "cosmosResources": Object { "delegatedBalance": "0", "withdrawAddress": "cosmos108uy5q9jt59gwugq5yrdhkzcd9jryslmpcstk5", @@ -52,7 +52,7 @@ Array [ "index": 1, "name": "Cosmos 2", "nfts": undefined, - "operationsCount": 12, + "operationsCount": 14, "pendingOperations": Array [], "seedIdentifier": "0388459b2653519948b12492f1a0b464720110c147a8155d23d423a5cc3c21d89a", "starred": false, @@ -63,9 +63,9 @@ Array [ "xpub": "cosmos108uy5q9jt59gwugq5yrdhkzcd9jryslmpcstk5", }, Object { - "balance": "478443", + "balance": "367382", "cosmosResources": Object { - "delegatedBalance": "1000", + "delegatedBalance": "0", "withdrawAddress": "cosmos1cgc696ay2pg6d4gcejek2y8la66j7e5y3c7kyw", }, "currencyId": "cosmos", @@ -82,7 +82,7 @@ Array [ "index": 2, "name": "Cosmos 3", "nfts": undefined, - "operationsCount": 8, + "operationsCount": 10, "pendingOperations": Array [], "seedIdentifier": "0388459b2653519948b12492f1a0b464720110c147a8155d23d423a5cc3c21d89a", "starred": false, @@ -224,6 +224,30 @@ Array [ "type": "IN", "value": "1000", }, + Object { + "accountId": "js:2:cosmos:cosmos1g84934jpu3v5de5yqukkkhxmcvsw3u2ajxvpdl:", + "blockHash": null, + "blockHeight": "10348199", + "contract": undefined, + "extra": Object { + "validators": Array [], + }, + "fee": "3345", + "hash": "381E494804FFC8EBDBA17B457D7D666DCE377D6D757F6B298FD820250450D409", + "id": "js:2:cosmos:cosmos1g84934jpu3v5de5yqukkkhxmcvsw3u2ajxvpdl:-381E494804FFC8EBDBA17B457D7D666DCE377D6D757F6B298FD820250450D409-OUT", + "operator": undefined, + "recipients": Array [ + "cosmos108uy5q9jt59gwugq5yrdhkzcd9jryslmpcstk5", + ], + "senders": Array [ + "cosmos1g84934jpu3v5de5yqukkkhxmcvsw3u2ajxvpdl", + ], + "standard": undefined, + "tokenId": undefined, + "transactionSequenceNumber": 79, + "type": "OUT", + "value": "203345", + }, Object { "accountId": "js:2:cosmos:cosmos1g84934jpu3v5de5yqukkkhxmcvsw3u2ajxvpdl:", "blockHash": null, @@ -710,6 +734,30 @@ Array [ "type": "IN", "value": "1000", }, + Object { + "accountId": "js:2:cosmos:cosmos108uy5q9jt59gwugq5yrdhkzcd9jryslmpcstk5:", + "blockHash": null, + "blockHeight": "10348199", + "contract": undefined, + "extra": Object { + "validators": Array [], + }, + "fee": "3345", + "hash": "381E494804FFC8EBDBA17B457D7D666DCE377D6D757F6B298FD820250450D409", + "id": "js:2:cosmos:cosmos108uy5q9jt59gwugq5yrdhkzcd9jryslmpcstk5:-381E494804FFC8EBDBA17B457D7D666DCE377D6D757F6B298FD820250450D409-IN", + "operator": undefined, + "recipients": Array [ + "cosmos108uy5q9jt59gwugq5yrdhkzcd9jryslmpcstk5", + ], + "senders": Array [ + "cosmos1g84934jpu3v5de5yqukkkhxmcvsw3u2ajxvpdl", + ], + "standard": undefined, + "tokenId": undefined, + "transactionSequenceNumber": 79, + "type": "IN", + "value": "200000", + }, Object { "accountId": "js:2:cosmos:cosmos108uy5q9jt59gwugq5yrdhkzcd9jryslmpcstk5:", "blockHash": null, @@ -950,6 +998,30 @@ Array [ "type": "OUT", "value": "15050", }, + Object { + "accountId": "js:2:cosmos:cosmos108uy5q9jt59gwugq5yrdhkzcd9jryslmpcstk5:", + "blockHash": null, + "blockHeight": "10348072", + "contract": undefined, + "extra": Object { + "validators": Array [], + }, + "fee": "3342", + "hash": "E7F1D275353E097E0A19217A1D0BFE2DC8947100213E912EFCC896329D950981", + "id": "js:2:cosmos:cosmos108uy5q9jt59gwugq5yrdhkzcd9jryslmpcstk5:-E7F1D275353E097E0A19217A1D0BFE2DC8947100213E912EFCC896329D950981-IN", + "operator": undefined, + "recipients": Array [ + "cosmos108uy5q9jt59gwugq5yrdhkzcd9jryslmpcstk5", + ], + "senders": Array [ + "cosmos1cgc696ay2pg6d4gcejek2y8la66j7e5y3c7kyw", + ], + "standard": undefined, + "tokenId": undefined, + "transactionSequenceNumber": 28, + "type": "IN", + "value": "100000", + }, ], Array [ Object { @@ -1121,6 +1193,31 @@ Array [ "type": "OUT", "value": "6565", }, + Object { + "accountId": "js:2:cosmos:cosmos1cgc696ay2pg6d4gcejek2y8la66j7e5y3c7kyw:", + "blockHash": null, + "blockHeight": "10337853", + "contract": undefined, + "extra": Object { + "validators": Array [ + Object { + "address": "cosmosvaloper17zcpywlhgcpk7ff505vr8mnc4wwpv5fcta6enz", + "amount": "1000", + }, + ], + }, + "fee": "7719", + "hash": "DD5085AF922A2BAD032131A2F9168EB1498E615063ECBC6C86CE31D5B9981E2A", + "id": "js:2:cosmos:cosmos1cgc696ay2pg6d4gcejek2y8la66j7e5y3c7kyw:-DD5085AF922A2BAD032131A2F9168EB1498E615063ECBC6C86CE31D5B9981E2A-UNDELEGATE", + "operator": undefined, + "recipients": Array [], + "senders": Array [], + "standard": undefined, + "tokenId": undefined, + "transactionSequenceNumber": 27, + "type": "UNDELEGATE", + "value": "7719", + }, Object { "accountId": "js:2:cosmos:cosmos1cgc696ay2pg6d4gcejek2y8la66j7e5y3c7kyw:", "blockHash": null, @@ -1150,6 +1247,30 @@ Array [ "type": "DELEGATE", "value": "8399", }, + Object { + "accountId": "js:2:cosmos:cosmos1cgc696ay2pg6d4gcejek2y8la66j7e5y3c7kyw:", + "blockHash": null, + "blockHeight": "10348072", + "contract": undefined, + "extra": Object { + "validators": Array [], + }, + "fee": "3342", + "hash": "E7F1D275353E097E0A19217A1D0BFE2DC8947100213E912EFCC896329D950981", + "id": "js:2:cosmos:cosmos1cgc696ay2pg6d4gcejek2y8la66j7e5y3c7kyw:-E7F1D275353E097E0A19217A1D0BFE2DC8947100213E912EFCC896329D950981-OUT", + "operator": undefined, + "recipients": Array [ + "cosmos108uy5q9jt59gwugq5yrdhkzcd9jryslmpcstk5", + ], + "senders": Array [ + "cosmos1cgc696ay2pg6d4gcejek2y8la66j7e5y3c7kyw", + ], + "standard": undefined, + "tokenId": undefined, + "transactionSequenceNumber": 28, + "type": "OUT", + "value": "103342", + }, ], Array [], ] diff --git a/src/families/cosmos/js-prepareTransaction.ts b/src/families/cosmos/js-prepareTransaction.ts index 95657d5013..f7310eb413 100644 --- a/src/families/cosmos/js-prepareTransaction.ts +++ b/src/families/cosmos/js-prepareTransaction.ts @@ -2,7 +2,6 @@ import { Account } from "../../types"; import { Transaction } from "./types"; import BigNumber from "bignumber.js"; import { simulate } from "./api/Cosmos"; -import { encodePubkey } from "@cosmjs/proto-signing"; import { getEnv } from "../../env"; import { buildTransaction, postBuildTransaction } from "./js-buildTransaction"; import { getMaxEstimatedBalance } from "./logic"; @@ -50,10 +49,13 @@ const getEstimatedFees = async ( // be sure payload is complete if (unsignedPayload) { - const pubkey = encodePubkey({ - type: "tendermint/PubKeySecp256k1", - value: Buffer.from(account.seedIdentifier, "hex").toString("base64"), - }); + const pubkey = { + typeUrl: "/cosmos.crypto.secp256k1.PubKey", + value: new Uint8Array([ + ...new Uint8Array([10, 33]), + ...new Uint8Array(Buffer.from(account.seedIdentifier, "hex")), + ]), + }; const tx_bytes = await postBuildTransaction( account, diff --git a/src/families/cosmos/js-signOperation.ts b/src/families/cosmos/js-signOperation.ts index dba1960f55..ab0cf93d6b 100644 --- a/src/families/cosmos/js-signOperation.ts +++ b/src/families/cosmos/js-signOperation.ts @@ -8,13 +8,12 @@ import type { Transaction } from "./types"; import { getAccount, getChainId } from "./api/Cosmos"; import { Observable } from "rxjs"; import { withDevice } from "../../hw/deviceAccess"; -import { encodePubkey } from "@cosmjs/proto-signing"; import { encodeOperationId } from "../../operation"; -import { LedgerSigner } from "@cosmjs/ledger-amino"; +import Cosmos from "@ledgerhq/hw-app-cosmos"; import { AminoTypes } from "@cosmjs/stargate"; -import { stringToPath } from "@cosmjs/crypto"; import { buildTransaction, postBuildTransaction } from "./js-buildTransaction"; import BigNumber from "bignumber.js"; +import { Secp256k1Signature } from "@cosmjs/crypto"; const aminoTypes = new AminoTypes({ prefix: "cosmos" }); @@ -32,52 +31,39 @@ const signOperation = ({ let cancelled; async function main() { + const hwApp = new Cosmos(transport); + const { accountNumber, sequence } = await getAccount( account.freshAddress ); const chainId = await getChainId(); - const hdPaths: any = stringToPath("m/" + account.freshAddressPath); - - const ledgerSigner = new LedgerSigner(transport, { - hdPaths: [hdPaths], - }); - o.next({ type: "device-signature-requested" }); - const accounts = await ledgerSigner.getAccounts(); - - let pubkey; + const { publicKey } = await hwApp.getAddress( + account.freshAddressPath, + "cosmos", + false + ); - accounts.forEach((a) => { - if (a.address == account.freshAddress) { - pubkey = encodePubkey({ - type: "tendermint/PubKeySecp256k1", - value: Buffer.from(a.pubkey).toString("base64"), - }); - } - }); + const pubkey = { + typeUrl: "/cosmos.crypto.secp256k1.PubKey", + value: new Uint8Array([ + ...new Uint8Array([10, 33]), + ...new Uint8Array(Buffer.from(publicKey, "hex")), + ]), + }; const unsignedPayload = await buildTransaction(account, transaction); const msgs = unsignedPayload.map((msg) => aminoTypes.toAmino(msg)); // Note: - // We don't use Cosmos App, - // Cosmos App support legacy StdTx and required to be ordered in a strict way, - // Cosmos API expects a different sorting, resulting in a separate signature. - // https://github.com/LedgerHQ/app-cosmos/blob/6c194daa28936e273f9548eabca9e72ba04bb632/app/src/tx_parser.c#L52 - - // Cosmos App sign data in Amino way only, not Protobuf. + // Cosmos Nano App sign data in Amino way only, not Protobuf. // This is a legacy outdated standard and a long-term blocking point. - // @ledgerhq/hw-app-cosmos don't allow to push message to device message converted - // by the AminoConverter from @cosmjs/stargate. There's two things who don't work: - // 1st, the way who message is sorted. - // 2nd, cast of numeric value (integer/numeric versus string). - - const signed = await ledgerSigner.signAmino(account.freshAddress, { + const message = { chain_id: chainId, account_number: accountNumber.toString(), sequence: sequence.toString(), @@ -92,17 +78,30 @@ const signOperation = ({ }, msgs: msgs, memo: transaction.memo || "", - }); + }; + + const { signature } = await hwApp.sign( + account.freshAddressPath, + JSON.stringify(sortedObject(message)) + ); + + if (!signature) { + throw new Error("Cosmos: no Signature Found"); + } + + const secp256k1Signature = Secp256k1Signature.fromDer( + new Uint8Array(signature) + ).toFixedLength(); const tx_bytes = await postBuildTransaction( account, transaction, pubkey, unsignedPayload, - new Uint8Array(Buffer.from(signed.signature.signature, "base64")) + secp256k1Signature ); - const signature = Buffer.from(tx_bytes).toString("hex"); + const signed = Buffer.from(tx_bytes).toString("hex"); if (cancelled) { return; @@ -169,7 +168,7 @@ const signOperation = ({ type: "signed", signedOperation: { operation, - signature, + signature: signed, expirationDate: null, }, }); @@ -186,4 +185,23 @@ const signOperation = ({ }) ); +const sortedObject = (obj) => { + if (typeof obj !== "object" || obj === null) { + return obj; + } + + if (Array.isArray(obj)) { + return obj.map(sortedObject); + } + + const sortedKeys = Object.keys(obj).sort(); + const result = {}; + + sortedKeys.forEach((key) => { + result[key] = sortedObject(obj[key]); + }); + + return result; +}; + export default signOperation; diff --git a/src/families/cosmos/validators.ts b/src/families/cosmos/validators.ts index 11946e1891..038fe79fbb 100644 --- a/src/families/cosmos/validators.ts +++ b/src/families/cosmos/validators.ts @@ -31,7 +31,7 @@ const cacheValidators = makeLRUCache( if (isStargate(currency)) { const url = `${getBaseApiUrl( currency - )}/${namespace}/staking/${version}/validators?status=BOND_STATUS_BONDED&pagination.limit=130`; + )}/${namespace}/staking/${version}/validators?status=BOND_STATUS_BONDED&pagination.limit=175`; const { data } = await network({ url, method: "GET", diff --git a/src/families/ripple/bridge.test.ts b/src/families/ripple/bridge.test.ts index 49a84d7914..7205f9914e 100644 --- a/src/families/ripple/bridge.test.ts +++ b/src/families/ripple/bridge.test.ts @@ -1,12 +1,6 @@ import { setup } from "../../__tests__/test-helpers/libcore-setup"; import { testBridge } from "../../__tests__/test-helpers/bridge"; import dataset from "./test-dataset"; -import { disconnect } from "../../api/Ripple"; - -// Disconnect all api clients that could be open. -afterAll(async () => { - await disconnect(); -}); setup("ripple"); testBridge("ripple", dataset); diff --git a/src/families/ripple/bridge/js.ts b/src/families/ripple/bridge/js.ts index 65a5faf389..9731aa22fb 100644 --- a/src/families/ripple/bridge/js.ts +++ b/src/families/ripple/bridge/js.ts @@ -1,77 +1,42 @@ /* eslint-disable no-param-reassign */ -import invariant from "invariant"; -import { BigNumber } from "bignumber.js"; -import { Observable } from "rxjs"; -import bs58check from "ripple-bs58check"; import { AmountRequired, - NotEnoughBalanceBecauseDestinationNotCreated, - NotEnoughSpendableBalance, - InvalidAddress, FeeNotLoaded, + FeeRequired, FeeTooHigh, - NetworkDown, + InvalidAddress, InvalidAddressBecauseDestinationIsAlsoSource, - FeeRequired, + NetworkDown, + NotEnoughBalanceBecauseDestinationNotCreated, + NotEnoughSpendableBalance, RecipientRequired, } from "@ledgerhq/errors"; -import type { Account, Operation, SignOperationEvent } from "../../../types"; -import { - getDerivationModesForCurrency, - getDerivationScheme, - runDerivationScheme, - isIterableDerivationMode, - derivationModeSupportsIndex, -} from "../../../derivation"; -import { formatCurrencyUnit } from "../../../currencies"; -import { patchOperationWithHash } from "../../../operation"; +import { BigNumber } from "bignumber.js"; +import invariant from "invariant"; +import bs58check from "ripple-bs58check"; +import { Observable } from "rxjs"; import { getMainAccount } from "../../../account"; -import { - getAccountPlaceholderName, - getNewAccountPlaceholderName, - emptyHistoryCache, -} from "../../../account"; -import getAddress from "../../../hw/getAddress"; -import { withDevice } from "../../../hw/deviceAccess"; -import { - parseAPIValue, - parseAPICurrencyObject, - formatAPICurrencyXRP, -} from "../../../api/Ripple"; -import type { CurrencyBridge, AccountBridge } from "../../../types/bridge"; -import signTransaction from "../../../hw/signTransaction"; -import type { Transaction, NetworkInfo } from "../types"; -import { makeAccountBridgeReceive, mergeOps } from "../../../bridge/jsHelpers"; -import { - preparePayment, - submit, +import getLedgerIndex, { getAccountInfo, getServerInfo, - getTransactions, + parseAPIValue, + submit, } from "../../../api/Ripple"; +import { makeAccountBridgeReceive } from "../../../bridge/jsHelpers"; +import { formatCurrencyUnit } from "../../../currencies"; +import signTransaction from "../../../hw/signTransaction"; +import { withDevice } from "../../../hw/deviceAccess"; +import { patchOperationWithHash } from "../../../operation"; +import type { Account, Operation, SignOperationEvent } from "../../../types"; +import type { AccountBridge, CurrencyBridge } from "../../../types/bridge"; +import { scanAccounts, sync } from "../js-synchronization"; +import type { NetworkInfo, Transaction } from "../types"; -// true if the error should be forwarded and is not a "not found" case -const checkAccountNotFound = (e) => { - return ( - !e.data || (e.message !== "actNotFound" && e.data.error !== "actNotFound") - ); -}; +export const NEW_ACCOUNT_ERROR_MESSAGE = "actNotFound"; +const LEDGER_OFFSET = 20; const receive = makeAccountBridgeReceive(); -const getSequenceNumber = async (account) => { - const lastOp = account.operations.find((op) => op.type === "OUT"); - - if (lastOp && lastOp.transactionSequenceNumber) { - return ( - lastOp.transactionSequenceNumber + account.pendingOperations.length + 1 - ); - } - - const info = await getAccountInfo(account.freshAddress); - return info.sequence + account.pendingOperations.length; -}; - const uint32maxPlus1 = new BigNumber(2).pow(32); const validateTag = (tag) => { @@ -84,6 +49,11 @@ const validateTag = (tag) => { ); }; +const getNextValidSequence = async (account: Account) => { + const accInfo = await getAccountInfo(account.freshAddress, true); + return accInfo.account_data.Sequence; +}; + const signOperation = ({ account, transaction, @@ -97,46 +67,36 @@ const signOperation = ({ if (!fee) throw new FeeNotLoaded(); async function main() { - const amount = formatAPICurrencyXRP(transaction.amount); - const tag = transaction.tag ? transaction.tag : undefined; - const payment = { - source: { - address: account.freshAddress, - amount, - }, - destination: { - address: transaction.recipient, - minAmount: amount, - tag, - }, - }; - const instruction = { - fee: formatAPICurrencyXRP(fee).value, - maxLedgerVersionOffset: 12, - }; - if (tag) - invariant( - validateTag(new BigNumber(tag)), - `tag is set but is not in a valid format, should be between [0 - ${uint32maxPlus1 - .minus(1) - .toString()}]` - ); - const prepared = await preparePayment( - account.freshAddress, - payment, - instruction - ); - let signature; - try { + const tag = transaction.tag ? transaction.tag : undefined; + const nextSequenceNumber = await getNextValidSequence(account); + const payment = { + TransactionType: "Payment", + Account: account.freshAddress, + Amount: transaction.amount.toString(), + Destination: transaction.recipient, + DestinationTag: tag, + Fee: fee.toString(), + Flags: 2147483648, + Sequence: nextSequenceNumber, + LastLedgerSequence: (await getLedgerIndex()) + LEDGER_OFFSET, + }; + if (tag) + invariant( + validateTag(new BigNumber(tag)), + `tag is set but is not in a valid format, should be between [0 - ${uint32maxPlus1 + .minus(1) + .toString()}]` + ); + o.next({ type: "device-signature-requested", }); - signature = await signTransaction( + const signature = await signTransaction( account.currency, transport, account.freshAddressPath, - JSON.parse(prepared.txJSON) + payment ); o.next({ type: "device-signature-granted", @@ -155,15 +115,10 @@ const signOperation = ({ senders: [account.freshAddress], recipients: [transaction.recipient], date: new Date(), - // we probably can't get it so it's a predictive value - transactionSequenceNumber: await getSequenceNumber(account), + transactionSequenceNumber: nextSequenceNumber, extra: {} as any, }; - if (transaction.tag) { - operation.extra.tag = transaction.tag; - } - o.next({ type: "signed", signedOperation: { @@ -188,7 +143,9 @@ const signOperation = ({ }) ); -const broadcast = async ({ signedOperation: { signature, operation } }) => { +const broadcast = async ({ + signedOperation: { signature, operation }, +}): Promise => { const submittedPayment = await submit(signature); if ( @@ -202,7 +159,7 @@ const broadcast = async ({ signedOperation: { signature, operation } }) => { return patchOperationWithHash(operation, hash); }; -function isRecipientValid(recipient) { +function isRecipientValid(recipient: string): boolean { try { bs58check.decode(recipient); return true; @@ -211,125 +168,14 @@ function isRecipientValid(recipient) { } } -type Tx = { - type: string; - address: string; - sequence: number; - id: string; - specification: { - source: { - address: string; - maxAmount: { - currency: string; - value: string; - }; - }; - destination: { - address: string; - amount: { - currency: string; - value: string; - }; - tag?: string; - }; - paths: string; - }; - outcome: { - result: string; - fee: string; - timestamp: string; - deliveredAmount?: { - currency: string; - value: string; - counterparty: string; - }; - balanceChanges: Record< - string, - Array<{ - counterparty: string; - currency: string; - value: string; - }> - >; - orderbookChanges: Record< - string, - Array<{ - direction: string; - quantity: { - currency: string; - value: string; - }; - totalPrice: { - currency: string; - counterparty: string; - value: string; - }; - makeExchangeRate: string; - sequence: number; - status: string; - }> - >; - ledgerVersion: number; - indexInLedger: number; - }; -}; - -const txToOperation = - (account: Account) => - ({ - id, - sequence, - outcome: { fee, deliveredAmount, ledgerVersion, timestamp }, - specification: { source, destination }, - }: Tx): Operation | null | undefined => { - const type = source.address === account.freshAddress ? "OUT" : "IN"; - let value = deliveredAmount - ? parseAPICurrencyObject(deliveredAmount) - : new BigNumber(0); - const feeValue = parseAPIValue(fee); - - if (type === "OUT") { - if (!Number.isNaN(feeValue)) { - value = value.plus(feeValue); - } - } - - const op: Operation = { - id: `${account.id}-${id}-${type}`, - hash: id, - accountId: account.id, - type, - value, - fee: feeValue, - blockHash: null, - blockHeight: ledgerVersion, - senders: [source.address], - recipients: [destination.address], - date: new Date(timestamp), - transactionSequenceNumber: sequence, - extra: {}, - }; - - if (destination.tag) { - op.extra.tag = destination.tag; - } - - return op; - }; - -const recipientIsNew = async (endpointConfig, recipient) => { +const recipientIsNew = async (recipient: string): Promise => { if (!isRecipientValid(recipient)) return false; - try { - await getAccountInfo(recipient, endpointConfig); - return false; - } catch (e) { - if (checkAccountNotFound(e)) { - throw e; - } - + const info = await getAccountInfo(recipient); + if (info.error === NEW_ACCOUNT_ERROR_MESSAGE) { return true; } + return false; }; // FIXME this could be cleaner @@ -348,284 +194,18 @@ const remapError = (error) => { const cacheRecipientsNew = {}; -const cachedRecipientIsNew = (endpointConfig, recipient) => { +const cachedRecipientIsNew = (recipient: string) => { if (recipient in cacheRecipientsNew) return cacheRecipientsNew[recipient]; - cacheRecipientsNew[recipient] = recipientIsNew(endpointConfig, recipient); + cacheRecipientsNew[recipient] = recipientIsNew(recipient); return cacheRecipientsNew[recipient]; }; const currencyBridge: CurrencyBridge = { preload: () => Promise.resolve({}), hydrate: () => {}, - scanAccounts: ({ currency, deviceId }) => - withDevice(deviceId)( - (transport) => - new Observable((o) => { - let finished = false; - - const unsubscribe = () => { - finished = true; - }; - - async function main() { - try { - const serverInfo = await getServerInfo(); - const ledgers = serverInfo.completeLedgers.split("-"); - const minLedgerVersion = Number(ledgers[0]); - const maxLedgerVersion = Number(ledgers[1]); - const derivationModes = getDerivationModesForCurrency(currency); - - for (const derivationMode of derivationModes) { - const derivationScheme = getDerivationScheme({ - derivationMode, - currency, - }); - const stopAt = isIterableDerivationMode(derivationMode) - ? 255 - : 1; - - for (let index = 0; index < stopAt; index++) { - if (!derivationModeSupportsIndex(derivationMode, index)) - continue; - const freshAddressPath = runDerivationScheme( - derivationScheme, - currency, - { - account: index, - } - ); - const { address } = await getAddress(transport, { - currency, - path: freshAddressPath, - derivationMode, - }); - if (finished) return; - const accountId = `ripplejs:2:${currency.id}:${address}:${derivationMode}`; - let info; - - try { - info = await getAccountInfo(address); - } catch (e) { - if (checkAccountNotFound(e)) { - throw e; - } - } - - // fresh address is address. ripple never changes. - const freshAddress = address; - - if (!info) { - // account does not exist in Ripple server - // we are generating a new account locally - if (derivationMode === "") { - o.next({ - type: "discovered", - account: { - type: "Account", - id: accountId, - seedIdentifier: freshAddress, - derivationMode, - name: getNewAccountPlaceholderName({ - currency, - index, - derivationMode, - }), - starred: false, - used: false, - freshAddress, - freshAddressPath, - freshAddresses: [ - { - address: freshAddress, - derivationPath: freshAddressPath, - }, - ], - balance: new BigNumber(0), - spendableBalance: new BigNumber(0), - blockHeight: maxLedgerVersion, - index, - currency, - operationsCount: 0, - operations: [], - pendingOperations: [], - unit: currency.units[0], - // @ts-expect-error archived does not exists on type Account - archived: false, - lastSyncDate: new Date(), - creationDate: new Date(), - swapHistory: [], - balanceHistoryCache: emptyHistoryCache, // calculated in the jsHelpers - }, - }); - } - - break; - } - - if (finished) return; - const balance = parseAPIValue(info.xrpBalance); - invariant( - !balance.isNaN() && balance.isFinite(), - `Ripple: invalid balance=${balance.toString()} for address ${address}` - ); - const transactions = await getTransactions(address, { - minLedgerVersion, - maxLedgerVersion, - types: ["payment"], - }); - if (finished) return; - const account: Account = { - type: "Account", - id: accountId, - seedIdentifier: freshAddress, - derivationMode, - name: getAccountPlaceholderName({ - currency, - index, - derivationMode, - }), - starred: false, - used: true, - freshAddress, - freshAddressPath, - freshAddresses: [ - { - address: freshAddress, - derivationPath: freshAddressPath, - }, - ], - balance, - spendableBalance: balance, - // TODO calc with base reserve - blockHeight: maxLedgerVersion, - index, - currency, - operationsCount: 0, - operations: [], - pendingOperations: [], - unit: currency.units[0], - lastSyncDate: new Date(), - creationDate: new Date(), - swapHistory: [], - balanceHistoryCache: emptyHistoryCache, // calculated in the jsHelpers - }; - account.operations = transactions - .map(txToOperation(account)) - .filter(Boolean); - account.operationsCount = account.operations.length; - - if (account.operations.length > 0) { - account.creationDate = - account.operations[account.operations.length - 1].date; - } - - o.next({ - type: "discovered", - account, - }); - } - } - - o.complete(); - } catch (e) { - o.error(e); - } - } - - main(); - return unsubscribe; - }) - ), + scanAccounts, }; -const sync = ({ - endpointConfig, - freshAddress, - blockHeight, - operations, -}: any): Observable<(arg0: Account) => Account> => - new Observable((o) => { - let finished = false; - const currentOpsLength = operations ? operations.length : 0; - - const unsubscribe = () => { - finished = true; - }; - - async function main() { - try { - if (finished) return; - const serverInfo = await getServerInfo(endpointConfig); - if (finished) return; - const ledgers = serverInfo.completeLedgers.split("-"); - const minLedgerVersion = Number(ledgers[0]); - const maxLedgerVersion = Number(ledgers[1]); - let info; - - try { - info = await getAccountInfo(freshAddress); - } catch (e) { - if (checkAccountNotFound(e)) { - throw e; - } - } - - if (finished) return; - - if (!info) { - // account does not exist, we have nothing to sync but to update the last sync date - o.next((a) => ({ ...a, lastSyncDate: new Date() })); - o.complete(); - return; - } - - const balance = parseAPIValue(info.xrpBalance); - invariant( - !balance.isNaN() && balance.isFinite(), - `Ripple: invalid balance=${balance.toString()} for address ${freshAddress}` - ); - const transactions = await getTransactions(freshAddress, { - minLedgerVersion: Math.max( - currentOpsLength === 0 ? 0 : blockHeight, // if there is no ops, it might be after a clear and we prefer to pull from the oldest possible history - minLedgerVersion - ), - maxLedgerVersion, - types: ["payment"], - }); - if (finished) return; - o.next((a) => { - const newOps = transactions.map(txToOperation(a)); - const operations = mergeOps(a.operations, newOps); - const [last] = operations; - const pendingOperations = a.pendingOperations.filter( - (oo) => - !operations.some((op) => oo.hash === op.hash) && - last && - last.transactionSequenceNumber && - oo.transactionSequenceNumber && - oo.transactionSequenceNumber > last.transactionSequenceNumber - ); - return { - ...a, - balance, - spendableBalance: balance, - // TODO use reserve - operations, - pendingOperations, - blockHeight: maxLedgerVersion, - lastSyncDate: new Date(), - }; - }); - o.complete(); - } catch (e) { - o.error(remapError(e)); - } - } - - main(); - return unsubscribe; - }); - const createTransaction = (): Transaction => ({ family: "ripple", amount: new BigNumber(0), @@ -636,15 +216,23 @@ const createTransaction = (): Transaction => ({ feeCustomUnit: null, }); -const updateTransaction = (t, patch) => ({ ...t, ...patch }); +const updateTransaction = ( + t: Transaction, + patch: Transaction +): Transaction => ({ ...t, ...patch }); -const prepareTransaction = async (a: Account, t: Transaction) => { +const prepareTransaction = async ( + a: Account, + t: Transaction +): Promise => { let networkInfo: NetworkInfo | null | undefined = t.networkInfo; if (!networkInfo) { try { const info = await getServerInfo(a.endpointConfig); - const serverFee = parseAPIValue(info.validatedLedger.baseFeeXRP); + const serverFee = parseAPIValue( + info.info.validated_ledger.base_fee_xrp.toString() + ); networkInfo = { family: "ripple", serverFee, @@ -664,7 +252,7 @@ const prepareTransaction = async (a: Account, t: Transaction) => { return t; }; -const getTransactionStatus = async (a, t) => { +const getTransactionStatus = async (a: Account, t: Transaction) => { const errors: { fee?: Error; amount?: Error; @@ -674,7 +262,9 @@ const getTransactionStatus = async (a, t) => { feeTooHigh?: Error; } = {}; const r = await getServerInfo(a.endpointConfig); - const reserveBaseXRP = parseAPIValue(r.validatedLedger.reserveBaseXRP); + const reserveBaseXRP = parseAPIValue( + r.info.validated_ledger.reserve_base_xrp.toString() + ); const estimatedFees = new BigNumber(t.fee || 0); const totalSpent = new BigNumber(t.amount).plus(estimatedFees); const amount = new BigNumber(t.amount); @@ -697,12 +287,15 @@ const getTransactionStatus = async (a, t) => { }); } else if ( t.recipient && - (await cachedRecipientIsNew(a.endpointConfig, t.recipient)) && + (await cachedRecipientIsNew(t.recipient)) && t.amount.lt(reserveBaseXRP) ) { - const f = formatAPICurrencyXRP(reserveBaseXRP); errors.amount = new NotEnoughBalanceBecauseDestinationNotCreated("", { - minimalAmount: `${f.currency} ${new BigNumber(f.value).toFixed()}`, + minimalAmount: formatCurrencyUnit(a.currency.units[0], reserveBaseXRP, { + disableRounding: true, + useGrouping: false, + showCode: true, + }), }); } @@ -737,10 +330,12 @@ const estimateMaxSpendable = async ({ account, parentAccount, transaction, -}) => { +}): Promise => { const mainAccount = getMainAccount(account, parentAccount); const r = await getServerInfo(mainAccount.endpointConfig); - const reserveBaseXRP = parseAPIValue(r.validatedLedger.reserveBaseXRP); + const reserveBaseXRP = parseAPIValue( + r.info.validated_ledger.reserve_base_xrp.toString() + ); const t = await prepareTransaction(mainAccount, { ...createTransaction(), ...transaction, @@ -761,7 +356,7 @@ const accountBridge: AccountBridge = { prepareTransaction, getTransactionStatus, estimateMaxSpendable, - sync, + sync: sync, receive, signOperation, broadcast, diff --git a/src/families/ripple/js-synchronization.ts b/src/families/ripple/js-synchronization.ts new file mode 100644 index 0000000000..3e24ca7a5f --- /dev/null +++ b/src/families/ripple/js-synchronization.ts @@ -0,0 +1,153 @@ +import BigNumber from "bignumber.js"; +import { + getAccountInfo, + getServerInfo, + getTransactions, +} from "../../api/Ripple"; +import { + GetAccountShape, + makeScanAccounts, + makeSync, + mergeOps, +} from "../../bridge/jsHelpers"; +import { encodeOperationId } from "../../operation"; +import { Account, Operation } from "../../types"; +import { encodeAccountId } from "../../account"; +import { NEW_ACCOUNT_ERROR_MESSAGE } from "./bridge/js"; +import { TxXRPL } from "./types.api"; + +const txToOperation = + (accountId: string, address: string) => + ({ + meta: { delivered_amount }, + tx: { + DestinationTag, + Fee, + hash, + inLedger, + date, + Account, + Destination, + Sequence, + }, + }: TxXRPL): Operation | null | undefined => { + const type = Account === address ? "OUT" : "IN"; + let value = + delivered_amount && typeof delivered_amount === "string" + ? new BigNumber(delivered_amount) + : new BigNumber(0); + const feeValue = new BigNumber(Fee); + + if (type === "OUT") { + if (!Number.isNaN(feeValue)) { + value = value.plus(feeValue); + } + } + + // https://xrpl.org/basic-data-types.html#specifying-time + const toEpochDate = (946684800 + date) * 1000; + + const op: Operation = { + id: encodeOperationId(accountId, hash, type), + hash: hash, + accountId: accountId, + type, + value, + fee: feeValue, + blockHash: null, + blockHeight: inLedger, + senders: [Account], + recipients: [Destination], + date: new Date(toEpochDate), + transactionSequenceNumber: Sequence, + extra: {}, + }; + + if (DestinationTag) { + op.extra.tag = DestinationTag; + } + + return op; + }; + +const filterOperations: any = ( + transactions: TxXRPL[], + accountId: string, + address: string +) => { + return transactions + .filter( + (tx: TxXRPL) => + tx.tx.TransactionType === "Payment" && + typeof tx.meta.delivered_amount === "string" + ) + .map(txToOperation(accountId, address)) + .filter(Boolean); +}; + +const getAccountShape: GetAccountShape = async ( + info +): Promise> => { + const { address, initialAccount, currency, derivationMode } = info; + const accountId = encodeAccountId({ + type: "js", + version: "2", + currencyId: currency.id, + xpubOrAddress: address, + derivationMode, + }); + const accountInfo = await getAccountInfo(address); + + if (!accountInfo || accountInfo.error === NEW_ACCOUNT_ERROR_MESSAGE) { + return { + id: accountId, + xpub: address, + blockHeight: 0, + balance: new BigNumber(0), + spendableBalance: new BigNumber(0), + operations: [], + operationsCount: 0, + }; + } + + const serverInfo = await getServerInfo(); + + const oldOperations = initialAccount?.operations || []; + const startAt = oldOperations.length + ? (oldOperations[0].blockHeight || 0) + 1 + : 0; + + const ledgers = serverInfo.info.complete_ledgers.split("-"); + const minLedgerVersion = Number(ledgers[0]); + const maxLedgerVersion = Number(ledgers[1]); + + const balance = new BigNumber(accountInfo.account_data.Balance); + + const newTransactions = + (await getTransactions(address, { + ledger_index_min: Math.max( + startAt, // if there is no ops, it might be after a clear and we prefer to pull from the oldest possible history + minLedgerVersion + ), + ledger_index_max: maxLedgerVersion, + })) || []; + + const newOperations = filterOperations(newTransactions, accountId, address); + + const operations = mergeOps(oldOperations, newOperations as Operation[]); + + const shape = { + id: accountId, + xpub: address, + blockHeight: maxLedgerVersion, + balance, + spendableBalance: balance, + operations, + operationsCount: operations.length, + }; + + return shape; +}; + +export const scanAccounts = makeScanAccounts({ getAccountShape }); +export const sync = makeSync({ getAccountShape }); diff --git a/src/families/ripple/test-dataset.ts b/src/families/ripple/test-dataset.ts index ff3d35f805..1c3fb5cdbf 100644 --- a/src/families/ripple/test-dataset.ts +++ b/src/families/ripple/test-dataset.ts @@ -23,6 +23,8 @@ const dataset: DatasetTest = { unstableAccounts: true, // our account is getting spammed... apdus: ` + => e00200400d038000002c8000009080000000 + <= 2103c73f64083463fa923e1530af6f558204853873c6a45cbfb1f2f1e2ac2a5d989c2272734a4675764165634c333153513750594864504b6b3335625a456f78446d5231789000 => e002004015058000002c80000090800000000000000000000000 <= 2103d1adcff3e0cf1232b1416a75cd6f23b49dd6a25c69bc291a1f6783ec6825ec062272616765584842365134566276765764547a4b414e776a65435434485846434b58379000 => e002004015058000002c80000090800000010000000000000000 diff --git a/src/families/ripple/types.api.ts b/src/families/ripple/types.api.ts new file mode 100644 index 0000000000..34a359d16f --- /dev/null +++ b/src/families/ripple/types.api.ts @@ -0,0 +1,23 @@ +interface Currency { + currency: string; + amount: string; +} + +export interface TxXRPL { + meta: { + TransactionResult: string; + delivered_amount: Currency | string; + }; + tx: { + TransactionType: string; + Fee: string; + Account: string; + Destination: string; + DestinationTag?: number; + Amount: string; + Sequence: number; + date: number; + inLedger: number; + hash: string; + }; +} diff --git a/src/featureFlags/defaultFeatures.ts b/src/featureFlags/defaultFeatures.ts index 0c98ed133e..f7c4a9640d 100644 --- a/src/featureFlags/defaultFeatures.ts +++ b/src/featureFlags/defaultFeatures.ts @@ -7,4 +7,51 @@ export const defaultFeatures: DefaultFeatures = { pushNotifications: { enabled: false, }, + ratings: { + enabled: false, + params: { + happy_moments: [ + { + route_name: "ReceiveConfirmation", + timer: 2000, + type: "on_enter", + }, + { + route_name: "ClaimRewardsValidationSuccess", + timer: 2000, + type: "on_enter", + }, + { + route_name: "SendValidationSuccess", + timer: 2000, + type: "on_enter", + }, + { + route_name: "MarketDetail", + timer: 3000, + type: "on_enter", + }, + ], + conditions: { + not_now_delay: { + days: 15, + }, + disappointed_delay: { + days: 90, + }, + satisfied_then_not_now_delay: { + days: 3, + }, + minimum_accounts_number: 3, + minimum_app_starts_number: 3, + minimum_duration_since_app_first_start: { + days: 3, + }, + minimum_number_of_app_starts_since_last_crash: 2, + }, + typeform_url: + "https://form.typeform.com/to/Jo7gqcB4?typeform-medium=embed-sdk&typeform-medium-version=next&typeform-embed=popup-blank", + support_email: "support@ledger.com", + }, + }, }; diff --git a/src/featureFlags/types.ts b/src/featureFlags/types.ts index c7f0f88cae..e4349b3160 100644 --- a/src/featureFlags/types.ts +++ b/src/featureFlags/types.ts @@ -1,10 +1,16 @@ // Add others with union (e.g. "learn" | "market" | "foo") -export type FeatureId = "learn" | "pushNotifications"; +export type FeatureId = + | "learn" + | "pushNotifications" + | "llmUsbFirmwareUpdate" + | "ratings" + | string; // We use objects instead of direct booleans for potential future improvements // like feature versioning etc export type Feature = { enabled: boolean; + params?: any; }; export type DefaultFeatures = { [key in FeatureId]: Feature }; diff --git a/src/platform/providers/GlobalCatalogProvider/api/mock.json b/src/platform/providers/GlobalCatalogProvider/api/mock.json index e93fc94a67..eef99bd452 100644 --- a/src/platform/providers/GlobalCatalogProvider/api/mock.json +++ b/src/platform/providers/GlobalCatalogProvider/api/mock.json @@ -83,32 +83,6 @@ "tags": [], "categories": [] }, - { - "appId": "Card", - "type": "LIVE_APP", - "tags": [ - "card" - ], - "categories": [ - "spend" - ], - "platform": "all", - "branch": "stable", - "currencies": "*" - }, - { - "appId": "cl-card", - "type": "LIVE_APP", - "tags": [ - "card" - ], - "categories": [ - "spend" - ], - "platform": "all", - "branch": "stable", - "currencies": "*" - }, { "appId": "moonpay", "type": "LIVE_APP", diff --git a/src/platform/providers/RemoteLiveAppProvider/api/mock.json b/src/platform/providers/RemoteLiveAppProvider/api/mock.json index 2224768fba..4038e2463b 100644 --- a/src/platform/providers/RemoteLiveAppProvider/api/mock.json +++ b/src/platform/providers/RemoteLiveAppProvider/api/mock.json @@ -1,67 +1,4 @@ [ - { - "id": "Card", - "name": "Card", - "url": "https://cl-cards.com/waiting-list/", - "homepageUrl": "https://baanx.com/", - "icon": "https://cdn.live.ledger.com/icons/platform/card2.png", - "platform": "all", - "apiVersion": "0.0.1", - "manifestVersion": "1", - "branch": "stable", - "categories": [ - "card" - ], - "currencies": "*", - "content": { - "shortDescription": { - "en": "Coming soon: spend your crypto globally with the crypto debit CL Card, powered by Ledger. Built to be compatible with your Ledger wallet. Join the waitlist" - }, - "description": { - "en": "Coming soon: spend your crypto globally with the crypto debit CL Card, powered by Ledger. Built to be compatible with your Ledger wallet. Join the waitlist" - } - }, - "permissions": [ - { - "method": "*" - } - ], - "domains": [ - "https://*" - ] - }, - { - "id": "cl-card", - "name": "Card", - "url": "https://cl-cards.com/waiting-list/", - "homepageUrl": "https://baanx.com/", - "icon": "https://cdn.live.ledger.com/icons/platform/card2.png", - "platform": "all", - "apiVersion": "0.0.1", - "manifestVersion": "1", - "private": true, - "branch": "stable", - "categories": [ - "card" - ], - "currencies": "*", - "content": { - "shortDescription": { - "en": "Coming soon: spend your crypto globally with the crypto debit CL Card, powered by Ledger. Built to be compatible with your Ledger wallet. Join the waitlist" - }, - "description": { - "en": "Coming soon: spend your crypto globally with the crypto debit CL Card, powered by Ledger. Built to be compatible with your Ledger wallet. Join the waitlist" - } - }, - "permissions": [ - { - "method": "*" - } - ], - "domains": [ - "https://*" - ] - }, { "id": "moonpay", "name": "MoonPay", diff --git a/src/types/nft.ts b/src/types/nft.ts index e4438383a1..1c2c356288 100644 --- a/src/types/nft.ts +++ b/src/types/nft.ts @@ -36,7 +36,7 @@ export type NFT = Omit & { metadata: NFTMetadata; }; -export type NFTMetadataLinksProviders = "opensea" | "rarible" | "etherscan"; +export type NFTMetadataLinksProviders = "opensea" | "rarible" | "explorer"; export type NFTMetadataResponse = { status: 200 | 404 | 500; diff --git a/tools/yarn.lock b/tools/yarn.lock index bb67086465..e50b120913 100644 --- a/tools/yarn.lock +++ b/tools/yarn.lock @@ -1946,17 +1946,28 @@ dependencies: commander "^2.20.0" -"@ledgerhq/cryptoassets@6.8.1", "@ledgerhq/cryptoassets@^6.8.1": - version "6.8.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/cryptoassets/-/cryptoassets-6.8.1.tgz#c3b73adc85cdc1b65bbc26a8553b85df7da4827b" - integrity sha512-Y74IGjxqRUZPexpFV5DOc0jJxt+qO/YXPd3xLXcjc5sOBpqi541ob7gw6TN1/2d9YAfpjJN7feYNCl3/6ZxoTg== +"@ledgerhq/cryptoassets@6.28.0", "@ledgerhq/cryptoassets@^6.27.0": + version "6.28.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/cryptoassets/-/cryptoassets-6.28.0.tgz#218a41c5184a176ceb3ec16dc21b37589f673c08" + integrity sha512-j3fBnjsOi2qijWO7p/PNoiEHdzjxP849pO02Q4YWW4Ms4lByv7ysmNLMwrset91We2yyVrdHsjdWY8X5JE97qQ== dependencies: invariant "2" +"@ledgerhq/devices@6.24.1", "@ledgerhq/devices@^6.24.1": + version "6.24.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-6.24.1.tgz#9696d7831aa1a1a8204cdfa55df13f892b7da162" + integrity sha512-6SNXWXxojUF6WKXMVIbRs15Mveg+9k0RKJK/PKlwZh929Lnr/NcbONWdwPjWKZAp1g82eEPT4jIkG6qc4QXlcA== + dependencies: + "@ledgerhq/errors" "^6.10.0" + "@ledgerhq/logs" "^6.10.0" + rxjs "6" + semver "^7.3.5" + "@ledgerhq/devices@6.7.0", "@ledgerhq/devices@^6.7.0": version "6.7.0" resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-6.7.0.tgz#90e8fef16e6d039dec64e8a7f1874031578e1973" integrity sha512-FWJfmdl8V300++OXLgBLpIi+IJoR/srWvxpXrWkc9hd3cNMxgeCl9opm84Y0oJDLBQL9AaERMrb+Cb1nZZR9Tw== + dependencies: "@ledgerhq/errors" "^6.2.0" "@ledgerhq/logs" "^6.2.0" @@ -3845,9 +3856,9 @@ async-limiter@~1.0.0: integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== async@^2.6.2: - version "2.6.3" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" - integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg== + version "2.6.4" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.4.tgz#706b7ff6084664cd7eae713f6f965433b5504221" + integrity sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA== dependencies: lodash "^4.17.14" diff --git a/yarn.lock b/yarn.lock index edae6d30e6..932bd14be0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -270,13 +270,20 @@ core-js-pure "^3.20.2" regenerator-runtime "^0.13.4" -"@babel/runtime@^7.10.2", "@babel/runtime@^7.10.4", "@babel/runtime@^7.10.5", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.15.4", "@babel/runtime@^7.16.3", "@babel/runtime@^7.17.2", "@babel/runtime@^7.9.2": +"@babel/runtime@^7.10.2", "@babel/runtime@^7.10.4", "@babel/runtime@^7.10.5", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.15.4", "@babel/runtime@^7.16.3", "@babel/runtime@^7.9.2": version "7.17.2" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.17.2.tgz#66f68591605e59da47523c631416b18508779941" integrity sha512-hzeyJyMA1YGdJTuWU0e/j4wKXrU4OMFvY2MSlaI9B7VQb0r5cxTE3EAIS2Q7Tn2RIcDkRvTA/v2JsAEhxe99uw== dependencies: regenerator-runtime "^0.13.4" +"@babel/runtime@^7.17.9": + version "7.17.9" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.17.9.tgz#d19fbf802d01a8cb6cf053a64e472d42c434ba72" + integrity sha512-lSiBBvodq29uShpWGNbgFdKYNiFDo5/HIYsaCEY9ff4sb10x9jizo2+pRrSyF4jKZCXqgzuqBOQKbUm90gQwJg== + dependencies: + regenerator-runtime "^0.13.4" + "@babel/template@^7.16.7", "@babel/template@^7.3.3": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.7.tgz#8d126c8701fde4d66b264b3eba3d96f07666d155" @@ -482,6 +489,16 @@ "@cosmjs/math" "^0.25.6" "@cosmjs/utils" "^0.25.6" +"@cosmjs/amino@^0.28.4": + version "0.28.4" + resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.28.4.tgz#9315f6876dba80148cf715ced44d1dc7a9b68b94" + integrity sha512-b8y5gFC0eGrH0IoYSNtDmTdsTgeQ1KFZ5YVOeIiKmzF91MeiciYO/MNqc027kctacZ+UbnVWGEUGyRBPi9ta/g== + dependencies: + "@cosmjs/crypto" "0.28.4" + "@cosmjs/encoding" "0.28.4" + "@cosmjs/math" "0.28.4" + "@cosmjs/utils" "0.28.4" + "@cosmjs/crypto@0.26.6", "@cosmjs/crypto@^0.26.5": version "0.26.6" resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.26.6.tgz#4ee84e8707406a951a43eac34ffc83ff6c6030f3" @@ -498,6 +515,19 @@ ripemd160 "^2.0.2" sha.js "^2.4.11" +"@cosmjs/crypto@0.28.4": + version "0.28.4" + resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.28.4.tgz#b2f1ccb9edee7d357ed1dcd92bdb61f6a1ca06d3" + integrity sha512-JRxNLlED3DDh9d04A0RcRw3mYkoobN7q7wafUFy3vI1TjoyWx33v0gqqaYE6/hoo9ghUrJSVOfzVihl8fZajJA== + dependencies: + "@cosmjs/encoding" "0.28.4" + "@cosmjs/math" "0.28.4" + "@cosmjs/utils" "0.28.4" + "@noble/hashes" "^1" + bn.js "^5.2.0" + elliptic "^6.5.3" + libsodium-wrappers "^0.7.6" + "@cosmjs/crypto@^0.24.1": version "0.24.1" resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.24.1.tgz#62da59c32b26344f26b10dd31a02b93655586d04" @@ -550,6 +580,15 @@ bech32 "^1.1.4" readonly-date "^1.0.0" +"@cosmjs/encoding@0.28.4": + version "0.28.4" + resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.28.4.tgz#ea39eb4c27ebf7b35e62e9898adae189b86d0da7" + integrity sha512-N6Qnjs4dd8KwjW5m9t3L+rWYYGW2wyS+iLtJJ9DD8DiTTxpW9h7/AmUVO/dsRe5H2tV8/DzH/B9pFfpsgro22A== + dependencies: + base64-js "^1.3.0" + bech32 "^1.1.4" + readonly-date "^1.0.0" + "@cosmjs/encoding@^0.24.1": version "0.24.1" resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.24.1.tgz#b30e92cdb70fc200a163b8c7aa5254606c8a09ab" @@ -596,19 +635,6 @@ axios "^0.21.1" fast-deep-equal "^3.1.3" -"@cosmjs/ledger-amino@^0.26.5": - version "0.26.6" - resolved "https://registry.yarnpkg.com/@cosmjs/ledger-amino/-/ledger-amino-0.26.6.tgz#4fd342229f3de3059e193f8db3f88877074aabe0" - integrity sha512-L5KDfEq7EswV4ku2SbWlozfKVv9WJWtap4/7SMXKH0XrYWOIz0AYeBfM0OGtJQjuHAiD/1QJ8pam/kjUL3+quQ== - dependencies: - "@cosmjs/amino" "0.26.6" - "@cosmjs/crypto" "0.26.6" - "@cosmjs/encoding" "0.26.6" - "@cosmjs/math" "0.26.6" - "@cosmjs/utils" "0.26.6" - ledger-cosmos-js "^2.1.8" - semver "^7.3.2" - "@cosmjs/math@0.23.1": version "0.23.1" resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.23.1.tgz#706f38742a9a1f6561cf2c4510f8e5ab001fc5e6" @@ -623,6 +649,13 @@ dependencies: bn.js "^4.11.8" +"@cosmjs/math@0.28.4": + version "0.28.4" + resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.28.4.tgz#ddc35b69fa1ffeaf5928f70d4c2faf9284627d84" + integrity sha512-wsWjbxFXvk46Dsx8jQ5vsBZOIQuiUIyaaZbUvxsgIhAMpuuBnV5O/drK87+B+4cL+umTelFqTbWnkqueVCIFxQ== + dependencies: + bn.js "^5.2.0" + "@cosmjs/math@^0.24.1": version "0.24.1" resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.24.1.tgz#9eed507885aacc9b269441fc9ecb00fb5876883a" @@ -785,6 +818,11 @@ resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.26.6.tgz#134ef1ea0675580c2cc7524589d09f3d42c678a7" integrity sha512-Zx60MMI1vffX8c2UbUMlszrGIug3TWa25bD7NF3blJ5k/MVCZFsPafEZ+jEi7kcqoxdhMhgJTI6AmUhnMfq9SQ== +"@cosmjs/utils@0.28.4": + version "0.28.4" + resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.28.4.tgz#ecbc72458cdaffa6eeef572bc691502b3151330f" + integrity sha512-lb3TU6833arPoPZF8HTeG9V418CpurvqH5Aa/ls0I0wYdPDEMO6622+PQNQhQ8Vw8Az2MXoSyc8jsqrgawT84Q== + "@cosmjs/utils@^0.24.1": version "0.24.1" resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.24.1.tgz#0adfefe63b7f17222bc2bc12f71296f35e7ad378" @@ -1308,10 +1346,10 @@ dependencies: commander "^2.20.0" -"@ledgerhq/cryptoassets@6.28.1", "@ledgerhq/cryptoassets@^6.28.1": - version "6.28.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/cryptoassets/-/cryptoassets-6.28.1.tgz#a053cea8354a070b6303e5c7430152fb8ff76d36" - integrity sha512-FMbgurSw2YUIL7Ypdf/t6VSlt0gNYS9W3LTB3CQeneo7ZLtryJaPo093tu+afbDPXpZcR4W5D5sTRMBJHr9jKA== +"@ledgerhq/cryptoassets@6.28.2", "@ledgerhq/cryptoassets@^6.28.2": + version "6.28.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/cryptoassets/-/cryptoassets-6.28.2.tgz#fabc77c46830348d121452976cdcc19908e0acb2" + integrity sha512-i+33VVNE+54HrC0mHly6JXWO6Th+/7n7vNpxjhUQq+1IL3K/ex1HUCwB61O/siDInjq7OZ1Roq9CEx7tAsED2Q== dependencies: invariant "2" @@ -1383,14 +1421,14 @@ "@ledgerhq/hw-transport" "^6.27.1" bip32-path "^0.4.2" -"@ledgerhq/hw-app-eth@6.28.1": - version "6.28.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-eth/-/hw-app-eth-6.28.1.tgz#5c5220a9b9354418ef446064a89303745e926918" - integrity sha512-GEB9TPCaJsObotRe5ADKrSxdFftwT97tJ4fZGXw1eoi1TZQyyki+v95cb//EsWyw3CxqqJVpYvGmL/AHEMdDrw== +"@ledgerhq/hw-app-eth@6.28.2": + version "6.28.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-eth/-/hw-app-eth-6.28.2.tgz#06fd19b9277442f4eb58ed76f4bc8299acd15a81" + integrity sha512-/pGJW5QKsci5mkjcUeP8RvDw4sV9gldp7RWKTKlkldqeRh2kV75bAdStL2p99fGdDfGkfYotpTfm3oOXQpOwiQ== dependencies: "@ethersproject/abi" "^5.5.0" "@ethersproject/rlp" "^5.5.0" - "@ledgerhq/cryptoassets" "^6.28.1" + "@ledgerhq/cryptoassets" "^6.28.2" "@ledgerhq/errors" "^6.10.0" "@ledgerhq/hw-transport" "^6.27.1" "@ledgerhq/logs" "^6.10.0" @@ -1487,7 +1525,7 @@ "@ledgerhq/errors" "^6.10.0" events "^3.3.0" -"@ledgerhq/hw-transport@^5.11.0", "@ledgerhq/hw-transport@^5.19.1", "@ledgerhq/hw-transport@^5.25.0", "@ledgerhq/hw-transport@^5.51.1": +"@ledgerhq/hw-transport@^5.11.0", "@ledgerhq/hw-transport@^5.19.1", "@ledgerhq/hw-transport@^5.51.1": version "5.51.1" resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-5.51.1.tgz#8dd14a8e58cbee4df0c29eaeef983a79f5f22578" integrity sha512-6wDYdbWrw9VwHIcoDnqWBaDFyviyjZWv6H9vz9Vyhe4Qd7TIFmbTl/eWs6hZvtZBza9K8y7zD8ChHwRI4s9tSw== @@ -1530,15 +1568,15 @@ resolved "https://registry.yarnpkg.com/@ledgerhq/logs/-/logs-5.50.0.tgz#29c6419e8379d496ab6d0426eadf3c4d100cd186" integrity sha512-swKHYCOZUGyVt4ge0u8a7AwNcA//h4nx5wIi0sruGye1IJ5Cva0GyK9L2/WdX+kWVTKp92ZiEo1df31lrWGPgA== -"@noble/hashes@1.0.0", "@noble/hashes@^1.0.0": +"@noble/hashes@1.0.0", "@noble/hashes@^1", "@noble/hashes@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.0.0.tgz#d5e38bfbdaba174805a4e649f13be9a9ed3351ae" integrity sha512-DZVbtY62kc3kkBtMHqwCOfXrT/hnoORy5BJ4+HU1IR59X0KWAOqsfzQPcUl/lQLlG7qXbe/fZ3r/emxtAl+sqg== -"@noble/secp256k1@1.5.2": - version "1.5.2" - resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.5.2.tgz#40399e4fba54f588fda14fc03a4499044fdcab24" - integrity sha512-5mzA40W2q55VCRuC9XzmkiEnODdY0c5a7qsK2QcOfI5/MuVQyBaWGQyE6YOEF7kDwp+tDVWGsCDVJUME+wsWWw== +"@noble/secp256k1@1.5.5": + version "1.5.5" + resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.5.5.tgz#315ab5745509d1a8c8e90d0bdf59823ccf9bcfc3" + integrity sha512-sZ1W6gQzYnu45wPrWx8D3kwI2/U29VYTx9OjbDAd7jwRItJ0cSTMPRL/C8AWZFn9kWFLQGqEXVEE86w4Z8LpIQ== "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -1561,169 +1599,169 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@polkadot/keyring@^8.4.1": - version "8.4.1" - resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-8.4.1.tgz#71098121c60a05e1ad33653fcc521c52f22ad1b8" - integrity sha512-0qfS7qikUxhe6LEdCOcMRdCxEa26inJ5aSUWaf5dXy+dgy9VJiov6uXAbXdAd1UHpDvr9hvw94FX+hXsJ7Vsyw== - dependencies: - "@babel/runtime" "^7.17.2" - "@polkadot/util" "8.4.1" - "@polkadot/util-crypto" "8.4.1" - -"@polkadot/networks@8.4.1", "@polkadot/networks@^8.4.1": - version "8.4.1" - resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-8.4.1.tgz#c22585edb38f5ae0a329a1f471577d8b35bf64e4" - integrity sha512-YFY3fPLbc1Uz9zsX4TOzjY/FF09nABMgrMkvqddrVbSgo71NvoBv3Gqw3mKV/7bX1Gzk1ODfvTzamdpsKEWSnA== - dependencies: - "@babel/runtime" "^7.17.2" - "@polkadot/util" "8.4.1" - "@substrate/ss58-registry" "^1.14.0" - -"@polkadot/types-augment@7.8.1": - version "7.8.1" - resolved "https://registry.yarnpkg.com/@polkadot/types-augment/-/types-augment-7.8.1.tgz#f790f3874384e3bd3a4850affb775c6d125f2ff3" - integrity sha512-uKDOlU6arH/Oz/faHq315tCA5vjIJTO/zQt0Iuz9woEbmXd6ga0vkCr3gXWfPvjg+QnMQuRpNG8rxtiX5w0vCw== - dependencies: - "@babel/runtime" "^7.17.2" - "@polkadot/types" "7.8.1" - "@polkadot/types-codec" "7.8.1" - "@polkadot/util" "^8.4.1" - -"@polkadot/types-codec@7.8.1": - version "7.8.1" - resolved "https://registry.yarnpkg.com/@polkadot/types-codec/-/types-codec-7.8.1.tgz#b42df0baeac7d424c4e5216752f7a630d95381fa" - integrity sha512-4et1ZiXXK/KsveKcXd0p1FwAYq8rwHmf1pyf1tOH9JglA/Ip6mArrIjivnfofxY5WFWgeuAv7b2+Rk5vGq/0Xw== - dependencies: - "@babel/runtime" "^7.17.2" - "@polkadot/util" "^8.4.1" - -"@polkadot/types-create@7.8.1": - version "7.8.1" - resolved "https://registry.yarnpkg.com/@polkadot/types-create/-/types-create-7.8.1.tgz#9b68e1f4bb3d71e4ed1eaa03119940e3e3952396" - integrity sha512-TxUFc3/WAzFHT1DIgzIssBKxtbjrSDe3GzHbOlJcIcLI17rLHFCVi53uDYvR9kMxterJ9MFMxXc76iqwnnXCgQ== - dependencies: - "@babel/runtime" "^7.17.2" - "@polkadot/types-codec" "7.8.1" - "@polkadot/util" "^8.4.1" - -"@polkadot/types-known@7.8.1": - version "7.8.1" - resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-7.8.1.tgz#1ed7ed5f5bdd5eb8816258753c1f0fa881a0c38f" - integrity sha512-qUTZq6B4tm+Gt3G/CvivZVHTD3NueTyNpv9/nEUWwOAmKgrZyJy7uLgGwHoqEjcXn+F86B3raIgp6WP+v8PibQ== - dependencies: - "@babel/runtime" "^7.17.2" - "@polkadot/networks" "^8.4.1" - "@polkadot/types" "7.8.1" - "@polkadot/types-codec" "7.8.1" - "@polkadot/types-create" "7.8.1" - "@polkadot/util" "^8.4.1" - -"@polkadot/types@7.8.1": - version "7.8.1" - resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-7.8.1.tgz#67ccf5f10fde4e47f007391f7c39c942cc12bdd8" - integrity sha512-B+b3q5qprJb6PJGiJ1r6FiXW6LxH2SOFXkTpcFpJeM2wBkJmeQoiEQ7M/r8kkrqtORptfsrxmhbjMr0xvUHZHA== - dependencies: - "@babel/runtime" "^7.17.2" - "@polkadot/keyring" "^8.4.1" - "@polkadot/types-augment" "7.8.1" - "@polkadot/types-codec" "7.8.1" - "@polkadot/types-create" "7.8.1" - "@polkadot/util" "^8.4.1" - "@polkadot/util-crypto" "^8.4.1" - rxjs "^7.5.4" - -"@polkadot/util-crypto@8.4.1", "@polkadot/util-crypto@^8.4.1": - version "8.4.1" - resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-8.4.1.tgz#41ff754dc995b681913fc0a484bb0d309221a703" - integrity sha512-mWjp83aIWw+EhKN9RkUDmubXibo25q5yHJl4BGm2gT71yTZcABB7q1SGfpDqLH9AB3eXJiutqhC4L3SH7YZ+6Q== - dependencies: - "@babel/runtime" "^7.17.2" +"@polkadot/keyring@^9.0.1": + version "9.0.1" + resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-9.0.1.tgz#421a28bd5d4055706183b3396908773cc5f425f9" + integrity sha512-i4C6TsqhhUpiKxaxD9+g3TWbgxDfWs5HP7oDfLtWNOzE7HJFh2oF/WYx8qgGTE7lYGHdsGUihld/VISnQDd97g== + dependencies: + "@babel/runtime" "^7.17.9" + "@polkadot/util" "9.0.1" + "@polkadot/util-crypto" "9.0.1" + +"@polkadot/networks@9.0.1", "@polkadot/networks@^9.0.1": + version "9.0.1" + resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-9.0.1.tgz#6bb6af0a98f3c35f76427e533dfd5359387e7016" + integrity sha512-jWunZIgA1ocYtF6WGWg3EsPQD19FJ/QCSjiyzHIqVZez8EgFSRQ1iqnawVLOJCd2UA319ZOzjLcuUt6QO0IqRQ== + dependencies: + "@babel/runtime" "^7.17.9" + "@polkadot/util" "9.0.1" + "@substrate/ss58-registry" "^1.17.0" + +"@polkadot/types-augment@8.1.1": + version "8.1.1" + resolved "https://registry.yarnpkg.com/@polkadot/types-augment/-/types-augment-8.1.1.tgz#f62107ca46080b9ddfc55f4acda30265dcf033ff" + integrity sha512-JyJigD/rH33uDKPRF8u2rMRmxkh/brM/AkD+pOH5ZO6AfcQ3mNsFEvM5OZ+Wx2vq6+vX3oH922wjK3d3/ILkpQ== + dependencies: + "@babel/runtime" "^7.17.9" + "@polkadot/types" "8.1.1" + "@polkadot/types-codec" "8.1.1" + "@polkadot/util" "^9.0.1" + +"@polkadot/types-codec@8.1.1": + version "8.1.1" + resolved "https://registry.yarnpkg.com/@polkadot/types-codec/-/types-codec-8.1.1.tgz#f45c40953169c28e406fbdb0b7306f90b858861a" + integrity sha512-JJkSYJrkSjNZYIWAqpihgtMKbTfk2r9J6eHeESiWFYhce61o2x1ylyzedaZkvoxD9hVhb7l94ulrHZKtlJKBFQ== + dependencies: + "@babel/runtime" "^7.17.9" + "@polkadot/util" "^9.0.1" + +"@polkadot/types-create@8.1.1": + version "8.1.1" + resolved "https://registry.yarnpkg.com/@polkadot/types-create/-/types-create-8.1.1.tgz#7e9663b1d8abf8caedb71482c1370e4438eee858" + integrity sha512-cL+CpLkHiTxRH67oHiCeunant9JpVvmtJZh+t/NZZypjRkH7YVOpKj643vkiP2m02259N2BzYTR6CEQP8QZGGQ== + dependencies: + "@babel/runtime" "^7.17.9" + "@polkadot/types-codec" "8.1.1" + "@polkadot/util" "^9.0.1" + +"@polkadot/types-known@8.1.1": + version "8.1.1" + resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-8.1.1.tgz#f956b5e0f282cabc32416c81e1a47f6dcda92e06" + integrity sha512-aOuHf/vTFrScipGx9DOcD83ki1jBLHg3549SAkMwyz0K+RnIlt2nat32/M60eUWJgyHHITl4G0QCZrtFY2D2OA== + dependencies: + "@babel/runtime" "^7.17.9" + "@polkadot/networks" "^9.0.1" + "@polkadot/types" "8.1.1" + "@polkadot/types-codec" "8.1.1" + "@polkadot/types-create" "8.1.1" + "@polkadot/util" "^9.0.1" + +"@polkadot/types@8.1.1": + version "8.1.1" + resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-8.1.1.tgz#43e5fb78e6214e6af7c5edbdb6ac69d5b919421d" + integrity sha512-x9WDx9XcaSkQGlnk2MNu+49oK80s8Js7lr0mmCinV12m8+3si+GvIOvnuV3ydmWgWtpTt2ERfN+T8a/6f50EpA== + dependencies: + "@babel/runtime" "^7.17.9" + "@polkadot/keyring" "^9.0.1" + "@polkadot/types-augment" "8.1.1" + "@polkadot/types-codec" "8.1.1" + "@polkadot/types-create" "8.1.1" + "@polkadot/util" "^9.0.1" + "@polkadot/util-crypto" "^9.0.1" + rxjs "^7.5.5" + +"@polkadot/util-crypto@9.0.1", "@polkadot/util-crypto@^9.0.1": + version "9.0.1" + resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-9.0.1.tgz#4cfc867ebec1d593b351cf881e021364eff0c496" + integrity sha512-HPze3+VHY899B6CXwyrgWNDqmjmhfYy6+l29giXLfT/kmaL5FodRPCO36BNTbGCITuVajDR9wdZ/LeLZdIb79w== + dependencies: + "@babel/runtime" "^7.17.9" "@noble/hashes" "1.0.0" - "@noble/secp256k1" "1.5.2" - "@polkadot/networks" "8.4.1" - "@polkadot/util" "8.4.1" - "@polkadot/wasm-crypto" "^4.5.1" - "@polkadot/x-bigint" "8.4.1" - "@polkadot/x-randomvalues" "8.4.1" + "@noble/secp256k1" "1.5.5" + "@polkadot/networks" "9.0.1" + "@polkadot/util" "9.0.1" + "@polkadot/wasm-crypto" "^6.0.1" + "@polkadot/x-bigint" "9.0.1" + "@polkadot/x-randomvalues" "9.0.1" "@scure/base" "1.0.0" ed2curve "^0.3.0" tweetnacl "^1.0.3" -"@polkadot/util@8.4.1", "@polkadot/util@^8.4.1": - version "8.4.1" - resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-8.4.1.tgz#b84835c55585c8b5fc5608a99aa62ac815292ae7" - integrity sha512-8+wqHgFbFWI5TfrvtcL888w0nWvFpbTTYIcbpEw+zYGp3n1YZTAMMP26bXWAaQX5AttxynJRij7JP3ySxYY1fg== +"@polkadot/util@9.0.1", "@polkadot/util@^9.0.1": + version "9.0.1" + resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-9.0.1.tgz#cedd3d44733df72245907eb13b86dafa32a52116" + integrity sha512-MuiuAb0VcnNpBFpbXZ4v0roxEVSpfx3bDR9qR31XCYCUODDKXa04srFz2EXI0pov087mTprIUE+x9wIWkH9QUg== dependencies: - "@babel/runtime" "^7.17.2" - "@polkadot/x-bigint" "8.4.1" - "@polkadot/x-global" "8.4.1" - "@polkadot/x-textdecoder" "8.4.1" - "@polkadot/x-textencoder" "8.4.1" + "@babel/runtime" "^7.17.9" + "@polkadot/x-bigint" "9.0.1" + "@polkadot/x-global" "9.0.1" + "@polkadot/x-textdecoder" "9.0.1" + "@polkadot/x-textencoder" "9.0.1" "@types/bn.js" "^5.1.0" bn.js "^5.2.0" ip-regex "^4.3.0" -"@polkadot/wasm-crypto-asmjs@^4.5.1": - version "4.5.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-4.5.1.tgz#e1025a49e106db11d1187caf65f56c960ea2ad2b" - integrity sha512-DOdRiWhxVvmqTvp+E9z1j+Yr0zDOGsDvqnT/eNw0Dl1FVUOImsEa7FKns/urASmcxCVEE1jtUWSnij29jrORMQ== +"@polkadot/wasm-crypto-asmjs@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-6.0.1.tgz#64a5ac84d3e7e23a57429fb8932e51161644d536" + integrity sha512-cSGsHBLfPW2nHztgZd+gisCoScA02jbAzwjop/b8xumQ2kq7yAed/K9G1lOQiofEKRetIJeqBzJyk0etopRORw== dependencies: - "@babel/runtime" "^7.16.3" + "@babel/runtime" "^7.17.9" -"@polkadot/wasm-crypto-wasm@^4.5.1": - version "4.5.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-4.5.1.tgz#063a58ff7ddd939b7886a6a238109a8d2c416e46" - integrity sha512-hPwke85HxpgG/RAlwdCE8u5w7bThvWg399mlB+XjogXMxOUWBZSgq2XYbgzROUXx27inK9nStF4Pnc4zJnqs9A== +"@polkadot/wasm-crypto-wasm@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-6.0.1.tgz#d77033f184f46891411453d798a0d5f2e1129e88" + integrity sha512-0r/QgOjIyw4U0mLk6Tm97Di92uxcSPjTo7dK6tdXo1PwYouhzO5IJnL/jNgma8dm5hQoBhk7rcErmkh8c1kLFQ== dependencies: - "@babel/runtime" "^7.16.3" + "@babel/runtime" "^7.17.9" -"@polkadot/wasm-crypto@^4.5.1": - version "4.5.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto/-/wasm-crypto-4.5.1.tgz#e1ac6d846a0ad8e991cec128994524183ef6e8fd" - integrity sha512-Cr21ais3Kq3aedIHZ3J1tjgeD/+K8FCiwEawr0oRywNBSJR8wyuZMePs4swR/6xm8wbBkpqoBVHz/UQHqqQJmA== +"@polkadot/wasm-crypto@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto/-/wasm-crypto-6.0.1.tgz#47e79133446f7c3e1afd35be844ce0e793b56bee" + integrity sha512-nW5DDrciHGbZbj0Xh7w0Bnh5exSJUw96Zux7RuGfXuoXXHZBcf0QiB4E2dcVh3d/NkF7PkB99FlkdQxQp4M0Rg== dependencies: - "@babel/runtime" "^7.16.3" - "@polkadot/wasm-crypto-asmjs" "^4.5.1" - "@polkadot/wasm-crypto-wasm" "^4.5.1" + "@babel/runtime" "^7.17.9" + "@polkadot/wasm-crypto-asmjs" "^6.0.1" + "@polkadot/wasm-crypto-wasm" "^6.0.1" -"@polkadot/x-bigint@8.4.1": - version "8.4.1" - resolved "https://registry.yarnpkg.com/@polkadot/x-bigint/-/x-bigint-8.4.1.tgz#d3ccddd26cdc5413f5c722d8c53ec523299e3ff1" - integrity sha512-QVP0UMoM0nBD998s3ESeaoSiVMEnHK3x0CCqocKO4l7ADNw8lfWdDG7Bb0+ymNaFYGz2KgEWxkN0VhNEnXzo0w== +"@polkadot/x-bigint@9.0.1": + version "9.0.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-bigint/-/x-bigint-9.0.1.tgz#8ce29cff85b0fcd088a3c1bc3dadc324afb66d88" + integrity sha512-At+huOL4WYdNh8PHy7r94y5JpilphsPLEuyM+K3M/aE2R9G/2f0qTK9AjHeyNyeIrhw6Bc4uzO5K2Ka72HjS2g== dependencies: - "@babel/runtime" "^7.17.2" - "@polkadot/x-global" "8.4.1" + "@babel/runtime" "^7.17.9" + "@polkadot/x-global" "9.0.1" -"@polkadot/x-global@8.4.1": - version "8.4.1" - resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-8.4.1.tgz#61def1f5962001200c17b9fde92f6837736b3c55" - integrity sha512-MQs89LKQrJwiXjV7dY2kDOPNaiWrwaQ/Fzg93ycB2xMCclRV1jRFRhnhTPJ8Ao79lhCCoazd7pXIyFgfifxdqg== +"@polkadot/x-global@9.0.1": + version "9.0.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-9.0.1.tgz#3fb9a6c9b8a86af542c4a514c0af4ba895a5ed5f" + integrity sha512-C4K3laEYWMlWc1fJFUC5Kd6gxSC0GIe/ajClPjiKf5cwCGkGgtkcB7uvpzvnMAdxYpXiUnMHbJB6X/QyV/VG+Q== dependencies: - "@babel/runtime" "^7.17.2" + "@babel/runtime" "^7.17.9" -"@polkadot/x-randomvalues@8.4.1": - version "8.4.1" - resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-8.4.1.tgz#4488d2d6b982e7b2ecafc573cd25e3f1e85a512c" - integrity sha512-1dRIFIib4RzyVo0k5oMLuxqSuZEV6UVvvN+jJw9G/9P1ggZtHjM1KwoFcyHgvpk2RWTB9eJZFemwSvQTpdmSJw== +"@polkadot/x-randomvalues@9.0.1": + version "9.0.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-9.0.1.tgz#0cbd65817dfd4af3f99d8a3e7d9a456797bc25d9" + integrity sha512-F/1Eabzx9kWivSXA23SW5BzfjtDWqaNct+GkC5dlm2lg/iE2IRY2JIqoKKkfh1u1/3iQ5YfjA96NmD/swNAcew== dependencies: - "@babel/runtime" "^7.17.2" - "@polkadot/x-global" "8.4.1" + "@babel/runtime" "^7.17.9" + "@polkadot/x-global" "9.0.1" -"@polkadot/x-textdecoder@8.4.1": - version "8.4.1" - resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-8.4.1.tgz#5a227006d183f5ec3a8a331ca38e4969d24c4a97" - integrity sha512-qbSXyR2KvE1bO6QGsxWU3Yrx5e70rX2lwv0MHG++MyyNaDoBM3hjx14lF911bYRWXR6MW4eZ+0Nakn0oM5uSKw== +"@polkadot/x-textdecoder@9.0.1": + version "9.0.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-9.0.1.tgz#dda6234550d770f34cbd12eb0ad9cf3efaf47dfe" + integrity sha512-SudTQiluYIRO8EXF02kfWZGfsXrvJq4D2yURiIeIeWbrAShRUcQES7W01iGa5xvaHSW249eJ3fHbeDTNQd5B6Q== dependencies: - "@babel/runtime" "^7.17.2" - "@polkadot/x-global" "8.4.1" + "@babel/runtime" "^7.17.9" + "@polkadot/x-global" "9.0.1" -"@polkadot/x-textencoder@8.4.1": - version "8.4.1" - resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-8.4.1.tgz#ea01733ce6b80821bf8af943a1d98878a9150af5" - integrity sha512-1UYuckNOk6NUk70Y/SGbK8oyGbqPlrny1x2OWoK/BT3/tyL2xKVV5TlXDOiFrX1PChbskXye5M8blCTYikFiJg== +"@polkadot/x-textencoder@9.0.1": + version "9.0.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-9.0.1.tgz#4013a5160a542472d5bdd94fb5b28b32f7e0bc9f" + integrity sha512-73LeTasA3iDJMCLQXZd21wzNjs1Xr2xNXW03Yja3OPLneGK6Zlqz77AAYcjhQd2dgSFoH2NQ1JvdffXT9y1sGA== dependencies: - "@babel/runtime" "^7.17.2" - "@polkadot/x-global" "8.4.1" + "@babel/runtime" "^7.17.9" + "@polkadot/x-global" "9.0.1" "@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": version "1.1.2" @@ -1938,10 +1976,10 @@ resolved "https://registry.yarnpkg.com/@stablelib/wipe/-/wipe-1.0.1.tgz#d21401f1d59ade56a62e139462a97f104ed19a36" integrity sha512-WfqfX/eXGiAd3RJe4VU2snh/ZPwtSjLG4ynQ/vYzvghTh7dHFcI1wl+nrkWG6lGhukOxOsUHfv8dUXr58D0ayg== -"@substrate/ss58-registry@^1.14.0": - version "1.15.0" - resolved "https://registry.yarnpkg.com/@substrate/ss58-registry/-/ss58-registry-1.15.0.tgz#211c7c9e5cbcbfb6ee9c300efd719a038af38c36" - integrity sha512-UU5uN8HEp0NM22od6kHWLltX0McQPgPX6O3gj7fSf1mMExsCS5fzW88gv1WaVaT8Q+umvGgnIAF7+Tvp8fqTFw== +"@substrate/ss58-registry@^1.17.0": + version "1.17.0" + resolved "https://registry.yarnpkg.com/@substrate/ss58-registry/-/ss58-registry-1.17.0.tgz#a6a50dbef67da0114aff7cdae7c6eec685c5983b" + integrity sha512-YdQOxCtEZLnYZFg/zSzfROYtvIs5+iLD7p/VHoll7AVEhrPAmxgF5ggMDB2Dass7dfwABVx7heATbPFNg95Q8w== "@svgr/babel-plugin-add-jsx-attribute@^5.4.0": version "5.4.0" @@ -2333,11 +2371,16 @@ resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= -"@types/lodash@^4.14.136", "@types/lodash@^4.14.159", "@types/lodash@^4.14.170", "@types/lodash@^4.14.178": +"@types/lodash@^4.14.159", "@types/lodash@^4.14.178": version "4.14.178" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.178.tgz#341f6d2247db528d4a13ddbb374bcdc80406f4f8" integrity sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw== +"@types/lodash@^4.14.170": + version "4.14.177" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.177.tgz#f70c0d19c30fab101cad46b52be60363c43c4578" + integrity sha512-0fDwydE2clKe9MNfvXHBHF9WEahRuj+msTuQqOmAApNORFvhMYZKNGGJdCzuhheVjMps/ti0Ak/iJPACMaevvw== + "@types/long@^4.0.1": version "4.0.1" resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.1.tgz#459c65fa1867dafe6a8f322c4c51695663cc55e9" @@ -2475,7 +2518,7 @@ resolved "https://registry.yarnpkg.com/@types/utf8/-/utf8-2.1.6.tgz#430cabb71a42d0a3613cce5621324fe4f5a25753" integrity sha512-pRs2gYF5yoKYrgSaira0DJqVg2tFuF+Qjp838xS7K+mJyY2jJzjsrl6y17GbIa4uMRogMbxs+ghNCvKg6XyNrA== -"@types/ws@^7.2.0", "@types/ws@^7.4.4": +"@types/ws@^7.4.4": version "7.4.7" resolved "https://registry.yarnpkg.com/@types/ws/-/ws-7.4.7.tgz#f7c390a36f7a0679aa69de2d501319f4f8d9b702" integrity sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww== @@ -3381,7 +3424,7 @@ bn.js@4.11.8: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== -bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.0, bn.js@^4.11.6, bn.js@^4.11.8, bn.js@^4.11.9: +bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.0, bn.js@^4.11.1, bn.js@^4.11.6, bn.js@^4.11.8, bn.js@^4.11.9: version "4.12.0" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== @@ -3432,7 +3475,7 @@ braces@^3.0.1: dependencies: fill-range "^7.0.1" -brorand@^1.0.1, brorand@^1.0.5, brorand@^1.1.0: +brorand@^1.0.1, brorand@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= @@ -6708,11 +6751,6 @@ jsonparse@^1.2.0: resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" integrity sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA= -jsonschema@1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/jsonschema/-/jsonschema-1.2.2.tgz#83ab9c63d65bf4d596f91d81195e78772f6452bc" - integrity sha512-iX5OFQ6yx9NgbHCwse51ohhKgLuLL7Z5cNOeZOPIlDUtAMrxlruHLzVZxbltdHE5mEDXN+75oFOwq6Gn0MZwsA== - jsprim@^1.2.2: version "1.4.2" resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" @@ -6801,16 +6839,6 @@ leb128@^0.0.5: bn.js "^5.0.0" buffer-pipe "0.0.3" -ledger-cosmos-js@^2.1.8: - version "2.1.8" - resolved "https://registry.yarnpkg.com/ledger-cosmos-js/-/ledger-cosmos-js-2.1.8.tgz#b409ecd1e77f630e6fb212a9f602fe5c6e8f054b" - integrity sha512-Gl7SWMq+3R9OTkF1hLlg5+1geGOmcHX9OdS+INDsGNxSiKRWlsWCvQipGoDnRIQ6CPo2i/Ze58Dw0Mt/l3UYyA== - dependencies: - "@babel/runtime" "^7.11.2" - "@ledgerhq/hw-transport" "^5.25.0" - bech32 "^1.1.4" - ripemd160 "^2.0.2" - leven@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" @@ -8220,7 +8248,7 @@ ripemd160@2, ripemd160@^2.0.0, ripemd160@^2.0.1, ripemd160@^2.0.2: hash-base "^3.0.0" inherits "^2.0.1" -ripple-address-codec@^4.1.1, ripple-address-codec@^4.2.3: +ripple-address-codec@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/ripple-address-codec/-/ripple-address-codec-4.2.3.tgz#516675715cd43b71d2fd76c59bd92d0f623c152d" integrity sha512-9Nd0hQmKoJEhSTzYR9kYjKmSWlH6HaVosNVAM7mIIVlzcNlQCPfKXj7CfvXcRiHl3C6XUZj7RFLqzVaPjq2ufA== @@ -8228,10 +8256,10 @@ ripple-address-codec@^4.1.1, ripple-address-codec@^4.2.3: base-x "3.0.9" create-hash "^1.1.2" -ripple-binary-codec@^1.1.3, ripple-binary-codec@^1.3.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/ripple-binary-codec/-/ripple-binary-codec-1.3.2.tgz#dfea9daea2a2b9efc871dfcb56eeacc606135ba8" - integrity sha512-8VG1vfb3EM1J7ZdPXo9E57Zv2hF4cxT64gP6rGSQzODVgMjiBCWozhN3729qNTGtHItz0e82Oix8v95vWYBQ3A== +ripple-binary-codec@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/ripple-binary-codec/-/ripple-binary-codec-1.3.0.tgz#0c6cf503fb0e12948d538abd198a740bd9d2143a" + integrity sha512-hz4nhiekqHbUwIdBOg1PQKsbi+/GwOccHmTTfkIJTTp/p5mlifS+U3Zfz4dVzKhftrXCPympYvLb5QgoIP1AKw== dependencies: assert "^2.0.0" big-integer "^1.6.48" @@ -8255,43 +8283,14 @@ ripple-bs58check@^2.0.2: create-hash "^1.1.0" ripple-bs58 "^4.0.0" -ripple-keypairs@^1.0.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/ripple-keypairs/-/ripple-keypairs-1.1.3.tgz#3af825ffe85c1777b0aa78d832e9fc5750d4529d" - integrity sha512-y74Y3c0g652BgpDhWsf0x98GnUyY2D9eO2ay2exienUfbIe00TeIiFhYXQhCGVnliGsxeV9WTpU+YuEWuIxuhw== - dependencies: - bn.js "^5.1.1" - brorand "^1.0.5" - elliptic "^6.5.4" - hash.js "^1.0.3" - ripple-address-codec "^4.2.3" - -ripple-lib-transactionparser@0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/ripple-lib-transactionparser/-/ripple-lib-transactionparser-0.8.2.tgz#7aaad3ba1e1aeee1d5bcff32334a7a838f834dce" - integrity sha512-1teosQLjYHLyOQrKUQfYyMjDR3MAq/Ga+MJuLUfpBMypl4LZB4bEoMcmG99/+WVTEiZOezJmH9iCSvm/MyxD+g== - dependencies: - bignumber.js "^9.0.0" - lodash "^4.17.15" - -ripple-lib@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/ripple-lib/-/ripple-lib-1.10.0.tgz#e41aaf17d5c6e6f8bcc8116736ac108ff3d6b810" - integrity sha512-Cg2u73UybfM1PnzcuLt5flvLKZn35ovdIp+1eLrReVB4swuRuUF/SskJG9hf5wMosbvh+E+jZu8A6IbYJoyFIA== +rlp@^2.0.0, rlp@^2.2.3: + version "2.2.6" + resolved "https://registry.npmjs.org/rlp/-/rlp-2.2.6.tgz" + integrity sha512-HAfAmL6SDYNWPUOJNrM500x4Thn4PZsEy5pijPh40U9WfNk0z15hUYzO9xVIMAdIHdFtD8CBDHd75Td1g36Mjg== dependencies: - "@types/lodash" "^4.14.136" - "@types/ws" "^7.2.0" - bignumber.js "^9.0.0" - https-proxy-agent "^5.0.0" - jsonschema "1.2.2" - lodash "^4.17.4" - ripple-address-codec "^4.1.1" - ripple-binary-codec "^1.1.3" - ripple-keypairs "^1.0.3" - ripple-lib-transactionparser "0.8.2" - ws "^7.2.0" + bn.js "^4.11.1" -rlp@^2.0.0, rlp@^2.2.3, rlp@^2.2.4: +rlp@^2.2.4: version "2.2.7" resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.7.tgz#33f31c4afac81124ac4b283e2bd4d9720b30beaf" integrity sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ== @@ -8336,10 +8335,10 @@ rxjs@6, rxjs@^6.6.3: dependencies: tslib "^1.9.0" -rxjs@^7.5.4: - version "7.5.4" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.5.4.tgz#3d6bd407e6b7ce9a123e76b1e770dc5761aa368d" - integrity sha512-h5M3Hk78r6wAheJF0a5YahB1yRQKCsZ4MsGdZ5O9ETbVtjPcScGfrMmoOq7EBsCRzd4BDkvDJ7ogP8Sz5tTFiQ== +rxjs@^7.5.5: + version "7.5.5" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.5.5.tgz#2ebad89af0f560f460ad5cc4213219e1f7dd4e9f" + integrity sha512-sy+H0pQofO95VDmFLzyaw9xNJU4KTRSwQIGM6+iG3SypAtCiLDzpeG8sJrNCWn2Up9km+KhkvTdbkrdy+yzZdw== dependencies: tslib "^2.1.0" @@ -9928,7 +9927,7 @@ ws@^3.0.0: safe-buffer "~5.1.0" ultron "~1.1.0" -ws@^7, ws@^7.2.0, ws@^7.4.5, ws@^7.4.6: +ws@^7, ws@^7.4.5, ws@^7.4.6: version "7.5.7" resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.7.tgz#9e0ac77ee50af70d58326ecff7e85eb3fa375e67" integrity sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A==