Skip to content

mirrorworld-universe/sonic-code-examples

Sonic Code Examples

This repository contains a collection of code examples and starter templates for building applications on the Sonic blockchain. These examples demonstrate various capabilities of the SonicSVM ecosystem and provide developers with practical starting points for their own projects.

Table of Contents

Basic Sonic Operations

Simple examples for interacting with the Sonic blockchain:

SPL Token Operations

Examples for working with SPL tokens on Sonic:

NFT Operations

Examples for NFT operations:

  • Mint NFT - Create and mint a new NFT using Metaplex

Pyth Integration

Examples for integrating with Pyth Network price feeds:

Agent Kit

A complete example of using the Sonic Agent Kit to create AI agents that can interact with the Sonic blockchain:

Rush ECS Framework

Examples of using the Rush ECS Framework for onchain game development:

  • Rush Quickstart - A simple Bevy game demonstrating how to convert a game to use the Rush ECS framework
  • Position Example - Example of storing and updating entity positions onchain

Getting Started

  1. Clone this repository:

    git clone https://github.com/your-username/sonic-code-examples.git
    cd sonic-code-examples
    
  2. Install dependencies:

    npm install
    
  3. Set up your environment variables in a .env file:

    RPC_URL=https://api.testnet.v1.sonic.game
    SONIC_PRIVATE_KEY=your_private_key_here
    OPENAI_API_KEY=your_openai_api_key_here (for Agent Kit examples)
    
  4. Run an example:

    npx ts-node ts/basic/fetch-balance.ts
    

Resources

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •