diff --git a/.env.local.example b/.env.local.example index bd74dcb..642341d 100644 --- a/.env.local.example +++ b/.env.local.example @@ -1,2 +1,4 @@ NEXT_PUBLIC_FCL_CRYPTO_CONTRACT=0xf8d6e0586b0a20c7 -FCL_CRYPTO_CONTRACT=0xf8d6e0586b0a20c7 \ No newline at end of file +FCL_CRYPTO_CONTRACT=0xf8d6e0586b0a20c7 +NEXT_PUBLIC_WC_PROJECT_ID= +NEXT_PUBLIC_RELAY_URL=wss://relay.walletconnect.com \ No newline at end of file diff --git a/flow/config.js b/flow/config.js index 171a1e1..c1817af 100644 --- a/flow/config.js +++ b/flow/config.js @@ -34,8 +34,8 @@ if (USE_LOCAL) { // dev-wallet .put("discovery.wallet", "http://localhost:8701/fcl/authn") // local discovery - //.put("discovery.wallet", "http://localhost:3002/testnet/authn") - //.put("discovery.authn.endpoint", "http://localhost:3002/api/testnet/authn") + // .put("discovery.wallet", "http://localhost:3002/local/authn") + // .put("discovery.authn.endpoint", "http://localhost:3002/api/local/authn") } else { // prettier-ignore fcl diff --git a/pages/index.js b/pages/index.js index c93fa5b..4fc257e 100644 --- a/pages/index.js +++ b/pages/index.js @@ -12,8 +12,8 @@ import "../flow/config" const WC_PROJECT_ID = process.env.NEXT_PUBLIC_WC_PROJECT_ID const WC_METADATA = { - name: "FCL WalletConnect", - description: "FCL DApp for WalletConnect", + name: "FCL Harness", + description: "FCL Harness dApp for Development and Testing", url: "https://flow.com/", icons: ["https://avatars.githubusercontent.com/u/62387156?s=280&v=4"], } @@ -53,16 +53,20 @@ export default function Home() { }) fcl.pluginRegistry.add(FclWcServicePlugin) } - initAdapter() + if ( + config && + config.flow.network !== "local" && + process.env.NEXT_PUBLIC_WC_PROJECT_ID + ) + initAdapter() }, []) useEffect(() => { const fetchServices = async () => await fcl.discovery.authn.subscribe(res => { - console.log("discovery api services", res) setServices(res.results) }) - fetchServices() + if (config && config.discovery.authn.endpoint) fetchServices() }, []) useEffect(() => {