@ledgerhq/device-signer-kit-ethereum 0.0.0-fix-rn-ble-20250425173318 → 0.0.0-fix-rn-ble-20250502082216

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 (108) hide show
  1. package/lib/cjs/api/SignerEth.js +1 -1
  2. package/lib/cjs/api/SignerEth.js.map +1 -1
  3. package/lib/cjs/api/app-binder/SignTransactionDeviceActionTypes.js +1 -1
  4. package/lib/cjs/api/app-binder/SignTransactionDeviceActionTypes.js.map +2 -2
  5. package/lib/cjs/api/app-binder/SignTypedDataDeviceActionTypes.js +1 -1
  6. package/lib/cjs/api/app-binder/SignTypedDataDeviceActionTypes.js.map +2 -2
  7. package/lib/cjs/api/model/AddressOptions.js +1 -1
  8. package/lib/cjs/api/model/AddressOptions.js.map +1 -1
  9. package/lib/cjs/api/model/MessageOptions.js +2 -0
  10. package/lib/cjs/api/model/MessageOptions.js.map +7 -0
  11. package/lib/cjs/api/model/TransactionOptions.js +1 -1
  12. package/lib/cjs/api/model/TransactionOptions.js.map +1 -1
  13. package/lib/cjs/api/model/TypedDataOptions.js +2 -0
  14. package/lib/cjs/api/model/TypedDataOptions.js.map +7 -0
  15. package/lib/cjs/internal/DefaultSignerEth.js +1 -1
  16. package/lib/cjs/internal/DefaultSignerEth.js.map +3 -3
  17. package/lib/cjs/internal/address/use-case/GetAddressUseCase.js +1 -1
  18. package/lib/cjs/internal/address/use-case/GetAddressUseCase.js.map +2 -2
  19. package/lib/cjs/internal/app-binder/EthAppBinder.js +1 -1
  20. package/lib/cjs/internal/app-binder/EthAppBinder.js.map +2 -2
  21. package/lib/cjs/internal/app-binder/constant/plugins.js +1 -1
  22. package/lib/cjs/internal/app-binder/constant/plugins.js.map +2 -2
  23. package/lib/cjs/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.js +1 -1
  24. package/lib/cjs/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.js.map +2 -2
  25. package/lib/cjs/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.test.js +1 -1
  26. package/lib/cjs/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.test.js.map +2 -2
  27. package/lib/cjs/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.js +1 -1
  28. package/lib/cjs/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.js.map +2 -2
  29. package/lib/cjs/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.test.js +1 -1
  30. package/lib/cjs/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.test.js.map +2 -2
  31. package/lib/cjs/internal/app-binder/task/BuildTransactionContextTask.js +1 -1
  32. package/lib/cjs/internal/app-binder/task/BuildTransactionContextTask.js.map +2 -2
  33. package/lib/cjs/internal/app-binder/task/BuildTransactionContextTask.test.js +1 -1
  34. package/lib/cjs/internal/app-binder/task/BuildTransactionContextTask.test.js.map +2 -2
  35. package/lib/cjs/internal/message/use-case/SignMessageUseCase.js +1 -1
  36. package/lib/cjs/internal/message/use-case/SignMessageUseCase.js.map +3 -3
  37. package/lib/cjs/internal/shared/utils/ApplicationChecker.js +1 -1
  38. package/lib/cjs/internal/shared/utils/ApplicationChecker.js.map +2 -2
  39. package/lib/cjs/internal/shared/utils/ApplicationChecker.test.js +1 -1
  40. package/lib/cjs/internal/shared/utils/ApplicationChecker.test.js.map +2 -2
  41. package/lib/cjs/internal/typed-data/use-case/SignTypedDataUseCase.js +1 -1
  42. package/lib/cjs/internal/typed-data/use-case/SignTypedDataUseCase.js.map +3 -3
  43. package/lib/esm/api/app-binder/SignTransactionDeviceActionTypes.js +1 -1
  44. package/lib/esm/api/app-binder/SignTransactionDeviceActionTypes.js.map +2 -2
  45. package/lib/esm/api/app-binder/SignTypedDataDeviceActionTypes.js +1 -1
  46. package/lib/esm/api/app-binder/SignTypedDataDeviceActionTypes.js.map +2 -2
  47. package/lib/esm/api/model/MessageOptions.js +1 -0
  48. package/lib/esm/api/model/MessageOptions.js.map +7 -0
  49. package/lib/esm/api/model/TypedDataOptions.js +1 -0
  50. package/lib/esm/api/model/TypedDataOptions.js.map +7 -0
  51. package/lib/esm/internal/DefaultSignerEth.js +1 -1
  52. package/lib/esm/internal/DefaultSignerEth.js.map +3 -3
  53. package/lib/esm/internal/address/use-case/GetAddressUseCase.js +1 -1
  54. package/lib/esm/internal/address/use-case/GetAddressUseCase.js.map +2 -2
  55. package/lib/esm/internal/app-binder/EthAppBinder.js +1 -1
  56. package/lib/esm/internal/app-binder/EthAppBinder.js.map +2 -2
  57. package/lib/esm/internal/app-binder/constant/plugins.js +1 -1
  58. package/lib/esm/internal/app-binder/constant/plugins.js.map +2 -2
  59. package/lib/esm/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.js +1 -1
  60. package/lib/esm/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.js.map +2 -2
  61. package/lib/esm/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.test.js +1 -1
  62. package/lib/esm/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.test.js.map +2 -2
  63. package/lib/esm/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.js +1 -1
  64. package/lib/esm/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.js.map +2 -2
  65. package/lib/esm/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.test.js +1 -1
  66. package/lib/esm/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.test.js.map +2 -2
  67. package/lib/esm/internal/app-binder/task/BuildTransactionContextTask.js +1 -1
  68. package/lib/esm/internal/app-binder/task/BuildTransactionContextTask.js.map +2 -2
  69. package/lib/esm/internal/app-binder/task/BuildTransactionContextTask.test.js +1 -1
  70. package/lib/esm/internal/app-binder/task/BuildTransactionContextTask.test.js.map +2 -2
  71. package/lib/esm/internal/message/use-case/SignMessageUseCase.js +1 -1
  72. package/lib/esm/internal/message/use-case/SignMessageUseCase.js.map +3 -3
  73. package/lib/esm/internal/shared/utils/ApplicationChecker.js +1 -1
  74. package/lib/esm/internal/shared/utils/ApplicationChecker.js.map +2 -2
  75. package/lib/esm/internal/shared/utils/ApplicationChecker.test.js +1 -1
  76. package/lib/esm/internal/shared/utils/ApplicationChecker.test.js.map +2 -2
  77. package/lib/esm/internal/typed-data/use-case/SignTypedDataUseCase.js +1 -1
  78. package/lib/esm/internal/typed-data/use-case/SignTypedDataUseCase.js.map +3 -3
  79. package/lib/types/api/SignerEth.d.ts +4 -2
  80. package/lib/types/api/SignerEth.d.ts.map +1 -1
  81. package/lib/types/api/app-binder/SignTransactionDeviceActionTypes.d.ts +6 -1
  82. package/lib/types/api/app-binder/SignTransactionDeviceActionTypes.d.ts.map +1 -1
  83. package/lib/types/api/app-binder/SignTypedDataDeviceActionTypes.d.ts +7 -1
  84. package/lib/types/api/app-binder/SignTypedDataDeviceActionTypes.d.ts.map +1 -1
  85. package/lib/types/api/model/AddressOptions.d.ts +1 -0
  86. package/lib/types/api/model/AddressOptions.d.ts.map +1 -1
  87. package/lib/types/api/model/MessageOptions.d.ts +4 -0
  88. package/lib/types/api/model/MessageOptions.d.ts.map +1 -0
  89. package/lib/types/api/model/TransactionOptions.d.ts +1 -0
  90. package/lib/types/api/model/TransactionOptions.d.ts.map +1 -1
  91. package/lib/types/api/model/TypedDataOptions.d.ts +4 -0
  92. package/lib/types/api/model/TypedDataOptions.d.ts.map +1 -0
  93. package/lib/types/internal/DefaultSignerEth.d.ts +5 -3
  94. package/lib/types/internal/DefaultSignerEth.d.ts.map +1 -1
  95. package/lib/types/internal/address/use-case/GetAddressUseCase.d.ts.map +1 -1
  96. package/lib/types/internal/app-binder/EthAppBinder.d.ts +3 -0
  97. package/lib/types/internal/app-binder/EthAppBinder.d.ts.map +1 -1
  98. package/lib/types/internal/app-binder/constant/plugins.d.ts.map +1 -1
  99. package/lib/types/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.d.ts.map +1 -1
  100. package/lib/types/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.d.ts.map +1 -1
  101. package/lib/types/internal/app-binder/task/BuildTransactionContextTask.d.ts.map +1 -1
  102. package/lib/types/internal/message/use-case/SignMessageUseCase.d.ts +2 -1
  103. package/lib/types/internal/message/use-case/SignMessageUseCase.d.ts.map +1 -1
  104. package/lib/types/internal/shared/utils/ApplicationChecker.d.ts.map +1 -1
  105. package/lib/types/internal/typed-data/use-case/SignTypedDataUseCase.d.ts +2 -1
  106. package/lib/types/internal/typed-data/use-case/SignTypedDataUseCase.d.ts.map +1 -1
  107. package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
  108. package/package.json +6 -6
@@ -1,2 +1,2 @@
1
- "use strict";var i=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var y=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of o(t))!p.call(e,r)&&r!==a&&i(e,r,{get:()=>t[r],enumerable:!(n=s(t,r))||n.enumerable});return e};var d=e=>y(i({},"__esModule",{value:!0}),e);var g={};module.exports=d(g);
1
+ "use strict";var i=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var y=(e,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of o(t))!p.call(e,n)&&n!==s&&i(e,n,{get:()=>t[n],enumerable:!(r=a(t,n))||r.enumerable});return e};var d=e=>y(i({},"__esModule",{value:!0}),e);var g={};module.exports=d(g);
2
2
  //# sourceMappingURL=SignerEth.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/api/SignerEth.ts"],
4
- "sourcesContent": ["import { type GetAddressDAReturnType } from \"@api/app-binder/GetAddressDeviceActionTypes\";\nimport { type SignTypedDataDAReturnType } from \"@api/app-binder/SignTypedDataDeviceActionTypes\";\nimport { type AddressOptions } from \"@api/model/AddressOptions\";\nimport { type TransactionOptions } from \"@api/model/TransactionOptions\";\nimport { type TypedData } from \"@api/model/TypedData\";\n\nimport { type SignPersonalMessageDAReturnType } from \"./app-binder/SignPersonalMessageDeviceActionTypes\";\nimport { type SignTransactionDAReturnType } from \"./app-binder/SignTransactionDeviceActionTypes\";\n\nexport interface SignerEth {\n signTransaction: (\n derivationPath: string,\n transaction: Uint8Array,\n options?: TransactionOptions,\n ) => SignTransactionDAReturnType;\n signMessage: (\n derivationPath: string,\n message: string | Uint8Array,\n ) => SignPersonalMessageDAReturnType;\n signTypedData: (\n derivationPath: string,\n typedData: TypedData,\n ) => SignTypedDataDAReturnType;\n getAddress: (\n derivationPath: string,\n options?: AddressOptions,\n ) => GetAddressDAReturnType;\n}\n"],
4
+ "sourcesContent": ["import { type GetAddressDAReturnType } from \"@api/app-binder/GetAddressDeviceActionTypes\";\nimport { type SignTypedDataDAReturnType } from \"@api/app-binder/SignTypedDataDeviceActionTypes\";\nimport { type AddressOptions } from \"@api/model/AddressOptions\";\nimport { type MessageOptions } from \"@api/model/MessageOptions\";\nimport { type TransactionOptions } from \"@api/model/TransactionOptions\";\nimport { type TypedData } from \"@api/model/TypedData\";\nimport { type TypedDataOptions } from \"@api/model/TypedDataOptions\";\n\nimport { type SignPersonalMessageDAReturnType } from \"./app-binder/SignPersonalMessageDeviceActionTypes\";\nimport { type SignTransactionDAReturnType } from \"./app-binder/SignTransactionDeviceActionTypes\";\n\nexport interface SignerEth {\n signTransaction: (\n derivationPath: string,\n transaction: Uint8Array,\n options?: TransactionOptions,\n ) => SignTransactionDAReturnType;\n signMessage: (\n derivationPath: string,\n message: string | Uint8Array,\n options?: MessageOptions,\n ) => SignPersonalMessageDAReturnType;\n signTypedData: (\n derivationPath: string,\n typedData: TypedData,\n options?: TypedDataOptions,\n ) => SignTypedDataDAReturnType;\n getAddress: (\n derivationPath: string,\n options?: AddressOptions,\n ) => GetAddressDAReturnType;\n}\n"],
5
5
  "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
6
  "names": ["SignerEth_exports", "__toCommonJS"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var i=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var l=(r,e)=>{for(var o in e)i(r,o,{get:e[o],enumerable:!0})},u=(r,e,o,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of c(e))!y.call(r,n)&&n!==o&&i(r,n,{get:()=>e[n],enumerable:!(a=s(e,n))||a.enumerable});return r};var d=r=>u(i({},"__esModule",{value:!0}),r);var C={};l(C,{SignTransactionDAStep:()=>p});module.exports=d(C);var p=(t=>(t.OPEN_APP="signer.eth.steps.openApp",t.GET_APP_CONFIG="signer.eth.steps.getAppConfig",t.WEB3_CHECKS_OPT_IN="signer.eth.steps.web3ChecksOptIn",t.BUILD_CONTEXT="signer.eth.steps.buildContext",t.PROVIDE_CONTEXT="signer.eth.steps.provideContext",t.PROVIDE_GENERIC_CONTEXT="signer.eth.steps.provideGenericContext",t.SIGN_TRANSACTION="signer.eth.steps.signTransaction",t))(p||{});0&&(module.exports={SignTransactionDAStep});
1
+ "use strict";var i=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var u=(n,e)=>{for(var o in e)i(n,o,{get:e[o],enumerable:!0})},y=(n,e,o,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of c(e))!l.call(n,r)&&r!==o&&i(n,r,{get:()=>e[r],enumerable:!(a=s(e,r))||a.enumerable});return n};var C=n=>y(i({},"__esModule",{value:!0}),n);var T={};u(T,{SignTransactionDAStep:()=>p});module.exports=C(T);var p=(t=>(t.OPEN_APP="signer.eth.steps.openApp",t.GET_APP_CONFIG="signer.eth.steps.getAppConfig",t.WEB3_CHECKS_OPT_IN="signer.eth.steps.web3ChecksOptIn",t.WEB3_CHECKS_OPT_IN_RESULT="signer.eth.steps.web3ChecksOptInResult",t.BUILD_CONTEXT="signer.eth.steps.buildContext",t.PROVIDE_CONTEXT="signer.eth.steps.provideContext",t.PROVIDE_GENERIC_CONTEXT="signer.eth.steps.provideGenericContext",t.SIGN_TRANSACTION="signer.eth.steps.signTransaction",t))(p||{});0&&(module.exports={SignTransactionDAStep});
2
2
  //# sourceMappingURL=SignTransactionDeviceActionTypes.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/api/app-binder/SignTransactionDeviceActionTypes.ts"],
