@ledgerhq/device-signer-kit-aleo 0.2.0 → 0.3.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 (88) 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/SignNestedCallDeviceActionTypes.js +2 -0
  4. package/lib/cjs/api/app-binder/SignNestedCallDeviceActionTypes.js.map +7 -0
  5. package/lib/cjs/api/index.js +1 -1
  6. package/lib/cjs/api/index.js.map +2 -2
  7. package/lib/cjs/internal/DefaultSignerAleo.js +1 -1
  8. package/lib/cjs/internal/DefaultSignerAleo.js.map +3 -3
  9. package/lib/cjs/internal/app-binder/AleoAppBinder.js +1 -1
  10. package/lib/cjs/internal/app-binder/AleoAppBinder.js.map +3 -3
  11. package/lib/cjs/internal/app-binder/command/SignNestedCallCommand.js +2 -0
  12. package/lib/cjs/internal/app-binder/command/SignNestedCallCommand.js.map +7 -0
  13. package/lib/cjs/internal/app-binder/command/SignNestedCallCommand.test.js +2 -0
  14. package/lib/cjs/internal/app-binder/command/SignNestedCallCommand.test.js.map +7 -0
  15. package/lib/cjs/internal/app-binder/command/utils/apduHeaderUtils.js +1 -1
  16. package/lib/cjs/internal/app-binder/command/utils/apduHeaderUtils.js.map +3 -3
  17. package/lib/cjs/internal/app-binder/task/SignFeeIntentTask.js +1 -1
  18. package/lib/cjs/internal/app-binder/task/SignFeeIntentTask.js.map +3 -3
  19. package/lib/cjs/internal/app-binder/task/SignNestedCallTask.js +2 -0
  20. package/lib/cjs/internal/app-binder/task/SignNestedCallTask.js.map +7 -0
  21. package/lib/cjs/internal/app-binder/task/SignNestedCallTask.test.js +2 -0
  22. package/lib/cjs/internal/app-binder/task/SignNestedCallTask.test.js.map +7 -0
  23. package/lib/cjs/internal/app-binder/task/SignRootIntentTask.js +1 -1
  24. package/lib/cjs/internal/app-binder/task/SignRootIntentTask.js.map +3 -3
  25. package/lib/cjs/internal/use-cases/transaction/SignNestedCallUseCase.js +2 -0
  26. package/lib/cjs/internal/use-cases/transaction/SignNestedCallUseCase.js.map +7 -0
  27. package/lib/cjs/internal/use-cases/transaction/di/transactionModule.js +1 -1
  28. package/lib/cjs/internal/use-cases/transaction/di/transactionModule.js.map +3 -3
  29. package/lib/cjs/internal/use-cases/transaction/di/transactionTypes.js +1 -1
  30. package/lib/cjs/internal/use-cases/transaction/di/transactionTypes.js.map +2 -2
  31. package/lib/cjs/package.json +3 -3
  32. package/lib/esm/api/app-binder/SignNestedCallDeviceActionTypes.js +1 -0
  33. package/lib/esm/api/app-binder/SignNestedCallDeviceActionTypes.js.map +7 -0
  34. package/lib/esm/api/index.js.map +2 -2
  35. package/lib/esm/internal/DefaultSignerAleo.js +1 -1
  36. package/lib/esm/internal/DefaultSignerAleo.js.map +3 -3
  37. package/lib/esm/internal/app-binder/AleoAppBinder.js +1 -1
  38. package/lib/esm/internal/app-binder/AleoAppBinder.js.map +3 -3
  39. package/lib/esm/internal/app-binder/command/SignNestedCallCommand.js +2 -0
  40. package/lib/esm/internal/app-binder/command/SignNestedCallCommand.js.map +7 -0
  41. package/lib/esm/internal/app-binder/command/SignNestedCallCommand.test.js +2 -0
  42. package/lib/esm/internal/app-binder/command/SignNestedCallCommand.test.js.map +7 -0
  43. package/lib/esm/internal/app-binder/command/utils/apduHeaderUtils.js +1 -1
  44. package/lib/esm/internal/app-binder/command/utils/apduHeaderUtils.js.map +3 -3
  45. package/lib/esm/internal/app-binder/task/SignFeeIntentTask.js +1 -1
  46. package/lib/esm/internal/app-binder/task/SignFeeIntentTask.js.map +3 -3
  47. package/lib/esm/internal/app-binder/task/SignNestedCallTask.js +2 -0
  48. package/lib/esm/internal/app-binder/task/SignNestedCallTask.js.map +7 -0
  49. package/lib/esm/internal/app-binder/task/SignNestedCallTask.test.js +2 -0
  50. package/lib/esm/internal/app-binder/task/SignNestedCallTask.test.js.map +7 -0
  51. package/lib/esm/internal/app-binder/task/SignRootIntentTask.js +1 -1
  52. package/lib/esm/internal/app-binder/task/SignRootIntentTask.js.map +3 -3
  53. package/lib/esm/internal/use-cases/transaction/SignNestedCallUseCase.js +2 -0
  54. package/lib/esm/internal/use-cases/transaction/SignNestedCallUseCase.js.map +7 -0
  55. package/lib/esm/internal/use-cases/transaction/di/transactionModule.js +1 -1
  56. package/lib/esm/internal/use-cases/transaction/di/transactionModule.js.map +3 -3
  57. package/lib/esm/internal/use-cases/transaction/di/transactionTypes.js +1 -1
  58. package/lib/esm/internal/use-cases/transaction/di/transactionTypes.js.map +2 -2
  59. package/lib/esm/package.json +3 -3
  60. package/lib/types/api/SignerAleo.d.ts +2 -0
  61. package/lib/types/api/SignerAleo.d.ts.map +1 -1
  62. package/lib/types/api/app-binder/SignNestedCallDeviceActionTypes.d.ts +12 -0
  63. package/lib/types/api/app-binder/SignNestedCallDeviceActionTypes.d.ts.map +1 -0
  64. package/lib/types/api/index.d.ts +1 -0
  65. package/lib/types/api/index.d.ts.map +1 -1
  66. package/lib/types/internal/DefaultSignerAleo.d.ts +2 -0
  67. package/lib/types/internal/DefaultSignerAleo.d.ts.map +1 -1
  68. package/lib/types/internal/app-binder/AleoAppBinder.d.ts +5 -0
  69. package/lib/types/internal/app-binder/AleoAppBinder.d.ts.map +1 -1
  70. package/lib/types/internal/app-binder/command/SignNestedCallCommand.d.ts +22 -0
  71. package/lib/types/internal/app-binder/command/SignNestedCallCommand.d.ts.map +1 -0
  72. package/lib/types/internal/app-binder/command/SignNestedCallCommand.test.d.ts +2 -0
  73. package/lib/types/internal/app-binder/command/SignNestedCallCommand.test.d.ts.map +1 -0
  74. package/lib/types/internal/app-binder/command/utils/apduHeaderUtils.d.ts +5 -0
  75. package/lib/types/internal/app-binder/command/utils/apduHeaderUtils.d.ts.map +1 -1
  76. package/lib/types/internal/app-binder/task/SignFeeIntentTask.d.ts.map +1 -1
  77. package/lib/types/internal/app-binder/task/SignNestedCallTask.d.ts +13 -0
  78. package/lib/types/internal/app-binder/task/SignNestedCallTask.d.ts.map +1 -0
  79. package/lib/types/internal/app-binder/task/SignNestedCallTask.test.d.ts +2 -0
  80. package/lib/types/internal/app-binder/task/SignNestedCallTask.test.d.ts.map +1 -0
  81. package/lib/types/internal/app-binder/task/SignRootIntentTask.d.ts.map +1 -1
  82. package/lib/types/internal/use-cases/transaction/SignNestedCallUseCase.d.ts +9 -0
  83. package/lib/types/internal/use-cases/transaction/SignNestedCallUseCase.d.ts.map +1 -0
  84. package/lib/types/internal/use-cases/transaction/di/transactionModule.d.ts.map +1 -1
  85. package/lib/types/internal/use-cases/transaction/di/transactionTypes.d.ts +1 -0
  86. package/lib/types/internal/use-cases/transaction/di/transactionTypes.d.ts.map +1 -1
  87. package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
  88. package/package.json +10 -10
