|
| 1 | +--- |
| 2 | +title: Examples |
| 3 | +description: Real-world implementations of Coda for Solana client generation |
| 4 | +--- |
| 5 | + |
| 6 | +Learn from real-world implementations of Coda in production projects. These examples demonstrate different configuration approaches and use cases for generating TypeScript clients from Anchor IDLs. |
| 7 | + |
| 8 | +## Official Examples |
| 9 | + |
| 10 | +### Token Metadata Client |
| 11 | + |
| 12 | +[](https://www.npmjs.com/package/@macalinao/clients-token-metadata) |
| 13 | +[](https://www.npmjs.com/package/@macalinao/clients-token-metadata) |
| 14 | + |
| 15 | +[View on GitHub →](https://github.com/macalinao/coda/tree/master/clients/token-metadata) |
| 16 | + |
| 17 | +The Token Metadata client showcases Coda's capabilities for a **single program** setup: |
| 18 | + |
| 19 | +- **Single IDL configuration** - Simple `coda.config.mjs` for one program |
| 20 | +- **Custom PDAs** - Adds program-derived addresses using Codama visitors |
| 21 | +- **Production-ready** - Pre-generated client for Metaplex Token Metadata |
| 22 | +- **Type-safe operations** - Full TypeScript support with proper typing |
| 23 | + |
| 24 | +Perfect for projects that need to interact with a single Solana program or want to see how to configure custom PDAs and transformations. |
| 25 | + |
| 26 | +### Quarry Client |
| 27 | + |
| 28 | +[](https://www.npmjs.com/package/@macalinao/clients-quarry) |
| 29 | +[](https://www.npmjs.com/package/@macalinao/clients-quarry) |
| 30 | + |
| 31 | +[View on GitHub →](https://github.com/macalinao/coda/tree/master/clients/quarry) |
| 32 | + |
| 33 | +The Quarry client demonstrates Coda's **multi-program** capabilities: |
| 34 | + |
| 35 | +- **Multiple IDL handling** - Uses glob patterns to process multiple IDLs |
| 36 | +- **Workspace management** - Generates clients for an entire protocol suite |
| 37 | +- **Shared types** - Manages dependencies between related programs |
| 38 | +- **Modular structure** - Organized output for complex protocol interactions |
| 39 | + |
| 40 | +Ideal for protocol developers managing multiple interconnected programs or anyone building comprehensive DeFi integrations. |
| 41 | + |
| 42 | +## What Makes These Examples Unique |
| 43 | + |
| 44 | +### Token Metadata |
| 45 | +- Shows how to extend generated code with custom PDAs |
| 46 | +- Demonstrates integration with existing Metaplex ecosystem |
| 47 | +- Includes practical patterns for NFT and metadata operations |
| 48 | + |
| 49 | +### Quarry |
| 50 | +- Illustrates handling of protocol-wide client generation |
| 51 | +- Shows glob pattern configuration for discovering IDLs |
| 52 | +- Demonstrates organizing multiple programs in a single package |
| 53 | + |
| 54 | +## Add Your Example |
| 55 | + |
| 56 | +Using Coda in your project? We'd love to showcase it! |
| 57 | + |
| 58 | +**[Submit a Pull Request →](https://github.com/macalinao/coda/pulls)** to add your project to this documentation. |
| 59 | + |
| 60 | +### How to Add Your Example |
| 61 | + |
| 62 | +1. Fork the [Coda repository](https://github.com/macalinao/coda) |
| 63 | +2. Edit this file at `docs/content/docs/examples.mdx` |
| 64 | +3. Add your project following this format: |
| 65 | + |
| 66 | +```mdx |
| 67 | +### Your Project Name |
| 68 | + |
| 69 | +[View on GitHub →](https://github.com/yourname/yourproject) |
| 70 | + |
| 71 | +Brief description of what makes your implementation unique: |
| 72 | + |
| 73 | +- **Key feature 1** - Description |
| 74 | +- **Key feature 2** - Description |
| 75 | +- **Key feature 3** - Description |
| 76 | + |
| 77 | +What developers can learn from your example. |
| 78 | +``` |
| 79 | + |
| 80 | +4. Submit your PR with a clear description |
| 81 | + |
| 82 | +We welcome examples that demonstrate: |
| 83 | +- Novel configuration approaches |
| 84 | +- Integration patterns |
| 85 | +- Complex visitor usage |
| 86 | +- Multi-program setups |
| 87 | +- Custom code generation workflows |
| 88 | +- Production deployment strategies |
| 89 | + |
| 90 | +Help the Solana developer community by sharing your Coda implementation! |
0 commit comments