4
- "sourcesContent": ["import {\n type ClearSignContextSuccess,\n type ClearSignContextType,\n type ContextModule,\n} from \"@ledgerhq/context-module\";\nimport {\n type CommandErrorResult,\n type DeviceActionState,\n type ExecuteDeviceActionReturnType,\n type OpenAppDAError,\n type OpenAppDARequiredInteraction,\n type UserInteractionRequired,\n} from \"@ledgerhq/device-management-kit\";\n\nimport { type GetConfigCommandResponse } from \"@api/app-binder/GetConfigCommandTypes\";\nimport { type Signature } from \"@api/model/Signature\";\nimport { type TransactionOptions } from \"@api/model/TransactionOptions\";\nimport { type TransactionType } from \"@api/model/TransactionType\";\nimport { type EthErrorCodes } from \"@internal/app-binder/command/utils/ethAppErrors\";\nimport { type GenericContext } from \"@internal/app-binder/task/ProvideTransactionGenericContextTask\";\nimport { type TransactionMapperService } from \"@internal/transaction/service/mapper/TransactionMapperService\";\nimport { type TransactionParserService } from \"@internal/transaction/service/parser/TransactionParserService\";\n\nexport enum SignTransactionDAStep {\n OPEN_APP = \"signer.eth.steps.openApp\",\n GET_APP_CONFIG = \"signer.eth.steps.getAppConfig\",\n WEB3_CHECKS_OPT_IN = \"signer.eth.steps.web3ChecksOptIn\",\n BUILD_CONTEXT = \"signer.eth.steps.buildContext\",\n PROVIDE_CONTEXT = \"signer.eth.steps.provideContext\",\n PROVIDE_GENERIC_CONTEXT = \"signer.eth.steps.provideGenericContext\",\n SIGN_TRANSACTION = \"signer.eth.steps.signTransaction\",\n}\n\nexport type SignTransactionDAOutput = Signature;\n\nexport type SignTransactionDAInput = {\n readonly derivationPath: string;\n readonly transaction: Uint8Array;\n readonly mapper: TransactionMapperService;\n readonly parser: TransactionParserService;\n readonly contextModule: ContextModule;\n readonly options: TransactionOptions;\n};\n\nexport type SignTransactionDAError =\n | OpenAppDAError\n | CommandErrorResult<EthErrorCodes>[\"error\"];\n\ntype SignTransactionDARequiredInteraction =\n | OpenAppDARequiredInteraction\n | UserInteractionRequired.Web3ChecksOptIn\n | UserInteractionRequired.SignTransaction;\n\nexport type SignTransactionDAIntermediateValue = {\n requiredUserInteraction: SignTransactionDARequiredInteraction;\n step: SignTransactionDAStep;\n};\n\nexport type SignTransactionDAState = DeviceActionState<\n SignTransactionDAOutput,\n SignTransactionDAError,\n SignTransactionDAIntermediateValue\n>;\n\nexport type SignTransactionDAInternalState = {\n readonly error: SignTransactionDAError | null;\n readonly appConfig: GetConfigCommandResponse | null;\n readonly clearSignContexts: ClearSignContextSuccess[] | GenericContext | null;\n readonly web3Check: ClearSignContextSuccess<ClearSignContextType.WEB3_CHECK> | null;\n readonly serializedTransaction: Uint8Array | null;\n readonly chainId: number | null;\n readonly transactionType: TransactionType | null;\n readonly isLegacy: boolean;\n readonly signature: Signature | null;\n};\n\nexport type SignTransactionDAReturnType = ExecuteDeviceActionReturnType<\n SignTransactionDAOutput,\n SignTransactionDAError,\n SignTransactionDAIntermediateValue\n>;\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,2BAAAE,IAAA,eAAAC,EAAAH,GAuBO,IAAKE,OACVA,EAAA,SAAW,2BACXA,EAAA,eAAiB,gCACjBA,EAAA,mBAAqB,mCACrBA,EAAA,cAAgB,gCAChBA,EAAA,gBAAkB,kCAClBA,EAAA,wBAA0B,yCAC1BA,EAAA,iBAAmB,mCAPTA,OAAA",
4
+ "sourcesContent": ["import {\n type ClearSignContextSuccess,\n type ClearSignContextType,\n type ContextModule,\n} from \"@ledgerhq/context-module\";\nimport {\n type CommandErrorResult,\n type DeviceActionState,\n type ExecuteDeviceActionReturnType,\n type OpenAppDAError,\n type OpenAppDARequiredInteraction,\n type UserInteractionRequired,\n} from \"@ledgerhq/device-management-kit\";\n\nimport { type GetConfigCommandResponse } from \"@api/app-binder/GetConfigCommandTypes\";\nimport { type Signature } from \"@api/model/Signature\";\nimport { type TransactionOptions } from \"@api/model/TransactionOptions\";\nimport { type TransactionType } from \"@api/model/TransactionType\";\nimport { type EthErrorCodes } from \"@internal/app-binder/command/utils/ethAppErrors\";\nimport { type GenericContext } from \"@internal/app-binder/task/ProvideTransactionGenericContextTask\";\nimport { type TransactionMapperService } from \"@internal/transaction/service/mapper/TransactionMapperService\";\nimport { type TransactionParserService } from \"@internal/transaction/service/parser/TransactionParserService\";\n\nexport enum SignTransactionDAStep {\n OPEN_APP = \"signer.eth.steps.openApp\",\n GET_APP_CONFIG = \"signer.eth.steps.getAppConfig\",\n WEB3_CHECKS_OPT_IN = \"signer.eth.steps.web3ChecksOptIn\",\n WEB3_CHECKS_OPT_IN_RESULT = \"signer.eth.steps.web3ChecksOptInResult\",\n BUILD_CONTEXT = \"signer.eth.steps.buildContext\",\n PROVIDE_CONTEXT = \"signer.eth.steps.provideContext\",\n PROVIDE_GENERIC_CONTEXT = \"signer.eth.steps.provideGenericContext\",\n SIGN_TRANSACTION = \"signer.eth.steps.signTransaction\",\n}\n\nexport type SignTransactionDAOutput = Signature;\n\nexport type SignTransactionDAInput = {\n readonly derivationPath: string;\n readonly transaction: Uint8Array;\n readonly mapper: TransactionMapperService;\n readonly parser: TransactionParserService;\n readonly contextModule: ContextModule;\n readonly options: TransactionOptions;\n};\n\nexport type SignTransactionDAError =\n | OpenAppDAError\n | CommandErrorResult<EthErrorCodes>[\"error\"];\n\ntype SignTransactionDARequiredInteraction =\n | OpenAppDARequiredInteraction\n | UserInteractionRequired.Web3ChecksOptIn\n | UserInteractionRequired.SignTransaction;\n\nexport type SignTransactionDAIntermediateValue =\n | {\n requiredUserInteraction: SignTransactionDARequiredInteraction;\n step: Exclude<\n SignTransactionDAStep,\n SignTransactionDAStep.WEB3_CHECKS_OPT_IN_RESULT\n >;\n }\n | {\n requiredUserInteraction: UserInteractionRequired.None;\n step: SignTransactionDAStep.WEB3_CHECKS_OPT_IN_RESULT;\n result: boolean;\n };\n\nexport type SignTransactionDAState = DeviceActionState<\n SignTransactionDAOutput,\n SignTransactionDAError,\n SignTransactionDAIntermediateValue\n>;\n\nexport type SignTransactionDAInternalState = {\n readonly error: SignTransactionDAError | null;\n readonly appConfig: GetConfigCommandResponse | null;\n readonly clearSignContexts: ClearSignContextSuccess[] | GenericContext | null;\n readonly web3Check: ClearSignContextSuccess<ClearSignContextType.WEB3_CHECK> | null;\n readonly serializedTransaction: Uint8Array | null;\n readonly chainId: number | null;\n readonly transactionType: TransactionType | null;\n readonly isLegacy: boolean;\n readonly signature: Signature | null;\n};\n\nexport type SignTransactionDAReturnType = ExecuteDeviceActionReturnType<\n SignTransactionDAOutput,\n SignTransactionDAError,\n SignTransactionDAIntermediateValue\n>;\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,2BAAAE,IAAA,eAAAC,EAAAH,GAuBO,IAAKE,OACVA,EAAA,SAAW,2BACXA,EAAA,eAAiB,gCACjBA,EAAA,mBAAqB,mCACrBA,EAAA,0BAA4B,yCAC5BA,EAAA,cAAgB,gCAChBA,EAAA,gBAAkB,kCAClBA,EAAA,wBAA0B,yCAC1BA,EAAA,iBAAmB,mCARTA,OAAA",
6
6
  "names": ["SignTransactionDeviceActionTypes_exports", "__export", "SignTransactionDAStep", "__toCommonJS"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var o=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var D=(r,e)=>{for(var p in e)o(r,p,{get:e[p],enumerable:!0})},u=(r,e,p,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of s(e))!y.call(r,n)&&n!==p&&o(r,n,{get:()=>e[n],enumerable:!(a=d(e,n))||a.enumerable});return r};var T=r=>u(o({},"__esModule",{value:!0}),r);var g={};D(g,{SignTypedDataDAStateStep:()=>i});module.exports=T(g);var i=(t=>(t.OPEN_APP="signer.eth.steps.openApp",t.GET_APP_CONFIG="signer.eth.steps.getAppConfig",t.WEB3_CHECKS_OPT_IN="signer.eth.steps.web3ChecksOptIn",t.BUILD_CONTEXT="signer.eth.steps.buildContext",t.PROVIDE_CONTEXT="signer.eth.steps.provideContext",t.PROVIDE_GENERIC_CONTEXT="signer.eth.steps.provideGenericContext",t.SIGN_TYPED_DATA="signer.eth.steps.signTypedData",t.SIGN_TYPED_DATA_LEGACY="signer.eth.steps.signTypedDataLegacy",t))(i||{});0&&(module.exports={SignTypedDataDAStateStep});
1
+ "use strict";var o=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var u=(r,e)=>{for(var p in e)o(r,p,{get:e[p],enumerable:!0})},D=(r,e,p,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of d(e))!y.call(r,n)&&n!==p&&o(r,n,{get:()=>e[n],enumerable:!(a=s(e,n))||a.enumerable});return r};var E=r=>D(o({},"__esModule",{value:!0}),r);var T={};u(T,{SignTypedDataDAStateStep:()=>i});module.exports=E(T);var i=(t=>(t.OPEN_APP="signer.eth.steps.openApp",t.GET_APP_CONFIG="signer.eth.steps.getAppConfig",t.WEB3_CHECKS_OPT_IN="signer.eth.steps.web3ChecksOptIn",t.WEB3_CHECKS_OPT_IN_RESULT="signer.eth.steps.web3ChecksOptInResult",t.BUILD_CONTEXT="signer.eth.steps.buildContext",t.PROVIDE_CONTEXT="signer.eth.steps.provideContext",t.PROVIDE_GENERIC_CONTEXT="signer.eth.steps.provideGenericContext",t.SIGN_TYPED_DATA="signer.eth.steps.signTypedData",t.SIGN_TYPED_DATA_LEGACY="signer.eth.steps.signTypedDataLegacy",t))(i||{});0&&(module.exports={SignTypedDataDAStateStep});
2
2
  //# sourceMappingURL=SignTypedDataDeviceActionTypes.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/api/app-binder/SignTypedDataDeviceActionTypes.ts"],
4
- "sourcesContent": ["import { type ContextModule } from \"@ledgerhq/context-module\";\nimport {\n type CommandErrorResult,\n type DeviceActionState,\n type ExecuteDeviceActionReturnType,\n type OpenAppDAError,\n type OpenAppDARequiredInteraction,\n type UserInteractionRequired,\n} from \"@ledgerhq/device-management-kit\";\n\nimport { type GetConfigCommandResponse } from \"@api/app-binder/GetConfigCommandTypes\";\nimport { type Signature } from \"@api/model/Signature\";\nimport { type TypedData } from \"@api/model/TypedData\";\nimport { type EthErrorCodes } from \"@internal/app-binder/command/utils/ethAppErrors\";\nimport type { ProvideEIP712ContextTaskArgs } from \"@internal/app-binder/task/ProvideEIP712ContextTask\";\nimport { type TypedDataParserService } from \"@internal/typed-data/service/TypedDataParserService\";\n\nexport enum SignTypedDataDAStateStep {\n OPEN_APP = \"signer.eth.steps.openApp\",\n GET_APP_CONFIG = \"signer.eth.steps.getAppConfig\",\n WEB3_CHECKS_OPT_IN = \"signer.eth.steps.web3ChecksOptIn\",\n BUILD_CONTEXT = \"signer.eth.steps.buildContext\",\n PROVIDE_CONTEXT = \"signer.eth.steps.provideContext\",\n PROVIDE_GENERIC_CONTEXT = \"signer.eth.steps.provideGenericContext\",\n SIGN_TYPED_DATA = \"signer.eth.steps.signTypedData\",\n SIGN_TYPED_DATA_LEGACY = \"signer.eth.steps.signTypedDataLegacy\",\n}\n\nexport type SignTypedDataDAOutput = Signature;\n\nexport type SignTypedDataDAInput = {\n readonly derivationPath: string;\n readonly data: TypedData;\n readonly parser: TypedDataParserService;\n readonly contextModule: ContextModule;\n};\n\nexport type SignTypedDataDAError =\n | OpenAppDAError\n | CommandErrorResult<EthErrorCodes>[\"error\"];\n\ntype SignTypedDataDARequiredInteraction =\n | OpenAppDARequiredInteraction\n | UserInteractionRequired.Web3ChecksOptIn\n | UserInteractionRequired.SignTypedData;\n\nexport type SignTypedDataDAIntermediateValue = {\n requiredUserInteraction: SignTypedDataDARequiredInteraction;\n step: SignTypedDataDAStateStep;\n};\n\nexport type SignTypedDataDAState = DeviceActionState<\n SignTypedDataDAOutput,\n SignTypedDataDAError,\n SignTypedDataDAIntermediateValue\n>;\n\nexport type SignTypedDataDAInternalState = {\n readonly error: SignTypedDataDAError | null;\n readonly appConfig: GetConfigCommandResponse | null;\n readonly typedDataContext: ProvideEIP712ContextTaskArgs | null;\n readonly signature: Signature | null;\n};\n\nexport type SignTypedDataDAReturnType = ExecuteDeviceActionReturnType<\n SignTypedDataDAOutput,\n SignTypedDataDAError,\n SignTypedDataDAIntermediateValue\n>;\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8BAAAE,IAAA,eAAAC,EAAAH,GAiBO,IAAKE,OACVA,EAAA,SAAW,2BACXA,EAAA,eAAiB,gCACjBA,EAAA,mBAAqB,mCACrBA,EAAA,cAAgB,gCAChBA,EAAA,gBAAkB,kCAClBA,EAAA,wBAA0B,yCAC1BA,EAAA,gBAAkB,iCAClBA,EAAA,uBAAyB,uCARfA,OAAA",
4
+ "sourcesContent": ["import { type ContextModule } from \"@ledgerhq/context-module\";\nimport {\n type CommandErrorResult,\n type DeviceActionState,\n type ExecuteDeviceActionReturnType,\n type OpenAppDAError,\n type OpenAppDARequiredInteraction,\n type UserInteractionRequired,\n} from \"@ledgerhq/device-management-kit\";\n\nimport { type GetConfigCommandResponse } from \"@api/app-binder/GetConfigCommandTypes\";\nimport { type Signature } from \"@api/model/Signature\";\nimport { type TypedData } from \"@api/model/TypedData\";\nimport { type EthErrorCodes } from \"@internal/app-binder/command/utils/ethAppErrors\";\nimport type { ProvideEIP712ContextTaskArgs } from \"@internal/app-binder/task/ProvideEIP712ContextTask\";\nimport { type TypedDataParserService } from \"@internal/typed-data/service/TypedDataParserService\";\n\nexport enum SignTypedDataDAStateStep {\n OPEN_APP = \"signer.eth.steps.openApp\",\n GET_APP_CONFIG = \"signer.eth.steps.getAppConfig\",\n WEB3_CHECKS_OPT_IN = \"signer.eth.steps.web3ChecksOptIn\",\n WEB3_CHECKS_OPT_IN_RESULT = \"signer.eth.steps.web3ChecksOptInResult\",\n BUILD_CONTEXT = \"signer.eth.steps.buildContext\",\n PROVIDE_CONTEXT = \"signer.eth.steps.provideContext\",\n PROVIDE_GENERIC_CONTEXT = \"signer.eth.steps.provideGenericContext\",\n SIGN_TYPED_DATA = \"signer.eth.steps.signTypedData\",\n SIGN_TYPED_DATA_LEGACY = \"signer.eth.steps.signTypedDataLegacy\",\n}\n\nexport type SignTypedDataDAOutput = Signature;\n\nexport type SignTypedDataDAInput = {\n readonly derivationPath: string;\n readonly data: TypedData;\n readonly parser: TypedDataParserService;\n readonly contextModule: ContextModule;\n readonly skipOpenApp?: boolean;\n};\n\nexport type SignTypedDataDAError =\n | OpenAppDAError\n | CommandErrorResult<EthErrorCodes>[\"error\"];\n\ntype SignTypedDataDARequiredInteraction =\n | OpenAppDARequiredInteraction\n | UserInteractionRequired.Web3ChecksOptIn\n | UserInteractionRequired.SignTypedData;\n\nexport type SignTypedDataDAIntermediateValue =\n | {\n requiredUserInteraction: SignTypedDataDARequiredInteraction;\n step: Exclude<\n SignTypedDataDAStateStep,\n SignTypedDataDAStateStep.WEB3_CHECKS_OPT_IN_RESULT\n >;\n }\n | {\n requiredUserInteraction: UserInteractionRequired.None;\n step: SignTypedDataDAStateStep.WEB3_CHECKS_OPT_IN_RESULT;\n result: boolean;\n };\n\nexport type SignTypedDataDAState = DeviceActionState<\n SignTypedDataDAOutput,\n SignTypedDataDAError,\n SignTypedDataDAIntermediateValue\n>;\n\nexport type SignTypedDataDAInternalState = {\n readonly error: SignTypedDataDAError | null;\n readonly appConfig: GetConfigCommandResponse | null;\n readonly typedDataContext: ProvideEIP712ContextTaskArgs | null;\n readonly signature: Signature | null;\n};\n\nexport type SignTypedDataDAReturnType = ExecuteDeviceActionReturnType<\n SignTypedDataDAOutput,\n SignTypedDataDAError,\n SignTypedDataDAIntermediateValue\n>;\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8BAAAE,IAAA,eAAAC,EAAAH,GAiBO,IAAKE,OACVA,EAAA,SAAW,2BACXA,EAAA,eAAiB,gCACjBA,EAAA,mBAAqB,mCACrBA,EAAA,0BAA4B,yCAC5BA,EAAA,cAAgB,gCAChBA,EAAA,gBAAkB,kCAClBA,EAAA,wBAA0B,yCAC1BA,EAAA,gBAAkB,iCAClBA,EAAA,uBAAyB,uCATfA,OAAA",
6
6
  "names": ["SignTypedDataDeviceActionTypes_exports", "__export", "SignTypedDataDAStateStep", "__toCommonJS"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var t=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var p=(o,e,a,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of d(e))!i.call(o,n)&&n!==a&&t(o,n,{get:()=>e[n],enumerable:!(r=c(e,n))||r.enumerable});return o};var s=o=>p(t({},"__esModule",{value:!0}),o);var b={};module.exports=s(b);
1
+ "use strict";var a=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var t=Object.prototype.hasOwnProperty;var b=(o,e,i,p)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of s(e))!t.call(o,n)&&n!==i&&a(o,n,{get:()=>e[n],enumerable:!(p=r(e,n))||p.enumerable});return o};var c=o=>b(a({},"__esModule",{value:!0}),o);var d={};module.exports=c(d);
2
2
  //# sourceMappingURL=AddressOptions.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/api/model/AddressOptions.ts"],
4
- "sourcesContent": ["export type AddressOptions = {\n checkOnDevice?: boolean;\n returnChainCode?: boolean;\n};\n"],
4
+ "sourcesContent": ["export type AddressOptions = {\n checkOnDevice?: boolean;\n returnChainCode?: boolean;\n skipOpenApp?: boolean;\n};\n"],
5
5
  "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
6
  "names": ["AddressOptions_exports", "__toCommonJS"]
7
7
  }
@@ -0,0 +1,2 @@
1
+ "use strict";var n=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var O=Object.prototype.hasOwnProperty;var b=(e,p,t,s)=>{if(p&&typeof p=="object"||typeof p=="function")for(let o of i(p))!O.call(e,o)&&o!==t&&n(e,o,{get:()=>p[o],enumerable:!(s=a(p,o))||s.enumerable});return e};var g=e=>b(n({},"__esModule",{value:!0}),e);var k={};module.exports=g(k);
2
+ //# sourceMappingURL=MessageOptions.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/api/model/MessageOptions.ts"],
4
+ "sourcesContent": ["export type MessageOptions = {\n skipOpenApp?: boolean;\n};\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["MessageOptions_exports", "__toCommonJS"]
7
+ }
@@ -1,2 +1,2 @@
1
- "use strict";var a=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var e=Object.prototype.hasOwnProperty;var c=(t,n,p,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of s(n))!e.call(t,i)&&i!==p&&a(t,i,{get:()=>n[i],enumerable:!(o=r(n,i))||o.enumerable});return t};var d=t=>c(a({},"__esModule",{value:!0}),t);var g={};module.exports=d(g);
1
+ "use strict";var t=Object.defineProperty;var e=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var r=Object.prototype.hasOwnProperty;var O=(p,n,a,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of s(n))!r.call(p,o)&&o!==a&&t(p,o,{get:()=>n[o],enumerable:!(i=e(n,o))||i.enumerable});return p};var b=p=>O(t({},"__esModule",{value:!0}),p);var c={};module.exports=b(c);
2
2
  //# sourceMappingURL=TransactionOptions.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/api/model/TransactionOptions.ts"],