@@ -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 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 { 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 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": "iOAAA,OACE,6BAAAA,EAGA,gCAAAC,EACA,2BAAAC,MACK,kCACP,OAAS,UAAAC,EAAQ,cAAAC,MAAkB,YAQnC,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,4BACnC,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,oBAA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ired", "inject", "injectable", "APP_NAME", "externalTypes", "GetAddressCommand", "GetAppConfigCommand", "GetViewKeyCommand", "SignFeeIntentTask", "SignNestedCallTask", "SignRootIntentTask", "AleoAppBinder", "dmk", "sessionId", "args", "SendCommandInAppDeviceAction", "GetAppConfigCommand", "APP_NAME", "UserInteractionRequired", "GetAddressCommand", "GetViewKeyCommand", "CallTaskInAppDeviceAction", "internalApi", "SignRootIntentTask", "SignNestedCallTask", "SignFeeIntentTask", "__decorateClass", "injectable", "__decorateParam", "inject", "externalTypes"]
7
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": "AAAA,OAGE,wBAAAA,EACA,0BAAAC,MACK,kCAEP,OACE,YAAAC,EACA,OAAAC,EACA,MAAAC,EACA,MAAAC,MACK,qDAEP,OAAS,yBAAAC,MAA6B,0BAEtC,SAAS,wBAAyB,IAAM,CACtC,MAAMC,EAAkB,IA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,GAAI,CAAC,EACvC,KAAM,IAAI,WAAW,CAAC,CAAC,CACzB,EAGMC,EAASH,EAAQ,cAAcE,CAAQ,EAG7C,OAAOV,EAAuBW,CAAM,CAAC,EAAE,KAAK,EAAK,EAC5CX,EAAuBW,CAAM,GAChC,OAAOA,EAAO,KAAK,EAAE,QACnB,OAAO,iBAAiB,CACtB,KAAM,sBACN,UAAW,OACX,QAAS,gBACX,CAAC,CACH,CAEJ,CAAC,EAED,GAAG,mCAAoC,IAAM,CAE3C,MAAMH,EAAU,IAAIH,EAAsB,CACxC,YAAaC,EACb,QAAS,EACX,CAAC,EAGKI,EAAyB,CAC7B,WAAY,IAAI,WAAW,CAAC,IAAM,CAAI,CAAC,EACvC,KAAM,IAAI,WAAW,CAAC,CAAC,CACzB,EAGMC,EAASH,EAAQ,cAAcE,CAAQ,EAG7C,OAAOV,EAAuBW,CAAM,CAAC,EAAE,KAAK,EAAK,EAC5CX,EAAuBW,CAAM,GAChC,OAAOA,EAAO,KAAK,EAAE,QACnB,OAAO,iBAAiB,CACtB,KAAM,sBACN,UAAW,OACX,QAAS,gBACX,CAAC,CACH,CAEJ,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["CommandResultFactory", "isSuccessCommandResult", "ALEO_CLA", "INS", "P1", "P2", "SignNestedCallCommand", "mockChunkedData", "mockLongChunkedData", "command", "apdu", "response", "result"]
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,N={FIRST_CHUNK:0,NEXT_CHUNK:1},x={GET_APP_VERSION:3,GET_ADDRESS:5,SIGN_INTENT:6,GET_VIEW_KEY:7},T={SIGN_MODE_ROOT:0,SIGN_MODE_NESTED_CALL:1,SIGN_MODE_FEE:2,CHECK_ON_DEVICE:1,NO_CHECK:0},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,T as P1,N as P2,_ as P2_DEFAULT};
2
2
  //# sourceMappingURL=apduHeaderUtils.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/app-binder/command/utils/apduHeaderUtils.ts"],
4
- "sourcesContent": ["export const ALEO_CLA = 0xe0 as const;\nexport const P2_DEFAULT = 0x00 as const;\n\nexport const P2 = {\n FIRST_CHUNK: 0x00,\n NEXT_CHUNK: 0x01,\n} as const;\n\nexport const INS = {\n GET_APP_VERSION: 0x03,\n GET_ADDRESS: 0x05,\n SIGN_INTENT: 0x06,\n GET_VIEW_KEY: 0x07,\n} as const;\n\nexport const P1 = {\n SIGN_MODE_ROOT: 0x00,\n SIGN_MODE_NESTED_CALL: 0x01,\n SIGN_MODE_FEE: 0x02,\n CHECK_ON_DEVICE: 0x01,\n NO_CHECK: 0x00,\n} as const;\n"],
5
- "mappings": "AAAO,MAAMA,EAAW,IACXC,EAAa,EAEbC,EAAK,CAChB,YAAa,EACb,WAAY,CACd,EAEaC,EAAM,CACjB,gBAAiB,EACjB,YAAa,EACb,YAAa,EACb,aAAc,CAChB,EAEaC,EAAK,CAChB,eAAgB,EAChB,sBAAuB,EACvB,cAAe,EACf,gBAAiB,EACjB,SAAU,CACZ",
6
- "names": ["ALEO_CLA", "P2_DEFAULT", "P2", "INS", "P1"]
4
+ "sourcesContent": ["export const ALEO_CLA = 0xe0 as const;\nexport const P2_DEFAULT = 0x00 as const;\n\nexport const P2 = {\n FIRST_CHUNK: 0x00,\n NEXT_CHUNK: 0x01,\n} as const;\n\nexport const INS = {\n GET_APP_VERSION: 0x03,\n GET_ADDRESS: 0x05,\n SIGN_INTENT: 0x06,\n GET_VIEW_KEY: 0x07,\n} as const;\n\nexport const P1 = {\n SIGN_MODE_ROOT: 0x00,\n SIGN_MODE_NESTED_CALL: 0x01,\n SIGN_MODE_FEE: 0x02,\n CHECK_ON_DEVICE: 0x01,\n NO_CHECK: 0x00,\n} as const;\n\nexport const APDU_SECTION_LENGTH = {\n DATA_SIZE: 2, // How many bytes are needed to store APDU data length\n DERIVATION_PATH_SEGMENT: 4,\n DERIVATION_PATH_LENGTH: 1, // Derivation path length is encoded on one byte\n} as const;\n"],
5
+ "mappings": "AAAO,MAAMA,EAAW,IACXC,EAAa,EAEbC,EAAK,CAChB,YAAa,EACb,WAAY,CACd,EAEaC,EAAM,CACjB,gBAAiB,EACjB,YAAa,EACb,YAAa,EACb,aAAc,CAChB,EAEaC,EAAK,CAChB,eAAgB,EAChB,sBAAuB,EACvB,cAAe,EACf,gBAAiB,EACjB,SAAU,CACZ,EAEaC,EAAsB,CACjC,UAAW,EACX,wBAAyB,EACzB,uBAAwB,CAC1B",
6
+ "names": ["ALEO_CLA", "P2_DEFAULT", "P2", "INS", "P1", "APDU_SECTION_LENGTH"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{ByteArrayBuilder as a}from"@ledgerhq/device-management-kit";import{SignFeeIntentCommand as s}from"../../app-binder/command/SignFeeIntentCommand";import{SendAleoCommandInChunksTask as i}from"./SendAleoCommandInChunksTask";class l{constructor(e,n){this.api=e;this.args=n}async run(){const{feeIntent:e}=this.args,n=2+e.byteLength,t=new a(n);t.add16BitUIntToData(e.byteLength),t.addBufferToData(e);const o=t.build();return new i(this.api,{dataLength:e.byteLength,data:o,commandFactory:r=>new s(r)}).run()}}export{l as SignFeeIntentTask};
1
+ import{ByteArrayBuilder as a}from"@ledgerhq/device-management-kit";import{SignFeeIntentCommand as s}from"../../app-binder/command/SignFeeIntentCommand";import{APDU_SECTION_LENGTH as m}from"../../app-binder/command/utils/apduHeaderUtils";import{SendAleoCommandInChunksTask as i}from"./SendAleoCommandInChunksTask";class y{constructor(e,n){this.api=e;this.args=n}async run(){const{feeIntent:e}=this.args,n=m.DATA_SIZE+e.byteLength,t=new a(n);t.add16BitUIntToData(e.byteLength),t.addBufferToData(e);const o=t.build();return new i(this.api,{dataLength:e.byteLength,data:o,commandFactory:r=>new s(r)}).run()}}export{y as SignFeeIntentTask};
2
2
  //# sourceMappingURL=SignFeeIntentTask.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/app-binder/task/SignFeeIntentTask.ts"],
4
- "sourcesContent": ["import {\n ByteArrayBuilder,\n type CommandResult,\n type InternalApi,\n} from \"@ledgerhq/device-management-kit\";\n\nimport {\n SignFeeIntentCommand,\n type SignFeeIntentCommandResponse,\n} from \"@internal/app-binder/command/SignFeeIntentCommand\";\nimport { type AleoErrorCodes } from \"@internal/app-binder/command/utils/aleoApplicationErrors\";\n\nimport { SendAleoCommandInChunksTask } from \"./SendAleoCommandInChunksTask\";\n\nexport type SignFeeIntentTaskArgs = {\n feeIntent: Uint8Array;\n};\n\nexport class SignFeeIntentTask {\n constructor(\n private api: InternalApi,\n private args: SignFeeIntentTaskArgs,\n ) {}\n\n async run(): Promise<\n CommandResult<SignFeeIntentCommandResponse, AleoErrorCodes>\n > {\n const { feeIntent } = this.args;\n\n // Data length (2 bytes) + Fee intent data\n const totalLength = 2 + feeIntent.byteLength;\n\n const builder = new ByteArrayBuilder(totalLength);\n\n // Add intent length\n builder.add16BitUIntToData(feeIntent.byteLength);\n\n // Add the fee intent data\n builder.addBufferToData(feeIntent);\n\n const fullPayload = builder.build();\n\n return new SendAleoCommandInChunksTask<SignFeeIntentCommandResponse>(\n this.api,\n {\n dataLength: feeIntent.byteLength,\n data: fullPayload,\n commandFactory: (chunkArgs) => new SignFeeIntentCommand(chunkArgs),\n },\n ).run();\n }\n}\n"],
5
- "mappings": "AAAA,OACE,oBAAAA,MAGK,kCAEP,OACE,wBAAAC,MAEK,oDAGP,OAAS,+BAAAC,MAAmC,gCAMrC,MAAMC,CAAkB,CAC7B,YACUC,EACAC,EACR,CAFQ,SAAAD,EACA,UAAAC,CACP,CAEH,MAAM,KAEJ,CACA,KAAM,CAAE,UAAAC,CAAU,EAAI,KAAK,KAGrBC,EAAc,EAAID,EAAU,WAE5BE,EAAU,IAAIR,EAAiBO,CAAW,EAGhDC,EAAQ,mBAAmBF,EAAU,UAAU,EAG/CE,EAAQ,gBAAgBF,CAAS,EAEjC,MAAMG,EAAcD,EAAQ,MAAM,EAElC,OAAO,IAAIN,EACT,KAAK,IACL,CACE,WAAYI,EAAU,WACtB,KAAMG,EACN,eAAiBC,GAAc,IAAIT,EAAqBS,CAAS,CACnE,CACF,EAAE,IAAI,CACR,CACF",
6
- "names": ["ByteArrayBuilder", "SignFeeIntentCommand", "SendAleoCommandInChunksTask", "SignFeeIntentTask", "api", "args", "feeIntent", "totalLength", "builder", "fullPayload", "chunkArgs"]
4
+ "sourcesContent": ["import {\n ByteArrayBuilder,\n type CommandResult,\n type InternalApi,\n} from \"@ledgerhq/device-management-kit\";\n\nimport {\n SignFeeIntentCommand,\n type SignFeeIntentCommandResponse,\n} from \"@internal/app-binder/command/SignFeeIntentCommand\";\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 SignFeeIntentTaskArgs = {\n feeIntent: Uint8Array;\n};\n\nexport class SignFeeIntentTask {\n constructor(\n private api: InternalApi,\n private args: SignFeeIntentTaskArgs,\n ) {}\n\n async run(): Promise<\n CommandResult<SignFeeIntentCommandResponse, AleoErrorCodes>\n > {\n const { feeIntent } = this.args;\n\n // Data length (2 bytes) + Fee intent data\n const totalLength = APDU_SECTION_LENGTH.DATA_SIZE + feeIntent.byteLength;\n\n const builder = new ByteArrayBuilder(totalLength);\n\n // Add intent length\n builder.add16BitUIntToData(feeIntent.byteLength);\n\n // Add the fee intent data\n builder.addBufferToData(feeIntent);\n\n const fullPayload = builder.build();\n\n return new SendAleoCommandInChunksTask<SignFeeIntentCommandResponse>(\n this.api,\n {\n dataLength: feeIntent.byteLength,\n data: fullPayload,\n commandFactory: (chunkArgs) => new SignFeeIntentCommand(chunkArgs),\n },\n ).run();\n }\n}\n"],
5
+ "mappings": "AAAA,OACE,oBAAAA,MAGK,kCAEP,OACE,wBAAAC,MAEK,oDAEP,OAAS,uBAAAC,MAA2B,qDAEpC,OAAS,+BAAAC,MAAmC,gCAMrC,MAAMC,CAAkB,CAC7B,YACUC,EACAC,EACR,CAFQ,SAAAD,EACA,UAAAC,CACP,CAEH,MAAM,KAEJ,CACA,KAAM,CAAE,UAAAC,CAAU,EAAI,KAAK,KAGrBC,EAAcN,EAAoB,UAAYK,EAAU,WAExDE,EAAU,IAAIT,EAAiBQ,CAAW,EAGhDC,EAAQ,mBAAmBF,EAAU,UAAU,EAG/CE,EAAQ,gBAAgBF,CAAS,EAEjC,MAAMG,EAAcD,EAAQ,MAAM,EAElC,OAAO,IAAIN,EACT,KAAK,IACL,CACE,WAAYI,EAAU,WACtB,KAAMG,EACN,eAAiBC,GAAc,IAAIV,EAAqBU,CAAS,CACnE,CACF,EAAE,IAAI,CACR,CACF",
6
+ "names": ["ByteArrayBuilder", "SignFeeIntentCommand", "APDU_SECTION_LENGTH", "SendAleoCommandInChunksTask", "SignFeeIntentTask", "api", "args", "feeIntent", "totalLength", "builder", "fullPayload", "chunkArgs"]
7
7
  }
