@ledgerhq/device-signer-kit-ethereum 1.4.0 → 1.5.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 (163) hide show
  1. package/README.md +53 -0
  2. package/lib/cjs/api/SignerEth.js +1 -1
  3. package/lib/cjs/api/SignerEth.js.map +1 -1
  4. package/lib/cjs/api/app-binder/SignDelegationAuthorizationTypes.js +2 -0
  5. package/lib/cjs/api/app-binder/SignDelegationAuthorizationTypes.js.map +7 -0
  6. package/lib/cjs/api/index.js +1 -1
  7. package/lib/cjs/api/index.js.map +2 -2
  8. package/lib/cjs/internal/DefaultSignerEth.js +1 -1
  9. package/lib/cjs/internal/DefaultSignerEth.js.map +3 -3
  10. package/lib/cjs/internal/DefaultSignerEth.test.js +1 -1
  11. package/lib/cjs/internal/DefaultSignerEth.test.js.map +3 -3
  12. package/lib/cjs/internal/address/di/addressModule.js +1 -1
  13. package/lib/cjs/internal/address/di/addressModule.js.map +3 -3
  14. package/lib/cjs/internal/address/di/addressModule.test.js +1 -1
  15. package/lib/cjs/internal/address/di/addressModule.test.js.map +2 -2
  16. package/lib/cjs/internal/app-binder/EthAppBinder.js +1 -1
  17. package/lib/cjs/internal/app-binder/EthAppBinder.js.map +3 -3
  18. package/lib/cjs/internal/app-binder/EthAppBinder.test.js +1 -1
  19. package/lib/cjs/internal/app-binder/EthAppBinder.test.js.map +3 -3
  20. package/lib/cjs/internal/app-binder/command/SignAuthorizationDelegationCommand.js +2 -0
  21. package/lib/cjs/internal/app-binder/command/SignAuthorizationDelegationCommand.js.map +7 -0
  22. package/lib/cjs/internal/app-binder/command/SignAuthorizationDelegationCommand.test.js +2 -0
  23. package/lib/cjs/internal/app-binder/command/SignAuthorizationDelegationCommand.test.js.map +7 -0
  24. package/lib/cjs/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.js +1 -1
  25. package/lib/cjs/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.js.map +2 -2
  26. package/lib/cjs/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.js +1 -1
  27. package/lib/cjs/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.js.map +2 -2
  28. package/lib/cjs/internal/app-binder/di/appBinderModule.js +1 -1
  29. package/lib/cjs/internal/app-binder/di/appBinderModule.js.map +3 -3
  30. package/lib/cjs/internal/app-binder/task/BuildTransactionContextTask.js +1 -1
  31. package/lib/cjs/internal/app-binder/task/BuildTransactionContextTask.js.map +2 -2
  32. package/lib/cjs/internal/app-binder/task/BuildTransactionContextTask.test.js +1 -1
  33. package/lib/cjs/internal/app-binder/task/BuildTransactionContextTask.test.js.map +2 -2
  34. package/lib/cjs/internal/app-binder/task/SendSignAuthorizationDelegationTask.js +2 -0
  35. package/lib/cjs/internal/app-binder/task/SendSignAuthorizationDelegationTask.js.map +7 -0
  36. package/lib/cjs/internal/app-binder/task/SendSignAuthorizationDelegationTask.test.js +2 -0
  37. package/lib/cjs/internal/app-binder/task/SendSignAuthorizationDelegationTask.test.js.map +7 -0
  38. package/lib/cjs/internal/di.js +1 -1
  39. package/lib/cjs/internal/di.js.map +3 -3
  40. package/lib/cjs/internal/eip7702/di/eip7702Module.js +2 -0
  41. package/lib/cjs/internal/eip7702/di/eip7702Module.js.map +7 -0
  42. package/lib/cjs/internal/eip7702/di/eip7702Module.test.js +2 -0
  43. package/lib/cjs/internal/eip7702/di/eip7702Module.test.js.map +7 -0
  44. package/lib/cjs/internal/eip7702/di/eip7702Types.js +2 -0
  45. package/lib/cjs/internal/eip7702/di/eip7702Types.js.map +7 -0
  46. package/lib/cjs/internal/eip7702/use-case/SignDelegationAuthorizationUseCase.js +2 -0
  47. package/lib/cjs/internal/eip7702/use-case/SignDelegationAuthorizationUseCase.js.map +7 -0
  48. package/lib/cjs/internal/eip7702/use-case/SignDelegationAuthorizationUseCase.test.js +2 -0
  49. package/lib/cjs/internal/eip7702/use-case/SignDelegationAuthorizationUseCase.test.js.map +7 -0
  50. package/lib/cjs/internal/message/di/messageModule.js +1 -1
  51. package/lib/cjs/internal/message/di/messageModule.js.map +3 -3
  52. package/lib/cjs/internal/message/di/messageModule.test.js +1 -1
  53. package/lib/cjs/internal/message/di/messageModule.test.js.map +2 -2
  54. package/lib/cjs/internal/transaction/di/transactionModule.js +1 -1
  55. package/lib/cjs/internal/transaction/di/transactionModule.js.map +3 -3
  56. package/lib/cjs/internal/transaction/di/transactionModule.test.js +1 -1
  57. package/lib/cjs/internal/transaction/di/transactionModule.test.js.map +2 -2
  58. package/lib/cjs/internal/typed-data/di/typedDataModule.js +1 -1
  59. package/lib/cjs/internal/typed-data/di/typedDataModule.js.map +3 -3
  60. package/lib/cjs/internal/typed-data/di/typedDataModule.test.js +1 -1
  61. package/lib/cjs/internal/typed-data/di/typedDataModule.test.js.map +2 -2
  62. package/lib/cjs/package.json +3 -4
  63. package/lib/esm/api/app-binder/SignDelegationAuthorizationTypes.js +1 -0
  64. package/lib/esm/api/app-binder/SignDelegationAuthorizationTypes.js.map +7 -0
  65. package/lib/esm/api/index.js +1 -1
  66. package/lib/esm/api/index.js.map +2 -2
  67. package/lib/esm/internal/DefaultSignerEth.js +1 -1
  68. package/lib/esm/internal/DefaultSignerEth.js.map +3 -3
  69. package/lib/esm/internal/DefaultSignerEth.test.js +1 -1
  70. package/lib/esm/internal/DefaultSignerEth.test.js.map +3 -3
  71. package/lib/esm/internal/address/di/addressModule.js +1 -1
  72. package/lib/esm/internal/address/di/addressModule.js.map +3 -3
  73. package/lib/esm/internal/address/di/addressModule.test.js +1 -1
  74. package/lib/esm/internal/address/di/addressModule.test.js.map +2 -2
  75. package/lib/esm/internal/app-binder/EthAppBinder.js +1 -1
  76. package/lib/esm/internal/app-binder/EthAppBinder.js.map +3 -3
  77. package/lib/esm/internal/app-binder/EthAppBinder.test.js +1 -1
  78. package/lib/esm/internal/app-binder/EthAppBinder.test.js.map +3 -3
  79. package/lib/esm/internal/app-binder/command/SignAuthorizationDelegationCommand.js +2 -0
  80. package/lib/esm/internal/app-binder/command/SignAuthorizationDelegationCommand.js.map +7 -0
  81. package/lib/esm/internal/app-binder/command/SignAuthorizationDelegationCommand.test.js +2 -0
  82. package/lib/esm/internal/app-binder/command/SignAuthorizationDelegationCommand.test.js.map +7 -0
  83. package/lib/esm/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.js +1 -1
  84. package/lib/esm/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.js.map +2 -2
  85. package/lib/esm/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.js +1 -1
  86. package/lib/esm/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.js.map +2 -2
  87. package/lib/esm/internal/app-binder/di/appBinderModule.js +1 -1
  88. package/lib/esm/internal/app-binder/di/appBinderModule.js.map +3 -3
  89. package/lib/esm/internal/app-binder/task/BuildTransactionContextTask.js +1 -1
  90. package/lib/esm/internal/app-binder/task/BuildTransactionContextTask.js.map +2 -2
  91. package/lib/esm/internal/app-binder/task/BuildTransactionContextTask.test.js +1 -1
  92. package/lib/esm/internal/app-binder/task/BuildTransactionContextTask.test.js.map +2 -2
  93. package/lib/esm/internal/app-binder/task/SendSignAuthorizationDelegationTask.js +2 -0
  94. package/lib/esm/internal/app-binder/task/SendSignAuthorizationDelegationTask.js.map +7 -0
  95. package/lib/esm/internal/app-binder/task/SendSignAuthorizationDelegationTask.test.js +2 -0
  96. package/lib/esm/internal/app-binder/task/SendSignAuthorizationDelegationTask.test.js.map +7 -0
  97. package/lib/esm/internal/di.js +1 -1
  98. package/lib/esm/internal/di.js.map +3 -3
  99. package/lib/esm/internal/eip7702/di/eip7702Module.js +2 -0
  100. package/lib/esm/internal/eip7702/di/eip7702Module.js.map +7 -0
  101. package/lib/esm/internal/eip7702/di/eip7702Module.test.js +2 -0
  102. package/lib/esm/internal/eip7702/di/eip7702Module.test.js.map +7 -0
  103. package/lib/esm/internal/eip7702/di/eip7702Types.js +2 -0
  104. package/lib/esm/internal/eip7702/di/eip7702Types.js.map +7 -0
  105. package/lib/esm/internal/eip7702/use-case/SignDelegationAuthorizationUseCase.js +2 -0
  106. package/lib/esm/internal/eip7702/use-case/SignDelegationAuthorizationUseCase.js.map +7 -0
  107. package/lib/esm/internal/eip7702/use-case/SignDelegationAuthorizationUseCase.test.js +2 -0
  108. package/lib/esm/internal/eip7702/use-case/SignDelegationAuthorizationUseCase.test.js.map +7 -0
  109. package/lib/esm/internal/message/di/messageModule.js +1 -1
  110. package/lib/esm/internal/message/di/messageModule.js.map +3 -3
  111. package/lib/esm/internal/message/di/messageModule.test.js +1 -1
  112. package/lib/esm/internal/message/di/messageModule.test.js.map +2 -2
  113. package/lib/esm/internal/transaction/di/transactionModule.js +1 -1
  114. package/lib/esm/internal/transaction/di/transactionModule.js.map +3 -3
  115. package/lib/esm/internal/transaction/di/transactionModule.test.js +1 -1
  116. package/lib/esm/internal/transaction/di/transactionModule.test.js.map +2 -2
  117. package/lib/esm/internal/typed-data/di/typedDataModule.js +1 -1
  118. package/lib/esm/internal/typed-data/di/typedDataModule.js.map +3 -3
  119. package/lib/esm/internal/typed-data/di/typedDataModule.test.js +1 -1
  120. package/lib/esm/internal/typed-data/di/typedDataModule.test.js.map +2 -2
  121. package/lib/esm/package.json +3 -4
  122. package/lib/types/api/SignerEth.d.ts +4 -2
  123. package/lib/types/api/SignerEth.d.ts.map +1 -1
  124. package/lib/types/api/app-binder/SignDelegationAuthorizationTypes.d.ts +19 -0
  125. package/lib/types/api/app-binder/SignDelegationAuthorizationTypes.d.ts.map +1 -0
  126. package/lib/types/api/index.d.ts +5 -0
  127. package/lib/types/api/index.d.ts.map +1 -1
  128. package/lib/types/internal/DefaultSignerEth.d.ts +2 -0
  129. package/lib/types/internal/DefaultSignerEth.d.ts.map +1 -1
  130. package/lib/types/internal/address/di/addressModule.d.ts.map +1 -1
  131. package/lib/types/internal/app-binder/EthAppBinder.d.ts +7 -0
  132. package/lib/types/internal/app-binder/EthAppBinder.d.ts.map +1 -1
  133. package/lib/types/internal/app-binder/command/SignAuthorizationDelegationCommand.d.ts +29 -0
  134. package/lib/types/internal/app-binder/command/SignAuthorizationDelegationCommand.d.ts.map +1 -0
  135. package/lib/types/internal/app-binder/command/SignAuthorizationDelegationCommand.test.d.ts +2 -0
  136. package/lib/types/internal/app-binder/command/SignAuthorizationDelegationCommand.test.d.ts.map +1 -0
  137. package/lib/types/internal/app-binder/command/utils/ethAppErrors.d.ts.map +1 -1
  138. package/lib/types/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.d.ts.map +1 -1
  139. package/lib/types/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.d.ts.map +1 -1
  140. package/lib/types/internal/app-binder/device-action/__test-utils__/setupOpenAppDAMock.d.ts.map +1 -1
  141. package/lib/types/internal/app-binder/di/appBinderModule.d.ts.map +1 -1
  142. package/lib/types/internal/app-binder/task/BuildEIP712ContextTask.d.ts.map +1 -1
  143. package/lib/types/internal/app-binder/task/BuildTransactionContextTask.d.ts.map +1 -1
  144. package/lib/types/internal/app-binder/task/SendSignAuthorizationDelegationTask.d.ts +18 -0
  145. package/lib/types/internal/app-binder/task/SendSignAuthorizationDelegationTask.d.ts.map +1 -0
  146. package/lib/types/internal/app-binder/task/SendSignAuthorizationDelegationTask.test.d.ts +2 -0
  147. package/lib/types/internal/app-binder/task/SendSignAuthorizationDelegationTask.test.d.ts.map +1 -0
  148. package/lib/types/internal/di.d.ts.map +1 -1
  149. package/lib/types/internal/eip7702/di/eip7702Module.d.ts +3 -0
  150. package/lib/types/internal/eip7702/di/eip7702Module.d.ts.map +1 -0
  151. package/lib/types/internal/eip7702/di/eip7702Module.test.d.ts +2 -0
  152. package/lib/types/internal/eip7702/di/eip7702Module.test.d.ts.map +1 -0
  153. package/lib/types/internal/eip7702/di/eip7702Types.d.ts +4 -0
  154. package/lib/types/internal/eip7702/di/eip7702Types.d.ts.map +1 -0
  155. package/lib/types/internal/eip7702/use-case/SignDelegationAuthorizationUseCase.d.ts +8 -0
  156. package/lib/types/internal/eip7702/use-case/SignDelegationAuthorizationUseCase.d.ts.map +1 -0
  157. package/lib/types/internal/eip7702/use-case/SignDelegationAuthorizationUseCase.test.d.ts +2 -0
  158. package/lib/types/internal/eip7702/use-case/SignDelegationAuthorizationUseCase.test.d.ts.map +1 -0
  159. package/lib/types/internal/message/di/messageModule.d.ts.map +1 -1
  160. package/lib/types/internal/transaction/di/transactionModule.d.ts.map +1 -1
  161. package/lib/types/internal/typed-data/di/typedDataModule.d.ts.map +1 -1
  162. package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
  163. package/package.json +7 -8
package/README.md CHANGED
@@ -260,6 +260,59 @@ type Signature = {
260
260
 
261
261
  - `cancel` A function to cancel the action on the Ledger device.
262
262
 
263
+ ### Use Case 5: Sign Delegation Authorization (EIP-7702)
264
+
265
+ This method enables users to sign a delegation authorization message following the [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) specification.
266
+
267
+ ```typescript
268
+ const { observable, cancel } = signerEth.signDelegationAuthorization(
269
+ derivationPath,
270
+ chainId,
271
+ contractAddress,
272
+ nonce,
273
+ );
274
+ ```
275
+
276
+ #### **Parameters**
277
+
278
+ - `derivationPath`
279
+
280
+ - **Required**
281
+ - **Type:** `string` (e.g., `"44'/60'/0'/0/0"`)
282
+ - The derivation path used by the Ethereum message. See [here](https://www.ledger.com/blog/understanding-crypto-addresses-and-derivation-paths) for more information.
283
+
284
+ - `chainId`
285
+
286
+ - **Required**
287
+ - **Type:** `number`
288
+ - The chain ID of the Ethereum network.
289
+
290
+ - `contractAddress`
291
+
292
+ - **Required**
293
+ - **Type:** `string`
294
+ - The address of the contract to be authorized.
295
+
296
+ - `nonce`
297
+
298
+ - **Required**
299
+ - **Type:** `number`
300
+ - The nonce of the transaction.
301
+
302
+ #### **Returns**
303
+
304
+ - `observable` Emits DeviceActionState updates, including the following details:
305
+
306
+ ```typescript
307
+ type Signature = {
308
+ r: `0x${string}`; // R component of the signature
309
+ s: `0x${string}`; // S component of the signature
310
+ v: number; // Recovery parameter
311
+ };
312
+ ```
313
+
314
+ - `cancel` A function to cancel the action on the Ledger device.
315
+
263
316
  ## 🔹 Observable Behavior
264
317
 
265
318
  Each method returns an [Observable](https://rxjs.dev/guide/observable) emitting updates structured as [`DeviceActionState`](https://github.com/LedgerHQ/device-sdk-ts/blob/develop/packages/device-management-kit/src/api/device-action/model/DeviceActionState.ts). These updates reflect the operation’s progress and status:
@@ -1,2 +1,2 @@
1
- "use strict";var i=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var y=(e,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of o(t))!p.call(e,n)&&n!==s&&i(e,n,{get:()=>t[n],enumerable:!(r=a(t,n))||r.enumerable});return e};var d=e=>y(i({},"__esModule",{value:!0}),e);var g={};module.exports=d(g);
1
+ "use strict";var r=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var g=(e,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of s(t))!p.call(e,n)&&n!==o&&r(e,n,{get:()=>t[n],enumerable:!(i=a(t,n))||i.enumerable});return e};var y=e=>g(r({},"__esModule",{value:!0}),e);var d={};module.exports=y(d);
2
2
  //# sourceMappingURL=SignerEth.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/api/SignerEth.ts"],
4
- "sourcesContent": ["import { type GetAddressDAReturnType } from \"@api/app-binder/GetAddressDeviceActionTypes\";\nimport { type SignTypedDataDAReturnType } from \"@api/app-binder/SignTypedDataDeviceActionTypes\";\nimport { type AddressOptions } from \"@api/model/AddressOptions\";\nimport { type MessageOptions } from \"@api/model/MessageOptions\";\nimport { type TransactionOptions } from \"@api/model/TransactionOptions\";\nimport { type TypedData } from \"@api/model/TypedData\";\nimport { type TypedDataOptions } from \"@api/model/TypedDataOptions\";\n\nimport { type SignPersonalMessageDAReturnType } from \"./app-binder/SignPersonalMessageDeviceActionTypes\";\nimport { type SignTransactionDAReturnType } from \"./app-binder/SignTransactionDeviceActionTypes\";\n\nexport interface SignerEth {\n signTransaction: (\n derivationPath: string,\n transaction: Uint8Array,\n options?: TransactionOptions,\n ) => SignTransactionDAReturnType;\n signMessage: (\n derivationPath: string,\n message: string | Uint8Array,\n options?: MessageOptions,\n ) => SignPersonalMessageDAReturnType;\n signTypedData: (\n derivationPath: string,\n typedData: TypedData,\n options?: TypedDataOptions,\n ) => SignTypedDataDAReturnType;\n getAddress: (\n derivationPath: string,\n options?: AddressOptions,\n ) => GetAddressDAReturnType;\n}\n"],
4
+ "sourcesContent": ["import { type GetAddressDAReturnType } from \"@api/app-binder/GetAddressDeviceActionTypes\";\nimport { type SignDelegationAuthorizationDAReturnType } from \"@api/app-binder/SignDelegationAuthorizationTypes\";\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\";\n\nexport interface SignerEth {\n signTransaction: (\n derivationPath: string,\n transaction: Uint8Array,\n options?: TransactionOptions,\n ) => SignTransactionDAReturnType;\n signMessage: (\n derivationPath: string,\n message: string | Uint8Array,\n options?: MessageOptions,\n ) => SignPersonalMessageDAReturnType;\n signTypedData: (\n derivationPath: string,\n typedData: TypedData,\n options?: TypedDataOptions,\n ) => SignTypedDataDAReturnType;\n getAddress: (\n derivationPath: string,\n options?: AddressOptions,\n ) => GetAddressDAReturnType;\n signDelegationAuthorization: (\n derivationPath: string,\n chainId: number,\n contractAddress: string,\n nonce: number,\n ) => SignDelegationAuthorizationDAReturnType;\n}\n"],
5
5
  "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
6
  "names": ["SignerEth_exports", "__toCommonJS"]
7
7
  }