4
- "sourcesContent": ["export type TransactionOptions = {\n domain?: string;\n};\n"],
4
+ "sourcesContent": ["export type TransactionOptions = {\n domain?: string;\n skipOpenApp?: boolean;\n};\n"],
5
5
  "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
6
  "names": ["TransactionOptions_exports", "__toCommonJS"]
7
7
  }
@@ -0,0 +1,2 @@
1
+ "use strict";var a=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var O=(e,p,n,t)=>{if(p&&typeof p=="object"||typeof p=="function")for(let o of s(p))!y.call(e,o)&&o!==n&&a(e,o,{get:()=>p[o],enumerable:!(t=i(p,o))||t.enumerable});return e};var b=e=>O(a({},"__esModule",{value:!0}),e);var d={};module.exports=b(d);
2
+ //# sourceMappingURL=TypedDataOptions.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/api/model/TypedDataOptions.ts"],
4
+ "sourcesContent": ["export type TypedDataOptions = {\n skipOpenApp?: boolean;\n};\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["TypedDataOptions_exports", "__toCommonJS"]
7
+ }
@@ -1,2 +1,2 @@
1
- "use strict";var i=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var T=(r,e)=>{for(var t in e)i(r,t,{get:e[t],enumerable:!0})},u=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of d(e))!c.call(r,n)&&n!==t&&i(r,n,{get:()=>e[n],enumerable:!(s=y(e,n))||s.enumerable});return r};var D=r=>u(i({},"__esModule",{value:!0}),r);var S={};T(S,{DefaultSignerEth:()=>f});module.exports=D(S);var o=require("./address/di/addressTypes"),a=require("./di"),p=require("./message/di/messageTypes"),m=require("./transaction/di/transactionTypes"),g=require("./typed-data/di/typedDataTypes");class f{_container;constructor({dmk:e,sessionId:t,contextModule:s}){this._container=(0,a.makeContainer)({dmk:e,sessionId:t,contextModule:s})}signTransaction(e,t,s){return this._container.get(m.transactionTypes.SignTransactionUseCase).execute(e,t,s)}signMessage(e,t){return this._container.get(p.messageTypes.SignMessageUseCase).execute(e,t)}signTypedData(e,t){return this._container.get(g.typedDataTypes.SignTypedDataUseCase).execute(e,t)}getAddress(e,t){return this._container.get(o.addressTypes.GetAddressUseCase).execute(e,t)}}0&&(module.exports={DefaultSignerEth});
1
+ "use strict";var i=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var c=(s,e)=>{for(var t in e)i(s,t,{get:e[t],enumerable:!0})},D=(s,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of d(e))!T.call(s,n)&&n!==t&&i(s,n,{get:()=>e[n],enumerable:!(r=y(e,n))||r.enumerable});return s};var f=s=>D(i({},"__esModule",{value:!0}),s);var S={};c(S,{DefaultSignerEth:()=>u});module.exports=f(S);var o=require("./address/di/addressTypes"),a=require("./di"),p=require("./message/di/messageTypes"),m=require("./transaction/di/transactionTypes"),g=require("./typed-data/di/typedDataTypes");class u{_container;constructor({dmk:e,sessionId:t,contextModule:r}){this._container=(0,a.makeContainer)({dmk:e,sessionId:t,contextModule:r})}signTransaction(e,t,r){return this._container.get(m.transactionTypes.SignTransactionUseCase).execute(e,t,r)}signMessage(e,t,r){return this._container.get(p.messageTypes.SignMessageUseCase).execute(e,t,r)}signTypedData(e,t,r){return this._container.get(g.typedDataTypes.SignTypedDataUseCase).execute(e,t,r)}getAddress(e,t){return this._container.get(o.addressTypes.GetAddressUseCase).execute(e,t)}}0&&(module.exports={DefaultSignerEth});
2
2
  //# sourceMappingURL=DefaultSignerEth.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/internal/DefaultSignerEth.ts"],
4
- "sourcesContent": ["import { type ContextModule } from \"@ledgerhq/context-module\";\nimport {\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 SignPersonalMessageDAReturnType } from \"@api/app-binder/SignPersonalMessageDeviceActionTypes\";\nimport { type SignTransactionDAReturnType } from \"@api/app-binder/SignTransactionDeviceActionTypes\";\nimport { type SignTypedDataDAReturnType } from \"@api/app-binder/SignTypedDataDeviceActionTypes\";\nimport { type AddressOptions } from \"@api/model/AddressOptions\";\nimport { type TransactionOptions } from \"@api/model/TransactionOptions\";\nimport { type TypedData } from \"@api/model/TypedData\";\nimport { type SignerEth } from \"@api/SignerEth\";\nimport { addressTypes } from \"@internal/address/di/addressTypes\";\nimport { type GetAddressUseCase } from \"@internal/address/use-case/GetAddressUseCase\";\nimport { makeContainer } from \"@internal/di\";\nimport { messageTypes } from \"@internal/message/di/messageTypes\";\nimport { type SignMessageUseCase } from \"@internal/message/use-case/SignMessageUseCase\";\nimport { transactionTypes } from \"@internal/transaction/di/transactionTypes\";\nimport { type SignTransactionUseCase } from \"@internal/transaction/use-case/SignTransactionUseCase\";\nimport { typedDataTypes } from \"@internal/typed-data/di/typedDataTypes\";\nimport { type SignTypedDataUseCase } from \"@internal/typed-data/use-case/SignTypedDataUseCase\";\n\ntype DefaultSignerConstructorArgs = {\n dmk: DeviceManagementKit;\n sessionId: DeviceSessionId;\n contextModule: ContextModule;\n};\n\nexport class DefaultSignerEth implements SignerEth {\n private _container: Container;\n\n constructor({ dmk, sessionId, contextModule }: DefaultSignerConstructorArgs) {\n this._container = makeContainer({ dmk, sessionId, contextModule });\n }\n\n signTransaction(\n derivationPath: string,\n transaction: Uint8Array,\n options?: TransactionOptions,\n ): SignTransactionDAReturnType {\n return this._container\n .get<SignTransactionUseCase>(transactionTypes.SignTransactionUseCase)\n .execute(derivationPath, transaction, options);\n }\n\n signMessage(\n _derivationPath: string,\n _message: string | Uint8Array,\n ): SignPersonalMessageDAReturnType {\n return this._container\n .get<SignMessageUseCase>(messageTypes.SignMessageUseCase)\n .execute(_derivationPath, _message);\n }\n\n signTypedData(\n _derivationPath: string,\n _typedData: TypedData,\n ): SignTypedDataDAReturnType {\n return this._container\n .get<SignTypedDataUseCase>(typedDataTypes.SignTypedDataUseCase)\n .execute(_derivationPath, _typedData);\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"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GAeA,IAAAI,EAA6B,6CAE7BC,EAA8B,wBAC9BC,EAA6B,6CAE7BC,EAAiC,qDAEjCC,EAA+B,kDASxB,MAAMN,CAAsC,CACzC,WAER,YAAY,CAAE,IAAAO,EAAK,UAAAC,EAAW,cAAAC,CAAc,EAAiC,CAC3E,KAAK,cAAa,iBAAc,CAAE,IAAAF,EAAK,UAAAC,EAAW,cAAAC,CAAc,CAAC,CACnE,CAEA,gBACEC,EACAC,EACAC,EAC6B,CAC7B,OAAO,KAAK,WACT,IAA4B,mBAAiB,sBAAsB,EACnE,QAAQF,EAAgBC,EAAaC,CAAO,CACjD,CAEA,YACEC,EACAC,EACiC,CACjC,OAAO,KAAK,WACT,IAAwB,eAAa,kBAAkB,EACvD,QAAQD,EAAiBC,CAAQ,CACtC,CAEA,cACED,EACAE,EAC2B,CAC3B,OAAO,KAAK,WACT,IAA0B,iBAAe,oBAAoB,EAC7D,QAAQF,EAAiBE,CAAU,CACxC,CAEA,WACEF,EACAG,EACwB,CACxB,OAAO,KAAK,WACT,IAAuB,eAAa,iBAAiB,EACrD,QAAQH,EAAiBG,CAAQ,CACtC,CACF",
6
- "names": ["DefaultSignerEth_exports", "__export", "DefaultSignerEth", "__toCommonJS", "import_addressTypes", "import_di", "import_messageTypes", "import_transactionTypes", "import_typedDataTypes", "dmk", "sessionId", "contextModule", "derivationPath", "transaction", "options", "_derivationPath", "_message", "_typedData", "_options"]
4
+ "sourcesContent": ["import { type ContextModule } from \"@ledgerhq/context-module\";\nimport {\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 SignPersonalMessageDAReturnType } from \"@api/app-binder/SignPersonalMessageDeviceActionTypes\";\nimport { type SignTransactionDAReturnType } from \"@api/app-binder/SignTransactionDeviceActionTypes\";\nimport { type SignTypedDataDAReturnType } from \"@api/app-binder/SignTypedDataDeviceActionTypes\";\nimport { type AddressOptions } from \"@api/model/AddressOptions\";\nimport { type MessageOptions } from \"@api/model/MessageOptions\";\nimport { type TransactionOptions } from \"@api/model/TransactionOptions\";\nimport { type TypedData } from \"@api/model/TypedData\";\nimport { type TypedDataOptions } from \"@api/model/TypedDataOptions\";\nimport { type SignerEth } from \"@api/SignerEth\";\nimport { addressTypes } from \"@internal/address/di/addressTypes\";\nimport { type GetAddressUseCase } from \"@internal/address/use-case/GetAddressUseCase\";\nimport { makeContainer } from \"@internal/di\";\nimport { messageTypes } from \"@internal/message/di/messageTypes\";\nimport { type SignMessageUseCase } from \"@internal/message/use-case/SignMessageUseCase\";\nimport { transactionTypes } from \"@internal/transaction/di/transactionTypes\";\nimport { type SignTransactionUseCase } from \"@internal/transaction/use-case/SignTransactionUseCase\";\nimport { typedDataTypes } from \"@internal/typed-data/di/typedDataTypes\";\nimport { type SignTypedDataUseCase } from \"@internal/typed-data/use-case/SignTypedDataUseCase\";\n\ntype DefaultSignerConstructorArgs = {\n dmk: DeviceManagementKit;\n sessionId: DeviceSessionId;\n contextModule: ContextModule;\n};\n\nexport class DefaultSignerEth implements SignerEth {\n private _container: Container;\n\n constructor({ dmk, sessionId, contextModule }: DefaultSignerConstructorArgs) {\n this._container = makeContainer({ dmk, sessionId, contextModule });\n }\n\n signTransaction(\n derivationPath: string,\n transaction: Uint8Array,\n options?: TransactionOptions,\n ): SignTransactionDAReturnType {\n return this._container\n .get<SignTransactionUseCase>(transactionTypes.SignTransactionUseCase)\n .execute(derivationPath, transaction, options);\n }\n\n signMessage(\n derivationPath: string,\n message: string | Uint8Array,\n options?: MessageOptions,\n ): SignPersonalMessageDAReturnType {\n return this._container\n .get<SignMessageUseCase>(messageTypes.SignMessageUseCase)\n .execute(derivationPath, message, options);\n }\n\n signTypedData(\n derivationPath: string,\n typedData: TypedData,\n options?: TypedDataOptions,\n ): SignTypedDataDAReturnType {\n return this._container\n .get<SignTypedDataUseCase>(typedDataTypes.SignTypedDataUseCase)\n .execute(derivationPath, typedData, options);\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"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GAiBA,IAAAI,EAA6B,6CAE7BC,EAA8B,wBAC9BC,EAA6B,6CAE7BC,EAAiC,qDAEjCC,EAA+B,kDASxB,MAAMN,CAAsC,CACzC,WAER,YAAY,CAAE,IAAAO,EAAK,UAAAC,EAAW,cAAAC,CAAc,EAAiC,CAC3E,KAAK,cAAa,iBAAc,CAAE,IAAAF,EAAK,UAAAC,EAAW,cAAAC,CAAc,CAAC,CACnE,CAEA,gBACEC,EACAC,EACAC,EAC6B,CAC7B,OAAO,KAAK,WACT,IAA4B,mBAAiB,sBAAsB,EACnE,QAAQF,EAAgBC,EAAaC,CAAO,CACjD,CAEA,YACEF,EACAG,EACAD,EACiC,CACjC,OAAO,KAAK,WACT,IAAwB,eAAa,kBAAkB,EACvD,QAAQF,EAAgBG,EAASD,CAAO,CAC7C,CAEA,cACEF,EACAI,EACAF,EAC2B,CAC3B,OAAO,KAAK,WACT,IAA0B,iBAAe,oBAAoB,EAC7D,QAAQF,EAAgBI,EAAWF,CAAO,CAC/C,CAEA,WACEF,EACAE,EACwB,CACxB,OAAO,KAAK,WACT,IAAuB,eAAa,iBAAiB,EACrD,QAAQF,EAAgBE,CAAO,CACpC,CACF",
6
+ "names": ["DefaultSignerEth_exports", "__export", "DefaultSignerEth", "__toCommonJS", "import_addressTypes", "import_di", "import_messageTypes", "import_transactionTypes", "import_typedDataTypes", "dmk", "sessionId", "contextModule", "derivationPath", "transaction", "options", "message", "typedData"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var o=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var f=(e,r)=>{for(var p in r)o(e,p,{get:r[p],enumerable:!0})},D=(e,r,p,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of a(r))!s.call(e,i)&&i!==p&&o(e,i,{get:()=>r[i],enumerable:!(t=h(r,i))||t.enumerable});return e};var O=e=>D(o({},"__esModule",{value:!0}),e),A=(e,r,p,t)=>{for(var i=t>1?void 0:t?h(r,p):r,c=e.length-1,m;c>=0;c--)(m=e[c])&&(i=(t?m(r,p,i):m(i))||i);return t&&i&&o(r,p,i),i},B=(e,r)=>(p,t)=>r(p,t,e);var g={};f(g,{GetAddressUseCase:()=>n});module.exports=O(g);var d=require("inversify"),u=require("../../app-binder/di/appBinderTypes");let n=class{_appBinder;constructor(r){this._appBinder=r}execute(r,p){return this._appBinder.getAddress({derivationPath:r,checkOnDevice:p?.checkOnDevice,returnChainCode:p?.returnChainCode})}};n=A([(0,d.injectable)(),B(0,(0,d.inject)(u.appBinderTypes.AppBinding))],n);0&&(module.exports={GetAddressUseCase});
1
+ "use strict";var d=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var O=(e,p)=>{for(var r in p)d(e,r,{get:p[r],enumerable:!0})},f=(e,p,r,n)=>{if(p&&typeof p=="object"||typeof p=="function")for(let i of u(p))!a.call(e,i)&&i!==r&&d(e,i,{get:()=>p[i],enumerable:!(n=A(p,i))||n.enumerable});return e};var k=e=>f(d({},"__esModule",{value:!0}),e),h=(e,p,r,n)=>{for(var i=n>1?void 0:n?A(p,r):p,c=e.length-1,m;c>=0;c--)(m=e[c])&&(i=(n?m(p,r,i):m(i))||i);return n&&i&&d(p,r,i),i},B=(e,p)=>(r,n)=>p(r,n,e);var D={};O(D,{GetAddressUseCase:()=>t});module.exports=k(D);var o=require("inversify"),s=require("../../app-binder/di/appBinderTypes");let t=class{_appBinder;constructor(p){this._appBinder=p}execute(p,r){return this._appBinder.getAddress({derivationPath:p,checkOnDevice:r?.checkOnDevice,returnChainCode:r?.returnChainCode,skipOpenApp:r?.skipOpenApp})}};t=h([(0,o.injectable)(),B(0,(0,o.inject)(s.appBinderTypes.AppBinding))],t);0&&(module.exports={GetAddressUseCase});
2
2
  //# sourceMappingURL=GetAddressUseCase.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/address/use-case/GetAddressUseCase.ts"],
4
- "sourcesContent": ["import { inject, injectable } from \"inversify\";\n\nimport { GetAddressDAReturnType } from \"@api/app-binder/GetAddressDeviceActionTypes\";\nimport { AddressOptions } from \"@api/model/AddressOptions\";\nimport { appBinderTypes } from \"@internal/app-binder/di/appBinderTypes\";\nimport { EthAppBinder } from \"@internal/app-binder/EthAppBinder\";\n\n@injectable()\nexport class GetAddressUseCase {\n private _appBinder: EthAppBinder;\n\n constructor(@inject(appBinderTypes.AppBinding) appBinder: EthAppBinder) {\n this._appBinder = appBinder;\n }\n\n execute(\n derivationPath: string,\n options?: AddressOptions,\n ): GetAddressDAReturnType {\n return this._appBinder.getAddress({\n derivationPath,\n checkOnDevice: options?.checkOnDevice,\n returnChainCode: options?.returnChainCode,\n });\n }\n}\n"],
5
- "mappings": "okBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,uBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAmC,qBAInCC,EAA+B,kDAIxB,IAAMC,EAAN,KAAwB,CACrB,WAER,YAA+CC,EAAyB,CACtE,KAAK,WAAaA,CACpB,CAEA,QACEC,EACAC,EACwB,CACxB,OAAO,KAAK,WAAW,WAAW,CAChC,eAAAD,EACA,cAAeC,GAAS,cACxB,gBAAiBA,GAAS,eAC5B,CAAC,CACH,CACF,EAjBaH,EAANI,EAAA,IADN,cAAW,EAIGC,EAAA,eAAO,iBAAe,UAAU,IAHlCL",
4
+ "sourcesContent": ["import { inject, injectable } from \"inversify\";\n\nimport { GetAddressDAReturnType } from \"@api/app-binder/GetAddressDeviceActionTypes\";\nimport { AddressOptions } from \"@api/model/AddressOptions\";\nimport { appBinderTypes } from \"@internal/app-binder/di/appBinderTypes\";\nimport { EthAppBinder } from \"@internal/app-binder/EthAppBinder\";\n\n@injectable()\nexport class GetAddressUseCase {\n private _appBinder: EthAppBinder;\n\n constructor(@inject(appBinderTypes.AppBinding) appBinder: EthAppBinder) {\n this._appBinder = appBinder;\n }\n\n execute(\n derivationPath: string,\n options?: AddressOptions,\n ): GetAddressDAReturnType {\n return this._appBinder.getAddress({\n derivationPath,\n checkOnDevice: options?.checkOnDevice,\n returnChainCode: options?.returnChainCode,\n skipOpenApp: options?.skipOpenApp,\n });\n }\n}\n"],
5
+ "mappings": "okBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,uBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAmC,qBAInCC,EAA+B,kDAIxB,IAAMC,EAAN,KAAwB,CACrB,WAER,YAA+CC,EAAyB,CACtE,KAAK,WAAaA,CACpB,CAEA,QACEC,EACAC,EACwB,CACxB,OAAO,KAAK,WAAW,WAAW,CAChC,eAAAD,EACA,cAAeC,GAAS,cACxB,gBAAiBA,GAAS,gBAC1B,YAAaA,GAAS,WACxB,CAAC,CACH,CACF,EAlBaH,EAANI,EAAA,IADN,cAAW,EAIGC,EAAA,eAAO,iBAAe,UAAU,IAHlCL",
6
6
  "names": ["GetAddressUseCase_exports", "__export", "GetAddressUseCase", "__toCommonJS", "import_inversify", "import_appBinderTypes", "GetAddressUseCase", "appBinder", "derivationPath", "options", "__decorateClass", "__decorateParam"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var c=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var M=Object.prototype.hasOwnProperty;var P=(i,e)=>{for(var r in e)c(i,r,{get:e[r],enumerable:!0})},I=(i,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of l(e))!M.call(i,t)&&t!==r&&c(i,t,{get:()=>e[t],enumerable:!(n=D(e,t))||n.enumerable});return i};var x=i=>I(c({},"__esModule",{value:!0}),i),A=(i,e,r,n)=>{for(var t=n>1?void 0:n?D(e,r):e,p=i.length-1,u;p>=0;p--)(u=i[p])&&(t=(n?u(e,r,t):u(t))||t);return n&&t&&c(e,r,t),t},a=(i,e)=>(r,n)=>e(r,n,i);var k={};P(k,{EthAppBinder:()=>s});module.exports=x(k);var v=require("@ledgerhq/device-management-kit"),m=require("@ledgerhq/device-management-kit"),o=require("inversify"),S=require("../app-binder/device-action/SignTypedData/SignTypedDataDeviceAction"),f=require("../app-binder/task/SendSignPersonalMessageTask"),d=require("../externalTypes"),T=require("../transaction/di/transactionTypes"),g=require("./command/GetAddressCommand"),y=require("./constant/plugins"),h=require("./device-action/SignTransaction/SignTransactionDeviceAction");let s=class{constructor(e,r,n,t,p){this.dmk=e;this.contextModule=r;this.mapper=n;this.parser=t;this.sessionId=p}getAddress(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new v.SendCommandInAppDeviceAction({input:{command:new g.GetAddressCommand(e),appName:"Ethereum",compatibleAppNames:y.ETHEREUM_PLUGINS,requiredUserInteraction:e.checkOnDevice?m.UserInteractionRequired.VerifyAddress:m.UserInteractionRequired.None}})})}signPersonalMessage(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new v.CallTaskInAppDeviceAction({input:{task:async r=>new f.SendSignPersonalMessageTask(r,e).run(),appName:"Ethereum",compatibleAppNames:y.ETHEREUM_PLUGINS,requiredUserInteraction:m.UserInteractionRequired.SignPersonalMessage}})})}signTransaction(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new h.SignTransactionDeviceAction({input:{derivationPath:e.derivationPath,transaction:e.transaction,mapper:this.mapper,parser:this.parser,contextModule:this.contextModule,options:e.options??{}}})})}signTypedData(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new S.SignTypedDataDeviceAction({input:{derivationPath:e.derivationPath,data:e.data,parser:e.parser,contextModule:this.contextModule}})})}};s=A([(0,o.injectable)(),a(0,(0,o.inject)(d.externalTypes.Dmk)),a(1,(0,o.inject)(d.externalTypes.ContextModule)),a(2,(0,o.inject)(T.transactionTypes.TransactionMapperService)),a(3,(0,o.inject)(T.transactionTypes.TransactionParserService)),a(4,(0,o.inject)(d.externalTypes.SessionId))],s);0&&(module.exports={EthAppBinder});
