@ledgerhq/device-signer-kit-ethereum 1.3.2 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) 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/SignerEthBuilder.js +1 -1
  4. package/lib/cjs/api/SignerEthBuilder.js.map +3 -3
  5. package/lib/cjs/api/SignerEthBuilder.test.js +1 -1
  6. package/lib/cjs/api/SignerEthBuilder.test.js.map +3 -3
  7. package/lib/cjs/api/app-binder/SignTransactionDeviceActionTypes.js +1 -1
  8. package/lib/cjs/api/app-binder/SignTransactionDeviceActionTypes.js.map +2 -2
  9. package/lib/cjs/api/app-binder/SignTypedDataDeviceActionTypes.js +1 -1
  10. package/lib/cjs/api/app-binder/SignTypedDataDeviceActionTypes.js.map +2 -2
  11. package/lib/cjs/api/model/AddressOptions.js +1 -1
  12. package/lib/cjs/api/model/AddressOptions.js.map +1 -1
  13. package/lib/cjs/api/model/MessageOptions.js +2 -0
  14. package/lib/cjs/api/model/MessageOptions.js.map +7 -0
  15. package/lib/cjs/api/model/TransactionOptions.js +1 -1
  16. package/lib/cjs/api/model/TransactionOptions.js.map +1 -1
  17. package/lib/cjs/api/model/TypedDataOptions.js +2 -0
  18. package/lib/cjs/api/model/TypedDataOptions.js.map +7 -0
  19. package/lib/cjs/internal/DefaultSignerEth.js +1 -1
  20. package/lib/cjs/internal/DefaultSignerEth.js.map +3 -3
  21. package/lib/cjs/internal/address/use-case/GetAddressUseCase.js +1 -1
  22. package/lib/cjs/internal/address/use-case/GetAddressUseCase.js.map +2 -2
  23. package/lib/cjs/internal/address/use-case/GetAddressUseCase.test.js +1 -1
  24. package/lib/cjs/internal/address/use-case/GetAddressUseCase.test.js.map +2 -2
  25. package/lib/cjs/internal/app-binder/EthAppBinder.js +1 -1
  26. package/lib/cjs/internal/app-binder/EthAppBinder.js.map +2 -2
  27. package/lib/cjs/internal/app-binder/EthAppBinder.test.js +1 -1
  28. package/lib/cjs/internal/app-binder/EthAppBinder.test.js.map +2 -2
  29. package/lib/cjs/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.js +1 -1
  30. package/lib/cjs/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.js.map +2 -2
  31. package/lib/cjs/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.test.js +1 -1
  32. package/lib/cjs/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.test.js.map +3 -3
  33. package/lib/cjs/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.js +1 -1
  34. package/lib/cjs/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.js.map +3 -3
  35. package/lib/cjs/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.test.js +1 -1
  36. package/lib/cjs/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.test.js.map +3 -3
  37. package/lib/cjs/internal/app-binder/device-action/__test-utils__/makeInternalApi.js +1 -1
  38. package/lib/cjs/internal/app-binder/device-action/__test-utils__/makeInternalApi.js.map +3 -3
  39. package/lib/cjs/internal/app-binder/task/BuildEIP712ContextTask.js +1 -1
  40. package/lib/cjs/internal/app-binder/task/BuildEIP712ContextTask.js.map +3 -3
  41. package/lib/cjs/internal/app-binder/task/BuildEIP712ContextTask.test.js +1 -1
  42. package/lib/cjs/internal/app-binder/task/BuildEIP712ContextTask.test.js.map +3 -3
  43. package/lib/cjs/internal/app-binder/task/BuildTransactionContextTask.js +1 -1
  44. package/lib/cjs/internal/app-binder/task/BuildTransactionContextTask.js.map +3 -3
  45. package/lib/cjs/internal/app-binder/task/BuildTransactionContextTask.test.js +1 -1
  46. package/lib/cjs/internal/app-binder/task/BuildTransactionContextTask.test.js.map +3 -3
  47. package/lib/cjs/internal/app-binder/task/ProvideEIP712ContextTask.js.map +2 -2
  48. package/lib/cjs/internal/app-binder/task/ProvideEIP712ContextTask.test.js +1 -1
  49. package/lib/cjs/internal/app-binder/task/ProvideEIP712ContextTask.test.js.map +2 -2
  50. package/lib/cjs/internal/app-binder/task/ProvideTransactionContextTask.js +1 -1
  51. package/lib/cjs/internal/app-binder/task/ProvideTransactionContextTask.js.map +3 -3
  52. package/lib/cjs/internal/app-binder/task/ProvideTransactionContextTask.test.js +1 -1
  53. package/lib/cjs/internal/app-binder/task/ProvideTransactionContextTask.test.js.map +3 -3
  54. package/lib/cjs/internal/app-binder/task/SignTypedDataLegacyTask.js +2 -0
  55. package/lib/cjs/internal/app-binder/task/SignTypedDataLegacyTask.js.map +7 -0
  56. package/lib/cjs/internal/app-binder/task/SignTypedDataLegacyTask.test.js +2 -0
  57. package/lib/cjs/internal/app-binder/task/SignTypedDataLegacyTask.test.js.map +7 -0
  58. package/lib/cjs/internal/message/use-case/SignMessageUseCase.js +1 -1
  59. package/lib/cjs/internal/message/use-case/SignMessageUseCase.js.map +3 -3
  60. package/lib/cjs/internal/message/use-case/SignMessageUseCase.test.js +1 -1
  61. package/lib/cjs/internal/message/use-case/SignMessageUseCase.test.js.map +2 -2
  62. package/lib/cjs/internal/shared/utils/ApplicationChecker.js +1 -1
  63. package/lib/cjs/internal/shared/utils/ApplicationChecker.js.map +3 -3
  64. package/lib/cjs/internal/shared/utils/ApplicationChecker.test.js +1 -1
  65. package/lib/cjs/internal/shared/utils/ApplicationChecker.test.js.map +3 -3
  66. package/lib/cjs/internal/typed-data/service/DefaultTypedDataParserService.js +1 -1
  67. package/lib/cjs/internal/typed-data/service/DefaultTypedDataParserService.js.map +2 -2
  68. package/lib/cjs/internal/typed-data/service/TypedDataParser.js +1 -1
  69. package/lib/cjs/internal/typed-data/service/TypedDataParser.js.map +3 -3
  70. package/lib/cjs/internal/typed-data/service/TypedDataParser.test.js +1 -1
  71. package/lib/cjs/internal/typed-data/service/TypedDataParser.test.js.map +2 -2
  72. package/lib/cjs/internal/typed-data/use-case/SignTypedDataUseCase.js +1 -1
  73. package/lib/cjs/internal/typed-data/use-case/SignTypedDataUseCase.js.map +3 -3
  74. package/lib/cjs/internal/typed-data/use-case/SignTypedDataUseCase.test.js +1 -1
  75. package/lib/cjs/internal/typed-data/use-case/SignTypedDataUseCase.test.js.map +2 -2
  76. package/lib/cjs/package.json +17 -17
  77. package/lib/esm/api/SignerEthBuilder.js +1 -1
  78. package/lib/esm/api/SignerEthBuilder.js.map +3 -3
  79. package/lib/esm/api/SignerEthBuilder.test.js +1 -1
  80. package/lib/esm/api/SignerEthBuilder.test.js.map +3 -3
  81. package/lib/esm/api/app-binder/SignTransactionDeviceActionTypes.js +1 -1
  82. package/lib/esm/api/app-binder/SignTransactionDeviceActionTypes.js.map +2 -2
  83. package/lib/esm/api/app-binder/SignTypedDataDeviceActionTypes.js +1 -1
  84. package/lib/esm/api/app-binder/SignTypedDataDeviceActionTypes.js.map +2 -2
  85. package/lib/esm/api/model/MessageOptions.js +1 -0
  86. package/lib/esm/api/model/MessageOptions.js.map +7 -0
  87. package/lib/esm/api/model/TypedDataOptions.js +1 -0
  88. package/lib/esm/api/model/TypedDataOptions.js.map +7 -0
  89. package/lib/esm/internal/DefaultSignerEth.js +1 -1
  90. package/lib/esm/internal/DefaultSignerEth.js.map +3 -3
  91. package/lib/esm/internal/address/use-case/GetAddressUseCase.js +1 -1
  92. package/lib/esm/internal/address/use-case/GetAddressUseCase.js.map +2 -2
  93. package/lib/esm/internal/address/use-case/GetAddressUseCase.test.js +1 -1
  94. package/lib/esm/internal/address/use-case/GetAddressUseCase.test.js.map +2 -2
  95. package/lib/esm/internal/app-binder/EthAppBinder.js +1 -1
  96. package/lib/esm/internal/app-binder/EthAppBinder.js.map +2 -2
  97. package/lib/esm/internal/app-binder/EthAppBinder.test.js +1 -1
  98. package/lib/esm/internal/app-binder/EthAppBinder.test.js.map +2 -2
  99. package/lib/esm/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.js +1 -1
  100. package/lib/esm/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.js.map +2 -2
  101. package/lib/esm/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.test.js +1 -1
  102. package/lib/esm/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.test.js.map +3 -3
  103. package/lib/esm/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.js +1 -1
  104. package/lib/esm/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.js.map +3 -3
  105. package/lib/esm/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.test.js +1 -1
  106. package/lib/esm/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.test.js.map +3 -3
  107. package/lib/esm/internal/app-binder/device-action/__test-utils__/makeInternalApi.js +1 -1
  108. package/lib/esm/internal/app-binder/device-action/__test-utils__/makeInternalApi.js.map +3 -3
  109. package/lib/esm/internal/app-binder/task/BuildEIP712ContextTask.js +1 -1
  110. package/lib/esm/internal/app-binder/task/BuildEIP712ContextTask.js.map +3 -3
  111. package/lib/esm/internal/app-binder/task/BuildEIP712ContextTask.test.js +1 -1
  112. package/lib/esm/internal/app-binder/task/BuildEIP712ContextTask.test.js.map +3 -3
  113. package/lib/esm/internal/app-binder/task/BuildTransactionContextTask.js +1 -1
  114. package/lib/esm/internal/app-binder/task/BuildTransactionContextTask.js.map +3 -3
  115. package/lib/esm/internal/app-binder/task/BuildTransactionContextTask.test.js +1 -1
  116. package/lib/esm/internal/app-binder/task/BuildTransactionContextTask.test.js.map +3 -3
  117. package/lib/esm/internal/app-binder/task/ProvideEIP712ContextTask.js.map +2 -2
  118. package/lib/esm/internal/app-binder/task/ProvideEIP712ContextTask.test.js +1 -1
  119. package/lib/esm/internal/app-binder/task/ProvideEIP712ContextTask.test.js.map +2 -2
  120. package/lib/esm/internal/app-binder/task/ProvideTransactionContextTask.js +1 -1
  121. package/lib/esm/internal/app-binder/task/ProvideTransactionContextTask.js.map +3 -3
  122. package/lib/esm/internal/app-binder/task/ProvideTransactionContextTask.test.js +1 -1
  123. package/lib/esm/internal/app-binder/task/ProvideTransactionContextTask.test.js.map +3 -3
  124. package/lib/esm/internal/app-binder/task/SignTypedDataLegacyTask.js +2 -0
  125. package/lib/esm/internal/app-binder/task/SignTypedDataLegacyTask.js.map +7 -0
  126. package/lib/esm/internal/app-binder/task/SignTypedDataLegacyTask.test.js +2 -0
  127. package/lib/esm/internal/app-binder/task/SignTypedDataLegacyTask.test.js.map +7 -0
  128. package/lib/esm/internal/message/use-case/SignMessageUseCase.js +1 -1
  129. package/lib/esm/internal/message/use-case/SignMessageUseCase.js.map +3 -3
  130. package/lib/esm/internal/message/use-case/SignMessageUseCase.test.js +1 -1
  131. package/lib/esm/internal/message/use-case/SignMessageUseCase.test.js.map +2 -2
  132. package/lib/esm/internal/shared/utils/ApplicationChecker.js +1 -1
  133. package/lib/esm/internal/shared/utils/ApplicationChecker.js.map +3 -3
  134. package/lib/esm/internal/shared/utils/ApplicationChecker.test.js +1 -1
  135. package/lib/esm/internal/shared/utils/ApplicationChecker.test.js.map +3 -3
  136. package/lib/esm/internal/typed-data/service/DefaultTypedDataParserService.js +1 -1
  137. package/lib/esm/internal/typed-data/service/DefaultTypedDataParserService.js.map +2 -2
  138. package/lib/esm/internal/typed-data/service/TypedDataParser.js +1 -1
  139. package/lib/esm/internal/typed-data/service/TypedDataParser.js.map +3 -3
  140. package/lib/esm/internal/typed-data/service/TypedDataParser.test.js +1 -1
  141. package/lib/esm/internal/typed-data/service/TypedDataParser.test.js.map +2 -2
  142. package/lib/esm/internal/typed-data/use-case/SignTypedDataUseCase.js +1 -1
  143. package/lib/esm/internal/typed-data/use-case/SignTypedDataUseCase.js.map +3 -3
  144. package/lib/esm/internal/typed-data/use-case/SignTypedDataUseCase.test.js +1 -1
  145. package/lib/esm/internal/typed-data/use-case/SignTypedDataUseCase.test.js.map +2 -2
  146. package/lib/esm/package.json +17 -17
  147. package/lib/types/api/SignerEth.d.ts +4 -2
  148. package/lib/types/api/SignerEth.d.ts.map +1 -1
  149. package/lib/types/api/SignerEthBuilder.d.ts +4 -2
  150. package/lib/types/api/SignerEthBuilder.d.ts.map +1 -1
  151. package/lib/types/api/app-binder/SignTransactionDeviceActionTypes.d.ts +8 -3
  152. package/lib/types/api/app-binder/SignTransactionDeviceActionTypes.d.ts.map +1 -1
  153. package/lib/types/api/app-binder/SignTypedDataDeviceActionTypes.d.ts +9 -3
  154. package/lib/types/api/app-binder/SignTypedDataDeviceActionTypes.d.ts.map +1 -1
  155. package/lib/types/api/model/AddressOptions.d.ts +1 -0
  156. package/lib/types/api/model/AddressOptions.d.ts.map +1 -1
  157. package/lib/types/api/model/MessageOptions.d.ts +4 -0
  158. package/lib/types/api/model/MessageOptions.d.ts.map +1 -0
  159. package/lib/types/api/model/TransactionOptions.d.ts +1 -0
  160. package/lib/types/api/model/TransactionOptions.d.ts.map +1 -1
  161. package/lib/types/api/model/TypedDataOptions.d.ts +4 -0
  162. package/lib/types/api/model/TypedDataOptions.d.ts.map +1 -0
  163. package/lib/types/internal/DefaultSignerEth.d.ts +5 -3
  164. package/lib/types/internal/DefaultSignerEth.d.ts.map +1 -1
  165. package/lib/types/internal/address/use-case/GetAddressUseCase.d.ts.map +1 -1
  166. package/lib/types/internal/app-binder/EthAppBinder.d.ts +5 -2
  167. package/lib/types/internal/app-binder/EthAppBinder.d.ts.map +1 -1
  168. package/lib/types/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.d.ts +1 -1
  169. package/lib/types/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.d.ts.map +1 -1
  170. package/lib/types/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.d.ts +2 -3
  171. package/lib/types/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.d.ts.map +1 -1
  172. package/lib/types/internal/app-binder/device-action/__test-utils__/makeInternalApi.d.ts.map +1 -1
  173. package/lib/types/internal/app-binder/task/BuildEIP712ContextTask.d.ts +3 -2
  174. package/lib/types/internal/app-binder/task/BuildEIP712ContextTask.d.ts.map +1 -1
  175. package/lib/types/internal/app-binder/task/BuildTransactionContextTask.d.ts +2 -1
  176. package/lib/types/internal/app-binder/task/BuildTransactionContextTask.d.ts.map +1 -1
  177. package/lib/types/internal/app-binder/task/ProvideEIP712ContextTask.d.ts +0 -2
  178. package/lib/types/internal/app-binder/task/ProvideEIP712ContextTask.d.ts.map +1 -1
  179. package/lib/types/internal/app-binder/task/SignTypedDataLegacyTask.d.ts +12 -0
  180. package/lib/types/internal/app-binder/task/SignTypedDataLegacyTask.d.ts.map +1 -0
  181. package/lib/types/internal/app-binder/task/SignTypedDataLegacyTask.test.d.ts +2 -0
  182. package/lib/types/internal/app-binder/task/SignTypedDataLegacyTask.test.d.ts.map +1 -0
  183. package/lib/types/internal/message/use-case/SignMessageUseCase.d.ts +2 -1
  184. package/lib/types/internal/message/use-case/SignMessageUseCase.d.ts.map +1 -1
  185. package/lib/types/internal/shared/utils/ApplicationChecker.d.ts +2 -1
  186. package/lib/types/internal/shared/utils/ApplicationChecker.d.ts.map +1 -1
  187. package/lib/types/internal/typed-data/service/TypedDataParser.d.ts +4 -2
  188. package/lib/types/internal/typed-data/service/TypedDataParser.d.ts.map +1 -1
  189. package/lib/types/internal/typed-data/use-case/SignTypedDataUseCase.d.ts +2 -1
  190. package/lib/types/internal/typed-data/use-case/SignTypedDataUseCase.d.ts.map +1 -1
  191. package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
  192. package/package.json +17 -17
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/typed-data/service/TypedDataParser.test.ts"],
4
- "sourcesContent": ["import { hexaStringToBuffer } from \"@ledgerhq/device-management-kit\";\nimport { Just, Nothing, Right } from \"purify-ts\";\n\nimport { type TypedData } from \"@api/model/TypedData\";\nimport {\n ArrayType,\n PrimitiveType,\n StructType,\n TypedDataValueArray,\n TypedDataValueField,\n TypedDataValueRoot,\n} from \"@internal/typed-data/model/Types\";\n\nimport { TypedDataParser } from \"./TypedDataParser\";\n\ndescribe(\"TypedDataParser - types parsing\", () => {\n it(\"Parse primitive types bytes\", () => {\n // GIVEN\n const types = {\n TestStruct: [\n { name: \"test1\", type: \"bytes\" },\n { name: \"test2\", type: \"bytes1\" },\n { name: \"test3\", type: \"bytes2\" },\n { name: \"test4\", type: \"bytes31\" },\n { name: \"test5\", type: \"bytes32\" },\n ],\n };\n // WHEN\n const parser = new TypedDataParser(types);\n // THEN\n const expected = {\n TestStruct: {\n test1: new PrimitiveType(\"bytes\", \"bytes\", Nothing),\n test2: new PrimitiveType(\"bytes1\", \"bytes\", Just(1)),\n test3: new PrimitiveType(\"bytes2\", \"bytes\", Just(2)),\n test4: new PrimitiveType(\"bytes31\", \"bytes\", Just(31)),\n test5: new PrimitiveType(\"bytes32\", \"bytes\", Just(32)),\n },\n };\n expect(parser.getStructDefinitions()).toStrictEqual(expected);\n });\n\n it(\"Parse primitive types bytes, out of bound\", () => {\n // GIVEN\n const types = {\n TestStruct: [\n { name: \"invalid1\", type: \"bytes0\" },\n { name: \"invalid2\", type: \"bytes33\" },\n ],\n };\n // WHEN\n const parser = new TypedDataParser(types);\n // THEN\n const expected = {\n TestStruct: {\n invalid1: new StructType(\"bytes0\"),\n invalid2: new StructType(\"bytes33\"),\n },\n };\n expect(parser.getStructDefinitions()).toStrictEqual(expected);\n });\n\n it(\"Parse primitive types number\", () => {\n // GIVEN\n const types = {\n TestStruct: [\n { name: \"test1\", type: \"int8\" },\n { name: \"test2\", type: \"uint8\" },\n { name: \"test3\", type: \"int16\" },\n { name: \"test4\", type: \"uint32\" },\n { name: \"test5\", type: \"uint64\" },\n { name: \"test6\", type: \"int128\" },\n { name: \"test7\", type: \"int136\" },\n { name: \"test8\", type: \"int144\" },\n { name: \"test9\", type: \"uint240\" },\n { name: \"test10\", type: \"uint248\" },\n { name: \"test11\", type: \"uint256\" },\n { name: \"test12\", type: \"int256\" },\n ],\n };\n // WHEN\n const parser = new TypedDataParser(types);\n // THEN\n const expected = {\n TestStruct: {\n test1: new PrimitiveType(\"int8\", \"int\", Just(1)),\n test2: new PrimitiveType(\"uint8\", \"uint\", Just(1)),\n test3: new PrimitiveType(\"int16\", \"int\", Just(2)),\n test4: new PrimitiveType(\"uint32\", \"uint\", Just(4)),\n test5: new PrimitiveType(\"uint64\", \"uint\", Just(8)),\n test6: new PrimitiveType(\"int128\", \"int\", Just(16)),\n test7: new PrimitiveType(\"int136\", \"int\", Just(17)),\n test8: new PrimitiveType(\"int144\", \"int\", Just(18)),\n test9: new PrimitiveType(\"uint240\", \"uint\", Just(30)),\n test10: new PrimitiveType(\"uint248\", \"uint\", Just(31)),\n test11: new PrimitiveType(\"uint256\", \"uint\", Just(32)),\n test12: new PrimitiveType(\"int256\", \"int\", Just(32)),\n },\n };\n expect(parser.getStructDefinitions()).toStrictEqual(expected);\n });\n\n it(\"Parse primitive types number, out of bound\", () => {\n // GIVEN\n const types = {\n TestStruct: [\n { name: \"invalid1\", type: \"int0\" },\n { name: \"invalid2\", type: \"uint0\" },\n { name: \"invalid3\", type: \"int7\" },\n { name: \"invalid4\", type: \"int257\" },\n { name: \"invalid5\", type: \"uint257\" },\n { name: \"invalid6\", type: \"int512\" },\n ],\n };\n // WHEN\n const parser = new TypedDataParser(types);\n // THEN\n const expected = {\n TestStruct: {\n invalid1: new StructType(\"int0\"),\n invalid2: new StructType(\"uint0\"),\n invalid3: new StructType(\"int7\"),\n invalid4: new StructType(\"int257\"),\n invalid5: new StructType(\"uint257\"),\n invalid6: new StructType(\"int512\"),\n },\n };\n expect(parser.getStructDefinitions()).toStrictEqual(expected);\n });\n\n it(\"Parse primitive types others\", () => {\n // GIVEN\n const types = {\n TestStruct: [\n { name: \"test1\", type: \"address\" },\n { name: \"test2\", type: \"bool\" },\n { name: \"test3\", type: \"string\" },\n ],\n };\n // WHEN\n const parser = new TypedDataParser(types);\n // THEN\n const expected = {\n TestStruct: {\n test1: new PrimitiveType(\"address\", \"address\", Nothing),\n test2: new PrimitiveType(\"bool\", \"bool\", Nothing),\n test3: new PrimitiveType(\"string\", \"string\", Nothing),\n },\n };\n expect(parser.getStructDefinitions()).toStrictEqual(expected);\n });\n\n it(\"Parse arrays\", () => {\n // GIVEN\n const types = {\n TestStruct: [\n { name: \"test1\", type: \"address[]\" },\n { name: \"test2\", type: \"uint16[3]\" },\n { name: \"test3\", type: \"custom[2][][3]\" },\n { name: \"test4\", type: \"string[2][][3][]\" },\n ],\n };\n // WHEN\n const parser = new TypedDataParser(types);\n // THEN\n const expected = {\n TestStruct: {\n test1: new ArrayType(\n \"address[]\",\n new PrimitiveType(\"address\", \"address\", Nothing),\n \"address\",\n Nothing,\n [Nothing],\n ),\n test2: new ArrayType(\n \"uint16[3]\",\n new PrimitiveType(\"uint16\", \"uint\", Just(2)),\n \"uint16\",\n Just(3),\n [Just(3)],\n ),\n test3: new ArrayType(\n \"custom[2][][3]\",\n new StructType(\"custom\"),\n \"custom[2][]\",\n Just(3),\n [Just(2), Nothing, Just(3)],\n ),\n test4: new ArrayType(\n \"string[2][][3][]\",\n new PrimitiveType(\"string\", \"string\", Nothing),\n \"string[2][][3]\",\n Nothing,\n [Just(2), Nothing, Just(3), Nothing],\n ),\n },\n };\n expect(parser.getStructDefinitions()).toStrictEqual(expected);\n });\n\n it(\"Parse custom struct\", () => {\n // GIVEN\n const types = {\n TestStruct: [{ name: \"test\", type: \"MyCustomStructure\" }],\n };\n // WHEN\n const parser = new TypedDataParser(types);\n // THEN\n const expected = {\n TestStruct: {\n test: new StructType(\"MyCustomStructure\"),\n },\n };\n expect(parser.getStructDefinitions()).toStrictEqual(expected);\n });\n});\n\ndescribe(\"TypedDataParser - message parsing\", () => {\n const MESSAGE: TypedData = {\n domain: {\n chainId: 0,\n name: \"Ether Mail\",\n verifyingContract: \"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC\",\n version: \"1\",\n },\n message: {\n contents: \"Hello, Bob!\",\n from: {\n name: \"Cow\",\n wallets: [\n \"0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826\",\n \"0xDeaDbeefdEAdbeefdEadbEEFdeadbeEFdEaDbeeF\",\n ],\n },\n to: [\n {\n wallets: [\n \"0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB\",\n \"0xB0BdaBea57B0BDABeA57b0bdABEA57b0BDabEa57\",\n \"0xB0B0b0b0b0b0B000000000000000000000000000\",\n ],\n name: \"Bob\",\n },\n ],\n },\n primaryType: \"Mail\",\n types: {\n EIP712Domain: [\n { name: \"name\", type: \"string\" },\n { name: \"version\", type: \"string\" },\n { name: \"chainId\", type: \"uint256\" },\n { name: \"verifyingContract\", type: \"address\" },\n ],\n Mail: [\n { name: \"from\", type: \"Person\" },\n { name: \"to\", type: \"Person[1]\" },\n { name: \"contents\", type: \"string\" },\n ],\n Person: [\n { name: \"name\", type: \"string\" },\n { name: \"wallets\", type: \"address[]\" },\n ],\n },\n };\n\n it(\"Parse an EIP712 message\", () => {\n // GIVEN\n const types = MESSAGE.types;\n const primaryType = MESSAGE.primaryType;\n const message = MESSAGE.message;\n // WHEN\n const parser = new TypedDataParser(types);\n // THEN\n const parsed = parser.parse(primaryType, message);\n const expected = [\n {\n path: \"\",\n type: \"\",\n value: new TypedDataValueRoot(primaryType),\n },\n {\n path: \"from.name\",\n type: \"string\",\n value: new TypedDataValueField(new TextEncoder().encode(\"Cow\")),\n },\n {\n path: \"from.wallets\",\n type: \"address[]\",\n value: new TypedDataValueArray(2),\n },\n {\n path: \"from.wallets.[]\",\n type: \"address\",\n value: new TypedDataValueField(\n hexaStringToBuffer(\"0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826\")!,\n ),\n },\n {\n path: \"from.wallets.[]\",\n type: \"address\",\n value: new TypedDataValueField(\n hexaStringToBuffer(\"0xDeaDbeefdEAdbeefdEadbEEFdeadbeEFdEaDbeeF\")!,\n ),\n },\n { path: \"to\", type: \"Person[1]\", value: new TypedDataValueArray(1) },\n {\n path: \"to.[].name\",\n type: \"string\",\n value: new TypedDataValueField(new TextEncoder().encode(\"Bob\")),\n },\n {\n path: \"to.[].wallets\",\n type: \"address[]\",\n value: new TypedDataValueArray(3),\n },\n {\n path: \"to.[].wallets.[]\",\n type: \"address\",\n value: new TypedDataValueField(\n hexaStringToBuffer(\"0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB\")!,\n ),\n },\n {\n path: \"to.[].wallets.[]\",\n type: \"address\",\n value: new TypedDataValueField(\n hexaStringToBuffer(\"0xB0BdaBea57B0BDABeA57b0bdABEA57b0BDabEa57\")!,\n ),\n },\n {\n path: \"to.[].wallets.[]\",\n type: \"address\",\n value: new TypedDataValueField(\n hexaStringToBuffer(\"0xB0B0b0b0b0b0B000000000000000000000000000\")!,\n ),\n },\n {\n path: \"contents\",\n type: \"string\",\n value: new TypedDataValueField(new TextEncoder().encode(\"Hello, Bob!\")),\n },\n ];\n expect(parsed).toStrictEqual(Right(expected));\n });\n\n it(\"Parse an EIP712 domain\", () => {\n // GIVEN\n const types = MESSAGE.types;\n const primaryType = \"EIP712Domain\";\n const message = MESSAGE.domain;\n // WHEN\n const parser = new TypedDataParser(types);\n // THEN\n const expected = [\n {\n path: \"\",\n type: \"\",\n value: new TypedDataValueRoot(primaryType),\n },\n {\n path: \"name\",\n type: \"string\",\n value: new TypedDataValueField(new TextEncoder().encode(\"Ether Mail\")),\n },\n {\n path: \"version\",\n type: \"string\",\n value: new TypedDataValueField(new TextEncoder().encode(\"1\")),\n },\n {\n path: \"chainId\",\n type: \"uint256\",\n value: new TypedDataValueField(Uint8Array.from([0])),\n },\n {\n path: \"verifyingContract\",\n type: \"address\",\n value: new TypedDataValueField(\n hexaStringToBuffer(\"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC\")!,\n ),\n },\n ];\n const parsed = parser.parse(primaryType, message);\n expect(parsed).toStrictEqual(Right(expected));\n });\n\n it(\"Invalid primary type\", () => {\n // GIVEN\n const types = MESSAGE.types;\n const primaryType = \"unknown\";\n const message = MESSAGE.domain;\n // WHEN\n const parser = new TypedDataParser(types);\n // THEN\n const parsed = parser.parse(primaryType, message);\n expect(parsed.isLeft()).toStrictEqual(true);\n });\n\n it(\"Struct points to an unknown custom type\", () => {\n // GIVEN\n const types = {\n Mail: [{ name: \"from\", type: \"Person\" }],\n };\n const primaryType = \"Mail\";\n const message = {\n from: \"0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826\",\n };\n // WHEN\n const parser = new TypedDataParser(types);\n // THEN\n const parsed = parser.parse(primaryType, message);\n expect(parsed.isLeft()).toStrictEqual(true);\n });\n\n it(\"Array contains an unknown custom type\", () => {\n // GIVEN\n const types = {\n Mail: [{ name: \"from\", type: \"Person[]\" }],\n };\n const primaryType = \"Mail\";\n const message = {\n from: [\"0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826\"],\n };\n // WHEN\n const parser = new TypedDataParser(types);\n // THEN\n const parsed = parser.parse(primaryType, message);\n expect(parsed.isLeft()).toStrictEqual(true);\n });\n\n it(\"Invalid primitive value\", () => {\n // GIVEN\n const types = {\n Mail: [{ name: \"from\", type: \"uint8\" }],\n };\n const primaryType = \"Mail\";\n const message = {\n from: 3000,\n };\n // WHEN\n const parser = new TypedDataParser(types);\n // THEN\n const parsed = parser.parse(primaryType, message);\n expect(parsed.isLeft()).toStrictEqual(true);\n });\n\n it(\"Array instead of primitive value\", () => {\n // GIVEN\n const types = {\n Mail: [{ name: \"from\", type: \"uint8\" }],\n };\n const primaryType = \"Mail\";\n const message = {\n from: [42],\n };\n // WHEN\n const parser = new TypedDataParser(types);\n // THEN\n const parsed = parser.parse(primaryType, message);\n expect(parsed.isLeft()).toStrictEqual(true);\n });\n\n it(\"Struct instead of primitive value\", () => {\n // GIVEN\n const types = {\n Mail: [{ name: \"from\", type: \"uint8\" }],\n };\n const primaryType = \"Mail\";\n const message = {\n from: { data: 42 },\n };\n // WHEN\n const parser = new TypedDataParser(types);\n // THEN\n const parsed = parser.parse(primaryType, message);\n expect(parsed.isLeft()).toStrictEqual(true);\n });\n\n it(\"Struct value not a record\", () => {\n // GIVEN\n const types = {\n Mail: [{ name: \"from\", type: \"Person\" }],\n Person: [{ name: \"data\", type: \"uint8\" }],\n };\n const primaryType = \"Mail\";\n const message = {\n from: 42,\n };\n // WHEN\n const parser = new TypedDataParser(types);\n // THEN\n const parsed = parser.parse(primaryType, message);\n expect(parsed.isLeft()).toStrictEqual(true);\n });\n\n it(\"Struct field not present in value\", () => {\n // GIVEN\n const types = {\n Mail: [{ name: \"from\", type: \"uint8\" }],\n };\n const primaryType = \"Mail\";\n const message = {\n to: 42,\n };\n // WHEN\n const parser = new TypedDataParser(types);\n // THEN\n const parsed = parser.parse(primaryType, message);\n expect(parsed.isLeft()).toStrictEqual(true);\n });\n\n it(\"Array value not an array\", () => {\n // GIVEN\n const types = {\n Mail: [{ name: \"from\", type: \"uint8[]\" }],\n };\n const primaryType = \"Mail\";\n const message = {\n from: 42,\n };\n // WHEN\n const parser = new TypedDataParser(types);\n // THEN\n const parsed = parser.parse(primaryType, message);\n expect(parsed.isLeft()).toStrictEqual(true);\n });\n\n it(\"Array value with invalid size\", () => {\n // GIVEN\n const types = {\n Mail: [{ name: \"from\", type: \"uint8[3]\" }],\n };\n const primaryType = \"Mail\";\n const message = {\n from: [42],\n };\n // WHEN\n const parser = new TypedDataParser(types);\n // THEN\n const parsed = parser.parse(primaryType, message);\n expect(parsed.isLeft()).toStrictEqual(true);\n });\n});\n"],
5
- "mappings": "aAAA,IAAAA,EAAmC,2CACnCC,EAAqC,qBAGrCC,EAOO,4CAEPC,EAAgC,6BAEhC,SAAS,kCAAmC,IAAM,CAChD,GAAG,8BAA+B,IAAM,CAEtC,MAAMC,EAAQ,CACZ,WAAY,CACV,CAAE,KAAM,QAAS,KAAM,OAAQ,EAC/B,CAAE,KAAM,QAAS,KAAM,QAAS,EAChC,CAAE,KAAM,QAAS,KAAM,QAAS,EAChC,CAAE,KAAM,QAAS,KAAM,SAAU,EACj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,EAAU,CACd,KAAM,EACR,EAIMC,EAFS,IAAI,kBAAgBN,CAAK,EAElB,MAAMI,EAAaC,CAAO,EAChD,OAAOC,EAAO,OAAO,CAAC,EAAE,cAAc,EAAI,CAC5C,CAAC,EAED,GAAG,oCAAqC,IAAM,CAE5C,MAAMN,EAAQ,CACZ,KAAM,CAAC,CAAE,KAAM,OAAQ,KAAM,OAAQ,CAAC,CACxC,EACMI,EAAc,OACdC,EAAU,CACd,GAAI,EACN,EAIMC,EAFS,IAAI,kBAAgBN,CAAK,EAElB,MAAMI,EAAaC,CAAO,EAChD,OAAOC,EAAO,OAAO,CAAC,EAAE,cAAc,EAAI,CAC5C,CAAC,EAED,GAAG,2BAA4B,IAAM,CAEnC,MAAMN,EAAQ,CACZ,KAAM,CAAC,CAAE,KAAM,OAAQ,KAAM,SAAU,CAAC,CAC1C,EACMI,EAAc,OACdC,EAAU,CACd,KAAM,EACR,EAIMC,EAFS,IAAI,kBAAgBN,CAAK,EAElB,MAAMI,EAAaC,CAAO,EAChD,OAAOC,EAAO,OAAO,CAAC,EAAE,cAAc,EAAI,CAC5C,CAAC,EAED,GAAG,gCAAiC,IAAM,CAExC,MAAMN,EAAQ,CACZ,KAAM,CAAC,CAAE,KAAM,OAAQ,KAAM,UAAW,CAAC,CAC3C,EACMI,EAAc,OACdC,EAAU,CACd,KAAM,CAAC,EAAE,CACX,EAIMC,EAFS,IAAI,kBAAgBN,CAAK,EAElB,MAAMI,EAAaC,CAAO,EAChD,OAAOC,EAAO,OAAO,CAAC,EAAE,cAAc,EAAI,CAC5C,CAAC,CACH,CAAC",
4
+ "sourcesContent": ["import { hexaStringToBuffer } from \"@ledgerhq/device-management-kit\";\nimport { Just, Nothing, Right } from \"purify-ts\";\n\nimport { type TypedData } from \"@api/model/TypedData\";\nimport {\n ArrayType,\n PrimitiveType,\n StructType,\n TypedDataValueArray,\n TypedDataValueField,\n TypedDataValueRoot,\n} from \"@internal/typed-data/model/Types\";\n\nimport { TypedDataParser } from \"./TypedDataParser\";\n\ndescribe(\"TypedDataParser - types parsing\", () => {\n it(\"Parse primitive types bytes\", () => {\n // GIVEN\n const types = {\n TestStruct: [\n { name: \"test1\", type: \"bytes\" },\n { name: \"test2\", type: \"bytes1\" },\n { name: \"test3\", type: \"bytes2\" },\n { name: \"test4\", type: \"bytes31\" },\n { name: \"test5\", type: \"bytes32\" },\n ],\n };\n // WHEN\n const parser = new TypedDataParser(types, {});\n // THEN\n const expected = {\n TestStruct: {\n test1: new PrimitiveType(\"bytes\", \"bytes\", Nothing),\n test2: new PrimitiveType(\"bytes1\", \"bytes\", Just(1)),\n test3: new PrimitiveType(\"bytes2\", \"bytes\", Just(2)),\n test4: new PrimitiveType(\"bytes31\", \"bytes\", Just(31)),\n test5: new PrimitiveType(\"bytes32\", \"bytes\", Just(32)),\n },\n };\n expect(parser.getStructDefinitions()).toStrictEqual(expected);\n });\n\n it(\"Parse primitive types bytes, out of bound\", () => {\n // GIVEN\n const types = {\n TestStruct: [\n { name: \"invalid1\", type: \"bytes0\" },\n { name: \"invalid2\", type: \"bytes33\" },\n ],\n };\n // WHEN\n const parser = new TypedDataParser(types, {});\n // THEN\n const expected = {\n TestStruct: {\n invalid1: new StructType(\"bytes0\"),\n invalid2: new StructType(\"bytes33\"),\n },\n };\n expect(parser.getStructDefinitions()).toStrictEqual(expected);\n });\n\n it(\"Parse primitive types number\", () => {\n // GIVEN\n const types = {\n TestStruct: [\n { name: \"test1\", type: \"int8\" },\n { name: \"test2\", type: \"uint8\" },\n { name: \"test3\", type: \"int16\" },\n { name: \"test4\", type: \"uint32\" },\n { name: \"test5\", type: \"uint64\" },\n { name: \"test6\", type: \"int128\" },\n { name: \"test7\", type: \"int136\" },\n { name: \"test8\", type: \"int144\" },\n { name: \"test9\", type: \"uint240\" },\n { name: \"test10\", type: \"uint248\" },\n { name: \"test11\", type: \"uint256\" },\n { name: \"test12\", type: \"int256\" },\n ],\n };\n // WHEN\n const parser = new TypedDataParser(types, {});\n // THEN\n const expected = {\n TestStruct: {\n test1: new PrimitiveType(\"int8\", \"int\", Just(1)),\n test2: new PrimitiveType(\"uint8\", \"uint\", Just(1)),\n test3: new PrimitiveType(\"int16\", \"int\", Just(2)),\n test4: new PrimitiveType(\"uint32\", \"uint\", Just(4)),\n test5: new PrimitiveType(\"uint64\", \"uint\", Just(8)),\n test6: new PrimitiveType(\"int128\", \"int\", Just(16)),\n test7: new PrimitiveType(\"int136\", \"int\", Just(17)),\n test8: new PrimitiveType(\"int144\", \"int\", Just(18)),\n test9: new PrimitiveType(\"uint240\", \"uint\", Just(30)),\n test10: new PrimitiveType(\"uint248\", \"uint\", Just(31)),\n test11: new PrimitiveType(\"uint256\", \"uint\", Just(32)),\n test12: new PrimitiveType(\"int256\", \"int\", Just(32)),\n },\n };\n expect(parser.getStructDefinitions()).toStrictEqual(expected);\n });\n\n it(\"Parse primitive types number, out of bound\", () => {\n // GIVEN\n const types = {\n TestStruct: [\n { name: \"invalid1\", type: \"int0\" },\n { name: \"invalid2\", type: \"uint0\" },\n { name: \"invalid3\", type: \"int7\" },\n { name: \"invalid4\", type: \"int257\" },\n { name: \"invalid5\", type: \"uint257\" },\n { name: \"invalid6\", type: \"int512\" },\n ],\n };\n // WHEN\n const parser = new TypedDataParser(types, {});\n // THEN\n const expected = {\n TestStruct: {\n invalid1: new StructType(\"int0\"),\n invalid2: new StructType(\"uint0\"),\n invalid3: new StructType(\"int7\"),\n invalid4: new StructType(\"int257\"),\n invalid5: new StructType(\"uint257\"),\n invalid6: new StructType(\"int512\"),\n },\n };\n expect(parser.getStructDefinitions()).toStrictEqual(expected);\n });\n\n it(\"Parse primitive types others\", () => {\n // GIVEN\n const types = {\n TestStruct: [\n { name: \"test1\", type: \"address\" },\n { name: \"test2\", type: \"bool\" },\n { name: \"test3\", type: \"string\" },\n ],\n };\n // WHEN\n const parser = new TypedDataParser(types, {});\n // THEN\n const expected = {\n TestStruct: {\n test1: new PrimitiveType(\"address\", \"address\", Nothing),\n test2: new PrimitiveType(\"bool\", \"bool\", Nothing),\n test3: new PrimitiveType(\"string\", \"string\", Nothing),\n },\n };\n expect(parser.getStructDefinitions()).toStrictEqual(expected);\n });\n\n it(\"Parse arrays\", () => {\n // GIVEN\n const types = {\n TestStruct: [\n { name: \"test1\", type: \"address[]\" },\n { name: \"test2\", type: \"uint16[3]\" },\n { name: \"test3\", type: \"custom[2][][3]\" },\n { name: \"test4\", type: \"string[2][][3][]\" },\n ],\n };\n // WHEN\n const parser = new TypedDataParser(types, {});\n // THEN\n const expected = {\n TestStruct: {\n test1: new ArrayType(\n \"address[]\",\n new PrimitiveType(\"address\", \"address\", Nothing),\n \"address\",\n Nothing,\n [Nothing],\n ),\n test2: new ArrayType(\n \"uint16[3]\",\n new PrimitiveType(\"uint16\", \"uint\", Just(2)),\n \"uint16\",\n Just(3),\n [Just(3)],\n ),\n test3: new ArrayType(\n \"custom[2][][3]\",\n new StructType(\"custom\"),\n \"custom[2][]\",\n Just(3),\n [Just(2), Nothing, Just(3)],\n ),\n test4: new ArrayType(\n \"string[2][][3][]\",\n new PrimitiveType(\"string\", \"string\", Nothing),\n \"string[2][][3]\",\n Nothing,\n [Just(2), Nothing, Just(3), Nothing],\n ),\n },\n };\n expect(parser.getStructDefinitions()).toStrictEqual(expected);\n });\n\n it(\"Parse custom struct\", () => {\n // GIVEN\n const types = {\n TestStruct: [{ name: \"test\", type: \"MyCustomStructure\" }],\n };\n // WHEN\n const parser = new TypedDataParser(types, {});\n // THEN\n const expected = {\n TestStruct: {\n test: new StructType(\"MyCustomStructure\"),\n },\n };\n expect(parser.getStructDefinitions()).toStrictEqual(expected);\n });\n\n it(\"Don't append domain default types if already present\", () => {\n // GIVEN\n const types = {\n EIP712Domain: [{ name: \"name\", type: \"string\" }],\n TestStruct: [{ name: \"test\", type: \"MyCustomStructure\" }],\n };\n // WHEN\n const parser = new TypedDataParser(types, {\n name: \"Seaport\",\n version: \"1.5\",\n chainId: 1,\n verifyingContract: \"0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC\",\n salt: \"0x42\",\n });\n // THEN\n const expected = {\n EIP712Domain: {\n name: new PrimitiveType(\"string\", \"string\", Nothing),\n },\n TestStruct: {\n test: new StructType(\"MyCustomStructure\"),\n },\n };\n expect(parser.getStructDefinitions()).toStrictEqual(expected);\n });\n\n it(\"Append domain default types\", () => {\n // GIVEN\n const types = {\n TestStruct: [{ name: \"test\", type: \"MyCustomStructure\" }],\n };\n // WHEN\n const parser = new TypedDataParser(types, {\n name: \"Seaport\",\n version: \"1.5\",\n chainId: 1,\n verifyingContract: \"0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC\",\n salt: \"0x42\",\n });\n // THEN\n const expected = {\n EIP712Domain: {\n name: new PrimitiveType(\"string\", \"string\", Nothing),\n version: new PrimitiveType(\"string\", \"string\", Nothing),\n chainId: new PrimitiveType(\"uint256\", \"uint\", Just(32)),\n verifyingContract: new PrimitiveType(\"address\", \"address\", Nothing),\n salt: new PrimitiveType(\"bytes32\", \"bytes\", Just(32)),\n },\n TestStruct: {\n test: new StructType(\"MyCustomStructure\"),\n },\n };\n expect(parser.getStructDefinitions()).toStrictEqual(expected);\n });\n\n it(\"Append partial domain default types\", () => {\n // GIVEN\n const types = {\n TestStruct: [{ name: \"test\", type: \"MyCustomStructure\" }],\n };\n // WHEN\n const parser = new TypedDataParser(types, {\n name: \"Seaport\",\n chainId: 1,\n verifyingContract: \"0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC\",\n });\n // THEN\n const expected = {\n EIP712Domain: {\n name: new PrimitiveType(\"string\", \"string\", Nothing),\n chainId: new PrimitiveType(\"uint256\", \"uint\", Just(32)),\n verifyingContract: new PrimitiveType(\"address\", \"address\", Nothing),\n },\n TestStruct: {\n test: new StructType(\"MyCustomStructure\"),\n },\n };\n expect(parser.getStructDefinitions()).toStrictEqual(expected);\n });\n});\n\ndescribe(\"TypedDataParser - message parsing\", () => {\n const MESSAGE: TypedData = {\n domain: {\n chainId: 0,\n name: \"Ether Mail\",\n verifyingContract: \"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC\",\n version: \"1\",\n },\n message: {\n contents: \"Hello, Bob!\",\n from: {\n name: \"Cow\",\n wallets: [\n \"0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826\",\n \"0xDeaDbeefdEAdbeefdEadbEEFdeadbeEFdEaDbeeF\",\n ],\n },\n to: [\n {\n wallets: [\n \"0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB\",\n \"0xB0BdaBea57B0BDABeA57b0bdABEA57b0BDabEa57\",\n \"0xB0B0b0b0b0b0B000000000000000000000000000\",\n ],\n name: \"Bob\",\n },\n ],\n },\n primaryType: \"Mail\",\n types: {\n EIP712Domain: [\n { name: \"name\", type: \"string\" },\n { name: \"version\", type: \"string\" },\n { name: \"chainId\", type: \"uint256\" },\n { name: \"verifyingContract\", type: \"address\" },\n ],\n Mail: [\n { name: \"from\", type: \"Person\" },\n { name: \"to\", type: \"Person[1]\" },\n { name: \"contents\", type: \"string\" },\n ],\n Person: [\n { name: \"name\", type: \"string\" },\n { name: \"wallets\", type: \"address[]\" },\n ],\n },\n };\n\n it(\"Parse an EIP712 message\", () => {\n // GIVEN\n const types = MESSAGE.types;\n const primaryType = MESSAGE.primaryType;\n const message = MESSAGE.message;\n // WHEN\n const parser = new TypedDataParser(types, {});\n // THEN\n const parsed = parser.parse(primaryType, message);\n const expected = [\n {\n path: \"\",\n type: \"\",\n value: new TypedDataValueRoot(primaryType),\n },\n {\n path: \"from.name\",\n type: \"string\",\n value: new TypedDataValueField(new TextEncoder().encode(\"Cow\")),\n },\n {\n path: \"from.wallets\",\n type: \"address[]\",\n value: new TypedDataValueArray(2),\n },\n {\n path: \"from.wallets.[]\",\n type: \"address\",\n value: new TypedDataValueField(\n hexaStringToBuffer(\"0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826\")!,\n ),\n },\n {\n path: \"from.wallets.[]\",\n type: \"address\",\n value: new TypedDataValueField(\n hexaStringToBuffer(\"0xDeaDbeefdEAdbeefdEadbEEFdeadbeEFdEaDbeeF\")!,\n ),\n },\n { path: \"to\", type: \"Person[1]\", value: new TypedDataValueArray(1) },\n {\n path: \"to.[].name\",\n type: \"string\",\n value: new TypedDataValueField(new TextEncoder().encode(\"Bob\")),\n },\n {\n path: \"to.[].wallets\",\n type: \"address[]\",\n value: new TypedDataValueArray(3),\n },\n {\n path: \"to.[].wallets.[]\",\n type: \"address\",\n value: new TypedDataValueField(\n hexaStringToBuffer(\"0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB\")!,\n ),\n },\n {\n path: \"to.[].wallets.[]\",\n type: \"address\",\n value: new TypedDataValueField(\n hexaStringToBuffer(\"0xB0BdaBea57B0BDABeA57b0bdABEA57b0BDabEa57\")!,\n ),\n },\n {\n path: \"to.[].wallets.[]\",\n type: \"address\",\n value: new TypedDataValueField(\n hexaStringToBuffer(\"0xB0B0b0b0b0b0B000000000000000000000000000\")!,\n ),\n },\n {\n path: \"contents\",\n type: \"string\",\n value: new TypedDataValueField(new TextEncoder().encode(\"Hello, Bob!\")),\n },\n ];\n expect(parsed).toStrictEqual(Right(expected));\n });\n\n it(\"Parse an EIP712 domain\", () => {\n // GIVEN\n const types = MESSAGE.types;\n const primaryType = \"EIP712Domain\";\n const message = MESSAGE.domain;\n // WHEN\n const parser = new TypedDataParser(types, {});\n // THEN\n const expected = [\n {\n path: \"\",\n type: \"\",\n value: new TypedDataValueRoot(primaryType),\n },\n {\n path: \"name\",\n type: \"string\",\n value: new TypedDataValueField(new TextEncoder().encode(\"Ether Mail\")),\n },\n {\n path: \"version\",\n type: \"string\",\n value: new TypedDataValueField(new TextEncoder().encode(\"1\")),\n },\n {\n path: \"chainId\",\n type: \"uint256\",\n value: new TypedDataValueField(Uint8Array.from([0])),\n },\n {\n path: \"verifyingContract\",\n type: \"address\",\n value: new TypedDataValueField(\n hexaStringToBuffer(\"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC\")!,\n ),\n },\n ];\n const parsed = parser.parse(primaryType, message);\n expect(parsed).toStrictEqual(Right(expected));\n });\n\n it(\"Invalid primary type\", () => {\n // GIVEN\n const types = MESSAGE.types;\n const primaryType = \"unknown\";\n const message = MESSAGE.domain;\n // WHEN\n const parser = new TypedDataParser(types, {});\n // THEN\n const parsed = parser.parse(primaryType, message);\n expect(parsed.isLeft()).toStrictEqual(true);\n });\n\n it(\"Struct points to an unknown custom type\", () => {\n // GIVEN\n const types = {\n Mail: [{ name: \"from\", type: \"Person\" }],\n };\n const primaryType = \"Mail\";\n const message = {\n from: \"0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826\",\n };\n // WHEN\n const parser = new TypedDataParser(types, {});\n // THEN\n const parsed = parser.parse(primaryType, message);\n expect(parsed.isLeft()).toStrictEqual(true);\n });\n\n it(\"Array contains an unknown custom type\", () => {\n // GIVEN\n const types = {\n Mail: [{ name: \"from\", type: \"Person[]\" }],\n };\n const primaryType = \"Mail\";\n const message = {\n from: [\"0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826\"],\n };\n // WHEN\n const parser = new TypedDataParser(types, {});\n // THEN\n const parsed = parser.parse(primaryType, message);\n expect(parsed.isLeft()).toStrictEqual(true);\n });\n\n it(\"Invalid primitive value\", () => {\n // GIVEN\n const types = {\n Mail: [{ name: \"from\", type: \"uint8\" }],\n };\n const primaryType = \"Mail\";\n const message = {\n from: 3000,\n };\n // WHEN\n const parser = new TypedDataParser(types, {});\n // THEN\n const parsed = parser.parse(primaryType, message);\n expect(parsed.isLeft()).toStrictEqual(true);\n });\n\n it(\"Array instead of primitive value\", () => {\n // GIVEN\n const types = {\n Mail: [{ name: \"from\", type: \"uint8\" }],\n };\n const primaryType = \"Mail\";\n const message = {\n from: [42],\n };\n // WHEN\n const parser = new TypedDataParser(types, {});\n // THEN\n const parsed = parser.parse(primaryType, message);\n expect(parsed.isLeft()).toStrictEqual(true);\n });\n\n it(\"Struct instead of primitive value\", () => {\n // GIVEN\n const types = {\n Mail: [{ name: \"from\", type: \"uint8\" }],\n };\n const primaryType = \"Mail\";\n const message = {\n from: { data: 42 },\n };\n // WHEN\n const parser = new TypedDataParser(types, {});\n // THEN\n const parsed = parser.parse(primaryType, message);\n expect(parsed.isLeft()).toStrictEqual(true);\n });\n\n it(\"Struct value not a record\", () => {\n // GIVEN\n const types = {\n Mail: [{ name: \"from\", type: \"Person\" }],\n Person: [{ name: \"data\", type: \"uint8\" }],\n };\n const primaryType = \"Mail\";\n const message = {\n from: 42,\n };\n // WHEN\n const parser = new TypedDataParser(types, {});\n // THEN\n const parsed = parser.parse(primaryType, message);\n expect(parsed.isLeft()).toStrictEqual(true);\n });\n\n it(\"Struct field not present in value\", () => {\n // GIVEN\n const types = {\n Mail: [{ name: \"from\", type: \"uint8\" }],\n };\n const primaryType = \"Mail\";\n const message = {\n to: 42,\n };\n // WHEN\n const parser = new TypedDataParser(types, {});\n // THEN\n const parsed = parser.parse(primaryType, message);\n expect(parsed.isLeft()).toStrictEqual(true);\n });\n\n it(\"Array value not an array\", () => {\n // GIVEN\n const types = {\n Mail: [{ name: \"from\", type: \"uint8[]\" }],\n };\n const primaryType = \"Mail\";\n const message = {\n from: 42,\n };\n // WHEN\n const parser = new TypedDataParser(types, {});\n // THEN\n const parsed = parser.parse(primaryType, message);\n expect(parsed.isLeft()).toStrictEqual(true);\n });\n\n it(\"Array value with invalid size\", () => {\n // GIVEN\n const types = {\n Mail: [{ name: \"from\", type: \"uint8[3]\" }],\n };\n const primaryType = \"Mail\";\n const message = {\n from: [42],\n };\n // WHEN\n const parser = new TypedDataParser(types, {});\n // THEN\n const parsed = parser.parse(primaryType, message);\n expect(parsed.isLeft()).toStrictEqual(true);\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAAmC,2CACnCC,EAAqC,qBAGrCC,EAOO,4CAEPC,EAAgC,6BAEhC,SAAS,kCAAmC,IAAM,CAChD,GAAG,8BAA+B,IAAM,CAEtC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,KAAM,OAAQ,KAAM,SAAU,CAAC,CAC1C,EACMI,EAAc,OACdC,EAAU,CACd,KAAM,EACR,EAIMC,EAFS,IAAI,kBAAgBN,EAAO,CAAC,CAAC,EAEtB,MAAMI,EAAaC,CAAO,EAChD,OAAOC,EAAO,OAAO,CAAC,EAAE,cAAc,EAAI,CAC5C,CAAC,EAED,GAAG,gCAAiC,IAAM,CAExC,MAAMN,EAAQ,CACZ,KAAM,CAAC,CAAE,KAAM,OAAQ,KAAM,UAAW,CAAC,CAC3C,EACMI,EAAc,OACdC,EAAU,CACd,KAAM,CAAC,EAAE,CACX,EAIMC,EAFS,IAAI,kBAAgBN,EAAO,CAAC,CAAC,EAEtB,MAAMI,EAAaC,CAAO,EAChD,OAAOC,EAAO,OAAO,CAAC,EAAE,cAAc,EAAI,CAC5C,CAAC,CACH,CAAC",
6
6
  "names": ["import_device_management_kit", "import_purify_ts", "import_Types", "import_TypedDataParser", "types", "parser", "expected", "MESSAGE", "primaryType", "message", "parsed"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var o=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var h=(e,r)=>{for(var p in r)o(e,p,{get:r[p],enumerable:!0})},v=(e,r,p,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of B(r))!f.call(e,t)&&t!==p&&o(e,t,{get:()=>r[t],enumerable:!(i=y(r,t))||i.enumerable});return e};var A=e=>v(o({},"__esModule",{value:!0}),e),c=(e,r,p,i)=>{for(var t=i>1?void 0:i?y(r,p):r,d=e.length-1,m;d>=0;d--)(m=e[d])&&(t=(i?m(r,p,t):m(t))||t);return i&&t&&o(r,p,t),t},s=(e,r)=>(p,i)=>r(p,i,e);var _={};h(_,{SignTypedDataUseCase:()=>a});module.exports=A(_);var n=require("inversify"),T=require("../../app-binder/di/appBinderTypes"),D=require("../../typed-data/di/typedDataTypes");let a=class{_appBinding;_parser;constructor(r,p){this._appBinding=r,this._parser=p}execute(r,p){return this._appBinding.signTypedData({derivationPath:r,parser:this._parser,data:p})}};a=c([(0,n.injectable)(),s(0,(0,n.inject)(T.appBinderTypes.AppBinding)),s(1,(0,n.inject)(D.typedDataTypes.TypedDataParserService))],a);0&&(module.exports={SignTypedDataUseCase});
1
+ "use strict";var o=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var B=(e,p)=>{for(var r in p)o(e,r,{get:p[r],enumerable:!0})},h=(e,p,r,i)=>{if(p&&typeof p=="object"||typeof p=="function")for(let t of f(p))!A.call(e,t)&&t!==r&&o(e,t,{get:()=>p[t],enumerable:!(i=y(p,t))||i.enumerable});return e};var v=e=>h(o({},"__esModule",{value:!0}),e),T=(e,p,r,i)=>{for(var t=i>1?void 0:i?y(p,r):p,d=e.length-1,s;d>=0;d--)(s=e[d])&&(t=(i?s(p,r,t):s(t))||t);return i&&t&&o(p,r,t),t},m=(e,p)=>(r,i)=>p(r,i,e);var _={};B(_,{SignTypedDataUseCase:()=>a});module.exports=v(_);var n=require("inversify"),D=require("../../app-binder/di/appBinderTypes"),c=require("../../typed-data/di/typedDataTypes");let a=class{_appBinding;_parser;constructor(p,r){this._appBinding=p,this._parser=r}execute(p,r,i){return this._appBinding.signTypedData({derivationPath:p,parser:this._parser,data:r,skipOpenApp:i?.skipOpenApp??!1})}};a=T([(0,n.injectable)(),m(0,(0,n.inject)(D.appBinderTypes.AppBinding)),m(1,(0,n.inject)(c.typedDataTypes.TypedDataParserService))],a);0&&(module.exports={SignTypedDataUseCase});
2
2
  //# sourceMappingURL=SignTypedDataUseCase.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/typed-data/use-case/SignTypedDataUseCase.ts"],
4
- "sourcesContent": ["import { inject, injectable } from \"inversify\";\n\nimport { SignTypedDataDAReturnType } from \"@api/app-binder/SignTypedDataDeviceActionTypes\";\nimport { type TypedData } from \"@api/model/TypedData\";\nimport { appBinderTypes } from \"@internal/app-binder/di/appBinderTypes\";\nimport { EthAppBinder } from \"@internal/app-binder/EthAppBinder\";\nimport { typedDataTypes } from \"@internal/typed-data/di/typedDataTypes\";\nimport { type TypedDataParserService } from \"@internal/typed-data/service/TypedDataParserService\";\n\n@injectable()\nexport class SignTypedDataUseCase {\n private _appBinding: EthAppBinder;\n private _parser: TypedDataParserService;\n\n constructor(\n @inject(appBinderTypes.AppBinding) appBinding: EthAppBinder,\n @inject(typedDataTypes.TypedDataParserService)\n typedDataParserService: TypedDataParserService,\n ) {\n this._appBinding = appBinding;\n this._parser = typedDataParserService;\n }\n\n execute(\n derivationPath: string,\n typedData: TypedData,\n ): SignTypedDataDAReturnType {\n return this._appBinding.signTypedData({\n derivationPath,\n parser: this._parser,\n data: typedData,\n });\n }\n}\n"],
5
- "mappings": "okBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAmC,qBAInCC,EAA+B,kDAE/BC,EAA+B,kDAIxB,IAAMC,EAAN,KAA2B,CACxB,YACA,QAER,YACqCC,EAEnCC,EACA,CACA,KAAK,YAAcD,EACnB,KAAK,QAAUC,CACjB,CAEA,QACEC,EACAC,EAC2B,CAC3B,OAAO,KAAK,YAAY,cAAc,CACpC,eAAAD,EACA,OAAQ,KAAK,QACb,KAAMC,CACR,CAAC,CACH,CACF,EAvBaJ,EAANK,EAAA,IADN,cAAW,EAMPC,EAAA,eAAO,iBAAe,UAAU,GAChCA,EAAA,eAAO,iBAAe,sBAAsB,IANpCN",
6
- "names": ["SignTypedDataUseCase_exports", "__export", "SignTypedDataUseCase", "__toCommonJS", "import_inversify", "import_appBinderTypes", "import_typedDataTypes", "SignTypedDataUseCase", "appBinding", "typedDataParserService", "derivationPath", "typedData", "__decorateClass", "__decorateParam"]
4
+ "sourcesContent": ["import { inject, injectable } from \"inversify\";\n\nimport { SignTypedDataDAReturnType } from \"@api/app-binder/SignTypedDataDeviceActionTypes\";\nimport { type TypedData } from \"@api/model/TypedData\";\nimport { TypedDataOptions } from \"@api/model/TypedDataOptions\";\nimport { appBinderTypes } from \"@internal/app-binder/di/appBinderTypes\";\nimport { EthAppBinder } from \"@internal/app-binder/EthAppBinder\";\nimport { typedDataTypes } from \"@internal/typed-data/di/typedDataTypes\";\nimport { type TypedDataParserService } from \"@internal/typed-data/service/TypedDataParserService\";\n\n@injectable()\nexport class SignTypedDataUseCase {\n private _appBinding: EthAppBinder;\n private _parser: TypedDataParserService;\n\n constructor(\n @inject(appBinderTypes.AppBinding) appBinding: EthAppBinder,\n @inject(typedDataTypes.TypedDataParserService)\n typedDataParserService: TypedDataParserService,\n ) {\n this._appBinding = appBinding;\n this._parser = typedDataParserService;\n }\n\n execute(\n derivationPath: string,\n typedData: TypedData,\n options?: TypedDataOptions,\n ): SignTypedDataDAReturnType {\n return this._appBinding.signTypedData({\n derivationPath,\n parser: this._parser,\n data: typedData,\n skipOpenApp: options?.skipOpenApp ?? false,\n });\n }\n}\n"],
5
+ "mappings": "okBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAmC,qBAKnCC,EAA+B,kDAE/BC,EAA+B,kDAIxB,IAAMC,EAAN,KAA2B,CACxB,YACA,QAER,YACqCC,EAEnCC,EACA,CACA,KAAK,YAAcD,EACnB,KAAK,QAAUC,CACjB,CAEA,QACEC,EACAC,EACAC,EAC2B,CAC3B,OAAO,KAAK,YAAY,cAAc,CACpC,eAAAF,EACA,OAAQ,KAAK,QACb,KAAMC,EACN,YAAaC,GAAS,aAAe,EACvC,CAAC,CACH,CACF,EAzBaL,EAANM,EAAA,IADN,cAAW,EAMPC,EAAA,eAAO,iBAAe,UAAU,GAChCA,EAAA,eAAO,iBAAe,sBAAsB,IANpCP",
6
+ "names": ["SignTypedDataUseCase_exports", "__export", "SignTypedDataUseCase", "__toCommonJS", "import_inversify", "import_appBinderTypes", "import_typedDataTypes", "SignTypedDataUseCase", "appBinding", "typedDataParserService", "derivationPath", "typedData", "options", "__decorateClass", "__decorateParam"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var s=require("./SignTypedDataUseCase");describe("SignTypedDataUseCase",()=>{it("should call signTypedData on appBinder with the correct arguments",()=>{const e="m/44'/60'/0'/0/0",a={domain:{},types:{},primaryType:"test",message:{}},t={parse:vi.fn()},p={signTypedData:vi.fn()};new s.SignTypedDataUseCase(p,t).execute(e,a),expect(p.signTypedData).toHaveBeenCalledWith({derivationPath:e,parser:t,data:a})})});
1
+ "use strict";var s=require("./SignTypedDataUseCase");describe("SignTypedDataUseCase",()=>{it("should call signTypedData on appBinder with the correct arguments",()=>{const e="m/44'/60'/0'/0/0",a={domain:{},types:{},primaryType:"test",message:{}},t={parse:vi.fn()},p={signTypedData:vi.fn()};new s.SignTypedDataUseCase(p,t).execute(e,a),expect(p.signTypedData).toHaveBeenCalledWith({derivationPath:e,parser:t,data:a,skipOpenApp:!1})})});
2
2
  //# sourceMappingURL=SignTypedDataUseCase.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/typed-data/use-case/SignTypedDataUseCase.test.ts"],
4
- "sourcesContent": ["import { type TypedData } from \"@api/model/TypedData\";\nimport { type EthAppBinder } from \"@internal/app-binder/EthAppBinder\";\nimport { type TypedDataParserService } from \"@internal/typed-data/service/TypedDataParserService\";\n\nimport { SignTypedDataUseCase } from \"./SignTypedDataUseCase\";\n\ndescribe(\"SignTypedDataUseCase\", () => {\n it(\"should call signTypedData on appBinder with the correct arguments\", () => {\n // Given\n const derivationPath = \"m/44'/60'/0'/0/0\";\n const typedData: TypedData = {\n domain: {},\n types: {},\n primaryType: \"test\",\n message: {},\n };\n const parser: TypedDataParserService = {\n parse: vi.fn(),\n };\n const appBinder = {\n signTypedData: vi.fn(),\n };\n const signTypedDataUseCase = new SignTypedDataUseCase(\n appBinder as unknown as EthAppBinder,\n parser,\n );\n\n // When\n signTypedDataUseCase.execute(derivationPath, typedData);\n\n // Then\n expect(appBinder.signTypedData).toHaveBeenCalledWith({\n derivationPath,\n parser,\n data: typedData,\n });\n });\n});\n"],
5
- "mappings": "aAIA,IAAAA,EAAqC,kCAErC,SAAS,uBAAwB,IAAM,CACrC,GAAG,oEAAqE,IAAM,CAE5E,MAAMC,EAAiB,mBACjBC,EAAuB,CAC3B,OAAQ,CAAC,EACT,MAAO,CAAC,EACR,YAAa,OACb,QAAS,CAAC,CACZ,EACMC,EAAiC,CACrC,MAAO,GAAG,GAAG,CACf,EACMC,EAAY,CAChB,cAAe,GAAG,GAAG,CACvB,EAC6B,IAAI,uBAC/BA,EACAD,CACF,EAGqB,QAAQF,EAAgBC,CAAS,EAGtD,OAAOE,EAAU,aAAa,EAAE,qBAAqB,CACnD,eAAAH,EACA,OAAAE,EACA,KAAMD,CACR,CAAC,CACH,CAAC,CACH,CAAC",
4
+ "sourcesContent": ["import { type TypedData } from \"@api/model/TypedData\";\nimport { type EthAppBinder } from \"@internal/app-binder/EthAppBinder\";\nimport { type TypedDataParserService } from \"@internal/typed-data/service/TypedDataParserService\";\n\nimport { SignTypedDataUseCase } from \"./SignTypedDataUseCase\";\n\ndescribe(\"SignTypedDataUseCase\", () => {\n it(\"should call signTypedData on appBinder with the correct arguments\", () => {\n // Given\n const derivationPath = \"m/44'/60'/0'/0/0\";\n const typedData: TypedData = {\n domain: {},\n types: {},\n primaryType: \"test\",\n message: {},\n };\n const parser: TypedDataParserService = {\n parse: vi.fn(),\n };\n const appBinder = {\n signTypedData: vi.fn(),\n };\n const signTypedDataUseCase = new SignTypedDataUseCase(\n appBinder as unknown as EthAppBinder,\n parser,\n );\n\n // When\n signTypedDataUseCase.execute(derivationPath, typedData);\n\n // Then\n expect(appBinder.signTypedData).toHaveBeenCalledWith({\n derivationPath,\n parser,\n data: typedData,\n skipOpenApp: false,\n });\n });\n});\n"],
5
+ "mappings": "aAIA,IAAAA,EAAqC,kCAErC,SAAS,uBAAwB,IAAM,CACrC,GAAG,oEAAqE,IAAM,CAE5E,MAAMC,EAAiB,mBACjBC,EAAuB,CAC3B,OAAQ,CAAC,EACT,MAAO,CAAC,EACR,YAAa,OACb,QAAS,CAAC,CACZ,EACMC,EAAiC,CACrC,MAAO,GAAG,GAAG,CACf,EACMC,EAAY,CAChB,cAAe,GAAG,GAAG,CACvB,EAC6B,IAAI,uBAC/BA,EACAD,CACF,EAGqB,QAAQF,EAAgBC,CAAS,EAGtD,OAAOE,EAAU,aAAa,EAAE,qBAAqB,CACnD,eAAAH,EACA,OAAAE,EACA,KAAMD,EACN,YAAa,EACf,CAAC,CACH,CAAC,CACH,CAAC",
6
6
  "names": ["import_SignTypedDataUseCase", "derivationPath", "typedData", "parser", "appBinder"]
7
7
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/device-signer-kit-ethereum",
3
- "version": "1.3.2",
3
+ "version": "1.4.0",
4
4
  "private": false,
5
5
  "license": "Apache-2.0",
6
6
  "exports": {
@@ -20,9 +20,9 @@
20
20
  ],
21
21
  "scripts": {
22
22
  "prebuild": "rimraf lib",
23
- "build": "pnpm lmdk-build --entryPoints src/index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
23
+ "build": "pnpm ldmk-tool build --entryPoints src/index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
24
24
  "dev": "concurrently \"pnpm watch:builds\" \"pnpm watch:types\"",
25
- "watch:builds": "pnpm lmdk-watch --entryPoints src/index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
25
+ "watch:builds": "pnpm ldmk-tool watch --entryPoints src/index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
26
26
  "watch:types": "concurrently \"tsc --watch -p tsconfig.prod.json\" \"tsc-alias --watch -p tsconfig.prod.json\"",
27
27
  "lint": "eslint",
28
28
  "lint:fix": "pnpm lint --fix",
@@ -35,29 +35,29 @@
35
35
  "test:coverage": "vitest run --coverage"
36
36
  },
37
37
  "dependencies": {
38
- "@ledgerhq/signer-utils": "^1.0.4",
39
- "ethers": "6.13.4",
40
- "inversify": "^6.2.2",
41
- "inversify-logger-middleware": "^3.1.0",
42
- "purify-ts": "^2.1.0",
43
- "reflect-metadata": "^0.2.2",
44
- "semver": "^7.6.3",
45
- "xstate": "^5.19.2"
38
+ "@ledgerhq/signer-utils": "workspace:*",
39
+ "ethers": "catalog:",
40
+ "inversify": "catalog:",
41
+ "inversify-logger-middleware": "catalog:",
42
+ "purify-ts": "catalog:",
43
+ "reflect-metadata": "catalog:",
44
+ "semver": "catalog:",
45
+ "xstate": "catalog:"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@ledgerhq/context-module": "workspace:*",
49
49
  "@ledgerhq/device-management-kit": "workspace:*",
50
- "@ledgerhq/esbuild-tools": "workspace:*",
50
+ "@ledgerhq/ldmk-tool": "workspace:*",
51
51
  "@ledgerhq/eslint-config-dsdk": "workspace:*",
52
52
  "@ledgerhq/prettier-config-dsdk": "workspace:*",
53
53
  "@ledgerhq/tsconfig-dsdk": "workspace:*",
54
54
  "@ledgerhq/vitest-config-dmk": "workspace:*",
55
- "@types/semver": "^7.5.8",
56
- "rxjs": "^7.8.2",
57
- "ts-node": "^10.9.2"
55
+ "@types/semver": "catalog:",
56
+ "rxjs": "catalog:",
57
+ "ts-node": "catalog:"
58
58
  },
59
59
  "peerDependencies": {
60
- "@ledgerhq/context-module": "workspace:*",
61
- "@ledgerhq/device-management-kit": "workspace:*"
60
+ "@ledgerhq/context-module": "^1.4.0",
61
+ "@ledgerhq/device-management-kit": "^0.7.0"
62
62
  }
63
63
  }
@@ -1,2 +1,2 @@
1
- import{ContextModuleBuilder as i}from"@ledgerhq/context-module";import{DefaultSignerEth as o}from"../internal/DefaultSignerEth";class d{_dmk;_sessionId;_contextModule;constructor({dmk:e,sessionId:t}){this._dmk=e,this._sessionId=t,this._contextModule=new i().build()}withContextModule(e){return this._contextModule=e,this}build(){return new o({dmk:this._dmk,sessionId:this._sessionId,contextModule:this._contextModule})}}export{d as SignerEthBuilder};
1
+ import{ContextModuleBuilder as o}from"@ledgerhq/context-module";import{DefaultSignerEth as n}from"../internal/DefaultSignerEth";class u{_dmk;_sessionId;_customContextModule;_originToken;constructor({dmk:e,sessionId:t,originToken:i}){this._dmk=e,this._sessionId=t,this._originToken=i}withContextModule(e){return this._customContextModule=e,this}build(){const e=this._customContextModule??new o({originToken:this._originToken}).build();return new n({dmk:this._dmk,sessionId:this._sessionId,contextModule:e})}}export{u as SignerEthBuilder};
2
2
  //# sourceMappingURL=SignerEthBuilder.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/api/SignerEthBuilder.ts"],
4
- "sourcesContent": ["import {\n type ContextModule,\n ContextModuleBuilder,\n} from \"@ledgerhq/context-module\";\nimport {\n type DeviceManagementKit,\n type DeviceSessionId,\n} from \"@ledgerhq/device-management-kit\";\n\nimport { DefaultSignerEth } from \"@internal/DefaultSignerEth\";\n\ntype SignerEthBuilderConstructorArgs = {\n dmk: DeviceManagementKit;\n sessionId: DeviceSessionId;\n};\n\n/**\n * Builder for the `SignerEth` class.\n *\n * @example\n * ```\n * const dmk = new SignerEthBuilder(dmk)\n * .build();\n * ```\n */\nexport class SignerEthBuilder {\n private _dmk: DeviceManagementKit;\n private _sessionId: DeviceSessionId;\n private _contextModule: ContextModule;\n\n constructor({ dmk, sessionId }: SignerEthBuilderConstructorArgs) {\n this._dmk = dmk;\n this._sessionId = sessionId;\n // default context module for ETH\n this._contextModule = new ContextModuleBuilder().build();\n }\n\n /**\n * Override the default context module\n *\n * @param contextModule\n * @returns this\n */\n withContextModule(contextModule: ContextModule) {\n this._contextModule = contextModule;\n return this;\n }\n\n /**\n * Build the ethereum signer\n *\n * @returns the ethereum signer\n */\n public build() {\n return new DefaultSignerEth({\n dmk: this._dmk,\n sessionId: this._sessionId,\n contextModule: this._contextModule,\n });\n }\n}\n"],
5
- "mappings": "AAAA,OAEE,wBAAAA,MACK,2BAMP,OAAS,oBAAAC,MAAwB,6BAgB1B,MAAMC,CAAiB,CACpB,KACA,WACA,eAER,YAAY,CAAE,IAAAC,EAAK,UAAAC,CAAU,EAAoC,CAC/D,KAAK,KAAOD,EACZ,KAAK,WAAaC,EAElB,KAAK,eAAiB,IAAIJ,EAAqB,EAAE,MAAM,CACzD,CAQA,kBAAkBK,EAA8B,CAC9C,YAAK,eAAiBA,EACf,IACT,CAOO,OAAQ,CACb,OAAO,IAAIJ,EAAiB,CAC1B,IAAK,KAAK,KACV,UAAW,KAAK,WAChB,cAAe,KAAK,cACtB,CAAC,CACH,CACF",
6
- "names": ["ContextModuleBuilder", "DefaultSignerEth", "SignerEthBuilder", "dmk", "sessionId", "contextModule"]
4
+ "sourcesContent": ["import {\n type ContextModule,\n ContextModuleBuilder,\n} from \"@ledgerhq/context-module\";\nimport {\n type DeviceManagementKit,\n type DeviceSessionId,\n} from \"@ledgerhq/device-management-kit\";\n\nimport { DefaultSignerEth } from \"@internal/DefaultSignerEth\";\n\ntype SignerEthBuilderConstructorArgs = {\n dmk: DeviceManagementKit;\n sessionId: DeviceSessionId;\n originToken?: string;\n};\n\n/**\n * Builder for the `SignerEth` class.\n *\n * @example\n * ```\n * const dmk = new SignerEthBuilder(dmk)\n * .build();\n * ```\n */\nexport class SignerEthBuilder {\n private _dmk: DeviceManagementKit;\n private _sessionId: DeviceSessionId;\n private _customContextModule: ContextModule | undefined;\n private _originToken: string | undefined;\n\n constructor({\n dmk,\n sessionId,\n originToken,\n }: SignerEthBuilderConstructorArgs) {\n this._dmk = dmk;\n this._sessionId = sessionId;\n this._originToken = originToken;\n }\n\n /**\n * Override the default context module\n *\n * @param contextModule\n * @returns this\n */\n withContextModule(contextModule: ContextModule) {\n this._customContextModule = contextModule;\n return this;\n }\n\n /**\n * Build the ethereum signer\n *\n * @returns the ethereum signer\n */\n public build() {\n const contextModule =\n this._customContextModule ??\n new ContextModuleBuilder({ originToken: this._originToken }).build();\n\n return new DefaultSignerEth({\n dmk: this._dmk,\n sessionId: this._sessionId,\n contextModule,\n });\n }\n}\n"],
5
+ "mappings": "AAAA,OAEE,wBAAAA,MACK,2BAMP,OAAS,oBAAAC,MAAwB,6BAiB1B,MAAMC,CAAiB,CACpB,KACA,WACA,qBACA,aAER,YAAY,CACV,IAAAC,EACA,UAAAC,EACA,YAAAC,CACF,EAAoC,CAClC,KAAK,KAAOF,EACZ,KAAK,WAAaC,EAClB,KAAK,aAAeC,CACtB,CAQA,kBAAkBC,EAA8B,CAC9C,YAAK,qBAAuBA,EACrB,IACT,CAOO,OAAQ,CACb,MAAMA,EACJ,KAAK,sBACL,IAAIN,EAAqB,CAAE,YAAa,KAAK,YAAa,CAAC,EAAE,MAAM,EAErE,OAAO,IAAIC,EAAiB,CAC1B,IAAK,KAAK,KACV,UAAW,KAAK,WAChB,cAAAK,CACF,CAAC,CACH,CACF",
6
+ "names": ["ContextModuleBuilder", "DefaultSignerEth", "SignerEthBuilder", "dmk", "sessionId", "originToken", "contextModule"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{SignerEthBuilder as t}from"./SignerEthBuilder";describe("SignerEthBuilder",()=>{const o={};test("should be an instance of SignerEth",()=>{const e=new t({dmk:o,sessionId:""});e.build(),expect(e).toBeInstanceOf(t)}),test("should instanciate with default context module",()=>{const e=new t({dmk:o,sessionId:""});e.build(),expect(e._contextModule).toBeDefined(),expect(e._contextModule._loaders).toHaveLength(6)}),test("should instanciate with custom context module",()=>{const e=new t({dmk:o,sessionId:""}),n={};e.withContextModule(n).build(),expect(e._contextModule).toBe(n)})});
1
+ import{SignerEthBuilder as n}from"./SignerEthBuilder";import{DefaultSignerEth as c}from"../internal/DefaultSignerEth";import{externalTypes as d}from"../internal/externalTypes";describe("SignerEthBuilder",()=>{const i={dmk:{},sessionId:"",originToken:"test"};test("should be an instance of SignerEth",()=>{const t=new n(i);t.build(),expect(t).toBeInstanceOf(n)}),test("should instanciate with default context module",()=>{const o=new n(i).build(),e=o._container.get(d.ContextModule);expect(o).toBeInstanceOf(c),expect(e).toBeDefined(),expect(e._loaders).toHaveLength(6),expect(e._typedDataLoader).toBeDefined(),expect(e._web3CheckLoader).toBeDefined()}),test("should instanciate with custom context module",()=>{const t=new n(i),o={},e=t.withContextModule(o).build();expect(e).toBeInstanceOf(c),expect(e._container.get(d.ContextModule)).toBe(o)})});
2
2
  //# sourceMappingURL=SignerEthBuilder.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/api/SignerEthBuilder.test.ts"],
4
- "sourcesContent": ["import {\n type ContextLoader,\n type ContextModule,\n} from \"@ledgerhq/context-module\";\nimport { type DeviceManagementKit } from \"@ledgerhq/device-management-kit\";\n\nimport { SignerEthBuilder } from \"@api/SignerEthBuilder\";\n\ndescribe(\"SignerEthBuilder\", () => {\n const dmk: DeviceManagementKit = {} as DeviceManagementKit;\n\n test(\"should be an instance of SignerEth\", () => {\n // GIVEN\n const builder = new SignerEthBuilder({ dmk, sessionId: \"\" });\n\n // WHEN\n builder.build();\n\n // THEN\n expect(builder).toBeInstanceOf(SignerEthBuilder);\n });\n\n test(\"should instanciate with default context module\", () => {\n // GIVEN\n const builder = new SignerEthBuilder({ dmk, sessionId: \"\" });\n\n // WHEN\n builder.build();\n\n // THEN\n expect(builder[\"_contextModule\"]).toBeDefined();\n expect(\n (builder[\"_contextModule\"] as unknown as { _loaders: ContextLoader[] })\n ._loaders,\n ).toHaveLength(6);\n });\n\n test(\"should instanciate with custom context module\", () => {\n // GIVEN\n const builder = new SignerEthBuilder({ dmk, sessionId: \"\" });\n const contextModule = {} as ContextModule;\n\n // WHEN\n builder.withContextModule(contextModule).build();\n\n // THEN\n expect(builder[\"_contextModule\"]).toBe(contextModule);\n });\n});\n"],
5
- "mappings": "AAMA,OAAS,oBAAAA,MAAwB,wBAEjC,SAAS,mBAAoB,IAAM,CACjC,MAAMC,EAA2B,CAAC,EAElC,KAAK,qCAAsC,IAAM,CAE/C,MAAMC,EAAU,IAAIF,EAAiB,CAAE,IAAAC,EAAK,UAAW,EAAG,CAAC,EAG3DC,EAAQ,MAAM,EAGd,OAAOA,CAAO,EAAE,eAAeF,CAAgB,CACjD,CAAC,EAED,KAAK,iDAAkD,IAAM,CAE3D,MAAME,EAAU,IAAIF,EAAiB,CAAE,IAAAC,EAAK,UAAW,EAAG,CAAC,EAG3DC,EAAQ,MAAM,EAGd,OAAOA,EAAQ,cAAiB,EAAE,YAAY,EAC9C,OACGA,EAAQ,eACN,QACL,EAAE,aAAa,CAAC,CAClB,CAAC,EAED,KAAK,gDAAiD,IAAM,CAE1D,MAAMA,EAAU,IAAIF,EAAiB,CAAE,IAAAC,EAAK,UAAW,EAAG,CAAC,EACrDE,EAAgB,CAAC,EAGvBD,EAAQ,kBAAkBC,CAAa,EAAE,MAAM,EAG/C,OAAOD,EAAQ,cAAiB,EAAE,KAAKC,CAAa,CACtD,CAAC,CACH,CAAC",
6
- "names": ["SignerEthBuilder", "dmk", "builder", "contextModule"]
4
+ "sourcesContent": ["import { type ContextModule } from \"@ledgerhq/context-module\";\nimport { type DeviceManagementKit } from \"@ledgerhq/device-management-kit\";\n\nimport { SignerEthBuilder } from \"@api/SignerEthBuilder\";\nimport { DefaultSignerEth } from \"@internal/DefaultSignerEth\";\nimport { externalTypes } from \"@internal/externalTypes\";\n\ndescribe(\"SignerEthBuilder\", () => {\n const dmk: DeviceManagementKit = {} as DeviceManagementKit;\n const defaultConstructorArgs = { dmk, sessionId: \"\", originToken: \"test\" };\n\n test(\"should be an instance of SignerEth\", () => {\n // GIVEN\n const builder = new SignerEthBuilder(defaultConstructorArgs);\n\n // WHEN\n builder.build();\n\n // THEN\n expect(builder).toBeInstanceOf(SignerEthBuilder);\n });\n\n test(\"should instanciate with default context module\", () => {\n // GIVEN\n const builder = new SignerEthBuilder(defaultConstructorArgs);\n\n // WHEN\n const signer = builder.build();\n const contextModule = signer[\"_container\"].get<ContextModule>(\n externalTypes.ContextModule,\n );\n\n // THEN\n expect(signer).toBeInstanceOf(DefaultSignerEth);\n expect(contextModule).toBeDefined();\n // @ts-expect-error - private property\n expect(contextModule._loaders).toHaveLength(6);\n // @ts-expect-error - private property\n expect(contextModule._typedDataLoader).toBeDefined();\n // @ts-expect-error - private property\n expect(contextModule._web3CheckLoader).toBeDefined();\n });\n\n test(\"should instanciate with custom context module\", () => {\n // GIVEN\n const builder = new SignerEthBuilder(defaultConstructorArgs);\n const contextModule = {} as ContextModule;\n\n // WHEN\n const signer = builder.withContextModule(contextModule).build();\n\n // THEN\n expect(signer).toBeInstanceOf(DefaultSignerEth);\n expect(\n signer[\"_container\"].get<ContextModule>(externalTypes.ContextModule),\n ).toBe(contextModule);\n });\n});\n"],
5
+ "mappings": "AAGA,OAAS,oBAAAA,MAAwB,wBACjC,OAAS,oBAAAC,MAAwB,6BACjC,OAAS,iBAAAC,MAAqB,0BAE9B,SAAS,mBAAoB,IAAM,CAEjC,MAAMC,EAAyB,CAAE,IADA,CAAC,EACI,UAAW,GAAI,YAAa,MAAO,EAEzE,KAAK,qCAAsC,IAAM,CAE/C,MAAMC,EAAU,IAAIJ,EAAiBG,CAAsB,EAG3DC,EAAQ,MAAM,EAGd,OAAOA,CAAO,EAAE,eAAeJ,CAAgB,CACjD,CAAC,EAED,KAAK,iDAAkD,IAAM,CAK3D,MAAMK,EAHU,IAAIL,EAAiBG,CAAsB,EAGpC,MAAM,EACvBG,EAAgBD,EAAO,WAAc,IACzCH,EAAc,aAChB,EAGA,OAAOG,CAAM,EAAE,eAAeJ,CAAgB,EAC9C,OAAOK,CAAa,EAAE,YAAY,EAElC,OAAOA,EAAc,QAAQ,EAAE,aAAa,CAAC,EAE7C,OAAOA,EAAc,gBAAgB,EAAE,YAAY,EAEnD,OAAOA,EAAc,gBAAgB,EAAE,YAAY,CACrD,CAAC,EAED,KAAK,gDAAiD,IAAM,CAE1D,MAAMF,EAAU,IAAIJ,EAAiBG,CAAsB,EACrDG,EAAgB,CAAC,EAGjBD,EAASD,EAAQ,kBAAkBE,CAAa,EAAE,MAAM,EAG9D,OAAOD,CAAM,EAAE,eAAeJ,CAAgB,EAC9C,OACEI,EAAO,WAAc,IAAmBH,EAAc,aAAa,CACrE,EAAE,KAAKI,CAAa,CACtB,CAAC,CACH,CAAC",
6
+ "names": ["SignerEthBuilder", "DefaultSignerEth", "externalTypes", "defaultConstructorArgs", "builder", "signer", "contextModule"]
7
7
  }
@@ -1,2 +1,2 @@
1
- var r=(e=>(e.OPEN_APP="signer.eth.steps.openApp",e.GET_APP_CONFIG="signer.eth.steps.getAppConfig",e.WEB3_CHECKS_OPT_IN="signer.eth.steps.web3ChecksOptIn",e.BUILD_CONTEXT="signer.eth.steps.buildContext",e.PROVIDE_CONTEXT="signer.eth.steps.provideContext",e.PROVIDE_GENERIC_CONTEXT="signer.eth.steps.provideGenericContext",e.SIGN_TRANSACTION="signer.eth.steps.signTransaction",e))(r||{});export{r as SignTransactionDAStep};
1
+ var t=(e=>(e.OPEN_APP="signer.eth.steps.openApp",e.GET_APP_CONFIG="signer.eth.steps.getAppConfig",e.WEB3_CHECKS_OPT_IN="signer.eth.steps.web3ChecksOptIn",e.WEB3_CHECKS_OPT_IN_RESULT="signer.eth.steps.web3ChecksOptInResult",e.BUILD_CONTEXT="signer.eth.steps.buildContext",e.PROVIDE_CONTEXT="signer.eth.steps.provideContext",e.PROVIDE_GENERIC_CONTEXT="signer.eth.steps.provideGenericContext",e.SIGN_TRANSACTION="signer.eth.steps.signTransaction",e))(t||{});export{t as 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 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 clearSignContexts: ClearSignContextSuccess[] | GenericContext | null;\n readonly web3ChecksOptIn: boolean;\n readonly web3ChecksEnabled: boolean;\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": "AAsBO,IAAKA,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": "AAuBO,IAAKA,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": ["SignTransactionDAStep"]
7
7
  }
@@ -1,2 +1,2 @@
1
- var t=(e=>(e.OPEN_APP="signer.eth.steps.openApp",e.GET_APP_CONFIG="signer.eth.steps.getAppConfig",e.WEB3_CHECKS_OPT_IN="signer.eth.steps.web3ChecksOptIn",e.BUILD_CONTEXT="signer.eth.steps.buildContext",e.PROVIDE_CONTEXT="signer.eth.steps.provideContext",e.PROVIDE_GENERIC_CONTEXT="signer.eth.steps.provideGenericContext",e.SIGN_TYPED_DATA="signer.eth.steps.signTypedData",e.SIGN_TYPED_DATA_LEGACY="signer.eth.steps.signTypedDataLegacy",e))(t||{});export{t as SignTypedDataDAStateStep};
1
+ var t=(e=>(e.OPEN_APP="signer.eth.steps.openApp",e.GET_APP_CONFIG="signer.eth.steps.getAppConfig",e.WEB3_CHECKS_OPT_IN="signer.eth.steps.web3ChecksOptIn",e.WEB3_CHECKS_OPT_IN_RESULT="signer.eth.steps.web3ChecksOptInResult",e.BUILD_CONTEXT="signer.eth.steps.buildContext",e.PROVIDE_CONTEXT="signer.eth.steps.provideContext",e.PROVIDE_GENERIC_CONTEXT="signer.eth.steps.provideGenericContext",e.SIGN_TYPED_DATA="signer.eth.steps.signTypedData",e.SIGN_TYPED_DATA_LEGACY="signer.eth.steps.signTypedDataLegacy",e))(t||{});export{t as 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 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 web3ChecksOptIn: boolean;\n web3ChecksEnabled: boolean;\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": "AAgBO,IAAKA,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": "AAiBO,IAAKA,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": ["SignTypedDataDAStateStep"]
7
7
  }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=MessageOptions.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=TypedDataOptions.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -1,2 +1,2 @@
1
- import{addressTypes as s}from"./address/di/addressTypes";import{makeContainer as n}from"./di";import{messageTypes as i}from"./message/di/messageTypes";import{transactionTypes as o}from"./transaction/di/transactionTypes";import{typedDataTypes as a}from"./typed-data/di/typedDataTypes";class T{_container;constructor({dmk:e,sessionId:t,contextModule:r}){this._container=n({dmk:e,sessionId:t,contextModule:r})}signTransaction(e,t,r){return this._container.get(o.SignTransactionUseCase).execute(e,t,r)}signMessage(e,t){return this._container.get(i.SignMessageUseCase).execute(e,t)}signTypedData(e,t){return this._container.get(a.SignTypedDataUseCase).execute(e,t)}getAddress(e,t){return this._container.get(s.GetAddressUseCase).execute(e,t)}}export{T as DefaultSignerEth};
1
+ import{addressTypes as s}from"./address/di/addressTypes";import{makeContainer as n}from"./di";import{messageTypes as i}from"./message/di/messageTypes";import{transactionTypes as o}from"./transaction/di/transactionTypes";import{typedDataTypes as a}from"./typed-data/di/typedDataTypes";class c{_container;constructor({dmk:e,sessionId:t,contextModule:r}){this._container=n({dmk:e,sessionId:t,contextModule:r})}signTransaction(e,t,r){return this._container.get(o.SignTransactionUseCase).execute(e,t,r)}signMessage(e,t,r){return this._container.get(i.SignMessageUseCase).execute(e,t,r)}signTypedData(e,t,r){return this._container.get(a.SignTypedDataUseCase).execute(e,t,r)}getAddress(e,t){return this._container.get(s.GetAddressUseCase).execute(e,t)}}export{c as 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": "AAeA,OAAS,gBAAAA,MAAoB,oCAE7B,OAAS,iBAAAC,MAAqB,eAC9B,OAAS,gBAAAC,MAAoB,oCAE7B,OAAS,oBAAAC,MAAwB,4CAEjC,OAAS,kBAAAC,MAAsB,yCASxB,MAAMC,CAAsC,CACzC,WAER,YAAY,CAAE,IAAAC,EAAK,UAAAC,EAAW,cAAAC,CAAc,EAAiC,CAC3E,KAAK,WAAaP,EAAc,CAAE,IAAAK,EAAK,UAAAC,EAAW,cAAAC,CAAc,CAAC,CACnE,CAEA,gBACEC,EACAC,EACAC,EAC6B,CAC7B,OAAO,KAAK,WACT,IAA4BR,EAAiB,sBAAsB,EACnE,QAAQM,EAAgBC,EAAaC,CAAO,CACjD,CAEA,YACEC,EACAC,EACiC,CACjC,OAAO,KAAK,WACT,IAAwBX,EAAa,kBAAkB,EACvD,QAAQU,EAAiBC,CAAQ,CACtC,CAEA,cACED,EACAE,EAC2B,CAC3B,OAAO,KAAK,WACT,IAA0BV,EAAe,oBAAoB,EAC7D,QAAQQ,EAAiBE,CAAU,CACxC,CAEA,WACEF,EACAG,EACwB,CACxB,OAAO,KAAK,WACT,IAAuBf,EAAa,iBAAiB,EACrD,QAAQY,EAAiBG,CAAQ,CACtC,CACF",
6
- "names": ["addressTypes", "makeContainer", "messageTypes", "transactionTypes", "typedDataTypes", "DefaultSignerEth", "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": "AAiBA,OAAS,gBAAAA,MAAoB,oCAE7B,OAAS,iBAAAC,MAAqB,eAC9B,OAAS,gBAAAC,MAAoB,oCAE7B,OAAS,oBAAAC,MAAwB,4CAEjC,OAAS,kBAAAC,MAAsB,yCASxB,MAAMC,CAAsC,CACzC,WAER,YAAY,CAAE,IAAAC,EAAK,UAAAC,EAAW,cAAAC,CAAc,EAAiC,CAC3E,KAAK,WAAaP,EAAc,CAAE,IAAAK,EAAK,UAAAC,EAAW,cAAAC,CAAc,CAAC,CACnE,CAEA,gBACEC,EACAC,EACAC,EAC6B,CAC7B,OAAO,KAAK,WACT,IAA4BR,EAAiB,sBAAsB,EACnE,QAAQM,EAAgBC,EAAaC,CAAO,CACjD,CAEA,YACEF,EACAG,EACAD,EACiC,CACjC,OAAO,KAAK,WACT,IAAwBT,EAAa,kBAAkB,EACvD,QAAQO,EAAgBG,EAASD,CAAO,CAC7C,CAEA,cACEF,EACAI,EACAF,EAC2B,CAC3B,OAAO,KAAK,WACT,IAA0BP,EAAe,oBAAoB,EAC7D,QAAQK,EAAgBI,EAAWF,CAAO,CAC/C,CAEA,WACEF,EACAE,EACwB,CACxB,OAAO,KAAK,WACT,IAAuBX,EAAa,iBAAiB,EACrD,QAAQS,EAAgBE,CAAO,CACpC,CACF",
6
+ "names": ["addressTypes", "makeContainer", "messageTypes", "transactionTypes", "typedDataTypes", "DefaultSignerEth", "dmk", "sessionId", "contextModule", "derivationPath", "transaction", "options", "message", "typedData"]
7
7
  }
@@ -1,2 +1,2 @@
1
- var h=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var c=(t,r,e,i)=>{for(var p=i>1?void 0:i?A(r,e):r,o=t.length-1,d;o>=0;o--)(d=t[o])&&(p=(i?d(r,e,p):d(p))||p);return i&&p&&h(r,e,p),p},m=(t,r)=>(e,i)=>r(e,i,t);import{inject as B,injectable as u}from"inversify";import{appBinderTypes as a}from"../../app-binder/di/appBinderTypes";let n=class{_appBinder;constructor(r){this._appBinder=r}execute(r,e){return this._appBinder.getAddress({derivationPath:r,checkOnDevice:e?.checkOnDevice,returnChainCode:e?.returnChainCode})}};n=c([u(),m(0,B(a.AppBinding))],n);export{n as GetAddressUseCase};
1
+ var s=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var c=(n,p,e,i)=>{for(var r=i>1?void 0:i?A(p,e):p,d=n.length-1,o;d>=0;d--)(o=n[d])&&(r=(i?o(p,e,r):o(r))||r);return i&&r&&s(p,e,r),r},m=(n,p)=>(e,i)=>p(e,i,n);import{inject as a,injectable as h}from"inversify";import{appBinderTypes as f}from"../../app-binder/di/appBinderTypes";let t=class{_appBinder;constructor(p){this._appBinder=p}execute(p,e){return this._appBinder.getAddress({derivationPath:p,checkOnDevice:e?.checkOnDevice??!1,returnChainCode:e?.returnChainCode??!1,skipOpenApp:e?.skipOpenApp??!1})}};t=c([h(),m(0,a(f.AppBinding))],t);export{t as 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": "iOAAA,OAAS,UAAAA,EAAQ,cAAAC,MAAkB,YAInC,OAAS,kBAAAC,MAAsB,yCAIxB,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,CADNC,EAAW,EAIGC,EAAA,EAAAC,EAAOC,EAAe,UAAU,IAHlCR",
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 ?? false,\n returnChainCode: options?.returnChainCode ?? false,\n skipOpenApp: options?.skipOpenApp ?? false,\n });\n }\n}\n"],
5
+ "mappings": "iOAAA,OAAS,UAAAA,EAAQ,cAAAC,MAAkB,YAInC,OAAS,kBAAAC,MAAsB,yCAIxB,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,eAAiB,GACzC,gBAAiBA,GAAS,iBAAmB,GAC7C,YAAaA,GAAS,aAAe,EACvC,CAAC,CACH,CACF,EAlBaH,EAANI,EAAA,CADNC,EAAW,EAIGC,EAAA,EAAAC,EAAOC,EAAe,UAAU,IAHlCR",
6
6
  "names": ["inject", "injectable", "appBinderTypes", "GetAddressUseCase", "appBinder", "derivationPath", "options", "__decorateClass", "injectable", "__decorateParam", "inject", "appBinderTypes"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{GetAddressUseCase as r}from"./GetAddressUseCase";describe("GetAddressUseCase",()=>{it("should call getAddress on appBinder with the correct arguments",()=>{const e="m/44'/60'/0'/0/0",s={checkOnDevice:!0,returnChainCode:!0},t=vi.fn(),n={getAddress:t};new r(n).execute(e,s),expect(t).toHaveBeenCalledWith({derivationPath:e,checkOnDevice:!0,returnChainCode:!0})})});
1
+ import{GetAddressUseCase as r}from"./GetAddressUseCase";describe("GetAddressUseCase",()=>{it("should call getAddress on appBinder with the correct arguments",()=>{const e="m/44'/60'/0'/0/0",t={checkOnDevice:!0,returnChainCode:!0},s=vi.fn(),n={getAddress:s};new r(n).execute(e,t),expect(s).toHaveBeenCalledWith({derivationPath:e,checkOnDevice:!0,returnChainCode:!0,skipOpenApp:!1})})});
2
2
  //# sourceMappingURL=GetAddressUseCase.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/address/use-case/GetAddressUseCase.test.ts"],
4
- "sourcesContent": ["import { type EthAppBinder } from \"@internal/app-binder/EthAppBinder\";\n\nimport { GetAddressUseCase } from \"./GetAddressUseCase\";\n\ndescribe(\"GetAddressUseCase\", () => {\n it(\"should call getAddress on appBinder with the correct arguments\", () => {\n // Given\n const derivationPath = \"m/44'/60'/0'/0/0\";\n const checkOnDevice = true;\n const returnChainCode = true;\n const options = {\n checkOnDevice,\n returnChainCode,\n };\n const getAddress = vi.fn();\n const appBinder = {\n getAddress,\n };\n const getAddressUseCase = new GetAddressUseCase(\n appBinder as unknown as EthAppBinder,\n );\n\n // When\n getAddressUseCase.execute(derivationPath, options);\n\n // Then\n expect(getAddress).toHaveBeenCalledWith({\n derivationPath,\n checkOnDevice,\n returnChainCode,\n });\n });\n});\n"],
5
- "mappings": "AAEA,OAAS,qBAAAA,MAAyB,sBAElC,SAAS,oBAAqB,IAAM,CAClC,GAAG,iEAAkE,IAAM,CAEzE,MAAMC,EAAiB,mBAGjBC,EAAU,CACd,iBACA,kBACF,EACMC,EAAa,GAAG,GAAG,EACnBC,EAAY,CAChB,WAAAD,CACF,EAC0B,IAAIH,EAC5BI,CACF,EAGkB,QAAQH,EAAgBC,CAAO,EAGjD,OAAOC,CAAU,EAAE,qBAAqB,CACtC,eAAAF,EACA,iBACA,kBACF,CAAC,CACH,CAAC,CACH,CAAC",
4
+ "sourcesContent": ["import { type EthAppBinder } from \"@internal/app-binder/EthAppBinder\";\n\nimport { GetAddressUseCase } from \"./GetAddressUseCase\";\n\ndescribe(\"GetAddressUseCase\", () => {\n it(\"should call getAddress on appBinder with the correct arguments\", () => {\n // Given\n const derivationPath = \"m/44'/60'/0'/0/0\";\n const checkOnDevice = true;\n const returnChainCode = true;\n const options = {\n checkOnDevice,\n returnChainCode,\n };\n const getAddress = vi.fn();\n const appBinder = {\n getAddress,\n };\n const getAddressUseCase = new GetAddressUseCase(\n appBinder as unknown as EthAppBinder,\n );\n\n // When\n getAddressUseCase.execute(derivationPath, options);\n\n // Then\n expect(getAddress).toHaveBeenCalledWith({\n derivationPath,\n checkOnDevice,\n returnChainCode,\n skipOpenApp: false,\n });\n });\n});\n"],
5
+ "mappings": "AAEA,OAAS,qBAAAA,MAAyB,sBAElC,SAAS,oBAAqB,IAAM,CAClC,GAAG,iEAAkE,IAAM,CAEzE,MAAMC,EAAiB,mBAGjBC,EAAU,CACd,iBACA,kBACF,EACMC,EAAa,GAAG,GAAG,EACnBC,EAAY,CAChB,WAAAD,CACF,EAC0B,IAAIH,EAC5BI,CACF,EAGkB,QAAQH,EAAgBC,CAAO,EAGjD,OAAOC,CAAU,EAAE,qBAAqB,CACtC,eAAAF,EACA,iBACA,mBACA,YAAa,EACf,CAAC,CACH,CAAC,CACH,CAAC",
6
6
  "names": ["GetAddressUseCase", "derivationPath", "options", "getAddress", "appBinder"]
7
7
  }
