@ledgerhq/device-signer-kit-aleo 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/lib/cjs/api/SignerAleo.js +1 -1
  2. package/lib/cjs/api/SignerAleo.js.map +1 -1
  3. package/lib/cjs/api/app-binder/GetTvkDeviceActionTypes.js +2 -0
  4. package/lib/cjs/api/app-binder/GetTvkDeviceActionTypes.js.map +7 -0
  5. package/lib/cjs/api/app-binder/SignNestedCallDeviceActionTypes.js +2 -0
  6. package/lib/cjs/api/app-binder/SignNestedCallDeviceActionTypes.js.map +7 -0
  7. package/lib/cjs/api/index.js +1 -1
  8. package/lib/cjs/api/index.js.map +2 -2
  9. package/lib/cjs/api/model/GetTvkOptions.js +2 -0
  10. package/lib/cjs/api/model/GetTvkOptions.js.map +7 -0
  11. package/lib/cjs/internal/DefaultSignerAleo.js +1 -1
  12. package/lib/cjs/internal/DefaultSignerAleo.js.map +3 -3
  13. package/lib/cjs/internal/app-binder/AleoAppBinder.js +1 -1
  14. package/lib/cjs/internal/app-binder/AleoAppBinder.js.map +3 -3
  15. package/lib/cjs/internal/app-binder/command/GetTvkCommand.js +2 -0
  16. package/lib/cjs/internal/app-binder/command/GetTvkCommand.js.map +7 -0
  17. package/lib/cjs/internal/app-binder/command/GetTvkCommand.test.js +2 -0
  18. package/lib/cjs/internal/app-binder/command/GetTvkCommand.test.js.map +7 -0
  19. package/lib/cjs/internal/app-binder/command/SignNestedCallCommand.js +2 -0
  20. package/lib/cjs/internal/app-binder/command/SignNestedCallCommand.js.map +7 -0
  21. package/lib/cjs/internal/app-binder/command/SignNestedCallCommand.test.js +2 -0
  22. package/lib/cjs/internal/app-binder/command/SignNestedCallCommand.test.js.map +7 -0
  23. package/lib/cjs/internal/app-binder/command/utils/aleoApplicationErrors.js +1 -1
  24. package/lib/cjs/internal/app-binder/command/utils/aleoApplicationErrors.js.map +2 -2
  25. package/lib/cjs/internal/app-binder/command/utils/aleoApplicationErrors.test.js +1 -1
  26. package/lib/cjs/internal/app-binder/command/utils/aleoApplicationErrors.test.js.map +2 -2
  27. package/lib/cjs/internal/app-binder/command/utils/apduHeaderUtils.js +1 -1
  28. package/lib/cjs/internal/app-binder/command/utils/apduHeaderUtils.js.map +3 -3
  29. package/lib/cjs/internal/app-binder/task/SignFeeIntentTask.js +1 -1
  30. package/lib/cjs/internal/app-binder/task/SignFeeIntentTask.js.map +3 -3
  31. package/lib/cjs/internal/app-binder/task/SignNestedCallTask.js +2 -0
  32. package/lib/cjs/internal/app-binder/task/SignNestedCallTask.js.map +7 -0
  33. package/lib/cjs/internal/app-binder/task/SignNestedCallTask.test.js +2 -0
  34. package/lib/cjs/internal/app-binder/task/SignNestedCallTask.test.js.map +7 -0
  35. package/lib/cjs/internal/app-binder/task/SignRootIntentTask.js +1 -1
  36. package/lib/cjs/internal/app-binder/task/SignRootIntentTask.js.map +3 -3
  37. package/lib/cjs/internal/use-cases/address/GetTvkUseCase.js +2 -0
  38. package/lib/cjs/internal/use-cases/address/GetTvkUseCase.js.map +7 -0
  39. package/lib/cjs/internal/use-cases/address/di/addressModule.js +1 -1
  40. package/lib/cjs/internal/use-cases/address/di/addressModule.js.map +3 -3
  41. package/lib/cjs/internal/use-cases/address/di/addressTypes.js +1 -1
  42. package/lib/cjs/internal/use-cases/address/di/addressTypes.js.map +2 -2
  43. package/lib/cjs/internal/use-cases/transaction/SignNestedCallUseCase.js +2 -0
  44. package/lib/cjs/internal/use-cases/transaction/SignNestedCallUseCase.js.map +7 -0
  45. package/lib/cjs/internal/use-cases/transaction/di/transactionModule.js +1 -1
  46. package/lib/cjs/internal/use-cases/transaction/di/transactionModule.js.map +3 -3
  47. package/lib/cjs/internal/use-cases/transaction/di/transactionTypes.js +1 -1
  48. package/lib/cjs/internal/use-cases/transaction/di/transactionTypes.js.map +2 -2
  49. package/lib/cjs/package.json +5 -5
  50. package/lib/esm/api/app-binder/GetTvkDeviceActionTypes.js +1 -0
  51. package/lib/esm/api/app-binder/GetTvkDeviceActionTypes.js.map +7 -0
  52. package/lib/esm/api/app-binder/SignNestedCallDeviceActionTypes.js +1 -0
  53. package/lib/esm/api/app-binder/SignNestedCallDeviceActionTypes.js.map +7 -0
  54. package/lib/esm/api/index.js.map +2 -2
  55. package/lib/esm/api/model/GetTvkOptions.js +1 -0
  56. package/lib/esm/api/model/GetTvkOptions.js.map +7 -0
  57. package/lib/esm/internal/DefaultSignerAleo.js +1 -1
  58. package/lib/esm/internal/DefaultSignerAleo.js.map +3 -3
  59. package/lib/esm/internal/app-binder/AleoAppBinder.js +1 -1
  60. package/lib/esm/internal/app-binder/AleoAppBinder.js.map +3 -3
  61. package/lib/esm/internal/app-binder/command/GetTvkCommand.js +2 -0
  62. package/lib/esm/internal/app-binder/command/GetTvkCommand.js.map +7 -0
  63. package/lib/esm/internal/app-binder/command/GetTvkCommand.test.js +2 -0
  64. package/lib/esm/internal/app-binder/command/GetTvkCommand.test.js.map +7 -0
  65. package/lib/esm/internal/app-binder/command/SignNestedCallCommand.js +2 -0
  66. package/lib/esm/internal/app-binder/command/SignNestedCallCommand.js.map +7 -0
  67. package/lib/esm/internal/app-binder/command/SignNestedCallCommand.test.js +2 -0
  68. package/lib/esm/internal/app-binder/command/SignNestedCallCommand.test.js.map +7 -0
  69. package/lib/esm/internal/app-binder/command/utils/aleoApplicationErrors.js +1 -1
  70. package/lib/esm/internal/app-binder/command/utils/aleoApplicationErrors.js.map +2 -2
  71. package/lib/esm/internal/app-binder/command/utils/aleoApplicationErrors.test.js +1 -1
  72. package/lib/esm/internal/app-binder/command/utils/aleoApplicationErrors.test.js.map +2 -2
  73. package/lib/esm/internal/app-binder/command/utils/apduHeaderUtils.js +1 -1
  74. package/lib/esm/internal/app-binder/command/utils/apduHeaderUtils.js.map +3 -3
  75. package/lib/esm/internal/app-binder/task/SignFeeIntentTask.js +1 -1
  76. package/lib/esm/internal/app-binder/task/SignFeeIntentTask.js.map +3 -3
  77. package/lib/esm/internal/app-binder/task/SignNestedCallTask.js +2 -0
  78. package/lib/esm/internal/app-binder/task/SignNestedCallTask.js.map +7 -0
  79. package/lib/esm/internal/app-binder/task/SignNestedCallTask.test.js +2 -0
  80. package/lib/esm/internal/app-binder/task/SignNestedCallTask.test.js.map +7 -0
  81. package/lib/esm/internal/app-binder/task/SignRootIntentTask.js +1 -1
  82. package/lib/esm/internal/app-binder/task/SignRootIntentTask.js.map +3 -3
  83. package/lib/esm/internal/use-cases/address/GetTvkUseCase.js +2 -0
  84. package/lib/esm/internal/use-cases/address/GetTvkUseCase.js.map +7 -0
  85. package/lib/esm/internal/use-cases/address/di/addressModule.js +1 -1
  86. package/lib/esm/internal/use-cases/address/di/addressModule.js.map +3 -3
  87. package/lib/esm/internal/use-cases/address/di/addressTypes.js +1 -1
  88. package/lib/esm/internal/use-cases/address/di/addressTypes.js.map +2 -2
  89. package/lib/esm/internal/use-cases/transaction/SignNestedCallUseCase.js +2 -0
  90. package/lib/esm/internal/use-cases/transaction/SignNestedCallUseCase.js.map +7 -0
  91. package/lib/esm/internal/use-cases/transaction/di/transactionModule.js +1 -1
  92. package/lib/esm/internal/use-cases/transaction/di/transactionModule.js.map +3 -3
  93. package/lib/esm/internal/use-cases/transaction/di/transactionTypes.js +1 -1
  94. package/lib/esm/internal/use-cases/transaction/di/transactionTypes.js.map +2 -2
  95. package/lib/esm/package.json +5 -5
  96. package/lib/types/api/SignerAleo.d.ts +5 -0
  97. package/lib/types/api/SignerAleo.d.ts.map +1 -1
  98. package/lib/types/api/app-binder/GetTvkDeviceActionTypes.d.ts +10 -0
  99. package/lib/types/api/app-binder/GetTvkDeviceActionTypes.d.ts.map +1 -0
  100. package/lib/types/api/app-binder/SignNestedCallDeviceActionTypes.d.ts +12 -0
  101. package/lib/types/api/app-binder/SignNestedCallDeviceActionTypes.d.ts.map +1 -0
  102. package/lib/types/api/index.d.ts +3 -0
  103. package/lib/types/api/index.d.ts.map +1 -1
  104. package/lib/types/api/model/GetTvkOptions.d.ts +5 -0
  105. package/lib/types/api/model/GetTvkOptions.d.ts.map +1 -0
  106. package/lib/types/internal/DefaultSignerAleo.d.ts +5 -0
  107. package/lib/types/internal/DefaultSignerAleo.d.ts.map +1 -1
  108. package/lib/types/internal/app-binder/AleoAppBinder.d.ts +11 -0
  109. package/lib/types/internal/app-binder/AleoAppBinder.d.ts.map +1 -1
  110. package/lib/types/internal/app-binder/command/GetTvkCommand.d.ts +19 -0
  111. package/lib/types/internal/app-binder/command/GetTvkCommand.d.ts.map +1 -0
  112. package/lib/types/internal/app-binder/command/GetTvkCommand.test.d.ts +2 -0
  113. package/lib/types/internal/app-binder/command/GetTvkCommand.test.d.ts.map +1 -0
  114. package/lib/types/internal/app-binder/command/SignNestedCallCommand.d.ts +22 -0
  115. package/lib/types/internal/app-binder/command/SignNestedCallCommand.d.ts.map +1 -0
  116. package/lib/types/internal/app-binder/command/SignNestedCallCommand.test.d.ts +2 -0
  117. package/lib/types/internal/app-binder/command/SignNestedCallCommand.test.d.ts.map +1 -0
  118. package/lib/types/internal/app-binder/command/utils/aleoApplicationErrors.d.ts +1 -1
  119. package/lib/types/internal/app-binder/command/utils/aleoApplicationErrors.d.ts.map +1 -1
  120. package/lib/types/internal/app-binder/command/utils/apduHeaderUtils.d.ts +8 -0
  121. package/lib/types/internal/app-binder/command/utils/apduHeaderUtils.d.ts.map +1 -1
  122. package/lib/types/internal/app-binder/task/SignFeeIntentTask.d.ts.map +1 -1
  123. package/lib/types/internal/app-binder/task/SignNestedCallTask.d.ts +13 -0
  124. package/lib/types/internal/app-binder/task/SignNestedCallTask.d.ts.map +1 -0
  125. package/lib/types/internal/app-binder/task/SignNestedCallTask.test.d.ts +2 -0
  126. package/lib/types/internal/app-binder/task/SignNestedCallTask.test.d.ts.map +1 -0
  127. package/lib/types/internal/app-binder/task/SignRootIntentTask.d.ts.map +1 -1
  128. package/lib/types/internal/use-cases/address/GetTvkUseCase.d.ts +9 -0
  129. package/lib/types/internal/use-cases/address/GetTvkUseCase.d.ts.map +1 -0
  130. package/lib/types/internal/use-cases/address/di/addressModule.d.ts.map +1 -1
  131. package/lib/types/internal/use-cases/address/di/addressTypes.d.ts +1 -0
  132. package/lib/types/internal/use-cases/address/di/addressTypes.d.ts.map +1 -1
  133. package/lib/types/internal/use-cases/transaction/SignNestedCallUseCase.d.ts +9 -0
  134. package/lib/types/internal/use-cases/transaction/SignNestedCallUseCase.d.ts.map +1 -0
  135. package/lib/types/internal/use-cases/transaction/di/transactionModule.d.ts.map +1 -1
  136. package/lib/types/internal/use-cases/transaction/di/transactionTypes.d.ts +1 -0
  137. package/lib/types/internal/use-cases/transaction/di/transactionTypes.d.ts.map +1 -1
  138. package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
  139. package/package.json +11 -11
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/app-binder/task/SignRootIntentTask.ts"],
4
- "sourcesContent": ["import {\n ByteArrayBuilder,\n type CommandResult,\n type InternalApi,\n} from \"@ledgerhq/device-management-kit\";\nimport { DerivationPathUtils } from \"@ledgerhq/signer-utils\";\n\nimport {\n SignRootIntentCommand,\n type SignRootIntentCommandResponse,\n} from \"@internal/app-binder/command/SignRootIntentCommand\";\nimport { type AleoErrorCodes } from \"@internal/app-binder/command/utils/aleoApplicationErrors\";\n\nimport { SendAleoCommandInChunksTask } from \"./SendAleoCommandInChunksTask\";\n\nexport type SignRootIntentTaskArgs = {\n derivationPath: string;\n rootIntent: Uint8Array;\n};\n\nexport class SignRootIntentTask {\n constructor(\n private api: InternalApi,\n private args: SignRootIntentTaskArgs,\n ) {}\n\n async run(): Promise<\n CommandResult<SignRootIntentCommandResponse, AleoErrorCodes>\n > {\n const { derivationPath, rootIntent } = this.args;\n\n const path = DerivationPathUtils.splitPath(derivationPath);\n // Path length (1 byte) + Path (4 bytes per element) + Data length (2 bytes) + Root intent data\n const totalLength = 1 + path.length * 4 + 2 + rootIntent.byteLength;\n\n const builder = new ByteArrayBuilder(totalLength);\n\n // Add the derivation path\n builder.add8BitUIntToData(path.length);\n path.forEach((element) => {\n builder.add32BitUIntToData(element);\n });\n\n // Add intent length\n builder.add16BitUIntToData(rootIntent.byteLength);\n\n // Add the root intent data\n builder.addBufferToData(rootIntent);\n\n const fullPayload = builder.build();\n\n return new SendAleoCommandInChunksTask<SignRootIntentCommandResponse>(\n this.api,\n {\n dataLength: rootIntent.byteLength,\n data: fullPayload,\n commandFactory: (chunkArgs) => new SignRootIntentCommand(chunkArgs),\n },\n ).run();\n }\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAIO,2CACPC,EAAoC,kCAEpCC,EAGO,8DAGPC,EAA4C,yCAOrC,MAAML,CAAmB,CAC9B,YACUM,EACAC,EACR,CAFQ,SAAAD,EACA,UAAAC,CACP,CAEH,MAAM,KAEJ,CACA,KAAM,CAAE,eAAAC,EAAgB,WAAAC,CAAW,EAAI,KAAK,KAEtCC,EAAO,sBAAoB,UAAUF,CAAc,EAEnDG,EAAc,EAAID,EAAK,OAAS,EAAI,EAAID,EAAW,WAEnDG,EAAU,IAAI,mBAAiBD,CAAW,EAGhDC,EAAQ,kBAAkBF,EAAK,MAAM,EACrCA,EAAK,QAASG,GAAY,CACxBD,EAAQ,mBAAmBC,CAAO,CACpC,CAAC,EAGDD,EAAQ,mBAAmBH,EAAW,UAAU,EAGhDG,EAAQ,gBAAgBH,CAAU,EAElC,MAAMK,EAAcF,EAAQ,MAAM,EAElC,OAAO,IAAI,8BACT,KAAK,IACL,CACE,WAAYH,EAAW,WACvB,KAAMK,EACN,eAAiBC,GAAc,IAAI,wBAAsBA,CAAS,CACpE,CACF,EAAE,IAAI,CACR,CACF",
6
- "names": ["SignRootIntentTask_exports", "__export", "SignRootIntentTask", "__toCommonJS", "import_device_management_kit", "import_signer_utils", "import_SignRootIntentCommand", "import_SendAleoCommandInChunksTask", "api", "args", "derivationPath", "rootIntent", "path", "totalLength", "builder", "element", "fullPayload", "chunkArgs"]
4
+ "sourcesContent": ["import {\n ByteArrayBuilder,\n type CommandResult,\n type InternalApi,\n} from \"@ledgerhq/device-management-kit\";\nimport { DerivationPathUtils } from \"@ledgerhq/signer-utils\";\n\nimport {\n SignRootIntentCommand,\n type SignRootIntentCommandResponse,\n} from \"@internal/app-binder/command/SignRootIntentCommand\";\nimport { type AleoErrorCodes } from \"@internal/app-binder/command/utils/aleoApplicationErrors\";\nimport { APDU_SECTION_LENGTH } from \"@internal/app-binder/command/utils/apduHeaderUtils\";\n\nimport { SendAleoCommandInChunksTask } from \"./SendAleoCommandInChunksTask\";\n\nexport type SignRootIntentTaskArgs = {\n derivationPath: string;\n rootIntent: Uint8Array;\n};\n\nexport class SignRootIntentTask {\n constructor(\n private api: InternalApi,\n private args: SignRootIntentTaskArgs,\n ) {}\n\n async run(): Promise<\n CommandResult<SignRootIntentCommandResponse, AleoErrorCodes>\n > {\n const { derivationPath, rootIntent } = this.args;\n\n const path = DerivationPathUtils.splitPath(derivationPath);\n // Path length (1 byte) + Path (4 bytes per element) + Data length (2 bytes) + Root intent data\n const totalLength =\n APDU_SECTION_LENGTH.DERIVATION_PATH_LENGTH +\n path.length * APDU_SECTION_LENGTH.DERIVATION_PATH_SEGMENT +\n APDU_SECTION_LENGTH.DATA_SIZE +\n rootIntent.byteLength;\n\n const builder = new ByteArrayBuilder(totalLength);\n\n // Add the derivation path\n builder.add8BitUIntToData(path.length);\n path.forEach((element) => {\n builder.add32BitUIntToData(element);\n });\n\n // Add intent length\n builder.add16BitUIntToData(rootIntent.byteLength);\n\n // Add the root intent data\n builder.addBufferToData(rootIntent);\n\n const fullPayload = builder.build();\n\n return new SendAleoCommandInChunksTask<SignRootIntentCommandResponse>(\n this.api,\n {\n dataLength: rootIntent.byteLength,\n data: fullPayload,\n commandFactory: (chunkArgs) => new SignRootIntentCommand(chunkArgs),\n },\n ).run();\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAIO,2CACPC,EAAoC,kCAEpCC,EAGO,8DAEPC,EAAoC,8DAEpCC,EAA4C,yCAOrC,MAAMN,CAAmB,CAC9B,YACUO,EACAC,EACR,CAFQ,SAAAD,EACA,UAAAC,CACP,CAEH,MAAM,KAEJ,CACA,KAAM,CAAE,eAAAC,EAAgB,WAAAC,CAAW,EAAI,KAAK,KAEtCC,EAAO,sBAAoB,UAAUF,CAAc,EAEnDG,EACJ,sBAAoB,uBACpBD,EAAK,OAAS,sBAAoB,wBAClC,sBAAoB,UACpBD,EAAW,WAEPG,EAAU,IAAI,mBAAiBD,CAAW,EAGhDC,EAAQ,kBAAkBF,EAAK,MAAM,EACrCA,EAAK,QAASG,GAAY,CACxBD,EAAQ,mBAAmBC,CAAO,CACpC,CAAC,EAGDD,EAAQ,mBAAmBH,EAAW,UAAU,EAGhDG,EAAQ,gBAAgBH,CAAU,EAElC,MAAMK,EAAcF,EAAQ,MAAM,EAElC,OAAO,IAAI,8BACT,KAAK,IACL,CACE,WAAYH,EAAW,WACvB,KAAMK,EACN,eAAiBC,GAAc,IAAI,wBAAsBA,CAAS,CACpE,CACF,EAAE,IAAI,CACR,CACF",
6
+ "names": ["SignRootIntentTask_exports", "__export", "SignRootIntentTask", "__toCommonJS", "import_device_management_kit", "import_signer_utils", "import_SignRootIntentCommand", "import_apduHeaderUtils", "import_SendAleoCommandInChunksTask", "api", "args", "derivationPath", "rootIntent", "path", "totalLength", "builder", "element", "fullPayload", "chunkArgs"]
7
7
  }
@@ -0,0 +1,2 @@
1
+ "use strict";var o=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var y=(r,p)=>{for(var e in p)o(r,e,{get:p[e],enumerable:!0})},u=(r,p,e,t)=>{if(p&&typeof p=="object"||typeof p=="function")for(let i of c(p))!f.call(r,i)&&i!==e&&o(r,i,{get:()=>p[i],enumerable:!(t=a(p,i))||t.enumerable});return r};var T=r=>u(o({},"__esModule",{value:!0}),r),B=(r,p,e,t)=>{for(var i=t>1?void 0:t?a(p,e):p,A=r.length-1,m;A>=0;A--)(m=r[A])&&(i=(t?m(p,e,i):m(i))||i);return t&&i&&o(p,e,i),i},l=(r,p)=>(e,t)=>p(e,t,r);var k={};y(k,{GetTvkUseCase:()=>n});module.exports=T(k);var d=require("inversify"),s=require("../../app-binder/di/appBinderTypes");let n=class{_appBinder;constructor(p){this._appBinder=p}execute(p,e){return this._appBinder.getTvk({derivationPath:p,transitionIndex:e?.transitionIndex,skipOpenApp:e?.skipOpenApp??!1})}};n=B([(0,d.injectable)(),l(0,(0,d.inject)(s.appBinderTypes.AppBinding))],n);0&&(module.exports={GetTvkUseCase});
2
+ //# sourceMappingURL=GetTvkUseCase.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/internal/use-cases/address/GetTvkUseCase.ts"],
4
+ "sourcesContent": ["import { inject, injectable } from \"inversify\";\n\nimport { type GetTvkDAReturnType } from \"@api/app-binder/GetTvkDeviceActionTypes\";\nimport { type GetTvkOptions } from \"@api/model/GetTvkOptions\";\nimport { AleoAppBinder } from \"@internal/app-binder/AleoAppBinder\";\nimport { appBinderTypes } from \"@internal/app-binder/di/appBinderTypes\";\n\n@injectable()\nexport class GetTvkUseCase {\n private readonly _appBinder: AleoAppBinder;\n\n constructor(@inject(appBinderTypes.AppBinding) appBinder: AleoAppBinder) {\n this._appBinder = appBinder;\n }\n\n execute(derivationPath: string, options?: GetTvkOptions): GetTvkDAReturnType {\n return this._appBinder.getTvk({\n derivationPath,\n transitionIndex: options?.transitionIndex,\n skipOpenApp: options?.skipOpenApp ?? false,\n });\n }\n}\n"],
5
+ "mappings": "okBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAmC,qBAKnCC,EAA+B,kDAGxB,IAAMC,EAAN,KAAoB,CACR,WAEjB,YAA+CC,EAA0B,CACvE,KAAK,WAAaA,CACpB,CAEA,QAAQC,EAAwBC,EAA6C,CAC3E,OAAO,KAAK,WAAW,OAAO,CAC5B,eAAAD,EACA,gBAAiBC,GAAS,gBAC1B,YAAaA,GAAS,aAAe,EACvC,CAAC,CACH,CACF,EAdaH,EAANI,EAAA,IADN,cAAW,EAIGC,EAAA,eAAO,iBAAe,UAAU,IAHlCL",
6
+ "names": ["GetTvkUseCase_exports", "__export", "GetTvkUseCase", "__toCommonJS", "import_inversify", "import_appBinderTypes", "GetTvkUseCase", "appBinder", "derivationPath", "options", "__decorateClass", "__decorateParam"]
7
+ }
@@ -1,2 +1,2 @@
1
- "use strict";var t=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var G=(e,s)=>{for(var r in s)t(e,r,{get:s[r],enumerable:!0})},U=(e,s,r,a)=>{if(s&&typeof s=="object"||typeof s=="function")for(let o of f(s))!y.call(e,o)&&o!==r&&t(e,o,{get:()=>s[o],enumerable:!(a=C(s,o))||a.enumerable});return e};var n=e=>U(t({},"__esModule",{value:!0}),e);var c={};G(c,{addressModuleFactory:()=>w});module.exports=n(c);var m=require("inversify"),d=require("../../../use-cases/address/di/addressTypes"),i=require("../../../use-cases/address/GetAddressUseCase"),p=require("../../../use-cases/address/GetViewKeyUseCase");const w=()=>new m.ContainerModule(({bind:e})=>{e(d.addressTypes.GetAddressUseCase).to(i.GetAddressUseCase),e(d.addressTypes.GetViewKeyUseCase).to(p.GetViewKeyUseCase)});0&&(module.exports={addressModuleFactory});
1
+ "use strict";var a=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var y=(e,s)=>{for(var t in s)a(e,t,{get:s[t],enumerable:!0})},w=(e,s,t,m)=>{if(s&&typeof s=="object"||typeof s=="function")for(let o of U(s))!f.call(e,o)&&o!==t&&a(e,o,{get:()=>s[o],enumerable:!(m=G(s,o))||m.enumerable});return e};var T=e=>w(a({},"__esModule",{value:!0}),e);var k={};y(k,{addressModuleFactory:()=>c});module.exports=T(k);var d=require("inversify"),r=require("../../../use-cases/address/di/addressTypes"),p=require("../../../use-cases/address/GetAddressUseCase"),C=require("../../../use-cases/address/GetTvkUseCase"),i=require("../../../use-cases/address/GetViewKeyUseCase");const c=()=>new d.ContainerModule(({bind:e})=>{e(r.addressTypes.GetAddressUseCase).to(p.GetAddressUseCase),e(r.addressTypes.GetViewKeyUseCase).to(i.GetViewKeyUseCase),e(r.addressTypes.GetTvkUseCase).to(C.GetTvkUseCase)});0&&(module.exports={addressModuleFactory});
2
2
  //# sourceMappingURL=addressModule.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/use-cases/address/di/addressModule.ts"],