1
+ "use strict";var c=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var M=(i,e)=>{for(var n in e)c(i,n,{get:e[n],enumerable:!0})},P=(i,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of k(e))!g.call(i,t)&&t!==n&&c(i,t,{get:()=>e[t],enumerable:!(r=y(e,t))||r.enumerable});return i};var I=i=>P(c({},"__esModule",{value:!0}),i),D=(i,e,n,r)=>{for(var t=r>1?void 0:r?y(e,n):e,p=i.length-1,A;p>=0;p--)(A=i[p])&&(t=(r?A(e,n,t):A(t))||t);return r&&t&&c(e,n,t),t},a=(i,e)=>(n,r)=>e(n,r,i);var x={};M(x,{EthAppBinder:()=>s});module.exports=I(x);var v=require("@ledgerhq/device-management-kit"),m=require("@ledgerhq/device-management-kit"),o=require("inversify"),l=require("../app-binder/device-action/SignTypedData/SignTypedDataDeviceAction"),S=require("../app-binder/task/SendSignPersonalMessageTask"),d=require("../externalTypes"),u=require("../transaction/di/transactionTypes"),f=require("./command/GetAddressCommand"),T=require("./constant/plugins"),h=require("./device-action/SignTransaction/SignTransactionDeviceAction");let s=class{constructor(e,n,r,t,p){this.dmk=e;this.contextModule=n;this.mapper=r;this.parser=t;this.sessionId=p}getAddress(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new v.SendCommandInAppDeviceAction({input:{command:new f.GetAddressCommand(e),appName:"Ethereum",compatibleAppNames:T.ETHEREUM_PLUGINS,requiredUserInteraction:e.checkOnDevice?m.UserInteractionRequired.VerifyAddress:m.UserInteractionRequired.None,skipOpenApp:e.skipOpenApp}})})}signPersonalMessage(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new v.CallTaskInAppDeviceAction({input:{task:async n=>new S.SendSignPersonalMessageTask(n,e).run(),appName:"Ethereum",compatibleAppNames:T.ETHEREUM_PLUGINS,requiredUserInteraction:m.UserInteractionRequired.SignPersonalMessage,skipOpenApp:e.skipOpenApp}})})}signTransaction(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new h.SignTransactionDeviceAction({input:{derivationPath:e.derivationPath,transaction:e.transaction,mapper:this.mapper,parser:this.parser,contextModule:this.contextModule,options:e.options??{}}})})}signTypedData(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new l.SignTypedDataDeviceAction({input:{derivationPath:e.derivationPath,data:e.data,parser:e.parser,contextModule:this.contextModule,skipOpenApp:e.skipOpenApp}})})}};s=D([(0,o.injectable)(),a(0,(0,o.inject)(d.externalTypes.Dmk)),a(1,(0,o.inject)(d.externalTypes.ContextModule)),a(2,(0,o.inject)(u.transactionTypes.TransactionMapperService)),a(3,(0,o.inject)(u.transactionTypes.TransactionParserService)),a(4,(0,o.inject)(d.externalTypes.SessionId))],s);0&&(module.exports={EthAppBinder});
2
2
  //# sourceMappingURL=EthAppBinder.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/internal/app-binder/EthAppBinder.ts"],
4
- "sourcesContent": ["import { type ContextModule } from \"@ledgerhq/context-module\";\nimport {\n DeviceManagementKit,\n type DeviceSessionId,\n} from \"@ledgerhq/device-management-kit\";\nimport {\n CallTaskInAppDeviceAction,\n SendCommandInAppDeviceAction,\n} from \"@ledgerhq/device-management-kit\";\nimport { UserInteractionRequired } from \"@ledgerhq/device-management-kit\";\nimport { inject, injectable } from \"inversify\";\n\nimport { type GetAddressDAReturnType } from \"@api/app-binder/GetAddressDeviceActionTypes\";\nimport { type SignPersonalMessageDAReturnType } from \"@api/app-binder/SignPersonalMessageDeviceActionTypes\";\nimport { type SignTransactionDAReturnType } from \"@api/app-binder/SignTransactionDeviceActionTypes\";\nimport { type SignTypedDataDAReturnType } from \"@api/app-binder/SignTypedDataDeviceActionTypes\";\nimport { type TransactionOptions } from \"@api/model/TransactionOptions\";\nimport { type TypedData } from \"@api/model/TypedData\";\nimport { SignTypedDataDeviceAction } from \"@internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction\";\nimport { SendSignPersonalMessageTask } from \"@internal/app-binder/task/SendSignPersonalMessageTask\";\nimport { externalTypes } from \"@internal/externalTypes\";\nimport { transactionTypes } from \"@internal/transaction/di/transactionTypes\";\nimport { TransactionMapperService } from \"@internal/transaction/service/mapper/TransactionMapperService\";\nimport { TransactionParserService } from \"@internal/transaction/service/parser/TransactionParserService\";\nimport { type TypedDataParserService } from \"@internal/typed-data/service/TypedDataParserService\";\n\nimport { GetAddressCommand } from \"./command/GetAddressCommand\";\nimport { ETHEREUM_PLUGINS } from \"./constant/plugins\";\nimport { SignTransactionDeviceAction } from \"./device-action/SignTransaction/SignTransactionDeviceAction\";\n\n@injectable()\nexport class EthAppBinder {\n constructor(\n @inject(externalTypes.Dmk) private dmk: DeviceManagementKit,\n @inject(externalTypes.ContextModule) private contextModule: ContextModule,\n @inject(transactionTypes.TransactionMapperService)\n private mapper: TransactionMapperService,\n @inject(transactionTypes.TransactionParserService)\n private parser: TransactionParserService,\n @inject(externalTypes.SessionId) private sessionId: DeviceSessionId,\n ) {}\n\n getAddress(args: {\n derivationPath: string;\n checkOnDevice?: boolean;\n returnChainCode?: 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: \"Ethereum\",\n compatibleAppNames: ETHEREUM_PLUGINS,\n requiredUserInteraction: args.checkOnDevice\n ? UserInteractionRequired.VerifyAddress\n : UserInteractionRequired.None,\n },\n }),\n });\n }\n\n signPersonalMessage(args: {\n derivationPath: string;\n message: string | Uint8Array;\n }): SignPersonalMessageDAReturnType {\n return this.dmk.executeDeviceAction({\n sessionId: this.sessionId,\n deviceAction: new CallTaskInAppDeviceAction({\n input: {\n task: async (internalApi) =>\n new SendSignPersonalMessageTask(internalApi, args).run(),\n appName: \"Ethereum\",\n compatibleAppNames: ETHEREUM_PLUGINS,\n requiredUserInteraction: UserInteractionRequired.SignPersonalMessage,\n },\n }),\n });\n }\n\n signTransaction(args: {\n derivationPath: string;\n transaction: Uint8Array;\n options?: TransactionOptions;\n }): SignTransactionDAReturnType {\n return this.dmk.executeDeviceAction({\n sessionId: this.sessionId,\n deviceAction: new SignTransactionDeviceAction({\n input: {\n derivationPath: args.derivationPath,\n transaction: args.transaction,\n mapper: this.mapper,\n parser: this.parser,\n contextModule: this.contextModule,\n options: args.options ?? {},\n },\n }),\n });\n }\n\n signTypedData(args: {\n derivationPath: string;\n parser: TypedDataParserService;\n data: TypedData;\n }): SignTypedDataDAReturnType {\n return this.dmk.executeDeviceAction({\n sessionId: this.sessionId,\n deviceAction: new SignTypedDataDeviceAction({\n input: {\n derivationPath: args.derivationPath,\n data: args.data,\n parser: args.parser,\n contextModule: this.contextModule,\n },\n }),\n });\n }\n}\n"],
5
- "mappings": "okBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,IAAA,eAAAC,EAAAH,GAKA,IAAAI,EAGO,2CACPA,EAAwC,2CACxCC,EAAmC,qBAQnCC,EAA0C,sFAC1CC,EAA4C,iEAC5CC,EAA8B,mCAC9BC,EAAiC,qDAKjCC,EAAkC,uCAClCC,EAAiC,8BACjCC,EAA4C,uEAGrC,IAAMC,EAAN,KAAmB,CACxB,YACqCC,EACUC,EAErCC,EAEAC,EACiCC,EACzC,CAPmC,SAAAJ,EACU,mBAAAC,EAErC,YAAAC,EAEA,YAAAC,EACiC,eAAAC,CACxC,CAEH,WAAWC,EAIgB,CACzB,OAAO,KAAK,IAAI,oBAAoB,CAClC,UAAW,KAAK,UAChB,aAAc,IAAI,+BAA6B,CAC7C,MAAO,CACL,QAAS,IAAI,oBAAkBA,CAAI,EACnC,QAAS,WACT,mBAAoB,mBACpB,wBAAyBA,EAAK,cAC1B,0BAAwB,cACxB,0BAAwB,IAC9B,CACF,CAAC,CACH,CAAC,CACH,CAEA,oBAAoBA,EAGgB,CAClC,OAAO,KAAK,IAAI,oBAAoB,CAClC,UAAW,KAAK,UAChB,aAAc,IAAI,4BAA0B,CAC1C,MAAO,CACL,KAAM,MAAOC,GACX,IAAI,8BAA4BA,EAAaD,CAAI,EAAE,IAAI,EACzD,QAAS,WACT,mBAAoB,mBACpB,wBAAyB,0BAAwB,mBACnD,CACF,CAAC,CACH,CAAC,CACH,CAEA,gBAAgBA,EAIgB,CAC9B,OAAO,KAAK,IAAI,oBAAoB,CAClC,UAAW,KAAK,UAChB,aAAc,IAAI,8BAA4B,CAC5C,MAAO,CACL,eAAgBA,EAAK,eACrB,YAAaA,EAAK,YAClB,OAAQ,KAAK,OACb,OAAQ,KAAK,OACb,cAAe,KAAK,cACpB,QAASA,EAAK,SAAW,CAAC,CAC5B,CACF,CAAC,CACH,CAAC,CACH,CAEA,cAAcA,EAIgB,CAC5B,OAAO,KAAK,IAAI,oBAAoB,CAClC,UAAW,KAAK,UAChB,aAAc,IAAI,4BAA0B,CAC1C,MAAO,CACL,eAAgBA,EAAK,eACrB,KAAMA,EAAK,KACX,OAAQA,EAAK,OACb,cAAe,KAAK,aACtB,CACF,CAAC,CACH,CAAC,CACH,CACF,EAtFaN,EAANQ,EAAA,IADN,cAAW,EAGPC,EAAA,eAAO,gBAAc,GAAG,GACxBA,EAAA,eAAO,gBAAc,aAAa,GAClCA,EAAA,eAAO,mBAAiB,wBAAwB,GAEhDA,EAAA,eAAO,mBAAiB,wBAAwB,GAEhDA,EAAA,eAAO,gBAAc,SAAS,IARtBT",
4
+ "sourcesContent": ["import { type ContextModule } from \"@ledgerhq/context-module\";\nimport {\n DeviceManagementKit,\n type DeviceSessionId,\n} from \"@ledgerhq/device-management-kit\";\nimport {\n CallTaskInAppDeviceAction,\n SendCommandInAppDeviceAction,\n} from \"@ledgerhq/device-management-kit\";\nimport { UserInteractionRequired } from \"@ledgerhq/device-management-kit\";\nimport { inject, injectable } from \"inversify\";\n\nimport { type GetAddressDAReturnType } from \"@api/app-binder/GetAddressDeviceActionTypes\";\nimport { type SignPersonalMessageDAReturnType } from \"@api/app-binder/SignPersonalMessageDeviceActionTypes\";\nimport { type SignTransactionDAReturnType } from \"@api/app-binder/SignTransactionDeviceActionTypes\";\nimport { type SignTypedDataDAReturnType } from \"@api/app-binder/SignTypedDataDeviceActionTypes\";\nimport { type TransactionOptions } from \"@api/model/TransactionOptions\";\nimport { type TypedData } from \"@api/model/TypedData\";\nimport { SignTypedDataDeviceAction } from \"@internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction\";\nimport { SendSignPersonalMessageTask } from \"@internal/app-binder/task/SendSignPersonalMessageTask\";\nimport { externalTypes } from \"@internal/externalTypes\";\nimport { transactionTypes } from \"@internal/transaction/di/transactionTypes\";\nimport { TransactionMapperService } from \"@internal/transaction/service/mapper/TransactionMapperService\";\nimport { TransactionParserService } from \"@internal/transaction/service/parser/TransactionParserService\";\nimport { type TypedDataParserService } from \"@internal/typed-data/service/TypedDataParserService\";\n\nimport { GetAddressCommand } from \"./command/GetAddressCommand\";\nimport { ETHEREUM_PLUGINS } from \"./constant/plugins\";\nimport { SignTransactionDeviceAction } from \"./device-action/SignTransaction/SignTransactionDeviceAction\";\n\n@injectable()\nexport class EthAppBinder {\n constructor(\n @inject(externalTypes.Dmk) private dmk: DeviceManagementKit,\n @inject(externalTypes.ContextModule) private contextModule: ContextModule,\n @inject(transactionTypes.TransactionMapperService)\n private mapper: TransactionMapperService,\n @inject(transactionTypes.TransactionParserService)\n private parser: TransactionParserService,\n @inject(externalTypes.SessionId) private sessionId: DeviceSessionId,\n ) {}\n\n getAddress(args: {\n derivationPath: string;\n checkOnDevice?: boolean;\n returnChainCode?: 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: \"Ethereum\",\n compatibleAppNames: ETHEREUM_PLUGINS,\n requiredUserInteraction: args.checkOnDevice\n ? UserInteractionRequired.VerifyAddress\n : UserInteractionRequired.None,\n skipOpenApp: args.skipOpenApp,\n },\n }),\n });\n }\n\n signPersonalMessage(args: {\n derivationPath: string;\n message: string | Uint8Array;\n skipOpenApp?: boolean;\n }): SignPersonalMessageDAReturnType {\n return this.dmk.executeDeviceAction({\n sessionId: this.sessionId,\n deviceAction: new CallTaskInAppDeviceAction({\n input: {\n task: async (internalApi) =>\n new SendSignPersonalMessageTask(internalApi, args).run(),\n appName: \"Ethereum\",\n compatibleAppNames: ETHEREUM_PLUGINS,\n requiredUserInteraction: UserInteractionRequired.SignPersonalMessage,\n skipOpenApp: args.skipOpenApp,\n },\n }),\n });\n }\n\n signTransaction(args: {\n derivationPath: string;\n transaction: Uint8Array;\n options?: TransactionOptions;\n }): SignTransactionDAReturnType {\n return this.dmk.executeDeviceAction({\n sessionId: this.sessionId,\n deviceAction: new SignTransactionDeviceAction({\n input: {\n derivationPath: args.derivationPath,\n transaction: args.transaction,\n mapper: this.mapper,\n parser: this.parser,\n contextModule: this.contextModule,\n options: args.options ?? {},\n },\n }),\n });\n }\n\n signTypedData(args: {\n derivationPath: string;\n parser: TypedDataParserService;\n data: TypedData;\n skipOpenApp?: boolean;\n }): SignTypedDataDAReturnType {\n return this.dmk.executeDeviceAction({\n sessionId: this.sessionId,\n deviceAction: new SignTypedDataDeviceAction({\n input: {\n derivationPath: args.derivationPath,\n data: args.data,\n parser: args.parser,\n contextModule: this.contextModule,\n skipOpenApp: args.skipOpenApp,\n },\n }),\n });\n }\n}\n"],
5
+ "mappings": "okBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,IAAA,eAAAC,EAAAH,GAKA,IAAAI,EAGO,2CACPA,EAAwC,2CACxCC,EAAmC,qBAQnCC,EAA0C,sFAC1CC,EAA4C,iEAC5CC,EAA8B,mCAC9BC,EAAiC,qDAKjCC,EAAkC,uCAClCC,EAAiC,8BACjCC,EAA4C,uEAGrC,IAAMC,EAAN,KAAmB,CACxB,YACqCC,EACUC,EAErCC,EAEAC,EACiCC,EACzC,CAPmC,SAAAJ,EACU,mBAAAC,EAErC,YAAAC,EAEA,YAAAC,EACiC,eAAAC,CACxC,CAEH,WAAWC,EAKgB,CACzB,OAAO,KAAK,IAAI,oBAAoB,CAClC,UAAW,KAAK,UAChB,aAAc,IAAI,+BAA6B,CAC7C,MAAO,CACL,QAAS,IAAI,oBAAkBA,CAAI,EACnC,QAAS,WACT,mBAAoB,mBACpB,wBAAyBA,EAAK,cAC1B,0BAAwB,cACxB,0BAAwB,KAC5B,YAAaA,EAAK,WACpB,CACF,CAAC,CACH,CAAC,CACH,CAEA,oBAAoBA,EAIgB,CAClC,OAAO,KAAK,IAAI,oBAAoB,CAClC,UAAW,KAAK,UAChB,aAAc,IAAI,4BAA0B,CAC1C,MAAO,CACL,KAAM,MAAOC,GACX,IAAI,8BAA4BA,EAAaD,CAAI,EAAE,IAAI,EACzD,QAAS,WACT,mBAAoB,mBACpB,wBAAyB,0BAAwB,oBACjD,YAAaA,EAAK,WACpB,CACF,CAAC,CACH,CAAC,CACH,CAEA,gBAAgBA,EAIgB,CAC9B,OAAO,KAAK,IAAI,oBAAoB,CAClC,UAAW,KAAK,UAChB,aAAc,IAAI,8BAA4B,CAC5C,MAAO,CACL,eAAgBA,EAAK,eACrB,YAAaA,EAAK,YAClB,OAAQ,KAAK,OACb,OAAQ,KAAK,OACb,cAAe,KAAK,cACpB,QAASA,EAAK,SAAW,CAAC,CAC5B,CACF,CAAC,CACH,CAAC,CACH,CAEA,cAAcA,EAKgB,CAC5B,OAAO,KAAK,IAAI,oBAAoB,CAClC,UAAW,KAAK,UAChB,aAAc,IAAI,4BAA0B,CAC1C,MAAO,CACL,eAAgBA,EAAK,eACrB,KAAMA,EAAK,KACX,OAAQA,EAAK,OACb,cAAe,KAAK,cACpB,YAAaA,EAAK,WACpB,CACF,CAAC,CACH,CAAC,CACH,CACF,EA5FaN,EAANQ,EAAA,IADN,cAAW,EAGPC,EAAA,eAAO,gBAAc,GAAG,GACxBA,EAAA,eAAO,gBAAc,aAAa,GAClCA,EAAA,eAAO,mBAAiB,wBAAwB,GAEhDA,EAAA,eAAO,mBAAiB,wBAAwB,GAEhDA,EAAA,eAAO,gBAAc,SAAS,IARtBT",
6
6
  "names": ["EthAppBinder_exports", "__export", "EthAppBinder", "__toCommonJS", "import_device_management_kit", "import_inversify", "import_SignTypedDataDeviceAction", "import_SendSignPersonalMessageTask", "import_externalTypes", "import_transactionTypes", "import_GetAddressCommand", "import_plugins", "import_SignTransactionDeviceAction", "EthAppBinder", "dmk", "contextModule", "mapper", "parser", "sessionId", "args", "internalApi", "__decorateClass", "__decorateParam"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var n=Object.defineProperty;var t=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var c=(a,e)=>{for(var o in e)n(a,o,{get:e[o],enumerable:!0})},p=(a,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of s(e))!l.call(a,i)&&i!==o&&n(a,i,{get:()=>e[i],enumerable:!(r=t(e,i))||r.enumerable});return a};var S=a=>p(n({},"__esModule",{value:!0}),a);var A={};c(A,{ETHEREUM_PLUGINS:()=>k});module.exports=S(A);const k=["1inch","Aave","Alkemi","Angle","APWine","ArtBlocks","Brick Towers","capsa","cBridge","ChorusOne","CIAN","Coinbase","Cometh","Compound","DODO","EigenLayer","ENS","Figment","Harvest","Kelp","Kiln","Lens","libertify","Lido","[ L ] Market","Midas","Morpho","Nested","OKX Web3","OpenSea","P2P.org","Paraswap","POAP","QuickSwap","Rarible","Ribbon","Ricochet","Rocket Pool","Spool","Squid","Staderlabs","StakeDAO","StakeKit","Swell","Thales","Yearn","Uniswap","Exchange"];0&&(module.exports={ETHEREUM_PLUGINS});
