const connection = new anchor.web3.Connection("https://api.devnet.solana.com");
const provider = new anchor.Provider(connection, wallet, {
preflightCommitment: "recent",
});
const programid = new anchor.web3.PublicKey("EcgzWq52GhdCRJFEXub5LCgdqPs5Eid2XfiZSXM22eQu");
const res = await axios.get(process.env.REACT_APP_API_ENDPOINT+"/stakeidl");
const idl = await res.data;
const program = new anchor.Program(idl, programid, provider);
console.log(program);
const [collections,bump] = (await PublicKey.findProgramAddress(["collections"],programid));
console.log(collections,bump);
const tx = await program.rpc.setAdmin(bump,{accounts:
{collections:collections,
admin:wallet.publicKey,
systemProgram:anchor.web3.SystemProgram.programId}});
Above code is throwing custom program error 0xbbf I create program using publickey and idl and call setAdmin on rust it is giving 0xbbf