https://github.com/ironforge-cloud/mudlands
Discovers all IDLs ever published for a Solana program
https://github.com/ironforge-cloud/mudlands
Last synced: about 1 year ago
JSON representation
Discovers all IDLs ever published for a Solana program
- Host: GitHub
- URL: https://github.com/ironforge-cloud/mudlands
- Owner: ironforge-cloud
- Created: 2023-10-31T07:16:47.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-03-16T19:43:12.000Z (over 2 years ago)
- Last Synced: 2025-04-11T20:49:53.906Z (about 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 179 KB
- Stars: 19
- Watchers: 0
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Mudlands
Mu _ltiple_ _I_ dl and S _olana tooling_, discovers all IDLs ever published for a Solana program.
```ts
import { findIdls } from '@ironforge/mudlands'
// Helper to log IDLs
function parseWrites(writes: { idl: Buffer }[]) {
return writes.map((w) => JSON.parse(w.idl.toString()))
}
// Find all IDLs created for CandyMachine
const CANDY_PROGRAM_ID = 'cndy3Z4yapfJBmL3ShUp5exZKqR3z33thTzeNMm2gRZ'
// Should use different RPC provider to avoid getting rate limited
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`](./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.:
```sh
RPC=$HELIUS_MAIN yarn ex:usd
```
## LICENSE
MIT