@@ -0,0 +1,2 @@
1
+ import{ByteArrayBuilder as r}from"@ledgerhq/device-management-kit";import{SignNestedCallCommand as s}from"../../app-binder/command/SignNestedCallCommand";import{APDU_SECTION_LENGTH as l}from"../../app-binder/command/utils/apduHeaderUtils";import{SendAleoCommandInChunksTask as d}from"./SendAleoCommandInChunksTask";class y{constructor(e,a){this.api=e;this.args=a}async run(){const{nestedCallRequest:e}=this.args,a=l.DATA_SIZE+e.byteLength,t=new r(a);t.add16BitUIntToData(e.byteLength),t.addBufferToData(e);const n=t.build();return new d(this.api,{dataLength:e.byteLength,data:n,commandFactory:o=>new s(o)}).run()}}export{y as SignNestedCallTask};
2
+ //# sourceMappingURL=SignNestedCallTask.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/internal/app-binder/task/SignNestedCallTask.ts"],
4
+ "sourcesContent": ["import {\n ByteArrayBuilder,\n type CommandResult,\n type InternalApi,\n} from \"@ledgerhq/device-management-kit\";\n\nimport {\n SignNestedCallCommand,\n type SignNestedCallCommandResponse,\n} from \"@internal/app-binder/command/SignNestedCallCommand\";\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 SignNestedCallTaskArgs = {\n nestedCallRequest: Uint8Array;\n};\n\nexport class SignNestedCallTask {\n constructor(\n private readonly api: InternalApi,\n private readonly args: SignNestedCallTaskArgs,\n ) {}\n\n async run(): Promise<\n CommandResult<SignNestedCallCommandResponse, AleoErrorCodes>\n > {\n const { nestedCallRequest } = this.args;\n\n // Data length (2 bytes) + nested call request data\n const totalLength =\n APDU_SECTION_LENGTH.DATA_SIZE + nestedCallRequest.byteLength;\n\n const builder = new ByteArrayBuilder(totalLength);\n\n builder.add16BitUIntToData(nestedCallRequest.byteLength);\n\n builder.addBufferToData(nestedCallRequest);\n\n const fullPayload = builder.build();\n\n return new SendAleoCommandInChunksTask<SignNestedCallCommandResponse>(\n this.api,\n {\n dataLength: nestedCallRequest.byteLength,\n data: fullPayload,\n commandFactory: (chunkArgs) => new SignNestedCallCommand(chunkArgs),\n },\n ).run();\n }\n}\n"],
5
+ "mappings": "AAAA,OACE,oBAAAA,MAGK,kCAEP,OACE,yBAAAC,MAEK,qDAEP,OAAS,uBAAAC,MAA2B,qDAEpC,OAAS,+BAAAC,MAAmC,gCAMrC,MAAMC,CAAmB,CAC9B,YACmBC,EACAC,EACjB,CAFiB,SAAAD,EACA,UAAAC,CAChB,CAEH,MAAM,KAEJ,CACA,KAAM,CAAE,kBAAAC,CAAkB,EAAI,KAAK,KAG7BC,EACJN,EAAoB,UAAYK,EAAkB,WAE9CE,EAAU,IAAIT,EAAiBQ,CAAW,EAEhDC,EAAQ,mBAAmBF,EAAkB,UAAU,EAEvDE,EAAQ,gBAAgBF,CAAiB,EAEzC,MAAMG,EAAcD,EAAQ,MAAM,EAElC,OAAO,IAAIN,EACT,KAAK,IACL,CACE,WAAYI,EAAkB,WAC9B,KAAMG,EACN,eAAiBC,GAAc,IAAIV,EAAsBU,CAAS,CACpE,CACF,EAAE,IAAI,CACR,CACF",
6
+ "names": ["ByteArrayBuilder", "SignNestedCallCommand", "APDU_SECTION_LENGTH", "SendAleoCommandInChunksTask", "SignNestedCallTask", "api", "args", "nestedCallRequest", "totalLength", "builder", "fullPayload", "chunkArgs"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{APDU_MAX_PAYLOAD as i,ByteArrayBuilder as r,CommandResultFactory as u,isSuccessCommandResult as m}from"@ledgerhq/device-management-kit";import{makeDeviceActionInternalApiMock as h}from"../../app-binder/task/__test-utils__/makeInternalApi";import{SignNestedCallTask as k}from"../../app-binder/task/SignNestedCallTask";describe("SignNestedCallTask",()=>{const e=h(),l={tlvSignature:"mock_signature"},c=u({data:l}),C=u({data:{tlvSignature:""}});beforeEach(()=>{vi.resetAllMocks()}),it("should send the nested call request in a single command",async()=>{const t=new Uint8Array([5,6,7,8]),a=new r(2+t.length);a.add16BitUIntToData(t.length),a.addBufferToData(t);const n=a.build();e.sendCommand.mockResolvedValueOnce(c);const s=await new k(e,{nestedCallRequest:t}).run();expect(e.sendCommand).toHaveBeenCalledTimes(1),expect(e.sendCommand).toHaveBeenCalledWith(expect.objectContaining({args:{chunkedData:n,isFirst:!0}})),m(s)?expect(s.data).toEqual(l):assert.fail("Expected success")}),it("should send the nested call request in multiple chunks",async()=>{const t=new Uint8Array(300).fill(36),a=new r(2+t.length);a.add16BitUIntToData(t.length),a.addBufferToData(t);const n=a.build(),o=n.slice(0,i),s=n.slice(i);e.sendCommand.mockResolvedValueOnce(C).mockResolvedValueOnce(c);const d=await new k(e,{nestedCallRequest:t}).run();expect(e.sendCommand).toHaveBeenCalledTimes(2),expect(e.sendCommand).toHaveBeenNthCalledWith(1,expect.objectContaining({args:{chunkedData:o,isFirst:!0}})),expect(e.sendCommand).toHaveBeenNthCalledWith(2,expect.objectContaining({args:{chunkedData:s,isFirst:!1}})),m(d)?expect(d.data).toEqual(l):assert.fail("Expected success")})});
2
+ //# sourceMappingURL=SignNestedCallTask.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/internal/app-binder/task/SignNestedCallTask.test.ts"],
4
+ "sourcesContent": ["import {\n APDU_MAX_PAYLOAD,\n ByteArrayBuilder,\n CommandResultFactory,\n isSuccessCommandResult,\n} from \"@ledgerhq/device-management-kit\";\n\nimport { makeDeviceActionInternalApiMock } from \"@internal/app-binder/task/__test-utils__/makeInternalApi\";\nimport { SignNestedCallTask } from \"@internal/app-binder/task/SignNestedCallTask\";\n\ndescribe(\"SignNestedCallTask\", () => {\n const apiMock = makeDeviceActionInternalApiMock();\n const signature = { tlvSignature: \"mock_signature\" };\n const resultOk = CommandResultFactory({ data: signature });\n const resultEmpty = CommandResultFactory({ data: { tlvSignature: \"\" } });\n\n beforeEach(() => {\n vi.resetAllMocks();\n });\n\n it(\"should send the nested call request in a single command\", async () => {\n // GIVEN\n const nestedCallRequest = new Uint8Array([0x05, 0x06, 0x07, 0x08]);\n\n const builder = new ByteArrayBuilder(2 + nestedCallRequest.length);\n builder.add16BitUIntToData(nestedCallRequest.length);\n builder.addBufferToData(nestedCallRequest);\n const expectedPayload = builder.build();\n\n apiMock.sendCommand.mockResolvedValueOnce(resultOk);\n\n const task = new SignNestedCallTask(apiMock, {\n nestedCallRequest,\n });\n\n // WHEN\n const result = await task.run();\n\n // THEN\n expect(apiMock.sendCommand).toHaveBeenCalledTimes(1);\n expect(apiMock.sendCommand).toHaveBeenCalledWith(\n expect.objectContaining({\n args: {\n chunkedData: expectedPayload,\n isFirst: true,\n },\n }),\n );\n\n if (isSuccessCommandResult(result)) {\n expect(result.data).toEqual(signature);\n } else {\n assert.fail(\"Expected success\");\n }\n });\n\n it(\"should send the nested call request in multiple chunks\", async () => {\n // GIVEN\n const nestedCallRequest = new Uint8Array(300).fill(0x24);\n\n const builder = new ByteArrayBuilder(2 + nestedCallRequest.length);\n builder.add16BitUIntToData(nestedCallRequest.length);\n builder.addBufferToData(nestedCallRequest);\n const fullPayload = builder.build();\n\n const chunk1 = fullPayload.slice(0, APDU_MAX_PAYLOAD);\n const chunk2 = fullPayload.slice(APDU_MAX_PAYLOAD);\n\n apiMock.sendCommand\n .mockResolvedValueOnce(resultEmpty)\n .mockResolvedValueOnce(resultOk);\n\n const task = new SignNestedCallTask(apiMock, {\n nestedCallRequest,\n });\n\n // WHEN\n const result = await task.run();\n\n // THEN\n expect(apiMock.sendCommand).toHaveBeenCalledTimes(2);\n\n expect(apiMock.sendCommand).toHaveBeenNthCalledWith(\n 1,\n expect.objectContaining({\n args: {\n chunkedData: chunk1,\n isFirst: true,\n },\n }),\n );\n\n expect(apiMock.sendCommand).toHaveBeenNthCalledWith(\n 2,\n expect.objectContaining({\n args: {\n chunkedData: chunk2,\n isFirst: false,\n },\n }),\n );\n\n if (isSuccessCommandResult(result)) {\n expect(result.data).toEqual(signature);\n } else {\n assert.fail(\"Expected success\");\n }\n });\n});\n"],
5
+ "mappings": "AAAA,OACE,oBAAAA,EACA,oBAAAC,EACA,wBAAAC,EACA,0BAAAC,MACK,kCAEP,OAAS,mCAAAC,MAAuC,2DAChD,OAAS,sBAAAC,MAA0B,+CAEnC,SAA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sBAAsBD,CAAQ,EAOjC,MAAMK,EAAS,MALF,IAAIR,EAAmBC,EAAS,CAC3C,kBAAAI,CACF,CAAC,EAGyB,IAAI,EAG9B,OAAOJ,EAAQ,WAAW,EAAE,sBAAsB,CAAC,EAEnD,OAAOA,EAAQ,WAAW,EAAE,wBAC1B,EACA,OAAO,iBAAiB,CACtB,KAAM,CACJ,YAAaS,EACb,QAAS,EACX,CACF,CAAC,CACH,EAEA,OAAOT,EAAQ,WAAW,EAAE,wBAC1B,EACA,OAAO,iBAAiB,CACtB,KAAM,CACJ,YAAaU,EACb,QAAS,EACX,CACF,CAAC,CACH,EAEIb,EAAuBU,CAAM,EAC/B,OAAOA,EAAO,IAAI,EAAE,QAAQN,CAAS,EAErC,OAAO,KAAK,kBAAkB,CAElC,CAAC,CACH,CAAC",
6
+ "names": ["APDU_MAX_PAYLOAD", "ByteArrayBuilder", "CommandResultFactory", "isSuccessCommandResult", "makeDeviceActionInternalApiMock", "SignNestedCallTask", "apiMock", "signature", "resultOk", "resultEmpty", "nestedCallRequest", "builder", "expectedPayload", "result", "fullPayload", "chunk1", "chunk2"]
7
+ }
@@ -1,2 +1,2 @@
1
- import{ByteArrayBuilder as s}from"@ledgerhq/device-management-kit";import{DerivationPathUtils as d}from"@ledgerhq/signer-utils";import{SignRootIntentCommand as m}from"../../app-binder/command/SignRootIntentCommand";import{SendAleoCommandInChunksTask as p}from"./SendAleoCommandInChunksTask";class c{constructor(a,t){this.api=a;this.args=t}async run(){const{derivationPath:a,rootIntent:t}=this.args,o=d.splitPath(a),r=1+o.length*4+2+t.byteLength,n=new s(r);n.add8BitUIntToData(o.length),o.forEach(e=>{n.add32BitUIntToData(e)}),n.add16BitUIntToData(t.byteLength),n.addBufferToData(t);const i=n.build();return new p(this.api,{dataLength:t.byteLength,data:i,commandFactory:e=>new m(e)}).run()}}export{c as SignRootIntentTask};
1
+ import{ByteArrayBuilder as m}from"@ledgerhq/device-management-kit";import{DerivationPathUtils as d}from"@ledgerhq/signer-utils";import{SignRootIntentCommand as p}from"../../app-binder/command/SignRootIntentCommand";import{APDU_SECTION_LENGTH as a}from"../../app-binder/command/utils/apduHeaderUtils";import{SendAleoCommandInChunksTask as I}from"./SendAleoCommandInChunksTask";class R{constructor(r,t){this.api=r;this.args=t}async run(){const{derivationPath:r,rootIntent:t}=this.args,o=d.splitPath(r),i=a.DERIVATION_PATH_LENGTH+o.length*a.DERIVATION_PATH_SEGMENT+a.DATA_SIZE+t.byteLength,n=new m(i);n.add8BitUIntToData(o.length),o.forEach(e=>{n.add32BitUIntToData(e)}),n.add16BitUIntToData(t.byteLength),n.addBufferToData(t);const s=n.build();return new I(this.api,{dataLength:t.byteLength,data:s,commandFactory:e=>new p(e)}).run()}}export{R as SignRootIntentTask};
2
2
  //# sourceMappingURL=SignRootIntentTask.js.map