@@ -0,0 +1,2 @@
1
+ "use strict";var n=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var A=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of p(e))!u.call(t,i)&&i!==o&&n(t,i,{get:()=>e[i],enumerable:!(r=a(e,i))||r.enumerable});return t};var D=t=>A(n({},"__esModule",{value:!0}),t);var g={};module.exports=D(g);
2
+ //# sourceMappingURL=SignDelegationAuthorizationTypes.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/api/app-binder/SignDelegationAuthorizationTypes.ts"],
4
+ "sourcesContent": ["import {\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 EthErrorCodes } from \"@internal/app-binder/command/utils/ethAppErrors\";\n\nexport type SignDelegationAuthorizationDAOutput = Signature;\n\nexport type SignDelegationAuthorizationDAInput = {\n readonly derivationPath: string;\n readonly address: `0x${string}`;\n readonly chainId: number;\n readonly nonce: number;\n};\n\nexport type SignDelegationAuthorizationDAError =\n | OpenAppDAError\n | CommandErrorResult<EthErrorCodes>[\"error\"];\n\ntype SignDelegationAuthorizationDARequiredInteraction =\n | OpenAppDARequiredInteraction\n | UserInteractionRequired.SignDelegationAuthorization;\n\nexport type SignDelegationAuthorizationDAIntermediateValue = {\n requiredUserInteraction: SignDelegationAuthorizationDARequiredInteraction;\n};\n\nexport type SignDelegationAuthorizationDAState = DeviceActionState<\n SignDelegationAuthorizationDAOutput,\n SignDelegationAuthorizationDAError,\n SignDelegationAuthorizationDAIntermediateValue\n>;\n\nexport type SignDelegationAuthorizationDAReturnType =\n ExecuteDeviceActionReturnType<\n SignDelegationAuthorizationDAOutput,\n SignDelegationAuthorizationDAError,\n SignDelegationAuthorizationDAIntermediateValue\n >;\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["SignDelegationAuthorizationTypes_exports", "__toCommonJS"]
7
+ }
@@ -1,2 +1,2 @@
1
- "use strict";var i=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var m=(a,r)=>{for(var p in r)i(a,p,{get:r[p],enumerable:!0})},o=(a,r,p,D)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of y(r))!A.call(a,n)&&n!==p&&i(a,n,{get:()=>r[n],enumerable:!(D=s(r,n))||D.enumerable});return a},t=(a,r,p)=>(o(a,r,"default"),p&&o(p,r,"default"));var T=a=>o(i({},"__esModule",{value:!0}),a);var e={};m(e,{SignTransactionDAStep:()=>S.SignTransactionDAStep,SignTypedDataDAStateStep:()=>g.SignTypedDataDAStateStep});module.exports=T(e);t(e,require("./app-binder/GetAddressDeviceActionTypes"),module.exports);var S=require("./app-binder/SignTransactionDeviceActionTypes"),g=require("./app-binder/SignTypedDataDeviceActionTypes");t(e,require("./model/Address"),module.exports);t(e,require("./model/AddressOptions"),module.exports);t(e,require("./model/Signature"),module.exports);t(e,require("./model/TransactionOptions"),module.exports);t(e,require("./model/TransactionType"),module.exports);t(e,require("./model/TypedData"),module.exports);t(e,require("./SignerEth"),module.exports);t(e,require("./SignerEthBuilder"),module.exports);0&&(module.exports={SignTransactionDAStep,SignTypedDataDAStateStep,...require("./app-binder/GetAddressDeviceActionTypes"),...require("./model/Address"),...require("./model/AddressOptions"),...require("./model/Signature"),...require("./model/TransactionOptions"),...require("./model/TransactionType"),...require("./model/TypedData"),...require("./SignerEth"),...require("./SignerEthBuilder")});
1
+ "use strict";var i=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var u=(o,r)=>{for(var a in r)i(o,a,{get:r[a],enumerable:!0})},p=(o,r,a,D)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of y(r))!m.call(o,n)&&n!==a&&i(o,n,{get:()=>r[n],enumerable:!(D=A(r,n))||D.enumerable});return o},e=(o,r,a)=>(p(o,r,"default"),a&&p(a,r,"default"));var s=o=>p(i({},"__esModule",{value:!0}),o);var t={};u(t,{SignTransactionDAStep:()=>g.SignTransactionDAStep,SignTypedDataDAStateStep:()=>S.SignTypedDataDAStateStep});module.exports=s(t);e(t,require("./app-binder/GetAddressDeviceActionTypes"),module.exports);var g=require("./app-binder/SignTransactionDeviceActionTypes"),S=require("./app-binder/SignTypedDataDeviceActionTypes");e(t,require("./model/Address"),module.exports);e(t,require("./model/AddressOptions"),module.exports);e(t,require("./model/Signature"),module.exports);e(t,require("./model/TransactionOptions"),module.exports);e(t,require("./model/TransactionType"),module.exports);e(t,require("./model/TypedData"),module.exports);e(t,require("./SignerEth"),module.exports);e(t,require("./SignerEthBuilder"),module.exports);0&&(module.exports={SignTransactionDAStep,SignTypedDataDAStateStep,...require("./app-binder/GetAddressDeviceActionTypes"),...require("./model/Address"),...require("./model/AddressOptions"),...require("./model/Signature"),...require("./model/TransactionOptions"),...require("./model/TransactionType"),...require("./model/TypedData"),...require("./SignerEth"),...require("./SignerEthBuilder")});
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/api/index.ts"],
4
- "sourcesContent": ["export * from \"@api/app-binder/GetAddressDeviceActionTypes\";\nexport type {\n SignPersonalMessageDAError,\n SignPersonalMessageDAIntermediateValue,\n SignPersonalMessageDAOutput,\n} from \"@api/app-binder/SignPersonalMessageDeviceActionTypes\";\nexport {\n type SignTransactionDAError,\n type SignTransactionDAInput,\n type SignTransactionDAIntermediateValue,\n type SignTransactionDAOutput,\n type SignTransactionDAState,\n SignTransactionDAStep,\n} from \"@api/app-binder/SignTransactionDeviceActionTypes\";\nexport {\n type SignTypedDataDAError,\n type SignTypedDataDAInput,\n type SignTypedDataDAIntermediateValue,\n type SignTypedDataDAOutput,\n type SignTypedDataDAState,\n SignTypedDataDAStateStep,\n} from \"@api/app-binder/SignTypedDataDeviceActionTypes\";\nexport * from \"@api/model/Address\";\nexport * from \"@api/model/AddressOptions\";\nexport * from \"@api/model/Signature\";\nexport * from \"@api/model/TransactionOptions\";\nexport * from \"@api/model/TransactionType\";\nexport * from \"@api/model/TypedData\";\nexport * from \"@api/SignerEth\";\nexport * from \"@api/SignerEthBuilder\";\n"],
5
- "mappings": "2dAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4HAAAE,EAAAF,GAAAG,EAAAH,EAAc,uDAAd,gBAMA,IAAAI,EAOO,4DACPC,EAOO,0DACPF,EAAAH,EAAc,8BAtBd,gBAuBAG,EAAAH,EAAc,qCAvBd,gBAwBAG,EAAAH,EAAc,gCAxBd,gBAyBAG,EAAAH,EAAc,yCAzBd,gBA0BAG,EAAAH,EAAc,sCA1Bd,gBA2BAG,EAAAH,EAAc,gCA3Bd,gBA4BAG,EAAAH,EAAc,0BA5Bd,gBA6BAG,EAAAH,EAAc,iCA7Bd",
4
+ "sourcesContent": ["export * from \"@api/app-binder/GetAddressDeviceActionTypes\";\nexport { type SignDelegationAuthorizationDAError } from \"@api/app-binder/SignDelegationAuthorizationTypes\";\nexport { type SignDelegationAuthorizationDAInput } from \"@api/app-binder/SignDelegationAuthorizationTypes\";\nexport { type SignDelegationAuthorizationDAOutput } from \"@api/app-binder/SignDelegationAuthorizationTypes\";\nexport { type SignDelegationAuthorizationDAState } from \"@api/app-binder/SignDelegationAuthorizationTypes\";\nexport { type SignDelegationAuthorizationDAIntermediateValue } from \"@api/app-binder/SignDelegationAuthorizationTypes\";\nexport type {\n SignPersonalMessageDAError,\n SignPersonalMessageDAIntermediateValue,\n SignPersonalMessageDAOutput,\n} from \"@api/app-binder/SignPersonalMessageDeviceActionTypes\";\nexport {\n type SignTransactionDAError,\n type SignTransactionDAInput,\n type SignTransactionDAIntermediateValue,\n type SignTransactionDAOutput,\n type SignTransactionDAState,\n SignTransactionDAStep,\n} from \"@api/app-binder/SignTransactionDeviceActionTypes\";\nexport {\n type SignTypedDataDAError,\n type SignTypedDataDAInput,\n type SignTypedDataDAIntermediateValue,\n type SignTypedDataDAOutput,\n type SignTypedDataDAState,\n SignTypedDataDAStateStep,\n} from \"@api/app-binder/SignTypedDataDeviceActionTypes\";\nexport * from \"@api/model/Address\";\nexport * from \"@api/model/AddressOptions\";\nexport * from \"@api/model/Signature\";\nexport * from \"@api/model/TransactionOptions\";\nexport * from \"@api/model/TransactionType\";\nexport * from \"@api/model/TypedData\";\nexport * from \"@api/SignerEth\";\nexport * from \"@api/SignerEthBuilder\";\n"],
5
+ "mappings": "2dAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4HAAAE,EAAAF,GAAAG,EAAAH,EAAc,uDAAd,gBAWA,IAAAI,EAOO,4DACPC,EAOO,0DACPF,EAAAH,EAAc,8BA3Bd,gBA4BAG,EAAAH,EAAc,qCA5Bd,gBA6BAG,EAAAH,EAAc,gCA7Bd,gBA8BAG,EAAAH,EAAc,yCA9Bd,gBA+BAG,EAAAH,EAAc,sCA/Bd,gBAgCAG,EAAAH,EAAc,gCAhCd,gBAiCAG,EAAAH,EAAc,0BAjCd,gBAkCAG,EAAAH,EAAc,iCAlCd",
6
6
  "names": ["api_exports", "__export", "__toCommonJS", "__reExport", "import_SignTransactionDeviceActionTypes", "import_SignTypedDataDeviceActionTypes"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var i=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var c=(s,e)=>{for(var t in e)i(s,t,{get:e[t],enumerable:!0})},D=(s,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of d(e))!T.call(s,n)&&n!==t&&i(s,n,{get:()=>e[n],enumerable:!(r=y(e,n))||r.enumerable});return s};var f=s=>D(i({},"__esModule",{value:!0}),s);var S={};c(S,{DefaultSignerEth:()=>u});module.exports=f(S);var o=require("./address/di/addressTypes"),a=require("./di"),p=require("./message/di/messageTypes"),m=require("./transaction/di/transactionTypes"),g=require("./typed-data/di/typedDataTypes");class u{_container;constructor({dmk:e,sessionId:t,contextModule:r}){this._container=(0,a.makeContainer)({dmk:e,sessionId:t,contextModule:r})}signTransaction(e,t,r){return this._container.get(m.transactionTypes.SignTransactionUseCase).execute(e,t,r)}signMessage(e,t,r){return this._container.get(p.messageTypes.SignMessageUseCase).execute(e,t,r)}signTypedData(e,t,r){return this._container.get(g.typedDataTypes.SignTypedDataUseCase).execute(e,t,r)}getAddress(e,t){return this._container.get(o.addressTypes.GetAddressUseCase).execute(e,t)}}0&&(module.exports={DefaultSignerEth});
1
+ "use strict";var s=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var D=Object.prototype.hasOwnProperty;var T=(n,e)=>{for(var t in e)s(n,t,{get:e[t],enumerable:!0})},c=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of d(e))!D.call(n,i)&&i!==t&&s(n,i,{get:()=>e[i],enumerable:!(r=u(e,i))||r.enumerable});return n};var f=n=>c(s({},"__esModule",{value:!0}),n);var S={};T(S,{DefaultSignerEth:()=>A});module.exports=f(S);var o=require("./address/di/addressTypes"),a=require("./di"),p=require("./message/di/messageTypes"),g=require("./transaction/di/transactionTypes"),m=require("./typed-data/di/typedDataTypes"),y=require("./eip7702/di/eip7702Types");class A{_container;constructor({dmk:e,sessionId:t,contextModule:r}){this._container=(0,a.makeContainer)({dmk:e,sessionId:t,contextModule:r})}signTransaction(e,t,r){return this._container.get(g.transactionTypes.SignTransactionUseCase).execute(e,t,r)}signMessage(e,t,r){return this._container.get(p.messageTypes.SignMessageUseCase).execute(e,t,r)}signTypedData(e,t,r){return this._container.get(m.typedDataTypes.SignTypedDataUseCase).execute(e,t,r)}getAddress(e,t){return this._container.get(o.addressTypes.GetAddressUseCase).execute(e,t)}signDelegationAuthorization(e,t,r,i){return this._container.get(y.eip7702Types.SignDelegationAuthorizationUseCase).execute(e,i,r,t)}}0&&(module.exports={DefaultSignerEth});
2
2
  //# sourceMappingURL=DefaultSignerEth.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/internal/DefaultSignerEth.ts"],
