GoldRush Onchain Data

The SDK includes built-in tools for interacting with blockchain data through the GoldRush API. These tools allow agents to fetch token balances, NFT holdings, and transaction history across 100+ blockchains.

Each GoldRush tool requires an API key which can be set through the GOLDRUSH_API_KEY environment variable. Tools can be used independently or combined for comprehensive blockchain analysis.

Available GoldRush Tools

  1. Token Balances Tool: Fetch token balances for any wallet address across supported blockchains. This tool provides detailed information including:
    • Token amounts and USD values
    • Token metadata (symbol, decimals, contract address)
const tokenBalances = new TokenBalancesTool("openai");
  1. NFT Holdings Tool: Fetch NFT holdings for any wallet address with comprehensive metadata:
    • Collection information
    • Token IDs and ownership details
    • Media URLs and metadata
    • Floor prices and estimated values
const nftHoldings = new NFTHoldingsTool("openai");
  1. Transaction History Tool: Fetch detailed transaction history for any wallet address including:
    • Transaction types (transfers, swaps, mints)
    • Token movements and values
    • Timestamps and block information
    • Gas costs and transaction status
const transactionHistory = new TransactionHistoryTool("openai");
  1. Historical Token Price Tool: Fetch historical price data for any token across supported blockchains:
    • Price history over customizable timeframes (1h, 24h, 7d, 30d)
    • Token prices in USD
    • Detailed price data points within the selected timeframe
const historicalPrices = new HistoricalTokenPriceTool("openai");

Using GoldRush Tools

To use GoldRush tools in your agent:

const agent = new Agent({
    name: "blockchain researcher",
    model: {
        provider: "OPEN_AI",
        id: "gpt-4o-mini",
    },
    description:
        "You are a blockchain researcher analyzing wallet activities using the GoldRush On Chain Data APIs.",
    instructions: [
        "Analyze wallet activities using the provided blockchain tools",
        "Summarize token holdings, NFT collections, and recent transactions",
        "Provide insights about the wallet's activity patterns",
    ],
    tools: {
        tokenBalances: new TokenBalancesTool("openai"),
        nftBalances: new NFTBalancesTool("openai"),
        transactions: new TransactionsTool("openai"),
    },
});