refactor: import indexer from @crossbell/indexer
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { notFound } from "~/lib/server-side-props"
|
||||
import { PageVisibilityEnum, Notes, Note } from "~/lib/types"
|
||||
import unidata from "~/queries/unidata.server"
|
||||
import { indexer } from "~/queries/crossbell"
|
||||
import { indexer } from "@crossbell/indexer"
|
||||
import { NoteEntity, CharacterEntity, ListResponse } from "crossbell.js"
|
||||
import { getStorage, getKeys } from "~/lib/storage"
|
||||
import axios from "axios"
|
||||
|
||||
@@ -6,7 +6,7 @@ import type Unidata from "unidata.js"
|
||||
import type { Profiles as UniProfiles } from "unidata.js"
|
||||
import { createClient } from "@urql/core"
|
||||
import axios from "axios"
|
||||
import { indexer } from "~/queries/crossbell"
|
||||
import { indexer } from "@crossbell/indexer"
|
||||
import type { LinkEntity, NoteEntity, Contract } from "crossbell.js"
|
||||
import { CharacterOperatorPermission } from "crossbell.js"
|
||||
|
||||
|
||||
@@ -15,11 +15,15 @@ import {
|
||||
import { InitContractProvider } from "@crossbell/contract"
|
||||
import { useRefCallback } from "@crossbell/util-hooks"
|
||||
import NextNProgress from "nextjs-progressbar"
|
||||
import { Network } from "crossbell.js"
|
||||
|
||||
import { IPFS_GATEWAY } from "~/lib/env"
|
||||
import { toGateway } from "~/lib/ipfs-parser"
|
||||
import { connectors, provider } from "~/lib/wallet-config"
|
||||
import { createIDBPersister } from "~/lib/persister.client"
|
||||
|
||||
Network.setIpfsGateway(IPFS_GATEWAY)
|
||||
|
||||
const wagmiClient = createClient({
|
||||
autoConnect: true,
|
||||
connectors,
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
import { useAccount } from "wagmi"
|
||||
import { Contract, Indexer, Network } from "crossbell.js"
|
||||
import { IPFS_GATEWAY } from "../lib/env"
|
||||
|
||||
Network.setIpfsGateway(IPFS_GATEWAY)
|
||||
|
||||
const indexer = new Indexer()
|
||||
|
||||
let contract: Contract
|
||||
|
||||
const useContract = () => {
|
||||
const { connector, isConnected } = useAccount()
|
||||
if (isConnected && connector) {
|
||||
connector?.getProvider().then(async (provider) => {
|
||||
contract = new Contract(provider)
|
||||
await contract.connect()
|
||||
})
|
||||
} else {
|
||||
contract = new Contract()
|
||||
contract.connect()
|
||||
}
|
||||
return contract
|
||||
}
|
||||
|
||||
export { indexer, useContract }
|
||||
Reference in New Issue
Block a user