4
- "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { addressTypes } from \"@internal/use-cases/address/di/addressTypes\";\nimport { GetAddressUseCase } from \"@internal/use-cases/address/GetAddressUseCase\";\nimport { GetViewKeyUseCase } from \"@internal/use-cases/address/GetViewKeyUseCase\";\n\nexport const addressModuleFactory = () =>\n new ContainerModule(({ bind }) => {\n bind(addressTypes.GetAddressUseCase).to(GetAddressUseCase);\n bind(addressTypes.GetViewKeyUseCase).to(GetViewKeyUseCase);\n });\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAA6B,uDAC7BC,EAAkC,yDAClCC,EAAkC,yDAE3B,MAAML,EAAuB,IAClC,IAAI,kBAAgB,CAAC,CAAE,KAAAM,CAAK,IAAM,CAChCA,EAAK,eAAa,iBAAiB,EAAE,GAAG,mBAAiB,EACzDA,EAAK,eAAa,iBAAiB,EAAE,GAAG,mBAAiB,CAC3D,CAAC",
6
- "names": ["addressModule_exports", "__export", "addressModuleFactory", "__toCommonJS", "import_inversify", "import_addressTypes", "import_GetAddressUseCase", "import_GetViewKeyUseCase", "bind"]
4
+ "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { addressTypes } from \"@internal/use-cases/address/di/addressTypes\";\nimport { GetAddressUseCase } from \"@internal/use-cases/address/GetAddressUseCase\";\nimport { GetTvkUseCase } from \"@internal/use-cases/address/GetTvkUseCase\";\nimport { GetViewKeyUseCase } from \"@internal/use-cases/address/GetViewKeyUseCase\";\n\nexport const addressModuleFactory = () =>\n new ContainerModule(({ bind }) => {\n bind(addressTypes.GetAddressUseCase).to(GetAddressUseCase);\n bind(addressTypes.GetViewKeyUseCase).to(GetViewKeyUseCase);\n bind(addressTypes.GetTvkUseCase).to(GetTvkUseCase);\n });\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAA6B,uDAC7BC,EAAkC,yDAClCC,EAA8B,qDAC9BC,EAAkC,yDAE3B,MAAMN,EAAuB,IAClC,IAAI,kBAAgB,CAAC,CAAE,KAAAO,CAAK,IAAM,CAChCA,EAAK,eAAa,iBAAiB,EAAE,GAAG,mBAAiB,EACzDA,EAAK,eAAa,iBAAiB,EAAE,GAAG,mBAAiB,EACzDA,EAAK,eAAa,aAAa,EAAE,GAAG,eAAa,CACnD,CAAC",
6
+ "names": ["addressModule_exports", "__export", "addressModuleFactory", "__toCommonJS", "import_inversify", "import_addressTypes", "import_GetAddressUseCase", "import_GetTvkUseCase", "import_GetViewKeyUseCase", "bind"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var a=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var G=(s,e)=>{for(var t in e)a(s,t,{get:e[t],enumerable:!0})},U=(s,e,t,d)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of y(e))!C.call(s,o)&&o!==t&&a(s,o,{get:()=>e[o],enumerable:!(d=r(e,o))||d.enumerable});return s};var b=s=>U(a({},"__esModule",{value:!0}),s);var f={};G(f,{addressTypes:()=>c});module.exports=b(f);const c={GetAddressUseCase:Symbol.for("GetAddressUseCase"),GetViewKeyUseCase:Symbol.for("GetViewKeyUseCase")};0&&(module.exports={addressTypes});
1
+ "use strict";var a=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var G=(s,e)=>{for(var t in e)a(s,t,{get:e[t],enumerable:!0})},U=(s,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of y(e))!C.call(s,o)&&o!==t&&a(s,o,{get:()=>e[o],enumerable:!(r=d(e,o))||r.enumerable});return s};var b=s=>U(a({},"__esModule",{value:!0}),s);var l={};G(l,{addressTypes:()=>f});module.exports=b(l);const f={GetAddressUseCase:Symbol.for("GetAddressUseCase"),GetViewKeyUseCase:Symbol.for("GetViewKeyUseCase"),GetTvkUseCase:Symbol.for("GetTvkUseCase")};0&&(module.exports={addressTypes});
2
2
  //# sourceMappingURL=addressTypes.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/use-cases/address/di/addressTypes.ts"],
4
- "sourcesContent": ["export const addressTypes = {\n GetAddressUseCase: Symbol.for(\"GetAddressUseCase\"),\n GetViewKeyUseCase: Symbol.for(\"GetViewKeyUseCase\"),\n} as const;\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,IAAA,eAAAC,EAAAH,GAAO,MAAME,EAAe,CAC1B,kBAAmB,OAAO,IAAI,mBAAmB,EACjD,kBAAmB,OAAO,IAAI,mBAAmB,CACnD",
4
+ "sourcesContent": ["export const addressTypes = {\n GetAddressUseCase: Symbol.for(\"GetAddressUseCase\"),\n GetViewKeyUseCase: Symbol.for(\"GetViewKeyUseCase\"),\n GetTvkUseCase: Symbol.for(\"GetTvkUseCase\"),\n} as const;\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,IAAA,eAAAC,EAAAH,GAAO,MAAME,EAAe,CAC1B,kBAAmB,OAAO,IAAI,mBAAmB,EACjD,kBAAmB,OAAO,IAAI,mBAAmB,EACjD,cAAe,OAAO,IAAI,eAAe,CAC3C",
6
6
  "names": ["addressTypes_exports", "__export", "addressTypes", "__toCommonJS"]
7
7
  }
@@ -0,0 +1,2 @@
1
+ "use strict";var o=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var f=(r,p)=>{for(var n in p)o(r,n,{get:p[n],enumerable:!0})},u=(r,p,n,e)=>{if(p&&typeof p=="object"||typeof p=="function")for(let i of l(p))!y.call(r,i)&&i!==n&&o(r,i,{get:()=>p[i],enumerable:!(e=d(p,i))||e.enumerable});return r};var T=r=>u(o({},"__esModule",{value:!0}),r),c=(r,p,n,e)=>{for(var i=e>1?void 0:e?d(p,n):p,a=r.length-1,m;a>=0;a--)(m=r[a])&&(i=(e?m(p,n,i):m(i))||i);return e&&i&&o(p,n,i),i},s=(r,p)=>(n,e)=>p(n,e,r);var O={};f(O,{SignNestedCallUseCase:()=>t});module.exports=T(O);var A=require("inversify"),B=require("../../app-binder/di/appBinderTypes");let t=class{_appBinder;constructor(p){this._appBinder=p}execute(p,n){return this._appBinder.signNestedCall({nestedCallRequest:p,skipOpenApp:n?.skipOpenApp??!1})}};t=c([(0,A.injectable)(),s(0,(0,A.inject)(B.appBinderTypes.AppBinding))],t);0&&(module.exports={SignNestedCallUseCase});
2
+ //# sourceMappingURL=SignNestedCallUseCase.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/internal/use-cases/transaction/SignNestedCallUseCase.ts"],
4
+ "sourcesContent": ["import { inject, injectable } from \"inversify\";\n\nimport { type SignNestedCallDAReturnType } from \"@api/app-binder/SignNestedCallDeviceActionTypes\";\nimport { type TransactionOptions } from \"@api/model/TransactionOptions\";\nimport { AleoAppBinder } from \"@internal/app-binder/AleoAppBinder\";\nimport { appBinderTypes } from \"@internal/app-binder/di/appBinderTypes\";\n\n@injectable()\nexport class SignNestedCallUseCase {\n private readonly _appBinder: AleoAppBinder;\n\n constructor(@inject(appBinderTypes.AppBinding) appBinder: AleoAppBinder) {\n this._appBinder = appBinder;\n }\n\n execute(\n nestedCallRequest: Uint8Array,\n options?: TransactionOptions,\n ): SignNestedCallDAReturnType {\n return this._appBinder.signNestedCall({\n nestedCallRequest,\n skipOpenApp: options?.skipOpenApp ?? false,\n });\n }\n}\n"],
5
+ "mappings": "okBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,2BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAmC,qBAKnCC,EAA+B,kDAGxB,IAAMC,EAAN,KAA4B,CAChB,WAEjB,YAA+CC,EAA0B,CACvE,KAAK,WAAaA,CACpB,CAEA,QACEC,EACAC,EAC4B,CAC5B,OAAO,KAAK,WAAW,eAAe,CACpC,kBAAAD,EACA,YAAaC,GAAS,aAAe,EACvC,CAAC,CACH,CACF,EAhBaH,EAANI,EAAA,IADN,cAAW,EAIGC,EAAA,eAAO,iBAAe,UAAU,IAHlCL",
6
+ "names": ["SignNestedCallUseCase_exports", "__export", "SignNestedCallUseCase", "__toCommonJS", "import_inversify", "import_appBinderTypes", "SignNestedCallUseCase", "appBinder", "nestedCallRequest", "options", "__decorateClass", "__decorateParam"]
7
+ }
@@ -1,2 +1,2 @@
1
- "use strict";var r=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var g=(t,e)=>{for(var n in e)r(t,n,{get:e[n],enumerable:!0})},I=(t,e,n,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of c(e))!f.call(t,o)&&o!==n&&r(t,o,{get:()=>e[o],enumerable:!(a=C(e,o))||a.enumerable});return t};var S=t=>I(r({},"__esModule",{value:!0}),t);var F={};g(F,{transactionModuleFactory:()=>U});module.exports=S(F);var i=require("inversify"),s=require("../../../use-cases/transaction/di/transactionTypes"),m=require("../../../use-cases/transaction/SignFeeIntentUseCase"),p=require("../../../use-cases/transaction/SignRootIntentUseCase");const U=()=>new i.ContainerModule(({bind:t})=>{t(s.transactionTypes.SignRootIntentUseCase).to(p.SignRootIntentUseCase),t(s.transactionTypes.SignFeeIntentUseCase).to(m.SignFeeIntentUseCase)});0&&(module.exports={transactionModuleFactory});
1
+ "use strict";var r=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var U=(e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})},f=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of l(t))!S.call(e,o)&&o!==n&&r(e,o,{get:()=>t[o],enumerable:!(a=g(t,o))||a.enumerable});return e};var c=e=>f(r({},"__esModule",{value:!0}),e);var F={};U(F,{transactionModuleFactory:()=>I});module.exports=c(F);var i=require("inversify"),s=require("../../../use-cases/transaction/di/transactionTypes"),m=require("../../../use-cases/transaction/SignFeeIntentUseCase"),C=require("../../../use-cases/transaction/SignNestedCallUseCase"),p=require("../../../use-cases/transaction/SignRootIntentUseCase");const I=()=>new i.ContainerModule(({bind:e})=>{e(s.transactionTypes.SignRootIntentUseCase).to(p.SignRootIntentUseCase),e(s.transactionTypes.SignNestedCallUseCase).to(C.SignNestedCallUseCase),e(s.transactionTypes.SignFeeIntentUseCase).to(m.SignFeeIntentUseCase)});0&&(module.exports={transactionModuleFactory});
2
2
  //# sourceMappingURL=transactionModule.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/use-cases/transaction/di/transactionModule.ts"],
