From e12075c22f76140e01840088fe043c8e97ce1681 Mon Sep 17 00:00:00 2001 From: tiero <3596602+tiero@users.noreply.github.com> Date: Fri, 6 Jan 2023 23:18:43 +0100 Subject: [PATCH] example: add dependencies --- example/index.tsx | 14 ++++++++++- example/package.json | 2 ++ example/yarn.lock | 58 +++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 72 insertions(+), 2 deletions(-) diff --git a/example/index.tsx b/example/index.tsx index b01648b..36e7d7c 100644 --- a/example/index.tsx +++ b/example/index.tsx @@ -3,7 +3,7 @@ import { useEffect, useState } from 'react'; import { useStatePersist } from 'use-state-persist'; import * as ReactDOM from 'react-dom'; -import { broadcastToRelay, Connect, connectToRelay, ConnectURI } from '../src'; +import { broadcastToRelay, Connect, connectToRelay, ConnectURI } from '@nostr-connect/connect'; import { QRCodeSVG } from 'qrcode.react'; import { getEventHash, getPublicKey, Event } from 'nostr-tools'; @@ -84,6 +84,14 @@ const App = () => { return pubkey.length > 0; } + const copyToClipboard = () => { + navigator.clipboard.writeText(connectURI.toString()).then(function() { + alert('Copied!'); + }, function(err) { + console.error('Async: Could not copy text: ', err); + }); + } + return ( <>
@@ -99,6 +107,7 @@ const App = () => { {!isConnected() &&

Connect with Nostr

+ { value={connectURI.toString()} readOnly /> +
}
diff --git a/example/package.json b/example/package.json index 269fc44..a364e74 100644 --- a/example/package.json +++ b/example/package.json @@ -8,6 +8,8 @@ "build": "parcel build index.html" }, "dependencies": { + "@nostr-connect/connect": "^0.1.0", + "nostr-tools": "^1.1.1", "qrcode.react": "^3.1.0", "react-app-polyfill": "^1.0.0", "use-state-persist": "^0.3.1" diff --git a/example/yarn.lock b/example/yarn.lock index 438994e..c10a4c9 100644 --- a/example/yarn.lock +++ b/example/yarn.lock @@ -144,6 +144,29 @@ resolved "https://registry.yarnpkg.com/@msgpackr-extract/msgpackr-extract-win32-x64/-/msgpackr-extract-win32-x64-2.2.0.tgz#016d855b6bc459fd908095811f6826e45dd4ba64" integrity sha512-XrC0JzsqQSvOyM3t04FMLO6z5gCuhPE6k4FXuLK5xf52ZbdvcFe1yBmo7meCew9B8G2f0T9iu9t3kfTYRYROgA== +"@noble/hashes@^0.5.7": + version "0.5.9" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-0.5.9.tgz#9f3051a4cc6f7c168022b3b7fbbe9fe2a35cccf0" + integrity sha512-7lN1Qh6d8DUGmfN36XRsbN/WcGIPNtTGhkw26vWId/DlCIGsYJJootTtPGghTLcn/AaXPx2Q0b3cacrwXa7OVw== + +"@noble/hashes@~1.1.1", "@noble/hashes@~1.1.3": + version "1.1.5" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.5.tgz#1a0377f3b9020efe2fae03290bd2a12140c95c11" + integrity sha512-LTMZiiLc+V4v1Yi16TD6aX2gmtKszNye0pQgbaLqkvhIqP7nVsSaJsWloGQjJfJ8offaoP5GtX3yY5swbcJxxQ== + +"@noble/secp256k1@^1.7.0", "@noble/secp256k1@~1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.7.0.tgz#d15357f7c227e751d90aa06b05a0e5cf993ba8c1" + integrity sha512-kbacwGSsH/CTout0ZnZWxnW1B+jH/7r/WAAKLBtrRJ/+CUH7lgmQzl3GTrQua3SGKWNSDsS6lmjnDpIJ5Dxyaw== + +"@nostr-connect/connect@^0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@nostr-connect/connect/-/connect-0.1.0.tgz#0f5537237d63e328922b9b13b97d98da53cc3bd4" + integrity sha512-YcQvkvMEdWBFy1tnPJhuS+wNK+W1EOz0vdOeIth6KezdSKS+yTHoR/jV58nQdRLvmiAIAIr+ZY/gYTztFddiUA== + dependencies: + events "^3.3.0" + nostr-tools "^1.0.1" + "@parcel/bundler-default@2.8.2": version "2.8.2" resolved "https://registry.yarnpkg.com/@parcel/bundler-default/-/bundler-default-2.8.2.tgz#7340866cd612aece575489d16bf97325fd699b7f" @@ -703,6 +726,28 @@ chrome-trace-event "^1.0.2" nullthrows "^1.1.1" +"@scure/base@^1.1.1", "@scure/base@~1.1.0": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.1.tgz#ebb651ee52ff84f420097055f4bf46cfba403938" + integrity sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA== + +"@scure/bip32@^1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.1.1.tgz#f62e4a2f13cc3e5e720ad81b7582b8631ae6835a" + integrity sha512-UmI+liY7np2XakaW+6lMB6HZnpczWk1yXZTxvg8TM8MdOcKHCGL1YkraGj8eAjPfMwFNiAyek2hXmS/XFbab8g== + dependencies: + "@noble/hashes" "~1.1.3" + "@noble/secp256k1" "~1.7.0" + "@scure/base" "~1.1.0" + +"@scure/bip39@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.1.0.tgz#92f11d095bae025f166bef3defcc5bf4945d419a" + integrity sha512-pwrPOS16VeTKg98dYXQyIjJEcWfz7/1YJIwxUEPFfQPtc86Ym/1sVgQ2RLoD43AazMk2l/unK4ITySSpW2+82w== + dependencies: + "@noble/hashes" "~1.1.1" + "@scure/base" "~1.1.0" + "@swc/helpers@^0.4.12": version "0.4.14" resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.4.14.tgz#1352ac6d95e3617ccb7c1498ff019654f1e12a74" @@ -1002,7 +1047,7 @@ escape-string-regexp@^1.0.5: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== -events@^3.1.0: +events@^3.1.0, events@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== @@ -1216,6 +1261,17 @@ node-releases@^2.0.6: resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.8.tgz#0f349cdc8fcfa39a92ac0be9bc48b7706292b9ae" integrity sha512-dFSmB8fFHEH/s81Xi+Y/15DQY6VHW81nXRj86EMSL3lmuTmK1e+aT4wrFCkTbm+gSwkw4KpX+rT/pMM2c1mF+A== +nostr-tools@^1.0.1, nostr-tools@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/nostr-tools/-/nostr-tools-1.1.1.tgz#2be4cd650bc0a4d20650b6cf46fee451c9f565b8" + integrity sha512-mxgjbHR6nx2ACBNa2tBpeM/glsPWqxHPT1Kszx/XfzL+kUdi1Gm3Xz1UcaODQ2F84IFtCKNLO+aF31ZfTAhSYQ== + dependencies: + "@noble/hashes" "^0.5.7" + "@noble/secp256k1" "^1.7.0" + "@scure/base" "^1.1.1" + "@scure/bip32" "^1.1.1" + "@scure/bip39" "^1.1.0" + nth-check@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-2.1.1.tgz#c9eab428effce36cd6b92c924bdb000ef1f1ed1d"