@ledgerhq/device-signer-kit-concordium 0.0.0-develop-20260327001650
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.
- package/LICENSE.MD +202 -0
- package/lib/cjs/api/SignerConcordium.js +2 -0
- package/lib/cjs/api/SignerConcordium.js.map +7 -0
- package/lib/cjs/api/SignerConcordiumBuilder.js +2 -0
- package/lib/cjs/api/SignerConcordiumBuilder.js.map +7 -0
- package/lib/cjs/api/app-binder/GetPublicKeyDeviceActionTypes.js +2 -0
- package/lib/cjs/api/app-binder/GetPublicKeyDeviceActionTypes.js.map +7 -0
- package/lib/cjs/api/app-binder/SignTransactionDeviceActionTypes.js +2 -0
- package/lib/cjs/api/app-binder/SignTransactionDeviceActionTypes.js.map +7 -0
- package/lib/cjs/api/index.js +2 -0
- package/lib/cjs/api/index.js.map +7 -0
- package/lib/cjs/api/model/PublicKey.js +2 -0
- package/lib/cjs/api/model/PublicKey.js.map +7 -0
- package/lib/cjs/api/model/Signature.js +2 -0
- package/lib/cjs/api/model/Signature.js.map +7 -0
- package/lib/cjs/index.js +2 -0
- package/lib/cjs/index.js.map +7 -0
- package/lib/cjs/internal/DefaultSignerConcordium.js +2 -0
- package/lib/cjs/internal/DefaultSignerConcordium.js.map +7 -0
- package/lib/cjs/internal/app-binder/ConcordiumAppBinder.js +2 -0
- package/lib/cjs/internal/app-binder/ConcordiumAppBinder.js.map +7 -0
- package/lib/cjs/internal/app-binder/command/GetPublicKeyCommand.js +2 -0
- package/lib/cjs/internal/app-binder/command/GetPublicKeyCommand.js.map +7 -0
- package/lib/cjs/internal/app-binder/command/GetPublicKeyCommand.test.js +2 -0
- package/lib/cjs/internal/app-binder/command/GetPublicKeyCommand.test.js.map +7 -0
- package/lib/cjs/internal/app-binder/command/SignTransferCommand.js +2 -0
- package/lib/cjs/internal/app-binder/command/SignTransferCommand.js.map +7 -0
- package/lib/cjs/internal/app-binder/command/SignTransferCommand.test.js +2 -0
- package/lib/cjs/internal/app-binder/command/SignTransferCommand.test.js.map +7 -0
- package/lib/cjs/internal/app-binder/command/utils/ConcordiumApplicationErrors.js +2 -0
- package/lib/cjs/internal/app-binder/command/utils/ConcordiumApplicationErrors.js.map +7 -0
- package/lib/cjs/internal/app-binder/command/utils/EncodeDerivationPath.js +2 -0
- package/lib/cjs/internal/app-binder/command/utils/EncodeDerivationPath.js.map +7 -0
- package/lib/cjs/internal/app-binder/command/utils/EncodeDerivationPath.test.js +2 -0
- package/lib/cjs/internal/app-binder/command/utils/EncodeDerivationPath.test.js.map +7 -0
- package/lib/cjs/internal/app-binder/constants.js +2 -0
- package/lib/cjs/internal/app-binder/constants.js.map +7 -0
- package/lib/cjs/internal/app-binder/di/appBinderModule.js +2 -0
- package/lib/cjs/internal/app-binder/di/appBinderModule.js.map +7 -0
- package/lib/cjs/internal/app-binder/di/appBinderTypes.js +2 -0
- package/lib/cjs/internal/app-binder/di/appBinderTypes.js.map +7 -0
- package/lib/cjs/internal/app-binder/task/SendInChunksTask.js +2 -0
- package/lib/cjs/internal/app-binder/task/SendInChunksTask.js.map +7 -0
- package/lib/cjs/internal/app-binder/task/SendInChunksTask.test.js +2 -0
- package/lib/cjs/internal/app-binder/task/SendInChunksTask.test.js.map +7 -0
- package/lib/cjs/internal/di.js +2 -0
- package/lib/cjs/internal/di.js.map +7 -0
- package/lib/cjs/internal/externalTypes.js +2 -0
- package/lib/cjs/internal/externalTypes.js.map +7 -0
- package/lib/cjs/internal/use-cases/publickey/GetPublicKeyUseCase.js +2 -0
- package/lib/cjs/internal/use-cases/publickey/GetPublicKeyUseCase.js.map +7 -0
- package/lib/cjs/internal/use-cases/publickey/di/publicKeyModule.js +2 -0
- package/lib/cjs/internal/use-cases/publickey/di/publicKeyModule.js.map +7 -0
- package/lib/cjs/internal/use-cases/publickey/di/publicKeyTypes.js +2 -0
- package/lib/cjs/internal/use-cases/publickey/di/publicKeyTypes.js.map +7 -0
- package/lib/cjs/internal/use-cases/transaction/SignTransactionUseCase.js +2 -0
- package/lib/cjs/internal/use-cases/transaction/SignTransactionUseCase.js.map +7 -0
- package/lib/cjs/internal/use-cases/transaction/di/transactionModule.js +2 -0
- package/lib/cjs/internal/use-cases/transaction/di/transactionModule.js.map +7 -0
- package/lib/cjs/internal/use-cases/transaction/di/transactionTypes.js +2 -0
- package/lib/cjs/internal/use-cases/transaction/di/transactionTypes.js.map +7 -0
- package/lib/cjs/package.json +60 -0
- package/lib/esm/api/SignerConcordium.js +1 -0
- package/lib/esm/api/SignerConcordium.js.map +7 -0
- package/lib/esm/api/SignerConcordiumBuilder.js +2 -0
- package/lib/esm/api/SignerConcordiumBuilder.js.map +7 -0
- package/lib/esm/api/app-binder/GetPublicKeyDeviceActionTypes.js +1 -0
- package/lib/esm/api/app-binder/GetPublicKeyDeviceActionTypes.js.map +7 -0
- package/lib/esm/api/app-binder/SignTransactionDeviceActionTypes.js +1 -0
- package/lib/esm/api/app-binder/SignTransactionDeviceActionTypes.js.map +7 -0
- package/lib/esm/api/index.js +2 -0
- package/lib/esm/api/index.js.map +7 -0
- package/lib/esm/api/model/PublicKey.js +1 -0
- package/lib/esm/api/model/PublicKey.js.map +7 -0
- package/lib/esm/api/model/Signature.js +1 -0
- package/lib/esm/api/model/Signature.js.map +7 -0
- package/lib/esm/index.js +2 -0
- package/lib/esm/index.js.map +7 -0
- package/lib/esm/internal/DefaultSignerConcordium.js +2 -0
- package/lib/esm/internal/DefaultSignerConcordium.js.map +7 -0
- package/lib/esm/internal/app-binder/ConcordiumAppBinder.js +2 -0
- package/lib/esm/internal/app-binder/ConcordiumAppBinder.js.map +7 -0
- package/lib/esm/internal/app-binder/command/GetPublicKeyCommand.js +2 -0
- package/lib/esm/internal/app-binder/command/GetPublicKeyCommand.js.map +7 -0
- package/lib/esm/internal/app-binder/command/GetPublicKeyCommand.test.js +2 -0
- package/lib/esm/internal/app-binder/command/GetPublicKeyCommand.test.js.map +7 -0
- package/lib/esm/internal/app-binder/command/SignTransferCommand.js +2 -0
- package/lib/esm/internal/app-binder/command/SignTransferCommand.js.map +7 -0
- package/lib/esm/internal/app-binder/command/SignTransferCommand.test.js +2 -0
- package/lib/esm/internal/app-binder/command/SignTransferCommand.test.js.map +7 -0
- package/lib/esm/internal/app-binder/command/utils/ConcordiumApplicationErrors.js +2 -0
- package/lib/esm/internal/app-binder/command/utils/ConcordiumApplicationErrors.js.map +7 -0
- package/lib/esm/internal/app-binder/command/utils/EncodeDerivationPath.js +2 -0
- package/lib/esm/internal/app-binder/command/utils/EncodeDerivationPath.js.map +7 -0
- package/lib/esm/internal/app-binder/command/utils/EncodeDerivationPath.test.js +2 -0
- package/lib/esm/internal/app-binder/command/utils/EncodeDerivationPath.test.js.map +7 -0
- package/lib/esm/internal/app-binder/constants.js +2 -0
- package/lib/esm/internal/app-binder/constants.js.map +7 -0
- package/lib/esm/internal/app-binder/di/appBinderModule.js +2 -0
- package/lib/esm/internal/app-binder/di/appBinderModule.js.map +7 -0
- package/lib/esm/internal/app-binder/di/appBinderTypes.js +2 -0
- package/lib/esm/internal/app-binder/di/appBinderTypes.js.map +7 -0
- package/lib/esm/internal/app-binder/task/SendInChunksTask.js +2 -0
- package/lib/esm/internal/app-binder/task/SendInChunksTask.js.map +7 -0
- package/lib/esm/internal/app-binder/task/SendInChunksTask.test.js +2 -0
- package/lib/esm/internal/app-binder/task/SendInChunksTask.test.js.map +7 -0
- package/lib/esm/internal/di.js +2 -0
- package/lib/esm/internal/di.js.map +7 -0
- package/lib/esm/internal/externalTypes.js +2 -0
- package/lib/esm/internal/externalTypes.js.map +7 -0
- package/lib/esm/internal/use-cases/publickey/GetPublicKeyUseCase.js +2 -0
- package/lib/esm/internal/use-cases/publickey/GetPublicKeyUseCase.js.map +7 -0
- package/lib/esm/internal/use-cases/publickey/di/publicKeyModule.js +2 -0
- package/lib/esm/internal/use-cases/publickey/di/publicKeyModule.js.map +7 -0
- package/lib/esm/internal/use-cases/publickey/di/publicKeyTypes.js +2 -0
- package/lib/esm/internal/use-cases/publickey/di/publicKeyTypes.js.map +7 -0
- package/lib/esm/internal/use-cases/transaction/SignTransactionUseCase.js +2 -0
- package/lib/esm/internal/use-cases/transaction/SignTransactionUseCase.js.map +7 -0
- package/lib/esm/internal/use-cases/transaction/di/transactionModule.js +2 -0
- package/lib/esm/internal/use-cases/transaction/di/transactionModule.js.map +7 -0
- package/lib/esm/internal/use-cases/transaction/di/transactionTypes.js +2 -0
- package/lib/esm/internal/use-cases/transaction/di/transactionTypes.js.map +7 -0
- package/lib/esm/package.json +60 -0
- package/lib/types/api/SignerConcordium.d.ts +14 -0
- package/lib/types/api/SignerConcordium.d.ts.map +1 -0
- package/lib/types/api/SignerConcordiumBuilder.d.ts +14 -0
- package/lib/types/api/SignerConcordiumBuilder.d.ts.map +1 -0
- package/lib/types/api/app-binder/GetPublicKeyDeviceActionTypes.d.ts +10 -0
- package/lib/types/api/app-binder/GetPublicKeyDeviceActionTypes.d.ts.map +1 -0
- package/lib/types/api/app-binder/SignTransactionDeviceActionTypes.d.ts +12 -0
- package/lib/types/api/app-binder/SignTransactionDeviceActionTypes.d.ts.map +1 -0
- package/lib/types/api/index.d.ts +7 -0
- package/lib/types/api/index.d.ts.map +1 -0
- package/lib/types/api/model/PublicKey.d.ts +4 -0
- package/lib/types/api/model/PublicKey.d.ts.map +1 -0
- package/lib/types/api/model/Signature.d.ts +2 -0
- package/lib/types/api/model/Signature.d.ts.map +1 -0
- package/lib/types/index.d.ts +3 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/internal/DefaultSignerConcordium.d.ts +16 -0
- package/lib/types/internal/DefaultSignerConcordium.d.ts.map +1 -0
- package/lib/types/internal/app-binder/ConcordiumAppBinder.d.ts +17 -0
- package/lib/types/internal/app-binder/ConcordiumAppBinder.d.ts.map +1 -0
- package/lib/types/internal/app-binder/command/GetPublicKeyCommand.d.ts +18 -0
- package/lib/types/internal/app-binder/command/GetPublicKeyCommand.d.ts.map +1 -0
- package/lib/types/internal/app-binder/command/GetPublicKeyCommand.test.d.ts +2 -0
- package/lib/types/internal/app-binder/command/GetPublicKeyCommand.test.d.ts.map +1 -0
- package/lib/types/internal/app-binder/command/SignTransferCommand.d.ts +17 -0
- package/lib/types/internal/app-binder/command/SignTransferCommand.d.ts.map +1 -0
- package/lib/types/internal/app-binder/command/SignTransferCommand.test.d.ts +2 -0
- package/lib/types/internal/app-binder/command/SignTransferCommand.test.d.ts.map +1 -0
- package/lib/types/internal/app-binder/command/utils/ConcordiumApplicationErrors.d.ts +15 -0
- package/lib/types/internal/app-binder/command/utils/ConcordiumApplicationErrors.d.ts.map +1 -0
- package/lib/types/internal/app-binder/command/utils/EncodeDerivationPath.d.ts +13 -0
- package/lib/types/internal/app-binder/command/utils/EncodeDerivationPath.d.ts.map +1 -0
- package/lib/types/internal/app-binder/command/utils/EncodeDerivationPath.test.d.ts +2 -0
- package/lib/types/internal/app-binder/command/utils/EncodeDerivationPath.test.d.ts.map +1 -0
- package/lib/types/internal/app-binder/constants.d.ts +27 -0
- package/lib/types/internal/app-binder/constants.d.ts.map +1 -0
- package/lib/types/internal/app-binder/di/appBinderModule.d.ts +3 -0
- package/lib/types/internal/app-binder/di/appBinderModule.d.ts.map +1 -0
- package/lib/types/internal/app-binder/di/appBinderTypes.d.ts +4 -0
- package/lib/types/internal/app-binder/di/appBinderTypes.d.ts.map +1 -0
- package/lib/types/internal/app-binder/task/SendInChunksTask.d.ts +16 -0
- package/lib/types/internal/app-binder/task/SendInChunksTask.d.ts.map +1 -0
- package/lib/types/internal/app-binder/task/SendInChunksTask.test.d.ts +2 -0
- package/lib/types/internal/app-binder/task/SendInChunksTask.test.d.ts.map +1 -0
- package/lib/types/internal/di.d.ts +9 -0
- package/lib/types/internal/di.d.ts.map +1 -0
- package/lib/types/internal/externalTypes.d.ts +6 -0
- package/lib/types/internal/externalTypes.d.ts.map +1 -0
- package/lib/types/internal/use-cases/publickey/GetPublicKeyUseCase.d.ts +9 -0
- package/lib/types/internal/use-cases/publickey/GetPublicKeyUseCase.d.ts.map +1 -0
- package/lib/types/internal/use-cases/publickey/di/publicKeyModule.d.ts +3 -0
- package/lib/types/internal/use-cases/publickey/di/publicKeyModule.d.ts.map +1 -0
- package/lib/types/internal/use-cases/publickey/di/publicKeyTypes.d.ts +4 -0
- package/lib/types/internal/use-cases/publickey/di/publicKeyTypes.d.ts.map +1 -0
- package/lib/types/internal/use-cases/transaction/SignTransactionUseCase.d.ts +9 -0
- package/lib/types/internal/use-cases/transaction/SignTransactionUseCase.d.ts.map +1 -0
- package/lib/types/internal/use-cases/transaction/di/transactionModule.d.ts +3 -0
- package/lib/types/internal/use-cases/transaction/di/transactionModule.d.ts.map +1 -0
- package/lib/types/internal/use-cases/transaction/di/transactionTypes.d.ts +4 -0
- package/lib/types/internal/use-cases/transaction/di/transactionTypes.d.ts.map +1 -0
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -0
- package/package.json +60 -0
package/LICENSE.MD
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright 2024-present Ledger
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var o=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var c=(t,n,p,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of a(n))!s.call(t,e)&&e!==p&&o(t,e,{get:()=>n[e],enumerable:!(i=r(n,e))||i.enumerable});return t};var y=t=>c(o({},"__esModule",{value:!0}),t);var u={};module.exports=y(u);
|
|
2
|
+
//# sourceMappingURL=SignerConcordium.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/api/SignerConcordium.ts"],
|
|
4
|
+
"sourcesContent": ["import { type GetPublicKeyDAReturnType } from \"@api/app-binder/GetPublicKeyDeviceActionTypes\";\nimport { type SignTransactionDAReturnType } from \"@api/app-binder/SignTransactionDeviceActionTypes\";\n\nexport type PublicKeyOptions = {\n checkOnDevice?: boolean;\n skipOpenApp?: boolean;\n};\n\nexport type TransactionOptions = {\n skipOpenApp?: boolean;\n};\n\nexport interface SignerConcordium {\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"],
|
|
5
|
+
"mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
|
|
6
|
+
"names": ["SignerConcordium_exports", "__toCommonJS"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var n=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var u=(i,e)=>{for(var r in e)n(i,r,{get:e[r],enumerable:!0})},a=(i,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of m(e))!c.call(i,o)&&o!==r&&n(i,o,{get:()=>e[o],enumerable:!(s=d(e,o))||s.enumerable});return i};var g=i=>a(n({},"__esModule",{value:!0}),i);var l={};u(l,{SignerConcordiumBuilder:()=>p});module.exports=g(l);var t=require("../internal/DefaultSignerConcordium");class p{_dmk;_sessionId;constructor({dmk:e,sessionId:r}){this._dmk=e,this._sessionId=r}build(){return new t.DefaultSignerConcordium({dmk:this._dmk,sessionId:this._sessionId})}}0&&(module.exports={SignerConcordiumBuilder});
|
|
2
|
+
//# sourceMappingURL=SignerConcordiumBuilder.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/api/SignerConcordiumBuilder.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n type DeviceManagementKit,\n type DeviceSessionId,\n} from \"@ledgerhq/device-management-kit\";\n\nimport { type SignerConcordium } from \"@api/SignerConcordium\";\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\n constructor({ dmk, sessionId }: SignerConcordiumBuilderConstructorArgs) {\n this._dmk = dmk;\n this._sessionId = sessionId;\n }\n\n public build(): SignerConcordium {\n return new DefaultSignerConcordium({\n dmk: this._dmk,\n sessionId: this._sessionId,\n });\n }\n}\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,6BAAAE,IAAA,eAAAC,EAAAH,GAMA,IAAAI,EAAwC,6CAOjC,MAAMF,CAAwB,CAClB,KACA,WAEjB,YAAY,CAAE,IAAAG,EAAK,UAAAC,CAAU,EAA2C,CACtE,KAAK,KAAOD,EACZ,KAAK,WAAaC,CACpB,CAEO,OAA0B,CAC/B,OAAO,IAAI,0BAAwB,CACjC,IAAK,KAAK,KACV,UAAW,KAAK,UAClB,CAAC,CACH,CACF",
|
|
6
|
+
"names": ["SignerConcordiumBuilder_exports", "__export", "SignerConcordiumBuilder", "__toCommonJS", "import_DefaultSignerConcordium", "dmk", "sessionId"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var p=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var y=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of i(e))!m.call(t,r)&&r!==n&&p(t,r,{get:()=>e[r],enumerable:!(o=u(e,r))||o.enumerable});return t};var d=t=>y(p({},"__esModule",{value:!0}),t);var c={};module.exports=d(c);
|
|
2
|
+
//# sourceMappingURL=GetPublicKeyDeviceActionTypes.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/api/app-binder/GetPublicKeyDeviceActionTypes.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n type CommandErrorResult,\n type ExecuteDeviceActionReturnType,\n type OpenAppDAError,\n type SendCommandInAppDAIntermediateValue,\n type SendCommandInAppDAOutput,\n type UserInteractionRequired,\n} from \"@ledgerhq/device-management-kit\";\n\nimport { type GetPublicKeyCommandResponse } from \"@internal/app-binder/command/GetPublicKeyCommand\";\nimport { type ConcordiumErrorCodes } from \"@internal/app-binder/command/utils/ConcordiumApplicationErrors\";\n\ntype GetPublicKeyDAUserInteractionRequired =\n | UserInteractionRequired.None\n | UserInteractionRequired.VerifyAddress;\n\nexport type GetPublicKeyDAOutput =\n SendCommandInAppDAOutput<GetPublicKeyCommandResponse>;\n\nexport type GetPublicKeyDAError =\n | OpenAppDAError\n | CommandErrorResult<ConcordiumErrorCodes>[\"error\"];\n\nexport type GetPublicKeyDAIntermediateValue =\n SendCommandInAppDAIntermediateValue<GetPublicKeyDAUserInteractionRequired>;\n\nexport type GetPublicKeyDAReturnType = ExecuteDeviceActionReturnType<\n GetPublicKeyDAOutput,\n GetPublicKeyDAError,\n GetPublicKeyDAIntermediateValue\n>;\n"],
|
|
5
|
+
"mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
|
|
6
|
+
"names": ["GetPublicKeyDeviceActionTypes_exports", "__toCommonJS"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var o=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var c=(r,e,i,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of a(e))!u.call(r,n)&&n!==i&&o(r,n,{get:()=>e[n],enumerable:!(t=p(e,n))||t.enumerable});return r};var s=r=>c(o({},"__esModule",{value:!0}),r);var A={};module.exports=s(A);
|
|
2
|
+
//# sourceMappingURL=SignTransactionDeviceActionTypes.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/api/app-binder/SignTransactionDeviceActionTypes.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n type CommandErrorResult,\n type ExecuteDeviceActionReturnType,\n type OpenAppDAError,\n type OpenAppDARequiredInteraction,\n type SendCommandInAppDAOutput,\n type UserInteractionRequired,\n} from \"@ledgerhq/device-management-kit\";\n\nimport { type SignTransferCommandResponse } from \"@internal/app-binder/command/SignTransferCommand\";\nimport { type ConcordiumErrorCodes } from \"@internal/app-binder/command/utils/ConcordiumApplicationErrors\";\n\nexport type SignTransactionDAOutput =\n SendCommandInAppDAOutput<SignTransferCommandResponse>;\nexport type SignTransactionDAError =\n | OpenAppDAError\n | CommandErrorResult<ConcordiumErrorCodes>[\"error\"];\n\ntype SignTransactionDARequiredInteraction =\n | OpenAppDARequiredInteraction\n | UserInteractionRequired.SignTransaction;\n\nexport type SignTransactionDAIntermediateValue = {\n requiredUserInteraction: SignTransactionDARequiredInteraction;\n};\n\nexport type SignTransactionDAReturnType = ExecuteDeviceActionReturnType<\n SignTransactionDAOutput,\n SignTransactionDAError,\n SignTransactionDAIntermediateValue\n>;\n"],
|
|
5
|
+
"mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
|
|
6
|
+
"names": ["SignTransactionDeviceActionTypes_exports", "__toCommonJS"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var i=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var c=(t,e)=>{for(var o in e)i(t,o,{get:e[o],enumerable:!0})},m=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of u(e))!a.call(t,r)&&r!==o&&i(t,r,{get:()=>e[r],enumerable:!(n=y(e,r))||n.enumerable});return t};var l=t=>m(i({},"__esModule",{value:!0}),t);var A={};c(A,{SignerConcordiumBuilder:()=>p.SignerConcordiumBuilder});module.exports=l(A);var p=require("./SignerConcordiumBuilder");0&&(module.exports={SignerConcordiumBuilder});
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/api/index.ts"],
|
|
4
|
+
"sourcesContent": ["export {\n type GetPublicKeyDAError,\n type GetPublicKeyDAIntermediateValue,\n type GetPublicKeyDAOutput,\n type GetPublicKeyDAReturnType,\n} from \"@api/app-binder/GetPublicKeyDeviceActionTypes\";\nexport {\n type SignTransactionDAError,\n type SignTransactionDAIntermediateValue,\n type SignTransactionDAOutput,\n type SignTransactionDAReturnType,\n} from \"@api/app-binder/SignTransactionDeviceActionTypes\";\nexport { type PublicKey } from \"@api/model/PublicKey\";\nexport { type Signature } from \"@api/model/Signature\";\nexport { type SignerConcordium } from \"@api/SignerConcordium\";\nexport { SignerConcordiumBuilder } from \"@api/SignerConcordiumBuilder\";\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wEAAAE,EAAAF,GAeA,IAAAG,EAAwC",
|
|
6
|
+
"names": ["api_exports", "__export", "__toCommonJS", "import_SignerConcordiumBuilder"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var r=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var u=(y,e,t,p)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of c(e))!l.call(y,i)&&i!==t&&r(y,i,{get:()=>e[i],enumerable:!(p=b(e,i))||p.enumerable});return y};var K=y=>u(r({},"__esModule",{value:!0}),y);var a={};module.exports=K(a);
|
|
2
|
+
//# sourceMappingURL=PublicKey.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var i=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var o=(t,r,n,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of y(r))!g.call(t,e)&&e!==n&&i(t,e,{get:()=>r[e],enumerable:!(a=p(r,e))||a.enumerable});return t};var u=t=>o(i({},"__esModule",{value:!0}),t);var x={};module.exports=u(x);
|
|
2
|
+
//# sourceMappingURL=Signature.js.map
|
package/lib/cjs/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var x=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var f=(r,o,t,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let m of b(o))!c.call(r,m)&&m!==t&&x(r,m,{get:()=>o[m],enumerable:!(i=a(o,m))||i.enumerable});return r},e=(r,o,t)=>(f(r,o,"default"),t&&f(t,o,"default"));var d=r=>f(x({},"__esModule",{value:!0}),r);var p={};module.exports=d(p);var h=require("reflect-metadata");e(p,require("./api/index"),module.exports);0&&(module.exports={...require("./api/index")});
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["// inversify requirement\nimport \"reflect-metadata\";\n\nexport * from \"@api/index\";\n"],
|
|
5
|
+
"mappings": "iaAAA,IAAAA,EAAA,kBAAAC,EAAAD,GACA,IAAAE,EAAO,4BAEPC,EAAAH,EAAc,sBAHd",
|
|
6
|
+
"names": ["index_exports", "__toCommonJS", "import_reflect_metadata", "__reExport"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var o=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var y=(n,e)=>{for(var t in e)o(n,t,{get:e[t],enumerable:!0})},g=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of m(e))!u.call(n,i)&&i!==t&&o(n,i,{get:()=>e[i],enumerable:!(r=p(e,i))||r.enumerable});return n};var C=n=>g(o({},"__esModule",{value:!0}),n);var T={};y(T,{DefaultSignerConcordium:()=>l});module.exports=C(T);var s=require("./di"),a=require("./use-cases/publickey/di/publicKeyTypes"),c=require("./use-cases/transaction/di/transactionTypes");class l{_container;constructor({dmk:e,sessionId:t}){this._container=(0,s.makeContainer)({dmk:e,sessionId:t})}getPublicKey(e,t){return this._container.get(a.publicKeyTypes.GetPublicKeyUseCase).execute(e,t)}signTransaction(e,t,r){return this._container.get(c.transactionTypes.SignTransactionUseCase).execute(e,t,r)}}0&&(module.exports={DefaultSignerConcordium});
|
|
2
|
+
//# sourceMappingURL=DefaultSignerConcordium.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/internal/DefaultSignerConcordium.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n type DeviceManagementKit,\n type DeviceSessionId,\n} from \"@ledgerhq/device-management-kit\";\nimport { type Container } from \"inversify\";\n\nimport { type GetPublicKeyDAReturnType } from \"@api/app-binder/GetPublicKeyDeviceActionTypes\";\nimport { type SignTransactionDAReturnType } from \"@api/app-binder/SignTransactionDeviceActionTypes\";\nimport {\n type PublicKeyOptions,\n type SignerConcordium,\n type TransactionOptions,\n} from \"@api/SignerConcordium\";\nimport { makeContainer } from \"@internal/di\";\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\";\n\ntype DefaultSignerConcordiumConstructorArgs = {\n dmk: DeviceManagementKit;\n sessionId: DeviceSessionId;\n};\n\nexport class DefaultSignerConcordium implements SignerConcordium {\n private readonly _container: Container;\n\n constructor({ dmk, sessionId }: DefaultSignerConcordiumConstructorArgs) {\n this._container = makeContainer({ dmk, sessionId });\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"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,6BAAAE,IAAA,eAAAC,EAAAH,GAaA,IAAAI,EAA8B,wBAC9BC,EAA+B,2DAE/BC,EAAiC,+DAQ1B,MAAMJ,CAAoD,CAC9C,WAEjB,YAAY,CAAE,IAAAK,EAAK,UAAAC,CAAU,EAA2C,CACtE,KAAK,cAAa,iBAAc,CAAE,IAAAD,EAAK,UAAAC,CAAU,CAAC,CACpD,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,CACF",
|
|
6
|
+
"names": ["DefaultSignerConcordium_exports", "__export", "DefaultSignerConcordium", "__toCommonJS", "import_di", "import_publicKeyTypes", "import_transactionTypes", "dmk", "sessionId", "derivationPath", "options", "transaction"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var c=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var D=Object.prototype.hasOwnProperty;var I=(i,e)=>{for(var n in e)c(i,n,{get:e[n],enumerable:!0})},h=(i,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of v(e))!D.call(i,t)&&t!==n&&c(i,t,{get:()=>e[t],enumerable:!(r=u(e,t))||r.enumerable});return i};var T=i=>h(c({},"__esModule",{value:!0}),i),k=(i,e,n,r)=>{for(var t=r>1?void 0:r?u(e,n):e,g=i.length-1,d;g>=0;g--)(d=i[g])&&(t=(r?d(e,n,t):d(t))||t);return r&&t&&c(e,n,t),t},p=(i,e)=>(n,r)=>e(n,r,i);var P={};I(P,{ConcordiumAppBinder:()=>a});module.exports=T(P);var o=require("@ledgerhq/device-management-kit"),s=require("inversify"),A=require("../app-binder/command/GetPublicKeyCommand"),y=require("../app-binder/constants"),l=require("../app-binder/task/SendInChunksTask"),m=require("../externalTypes");let a=class{constructor(e,n,r){this.dmk=e;this.sessionId=n;this.dmkLoggerFactory=r}getPublicKey(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new o.SendCommandInAppDeviceAction({input:{command:new A.GetPublicKeyCommand(e),appName:y.APP_NAME,requiredUserInteraction:e.checkOnDevice?o.UserInteractionRequired.VerifyAddress:o.UserInteractionRequired.None,skipOpenApp:e.skipOpenApp},logger:this.dmkLoggerFactory("GetPublicKeyCommand")})})}signTransaction(e){return this.dmk.executeDeviceAction({sessionId:this.sessionId,deviceAction:new o.CallTaskInAppDeviceAction({input:{task:async n=>new l.SendInChunksTask(n,e,this.dmkLoggerFactory("SendInChunksTask")).run(),appName:y.APP_NAME,requiredUserInteraction:o.UserInteractionRequired.SignTransaction,skipOpenApp:e.skipOpenApp??!1},logger:this.dmkLoggerFactory("SignTransferCommand")})})}};a=k([(0,s.injectable)(),p(0,(0,s.inject)(m.externalTypes.Dmk)),p(1,(0,s.inject)(m.externalTypes.SessionId)),p(2,(0,s.inject)(m.externalTypes.DmkLoggerFactory))],a);0&&(module.exports={ConcordiumAppBinder});
|
|
2
|
+
//# sourceMappingURL=ConcordiumAppBinder.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/internal/app-binder/ConcordiumAppBinder.ts"],
|
|
4
|
+
"sourcesContent": ["import {\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 GetPublicKeyDAReturnType } from \"@api/app-binder/GetPublicKeyDeviceActionTypes\";\nimport { type SignTransactionDAReturnType } from \"@api/app-binder/SignTransactionDeviceActionTypes\";\nimport {\n GetPublicKeyCommand,\n type GetPublicKeyCommandArgs,\n} from \"@internal/app-binder/command/GetPublicKeyCommand\";\nimport { APP_NAME } from \"@internal/app-binder/constants\";\nimport { SendInChunksTask } from \"@internal/app-binder/task/SendInChunksTask\";\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 ) {}\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 new SendInChunksTask(\n internalApi,\n args,\n this.dmkLoggerFactory(\"SendInChunksTask\"),\n ).run(),\n appName: APP_NAME,\n requiredUserInteraction: UserInteractionRequired.SignTransaction,\n skipOpenApp: args.skipOpenApp ?? false,\n },\n logger: this.dmkLoggerFactory(\"SignTransferCommand\"),\n }),\n });\n }\n}\n"],
|
|
5
|
+
"mappings": "okBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAOO,2CACPC,EAAmC,qBAInCC,EAGO,4DACPC,EAAyB,0CACzBC,EAAiC,sDACjCC,EAA8B,mCAGvB,IAAMC,EAAN,KAA0B,CAC/B,YACqCC,EACMC,EAEjCC,EACR,CAJmC,SAAAF,EACM,eAAAC,EAEjC,sBAAAC,CACP,CAEH,aAAaC,EAAyD,CACpE,OAAO,KAAK,IAAI,oBAAoB,CAClC,UAAW,KAAK,UAChB,aAAc,IAAI,+BAA6B,CAC7C,MAAO,CACL,QAAS,IAAI,sBAAoBA,CAAI,EACrC,QAAS,WACT,wBAAyBA,EAAK,cAC1B,0BAAwB,cACxB,0BAAwB,KAC5B,YAAaA,EAAK,WACpB,EACA,OAAQ,KAAK,iBAAiB,qBAAqB,CACrD,CAAC,CACH,CAAC,CACH,CAEA,gBAAgBA,EAIgB,CAC9B,OAAO,KAAK,IAAI,oBAAoB,CAClC,UAAW,KAAK,UAChB,aAAc,IAAI,4BAA0B,CAC1C,MAAO,CACL,KAAM,MAAOC,GACX,IAAI,mBACFA,EACAD,EACA,KAAK,iBAAiB,kBAAkB,CAC1C,EAAE,IAAI,EACR,QAAS,WACT,wBAAyB,0BAAwB,gBACjD,YAAaA,EAAK,aAAe,EACnC,EACA,OAAQ,KAAK,iBAAiB,qBAAqB,CACrD,CAAC,CACH,CAAC,CACH,CACF,EAhDaJ,EAANM,EAAA,IADN,cAAW,EAGPC,EAAA,eAAO,gBAAc,GAAG,GACxBA,EAAA,eAAO,gBAAc,SAAS,GAC9BA,EAAA,eAAO,gBAAc,gBAAgB,IAJ7BP",
|
|
6
|
+
"names": ["ConcordiumAppBinder_exports", "__export", "ConcordiumAppBinder", "__toCommonJS", "import_device_management_kit", "import_inversify", "import_GetPublicKeyCommand", "import_constants", "import_SendInChunksTask", "import_externalTypes", "ConcordiumAppBinder", "dmk", "sessionId", "dmkLoggerFactory", "args", "internalApi", "__decorateClass", "__decorateParam"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var i=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var C=(t,e)=>{for(var n in e)i(t,n,{get:e[n],enumerable:!0})},P=(t,e,n,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let d of c(e))!y.call(t,d)&&d!==n&&i(t,d,{get:()=>e[d],enumerable:!(a=l(e,d))||a.enumerable});return t};var b=t=>P(i({},"__esModule",{value:!0}),t);var A={};C(A,{GetPublicKeyCommand:()=>R});module.exports=b(A);var r=require("@ledgerhq/device-management-kit"),s=require("@ledgerhq/signer-utils"),p=require("purify-ts"),m=require("../../app-binder/command/utils/ConcordiumApplicationErrors"),u=require("../../app-binder/command/utils/EncodeDerivationPath"),o=require("../../app-binder/constants");const E=32;class R{name="GetPublicKey";args;errorHelper=new s.CommandErrorHelper(m.CONCORDIUM_APP_ERRORS,m.ConcordiumAppCommandErrorFactory);constructor(e){this.args=e}getApdu(){const e=new r.ApduBuilder({cla:o.LEDGER_CLA,ins:o.INS.GET_PUBLIC_KEY,p1:this.args.checkOnDevice?o.P1.CONFIRM:o.P1.NON_CONFIRM,p2:o.P2.NONE}),n=(0,u.encodeDerivationPath)(this.args.derivationPath);return e.addBufferToData(n),e.build()}parseResponse(e){return p.Maybe.fromNullable(this.errorHelper.getError(e)).orDefaultLazy(()=>{const a=new r.ApduParser(e).extractFieldByLength(E);return a===void 0?(0,r.CommandResultFactory)({error:new r.InvalidStatusWordError("Public key is missing")}):(0,r.CommandResultFactory)({data:{publicKey:a}})})}}0&&(module.exports={GetPublicKeyCommand});
|
|
2
|
+
//# sourceMappingURL=GetPublicKeyCommand.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/internal/app-binder/command/GetPublicKeyCommand.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n type Apdu,\n ApduBuilder,\n ApduParser,\n type ApduResponse,\n type Command,\n type CommandResult,\n CommandResultFactory,\n InvalidStatusWordError,\n} from \"@ledgerhq/device-management-kit\";\nimport { CommandErrorHelper } from \"@ledgerhq/signer-utils\";\nimport { Maybe } from \"purify-ts\";\n\nimport { type PublicKey } from \"@api/model/PublicKey\";\nimport {\n CONCORDIUM_APP_ERRORS,\n ConcordiumAppCommandErrorFactory,\n type ConcordiumErrorCodes,\n} from \"@internal/app-binder/command/utils/ConcordiumApplicationErrors\";\nimport { encodeDerivationPath } from \"@internal/app-binder/command/utils/EncodeDerivationPath\";\nimport { INS, LEDGER_CLA, P1, P2 } from \"@internal/app-binder/constants\";\n\nconst PUBLIC_KEY_LENGTH = 32;\n\nexport type GetPublicKeyCommandArgs = {\n readonly derivationPath: string;\n readonly checkOnDevice: boolean;\n readonly skipOpenApp: boolean;\n};\n\nexport type GetPublicKeyCommandResponse = PublicKey;\n\nexport class GetPublicKeyCommand\n implements\n Command<\n GetPublicKeyCommandResponse,\n GetPublicKeyCommandArgs,\n ConcordiumErrorCodes\n >\n{\n readonly name = \"GetPublicKey\";\n\n private readonly args: GetPublicKeyCommandArgs;\n\n private readonly errorHelper = new CommandErrorHelper<\n GetPublicKeyCommandResponse,\n ConcordiumErrorCodes\n >(CONCORDIUM_APP_ERRORS, ConcordiumAppCommandErrorFactory);\n\n constructor(args: GetPublicKeyCommandArgs) {\n this.args = args;\n }\n\n getApdu(): Apdu {\n const apduBuilder = new ApduBuilder({\n cla: LEDGER_CLA,\n ins: INS.GET_PUBLIC_KEY,\n p1: this.args.checkOnDevice ? P1.CONFIRM : P1.NON_CONFIRM,\n p2: P2.NONE,\n });\n\n const encodedPath = encodeDerivationPath(this.args.derivationPath);\n apduBuilder.addBufferToData(encodedPath);\n\n return apduBuilder.build();\n }\n\n parseResponse(\n apduResponse: ApduResponse,\n ): CommandResult<GetPublicKeyCommandResponse, ConcordiumErrorCodes> {\n return Maybe.fromNullable(\n this.errorHelper.getError(apduResponse),\n ).orDefaultLazy(() => {\n const apduParser = new ApduParser(apduResponse);\n const publicKey = apduParser.extractFieldByLength(PUBLIC_KEY_LENGTH);\n\n if (publicKey === undefined) {\n return CommandResultFactory({\n error: new InvalidStatusWordError(\"Public key is missing\"),\n });\n }\n\n return CommandResultFactory({\n data: { publicKey },\n });\n });\n }\n}\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EASO,2CACPC,EAAmC,kCACnCC,EAAsB,qBAGtBC,EAIO,0EACPC,EAAqC,mEACrCC,EAAwC,0CAExC,MAAMC,EAAoB,GAUnB,MAAMR,CAOb,CACW,KAAO,eAEC,KAEA,YAAc,IAAI,qBAGjC,wBAAuB,kCAAgC,EAEzD,YAAYS,EAA+B,CACzC,KAAK,KAAOA,CACd,CAEA,SAAgB,CACd,MAAMC,EAAc,IAAI,cAAY,CAClC,IAAK,aACL,IAAK,MAAI,eACT,GAAI,KAAK,KAAK,cAAgB,KAAG,QAAU,KAAG,YAC9C,GAAI,KAAG,IACT,CAAC,EAEKC,KAAc,wBAAqB,KAAK,KAAK,cAAc,EACjE,OAAAD,EAAY,gBAAgBC,CAAW,EAEhCD,EAAY,MAAM,CAC3B,CAEA,cACEE,EACkE,CAClE,OAAO,QAAM,aACX,KAAK,YAAY,SAASA,CAAY,CACxC,EAAE,cAAc,IAAM,CAEpB,MAAMC,EADa,IAAI,aAAWD,CAAY,EACjB,qBAAqBJ,CAAiB,EAEnE,OAAIK,IAAc,UACT,wBAAqB,CAC1B,MAAO,IAAI,yBAAuB,uBAAuB,CAC3D,CAAC,KAGI,wBAAqB,CAC1B,KAAM,CAAE,UAAAA,CAAU,CACpB,CAAC,CACH,CAAC,CACH,CACF",
|
|
6
|
+
"names": ["GetPublicKeyCommand_exports", "__export", "GetPublicKeyCommand", "__toCommonJS", "import_device_management_kit", "import_signer_utils", "import_purify_ts", "import_ConcordiumApplicationErrors", "import_EncodeDerivationPath", "import_constants", "PUBLIC_KEY_LENGTH", "args", "apduBuilder", "encodedPath", "apduResponse", "publicKey"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var t=require("@ledgerhq/device-management-kit"),s=require("../../app-binder/command/GetPublicKeyCommand"),i=require("../../app-binder/command/utils/ConcordiumApplicationErrors"),n=require("../../app-binder/constants");const c="44'/919'/0'/0'/0'";describe("GetPublicKeyCommand",()=>{describe("getApdu",()=>{it("should build APDU with correct header for non-confirm",()=>{const e=new s.GetPublicKeyCommand({derivationPath:c,checkOnDevice:!1,skipOpenApp:!1}).getApdu().getRawApdu();expect(e[0]).toBe(n.LEDGER_CLA),expect(e[1]).toBe(n.INS.GET_PUBLIC_KEY),expect(e[2]).toBe(n.P1.NON_CONFIRM),expect(e[3]).toBe(n.P2.NONE)}),it("should build APDU with CONFIRM P1 when checkOnDevice is true",()=>{const e=new s.GetPublicKeyCommand({derivationPath:c,checkOnDevice:!0,skipOpenApp:!1}).getApdu().getRawApdu();expect(e[2]).toBe(n.P1.CONFIRM)}),it("should include encoded derivation path in data",()=>{const e=new s.GetPublicKeyCommand({derivationPath:c,checkOnDevice:!1,skipOpenApp:!1}).getApdu().getRawApdu();expect(e[5]).toBe(5),expect(e.length).toBe(26)})}),describe("parseResponse",()=>{it("should extract 32-byte public key on success",()=>{const r=new s.GetPublicKeyCommand({derivationPath:c,checkOnDevice:!1,skipOpenApp:!1}),e=new Uint8Array(32).fill(170),o=new t.ApduResponse({statusCode:new Uint8Array([144,0]),data:e}),a=r.parseResponse(o);expect((0,t.isSuccessCommandResult)(a)).toBe(!0),(0,t.isSuccessCommandResult)(a)&&expect(a.data.publicKey).toStrictEqual(e)}),it("should return InvalidStatusWordError when data is too short",()=>{const r=new s.GetPublicKeyCommand({derivationPath:c,checkOnDevice:!1,skipOpenApp:!1}),e=new t.ApduResponse({statusCode:new Uint8Array([144,0]),data:new Uint8Array(10)}),o=r.parseResponse(e);expect((0,t.isSuccessCommandResult)(o)).toBe(!1),(0,t.isSuccessCommandResult)(o)||expect(o.error).toBeInstanceOf(t.InvalidStatusWordError)}),it("should return ConcordiumAppCommandError on user rejection",()=>{const r=new s.GetPublicKeyCommand({derivationPath:c,checkOnDevice:!1,skipOpenApp:!1}),e=new t.ApduResponse({statusCode:new Uint8Array([105,133]),data:new Uint8Array([])}),o=r.parseResponse(e);if(expect((0,t.isSuccessCommandResult)(o)).toBe(!1),!(0,t.isSuccessCommandResult)(o)){const a=o.error;expect(a.errorCode).toBe(i.ConcordiumErrorCodes.USER_REJECTED)}})})});
|
|
2
|
+
//# sourceMappingURL=GetPublicKeyCommand.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/internal/app-binder/command/GetPublicKeyCommand.test.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n ApduResponse,\n InvalidStatusWordError,\n isSuccessCommandResult,\n} from \"@ledgerhq/device-management-kit\";\n\nimport { GetPublicKeyCommand } from \"@internal/app-binder/command/GetPublicKeyCommand\";\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 DERIVATION_PATH = \"44'/919'/0'/0'/0'\";\n\ndescribe(\"GetPublicKeyCommand\", () => {\n describe(\"getApdu\", () => {\n it(\"should build APDU with correct header for non-confirm\", () => {\n const command = new GetPublicKeyCommand({\n derivationPath: DERIVATION_PATH,\n checkOnDevice: false,\n skipOpenApp: false,\n });\n\n const raw = command.getApdu().getRawApdu();\n\n expect(raw[0]).toBe(LEDGER_CLA);\n expect(raw[1]).toBe(INS.GET_PUBLIC_KEY);\n expect(raw[2]).toBe(P1.NON_CONFIRM);\n expect(raw[3]).toBe(P2.NONE);\n });\n\n it(\"should build APDU with CONFIRM P1 when checkOnDevice is true\", () => {\n const command = new GetPublicKeyCommand({\n derivationPath: DERIVATION_PATH,\n checkOnDevice: true,\n skipOpenApp: false,\n });\n\n const raw = command.getApdu().getRawApdu();\n\n expect(raw[2]).toBe(P1.CONFIRM);\n });\n\n it(\"should include encoded derivation path in data\", () => {\n const command = new GetPublicKeyCommand({\n derivationPath: DERIVATION_PATH,\n checkOnDevice: false,\n skipOpenApp: false,\n });\n\n const raw = command.getApdu().getRawApdu();\n // Data starts at byte 5; first byte is path length\n expect(raw[5]).toBe(5);\n // Total data: 1 (length) + 5*4 (path elements) = 21 bytes\n expect(raw.length).toBe(5 + 21);\n });\n });\n\n describe(\"parseResponse\", () => {\n it(\"should extract 32-byte public key on success\", () => {\n const command = new GetPublicKeyCommand({\n derivationPath: DERIVATION_PATH,\n checkOnDevice: false,\n skipOpenApp: false,\n });\n\n const pubKey = new Uint8Array(32).fill(0xaa);\n const response = new ApduResponse({\n statusCode: new Uint8Array([0x90, 0x00]),\n data: pubKey,\n });\n\n const result = command.parseResponse(response);\n\n expect(isSuccessCommandResult(result)).toBe(true);\n if (isSuccessCommandResult(result)) {\n expect(result.data.publicKey).toStrictEqual(pubKey);\n }\n });\n\n it(\"should return InvalidStatusWordError when data is too short\", () => {\n const command = new GetPublicKeyCommand({\n derivationPath: DERIVATION_PATH,\n checkOnDevice: false,\n skipOpenApp: false,\n });\n\n const response = new ApduResponse({\n statusCode: new Uint8Array([0x90, 0x00]),\n data: new Uint8Array(10),\n });\n\n const result = command.parseResponse(response);\n\n expect(isSuccessCommandResult(result)).toBe(false);\n if (!isSuccessCommandResult(result)) {\n expect(result.error).toBeInstanceOf(InvalidStatusWordError);\n }\n });\n\n it(\"should return ConcordiumAppCommandError on user rejection\", () => {\n const command = new GetPublicKeyCommand({\n derivationPath: DERIVATION_PATH,\n checkOnDevice: false,\n skipOpenApp: false,\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});\n"],
|
|
5
|
+
"mappings": "aAAA,IAAAA,EAIO,2CAEPC,EAAoC,4DACpCC,EAGO,0EACPC,EAAwC,0CAExC,MAAMC,EAAkB,oBAExB,SAAS,sBAAuB,IAAM,CACpC,SAAS,UAAW,IAAM,CACxB,GAAG,wDAAyD,IAAM,CAOhE,MAAMC,EANU,IAAI,sBAAoB,CACtC,eAAgBD,EAChB,cAAe,GACf,YAAa,EACf,CAAC,EAEmB,QAAQ,EAAE,WAAW,EAEzC,OAAOC,EAAI,CAAC,CAAC,EAAE,KAAK,YAAU,EAC9B,OAAOA,EAAI,CAAC,CAAC,EAAE,KAAK,MAAI,cAAc,EACtC,OAAOA,EAAI,CAAC,CAAC,EAAE,KAAK,KAAG,WAAW,EAClC,OAAOA,EAAI,CAAC,CAAC,EAAE,KAAK,KAAG,IAAI,CAC7B,CAAC,EAED,GAAG,+DAAgE,IAAM,CAOvE,MAAMA,EANU,IAAI,sBAAoB,CACtC,eAAgBD,EAChB,cAAe,GACf,YAAa,EACf,CAAC,EAEmB,QAAQ,EAAE,WAAW,EAEzC,OAAOC,EAAI,CAAC,CAAC,EAAE,KAAK,KAAG,OAAO,CAChC,CAAC,EAED,GAAG,iDAAkD,IAAM,CAOzD,MAAMA,EANU,IAAI,sBAAoB,CACtC,eAAgBD,EAChB,cAAe,GACf,YAAa,EACf,CAAC,EAEmB,QAAQ,EAAE,WAAW,EAEzC,OAAOC,EAAI,CAAC,CAAC,EAAE,KAAK,CAAC,EAErB,OAAOA,EAAI,MAAM,EAAE,KAAK,EAAM,CAChC,CAAC,CACH,CAAC,EAED,SAAS,gBAAiB,IAAM,CAC9B,GAAG,+CAAgD,IAAM,CACvD,MAAMC,EAAU,IAAI,sBAAoB,CACtC,eAAgBF,EAChB,cAAe,GACf,YAAa,EACf,CAAC,EAEKG,EAAS,IAAI,WAAW,EAAE,EAAE,KAAK,GAAI,EACrCC,EAAW,IAAI,eAAa,CAChC,WAAY,IAAI,WAAW,CAAC,IAAM,CAAI,CAAC,EACvC,KAAMD,CACR,CAAC,EAEKE,EAASH,EAAQ,cAAcE,CAAQ,EAE7C,UAAO,0BAAuBC,CAAM,CAAC,EAAE,KAAK,EAAI,KAC5C,0BAAuBA,CAAM,GAC/B,OAAOA,EAAO,KAAK,SAAS,EAAE,cAAcF,CAAM,CAEtD,CAAC,EAED,GAAG,8DAA+D,IAAM,CACtE,MAAMD,EAAU,IAAI,sBAAoB,CACtC,eAAgBF,EAChB,cAAe,GACf,YAAa,EACf,CAAC,EAEKI,EAAW,IAAI,eAAa,CAChC,WAAY,IAAI,WAAW,CAAC,IAAM,CAAI,CAAC,EACvC,KAAM,IAAI,WAAW,EAAE,CACzB,CAAC,EAEKC,EAASH,EAAQ,cAAcE,CAAQ,EAE7C,UAAO,0BAAuBC,CAAM,CAAC,EAAE,KAAK,EAAK,KAC5C,0BAAuBA,CAAM,GAChC,OAAOA,EAAO,KAAK,EAAE,eAAe,wBAAsB,CAE9D,CAAC,EAED,GAAG,4DAA6D,IAAM,CACpE,MAAMH,EAAU,IAAI,sBAAoB,CACtC,eAAgBF,EAChB,cAAe,GACf,YAAa,EACf,CAAC,EAEKI,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,CACH,CAAC,CACH,CAAC",
|
|
6
|
+
"names": ["import_device_management_kit", "import_GetPublicKeyCommand", "import_ConcordiumApplicationErrors", "import_constants", "DERIVATION_PATH", "raw", "command", "pubKey", "response", "result", "err"]
|
|
7
|
+
}
|
|
@@ -0,0 +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});
|
|
2
|
+
//# sourceMappingURL=SignTransferCommand.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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",
|
|
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
|
+
}
|
|
@@ -0,0 +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)}})})});
|
|
2
|
+
//# sourceMappingURL=SignTransferCommand.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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,EACf,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,KAAG,IAAI,CAC7B,CAAC,EAED,GAAG,iDAAkD,IAAM,CAMzD,MAAMA,EALU,IAAI,sBAAoB,CACtC,YAAa,IAAI,WAAW,EAAE,EAAE,KAAK,CAAI,EACzC,YAAa,EACf,CAAC,EAEmB,QAAQ,EAAE,WAAW,EAEzC,OAAOA,EAAI,CAAC,CAAC,EAAE,KAAK,KAAG,IAAI,CAC7B,CAAC,EAED,GAAG,8CAA+C,IAAM,CACtD,MAAMC,EAAO,IAAI,WAAW,CAAC,IAAM,IAAM,IAAM,GAAI,CAAC,EAM9CD,EALU,IAAI,sBAAoB,CACtC,YAAaC,EACb,YAAa,EACf,CAAC,EAEmB,QAAQ,EAAE,WAAW,EAEzC,OAAOD,EAAI,MAAM,CAAC,CAAC,EAAE,cAAcC,CAAI,CACzC,CAAC,CACH,CAAC,EAED,SAAS,gBAAiB,IAAM,CAC9B,GAAG,4CAA6C,IAAM,CACpD,MAAMC,EAAU,IAAI,sBAAoB,CACtC,YAAa,IAAI,WAAW,EAAE,EAC9B,YAAa,EACf,CAAC,EAEKC,EAAY,IAAI,WAAW,EAAE,EAAE,KAAK,GAAI,EACxCC,EAAW,IAAI,eAAa,CAChC,WAAY,IAAI,WAAW,CAAC,IAAM,CAAI,CAAC,EACvC,KAAMD,CACR,CAAC,EAEKE,EAASH,EAAQ,cAAcE,CAAQ,EAE7C,UAAO,0BAAuBC,CAAM,CAAC,EAAE,KAAK,EAAI,KAC5C,0BAAuBA,CAAM,GAC/B,OAAOA,EAAO,IAAI,EAAE,cAAcF,CAAS,CAE/C,CAAC,EAED,GAAG,2DAA4D,IAAM,CACnE,MAAMD,EAAU,IAAI,sBAAoB,CACtC,YAAa,IAAI,WAAW,EAAE,EAC9B,YAAa,EACf,CAAC,EAEKE,EAAW,IAAI,eAAa,CAChC,WAAY,IAAI,WAAW,CAAC,IAAM,CAAI,CAAC,EACvC,KAAM,IAAI,WAAW,CAAC,CAAC,CACzB,CAAC,EAEKC,EAASH,EAAQ,cAAcE,CAAQ,EAE7C,UAAO,0BAAuBC,CAAM,CAAC,EAAE,KAAK,EAAI,CAClD,CAAC,EAED,GAAG,4DAA6D,IAAM,CACpE,MAAMH,EAAU,IAAI,sBAAoB,CACtC,YAAa,IAAI,WAAW,EAAE,EAC9B,YAAa,EACf,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,sBAAoB,CACtC,YAAa,IAAI,WAAW,EAAE,EAC9B,YAAa,EACf,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", "data", "command", "signature", "response", "result", "err"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var a=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var A=(e,r)=>{for(var s in r)a(e,s,{get:r[s],enumerable:!0})},g=(e,r,s,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let m of C(r))!c.call(e,m)&&m!==s&&a(e,m,{get:()=>r[m],enumerable:!(n=d(r,m))||n.enumerable});return e};var R=e=>g(a({},"__esModule",{value:!0}),e);var _={};A(_,{CONCORDIUM_APP_ERRORS:()=>D,ConcordiumAppCommandError:()=>p,ConcordiumAppCommandErrorFactory:()=>O,ConcordiumErrorCodes:()=>E});module.exports=R(_);var t=require("@ledgerhq/device-management-kit"),E=(o=>(o.USER_REJECTED="6985",o.LOCKED_DEVICE="5515",o.DATA_INVALID="6a80",o.INS_NOT_SUPPORTED="6d00",o.CLA_NOT_SUPPORTED="6e00",o.UNKNOWN_ERROR="6f00",o))(E||{});const D={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"}};class p extends t.DeviceExchangeError{constructor(r){super({tag:"ConcordiumAppCommandError",...r})}}const O=e=>new p(e);0&&(module.exports={CONCORDIUM_APP_ERRORS,ConcordiumAppCommandError,ConcordiumAppCommandErrorFactory,ConcordiumErrorCodes});
|
|
2
|
+
//# sourceMappingURL=ConcordiumApplicationErrors.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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}\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};\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,OANNA,OAAA,IASL,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,CACrC,EAEO,MAAMC,UAAkC,qBAA0C,CACvF,YAAYK,EAA8C,CACxD,MAAM,CAAE,IAAK,4BAA6B,GAAGA,CAAK,CAAC,CACrD,CACF,CAEO,MAAMJ,EACXI,GACG,IAAIL,EAA0BK,CAAI",
|
|
6
|
+
"names": ["ConcordiumApplicationErrors_exports", "__export", "CONCORDIUM_APP_ERRORS", "ConcordiumAppCommandError", "ConcordiumAppCommandErrorFactory", "ConcordiumErrorCodes", "__toCommonJS", "import_device_management_kit", "args"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var f=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var c=(e,t)=>{for(var n in t)f(e,n,{get:t[n],enumerable:!0})},w=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of h(t))!l.call(e,a)&&a!==n&&f(e,a,{get:()=>t[a],enumerable:!(r=s(t,a))||r.enumerable});return e};var U=e=>w(f({},"__esModule",{value:!0}),e);var p={};c(p,{encodeDerivationPath:()=>g});module.exports=U(p);var i=require("@ledgerhq/signer-utils");const g=e=>{const t=i.DerivationPathUtils.splitPath(e),n=new DataView(new ArrayBuffer(1+t.length*4));n.setUint8(0,t.length);for(let r=0;r<t.length;r++){const o=(2147483648|t[r]&2147483647)>>>0;n.setUint32(1+r*4,o,!1)}return new Uint8Array(n.buffer)};0&&(module.exports={encodeDerivationPath});
|
|
2
|
+
//# sourceMappingURL=EncodeDerivationPath.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/internal/app-binder/command/utils/EncodeDerivationPath.ts"],
|
|
4
|
+
"sourcesContent": ["import { DerivationPathUtils } from \"@ledgerhq/signer-utils\";\n\n/**\n * Encode a Concordium derivation path string as a Uint8Array.\n *\n * Concordium BIP44 path: 44'/919'/account'/identity'/credential'\n * (without \"m/\" prefix \u2014 DerivationPathUtils.splitPath does not accept it)\n *\n * All elements are hardened in the output regardless of input.\n *\n * Output format matches firmware expectation:\n * [path_length: 1 byte][element_0: 4 bytes BE]...[element_n: 4 bytes BE]\n */\nexport const encodeDerivationPath = (derivationPath: string): Uint8Array => {\n const paths = DerivationPathUtils.splitPath(derivationPath);\n const buf = new DataView(new ArrayBuffer(1 + paths.length * 4));\n buf.setUint8(0, paths.length);\n for (let i = 0; i < paths.length; i++) {\n const raw = paths[i]! & 0x7fffffff;\n const hardened = (0x80000000 | raw) >>> 0;\n buf.setUint32(1 + i * 4, hardened, false);\n }\n return new Uint8Array(buf.buffer);\n};\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAoC,kCAa7B,MAAMF,EAAwBG,GAAuC,CAC1E,MAAMC,EAAQ,sBAAoB,UAAUD,CAAc,EACpDE,EAAM,IAAI,SAAS,IAAI,YAAY,EAAID,EAAM,OAAS,CAAC,CAAC,EAC9DC,EAAI,SAAS,EAAGD,EAAM,MAAM,EAC5B,QAASE,EAAI,EAAGA,EAAIF,EAAM,OAAQE,IAAK,CAErC,MAAMC,GAAY,WADNH,EAAME,CAAC,EAAK,cACgB,EACxCD,EAAI,UAAU,EAAIC,EAAI,EAAGC,EAAU,EAAK,CAC1C,CACA,OAAO,IAAI,WAAWF,EAAI,MAAM,CAClC",
|
|
6
|
+
"names": ["EncodeDerivationPath_exports", "__export", "encodeDerivationPath", "__toCommonJS", "import_signer_utils", "derivationPath", "paths", "buf", "i", "hardened"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var o=require("../../../app-binder/command/utils/EncodeDerivationPath");describe("encodeDerivationPath",()=>{it("should encode a standard 5-element Concordium path",()=>{const e=(0,o.encodeDerivationPath)("44'/919'/0'/0'/0'");expect(e).toHaveLength(21),expect(e[0]).toBe(5);const t=new DataView(e.buffer,e.byteOffset);expect(t.getUint32(1,!1)).toBe(2147483692),expect(t.getUint32(5,!1)).toBe(2147484567),expect(t.getUint32(9,!1)).toBe(2147483648),expect(t.getUint32(13,!1)).toBe(2147483648),expect(t.getUint32(17,!1)).toBe(2147483648)}),it("should harden all elements regardless of input",()=>{const e=(0,o.encodeDerivationPath)("44/919/0/0/0"),t=new DataView(e.buffer,e.byteOffset);expect(t.getUint32(1,!1)).toBe(2147483692),expect(t.getUint32(5,!1)).toBe(2147484567)}),it("should encode paths with non-zero identity and credential indices",()=>{const e=(0,o.encodeDerivationPath)("44'/919'/0'/3'/7'"),t=new DataView(e.buffer,e.byteOffset);expect(t.getUint32(13,!1)).toBe(2147483651),expect(t.getUint32(17,!1)).toBe(2147483655)}),it("should use big-endian byte order",()=>{const e=(0,o.encodeDerivationPath)("44'/919'/0'/0'/0'");expect(e[1]).toBe(128),expect(e[2]).toBe(0),expect(e[3]).toBe(0),expect(e[4]).toBe(44)}),it("should throw on invalid path input",()=>{expect(()=>(0,o.encodeDerivationPath)("m/44'/919'/0'/0'/0'")).toThrow()})});
|
|
2
|
+
//# sourceMappingURL=EncodeDerivationPath.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/internal/app-binder/command/utils/EncodeDerivationPath.test.ts"],
|
|
4
|
+
"sourcesContent": ["import { encodeDerivationPath } from \"@internal/app-binder/command/utils/EncodeDerivationPath\";\n\ndescribe(\"encodeDerivationPath\", () => {\n it(\"should encode a standard 5-element Concordium path\", () => {\n const result = encodeDerivationPath(\"44'/919'/0'/0'/0'\");\n\n // 1 byte length + 5 * 4 bytes = 21 bytes\n expect(result).toHaveLength(21);\n\n // First byte: path length\n expect(result[0]).toBe(5);\n\n const view = new DataView(result.buffer, result.byteOffset);\n\n // 44' = 44 | 0x80000000 = 0x8000002C\n expect(view.getUint32(1, false)).toBe(0x8000002c);\n\n // 919' = 919 | 0x80000000 = 0x80000397\n expect(view.getUint32(5, false)).toBe(0x80000397);\n\n // 0' = 0 | 0x80000000 = 0x80000000\n expect(view.getUint32(9, false)).toBe(0x80000000);\n expect(view.getUint32(13, false)).toBe(0x80000000);\n expect(view.getUint32(17, false)).toBe(0x80000000);\n });\n\n it(\"should harden all elements regardless of input\", () => {\n // Input without hardening markers \u2014 output should still be hardened\n const result = encodeDerivationPath(\"44/919/0/0/0\");\n const view = new DataView(result.buffer, result.byteOffset);\n\n expect(view.getUint32(1, false)).toBe(0x8000002c);\n expect(view.getUint32(5, false)).toBe(0x80000397);\n });\n\n it(\"should encode paths with non-zero identity and credential indices\", () => {\n const result = encodeDerivationPath(\"44'/919'/0'/3'/7'\");\n const view = new DataView(result.buffer, result.byteOffset);\n\n // 3' = 0x80000003\n expect(view.getUint32(13, false)).toBe(0x80000003);\n\n // 7' = 0x80000007\n expect(view.getUint32(17, false)).toBe(0x80000007);\n });\n\n it(\"should use big-endian byte order\", () => {\n const result = encodeDerivationPath(\"44'/919'/0'/0'/0'\");\n\n // 0x8000002C in big-endian: [0x80, 0x00, 0x00, 0x2C]\n expect(result[1]).toBe(0x80);\n expect(result[2]).toBe(0x00);\n expect(result[3]).toBe(0x00);\n expect(result[4]).toBe(0x2c);\n });\n\n it(\"should throw on invalid path input\", () => {\n expect(() => encodeDerivationPath(\"m/44'/919'/0'/0'/0'\")).toThrow();\n });\n});\n"],
|
|
5
|
+
"mappings": "aAAA,IAAAA,EAAqC,mEAErC,SAAS,uBAAwB,IAAM,CACrC,GAAG,qDAAsD,IAAM,CAC7D,MAAMC,KAAS,wBAAqB,mBAAmB,EAGvD,OAAOA,CAAM,EAAE,aAAa,EAAE,EAG9B,OAAOA,EAAO,CAAC,CAAC,EAAE,KAAK,CAAC,EAExB,MAAMC,EAAO,IAAI,SAASD,EAAO,OAAQA,EAAO,UAAU,EAG1D,OAAOC,EAAK,UAAU,EAAG,EAAK,CAAC,EAAE,KAAK,UAAU,EAGhD,OAAOA,EAAK,UAAU,EAAG,EAAK,CAAC,EAAE,KAAK,UAAU,EAGhD,OAAOA,EAAK,UAAU,EAAG,EAAK,CAAC,EAAE,KAAK,UAAU,EAChD,OAAOA,EAAK,UAAU,GAAI,EAAK,CAAC,EAAE,KAAK,UAAU,EACjD,OAAOA,EAAK,UAAU,GAAI,EAAK,CAAC,EAAE,KAAK,UAAU,CACnD,CAAC,EAED,GAAG,iDAAkD,IAAM,CAEzD,MAAMD,KAAS,wBAAqB,cAAc,EAC5CC,EAAO,IAAI,SAASD,EAAO,OAAQA,EAAO,UAAU,EAE1D,OAAOC,EAAK,UAAU,EAAG,EAAK,CAAC,EAAE,KAAK,UAAU,EAChD,OAAOA,EAAK,UAAU,EAAG,EAAK,CAAC,EAAE,KAAK,UAAU,CAClD,CAAC,EAED,GAAG,oEAAqE,IAAM,CAC5E,MAAMD,KAAS,wBAAqB,mBAAmB,EACjDC,EAAO,IAAI,SAASD,EAAO,OAAQA,EAAO,UAAU,EAG1D,OAAOC,EAAK,UAAU,GAAI,EAAK,CAAC,EAAE,KAAK,UAAU,EAGjD,OAAOA,EAAK,UAAU,GAAI,EAAK,CAAC,EAAE,KAAK,UAAU,CACnD,CAAC,EAED,GAAG,mCAAoC,IAAM,CAC3C,MAAMD,KAAS,wBAAqB,mBAAmB,EAGvD,OAAOA,EAAO,CAAC,CAAC,EAAE,KAAK,GAAI,EAC3B,OAAOA,EAAO,CAAC,CAAC,EAAE,KAAK,CAAI,EAC3B,OAAOA,EAAO,CAAC,CAAC,EAAE,KAAK,CAAI,EAC3B,OAAOA,EAAO,CAAC,CAAC,EAAE,KAAK,EAAI,CAC7B,CAAC,EAED,GAAG,qCAAsC,IAAM,CAC7C,OAAO,OAAM,wBAAqB,qBAAqB,CAAC,EAAE,QAAQ,CACpE,CAAC,CACH,CAAC",
|
|
6
|
+
"names": ["import_EncodeDerivationPath", "result", "view"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var I=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var o=(x,E)=>{for(var _ in E)I(x,_,{get:E[_],enumerable:!0})},M=(x,E,_,R)=>{if(E&&typeof E=="object"||typeof E=="function")for(let N of S(E))!A.call(x,N)&&N!==_&&I(x,N,{get:()=>E[N],enumerable:!(R=T(E,N))||R.enumerable});return x};var t=x=>M(I({},"__esModule",{value:!0}),x);var C={};o(C,{APP_NAME:()=>s,INS:()=>L,LEDGER_CLA:()=>O,P1:()=>c,P2:()=>n});module.exports=t(C);const s="Concordium",O=224,L={VERIFY_ADDRESS:0,GET_PUBLIC_KEY:1,SIGN_TRANSFER:2,SIGN_TRANSFER_WITH_SCHEDULE:3,SIGN_CREDENTIAL_DEPLOYMENT:4,SIGN_TRANSFER_WITH_MEMO:50,SIGN_TRANSFER_WITH_SCHEDULE_AND_MEMO:52,REGISTER_DATA:53},c={NON_CONFIRM:1,CONFIRM:0,FIRST_CHUNK:0,INITIAL:0,INITIAL_WITH_MEMO:1,MEMO:2,AMOUNT:3},n={NONE:0,MORE:128,LAST:0};0&&(module.exports={APP_NAME,INS,LEDGER_CLA,P1,P2});
|
|
2
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/internal/app-binder/constants.ts"],
|
|
4
|
+
"sourcesContent": ["export const APP_NAME = \"Concordium\";\n\nexport const LEDGER_CLA = 0xe0;\n\nexport const INS = {\n VERIFY_ADDRESS: 0x00,\n GET_PUBLIC_KEY: 0x01,\n SIGN_TRANSFER: 0x02,\n SIGN_TRANSFER_WITH_SCHEDULE: 0x03,\n SIGN_CREDENTIAL_DEPLOYMENT: 0x04,\n SIGN_TRANSFER_WITH_MEMO: 0x32,\n SIGN_TRANSFER_WITH_SCHEDULE_AND_MEMO: 0x34,\n REGISTER_DATA: 0x35,\n} as const;\n\nexport const P1 = {\n NON_CONFIRM: 0x01,\n CONFIRM: 0x00,\n FIRST_CHUNK: 0x00,\n INITIAL: 0x00,\n INITIAL_WITH_MEMO: 0x01,\n MEMO: 0x02,\n AMOUNT: 0x03,\n} as const;\n\nexport const P2 = {\n NONE: 0x00,\n MORE: 0x80,\n LAST: 0x00,\n} as const;\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,cAAAE,EAAA,QAAAC,EAAA,eAAAC,EAAA,OAAAC,EAAA,OAAAC,IAAA,eAAAC,EAAAP,GAAO,MAAME,EAAW,aAEXE,EAAa,IAEbD,EAAM,CACjB,eAAgB,EAChB,eAAgB,EAChB,cAAe,EACf,4BAA6B,EAC7B,2BAA4B,EAC5B,wBAAyB,GACzB,qCAAsC,GACtC,cAAe,EACjB,EAEaE,EAAK,CAChB,YAAa,EACb,QAAS,EACT,YAAa,EACb,QAAS,EACT,kBAAmB,EACnB,KAAM,EACN,OAAQ,CACV,EAEaC,EAAK,CAChB,KAAM,EACN,KAAM,IACN,KAAM,CACR",
|
|
6
|
+
"names": ["constants_exports", "__export", "APP_NAME", "INS", "LEDGER_CLA", "P1", "P2", "__toCommonJS"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var n=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var f=(o,p)=>{for(var i in p)n(o,i,{get:p[i],enumerable:!0})},u=(o,p,i,e)=>{if(p&&typeof p=="object"||typeof p=="function")for(let r of B(p))!c.call(o,r)&&r!==i&&n(o,r,{get:()=>p[r],enumerable:!(e=a(p,r))||e.enumerable});return o};var g=o=>u(n({},"__esModule",{value:!0}),o);var s={};f(s,{appBindingModuleFactory:()=>l});module.exports=g(s);var t=require("inversify"),d=require("../../app-binder/ConcordiumAppBinder"),m=require("../../app-binder/di/appBinderTypes");const l=()=>new t.ContainerModule(({bind:o})=>{o(m.appBinderTypes.AppBinding).to(d.ConcordiumAppBinder)});0&&(module.exports={appBindingModuleFactory});
|
|
2
|
+
//# sourceMappingURL=appBinderModule.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/internal/app-binder/di/appBinderModule.ts"],
|
|
4
|
+
"sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { ConcordiumAppBinder } from \"@internal/app-binder/ConcordiumAppBinder\";\nimport { appBinderTypes } from \"@internal/app-binder/di/appBinderTypes\";\n\nexport const appBindingModuleFactory = () =>\n new ContainerModule(({ bind }) => {\n bind(appBinderTypes.AppBinding).to(ConcordiumAppBinder);\n });\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,6BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAAoC,oDACpCC,EAA+B,kDAExB,MAAMJ,EAA0B,IACrC,IAAI,kBAAgB,CAAC,CAAE,KAAAK,CAAK,IAAM,CAChCA,EAAK,iBAAe,UAAU,EAAE,GAAG,qBAAmB,CACxD,CAAC",
|
|
6
|
+
"names": ["appBinderModule_exports", "__export", "appBindingModuleFactory", "__toCommonJS", "import_inversify", "import_ConcordiumAppBinder", "import_appBinderTypes", "bind"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var s=Object.defineProperty;var e=Object.getOwnPropertyDescriptor;var r=Object.getOwnPropertyNames;var t=Object.prototype.hasOwnProperty;var B=(n,p)=>{for(var o in p)s(n,o,{get:p[o],enumerable:!0})},a=(n,p,o,d)=>{if(p&&typeof p=="object"||typeof p=="function")for(let i of r(p))!t.call(n,i)&&i!==o&&s(n,i,{get:()=>p[i],enumerable:!(d=e(p,i))||d.enumerable});return n};var c=n=>a(s({},"__esModule",{value:!0}),n);var y={};B(y,{appBinderTypes:()=>g});module.exports=c(y);const g={AppBinding:Symbol.for("AppBinding")};0&&(module.exports={appBinderTypes});
|
|
2
|
+
//# sourceMappingURL=appBinderTypes.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/internal/app-binder/di/appBinderTypes.ts"],
|
|
4
|
+
"sourcesContent": ["export const appBinderTypes = {\n AppBinding: Symbol.for(\"AppBinding\"),\n} as const;\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,IAAA,eAAAC,EAAAH,GAAO,MAAME,EAAiB,CAC5B,WAAY,OAAO,IAAI,YAAY,CACrC",
|
|
6
|
+
"names": ["appBinderTypes_exports", "__export", "appBinderTypes", "__toCommonJS"]
|
|
7
|
+
}
|