diff --git a/packages/hw-app-eth/src/Eth.ts b/packages/hw-app-eth/src/Eth.ts index 4d5300d29..e12835f73 100644 --- a/packages/hw-app-eth/src/Eth.ts +++ b/packages/hw-app-eth/src/Eth.ts @@ -15,13 +15,16 @@ * limitations under the License. ********************************************************************************/ // FIXME drop: -import { EthAppPleaseEnableContractData } from "@ledgerhq/errors"; import type Transport from "@ledgerhq/hw-transport"; import { BigNumber } from "bignumber.js"; import { decodeTxInfo } from "./utils"; // NB: these are temporary import for the deprecated fallback mechanism import { LedgerEthTransactionResolution, LoadConfig } from "./services/types"; import ledgerService from "./services/ledger"; +import { + EthAppNftNotSupported, + EthAppPleaseEnableContractData, +} from "./errors"; export type StarkQuantizationType = | "eth" @@ -1187,8 +1190,8 @@ function provideNFTInformation( return false; } if (e && e.statusCode === 0x6d00) { - // ignore older version of ETH app - return false; + // older version of ETH app => error because we don't allow blind sign when NFT is explicitly requested to be resolved. + throw new EthAppNftNotSupported(); } throw e; } diff --git a/packages/hw-app-eth/src/errors.ts b/packages/hw-app-eth/src/errors.ts new file mode 100644 index 000000000..3f7c21afe --- /dev/null +++ b/packages/hw-app-eth/src/errors.ts @@ -0,0 +1,8 @@ +import { createCustomErrorClass } from "@ledgerhq/errors"; + +export const EthAppPleaseEnableContractData = createCustomErrorClass( + "EthAppPleaseEnableContractData" +); +export const EthAppNftNotSupported = createCustomErrorClass( + "EthAppNftNotSupported" +);