1
+ "use strict";var r=Object.defineProperty;var t=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var c=(a,e)=>{for(var o in e)r(a,o,{get:e[o],enumerable:!0})},p=(a,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of s(e))!l.call(a,i)&&i!==o&&r(a,i,{get:()=>e[i],enumerable:!(n=t(e,i))||n.enumerable});return a};var S=a=>p(r({},"__esModule",{value:!0}),a);var A={};c(A,{ETHEREUM_PLUGINS:()=>k});module.exports=S(A);const k=["1inch","Aave","Alkemi","Angle","APWine","ArtBlocks","Brick Towers","capsa","cBridge","ChorusOne","CIAN","Coinbase","Cometh","Compound","DODO","EigenLayer","ENS","Figment","Harvest","Kelp","Kiln","Lens","libertify","Lido","[ L ] Market","Midas","Morpho","Nested","OKX Web3","OpenSea","P2P.org","Paraswap","POAP","QuickSwap","Rarible","Ribbon","Ricochet","Rocket Pool","Spool","Squid","Staderlabs","StakeDAO","StakeKit","Swell","Thales","Yearn","Uniswap"];0&&(module.exports={ETHEREUM_PLUGINS});
2
2
  //# sourceMappingURL=plugins.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/app-binder/constant/plugins.ts"],