4
- "sourcesContent": ["import { type ContextModule } from \"@ledgerhq/context-module\";\nimport {\n type DeviceManagementKit,\n type DeviceSessionId,\n} from \"@ledgerhq/device-management-kit\";\nimport { type Container } from \"inversify\";\n\nimport { type GetAddressDAReturnType } from \"@api/app-binder/GetAddressDeviceActionTypes\";\nimport { type SignPersonalMessageDAReturnType } from \"@api/app-binder/SignPersonalMessageDeviceActionTypes\";\nimport { type SignTransactionDAReturnType } from \"@api/app-binder/SignTransactionDeviceActionTypes\";\nimport { type SignTypedDataDAReturnType } from \"@api/app-binder/SignTypedDataDeviceActionTypes\";\nimport { type AddressOptions } from \"@api/model/AddressOptions\";\nimport { type MessageOptions } from \"@api/model/MessageOptions\";\nimport { type TransactionOptions } from \"@api/model/TransactionOptions\";\nimport { type TypedData } from \"@api/model/TypedData\";\nimport { type TypedDataOptions } from \"@api/model/TypedDataOptions\";\nimport { type SignerEth } from \"@api/SignerEth\";\nimport { addressTypes } from \"@internal/address/di/addressTypes\";\nimport { type GetAddressUseCase } from \"@internal/address/use-case/GetAddressUseCase\";\nimport { makeContainer } from \"@internal/di\";\nimport { messageTypes } from \"@internal/message/di/messageTypes\";\nimport { type SignMessageUseCase } from \"@internal/message/use-case/SignMessageUseCase\";\nimport { transactionTypes } from \"@internal/transaction/di/transactionTypes\";\nimport { type SignTransactionUseCase } from \"@internal/transaction/use-case/SignTransactionUseCase\";\nimport { typedDataTypes } from \"@internal/typed-data/di/typedDataTypes\";\nimport { type SignTypedDataUseCase } from \"@internal/typed-data/use-case/SignTypedDataUseCase\";\n\ntype DefaultSignerConstructorArgs = {\n dmk: DeviceManagementKit;\n sessionId: DeviceSessionId;\n contextModule: ContextModule;\n};\n\nexport class DefaultSignerEth implements SignerEth {\n private _container: Container;\n\n constructor({ dmk, sessionId, contextModule }: DefaultSignerConstructorArgs) {\n this._container = makeContainer({ dmk, sessionId, contextModule });\n }\n\n signTransaction(\n derivationPath: string,\n transaction: Uint8Array,\n options?: TransactionOptions,\n ): SignTransactionDAReturnType {\n return this._container\n .get<SignTransactionUseCase>(transactionTypes.SignTransactionUseCase)\n .execute(derivationPath, transaction, options);\n }\n\n signMessage(\n derivationPath: string,\n message: string | Uint8Array,\n options?: MessageOptions,\n ): SignPersonalMessageDAReturnType {\n return this._container\n .get<SignMessageUseCase>(messageTypes.SignMessageUseCase)\n .execute(derivationPath, message, options);\n }\n\n signTypedData(\n derivationPath: string,\n typedData: TypedData,\n options?: TypedDataOptions,\n ): SignTypedDataDAReturnType {\n return this._container\n .get<SignTypedDataUseCase>(typedDataTypes.SignTypedDataUseCase)\n .execute(derivationPath, typedData, options);\n }\n\n getAddress(\n derivationPath: string,\n options?: AddressOptions,\n ): GetAddressDAReturnType {\n return this._container\n .get<GetAddressUseCase>(addressTypes.GetAddressUseCase)\n .execute(derivationPath, options);\n }\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GAiBA,IAAAI,EAA6B,6CAE7BC,EAA8B,wBAC9BC,EAA6B,6CAE7BC,EAAiC,qDAEjCC,EAA+B,kDASxB,MAAMN,CAAsC,CACzC,WAER,YAAY,CAAE,IAAAO,EAAK,UAAAC,EAAW,cAAAC,CAAc,EAAiC,CAC3E,KAAK,cAAa,iBAAc,CAAE,IAAAF,EAAK,UAAAC,EAAW,cAAAC,CAAc,CAAC,CACnE,CAEA,gBACEC,EACAC,EACAC,EAC6B,CAC7B,OAAO,KAAK,WACT,IAA4B,mBAAiB,sBAAsB,EACnE,QAAQF,EAAgBC,EAAaC,CAAO,CACjD,CAEA,YACEF,EACAG,EACAD,EACiC,CACjC,OAAO,KAAK,WACT,IAAwB,eAAa,kBAAkB,EACvD,QAAQF,EAAgBG,EAASD,CAAO,CAC7C,CAEA,cACEF,EACAI,EACAF,EAC2B,CAC3B,OAAO,KAAK,WACT,IAA0B,iBAAe,oBAAoB,EAC7D,QAAQF,EAAgBI,EAAWF,CAAO,CAC/C,CAEA,WACEF,EACAE,EACwB,CACxB,OAAO,KAAK,WACT,IAAuB,eAAa,iBAAiB,EACrD,QAAQF,EAAgBE,CAAO,CACpC,CACF",
6
- "names": ["DefaultSignerEth_exports", "__export", "DefaultSignerEth", "__toCommonJS", "import_addressTypes", "import_di", "import_messageTypes", "import_transactionTypes", "import_typedDataTypes", "dmk", "sessionId", "contextModule", "derivationPath", "transaction", "options", "message", "typedData"]
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 SignDelegationAuthorizationDAReturnType } from \"@api/app-binder/SignDelegationAuthorizationTypes\";\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\nimport { eip7702Types } from \"./eip7702/di/eip7702Types\";\nimport { type SignDelegationAuthorizationUseCase } from \"./eip7702/use-case/SignDelegationAuthorizationUseCase\";\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 signDelegationAuthorization(\n derivationPath: string,\n chainId: number,\n contractAddress: string,\n nonce: number,\n ): SignDelegationAuthorizationDAReturnType {\n return this._container\n .get<SignDelegationAuthorizationUseCase>(\n eip7702Types.SignDelegationAuthorizationUseCase,\n )\n .execute(derivationPath, nonce, contractAddress, chainId);\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GAkBA,IAAAI,EAA6B,6CAE7BC,EAA8B,wBAC9BC,EAA6B,6CAE7BC,EAAiC,qDAEjCC,EAA+B,kDAG/BC,EAA6B,qCAStB,MAAMP,CAAsC,CACzC,WAER,YAAY,CAAE,IAAAQ,EAAK,UAAAC,EAAW,cAAAC,CAAc,EAAiC,CAC3E,KAAK,cAAa,iBAAc,CAAE,IAAAF,EAAK,UAAAC,EAAW,cAAAC,CAAc,CAAC,CACnE,CAEA,gBACEC,EACAC,EACAC,EAC6B,CAC7B,OAAO,KAAK,WACT,IAA4B,mBAAiB,sBAAsB,EACnE,QAAQF,EAAgBC,EAAaC,CAAO,CACjD,CAEA,YACEF,EACAG,EACAD,EACiC,CACjC,OAAO,KAAK,WACT,IAAwB,eAAa,kBAAkB,EACvD,QAAQF,EAAgBG,EAASD,CAAO,CAC7C,CAEA,cACEF,EACAI,EACAF,EAC2B,CAC3B,OAAO,KAAK,WACT,IAA0B,iBAAe,oBAAoB,EAC7D,QAAQF,EAAgBI,EAAWF,CAAO,CAC/C,CAEA,WACEF,EACAE,EACwB,CACxB,OAAO,KAAK,WACT,IAAuB,eAAa,iBAAiB,EACrD,QAAQF,EAAgBE,CAAO,CACpC,CAEA,4BACEF,EACAK,EACAC,EACAC,EACyC,CACzC,OAAO,KAAK,WACT,IACC,eAAa,kCACf,EACC,QAAQP,EAAgBO,EAAOD,EAAiBD,CAAO,CAC5D,CACF",
6
+ "names": ["DefaultSignerEth_exports", "__export", "DefaultSignerEth", "__toCommonJS", "import_addressTypes", "import_di", "import_messageTypes", "import_transactionTypes", "import_typedDataTypes", "import_eip7702Types", "dmk", "sessionId", "contextModule", "derivationPath", "transaction", "options", "message", "typedData", "chainId", "contractAddress", "nonce"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var i=require("./address/di/addressTypes"),o=require("./message/di/messageTypes"),r=require("./transaction/di/transactionTypes"),d=require("./typed-data/di/typedDataTypes"),c=require("./DefaultSignerEth");describe("DefaultSignerEth",()=>{let a;const n={get:vi.fn(e=>({execute:vi.fn(()=>e===r.transactionTypes.SignTransactionUseCase?"transaction-result":e===o.messageTypes.SignMessageUseCase?"message-result":e===d.typedDataTypes.SignTypedDataUseCase?"typed-data-result":e===i.addressTypes.GetAddressUseCase?"address-result":"undefined-result")}))};beforeEach(()=>{vi.clearAllMocks();const e={},s="",t={};a=new c.DefaultSignerEth({dmk:e,sessionId:s,contextModule:t}),a._container=n}),describe("signTransaction",()=>{it("should sign a transaction",async()=>{const e="derivationPath",s=new Uint8Array(0),t=await a.signTransaction(e,s);expect(t).toBeDefined(),expect(t).toBe("transaction-result"),expect(n.get).toHaveBeenCalledWith(r.transactionTypes.SignTransactionUseCase)})}),describe("signMessage",()=>{it("should sign a message",async()=>{const t=await a.signMessage("derivationPath","message");expect(t).toBeDefined(),expect(t).toBe("message-result"),expect(n.get).toHaveBeenCalledWith(o.messageTypes.SignMessageUseCase)})}),describe("signTypedData",()=>{it("should sign typed data",async()=>{const e="derivationPath",s={},t=await a.signTypedData(e,s);expect(t).toBeDefined(),expect(t).toBe("typed-data-result"),expect(n.get).toHaveBeenCalledWith(d.typedDataTypes.SignTypedDataUseCase)})}),describe("getAddress",()=>{it("should get an address",async()=>{const s=await a.getAddress("derivationPath");expect(s).toBeDefined(),expect(s).toBe("address-result"),expect(n.get).toHaveBeenCalledWith(i.addressTypes.GetAddressUseCase)})})});
1
+ "use strict";var i=require("./address/di/addressTypes"),o=require("./eip7702/di/eip7702Types"),r=require("./message/di/messageTypes"),d=require("./transaction/di/transactionTypes"),c=require("./typed-data/di/typedDataTypes"),l=require("./DefaultSignerEth");describe("DefaultSignerEth",()=>{let a;const n={get:vi.fn(e=>({execute:vi.fn(()=>e===d.transactionTypes.SignTransactionUseCase?"transaction-result":e===o.eip7702Types.SignDelegationAuthorizationUseCase?"delegation-result":e===r.messageTypes.SignMessageUseCase?"message-result":e===c.typedDataTypes.SignTypedDataUseCase?"typed-data-result":e===i.addressTypes.GetAddressUseCase?"address-result":"undefined-result")}))};beforeEach(()=>{vi.clearAllMocks();const e={},s="",t={};a=new l.DefaultSignerEth({dmk:e,sessionId:s,contextModule:t}),a._container=n}),describe("signTransaction",()=>{it("should sign a transaction",async()=>{const e="derivationPath",s=new Uint8Array(0),t=await a.signTransaction(e,s);expect(t).toBeDefined(),expect(t).toBe("transaction-result"),expect(n.get).toHaveBeenCalledWith(d.transactionTypes.SignTransactionUseCase)})}),describe("signMessage",()=>{it("should sign a message",async()=>{const t=await a.signMessage("derivationPath","message");expect(t).toBeDefined(),expect(t).toBe("message-result"),expect(n.get).toHaveBeenCalledWith(r.messageTypes.SignMessageUseCase)})}),describe("signDelegationAuthorization",()=>{it("should sign a delegation authorization",async()=>{const g=await a.signDelegationAuthorization("derivationPath",2,"0xaddress",42);expect(g).toBeDefined(),expect(g).toBe("delegation-result"),expect(n.get).toHaveBeenCalledWith(o.eip7702Types.SignDelegationAuthorizationUseCase)})}),describe("signTypedData",()=>{it("should sign typed data",async()=>{const e="derivationPath",s={},t=await a.signTypedData(e,s);expect(t).toBeDefined(),expect(t).toBe("typed-data-result"),expect(n.get).toHaveBeenCalledWith(c.typedDataTypes.SignTypedDataUseCase)})}),describe("getAddress",()=>{it("should get an address",async()=>{const s=await a.getAddress("derivationPath");expect(s).toBeDefined(),expect(s).toBe("address-result"),expect(n.get).toHaveBeenCalledWith(i.addressTypes.GetAddressUseCase)})})});
2
2
  //# sourceMappingURL=DefaultSignerEth.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/internal/DefaultSignerEth.test.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 { addressTypes } from \"./address/di/addressTypes\";\nimport { messageTypes } from \"./message/di/messageTypes\";\nimport { transactionTypes } from \"./transaction/di/transactionTypes\";\nimport { typedDataTypes } from \"./typed-data/di/typedDataTypes\";\nimport { type TypedData } from \"..\";\nimport { DefaultSignerEth } from \"./DefaultSignerEth\";\n\ndescribe(\"DefaultSignerEth\", () => {\n let signer: DefaultSignerEth;\n const mock: Container = {\n get: vi.fn((id: symbol) => ({\n execute: vi.fn(() => {\n if (id === transactionTypes.SignTransactionUseCase) {\n return \"transaction-result\";\n } else if (id === messageTypes.SignMessageUseCase) {\n return \"message-result\";\n } else if (id === typedDataTypes.SignTypedDataUseCase) {\n return \"typed-data-result\";\n } else if (id === addressTypes.GetAddressUseCase) {\n return \"address-result\";\n }\n\n return \"undefined-result\";\n }),\n })),\n } as unknown as Container;\n\n beforeEach(() => {\n vi.clearAllMocks();\n\n const dmk = {} as DeviceManagementKit;\n const sessionId = \"\" as DeviceSessionId;\n const contextModule = {} as ContextModule;\n signer = new DefaultSignerEth({ dmk, sessionId, contextModule });\n signer[\"_container\"] = mock as unknown as Container;\n });\n\n describe(\"signTransaction\", () => {\n it(\"should sign a transaction\", async () => {\n // GIVEN\n const derivationPath = \"derivationPath\";\n const transaction = new Uint8Array(0);\n\n // WHEN\n const result = await signer.signTransaction(derivationPath, transaction);\n\n // THEN\n expect(result).toBeDefined();\n expect(result).toBe(\"transaction-result\");\n expect(mock.get).toHaveBeenCalledWith(\n transactionTypes.SignTransactionUseCase,\n );\n });\n });\n\n describe(\"signMessage\", () => {\n it(\"should sign a message\", async () => {\n // GIVEN\n const derivationPath = \"derivationPath\";\n const message = \"message\";\n\n // WHEN\n const result = await signer.signMessage(derivationPath, message);\n\n // THEN\n expect(result).toBeDefined();\n expect(result).toBe(\"message-result\");\n expect(mock.get).toHaveBeenCalledWith(messageTypes.SignMessageUseCase);\n });\n });\n\n describe(\"signTypedData\", () => {\n it(\"should sign typed data\", async () => {\n // GIVEN\n const derivationPath = \"derivationPath\";\n const typedData = {} as TypedData;\n\n // WHEN\n const result = await signer.signTypedData(derivationPath, typedData);\n\n // THEN\n expect(result).toBeDefined();\n expect(result).toBe(\"typed-data-result\");\n expect(mock.get).toHaveBeenCalledWith(\n typedDataTypes.SignTypedDataUseCase,\n );\n });\n });\n\n describe(\"getAddress\", () => {\n it(\"should get an address\", async () => {\n // GIVEN\n const derivationPath = \"derivationPath\";\n\n // WHEN\n const result = await signer.getAddress(derivationPath);\n\n // THEN\n expect(result).toBeDefined();\n expect(result).toBe(\"address-result\");\n expect(mock.get).toHaveBeenCalledWith(addressTypes.GetAddressUseCase);\n });\n });\n});\n"],
5
- "mappings": "aAOA,IAAAA,EAA6B,qCAC7BC,EAA6B,qCAC7BC,EAAiC,6CACjCC,EAA+B,0CAE/BC,EAAiC,8BAEjC,SAAS,mBAAoB,IAAM,CACjC,IAAIC,EACJ,MAAMC,EAAkB,CACtB,IAAK,GAAG,GAAIC,IAAgB,CAC1B,QAAS,GAAG,GAAG,IACTA,IAAO,mBAAiB,uBACnB,qBACEA,IAAO,eAAa,mBACtB,iBACEA,IAAO,iBAAe,qBACxB,oBACEA,IAAO,eAAa,kBACtB,iBAGF,kBACR,CACH,EAAE,CACJ,EAEA,WAAW,IAAM,CACf,GAAG,cAAc,EAEjB,MAAMC,EAAM,CAAC,EACPC,EAAY,GACZC,EAAgB,CAAC,EACvBL,EAAS,IAAI,mBAAiB,CAAE,IAAAG,EAAK,UAAAC,EAAW,cAAAC,CAAc,CAAC,EAC/DL,EAAO,WAAgBC,CACzB,CAAC,EAED,SAAS,kBAAmB,IAAM,CAChC,GAAG,4BAA6B,SAAY,CAE1C,MAAMK,EAAiB,iBACjBC,EAAc,IAAI,WAAW,CAAC,EAG9BC,EAAS,MAAMR,EAAO,gBAAgBM,EAAgBC,CAAW,EAGvE,OAAOC,CAAM,EAAE,YAAY,EAC3B,OAAOA,CAAM,EAAE,KAAK,oBAAoB,EACxC,OAAOP,EAAK,GAAG,EAAE,qBACf,mBAAiB,sBACnB,CACF,CAAC,CACH,CAAC,EAED,SAAS,cAAe,IAAM,CAC5B,GAAG,wBAAyB,SAAY,CAMtC,MAAMO,EAAS,MAAMR,EAAO,YAJL,iBACP,SAG+C,EAG/D,OAAOQ,CAAM,EAAE,YAAY,EAC3B,OAAOA,CAAM,EAAE,KAAK,gBAAgB,EACpC,OAAOP,EAAK,GAAG,EAAE,qBAAqB,eAAa,kBAAkB,CACvE,CAAC,CACH,CAAC,EAED,SAAS,gBAAiB,IAAM,CAC9B,GAAG,yBAA0B,SAAY,CAEvC,MAAMK,EAAiB,iBACjBG,EAAY,CAAC,EAGbD,EAAS,MAAMR,EAAO,cAAcM,EAAgBG,CAAS,EAGnE,OAAOD,CAAM,EAAE,YAAY,EAC3B,OAAOA,CAAM,EAAE,KAAK,mBAAmB,EACvC,OAAOP,EAAK,GAAG,EAAE,qBACf,iBAAe,oBACjB,CACF,CAAC,CACH,CAAC,EAED,SAAS,aAAc,IAAM,CAC3B,GAAG,wBAAyB,SAAY,CAKtC,MAAMO,EAAS,MAAMR,EAAO,WAHL,gBAG8B,EAGrD,OAAOQ,CAAM,EAAE,YAAY,EAC3B,OAAOA,CAAM,EAAE,KAAK,gBAAgB,EACpC,OAAOP,EAAK,GAAG,EAAE,qBAAqB,eAAa,iBAAiB,CACtE,CAAC,CACH,CAAC,CACH,CAAC",
6
- "names": ["import_addressTypes", "import_messageTypes", "import_transactionTypes", "import_typedDataTypes", "import_DefaultSignerEth", "signer", "mock", "id", "dmk", "sessionId", "contextModule", "derivationPath", "transaction", "result", "typedData"]
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 { addressTypes } from \"./address/di/addressTypes\";\nimport { eip7702Types } from \"./eip7702/di/eip7702Types\";\nimport { messageTypes } from \"./message/di/messageTypes\";\nimport { transactionTypes } from \"./transaction/di/transactionTypes\";\nimport { typedDataTypes } from \"./typed-data/di/typedDataTypes\";\nimport { type TypedData } from \"..\";\nimport { DefaultSignerEth } from \"./DefaultSignerEth\";\n\ndescribe(\"DefaultSignerEth\", () => {\n let signer: DefaultSignerEth;\n const mock: Container = {\n get: vi.fn((id: symbol) => ({\n execute: vi.fn(() => {\n if (id === transactionTypes.SignTransactionUseCase) {\n return \"transaction-result\";\n } else if (id === eip7702Types.SignDelegationAuthorizationUseCase) {\n return \"delegation-result\";\n } else if (id === messageTypes.SignMessageUseCase) {\n return \"message-result\";\n } else if (id === typedDataTypes.SignTypedDataUseCase) {\n return \"typed-data-result\";\n } else if (id === addressTypes.GetAddressUseCase) {\n return \"address-result\";\n }\n\n return \"undefined-result\";\n }),\n })),\n } as unknown as Container;\n\n beforeEach(() => {\n vi.clearAllMocks();\n\n const dmk = {} as DeviceManagementKit;\n const sessionId = \"\" as DeviceSessionId;\n const contextModule = {} as ContextModule;\n signer = new DefaultSignerEth({ dmk, sessionId, contextModule });\n signer[\"_container\"] = mock as unknown as Container;\n });\n\n describe(\"signTransaction\", () => {\n it(\"should sign a transaction\", async () => {\n // GIVEN\n const derivationPath = \"derivationPath\";\n const transaction = new Uint8Array(0);\n\n // WHEN\n const result = await signer.signTransaction(derivationPath, transaction);\n\n // THEN\n expect(result).toBeDefined();\n expect(result).toBe(\"transaction-result\");\n expect(mock.get).toHaveBeenCalledWith(\n transactionTypes.SignTransactionUseCase,\n );\n });\n });\n\n describe(\"signMessage\", () => {\n it(\"should sign a message\", async () => {\n // GIVEN\n const derivationPath = \"derivationPath\";\n const message = \"message\";\n\n // WHEN\n const result = await signer.signMessage(derivationPath, message);\n\n // THEN\n expect(result).toBeDefined();\n expect(result).toBe(\"message-result\");\n expect(mock.get).toHaveBeenCalledWith(messageTypes.SignMessageUseCase);\n });\n });\n\n describe(\"signDelegationAuthorization\", () => {\n it(\"should sign a delegation authorization\", async () => {\n // GIVEN\n const derivationPath = \"derivationPath\";\n const chainId = 2;\n const nonce = 42;\n const address = \"0xaddress\";\n\n // WHEN\n const result = await signer.signDelegationAuthorization(\n derivationPath,\n chainId,\n address,\n nonce,\n );\n\n // THEN\n expect(result).toBeDefined();\n expect(result).toBe(\"delegation-result\");\n expect(mock.get).toHaveBeenCalledWith(\n eip7702Types.SignDelegationAuthorizationUseCase,\n );\n });\n });\n\n describe(\"signTypedData\", () => {\n it(\"should sign typed data\", async () => {\n // GIVEN\n const derivationPath = \"derivationPath\";\n const typedData = {} as TypedData;\n\n // WHEN\n const result = await signer.signTypedData(derivationPath, typedData);\n\n // THEN\n expect(result).toBeDefined();\n expect(result).toBe(\"typed-data-result\");\n expect(mock.get).toHaveBeenCalledWith(\n typedDataTypes.SignTypedDataUseCase,\n );\n });\n });\n\n describe(\"getAddress\", () => {\n it(\"should get an address\", async () => {\n // GIVEN\n const derivationPath = \"derivationPath\";\n\n // WHEN\n const result = await signer.getAddress(derivationPath);\n\n // THEN\n expect(result).toBeDefined();\n expect(result).toBe(\"address-result\");\n expect(mock.get).toHaveBeenCalledWith(addressTypes.GetAddressUseCase);\n });\n });\n});\n"],
5
+ "mappings": "aAOA,IAAAA,EAA6B,qCAC7BC,EAA6B,qCAC7BC,EAA6B,qCAC7BC,EAAiC,6CACjCC,EAA+B,0CAE/BC,EAAiC,8BAEjC,SAAS,mBAAoB,IAAM,CACjC,IAAIC,EACJ,MAAMC,EAAkB,CACtB,IAAK,GAAG,GAAIC,IAAgB,CAC1B,QAAS,GAAG,GAAG,IACTA,IAAO,mBA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AEvC,MAAMK,EAAiB,iBACjBG,EAAY,CAAC,EAGbD,EAAS,MAAMR,EAAO,cAAcM,EAAgBG,CAAS,EAGnE,OAAOD,CAAM,EAAE,YAAY,EAC3B,OAAOA,CAAM,EAAE,KAAK,mBAAmB,EACvC,OAAOP,EAAK,GAAG,EAAE,qBACf,iBAAe,oBACjB,CACF,CAAC,CACH,CAAC,EAED,SAAS,aAAc,IAAM,CAC3B,GAAG,wBAAyB,SAAY,CAKtC,MAAMO,EAAS,MAAMR,EAAO,WAHL,gBAG8B,EAGrD,OAAOQ,CAAM,EAAE,YAAY,EAC3B,OAAOA,CAAM,EAAE,KAAK,gBAAgB,EACpC,OAAOP,EAAK,GAAG,EAAE,qBAAqB,eAAa,iBAAiB,CACtE,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["import_addressTypes", "import_eip7702Types", "import_messageTypes", "import_transactionTypes", "import_typedDataTypes", "import_DefaultSignerEth", "signer", "mock", "id", "dmk", "sessionId", "contextModule", "derivationPath", "transaction", "result", "typedData"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var r=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var p=(o,e)=>{for(var n in e)r(o,n,{get:e[n],enumerable:!0})},u=(o,e,n,d)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of _(e))!c.call(o,s)&&s!==n&&r(o,s,{get:()=>e[s],enumerable:!(d=m(e,s))||d.enumerable});return o};var A=o=>u(r({},"__esModule",{value:!0}),o);var f={};p(f,{addressModuleFactory:()=>b});module.exports=A(f);var t=require("inversify"),i=require("../../address/di/addressTypes"),a=require("../../address/use-case/GetAddressUseCase");const b=()=>new t.ContainerModule((o,e,n,d,s,y,C)=>{o(i.addressTypes.GetAddressUseCase).to(a.GetAddressUseCase)});0&&(module.exports={addressModuleFactory});
1
+ "use strict";var d=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var C=(e,s)=>{for(var r in s)d(e,r,{get:s[r],enumerable:!0})},c=(e,s,r,t)=>{if(s&&typeof s=="object"||typeof s=="function")for(let o of n(s))!f.call(e,o)&&o!==r&&d(e,o,{get:()=>s[o],enumerable:!(t=i(s,o))||t.enumerable});return e};var l=e=>c(d({},"__esModule",{value:!0}),e);var y={};C(y,{addressModuleFactory:()=>u});module.exports=l(y);var a=require("inversify"),m=require("../../address/di/addressTypes"),p=require("../../address/use-case/GetAddressUseCase");const u=()=>new a.ContainerModule(({bind:e})=>{e(m.addressTypes.GetAddressUseCase).to(p.GetAddressUseCase)});0&&(module.exports={addressModuleFactory});
2
2
  //# sourceMappingURL=addressModule.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/address/di/addressModule.ts"],