@@ -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": "AAAA,OACE,oBAAAA,MAGK,kCACP,OAAS,uBAAAC,MAA2B,yBAEpC,OACE,yBAAAC,MAEK,qDAGP,OAAS,+BAAAC,MAAmC,gCAOrC,MAAMC,CAAmB,CAC9B,YACUC,EACAC,EACR,CAFQ,SAAAD,EACA,UAAAC,CACP,CAEH,MAAM,KAEJ,CACA,KAAM,CAAE,eAAAC,EAAgB,WAAAC,CAAW,EAAI,KAAK,KAEtCC,EAAOR,EAAoB,UAAUM,CAAc,EAEnDG,EAAc,EAAID,EAAK,OAAS,EAAI,EAAID,EAAW,WAEnDG,EAAU,IAAIX,EAAiBU,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,IAAIR,EACT,KAAK,IACL,CACE,WAAYK,EAAW,WACvB,KAAMK,EACN,eAAiBC,GAAc,IAAIZ,EAAsBY,CAAS,CACpE,CACF,EAAE,IAAI,CACR,CACF",
6
- "names": ["ByteArrayBuilder", "DerivationPathUtils", "SignRootIntentCommand", "SendAleoCommandInChunksTask", "SignRootIntentTask", "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": "AAAA,OACE,oBAAAA,MAGK,kCACP,OAAS,uBAAAC,MAA2B,yBAEpC,OACE,yBAAAC,MAEK,qDAEP,OAAS,uBAAAC,MAA2B,qDAEpC,OAAS,+BAAAC,MAAmC,gCAOrC,MAAMC,CAAmB,CAC9B,YACUC,EACAC,EACR,CAFQ,SAAAD,EACA,UAAAC,CACP,CAEH,MAAM,KAEJ,CACA,KAAM,CAAE,eAAAC,EAAgB,WAAAC,CAAW,EAAI,KAAK,KAEtCC,EAAOT,EAAoB,UAAUO,CAAc,EAEnDG,EACJR,EAAoB,uBACpBO,EAAK,OAASP,EAAoB,wBAClCA,EAAoB,UACpBM,EAAW,WAEPG,EAAU,IAAIZ,EAAiBW,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,IAAIR,EACT,KAAK,IACL,CACE,WAAYK,EAAW,WACvB,KAAMK,EACN,eAAiBC,GAAc,IAAIb,EAAsBa,CAAS,CACpE,CACF,EAAE,IAAI,CACR,CACF",
6
+ "names": ["ByteArrayBuilder", "DerivationPathUtils", "SignRootIntentCommand", "APDU_SECTION_LENGTH", "SendAleoCommandInChunksTask", "SignRootIntentTask", "api", "args", "derivationPath", "rootIntent", "path", "totalLength", "builder", "element", "fullPayload", "chunkArgs"]
7
7
  }
