]> zoso.dev Git - nemo-wallet.git/commitdiff
Move file to top of directory. Add local reference to libnemo for testing changes...
authorChris Duncan <chris@zoso.dev>
Fri, 1 Nov 2024 05:51:28 +0000 (22:51 -0700)
committerChris Duncan <chris@zoso.dev>
Fri, 1 Nov 2024 05:51:28 +0000 (22:51 -0700)
nemo-wallet.html [moved from app/pages/nemo-wallet.html with 97% similarity]
test.js [new file with mode: 0644]
tsconfig.json

similarity index 97%
rename from app/pages/nemo-wallet.html
rename to nemo-wallet.html
index f4b192b6d77f8b4404ab095c9ef102db116c816a..f50bff6965ab9531904fdadb5fcd389dfe597a77 100644 (file)
@@ -4,11 +4,20 @@
        <meta charset="utf-8" />
        <meta lang="en" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />
-       <script type="module" src="https://cdn.jsdelivr.net/npm/barcode-detector@2.2.11/dist/es/side-effects.min.js"></script>
-       <script type="module">
-               let libnemo, css
-               const barcodeDetector = new BarcodeDetector()
-
+       <!-- <script type="module" src="https://cdn.jsdelivr.net/npm/barcode-detector@2.2.11/dist/es/side-effects.min.js"></script> -->
+       <script type="module" src="https://cdn.jsdelivr.net/npm/libnemo@0.0.16/dist/global.min.js"></script>
+       <script type="module" src="./test.js"></script>
+       <script type="module" src="../libnemo/dist/global.min.js"></script>
+       <script>
+               // const barcodeDetector = new BarcodeDetector({
+               //      formats: ["qr_code"],
+               // })
+               // const imageFile = await fetch(
+               //      "https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=Hello%20world!",
+               // ).then(resp => resp.blob())
+               // barcodeDetector.detect(imageFile).then(console.log)
+
+               // let css
                const observer = new MutationObserver((mutations) => {
                        for (const mutation of mutations) {
                                if (mutation.type === "attributes") {
                        } catch (err) {
                                location.hash = '#transact'
                        }
-                       await loadNemo()
                        await loadData()
                        await loadUi()
                        console.log('done')
                })
 
-               async function loadNemo () {
-                       console.log('loading libnemo')
-                       libnemo = await import('https://cdn.jsdelivr.net/npm/libnemo@0.0.14/dist/main.min.js')
-                       const barcodeDetector = new BarcodeDetector({
-                               formats: ["qr_code"],
-                       })
-                       const imageFile = await fetch(
-                               "https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=Hello%20world!",
-                       ).then(resp => resp.blob())
-                       barcodeDetector.detect(imageFile).then(console.log)
-               }
-
                async function loadData () {
                        console.log('loading data')
                        const walletSelect = document.querySelector('#wallet')
                                }
                                case '_ledger': {
                                        try {
-                                               await LedgerWallet.create()
+                                               await libnemo.LedgerWallet.create()
                                        } catch (err) {
                                                walletSelect.value = ''
                                                console.error(err)
diff --git a/test.js b/test.js
new file mode 100644 (file)
index 0000000..7534725
--- /dev/null
+++ b/test.js
@@ -0,0 +1,4 @@
+// SPDX-FileCopyrightText: 2024 Chris Duncan <chris@zoso.dev>
+// SPDX-License-Identifier: GPL-3.0-or-later
+import * as b from 'https://cdn.jsdelivr.net/npm/buffer-esm@1.2.0/esm/index.js'
+globalThis.Buffer = b
index 6fb30117ec3c54944fd0f51975a31385734b6acd..71cd0df34eaed44885932aaa734d8a2f4eca9f98 100644 (file)
@@ -30,7 +30,8 @@
                }
        },
        "include": [
-               "app/**/*"
+               "app/**/*",
+               "test.js"
        ],
        "files": [
                "./references.d.ts"