4
- "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { addressTypes } from \"@internal/address/di/addressTypes\";\nimport { GetAddressUseCase } from \"@internal/address/use-case/GetAddressUseCase\";\n\nexport const addressModuleFactory = () =>\n new ContainerModule(\n (\n bind,\n _unbind,\n _isBound,\n _rebind,\n _unbindAsync,\n _onActivation,\n _onDeactivation,\n ) => {\n bind(addressTypes.GetAddressUseCase).to(GetAddressUseCase);\n },\n );\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAA6B,6CAC7BC,EAAkC,wDAE3B,MAAMJ,EAAuB,IAClC,IAAI,kBACF,CACEK,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,IACG,CACHN,EAAK,eAAa,iBAAiB,EAAE,GAAG,mBAAiB,CAC3D,CACF",
6
- "names": ["addressModule_exports", "__export", "addressModuleFactory", "__toCommonJS", "import_inversify", "import_addressTypes", "import_GetAddressUseCase", "bind", "_unbind", "_isBound", "_rebind", "_unbindAsync", "_onActivation", "_onDeactivation"]
4
+ "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { addressTypes } from \"@internal/address/di/addressTypes\";\nimport { GetAddressUseCase } from \"@internal/address/use-case/GetAddressUseCase\";\n\nexport const addressModuleFactory = () =>\n new ContainerModule(({ bind }) => {\n bind(addressTypes.GetAddressUseCase).to(GetAddressUseCase);\n });\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAA6B,6CAC7BC,EAAkC,wDAE3B,MAAMJ,EAAuB,IAClC,IAAI,kBAAgB,CAAC,CAAE,KAAAK,CAAK,IAAM,CAChCA,EAAK,eAAa,iBAAiB,EAAE,GAAG,mBAAiB,CAC3D,CAAC",
6
+ "names": ["addressModule_exports", "__export", "addressModuleFactory", "__toCommonJS", "import_inversify", "import_addressTypes", "import_GetAddressUseCase", "bind"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var r=require("inversify"),d=require("./addressModule");describe("addressModuleFactory",()=>{describe("Default",()=>{let o,e;beforeEach(()=>{e=(0,d.addressModuleFactory)(),o=new r.Container,o.load(e)}),it("should return the address module",()=>{expect(e).toBeDefined()})})});
1
+ "use strict";var r=require("inversify"),d=require("./addressModule");describe("addressModuleFactory",()=>{describe("Default",()=>{let o,e;beforeEach(()=>{e=(0,d.addressModuleFactory)(),o=new r.Container,o.loadSync(e)}),it("should return the address module",()=>{expect(e).toBeDefined()})})});
2
2
  //# sourceMappingURL=addressModule.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/address/di/addressModule.test.ts"],
4
- "sourcesContent": ["import { Container } from \"inversify\";\n\nimport { addressModuleFactory } from \"./addressModule\";\n\ndescribe(\"addressModuleFactory\", () => {\n describe(\"Default\", () => {\n let container: Container;\n let mod: ReturnType<typeof addressModuleFactory>;\n beforeEach(() => {\n mod = addressModuleFactory();\n container = new Container();\n container.load(mod);\n });\n\n it(\"should return the address module\", () => {\n expect(mod).toBeDefined();\n });\n });\n});\n"],
5
- "mappings": "aAAA,IAAAA,EAA0B,qBAE1BC,EAAqC,2BAErC,SAAS,uBAAwB,IAAM,CACrC,SAAS,UAAW,IAAM,CACxB,IAAIC,EACAC,EACJ,WAAW,IAAM,CACfA,KAAM,wBAAqB,EAC3BD,EAAY,IAAI,YAChBA,EAAU,KAAKC,CAAG,CACpB,CAAC,EAED,GAAG,mCAAoC,IAAM,CAC3C,OAAOA,CAAG,EAAE,YAAY,CAC1B,CAAC,CACH,CAAC,CACH,CAAC",
4
+ "sourcesContent": ["import { Container } from \"inversify\";\n\nimport { addressModuleFactory } from \"./addressModule\";\n\ndescribe(\"addressModuleFactory\", () => {\n describe(\"Default\", () => {\n let container: Container;\n let mod: ReturnType<typeof addressModuleFactory>;\n beforeEach(() => {\n mod = addressModuleFactory();\n container = new Container();\n container.loadSync(mod);\n });\n\n it(\"should return the address module\", () => {\n expect(mod).toBeDefined();\n });\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAA0B,qBAE1BC,EAAqC,2BAErC,SAAS,uBAAwB,IAAM,CACrC,SAAS,UAAW,IAAM,CACxB,IAAIC,EACAC,EACJ,WAAW,IAAM,CACfA,KAAM,wBAAqB,EAC3BD,EAAY,IAAI,YAChBA,EAAU,SAASC,CAAG,CACxB,CAAC,EAED,GAAG,mCAAoC,IAAM,CAC3C,OAAOA,CAAG,EAAE,YAAY,CAC1B,CAAC,CACH,CAAC,CACH,CAAC",
6
6
  "names": ["import_inversify", "import_addressModule", "container", "mod"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var c=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var M=(i,e)=>{for(var n in e)c(i,n,{get:e[n],enumerable:!0})},P=(i,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of k(e))!g.call(i,t)&&t!==n&&c(i,t,{get:()=>e[t],enumerable:!(r=y(e,t))||r.enumerable});return i};var I=i=>P(c({},"__esModule",{value:!0}),i),D=(i,e,n,r)=>{for(var t=r>1?void 0:r?y(e,n):e,p=i.length-1,A;p>=0;p--)(A=i[p])&&(t=(r?A(e,n,t):A(t))||t);return r&&t&&c(e,n,t),t},a=(i,e)=>(n,r)=>e(n,r,i);var x={};M(x,{EthAppBinder:()=>s});module.exports=I(x);var v=require("@ledgerhq/device-management-kit"),m=require("@ledgerhq/device-management-kit"),o=require("inversify"),l=require("../app-binder/device-action/SignTypedData/SignTypedDataDeviceAction"),S=require("../app-binder/task/SendSignPersonalMessageTask"),d=require("../externalTypes"),u=require("../transaction/di/transactionTypes"),f=require("./command/GetAddressCommand"),T=require("./constant/plugins"),h=require("./device-action/SignTransaction/SignTransactionDeviceAction");let s=class{constructor(e,n,r,t,p){this.dmk=e;this.contextModule=n;this.mapper=r;this.parser=t;this.sessionId=p}getAddress(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new v.SendCommandInAppDeviceAction({input:{command:new f.GetAddressCommand(e),appName:"Ethereum",compatibleAppNames:T.ETHEREUM_PLUGINS,requiredUserInteraction:e.checkOnDevice?m.UserInteractionRequired.VerifyAddress:m.UserInteractionRequired.None,skipOpenApp:e.skipOpenApp}})})}signPersonalMessage(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new v.CallTaskInAppDeviceAction({input:{task:async n=>new S.SendSignPersonalMessageTask(n,e).run(),appName:"Ethereum",compatibleAppNames:T.ETHEREUM_PLUGINS,requiredUserInteraction:m.UserInteractionRequired.SignPersonalMessage,skipOpenApp:e.skipOpenApp}})})}signTransaction(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new h.SignTransactionDeviceAction({input:{derivationPath:e.derivationPath,transaction:e.transaction,mapper:this.mapper,parser:this.parser,contextModule:this.contextModule,options:e.options??{}}})})}signTypedData(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new l.SignTypedDataDeviceAction({input:{derivationPath:e.derivationPath,data:e.data,parser:e.parser,contextModule:this.contextModule,skipOpenApp:e.skipOpenApp}})})}};s=D([(0,o.injectable)(),a(0,(0,o.inject)(d.externalTypes.Dmk)),a(1,(0,o.inject)(d.externalTypes.ContextModule)),a(2,(0,o.inject)(u.transactionTypes.TransactionMapperService)),a(3,(0,o.inject)(u.transactionTypes.TransactionParserService)),a(4,(0,o.inject)(d.externalTypes.SessionId))],s);0&&(module.exports={EthAppBinder});
1
+ "use strict";var d=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var P=(n,e)=>{for(var t in e)d(n,t,{get:e[t],enumerable:!0})},M=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of k(e))!I.call(n,i)&&i!==t&&d(n,i,{get:()=>e[i],enumerable:!(r=T(e,i))||r.enumerable});return n};var x=n=>M(d({},"__esModule",{value:!0}),n),y=(n,e,t,r)=>{for(var i=r>1?void 0:r?T(e,t):e,m=n.length-1,v;m>=0;m--)(v=n[m])&&(i=(r?v(e,t,i):v(i))||i);return r&&i&&d(e,t,i),i},a=(n,e)=>(t,r)=>e(t,r,n);var O={};P(O,{EthAppBinder:()=>p});module.exports=x(O);var c=require("@ledgerhq/device-management-kit"),s=require("@ledgerhq/device-management-kit"),o=require("inversify"),h=require("../app-binder/device-action/SignTypedData/SignTypedDataDeviceAction"),l=require("../app-binder/task/SendSignPersonalMessageTask"),u=require("../externalTypes"),D=require("../transaction/di/transactionTypes"),g=require("./command/GetAddressCommand"),A=require("./constant/plugins"),S=require("./device-action/SignTransaction/SignTransactionDeviceAction"),f=require("./task/SendSignAuthorizationDelegationTask");let p=class{constructor(e,t,r,i,m){this.dmk=e;this.contextModule=t;this.mapper=r;this.parser=i;this.sessionId=m}getAddress(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new c.SendCommandInAppDeviceAction({input:{command:new g.GetAddressCommand(e),appName:"Ethereum",compatibleAppNames:A.ETHEREUM_PLUGINS,requiredUserInteraction:e.checkOnDevice?s.UserInteractionRequired.VerifyAddress:s.UserInteractionRequired.None,skipOpenApp:e.skipOpenApp}})})}signPersonalMessage(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new c.CallTaskInAppDeviceAction({input:{task:async t=>new l.SendSignPersonalMessageTask(t,e).run(),appName:"Ethereum",compatibleAppNames:A.ETHEREUM_PLUGINS,requiredUserInteraction:s.UserInteractionRequired.SignPersonalMessage,skipOpenApp:e.skipOpenApp}})})}signTransaction(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new S.SignTransactionDeviceAction({input:{derivationPath:e.derivationPath,transaction:e.transaction,mapper:this.mapper,parser:this.parser,contextModule:this.contextModule,options:e.options??{}}})})}signTypedData(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new h.SignTypedDataDeviceAction({input:{derivationPath:e.derivationPath,data:e.data,parser:e.parser,contextModule:this.contextModule,skipOpenApp:e.skipOpenApp}})})}signDelegationAuthorization(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new c.CallTaskInAppDeviceAction({input:{task:async t=>new f.SendSignAuthorizationDelegationTask(t,e).run(),appName:"Ethereum",compatibleAppNames:A.ETHEREUM_PLUGINS,requiredUserInteraction:s.UserInteractionRequired.SignDelegationAuthorization,skipOpenApp:!1}})})}};p=y([(0,o.injectable)(),a(0,(0,o.inject)(u.externalTypes.Dmk)),a(1,(0,o.inject)(u.externalTypes.ContextModule)),a(2,(0,o.inject)(D.transactionTypes.TransactionMapperService)),a(3,(0,o.inject)(D.transactionTypes.TransactionParserService)),a(4,(0,o.inject)(u.externalTypes.SessionId))],p);0&&(module.exports={EthAppBinder});
2
2
  //# sourceMappingURL=EthAppBinder.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/internal/app-binder/EthAppBinder.ts"],