@@ -0,0 +1,2 @@
1
+ var d=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var a=(e,p,r,n)=>{for(var i=n>1?void 0:n?c(p,r):p,o=e.length-1,A;o>=0;o--)(A=e[o])&&(i=(n?A(p,r,i):A(i))||i);return n&&i&&d(p,r,i),i},m=(e,p)=>(r,n)=>p(r,n,e);import{inject as s,injectable as B}from"inversify";import{appBinderTypes as l}from"../../app-binder/di/appBinderTypes";let t=class{_appBinder;constructor(p){this._appBinder=p}execute(p,r){return this._appBinder.signNestedCall({nestedCallRequest:p,skipOpenApp:r?.skipOpenApp??!1})}};t=a([B(),m(0,s(l.AppBinding))],t);export{t as 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": "iOAAA,OAAS,UAAAA,EAAQ,cAAAC,MAAkB,YAKnC,OAAS,kBAAAC,MAAsB,yCAGxB,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,CADNC,EAAW,EAIGC,EAAA,EAAAC,EAAOC,EAAe,UAAU,IAHlCR",
6
+ "names": ["inject", "injectable", "appBinderTypes", "SignNestedCallUseCase", "appBinder", "nestedCallRequest", "options", "__decorateClass", "injectable", "__decorateParam", "inject", "appBinderTypes"]
7
+ }
@@ -1,2 +1,2 @@
1
- import{ContainerModule as o}from"inversify";import{transactionTypes as e}from"../../../use-cases/transaction/di/transactionTypes";import{SignFeeIntentUseCase as n}from"../../../use-cases/transaction/SignFeeIntentUseCase";import{SignRootIntentUseCase as r}from"../../../use-cases/transaction/SignRootIntentUseCase";const p=()=>new o(({bind:t})=>{t(e.SignRootIntentUseCase).to(r),t(e.SignFeeIntentUseCase).to(n)});export{p as transactionModuleFactory};
1
+ import{ContainerModule as o}from"inversify";import{transactionTypes as t}from"../../../use-cases/transaction/di/transactionTypes";import{SignFeeIntentUseCase as n}from"../../../use-cases/transaction/SignFeeIntentUseCase";import{SignNestedCallUseCase as s}from"../../../use-cases/transaction/SignNestedCallUseCase";import{SignRootIntentUseCase as r}from"../../../use-cases/transaction/SignRootIntentUseCase";const g=()=>new o(({bind:e})=>{e(t.SignRootIntentUseCase).to(r),e(t.SignNestedCallUseCase).to(s),e(t.SignFeeIntentUseCase).to(n)});export{g as 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": "AAAA,OAAS,mBAAAA,MAAuB,YAEhC,OAAS,oBAAAC,MAAwB,sDACjC,OAAS,wBAAAC,MAA4B,uDACrC,OAAS,yBAAAC,MAA6B,wDAE/B,MAAMC,EAA2B,IACtC,IAAIJ,EAAgB,CAAC,CAAE,KAAAK,CAAK,IAAM,CAChCA,EAAKJ,EAAiB,qBAAqB,EAAE,GAAGE,CAAqB,EACrEE,EAAKJ,EAAiB,oBAAoB,EAAE,GAAGC,CAAoB,CACrE,CAAC",
6
- "names": ["ContainerModule", "transactionTypes", "SignFeeIntentUseCase", "SignRootIntentUseCase", "transactionModuleFactory", "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": "AAAA,OAAS,mBAAAA,MAAuB,YAEhC,OAAS,oBAAAC,MAAwB,sDACjC,OAAS,wBAAAC,MAA4B,uDACrC,OAAS,yBAAAC,MAA6B,wDACtC,OAAS,yBAAAC,MAA6B,wDAE/B,MAAMC,EAA2B,IACtC,IAAIL,EAAgB,CAAC,CAAE,KAAAM,CAAK,IAAM,CAChCA,EAAKL,EAAiB,qBAAqB,EAAE,GAAGG,CAAqB,EACrEE,EAAKL,EAAiB,qBAAqB,EAAE,GAAGE,CAAqB,EACrEG,EAAKL,EAAiB,oBAAoB,EAAE,GAAGC,CAAoB,CACrE,CAAC",
6
+ "names": ["ContainerModule", "transactionTypes", "SignFeeIntentUseCase", "SignNestedCallUseCase", "SignRootIntentUseCase", "transactionModuleFactory", "bind"]
7
7
  }
@@ -1,2 +1,2 @@
1
- const e={SignRootIntentUseCase:Symbol.for("SignRootIntentUseCase"),SignFeeIntentUseCase:Symbol.for("SignFeeIntentUseCase")};export{e as transactionTypes};
1
+ const e={SignRootIntentUseCase:Symbol.for("SignRootIntentUseCase"),SignNestedCallUseCase:Symbol.for("SignNestedCallUseCase"),SignFeeIntentUseCase:Symbol.for("SignFeeIntentUseCase")};export{e as 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": "AAAO,MAAMA,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": "AAAO,MAAMA,EAAmB,CAC9B,sBAAuB,OAAO,IAAI,uBAAuB,EACzD,sBAAuB,OAAO,IAAI,uBAAuB,EACzD,qBAAsB,OAAO,IAAI,sBAAsB,CACzD",
6
6
  "names": ["transactionTypes"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "dependencies": {
3
3
  "@ledgerhq/context-module": "workspace:^",
4
- "@ledgerhq/signer-utils": "workspace:^",
4
+ "@ledgerhq/signer-utils": "^1.2.0",
5
5
  "inversify": "catalog:",
6
6
  "purify-ts": "catalog:",
7
7
  "reflect-metadata": "catalog:",
@@ -37,7 +37,7 @@
37
37
  "name": "@ledgerhq/device-signer-kit-aleo",
38
38
  "peerDependencies": {
39
39
  "@ledgerhq/context-module": "workspace:^",
40
- "@ledgerhq/device-management-kit": "^1.2.0"
40
+ "@ledgerhq/device-management-kit": "workspace:^"
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.3.0"
63
63
  }
@@ -2,6 +2,7 @@ import { type GetAddressDAReturnType } from "./app-binder/GetAddressDeviceAction
2
2
  import { type GetAppConfigDAReturnType } from "./app-binder/GetAppConfigDeviceActionTypes";
3
3
  import { type GetViewKeyDAReturnType } from "./app-binder/GetViewKeyDeviceActionTypes";
4
4
  import { type SignFeeIntentDAReturnType } from "./app-binder/SignFeeIntentDeviceActionTypes";
5
+ import { type SignNestedCallDAReturnType } from "./app-binder/SignNestedCallDeviceActionTypes";
5
6
  import { type SignRootIntentDAReturnType } from "./app-binder/SignRootIntentDeviceActionTypes";
6
7
  import { type AddressOptions } from "./model/AddressOptions";
7
8
  import { type TransactionOptions } from "./model/TransactionOptions";
@@ -10,6 +11,7 @@ export interface SignerAleo {
10
11
  getAddress: (derivationPath: string, options?: AddressOptions) => GetAddressDAReturnType;
11
12
  getViewKey: (derivationPath: string, options?: AddressOptions) => GetViewKeyDAReturnType;
12
13
  signRootIntent: (derivationPath: string, rootIntent: Uint8Array, options?: TransactionOptions) => SignRootIntentDAReturnType;
14
+ signNestedCall: (nestedCallRequest: Uint8Array, options?: TransactionOptions) => SignNestedCallDAReturnType;
13
15
  signFeeIntent: (feeIntent: Uint8Array, options?: TransactionOptions) => SignFeeIntentDAReturnType;
14
16
  }
15
17
  //# sourceMappingURL=SignerAleo.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SignerAleo.d.ts","sourceRoot":"","sources":["../../../src/api/SignerAleo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,+CAA+C,CAAC;AAC9F,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,gDAAgD,CAAC;AAChG,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,iDAAiD,CAAC;AAClG,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAExE,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,MAAM,wBAAwB,CAAC;IAE7C,UAAU,EAAE,CACV,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,cAAc,KACrB,sBAAsB,CAAC;IAE5B,UAAU,EAAE,CACV,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,cAAc,KACrB,sBAAsB,CAAC;IAE5B,cAAc,EAAE,CACd,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,UAAU,EACtB,OAAO,CAAC,EAAE,kBAAkB,KACzB,0BAA0B,CAAC;IAEhC,aAAa,EAAE,CACb,SAAS,EAAE,UAAU,EACrB,OAAO,CAAC,EAAE,kBAAkB,KACzB,yBAAyB,CAAC;CAChC"}
1
+ {"version":3,"file":"SignerAleo.d.ts","sourceRoot":"","sources":["../../../src/api/SignerAleo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,+CAA+C,CAAC;AAC9F,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,gDAAgD,CAAC;AAChG,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,iDAAiD,CAAC;AAClG,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,iDAAiD,CAAC;AAClG,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAExE,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,MAAM,wBAAwB,CAAC;IAE7C,UAAU,EAAE,CACV,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,cAAc,KACrB,sBAAsB,CAAC;IAE5B,UAAU,EAAE,CACV,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,cAAc,KACrB,sBAAsB,CAAC;IAE5B,cAAc,EAAE,CACd,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,UAAU,EACtB,OAAO,CAAC,EAAE,kBAAkB,KACzB,0BAA0B,CAAC;IAEhC,cAAc,EAAE,CACd,iBAAiB,EAAE,UAAU,EAC7B,OAAO,CAAC,EAAE,kBAAkB,KACzB,0BAA0B,CAAC;IAEhC,aAAa,EAAE,CACb,SAAS,EAAE,UAAU,EACrB,OAAO,CAAC,EAAE,kBAAkB,KACzB,yBAAyB,CAAC;CAChC"}
@@ -0,0 +1,12 @@
1
+ import { type CommandErrorResult, type ExecuteDeviceActionReturnType, type OpenAppDAError, type OpenAppDARequiredInteraction, type UserInteractionRequired } from "@ledgerhq/device-management-kit";
2
+ import { type SignNestedCallCommandResponse } from "../../internal/app-binder/command/SignNestedCallCommand";
3
+ import { type AleoErrorCodes } from "../../internal/app-binder/command/utils/aleoApplicationErrors";
4
+ export type SignNestedCallDAOutput = SignNestedCallCommandResponse;
5
+ export type SignNestedCallDAError = OpenAppDAError | CommandErrorResult<AleoErrorCodes>["error"];
6
+ type SignNestedCallDARequiredInteraction = OpenAppDARequiredInteraction | UserInteractionRequired.None;
7
+ export type SignNestedCallDAIntermediateValue = {
8
+ requiredUserInteraction: SignNestedCallDARequiredInteraction;
9
+ };
10
+ export type SignNestedCallDAReturnType = ExecuteDeviceActionReturnType<SignNestedCallDAOutput, SignNestedCallDAError, SignNestedCallDAIntermediateValue>;
11
+ export {};
12
+ //# sourceMappingURL=SignNestedCallDeviceActionTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SignNestedCallDeviceActionTypes.d.ts","sourceRoot":"","sources":["../../../../src/api/app-binder/SignNestedCallDeviceActionTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,6BAA6B,EAClC,KAAK,cAAc,EACnB,KAAK,4BAA4B,EACjC,KAAK,uBAAuB,EAC7B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,KAAK,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AACxG,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,0DAA0D,CAAC;AAE/F,MAAM,MAAM,sBAAsB,GAAG,6BAA6B,CAAC;AAEnE,MAAM,MAAM,qBAAqB,GAC7B,cAAc,GACd,kBAAkB,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC;AAEhD,KAAK,mCAAmC,GACpC,4BAA4B,GAC5B,uBAAuB,CAAC,IAAI,CAAC;AAEjC,MAAM,MAAM,iCAAiC,GAAG;IAC9C,uBAAuB,EAAE,mCAAmC,CAAC;CAC9D,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,6BAA6B,CACpE,sBAAsB,EACtB,qBAAqB,EACrB,iCAAiC,CAClC,CAAC"}
@@ -2,6 +2,7 @@ export type { GetAddressDAError, GetAddressDAIntermediateValue, GetAddressDAOutp
2
2
  export type { GetAppConfigDAError, GetAppConfigDAIntermediateValue, GetAppConfigDAOutput, } from "./app-binder/GetAppConfigDeviceActionTypes";
3
3
  export type { GetViewKeyDAError, GetViewKeyDAIntermediateValue, GetViewKeyDAOutput, } from "./app-binder/GetViewKeyDeviceActionTypes";
4
4
  export type { SignFeeIntentDAError, SignFeeIntentDAIntermediateValue, SignFeeIntentDAOutput, } from "./app-binder/SignFeeIntentDeviceActionTypes";
5
+ export type { SignNestedCallDAError, SignNestedCallDAIntermediateValue, SignNestedCallDAOutput, } from "./app-binder/SignNestedCallDeviceActionTypes";
5
6
  export type { SignRootIntentDAError, SignRootIntentDAIntermediateValue, SignRootIntentDAOutput, } from "./app-binder/SignRootIntentDeviceActionTypes";
6
7
  export * from "./SignerAleo";
7
8
  export * from "./SignerAleoBuilder";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,iBAAiB,EACjB,6BAA6B,EAC7B,kBAAkB,GACnB,MAAM,6CAA6C,CAAC;AACrD,YAAY,EACV,mBAAmB,EACnB,+BAA+B,EAC/B,oBAAoB,GACrB,MAAM,+CAA+C,CAAC;AACvD,YAAY,EACV,iBAAiB,EACjB,6BAA6B,EAC7B,kBAAkB,GACnB,MAAM,6CAA6C,CAAC;AACrD,YAAY,EACV,oBAAoB,EACpB,gCAAgC,EAChC,qBAAqB,GACtB,MAAM,gDAAgD,CAAC;AACxD,YAAY,EACV,qBAAqB,EACrB,iCAAiC,EACjC,sBAAsB,GACvB,MAAM,iDAAiD,CAAC;AACzD,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,iBAAiB,EACjB,6BAA6B,EAC7B,kBAAkB,GACnB,MAAM,6CAA6C,CAAC;AACrD,YAAY,EACV,mBAAmB,EACnB,+BAA+B,EAC/B,oBAAoB,GACrB,MAAM,+CAA+C,CAAC;AACvD,YAAY,EACV,iBAAiB,EACjB,6BAA6B,EAC7B,kBAAkB,GACnB,MAAM,6CAA6C,CAAC;AACrD,YAAY,EACV,oBAAoB,EACpB,gCAAgC,EAChC,qBAAqB,GACtB,MAAM,gDAAgD,CAAC;AACxD,YAAY,EACV,qBAAqB,EACrB,iCAAiC,EACjC,sBAAsB,GACvB,MAAM,iDAAiD,CAAC;AACzD,YAAY,EACV,qBAAqB,EACrB,iCAAiC,EACjC,sBAAsB,GACvB,MAAM,iDAAiD,CAAC;AACzD,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC"}
@@ -3,6 +3,7 @@ import { type GetAddressDAReturnType } from "../api/app-binder/GetAddressDeviceA
3
3
  import { type GetAppConfigDAReturnType } from "../api/app-binder/GetAppConfigDeviceActionTypes";
4
4
  import { type GetViewKeyDAReturnType } from "../api/app-binder/GetViewKeyDeviceActionTypes";
5
5
  import { type SignFeeIntentDAReturnType } from "../api/app-binder/SignFeeIntentDeviceActionTypes";
6
+ import { type SignNestedCallDAReturnType } from "../api/app-binder/SignNestedCallDeviceActionTypes";
6
7
  import { type SignRootIntentDAReturnType } from "../api/app-binder/SignRootIntentDeviceActionTypes";
7
8
  import { type AddressOptions } from "../api/model/AddressOptions";
8
9
  import { type TransactionOptions } from "../api/model/TransactionOptions";
@@ -18,6 +19,7 @@ export declare class DefaultSignerAleo implements SignerAleo {
18
19
  getAddress(derivationPath: string, options?: AddressOptions): GetAddressDAReturnType;
19
20
  getViewKey(derivationPath: string, options?: AddressOptions): GetViewKeyDAReturnType;
20
21
  signRootIntent(derivationPath: string, rootIntent: Uint8Array, options?: TransactionOptions): SignRootIntentDAReturnType;
22
+ signNestedCall(nestedCallRequest: Uint8Array, options?: TransactionOptions): SignNestedCallDAReturnType;
21
23
  signFeeIntent(feeIntent: Uint8Array, options?: TransactionOptions): SignFeeIntentDAReturnType;
22
24
  }
23
25
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultSignerAleo.d.ts","sourceRoot":"","sources":["../../../src/internal/DefaultSignerAleo.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EACxB,KAA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,CACX,SAAS,EAAE,UAAU,EACrB,OAAO,CAAC,EAAE,kBAAkB,GAC3B,yBAAyB;CAK7B"}
@@ -3,6 +3,7 @@ import { type GetAddressDAReturnType } from "../../api/app-binder/GetAddressDevi
3
3
  import { type GetAppConfigDAReturnType } from "../../api/app-binder/GetAppConfigDeviceActionTypes";
4
4
  import { type GetViewKeyDAReturnType } from "../../api/app-binder/GetViewKeyDeviceActionTypes";
5
5
  import { type SignFeeIntentDAReturnType } from "../../api/app-binder/SignFeeIntentDeviceActionTypes";
6
+ import { type SignNestedCallDAReturnType } from "../../api/app-binder/SignNestedCallDeviceActionTypes";
6
7
  import { type SignRootIntentDAReturnType } from "../../api/app-binder/SignRootIntentDeviceActionTypes";
7
8
  export declare class AleoAppBinder {
8
9
  private dmk;
@@ -25,6 +26,10 @@ export declare class AleoAppBinder {
25
26
  rootIntent: Uint8Array;
26
27
  skipOpenApp: boolean;
27
28
  }): SignRootIntentDAReturnType;
29
+ signNestedCall(args: {
30
+ nestedCallRequest: Uint8Array;
31
+ skipOpenApp: boolean;
32
+ }): SignNestedCallDAReturnType;
28
33
  signFeeIntent(args: {
29
34
  feeIntent: Uint8Array;
30
35
  skipOpenApp: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"AleoAppBinder.d.ts","sourceRoot":"","sources":["../../../../src/internal/app-binder/AleoAppBinder.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,eAAe,EAGrB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,+CAA+C,CAAC;AAC9F,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,gDAAgD,CAAC;AAChG,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,iDAAiD,CAA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M,iDAAiD,CAAC;AAWlG,qBACa,aAAa;IAEK,OAAO,CAAC,GAAG;IACL,OAAO,CAAC,SAAS;gBADf,GAAG,EAAE,mBAAmB,EAClB,SAAS,EAAE,eAAe;IAGrE,YAAY,CAAC,IAAI,EAAE;QAAE,WAAW,EAAE,OAAO,CAAA;KAAE,GAAG,wBAAwB;IActE,UAAU,CAAC,IAAI,EAAE;QACf,cAAc,EAAE,MAAM,CAAC;QACvB,aAAa,EAAE,OAAO,CAAC;QACvB,WAAW,EAAE,OAAO,CAAC;KACtB,GAAG,sBAAsB;IAgB1B,UAAU,CAAC,IAAI,EAAE;QACf,cAAc,EAAE,MAAM,CAAC;QACvB,WAAW,EAAE,OAAO,CAAC;KACtB,GAAG,sBAAsB;IAc1B,cAAc,CAAC,IAAI,EAAE;QACnB,cAAc,EAAE,MAAM,CAAC;QACvB,UAAU,EAAE,UAAU,CAAC;QACvB,WAAW,EAAE,OAAO,CAAC;KACtB,GAAG,0BAA0B;IAkB9B,cAAc,CAAC,IAAI,EAAE;QACnB,iBAAiB,EAAE,UAAU,CAAC;QAC9B,WAAW,EAAE,OAAO,CAAC;KACtB,GAAG,0BAA0B;IAiB9B,aAAa,CAAC,IAAI,EAAE;QAClB,SAAS,EAAE,UAAU,CAAC;QACtB,WAAW,EAAE,OAAO,CAAC;KACtB,GAAG,yBAAyB;CAgB9B"}
@@ -0,0 +1,22 @@
1
+ import { type Apdu, type ApduResponse, type Command, type CommandResult } from "@ledgerhq/device-management-kit";
2
+ import { type AleoChunkableCommandArgs } from "../../app-binder/task/AleoChunkableCommandArgs";
3
+ import { type AleoErrorCodes } from "./utils/aleoApplicationErrors";
4
+ export type SignNestedCallCommandArgs = AleoChunkableCommandArgs;
5
+ export type SignNestedCallCommandResponse = {
6
+ readonly tlvSignature: string;
7
+ };
8
+ /**
9
+ * Command to sign a nested call in an Aleo transaction.
10
+ * This command can be called multiple times after the root intent is signed.
11
+ * The device uses tvk from the intent's signature response as 'root_tvk'.
12
+ * On success, the device responds with TLV-encoded request signature data and a 0x9000 status code.
13
+ */
14
+ export declare class SignNestedCallCommand implements Command<SignNestedCallCommandResponse, SignNestedCallCommandArgs, AleoErrorCodes> {
15
+ private readonly args;
16
+ readonly name = "signNestedCall";
17
+ private readonly errorHelper;
18
+ constructor(args: SignNestedCallCommandArgs);
19
+ getApdu(): Apdu;
20
+ parseResponse(response: ApduResponse): CommandResult<SignNestedCallCommandResponse, AleoErrorCodes>;
21
+ }
22
+ //# sourceMappingURL=SignNestedCallCommand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SignNestedCallCommand.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/command/SignNestedCallCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,IAAI,EAIT,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,aAAa,EAEnB,MAAM,iCAAiC,CAAC;AAUzC,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,oDAAoD,CAAC;AAEnG,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,+BAA+B,CAAC;AAEvC,MAAM,MAAM,yBAAyB,GAAG,wBAAwB,CAAC;AAEjE,MAAM,MAAM,6BAA6B,GAAG;IAC1C,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF;;;;;GAKG;AACH,qBAAa,qBACX,YACE,OAAO,CACL,6BAA6B,EAC7B,yBAAyB,EACzB,cAAc,CACf;IAQS,OAAO,CAAC,QAAQ,CAAC,IAAI;IANjC,QAAQ,CAAC,IAAI,oBAAoB;IACjC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAGmB;gBAElB,IAAI,EAAE,yBAAyB;IAE5D,OAAO,IAAI,IAAI;IAef,aAAa,CACX,QAAQ,EAAE,YAAY,GACrB,aAAa,CAAC,6BAA6B,EAAE,cAAc,CAAC;CA0BhE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=SignNestedCallCommand.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SignNestedCallCommand.test.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/command/SignNestedCallCommand.test.ts"],"names":[],"mappings":""}
@@ -17,4 +17,9 @@ export declare const P1: {
17
17
  readonly CHECK_ON_DEVICE: 1;
18
18
  readonly NO_CHECK: 0;
19
19
  };
20
+ export declare const APDU_SECTION_LENGTH: {
21
+ readonly DATA_SIZE: 2;
22
+ readonly DERIVATION_PATH_SEGMENT: 4;
23
+ readonly DERIVATION_PATH_LENGTH: 1;
24
+ };
20
25
  //# sourceMappingURL=apduHeaderUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"apduHeaderUtils.d.ts","sourceRoot":"","sources":["../../../../../../src/internal/app-binder/command/utils/apduHeaderUtils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,EAAG,GAAa,CAAC;AACtC,eAAO,MAAM,UAAU,EAAG,CAAa,CAAC;AAExC,eAAO,MAAM,EAAE;;;CAGL,CAAC;AAEX,eAAO,MAAM,GAAG;;;;;CAKN,CAAC;AAEX,eAAO,MAAM,EAAE;;;;;;CAML,CAAC"}
1
+ {"version":3,"file":"apduHeaderUtils.d.ts","sourceRoot":"","sources":["../../../../../../src/internal/app-binder/command/utils/apduHeaderUtils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,EAAG,GAAa,CAAC;AACtC,eAAO,MAAM,UAAU,EAAG,CAAa,CAAC;AAExC,eAAO,MAAM,EAAE;;;CAGL,CAAC;AAEX,eAAO,MAAM,GAAG;;;;;CAKN,CAAC;AAEX,eAAO,MAAM,EAAE;;;;;;CAML,CAAC;AAEX,eAAO,MAAM,mBAAmB;;;;CAItB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SignFeeIntentTask.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/task/SignFeeIntentTask.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,WAAW,EACjB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,0DAA0D,CAAC;AAI/F,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,EAAE,UAAU,CAAC;CACvB,CAAC;AAEF,qBAAa,iBAAiB;IAE1B,OAAO,CAAC,GAAG;IACX,OAAO,CAAC,IAAI;gBADJ,GAAG,EAAE,WAAW,EAChB,IAAI,EAAE,qBAAqB;IAG/B,GAAG,IAAI,OAAO,CAClB,aAAa,CAAC,4BAA4B,EAAE,cAAc,CAAC,CAC5D;CAyBF"}
1
+ {"version":3,"file":"SignFeeIntentTask.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/task/SignFeeIntentTask.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,WAAW,EACjB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,0DAA0D,CAAC;AAK/F,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,EAAE,UAAU,CAAC;CACvB,CAAC;AAEF,qBAAa,iBAAiB;IAE1B,OAAO,CAAC,GAAG;IACX,OAAO,CAAC,IAAI;gBADJ,GAAG,EAAE,WAAW,EAChB,IAAI,EAAE,qBAAqB;IAG/B,GAAG,IAAI,OAAO,CAClB,aAAa,CAAC,4BAA4B,EAAE,cAAc,CAAC,CAC5D;CAyBF"}
@@ -0,0 +1,13 @@
1
+ import { type CommandResult, type InternalApi } from "@ledgerhq/device-management-kit";
2
+ import { type SignNestedCallCommandResponse } from "../../app-binder/command/SignNestedCallCommand";
3
+ import { type AleoErrorCodes } from "../../app-binder/command/utils/aleoApplicationErrors";
4
+ export type SignNestedCallTaskArgs = {
5
+ nestedCallRequest: Uint8Array;
6
+ };
7
+ export declare class SignNestedCallTask {
8
+ private readonly api;
9
+ private readonly args;
10
+ constructor(api: InternalApi, args: SignNestedCallTaskArgs);
11
+ run(): Promise<CommandResult<SignNestedCallCommandResponse, AleoErrorCodes>>;
12
+ }
13
+ //# sourceMappingURL=SignNestedCallTask.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SignNestedCallTask.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/task/SignNestedCallTask.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,WAAW,EACjB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAEL,KAAK,6BAA6B,EACnC,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,0DAA0D,CAAC;AAK/F,MAAM,MAAM,sBAAsB,GAAG;IACnC,iBAAiB,EAAE,UAAU,CAAC;CAC/B,CAAC;AAEF,qBAAa,kBAAkB;IAE3B,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,IAAI;gBADJ,GAAG,EAAE,WAAW,EAChB,IAAI,EAAE,sBAAsB;IAGzC,GAAG,IAAI,OAAO,CAClB,aAAa,CAAC,6BAA6B,EAAE,cAAc,CAAC,CAC7D;CAwBF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=SignNestedCallTask.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SignNestedCallTask.test.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/task/SignNestedCallTask.test.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"SignRootIntentTask.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/task/SignRootIntentTask.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,WAAW,EACjB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EAEL,KAAK,6BAA6B,EACnC,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,0DAA0D,CAAC;AAI/F,MAAM,MAAM,sBAAsB,GAAG;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,qBAAa,kBAAkB;IAE3B,OAAO,CAAC,GAAG;IACX,OAAO,CAAC,IAAI;gBADJ,GAAG,EAAE,WAAW,EAChB,IAAI,EAAE,sBAAsB;IAGhC,GAAG,IAAI,OAAO,CAClB,aAAa,CAAC,6BAA6B,EAAE,cAAc,CAAC,CAC7D;CAgCF"}
1
+ {"version":3,"file":"SignRootIntentTask.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/task/SignRootIntentTask.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,WAAW,EACjB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EAEL,KAAK,6BAA6B,EACnC,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,0DAA0D,CAAC;AAK/F,MAAM,MAAM,sBAAsB,GAAG;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,qBAAa,kBAAkB;IAE3B,OAAO,CAAC,GAAG;IACX,OAAO,CAAC,IAAI;gBADJ,GAAG,EAAE,WAAW,EAChB,IAAI,EAAE,sBAAsB;IAGhC,GAAG,IAAI,OAAO,CAClB,aAAa,CAAC,6BAA6B,EAAE,cAAc,CAAC,CAC7D;CAoCF"}
@@ -0,0 +1,9 @@
1
+ import { type SignNestedCallDAReturnType } from "../../../api/app-binder/SignNestedCallDeviceActionTypes";
2
+ import { type TransactionOptions } from "../../../api/model/TransactionOptions";
3
+ import { AleoAppBinder } from "../../app-binder/AleoAppBinder";
4
+ export declare class SignNestedCallUseCase {
5
+ private readonly _appBinder;
6
+ constructor(appBinder: AleoAppBinder);
7
+ execute(nestedCallRequest: Uint8Array, options?: TransactionOptions): SignNestedCallDAReturnType;
8
+ }
9
+ //# sourceMappingURL=SignNestedCallUseCase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SignNestedCallUseCase.d.ts","sourceRoot":"","sources":["../../../../../src/internal/use-cases/transaction/SignNestedCallUseCase.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,iDAAiD,CAAC;AAClG,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAGnE,qBACa,qBAAqB;IAChC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAgB;gBAEI,SAAS,EAAE,aAAa;IAIvE,OAAO,CACL,iBAAiB,EAAE,UAAU,EAC7B,OAAO,CAAC,EAAE,kBAAkB,GAC3B,0BAA0B;CAM9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"transactionModule.d.ts","sourceRoot":"","sources":["../../../../../../src/internal/use-cases/transaction/di/transactionModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAM5C,eAAO,MAAM,wBAAwB,uBAIjC,CAAC"}
1
+ {"version":3,"file":"transactionModule.d.ts","sourceRoot":"","sources":["../../../../../../src/internal/use-cases/transaction/di/transactionModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAO5C,eAAO,MAAM,wBAAwB,uBAKjC,CAAC"}
@@ -1,5 +1,6 @@
1
1
  export declare const transactionTypes: {
2
2
  readonly SignRootIntentUseCase: symbol;
3
+ readonly SignNestedCallUseCase: symbol;
3
4
  readonly SignFeeIntentUseCase: symbol;
4
5
  };
5
6
  //# sourceMappingURL=transactionTypes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transactionTypes.d.ts","sourceRoot":"","sources":["../../../../../../src/internal/use-cases/transaction/di/transactionTypes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;CAGnB,CAAC"}
1
+ {"version":3,"file":"transactionTypes.d.ts","sourceRoot":"","sources":["../../../../../../src/internal/use-cases/transaction/di/transactionTypes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;;CAInB,CAAC"}