@ledgerhq/device-management-kit 0.0.0-develop-20260908001420 → 0.0.0-develop-20260911001401
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/package.json +1 -1
- package/lib/cjs/src/api/command/os/GetOsVersionCommand.test.js +1 -1
- package/lib/cjs/src/api/command/os/GetOsVersionCommand.test.js.map +2 -2
- package/lib/cjs/src/api/command/os/SecureElementFlagsParser.js +1 -1
- package/lib/cjs/src/api/command/os/SecureElementFlagsParser.js.map +2 -2
- package/lib/cjs/src/api/command/os/SecureElementFlagsParser.test.js +1 -1
- package/lib/cjs/src/api/command/os/SecureElementFlagsParser.test.js.map +2 -2
- package/lib/cjs/src/api/command/os/__mocks__/GetOsVersionCommand.js +1 -1
- package/lib/cjs/src/api/command/os/__mocks__/GetOsVersionCommand.js.map +2 -2
- package/lib/cjs/src/api/device/SecureElementFlags.js +1 -1
- package/lib/cjs/src/api/device/SecureElementFlags.js.map +2 -2
- package/lib/esm/package.json +1 -1
- package/lib/esm/src/api/command/os/GetOsVersionCommand.test.js +1 -1
- package/lib/esm/src/api/command/os/GetOsVersionCommand.test.js.map +2 -2
- package/lib/esm/src/api/command/os/SecureElementFlagsParser.js +1 -1
- package/lib/esm/src/api/command/os/SecureElementFlagsParser.js.map +2 -2
- package/lib/esm/src/api/command/os/SecureElementFlagsParser.test.js +1 -1
- package/lib/esm/src/api/command/os/SecureElementFlagsParser.test.js.map +2 -2
- package/lib/esm/src/api/command/os/__mocks__/GetOsVersionCommand.js +1 -1
- package/lib/esm/src/api/command/os/__mocks__/GetOsVersionCommand.js.map +2 -2
- package/lib/esm/src/api/device/SecureElementFlags.js +1 -1
- package/lib/esm/src/api/device/SecureElementFlags.js.map +2 -2
- package/lib/types/src/api/command/os/SecureElementFlagsParser.d.ts.map +1 -1
- package/lib/types/src/api/device/SecureElementFlags.d.ts +4 -3
- package/lib/types/src/api/device/SecureElementFlags.d.ts.map +1 -1
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/api/command/os/SecureElementFlagsParser.test.ts"],
|
|
4
|
-
"sourcesContent": ["import { describe, expect, it } from \"vitest\";\n\nimport {\n type DeviceGeneralState,\n OnboardingState,\n SeedWordCount,\n} from \"@api/device/SecureElementFlags\";\n\nimport { SecureElementFlagsParser } from \"./SecureElementFlagsParser\";\n\ndescribe(\"SecureElementFlagsParser\", () => {\n it(\"should default missing secure element flag bytes to zero\", () => {\n const parser = new SecureElementFlagsParser(new Uint8Array([0xe0]));\n\n expect(parser.generalDeviceState().isPinValidated).toBe(true);\n expect(parser.endorsementInformation()).toEqual({\n hasEndorsementCertificateInSlot1: false,\n hasEndorsementCertificateInSlot2: false,\n });\n expect(parser.wordsInformation()).toEqual({\n numberOfWords: SeedWordCount.TwentyFour,\n currentWordIndex: 0,\n });\n expect(parser.onboardingStatus()).toEqual({\n onboardingState: OnboardingState.
|
|
5
|
-
"mappings": "AAAA,OAAS,YAAAA,EAAU,UAAAC,EAAQ,MAAAC,MAAU,SAErC,OAEE,mBAAAC,EACA,iBAAAC,MACK,iCAEP,OAAS,4BAAAC,MAAgC,6BAEzCL,EAAS,2BAA4B,IAAM,CACzCE,EAAG,2DAA4D,IAAM,CACnE,MAAMI,EAAS,IAAID,EAAyB,IAAI,WAAW,CAAC,GAAI,CAAC,CAAC,EAElEJ,EAAOK,EAAO,mBAAmB,EAAE,cAAc,EAAE,KAAK,EAAI,EAC5DL,EAAOK,EAAO,uBAAuB,CAAC,EAAE,QAAQ,CAC9C,iCAAkC,GAClC,iCAAkC,EACpC,CAAC,EACDL,EAAOK,EAAO,iBAAiB,CAAC,EAAE,QAAQ,CACxC,cAAeF,EAAc,WAC7B,iBAAkB,CACpB,CAAC,EACDH,EAAOK,EAAO,iBAAiB,CAAC,EAAE,QAAQ,CACxC,gBAAiBH,EAAgB,
|
|
4
|
+
"sourcesContent": ["import { describe, expect, it } from \"vitest\";\n\nimport {\n type DeviceGeneralState,\n OnboardingState,\n SeedWordCount,\n} from \"@api/device/SecureElementFlags\";\n\nimport { SecureElementFlagsParser } from \"./SecureElementFlagsParser\";\n\ndescribe(\"SecureElementFlagsParser\", () => {\n it(\"should default missing secure element flag bytes to zero\", () => {\n const parser = new SecureElementFlagsParser(new Uint8Array([0xe0]));\n\n expect(parser.generalDeviceState().isPinValidated).toBe(true);\n expect(parser.endorsementInformation()).toEqual({\n hasEndorsementCertificateInSlot1: false,\n hasEndorsementCertificateInSlot2: false,\n });\n expect(parser.wordsInformation()).toEqual({\n numberOfWords: SeedWordCount.TwentyFour,\n currentWordIndex: 0,\n });\n expect(parser.onboardingStatus()).toEqual({\n onboardingState: OnboardingState.WelcomeScreen1,\n });\n });\n\n it(\"should correctly parse the general device state\", () => {\n const seFlags = new Uint8Array([0b10101010, 0x00, 0x00, 0x00]);\n const parser = new SecureElementFlagsParser(seFlags);\n const expectedState: DeviceGeneralState = {\n isPinValidated: true,\n hasMcuSerialNumber: false,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: true,\n isOnboarded: false,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n };\n expect(parser.generalDeviceState()).toEqual(expectedState);\n });\n\n it.each([\n [0x00, false, false],\n [0x01, true, false],\n [0x02, false, true],\n [0x03, true, true],\n ])(\n \"should parse endorsement information value %#\",\n (value, hasSlot1, hasSlot2) => {\n const parser = new SecureElementFlagsParser(\n new Uint8Array([0x00, value, 0x00, 0x00]),\n );\n\n expect(parser.endorsementInformation()).toEqual({\n hasEndorsementCertificateInSlot1: hasSlot1,\n hasEndorsementCertificateInSlot2: hasSlot2,\n });\n },\n );\n\n it.each([\n [0b00000000, SeedWordCount.TwentyFour, 0],\n [0b00100101, SeedWordCount.Eighteen, 5],\n [0b01010001, SeedWordCount.Twelve, 17],\n [0b01111111, undefined, 31],\n ])(\n \"should parse words information value %#\",\n (value, numberOfWords, currentWordIndex) => {\n const parser = new SecureElementFlagsParser(\n new Uint8Array([0x00, 0x00, value, 0x00]),\n );\n\n expect(parser.wordsInformation()).toEqual({\n numberOfWords,\n currentWordIndex,\n });\n },\n );\n\n it(\"should ignore the reserved most-significant bit in words information\", () => {\n const parser = new SecureElementFlagsParser(\n new Uint8Array([0x00, 0x00, 0b10100101, 0x00]),\n );\n\n expect(parser.wordsInformation()).toEqual({\n numberOfWords: SeedWordCount.Eighteen,\n currentWordIndex: 5,\n });\n });\n\n it(\"should expose numeric seed word counts so they survive serialization\", () => {\n const parser = new SecureElementFlagsParser(\n new Uint8Array([0x00, 0x00, 0x00, 0x00]),\n );\n\n const words = parser.wordsInformation();\n\n expect(words.numberOfWords).toBe(SeedWordCount.TwentyFour);\n expect(JSON.parse(JSON.stringify(words))).toEqual({\n numberOfWords: SeedWordCount.TwentyFour,\n currentWordIndex: 0,\n });\n });\n\n it(\"should keep SeedWordCount as 12 | 18 | 24, not an open numeric enum\", () => {\n const valid: SeedWordCount = SeedWordCount.Twelve;\n expect(valid).toBe(12);\n\n // @ts-expect-error arbitrary numbers are not valid seed word counts\n const invalid: SeedWordCount = 15;\n expect(typeof invalid).toBe(\"number\");\n });\n\n describe(\"onboardingStatus\", () => {\n it.each([\n [0x00, OnboardingState.WelcomeScreen1],\n [0x01, OnboardingState.WelcomeScreen2],\n [0x02, OnboardingState.WelcomeScreen3],\n [0x03, OnboardingState.WelcomeScreen4],\n [0x04, OnboardingState.WelcomeScreenReminder],\n [0x05, OnboardingState.SetupChoice],\n [0x06, OnboardingState.Pin],\n [0x07, OnboardingState.NewDevice],\n [0x08, OnboardingState.ConfirmNewDevice],\n [0x09, OnboardingState.RestoreRecoveryPhrase],\n [0x0a, OnboardingState.SafetyWarning],\n [0x0b, OnboardingState.DeviceIsReady],\n [0x0c, OnboardingState.ChooseName],\n [0x0d, OnboardingState.RestoreRecoverBackup],\n [0x0e, OnboardingState.SetupRestoreChoice],\n [0x0f, OnboardingState.OnboardingStatusCheck],\n [0x10, OnboardingState.RestoreWithRk],\n [0x11, OnboardingState.Unknown],\n [0x43, OnboardingState.Unknown],\n [0xff, OnboardingState.Unknown],\n ] as const)(\"should parse byte 0x%s as %s\", (value, onboardingState) => {\n const parser = new SecureElementFlagsParser(\n new Uint8Array([0x00, 0x00, 0x00, value]),\n );\n\n expect(parser.onboardingStatus()).toEqual({ onboardingState });\n });\n\n it(\"should always expose a defined onboarding state so it survives serialization\", () => {\n const parser = new SecureElementFlagsParser(\n new Uint8Array([0x00, 0x00, 0x00, 0x11]),\n );\n\n const status = parser.onboardingStatus();\n\n expect(status.onboardingState).toBe(OnboardingState.Unknown);\n expect(JSON.parse(JSON.stringify(status))).toEqual({\n onboardingState: OnboardingState.Unknown,\n });\n });\n\n it(\"should map every documented GET VERSION byte to a distinct OnboardingState\", () => {\n const documentedBytes = Array.from({ length: 0x11 }, (_, index) => index);\n const parsedStates = documentedBytes.map(\n (value) =>\n new SecureElementFlagsParser(\n new Uint8Array([0x00, 0x00, 0x00, value]),\n ).onboardingStatus().onboardingState,\n );\n\n expect(parsedStates).toEqual(\n Object.values(OnboardingState).filter(\n (state) => state !== OnboardingState.Unknown,\n ),\n );\n });\n });\n\n it(\"should correctly check the nth bit in a byte\", () => {\n const seFlags = new Uint8Array([0x00, 0x00, 0x00, 0x00]);\n const parser = new SecureElementFlagsParser(seFlags);\n const byte = 0b10101010;\n expect(parser._checkNthBitInByte(byte, 1)).toBe(true);\n expect(parser._checkNthBitInByte(byte, 2)).toBe(false);\n expect(parser._checkNthBitInByte(byte, 3)).toBe(true);\n expect(parser._checkNthBitInByte(byte, 4)).toBe(false);\n expect(parser._checkNthBitInByte(byte, 5)).toBe(true);\n expect(parser._checkNthBitInByte(byte, 6)).toBe(false);\n expect(parser._checkNthBitInByte(byte, 7)).toBe(true);\n expect(parser._checkNthBitInByte(byte, 8)).toBe(false);\n });\n});\n"],
|
|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KAAK,CAAE,OAAQ,EAAK,EAAG,CAACC,EAAGC,IAAUA,CAAK,EACnC,IAClCX,GACC,IAAIJ,EACF,IAAI,WAAW,CAAC,EAAM,EAAM,EAAMI,CAAK,CAAC,CAC1C,EAAE,iBAAiB,EAAE,eACzB,EAEAR,EAAOiB,CAAY,EAAE,QACnB,OAAO,OAAOf,CAAe,EAAE,OAC5BkB,GAAUA,IAAUlB,EAAgB,OACvC,CACF,CACF,CAAC,CACH,CAAC,EAEDD,EAAG,+CAAgD,IAAM,CACvD,MAAMK,EAAU,IAAI,WAAW,CAAC,EAAM,EAAM,EAAM,CAAI,CAAC,EACjDD,EAAS,IAAID,EAAyBE,CAAO,EAC7Ce,EAAO,IACbrB,EAAOK,EAAO,mBAAmBgB,EAAM,CAAC,CAAC,EAAE,KAAK,EAAI,EACpDrB,EAAOK,EAAO,mBAAmBgB,EAAM,CAAC,CAAC,EAAE,KAAK,EAAK,EACrDrB,EAAOK,EAAO,mBAAmBgB,EAAM,CAAC,CAAC,EAAE,KAAK,EAAI,EACpDrB,EAAOK,EAAO,mBAAmBgB,EAAM,CAAC,CAAC,EAAE,KAAK,EAAK,EACrDrB,EAAOK,EAAO,mBAAmBgB,EAAM,CAAC,CAAC,EAAE,KAAK,EAAI,EACpDrB,EAAOK,EAAO,mBAAmBgB,EAAM,CAAC,CAAC,EAAE,KAAK,EAAK,EACrDrB,EAAOK,EAAO,mBAAmBgB,EAAM,CAAC,CAAC,EAAE,KAAK,EAAI,EACpDrB,EAAOK,EAAO,mBAAmBgB,EAAM,CAAC,CAAC,EAAE,KAAK,EAAK,CACvD,CAAC,CACH,CAAC",
|
|
6
6
|
"names": ["describe", "expect", "it", "OnboardingState", "SeedWordCount", "SecureElementFlagsParser", "parser", "seFlags", "expectedState", "value", "hasSlot1", "hasSlot2", "numberOfWords", "currentWordIndex", "words", "valid", "onboardingState", "status", "parsedStates", "_", "index", "state", "byte"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{DeviceModelId as e}from"../../../device/DeviceModel";import{OnboardingState as r,SeedWordCount as
|
|
1
|
+
import{DeviceModelId as e}from"../../../device/DeviceModel";import{OnboardingState as r,SeedWordCount as t}from"../../../device/SecureElementFlags";const i=(o=e.NANO_SP,n={})=>({[e.NANO_SP]:{isBootloader:!1,isOsu:!1,targetId:856686596,seTargetId:856686596,seVersion:"1.1.1",seFlags:new Uint8Array([230,0,0,0]),mcuTargetId:void 0,mcuSephVersion:"4.03",mcuBootloaderVersion:"3.12",hwVersion:"00",langId:0,recoverState:void 0,secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1,hasEndorsementCertificateInSlot1:!1,hasEndorsementCertificateInSlot2:!1,numberOfWords:t.TwentyFour,currentWordIndex:0,onboardingState:r.WelcomeScreen1},...n},[e.NANO_S]:{isBootloader:!1,isOsu:!1,targetId:858783748,seTargetId:858783748,seVersion:"1.1.1",seFlags:new Uint8Array([230,0,0,0]),mcuTargetId:void 0,mcuSephVersion:"6.4.0",mcuBootloaderVersion:"5.4.0",hwVersion:"00",langId:0,recoverState:void 0,secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1,hasEndorsementCertificateInSlot1:!1,hasEndorsementCertificateInSlot2:!1,numberOfWords:t.TwentyFour,currentWordIndex:0,onboardingState:r.WelcomeScreen1},...n},[e.NANO_X]:{isBootloader:!1,isOsu:!1,targetId:855638020,seTargetId:855638020,seVersion:"2.2.3",seFlags:new Uint8Array([230,0,0,0]),mcuTargetId:void 0,mcuSephVersion:"2.30",mcuBootloaderVersion:"1.16",hwVersion:"00",langId:0,recoverState:0,secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1,hasEndorsementCertificateInSlot1:!1,hasEndorsementCertificateInSlot2:!1,numberOfWords:t.TwentyFour,currentWordIndex:0,onboardingState:r.WelcomeScreen1},...n},[e.STAX]:{isBootloader:!1,isOsu:!1,targetId:857735172,seTargetId:857735172,seVersion:"1.3.0",seFlags:new Uint8Array([230,0,0,0]),mcuTargetId:void 0,mcuSephVersion:"5.24",mcuBootloaderVersion:"0.48",hwVersion:"00",langId:0,recoverState:void 0,secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1,hasEndorsementCertificateInSlot1:!1,hasEndorsementCertificateInSlot2:!1,numberOfWords:t.TwentyFour,currentWordIndex:0,onboardingState:r.WelcomeScreen1},...n},[e.FLEX]:{isBootloader:!1,isOsu:!1,targetId:858783748,seTargetId:858783748,seVersion:"1.1.1",seFlags:new Uint8Array([230,0,0,0]),mcuTargetId:void 0,mcuSephVersion:"6.4.0",mcuBootloaderVersion:"5.4.0",hwVersion:"00",langId:0,recoverState:0,secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1,hasEndorsementCertificateInSlot1:!1,hasEndorsementCertificateInSlot2:!1,numberOfWords:t.TwentyFour,currentWordIndex:0,onboardingState:r.WelcomeScreen1},...n},[e.APEX]:{isBootloader:!1,isOsu:!1,targetId:858783748,seTargetId:858783748,seVersion:"1.1.1",seFlags:new Uint8Array([230,0,0,0]),mcuTargetId:void 0,mcuSephVersion:"6.4.0",mcuBootloaderVersion:"5.4.0",hwVersion:"00",langId:0,recoverState:0,secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1,hasEndorsementCertificateInSlot1:!1,hasEndorsementCertificateInSlot2:!1,numberOfWords:t.TwentyFour,currentWordIndex:0,onboardingState:r.WelcomeScreen1}}})[o];export{i as getOsVersionCommandResponseMockBuilder};
|
|
2
2
|
//# sourceMappingURL=GetOsVersionCommand.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/api/command/os/__mocks__/GetOsVersionCommand.ts"],
|
|
4
|
-
"sourcesContent": ["import { type GetOsVersionResponse } from \"@api/command/os/GetOsVersionCommand\";\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { OnboardingState, SeedWordCount } from \"@api/device/SecureElementFlags\";\n\nexport const getOsVersionCommandResponseMockBuilder = (\n deviceModelId: DeviceModelId = DeviceModelId.NANO_SP,\n props: Partial<GetOsVersionResponse> = {},\n): GetOsVersionResponse =>\n ({\n [DeviceModelId.NANO_SP]: {\n isBootloader: false,\n isOsu: false,\n targetId: 856686596,\n seTargetId: 856686596,\n seVersion: \"1.1.1\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"4.03\",\n mcuBootloaderVersion: \"3.12\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: undefined,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n hasEndorsementCertificateInSlot1: false,\n hasEndorsementCertificateInSlot2: false,\n numberOfWords: SeedWordCount.TwentyFour,\n currentWordIndex: 0,\n onboardingState: OnboardingState.
|
|
5
|
-
"mappings": "AACA,OAAS,iBAAAA,MAAqB,0BAC9B,OAAS,mBAAAC,EAAiB,iBAAAC,MAAqB,iCAExC,MAAMC,EAAyC,CACpDC,EAA+BJ,EAAc,QAC7CK,EAAuC,CAAC,KAEvC,CACC,CAACL,EAAc,OAAO,EAAG,CACvB,aAAc,GACd,MAAO,GACP,SAAU,UACV,WAAY,UACZ,UAAW,QACX,QAAS,IAAI,WAAW,CAAC,IAAM,EAAM,EAAM,CAAI,CAAC,EAChD,YAAa,OACb,eAAgB,OAChB,qBAAsB,OACtB,UAAW,KACX,OAAQ,EACR,aAAc,OACd,mBAAoB,CAClB,eAAgB,GAChB,mBAAoB,GACpB,oBAAqB,GACrB,mCAAoC,GACpC,0BAA2B,GAC3B,YAAa,GACb,gBAAiB,GACjB,iBAAkB,GAClB,iCAAkC,GAClC,iCAAkC,GAClC,cAAeE,EAAc,WAC7B,iBAAkB,EAClB,gBAAiBD,EAAgB,
|
|
4
|
+
"sourcesContent": ["import { type GetOsVersionResponse } from \"@api/command/os/GetOsVersionCommand\";\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { OnboardingState, SeedWordCount } from \"@api/device/SecureElementFlags\";\n\nexport const getOsVersionCommandResponseMockBuilder = (\n deviceModelId: DeviceModelId = DeviceModelId.NANO_SP,\n props: Partial<GetOsVersionResponse> = {},\n): GetOsVersionResponse =>\n ({\n [DeviceModelId.NANO_SP]: {\n isBootloader: false,\n isOsu: false,\n targetId: 856686596,\n seTargetId: 856686596,\n seVersion: \"1.1.1\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"4.03\",\n mcuBootloaderVersion: \"3.12\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: undefined,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n hasEndorsementCertificateInSlot1: false,\n hasEndorsementCertificateInSlot2: false,\n numberOfWords: SeedWordCount.TwentyFour,\n currentWordIndex: 0,\n onboardingState: OnboardingState.WelcomeScreen1,\n },\n ...props,\n },\n [DeviceModelId.NANO_S]: {\n isBootloader: false,\n isOsu: false,\n targetId: 858783748,\n seTargetId: 858783748,\n seVersion: \"1.1.1\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"6.4.0\",\n mcuBootloaderVersion: \"5.4.0\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: undefined,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n hasEndorsementCertificateInSlot1: false,\n hasEndorsementCertificateInSlot2: false,\n numberOfWords: SeedWordCount.TwentyFour,\n currentWordIndex: 0,\n onboardingState: OnboardingState.WelcomeScreen1,\n },\n ...props,\n },\n [DeviceModelId.NANO_X]: {\n isBootloader: false,\n isOsu: false,\n targetId: 855638020,\n seTargetId: 855638020,\n seVersion: \"2.2.3\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"2.30\",\n mcuBootloaderVersion: \"1.16\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: 0,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n hasEndorsementCertificateInSlot1: false,\n hasEndorsementCertificateInSlot2: false,\n numberOfWords: SeedWordCount.TwentyFour,\n currentWordIndex: 0,\n onboardingState: OnboardingState.WelcomeScreen1,\n },\n ...props,\n },\n [DeviceModelId.STAX]: {\n isBootloader: false,\n isOsu: false,\n targetId: 857735172,\n seTargetId: 857735172,\n seVersion: \"1.3.0\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"5.24\",\n mcuBootloaderVersion: \"0.48\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: undefined,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n hasEndorsementCertificateInSlot1: false,\n hasEndorsementCertificateInSlot2: false,\n numberOfWords: SeedWordCount.TwentyFour,\n currentWordIndex: 0,\n onboardingState: OnboardingState.WelcomeScreen1,\n },\n ...props,\n },\n [DeviceModelId.FLEX]: {\n isBootloader: false,\n isOsu: false,\n targetId: 858783748,\n seTargetId: 858783748,\n seVersion: \"1.1.1\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"6.4.0\",\n mcuBootloaderVersion: \"5.4.0\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: 0,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n hasEndorsementCertificateInSlot1: false,\n hasEndorsementCertificateInSlot2: false,\n numberOfWords: SeedWordCount.TwentyFour,\n currentWordIndex: 0,\n onboardingState: OnboardingState.WelcomeScreen1,\n },\n ...props,\n },\n [DeviceModelId.APEX]: {\n isBootloader: false,\n isOsu: false,\n targetId: 858783748,\n seTargetId: 858783748,\n seVersion: \"1.1.1\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"6.4.0\",\n mcuBootloaderVersion: \"5.4.0\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: 0,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n hasEndorsementCertificateInSlot1: false,\n hasEndorsementCertificateInSlot2: false,\n numberOfWords: SeedWordCount.TwentyFour,\n currentWordIndex: 0,\n onboardingState: OnboardingState.WelcomeScreen1,\n },\n },\n })[deviceModelId];\n"],
|
|
5
|
+
"mappings": "AACA,OAAS,iBAAAA,MAAqB,0BAC9B,OAAS,mBAAAC,EAAiB,iBAAAC,MAAqB,iCAExC,MAAMC,EAAyC,CACpDC,EAA+BJ,EAAc,QAC7CK,EAAuC,CAAC,KAEvC,CACC,CAACL,EAAc,OAAO,EAAG,CACvB,aAAc,GACd,MAAO,GACP,SAAU,UACV,WAAY,UACZ,UAAW,QACX,QAAS,IAAI,WAAW,CAAC,IAAM,EAAM,EAAM,CAAI,CAAC,EAChD,YAAa,OACb,eAAgB,OAChB,qBAAsB,OACtB,UAAW,KACX,OAAQ,EACR,aAAc,OACd,mBAAoB,CAClB,eAAgB,GAChB,mBAAoB,GACpB,oBAAqB,GACrB,mCAAoC,GACpC,0BAA2B,GAC3B,YAAa,GACb,gBAAiB,GACjB,iBAAkB,GAClB,iCAAkC,GAClC,iCAAkC,GAClC,cAAeE,EAAc,WAC7B,iBAAkB,EAClB,gBAAiBD,EAAgB,cACnC,EACA,GAAGI,CACL,EACA,CAACL,EAAc,MAAM,EAAG,CACtB,aAAc,GACd,MAAO,GACP,SAAU,UACV,WAAY,UACZ,UAAW,QACX,QAAS,IAAI,WAAW,CAAC,IAAM,EAAM,EAAM,CAAI,CAAC,EAChD,YAAa,OACb,eAAgB,QAChB,qBAAsB,QACtB,UAAW,KACX,OAAQ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AAW,QACX,QAAS,IAAI,WAAW,CAAC,IAAM,EAAM,EAAM,CAAI,CAAC,EAChD,YAAa,OACb,eAAgB,QAChB,qBAAsB,QACtB,UAAW,KACX,OAAQ,EACR,aAAc,EACd,mBAAoB,CAClB,eAAgB,GAChB,mBAAoB,GACpB,oBAAqB,GACrB,mCAAoC,GACpC,0BAA2B,GAC3B,YAAa,GACb,gBAAiB,GACjB,iBAAkB,GAClB,iCAAkC,GAClC,iCAAkC,GAClC,cAAeE,EAAc,WAC7B,iBAAkB,EAClB,gBAAiBD,EAAgB,cACnC,EACA,GAAGI,CACL,EACA,CAACL,EAAc,IAAI,EAAG,CACpB,aAAc,GACd,MAAO,GACP,SAAU,UACV,WAAY,UACZ,UAAW,QACX,QAAS,IAAI,WAAW,CAAC,IAAM,EAAM,EAAM,CAAI,CAAC,EAChD,YAAa,OACb,eAAgB,QAChB,qBAAsB,QACtB,UAAW,KACX,OAAQ,EACR,aAAc,EACd,mBAAoB,CAClB,eAAgB,GAChB,mBAAoB,GACpB,oBAAqB,GACrB,mCAAoC,GACpC,0BAA2B,GAC3B,YAAa,GACb,gBAAiB,GACjB,iBAAkB,GAClB,iCAAkC,GAClC,iCAAkC,GAClC,cAAeE,EAAc,WAC7B,iBAAkB,EAClB,gBAAiBD,EAAgB,cACnC,CACF,CACF,GAAGG,CAAa",
|
|
6
6
|
"names": ["DeviceModelId", "OnboardingState", "SeedWordCount", "getOsVersionCommandResponseMockBuilder", "deviceModelId", "props"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const r={Twelve:12,Eighteen:18,TwentyFour:24};var o=(e=>(e.Unknown="unknown",e.WelcomeScreen1="welcome-screen-1",e.WelcomeScreen2="welcome-screen-2",e.WelcomeScreen3="welcome-screen-3",e.WelcomeScreen4="welcome-screen-4",e.WelcomeScreenReminder="welcome-screen-reminder",e.SetupChoice="setup-choice",e.NewDevice="new-device",e.ConfirmNewDevice="confirm-new-device",e.RestoreRecoveryPhrase="restore-recovery-phrase",e.SafetyWarning="safety-warning",e.DeviceIsReady="device-is-ready",e.ChooseName="choose-name",e.RestoreRecoverBackup="restore-recover-backup",e.SetupRestoreChoice="setup-restore-choice",e.OnboardingStatusCheck="onboarding-status-check",e.RestoreWithRk="restore-with-rk",e))(o||{});export{o as OnboardingState,r as SeedWordCount};
|
|
1
|
+
const r={Twelve:12,Eighteen:18,TwentyFour:24};var o=(e=>(e.Unknown="unknown",e.WelcomeScreen1="welcome-screen-1",e.WelcomeScreen2="welcome-screen-2",e.WelcomeScreen3="welcome-screen-3",e.WelcomeScreen4="welcome-screen-4",e.WelcomeScreenReminder="welcome-screen-reminder",e.SetupChoice="setup-choice",e.Pin="pin",e.NewDevice="new-device",e.ConfirmNewDevice="confirm-new-device",e.RestoreRecoveryPhrase="restore-recovery-phrase",e.SafetyWarning="safety-warning",e.DeviceIsReady="device-is-ready",e.ChooseName="choose-name",e.RestoreRecoverBackup="restore-recover-backup",e.SetupRestoreChoice="setup-restore-choice",e.OnboardingStatusCheck="onboarding-status-check",e.RestoreWithRk="restore-with-rk",e))(o||{});export{o as OnboardingState,r as SeedWordCount};
|
|
2
2
|
//# sourceMappingURL=SecureElementFlags.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/api/device/SecureElementFlags.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Represents the general state of a device, the information comes from the first byte of the secure element flags.\n */\nexport type DeviceGeneralState = {\n /**\n * Indicates whether the device's PIN has been validated.\n */\n isPinValidated: boolean;\n\n /**\n * Indicates whether the device has a MCU serial number.\n */\n hasMcuSerialNumber: boolean;\n\n /**\n * Indicates whether the device has a personalized valid Ledger certificate.\n */\n hasValidCertificate: boolean;\n\n /**\n * Indicates whether the device is allowed to connect with a custom certificate authority.\n */\n isCustomAuthorityConnectionAllowed: boolean;\n\n /**\n * Indicates whether the device is allowed to commnunicate with secure connection.\n */\n isSecureConnectionAllowed: boolean;\n\n /**\n * Indicates whether the device has been onboarded.\n */\n isOnboarded: boolean;\n\n /**\n * Indicates whether the MCU code on the device is signed.\n */\n isMcuCodeSigned: boolean;\n\n /**\n * Indicates whether the device is in recovery mode.\n */\n isInRecoveryMode: boolean;\n};\n\n/**\n * Represents which endorsement certificate slots are populated.\n * This information comes from the second byte of the secure element flags.\n */\nexport type EndorsementInformation = {\n hasEndorsementCertificateInSlot1: boolean;\n hasEndorsementCertificateInSlot2: boolean;\n};\n\n/**\n * Number of seed words selected during onboarding.\n * Values follow GET VERSION byte 3 (bits 5\u20136): 24, 18, or 12.\n *\n * Defined as a const object rather than a numeric enum so the type stays\n * `12 | 18 | 24` and is not assignable from an arbitrary `number`.\n */\nexport const SeedWordCount = {\n Twelve: 12,\n Eighteen: 18,\n TwentyFour: 24,\n} as const;\n\nexport type SeedWordCount = (typeof SeedWordCount)[keyof typeof SeedWordCount];\n\n/**\n * Represents the seed phrase setup progress.\n * This information comes from the third byte of the secure element flags.\n */\nexport type WordsInformation = {\n /**\n * Number of seed words selected by the user.\n * `undefined` represents a reserved or unknown encoding.\n */\n numberOfWords: SeedWordCount | undefined;\n /**\n * Zero-based index of the word currently being entered or confirmed.\n */\n currentWordIndex: number;\n};\n\n/**\n * Onboarding screen encoded in the fourth secure element flag byte.\n * Values follow GET VERSION byte 4 (
|
|
5
|
-
"mappings": "AA6DO,MAAMA,EAAgB,CAC3B,OAAQ,GACR,SAAU,GACV,WAAY,EACd,EAwBO,IAAKC,OAKVA,EAAA,QAAU,UACVA,EAAA,eAAiB,mBACjBA,EAAA,eAAiB,mBACjBA,EAAA,eAAiB,mBACjBA,EAAA,eAAiB,mBACjBA,EAAA,sBAAwB,0BACxBA,EAAA,YAAc,eACdA,EAAA,UAAY,aACZA,EAAA,iBAAmB,qBACnBA,EAAA,sBAAwB,0BACxBA,EAAA,cAAgB,iBAChBA,EAAA,cAAgB,kBAChBA,EAAA,WAAa,cACbA,EAAA,qBAAuB,yBACvBA,EAAA,mBAAqB,uBACrBA,EAAA,sBAAwB,0BACxBA,EAAA,cAAgB,
|
|
4
|
+
"sourcesContent": ["/**\n * Represents the general state of a device, the information comes from the first byte of the secure element flags.\n */\nexport type DeviceGeneralState = {\n /**\n * Indicates whether the device's PIN has been validated.\n */\n isPinValidated: boolean;\n\n /**\n * Indicates whether the device has a MCU serial number.\n */\n hasMcuSerialNumber: boolean;\n\n /**\n * Indicates whether the device has a personalized valid Ledger certificate.\n */\n hasValidCertificate: boolean;\n\n /**\n * Indicates whether the device is allowed to connect with a custom certificate authority.\n */\n isCustomAuthorityConnectionAllowed: boolean;\n\n /**\n * Indicates whether the device is allowed to commnunicate with secure connection.\n */\n isSecureConnectionAllowed: boolean;\n\n /**\n * Indicates whether the device has been onboarded.\n */\n isOnboarded: boolean;\n\n /**\n * Indicates whether the MCU code on the device is signed.\n */\n isMcuCodeSigned: boolean;\n\n /**\n * Indicates whether the device is in recovery mode.\n */\n isInRecoveryMode: boolean;\n};\n\n/**\n * Represents which endorsement certificate slots are populated.\n * This information comes from the second byte of the secure element flags.\n */\nexport type EndorsementInformation = {\n hasEndorsementCertificateInSlot1: boolean;\n hasEndorsementCertificateInSlot2: boolean;\n};\n\n/**\n * Number of seed words selected during onboarding.\n * Values follow GET VERSION byte 3 (bits 5\u20136): 24, 18, or 12.\n *\n * Defined as a const object rather than a numeric enum so the type stays\n * `12 | 18 | 24` and is not assignable from an arbitrary `number`.\n */\nexport const SeedWordCount = {\n Twelve: 12,\n Eighteen: 18,\n TwentyFour: 24,\n} as const;\n\nexport type SeedWordCount = (typeof SeedWordCount)[keyof typeof SeedWordCount];\n\n/**\n * Represents the seed phrase setup progress.\n * This information comes from the third byte of the secure element flags.\n */\nexport type WordsInformation = {\n /**\n * Number of seed words selected by the user.\n * `undefined` represents a reserved or unknown encoding.\n */\n numberOfWords: SeedWordCount | undefined;\n /**\n * Zero-based index of the word currently being entered or confirmed.\n */\n currentWordIndex: number;\n};\n\n/**\n * Onboarding screen encoded in the fourth secure element flag byte.\n * Values follow GET VERSION byte 4 (0x00 to 0x10).\n */\nexport enum OnboardingState {\n /**\n * An encoding not covered by the specification (any byte outside 0x00\u20130x10),\n * which future firmware versions may introduce.\n */\n Unknown = \"unknown\",\n WelcomeScreen1 = \"welcome-screen-1\",\n WelcomeScreen2 = \"welcome-screen-2\",\n WelcomeScreen3 = \"welcome-screen-3\",\n WelcomeScreen4 = \"welcome-screen-4\",\n WelcomeScreenReminder = \"welcome-screen-reminder\",\n SetupChoice = \"setup-choice\",\n Pin = \"pin\",\n NewDevice = \"new-device\",\n ConfirmNewDevice = \"confirm-new-device\",\n RestoreRecoveryPhrase = \"restore-recovery-phrase\",\n SafetyWarning = \"safety-warning\",\n DeviceIsReady = \"device-is-ready\",\n ChooseName = \"choose-name\",\n RestoreRecoverBackup = \"restore-recover-backup\",\n SetupRestoreChoice = \"setup-restore-choice\",\n OnboardingStatusCheck = \"onboarding-status-check\",\n RestoreWithRk = \"restore-with-rk\",\n}\n\n/**\n * Represents the current onboarding state.\n * This information comes from the fourth byte of the secure element flags.\n */\nexport type OnboardingStatus = {\n /**\n * Parsed onboarding state, `OnboardingState.Unknown` for unmapped bytes.\n */\n onboardingState: OnboardingState;\n};\n\n/**\n * Parsed secure element flags from a Get OS version response.\n */\nexport type SecureElementFlags = DeviceGeneralState &\n EndorsementInformation &\n WordsInformation &\n OnboardingStatus;\n"],
|
|
5
|
+
"mappings": "AA6DO,MAAMA,EAAgB,CAC3B,OAAQ,GACR,SAAU,GACV,WAAY,EACd,EAwBO,IAAKC,OAKVA,EAAA,QAAU,UACVA,EAAA,eAAiB,mBACjBA,EAAA,eAAiB,mBACjBA,EAAA,eAAiB,mBACjBA,EAAA,eAAiB,mBACjBA,EAAA,sBAAwB,0BACxBA,EAAA,YAAc,eACdA,EAAA,IAAM,MACNA,EAAA,UAAY,aACZA,EAAA,iBAAmB,qBACnBA,EAAA,sBAAwB,0BACxBA,EAAA,cAAgB,iBAChBA,EAAA,cAAgB,kBAChBA,EAAA,WAAa,cACbA,EAAA,qBAAuB,yBACvBA,EAAA,mBAAqB,uBACrBA,EAAA,sBAAwB,0BACxBA,EAAA,cAAgB,kBAtBNA,OAAA",
|
|
6
6
|
"names": ["SeedWordCount", "OnboardingState"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecureElementFlagsParser.d.ts","sourceRoot":"","sources":["../../../../../../src/api/command/os/SecureElementFlagsParser.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAE3B,KAAK,gBAAgB,EAErB,KAAK,gBAAgB,EACtB,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"SecureElementFlagsParser.d.ts","sourceRoot":"","sources":["../../../../../../src/api/command/os/SecureElementFlagsParser.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAE3B,KAAK,gBAAgB,EAErB,KAAK,gBAAgB,EACtB,MAAM,gCAAgC,CAAC;AAsBxC;;GAEG;AACH,qBAAa,wBAAwB;IACnC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAa;IAErC;;;OAGG;gBACS,OAAO,EAAE,UAAU;IAK/B;;;OAGG;IACH,kBAAkB,IAAI,kBAAkB;IAexC;;;OAGG;IACH,sBAAsB,IAAI,sBAAsB;IAShD;;;OAGG;IACH,gBAAgB,IAAI,gBAAgB;IAgBpC;;;OAGG;IACH,gBAAgB,IAAI,gBAAgB;IASpC;;;;;OAKG;IACH,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO;CAGrD"}
|
|
@@ -73,12 +73,12 @@ export type WordsInformation = {
|
|
|
73
73
|
};
|
|
74
74
|
/**
|
|
75
75
|
* Onboarding screen encoded in the fourth secure element flag byte.
|
|
76
|
-
* Values follow GET VERSION byte 4 (
|
|
76
|
+
* Values follow GET VERSION byte 4 (0x00 to 0x10).
|
|
77
77
|
*/
|
|
78
78
|
export declare enum OnboardingState {
|
|
79
79
|
/**
|
|
80
|
-
*
|
|
81
|
-
* future firmware versions may introduce.
|
|
80
|
+
* An encoding not covered by the specification (any byte outside 0x00–0x10),
|
|
81
|
+
* which future firmware versions may introduce.
|
|
82
82
|
*/
|
|
83
83
|
Unknown = "unknown",
|
|
84
84
|
WelcomeScreen1 = "welcome-screen-1",
|
|
@@ -87,6 +87,7 @@ export declare enum OnboardingState {
|
|
|
87
87
|
WelcomeScreen4 = "welcome-screen-4",
|
|
88
88
|
WelcomeScreenReminder = "welcome-screen-reminder",
|
|
89
89
|
SetupChoice = "setup-choice",
|
|
90
|
+
Pin = "pin",
|
|
90
91
|
NewDevice = "new-device",
|
|
91
92
|
ConfirmNewDevice = "confirm-new-device",
|
|
92
93
|
RestoreRecoveryPhrase = "restore-recovery-phrase",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecureElementFlags.d.ts","sourceRoot":"","sources":["../../../../../src/api/device/SecureElementFlags.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,cAAc,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,kBAAkB,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,mBAAmB,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,kCAAkC,EAAE,OAAO,CAAC;IAE5C;;OAEG;IACH,yBAAyB,EAAE,OAAO,CAAC;IAEnC;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,eAAe,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,gCAAgC,EAAE,OAAO,CAAC;IAC1C,gCAAgC,EAAE,OAAO,CAAC;CAC3C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,aAAa;;;;CAIhB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAE/E;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,aAAa,EAAE,aAAa,GAAG,SAAS,CAAC;IACzC;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF;;;GAGG;AACH,oBAAY,eAAe;IACzB;;;OAGG;IACH,OAAO,YAAY;IACnB,cAAc,qBAAqB;IACnC,cAAc,qBAAqB;IACnC,cAAc,qBAAqB;IACnC,cAAc,qBAAqB;IACnC,qBAAqB,4BAA4B;IACjD,WAAW,iBAAiB;IAC5B,SAAS,eAAe;IACxB,gBAAgB,uBAAuB;IACvC,qBAAqB,4BAA4B;IACjD,aAAa,mBAAmB;IAChC,aAAa,oBAAoB;IACjC,UAAU,gBAAgB;IAC1B,oBAAoB,2BAA2B;IAC/C,kBAAkB,yBAAyB;IAC3C,qBAAqB,4BAA4B;IACjD,aAAa,oBAAoB;CAClC;AAED;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;OAEG;IACH,eAAe,EAAE,eAAe,CAAC;CAClC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,kBAAkB,GACjD,sBAAsB,GACtB,gBAAgB,GAChB,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"SecureElementFlags.d.ts","sourceRoot":"","sources":["../../../../../src/api/device/SecureElementFlags.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,cAAc,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,kBAAkB,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,mBAAmB,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,kCAAkC,EAAE,OAAO,C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