@ledgerhq/device-signer-kit-concordium 0.3.0 → 0.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 (158) hide show
  1. package/README.md +65 -5
  2. package/lib/cjs/api/SignerConcordium.js +1 -1
  3. package/lib/cjs/api/SignerConcordium.js.map +1 -1
  4. package/lib/cjs/api/SignerConcordiumBuilder.js +1 -1
  5. package/lib/cjs/api/SignerConcordiumBuilder.js.map +2 -2
  6. package/lib/cjs/internal/DefaultSignerConcordium.js +1 -1
  7. package/lib/cjs/internal/DefaultSignerConcordium.js.map +3 -3
  8. package/lib/cjs/internal/app-binder/ConcordiumAppBinder.js.map +2 -2
  9. package/lib/cjs/internal/app-binder/command/SignPltCommand.js +2 -0
  10. package/lib/cjs/internal/app-binder/command/SignPltCommand.js.map +7 -0
  11. package/lib/cjs/internal/app-binder/command/SignPltCommand.test.js +2 -0
  12. package/lib/cjs/internal/app-binder/command/SignPltCommand.test.js.map +7 -0
  13. package/lib/cjs/internal/app-binder/command/SignTransferCommand.js +1 -1
  14. package/lib/cjs/internal/app-binder/command/SignTransferCommand.js.map +2 -2
  15. package/lib/cjs/internal/app-binder/command/SignTransferCommand.test.js +1 -1
  16. package/lib/cjs/internal/app-binder/command/SignTransferCommand.test.js.map +3 -3
  17. package/lib/cjs/internal/app-binder/command/SignTransferWithMemoCommand.js +1 -1
  18. package/lib/cjs/internal/app-binder/command/SignTransferWithMemoCommand.js.map +2 -2
  19. package/lib/cjs/internal/app-binder/command/SignTransferWithMemoCommand.test.js +1 -1
  20. package/lib/cjs/internal/app-binder/command/SignTransferWithMemoCommand.test.js.map +2 -2
  21. package/lib/cjs/internal/app-binder/command/utils/ConcordiumApplicationErrors.js +1 -1
  22. package/lib/cjs/internal/app-binder/command/utils/ConcordiumApplicationErrors.js.map +2 -2
  23. package/lib/cjs/internal/app-binder/command/utils/EncodeMaxFee.js +2 -0
  24. package/lib/cjs/internal/app-binder/command/utils/EncodeMaxFee.js.map +7 -0
  25. package/lib/cjs/internal/app-binder/command/utils/InvalidMaxFeeError.js +2 -0
  26. package/lib/cjs/internal/app-binder/command/utils/InvalidMaxFeeError.js.map +7 -0
  27. package/lib/cjs/internal/app-binder/command/utils/InvalidPltTransactionError.js +2 -0
  28. package/lib/cjs/internal/app-binder/command/utils/InvalidPltTransactionError.js.map +7 -0
  29. package/lib/cjs/internal/app-binder/command/utils/UnsupportedAppVersionError.js +2 -0
  30. package/lib/cjs/internal/app-binder/command/utils/UnsupportedAppVersionError.js.map +7 -0
  31. package/lib/cjs/internal/app-binder/command/utils/UnsupportedTransactionTypeError.js +1 -1
  32. package/lib/cjs/internal/app-binder/command/utils/UnsupportedTransactionTypeError.js.map +2 -2
  33. package/lib/cjs/internal/app-binder/constants.js +1 -1
  34. package/lib/cjs/internal/app-binder/constants.js.map +3 -3
  35. package/lib/cjs/internal/app-binder/task/SendPltTask.js +2 -0
  36. package/lib/cjs/internal/app-binder/task/SendPltTask.js.map +7 -0
  37. package/lib/cjs/internal/app-binder/task/SendPltTask.test.js +2 -0
  38. package/lib/cjs/internal/app-binder/task/SendPltTask.test.js.map +7 -0
  39. package/lib/cjs/internal/app-binder/task/SendTransferTask.js +1 -1
  40. package/lib/cjs/internal/app-binder/task/SendTransferTask.js.map +3 -3
  41. package/lib/cjs/internal/app-binder/task/SendTransferTask.test.js +1 -1
  42. package/lib/cjs/internal/app-binder/task/SendTransferTask.test.js.map +3 -3
  43. package/lib/cjs/internal/app-binder/task/SendTransferWithMemoTask.js +1 -1
  44. package/lib/cjs/internal/app-binder/task/SendTransferWithMemoTask.js.map +3 -3
  45. package/lib/cjs/internal/app-binder/task/SendTransferWithMemoTask.test.js +1 -1
  46. package/lib/cjs/internal/app-binder/task/SendTransferWithMemoTask.test.js.map +3 -3
  47. package/lib/cjs/internal/app-binder/task/SignTransactionTaskFactory.js +1 -1
  48. package/lib/cjs/internal/app-binder/task/SignTransactionTaskFactory.js.map +3 -3
  49. package/lib/cjs/internal/app-binder/task/SignTransactionTaskFactory.test.js +1 -1
  50. package/lib/cjs/internal/app-binder/task/SignTransactionTaskFactory.test.js.map +3 -3
  51. package/lib/cjs/internal/app-binder/task/VerifyAddressTask.js +1 -1
  52. package/lib/cjs/internal/app-binder/task/VerifyAddressTask.js.map +2 -2
  53. package/lib/cjs/internal/app-binder/task/VerifyAddressTask.test.js +1 -1
  54. package/lib/cjs/internal/app-binder/task/VerifyAddressTask.test.js.map +2 -2
  55. package/lib/cjs/internal/shared/ConcordiumAppVersions.js +2 -0
  56. package/lib/cjs/internal/shared/ConcordiumAppVersions.js.map +7 -0
  57. package/lib/cjs/internal/use-cases/transaction/SignTransactionUseCase.js +1 -1
  58. package/lib/cjs/internal/use-cases/transaction/SignTransactionUseCase.js.map +3 -3
  59. package/lib/cjs/package.json +3 -3
  60. package/lib/esm/api/SignerConcordiumBuilder.js +1 -1
  61. package/lib/esm/api/SignerConcordiumBuilder.js.map +3 -3
  62. package/lib/esm/internal/DefaultSignerConcordium.js +1 -1
  63. package/lib/esm/internal/DefaultSignerConcordium.js.map +3 -3
  64. package/lib/esm/internal/app-binder/ConcordiumAppBinder.js.map +2 -2
  65. package/lib/esm/internal/app-binder/command/SignPltCommand.js +2 -0
  66. package/lib/esm/internal/app-binder/command/SignPltCommand.js.map +7 -0
  67. package/lib/esm/internal/app-binder/command/SignPltCommand.test.js +2 -0
  68. package/lib/esm/internal/app-binder/command/SignPltCommand.test.js.map +7 -0
  69. package/lib/esm/internal/app-binder/command/SignTransferCommand.js +1 -1
  70. package/lib/esm/internal/app-binder/command/SignTransferCommand.js.map +3 -3
  71. package/lib/esm/internal/app-binder/command/SignTransferCommand.test.js +1 -1
  72. package/lib/esm/internal/app-binder/command/SignTransferCommand.test.js.map +3 -3
  73. package/lib/esm/internal/app-binder/command/SignTransferWithMemoCommand.js +1 -1
  74. package/lib/esm/internal/app-binder/command/SignTransferWithMemoCommand.js.map +3 -3
  75. package/lib/esm/internal/app-binder/command/SignTransferWithMemoCommand.test.js +1 -1
  76. package/lib/esm/internal/app-binder/command/SignTransferWithMemoCommand.test.js.map +2 -2
  77. package/lib/esm/internal/app-binder/command/utils/ConcordiumApplicationErrors.js +1 -1
  78. package/lib/esm/internal/app-binder/command/utils/ConcordiumApplicationErrors.js.map +2 -2
  79. package/lib/esm/internal/app-binder/command/utils/EncodeMaxFee.js +2 -0
  80. package/lib/esm/internal/app-binder/command/utils/EncodeMaxFee.js.map +7 -0
  81. package/lib/esm/internal/app-binder/command/utils/InvalidMaxFeeError.js +2 -0
  82. package/lib/esm/internal/app-binder/command/utils/InvalidMaxFeeError.js.map +7 -0
  83. package/lib/esm/internal/app-binder/command/utils/InvalidPltTransactionError.js +2 -0
  84. package/lib/esm/internal/app-binder/command/utils/InvalidPltTransactionError.js.map +7 -0
  85. package/lib/esm/internal/app-binder/command/utils/UnsupportedAppVersionError.js +2 -0
  86. package/lib/esm/internal/app-binder/command/utils/UnsupportedAppVersionError.js.map +7 -0
  87. package/lib/esm/internal/app-binder/command/utils/UnsupportedTransactionTypeError.js +1 -1
  88. package/lib/esm/internal/app-binder/command/utils/UnsupportedTransactionTypeError.js.map +2 -2
  89. package/lib/esm/internal/app-binder/constants.js +1 -1
  90. package/lib/esm/internal/app-binder/constants.js.map +3 -3
  91. package/lib/esm/internal/app-binder/task/SendPltTask.js +2 -0
  92. package/lib/esm/internal/app-binder/task/SendPltTask.js.map +7 -0
  93. package/lib/esm/internal/app-binder/task/SendPltTask.test.js +2 -0
  94. package/lib/esm/internal/app-binder/task/SendPltTask.test.js.map +7 -0
  95. package/lib/esm/internal/app-binder/task/SendTransferTask.js +1 -1
  96. package/lib/esm/internal/app-binder/task/SendTransferTask.js.map +3 -3
  97. package/lib/esm/internal/app-binder/task/SendTransferTask.test.js +1 -1
  98. package/lib/esm/internal/app-binder/task/SendTransferTask.test.js.map +3 -3
  99. package/lib/esm/internal/app-binder/task/SendTransferWithMemoTask.js +1 -1
  100. package/lib/esm/internal/app-binder/task/SendTransferWithMemoTask.js.map +3 -3
  101. package/lib/esm/internal/app-binder/task/SendTransferWithMemoTask.test.js +1 -1
  102. package/lib/esm/internal/app-binder/task/SendTransferWithMemoTask.test.js.map +3 -3
  103. package/lib/esm/internal/app-binder/task/SignTransactionTaskFactory.js +1 -1
  104. package/lib/esm/internal/app-binder/task/SignTransactionTaskFactory.js.map +3 -3
  105. package/lib/esm/internal/app-binder/task/SignTransactionTaskFactory.test.js +1 -1
  106. package/lib/esm/internal/app-binder/task/SignTransactionTaskFactory.test.js.map +3 -3
  107. package/lib/esm/internal/app-binder/task/VerifyAddressTask.js +1 -1
  108. package/lib/esm/internal/app-binder/task/VerifyAddressTask.js.map +2 -2
  109. package/lib/esm/internal/app-binder/task/VerifyAddressTask.test.js +1 -1
  110. package/lib/esm/internal/app-binder/task/VerifyAddressTask.test.js.map +2 -2
  111. package/lib/esm/internal/shared/ConcordiumAppVersions.js +2 -0
  112. package/lib/esm/internal/shared/ConcordiumAppVersions.js.map +7 -0
  113. package/lib/esm/internal/use-cases/transaction/SignTransactionUseCase.js +1 -1
  114. package/lib/esm/internal/use-cases/transaction/SignTransactionUseCase.js.map +3 -3
  115. package/lib/esm/package.json +3 -3
  116. package/lib/types/api/SignerConcordium.d.ts +11 -1
  117. package/lib/types/api/SignerConcordium.d.ts.map +1 -1
  118. package/lib/types/api/SignerConcordiumBuilder.d.ts.map +1 -1
  119. package/lib/types/internal/DefaultSignerConcordium.d.ts +1 -1
  120. package/lib/types/internal/DefaultSignerConcordium.d.ts.map +1 -1
  121. package/lib/types/internal/app-binder/ConcordiumAppBinder.d.ts +1 -0
  122. package/lib/types/internal/app-binder/ConcordiumAppBinder.d.ts.map +1 -1
  123. package/lib/types/internal/app-binder/command/SignPltCommand.d.ts +30 -0
  124. package/lib/types/internal/app-binder/command/SignPltCommand.d.ts.map +1 -0
  125. package/lib/types/internal/app-binder/command/SignPltCommand.test.d.ts +2 -0
  126. package/lib/types/internal/app-binder/command/SignPltCommand.test.d.ts.map +1 -0
  127. package/lib/types/internal/app-binder/command/SignTransferCommand.d.ts +2 -2
  128. package/lib/types/internal/app-binder/command/SignTransferCommand.d.ts.map +1 -1
  129. package/lib/types/internal/app-binder/command/SignTransferWithMemoCommand.d.ts +1 -0
  130. package/lib/types/internal/app-binder/command/SignTransferWithMemoCommand.d.ts.map +1 -1
  131. package/lib/types/internal/app-binder/command/utils/ConcordiumApplicationErrors.d.ts +16 -1
  132. package/lib/types/internal/app-binder/command/utils/ConcordiumApplicationErrors.d.ts.map +1 -1
  133. package/lib/types/internal/app-binder/command/utils/EncodeMaxFee.d.ts +5 -0
  134. package/lib/types/internal/app-binder/command/utils/EncodeMaxFee.d.ts.map +1 -0
  135. package/lib/types/internal/app-binder/command/utils/InvalidMaxFeeError.d.ts +6 -0
  136. package/lib/types/internal/app-binder/command/utils/InvalidMaxFeeError.d.ts.map +1 -0
  137. package/lib/types/internal/app-binder/command/utils/InvalidPltTransactionError.d.ts +11 -0
  138. package/lib/types/internal/app-binder/command/utils/InvalidPltTransactionError.d.ts.map +1 -0
  139. package/lib/types/internal/app-binder/command/utils/UnsupportedAppVersionError.d.ts +11 -0
  140. package/lib/types/internal/app-binder/command/utils/UnsupportedAppVersionError.d.ts.map +1 -0
  141. package/lib/types/internal/app-binder/constants.d.ts +5 -0
  142. package/lib/types/internal/app-binder/constants.d.ts.map +1 -1
  143. package/lib/types/internal/app-binder/task/SendPltTask.d.ts +35 -0
  144. package/lib/types/internal/app-binder/task/SendPltTask.d.ts.map +1 -0
  145. package/lib/types/internal/app-binder/task/SendPltTask.test.d.ts +2 -0
  146. package/lib/types/internal/app-binder/task/SendPltTask.test.d.ts.map +1 -0
  147. package/lib/types/internal/app-binder/task/SendTransferTask.d.ts +2 -0
  148. package/lib/types/internal/app-binder/task/SendTransferTask.d.ts.map +1 -1
  149. package/lib/types/internal/app-binder/task/SendTransferWithMemoTask.d.ts +2 -0
  150. package/lib/types/internal/app-binder/task/SendTransferWithMemoTask.d.ts.map +1 -1
  151. package/lib/types/internal/app-binder/task/SignTransactionTaskFactory.d.ts +1 -0
  152. package/lib/types/internal/app-binder/task/SignTransactionTaskFactory.d.ts.map +1 -1
  153. package/lib/types/internal/shared/ConcordiumAppVersions.d.ts +10 -0
  154. package/lib/types/internal/shared/ConcordiumAppVersions.d.ts.map +1 -0
  155. package/lib/types/internal/use-cases/transaction/SignTransactionUseCase.d.ts +1 -1
  156. package/lib/types/internal/use-cases/transaction/SignTransactionUseCase.d.ts.map +1 -1
  157. package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
  158. package/package.json +8 -8
package/README.md CHANGED
@@ -4,7 +4,7 @@ This module provides the implementation of the Ledger Concordium signer of the D
4
4
 
5
5
  - Querying the device app configuration and version;
6
6
  - Retrieving the Concordium public key using a given derivation path;
7
- - Signing a Concordium transaction (Transfer and TransferWithMemo);
7
+ - Signing a Concordium transaction (Transfer, TransferWithMemo and TokenUpdate / PLT);
8
8
  - Signing a Concordium credential deployment transaction;
9
9
  - Verifying a Concordium address on-device using a trusted backend;
10
10
 