4
- "sourcesContent": ["import { type ContextModule } from \"@ledgerhq/context-module\";\nimport {\n DeviceManagementKit,\n type DeviceSessionId,\n} from \"@ledgerhq/device-management-kit\";\nimport {\n CallTaskInAppDeviceAction,\n SendCommandInAppDeviceAction,\n} from \"@ledgerhq/device-management-kit\";\nimport { UserInteractionRequired } from \"@ledgerhq/device-management-kit\";\nimport { inject, injectable } from \"inversify\";\n\nimport { type GetAddressDAReturnType } from \"@api/app-binder/GetAddressDeviceActionTypes\";\nimport { type SignPersonalMessageDAReturnType } from \"@api/app-binder/SignPersonalMessageDeviceActionTypes\";\nimport { type SignTransactionDAReturnType } from \"@api/app-binder/SignTransactionDeviceActionTypes\";\nimport { type SignTypedDataDAReturnType } from \"@api/app-binder/SignTypedDataDeviceActionTypes\";\nimport { type TransactionOptions } from \"@api/model/TransactionOptions\";\nimport { type TypedData } from \"@api/model/TypedData\";\nimport { SignTypedDataDeviceAction } from \"@internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction\";\nimport { SendSignPersonalMessageTask } from \"@internal/app-binder/task/SendSignPersonalMessageTask\";\nimport { externalTypes } from \"@internal/externalTypes\";\nimport { transactionTypes } from \"@internal/transaction/di/transactionTypes\";\nimport { TransactionMapperService } from \"@internal/transaction/service/mapper/TransactionMapperService\";\nimport { TransactionParserService } from \"@internal/transaction/service/parser/TransactionParserService\";\nimport { type TypedDataParserService } from \"@internal/typed-data/service/TypedDataParserService\";\n\nimport { GetAddressCommand } from \"./command/GetAddressCommand\";\nimport { ETHEREUM_PLUGINS } from \"./constant/plugins\";\nimport { SignTransactionDeviceAction } from \"./device-action/SignTransaction/SignTransactionDeviceAction\";\n\n@injectable()\nexport class EthAppBinder {\n constructor(\n @inject(externalTypes.Dmk) private dmk: DeviceManagementKit,\n @inject(externalTypes.ContextModule) private contextModule: ContextModule,\n @inject(transactionTypes.TransactionMapperService)\n private mapper: TransactionMapperService,\n @inject(transactionTypes.TransactionParserService)\n private parser: TransactionParserService,\n @inject(externalTypes.SessionId) private sessionId: DeviceSessionId,\n ) {}\n\n getAddress(args: {\n derivationPath: string;\n checkOnDevice: boolean;\n returnChainCode: boolean;\n 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: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ACF,CAAC,CACH,CAAC,CACH,CAEA,cAAcA,EAKgB,CAC5B,OAAO,KAAK,IAAI,oBAAoB,CAClC,UAAW,KAAK,UAChB,aAAc,IAAI,4BAA0B,CAC1C,MAAO,CACL,eAAgBA,EAAK,eACrB,KAAMA,EAAK,KACX,OAAQA,EAAK,OACb,cAAe,KAAK,cACpB,YAAaA,EAAK,WACpB,CACF,CAAC,CACH,CAAC,CACH,CACF,EA5FaN,EAANQ,EAAA,IADN,cAAW,EAGPC,EAAA,eAAO,gBAAc,GAAG,GACxBA,EAAA,eAAO,gBAAc,aAAa,GAClCA,EAAA,eAAO,mBAAiB,wBAAwB,GAEhDA,EAAA,eAAO,mBAAiB,wBAAwB,GAEhDA,EAAA,eAAO,gBAAc,SAAS,IARtBT",
6
- "names": ["EthAppBinder_exports", "__export", "EthAppBinder", "__toCommonJS", "import_device_management_kit", "import_inversify", "import_SignTypedDataDeviceAction", "import_SendSignPersonalMessageTask", "import_externalTypes", "import_transactionTypes", "import_GetAddressCommand", "import_plugins", "import_SignTransactionDeviceAction", "EthAppBinder", "dmk", "contextModule", "mapper", "parser", "sessionId", "args", "internalApi", "__decorateClass", "__decorateParam"]
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 { SignDelegationAuthorizationDAReturnType } from \"@api/app-binder/SignDelegationAuthorizationTypes\";\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\";\nimport { SendSignAuthorizationDelegationTask } from \"./task/SendSignAuthorizationDelegationTask\";\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 signDelegationAuthorization(args: {\n derivationPath: string;\n chainId: number;\n address: string;\n nonce: number;\n }): SignDelegationAuthorizationDAReturnType {\n return this.dmk.executeDeviceAction({\n sessionId: this.sessionId,\n deviceAction: new CallTaskInAppDeviceAction({\n input: {\n task: async (internalApi) =>\n new SendSignAuthorizationDelegationTask(internalApi, args).run(),\n appName: \"Ethereum\",\n compatibleAppNames: ETHEREUM_PLUGINS,\n requiredUserInteraction:\n UserInteractionRequired.SignDelegationAuthorization,\n skipOpenApp: false,\n },\n }),\n });\n }\n}\n"],
5
+ "mappings": "okBAAA,IAAAA,EAAA,GAAAC,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AAK,IAAI,oBAAoB,CAClC,UAAW,KAAK,UAChB,aAAc,IAAI,4BAA0B,CAC1C,MAAO,CACL,eAAgBA,EAAK,eACrB,KAAMA,EAAK,KACX,OAAQA,EAAK,OACb,cAAe,KAAK,cACpB,YAAaA,EAAK,WACpB,CACF,CAAC,CACH,CAAC,CACH,CAEA,4BAA4BA,EAKgB,CAC1C,OAAO,KAAK,IAAI,oBAAoB,CAClC,UAAW,KAAK,UAChB,aAAc,IAAI,4BAA0B,CAC1C,MAAO,CACL,KAAM,MAAOC,GACX,IAAI,sCAAoCA,EAAaD,CAAI,EAAE,IAAI,EACjE,QAAS,WACT,mBAAoB,mBACpB,wBACE,0BAAwB,4BAC1B,YAAa,EACf,CACF,CAAC,CACH,CAAC,CACH,CACF,EAlHaN,EAANQ,EAAA,IADN,cAAW,EAGPC,EAAA,eAAO,gBAAc,GAAG,GACxBA,EAAA,eAAO,gBAAc,aAAa,GAClCA,EAAA,eAAO,mBAAiB,wBAAwB,GAEhDA,EAAA,eAAO,mBAAiB,wBAAwB,GAEhDA,EAAA,eAAO,gBAAc,SAAS,IARtBT",
6
+ "names": ["EthAppBinder_exports", "__export", "EthAppBinder", "__toCommonJS", "import_device_management_kit", "import_inversify", "import_SignTypedDataDeviceAction", "import_SendSignPersonalMessageTask", "import_externalTypes", "import_transactionTypes", "import_GetAddressCommand", "import_plugins", "import_SignTransactionDeviceAction", "import_SendSignAuthorizationDelegationTask", "EthAppBinder", "dmk", "contextModule", "mapper", "parser", "sessionId", "args", "internalApi", "__decorateClass", "__decorateParam"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var v=require("@ledgerhq/device-management-kit"),c=require("@ledgerhq/device-management-kit"),g=require("@ledgerhq/device-management-kit"),S=require("@ledgerhq/device-management-kit"),y=require("ethers"),A=require("rxjs"),f=require("./command/GetAddressCommand"),h=require("./constant/plugins"),u=require("./EthAppBinder");describe("EthAppBinder",()=>{const a={sendCommand:vi.fn(),executeDeviceAction:vi.fn()},m={getContext:vi.fn(),getContexts:vi.fn(),getTypedDataFilters:vi.fn(),getWeb3Checks:vi.fn()},D={mapTransactionToSubset:vi.fn()},l={extractValue:vi.fn()};beforeEach(()=>{vi.clearAllMocks()}),describe("getAddress",()=>{it("should return the address, publicKey, and chainCode",()=>new Promise((s,r)=>{const e="0xF7C69BedB292Dd3fC2cA4103989B5BD705164c43",i="04e3785ca";vi.spyOn(a,"executeDeviceAction").mockReturnValue({observable:(0,A.from)([{status:c.DeviceActionStatus.Completed,output:{address:e,publicKey:i,chainCode:void 0}}]),cancel:vi.fn()});const p=new u.EthAppBinder(a,m,D,l,"sessionId"),{observable:o}=p.getAddress({derivationPath:"44'/60'/3'/2/1",checkOnDevice:!1,returnChainCode:!1,skipOpenApp:!1}),t=[];o.subscribe({next:n=>{t.push(n)},error:n=>{r(n)},complete:()=>{try{expect(t).toEqual([{status:c.DeviceActionStatus.Completed,output:{address:e,publicKey:i,chainCode:void 0}}]),s()}catch(n){r(n)}}})})),describe("calls of executeDeviceAction with the correct params",()=>{const s={derivationPath:"44'/60'/3'/2/1",checkOnDevice:!1,returnChainCode:!1,skipOpenApp:!1};test("when checkOnDevice is true: UserInteractionRequired.VerifyAddress",()=>{const e={...s,checkOnDevice:!0};new u.EthAppBinder(a,m,D,l,"sessionId").getAddress(e),expect(a.executeDeviceAction).toHaveBeenCalledWith({sessionId:"sessionId",deviceAction:new g.SendCommandInAppDeviceAction({input:{command:new f.GetAddressCommand(e),appName:"Ethereum",requiredUserInteraction:S.UserInteractionRequired.VerifyAddress,compatibleAppNames:h.ETHEREUM_PLUGINS,skipOpenApp:!1}})})}),test("when checkOnDevice is false: UserInteractionRequired.None",()=>{const e={...s,checkOnDevice:!1};new u.EthAppBinder(a,m,D,l,"sessionId").getAddress(e),expect(a.executeDeviceAction).toHaveBeenCalledWith({sessionId:"sessionId",deviceAction:new g.SendCommandInAppDeviceAction({input:{command:new f.GetAddressCommand(e),appName:"Ethereum",requiredUserInteraction:S.UserInteractionRequired.None,compatibleAppNames:h.ETHEREUM_PLUGINS,skipOpenApp:!1}})})})})}),describe("signTransaction",()=>{it("should return the signature",()=>new Promise((s,r)=>{const e={r:"0xDEAD",s:"0xBEEF",v:0},i=(0,v.hexaStringToBuffer)(y.Transaction.from({to:"0x1234567890123456789012345678901234567890",value:0n}).unsignedSerialized),d={};vi.spyOn(a,"executeDeviceAction").mockReturnValue({observable:(0,A.from)([{status:c.DeviceActionStatus.Completed,output:e}]),cancel:vi.fn()});const p=new u.EthAppBinder(a,m,D,l,"sessionId"),{observable:o}=p.signTransaction({derivationPath:"44'/60'/3'/2/1",transaction:i,options:d}),t=[];o.subscribe({next:n=>{t.push(n)},error:n=>{r(n)},complete:()=>{try{expect(t).toEqual([{status:c.DeviceActionStatus.Completed,output:e}]),s()}catch(n){r(n)}}})})),it("should return the signature without options",()=>new Promise((s,r)=>{const e={r:"0xDEAD",s:"0xBEEF",v:0},i=(0,v.hexaStringToBuffer)(y.Transaction.from({to:"0x1234567890123456789012345678901234567890",value:0n}).unsignedSerialized);vi.spyOn(a,"executeDeviceAction").mockReturnValue({observable:(0,A.from)([{status:c.DeviceActionStatus.Completed,output:e}]),cancel:vi.fn()});const d=new u.EthAppBinder(a,m,D,l,"sessionId"),{observable:p}=d.signTransaction({derivationPath:"44'/60'/3'/2/1",transaction:i,options:void 0}),o=[];p.subscribe({next:t=>{o.push(t)},error:t=>{r(t)},complete:()=>{try{expect(o).toEqual([{status:c.DeviceActionStatus.Completed,output:e}]),s()}catch(t){r(t)}}})}))}),describe("signMessage",()=>{it("should return the signature",()=>new Promise((s,r)=>{const e={r:"0xDEAD",s:"0xBEEF",v:0},i="Hello, World!";vi.spyOn(a,"executeDeviceAction").mockReturnValue({observable:(0,A.from)([{status:c.DeviceActionStatus.Completed,output:e}]),cancel:vi.fn()});const d=new u.EthAppBinder(a,m,D,l,"sessionId"),{observable:p}=d.signPersonalMessage({derivationPath:"44'/60'/3'/2/1",message:i,skipOpenApp:!1}),o=[];p.subscribe({next:t=>{o.push(t)},error:t=>{r(t)},complete:()=>{try{expect(o).toEqual([{status:c.DeviceActionStatus.Completed,output:e}]),s()}catch(t){r(t)}}})}))}),describe("signTypedData",()=>{it("should return the signature",()=>new Promise((s,r)=>{const e={r:"0xDEAD",s:"0xBEEF",v:0},i={domain:{},types:{},primaryType:"test",message:{}},d={parse:vi.fn()};vi.spyOn(a,"executeDeviceAction").mockReturnValue({observable:(0,A.from)([{status:c.DeviceActionStatus.Completed,output:e}]),cancel:vi.fn()});const p=new u.EthAppBinder(a,m,D,l,"sessionId"),{observable:o}=p.signTypedData({derivationPath:"44'/60'/3'/2/1",parser:d,data:i,skipOpenApp:!1}),t=[];o.subscribe({next:n=>{t.push(n)},error:n=>{r(n)},complete:()=>{try{expect(t).toEqual([{status:c.DeviceActionStatus.Completed,output:e}]),s()}catch(n){r(n)}}})}))})});
1
+ "use strict";var v=require("@ledgerhq/device-management-kit"),c=require("@ledgerhq/device-management-kit"),S=require("@ledgerhq/device-management-kit"),h=require("@ledgerhq/device-management-kit"),y=require("ethers"),A=require("rxjs"),f=require("./command/GetAddressCommand"),E=require("./constant/plugins"),d=require("./EthAppBinder");describe("EthAppBinder",()=>{const r={sendCommand:vi.fn(),executeDeviceAction:vi.fn()},D={getContext:vi.fn(),getContexts:vi.fn(),getTypedDataFilters:vi.fn(),getWeb3Checks:vi.fn()},l={mapTransactionToSubset:vi.fn()},m={extractValue:vi.fn()};beforeEach(()=>{vi.clearAllMocks()}),describe("getAddress",()=>{it("should return the address, publicKey, and chainCode",()=>new Promise((i,a)=>{const e="0xF7C69BedB292Dd3fC2cA4103989B5BD705164c43",s="04e3785ca";vi.spyOn(r,"executeDeviceAction").mockReturnValue({observable:(0,A.from)([{status:c.DeviceActionStatus.Completed,output:{address:e,publicKey:s,chainCode:void 0}}]),cancel:vi.fn()});const p=new d.EthAppBinder(r,D,l,m,"sessionId"),{observable:o}=p.getAddress({derivationPath:"44'/60'/3'/2/1",checkOnDevice:!1,returnChainCode:!1,skipOpenApp:!1}),t=[];o.subscribe({next:n=>{t.push(n)},error:n=>{a(n)},complete:()=>{try{expect(t).toEqual([{status:c.DeviceActionStatus.Completed,output:{address:e,publicKey:s,chainCode:void 0}}]),i()}catch(n){a(n)}}})})),describe("calls of executeDeviceAction with the correct params",()=>{const i={derivationPath:"44'/60'/3'/2/1",checkOnDevice:!1,returnChainCode:!1,skipOpenApp:!1};test("when checkOnDevice is true: UserInteractionRequired.VerifyAddress",()=>{const e={...i,checkOnDevice:!0};new d.EthAppBinder(r,D,l,m,"sessionId").getAddress(e),expect(r.executeDeviceAction).toHaveBeenCalledWith({sessionId:"sessionId",deviceAction:new S.SendCommandInAppDeviceAction({input:{command:new f.GetAddressCommand(e),appName:"Ethereum",requiredUserInteraction:h.UserInteractionRequired.VerifyAddress,compatibleAppNames:E.ETHEREUM_PLUGINS,skipOpenApp:!1}})})}),test("when checkOnDevice is false: UserInteractionRequired.None",()=>{const e={...i,checkOnDevice:!1};new d.EthAppBinder(r,D,l,m,"sessionId").getAddress(e),expect(r.executeDeviceAction).toHaveBeenCalledWith({sessionId:"sessionId",deviceAction:new S.SendCommandInAppDeviceAction({input:{command:new f.GetAddressCommand(e),appName:"Ethereum",requiredUserInteraction:h.UserInteractionRequired.None,compatibleAppNames:E.ETHEREUM_PLUGINS,skipOpenApp:!1}})})})})}),describe("signTransaction",()=>{it("should return the signature",()=>new Promise((i,a)=>{const e={r:"0xDEAD",s:"0xBEEF",v:0},s=(0,v.hexaStringToBuffer)(y.Transaction.from({to:"0x1234567890123456789012345678901234567890",value:0n}).unsignedSerialized),u={};vi.spyOn(r,"executeDeviceAction").mockReturnValue({observable:(0,A.from)([{status:c.DeviceActionStatus.Completed,output:e}]),cancel:vi.fn()});const p=new d.EthAppBinder(r,D,l,m,"sessionId"),{observable:o}=p.signTransaction({derivationPath:"44'/60'/3'/2/1",transaction:s,options:u}),t=[];o.subscribe({next:n=>{t.push(n)},error:n=>{a(n)},complete:()=>{try{expect(t).toEqual([{status:c.DeviceActionStatus.Completed,output:e}]),i()}catch(n){a(n)}}})})),it("should return the signature without options",()=>new Promise((i,a)=>{const e={r:"0xDEAD",s:"0xBEEF",v:0},s=(0,v.hexaStringToBuffer)(y.Transaction.from({to:"0x1234567890123456789012345678901234567890",value:0n}).unsignedSerialized);vi.spyOn(r,"executeDeviceAction").mockReturnValue({observable:(0,A.from)([{status:c.DeviceActionStatus.Completed,output:e}]),cancel:vi.fn()});const u=new d.EthAppBinder(r,D,l,m,"sessionId"),{observable:p}=u.signTransaction({derivationPath:"44'/60'/3'/2/1",transaction:s,options:void 0}),o=[];p.subscribe({next:t=>{o.push(t)},error:t=>{a(t)},complete:()=>{try{expect(o).toEqual([{status:c.DeviceActionStatus.Completed,output:e}]),i()}catch(t){a(t)}}})}))}),describe("signMessage",()=>{it("should return the signature",()=>new Promise((i,a)=>{const e={r:"0xDEAD",s:"0xBEEF",v:0},s="Hello, World!";vi.spyOn(r,"executeDeviceAction").mockReturnValue({observable:(0,A.from)([{status:c.DeviceActionStatus.Completed,output:e}]),cancel:vi.fn()});const u=new d.EthAppBinder(r,D,l,m,"sessionId"),{observable:p}=u.signPersonalMessage({derivationPath:"44'/60'/3'/2/1",message:s,skipOpenApp:!1}),o=[];p.subscribe({next:t=>{o.push(t)},error:t=>{a(t)},complete:()=>{try{expect(o).toEqual([{status:c.DeviceActionStatus.Completed,output:e}]),i()}catch(t){a(t)}}})}))}),describe("signDelegationAuthorization",()=>{it("should return the signature",()=>new Promise((i,a)=>{const e={r:"0xDEAD",s:"0xBEEF",v:0},s=2,u=42,p="0xaddress";vi.spyOn(r,"executeDeviceAction").mockReturnValue({observable:(0,A.from)([{status:c.DeviceActionStatus.Completed,output:e}]),cancel:vi.fn()});const o=new d.EthAppBinder(r,D,l,m,"sessionId"),{observable:t}=o.signDelegationAuthorization({derivationPath:"44'/60'/3'/2/1",chainId:s,address:p,nonce:u}),n=[];t.subscribe({next:g=>{n.push(g)},error:g=>{a(g)},complete:()=>{try{expect(n).toEqual([{status:c.DeviceActionStatus.Completed,output:e}]),i()}catch(g){a(g)}}})}))}),describe("signTypedData",()=>{it("should return the signature",()=>new Promise((i,a)=>{const e={r:"0xDEAD",s:"0xBEEF",v:0},s={domain:{},types:{},primaryType:"test",message:{}},u={parse:vi.fn()};vi.spyOn(r,"executeDeviceAction").mockReturnValue({observable:(0,A.from)([{status:c.DeviceActionStatus.Completed,output:e}]),cancel:vi.fn()});const p=new d.EthAppBinder(r,D,l,m,"sessionId"),{observable:o}=p.signTypedData({derivationPath:"44'/60'/3'/2/1",parser:u,data:s,skipOpenApp:!1}),t=[];o.subscribe({next:n=>{t.push(n)},error:n=>{a(n)},complete:()=>{try{expect(t).toEqual([{status:c.DeviceActionStatus.Completed,output:e}]),i()}catch(n){a(n)}}})}))})});
2
2
  //# sourceMappingURL=EthAppBinder.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/internal/app-binder/EthAppBinder.test.ts"],
4
- "sourcesContent": ["import { type ContextModule } from \"@ledgerhq/context-module\";\nimport {\n type DeviceActionState,\n type DeviceManagementKit,\n hexaStringToBuffer,\n} from \"@ledgerhq/device-management-kit\";\nimport { DeviceActionStatus } from \"@ledgerhq/device-management-kit\";\nimport { SendCommandInAppDeviceAction } from \"@ledgerhq/device-management-kit\";\nimport { UserInteractionRequired } from \"@ledgerhq/device-management-kit\";\nimport { Transaction } from \"ethers\";\nimport { from } from \"rxjs\";\n\nimport {\n type GetAddressDAError,\n type GetAddressDAIntermediateValue,\n type GetAddressDAOutput,\n} from \"@api/app-binder/GetAddressDeviceActionTypes\";\nimport {\n type SignPersonalMessageDAError,\n type SignPersonalMessageDAIntermediateValue,\n type SignPersonalMessageDAOutput,\n} from \"@api/app-binder/SignPersonalMessageDeviceActionTypes\";\nimport {\n type SignTransactionDAError,\n type SignTransactionDAIntermediateValue,\n type SignTransactionDAOutput,\n} from \"@api/app-binder/SignTransactionDeviceActionTypes\";\nimport {\n type SignTypedDataDAError,\n type SignTypedDataDAIntermediateValue,\n type SignTypedDataDAOutput,\n} from \"@api/app-binder/SignTypedDataDeviceActionTypes\";\nimport { type Signature } from \"@api/model/Signature\";\nimport { type TypedData } from \"@api/model/TypedData\";\nimport { type TransactionMapperService } from \"@internal/transaction/service/mapper/TransactionMapperService\";\nimport { type 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 { EthAppBinder } from \"./EthAppBinder\";\n\ndescribe(\"EthAppBinder\", () => {\n const mockedDmk: DeviceManagementKit = {\n sendCommand: vi.fn(),\n executeDeviceAction: vi.fn(),\n } as unknown as DeviceManagementKit;\n const mockedContextModule: ContextModule = {\n getContext: vi.fn(),\n getContexts: vi.fn(),\n getTypedDataFilters: vi.fn(),\n getWeb3Checks: vi.fn(),\n };\n const mockedMapper: TransactionMapperService = {\n mapTransactionToSubset: vi.fn(),\n } as unknown as TransactionMapperService;\n const mockedParser: TransactionParserService = {\n extractValue: vi.fn(),\n } as unknown as TransactionParserService;\n\n beforeEach(() => {\n vi.clearAllMocks();\n });\n\n describe(\"getAddress\", () => {\n it(\"should return the address, publicKey, and chainCode\", () =>\n new Promise<void>((resolve, reject) => {\n // GIVEN\n const address = \"0xF7C69BedB292Dd3fC2cA4103989B5BD705164c43\";\n const publicKey = \"04e3785ca\";\n const chainCode = undefined;\n\n vi.spyOn(mockedDmk, \"executeDeviceAction\").mockReturnValue({\n observable: from([\n {\n status: DeviceActionStatus.Completed,\n output: { address, publicKey, chainCode },\n } as DeviceActionState<\n GetAddressDAOutput,\n GetAddressDAError,\n GetAddressDAIntermediateValue\n >,\n ]),\n cancel: vi.fn(),\n });\n\n // WHEN\n const appBinder = new EthAppBinder(\n mockedDmk,\n mockedContextModule,\n mockedMapper,\n mockedParser,\n \"sessionId\",\n );\n const { observable } = appBinder.getAddress({\n derivationPath: \"44'/60'/3'/2/1\",\n checkOnDevice: false,\n returnChainCode: false,\n skipOpenApp: false,\n });\n\n // THEN\n const states: DeviceActionState<\n GetAddressDAOutput,\n GetAddressDAError,\n GetAddressDAIntermediateValue\n >[] = [];\n observable.subscribe({\n next: (state) => {\n states.push(state);\n },\n error: (err) => {\n reject(err);\n },\n complete: () => {\n try {\n expect(states).toEqual([\n {\n status: DeviceActionStatus.Completed,\n output: { address, publicKey, chainCode },\n },\n ]);\n resolve();\n } catch (err) {\n reject(err as Error);\n }\n },\n });\n }));\n\n describe(\"calls of executeDeviceAction with the correct params\", () => {\n const baseParams = {\n derivationPath: \"44'/60'/3'/2/1\",\n checkOnDevice: false,\n returnChainCode: false,\n skipOpenApp: false,\n };\n\n test(\"when checkOnDevice is true: UserInteractionRequired.VerifyAddress\", () => {\n // GIVEN\n const checkOnDevice = true;\n const params = {\n ...baseParams,\n checkOnDevice,\n };\n\n // WHEN\n const appBinder = new EthAppBinder(\n mockedDmk,\n mockedContextModule,\n mockedMapper,\n mockedParser,\n \"sessionId\",\n );\n appBinder.getAddress(params);\n\n // THEN\n expect(mockedDmk.executeDeviceAction).toHaveBeenCalledWith({\n sessionId: \"sessionId\",\n deviceAction: new SendCommandInAppDeviceAction({\n input: {\n command: new GetAddressCommand(params),\n appName: \"Ethereum\",\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n compatibleAppNames: ETHEREUM_PLUGINS,\n skipOpenApp: false,\n },\n }),\n });\n });\n\n test(\"when checkOnDevice is false: UserInteractionRequired.None\", () => {\n // GIVEN\n const checkOnDevice = false;\n const params = {\n ...baseParams,\n checkOnDevice,\n };\n\n // WHEN\n const appBinder = new EthAppBinder(\n mockedDmk,\n mockedContextModule,\n mockedMapper,\n mockedParser,\n \"sessionId\",\n );\n appBinder.getAddress(params);\n\n // THEN\n expect(mockedDmk.executeDeviceAction).toHaveBeenCalledWith({\n sessionId: \"sessionId\",\n deviceAction: new SendCommandInAppDeviceAction({\n input: {\n command: new GetAddressCommand(params),\n appName: \"Ethereum\",\n requiredUserInteraction: UserInteractionRequired.None,\n compatibleAppNames: ETHEREUM_PLUGINS,\n skipOpenApp: false,\n },\n }),\n });\n });\n });\n });\n\n describe(\"signTransaction\", () => {\n it(\"should return the signature\", () =>\n new Promise<void>((resolve, reject) => {\n // GIVEN\n const signature: Signature = {\n r: `0xDEAD`,\n s: `0xBEEF`,\n v: 0,\n };\n const transaction: Uint8Array = hexaStringToBuffer(\n Transaction.from({\n to: \"0x1234567890123456789012345678901234567890\",\n value: 0n,\n }).unsignedSerialized,\n )!;\n const options = {};\n\n vi.spyOn(mockedDmk, \"executeDeviceAction\").mockReturnValue({\n observable: from([\n {\n status: DeviceActionStatus.Completed,\n output: signature,\n } as DeviceActionState<\n SignTypedDataDAOutput,\n SignTypedDataDAError,\n SignTypedDataDAIntermediateValue\n >,\n ]),\n cancel: vi.fn(),\n });\n\n // WHEN\n const appBinder = new EthAppBinder(\n mockedDmk,\n mockedContextModule,\n mockedMapper,\n mockedParser,\n \"sessionId\",\n );\n const { observable } = appBinder.signTransaction({\n derivationPath: \"44'/60'/3'/2/1\",\n transaction,\n options,\n });\n\n // THEN\n const states: DeviceActionState<\n SignTransactionDAOutput,\n SignTransactionDAError,\n SignTransactionDAIntermediateValue\n >[] = [];\n observable.subscribe({\n next: (state) => {\n states.push(state);\n },\n error: (err) => {\n reject(err);\n },\n complete: () => {\n try {\n expect(states).toEqual([\n {\n status: DeviceActionStatus.Completed,\n output: signature,\n },\n ]);\n resolve();\n } catch (err) {\n reject(err as Error);\n }\n },\n });\n }));\n\n it(\"should return the signature without options\", () =>\n new Promise<void>((resolve, reject) => {\n // GIVEN\n const signature: Signature = {\n r: `0xDEAD`,\n s: `0xBEEF`,\n v: 0,\n };\n const transaction: Uint8Array = hexaStringToBuffer(\n Transaction.from({\n to: \"0x1234567890123456789012345678901234567890\",\n value: 0n,\n }).unsignedSerialized,\n )!;\n\n vi.spyOn(mockedDmk, \"executeDeviceAction\").mockReturnValue({\n observable: from([\n {\n status: DeviceActionStatus.Completed,\n output: signature,\n } as DeviceActionState<\n SignTypedDataDAOutput,\n SignTypedDataDAError,\n SignTypedDataDAIntermediateValue\n >,\n ]),\n cancel: vi.fn(),\n });\n\n // WHEN\n const appBinder = new EthAppBinder(\n mockedDmk,\n mockedContextModule,\n mockedMapper,\n mockedParser,\n \"sessionId\",\n );\n const { observable } = appBinder.signTransaction({\n derivationPath: \"44'/60'/3'/2/1\",\n transaction,\n options: undefined,\n });\n\n // THEN\n const states: DeviceActionState<\n SignTransactionDAOutput,\n SignTransactionDAError,\n SignTransactionDAIntermediateValue\n >[] = [];\n observable.subscribe({\n next: (state) => {\n states.push(state);\n },\n error: (err) => {\n reject(err);\n },\n complete: () => {\n try {\n expect(states).toEqual([\n {\n status: DeviceActionStatus.Completed,\n output: signature,\n },\n ]);\n resolve();\n } catch (err) {\n reject(err as Error);\n }\n },\n });\n }));\n });\n\n describe(\"signMessage\", () => {\n it(\"should return the signature\", () =>\n new Promise<void>((resolve, reject) => {\n // GIVEN\n const signature: Signature = {\n r: `0xDEAD`,\n s: `0xBEEF`,\n v: 0,\n };\n const message = \"Hello, World!\";\n\n vi.spyOn(mockedDmk, \"executeDeviceAction\").mockReturnValue({\n observable: from([\n {\n status: DeviceActionStatus.Completed,\n output: signature,\n } as DeviceActionState<\n SignPersonalMessageDAOutput,\n SignPersonalMessageDAError,\n SignPersonalMessageDAIntermediateValue\n >,\n ]),\n cancel: vi.fn(),\n });\n\n // WHEN\n const appBinder = new EthAppBinder(\n mockedDmk,\n mockedContextModule,\n mockedMapper,\n mockedParser,\n \"sessionId\",\n );\n const { observable } = appBinder.signPersonalMessage({\n derivationPath: \"44'/60'/3'/2/1\",\n message,\n skipOpenApp: false,\n });\n\n // THEN\n const states: DeviceActionState<\n SignPersonalMessageDAOutput,\n SignPersonalMessageDAError,\n SignPersonalMessageDAIntermediateValue\n >[] = [];\n observable.subscribe({\n next: (state) => {\n states.push(state);\n },\n error: (err) => {\n reject(err);\n },\n complete: () => {\n try {\n expect(states).toEqual([\n {\n status: DeviceActionStatus.Completed,\n output: signature,\n },\n ]);\n resolve();\n } catch (err) {\n reject(err as Error);\n }\n },\n });\n }));\n });\n\n describe(\"signTypedData\", () => {\n it(\"should return the signature\", () =>\n new Promise<void>((resolve, reject) => {\n // GIVEN\n const signature: Signature = {\n r: `0xDEAD`,\n s: `0xBEEF`,\n v: 0,\n };\n const typedData: TypedData = {\n domain: {},\n types: {},\n primaryType: \"test\",\n message: {},\n };\n const parser: TypedDataParserService = {\n parse: vi.fn(),\n };\n\n vi.spyOn(mockedDmk, \"executeDeviceAction\").mockReturnValue({\n observable: from([\n {\n status: DeviceActionStatus.Completed,\n output: signature,\n } as DeviceActionState<\n SignTypedDataDAOutput,\n SignTypedDataDAError,\n SignTypedDataDAIntermediateValue\n >,\n ]),\n cancel: vi.fn(),\n });\n\n // WHEN\n const appBinder = new EthAppBinder(\n mockedDmk,\n mockedContextModule,\n mockedMapper,\n mockedParser,\n \"sessionId\",\n );\n const { observable } = appBinder.signTypedData({\n derivationPath: \"44'/60'/3'/2/1\",\n parser,\n data: typedData,\n skipOpenApp: false,\n });\n\n // THEN\n const states: DeviceActionState<\n SignTypedDataDAOutput,\n SignTypedDataDAError,\n SignTypedDataDAIntermediateValue\n >[] = [];\n observable.subscribe({\n next: (state) => {\n states.push(state);\n },\n error: (err) => {\n reject(err);\n },\n complete: () => {\n try {\n expect(states).toEqual([\n {\n status: DeviceActionStatus.Completed,\n output: signature,\n },\n ]);\n resolve();\n } catch (err) {\n reject(err as Error);\n }\n },\n });\n }));\n });\n});\n"],
5
- "mappings": "aACA,IAAAA,EAIO,2CACPA,EAAmC,2CACnCA,EAA6C,2CAC7CA,EAAwC,2CACxCC,EAA4B,kBAC5BC,EAAqB,gBA4BrBC,EAAkC,uCAClCC,EAAiC,8BACjCC,EAA6B,0BAE7B,SAAS,eAAgB,IAAM,CA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gBAAgB,CACzD,cAAY,QAAK,CACf,CACE,OAAQ,qBAAmB,UAC3B,OAAQe,CACV,CAKF,CAAC,EACD,OAAQ,GAAG,GAAG,CAChB,CAAC,EAGD,MAAMP,EAAY,IAAI,eACpBR,EACAC,EACAC,EACAC,EACA,WACF,EACM,CAAE,WAAAM,CAAW,EAAID,EAAU,cAAc,CAC7C,eAAgB,iBAChB,OAAAY,EACA,KAAMD,EACN,YAAa,EACf,CAAC,EAGKT,EAIA,CAAC,EACPD,EAAW,UAAU,CACnB,KAAOE,GAAU,CACfD,EAAO,KAAKC,CAAK,CACnB,EACA,MAAQC,GAAQ,CACdP,EAAOO,CAAG,CACZ,EACA,SAAU,IAAM,CACd,GAAI,CACF,OAAOF,CAAM,EAAE,QAAQ,CACrB,CACE,OAAQ,qBAAmB,UAC3B,OAAQK,CACV,CACF,CAAC,EACDX,EAAQ,CACV,OAASQ,EAAK,CACZP,EAAOO,CAAY,CACrB,CACF,CACF,CAAC,CACH,CAAC,CAAC,CACN,CAAC,CACH,CAAC",
6
- "names": ["import_device_management_kit", "import_ethers", "import_rxjs", "import_GetAddressCommand", "import_plugins", "import_EthAppBinder", "mockedDmk", "mockedContextModule", "mockedMapper", "mockedParser", "resolve", "reject", "address", "publicKey", "appBinder", "observable", "states", "state", "err", "baseParams", "params", "signature", "transaction", "options", "message", "typedData", "parser"]
4
+ "sourcesContent": ["import { type ContextModule } from \"@ledgerhq/context-module\";\nimport {\n type DeviceActionState,\n type DeviceManagementKit,\n hexaStringToBuffer,\n} from \"@ledgerhq/device-management-kit\";\nimport { DeviceActionStatus } from \"@ledgerhq/device-management-kit\";\nimport { SendCommandInAppDeviceAction } from \"@ledgerhq/device-management-kit\";\nimport { UserInteractionRequired } from \"@ledgerhq/device-management-kit\";\nimport { Transaction } from \"ethers\";\nimport { from } from \"rxjs\";\n\nimport {\n type GetAddressDAError,\n type GetAddressDAIntermediateValue,\n type GetAddressDAOutput,\n} from \"@api/app-binder/GetAddressDeviceActionTypes\";\nimport {\n type SignDelegationAuthorizationDAError,\n type SignDelegationAuthorizationDAIntermediateValue,\n type SignDelegationAuthorizationDAOutput,\n} from \"@api/app-binder/SignDelegationAuthorizationTypes\";\nimport {\n type SignPersonalMessageDAError,\n type SignPersonalMessageDAIntermediateValue,\n type SignPersonalMessageDAOutput,\n} from \"@api/app-binder/SignPersonalMessageDeviceActionTypes\";\nimport {\n type SignTransactionDAError,\n type SignTransactionDAIntermediateValue,\n type SignTransactionDAOutput,\n} from \"@api/app-binder/SignTransactionDeviceActionTypes\";\nimport {\n type SignTypedDataDAError,\n type SignTypedDataDAIntermediateValue,\n type SignTypedDataDAOutput,\n} from \"@api/app-binder/SignTypedDataDeviceActionTypes\";\nimport { type Signature } from \"@api/model/Signature\";\nimport { type TypedData } from \"@api/model/TypedData\";\nimport { type TransactionMapperService } from \"@internal/transaction/service/mapper/TransactionMapperService\";\nimport { type 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 { EthAppBinder } from \"./EthAppBinder\";\n\ndescribe(\"EthAppBinder\", () => {\n const mockedDmk: DeviceManagementKit = {\n sendCommand: vi.fn(),\n executeDeviceAction: vi.fn(),\n } as unknown as DeviceManagementKit;\n const mockedContextModule: ContextModule = {\n getContext: vi.fn(),\n getContexts: vi.fn(),\n getTypedDataFilters: vi.fn(),\n getWeb3Checks: vi.fn(),\n };\n const mockedMapper: TransactionMapperService = {\n mapTransactionToSubset: vi.fn(),\n } as unknown as TransactionMapperService;\n const mockedParser: TransactionParserService = {\n extractValue: vi.fn(),\n } as unknown as TransactionParserService;\n\n beforeEach(() => {\n vi.clearAllMocks();\n });\n\n describe(\"getAddress\", () => {\n it(\"should return the address, publicKey, and chainCode\", () =>\n new Promise<void>((resolve, reject) => {\n // GIVEN\n const address = \"0xF7C69BedB292Dd3fC2cA4103989B5BD705164c43\";\n const publicKey = \"04e3785ca\";\n const chainCode = undefined;\n\n vi.spyOn(mockedDmk, \"executeDeviceAction\").mockReturnValue({\n observable: from([\n {\n status: DeviceActionStatus.Completed,\n output: { address, publicKey, chainCode },\n } as DeviceActionState<\n GetAddressDAOutput,\n GetAddressDAError,\n GetAddressDAIntermediateValue\n >,\n ]),\n cancel: vi.fn(),\n });\n\n // WHEN\n const appBinder = new EthAppBinder(\n mockedDmk,\n mockedContextModule,\n mockedMapper,\n mockedParser,\n \"sessionId\",\n );\n const { observable } = appBinder.getAddress({\n derivationPath: \"44'/60'/3'/2/1\",\n checkOnDevice: false,\n returnChainCode: false,\n skipOpenApp: false,\n });\n\n // THEN\n const states: DeviceActionState<\n GetAddressDAOutput,\n GetAddressDAError,\n GetAddressDAIntermediateValue\n >[] = [];\n observable.subscribe({\n next: (state) => {\n states.push(state);\n },\n error: (err) => {\n reject(err);\n },\n complete: () => {\n try {\n expect(states).toEqual([\n {\n status: DeviceActionStatus.Completed,\n output: { address, publicKey, chainCode },\n },\n ]);\n resolve();\n } catch (err) {\n reject(err as Error);\n }\n },\n });\n }));\n\n describe(\"calls of executeDeviceAction with the correct params\", () => {\n const baseParams = {\n derivationPath: \"44'/60'/3'/2/1\",\n checkOnDevice: false,\n returnChainCode: false,\n skipOpenApp: false,\n };\n\n test(\"when checkOnDevice is true: UserInteractionRequired.VerifyAddress\", () => {\n // GIVEN\n const checkOnDevice = true;\n const params = {\n ...baseParams,\n checkOnDevice,\n };\n\n // WHEN\n const appBinder = new EthAppBinder(\n mockedDmk,\n mockedContextModule,\n mockedMapper,\n mockedParser,\n \"sessionId\",\n );\n appBinder.getAddress(params);\n\n // THEN\n expect(mockedDmk.executeDeviceAction).toHaveBeenCalledWith({\n sessionId: \"sessionId\",\n deviceAction: new SendCommandInAppDeviceAction({\n input: {\n command: new GetAddressCommand(params),\n appName: \"Ethereum\",\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n compatibleAppNames: ETHEREUM_PLUGINS,\n skipOpenApp: false,\n },\n }),\n });\n });\n\n test(\"when checkOnDevice is false: UserInteractionRequired.None\", () => {\n // GIVEN\n const checkOnDevice = false;\n const params = {\n ...baseParams,\n checkOnDevice,\n };\n\n // WHEN\n const appBinder = new EthAppBinder(\n mockedDmk,\n mockedContextModule,\n mockedMapper,\n mockedParser,\n \"sessionId\",\n );\n appBinder.getAddress(params);\n\n // THEN\n expect(mockedDmk.executeDeviceAction).toHaveBeenCalledWith({\n sessionId: \"sessionId\",\n deviceAction: new SendCommandInAppDeviceAction({\n input: {\n command: new GetAddressCommand(params),\n appName: \"Ethereum\",\n requiredUserInteraction: UserInteractionRequired.None,\n compatibleAppNames: ETHEREUM_PLUGINS,\n skipOpenApp: false,\n },\n }),\n });\n });\n });\n });\n\n describe(\"signTransaction\", () => {\n it(\"should return the signature\", () =>\n new Promise<void>((resolve, reject) => {\n // GIVEN\n const signature: Signature = {\n r: `0xDEAD`,\n s: `0xBEEF`,\n v: 0,\n };\n const transaction: Uint8Array = hexaStringToBuffer(\n Transaction.from({\n to: \"0x1234567890123456789012345678901234567890\",\n value: 0n,\n }).unsignedSerialized,\n )!;\n const options = {};\n\n vi.spyOn(mockedDmk, \"executeDeviceAction\").mockReturnValue({\n observable: from([\n {\n status: DeviceActionStatus.Completed,\n output: signature,\n } as DeviceActionState<\n SignTypedDataDAOutput,\n SignTypedDataDAError,\n SignTypedDataDAIntermediateValue\n >,\n ]),\n cancel: vi.fn(),\n });\n\n // WHEN\n const appBinder = new EthAppBinder(\n mockedDmk,\n mockedContextModule,\n mockedMapper,\n mockedParser,\n \"sessionId\",\n );\n const { observable } = appBinder.signTransaction({\n derivationPath: \"44'/60'/3'/2/1\",\n transaction,\n options,\n });\n\n // THEN\n const states: DeviceActionState<\n SignTransactionDAOutput,\n SignTransactionDAError,\n SignTransactionDAIntermediateValue\n >[] = [];\n observable.subscribe({\n next: (state) => {\n states.push(state);\n },\n error: (err) => {\n reject(err);\n },\n complete: () => {\n try {\n expect(states).toEqual([\n {\n status: DeviceActionStatus.Completed,\n output: signature,\n },\n ]);\n resolve();\n } catch (err) {\n reject(err as Error);\n }\n },\n });\n }));\n\n it(\"should return the signature without options\", () =>\n new Promise<void>((resolve, reject) => {\n // GIVEN\n const signature: Signature = {\n r: `0xDEAD`,\n s: `0xBEEF`,\n v: 0,\n };\n const transaction: Uint8Array = hexaStringToBuffer(\n Transaction.from({\n to: \"0x1234567890123456789012345678901234567890\",\n value: 0n,\n }).unsignedSerialized,\n )!;\n\n vi.spyOn(mockedDmk, \"executeDeviceAction\").mockReturnValue({\n observable: from([\n {\n status: DeviceActionStatus.Completed,\n output: signature,\n } as DeviceActionState<\n SignTypedDataDAOutput,\n SignTypedDataDAError,\n SignTypedDataDAIntermediateValue\n >,\n ]),\n cancel: vi.fn(),\n });\n\n // WHEN\n const appBinder = new EthAppBinder(\n mockedDmk,\n mockedContextModule,\n mockedMapper,\n mockedParser,\n \"sessionId\",\n );\n const { observable } = appBinder.signTransaction({\n derivationPath: \"44'/60'/3'/2/1\",\n transaction,\n options: undefined,\n });\n\n // THEN\n const states: DeviceActionState<\n SignTransactionDAOutput,\n SignTransactionDAError,\n SignTransactionDAIntermediateValue\n >[] = [];\n observable.subscribe({\n next: (state) => {\n states.push(state);\n },\n error: (err) => {\n reject(err);\n },\n complete: () => {\n try {\n expect(states).toEqual([\n {\n status: DeviceActionStatus.Completed,\n output: signature,\n },\n ]);\n resolve();\n } catch (err) {\n reject(err as Error);\n }\n },\n });\n }));\n });\n\n describe(\"signMessage\", () => {\n it(\"should return the signature\", () =>\n new Promise<void>((resolve, reject) => {\n // GIVEN\n const signature: Signature = {\n r: `0xDEAD`,\n s: `0xBEEF`,\n v: 0,\n };\n const message = \"Hello, World!\";\n\n vi.spyOn(mockedDmk, \"executeDeviceAction\").mockReturnValue({\n observable: from([\n {\n status: DeviceActionStatus.Completed,\n output: signature,\n } as DeviceActionState<\n SignPersonalMessageDAOutput,\n SignPersonalMessageDAError,\n SignPersonalMessageDAIntermediateValue\n >,\n ]),\n cancel: vi.fn(),\n });\n\n // WHEN\n const appBinder = new EthAppBinder(\n mockedDmk,\n mockedContextModule,\n mockedMapper,\n mockedParser,\n \"sessionId\",\n );\n const { observable } = appBinder.signPersonalMessage({\n derivationPath: \"44'/60'/3'/2/1\",\n message,\n skipOpenApp: false,\n });\n\n // THEN\n const states: DeviceActionState<\n SignPersonalMessageDAOutput,\n SignPersonalMessageDAError,\n SignPersonalMessageDAIntermediateValue\n >[] = [];\n observable.subscribe({\n next: (state) => {\n states.push(state);\n },\n error: (err) => {\n reject(err);\n },\n complete: () => {\n try {\n expect(states).toEqual([\n {\n status: DeviceActionStatus.Completed,\n output: signature,\n },\n ]);\n resolve();\n } catch (err) {\n reject(err as Error);\n }\n },\n });\n }));\n });\n\n describe(\"signDelegationAuthorization\", () => {\n it(\"should return the signature\", () =>\n new Promise<void>((resolve, reject) => {\n // GIVEN\n const signature: Signature = {\n r: `0xDEAD`,\n s: `0xBEEF`,\n v: 0,\n };\n const chainId = 2;\n const nonce = 42;\n const address = \"0xaddress\";\n\n vi.spyOn(mockedDmk, \"executeDeviceAction\").mockReturnValue({\n observable: from([\n {\n status: DeviceActionStatus.Completed,\n output: signature,\n } as DeviceActionState<\n SignDelegationAuthorizationDAOutput,\n SignDelegationAuthorizationDAError,\n SignDelegationAuthorizationDAIntermediateValue\n >,\n ]),\n cancel: vi.fn(),\n });\n\n // WHEN\n const appBinder = new EthAppBinder(\n mockedDmk,\n mockedContextModule,\n mockedMapper,\n mockedParser,\n \"sessionId\",\n );\n const { observable } = appBinder.signDelegationAuthorization({\n derivationPath: \"44'/60'/3'/2/1\",\n chainId,\n address,\n nonce,\n });\n\n // THEN\n const states: DeviceActionState<\n SignDelegationAuthorizationDAOutput,\n SignDelegationAuthorizationDAError,\n SignDelegationAuthorizationDAIntermediateValue\n >[] = [];\n observable.subscribe({\n next: (state) => {\n states.push(state);\n },\n error: (err) => {\n reject(err);\n },\n complete: () => {\n try {\n expect(states).toEqual([\n {\n status: DeviceActionStatus.Completed,\n output: signature,\n },\n ]);\n resolve();\n } catch (err) {\n reject(err as Error);\n }\n },\n });\n }));\n });\n\n describe(\"signTypedData\", () => {\n it(\"should return the signature\", () =>\n new Promise<void>((resolve, reject) => {\n // GIVEN\n const signature: Signature = {\n r: `0xDEAD`,\n s: `0xBEEF`,\n v: 0,\n };\n const typedData: TypedData = {\n domain: {},\n types: {},\n primaryType: \"test\",\n message: {},\n };\n const parser: TypedDataParserService = {\n parse: vi.fn(),\n };\n\n vi.spyOn(mockedDmk, \"executeDeviceAction\").mockReturnValue({\n observable: from([\n {\n status: DeviceActionStatus.Completed,\n output: signature,\n } as DeviceActionState<\n SignTypedDataDAOutput,\n SignTypedDataDAError,\n SignTypedDataDAIntermediateValue\n >,\n ]),\n cancel: vi.fn(),\n });\n\n // WHEN\n const appBinder = new EthAppBinder(\n mockedDmk,\n mockedContextModule,\n mockedMapper,\n mockedParser,\n \"sessionId\",\n );\n const { observable } = appBinder.signTypedData({\n derivationPath: \"44'/60'/3'/2/1\",\n parser,\n data: typedData,\n skipOpenApp: false,\n });\n\n // THEN\n const states: DeviceActionState<\n SignTypedDataDAOutput,\n SignTypedDataDAError,\n SignTypedDataDAIntermediateValue\n >[] = [];\n observable.subscribe({\n next: (state) => {\n states.push(state);\n },\n error: (err) => {\n reject(err);\n },\n complete: () => {\n try {\n expect(states).toEqual([\n {\n status: DeviceActionStatus.Completed,\n output: signature,\n },\n ]);\n resolve();\n } catch (err) {\n reject(err as Error);\n }\n },\n });\n }));\n });\n});\n"],
5
+ "mappings": "aACA,IAAAA,EAIO,2CACPA,EAAmC,2CACnCA,EAA6C,2CAC7CA,EAAwC,2CACxCC,EAA4B,kBAC5BC,EAAqB,gBAiCrBC,EAAkC,uCAClCC,EAAiC,8BACjCC,EAA6B,0BAE7B,SAAS,eAAgB,IAAM,CAC7B,MAAMC,EAAiC,CACrC,YAAa,GAAG,GAAG,E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,SAAU,IAAM,CACd,GAAI,CACF,OAAOF,CAAM,EAAE,QAAQ,CACrB,CACE,OAAQ,qBAAmB,UAC3B,OAAQK,CACV,CACF,CAAC,EACDX,EAAQ,CACV,OAASQ,EAAK,CACZP,EAAOO,CAAY,CACrB,CACF,CACF,CAAC,CACH,CAAC,CAAC,CACN,CAAC,CACH,CAAC",
6
+ "names": ["import_device_management_kit", "import_ethers", "import_rxjs", "import_GetAddressCommand", "import_plugins", "import_EthAppBinder", "mockedDmk", "mockedContextModule", "mockedMapper", "mockedParser", "resolve", "reject", "address", "publicKey", "appBinder", "observable", "states", "state", "err", "baseParams", "params", "signature", "transaction", "options", "message", "chainId", "nonce", "typedData", "parser"]
7
7
  }
