Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joeymeere/dreamcast
Fetch & interact with Anchor programs in minutes
https://github.com/joeymeere/dreamcast
anchor solana
Last synced: 2 months ago
JSON representation
Fetch & interact with Anchor programs in minutes
- Host: GitHub
- URL: https://github.com/joeymeere/dreamcast
- Owner: joeymeere
- License: mit
- Created: 2024-04-26T17:35:54.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-05-15T18:25:25.000Z (8 months ago)
- Last Synced: 2024-08-02T11:22:54.893Z (5 months ago)
- Topics: anchor, solana
- Language: TypeScript
- Homepage:
- Size: 45.9 KB
- Stars: 11
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
- solana-awesome - Link
README
Dreamcast
Fetching and interacting with Anchor IDLs made quicker and easier.
## Who Is This For?
Dreamcast is for both novice and expert developers who are looking to interact with programs that lack a Typescript SDK, but have a published IDL account on-chain.Additionally, this library is suitable for those who have an IDL file for a custom program they are interacting with, but want a concise and reusable method for creating their provider and program instances.
## Installation
You can install Dreamcast with npm using the following command:
```
npm i @joeymeere/dreamcast
```
Additionally, you can load the source code via unpkg:
```
https://unpkg.com/@joeymeere/dreamcast@latest
```## Usage
**Fetching IDLs**
```
// create a connection (web3.js)
const connection = new Connection("");
const programId = "STKUaKniasuqrfer3XNbmrrc578pkL1XACdK8H3YPu8";// returns formatted IDL object
const idl = await getIDL(connection, programId);
```## Use with Next.js
If you're using this package with Next.js, you'll need to add some extra lines to your next.config.js to ensure IDLs are correctly loaded.```
transpilePackages: ['@joeymeere/dreamcast'],
webpack: (config) => {
config.resolve.extensionAlias = {
".js": [".ts", ".tsx", ".js", ".jsx"],
".mjs": [".mts", ".mjs"],
".cjs": [".cts", ".cjs"],
};
return config;
},
```