@@ -1,2 +1,2 @@
1
- var y=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var v=(o,e,t,r)=>{for(var i=r>1?void 0:r?D(e,t):e,s=o.length-1,c;s>=0;s--)(c=o[s])&&(i=(r?c(e,t,i):c(i))||i);return r&&i&&y(e,t,i),i},n=(o,e)=>(t,r)=>e(t,r,o);import{CallTaskInAppDeviceAction as A,SendCommandInAppDeviceAction as S}from"@ledgerhq/device-management-kit";import{UserInteractionRequired as m}from"@ledgerhq/device-management-kit";import{inject as a,injectable as f}from"inversify";import{SignTypedDataDeviceAction as g}from"../app-binder/device-action/SignTypedData/SignTypedDataDeviceAction";import{SendSignPersonalMessageTask as h}from"../app-binder/task/SendSignPersonalMessageTask";import{externalTypes as d}from"../externalTypes";import{transactionTypes as u}from"../transaction/di/transactionTypes";import{GetAddressCommand as l}from"./command/GetAddressCommand";import{ETHEREUM_PLUGINS as T}from"./constant/plugins";import{SignTransactionDeviceAction as M}from"./device-action/SignTransaction/SignTransactionDeviceAction";let p=class{constructor(e,t,r,i,s){this.dmk=e;this.contextModule=t;this.mapper=r;this.parser=i;this.sessionId=s}getAddress(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new S({input:{command:new l(e),appName:"Ethereum",compatibleAppNames:T,requiredUserInteraction:e.checkOnDevice?m.VerifyAddress:m.None}})})}signPersonalMessage(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new A({input:{task:async t=>new h(t,e).run(),appName:"Ethereum",compatibleAppNames:T,requiredUserInteraction:m.SignPersonalMessage}})})}signTransaction(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new M({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 g({input:{derivationPath:e.derivationPath,data:e.data,parser:e.parser,contextModule:this.contextModule}})})}};p=v([f(),n(0,a(d.Dmk)),n(1,a(d.ContextModule)),n(2,a(u.TransactionMapperService)),n(3,a(u.TransactionParserService)),n(4,a(d.SessionId))],p);export{p as EthAppBinder};
1
+ var T=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var v=(o,e,t,n)=>{for(var i=n>1?void 0:n?y(e,t):e,s=o.length-1,c;s>=0;s--)(c=o[s])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&T(e,t,i),i},r=(o,e)=>(t,n)=>e(t,n,o);import{CallTaskInAppDeviceAction as D,SendCommandInAppDeviceAction as l}from"@ledgerhq/device-management-kit";import{UserInteractionRequired as m}from"@ledgerhq/device-management-kit";import{inject as a,injectable as S}from"inversify";import{SignTypedDataDeviceAction as f}from"../app-binder/device-action/SignTypedData/SignTypedDataDeviceAction";import{SendSignPersonalMessageTask as h}from"../app-binder/task/SendSignPersonalMessageTask";import{externalTypes as d}from"../externalTypes";import{transactionTypes as A}from"../transaction/di/transactionTypes";import{GetAddressCommand as k}from"./command/GetAddressCommand";import{ETHEREUM_PLUGINS as u}from"./constant/plugins";import{SignTransactionDeviceAction as g}from"./device-action/SignTransaction/SignTransactionDeviceAction";let p=class{constructor(e,t,n,i,s){this.dmk=e;this.contextModule=t;this.mapper=n;this.parser=i;this.sessionId=s}getAddress(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new l({input:{command:new k(e),appName:"Ethereum",compatibleAppNames:u,requiredUserInteraction:e.checkOnDevice?m.VerifyAddress:m.None,skipOpenApp:e.skipOpenApp}})})}signPersonalMessage(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new D({input:{task:async t=>new h(t,e).run(),appName:"Ethereum",compatibleAppNames:u,requiredUserInteraction:m.SignPersonalMessage,skipOpenApp:e.skipOpenApp}})})}signTransaction(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new g({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 f({input:{derivationPath:e.derivationPath,data:e.data,parser:e.parser,contextModule:this.contextModule,skipOpenApp:e.skipOpenApp}})})}};p=v([S(),r(0,a(d.Dmk)),r(1,a(d.ContextModule)),r(2,a(A.TransactionMapperService)),r(3,a(A.TransactionParserService)),r(4,a(d.SessionId))],p);export{p as 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": "iOAKA,OACE,6BAAAA,EACA,gCAAAC,MACK,kCACP,OAAS,2BAAAC,MAA+B,kC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oBAAoB,CAClC,UAAW,KAAK,UAChB,aAAc,IAAIS,EAA0B,CAC1C,MAAO,CACL,eAAgBT,EAAK,eACrB,KAAMA,EAAK,KACX,OAAQA,EAAK,OACb,cAAe,KAAK,aACtB,CACF,CAAC,CACH,CAAC,CACH,CACF,EAtFaN,EAANgB,EAAA,CADNC,EAAW,EAGPC,EAAA,EAAAC,EAAOC,EAAc,GAAG,GACxBF,EAAA,EAAAC,EAAOC,EAAc,aAAa,GAClCF,EAAA,EAAAC,EAAOE,EAAiB,wBAAwB,GAEhDH,EAAA,EAAAC,EAAOE,EAAiB,wBAAwB,GAEhDH,EAAA,EAAAC,EAAOC,EAAc,SAAS,IARtBpB",
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": "iOAKA,OACE,6BAAAA,EACA,gCAAAC,MACK,kCACP,OAAS,2BAAAC,MAA+B,kCACxC,OAAS,UAAAC,EAAQ,cAAAC,MAAkB,YAQnC,OAAS,6BAAAC,MAAiC,6EAC1C,OAAS,+BAAAC,MAAmC,wDAC5C,OAAS,iBAAAC,MAAqB,0BAC9B,OAAS,oBAAAC,MAAwB,4CAKjC,OAAS,qBAAAC,MAAyB,8BAClC,OAAS,oBAAAC,MAAwB,qBACjC,OAAS,+BAAAC,MAAmC,8DAGrC,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,IAAIC,EAA6B,CAC7C,MAAO,CACL,QAAS,IAAIC,EAAkBF,CAAI,EACnC,QAAS,WACT,mBAAoBG,EACpB,wBAAyBH,EAAK,cAC1BI,EAAwB,cACxBA,EAAwB,KAC5B,YAAaJ,EAAK,WACpB,CACF,CAAC,CACH,CAAC,CACH,CAEA,oBAAoBA,EAIgB,CAClC,OAAO,KAAK,IAAI,oBAAoB,CAClC,UAAW,KAAK,UAChB,aAAc,IAAIK,EAA0B,CAC1C,MAAO,CACL,KAAM,MAAOC,GACX,IAAIC,EAA4BD,EAAaN,CAAI,EAAE,IAAI,EACzD,QAAS,WACT,mBAAoBG,EACpB,wBAAyBC,EAAwB,oBACjD,YAAaJ,EAAK,WACpB,CACF,CAAC,CACH,CAAC,CACH,CAEA,gBAAgBA,EAIgB,CAC9B,OAAO,KAAK,IAAI,oBAAoB,CAClC,UAAW,KAAK,UAChB,aAAc,IAAIQ,EAA4B,CAC5C,MAAO,CACL,eAAgBR,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,IAAIS,EAA0B,CAC1C,MAAO,CACL,eAAgBT,EAAK,eACrB,KAAMA,EAAK,KACX,OAAQA,EAAK,OACb,cAAe,KAAK,cACpB,YAAaA,EAAK,WACpB,CACF,CAAC,CACH,CAAC,CACH,CACF,EA5FaN,EAANgB,EAAA,CADNC,EAAW,EAGPC,EAAA,EAAAC,EAAOC,EAAc,GAAG,GACxBF,EAAA,EAAAC,EAAOC,EAAc,aAAa,GAClCF,EAAA,EAAAC,EAAOE,EAAiB,wBAAwB,GAEhDH,EAAA,EAAAC,EAAOE,EAAiB,wBAAwB,GAEhDH,EAAA,EAAAC,EAAOC,EAAc,SAAS,IARtBpB",
6
6
  "names": ["CallTaskInAppDeviceAction", "SendCommandInAppDeviceAction", "UserInteractionRequired", "inject", "injectable", "SignTypedDataDeviceAction", "SendSignPersonalMessageTask", "externalTypes", "transactionTypes", "GetAddressCommand", "ETHEREUM_PLUGINS", "SignTransactionDeviceAction", "EthAppBinder", "dmk", "contextModule", "mapper", "parser", "sessionId", "args", "SendCommandInAppDeviceAction", "GetAddressCommand", "ETHEREUM_PLUGINS", "UserInteractionRequired", "CallTaskInAppDeviceAction", "internalApi", "SendSignPersonalMessageTask", "SignTransactionDeviceAction", "SignTypedDataDeviceAction", "__decorateClass", "injectable", "__decorateParam", "inject", "externalTypes", "transactionTypes"]
7
7
  }