{"openapi":"3.1.0","info":{"title":"SolFund API","version":"1.0.0","summary":"Public API for scanning Solana token accounts and building unsigned reclaim transactions.","description":"SolFund by The Galactic Center scans token accounts and builds unsigned transactions that close them. The server never accepts private keys. Callers sign the returned transactions in their own wallet. Instructions are limited to closeAccount, burn, one disclosed fee transfer, and compute budget."},"servers":[{"url":"/"}],"tags":[{"name":"Scan"},{"name":"Transactions"},{"name":"Stats"}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"Optional. Required only when SOLFUND_API_KEY is set on the server. The same value may be sent as the x-api-key header."}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"Account":{"type":"object","required":["address","mint","programId","program","category","amount","decimals","uiAmount","lamports","closeOnly"],"properties":{"address":{"type":"string","description":"Token account address."},"mint":{"type":"string"},"programId":{"type":"string"},"program":{"type":"string","enum":["spl-token","token-2022"]},"category":{"type":"string","enum":["empty","token","nft","unsupported"]},"name":{"type":"string","nullable":true},"symbol":{"type":"string","nullable":true},"amount":{"type":"string","description":"Raw token amount."},"decimals":{"type":"integer"},"uiAmount":{"type":"string"},"lamports":{"type":"string","description":"SOL lamports returned if the account is closed."},"closeOnly":{"type":"boolean"},"unsupportedReason":{"type":"string"}}},"Quote":{"type":"object","required":["totalLamports","feeLamports","netLamports"],"properties":{"accountCount":{"type":"integer"},"empty":{"type":"integer"},"tokens":{"type":"integer"},"nfts":{"type":"integer"},"totalLamports":{"type":"string"},"feeLamports":{"type":"string"},"netLamports":{"type":"string"}}}}},"paths":{"/api/v1/scan/{wallet}":{"get":{"tags":["Scan"],"operationId":"scanWallet","summary":"List closable accounts and a fee quote","parameters":[{"name":"wallet","in":"path","required":true,"description":"Base58 public address. Private keys are rejected.","schema":{"type":"string"}}],"responses":{"200":{"description":"Closable empty accounts, fungible tokens, NFTs, unsupported accounts, and a quote for closing every closable account.","content":{"application/json":{"schema":{"type":"object","required":["version","wallet","closable","unsupported","quote"],"properties":{"version":{"type":"string","const":"v1"},"wallet":{"type":"string"},"cluster":{"type":"string"},"feeBps":{"type":"integer"},"treasuryAddress":{"type":"string","nullable":true},"closable":{"type":"array","items":{"$ref":"#/components/schemas/Account"}},"unsupported":{"type":"array","items":{"$ref":"#/components/schemas/Account"}},"quote":{"$ref":"#/components/schemas/Quote"}}}}}},"400":{"description":"Invalid public address.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"API key required and missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded."},"502":{"description":"RPC request failed."}}}},"/api/v1/build-transactions":{"post":{"tags":["Transactions"],"operationId":"buildTransactions","summary":"Build unsigned reclaim transactions","description":"Rescans the wallet and builds transactions only for the listed token accounts. The response is unsigned. The caller signs client-side. Allowed instructions: closeAccount, burn, one SystemProgram.transfer for the disclosed fee, and compute budget.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["wallet","accounts"],"properties":{"wallet":{"type":"string","description":"Owner public address."},"accounts":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"string"},"description":"Token account addresses to close. Amounts are read from the chain, not from this body."}}}}}},"responses":{"200":{"description":"Unsigned legacy transactions, base64-encoded, plus a public instruction summary.","content":{"application/json":{"schema":{"type":"object","required":["transactions","quote","recentBlockhash"],"properties":{"recentBlockhash":{"type":"string"},"lastValidBlockHeight":{"type":"integer"},"quote":{"$ref":"#/components/schemas/Quote"},"transactions":{"type":"array","items":{"type":"object","required":["serialized","instructions"],"properties":{"index":{"type":"integer"},"encoding":{"type":"string","const":"base64"},"serialized":{"type":"string"},"instructions":{"type":"array","items":{"type":"object"}}}}}}}}}},"400":{"description":"Invalid input, unsupported account, or the transaction could not be built."},"401":{"description":"API key required and missing."},"429":{"description":"Rate limit exceeded."},"502":{"description":"RPC request failed."}}}},"/api/v1/stats":{"get":{"tags":["Stats"],"operationId":"getStats","summary":"Fee configuration and placeholder network totals","responses":{"200":{"description":"Deployment configuration, null network totals, and this process's request counters."}}}}}}