@@ -49,9 +49,14 @@ const signerConcordium = new SignerConcordiumBuilder({
49
49
  The builder creates a default `ContextModule` out of the box, which is used by `verifyAddress` to communicate with the trusted metadata service. You can also provide a customized context module:
50
50
 
51
51
  ```typescript
52
- import { ContextModuleBuilder } from "@ledgerhq/context-module";
52
+ import {
53
+ ContextModuleBuilder,
54
+ ContextModuleChainID,
55
+ } from "@ledgerhq/context-module";
53
56
 
54
- const customContextModule = new ContextModuleBuilder({ originToken }).build();
57
+ const customContextModule = new ContextModuleBuilder({ originToken })
58
+ .setChain(ContextModuleChainID.Concordium)
59
+ .build();
55
60
 
56
61
  const signerConcordium = new SignerConcordiumBuilder({
57
62
  dmk,
@@ -145,12 +150,21 @@ type PublicKey = {
145
150
 
146
151
  ### Use Case 3: Sign Transaction
147
152
 
148
- Securely sign a Concordium transaction on Ledger devices. Supports both Transfer and TransferWithMemo transaction types. The transaction type is automatically detected from the serialized payload.
153
+ Securely sign a Concordium transaction on Ledger devices. The transaction kind is detected automatically from the kind byte at offset 60 of the serialized payload.
154
+
155
+ | Kind | Byte | Name |
156
+ | ---------------- | ------------- | ------------------------------------ |
157
+ | Transfer | `3` (`0x03`) | Plain CCD transfer |
158
+ | TransferWithMemo | `22` (`0x16`) | CCD transfer with a memo |
159
+ | TokenUpdate | `27` (`0x1B`) | Protocol Level Token (PLT) operation |
160
+
161
+ Any other kind byte is rejected with `UnsupportedTransactionTypeError` (errorCode `"unsupported_transaction_type"`) before anything is sent to the device.
149
162
 
150
163
  ```typescript
151
164
  const { observable, cancel } = signerConcordium.signTransaction(
152
165
  derivationPath,
153
166
  transaction,
167
+ maxFee,
154
168
  options,
155
169
  );
156
170
  ```
@@ -167,7 +181,27 @@ const { observable, cancel } = signerConcordium.signTransaction(
167
181
 
168
182
  - **Required**
169
183
  - **Type:** `Uint8Array`
170
- - The serialized transaction bytes to sign. The transaction type (Transfer or TransferWithMemo) is detected automatically from the type byte at offset 60.
184
+ - The serialized transaction bytes to sign. The transaction kind is detected automatically from the kind byte at offset 60.
185
+ - For **TokenUpdate (PLT)** the expected layout is flat:
186
+
187
+ ```text
188
+ [header:60][kind:1 = 0x1B][token_id_length:1][token_id:1..128][cbor_total_length:4 BE][cbor:N]
189
+ ```
190
+
191
+ This matches the serialization produced by the official Concordium JS SDK: a token id with a word8 length prefix, followed by the operations payload with a word32 length prefix.
192
+
193
+ The signer streams this to the device as one INIT frame carrying everything up to and including `cbor_total_length`, then CONT frames carrying the CBOR payload. Chunking is byte-oriented, so a CBOR field may span a frame boundary.
194
+
195
+ The CBOR payload is passed through **opaque**. The signer does not decode or validate PLT semantics — the operation type, amount, recipient and memo are parsed and displayed by the device app. The signer checks only the framing: `token_id_length` within `1..128`, `cbor_total_length` within `1..512` and consistent with the remaining byte count. A layout failure is reported as `InvalidPltTransactionError` (errorCode `"invalid_plt_transaction"`) with the offending field named in the message, before any APDU is sent.
196
+
197
+ - `maxFee`
198
+
199
+ - **Required**
200
+ - **Type:** `bigint` (µCCD)
201
+ - The max-fee value to display, as a uint64 in µCCD. Rendered on-device alongside the recipient and amount. The value is **display-only**: it is not part of the canonical signed bytes, so the on-chain transaction hash is unaffected.
202
+ - Requires Concordium app version **5.6.0 or newer** on the device. On older firmware the value is dropped at the wire boundary and the device falls back to the legacy display. Signing still succeeds; only the on-device display degrades. Callers should always pass a real value; do not gate on detected firmware version.
203
+ - **Ignored for TokenUpdate (PLT) transactions.** The device displays no fee for `INS 0x27`, and the handler rejects both a non-zero P2 and any trailing fee suffix. The value is still validated for range, so pass `0n` unless you have a real figure.
204
+ - Invalid values (non-bigint, negative, or above uint64 range) are rejected with `InvalidMaxFeeError` (errorCode `"invalid_max_fee"`).
171
205
 
172
206
  - `options`
173
207
 
@@ -182,6 +216,32 @@ const { observable, cancel } = signerConcordium.signTransaction(
182
216
 
183
217
  - `skipOpenApp`: An optional boolean indicating whether to skip opening the Concordium app on the device.
184
218
 
219
+ #### **PLT app-version requirement**
220
+
221
+ PLT signing requires a Concordium app that implements `INS 0x27`, currently **5.7.0 or newer**. The signer checks the running app version before sending anything and rejects an older app with `UnsupportedAppVersionError` (errorCode `"unsupported_app_version"`). This is deliberately distinct from a signing failure, so an integrator can prompt the user to update the app rather than reporting a failed transaction. Transfer and TransferWithMemo are unaffected and keep working on older apps.
222
+
223
+ #### **PLT status words**
224
+
225
+ Device-originated errors on the PLT path are surfaced via `DeviceActionStatus.Error` and discriminated by the `errorCode` string:
226
+
227
+ | `errorCode` | Meaning | Integrator action |
228
+ | ----------- | -------------------------------------------------------------------------- | ----------------------------------------- |
229
+ | `"6b00"` | P2 was not `0x00` | Signer bug; report it |
230
+ | `"6b01"` | INIT sent twice, or CONT before INIT | Signer bug; report it |
231
+ | `"6b02"` | Derivation path invalid or deeper than 8 nodes | Correct the derivation path |
232
+ | `"6b03"` | P1 was neither `0x00` nor `0x01` | Signer bug; report it |
233
+ | `"6b04"` | Kind byte was not `27`, or the header is too short | Correct the serialized transaction |
234
+ | `"6b06"` | Display formatting overflow | Report with the payload that triggered it |
235
+ | `"6b07"` | Device crypto initialisation failed | Retry; escalate if persistent |
236
+ | `"6b0d"` | Empty CONT frame, CBOR overflow, or a CBOR payload the device cannot parse | Check the CBOR against CIS-7 |
237
+ | `"6b0e"` | `cbor_total_length` is `0` or above `512` | Reduce the payload |
238
+ | `"6b0f"` | `token_id_length` outside `1..128` | Correct the token id |
239
+ | `"6b10"` | The CBOR array carries more than one operation | Send one operation per transaction |
240
+
241
+ The device accepts exactly **one** operation per PLT transaction. Batching several into the outer CBOR array is refused with `"6b10"`, so that the user cannot approve a screen showing only part of what they are signing.
242
+
243
+ The generic codes apply here too: `"6985"` user rejected, `"5515"` locked device, `"6d00"` the app does not implement `INS 0x27`.
244
+
185
245
  #### **Returns**
186
246
 
187
247
  - `observable` Emits DeviceActionState updates, including the following details:
@@ -1,2 +1,2 @@
1
- "use strict";var i=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var y=(n,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of s(t))!a.call(n,e)&&e!==o&&i(n,e,{get:()=>t[e],enumerable:!(r=p(t,e))||r.enumerable});return n};var c=n=>y(i({},"__esModule",{value:!0}),n);var m={};module.exports=c(m);
1
+ "use strict";var r=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var y=(n,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of s(t))!a.call(n,e)&&e!==o&&r(n,e,{get:()=>t[e],enumerable:!(i=p(t,e))||i.enumerable});return n};var m=n=>y(r({},"__esModule",{value:!0}),n);var c={};module.exports=m(c);
2
2
  //# sourceMappingURL=SignerConcordium.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/api/SignerConcordium.ts"],
4
- "sourcesContent": ["import { type AccountOwnershipNetwork } from \"@ledgerhq/context-module\";\n\nimport { type GetAppConfigDAReturnType } from \"@api/app-binder/GetAppConfigDeviceActionTypes\";\nimport { type GetPublicKeyDAReturnType } from \"@api/app-binder/GetPublicKeyDeviceActionTypes\";\nimport { type SignCredentialDeploymentTransactionDAReturnType } from \"@api/app-binder/SignCredentialDeploymentTransactionDeviceActionTypes\";\nimport { type SignTransactionDAReturnType } from \"@api/app-binder/SignTransactionDeviceActionTypes\";\nimport { type VerifyAddressDAReturnType } from \"@api/app-binder/VerifyAddressDeviceActionTypes\";\nimport { type PublicKeyOptions } from \"@api/model/PublicKeyOptions\";\nimport { type TransactionOptions } from \"@api/model/TransactionOptions\";\nimport { type VerifyAddressOptions } from \"@api/model/VerifyAddressOptions\";\n\nexport interface SignerConcordium {\n getAppConfiguration: () => GetAppConfigDAReturnType;\n\n getPublicKey: (\n derivationPath: string,\n options?: PublicKeyOptions,\n ) => GetPublicKeyDAReturnType;\n\n signTransaction: (\n derivationPath: string,\n transaction: Uint8Array,\n options?: TransactionOptions,\n ) => SignTransactionDAReturnType;\n\n signCredentialDeploymentTransaction: (\n derivationPath: string,\n transaction: Uint8Array,\n options?: TransactionOptions,\n ) => SignCredentialDeploymentTransactionDAReturnType;\n\n verifyAddress: (\n derivationPath: string,\n address: string,\n network: AccountOwnershipNetwork,\n options?: VerifyAddressOptions,\n ) => VerifyAddressDAReturnType;\n}\n"],
4
+ "sourcesContent": ["import { type AccountOwnershipNetwork } from \"@ledgerhq/context-module\";\n\nimport { type GetAppConfigDAReturnType } from \"@api/app-binder/GetAppConfigDeviceActionTypes\";\nimport { type GetPublicKeyDAReturnType } from \"@api/app-binder/GetPublicKeyDeviceActionTypes\";\nimport { type SignCredentialDeploymentTransactionDAReturnType } from \"@api/app-binder/SignCredentialDeploymentTransactionDeviceActionTypes\";\nimport { type SignTransactionDAReturnType } from \"@api/app-binder/SignTransactionDeviceActionTypes\";\nimport { type VerifyAddressDAReturnType } from \"@api/app-binder/VerifyAddressDeviceActionTypes\";\nimport { type PublicKeyOptions } from \"@api/model/PublicKeyOptions\";\nimport { type TransactionOptions } from \"@api/model/TransactionOptions\";\nimport { type VerifyAddressOptions } from \"@api/model/VerifyAddressOptions\";\n\nexport interface SignerConcordium {\n getAppConfiguration: () => GetAppConfigDAReturnType;\n\n getPublicKey: (\n derivationPath: string,\n options?: PublicKeyOptions,\n ) => GetPublicKeyDAReturnType;\n\n /**\n * Sign a serialized Concordium account transaction.\n *\n * Supported kinds are Transfer (3), TransferWithMemo (22) and\n * TokenUpdate (27, PLT).\n *\n * @param maxFee - Maximum fee in \u00B5CCD, shown on the device review screens.\n * Used for every supported kind, PLT included. The device does not hash it,\n * so it affects the display only.\n */\n signTransaction: (\n derivationPath: string,\n transaction: Uint8Array,\n maxFee: bigint,\n options?: TransactionOptions,\n ) => SignTransactionDAReturnType;\n\n signCredentialDeploymentTransaction: (\n derivationPath: string,\n transaction: Uint8Array,\n options?: TransactionOptions,\n ) => SignCredentialDeploymentTransactionDAReturnType;\n\n verifyAddress: (\n derivationPath: string,\n address: string,\n network: AccountOwnershipNetwork,\n options?: VerifyAddressOptions,\n ) => VerifyAddressDAReturnType;\n}\n"],
5
5
  "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
6
  "names": ["SignerConcordium_exports", "__toCommonJS"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var n=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var m=(t,e)=>{for(var o in e)n(t,o,{get:e[o],enumerable:!0})},a=(t,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of c(e))!l.call(t,i)&&i!==o&&n(t,i,{get:()=>e[i],enumerable:!(s=u(e,i))||s.enumerable});return t};var g=t=>a(n({},"__esModule",{value:!0}),t);var p={};m(p,{SignerConcordiumBuilder:()=>C});module.exports=g(p);var r=require("@ledgerhq/context-module"),d=require("../internal/DefaultSignerConcordium");class C{_dmk;_sessionId;_customContextModule;constructor({dmk:e,sessionId:o}){this._dmk=e,this._sessionId=o}withContextModule(e){return this._customContextModule=e,this}build(){const e=this._customContextModule??new r.ContextModuleBuilder({loggerFactory:o=>this._dmk.getLoggerFactory()(["ContextModule",o])}).build();return new d.DefaultSignerConcordium({dmk:this._dmk,sessionId:this._sessionId,contextModule:e})}}0&&(module.exports={SignerConcordiumBuilder});
1
+ "use strict";var s=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var m=(t,e)=>{for(var o in e)s(t,o,{get:e[o],enumerable:!0})},C=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of c(e))!l.call(t,i)&&i!==o&&s(t,i,{get:()=>e[i],enumerable:!(r=u(e,i))||r.enumerable});return t};var a=t=>C(s({},"__esModule",{value:!0}),t);var M={};m(M,{SignerConcordiumBuilder:()=>g});module.exports=a(M);var n=require("@ledgerhq/context-module"),d=require("../internal/DefaultSignerConcordium");class g{_dmk;_sessionId;_customContextModule;constructor({dmk:e,sessionId:o}){this._dmk=e,this._sessionId=o}withContextModule(e){return this._customContextModule=e,this}build(){const e=this._customContextModule??new n.ContextModuleBuilder({loggerFactory:o=>this._dmk.getLoggerFactory()(["ContextModule",o])}).setChain(n.ContextModuleChainID.Concordium).build();return new d.DefaultSignerConcordium({dmk:this._dmk,sessionId:this._sessionId,contextModule:e})}}0&&(module.exports={SignerConcordiumBuilder});
2
2
  //# sourceMappingURL=SignerConcordiumBuilder.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/api/SignerConcordiumBuilder.ts"],
4
- "sourcesContent": ["import {\n type ContextModule,\n ContextModuleBuilder,\n} from \"@ledgerhq/context-module\";\nimport {\n type DeviceManagementKit,\n type DeviceSessionId,\n} from \"@ledgerhq/device-management-kit\";\n\nimport { DefaultSignerConcordium } from \"@internal/DefaultSignerConcordium\";\n\ntype SignerConcordiumBuilderConstructorArgs = {\n dmk: DeviceManagementKit;\n sessionId: DeviceSessionId;\n};\n\nexport class SignerConcordiumBuilder {\n private readonly _dmk: DeviceManagementKit;\n private readonly _sessionId: DeviceSessionId;\n private _customContextModule?: ContextModule;\n\n constructor({ dmk, sessionId }: SignerConcordiumBuilderConstructorArgs) {\n this._dmk = dmk;\n this._sessionId = sessionId;\n }\n\n /**\n * Override the default context module\n *\n * @param contextModule\n * @returns this\n */\n public withContextModule(contextModule: ContextModule): this {\n this._customContextModule = contextModule;\n return this;\n }\n\n public build() {\n const contextModule =\n this._customContextModule ??\n new ContextModuleBuilder({\n loggerFactory: (tag: string) =>\n this._dmk.getLoggerFactory()([\"ContextModule\", tag]),\n }).build();\n\n return new DefaultSignerConcordium({\n dmk: this._dmk,\n sessionId: this._sessionId,\n contextModule,\n });\n }\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,6BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAGO,oCAMPC,EAAwC,6CAOjC,MAAMH,CAAwB,CAClB,KACA,WACT,qBAER,YAAY,CAAE,IAAAI,EAAK,UAAAC,CAAU,EAA2C,CACtE,KAAK,KAAOD,EACZ,KAAK,WAAaC,CACpB,CAQO,kBAAkBC,EAAoC,CAC3D,YAAK,qBAAuBA,EACrB,IACT,CAEO,OAAQ,CACb,MAAMA,EACJ,KAAK,sBACL,IAAI,uBAAqB,CACvB,cAAgBC,GACd,KAAK,KAAK,iBAAiB,EAAE,CAAC,gBAAiBA,CAAG,CAAC,CACvD,CAAC,EAAE,MAAM,EAEX,OAAO,IAAI,0BAAwB,CACjC,IAAK,KAAK,KACV,UAAW,KAAK,WAChB,cAAAD,CACF,CAAC,CACH,CACF",
4
+ "sourcesContent": ["import {\n type ContextModule,\n ContextModuleBuilder,\n ContextModuleChainID,\n} from \"@ledgerhq/context-module\";\nimport {\n type DeviceManagementKit,\n type DeviceSessionId,\n} from \"@ledgerhq/device-management-kit\";\n\nimport { DefaultSignerConcordium } from \"@internal/DefaultSignerConcordium\";\n\ntype SignerConcordiumBuilderConstructorArgs = {\n dmk: DeviceManagementKit;\n sessionId: DeviceSessionId;\n};\n\nexport class SignerConcordiumBuilder {\n private readonly _dmk: DeviceManagementKit;\n private readonly _sessionId: DeviceSessionId;\n private _customContextModule?: ContextModule;\n\n constructor({ dmk, sessionId }: SignerConcordiumBuilderConstructorArgs) {\n this._dmk = dmk;\n this._sessionId = sessionId;\n }\n\n /**\n * Override the default context module\n *\n * @param contextModule\n * @returns this\n */\n public withContextModule(contextModule: ContextModule): this {\n this._customContextModule = contextModule;\n return this;\n }\n\n public build() {\n const contextModule =\n this._customContextModule ??\n new ContextModuleBuilder({\n loggerFactory: (tag: string) =>\n this._dmk.getLoggerFactory()([\"ContextModule\", tag]),\n })\n .setChain(ContextModuleChainID.Concordium)\n .build();\n\n return new DefaultSignerConcordium({\n dmk: this._dmk,\n sessionId: this._sessionId,\n contextModule,\n });\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,6BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAIO,oCAMPC,EAAwC,6CAOjC,MAAMH,CAAwB,CAClB,KACA,WACT,qBAER,YAAY,CAAE,IAAAI,EAAK,UAAAC,CAAU,EAA2C,CACtE,KAAK,KAAOD,EACZ,KAAK,WAAaC,CACpB,CAQO,kBAAkBC,EAAoC,CAC3D,YAAK,qBAAuBA,EACrB,IACT,CAEO,OAAQ,CACb,MAAMA,EACJ,KAAK,sBACL,IAAI,uBAAqB,CACvB,cAAgBC,GACd,KAAK,KAAK,iBAAiB,EAAE,CAAC,gBAAiBA,CAAG,CAAC,CACvD,CAAC,EACE,SAAS,uBAAqB,UAAU,EACxC,MAAM,EAEX,OAAO,IAAI,0BAAwB,CACjC,IAAK,KAAK,KACV,UAAW,KAAK,WAChB,cAAAD,CACF,CAAC,CACH,CACF",
6
6
  "names": ["SignerConcordiumBuilder_exports", "__export", "SignerConcordiumBuilder", "__toCommonJS", "import_context_module", "import_DefaultSignerConcordium", "dmk", "sessionId", "contextModule", "tag"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var o=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var C=(n,e)=>{for(var t in e)o(n,t,{get:e[t],enumerable:!0})},d=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of f(e))!g.call(n,i)&&i!==t&&o(n,i,{get:()=>e[i],enumerable:!(r=u(e,i))||r.enumerable});return n};var l=n=>d(o({},"__esModule",{value:!0}),n);var T={};C(T,{DefaultSignerConcordium:()=>A});module.exports=l(T);var s=require("./di"),p=require("./use-cases/app-config/di/appConfigTypes"),a=require("./use-cases/credential-deployment/di/credentialDeploymentTypes"),m=require("./use-cases/publickey/di/publicKeyTypes"),y=require("./use-cases/transaction/di/transactionTypes"),c=require("./use-cases/verify-address/di/verifyAddressTypes");class A{_container;constructor({dmk:e,sessionId:t,contextModule:r}){this._container=(0,s.makeContainer)({dmk:e,sessionId:t,contextModule:r})}getAppConfiguration(){return this._container.get(p.appConfigTypes.GetAppConfigUseCase).execute()}getPublicKey(e,t){return this._container.get(m.publicKeyTypes.GetPublicKeyUseCase).execute(e,t)}signTransaction(e,t,r){return this._container.get(y.transactionTypes.SignTransactionUseCase).execute(e,t,r)}signCredentialDeploymentTransaction(e,t,r){return this._container.get(a.credentialDeploymentTypes.SignCredentialDeploymentTransactionUseCase).execute(e,t,r)}verifyAddress(e,t,r,i){return this._container.get(c.verifyAddressTypes.VerifyAddressUseCase).execute(e,t,r,i)}}0&&(module.exports={DefaultSignerConcordium});
1
+ "use strict";var o=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var C=(i,e)=>{for(var t in e)o(i,t,{get:e[t],enumerable:!0})},d=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of f(e))!g.call(i,n)&&n!==t&&o(i,n,{get:()=>e[n],enumerable:!(r=u(e,n))||r.enumerable});return i};var l=i=>d(o({},"__esModule",{value:!0}),i);var T={};C(T,{DefaultSignerConcordium:()=>A});module.exports=l(T);var s=require("./di"),p=require("./use-cases/app-config/di/appConfigTypes"),a=require("./use-cases/credential-deployment/di/credentialDeploymentTypes"),m=require("./use-cases/publickey/di/publicKeyTypes"),y=require("./use-cases/transaction/di/transactionTypes"),c=require("./use-cases/verify-address/di/verifyAddressTypes");class A{_container;constructor({dmk:e,sessionId:t,contextModule:r}){this._container=(0,s.makeContainer)({dmk:e,sessionId:t,contextModule:r})}getAppConfiguration(){return this._container.get(p.appConfigTypes.GetAppConfigUseCase).execute()}getPublicKey(e,t){return this._container.get(m.publicKeyTypes.GetPublicKeyUseCase).execute(e,t)}signTransaction(e,t,r,n){return this._container.get(y.transactionTypes.SignTransactionUseCase).execute(e,t,r,n)}signCredentialDeploymentTransaction(e,t,r){return this._container.get(a.credentialDeploymentTypes.SignCredentialDeploymentTransactionUseCase).execute(e,t,r)}verifyAddress(e,t,r,n){return this._container.get(c.verifyAddressTypes.VerifyAddressUseCase).execute(e,t,r,n)}}0&&(module.exports={DefaultSignerConcordium});
2
2
  //# sourceMappingURL=DefaultSignerConcordium.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/internal/DefaultSignerConcordium.ts"],
4
- "sourcesContent": ["import {\n type AccountOwnershipNetwork,\n type ContextModule,\n} 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 GetAppConfigDAReturnType } from \"@api/app-binder/GetAppConfigDeviceActionTypes\";\nimport { type GetPublicKeyDAReturnType } from \"@api/app-binder/GetPublicKeyDeviceActionTypes\";\nimport { type SignCredentialDeploymentTransactionDAReturnType } from \"@api/app-binder/SignCredentialDeploymentTransactionDeviceActionTypes\";\nimport { type SignTransactionDAReturnType } from \"@api/app-binder/SignTransactionDeviceActionTypes\";\nimport { type VerifyAddressDAReturnType } from \"@api/app-binder/VerifyAddressDeviceActionTypes\";\nimport { type PublicKeyOptions } from \"@api/model/PublicKeyOptions\";\nimport { type TransactionOptions } from \"@api/model/TransactionOptions\";\nimport { type VerifyAddressOptions } from \"@api/model/VerifyAddressOptions\";\nimport { type SignerConcordium } from \"@api/SignerConcordium\";\nimport { makeContainer } from \"@internal/di\";\nimport { appConfigTypes } from \"@internal/use-cases/app-config/di/appConfigTypes\";\nimport { type GetAppConfigUseCase } from \"@internal/use-cases/app-config/GetAppConfigUseCase\";\nimport { credentialDeploymentTypes } from \"@internal/use-cases/credential-deployment/di/credentialDeploymentTypes\";\nimport { type SignCredentialDeploymentTransactionUseCase } from \"@internal/use-cases/credential-deployment/SignCredentialDeploymentTransactionUseCase\";\nimport { publicKeyTypes } from \"@internal/use-cases/publickey/di/publicKeyTypes\";\nimport { type GetPublicKeyUseCase } from \"@internal/use-cases/publickey/GetPublicKeyUseCase\";\nimport { transactionTypes } from \"@internal/use-cases/transaction/di/transactionTypes\";\nimport { type SignTransactionUseCase } from \"@internal/use-cases/transaction/SignTransactionUseCase\";\nimport { verifyAddressTypes } from \"@internal/use-cases/verify-address/di/verifyAddressTypes\";\nimport { type VerifyAddressUseCase } from \"@internal/use-cases/verify-address/VerifyAddressUseCase\";\n\ntype DefaultSignerConcordiumConstructorArgs = {\n dmk: DeviceManagementKit;\n sessionId: DeviceSessionId;\n contextModule: ContextModule;\n};\n\nexport class DefaultSignerConcordium implements SignerConcordium {\n private readonly _container: Container;\n\n constructor({\n dmk,\n sessionId,\n contextModule,\n }: DefaultSignerConcordiumConstructorArgs) {\n this._container = makeContainer({ dmk, sessionId, contextModule });\n }\n\n getAppConfiguration(): GetAppConfigDAReturnType {\n return this._container\n .get<GetAppConfigUseCase>(appConfigTypes.GetAppConfigUseCase)\n .execute();\n }\n\n getPublicKey(\n derivationPath: string,\n options?: PublicKeyOptions,\n ): GetPublicKeyDAReturnType {\n return this._container\n .get<GetPublicKeyUseCase>(publicKeyTypes.GetPublicKeyUseCase)\n .execute(derivationPath, options);\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 signCredentialDeploymentTransaction(\n derivationPath: string,\n transaction: Uint8Array,\n options?: TransactionOptions,\n ): SignCredentialDeploymentTransactionDAReturnType {\n return this._container\n .get<SignCredentialDeploymentTransactionUseCase>(\n credentialDeploymentTypes.SignCredentialDeploymentTransactionUseCase,\n )\n .execute(derivationPath, transaction, options);\n }\n\n verifyAddress(\n derivationPath: string,\n address: string,\n network: AccountOwnershipNetwork,\n options?: VerifyAddressOptions,\n ): VerifyAddressDAReturnType {\n return this._container\n .get<VerifyAddressUseCase>(verifyAddressTypes.VerifyAddressUseCase)\n .execute(derivationPath, address, network, options);\n }\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,6BAAAE,IAAA,eAAAC,EAAAH,GAmBA,IAAAI,EAA8B,wBAC9BC,EAA+B,4DAE/BC,EAA0C,kFAE1CC,EAA+B,2DAE/BC,EAAiC,+DAEjCC,EAAmC,oEAS5B,MAAMP,CAAoD,CAC9C,WAEjB,YAAY,CACV,IAAAQ,EACA,UAAAC,EACA,cAAAC,CACF,EAA2C,CACzC,KAAK,cAAa,iBAAc,CAAE,IAAAF,EAAK,UAAAC,EAAW,cAAAC,CAAc,CAAC,CACnE,CAEA,qBAAgD,CAC9C,OAAO,KAAK,WACT,IAAyB,iBAAe,mBAAmB,EAC3D,QAAQ,CACb,CAEA,aACEC,EACAC,EAC0B,CAC1B,OAAO,KAAK,WACT,IAAyB,iBAAe,mBAAmB,EAC3D,QAAQD,EAAgBC,CAAO,CACpC,CAEA,gBACED,EACAE,EACAD,EAC6B,CAC7B,OAAO,KAAK,WACT,IAA4B,mBAAiB,sBAAsB,EACnE,QAAQD,EAAgBE,EAAaD,CAAO,CACjD,CAEA,oCACED,EACAE,EACAD,EACiD,CACjD,OAAO,KAAK,WACT,IACC,4BAA0B,0CAC5B,EACC,QAAQD,EAAgBE,EAAaD,CAAO,CACjD,CAEA,cACED,EACAG,EACAC,EACAH,EAC2B,CAC3B,OAAO,KAAK,WACT,IAA0B,qBAAmB,oBAAoB,EACjE,QAAQD,EAAgBG,EAASC,EAASH,CAAO,CACtD,CACF",
6
- "names": ["DefaultSignerConcordium_exports", "__export", "DefaultSignerConcordium", "__toCommonJS", "import_di", "import_appConfigTypes", "import_credentialDeploymentTypes", "import_publicKeyTypes", "import_transactionTypes", "import_verifyAddressTypes", "dmk", "sessionId", "contextModule", "derivationPath", "options", "transaction", "address", "network"]
4
+ "sourcesContent": ["import {\n type AccountOwnershipNetwork,\n type ContextModule,\n} 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 GetAppConfigDAReturnType } from \"@api/app-binder/GetAppConfigDeviceActionTypes\";\nimport { type GetPublicKeyDAReturnType } from \"@api/app-binder/GetPublicKeyDeviceActionTypes\";\nimport { type SignCredentialDeploymentTransactionDAReturnType } from \"@api/app-binder/SignCredentialDeploymentTransactionDeviceActionTypes\";\nimport { type SignTransactionDAReturnType } from \"@api/app-binder/SignTransactionDeviceActionTypes\";\nimport { type VerifyAddressDAReturnType } from \"@api/app-binder/VerifyAddressDeviceActionTypes\";\nimport { type PublicKeyOptions } from \"@api/model/PublicKeyOptions\";\nimport { type TransactionOptions } from \"@api/model/TransactionOptions\";\nimport { type VerifyAddressOptions } from \"@api/model/VerifyAddressOptions\";\nimport { type SignerConcordium } from \"@api/SignerConcordium\";\nimport { makeContainer } from \"@internal/di\";\nimport { appConfigTypes } from \"@internal/use-cases/app-config/di/appConfigTypes\";\nimport { type GetAppConfigUseCase } from \"@internal/use-cases/app-config/GetAppConfigUseCase\";\nimport { credentialDeploymentTypes } from \"@internal/use-cases/credential-deployment/di/credentialDeploymentTypes\";\nimport { type SignCredentialDeploymentTransactionUseCase } from \"@internal/use-cases/credential-deployment/SignCredentialDeploymentTransactionUseCase\";\nimport { publicKeyTypes } from \"@internal/use-cases/publickey/di/publicKeyTypes\";\nimport { type GetPublicKeyUseCase } from \"@internal/use-cases/publickey/GetPublicKeyUseCase\";\nimport { transactionTypes } from \"@internal/use-cases/transaction/di/transactionTypes\";\nimport { type SignTransactionUseCase } from \"@internal/use-cases/transaction/SignTransactionUseCase\";\nimport { verifyAddressTypes } from \"@internal/use-cases/verify-address/di/verifyAddressTypes\";\nimport { type VerifyAddressUseCase } from \"@internal/use-cases/verify-address/VerifyAddressUseCase\";\n\ntype DefaultSignerConcordiumConstructorArgs = {\n dmk: DeviceManagementKit;\n sessionId: DeviceSessionId;\n contextModule: ContextModule;\n};\n\nexport class DefaultSignerConcordium implements SignerConcordium {\n private readonly _container: Container;\n\n constructor({\n dmk,\n sessionId,\n contextModule,\n }: DefaultSignerConcordiumConstructorArgs) {\n this._container = makeContainer({ dmk, sessionId, contextModule });\n }\n\n getAppConfiguration(): GetAppConfigDAReturnType {\n return this._container\n .get<GetAppConfigUseCase>(appConfigTypes.GetAppConfigUseCase)\n .execute();\n }\n\n getPublicKey(\n derivationPath: string,\n options?: PublicKeyOptions,\n ): GetPublicKeyDAReturnType {\n return this._container\n .get<GetPublicKeyUseCase>(publicKeyTypes.GetPublicKeyUseCase)\n .execute(derivationPath, options);\n }\n\n signTransaction(\n derivationPath: string,\n transaction: Uint8Array,\n maxFee: bigint,\n options?: TransactionOptions,\n ): SignTransactionDAReturnType {\n return this._container\n .get<SignTransactionUseCase>(transactionTypes.SignTransactionUseCase)\n .execute(derivationPath, transaction, maxFee, options);\n }\n\n signCredentialDeploymentTransaction(\n derivationPath: string,\n transaction: Uint8Array,\n options?: TransactionOptions,\n ): SignCredentialDeploymentTransactionDAReturnType {\n return this._container\n .get<SignCredentialDeploymentTransactionUseCase>(\n credentialDeploymentTypes.SignCredentialDeploymentTransactionUseCase,\n )\n .execute(derivationPath, transaction, options);\n }\n\n verifyAddress(\n derivationPath: string,\n address: string,\n network: AccountOwnershipNetwork,\n options?: VerifyAddressOptions,\n ): VerifyAddressDAReturnType {\n return this._container\n .get<VerifyAddressUseCase>(verifyAddressTypes.VerifyAddressUseCase)\n .execute(derivationPath, address, network, options);\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,6BAAAE,IAAA,eAAAC,EAAAH,GAmBA,IAAAI,EAA8B,wBAC9BC,EAA+B,4DAE/BC,EAA0C,kFAE1CC,EAA+B,2DAE/BC,EAAiC,+DAEjCC,EAAmC,oEAS5B,MAAMP,CAAoD,CAC9C,WAEjB,YAAY,CACV,IAAAQ,EACA,UAAAC,EACA,cAAAC,CACF,EAA2C,CACzC,KAAK,cAAa,iBAAc,CAAE,IAAAF,EAAK,UAAAC,EAAW,cAAAC,CAAc,CAAC,CACnE,CAEA,qBAAgD,CAC9C,OAAO,KAAK,WACT,IAAyB,iBAAe,mBAAmB,EAC3D,QAAQ,CACb,CAEA,aACEC,EACAC,EAC0B,CAC1B,OAAO,KAAK,WACT,IAAyB,iBAAe,mBAAmB,EAC3D,QAAQD,EAAgBC,CAAO,CACpC,CAEA,gBACED,EACAE,EACAC,EACAF,EAC6B,CAC7B,OAAO,KAAK,WACT,IAA4B,mBAAiB,sBAAsB,EACnE,QAAQD,EAAgBE,EAAaC,EAAQF,CAAO,CACzD,CAEA,oCACED,EACAE,EACAD,EACiD,CACjD,OAAO,KAAK,WACT,IACC,4BAA0B,0CAC5B,EACC,QAAQD,EAAgBE,EAAaD,CAAO,CACjD,CAEA,cACED,EACAI,EACAC,EACAJ,EAC2B,CAC3B,OAAO,KAAK,WACT,IAA0B,qBAAmB,oBAAoB,EACjE,QAAQD,EAAgBI,EAASC,EAASJ,CAAO,CACtD,CACF",
6
+ "names": ["DefaultSignerConcordium_exports", "__export", "DefaultSignerConcordium", "__toCommonJS", "import_di", "import_appConfigTypes", "import_credentialDeploymentTypes", "import_publicKeyTypes", "import_transactionTypes", "import_verifyAddressTypes", "dmk", "sessionId", "contextModule", "derivationPath", "options", "transaction", "maxFee", "address", "network"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/internal/app-binder/ConcordiumAppBinder.ts"],
4
- "sourcesContent": ["import {\n type AccountOwnershipNetwork,\n type ContextModule,\n} from \"@ledgerhq/context-module\";\nimport {\n CallTaskInAppDeviceAction,\n type DeviceManagementKit,\n type DeviceSessionId,\n LoggerPublisherService,\n SendCommandInAppDeviceAction,\n UserInteractionRequired,\n} from \"@ledgerhq/device-management-kit\";\nimport { inject, injectable } from \"inversify\";\n\nimport { type GetAppConfigDAReturnType } from \"@api/app-binder/GetAppConfigDeviceActionTypes\";\nimport { type GetPublicKeyDAReturnType } from \"@api/app-binder/GetPublicKeyDeviceActionTypes\";\nimport { type SignCredentialDeploymentTransactionDAReturnType } from \"@api/app-binder/SignCredentialDeploymentTransactionDeviceActionTypes\";\nimport { type SignTransactionDAReturnType } from \"@api/app-binder/SignTransactionDeviceActionTypes\";\nimport { type VerifyAddressDAReturnType } from \"@api/app-binder/VerifyAddressDeviceActionTypes\";\nimport { GetAppConfigCommand } from \"@internal/app-binder/command/GetAppConfigCommand\";\nimport {\n GetPublicKeyCommand,\n type GetPublicKeyCommandArgs,\n} from \"@internal/app-binder/command/GetPublicKeyCommand\";\nimport { APP_NAME } from \"@internal/app-binder/constants\";\nimport { SendCredentialDeploymentTransactionTask } from \"@internal/app-binder/task/SendCredentialDeploymentTransactionTask\";\nimport { createSignTransactionTask } from \"@internal/app-binder/task/SignTransactionTaskFactory\";\nimport { VerifyAddressTask } from \"@internal/app-binder/task/VerifyAddressTask\";\nimport { externalTypes } from \"@internal/externalTypes\";\n\n@injectable()\nexport class ConcordiumAppBinder {\n constructor(\n @inject(externalTypes.Dmk) private dmk: DeviceManagementKit,\n @inject(externalTypes.SessionId) private sessionId: DeviceSessionId,\n @inject(externalTypes.DmkLoggerFactory)\n private dmkLoggerFactory: (tag: string) => LoggerPublisherService,\n @inject(externalTypes.ContextModule)\n private readonly contextModule: ContextModule,\n ) {}\n\n getAppConfiguration(args: {\n skipOpenApp: boolean;\n }): GetAppConfigDAReturnType {\n return this.dmk.executeDeviceAction({\n sessionId: this.sessionId,\n deviceAction: new SendCommandInAppDeviceAction({\n input: {\n command: new GetAppConfigCommand(),\n appName: APP_NAME,\n requiredUserInteraction: UserInteractionRequired.None,\n skipOpenApp: args.skipOpenApp,\n },\n logger: this.dmkLoggerFactory(\"GetAppConfigCommand\"),\n }),\n });\n }\n\n getPublicKey(args: GetPublicKeyCommandArgs): GetPublicKeyDAReturnType {\n return this.dmk.executeDeviceAction({\n sessionId: this.sessionId,\n deviceAction: new SendCommandInAppDeviceAction({\n input: {\n command: new GetPublicKeyCommand(args),\n appName: APP_NAME,\n requiredUserInteraction: args.checkOnDevice\n ? UserInteractionRequired.VerifyAddress\n : UserInteractionRequired.None,\n skipOpenApp: args.skipOpenApp,\n },\n logger: this.dmkLoggerFactory(\"GetPublicKeyCommand\"),\n }),\n });\n }\n\n signTransaction(args: {\n derivationPath: string;\n transaction: Uint8Array;\n skipOpenApp?: boolean;\n }): SignTransactionDAReturnType {\n return this.dmk.executeDeviceAction({\n sessionId: this.sessionId,\n deviceAction: new CallTaskInAppDeviceAction({\n input: {\n task: async (internalApi) =>\n createSignTransactionTask(\n internalApi,\n args,\n this.dmkLoggerFactory,\n )(),\n appName: APP_NAME,\n requiredUserInteraction: UserInteractionRequired.SignTransaction,\n skipOpenApp: args.skipOpenApp ?? false,\n },\n logger: this.dmkLoggerFactory(\"SignTransaction\"),\n }),\n });\n }\n\n signCredentialDeploymentTransaction(args: {\n derivationPath: string;\n transaction: Uint8Array;\n skipOpenApp?: boolean;\n }): SignCredentialDeploymentTransactionDAReturnType {\n return this.dmk.executeDeviceAction({\n sessionId: this.sessionId,\n deviceAction: new CallTaskInAppDeviceAction({\n input: {\n task: async (internalApi) =>\n new SendCredentialDeploymentTransactionTask(\n internalApi,\n {\n derivationPath: args.derivationPath,\n transaction: args.transaction,\n },\n this.dmkLoggerFactory(\"SendCredentialDeploymentTransactionTask\"),\n ).run(),\n appName: APP_NAME,\n requiredUserInteraction: UserInteractionRequired.SignTransaction,\n skipOpenApp: args.skipOpenApp ?? false,\n },\n logger: this.dmkLoggerFactory(\"SignCredentialDeploymentTransaction\"),\n }),\n });\n }\n\n verifyAddress(args: {\n derivationPath: string;\n address: string;\n network: AccountOwnershipNetwork;\n skipOpenApp?: boolean;\n }): VerifyAddressDAReturnType {\n return this.dmk.executeDeviceAction({\n sessionId: this.sessionId,\n deviceAction: new CallTaskInAppDeviceAction({\n input: {\n task: async (internalApi) =>\n new VerifyAddressTask(\n internalApi,\n {\n derivationPath: args.derivationPath,\n address: args.address,\n network: args.network,\n contextModule: this.contextModule,\n },\n this.dmkLoggerFactory(\"VerifyAddressTask\"),\n ).run(),\n appName: APP_NAME,\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n skipOpenApp: args.skipOpenApp ?? false,\n },\n logger: this.dmkLoggerFactory(\"VerifyAddress\"),\n }),\n });\n }\n}\n"],
5
- "mappings": "okBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,IAAA,eAAAC,EAAAH,GAIA,IAAAI,EAOO,2CACPC,EAAmC,qBAOnCC,EAAoC,4DACpCC,EAGO,4DACPC,EAAyB,0CACzBC,EAAwD,6EACxDC,EAA0C,gEAC1CC,EAAkC,uDAClCC,EAA8B,mCAGvB,IAAMC,EAAN,KAA0B,CAC/B,YACqCC,EACMC,EAEjCC,EAESC,EACjB,CANmC,SAAAH,EACM,eAAAC,EAEjC,sBAAAC,EAES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H,CAEA,cAAcA,EAKgB,CAC5B,OAAO,KAAK,IAAI,oBAAoB,CAClC,UAAW,KAAK,UAChB,aAAc,IAAI,4BAA0B,CAC1C,MAAO,CACL,KAAM,MAAOC,GACX,IAAI,oBACFA,EACA,CACE,eAAgBD,EAAK,eACrB,QAASA,EAAK,QACd,QAASA,EAAK,QACd,cAAe,KAAK,aACtB,EACA,KAAK,iBAAiB,mBAAmB,CAC3C,EAAE,IAAI,EACR,QAAS,WACT,wBAAyB,0BAAwB,cACjD,YAAaA,EAAK,aAAe,EACnC,EACA,OAAQ,KAAK,iBAAiB,eAAe,CAC/C,CAAC,CACH,CAAC,CACH,CACF,EA5HaL,EAANO,EAAA,IADN,cAAW,EAGPC,EAAA,eAAO,gBAAc,GAAG,GACxBA,EAAA,eAAO,gBAAc,SAAS,GAC9BA,EAAA,eAAO,gBAAc,gBAAgB,GAErCA,EAAA,eAAO,gBAAc,aAAa,IAN1BR",
4
+ "sourcesContent": ["import {\n type AccountOwnershipNetwork,\n type ContextModule,\n} from \"@ledgerhq/context-module\";\nimport {\n CallTaskInAppDeviceAction,\n type DeviceManagementKit,\n type DeviceSessionId,\n LoggerPublisherService,\n SendCommandInAppDeviceAction,\n UserInteractionRequired,\n} from \"@ledgerhq/device-management-kit\";\nimport { inject, injectable } from \"inversify\";\n\nimport { type GetAppConfigDAReturnType } from \"@api/app-binder/GetAppConfigDeviceActionTypes\";\nimport { type GetPublicKeyDAReturnType } from \"@api/app-binder/GetPublicKeyDeviceActionTypes\";\nimport { type SignCredentialDeploymentTransactionDAReturnType } from \"@api/app-binder/SignCredentialDeploymentTransactionDeviceActionTypes\";\nimport { type SignTransactionDAReturnType } from \"@api/app-binder/SignTransactionDeviceActionTypes\";\nimport { type VerifyAddressDAReturnType } from \"@api/app-binder/VerifyAddressDeviceActionTypes\";\nimport { GetAppConfigCommand } from \"@internal/app-binder/command/GetAppConfigCommand\";\nimport {\n GetPublicKeyCommand,\n type GetPublicKeyCommandArgs,\n} from \"@internal/app-binder/command/GetPublicKeyCommand\";\nimport { APP_NAME } from \"@internal/app-binder/constants\";\nimport { SendCredentialDeploymentTransactionTask } from \"@internal/app-binder/task/SendCredentialDeploymentTransactionTask\";\nimport { createSignTransactionTask } from \"@internal/app-binder/task/SignTransactionTaskFactory\";\nimport { VerifyAddressTask } from \"@internal/app-binder/task/VerifyAddressTask\";\nimport { externalTypes } from \"@internal/externalTypes\";\n\n@injectable()\nexport class ConcordiumAppBinder {\n constructor(\n @inject(externalTypes.Dmk) private dmk: DeviceManagementKit,\n @inject(externalTypes.SessionId) private sessionId: DeviceSessionId,\n @inject(externalTypes.DmkLoggerFactory)\n private dmkLoggerFactory: (tag: string) => LoggerPublisherService,\n @inject(externalTypes.ContextModule)\n private readonly contextModule: ContextModule,\n ) {}\n\n getAppConfiguration(args: {\n skipOpenApp: boolean;\n }): GetAppConfigDAReturnType {\n return this.dmk.executeDeviceAction({\n sessionId: this.sessionId,\n deviceAction: new SendCommandInAppDeviceAction({\n input: {\n command: new GetAppConfigCommand(),\n appName: APP_NAME,\n requiredUserInteraction: UserInteractionRequired.None,\n skipOpenApp: args.skipOpenApp,\n },\n logger: this.dmkLoggerFactory(\"GetAppConfigCommand\"),\n }),\n });\n }\n\n getPublicKey(args: GetPublicKeyCommandArgs): GetPublicKeyDAReturnType {\n return this.dmk.executeDeviceAction({\n sessionId: this.sessionId,\n deviceAction: new SendCommandInAppDeviceAction({\n input: {\n command: new GetPublicKeyCommand(args),\n appName: APP_NAME,\n requiredUserInteraction: args.checkOnDevice\n ? UserInteractionRequired.VerifyAddress\n : UserInteractionRequired.None,\n skipOpenApp: args.skipOpenApp,\n },\n logger: this.dmkLoggerFactory(\"GetPublicKeyCommand\"),\n }),\n });\n }\n\n signTransaction(args: {\n derivationPath: string;\n transaction: Uint8Array;\n maxFee: bigint;\n skipOpenApp?: boolean;\n }): SignTransactionDAReturnType {\n return this.dmk.executeDeviceAction({\n sessionId: this.sessionId,\n deviceAction: new CallTaskInAppDeviceAction({\n input: {\n task: async (internalApi) =>\n createSignTransactionTask(\n internalApi,\n args,\n this.dmkLoggerFactory,\n )(),\n appName: APP_NAME,\n requiredUserInteraction: UserInteractionRequired.SignTransaction,\n skipOpenApp: args.skipOpenApp ?? false,\n },\n logger: this.dmkLoggerFactory(\"SignTransaction\"),\n }),\n });\n }\n\n signCredentialDeploymentTransaction(args: {\n derivationPath: string;\n transaction: Uint8Array;\n skipOpenApp?: boolean;\n }): SignCredentialDeploymentTransactionDAReturnType {\n return this.dmk.executeDeviceAction({\n sessionId: this.sessionId,\n deviceAction: new CallTaskInAppDeviceAction({\n input: {\n task: async (internalApi) =>\n new SendCredentialDeploymentTransactionTask(\n internalApi,\n {\n derivationPath: args.derivationPath,\n transaction: args.transaction,\n },\n this.dmkLoggerFactory(\"SendCredentialDeploymentTransactionTask\"),\n ).run(),\n appName: APP_NAME,\n requiredUserInteraction: UserInteractionRequired.SignTransaction,\n skipOpenApp: args.skipOpenApp ?? false,\n },\n logger: this.dmkLoggerFactory(\"SignCredentialDeploymentTransaction\"),\n }),\n });\n }\n\n verifyAddress(args: {\n derivationPath: string;\n address: string;\n network: AccountOwnershipNetwork;\n skipOpenApp?: boolean;\n }): VerifyAddressDAReturnType {\n return this.dmk.executeDeviceAction({\n sessionId: this.sessionId,\n deviceAction: new CallTaskInAppDeviceAction({\n input: {\n task: async (internalApi) =>\n new VerifyAddressTask(\n internalApi,\n {\n derivationPath: args.derivationPath,\n address: args.address,\n network: args.network,\n contextModule: this.contextModule,\n },\n this.dmkLoggerFactory(\"VerifyAddressTask\"),\n ).run(),\n appName: APP_NAME,\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n skipOpenApp: args.skipOpenApp ?? false,\n },\n logger: this.dmkLoggerFactory(\"VerifyAddress\"),\n }),\n });\n }\n}\n"],
5
+ "mappings": "okBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,IAAA,eAAAC,EAAAH,GAIA,IAAAI,EAOO,2CACPC,E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I,0CACFA,EACA,CACE,eAAgBD,EAAK,eACrB,YAAaA,EAAK,WACpB,EACA,KAAK,iBAAiB,yCAAyC,CACjE,EAAE,IAAI,EACR,QAAS,WACT,wBAAyB,0BAAwB,gBACjD,YAAaA,EAAK,aAAe,EACnC,EACA,OAAQ,KAAK,iBAAiB,qCAAqC,CACrE,CAAC,CACH,CAAC,CACH,CAEA,cAAcA,EAKgB,CAC5B,OAAO,KAAK,IAAI,oBAAoB,CAClC,UAAW,KAAK,UAChB,aAAc,IAAI,4BAA0B,CAC1C,MAAO,CACL,KAAM,MAAOC,GACX,IAAI,oBACFA,EACA,CACE,eAAgBD,EAAK,eACrB,QAASA,EAAK,QACd,QAASA,EAAK,QACd,cAAe,KAAK,aACtB,EACA,KAAK,iBAAiB,mBAAmB,CAC3C,EAAE,IAAI,EACR,QAAS,WACT,wBAAyB,0BAAwB,cACjD,YAAaA,EAAK,aAAe,EACnC,EACA,OAAQ,KAAK,iBAAiB,eAAe,CAC/C,CAAC,CACH,CAAC,CACH,CACF,EA7HaL,EAANO,EAAA,IADN,cAAW,EAGPC,EAAA,eAAO,gBAAc,GAAG,GACxBA,EAAA,eAAO,gBAAc,SAAS,GAC9BA,EAAA,eAAO,gBAAc,gBAAgB,GAErCA,EAAA,eAAO,gBAAc,aAAa,IAN1BR",
6
6
  "names": ["ConcordiumAppBinder_exports", "__export", "ConcordiumAppBinder", "__toCommonJS", "import_device_management_kit", "import_inversify", "import_GetAppConfigCommand", "import_GetPublicKeyCommand", "import_constants", "import_SendCredentialDeploymentTransactionTask", "import_SignTransactionTaskFactory", "import_VerifyAddressTask", "import_externalTypes", "ConcordiumAppBinder", "dmk", "sessionId", "dmkLoggerFactory", "contextModule", "args", "internalApi", "__decorateClass", "__decorateParam"]
7
7
  }
@@ -0,0 +1,2 @@
1
+ "use strict";var s=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var C=(e,r)=>{for(var o in r)s(e,o,{get:r[o],enumerable:!0})},y=(e,r,o,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of u(r))!g.call(e,n)&&n!==o&&s(e,n,{get:()=>r[n],enumerable:!(a=l(r,n))||a.enumerable});return e};var c=e=>y(s({},"__esModule",{value:!0}),e);var A={};C(A,{SignPltCommand:()=>S});module.exports=c(A);var t=require("@ledgerhq/device-management-kit"),p=require("@ledgerhq/signer-utils"),i=require("purify-ts"),m=require("../../app-binder/command/utils/ConcordiumApplicationErrors"),d=require("../../app-binder/constants");class S{name="SignPlt";args;errorHelper=new p.CommandErrorHelper(m.CONCORDIUM_APP_ERRORS,m.ConcordiumAppCommandErrorFactory);constructor(r){this.args=r}getApdu(){const r=new t.ApduBuilder({cla:d.LEDGER_CLA,ins:d.INS.SIGN_PLT,p1:this.args.p1,p2:this.args.p2});return r.addBufferToData(this.args.data),r.build()}parseResponse(r){return i.Maybe.fromNullable(this.errorHelper.getError(r)).orDefaultLazy(()=>{const o=new t.ApduParser(r),a=o.getUnparsedRemainingLength(),n=o.extractFieldByLength(a);return(0,t.CommandResultFactory)({data:n})})}}0&&(module.exports={SignPltCommand});
2
+ //# sourceMappingURL=SignPltCommand.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/internal/app-binder/command/SignPltCommand.ts"],
4
+ "sourcesContent": ["import {\n type Apdu,\n ApduBuilder,\n ApduParser,\n type ApduResponse,\n type Command,\n type CommandResult,\n CommandResultFactory,\n} from \"@ledgerhq/device-management-kit\";\nimport { CommandErrorHelper } from \"@ledgerhq/signer-utils\";\nimport { Maybe } from \"purify-ts\";\n\nimport { type Signature } from \"@api/model/Signature\";\nimport {\n CONCORDIUM_APP_ERRORS,\n ConcordiumAppCommandErrorFactory,\n type ConcordiumErrorCodes,\n} from \"@internal/app-binder/command/utils/ConcordiumApplicationErrors\";\nimport { INS, LEDGER_CLA } from \"@internal/app-binder/constants\";\n\nexport type SignPltCommandArgs = {\n readonly p1: number;\n readonly p2: number;\n readonly data: Uint8Array;\n};\n\n/**\n * Empty for the INIT frame and every intermediate CONT frame; the 64-byte\n * Ed25519 signature on the final CONT frame.\n */\nexport type SignPltCommandResponse = Signature;\n\n/**\n * PLT (Protocol Level Token) signing, INS 0x27.\n *\n * P2 selects fee display on the INIT frame: `0x00` sends no fee, `0x01` appends\n * an 8-byte big-endian \u00B5CCD suffix and the device renders a \"Max fees\" step.\n * A CONT frame must use `0x00`, and returns 0x6B00 otherwise, so the caller\n * chooses P2 per frame rather than reusing one value for the whole flow.\n */\nexport class SignPltCommand\n implements\n Command<SignPltCommandResponse, SignPltCommandArgs, ConcordiumErrorCodes>\n{\n readonly name = \"SignPlt\";\n\n private readonly args: SignPltCommandArgs;\n\n private readonly errorHelper = new CommandErrorHelper<\n SignPltCommandResponse,\n ConcordiumErrorCodes\n >(CONCORDIUM_APP_ERRORS, ConcordiumAppCommandErrorFactory);\n\n constructor(args: SignPltCommandArgs) {\n this.args = args;\n }\n\n getApdu(): Apdu {\n const apduBuilder = new ApduBuilder({\n cla: LEDGER_CLA,\n ins: INS.SIGN_PLT,\n p1: this.args.p1,\n p2: this.args.p2,\n });\n\n apduBuilder.addBufferToData(this.args.data);\n\n return apduBuilder.build();\n }\n\n parseResponse(\n apduResponse: ApduResponse,\n ): CommandResult<SignPltCommandResponse, ConcordiumErrorCodes> {\n return Maybe.fromNullable(\n this.errorHelper.getError(apduResponse),\n ).orDefaultLazy(() => {\n const apduParser = new ApduParser(apduResponse);\n const remaining = apduParser.getUnparsedRemainingLength();\n const signature = apduParser.extractFieldByLength(remaining);\n\n return CommandResultFactory({\n data: signature as Signature,\n });\n });\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAQO,2CACPC,EAAmC,kCACnCC,EAAsB,qBAGtBC,EAIO,0EACPC,EAAgC,0CAsBzB,MAAMN,CAGb,CACW,KAAO,UAEC,KAEA,YAAc,IAAI,qBAGjC,wBAAuB,kCAAgC,EAEzD,YAAYO,EAA0B,CACpC,KAAK,KAAOA,CACd,CAEA,SAAgB,CACd,MAAMC,EAAc,IAAI,cAAY,CAClC,IAAK,aACL,IAAK,MAAI,SACT,GAAI,KAAK,KAAK,GACd,GAAI,KAAK,KAAK,EAChB,CAAC,EAED,OAAAA,EAAY,gBAAgB,KAAK,KAAK,IAAI,EAEnCA,EAAY,MAAM,CAC3B,CAEA,cACEC,EAC6D,CAC7D,OAAO,QAAM,aACX,KAAK,YAAY,SAASA,CAAY,CACxC,EAAE,cAAc,IAAM,CACpB,MAAMC,EAAa,IAAI,aAAWD,CAAY,EACxCE,EAAYD,EAAW,2BAA2B,EAClDE,EAAYF,EAAW,qBAAqBC,CAAS,EAE3D,SAAO,wBAAqB,CAC1B,KAAMC,CACR,CAAC,CACH,CAAC,CACH,CACF",
6
+ "names": ["SignPltCommand_exports", "__export", "SignPltCommand", "__toCommonJS", "import_device_management_kit", "import_signer_utils", "import_purify_ts", "import_ConcordiumApplicationErrors", "import_constants", "args", "apduBuilder", "apduResponse", "apduParser", "remaining", "signature"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var o=require("@ledgerhq/device-management-kit"),a=require("../../app-binder/command/SignPltCommand"),n=require("../../app-binder/command/utils/ConcordiumApplicationErrors"),e=require("../../app-binder/constants");const i=new Uint8Array([144,0]);function c(r,t=new Uint8Array){return new o.ApduResponse({statusCode:r,data:t})}describe("SignPltCommand",()=>{describe("getApdu",()=>{it("should build the INIT frame with INS=0x27, P1=0x00 and P2=0x00",()=>{const t=new a.SignPltCommand({p1:e.P1.PLT_INIT,p2:e.P2.NONE,data:new Uint8Array(80).fill(1)}).getApdu().getRawApdu();expect(t[0]).toBe(e.LEDGER_CLA),expect(t[1]).toBe(e.INS.SIGN_PLT),expect(t[2]).toBe(e.P1.PLT_INIT),expect(t[3]).toBe(e.P2.NONE),expect(t[4]).toBe(80)}),it("should build the CONT frame with P1=0x01",()=>{const t=new a.SignPltCommand({p1:e.P1.PLT_CONT,p2:e.P2.NONE,data:new Uint8Array(9).fill(204)}).getApdu().getRawApdu();expect(t[1]).toBe(e.INS.SIGN_PLT),expect(t[2]).toBe(e.P1.PLT_CONT),expect(t[3]).toBe(e.P2.NONE)}),it("should forward P2 to the APDU rather than pinning it",()=>{const r=t=>new a.SignPltCommand({p1:e.P1.PLT_INIT,p2:t,data:new Uint8Array(4)}).getApdu().getRawApdu()[3];expect(r(e.P2.NONE)).toBe(0),expect(r(e.P2.FEE_DISPLAY)).toBe(1)}),it("should include the data in the APDU payload",()=>{const r=new Uint8Array([222,173,190,239]),d=new a.SignPltCommand({p1:e.P1.PLT_CONT,p2:e.P2.NONE,data:r}).getApdu().getRawApdu();expect(d.slice(5)).toStrictEqual(r)})}),describe("parseResponse",()=>{it("should return an empty signature for INIT and intermediate CONT frames",()=>{const t=new a.SignPltCommand({p1:e.P1.PLT_INIT,p2:e.P2.NONE,data:new Uint8Array(4)}).parseResponse(c(i));expect((0,o.isSuccessCommandResult)(t)).toBe(!0),(0,o.isSuccessCommandResult)(t)&&expect(t.data).toStrictEqual(new Uint8Array)}),it("should extract the 64-byte signature from the final CONT frame",()=>{const r=new a.SignPltCommand({p1:e.P1.PLT_CONT,p2:e.P2.NONE,data:new Uint8Array(9)}),t=new Uint8Array(64).fill(171),d=r.parseResponse(c(i,t));expect((0,o.isSuccessCommandResult)(d)).toBe(!0),(0,o.isSuccessCommandResult)(d)&&expect(d.data).toStrictEqual(t)}),it.each([[[105,133],n.ConcordiumErrorCodes.USER_REJECTED],[[85,21],n.ConcordiumErrorCodes.LOCKED_DEVICE],[[106,128],n.ConcordiumErrorCodes.DATA_INVALID],[[107,0],n.ConcordiumErrorCodes.WRONG_P1_P2],[[107,1],n.ConcordiumErrorCodes.INVALID_STATE],[[107,2],n.ConcordiumErrorCodes.INVALID_PATH],[[107,3],n.ConcordiumErrorCodes.INVALID_PARAM],[[107,4],n.ConcordiumErrorCodes.INVALID_TRANSACTION],[[107,6],n.ConcordiumErrorCodes.BUFFER_OVERFLOW],[[107,7],n.ConcordiumErrorCodes.FAILED_CX_OPERATION],[[107,13],n.ConcordiumErrorCodes.PLT_CBOR_ERROR],[[107,14],n.ConcordiumErrorCodes.PLT_BUFFER_ERROR],[[107,15],n.ConcordiumErrorCodes.PLT_DATA_ERROR],[[107,16],n.ConcordiumErrorCodes.PLT_MULTI_OP]])("should map status word %s to a typed error",(r,t)=>{const p=new a.SignPltCommand({p1:e.P1.PLT_CONT,p2:e.P2.NONE,data:new Uint8Array(4)}).parseResponse(c(new Uint8Array(r)));expect((0,o.isSuccessCommandResult)(p)).toBe(!1),(0,o.isSuccessCommandResult)(p)||expect(p.error.errorCode).toStrictEqual(t)})})});
2
+ //# sourceMappingURL=SignPltCommand.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/internal/app-binder/command/SignPltCommand.test.ts"],
4
+ "sourcesContent": ["import {\n ApduResponse,\n isSuccessCommandResult,\n} from \"@ledgerhq/device-management-kit\";\n\nimport { SignPltCommand } from \"@internal/app-binder/command/SignPltCommand\";\nimport {\n type ConcordiumAppCommandError,\n ConcordiumErrorCodes,\n} from \"@internal/app-binder/command/utils/ConcordiumApplicationErrors\";\nimport { INS, LEDGER_CLA, P1, P2 } from \"@internal/app-binder/constants\";\n\nconst SUCCESS = new Uint8Array([0x90, 0x00]);\n\nfunction buildResponse(statusCode: Uint8Array, data = new Uint8Array()) {\n return new ApduResponse({ statusCode, data });\n}\n\ndescribe(\"SignPltCommand\", () => {\n describe(\"getApdu\", () => {\n it(\"should build the INIT frame with INS=0x27, P1=0x00 and P2=0x00\", () => {\n const command = new SignPltCommand({\n p1: P1.PLT_INIT,\n p2: P2.NONE,\n data: new Uint8Array(80).fill(0x01),\n });\n\n const raw = command.getApdu().getRawApdu();\n\n expect(raw[0]).toBe(LEDGER_CLA);\n expect(raw[1]).toBe(INS.SIGN_PLT);\n expect(raw[2]).toBe(P1.PLT_INIT);\n expect(raw[3]).toBe(P2.NONE);\n expect(raw[4]).toBe(80);\n });\n\n it(\"should build the CONT frame with P1=0x01\", () => {\n const command = new SignPltCommand({\n p1: P1.PLT_CONT,\n p2: P2.NONE,\n data: new Uint8Array(9).fill(0xcc),\n });\n\n const raw = command.getApdu().getRawApdu();\n\n expect(raw[1]).toBe(INS.SIGN_PLT);\n expect(raw[2]).toBe(P1.PLT_CONT);\n expect(raw[3]).toBe(P2.NONE);\n });\n\n // The command forwards P2 verbatim; choosing it per frame is the caller's\n // job, because the device accepts fee display only on INIT.\n it(\"should forward P2 to the APDU rather than pinning it\", () => {\n const build = (p2: number) =>\n new SignPltCommand({ p1: P1.PLT_INIT, p2, data: new Uint8Array(4) })\n .getApdu()\n .getRawApdu()[3];\n\n expect(build(P2.NONE)).toBe(0x00);\n expect(build(P2.FEE_DISPLAY)).toBe(0x01);\n });\n\n it(\"should include the data in the APDU payload\", () => {\n const data = new Uint8Array([0xde, 0xad, 0xbe, 0xef]);\n const command = new SignPltCommand({\n p1: P1.PLT_CONT,\n p2: P2.NONE,\n data,\n });\n\n const raw = command.getApdu().getRawApdu();\n\n expect(raw.slice(5)).toStrictEqual(data);\n });\n });\n\n describe(\"parseResponse\", () => {\n it(\"should return an empty signature for INIT and intermediate CONT frames\", () => {\n const command = new SignPltCommand({\n p1: P1.PLT_INIT,\n p2: P2.NONE,\n data: new Uint8Array(4),\n });\n\n const result = command.parseResponse(buildResponse(SUCCESS));\n\n expect(isSuccessCommandResult(result)).toBe(true);\n if (isSuccessCommandResult(result)) {\n expect(result.data).toStrictEqual(new Uint8Array());\n }\n });\n\n it(\"should extract the 64-byte signature from the final CONT frame\", () => {\n const command = new SignPltCommand({\n p1: P1.PLT_CONT,\n p2: P2.NONE,\n data: new Uint8Array(9),\n });\n const signature = new Uint8Array(64).fill(0xab);\n\n const result = command.parseResponse(buildResponse(SUCCESS, signature));\n\n expect(isSuccessCommandResult(result)).toBe(true);\n if (isSuccessCommandResult(result)) {\n expect(result.data).toStrictEqual(signature);\n }\n });\n\n it.each([\n [[0x69, 0x85], ConcordiumErrorCodes.USER_REJECTED],\n [[0x55, 0x15], ConcordiumErrorCodes.LOCKED_DEVICE],\n [[0x6a, 0x80], ConcordiumErrorCodes.DATA_INVALID],\n [[0x6b, 0x00], ConcordiumErrorCodes.WRONG_P1_P2],\n [[0x6b, 0x01], ConcordiumErrorCodes.INVALID_STATE],\n [[0x6b, 0x02], ConcordiumErrorCodes.INVALID_PATH],\n [[0x6b, 0x03], ConcordiumErrorCodes.INVALID_PARAM],\n [[0x6b, 0x04], ConcordiumErrorCodes.INVALID_TRANSACTION],\n [[0x6b, 0x06], ConcordiumErrorCodes.BUFFER_OVERFLOW],\n [[0x6b, 0x07], ConcordiumErrorCodes.FAILED_CX_OPERATION],\n [[0x6b, 0x0d], ConcordiumErrorCodes.PLT_CBOR_ERROR],\n [[0x6b, 0x0e], ConcordiumErrorCodes.PLT_BUFFER_ERROR],\n [[0x6b, 0x0f], ConcordiumErrorCodes.PLT_DATA_ERROR],\n [[0x6b, 0x10], ConcordiumErrorCodes.PLT_MULTI_OP],\n ])(\"should map status word %s to a typed error\", (statusCode, expected) => {\n const command = new SignPltCommand({\n p1: P1.PLT_CONT,\n p2: P2.NONE,\n data: new Uint8Array(4),\n });\n\n const result = command.parseResponse(\n buildResponse(new Uint8Array(statusCode)),\n );\n\n expect(isSuccessCommandResult(result)).toBe(false);\n if (!isSuccessCommandResult(result)) {\n expect(\n (result.error as ConcordiumAppCommandError).errorCode,\n ).toStrictEqual(expected);\n }\n });\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAGO,2CAEPC,EAA+B,uDAC/BC,EAGO,0EACPC,EAAwC,0CAExC,MAAMC,EAAU,IAAI,WAAW,CAAC,IAAM,CAAI,CAAC,EAE3C,SAASC,EAAcC,EAAwBC,EAAO,IAAI,WAAc,CACtE,OAAO,IAAI,eAAa,CAAE,WAAA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a,EACjD,CAAC,CAAC,IAAM,CAAI,EAAG,uBAAqB,YAAY,EAChD,CAAC,CAAC,IAAM,CAAI,EAAG,uBAAqB,aAAa,EACjD,CAAC,CAAC,IAAM,CAAI,EAAG,uBAAqB,mBAAmB,EACvD,CAAC,CAAC,IAAM,CAAI,EAAG,uBAAqB,eAAe,EACnD,CAAC,CAAC,IAAM,CAAI,EAAG,uBAAqB,mBAAmB,EACvD,CAAC,CAAC,IAAM,EAAI,EAAG,uBAAqB,cAAc,EAClD,CAAC,CAAC,IAAM,EAAI,EAAG,uBAAqB,gBAAgB,EACpD,CAAC,CAAC,IAAM,EAAI,EAAG,uBAAqB,cAAc,EAClD,CAAC,CAAC,IAAM,EAAI,EAAG,uBAAqB,YAAY,CAClD,CAAC,EAAE,6CAA8C,CAACP,EAAYQ,IAAa,CAOzE,MAAMH,EANU,IAAI,iBAAe,CACjC,GAAI,KAAG,SACP,GAAI,KAAG,KACP,KAAM,IAAI,WAAW,CAAC,CACxB,CAAC,EAEsB,cACrBN,EAAc,IAAI,WAAWC,CAAU,CAAC,CAC1C,EAEA,UAAO,0BAAuBK,CAAM,CAAC,EAAE,KAAK,EAAK,KAC5C,0BAAuBA,CAAM,GAChC,OACGA,EAAO,MAAoC,SAC9C,EAAE,cAAcG,CAAQ,CAE5B,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["import_device_management_kit", "import_SignPltCommand", "import_ConcordiumApplicationErrors", "import_constants", "SUCCESS", "buildResponse", "statusCode", "data", "raw", "build", "p2", "result", "command", "signature", "expected"]
7
+ }
@@ -1,2 +1,2 @@
1
- "use strict";var d=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var l=(e,r)=>{for(var n in r)d(e,n,{get:r[n],enumerable:!0})},f=(e,r,n,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of C(r))!g.call(e,o)&&o!==n&&d(e,o,{get:()=>r[o],enumerable:!(t=u(r,o))||t.enumerable});return e};var y=e=>f(d({},"__esModule",{value:!0}),e);var R={};l(R,{SignTransferCommand:()=>c});module.exports=y(R);var s=require("@ledgerhq/device-management-kit"),i=require("@ledgerhq/signer-utils"),p=require("purify-ts"),m=require("../../app-binder/command/utils/ConcordiumApplicationErrors"),a=require("../../app-binder/constants");class c{name="SignTransfer";args;errorHelper=new i.CommandErrorHelper(m.CONCORDIUM_APP_ERRORS,m.ConcordiumAppCommandErrorFactory);constructor(r){this.args=r}getApdu(){const r=new s.ApduBuilder({cla:a.LEDGER_CLA,ins:a.INS.SIGN_TRANSFER,p1:0,p2:this.args.isLastChunk?a.P2.LAST:a.P2.MORE});return r.addBufferToData(this.args.chunkedData),r.build()}parseResponse(r){return p.Maybe.fromNullable(this.errorHelper.getError(r)).orDefaultLazy(()=>{const n=new s.ApduParser(r),t=n.getUnparsedRemainingLength(),o=n.extractFieldByLength(t);return(0,s.CommandResultFactory)({data:o})})}}0&&(module.exports={SignTransferCommand});
1
+ "use strict";var d=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var l=(e,r)=>{for(var n in r)d(e,n,{get:r[n],enumerable:!0})},f=(e,r,n,m)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of g(r))!C.call(e,o)&&o!==n&&d(e,o,{get:()=>r[o],enumerable:!(m=u(r,o))||m.enumerable});return e};var y=e=>f(d({},"__esModule",{value:!0}),e);var S={};l(S,{SignTransferCommand:()=>R});module.exports=y(S);var a=require("@ledgerhq/device-management-kit"),p=require("@ledgerhq/signer-utils"),i=require("purify-ts"),s=require("../../app-binder/command/utils/ConcordiumApplicationErrors"),t=require("../../app-binder/constants");class R{name="SignTransfer";args;errorHelper=new p.CommandErrorHelper(s.CONCORDIUM_APP_ERRORS,s.ConcordiumAppCommandErrorFactory);constructor(r){this.args=r}getApdu(){const r=new a.ApduBuilder({cla:t.LEDGER_CLA,ins:t.INS.SIGN_TRANSFER,p1:0,p2:this.args.p2});return r.addBufferToData(this.args.data),r.build()}parseResponse(r){return i.Maybe.fromNullable(this.errorHelper.getError(r)).orDefaultLazy(()=>{const n=new a.ApduParser(r),m=n.getUnparsedRemainingLength(),o=n.extractFieldByLength(m);return(0,a.CommandResultFactory)({data:o})})}}0&&(module.exports={SignTransferCommand});
2
2
  //# sourceMappingURL=SignTransferCommand.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/app-binder/command/SignTransferCommand.ts"],
4
- "sourcesContent": ["import {\n type Apdu,\n ApduBuilder,\n ApduParser,\n type ApduResponse,\n type Command,\n type CommandResult,\n CommandResultFactory,\n} from \"@ledgerhq/device-management-kit\";\nimport { CommandErrorHelper } from \"@ledgerhq/signer-utils\";\nimport { Maybe } from \"purify-ts\";\n\nimport { type Signature } from \"@api/model/Signature\";\nimport {\n CONCORDIUM_APP_ERRORS,\n ConcordiumAppCommandErrorFactory,\n type ConcordiumErrorCodes,\n} from \"@internal/app-binder/command/utils/ConcordiumApplicationErrors\";\nimport { INS, LEDGER_CLA, P2 } from \"@internal/app-binder/constants\";\n\nexport type SignTransferCommandArgs = {\n readonly chunkedData: Uint8Array;\n readonly isLastChunk: boolean;\n};\n\nexport type SignTransferCommandResponse = Signature;\n\nexport class SignTransferCommand\n implements\n Command<\n SignTransferCommandResponse,\n SignTransferCommandArgs,\n ConcordiumErrorCodes\n >\n{\n readonly name = \"SignTransfer\";\n\n private readonly args: SignTransferCommandArgs;\n\n private readonly errorHelper = new CommandErrorHelper<\n SignTransferCommandResponse,\n ConcordiumErrorCodes\n >(CONCORDIUM_APP_ERRORS, ConcordiumAppCommandErrorFactory);\n\n constructor(args: SignTransferCommandArgs) {\n this.args = args;\n }\n\n getApdu(): Apdu {\n const apduBuilder = new ApduBuilder({\n cla: LEDGER_CLA,\n ins: INS.SIGN_TRANSFER,\n p1: 0x00,\n p2: this.args.isLastChunk ? P2.LAST : P2.MORE,\n });\n\n apduBuilder.addBufferToData(this.args.chunkedData);\n\n return apduBuilder.build();\n }\n\n parseResponse(\n apduResponse: ApduResponse,\n ): CommandResult<SignTransferCommandResponse, ConcordiumErrorCodes> {\n return Maybe.fromNullable(\n this.errorHelper.getError(apduResponse),\n ).orDefaultLazy(() => {\n const apduParser = new ApduParser(apduResponse);\n const remaining = apduParser.getUnparsedRemainingLength();\n const signature = apduParser.extractFieldByLength(remaining);\n\n return CommandResultFactory({\n data: signature as Signature,\n });\n });\n }\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAQO,2CACPC,EAAmC,kCACnCC,EAAsB,qBAGtBC,EAIO,0EACPC,EAAoC,0CAS7B,MAAMN,CAOb,CACW,KAAO,eAEC,KAEA,YAAc,IAAI,qBAGjC,wBAAuB,kCAAgC,EAEzD,YAAYO,EAA+B,CACzC,KAAK,KAAOA,CACd,CAEA,SAAgB,CACd,MAAMC,EAAc,IAAI,cAAY,CAClC,IAAK,aACL,IAAK,MAAI,cACT,GAAI,EACJ,GAAI,KAAK,KAAK,YAAc,KAAG,KAAO,KAAG,IAC3C,CAAC,EAED,OAAAA,EAAY,gBAAgB,KAAK,KAAK,WAAW,EAE1CA,EAAY,MAAM,CAC3B,CAEA,cACEC,EACkE,CAClE,OAAO,QAAM,aACX,KAAK,YAAY,SAASA,CAAY,CACxC,EAAE,cAAc,IAAM,CACpB,MAAMC,EAAa,IAAI,aAAWD,CAAY,EACxCE,EAAYD,EAAW,2BAA2B,EAClDE,EAAYF,EAAW,qBAAqBC,CAAS,EAE3D,SAAO,wBAAqB,CAC1B,KAAMC,CACR,CAAC,CACH,CAAC,CACH,CACF",
4
+ "sourcesContent": ["import {\n type Apdu,\n ApduBuilder,\n ApduParser,\n type ApduResponse,\n type Command,\n type CommandResult,\n CommandResultFactory,\n} from \"@ledgerhq/device-management-kit\";\nimport { CommandErrorHelper } from \"@ledgerhq/signer-utils\";\nimport { Maybe } from \"purify-ts\";\n\nimport { type Signature } from \"@api/model/Signature\";\nimport {\n CONCORDIUM_APP_ERRORS,\n ConcordiumAppCommandErrorFactory,\n type ConcordiumErrorCodes,\n} from \"@internal/app-binder/command/utils/ConcordiumApplicationErrors\";\nimport { INS, LEDGER_CLA } from \"@internal/app-binder/constants\";\n\nexport type SignTransferCommandArgs = {\n readonly data: Uint8Array;\n readonly p2: number;\n};\n\nexport type SignTransferCommandResponse = Signature;\n\nexport class SignTransferCommand\n implements\n Command<\n SignTransferCommandResponse,\n SignTransferCommandArgs,\n ConcordiumErrorCodes\n >\n{\n readonly name = \"SignTransfer\";\n\n private readonly args: SignTransferCommandArgs;\n\n private readonly errorHelper = new CommandErrorHelper<\n SignTransferCommandResponse,\n ConcordiumErrorCodes\n >(CONCORDIUM_APP_ERRORS, ConcordiumAppCommandErrorFactory);\n\n constructor(args: SignTransferCommandArgs) {\n this.args = args;\n }\n\n getApdu(): Apdu {\n const apduBuilder = new ApduBuilder({\n cla: LEDGER_CLA,\n ins: INS.SIGN_TRANSFER,\n p1: 0x00,\n p2: this.args.p2,\n });\n\n apduBuilder.addBufferToData(this.args.data);\n\n return apduBuilder.build();\n }\n\n parseResponse(\n apduResponse: ApduResponse,\n ): CommandResult<SignTransferCommandResponse, ConcordiumErrorCodes> {\n return Maybe.fromNullable(\n this.errorHelper.getError(apduResponse),\n ).orDefaultLazy(() => {\n const apduParser = new ApduParser(apduResponse);\n const remaining = apduParser.getUnparsedRemainingLength();\n const signature = apduParser.extractFieldByLength(remaining);\n\n return CommandResultFactory({\n data: signature as Signature,\n });\n });\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAQO,2CACPC,EAAmC,kCACnCC,EAAsB,qBAGtBC,EAIO,0EACPC,EAAgC,0CASzB,MAAMN,CAOb,CACW,KAAO,eAEC,KAEA,YAAc,IAAI,qBAGjC,wBAAuB,kCAAgC,EAEzD,YAAYO,EAA+B,CACzC,KAAK,KAAOA,CACd,CAEA,SAAgB,CACd,MAAMC,EAAc,IAAI,cAAY,CAClC,IAAK,aACL,IAAK,MAAI,cACT,GAAI,EACJ,GAAI,KAAK,KAAK,EAChB,CAAC,EAED,OAAAA,EAAY,gBAAgB,KAAK,KAAK,IAAI,EAEnCA,EAAY,MAAM,CAC3B,CAEA,cACEC,EACkE,CAClE,OAAO,QAAM,aACX,KAAK,YAAY,SAASA,CAAY,CACxC,EAAE,cAAc,IAAM,CACpB,MAAMC,EAAa,IAAI,aAAWD,CAAY,EACxCE,EAAYD,EAAW,2BAA2B,EAClDE,EAAYF,EAAW,qBAAqBC,CAAS,EAE3D,SAAO,wBAAqB,CAC1B,KAAMC,CACR,CAAC,CACH,CAAC,CACH,CACF",
6
6
  "names": ["SignTransferCommand_exports", "__export", "SignTransferCommand", "__toCommonJS", "import_device_management_kit", "import_signer_utils", "import_purify_ts", "import_ConcordiumApplicationErrors", "import_constants", "args", "apduBuilder", "apduResponse", "apduParser", "remaining", "signature"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var n=require("@ledgerhq/device-management-kit"),o=require("../../app-binder/command/SignTransferCommand"),c=require("../../app-binder/command/utils/ConcordiumApplicationErrors"),s=require("../../app-binder/constants");describe("SignTransferCommand",()=>{describe("getApdu",()=>{it("should build APDU with P2=MORE when not last chunk",()=>{const e=new o.SignTransferCommand({chunkedData:new Uint8Array(50).fill(1),isLastChunk:!1}).getApdu().getRawApdu();expect(e[0]).toBe(s.LEDGER_CLA),expect(e[1]).toBe(s.INS.SIGN_TRANSFER),expect(e[2]).toBe(0),expect(e[3]).toBe(s.P2.MORE)}),it("should build APDU with P2=LAST when last chunk",()=>{const e=new o.SignTransferCommand({chunkedData:new Uint8Array(50).fill(1),isLastChunk:!0}).getApdu().getRawApdu();expect(e[3]).toBe(s.P2.LAST)}),it("should include chunked data in APDU payload",()=>{const r=new Uint8Array([222,173,190,239]),t=new o.SignTransferCommand({chunkedData:r,isLastChunk:!0}).getApdu().getRawApdu();expect(t.slice(5)).toStrictEqual(r)})}),describe("parseResponse",()=>{it("should extract signature bytes on success",()=>{const r=new o.SignTransferCommand({chunkedData:new Uint8Array(10),isLastChunk:!0}),e=new Uint8Array(64).fill(171),t=new n.ApduResponse({statusCode:new Uint8Array([144,0]),data:e}),a=r.parseResponse(t);expect((0,n.isSuccessCommandResult)(a)).toBe(!0),(0,n.isSuccessCommandResult)(a)&&expect(a.data).toStrictEqual(e)}),it("should return empty data for intermediate chunk response",()=>{const r=new o.SignTransferCommand({chunkedData:new Uint8Array(10),isLastChunk:!1}),e=new n.ApduResponse({statusCode:new Uint8Array([144,0]),data:new Uint8Array([])}),t=r.parseResponse(e);expect((0,n.isSuccessCommandResult)(t)).toBe(!0)}),it("should return ConcordiumAppCommandError on user rejection",()=>{const r=new o.SignTransferCommand({chunkedData:new Uint8Array(10),isLastChunk:!0}),e=new n.ApduResponse({statusCode:new Uint8Array([105,133]),data:new Uint8Array([])}),t=r.parseResponse(e);if(expect((0,n.isSuccessCommandResult)(t)).toBe(!1),!(0,n.isSuccessCommandResult)(t)){const a=t.error;expect(a.errorCode).toBe(c.ConcordiumErrorCodes.USER_REJECTED)}}),it("should return ConcordiumAppCommandError on data invalid",()=>{const r=new o.SignTransferCommand({chunkedData:new Uint8Array(10),isLastChunk:!1}),e=new n.ApduResponse({statusCode:new Uint8Array([106,128]),data:new Uint8Array([])}),t=r.parseResponse(e);if(expect((0,n.isSuccessCommandResult)(t)).toBe(!1),!(0,n.isSuccessCommandResult)(t)){const a=t.error;expect(a.errorCode).toBe(c.ConcordiumErrorCodes.DATA_INVALID)}})})});
1
+ "use strict";var o=require("@ledgerhq/device-management-kit"),s=require("../../app-binder/command/SignTransferCommand"),d=require("../../app-binder/command/utils/ConcordiumApplicationErrors"),t=require("../../app-binder/constants");describe("SignTransferCommand",()=>{describe("getApdu",()=>{it("should build APDU with caller-provided P2=LAST",()=>{const e=new s.SignTransferCommand({data:new Uint8Array(50).fill(1),p2:t.P2.LAST}).getApdu().getRawApdu();expect(e[0]).toBe(t.LEDGER_CLA),expect(e[1]).toBe(t.INS.SIGN_TRANSFER),expect(e[2]).toBe(0),expect(e[3]).toBe(t.P2.LAST)}),it("should build APDU with caller-provided P2=FEE_DISPLAY",()=>{const e=new s.SignTransferCommand({data:new Uint8Array(50).fill(1),p2:t.P2.FEE_DISPLAY}).getApdu().getRawApdu();expect(e[3]).toBe(t.P2.FEE_DISPLAY)}),it("should include data in APDU payload",()=>{const n=new Uint8Array([222,173,190,239]),r=new s.SignTransferCommand({data:n,p2:t.P2.LAST}).getApdu().getRawApdu();expect(r.slice(5)).toStrictEqual(n)})}),describe("parseResponse",()=>{it("should extract signature bytes on success",()=>{const n=new s.SignTransferCommand({data:new Uint8Array(10),p2:t.P2.LAST}),e=new Uint8Array(64).fill(171),r=new o.ApduResponse({statusCode:new Uint8Array([144,0]),data:e}),a=n.parseResponse(r);expect((0,o.isSuccessCommandResult)(a)).toBe(!0),(0,o.isSuccessCommandResult)(a)&&expect(a.data).toStrictEqual(e)}),it("should return ConcordiumAppCommandError on user rejection",()=>{const n=new s.SignTransferCommand({data:new Uint8Array(10),p2:t.P2.LAST}),e=new o.ApduResponse({statusCode:new Uint8Array([105,133]),data:new Uint8Array([])}),r=n.parseResponse(e);if(expect((0,o.isSuccessCommandResult)(r)).toBe(!1),!(0,o.isSuccessCommandResult)(r)){const a=r.error;expect(a.errorCode).toBe(d.ConcordiumErrorCodes.USER_REJECTED)}}),it("should return ConcordiumAppCommandError on data invalid",()=>{const n=new s.SignTransferCommand({data:new Uint8Array(10),p2:t.P2.LAST}),e=new o.ApduResponse({statusCode:new Uint8Array([106,128]),data:new Uint8Array([])}),r=n.parseResponse(e);if(expect((0,o.isSuccessCommandResult)(r)).toBe(!1),!(0,o.isSuccessCommandResult)(r)){const a=r.error;expect(a.errorCode).toBe(d.ConcordiumErrorCodes.DATA_INVALID)}})})});
2
2
  //# sourceMappingURL=SignTransferCommand.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/app-binder/command/SignTransferCommand.test.ts"],
4
- "sourcesContent": ["import {\n ApduResponse,\n isSuccessCommandResult,\n} from \"@ledgerhq/device-management-kit\";\n\nimport { SignTransferCommand } from \"@internal/app-binder/command/SignTransferCommand\";\nimport {\n type ConcordiumAppCommandError,\n ConcordiumErrorCodes,\n} from \"@internal/app-binder/command/utils/ConcordiumApplicationErrors\";\nimport { INS, LEDGER_CLA, P2 } from \"@internal/app-binder/constants\";\n\ndescribe(\"SignTransferCommand\", () => {\n describe(\"getApdu\", () => {\n it(\"should build APDU with P2=MORE when not last chunk\", () => {\n const command = new SignTransferCommand({\n chunkedData: new Uint8Array(50).fill(0x01),\n isLastChunk: false,\n });\n\n const raw = command.getApdu().getRawApdu();\n\n expect(raw[0]).toBe(LEDGER_CLA);\n expect(raw[1]).toBe(INS.SIGN_TRANSFER);\n expect(raw[2]).toBe(0x00);\n expect(raw[3]).toBe(P2.MORE);\n });\n\n it(\"should build APDU with P2=LAST when last chunk\", () => {\n const command = new SignTransferCommand({\n chunkedData: new Uint8Array(50).fill(0x01),\n isLastChunk: true,\n });\n\n const raw = command.getApdu().getRawApdu();\n\n expect(raw[3]).toBe(P2.LAST);\n });\n\n it(\"should include chunked data in APDU payload\", () => {\n const data = new Uint8Array([0xde, 0xad, 0xbe, 0xef]);\n const command = new SignTransferCommand({\n chunkedData: data,\n isLastChunk: true,\n });\n\n const raw = command.getApdu().getRawApdu();\n // Data starts at byte 5\n expect(raw.slice(5)).toStrictEqual(data);\n });\n });\n\n describe(\"parseResponse\", () => {\n it(\"should extract signature bytes on success\", () => {\n const command = new SignTransferCommand({\n chunkedData: new Uint8Array(10),\n isLastChunk: true,\n });\n\n const signature = new Uint8Array(64).fill(0xab);\n const response = new ApduResponse({\n statusCode: new Uint8Array([0x90, 0x00]),\n data: signature,\n });\n\n const result = command.parseResponse(response);\n\n expect(isSuccessCommandResult(result)).toBe(true);\n if (isSuccessCommandResult(result)) {\n expect(result.data).toStrictEqual(signature);\n }\n });\n\n it(\"should return empty data for intermediate chunk response\", () => {\n const command = new SignTransferCommand({\n chunkedData: new Uint8Array(10),\n isLastChunk: false,\n });\n\n const response = new ApduResponse({\n statusCode: new Uint8Array([0x90, 0x00]),\n data: new Uint8Array([]),\n });\n\n const result = command.parseResponse(response);\n\n expect(isSuccessCommandResult(result)).toBe(true);\n });\n\n it(\"should return ConcordiumAppCommandError on user rejection\", () => {\n const command = new SignTransferCommand({\n chunkedData: new Uint8Array(10),\n isLastChunk: true,\n });\n\n const response = new ApduResponse({\n statusCode: new Uint8Array([0x69, 0x85]),\n data: new Uint8Array([]),\n });\n\n const result = command.parseResponse(response);\n\n expect(isSuccessCommandResult(result)).toBe(false);\n if (!isSuccessCommandResult(result)) {\n const err = result.error as ConcordiumAppCommandError;\n expect(err.errorCode).toBe(ConcordiumErrorCodes.USER_REJECTED);\n }\n });\n\n it(\"should return ConcordiumAppCommandError on data invalid\", () => {\n const command = new SignTransferCommand({\n chunkedData: new Uint8Array(10),\n isLastChunk: false,\n });\n\n const response = new ApduResponse({\n statusCode: new Uint8Array([0x6a, 0x80]),\n data: new Uint8Array([]),\n });\n\n const result = command.parseResponse(response);\n\n expect(isSuccessCommandResult(result)).toBe(false);\n if (!isSuccessCommandResult(result)) {\n const err = result.error as ConcordiumAppCommandError;\n expect(err.errorCode).toBe(ConcordiumErrorCodes.DATA_INVALID);\n }\n });\n });\n});\n"],
5
- "mappings": "aAAA,IAAAA,EAGO,2CAEPC,EAAoC,4DACpCC,EAGO,0EACPC,EAAoC,0CAEpC,SAAS,sBAAuB,IAAM,CACpC,SAAS,UAAW,IAAM,CACxB,GAAG,qDAAsD,IAAM,CAM7D,MAAMC,EALU,IAAI,sBAAoB,CACtC,YAAa,IAAI,WAAW,EAAE,EAAE,KAAK,CAAI,EACzC,YAAa,E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CAAC,CACH,CAAC",
6
- "names": ["import_device_management_kit", "import_SignTransferCommand", "import_ConcordiumApplicationErrors", "import_constants", "raw", "data", "command", "signature", "response", "result", "err"]
4
+ "sourcesContent": ["import {\n ApduResponse,\n isSuccessCommandResult,\n} from \"@ledgerhq/device-management-kit\";\n\nimport { SignTransferCommand } from \"@internal/app-binder/command/SignTransferCommand\";\nimport {\n type ConcordiumAppCommandError,\n ConcordiumErrorCodes,\n} from \"@internal/app-binder/command/utils/ConcordiumApplicationErrors\";\nimport { INS, LEDGER_CLA, P2 } from \"@internal/app-binder/constants\";\n\ndescribe(\"SignTransferCommand\", () => {\n describe(\"getApdu\", () => {\n it(\"should build APDU with caller-provided P2=LAST\", () => {\n const command = new SignTransferCommand({\n data: new Uint8Array(50).fill(0x01),\n p2: P2.LAST,\n });\n\n const raw = command.getApdu().getRawApdu();\n\n expect(raw[0]).toBe(LEDGER_CLA);\n expect(raw[1]).toBe(INS.SIGN_TRANSFER);\n expect(raw[2]).toBe(0x00);\n expect(raw[3]).toBe(P2.LAST);\n });\n\n it(\"should build APDU with caller-provided P2=FEE_DISPLAY\", () => {\n const command = new SignTransferCommand({\n data: new Uint8Array(50).fill(0x01),\n p2: P2.FEE_DISPLAY,\n });\n\n const raw = command.getApdu().getRawApdu();\n\n expect(raw[3]).toBe(P2.FEE_DISPLAY);\n });\n\n it(\"should include data in APDU payload\", () => {\n const buf = new Uint8Array([0xde, 0xad, 0xbe, 0xef]);\n const command = new SignTransferCommand({\n data: buf,\n p2: P2.LAST,\n });\n\n const raw = command.getApdu().getRawApdu();\n // Data starts at byte 5\n expect(raw.slice(5)).toStrictEqual(buf);\n });\n });\n\n describe(\"parseResponse\", () => {\n it(\"should extract signature bytes on success\", () => {\n const command = new SignTransferCommand({\n data: new Uint8Array(10),\n p2: P2.LAST,\n });\n\n const signature = new Uint8Array(64).fill(0xab);\n const response = new ApduResponse({\n statusCode: new Uint8Array([0x90, 0x00]),\n data: signature,\n });\n\n const result = command.parseResponse(response);\n\n expect(isSuccessCommandResult(result)).toBe(true);\n if (isSuccessCommandResult(result)) {\n expect(result.data).toStrictEqual(signature);\n }\n });\n\n it(\"should return ConcordiumAppCommandError on user rejection\", () => {\n const command = new SignTransferCommand({\n data: new Uint8Array(10),\n p2: P2.LAST,\n });\n\n const response = new ApduResponse({\n statusCode: new Uint8Array([0x69, 0x85]),\n data: new Uint8Array([]),\n });\n\n const result = command.parseResponse(response);\n\n expect(isSuccessCommandResult(result)).toBe(false);\n if (!isSuccessCommandResult(result)) {\n const err = result.error as ConcordiumAppCommandError;\n expect(err.errorCode).toBe(ConcordiumErrorCodes.USER_REJECTED);\n }\n });\n\n it(\"should return ConcordiumAppCommandError on data invalid\", () => {\n const command = new SignTransferCommand({\n data: new Uint8Array(10),\n p2: P2.LAST,\n });\n\n const response = new ApduResponse({\n statusCode: new Uint8Array([0x6a, 0x80]),\n data: new Uint8Array([]),\n });\n\n const result = command.parseResponse(response);\n\n expect(isSuccessCommandResult(result)).toBe(false);\n if (!isSuccessCommandResult(result)) {\n const err = result.error as ConcordiumAppCommandError;\n expect(err.errorCode).toBe(ConcordiumErrorCodes.DATA_INVALID);\n }\n });\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAGO,2CAEPC,EAAoC,4DACpCC,EAGO,0EACPC,EAAoC,0CAEpC,SAAS,sBAAuB,IAAM,CACpC,SAAS,UAAW,IAAM,CACxB,GAAG,iDAAkD,IAAM,CAMzD,MAAMC,EALU,IAAI,sBAAoB,CACtC,KAAM,IAAI,WAAW,EAAE,EAAE,KAAK,CAAI,EAClC,GAAI,KAAG,IACT,CAAC,EAEmB,QAAQ,EAAE,WAAW,EAEzC,OAAOA,EAAI,CAAC,CAAC,EAAE,KAAK,YAAU,EAC9B,OAAOA,EAAI,CAAC,CAAC,EAAE,KAAK,MAAI,aAAa,EACrC,OAAOA,EAAI,CAAC,CAAC,EAAE,KAAK,CAAI,EACxB,OAAOA,EAAI,CAAC,CAAC,EAAE,KAAK,KA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EAASH,EAAQ,cAAcE,CAAQ,EAG7C,GADA,UAAO,0BAAuBC,CAAM,CAAC,EAAE,KAAK,EAAK,EAC7C,IAAC,0BAAuBA,CAAM,EAAG,CACnC,MAAMC,EAAMD,EAAO,MACnB,OAAOC,EAAI,SAAS,EAAE,KAAK,uBAAqB,aAAa,CAC/D,CACF,CAAC,EAED,GAAG,0DAA2D,IAAM,CAClE,MAAMJ,EAAU,IAAI,sBAAoB,CACtC,KAAM,IAAI,WAAW,EAAE,EACvB,GAAI,KAAG,IACT,CAAC,EAEKE,EAAW,IAAI,eAAa,CAChC,WAAY,IAAI,WAAW,CAAC,IAAM,GAAI,CAAC,EACvC,KAAM,IAAI,WAAW,CAAC,CAAC,CACzB,CAAC,EAEKC,EAASH,EAAQ,cAAcE,CAAQ,EAG7C,GADA,UAAO,0BAAuBC,CAAM,CAAC,EAAE,KAAK,EAAK,EAC7C,IAAC,0BAAuBA,CAAM,EAAG,CACnC,MAAMC,EAAMD,EAAO,MACnB,OAAOC,EAAI,SAAS,EAAE,KAAK,uBAAqB,YAAY,CAC9D,CACF,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["import_device_management_kit", "import_SignTransferCommand", "import_ConcordiumApplicationErrors", "import_constants", "raw", "buf", "command", "signature", "response", "result", "err"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var i=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var l=(e,r)=>{for(var o in r)i(e,o,{get:r[o],enumerable:!0})},f=(e,r,o,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of g(r))!C.call(e,n)&&n!==o&&i(e,n,{get:()=>r[n],enumerable:!(t=u(r,n))||t.enumerable});return e};var y=e=>f(i({},"__esModule",{value:!0}),e);var S={};l(S,{SignTransferWithMemoCommand:()=>R});module.exports=y(S);var a=require("@ledgerhq/device-management-kit"),d=require("@ledgerhq/signer-utils"),p=require("purify-ts"),s=require("../../app-binder/command/utils/ConcordiumApplicationErrors"),m=require("../../app-binder/constants");class R{name="SignTransferWithMemo";args;errorHelper=new d.CommandErrorHelper(s.CONCORDIUM_APP_ERRORS,s.ConcordiumAppCommandErrorFactory);constructor(r){this.args=r}getApdu(){const r=new a.ApduBuilder({cla:m.LEDGER_CLA,ins:m.INS.SIGN_TRANSFER_WITH_MEMO,p1:this.args.p1,p2:m.P2.NONE});return r.addBufferToData(this.args.data),r.build()}parseResponse(r){return p.Maybe.fromNullable(this.errorHelper.getError(r)).orDefaultLazy(()=>{const o=new a.ApduParser(r),t=o.getUnparsedRemainingLength(),n=o.extractFieldByLength(t);return(0,a.CommandResultFactory)({data:n})})}}0&&(module.exports={SignTransferWithMemoCommand});
1
+ "use strict";var i=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var l=(e,r)=>{for(var o in r)i(e,o,{get:r[o],enumerable:!0})},f=(e,r,o,m)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of g(r))!C.call(e,n)&&n!==o&&i(e,n,{get:()=>r[n],enumerable:!(m=u(r,n))||m.enumerable});return e};var y=e=>f(i({},"__esModule",{value:!0}),e);var R={};l(R,{SignTransferWithMemoCommand:()=>h});module.exports=y(R);var a=require("@ledgerhq/device-management-kit"),d=require("@ledgerhq/signer-utils"),p=require("purify-ts"),t=require("../../app-binder/command/utils/ConcordiumApplicationErrors"),s=require("../../app-binder/constants");class h{name="SignTransferWithMemo";args;errorHelper=new d.CommandErrorHelper(t.CONCORDIUM_APP_ERRORS,t.ConcordiumAppCommandErrorFactory);constructor(r){this.args=r}getApdu(){const r=new a.ApduBuilder({cla:s.LEDGER_CLA,ins:s.INS.SIGN_TRANSFER_WITH_MEMO,p1:this.args.p1,p2:this.args.p2});return r.addBufferToData(this.args.data),r.build()}parseResponse(r){return p.Maybe.fromNullable(this.errorHelper.getError(r)).orDefaultLazy(()=>{const o=new a.ApduParser(r),m=o.getUnparsedRemainingLength(),n=o.extractFieldByLength(m);return(0,a.CommandResultFactory)({data:n})})}}0&&(module.exports={SignTransferWithMemoCommand});
2
2
  //# sourceMappingURL=SignTransferWithMemoCommand.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/app-binder/command/SignTransferWithMemoCommand.ts"],
4
- "sourcesContent": ["import {\n type Apdu,\n ApduBuilder,\n ApduParser,\n type ApduResponse,\n type Command,\n type CommandResult,\n CommandResultFactory,\n} from \"@ledgerhq/device-management-kit\";\nimport { CommandErrorHelper } from \"@ledgerhq/signer-utils\";\nimport { Maybe } from \"purify-ts\";\n\nimport { type Signature } from \"@api/model/Signature\";\nimport {\n CONCORDIUM_APP_ERRORS,\n ConcordiumAppCommandErrorFactory,\n type ConcordiumErrorCodes,\n} from \"@internal/app-binder/command/utils/ConcordiumApplicationErrors\";\nimport { INS, LEDGER_CLA, P2 } from \"@internal/app-binder/constants\";\n\nexport type SignTransferWithMemoCommandArgs = {\n readonly p1: number;\n readonly data: Uint8Array;\n};\n\nexport type SignTransferWithMemoCommandResponse = Signature;\n\nexport class SignTransferWithMemoCommand\n implements\n Command<\n SignTransferWithMemoCommandResponse,\n SignTransferWithMemoCommandArgs,\n ConcordiumErrorCodes\n >\n{\n readonly name = \"SignTransferWithMemo\";\n\n private readonly args: SignTransferWithMemoCommandArgs;\n\n private readonly errorHelper = new CommandErrorHelper<\n SignTransferWithMemoCommandResponse,\n ConcordiumErrorCodes\n >(CONCORDIUM_APP_ERRORS, ConcordiumAppCommandErrorFactory);\n\n constructor(args: SignTransferWithMemoCommandArgs) {\n this.args = args;\n }\n\n getApdu(): Apdu {\n const apduBuilder = new ApduBuilder({\n cla: LEDGER_CLA,\n ins: INS.SIGN_TRANSFER_WITH_MEMO,\n p1: this.args.p1,\n p2: P2.NONE,\n });\n\n apduBuilder.addBufferToData(this.args.data);\n\n return apduBuilder.build();\n }\n\n parseResponse(\n apduResponse: ApduResponse,\n ): CommandResult<SignTransferWithMemoCommandResponse, ConcordiumErrorCodes> {\n return Maybe.fromNullable(\n this.errorHelper.getError(apduResponse),\n ).orDefaultLazy(() => {\n const apduParser = new ApduParser(apduResponse);\n const remaining = apduParser.getUnparsedRemainingLength();\n const signature = apduParser.extractFieldByLength(remaining);\n\n return CommandResultFactory({\n data: signature as Signature,\n });\n });\n }\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iCAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAQO,2CACPC,EAAmC,kCACnCC,EAAsB,qBAGtBC,EAIO,0EACPC,EAAoC,0CAS7B,MAAMN,CAOb,CACW,KAAO,uBAEC,KAEA,YAAc,IAAI,qBAGjC,wBAAuB,kCAAgC,EAEzD,YAAYO,EAAuC,CACjD,KAAK,KAAOA,CACd,CAEA,SAAgB,CACd,MAAMC,EAAc,IAAI,cAAY,CAClC,IAAK,aACL,IAAK,MAAI,wBACT,GAAI,KAAK,KAAK,GACd,GAAI,KAAG,IACT,CAAC,EAED,OAAAA,EAAY,gBAAgB,KAAK,KAAK,IAAI,EAEnCA,EAAY,MAAM,CAC3B,CAEA,cACEC,EAC0E,CAC1E,OAAO,QAAM,aACX,KAAK,YAAY,SAASA,CAAY,CACxC,EAAE,cAAc,IAAM,CACpB,MAAMC,EAAa,IAAI,aAAWD,CAAY,EACxCE,EAAYD,EAAW,2BAA2B,EAClDE,EAAYF,EAAW,qBAAqBC,CAAS,EAE3D,SAAO,wBAAqB,CAC1B,KAAMC,CACR,CAAC,CACH,CAAC,CACH,CACF",
4
+ "sourcesContent": ["import {\n type Apdu,\n ApduBuilder,\n ApduParser,\n type ApduResponse,\n type Command,\n type CommandResult,\n CommandResultFactory,\n} from \"@ledgerhq/device-management-kit\";\nimport { CommandErrorHelper } from \"@ledgerhq/signer-utils\";\nimport { Maybe } from \"purify-ts\";\n\nimport { type Signature } from \"@api/model/Signature\";\nimport {\n CONCORDIUM_APP_ERRORS,\n ConcordiumAppCommandErrorFactory,\n type ConcordiumErrorCodes,\n} from \"@internal/app-binder/command/utils/ConcordiumApplicationErrors\";\nimport { INS, LEDGER_CLA } from \"@internal/app-binder/constants\";\n\nexport type SignTransferWithMemoCommandArgs = {\n readonly p1: number;\n readonly p2: number;\n readonly data: Uint8Array;\n};\n\nexport type SignTransferWithMemoCommandResponse = Signature;\n\nexport class SignTransferWithMemoCommand\n implements\n Command<\n SignTransferWithMemoCommandResponse,\n SignTransferWithMemoCommandArgs,\n ConcordiumErrorCodes\n >\n{\n readonly name = \"SignTransferWithMemo\";\n\n private readonly args: SignTransferWithMemoCommandArgs;\n\n private readonly errorHelper = new CommandErrorHelper<\n SignTransferWithMemoCommandResponse,\n ConcordiumErrorCodes\n >(CONCORDIUM_APP_ERRORS, ConcordiumAppCommandErrorFactory);\n\n constructor(args: SignTransferWithMemoCommandArgs) {\n this.args = args;\n }\n\n getApdu(): Apdu {\n const apduBuilder = new ApduBuilder({\n cla: LEDGER_CLA,\n ins: INS.SIGN_TRANSFER_WITH_MEMO,\n p1: this.args.p1,\n p2: this.args.p2,\n });\n\n apduBuilder.addBufferToData(this.args.data);\n\n return apduBuilder.build();\n }\n\n parseResponse(\n apduResponse: ApduResponse,\n ): CommandResult<SignTransferWithMemoCommandResponse, ConcordiumErrorCodes> {\n return Maybe.fromNullable(\n this.errorHelper.getError(apduResponse),\n ).orDefaultLazy(() => {\n const apduParser = new ApduParser(apduResponse);\n const remaining = apduParser.getUnparsedRemainingLength();\n const signature = apduParser.extractFieldByLength(remaining);\n\n return CommandResultFactory({\n data: signature as Signature,\n });\n });\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iCAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAQO,2CACPC,EAAmC,kCACnCC,EAAsB,qBAGtBC,EAIO,0EACPC,EAAgC,0CAUzB,MAAMN,CAOb,CACW,KAAO,uBAEC,KAEA,YAAc,IAAI,qBAGjC,wBAAuB,kCAAgC,EAEzD,YAAYO,EAAuC,CACjD,KAAK,KAAOA,CACd,CAEA,SAAgB,CACd,MAAMC,EAAc,IAAI,cAAY,CAClC,IAAK,aACL,IAAK,MAAI,wBACT,GAAI,KAAK,KAAK,GACd,GAAI,KAAK,KAAK,EAChB,CAAC,EAED,OAAAA,EAAY,gBAAgB,KAAK,KAAK,IAAI,EAEnCA,EAAY,MAAM,CAC3B,CAEA,cACEC,EAC0E,CAC1E,OAAO,QAAM,aACX,KAAK,YAAY,SAASA,CAAY,CACxC,EAAE,cAAc,IAAM,CACpB,MAAMC,EAAa,IAAI,aAAWD,CAAY,EACxCE,EAAYD,EAAW,2BAA2B,EAClDE,EAAYF,EAAW,qBAAqBC,CAAS,EAE3D,SAAO,wBAAqB,CAC1B,KAAMC,CACR,CAAC,CACH,CAAC,CACH,CACF",
6
6
  "names": ["SignTransferWithMemoCommand_exports", "__export", "SignTransferWithMemoCommand", "__toCommonJS", "import_device_management_kit", "import_signer_utils", "import_purify_ts", "import_ConcordiumApplicationErrors", "import_constants", "args", "apduBuilder", "apduResponse", "apduParser", "remaining", "signature"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var r=require("@ledgerhq/device-management-kit"),a=require("../../app-binder/command/SignTransferWithMemoCommand"),d=require("../../app-binder/command/utils/ConcordiumApplicationErrors"),t=require("../../app-binder/constants");describe("SignTransferWithMemoCommand",()=>{describe("getApdu",()=>{it("should build APDU with INS=SIGN_TRANSFER_WITH_MEMO and given P1",()=>{const e=new a.SignTransferWithMemoCommand({p1:t.P1.INITIAL_WITH_MEMO,data:new Uint8Array(50).fill(1)}).getApdu().getRawApdu();expect(e[0]).toBe(t.LEDGER_CLA),expect(e[1]).toBe(t.INS.SIGN_TRANSFER_WITH_MEMO),expect(e[2]).toBe(t.P1.INITIAL_WITH_MEMO),expect(e[3]).toBe(t.P2.NONE)}),it("should use P1=MEMO for memo chunks",()=>{const e=new a.SignTransferWithMemoCommand({p1:t.P1.MEMO,data:new Uint8Array(100).fill(204)}).getApdu().getRawApdu();expect(e[2]).toBe(t.P1.MEMO)}),it("should use P1=AMOUNT for final amount step",()=>{const e=new a.SignTransferWithMemoCommand({p1:t.P1.AMOUNT,data:new Uint8Array(8).fill(0)}).getApdu().getRawApdu();expect(e[2]).toBe(t.P1.AMOUNT)}),it("should include data in APDU payload",()=>{const n=new Uint8Array([222,173,190,239]),o=new a.SignTransferWithMemoCommand({p1:t.P1.MEMO,data:n}).getApdu().getRawApdu();expect(o.slice(5)).toStrictEqual(n)})}),describe("parseResponse",()=>{it("should extract signature bytes on success",()=>{const n=new a.SignTransferWithMemoCommand({p1:t.P1.AMOUNT,data:new Uint8Array(8)}),e=new Uint8Array(64).fill(171),o=new r.ApduResponse({statusCode:new Uint8Array([144,0]),data:e}),s=n.parseResponse(o);expect((0,r.isSuccessCommandResult)(s)).toBe(!0),(0,r.isSuccessCommandResult)(s)&&expect(s.data).toStrictEqual(e)}),it("should return empty data for intermediate step response",()=>{const n=new a.SignTransferWithMemoCommand({p1:t.P1.INITIAL_WITH_MEMO,data:new Uint8Array(50)}),e=new r.ApduResponse({statusCode:new Uint8Array([144,0]),data:new Uint8Array([])}),o=n.parseResponse(e);expect((0,r.isSuccessCommandResult)(o)).toBe(!0)}),it("should return ConcordiumAppCommandError on user rejection",()=>{const n=new a.SignTransferWithMemoCommand({p1:t.P1.AMOUNT,data:new Uint8Array(8)}),e=new r.ApduResponse({statusCode:new Uint8Array([105,133]),data:new Uint8Array([])}),o=n.parseResponse(e);if(expect((0,r.isSuccessCommandResult)(o)).toBe(!1),!(0,r.isSuccessCommandResult)(o)){const s=o.error;expect(s.errorCode).toBe(d.ConcordiumErrorCodes.USER_REJECTED)}}),it("should return ConcordiumAppCommandError on data invalid",()=>{const n=new a.SignTransferWithMemoCommand({p1:t.P1.MEMO,data:new Uint8Array(10)}),e=new r.ApduResponse({statusCode:new Uint8Array([106,128]),data:new Uint8Array([])}),o=n.parseResponse(e);if(expect((0,r.isSuccessCommandResult)(o)).toBe(!1),!(0,r.isSuccessCommandResult)(o)){const s=o.error;expect(s.errorCode).toBe(d.ConcordiumErrorCodes.DATA_INVALID)}})})});
1
+ "use strict";var r=require("@ledgerhq/device-management-kit"),a=require("../../app-binder/command/SignTransferWithMemoCommand"),d=require("../../app-binder/command/utils/ConcordiumApplicationErrors"),e=require("../../app-binder/constants");describe("SignTransferWithMemoCommand",()=>{describe("getApdu",()=>{it("should build APDU with INS=SIGN_TRANSFER_WITH_MEMO and given P1",()=>{const t=new a.SignTransferWithMemoCommand({p1:e.P1.INITIAL_WITH_MEMO,p2:e.P2.NONE,data:new Uint8Array(50).fill(1)}).getApdu().getRawApdu();expect(t[0]).toBe(e.LEDGER_CLA),expect(t[1]).toBe(e.INS.SIGN_TRANSFER_WITH_MEMO),expect(t[2]).toBe(e.P1.INITIAL_WITH_MEMO),expect(t[3]).toBe(e.P2.NONE)}),it("should use P1=MEMO for memo chunks",()=>{const t=new a.SignTransferWithMemoCommand({p1:e.P1.MEMO,p2:e.P2.NONE,data:new Uint8Array(100).fill(204)}).getApdu().getRawApdu();expect(t[2]).toBe(e.P1.MEMO)}),it("should use P1=AMOUNT for final amount step",()=>{const t=new a.SignTransferWithMemoCommand({p1:e.P1.AMOUNT,p2:e.P2.NONE,data:new Uint8Array(8).fill(0)}).getApdu().getRawApdu();expect(t[2]).toBe(e.P1.AMOUNT)}),it("should include data in APDU payload",()=>{const n=new Uint8Array([222,173,190,239]),o=new a.SignTransferWithMemoCommand({p1:e.P1.MEMO,p2:e.P2.NONE,data:n}).getApdu().getRawApdu();expect(o.slice(5)).toStrictEqual(n)})}),describe("parseResponse",()=>{it("should extract signature bytes on success",()=>{const n=new a.SignTransferWithMemoCommand({p1:e.P1.AMOUNT,p2:e.P2.NONE,data:new Uint8Array(8)}),t=new Uint8Array(64).fill(171),o=new r.ApduResponse({statusCode:new Uint8Array([144,0]),data:t}),s=n.parseResponse(o);expect((0,r.isSuccessCommandResult)(s)).toBe(!0),(0,r.isSuccessCommandResult)(s)&&expect(s.data).toStrictEqual(t)}),it("should return empty data for intermediate step response",()=>{const n=new a.SignTransferWithMemoCommand({p1:e.P1.INITIAL_WITH_MEMO,p2:e.P2.NONE,data:new Uint8Array(50)}),t=new r.ApduResponse({statusCode:new Uint8Array([144,0]),data:new Uint8Array([])}),o=n.parseResponse(t);expect((0,r.isSuccessCommandResult)(o)).toBe(!0)}),it("should return ConcordiumAppCommandError on user rejection",()=>{const n=new a.SignTransferWithMemoCommand({p1:e.P1.AMOUNT,p2:e.P2.NONE,data:new Uint8Array(8)}),t=new r.ApduResponse({statusCode:new Uint8Array([105,133]),data:new Uint8Array([])}),o=n.parseResponse(t);if(expect((0,r.isSuccessCommandResult)(o)).toBe(!1),!(0,r.isSuccessCommandResult)(o)){const s=o.error;expect(s.errorCode).toBe(d.ConcordiumErrorCodes.USER_REJECTED)}}),it("should return ConcordiumAppCommandError on data invalid",()=>{const n=new a.SignTransferWithMemoCommand({p1:e.P1.MEMO,p2:e.P2.NONE,data:new Uint8Array(10)}),t=new r.ApduResponse({statusCode:new Uint8Array([106,128]),data:new Uint8Array([])}),o=n.parseResponse(t);if(expect((0,r.isSuccessCommandResult)(o)).toBe(!1),!(0,r.isSuccessCommandResult)(o)){const s=o.error;expect(s.errorCode).toBe(d.ConcordiumErrorCodes.DATA_INVALID)}})})});
2
2
  //# sourceMappingURL=SignTransferWithMemoCommand.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/app-binder/command/SignTransferWithMemoCommand.test.ts"],
4
- "sourcesContent": ["import {\n ApduResponse,\n isSuccessCommandResult,\n} from \"@ledgerhq/device-management-kit\";\n\nimport { SignTransferWithMemoCommand } from \"@internal/app-binder/command/SignTransferWithMemoCommand\";\nimport {\n type ConcordiumAppCommandError,\n ConcordiumErrorCodes,\n} from \"@internal/app-binder/command/utils/ConcordiumApplicationErrors\";\nimport { INS, LEDGER_CLA, P1, P2 } from \"@internal/app-binder/constants\";\n\ndescribe(\"SignTransferWithMemoCommand\", () => {\n describe(\"getApdu\", () => {\n it(\"should build APDU with INS=SIGN_TRANSFER_WITH_MEMO and given P1\", () => {\n const command = new SignTransferWithMemoCommand({\n p1: P1.INITIAL_WITH_MEMO,\n data: new Uint8Array(50).fill(0x01),\n });\n\n const raw = command.getApdu().getRawApdu();\n\n expect(raw[0]).toBe(LEDGER_CLA);\n expect(raw[1]).toBe(INS.SIGN_TRANSFER_WITH_MEMO);\n expect(raw[2]).toBe(P1.INITIAL_WITH_MEMO);\n expect(raw[3]).toBe(P2.NONE);\n });\n\n it(\"should use P1=MEMO for memo chunks\", () => {\n const command = new SignTransferWithMemoCommand({\n p1: P1.MEMO,\n data: new Uint8Array(100).fill(0xcc),\n });\n\n const raw = command.getApdu().getRawApdu();\n\n expect(raw[2]).toBe(P1.MEMO);\n });\n\n it(\"should use P1=AMOUNT for final amount step\", () => {\n const command = new SignTransferWithMemoCommand({\n p1: P1.AMOUNT,\n data: new Uint8Array(8).fill(0x00),\n });\n\n const raw = command.getApdu().getRawApdu();\n\n expect(raw[2]).toBe(P1.AMOUNT);\n });\n\n it(\"should include data in APDU payload\", () => {\n const data = new Uint8Array([0xde, 0xad, 0xbe, 0xef]);\n const command = new SignTransferWithMemoCommand({\n p1: P1.MEMO,\n data,\n });\n\n const raw = command.getApdu().getRawApdu();\n\n expect(raw.slice(5)).toStrictEqual(data);\n });\n });\n\n describe(\"parseResponse\", () => {\n it(\"should extract signature bytes on success\", () => {\n const command = new SignTransferWithMemoCommand({\n p1: P1.AMOUNT,\n data: new Uint8Array(8),\n });\n\n const signature = new Uint8Array(64).fill(0xab);\n const response = new ApduResponse({\n statusCode: new Uint8Array([0x90, 0x00]),\n data: signature,\n });\n\n const result = command.parseResponse(response);\n\n expect(isSuccessCommandResult(result)).toBe(true);\n if (isSuccessCommandResult(result)) {\n expect(result.data).toStrictEqual(signature);\n }\n });\n\n it(\"should return empty data for intermediate step response\", () => {\n const command = new SignTransferWithMemoCommand({\n p1: P1.INITIAL_WITH_MEMO,\n data: new Uint8Array(50),\n });\n\n const response = new ApduResponse({\n statusCode: new Uint8Array([0x90, 0x00]),\n data: new Uint8Array([]),\n });\n\n const result = command.parseResponse(response);\n\n expect(isSuccessCommandResult(result)).toBe(true);\n });\n\n it(\"should return ConcordiumAppCommandError on user rejection\", () => {\n const command = new SignTransferWithMemoCommand({\n p1: P1.AMOUNT,\n data: new Uint8Array(8),\n });\n\n const response = new ApduResponse({\n statusCode: new Uint8Array([0x69, 0x85]),\n data: new Uint8Array([]),\n });\n\n const result = command.parseResponse(response);\n\n expect(isSuccessCommandResult(result)).toBe(false);\n if (!isSuccessCommandResult(result)) {\n const err = result.error as ConcordiumAppCommandError;\n expect(err.errorCode).toBe(ConcordiumErrorCodes.USER_REJECTED);\n }\n });\n\n it(\"should return ConcordiumAppCommandError on data invalid\", () => {\n const command = new SignTransferWithMemoCommand({\n p1: P1.MEMO,\n data: new Uint8Array(10),\n });\n\n const response = new ApduResponse({\n statusCode: new Uint8Array([0x6a, 0x80]),\n data: new Uint8Array([]),\n });\n\n const result = command.parseResponse(response);\n\n expect(isSuccessCommandResult(result)).toBe(false);\n if (!isSuccessCommandResult(result)) {\n const err = result.error as ConcordiumAppCommandError;\n expect(err.errorCode).toBe(ConcordiumErrorCodes.DATA_INVALID);\n }\n });\n });\n});\n"],
5
- "mappings": "aAAA,IAAAA,EAGO,2CAEPC,EAA4C,oEAC5CC,EAGO,0EACPC,EAAwC,0CAExC,SAAS,8BAA+B,IAAM,CAC5C,SAAS,UAAW,IAAM,CACxB,GAAG,kEAAmE,IAAM,CAM1E,MAAMC,EALU,IAAI,8BAA4B,CAC9C,GAAI,KAAG,kBACP,KAAM,IAAI,WAAW,EAAE,EAAE,KAAK,CAAI,CACpC,CAAC,EAEmB,QAAQ,EAAE,WAAW,EAEzC,OAAOA,EAAI,CAAC,CAAC,EAAE,KAAK,YAAU,EAC9B,OAAOA,EAAI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AAO,0BAAuBC,CAAM,CAAC,EAAE,KAAK,EAAK,EAC7C,IAAC,0BAAuBA,CAAM,EAAG,CACnC,MAAMC,EAAMD,EAAO,MACnB,OAAOC,EAAI,SAAS,EAAE,KAAK,uBAAqB,YAAY,CAC9D,CACF,CAAC,CACH,CAAC,CACH,CAAC",
4
+ "sourcesContent": ["import {\n ApduResponse,\n isSuccessCommandResult,\n} from \"@ledgerhq/device-management-kit\";\n\nimport { SignTransferWithMemoCommand } from \"@internal/app-binder/command/SignTransferWithMemoCommand\";\nimport {\n type ConcordiumAppCommandError,\n ConcordiumErrorCodes,\n} from \"@internal/app-binder/command/utils/ConcordiumApplicationErrors\";\nimport { INS, LEDGER_CLA, P1, P2 } from \"@internal/app-binder/constants\";\n\ndescribe(\"SignTransferWithMemoCommand\", () => {\n describe(\"getApdu\", () => {\n it(\"should build APDU with INS=SIGN_TRANSFER_WITH_MEMO and given P1\", () => {\n const command = new SignTransferWithMemoCommand({\n p1: P1.INITIAL_WITH_MEMO,\n p2: P2.NONE,\n data: new Uint8Array(50).fill(0x01),\n });\n\n const raw = command.getApdu().getRawApdu();\n\n expect(raw[0]).toBe(LEDGER_CLA);\n expect(raw[1]).toBe(INS.SIGN_TRANSFER_WITH_MEMO);\n expect(raw[2]).toBe(P1.INITIAL_WITH_MEMO);\n expect(raw[3]).toBe(P2.NONE);\n });\n\n it(\"should use P1=MEMO for memo chunks\", () => {\n const command = new SignTransferWithMemoCommand({\n p1: P1.MEMO,\n p2: P2.NONE,\n data: new Uint8Array(100).fill(0xcc),\n });\n\n const raw = command.getApdu().getRawApdu();\n\n expect(raw[2]).toBe(P1.MEMO);\n });\n\n it(\"should use P1=AMOUNT for final amount step\", () => {\n const command = new SignTransferWithMemoCommand({\n p1: P1.AMOUNT,\n p2: P2.NONE,\n data: new Uint8Array(8).fill(0x00),\n });\n\n const raw = command.getApdu().getRawApdu();\n\n expect(raw[2]).toBe(P1.AMOUNT);\n });\n\n it(\"should include data in APDU payload\", () => {\n const data = new Uint8Array([0xde, 0xad, 0xbe, 0xef]);\n const command = new SignTransferWithMemoCommand({\n p1: P1.MEMO,\n p2: P2.NONE,\n data,\n });\n\n const raw = command.getApdu().getRawApdu();\n\n expect(raw.slice(5)).toStrictEqual(data);\n });\n });\n\n describe(\"parseResponse\", () => {\n it(\"should extract signature bytes on success\", () => {\n const command = new SignTransferWithMemoCommand({\n p1: P1.AMOUNT,\n p2: P2.NONE,\n data: new Uint8Array(8),\n });\n\n const signature = new Uint8Array(64).fill(0xab);\n const response = new ApduResponse({\n statusCode: new Uint8Array([0x90, 0x00]),\n data: signature,\n });\n\n const result = command.parseResponse(response);\n\n expect(isSuccessCommandResult(result)).toBe(true);\n if (isSuccessCommandResult(result)) {\n expect(result.data).toStrictEqual(signature);\n }\n });\n\n it(\"should return empty data for intermediate step response\", () => {\n const command = new SignTransferWithMemoCommand({\n p1: P1.INITIAL_WITH_MEMO,\n p2: P2.NONE,\n data: new Uint8Array(50),\n });\n\n const response = new ApduResponse({\n statusCode: new Uint8Array([0x90, 0x00]),\n data: new Uint8Array([]),\n });\n\n const result = command.parseResponse(response);\n\n expect(isSuccessCommandResult(result)).toBe(true);\n });\n\n it(\"should return ConcordiumAppCommandError on user rejection\", () => {\n const command = new SignTransferWithMemoCommand({\n p1: P1.AMOUNT,\n p2: P2.NONE,\n data: new Uint8Array(8),\n });\n\n const response = new ApduResponse({\n statusCode: new Uint8Array([0x69, 0x85]),\n data: new Uint8Array([]),\n });\n\n const result = command.parseResponse(response);\n\n expect(isSuccessCommandResult(result)).toBe(false);\n if (!isSuccessCommandResult(result)) {\n const err = result.error as ConcordiumAppCommandError;\n expect(err.errorCode).toBe(ConcordiumErrorCodes.USER_REJECTED);\n }\n });\n\n it(\"should return ConcordiumAppCommandError on data invalid\", () => {\n const command = new SignTransferWithMemoCommand({\n p1: P1.MEMO,\n p2: P2.NONE,\n data: new Uint8Array(10),\n });\n\n const response = new ApduResponse({\n statusCode: new Uint8Array([0x6a, 0x80]),\n data: new Uint8Array([]),\n });\n\n const result = command.parseResponse(response);\n\n expect(isSuccessCommandResult(result)).toBe(false);\n if (!isSuccessCommandResult(result)) {\n const err = result.error as ConcordiumAppCommandError;\n expect(err.errorCode).toBe(ConcordiumErrorCodes.DATA_INVALID);\n }\n });\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAGO,2CAEPC,EAA4C,oEAC5CC,EAGO,0EACPC,EAAwC,0CAExC,SAAS,8BAA+B,IAAM,CAC5C,SAAS,UAAW,IAAM,CACxB,GAAG,kEAAmE,IAAM,CAO1E,MAAMC,EANU,IAAI,8BAA4B,CAC9C,GAAI,KAAG,kBACP,GAAI,KAAG,KACP,KAAM,IAAI,WAAW,EAAE,EAAE,KAAK,CAAI,CACpC,CAAC,EAEmB,QAAQ,EAAE,WAAW,EAEzC,OAAOA,EAAI,CAAC,CAAC,EAAE,KAAK,YAAU,EAC9B,OAAOA,EAAI,CAAC,CAAC,EAAE,KAAK,MAAI,uBAAuB,EAC/C,OAAOA,EAAI,CAAC,CAAC,EAAE,KAAK,KAAG,iBAAiB,EACxC,OAAOA,EAAI,CAAC,CAAC,EAAE,KAAK,KAAG,IAAI,CAC7B,CAAC,EAED,GAAG,qCAAsC,IAAM,CAO7C,MAAMA,EANU,IAAI,8BAA4B,CAC9C,GAAI,KAAG,KACP,GAAI,KAAG,KACP,KAAM,IAAI,WAAW,GAAG,EAAE,KAAK,GAAI,CACrC,CAAC,EAEmB,QAAQ,EAAE,WAAW,EAEzC,OAAOA,EAAI,CAAC,CAAC,EAAE,KAAK,KAAG,IAAI,CAC7B,CAAC,EAED,GAAG,6CAA8C,IAAM,CAOrD,MAAMA,EANU,IAAI,8BAA4B,CAC9C,GAAI,KAAG,OACP,GAAI,KAAG,KACP,KAAM,IAAI,WAAW,CAAC,EAAE,KAAK,CAAI,CACnC,CAAC,EAEmB,QAAQ,EAAE,WAAW,EAEzC,OAAOA,EAAI,CAAC,CAAC,EAAE,KAAK,KAAG,MAAM,CAC/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P,KAAM,IAAI,WAAW,CAAC,CACxB,CAAC,EAEKE,EAAW,IAAI,eAAa,CAChC,WAAY,IAAI,WAAW,CAAC,IAAM,GAAI,CAAC,EACvC,KAAM,IAAI,WAAW,CAAC,CAAC,CACzB,CAAC,EAEKC,EAASH,EAAQ,cAAcE,CAAQ,EAG7C,GADA,UAAO,0BAAuBC,CAAM,CAAC,EAAE,KAAK,EAAK,EAC7C,IAAC,0BAAuBA,CAAM,EAAG,CACnC,MAAMC,EAAMD,EAAO,MACnB,OAAOC,EAAI,SAAS,EAAE,KAAK,uBAAqB,aAAa,CAC/D,CACF,CAAC,EAED,GAAG,0DAA2D,IAAM,CAClE,MAAMJ,EAAU,IAAI,8BAA4B,CAC9C,GAAI,KAAG,KACP,GAAI,KAAG,KACP,KAAM,IAAI,WAAW,EAAE,CACzB,CAAC,EAEKE,EAAW,IAAI,eAAa,CAChC,WAAY,IAAI,WAAW,CAAC,IAAM,GAAI,CAAC,EACvC,KAAM,IAAI,WAAW,CAAC,CAAC,CACzB,CAAC,EAEKC,EAASH,EAAQ,cAAcE,CAAQ,EAG7C,GADA,UAAO,0BAAuBC,CAAM,CAAC,EAAE,KAAK,EAAK,EAC7C,IAAC,0BAAuBA,CAAM,EAAG,CACnC,MAAMC,EAAMD,EAAO,MACnB,OAAOC,EAAI,SAAS,EAAE,KAAK,uBAAqB,YAAY,CAC9D,CACF,CAAC,CACH,CAAC,CACH,CAAC",
6
6
  "names": ["import_device_management_kit", "import_SignTransferWithMemoCommand", "import_ConcordiumApplicationErrors", "import_constants", "raw", "data", "command", "signature", "response", "result", "err"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var _=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var i=(r,e)=>{for(var t in e)_(r,t,{get:e[t],enumerable:!0})},R=(r,e,t,m)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of E(e))!A.call(r,s)&&s!==t&&_(r,s,{get:()=>e[s],enumerable:!(m=p(e,s))||m.enumerable});return r};var c=r=>R(_({},"__esModule",{value:!0}),r);var g={};i(g,{CONCORDIUM_APP_ERRORS:()=>T,ConcordiumAppCommandError:()=>d,ConcordiumAppCommandErrorFactory:()=>D,ConcordiumErrorCodes:()=>o});module.exports=c(g);var n=require("@ledgerhq/device-management-kit"),o=(a=>(a.USER_REJECTED="6985",a.LOCKED_DEVICE="5515",a.DATA_INVALID="6a80",a.INS_NOT_SUPPORTED="6d00",a.CLA_NOT_SUPPORTED="6e00",a.UNKNOWN_ERROR="6f00",a.TRUSTED_NAME_MISMATCH="6b0c",a.UNSUPPORTED_TRANSACTION_TYPE="unsupported_transaction_type",a.TRUSTED_METADATA_SERVICE_ERROR="trusted_metadata_service_error",a.ADDRESS_VERIFICATION_FAILED="address_verification_failed",a))(o||{});const T={6985:{message:"User rejected"},5515:{message:"Locked device"},"6a80":{message:"Data invalid"},"6d00":{message:"INS not supported"},"6e00":{message:"CLA not supported"},"6f00":{message:"Unknown error"},"6b0c":{message:"Trusted name mismatch"},unsupported_transaction_type:{message:"Unsupported transaction type"},trusted_metadata_service_error:{message:"Trusted metadata service error"},address_verification_failed:{message:"Address verification failed"}};class d extends n.DeviceExchangeError{constructor(e){super({tag:"ConcordiumAppCommandError",...e})}}const D=r=>new d(r);0&&(module.exports={CONCORDIUM_APP_ERRORS,ConcordiumAppCommandError,ConcordiumAppCommandErrorFactory,ConcordiumErrorCodes});
1
+ "use strict";var p=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var i=(s,a)=>{for(var _ in a)p(s,_,{get:a[_],enumerable:!0})},g=(s,a,_,n)=>{if(a&&typeof a=="object"||typeof a=="function")for(let t of I(a))!P.call(s,t)&&t!==_&&p(s,t,{get:()=>a[t],enumerable:!(n=m(a,t))||n.enumerable});return s};var O=s=>g(p({},"__esModule",{value:!0}),s);var L={};i(L,{CONCORDIUM_APP_ERRORS:()=>N,ConcordiumAppCommandError:()=>R,ConcordiumAppCommandErrorFactory:()=>D,ConcordiumErrorCodes:()=>T});module.exports=O(L);var A=require("@ledgerhq/device-management-kit"),T=(e=>(e.USER_REJECTED="6985",e.LOCKED_DEVICE="5515",e.DATA_INVALID="6a80",e.INS_NOT_SUPPORTED="6d00",e.CLA_NOT_SUPPORTED="6e00",e.UNKNOWN_ERROR="6f00",e.WRONG_P1_P2="6b00",e.INVALID_STATE="6b01",e.INVALID_PATH="6b02",e.INVALID_PARAM="6b03",e.INVALID_TRANSACTION="6b04",e.BUFFER_OVERFLOW="6b06",e.FAILED_CX_OPERATION="6b07",e.TRUSTED_NAME_MISMATCH="6b0c",e.PLT_CBOR_ERROR="6b0d",e.PLT_BUFFER_ERROR="6b0e",e.PLT_DATA_ERROR="6b0f",e.PLT_MULTI_OP="6b10",e.PLT_UNSUPPORTED_DECIMALS="6b11",e.UNSUPPORTED_TRANSACTION_TYPE="unsupported_transaction_type",e.UNSUPPORTED_APP_VERSION="unsupported_app_version",e.INVALID_PLT_TRANSACTION="invalid_plt_transaction",e.TRUSTED_METADATA_SERVICE_ERROR="trusted_metadata_service_error",e.ADDRESS_VERIFICATION_FAILED="address_verification_failed",e.INVALID_MAX_FEE="invalid_max_fee",e))(T||{});const N={6985:{message:"User rejected"},5515:{message:"Locked device"},"6a80":{message:"Data invalid"},"6d00":{message:"INS not supported"},"6e00":{message:"CLA not supported"},"6f00":{message:"Unknown error"},"6b00":{message:"Wrong P1 or P2"},"6b01":{message:"Invalid state"},"6b02":{message:"Invalid derivation path"},"6b03":{message:"Invalid parameter"},"6b04":{message:"Invalid transaction"},"6b06":{message:"Buffer overflow"},"6b07":{message:"Failed crypto operation"},"6b0c":{message:"Trusted name mismatch"},"6b0d":{message:"PLT CBOR error"},"6b0e":{message:"PLT buffer error"},"6b0f":{message:"PLT data error"},"6b10":{message:"PLT payload has more than one operation"},"6b11":{message:"PLT amount has more than the 18 decimal places the app can display"},unsupported_transaction_type:{message:"Unsupported transaction type"},unsupported_app_version:{message:"Unsupported app version"},invalid_plt_transaction:{message:"Invalid PLT transaction"},trusted_metadata_service_error:{message:"Trusted metadata service error"},address_verification_failed:{message:"Address verification failed"},invalid_max_fee:{message:"Invalid maxFee value"}};class R extends A.DeviceExchangeError{constructor(a){super({tag:"ConcordiumAppCommandError",...a})}}const D=s=>new R(s);0&&(module.exports={CONCORDIUM_APP_ERRORS,ConcordiumAppCommandError,ConcordiumAppCommandErrorFactory,ConcordiumErrorCodes});
2
2
  //# sourceMappingURL=ConcordiumApplicationErrors.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/app-binder/command/utils/ConcordiumApplicationErrors.ts"],
4
- "sourcesContent": ["import {\n type CommandErrorArgs,\n type CommandErrors,\n DeviceExchangeError,\n} from \"@ledgerhq/device-management-kit\";\n\nexport enum ConcordiumErrorCodes {\n USER_REJECTED = \"6985\",\n LOCKED_DEVICE = \"5515\",\n DATA_INVALID = \"6a80\",\n INS_NOT_SUPPORTED = \"6d00\",\n CLA_NOT_SUPPORTED = \"6e00\",\n UNKNOWN_ERROR = \"6f00\",\n TRUSTED_NAME_MISMATCH = \"6b0c\",\n UNSUPPORTED_TRANSACTION_TYPE = \"unsupported_transaction_type\",\n TRUSTED_METADATA_SERVICE_ERROR = \"trusted_metadata_service_error\",\n ADDRESS_VERIFICATION_FAILED = \"address_verification_failed\",\n}\n\nexport const CONCORDIUM_APP_ERRORS: CommandErrors<ConcordiumErrorCodes> = {\n \"6985\": { message: \"User rejected\" },\n \"5515\": { message: \"Locked device\" },\n \"6a80\": { message: \"Data invalid\" },\n \"6d00\": { message: \"INS not supported\" },\n \"6e00\": { message: \"CLA not supported\" },\n \"6f00\": { message: \"Unknown error\" },\n \"6b0c\": { message: \"Trusted name mismatch\" },\n unsupported_transaction_type: { message: \"Unsupported transaction type\" },\n trusted_metadata_service_error: {\n message: \"Trusted metadata service error\",\n },\n address_verification_failed: {\n message: \"Address verification failed\",\n },\n};\n\nexport class ConcordiumAppCommandError extends DeviceExchangeError<ConcordiumErrorCodes> {\n constructor(args: CommandErrorArgs<ConcordiumErrorCodes>) {\n super({ tag: \"ConcordiumAppCommandError\", ...args });\n }\n}\n\nexport const ConcordiumAppCommandErrorFactory = (\n args: CommandErrorArgs<ConcordiumErrorCodes>,\n) => new ConcordiumAppCommandError(args);\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,2BAAAE,EAAA,8BAAAC,EAAA,qCAAAC,EAAA,yBAAAC,IAAA,eAAAC,EAAAN,GAAA,IAAAO,EAIO,2CAEKF,OACVA,EAAA,cAAgB,OAChBA,EAAA,cAAgB,OAChBA,EAAA,aAAe,OACfA,EAAA,kBAAoB,OACpBA,EAAA,kBAAoB,OACpBA,EAAA,cAAgB,OAChBA,EAAA,sBAAwB,OACxBA,EAAA,6BAA+B,+BAC/BA,EAAA,+BAAiC,iCACjCA,EAAA,4BAA8B,8BAVpBA,OAAA,IAaL,MAAMH,EAA6D,CACxE,KAAQ,CAAE,QAAS,eAAgB,EACnC,KAAQ,CAAE,QAAS,eAAgB,EACnC,OAAQ,CAAE,QAAS,cAAe,EAClC,OAAQ,CAAE,QAAS,mBAAoB,EACvC,OAAQ,CAAE,QAAS,mBAAoB,EACvC,OAAQ,CAAE,QAAS,eAAgB,EACnC,OAAQ,CAAE,QAAS,uBAAwB,EAC3C,6BAA8B,CAAE,QAAS,8BAA+B,EACxE,+BAAgC,CAC9B,QAAS,gCACX,EACA,4BAA6B,CAC3B,QAAS,6BACX,CACF,EAEO,MAAMC,UAAkC,qBAA0C,CACvF,YAAYK,EAA8C,CACxD,MAAM,CAAE,IAAK,4BAA6B,GAAGA,CAAK,CAAC,CACrD,CACF,CAEO,MAAMJ,EACXI,GACG,IAAIL,EAA0BK,CAAI",
4
+ "sourcesContent": ["import {\n type CommandErrorArgs,\n type CommandErrors,\n DeviceExchangeError,\n} from \"@ledgerhq/device-management-kit\";\n\nexport enum ConcordiumErrorCodes {\n USER_REJECTED = \"6985\",\n LOCKED_DEVICE = \"5515\",\n DATA_INVALID = \"6a80\",\n INS_NOT_SUPPORTED = \"6d00\",\n CLA_NOT_SUPPORTED = \"6e00\",\n UNKNOWN_ERROR = \"6f00\",\n WRONG_P1_P2 = \"6b00\",\n INVALID_STATE = \"6b01\",\n INVALID_PATH = \"6b02\",\n INVALID_PARAM = \"6b03\",\n INVALID_TRANSACTION = \"6b04\",\n BUFFER_OVERFLOW = \"6b06\",\n FAILED_CX_OPERATION = \"6b07\",\n TRUSTED_NAME_MISMATCH = \"6b0c\",\n PLT_CBOR_ERROR = \"6b0d\",\n PLT_BUFFER_ERROR = \"6b0e\",\n PLT_DATA_ERROR = \"6b0f\",\n PLT_MULTI_OP = \"6b10\",\n PLT_UNSUPPORTED_DECIMALS = \"6b11\",\n UNSUPPORTED_TRANSACTION_TYPE = \"unsupported_transaction_type\",\n UNSUPPORTED_APP_VERSION = \"unsupported_app_version\",\n INVALID_PLT_TRANSACTION = \"invalid_plt_transaction\",\n TRUSTED_METADATA_SERVICE_ERROR = \"trusted_metadata_service_error\",\n ADDRESS_VERIFICATION_FAILED = \"address_verification_failed\",\n INVALID_MAX_FEE = \"invalid_max_fee\",\n}\n\nexport const CONCORDIUM_APP_ERRORS: CommandErrors<ConcordiumErrorCodes> = {\n \"6985\": { message: \"User rejected\" },\n \"5515\": { message: \"Locked device\" },\n \"6a80\": { message: \"Data invalid\" },\n \"6d00\": { message: \"INS not supported\" },\n \"6e00\": { message: \"CLA not supported\" },\n \"6f00\": { message: \"Unknown error\" },\n \"6b00\": { message: \"Wrong P1 or P2\" },\n \"6b01\": { message: \"Invalid state\" },\n \"6b02\": { message: \"Invalid derivation path\" },\n \"6b03\": { message: \"Invalid parameter\" },\n \"6b04\": { message: \"Invalid transaction\" },\n \"6b06\": { message: \"Buffer overflow\" },\n \"6b07\": { message: \"Failed crypto operation\" },\n \"6b0c\": { message: \"Trusted name mismatch\" },\n \"6b0d\": { message: \"PLT CBOR error\" },\n \"6b0e\": { message: \"PLT buffer error\" },\n \"6b0f\": { message: \"PLT data error\" },\n \"6b10\": { message: \"PLT payload has more than one operation\" },\n \"6b11\": {\n message:\n \"PLT amount has more than the 18 decimal places the app can display\",\n },\n unsupported_transaction_type: { message: \"Unsupported transaction type\" },\n unsupported_app_version: { message: \"Unsupported app version\" },\n invalid_plt_transaction: { message: \"Invalid PLT transaction\" },\n trusted_metadata_service_error: {\n message: \"Trusted metadata service error\",\n },\n address_verification_failed: {\n message: \"Address verification failed\",\n },\n invalid_max_fee: {\n message: \"Invalid maxFee value\",\n },\n};\n\nexport class ConcordiumAppCommandError extends DeviceExchangeError<ConcordiumErrorCodes> {\n constructor(args: CommandErrorArgs<ConcordiumErrorCodes>) {\n super({ tag: \"ConcordiumAppCommandError\", ...args });\n }\n}\n\nexport const ConcordiumAppCommandErrorFactory = (\n args: CommandErrorArgs<ConcordiumErrorCodes>,\n) => new ConcordiumAppCommandError(args);\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,2BAAAE,EAAA,8BAAAC,EAAA,qCAAAC,EAAA,yBAAAC,IAAA,eAAAC,EAAAN,GAAA,IAAAO,EAIO,2CAEKF,OACVA,EAAA,cAAgB,OAChBA,EAAA,cAAgB,OAChBA,EAAA,aAAe,OACfA,EAAA,kBAAoB,OACpBA,EAAA,kBAAoB,OACpBA,EAAA,cAAgB,OAChBA,EAAA,YAAc,OACdA,EAAA,cAAgB,OAChBA,EAAA,aAAe,OACfA,EAAA,cAAgB,OAChBA,EAAA,oBAAsB,OACtBA,EAAA,gBAAkB,OAClBA,EAAA,oBAAsB,OACtBA,EAAA,sBAAwB,OACxBA,EAAA,eAAiB,OACjBA,EAAA,iBAAmB,OACnBA,EAAA,eAAiB,OACjBA,EAAA,aAAe,OACfA,EAAA,yBAA2B,OAC3BA,EAAA,6BAA+B,+BAC/BA,EAAA,wBAA0B,0BAC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cordiumErrorCodes", "__toCommonJS", "import_device_management_kit", "args"]
7
7
  }