From 1c49dcac38d895816ce181641a7c601bdede2906 Mon Sep 17 00:00:00 2001 From: Anthony Goussot Date: Thu, 8 Aug 2024 12:29:14 +0200 Subject: [PATCH 01/20] feat(coin-module): Moving from LLC Family to Coin Module --- .../project.pbxproj | 15 + libs/coin-modules/coin-vechain/.eslintrc.js | 31 + .../coin-vechain/.unimportedrc.json | 33 + libs/coin-modules/coin-vechain/CHANGELOG.md | 1175 +++++++++++++++++ libs/coin-modules/coin-vechain/jest.config.js | 8 + libs/coin-modules/coin-vechain/package.json | 106 ++ .../bridge.integration.test.ts.snap | 146 ++ .../coin-vechain/src}/account.ts | 4 +- .../coin-vechain/src}/api/index.ts | 0 .../coin-vechain/src}/api/sdk.ts | 0 .../coin-vechain/src}/api/types.ts | 0 .../src/bridge.integration.test.ts | 259 ++++ .../coin-vechain/src/bridge/js.ts | 33 + .../coin-vechain/src/bridge/mock.ts | 137 ++ .../coin-vechain/src}/broadcast.ts | 3 +- .../src}/buildOptimisticOperatioin.ts | 2 +- .../coin-vechain/src}/cli-transaction.ts | 3 +- libs/coin-modules/coin-vechain/src/config.ts | 18 + .../coin-vechain/src}/constants.ts | 0 .../src}/contracts/abis/VIP180.ts | 0 .../src}/contracts/abis/params.ts | 0 .../coin-vechain/src}/contracts/constants.ts | 0 .../coin-vechain/src}/createTransaction.ts | 0 .../src}/datasets/vechain.scanAccounts.1.ts | 0 .../coin-vechain/src}/datasets/vechain.ts | 0 .../coin-vechain/src}/errors.ts | 0 .../coin-vechain/src}/estimateMaxSpendable.ts | 0 .../coin-vechain/src}/getTransactionStatus.ts | 0 .../coin-vechain/src}/hw-getAddress.ts | 0 .../coin-vechain/src}/hw-signMessage.ts | 0 libs/coin-modules/coin-vechain/src/logic.ts | 44 + .../coin-vechain/src}/mock.ts | 0 .../coin-vechain/src}/prepareTransaction.ts | 0 .../coin-vechain/src}/signOperation.ts | 0 .../coin-vechain/src}/specs.ts | 12 +- .../src}/speculos-deviceActions.ts | 4 +- .../coin-vechain/src}/synchronisation.ts | 10 +- .../coin-vechain/src}/transaction.ts | 4 +- libs/coin-modules/coin-vechain/src/types.ts | 35 + .../coin-vechain/src}/utils/address-utils.ts | 0 .../coin-vechain/src}/utils/hex-utils.ts | 0 .../coin-vechain/src}/utils/mapping-utils.ts | 0 .../coin-vechain/src}/utils/pad-address.ts | 0 .../src}/utils/transaction-utils.ts | 0 libs/coin-modules/coin-vechain/tsconfig.json | 13 + libs/ledger-live-common/package.json | 2 +- .../vechain/bridge.integration.test.ts | 255 +--- package.json | 1 + pnpm-lock.yaml | 153 ++- 49 files changed, 2227 insertions(+), 279 deletions(-) create mode 100644 libs/coin-modules/coin-vechain/.eslintrc.js create mode 100644 libs/coin-modules/coin-vechain/.unimportedrc.json create mode 100644 libs/coin-modules/coin-vechain/CHANGELOG.md create mode 100644 libs/coin-modules/coin-vechain/jest.config.js create mode 100644 libs/coin-modules/coin-vechain/package.json create mode 100644 libs/coin-modules/coin-vechain/src/__snapshots__/bridge.integration.test.ts.snap rename libs/{ledger-live-common/src/families/vechain => coin-modules/coin-vechain/src}/account.ts (72%) rename libs/{ledger-live-common/src/families/vechain => coin-modules/coin-vechain/src}/api/index.ts (100%) rename libs/{ledger-live-common/src/families/vechain => coin-modules/coin-vechain/src}/api/sdk.ts (100%) rename libs/{ledger-live-common/src/families/vechain => coin-modules/coin-vechain/src}/api/types.ts (100%) create mode 100644 libs/coin-modules/coin-vechain/src/bridge.integration.test.ts create mode 100644 libs/coin-modules/coin-vechain/src/bridge/js.ts create mode 100644 libs/coin-modules/coin-vechain/src/bridge/mock.ts rename libs/{ledger-live-common/src/families/vechain => coin-modules/coin-vechain/src}/broadcast.ts (89%) rename libs/{ledger-live-common/src/families/vechain => coin-modules/coin-vechain/src}/buildOptimisticOperatioin.ts (95%) rename libs/{ledger-live-common/src/families/vechain => coin-modules/coin-vechain/src}/cli-transaction.ts (93%) create mode 100644 libs/coin-modules/coin-vechain/src/config.ts rename libs/{ledger-live-common/src/families/vechain => coin-modules/coin-vechain/src}/constants.ts (100%) rename libs/{ledger-live-common/src/families/vechain => coin-modules/coin-vechain/src}/contracts/abis/VIP180.ts (100%) rename libs/{ledger-live-common/src/families/vechain => coin-modules/coin-vechain/src}/contracts/abis/params.ts (100%) rename libs/{ledger-live-common/src/families/vechain => coin-modules/coin-vechain/src}/contracts/constants.ts (100%) rename libs/{ledger-live-common/src/families/vechain => coin-modules/coin-vechain/src}/createTransaction.ts (100%) rename libs/{ledger-live-common/src/families/vechain => coin-modules/coin-vechain/src}/datasets/vechain.scanAccounts.1.ts (100%) rename libs/{ledger-live-common/src/families/vechain => coin-modules/coin-vechain/src}/datasets/vechain.ts (100%) rename libs/{ledger-live-common/src/families/vechain => coin-modules/coin-vechain/src}/errors.ts (100%) rename libs/{ledger-live-common/src/families/vechain => coin-modules/coin-vechain/src}/estimateMaxSpendable.ts (100%) rename libs/{ledger-live-common/src/families/vechain => coin-modules/coin-vechain/src}/getTransactionStatus.ts (100%) rename libs/{ledger-live-common/src/families/vechain => coin-modules/coin-vechain/src}/hw-getAddress.ts (100%) rename libs/{ledger-live-common/src/families/vechain => coin-modules/coin-vechain/src}/hw-signMessage.ts (100%) create mode 100644 libs/coin-modules/coin-vechain/src/logic.ts rename libs/{ledger-live-common/src/families/vechain => coin-modules/coin-vechain/src}/mock.ts (100%) rename libs/{ledger-live-common/src/families/vechain => coin-modules/coin-vechain/src}/prepareTransaction.ts (100%) rename libs/{ledger-live-common/src/families/vechain => coin-modules/coin-vechain/src}/signOperation.ts (100%) rename libs/{ledger-live-common/src/families/vechain => coin-modules/coin-vechain/src}/specs.ts (94%) rename libs/{ledger-live-common/src/families/vechain => coin-modules/coin-vechain/src}/speculos-deviceActions.ts (75%) rename libs/{ledger-live-common/src/families/vechain => coin-modules/coin-vechain/src}/synchronisation.ts (90%) rename libs/{ledger-live-common/src/families/vechain => coin-modules/coin-vechain/src}/transaction.ts (91%) create mode 100644 libs/coin-modules/coin-vechain/src/types.ts rename libs/{ledger-live-common/src/families/vechain => coin-modules/coin-vechain/src}/utils/address-utils.ts (100%) rename libs/{ledger-live-common/src/families/vechain => coin-modules/coin-vechain/src}/utils/hex-utils.ts (100%) rename libs/{ledger-live-common/src/families/vechain => coin-modules/coin-vechain/src}/utils/mapping-utils.ts (100%) rename libs/{ledger-live-common/src/families/vechain => coin-modules/coin-vechain/src}/utils/pad-address.ts (100%) rename libs/{ledger-live-common/src/families/vechain => coin-modules/coin-vechain/src}/utils/transaction-utils.ts (100%) create mode 100644 libs/coin-modules/coin-vechain/tsconfig.json diff --git a/apps/ledger-live-mobile/ios/ledgerlivemobile.xcodeproj/project.pbxproj b/apps/ledger-live-mobile/ios/ledgerlivemobile.xcodeproj/project.pbxproj index 9cc6536b5a72..e683dccb3420 100644 --- a/apps/ledger-live-mobile/ios/ledgerlivemobile.xcodeproj/project.pbxproj +++ b/apps/ledger-live-mobile/ios/ledgerlivemobile.xcodeproj/project.pbxproj @@ -42,6 +42,7 @@ 09BC9C5402323A57C5327727 /* ExpoModulesProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ExpoModulesProvider.swift; path = "Pods/Target Support Files/Pods-ledgerlivemobile/ExpoModulesProvider.swift"; sourceTree = ""; }; 0EC70FE4282B9CAA00E9E355 /* AdServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdServices.framework; path = System/Library/Frameworks/AdServices.framework; sourceTree = SDKROOT; }; 0F189190C1964DD1B7E31BE6 /* FontAwesome5_Brands.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome5_Brands.ttf; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Brands.ttf"; sourceTree = ""; }; + 0F3FA5B2EBC599D43E064942 /* Pods-ledgerlivemobile.prerelease.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ledgerlivemobile.prerelease.xcconfig"; path = "Target Support Files/Pods-ledgerlivemobile/Pods-ledgerlivemobile.prerelease.xcconfig"; sourceTree = ""; }; 13B07F961A680F5B00A75B9A /* ledgerlivemobile.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ledgerlivemobile.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = ledgerlivemobile/AppDelegate.h; sourceTree = ""; }; 13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = ledgerlivemobile/AppDelegate.mm; sourceTree = ""; }; @@ -82,6 +83,7 @@ 97FD0A4F7C8CED04EEB0A176 /* Pods-ledgerlivemobile.prerelease.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ledgerlivemobile.prerelease.xcconfig"; path = "Target Support Files/Pods-ledgerlivemobile/Pods-ledgerlivemobile.prerelease.xcconfig"; sourceTree = ""; }; 991AA9919E4840DBB799E117 /* FontAwesome5_Pro_Solid.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome5_Pro_Solid.ttf; path = ../assets/fonts/FontAwesome5_Pro_Solid.ttf; sourceTree = ""; }; 99A82013C77445B4B2B54AB5 /* EvilIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = EvilIcons.ttf; path = "../node_modules/react-native-vector-icons/Fonts/EvilIcons.ttf"; sourceTree = ""; }; + A187EC82BC83E3BD9D7F3D1F /* Pods-ledgerlivemobile.nightly.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ledgerlivemobile.nightly.xcconfig"; path = "Target Support Files/Pods-ledgerlivemobile/Pods-ledgerlivemobile.nightly.xcconfig"; sourceTree = ""; }; A80B735599C416373F147DED /* Pods-ledgerlivemobile-ledgerlivemobileTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ledgerlivemobile-ledgerlivemobileTests.release.xcconfig"; path = "Target Support Files/Pods-ledgerlivemobile-ledgerlivemobileTests/Pods-ledgerlivemobile-ledgerlivemobileTests.release.xcconfig"; sourceTree = ""; }; B2ADF826B67305807029EFEE /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = ledgerlivemobile/PrivacyInfo.xcprivacy; sourceTree = ""; }; B3F983E6F88EBD69A6725FF4 /* Pods-ledgerlivemobile.nightly.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ledgerlivemobile.nightly.xcconfig"; path = "Target Support Files/Pods-ledgerlivemobile/Pods-ledgerlivemobile.nightly.xcconfig"; sourceTree = ""; }; @@ -164,8 +166,13 @@ 68139B1F4BF967461F30D471 /* Pods-ledgerlivemobile-ledgerlivemobileTests.debug.xcconfig */, A80B735599C416373F147DED /* Pods-ledgerlivemobile-ledgerlivemobileTests.release.xcconfig */, C630F76F0E1C857DA405027E /* Pods-ledgerlivemobile-ledgerlivemobileTests.staging.xcconfig */, +<<<<<<< HEAD B3F983E6F88EBD69A6725FF4 /* Pods-ledgerlivemobile.nightly.xcconfig */, 97FD0A4F7C8CED04EEB0A176 /* Pods-ledgerlivemobile.prerelease.xcconfig */, +======= + A187EC82BC83E3BD9D7F3D1F /* Pods-ledgerlivemobile.nightly.xcconfig */, + 0F3FA5B2EBC599D43E064942 /* Pods-ledgerlivemobile.prerelease.xcconfig */, +>>>>>>> 6d8cdfd2dd (feat(coin-module): Moving from LLC Family to Coin Module) ); path = Pods; sourceTree = ""; @@ -1130,7 +1137,11 @@ }; BB0B80022CAAB47600AF2B0C /* Nightly */ = { isa = XCBuildConfiguration; +<<<<<<< HEAD baseConfigurationReference = B3F983E6F88EBD69A6725FF4 /* Pods-ledgerlivemobile.nightly.xcconfig */; +======= + baseConfigurationReference = A187EC82BC83E3BD9D7F3D1F /* Pods-ledgerlivemobile.nightly.xcconfig */; +>>>>>>> 6d8cdfd2dd (feat(coin-module): Moving from LLC Family to Coin Module) buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = NightlyAppIcon; CLANG_ENABLE_MODULES = YES; @@ -1257,7 +1268,11 @@ }; BB2FFDA22CAD600D00AB17D8 /* Prerelease */ = { isa = XCBuildConfiguration; +<<<<<<< HEAD baseConfigurationReference = 97FD0A4F7C8CED04EEB0A176 /* Pods-ledgerlivemobile.prerelease.xcconfig */; +======= + baseConfigurationReference = 0F3FA5B2EBC599D43E064942 /* Pods-ledgerlivemobile.prerelease.xcconfig */; +>>>>>>> 6d8cdfd2dd (feat(coin-module): Moving from LLC Family to Coin Module) buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = PrereleaseAppIcon; CLANG_ENABLE_MODULES = YES; diff --git a/libs/coin-modules/coin-vechain/.eslintrc.js b/libs/coin-modules/coin-vechain/.eslintrc.js new file mode 100644 index 000000000000..d5820bbd4d9a --- /dev/null +++ b/libs/coin-modules/coin-vechain/.eslintrc.js @@ -0,0 +1,31 @@ +module.exports = { + env: { + browser: true, + es6: true, + }, + plugins: ["import"], + rules: { + "no-console": ["error", { allow: ["warn", "error"] }], + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/explicit-function-return-type": "error", + "import/order": ["error"], + }, + overrides: [ + { + files: ["src/**/*.test.{ts,tsx}"], + env: { + "jest/globals": true, + }, + plugins: ["jest"], + }, + { + // allow, as warning, only any in tests + files: ["*/__tests__/**/*.{ts,tsx}"], + rules: { + "no-console": "off", + "@typescript-eslint/no-explicit-any": "warn", + "@typescript-eslint/explicit-function-return-type": "off", + }, + }, + ], +}; diff --git a/libs/coin-modules/coin-vechain/.unimportedrc.json b/libs/coin-modules/coin-vechain/.unimportedrc.json new file mode 100644 index 000000000000..56f6747c5715 --- /dev/null +++ b/libs/coin-modules/coin-vechain/.unimportedrc.json @@ -0,0 +1,33 @@ +{ + "entry": [ + "src/deviceTransactionConfig.ts", + "src/errors.ts", + "src/hw-getAddress.ts", + "src/serialization.ts", + "src/specs.ts", + "src/transaction.ts" + ], + "ignorePatterns": [ + "**/node_modules/**", + "**/*.fixture.ts", + "**/*.mock.ts", + "**/*.test.{js,jsx,ts,tsx}" + ], + "ignoreUnresolved": [], + "ignoreUnimported": [ + "src/bridge/index.ts", + "src/broadcast.ts", + "src/buildOptimisticOperation.ts", + "src/buildTransaction.ts", + "src/cli.ts", + "src/config.ts", + "src/createTransaction.ts", + "src/estimateMaxSpendable.ts", + "src/getTransactionStatus.ts", + "src/prepareTransaction.ts", + "src/signOperation.ts", + "src/synchronization.ts", + "src/tokens.ts" + ], + "ignoreUnused": ["rxjs"] +} diff --git a/libs/coin-modules/coin-vechain/CHANGELOG.md b/libs/coin-modules/coin-vechain/CHANGELOG.md new file mode 100644 index 000000000000..959e9741d07f --- /dev/null +++ b/libs/coin-modules/coin-vechain/CHANGELOG.md @@ -0,0 +1,1175 @@ +# @ledgerhq/coin-evm + +## 2.1.3 + +### Patch Changes + +- Updated dependencies [[`0b12c90`](https://github.com/LedgerHQ/ledger-live/commit/0b12c9040d6ee0a326b1d5effd261ddee2db452f)]: + - @ledgerhq/devices@8.4.2 + - @ledgerhq/coin-framework@0.16.1 + +## 2.1.3-hotfix.0 + +### Patch Changes + +- Updated dependencies [[`5d508e5`](https://github.com/LedgerHQ/ledger-live/commit/5d508e5cfd296e458746adf176dd292aa884f7ea)]: + - @ledgerhq/devices@8.4.2-hotfix.0 + - @ledgerhq/coin-framework@0.16.1-hotfix.0 + +## 2.1.2 + +### Patch Changes + +- Updated dependencies [[`ef2d53d`](https://github.com/LedgerHQ/ledger-live/commit/ef2d53d514f1f4e6f18fc79fa3423bd9b0208a04), [`b77ab8e`](https://github.com/LedgerHQ/ledger-live/commit/b77ab8e718ee8e10b74dc15370e8a19d2597d39e), [`fe8a26b`](https://github.com/LedgerHQ/ledger-live/commit/fe8a26b04206df64e50220c3e9249c9a1bd057a6), [`e78f3b7`](https://github.com/LedgerHQ/ledger-live/commit/e78f3b75296c7a063f6cddbeae44c36d236055f3), [`f979216`](https://github.com/LedgerHQ/ledger-live/commit/f9792160293fc8215c6d099f02e1b136c6655f9b), [`c1d2bb0`](https://github.com/LedgerHQ/ledger-live/commit/c1d2bb0866723c10d6e2899d40ddd9b9801189f4), [`c59adf2`](https://github.com/LedgerHQ/ledger-live/commit/c59adf2b0d49ea3c72b94fcb356eb72bcbfc4a6b)]: + - @ledgerhq/cryptoassets@13.2.0 + - @ledgerhq/coin-framework@0.16.0 + - @ledgerhq/errors@6.18.0 + - @ledgerhq/domain-service@1.2.2 + - @ledgerhq/evm-tools@1.1.2 + - @ledgerhq/devices@8.4.1 + - @ledgerhq/live-network@1.3.1 + +## 2.1.2-next.0 + +### Patch Changes + +- Updated dependencies [[`ef2d53d`](https://github.com/LedgerHQ/ledger-live/commit/ef2d53d514f1f4e6f18fc79fa3423bd9b0208a04), [`b77ab8e`](https://github.com/LedgerHQ/ledger-live/commit/b77ab8e718ee8e10b74dc15370e8a19d2597d39e), [`fe8a26b`](https://github.com/LedgerHQ/ledger-live/commit/fe8a26b04206df64e50220c3e9249c9a1bd057a6), [`e78f3b7`](https://github.com/LedgerHQ/ledger-live/commit/e78f3b75296c7a063f6cddbeae44c36d236055f3), [`f979216`](https://github.com/LedgerHQ/ledger-live/commit/f9792160293fc8215c6d099f02e1b136c6655f9b), [`c1d2bb0`](https://github.com/LedgerHQ/ledger-live/commit/c1d2bb0866723c10d6e2899d40ddd9b9801189f4), [`c59adf2`](https://github.com/LedgerHQ/ledger-live/commit/c59adf2b0d49ea3c72b94fcb356eb72bcbfc4a6b)]: + - @ledgerhq/cryptoassets@13.2.0-next.0 + - @ledgerhq/coin-framework@0.16.0-next.0 + - @ledgerhq/errors@6.18.0-next.0 + - @ledgerhq/domain-service@1.2.2-next.0 + - @ledgerhq/evm-tools@1.1.2-next.0 + - @ledgerhq/devices@8.4.1-next.0 + - @ledgerhq/live-network@1.3.1-next.0 + +## 2.1.1 + +### Patch Changes + +- [#7078](https://github.com/LedgerHQ/ledger-live/pull/7078) [`993c5f2`](https://github.com/LedgerHQ/ledger-live/commit/993c5f25b8a3ef3bb1f96dd93883e430e61f9fac) Thanks [@lvndry](https://github.com/lvndry)! - [evm] Improve error message if could not get list of operations + +- [#7206](https://github.com/LedgerHQ/ledger-live/pull/7206) [`81e5b8b`](https://github.com/LedgerHQ/ledger-live/commit/81e5b8bf4830dcb9d666436f2cc4367d92e93e78) Thanks [@kallen-ledger](https://github.com/kallen-ledger)! - chore: resolve merge conflicts + +- Updated dependencies [[`cde94b9`](https://github.com/LedgerHQ/ledger-live/commit/cde94b9584d6889849fb097813a5fc11ea19d069), [`b478096`](https://github.com/LedgerHQ/ledger-live/commit/b478096537a0f86a9e39acc8c6cf17b1184e0849), [`81e5b8b`](https://github.com/LedgerHQ/ledger-live/commit/81e5b8bf4830dcb9d666436f2cc4367d92e93e78)]: + - @ledgerhq/coin-framework@0.15.0 + - @ledgerhq/cryptoassets@13.1.1 + - @ledgerhq/domain-service@1.2.1 + - @ledgerhq/evm-tools@1.1.1 + +## 2.1.1-next.2 + +### Patch Changes + +- [#7206](https://github.com/LedgerHQ/ledger-live/pull/7206) [`81e5b8b`](https://github.com/LedgerHQ/ledger-live/commit/81e5b8bf4830dcb9d666436f2cc4367d92e93e78) Thanks [@kallen-ledger](https://github.com/kallen-ledger)! - chore: resolve merge conflicts + +- Updated dependencies [[`81e5b8b`](https://github.com/LedgerHQ/ledger-live/commit/81e5b8bf4830dcb9d666436f2cc4367d92e93e78)]: + - @ledgerhq/cryptoassets@13.1.1-next.1 + - @ledgerhq/coin-framework@0.15.0-next.2 + - @ledgerhq/domain-service@1.2.1-next.1 + - @ledgerhq/evm-tools@1.1.1-next.1 + +## 2.1.1-next.1 + +### Patch Changes + +- Updated dependencies [[`b478096`](https://github.com/LedgerHQ/ledger-live/commit/b478096537a0f86a9e39acc8c6cf17b1184e0849)]: + - @ledgerhq/cryptoassets@13.1.1-next.0 + - @ledgerhq/coin-framework@0.15.0-next.1 + - @ledgerhq/evm-tools@1.1.1-next.0 + +## 2.1.1-next.0 + +### Patch Changes + +- [#7078](https://github.com/LedgerHQ/ledger-live/pull/7078) [`993c5f2`](https://github.com/LedgerHQ/ledger-live/commit/993c5f25b8a3ef3bb1f96dd93883e430e61f9fac) Thanks [@lvndry](https://github.com/lvndry)! - [evm] Improve error message if could not get list of operations + +- Updated dependencies [[`cde94b9`](https://github.com/LedgerHQ/ledger-live/commit/cde94b9584d6889849fb097813a5fc11ea19d069)]: + - @ledgerhq/coin-framework@0.15.0-next.0 + - @ledgerhq/domain-service@1.2.1-next.0 + - @ledgerhq/evm-tools@1.1.0 + +## 2.1.0 + +### Minor Changes + +- [#6596](https://github.com/LedgerHQ/ledger-live/pull/6596) [`77fa530`](https://github.com/LedgerHQ/ledger-live/commit/77fa530c8626df94fa7f9c0a8b3a99f2efa7cb11) Thanks [@KVNLS](https://github.com/KVNLS)! - Upgrade React Native to version 0.73.6 + +- [#7030](https://github.com/LedgerHQ/ledger-live/pull/7030) [`12a74b9`](https://github.com/LedgerHQ/ledger-live/commit/12a74b9f2f27285e44a5dca665422b3b8ecd4028) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Update evm coin-tester indexer now supporting Ledger & Etherscan-like explorers + +- [#6876](https://github.com/LedgerHQ/ledger-live/pull/6876) [`689e6e5`](https://github.com/LedgerHQ/ledger-live/commit/689e6e5a443170b8e6c2b404cc99af2e67d8e8e4) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Update coin implementations to use new account bridge types & implement cleaner architecture + +- [#6977](https://github.com/LedgerHQ/ledger-live/pull/6977) [`2f2b754`](https://github.com/LedgerHQ/ledger-live/commit/2f2b754b1350360ca0d9f761ca6e4a8cbaff141b) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Add support for Scroll & Scroll Sepolia + +### Patch Changes + +- [#6663](https://github.com/LedgerHQ/ledger-live/pull/6663) [`de5de2d`](https://github.com/LedgerHQ/ledger-live/commit/de5de2d273ed6966c82bde2c3a95b98ba594204f) Thanks [@sprohaszka-ledger](https://github.com/sprohaszka-ledger)! - Reorganize coin serializaiton code + +- [#6754](https://github.com/LedgerHQ/ledger-live/pull/6754) [`4c01029`](https://github.com/LedgerHQ/ledger-live/commit/4c01029b4d4feb32dab2f9e77da1126050d8c1bc) Thanks [@sprohaszka-ledger](https://github.com/sprohaszka-ledger)! - Move Tezos in its own package + +- [#6752](https://github.com/LedgerHQ/ledger-live/pull/6752) [`434262d`](https://github.com/LedgerHQ/ledger-live/commit/434262db4560f62113002fbb607bd1a8da0712b4) Thanks [@CremaFR](https://github.com/CremaFR)! - bugfix, keep swap history for token when deep cleaning + +- [#6844](https://github.com/LedgerHQ/ledger-live/pull/6844) [`f19960f`](https://github.com/LedgerHQ/ledger-live/commit/f19960f2e7104e5bdf332269fa92fda47455e17d) Thanks [@sprohaszka-ledger](https://github.com/sprohaszka-ledger)! - Simplify SignerContext generic signature + +- [#6796](https://github.com/LedgerHQ/ledger-live/pull/6796) [`6552679`](https://github.com/LedgerHQ/ledger-live/commit/65526794bb4d1fbc7e286c0e1c0b6d021413fc8c) Thanks [@gre](https://github.com/gre)! - Drop technical Account#name and Account#starred fields and replace it with a new architecture: a wallet store that contains all user's data. + +- [#7030](https://github.com/LedgerHQ/ledger-live/pull/7030) [`12a74b9`](https://github.com/LedgerHQ/ledger-live/commit/12a74b9f2f27285e44a5dca665422b3b8ecd4028) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Make `gasTracker` optional in `EvmConfig` + +- [#6816](https://github.com/LedgerHQ/ledger-live/pull/6816) [`60cd799`](https://github.com/LedgerHQ/ledger-live/commit/60cd799e693e3ae0712a5a9e88206b5304bbc214) Thanks [@sprohaszka-ledger](https://github.com/sprohaszka-ledger)! - Split currencies utils between CoinFmk and LLC + +- Updated dependencies [[`77fa530`](https://github.com/LedgerHQ/ledger-live/commit/77fa530c8626df94fa7f9c0a8b3a99f2efa7cb11), [`6c35cc5`](https://github.com/LedgerHQ/ledger-live/commit/6c35cc564cb050614ee571907f628ecf15ec4584), [`b9f1f71`](https://github.com/LedgerHQ/ledger-live/commit/b9f1f715355752d8c57c24ecd6a6d166b80f689d), [`815ae3d`](https://github.com/LedgerHQ/ledger-live/commit/815ae3dae8027823854ada837df3dc983d09b10f), [`de5de2d`](https://github.com/LedgerHQ/ledger-live/commit/de5de2d273ed6966c82bde2c3a95b98ba594204f), [`83e5690`](https://github.com/LedgerHQ/ledger-live/commit/83e5690429e41ecd1c508b3398904ae747085cf7), [`4c01029`](https://github.com/LedgerHQ/ledger-live/commit/4c01029b4d4feb32dab2f9e77da1126050d8c1bc), [`326cae0`](https://github.com/LedgerHQ/ledger-live/commit/326cae088cc33795536deb1d868c86e8dbeb6a13), [`6c35cc5`](https://github.com/LedgerHQ/ledger-live/commit/6c35cc564cb050614ee571907f628ecf15ec4584), [`4499990`](https://github.com/LedgerHQ/ledger-live/commit/449999066c58ae5df371dfb92a7230f9b5e90a60), [`a18c28e`](https://github.com/LedgerHQ/ledger-live/commit/a18c28e3f6a6132bd5e53d5b61721084b3aa19e8), [`cec1599`](https://github.com/LedgerHQ/ledger-live/commit/cec1599a41aa1a18a249e34312164bc93b63972f), [`801265b`](https://github.com/LedgerHQ/ledger-live/commit/801265b7ff3ed7ebd0012eb50f70898557a2dd52), [`d5a1300`](https://github.com/LedgerHQ/ledger-live/commit/d5a130034c18c7ac8b1fd3d4c5271423b4f7639d), [`6d44f25`](https://github.com/LedgerHQ/ledger-live/commit/6d44f255c5b2f453c61d0b754807db1f76d7174e), [`f19960f`](https://github.com/LedgerHQ/ledger-live/commit/f19960f2e7104e5bdf332269fa92fda47455e17d), [`3b9c93c`](https://github.com/LedgerHQ/ledger-live/commit/3b9c93c0de8ceff2af96a6ee8e42b8d9c2ab7af0), [`6623cd1`](https://github.com/LedgerHQ/ledger-live/commit/6623cd13102bd8340bd7d4dfdd469934527985c3), [`f7e7881`](https://github.com/LedgerHQ/ledger-live/commit/f7e7881a820880143c2b011d6a92b5a36156b2c1), [`2f2b754`](https://github.com/LedgerHQ/ledger-live/commit/2f2b754b1350360ca0d9f761ca6e4a8cbaff141b), [`689e6e5`](https://github.com/LedgerHQ/ledger-live/commit/689e6e5a443170b8e6c2b404cc99af2e67d8e8e4), [`6552679`](https://github.com/LedgerHQ/ledger-live/commit/65526794bb4d1fbc7e286c0e1c0b6d021413fc8c), [`fda6a81`](https://github.com/LedgerHQ/ledger-live/commit/fda6a814544b3a1debceab22f69485911e76cadc), [`689e6e5`](https://github.com/LedgerHQ/ledger-live/commit/689e6e5a443170b8e6c2b404cc99af2e67d8e8e4), [`60cd799`](https://github.com/LedgerHQ/ledger-live/commit/60cd799e693e3ae0712a5a9e88206b5304bbc214), [`84274a6`](https://github.com/LedgerHQ/ledger-live/commit/84274a6e764a385f707bc811ead7a7e92a02ed6a)]: + - @ledgerhq/cryptoassets@13.1.0 + - @ledgerhq/devices@8.4.0 + - @ledgerhq/errors@6.17.0 + - @ledgerhq/coin-framework@0.14.0 + - @ledgerhq/domain-service@1.2.0 + - @ledgerhq/live-network@1.3.0 + - @ledgerhq/evm-tools@1.1.0 + - @ledgerhq/live-promise@0.1.0 + - @ledgerhq/live-env@2.1.0 + +## 2.1.0-next.2 + +### Patch Changes + +- Updated dependencies [[`d5a1300`](https://github.com/LedgerHQ/ledger-live/commit/d5a130034c18c7ac8b1fd3d4c5271423b4f7639d)]: + - @ledgerhq/cryptoassets@13.1.0-next.2 + - @ledgerhq/coin-framework@0.14.0-next.2 + - @ledgerhq/evm-tools@1.1.0-next.2 + +## 2.1.0-next.1 + +### Patch Changes + +- Updated dependencies [[`f7e7881`](https://github.com/LedgerHQ/ledger-live/commit/f7e7881a820880143c2b011d6a92b5a36156b2c1)]: + - @ledgerhq/cryptoassets@13.1.0-next.1 + - @ledgerhq/coin-framework@0.14.0-next.1 + - @ledgerhq/evm-tools@1.1.0-next.1 + +## 2.1.0-next.0 + +### Minor Changes + +- [#6596](https://github.com/LedgerHQ/ledger-live/pull/6596) [`77fa530`](https://github.com/LedgerHQ/ledger-live/commit/77fa530c8626df94fa7f9c0a8b3a99f2efa7cb11) Thanks [@KVNLS](https://github.com/KVNLS)! - Upgrade React Native to version 0.73.6 + +- [#7030](https://github.com/LedgerHQ/ledger-live/pull/7030) [`12a74b9`](https://github.com/LedgerHQ/ledger-live/commit/12a74b9f2f27285e44a5dca665422b3b8ecd4028) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Update evm coin-tester indexer now supporting Ledger & Etherscan-like explorers + +- [#6876](https://github.com/LedgerHQ/ledger-live/pull/6876) [`689e6e5`](https://github.com/LedgerHQ/ledger-live/commit/689e6e5a443170b8e6c2b404cc99af2e67d8e8e4) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Update coin implementations to use new account bridge types & implement cleaner architecture + +- [#6977](https://github.com/LedgerHQ/ledger-live/pull/6977) [`2f2b754`](https://github.com/LedgerHQ/ledger-live/commit/2f2b754b1350360ca0d9f761ca6e4a8cbaff141b) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Add support for Scroll & Scroll Sepolia + +### Patch Changes + +- [#6663](https://github.com/LedgerHQ/ledger-live/pull/6663) [`de5de2d`](https://github.com/LedgerHQ/ledger-live/commit/de5de2d273ed6966c82bde2c3a95b98ba594204f) Thanks [@sprohaszka-ledger](https://github.com/sprohaszka-ledger)! - Reorganize coin serializaiton code + +- [#6754](https://github.com/LedgerHQ/ledger-live/pull/6754) [`4c01029`](https://github.com/LedgerHQ/ledger-live/commit/4c01029b4d4feb32dab2f9e77da1126050d8c1bc) Thanks [@sprohaszka-ledger](https://github.com/sprohaszka-ledger)! - Move Tezos in its own package + +- [#6752](https://github.com/LedgerHQ/ledger-live/pull/6752) [`434262d`](https://github.com/LedgerHQ/ledger-live/commit/434262db4560f62113002fbb607bd1a8da0712b4) Thanks [@CremaFR](https://github.com/CremaFR)! - bugfix, keep swap history for token when deep cleaning + +- [#6844](https://github.com/LedgerHQ/ledger-live/pull/6844) [`f19960f`](https://github.com/LedgerHQ/ledger-live/commit/f19960f2e7104e5bdf332269fa92fda47455e17d) Thanks [@sprohaszka-ledger](https://github.com/sprohaszka-ledger)! - Simplify SignerContext generic signature + +- [#6796](https://github.com/LedgerHQ/ledger-live/pull/6796) [`6552679`](https://github.com/LedgerHQ/ledger-live/commit/65526794bb4d1fbc7e286c0e1c0b6d021413fc8c) Thanks [@gre](https://github.com/gre)! - Drop technical Account#name and Account#starred fields and replace it with a new architecture: a wallet store that contains all user's data. + +- [#7030](https://github.com/LedgerHQ/ledger-live/pull/7030) [`12a74b9`](https://github.com/LedgerHQ/ledger-live/commit/12a74b9f2f27285e44a5dca665422b3b8ecd4028) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Make `gasTracker` optional in `EvmConfig` + +- [#6816](https://github.com/LedgerHQ/ledger-live/pull/6816) [`60cd799`](https://github.com/LedgerHQ/ledger-live/commit/60cd799e693e3ae0712a5a9e88206b5304bbc214) Thanks [@sprohaszka-ledger](https://github.com/sprohaszka-ledger)! - Split currencies utils between CoinFmk and LLC + +- Updated dependencies [[`77fa530`](https://github.com/LedgerHQ/ledger-live/commit/77fa530c8626df94fa7f9c0a8b3a99f2efa7cb11), [`6c35cc5`](https://github.com/LedgerHQ/ledger-live/commit/6c35cc564cb050614ee571907f628ecf15ec4584), [`b9f1f71`](https://github.com/LedgerHQ/ledger-live/commit/b9f1f715355752d8c57c24ecd6a6d166b80f689d), [`815ae3d`](https://github.com/LedgerHQ/ledger-live/commit/815ae3dae8027823854ada837df3dc983d09b10f), [`de5de2d`](https://github.com/LedgerHQ/ledger-live/commit/de5de2d273ed6966c82bde2c3a95b98ba594204f), [`83e5690`](https://github.com/LedgerHQ/ledger-live/commit/83e5690429e41ecd1c508b3398904ae747085cf7), [`4c01029`](https://github.com/LedgerHQ/ledger-live/commit/4c01029b4d4feb32dab2f9e77da1126050d8c1bc), [`326cae0`](https://github.com/LedgerHQ/ledger-live/commit/326cae088cc33795536deb1d868c86e8dbeb6a13), [`6c35cc5`](https://github.com/LedgerHQ/ledger-live/commit/6c35cc564cb050614ee571907f628ecf15ec4584), [`4499990`](https://github.com/LedgerHQ/ledger-live/commit/449999066c58ae5df371dfb92a7230f9b5e90a60), [`a18c28e`](https://github.com/LedgerHQ/ledger-live/commit/a18c28e3f6a6132bd5e53d5b61721084b3aa19e8), [`cec1599`](https://github.com/LedgerHQ/ledger-live/commit/cec1599a41aa1a18a249e34312164bc93b63972f), [`801265b`](https://github.com/LedgerHQ/ledger-live/commit/801265b7ff3ed7ebd0012eb50f70898557a2dd52), [`6d44f25`](https://github.com/LedgerHQ/ledger-live/commit/6d44f255c5b2f453c61d0b754807db1f76d7174e), [`f19960f`](https://github.com/LedgerHQ/ledger-live/commit/f19960f2e7104e5bdf332269fa92fda47455e17d), [`3b9c93c`](https://github.com/LedgerHQ/ledger-live/commit/3b9c93c0de8ceff2af96a6ee8e42b8d9c2ab7af0), [`6623cd1`](https://github.com/LedgerHQ/ledger-live/commit/6623cd13102bd8340bd7d4dfdd469934527985c3), [`2f2b754`](https://github.com/LedgerHQ/ledger-live/commit/2f2b754b1350360ca0d9f761ca6e4a8cbaff141b), [`689e6e5`](https://github.com/LedgerHQ/ledger-live/commit/689e6e5a443170b8e6c2b404cc99af2e67d8e8e4), [`6552679`](https://github.com/LedgerHQ/ledger-live/commit/65526794bb4d1fbc7e286c0e1c0b6d021413fc8c), [`fda6a81`](https://github.com/LedgerHQ/ledger-live/commit/fda6a814544b3a1debceab22f69485911e76cadc), [`689e6e5`](https://github.com/LedgerHQ/ledger-live/commit/689e6e5a443170b8e6c2b404cc99af2e67d8e8e4), [`60cd799`](https://github.com/LedgerHQ/ledger-live/commit/60cd799e693e3ae0712a5a9e88206b5304bbc214), [`84274a6`](https://github.com/LedgerHQ/ledger-live/commit/84274a6e764a385f707bc811ead7a7e92a02ed6a)]: + - @ledgerhq/cryptoassets@13.1.0-next.0 + - @ledgerhq/devices@8.4.0-next.0 + - @ledgerhq/errors@6.17.0-next.0 + - @ledgerhq/coin-framework@0.14.0-next.0 + - @ledgerhq/domain-service@1.2.0-next.0 + - @ledgerhq/live-network@1.3.0-next.0 + - @ledgerhq/evm-tools@1.1.0-next.0 + - @ledgerhq/live-promise@0.1.0-next.0 + - @ledgerhq/live-env@2.1.0-next.0 + +## 2.0.0 + +### Major Changes + +- [#6669](https://github.com/LedgerHQ/ledger-live/pull/6669) [`fdb76a7`](https://github.com/LedgerHQ/ledger-live/commit/fdb76a7c3a8459a50b22b3e5a5a3002932805bcd) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Removing support for Goerli & Ropsten networks and their Layer 2 variants (Linea Goerli & Optimism Goerli) and replace them by Linea Sepolia & Optimism Sepolia + +### Minor Changes + +- [#6567](https://github.com/LedgerHQ/ledger-live/pull/6567) [`0dae8e5`](https://github.com/LedgerHQ/ledger-live/commit/0dae8e5a33704eaee5976e8ae2cbe29c6f458167) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Update `getSyncHash` method to use new hash files provided by token importers instead of manually serializing each token. This greatly improve performances of that method. + +### Patch Changes + +- [#6684](https://github.com/LedgerHQ/ledger-live/pull/6684) [`96029e1`](https://github.com/LedgerHQ/ledger-live/commit/96029e1396be2f283f0345a59e08009b0a6a96db) Thanks [@CremaFR](https://github.com/CremaFR)! - Allow additional fees when using maxButton + +- Updated dependencies [[`5552ca0`](https://github.com/LedgerHQ/ledger-live/commit/5552ca0542d5734b845ed23dae2f02c6d1b8ba2d), [`fdb76a7`](https://github.com/LedgerHQ/ledger-live/commit/fdb76a7c3a8459a50b22b3e5a5a3002932805bcd), [`df1dcbf`](https://github.com/LedgerHQ/ledger-live/commit/df1dcbffe901d7c4baddb46a06b08a4ed5b7a17e), [`3896648`](https://github.com/LedgerHQ/ledger-live/commit/389664874b98074905a7f8f8e5a845bb76908f13), [`45a53bc`](https://github.com/LedgerHQ/ledger-live/commit/45a53bc227ab2f42b1e839aacbb8c251d0a4a5d2), [`0dae8e5`](https://github.com/LedgerHQ/ledger-live/commit/0dae8e5a33704eaee5976e8ae2cbe29c6f458167), [`fdb76a7`](https://github.com/LedgerHQ/ledger-live/commit/fdb76a7c3a8459a50b22b3e5a5a3002932805bcd), [`0dae8e5`](https://github.com/LedgerHQ/ledger-live/commit/0dae8e5a33704eaee5976e8ae2cbe29c6f458167), [`cfb97f7`](https://github.com/LedgerHQ/ledger-live/commit/cfb97f7d5c81824815522e8699b7469047b1513a), [`2f2ef00`](https://github.com/LedgerHQ/ledger-live/commit/2f2ef001145469870ac703b6af28fdf8f0d70945)]: + - @ledgerhq/live-promise@0.0.4 + - @ledgerhq/coin-framework@0.13.0 + - @ledgerhq/live-env@2.0.2 + - @ledgerhq/cryptoassets@13.0.0 + - @ledgerhq/live-network@1.2.2 + - @ledgerhq/domain-service@1.1.21 + - @ledgerhq/evm-tools@1.0.19 + +## 2.0.0-next.1 + +### Patch Changes + +- Updated dependencies [[`5552ca0`](https://github.com/LedgerHQ/ledger-live/commit/5552ca0542d5734b845ed23dae2f02c6d1b8ba2d)]: + - @ledgerhq/live-promise@0.0.4-next.1 + - @ledgerhq/live-network@1.2.2-next.1 + +## 2.0.0-next.0 + +### Major Changes + +- [#6669](https://github.com/LedgerHQ/ledger-live/pull/6669) [`fdb76a7`](https://github.com/LedgerHQ/ledger-live/commit/fdb76a7c3a8459a50b22b3e5a5a3002932805bcd) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Removing support for Goerli & Ropsten networks and their Layer 2 variants (Linea Goerli & Optimism Goerli) and replace them by Linea Sepolia & Optimism Sepolia + +### Minor Changes + +- [#6567](https://github.com/LedgerHQ/ledger-live/pull/6567) [`0dae8e5`](https://github.com/LedgerHQ/ledger-live/commit/0dae8e5a33704eaee5976e8ae2cbe29c6f458167) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Update `getSyncHash` method to use new hash files provided by token importers instead of manually serializing each token. This greatly improve performances of that method. + +### Patch Changes + +- [#6684](https://github.com/LedgerHQ/ledger-live/pull/6684) [`96029e1`](https://github.com/LedgerHQ/ledger-live/commit/96029e1396be2f283f0345a59e08009b0a6a96db) Thanks [@CremaFR](https://github.com/CremaFR)! - Allow additional fees when using maxButton + +- Updated dependencies [[`fdb76a7`](https://github.com/LedgerHQ/ledger-live/commit/fdb76a7c3a8459a50b22b3e5a5a3002932805bcd), [`df1dcbf`](https://github.com/LedgerHQ/ledger-live/commit/df1dcbffe901d7c4baddb46a06b08a4ed5b7a17e), [`3896648`](https://github.com/LedgerHQ/ledger-live/commit/389664874b98074905a7f8f8e5a845bb76908f13), [`45a53bc`](https://github.com/LedgerHQ/ledger-live/commit/45a53bc227ab2f42b1e839aacbb8c251d0a4a5d2), [`0dae8e5`](https://github.com/LedgerHQ/ledger-live/commit/0dae8e5a33704eaee5976e8ae2cbe29c6f458167), [`fdb76a7`](https://github.com/LedgerHQ/ledger-live/commit/fdb76a7c3a8459a50b22b3e5a5a3002932805bcd), [`0dae8e5`](https://github.com/LedgerHQ/ledger-live/commit/0dae8e5a33704eaee5976e8ae2cbe29c6f458167), [`cfb97f7`](https://github.com/LedgerHQ/ledger-live/commit/cfb97f7d5c81824815522e8699b7469047b1513a), [`2f2ef00`](https://github.com/LedgerHQ/ledger-live/commit/2f2ef001145469870ac703b6af28fdf8f0d70945)]: + - @ledgerhq/coin-framework@0.13.0-next.0 + - @ledgerhq/live-env@2.0.2-next.0 + - @ledgerhq/cryptoassets@13.0.0-next.0 + - @ledgerhq/live-network@1.2.2-next.0 + - @ledgerhq/live-promise@0.0.4-next.0 + - @ledgerhq/domain-service@1.1.21-next.0 + - @ledgerhq/evm-tools@1.0.19-next.0 + +## 1.1.0 + +### Minor Changes + +- [#6309](https://github.com/LedgerHQ/ledger-live/pull/6309) [`5848f9e`](https://github.com/LedgerHQ/ledger-live/commit/5848f9e247f169eb7a4aff322253937214b9efdd) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Removes never publicly exposed Evmos & Kava currencies. Also fixes multiple Etherscan based explorers URI (Lukso, RSK, Astar & Boba). + +- [#6290](https://github.com/LedgerHQ/ledger-live/pull/6290) [`08c9779`](https://github.com/LedgerHQ/ledger-live/commit/08c9779659628e4e22ac99a152049ac3fa2745fa) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Add `chainId` while using the `hw-getAddress` method to display the network name and logo on a Stax device + +- [#6422](https://github.com/LedgerHQ/ledger-live/pull/6422) [`381023d`](https://github.com/LedgerHQ/ledger-live/commit/381023de2617aa09829a8b5dad7b0ba2c846328e) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Fix Operations' amount depending if failure and remove internal operations from a failed coin operation + +- [#6482](https://github.com/LedgerHQ/ledger-live/pull/6482) [`83d0bc6`](https://github.com/LedgerHQ/ledger-live/commit/83d0bc67979159044a7785b5cb4cbda8ed78ebf4) Thanks [@vbergeron-ledger](https://github.com/vbergeron-ledger)! - EVM coin synchronozation is now optimized to start from the latest sync rather than from the latest operation + +### Patch Changes + +- [#6501](https://github.com/LedgerHQ/ledger-live/pull/6501) [`5e939e0`](https://github.com/LedgerHQ/ledger-live/commit/5e939e0540cabb8d9931794b79909fe0a353a179) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Add missing index to Ledger ERC20 operations' ids, leading to missing token ops in history + +- [#6341](https://github.com/LedgerHQ/ledger-live/pull/6341) [`92e9d19`](https://github.com/LedgerHQ/ledger-live/commit/92e9d194313ffd1542b676c59ae2d34e861f698f) Thanks [@sarneijim](https://github.com/sarneijim)! - Fix swap history + +- [#6370](https://github.com/LedgerHQ/ledger-live/pull/6370) [`3c15515`](https://github.com/LedgerHQ/ledger-live/commit/3c155155f2d45fb85f8900e7e77c1b5ab1c7ad67) Thanks [@lvndry](https://github.com/lvndry)! - Get evm node, explorer and gasTracker information from liveconfig + +- Updated dependencies [[`1aa8ef4`](https://github.com/LedgerHQ/ledger-live/commit/1aa8ef404411c31f6ac4cf09fba453042db8b955), [`3c15515`](https://github.com/LedgerHQ/ledger-live/commit/3c155155f2d45fb85f8900e7e77c1b5ab1c7ad67), [`762dea1`](https://github.com/LedgerHQ/ledger-live/commit/762dea1c52ef0537961d058f7ba81fa399663ac1), [`fc4f83e`](https://github.com/LedgerHQ/ledger-live/commit/fc4f83e26d9f00b7c518f28157e8d9da55ce3685), [`dd1d17f`](https://github.com/LedgerHQ/ledger-live/commit/dd1d17fd3ce7ed42558204b2f93707fb9b1599de), [`26b3a5d`](https://github.com/LedgerHQ/ledger-live/commit/26b3a5d7d6e11efc226403707d683f3d0098a1c1), [`5848f9e`](https://github.com/LedgerHQ/ledger-live/commit/5848f9e247f169eb7a4aff322253937214b9efdd), [`a8138f9`](https://github.com/LedgerHQ/ledger-live/commit/a8138f9ec0cff714d9745012eb91a09713ffbbd2), [`ebb45be`](https://github.com/LedgerHQ/ledger-live/commit/ebb45be56c6b1fdb3c36a8c20a16b41600baa264), [`53da330`](https://github.com/LedgerHQ/ledger-live/commit/53da3301aaceeb16e6b1f96b1ea44428fbeb4483), [`abb1bbb`](https://github.com/LedgerHQ/ledger-live/commit/abb1bbb09c52a3d08577ba622c6cb0f44aab36c1)]: + - @ledgerhq/coin-framework@0.12.0 + - @ledgerhq/cryptoassets@12.1.0 + - @ledgerhq/live-env@2.0.1 + - @ledgerhq/errors@6.16.4 + - @ledgerhq/devices@8.3.0 + - @ledgerhq/domain-service@1.1.20 + - @ledgerhq/evm-tools@1.0.18 + - @ledgerhq/live-network@1.2.1 + +## 1.1.0-next.1 + +### Patch Changes + +- Updated dependencies [[`762dea1`](https://github.com/LedgerHQ/ledger-live/commit/762dea1c52ef0537961d058f7ba81fa399663ac1)]: + - @ledgerhq/live-env@2.0.1-next.0 + - @ledgerhq/coin-framework@0.12.0-next.1 + - @ledgerhq/evm-tools@1.0.18-next.1 + - @ledgerhq/live-network@1.2.1-next.1 + +## 1.1.0-next.0 + +### Minor Changes + +- [#6309](https://github.com/LedgerHQ/ledger-live/pull/6309) [`5848f9e`](https://github.com/LedgerHQ/ledger-live/commit/5848f9e247f169eb7a4aff322253937214b9efdd) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Removes never publicly exposed Evmos & Kava currencies. Also fixes multiple Etherscan based explorers URI (Lukso, RSK, Astar & Boba). + +- [#6290](https://github.com/LedgerHQ/ledger-live/pull/6290) [`08c9779`](https://github.com/LedgerHQ/ledger-live/commit/08c9779659628e4e22ac99a152049ac3fa2745fa) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Add `chainId` while using the `hw-getAddress` method to display the network name and logo on a Stax device + +- [#6422](https://github.com/LedgerHQ/ledger-live/pull/6422) [`381023d`](https://github.com/LedgerHQ/ledger-live/commit/381023de2617aa09829a8b5dad7b0ba2c846328e) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Fix Operations' amount depending if failure and remove internal operations from a failed coin operation + +- [#6482](https://github.com/LedgerHQ/ledger-live/pull/6482) [`83d0bc6`](https://github.com/LedgerHQ/ledger-live/commit/83d0bc67979159044a7785b5cb4cbda8ed78ebf4) Thanks [@vbergeron-ledger](https://github.com/vbergeron-ledger)! - EVM coin synchronozation is now optimized to start from the latest sync rather than from the latest operation + +### Patch Changes + +- [#6501](https://github.com/LedgerHQ/ledger-live/pull/6501) [`5e939e0`](https://github.com/LedgerHQ/ledger-live/commit/5e939e0540cabb8d9931794b79909fe0a353a179) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Add missing index to Ledger ERC20 operations' ids, leading to missing token ops in history + +- [#6341](https://github.com/LedgerHQ/ledger-live/pull/6341) [`92e9d19`](https://github.com/LedgerHQ/ledger-live/commit/92e9d194313ffd1542b676c59ae2d34e861f698f) Thanks [@sarneijim](https://github.com/sarneijim)! - Fix swap history + +- [#6370](https://github.com/LedgerHQ/ledger-live/pull/6370) [`3c15515`](https://github.com/LedgerHQ/ledger-live/commit/3c155155f2d45fb85f8900e7e77c1b5ab1c7ad67) Thanks [@lvndry](https://github.com/lvndry)! - Get evm node, explorer and gasTracker information from liveconfig + +- Updated dependencies [[`1aa8ef4`](https://github.com/LedgerHQ/ledger-live/commit/1aa8ef404411c31f6ac4cf09fba453042db8b955), [`3c15515`](https://github.com/LedgerHQ/ledger-live/commit/3c155155f2d45fb85f8900e7e77c1b5ab1c7ad67), [`fc4f83e`](https://github.com/LedgerHQ/ledger-live/commit/fc4f83e26d9f00b7c518f28157e8d9da55ce3685), [`dd1d17f`](https://github.com/LedgerHQ/ledger-live/commit/dd1d17fd3ce7ed42558204b2f93707fb9b1599de), [`26b3a5d`](https://github.com/LedgerHQ/ledger-live/commit/26b3a5d7d6e11efc226403707d683f3d0098a1c1), [`5848f9e`](https://github.com/LedgerHQ/ledger-live/commit/5848f9e247f169eb7a4aff322253937214b9efdd), [`a8138f9`](https://github.com/LedgerHQ/ledger-live/commit/a8138f9ec0cff714d9745012eb91a09713ffbbd2), [`ebb45be`](https://github.com/LedgerHQ/ledger-live/commit/ebb45be56c6b1fdb3c36a8c20a16b41600baa264), [`53da330`](https://github.com/LedgerHQ/ledger-live/commit/53da3301aaceeb16e6b1f96b1ea44428fbeb4483), [`abb1bbb`](https://github.com/LedgerHQ/ledger-live/commit/abb1bbb09c52a3d08577ba622c6cb0f44aab36c1)]: + - @ledgerhq/coin-framework@0.12.0-next.0 + - @ledgerhq/cryptoassets@12.1.0-next.0 + - @ledgerhq/errors@6.16.4-next.0 + - @ledgerhq/devices@8.3.0-next.0 + - @ledgerhq/domain-service@1.1.20-next.0 + - @ledgerhq/evm-tools@1.0.18-next.0 + - @ledgerhq/live-network@1.2.1-next.0 + +## 1.0.0 + +### Major Changes + +- [#6195](https://github.com/LedgerHQ/ledger-live/pull/6195) [`dfac39b`](https://github.com/LedgerHQ/ledger-live/commit/dfac39b2086f0475d1bc8065032bfe27cbf424f6) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Deprecating Arbitrum goerli & Base goerli + +### Minor Changes + +- [#6179](https://github.com/LedgerHQ/ledger-live/pull/6179) [`25fe5c4`](https://github.com/LedgerHQ/ledger-live/commit/25fe5c48d44d3d1b11e35b81bb4bf31d30fa1268) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Update `DEFAULT_NONCE` (-1) behaviour when converting a Ledger Live transaction to an `ethers` transaction, because using an invalid nonce (like a negative value here) will make `ethers` throw with some of its methods, like `serializeTransaction` + +- [#6196](https://github.com/LedgerHQ/ledger-live/pull/6196) [`255476b`](https://github.com/LedgerHQ/ledger-live/commit/255476bd65b15971eb523807fe9795c84882f198) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Add suppport of `blacklistedTokenIds` to coin-evm synchronization + +- [#6195](https://github.com/LedgerHQ/ledger-live/pull/6195) [`dfac39b`](https://github.com/LedgerHQ/ledger-live/commit/dfac39b2086f0475d1bc8065032bfe27cbf424f6) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Add support for Base Sepolia & Arbitrum Sepolia + +### Patch Changes + +- [#6041](https://github.com/LedgerHQ/ledger-live/pull/6041) [`9c83695`](https://github.com/LedgerHQ/ledger-live/commit/9c8369580b91d82021d4ec28ad7a49dc4ba42e4f) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Remove unnecessary logs + +- [#5682](https://github.com/LedgerHQ/ledger-live/pull/5682) [`4744c31`](https://github.com/LedgerHQ/ledger-live/commit/4744c3136021f1f47ad1617f2c84f47ac0647370) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Make `hw-app-eth` a devDep by relying on `clearSignTransaction` instead of importing the `ledgerService` + +- [#5682](https://github.com/LedgerHQ/ledger-live/pull/5682) [`4744c31`](https://github.com/LedgerHQ/ledger-live/commit/4744c3136021f1f47ad1617f2c84f47ac0647370) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Add documentation + +- [#5682](https://github.com/LedgerHQ/ledger-live/pull/5682) [`4744c31`](https://github.com/LedgerHQ/ledger-live/commit/4744c3136021f1f47ad1617f2c84f47ac0647370) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Move clear signed selectors to evm-tools lib + +- [#5682](https://github.com/LedgerHQ/ledger-live/pull/5682) [`4744c31`](https://github.com/LedgerHQ/ledger-live/commit/4744c3136021f1f47ad1617f2c84f47ac0647370) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Update `NotEnoughBalance` error for token transactions + +- Updated dependencies [[`4744c31`](https://github.com/LedgerHQ/ledger-live/commit/4744c3136021f1f47ad1617f2c84f47ac0647370), [`0dd1546`](https://github.com/LedgerHQ/ledger-live/commit/0dd15467070cbf7fcbb9d9055a4535f6a25b2ad0), [`f456d69`](https://github.com/LedgerHQ/ledger-live/commit/f456d69a2f64b6a217d3c1d9c6a531f31c2817a8), [`4715e4c`](https://github.com/LedgerHQ/ledger-live/commit/4715e4c411fa2396330ebcb810aeb6bfc9892e88), [`9c83695`](https://github.com/LedgerHQ/ledger-live/commit/9c8369580b91d82021d4ec28ad7a49dc4ba42e4f), [`74ef384`](https://github.com/LedgerHQ/ledger-live/commit/74ef3840c17181fa779035f190f829e9537e1539), [`2fd465e`](https://github.com/LedgerHQ/ledger-live/commit/2fd465ee730b11594d231503cfb940b984fa2f5a), [`dfac39b`](https://github.com/LedgerHQ/ledger-live/commit/dfac39b2086f0475d1bc8065032bfe27cbf424f6), [`7fb3eb2`](https://github.com/LedgerHQ/ledger-live/commit/7fb3eb266acdca143c94d2fce74329809ebfbb79), [`4744c31`](https://github.com/LedgerHQ/ledger-live/commit/4744c3136021f1f47ad1617f2c84f47ac0647370), [`bd4ee6c`](https://github.com/LedgerHQ/ledger-live/commit/bd4ee6c938c27102c2d0529c2aab07ac000f7424), [`dfac39b`](https://github.com/LedgerHQ/ledger-live/commit/dfac39b2086f0475d1bc8065032bfe27cbf424f6), [`2e5185b`](https://github.com/LedgerHQ/ledger-live/commit/2e5185b3dba497c956272068128e49db72e8af2a)]: + - @ledgerhq/live-env@2.0.0 + - @ledgerhq/errors@6.16.3 + - @ledgerhq/cryptoassets@12.0.0 + - @ledgerhq/coin-framework@0.11.3 + - @ledgerhq/evm-tools@1.0.17 + - @ledgerhq/live-network@1.2.0 + - @ledgerhq/domain-service@1.1.19 + - @ledgerhq/devices@8.2.2 + +## 1.0.0-next.1 + +### Patch Changes + +- [#6375](https://github.com/LedgerHQ/ledger-live/pull/6375) [`09128f3`](https://github.com/LedgerHQ/ledger-live/commit/09128f3fd41285199122115324964d83befe9237) Thanks [@CremaFR](https://github.com/CremaFR)! - Allow additional fees when using maxButton + +## 1.0.0-next.0 + +### Major Changes + +- [#6195](https://github.com/LedgerHQ/ledger-live/pull/6195) [`dfac39b`](https://github.com/LedgerHQ/ledger-live/commit/dfac39b2086f0475d1bc8065032bfe27cbf424f6) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Deprecating Arbitrum goerli & Base goerli + +### Minor Changes + +- [#6179](https://github.com/LedgerHQ/ledger-live/pull/6179) [`25fe5c4`](https://github.com/LedgerHQ/ledger-live/commit/25fe5c48d44d3d1b11e35b81bb4bf31d30fa1268) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Update `DEFAULT_NONCE` (-1) behaviour when converting a Ledger Live transaction to an `ethers` transaction, because using an invalid nonce (like a negative value here) will make `ethers` throw with some of its methods, like `serializeTransaction` + +- [#6196](https://github.com/LedgerHQ/ledger-live/pull/6196) [`255476b`](https://github.com/LedgerHQ/ledger-live/commit/255476bd65b15971eb523807fe9795c84882f198) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Add suppport of `blacklistedTokenIds` to coin-evm synchronization + +- [#6195](https://github.com/LedgerHQ/ledger-live/pull/6195) [`dfac39b`](https://github.com/LedgerHQ/ledger-live/commit/dfac39b2086f0475d1bc8065032bfe27cbf424f6) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Add support for Base Sepolia & Arbitrum Sepolia + +### Patch Changes + +- [#6041](https://github.com/LedgerHQ/ledger-live/pull/6041) [`9c83695`](https://github.com/LedgerHQ/ledger-live/commit/9c8369580b91d82021d4ec28ad7a49dc4ba42e4f) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Remove unnecessary logs + +- [#5682](https://github.com/LedgerHQ/ledger-live/pull/5682) [`4744c31`](https://github.com/LedgerHQ/ledger-live/commit/4744c3136021f1f47ad1617f2c84f47ac0647370) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Make `hw-app-eth` a devDep by relying on `clearSignTransaction` instead of importing the `ledgerService` + +- [#5682](https://github.com/LedgerHQ/ledger-live/pull/5682) [`4744c31`](https://github.com/LedgerHQ/ledger-live/commit/4744c3136021f1f47ad1617f2c84f47ac0647370) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Add documentation + +- [#5682](https://github.com/LedgerHQ/ledger-live/pull/5682) [`4744c31`](https://github.com/LedgerHQ/ledger-live/commit/4744c3136021f1f47ad1617f2c84f47ac0647370) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Move clear signed selectors to evm-tools lib + +- [#5682](https://github.com/LedgerHQ/ledger-live/pull/5682) [`4744c31`](https://github.com/LedgerHQ/ledger-live/commit/4744c3136021f1f47ad1617f2c84f47ac0647370) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Update `NotEnoughBalance` error for token transactions + +- Updated dependencies [[`4744c31`](https://github.com/LedgerHQ/ledger-live/commit/4744c3136021f1f47ad1617f2c84f47ac0647370), [`0dd1546`](https://github.com/LedgerHQ/ledger-live/commit/0dd15467070cbf7fcbb9d9055a4535f6a25b2ad0), [`f456d69`](https://github.com/LedgerHQ/ledger-live/commit/f456d69a2f64b6a217d3c1d9c6a531f31c2817a8), [`4715e4c`](https://github.com/LedgerHQ/ledger-live/commit/4715e4c411fa2396330ebcb810aeb6bfc9892e88), [`9c83695`](https://github.com/LedgerHQ/ledger-live/commit/9c8369580b91d82021d4ec28ad7a49dc4ba42e4f), [`74ef384`](https://github.com/LedgerHQ/ledger-live/commit/74ef3840c17181fa779035f190f829e9537e1539), [`2fd465e`](https://github.com/LedgerHQ/ledger-live/commit/2fd465ee730b11594d231503cfb940b984fa2f5a), [`dfac39b`](https://github.com/LedgerHQ/ledger-live/commit/dfac39b2086f0475d1bc8065032bfe27cbf424f6), [`7fb3eb2`](https://github.com/LedgerHQ/ledger-live/commit/7fb3eb266acdca143c94d2fce74329809ebfbb79), [`4744c31`](https://github.com/LedgerHQ/ledger-live/commit/4744c3136021f1f47ad1617f2c84f47ac0647370), [`bd4ee6c`](https://github.com/LedgerHQ/ledger-live/commit/bd4ee6c938c27102c2d0529c2aab07ac000f7424), [`dfac39b`](https://github.com/LedgerHQ/ledger-live/commit/dfac39b2086f0475d1bc8065032bfe27cbf424f6), [`2e5185b`](https://github.com/LedgerHQ/ledger-live/commit/2e5185b3dba497c956272068128e49db72e8af2a)]: + - @ledgerhq/live-env@2.0.0-next.0 + - @ledgerhq/errors@6.16.3-next.0 + - @ledgerhq/cryptoassets@12.0.0-next.0 + - @ledgerhq/coin-framework@0.11.3-next.0 + - @ledgerhq/evm-tools@1.0.17-next.0 + - @ledgerhq/live-network@1.2.0-next.0 + - @ledgerhq/domain-service@1.1.19-next.0 + - @ledgerhq/devices@8.2.2-next.0 + +## 0.12.3 + +### Patch Changes + +- Updated dependencies [[`884cfd6`](https://github.com/LedgerHQ/ledger-live/commit/884cfd64a1440d393fb983dfe361be9c78f3b81c), [`3e28615`](https://github.com/LedgerHQ/ledger-live/commit/3e28615a8d5edbec3eff1e93207bf0e9d017666a)]: + - @ledgerhq/cryptoassets@11.4.1 + - @ledgerhq/live-env@1.0.1 + - @ledgerhq/coin-framework@0.11.2 + - @ledgerhq/evm-tools@1.0.16 + - @ledgerhq/live-network@1.1.13 + +## 0.12.3-hotfix.1 + +### Patch Changes + +- Updated dependencies [[`884cfd6`](https://github.com/LedgerHQ/ledger-live/commit/884cfd64a1440d393fb983dfe361be9c78f3b81c)]: + - @ledgerhq/cryptoassets@11.4.1-hotfix.0 + - @ledgerhq/coin-framework@0.11.2-hotfix.1 + - @ledgerhq/evm-tools@1.0.16-hotfix.1 + +## 0.12.3-hotfix.0 + +### Patch Changes + +- Updated dependencies [[`3e28615`](https://github.com/LedgerHQ/ledger-live/commit/3e28615a8d5edbec3eff1e93207bf0e9d017666a)]: + - @ledgerhq/live-env@1.0.1-hotfix.0 + - @ledgerhq/coin-framework@0.11.2-hotfix.0 + - @ledgerhq/evm-tools@1.0.16-hotfix.0 + - @ledgerhq/live-network@1.1.13-hotfix.0 + +## 0.12.2 + +### Patch Changes + +- [#6165](https://github.com/LedgerHQ/ledger-live/pull/6165) [`8d99b81`](https://github.com/LedgerHQ/ledger-live/commit/8d99b81feaf5e8d46e0c26f34bc70b709a7e3c14) Thanks [@live-github-bot](https://github.com/apps/live-github-bot)! - Remove unnecessary logs + +- [#6165](https://github.com/LedgerHQ/ledger-live/pull/6165) [`c18a0cf`](https://github.com/LedgerHQ/ledger-live/commit/c18a0cfdce5d1e44faf8d8bd5659ebdae38533fa) Thanks [@live-github-bot](https://github.com/apps/live-github-bot)! - Make `hw-app-eth` a devDep by relying on `clearSignTransaction` instead of importing the `ledgerService` + +- [#6165](https://github.com/LedgerHQ/ledger-live/pull/6165) [`c18a0cf`](https://github.com/LedgerHQ/ledger-live/commit/c18a0cfdce5d1e44faf8d8bd5659ebdae38533fa) Thanks [@live-github-bot](https://github.com/apps/live-github-bot)! - Add documentation + +- [#6165](https://github.com/LedgerHQ/ledger-live/pull/6165) [`c18a0cf`](https://github.com/LedgerHQ/ledger-live/commit/c18a0cfdce5d1e44faf8d8bd5659ebdae38533fa) Thanks [@live-github-bot](https://github.com/apps/live-github-bot)! - Move clear signed selectors to evm-tools lib + +- [#6165](https://github.com/LedgerHQ/ledger-live/pull/6165) [`c18a0cf`](https://github.com/LedgerHQ/ledger-live/commit/c18a0cfdce5d1e44faf8d8bd5659ebdae38533fa) Thanks [@live-github-bot](https://github.com/apps/live-github-bot)! - Update `NotEnoughBalance` error for token transactions + +- Updated dependencies [[`c18a0cf`](https://github.com/LedgerHQ/ledger-live/commit/c18a0cfdce5d1e44faf8d8bd5659ebdae38533fa), [`ee88785`](https://github.com/LedgerHQ/ledger-live/commit/ee8878515671241ce1037362af5e8f7799b3673a), [`8d99b81`](https://github.com/LedgerHQ/ledger-live/commit/8d99b81feaf5e8d46e0c26f34bc70b709a7e3c14), [`628fa73`](https://github.com/LedgerHQ/ledger-live/commit/628fa732866a6018287ca7bc3d463acb3f5cd6b9), [`43eea9e`](https://github.com/LedgerHQ/ledger-live/commit/43eea9e8076f2c9d5aeb0f8a3b0738e97b3152c8), [`c18a0cf`](https://github.com/LedgerHQ/ledger-live/commit/c18a0cfdce5d1e44faf8d8bd5659ebdae38533fa), [`b444092`](https://github.com/LedgerHQ/ledger-live/commit/b444092040af249ae45e5ee18d75be420f9f26f8)]: + - @ledgerhq/live-env@1.0.0 + - @ledgerhq/errors@6.16.2 + - @ledgerhq/coin-framework@0.11.1 + - @ledgerhq/evm-tools@1.0.15 + - @ledgerhq/domain-service@1.1.18 + - @ledgerhq/live-network@1.1.12 + - @ledgerhq/devices@8.2.1 + +## 0.12.2-next.0 + +### Patch Changes + +- [#6041](https://github.com/LedgerHQ/ledger-live/pull/6041) [`9c83695`](https://github.com/LedgerHQ/ledger-live/commit/9c8369580b91d82021d4ec28ad7a49dc4ba42e4f) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Remove unnecessary logs + +- [#5682](https://github.com/LedgerHQ/ledger-live/pull/5682) [`4744c31`](https://github.com/LedgerHQ/ledger-live/commit/4744c3136021f1f47ad1617f2c84f47ac0647370) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Make `hw-app-eth` a devDep by relying on `clearSignTransaction` instead of importing the `ledgerService` + +- [#5682](https://github.com/LedgerHQ/ledger-live/pull/5682) [`4744c31`](https://github.com/LedgerHQ/ledger-live/commit/4744c3136021f1f47ad1617f2c84f47ac0647370) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Add documentation + +- [#5682](https://github.com/LedgerHQ/ledger-live/pull/5682) [`4744c31`](https://github.com/LedgerHQ/ledger-live/commit/4744c3136021f1f47ad1617f2c84f47ac0647370) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Move clear signed selectors to evm-tools lib + +- [#5682](https://github.com/LedgerHQ/ledger-live/pull/5682) [`4744c31`](https://github.com/LedgerHQ/ledger-live/commit/4744c3136021f1f47ad1617f2c84f47ac0647370) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Update `NotEnoughBalance` error for token transactions + +- Updated dependencies [[`4744c31`](https://github.com/LedgerHQ/ledger-live/commit/4744c3136021f1f47ad1617f2c84f47ac0647370), [`f456d69`](https://github.com/LedgerHQ/ledger-live/commit/f456d69a2f64b6a217d3c1d9c6a531f31c2817a8), [`9c83695`](https://github.com/LedgerHQ/ledger-live/commit/9c8369580b91d82021d4ec28ad7a49dc4ba42e4f), [`74ef384`](https://github.com/LedgerHQ/ledger-live/commit/74ef3840c17181fa779035f190f829e9537e1539), [`2fd465e`](https://github.com/LedgerHQ/ledger-live/commit/2fd465ee730b11594d231503cfb940b984fa2f5a), [`4744c31`](https://github.com/LedgerHQ/ledger-live/commit/4744c3136021f1f47ad1617f2c84f47ac0647370), [`bd4ee6c`](https://github.com/LedgerHQ/ledger-live/commit/bd4ee6c938c27102c2d0529c2aab07ac000f7424)]: + - @ledgerhq/live-env@1.0.0-next.0 + - @ledgerhq/errors@6.16.2-next.0 + - @ledgerhq/coin-framework@0.11.1-next.0 + - @ledgerhq/evm-tools@1.0.15-next.0 + - @ledgerhq/domain-service@1.1.18-next.0 + - @ledgerhq/live-network@1.1.12-next.0 + - @ledgerhq/devices@8.2.1-next.0 + +## 0.12.1 + +### Patch Changes + +- Updated dependencies []: + - @ledgerhq/hw-app-eth@6.35.4 + - @ledgerhq/coin-framework@0.11.0 + +## 0.12.1-next.0 + +### Patch Changes + +- Updated dependencies []: + - @ledgerhq/hw-app-eth@6.35.4-next.0 + - @ledgerhq/coin-framework@0.11.0 + +## 0.12.0 + +### Minor Changes + +- [#5722](https://github.com/LedgerHQ/ledger-live/pull/5722) [`2358e87`](https://github.com/LedgerHQ/ledger-live/commit/2358e8748d9ae9398cfc05a0ec20a6b191fc7324) Thanks [@chabroA](https://github.com/chabroA)! - Add Ethereum Sepolia and Holesky + +- [#5744](https://github.com/LedgerHQ/ledger-live/pull/5744) [`ed23f46`](https://github.com/LedgerHQ/ledger-live/commit/ed23f4680d4ed1020bf34ac05b064ff659a282f5) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Add support for internal transactions in transactions' history + +### Patch Changes + +- [#5743](https://github.com/LedgerHQ/ledger-live/pull/5743) [`e494a2b`](https://github.com/LedgerHQ/ledger-live/commit/e494a2b984fb0406fe9225bb4eccde3d9585efe1) Thanks [@chabroA](https://github.com/chabroA)! - remove unreachable statement + +- [#5780](https://github.com/LedgerHQ/ledger-live/pull/5780) [`2b627ae`](https://github.com/LedgerHQ/ledger-live/commit/2b627aebddef859b9cb62467353e7d868bfbc4f9) Thanks [@mle-gall](https://github.com/mle-gall)! - Parent Account Error on gas fees LLD + +- [#5780](https://github.com/LedgerHQ/ledger-live/pull/5780) [`17d1f86`](https://github.com/LedgerHQ/ledger-live/commit/17d1f86022f0122ac85ca6489eb4698c7d9045fb) Thanks [@mle-gall](https://github.com/mle-gall)! - New LLM gas fees parent account error + +- Updated dependencies [[`fc2cf04`](https://github.com/LedgerHQ/ledger-live/commit/fc2cf04c8d3cd55503ea19aeb21fd12ee55046f6), [`dd5d930`](https://github.com/LedgerHQ/ledger-live/commit/dd5d9308e0e3ef8ca78f879c15bc07313ef3c8c4), [`a4a72da`](https://github.com/LedgerHQ/ledger-live/commit/a4a72da33ddfefd5ba69ac4d9ecb33d7775583f1), [`acc0605`](https://github.com/LedgerHQ/ledger-live/commit/acc06050b622f8d4265be9f962c6c83b1fbaefd5), [`2358e87`](https://github.com/LedgerHQ/ledger-live/commit/2358e8748d9ae9398cfc05a0ec20a6b191fc7324), [`65772fb`](https://github.com/LedgerHQ/ledger-live/commit/65772fbcc1e6887d60ca585147123d356914ba56), [`69bbdce`](https://github.com/LedgerHQ/ledger-live/commit/69bbdce5c88d69248cbddb94ac4627334c1df626), [`b74faea`](https://github.com/LedgerHQ/ledger-live/commit/b74faea05f856860a253c5b94a9333810a3446ca), [`0375de1`](https://github.com/LedgerHQ/ledger-live/commit/0375de19ca909b0b013992c114b0fa2ead2a08f3)]: + - @ledgerhq/cryptoassets@11.4.0 + - @ledgerhq/live-network@1.1.11 + - @ledgerhq/types-live@6.44.0 + - @ledgerhq/coin-framework@0.11.0 + - @ledgerhq/types-cryptoassets@7.9.0 + - @ledgerhq/live-env@0.9.0 + - @ledgerhq/evm-tools@1.0.14 + - @ledgerhq/hw-app-eth@6.35.3 + - @ledgerhq/domain-service@1.1.17 + +## 0.12.0-next.0 + +### Minor Changes + +- [#5722](https://github.com/LedgerHQ/ledger-live/pull/5722) [`2358e87`](https://github.com/LedgerHQ/ledger-live/commit/2358e8748d9ae9398cfc05a0ec20a6b191fc7324) Thanks [@chabroA](https://github.com/chabroA)! - Add Ethereum Sepolia and Holesky + +- [#5744](https://github.com/LedgerHQ/ledger-live/pull/5744) [`ed23f46`](https://github.com/LedgerHQ/ledger-live/commit/ed23f4680d4ed1020bf34ac05b064ff659a282f5) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Add support for internal transactions in transactions' history + +### Patch Changes + +- [#5743](https://github.com/LedgerHQ/ledger-live/pull/5743) [`e494a2b`](https://github.com/LedgerHQ/ledger-live/commit/e494a2b984fb0406fe9225bb4eccde3d9585efe1) Thanks [@chabroA](https://github.com/chabroA)! - remove unreachable statement + +- [#5780](https://github.com/LedgerHQ/ledger-live/pull/5780) [`2b627ae`](https://github.com/LedgerHQ/ledger-live/commit/2b627aebddef859b9cb62467353e7d868bfbc4f9) Thanks [@mle-gall](https://github.com/mle-gall)! - Parent Account Error on gas fees LLD + +- [#5780](https://github.com/LedgerHQ/ledger-live/pull/5780) [`17d1f86`](https://github.com/LedgerHQ/ledger-live/commit/17d1f86022f0122ac85ca6489eb4698c7d9045fb) Thanks [@mle-gall](https://github.com/mle-gall)! - New LLM gas fees parent account error + +- Updated dependencies [[`fc2cf04`](https://github.com/LedgerHQ/ledger-live/commit/fc2cf04c8d3cd55503ea19aeb21fd12ee55046f6), [`dd5d930`](https://github.com/LedgerHQ/ledger-live/commit/dd5d9308e0e3ef8ca78f879c15bc07313ef3c8c4), [`a4a72da`](https://github.com/LedgerHQ/ledger-live/commit/a4a72da33ddfefd5ba69ac4d9ecb33d7775583f1), [`acc0605`](https://github.com/LedgerHQ/ledger-live/commit/acc06050b622f8d4265be9f962c6c83b1fbaefd5), [`2358e87`](https://github.com/LedgerHQ/ledger-live/commit/2358e8748d9ae9398cfc05a0ec20a6b191fc7324), [`65772fb`](https://github.com/LedgerHQ/ledger-live/commit/65772fbcc1e6887d60ca585147123d356914ba56), [`69bbdce`](https://github.com/LedgerHQ/ledger-live/commit/69bbdce5c88d69248cbddb94ac4627334c1df626), [`b74faea`](https://github.com/LedgerHQ/ledger-live/commit/b74faea05f856860a253c5b94a9333810a3446ca), [`0375de1`](https://github.com/LedgerHQ/ledger-live/commit/0375de19ca909b0b013992c114b0fa2ead2a08f3)]: + - @ledgerhq/cryptoassets@11.4.0-next.0 + - @ledgerhq/live-network@1.1.11-next.0 + - @ledgerhq/types-live@6.44.0-next.0 + - @ledgerhq/coin-framework@0.11.0-next.0 + - @ledgerhq/types-cryptoassets@7.9.0-next.0 + - @ledgerhq/live-env@0.9.0-next.0 + - @ledgerhq/evm-tools@1.0.14-next.0 + - @ledgerhq/hw-app-eth@6.35.3-next.0 + - @ledgerhq/domain-service@1.1.17-next.0 + +## 0.11.2 + +### Patch Changes + +- Updated dependencies [[`d49f444`](https://github.com/LedgerHQ/ledger-live/commit/d49f44417fd175affe71da589c0ca380e88fbb35)]: + - @ledgerhq/cryptoassets@11.3.1 + - @ledgerhq/coin-framework@0.10.1 + - @ledgerhq/evm-tools@1.0.13 + - @ledgerhq/hw-app-eth@6.35.2 + +## 0.11.2-next.0 + +### Patch Changes + +- Updated dependencies [[`d49f444`](https://github.com/LedgerHQ/ledger-live/commit/d49f44417fd175affe71da589c0ca380e88fbb35)]: + - @ledgerhq/cryptoassets@11.3.1-next.0 + - @ledgerhq/coin-framework@0.10.1-next.0 + - @ledgerhq/evm-tools@1.0.13-next.0 + - @ledgerhq/hw-app-eth@6.35.2-next.0 + +## 0.11.1 + +### Patch Changes + +- [#5709](https://github.com/LedgerHQ/ledger-live/pull/5709) [`0fb6cb3`](https://github.com/LedgerHQ/ledger-live/commit/0fb6cb3cb0085b71dfadfd3a92602511cb7e9928) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Fix improper filtering for logging of invalid dates + +- [#5546](https://github.com/LedgerHQ/ledger-live/pull/5546) [`6dc1007`](https://github.com/LedgerHQ/ledger-live/commit/6dc100774010ad674001d04b531239f5adfdce7b) Thanks [@lvndry](https://github.com/lvndry)! - safeEncode senders and recipient addresses + +- [#5524](https://github.com/LedgerHQ/ledger-live/pull/5524) [`be22d72`](https://github.com/LedgerHQ/ledger-live/commit/be22d724cf5499fe4958bfb3b5f763ffaf0d0446) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Addings logs to detect date issue resulting with a RangeError + +- Updated dependencies [[`1cb527b`](https://github.com/LedgerHQ/ledger-live/commit/1cb527b9a0b03f23a921a446c64f71ab5c9e9013), [`b7d58b4`](https://github.com/LedgerHQ/ledger-live/commit/b7d58b4cf3aa041b7b794d9af6f0b89bbc0df633), [`44ee889`](https://github.com/LedgerHQ/ledger-live/commit/44ee88944571c73afb105349f5f28b82e8be262d), [`13d9cbe`](https://github.com/LedgerHQ/ledger-live/commit/13d9cbe9a4afbf3ccd532a33e4ada3685d9d646a), [`618307f`](https://github.com/LedgerHQ/ledger-live/commit/618307f92899af07f4c8ad97c67df483492e3d9d), [`0f5292a`](https://github.com/LedgerHQ/ledger-live/commit/0f5292af8feaa517f36ec35155d813b17c4f66e9), [`52a3732`](https://github.com/LedgerHQ/ledger-live/commit/52a373273dee3b2cb5a3e8d2d4b05f90616d71a2), [`4d1aade`](https://github.com/LedgerHQ/ledger-live/commit/4d1aade53cd33f8e7548ce340f54fbb834bdcdcb), [`eb5ac4d`](https://github.com/LedgerHQ/ledger-live/commit/eb5ac4dca430654f5f86854025fddddab4261a29), [`c8172ab`](https://github.com/LedgerHQ/ledger-live/commit/c8172abc5c052a753b93be8b6c9cfd88ce0dd64a), [`5d03bf5`](https://github.com/LedgerHQ/ledger-live/commit/5d03bf514fcf7aea91dc8beae0cd503ed6b4ab3c), [`9d35080`](https://github.com/LedgerHQ/ledger-live/commit/9d35080944a6a63c78f54a545734f4cf3cbded63), [`3adea7a`](https://github.com/LedgerHQ/ledger-live/commit/3adea7a7ad66080b5e6e4407071a976644158d04), [`2edfa53`](https://github.com/LedgerHQ/ledger-live/commit/2edfa533bccafbfd8a61aea0f5422c0db79825ea), [`be22d72`](https://github.com/LedgerHQ/ledger-live/commit/be22d724cf5499fe4958bfb3b5f763ffaf0d0446), [`52a3732`](https://github.com/LedgerHQ/ledger-live/commit/52a373273dee3b2cb5a3e8d2d4b05f90616d71a2), [`6dea540`](https://github.com/LedgerHQ/ledger-live/commit/6dea54057f67162a1f556661afae16e0422f7ac3), [`e70e345`](https://github.com/LedgerHQ/ledger-live/commit/e70e345bd21d4f5c82fbedfd4447aec0e866be5a)]: + - @ledgerhq/types-live@6.43.1 + - @ledgerhq/cryptoassets@11.3.0 + - @ledgerhq/coin-framework@0.10.0 + - @ledgerhq/live-env@0.8.0 + - @ledgerhq/errors@6.16.1 + - @ledgerhq/devices@8.2.0 + - @ledgerhq/domain-service@1.1.16 + - @ledgerhq/evm-tools@1.0.12 + - @ledgerhq/hw-app-eth@6.35.1 + - @ledgerhq/live-network@1.1.10 + +## 0.11.1-next.1 + +### Patch Changes + +- [#5709](https://github.com/LedgerHQ/ledger-live/pull/5709) [`0fb6cb3`](https://github.com/LedgerHQ/ledger-live/commit/0fb6cb3cb0085b71dfadfd3a92602511cb7e9928) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Fix improper filtering for logging of invalid dates + +## 0.11.1-next.0 + +### Patch Changes + +- [#5546](https://github.com/LedgerHQ/ledger-live/pull/5546) [`6dc1007`](https://github.com/LedgerHQ/ledger-live/commit/6dc100774010ad674001d04b531239f5adfdce7b) Thanks [@lvndry](https://github.com/lvndry)! - safeEncode senders and recipient addresses + +- [#5524](https://github.com/LedgerHQ/ledger-live/pull/5524) [`be22d72`](https://github.com/LedgerHQ/ledger-live/commit/be22d724cf5499fe4958bfb3b5f763ffaf0d0446) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Addings logs to detect date issue resulting with a RangeError + +- Updated dependencies [[`1cb527b`](https://github.com/LedgerHQ/ledger-live/commit/1cb527b9a0b03f23a921a446c64f71ab5c9e9013), [`b7d58b4`](https://github.com/LedgerHQ/ledger-live/commit/b7d58b4cf3aa041b7b794d9af6f0b89bbc0df633), [`44ee889`](https://github.com/LedgerHQ/ledger-live/commit/44ee88944571c73afb105349f5f28b82e8be262d), [`13d9cbe`](https://github.com/LedgerHQ/ledger-live/commit/13d9cbe9a4afbf3ccd532a33e4ada3685d9d646a), [`618307f`](https://github.com/LedgerHQ/ledger-live/commit/618307f92899af07f4c8ad97c67df483492e3d9d), [`0f5292a`](https://github.com/LedgerHQ/ledger-live/commit/0f5292af8feaa517f36ec35155d813b17c4f66e9), [`52a3732`](https://github.com/LedgerHQ/ledger-live/commit/52a373273dee3b2cb5a3e8d2d4b05f90616d71a2), [`4d1aade`](https://github.com/LedgerHQ/ledger-live/commit/4d1aade53cd33f8e7548ce340f54fbb834bdcdcb), [`eb5ac4d`](https://github.com/LedgerHQ/ledger-live/commit/eb5ac4dca430654f5f86854025fddddab4261a29), [`c8172ab`](https://github.com/LedgerHQ/ledger-live/commit/c8172abc5c052a753b93be8b6c9cfd88ce0dd64a), [`5d03bf5`](https://github.com/LedgerHQ/ledger-live/commit/5d03bf514fcf7aea91dc8beae0cd503ed6b4ab3c), [`9d35080`](https://github.com/LedgerHQ/ledger-live/commit/9d35080944a6a63c78f54a545734f4cf3cbded63), [`3adea7a`](https://github.com/LedgerHQ/ledger-live/commit/3adea7a7ad66080b5e6e4407071a976644158d04), [`2edfa53`](https://github.com/LedgerHQ/ledger-live/commit/2edfa533bccafbfd8a61aea0f5422c0db79825ea), [`be22d72`](https://github.com/LedgerHQ/ledger-live/commit/be22d724cf5499fe4958bfb3b5f763ffaf0d0446), [`52a3732`](https://github.com/LedgerHQ/ledger-live/commit/52a373273dee3b2cb5a3e8d2d4b05f90616d71a2), [`6dea540`](https://github.com/LedgerHQ/ledger-live/commit/6dea54057f67162a1f556661afae16e0422f7ac3), [`e70e345`](https://github.com/LedgerHQ/ledger-live/commit/e70e345bd21d4f5c82fbedfd4447aec0e866be5a)]: + - @ledgerhq/types-live@6.43.1-next.0 + - @ledgerhq/cryptoassets@11.3.0-next.0 + - @ledgerhq/coin-framework@0.10.0-next.0 + - @ledgerhq/live-env@0.8.0-next.0 + - @ledgerhq/errors@6.16.1-next.0 + - @ledgerhq/devices@8.2.0-next.0 + - @ledgerhq/domain-service@1.1.16-next.0 + - @ledgerhq/evm-tools@1.0.12-next.0 + - @ledgerhq/hw-app-eth@6.35.1-next.0 + - @ledgerhq/live-network@1.1.10-next.0 + +## 0.11.0 + +### Minor Changes + +- [#4886](https://github.com/LedgerHQ/ledger-live/pull/4886) [`771c9d3c1d`](https://github.com/LedgerHQ/ledger-live/commit/771c9d3c1d138ddd68da2e4f9738e2c41ecaf81b) Thanks [@chabroA](https://github.com/chabroA)! - Add speedup / cancel tx feature for evm + +### Patch Changes + +- [#5364](https://github.com/LedgerHQ/ledger-live/pull/5364) [`743e1ede3e`](https://github.com/LedgerHQ/ledger-live/commit/743e1ede3eebf806e1e22c8627191b419870a476) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Updating the hashing algorithm from SHA256 to MurmurHashV3 for the `getSyncHash` method in order to drastically increase performances on a React Native environment. + +- [#4886](https://github.com/LedgerHQ/ledger-live/pull/4886) [`771c9d3c1d`](https://github.com/LedgerHQ/ledger-live/commit/771c9d3c1d138ddd68da2e4f9738e2c41ecaf81b) Thanks [@chabroA](https://github.com/chabroA)! - Fix wrong usage of explorer block endpoint in coin evm + +- [#4987](https://github.com/LedgerHQ/ledger-live/pull/4987) [`e63205b850`](https://github.com/LedgerHQ/ledger-live/commit/e63205b85071538ed2431157a12818d7a8f0ffa9) Thanks [@kallen-ledger](https://github.com/kallen-ledger)! - add 10s timeout to estimate gas + +- Updated dependencies [[`48487abd29`](https://github.com/LedgerHQ/ledger-live/commit/48487abd297e41629c6725bc0ac9d69bfeaa74d3), [`08dde174fd`](https://github.com/LedgerHQ/ledger-live/commit/08dde174fdeaadbce85dcd914383839f788f21dd), [`771c9d3c1d`](https://github.com/LedgerHQ/ledger-live/commit/771c9d3c1d138ddd68da2e4f9738e2c41ecaf81b), [`c5981ae341`](https://github.com/LedgerHQ/ledger-live/commit/c5981ae3411abc4c8594adf2efcb52aacddac143), [`317685e696`](https://github.com/LedgerHQ/ledger-live/commit/317685e69678e6fe1f489f0c071e7613d329d389), [`a4299c5d62`](https://github.com/LedgerHQ/ledger-live/commit/a4299c5d629cd56e6e6795adaa14978ae2b90f42), [`b4e7201b0b`](https://github.com/LedgerHQ/ledger-live/commit/b4e7201b0b70d146de7d936ff2c9e9e443164243), [`e63205b850`](https://github.com/LedgerHQ/ledger-live/commit/e63205b85071538ed2431157a12818d7a8f0ffa9), [`5964e30bed`](https://github.com/LedgerHQ/ledger-live/commit/5964e30bed11d64a3b7401c6ab51ffc1ad4c427c), [`4a283060bf`](https://github.com/LedgerHQ/ledger-live/commit/4a283060bf2e837d73c6c1cb5d89f890a4e4b931)]: + - @ledgerhq/types-live@6.43.0 + - @ledgerhq/types-cryptoassets@7.8.0 + - @ledgerhq/cryptoassets@11.2.0 + - @ledgerhq/errors@6.16.0 + - @ledgerhq/coin-framework@0.9.0 + - @ledgerhq/live-env@0.7.0 + - @ledgerhq/hw-app-eth@6.35.0 + - @ledgerhq/devices@8.1.0 + - @ledgerhq/logs@6.12.0 + - @ledgerhq/domain-service@1.1.15 + - @ledgerhq/evm-tools@1.0.11 + - @ledgerhq/live-network@1.1.9 + - @ledgerhq/live-promise@0.0.3 + +## 0.11.0-next.1 + +### Patch Changes + +- Updated dependencies [[`4a283060bf`](https://github.com/LedgerHQ/ledger-live/commit/4a283060bf2e837d73c6c1cb5d89f890a4e4b931)]: + - @ledgerhq/cryptoassets@11.2.0-next.1 + - @ledgerhq/coin-framework@0.9.0-next.1 + - @ledgerhq/evm-tools@1.0.11-next.1 + - @ledgerhq/hw-app-eth@6.35.0-next.1 + +## 0.11.0-next.0 + +### Minor Changes + +- [#4886](https://github.com/LedgerHQ/ledger-live/pull/4886) [`771c9d3c1d`](https://github.com/LedgerHQ/ledger-live/commit/771c9d3c1d138ddd68da2e4f9738e2c41ecaf81b) Thanks [@chabroA](https://github.com/chabroA)! - Add speedup / cancel tx feature for evm + +### Patch Changes + +- [#5364](https://github.com/LedgerHQ/ledger-live/pull/5364) [`743e1ede3e`](https://github.com/LedgerHQ/ledger-live/commit/743e1ede3eebf806e1e22c8627191b419870a476) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Updating the hashing algorithm from SHA256 to MurmurHashV3 for the `getSyncHash` method in order to drastically increase performances on a React Native environment. + +- [#4886](https://github.com/LedgerHQ/ledger-live/pull/4886) [`771c9d3c1d`](https://github.com/LedgerHQ/ledger-live/commit/771c9d3c1d138ddd68da2e4f9738e2c41ecaf81b) Thanks [@chabroA](https://github.com/chabroA)! - Fix wrong usage of explorer block endpoint in coin evm + +- [#4987](https://github.com/LedgerHQ/ledger-live/pull/4987) [`e63205b850`](https://github.com/LedgerHQ/ledger-live/commit/e63205b85071538ed2431157a12818d7a8f0ffa9) Thanks [@kallen-ledger](https://github.com/kallen-ledger)! - add 10s timeout to estimate gas + +- Updated dependencies [[`48487abd29`](https://github.com/LedgerHQ/ledger-live/commit/48487abd297e41629c6725bc0ac9d69bfeaa74d3), [`08dde174fd`](https://github.com/LedgerHQ/ledger-live/commit/08dde174fdeaadbce85dcd914383839f788f21dd), [`771c9d3c1d`](https://github.com/LedgerHQ/ledger-live/commit/771c9d3c1d138ddd68da2e4f9738e2c41ecaf81b), [`c5981ae341`](https://github.com/LedgerHQ/ledger-live/commit/c5981ae3411abc4c8594adf2efcb52aacddac143), [`317685e696`](https://github.com/LedgerHQ/ledger-live/commit/317685e69678e6fe1f489f0c071e7613d329d389), [`a4299c5d62`](https://github.com/LedgerHQ/ledger-live/commit/a4299c5d629cd56e6e6795adaa14978ae2b90f42), [`b4e7201b0b`](https://github.com/LedgerHQ/ledger-live/commit/b4e7201b0b70d146de7d936ff2c9e9e443164243), [`e63205b850`](https://github.com/LedgerHQ/ledger-live/commit/e63205b85071538ed2431157a12818d7a8f0ffa9), [`5964e30bed`](https://github.com/LedgerHQ/ledger-live/commit/5964e30bed11d64a3b7401c6ab51ffc1ad4c427c)]: + - @ledgerhq/types-live@6.43.0-next.0 + - @ledgerhq/types-cryptoassets@7.8.0-next.0 + - @ledgerhq/cryptoassets@11.2.0-next.0 + - @ledgerhq/errors@6.16.0-next.0 + - @ledgerhq/coin-framework@0.9.0-next.0 + - @ledgerhq/live-env@0.7.0-next.0 + - @ledgerhq/hw-app-eth@6.35.0-next.0 + - @ledgerhq/devices@8.1.0-next.0 + - @ledgerhq/logs@6.12.0-next.0 + - @ledgerhq/domain-service@1.1.15-next.0 + - @ledgerhq/evm-tools@1.0.11-next.0 + - @ledgerhq/live-network@1.1.9-next.0 + - @ledgerhq/live-promise@0.0.3-next.0 + +## 0.10.0 + +### Minor Changes + +- [#5173](https://github.com/LedgerHQ/ledger-live/pull/5173) [`17ba334e47`](https://github.com/LedgerHQ/ledger-live/commit/17ba334e47b901e34fbb083396aa3f9952e5233e) Thanks [@chabroA](https://github.com/chabroA)! - Add neon_evm support + +### Patch Changes + +- [#4856](https://github.com/LedgerHQ/ledger-live/pull/4856) [`173d7d6d22`](https://github.com/LedgerHQ/ledger-live/commit/173d7d6d224bcf1cecf364062b6571f52792e371) Thanks [@chabroA](https://github.com/chabroA)! - return error when tx from tokenAccount has no amount + +- [#5088](https://github.com/LedgerHQ/ledger-live/pull/5088) [`2fc6d1efa0`](https://github.com/LedgerHQ/ledger-live/commit/2fc6d1efa0233a90b0fa273782cff1dd6344d52c) Thanks [@sarneijim](https://github.com/sarneijim)! - Fix swap-web-app fees + +- Updated dependencies [[`3dc4937cc0`](https://github.com/LedgerHQ/ledger-live/commit/3dc4937cc0c77f6dc40ac7c628e9ab165dfb899f), [`fc121ce96d`](https://github.com/LedgerHQ/ledger-live/commit/fc121ce96dbcc4f30cfd9836644f778b85f997b7), [`95cf52eb66`](https://github.com/LedgerHQ/ledger-live/commit/95cf52eb66769228feb45dd5e799c444e80c5072), [`f5a5c315ea`](https://github.com/LedgerHQ/ledger-live/commit/f5a5c315ea2200cd5b52ef3a0b377d1327b1144e), [`17ba334e47`](https://github.com/LedgerHQ/ledger-live/commit/17ba334e47b901e34fbb083396aa3f9952e5233e), [`9e2d32aec4`](https://github.com/LedgerHQ/ledger-live/commit/9e2d32aec4ebd8774880f94e3ef0e805ebb172ac), [`f83e060bf4`](https://github.com/LedgerHQ/ledger-live/commit/f83e060bf474a6b6133406eff49cb054e813046f), [`9e2d32aec4`](https://github.com/LedgerHQ/ledger-live/commit/9e2d32aec4ebd8774880f94e3ef0e805ebb172ac), [`df5c9ae02a`](https://github.com/LedgerHQ/ledger-live/commit/df5c9ae02a604ddba13ddc64caf8d9ad079c303d), [`54b1d185c9`](https://github.com/LedgerHQ/ledger-live/commit/54b1d185c9df5ae84dc7e85d58249c06550df5f1), [`9b49ff233c`](https://github.com/LedgerHQ/ledger-live/commit/9b49ff233ccfad68c98d15cd648927dee12a8b0b), [`4d6fa0772e`](https://github.com/LedgerHQ/ledger-live/commit/4d6fa0772e19cdbd4b432fafa43621c42e2a5fdd), [`b259781b72`](https://github.com/LedgerHQ/ledger-live/commit/b259781b7212aa7758437640e7c48c5d17b0fa79)]: + - @ledgerhq/types-live@6.42.0 + - @ledgerhq/domain-service@1.1.14 + - @ledgerhq/types-cryptoassets@7.7.0 + - @ledgerhq/cryptoassets@11.1.0 + - @ledgerhq/logs@6.11.0 + - @ledgerhq/coin-framework@0.8.1 + - @ledgerhq/live-env@0.6.1 + - @ledgerhq/errors@6.15.0 + - @ledgerhq/evm-tools@1.0.10 + - @ledgerhq/hw-app-eth@6.34.9 + - @ledgerhq/devices@8.0.8 + - @ledgerhq/live-network@1.1.8 + - @ledgerhq/live-promise@0.0.2 + +## 0.10.0-next.0 + +### Minor Changes + +- [#5173](https://github.com/LedgerHQ/ledger-live/pull/5173) [`17ba334e47`](https://github.com/LedgerHQ/ledger-live/commit/17ba334e47b901e34fbb083396aa3f9952e5233e) Thanks [@chabroA](https://github.com/chabroA)! - Add neon_evm support + +### Patch Changes + +- [#4856](https://github.com/LedgerHQ/ledger-live/pull/4856) [`173d7d6d22`](https://github.com/LedgerHQ/ledger-live/commit/173d7d6d224bcf1cecf364062b6571f52792e371) Thanks [@chabroA](https://github.com/chabroA)! - return error when tx from tokenAccount has no amount + +- [#5088](https://github.com/LedgerHQ/ledger-live/pull/5088) [`2fc6d1efa0`](https://github.com/LedgerHQ/ledger-live/commit/2fc6d1efa0233a90b0fa273782cff1dd6344d52c) Thanks [@sarneijim](https://github.com/sarneijim)! - Fix swap-web-app fees + +- Updated dependencies [[`3dc4937cc0`](https://github.com/LedgerHQ/ledger-live/commit/3dc4937cc0c77f6dc40ac7c628e9ab165dfb899f), [`fc121ce96d`](https://github.com/LedgerHQ/ledger-live/commit/fc121ce96dbcc4f30cfd9836644f778b85f997b7), [`95cf52eb66`](https://github.com/LedgerHQ/ledger-live/commit/95cf52eb66769228feb45dd5e799c444e80c5072), [`f5a5c315ea`](https://github.com/LedgerHQ/ledger-live/commit/f5a5c315ea2200cd5b52ef3a0b377d1327b1144e), [`17ba334e47`](https://github.com/LedgerHQ/ledger-live/commit/17ba334e47b901e34fbb083396aa3f9952e5233e), [`9e2d32aec4`](https://github.com/LedgerHQ/ledger-live/commit/9e2d32aec4ebd8774880f94e3ef0e805ebb172ac), [`f83e060bf4`](https://github.com/LedgerHQ/ledger-live/commit/f83e060bf474a6b6133406eff49cb054e813046f), [`9e2d32aec4`](https://github.com/LedgerHQ/ledger-live/commit/9e2d32aec4ebd8774880f94e3ef0e805ebb172ac), [`df5c9ae02a`](https://github.com/LedgerHQ/ledger-live/commit/df5c9ae02a604ddba13ddc64caf8d9ad079c303d), [`54b1d185c9`](https://github.com/LedgerHQ/ledger-live/commit/54b1d185c9df5ae84dc7e85d58249c06550df5f1), [`9b49ff233c`](https://github.com/LedgerHQ/ledger-live/commit/9b49ff233ccfad68c98d15cd648927dee12a8b0b), [`4d6fa0772e`](https://github.com/LedgerHQ/ledger-live/commit/4d6fa0772e19cdbd4b432fafa43621c42e2a5fdd), [`b259781b72`](https://github.com/LedgerHQ/ledger-live/commit/b259781b7212aa7758437640e7c48c5d17b0fa79)]: + - @ledgerhq/types-live@6.42.0-next.0 + - @ledgerhq/domain-service@1.1.14-next.0 + - @ledgerhq/types-cryptoassets@7.7.0-next.0 + - @ledgerhq/cryptoassets@11.1.0-next.0 + - @ledgerhq/logs@6.11.0-next.0 + - @ledgerhq/coin-framework@0.8.1-next.0 + - @ledgerhq/live-env@0.6.1-next.0 + - @ledgerhq/errors@6.15.0-next.0 + - @ledgerhq/evm-tools@1.0.10-next.0 + - @ledgerhq/hw-app-eth@6.34.9-next.0 + - @ledgerhq/devices@8.0.8-next.0 + - @ledgerhq/live-network@1.1.8-next.0 + - @ledgerhq/live-promise@0.0.2-next.0 + +## 0.9.0 + +### Minor Changes + +- [#5042](https://github.com/LedgerHQ/ledger-live/pull/5042) [`3b4f7501cc`](https://github.com/LedgerHQ/ledger-live/commit/3b4f7501cc5f09be94a2994f20f9998898682975) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Ensure compatiblity with @ledgerhq/coin-framework change regarding `TokenAccounts` ids & update `preload` & `hydrate` method to use the `convertBEP20` method instead of the `convertERC20` method when dealing with the bsc chain. This last fix is technically useless as BEP20 = ERC20, it's only here in order to prevent breaking changes with the different backends at Ledger. As soon as those backends have the possibility of changing the "bsc/bep20/XYZ" token ids into "bsc/erc20/XYZ", this fix should be removed in order to avoid useless complexity. + +### Patch Changes + +- Updated dependencies [[`ce18546c0a`](https://github.com/LedgerHQ/ledger-live/commit/ce18546c0a0b9dd5ed78b1745cac19b7eef7b5eb), [`3b4f7501cc`](https://github.com/LedgerHQ/ledger-live/commit/3b4f7501cc5f09be94a2994f20f9998898682975), [`fbeebfe04b`](https://github.com/LedgerHQ/ledger-live/commit/fbeebfe04b297b33ec258440b694cdfb6213af24)]: + - @ledgerhq/types-live@6.41.1 + - @ledgerhq/coin-framework@0.8.0 + - @ledgerhq/cryptoassets@11.0.1 + - @ledgerhq/domain-service@1.1.13 + - @ledgerhq/evm-tools@1.0.9 + - @ledgerhq/hw-app-eth@6.34.8 + +## 0.9.0-hotfix.2 + +### Patch Changes + +- Updated dependencies [[`fbeebfe04b`](https://github.com/LedgerHQ/ledger-live/commit/fbeebfe04b297b33ec258440b694cdfb6213af24)]: + - @ledgerhq/cryptoassets@11.0.1-hotfix.0 + - @ledgerhq/coin-framework@0.8.0-hotfix.2 + - @ledgerhq/domain-service@1.1.13-hotfix.1 + - @ledgerhq/evm-tools@1.0.9-hotfix.0 + - @ledgerhq/hw-app-eth@6.34.8-hotfix.1 + +## 0.9.0-hotfix.1 + +### Minor Changes + +- [#5042](https://github.com/LedgerHQ/ledger-live/pull/5042) [`3b4f7501cc`](https://github.com/LedgerHQ/ledger-live/commit/3b4f7501cc5f09be94a2994f20f9998898682975) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Ensure compatiblity with @ledgerhq/coin-framework change regarding `TokenAccounts` ids & update `preload` & `hydrate` method to use the `convertBEP20` method instead of the `convertERC20` method when dealing with the bsc chain. This last fix is technically useless as BEP20 = ERC20, it's only here in order to prevent breaking changes with the different backends at Ledger. As soon as those backends have the possibility of changing the "bsc/bep20/XYZ" token ids into "bsc/erc20/XYZ", this fix should be removed in order to avoid useless complexity. + +### Patch Changes + +- Updated dependencies [[`3b4f7501cc`](https://github.com/LedgerHQ/ledger-live/commit/3b4f7501cc5f09be94a2994f20f9998898682975)]: + - @ledgerhq/coin-framework@0.8.0-hotfix.1 + +## 0.8.1-hotfix.0 + +### Patch Changes + +- Updated dependencies [[`ce18546c0a`](https://github.com/LedgerHQ/ledger-live/commit/ce18546c0a0b9dd5ed78b1745cac19b7eef7b5eb)]: + - @ledgerhq/types-live@6.41.1-hotfix.0 + - @ledgerhq/coin-framework@0.7.1-hotfix.0 + - @ledgerhq/domain-service@1.1.13-hotfix.0 + - @ledgerhq/evm-tools@1.0.8 + - @ledgerhq/hw-app-eth@6.34.8-hotfix.0 + +## 0.8.0 + +### Minor Changes + +- [#4741](https://github.com/LedgerHQ/ledger-live/pull/4741) [`a134f28e9d`](https://github.com/LedgerHQ/ledger-live/commit/a134f28e9d220d172148619ed281d4ca897d5532) Thanks [@chabroA](https://github.com/chabroA)! - Add gasOption serialisation and deserialisation to evm transactions + +- [#4791](https://github.com/LedgerHQ/ledger-live/pull/4791) [`b779f6c964`](https://github.com/LedgerHQ/ledger-live/commit/b779f6c964079b9cd9a4ee985cd5cdbb8c49406e) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Update `getDeviceTransactionConfig` to return correctly nano fields when the transaction has been crafted by a third party (like the Wallet API) + +- [#4285](https://github.com/LedgerHQ/ledger-live/pull/4285) [`533278e2c4`](https://github.com/LedgerHQ/ledger-live/commit/533278e2c40ee764ecb87d4430fa6650f251ff0c) Thanks [@chabroA](https://github.com/chabroA)! - Migrate Ethereum family implementation to EVM family + + Replace the legcay Ethereum familly implementation that was present in ledger-live-common by the coin-evm lib implementation. + This change was made in order to improve scalabillity and maintainability of the evm coins, as well as more easilly integrate new evm based chains in the future. + +### Patch Changes + +- [#4804](https://github.com/LedgerHQ/ledger-live/pull/4804) [`4cb507a52b`](https://github.com/LedgerHQ/ledger-live/commit/4cb507a52bf336d395b08b4c1a429bd4956ab22d) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Add cache to CDN requests during preload + +- Updated dependencies [[`c86637f6e5`](https://github.com/LedgerHQ/ledger-live/commit/c86637f6e57845716a791854dd8f686807152e73), [`72288402ec`](https://github.com/LedgerHQ/ledger-live/commit/72288402ec70f9159022505cb3187e63b24df450), [`f527d1bb5a`](https://github.com/LedgerHQ/ledger-live/commit/f527d1bb5a2888a916f761d43d2ba5093eaa3e3f), [`a134f28e9d`](https://github.com/LedgerHQ/ledger-live/commit/a134f28e9d220d172148619ed281d4ca897d5532), [`49ea3fd98b`](https://github.com/LedgerHQ/ledger-live/commit/49ea3fd98ba1e1e0ed54d29ab5fdc71c4918183f), [`533278e2c4`](https://github.com/LedgerHQ/ledger-live/commit/533278e2c40ee764ecb87d4430fa6650f251ff0c), [`70e4277bc9`](https://github.com/LedgerHQ/ledger-live/commit/70e4277bc9dda253b894bdae5f2c8a5f43a9a64e)]: + - @ledgerhq/hw-app-eth@6.34.7 + - @ledgerhq/cryptoassets@11.0.0 + - @ledgerhq/types-cryptoassets@7.6.0 + - @ledgerhq/types-live@6.41.0 + - @ledgerhq/coin-framework@0.7.0 + - @ledgerhq/live-env@0.6.0 + - @ledgerhq/domain-service@1.1.12 + - @ledgerhq/evm-tools@1.0.8 + - @ledgerhq/live-network@1.1.7 + +## 0.6.2 + +### Patch Changes + +- Updated dependencies [[`6c83521fee`](https://github.com/LedgerHQ/ledger-live/commit/6c83521fee8da656858630c1cb37a5af95df3362)]: + - @ledgerhq/types-cryptoassets@7.5.0 + - @ledgerhq/cryptoassets@9.13.0 + - @ledgerhq/types-live@6.40.0 + - @ledgerhq/coin-framework@0.5.4 + - @ledgerhq/domain-service@1.1.11 + - @ledgerhq/evm-tools@1.0.7 + - @ledgerhq/hw-app-eth@6.34.6 + +## 0.6.1 + +### Patch Changes + +- Updated dependencies [[`e0cc3a0841`](https://github.com/LedgerHQ/ledger-live/commit/e0cc3a08415de84b9d3ce828444248a043a9d699), [`18b4a47b48`](https://github.com/LedgerHQ/ledger-live/commit/18b4a47b4878a23695a50096b7770134883b8a2e)]: + - @ledgerhq/coin-framework@0.5.3 + - @ledgerhq/cryptoassets@9.12.1 + - @ledgerhq/domain-service@1.1.10 + - @ledgerhq/evm-tools@1.0.6 + - @ledgerhq/hw-app-eth@6.34.5 + +## 0.6.0 + +### Minor Changes + +- [#4235](https://github.com/LedgerHQ/ledger-live/pull/4235) [`8e9df43a0c`](https://github.com/LedgerHQ/ledger-live/commit/8e9df43a0cd00a2065b494439f300f96724b8eb8) Thanks [@haammar-ledger](https://github.com/haammar-ledger)! - Better typing for the Operation.extra field + +### Patch Changes + +- [#4391](https://github.com/LedgerHQ/ledger-live/pull/4391) [`fde2fe79f1`](https://github.com/LedgerHQ/ledger-live/commit/fde2fe79f1df69fffe80763cd6d9792fe9de1262) Thanks [@valpinkman](https://github.com/valpinkman)! - Rework some env typings + +- [#4452](https://github.com/LedgerHQ/ledger-live/pull/4452) [`1020f27632`](https://github.com/LedgerHQ/ledger-live/commit/1020f276322fe361585a56573091ec647fbd901e) Thanks [@hzheng-ledger](https://github.com/hzheng-ledger)! - fix evm integration tests + +- [#4268](https://github.com/LedgerHQ/ledger-live/pull/4268) [`707e59f8b5`](https://github.com/LedgerHQ/ledger-live/commit/707e59f8b516448e6f2845288ad4cb3f5488e688) Thanks [@hzheng-ledger](https://github.com/hzheng-ledger)! - fix pending transaction bug in evm family + +- Updated dependencies [[`8e9df43a0c`](https://github.com/LedgerHQ/ledger-live/commit/8e9df43a0cd00a2065b494439f300f96724b8eb8), [`fde2fe79f1`](https://github.com/LedgerHQ/ledger-live/commit/fde2fe79f1df69fffe80763cd6d9792fe9de1262), [`f6f70ba0e8`](https://github.com/LedgerHQ/ledger-live/commit/f6f70ba0e85c7898cdeec19402b1eadfde6a2206), [`45be23c776`](https://github.com/LedgerHQ/ledger-live/commit/45be23c77666697dbe395f836ab592062173d5cb), [`6375c250a9`](https://github.com/LedgerHQ/ledger-live/commit/6375c250a9a58b33e3dd1d6c96a96c7e46150298), [`0d9ad3599b`](https://github.com/LedgerHQ/ledger-live/commit/0d9ad3599bce8872fde97d27c977ab24445afc3a)]: + - @ledgerhq/types-live@6.39.0 + - @ledgerhq/live-env@0.5.0 + - @ledgerhq/coin-framework@0.5.2 + - @ledgerhq/cryptoassets@9.12.0 + - @ledgerhq/domain-service@1.1.9 + - @ledgerhq/evm-tools@1.0.5 + - @ledgerhq/hw-app-eth@6.34.4 + - @ledgerhq/live-network@1.1.6 + +## 0.6.0-next.0 + +### Minor Changes + +- [#4235](https://github.com/LedgerHQ/ledger-live/pull/4235) [`8e9df43a0c`](https://github.com/LedgerHQ/ledger-live/commit/8e9df43a0cd00a2065b494439f300f96724b8eb8) Thanks [@haammar-ledger](https://github.com/haammar-ledger)! - Better typing for the Operation.extra field + +### Patch Changes + +- [#4391](https://github.com/LedgerHQ/ledger-live/pull/4391) [`fde2fe79f1`](https://github.com/LedgerHQ/ledger-live/commit/fde2fe79f1df69fffe80763cd6d9792fe9de1262) Thanks [@valpinkman](https://github.com/valpinkman)! - Rework some env typings + +- [#4452](https://github.com/LedgerHQ/ledger-live/pull/4452) [`1020f27632`](https://github.com/LedgerHQ/ledger-live/commit/1020f276322fe361585a56573091ec647fbd901e) Thanks [@hzheng-ledger](https://github.com/hzheng-ledger)! - fix evm integration tests + +- [#4268](https://github.com/LedgerHQ/ledger-live/pull/4268) [`707e59f8b5`](https://github.com/LedgerHQ/ledger-live/commit/707e59f8b516448e6f2845288ad4cb3f5488e688) Thanks [@hzheng-ledger](https://github.com/hzheng-ledger)! - fix pending transaction bug in evm family + +- Updated dependencies [[`8e9df43a0c`](https://github.com/LedgerHQ/ledger-live/commit/8e9df43a0cd00a2065b494439f300f96724b8eb8), [`fde2fe79f1`](https://github.com/LedgerHQ/ledger-live/commit/fde2fe79f1df69fffe80763cd6d9792fe9de1262), [`f6f70ba0e8`](https://github.com/LedgerHQ/ledger-live/commit/f6f70ba0e85c7898cdeec19402b1eadfde6a2206), [`45be23c776`](https://github.com/LedgerHQ/ledger-live/commit/45be23c77666697dbe395f836ab592062173d5cb), [`6375c250a9`](https://github.com/LedgerHQ/ledger-live/commit/6375c250a9a58b33e3dd1d6c96a96c7e46150298), [`0d9ad3599b`](https://github.com/LedgerHQ/ledger-live/commit/0d9ad3599bce8872fde97d27c977ab24445afc3a)]: + - @ledgerhq/types-live@6.39.0-next.0 + - @ledgerhq/live-env@0.5.0-next.0 + - @ledgerhq/coin-framework@0.5.2-next.0 + - @ledgerhq/cryptoassets@9.12.0-next.0 + - @ledgerhq/domain-service@1.1.9-next.0 + - @ledgerhq/evm-tools@1.0.5-next.0 + - @ledgerhq/hw-app-eth@6.34.4-next.0 + - @ledgerhq/live-network@1.1.6-next.0 + +## 0.5.1 + +### Patch Changes + +- Updated dependencies [[`5bbcea12f9`](https://github.com/LedgerHQ/ledger-live/commit/5bbcea12f93e3cda41705a4d61d50845628a6de6), [`95088eab45`](https://github.com/LedgerHQ/ledger-live/commit/95088eab45f6af919e347a605cefefb6d7705808), [`a61a43fc47`](https://github.com/LedgerHQ/ledger-live/commit/a61a43fc47399e969fa68539de6af51bfa41e921), [`4c2539a1d5`](https://github.com/LedgerHQ/ledger-live/commit/4c2539a1d5c9c01c0f9fa7cd1daf5a5a63c02996), [`229cf62304`](https://github.com/LedgerHQ/ledger-live/commit/229cf623043b29eefed3e8e37a102325fa6e0387), [`3455944496`](https://github.com/LedgerHQ/ledger-live/commit/34559444969ce1571ff4c54f33feb7f3fb59a33a)]: + - @ledgerhq/types-live@6.38.1 + - @ledgerhq/live-env@0.4.2 + - @ledgerhq/errors@6.14.0 + - @ledgerhq/cryptoassets@9.11.1 + - @ledgerhq/coin-framework@0.5.1 + - @ledgerhq/domain-service@1.1.8 + - @ledgerhq/evm-tools@1.0.4 + - @ledgerhq/hw-app-eth@6.34.3 + - @ledgerhq/live-network@1.1.5 + - @ledgerhq/devices@8.0.7 + +## 0.5.1-next.0 + +### Patch Changes + +- Updated dependencies [[`5bbcea12f9`](https://github.com/LedgerHQ/ledger-live/commit/5bbcea12f93e3cda41705a4d61d50845628a6de6), [`95088eab45`](https://github.com/LedgerHQ/ledger-live/commit/95088eab45f6af919e347a605cefefb6d7705808), [`a61a43fc47`](https://github.com/LedgerHQ/ledger-live/commit/a61a43fc47399e969fa68539de6af51bfa41e921), [`4c2539a1d5`](https://github.com/LedgerHQ/ledger-live/commit/4c2539a1d5c9c01c0f9fa7cd1daf5a5a63c02996), [`229cf62304`](https://github.com/LedgerHQ/ledger-live/commit/229cf623043b29eefed3e8e37a102325fa6e0387), [`3455944496`](https://github.com/LedgerHQ/ledger-live/commit/34559444969ce1571ff4c54f33feb7f3fb59a33a)]: + - @ledgerhq/types-live@6.38.1-next.0 + - @ledgerhq/live-env@0.4.2-next.0 + - @ledgerhq/errors@6.14.0-next.0 + - @ledgerhq/cryptoassets@9.11.1-next.0 + - @ledgerhq/coin-framework@0.5.1-next.0 + - @ledgerhq/domain-service@1.1.8-next.0 + - @ledgerhq/evm-tools@1.0.4-next.0 + - @ledgerhq/hw-app-eth@6.34.3-next.0 + - @ledgerhq/live-network@1.1.5-next.0 + - @ledgerhq/devices@8.0.7-next.0 + +## 0.5.0 + +### Minor Changes + +- [#4021](https://github.com/LedgerHQ/ledger-live/pull/4021) [`e5f9cc46d6`](https://github.com/LedgerHQ/ledger-live/commit/e5f9cc46d69b82ad7267296b350e9d97a47f9e86) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Add telos evm currency + +- [#3704](https://github.com/LedgerHQ/ledger-live/pull/3704) [`b6e50932af`](https://github.com/LedgerHQ/ledger-live/commit/b6e50932afac6acc2d2f9fa9ed10b77a62378e03) Thanks [@chabroA](https://github.com/chabroA)! - Create EVM send flow + +- [#3827](https://github.com/LedgerHQ/ledger-live/pull/3827) [`6a88b7f8a6`](https://github.com/LedgerHQ/ledger-live/commit/6a88b7f8a6b7c732be0c945131b6c1d9b3937cc1) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Add support for Ledger infra as node and/or explorer + +- [#4015](https://github.com/LedgerHQ/ledger-live/pull/4015) [`374e339c27`](https://github.com/LedgerHQ/ledger-live/commit/374e339c27e317656d01463a822898ad3a60df85) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Add support for Polygon zkEVM, Base Goerli, Klaytn + +### Patch Changes + +- [#4090](https://github.com/LedgerHQ/ledger-live/pull/4090) [`7675787398`](https://github.com/LedgerHQ/ledger-live/commit/767578739822597768f877f94fd8f7f35441395a) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Fix building & bundling of `evm-tools` & `domain-service` libs due to .gitignore(s) + +- [#4143](https://github.com/LedgerHQ/ledger-live/pull/4143) [`c2fd7e2e3d`](https://github.com/LedgerHQ/ledger-live/commit/c2fd7e2e3d684da831a7eafe6b22b5e2c96a3722) Thanks [@chabroA](https://github.com/chabroA)! - Add missing teloscan in type guard + +- Updated dependencies [[`1263b7a9c1`](https://github.com/LedgerHQ/ledger-live/commit/1263b7a9c1916da81ad55bb2ca1e804cff5f89e2), [`770842cdbe`](https://github.com/LedgerHQ/ledger-live/commit/770842cdbe94c629b6844f93d1b5d94d381931b1), [`e5f9cc46d6`](https://github.com/LedgerHQ/ledger-live/commit/e5f9cc46d69b82ad7267296b350e9d97a47f9e86), [`6a88b7f8a6`](https://github.com/LedgerHQ/ledger-live/commit/6a88b7f8a6b7c732be0c945131b6c1d9b3937cc1), [`cfbff52724`](https://github.com/LedgerHQ/ledger-live/commit/cfbff527241534aba69bff3d86733b50a14eb4ce), [`b6e50932af`](https://github.com/LedgerHQ/ledger-live/commit/b6e50932afac6acc2d2f9fa9ed10b77a62378e03), [`6a88b7f8a6`](https://github.com/LedgerHQ/ledger-live/commit/6a88b7f8a6b7c732be0c945131b6c1d9b3937cc1), [`7675787398`](https://github.com/LedgerHQ/ledger-live/commit/767578739822597768f877f94fd8f7f35441395a), [`95ac67a5e0`](https://github.com/LedgerHQ/ledger-live/commit/95ac67a5e0359b03c7d82c34fd1f2f3b6eb7df22), [`c7c484acf0`](https://github.com/LedgerHQ/ledger-live/commit/c7c484acf01e9db8dc5a5507b62ffcb863c77ca4), [`374e339c27`](https://github.com/LedgerHQ/ledger-live/commit/374e339c27e317656d01463a822898ad3a60df85), [`66769a98e6`](https://github.com/LedgerHQ/ledger-live/commit/66769a98e69f2b8156417e464e90d9162272b470)]: + - @ledgerhq/cryptoassets@9.11.0 + - @ledgerhq/live-env@0.4.1 + - @ledgerhq/types-cryptoassets@7.4.0 + - @ledgerhq/types-live@6.38.0 + - @ledgerhq/coin-framework@0.5.0 + - @ledgerhq/evm-tools@1.0.3 + - @ledgerhq/hw-app-eth@6.34.2 + - @ledgerhq/errors@6.13.1 + - @ledgerhq/domain-service@1.1.7 + - @ledgerhq/live-network@1.1.4 + - @ledgerhq/devices@8.0.6 + +## 0.5.0-next.0 + +### Minor Changes + +- [#4021](https://github.com/LedgerHQ/ledger-live/pull/4021) [`e5f9cc46d6`](https://github.com/LedgerHQ/ledger-live/commit/e5f9cc46d69b82ad7267296b350e9d97a47f9e86) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Add telos evm currency + +- [#3704](https://github.com/LedgerHQ/ledger-live/pull/3704) [`b6e50932af`](https://github.com/LedgerHQ/ledger-live/commit/b6e50932afac6acc2d2f9fa9ed10b77a62378e03) Thanks [@chabroA](https://github.com/chabroA)! - Create EVM send flow + +- [#3827](https://github.com/LedgerHQ/ledger-live/pull/3827) [`6a88b7f8a6`](https://github.com/LedgerHQ/ledger-live/commit/6a88b7f8a6b7c732be0c945131b6c1d9b3937cc1) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Add support for Ledger infra as node and/or explorer + +- [#4015](https://github.com/LedgerHQ/ledger-live/pull/4015) [`374e339c27`](https://github.com/LedgerHQ/ledger-live/commit/374e339c27e317656d01463a822898ad3a60df85) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Add support for Polygon zkEVM, Base Goerli, Klaytn + +### Patch Changes + +- [#4090](https://github.com/LedgerHQ/ledger-live/pull/4090) [`7675787398`](https://github.com/LedgerHQ/ledger-live/commit/767578739822597768f877f94fd8f7f35441395a) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Fix building & bundling of `evm-tools` & `domain-service` libs due to .gitignore(s) + +- [#4143](https://github.com/LedgerHQ/ledger-live/pull/4143) [`c2fd7e2e3d`](https://github.com/LedgerHQ/ledger-live/commit/c2fd7e2e3d684da831a7eafe6b22b5e2c96a3722) Thanks [@chabroA](https://github.com/chabroA)! - Add missing teloscan in type guard + +- Updated dependencies [[`1263b7a9c1`](https://github.com/LedgerHQ/ledger-live/commit/1263b7a9c1916da81ad55bb2ca1e804cff5f89e2), [`770842cdbe`](https://github.com/LedgerHQ/ledger-live/commit/770842cdbe94c629b6844f93d1b5d94d381931b1), [`e5f9cc46d6`](https://github.com/LedgerHQ/ledger-live/commit/e5f9cc46d69b82ad7267296b350e9d97a47f9e86), [`6a88b7f8a6`](https://github.com/LedgerHQ/ledger-live/commit/6a88b7f8a6b7c732be0c945131b6c1d9b3937cc1), [`cfbff52724`](https://github.com/LedgerHQ/ledger-live/commit/cfbff527241534aba69bff3d86733b50a14eb4ce), [`b6e50932af`](https://github.com/LedgerHQ/ledger-live/commit/b6e50932afac6acc2d2f9fa9ed10b77a62378e03), [`6a88b7f8a6`](https://github.com/LedgerHQ/ledger-live/commit/6a88b7f8a6b7c732be0c945131b6c1d9b3937cc1), [`7675787398`](https://github.com/LedgerHQ/ledger-live/commit/767578739822597768f877f94fd8f7f35441395a), [`95ac67a5e0`](https://github.com/LedgerHQ/ledger-live/commit/95ac67a5e0359b03c7d82c34fd1f2f3b6eb7df22), [`c7c484acf0`](https://github.com/LedgerHQ/ledger-live/commit/c7c484acf01e9db8dc5a5507b62ffcb863c77ca4), [`374e339c27`](https://github.com/LedgerHQ/ledger-live/commit/374e339c27e317656d01463a822898ad3a60df85), [`66769a98e6`](https://github.com/LedgerHQ/ledger-live/commit/66769a98e69f2b8156417e464e90d9162272b470)]: + - @ledgerhq/cryptoassets@9.11.0-next.0 + - @ledgerhq/live-env@0.4.1-next.0 + - @ledgerhq/types-cryptoassets@7.4.0-next.0 + - @ledgerhq/types-live@6.38.0-next.0 + - @ledgerhq/coin-framework@0.5.0-next.0 + - @ledgerhq/evm-tools@1.0.3-next.0 + - @ledgerhq/hw-app-eth@6.34.2-next.0 + - @ledgerhq/errors@6.13.1-next.0 + - @ledgerhq/domain-service@1.1.7-next.0 + - @ledgerhq/live-network@1.1.4-next.0 + - @ledgerhq/devices@8.0.6-next.0 + +## 0.4.1 + +### Patch Changes + +- [#4103](https://github.com/LedgerHQ/ledger-live/pull/4103) [`2317fccb67`](https://github.com/LedgerHQ/ledger-live/commit/2317fccb6776a077eaca8828da8371d402323be4) Thanks [@live-github-bot](https://github.com/apps/live-github-bot)! - Fix building & bundling of `evm-tools` & `domain-service` libs due to .gitignore(s) + +- Updated dependencies [[`2317fccb67`](https://github.com/LedgerHQ/ledger-live/commit/2317fccb6776a077eaca8828da8371d402323be4)]: + - @ledgerhq/evm-tools@1.0.2 + - @ledgerhq/hw-app-eth@6.34.1 + +## 0.4.1-hotfix.0 + +### Patch Changes + +- [#4103](https://github.com/LedgerHQ/ledger-live/pull/4103) [`2317fccb67`](https://github.com/LedgerHQ/ledger-live/commit/2317fccb6776a077eaca8828da8371d402323be4) Thanks [@live-github-bot](https://github.com/apps/live-github-bot)! - Fix building & bundling of `evm-tools` & `domain-service` libs due to .gitignore(s) + +- Updated dependencies [[`2317fccb67`](https://github.com/LedgerHQ/ledger-live/commit/2317fccb6776a077eaca8828da8371d402323be4)]: + - @ledgerhq/evm-tools@1.0.2-hotfix.0 + - @ledgerhq/hw-app-eth@6.34.1-hotfix.0 + +## 0.4.0 + +### Minor Changes + +- [#3714](https://github.com/LedgerHQ/ledger-live/pull/3714) [`15e8abc482`](https://github.com/LedgerHQ/ledger-live/commit/15e8abc482b2b38e4808890f556097cf693359ec) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Adding support for NFT transactions + +- [#3786](https://github.com/LedgerHQ/ledger-live/pull/3786) [`11e62b1e1e`](https://github.com/LedgerHQ/ledger-live/commit/11e62b1e1e3773eeaad748453973e0b3bcd3e3bf) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Adds support for the `setLoadConfig` during the SignOperation step and adds the usage of environment variables to set the backends URIs + +- [#3714](https://github.com/LedgerHQ/ledger-live/pull/3714) [`15e8abc482`](https://github.com/LedgerHQ/ledger-live/commit/15e8abc482b2b38e4808890f556097cf693359ec) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Add support for non finite quantity w/ NFT transaction data crafting + +- [#3924](https://github.com/LedgerHQ/ledger-live/pull/3924) [`14cce73003`](https://github.com/LedgerHQ/ledger-live/commit/14cce7300333c51cbcdbd5a7e290ddc600c9f3a1) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Use of the `evm-tools` new library to bring support for SignMessage + +### Patch Changes + +- [#3714](https://github.com/LedgerHQ/ledger-live/pull/3714) [`15e8abc482`](https://github.com/LedgerHQ/ledger-live/commit/15e8abc482b2b38e4808890f556097cf693359ec) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Prevent duplicated sub & nft operations with rate limited explorers & make explorerless implementation also patch sub & nft operations after transaction finalization + +- [#3714](https://github.com/LedgerHQ/ledger-live/pull/3714) [`15e8abc482`](https://github.com/LedgerHQ/ledger-live/commit/15e8abc482b2b38e4808890f556097cf693359ec) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Rename rpc file that prevented shims to be applied for React Native + +- Updated dependencies [[`15e8abc482`](https://github.com/LedgerHQ/ledger-live/commit/15e8abc482b2b38e4808890f556097cf693359ec), [`15e8abc482`](https://github.com/LedgerHQ/ledger-live/commit/15e8abc482b2b38e4808890f556097cf693359ec), [`49182846de`](https://github.com/LedgerHQ/ledger-live/commit/49182846dee35ae9b3535c0c120e17d0eaecde70), [`15e8abc482`](https://github.com/LedgerHQ/ledger-live/commit/15e8abc482b2b38e4808890f556097cf693359ec), [`c660c4e389`](https://github.com/LedgerHQ/ledger-live/commit/c660c4e389ac200ef308cbc3882930d392375de3), [`2c28d5aab3`](https://github.com/LedgerHQ/ledger-live/commit/2c28d5aab36b8b0cf2cb2a50e02eac4c5a588e41), [`0f4293e9bf`](https://github.com/LedgerHQ/ledger-live/commit/0f4293e9bf9cac4c2a195efeb0831aab3d51933d), [`14cce73003`](https://github.com/LedgerHQ/ledger-live/commit/14cce7300333c51cbcdbd5a7e290ddc600c9f3a1), [`14cce73003`](https://github.com/LedgerHQ/ledger-live/commit/14cce7300333c51cbcdbd5a7e290ddc600c9f3a1), [`15e8abc482`](https://github.com/LedgerHQ/ledger-live/commit/15e8abc482b2b38e4808890f556097cf693359ec), [`bae3b64dd2`](https://github.com/LedgerHQ/ledger-live/commit/bae3b64dd2710a3743552600166be986e93d9099), [`9692adc2a6`](https://github.com/LedgerHQ/ledger-live/commit/9692adc2a6774feb4424fc7a984810918c946b1b), [`15e8abc482`](https://github.com/LedgerHQ/ledger-live/commit/15e8abc482b2b38e4808890f556097cf693359ec)]: + - @ledgerhq/live-env@0.4.0 + - @ledgerhq/coin-framework@0.4.0 + - @ledgerhq/cryptoassets@9.10.0 + - @ledgerhq/errors@6.13.0 + - @ledgerhq/types-live@6.37.0 + - @ledgerhq/hw-app-eth@6.34.0 + - @ledgerhq/types-cryptoassets@7.3.1 + - @ledgerhq/evm-tools@1.0.1 + - @ledgerhq/live-network@1.1.3 + - @ledgerhq/domain-service@1.1.6 + - @ledgerhq/devices@8.0.5 + +## 0.4.0-next.0 + +### Minor Changes + +- [#3714](https://github.com/LedgerHQ/ledger-live/pull/3714) [`15e8abc482`](https://github.com/LedgerHQ/ledger-live/commit/15e8abc482b2b38e4808890f556097cf693359ec) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Adding support for NFT transactions + +- [#3786](https://github.com/LedgerHQ/ledger-live/pull/3786) [`11e62b1e1e`](https://github.com/LedgerHQ/ledger-live/commit/11e62b1e1e3773eeaad748453973e0b3bcd3e3bf) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Adds support for the `setLoadConfig` during the SignOperation step and adds the usage of environment variables to set the backends URIs + +- [#3714](https://github.com/LedgerHQ/ledger-live/pull/3714) [`15e8abc482`](https://github.com/LedgerHQ/ledger-live/commit/15e8abc482b2b38e4808890f556097cf693359ec) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Add support for non finite quantity w/ NFT transaction data crafting + +- [#3924](https://github.com/LedgerHQ/ledger-live/pull/3924) [`14cce73003`](https://github.com/LedgerHQ/ledger-live/commit/14cce7300333c51cbcdbd5a7e290ddc600c9f3a1) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Use of the `evm-tools` new library to bring support for SignMessage + +### Patch Changes + +- [#3714](https://github.com/LedgerHQ/ledger-live/pull/3714) [`15e8abc482`](https://github.com/LedgerHQ/ledger-live/commit/15e8abc482b2b38e4808890f556097cf693359ec) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Prevent duplicated sub & nft operations with rate limited explorers & make explorerless implementation also patch sub & nft operations after transaction finalization + +- [#3714](https://github.com/LedgerHQ/ledger-live/pull/3714) [`15e8abc482`](https://github.com/LedgerHQ/ledger-live/commit/15e8abc482b2b38e4808890f556097cf693359ec) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Rename rpc file that prevented shims to be applied for React Native + +- Updated dependencies [[`15e8abc482`](https://github.com/LedgerHQ/ledger-live/commit/15e8abc482b2b38e4808890f556097cf693359ec), [`15e8abc482`](https://github.com/LedgerHQ/ledger-live/commit/15e8abc482b2b38e4808890f556097cf693359ec), [`49182846de`](https://github.com/LedgerHQ/ledger-live/commit/49182846dee35ae9b3535c0c120e17d0eaecde70), [`15e8abc482`](https://github.com/LedgerHQ/ledger-live/commit/15e8abc482b2b38e4808890f556097cf693359ec), [`c660c4e389`](https://github.com/LedgerHQ/ledger-live/commit/c660c4e389ac200ef308cbc3882930d392375de3), [`2c28d5aab3`](https://github.com/LedgerHQ/ledger-live/commit/2c28d5aab36b8b0cf2cb2a50e02eac4c5a588e41), [`0f4293e9bf`](https://github.com/LedgerHQ/ledger-live/commit/0f4293e9bf9cac4c2a195efeb0831aab3d51933d), [`14cce73003`](https://github.com/LedgerHQ/ledger-live/commit/14cce7300333c51cbcdbd5a7e290ddc600c9f3a1), [`14cce73003`](https://github.com/LedgerHQ/ledger-live/commit/14cce7300333c51cbcdbd5a7e290ddc600c9f3a1), [`15e8abc482`](https://github.com/LedgerHQ/ledger-live/commit/15e8abc482b2b38e4808890f556097cf693359ec), [`bae3b64dd2`](https://github.com/LedgerHQ/ledger-live/commit/bae3b64dd2710a3743552600166be986e93d9099), [`9692adc2a6`](https://github.com/LedgerHQ/ledger-live/commit/9692adc2a6774feb4424fc7a984810918c946b1b), [`15e8abc482`](https://github.com/LedgerHQ/ledger-live/commit/15e8abc482b2b38e4808890f556097cf693359ec)]: + - @ledgerhq/live-env@0.4.0-next.0 + - @ledgerhq/coin-framework@0.4.0-next.0 + - @ledgerhq/cryptoassets@9.10.0-next.0 + - @ledgerhq/errors@6.13.0-next.0 + - @ledgerhq/types-live@6.37.0-next.0 + - @ledgerhq/hw-app-eth@6.34.0-next.0 + - @ledgerhq/types-cryptoassets@7.3.1-next.0 + - @ledgerhq/evm-tools@1.0.1-next.0 + - @ledgerhq/live-network@1.1.3-next.0 + - @ledgerhq/domain-service@1.1.6-next.0 + - @ledgerhq/devices@8.0.5-next.0 + +## 0.3.0 + +### Minor Changes + +- [#3611](https://github.com/LedgerHQ/ledger-live/pull/3611) [`092cb8d317`](https://github.com/LedgerHQ/ledger-live/commit/092cb8d317fa7971e0f790b77f900ae3864d96c2) Thanks [@chabroA](https://github.com/chabroA)! - Create GasTracker abstraction for evm familly + +### Patch Changes + +- [#3741](https://github.com/LedgerHQ/ledger-live/pull/3741) [`6194db3178`](https://github.com/LedgerHQ/ledger-live/commit/6194db3178cf90b26f4f6c7f049b7eafafdf7bfc) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Update eip55 dependency + +- [#3741](https://github.com/LedgerHQ/ledger-live/pull/3741) [`6194db3178`](https://github.com/LedgerHQ/ledger-live/commit/6194db3178cf90b26f4f6c7f049b7eafafdf7bfc) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Update eip55 dependency to 2.1.1 fixing browser context usage + +- [#3872](https://github.com/LedgerHQ/ledger-live/pull/3872) [`d1d1578ab5`](https://github.com/LedgerHQ/ledger-live/commit/d1d1578ab5b351544c98d56b67c68f18640f2d20) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Rename rpc file that prevented shims to be applied for React Native + +- Updated dependencies [[`6194db3178`](https://github.com/LedgerHQ/ledger-live/commit/6194db3178cf90b26f4f6c7f049b7eafafdf7bfc), [`44192f2ab2`](https://github.com/LedgerHQ/ledger-live/commit/44192f2ab2857cbae2ef4a81ee9608d395dcd2b9), [`cb95f72c24`](https://github.com/LedgerHQ/ledger-live/commit/cb95f72c2415876ef88ca83fd2c4363a57669b92), [`be5f56b233`](https://github.com/LedgerHQ/ledger-live/commit/be5f56b2330c166323914b79fef37a3c05e0e13a), [`092cb8d317`](https://github.com/LedgerHQ/ledger-live/commit/092cb8d317fa7971e0f790b77f900ae3864d96c2), [`5af41b6fa1`](https://github.com/LedgerHQ/ledger-live/commit/5af41b6fa1e43037ccdb2df279c82e12ef3d2b1a), [`6194db3178`](https://github.com/LedgerHQ/ledger-live/commit/6194db3178cf90b26f4f6c7f049b7eafafdf7bfc)]: + - @ledgerhq/domain-service@1.1.5 + - @ledgerhq/types-live@6.36.0 + - @ledgerhq/cryptoassets@9.9.0 + - @ledgerhq/types-cryptoassets@7.3.0 + - @ledgerhq/live-env@0.3.1 + - @ledgerhq/hw-app-eth@6.33.7 + - @ledgerhq/coin-framework@0.3.7 + - @ledgerhq/live-network@1.1.2 + +## 0.3.0-next.1 + +### Patch Changes + +- [#3872](https://github.com/LedgerHQ/ledger-live/pull/3872) [`d1d1578ab5`](https://github.com/LedgerHQ/ledger-live/commit/d1d1578ab5b351544c98d56b67c68f18640f2d20) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Rename rpc file that prevented shims to be applied for React Native + +## 0.3.0-next.0 + +### Minor Changes + +- [#3611](https://github.com/LedgerHQ/ledger-live/pull/3611) [`092cb8d317`](https://github.com/LedgerHQ/ledger-live/commit/092cb8d317fa7971e0f790b77f900ae3864d96c2) Thanks [@chabroA](https://github.com/chabroA)! - Create GasTracker abstraction for evm familly + +### Patch Changes + +- [#3741](https://github.com/LedgerHQ/ledger-live/pull/3741) [`6194db3178`](https://github.com/LedgerHQ/ledger-live/commit/6194db3178cf90b26f4f6c7f049b7eafafdf7bfc) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Update eip55 dependency + +- [#3741](https://github.com/LedgerHQ/ledger-live/pull/3741) [`6194db3178`](https://github.com/LedgerHQ/ledger-live/commit/6194db3178cf90b26f4f6c7f049b7eafafdf7bfc) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Update eip55 dependency to 2.1.1 fixing browser context usage + +- Updated dependencies [[`6194db3178`](https://github.com/LedgerHQ/ledger-live/commit/6194db3178cf90b26f4f6c7f049b7eafafdf7bfc), [`44192f2ab2`](https://github.com/LedgerHQ/ledger-live/commit/44192f2ab2857cbae2ef4a81ee9608d395dcd2b9), [`cb95f72c24`](https://github.com/LedgerHQ/ledger-live/commit/cb95f72c2415876ef88ca83fd2c4363a57669b92), [`be5f56b233`](https://github.com/LedgerHQ/ledger-live/commit/be5f56b2330c166323914b79fef37a3c05e0e13a), [`092cb8d317`](https://github.com/LedgerHQ/ledger-live/commit/092cb8d317fa7971e0f790b77f900ae3864d96c2), [`5af41b6fa1`](https://github.com/LedgerHQ/ledger-live/commit/5af41b6fa1e43037ccdb2df279c82e12ef3d2b1a), [`6194db3178`](https://github.com/LedgerHQ/ledger-live/commit/6194db3178cf90b26f4f6c7f049b7eafafdf7bfc)]: + - @ledgerhq/domain-service@1.1.5-next.0 + - @ledgerhq/types-live@6.36.0-next.0 + - @ledgerhq/cryptoassets@9.9.0-next.0 + - @ledgerhq/types-cryptoassets@7.3.0-next.0 + - @ledgerhq/live-env@0.3.1-next.0 + - @ledgerhq/hw-app-eth@6.33.7-next.0 + - @ledgerhq/coin-framework@0.3.7-next.0 + - @ledgerhq/live-network@1.1.2-next.0 + +## 0.2.1 + +### Patch Changes + +- Updated dependencies [[`9adc1862dd`](https://github.com/LedgerHQ/ledger-live/commit/9adc1862dda605a722d19f3b6895bd324834c914), [`4a1454beb3`](https://github.com/LedgerHQ/ledger-live/commit/4a1454beb3f86405ba2686e07879c12a7d35ad8e), [`809065c571`](https://github.com/LedgerHQ/ledger-live/commit/809065c57198646a49adea112b9d799e35a57d25), [`d1aa522db7`](https://github.com/LedgerHQ/ledger-live/commit/d1aa522db75f7ea850efe412abaa4dc7d37af6b7), [`ebe5b07afe`](https://github.com/LedgerHQ/ledger-live/commit/ebe5b07afec441ea3e2d9103da9e1175972add47)]: + - @ledgerhq/errors@6.12.7 + - @ledgerhq/cryptoassets@9.8.0 + - @ledgerhq/types-cryptoassets@7.2.1 + - @ledgerhq/types-live@6.35.1 + - @ledgerhq/coin-framework@0.3.6 + - @ledgerhq/domain-service@1.1.4 + - @ledgerhq/devices@8.0.4 + - @ledgerhq/hw-app-eth@6.33.6 + - @ledgerhq/live-network@1.1.1 + - @ledgerhq/live-portfolio@0.0.8 + +## 0.2.1-next.0 + +### Patch Changes + +- Updated dependencies [[`9adc1862dd`](https://github.com/LedgerHQ/ledger-live/commit/9adc1862dda605a722d19f3b6895bd324834c914), [`4a1454beb3`](https://github.com/LedgerHQ/ledger-live/commit/4a1454beb3f86405ba2686e07879c12a7d35ad8e), [`809065c571`](https://github.com/LedgerHQ/ledger-live/commit/809065c57198646a49adea112b9d799e35a57d25), [`d1aa522db7`](https://github.com/LedgerHQ/ledger-live/commit/d1aa522db75f7ea850efe412abaa4dc7d37af6b7), [`ebe5b07afe`](https://github.com/LedgerHQ/ledger-live/commit/ebe5b07afec441ea3e2d9103da9e1175972add47)]: + - @ledgerhq/errors@6.12.7-next.0 + - @ledgerhq/cryptoassets@9.8.0-next.0 + - @ledgerhq/types-cryptoassets@7.2.1-next.0 + - @ledgerhq/types-live@6.35.1-next.0 + - @ledgerhq/coin-framework@0.3.6-next.0 + - @ledgerhq/domain-service@1.1.4-next.0 + - @ledgerhq/devices@8.0.4-next.0 + - @ledgerhq/hw-app-eth@6.33.6-next.0 + - @ledgerhq/live-network@1.1.1-next.0 + - @ledgerhq/live-portfolio@0.0.8-next.0 + +## 0.2.0 + +### Minor Changes + +- [#3536](https://github.com/LedgerHQ/ledger-live/pull/3536) [`a380bfc53a`](https://github.com/LedgerHQ/ledger-live/commit/a380bfc53a25bf196031337cd7ab8bc459731e16) Thanks [@chabroA](https://github.com/chabroA)! - Move evm familly logic in own package + +### Patch Changes + +- Updated dependencies [[`5cce6e3593`](https://github.com/LedgerHQ/ledger-live/commit/5cce6e359309110df53e16ef989c5b8b94492dfd), [`30bf4d92c7`](https://github.com/LedgerHQ/ledger-live/commit/30bf4d92c7d79cb81b1e4ad014857459739c33be), [`b30ead9d22`](https://github.com/LedgerHQ/ledger-live/commit/b30ead9d22a4bce5f8ee27febf0190fccd2ca25b), [`ce675302c7`](https://github.com/LedgerHQ/ledger-live/commit/ce675302c78311571e1087cfa35ee67580263796), [`43cdd2624c`](https://github.com/LedgerHQ/ledger-live/commit/43cdd2624cd2965ddb6e346e9a77a3cc12476500)]: + - @ledgerhq/cryptoassets@9.7.0 + - @ledgerhq/live-network@1.1.0 + - @ledgerhq/types-live@6.35.0 + - @ledgerhq/coin-framework@0.3.5 + - @ledgerhq/domain-service@1.1.3 + - @ledgerhq/hw-app-eth@6.33.5 + - @ledgerhq/live-portfolio@0.0.7 + +## 0.2.0-next.1 + +### Patch Changes + +- Updated dependencies [[`30bf4d92c7`](https://github.com/LedgerHQ/ledger-live/commit/30bf4d92c7d79cb81b1e4ad014857459739c33be)]: + - @ledgerhq/cryptoassets@9.7.0-next.1 + - @ledgerhq/coin-framework@0.3.5-next.1 + - @ledgerhq/domain-service@1.1.3-next.1 + - @ledgerhq/hw-app-eth@6.33.5-next.1 + +## 0.2.0-next.0 + +### Minor Changes + +- [#3536](https://github.com/LedgerHQ/ledger-live/pull/3536) [`a380bfc53a`](https://github.com/LedgerHQ/ledger-live/commit/a380bfc53a25bf196031337cd7ab8bc459731e16) Thanks [@chabroA](https://github.com/chabroA)! - Move evm familly logic in own package + +### Patch Changes + +- Updated dependencies [[`5cce6e3593`](https://github.com/LedgerHQ/ledger-live/commit/5cce6e359309110df53e16ef989c5b8b94492dfd), [`b30ead9d22`](https://github.com/LedgerHQ/ledger-live/commit/b30ead9d22a4bce5f8ee27febf0190fccd2ca25b), [`7439b63325`](https://github.com/LedgerHQ/ledger-live/commit/7439b63325a9b0181a3af4310ba787f00faa80c9), [`ce675302c7`](https://github.com/LedgerHQ/ledger-live/commit/ce675302c78311571e1087cfa35ee67580263796), [`43cdd2624c`](https://github.com/LedgerHQ/ledger-live/commit/43cdd2624cd2965ddb6e346e9a77a3cc12476500)]: + - @ledgerhq/cryptoassets@9.7.0-next.0 + - @ledgerhq/live-network@1.1.0-next.0 + - @ledgerhq/types-live@6.35.0-next.0 + - @ledgerhq/coin-framework@0.3.5-next.0 + - @ledgerhq/domain-service@1.1.3-next.0 + - @ledgerhq/hw-app-eth@6.33.5-next.0 + - @ledgerhq/live-portfolio@0.0.7-next.0 diff --git a/libs/coin-modules/coin-vechain/jest.config.js b/libs/coin-modules/coin-vechain/jest.config.js new file mode 100644 index 000000000000..277979429936 --- /dev/null +++ b/libs/coin-modules/coin-vechain/jest.config.js @@ -0,0 +1,8 @@ +/** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ +module.exports = { + collectCoverageFrom: ["src/**/*.ts"], + coverageDirectory: "coverage", + preset: "ts-jest", + testEnvironment: "node", + testPathIgnorePatterns: ["lib/", "lib-es/", ".*\\.integ\\.test\\.[tj]s"], +}; diff --git a/libs/coin-modules/coin-vechain/package.json b/libs/coin-modules/coin-vechain/package.json new file mode 100644 index 000000000000..9ef062aa73bf --- /dev/null +++ b/libs/coin-modules/coin-vechain/package.json @@ -0,0 +1,106 @@ +{ + "name": "@ledgerhq/coin-vechain", + "version": "2.1.3", + "description": "Ledger VeChain Coin integration", + "keywords": [ + "Ledger", + "LedgerWallet", + "VeChain", + "Hardware Wallet" + ], + "repository": { + "type": "git", + "url": "https://github.com/LedgerHQ/ledger-live.git" + }, + "bugs": { + "url": "https://github.com/LedgerHQ/ledger-live/issues" + }, + "homepage": "https://github.com/LedgerHQ/ledger-live/tree/develop/libs/coin-modules/coin-vechain", + "publishConfig": { + "access": "public" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib/*" + ], + "lib-es/*": [ + "lib-es/*" + ], + "*": [ + "lib/*" + ] + } + }, + "exports": { + "./lib/*": "./lib/*.js", + "./lib-es/*": "./lib-es/*.js", + "./*": { + "require": "./lib/*.js", + "default": "./lib-es/*.js" + }, + "./package.json": "./package.json" + }, + "license": "Apache-2.0", + "scripts": { + "clean": "rimraf lib lib-es", + "build": "tsc && tsc -m ES6 --outDir lib-es", + "coverage": "jest --coverage --testPathIgnorePatterns='/bridge.integration.test.ts|node_modules|lib-es|lib/' --passWithNoTests && mv coverage/coverage-final.json coverage/coverage-vechain.json", + "prewatch": "pnpm build", + "watch": "tsc --watch", + "doc": "documentation readme src/** --section=API --pe ts --re ts --re d.ts", + "lint": "eslint ./src --no-error-on-unmatched-pattern --ext .ts,.tsx --cache", + "lint:fix": "pnpm lint --fix", + "typecheck": "tsc --noEmit", + "test": "jest", + "unimported": "unimported", + "coin-tester": "DOTENV_CONFIG_PATH=src/__tests__/coin-tester/.env pnpm jest --runTestsByPath src/__tests__/coin-tester/*.test.ts" + }, + "dependencies": { + "@ethersproject/shims": "^5.7.0", + "@ledgerhq/coin-framework": "workspace:^", + "@ledgerhq/cryptoassets": "workspace:^", + "@ledgerhq/devices": "workspace:^", + "@ledgerhq/domain-service": "workspace:^", + "@ledgerhq/errors": "workspace:^", + "@ledgerhq/evm-tools": "workspace:^", + "@ledgerhq/live-config": "^3.0.0", + "@ledgerhq/live-env": "workspace:^", + "@ledgerhq/live-network": "workspace:^", + "@ledgerhq/live-promise": "workspace:^", + "@ledgerhq/logs": "workspace:^", + "axios": "0.26.1", + "bignumber.js": "^9.1.2", + "eip55": "^2.1.1", + "ethers": "5.7.2", + "expect": "^27.4.6", + "imurmurhash": "^0.1.4", + "invariant": "^2.2.2", + "lodash": "^4.17.21", + "react-native-get-random-values": "^1.8.0", + "rxjs": "^7.8.1", + "thor-devkit": "^2.0.6" + }, + "devDependencies": { + "@ledgerhq/coin-tester": "workspace:^", + "@ledgerhq/hw-app-eth": "workspace:^", + "@ledgerhq/types-cryptoassets": "workspace:^", + "@ledgerhq/types-live": "workspace:^", + "@types/bluebird": "^3.5.42", + "@types/imurmurhash": "^0.1.4", + "@types/invariant": "^2.2.2", + "@types/jest": "^29.5.10", + "@types/lodash": "^4.14.191", + "bluebird": "^3.7.2", + "chalk": "^4.1.2", + "docker-compose": "^0.24.2", + "dotenv": "^16.4.5", + "eslint-plugin-import": "^2.28.1", + "fast-check": "^3.12.0", + "jest": "^29.7.0", + "jest-expect-message": "^1.1.3", + "msw": "^2.2.12", + "prando": "^6.0.1", + "ts-jest": "^29.1.1" + } +} diff --git a/libs/coin-modules/coin-vechain/src/__snapshots__/bridge.integration.test.ts.snap b/libs/coin-modules/coin-vechain/src/__snapshots__/bridge.integration.test.ts.snap new file mode 100644 index 000000000000..0c0bbaa55115 --- /dev/null +++ b/libs/coin-modules/coin-vechain/src/__snapshots__/bridge.integration.test.ts.snap @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`vechain currency bridge scanAccounts vechain seed 1 1`] = ` +[ + { + "currencyId": "vechain", + "derivationMode": "vechain", + "feesCurrencyId": "vechain/vip180/vtho", + "freshAddress": "0x0fe6688548f0C303932bB197B0A96034f1d74dba", + "freshAddressPath": "44'/818'/0'/0/0", + "id": "js:2:vechain:0x0fe6688548f0C303932bB197B0A96034f1d74dba:vechain", + "index": 0, + "operationsCount": 1, + "pendingOperations": [], + "seedIdentifier": "04de5a8f11cc426ff5617aeffd397c5dd77b58424662f368f2cd539a8c42fd2e7d0c6245c9c3a4306f70d7f292e95642651a6832d66fd9823fa6a0af575113e94e", + "subAccounts": [], + "swapHistory": [], + "syncHash": undefined, + "used": true, + }, + { + "id": "js:2:vechain:0x0fe6688548f0C303932bB197B0A96034f1d74dba:vechain+vechain%2Fvip180%2Fvtho", + "operationsCount": 1, + "parentId": "js:2:vechain:0x0fe6688548f0C303932bB197B0A96034f1d74dba:vechain", + "pendingOperations": [], + "swapHistory": [], + "tokenId": "vechain/vip180/vtho", + "type": "TokenAccountRaw", + }, + { + "currencyId": "vechain", + "derivationMode": "vechain", + "feesCurrencyId": "vechain/vip180/vtho", + "freshAddress": "0x02961B92B8D20A4ea12f1f1CeFA74Dd7B4355A86", + "freshAddressPath": "44'/818'/0'/0/1", + "id": "js:2:vechain:0x02961B92B8D20A4ea12f1f1CeFA74Dd7B4355A86:vechain", + "index": 1, + "operationsCount": 1, + "pendingOperations": [], + "seedIdentifier": "04de5a8f11cc426ff5617aeffd397c5dd77b58424662f368f2cd539a8c42fd2e7d0c6245c9c3a4306f70d7f292e95642651a6832d66fd9823fa6a0af575113e94e", + "subAccounts": [], + "swapHistory": [], + "syncHash": undefined, + "used": true, + }, + { + "id": "js:2:vechain:0x02961B92B8D20A4ea12f1f1CeFA74Dd7B4355A86:vechain+vechain%2Fvip180%2Fvtho", + "operationsCount": 0, + "parentId": "js:2:vechain:0x02961B92B8D20A4ea12f1f1CeFA74Dd7B4355A86:vechain", + "pendingOperations": [], + "swapHistory": [], + "tokenId": "vechain/vip180/vtho", + "type": "TokenAccountRaw", + }, + { + "currencyId": "vechain", + "derivationMode": "vechain", + "feesCurrencyId": "vechain/vip180/vtho", + "freshAddress": "0xFbC8653C0b842dd33361CE8938B24e407dd4838C", + "freshAddressPath": "44'/818'/0'/0/2", + "id": "js:2:vechain:0xFbC8653C0b842dd33361CE8938B24e407dd4838C:vechain", + "index": 2, + "operationsCount": 0, + "pendingOperations": [], + "seedIdentifier": "04de5a8f11cc426ff5617aeffd397c5dd77b58424662f368f2cd539a8c42fd2e7d0c6245c9c3a4306f70d7f292e95642651a6832d66fd9823fa6a0af575113e94e", + "subAccounts": [], + "swapHistory": [], + "syncHash": undefined, + "used": false, + }, + { + "id": "js:2:vechain:0xFbC8653C0b842dd33361CE8938B24e407dd4838C:vechain+vechain%2Fvip180%2Fvtho", + "operationsCount": 0, + "parentId": "js:2:vechain:0xFbC8653C0b842dd33361CE8938B24e407dd4838C:vechain", + "pendingOperations": [], + "swapHistory": [], + "tokenId": "vechain/vip180/vtho", + "type": "TokenAccountRaw", + }, +] +`; + +exports[`vechain currency bridge scanAccounts vechain seed 1 2`] = ` +[ + [ + { + "accountId": "js:2:vechain:0x0fe6688548f0C303932bB197B0A96034f1d74dba:vechain", + "blockHash": "0x00fa5b35f158cee280b6be35b4ada7669951035a79806244aaa11e5d2764d5bd", + "blockHeight": 16407349, + "extra": {}, + "fee": "210000000000000000", + "hash": "0xe113f82af98a24c6f2473802f8673f0d69eed1c0f51a5a87d3cc6b8cf96ccfd6", + "id": "js:2:vechain:0x0fe6688548f0C303932bB197B0A96034f1d74dba:vechain-0xe113f82af98a24c6f2473802f8673f0d69eed1c0f51a5a87d3cc6b8cf96ccfd6-IN", + "recipients": [ + "0x0fe6688548f0c303932bb197b0a96034f1d74dba", + ], + "senders": [ + "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", + ], + "type": "IN", + "value": "10000000000000000000", + }, + ], + [ + { + "accountId": "js:2:vechain:0x0fe6688548f0C303932bB197B0A96034f1d74dba:vechain+vechain%2Fvip180%2Fvtho", + "blockHash": "0x00fa5b4ee2eca5cf65907e3695bbea044cd1f78224534dc0ba02526890055ecc", + "blockHeight": 16407374, + "extra": {}, + "fee": "365180000000000000", + "hash": "0x5fdd7191c4d476a8e86060d516366e87421f65667b9b3c14c33a740c04921b10", + "id": "js:2:vechain:0x0fe6688548f0C303932bB197B0A96034f1d74dba:vechain+vechain%2Fvip180%2Fvtho-0x5fdd7191c4d476a8e86060d516366e87421f65667b9b3c14c33a740c04921b10-IN", + "recipients": [ + "0x0fe6688548f0c303932bb197b0a96034f1d74dba", + ], + "senders": [ + "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", + ], + "type": "IN", + "value": "10000000000000000000", + }, + ], + [ + { + "accountId": "js:2:vechain:0x02961B92B8D20A4ea12f1f1CeFA74Dd7B4355A86:vechain", + "blockHash": "0x00fa5b547b0d542ba8e62a85aa99cf355f1b2a70bd34e3949f889b0856776e05", + "blockHeight": 16407380, + "extra": {}, + "fee": "210000000000000000", + "hash": "0xa4096186f2d58ecc68e6ea11c9757ef5bd78b21b87d73b4618eb6fd3508431ec", + "id": "js:2:vechain:0x02961B92B8D20A4ea12f1f1CeFA74Dd7B4355A86:vechain-0xa4096186f2d58ecc68e6ea11c9757ef5bd78b21b87d73b4618eb6fd3508431ec-IN", + "recipients": [ + "0x02961b92b8d20a4ea12f1f1cefa74dd7b4355a86", + ], + "senders": [ + "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", + ], + "type": "IN", + "value": "10000000000000000000", + }, + ], + [], + [], + [], +] +`; diff --git a/libs/ledger-live-common/src/families/vechain/account.ts b/libs/coin-modules/coin-vechain/src/account.ts similarity index 72% rename from libs/ledger-live-common/src/families/vechain/account.ts rename to libs/coin-modules/coin-vechain/src/account.ts index 6ce5b5dbc58e..38098420f9f2 100644 --- a/libs/ledger-live-common/src/families/vechain/account.ts +++ b/libs/coin-modules/coin-vechain/src/account.ts @@ -1,6 +1,6 @@ +import { getAccountCurrency } from "@ledgerhq/coin-framework/lib/account/index"; +import { formatCurrencyUnit } from "@ledgerhq/coin-framework/lib/currencies/index"; import type { Account } from "@ledgerhq/types-live"; -import { getAccountCurrency } from "../../account"; -import { formatCurrencyUnit } from "../../currencies"; function formatAccountSpecifics(account: Account): string { const unit = getAccountCurrency(account).units[0]; diff --git a/libs/ledger-live-common/src/families/vechain/api/index.ts b/libs/coin-modules/coin-vechain/src/api/index.ts similarity index 100% rename from libs/ledger-live-common/src/families/vechain/api/index.ts rename to libs/coin-modules/coin-vechain/src/api/index.ts diff --git a/libs/ledger-live-common/src/families/vechain/api/sdk.ts b/libs/coin-modules/coin-vechain/src/api/sdk.ts similarity index 100% rename from libs/ledger-live-common/src/families/vechain/api/sdk.ts rename to libs/coin-modules/coin-vechain/src/api/sdk.ts diff --git a/libs/ledger-live-common/src/families/vechain/api/types.ts b/libs/coin-modules/coin-vechain/src/api/types.ts similarity index 100% rename from libs/ledger-live-common/src/families/vechain/api/types.ts rename to libs/coin-modules/coin-vechain/src/api/types.ts diff --git a/libs/coin-modules/coin-vechain/src/bridge.integration.test.ts b/libs/coin-modules/coin-vechain/src/bridge.integration.test.ts new file mode 100644 index 000000000000..99bc24386ebb --- /dev/null +++ b/libs/coin-modules/coin-vechain/src/bridge.integration.test.ts @@ -0,0 +1,259 @@ +import type { AccountRaw, DatasetTest } from "@ledgerhq/types-live"; +import type { Transaction } from "./types"; +import { fromTransactionRaw } from "./transaction"; +import { DEFAULT_GAS_COEFFICIENT, MAINNET_CHAIN_TAG } from "./constants"; +import { vechain1, vechain3 } from "./datasets/vechain"; +import { generateNonce } from "./utils/transaction-utils"; +import BigNumber from "bignumber.js"; + +import vechainScanAccounts1 from "./datasets/vechain.scanAccounts.1"; +import { AmountRequired, NotEnoughBalance } from "@ledgerhq/errors"; +import VIP180 from "./contracts/abis/VIP180"; +import { CryptoCurrencyId } from "@ledgerhq/types-cryptoassets"; +import { NotEnoughVTHO } from "./errors"; +import { + listSupportedCurrencies, + setSupportedCurrencies, +} from "@ledgerhq/coin-framework/lib/currencies/index"; +import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies"; + +const listSupported = listSupportedCurrencies(); +listSupported.push(getCryptoCurrencyById("vechain")); +setSupportedCurrencies(listSupported.map(c => c.id) as CryptoCurrencyId[]); + +export const dataset: DatasetTest = { + implementations: ["js", "mock"], + currencies: { + vechain: { + FIXME_ignoreAccountFields: ["balance", "spendableBalance", "estimateMaxSpendable"], // the balance depends on VTHO and it's earned without operations + scanAccounts: vechainScanAccounts1, + + accounts: [ + { + raw: vechain1 as AccountRaw, + transactions: [ + { + name: "Send VET", + transaction: fromTransactionRaw({ + family: "vechain", + estimatedFees: "210000000000000000", + recipient: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", + amount: "1000000000000000000", + body: { + chainTag: MAINNET_CHAIN_TAG, + blockRef: "0x00634a0c856ec1db", + expiration: 18, + clauses: [ + { + to: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", + value: "1000000000000000000", + data: "0x", + }, + ], + gasPriceCoef: DEFAULT_GAS_COEFFICIENT, + gas: "0", + dependsOn: null, + nonce: generateNonce(), + }, + }), + expectedStatus: { + amount: new BigNumber("1000000000000000000"), + estimatedFees: new BigNumber("210000000000000000"), + totalSpent: new BigNumber("1000000000000000000"), + errors: {}, + warnings: {}, + }, + }, + { + name: "Send VTHO", + transaction: fromTransactionRaw({ + family: "vechain", + subAccountId: + "js:2:vechain:0x0fe6688548f0C303932bB197B0A96034f1d74dba:vechain+vechain%2Fvip180%2Fvtho", + estimatedFees: "515180000000000000", + recipient: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", + amount: "1000000000000000000", + body: { + chainTag: MAINNET_CHAIN_TAG, + blockRef: "0x00634a0c856ec1db", + expiration: 18, + clauses: [ + { + to: "0x0000000000000000000000000000456e65726779", + value: 0, + data: VIP180.transfer.encode( + "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", + "9000000000000000000", + ), + }, + ], + gasPriceCoef: DEFAULT_GAS_COEFFICIENT, + gas: "0", + dependsOn: null, + nonce: generateNonce(), + }, + }), + expectedStatus: { + amount: new BigNumber("1000000000000000000"), + estimatedFees: new BigNumber("515180000000000000"), + totalSpent: new BigNumber("1515180000000000000"), + errors: {}, + warnings: {}, + }, + }, + { + name: "Amount required", + transaction: fromTransactionRaw({ + family: "vechain", + estimatedFees: "0", + recipient: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", + amount: "", + body: { + chainTag: MAINNET_CHAIN_TAG, + blockRef: "0x00634a0c856ec1db", + expiration: 18, + clauses: [{ to: "", value: 0, data: "0x" }], + gasPriceCoef: DEFAULT_GAS_COEFFICIENT, + gas: "0", + dependsOn: null, + nonce: generateNonce(), + }, + }), + expectedStatus: { + errors: { + amount: new AmountRequired(), + }, + warnings: {}, + }, + }, + { + name: "VET balance not enough", + transaction: fromTransactionRaw({ + family: "vechain", + estimatedFees: "210000000000000000", + recipient: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", + amount: "20000000000000000000", + body: { + chainTag: MAINNET_CHAIN_TAG, + blockRef: "0x00634a0c856ec1db", + expiration: 18, + clauses: [ + { + to: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", + value: "20000000000000000000", + data: "0x", + }, + ], + gasPriceCoef: DEFAULT_GAS_COEFFICIENT, + gas: "0", + dependsOn: null, + nonce: generateNonce(), + }, + }), + expectedStatus: { + amount: new BigNumber("20000000000000000000"), + errors: { + amount: new NotEnoughBalance(), + }, + warnings: {}, + totalSpent: new BigNumber("20000000000000000000"), + estimatedFees: new BigNumber("210000000000000000"), + }, + }, + { + name: "VTHO balance not enough", + transaction: fromTransactionRaw({ + family: "vechain", + subAccountId: + "js:2:vechain:0x0fe6688548f0C303932bB197B0A96034f1d74dba:vechain+vechain%2Fvip180%2Fvtho", + estimatedFees: "515820000000000000", + recipient: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", + amount: "20000000000000000000", + body: { + chainTag: MAINNET_CHAIN_TAG, + blockRef: "0x00634a0c856ec1db", + expiration: 18, + clauses: [ + { + to: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", + value: "20000000000000000000", + data: "0x", + }, + ], + gasPriceCoef: DEFAULT_GAS_COEFFICIENT, + gas: "0", + dependsOn: null, + nonce: generateNonce(), + }, + }), + expectedStatus: { + amount: new BigNumber("20000000000000000000"), + errors: { + amount: new NotEnoughBalance(), + }, + warnings: {}, + totalSpent: new BigNumber("20515820000000000000"), + estimatedFees: new BigNumber("515820000000000000"), + }, + }, + ], + FIXME_tests: [ + "balance is sum of ops", // the balance depends on VTHO and it's earned without operations + "empty transaction is equals to itself", //nonce is not deterministic + "ref stability on self transaction", //blockref is not deterministic + "can be run in parallel and all yield same results", //blockref is not deterministic + ], + }, + { + raw: vechain3 as AccountRaw, + transactions: [ + { + name: "Not enough VTHO to pay fees", + transaction: fromTransactionRaw({ + family: "vechain", + estimatedFees: "210000000000000000", + recipient: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", + amount: "1000000000000000000", + body: { + chainTag: MAINNET_CHAIN_TAG, + blockRef: "0x00634a0c856ec1db", + expiration: 18, + clauses: [ + { + to: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", + value: "1000000000000000000", + data: "0x", + }, + ], + gasPriceCoef: DEFAULT_GAS_COEFFICIENT, + gas: "0", + dependsOn: null, + nonce: generateNonce(), + }, + }), + expectedStatus: { + amount: new BigNumber("1000000000000000000"), + estimatedFees: new BigNumber("210000000000000000"), + totalSpent: new BigNumber("1000000000000000000"), + errors: { + amount: new NotEnoughVTHO(), + }, + warnings: {}, + }, + }, + ], + FIXME_tests: [ + "balance is sum of ops", // the balance depends on VTHO and it's earned without operations + "empty transaction is equals to itself", //nonce is not deterministic + "ref stability on self transaction", //blockref is not deterministic + "can be run in parallel and all yield same results", //blockref is not deterministic + ], + }, + ], + }, + }, +}; + +describe("VeChain Bridge", () => { + test.todo("sample test"); +}); diff --git a/libs/coin-modules/coin-vechain/src/bridge/js.ts b/libs/coin-modules/coin-vechain/src/bridge/js.ts new file mode 100644 index 000000000000..517caff82686 --- /dev/null +++ b/libs/coin-modules/coin-vechain/src/bridge/js.ts @@ -0,0 +1,33 @@ +import { Account, AccountBridge, CurrencyBridge } from "@ledgerhq/types-live"; +import { defaultUpdateTransaction } from "@ledgerhq/coin-framework/bridge/jsHelpers"; +import { makeAccountBridgeReceive } from "../../../bridge/jsHelpers"; +import { getTransactionStatus } from "../getTransactionStatus"; +import type { Transaction, TransactionStatus } from "../types"; +import { estimateMaxSpendable } from "../estimateMaxSpendable"; +import { prepareTransaction } from "../prepareTransaction"; +import { createTransaction } from "../createTransaction"; +import { sync, scanAccounts } from "../synchronisation"; +import { signOperation } from "../signOperation"; +import { broadcast } from "../broadcast"; + +const receive: AccountBridge["receive"] = makeAccountBridgeReceive(); + +const currencyBridge: CurrencyBridge = { + scanAccounts, + preload: async () => Promise.resolve({}), + hydrate: (): void => {}, +}; + +const accountBridge: AccountBridge = { + estimateMaxSpendable, + createTransaction, + updateTransaction: defaultUpdateTransaction, + getTransactionStatus, + prepareTransaction, + sync, + receive, + signOperation, + broadcast, +}; + +export default { currencyBridge, accountBridge }; diff --git a/libs/coin-modules/coin-vechain/src/bridge/mock.ts b/libs/coin-modules/coin-vechain/src/bridge/mock.ts new file mode 100644 index 000000000000..e3bc22524547 --- /dev/null +++ b/libs/coin-modules/coin-vechain/src/bridge/mock.ts @@ -0,0 +1,137 @@ +import { AccountBridge, CurrencyBridge, TokenAccount } from "@ledgerhq/types-live"; +import type { Transaction, TransactionStatus } from "../types"; +import { scanAccounts, signOperation, broadcast, sync } from "../../../bridge/mockHelpers"; +import { makeAccountBridgeReceive } from "../../../bridge/mockHelpers"; +import BigNumber from "bignumber.js"; +import { DEFAULT_GAS_COEFFICIENT, MAINNET_CHAIN_TAG } from "../constants"; +import { calculateTransactionInfo, generateNonce } from "../utils/transaction-utils"; +import { defaultUpdateTransaction } from "@ledgerhq/coin-framework/bridge/jsHelpers"; +import { Account } from "@ledgerhq/types-live"; +import { + AmountRequired, + FeeNotLoaded, + InvalidAddress, + InvalidAddressBecauseDestinationIsAlsoSource, + NotEnoughBalance, + RecipientRequired, +} from "@ledgerhq/errors"; +import { NotEnoughVTHO } from "../errors"; +import { isValid } from "../utils/address-utils"; + +const receive = makeAccountBridgeReceive(); + +const currencyBridge: CurrencyBridge = { + scanAccounts, + preload: async () => Promise.resolve({}), + hydrate: (): void => {}, +}; + +const estimateMaxSpendable = ({ account }) => { + return account.balance; +}; + +const createTransaction = (): Transaction => ({ + amount: new BigNumber(0), + useAllAmount: false, + family: "vechain", + estimatedFees: "0", + recipient: "", + body: { + chainTag: MAINNET_CHAIN_TAG, + blockRef: "", + expiration: 18, + clauses: [], + gasPriceCoef: DEFAULT_GAS_COEFFICIENT, + gas: "0", + dependsOn: null, + nonce: generateNonce(), + }, +}); + +const getTransactionStatus = async ( + account: Account, + transaction: Transaction, +): Promise => { + const { freshAddress, currency, subAccounts } = account; + const { body, recipient, subAccountId } = transaction; + const errors: Record = {}; + const warnings: Record = {}; + + const tokenAccount = + subAccountId && subAccounts + ? (subAccounts.find(subAccount => { + return subAccount.id === subAccountId; + }) as TokenAccount) + : undefined; + const isTokenAccount = !!tokenAccount; + const estimatedFees = new BigNumber(transaction.estimatedFees); + + const { amount, spendableBalance } = await calculateTransactionInfo(account, transaction, { + estimatedGas: body.gas as number, + estimatedGasFees: estimatedFees, + }); + + if (!body?.gas) { + errors.fees = new FeeNotLoaded(); + } + + if (!recipient) { + errors.recipient = new RecipientRequired(); + } else if (freshAddress.toLowerCase() === recipient.toLowerCase()) { + warnings.recipient = new InvalidAddressBecauseDestinationIsAlsoSource(); + } else if (!isValid(recipient)) { + errors.recipient = new InvalidAddress("", { + currencyName: currency.name, + }); + } + + if (!amount.gt(0)) { + if (!transaction.useAllAmount) errors.amount = new AmountRequired(); + else errors.amount = new NotEnoughBalance(); + } else { + if (amount.gt(spendableBalance)) { + errors.amount = new NotEnoughBalance(); + } + if (!isTokenAccount) { + // vet + const vthoBalance = subAccounts?.[0].balance; + if (estimatedFees.gt(vthoBalance || 0)) { + errors.amount = new NotEnoughVTHO(); + } + } + } + + let totalSpent = amount; + if (isTokenAccount) { + totalSpent = amount.plus(estimatedFees); + } + + return Promise.resolve({ + errors, + warnings, + estimatedFees, + amount, + totalSpent, + }); +}; + +export const prepareTransaction = async ( + account: Account, + transaction: Transaction, +): Promise => { + return transaction; +}; + +const accountBridge: AccountBridge = { + estimateMaxSpendable, + createTransaction, + updateTransaction: defaultUpdateTransaction, + getTransactionStatus, + prepareTransaction, + sync, + receive, + signOperation, + broadcast, +}; + +export default { currencyBridge, accountBridge }; diff --git a/libs/ledger-live-common/src/families/vechain/broadcast.ts b/libs/coin-modules/coin-vechain/src/broadcast.ts similarity index 89% rename from libs/ledger-live-common/src/families/vechain/broadcast.ts rename to libs/coin-modules/coin-vechain/src/broadcast.ts index 708d2fa95615..93a3316556ec 100644 --- a/libs/ledger-live-common/src/families/vechain/broadcast.ts +++ b/libs/coin-modules/coin-vechain/src/broadcast.ts @@ -1,6 +1,7 @@ import { Transaction as VeChainThorTransaction } from "thor-devkit"; import type { AccountBridge } from "@ledgerhq/types-live"; -import { patchOperationWithHash } from "../../operation"; +import { patchOperationWithHash } from "@ledgerhq/coin-framework/lib/operation"; + import { Transaction } from "./types"; import { submit } from "./api"; diff --git a/libs/ledger-live-common/src/families/vechain/buildOptimisticOperatioin.ts b/libs/coin-modules/coin-vechain/src/buildOptimisticOperatioin.ts similarity index 95% rename from libs/ledger-live-common/src/families/vechain/buildOptimisticOperatioin.ts rename to libs/coin-modules/coin-vechain/src/buildOptimisticOperatioin.ts index f14b6d6476e6..b83bbd83bfbc 100644 --- a/libs/ledger-live-common/src/families/vechain/buildOptimisticOperatioin.ts +++ b/libs/coin-modules/coin-vechain/src/buildOptimisticOperatioin.ts @@ -1,7 +1,7 @@ import { Account, Operation } from "@ledgerhq/types-live"; import { Transaction } from "./types"; -import { encodeOperationId } from "../../operation"; import BigNumber from "bignumber.js"; +import { encodeOperationId } from "@ledgerhq/coin-framework/lib/operation"; export const buildOptimisticOperation = async ( account: Account, diff --git a/libs/ledger-live-common/src/families/vechain/cli-transaction.ts b/libs/coin-modules/coin-vechain/src/cli-transaction.ts similarity index 93% rename from libs/ledger-live-common/src/families/vechain/cli-transaction.ts rename to libs/coin-modules/coin-vechain/src/cli-transaction.ts index 97c556250f5c..8ec3ef70a62a 100644 --- a/libs/ledger-live-common/src/families/vechain/cli-transaction.ts +++ b/libs/coin-modules/coin-vechain/src/cli-transaction.ts @@ -1,6 +1,5 @@ import flatMap from "lodash/flatMap"; -import type { Transaction } from "../../generated/types"; -import { Transaction as VechainTransaction } from "./types"; +import { Transaction, Transaction as VechainTransaction } from "./types"; import type { Account, AccountLike } from "@ledgerhq/types-live"; import { VTHO_ADDRESS } from "./contracts/constants"; import VIP180 from "./contracts/abis/VIP180"; diff --git a/libs/coin-modules/coin-vechain/src/config.ts b/libs/coin-modules/coin-vechain/src/config.ts new file mode 100644 index 000000000000..461dc259cf42 --- /dev/null +++ b/libs/coin-modules/coin-vechain/src/config.ts @@ -0,0 +1,18 @@ +import { CurrencyConfig, CoinConfig } from "@ledgerhq/coin-framework/config"; +import { MissingCoinConfig } from "@ledgerhq/coin-framework/errors"; + +export type VeChainCoinConfig = CurrencyConfig; + +let coinConfig: CoinConfig | undefined; + +export function setCoinConfig(config: CoinConfig): void { + coinConfig = config; +} + +export function getCoinConfig(): VeChainCoinConfig { + if (!coinConfig) { + throw new MissingCoinConfig(); + } + + return coinConfig(); +} diff --git a/libs/ledger-live-common/src/families/vechain/constants.ts b/libs/coin-modules/coin-vechain/src/constants.ts similarity index 100% rename from libs/ledger-live-common/src/families/vechain/constants.ts rename to libs/coin-modules/coin-vechain/src/constants.ts diff --git a/libs/ledger-live-common/src/families/vechain/contracts/abis/VIP180.ts b/libs/coin-modules/coin-vechain/src/contracts/abis/VIP180.ts similarity index 100% rename from libs/ledger-live-common/src/families/vechain/contracts/abis/VIP180.ts rename to libs/coin-modules/coin-vechain/src/contracts/abis/VIP180.ts diff --git a/libs/ledger-live-common/src/families/vechain/contracts/abis/params.ts b/libs/coin-modules/coin-vechain/src/contracts/abis/params.ts similarity index 100% rename from libs/ledger-live-common/src/families/vechain/contracts/abis/params.ts rename to libs/coin-modules/coin-vechain/src/contracts/abis/params.ts diff --git a/libs/ledger-live-common/src/families/vechain/contracts/constants.ts b/libs/coin-modules/coin-vechain/src/contracts/constants.ts similarity index 100% rename from libs/ledger-live-common/src/families/vechain/contracts/constants.ts rename to libs/coin-modules/coin-vechain/src/contracts/constants.ts diff --git a/libs/ledger-live-common/src/families/vechain/createTransaction.ts b/libs/coin-modules/coin-vechain/src/createTransaction.ts similarity index 100% rename from libs/ledger-live-common/src/families/vechain/createTransaction.ts rename to libs/coin-modules/coin-vechain/src/createTransaction.ts diff --git a/libs/ledger-live-common/src/families/vechain/datasets/vechain.scanAccounts.1.ts b/libs/coin-modules/coin-vechain/src/datasets/vechain.scanAccounts.1.ts similarity index 100% rename from libs/ledger-live-common/src/families/vechain/datasets/vechain.scanAccounts.1.ts rename to libs/coin-modules/coin-vechain/src/datasets/vechain.scanAccounts.1.ts diff --git a/libs/ledger-live-common/src/families/vechain/datasets/vechain.ts b/libs/coin-modules/coin-vechain/src/datasets/vechain.ts similarity index 100% rename from libs/ledger-live-common/src/families/vechain/datasets/vechain.ts rename to libs/coin-modules/coin-vechain/src/datasets/vechain.ts diff --git a/libs/ledger-live-common/src/families/vechain/errors.ts b/libs/coin-modules/coin-vechain/src/errors.ts similarity index 100% rename from libs/ledger-live-common/src/families/vechain/errors.ts rename to libs/coin-modules/coin-vechain/src/errors.ts diff --git a/libs/ledger-live-common/src/families/vechain/estimateMaxSpendable.ts b/libs/coin-modules/coin-vechain/src/estimateMaxSpendable.ts similarity index 100% rename from libs/ledger-live-common/src/families/vechain/estimateMaxSpendable.ts rename to libs/coin-modules/coin-vechain/src/estimateMaxSpendable.ts diff --git a/libs/ledger-live-common/src/families/vechain/getTransactionStatus.ts b/libs/coin-modules/coin-vechain/src/getTransactionStatus.ts similarity index 100% rename from libs/ledger-live-common/src/families/vechain/getTransactionStatus.ts rename to libs/coin-modules/coin-vechain/src/getTransactionStatus.ts diff --git a/libs/ledger-live-common/src/families/vechain/hw-getAddress.ts b/libs/coin-modules/coin-vechain/src/hw-getAddress.ts similarity index 100% rename from libs/ledger-live-common/src/families/vechain/hw-getAddress.ts rename to libs/coin-modules/coin-vechain/src/hw-getAddress.ts diff --git a/libs/ledger-live-common/src/families/vechain/hw-signMessage.ts b/libs/coin-modules/coin-vechain/src/hw-signMessage.ts similarity index 100% rename from libs/ledger-live-common/src/families/vechain/hw-signMessage.ts rename to libs/coin-modules/coin-vechain/src/hw-signMessage.ts diff --git a/libs/coin-modules/coin-vechain/src/logic.ts b/libs/coin-modules/coin-vechain/src/logic.ts new file mode 100644 index 000000000000..4326ca2972d5 --- /dev/null +++ b/libs/coin-modules/coin-vechain/src/logic.ts @@ -0,0 +1,44 @@ +import BigNumber from "bignumber.js"; +import { Transaction as VeChainThorTransaction } from "thor-devkit"; +import { VTHO_ADDRESS } from "./contracts/constants"; +import VIP180 from "./contracts/abis/VIP180"; +import { HEX_PREFIX } from "./constants"; + +export const calculateClausesVtho = async ( + recipient: string, + amount: BigNumber, +): Promise => { + const clauses: VeChainThorTransaction.Clause[] = []; + + // Get the existing clause or create a blank one + const updatedClause: VeChainThorTransaction.Clause = { + to: VTHO_ADDRESS, + value: 0, + data: "0x", + }; + updatedClause.data = VIP180.transfer.encode(recipient, amount.toFixed()); + + clauses.push(updatedClause); + return clauses; +}; + +export const calculateClausesVet = async ( + recipient: string, + amount: BigNumber, +): Promise => { + const clauses: VeChainThorTransaction.Clause[] = []; + + // Get the existing clause or create a blank one + const updatedClause: VeChainThorTransaction.Clause = { + to: null, + value: 0, + data: "0x", + }; + + updatedClause.value = `${HEX_PREFIX}${amount.toString(16)}`; + updatedClause.to = recipient; + + clauses.push(updatedClause); + + return clauses; +}; diff --git a/libs/ledger-live-common/src/families/vechain/mock.ts b/libs/coin-modules/coin-vechain/src/mock.ts similarity index 100% rename from libs/ledger-live-common/src/families/vechain/mock.ts rename to libs/coin-modules/coin-vechain/src/mock.ts diff --git a/libs/ledger-live-common/src/families/vechain/prepareTransaction.ts b/libs/coin-modules/coin-vechain/src/prepareTransaction.ts similarity index 100% rename from libs/ledger-live-common/src/families/vechain/prepareTransaction.ts rename to libs/coin-modules/coin-vechain/src/prepareTransaction.ts diff --git a/libs/ledger-live-common/src/families/vechain/signOperation.ts b/libs/coin-modules/coin-vechain/src/signOperation.ts similarity index 100% rename from libs/ledger-live-common/src/families/vechain/signOperation.ts rename to libs/coin-modules/coin-vechain/src/signOperation.ts diff --git a/libs/ledger-live-common/src/families/vechain/specs.ts b/libs/coin-modules/coin-vechain/src/specs.ts similarity index 94% rename from libs/ledger-live-common/src/families/vechain/specs.ts rename to libs/coin-modules/coin-vechain/src/specs.ts index 754bacb53101..32b665f7ef88 100644 --- a/libs/ledger-live-common/src/families/vechain/specs.ts +++ b/libs/coin-modules/coin-vechain/src/specs.ts @@ -5,13 +5,15 @@ import type { TransactionArg, TransactionRes, TransactionTestInput, -} from "../../bot/types"; + SpeculosTransport, +} from "@ledgerhq/coin-framework/bot/types"; import type { Transaction } from "./types"; -import { pickSiblings, botTest, SpeculosButton } from "../../bot/specs"; +import { pickSiblings, botTest, SpeculosButton } from "@ledgerhq/coin-framework/bot/specs"; import { DeviceModelId } from "@ledgerhq/devices"; import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies"; -import deviceAction from "../vechain/speculos-deviceActions"; + import BigNumber from "bignumber.js"; +import speculosDeviceActions from "./speculos-deviceActions"; const MIN_VET_TRANSACTION_AMOUNT = 1000000000000000000; const MAX_VTHO_FEE_FOR_VTHO_TRANSACTION = 1040000000000000000; @@ -26,8 +28,8 @@ const vechainTest = { }, allowEmptyAccounts: true, testTimeout: 60 * 1000, // 1 minute - genericDeviceAction: deviceAction.acceptTransaction, - onSpeculosDeviceCreated: async ({ transport }) => { + genericDeviceAction: speculosDeviceActions.acceptTransaction, + onSpeculosDeviceCreated: async ({ transport }: { transport: SpeculosTransport }) => { // enable contract data await transport.button(SpeculosButton.RIGHT); await transport.button(SpeculosButton.BOTH); diff --git a/libs/ledger-live-common/src/families/vechain/speculos-deviceActions.ts b/libs/coin-modules/coin-vechain/src/speculos-deviceActions.ts similarity index 75% rename from libs/ledger-live-common/src/families/vechain/speculos-deviceActions.ts rename to libs/coin-modules/coin-vechain/src/speculos-deviceActions.ts index 6edac20389e2..93b2040039f3 100644 --- a/libs/ledger-live-common/src/families/vechain/speculos-deviceActions.ts +++ b/libs/coin-modules/coin-vechain/src/speculos-deviceActions.ts @@ -1,6 +1,6 @@ -import type { DeviceAction } from "../../bot/types"; +import { SpeculosButton, deviceActionFlow } from "@ledgerhq/coin-framework/lib/bot/specs"; import type { Transaction } from "./types"; -import { deviceActionFlow, SpeculosButton } from "../../bot/specs"; +import { DeviceAction } from "@ledgerhq/coin-framework/lib/bot/types"; const acceptTransaction: DeviceAction = deviceActionFlow({ steps: [ diff --git a/libs/ledger-live-common/src/families/vechain/synchronisation.ts b/libs/coin-modules/coin-vechain/src/synchronisation.ts similarity index 90% rename from libs/ledger-live-common/src/families/vechain/synchronisation.ts rename to libs/coin-modules/coin-vechain/src/synchronisation.ts index e5a4f052e313..97ff12e66e22 100644 --- a/libs/ledger-live-common/src/families/vechain/synchronisation.ts +++ b/libs/coin-modules/coin-vechain/src/synchronisation.ts @@ -1,6 +1,5 @@ -import type { GetAccountShape } from "../../bridge/jsHelpers"; import { BigNumber } from "bignumber.js"; -import { makeSync, makeScanAccounts, mergeOps } from "../../bridge/jsHelpers"; + import eip55 from "eip55"; import { emptyHistoryCache, @@ -11,8 +10,10 @@ import { import { getAccount, getLastBlockHeight, getOperations, getTokenOperations } from "./api"; import { findTokenById, getTokenById } from "@ledgerhq/cryptoassets/tokens"; import { VTHO_ADDRESS } from "./contracts/constants"; +import { GetAccountShape, mergeOps } from "@ledgerhq/coin-framework/lib/bridge/jsHelpers"; +import { Account } from "@ledgerhq/types-live"; -const getAccountShape: GetAccountShape = async info => { +export const getAccountShape: GetAccountShape = async info => { const { initialAccount, currency, derivationMode } = info; const address = eip55.encode(info.address); @@ -83,6 +84,3 @@ const getAccountShape: GetAccountShape = async info => { return shape; }; - -export const scanAccounts = makeScanAccounts({ getAccountShape }); -export const sync = makeSync({ getAccountShape }); diff --git a/libs/ledger-live-common/src/families/vechain/transaction.ts b/libs/coin-modules/coin-vechain/src/transaction.ts similarity index 91% rename from libs/ledger-live-common/src/families/vechain/transaction.ts rename to libs/coin-modules/coin-vechain/src/transaction.ts index 834fa18c142b..e16ba244b133 100644 --- a/libs/ledger-live-common/src/families/vechain/transaction.ts +++ b/libs/coin-modules/coin-vechain/src/transaction.ts @@ -1,5 +1,7 @@ +import { getAccountCurrency } from "@ledgerhq/coin-framework/lib/account/index"; import type { Transaction, TransactionRaw, TransactionStatus, TransactionStatusRaw } from "./types"; import { formatTransactionStatus } from "@ledgerhq/coin-framework/formatters"; +import { formatCurrencyUnit } from "@ledgerhq/coin-framework/lib/currencies/index"; import { fromTransactionCommonRaw, fromTransactionStatusRawCommon, @@ -7,8 +9,6 @@ import { toTransactionStatusRawCommon, } from "@ledgerhq/coin-framework/serialization"; import type { Account } from "@ledgerhq/types-live"; -import { getAccountCurrency } from "../../account"; -import { formatCurrencyUnit } from "../../currencies"; export const formatTransaction = (t: Transaction, account: Account): string => { const { amount, recipient, useAllAmount } = t; diff --git a/libs/coin-modules/coin-vechain/src/types.ts b/libs/coin-modules/coin-vechain/src/types.ts new file mode 100644 index 000000000000..f225426a9c9c --- /dev/null +++ b/libs/coin-modules/coin-vechain/src/types.ts @@ -0,0 +1,35 @@ +import type { + TokenAccount, + TransactionCommon, + TransactionCommonRaw, + TransactionStatusCommon, + TransactionStatusCommonRaw, +} from "@ledgerhq/types-live"; +import BigNumber from "bignumber.js"; +import { Transaction as ThorTransaction } from "thor-devkit"; + +export type Transaction = TransactionCommon & { + family: "vechain"; + estimatedFees: string; + body: ThorTransaction.Body; +}; + +export type TransactionRaw = TransactionCommonRaw & { + family: "vechain"; + estimatedFees: string; + body: ThorTransaction.Body; +}; + +export type TransactionStatus = TransactionStatusCommon; + +export type TransactionStatusRaw = TransactionStatusCommonRaw; + +export type TransactionInfo = { + isTokenAccount: boolean; + amount: BigNumber; + balance: BigNumber; + spendableBalance: BigNumber; + tokenAccount?: TokenAccount; + estimatedFees: string; + estimatedGas: number; +}; diff --git a/libs/ledger-live-common/src/families/vechain/utils/address-utils.ts b/libs/coin-modules/coin-vechain/src/utils/address-utils.ts similarity index 100% rename from libs/ledger-live-common/src/families/vechain/utils/address-utils.ts rename to libs/coin-modules/coin-vechain/src/utils/address-utils.ts diff --git a/libs/ledger-live-common/src/families/vechain/utils/hex-utils.ts b/libs/coin-modules/coin-vechain/src/utils/hex-utils.ts similarity index 100% rename from libs/ledger-live-common/src/families/vechain/utils/hex-utils.ts rename to libs/coin-modules/coin-vechain/src/utils/hex-utils.ts diff --git a/libs/ledger-live-common/src/families/vechain/utils/mapping-utils.ts b/libs/coin-modules/coin-vechain/src/utils/mapping-utils.ts similarity index 100% rename from libs/ledger-live-common/src/families/vechain/utils/mapping-utils.ts rename to libs/coin-modules/coin-vechain/src/utils/mapping-utils.ts diff --git a/libs/ledger-live-common/src/families/vechain/utils/pad-address.ts b/libs/coin-modules/coin-vechain/src/utils/pad-address.ts similarity index 100% rename from libs/ledger-live-common/src/families/vechain/utils/pad-address.ts rename to libs/coin-modules/coin-vechain/src/utils/pad-address.ts diff --git a/libs/ledger-live-common/src/families/vechain/utils/transaction-utils.ts b/libs/coin-modules/coin-vechain/src/utils/transaction-utils.ts similarity index 100% rename from libs/ledger-live-common/src/families/vechain/utils/transaction-utils.ts rename to libs/coin-modules/coin-vechain/src/utils/transaction-utils.ts diff --git a/libs/coin-modules/coin-vechain/tsconfig.json b/libs/coin-modules/coin-vechain/tsconfig.json new file mode 100644 index 000000000000..f56b01ccd35e --- /dev/null +++ b/libs/coin-modules/coin-vechain/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../../../tsconfig.base", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "module": "commonjs", + "downlevelIteration": true, + "lib": ["es2020", "dom"], + "outDir": "lib", + "exactOptionalPropertyTypes": true + }, + "include": ["src/**/*"] +} diff --git a/libs/ledger-live-common/package.json b/libs/ledger-live-common/package.json index dbaee903bbd1..db460c143845 100644 --- a/libs/ledger-live-common/package.json +++ b/libs/ledger-live-common/package.json @@ -148,6 +148,7 @@ "@ledgerhq/coin-tezos": "workspace:^", "@ledgerhq/coin-ton": "workspace:^", "@ledgerhq/coin-tron": "workspace:^", + "@ledgerhq/coin-vechain": "workspace:^", "@ledgerhq/coin-xrp": "workspace:^", "@ledgerhq/crypto-icons-ui": "workspace:^", "@ledgerhq/cryptoassets": "workspace:^", @@ -237,7 +238,6 @@ "semver": "^7.3.5", "sha.js": "^2.4.11", "simple-cbor": "^0.4.1", - "thor-devkit": "^2.0.6", "triple-beam": "^1.3.0", "tsx": "^4.7.1", "usehooks-ts": "^2.13.0", diff --git a/libs/ledger-live-common/src/families/vechain/bridge.integration.test.ts b/libs/ledger-live-common/src/families/vechain/bridge.integration.test.ts index 45ad5d724549..eef303a2c138 100644 --- a/libs/ledger-live-common/src/families/vechain/bridge.integration.test.ts +++ b/libs/ledger-live-common/src/families/vechain/bridge.integration.test.ts @@ -1,258 +1,5 @@ import "../../__tests__/test-helpers/setup"; import { testBridge } from "../../__tests__/test-helpers/bridge"; -import type { AccountRaw, DatasetTest } from "@ledgerhq/types-live"; -import type { Transaction } from "./types"; -import { fromTransactionRaw } from "./transaction"; -import { DEFAULT_GAS_COEFFICIENT, MAINNET_CHAIN_TAG } from "./constants"; -import { vechain1, vechain3 } from "./datasets/vechain"; -import { generateNonce } from "./utils/transaction-utils"; -import BigNumber from "bignumber.js"; -import { - setSupportedCurrencies, - listSupportedCurrencies, - getCryptoCurrencyById, -} from "../../currencies"; -import vechainScanAccounts1 from "./datasets/vechain.scanAccounts.1"; -import { AmountRequired, NotEnoughBalance } from "@ledgerhq/errors"; -import VIP180 from "./contracts/abis/VIP180"; -import { CryptoCurrencyId } from "@ledgerhq/types-cryptoassets"; -import { NotEnoughVTHO } from "./errors"; - -const listSupported = listSupportedCurrencies(); -listSupported.push(getCryptoCurrencyById("vechain")); -setSupportedCurrencies(listSupported.map(c => c.id) as CryptoCurrencyId[]); - -const dataset: DatasetTest = { - implementations: ["js", "mock"], - currencies: { - vechain: { - FIXME_ignoreAccountFields: ["balance", "spendableBalance", "estimateMaxSpendable"], // the balance depends on VTHO and it's earned without operations - scanAccounts: vechainScanAccounts1, - - accounts: [ - { - raw: vechain1 as AccountRaw, - transactions: [ - { - name: "Send VET", - transaction: fromTransactionRaw({ - family: "vechain", - estimatedFees: "210000000000000000", - recipient: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", - amount: "1000000000000000000", - body: { - chainTag: MAINNET_CHAIN_TAG, - blockRef: "0x00634a0c856ec1db", - expiration: 18, - clauses: [ - { - to: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", - value: "1000000000000000000", - data: "0x", - }, - ], - gasPriceCoef: DEFAULT_GAS_COEFFICIENT, - gas: "0", - dependsOn: null, - nonce: generateNonce(), - }, - }), - expectedStatus: { - amount: new BigNumber("1000000000000000000"), - estimatedFees: new BigNumber("210000000000000000"), - totalSpent: new BigNumber("1000000000000000000"), - errors: {}, - warnings: {}, - }, - }, - { - name: "Send VTHO", - transaction: fromTransactionRaw({ - family: "vechain", - subAccountId: - "js:2:vechain:0x0fe6688548f0C303932bB197B0A96034f1d74dba:vechain+vechain%2Fvip180%2Fvtho", - estimatedFees: "515180000000000000", - recipient: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", - amount: "1000000000000000000", - body: { - chainTag: MAINNET_CHAIN_TAG, - blockRef: "0x00634a0c856ec1db", - expiration: 18, - clauses: [ - { - to: "0x0000000000000000000000000000456e65726779", - value: 0, - data: VIP180.transfer.encode( - "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", - "9000000000000000000", - ), - }, - ], - gasPriceCoef: DEFAULT_GAS_COEFFICIENT, - gas: "0", - dependsOn: null, - nonce: generateNonce(), - }, - }), - expectedStatus: { - amount: new BigNumber("1000000000000000000"), - estimatedFees: new BigNumber("515180000000000000"), - totalSpent: new BigNumber("1515180000000000000"), - errors: {}, - warnings: {}, - }, - }, - { - name: "Amount required", - transaction: fromTransactionRaw({ - family: "vechain", - estimatedFees: "0", - recipient: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", - amount: "", - body: { - chainTag: MAINNET_CHAIN_TAG, - blockRef: "0x00634a0c856ec1db", - expiration: 18, - clauses: [{ to: "", value: 0, data: "0x" }], - gasPriceCoef: DEFAULT_GAS_COEFFICIENT, - gas: "0", - dependsOn: null, - nonce: generateNonce(), - }, - }), - expectedStatus: { - errors: { - amount: new AmountRequired(), - }, - warnings: {}, - }, - }, - { - name: "VET balance not enough", - transaction: fromTransactionRaw({ - family: "vechain", - estimatedFees: "210000000000000000", - recipient: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", - amount: "20000000000000000000", - body: { - chainTag: MAINNET_CHAIN_TAG, - blockRef: "0x00634a0c856ec1db", - expiration: 18, - clauses: [ - { - to: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", - value: "20000000000000000000", - data: "0x", - }, - ], - gasPriceCoef: DEFAULT_GAS_COEFFICIENT, - gas: "0", - dependsOn: null, - nonce: generateNonce(), - }, - }), - expectedStatus: { - amount: new BigNumber("20000000000000000000"), - errors: { - amount: new NotEnoughBalance(), - }, - warnings: {}, - totalSpent: new BigNumber("20000000000000000000"), - estimatedFees: new BigNumber("210000000000000000"), - }, - }, - { - name: "VTHO balance not enough", - transaction: fromTransactionRaw({ - family: "vechain", - subAccountId: - "js:2:vechain:0x0fe6688548f0C303932bB197B0A96034f1d74dba:vechain+vechain%2Fvip180%2Fvtho", - estimatedFees: "515820000000000000", - recipient: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", - amount: "20000000000000000000", - body: { - chainTag: MAINNET_CHAIN_TAG, - blockRef: "0x00634a0c856ec1db", - expiration: 18, - clauses: [ - { - to: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", - value: "20000000000000000000", - data: "0x", - }, - ], - gasPriceCoef: DEFAULT_GAS_COEFFICIENT, - gas: "0", - dependsOn: null, - nonce: generateNonce(), - }, - }), - expectedStatus: { - amount: new BigNumber("20000000000000000000"), - errors: { - amount: new NotEnoughBalance(), - }, - warnings: {}, - totalSpent: new BigNumber("20515820000000000000"), - estimatedFees: new BigNumber("515820000000000000"), - }, - }, - ], - FIXME_tests: [ - "balance is sum of ops", // the balance depends on VTHO and it's earned without operations - "empty transaction is equals to itself", //nonce is not deterministic - "ref stability on self transaction", //blockref is not deterministic - "can be run in parallel and all yield same results", //blockref is not deterministic - ], - }, - { - raw: vechain3 as AccountRaw, - transactions: [ - { - name: "Not enough VTHO to pay fees", - transaction: fromTransactionRaw({ - family: "vechain", - estimatedFees: "210000000000000000", - recipient: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", - amount: "1000000000000000000", - body: { - chainTag: MAINNET_CHAIN_TAG, - blockRef: "0x00634a0c856ec1db", - expiration: 18, - clauses: [ - { - to: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", - value: "1000000000000000000", - data: "0x", - }, - ], - gasPriceCoef: DEFAULT_GAS_COEFFICIENT, - gas: "0", - dependsOn: null, - nonce: generateNonce(), - }, - }), - expectedStatus: { - amount: new BigNumber("1000000000000000000"), - estimatedFees: new BigNumber("210000000000000000"), - totalSpent: new BigNumber("1000000000000000000"), - errors: { - amount: new NotEnoughVTHO(), - }, - warnings: {}, - }, - }, - ], - FIXME_tests: [ - "balance is sum of ops", // the balance depends on VTHO and it's earned without operations - "empty transaction is equals to itself", //nonce is not deterministic - "ref stability on self transaction", //blockref is not deterministic - "can be run in parallel and all yield same results", //blockref is not deterministic - ], - }, - ], - }, - }, -}; +import { dataset } from "@ledgerhq/coin-vechain/bridge.integration.test"; testBridge(dataset); diff --git a/package.json b/package.json index 21b28351c2f6..cf957c83235e 100644 --- a/package.json +++ b/package.json @@ -84,6 +84,7 @@ "coin:stellar": "pnpm --filter coin-stellar", "coin:tezos": "pnpm --filter coin-tezos", "coin:tron": "pnpm --filter coin-tron", + "coin:vechain": "pnpm --filter coin-vechain", "coin:xrp": "pnpm --filter coin-xrp", "evm-tools": "pnpm --filter evm-tools", "domain": "pnpm --filter domain-service", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6a004d5f83a7..8fd71e7239ad 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3224,6 +3224,139 @@ importers: specifier: ^5.4.5 version: 5.6.3 + libs/coin-modules/coin-vechain: + dependencies: + '@ethersproject/shims': + specifier: ^5.7.0 + version: 5.7.0 + '@ledgerhq/coin-framework': + specifier: workspace:^ + version: link:../../coin-framework + '@ledgerhq/cryptoassets': + specifier: workspace:^ + version: link:../../ledgerjs/packages/cryptoassets + '@ledgerhq/devices': + specifier: workspace:* + version: link:../../ledgerjs/packages/devices + '@ledgerhq/domain-service': + specifier: workspace:^ + version: link:../../domain-service + '@ledgerhq/errors': + specifier: workspace:^ + version: link:../../ledgerjs/packages/errors + '@ledgerhq/evm-tools': + specifier: workspace:^ + version: link:../../evm-tools + '@ledgerhq/live-config': + specifier: ^3.0.0 + version: 3.0.0 + '@ledgerhq/live-env': + specifier: workspace:^ + version: link:../../env + '@ledgerhq/live-network': + specifier: workspace:^ + version: link:../../live-network + '@ledgerhq/live-promise': + specifier: workspace:^ + version: link:../../promise + '@ledgerhq/logs': + specifier: workspace:^ + version: link:../../ledgerjs/packages/logs + axios: + specifier: 0.26.1 + version: 0.26.1 + bignumber.js: + specifier: ^9.1.2 + version: 9.1.2 + eip55: + specifier: ^2.1.1 + version: 2.1.1 + ethers: + specifier: 5.7.2 + version: 5.7.2 + expect: + specifier: ^27.4.6 + version: 27.5.1 + imurmurhash: + specifier: ^0.1.4 + version: 0.1.4 + invariant: + specifier: ^2.2.2 + version: 2.2.4 + lodash: + specifier: ^4.17.21 + version: 4.17.21 + react-native-get-random-values: + specifier: ^1.8.0 + version: 1.11.0 + rxjs: + specifier: ^7.8.1 + version: 7.8.1 + thor-devkit: + specifier: ^2.0.6 + version: 2.0.9 + devDependencies: + '@ledgerhq/coin-tester': + specifier: workspace:^ + version: link:../../coin-tester + '@ledgerhq/hw-app-eth': + specifier: workspace:^ + version: link:../../ledgerjs/packages/hw-app-eth + '@ledgerhq/types-cryptoassets': + specifier: workspace:^ + version: link:../../ledgerjs/packages/types-cryptoassets + '@ledgerhq/types-live': + specifier: workspace:^ + version: link:../../ledgerjs/packages/types-live + '@types/bluebird': + specifier: ^3.5.42 + version: 3.5.42 + '@types/imurmurhash': + specifier: ^0.1.4 + version: 0.1.4 + '@types/invariant': + specifier: ^2.2.2 + version: 2.2.37 + '@types/jest': + specifier: ^29.5.10 + version: 29.5.12 + '@types/lodash': + specifier: ^4.14.191 + version: 4.17.4 + bluebird: + specifier: ^3.7.2 + version: 3.7.2 + chalk: + specifier: ^4.1.2 + version: 4.1.2 + docker-compose: + specifier: ^0.24.2 + version: 0.24.8 + dotenv: + specifier: ^16.4.5 + version: 16.4.5 + eslint-plugin-import: + specifier: ^2.28.1 + version: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.3))(eslint@8.57.0) + fast-check: + specifier: ^3.12.0 + version: 3.17.1 + jest: + specifier: ^29.7.0 + version: 29.7.0 + jest-expect-message: + specifier: ^1.1.3 + version: 1.1.3 + msw: + specifier: ^2.2.12 + version: 2.3.4(typescript@5.4.3) + prando: + specifier: ^6.0.1 + version: 6.0.1 + ts-jest: + specifier: ^29.1.1 + version: 29.1.4(jest@29.7.0)(typescript@5.4.3) + libs/coin-modules/coin-xrp: dependencies: '@ledgerhq/coin-framework': @@ -3774,6 +3907,9 @@ importers: '@ledgerhq/coin-tron': specifier: workspace:^ version: link:../coin-modules/coin-tron + '@ledgerhq/coin-vechain': + specifier: workspace:^ + version: link:../coin-modules/coin-vechain '@ledgerhq/coin-xrp': specifier: workspace:^ version: link:../coin-modules/coin-xrp @@ -4041,9 +4177,6 @@ importers: simple-cbor: specifier: ^0.4.1 version: 0.4.1 - thor-devkit: - specifier: ^2.0.6 - version: 2.0.9 triple-beam: specifier: ^1.3.0 version: 1.4.1 @@ -10915,6 +11048,9 @@ packages: '@ledgerhq/live-app-sdk@0.8.2': resolution: {integrity: sha512-yD+L02pAwTfjeSyixWkfqlh6Xg3yAGFnFitrcHk2WWUtKg1TVmNpWNHLS22LKYYWJ7Lflj/pLLQ0nKm1OsJB9g==} + '@ledgerhq/live-config@3.0.0': + resolution: {integrity: sha512-iisns2TFXHLPAYAgpXF/wggvcSscPaxZnMgixRsZho35tL0Dap4hhIT/35f3VuYS/dKDmahTrNjJzeIYEDJ7/Q==} + '@ledgerhq/logs@5.50.0': resolution: {integrity: sha512-swKHYCOZUGyVt4ge0u8a7AwNcA//h4nx5wIi0sruGye1IJ5Cva0GyK9L2/WdX+kWVTKp92ZiEo1df31lrWGPgA==} @@ -16520,6 +16656,9 @@ packages: axios@0.24.0: resolution: {integrity: sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==} + axios@0.26.1: + resolution: {integrity: sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==} + axios@1.7.7: resolution: {integrity: sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==} @@ -36114,6 +36253,10 @@ snapshots: bignumber.js: 9.1.2 json-rpc-2.0: 1.7.0 + '@ledgerhq/live-config@3.0.0': + dependencies: + lodash: 4.17.21 + '@ledgerhq/logs@5.50.0': {} '@ledgerhq/logs@6.12.0': {} @@ -45169,6 +45312,10 @@ snapshots: dependencies: follow-redirects: 1.15.6 + axios@0.26.1: + dependencies: + follow-redirects: 1.15.6 + axios@1.7.7: dependencies: follow-redirects: 1.15.6 From 5bd336a8bbf866f95734097f301399939f274fcf Mon Sep 17 00:00:00 2001 From: Anthony Goussot Date: Thu, 8 Aug 2024 12:36:45 +0200 Subject: [PATCH 02/20] feat(bridge.integration): Typecast --- .../coin-vechain/src/bridge.integration.test.ts | 4 +++- .../src/families/vechain/bridge.integration.test.ts | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/libs/coin-modules/coin-vechain/src/bridge.integration.test.ts b/libs/coin-modules/coin-vechain/src/bridge.integration.test.ts index 99bc24386ebb..8cbfe32b06a2 100644 --- a/libs/coin-modules/coin-vechain/src/bridge.integration.test.ts +++ b/libs/coin-modules/coin-vechain/src/bridge.integration.test.ts @@ -21,7 +21,7 @@ const listSupported = listSupportedCurrencies(); listSupported.push(getCryptoCurrencyById("vechain")); setSupportedCurrencies(listSupported.map(c => c.id) as CryptoCurrencyId[]); -export const dataset: DatasetTest = { +const dataset: DatasetTest = { implementations: ["js", "mock"], currencies: { vechain: { @@ -257,3 +257,5 @@ export const dataset: DatasetTest = { describe("VeChain Bridge", () => { test.todo("sample test"); }); + +export default dataset; diff --git a/libs/ledger-live-common/src/families/vechain/bridge.integration.test.ts b/libs/ledger-live-common/src/families/vechain/bridge.integration.test.ts index eef303a2c138..a3ce302fb289 100644 --- a/libs/ledger-live-common/src/families/vechain/bridge.integration.test.ts +++ b/libs/ledger-live-common/src/families/vechain/bridge.integration.test.ts @@ -1,5 +1,7 @@ import "../../__tests__/test-helpers/setup"; import { testBridge } from "../../__tests__/test-helpers/bridge"; -import { dataset } from "@ledgerhq/coin-vechain/bridge.integration.test"; +import dataset from "@ledgerhq/coin-vechain/bridge.integration.test"; +import { DatasetTest } from "@ledgerhq/types-live"; +import { Transaction } from "@ledgerhq/coin-vechain/lib/types"; -testBridge(dataset); +testBridge(dataset as DatasetTest); // TODO: Remove casting From b34e6d54ae6e86b996216df908e6ccf28d6aec8f Mon Sep 17 00:00:00 2001 From: Anthony Goussot Date: Tue, 3 Sep 2024 15:48:46 +0200 Subject: [PATCH 03/20] feat(coin_module): bridge and signer --- .../coin-vechain/src/bridge/js.ts | 87 +++++++++++++------ libs/coin-modules/coin-vechain/src/signer.ts | 0 2 files changed, 60 insertions(+), 27 deletions(-) create mode 100644 libs/coin-modules/coin-vechain/src/signer.ts diff --git a/libs/coin-modules/coin-vechain/src/bridge/js.ts b/libs/coin-modules/coin-vechain/src/bridge/js.ts index 517caff82686..f498b2399089 100644 --- a/libs/coin-modules/coin-vechain/src/bridge/js.ts +++ b/libs/coin-modules/coin-vechain/src/bridge/js.ts @@ -1,33 +1,66 @@ -import { Account, AccountBridge, CurrencyBridge } from "@ledgerhq/types-live"; -import { defaultUpdateTransaction } from "@ledgerhq/coin-framework/bridge/jsHelpers"; -import { makeAccountBridgeReceive } from "../../../bridge/jsHelpers"; +import { AccountBridge, CurrencyBridge } from "@ledgerhq/types-live"; +import { + defaultUpdateTransaction, + makeAccountBridgeReceive, + makeScanAccounts, +} from "@ledgerhq/coin-framework/bridge/jsHelpers"; +import { SignerContext } from "@ledgerhq/coin-framework/signer"; +import getAddressWrapper from "@ledgerhq/coin-framework/lib/bridge/getAddressWrapper"; import { getTransactionStatus } from "../getTransactionStatus"; -import type { Transaction, TransactionStatus } from "../types"; import { estimateMaxSpendable } from "../estimateMaxSpendable"; import { prepareTransaction } from "../prepareTransaction"; import { createTransaction } from "../createTransaction"; -import { sync, scanAccounts } from "../synchronisation"; -import { signOperation } from "../signOperation"; +import { getAccountShape, sync } from "../synchronisation"; +import { buildSignOperation } from "../signOperation"; import { broadcast } from "../broadcast"; +import resolver from "../hw-getAddress"; +import { setCoinConfig, VeChainCoinConfig } from "../config"; +import type { Transaction } from "../types"; -const receive: AccountBridge["receive"] = makeAccountBridgeReceive(); - -const currencyBridge: CurrencyBridge = { - scanAccounts, - preload: async () => Promise.resolve({}), - hydrate: (): void => {}, -}; - -const accountBridge: AccountBridge = { - estimateMaxSpendable, - createTransaction, - updateTransaction: defaultUpdateTransaction, - getTransactionStatus, - prepareTransaction, - sync, - receive, - signOperation, - broadcast, -}; - -export default { currencyBridge, accountBridge }; +export function buildCurrencyBridge(signerContext: SignerContext): CurrencyBridge { + const getAddress = resolver(signerContext); + + const scanAccounts = makeScanAccounts({ + getAccountShape, + getAddressFn: getAddress, + }); + + return { + preload: async () => Promise.resolve({}), + hydrate: () => {}, + scanAccounts, + }; +} + +export function buildAccountBridge( + signerContext: SignerContext, +): AccountBridge { + const getAddress = resolver(signerContext); + + const receive = makeAccountBridgeReceive(getAddressWrapper(getAddress)); + const signOperation = buildSignOperation(signerContext); + + return { + estimateMaxSpendable, + createTransaction, + updateTransaction: defaultUpdateTransaction, + getTransactionStatus, + prepareTransaction, + sync, + receive, + signOperation, + broadcast, + }; +} + +export function createBridges( + signerContext: SignerContext, + coinConfig: VeChainCoinConfig, +) { + setCoinConfig(coinConfig); + + return { + currencyBridge: buildCurrencyBridge(signerContext), + accountBridge: buildAccountBridge(signerContext), + }; +} diff --git a/libs/coin-modules/coin-vechain/src/signer.ts b/libs/coin-modules/coin-vechain/src/signer.ts new file mode 100644 index 000000000000..e69de29bb2d1 From d16094f46d7794f14b85b7d12e47ebc0a7996516 Mon Sep 17 00:00:00 2001 From: Anthony Goussot Date: Mon, 9 Sep 2024 16:06:47 +0200 Subject: [PATCH 04/20] feat(coin_module): clitools and llc adaptations --- libs/coin-modules/coin-vechain/package.json | 2 +- .../coin-vechain/src/bridge/js.ts | 6 +- .../coin-vechain/src/bridge/mock.ts | 137 ------------------ .../coin-vechain/src/cli-transaction.ts | 26 +++- libs/coin-modules/coin-vechain/src/config.ts | 8 +- .../coin-vechain/src/signOperation.ts | 80 +++++----- libs/coin-modules/coin-vechain/src/signer.ts | 10 ++ .../coin-vechain/src/synchronisation.ts | 4 +- libs/ledger-live-common/src/errors.ts | 1 + .../src/families/ton/setup.ts | 4 +- .../src/families/vechain/config.ts | 14 +- .../src/families/vechain/logic.ts | 46 +----- .../src/families/vechain/setup.ts | 33 +++++ .../src/families/vechain/types.ts | 37 +---- pnpm-lock.yaml | 6 +- 15 files changed, 129 insertions(+), 285 deletions(-) delete mode 100644 libs/coin-modules/coin-vechain/src/bridge/mock.ts create mode 100644 libs/ledger-live-common/src/families/vechain/setup.ts diff --git a/libs/coin-modules/coin-vechain/package.json b/libs/coin-modules/coin-vechain/package.json index 9ef062aa73bf..26d74de8295f 100644 --- a/libs/coin-modules/coin-vechain/package.json +++ b/libs/coin-modules/coin-vechain/package.json @@ -64,6 +64,7 @@ "@ledgerhq/domain-service": "workspace:^", "@ledgerhq/errors": "workspace:^", "@ledgerhq/evm-tools": "workspace:^", + "@ledgerhq/hw-app-vet": "workspace:^", "@ledgerhq/live-config": "^3.0.0", "@ledgerhq/live-env": "workspace:^", "@ledgerhq/live-network": "workspace:^", @@ -83,7 +84,6 @@ }, "devDependencies": { "@ledgerhq/coin-tester": "workspace:^", - "@ledgerhq/hw-app-eth": "workspace:^", "@ledgerhq/types-cryptoassets": "workspace:^", "@ledgerhq/types-live": "workspace:^", "@types/bluebird": "^3.5.42", diff --git a/libs/coin-modules/coin-vechain/src/bridge/js.ts b/libs/coin-modules/coin-vechain/src/bridge/js.ts index f498b2399089..42f6a654ef36 100644 --- a/libs/coin-modules/coin-vechain/src/bridge/js.ts +++ b/libs/coin-modules/coin-vechain/src/bridge/js.ts @@ -14,8 +14,10 @@ import { getAccountShape, sync } from "../synchronisation"; import { buildSignOperation } from "../signOperation"; import { broadcast } from "../broadcast"; import resolver from "../hw-getAddress"; -import { setCoinConfig, VeChainCoinConfig } from "../config"; +import { VechainCoinConfig, setCoinConfig } from "../config"; +import { VechainSigner } from "../signer"; import type { Transaction } from "../types"; +import { CurrencyConfig } from "@ledgerhq/coin-framework/lib/config"; export function buildCurrencyBridge(signerContext: SignerContext): CurrencyBridge { const getAddress = resolver(signerContext); @@ -55,7 +57,7 @@ export function buildAccountBridge( export function createBridges( signerContext: SignerContext, - coinConfig: VeChainCoinConfig, + coinConfig: VechainCoinConfig, ) { setCoinConfig(coinConfig); diff --git a/libs/coin-modules/coin-vechain/src/bridge/mock.ts b/libs/coin-modules/coin-vechain/src/bridge/mock.ts deleted file mode 100644 index e3bc22524547..000000000000 --- a/libs/coin-modules/coin-vechain/src/bridge/mock.ts +++ /dev/null @@ -1,137 +0,0 @@ -import { AccountBridge, CurrencyBridge, TokenAccount } from "@ledgerhq/types-live"; -import type { Transaction, TransactionStatus } from "../types"; -import { scanAccounts, signOperation, broadcast, sync } from "../../../bridge/mockHelpers"; -import { makeAccountBridgeReceive } from "../../../bridge/mockHelpers"; -import BigNumber from "bignumber.js"; -import { DEFAULT_GAS_COEFFICIENT, MAINNET_CHAIN_TAG } from "../constants"; -import { calculateTransactionInfo, generateNonce } from "../utils/transaction-utils"; -import { defaultUpdateTransaction } from "@ledgerhq/coin-framework/bridge/jsHelpers"; -import { Account } from "@ledgerhq/types-live"; -import { - AmountRequired, - FeeNotLoaded, - InvalidAddress, - InvalidAddressBecauseDestinationIsAlsoSource, - NotEnoughBalance, - RecipientRequired, -} from "@ledgerhq/errors"; -import { NotEnoughVTHO } from "../errors"; -import { isValid } from "../utils/address-utils"; - -const receive = makeAccountBridgeReceive(); - -const currencyBridge: CurrencyBridge = { - scanAccounts, - preload: async () => Promise.resolve({}), - hydrate: (): void => {}, -}; - -const estimateMaxSpendable = ({ account }) => { - return account.balance; -}; - -const createTransaction = (): Transaction => ({ - amount: new BigNumber(0), - useAllAmount: false, - family: "vechain", - estimatedFees: "0", - recipient: "", - body: { - chainTag: MAINNET_CHAIN_TAG, - blockRef: "", - expiration: 18, - clauses: [], - gasPriceCoef: DEFAULT_GAS_COEFFICIENT, - gas: "0", - dependsOn: null, - nonce: generateNonce(), - }, -}); - -const getTransactionStatus = async ( - account: Account, - transaction: Transaction, -): Promise => { - const { freshAddress, currency, subAccounts } = account; - const { body, recipient, subAccountId } = transaction; - const errors: Record = {}; - const warnings: Record = {}; - - const tokenAccount = - subAccountId && subAccounts - ? (subAccounts.find(subAccount => { - return subAccount.id === subAccountId; - }) as TokenAccount) - : undefined; - const isTokenAccount = !!tokenAccount; - const estimatedFees = new BigNumber(transaction.estimatedFees); - - const { amount, spendableBalance } = await calculateTransactionInfo(account, transaction, { - estimatedGas: body.gas as number, - estimatedGasFees: estimatedFees, - }); - - if (!body?.gas) { - errors.fees = new FeeNotLoaded(); - } - - if (!recipient) { - errors.recipient = new RecipientRequired(); - } else if (freshAddress.toLowerCase() === recipient.toLowerCase()) { - warnings.recipient = new InvalidAddressBecauseDestinationIsAlsoSource(); - } else if (!isValid(recipient)) { - errors.recipient = new InvalidAddress("", { - currencyName: currency.name, - }); - } - - if (!amount.gt(0)) { - if (!transaction.useAllAmount) errors.amount = new AmountRequired(); - else errors.amount = new NotEnoughBalance(); - } else { - if (amount.gt(spendableBalance)) { - errors.amount = new NotEnoughBalance(); - } - if (!isTokenAccount) { - // vet - const vthoBalance = subAccounts?.[0].balance; - if (estimatedFees.gt(vthoBalance || 0)) { - errors.amount = new NotEnoughVTHO(); - } - } - } - - let totalSpent = amount; - if (isTokenAccount) { - totalSpent = amount.plus(estimatedFees); - } - - return Promise.resolve({ - errors, - warnings, - estimatedFees, - amount, - totalSpent, - }); -}; - -export const prepareTransaction = async ( - account: Account, - transaction: Transaction, -): Promise => { - return transaction; -}; - -const accountBridge: AccountBridge = { - estimateMaxSpendable, - createTransaction, - updateTransaction: defaultUpdateTransaction, - getTransactionStatus, - prepareTransaction, - sync, - receive, - signOperation, - broadcast, -}; - -export default { currencyBridge, accountBridge }; diff --git a/libs/coin-modules/coin-vechain/src/cli-transaction.ts b/libs/coin-modules/coin-vechain/src/cli-transaction.ts index 8ec3ef70a62a..e07fa2952129 100644 --- a/libs/coin-modules/coin-vechain/src/cli-transaction.ts +++ b/libs/coin-modules/coin-vechain/src/cli-transaction.ts @@ -5,6 +5,22 @@ import { VTHO_ADDRESS } from "./contracts/constants"; import VIP180 from "./contracts/abis/VIP180"; import { MustBeVechain } from "./errors"; +type CliTools = { + options: Array<{ + name: string; + type: any; + desc: string; + }>; + inferTransactions: ( + transactions: Array<{ + account: AccountLike; + transaction: Transaction; + mainAccount: Account; + }>, + opts: Record, + ) => Transaction[]; +}; + type Clauses = { to: string; data: string; @@ -62,7 +78,9 @@ function inferTransactions( }); } -export default { - options, - inferTransactions, -}; +export default function makeCliTools(): CliTools { + return { + options, + inferTransactions, + }; +} diff --git a/libs/coin-modules/coin-vechain/src/config.ts b/libs/coin-modules/coin-vechain/src/config.ts index 461dc259cf42..4638c56d75ac 100644 --- a/libs/coin-modules/coin-vechain/src/config.ts +++ b/libs/coin-modules/coin-vechain/src/config.ts @@ -1,15 +1,15 @@ import { CurrencyConfig, CoinConfig } from "@ledgerhq/coin-framework/config"; import { MissingCoinConfig } from "@ledgerhq/coin-framework/errors"; -export type VeChainCoinConfig = CurrencyConfig; +export type VechainCoinConfig = () => CurrencyConfig -let coinConfig: CoinConfig | undefined; +let coinConfig: CoinConfig | undefined; -export function setCoinConfig(config: CoinConfig): void { +export function setCoinConfig(config: CoinConfig): void { coinConfig = config; } -export function getCoinConfig(): VeChainCoinConfig { +export function getCoinConfig(): CurrencyConfig { if (!coinConfig) { throw new MissingCoinConfig(); } diff --git a/libs/coin-modules/coin-vechain/src/signOperation.ts b/libs/coin-modules/coin-vechain/src/signOperation.ts index abe9807e9822..444a22f1395d 100644 --- a/libs/coin-modules/coin-vechain/src/signOperation.ts +++ b/libs/coin-modules/coin-vechain/src/signOperation.ts @@ -1,54 +1,54 @@ import { Observable } from "rxjs"; -import Vet from "@ledgerhq/hw-app-vet"; import { Transaction as ThorTransaction } from "thor-devkit"; -import type { AccountBridge } from "@ledgerhq/types-live"; +import type { Account, AccountBridge, DeviceId, SignOperationEvent } from "@ledgerhq/types-live"; +import { SignerContext } from "@ledgerhq/coin-framework/lib/signer"; import { buildOptimisticOperation } from "./buildOptimisticOperatioin"; -import { withDevice } from "../../hw/deviceAccess"; import type { Transaction } from "./types"; +import { VechainSigner, VechainSignature } from "./signer"; /** * Sign Transaction with Ledger hardware */ -export const signOperation: AccountBridge["signOperation"] = ({ - account, - deviceId, - transaction, -}) => - withDevice(deviceId)( - transport => - new Observable(o => { - async function main() { - const unsigned = new ThorTransaction(transaction.body); +export const buildSignOperation = + (signerContext: SignerContext): AccountBridge["signOperation"] => + ({ + account, + transaction, + deviceId, + }: { + account: Account; + transaction: Transaction; + deviceId: DeviceId; + }): Observable => + new Observable(o => { + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + async function main() { + const unsigned = new ThorTransaction(transaction.body); - // Sign on device - const vechainApp = new Vet(transport); - o.next({ - type: "device-signature-requested", - }); - const signature = await vechainApp.signTransaction( - account.freshAddressPath, - unsigned.encode().toString("hex"), - ); + o.next({ + type: "device-signature-requested", + }); - o.next({ type: "device-signature-granted" }); + const signature = (await signerContext(deviceId, signer => + signer.signTransaction(account.freshAddressPath, unsigned.encode().toString("hex")), + )) as VechainSignature; - const operation = await buildOptimisticOperation(account, transaction); + o.next({ type: "device-signature-granted" }); - o.next({ - type: "signed", - signedOperation: { - operation, - signature: signature.toString("hex"), - rawData: transaction, - }, - }); - } + const operation = await buildOptimisticOperation(account, transaction); - main().then( - () => o.complete(), - e => o.error(e), - ); - }), - ); + o.next({ + type: "signed", + signedOperation: { + operation, + signature: signature.toString("hex"), + rawData: transaction, + }, + }); + } -export default signOperation; + main().then( + () => o.complete(), + e => o.error(e), + ); + }); diff --git a/libs/coin-modules/coin-vechain/src/signer.ts b/libs/coin-modules/coin-vechain/src/signer.ts index e69de29bb2d1..878cbf96a0ee 100644 --- a/libs/coin-modules/coin-vechain/src/signer.ts +++ b/libs/coin-modules/coin-vechain/src/signer.ts @@ -0,0 +1,10 @@ +export type VechainAddress = { + publicKey: string; + address: string; + chainCode?: string; +}; +export type VechainSignature = Buffer; +export interface VechainSigner { + getAddress(path: string, boolDisplay?: boolean, chainCode?: boolean): Promise; + signTransaction(path: string, rawTxHex: string): Promise; +} diff --git a/libs/coin-modules/coin-vechain/src/synchronisation.ts b/libs/coin-modules/coin-vechain/src/synchronisation.ts index 97ff12e66e22..3a5219939a82 100644 --- a/libs/coin-modules/coin-vechain/src/synchronisation.ts +++ b/libs/coin-modules/coin-vechain/src/synchronisation.ts @@ -10,7 +10,7 @@ import { import { getAccount, getLastBlockHeight, getOperations, getTokenOperations } from "./api"; import { findTokenById, getTokenById } from "@ledgerhq/cryptoassets/tokens"; import { VTHO_ADDRESS } from "./contracts/constants"; -import { GetAccountShape, mergeOps } from "@ledgerhq/coin-framework/lib/bridge/jsHelpers"; +import { GetAccountShape, makeSync, mergeOps } from "@ledgerhq/coin-framework/lib/bridge/jsHelpers"; import { Account } from "@ledgerhq/types-live"; export const getAccountShape: GetAccountShape = async info => { @@ -84,3 +84,5 @@ export const getAccountShape: GetAccountShape = async info => { return shape; }; + +export const sync = makeSync({ getAccountShape }) \ No newline at end of file diff --git a/libs/ledger-live-common/src/errors.ts b/libs/ledger-live-common/src/errors.ts index 7b2c583fd329..29ad131885f1 100644 --- a/libs/ledger-live-common/src/errors.ts +++ b/libs/ledger-live-common/src/errors.ts @@ -134,3 +134,4 @@ export * from "@ledgerhq/coin-solana/errors"; export * from "@ledgerhq/coin-stacks/errors"; export * from "@ledgerhq/coin-stellar/errors"; export * from "@ledgerhq/coin-tezos/errors"; +export * from "@ledgerhq/coin-vechain/errors"; diff --git a/libs/ledger-live-common/src/families/ton/setup.ts b/libs/ledger-live-common/src/families/ton/setup.ts index 2527d74f8196..bb45474ea947 100644 --- a/libs/ledger-live-common/src/families/ton/setup.ts +++ b/libs/ledger-live-common/src/families/ton/setup.ts @@ -2,7 +2,7 @@ import { createBridges } from "@ledgerhq/coin-ton/bridge/js"; import makeCliTools from "@ledgerhq/coin-ton/cli-transaction"; -import nearResolver from "@ledgerhq/coin-ton/hw-getAddress"; +import tonResolver from "@ledgerhq/coin-ton/hw-getAddress"; import { signMessage } from "@ledgerhq/coin-ton/hw-signMessage"; import { TonCoinConfig } from "@ledgerhq/coin-ton/lib/config"; import { TonSigner } from "@ledgerhq/coin-ton/lib/signer"; @@ -26,7 +26,7 @@ const messageSigner = { signMessage, }; -const resolver: Resolver = createResolver(createSigner, nearResolver); +const resolver: Resolver = createResolver(createSigner, tonResolver); const cliTools = makeCliTools(); diff --git a/libs/ledger-live-common/src/families/vechain/config.ts b/libs/ledger-live-common/src/families/vechain/config.ts index d7929120f64e..20e41dbb674f 100644 --- a/libs/ledger-live-common/src/families/vechain/config.ts +++ b/libs/ledger-live-common/src/families/vechain/config.ts @@ -1,12 +1,2 @@ -import { ConfigInfo } from "@ledgerhq/live-config/LiveConfig"; - -export const vechainConfig: Record = { - config_currency_vechain: { - type: "object", - default: { - status: { - type: "active", - }, - }, - }, -}; +// Encapsulate for LLD and LLM +export * from "@ledgerhq/coin-vechain/config"; diff --git a/libs/ledger-live-common/src/families/vechain/logic.ts b/libs/ledger-live-common/src/families/vechain/logic.ts index 4326ca2972d5..22caf8451ee2 100644 --- a/libs/ledger-live-common/src/families/vechain/logic.ts +++ b/libs/ledger-live-common/src/families/vechain/logic.ts @@ -1,44 +1,2 @@ -import BigNumber from "bignumber.js"; -import { Transaction as VeChainThorTransaction } from "thor-devkit"; -import { VTHO_ADDRESS } from "./contracts/constants"; -import VIP180 from "./contracts/abis/VIP180"; -import { HEX_PREFIX } from "./constants"; - -export const calculateClausesVtho = async ( - recipient: string, - amount: BigNumber, -): Promise => { - const clauses: VeChainThorTransaction.Clause[] = []; - - // Get the existing clause or create a blank one - const updatedClause: VeChainThorTransaction.Clause = { - to: VTHO_ADDRESS, - value: 0, - data: "0x", - }; - updatedClause.data = VIP180.transfer.encode(recipient, amount.toFixed()); - - clauses.push(updatedClause); - return clauses; -}; - -export const calculateClausesVet = async ( - recipient: string, - amount: BigNumber, -): Promise => { - const clauses: VeChainThorTransaction.Clause[] = []; - - // Get the existing clause or create a blank one - const updatedClause: VeChainThorTransaction.Clause = { - to: null, - value: 0, - data: "0x", - }; - - updatedClause.value = `${HEX_PREFIX}${amount.toString(16)}`; - updatedClause.to = recipient; - - clauses.push(updatedClause); - - return clauses; -}; +// Encapsulate for LLD and LLM +export * from "@ledgerhq/coin-vechain/logic"; \ No newline at end of file diff --git a/libs/ledger-live-common/src/families/vechain/setup.ts b/libs/ledger-live-common/src/families/vechain/setup.ts new file mode 100644 index 000000000000..58f6ef7fb116 --- /dev/null +++ b/libs/ledger-live-common/src/families/vechain/setup.ts @@ -0,0 +1,33 @@ +// Goal of this file is to inject all necessary device/signer dependency to coin-modules + +import { createBridges } from "@ledgerhq/coin-vechain/bridge/js"; +import makeCliTools from "@ledgerhq/coin-vechain/cli-transaction"; +import vechainResolver from "@ledgerhq/coin-vechain/hw-getAddress"; +import { signMessage } from "@ledgerhq/coin-vechain/hw-signMessage"; +import { VechainSigner } from "@ledgerhq/coin-vechain/signer"; +import { Transaction } from "@ledgerhq/coin-vechain/types"; +import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies"; +import Transport from "@ledgerhq/hw-transport"; +import type { Bridge } from "@ledgerhq/types-live"; +import Vet from "@ledgerhq/hw-app-vet"; +import { CreateSigner, createResolver, executeWithSigner } from "../../bridge/setup"; +import { getCurrencyConfiguration } from "../../config"; +import type { Resolver } from "../../hw/getAddress/types"; +import { VechainCoinConfig } from "./config"; + +const createSigner: CreateSigner = (transport: Transport) => new Vet(transport); + +const getCoinConfig: VechainCoinConfig = () => + getCurrencyConfiguration>(getCryptoCurrencyById("ton")); + +const bridge: Bridge = createBridges(executeWithSigner(createSigner), getCoinConfig); + +const messageSigner = { + signMessage, +}; + +const resolver: Resolver = createResolver(createSigner, vechainResolver); + +const cliTools = makeCliTools(); + +export { bridge, cliTools, messageSigner, resolver }; diff --git a/libs/ledger-live-common/src/families/vechain/types.ts b/libs/ledger-live-common/src/families/vechain/types.ts index f225426a9c9c..950888f51a32 100644 --- a/libs/ledger-live-common/src/families/vechain/types.ts +++ b/libs/ledger-live-common/src/families/vechain/types.ts @@ -1,35 +1,2 @@ -import type { - TokenAccount, - TransactionCommon, - TransactionCommonRaw, - TransactionStatusCommon, - TransactionStatusCommonRaw, -} from "@ledgerhq/types-live"; -import BigNumber from "bignumber.js"; -import { Transaction as ThorTransaction } from "thor-devkit"; - -export type Transaction = TransactionCommon & { - family: "vechain"; - estimatedFees: string; - body: ThorTransaction.Body; -}; - -export type TransactionRaw = TransactionCommonRaw & { - family: "vechain"; - estimatedFees: string; - body: ThorTransaction.Body; -}; - -export type TransactionStatus = TransactionStatusCommon; - -export type TransactionStatusRaw = TransactionStatusCommonRaw; - -export type TransactionInfo = { - isTokenAccount: boolean; - amount: BigNumber; - balance: BigNumber; - spendableBalance: BigNumber; - tokenAccount?: TokenAccount; - estimatedFees: string; - estimatedGas: number; -}; +// Encapsulate for LLD and LLM +export * from "@ledgerhq/coin-vechain/types"; \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8fd71e7239ad..1e11e5fec59c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3247,6 +3247,9 @@ importers: '@ledgerhq/evm-tools': specifier: workspace:^ version: link:../../evm-tools + '@ledgerhq/hw-app-vet': + specifier: workspace:^ + version: link:../../ledgerjs/packages/hw-app-vet '@ledgerhq/live-config': specifier: ^3.0.0 version: 3.0.0 @@ -3299,9 +3302,6 @@ importers: '@ledgerhq/coin-tester': specifier: workspace:^ version: link:../../coin-tester - '@ledgerhq/hw-app-eth': - specifier: workspace:^ - version: link:../../ledgerjs/packages/hw-app-eth '@ledgerhq/types-cryptoassets': specifier: workspace:^ version: link:../../ledgerjs/packages/types-cryptoassets From 4c4c2dee329c2cf18cc9e552185e89b362c148f9 Mon Sep 17 00:00:00 2001 From: Anthony Goussot Date: Tue, 10 Sep 2024 12:53:24 +0200 Subject: [PATCH 05/20] feat(coin_module): fixing cli errors --- .../coin-vechain/src/hw-getAddress.ts | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/libs/coin-modules/coin-vechain/src/hw-getAddress.ts b/libs/coin-modules/coin-vechain/src/hw-getAddress.ts index 227074d00dfe..31fd56a2f416 100644 --- a/libs/coin-modules/coin-vechain/src/hw-getAddress.ts +++ b/libs/coin-modules/coin-vechain/src/hw-getAddress.ts @@ -1,16 +1,24 @@ -import Vet from "@ledgerhq/hw-app-vet"; +import { SignerContext } from "@ledgerhq/coin-framework/lib/signer"; import eip55 from "eip55"; -import type { Resolver } from "../../hw/getAddress/types"; +import { VechainSigner } from "./signer"; +import { GetAddressFn } from "@ledgerhq/coin-framework/lib/bridge/getAddressWrapper"; +import { GetAddressOptions } from "@ledgerhq/coin-framework/lib/derivation"; -const resolver: Resolver = async (transport, { path, verify, askChainCode }) => { - const vet = new Vet(transport); - const r = await vet.getAddress(path, verify, askChainCode || false); - const address = eip55.encode(r.address); - return { - path, - address, - publicKey: r.publicKey, - chainCode: r.chainCode, +const resolver = (signerContext: SignerContext): GetAddressFn => { + return async (deviceId: string, { path, verify }: GetAddressOptions) => { + const sig = await signerContext(deviceId, async signer => { + return await signer.getAddress(path, verify, false); // Note: Do we need to check askChainCode or false? + }); + + if (!sig.address || !sig.publicKey.length) + throw Error(`[vechain] Response is empty ${sig.address} ${sig.publicKey}`); + + const address = eip55.encode(sig.address) + return { + address, + publicKey: sig.publicKey, + path, + }; }; }; From d0511974f675ed64f3018f74eecb09237fa4a777 Mon Sep 17 00:00:00 2001 From: Anthony Goussot Date: Wed, 11 Sep 2024 17:33:10 +0200 Subject: [PATCH 06/20] feat(coin_module): finialized --- libs/coin-modules/coin-vechain/package.json | 1 + .../coin-vechain/src/hw-signMessage.ts | 4 +- libs/coin-modules/coin-vechain/src/types.ts | 2 +- .../src/families/vechain/bridge/js.ts | 33 ----- .../src/families/vechain/bridge/mock.ts | 137 ------------------ .../src/families/vechain/config.ts | 14 +- .../src/families/vechain/setup.ts | 2 +- .../src/generated/account.ts | 2 - .../src/generated/bridge/mock.ts | 2 - .../src/generated/cli-transaction.ts | 3 + libs/ledger-live-common/src/generated/mock.ts | 2 +- pnpm-lock.yaml | 18 +++ 12 files changed, 39 insertions(+), 181 deletions(-) delete mode 100644 libs/ledger-live-common/src/families/vechain/bridge/js.ts delete mode 100644 libs/ledger-live-common/src/families/vechain/bridge/mock.ts diff --git a/libs/coin-modules/coin-vechain/package.json b/libs/coin-modules/coin-vechain/package.json index 26d74de8295f..ba2b97007547 100644 --- a/libs/coin-modules/coin-vechain/package.json +++ b/libs/coin-modules/coin-vechain/package.json @@ -65,6 +65,7 @@ "@ledgerhq/errors": "workspace:^", "@ledgerhq/evm-tools": "workspace:^", "@ledgerhq/hw-app-vet": "workspace:^", + "@ledgerhq/hw-transport": "^6.31.2", "@ledgerhq/live-config": "^3.0.0", "@ledgerhq/live-env": "workspace:^", "@ledgerhq/live-network": "workspace:^", diff --git a/libs/coin-modules/coin-vechain/src/hw-signMessage.ts b/libs/coin-modules/coin-vechain/src/hw-signMessage.ts index 1c4cffe956d7..69a483eaa16c 100644 --- a/libs/coin-modules/coin-vechain/src/hw-signMessage.ts +++ b/libs/coin-modules/coin-vechain/src/hw-signMessage.ts @@ -5,7 +5,7 @@ import { Transaction as ThorTransaction } from "thor-devkit"; export const signMessage = async ( transport: Transport, { path, message, rawMessage }: { path: string; message: string; rawMessage: string }, -): Promise => { +): Promise => { let messageObj; let unsigned; try { @@ -17,7 +17,7 @@ export const signMessage = async ( } const vet = new Vet(transport); - const result = await vet.signTransaction(path, unsigned.encode().toString("hex")); + const result = await vet.signTransaction(path, (unsigned as ThorTransaction).encode().toString("hex")); return result.toString("hex"); }; diff --git a/libs/coin-modules/coin-vechain/src/types.ts b/libs/coin-modules/coin-vechain/src/types.ts index f225426a9c9c..aa65063b80fd 100644 --- a/libs/coin-modules/coin-vechain/src/types.ts +++ b/libs/coin-modules/coin-vechain/src/types.ts @@ -29,7 +29,7 @@ export type TransactionInfo = { amount: BigNumber; balance: BigNumber; spendableBalance: BigNumber; - tokenAccount?: TokenAccount; + tokenAccount: TokenAccount | undefined; estimatedFees: string; estimatedGas: number; }; diff --git a/libs/ledger-live-common/src/families/vechain/bridge/js.ts b/libs/ledger-live-common/src/families/vechain/bridge/js.ts deleted file mode 100644 index 517caff82686..000000000000 --- a/libs/ledger-live-common/src/families/vechain/bridge/js.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { Account, AccountBridge, CurrencyBridge } from "@ledgerhq/types-live"; -import { defaultUpdateTransaction } from "@ledgerhq/coin-framework/bridge/jsHelpers"; -import { makeAccountBridgeReceive } from "../../../bridge/jsHelpers"; -import { getTransactionStatus } from "../getTransactionStatus"; -import type { Transaction, TransactionStatus } from "../types"; -import { estimateMaxSpendable } from "../estimateMaxSpendable"; -import { prepareTransaction } from "../prepareTransaction"; -import { createTransaction } from "../createTransaction"; -import { sync, scanAccounts } from "../synchronisation"; -import { signOperation } from "../signOperation"; -import { broadcast } from "../broadcast"; - -const receive: AccountBridge["receive"] = makeAccountBridgeReceive(); - -const currencyBridge: CurrencyBridge = { - scanAccounts, - preload: async () => Promise.resolve({}), - hydrate: (): void => {}, -}; - -const accountBridge: AccountBridge = { - estimateMaxSpendable, - createTransaction, - updateTransaction: defaultUpdateTransaction, - getTransactionStatus, - prepareTransaction, - sync, - receive, - signOperation, - broadcast, -}; - -export default { currencyBridge, accountBridge }; diff --git a/libs/ledger-live-common/src/families/vechain/bridge/mock.ts b/libs/ledger-live-common/src/families/vechain/bridge/mock.ts deleted file mode 100644 index e3bc22524547..000000000000 --- a/libs/ledger-live-common/src/families/vechain/bridge/mock.ts +++ /dev/null @@ -1,137 +0,0 @@ -import { AccountBridge, CurrencyBridge, TokenAccount } from "@ledgerhq/types-live"; -import type { Transaction, TransactionStatus } from "../types"; -import { scanAccounts, signOperation, broadcast, sync } from "../../../bridge/mockHelpers"; -import { makeAccountBridgeReceive } from "../../../bridge/mockHelpers"; -import BigNumber from "bignumber.js"; -import { DEFAULT_GAS_COEFFICIENT, MAINNET_CHAIN_TAG } from "../constants"; -import { calculateTransactionInfo, generateNonce } from "../utils/transaction-utils"; -import { defaultUpdateTransaction } from "@ledgerhq/coin-framework/bridge/jsHelpers"; -import { Account } from "@ledgerhq/types-live"; -import { - AmountRequired, - FeeNotLoaded, - InvalidAddress, - InvalidAddressBecauseDestinationIsAlsoSource, - NotEnoughBalance, - RecipientRequired, -} from "@ledgerhq/errors"; -import { NotEnoughVTHO } from "../errors"; -import { isValid } from "../utils/address-utils"; - -const receive = makeAccountBridgeReceive(); - -const currencyBridge: CurrencyBridge = { - scanAccounts, - preload: async () => Promise.resolve({}), - hydrate: (): void => {}, -}; - -const estimateMaxSpendable = ({ account }) => { - return account.balance; -}; - -const createTransaction = (): Transaction => ({ - amount: new BigNumber(0), - useAllAmount: false, - family: "vechain", - estimatedFees: "0", - recipient: "", - body: { - chainTag: MAINNET_CHAIN_TAG, - blockRef: "", - expiration: 18, - clauses: [], - gasPriceCoef: DEFAULT_GAS_COEFFICIENT, - gas: "0", - dependsOn: null, - nonce: generateNonce(), - }, -}); - -const getTransactionStatus = async ( - account: Account, - transaction: Transaction, -): Promise => { - const { freshAddress, currency, subAccounts } = account; - const { body, recipient, subAccountId } = transaction; - const errors: Record = {}; - const warnings: Record = {}; - - const tokenAccount = - subAccountId && subAccounts - ? (subAccounts.find(subAccount => { - return subAccount.id === subAccountId; - }) as TokenAccount) - : undefined; - const isTokenAccount = !!tokenAccount; - const estimatedFees = new BigNumber(transaction.estimatedFees); - - const { amount, spendableBalance } = await calculateTransactionInfo(account, transaction, { - estimatedGas: body.gas as number, - estimatedGasFees: estimatedFees, - }); - - if (!body?.gas) { - errors.fees = new FeeNotLoaded(); - } - - if (!recipient) { - errors.recipient = new RecipientRequired(); - } else if (freshAddress.toLowerCase() === recipient.toLowerCase()) { - warnings.recipient = new InvalidAddressBecauseDestinationIsAlsoSource(); - } else if (!isValid(recipient)) { - errors.recipient = new InvalidAddress("", { - currencyName: currency.name, - }); - } - - if (!amount.gt(0)) { - if (!transaction.useAllAmount) errors.amount = new AmountRequired(); - else errors.amount = new NotEnoughBalance(); - } else { - if (amount.gt(spendableBalance)) { - errors.amount = new NotEnoughBalance(); - } - if (!isTokenAccount) { - // vet - const vthoBalance = subAccounts?.[0].balance; - if (estimatedFees.gt(vthoBalance || 0)) { - errors.amount = new NotEnoughVTHO(); - } - } - } - - let totalSpent = amount; - if (isTokenAccount) { - totalSpent = amount.plus(estimatedFees); - } - - return Promise.resolve({ - errors, - warnings, - estimatedFees, - amount, - totalSpent, - }); -}; - -export const prepareTransaction = async ( - account: Account, - transaction: Transaction, -): Promise => { - return transaction; -}; - -const accountBridge: AccountBridge = { - estimateMaxSpendable, - createTransaction, - updateTransaction: defaultUpdateTransaction, - getTransactionStatus, - prepareTransaction, - sync, - receive, - signOperation, - broadcast, -}; - -export default { currencyBridge, accountBridge }; diff --git a/libs/ledger-live-common/src/families/vechain/config.ts b/libs/ledger-live-common/src/families/vechain/config.ts index 20e41dbb674f..7b91c2a576fa 100644 --- a/libs/ledger-live-common/src/families/vechain/config.ts +++ b/libs/ledger-live-common/src/families/vechain/config.ts @@ -1,2 +1,12 @@ -// Encapsulate for LLD and LLM -export * from "@ledgerhq/coin-vechain/config"; +import { CurrencyLiveConfigDefinition } from "../../config"; + +const vechainConfig: CurrencyLiveConfigDefinition = { + config_currency_vechain: { + type: "object", + default: { + status: { type: "active" }, + }, + }, +}; + +export { vechainConfig }; \ No newline at end of file diff --git a/libs/ledger-live-common/src/families/vechain/setup.ts b/libs/ledger-live-common/src/families/vechain/setup.ts index 58f6ef7fb116..0d2fa178f6a0 100644 --- a/libs/ledger-live-common/src/families/vechain/setup.ts +++ b/libs/ledger-live-common/src/families/vechain/setup.ts @@ -13,7 +13,7 @@ import Vet from "@ledgerhq/hw-app-vet"; import { CreateSigner, createResolver, executeWithSigner } from "../../bridge/setup"; import { getCurrencyConfiguration } from "../../config"; import type { Resolver } from "../../hw/getAddress/types"; -import { VechainCoinConfig } from "./config"; +import { VechainCoinConfig } from "@ledgerhq/coin-vechain/lib/config"; const createSigner: CreateSigner = (transport: Transport) => new Vet(transport); diff --git a/libs/ledger-live-common/src/generated/account.ts b/libs/ledger-live-common/src/generated/account.ts index 099824df7138..33dfe446aa60 100644 --- a/libs/ledger-live-common/src/generated/account.ts +++ b/libs/ledger-live-common/src/generated/account.ts @@ -1,5 +1,4 @@ import crypto_org from "../families/crypto_org/account"; -import vechain from "../families/vechain/account"; import bitcoin from "@ledgerhq/coin-bitcoin/account"; import cardano from "@ledgerhq/coin-cardano/account"; import icon from "@ledgerhq/coin-icon/account"; @@ -7,7 +6,6 @@ import near from "@ledgerhq/coin-near/account"; export default { crypto_org, - vechain, bitcoin, cardano, icon, diff --git a/libs/ledger-live-common/src/generated/bridge/mock.ts b/libs/ledger-live-common/src/generated/bridge/mock.ts index 51bc56c966ca..a4b5ae66cce5 100644 --- a/libs/ledger-live-common/src/generated/bridge/mock.ts +++ b/libs/ledger-live-common/src/generated/bridge/mock.ts @@ -11,7 +11,6 @@ import solana from "../../families/solana/bridge/mock"; import stellar from "../../families/stellar/bridge/mock"; import tezos from "../../families/tezos/bridge/mock"; import tron from "../../families/tron/bridge/mock"; -import vechain from "../../families/vechain/bridge/mock"; import xrp from "../../families/xrp/bridge/mock"; export default { @@ -28,6 +27,5 @@ export default { stellar, tezos, tron, - vechain, xrp, }; diff --git a/libs/ledger-live-common/src/generated/cli-transaction.ts b/libs/ledger-live-common/src/generated/cli-transaction.ts index e4c57400406d..a7e5d64fe098 100644 --- a/libs/ledger-live-common/src/generated/cli-transaction.ts +++ b/libs/ledger-live-common/src/generated/cli-transaction.ts @@ -1,6 +1,9 @@ import celo from "../families/celo/cli-transaction"; import crypto_org from "../families/crypto_org/cli-transaction"; import vechain from "../families/vechain/cli-transaction"; +import filecoin from "../families/filecoin/cli-transaction"; +import hedera from "../families/hedera/cli-transaction"; +import stacks from "../families/stacks/cli-transaction"; import { cliTools as algorand } from "../families/algorand/setup"; import { cliTools as bitcoin } from "../families/bitcoin/setup"; import { cliTools as cardano } from "../families/cardano/setup"; diff --git a/libs/ledger-live-common/src/generated/mock.ts b/libs/ledger-live-common/src/generated/mock.ts index ce694fe66d4e..b688d95f7471 100644 --- a/libs/ledger-live-common/src/generated/mock.ts +++ b/libs/ledger-live-common/src/generated/mock.ts @@ -5,5 +5,5 @@ import cosmos from "@ledgerhq/coin-cosmos/mock"; export default { vechain, algorand, - cosmos, + cosmos }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1e11e5fec59c..06fc2f00ba92 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3250,6 +3250,9 @@ importers: '@ledgerhq/hw-app-vet': specifier: workspace:^ version: link:../../ledgerjs/packages/hw-app-vet + '@ledgerhq/hw-transport': + specifier: ^6.31.2 + version: 6.31.2 '@ledgerhq/live-config': specifier: ^3.0.0 version: 3.0.0 @@ -11002,6 +11005,9 @@ packages: '@ledgerhq/errors@5.50.0': resolution: {integrity: sha512-gu6aJ/BHuRlpU7kgVpy2vcYk6atjB4iauP2ymF7Gk0ez0Y/6VSMVSJvubeEQN+IV60+OBK0JgeIZG7OiHaw8ow==} + '@ledgerhq/errors@6.18.0': + resolution: {integrity: sha512-L3jQWAGyooxRDk/MRlW2v4Ji9+kloBtdmz9wBkHaj2j0n+05rweJSV3GHw9oye1BYMbVFqFffmT4H3hlXlCasw==} + '@ledgerhq/errors@6.19.1': resolution: {integrity: sha512-75yK7Nnit/Gp7gdrJAz0ipp31CCgncRp+evWt6QawQEtQKYEDfGo10QywgrrBBixeRxwnMy1DP6g2oCWRf1bjw==} @@ -11027,6 +11033,9 @@ packages: '@ledgerhq/hw-transport@6.30.6': resolution: {integrity: sha512-fT0Z4IywiuJuZrZE/+W0blkV5UCotDPFTYKLkKCLzYzuE6javva7D/ajRaIeR+hZ4kTmKF4EqnsmDCXwElez+w==} + '@ledgerhq/hw-transport@6.31.2': + resolution: {integrity: sha512-B27UIzMzm2IXPGYnEB95R7eHxpXBkTBHh6MUJJQZVknt8LilEz1tfpTYUdzAKDGQ+Z5MZyYb01Eh3Zqm3kn3uw==} + '@ledgerhq/hw-transport@6.31.3': resolution: {integrity: sha512-rFplkHWF5NXtlYwAusqLlMu298NHtRD+2q/jrTYc//uu/xJO9LkDIgKid6IVF2+e1Wj7yX6YQVrU6L0Yu1ntEw==} @@ -36181,6 +36190,8 @@ snapshots: '@ledgerhq/errors@5.50.0': {} + '@ledgerhq/errors@6.18.0': {} + '@ledgerhq/errors@6.19.1': {} '@ledgerhq/hw-app-eth@5.11.0': @@ -36226,6 +36237,13 @@ snapshots: '@ledgerhq/logs': 6.12.0 events: 3.3.0 + '@ledgerhq/hw-transport@6.31.2': + dependencies: + '@ledgerhq/devices': link:libs/ledgerjs/packages/devices + '@ledgerhq/errors': 6.18.0 + '@ledgerhq/logs': 6.12.0 + events: 3.3.0 + '@ledgerhq/hw-transport@6.31.3': dependencies: '@ledgerhq/devices': link:libs/ledgerjs/packages/devices From 91f2e7239ece63f8b75634d282d48683565d149e Mon Sep 17 00:00:00 2001 From: Anthony Goussot Date: Thu, 12 Sep 2024 09:57:53 +0200 Subject: [PATCH 07/20] feat(coin_module): config file for vechain --- libs/ledger-live-common/src/families/vechain/config.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/ledger-live-common/src/families/vechain/config.ts b/libs/ledger-live-common/src/families/vechain/config.ts index 7b91c2a576fa..37ce86f86b7c 100644 --- a/libs/ledger-live-common/src/families/vechain/config.ts +++ b/libs/ledger-live-common/src/families/vechain/config.ts @@ -5,6 +5,9 @@ const vechainConfig: CurrencyLiveConfigDefinition = { type: "object", default: { status: { type: "active" }, + infra: { + API_VECHAIN_THOREST: "https://vechain.coin.ledger.com", + }, }, }, }; From 6e68a79f87ae4c901b3a15df3f225bae6592c313 Mon Sep 17 00:00:00 2001 From: Anthony Goussot Date: Tue, 22 Oct 2024 10:54:41 +0200 Subject: [PATCH 08/20] chore(coin-module): Add script for file generation --- libs/ledger-live-common/scripts/sync-families-dispatch.mjs | 1 + libs/ledger-live-common/src/generated/account.ts | 2 ++ libs/ledger-live-common/src/generated/bridge/js.ts | 2 ++ libs/ledger-live-common/src/generated/cli-transaction.ts | 2 ++ libs/ledger-live-common/src/generated/hw-getAddress.ts | 2 ++ libs/ledger-live-common/src/generated/hw-signMessage.ts | 2 ++ libs/ledger-live-common/src/generated/mock.ts | 6 +++--- libs/ledger-live-common/src/generated/specs.ts | 2 ++ libs/ledger-live-common/src/generated/transaction.ts | 2 ++ libs/ledger-live-common/src/generated/types.ts | 2 +- 10 files changed, 19 insertions(+), 4 deletions(-) diff --git a/libs/ledger-live-common/scripts/sync-families-dispatch.mjs b/libs/ledger-live-common/scripts/sync-families-dispatch.mjs index 624c48a37036..b1ae4e03089a 100644 --- a/libs/ledger-live-common/scripts/sync-families-dispatch.mjs +++ b/libs/ledger-live-common/scripts/sync-families-dispatch.mjs @@ -39,6 +39,7 @@ const familiesWPackage = [ "tezos", "ton", "tron", + "vechain", "xrp", ]; diff --git a/libs/ledger-live-common/src/generated/account.ts b/libs/ledger-live-common/src/generated/account.ts index 33dfe446aa60..e4543f89d777 100644 --- a/libs/ledger-live-common/src/generated/account.ts +++ b/libs/ledger-live-common/src/generated/account.ts @@ -3,6 +3,7 @@ import bitcoin from "@ledgerhq/coin-bitcoin/account"; import cardano from "@ledgerhq/coin-cardano/account"; import icon from "@ledgerhq/coin-icon/account"; import near from "@ledgerhq/coin-near/account"; +import vechain from "@ledgerhq/coin-vechain/account"; export default { crypto_org, @@ -10,4 +11,5 @@ export default { cardano, icon, near, + vechain, }; diff --git a/libs/ledger-live-common/src/generated/bridge/js.ts b/libs/ledger-live-common/src/generated/bridge/js.ts index 6e8177397694..30e69f0d3d4d 100644 --- a/libs/ledger-live-common/src/generated/bridge/js.ts +++ b/libs/ledger-live-common/src/generated/bridge/js.ts @@ -20,6 +20,7 @@ import { bridge as stellar } from "../../families/stellar/setup"; import { bridge as tezos } from "../../families/tezos/setup"; import { bridge as ton } from "../../families/ton/setup"; import { bridge as tron } from "../../families/tron/setup"; +import { bridge as vechain } from "../../families/vechain/setup"; import { bridge as xrp } from "../../families/xrp/setup"; export default { @@ -45,5 +46,6 @@ export default { tezos, ton, tron, + vechain, xrp, }; diff --git a/libs/ledger-live-common/src/generated/cli-transaction.ts b/libs/ledger-live-common/src/generated/cli-transaction.ts index a7e5d64fe098..7178b2f95102 100644 --- a/libs/ledger-live-common/src/generated/cli-transaction.ts +++ b/libs/ledger-live-common/src/generated/cli-transaction.ts @@ -21,6 +21,7 @@ import { cliTools as stellar } from "../families/stellar/setup"; import { cliTools as tezos } from "../families/tezos/setup"; import { cliTools as ton } from "../families/ton/setup"; import { cliTools as tron } from "../families/tron/setup"; +import { cliTools as vechain } from "../families/vechain/setup"; import { cliTools as xrp } from "../families/xrp/setup"; export default { @@ -44,5 +45,6 @@ export default { tezos, ton, tron, + vechain, xrp, }; diff --git a/libs/ledger-live-common/src/generated/hw-getAddress.ts b/libs/ledger-live-common/src/generated/hw-getAddress.ts index 1f7c750cc2c9..6bc8f665ba1a 100644 --- a/libs/ledger-live-common/src/generated/hw-getAddress.ts +++ b/libs/ledger-live-common/src/generated/hw-getAddress.ts @@ -20,6 +20,7 @@ import { resolver as stellar } from "../families/stellar/setup"; import { resolver as tezos } from "../families/tezos/setup"; import { resolver as ton } from "../families/ton/setup"; import { resolver as tron } from "../families/tron/setup"; +import { resolver as vechain } from "../families/vechain/setup"; import { resolver as xrp } from "../families/xrp/setup"; export default { @@ -45,5 +46,6 @@ export default { tezos, ton, tron, + vechain, xrp, }; diff --git a/libs/ledger-live-common/src/generated/hw-signMessage.ts b/libs/ledger-live-common/src/generated/hw-signMessage.ts index e062112bc823..275dd0ab42db 100644 --- a/libs/ledger-live-common/src/generated/hw-signMessage.ts +++ b/libs/ledger-live-common/src/generated/hw-signMessage.ts @@ -5,6 +5,7 @@ import { messageSigner as bitcoin } from "../families/bitcoin/setup"; import { messageSigner as evm } from "../families/evm/setup"; import { messageSigner as filecoin } from "../families/filecoin/setup"; import { messageSigner as ton } from "../families/ton/setup"; +import { messageSigner as vechain } from "../families/vechain/setup"; export default { casper, @@ -14,4 +15,5 @@ export default { evm, filecoin, ton, + vechain, }; diff --git a/libs/ledger-live-common/src/generated/mock.ts b/libs/ledger-live-common/src/generated/mock.ts index b688d95f7471..b1febbae1628 100644 --- a/libs/ledger-live-common/src/generated/mock.ts +++ b/libs/ledger-live-common/src/generated/mock.ts @@ -1,9 +1,9 @@ -import vechain from "../families/vechain/mock"; import algorand from "@ledgerhq/coin-algorand/mock"; import cosmos from "@ledgerhq/coin-cosmos/mock"; +import vechain from "@ledgerhq/coin-vechain/mock"; export default { - vechain, algorand, - cosmos + cosmos, + vechain, }; diff --git a/libs/ledger-live-common/src/generated/specs.ts b/libs/ledger-live-common/src/generated/specs.ts index 5c6868beb8c9..884d5eef9883 100644 --- a/libs/ledger-live-common/src/generated/specs.ts +++ b/libs/ledger-live-common/src/generated/specs.ts @@ -20,6 +20,7 @@ import stellar from "@ledgerhq/coin-stellar/specs"; import tezos from "@ledgerhq/coin-tezos/specs"; import ton from "@ledgerhq/coin-ton/specs"; import tron from "@ledgerhq/coin-tron/specs"; +import vechain from "@ledgerhq/coin-vechain/specs"; import xrp from "@ledgerhq/coin-xrp/specs"; export default { @@ -45,5 +46,6 @@ export default { tezos, ton, tron, + vechain, xrp, }; diff --git a/libs/ledger-live-common/src/generated/transaction.ts b/libs/ledger-live-common/src/generated/transaction.ts index 1418d8f3bb93..fd41bc74b84c 100644 --- a/libs/ledger-live-common/src/generated/transaction.ts +++ b/libs/ledger-live-common/src/generated/transaction.ts @@ -20,6 +20,7 @@ import stellar from "@ledgerhq/coin-stellar/transaction"; import tezos from "@ledgerhq/coin-tezos/transaction"; import ton from "@ledgerhq/coin-ton/transaction"; import tron from "@ledgerhq/coin-tron/transaction"; +import vechain from "@ledgerhq/coin-vechain/transaction"; import xrp from "@ledgerhq/coin-xrp/transaction"; export default { @@ -45,5 +46,6 @@ export default { tezos, ton, tron, + vechain, xrp, }; diff --git a/libs/ledger-live-common/src/generated/types.ts b/libs/ledger-live-common/src/generated/types.ts index 96e3edb9536d..8ec6a9820b92 100644 --- a/libs/ledger-live-common/src/generated/types.ts +++ b/libs/ledger-live-common/src/generated/types.ts @@ -129,7 +129,7 @@ import type { TransactionRaw as vechainTransactionRaw, TransactionStatus as vechainTransactionStatus, TransactionStatusRaw as vechainTransactionStatusRaw, -} from "../families/vechain/types"; +} from "@ledgerhq/coin-vechain/types"; import type { Transaction as xrpTransaction, TransactionRaw as xrpTransactionRaw, From 91efa0bb6dd3b9ff7f5c554413d1566dac6258a9 Mon Sep 17 00:00:00 2001 From: Anthony Goussot Date: Tue, 22 Oct 2024 11:34:05 +0200 Subject: [PATCH 09/20] chore(coin-vechain): remove signOperation --- libs/coin-modules/coin-vechain/package.json | 2 -- .../coin-vechain/src/hw-signMessage.ts | 25 ------------------- .../src/families/vechain/setup.ts | 7 +----- .../src/generated/hw-signMessage.ts | 2 -- pnpm-lock.yaml | 6 ----- 5 files changed, 1 insertion(+), 41 deletions(-) delete mode 100644 libs/coin-modules/coin-vechain/src/hw-signMessage.ts diff --git a/libs/coin-modules/coin-vechain/package.json b/libs/coin-modules/coin-vechain/package.json index ba2b97007547..24edc6bb053b 100644 --- a/libs/coin-modules/coin-vechain/package.json +++ b/libs/coin-modules/coin-vechain/package.json @@ -57,11 +57,9 @@ "coin-tester": "DOTENV_CONFIG_PATH=src/__tests__/coin-tester/.env pnpm jest --runTestsByPath src/__tests__/coin-tester/*.test.ts" }, "dependencies": { - "@ethersproject/shims": "^5.7.0", "@ledgerhq/coin-framework": "workspace:^", "@ledgerhq/cryptoassets": "workspace:^", "@ledgerhq/devices": "workspace:^", - "@ledgerhq/domain-service": "workspace:^", "@ledgerhq/errors": "workspace:^", "@ledgerhq/evm-tools": "workspace:^", "@ledgerhq/hw-app-vet": "workspace:^", diff --git a/libs/coin-modules/coin-vechain/src/hw-signMessage.ts b/libs/coin-modules/coin-vechain/src/hw-signMessage.ts deleted file mode 100644 index 69a483eaa16c..000000000000 --- a/libs/coin-modules/coin-vechain/src/hw-signMessage.ts +++ /dev/null @@ -1,25 +0,0 @@ -import Transport from "@ledgerhq/hw-transport"; -import Vet from "@ledgerhq/hw-app-vet"; -import { Transaction as ThorTransaction } from "thor-devkit"; - -export const signMessage = async ( - transport: Transport, - { path, message, rawMessage }: { path: string; message: string; rawMessage: string }, -): Promise => { - let messageObj; - let unsigned; - try { - if (message) messageObj = JSON.parse(message); - else messageObj = JSON.parse(rawMessage); - unsigned = new ThorTransaction(messageObj); - } catch (e) { - console.error(e); - } - const vet = new Vet(transport); - - const result = await vet.signTransaction(path, (unsigned as ThorTransaction).encode().toString("hex")); - - return result.toString("hex"); -}; - -export default { signMessage }; diff --git a/libs/ledger-live-common/src/families/vechain/setup.ts b/libs/ledger-live-common/src/families/vechain/setup.ts index 0d2fa178f6a0..a845d8b1accf 100644 --- a/libs/ledger-live-common/src/families/vechain/setup.ts +++ b/libs/ledger-live-common/src/families/vechain/setup.ts @@ -3,7 +3,6 @@ import { createBridges } from "@ledgerhq/coin-vechain/bridge/js"; import makeCliTools from "@ledgerhq/coin-vechain/cli-transaction"; import vechainResolver from "@ledgerhq/coin-vechain/hw-getAddress"; -import { signMessage } from "@ledgerhq/coin-vechain/hw-signMessage"; import { VechainSigner } from "@ledgerhq/coin-vechain/signer"; import { Transaction } from "@ledgerhq/coin-vechain/types"; import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies"; @@ -22,12 +21,8 @@ const getCoinConfig: VechainCoinConfig = () => const bridge: Bridge = createBridges(executeWithSigner(createSigner), getCoinConfig); -const messageSigner = { - signMessage, -}; - const resolver: Resolver = createResolver(createSigner, vechainResolver); const cliTools = makeCliTools(); -export { bridge, cliTools, messageSigner, resolver }; +export { bridge, cliTools, resolver }; diff --git a/libs/ledger-live-common/src/generated/hw-signMessage.ts b/libs/ledger-live-common/src/generated/hw-signMessage.ts index 275dd0ab42db..e062112bc823 100644 --- a/libs/ledger-live-common/src/generated/hw-signMessage.ts +++ b/libs/ledger-live-common/src/generated/hw-signMessage.ts @@ -5,7 +5,6 @@ import { messageSigner as bitcoin } from "../families/bitcoin/setup"; import { messageSigner as evm } from "../families/evm/setup"; import { messageSigner as filecoin } from "../families/filecoin/setup"; import { messageSigner as ton } from "../families/ton/setup"; -import { messageSigner as vechain } from "../families/vechain/setup"; export default { casper, @@ -15,5 +14,4 @@ export default { evm, filecoin, ton, - vechain, }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 06fc2f00ba92..56a3fab9d2dd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3226,9 +3226,6 @@ importers: libs/coin-modules/coin-vechain: dependencies: - '@ethersproject/shims': - specifier: ^5.7.0 - version: 5.7.0 '@ledgerhq/coin-framework': specifier: workspace:^ version: link:../../coin-framework @@ -3238,9 +3235,6 @@ importers: '@ledgerhq/devices': specifier: workspace:* version: link:../../ledgerjs/packages/devices - '@ledgerhq/domain-service': - specifier: workspace:^ - version: link:../../domain-service '@ledgerhq/errors': specifier: workspace:^ version: link:../../ledgerjs/packages/errors From 9fd557a3c88694b953d0e0d91323c9fdcc56fbab Mon Sep 17 00:00:00 2001 From: Anthony Goussot Date: Tue, 22 Oct 2024 12:59:26 +0200 Subject: [PATCH 10/20] chore(xcodeproj): replace with develop version --- .../project.pbxproj | 108 +++--------------- 1 file changed, 18 insertions(+), 90 deletions(-) diff --git a/apps/ledger-live-mobile/ios/ledgerlivemobile.xcodeproj/project.pbxproj b/apps/ledger-live-mobile/ios/ledgerlivemobile.xcodeproj/project.pbxproj index e683dccb3420..fca8fb2c0fac 100644 --- a/apps/ledger-live-mobile/ios/ledgerlivemobile.xcodeproj/project.pbxproj +++ b/apps/ledger-live-mobile/ios/ledgerlivemobile.xcodeproj/project.pbxproj @@ -17,7 +17,6 @@ 2EA091AF2C3FBD5900B6181E /* GoogleService-Info-Testing.plist in Resources */ = {isa = PBXBuildFile; fileRef = 2EA091AE2C3FBD5900B6181E /* GoogleService-Info-Testing.plist */; }; 3407D5D9215D2AB800C9D40B /* NeededForBLE.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3407D5D8215D2AB800C9D40B /* NeededForBLE.swift */; }; 515E9C2C8C0049EC992210D9 /* Inter-Medium.otf in Resources */ = {isa = PBXBuildFile; fileRef = 3B6982A2E67F482A8069215B /* Inter-Medium.otf */; }; - 53E10EBE8D058B0E732DD09B /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = B2ADF826B67305807029EFEE /* PrivacyInfo.xcprivacy */; }; AD6EE26071FA4673B5C89936 /* FontAwesome5_Pro_Brands.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 4BD106EA37CA467F9525D699 /* FontAwesome5_Pro_Brands.ttf */; }; AD7A77B84DF3487C812B091B /* FontAwesome5_Pro_Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 668E26194DD94B6D8F10D450 /* FontAwesome5_Pro_Regular.ttf */; }; B116B48438CB416C980DD0E7 /* Inter-SemiBold.otf in Resources */ = {isa = PBXBuildFile; fileRef = F3993D7FF61549FE9270BC06 /* Inter-SemiBold.otf */; }; @@ -42,7 +41,6 @@ 09BC9C5402323A57C5327727 /* ExpoModulesProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ExpoModulesProvider.swift; path = "Pods/Target Support Files/Pods-ledgerlivemobile/ExpoModulesProvider.swift"; sourceTree = ""; }; 0EC70FE4282B9CAA00E9E355 /* AdServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdServices.framework; path = System/Library/Frameworks/AdServices.framework; sourceTree = SDKROOT; }; 0F189190C1964DD1B7E31BE6 /* FontAwesome5_Brands.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome5_Brands.ttf; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Brands.ttf"; sourceTree = ""; }; - 0F3FA5B2EBC599D43E064942 /* Pods-ledgerlivemobile.prerelease.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ledgerlivemobile.prerelease.xcconfig"; path = "Target Support Files/Pods-ledgerlivemobile/Pods-ledgerlivemobile.prerelease.xcconfig"; sourceTree = ""; }; 13B07F961A680F5B00A75B9A /* ledgerlivemobile.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ledgerlivemobile.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = ledgerlivemobile/AppDelegate.h; sourceTree = ""; }; 13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = ledgerlivemobile/AppDelegate.mm; sourceTree = ""; }; @@ -80,13 +78,9 @@ 6D891D99F1084D459DBF667F /* FontAwesome5_Pro_Light.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome5_Pro_Light.ttf; path = ../assets/fonts/FontAwesome5_Pro_Light.ttf; sourceTree = ""; }; 793F2C3B8DC0475194262928 /* libRCTCamera.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRCTCamera.a; sourceTree = ""; }; 9390D938BCB148F2A34703E3 /* AntDesign.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = AntDesign.ttf; path = "../node_modules/react-native-vector-icons/Fonts/AntDesign.ttf"; sourceTree = ""; }; - 97FD0A4F7C8CED04EEB0A176 /* Pods-ledgerlivemobile.prerelease.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ledgerlivemobile.prerelease.xcconfig"; path = "Target Support Files/Pods-ledgerlivemobile/Pods-ledgerlivemobile.prerelease.xcconfig"; sourceTree = ""; }; 991AA9919E4840DBB799E117 /* FontAwesome5_Pro_Solid.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome5_Pro_Solid.ttf; path = ../assets/fonts/FontAwesome5_Pro_Solid.ttf; sourceTree = ""; }; 99A82013C77445B4B2B54AB5 /* EvilIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = EvilIcons.ttf; path = "../node_modules/react-native-vector-icons/Fonts/EvilIcons.ttf"; sourceTree = ""; }; - A187EC82BC83E3BD9D7F3D1F /* Pods-ledgerlivemobile.nightly.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ledgerlivemobile.nightly.xcconfig"; path = "Target Support Files/Pods-ledgerlivemobile/Pods-ledgerlivemobile.nightly.xcconfig"; sourceTree = ""; }; A80B735599C416373F147DED /* Pods-ledgerlivemobile-ledgerlivemobileTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ledgerlivemobile-ledgerlivemobileTests.release.xcconfig"; path = "Target Support Files/Pods-ledgerlivemobile-ledgerlivemobileTests/Pods-ledgerlivemobile-ledgerlivemobileTests.release.xcconfig"; sourceTree = ""; }; - B2ADF826B67305807029EFEE /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = ledgerlivemobile/PrivacyInfo.xcprivacy; sourceTree = ""; }; - B3F983E6F88EBD69A6725FF4 /* Pods-ledgerlivemobile.nightly.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ledgerlivemobile.nightly.xcconfig"; path = "Target Support Files/Pods-ledgerlivemobile/Pods-ledgerlivemobile.nightly.xcconfig"; sourceTree = ""; }; BA451DE627CE516700AAB209 /* GoogleService-Info-Production.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info-Production.plist"; sourceTree = ""; }; BA451DE727CE516700AAB209 /* GoogleService-Info-Staging.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info-Staging.plist"; sourceTree = ""; }; BAE7948F27D7C46A00C465F5 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; @@ -166,13 +160,6 @@ 68139B1F4BF967461F30D471 /* Pods-ledgerlivemobile-ledgerlivemobileTests.debug.xcconfig */, A80B735599C416373F147DED /* Pods-ledgerlivemobile-ledgerlivemobileTests.release.xcconfig */, C630F76F0E1C857DA405027E /* Pods-ledgerlivemobile-ledgerlivemobileTests.staging.xcconfig */, -<<<<<<< HEAD - B3F983E6F88EBD69A6725FF4 /* Pods-ledgerlivemobile.nightly.xcconfig */, - 97FD0A4F7C8CED04EEB0A176 /* Pods-ledgerlivemobile.prerelease.xcconfig */, -======= - A187EC82BC83E3BD9D7F3D1F /* Pods-ledgerlivemobile.nightly.xcconfig */, - 0F3FA5B2EBC599D43E064942 /* Pods-ledgerlivemobile.prerelease.xcconfig */, ->>>>>>> 6d8cdfd2dd (feat(coin-module): Moving from LLC Family to Coin Module) ); path = Pods; sourceTree = ""; @@ -192,7 +179,6 @@ 13B07FB71A68108700A75B9A /* main.m */, E9558F012AF93CD200BBEB55 /* InfoPlist.strings */, E85A22C52B17E835005A8E6D /* LaunchScreen.storyboard */, - B2ADF826B67305807029EFEE /* PrivacyInfo.xcprivacy */, ); name = ledgerlivemobile; sourceTree = ""; @@ -416,7 +402,6 @@ BC26C23ED1C649E7849FF99A /* HMAlphaMono-Medium.otf in Resources */, 515E9C2C8C0049EC992210D9 /* Inter-Medium.otf in Resources */, BAE7949027D7C46A00C465F5 /* GoogleService-Info.plist in Resources */, - 53E10EBE8D058B0E732DD09B /* PrivacyInfo.xcprivacy in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -470,8 +455,6 @@ "${PODS_CONFIGURATION_BUILD_DIR}/BrazeLocation/BrazeLocation.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/BrazeUI/BrazeUI.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/EXConstants/EXConstants.bundle", - "${PODS_CONFIGURATION_BUILD_DIR}/EXConstants/ExpoConstants_privacy.bundle", - "${PODS_CONFIGURATION_BUILD_DIR}/ExpoFileSystem/ExpoFileSystem_privacy.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/GoogleDataTransport/GoogleDataTransport_Privacy.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities/GoogleUtilities_Privacy.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC/FBLPromises_Privacy.bundle", @@ -508,8 +491,6 @@ "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/BrazeLocation.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/BrazeUI.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EXConstants.bundle", - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ExpoConstants_privacy.bundle", - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ExpoFileSystem_privacy.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleDataTransport_Privacy.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleUtilities_Privacy.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FBLPromises_Privacy.bundle", @@ -602,11 +583,17 @@ ); inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-ledgerlivemobile/Pods-ledgerlivemobile-frameworks.sh", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/Flipper-DoubleConversion/double-conversion.framework/double-conversion", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/Flipper-Glog/glog.framework/glog", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL-Universal/OpenSSL.framework/OpenSSL", "${PODS_XCFRAMEWORKS_BUILD_DIR}/Storyly/Storyly.framework/Storyly", "${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/Pre-built/hermes.framework/hermes", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/double-conversion.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/glog.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OpenSSL.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Storyly.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hermes.framework", ); @@ -716,7 +703,6 @@ SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; VALID_ARCHS = "$(ARCHS_STANDARD)"; - "VALID_ARCHS[arch=*]" = "$(ARCHS_STANDARD)"; VERSIONING_SYSTEM = "apple-generic"; }; name = Debug; @@ -774,7 +760,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - CC = ""; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "c++20"; CLANG_CXX_LIBRARY = "libc++"; @@ -802,7 +787,6 @@ CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; - CXX = ""; DEVELOPMENT_TEAM = 5HK2Q4J4X4; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -822,8 +806,6 @@ INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-traditional"; INFOPLIST_PREPROCESS = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.4; - LD = ""; - LDPLUSPLUS = ""; LIBRARY_SEARCH_PATHS = ( "$(SDKROOT)/usr/lib/swift", "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", @@ -831,14 +813,8 @@ ); MTL_ENABLE_DEBUG_INFO = NO; ONLY_ACTIVE_ARCH = YES; - OTHER_CFLAGS = ( - "$(inherited)", - " ", - ); - OTHER_CPLUSPLUSFLAGS = ( - "$(inherited)", - " ", - ); + OTHER_CFLAGS = "$(inherited) "; + OTHER_CPLUSPLUSFLAGS = "$(inherited) "; OTHER_LDFLAGS = "$(inherited)"; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; @@ -901,7 +877,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - CC = ""; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "c++20"; CLANG_CXX_LIBRARY = "libc++"; @@ -929,7 +904,6 @@ CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; - CXX = ""; DEVELOPMENT_TEAM = 5HK2Q4J4X4; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -954,8 +928,6 @@ INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-traditional"; INFOPLIST_PREPROCESS = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.4; - LD = ""; - LDPLUSPLUS = ""; LIBRARY_SEARCH_PATHS = ( "$(SDKROOT)/usr/lib/swift", "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", @@ -963,14 +935,8 @@ ); MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; - OTHER_CFLAGS = ( - "$(inherited)", - " ", - ); - OTHER_CPLUSPLUSFLAGS = ( - "$(inherited)", - " ", - ); + OTHER_CFLAGS = "$(inherited) "; + OTHER_CPLUSPLUSFLAGS = "$(inherited) "; OTHER_LDFLAGS = "$(inherited)"; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; @@ -983,7 +949,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - CC = ""; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "c++20"; CLANG_CXX_LIBRARY = "libc++"; @@ -1011,7 +976,6 @@ CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; - CXX = ""; DEVELOPMENT_TEAM = 5HK2Q4J4X4; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -1031,22 +995,14 @@ INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-traditional"; INFOPLIST_PREPROCESS = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.4; - LD = ""; - LDPLUSPLUS = ""; LIBRARY_SEARCH_PATHS = ( "$(SDKROOT)/usr/lib/swift", "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", "\"$(inherited)\"", ); MTL_ENABLE_DEBUG_INFO = NO; - OTHER_CFLAGS = ( - "$(inherited)", - " ", - ); - OTHER_CPLUSPLUSFLAGS = ( - "$(inherited)", - " ", - ); + OTHER_CFLAGS = "$(inherited) "; + OTHER_CPLUSPLUSFLAGS = "$(inherited) "; OTHER_LDFLAGS = "$(inherited)"; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; @@ -1061,7 +1017,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - CC = ""; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "c++20"; CLANG_CXX_LIBRARY = "libc++"; @@ -1089,7 +1044,6 @@ CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; - CXX = ""; DEVELOPMENT_TEAM = 5HK2Q4J4X4; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -1109,22 +1063,14 @@ INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-traditional"; INFOPLIST_PREPROCESS = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.4; - LD = ""; - LDPLUSPLUS = ""; LIBRARY_SEARCH_PATHS = ( "$(SDKROOT)/usr/lib/swift", "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", "\"$(inherited)\"", ); MTL_ENABLE_DEBUG_INFO = NO; - OTHER_CFLAGS = ( - "$(inherited)", - " ", - ); - OTHER_CPLUSPLUSFLAGS = ( - "$(inherited)", - " ", - ); + OTHER_CFLAGS = "$(inherited) "; + OTHER_CPLUSPLUSFLAGS = "$(inherited) "; OTHER_LDFLAGS = "$(inherited)"; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; @@ -1137,11 +1083,7 @@ }; BB0B80022CAAB47600AF2B0C /* Nightly */ = { isa = XCBuildConfiguration; -<<<<<<< HEAD - baseConfigurationReference = B3F983E6F88EBD69A6725FF4 /* Pods-ledgerlivemobile.nightly.xcconfig */; -======= - baseConfigurationReference = A187EC82BC83E3BD9D7F3D1F /* Pods-ledgerlivemobile.nightly.xcconfig */; ->>>>>>> 6d8cdfd2dd (feat(coin-module): Moving from LLC Family to Coin Module) + baseConfigurationReference = F77638C1F4BC132FB97FEEAF /* Pods-ledgerlivemobile.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = NightlyAppIcon; CLANG_ENABLE_MODULES = YES; @@ -1192,7 +1134,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - CC = ""; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "c++20"; CLANG_CXX_LIBRARY = "libc++"; @@ -1220,7 +1161,6 @@ CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; - CXX = ""; DEVELOPMENT_TEAM = 5HK2Q4J4X4; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -1240,22 +1180,14 @@ INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-traditional"; INFOPLIST_PREPROCESS = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.4; - LD = ""; - LDPLUSPLUS = ""; LIBRARY_SEARCH_PATHS = ( "$(SDKROOT)/usr/lib/swift", "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", "\"$(inherited)\"", ); MTL_ENABLE_DEBUG_INFO = NO; - OTHER_CFLAGS = ( - "$(inherited)", - " ", - ); - OTHER_CPLUSPLUSFLAGS = ( - "$(inherited)", - " ", - ); + OTHER_CFLAGS = "$(inherited) "; + OTHER_CPLUSPLUSFLAGS = "$(inherited) "; OTHER_LDFLAGS = "$(inherited)"; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; @@ -1268,11 +1200,7 @@ }; BB2FFDA22CAD600D00AB17D8 /* Prerelease */ = { isa = XCBuildConfiguration; -<<<<<<< HEAD - baseConfigurationReference = 97FD0A4F7C8CED04EEB0A176 /* Pods-ledgerlivemobile.prerelease.xcconfig */; -======= - baseConfigurationReference = 0F3FA5B2EBC599D43E064942 /* Pods-ledgerlivemobile.prerelease.xcconfig */; ->>>>>>> 6d8cdfd2dd (feat(coin-module): Moving from LLC Family to Coin Module) + baseConfigurationReference = F77638C1F4BC132FB97FEEAF /* Pods-ledgerlivemobile.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = PrereleaseAppIcon; CLANG_ENABLE_MODULES = YES; From a1e6564fb1a27a7547a67c9fc1ab04e4d2157108 Mon Sep 17 00:00:00 2001 From: Anthony Goussot Date: Wed, 23 Oct 2024 10:24:32 +0200 Subject: [PATCH 11/20] chore(coin-vechain): remove /lib/ ib coin framework import paths --- libs/coin-modules/coin-vechain/src/account.ts | 4 ++-- .../coin-vechain/src/bridge.integration.test.ts | 2 +- libs/coin-modules/coin-vechain/src/broadcast.ts | 2 +- .../coin-vechain/src/buildOptimisticOperatioin.ts | 2 +- libs/coin-modules/coin-vechain/src/hw-getAddress.ts | 10 +++++----- libs/coin-modules/coin-vechain/src/signOperation.ts | 2 +- .../coin-vechain/src/speculos-deviceActions.ts | 4 ++-- libs/coin-modules/coin-vechain/src/synchronisation.ts | 4 ++-- libs/coin-modules/coin-vechain/src/transaction.ts | 4 ++-- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/libs/coin-modules/coin-vechain/src/account.ts b/libs/coin-modules/coin-vechain/src/account.ts index 38098420f9f2..87fa54e88f98 100644 --- a/libs/coin-modules/coin-vechain/src/account.ts +++ b/libs/coin-modules/coin-vechain/src/account.ts @@ -1,5 +1,5 @@ -import { getAccountCurrency } from "@ledgerhq/coin-framework/lib/account/index"; -import { formatCurrencyUnit } from "@ledgerhq/coin-framework/lib/currencies/index"; +import { getAccountCurrency } from "@ledgerhq/coin-framework/account/index"; +import { formatCurrencyUnit } from "@ledgerhq/coin-framework/currencies/index"; import type { Account } from "@ledgerhq/types-live"; function formatAccountSpecifics(account: Account): string { diff --git a/libs/coin-modules/coin-vechain/src/bridge.integration.test.ts b/libs/coin-modules/coin-vechain/src/bridge.integration.test.ts index 8cbfe32b06a2..dcf47f20e727 100644 --- a/libs/coin-modules/coin-vechain/src/bridge.integration.test.ts +++ b/libs/coin-modules/coin-vechain/src/bridge.integration.test.ts @@ -14,7 +14,7 @@ import { NotEnoughVTHO } from "./errors"; import { listSupportedCurrencies, setSupportedCurrencies, -} from "@ledgerhq/coin-framework/lib/currencies/index"; +} from "@ledgerhq/coin-framework/currencies/index"; import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies"; const listSupported = listSupportedCurrencies(); diff --git a/libs/coin-modules/coin-vechain/src/broadcast.ts b/libs/coin-modules/coin-vechain/src/broadcast.ts index 93a3316556ec..ee9b8789911c 100644 --- a/libs/coin-modules/coin-vechain/src/broadcast.ts +++ b/libs/coin-modules/coin-vechain/src/broadcast.ts @@ -1,6 +1,6 @@ import { Transaction as VeChainThorTransaction } from "thor-devkit"; import type { AccountBridge } from "@ledgerhq/types-live"; -import { patchOperationWithHash } from "@ledgerhq/coin-framework/lib/operation"; +import { patchOperationWithHash } from "@ledgerhq/coin-framework/operation"; import { Transaction } from "./types"; import { submit } from "./api"; diff --git a/libs/coin-modules/coin-vechain/src/buildOptimisticOperatioin.ts b/libs/coin-modules/coin-vechain/src/buildOptimisticOperatioin.ts index b83bbd83bfbc..3a4da7657f63 100644 --- a/libs/coin-modules/coin-vechain/src/buildOptimisticOperatioin.ts +++ b/libs/coin-modules/coin-vechain/src/buildOptimisticOperatioin.ts @@ -1,7 +1,7 @@ import { Account, Operation } from "@ledgerhq/types-live"; import { Transaction } from "./types"; import BigNumber from "bignumber.js"; -import { encodeOperationId } from "@ledgerhq/coin-framework/lib/operation"; +import { encodeOperationId } from "@ledgerhq/coin-framework/operation"; export const buildOptimisticOperation = async ( account: Account, diff --git a/libs/coin-modules/coin-vechain/src/hw-getAddress.ts b/libs/coin-modules/coin-vechain/src/hw-getAddress.ts index 31fd56a2f416..69c2909263c9 100644 --- a/libs/coin-modules/coin-vechain/src/hw-getAddress.ts +++ b/libs/coin-modules/coin-vechain/src/hw-getAddress.ts @@ -1,8 +1,8 @@ -import { SignerContext } from "@ledgerhq/coin-framework/lib/signer"; +import { SignerContext } from "@ledgerhq/coin-framework/signer"; import eip55 from "eip55"; import { VechainSigner } from "./signer"; -import { GetAddressFn } from "@ledgerhq/coin-framework/lib/bridge/getAddressWrapper"; -import { GetAddressOptions } from "@ledgerhq/coin-framework/lib/derivation"; +import { GetAddressFn } from "@ledgerhq/coin-framework/bridge/getAddressWrapper"; +import { GetAddressOptions } from "@ledgerhq/coin-framework/derivation"; const resolver = (signerContext: SignerContext): GetAddressFn => { return async (deviceId: string, { path, verify }: GetAddressOptions) => { @@ -12,8 +12,8 @@ const resolver = (signerContext: SignerContext): GetAddressFn => if (!sig.address || !sig.publicKey.length) throw Error(`[vechain] Response is empty ${sig.address} ${sig.publicKey}`); - - const address = eip55.encode(sig.address) + + const address = eip55.encode(sig.address); return { address, publicKey: sig.publicKey, diff --git a/libs/coin-modules/coin-vechain/src/signOperation.ts b/libs/coin-modules/coin-vechain/src/signOperation.ts index 444a22f1395d..39208be5a100 100644 --- a/libs/coin-modules/coin-vechain/src/signOperation.ts +++ b/libs/coin-modules/coin-vechain/src/signOperation.ts @@ -1,7 +1,7 @@ import { Observable } from "rxjs"; import { Transaction as ThorTransaction } from "thor-devkit"; import type { Account, AccountBridge, DeviceId, SignOperationEvent } from "@ledgerhq/types-live"; -import { SignerContext } from "@ledgerhq/coin-framework/lib/signer"; +import { SignerContext } from "@ledgerhq/coin-framework/signer"; import { buildOptimisticOperation } from "./buildOptimisticOperatioin"; import type { Transaction } from "./types"; import { VechainSigner, VechainSignature } from "./signer"; diff --git a/libs/coin-modules/coin-vechain/src/speculos-deviceActions.ts b/libs/coin-modules/coin-vechain/src/speculos-deviceActions.ts index 93b2040039f3..53a4bfd3ed2f 100644 --- a/libs/coin-modules/coin-vechain/src/speculos-deviceActions.ts +++ b/libs/coin-modules/coin-vechain/src/speculos-deviceActions.ts @@ -1,6 +1,6 @@ -import { SpeculosButton, deviceActionFlow } from "@ledgerhq/coin-framework/lib/bot/specs"; +import { SpeculosButton, deviceActionFlow } from "@ledgerhq/coin-framework/bot/specs"; import type { Transaction } from "./types"; -import { DeviceAction } from "@ledgerhq/coin-framework/lib/bot/types"; +import { DeviceAction } from "@ledgerhq/coin-framework/bot/types"; const acceptTransaction: DeviceAction = deviceActionFlow({ steps: [ diff --git a/libs/coin-modules/coin-vechain/src/synchronisation.ts b/libs/coin-modules/coin-vechain/src/synchronisation.ts index 3a5219939a82..8ad8f6b4d08f 100644 --- a/libs/coin-modules/coin-vechain/src/synchronisation.ts +++ b/libs/coin-modules/coin-vechain/src/synchronisation.ts @@ -10,7 +10,7 @@ import { import { getAccount, getLastBlockHeight, getOperations, getTokenOperations } from "./api"; import { findTokenById, getTokenById } from "@ledgerhq/cryptoassets/tokens"; import { VTHO_ADDRESS } from "./contracts/constants"; -import { GetAccountShape, makeSync, mergeOps } from "@ledgerhq/coin-framework/lib/bridge/jsHelpers"; +import { GetAccountShape, makeSync, mergeOps } from "@ledgerhq/coin-framework/bridge/jsHelpers"; import { Account } from "@ledgerhq/types-live"; export const getAccountShape: GetAccountShape = async info => { @@ -85,4 +85,4 @@ export const getAccountShape: GetAccountShape = async info => { return shape; }; -export const sync = makeSync({ getAccountShape }) \ No newline at end of file +export const sync = makeSync({ getAccountShape }); diff --git a/libs/coin-modules/coin-vechain/src/transaction.ts b/libs/coin-modules/coin-vechain/src/transaction.ts index e16ba244b133..e7bf93a39c82 100644 --- a/libs/coin-modules/coin-vechain/src/transaction.ts +++ b/libs/coin-modules/coin-vechain/src/transaction.ts @@ -1,7 +1,7 @@ -import { getAccountCurrency } from "@ledgerhq/coin-framework/lib/account/index"; +import { getAccountCurrency } from "@ledgerhq/coin-framework/account/index"; import type { Transaction, TransactionRaw, TransactionStatus, TransactionStatusRaw } from "./types"; import { formatTransactionStatus } from "@ledgerhq/coin-framework/formatters"; -import { formatCurrencyUnit } from "@ledgerhq/coin-framework/lib/currencies/index"; +import { formatCurrencyUnit } from "@ledgerhq/coin-framework/currencies/index"; import { fromTransactionCommonRaw, fromTransactionStatusRawCommon, From cf4f880d88486a0985fb070f3ebb52c046962b74 Mon Sep 17 00:00:00 2001 From: qperrot Date: Fri, 15 Nov 2024 14:57:28 +0100 Subject: [PATCH 12/20] fix: removed unused import --- libs/coin-modules/coin-vechain/jest.config.js | 2 +- libs/ledger-live-common/src/generated/bridge/js.ts | 2 -- libs/ledger-live-common/src/generated/cli-transaction.ts | 5 ----- libs/ledger-live-common/src/generated/hw-getAddress.ts | 2 -- libs/ledger-live-common/src/generated/hw-signMessage.ts | 2 -- libs/ledger-live-common/src/generated/specs.ts | 2 -- libs/ledger-live-common/src/generated/transaction.ts | 2 -- pnpm-lock.yaml | 4 ++-- 8 files changed, 3 insertions(+), 18 deletions(-) diff --git a/libs/coin-modules/coin-vechain/jest.config.js b/libs/coin-modules/coin-vechain/jest.config.js index 277979429936..f1b2df2b8018 100644 --- a/libs/coin-modules/coin-vechain/jest.config.js +++ b/libs/coin-modules/coin-vechain/jest.config.js @@ -4,5 +4,5 @@ module.exports = { coverageDirectory: "coverage", preset: "ts-jest", testEnvironment: "node", - testPathIgnorePatterns: ["lib/", "lib-es/", ".*\\.integ\\.test\\.[tj]s"], + testPathIgnorePatterns: ["lib/", "lib-es/", ".integration.test.ts"], }; diff --git a/libs/ledger-live-common/src/generated/bridge/js.ts b/libs/ledger-live-common/src/generated/bridge/js.ts index 30e69f0d3d4d..38193f9f776f 100644 --- a/libs/ledger-live-common/src/generated/bridge/js.ts +++ b/libs/ledger-live-common/src/generated/bridge/js.ts @@ -2,7 +2,6 @@ import casper from "../../families/casper/bridge/js"; import celo from "../../families/celo/bridge/js"; import crypto_org from "../../families/crypto_org/bridge/js"; import internet_computer from "../../families/internet_computer/bridge/js"; -import vechain from "../../families/vechain/bridge/js"; import { bridge as algorand } from "../../families/algorand/setup"; import { bridge as bitcoin } from "../../families/bitcoin/setup"; import { bridge as cardano } from "../../families/cardano/setup"; @@ -28,7 +27,6 @@ export default { celo, crypto_org, internet_computer, - vechain, algorand, bitcoin, cardano, diff --git a/libs/ledger-live-common/src/generated/cli-transaction.ts b/libs/ledger-live-common/src/generated/cli-transaction.ts index 7178b2f95102..02d5f8eb1ff3 100644 --- a/libs/ledger-live-common/src/generated/cli-transaction.ts +++ b/libs/ledger-live-common/src/generated/cli-transaction.ts @@ -1,9 +1,5 @@ import celo from "../families/celo/cli-transaction"; import crypto_org from "../families/crypto_org/cli-transaction"; -import vechain from "../families/vechain/cli-transaction"; -import filecoin from "../families/filecoin/cli-transaction"; -import hedera from "../families/hedera/cli-transaction"; -import stacks from "../families/stacks/cli-transaction"; import { cliTools as algorand } from "../families/algorand/setup"; import { cliTools as bitcoin } from "../families/bitcoin/setup"; import { cliTools as cardano } from "../families/cardano/setup"; @@ -27,7 +23,6 @@ import { cliTools as xrp } from "../families/xrp/setup"; export default { celo, crypto_org, - vechain, algorand, bitcoin, cardano, diff --git a/libs/ledger-live-common/src/generated/hw-getAddress.ts b/libs/ledger-live-common/src/generated/hw-getAddress.ts index 6bc8f665ba1a..acc39f116e0d 100644 --- a/libs/ledger-live-common/src/generated/hw-getAddress.ts +++ b/libs/ledger-live-common/src/generated/hw-getAddress.ts @@ -2,7 +2,6 @@ import casper from "../families/casper/hw-getAddress"; import celo from "../families/celo/hw-getAddress"; import crypto_org from "../families/crypto_org/hw-getAddress"; import internet_computer from "../families/internet_computer/hw-getAddress"; -import vechain from "../families/vechain/hw-getAddress"; import { resolver as algorand } from "../families/algorand/setup"; import { resolver as bitcoin } from "../families/bitcoin/setup"; import { resolver as cardano } from "../families/cardano/setup"; @@ -28,7 +27,6 @@ export default { celo, crypto_org, internet_computer, - vechain, algorand, bitcoin, cardano, diff --git a/libs/ledger-live-common/src/generated/hw-signMessage.ts b/libs/ledger-live-common/src/generated/hw-signMessage.ts index e062112bc823..c72976f5903c 100644 --- a/libs/ledger-live-common/src/generated/hw-signMessage.ts +++ b/libs/ledger-live-common/src/generated/hw-signMessage.ts @@ -1,6 +1,5 @@ import casper from "../families/casper/hw-signMessage"; import internet_computer from "../families/internet_computer/hw-signMessage"; -import vechain from "../families/vechain/hw-signMessage"; import { messageSigner as bitcoin } from "../families/bitcoin/setup"; import { messageSigner as evm } from "../families/evm/setup"; import { messageSigner as filecoin } from "../families/filecoin/setup"; @@ -9,7 +8,6 @@ import { messageSigner as ton } from "../families/ton/setup"; export default { casper, internet_computer, - vechain, bitcoin, evm, filecoin, diff --git a/libs/ledger-live-common/src/generated/specs.ts b/libs/ledger-live-common/src/generated/specs.ts index 884d5eef9883..9a8b0dc12629 100644 --- a/libs/ledger-live-common/src/generated/specs.ts +++ b/libs/ledger-live-common/src/generated/specs.ts @@ -2,7 +2,6 @@ import casper from "../families/casper/specs"; import celo from "../families/celo/specs"; import crypto_org from "../families/crypto_org/specs"; import internet_computer from "../families/internet_computer/specs"; -import vechain from "../families/vechain/specs"; import algorand from "@ledgerhq/coin-algorand/specs"; import bitcoin from "@ledgerhq/coin-bitcoin/specs"; import cardano from "@ledgerhq/coin-cardano/specs"; @@ -28,7 +27,6 @@ export default { celo, crypto_org, internet_computer, - vechain, algorand, bitcoin, cardano, diff --git a/libs/ledger-live-common/src/generated/transaction.ts b/libs/ledger-live-common/src/generated/transaction.ts index fd41bc74b84c..766e2199131d 100644 --- a/libs/ledger-live-common/src/generated/transaction.ts +++ b/libs/ledger-live-common/src/generated/transaction.ts @@ -2,7 +2,6 @@ import casper from "../families/casper/transaction"; import celo from "../families/celo/transaction"; import crypto_org from "../families/crypto_org/transaction"; import internet_computer from "../families/internet_computer/transaction"; -import vechain from "../families/vechain/transaction"; import algorand from "@ledgerhq/coin-algorand/transaction"; import bitcoin from "@ledgerhq/coin-bitcoin/transaction"; import cardano from "@ledgerhq/coin-cardano/transaction"; @@ -28,7 +27,6 @@ export default { celo, crypto_org, internet_computer, - vechain, algorand, bitcoin, cardano, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 56a3fab9d2dd..37c2f2b9f91f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3319,7 +3319,7 @@ importers: version: 29.5.12 '@types/lodash': specifier: ^4.14.191 - version: 4.17.4 + version: 4.17.7 bluebird: specifier: ^3.7.2 version: 3.7.2 @@ -3352,7 +3352,7 @@ importers: version: 6.0.1 ts-jest: specifier: ^29.1.1 - version: 29.1.4(jest@29.7.0)(typescript@5.4.3) + version: 29.1.5(jest@29.7.0)(typescript@5.4.3) libs/coin-modules/coin-xrp: dependencies: From ec714064639a313ede4c6a50633af1496b7eef54 Mon Sep 17 00:00:00 2001 From: qperrot Date: Fri, 15 Nov 2024 15:31:17 +0100 Subject: [PATCH 13/20] fix: lint --- .../project.pbxproj | 92 +++++++++++++++---- libs/coin-modules/coin-vechain/.eslintrc.js | 21 +---- libs/coin-modules/coin-vechain/src/api/sdk.ts | 2 +- .../src/bridge.integration.test.ts | 2 +- .../coin-vechain/src/bridge/js.ts | 1 - .../src/buildOptimisticOperatioin.ts | 2 +- libs/coin-modules/coin-vechain/src/config.ts | 2 +- .../coin-vechain/src/getTransactionStatus.ts | 2 +- libs/coin-modules/coin-vechain/src/specs.ts | 3 +- .../coin-vechain/src/utils/mapping-utils.ts | 2 +- .../src/utils/transaction-utils.ts | 2 +- .../src/families/vechain/config.ts | 2 +- .../src/families/vechain/logic.ts | 2 +- .../src/families/vechain/types.ts | 2 +- 14 files changed, 90 insertions(+), 47 deletions(-) diff --git a/apps/ledger-live-mobile/ios/ledgerlivemobile.xcodeproj/project.pbxproj b/apps/ledger-live-mobile/ios/ledgerlivemobile.xcodeproj/project.pbxproj index fca8fb2c0fac..bf405f88eb54 100644 --- a/apps/ledger-live-mobile/ios/ledgerlivemobile.xcodeproj/project.pbxproj +++ b/apps/ledger-live-mobile/ios/ledgerlivemobile.xcodeproj/project.pbxproj @@ -17,6 +17,7 @@ 2EA091AF2C3FBD5900B6181E /* GoogleService-Info-Testing.plist in Resources */ = {isa = PBXBuildFile; fileRef = 2EA091AE2C3FBD5900B6181E /* GoogleService-Info-Testing.plist */; }; 3407D5D9215D2AB800C9D40B /* NeededForBLE.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3407D5D8215D2AB800C9D40B /* NeededForBLE.swift */; }; 515E9C2C8C0049EC992210D9 /* Inter-Medium.otf in Resources */ = {isa = PBXBuildFile; fileRef = 3B6982A2E67F482A8069215B /* Inter-Medium.otf */; }; + 9DB523402249BD405124BA05 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 3FF1B576B23156C611F7B818 /* PrivacyInfo.xcprivacy */; }; AD6EE26071FA4673B5C89936 /* FontAwesome5_Pro_Brands.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 4BD106EA37CA467F9525D699 /* FontAwesome5_Pro_Brands.ttf */; }; AD7A77B84DF3487C812B091B /* FontAwesome5_Pro_Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 668E26194DD94B6D8F10D450 /* FontAwesome5_Pro_Regular.ttf */; }; B116B48438CB416C980DD0E7 /* Inter-SemiBold.otf in Resources */ = {isa = PBXBuildFile; fileRef = F3993D7FF61549FE9270BC06 /* Inter-SemiBold.otf */; }; @@ -51,17 +52,20 @@ 148B039A3EDE47A19A6BC6AE /* Feather.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Feather.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Feather.ttf"; sourceTree = ""; }; 17F58471269C64670070C475 /* RCTBluetoothHelperModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RCTBluetoothHelperModule.m; path = ledgerlivemobile/RCTBluetoothHelperModule.m; sourceTree = ""; }; 17F58473269C64870070C475 /* RCTBluetoothHelperModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RCTBluetoothHelperModule.h; path = ledgerlivemobile/RCTBluetoothHelperModule.h; sourceTree = ""; }; + 1C5AEEE0CC5135F31C3BEDA3 /* Pods-ledgerlivemobile.nightly.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ledgerlivemobile.nightly.xcconfig"; path = "Target Support Files/Pods-ledgerlivemobile/Pods-ledgerlivemobile.nightly.xcconfig"; sourceTree = ""; }; 1EA470840B7C44A3BF38FA4A /* HMAlphaMono-Medium.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "HMAlphaMono-Medium.otf"; path = "../node_modules/@ledgerhq/native-ui/lib/assets/fonts/alpha/HMAlphaMono-Medium.otf"; sourceTree = ""; }; 2402D074219C2E6600276138 /* ledgerlivemobile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = ledgerlivemobile.entitlements; path = ledgerlivemobile/ledgerlivemobile.entitlements; sourceTree = ""; }; 2433F86A66DB455E803650A5 /* Octicons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Octicons.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Octicons.ttf"; sourceTree = ""; }; 2B8A443FFF9942B295210CA2 /* Entypo.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Entypo.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Entypo.ttf"; sourceTree = ""; }; 2EA091AE2C3FBD5900B6181E /* GoogleService-Info-Testing.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info-Testing.plist"; sourceTree = ""; }; + 31305912D029BD43F91EC27C /* Pods-ledgerlivemobile.prerelease.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ledgerlivemobile.prerelease.xcconfig"; path = "Target Support Files/Pods-ledgerlivemobile/Pods-ledgerlivemobile.prerelease.xcconfig"; sourceTree = ""; }; 31C4672E151A9F9D4A18DB00 /* libPods-ledgerlivemobile.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ledgerlivemobile.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 3263CCC7104E4B86AC2ADDB4 /* MuseoSans-Regular.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "MuseoSans-Regular.otf"; path = "../assets/fonts/MuseoSans-Regular.otf"; sourceTree = ""; }; 3407D5D7215D2AB800C9D40B /* ledgerlivemobile-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ledgerlivemobile-Bridging-Header.h"; sourceTree = ""; }; 3407D5D8215D2AB800C9D40B /* NeededForBLE.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NeededForBLE.swift; sourceTree = ""; }; 3B6982A2E67F482A8069215B /* Inter-Medium.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Inter-Medium.otf"; path = "../node_modules/@ledgerhq/native-ui/lib/assets/fonts/inter/Inter-Medium.otf"; sourceTree = ""; }; 3E71666B2C4291351C2BA23C /* Pods-ledgerlivemobileTests.staging.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ledgerlivemobileTests.staging.xcconfig"; path = "Target Support Files/Pods-ledgerlivemobileTests/Pods-ledgerlivemobileTests.staging.xcconfig"; sourceTree = ""; }; + 3FF1B576B23156C611F7B818 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; name = PrivacyInfo.xcprivacy; path = ledgerlivemobile/PrivacyInfo.xcprivacy; sourceTree = ""; }; 44387CB2EE84464C83A75FD7 /* OpenSans-Regular.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "OpenSans-Regular.ttf"; path = "../assets/fonts/OpenSans-Regular.ttf"; sourceTree = ""; }; 4BD106EA37CA467F9525D699 /* FontAwesome5_Pro_Brands.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome5_Pro_Brands.ttf; path = ../assets/fonts/FontAwesome5_Pro_Brands.ttf; sourceTree = ""; }; 4C2397DC873B4F8E91B750A8 /* Inter-Regular.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Inter-Regular.otf"; path = "../assets/fonts/Inter-Regular.otf"; sourceTree = ""; }; @@ -160,6 +164,8 @@ 68139B1F4BF967461F30D471 /* Pods-ledgerlivemobile-ledgerlivemobileTests.debug.xcconfig */, A80B735599C416373F147DED /* Pods-ledgerlivemobile-ledgerlivemobileTests.release.xcconfig */, C630F76F0E1C857DA405027E /* Pods-ledgerlivemobile-ledgerlivemobileTests.staging.xcconfig */, + 1C5AEEE0CC5135F31C3BEDA3 /* Pods-ledgerlivemobile.nightly.xcconfig */, + 31305912D029BD43F91EC27C /* Pods-ledgerlivemobile.prerelease.xcconfig */, ); path = Pods; sourceTree = ""; @@ -179,6 +185,7 @@ 13B07FB71A68108700A75B9A /* main.m */, E9558F012AF93CD200BBEB55 /* InfoPlist.strings */, E85A22C52B17E835005A8E6D /* LaunchScreen.storyboard */, + 3FF1B576B23156C611F7B818 /* PrivacyInfo.xcprivacy */, ); name = ledgerlivemobile; sourceTree = ""; @@ -402,6 +409,7 @@ BC26C23ED1C649E7849FF99A /* HMAlphaMono-Medium.otf in Resources */, 515E9C2C8C0049EC992210D9 /* Inter-Medium.otf in Resources */, BAE7949027D7C46A00C465F5 /* GoogleService-Info.plist in Resources */, + 9DB523402249BD405124BA05 /* PrivacyInfo.xcprivacy in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -455,6 +463,8 @@ "${PODS_CONFIGURATION_BUILD_DIR}/BrazeLocation/BrazeLocation.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/BrazeUI/BrazeUI.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/EXConstants/EXConstants.bundle", + "${PODS_CONFIGURATION_BUILD_DIR}/EXConstants/ExpoConstants_privacy.bundle", + "${PODS_CONFIGURATION_BUILD_DIR}/ExpoFileSystem/ExpoFileSystem_privacy.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/GoogleDataTransport/GoogleDataTransport_Privacy.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities/GoogleUtilities_Privacy.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC/FBLPromises_Privacy.bundle", @@ -491,6 +501,8 @@ "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/BrazeLocation.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/BrazeUI.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EXConstants.bundle", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ExpoConstants_privacy.bundle", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ExpoFileSystem_privacy.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleDataTransport_Privacy.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleUtilities_Privacy.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FBLPromises_Privacy.bundle", @@ -583,17 +595,11 @@ ); inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-ledgerlivemobile/Pods-ledgerlivemobile-frameworks.sh", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/Flipper-DoubleConversion/double-conversion.framework/double-conversion", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/Flipper-Glog/glog.framework/glog", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL-Universal/OpenSSL.framework/OpenSSL", "${PODS_XCFRAMEWORKS_BUILD_DIR}/Storyly/Storyly.framework/Storyly", "${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/Pre-built/hermes.framework/hermes", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/double-conversion.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/glog.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OpenSSL.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Storyly.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hermes.framework", ); @@ -760,6 +766,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CC = ""; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "c++20"; CLANG_CXX_LIBRARY = "libc++"; @@ -787,6 +794,7 @@ CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; + CXX = ""; DEVELOPMENT_TEAM = 5HK2Q4J4X4; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -806,6 +814,8 @@ INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-traditional"; INFOPLIST_PREPROCESS = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.4; + LD = ""; + LDPLUSPLUS = ""; LIBRARY_SEARCH_PATHS = ( "$(SDKROOT)/usr/lib/swift", "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", @@ -813,8 +823,14 @@ ); MTL_ENABLE_DEBUG_INFO = NO; ONLY_ACTIVE_ARCH = YES; - OTHER_CFLAGS = "$(inherited) "; - OTHER_CPLUSPLUSFLAGS = "$(inherited) "; + OTHER_CFLAGS = ( + "$(inherited)", + " ", + ); + OTHER_CPLUSPLUSFLAGS = ( + "$(inherited)", + " ", + ); OTHER_LDFLAGS = "$(inherited)"; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; @@ -877,6 +893,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CC = ""; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "c++20"; CLANG_CXX_LIBRARY = "libc++"; @@ -904,6 +921,7 @@ CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; + CXX = ""; DEVELOPMENT_TEAM = 5HK2Q4J4X4; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -928,6 +946,8 @@ INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-traditional"; INFOPLIST_PREPROCESS = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.4; + LD = ""; + LDPLUSPLUS = ""; LIBRARY_SEARCH_PATHS = ( "$(SDKROOT)/usr/lib/swift", "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", @@ -935,8 +955,14 @@ ); MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; - OTHER_CFLAGS = "$(inherited) "; - OTHER_CPLUSPLUSFLAGS = "$(inherited) "; + OTHER_CFLAGS = ( + "$(inherited)", + " ", + ); + OTHER_CPLUSPLUSFLAGS = ( + "$(inherited)", + " ", + ); OTHER_LDFLAGS = "$(inherited)"; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; @@ -949,6 +975,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CC = ""; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "c++20"; CLANG_CXX_LIBRARY = "libc++"; @@ -976,6 +1003,7 @@ CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; + CXX = ""; DEVELOPMENT_TEAM = 5HK2Q4J4X4; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -995,14 +1023,22 @@ INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-traditional"; INFOPLIST_PREPROCESS = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.4; + LD = ""; + LDPLUSPLUS = ""; LIBRARY_SEARCH_PATHS = ( "$(SDKROOT)/usr/lib/swift", "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", "\"$(inherited)\"", ); MTL_ENABLE_DEBUG_INFO = NO; - OTHER_CFLAGS = "$(inherited) "; - OTHER_CPLUSPLUSFLAGS = "$(inherited) "; + OTHER_CFLAGS = ( + "$(inherited)", + " ", + ); + OTHER_CPLUSPLUSFLAGS = ( + "$(inherited)", + " ", + ); OTHER_LDFLAGS = "$(inherited)"; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; @@ -1017,6 +1053,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CC = ""; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "c++20"; CLANG_CXX_LIBRARY = "libc++"; @@ -1044,6 +1081,7 @@ CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; + CXX = ""; DEVELOPMENT_TEAM = 5HK2Q4J4X4; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -1063,14 +1101,22 @@ INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-traditional"; INFOPLIST_PREPROCESS = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.4; + LD = ""; + LDPLUSPLUS = ""; LIBRARY_SEARCH_PATHS = ( "$(SDKROOT)/usr/lib/swift", "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", "\"$(inherited)\"", ); MTL_ENABLE_DEBUG_INFO = NO; - OTHER_CFLAGS = "$(inherited) "; - OTHER_CPLUSPLUSFLAGS = "$(inherited) "; + OTHER_CFLAGS = ( + "$(inherited)", + " ", + ); + OTHER_CPLUSPLUSFLAGS = ( + "$(inherited)", + " ", + ); OTHER_LDFLAGS = "$(inherited)"; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; @@ -1083,7 +1129,7 @@ }; BB0B80022CAAB47600AF2B0C /* Nightly */ = { isa = XCBuildConfiguration; - baseConfigurationReference = F77638C1F4BC132FB97FEEAF /* Pods-ledgerlivemobile.release.xcconfig */; + baseConfigurationReference = 1C5AEEE0CC5135F31C3BEDA3 /* Pods-ledgerlivemobile.nightly.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = NightlyAppIcon; CLANG_ENABLE_MODULES = YES; @@ -1134,6 +1180,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CC = ""; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "c++20"; CLANG_CXX_LIBRARY = "libc++"; @@ -1161,6 +1208,7 @@ CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; + CXX = ""; DEVELOPMENT_TEAM = 5HK2Q4J4X4; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -1180,14 +1228,22 @@ INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-traditional"; INFOPLIST_PREPROCESS = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.4; + LD = ""; + LDPLUSPLUS = ""; LIBRARY_SEARCH_PATHS = ( "$(SDKROOT)/usr/lib/swift", "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", "\"$(inherited)\"", ); MTL_ENABLE_DEBUG_INFO = NO; - OTHER_CFLAGS = "$(inherited) "; - OTHER_CPLUSPLUSFLAGS = "$(inherited) "; + OTHER_CFLAGS = ( + "$(inherited)", + " ", + ); + OTHER_CPLUSPLUSFLAGS = ( + "$(inherited)", + " ", + ); OTHER_LDFLAGS = "$(inherited)"; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; @@ -1200,7 +1256,7 @@ }; BB2FFDA22CAD600D00AB17D8 /* Prerelease */ = { isa = XCBuildConfiguration; - baseConfigurationReference = F77638C1F4BC132FB97FEEAF /* Pods-ledgerlivemobile.release.xcconfig */; + baseConfigurationReference = 31305912D029BD43F91EC27C /* Pods-ledgerlivemobile.prerelease.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = PrereleaseAppIcon; CLANG_ENABLE_MODULES = YES; diff --git a/libs/coin-modules/coin-vechain/.eslintrc.js b/libs/coin-modules/coin-vechain/.eslintrc.js index d5820bbd4d9a..8f6848a860b9 100644 --- a/libs/coin-modules/coin-vechain/.eslintrc.js +++ b/libs/coin-modules/coin-vechain/.eslintrc.js @@ -3,13 +3,6 @@ module.exports = { browser: true, es6: true, }, - plugins: ["import"], - rules: { - "no-console": ["error", { allow: ["warn", "error"] }], - "@typescript-eslint/no-empty-function": "off", - "@typescript-eslint/explicit-function-return-type": "error", - "import/order": ["error"], - }, overrides: [ { files: ["src/**/*.test.{ts,tsx}"], @@ -18,14 +11,10 @@ module.exports = { }, plugins: ["jest"], }, - { - // allow, as warning, only any in tests - files: ["*/__tests__/**/*.{ts,tsx}"], - rules: { - "no-console": "off", - "@typescript-eslint/no-explicit-any": "warn", - "@typescript-eslint/explicit-function-return-type": "off", - }, - }, ], + rules: { + "no-console": ["error", { allow: ["warn", "error"] }], + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/no-explicit-any": "warn", + }, }; diff --git a/libs/coin-modules/coin-vechain/src/api/sdk.ts b/libs/coin-modules/coin-vechain/src/api/sdk.ts index 046233433d01..837fbb66dd75 100644 --- a/libs/coin-modules/coin-vechain/src/api/sdk.ts +++ b/libs/coin-modules/coin-vechain/src/api/sdk.ts @@ -1,3 +1,4 @@ +import BigNumber from "bignumber.js"; import network from "@ledgerhq/live-network/network"; import { AccountResponse, VetTxsQuery, TokenTxsQuery, Query, QueryResponse } from "./types"; import type { Operation } from "@ledgerhq/types-live"; @@ -7,7 +8,6 @@ import { TransferEventSignature } from "../contracts/constants"; import { Transaction } from "thor-devkit"; import { HEX_PREFIX } from "../constants"; import { getEnv } from "@ledgerhq/live-env"; -import BigNumber from "bignumber.js"; const BASE_URL = getEnv("API_VECHAIN_THOREST"); diff --git a/libs/coin-modules/coin-vechain/src/bridge.integration.test.ts b/libs/coin-modules/coin-vechain/src/bridge.integration.test.ts index dcf47f20e727..ed9c090fccbf 100644 --- a/libs/coin-modules/coin-vechain/src/bridge.integration.test.ts +++ b/libs/coin-modules/coin-vechain/src/bridge.integration.test.ts @@ -1,10 +1,10 @@ +import BigNumber from "bignumber.js"; import type { AccountRaw, DatasetTest } from "@ledgerhq/types-live"; import type { Transaction } from "./types"; import { fromTransactionRaw } from "./transaction"; import { DEFAULT_GAS_COEFFICIENT, MAINNET_CHAIN_TAG } from "./constants"; import { vechain1, vechain3 } from "./datasets/vechain"; import { generateNonce } from "./utils/transaction-utils"; -import BigNumber from "bignumber.js"; import vechainScanAccounts1 from "./datasets/vechain.scanAccounts.1"; import { AmountRequired, NotEnoughBalance } from "@ledgerhq/errors"; diff --git a/libs/coin-modules/coin-vechain/src/bridge/js.ts b/libs/coin-modules/coin-vechain/src/bridge/js.ts index 42f6a654ef36..e7961ca6c859 100644 --- a/libs/coin-modules/coin-vechain/src/bridge/js.ts +++ b/libs/coin-modules/coin-vechain/src/bridge/js.ts @@ -17,7 +17,6 @@ import resolver from "../hw-getAddress"; import { VechainCoinConfig, setCoinConfig } from "../config"; import { VechainSigner } from "../signer"; import type { Transaction } from "../types"; -import { CurrencyConfig } from "@ledgerhq/coin-framework/lib/config"; export function buildCurrencyBridge(signerContext: SignerContext): CurrencyBridge { const getAddress = resolver(signerContext); diff --git a/libs/coin-modules/coin-vechain/src/buildOptimisticOperatioin.ts b/libs/coin-modules/coin-vechain/src/buildOptimisticOperatioin.ts index 3a4da7657f63..8bcf0392364f 100644 --- a/libs/coin-modules/coin-vechain/src/buildOptimisticOperatioin.ts +++ b/libs/coin-modules/coin-vechain/src/buildOptimisticOperatioin.ts @@ -1,6 +1,6 @@ +import BigNumber from "bignumber.js"; import { Account, Operation } from "@ledgerhq/types-live"; import { Transaction } from "./types"; -import BigNumber from "bignumber.js"; import { encodeOperationId } from "@ledgerhq/coin-framework/operation"; export const buildOptimisticOperation = async ( diff --git a/libs/coin-modules/coin-vechain/src/config.ts b/libs/coin-modules/coin-vechain/src/config.ts index 4638c56d75ac..3b975cf4245f 100644 --- a/libs/coin-modules/coin-vechain/src/config.ts +++ b/libs/coin-modules/coin-vechain/src/config.ts @@ -1,7 +1,7 @@ import { CurrencyConfig, CoinConfig } from "@ledgerhq/coin-framework/config"; import { MissingCoinConfig } from "@ledgerhq/coin-framework/errors"; -export type VechainCoinConfig = () => CurrencyConfig +export type VechainCoinConfig = () => CurrencyConfig; let coinConfig: CoinConfig | undefined; diff --git a/libs/coin-modules/coin-vechain/src/getTransactionStatus.ts b/libs/coin-modules/coin-vechain/src/getTransactionStatus.ts index 0b3f20280f13..8926de5faf11 100644 --- a/libs/coin-modules/coin-vechain/src/getTransactionStatus.ts +++ b/libs/coin-modules/coin-vechain/src/getTransactionStatus.ts @@ -1,3 +1,4 @@ +import BigNumber from "bignumber.js"; import { AmountRequired, FeeNotLoaded, @@ -6,7 +7,6 @@ import { NotEnoughBalance, RecipientRequired, } from "@ledgerhq/errors"; -import BigNumber from "bignumber.js"; import { AccountBridge } from "@ledgerhq/types-live"; import { calculateTransactionInfo } from "./utils/transaction-utils"; import { isValid } from "./utils/address-utils"; diff --git a/libs/coin-modules/coin-vechain/src/specs.ts b/libs/coin-modules/coin-vechain/src/specs.ts index 32b665f7ef88..931551e4c45c 100644 --- a/libs/coin-modules/coin-vechain/src/specs.ts +++ b/libs/coin-modules/coin-vechain/src/specs.ts @@ -1,3 +1,4 @@ +import BigNumber from "bignumber.js"; import invariant from "invariant"; import expect from "expect"; import type { @@ -11,8 +12,6 @@ import type { Transaction } from "./types"; import { pickSiblings, botTest, SpeculosButton } from "@ledgerhq/coin-framework/bot/specs"; import { DeviceModelId } from "@ledgerhq/devices"; import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies"; - -import BigNumber from "bignumber.js"; import speculosDeviceActions from "./speculos-deviceActions"; const MIN_VET_TRANSACTION_AMOUNT = 1000000000000000000; diff --git a/libs/coin-modules/coin-vechain/src/utils/mapping-utils.ts b/libs/coin-modules/coin-vechain/src/utils/mapping-utils.ts index 70a242922ce8..90bf61a823de 100644 --- a/libs/coin-modules/coin-vechain/src/utils/mapping-utils.ts +++ b/libs/coin-modules/coin-vechain/src/utils/mapping-utils.ts @@ -1,6 +1,6 @@ +import BigNumber from "bignumber.js"; import vip180 from "../contracts/abis/VIP180"; import { Operation } from "@ledgerhq/types-live"; -import BigNumber from "bignumber.js"; import { EventLog, TransferLog } from "../api/types"; import { encodeOperationId } from "@ledgerhq/coin-framework/operation"; import { getFees } from "../api"; diff --git a/libs/coin-modules/coin-vechain/src/utils/transaction-utils.ts b/libs/coin-modules/coin-vechain/src/utils/transaction-utils.ts index 4533d8c0bd5f..92165bd18fea 100644 --- a/libs/coin-modules/coin-vechain/src/utils/transaction-utils.ts +++ b/libs/coin-modules/coin-vechain/src/utils/transaction-utils.ts @@ -1,6 +1,6 @@ +import BigNumber from "bignumber.js"; import { DEFAULT_GAS_COEFFICIENT, HEX_PREFIX } from "../constants"; import crypto from "crypto"; -import BigNumber from "bignumber.js"; import { Transaction as ThorTransaction } from "thor-devkit"; import params from "../contracts/abis/params"; import { BASE_GAS_PRICE_KEY, PARAMS_ADDRESS } from "../contracts/constants"; diff --git a/libs/ledger-live-common/src/families/vechain/config.ts b/libs/ledger-live-common/src/families/vechain/config.ts index 37ce86f86b7c..6c096f4a2f21 100644 --- a/libs/ledger-live-common/src/families/vechain/config.ts +++ b/libs/ledger-live-common/src/families/vechain/config.ts @@ -12,4 +12,4 @@ const vechainConfig: CurrencyLiveConfigDefinition = { }, }; -export { vechainConfig }; \ No newline at end of file +export { vechainConfig }; diff --git a/libs/ledger-live-common/src/families/vechain/logic.ts b/libs/ledger-live-common/src/families/vechain/logic.ts index 22caf8451ee2..24a61a08c84e 100644 --- a/libs/ledger-live-common/src/families/vechain/logic.ts +++ b/libs/ledger-live-common/src/families/vechain/logic.ts @@ -1,2 +1,2 @@ // Encapsulate for LLD and LLM -export * from "@ledgerhq/coin-vechain/logic"; \ No newline at end of file +export * from "@ledgerhq/coin-vechain/logic"; diff --git a/libs/ledger-live-common/src/families/vechain/types.ts b/libs/ledger-live-common/src/families/vechain/types.ts index 950888f51a32..bd6719aca78b 100644 --- a/libs/ledger-live-common/src/families/vechain/types.ts +++ b/libs/ledger-live-common/src/families/vechain/types.ts @@ -1,2 +1,2 @@ // Encapsulate for LLD and LLM -export * from "@ledgerhq/coin-vechain/types"; \ No newline at end of file +export * from "@ledgerhq/coin-vechain/types"; From f0254b52c36aa67c55e16c8a7cffbd9c3b7faed4 Mon Sep 17 00:00:00 2001 From: qperrot Date: Fri, 15 Nov 2024 16:03:38 +0100 Subject: [PATCH 14/20] fix: unimportedrc and package --- libs/ledger-live-common/.unimportedrc.json | 2 ++ libs/ledger-live-common/package.json | 1 - pnpm-lock.yaml | 3 --- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/libs/ledger-live-common/.unimportedrc.json b/libs/ledger-live-common/.unimportedrc.json index 26ea041ee3b9..75d116e839b0 100644 --- a/libs/ledger-live-common/.unimportedrc.json +++ b/libs/ledger-live-common/.unimportedrc.json @@ -132,6 +132,8 @@ "src/families/tezos/types.ts", "src/families/tron/react.ts", "src/families/tron/types.ts", + "src/families/vechain/logic.ts", + "src/families/vechain/types.ts", "src/families/xrp/types.ts", "src/featureFlags/FeatureFlagsContext.ts", "src/featureFlags/groupedFeatures.ts", diff --git a/libs/ledger-live-common/package.json b/libs/ledger-live-common/package.json index db460c143845..218d8a70fd34 100644 --- a/libs/ledger-live-common/package.json +++ b/libs/ledger-live-common/package.json @@ -217,7 +217,6 @@ "bs58": "^4.0.1", "casper-js-sdk": "^2.15.2", "date-fns": "^2.23.0", - "eip55": "^2.1.1", "expect": "^27.4.6", "fuse.js": "^6.6.2", "invariant": "^2.2.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 37c2f2b9f91f..6767a15b206c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4111,9 +4111,6 @@ importers: date-fns: specifier: ^2.23.0 version: 2.30.0 - eip55: - specifier: ^2.1.1 - version: 2.1.1 expect: specifier: ^27.4.6 version: 27.5.1 From d294b572a0cc0e4788f13811cfc353780bb360a1 Mon Sep 17 00:00:00 2001 From: qperrot Date: Fri, 15 Nov 2024 16:52:49 +0100 Subject: [PATCH 15/20] fix: update unimportedrc an package coin module vechain --- .../coin-vechain/.unimportedrc.json | 34 +++++++--- libs/coin-modules/coin-vechain/package.json | 11 ---- pnpm-lock.yaml | 62 ------------------- 3 files changed, 27 insertions(+), 80 deletions(-) diff --git a/libs/coin-modules/coin-vechain/.unimportedrc.json b/libs/coin-modules/coin-vechain/.unimportedrc.json index 56f6747c5715..e384829f9653 100644 --- a/libs/coin-modules/coin-vechain/.unimportedrc.json +++ b/libs/coin-modules/coin-vechain/.unimportedrc.json @@ -15,19 +15,39 @@ ], "ignoreUnresolved": [], "ignoreUnimported": [ - "src/bridge/index.ts", + "src/account.ts", + "src/api/index.ts", + "src/api/sdk.ts", + "src/api/types.ts", + "src/bridge/js.ts", "src/broadcast.ts", - "src/buildOptimisticOperation.ts", - "src/buildTransaction.ts", - "src/cli.ts", + "src/buildOptimisticOperatioin.ts", + "src/cli-transaction.ts", "src/config.ts", + "src/constants.ts", + "src/contracts/abis/VIP180.ts", + "src/contracts/abis/params.ts", + "src/contracts/constants.ts", "src/createTransaction.ts", + "src/datasets/vechain.scanAccounts.1.ts", + "src/datasets/vechain.ts", "src/estimateMaxSpendable.ts", "src/getTransactionStatus.ts", + "src/logic.ts", + "src/mock.ts", "src/prepareTransaction.ts", "src/signOperation.ts", - "src/synchronization.ts", - "src/tokens.ts" + "src/synchronisation.ts", + "src/utils/address-utils.ts", + "src/utils/hex-utils.ts", + "src/utils/mapping-utils.ts", + "src/utils/pad-address.ts", + "src/utils/transaction-utils.ts" ], - "ignoreUnused": ["rxjs"] + "ignoreUnused": [ + "@ledgerhq/live-env", + "@ledgerhq/live-network", + "lodash", + "rxjs" + ] } diff --git a/libs/coin-modules/coin-vechain/package.json b/libs/coin-modules/coin-vechain/package.json index 24edc6bb053b..631d457a2fff 100644 --- a/libs/coin-modules/coin-vechain/package.json +++ b/libs/coin-modules/coin-vechain/package.json @@ -61,23 +61,13 @@ "@ledgerhq/cryptoassets": "workspace:^", "@ledgerhq/devices": "workspace:^", "@ledgerhq/errors": "workspace:^", - "@ledgerhq/evm-tools": "workspace:^", - "@ledgerhq/hw-app-vet": "workspace:^", - "@ledgerhq/hw-transport": "^6.31.2", - "@ledgerhq/live-config": "^3.0.0", "@ledgerhq/live-env": "workspace:^", "@ledgerhq/live-network": "workspace:^", - "@ledgerhq/live-promise": "workspace:^", - "@ledgerhq/logs": "workspace:^", - "axios": "0.26.1", "bignumber.js": "^9.1.2", "eip55": "^2.1.1", - "ethers": "5.7.2", "expect": "^27.4.6", - "imurmurhash": "^0.1.4", "invariant": "^2.2.2", "lodash": "^4.17.21", - "react-native-get-random-values": "^1.8.0", "rxjs": "^7.8.1", "thor-devkit": "^2.0.6" }, @@ -86,7 +76,6 @@ "@ledgerhq/types-cryptoassets": "workspace:^", "@ledgerhq/types-live": "workspace:^", "@types/bluebird": "^3.5.42", - "@types/imurmurhash": "^0.1.4", "@types/invariant": "^2.2.2", "@types/jest": "^29.5.10", "@types/lodash": "^4.14.191", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6767a15b206c..ffba4f975b38 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3238,57 +3238,27 @@ importers: '@ledgerhq/errors': specifier: workspace:^ version: link:../../ledgerjs/packages/errors - '@ledgerhq/evm-tools': - specifier: workspace:^ - version: link:../../evm-tools - '@ledgerhq/hw-app-vet': - specifier: workspace:^ - version: link:../../ledgerjs/packages/hw-app-vet - '@ledgerhq/hw-transport': - specifier: ^6.31.2 - version: 6.31.2 - '@ledgerhq/live-config': - specifier: ^3.0.0 - version: 3.0.0 '@ledgerhq/live-env': specifier: workspace:^ version: link:../../env '@ledgerhq/live-network': specifier: workspace:^ version: link:../../live-network - '@ledgerhq/live-promise': - specifier: workspace:^ - version: link:../../promise - '@ledgerhq/logs': - specifier: workspace:^ - version: link:../../ledgerjs/packages/logs - axios: - specifier: 0.26.1 - version: 0.26.1 bignumber.js: specifier: ^9.1.2 version: 9.1.2 eip55: specifier: ^2.1.1 version: 2.1.1 - ethers: - specifier: 5.7.2 - version: 5.7.2 expect: specifier: ^27.4.6 version: 27.5.1 - imurmurhash: - specifier: ^0.1.4 - version: 0.1.4 invariant: specifier: ^2.2.2 version: 2.2.4 lodash: specifier: ^4.17.21 version: 4.17.21 - react-native-get-random-values: - specifier: ^1.8.0 - version: 1.11.0 rxjs: specifier: ^7.8.1 version: 7.8.1 @@ -3308,9 +3278,6 @@ importers: '@types/bluebird': specifier: ^3.5.42 version: 3.5.42 - '@types/imurmurhash': - specifier: ^0.1.4 - version: 0.1.4 '@types/invariant': specifier: ^2.2.2 version: 2.2.37 @@ -10996,9 +10963,6 @@ packages: '@ledgerhq/errors@5.50.0': resolution: {integrity: sha512-gu6aJ/BHuRlpU7kgVpy2vcYk6atjB4iauP2ymF7Gk0ez0Y/6VSMVSJvubeEQN+IV60+OBK0JgeIZG7OiHaw8ow==} - '@ledgerhq/errors@6.18.0': - resolution: {integrity: sha512-L3jQWAGyooxRDk/MRlW2v4Ji9+kloBtdmz9wBkHaj2j0n+05rweJSV3GHw9oye1BYMbVFqFffmT4H3hlXlCasw==} - '@ledgerhq/errors@6.19.1': resolution: {integrity: sha512-75yK7Nnit/Gp7gdrJAz0ipp31CCgncRp+evWt6QawQEtQKYEDfGo10QywgrrBBixeRxwnMy1DP6g2oCWRf1bjw==} @@ -11024,9 +10988,6 @@ packages: '@ledgerhq/hw-transport@6.30.6': resolution: {integrity: sha512-fT0Z4IywiuJuZrZE/+W0blkV5UCotDPFTYKLkKCLzYzuE6javva7D/ajRaIeR+hZ4kTmKF4EqnsmDCXwElez+w==} - '@ledgerhq/hw-transport@6.31.2': - resolution: {integrity: sha512-B27UIzMzm2IXPGYnEB95R7eHxpXBkTBHh6MUJJQZVknt8LilEz1tfpTYUdzAKDGQ+Z5MZyYb01Eh3Zqm3kn3uw==} - '@ledgerhq/hw-transport@6.31.3': resolution: {integrity: sha512-rFplkHWF5NXtlYwAusqLlMu298NHtRD+2q/jrTYc//uu/xJO9LkDIgKid6IVF2+e1Wj7yX6YQVrU6L0Yu1ntEw==} @@ -11048,9 +11009,6 @@ packages: '@ledgerhq/live-app-sdk@0.8.2': resolution: {integrity: sha512-yD+L02pAwTfjeSyixWkfqlh6Xg3yAGFnFitrcHk2WWUtKg1TVmNpWNHLS22LKYYWJ7Lflj/pLLQ0nKm1OsJB9g==} - '@ledgerhq/live-config@3.0.0': - resolution: {integrity: sha512-iisns2TFXHLPAYAgpXF/wggvcSscPaxZnMgixRsZho35tL0Dap4hhIT/35f3VuYS/dKDmahTrNjJzeIYEDJ7/Q==} - '@ledgerhq/logs@5.50.0': resolution: {integrity: sha512-swKHYCOZUGyVt4ge0u8a7AwNcA//h4nx5wIi0sruGye1IJ5Cva0GyK9L2/WdX+kWVTKp92ZiEo1df31lrWGPgA==} @@ -16656,9 +16614,6 @@ packages: axios@0.24.0: resolution: {integrity: sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==} - axios@0.26.1: - resolution: {integrity: sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==} - axios@1.7.7: resolution: {integrity: sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==} @@ -36181,8 +36136,6 @@ snapshots: '@ledgerhq/errors@5.50.0': {} - '@ledgerhq/errors@6.18.0': {} - '@ledgerhq/errors@6.19.1': {} '@ledgerhq/hw-app-eth@5.11.0': @@ -36228,13 +36181,6 @@ snapshots: '@ledgerhq/logs': 6.12.0 events: 3.3.0 - '@ledgerhq/hw-transport@6.31.2': - dependencies: - '@ledgerhq/devices': link:libs/ledgerjs/packages/devices - '@ledgerhq/errors': 6.18.0 - '@ledgerhq/logs': 6.12.0 - events: 3.3.0 - '@ledgerhq/hw-transport@6.31.3': dependencies: '@ledgerhq/devices': link:libs/ledgerjs/packages/devices @@ -36262,10 +36208,6 @@ snapshots: bignumber.js: 9.1.2 json-rpc-2.0: 1.7.0 - '@ledgerhq/live-config@3.0.0': - dependencies: - lodash: 4.17.21 - '@ledgerhq/logs@5.50.0': {} '@ledgerhq/logs@6.12.0': {} @@ -45321,10 +45263,6 @@ snapshots: dependencies: follow-redirects: 1.15.6 - axios@0.26.1: - dependencies: - follow-redirects: 1.15.6 - axios@1.7.7: dependencies: follow-redirects: 1.15.6 From 631a454062b9d231dcb7f0e1b8b71ed599a1c588 Mon Sep 17 00:00:00 2001 From: qperrot Date: Mon, 18 Nov 2024 11:06:46 +0100 Subject: [PATCH 16/20] fix: start separate in folders --- libs/coin-modules/coin-vechain/package.json | 30 ++ .../src/bridge.integration.test.ts | 261 ----------------- .../src/{ => bridge}/broadcast.ts | 4 +- .../{ => bridge}/buildOptimisticOperatioin.ts | 2 +- .../src/{ => bridge}/createTransaction.ts | 5 +- .../src/{ => bridge}/estimateMaxSpendable.ts | 4 +- .../src/{ => bridge}/getTransactionStatus.ts | 7 +- .../src/bridge/{js.ts => index.ts} | 24 +- .../src/{ => bridge}/prepareTransaction.ts | 13 +- .../src/{ => bridge}/signOperation.ts | 7 +- .../src/{ => bridge}/synchronisation.ts | 8 +- .../src/{ => bridge}/transaction.ts | 7 +- .../{utils => common-logic}/address-utils.ts | 0 .../src/{utils => common-logic}/hex-utils.ts | 0 .../coin-vechain/src/common-logic/index.ts | 6 + .../src/{ => common-logic}/logic.ts | 6 +- .../{utils => common-logic}/mapping-utils.ts | 4 +- .../{utils => common-logic}/pad-address.ts | 0 .../transaction-utils.ts | 9 +- .../coin-vechain/src/datasets/index.ts | 2 + .../src/{api => network}/index.ts | 0 .../coin-vechain/src/{api => network}/sdk.ts | 11 +- .../getAddress.ts} | 2 +- .../coin-vechain/src/signer/index.ts | 2 + .../bot-deviceActions.ts} | 2 +- .../src/{specs.ts => test/bot-specs.ts} | 4 +- .../src/test/bridgeDatasetTest.ts | 262 ++++++++++++++++++ .../src/{cli-transaction.ts => test/cli.ts} | 8 +- .../coin-vechain/src/test/index.ts | 6 + .../src/{types.ts => types/bridge.ts} | 0 .../coin-vechain/src/{ => types}/constants.ts | 0 .../coin-vechain/src/types/index.ts | 4 + .../src/{api/types.ts => types/network.ts} | 0 .../coin-vechain/src/{ => types}/signer.ts | 0 .../vechain/bridge.integration.test.ts | 6 +- .../src/families/vechain/setup.ts | 9 +- .../src/families/vechain/types.ts | 2 +- .../ledger-live-common/src/generated/types.ts | 2 +- 38 files changed, 387 insertions(+), 332 deletions(-) delete mode 100644 libs/coin-modules/coin-vechain/src/bridge.integration.test.ts rename libs/coin-modules/coin-vechain/src/{ => bridge}/broadcast.ts (89%) rename libs/coin-modules/coin-vechain/src/{ => bridge}/buildOptimisticOperatioin.ts (97%) rename libs/coin-modules/coin-vechain/src/{ => bridge}/createTransaction.ts (79%) rename libs/coin-modules/coin-vechain/src/{ => bridge}/estimateMaxSpendable.ts (84%) rename libs/coin-modules/coin-vechain/src/{ => bridge}/getTransactionStatus.ts (90%) rename libs/coin-modules/coin-vechain/src/bridge/{js.ts => index.ts} (72%) rename libs/coin-modules/coin-vechain/src/{ => bridge}/prepareTransaction.ts (79%) rename libs/coin-modules/coin-vechain/src/{ => bridge}/signOperation.ts (88%) rename libs/coin-modules/coin-vechain/src/{ => bridge}/synchronisation.ts (92%) rename libs/coin-modules/coin-vechain/src/{ => bridge}/transaction.ts (94%) rename libs/coin-modules/coin-vechain/src/{utils => common-logic}/address-utils.ts (100%) rename libs/coin-modules/coin-vechain/src/{utils => common-logic}/hex-utils.ts (100%) create mode 100644 libs/coin-modules/coin-vechain/src/common-logic/index.ts rename libs/coin-modules/coin-vechain/src/{ => common-logic}/logic.ts (88%) rename libs/coin-modules/coin-vechain/src/{utils => common-logic}/mapping-utils.ts (95%) rename libs/coin-modules/coin-vechain/src/{utils => common-logic}/pad-address.ts (100%) rename libs/coin-modules/coin-vechain/src/{utils => common-logic}/transaction-utils.ts (95%) create mode 100644 libs/coin-modules/coin-vechain/src/datasets/index.ts rename libs/coin-modules/coin-vechain/src/{api => network}/index.ts (100%) rename libs/coin-modules/coin-vechain/src/{api => network}/sdk.ts (94%) rename libs/coin-modules/coin-vechain/src/{hw-getAddress.ts => signer/getAddress.ts} (95%) create mode 100644 libs/coin-modules/coin-vechain/src/signer/index.ts rename libs/coin-modules/coin-vechain/src/{speculos-deviceActions.ts => test/bot-deviceActions.ts} (93%) rename libs/coin-modules/coin-vechain/src/{specs.ts => test/bot-specs.ts} (98%) create mode 100644 libs/coin-modules/coin-vechain/src/test/bridgeDatasetTest.ts rename libs/coin-modules/coin-vechain/src/{cli-transaction.ts => test/cli.ts} (92%) create mode 100644 libs/coin-modules/coin-vechain/src/test/index.ts rename libs/coin-modules/coin-vechain/src/{types.ts => types/bridge.ts} (100%) rename libs/coin-modules/coin-vechain/src/{ => types}/constants.ts (100%) create mode 100644 libs/coin-modules/coin-vechain/src/types/index.ts rename libs/coin-modules/coin-vechain/src/{api/types.ts => types/network.ts} (100%) rename libs/coin-modules/coin-vechain/src/{ => types}/signer.ts (100%) diff --git a/libs/coin-modules/coin-vechain/package.json b/libs/coin-modules/coin-vechain/package.json index 631d457a2fff..b8bba230aa89 100644 --- a/libs/coin-modules/coin-vechain/package.json +++ b/libs/coin-modules/coin-vechain/package.json @@ -6,6 +6,8 @@ "Ledger", "LedgerWallet", "VeChain", + "vet", + "vtho", "Hardware Wallet" ], "repository": { @@ -35,10 +37,38 @@ "exports": { "./lib/*": "./lib/*.js", "./lib-es/*": "./lib-es/*.js", + "./logic": { + "require": "./lib/common-logic/index.js", + "default": "./lib-es/common-logic/index.js" + }, + "./network": { + "require": "./lib/network/index.js", + "default": "./lib-es/network/index.js" + }, + "./signer": { + "require": "./lib/signer/index.js", + "default": "./lib-es/signer/index.js" + }, + "./specs": { + "require": "./lib/test/bot-specs.js", + "default": "./lib-es/test/bot-specs.js" + }, + "./transaction": { + "require": "./lib/bridge/transaction.js", + "default": "./lib-es/bridge/transaction.js" + }, + "./types": { + "require": "./lib/types/index.js", + "default": "./lib-es/types/index.js" + }, "./*": { "require": "./lib/*.js", "default": "./lib-es/*.js" }, + ".": { + "require": "./lib/index.js", + "default": "./lib-es/index.js" + }, "./package.json": "./package.json" }, "license": "Apache-2.0", diff --git a/libs/coin-modules/coin-vechain/src/bridge.integration.test.ts b/libs/coin-modules/coin-vechain/src/bridge.integration.test.ts deleted file mode 100644 index ed9c090fccbf..000000000000 --- a/libs/coin-modules/coin-vechain/src/bridge.integration.test.ts +++ /dev/null @@ -1,261 +0,0 @@ -import BigNumber from "bignumber.js"; -import type { AccountRaw, DatasetTest } from "@ledgerhq/types-live"; -import type { Transaction } from "./types"; -import { fromTransactionRaw } from "./transaction"; -import { DEFAULT_GAS_COEFFICIENT, MAINNET_CHAIN_TAG } from "./constants"; -import { vechain1, vechain3 } from "./datasets/vechain"; -import { generateNonce } from "./utils/transaction-utils"; - -import vechainScanAccounts1 from "./datasets/vechain.scanAccounts.1"; -import { AmountRequired, NotEnoughBalance } from "@ledgerhq/errors"; -import VIP180 from "./contracts/abis/VIP180"; -import { CryptoCurrencyId } from "@ledgerhq/types-cryptoassets"; -import { NotEnoughVTHO } from "./errors"; -import { - listSupportedCurrencies, - setSupportedCurrencies, -} from "@ledgerhq/coin-framework/currencies/index"; -import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies"; - -const listSupported = listSupportedCurrencies(); -listSupported.push(getCryptoCurrencyById("vechain")); -setSupportedCurrencies(listSupported.map(c => c.id) as CryptoCurrencyId[]); - -const dataset: DatasetTest = { - implementations: ["js", "mock"], - currencies: { - vechain: { - FIXME_ignoreAccountFields: ["balance", "spendableBalance", "estimateMaxSpendable"], // the balance depends on VTHO and it's earned without operations - scanAccounts: vechainScanAccounts1, - - accounts: [ - { - raw: vechain1 as AccountRaw, - transactions: [ - { - name: "Send VET", - transaction: fromTransactionRaw({ - family: "vechain", - estimatedFees: "210000000000000000", - recipient: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", - amount: "1000000000000000000", - body: { - chainTag: MAINNET_CHAIN_TAG, - blockRef: "0x00634a0c856ec1db", - expiration: 18, - clauses: [ - { - to: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", - value: "1000000000000000000", - data: "0x", - }, - ], - gasPriceCoef: DEFAULT_GAS_COEFFICIENT, - gas: "0", - dependsOn: null, - nonce: generateNonce(), - }, - }), - expectedStatus: { - amount: new BigNumber("1000000000000000000"), - estimatedFees: new BigNumber("210000000000000000"), - totalSpent: new BigNumber("1000000000000000000"), - errors: {}, - warnings: {}, - }, - }, - { - name: "Send VTHO", - transaction: fromTransactionRaw({ - family: "vechain", - subAccountId: - "js:2:vechain:0x0fe6688548f0C303932bB197B0A96034f1d74dba:vechain+vechain%2Fvip180%2Fvtho", - estimatedFees: "515180000000000000", - recipient: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", - amount: "1000000000000000000", - body: { - chainTag: MAINNET_CHAIN_TAG, - blockRef: "0x00634a0c856ec1db", - expiration: 18, - clauses: [ - { - to: "0x0000000000000000000000000000456e65726779", - value: 0, - data: VIP180.transfer.encode( - "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", - "9000000000000000000", - ), - }, - ], - gasPriceCoef: DEFAULT_GAS_COEFFICIENT, - gas: "0", - dependsOn: null, - nonce: generateNonce(), - }, - }), - expectedStatus: { - amount: new BigNumber("1000000000000000000"), - estimatedFees: new BigNumber("515180000000000000"), - totalSpent: new BigNumber("1515180000000000000"), - errors: {}, - warnings: {}, - }, - }, - { - name: "Amount required", - transaction: fromTransactionRaw({ - family: "vechain", - estimatedFees: "0", - recipient: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", - amount: "", - body: { - chainTag: MAINNET_CHAIN_TAG, - blockRef: "0x00634a0c856ec1db", - expiration: 18, - clauses: [{ to: "", value: 0, data: "0x" }], - gasPriceCoef: DEFAULT_GAS_COEFFICIENT, - gas: "0", - dependsOn: null, - nonce: generateNonce(), - }, - }), - expectedStatus: { - errors: { - amount: new AmountRequired(), - }, - warnings: {}, - }, - }, - { - name: "VET balance not enough", - transaction: fromTransactionRaw({ - family: "vechain", - estimatedFees: "210000000000000000", - recipient: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", - amount: "20000000000000000000", - body: { - chainTag: MAINNET_CHAIN_TAG, - blockRef: "0x00634a0c856ec1db", - expiration: 18, - clauses: [ - { - to: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", - value: "20000000000000000000", - data: "0x", - }, - ], - gasPriceCoef: DEFAULT_GAS_COEFFICIENT, - gas: "0", - dependsOn: null, - nonce: generateNonce(), - }, - }), - expectedStatus: { - amount: new BigNumber("20000000000000000000"), - errors: { - amount: new NotEnoughBalance(), - }, - warnings: {}, - totalSpent: new BigNumber("20000000000000000000"), - estimatedFees: new BigNumber("210000000000000000"), - }, - }, - { - name: "VTHO balance not enough", - transaction: fromTransactionRaw({ - family: "vechain", - subAccountId: - "js:2:vechain:0x0fe6688548f0C303932bB197B0A96034f1d74dba:vechain+vechain%2Fvip180%2Fvtho", - estimatedFees: "515820000000000000", - recipient: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", - amount: "20000000000000000000", - body: { - chainTag: MAINNET_CHAIN_TAG, - blockRef: "0x00634a0c856ec1db", - expiration: 18, - clauses: [ - { - to: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", - value: "20000000000000000000", - data: "0x", - }, - ], - gasPriceCoef: DEFAULT_GAS_COEFFICIENT, - gas: "0", - dependsOn: null, - nonce: generateNonce(), - }, - }), - expectedStatus: { - amount: new BigNumber("20000000000000000000"), - errors: { - amount: new NotEnoughBalance(), - }, - warnings: {}, - totalSpent: new BigNumber("20515820000000000000"), - estimatedFees: new BigNumber("515820000000000000"), - }, - }, - ], - FIXME_tests: [ - "balance is sum of ops", // the balance depends on VTHO and it's earned without operations - "empty transaction is equals to itself", //nonce is not deterministic - "ref stability on self transaction", //blockref is not deterministic - "can be run in parallel and all yield same results", //blockref is not deterministic - ], - }, - { - raw: vechain3 as AccountRaw, - transactions: [ - { - name: "Not enough VTHO to pay fees", - transaction: fromTransactionRaw({ - family: "vechain", - estimatedFees: "210000000000000000", - recipient: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", - amount: "1000000000000000000", - body: { - chainTag: MAINNET_CHAIN_TAG, - blockRef: "0x00634a0c856ec1db", - expiration: 18, - clauses: [ - { - to: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", - value: "1000000000000000000", - data: "0x", - }, - ], - gasPriceCoef: DEFAULT_GAS_COEFFICIENT, - gas: "0", - dependsOn: null, - nonce: generateNonce(), - }, - }), - expectedStatus: { - amount: new BigNumber("1000000000000000000"), - estimatedFees: new BigNumber("210000000000000000"), - totalSpent: new BigNumber("1000000000000000000"), - errors: { - amount: new NotEnoughVTHO(), - }, - warnings: {}, - }, - }, - ], - FIXME_tests: [ - "balance is sum of ops", // the balance depends on VTHO and it's earned without operations - "empty transaction is equals to itself", //nonce is not deterministic - "ref stability on self transaction", //blockref is not deterministic - "can be run in parallel and all yield same results", //blockref is not deterministic - ], - }, - ], - }, - }, -}; - -describe("VeChain Bridge", () => { - test.todo("sample test"); -}); - -export default dataset; diff --git a/libs/coin-modules/coin-vechain/src/broadcast.ts b/libs/coin-modules/coin-vechain/src/bridge/broadcast.ts similarity index 89% rename from libs/coin-modules/coin-vechain/src/broadcast.ts rename to libs/coin-modules/coin-vechain/src/bridge/broadcast.ts index ee9b8789911c..3909ff4863e6 100644 --- a/libs/coin-modules/coin-vechain/src/broadcast.ts +++ b/libs/coin-modules/coin-vechain/src/bridge/broadcast.ts @@ -2,8 +2,8 @@ import { Transaction as VeChainThorTransaction } from "thor-devkit"; import type { AccountBridge } from "@ledgerhq/types-live"; import { patchOperationWithHash } from "@ledgerhq/coin-framework/operation"; -import { Transaction } from "./types"; -import { submit } from "./api"; +import { Transaction } from "../types"; +import { submit } from "../network"; /** * Broadcast the signed transaction diff --git a/libs/coin-modules/coin-vechain/src/buildOptimisticOperatioin.ts b/libs/coin-modules/coin-vechain/src/bridge/buildOptimisticOperatioin.ts similarity index 97% rename from libs/coin-modules/coin-vechain/src/buildOptimisticOperatioin.ts rename to libs/coin-modules/coin-vechain/src/bridge/buildOptimisticOperatioin.ts index 8bcf0392364f..44ba5fcfd68d 100644 --- a/libs/coin-modules/coin-vechain/src/buildOptimisticOperatioin.ts +++ b/libs/coin-modules/coin-vechain/src/bridge/buildOptimisticOperatioin.ts @@ -1,6 +1,6 @@ import BigNumber from "bignumber.js"; import { Account, Operation } from "@ledgerhq/types-live"; -import { Transaction } from "./types"; +import { Transaction } from "../types"; import { encodeOperationId } from "@ledgerhq/coin-framework/operation"; export const buildOptimisticOperation = async ( diff --git a/libs/coin-modules/coin-vechain/src/createTransaction.ts b/libs/coin-modules/coin-vechain/src/bridge/createTransaction.ts similarity index 79% rename from libs/coin-modules/coin-vechain/src/createTransaction.ts rename to libs/coin-modules/coin-vechain/src/bridge/createTransaction.ts index 785a096fa017..898aedb8c958 100644 --- a/libs/coin-modules/coin-vechain/src/createTransaction.ts +++ b/libs/coin-modules/coin-vechain/src/bridge/createTransaction.ts @@ -1,8 +1,7 @@ import BigNumber from "bignumber.js"; import { AccountBridge } from "@ledgerhq/types-live"; -import { DEFAULT_GAS_COEFFICIENT, MAINNET_CHAIN_TAG } from "./constants"; -import { generateNonce } from "./utils/transaction-utils"; -import { Transaction } from "./types"; +import { generateNonce } from "../common-logic"; +import { Transaction, DEFAULT_GAS_COEFFICIENT, MAINNET_CHAIN_TAG } from "../types"; /** * Create an empty VET or VTHO transaction diff --git a/libs/coin-modules/coin-vechain/src/estimateMaxSpendable.ts b/libs/coin-modules/coin-vechain/src/bridge/estimateMaxSpendable.ts similarity index 84% rename from libs/coin-modules/coin-vechain/src/estimateMaxSpendable.ts rename to libs/coin-modules/coin-vechain/src/bridge/estimateMaxSpendable.ts index bf6eb66d9b14..afe3c5cd7c30 100644 --- a/libs/coin-modules/coin-vechain/src/estimateMaxSpendable.ts +++ b/libs/coin-modules/coin-vechain/src/bridge/estimateMaxSpendable.ts @@ -1,7 +1,7 @@ import BigNumber from "bignumber.js"; import { AccountBridge } from "@ledgerhq/types-live"; -import { calculateGasFees } from "./utils/transaction-utils"; -import type { Transaction } from "./types"; +import { calculateGasFees } from "../common-logic"; +import type { Transaction } from "../types"; export const estimateMaxSpendable: AccountBridge["estimateMaxSpendable"] = async ({ account, diff --git a/libs/coin-modules/coin-vechain/src/getTransactionStatus.ts b/libs/coin-modules/coin-vechain/src/bridge/getTransactionStatus.ts similarity index 90% rename from libs/coin-modules/coin-vechain/src/getTransactionStatus.ts rename to libs/coin-modules/coin-vechain/src/bridge/getTransactionStatus.ts index 8926de5faf11..f77f8969ad66 100644 --- a/libs/coin-modules/coin-vechain/src/getTransactionStatus.ts +++ b/libs/coin-modules/coin-vechain/src/bridge/getTransactionStatus.ts @@ -8,10 +8,9 @@ import { RecipientRequired, } from "@ledgerhq/errors"; import { AccountBridge } from "@ledgerhq/types-live"; -import { calculateTransactionInfo } from "./utils/transaction-utils"; -import { isValid } from "./utils/address-utils"; -import type { Transaction } from "./types"; -import { NotEnoughVTHO } from "./errors"; +import { calculateTransactionInfo, isValid } from "../common-logic"; +import type { Transaction } from "../types"; +import { NotEnoughVTHO } from "../errors"; export const getTransactionStatus: AccountBridge["getTransactionStatus"] = async ( account, diff --git a/libs/coin-modules/coin-vechain/src/bridge/js.ts b/libs/coin-modules/coin-vechain/src/bridge/index.ts similarity index 72% rename from libs/coin-modules/coin-vechain/src/bridge/js.ts rename to libs/coin-modules/coin-vechain/src/bridge/index.ts index e7961ca6c859..879f646ac4de 100644 --- a/libs/coin-modules/coin-vechain/src/bridge/js.ts +++ b/libs/coin-modules/coin-vechain/src/bridge/index.ts @@ -3,27 +3,27 @@ import { defaultUpdateTransaction, makeAccountBridgeReceive, makeScanAccounts, + makeSync, } from "@ledgerhq/coin-framework/bridge/jsHelpers"; import { SignerContext } from "@ledgerhq/coin-framework/signer"; import getAddressWrapper from "@ledgerhq/coin-framework/lib/bridge/getAddressWrapper"; -import { getTransactionStatus } from "../getTransactionStatus"; -import { estimateMaxSpendable } from "../estimateMaxSpendable"; -import { prepareTransaction } from "../prepareTransaction"; -import { createTransaction } from "../createTransaction"; -import { getAccountShape, sync } from "../synchronisation"; -import { buildSignOperation } from "../signOperation"; -import { broadcast } from "../broadcast"; -import resolver from "../hw-getAddress"; +import { getTransactionStatus } from "./getTransactionStatus"; +import { estimateMaxSpendable } from "./estimateMaxSpendable"; +import { prepareTransaction } from "./prepareTransaction"; +import { createTransaction } from "./createTransaction"; +import { getAccountShape } from "./synchronisation"; +import { buildSignOperation } from "./signOperation"; +import { broadcast } from "./broadcast"; +import resolver from "../signer"; import { VechainCoinConfig, setCoinConfig } from "../config"; -import { VechainSigner } from "../signer"; -import type { Transaction } from "../types"; +import type { Transaction, VechainSigner } from "../types"; export function buildCurrencyBridge(signerContext: SignerContext): CurrencyBridge { const getAddress = resolver(signerContext); const scanAccounts = makeScanAccounts({ getAccountShape, - getAddressFn: getAddress, + getAddressFn: getAddressWrapper(getAddress), }); return { @@ -33,6 +33,8 @@ export function buildCurrencyBridge(signerContext: SignerContext) }; } +const sync = makeSync({ getAccountShape }); + export function buildAccountBridge( signerContext: SignerContext, ): AccountBridge { diff --git a/libs/coin-modules/coin-vechain/src/prepareTransaction.ts b/libs/coin-modules/coin-vechain/src/bridge/prepareTransaction.ts similarity index 79% rename from libs/coin-modules/coin-vechain/src/prepareTransaction.ts rename to libs/coin-modules/coin-vechain/src/bridge/prepareTransaction.ts index 3458dc32002a..31600ec0104b 100644 --- a/libs/coin-modules/coin-vechain/src/prepareTransaction.ts +++ b/libs/coin-modules/coin-vechain/src/bridge/prepareTransaction.ts @@ -1,10 +1,13 @@ import { Account } from "@ledgerhq/types-live"; import { Transaction as VeChainThorTransaction } from "thor-devkit"; -import { calculateTransactionInfo } from "./utils/transaction-utils"; -import { isValid } from "./utils/address-utils"; -import { Transaction } from "./types"; -import { getBlockRef } from "./api"; -import { calculateClausesVet, calculateClausesVtho } from "./logic"; +import { + calculateTransactionInfo, + isValid, + calculateClausesVet, + calculateClausesVtho, +} from "../common-logic"; +import { Transaction } from "../types"; +import { getBlockRef } from "../network"; /** * Prepare transaction before checking status diff --git a/libs/coin-modules/coin-vechain/src/signOperation.ts b/libs/coin-modules/coin-vechain/src/bridge/signOperation.ts similarity index 88% rename from libs/coin-modules/coin-vechain/src/signOperation.ts rename to libs/coin-modules/coin-vechain/src/bridge/signOperation.ts index 39208be5a100..9c1d68adf308 100644 --- a/libs/coin-modules/coin-vechain/src/signOperation.ts +++ b/libs/coin-modules/coin-vechain/src/bridge/signOperation.ts @@ -3,8 +3,7 @@ import { Transaction as ThorTransaction } from "thor-devkit"; import type { Account, AccountBridge, DeviceId, SignOperationEvent } from "@ledgerhq/types-live"; import { SignerContext } from "@ledgerhq/coin-framework/signer"; import { buildOptimisticOperation } from "./buildOptimisticOperatioin"; -import type { Transaction } from "./types"; -import { VechainSigner, VechainSignature } from "./signer"; +import type { Transaction, VechainSigner } from "../types"; /** * Sign Transaction with Ledger hardware @@ -29,9 +28,9 @@ export const buildSignOperation = type: "device-signature-requested", }); - const signature = (await signerContext(deviceId, signer => + const signature = await signerContext(deviceId, signer => signer.signTransaction(account.freshAddressPath, unsigned.encode().toString("hex")), - )) as VechainSignature; + ); o.next({ type: "device-signature-granted" }); diff --git a/libs/coin-modules/coin-vechain/src/synchronisation.ts b/libs/coin-modules/coin-vechain/src/bridge/synchronisation.ts similarity index 92% rename from libs/coin-modules/coin-vechain/src/synchronisation.ts rename to libs/coin-modules/coin-vechain/src/bridge/synchronisation.ts index 8ad8f6b4d08f..75602ec77e60 100644 --- a/libs/coin-modules/coin-vechain/src/synchronisation.ts +++ b/libs/coin-modules/coin-vechain/src/bridge/synchronisation.ts @@ -7,10 +7,10 @@ import { encodeTokenAccountId, } from "@ledgerhq/coin-framework/account/index"; -import { getAccount, getLastBlockHeight, getOperations, getTokenOperations } from "./api"; +import { getAccount, getLastBlockHeight, getOperations, getTokenOperations } from "../network"; import { findTokenById, getTokenById } from "@ledgerhq/cryptoassets/tokens"; -import { VTHO_ADDRESS } from "./contracts/constants"; -import { GetAccountShape, makeSync, mergeOps } from "@ledgerhq/coin-framework/bridge/jsHelpers"; +import { VTHO_ADDRESS } from "../contracts/constants"; +import { GetAccountShape, mergeOps } from "@ledgerhq/coin-framework/bridge/jsHelpers"; import { Account } from "@ledgerhq/types-live"; export const getAccountShape: GetAccountShape = async info => { @@ -84,5 +84,3 @@ export const getAccountShape: GetAccountShape = async info => { return shape; }; - -export const sync = makeSync({ getAccountShape }); diff --git a/libs/coin-modules/coin-vechain/src/transaction.ts b/libs/coin-modules/coin-vechain/src/bridge/transaction.ts similarity index 94% rename from libs/coin-modules/coin-vechain/src/transaction.ts rename to libs/coin-modules/coin-vechain/src/bridge/transaction.ts index e7bf93a39c82..d99e6b842e8a 100644 --- a/libs/coin-modules/coin-vechain/src/transaction.ts +++ b/libs/coin-modules/coin-vechain/src/bridge/transaction.ts @@ -1,5 +1,10 @@ import { getAccountCurrency } from "@ledgerhq/coin-framework/account/index"; -import type { Transaction, TransactionRaw, TransactionStatus, TransactionStatusRaw } from "./types"; +import type { + Transaction, + TransactionRaw, + TransactionStatus, + TransactionStatusRaw, +} from "../types"; import { formatTransactionStatus } from "@ledgerhq/coin-framework/formatters"; import { formatCurrencyUnit } from "@ledgerhq/coin-framework/currencies/index"; import { diff --git a/libs/coin-modules/coin-vechain/src/utils/address-utils.ts b/libs/coin-modules/coin-vechain/src/common-logic/address-utils.ts similarity index 100% rename from libs/coin-modules/coin-vechain/src/utils/address-utils.ts rename to libs/coin-modules/coin-vechain/src/common-logic/address-utils.ts diff --git a/libs/coin-modules/coin-vechain/src/utils/hex-utils.ts b/libs/coin-modules/coin-vechain/src/common-logic/hex-utils.ts similarity index 100% rename from libs/coin-modules/coin-vechain/src/utils/hex-utils.ts rename to libs/coin-modules/coin-vechain/src/common-logic/hex-utils.ts diff --git a/libs/coin-modules/coin-vechain/src/common-logic/index.ts b/libs/coin-modules/coin-vechain/src/common-logic/index.ts new file mode 100644 index 000000000000..72d4939ff517 --- /dev/null +++ b/libs/coin-modules/coin-vechain/src/common-logic/index.ts @@ -0,0 +1,6 @@ +export * from "./address-utils"; +export * from "./hex-utils"; +export * from "./logic"; +export * from "./mapping-utils"; +export * from "./pad-address"; +export * from "./transaction-utils"; diff --git a/libs/coin-modules/coin-vechain/src/logic.ts b/libs/coin-modules/coin-vechain/src/common-logic/logic.ts similarity index 88% rename from libs/coin-modules/coin-vechain/src/logic.ts rename to libs/coin-modules/coin-vechain/src/common-logic/logic.ts index 4326ca2972d5..36f63c10a882 100644 --- a/libs/coin-modules/coin-vechain/src/logic.ts +++ b/libs/coin-modules/coin-vechain/src/common-logic/logic.ts @@ -1,8 +1,8 @@ import BigNumber from "bignumber.js"; import { Transaction as VeChainThorTransaction } from "thor-devkit"; -import { VTHO_ADDRESS } from "./contracts/constants"; -import VIP180 from "./contracts/abis/VIP180"; -import { HEX_PREFIX } from "./constants"; +import { VTHO_ADDRESS } from "../contracts/constants"; +import VIP180 from "../contracts/abis/VIP180"; +import { HEX_PREFIX } from "../types"; export const calculateClausesVtho = async ( recipient: string, diff --git a/libs/coin-modules/coin-vechain/src/utils/mapping-utils.ts b/libs/coin-modules/coin-vechain/src/common-logic/mapping-utils.ts similarity index 95% rename from libs/coin-modules/coin-vechain/src/utils/mapping-utils.ts rename to libs/coin-modules/coin-vechain/src/common-logic/mapping-utils.ts index 90bf61a823de..5fcd78dcffd4 100644 --- a/libs/coin-modules/coin-vechain/src/utils/mapping-utils.ts +++ b/libs/coin-modules/coin-vechain/src/common-logic/mapping-utils.ts @@ -1,9 +1,9 @@ import BigNumber from "bignumber.js"; import vip180 from "../contracts/abis/VIP180"; import { Operation } from "@ledgerhq/types-live"; -import { EventLog, TransferLog } from "../api/types"; +import { EventLog, TransferLog } from "../types"; import { encodeOperationId } from "@ledgerhq/coin-framework/operation"; -import { getFees } from "../api"; +import { getFees } from "../network"; export const mapVetTransfersToOperations = async ( txs: TransferLog[], diff --git a/libs/coin-modules/coin-vechain/src/utils/pad-address.ts b/libs/coin-modules/coin-vechain/src/common-logic/pad-address.ts similarity index 100% rename from libs/coin-modules/coin-vechain/src/utils/pad-address.ts rename to libs/coin-modules/coin-vechain/src/common-logic/pad-address.ts diff --git a/libs/coin-modules/coin-vechain/src/utils/transaction-utils.ts b/libs/coin-modules/coin-vechain/src/common-logic/transaction-utils.ts similarity index 95% rename from libs/coin-modules/coin-vechain/src/utils/transaction-utils.ts rename to libs/coin-modules/coin-vechain/src/common-logic/transaction-utils.ts index 92165bd18fea..f44c49b4dc77 100644 --- a/libs/coin-modules/coin-vechain/src/utils/transaction-utils.ts +++ b/libs/coin-modules/coin-vechain/src/common-logic/transaction-utils.ts @@ -1,15 +1,14 @@ import BigNumber from "bignumber.js"; -import { DEFAULT_GAS_COEFFICIENT, HEX_PREFIX } from "../constants"; +import { DEFAULT_GAS_COEFFICIENT, HEX_PREFIX } from "../types"; import crypto from "crypto"; import { Transaction as ThorTransaction } from "thor-devkit"; import params from "../contracts/abis/params"; import { BASE_GAS_PRICE_KEY, PARAMS_ADDRESS } from "../contracts/constants"; -import { Query } from "../api/types"; -import { query } from "../api/sdk"; +import { query } from "../network"; import { Account, TokenAccount } from "@ledgerhq/types-live"; -import { Transaction, TransactionInfo } from "../types"; +import { Transaction, TransactionInfo, Query } from "../types"; import { isValid } from "./address-utils"; -import { calculateClausesVet, calculateClausesVtho } from "../logic"; +import { calculateClausesVet, calculateClausesVtho } from "./logic"; import { ImpossibleToCalculateAmountAndFees } from "../errors"; const GAS_COEFFICIENT = 15000; diff --git a/libs/coin-modules/coin-vechain/src/datasets/index.ts b/libs/coin-modules/coin-vechain/src/datasets/index.ts new file mode 100644 index 000000000000..e1f780299a02 --- /dev/null +++ b/libs/coin-modules/coin-vechain/src/datasets/index.ts @@ -0,0 +1,2 @@ +export * from "./vechain.scanAccounts.1"; +export { vechain1, vechain2, vechain3 } from "./vechain"; diff --git a/libs/coin-modules/coin-vechain/src/api/index.ts b/libs/coin-modules/coin-vechain/src/network/index.ts similarity index 100% rename from libs/coin-modules/coin-vechain/src/api/index.ts rename to libs/coin-modules/coin-vechain/src/network/index.ts diff --git a/libs/coin-modules/coin-vechain/src/api/sdk.ts b/libs/coin-modules/coin-vechain/src/network/sdk.ts similarity index 94% rename from libs/coin-modules/coin-vechain/src/api/sdk.ts rename to libs/coin-modules/coin-vechain/src/network/sdk.ts index 837fbb66dd75..617f16318bac 100644 --- a/libs/coin-modules/coin-vechain/src/api/sdk.ts +++ b/libs/coin-modules/coin-vechain/src/network/sdk.ts @@ -1,12 +1,15 @@ import BigNumber from "bignumber.js"; import network from "@ledgerhq/live-network/network"; -import { AccountResponse, VetTxsQuery, TokenTxsQuery, Query, QueryResponse } from "./types"; +import { AccountResponse, VetTxsQuery, TokenTxsQuery, Query, QueryResponse } from "../types"; import type { Operation } from "@ledgerhq/types-live"; -import { mapVetTransfersToOperations, mapTokenTransfersToOperations } from "../utils/mapping-utils"; -import { padAddress } from "../utils/pad-address"; +import { + mapVetTransfersToOperations, + mapTokenTransfersToOperations, + padAddress, +} from "../common-logic"; import { TransferEventSignature } from "../contracts/constants"; import { Transaction } from "thor-devkit"; -import { HEX_PREFIX } from "../constants"; +import { HEX_PREFIX } from "../types"; import { getEnv } from "@ledgerhq/live-env"; const BASE_URL = getEnv("API_VECHAIN_THOREST"); diff --git a/libs/coin-modules/coin-vechain/src/hw-getAddress.ts b/libs/coin-modules/coin-vechain/src/signer/getAddress.ts similarity index 95% rename from libs/coin-modules/coin-vechain/src/hw-getAddress.ts rename to libs/coin-modules/coin-vechain/src/signer/getAddress.ts index 69c2909263c9..dfccaeff4858 100644 --- a/libs/coin-modules/coin-vechain/src/hw-getAddress.ts +++ b/libs/coin-modules/coin-vechain/src/signer/getAddress.ts @@ -1,6 +1,6 @@ import { SignerContext } from "@ledgerhq/coin-framework/signer"; import eip55 from "eip55"; -import { VechainSigner } from "./signer"; +import { VechainSigner } from "../types"; import { GetAddressFn } from "@ledgerhq/coin-framework/bridge/getAddressWrapper"; import { GetAddressOptions } from "@ledgerhq/coin-framework/derivation"; diff --git a/libs/coin-modules/coin-vechain/src/signer/index.ts b/libs/coin-modules/coin-vechain/src/signer/index.ts new file mode 100644 index 000000000000..9c39c7bdab20 --- /dev/null +++ b/libs/coin-modules/coin-vechain/src/signer/index.ts @@ -0,0 +1,2 @@ +import resolver from "./getAddress"; +export default resolver; diff --git a/libs/coin-modules/coin-vechain/src/speculos-deviceActions.ts b/libs/coin-modules/coin-vechain/src/test/bot-deviceActions.ts similarity index 93% rename from libs/coin-modules/coin-vechain/src/speculos-deviceActions.ts rename to libs/coin-modules/coin-vechain/src/test/bot-deviceActions.ts index 53a4bfd3ed2f..1e026e72cc38 100644 --- a/libs/coin-modules/coin-vechain/src/speculos-deviceActions.ts +++ b/libs/coin-modules/coin-vechain/src/test/bot-deviceActions.ts @@ -1,5 +1,5 @@ import { SpeculosButton, deviceActionFlow } from "@ledgerhq/coin-framework/bot/specs"; -import type { Transaction } from "./types"; +import type { Transaction } from "../types"; import { DeviceAction } from "@ledgerhq/coin-framework/bot/types"; const acceptTransaction: DeviceAction = deviceActionFlow({ diff --git a/libs/coin-modules/coin-vechain/src/specs.ts b/libs/coin-modules/coin-vechain/src/test/bot-specs.ts similarity index 98% rename from libs/coin-modules/coin-vechain/src/specs.ts rename to libs/coin-modules/coin-vechain/src/test/bot-specs.ts index 931551e4c45c..19f027851ccc 100644 --- a/libs/coin-modules/coin-vechain/src/specs.ts +++ b/libs/coin-modules/coin-vechain/src/test/bot-specs.ts @@ -8,11 +8,11 @@ import type { TransactionTestInput, SpeculosTransport, } from "@ledgerhq/coin-framework/bot/types"; -import type { Transaction } from "./types"; +import type { Transaction } from "../types"; import { pickSiblings, botTest, SpeculosButton } from "@ledgerhq/coin-framework/bot/specs"; import { DeviceModelId } from "@ledgerhq/devices"; import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies"; -import speculosDeviceActions from "./speculos-deviceActions"; +import speculosDeviceActions from "./bot-deviceActions"; const MIN_VET_TRANSACTION_AMOUNT = 1000000000000000000; const MAX_VTHO_FEE_FOR_VTHO_TRANSACTION = 1040000000000000000; diff --git a/libs/coin-modules/coin-vechain/src/test/bridgeDatasetTest.ts b/libs/coin-modules/coin-vechain/src/test/bridgeDatasetTest.ts new file mode 100644 index 000000000000..06292eec20cf --- /dev/null +++ b/libs/coin-modules/coin-vechain/src/test/bridgeDatasetTest.ts @@ -0,0 +1,262 @@ +import BigNumber from "bignumber.js"; +import type { AccountRaw, CurrenciesData, DatasetTest } from "@ledgerhq/types-live"; +import type { Transaction } from "../types"; +import { fromTransactionRaw } from "../bridge/transaction"; +import { DEFAULT_GAS_COEFFICIENT, MAINNET_CHAIN_TAG } from "../types"; +import { vechain1, vechain3 } from "../datasets"; +import { generateNonce } from "../common-logic"; + +import vechainScanAccounts1 from "../datasets/vechain.scanAccounts.1"; +import { AmountRequired, NotEnoughBalance } from "@ledgerhq/errors"; +import VIP180 from "../contracts/abis/VIP180"; +import { CryptoCurrencyId } from "@ledgerhq/types-cryptoassets"; +import { NotEnoughVTHO } from "../errors"; +import { + listSupportedCurrencies, + setSupportedCurrencies, +} from "@ledgerhq/coin-framework/currencies/index"; +import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies"; + +const listSupported = listSupportedCurrencies(); +listSupported.push(getCryptoCurrencyById("vechain")); +setSupportedCurrencies(listSupported.map(c => c.id) as CryptoCurrencyId[]); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +export const vechain: CurrenciesData = { + FIXME_ignoreAccountFields: ["balance", "spendableBalance", "estimateMaxSpendable"], // the balance depends on VTHO and it's earned without operations + scanAccounts: vechainScanAccounts1, + + accounts: [ + { + raw: vechain1 as AccountRaw, + transactions: [ + { + name: "Send VET", + transaction: fromTransactionRaw({ + family: "vechain", + estimatedFees: "210000000000000000", + recipient: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", + amount: "1000000000000000000", + body: { + chainTag: MAINNET_CHAIN_TAG, + blockRef: "0x00634a0c856ec1db", + expiration: 18, + clauses: [ + { + to: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", + value: "1000000000000000000", + data: "0x", + }, + ], + gasPriceCoef: DEFAULT_GAS_COEFFICIENT, + gas: "0", + dependsOn: null, + nonce: generateNonce(), + }, + }), + expectedStatus: { + amount: new BigNumber("1000000000000000000"), + estimatedFees: new BigNumber("210000000000000000"), + totalSpent: new BigNumber("1000000000000000000"), + errors: {}, + warnings: {}, + }, + }, + { + name: "Send VTHO", + transaction: fromTransactionRaw({ + family: "vechain", + subAccountId: + "js:2:vechain:0x0fe6688548f0C303932bB197B0A96034f1d74dba:vechain+vechain%2Fvip180%2Fvtho", + estimatedFees: "515180000000000000", + recipient: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", + amount: "1000000000000000000", + body: { + chainTag: MAINNET_CHAIN_TAG, + blockRef: "0x00634a0c856ec1db", + expiration: 18, + clauses: [ + { + to: "0x0000000000000000000000000000456e65726779", + value: 0, + data: VIP180.transfer.encode( + "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", + "9000000000000000000", + ), + }, + ], + gasPriceCoef: DEFAULT_GAS_COEFFICIENT, + gas: "0", + dependsOn: null, + nonce: generateNonce(), + }, + }), + expectedStatus: { + amount: new BigNumber("1000000000000000000"), + estimatedFees: new BigNumber("515180000000000000"), + totalSpent: new BigNumber("1515180000000000000"), + errors: {}, + warnings: {}, + }, + }, + { + name: "Amount required", + transaction: fromTransactionRaw({ + family: "vechain", + estimatedFees: "0", + recipient: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", + amount: "", + body: { + chainTag: MAINNET_CHAIN_TAG, + blockRef: "0x00634a0c856ec1db", + expiration: 18, + clauses: [{ to: "", value: 0, data: "0x" }], + gasPriceCoef: DEFAULT_GAS_COEFFICIENT, + gas: "0", + dependsOn: null, + nonce: generateNonce(), + }, + }), + expectedStatus: { + errors: { + amount: new AmountRequired(), + }, + warnings: {}, + }, + }, + { + name: "VET balance not enough", + transaction: fromTransactionRaw({ + family: "vechain", + estimatedFees: "210000000000000000", + recipient: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", + amount: "20000000000000000000", + body: { + chainTag: MAINNET_CHAIN_TAG, + blockRef: "0x00634a0c856ec1db", + expiration: 18, + clauses: [ + { + to: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", + value: "20000000000000000000", + data: "0x", + }, + ], + gasPriceCoef: DEFAULT_GAS_COEFFICIENT, + gas: "0", + dependsOn: null, + nonce: generateNonce(), + }, + }), + expectedStatus: { + amount: new BigNumber("20000000000000000000"), + errors: { + amount: new NotEnoughBalance(), + }, + warnings: {}, + totalSpent: new BigNumber("20000000000000000000"), + estimatedFees: new BigNumber("210000000000000000"), + }, + }, + { + name: "VTHO balance not enough", + transaction: fromTransactionRaw({ + family: "vechain", + subAccountId: + "js:2:vechain:0x0fe6688548f0C303932bB197B0A96034f1d74dba:vechain+vechain%2Fvip180%2Fvtho", + estimatedFees: "515820000000000000", + recipient: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", + amount: "20000000000000000000", + body: { + chainTag: MAINNET_CHAIN_TAG, + blockRef: "0x00634a0c856ec1db", + expiration: 18, + clauses: [ + { + to: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", + value: "20000000000000000000", + data: "0x", + }, + ], + gasPriceCoef: DEFAULT_GAS_COEFFICIENT, + gas: "0", + dependsOn: null, + nonce: generateNonce(), + }, + }), + expectedStatus: { + amount: new BigNumber("20000000000000000000"), + errors: { + amount: new NotEnoughBalance(), + }, + warnings: {}, + totalSpent: new BigNumber("20515820000000000000"), + estimatedFees: new BigNumber("515820000000000000"), + }, + }, + ], + FIXME_tests: [ + "balance is sum of ops", // the balance depends on VTHO and it's earned without operations + "empty transaction is equals to itself", //nonce is not deterministic + "ref stability on self transaction", //blockref is not deterministic + "can be run in parallel and all yield same results", //blockref is not deterministic + ], + }, + { + raw: vechain3 as AccountRaw, + transactions: [ + { + name: "Not enough VTHO to pay fees", + transaction: fromTransactionRaw({ + family: "vechain", + estimatedFees: "210000000000000000", + recipient: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", + amount: "1000000000000000000", + body: { + chainTag: MAINNET_CHAIN_TAG, + blockRef: "0x00634a0c856ec1db", + expiration: 18, + clauses: [ + { + to: "0xcf130b42ae31c4931298b4b1c0f1d974b8732957", + value: "1000000000000000000", + data: "0x", + }, + ], + gasPriceCoef: DEFAULT_GAS_COEFFICIENT, + gas: "0", + dependsOn: null, + nonce: generateNonce(), + }, + }), + expectedStatus: { + amount: new BigNumber("1000000000000000000"), + estimatedFees: new BigNumber("210000000000000000"), + totalSpent: new BigNumber("1000000000000000000"), + errors: { + amount: new NotEnoughVTHO(), + }, + warnings: {}, + }, + }, + ], + FIXME_tests: [ + "balance is sum of ops", // the balance depends on VTHO and it's earned without operations + "empty transaction is equals to itself", //nonce is not deterministic + "ref stability on self transaction", //blockref is not deterministic + "can be run in parallel and all yield same results", //blockref is not deterministic + ], + }, + ], +}; + +// describe("VeChain Bridge", () => { +// test.todo("sample test"); +// }); + +export const dataset: DatasetTest = { + implementations: ["js", "mock"], + currencies: { + vechain, + }, +}; diff --git a/libs/coin-modules/coin-vechain/src/cli-transaction.ts b/libs/coin-modules/coin-vechain/src/test/cli.ts similarity index 92% rename from libs/coin-modules/coin-vechain/src/cli-transaction.ts rename to libs/coin-modules/coin-vechain/src/test/cli.ts index e07fa2952129..b1d716dbf9d8 100644 --- a/libs/coin-modules/coin-vechain/src/cli-transaction.ts +++ b/libs/coin-modules/coin-vechain/src/test/cli.ts @@ -1,9 +1,9 @@ import flatMap from "lodash/flatMap"; -import { Transaction, Transaction as VechainTransaction } from "./types"; +import { Transaction, Transaction as VechainTransaction } from "../types"; import type { Account, AccountLike } from "@ledgerhq/types-live"; -import { VTHO_ADDRESS } from "./contracts/constants"; -import VIP180 from "./contracts/abis/VIP180"; -import { MustBeVechain } from "./errors"; +import { VTHO_ADDRESS } from "../contracts/constants"; +import VIP180 from "../contracts/abis/VIP180"; +import { MustBeVechain } from "../errors"; type CliTools = { options: Array<{ diff --git a/libs/coin-modules/coin-vechain/src/test/index.ts b/libs/coin-modules/coin-vechain/src/test/index.ts new file mode 100644 index 000000000000..f54948a8413b --- /dev/null +++ b/libs/coin-modules/coin-vechain/src/test/index.ts @@ -0,0 +1,6 @@ +import makeCliTools from "./cli"; + +export * from "./bridgeDatasetTest"; +export { makeCliTools }; +export * from "./bot-deviceActions"; +export * from "./bot-specs"; diff --git a/libs/coin-modules/coin-vechain/src/types.ts b/libs/coin-modules/coin-vechain/src/types/bridge.ts similarity index 100% rename from libs/coin-modules/coin-vechain/src/types.ts rename to libs/coin-modules/coin-vechain/src/types/bridge.ts diff --git a/libs/coin-modules/coin-vechain/src/constants.ts b/libs/coin-modules/coin-vechain/src/types/constants.ts similarity index 100% rename from libs/coin-modules/coin-vechain/src/constants.ts rename to libs/coin-modules/coin-vechain/src/types/constants.ts diff --git a/libs/coin-modules/coin-vechain/src/types/index.ts b/libs/coin-modules/coin-vechain/src/types/index.ts new file mode 100644 index 000000000000..3e980b0d6b00 --- /dev/null +++ b/libs/coin-modules/coin-vechain/src/types/index.ts @@ -0,0 +1,4 @@ +export * from "./bridge"; +export * from "./signer"; +export * from "./constants"; +export * from "./network"; diff --git a/libs/coin-modules/coin-vechain/src/api/types.ts b/libs/coin-modules/coin-vechain/src/types/network.ts similarity index 100% rename from libs/coin-modules/coin-vechain/src/api/types.ts rename to libs/coin-modules/coin-vechain/src/types/network.ts diff --git a/libs/coin-modules/coin-vechain/src/signer.ts b/libs/coin-modules/coin-vechain/src/types/signer.ts similarity index 100% rename from libs/coin-modules/coin-vechain/src/signer.ts rename to libs/coin-modules/coin-vechain/src/types/signer.ts diff --git a/libs/ledger-live-common/src/families/vechain/bridge.integration.test.ts b/libs/ledger-live-common/src/families/vechain/bridge.integration.test.ts index a3ce302fb289..894c5f03408d 100644 --- a/libs/ledger-live-common/src/families/vechain/bridge.integration.test.ts +++ b/libs/ledger-live-common/src/families/vechain/bridge.integration.test.ts @@ -1,7 +1,5 @@ import "../../__tests__/test-helpers/setup"; import { testBridge } from "../../__tests__/test-helpers/bridge"; -import dataset from "@ledgerhq/coin-vechain/bridge.integration.test"; -import { DatasetTest } from "@ledgerhq/types-live"; -import { Transaction } from "@ledgerhq/coin-vechain/lib/types"; +import dataset from "@ledgerhq/coin-vechain/test/index"; -testBridge(dataset as DatasetTest); // TODO: Remove casting +testBridge(dataset); // TODO: Remove casting diff --git a/libs/ledger-live-common/src/families/vechain/setup.ts b/libs/ledger-live-common/src/families/vechain/setup.ts index a845d8b1accf..6c015113e9d0 100644 --- a/libs/ledger-live-common/src/families/vechain/setup.ts +++ b/libs/ledger-live-common/src/families/vechain/setup.ts @@ -1,10 +1,9 @@ // Goal of this file is to inject all necessary device/signer dependency to coin-modules -import { createBridges } from "@ledgerhq/coin-vechain/bridge/js"; -import makeCliTools from "@ledgerhq/coin-vechain/cli-transaction"; -import vechainResolver from "@ledgerhq/coin-vechain/hw-getAddress"; -import { VechainSigner } from "@ledgerhq/coin-vechain/signer"; -import { Transaction } from "@ledgerhq/coin-vechain/types"; +import { createBridges } from "@ledgerhq/coin-vechain/index"; +import makeCliTools from "@ledgerhq/coin-vechain/test/cli"; +import vechainResolver from "@ledgerhq/coin-vechain/signer"; +import { Transaction, VechainSigner } from "@ledgerhq/coin-vechain/types"; import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies"; import Transport from "@ledgerhq/hw-transport"; import type { Bridge } from "@ledgerhq/types-live"; diff --git a/libs/ledger-live-common/src/families/vechain/types.ts b/libs/ledger-live-common/src/families/vechain/types.ts index bd6719aca78b..9eba7ede9a90 100644 --- a/libs/ledger-live-common/src/families/vechain/types.ts +++ b/libs/ledger-live-common/src/families/vechain/types.ts @@ -1,2 +1,2 @@ // Encapsulate for LLD and LLM -export * from "@ledgerhq/coin-vechain/types"; +export * from "@ledgerhq/coin-vechain/types/index"; diff --git a/libs/ledger-live-common/src/generated/types.ts b/libs/ledger-live-common/src/generated/types.ts index 8ec6a9820b92..a09d8e051e30 100644 --- a/libs/ledger-live-common/src/generated/types.ts +++ b/libs/ledger-live-common/src/generated/types.ts @@ -129,7 +129,7 @@ import type { TransactionRaw as vechainTransactionRaw, TransactionStatus as vechainTransactionStatus, TransactionStatusRaw as vechainTransactionStatusRaw, -} from "@ledgerhq/coin-vechain/types"; +} from "@ledgerhq/coin-vechain/types/index"; import type { Transaction as xrpTransaction, TransactionRaw as xrpTransactionRaw, From 1c3c87611aa7e92e4174c906c07762580fb570cf Mon Sep 17 00:00:00 2001 From: qperrot Date: Mon, 18 Nov 2024 16:14:11 +0100 Subject: [PATCH 17/20] fix: move in folders and fix tests --- .../coin-vechain/.unimportedrc.json | 65 ++++++++++++------- libs/coin-modules/coin-vechain/jest.config.js | 2 +- libs/coin-modules/coin-vechain/package.json | 22 +++---- .../coin-vechain/src/bridge/index.ts | 8 +-- libs/coin-modules/coin-vechain/src/index.ts | 1 + .../coin-vechain/src/signer/index.ts | 2 + .../coin-vechain/src/signer/signMessage.ts | 22 +++++++ .../coin-vechain/src/test/bot-specs.ts | 1 - .../src/test/bridgeDatasetTest.ts | 2 +- .../vechain/bridge.integration.test.ts | 4 +- .../src/families/vechain/logic.ts | 2 - .../src/families/vechain/setup.ts | 16 ++--- pnpm-lock.yaml | 30 --------- 13 files changed, 89 insertions(+), 88 deletions(-) create mode 100644 libs/coin-modules/coin-vechain/src/index.ts create mode 100644 libs/coin-modules/coin-vechain/src/signer/signMessage.ts delete mode 100644 libs/ledger-live-common/src/families/vechain/logic.ts diff --git a/libs/coin-modules/coin-vechain/.unimportedrc.json b/libs/coin-modules/coin-vechain/.unimportedrc.json index e384829f9653..eae49dffeabc 100644 --- a/libs/coin-modules/coin-vechain/.unimportedrc.json +++ b/libs/coin-modules/coin-vechain/.unimportedrc.json @@ -16,38 +16,59 @@ "ignoreUnresolved": [], "ignoreUnimported": [ "src/account.ts", - "src/api/index.ts", - "src/api/sdk.ts", - "src/api/types.ts", - "src/bridge/js.ts", - "src/broadcast.ts", - "src/buildOptimisticOperatioin.ts", - "src/cli-transaction.ts", + "src/bridge/broadcast.ts", + "src/bridge/buildOptimisticOperatioin.ts", + "src/bridge/createTransaction.ts", + "src/bridge/estimateMaxSpendable.ts", + "src/bridge/getTransactionStatus.ts", + "src/bridge/index.ts", + "src/bridge/prepareTransaction.ts", + "src/bridge/signOperation.ts", + "src/bridge/synchronisation.ts", + "src/bridge/transaction.ts", + "src/common-logic/address-utils.ts", + "src/common-logic/hex-utils.ts", + "src/common-logic/index.ts", + "src/common-logic/logic.ts", + "src/common-logic/mapping-utils.ts", + "src/common-logic/pad-address.ts", + "src/common-logic/transaction-utils.ts", "src/config.ts", - "src/constants.ts", "src/contracts/abis/VIP180.ts", "src/contracts/abis/params.ts", "src/contracts/constants.ts", - "src/createTransaction.ts", + "src/datasets/index.ts", "src/datasets/vechain.scanAccounts.1.ts", "src/datasets/vechain.ts", - "src/estimateMaxSpendable.ts", - "src/getTransactionStatus.ts", - "src/logic.ts", + "src/index.ts", "src/mock.ts", - "src/prepareTransaction.ts", - "src/signOperation.ts", - "src/synchronisation.ts", - "src/utils/address-utils.ts", - "src/utils/hex-utils.ts", - "src/utils/mapping-utils.ts", - "src/utils/pad-address.ts", - "src/utils/transaction-utils.ts" + "src/network/index.ts", + "src/network/sdk.ts", + "src/signer/getAddress.ts", + "src/signer/index.ts", + "src/signer/signMessage.ts", + "src/test/bot-deviceActions.ts", + "src/test/bot-specs.ts", + "src/test/bridgeDatasetTest.ts", + "src/test/cli.ts", + "src/test/index.ts", + "src/types/bridge.ts", + "src/types/constants.ts", + "src/types/index.ts", + "src/types/network.ts", + "src/types/signer.ts" ], "ignoreUnused": [ + "@ledgerhq/coin-framework", + "@ledgerhq/cryptoassets", + "@ledgerhq/devices", "@ledgerhq/live-env", "@ledgerhq/live-network", + "bignumber.js", + "eip55", + "invariant", "lodash", - "rxjs" + "rxjs", + "thor-devkit" ] -} +} \ No newline at end of file diff --git a/libs/coin-modules/coin-vechain/jest.config.js b/libs/coin-modules/coin-vechain/jest.config.js index f1b2df2b8018..256cf95233c1 100644 --- a/libs/coin-modules/coin-vechain/jest.config.js +++ b/libs/coin-modules/coin-vechain/jest.config.js @@ -4,5 +4,5 @@ module.exports = { coverageDirectory: "coverage", preset: "ts-jest", testEnvironment: "node", - testPathIgnorePatterns: ["lib/", "lib-es/", ".integration.test.ts"], + testPathIgnorePatterns: ["lib/", "lib-es/"], }; diff --git a/libs/coin-modules/coin-vechain/package.json b/libs/coin-modules/coin-vechain/package.json index b8bba230aa89..ed4cd459faec 100644 --- a/libs/coin-modules/coin-vechain/package.json +++ b/libs/coin-modules/coin-vechain/package.json @@ -29,6 +29,12 @@ "lib-es/*": [ "lib-es/*" ], + "specs": [ + "lib/test/bot-specs" + ], + "transaction": [ + "lib/bridge/transaction" + ], "*": [ "lib/*" ] @@ -82,9 +88,9 @@ "lint": "eslint ./src --no-error-on-unmatched-pattern --ext .ts,.tsx --cache", "lint:fix": "pnpm lint --fix", "typecheck": "tsc --noEmit", - "test": "jest", - "unimported": "unimported", - "coin-tester": "DOTENV_CONFIG_PATH=src/__tests__/coin-tester/.env pnpm jest --runTestsByPath src/__tests__/coin-tester/*.test.ts" + "test": "jest --passWithNoTests", + "test-integ": "DOTENV_CONFIG_PATH=.env.integ.test jest --config=jest.integ.config.js", + "unimported": "unimported" }, "dependencies": { "@ledgerhq/coin-framework": "workspace:^", @@ -95,7 +101,6 @@ "@ledgerhq/live-network": "workspace:^", "bignumber.js": "^9.1.2", "eip55": "^2.1.1", - "expect": "^27.4.6", "invariant": "^2.2.2", "lodash": "^4.17.21", "rxjs": "^7.8.1", @@ -105,20 +110,11 @@ "@ledgerhq/coin-tester": "workspace:^", "@ledgerhq/types-cryptoassets": "workspace:^", "@ledgerhq/types-live": "workspace:^", - "@types/bluebird": "^3.5.42", "@types/invariant": "^2.2.2", "@types/jest": "^29.5.10", "@types/lodash": "^4.14.191", - "bluebird": "^3.7.2", - "chalk": "^4.1.2", - "docker-compose": "^0.24.2", "dotenv": "^16.4.5", - "eslint-plugin-import": "^2.28.1", - "fast-check": "^3.12.0", "jest": "^29.7.0", - "jest-expect-message": "^1.1.3", - "msw": "^2.2.12", - "prando": "^6.0.1", "ts-jest": "^29.1.1" } } diff --git a/libs/coin-modules/coin-vechain/src/bridge/index.ts b/libs/coin-modules/coin-vechain/src/bridge/index.ts index 879f646ac4de..7fb9a9450527 100644 --- a/libs/coin-modules/coin-vechain/src/bridge/index.ts +++ b/libs/coin-modules/coin-vechain/src/bridge/index.ts @@ -15,7 +15,6 @@ import { getAccountShape } from "./synchronisation"; import { buildSignOperation } from "./signOperation"; import { broadcast } from "./broadcast"; import resolver from "../signer"; -import { VechainCoinConfig, setCoinConfig } from "../config"; import type { Transaction, VechainSigner } from "../types"; export function buildCurrencyBridge(signerContext: SignerContext): CurrencyBridge { @@ -56,12 +55,7 @@ export function buildAccountBridge( }; } -export function createBridges( - signerContext: SignerContext, - coinConfig: VechainCoinConfig, -) { - setCoinConfig(coinConfig); - +export function createBridges(signerContext: SignerContext) { return { currencyBridge: buildCurrencyBridge(signerContext), accountBridge: buildAccountBridge(signerContext), diff --git a/libs/coin-modules/coin-vechain/src/index.ts b/libs/coin-modules/coin-vechain/src/index.ts new file mode 100644 index 000000000000..b6952a1f1150 --- /dev/null +++ b/libs/coin-modules/coin-vechain/src/index.ts @@ -0,0 +1 @@ +export { createBridges } from "./bridge/index"; diff --git a/libs/coin-modules/coin-vechain/src/signer/index.ts b/libs/coin-modules/coin-vechain/src/signer/index.ts index 9c39c7bdab20..dfe294ec89ba 100644 --- a/libs/coin-modules/coin-vechain/src/signer/index.ts +++ b/libs/coin-modules/coin-vechain/src/signer/index.ts @@ -1,2 +1,4 @@ import resolver from "./getAddress"; + +export * from "./signMessage"; export default resolver; diff --git a/libs/coin-modules/coin-vechain/src/signer/signMessage.ts b/libs/coin-modules/coin-vechain/src/signer/signMessage.ts new file mode 100644 index 000000000000..cc2641f77080 --- /dev/null +++ b/libs/coin-modules/coin-vechain/src/signer/signMessage.ts @@ -0,0 +1,22 @@ +import { Transaction as ThorTransaction } from "thor-devkit"; +import { SignerContext } from "@ledgerhq/coin-framework/signer"; +import { VechainSigner } from "../types"; + +export const signMessage = + (signerContext: SignerContext) => + async (deviceId: string, path: string, message: string, rawMessage: string) => { + let messageObj; + let unsigned: ThorTransaction; + try { + if (message) messageObj = JSON.parse(message); + else messageObj = JSON.parse(rawMessage); + unsigned = new ThorTransaction(messageObj); + } catch (e) { + throw new Error("Message is not a valid JSON object"); + } + const result = await signerContext(deviceId, signer => + signer.signTransaction(path, unsigned.encode().toString("hex")), + ); + + return result.toString("hex"); + }; diff --git a/libs/coin-modules/coin-vechain/src/test/bot-specs.ts b/libs/coin-modules/coin-vechain/src/test/bot-specs.ts index 19f027851ccc..18f3165fc6f6 100644 --- a/libs/coin-modules/coin-vechain/src/test/bot-specs.ts +++ b/libs/coin-modules/coin-vechain/src/test/bot-specs.ts @@ -1,6 +1,5 @@ import BigNumber from "bignumber.js"; import invariant from "invariant"; -import expect from "expect"; import type { AppSpec, TransactionArg, diff --git a/libs/coin-modules/coin-vechain/src/test/bridgeDatasetTest.ts b/libs/coin-modules/coin-vechain/src/test/bridgeDatasetTest.ts index 06292eec20cf..a13e93e1b1a4 100644 --- a/libs/coin-modules/coin-vechain/src/test/bridgeDatasetTest.ts +++ b/libs/coin-modules/coin-vechain/src/test/bridgeDatasetTest.ts @@ -22,7 +22,7 @@ listSupported.push(getCryptoCurrencyById("vechain")); setSupportedCurrencies(listSupported.map(c => c.id) as CryptoCurrencyId[]); // eslint-disable-next-line @typescript-eslint/no-unused-vars -export const vechain: CurrenciesData = { +const vechain: CurrenciesData = { FIXME_ignoreAccountFields: ["balance", "spendableBalance", "estimateMaxSpendable"], // the balance depends on VTHO and it's earned without operations scanAccounts: vechainScanAccounts1, diff --git a/libs/ledger-live-common/src/families/vechain/bridge.integration.test.ts b/libs/ledger-live-common/src/families/vechain/bridge.integration.test.ts index 894c5f03408d..50b1a786fba4 100644 --- a/libs/ledger-live-common/src/families/vechain/bridge.integration.test.ts +++ b/libs/ledger-live-common/src/families/vechain/bridge.integration.test.ts @@ -1,5 +1,5 @@ import "../../__tests__/test-helpers/setup"; import { testBridge } from "../../__tests__/test-helpers/bridge"; -import dataset from "@ledgerhq/coin-vechain/test/index"; +import { dataset } from "@ledgerhq/coin-vechain/test/index"; -testBridge(dataset); // TODO: Remove casting +testBridge(dataset); diff --git a/libs/ledger-live-common/src/families/vechain/logic.ts b/libs/ledger-live-common/src/families/vechain/logic.ts deleted file mode 100644 index 24a61a08c84e..000000000000 --- a/libs/ledger-live-common/src/families/vechain/logic.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Encapsulate for LLD and LLM -export * from "@ledgerhq/coin-vechain/logic"; diff --git a/libs/ledger-live-common/src/families/vechain/setup.ts b/libs/ledger-live-common/src/families/vechain/setup.ts index 6c015113e9d0..6ba4e3f59a5d 100644 --- a/libs/ledger-live-common/src/families/vechain/setup.ts +++ b/libs/ledger-live-common/src/families/vechain/setup.ts @@ -2,26 +2,24 @@ import { createBridges } from "@ledgerhq/coin-vechain/index"; import makeCliTools from "@ledgerhq/coin-vechain/test/cli"; -import vechainResolver from "@ledgerhq/coin-vechain/signer"; -import { Transaction, VechainSigner } from "@ledgerhq/coin-vechain/types"; -import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies"; +import vechainResolver, { signMessage } from "@ledgerhq/coin-vechain/signer/index"; +import { Transaction, VechainSigner } from "./types"; import Transport from "@ledgerhq/hw-transport"; import type { Bridge } from "@ledgerhq/types-live"; import Vet from "@ledgerhq/hw-app-vet"; import { CreateSigner, createResolver, executeWithSigner } from "../../bridge/setup"; -import { getCurrencyConfiguration } from "../../config"; import type { Resolver } from "../../hw/getAddress/types"; -import { VechainCoinConfig } from "@ledgerhq/coin-vechain/lib/config"; const createSigner: CreateSigner = (transport: Transport) => new Vet(transport); -const getCoinConfig: VechainCoinConfig = () => - getCurrencyConfiguration>(getCryptoCurrencyById("ton")); +const bridge: Bridge = createBridges(executeWithSigner(createSigner)); -const bridge: Bridge = createBridges(executeWithSigner(createSigner), getCoinConfig); +const messageSigner = { + signMessage, +}; const resolver: Resolver = createResolver(createSigner, vechainResolver); const cliTools = makeCliTools(); -export { bridge, cliTools, resolver }; +export { bridge, cliTools, messageSigner, resolver }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ffba4f975b38..b57a57301155 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3250,9 +3250,6 @@ importers: eip55: specifier: ^2.1.1 version: 2.1.1 - expect: - specifier: ^27.4.6 - version: 27.5.1 invariant: specifier: ^2.2.2 version: 2.2.4 @@ -3275,9 +3272,6 @@ importers: '@ledgerhq/types-live': specifier: workspace:^ version: link:../../ledgerjs/packages/types-live - '@types/bluebird': - specifier: ^3.5.42 - version: 3.5.42 '@types/invariant': specifier: ^2.2.2 version: 2.2.37 @@ -3287,36 +3281,12 @@ importers: '@types/lodash': specifier: ^4.14.191 version: 4.17.7 - bluebird: - specifier: ^3.7.2 - version: 3.7.2 - chalk: - specifier: ^4.1.2 - version: 4.1.2 - docker-compose: - specifier: ^0.24.2 - version: 0.24.8 dotenv: specifier: ^16.4.5 version: 16.4.5 - eslint-plugin-import: - specifier: ^2.28.1 - version: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.3))(eslint@8.57.0) - fast-check: - specifier: ^3.12.0 - version: 3.17.1 jest: specifier: ^29.7.0 version: 29.7.0 - jest-expect-message: - specifier: ^1.1.3 - version: 1.1.3 - msw: - specifier: ^2.2.12 - version: 2.3.4(typescript@5.4.3) - prando: - specifier: ^6.0.1 - version: 6.0.1 ts-jest: specifier: ^29.1.1 version: 29.1.5(jest@29.7.0)(typescript@5.4.3) From 517fa44bbc40425995bf840ecab60773d022a30d Mon Sep 17 00:00:00 2001 From: qperrot Date: Mon, 18 Nov 2024 16:40:15 +0100 Subject: [PATCH 18/20] chore: add changeset --- .changeset/two-pigs-buy.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changeset/two-pigs-buy.md diff --git a/.changeset/two-pigs-buy.md b/.changeset/two-pigs-buy.md new file mode 100644 index 000000000000..2db4a4c22c9f --- /dev/null +++ b/.changeset/two-pigs-buy.md @@ -0,0 +1,7 @@ +--- +"@ledgerhq/coin-vechain": patch +"live-mobile": patch +"@ledgerhq/live-common": patch +--- + +move vechain to its own coin module From 48c66c483b9ce906b1e5a141d6ee583c94308045 Mon Sep 17 00:00:00 2001 From: qperrot Date: Tue, 19 Nov 2024 09:40:08 +0100 Subject: [PATCH 19/20] fix: getAddressWrapper import in index --- libs/coin-modules/coin-vechain/src/bridge/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/coin-modules/coin-vechain/src/bridge/index.ts b/libs/coin-modules/coin-vechain/src/bridge/index.ts index 7fb9a9450527..cc8a581daa36 100644 --- a/libs/coin-modules/coin-vechain/src/bridge/index.ts +++ b/libs/coin-modules/coin-vechain/src/bridge/index.ts @@ -6,7 +6,7 @@ import { makeSync, } from "@ledgerhq/coin-framework/bridge/jsHelpers"; import { SignerContext } from "@ledgerhq/coin-framework/signer"; -import getAddressWrapper from "@ledgerhq/coin-framework/lib/bridge/getAddressWrapper"; +import getAddressWrapper from "@ledgerhq/coin-framework/bridge/getAddressWrapper"; import { getTransactionStatus } from "./getTransactionStatus"; import { estimateMaxSpendable } from "./estimateMaxSpendable"; import { prepareTransaction } from "./prepareTransaction"; From 258daf4abdab2612aed4617385de4036ff66bded Mon Sep 17 00:00:00 2001 From: qperrot Date: Tue, 19 Nov 2024 13:44:46 +0100 Subject: [PATCH 20/20] fix: changed patch to minor --- .changeset/two-pigs-buy.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.changeset/two-pigs-buy.md b/.changeset/two-pigs-buy.md index 2db4a4c22c9f..8d8aa32c4462 100644 --- a/.changeset/two-pigs-buy.md +++ b/.changeset/two-pigs-buy.md @@ -1,7 +1,7 @@ --- -"@ledgerhq/coin-vechain": patch -"live-mobile": patch -"@ledgerhq/live-common": patch +"@ledgerhq/coin-vechain": minor +"live-mobile": minor +"@ledgerhq/live-common": minor --- move vechain to its own coin module