@ledgerhq/device-signer-kit-ethereum 0.0.0-rnble-transport-20250401143613 → 0.0.0-rnble-transport-20250404160243
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.
- package/lib/cjs/internal/app-binder/constant/plugins.js +1 -1
- package/lib/cjs/internal/app-binder/constant/plugins.js.map +2 -2
- package/lib/cjs/internal/shared/utils/ApplicationChecker.js +1 -1
- package/lib/cjs/internal/shared/utils/ApplicationChecker.js.map +2 -2
- package/lib/cjs/internal/shared/utils/ApplicationChecker.test.js +1 -1
- package/lib/cjs/internal/shared/utils/ApplicationChecker.test.js.map +2 -2
- package/lib/esm/internal/app-binder/constant/plugins.js +1 -1
- package/lib/esm/internal/app-binder/constant/plugins.js.map +2 -2
- package/lib/esm/internal/shared/utils/ApplicationChecker.js +1 -1
- package/lib/esm/internal/shared/utils/ApplicationChecker.js.map +2 -2
- package/lib/esm/internal/shared/utils/ApplicationChecker.test.js +1 -1
- package/lib/esm/internal/shared/utils/ApplicationChecker.test.js.map +2 -2
- package/lib/types/internal/app-binder/constant/plugins.d.ts.map +1 -1
- package/lib/types/internal/shared/utils/ApplicationChecker.d.ts.map +1 -1
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +6 -6
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var n=Object.defineProperty;var t=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var c=(a,e)=>{for(var o in e)n(a,o,{get:e[o],enumerable:!0})},p=(a,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of s(e))!l.call(a,i)&&i!==o&&n(a,i,{get:()=>e[i],enumerable:!(r=t(e,i))||r.enumerable});return a};var S=a=>p(n({},"__esModule",{value:!0}),a);var A={};c(A,{ETHEREUM_PLUGINS:()=>k});module.exports=S(A);const k=["1inch","Aave","Alkemi","Angle","APWine","ArtBlocks","Brick Towers","capsa","cBridge","ChorusOne","CIAN","Coinbase","Cometh","Compound","DODO","EigenLayer","ENS","Figment","Harvest","Kelp","Kiln","Lens","libertify","Lido","[ L ] Market","Midas","Morpho","Nested","OKX Web3","OpenSea","P2P.org","Paraswap","POAP","QuickSwap","Rarible","Ribbon","Ricochet","Rocket Pool","Spool","Squid","Staderlabs","StakeDAO","StakeKit","Swell","Thales","Yearn","Uniswap","Exchange"];0&&(module.exports={ETHEREUM_PLUGINS});
|
|
2
2
|
//# sourceMappingURL=plugins.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/internal/app-binder/constant/plugins.ts"],
|
|
4
|
-
"sourcesContent": ["export const ETHEREUM_PLUGINS: string[] = [\n \"1inch\",\n \"Aave\",\n \"Alkemi\",\n \"Angle\",\n \"APWine\",\n \"ArtBlocks\",\n \"Brick Towers\",\n \"capsa\",\n \"cBridge\",\n \"ChorusOne\",\n \"CIAN\",\n \"Coinbase\",\n \"Cometh\",\n \"Compound\",\n \"DODO\",\n \"EigenLayer\",\n \"ENS\",\n \"Figment\",\n \"Harvest\",\n \"Kelp\",\n \"Kiln\",\n \"Lens\",\n \"libertify\",\n \"Lido\",\n \"[ L ] Market\",\n \"Midas\",\n \"Morpho\",\n \"Nested\",\n \"OKX Web3\",\n \"OpenSea\",\n \"P2P.org\",\n \"Paraswap\",\n \"POAP\",\n \"QuickSwap\",\n \"Rarible\",\n \"Ribbon\",\n \"Ricochet\",\n \"Rocket Pool\",\n \"Spool\",\n \"Squid\",\n \"Staderlabs\",\n \"StakeDAO\",\n \"StakeKit\",\n \"Swell\",\n \"Thales\",\n \"Yearn\",\n \"Uniswap\",\n];\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GAAO,MAAME,EAA6B,CACxC,QACA,OACA,SACA,QACA,SACA,YACA,eACA,QACA,UACA,YACA,OACA,WACA,SACA,WACA,OACA,aACA,MACA,UACA,UACA,OACA,OACA,OACA,YACA,OACA,eACA,QACA,SACA,SACA,WACA,UACA,UACA,WACA,OACA,YACA,UACA,SACA,WACA,cACA,QACA,QACA,aACA,WACA,WACA,QACA,SACA,QACA,
|
|
4
|
+
"sourcesContent": ["export const ETHEREUM_PLUGINS: string[] = [\n \"1inch\",\n \"Aave\",\n \"Alkemi\",\n \"Angle\",\n \"APWine\",\n \"ArtBlocks\",\n \"Brick Towers\",\n \"capsa\",\n \"cBridge\",\n \"ChorusOne\",\n \"CIAN\",\n \"Coinbase\",\n \"Cometh\",\n \"Compound\",\n \"DODO\",\n \"EigenLayer\",\n \"ENS\",\n \"Figment\",\n \"Harvest\",\n \"Kelp\",\n \"Kiln\",\n \"Lens\",\n \"libertify\",\n \"Lido\",\n \"[ L ] Market\",\n \"Midas\",\n \"Morpho\",\n \"Nested\",\n \"OKX Web3\",\n \"OpenSea\",\n \"P2P.org\",\n \"Paraswap\",\n \"POAP\",\n \"QuickSwap\",\n \"Rarible\",\n \"Ribbon\",\n \"Ricochet\",\n \"Rocket Pool\",\n \"Spool\",\n \"Squid\",\n \"Staderlabs\",\n \"StakeDAO\",\n \"StakeKit\",\n \"Swell\",\n \"Thales\",\n \"Yearn\",\n \"Uniswap\",\n \"Exchange\", // Not a plugin, but a compatible app during exchange flows\n];\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GAAO,MAAME,EAA6B,CACxC,QACA,OACA,SACA,QACA,SACA,YACA,eACA,QACA,UACA,YACA,OACA,WACA,SACA,WACA,OACA,aACA,MACA,UACA,UACA,OACA,OACA,OACA,YACA,OACA,eACA,QACA,SACA,SACA,WACA,UACA,UACA,WACA,OACA,YACA,UACA,SACA,WACA,cACA,QACA,QACA,aACA,WACA,WACA,QACA,SACA,QACA,UACA,UACF",
|
|
6
6
|
"names": ["plugins_exports", "__export", "ETHEREUM_PLUGINS", "__toCommonJS"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var r=Object.defineProperty;var
|
|
1
|
+
"use strict";var r=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var h=(i,e)=>{for(var s in e)r(i,s,{get:e[s],enumerable:!0})},f=(i,e,s,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of m(e))!c.call(i,t)&&t!==s&&r(i,t,{get:()=>e[t],enumerable:!(n=a(e,t))||n.enumerable});return i};var u=i=>f(r({},"__esModule",{value:!0}),i);var d={};h(d,{ApplicationChecker:()=>C});module.exports=u(d);var p=require("@ledgerhq/device-management-kit"),o=require("semver"),l=require("../../app-binder/constant/plugins");class C{isCompatible=!0;version="0.0.1";modelId;constructor(e,s){if(this.modelId=e.deviceModelId,e.sessionStateType===p.DeviceSessionStateType.Connected){this.isCompatible=!1;return}if(e.currentApp.name!=="Ethereum"&&!l.ETHEREUM_PLUGINS.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=s.version}withMinVersionInclusive(e){return(0,o.gte)(this.version,e)||(this.isCompatible=!1),this}withMinVersionExclusive(e){return(0,o.gt)(this.version,e)||(this.isCompatible=!1),this}excludeDeviceModel(e){return this.modelId===e&&(this.isCompatible=!1),this}check(){return this.isCompatible}}0&&(module.exports={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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAIO,2CACPC,EAAwB,kBAGxBC,EAAiC,iDAE1B,MAAMJ,CAAmB,CACtB,aAAwB,GACxB,QAAkB,QAClB,QAER,YACEK,EACAC,EACA,CAIA,GAHA,KAAK,QAAUD,EAAY,cAGvBA,EAAY,mBAAqB,yBAAuB,UAAW,CACrE,KAAK,aAAe,GACpB,MACF,CACA,GACEA,EAAY,WAAW,OAAS,YAChC,CAAC,mBAAiB,SAASA,EAAY,WAAW,IAAI,EACtD,CACA,KAAK,aAAe,GACpB,MACF,CACIA,EAAY,WAAW,OAAS,WAClC,KAAK,QAAUA,EAAY,WAAW,
|
|
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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAIO,2CACPC,EAAwB,kBAGxBC,EAAiC,iDAE1B,MAAMJ,CAAmB,CACtB,aAAwB,GACxB,QAAkB,QAClB,QAER,YACEK,EACAC,EACA,CAIA,GAHA,KAAK,QAAUD,EAAY,cAGvBA,EAAY,mBAAqB,yBAAuB,UAAW,CACrE,KAAK,aAAe,GACpB,MACF,CACA,GACEA,EAAY,WAAW,OAAS,YAChC,CAAC,mBAAiB,SAASA,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,SAAK,OAAI,KAAK,QAASA,CAAO,IAC5B,KAAK,aAAe,IAEf,IACT,CAEA,wBAAwBA,EAAqC,CAC3D,SAAK,MAAG,KAAK,QAASA,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": ["ApplicationChecker_exports", "__export", "ApplicationChecker", "__toCommonJS", "import_device_management_kit", "import_semver", "import_plugins", "deviceState", "appConfig", "version", "modelId"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("@ledgerhq/device-management-kit"),s=require("./ApplicationChecker");describe("ApplicationChecker",()=>{function i(t){return{blindSigningEnabled:!1,web3ChecksEnabled:!1,web3ChecksOptIn:!1,version:t}}it("should pass the check for exclusive version",()=>{const t={sessionStateType:e.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:e.DeviceStatus.CONNECTED,installedApps:[],currentApp:{name:"Ethereum",version:"1.13.0-rc"},deviceModelId:e.DeviceModelId.FLEX,isSecureConnectionAllowed:!1},n=i("1.13.0"),c=new s.ApplicationChecker(t,n).withMinVersionExclusive("1.12.0").check();expect(c).toStrictEqual(!0)}),it("should reject the check for exclusive version",()=>{const t={sessionStateType:e.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:e.DeviceStatus.CONNECTED,installedApps:[],currentApp:{name:"Ethereum",version:"1.12.0"},deviceModelId:e.DeviceModelId.FLEX,isSecureConnectionAllowed:!1},n=i("1.12.0"),c=new s.ApplicationChecker(t,n).withMinVersionExclusive("1.12.0").check();expect(c).toStrictEqual(!1)}),it("should pass the check for inclusive version",()=>{const t={sessionStateType:e.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:e.DeviceStatus.CONNECTED,installedApps:[],currentApp:{name:"Ethereum",version:"1.12.0"},deviceModelId:e.DeviceModelId.FLEX,isSecureConnectionAllowed:!1},n=i("1.10.0"),c=new s.ApplicationChecker(t,n).withMinVersionInclusive("1.12.0").check();expect(c).toStrictEqual(!0)}),it("should reject the check for inclusive version",()=>{const t={sessionStateType:e.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:e.DeviceStatus.CONNECTED,installedApps:[],currentApp:{name:"Ethereum",version:"1.11.0"},deviceModelId:e.DeviceModelId.FLEX,isSecureConnectionAllowed:!1},n=i("1.11.0"),c=new s.ApplicationChecker(t,n).withMinVersionInclusive("1.12.0").check();expect(c).toStrictEqual(!1)}),it("should pass the check for excluded device",()=>{const t={sessionStateType:e.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:e.DeviceStatus.CONNECTED,installedApps:[],currentApp:{name:"Ethereum",version:"1.11.0"},deviceModelId:e.DeviceModelId.FLEX,isSecureConnectionAllowed:!1},n=i("1.11.0"),c=new s.ApplicationChecker(t,n).excludeDeviceModel(e.DeviceModelId.NANO_S).check();expect(c).toStrictEqual(!0)}),it("should reject the check for excluded device",()=>{const t={sessionStateType:e.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:e.DeviceStatus.CONNECTED,installedApps:[],currentApp:{name:"Ethereum",version:"1.11.0"},deviceModelId:e.DeviceModelId.FLEX,isSecureConnectionAllowed:!1},n=i("1.11.0"),c=new s.ApplicationChecker(t,n).excludeDeviceModel(e.DeviceModelId.FLEX).check();expect(c).toStrictEqual(!1)}),it("should pass the check for chained condition",()=>{const t={sessionStateType:e.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:e.DeviceStatus.CONNECTED,installedApps:[],currentApp:{name:"Ethereum",version:"1.11.0"},deviceModelId:e.DeviceModelId.FLEX,isSecureConnectionAllowed:!1},n=i("1.11.0"),c=new s.ApplicationChecker(t,n).withMinVersionInclusive("1.11.0").excludeDeviceModel(e.DeviceModelId.NANO_S).check();expect(c).toStrictEqual(!0)}),it("should reject the check for chained condition",()=>{const t={sessionStateType:e.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:e.DeviceStatus.CONNECTED,installedApps:[],currentApp:{name:"Ethereum",version:"1.10.0"},deviceModelId:e.DeviceModelId.FLEX,isSecureConnectionAllowed:!1},n=i("1.10.0"),c=new s.ApplicationChecker(t,n).withMinVersionInclusive("1.11.0").excludeDeviceModel(e.DeviceModelId.NANO_S).check();expect(c).toStrictEqual(!1)}),it("should pass the check in plugins",()=>{const t={sessionStateType:e.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:e.DeviceStatus.CONNECTED,installedApps:[],currentApp:{name:"1inch",version:"1.11.0-rc"},deviceModelId:e.DeviceModelId.FLEX,isSecureConnectionAllowed:!1},n=i("1.13.0"),c=new s.ApplicationChecker(t,n).withMinVersionExclusive("1.12.0").check();expect(c).toStrictEqual(!0)}),it("should reject the check in unknexpected app",()=>{const t={sessionStateType:e.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:e.DeviceStatus.CONNECTED,installedApps:[],currentApp:{name:"Bitcoin",version:"1.13.0-rc"},deviceModelId:e.DeviceModelId.FLEX,isSecureConnectionAllowed:!1},n=i("1.13.0"),c=new s.ApplicationChecker(t,n).withMinVersionExclusive("1.12.0").check();expect(c).toStrictEqual(!1)}),it("should reject the check in unknexpected state",()=>{const t={sessionStateType:e.DeviceSessionStateType.Connected,deviceStatus:e.DeviceStatus.CONNECTED,installedApps:[],currentApp:{name:"Bitcoin",version:"1.13.0-rc"},deviceModelId:e.DeviceModelId.FLEX,isSecureConnectionAllowed:!1},n=i("1.13.0"),c=new s.ApplicationChecker(t,n).withMinVersionExclusive("1.12.0").check();expect(c).toStrictEqual(!1)})});
|
|
1
|
+
"use strict";var e=require("@ledgerhq/device-management-kit"),s=require("./ApplicationChecker");describe("ApplicationChecker",()=>{function i(t){return{blindSigningEnabled:!1,web3ChecksEnabled:!1,web3ChecksOptIn:!1,version:t}}it("should pass the check for exclusive version",()=>{const t={sessionStateType:e.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:e.DeviceStatus.CONNECTED,installedApps:[],currentApp:{name:"Ethereum",version:"1.13.0-rc"},deviceModelId:e.DeviceModelId.FLEX,isSecureConnectionAllowed:!1},n=i("1.13.0"),c=new s.ApplicationChecker(t,n).withMinVersionExclusive("1.12.0").check();expect(c).toStrictEqual(!0)}),it("should reject the check for exclusive version",()=>{const t={sessionStateType:e.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:e.DeviceStatus.CONNECTED,installedApps:[],currentApp:{name:"Ethereum",version:"1.12.0"},deviceModelId:e.DeviceModelId.FLEX,isSecureConnectionAllowed:!1},n=i("1.12.0"),c=new s.ApplicationChecker(t,n).withMinVersionExclusive("1.12.0").check();expect(c).toStrictEqual(!1)}),it("should pass the check for inclusive version",()=>{const t={sessionStateType:e.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:e.DeviceStatus.CONNECTED,installedApps:[],currentApp:{name:"Ethereum",version:"1.12.0"},deviceModelId:e.DeviceModelId.FLEX,isSecureConnectionAllowed:!1},n=i("1.10.0"),c=new s.ApplicationChecker(t,n).withMinVersionInclusive("1.12.0").check();expect(c).toStrictEqual(!0)}),it("should reject the check for inclusive version",()=>{const t={sessionStateType:e.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:e.DeviceStatus.CONNECTED,installedApps:[],currentApp:{name:"Ethereum",version:"1.11.0"},deviceModelId:e.DeviceModelId.FLEX,isSecureConnectionAllowed:!1},n=i("1.11.0"),c=new s.ApplicationChecker(t,n).withMinVersionInclusive("1.12.0").check();expect(c).toStrictEqual(!1)}),it("should pass the check for excluded device",()=>{const t={sessionStateType:e.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:e.DeviceStatus.CONNECTED,installedApps:[],currentApp:{name:"Ethereum",version:"1.11.0"},deviceModelId:e.DeviceModelId.FLEX,isSecureConnectionAllowed:!1},n=i("1.11.0"),c=new s.ApplicationChecker(t,n).excludeDeviceModel(e.DeviceModelId.NANO_S).check();expect(c).toStrictEqual(!0)}),it("should reject the check for excluded device",()=>{const t={sessionStateType:e.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:e.DeviceStatus.CONNECTED,installedApps:[],currentApp:{name:"Ethereum",version:"1.11.0"},deviceModelId:e.DeviceModelId.FLEX,isSecureConnectionAllowed:!1},n=i("1.11.0"),c=new s.ApplicationChecker(t,n).excludeDeviceModel(e.DeviceModelId.FLEX).check();expect(c).toStrictEqual(!1)}),it("should pass the check for chained condition",()=>{const t={sessionStateType:e.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:e.DeviceStatus.CONNECTED,installedApps:[],currentApp:{name:"Ethereum",version:"1.11.0"},deviceModelId:e.DeviceModelId.FLEX,isSecureConnectionAllowed:!1},n=i("1.11.0"),c=new s.ApplicationChecker(t,n).withMinVersionInclusive("1.11.0").excludeDeviceModel(e.DeviceModelId.NANO_S).check();expect(c).toStrictEqual(!0)}),it("should reject the check for chained condition",()=>{const t={sessionStateType:e.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:e.DeviceStatus.CONNECTED,installedApps:[],currentApp:{name:"Ethereum",version:"1.10.0"},deviceModelId:e.DeviceModelId.FLEX,isSecureConnectionAllowed:!1},n=i("1.10.0"),c=new s.ApplicationChecker(t,n).withMinVersionInclusive("1.11.0").excludeDeviceModel(e.DeviceModelId.NANO_S).check();expect(c).toStrictEqual(!1)}),it("exchange app should not be compatible with eth features",()=>{const t={sessionStateType:e.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:e.DeviceStatus.CONNECTED,installedApps:[],currentApp:{name:"Exchange",version:"1.11.0-rc"},deviceModelId:e.DeviceModelId.FLEX,isSecureConnectionAllowed:!1},n=i("1.13.0"),c=new s.ApplicationChecker(t,n).check();expect(c).toStrictEqual(!1)}),it("should pass the check in plugins",()=>{const t={sessionStateType:e.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:e.DeviceStatus.CONNECTED,installedApps:[],currentApp:{name:"1inch",version:"1.11.0-rc"},deviceModelId:e.DeviceModelId.FLEX,isSecureConnectionAllowed:!1},n=i("1.13.0"),c=new s.ApplicationChecker(t,n).withMinVersionExclusive("1.12.0").check();expect(c).toStrictEqual(!0)}),it("should reject the check in unknexpected app",()=>{const t={sessionStateType:e.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:e.DeviceStatus.CONNECTED,installedApps:[],currentApp:{name:"Bitcoin",version:"1.13.0-rc"},deviceModelId:e.DeviceModelId.FLEX,isSecureConnectionAllowed:!1},n=i("1.13.0"),c=new s.ApplicationChecker(t,n).withMinVersionExclusive("1.12.0").check();expect(c).toStrictEqual(!1)}),it("should reject the check in unknexpected state",()=>{const t={sessionStateType:e.DeviceSessionStateType.Connected,deviceStatus:e.DeviceStatus.CONNECTED,installedApps:[],currentApp:{name:"Bitcoin",version:"1.13.0-rc"},deviceModelId:e.DeviceModelId.FLEX,isSecureConnectionAllowed:!1},n=i("1.13.0"),c=new s.ApplicationChecker(t,n).withMinVersionExclusive("1.12.0").check();expect(c).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,IAAAA,EAIO,2CAIPC,EAAmC,gCAEnC,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,iBAAkB,yBAAuB,0BACzC,aAAc,eAAa,UAC3B,cAAe,CAAC,EAChB,WAAY,CAAE,KAAM,WAAY,QAAS,WAAY,EACrD,cAAe,gBAAc,KAC7B,0BAA2B,EAC7B,EACMC,EAASH,EAAgB,QAAQ,EAEjCI,EAAS,IAAI,qBAAmBF,EAAOC,CAAM,EAChD,wBAAwB,QAAQ,EAChC,MAAM,EAET,OAAOC,CAAM,EAAE,cAAc,EAAI,CACnC,CAAC,EAED,GAAG,gDAAiD,IAAM,CAExD,MAAMF,EAAQ,CACZ,iBAAkB,yBAAuB,0BACzC,aAAc,eAAa,UAC3B,cA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UAC3B,cAAe,CAAC,EAChB,WAAY,CAAE,KAAM,QAAS,QAAS,WAAY,EAClD,cAAe,gBAAc,KAC7B,0BAA2B,EAC7B,EACMC,EAASH,EAAgB,QAAQ,EAEjCI,EAAS,IAAI,qBAAmBF,EAAOC,CAAM,EAChD,wBAAwB,QAAQ,EAChC,MAAM,EAET,OAAOC,CAAM,EAAE,cAAc,EAAI,CACnC,CAAC,EAED,GAAG,8CAA+C,IAAM,CAEtD,MAAMF,EAAQ,CACZ,iBAAkB,yBAAuB,0BACzC,aAAc,eAAa,UAC3B,cAAe,CAAC,EAChB,WAAY,CAAE,KAAM,UAAW,QAAS,WAAY,EACpD,cAAe,gBAAc,KAC7B,0BAA2B,EAC7B,EACMC,EAASH,EAAgB,QAAQ,EAEjCI,EAAS,IAAI,qBAAmBF,EAAOC,CAAM,EAChD,wBAAwB,QAAQ,EAChC,MAAM,EAET,OAAOC,CAAM,EAAE,cAAc,EAAK,CACpC,CAAC,EAED,GAAG,gDAAiD,IAAM,CAExD,MAAMF,EAAQ,CACZ,iBAAkB,yBAAuB,UACzC,aAAc,eAAa,UAC3B,cAAe,CAAC,EAChB,WAAY,CAAE,KAAM,UAAW,QAAS,WAAY,EACpD,cAAe,gBAAc,KAC7B,0BAA2B,EAC7B,EACMC,EAASH,EAAgB,QAAQ,EAEjCI,EAAS,IAAI,qBAAmBF,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,IAAAA,EAIO,2CAIPC,EAAmC,gCAEnC,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,iBAAkB,yBAAuB,0BACzC,aAAc,eAAa,UAC3B,cAAe,CAAC,EAChB,WAAY,CAAE,KAAM,WAAY,QAAS,WAAY,EACrD,cAAe,gBAAc,KAC7B,0BAA2B,EAC7B,EACMC,EAASH,EAAgB,QAAQ,EAEjCI,EAAS,IAAI,qBAAmBF,EAAOC,CAAM,EAChD,wBAAwB,QAAQ,EAChC,MAAM,EAET,OAAOC,CAAM,EAAE,cAAc,EAAI,CACnC,CAAC,EAED,GAAG,gDAAiD,IAAM,CAExD,MAAMF,EAAQ,CACZ,iBAAkB,yBAAuB,0BACzC,aAAc,eAAa,UAC3B,cAAe,CAAC,EAChB,WAAY,CAAE,KAAM,WAAY,QAAS,QAAS,EAClD,cAAe,gBAAc,KAC7B,0BAA2B,EAC7B,EACMC,EAASH,EAAgB,QAAQ,EAEjCI,EAAS,IAAI,qBAAmBF,EAAOC,CAAM,EAChD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AM,EAAE,MAAM,EAE3D,OAAOC,CAAM,EAAE,cAAc,EAAK,CACpC,CAAC,EAED,GAAG,mCAAoC,IAAM,CAE3C,MAAMF,EAAQ,CACZ,iBAAkB,yBAAuB,0BACzC,aAAc,eAAa,UAC3B,cAAe,CAAC,EAChB,WAAY,CAAE,KAAM,QAAS,QAAS,WAAY,EAClD,cAAe,gBAAc,KAC7B,0BAA2B,EAC7B,EACMC,EAASH,EAAgB,QAAQ,EAEjCI,EAAS,IAAI,qBAAmBF,EAAOC,CAAM,EAChD,wBAAwB,QAAQ,EAChC,MAAM,EAET,OAAOC,CAAM,EAAE,cAAc,EAAI,CACnC,CAAC,EAED,GAAG,8CAA+C,IAAM,CAEtD,MAAMF,EAAQ,CACZ,iBAAkB,yBAAuB,0BACzC,aAAc,eAAa,UAC3B,cAAe,CAAC,EAChB,WAAY,CAAE,KAAM,UAAW,QAAS,WAAY,EACpD,cAAe,gBAAc,KAC7B,0BAA2B,EAC7B,EACMC,EAASH,EAAgB,QAAQ,EAEjCI,EAAS,IAAI,qBAAmBF,EAAOC,CAAM,EAChD,wBAAwB,QAAQ,EAChC,MAAM,EAET,OAAOC,CAAM,EAAE,cAAc,EAAK,CACpC,CAAC,EAED,GAAG,gDAAiD,IAAM,CAExD,MAAMF,EAAQ,CACZ,iBAAkB,yBAAuB,UACzC,aAAc,eAAa,UAC3B,cAAe,CAAC,EAChB,WAAY,CAAE,KAAM,UAAW,QAAS,WAAY,EACpD,cAAe,gBAAc,KAC7B,0BAA2B,EAC7B,EACMC,EAASH,EAAgB,QAAQ,EAEjCI,EAAS,IAAI,qBAAmBF,EAAOC,CAAM,EAChD,wBAAwB,QAAQ,EAChC,MAAM,EAET,OAAOC,CAAM,EAAE,cAAc,EAAK,CACpC,CAAC,CACH,CAAC",
|
|
6
6
|
"names": ["import_device_management_kit", "import_ApplicationChecker", "createAppConfig", "version", "state", "config", "result"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=["1inch","Aave","Alkemi","Angle","APWine","ArtBlocks","Brick Towers","capsa","cBridge","ChorusOne","CIAN","Coinbase","Cometh","Compound","DODO","EigenLayer","ENS","Figment","Harvest","Kelp","Kiln","Lens","libertify","Lido","[ L ] Market","Midas","Morpho","Nested","OKX Web3","OpenSea","P2P.org","Paraswap","POAP","QuickSwap","Rarible","Ribbon","Ricochet","Rocket Pool","Spool","Squid","Staderlabs","StakeDAO","StakeKit","Swell","Thales","Yearn","Uniswap"];export{e as ETHEREUM_PLUGINS};
|
|
1
|
+
const e=["1inch","Aave","Alkemi","Angle","APWine","ArtBlocks","Brick Towers","capsa","cBridge","ChorusOne","CIAN","Coinbase","Cometh","Compound","DODO","EigenLayer","ENS","Figment","Harvest","Kelp","Kiln","Lens","libertify","Lido","[ L ] Market","Midas","Morpho","Nested","OKX Web3","OpenSea","P2P.org","Paraswap","POAP","QuickSwap","Rarible","Ribbon","Ricochet","Rocket Pool","Spool","Squid","Staderlabs","StakeDAO","StakeKit","Swell","Thales","Yearn","Uniswap","Exchange"];export{e as ETHEREUM_PLUGINS};
|
|
2
2
|
//# sourceMappingURL=plugins.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/internal/app-binder/constant/plugins.ts"],
|
|
4
|
-
"sourcesContent": ["export const ETHEREUM_PLUGINS: string[] = [\n \"1inch\",\n \"Aave\",\n \"Alkemi\",\n \"Angle\",\n \"APWine\",\n \"ArtBlocks\",\n \"Brick Towers\",\n \"capsa\",\n \"cBridge\",\n \"ChorusOne\",\n \"CIAN\",\n \"Coinbase\",\n \"Cometh\",\n \"Compound\",\n \"DODO\",\n \"EigenLayer\",\n \"ENS\",\n \"Figment\",\n \"Harvest\",\n \"Kelp\",\n \"Kiln\",\n \"Lens\",\n \"libertify\",\n \"Lido\",\n \"[ L ] Market\",\n \"Midas\",\n \"Morpho\",\n \"Nested\",\n \"OKX Web3\",\n \"OpenSea\",\n \"P2P.org\",\n \"Paraswap\",\n \"POAP\",\n \"QuickSwap\",\n \"Rarible\",\n \"Ribbon\",\n \"Ricochet\",\n \"Rocket Pool\",\n \"Spool\",\n \"Squid\",\n \"Staderlabs\",\n \"StakeDAO\",\n \"StakeKit\",\n \"Swell\",\n \"Thales\",\n \"Yearn\",\n \"Uniswap\",\n];\n"],
|
|
5
|
-
"mappings": "AAAO,MAAMA,EAA6B,CACxC,QACA,OACA,SACA,QACA,SACA,YACA,eACA,QACA,UACA,YACA,OACA,WACA,SACA,WACA,OACA,aACA,MACA,UACA,UACA,OACA,OACA,OACA,YACA,OACA,eACA,QACA,SACA,SACA,WACA,UACA,UACA,WACA,OACA,YACA,UACA,SACA,WACA,cACA,QACA,QACA,aACA,WACA,WACA,QACA,SACA,QACA,
|
|
4
|
+
"sourcesContent": ["export const ETHEREUM_PLUGINS: string[] = [\n \"1inch\",\n \"Aave\",\n \"Alkemi\",\n \"Angle\",\n \"APWine\",\n \"ArtBlocks\",\n \"Brick Towers\",\n \"capsa\",\n \"cBridge\",\n \"ChorusOne\",\n \"CIAN\",\n \"Coinbase\",\n \"Cometh\",\n \"Compound\",\n \"DODO\",\n \"EigenLayer\",\n \"ENS\",\n \"Figment\",\n \"Harvest\",\n \"Kelp\",\n \"Kiln\",\n \"Lens\",\n \"libertify\",\n \"Lido\",\n \"[ L ] Market\",\n \"Midas\",\n \"Morpho\",\n \"Nested\",\n \"OKX Web3\",\n \"OpenSea\",\n \"P2P.org\",\n \"Paraswap\",\n \"POAP\",\n \"QuickSwap\",\n \"Rarible\",\n \"Ribbon\",\n \"Ricochet\",\n \"Rocket Pool\",\n \"Spool\",\n \"Squid\",\n \"Staderlabs\",\n \"StakeDAO\",\n \"StakeKit\",\n \"Swell\",\n \"Thales\",\n \"Yearn\",\n \"Uniswap\",\n \"Exchange\", // Not a plugin, but a compatible app during exchange flows\n];\n"],
|
|
5
|
+
"mappings": "AAAO,MAAMA,EAA6B,CACxC,QACA,OACA,SACA,QACA,SACA,YACA,eACA,QACA,UACA,YACA,OACA,WACA,SACA,WACA,OACA,aACA,MACA,UACA,UACA,OACA,OACA,OACA,YACA,OACA,eACA,QACA,SACA,SACA,WACA,UACA,UACA,WACA,OACA,YACA,UACA,SACA,WACA,cACA,QACA,QACA,aACA,WACA,WACA,QACA,SACA,QACA,UACA,UACF",
|
|
6
6
|
"names": ["ETHEREUM_PLUGINS"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{DeviceSessionStateType as
|
|
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,
|
|
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,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C,EAED,GAAG,mCAAoC,IAAM,CAE3C,MAAMF,EAAQ,CACZ,iBAAkBL,EAAuB,0BACzC,aAAcC,EAAa,UAC3B,cAAe,CAAC,EAChB,WAAY,CAAE,KAAM,QAAS,QAAS,WAAY,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",
|
|
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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AAc,EAAK,CACpC,CAAC,CACH,CAAC",
|
|
6
6
|
"names": ["DeviceModelId", "DeviceSessionStateType", "DeviceStatus", "ApplicationChecker", "createAppConfig", "version", "state", "config", "result"]
|
|
7
7
|
}
|
|
@@ -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,
|
|
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;
|
|
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"}
|