You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am trying to convert some js code which uses solana/anchor api to microsoft .net and was planning to use this library.
But I cannot figure out how to get the data/state for a pda, in js the call for this looks like -
program.account.projectParameter.fetch(projectPDA)
Some sample code below to give you a idea of what I am trying to do.
import React, { useState, useEffect } from "react";
import { Program, AnchorProvider, web3 } from "@project-serum/anchor
const getProvider = () => {
const provider = new AnchorProvider(
connection,
window.solana,
opts.preflightCommitment
);
return provider;
};
const getVoters = async (projectId) => {
const program = new Program(project, projectProgramID, provider);
Beta Was this translation helpful? Give feedback.
All reactions