4
- "sourcesContent": ["export const ETHEREUM_PLUGINS: string[] = [\n \"1inch\",\n \"Aave\",\n \"Alkemi\",\n \"Angle\",\n \"APWine\",\n \"ArtBlocks\",\n \"Brick Towers\",\n \"capsa\",\n \"cBridge\",\n \"ChorusOne\",\n \"CIAN\",\n \"Coinbase\",\n \"Cometh\",\n \"Compound\",\n \"DODO\",\n \"EigenLayer\",\n \"ENS\",\n \"Figment\",\n \"Harvest\",\n \"Kelp\",\n \"Kiln\",\n \"Lens\",\n \"libertify\",\n \"Lido\",\n \"[ L ] Market\",\n \"Midas\",\n \"Morpho\",\n \"Nested\",\n \"OKX Web3\",\n \"OpenSea\",\n \"P2P.org\",\n \"Paraswap\",\n \"POAP\",\n \"QuickSwap\",\n \"Rarible\",\n \"Ribbon\",\n \"Ricochet\",\n \"Rocket Pool\",\n \"Spool\",\n \"Squid\",\n \"Staderlabs\",\n \"StakeDAO\",\n \"StakeKit\",\n \"Swell\",\n \"Thales\",\n \"Yearn\",\n \"Uniswap\",\n \"Exchange\", // Not a plugin, but a compatible app during exchange flows\n];\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GAAO,MAAME,EAA6B,CACxC,QACA,OACA,SACA,QACA,SACA,YACA,eACA,QACA,UACA,YACA,OACA,WACA,SACA,WACA,OACA,aACA,MACA,UACA,UACA,OACA,OACA,OACA,YACA,OACA,eACA,QACA,SACA,SACA,WACA,UACA,UACA,WACA,OACA,YACA,UACA,SACA,WACA,cACA,QACA,QACA,aACA,WACA,WACA,QACA,SACA,QACA,UACA,UACF",
4
+ "sourcesContent": ["export const ETHEREUM_PLUGINS: string[] = [\n \"1inch\",\n \"Aave\",\n \"Alkemi\",\n \"Angle\",\n \"APWine\",\n \"ArtBlocks\",\n \"Brick Towers\",\n \"capsa\",\n \"cBridge\",\n \"ChorusOne\",\n \"CIAN\",\n \"Coinbase\",\n \"Cometh\",\n \"Compound\",\n \"DODO\",\n \"EigenLayer\",\n \"ENS\",\n \"Figment\",\n \"Harvest\",\n \"Kelp\",\n \"Kiln\",\n \"Lens\",\n \"libertify\",\n \"Lido\",\n \"[ L ] Market\",\n \"Midas\",\n \"Morpho\",\n \"Nested\",\n \"OKX Web3\",\n \"OpenSea\",\n \"P2P.org\",\n \"Paraswap\",\n \"POAP\",\n \"QuickSwap\",\n \"Rarible\",\n \"Ribbon\",\n \"Ricochet\",\n \"Rocket Pool\",\n \"Spool\",\n \"Squid\",\n \"Staderlabs\",\n \"StakeDAO\",\n \"StakeKit\",\n \"Swell\",\n \"Thales\",\n \"Yearn\",\n \"Uniswap\",\n];\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GAAO,MAAME,EAA6B,CACxC,QACA,OACA,SACA,QACA,SACA,YACA,eACA,QACA,UACA,YACA,OACA,WACA,SACA,WACA,OACA,aACA,MACA,UACA,UACA,OACA,OACA,OACA,YACA,OACA,eACA,QACA,SACA,SACA,WACA,UACA,UACA,WACA,OACA,YACA,UACA,SACA,WACA,cACA,QACA,QACA,aACA,WACA,WACA,QACA,SACA,QACA,SACF",
6
6
  "names": ["plugins_exports", "__export", "ETHEREUM_PLUGINS", "__toCommonJS"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var l=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var _=Object.prototype.hasOwnProperty;var f=(o,r)=>{for(var c in r)l(o,c,{get:r[c],enumerable:!0})},b=(o,r,c,p)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of v(r))!_.call(o,s)&&s!==c&&l(o,s,{get:()=>r[s],enumerable:!(p=k(r,s))||p.enumerable});return o};var P=o=>b(l({},"__esModule",{value:!0}),o);var O={};f(O,{SignTransactionDeviceAction:()=>D});module.exports=P(O);var n=require("@ledgerhq/device-management-kit"),u=require("purify-ts"),t=require("xstate"),i=require("../../../../api/app-binder/SignTransactionDeviceActionTypes"),m=require("../../../app-binder/command/GetAppConfigurationCommand"),T=require("../../../app-binder/command/Web3CheckOptInCommand"),h=require("../../../app-binder/constant/plugins"),y=require("../../../app-binder/task/BuildTransactionContextTask"),E=require("../../../app-binder/task/ProvideTransactionContextTask"),x=require("../../../app-binder/task/ProvideTransactionGenericContextTask"),I=require("../../../app-binder/task/SendSignTransactionTask"),A=require("../../../shared/utils/ApplicationChecker");class D extends n.XStateDeviceAction{makeStateMachine(r){const{getAppConfig:c,web3CheckOptIn:p,buildContext:s,provideContext:C,provideGenericContext:d,signTransaction:g}=this.extractDependencies(r);return(0,t.setup)({types:{input:{},context:{},output:{}},actors:{openAppStateMachine:new n.OpenAppDeviceAction({input:{appName:"Ethereum"}}).makeStateMachine(r),getAppConfig:(0,t.fromPromise)(c),web3CheckOptIn:(0,t.fromPromise)(p),buildContext:(0,t.fromPromise)(s),provideContext:(0,t.fromPromise)(C),provideGenericContext:(0,t.fromPromise)(d),signTransaction:(0,t.fromPromise)(g)},guards:{noInternalError:({context:e})=>e._internalState.error===null,isGenericContext:({context:e})=>e._internalState.clearSignContexts!==null&&typeof e._internalState.clearSignContexts.transactionInfo=="string",isWeb3ChecksSupported:({context:e})=>new A.ApplicationChecker(r.getDeviceSessionState(),e._internalState.appConfig).withMinVersionExclusive("1.15.0").excludeDeviceModel(n.DeviceModelId.NANO_S).check(),shouldOptIn:({context:e})=>!e._internalState.appConfig.web3ChecksEnabled&&!e._internalState.appConfig.web3ChecksOptIn},actions:{assignErrorFromEvent:(0,t.assign)({_internalState:e=>({...e.context._internalState,error:e.event.error})})}}).createMachine({id:"SignTransactionDeviceAction",initial:"OpenAppDeviceAction",context:({input:e})=>({input:e,intermediateValue:{requiredUserInteraction:n.UserInteractionRequired.None,step:i.SignTransactionDAStep.OPEN_APP},_internalState:{error:null,appConfig:null,clearSignContexts:null,serializedTransaction:null,chainId:null,web3Check:null,transactionType:null,isLegacy:!0,signature:null}}),states:{OpenAppDeviceAction:{exit:(0,t.assign)({intermediateValue:{requiredUserInteraction:n.UserInteractionRequired.None,step:i.SignTransactionDAStep.OPEN_APP}}),invoke:{id:"openAppStateMachine",input:{appName:"Ethereum",compatibleAppNames:h.ETHEREUM_PLUGINS},src:"openAppStateMachine",onSnapshot:{actions:(0,t.assign)({intermediateValue:e=>({...e.event.snapshot.context.intermediateValue,step:i.SignTransactionDAStep.OPEN_APP})})},onDone:{actions:(0,t.assign)({_internalState:e=>e.event.output.caseOf({Right:()=>e.context._internalState,Left:a=>({...e.context._internalState,error:a})})}),target:"CheckOpenAppDeviceActionResult"}}},CheckOpenAppDeviceActionResult:{always:[{target:"GetAppConfig",guard:"noInternalError"},"Error"]},GetAppConfig:{entry:(0,t.assign)({intermediateValue:{requiredUserInteraction:n.UserInteractionRequired.None,step:i.SignTransactionDAStep.GET_APP_CONFIG}}),invoke:{id:"getAppConfig",src:"getAppConfig",onDone:{target:"GetAppConfigResultCheck",actions:[(0,t.assign)({_internalState:({event:e,context:a})=>(0,n.isSuccessCommandResult)(e.output)?{...a._internalState,appConfig:e.output.data}:{...a._internalState,error:e.output.error}})]},onError:{target:"Error",actions:"assignErrorFromEvent"}}},GetAppConfigResultCheck:{always:[{target:"Web3ChecksOptIn",guard:(0,t.and)(["noInternalError","isWeb3ChecksSupported","shouldOptIn"])},{target:"BuildContext",guard:"noInternalError"},{target:"Error"}]},Web3ChecksOptIn:{entry:(0,t.assign)({intermediateValue:{requiredUserInteraction:n.UserInteractionRequired.Web3ChecksOptIn,step:i.SignTransactionDAStep.WEB3_CHECKS_OPT_IN}}),exit:(0,t.assign)({intermediateValue:{requiredUserInteraction:n.UserInteractionRequired.None,step:i.SignTransactionDAStep.WEB3_CHECKS_OPT_IN}}),invoke:{id:"web3CheckOptIn",src:"web3CheckOptIn",onDone:{target:"BuildContext",actions:[(0,t.assign)({_internalState:({event:e,context:a})=>(0,n.isSuccessCommandResult)(e.output)?{...a._internalState,appConfig:{...a._internalState.appConfig,web3ChecksEnabled:e.output.data.enabled}}:a._internalState})]},onError:{target:"Error",actions:"assignErrorFromEvent"}}},BuildContext:{entry:(0,t.assign)({intermediateValue:{requiredUserInteraction:n.UserInteractionRequired.None,step:i.SignTransactionDAStep.BUILD_CONTEXT}}),invoke:{id:"buildContext",src:"buildContext",input:({context:e})=>({contextModule:e.input.contextModule,mapper:e.input.mapper,transaction:e.input.transaction,options:e.input.options,appConfig:e._internalState.appConfig,derivationPath:e.input.derivationPath}),onDone:{target:"BuildContextResultCheck",actions:[(0,t.assign)({_internalState:({event:e,context:a})=>({...a._internalState,clearSignContexts:e.output.clearSignContexts,web3Check:e.output.web3Check,serializedTransaction:e.output.serializedTransaction,chainId:e.output.chainId,transactionType:e.output.transactionType})})]},onError:{target:"Error",actions:"assignErrorFromEvent"}}},BuildContextResultCheck:{always:[{target:"ProvideGenericContext",guard:"isGenericContext"},{target:"ProvideContext"}]},ProvideContext:{entry:(0,t.assign)({intermediateValue:{requiredUserInteraction:n.UserInteractionRequired.None,step:i.SignTransactionDAStep.PROVIDE_CONTEXT}}),invoke:{id:"provideContext",src:"provideContext",input:({context:e})=>({clearSignContexts:e._internalState.clearSignContexts,web3Check:e._internalState.web3Check}),onDone:{target:"SignTransaction"},onError:{target:"Error",actions:"assignErrorFromEvent"}}},ProvideGenericContext:{entry:(0,t.assign)({intermediateValue:{requiredUserInteraction:n.UserInteractionRequired.None,step:i.SignTransactionDAStep.PROVIDE_GENERIC_CONTEXT}}),invoke:{id:"provideGenericContext",src:"provideGenericContext",input:({context:e})=>({contextModule:e.input.contextModule,transactionParser:e.input.parser,chainId:e._internalState.chainId,derivationPath:e.input.derivationPath,serializedTransaction:e._internalState.serializedTransaction,context:e._internalState.clearSignContexts,web3Check:e._internalState.web3Check}),onDone:{actions:(0,t.assign)({_internalState:({event:e,context:a})=>{const{isLegacy:w,...S}=a._internalState;return e.output.caseOf({Just:()=>({...S,isLegacy:!1}),Nothing:()=>({...S,isLegacy:!1})})}}),target:"SignTransaction"},onError:{target:"Error",actions:"assignErrorFromEvent"}}},SignTransaction:{entry:(0,t.assign)({intermediateValue:{requiredUserInteraction:n.UserInteractionRequired.SignTransaction,step:i.SignTransactionDAStep.SIGN_TRANSACTION}}),exit:(0,t.assign)({intermediateValue:{requiredUserInteraction:n.UserInteractionRequired.None,step:i.SignTransactionDAStep.SIGN_TRANSACTION}}),invoke:{id:"signTransaction",src:"signTransaction",input:({context:e})=>({derivationPath:e.input.derivationPath,serializedTransaction:e._internalState.serializedTransaction,chainId:e._internalState.chainId,transactionType:e._internalState.transactionType,isLegacy:e._internalState.isLegacy}),onDone:{target:"SignTransactionResultCheck",actions:[(0,t.assign)({_internalState:({event:e,context:a})=>(0,n.isSuccessCommandResult)(e.output)?{...a._internalState,signature:e.output.data}:{...a._internalState,error:e.output.error}})]},onError:{target:"Error",actions:"assignErrorFromEvent"}}},SignTransactionResultCheck:{always:[{guard:"noInternalError",target:"Success"},{target:"Error"}]},Success:{type:"final"},Error:{type:"final"}},output:({context:e})=>e._internalState.signature?(0,u.Right)(e._internalState.signature):(0,u.Left)(e._internalState.error||new n.UnknownDAError("No error in final state"))})}extractDependencies(r){return{getAppConfig:async()=>r.sendCommand(new m.GetAppConfiguration),web3CheckOptIn:async()=>r.sendCommand(new T.Web3CheckOptInCommand),buildContext:async e=>new y.BuildTransactionContextTask(r,e.input).run(),provideContext:async e=>new E.ProvideTransactionContextTask(r,{clearSignContexts:e.input.clearSignContexts,web3Check:e.input.web3Check}).run(),provideGenericContext:async e=>new x.ProvideTransactionGenericContextTask(r,{contextModule:e.input.contextModule,transactionParser:e.input.transactionParser,chainId:e.input.chainId,derivationPath:e.input.derivationPath,serializedTransaction:e.input.serializedTransaction,context:e.input.context,web3Check:e.input.web3Check}).run(),signTransaction:async e=>new I.SendSignTransactionTask(r,e.input).run()}}}0&&(module.exports={SignTransactionDeviceAction});
1
+ "use strict";var l=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var v=Object.prototype.hasOwnProperty;var _=(o,r)=>{for(var c in r)l(o,c,{get:r[c],enumerable:!0})},b=(o,r,c,p)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of f(r))!v.call(o,s)&&s!==c&&l(o,s,{get:()=>r[s],enumerable:!(p=A(r,s))||p.enumerable});return o};var D=o=>b(l({},"__esModule",{value:!0}),o);var O={};_(O,{SignTransactionDeviceAction:()=>P});module.exports=D(O);var n=require("@ledgerhq/device-management-kit"),u=require("purify-ts"),t=require("xstate"),i=require("../../../../api/app-binder/SignTransactionDeviceActionTypes"),m=require("../../../app-binder/command/GetAppConfigurationCommand"),T=require("../../../app-binder/command/Web3CheckOptInCommand"),h=require("../../../app-binder/constant/plugins"),y=require("../../../app-binder/task/BuildTransactionContextTask"),E=require("../../../app-binder/task/ProvideTransactionContextTask"),x=require("../../../app-binder/task/ProvideTransactionGenericContextTask"),I=require("../../../app-binder/task/SendSignTransactionTask"),k=require("../../../shared/utils/ApplicationChecker");class P extends n.XStateDeviceAction{makeStateMachine(r){const{getAppConfig:c,web3CheckOptIn:p,buildContext:s,provideContext:C,provideGenericContext:d,signTransaction:g}=this.extractDependencies(r);return(0,t.setup)({types:{input:{},context:{},output:{}},actors:{openAppStateMachine:new n.OpenAppDeviceAction({input:{appName:"Ethereum"}}).makeStateMachine(r),getAppConfig:(0,t.fromPromise)(c),web3CheckOptIn:(0,t.fromPromise)(p),buildContext:(0,t.fromPromise)(s),provideContext:(0,t.fromPromise)(C),provideGenericContext:(0,t.fromPromise)(d),signTransaction:(0,t.fromPromise)(g)},guards:{noInternalError:({context:e})=>e._internalState.error===null,isGenericContext:({context:e})=>e._internalState.clearSignContexts!==null&&typeof e._internalState.clearSignContexts.transactionInfo=="string",isWeb3ChecksSupported:({context:e})=>new k.ApplicationChecker(r.getDeviceSessionState(),e._internalState.appConfig).withMinVersionExclusive("1.15.0").excludeDeviceModel(n.DeviceModelId.NANO_S).check(),shouldOptIn:({context:e})=>!e._internalState.appConfig.web3ChecksEnabled&&!e._internalState.appConfig.web3ChecksOptIn,skipOpenApp:({context:e})=>!!e.input.options.skipOpenApp},actions:{assignErrorFromEvent:(0,t.assign)({_internalState:e=>({...e.context._internalState,error:e.event.error})})}}).createMachine({id:"SignTransactionDeviceAction",initial:"InitialState",context:({input:e})=>({input:e,intermediateValue:{requiredUserInteraction:n.UserInteractionRequired.None,step:i.SignTransactionDAStep.OPEN_APP},_internalState:{error:null,appConfig:null,clearSignContexts:null,serializedTransaction:null,chainId:null,web3Check:null,transactionType:null,isLegacy:!0,signature:null}}),states:{InitialState:{always:[{target:"GetAppConfig",guard:"skipOpenApp"},"OpenAppDeviceAction"]},OpenAppDeviceAction:{invoke:{id:"openAppStateMachine",input:{appName:"Ethereum",compatibleAppNames:h.ETHEREUM_PLUGINS},src:"openAppStateMachine",onSnapshot:{actions:(0,t.assign)({intermediateValue:e=>({...e.event.snapshot.context.intermediateValue,step:i.SignTransactionDAStep.OPEN_APP})})},onDone:{actions:(0,t.assign)({_internalState:e=>e.event.output.caseOf({Right:()=>e.context._internalState,Left:a=>({...e.context._internalState,error:a})})}),target:"CheckOpenAppDeviceActionResult"}}},CheckOpenAppDeviceActionResult:{always:[{target:"GetAppConfig",guard:"noInternalError"},"Error"]},GetAppConfig:{entry:(0,t.assign)({intermediateValue:{requiredUserInteraction:n.UserInteractionRequired.None,step:i.SignTransactionDAStep.GET_APP_CONFIG}}),invoke:{id:"getAppConfig",src:"getAppConfig",onDone:{target:"GetAppConfigResultCheck",actions:[(0,t.assign)({_internalState:({event:e,context:a})=>(0,n.isSuccessCommandResult)(e.output)?{...a._internalState,appConfig:e.output.data}:{...a._internalState,error:e.output.error}})]},onError:{target:"Error",actions:"assignErrorFromEvent"}}},GetAppConfigResultCheck:{always:[{target:"Web3ChecksOptIn",guard:(0,t.and)(["noInternalError","isWeb3ChecksSupported","shouldOptIn"])},{target:"BuildContext",guard:"noInternalError"},{target:"Error"}]},Web3ChecksOptIn:{entry:(0,t.assign)({intermediateValue:{requiredUserInteraction:n.UserInteractionRequired.Web3ChecksOptIn,step:i.SignTransactionDAStep.WEB3_CHECKS_OPT_IN}}),invoke:{id:"web3CheckOptIn",src:"web3CheckOptIn",onDone:{target:"Web3ChecksOptInResult",actions:[(0,t.assign)({_internalState:({event:e,context:a})=>(0,n.isSuccessCommandResult)(e.output)?{...a._internalState,appConfig:{...a._internalState.appConfig,web3ChecksEnabled:e.output.data.enabled}}:a._internalState})]},onError:{target:"Error",actions:"assignErrorFromEvent"}}},Web3ChecksOptInResult:{entry:(0,t.assign)(({context:e})=>({intermediateValue:{requiredUserInteraction:n.UserInteractionRequired.None,step:i.SignTransactionDAStep.WEB3_CHECKS_OPT_IN_RESULT,result:e._internalState.appConfig.web3ChecksEnabled}})),after:{0:{target:"BuildContext"}}},BuildContext:{entry:(0,t.assign)({intermediateValue:{requiredUserInteraction:n.UserInteractionRequired.None,step:i.SignTransactionDAStep.BUILD_CONTEXT}}),invoke:{id:"buildContext",src:"buildContext",input:({context:e})=>({contextModule:e.input.contextModule,mapper:e.input.mapper,transaction:e.input.transaction,options:e.input.options,appConfig:e._internalState.appConfig,derivationPath:e.input.derivationPath}),onDone:{target:"BuildContextResultCheck",actions:[(0,t.assign)({_internalState:({event:e,context:a})=>({...a._internalState,clearSignContexts:e.output.clearSignContexts,web3Check:e.output.web3Check,serializedTransaction:e.output.serializedTransaction,chainId:e.output.chainId,transactionType:e.output.transactionType})})]},onError:{target:"Error",actions:"assignErrorFromEvent"}}},BuildContextResultCheck:{always:[{target:"ProvideGenericContext",guard:"isGenericContext"},{target:"ProvideContext"}]},ProvideContext:{entry:(0,t.assign)({intermediateValue:{requiredUserInteraction:n.UserInteractionRequired.None,step:i.SignTransactionDAStep.PROVIDE_CONTEXT}}),invoke:{id:"provideContext",src:"provideContext",input:({context:e})=>({clearSignContexts:e._internalState.clearSignContexts,web3Check:e._internalState.web3Check}),onDone:{target:"SignTransaction"},onError:{target:"Error",actions:"assignErrorFromEvent"}}},ProvideGenericContext:{entry:(0,t.assign)({intermediateValue:{requiredUserInteraction:n.UserInteractionRequired.None,step:i.SignTransactionDAStep.PROVIDE_GENERIC_CONTEXT}}),invoke:{id:"provideGenericContext",src:"provideGenericContext",input:({context:e})=>({contextModule:e.input.contextModule,transactionParser:e.input.parser,chainId:e._internalState.chainId,derivationPath:e.input.derivationPath,serializedTransaction:e._internalState.serializedTransaction,context:e._internalState.clearSignContexts,web3Check:e._internalState.web3Check}),onDone:{actions:(0,t.assign)({_internalState:({event:e,context:a})=>{const{isLegacy:w,...S}=a._internalState;return e.output.caseOf({Just:()=>({...S,isLegacy:!1}),Nothing:()=>({...S,isLegacy:!1})})}}),target:"SignTransaction"},onError:{target:"Error",actions:"assignErrorFromEvent"}}},SignTransaction:{entry:(0,t.assign)({intermediateValue:{requiredUserInteraction:n.UserInteractionRequired.SignTransaction,step:i.SignTransactionDAStep.SIGN_TRANSACTION}}),invoke:{id:"signTransaction",src:"signTransaction",input:({context:e})=>({derivationPath:e.input.derivationPath,serializedTransaction:e._internalState.serializedTransaction,chainId:e._internalState.chainId,transactionType:e._internalState.transactionType,isLegacy:e._internalState.isLegacy}),onDone:{target:"SignTransactionResultCheck",actions:[(0,t.assign)({_internalState:({event:e,context:a})=>(0,n.isSuccessCommandResult)(e.output)?{...a._internalState,signature:e.output.data}:{...a._internalState,error:e.output.error}})]},onError:{target:"Error",actions:"assignErrorFromEvent"}}},SignTransactionResultCheck:{always:[{guard:"noInternalError",target:"Success"},{target:"Error"}]},Success:{type:"final"},Error:{type:"final"}},output:({context:e})=>e._internalState.signature?(0,u.Right)(e._internalState.signature):(0,u.Left)(e._internalState.error||new n.UnknownDAError("No error in final state"))})}extractDependencies(r){return{getAppConfig:async()=>r.sendCommand(new m.GetAppConfiguration),web3CheckOptIn:async()=>r.sendCommand(new T.Web3CheckOptInCommand),buildContext:async e=>new y.BuildTransactionContextTask(r,e.input).run(),provideContext:async e=>new E.ProvideTransactionContextTask(r,{clearSignContexts:e.input.clearSignContexts,web3Check:e.input.web3Check}).run(),provideGenericContext:async e=>new x.ProvideTransactionGenericContextTask(r,{contextModule:e.input.contextModule,transactionParser:e.input.transactionParser,chainId:e.input.chainId,derivationPath:e.input.derivationPath,serializedTransaction:e.input.serializedTransaction,context:e.input.context,web3Check:e.input.web3Check}).run(),signTransaction:async e=>new I.SendSignTransactionTask(r,e.input).run()}}}0&&(module.exports={SignTransactionDeviceAction});
2
2
  //# sourceMappingURL=SignTransactionDeviceAction.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.ts"],