4
- "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { transactionTypes } from \"@internal/use-cases/transaction/di/transactionTypes\";\nimport { SignFeeIntentUseCase } from \"@internal/use-cases/transaction/SignFeeIntentUseCase\";\nimport { SignRootIntentUseCase } from \"@internal/use-cases/transaction/SignRootIntentUseCase\";\n\nexport const transactionModuleFactory = () =>\n new ContainerModule(({ bind }) => {\n bind(transactionTypes.SignRootIntentUseCase).to(SignRootIntentUseCase);\n bind(transactionTypes.SignFeeIntentUseCase).to(SignFeeIntentUseCase);\n });\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAAiC,+DACjCC,EAAqC,gEACrCC,EAAsC,iEAE/B,MAAML,EAA2B,IACtC,IAAI,kBAAgB,CAAC,CAAE,KAAAM,CAAK,IAAM,CAChCA,EAAK,mBAAiB,qBAAqB,EAAE,GAAG,uBAAqB,EACrEA,EAAK,mBAAiB,oBAAoB,EAAE,GAAG,sBAAoB,CACrE,CAAC",
6
- "names": ["transactionModule_exports", "__export", "transactionModuleFactory", "__toCommonJS", "import_inversify", "import_transactionTypes", "import_SignFeeIntentUseCase", "import_SignRootIntentUseCase", "bind"]
4
+ "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { transactionTypes } from \"@internal/use-cases/transaction/di/transactionTypes\";\nimport { SignFeeIntentUseCase } from \"@internal/use-cases/transaction/SignFeeIntentUseCase\";\nimport { SignNestedCallUseCase } from \"@internal/use-cases/transaction/SignNestedCallUseCase\";\nimport { SignRootIntentUseCase } from \"@internal/use-cases/transaction/SignRootIntentUseCase\";\n\nexport const transactionModuleFactory = () =>\n new ContainerModule(({ bind }) => {\n bind(transactionTypes.SignRootIntentUseCase).to(SignRootIntentUseCase);\n bind(transactionTypes.SignNestedCallUseCase).to(SignNestedCallUseCase);\n bind(transactionTypes.SignFeeIntentUseCase).to(SignFeeIntentUseCase);\n });\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAAiC,+DACjCC,EAAqC,gEACrCC,EAAsC,iEACtCC,EAAsC,iEAE/B,MAAMN,EAA2B,IACtC,IAAI,kBAAgB,CAAC,CAAE,KAAAO,CAAK,IAAM,CAChCA,EAAK,mBAAiB,qBAAqB,EAAE,GAAG,uBAAqB,EACrEA,EAAK,mBAAiB,qBAAqB,EAAE,GAAG,uBAAqB,EACrEA,EAAK,mBAAiB,oBAAoB,EAAE,GAAG,sBAAoB,CACrE,CAAC",
6
+ "names": ["transactionModule_exports", "__export", "transactionModuleFactory", "__toCommonJS", "import_inversify", "import_transactionTypes", "import_SignFeeIntentUseCase", "import_SignNestedCallUseCase", "import_SignRootIntentUseCase", "bind"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var o=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var r=(n,e)=>{for(var s in e)o(n,s,{get:e[s],enumerable:!0})},C=(n,e,s,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of i(e))!g.call(n,t)&&t!==s&&o(n,t,{get:()=>e[t],enumerable:!(a=S(e,t))||a.enumerable});return n};var I=n=>C(o({},"__esModule",{value:!0}),n);var c={};r(c,{transactionTypes:()=>U});module.exports=I(c);const U={SignRootIntentUseCase:Symbol.for("SignRootIntentUseCase"),SignFeeIntentUseCase:Symbol.for("SignFeeIntentUseCase")};0&&(module.exports={transactionTypes});
1
+ "use strict";var o=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var l=(s,e)=>{for(var t in e)o(s,t,{get:e[t],enumerable:!0})},g=(s,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of C(e))!i.call(s,n)&&n!==t&&o(s,n,{get:()=>e[n],enumerable:!(a=S(e,n))||a.enumerable});return s};var U=s=>g(o({},"__esModule",{value:!0}),s);var y={};l(y,{transactionTypes:()=>r});module.exports=U(y);const r={SignRootIntentUseCase:Symbol.for("SignRootIntentUseCase"),SignNestedCallUseCase:Symbol.for("SignNestedCallUseCase"),SignFeeIntentUseCase:Symbol.for("SignFeeIntentUseCase")};0&&(module.exports={transactionTypes});
2
2
  //# sourceMappingURL=transactionTypes.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/use-cases/transaction/di/transactionTypes.ts"],
