Skip to content

feat(chain): implement Solana chain module (#22)#32

Open
xiaofengzii wants to merge 1 commit into
kcolbchain:mainfrom
xiaofengzii:feat/impl-solana-chain-module-issue-22
Open

feat(chain): implement Solana chain module (#22)#32
xiaofengzii wants to merge 1 commit into
kcolbchain:mainfrom
xiaofengzii:feat/impl-solana-chain-module-issue-22

Conversation

@xiaofengzii

Copy link
Copy Markdown

Summary

Implements the Solana chain module for arka SDK as specified in issue #22.

Changes

  • Chain enum: Added Solana variant with chain ID 101, RPC URL, native token (SOL), and explorer URL
  • SolanaConnector: Full RPC client implementation with:
    • get_balance() - Get SOL balance
    • get_slot() - Get current slot
    • get_block_height() - Get block height
    • �ccount_exists() - Check if address exists
    • get_token_balance() - Get SPL token balance
    • �uild_transfer_ix() - Build SOL transfer instruction
    • �uild_token_transfer_ix() - Build SPL token transfer instruction
    • send_transaction() - Send signed transactions
    • �irdrop() - Airdrop SOL (devnet/testnet only)
  • Token mints: Well-known Solana tokens (USDC, USDT, WSOL)
  • Cluster constants: Mainnet, devnet, testnet, and local validator RPCs
  • Tests: Unit tests for balance, slot, account existence, token mints

Acceptance Criteria Met

  • New module chain/solana.rs implementing Solana RPC operations
  • Support: connection, balance check, SOL transfer, SPL token transfer
  • Uses solana-client crate
  • Tests with mainnet RPC
  • Updated examples/multi_chain.rs with Solana demo
  • README updated

Testing

Tests connect to Solana mainnet RPC and verify:

  • Balance queries work
  • Slot queries return valid data
  • Account existence checks function correctly
  • Token mint addresses are valid

Note

Previous PR #28 was closed without merge. This implementation provides a cleaner, more complete solution with proper error handling and comprehensive test coverage.

Closes #22

- Add Solana to Chain enum with chain ID 101
- Add SolanaConnector for RPC operations (balance, slot, transfers)
- Support SOL and SPL token operations
- Add well-known token mints (USDC, USDT, WSOL)
- Update multi_chain example with Solana demo
- Update README with Solana status

Closes kcolbchain#22

Co-authored-by: Cursor <cursoragent@cursor.com>
@abhicris

Copy link
Copy Markdown
Contributor

Welcome to kcolbchain, @xiaofengzii — glad you're here. 🌱

Here's what happens from this PR:

  1. Our automated review looks for obvious issues (tests, secrets, size) within a couple of hours.
  2. If it's clean and CI passes, we merge without back-and-forth.
  3. If we need changes, we'll leave a specific comment — not a generic nit. Push another commit and we re-review.

While you wait:

  • Run the repo's tests locally (see the repo README.md).
  • Keep the PR scoped to one concern — bigger PRs land slower.
  • Don't commit tokens or .env contents.

What happens after your first merge

Thanks for writing the code. We're building this to last.

@abhicris

Copy link
Copy Markdown
Contributor

🤖 Audit verdict: safe

Legitimate Solana SDK integration with standard dependencies, correct token constants, public RPC endpoints, and no malicious payloads or credential leakage.

Audited by the kcolbchain PR pipeline. See pipeline docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

L2: Implement Solana chain module

2 participants