Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update config.js and package.json for blocto/fcl #55

Merged
merged 2 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/Context/flowContext.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createContext, useContext } from "react";
import * as fcl from "@onflow/fcl";
import * as fcl from "@blocto/fcl";
import * as types from "@onflow/types";
import React, { useState, useEffect } from "react";
import { getBalance } from "../../cadence/scripts/getBalance";
Expand Down
2 changes: 1 addition & 1 deletion components/Layout/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import MenuIcon from "@mui/icons-material/Menu";
import DashboardIcon from "@mui/icons-material/Dashboard";
import PersonOutlineSharpIcon from "@mui/icons-material/PersonOutlineSharp";
import AccountBalanceWalletIcon from "@mui/icons-material/AccountBalanceWallet";
import * as fcl from "@onflow/fcl";
import * as fcl from "@blocto/fcl";
import useSWR, { useSWRConfig } from "swr";
import "../../flow/config.js";
import {
Expand Down
2 changes: 1 addition & 1 deletion components/article/Tipping.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { useFlowContext } from "../Context/flowContext";
import { useUser } from "../../hooks/useAuth";
import { transferTokens } from "../../cadence/scripts/transactions/transferTokens";

import * as fcl from "@onflow/fcl";
import * as fcl from "@blocto/fcl";
import * as types from "@onflow/types";
import Router from "next/router";
import { useForm } from "react-hook-form";
Expand Down
31 changes: 22 additions & 9 deletions flow/config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as fcl from "@onflow/fcl";
import * as fcl from "@blocto/fcl";

const resolver = async () => {
const response = await fetch("/api/auth/generate");
Expand All @@ -9,11 +9,24 @@ const resolver = async () => {
};
};

fcl.config()
.put("app.detail.title", "Violet Verse")
.put("app.detail.icon", "https://i.imgur.com/jDJnCzx.png")
.put("accessNode.api", "https://rest-mainnet.onflow.org") // pointing to mainnet
.put("0xVioletVerse", "0xf5f7db710acb59d3")
.put("discovery.wallet", "https://flow-wallet.blocto.app/authn")
.put("fcl.accountProof.resolver", resolver)
.put("flow.network", "mainnet");
fcl
.config({
"app.detail.title": "Violet Verse",
"app.detail.icon": "https://i.imgur.com/jDJnCzx.png",
"accessNode.api": "https://rest-mainnet.onflow.org",
"0xVioletVerse": "0xf5f7db710acb59d3",
"discovery.wallet": "https://wallet-v2.blocto.app/api/flow/authn",
"fcl.accountProof.resolver": resolver,
//"app.detail.id": "YOUR_DAPP_ID"// this line is optional
"discovery.wallet.method": "HTTP/POST"
})

//// old config
// fcl.config()
// .put("app.detail.title", "Violet Verse")
// .put("app.detail.icon", "https://i.imgur.com/jDJnCzx.png")
// .put("accessNode.api", "https://rest-mainnet.onflow.org") // pointing to mainnet
// .put("0xVioletVerse", "0xf5f7db710acb59d3")
// .put("discovery.wallet", "https://flow-wallet.blocto.app/authn")
// .put("fcl.accountProof.resolver", resolver)
// .put("flow.network", "mainnet");
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@mui/icons-material": "^5.8.4",
"@mui/material": "^5.10.0",
"@nextui-org/react": "^1.0.0-beta.9",
"@onflow/fcl": "^1.2.0",
"@blocto/fcl": "^1.6.1",
"@onflow/types": "^1.0.3",
"@segment/snippet": "^4.15.3",
"@tinymce/tinymce-react": "^4.3.0",
Expand Down
2 changes: 1 addition & 1 deletion pages/[articlePage].js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
} from "./api/database/getUserForPost";

import { transferTokens } from "../cadence/scripts/transactions/purchaseContent";
import * as fcl from "@onflow/fcl";
import * as fcl from "@blocto/fcl";
import * as types from "@onflow/types";
import Tipping from "../components/article/Tipping";
import connectDatabase from "../lib/mongoClient";
Expand Down
2 changes: 1 addition & 1 deletion pages/api/auth/verify.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as fcl from "@onflow/fcl";
import * as fcl from "@blocto/fcl";
import Iron from "@hapi/iron";
import CookieService from "../../../lib/cookie";
import { table } from "../utils/userTable";
Expand Down
2 changes: 1 addition & 1 deletion pages/blocto.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState, useEffect } from "react";
import * as fcl from "@onflow/fcl";
import * as fcl from "@blocto/fcl";
import * as types from "@onflow/types";
import "../flow/config.js";
import useSWR, { useSWRConfig } from "swr";
Expand Down
2 changes: 1 addition & 1 deletion pages/tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useUser } from "../hooks/useAuth";
import { createVault } from "../cadence/scripts/transactions/createVault";
import { transferTokens } from "../cadence/scripts/transactions/transferTokens";

import * as fcl from "@onflow/fcl";
import * as fcl from "@blocto/fcl";
import * as types from "@onflow/types";
import Router from "next/router";
import { useForm } from "react-hook-form";
Expand Down