@qrkit/react 0.0.1

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 ADDED
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship made available under
36
+ the License, as indicated by a copyright notice that is included in
37
+ or attached with the work (an example is provided in the Appendix below).
38
+
39
+ "Derivative Works" shall mean any work, whether in Source or Object
40
+ form, that is based on (or derived from) the Work and for which the
41
+ editorial revisions, annotations, elaborations, or other transformations
42
+ represent, as a whole, an original work of authorship. For the purposes
43
+ of this License, Derivative Works shall not include works that remain
44
+ separable from, or merely link (or bind by name) to the interfaces of,
45
+ the Work and Derivative Works thereof.
46
+
47
+ "Contribution" shall mean, as submitted to the Licensor for inclusion
48
+ in the Work by the copyright owner or by an individual or Legal Entity
49
+ authorized to submit on behalf of the copyright owner. For the purposes
50
+ of this definition, "submit" means any form of electronic, verbal, or
51
+ written communication sent to the Licensor or its representatives,
52
+ including but not limited to communication on electronic mailing lists,
53
+ source lists, defect tracking systems, and issue tracking systems that
54
+ are managed by, or on behalf of, the Licensor for the purpose of
55
+ discussing and improving the Work, but excluding communication that is
56
+ conspicuously marked or designated in writing by the copyright owner as
57
+ "Not a Contribution."
58
+
59
+ "Contributor" shall mean Licensor and any Legal Entity on behalf of
60
+ whom a Contribution has been received by the Licensor and included
61
+ within the Work.
62
+
63
+ 2. Grant of Copyright License. Subject to the terms and conditions of
64
+ this License, each Contributor hereby grants to You a perpetual,
65
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
66
+ copyright license to reproduce, prepare Derivative Works of,
67
+ publicly display, publicly perform, sublicense, and distribute the
68
+ Work and such Derivative Works in Source or Object form.
69
+
70
+ 3. Grant of Patent License. Subject to the terms and conditions of
71
+ this License, each Contributor hereby grants to You a perpetual,
72
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
73
+ (except as stated in this section) patent license to make, have made,
74
+ use, offer to sell, sell, import, and otherwise transfer the Work,
75
+ where such license applies only to those patent claims licensable
76
+ by such Contributor that are necessarily infringed by their
77
+ Contribution(s) alone or by the combination of their Contribution(s)
78
+ with the Work to which such Contribution(s) was submitted. If You
79
+ institute patent litigation against any entity (including a cross-claim
80
+ or counterclaim in a lawsuit) alleging that the Work or any patent
81
+ claim embodied in the Work constitutes direct or patent infringement,
82
+ then any patent rights granted to You under this License for that Work
83
+ shall terminate as of the date such litigation is filed.
84
+
85
+ 4. Redistribution. You may reproduce and distribute copies of the
86
+ Work or Derivative Works thereof in any medium, with or without
87
+ modifications, and in Source or Object form, provided that You
88
+ meet the following conditions:
89
+
90
+ (a) You must give any other recipients of the Work or Derivative
91
+ Works a copy of this License; and
92
+
93
+ (b) You must cause any modified files to carry prominent notices
94
+ stating that You changed the files; and
95
+
96
+ (c) You must retain, in all Source or Derivative Works that You
97
+ distribute, all copyright, patent, trademark, and attribution
98
+ notices from the Source form of the Work, excluding those notices
99
+ that do not pertain to any part of the Derivative Works; and
100
+
101
+ (d) If the Work includes a "NOTICE" text file as part of its
102
+ distribution, then any Derivative Works that You distribute must
103
+ include a readable copy of the attribution notices contained
104
+ within such NOTICE file, except for those notices that do not
105
+ pertain to any part of the Derivative Works, in any part of
106
+ the Derivative Works in which You reproduce, separately or as
107
+ an addendum to the NOTICE text from the Work, provided that
108
+ such additional attribution notices cannot be construed as
109
+ modifying the License.
110
+
111
+ You may add Your own attribution notices within Derivative Works
112
+ that You distribute, alongside or in addition to the NOTICE text
113
+ from the Work, provided that such additional attribution notices
114
+ cannot be construed as modifying the License.
115
+
116
+ You may add Your own copyright statement to Your modifications and
117
+ may provide additional grant of rights to use, reproduce, prepare
118
+ Derivative Works of, publicly display, publicly perform, sublicense,
119
+ and distribute those Modifications, as in this License.
120
+
121
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
122
+ any Contribution intentionally submitted for inclusion in the Work
123
+ by You to the Licensor shall be under the terms and conditions of
124
+ this License, without any additional terms or conditions.
125
+ Notwithstanding the above, nothing herein shall supersede or modify
126
+ the terms of any separate license agreement you may have executed
127
+ with Licensor regarding such Contributions.
128
+
129
+ 6. Trademarks. This License does not grant permission to use the trade
130
+ names, trademarks, service marks, or product names of the Licensor,
131
+ except as required for reasonable and customary use in describing the
132
+ origin of the Work and reproducing the content of the NOTICE file.
133
+
134
+ 7. Disclaimer of Warranty. Unless required by applicable law or
135
+ agreed to in writing, Licensor provides the Work (and each
136
+ Contributor provides its Contributions) on an "AS IS" BASIS,
137
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
138
+ implied, including, without limitation, any conditions of title,
139
+ MERCHANTIBILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely
140
+ responsible for determining the appropriateness of using or
141
+ reproducing the Work and assume any risks associated with Your
142
+ exercise of permissions under this License.
143
+
144
+ 8. Limitation of Liability. In no event and under no legal theory,
145
+ whether in tort (including negligence), contract, or otherwise,
146
+ unless required by applicable law (such as deliberate and grossly
147
+ negligent acts) or agreed to in writing, shall any Contributor be
148
+ liable to You for damages, including any direct, indirect, special,
149
+ incidental, or exemplary damages of any character arising as a
150
+ result of this License or out of the use or inability to use the
151
+ Work (including but not limited to damages for loss of goodwill,
152
+ work stoppage, computer failure or malfunction, or all other
153
+ commercial damages or losses), even if such Contributor has been
154
+ advised of the possibility of such damages.
155
+
156
+ 9. Accepting Warranty or Additional Liability. While redistributing
157
+ the Work or Derivative Works thereof, You may wish to offer, and
158
+ charge a fee for, acceptance of support, warranty, indemnity, or
159
+ other liability obligations and/or rights consistent of this License.
160
+ However, in accepting such obligations, You may offer such conditions
161
+ only on Your own behalf and on Your sole responsibility, not on behalf
162
+ of any other Contributor, and only if You agree to indemnify, defend,
163
+ and hold each Contributor harmless for any liability incurred by, or
164
+ claims asserted against, such Contributor by reason of your accepting
165
+ any such warranty or additional liability.
166
+
167
+ END OF TERMS AND CONDITIONS
168
+
169
+ APPENDIX: How to apply the Apache License to your work.
170
+
171
+ To apply the Apache License to your work, attach the following
172
+ boilerplate notice, with the fields enclosed by brackets "[]"
173
+ replaced with your own identifying information. (Don't include
174
+ the brackets!) The text should be enclosed in the appropriate
175
+ comment syntax for the format in question; you may also recommend
176
+ that file header to be included with the copyright notice:
177
+
178
+ Copyright 2026 Mladen Milankovic
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,54 @@
1
+ # @qrkit/react
2
+
3
+ React context, hooks, and drop-in components for QR-based airgapped wallet flows.
4
+
5
+ Builds on [`@qrkit/core`](../core). Provides a provider/context model, ready-to-use hooks, and optional drop-in components for connection scanning, account display, and message signing.
6
+
7
+ ## Install
8
+
9
+ ```sh
10
+ pnpm add @qrkit/react
11
+ ```
12
+
13
+ React 18+ is required as a peer dependency.
14
+
15
+ ## Planned API
16
+
17
+ ### Provider
18
+
19
+ ```tsx
20
+ import { QRKitProvider } from '@qrkit/react'
21
+
22
+ <QRKitProvider config={{ appName: 'My dApp', chains: ['evm'] }}>
23
+ <App />
24
+ </QRKitProvider>
25
+ ```
26
+
27
+ ### Hooks
28
+
29
+ ```ts
30
+ import { useQRKit, useQRKitConnect, useQRKitSignMessage } from '@qrkit/react'
31
+
32
+ const { status, session, accounts, disconnect } = useQRKit()
33
+ const { startConnectionScan } = useQRKitConnect()
34
+ const { request, createMessageRequest, parseSignatureResponse } = useQRKitSignMessage()
35
+ ```
36
+
37
+ ### Drop-in components
38
+
39
+ ```tsx
40
+ import { QRKitConnect, QRKitAccounts, QRKitSignMessage } from '@qrkit/react'
41
+
42
+ // Scan a connection QR
43
+ <QRKitConnect onConnected={(session) => console.log(session)} />
44
+
45
+ // Display derived accounts
46
+ <QRKitAccounts />
47
+
48
+ // Full sign message flow
49
+ <QRKitSignMessage message="hello" onSigned={(result) => console.log(result.signature)} />
50
+ ```
51
+
52
+ ## License
53
+
54
+ [Apache 2.0](../../LICENSE)
package/dist/index.cjs ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,2 @@
1
+
2
+ export { }
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@qrkit/react",
3
+ "version": "0.0.1",
4
+ "description": "React context, hooks, and drop-in components for QR-based airgapped wallet flows.",
5
+ "license": "Apache-2.0",
6
+ "type": "module",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.js",
11
+ "require": "./dist/index.cjs"
12
+ }
13
+ },
14
+ "main": "./dist/index.cjs",
15
+ "module": "./dist/index.js",
16
+ "types": "./dist/index.d.ts",
17
+ "files": [
18
+ "dist"
19
+ ],
20
+ "dependencies": {
21
+ "jsqr": "^1.4.0",
22
+ "qrcode": "^1.5.4",
23
+ "@qrkit/core": "0.1.0"
24
+ },
25
+ "peerDependencies": {
26
+ "react": ">=18",
27
+ "react-dom": ">=18"
28
+ },
29
+ "devDependencies": {
30
+ "@types/qrcode": "^1.5.6",
31
+ "@types/react": "^19.2.14",
32
+ "@types/react-dom": "^19.2.3",
33
+ "react": "^19.2.4",
34
+ "react-dom": "^19.2.4",
35
+ "tsup": "^8.4.0",
36
+ "typescript": "~5.9.3",
37
+ "vitest": "^4.1.2"
38
+ },
39
+ "scripts": {
40
+ "build": "tsup",
41
+ "dev": "tsup --watch",
42
+ "test": "vitest run --passWithNoTests",
43
+ "typecheck": "tsc --noEmit",
44
+ "lint": "eslint src"
45
+ }
46
+ }