Skip to content

Commit

Permalink
Don't use anchor provider (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChewingGlass authored Oct 12, 2023
1 parent 2ff9401 commit 735c77e
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions hooks/useVotes.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import { Program } from "@coral-xyz/anchor";
import { useAnchorProvider } from "@helium/helium-react-hooks";
import { AnchorProvider, Program } from "@coral-xyz/anchor";
import { VoterStakeRegistry } from "@helium/idls/lib/types/voter_stake_registry";
import { init } from "@helium/voter-stake-registry-sdk";
import { useConnection } from "@solana/wallet-adapter-react";
import { PublicKey } from "@solana/web3.js";
import { useAsync } from "react-async-hook";

export function useVotes(proposal: PublicKey) {
const provider = useAnchorProvider();
const { result: sdk, loading: loadingSdk } = useAsync(
async (provider) => init(provider),
[provider]
const { connection: conn } = useConnection();
const {
result: sdk,
loading: loadingSdk,
} = useAsync(
async (conn) => init(new AnchorProvider(conn, {} as any, {})),
[conn]
);
// @ts-ignore
const { result: markers, loading } = useAsync(
Expand Down

0 comments on commit 735c77e

Please sign in to comment.