4
- "sourcesContent": ["export const transactionTypes = {\n SignRootIntentUseCase: Symbol.for(\"SignRootIntentUseCase\"),\n SignFeeIntentUseCase: Symbol.for(\"SignFeeIntentUseCase\"),\n} as const;\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GAAO,MAAME,EAAmB,CAC9B,sBAAuB,OAAO,IAAI,uBAAuB,EACzD,qBAAsB,OAAO,IAAI,sBAAsB,CACzD",
4
+ "sourcesContent": ["export const transactionTypes = {\n SignRootIntentUseCase: Symbol.for(\"SignRootIntentUseCase\"),\n SignNestedCallUseCase: Symbol.for(\"SignNestedCallUseCase\"),\n SignFeeIntentUseCase: Symbol.for(\"SignFeeIntentUseCase\"),\n} as const;\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GAAO,MAAME,EAAmB,CAC9B,sBAAuB,OAAO,IAAI,uBAAuB,EACzD,sBAAuB,OAAO,IAAI,uBAAuB,EACzD,qBAAsB,OAAO,IAAI,sBAAsB,CACzD",
6
6
  "names": ["transactionTypes_exports", "__export", "transactionTypes", "__toCommonJS"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "dependencies": {
3
- "@ledgerhq/context-module": "workspace:^",
4
- "@ledgerhq/signer-utils": "workspace:^",
3
+ "@ledgerhq/context-module": "^2.1.0",
4
+ "@ledgerhq/signer-utils": "^1.2.0",
5
5
  "inversify": "catalog:",
6
6
  "purify-ts": "catalog:",
7
7
  "reflect-metadata": "catalog:",
@@ -36,8 +36,8 @@
36
36
  "license": "Apache-2.0",
37
37
  "name": "@ledgerhq/device-signer-kit-aleo",
38
38
  "peerDependencies": {
39
- "@ledgerhq/context-module": "workspace:^",
40
- "@ledgerhq/device-management-kit": "^1.2.0"
39
+ "@ledgerhq/context-module": "^2.1.0",
40
+ "@ledgerhq/device-management-kit": "^1.6.0"
41
41
  },
42
42
  "private": false,
43
43
  "repository": {
@@ -59,5 +59,5 @@
59
59
  "watch:builds": "pnpm ldmk-tool watch --entryPoints src/index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
60
60
  "watch:types": "concurrently \"tsc --watch -p tsconfig.prod.json\" \"tsc-alias --watch -p tsconfig.prod.json\""
61
61
  },
62
- "version": "0.2.0"
62
+ "version": "0.4.0"
63
63
  }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=GetTvkDeviceActionTypes.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=SignNestedCallDeviceActionTypes.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/api/index.ts"],
4
- "sourcesContent": ["export type {\n GetAddressDAError,\n GetAddressDAIntermediateValue,\n GetAddressDAOutput,\n} from \"@api/app-binder/GetAddressDeviceActionTypes\";\nexport type {\n GetAppConfigDAError,\n GetAppConfigDAIntermediateValue,\n GetAppConfigDAOutput,\n} from \"@api/app-binder/GetAppConfigDeviceActionTypes\";\nexport type {\n GetViewKeyDAError,\n GetViewKeyDAIntermediateValue,\n GetViewKeyDAOutput,\n} from \"@api/app-binder/GetViewKeyDeviceActionTypes\";\nexport type {\n SignFeeIntentDAError,\n SignFeeIntentDAIntermediateValue,\n SignFeeIntentDAOutput,\n} from \"@api/app-binder/SignFeeIntentDeviceActionTypes\";\nexport type {\n SignRootIntentDAError,\n SignRootIntentDAIntermediateValue,\n SignRootIntentDAOutput,\n} from \"@api/app-binder/SignRootIntentDeviceActionTypes\";\nexport * from \"@api/SignerAleo\";\nexport * from \"@api/SignerAleoBuilder\";\n// Export other types as needed\n"],
5
- "mappings": "AAyBA,WAAc,kBACd,WAAc",
4
+ "sourcesContent": ["export type {\n GetAddressDAError,\n GetAddressDAIntermediateValue,\n GetAddressDAOutput,\n} from \"@api/app-binder/GetAddressDeviceActionTypes\";\nexport type {\n GetAppConfigDAError,\n GetAppConfigDAIntermediateValue,\n GetAppConfigDAOutput,\n} from \"@api/app-binder/GetAppConfigDeviceActionTypes\";\nexport type {\n GetTvkDAError,\n GetTvkDAIntermediateValue,\n GetTvkDAOutput,\n GetTvkDAReturnType,\n} from \"@api/app-binder/GetTvkDeviceActionTypes\";\nexport type {\n GetViewKeyDAError,\n GetViewKeyDAIntermediateValue,\n GetViewKeyDAOutput,\n} from \"@api/app-binder/GetViewKeyDeviceActionTypes\";\nexport type {\n SignFeeIntentDAError,\n SignFeeIntentDAIntermediateValue,\n SignFeeIntentDAOutput,\n} from \"@api/app-binder/SignFeeIntentDeviceActionTypes\";\nexport type {\n SignNestedCallDAError,\n SignNestedCallDAIntermediateValue,\n SignNestedCallDAOutput,\n} from \"@api/app-binder/SignNestedCallDeviceActionTypes\";\nexport type {\n SignRootIntentDAError,\n SignRootIntentDAIntermediateValue,\n SignRootIntentDAOutput,\n} from \"@api/app-binder/SignRootIntentDeviceActionTypes\";\nexport type { GetTvkOptions } from \"@api/model/GetTvkOptions\";\nexport * from \"@api/SignerAleo\";\nexport * from \"@api/SignerAleoBuilder\";\n// Export other types as needed\n"],
5
+ "mappings": "AAqCA,WAAc,kBACd,WAAc",
6
6
  "names": []
7
7
  }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=GetTvkOptions.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -1,2 +1,2 @@
1
- import{makeContainer as i}from"./di";import{addressTypes as n}from"./use-cases/address/di/addressTypes";import{configTypes as s}from"./use-cases/config/di/configTypes";import{transactionTypes as r}from"./use-cases/transaction/di/transactionTypes";class A{_container;constructor({dmk:e,sessionId:t}){this._container=i({dmk:e,sessionId:t})}getAppConfig(){return this._container.get(s.GetAppConfigUseCase).execute()}getAddress(e,t){return this._container.get(n.GetAddressUseCase).execute(e,t)}getViewKey(e,t){return this._container.get(n.GetViewKeyUseCase).execute(e,t)}signRootIntent(e,t,o){return this._container.get(r.SignRootIntentUseCase).execute(e,t,o)}signFeeIntent(e,t){return this._container.get(r.SignFeeIntentUseCase).execute(e,t)}}export{A as DefaultSignerAleo};
1
+ import{makeContainer as i}from"./di";import{addressTypes as n}from"./use-cases/address/di/addressTypes";import{configTypes as o}from"./use-cases/config/di/configTypes";import{transactionTypes as r}from"./use-cases/transaction/di/transactionTypes";class A{_container;constructor({dmk:e,sessionId:t}){this._container=i({dmk:e,sessionId:t})}getAppConfig(){return this._container.get(o.GetAppConfigUseCase).execute()}getAddress(e,t){return this._container.get(n.GetAddressUseCase).execute(e,t)}getViewKey(e,t){return this._container.get(n.GetViewKeyUseCase).execute(e,t)}getTvk(e,t){return this._container.get(n.GetTvkUseCase).execute(e,t)}signRootIntent(e,t,s){return this._container.get(r.SignRootIntentUseCase).execute(e,t,s)}signNestedCall(e,t){return this._container.get(r.SignNestedCallUseCase).execute(e,t)}signFeeIntent(e,t){return this._container.get(r.SignFeeIntentUseCase).execute(e,t)}}export{A as DefaultSignerAleo};
2
2
  //# sourceMappingURL=DefaultSignerAleo.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/internal/DefaultSignerAleo.ts"],
4
- "sourcesContent": ["import {\n type DeviceManagementKit,\n type DeviceSessionId,\n} from \"@ledgerhq/device-management-kit\";\nimport { type Container } from \"inversify\";\n\nimport { type GetAddressDAReturnType } from \"@api/app-binder/GetAddressDeviceActionTypes\";\nimport { type GetAppConfigDAReturnType } from \"@api/app-binder/GetAppConfigDeviceActionTypes\";\nimport { type GetViewKeyDAReturnType } from \"@api/app-binder/GetViewKeyDeviceActionTypes\";\nimport { type SignFeeIntentDAReturnType } from \"@api/app-binder/SignFeeIntentDeviceActionTypes\";\nimport { type SignRootIntentDAReturnType } from \"@api/app-binder/SignRootIntentDeviceActionTypes\";\nimport { type AddressOptions } from \"@api/model/AddressOptions\";\nimport { type TransactionOptions } from \"@api/model/TransactionOptions\";\nimport { type SignerAleo } from \"@api/SignerAleo\";\nimport { makeContainer } from \"@internal/di\";\nimport { addressTypes } from \"@internal/use-cases/address/di/addressTypes\";\nimport { type GetAddressUseCase } from \"@internal/use-cases/address/GetAddressUseCase\";\nimport { type GetViewKeyUseCase } from \"@internal/use-cases/address/GetViewKeyUseCase\";\nimport { configTypes } from \"@internal/use-cases/config/di/configTypes\";\nimport { type GetAppConfigUseCase } from \"@internal/use-cases/config/GetAppConfigUseCase\";\nimport { transactionTypes } from \"@internal/use-cases/transaction/di/transactionTypes\";\nimport { type SignFeeIntentUseCase } from \"@internal/use-cases/transaction/SignFeeIntentUseCase\";\nimport { type SignRootIntentUseCase } from \"@internal/use-cases/transaction/SignRootIntentUseCase\";\n\ntype DefaultSignerAleoConstructorArgs = {\n dmk: DeviceManagementKit;\n sessionId: DeviceSessionId;\n};\n\nexport class DefaultSignerAleo implements SignerAleo {\n private readonly _container: Container;\n\n constructor({ dmk, sessionId }: DefaultSignerAleoConstructorArgs) {\n this._container = makeContainer({ dmk, sessionId });\n }\n\n getAppConfig(): GetAppConfigDAReturnType {\n return this._container\n .get<GetAppConfigUseCase>(configTypes.GetAppConfigUseCase)\n .execute();\n }\n\n getAddress(\n derivationPath: string,\n options?: AddressOptions,\n ): GetAddressDAReturnType {\n return this._container\n .get<GetAddressUseCase>(addressTypes.GetAddressUseCase)\n .execute(derivationPath, options);\n }\n\n getViewKey(\n derivationPath: string,\n options?: AddressOptions,\n ): GetViewKeyDAReturnType {\n return this._container\n .get<GetViewKeyUseCase>(addressTypes.GetViewKeyUseCase)\n .execute(derivationPath, options);\n }\n\n signRootIntent(\n derivationPath: string,\n rootIntent: Uint8Array,\n options?: TransactionOptions,\n ): SignRootIntentDAReturnType {\n return this._container\n .get<SignRootIntentUseCase>(transactionTypes.SignRootIntentUseCase)\n .execute(derivationPath, rootIntent, options);\n }\n\n signFeeIntent(\n feeIntent: Uint8Array,\n options?: TransactionOptions,\n ): SignFeeIntentDAReturnType {\n return this._container\n .get<SignFeeIntentUseCase>(transactionTypes.SignFeeIntentUseCase)\n .execute(feeIntent, options);\n }\n}\n"],
5
- "mappings": "AAcA,OAAS,iBAAAA,MAAqB,eAC9B,OAAS,gBAAAC,MAAoB,8CAG7B,OAAS,eAAAC,MAAmB,4CAE5B,OAAS,oBAAAC,MAAwB,sDAS1B,MAAMC,CAAwC,CAClC,WAEjB,YAAY,CAAE,IAAAC,EAAK,UAAAC,CAAU,EAAqC,CAChE,KAAK,WAAaN,EAAc,CAAE,IAAAK,EAAK,UAAAC,CAAU,CAAC,CACpD,CAEA,cAAyC,CACvC,OAAO,KAAK,WACT,IAAyBJ,EAAY,mBAAmB,EACxD,QAAQ,CACb,CAEA,WACEK,EACAC,EACwB,CACxB,OAAO,KAAK,WACT,IAAuBP,EAAa,iBAAiB,EACrD,QAAQM,EAAgBC,CAAO,CACpC,CAEA,WACED,EACAC,EACwB,CACxB,OAAO,KAAK,WACT,IAAuBP,EAAa,iBAAiB,EACrD,QAAQM,EAAgBC,CAAO,CACpC,CAEA,eACED,EACAE,EACAD,EAC4B,CAC5B,OAAO,KAAK,WACT,IAA2BL,EAAiB,qBAAqB,EACjE,QAAQI,EAAgBE,EAAYD,CAAO,CAChD,CAEA,cACEE,EACAF,EAC2B,CAC3B,OAAO,KAAK,WACT,IAA0BL,EAAiB,oBAAoB,EAC/D,QAAQO,EAAWF,CAAO,CAC/B,CACF",
6
- "names": ["makeContainer", "addressTypes", "configTypes", "transactionTypes", "DefaultSignerAleo", "dmk", "sessionId", "derivationPath", "options", "rootIntent", "feeIntent"]
4
+ "sourcesContent": ["import {\n type DeviceManagementKit,\n type DeviceSessionId,\n} from \"@ledgerhq/device-management-kit\";\nimport { type Container } from \"inversify\";\n\nimport { type GetAddressDAReturnType } from \"@api/app-binder/GetAddressDeviceActionTypes\";\nimport { type GetAppConfigDAReturnType } from \"@api/app-binder/GetAppConfigDeviceActionTypes\";\nimport { type GetTvkDAReturnType } from \"@api/app-binder/GetTvkDeviceActionTypes\";\nimport { type GetViewKeyDAReturnType } from \"@api/app-binder/GetViewKeyDeviceActionTypes\";\nimport { type SignFeeIntentDAReturnType } from \"@api/app-binder/SignFeeIntentDeviceActionTypes\";\nimport { type SignNestedCallDAReturnType } from \"@api/app-binder/SignNestedCallDeviceActionTypes\";\nimport { type SignRootIntentDAReturnType } from \"@api/app-binder/SignRootIntentDeviceActionTypes\";\nimport { type AddressOptions } from \"@api/model/AddressOptions\";\nimport { type GetTvkOptions } from \"@api/model/GetTvkOptions\";\nimport { type TransactionOptions } from \"@api/model/TransactionOptions\";\nimport { type SignerAleo } from \"@api/SignerAleo\";\nimport { makeContainer } from \"@internal/di\";\nimport { addressTypes } from \"@internal/use-cases/address/di/addressTypes\";\nimport { type GetAddressUseCase } from \"@internal/use-cases/address/GetAddressUseCase\";\nimport { type GetTvkUseCase } from \"@internal/use-cases/address/GetTvkUseCase\";\nimport { type GetViewKeyUseCase } from \"@internal/use-cases/address/GetViewKeyUseCase\";\nimport { configTypes } from \"@internal/use-cases/config/di/configTypes\";\nimport { type GetAppConfigUseCase } from \"@internal/use-cases/config/GetAppConfigUseCase\";\nimport { transactionTypes } from \"@internal/use-cases/transaction/di/transactionTypes\";\nimport { type SignFeeIntentUseCase } from \"@internal/use-cases/transaction/SignFeeIntentUseCase\";\nimport { type SignNestedCallUseCase } from \"@internal/use-cases/transaction/SignNestedCallUseCase\";\nimport { type SignRootIntentUseCase } from \"@internal/use-cases/transaction/SignRootIntentUseCase\";\n\ntype DefaultSignerAleoConstructorArgs = {\n dmk: DeviceManagementKit;\n sessionId: DeviceSessionId;\n};\n\nexport class DefaultSignerAleo implements SignerAleo {\n private readonly _container: Container;\n\n constructor({ dmk, sessionId }: DefaultSignerAleoConstructorArgs) {\n this._container = makeContainer({ dmk, sessionId });\n }\n\n getAppConfig(): GetAppConfigDAReturnType {\n return this._container\n .get<GetAppConfigUseCase>(configTypes.GetAppConfigUseCase)\n .execute();\n }\n\n getAddress(\n derivationPath: string,\n options?: AddressOptions,\n ): GetAddressDAReturnType {\n return this._container\n .get<GetAddressUseCase>(addressTypes.GetAddressUseCase)\n .execute(derivationPath, options);\n }\n\n getViewKey(\n derivationPath: string,\n options?: AddressOptions,\n ): GetViewKeyDAReturnType {\n return this._container\n .get<GetViewKeyUseCase>(addressTypes.GetViewKeyUseCase)\n .execute(derivationPath, options);\n }\n\n getTvk(derivationPath: string, options?: GetTvkOptions): GetTvkDAReturnType {\n return this._container\n .get<GetTvkUseCase>(addressTypes.GetTvkUseCase)\n .execute(derivationPath, options);\n }\n\n signRootIntent(\n derivationPath: string,\n rootIntent: Uint8Array,\n options?: TransactionOptions,\n ): SignRootIntentDAReturnType {\n return this._container\n .get<SignRootIntentUseCase>(transactionTypes.SignRootIntentUseCase)\n .execute(derivationPath, rootIntent, options);\n }\n\n signNestedCall(\n nestedCallRequest: Uint8Array,\n options?: TransactionOptions,\n ): SignNestedCallDAReturnType {\n return this._container\n .get<SignNestedCallUseCase>(transactionTypes.SignNestedCallUseCase)\n .execute(nestedCallRequest, options);\n }\n\n signFeeIntent(\n feeIntent: Uint8Array,\n options?: TransactionOptions,\n ): SignFeeIntentDAReturnType {\n return this._container\n .get<SignFeeIntentUseCase>(transactionTypes.SignFeeIntentUseCase)\n .execute(feeIntent, options);\n }\n}\n"],
5
+ "mappings": "AAiBA,OAAS,iBAAAA,MAAqB,eAC9B,OAAS,gBAAAC,MAAoB,8CAI7B,OAAS,eAAAC,MAAmB,4CAE5B,OAAS,oBAAAC,MAAwB,sDAU1B,MAAMC,CAAwC,CAClC,WAEjB,YAAY,CAAE,IAAAC,EAAK,UAAAC,CAAU,EAAqC,CAChE,KAAK,WAAaN,EAAc,CAAE,IAAAK,EAAK,UAAAC,CAAU,CAAC,CACpD,CAEA,cAAyC,CACvC,OAAO,KAAK,WACT,IAAyBJ,EAAY,mBAAmB,EACxD,QAAQ,CACb,CAEA,WACEK,EACAC,EACwB,CACxB,OAAO,KAAK,WACT,IAAuBP,EAAa,iBAAiB,EACrD,QAAQM,EAAgBC,CAAO,CACpC,CAEA,WACED,EACAC,EACwB,CACxB,OAAO,KAAK,WACT,IAAuBP,EAAa,iBAAiB,EACrD,QAAQM,EAAgBC,CAAO,CACpC,CAEA,OAAOD,EAAwBC,EAA6C,CAC1E,OAAO,KAAK,WACT,IAAmBP,EAAa,aAAa,EAC7C,QAAQM,EAAgBC,CAAO,CACpC,CAEA,eACED,EACAE,EACAD,EAC4B,CAC5B,OAAO,KAAK,WACT,IAA2BL,EAAiB,qBAAqB,EACjE,QAAQI,EAAgBE,EAAYD,CAAO,CAChD,CAEA,eACEE,EACAF,EAC4B,CAC5B,OAAO,KAAK,WACT,IAA2BL,EAAiB,qBAAqB,EACjE,QAAQO,EAAmBF,CAAO,CACvC,CAEA,cACEG,EACAH,EAC2B,CAC3B,OAAO,KAAK,WACT,IAA0BL,EAAiB,oBAAoB,EAC/D,QAAQQ,EAAWH,CAAO,CAC/B,CACF",
6
+ "names": ["makeContainer", "addressTypes", "configTypes", "transactionTypes", "DefaultSignerAleo", "dmk", "sessionId", "derivationPath", "options", "rootIntent", "nestedCallRequest", "feeIntent"]
7
7
  }
@@ -1,2 +1,2 @@
1
- var y=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var A=(o,e,n,i)=>{for(var t=i>1?void 0:i?v(e,n):e,m=o.length-1,c;m>=0;m--)(c=o[m])&&(t=(i?c(e,n,t):c(t))||t);return i&&t&&y(e,n,t),t},a=(o,e)=>(n,i)=>e(n,i,o);import{CallTaskInAppDeviceAction as I,SendCommandInAppDeviceAction as d,UserInteractionRequired as p}from"@ledgerhq/device-management-kit";import{inject as u,injectable as D}from"inversify";import{APP_NAME as r}from"../app-binder/constants";import{externalTypes as k}from"../externalTypes";import{GetAddressCommand as f}from"./command/GetAddressCommand";import{GetAppConfigCommand as h}from"./command/GetAppConfigCommand";import{GetViewKeyCommand as O}from"./command/GetViewKeyCommand";import{SignFeeIntentTask as g}from"./task/SignFeeIntentTask";import{SignRootIntentTask as T}from"./task/SignRootIntentTask";let s=class{constructor(e,n){this.dmk=e;this.sessionId=n}getAppConfig(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new d({input:{command:new h,appName:r,requiredUserInteraction:p.None,skipOpenApp:e.skipOpenApp}})})}getAddress(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new d({input:{command:new f(e),appName:r,requiredUserInteraction:e.checkOnDevice?p.VerifyAddress:p.None,skipOpenApp:e.skipOpenApp}})})}getViewKey(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new d({input:{command:new O(e),appName:r,requiredUserInteraction:p.VerifyAddress,skipOpenApp:e.skipOpenApp}})})}signRootIntent(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new I({input:{task:n=>new T(n,{derivationPath:e.derivationPath,rootIntent:e.rootIntent}).run(),appName:r,requiredUserInteraction:p.SignTransaction,skipOpenApp:e.skipOpenApp}})})}signFeeIntent(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new I({input:{task:n=>new g(n,{feeIntent:e.feeIntent}).run(),appName:r,requiredUserInteraction:p.SignTransaction,skipOpenApp:e.skipOpenApp}})})}};s=A([D(),a(0,u(k.Dmk)),a(1,u(k.SessionId))],s);export{s as AleoAppBinder};
1
+ var v=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var u=(s,e,n,o)=>{for(var i=o>1?void 0:o?y(e,n):e,d=s.length-1,m;d>=0;d--)(m=s[d])&&(i=(o?m(e,n,i):m(i))||i);return o&&i&&v(e,n,i),i},c=(s,e)=>(n,o)=>e(n,o,s);import{CallTaskInAppDeviceAction as A,SendCommandInAppDeviceAction as r,UserInteractionRequired as t}from"@ledgerhq/device-management-kit";import{inject as k,injectable as D}from"inversify";import{APP_NAME as p}from"../app-binder/constants";import{externalTypes as I}from"../externalTypes";import{GetAddressCommand as f}from"./command/GetAddressCommand";import{GetAppConfigCommand as T}from"./command/GetAppConfigCommand";import{GetTvkCommand as l}from"./command/GetTvkCommand";import{GetViewKeyCommand as O}from"./command/GetViewKeyCommand";import{SignFeeIntentTask as h}from"./task/SignFeeIntentTask";import{SignNestedCallTask as R}from"./task/SignNestedCallTask";import{SignRootIntentTask as g}from"./task/SignRootIntentTask";let a=class{constructor(e,n){this.dmk=e;this.sessionId=n}getAppConfig(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new r({input:{command:new T,appName:p,requiredUserInteraction:t.None,skipOpenApp:e.skipOpenApp}})})}getAddress(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new r({input:{command:new f(e),appName:p,requiredUserInteraction:e.checkOnDevice?t.VerifyAddress:t.None,skipOpenApp:e.skipOpenApp}})})}getTvk(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new r({input:{command:new l(e),appName:p,requiredUserInteraction:t.None,skipOpenApp:e.skipOpenApp}})})}getViewKey(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new r({input:{command:new O(e),appName:p,requiredUserInteraction:t.VerifyAddress,skipOpenApp:e.skipOpenApp}})})}signRootIntent(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new A({input:{task:n=>new g(n,{derivationPath:e.derivationPath,rootIntent:e.rootIntent}).run(),appName:p,requiredUserInteraction:t.SignTransaction,skipOpenApp:e.skipOpenApp}})})}signNestedCall(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new A({input:{task:n=>new R(n,{nestedCallRequest:e.nestedCallRequest}).run(),appName:p,requiredUserInteraction:t.None,skipOpenApp:e.skipOpenApp}})})}signFeeIntent(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new A({input:{task:n=>new h(n,{feeIntent:e.feeIntent}).run(),appName:p,requiredUserInteraction:t.SignTransaction,skipOpenApp:e.skipOpenApp}})})}};a=u([D(),c(0,k(I.Dmk)),c(1,k(I.SessionId))],a);export{a as AleoAppBinder};
2
2
  //# sourceMappingURL=AleoAppBinder.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/internal/app-binder/AleoAppBinder.ts"],
