MCPcopy Create free account
hub / github.com/CleverProgrammers/facebook-solana-blockchain / getProgramInstance

Function getProgramInstance

utils/get-program.js:5–21  ·  view source on GitHub ↗
(connection, wallet)

Source from the content-addressed store, hash-verified

3import { STABLE_POOL_IDL, STABLE_POOL_PROGRAM_ID } from './const'
4
5export function getProgramInstance(connection, wallet) {
6 if (!wallet.publicKey) throw new WalletNotConnectedError()
7
8 const provider = new anchor.Provider(
9 connection,
10 wallet,
11 anchor.Provider.defaultOptions(),
12 )
13
14 const idl = STABLE_POOL_IDL
15
16 const programId = STABLE_POOL_PROGRAM_ID
17
18 const program = new anchor.Program(idl, programId, provider)
19
20 return program
21}

Callers 1

Feed.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected