@ledgerhq/device-signer-kit-ethereum 0.0.0-signer-eth-plugin-fix-20250331141239 → 0.0.0-try-to-fix-20250429171448

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/lib/cjs/api/SignerEthBuilder.js +1 -1
  2. package/lib/cjs/api/SignerEthBuilder.js.map +3 -3
  3. package/lib/cjs/api/SignerEthBuilder.test.js +1 -1
  4. package/lib/cjs/api/SignerEthBuilder.test.js.map +3 -3
  5. package/lib/cjs/internal/app-binder/constant/plugins.js +1 -1
  6. package/lib/cjs/internal/app-binder/constant/plugins.js.map +2 -2
  7. package/lib/cjs/internal/app-binder/task/ProvideTransactionContextTask.js +1 -1
  8. package/lib/cjs/internal/app-binder/task/ProvideTransactionContextTask.js.map +3 -3
  9. package/lib/cjs/internal/app-binder/task/ProvideTransactionContextTask.test.js +1 -1
  10. package/lib/cjs/internal/app-binder/task/ProvideTransactionContextTask.test.js.map +3 -3
  11. package/lib/cjs/internal/shared/utils/ApplicationChecker.js +1 -1
  12. package/lib/cjs/internal/shared/utils/ApplicationChecker.js.map +2 -2
  13. package/lib/cjs/internal/shared/utils/ApplicationChecker.test.js +1 -1
  14. package/lib/cjs/internal/shared/utils/ApplicationChecker.test.js.map +2 -2
  15. package/lib/cjs/package.json +1 -1
  16. package/lib/esm/api/SignerEthBuilder.js +1 -1
  17. package/lib/esm/api/SignerEthBuilder.js.map +3 -3
  18. package/lib/esm/api/SignerEthBuilder.test.js +1 -1
  19. package/lib/esm/api/SignerEthBuilder.test.js.map +3 -3
  20. package/lib/esm/internal/app-binder/constant/plugins.js +1 -1
  21. package/lib/esm/internal/app-binder/constant/plugins.js.map +2 -2
  22. package/lib/esm/internal/app-binder/task/ProvideTransactionContextTask.js +1 -1
  23. package/lib/esm/internal/app-binder/task/ProvideTransactionContextTask.js.map +3 -3
  24. package/lib/esm/internal/app-binder/task/ProvideTransactionContextTask.test.js +1 -1
  25. package/lib/esm/internal/app-binder/task/ProvideTransactionContextTask.test.js.map +3 -3
  26. package/lib/esm/internal/shared/utils/ApplicationChecker.js +1 -1
  27. package/lib/esm/internal/shared/utils/ApplicationChecker.js.map +2 -2
  28. package/lib/esm/internal/shared/utils/ApplicationChecker.test.js +1 -1
  29. package/lib/esm/internal/shared/utils/ApplicationChecker.test.js.map +2 -2
  30. package/lib/esm/package.json +1 -1
  31. package/lib/types/api/SignerEthBuilder.d.ts +4 -2
  32. package/lib/types/api/SignerEthBuilder.d.ts.map +1 -1
  33. package/lib/types/internal/app-binder/constant/plugins.d.ts.map +1 -1
  34. package/lib/types/internal/shared/utils/ApplicationChecker.d.ts.map +1 -1
  35. package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
  36. package/package.json +6 -6
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/app-binder/task/ProvideTransactionContextTask.test.ts"],
4
- "sourcesContent": ["import { ClearSignContextType } from \"@ledgerhq/context-module\";\nimport {\n CommandResultFactory,\n type UnknownDeviceExchangeError,\n} from \"@ledgerhq/device-management-kit\";\n\nimport { ProvideNFTInformationCommand } from \"@internal/app-binder/command/ProvideNFTInformationCommand\";\nimport { ProvideTokenInformationCommand } from \"@internal/app-binder/command/ProvideTokenInformationCommand\";\nimport { SetExternalPluginCommand } from \"@internal/app-binder/command/SetExternalPluginCommand\";\nimport { SetPluginCommand } from \"@internal/app-binder/command/SetPluginCommand\";\nimport { type EthErrorCodes } from \"@internal/app-binder/command/utils/ethAppErrors\";\nimport { makeDeviceActionInternalApiMock } from \"@internal/app-binder/device-action/__test-utils__/makeInternalApi\";\n\nimport {\n ProvideTransactionContextTask,\n type ProvideTransactionContextTaskArgs,\n} from \"./ProvideTransactionContextTask\";\n\ndescribe(\"ProvideTransactionContextTask\", () => {\n const api = makeDeviceActionInternalApiMock();\n const successResult = CommandResultFactory<void, EthErrorCodes>({\n data: undefined,\n });\n const errorResult = CommandResultFactory<void, EthErrorCodes>({\n data: undefined,\n error: {} as UnknownDeviceExchangeError,\n });\n\n beforeEach(() => {\n vi.resetAllMocks();\n });\n\n describe(\"run\", () => {\n const args: ProvideTransactionContextTaskArgs = {\n clearSignContexts: [\n {\n type: ClearSignContextType.PLUGIN,\n payload: \"706c7567696e\", // \"plugin\"\n },\n {\n type: ClearSignContextType.EXTERNAL_PLUGIN,\n payload: \"65787465726e616c506c7567696e\", // \"externalPlugin\"\n },\n {\n type: ClearSignContextType.NFT,\n payload: \"6e6674\", // \"nft\"\n },\n {\n type: ClearSignContextType.TOKEN,\n payload: \"746f6b656e\", // \"token\"\n },\n ],\n web3Check: null,\n };\n afterEach(() => {\n vi.restoreAllMocks();\n });\n it(\"should send relative commands when receiving ClearSignContexts of type not trustedName\", async () => {\n api.sendCommand.mockResolvedValue(successResult);\n // GIVEN\n const task = new ProvideTransactionContextTask(api, args);\n // WHEN\n await task.run();\n // THEN\n expect(api.sendCommand).toHaveBeenCalledTimes(4);\n expect(api.sendCommand).toHaveBeenNthCalledWith(\n args.clearSignContexts.findIndex(\n (c) => c.type === ClearSignContextType.PLUGIN,\n ) + 1,\n expect.objectContaining(\n new SetPluginCommand({ payload: \"706c7567696e\" }),\n ),\n );\n expect(api.sendCommand).toHaveBeenNthCalledWith(\n args.clearSignContexts.findIndex(\n (c) => c.type === ClearSignContextType.EXTERNAL_PLUGIN,\n ) + 1,\n expect.objectContaining(\n new SetExternalPluginCommand({\n payload: \"65787465726e616c506c7567696e\",\n }),\n ),\n );\n expect(api.sendCommand).toHaveBeenNthCalledWith(\n args.clearSignContexts.findIndex(\n (c) => c.type === ClearSignContextType.NFT,\n ) + 1,\n expect.objectContaining(\n new ProvideNFTInformationCommand({ payload: \"6e6674\" }),\n ),\n );\n expect(api.sendCommand).toHaveBeenNthCalledWith(\n args.clearSignContexts.findIndex(\n (c) => c.type === ClearSignContextType.TOKEN,\n ) + 1,\n expect.objectContaining(\n new ProvideTokenInformationCommand({ payload: \"746f6b656e\" }),\n ),\n );\n });\n it(\"should return the command error result and stop when the command fails\", async () => {\n api.sendCommand.mockReset();\n api.sendCommand.mockResolvedValueOnce(errorResult);\n // GIVEN\n const task = new ProvideTransactionContextTask(api, args);\n // WHEN\n const result = await task.run();\n // THEN\n expect(api.sendCommand).toHaveBeenCalledTimes(1);\n expect(result.isJust()).toBe(true);\n expect(result.extract()).toStrictEqual(errorResult);\n });\n });\n});\n"],
5
- "mappings": "AAAA,OAAS,wBAAAA,MAA4B,2BACrC,OACE,wBAAAC,MAEK,kCAEP,OAAS,gCAAAC,MAAoC,4DAC7C,OAAS,kCAAAC,MAAsC,8DAC/C,OAAS,4BAAAC,MAAgC,wDACzC,OAAS,oBAAAC,MAAwB,gDAEjC,OAAS,mCAAAC,MAAuC,oEAEhD,OACE,iCAAAC,MAEK,kCAEP,SAAS,gCAAiC,IAAM,CAC9C,MAAMC,EAAMF,EAAgC,EACtCG,EAAgBR,EAA0C,CAC9D,KAAM,MACR,CAAC,EACKS,EAAcT,EAA0C,CAC5D,KAAM,OACN,MAAO,CAAC,CACV,CAAC,EAED,WAAW,IAAM,CACf,GAAG,cAAc,CACnB,CAAC,EAED,SAAS,MAAO,IAAM,CACpB,MAAMU,EAA0C,CAC9C,kBAAmB,CACjB,CACE,KAAMX,EAAqB,OAC3B,QAAS,cACX,EACA,CACE,KAAMA,EAAqB,gBAC3B,QAAS,8BACX,EACA,CACE,KAAMA,EAAqB,IAC3B,QAAS,QACX,EACA,CACE,KAAMA,EAAqB,MAC3B,QAAS,YACX,CACF,EACA,UAAW,IACb,EACA,UAAU,IAAM,CACd,GAAG,gBAAgB,CACrB,CAAC,EACD,GAAG,yFAA0F,SAAY,CACvGQ,EAAI,YAAY,kBAAkBC,CAAa,EAI/C,MAFa,IAAIF,EAA8BC,EAAKG,CAAI,EAE7C,IAAI,EAEf,OAAOH,EAAI,WAAW,EAAE,sBAAsB,CAAC,EAC/C,OAAOA,EAAI,WAAW,EAAE,wBACtBG,EAAK,kBAAkB,UACpBC,GAAMA,EAAE,OAASZ,EAAqB,MACzC,EAAI,EACJ,OAAO,iBACL,IAAIK,EAAiB,CAAE,QAAS,cAAe,CAAC,CAClD,CACF,EACA,OAAOG,EAAI,WAAW,EAAE,wBACtBG,EAAK,kBAAkB,UACpBC,GAAMA,EAAE,OAASZ,EAAqB,eACzC,EAAI,EACJ,OAAO,iBACL,IAAII,EAAyB,CAC3B,QAAS,8BACX,CAAC,CACH,CACF,EACA,OAAOI,EAAI,WAAW,EAAE,wBACtBG,EAAK,kBAAkB,UACpBC,GAAMA,EAAE,OAASZ,EAAqB,GACzC,EAAI,EACJ,OAAO,iBACL,IAAIE,EAA6B,CAAE,QAAS,QAAS,CAAC,CACxD,CACF,EACA,OAAOM,EAAI,WAAW,EAAE,wBACtBG,EAAK,kBAAkB,UACpBC,GAAMA,EAAE,OAASZ,EAAqB,KACzC,EAAI,EACJ,OAAO,iBACL,IAAIG,EAA+B,CAAE,QAAS,YAAa,CAAC,CAC9D,CACF,CACF,CAAC,EACD,GAAG,yEAA0E,SAAY,CACvFK,EAAI,YAAY,UAAU,EAC1BA,EAAI,YAAY,sBAAsBE,CAAW,EAIjD,MAAMG,EAAS,MAFF,IAAIN,EAA8BC,EAAKG,CAAI,EAE9B,IAAI,EAE9B,OAAOH,EAAI,WAAW,EAAE,sBAAsB,CAAC,EAC/C,OAAOK,EAAO,OAAO,CAAC,EAAE,KAAK,EAAI,EACjC,OAAOA,EAAO,QAAQ,CAAC,EAAE,cAAcH,CAAW,CACpD,CAAC,CACH,CAAC,CACH,CAAC",
6
- "names": ["ClearSignContextType", "CommandResultFactory", "ProvideNFTInformationCommand", "ProvideTokenInformationCommand", "SetExternalPluginCommand", "SetPluginCommand", "makeDeviceActionInternalApiMock", "ProvideTransactionContextTask", "api", "successResult", "errorResult", "args", "c", "result"]
4
+ "sourcesContent": ["import { ClearSignContextType } from \"@ledgerhq/context-module\";\nimport {\n CommandResultFactory,\n hexaStringToBuffer,\n LoadCertificateCommand,\n type UnknownDeviceExchangeError,\n} from \"@ledgerhq/device-management-kit\";\n\nimport { ProvideNFTInformationCommand } from \"@internal/app-binder/command/ProvideNFTInformationCommand\";\nimport { ProvideTokenInformationCommand } from \"@internal/app-binder/command/ProvideTokenInformationCommand\";\nimport { ProvideWeb3CheckCommand } from \"@internal/app-binder/command/ProvideWeb3CheckCommand\";\nimport { SetExternalPluginCommand } from \"@internal/app-binder/command/SetExternalPluginCommand\";\nimport { SetPluginCommand } from \"@internal/app-binder/command/SetPluginCommand\";\nimport { type EthErrorCodes } from \"@internal/app-binder/command/utils/ethAppErrors\";\nimport { makeDeviceActionInternalApiMock } from \"@internal/app-binder/device-action/__test-utils__/makeInternalApi\";\n\nimport {\n ProvideTransactionContextTask,\n type ProvideTransactionContextTaskArgs,\n} from \"./ProvideTransactionContextTask\";\n\ndescribe(\"ProvideTransactionContextTask\", () => {\n const api = makeDeviceActionInternalApiMock();\n const successResult = CommandResultFactory<void, EthErrorCodes>({\n data: undefined,\n });\n const errorResult = CommandResultFactory<void, EthErrorCodes>({\n data: undefined,\n error: {} as UnknownDeviceExchangeError,\n });\n\n beforeEach(() => {\n vi.resetAllMocks();\n });\n\n describe(\"run\", () => {\n const args: ProvideTransactionContextTaskArgs = {\n clearSignContexts: [\n {\n type: ClearSignContextType.PLUGIN,\n payload: \"706c7567696e\", // \"plugin\"\n },\n {\n type: ClearSignContextType.EXTERNAL_PLUGIN,\n payload: \"65787465726e616c506c7567696e\", // \"externalPlugin\"\n },\n {\n type: ClearSignContextType.NFT,\n payload: \"6e6674\", // \"nft\"\n },\n {\n type: ClearSignContextType.TOKEN,\n payload: \"746f6b656e\", // \"token\"\n },\n ],\n web3Check: null,\n };\n\n beforeEach(() => {\n vi.resetAllMocks();\n });\n\n it(\"should send relative commands when receiving ClearSignContexts of type not trustedName\", async () => {\n api.sendCommand.mockResolvedValue(successResult);\n // GIVEN\n const task = new ProvideTransactionContextTask(api, args);\n // WHEN\n await task.run();\n // THEN\n expect(api.sendCommand).toHaveBeenCalledTimes(4);\n expect(api.sendCommand).toHaveBeenNthCalledWith(\n args.clearSignContexts.findIndex(\n (c) => c.type === ClearSignContextType.PLUGIN,\n ) + 1,\n expect.objectContaining(\n new SetPluginCommand({ payload: \"706c7567696e\" }),\n ),\n );\n expect(api.sendCommand).toHaveBeenNthCalledWith(\n args.clearSignContexts.findIndex(\n (c) => c.type === ClearSignContextType.EXTERNAL_PLUGIN,\n ) + 1,\n expect.objectContaining(\n new SetExternalPluginCommand({\n payload: \"65787465726e616c506c7567696e\",\n }),\n ),\n );\n expect(api.sendCommand).toHaveBeenNthCalledWith(\n args.clearSignContexts.findIndex(\n (c) => c.type === ClearSignContextType.NFT,\n ) + 1,\n expect.objectContaining(\n new ProvideNFTInformationCommand({ payload: \"6e6674\" }),\n ),\n );\n expect(api.sendCommand).toHaveBeenNthCalledWith(\n args.clearSignContexts.findIndex(\n (c) => c.type === ClearSignContextType.TOKEN,\n ) + 1,\n expect.objectContaining(\n new ProvideTokenInformationCommand({ payload: \"746f6b656e\" }),\n ),\n );\n });\n\n it(\"should return the command error result and stop when the command fails\", async () => {\n api.sendCommand.mockResolvedValueOnce(errorResult);\n // GIVEN\n const task = new ProvideTransactionContextTask(api, args);\n // WHEN\n const result = await task.run();\n // THEN\n expect(api.sendCommand).toHaveBeenCalledTimes(1);\n expect(result.isJust()).toBe(true);\n expect(result.extract()).toStrictEqual(errorResult);\n });\n\n it(\"should send the web3Check command when it is provided\", async () => {\n api.sendCommand.mockResolvedValue(successResult);\n // GIVEN\n const task = new ProvideTransactionContextTask(api, {\n ...args,\n web3Check: {\n type: ClearSignContextType.WEB3_CHECK,\n payload: \"0x01020304\",\n certificate: {\n payload: new Uint8Array(),\n keyUsageNumber: 1,\n },\n },\n });\n // WHEN\n const result = await task.run();\n // THEN\n expect(api.sendCommand).toHaveBeenCalledTimes(6);\n expect(api.sendCommand).toHaveBeenNthCalledWith(\n 1,\n expect.objectContaining(\n new LoadCertificateCommand({\n certificate: new Uint8Array(),\n keyUsage: 1,\n }),\n ),\n );\n expect(api.sendCommand).toHaveBeenNthCalledWith(\n 2,\n expect.objectContaining(\n new ProvideWeb3CheckCommand({\n payload: hexaStringToBuffer(\"0x000401020304\")!,\n isFirstChunk: true,\n }),\n ),\n );\n expect(result.isJust()).toBe(false);\n });\n });\n});\n"],
5
+ "mappings": "AAAA,OAAS,wBAAAA,MAA4B,2BACrC,OACE,wBAAAC,EACA,sBAAAC,EACA,0BAAAC,MAEK,kCAEP,OAAS,gCAAAC,MAAoC,4DAC7C,OAAS,kCAAAC,MAAsC,8DAC/C,OAAS,2BAAAC,MAA+B,uDACxC,OAAS,4BAAAC,MAAgC,wDACzC,OAAS,oBAAAC,MAAwB,gDAEjC,OAAS,mCAAAC,MAAuC,oEAEhD,OACE,iCAAAC,MAEK,kCAEP,SAAS,gCAAiC,IAAM,CAC9C,MAAMC,EAAMF,EAAgC,EACtCG,EAAgBX,EAA0C,CAC9D,KAAM,MACR,CAAC,EACKY,EAAcZ,EAA0C,CAC5D,KAAM,OACN,MAAO,CAAC,CACV,CAAC,EAED,WAAW,IAAM,CACf,GAAG,cAAc,CACnB,CAAC,EAED,SAAS,MAAO,IAAM,CACpB,MAAMa,EAA0C,CAC9C,kBAAmB,CACjB,CACE,KAAMd,EAAqB,OAC3B,QAAS,cACX,EACA,CACE,KAAMA,EAAqB,gBAC3B,QAAS,8BACX,EACA,CACE,KAAMA,EAAqB,IAC3B,QAAS,QACX,EACA,CACE,KAAMA,EAAqB,MAC3B,QAAS,YACX,CACF,EACA,UAAW,IACb,EAEA,WAAW,IAAM,CACf,GAAG,cAAc,CACnB,CAAC,EAED,GAAG,yFAA0F,SAAY,CACvGW,EAAI,YAAY,kBAAkBC,CAAa,EAI/C,MAFa,IAAIF,EAA8BC,EAAKG,CAAI,EAE7C,IAAI,EAEf,OAAOH,EAAI,WAAW,EAAE,sBAAsB,CAAC,EAC/C,OAAOA,EAAI,WAAW,EAAE,wBACtBG,EAAK,k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,EAAE,wBACtB,EACA,OAAO,iBACL,IAAIR,EAAuB,CACzB,YAAa,IAAI,WACjB,SAAU,CACZ,CAAC,CACH,CACF,EACA,OAAOQ,EAAI,WAAW,EAAE,wBACtB,EACA,OAAO,iBACL,IAAIL,EAAwB,CAC1B,QAASJ,EAAmB,gBAAgB,EAC5C,aAAc,EAChB,CAAC,CACH,CACF,EACA,OAAOc,EAAO,OAAO,CAAC,EAAE,KAAK,EAAK,CACpC,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["ClearSignContextType", "CommandResultFactory", "hexaStringToBuffer", "LoadCertificateCommand", "ProvideNFTInformationCommand", "ProvideTokenInformationCommand", "ProvideWeb3CheckCommand", "SetExternalPluginCommand", "SetPluginCommand", "makeDeviceActionInternalApiMock", "ProvideTransactionContextTask", "api", "successResult", "errorResult", "args", "c", "result"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{DeviceSessionStateType as t}from"@ledgerhq/device-management-kit";import{gt as s,gte as o}from"semver";import{ETHEREUM_PLUGINS as r}from"../../app-binder/constant/plugins";class a{isCompatible=!0;version="0.0.1";modelId;constructor(e,i){if(this.modelId=e.deviceModelId,e.sessionStateType===t.Connected){this.isCompatible=!1;return}if(e.currentApp.name!=="Ethereum"&&!r.includes(e.currentApp.name)){this.isCompatible=!1;return}e.currentApp.name==="Ethereum"?this.version=e.currentApp.version:this.version=i.version}withMinVersionInclusive(e){return o(this.version,e)||(this.isCompatible=!1),this}withMinVersionExclusive(e){return s(this.version,e)||(this.isCompatible=!1),this}excludeDeviceModel(e){return this.modelId===e&&(this.isCompatible=!1),this}check(){return this.isCompatible}}export{a as ApplicationChecker};
1
+ import{DeviceSessionStateType as s}from"@ledgerhq/device-management-kit";import{gt as t,gte as o}from"semver";import{ETHEREUM_PLUGINS as r}from"../../app-binder/constant/plugins";class m{isCompatible=!0;version="0.0.1";modelId;constructor(e,i){if(this.modelId=e.deviceModelId,e.sessionStateType===s.Connected){this.isCompatible=!1;return}if(e.currentApp.name!=="Ethereum"&&!r.includes(e.currentApp.name)){this.isCompatible=!1;return}e.currentApp.name==="Ethereum"?this.version=e.currentApp.version:e.currentApp.name==="Exchange"?this.isCompatible=!1:this.version=i.version}withMinVersionInclusive(e){return o(this.version,e)||(this.isCompatible=!1),this}withMinVersionExclusive(e){return t(this.version,e)||(this.isCompatible=!1),this}excludeDeviceModel(e){return this.modelId===e&&(this.isCompatible=!1),this}check(){return this.isCompatible}}export{m as ApplicationChecker};
2
2
  //# sourceMappingURL=ApplicationChecker.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/shared/utils/ApplicationChecker.ts"],
