google-agents-cli-scaffold
Project scaffolding, deployment configuration, and CI/CD setup for Google ADK agents.
Use when querying the Midnight indexer for blockchain data, fetching account balances, listing transactions, reading contract state, or building data-driven DApp backends.
Full skill instructions
Connect to and query the Midnight Network indexer for blockchain data including balances, transactions, and contract state.
The Midnight indexer provides a GraphQL API for querying blockchain data. It indexes all on-chain activity and exposes it through structured queries.
| Component | Purpose |
|---|---|
| GraphQL API | Query interface for blockchain data |
| WebSocket | Real-time subscriptions (see event-subscriptions skill) |
| REST Health | Service health checks |
The indexer API has evolved through several versions. Ensure your queries are compatible with your target version.
| Version | Key Features | Breaking Changes |
|---|---|---|
| 2.0.0 | Base GraphQL schema | Initial release |
| 2.1.0 | Enhanced filters, pagination | Query parameter changes |
| 2.1.4 | Performance optimizations | None from 2.1.0 |
Midnight uses a UTXO (Unspent Transaction Output) model rather than an account model. Balance queries return the set of unspent outputs owned by an address.
Midnight supports both transparent and shielded transactions. The indexer provides different access patterns:
| Document | Description |
|---|---|
| api-versions.md | Version differences and migration guide |
| query-patterns.md | Common query patterns and optimization |
| Example | Description |
|---|---|
| balance-query/ | Query account balance and UTXOs |
| transaction-list/ | List transaction history with pagination |
| contract-state/ | Read deployed contract state |
import { createIndexerClient } from '@midnight-ntwrk/midnight-js-indexer';
const indexer = createIndexerClient({
uri: 'https://indexer.testnet.midnight.network/api/v1/graphql',
wsUri: 'wss://indexer.testnet.midnight.network/api/v1/graphql',
});
const balance = await indexer.query({
query: `
query GetBalance($address: String!) {
balance(address: $address) {
total
utxos {
txHash
outputIndex
amount
}
}
}
`,
variables: { address: 'addr_test1...' },
});
console.log('Total balance:', balance.data.balance.total);
const transactions = await indexer.query({
query: `
query GetTransactions($address: String!, $limit: Int!) {
transactions(address: $address, first: $limit) {
edges {
node {
hash
blockNumber
timestamp
inputs { address amount }
outputs { address amount }
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
`,
variables: { address: 'addr_test1...', limit: 20 },
});
interface IndexerConfig {
uri: string;
wsUri: string;
}
function getIndexerConfig(): IndexerConfig {
const network = process.env.MIDNIGHT_NETWORK || 'testnet';
const configs: Record<string, IndexerConfig> = {
testnet: {
uri: 'https://indexer.testnet.midnight.network/api/v1/graphql',
wsUri: 'wss://indexer.testnet.midnight.network/api/v1/graphql',
},
mainnet: {
uri: 'https://indexer.midnight.network/api/v1/graphql',
wsUri: 'wss://indexer.midnight.network/api/v1/graphql',
},
};
return configs[network] ?? configs.testnet;
}
async function fetchAllTransactions(
indexer: IndexerClient,
address: string
): Promise<Transaction[]> {
const allTransactions: Transaction[] = [];
let cursor: string | null = null;
let hasMore = true;
while (hasMore) {
const result = await indexer.query({
query: TRANSACTIONS_QUERY,
variables: {
address,
first: 100,
after: cursor,
},
});
const { edges, pageInfo } = result.data.transactions;
allTransactions.push(...edges.map(e => e.node));
hasMore = pageInfo.hasNextPage;
cursor = pageInfo.endCursor;
}
return allTransactions;
}
async function checkIndexerHealth(baseUrl: string): Promise<boolean> {
try {
const response = await fetch(`${baseUrl}/health`);
return response.ok;
} catch {
return false;
}
}
async function queryWithRetry<T>(
indexer: IndexerClient,
query: string,
variables: Record<string, unknown>,
maxRetries = 3
): Promise<T> {
let lastError: Error | null = null;
for (let attempt = 1; attempt <= maxRetries; attempt++) {
try {
return await indexer.query({ query, variables });
} catch (error) {
lastError = error as Error;
if (attempt < maxRetries) {
await new Promise(r => setTimeout(r, 1000 * attempt));
}
}
}
throw lastError;
}
event-subscriptions - Real-time WebSocket event streamsmidnight-tooling:contract-calling - Invoking contracts that change statemidnight-dapp:state-management - Frontend state synchronization with indexer/midnight-tooling:check - Verify indexer connectivityProject scaffolding, deployment configuration, and CI/CD setup for Google ADK agents.
Set up tracing, logging, and monitoring for deployed ADK agents across Cloud Trace, BigQuery, and third-party platforms.
Enterprise Azure infrastructure architect generating Bicep or Terraform from workload descriptions.
Plan and configure production-ready Azure Kubernetes Service clusters with Day-0 and Day-1 best practices.
Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects. For data-heavy dashboards, portfolios, or editorial sites that need to feel like declassified blueprints.
Web search, scraping, extraction, crawling, and monitoring via ScrapeGraph AI CLI.
Skill for working with Firebase Hosting (Classic). Use this when you want to deploy static web apps, Single Page Apps (SPAs), or simple microservices. Do NOT use for Firebase App Hosting.
Deploy and manage web apps with Firebase App Hosting. Use this skill when deploying Next.js/Angular apps with backends.
Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".
Build SEO-optimized pages at scale using templates, data, and proven playbook patterns.
Design and build isolated, reusable Convex backend components with clear boundaries and app-facing wrappers.
Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".
Opus.ai: Revolutionize Your Web Experience
Build a no-code AI app in minutes.
An IDE for code migration from legacy to modern frameworks through coding agents.
Automate CGI animation in live-action scenes
Branded artistic QR-code concepts
Launch a website in seconds with AI.
Streamline Your Coding Experience with AI Code Helper
Convert any screenshot or design to clean code.