4
- "sourcesContent": ["import {\n CallTaskInAppDeviceAction,\n type DeviceManagementKit,\n type DeviceSessionId,\n SendCommandInAppDeviceAction,\n UserInteractionRequired,\n} from \"@ledgerhq/device-management-kit\";\nimport { inject, injectable } from \"inversify\";\n\nimport { type GetAddressDAReturnType } from \"@api/app-binder/GetAddressDeviceActionTypes\";\nimport { type GetAppConfigDAReturnType } from \"@api/app-binder/GetAppConfigDeviceActionTypes\";\nimport { type GetViewKeyDAReturnType } from \"@api/app-binder/GetViewKeyDeviceActionTypes\";\nimport { type SignFeeIntentDAReturnType } from \"@api/app-binder/SignFeeIntentDeviceActionTypes\";\nimport { type SignRootIntentDAReturnType } from \"@api/app-binder/SignRootIntentDeviceActionTypes\";\nimport { APP_NAME } from \"@internal/app-binder/constants\";\nimport { externalTypes } from \"@internal/externalTypes\";\n\nimport { GetAddressCommand } from \"./command/GetAddressCommand\";\nimport { GetAppConfigCommand } from \"./command/GetAppConfigCommand\";\nimport { GetViewKeyCommand } from \"./command/GetViewKeyCommand\";\nimport { SignFeeIntentTask } from \"./task/SignFeeIntentTask\";\nimport { SignRootIntentTask } from \"./task/SignRootIntentTask\";\n\n@injectable()\nexport class AleoAppBinder {\n constructor(\n @inject(externalTypes.Dmk) private dmk: DeviceManagementKit,\n @inject(externalTypes.SessionId) private sessionId: DeviceSessionId,\n ) {}\n\n getAppConfig(args: { skipOpenApp: boolean }): GetAppConfigDAReturnType {\n return this.dmk.executeDeviceAction({\n sessionId: this.sessionId,\n deviceAction: new SendCommandInAppDeviceAction({\n input: {\n command: new GetAppConfigCommand(),\n appName: APP_NAME,\n requiredUserInteraction: UserInteractionRequired.None,\n skipOpenApp: args.skipOpenApp,\n },\n }),\n });\n }\n\n getAddress(args: {\n derivationPath: string;\n checkOnDevice: boolean;\n skipOpenApp: boolean;\n }): GetAddressDAReturnType {\n return this.dmk.executeDeviceAction({\n sessionId: this.sessionId,\n deviceAction: new SendCommandInAppDeviceAction({\n input: {\n command: new GetAddressCommand(args),\n appName: APP_NAME,\n requiredUserInteraction: args.checkOnDevice\n ? UserInteractionRequired.VerifyAddress\n : UserInteractionRequired.None,\n skipOpenApp: args.skipOpenApp,\n },\n }),\n });\n }\n\n getViewKey(args: {\n derivationPath: string;\n skipOpenApp: boolean;\n }): GetViewKeyDAReturnType {\n return this.dmk.executeDeviceAction({\n sessionId: this.sessionId,\n deviceAction: new SendCommandInAppDeviceAction({\n input: {\n command: new GetViewKeyCommand(args),\n appName: APP_NAME,\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n skipOpenApp: args.skipOpenApp,\n },\n }),\n });\n }\n\n signRootIntent(args: {\n derivationPath: string;\n rootIntent: Uint8Array;\n skipOpenApp: boolean;\n }): SignRootIntentDAReturnType {\n return this.dmk.executeDeviceAction({\n sessionId: this.sessionId,\n deviceAction: new CallTaskInAppDeviceAction({\n input: {\n task: (internalApi) =>\n new SignRootIntentTask(internalApi, {\n derivationPath: args.derivationPath,\n rootIntent: args.rootIntent,\n }).run(),\n appName: APP_NAME,\n requiredUserInteraction: UserInteractionRequired.SignTransaction,\n skipOpenApp: args.skipOpenApp,\n },\n }),\n });\n }\n\n signFeeIntent(args: {\n feeIntent: Uint8Array;\n skipOpenApp: boolean;\n }): SignFeeIntentDAReturnType {\n return this.dmk.executeDeviceAction({\n sessionId: this.sessionId,\n deviceAction: new CallTaskInAppDeviceAction({\n input: {\n task: (internalApi) =>\n new SignFeeIntentTask(internalApi, {\n feeIntent: args.feeIntent,\n }).run(),\n appName: APP_NAME,\n requiredUserInteraction: UserInteractionRequired.SignTransaction,\n skipOpenApp: args.skipOpenApp,\n },\n }),\n });\n }\n}\n"],
5
- "mappings": "iOAAA,OACE,6BAAAA,EAGA,gCAAAC,EACA,2BAAAC,MACK,kCACP,OAAS,UAAAC,EAAQ,cAAAC,MAAkB,YAOnC,OAAS,YAAAC,MAAgB,iCACzB,OAAS,iBAAAC,MAAqB,0BAE9B,OAAS,qBAAAC,MAAyB,8BAClC,OAAS,uBAAAC,MAA2B,gCACpC,OAAS,qBAAAC,MAAyB,8BAClC,OAAS,qBAAAC,MAAyB,2BAClC,OAAS,sBAAAC,MAA0B,4BAG5B,IAAMC,EAAN,KAAoB,CACzB,YACqCC,EACMC,EACzC,CAFmC,SAAAD,EACM,eAAAC,CACxC,CAEH,aAAaC,EAA0D,CACrE,OAAO,KAAK,IAAI,oBAAoB,CAClC,UAAW,KAAK,UAChB,aAAc,IAAIC,EAA6B,CAC7C,MAAO,CACL,QAAS,IAAIC,EACb,QAASC,EACT,wBAAyBC,EAAwB,KACjD,YAAaJ,EAAK,WACpB,CACF,CAAC,CACH,CAAC,CACH,CAEA,WAAWA,EAIgB,CACzB,OAAO,KAAK,IAAI,oBAAoB,CAClC,UAAW,KAAK,UAChB,aAAc,IAAIC,EAA6B,CAC7C,MAAO,CACL,QAAS,IAAII,EAAkBL,CAAI,EACnC,QAASG,EACT,wBAAyBH,EAAK,cAC1BI,EAAwB,cACxBA,EAAwB,KAC5B,YAAaJ,EAAK,WACpB,CACF,CAAC,CACH,CAAC,CACH,CAEA,WAAWA,EAGgB,CACzB,OAAO,KAAK,IAAI,oBAAoB,CAClC,UAAW,KAAK,UAChB,aAAc,IAAIC,EAA6B,CAC7C,MAAO,CACL,QAAS,IAAIK,EAAkBN,CAAI,EACnC,QAASG,EACT,wBAAyBC,EAAwB,cACjD,YAAaJ,EAAK,WACpB,CACF,CAAC,CACH,CAAC,CACH,CAEA,eAAeA,EAIgB,CAC7B,OAAO,KAAK,IAAI,oBAAoB,CAClC,UAAW,KAAK,UAChB,aAAc,IAAIO,EAA0B,CAC1C,MAAO,CACL,KAAOC,GACL,IAAIC,EAAmBD,EAAa,CAClC,eAAgBR,EAAK,eACrB,WAAYA,EAAK,UACnB,CAAC,EAAE,IAAI,EACT,QAASG,EACT,wBAAyBC,EAAwB,gBACjD,YAAaJ,EAAK,WACpB,CACF,CAAC,CACH,CAAC,CACH,CAEA,cAAcA,EAGgB,CAC5B,OAAO,KAAK,IAAI,oBAAoB,CAClC,UAAW,KAAK,UAChB,aAAc,IAAIO,EAA0B,CAC1C,MAAO,CACL,KAAOC,GACL,IAAIE,EAAkBF,EAAa,CACjC,UAAWR,EAAK,SAClB,CAAC,EAAE,IAAI,EACT,QAASG,EACT,wBAAyBC,EAAwB,gBACjD,YAAaJ,EAAK,WACpB,CACF,CAAC,CACH,CAAC,CACH,CACF,EAlGaH,EAANc,EAAA,CADNC,EAAW,EAGPC,EAAA,EAAAC,EAAOC,EAAc,GAAG,GACxBF,EAAA,EAAAC,EAAOC,EAAc,SAAS,IAHtBlB",
6
- "names": ["CallTaskInAppDeviceAction", "SendCommandInAppDeviceAction", "UserInteractionRequired", "inject", "injectable", "APP_NAME", "externalTypes", "GetAddressCommand", "GetAppConfigCommand", "GetViewKeyCommand", "SignFeeIntentTask", "SignRootIntentTask", "AleoAppBinder", "dmk", "sessionId", "args", "SendCommandInAppDeviceAction", "GetAppConfigCommand", "APP_NAME", "UserInteractionRequired", "GetAddressCommand", "GetViewKeyCommand", "CallTaskInAppDeviceAction", "internalApi", "SignRootIntentTask", "SignFeeIntentTask", "__decorateClass", "injectable", "__decorateParam", "inject", "externalTypes"]
4
+ "sourcesContent": ["import {\n CallTaskInAppDeviceAction,\n type DeviceManagementKit,\n type DeviceSessionId,\n SendCommandInAppDeviceAction,\n UserInteractionRequired,\n} from \"@ledgerhq/device-management-kit\";\nimport { inject, injectable } from \"inversify\";\n\nimport { type GetAddressDAReturnType } from \"@api/app-binder/GetAddressDeviceActionTypes\";\nimport { type GetAppConfigDAReturnType } from \"@api/app-binder/GetAppConfigDeviceActionTypes\";\nimport { type GetTvkDAReturnType } from \"@api/app-binder/GetTvkDeviceActionTypes\";\nimport { type GetViewKeyDAReturnType } from \"@api/app-binder/GetViewKeyDeviceActionTypes\";\nimport { type SignFeeIntentDAReturnType } from \"@api/app-binder/SignFeeIntentDeviceActionTypes\";\nimport { type SignNestedCallDAReturnType } from \"@api/app-binder/SignNestedCallDeviceActionTypes\";\nimport { type SignRootIntentDAReturnType } from \"@api/app-binder/SignRootIntentDeviceActionTypes\";\nimport { APP_NAME } from \"@internal/app-binder/constants\";\nimport { externalTypes } from \"@internal/externalTypes\";\n\nimport { GetAddressCommand } from \"./command/GetAddressCommand\";\nimport { GetAppConfigCommand } from \"./command/GetAppConfigCommand\";\nimport { GetTvkCommand } from \"./command/GetTvkCommand\";\nimport { GetViewKeyCommand } from \"./command/GetViewKeyCommand\";\nimport { SignFeeIntentTask } from \"./task/SignFeeIntentTask\";\nimport { SignNestedCallTask } from \"./task/SignNestedCallTask\";\nimport { SignRootIntentTask } from \"./task/SignRootIntentTask\";\n\n@injectable()\nexport class AleoAppBinder {\n constructor(\n @inject(externalTypes.Dmk) private dmk: DeviceManagementKit,\n @inject(externalTypes.SessionId) private sessionId: DeviceSessionId,\n ) {}\n\n getAppConfig(args: { skipOpenApp: boolean }): GetAppConfigDAReturnType {\n return this.dmk.executeDeviceAction({\n sessionId: this.sessionId,\n deviceAction: new SendCommandInAppDeviceAction({\n input: {\n command: new GetAppConfigCommand(),\n appName: APP_NAME,\n requiredUserInteraction: UserInteractionRequired.None,\n skipOpenApp: args.skipOpenApp,\n },\n }),\n });\n }\n\n getAddress(args: {\n derivationPath: string;\n checkOnDevice: boolean;\n skipOpenApp: boolean;\n }): GetAddressDAReturnType {\n return this.dmk.executeDeviceAction({\n sessionId: this.sessionId,\n deviceAction: new SendCommandInAppDeviceAction({\n input: {\n command: new GetAddressCommand(args),\n appName: APP_NAME,\n requiredUserInteraction: args.checkOnDevice\n ? UserInteractionRequired.VerifyAddress\n : UserInteractionRequired.None,\n skipOpenApp: args.skipOpenApp,\n },\n }),\n });\n }\n\n getTvk(args: {\n derivationPath: string;\n transitionIndex?: number;\n skipOpenApp: boolean;\n }): GetTvkDAReturnType {\n return this.dmk.executeDeviceAction({\n sessionId: this.sessionId,\n deviceAction: new SendCommandInAppDeviceAction({\n input: {\n command: new GetTvkCommand(args),\n appName: APP_NAME,\n requiredUserInteraction: UserInteractionRequired.None,\n skipOpenApp: args.skipOpenApp,\n },\n }),\n });\n }\n\n getViewKey(args: {\n derivationPath: string;\n skipOpenApp: boolean;\n }): GetViewKeyDAReturnType {\n return this.dmk.executeDeviceAction({\n sessionId: this.sessionId,\n deviceAction: new SendCommandInAppDeviceAction({\n input: {\n command: new GetViewKeyCommand(args),\n appName: APP_NAME,\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n skipOpenApp: args.skipOpenApp,\n },\n }),\n });\n }\n\n signRootIntent(args: {\n derivationPath: string;\n rootIntent: Uint8Array;\n skipOpenApp: boolean;\n }): SignRootIntentDAReturnType {\n return this.dmk.executeDeviceAction({\n sessionId: this.sessionId,\n deviceAction: new CallTaskInAppDeviceAction({\n input: {\n task: (internalApi) =>\n new SignRootIntentTask(internalApi, {\n derivationPath: args.derivationPath,\n rootIntent: args.rootIntent,\n }).run(),\n appName: APP_NAME,\n requiredUserInteraction: UserInteractionRequired.SignTransaction,\n skipOpenApp: args.skipOpenApp,\n },\n }),\n });\n }\n\n signNestedCall(args: {\n nestedCallRequest: Uint8Array;\n skipOpenApp: boolean;\n }): SignNestedCallDAReturnType {\n return this.dmk.executeDeviceAction({\n sessionId: this.sessionId,\n deviceAction: new CallTaskInAppDeviceAction({\n input: {\n task: (internalApi) =>\n new SignNestedCallTask(internalApi, {\n nestedCallRequest: args.nestedCallRequest,\n }).run(),\n appName: APP_NAME,\n requiredUserInteraction: UserInteractionRequired.None,\n skipOpenApp: args.skipOpenApp,\n },\n }),\n });\n }\n\n signFeeIntent(args: {\n feeIntent: Uint8Array;\n skipOpenApp: boolean;\n }): SignFeeIntentDAReturnType {\n return this.dmk.executeDeviceAction({\n sessionId: this.sessionId,\n deviceAction: new CallTaskInAppDeviceAction({\n input: {\n task: (internalApi) =>\n new SignFeeIntentTask(internalApi, {\n feeIntent: args.feeIntent,\n }).run(),\n appName: APP_NAME,\n requiredUserInteraction: UserInteractionRequired.SignTransaction,\n skipOpenApp: args.skipOpenApp,\n },\n }),\n });\n }\n}\n"],
5
+ "mappings": "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",
6
+ "names": ["CallTaskInAppDeviceAction", "SendCommandInAppDeviceAction", "UserInteractionRequired", "inject", "injectable", "APP_NAME", "externalTypes", "GetAddressCommand", "GetAppConfigCommand", "GetTvkCommand", "GetViewKeyCommand", "SignFeeIntentTask", "SignNestedCallTask", "SignRootIntentTask", "AleoAppBinder", "dmk", "sessionId", "args", "SendCommandInAppDeviceAction", "GetAppConfigCommand", "APP_NAME", "UserInteractionRequired", "GetAddressCommand", "GetTvkCommand", "GetViewKeyCommand", "CallTaskInAppDeviceAction", "internalApi", "SignRootIntentTask", "SignNestedCallTask", "SignFeeIntentTask", "__decorateClass", "injectable", "__decorateParam", "inject", "externalTypes"]
7
7
  }
