forked from gregsantos/fcl-next-harness
-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.js
70 lines (65 loc) · 2.54 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import * as fcl from "@onflow/fcl"
const WC_PROJECT_ID = process.env.NEXT_PUBLIC_WC_PROJECT_ID || "9b70cfa398b2355a5eb9b1cf99f4a981"
const USE_LOCAL = false
const resolver = async () => ({
appIdentifier: "Awesome App (v0.0)",
nonce: "3037366134636339643564623330316636626239323161663465346131393662",
})
const isServerSide = () => typeof window === "undefined"
const LOCAL_STORAGE = {
can: !isServerSide(),
get: async key => JSON.parse(localStorage.getItem(key)),
put: async (key, value) => localStorage.setItem(key, JSON.stringify(value)),
}
// prettier-ignore
fcl
.config()
.put("debug.accounts", true)
.put("logger.level", 2)
.put("app.detail.title", "Test Harness")
.put("app.detail.icon", "https://placekitten.com/g/200/200")
.put("service.OpenID.scopes", "email")
.put("fcl.accountProof.resolver", resolver)
.put("walletconnect.projectId", WC_PROJECT_ID)
// storage override
//.put("fcl.storage", LOCAL_STORAGE)
if (USE_LOCAL) {
// prettier-ignore
fcl
.config()
.put("flow.network", "local")
.put("accessNode.api", "http://localhost:8888")
// dev-wallet
.put("discovery.wallet", "http://localhost:8701/fcl/authn")
// local discovery
// .put("discovery.wallet", "http://localhost:3002/local/authn")
// .put("discovery.authn.endpoint", "http://localhost:3002/api/local/authn")
} else {
// prettier-ignore
fcl
.config()
// testnet
.put("flow.network", "testnet")
.put("accessNode.api", "https://rest-testnet.onflow.org") // grpc: https://access-testnet.onflow.org
.put("discovery.wallet", "https://fcl-discovery.onflow.org/testnet/authn")
.put(
"discovery.authn.endpoint",
"https://fcl-discovery.onflow.org/api/testnet/authn"
)
.put("discovery.authn.include", [
"0x82ec283f88a62e65", // Dapper
"0x9d2e44203cb13051", // Ledger
])
// mainnet
// .put("flow.network", "mainnet")
// .put("accessNode.api", "https://rest-mainnet.onflow.org")
// .put("discovery.wallet", "https://fcl-discovery.onflow.org/authn")
// .put("discovery.authn.endpoint","https://fcl-discovery.onflow.org/api/mainnet/authn")
// .put("discovery.authn.include", ["0xead892083b3e2c6c", "0xe5cd26afebe62781",])
// Dapper Wallet
// .put("discovery.wallet","https://staging.accounts.meetdapper.com/fcl/authn-restricted")
// .put("discovery.wallet.method", "POP/RPC")
// .put("discovery.wallet","https://graphql-api.staging.app.dapperlabs.com/fcl/authn")
// .put("discovery.wallet.method", "HTTP/POST")
// .put("discovery.wallet","https://graphql-api.app.dapperlabs.com/fcl/authn")
}