Skip to content

Instantly share code, notes, and snippets.

@ngundotra
ngundotra / surfpool-jupiter-test.ts
Last active August 14, 2025 19:14
Surfpool-Jupiter Transaction
/**
* Jupiter Swap Test Transaction for Surfpool
* Creates a test transaction that can be executed in the Surfpool environment
* bun run surfpool-jupiter-test.ts
*/
import {
Connection,
PublicKey,
VersionedTransaction,
@ngundotra
ngundotra / usdc-transfer.ts
Created July 24, 2025 19:40
Solana Transfer Test (Priority Fee)
import {
Connection,
Keypair,
PublicKey,
Transaction,
ComputeBudgetProgram,
sendAndConfirmTransaction,
VersionedTransaction,
TransactionMessage
} from '@solana/web3.js';
@ngundotra
ngundotra / top-sas-issuers.ts
Created July 11, 2025 18:50
Get Top SAS Issuers
import {
createSolanaRpc,
getBase58Codec,
getBase64Encoder,
type Address,
type Base58EncodedBytes,
type Codec,
type GetProgramAccountsDatasizeFilter,
type GetProgramAccountsMemcmpFilter,
type Lamports,
sequenceDiagram
  participant Client
  participant Server
  participant Facilitator

  Client->>Server: GET /api
  Server->>Client: HTTP 402 - Payment Required with { extra: { account: pubkey } }
  Client->>Solana: GET /blockhash
 Client->>Client: Form templated transaction, cosign, serialize
@ngundotra
ngundotra / solana-x402-flow.md
Last active July 3, 2025 14:01
Solana x402 Permanent Delegate

x402 on Solana: Permanent Delegate Flow

Flow Diagram

sequenceDiagram
    participant User as User<br/>(Has: Wallet, xUSDC)<br/>(Knows: Sign messages)
    participant Client as Client App<br/>(x402 SDK)
    participant Server as Resource Server<br/>(Has: Solana wallet)<br/>(Knows: Basic web)
    participant Facilitator as Facilitator<br/>(Has: Permanent Delegate)<br/>(Knows: Solana txs)
@ngundotra
ngundotra / SurfpoolBugReport.md
Last active July 2, 2025 11:31
Surfpool Error Repro

Surfpool RPC Response Parsing Error

Issue Description

When sending transactions that result in errors through surfpool, the Python solana-py client crashes with a panic instead of handling the error gracefully:

thread '<unnamed>' panicked at crates/rpc-responses/src/lib.rs:363:84:
called `Result::unwrap()` on an `Err` value: Error("missing field `data`", line: 0, column: 0)
@ngundotra
ngundotra / mcp-response.json
Created June 11, 2025 20:25
OpenAI MCP network call
{
"connector": {
"id": "connector_6849e5b098d4819183df84983fb13a6e",
"created_at": "2025-06-11T20:23:12.597222Z",
"connector_type": "MCP",
"name": "Solana Developer Resources",
"description": "Returns the most up to date resources for documentation across the Solana ecosystem",
"service": "https://mcp.solana.com",
"logo_url": null,
"logo_url_dark": null,
@ngundotra
ngundotra / enriched_nodes.json
Last active June 2, 2025 03:57
Living IP Enriched Json
This file has been truncated, but you can view the full file.
[
{
"key": "def_valueBasedHealthCare",
"title": "Value-Based Health Care",
"definition": "Value-based health care, which focuses on measuring health outcomes and costs",
"lines": [
"3-4"
],
"article_id": "9b72d5ebf17648c3a68e95fa57f1542b",
"article_url": "https://storage.googleapis.com/download/storage/v1/b/teleo-files-cdn/o/teleo%2Fdocs%2Fpid-ce6b7d54c03840adb1f5390bbcf55e05%2Fdid-9b72d5ebf17648c3a68e95fa57f1542b.md?alt=media",
@ngundotra
ngundotra / classes-v0.json
Last active May 19, 2025 13:34
All Classes - Logical Data v0
[
{
"catalogType": "definitions",
"items": [
{
"key": "Def_0to1Innovation",
"title": "0 to 1 Innovation",
"definition": "Intensive progress involves going from 0 to 1 (not simply the 1 to n of globalization).",
"lines": [
"assay3:41",
@ngundotra
ngundotra / lighthouse.codama.json
Created December 31, 2024 15:36
Lighthouse Codama With No Hook Links
{"kind":"rootNode","standard":"codama","version":"1.2.0","program":{"kind":"programNode","name":"lighthouse","publicKey":"L2TExMFKdjpN9kozasaurPirfHy9P8sbXoAN1qA3S95","version":"2.0.0","origin":"shank","docs":[],"accounts":[],"instructions":[{"kind":"instructionNode","name":"memoryWrite","docs":[],"optionalAccountStrategy":"programId","accounts":[{"kind":"instructionAccountNode","name":"programId","isWritable":false,"isSigner":false,"isOptional":false,"docs":["Lighthouse program"],"defaultValue":{"kind":"programIdValueNode"}},{"kind":"instructionAccountNode","name":"systemProgram","isWritable":false,"isSigner":false,"isOptional":false,"docs":["System program"],"defaultValue":{"kind":"publicKeyValueNode","publicKey":"11111111111111111111111111111111","identifier":"splSystem"}},{"kind":"instructionAccountNode","name":"payer","isWritable":true,"isSigner":true,"isOptional":false,"docs":["Payer account"],"defaultValue":{"kind":"payerValueNode"}},{"kind":"instructionAccountNode","name":"memory","isWritable":true,"i