@@ -0,0 +1,2 @@
1
+ "use strict";var d=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var E=(e,r)=>{for(var t in r)d(e,t,{get:r[t],enumerable:!0})},l=(e,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of g(r))!A.call(e,n)&&n!==t&&d(e,n,{get:()=>r[n],enumerable:!(i=p(r,n))||i.enumerable});return e};var h=e=>l(d({},"__esModule",{value:!0}),e);var S={};E(S,{SignEIP7702AuthorizationCommand:()=>c});module.exports=h(S);var o=require("@ledgerhq/device-management-kit"),u=require("@ledgerhq/signer-utils"),a=require("purify-ts"),s=require("./utils/ethAppErrors");const C=32,y=32;class c{args;errorHelper=new u.CommandErrorHelper(s.ETH_APP_ERRORS,s.EthAppCommandErrorFactory);constructor(r){this.args=r}getApdu(){const{data:r,isFirstChunk:t}=this.args,i={cla:224,ins:52,p1:t?1:0,p2:0};return new o.ApduBuilder(i).addBufferToData(r).build()}parseResponse(r){return a.Maybe.fromNullable(this.errorHelper.getError(r)).orDefaultLazy(()=>{const t=new o.ApduParser(r),i=t.extract8BitUInt();if(i===void 0)return(0,o.CommandResultFactory)({data:a.Nothing});const n=t.encodeToHexaString(t.extractFieldByLength(C),!0);if(!n)return(0,o.CommandResultFactory)({error:new o.InvalidStatusWordError("R is missing")});const m=t.encodeToHexaString(t.extractFieldByLength(y),!0);return m?(0,o.CommandResultFactory)({data:(0,a.Just)({r:n,s:m,v:i})}):(0,o.CommandResultFactory)({error:new o.InvalidStatusWordError("S is missing")})})}}0&&(module.exports={SignEIP7702AuthorizationCommand});
2
+ //# sourceMappingURL=SignAuthorizationDelegationCommand.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/internal/app-binder/command/SignAuthorizationDelegationCommand.ts"],
4
+ "sourcesContent": ["// https://github.com/LedgerHQ/app-ethereum/blob/develop/doc/ethapp.adoc#sign-eth-personal-message\nimport {\n type Apdu,\n ApduBuilder,\n type ApduBuilderArgs,\n ApduParser,\n type ApduResponse,\n type Command,\n type CommandResult,\n CommandResultFactory,\n InvalidStatusWordError,\n} from \"@ledgerhq/device-management-kit\";\nimport { CommandErrorHelper } from \"@ledgerhq/signer-utils\";\nimport { Just, Maybe, Nothing } from \"purify-ts\";\n\nimport { type Signature } from \"@api/model/Signature\";\n\nimport {\n ETH_APP_ERRORS,\n EthAppCommandErrorFactory,\n type EthErrorCodes,\n} from \"./utils/ethAppErrors\";\n\nconst R_LENGTH = 32;\nconst S_LENGTH = 32;\n\nexport type SignEIP7702AuthorizationCommandArgs = {\n /**\n * The data to sign in max 255 bytes chunks\n * Data is a concatenation of the following:\n * - Derivation path length (1 byte)\n * - Derivation path (4 bytes per element)\n * - Nonce (4 bytes)\n * - Chain ID (4 bytes)\n * - Address (20 bytes)\n */\n readonly data: Uint8Array;\n /**\n * If this is the first chunk of the message\n */\n readonly isFirstChunk: boolean;\n};\n\nexport type SignEIP7702AuthorizationCommandResponse = Maybe<Signature>;\n\nexport class SignEIP7702AuthorizationCommand\n implements\n Command<\n SignEIP7702AuthorizationCommandResponse,\n SignEIP7702AuthorizationCommandArgs,\n EthErrorCodes\n >\n{\n readonly args: SignEIP7702AuthorizationCommandArgs;\n private readonly errorHelper = new CommandErrorHelper<\n SignEIP7702AuthorizationCommandResponse,\n EthErrorCodes\n >(ETH_APP_ERRORS, EthAppCommandErrorFactory);\n\n constructor(args: SignEIP7702AuthorizationCommandArgs) {\n this.args = args;\n }\n\n getApdu(): Apdu {\n const { data, isFirstChunk } = this.args;\n const signEIP7702AuthorizationArgs: ApduBuilderArgs = {\n cla: 0xe0,\n ins: 0x34,\n p1: isFirstChunk ? 0x01 : 0x00,\n p2: 0x00,\n };\n\n return new ApduBuilder(signEIP7702AuthorizationArgs)\n .addBufferToData(data)\n .build();\n }\n\n parseResponse(\n apduResponse: ApduResponse,\n ): CommandResult<SignEIP7702AuthorizationCommandResponse, EthErrorCodes> {\n return Maybe.fromNullable(\n this.errorHelper.getError(apduResponse),\n ).orDefaultLazy(() => {\n const parser = new ApduParser(apduResponse);\n\n // The data is returned only for the last chunk\n const v = parser.extract8BitUInt();\n if (v === undefined) {\n return CommandResultFactory({ data: Nothing });\n }\n\n const r = parser.encodeToHexaString(\n parser.extractFieldByLength(R_LENGTH),\n true,\n );\n if (!r) {\n return CommandResultFactory({\n error: new InvalidStatusWordError(\"R is missing\"),\n });\n }\n\n const s = parser.encodeToHexaString(\n parser.extractFieldByLength(S_LENGTH),\n true,\n );\n if (!s) {\n return CommandResultFactory({\n error: new InvalidStatusWordError(\"S is missing\"),\n });\n }\n\n return CommandResultFactory({\n data: Just({\n r,\n s,\n v,\n }),\n });\n });\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qCAAAE,IAAA,eAAAC,EAAAH,GACA,IAAAI,EAUO,2CACPC,EAAmC,kCACnCC,EAAqC,qBAIrCC,EAIO,gCAEP,MAAMC,EAAW,GACXC,EAAW,GAqBV,MAAMP,CAOb,CACW,KACQ,YAAc,IAAI,qBAGjC,iBAAgB,2BAAyB,EAE3C,YAAYQ,EAA2C,CACrD,KAAK,KAAOA,CACd,CAEA,SAAgB,CACd,KAAM,CAAE,KAAAC,EAAM,aAAAC,CAAa,EAAI,KAAK,KAC9BC,EAAgD,CACpD,IAAK,IACL,IAAK,GACL,GAAID,EAAe,EAAO,EAC1B,GAAI,CACN,EAEA,OAAO,IAAI,cAAYC,CAA4B,EAChD,gBAAgBF,CAAI,EACpB,MAAM,CACX,CAEA,cACEG,EACuE,CACvE,OAAO,QAAM,aACX,KAAK,YAAY,SAASA,CAAY,CACxC,EAAE,cAAc,IAAM,CACpB,MAAMC,EAAS,IAAI,aAAWD,CAAY,EAGpCE,EAAID,EAAO,gBAAgB,EACjC,GAAIC,IAAM,OACR,SAAO,wBAAqB,CAAE,KAAM,SAAQ,CAAC,EAG/C,MAAMC,EAAIF,EAAO,mBACfA,EAAO,qBAAqBP,CAAQ,EACpC,EACF,EACA,GAAI,CAACS,EACH,SAAO,wBAAqB,CAC1B,MAAO,IAAI,yBAAuB,cAAc,CAClD,CAAC,EAGH,MAAMC,EAAIH,EAAO,mBACfA,EAAO,qBAAqBN,CAAQ,EACpC,EACF,EACA,OAAKS,KAME,wBAAqB,CAC1B,QAAM,QAAK,CACT,EAAAD,EACA,EAAAC,EACA,EAAAF,CACF,CAAC,CACH,CAAC,KAXQ,wBAAqB,CAC1B,MAAO,IAAI,yBAAuB,cAAc,CAClD,CAAC,CAUL,CAAC,CACH,CACF",
6
+ "names": ["SignAuthorizationDelegationCommand_exports", "__export", "SignEIP7702AuthorizationCommand", "__toCommonJS", "import_device_management_kit", "import_signer_utils", "import_purify_ts", "import_ethAppErrors", "R_LENGTH", "S_LENGTH", "args", "data", "isFirstChunk", "signEIP7702AuthorizationArgs", "apduResponse", "parser", "v", "r", "s"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var s=require("@ledgerhq/device-management-kit"),n=require("purify-ts"),r=require("./SignAuthorizationDelegationCommand");const a=Uint8Array.from([224,52,1,0,8,0,6,76,101,100,103,101,114]),c=Uint8Array.from([224,52,0,0,8,0,6,76,101,100,103,101,114]),x=new Uint8Array([27,151,164,202,143,105,70,51,89,38,1,245,162,62,11,204,85,60,157,10,144,211,163,66,45,87,85,8,169,40,152,185,110,105,80,208,46,116,233,193,2,193,100,162,37,83,48,130,202,189,216,144,239,196,99,246,127,96,206,254,140,63,135,207,206]);describe("SignEIP7702AuthorizationCommand",()=>{describe("getApdu",()=>{it("should return the first chunk raw APDU",()=>{const e={data:a.slice(5),isFirstChunk:!0},t=new r.SignEIP7702AuthorizationCommand(e).getApdu();expect(t.getRawApdu()).toStrictEqual(a)}),it("should return the next chunk raw APDU",()=>{const e={data:a.slice(5),isFirstChunk:!1},t=new r.SignEIP7702AuthorizationCommand(e).getApdu();expect(t.getRawApdu()).toStrictEqual(c)})}),describe("parseResponse",()=>{it("should return an error if the response status code is invalid",()=>{const e={data:Buffer.from([]),statusCode:Buffer.from([106,128])},t=new r.SignEIP7702AuthorizationCommand({data:Uint8Array.from([]),isFirstChunk:!0}).parseResponse(e);expect((0,s.isSuccessCommandResult)(t)).toBe(!1)}),it("should return success without result for first chunk",()=>{const e={statusCode:Buffer.from([144,0]),data:Buffer.from([])},t=new r.SignEIP7702AuthorizationCommand({data:Uint8Array.from([]),isFirstChunk:!0}).parseResponse(e);expect(t).toStrictEqual((0,s.CommandResultFactory)({data:n.Nothing}))}),it("should return success if the response signature is valid",()=>{const e={statusCode:Buffer.from([144,0]),data:x},t=new r.SignEIP7702AuthorizationCommand({data:Uint8Array.from([]),isFirstChunk:!0}).parseResponse(e);expect(t).toStrictEqual((0,s.CommandResultFactory)({data:(0,n.Just)({r:"0x97a4ca8f694633592601f5a23e0bcc553c9d0a90d3a3422d575508a92898b96e",s:"0x6950d02e74e9c102c164a225533082cabdd890efc463f67f60cefe8c3f87cfce",v:27})}))}),it("should return an error if r is missing",()=>{const e={statusCode:Buffer.from([144,0]),data:x.slice(0,32)},t=new r.SignEIP7702AuthorizationCommand({data:Uint8Array.from([]),isFirstChunk:!0}).parseResponse(e);expect(t).toStrictEqual((0,s.CommandResultFactory)({error:new s.InvalidStatusWordError("R is missing")}))}),it("should return an error if s is missing",()=>{const e={statusCode:Buffer.from([144,0]),data:x.slice(0,64)},t=new r.SignEIP7702AuthorizationCommand({data:Uint8Array.from([]),isFirstChunk:!0}).parseResponse(e);expect(t).toStrictEqual((0,s.CommandResultFactory)({error:new s.InvalidStatusWordError("S is missing")}))})})});
2
+ //# sourceMappingURL=SignAuthorizationDelegationCommand.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/internal/app-binder/command/SignAuthorizationDelegationCommand.test.ts"],
4
+ "sourcesContent": ["import {\n type ApduResponse,\n CommandResultFactory,\n InvalidStatusWordError,\n isSuccessCommandResult,\n} from \"@ledgerhq/device-management-kit\";\nimport { Just, Nothing } from \"purify-ts\";\n\nimport {\n SignEIP7702AuthorizationCommand,\n type SignEIP7702AuthorizationCommandArgs,\n} from \"./SignAuthorizationDelegationCommand\";\n\nconst FIRST_CHUNK_APDU = Uint8Array.from([\n 0xe0, 0x34, 0x01, 0x00, 0x08, 0x00, 0x06, 0x4c, 0x65, 0x64, 0x67, 0x65, 0x72,\n]);\n\nconst NEXT_CHUNK_APDU = Uint8Array.from([\n 0xe0, 0x34, 0x00, 0x00, 0x08, 0x00, 0x06, 0x4c, 0x65, 0x64, 0x67, 0x65, 0x72,\n]);\n\nconst SUCCESS_RESPONSE = new Uint8Array([\n 0x1b, 0x97, 0xa4, 0xca, 0x8f, 0x69, 0x46, 0x33, 0x59, 0x26, 0x01, 0xf5, 0xa2,\n 0x3e, 0x0b, 0xcc, 0x55, 0x3c, 0x9d, 0x0a, 0x90, 0xd3, 0xa3, 0x42, 0x2d, 0x57,\n 0x55, 0x08, 0xa9, 0x28, 0x98, 0xb9, 0x6e, 0x69, 0x50, 0xd0, 0x2e, 0x74, 0xe9,\n 0xc1, 0x02, 0xc1, 0x64, 0xa2, 0x25, 0x53, 0x30, 0x82, 0xca, 0xbd, 0xd8, 0x90,\n 0xef, 0xc4, 0x63, 0xf6, 0x7f, 0x60, 0xce, 0xfe, 0x8c, 0x3f, 0x87, 0xcf, 0xce,\n]);\n\ndescribe(\"SignEIP7702AuthorizationCommand\", () => {\n describe(\"getApdu\", () => {\n it(\"should return the first chunk raw APDU\", () => {\n // GIVEN\n const args: SignEIP7702AuthorizationCommandArgs = {\n data: FIRST_CHUNK_APDU.slice(5),\n isFirstChunk: true,\n };\n // WHEN\n const command = new SignEIP7702AuthorizationCommand(args);\n const apdu = command.getApdu();\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(FIRST_CHUNK_APDU);\n });\n\n it(\"should return the next chunk raw APDU\", () => {\n // GIVEN\n const args: SignEIP7702AuthorizationCommandArgs = {\n data: FIRST_CHUNK_APDU.slice(5),\n isFirstChunk: false,\n };\n // WHEN\n const command = new SignEIP7702AuthorizationCommand(args);\n const apdu = command.getApdu();\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(NEXT_CHUNK_APDU);\n });\n });\n\n describe(\"parseResponse\", () => {\n it(\"should return an error if the response status code is invalid\", () => {\n // GIVEN\n const response: ApduResponse = {\n data: Buffer.from([]),\n statusCode: Buffer.from([0x6a, 0x80]), // Invalid status code\n };\n // WHEN\n const command = new SignEIP7702AuthorizationCommand({\n data: Uint8Array.from([]),\n isFirstChunk: true,\n });\n const result = command.parseResponse(response);\n // THEN\n expect(isSuccessCommandResult(result)).toBe(false);\n });\n\n it(\"should return success without result for first chunk\", () => {\n // GIVEN\n const response: ApduResponse = {\n statusCode: Buffer.from([0x90, 0x00]), // Success status code\n data: Buffer.from([]),\n };\n // WHEN\n const command = new SignEIP7702AuthorizationCommand({\n data: Uint8Array.from([]),\n isFirstChunk: true,\n });\n const result = command.parseResponse(response);\n // THEN\n expect(result).toStrictEqual(\n CommandResultFactory({\n data: Nothing,\n }),\n );\n });\n\n it(\"should return success if the response signature is valid\", () => {\n // GIVEN\n const response: ApduResponse = {\n statusCode: Buffer.from([0x90, 0x00]), // Success status code\n data: SUCCESS_RESPONSE,\n };\n // WHEN\n const command = new SignEIP7702AuthorizationCommand({\n data: Uint8Array.from([]),\n isFirstChunk: true,\n });\n const result = command.parseResponse(response);\n // THEN\n expect(result).toStrictEqual(\n CommandResultFactory({\n data: Just({\n r: \"0x97a4ca8f694633592601f5a23e0bcc553c9d0a90d3a3422d575508a92898b96e\",\n s: \"0x6950d02e74e9c102c164a225533082cabdd890efc463f67f60cefe8c3f87cfce\",\n v: 27,\n }),\n }),\n );\n });\n\n it(\"should return an error if r is missing\", () => {\n // GIVEN\n const response: ApduResponse = {\n statusCode: Buffer.from([0x90, 0x00]), // Success status code\n data: SUCCESS_RESPONSE.slice(0, 32),\n };\n // WHEN\n const command = new SignEIP7702AuthorizationCommand({\n data: Uint8Array.from([]),\n isFirstChunk: true,\n });\n const result = command.parseResponse(response);\n // THEN\n expect(result).toStrictEqual(\n CommandResultFactory({\n error: new InvalidStatusWordError(\"R is missing\"),\n }),\n );\n });\n\n it(\"should return an error if s is missing\", () => {\n // GIVEN\n const response: ApduResponse = {\n statusCode: Buffer.from([0x90, 0x00]), // Success status code\n data: SUCCESS_RESPONSE.slice(0, 64),\n };\n // WHEN\n const command = new SignEIP7702AuthorizationCommand({\n data: Uint8Array.from([]),\n isFirstChunk: true,\n });\n const result = command.parseResponse(response);\n // THEN\n expect(result).toStrictEqual(\n CommandResultFactory({\n error: new InvalidStatusWordError(\"S is missing\"),\n }),\n );\n });\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAKO,2CACPC,EAA8B,qBAE9BC,EAGO,gDAEP,MAAMC,EAAmB,WAAW,KAAK,CACvC,IAAM,GAAM,EAAM,EAAM,EAAM,EAAM,EAAM,GAAM,IAAM,IAAM,IAAM,IAAM,GAC1E,CAAC,EAEKC,EAAkB,WAAW,KAAK,CACtC,IAAM,GAAM,EAAM,EAAM,EAAM,EAAM,EAAM,GAAM,IAAM,IAAM,IAAM,IAAM,GAC1E,CAAC,EAEKC,EAAmB,IAAI,WAAW,CACtC,GAAM,IAAM,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C,EACsB,cAAcD,CAAQ,EAE7C,OAAOC,CAAM,EAAE,iBACb,wBAAqB,CACnB,MAAO,IAAI,yBAAuB,cAAc,CAClD,CAAC,CACH,CACF,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["import_device_management_kit", "import_purify_ts", "import_SignAuthorizationDelegationCommand", "FIRST_CHUNK_APDU", "NEXT_CHUNK_APDU", "SUCCESS_RESPONSE", "args", "apdu", "response", "result"]
7
+ }