Mudlands
Mu ltiple I dl and S olana tooling, discovers all IDLs ever published for a Solana program.
import { findIdls } from '@ironforge/mudlands'
function parseWrites(writes: { idl: Buffer }[]) {
return writes.map((w) => JSON.parse(w.idl.toString()))
}
const CANDY_PROGRAM_ID = 'cndy3Z4yapfJBmL3ShUp5exZKqR3z33thTzeNMm2gRZ'
const SOLANA_MAINNET = 'https://api.mainnet-beta.solana.com'
const idlWrites = await findIdls(CANDY_PROGRAM_ID, SOLANA_MAINNET)
console.log(JSON.stringify(parseWrites(idlWrites), null, 2))
Example
To try an example have a look at ./examples/check-idl.ts
.
You can try it via yarn ex:usd
, but replace SOLANA_MAINNET
with an RPC node like helius
first, i.e.:
RPC=$HELIUS_MAIN yarn ex:usd
LICENSE
MIT