@@ -0,0 +1,2 @@
1
+ import{ApduBuilder as m,ApduParser as p,CommandResultFactory as o,InvalidResponseFormatError as a}from"@ledgerhq/device-management-kit";import{CommandErrorHelper as l,DerivationPathUtils as u}from"@ledgerhq/signer-utils";import{Maybe as A}from"purify-ts";import{ALEO_CLA as T,INS as g,P1 as i,P2_DEFAULT as v}from"../../app-binder/command/utils/apduHeaderUtils";import{ALEO_APP_ERRORS as C,AleoAppCommandErrorFactory as f}from"./utils/aleoApplicationErrors";class I{name="getTvk";errorHelper=new l(C,f);args;constructor(e){this.args=e}assertValidTransitionIndex(e){if(!Number.isInteger(e)||e<1||e>31)throw new a(`transitionIndex must be an integer in [1, 31], got ${e}`)}getApdu(){const{transitionIndex:e}=this.args,t=e!==void 0;e!==void 0&&this.assertValidTransitionIndex(e);const n={cla:T,ins:g.GET_TVK,p1:t?i.GET_TVK_INDEXED:i.GET_TVK_ROOT,p2:v},r=new m(n),s=u.splitPath(this.args.derivationPath);return r.add8BitUIntToData(s.length),s.forEach(d=>{r.add32BitUIntToData(d)}),e!==void 0&&r.add8BitUIntToData(e),r.build()}parseResponse(e){return A.fromNullable(this.errorHelper.getError(e)).orDefaultLazy(()=>{const t=new p(e),n=t.extract8BitUInt();if(n===void 0)return o({error:new a("Aleo TVK length is missing")});if(t.testMinimalLength(n)===!1)return o({error:new a("TVK is missing")});const r=t.extractFieldByLength(n);return r===void 0?o({error:new a("Unable to extract TVK")}):o({data:{tvk:r}})})}}export{I as GetTvkCommand};
2
+ //# sourceMappingURL=GetTvkCommand.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/internal/app-binder/command/GetTvkCommand.ts"],
4
+ "sourcesContent": ["import {\n type Apdu,\n ApduBuilder,\n type ApduBuilderArgs,\n ApduParser,\n type ApduResponse,\n type Command,\n type CommandResult,\n CommandResultFactory,\n InvalidResponseFormatError,\n} from \"@ledgerhq/device-management-kit\";\nimport {\n CommandErrorHelper,\n DerivationPathUtils,\n} from \"@ledgerhq/signer-utils\";\nimport { Maybe } from \"purify-ts\";\n\nimport {\n ALEO_CLA,\n INS,\n P1,\n P2_DEFAULT,\n} from \"@internal/app-binder/command/utils/apduHeaderUtils\";\n\nimport {\n ALEO_APP_ERRORS,\n AleoAppCommandErrorFactory,\n type AleoErrorCodes,\n} from \"./utils/aleoApplicationErrors\";\n\nexport type GetTvkCommandArgs = {\n readonly derivationPath: string;\n readonly transitionIndex?: number;\n};\n\nexport type GetTvkCommandResponse = {\n readonly tvk: Uint8Array;\n};\n\nexport class GetTvkCommand\n implements Command<GetTvkCommandResponse, GetTvkCommandArgs, AleoErrorCodes>\n{\n readonly name = \"getTvk\";\n private readonly errorHelper = new CommandErrorHelper<\n GetTvkCommandResponse,\n AleoErrorCodes\n >(ALEO_APP_ERRORS, AleoAppCommandErrorFactory);\n\n private readonly args: GetTvkCommandArgs;\n\n constructor(args: GetTvkCommandArgs) {\n this.args = args;\n }\n\n private assertValidTransitionIndex(index: number): void {\n if (!Number.isInteger(index) || index < 1 || index > 31) {\n throw new InvalidResponseFormatError(\n `transitionIndex must be an integer in [1, 31], got ${index}`,\n );\n }\n }\n\n getApdu(): Apdu {\n const { transitionIndex } = this.args;\n const isIndexed = transitionIndex !== undefined;\n\n if (transitionIndex !== undefined) {\n this.assertValidTransitionIndex(transitionIndex);\n }\n\n const getTvkArgs: ApduBuilderArgs = {\n cla: ALEO_CLA,\n ins: INS.GET_TVK,\n p1: isIndexed ? P1.GET_TVK_INDEXED : P1.GET_TVK_ROOT,\n p2: P2_DEFAULT,\n };\n\n const builder = new ApduBuilder(getTvkArgs);\n const path = DerivationPathUtils.splitPath(this.args.derivationPath);\n\n builder.add8BitUIntToData(path.length);\n path.forEach((element) => {\n builder.add32BitUIntToData(element);\n });\n\n if (transitionIndex !== undefined) {\n builder.add8BitUIntToData(transitionIndex);\n }\n\n return builder.build();\n }\n\n parseResponse(\n response: ApduResponse,\n ): CommandResult<GetTvkCommandResponse, AleoErrorCodes> {\n return Maybe.fromNullable(\n this.errorHelper.getError(response),\n ).orDefaultLazy(() => {\n const parser = new ApduParser(response);\n\n const tvkLength = parser.extract8BitUInt();\n if (tvkLength === undefined) {\n return CommandResultFactory({\n error: new InvalidResponseFormatError(\"Aleo TVK length is missing\"),\n });\n }\n\n if (parser.testMinimalLength(tvkLength) === false) {\n return CommandResultFactory({\n error: new InvalidResponseFormatError(\"TVK is missing\"),\n });\n }\n\n const tvk = parser.extractFieldByLength(tvkLength);\n if (tvk === undefined) {\n return CommandResultFactory({\n error: new InvalidResponseFormatError(\"Unable to extract TVK\"),\n });\n }\n\n return CommandResultFactory({\n data: { tvk },\n });\n });\n }\n}\n"],
5
+ "mappings": "AAAA,OAEE,eAAAA,EAEA,cAAAC,EAIA,wBAAAC,EACA,8BAAAC,MACK,kCACP,OACE,sBAAAC,EACA,uBAAAC,MACK,yBACP,OAAS,SAAAC,MAAa,YAEtB,OACE,YAAAC,EACA,OAAAC,EACA,MAAAC,EACA,cAAAC,MACK,qDAEP,OACE,mBAAAC,EACA,8BAAAC,MAEK,gCAWA,MAAMC,CAEb,CACW,KAAO,SACC,YAAc,IAAIT,EAGjCO,EAAiBC,CAA0B,EAE5B,KAEjB,YAAYE,EAAyB,CACnC,KAAK,KAAOA,CACd,CAEQ,2BAA2BC,EAAqB,CACtD,GAAI,CAAC,OAAO,UAAUA,CAAK,GAAKA,EAAQ,GAAKA,EAAQ,GACnD,MAAM,IAAIZ,EACR,sDAAsDY,CAAK,EAC7D,CAEJ,CAEA,SAAgB,CACd,KAAM,CAAE,gBAAAC,CAAgB,EAAI,KAAK,KAC3BC,EAAYD,IAAoB,OAElCA,IAAoB,QACtB,KAAK,2BAA2BA,CAAe,EAGjD,MAAME,EAA8B,CAClC,IAAKX,EACL,IAAKC,EAAI,QACT,GAAIS,EAAYR,EAAG,gBAAkBA,EAAG,aACxC,GAAIC,CACN,EAEMS,EAAU,IAAInB,EAAYkB,CAAU,EACpCE,EAAOf,EAAoB,UAAU,KAAK,KAAK,cAAc,EAEnE,OAAAc,EAAQ,kBAAkBC,EAAK,MAAM,EACrCA,EAAK,QAASC,GAAY,CACxBF,EAAQ,mBAAmBE,CAAO,CACpC,CAAC,EAEGL,IAAoB,QACtBG,EAAQ,kBAAkBH,CAAe,EAGpCG,EAAQ,MAAM,CACvB,CAEA,cACEG,EACsD,CACtD,OAAOhB,EAAM,aACX,KAAK,YAAY,SAASgB,CAAQ,CACpC,EAAE,cAAc,IAAM,CACpB,MAAMC,EAAS,IAAItB,EAAWqB,CAAQ,EAEhCE,EAAYD,EAAO,gBAAgB,EACzC,GAAIC,IAAc,OAChB,OAAOtB,EAAqB,CAC1B,MAAO,IAAIC,EAA2B,4BAA4B,CACpE,CAAC,EAGH,GAAIoB,EAAO,kBAAkBC,CAAS,IAAM,GAC1C,OAAOtB,EAAqB,CAC1B,MAAO,IAAIC,EAA2B,gBAAgB,CACxD,CAAC,EAGH,MAAMsB,EAAMF,EAAO,qBAAqBC,CAAS,EACjD,OAAIC,IAAQ,OACHvB,EAAqB,CAC1B,MAAO,IAAIC,EAA2B,uBAAuB,CAC/D,CAAC,EAGID,EAAqB,CAC1B,KAAM,CAAE,IAAAuB,CAAI,CACd,CAAC,CACH,CAAC,CACH,CACF",
6
+ "names": ["ApduBuilder", "ApduParser", "CommandResultFactory", "InvalidResponseFormatError", "CommandErrorHelper", "DerivationPathUtils", "Maybe", "ALEO_CLA", "INS", "P1", "P2_DEFAULT", "ALEO_APP_ERRORS", "AleoAppCommandErrorFactory", "GetTvkCommand", "args", "index", "transitionIndex", "isIndexed", "getTvkArgs", "builder", "path", "element", "response", "parser", "tvkLength", "tvk"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{ApduResponse as s,CommandResultFactory as p,InvalidResponseFormatError as i,isSuccessCommandResult as c}from"@ledgerhq/device-management-kit";import{GetTvkCommand as o}from"./GetTvkCommand";const d=Uint8Array.from({length:32},()=>171),u=Uint8Array.from(Buffer.from("e00800000d038000002c800002ab00000000","hex")),x=Uint8Array.from(Buffer.from("e00801000e038000002c800002ab0000000005","hex")),f=Uint8Array.from(Buffer.concat([Buffer.from([32]),Buffer.from(d)])),l=new s({statusCode:Uint8Array.from([144,0]),data:f});describe("GetTvkCommand",()=>{const n="44'/683'/0";describe("name",()=>{it("should be 'getTvk'",()=>{const e=new o({derivationPath:n});expect(e.name).toBe("getTvk")})}),describe("getApdu",()=>{it("should return root TVK APDU (P1=0x00) when no transitionIndex",()=>{const e=new o({derivationPath:n});expect(e.getApdu().getRawApdu()).toStrictEqual(u)}),it("should return indexed TVK APDU (P1=0x01) when transitionIndex provided",()=>{const e=new o({derivationPath:n,transitionIndex:5});expect(e.getApdu().getRawApdu()).toStrictEqual(x)}),describe("should throw when transitionIndex is invalid",()=>{it.each([["zero",0],["negative",-1],["above max (32)",32],["above max (255)",255],["float",1.5],["NaN",NaN]])("%s",(e,r)=>{const t=new o({derivationPath:n,transitionIndex:r});let a;try{t.getApdu()}catch(m){a=m}expect(a).toBeInstanceOf(i),expect(a.originalError.message).toMatch(/transitionIndex must be an integer in \[1, 31\]/)})})}),describe("parseResponse",()=>{it("should parse the response and return a Uint8Array tvk",()=>{const r=new o({derivationPath:n}).parseResponse(l);expect(r).toStrictEqual(p({data:{tvk:d}}))}),describe("should return an error",()=>{it("when the response status is not successful",()=>{const e=new o({derivationPath:n}),r=new s({statusCode:Uint8Array.from([109,0]),data:new Uint8Array(0)});expect(c(e.parseResponse(r))).toBe(!1)}),it("when TVK length byte is missing",()=>{const e=new o({derivationPath:n}),r=new s({statusCode:Uint8Array.from([144,0]),data:new Uint8Array(0)}),t=e.parseResponse(r);if(c(t))throw new Error("Expected an error");expect(t.error).toBeInstanceOf(i),expect(t.error.originalError).toEqual(new Error("Aleo TVK length is missing"))}),it("when TVK data is missing (response too short)",()=>{const e=new o({derivationPath:n}),r=new s({statusCode:Uint8Array.from([144,0]),data:Uint8Array.from([32])}),t=e.parseResponse(r);if(c(t))throw new Error("Expected an error");expect(t.error).toBeInstanceOf(i),expect(t.error.originalError).toEqual(new Error("TVK is missing"))})})})});
2
+ //# sourceMappingURL=GetTvkCommand.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/internal/app-binder/command/GetTvkCommand.test.ts"],
4
+ "sourcesContent": ["import {\n ApduResponse,\n CommandResultFactory,\n InvalidResponseFormatError,\n isSuccessCommandResult,\n} from \"@ledgerhq/device-management-kit\";\n\nimport { GetTvkCommand } from \"./GetTvkCommand\";\n\nconst TVK_BYTES = Uint8Array.from({ length: 32 }, () => 0xab);\n\n// e0 08 00 00 0d 03 8000002c 800002ab 00000000\nconst GET_TVK_ROOT_APDU = Uint8Array.from(\n Buffer.from(\"e00800000d038000002c800002ab00000000\", \"hex\"),\n);\n\n// e0 08 01 00 0e 03 8000002c 800002ab 00000000 05\nconst GET_TVK_INDEXED_APDU = Uint8Array.from(\n Buffer.from(\"e00801000e038000002c800002ab0000000005\", \"hex\"),\n);\n\nconst RESPONSE_DATA = Uint8Array.from(\n Buffer.concat([Buffer.from([0x20]), Buffer.from(TVK_BYTES)]),\n);\n\nconst RESPONSE_GOOD = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: RESPONSE_DATA,\n});\n\ndescribe(\"GetTvkCommand\", () => {\n const derivationPath = \"44'/683'/0\";\n\n describe(\"name\", () => {\n it(\"should be 'getTvk'\", () => {\n const command = new GetTvkCommand({ derivationPath });\n expect(command.name).toBe(\"getTvk\");\n });\n });\n\n describe(\"getApdu\", () => {\n it(\"should return root TVK APDU (P1=0x00) when no transitionIndex\", () => {\n const command = new GetTvkCommand({ derivationPath });\n expect(command.getApdu().getRawApdu()).toStrictEqual(GET_TVK_ROOT_APDU);\n });\n\n it(\"should return indexed TVK APDU (P1=0x01) when transitionIndex provided\", () => {\n const command = new GetTvkCommand({\n derivationPath,\n transitionIndex: 5,\n });\n expect(command.getApdu().getRawApdu()).toStrictEqual(\n GET_TVK_INDEXED_APDU,\n );\n });\n\n describe(\"should throw when transitionIndex is invalid\", () => {\n it.each([\n [\"zero\", 0],\n [\"negative\", -1],\n [\"above max (32)\", 32],\n [\"above max (255)\", 255],\n [\"float\", 1.5],\n [\"NaN\", NaN],\n ])(\"%s\", (_label, index) => {\n const command = new GetTvkCommand({\n derivationPath,\n transitionIndex: index,\n });\n let error: unknown;\n try {\n command.getApdu();\n } catch (e) {\n error = e;\n }\n expect(error).toBeInstanceOf(InvalidResponseFormatError);\n expect(\n (error as InvalidResponseFormatError).originalError.message,\n ).toMatch(/transitionIndex must be an integer in \\[1, 31\\]/);\n });\n });\n });\n\n describe(\"parseResponse\", () => {\n it(\"should parse the response and return a Uint8Array tvk\", () => {\n const command = new GetTvkCommand({ derivationPath });\n const result = command.parseResponse(RESPONSE_GOOD);\n expect(result).toStrictEqual(\n CommandResultFactory({ data: { tvk: TVK_BYTES } }),\n );\n });\n\n describe(\"should return an error\", () => {\n it(\"when the response status is not successful\", () => {\n const command = new GetTvkCommand({ derivationPath });\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x6d, 0x00]),\n data: new Uint8Array(0),\n });\n expect(isSuccessCommandResult(command.parseResponse(response))).toBe(\n false,\n );\n });\n\n it(\"when TVK length byte is missing\", () => {\n const command = new GetTvkCommand({ derivationPath });\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: new Uint8Array(0),\n });\n const result = command.parseResponse(response);\n if (isSuccessCommandResult(result)) {\n throw new Error(\"Expected an error\");\n }\n expect(result.error).toBeInstanceOf(InvalidResponseFormatError);\n expect(result.error.originalError).toEqual(\n new Error(\"Aleo TVK length is missing\"),\n );\n });\n\n it(\"when TVK data is missing (response too short)\", () => {\n const command = new GetTvkCommand({ derivationPath });\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: Uint8Array.from([0x20]), // length byte only, no TVK data\n });\n const result = command.parseResponse(response);\n if (isSuccessCommandResult(result)) {\n throw new Error(\"Expected an error\");\n }\n expect(result.error).toBeInstanceOf(InvalidResponseFormatError);\n expect(result.error.originalError).toEqual(new Error(\"TVK is missing\"));\n });\n });\n });\n});\n"],
5
+ "mappings": "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",
6
+ "names": ["ApduResponse", "CommandResultFactory", "InvalidResponseFormatError", "isSuccessCommandResult", "GetTvkCommand", "TVK_BYTES", "GET_TVK_ROOT_APDU", "GET_TVK_INDEXED_APDU", "RESPONSE_DATA", "RESPONSE_GOOD", "derivationPath", "command", "_label", "index", "error", "e", "result", "response"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{ApduBuilder as s,ApduParser as d,CommandResultFactory as t}from"@ledgerhq/device-management-kit";import{CommandErrorHelper as l}from"@ledgerhq/signer-utils";import{Maybe as m}from"purify-ts";import{ALEO_CLA as p,INS as i,P1 as C,P2 as n}from"../../app-binder/command/utils/apduHeaderUtils";import{ALEO_APP_ERRORS as g,AleoAppCommandErrorFactory as u}from"./utils/aleoApplicationErrors";class c{constructor(r){this.args=r}name="signNestedCall";errorHelper=new l(g,u);getApdu(){const r={cla:p,ins:i.SIGN_INTENT,p1:C.SIGN_MODE_NESTED_CALL,p2:this.args.isFirst?n.FIRST_CHUNK:n.NEXT_CHUNK},e=new s(r);return e.addBufferToData(this.args.chunkedData),e.build()}parseResponse(r){return m.fromNullable(this.errorHelper.getError(r)).orDefaultLazy(()=>{const e=new d(r),a=e.getUnparsedRemainingLength(),o=e.extractFieldByLength(a);return o&&o.length>0?t({data:{tlvSignature:e.encodeToHexaString(o)}}):t({data:{tlvSignature:""}})})}}export{c as SignNestedCallCommand};
2
+ //# sourceMappingURL=SignNestedCallCommand.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/internal/app-binder/command/SignNestedCallCommand.ts"],
4
+ "sourcesContent": ["import {\n type Apdu,\n ApduBuilder,\n type ApduBuilderArgs,\n ApduParser,\n type ApduResponse,\n type Command,\n type CommandResult,\n CommandResultFactory,\n} from \"@ledgerhq/device-management-kit\";\nimport { CommandErrorHelper } from \"@ledgerhq/signer-utils\";\nimport { Maybe } from \"purify-ts\";\n\nimport {\n ALEO_CLA,\n INS,\n P1,\n P2,\n} from \"@internal/app-binder/command/utils/apduHeaderUtils\";\nimport { type AleoChunkableCommandArgs } from \"@internal/app-binder/task/AleoChunkableCommandArgs\";\n\nimport {\n ALEO_APP_ERRORS,\n AleoAppCommandErrorFactory,\n type AleoErrorCodes,\n} from \"./utils/aleoApplicationErrors\";\n\nexport type SignNestedCallCommandArgs = AleoChunkableCommandArgs;\n\nexport type SignNestedCallCommandResponse = {\n readonly tlvSignature: string;\n};\n\n/**\n * Command to sign a nested call in an Aleo transaction.\n * This command can be called multiple times after the root intent is signed.\n * The device uses tvk from the intent's signature response as 'root_tvk'.\n * On success, the device responds with TLV-encoded request signature data and a 0x9000 status code.\n */\nexport class SignNestedCallCommand\n implements\n Command<\n SignNestedCallCommandResponse,\n SignNestedCallCommandArgs,\n AleoErrorCodes\n >\n{\n readonly name = \"signNestedCall\";\n private readonly errorHelper = new CommandErrorHelper<\n SignNestedCallCommandResponse,\n AleoErrorCodes\n >(ALEO_APP_ERRORS, AleoAppCommandErrorFactory);\n\n constructor(private readonly args: SignNestedCallCommandArgs) {}\n\n getApdu(): Apdu {\n const signNestedCallArgs: ApduBuilderArgs = {\n cla: ALEO_CLA,\n ins: INS.SIGN_INTENT,\n p1: P1.SIGN_MODE_NESTED_CALL,\n p2: this.args.isFirst ? P2.FIRST_CHUNK : P2.NEXT_CHUNK,\n };\n\n const builder = new ApduBuilder(signNestedCallArgs);\n\n builder.addBufferToData(this.args.chunkedData);\n\n return builder.build();\n }\n\n parseResponse(\n response: ApduResponse,\n ): CommandResult<SignNestedCallCommandResponse, AleoErrorCodes> {\n return Maybe.fromNullable(\n this.errorHelper.getError(response),\n ).orDefaultLazy(() => {\n const parser = new ApduParser(response);\n\n const remainingLength = parser.getUnparsedRemainingLength();\n\n const data = parser.extractFieldByLength(remainingLength);\n\n if (data && data.length > 0) {\n return CommandResultFactory({\n data: {\n tlvSignature: parser.encodeToHexaString(data),\n },\n });\n }\n\n // for intermediate chunks, the device returns 0 bytes of data with 0x9000.\n return CommandResultFactory({\n data: {\n tlvSignature: \"\",\n },\n });\n });\n }\n}\n"],
5
+ "mappings": "AAAA,OAEE,eAAAA,EAEA,cAAAC,EAIA,wBAAAC,MACK,kCACP,OAAS,sBAAAC,MAA0B,yBACnC,OAAS,SAAAC,MAAa,YAEtB,OACE,YAAAC,EACA,OAAAC,EACA,MAAAC,EACA,MAAAC,MACK,qDAGP,OACE,mBAAAC,EACA,8BAAAC,MAEK,gCAcA,MAAMC,CAOb,CAOE,YAA6BC,EAAiC,CAAjC,UAAAA,CAAkC,CANtD,KAAO,iBACC,YAAc,IAAIT,EAGjCM,EAAiBC,CAA0B,EAI7C,SAAgB,CACd,MAAMG,EAAsC,CAC1C,IAAKR,EACL,IAAKC,EAAI,YACT,GAAIC,EAAG,sBACP,GAAI,KAAK,KAAK,QAAUC,EAAG,YAAcA,EAAG,UAC9C,EAEMM,EAAU,IAAId,EAAYa,CAAkB,EAElD,OAAAC,EAAQ,gBAAgB,KAAK,KAAK,WAAW,EAEtCA,EAAQ,MAAM,CACvB,CAEA,cACEC,EAC8D,CAC9D,OAAOX,EAAM,aACX,KAAK,YAAY,SAASW,CAAQ,CACpC,EAAE,cAAc,IAAM,CACpB,MAAMC,EAAS,IAAIf,EAAWc,CAAQ,EAEhCE,EAAkBD,EAAO,2BAA2B,EAEpDE,EAAOF,EAAO,qBAAqBC,CAAe,EAExD,OAAIC,GAAQA,EAAK,OAAS,EACjBhB,EAAqB,CAC1B,KAAM,CACJ,aAAcc,EAAO,mBAAmBE,CAAI,CAC9C,CACF,CAAC,EAIIhB,EAAqB,CAC1B,KAAM,CACJ,aAAc,EAChB,CACF,CAAC,CACH,CAAC,CACH,CACF",
6
+ "names": ["ApduBuilder", "ApduParser", "CommandResultFactory", "CommandErrorHelper", "Maybe", "ALEO_CLA", "INS", "P1", "P2", "ALEO_APP_ERRORS", "AleoAppCommandErrorFactory", "SignNestedCallCommand", "args", "signNestedCallArgs", "builder", "response", "parser", "remainingLength", "data"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{CommandResultFactory as i,isSuccessCommandResult as a}from"@ledgerhq/device-management-kit";import{ALEO_CLA as r,INS as c,P1 as d,P2 as p}from"../../app-binder/command/utils/apduHeaderUtils";import{SignNestedCallCommand as o}from"./SignNestedCallCommand";describe("SignNestedCallCommand",()=>{const s=new Uint8Array([5,6,7,8]),u=new Uint8Array(255).fill(36);describe("name",()=>{it("should be 'signNestedCall'",()=>{const t=new o({chunkedData:s,isFirst:!0});expect(t.name).toBe("signNestedCall")})}),describe("getApdu",()=>{it("should create correct APDU for the first chunk",()=>{const e=new o({chunkedData:s,isFirst:!0}).getApdu();expect(e.cla).toBe(r),expect(e.ins).toBe(c.SIGN_INTENT),expect(e.p1).toBe(d.SIGN_MODE_NESTED_CALL),expect(e.p2).toBe(p.FIRST_CHUNK),expect(e.data.length).toBe(s.length),expect(e.data).toEqual(s)}),it("should create correct APDU for subsequent chunks",()=>{const e=new o({chunkedData:s,isFirst:!1}).getApdu();expect(e.cla).toBe(r),expect(e.ins).toBe(c.SIGN_INTENT),expect(e.p1).toBe(d.SIGN_MODE_NESTED_CALL),expect(e.p2).toBe(p.NEXT_CHUNK),expect(e.data.length).toBe(s.length),expect(e.data).toEqual(s)}),it("should create correct APDU for a long chunk (255 bytes)",()=>{const e=new o({chunkedData:u,isFirst:!1}).getApdu();expect(e.cla).toBe(r),expect(e.ins).toBe(c.SIGN_INTENT),expect(e.p1).toBe(d.SIGN_MODE_NESTED_CALL),expect(e.p2).toBe(p.NEXT_CHUNK),expect(e.data.length).toBe(255),expect(e.data).toEqual(u)})}),describe("parseResponse",()=>{it("should return hexadecimal string for successful response",()=>{const t=new o({chunkedData:s,isFirst:!0}),e={statusCode:new Uint8Array([144,0]),data:new Uint8Array([1,2,3])},n=t.parseResponse(e);expect(n).toEqual(i({data:{tlvSignature:"010203"}}))}),it("should return empty signature for successful response without data (intermediate chunks)",()=>{const t=new o({chunkedData:s,isFirst:!0}),e={statusCode:new Uint8Array([144,0]),data:new Uint8Array([])},n=t.parseResponse(e);expect(n).toEqual(i({data:{tlvSignature:""}}))}),it("should handle user rejection",()=>{const t=new o({chunkedData:s,isFirst:!0}),e={statusCode:new Uint8Array([105,240]),data:new Uint8Array([])},n=t.parseResponse(e);expect(a(n)).toBe(!1),a(n)||expect(n.error).toEqual(expect.objectContaining({_tag:"AleoAppCommandError",errorCode:"69f0",message:"Denied by user"}))}),it("should handle device error codes",()=>{const t=new o({chunkedData:s,isFirst:!0}),e={statusCode:new Uint8Array([176,8]),data:new Uint8Array([])},n=t.parseResponse(e);expect(a(n)).toBe(!1),a(n)||expect(n.error).toEqual(expect.objectContaining({_tag:"AleoAppCommandError",errorCode:"b008",message:"Signature fail"}))})})});
2
+ //# sourceMappingURL=SignNestedCallCommand.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/internal/app-binder/command/SignNestedCallCommand.test.ts"],
4
+ "sourcesContent": ["import {\n type Apdu,\n type ApduResponse,\n CommandResultFactory,\n isSuccessCommandResult,\n} from \"@ledgerhq/device-management-kit\";\n\nimport {\n ALEO_CLA,\n INS,\n P1,\n P2,\n} from \"@internal/app-binder/command/utils/apduHeaderUtils\";\n\nimport { SignNestedCallCommand } from \"./SignNestedCallCommand\";\n\ndescribe(\"SignNestedCallCommand\", () => {\n const mockChunkedData = new Uint8Array([0x05, 0x06, 0x07, 0x08]);\n const mockLongChunkedData = new Uint8Array(255).fill(0x24);\n\n describe(\"name\", () => {\n it(\"should be 'signNestedCall'\", () => {\n const command = new SignNestedCallCommand({\n chunkedData: mockChunkedData,\n isFirst: true,\n });\n expect(command.name).toBe(\"signNestedCall\");\n });\n });\n\n describe(\"getApdu\", () => {\n it(\"should create correct APDU for the first chunk\", () => {\n // Given\n const command = new SignNestedCallCommand({\n chunkedData: mockChunkedData,\n isFirst: true,\n });\n\n // When\n const apdu: Apdu = command.getApdu();\n\n // Then\n expect(apdu.cla).toBe(ALEO_CLA);\n expect(apdu.ins).toBe(INS.SIGN_INTENT);\n expect(apdu.p1).toBe(P1.SIGN_MODE_NESTED_CALL);\n expect(apdu.p2).toBe(P2.FIRST_CHUNK);\n\n expect(apdu.data.length).toBe(mockChunkedData.length);\n expect(apdu.data).toEqual(mockChunkedData);\n });\n\n it(\"should create correct APDU for subsequent chunks\", () => {\n // Given\n const command = new SignNestedCallCommand({\n chunkedData: mockChunkedData,\n isFirst: false,\n });\n\n // When\n const apdu: Apdu = command.getApdu();\n\n // Then\n expect(apdu.cla).toBe(ALEO_CLA);\n expect(apdu.ins).toBe(INS.SIGN_INTENT);\n expect(apdu.p1).toBe(P1.SIGN_MODE_NESTED_CALL);\n expect(apdu.p2).toBe(P2.NEXT_CHUNK);\n\n expect(apdu.data.length).toBe(mockChunkedData.length);\n expect(apdu.data).toEqual(mockChunkedData);\n });\n\n it(\"should create correct APDU for a long chunk (255 bytes)\", () => {\n // Given\n const command = new SignNestedCallCommand({\n chunkedData: mockLongChunkedData,\n isFirst: false,\n });\n\n // When\n const apdu: Apdu = command.getApdu();\n\n // Then\n expect(apdu.cla).toBe(ALEO_CLA);\n expect(apdu.ins).toBe(INS.SIGN_INTENT);\n expect(apdu.p1).toBe(P1.SIGN_MODE_NESTED_CALL);\n expect(apdu.p2).toBe(P2.NEXT_CHUNK);\n\n expect(apdu.data.length).toBe(255);\n expect(apdu.data).toEqual(mockLongChunkedData);\n });\n });\n\n describe(\"parseResponse\", () => {\n it(\"should return hexadecimal string for successful response\", () => {\n // Given\n const command = new SignNestedCallCommand({\n chunkedData: mockChunkedData,\n isFirst: true,\n });\n\n const response: ApduResponse = {\n statusCode: new Uint8Array([0x90, 0x00]),\n data: new Uint8Array([0x01, 0x02, 0x03]),\n };\n\n // When\n const result = command.parseResponse(response);\n\n // Then\n expect(result).toEqual(\n CommandResultFactory({\n data: {\n tlvSignature: \"010203\",\n },\n }),\n );\n });\n\n it(\"should return empty signature for successful response without data (intermediate chunks)\", () => {\n // Given\n const command = new SignNestedCallCommand({\n chunkedData: mockChunkedData,\n isFirst: true,\n });\n\n const response: ApduResponse = {\n statusCode: new Uint8Array([0x90, 0x00]),\n data: new Uint8Array([]),\n };\n\n // When\n const result = command.parseResponse(response);\n\n // Then\n expect(result).toEqual(\n CommandResultFactory({\n data: {\n tlvSignature: \"\",\n },\n }),\n );\n });\n\n it(\"should handle user rejection\", () => {\n // Given\n const command = new SignNestedCallCommand({\n chunkedData: mockChunkedData,\n isFirst: true,\n });\n\n const response: ApduResponse = {\n statusCode: new Uint8Array([0x69, 0xf0]),\n data: new Uint8Array([]),\n };\n\n // When\n const result = command.parseResponse(response);\n\n // Then\n expect(isSuccessCommandResult(result)).toBe(false);\n if (!isSuccessCommandResult(result)) {\n expect(result.error).toEqual(\n expect.objectContaining({\n _tag: \"AleoAppCommandError\",\n errorCode: \"69f0\",\n message: \"Denied by user\",\n }),\n );\n }\n });\n\n it(\"should handle device error codes\", () => {\n // Given\n const command = new SignNestedCallCommand({\n chunkedData: mockChunkedData,\n isFirst: true,\n });\n\n // Signature fail (0xb008)\n const response: ApduResponse = {\n statusCode: new Uint8Array([0xb0, 0x08]),\n data: new Uint8Array([]),\n };\n\n // When\n const result = command.parseResponse(response);\n\n // Then\n expect(isSuccessCommandResult(result)).toBe(false);\n if (!isSuccessCommandResult(result)) {\n expect(result.error).toEqual(\n expect.objectContaining({\n _tag: \"AleoAppCommandError\",\n errorCode: \"b008\",\n message: \"Signature fail\",\n }),\n );\n }\n });\n });\n});\n"],
5
+ "mappings": "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",
6
+ "names": ["CommandResultFactory", "isSuccessCommandResult", "ALEO_CLA", "INS", "P1", "P2", "SignNestedCallCommand", "mockChunkedData", "mockLongChunkedData", "command", "apdu", "response", "result"]
7
+ }
@@ -1,2 +1,2 @@
1
- import{DeviceExchangeError as r}from"@ledgerhq/device-management-kit";const n={"69f0":{message:"Denied by user"},6985:{message:"Condition not satisfied"},"6a86":{message:"Incorrect P1 or P2"},"6a87":{message:"Wrong LC or length of APDU command less than 5"},"6d00":{message:"Unknown command with this INS"},"6e00":{message:"Instruction class is different than CLA"},b000:{message:"Wrong response length (buffer too small or too big)"},b001:{message:"Fail to display BIP32 path"},b002:{message:"Fail to display address"},b003:{message:"Fail to display amount"},b004:{message:"Wrong transaction length"},b005:{message:"Fail of transaction parsing"},b006:{message:"Fail of transaction hash"},b007:{message:"Bad state"},b008:{message:"Signature fail"},c000:{message:"Swap failure"}};class s extends r{constructor(o){super({tag:"AleoAppCommandError",...o})}}const t=e=>new s(e);export{n as ALEO_APP_ERRORS,s as AleoAppCommandError,t as AleoAppCommandErrorFactory};
1
+ import{DeviceExchangeError as o}from"@ledgerhq/device-management-kit";const t={"69f0":{message:"Denied by user"},6985:{message:"Condition not satisfied"},"6a80":{message:"Incorrect data"},"6a86":{message:"Incorrect P1 or P2"},"6a87":{message:"Wrong LC or length of APDU command less than 5"},"6d00":{message:"Unknown command with this INS"},"6e00":{message:"Instruction class is different than CLA"},b000:{message:"Wrong response length (buffer too small or too big)"},b001:{message:"Fail to display BIP32 path"},b002:{message:"Fail to display address"},b003:{message:"Fail to display amount"},b004:{message:"Wrong transaction length"},b005:{message:"Fail of transaction parsing"},b006:{message:"Fail of transaction hash"},b007:{message:"Bad state"},b008:{message:"Signature fail"},c000:{message:"Swap failure"}};class s extends o{constructor(r){super({tag:"AleoAppCommandError",...r})}}const n=e=>new s(e);export{t as ALEO_APP_ERRORS,s as AleoAppCommandError,n as AleoAppCommandErrorFactory};
2
2
  //# sourceMappingURL=aleoApplicationErrors.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/app-binder/command/utils/aleoApplicationErrors.ts"],
4
- "sourcesContent": ["import {\n type CommandErrorArgs,\n type CommandErrors,\n DeviceExchangeError,\n} from \"@ledgerhq/device-management-kit\";\n\nexport type AleoErrorCodes =\n | \"69f0\"\n | \"6985\"\n | \"6a86\"\n | \"6a87\"\n | \"6d00\"\n | \"6e00\"\n | \"b000\"\n | \"b001\"\n | \"b002\"\n | \"b003\"\n | \"b004\"\n | \"b005\"\n | \"b006\"\n | \"b007\"\n | \"b008\"\n | \"c000\";\n\nexport const ALEO_APP_ERRORS: CommandErrors<AleoErrorCodes> = {\n \"69f0\": { message: \"Denied by user\" },\n \"6985\": { message: \"Condition not satisfied\" },\n \"6a86\": { message: \"Incorrect P1 or P2\" },\n \"6a87\": { message: \"Wrong LC or length of APDU command less than 5\" },\n \"6d00\": { message: \"Unknown command with this INS\" },\n \"6e00\": { message: \"Instruction class is different than CLA\" },\n b000: { message: \"Wrong response length (buffer too small or too big)\" },\n b001: { message: \"Fail to display BIP32 path\" },\n b002: { message: \"Fail to display address\" },\n b003: { message: \"Fail to display amount\" },\n b004: { message: \"Wrong transaction length\" },\n b005: { message: \"Fail of transaction parsing\" },\n b006: { message: \"Fail of transaction hash\" },\n b007: { message: \"Bad state\" },\n b008: { message: \"Signature fail\" },\n c000: { message: \"Swap failure\" },\n};\n\nexport class AleoAppCommandError extends DeviceExchangeError<AleoErrorCodes> {\n constructor(args: CommandErrorArgs<AleoErrorCodes>) {\n super({ tag: \"AleoAppCommandError\", ...args });\n }\n}\n\nexport const AleoAppCommandErrorFactory = (\n args: CommandErrorArgs<AleoErrorCodes>,\n) => new AleoAppCommandError(args);\n"],
5
- "mappings": "AAAA,OAGE,uBAAAA,MACK,kCAoBA,MAAMC,EAAiD,CAC5D,OAAQ,CAAE,QAAS,gBAAiB,EACpC,KAAQ,CAAE,QAAS,yBAA0B,EAC7C,OAAQ,CAAE,QAAS,oBAAqB,EACxC,OAAQ,CAAE,QAAS,gDAAiD,EACpE,OAAQ,CAAE,QAAS,+BAAgC,EACnD,OAAQ,CAAE,QAAS,yCAA0C,EAC7D,KAAM,CAAE,QAAS,qDAAsD,EACvE,KAAM,CAAE,QAAS,4BAA6B,EAC9C,KAAM,CAAE,QAAS,yBAA0B,EAC3C,KAAM,CAAE,QAAS,wBAAyB,EAC1C,KAAM,CAAE,QAAS,0BAA2B,EAC5C,KAAM,CAAE,QAAS,6BAA8B,EAC/C,KAAM,CAAE,QAAS,0BAA2B,EAC5C,KAAM,CAAE,QAAS,WAAY,EAC7B,KAAM,CAAE,QAAS,gBAAiB,EAClC,KAAM,CAAE,QAAS,cAAe,CAClC,EAEO,MAAMC,UAA4BF,CAAoC,CAC3E,YAAYG,EAAwC,CAClD,MAAM,CAAE,IAAK,sBAAuB,GAAGA,CAAK,CAAC,CAC/C,CACF,CAEO,MAAMC,EACXD,GACG,IAAID,EAAoBC,CAAI",
4
+ "sourcesContent": ["import {\n type CommandErrorArgs,\n type CommandErrors,\n DeviceExchangeError,\n} from \"@ledgerhq/device-management-kit\";\n\nexport type AleoErrorCodes =\n | \"69f0\"\n | \"6985\"\n | \"6a80\"\n | \"6a86\"\n | \"6a87\"\n | \"6d00\"\n | \"6e00\"\n | \"b000\"\n | \"b001\"\n | \"b002\"\n | \"b003\"\n | \"b004\"\n | \"b005\"\n | \"b006\"\n | \"b007\"\n | \"b008\"\n | \"c000\";\n\nexport const ALEO_APP_ERRORS: CommandErrors<AleoErrorCodes> = {\n \"69f0\": { message: \"Denied by user\" },\n \"6985\": { message: \"Condition not satisfied\" },\n \"6a80\": { message: \"Incorrect data\" },\n \"6a86\": { message: \"Incorrect P1 or P2\" },\n \"6a87\": { message: \"Wrong LC or length of APDU command less than 5\" },\n \"6d00\": { message: \"Unknown command with this INS\" },\n \"6e00\": { message: \"Instruction class is different than CLA\" },\n b000: { message: \"Wrong response length (buffer too small or too big)\" },\n b001: { message: \"Fail to display BIP32 path\" },\n b002: { message: \"Fail to display address\" },\n b003: { message: \"Fail to display amount\" },\n b004: { message: \"Wrong transaction length\" },\n b005: { message: \"Fail of transaction parsing\" },\n b006: { message: \"Fail of transaction hash\" },\n b007: { message: \"Bad state\" },\n b008: { message: \"Signature fail\" },\n c000: { message: \"Swap failure\" },\n};\n\nexport class AleoAppCommandError extends DeviceExchangeError<AleoErrorCodes> {\n constructor(args: CommandErrorArgs<AleoErrorCodes>) {\n super({ tag: \"AleoAppCommandError\", ...args });\n }\n}\n\nexport const AleoAppCommandErrorFactory = (\n args: CommandErrorArgs<AleoErrorCodes>,\n) => new AleoAppCommandError(args);\n"],
5
+ "mappings": "AAAA,OAGE,uBAAAA,MACK,kCAqBA,MAAMC,EAAiD,CAC5D,OAAQ,CAAE,QAAS,gBAAiB,EACpC,KAAQ,CAAE,QAAS,yBAA0B,EAC7C,OAAQ,CAAE,QAAS,gBAAiB,EACpC,OAAQ,CAAE,QAAS,oBAAqB,EACxC,OAAQ,CAAE,QAAS,gDAAiD,EACpE,OAAQ,CAAE,QAAS,+BAAgC,EACnD,OAAQ,CAAE,QAAS,yCAA0C,EAC7D,KAAM,CAAE,QAAS,qDAAsD,EACvE,KAAM,CAAE,QAAS,4BAA6B,EAC9C,KAAM,CAAE,QAAS,yBAA0B,EAC3C,KAAM,CAAE,QAAS,wBAAyB,EAC1C,KAAM,CAAE,QAAS,0BAA2B,EAC5C,KAAM,CAAE,QAAS,6BAA8B,EAC/C,KAAM,CAAE,QAAS,0BAA2B,EAC5C,KAAM,CAAE,QAAS,WAAY,EAC7B,KAAM,CAAE,QAAS,gBAAiB,EAClC,KAAM,CAAE,QAAS,cAAe,CAClC,EAEO,MAAMC,UAA4BF,CAAoC,CAC3E,YAAYG,EAAwC,CAClD,MAAM,CAAE,IAAK,sBAAuB,GAAGA,CAAK,CAAC,CAC/C,CACF,CAEO,MAAMC,EACXD,GACG,IAAID,EAAoBC,CAAI",
6
6
  "names": ["DeviceExchangeError", "ALEO_APP_ERRORS", "AleoAppCommandError", "args", "AleoAppCommandErrorFactory"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{DeviceExchangeError as a}from"@ledgerhq/device-management-kit";import{afterAll as d,afterEach as l,describe as c,expect as r,it as t,vi as m}from"vitest";import{ALEO_APP_ERRORS as g,AleoAppCommandError as n,AleoAppCommandErrorFactory as C}from"./aleoApplicationErrors";c("AleoAppCommandError",()=>{l(()=>{m.resetAllMocks()}),d(()=>{m.resetModules()}),t("should be an instance of DeviceExchangeError",()=>{const e=new n({message:"Test error message",errorCode:"6985"});r(e).toBeInstanceOf(a)}),t("should set the correct message when provided",()=>{const e="Custom error message",o=new n({message:e,errorCode:"6985"});r(o.message).toBe(e)}),t("should set the correct customErrorCode",()=>{const e="6a86",o=new n({message:"Incorrect P1 or P2",errorCode:e});r(o.errorCode).toBe(e)}),t("should correlate error codes with messages from aleoApplicationErrors",()=>{const e="6e00",o=g[e].message,s=new n({message:o,errorCode:e});r(s.errorCode).toBe(e),r(s.message).toBe(o),r(s).toBeInstanceOf(a)}),t("should handle unknown error codes gracefully",()=>{const e="9999",o="Unknown error occurred",s=new n({message:o,errorCode:e});r(s.errorCode).toBe(e),r(s.message).toBe(o),r(s).toBeInstanceOf(a)}),c("AleoAppCommandErrorFactory",()=>{t("should create an instance of AleoAppCommandError",()=>{const e=C({message:"Test error message",errorCode:"6985"});r(e).toBeInstanceOf(n),r(e.message).toBe("Test error message"),r(e.errorCode).toBe("6985")})})});
1
+ import{DeviceExchangeError as c}from"@ledgerhq/device-management-kit";import{afterAll as l,afterEach as C,describe as d,expect as r,it as t,vi as m}from"vitest";import{ALEO_APP_ERRORS as n,AleoAppCommandError as a,AleoAppCommandErrorFactory as g}from"./aleoApplicationErrors";d("AleoAppCommandError",()=>{C(()=>{m.resetAllMocks()}),l(()=>{m.resetModules()}),t("should be an instance of DeviceExchangeError",()=>{const e=new a({message:"Test error message",errorCode:"6985"});r(e).toBeInstanceOf(c)}),t("should set the correct message when provided",()=>{const e="Custom error message",o=new a({message:e,errorCode:"6985"});r(o.message).toBe(e)}),t("should set the correct customErrorCode",()=>{const e="6a86",o=new a({message:"Incorrect P1 or P2",errorCode:e});r(o.errorCode).toBe(e)}),t("should correlate error codes with messages from aleoApplicationErrors",()=>{const e="6e00",o=n[e].message,s=new a({message:o,errorCode:e});r(s.errorCode).toBe(e),r(s.message).toBe(o),r(s).toBeInstanceOf(c)}),t("should handle unknown error codes gracefully",()=>{const e="9999",o="Unknown error occurred",s=new a({message:o,errorCode:e});r(s.errorCode).toBe(e),r(s.message).toBe(o),r(s).toBeInstanceOf(c)}),d("6a80 - Incorrect data",()=>{t("should be defined in ALEO_APP_ERRORS with message 'Incorrect data'",()=>{r(n["6a80"]).toBeDefined(),r(n["6a80"].message).toBe("Incorrect data")}),t("should map error code 6a80 to 'Incorrect data' via AleoAppCommandError",()=>{const e="6a80",o=n[e].message,s=new a({message:o,errorCode:e});r(s.errorCode).toBe("6a80"),r(s.message).toBe("Incorrect data"),r(s).toBeInstanceOf(c)}),t("should create a 6a80 error via AleoAppCommandErrorFactory",()=>{const e=g({message:n["6a80"].message,errorCode:"6a80"});r(e).toBeInstanceOf(a),r(e.errorCode).toBe("6a80"),r(e.message).toBe("Incorrect data")})}),d("AleoAppCommandErrorFactory",()=>{t("should create an instance of AleoAppCommandError",()=>{const e=g({message:"Test error message",errorCode:"6985"});r(e).toBeInstanceOf(a),r(e.message).toBe("Test error message"),r(e.errorCode).toBe("6985")})})});
2
2
  //# sourceMappingURL=aleoApplicationErrors.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/app-binder/command/utils/aleoApplicationErrors.test.ts"],
4
- "sourcesContent": ["import { DeviceExchangeError } from \"@ledgerhq/device-management-kit\";\nimport { afterAll, afterEach, describe, expect, it, vi } from \"vitest\";\n\nimport {\n ALEO_APP_ERRORS,\n AleoAppCommandError,\n AleoAppCommandErrorFactory,\n type AleoErrorCodes,\n} from \"./aleoApplicationErrors\";\n\ndescribe(\"AleoAppCommandError\", () => {\n afterEach(() => {\n vi.resetAllMocks();\n });\n\n afterAll(() => {\n vi.resetModules();\n });\n\n it(\"should be an instance of DeviceExchangeError\", () => {\n const error = new AleoAppCommandError({\n message: \"Test error message\",\n errorCode: \"6985\",\n });\n\n expect(error).toBeInstanceOf(DeviceExchangeError);\n });\n\n it(\"should set the correct message when provided\", () => {\n const customMessage = \"Custom error message\";\n const error = new AleoAppCommandError({\n message: customMessage,\n errorCode: \"6985\",\n });\n\n expect(error.message).toBe(customMessage);\n });\n\n it(\"should set the correct customErrorCode\", () => {\n const errorCode: AleoErrorCodes = \"6a86\";\n const error = new AleoAppCommandError({\n message: \"Incorrect P1 or P2\",\n errorCode,\n });\n\n expect(error.errorCode).toBe(errorCode);\n });\n\n it(\"should correlate error codes with messages from aleoApplicationErrors\", () => {\n const errorCode: AleoErrorCodes = \"6e00\";\n const expectedMessage = ALEO_APP_ERRORS[errorCode].message;\n\n const error = new AleoAppCommandError({\n message: expectedMessage,\n errorCode,\n });\n\n expect(error.errorCode).toBe(errorCode);\n expect(error.message).toBe(expectedMessage);\n\n expect(error).toBeInstanceOf(DeviceExchangeError);\n });\n\n it(\"should handle unknown error codes gracefully\", () => {\n const unknownErrorCode = \"9999\" as AleoErrorCodes;\n const customMessage = \"Unknown error occurred\";\n\n const error = new AleoAppCommandError({\n message: customMessage,\n errorCode: unknownErrorCode,\n });\n\n expect(error.errorCode).toBe(unknownErrorCode);\n expect(error.message).toBe(customMessage);\n expect(error).toBeInstanceOf(DeviceExchangeError);\n });\n\n describe(\"AleoAppCommandErrorFactory\", () => {\n it(\"should create an instance of AleoAppCommandError\", () => {\n const error = AleoAppCommandErrorFactory({\n message: \"Test error message\",\n errorCode: \"6985\",\n });\n\n expect(error).toBeInstanceOf(AleoAppCommandError);\n expect(error.message).toBe(\"Test error message\");\n expect(error.errorCode).toBe(\"6985\");\n });\n });\n});\n"],
5
- "mappings": "AAAA,OAAS,uBAAAA,MAA2B,kCACpC,OAAS,YAAAC,EAAU,aAAAC,EAAW,YAAAC,EAAU,UAAAC,EAAQ,MAAAC,EAAI,MAAAC,MAAU,SAE9D,OACE,mBAAAC,EACA,uBAAAC,EACA,8BAAAC,MAEK,0BAEPN,EAAS,sBAAuB,IAAM,CACpCD,EAAU,IAAM,CACdI,EAAG,cAAc,CACnB,CAAC,EAEDL,EAAS,IAAM,CACbK,EAAG,aAAa,CAClB,CAAC,EAEDD,EAAG,+CAAgD,IAAM,CACvD,MAAMK,EAAQ,IAAIF,EAAoB,CACpC,QAAS,qBACT,UAAW,MACb,CAAC,EAEDJ,EAAOM,CAAK,EAAE,eAAeV,CAAmB,CAClD,CAAC,EAEDK,EAAG,+CAAgD,IAAM,CACvD,MAAMM,EAAgB,uBAChBD,EAAQ,IAAIF,EAAoB,CACpC,QAASG,EACT,UAAW,MACb,CAAC,EAEDP,EAAOM,EAAM,OAAO,EAAE,KAAKC,CAAa,CAC1C,CAAC,EAEDN,EAAG,yCAA0C,IAAM,CACjD,MAAMO,EAA4B,OAC5BF,EAAQ,IAAIF,EAAoB,CACpC,QAAS,qBACT,UAAAI,CACF,CAAC,EAEDR,EAAOM,EAAM,SAAS,EAAE,KAAKE,CAAS,CACxC,CAAC,EAEDP,EAAG,wEAAyE,IAAM,CAChF,MAAMO,EAA4B,OAC5BC,EAAkBN,EAAgBK,CAAS,EAAE,QAE7CF,EAAQ,IAAIF,EAAoB,CACpC,QAASK,EACT,UAAAD,CACF,CAAC,EAEDR,EAAOM,EAAM,SAAS,EAAE,KAAKE,CAAS,EACtCR,EAAOM,EAAM,OAAO,EAAE,KAAKG,CAAe,EAE1CT,EAAOM,CAAK,EAAE,eAAeV,CAAmB,CAClD,CAAC,EAEDK,EAAG,+CAAgD,IAAM,CACvD,MAAMS,EAAmB,OACnBH,EAAgB,yBAEhBD,EAAQ,IAAIF,EAAoB,CACpC,QAASG,EACT,UAAWG,CACb,CAAC,EAEDV,EAAOM,EAAM,SAAS,EAAE,KAAKI,CAAgB,EAC7CV,EAAOM,EAAM,OAAO,EAAE,KAAKC,CAAa,EACxCP,EAAOM,CAAK,EAAE,eAAeV,CAAmB,CAClD,CAAC,EAEDG,EAAS,6BAA8B,IAAM,CAC3CE,EAAG,mDAAoD,IAAM,CAC3D,MAAMK,EAAQD,EAA2B,CACvC,QAAS,qBACT,UAAW,MACb,CAAC,EAEDL,EAAOM,CAAK,EAAE,eAAeF,CAAmB,EAChDJ,EAAOM,EAAM,OAAO,EAAE,KAAK,oBAAoB,EAC/CN,EAAOM,EAAM,SAAS,EAAE,KAAK,MAAM,CACrC,CAAC,CACH,CAAC,CACH,CAAC",
4
+ "sourcesContent": ["import { DeviceExchangeError } from \"@ledgerhq/device-management-kit\";\nimport { afterAll, afterEach, describe, expect, it, vi } from \"vitest\";\n\nimport {\n ALEO_APP_ERRORS,\n AleoAppCommandError,\n AleoAppCommandErrorFactory,\n type AleoErrorCodes,\n} from \"./aleoApplicationErrors\";\n\ndescribe(\"AleoAppCommandError\", () => {\n afterEach(() => {\n vi.resetAllMocks();\n });\n\n afterAll(() => {\n vi.resetModules();\n });\n\n it(\"should be an instance of DeviceExchangeError\", () => {\n const error = new AleoAppCommandError({\n message: \"Test error message\",\n errorCode: \"6985\",\n });\n\n expect(error).toBeInstanceOf(DeviceExchangeError);\n });\n\n it(\"should set the correct message when provided\", () => {\n const customMessage = \"Custom error message\";\n const error = new AleoAppCommandError({\n message: customMessage,\n errorCode: \"6985\",\n });\n\n expect(error.message).toBe(customMessage);\n });\n\n it(\"should set the correct customErrorCode\", () => {\n const errorCode: AleoErrorCodes = \"6a86\";\n const error = new AleoAppCommandError({\n message: \"Incorrect P1 or P2\",\n errorCode,\n });\n\n expect(error.errorCode).toBe(errorCode);\n });\n\n it(\"should correlate error codes with messages from aleoApplicationErrors\", () => {\n const errorCode: AleoErrorCodes = \"6e00\";\n const expectedMessage = ALEO_APP_ERRORS[errorCode].message;\n\n const error = new AleoAppCommandError({\n message: expectedMessage,\n errorCode,\n });\n\n expect(error.errorCode).toBe(errorCode);\n expect(error.message).toBe(expectedMessage);\n\n expect(error).toBeInstanceOf(DeviceExchangeError);\n });\n\n it(\"should handle unknown error codes gracefully\", () => {\n const unknownErrorCode = \"9999\" as AleoErrorCodes;\n const customMessage = \"Unknown error occurred\";\n\n const error = new AleoAppCommandError({\n message: customMessage,\n errorCode: unknownErrorCode,\n });\n\n expect(error.errorCode).toBe(unknownErrorCode);\n expect(error.message).toBe(customMessage);\n expect(error).toBeInstanceOf(DeviceExchangeError);\n });\n\n describe(\"6a80 - Incorrect data\", () => {\n it(\"should be defined in ALEO_APP_ERRORS with message 'Incorrect data'\", () => {\n expect(ALEO_APP_ERRORS[\"6a80\"]).toBeDefined();\n expect(ALEO_APP_ERRORS[\"6a80\"].message).toBe(\"Incorrect data\");\n });\n\n it(\"should map error code 6a80 to 'Incorrect data' via AleoAppCommandError\", () => {\n const errorCode: AleoErrorCodes = \"6a80\";\n const expectedMessage = ALEO_APP_ERRORS[errorCode].message;\n\n const error = new AleoAppCommandError({\n message: expectedMessage,\n errorCode,\n });\n\n expect(error.errorCode).toBe(\"6a80\");\n expect(error.message).toBe(\"Incorrect data\");\n expect(error).toBeInstanceOf(DeviceExchangeError);\n });\n\n it(\"should create a 6a80 error via AleoAppCommandErrorFactory\", () => {\n const error = AleoAppCommandErrorFactory({\n message: ALEO_APP_ERRORS[\"6a80\"].message,\n errorCode: \"6a80\",\n });\n\n expect(error).toBeInstanceOf(AleoAppCommandError);\n expect(error.errorCode).toBe(\"6a80\");\n expect(error.message).toBe(\"Incorrect data\");\n });\n });\n\n describe(\"AleoAppCommandErrorFactory\", () => {\n it(\"should create an instance of AleoAppCommandError\", () => {\n const error = AleoAppCommandErrorFactory({\n message: \"Test error message\",\n errorCode: \"6985\",\n });\n\n expect(error).toBeInstanceOf(AleoAppCommandError);\n expect(error.message).toBe(\"Test error message\");\n expect(error.errorCode).toBe(\"6985\");\n });\n });\n});\n"],
5
+ "mappings": "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",
6
6
  "names": ["DeviceExchangeError", "afterAll", "afterEach", "describe", "expect", "it", "vi", "ALEO_APP_ERRORS", "AleoAppCommandError", "AleoAppCommandErrorFactory", "error", "customMessage", "errorCode", "expectedMessage", "unknownErrorCode"]
7
7
  }
@@ -1,2 +1,2 @@
1
- const E=224,_=0,x={FIRST_CHUNK:0,NEXT_CHUNK:1},o={GET_APP_VERSION:3,GET_ADDRESS:5,SIGN_INTENT:6,GET_VIEW_KEY:7},s={SIGN_MODE_ROOT:0,SIGN_MODE_NESTED_CALL:1,SIGN_MODE_FEE:2,CHECK_ON_DEVICE:1,NO_CHECK:0};export{E as ALEO_CLA,o as INS,s as P1,x as P2,_ as P2_DEFAULT};
1
+ const E=224,_=0,T={FIRST_CHUNK:0,NEXT_CHUNK:1},x={GET_APP_VERSION:3,GET_ADDRESS:5,SIGN_INTENT:6,GET_VIEW_KEY:7,GET_TVK:8},N={SIGN_MODE_ROOT:0,SIGN_MODE_NESTED_CALL:1,SIGN_MODE_FEE:2,CHECK_ON_DEVICE:1,NO_CHECK:0,GET_TVK_ROOT:0,GET_TVK_INDEXED:1},o={DATA_SIZE:2,DERIVATION_PATH_SEGMENT:4,DERIVATION_PATH_LENGTH:1};export{E as ALEO_CLA,o as APDU_SECTION_LENGTH,x as INS,N as P1,T as P2,_ as P2_DEFAULT};
2
2
  //# sourceMappingURL=apduHeaderUtils.js.map