4
- "sourcesContent": ["import {\n type ClearSignContextSuccess,\n type ClearSignContextType,\n type ContextModule,\n} from \"@ledgerhq/context-module\";\nimport {\n type CommandErrorResult,\n type CommandResult,\n type DeviceActionStateMachine,\n DeviceModelId,\n type InternalApi,\n isSuccessCommandResult,\n OpenAppDeviceAction,\n type StateMachineTypes,\n UnknownDAError,\n UserInteractionRequired,\n XStateDeviceAction,\n} from \"@ledgerhq/device-management-kit\";\nimport { Left, type Maybe, Right } from \"purify-ts\";\nimport { and, assign, fromPromise, setup } from \"xstate\";\n\nimport { type GetConfigCommandResponse } from \"@api/app-binder/GetConfigCommandTypes\";\nimport {\n type SignTransactionDAError,\n type SignTransactionDAInput,\n type SignTransactionDAIntermediateValue,\n type SignTransactionDAInternalState,\n type SignTransactionDAOutput,\n SignTransactionDAStep,\n} from \"@api/app-binder/SignTransactionDeviceActionTypes\";\nimport { type Signature } from \"@api/model/Signature\";\nimport { type TransactionOptions } from \"@api/model/TransactionOptions\";\nimport { type TransactionType } from \"@api/model/TransactionType\";\nimport { GetAppConfiguration } from \"@internal/app-binder/command/GetAppConfigurationCommand\";\nimport { type EthErrorCodes } from \"@internal/app-binder/command/utils/ethAppErrors\";\nimport {\n Web3CheckOptInCommand,\n type Web3CheckOptInCommandResponse,\n} from \"@internal/app-binder/command/Web3CheckOptInCommand\";\nimport { ETHEREUM_PLUGINS } from \"@internal/app-binder/constant/plugins\";\nimport {\n BuildTransactionContextTask,\n type BuildTransactionContextTaskArgs,\n type BuildTransactionTaskResult,\n} from \"@internal/app-binder/task/BuildTransactionContextTask\";\nimport { ProvideTransactionContextTask } from \"@internal/app-binder/task/ProvideTransactionContextTask\";\nimport {\n type GenericContext,\n ProvideTransactionGenericContextTask,\n type ProvideTransactionGenericContextTaskErrorCodes,\n} from \"@internal/app-binder/task/ProvideTransactionGenericContextTask\";\nimport { SendSignTransactionTask } from \"@internal/app-binder/task/SendSignTransactionTask\";\nimport { ApplicationChecker } from \"@internal/shared/utils/ApplicationChecker\";\nimport { type TransactionMapperService } from \"@internal/transaction/service/mapper/TransactionMapperService\";\nimport { type TransactionParserService } from \"@internal/transaction/service/parser/TransactionParserService\";\n\nexport type MachineDependencies = {\n readonly getAppConfig: () => Promise<\n CommandResult<GetConfigCommandResponse, EthErrorCodes>\n >;\n readonly web3CheckOptIn: () => Promise<\n CommandResult<Web3CheckOptInCommandResponse, EthErrorCodes>\n >;\n readonly buildContext: (arg0: {\n input: {\n contextModule: ContextModule;\n mapper: TransactionMapperService;\n transaction: Uint8Array;\n options: TransactionOptions;\n appConfig: GetConfigCommandResponse;\n derivationPath: string;\n };\n }) => Promise<BuildTransactionTaskResult>;\n readonly provideContext: (arg0: {\n input: {\n clearSignContexts: ClearSignContextSuccess[];\n web3Check: ClearSignContextSuccess<ClearSignContextType.WEB3_CHECK> | null;\n };\n }) => Promise<Maybe<CommandErrorResult<EthErrorCodes>>>;\n readonly provideGenericContext: (arg0: {\n input: {\n contextModule: ContextModule;\n transactionParser: TransactionParserService;\n chainId: number;\n derivationPath: string;\n serializedTransaction: Uint8Array;\n context: GenericContext;\n web3Check: ClearSignContextSuccess<ClearSignContextType.WEB3_CHECK> | null;\n };\n }) => Promise<\n Maybe<CommandErrorResult<ProvideTransactionGenericContextTaskErrorCodes>>\n >;\n readonly signTransaction: (arg0: {\n input: {\n derivationPath: string;\n serializedTransaction: Uint8Array;\n chainId: number;\n transactionType: TransactionType;\n isLegacy: boolean;\n };\n }) => Promise<CommandResult<Signature, EthErrorCodes>>;\n};\n\nexport class SignTransactionDeviceAction extends XStateDeviceAction<\n SignTransactionDAOutput,\n SignTransactionDAInput,\n SignTransactionDAError,\n SignTransactionDAIntermediateValue,\n SignTransactionDAInternalState\n> {\n makeStateMachine(\n internalApi: InternalApi,\n ): DeviceActionStateMachine<\n SignTransactionDAOutput,\n SignTransactionDAInput,\n SignTransactionDAError,\n SignTransactionDAIntermediateValue,\n SignTransactionDAInternalState\n > {\n type types = StateMachineTypes<\n SignTransactionDAOutput,\n SignTransactionDAInput,\n SignTransactionDAError,\n SignTransactionDAIntermediateValue,\n SignTransactionDAInternalState\n >;\n\n const {\n getAppConfig,\n web3CheckOptIn,\n buildContext,\n provideContext,\n provideGenericContext,\n signTransaction,\n } = this.extractDependencies(internalApi);\n\n return setup({\n types: {\n input: {} as types[\"input\"],\n context: {} as types[\"context\"],\n output: {} as types[\"output\"],\n },\n actors: {\n openAppStateMachine: new OpenAppDeviceAction({\n input: { appName: \"Ethereum\" },\n }).makeStateMachine(internalApi),\n getAppConfig: fromPromise(getAppConfig),\n web3CheckOptIn: fromPromise(web3CheckOptIn),\n buildContext: fromPromise(buildContext),\n provideContext: fromPromise(provideContext),\n provideGenericContext: fromPromise(provideGenericContext),\n signTransaction: fromPromise(signTransaction),\n },\n guards: {\n noInternalError: ({ context }) => context._internalState.error === null,\n isGenericContext: ({ context }) =>\n context._internalState.clearSignContexts !== null &&\n typeof (context._internalState.clearSignContexts as GenericContext)\n .transactionInfo === \"string\",\n isWeb3ChecksSupported: ({ context }) =>\n new ApplicationChecker(\n internalApi.getDeviceSessionState(),\n context._internalState.appConfig!,\n )\n .withMinVersionExclusive(\"1.15.0\")\n .excludeDeviceModel(DeviceModelId.NANO_S)\n .check(),\n shouldOptIn: ({ context }) =>\n !context._internalState.appConfig!.web3ChecksEnabled &&\n !context._internalState.appConfig!.web3ChecksOptIn,\n },\n actions: {\n assignErrorFromEvent: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: _.event[\"error\"], // NOTE: it should never happen, the error is not typed anymore here\n }),\n }),\n },\n }).createMachine({\n /** @xstate-layout N4IgpgJg5mDOIC5QGUCWUB2AVATgQw1jwGMAXVAewwBEwA3VYsAQTMowDoB5ABzA2Y8etBk1bkqAYghUwHVBjoUA1nIp8BQ5KTykwAWRIALBWADaABgC6iUDwqxUEjLZAAPRABYAzAHYOAJwAHACMAb4ArBYWAEw+FkHeADQgAJ6IwRYcAGwRQUG52TF5EcUAvmUpaJi4BERsVCKMLA2cAMJGYMTKvPyCwvTN4uwASnAArgA2pJKWNkgg9o7Orh4IAcEcpRYhvonZAd4byWmIITtZESEhBTHeEVH33hVV6Nj4hCTOTWKtHB1dHoafo-FrOMawKYzMwheZ2BxOdirDKbba7faHY4pdIIUIcG6+bwWbKeXwxIKeTzkl4garvOpfdig4ZUDgAcTApA6eEmk34MGksnkihUchgXKMPL5GBgc1cS0RVGRCBCngC2Q4aqCewCEWyQUyJxx5x2HBiByCsV8AQsaoinhpdNqn1azL+HIlUv5YEkYBwOAoOA4PEmugAZoGALYccXc3neuULBUrBZrVXqzXBHV6g2Wo1nDaasIWXxkwkxW0xXyOt7O+rfQa-Zzszlx6UwCFQgHdWbWeUIlOgNMBTxBDiJby3MkmiK+bFnCzeEL4mLm4m5aLeB2VWm1j71pmNsHsF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fEs53wbHztaHwjDlF+1ZGoyU54OxcLCt0TRjU0zgW8IECCrF872Q2PaNKq4ci7yeuSPINxqSKLGnY-ySEyIVSoh42Gaw+JHHxIcaIGxOIlnzCqb8mV9QZK3McJOtjfYJLKkk2m193Hc3vodc0r47i7xssBEIS40o+EcouZGRQ3ZOSepUkmKjWTfV+rTVJCDEBLicpqAoeYUqLm6tdVyv9JHaiOPnUZ497GcEmSzI2HNKrYRmRbCCUjSzmjfsjCshw0pu3HK5aWfdbSeBGbE96YyDkcGgeNC5DE-DMRXl080fdKShDWTiCkAR8QHDCLsG05JyjfLHhNEhrIAWtHqcoIFh0qSmNyPkEcHc9Riz4o5UCDx3ZbiXBEPZmLxmcGQOMYgTBYCQNorwh+Ql4VUgSD4J6uRPAhEpRqWhYRjoXCCEy2BnAACiqkcAEpbvyzUKdhVPXtOK66oExwY3VEI1Ffhd4gLKEAA */\n id: \"SignTransactionDeviceAction\",\n initial: \"OpenAppDeviceAction\",\n context: ({ input }) => {\n return {\n input,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n step: SignTransactionDAStep.OPEN_APP,\n },\n _internalState: {\n error: null,\n appConfig: null,\n clearSignContexts: null,\n serializedTransaction: null,\n chainId: null,\n web3Check: null,\n transactionType: null,\n isLegacy: true,\n signature: null,\n },\n };\n },\n states: {\n OpenAppDeviceAction: {\n exit: assign({\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n step: SignTransactionDAStep.OPEN_APP,\n },\n }),\n invoke: {\n id: \"openAppStateMachine\",\n input: {\n appName: \"Ethereum\",\n compatibleAppNames: ETHEREUM_PLUGINS,\n },\n src: \"openAppStateMachine\",\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) => ({\n ..._.event.snapshot.context.intermediateValue,\n step: SignTransactionDAStep.OPEN_APP,\n }),\n }),\n },\n onDone: {\n actions: assign({\n _internalState: (_) => {\n return _.event.output.caseOf<SignTransactionDAInternalState>({\n Right: () => _.context._internalState,\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n });\n },\n }),\n target: \"CheckOpenAppDeviceActionResult\",\n },\n },\n },\n CheckOpenAppDeviceActionResult: {\n always: [\n {\n target: \"GetAppConfig\",\n guard: \"noInternalError\",\n },\n \"Error\",\n ],\n },\n GetAppConfig: {\n entry: assign({\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n step: SignTransactionDAStep.GET_APP_CONFIG,\n },\n }),\n invoke: {\n id: \"getAppConfig\",\n src: \"getAppConfig\",\n onDone: {\n target: \"GetAppConfigResultCheck\",\n actions: [\n assign({\n _internalState: ({ event, context }) => {\n if (isSuccessCommandResult(event.output)) {\n return {\n ...context._internalState,\n appConfig: event.output.data,\n };\n } else {\n return {\n ...context._internalState,\n error: event.output.error,\n };\n }\n },\n }),\n ],\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n GetAppConfigResultCheck: {\n always: [\n {\n target: \"Web3ChecksOptIn\",\n guard: and([\n \"noInternalError\",\n \"isWeb3ChecksSupported\",\n \"shouldOptIn\",\n ]),\n },\n {\n target: \"BuildContext\",\n guard: \"noInternalError\",\n },\n {\n target: \"Error\",\n },\n ],\n },\n Web3ChecksOptIn: {\n entry: assign({\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.Web3ChecksOptIn,\n step: SignTransactionDAStep.WEB3_CHECKS_OPT_IN,\n },\n }),\n exit: assign({\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n step: SignTransactionDAStep.WEB3_CHECKS_OPT_IN,\n },\n }),\n invoke: {\n id: \"web3CheckOptIn\",\n src: \"web3CheckOptIn\",\n onDone: {\n target: \"BuildContext\",\n actions: [\n assign({\n _internalState: ({ event, context }) => {\n if (isSuccessCommandResult(event.output)) {\n return {\n ...context._internalState,\n appConfig: {\n ...context._internalState.appConfig!,\n web3ChecksEnabled: event.output.data.enabled,\n },\n };\n } else {\n return context._internalState;\n }\n },\n }),\n ],\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n BuildContext: {\n entry: assign({\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n step: SignTransactionDAStep.BUILD_CONTEXT,\n },\n }),\n invoke: {\n id: \"buildContext\",\n src: \"buildContext\",\n input: ({ context }) => ({\n contextModule: context.input.contextModule,\n mapper: context.input.mapper,\n transaction: context.input.transaction,\n options: context.input.options,\n appConfig: context._internalState.appConfig!,\n derivationPath: context.input.derivationPath,\n }),\n onDone: {\n target: \"BuildContextResultCheck\",\n actions: [\n assign({\n _internalState: ({ event, context }) => ({\n ...context._internalState,\n clearSignContexts: event.output.clearSignContexts!,\n web3Check: event.output.web3Check,\n serializedTransaction: event.output.serializedTransaction,\n chainId: event.output.chainId,\n transactionType: event.output.transactionType,\n }),\n }),\n ],\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n BuildContextResultCheck: {\n always: [\n {\n target: \"ProvideGenericContext\",\n guard: \"isGenericContext\",\n },\n {\n target: \"ProvideContext\",\n },\n ],\n },\n ProvideContext: {\n entry: assign({\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n step: SignTransactionDAStep.PROVIDE_CONTEXT,\n },\n }),\n invoke: {\n id: \"provideContext\",\n src: \"provideContext\",\n input: ({ context }) => ({\n clearSignContexts: context._internalState\n .clearSignContexts as ClearSignContextSuccess[],\n web3Check: context._internalState.web3Check,\n }),\n onDone: {\n target: \"SignTransaction\",\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n ProvideGenericContext: {\n entry: assign({\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n step: SignTransactionDAStep.PROVIDE_GENERIC_CONTEXT,\n },\n }),\n invoke: {\n id: \"provideGenericContext\",\n src: \"provideGenericContext\",\n input: ({ context }) => ({\n contextModule: context.input.contextModule,\n transactionParser: context.input.parser,\n chainId: context._internalState.chainId!,\n derivationPath: context.input.derivationPath,\n serializedTransaction:\n context._internalState.serializedTransaction!,\n context: context._internalState\n .clearSignContexts as GenericContext,\n web3Check: context._internalState.web3Check,\n }),\n onDone: {\n actions: assign({\n _internalState: ({ event, context }) => {\n const { isLegacy: _, ...rest } = context._internalState;\n return event.output.caseOf({\n Just: () => ({\n ...rest,\n isLegacy: false,\n }),\n Nothing: () => ({\n ...rest,\n isLegacy: false,\n }),\n });\n },\n }),\n // NOTE: don't check errors to fallback to blind signing\n target: \"SignTransaction\",\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n SignTransaction: {\n entry: assign({\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.SignTransaction,\n step: SignTransactionDAStep.SIGN_TRANSACTION,\n },\n }),\n exit: assign({\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n step: SignTransactionDAStep.SIGN_TRANSACTION,\n },\n }),\n invoke: {\n id: \"signTransaction\",\n src: \"signTransaction\",\n input: ({ context }) => ({\n derivationPath: context.input.derivationPath,\n serializedTransaction:\n context._internalState.serializedTransaction!,\n chainId: context._internalState.chainId!,\n transactionType: context._internalState.transactionType!,\n isLegacy: context._internalState.isLegacy,\n }),\n onDone: {\n target: \"SignTransactionResultCheck\",\n actions: [\n assign({\n _internalState: ({ event, context }) => {\n if (isSuccessCommandResult(event.output)) {\n return {\n ...context._internalState,\n signature: event.output.data,\n };\n }\n return {\n ...context._internalState,\n error: event.output.error,\n };\n },\n }),\n ],\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n SignTransactionResultCheck: {\n always: [\n { guard: \"noInternalError\", target: \"Success\" },\n { target: \"Error\" },\n ],\n },\n Success: {\n type: \"final\",\n },\n Error: {\n type: \"final\",\n },\n },\n output: ({ context }) =>\n context._internalState.signature\n ? Right(context._internalState.signature)\n : Left(\n context._internalState.error ||\n new UnknownDAError(\"No error in final state\"),\n ),\n });\n }\n\n extractDependencies(internalApi: InternalApi): MachineDependencies {\n const getAppConfig = async () =>\n internalApi.sendCommand(new GetAppConfiguration());\n const web3CheckOptIn = async () =>\n internalApi.sendCommand(new Web3CheckOptInCommand());\n const buildContext = async (arg0: {\n input: BuildTransactionContextTaskArgs;\n }) => new BuildTransactionContextTask(internalApi, arg0.input).run();\n\n const provideContext = async (arg0: {\n input: {\n clearSignContexts: ClearSignContextSuccess[];\n web3Check: ClearSignContextSuccess<ClearSignContextType.WEB3_CHECK> | null;\n };\n }) =>\n new ProvideTransactionContextTask(internalApi, {\n clearSignContexts: arg0.input.clearSignContexts,\n web3Check: arg0.input.web3Check,\n }).run();\n\n const provideGenericContext = async (arg0: {\n input: {\n contextModule: ContextModule;\n transactionParser: TransactionParserService;\n chainId: number;\n derivationPath: string;\n serializedTransaction: Uint8Array;\n context: GenericContext;\n web3Check: ClearSignContextSuccess<ClearSignContextType.WEB3_CHECK> | null;\n };\n }) =>\n new ProvideTransactionGenericContextTask(internalApi, {\n contextModule: arg0.input.contextModule,\n transactionParser: arg0.input.transactionParser,\n chainId: arg0.input.chainId,\n derivationPath: arg0.input.derivationPath,\n serializedTransaction: arg0.input.serializedTransaction,\n context: arg0.input.context,\n web3Check: arg0.input.web3Check,\n }).run();\n\n const signTransaction = async (arg0: {\n input: {\n derivationPath: string;\n serializedTransaction: Uint8Array;\n chainId: number;\n transactionType: TransactionType;\n isLegacy: boolean;\n };\n }) => new SendSignTransactionTask(internalApi, arg0.input).run();\n\n return {\n getAppConfig,\n web3CheckOptIn,\n buildContext,\n provideContext,\n provideGenericContext,\n signTransaction,\n };\n }\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iCAAAE,IAAA,eAAAC,EAAAH,GAKA,IAAAI,EAYO,2CACPC,EAAwC,qBACxCC,EAAgD,kBAGhDC,EAOO,4DAIPC,EAAoC,mEAEpCC,EAGO,8DACPC,EAAiC,iDACjCC,EAIO,iEACPC,EAA8C,mEAC9CC,EAIO,0EACPC,E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CAAC,CACH,CAEA,oBAAoBP,EAA+C,CAmDjE,MAAO,CACL,aAnDmB,SACnBA,EAAY,YAAY,IAAI,qBAAqB,EAmDjD,eAlDqB,SACrBA,EAAY,YAAY,IAAI,uBAAuB,EAkDnD,aAjDmB,MAAOa,GAEtB,IAAI,8BAA4Bb,EAAaa,EAAK,KAAK,EAAE,IAAI,EAgDjE,eA9CqB,MAAOA,GAM5B,IAAI,gCAA8Bb,EAAa,CAC7C,kBAAmBa,EAAK,MAAM,kBAC9B,UAAWA,EAAK,MAAM,SACxB,CAAC,EAAE,IAAI,EAsCP,sBApC4B,MAAOA,GAWnC,IAAI,uCAAqCb,EAAa,CACpD,cAAea,EAAK,MAAM,cAC1B,kBAAmBA,EAAK,MAAM,kBAC9B,QAASA,EAAK,MAAM,QACpB,eAAgBA,EAAK,MAAM,eAC3B,sBAAuBA,EAAK,MAAM,sBAClC,QAASA,EAAK,MAAM,QACpB,UAAWA,EAAK,MAAM,SACxB,CAAC,EAAE,IAAI,EAkBP,gBAhBsB,MAAOA,GAQzB,IAAI,0BAAwBb,EAAaa,EAAK,KAAK,EAAE,IAAI,CAS/D,CACF,CACF",
4
+ "sourcesContent": ["import {\n type ClearSignContextSuccess,\n type ClearSignContextType,\n type ContextModule,\n} from \"@ledgerhq/context-module\";\nimport {\n type CommandErrorResult,\n type CommandResult,\n type DeviceActionStateMachine,\n DeviceModelId,\n type InternalApi,\n isSuccessCommandResult,\n OpenAppDeviceAction,\n type StateMachineTypes,\n UnknownDAError,\n UserInteractionRequired,\n XStateDeviceAction,\n} from \"@ledgerhq/device-management-kit\";\nimport { Left, type Maybe, Right } from \"purify-ts\";\nimport { and, assign, fromPromise, setup } from \"xstate\";\n\nimport { type GetConfigCommandResponse } from \"@api/app-binder/GetConfigCommandTypes\";\nimport {\n type SignTransactionDAError,\n type SignTransactionDAInput,\n type SignTransactionDAIntermediateValue,\n type SignTransactionDAInternalState,\n type SignTransactionDAOutput,\n SignTransactionDAStep,\n} from \"@api/app-binder/SignTransactionDeviceActionTypes\";\nimport { type Signature } from \"@api/model/Signature\";\nimport { type TransactionOptions } from \"@api/model/TransactionOptions\";\nimport { type TransactionType } from \"@api/model/TransactionType\";\nimport { GetAppConfiguration } from \"@internal/app-binder/command/GetAppConfigurationCommand\";\nimport { type EthErrorCodes } from \"@internal/app-binder/command/utils/ethAppErrors\";\nimport {\n Web3CheckOptInCommand,\n type Web3CheckOptInCommandResponse,\n} from \"@internal/app-binder/command/Web3CheckOptInCommand\";\nimport { ETHEREUM_PLUGINS } from \"@internal/app-binder/constant/plugins\";\nimport {\n BuildTransactionContextTask,\n type BuildTransactionContextTaskArgs,\n type BuildTransactionTaskResult,\n} from \"@internal/app-binder/task/BuildTransactionContextTask\";\nimport { ProvideTransactionContextTask } from \"@internal/app-binder/task/ProvideTransactionContextTask\";\nimport {\n type GenericContext,\n ProvideTransactionGenericContextTask,\n type ProvideTransactionGenericContextTaskErrorCodes,\n} from \"@internal/app-binder/task/ProvideTransactionGenericContextTask\";\nimport { SendSignTransactionTask } from \"@internal/app-binder/task/SendSignTransactionTask\";\nimport { ApplicationChecker } from \"@internal/shared/utils/ApplicationChecker\";\nimport { type TransactionMapperService } from \"@internal/transaction/service/mapper/TransactionMapperService\";\nimport { type TransactionParserService } from \"@internal/transaction/service/parser/TransactionParserService\";\n\nexport type MachineDependencies = {\n readonly getAppConfig: () => Promise<\n CommandResult<GetConfigCommandResponse, EthErrorCodes>\n >;\n readonly web3CheckOptIn: () => Promise<\n CommandResult<Web3CheckOptInCommandResponse, EthErrorCodes>\n >;\n readonly buildContext: (arg0: {\n input: {\n contextModule: ContextModule;\n mapper: TransactionMapperService;\n transaction: Uint8Array;\n options: TransactionOptions;\n appConfig: GetConfigCommandResponse;\n derivationPath: string;\n };\n }) => Promise<BuildTransactionTaskResult>;\n readonly provideContext: (arg0: {\n input: {\n clearSignContexts: ClearSignContextSuccess[];\n web3Check: ClearSignContextSuccess<ClearSignContextType.WEB3_CHECK> | null;\n };\n }) => Promise<Maybe<CommandErrorResult<EthErrorCodes>>>;\n readonly provideGenericContext: (arg0: {\n input: {\n contextModule: ContextModule;\n transactionParser: TransactionParserService;\n chainId: number;\n derivationPath: string;\n serializedTransaction: Uint8Array;\n context: GenericContext;\n web3Check: ClearSignContextSuccess<ClearSignContextType.WEB3_CHECK> | null;\n };\n }) => Promise<\n Maybe<CommandErrorResult<ProvideTransactionGenericContextTaskErrorCodes>>\n >;\n readonly signTransaction: (arg0: {\n input: {\n derivationPath: string;\n serializedTransaction: Uint8Array;\n chainId: number;\n transactionType: TransactionType;\n isLegacy: boolean;\n };\n }) => Promise<CommandResult<Signature, EthErrorCodes>>;\n};\n\nexport class SignTransactionDeviceAction extends XStateDeviceAction<\n SignTransactionDAOutput,\n SignTransactionDAInput,\n SignTransactionDAError,\n SignTransactionDAIntermediateValue,\n SignTransactionDAInternalState\n> {\n makeStateMachine(\n internalApi: InternalApi,\n ): DeviceActionStateMachine<\n SignTransactionDAOutput,\n SignTransactionDAInput,\n SignTransactionDAError,\n SignTransactionDAIntermediateValue,\n SignTransactionDAInternalState\n > {\n type types = StateMachineTypes<\n SignTransactionDAOutput,\n SignTransactionDAInput,\n SignTransactionDAError,\n SignTransactionDAIntermediateValue,\n SignTransactionDAInternalState\n >;\n\n const {\n getAppConfig,\n web3CheckOptIn,\n buildContext,\n provideContext,\n provideGenericContext,\n signTransaction,\n } = this.extractDependencies(internalApi);\n\n return setup({\n types: {\n input: {} as types[\"input\"],\n context: {} as types[\"context\"],\n output: {} as types[\"output\"],\n },\n actors: {\n openAppStateMachine: new OpenAppDeviceAction({\n input: { appName: \"Ethereum\" },\n }).makeStateMachine(internalApi),\n getAppConfig: fromPromise(getAppConfig),\n web3CheckOptIn: fromPromise(web3CheckOptIn),\n buildContext: fromPromise(buildContext),\n provideContext: fromPromise(provideContext),\n provideGenericContext: fromPromise(provideGenericContext),\n signTransaction: fromPromise(signTransaction),\n },\n guards: {\n noInternalError: ({ context }) => context._internalState.error === null,\n isGenericContext: ({ context }) =>\n context._internalState.clearSignContexts !== null &&\n typeof (context._internalState.clearSignContexts as GenericContext)\n .transactionInfo === \"string\",\n isWeb3ChecksSupported: ({ context }) =>\n new ApplicationChecker(\n internalApi.getDeviceSessionState(),\n context._internalState.appConfig!,\n )\n .withMinVersionExclusive(\"1.15.0\")\n .excludeDeviceModel(DeviceModelId.NANO_S)\n .check(),\n shouldOptIn: ({ context }) =>\n !context._internalState.appConfig!.web3ChecksEnabled &&\n !context._internalState.appConfig!.web3ChecksOptIn,\n skipOpenApp: ({ context }) => !!context.input.options.skipOpenApp,\n },\n actions: {\n assignErrorFromEvent: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: _.event[\"error\"], // NOTE: it should never happen, the error is not typed anymore here\n }),\n }),\n },\n }).createMachine({\n /** @xstate-layout N4IgpgJg5mDOIC5QGUCWUB2AVATgQw1jwGMAXVAewwBEwA3VYsAQTMowDoB5ABzA2Y8etBk1bkqAYghUwHVBjoUA1nIp8BQ5KTykwAWRIALBWADaABgC6iUDwqxUEjLZAAPRABYAzAHYOAJwAHACMAb4ArBYWAEw+FkHeADQgAJ6IwRYcAGwRQUG52TF5EcUAvmUpaJi4BERsVCKMLA2cAMJGYMTKvPyCwvTN4uwASnAArgA2pJKWNkgg9o7Orh4IAcEcpRYhvonZAd4byWmIITtZESEhBTHeEVH33hVV6Nj4hCTOTWKtHB1dHoafo-FrOMawKYzMwheZ2BxOdirDKbba7faHY4pdIIUIcG6+bwWbKeXwxIKeTzkl4garvOpfdig4ZUDgAcTApA6eEmk34MGksnkihUchgXKMPL5GBgc1cS0RVGRCBCngC2Q4aqCewCEWyQUyJxx5x2HBiByCsV8AQsaoinhpdNqn1azL+HIlUv5YEkYBwOAoOA4PEmugAZoGALYccXc3neuULBUrBZrVXqzXBHV6g2Wo1nDaasIWXxkwkxW0xXyOt7O+rfQa-Zzszlx6UwCFQgHdWbWeUIlOgNMBTxBDiJby3MkmiK+bFnCzeEL4mLm4m5aLeB2V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Htla0dtRJzh3knfEs53wbHztaHwjDlF+1ZGoyU54OxcLCt0TRjU0zgW8IECCrF872Q2PaNKq4ci7yeuSPINxqSKLGnY-ySEyIVSoh42Gaw+JHHxIcaIGxOIlnzCqb8mV9QZK3McJOtjfYJLKkk2m193Hc3vodc0r47i7xssBEIS40o+EcouZGRQ3ZOSepUkmKjWTfV+rTVJCDEBLicpqAoeYUqLm6tdVyv9JHaiOPnUZ497GcEmSzI2HNKrYRmRbCCUjSzmjfsjCshw0pu3HK5aWfdbSeBGbE96YyDkcGgeNC5DE-DMRXl080fdKShDWTiCkAR8QHDCLsG05JyjfLHhNEhrIAWtHqcoIFh0qSmNyPkEcHc9Riz4o5UCDx3ZbiXBEPZmLxmcGQOMYgTBYCQNorwh+Ql4VUgSD4J6uRPAhEpRqWhYRjoXCCEy2BnAACiqkcAEpbvyzUKdhVPXtOK66oExwY3VEI1Ffhd4gLKEAA */\n id: \"SignTransactionDeviceAction\",\n initial: \"InitialState\",\n context: ({ input }) => {\n return {\n input,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n step: SignTransactionDAStep.OPEN_APP,\n },\n _internalState: {\n error: null,\n appConfig: null,\n clearSignContexts: null,\n serializedTransaction: null,\n chainId: null,\n web3Check: null,\n transactionType: null,\n isLegacy: true,\n signature: null,\n },\n };\n },\n states: {\n InitialState: {\n always: [\n {\n target: \"GetAppConfig\",\n guard: \"skipOpenApp\",\n },\n \"OpenAppDeviceAction\",\n ],\n },\n OpenAppDeviceAction: {\n invoke: {\n id: \"openAppStateMachine\",\n input: {\n appName: \"Ethereum\",\n compatibleAppNames: ETHEREUM_PLUGINS,\n },\n src: \"openAppStateMachine\",\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) => ({\n ..._.event.snapshot.context.intermediateValue,\n step: SignTransactionDAStep.OPEN_APP,\n }),\n }),\n },\n onDone: {\n actions: assign({\n _internalState: (_) => {\n return _.event.output.caseOf<SignTransactionDAInternalState>({\n Right: () => _.context._internalState,\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n });\n },\n }),\n target: \"CheckOpenAppDeviceActionResult\",\n },\n },\n },\n CheckOpenAppDeviceActionResult: {\n always: [\n {\n target: \"GetAppConfig\",\n guard: \"noInternalError\",\n },\n \"Error\",\n ],\n },\n GetAppConfig: {\n entry: assign({\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n step: SignTransactionDAStep.GET_APP_CONFIG,\n },\n }),\n invoke: {\n id: \"getAppConfig\",\n src: \"getAppConfig\",\n onDone: {\n target: \"GetAppConfigResultCheck\",\n actions: [\n assign({\n _internalState: ({ event, context }) => {\n if (isSuccessCommandResult(event.output)) {\n return {\n ...context._internalState,\n appConfig: event.output.data,\n };\n } else {\n return {\n ...context._internalState,\n error: event.output.error,\n };\n }\n },\n }),\n ],\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n GetAppConfigResultCheck: {\n always: [\n {\n target: \"Web3ChecksOptIn\",\n guard: and([\n \"noInternalError\",\n \"isWeb3ChecksSupported\",\n \"shouldOptIn\",\n ]),\n },\n {\n target: \"BuildContext\",\n guard: \"noInternalError\",\n },\n {\n target: \"Error\",\n },\n ],\n },\n Web3ChecksOptIn: {\n entry: assign({\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.Web3ChecksOptIn,\n step: SignTransactionDAStep.WEB3_CHECKS_OPT_IN,\n },\n }),\n invoke: {\n id: \"web3CheckOptIn\",\n src: \"web3CheckOptIn\",\n onDone: {\n target: \"Web3ChecksOptInResult\",\n actions: [\n assign({\n _internalState: ({ event, context }) => {\n if (isSuccessCommandResult(event.output)) {\n return {\n ...context._internalState,\n appConfig: {\n ...context._internalState.appConfig!,\n web3ChecksEnabled: event.output.data.enabled,\n },\n };\n } else {\n return context._internalState;\n }\n },\n }),\n ],\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n Web3ChecksOptInResult: {\n entry: assign(({ context }) => ({\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n step: SignTransactionDAStep.WEB3_CHECKS_OPT_IN_RESULT,\n result: context._internalState.appConfig!.web3ChecksEnabled,\n },\n })),\n // Using after transition to force a snapshot of the state after the entry action\n // This ensures the intermediateValue is captured before moving to BuildContext\n after: {\n 0: {\n target: \"BuildContext\",\n },\n },\n },\n BuildContext: {\n entry: assign({\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n step: SignTransactionDAStep.BUILD_CONTEXT,\n },\n }),\n invoke: {\n id: \"buildContext\",\n src: \"buildContext\",\n input: ({ context }) => ({\n contextModule: context.input.contextModule,\n mapper: context.input.mapper,\n transaction: context.input.transaction,\n options: context.input.options,\n appConfig: context._internalState.appConfig!,\n derivationPath: context.input.derivationPath,\n }),\n onDone: {\n target: \"BuildContextResultCheck\",\n actions: [\n assign({\n _internalState: ({ event, context }) => ({\n ...context._internalState,\n clearSignContexts: event.output.clearSignContexts!,\n web3Check: event.output.web3Check,\n serializedTransaction: event.output.serializedTransaction,\n chainId: event.output.chainId,\n transactionType: event.output.transactionType,\n }),\n }),\n ],\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n BuildContextResultCheck: {\n always: [\n {\n target: \"ProvideGenericContext\",\n guard: \"isGenericContext\",\n },\n {\n target: \"ProvideContext\",\n },\n ],\n },\n ProvideContext: {\n entry: assign({\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n step: SignTransactionDAStep.PROVIDE_CONTEXT,\n },\n }),\n invoke: {\n id: \"provideContext\",\n src: \"provideContext\",\n input: ({ context }) => ({\n clearSignContexts: context._internalState\n .clearSignContexts as ClearSignContextSuccess[],\n web3Check: context._internalState.web3Check,\n }),\n onDone: {\n target: \"SignTransaction\",\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n ProvideGenericContext: {\n entry: assign({\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n step: SignTransactionDAStep.PROVIDE_GENERIC_CONTEXT,\n },\n }),\n invoke: {\n id: \"provideGenericContext\",\n src: \"provideGenericContext\",\n input: ({ context }) => ({\n contextModule: context.input.contextModule,\n transactionParser: context.input.parser,\n chainId: context._internalState.chainId!,\n derivationPath: context.input.derivationPath,\n serializedTransaction:\n context._internalState.serializedTransaction!,\n context: context._internalState\n .clearSignContexts as GenericContext,\n web3Check: context._internalState.web3Check,\n }),\n onDone: {\n actions: assign({\n _internalState: ({ event, context }) => {\n const { isLegacy: _, ...rest } = context._internalState;\n return event.output.caseOf({\n Just: () => ({\n ...rest,\n isLegacy: false,\n }),\n Nothing: () => ({\n ...rest,\n isLegacy: false,\n }),\n });\n },\n }),\n // NOTE: don't check errors to fallback to blind signing\n target: \"SignTransaction\",\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n SignTransaction: {\n entry: assign({\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.SignTransaction,\n step: SignTransactionDAStep.SIGN_TRANSACTION,\n },\n }),\n invoke: {\n id: \"signTransaction\",\n src: \"signTransaction\",\n input: ({ context }) => ({\n derivationPath: context.input.derivationPath,\n serializedTransaction:\n context._internalState.serializedTransaction!,\n chainId: context._internalState.chainId!,\n transactionType: context._internalState.transactionType!,\n isLegacy: context._internalState.isLegacy,\n }),\n onDone: {\n target: \"SignTransactionResultCheck\",\n actions: [\n assign({\n _internalState: ({ event, context }) => {\n if (isSuccessCommandResult(event.output)) {\n return {\n ...context._internalState,\n signature: event.output.data,\n };\n }\n return {\n ...context._internalState,\n error: event.output.error,\n };\n },\n }),\n ],\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n SignTransactionResultCheck: {\n always: [\n { guard: \"noInternalError\", target: \"Success\" },\n { target: \"Error\" },\n ],\n },\n Success: {\n type: \"final\",\n },\n Error: {\n type: \"final\",\n },\n },\n output: ({ context }) =>\n context._internalState.signature\n ? Right(context._internalState.signature)\n : Left(\n context._internalState.error ||\n new UnknownDAError(\"No error in final state\"),\n ),\n });\n }\n\n extractDependencies(internalApi: InternalApi): MachineDependencies {\n const getAppConfig = async () =>\n internalApi.sendCommand(new GetAppConfiguration());\n const web3CheckOptIn = async () =>\n internalApi.sendCommand(new Web3CheckOptInCommand());\n const buildContext = async (arg0: {\n input: BuildTransactionContextTaskArgs;\n }) => new BuildTransactionContextTask(internalApi, arg0.input).run();\n\n const provideContext = async (arg0: {\n input: {\n clearSignContexts: ClearSignContextSuccess[];\n web3Check: ClearSignContextSuccess<ClearSignContextType.WEB3_CHECK> | null;\n };\n }) =>\n new ProvideTransactionContextTask(internalApi, {\n clearSignContexts: arg0.input.clearSignContexts,\n web3Check: arg0.input.web3Check,\n }).run();\n\n const provideGenericContext = async (arg0: {\n input: {\n contextModule: ContextModule;\n transactionParser: TransactionParserService;\n chainId: number;\n derivationPath: string;\n serializedTransaction: Uint8Array;\n context: GenericContext;\n web3Check: ClearSignContextSuccess<ClearSignContextType.WEB3_CHECK> | null;\n };\n }) =>\n new ProvideTransactionGenericContextTask(internalApi, {\n contextModule: arg0.input.contextModule,\n transactionParser: arg0.input.transactionParser,\n chainId: arg0.input.chainId,\n derivationPath: arg0.input.derivationPath,\n serializedTransaction: arg0.input.serializedTransaction,\n context: arg0.input.context,\n web3Check: arg0.input.web3Check,\n }).run();\n\n const signTransaction = async (arg0: {\n input: {\n derivationPath: string;\n serializedTransaction: Uint8Array;\n chainId: number;\n transactionType: TransactionType;\n isLegacy: boolean;\n };\n }) => new SendSignTransactionTask(internalApi, arg0.input).run();\n\n return {\n getAppConfig,\n web3CheckOptIn,\n buildContext,\n provideContext,\n provideGenericContext,\n signTransaction,\n };\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iCAAAE,IAAA,eAAAC,EAAAH,GAKA,IAAAI,EAYO,2CACPC,EAAwC,qBACxCC,EAAgD,kBAGhDC,EAOO,4DAIPC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ACR,EACA,MAAO,CACL,KAAM,OACR,CACF,EACA,OAAQ,CAAC,CAAE,QAAAJ,CAAQ,IACjBA,EAAQ,eAAe,aACnB,SAAMA,EAAQ,eAAe,SAAS,KACtC,QACEA,EAAQ,eAAe,OACrB,IAAI,iBAAe,yBAAyB,CAChD,CACR,CAAC,CACH,CAEA,oBAAoBP,EAA+C,CAmDjE,MAAO,CACL,aAnDmB,SACnBA,EAAY,YAAY,IAAI,qBAAqB,EAmDjD,eAlDqB,SACrBA,EAAY,YAAY,IAAI,uBAAuB,EAkDnD,aAjDmB,MAAOa,GAEtB,IAAI,8BAA4Bb,EAAaa,EAAK,KAAK,EAAE,IAAI,EAgDjE,eA9CqB,MAAOA,GAM5B,IAAI,gCAA8Bb,EAAa,CAC7C,kBAAmBa,EAAK,MAAM,kBAC9B,UAAWA,EAAK,MAAM,SACxB,CAAC,EAAE,IAAI,EAsCP,sBApC4B,MAAOA,GAWnC,IAAI,uCAAqCb,EAAa,CACpD,cAAea,EAAK,MAAM,cAC1B,kBAAmBA,EAAK,MAAM,kBAC9B,QAASA,EAAK,MAAM,QACpB,eAAgBA,EAAK,MAAM,eAC3B,sBAAuBA,EAAK,MAAM,sBAClC,QAASA,EAAK,MAAM,QACpB,UAAWA,EAAK,MAAM,SACxB,CAAC,EAAE,IAAI,EAkBP,gBAhBsB,MAAOA,GAQzB,IAAI,0BAAwBb,EAAaa,EAAK,KAAK,EAAE,IAAI,CAS/D,CACF,CACF",
6
6
  "names": ["SignTransactionDeviceAction_exports", "__export", "SignTransactionDeviceAction", "__toCommonJS", "import_device_management_kit", "import_purify_ts", "import_xstate", "import_SignTransactionDeviceActionTypes", "import_GetAppConfigurationCommand", "import_Web3CheckOptInCommand", "import_plugins", "import_BuildTransactionContextTask", "import_ProvideTransactionContextTask", "import_ProvideTransactionGenericContextTask", "import_SendSignTransactionTask", "import_ApplicationChecker", "internalApi", "getAppConfig", "web3CheckOptIn", "buildContext", "provideContext", "provideGenericContext", "signTransaction", "context", "_", "input", "error", "event", "rest", "arg0"]
7
7
  }