4
- "sourcesContent": ["import {\n type DeviceModelId,\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@ledgerhq/device-management-kit\";\nimport { gt, gte } from \"semver\";\n\nimport { type GetConfigCommandResponse } from \"@api/app-binder/GetConfigCommandTypes\";\nimport { ETHEREUM_PLUGINS } from \"@internal/app-binder/constant/plugins\";\n\nexport class ApplicationChecker {\n private isCompatible: boolean = true;\n private version: string = \"0.0.1\";\n private modelId: DeviceModelId;\n\n constructor(\n deviceState: DeviceSessionState,\n appConfig: GetConfigCommandResponse,\n ) {\n this.modelId = deviceState.deviceModelId;\n\n // If device is not ready or app is unexpected, checker cannot be successful\n if (deviceState.sessionStateType === DeviceSessionStateType.Connected) {\n this.isCompatible = false;\n return;\n }\n if (\n deviceState.currentApp.name !== \"Ethereum\" &&\n !ETHEREUM_PLUGINS.includes(deviceState.currentApp.name)\n ) {\n this.isCompatible = false;\n return;\n }\n if (deviceState.currentApp.name === \"Ethereum\") {\n this.version = deviceState.currentApp.version;\n } else {\n // Fallback on appConfig version if a plugin is running.\n // It won't contain release candidate suffix but it should be enough for that edge case.\n this.version = appConfig.version;\n }\n }\n\n withMinVersionInclusive(version: string): ApplicationChecker {\n if (!gte(this.version, version)) {\n this.isCompatible = false;\n }\n return this;\n }\n\n withMinVersionExclusive(version: string): ApplicationChecker {\n if (!gt(this.version, version)) {\n this.isCompatible = false;\n }\n return this;\n }\n\n excludeDeviceModel(modelId: DeviceModelId): ApplicationChecker {\n if (this.modelId === modelId) {\n this.isCompatible = false;\n }\n return this;\n }\n\n check(): boolean {\n return this.isCompatible;\n }\n}\n"],
5
- "mappings": "AAAA,OAGE,0BAAAA,MACK,kCACP,OAAS,MAAAC,EAAI,OAAAC,MAAW,SAGxB,OAAS,oBAAAC,MAAwB,wCAE1B,MAAMC,CAAmB,CACtB,aAAwB,GACxB,QAAkB,QAClB,QAER,YACEC,EACAC,EACA,CAIA,GAHA,KAAK,QAAUD,EAAY,cAGvBA,EAAY,mBAAqBL,EAAuB,UAAW,CACrE,KAAK,aAAe,GACpB,MACF,CACA,GACEK,EAAY,WAAW,OAAS,YAChC,CAACF,EAAiB,SAASE,EAAY,WAAW,IAAI,EACtD,CACA,KAAK,aAAe,GACpB,MACF,CACIA,EAAY,WAAW,OAAS,WAClC,KAAK,QAAUA,EAAY,WAAW,QAItC,KAAK,QAAUC,EAAU,OAE7B,CAEA,wBAAwBC,EAAqC,CAC3D,OAAKL,EAAI,KAAK,QAASK,CAAO,IAC5B,KAAK,aAAe,IAEf,IACT,CAEA,wBAAwBA,EAAqC,CAC3D,OAAKN,EAAG,KAAK,QAASM,CAAO,IAC3B,KAAK,aAAe,IAEf,IACT,CAEA,mBAAmBC,EAA4C,CAC7D,OAAI,KAAK,UAAYA,IACnB,KAAK,aAAe,IAEf,IACT,CAEA,OAAiB,CACf,OAAO,KAAK,YACd,CACF",
4
+ "sourcesContent": ["import {\n type DeviceModelId,\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@ledgerhq/device-management-kit\";\nimport { gt, gte } from \"semver\";\n\nimport { type GetConfigCommandResponse } from \"@api/app-binder/GetConfigCommandTypes\";\nimport { ETHEREUM_PLUGINS } from \"@internal/app-binder/constant/plugins\";\n\nexport class ApplicationChecker {\n private isCompatible: boolean = true;\n private version: string = \"0.0.1\";\n private modelId: DeviceModelId;\n\n constructor(\n deviceState: DeviceSessionState,\n appConfig: GetConfigCommandResponse,\n ) {\n this.modelId = deviceState.deviceModelId;\n\n // If device is not ready or app is unexpected, checker cannot be successful\n if (deviceState.sessionStateType === DeviceSessionStateType.Connected) {\n this.isCompatible = false;\n return;\n }\n if (\n deviceState.currentApp.name !== \"Ethereum\" &&\n !ETHEREUM_PLUGINS.includes(deviceState.currentApp.name)\n ) {\n this.isCompatible = false;\n return;\n }\n if (deviceState.currentApp.name === \"Ethereum\") {\n this.version = deviceState.currentApp.version;\n } else if (deviceState.currentApp.name === \"Exchange\") {\n // Exchanges flows are not compatibles with ethereum features appart from SignTx\n this.isCompatible = false;\n } else {\n // Fallback on appConfig version if a plugin is running.\n // It won't contain release candidate suffix but it should be enough for that edge case.\n this.version = appConfig.version;\n }\n }\n\n withMinVersionInclusive(version: string): ApplicationChecker {\n if (!gte(this.version, version)) {\n this.isCompatible = false;\n }\n return this;\n }\n\n withMinVersionExclusive(version: string): ApplicationChecker {\n if (!gt(this.version, version)) {\n this.isCompatible = false;\n }\n return this;\n }\n\n excludeDeviceModel(modelId: DeviceModelId): ApplicationChecker {\n if (this.modelId === modelId) {\n this.isCompatible = false;\n }\n return this;\n }\n\n check(): boolean {\n return this.isCompatible;\n }\n}\n"],
5
+ "mappings": "AAAA,OAGE,0BAAAA,MACK,kCACP,OAAS,MAAAC,EAAI,OAAAC,MAAW,SAGxB,OAAS,oBAAAC,MAAwB,wCAE1B,MAAMC,CAAmB,CACtB,aAAwB,GACxB,QAAkB,QAClB,QAER,YACEC,EACAC,EACA,CAIA,GAHA,KAAK,QAAUD,EAAY,cAGvBA,EAAY,mBAAqBL,EAAuB,UAAW,CACrE,KAAK,aAAe,GACpB,MACF,CACA,GACEK,EAAY,WAAW,OAAS,YAChC,CAACF,EAAiB,SAASE,EAAY,WAAW,IAAI,EACtD,CACA,KAAK,aAAe,GACpB,MACF,CACIA,EAAY,WAAW,OAAS,WAClC,KAAK,QAAUA,EAAY,WAAW,QAC7BA,EAAY,WAAW,OAAS,WAEzC,KAAK,aAAe,GAIpB,KAAK,QAAUC,EAAU,OAE7B,CAEA,wBAAwBC,EAAqC,CAC3D,OAAKL,EAAI,KAAK,QAASK,CAAO,IAC5B,KAAK,aAAe,IAEf,IACT,CAEA,wBAAwBA,EAAqC,CAC3D,OAAKN,EAAG,KAAK,QAASM,CAAO,IAC3B,KAAK,aAAe,IAEf,IACT,CAEA,mBAAmBC,EAA4C,CAC7D,OAAI,KAAK,UAAYA,IACnB,KAAK,aAAe,IAEf,IACT,CAEA,OAAiB,CACf,OAAO,KAAK,YACd,CACF",
6
6
  "names": ["DeviceSessionStateType", "gt", "gte", "ETHEREUM_PLUGINS", "ApplicationChecker", "deviceState", "appConfig", "version", "modelId"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{DeviceModelId as c,DeviceSessionStateType as i,DeviceStatus as o}from"@ledgerhq/device-management-kit";import{ApplicationChecker as l}from"./ApplicationChecker";describe("ApplicationChecker",()=>{function s(e){return{blindSigningEnabled:!1,web3ChecksEnabled:!1,web3ChecksOptIn:!1,version:e}}it("should pass the check for exclusive version",()=>{const e={sessionStateType:i.ReadyWithoutSecureChannel,deviceStatus:o.CONNECTED,installedApps:[],currentApp:{name:"Ethereum",version:"1.13.0-rc"},deviceModelId:c.FLEX,isSecureConnectionAllowed:!1},t=s("1.13.0"),n=new l(e,t).withMinVersionExclusive("1.12.0").check();expect(n).toStrictEqual(!0)}),it("should reject the check for exclusive version",()=>{const e={sessionStateType:i.ReadyWithoutSecureChannel,deviceStatus:o.CONNECTED,installedApps:[],currentApp:{name:"Ethereum",version:"1.12.0"},deviceModelId:c.FLEX,isSecureConnectionAllowed:!1},t=s("1.12.0"),n=new l(e,t).withMinVersionExclusive("1.12.0").check();expect(n).toStrictEqual(!1)}),it("should pass the check for inclusive version",()=>{const e={sessionStateType:i.ReadyWithoutSecureChannel,deviceStatus:o.CONNECTED,installedApps:[],currentApp:{name:"Ethereum",version:"1.12.0"},deviceModelId:c.FLEX,isSecureConnectionAllowed:!1},t=s("1.10.0"),n=new l(e,t).withMinVersionInclusive("1.12.0").check();expect(n).toStrictEqual(!0)}),it("should reject the check for inclusive version",()=>{const e={sessionStateType:i.ReadyWithoutSecureChannel,deviceStatus:o.CONNECTED,installedApps:[],currentApp:{name:"Ethereum",version:"1.11.0"},deviceModelId:c.FLEX,isSecureConnectionAllowed:!1},t=s("1.11.0"),n=new l(e,t).withMinVersionInclusive("1.12.0").check();expect(n).toStrictEqual(!1)}),it("should pass the check for excluded device",()=>{const e={sessionStateType:i.ReadyWithoutSecureChannel,deviceStatus:o.CONNECTED,installedApps:[],currentApp:{name:"Ethereum",version:"1.11.0"},deviceModelId:c.FLEX,isSecureConnectionAllowed:!1},t=s("1.11.0"),n=new l(e,t).excludeDeviceModel(c.NANO_S).check();expect(n).toStrictEqual(!0)}),it("should reject the check for excluded device",()=>{const e={sessionStateType:i.ReadyWithoutSecureChannel,deviceStatus:o.CONNECTED,installedApps:[],currentApp:{name:"Ethereum",version:"1.11.0"},deviceModelId:c.FLEX,isSecureConnectionAllowed:!1},t=s("1.11.0"),n=new l(e,t).excludeDeviceModel(c.FLEX).check();expect(n).toStrictEqual(!1)}),it("should pass the check for chained condition",()=>{const e={sessionStateType:i.ReadyWithoutSecureChannel,deviceStatus:o.CONNECTED,installedApps:[],currentApp:{name:"Ethereum",version:"1.11.0"},deviceModelId:c.FLEX,isSecureConnectionAllowed:!1},t=s("1.11.0"),n=new l(e,t).withMinVersionInclusive("1.11.0").excludeDeviceModel(c.NANO_S).check();expect(n).toStrictEqual(!0)}),it("should reject the check for chained condition",()=>{const e={sessionStateType:i.ReadyWithoutSecureChannel,deviceStatus:o.CONNECTED,installedApps:[],currentApp:{name:"Ethereum",version:"1.10.0"},deviceModelId:c.FLEX,isSecureConnectionAllowed:!1},t=s("1.10.0"),n=new l(e,t).withMinVersionInclusive("1.11.0").excludeDeviceModel(c.NANO_S).check();expect(n).toStrictEqual(!1)}),it("should pass the check in plugins",()=>{const e={sessionStateType:i.ReadyWithoutSecureChannel,deviceStatus:o.CONNECTED,installedApps:[],currentApp:{name:"1inch",version:"1.11.0-rc"},deviceModelId:c.FLEX,isSecureConnectionAllowed:!1},t=s("1.13.0"),n=new l(e,t).withMinVersionExclusive("1.12.0").check();expect(n).toStrictEqual(!0)}),it("should reject the check in unknexpected app",()=>{const e={sessionStateType:i.ReadyWithoutSecureChannel,deviceStatus:o.CONNECTED,installedApps:[],currentApp:{name:"Bitcoin",version:"1.13.0-rc"},deviceModelId:c.FLEX,isSecureConnectionAllowed:!1},t=s("1.13.0"),n=new l(e,t).withMinVersionExclusive("1.12.0").check();expect(n).toStrictEqual(!1)}),it("should reject the check in unknexpected state",()=>{const e={sessionStateType:i.Connected,deviceStatus:o.CONNECTED,installedApps:[],currentApp:{name:"Bitcoin",version:"1.13.0-rc"},deviceModelId:c.FLEX,isSecureConnectionAllowed:!1},t=s("1.13.0"),n=new l(e,t).withMinVersionExclusive("1.12.0").check();expect(n).toStrictEqual(!1)})});
1
+ import{DeviceModelId as c,DeviceSessionStateType as i,DeviceStatus as o}from"@ledgerhq/device-management-kit";import{ApplicationChecker as l}from"./ApplicationChecker";describe("ApplicationChecker",()=>{function s(e){return{blindSigningEnabled:!1,web3ChecksEnabled:!1,web3ChecksOptIn:!1,version:e}}it("should pass the check for exclusive version",()=>{const e={sessionStateType:i.ReadyWithoutSecureChannel,deviceStatus:o.CONNECTED,installedApps:[],currentApp:{name:"Ethereum",version:"1.13.0-rc"},deviceModelId:c.FLEX,isSecureConnectionAllowed:!1},t=s("1.13.0"),n=new l(e,t).withMinVersionExclusive("1.12.0").check();expect(n).toStrictEqual(!0)}),it("should reject the check for exclusive version",()=>{const e={sessionStateType:i.ReadyWithoutSecureChannel,deviceStatus:o.CONNECTED,installedApps:[],currentApp:{name:"Ethereum",version:"1.12.0"},deviceModelId:c.FLEX,isSecureConnectionAllowed:!1},t=s("1.12.0"),n=new l(e,t).withMinVersionExclusive("1.12.0").check();expect(n).toStrictEqual(!1)}),it("should pass the check for inclusive version",()=>{const e={sessionStateType:i.ReadyWithoutSecureChannel,deviceStatus:o.CONNECTED,installedApps:[],currentApp:{name:"Ethereum",version:"1.12.0"},deviceModelId:c.FLEX,isSecureConnectionAllowed:!1},t=s("1.10.0"),n=new l(e,t).withMinVersionInclusive("1.12.0").check();expect(n).toStrictEqual(!0)}),it("should reject the check for inclusive version",()=>{const e={sessionStateType:i.ReadyWithoutSecureChannel,deviceStatus:o.CONNECTED,installedApps:[],currentApp:{name:"Ethereum",version:"1.11.0"},deviceModelId:c.FLEX,isSecureConnectionAllowed:!1},t=s("1.11.0"),n=new l(e,t).withMinVersionInclusive("1.12.0").check();expect(n).toStrictEqual(!1)}),it("should pass the check for excluded device",()=>{const e={sessionStateType:i.ReadyWithoutSecureChannel,deviceStatus:o.CONNECTED,installedApps:[],currentApp:{name:"Ethereum",version:"1.11.0"},deviceModelId:c.FLEX,isSecureConnectionAllowed:!1},t=s("1.11.0"),n=new l(e,t).excludeDeviceModel(c.NANO_S).check();expect(n).toStrictEqual(!0)}),it("should reject the check for excluded device",()=>{const e={sessionStateType:i.ReadyWithoutSecureChannel,deviceStatus:o.CONNECTED,installedApps:[],currentApp:{name:"Ethereum",version:"1.11.0"},deviceModelId:c.FLEX,isSecureConnectionAllowed:!1},t=s("1.11.0"),n=new l(e,t).excludeDeviceModel(c.FLEX).check();expect(n).toStrictEqual(!1)}),it("should pass the check for chained condition",()=>{const e={sessionStateType:i.ReadyWithoutSecureChannel,deviceStatus:o.CONNECTED,installedApps:[],currentApp:{name:"Ethereum",version:"1.11.0"},deviceModelId:c.FLEX,isSecureConnectionAllowed:!1},t=s("1.11.0"),n=new l(e,t).withMinVersionInclusive("1.11.0").excludeDeviceModel(c.NANO_S).check();expect(n).toStrictEqual(!0)}),it("should reject the check for chained condition",()=>{const e={sessionStateType:i.ReadyWithoutSecureChannel,deviceStatus:o.CONNECTED,installedApps:[],currentApp:{name:"Ethereum",version:"1.10.0"},deviceModelId:c.FLEX,isSecureConnectionAllowed:!1},t=s("1.10.0"),n=new l(e,t).withMinVersionInclusive("1.11.0").excludeDeviceModel(c.NANO_S).check();expect(n).toStrictEqual(!1)}),it("exchange app should not be compatible with eth features",()=>{const e={sessionStateType:i.ReadyWithoutSecureChannel,deviceStatus:o.CONNECTED,installedApps:[],currentApp:{name:"Exchange",version:"1.11.0-rc"},deviceModelId:c.FLEX,isSecureConnectionAllowed:!1},t=s("1.13.0"),n=new l(e,t).check();expect(n).toStrictEqual(!1)}),it("should pass the check in plugins",()=>{const e={sessionStateType:i.ReadyWithoutSecureChannel,deviceStatus:o.CONNECTED,installedApps:[],currentApp:{name:"1inch",version:"1.11.0-rc"},deviceModelId:c.FLEX,isSecureConnectionAllowed:!1},t=s("1.13.0"),n=new l(e,t).withMinVersionExclusive("1.12.0").check();expect(n).toStrictEqual(!0)}),it("should reject the check in unknexpected app",()=>{const e={sessionStateType:i.ReadyWithoutSecureChannel,deviceStatus:o.CONNECTED,installedApps:[],currentApp:{name:"Bitcoin",version:"1.13.0-rc"},deviceModelId:c.FLEX,isSecureConnectionAllowed:!1},t=s("1.13.0"),n=new l(e,t).withMinVersionExclusive("1.12.0").check();expect(n).toStrictEqual(!1)}),it("should reject the check in unknexpected state",()=>{const e={sessionStateType:i.Connected,deviceStatus:o.CONNECTED,installedApps:[],currentApp:{name:"Bitcoin",version:"1.13.0-rc"},deviceModelId:c.FLEX,isSecureConnectionAllowed:!1},t=s("1.13.0"),n=new l(e,t).withMinVersionExclusive("1.12.0").check();expect(n).toStrictEqual(!1)})});
2
2
  //# sourceMappingURL=ApplicationChecker.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/shared/utils/ApplicationChecker.test.ts"],
4
- "sourcesContent": ["import {\n DeviceModelId,\n DeviceSessionStateType,\n DeviceStatus,\n} from \"@ledgerhq/device-management-kit\";\n\nimport type { GetConfigCommandResponse } from \"@api/app-binder/GetConfigCommandTypes\";\n\nimport { ApplicationChecker } from \"./ApplicationChecker\";\n\ndescribe(\"ApplicationChecker\", () => {\n function createAppConfig(version: string): GetConfigCommandResponse {\n return {\n blindSigningEnabled: false,\n web3ChecksEnabled: false,\n web3ChecksOptIn: false,\n version,\n };\n }\n\n it(\"should pass the check for exclusive version\", () => {\n // GIVEN\n const state = {\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [],\n currentApp: { name: \"Ethereum\", version: \"1.13.0-rc\" },\n deviceModelId: DeviceModelId.FLEX,\n isSecureConnectionAllowed: false,\n };\n const config = createAppConfig(\"1.13.0\");\n // WHEN\n const result = new ApplicationChecker(state, config)\n .withMinVersionExclusive(\"1.12.0\")\n .check();\n // THEN\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject the check for exclusive version\", () => {\n // GIVEN\n const state = {\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [],\n currentApp: { name: \"Ethereum\", version: \"1.12.0\" },\n deviceModelId: DeviceModelId.FLEX,\n isSecureConnectionAllowed: false,\n };\n const config = createAppConfig(\"1.12.0\");\n // WHEN\n const result = new ApplicationChecker(state, config)\n .withMinVersionExclusive(\"1.12.0\")\n .check();\n // THEN\n expect(result).toStrictEqual(false);\n });\n\n it(\"should pass the check for inclusive version\", () => {\n // GIVEN\n const state = {\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [],\n currentApp: { name: \"Ethereum\", version: \"1.12.0\" },\n deviceModelId: DeviceModelId.FLEX,\n isSecureConnectionAllowed: false,\n };\n const config = createAppConfig(\"1.10.0\");\n // WHEN\n const result = new ApplicationChecker(state, config)\n .withMinVersionInclusive(\"1.12.0\")\n .check();\n // THEN\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject the check for inclusive version\", () => {\n // GIVEN\n const state = {\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [],\n currentApp: { name: \"Ethereum\", version: \"1.11.0\" },\n deviceModelId: DeviceModelId.FLEX,\n isSecureConnectionAllowed: false,\n };\n const config = createAppConfig(\"1.11.0\");\n // WHEN\n const result = new ApplicationChecker(state, config)\n .withMinVersionInclusive(\"1.12.0\")\n .check();\n // THEN\n expect(result).toStrictEqual(false);\n });\n\n it(\"should pass the check for excluded device\", () => {\n // GIVEN\n const state = {\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [],\n currentApp: { name: \"Ethereum\", version: \"1.11.0\" },\n deviceModelId: DeviceModelId.FLEX,\n isSecureConnectionAllowed: false,\n };\n const config = createAppConfig(\"1.11.0\");\n // WHEN\n const result = new ApplicationChecker(state, config)\n .excludeDeviceModel(DeviceModelId.NANO_S)\n .check();\n // THEN\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject the check for excluded device\", () => {\n // GIVEN\n const state = {\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [],\n currentApp: { name: \"Ethereum\", version: \"1.11.0\" },\n deviceModelId: DeviceModelId.FLEX,\n isSecureConnectionAllowed: false,\n };\n const config = createAppConfig(\"1.11.0\");\n // WHEN\n const result = new ApplicationChecker(state, config)\n .excludeDeviceModel(DeviceModelId.FLEX)\n .check();\n // THEN\n expect(result).toStrictEqual(false);\n });\n\n it(\"should pass the check for chained condition\", () => {\n // GIVEN\n const state = {\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [],\n currentApp: { name: \"Ethereum\", version: \"1.11.0\" },\n deviceModelId: DeviceModelId.FLEX,\n isSecureConnectionAllowed: false,\n };\n const config = createAppConfig(\"1.11.0\");\n // WHEN\n const result = new ApplicationChecker(state, config)\n .withMinVersionInclusive(\"1.11.0\")\n .excludeDeviceModel(DeviceModelId.NANO_S)\n .check();\n // THEN\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject the check for chained condition\", () => {\n // GIVEN\n const state = {\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [],\n currentApp: { name: \"Ethereum\", version: \"1.10.0\" },\n deviceModelId: DeviceModelId.FLEX,\n isSecureConnectionAllowed: false,\n };\n const config = createAppConfig(\"1.10.0\");\n // WHEN\n const result = new ApplicationChecker(state, config)\n .withMinVersionInclusive(\"1.11.0\")\n .excludeDeviceModel(DeviceModelId.NANO_S)\n .check();\n // THEN\n expect(result).toStrictEqual(false);\n });\n\n it(\"should pass the check in plugins\", () => {\n // GIVEN\n const state = {\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [],\n currentApp: { name: \"1inch\", version: \"1.11.0-rc\" },\n deviceModelId: DeviceModelId.FLEX,\n isSecureConnectionAllowed: false,\n };\n const config = createAppConfig(\"1.13.0\");\n // WHEN\n const result = new ApplicationChecker(state, config)\n .withMinVersionExclusive(\"1.12.0\")\n .check();\n // THEN\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject the check in unknexpected app\", () => {\n // GIVEN\n const state = {\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [],\n currentApp: { name: \"Bitcoin\", version: \"1.13.0-rc\" },\n deviceModelId: DeviceModelId.FLEX,\n isSecureConnectionAllowed: false,\n };\n const config = createAppConfig(\"1.13.0\");\n // WHEN\n const result = new ApplicationChecker(state, config)\n .withMinVersionExclusive(\"1.12.0\")\n .check();\n // THEN\n expect(result).toStrictEqual(false);\n });\n\n it(\"should reject the check in unknexpected state\", () => {\n // GIVEN\n const state = {\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [],\n currentApp: { name: \"Bitcoin\", version: \"1.13.0-rc\" },\n deviceModelId: DeviceModelId.FLEX,\n isSecureConnectionAllowed: false,\n };\n const config = createAppConfig(\"1.13.0\");\n // WHEN\n const result = new ApplicationChecker(state, config)\n .withMinVersionExclusive(\"1.12.0\")\n .check();\n // THEN\n expect(result).toStrictEqual(false);\n });\n});\n"],
5
- "mappings": "AAAA,OACE,iBAAAA,EACA,0BAAAC,EACA,gBAAAC,MACK,kCAIP,OAAS,sBAAAC,MAA0B,uBAEnC,SAAS,qBAAsB,IAAM,CACnC,SAASC,EAAgBC,EAA2C,CAClE,MAAO,CACL,oBAAqB,GACrB,kBAAmB,GACnB,gBAAiB,GACjB,QAAAA,CACF,CACF,CAEA,GAAG,8CAA+C,IAAM,CAEtD,MAAMC,EAAQ,CACZ,iBAAkBL,EAAuB,0BACzC,aAAcC,EAAa,UAC3B,cAAe,CAAC,EAChB,WAAY,CAAE,KAAM,WAAY,QAAS,WAAY,EACrD,cAAeF,EAAc,KAC7B,0BAA2B,EAC7B,EACMO,EAASH,EAAgB,QAAQ,EAEjCI,EAAS,IAAIL,EAAmBG,EAAOC,CAAM,EAChD,wBAAwB,QAAQ,EAChC,MAAM,EAET,OAAOC,CAAM,EAAE,cAAc,EAAI,CACnC,CAAC,EAED,GAAG,gDAAiD,IAAM,CAExD,MAAMF,EAAQ,CACZ,iBAAkBL,EAAuB,0BACzC,aAAcC,EAAa,UAC3B,cAAe,CAAC,EAChB,WAAY,CAAE,KAAM,WAAY,QAAS,QAAS,EAClD,cAAeF,EAAc,KAC7B,0BAA2B,EAC7B,EACMO,EAASH,EAAgB,QAAQ,EAEjCI,EAAS,IAAIL,EAAmBG,EAAOC,CAAM,EAChD,wBAAwB,QAAQ,EAChC,MAAM,EAET,OAAOC,CAAM,EAAE,cAAc,EAAK,CACpC,CAAC,EAED,GAAG,8CAA+C,IAAM,CAEtD,M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8CAA+C,IAAM,CAEtD,MAAMF,EAAQ,CACZ,iBAAkBL,EAAuB,0BACzC,aAAcC,EAAa,UAC3B,cAAe,CAAC,EAChB,WAAY,CAAE,KAAM,UAAW,QAAS,WAAY,EACpD,cAAeF,EAAc,KAC7B,0BAA2B,EAC7B,EACMO,EAASH,EAAgB,QAAQ,EAEjCI,EAAS,IAAIL,EAAmBG,EAAOC,CAAM,EAChD,wBAAwB,QAAQ,EAChC,MAAM,EAET,OAAOC,CAAM,EAAE,cAAc,EAAK,CACpC,CAAC,EAED,GAAG,gDAAiD,IAAM,CAExD,MAAMF,EAAQ,CACZ,iBAAkBL,EAAuB,UACzC,aAAcC,EAAa,UAC3B,cAAe,CAAC,EAChB,WAAY,CAAE,KAAM,UAAW,QAAS,WAAY,EACpD,cAAeF,EAAc,KAC7B,0BAA2B,EAC7B,EACMO,EAASH,EAAgB,QAAQ,EAEjCI,EAAS,IAAIL,EAAmBG,EAAOC,CAAM,EAChD,wBAAwB,QAAQ,EAChC,MAAM,EAET,OAAOC,CAAM,EAAE,cAAc,EAAK,CACpC,CAAC,CACH,CAAC",
4
+ "sourcesContent": ["import {\n DeviceModelId,\n DeviceSessionStateType,\n DeviceStatus,\n} from \"@ledgerhq/device-management-kit\";\n\nimport type { GetConfigCommandResponse } from \"@api/app-binder/GetConfigCommandTypes\";\n\nimport { ApplicationChecker } from \"./ApplicationChecker\";\n\ndescribe(\"ApplicationChecker\", () => {\n function createAppConfig(version: string): GetConfigCommandResponse {\n return {\n blindSigningEnabled: false,\n web3ChecksEnabled: false,\n web3ChecksOptIn: false,\n version,\n };\n }\n\n it(\"should pass the check for exclusive version\", () => {\n // GIVEN\n const state = {\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [],\n currentApp: { name: \"Ethereum\", version: \"1.13.0-rc\" },\n deviceModelId: DeviceModelId.FLEX,\n isSecureConnectionAllowed: false,\n };\n const config = createAppConfig(\"1.13.0\");\n // WHEN\n const result = new ApplicationChecker(state, config)\n .withMinVersionExclusive(\"1.12.0\")\n .check();\n // THEN\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject the check for exclusive version\", () => {\n // GIVEN\n const state = {\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [],\n currentApp: { name: \"Ethereum\", version: \"1.12.0\" },\n deviceModelId: DeviceModelId.FLEX,\n isSecureConnectionAllowed: false,\n };\n const config = createAppConfig(\"1.12.0\");\n // WHEN\n const result = new ApplicationChecker(state, config)\n .withMinVersionExclusive(\"1.12.0\")\n .check();\n // THEN\n expect(result).toStrictEqual(false);\n });\n\n it(\"should pass the check for inclusive version\", () => {\n // GIVEN\n const state = {\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [],\n currentApp: { name: \"Ethereum\", version: \"1.12.0\" },\n deviceModelId: DeviceModelId.FLEX,\n isSecureConnectionAllowed: false,\n };\n const config = createAppConfig(\"1.10.0\");\n // WHEN\n const result = new ApplicationChecker(state, config)\n .withMinVersionInclusive(\"1.12.0\")\n .check();\n // THEN\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject the check for inclusive version\", () => {\n // GIVEN\n const state = {\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [],\n currentApp: { name: \"Ethereum\", version: \"1.11.0\" },\n deviceModelId: DeviceModelId.FLEX,\n isSecureConnectionAllowed: false,\n };\n const config = createAppConfig(\"1.11.0\");\n // WHEN\n const result = new ApplicationChecker(state, config)\n .withMinVersionInclusive(\"1.12.0\")\n .check();\n // THEN\n expect(result).toStrictEqual(false);\n });\n\n it(\"should pass the check for excluded device\", () => {\n // GIVEN\n const state = {\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [],\n currentApp: { name: \"Ethereum\", version: \"1.11.0\" },\n deviceModelId: DeviceModelId.FLEX,\n isSecureConnectionAllowed: false,\n };\n const config = createAppConfig(\"1.11.0\");\n // WHEN\n const result = new ApplicationChecker(state, config)\n .excludeDeviceModel(DeviceModelId.NANO_S)\n .check();\n // THEN\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject the check for excluded device\", () => {\n // GIVEN\n const state = {\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [],\n currentApp: { name: \"Ethereum\", version: \"1.11.0\" },\n deviceModelId: DeviceModelId.FLEX,\n isSecureConnectionAllowed: false,\n };\n const config = createAppConfig(\"1.11.0\");\n // WHEN\n const result = new ApplicationChecker(state, config)\n .excludeDeviceModel(DeviceModelId.FLEX)\n .check();\n // THEN\n expect(result).toStrictEqual(false);\n });\n\n it(\"should pass the check for chained condition\", () => {\n // GIVEN\n const state = {\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [],\n currentApp: { name: \"Ethereum\", version: \"1.11.0\" },\n deviceModelId: DeviceModelId.FLEX,\n isSecureConnectionAllowed: false,\n };\n const config = createAppConfig(\"1.11.0\");\n // WHEN\n const result = new ApplicationChecker(state, config)\n .withMinVersionInclusive(\"1.11.0\")\n .excludeDeviceModel(DeviceModelId.NANO_S)\n .check();\n // THEN\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject the check for chained condition\", () => {\n // GIVEN\n const state = {\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [],\n currentApp: { name: \"Ethereum\", version: \"1.10.0\" },\n deviceModelId: DeviceModelId.FLEX,\n isSecureConnectionAllowed: false,\n };\n const config = createAppConfig(\"1.10.0\");\n // WHEN\n const result = new ApplicationChecker(state, config)\n .withMinVersionInclusive(\"1.11.0\")\n .excludeDeviceModel(DeviceModelId.NANO_S)\n .check();\n // THEN\n expect(result).toStrictEqual(false);\n });\n\n it(\"exchange app should not be compatible with eth features\", () => {\n // GIVEN\n const state = {\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [],\n currentApp: { name: \"Exchange\", version: \"1.11.0-rc\" },\n deviceModelId: DeviceModelId.FLEX,\n isSecureConnectionAllowed: false,\n };\n const config = createAppConfig(\"1.13.0\");\n // WHEN\n const result = new ApplicationChecker(state, config).check();\n // THEN\n expect(result).toStrictEqual(false);\n });\n\n it(\"should pass the check in plugins\", () => {\n // GIVEN\n const state = {\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [],\n currentApp: { name: \"1inch\", version: \"1.11.0-rc\" },\n deviceModelId: DeviceModelId.FLEX,\n isSecureConnectionAllowed: false,\n };\n const config = createAppConfig(\"1.13.0\");\n // WHEN\n const result = new ApplicationChecker(state, config)\n .withMinVersionExclusive(\"1.12.0\")\n .check();\n // THEN\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject the check in unknexpected app\", () => {\n // GIVEN\n const state = {\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [],\n currentApp: { name: \"Bitcoin\", version: \"1.13.0-rc\" },\n deviceModelId: DeviceModelId.FLEX,\n isSecureConnectionAllowed: false,\n };\n const config = createAppConfig(\"1.13.0\");\n // WHEN\n const result = new ApplicationChecker(state, config)\n .withMinVersionExclusive(\"1.12.0\")\n .check();\n // THEN\n expect(result).toStrictEqual(false);\n });\n\n it(\"should reject the check in unknexpected state\", () => {\n // GIVEN\n const state = {\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [],\n currentApp: { name: \"Bitcoin\", version: \"1.13.0-rc\" },\n deviceModelId: DeviceModelId.FLEX,\n isSecureConnectionAllowed: false,\n };\n const config = createAppConfig(\"1.13.0\");\n // WHEN\n const result = new ApplicationChecker(state, config)\n .withMinVersionExclusive(\"1.12.0\")\n .check();\n // THEN\n expect(result).toStrictEqual(false);\n });\n});\n"],
5
+ "mappings": "AAAA,OACE,iBAAAA,EACA,0BAAAC,EACA,gBAAAC,MACK,kCAIP,OAAS,sBAAAC,MAA0B,uBAEnC,SAAS,qBAAsB,IAAM,CACnC,SAASC,EAAgBC,EAA2C,CAClE,MAAO,CACL,oBAAqB,GACrB,kBAAmB,GACnB,gBAAiB,GACjB,QAAAA,CACF,CACF,CAEA,GAAG,8CAA+C,IAAM,CAEtD,MAAMC,EAAQ,CACZ,iBAAkBL,EAAuB,0BACzC,aAAcC,EAAa,UAC3B,cAAe,CAAC,EAChB,WAAY,CAAE,KAAM,WAAY,QAAS,WAAY,EACrD,cAAeF,EAAc,KAC7B,0BAA2B,EAC7B,EACMO,EAASH,EAAgB,QAAQ,EAEjCI,EAAS,IAAIL,EAAmBG,EAAOC,CAAM,EAChD,wBAAwB,QAAQ,EAChC,MAAM,EAET,OAAOC,CAAM,EAAE,cAAc,EAAI,CACnC,CAAC,EAED,GAAG,gDAAiD,IAAM,CAExD,MAAMF,EAAQ,CACZ,iBAAkBL,EAAuB,0BACzC,aAAcC,EAAa,UAC3B,cAAe,CAAC,EAChB,WAAY,CAAE,KAAM,WAAY,QAAS,QAAS,EAClD,cAAeF,EAAc,KAC7B,0BAA2B,EAC7B,EACMO,EAASH,EAAgB,QAAQ,EAEjCI,EAAS,IAAIL,EAAmBG,EAAOC,CAAM,EAChD,wBAAwB,QAAQ,EAChC,MAAM,EAET,OAAOC,CAAM,EAAE,cAAc,EAAK,CACpC,CAAC,EAED,GAAG,8CAA+C,IAAM,CAEtD,MAAMF,EAAQ,CACZ,iBAAkBL,EAAuB,0BACzC,aAAcC,EAAa,UAC3B,cAAe,CAAC,EAChB,WAAY,CAAE,KAAM,WAAY,QAAS,QAAS,EA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EAClD,cAAeF,EAAc,KAC7B,0BAA2B,EAC7B,EACMO,EAASH,EAAgB,QAAQ,EAEjCI,EAAS,IAAIL,EAAmBG,EAAOC,CAAM,EAChD,wBAAwB,QAAQ,EAChC,MAAM,EAET,OAAOC,CAAM,EAAE,cAAc,EAAI,CACnC,CAAC,EAED,GAAG,8CAA+C,IAAM,CAEtD,MAAMF,EAAQ,CACZ,iBAAkBL,EAAuB,0BACzC,aAAcC,EAAa,UAC3B,cAAe,CAAC,EAChB,WAAY,CAAE,KAAM,UAAW,QAAS,WAAY,EACpD,cAAeF,EAAc,KAC7B,0BAA2B,EAC7B,EACMO,EAASH,EAAgB,QAAQ,EAEjCI,EAAS,IAAIL,EAAmBG,EAAOC,CAAM,EAChD,wBAAwB,QAAQ,EAChC,MAAM,EAET,OAAOC,CAAM,EAAE,cAAc,EAAK,CACpC,CAAC,EAED,GAAG,gDAAiD,IAAM,CAExD,MAAMF,EAAQ,CACZ,iBAAkBL,EAAuB,UACzC,aAAcC,EAAa,UAC3B,cAAe,CAAC,EAChB,WAAY,CAAE,KAAM,UAAW,QAAS,WAAY,EACpD,cAAeF,EAAc,KAC7B,0BAA2B,EAC7B,EACMO,EAASH,EAAgB,QAAQ,EAEjCI,EAAS,IAAIL,EAAmBG,EAAOC,CAAM,EAChD,wBAAwB,QAAQ,EAChC,MAAM,EAET,OAAOC,CAAM,EAAE,cAAc,EAAK,CACpC,CAAC,CACH,CAAC",
6
6
  "names": ["DeviceModelId", "DeviceSessionStateType", "DeviceStatus", "ApplicationChecker", "createAppConfig", "version", "state", "config", "result"]
7
7
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/device-signer-kit-ethereum",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
4
4
  "private": false,
5
5
  "license": "Apache-2.0",
6
6
  "exports": {
@@ -4,6 +4,7 @@ import { DefaultSignerEth } from "../internal/DefaultSignerEth";
4
4
  type SignerEthBuilderConstructorArgs = {
5
5
  dmk: DeviceManagementKit;
6
6
  sessionId: DeviceSessionId;
7
+ originToken?: string;
7
8
  };
8
9
  /**
9
10
  * Builder for the `SignerEth` class.
@@ -17,8 +18,9 @@ type SignerEthBuilderConstructorArgs = {
17
18
  export declare class SignerEthBuilder {
18
19
  private _dmk;
19
20
  private _sessionId;
20
- private _contextModule;
21
- constructor({ dmk, sessionId }: SignerEthBuilderConstructorArgs);
21
+ private _customContextModule;
22
+ private _originToken;
23
+ constructor({ dmk, sessionId, originToken, }: SignerEthBuilderConstructorArgs);
22
24
  /**
23
25
  * Override the default context module
24
26
  *
@@ -1 +1 @@
1
- {"version":3,"file":"SignerEthBuilder.d.ts","sourceRoot":"","sources":["../../../src/api/SignerEthBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAEnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACrB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,KAAK,+BAA+B,GAAG;IACrC,GAAG,EAAE,mBAAmB,CAAC;IACzB,SAAS,EAAE,eAAe,CAAC;CAC5B,CAAC;AAEF;;;;;;;;GAQG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,IAAI,CAAsB;IAClC,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,cAAc,CAAgB;gBAE1B,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,+BAA+B;IAO/D;;;;;OAKG;IACH,iBAAiB,CAAC,aAAa,EAAE,aAAa;IAK9C;;;;OAIG;IACI,KAAK;CAOb"}
1
+ {"version":3,"file":"SignerEthBuilder.d.ts","sourceRoot":"","sources":["../../../src/api/SignerEthBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAEnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACrB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,KAAK,+BAA+B,GAAG;IACrC,GAAG,EAAE,mBAAmB,CAAC;IACzB,SAAS,EAAE,eAAe,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;;;;;;GAQG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,IAAI,CAAsB;IAClC,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,oBAAoB,CAA4B;IACxD,OAAO,CAAC,YAAY,CAAqB;gBAE7B,EACV,GAAG,EACH,SAAS,EACT,WAAW,GACZ,EAAE,+BAA+B;IAMlC;;;;;OAKG;IACH,iBAAiB,CAAC,aAAa,EAAE,aAAa;IAK9C;;;;OAIG;IACI,KAAK;CAWb"}
@@ -1 +1 @@
1
- {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/constant/plugins.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,EAAE,MAAM,EAgDpC,CAAC"}
1
+ {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/constant/plugins.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,EAAE,MAAM,EAiDpC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ApplicationChecker.d.ts","sourceRoot":"","sources":["../../../../../src/internal/shared/utils/ApplicationChecker.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EAExB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AAGtF,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,YAAY,CAAiB;IACrC,OAAO,CAAC,OAAO,CAAmB;IAClC,OAAO,CAAC,OAAO,CAAgB;gBAG7B,WAAW,EAAE,kBAAkB,EAC/B,SAAS,EAAE,wBAAwB;IAyBrC,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,kBAAkB;IAO5D,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,kBAAkB;IAO5D,kBAAkB,CAAC,OAAO,EAAE,aAAa,GAAG,kBAAkB;IAO9D,KAAK,IAAI,OAAO;CAGjB"}
1
+ {"version":3,"file":"ApplicationChecker.d.ts","sourceRoot":"","sources":["../../../../../src/internal/shared/utils/ApplicationChecker.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EAExB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AAGtF,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,YAAY,CAAiB;IACrC,OAAO,CAAC,OAAO,CAAmB;IAClC,OAAO,CAAC,OAAO,CAAgB;gBAG7B,WAAW,EAAE,kBAAkB,EAC/B,SAAS,EAAE,wBAAwB;IA4BrC,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,kBAAkB;IAO5D,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,kBAAkB;IAO5D,kBAAkB,CAAC,OAAO,EAAE,aAAa,GAAG,kBAAkB;IAO9D,KAAK,IAAI,OAAO;CAGjB"}