diff --git a/typescript/faucet-mcp/README.md b/typescript/faucet-mcp/README.md new file mode 100644 index 0000000..d3b4287 --- /dev/null +++ b/typescript/faucet-mcp/README.md @@ -0,0 +1,211 @@ +# TBNB Faucet MCP Server (Node.js) + +A Node.js implementation of a Model Context Protocol (MCP) server that provides a faucet service for distributing testnet BNB tokens on the Binance Smart Chain testnet. + +## About + +This MCP server enables AI agents and other MCP clients to request and receive testnet BNB tokens by interacting with the BSC testnet blockchain. It follows the Anthropic MCP specification and can be integrated with any MCP-compatible client. + +## Prerequisites + +- Node.js 18.0 or higher +- npm or yarn package manager +- A BSC testnet wallet with TBNB for the faucet +- Access to BSC testnet RPC endpoint + +## Installation + +1. Navigate to the project directory: +```bash +cd faucet-mcp +``` + +2. Install dependencies: +```bash +npm install +``` + +## Configuration + +Set the following environment variables before running: + +- `FAUCET_PRIVATE_KEY`: The private key of your faucet wallet (required) +- `BSC_TESTNET_RPC`: BSC testnet RPC endpoint URL (optional, has default) + +Example: + +```bash +export FAUCET_PRIVATE_KEY="0x..." +export BSC_TESTNET_RPC="https://data-seed-prebsc-1-s1.binance.org:8545/" +``` + +Or create a `.env` file (not included in repo for security): + +``` +FAUCET_PRIVATE_KEY=0x... +BSC_TESTNET_RPC=https://data-seed-prebsc-1-s1.binance.org:8545/ +``` + +## Usage + +Run the server: + +```bash +node index.js +``` + +Or using npm: + +```bash +npm start +``` + +The server communicates via stdio, which is the standard transport for MCP servers. + +## Available Tools + +### send_tbnb + +Sends testnet BNB tokens to a recipient address. + +**Parameters:** +- `recipient` (string, required): BSC testnet address to receive tokens +- `amount` (number, optional): Amount of TBNB to send (default: 0.1, max: 1.0) + +**Returns:** +- Transaction hash +- Recipient address +- Amount sent +- Block number +- Transaction status + +### get_faucet_info + +Retrieves information about the faucet wallet. + +**Parameters:** None + +**Returns:** +- Faucet wallet address +- Current balance (Wei and TBNB) +- Network information +- RPC endpoint + +### get_balance + +Queries the TBNB balance of any BSC testnet address. + +**Parameters:** +- `address` (string, required): BSC testnet address to check + +**Returns:** +- Address (checksummed) +- Balance in Wei and TBNB +- Network name + +## MCP Client Integration + +To integrate this server with an MCP client, add it to your client configuration: + +```json +{ + "mcpServers": { + "tbnb-faucet": { + "command": "node", + "args": ["/absolute/path/to/index.js"], + "env": { + "FAUCET_PRIVATE_KEY": "0x...", + "BSC_TESTNET_RPC": "https://data-seed-prebsc-1-s1.binance.org:8545/" + } + } + } +} +``` + +## Network Configuration + +- **Network**: Binance Smart Chain Testnet +- **Chain ID**: 97 +- **Default RPC**: https://data-seed-prebsc-1-s1.binance.org:8545/ +- **Block Explorer**: https://testnet.bscscan.com + +## Error Handling + +The server includes comprehensive error handling: + +- Address validation (checksum and format) +- Amount validation (0 to 1.0 TBNB) +- Self-transfer prevention +- Network connectivity checks +- Transaction error reporting + +All errors are returned as structured JSON responses. + +## Security + +🔒 **Security Best Practices:** + +- Never commit your private key to version control +- Use environment variables or secure secret management systems +- This server is intended for testnet use only +- Consider implementing rate limiting for production deployments +- Monitor faucet balance and set up alerts + +## Troubleshooting + +### Common Issues + +**"Faucet wallet not configured"** +- Ensure `FAUCET_PRIVATE_KEY` environment variable is set +- Verify the private key is valid and starts with `0x` + +**Connection errors** +- Check your internet connection +- Verify the RPC endpoint is accessible +- Try an alternative BSC testnet RPC endpoint + +**Transaction failures** +- Ensure the faucet wallet has sufficient TBNB balance +- Verify the recipient address is valid +- Check network conditions (gas prices, congestion) + +**Module not found errors** +- Run `npm install` to install dependencies +- Ensure you're using Node.js 18.0 or higher + +## Development + +The server uses: +- `@modelcontextprotocol/sdk` for MCP protocol implementation +- `ethers.js` v6 for blockchain interactions + +## License + +MIT License + +## Testing + +Run unit tests: + +```bash +npm install +npm test +``` + +Run tests with coverage: + +```bash +npm run test:coverage +``` + +Run tests in watch mode: + +```bash +npm run test:watch +``` + +## Resources + +- [Model Context Protocol Documentation](https://modelcontextprotocol.io) +- [BNB Chain Documentation](https://docs.bnbchain.org) +- [Ethers.js Documentation](https://docs.ethers.org) diff --git a/typescript/faucet-mcp/index.js b/typescript/faucet-mcp/index.js new file mode 100644 index 0000000..6414234 --- /dev/null +++ b/typescript/faucet-mcp/index.js @@ -0,0 +1,299 @@ +#!/usr/bin/env node + +/** + * TBNB Faucet MCP Server + * Model Context Protocol server for distributing testnet BNB tokens + */ + +import { Server } from "@modelcontextprotocol/sdk/server/index.js"; +import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; +import { + CallToolRequestSchema, + ListToolsRequestSchema, +} from "@modelcontextprotocol/sdk/types.js"; +import { ethers } from "ethers"; + +// Configuration +const BSC_TESTNET_RPC = process.env.BSC_TESTNET_RPC || "https://data-seed-prebsc-1-s1.binance.org:8545/"; +const FAUCET_PRIVATE_KEY = process.env.FAUCET_PRIVATE_KEY || ""; + +if (!FAUCET_PRIVATE_KEY) { + console.error("WARNING: FAUCET_PRIVATE_KEY environment variable is not set"); +} + +// Initialize provider and wallet +const provider = new ethers.JsonRpcProvider(BSC_TESTNET_RPC); +let wallet = null; +let walletAddress = null; + +if (FAUCET_PRIVATE_KEY) { + wallet = new ethers.Wallet(FAUCET_PRIVATE_KEY, provider); + walletAddress = wallet.address; +} + +// MCP Server +const server = new Server( + { + name: "tbnb-faucet", + version: "1.0.0", + }, + { + capabilities: { + tools: {}, + }, + } +); + +// List available tools +server.setRequestHandler(ListToolsRequestSchema, async () => { + return { + tools: [ + { + name: "send_tbnb", + description: "Send testnet BNB tokens to a specified address on BSC testnet", + inputSchema: { + type: "object", + properties: { + recipient: { + type: "string", + description: "The BSC testnet address that will receive the TBNB tokens", + }, + amount: { + type: "number", + description: "Amount of TBNB to send (default: 0.1, maximum: 1.0)", + default: 0.1, + }, + }, + required: ["recipient"], + }, + }, + { + name: "get_faucet_info", + description: "Get information about the faucet including current balance", + inputSchema: { + type: "object", + properties: {}, + }, + }, + { + name: "get_balance", + description: "Get the TBNB balance of a BSC testnet address", + inputSchema: { + type: "object", + properties: { + address: { + type: "string", + description: "The BSC testnet address to check", + }, + }, + required: ["address"], + }, + }, + ], + }; +}); + +// Handle tool calls +server.setRequestHandler(CallToolRequestSchema, async (request) => { + const { name, arguments: args } = request.params; + + try { + switch (name) { + case "send_tbnb": + return await handleSendTbnb(args); + case "get_faucet_info": + return await handleGetFaucetInfo(); + case "get_balance": + return await handleGetBalance(args); + default: + throw new Error(`Unknown tool: ${name}`); + } + } catch (error) { + return { + content: [ + { + type: "text", + text: JSON.stringify( + { + error: error.message, + }, + null, + 2 + ), + }, + ], + isError: true, + }; + } +}); + +/** + * Send TBNB to a recipient address + */ +async function handleSendTbnb(args) { + if (!wallet) { + throw new Error("Faucet wallet not configured. Please set FAUCET_PRIVATE_KEY."); + } + + const recipient = args?.recipient; + const amount = args?.amount || 0.1; + + if (!recipient) { + throw new Error("Recipient address is required"); + } + + // Validate address + if (!ethers.isAddress(recipient)) { + throw new Error(`Invalid address: ${recipient}`); + } + + const recipientAddress = ethers.getAddress(recipient); + + // Prevent self-transfer + if (recipientAddress.toLowerCase() === walletAddress.toLowerCase()) { + throw new Error("Cannot send tokens to the faucet address itself"); + } + + // Validate amount + if (amount <= 0 || amount > 1.0) { + throw new Error("Amount must be between 0 and 1.0 TBNB"); + } + + try { + // Convert amount to Wei + const amountWei = ethers.parseEther(amount.toString()); + + // Get current gas price + const feeData = await provider.getFeeData(); + + // Send transaction + const tx = await wallet.sendTransaction({ + to: recipientAddress, + value: amountWei, + gasLimit: 21000, + gasPrice: feeData.gasPrice, + }); + + // Wait for transaction to be mined + const receipt = await tx.wait(); + + return { + content: [ + { + type: "text", + text: JSON.stringify( + { + success: true, + transactionHash: tx.hash, + recipient: recipientAddress, + amount: amount, + amountWei: amountWei.toString(), + blockNumber: receipt.blockNumber, + status: receipt.status === 1 ? "confirmed" : "failed", + }, + null, + 2 + ), + }, + ], + }; + } catch (error) { + throw new Error(`Transaction failed: ${error.message}`); + } +} + +/** + * Get faucet information and balance + */ +async function handleGetFaucetInfo() { + if (!walletAddress) { + throw new Error("Faucet wallet not configured"); + } + + try { + const balance = await provider.getBalance(walletAddress); + const balanceTbnb = ethers.formatEther(balance); + + // Get network info + const network = await provider.getNetwork(); + + return { + content: [ + { + type: "text", + text: JSON.stringify( + { + faucetAddress: walletAddress, + balanceWei: balance.toString(), + balanceTbnb: parseFloat(balanceTbnb), + network: { + name: "BSC Testnet", + chainId: network.chainId.toString(), + }, + rpcEndpoint: BSC_TESTNET_RPC, + }, + null, + 2 + ), + }, + ], + }; + } catch (error) { + throw new Error(`Failed to get faucet info: ${error.message}`); + } +} + +/** + * Get balance of an address + */ +async function handleGetBalance(args) { + const address = args?.address; + + if (!address) { + throw new Error("Address is required"); + } + + // Validate address + if (!ethers.isAddress(address)) { + throw new Error(`Invalid address: ${address}`); + } + + try { + const addressChecksum = ethers.getAddress(address); + const balance = await provider.getBalance(addressChecksum); + const balanceTbnb = ethers.formatEther(balance); + + return { + content: [ + { + type: "text", + text: JSON.stringify( + { + address: addressChecksum, + balanceWei: balance.toString(), + balanceTbnb: parseFloat(balanceTbnb), + network: "BSC Testnet", + }, + null, + 2 + ), + }, + ], + }; + } catch (error) { + throw new Error(`Failed to get balance: ${error.message}`); + } +} + +// Start server +async function main() { + const transport = new StdioServerTransport(); + await server.connect(transport); + + console.error("TBNB Faucet MCP Server running on stdio"); +} + +main().catch((error) => { + console.error("Fatal error:", error); + process.exit(1); +}); diff --git a/typescript/faucet-mcp/index.test.js b/typescript/faucet-mcp/index.test.js new file mode 100644 index 0000000..9f47c94 --- /dev/null +++ b/typescript/faucet-mcp/index.test.js @@ -0,0 +1,277 @@ +/** + * Unit tests for TBNB Faucet MCP Server (Example 3 - Node.js) + * + * Note: These tests focus on the business logic and validation + * rather than full integration with the MCP server, since the server + * initializes on import and uses stdio transport. + */ + +import { describe, test, expect, beforeEach, jest } from '@jest/globals'; + +describe('Address Validation Logic', () => { + test('should validate correct Ethereum address format', () => { + const validAddress = '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb0'; + // Ethereum addresses are 42 characters (0x + 40 hex chars) + expect(validAddress.length).toBe(42); + expect(validAddress.startsWith('0x')).toBe(true); + expect(/^0x[a-fA-F0-9]{40}$/.test(validAddress)).toBe(true); + }); + + test('should reject invalid address formats', () => { + const invalidAddresses = [ + 'invalid', + '0x123', + '742d35Cc6634C0532925a3b844Bc9e7595f0bEb', // Missing 0x + '0xGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG', // Invalid hex + '', + ]; + + invalidAddresses.forEach((addr) => { + const isValid = addr.length === 42 && addr.startsWith('0x') && /^0x[a-fA-F0-9]{40}$/.test(addr); + expect(isValid).toBe(false); + }); + }); +}); + +describe('Amount Validation Logic', () => { + test('should accept valid amounts between 0 and 1.0', () => { + const validAmounts = [0.01, 0.1, 0.5, 1.0]; + + validAmounts.forEach((amount) => { + const isValid = amount > 0 && amount <= 1.0; + expect(isValid).toBe(true); + }); + }); + + test('should reject zero or negative amounts', () => { + const invalidAmounts = [0, -0.1, -1.0]; + + invalidAmounts.forEach((amount) => { + const isValid = amount > 0 && amount <= 1.0; + expect(isValid).toBe(false); + }); + }); + + test('should reject amounts greater than 1.0', () => { + const invalidAmounts = [1.1, 2.0, 10.0]; + + invalidAmounts.forEach((amount) => { + const isValid = amount > 0 && amount <= 1.0; + expect(isValid).toBe(false); + }); + }); +}); + +describe('Self-Transfer Prevention Logic', () => { + test('should detect self-transfer attempts', () => { + const faucetAddress = '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb'; + const recipient = '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb'; + + const isSelfTransfer = recipient.toLowerCase() === faucetAddress.toLowerCase(); + expect(isSelfTransfer).toBe(true); + }); + + test('should allow transfers to different addresses', () => { + const faucetAddress = '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb'; + const recipient = '0x1234567890123456789012345678901234567890'; + + const isSelfTransfer = recipient.toLowerCase() === faucetAddress.toLowerCase(); + expect(isSelfTransfer).toBe(false); + }); +}); + +describe('Wei Conversion Logic', () => { + test('should convert TBNB to Wei correctly', () => { + // 1 TBNB = 10^18 Wei + const tbnbAmounts = [ + { tbnb: 0.1, wei: '100000000000000000' }, + { tbnb: 1.0, wei: '1000000000000000000' }, + { tbnb: 0.01, wei: '10000000000000000' }, + ]; + + tbnbAmounts.forEach(({ tbnb, wei }) => { + // Manual conversion for testing + const calculatedWei = (tbnb * Math.pow(10, 18)).toString(); + expect(calculatedWei).toBe(wei); + }); + }); + + test('should handle Wei to TBNB conversion', () => { + const weiAmounts = [ + { wei: '100000000000000000', tbnb: 0.1 }, + { wei: '1000000000000000000', tbnb: 1.0 }, + { wei: '500000000000000000', tbnb: 0.5 }, + ]; + + weiAmounts.forEach(({ wei, tbnb }) => { + // Manual conversion for testing + const calculatedTbnb = parseFloat(wei) / Math.pow(10, 18); + expect(calculatedTbnb).toBeCloseTo(tbnb, 10); + }); + }); +}); + +describe('Transaction Response Format', () => { + test('should format successful transaction response correctly', () => { + const mockResponse = { + success: true, + transactionHash: '0xabcdef1234567890', + recipient: '0x1234567890123456789012345678901234567890', + amount: 0.1, + amountWei: '100000000000000000', + blockNumber: 12345, + status: 'confirmed', + }; + + expect(mockResponse).toHaveProperty('success'); + expect(mockResponse).toHaveProperty('transactionHash'); + expect(mockResponse).toHaveProperty('recipient'); + expect(mockResponse).toHaveProperty('amount'); + expect(mockResponse).toHaveProperty('blockNumber'); + expect(mockResponse).toHaveProperty('status'); + expect(mockResponse.success).toBe(true); + expect(mockResponse.status).toBe('confirmed'); + }); + + test('should format error response correctly', () => { + const mockErrorResponse = { + error: 'Invalid address: invalid_address', + }; + + expect(mockErrorResponse).toHaveProperty('error'); + expect(typeof mockErrorResponse.error).toBe('string'); + }); +}); + +describe('Faucet Info Response Format', () => { + test('should format faucet info response correctly', () => { + const mockFaucetInfo = { + faucetAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb', + balanceWei: '1000000000000000000', + balanceTbnb: 1.0, + network: { + name: 'BSC Testnet', + chainId: '97', + }, + rpcEndpoint: 'https://data-seed-prebsc-1-s1.binance.org:8545/', + }; + + expect(mockFaucetInfo).toHaveProperty('faucetAddress'); + expect(mockFaucetInfo).toHaveProperty('balanceWei'); + expect(mockFaucetInfo).toHaveProperty('balanceTbnb'); + expect(mockFaucetInfo).toHaveProperty('network'); + expect(mockFaucetInfo).toHaveProperty('rpcEndpoint'); + expect(mockFaucetInfo.network.chainId).toBe('97'); + }); +}); + +describe('Balance Query Response Format', () => { + test('should format balance query response correctly', () => { + const mockBalanceResponse = { + address: '0x1234567890123456789012345678901234567890', + balanceWei: '500000000000000000', + balanceTbnb: 0.5, + network: 'BSC Testnet', + }; + + expect(mockBalanceResponse).toHaveProperty('address'); + expect(mockBalanceResponse).toHaveProperty('balanceWei'); + expect(mockBalanceResponse).toHaveProperty('balanceTbnb'); + expect(mockBalanceResponse).toHaveProperty('network'); + expect(mockBalanceResponse.balanceTbnb).toBe(0.5); + }); +}); + +describe('Error Handling', () => { + test('should handle missing recipient address', () => { + const recipient = ''; + if (!recipient) { + expect(() => { + throw new Error('Recipient address is required'); + }).toThrow('Recipient address is required'); + } + }); + + test('should handle missing wallet configuration', () => { + const wallet = null; + if (!wallet) { + expect(() => { + throw new Error('Faucet wallet not configured. Please set FAUCET_PRIVATE_KEY.'); + }).toThrow('Faucet wallet not configured'); + } + }); + + test('should handle network errors gracefully', () => { + const networkError = new Error('Network error'); + expect(networkError.message).toBe('Network error'); + expect(networkError).toBeInstanceOf(Error); + }); +}); + +describe('MCP Tool Schema Validation', () => { + test('send_tbnb tool should have correct schema structure', () => { + const toolSchema = { + name: 'send_tbnb', + description: 'Send testnet BNB tokens to a specified address on BSC testnet', + inputSchema: { + type: 'object', + properties: { + recipient: { + type: 'string', + description: 'The BSC testnet address that will receive the TBNB tokens', + }, + amount: { + type: 'number', + description: 'Amount of TBNB to send (default: 0.1, maximum: 1.0)', + default: 0.1, + }, + }, + required: ['recipient'], + }, + }; + + expect(toolSchema).toHaveProperty('name'); + expect(toolSchema).toHaveProperty('description'); + expect(toolSchema).toHaveProperty('inputSchema'); + expect(toolSchema.inputSchema.type).toBe('object'); + expect(toolSchema.inputSchema.required).toContain('recipient'); + }); + + test('get_faucet_info tool should have correct schema structure', () => { + const toolSchema = { + name: 'get_faucet_info', + description: 'Get information about the faucet including current balance', + inputSchema: { + type: 'object', + properties: {}, + }, + }; + + expect(toolSchema).toHaveProperty('name'); + expect(toolSchema).toHaveProperty('description'); + expect(toolSchema).toHaveProperty('inputSchema'); + expect(toolSchema.inputSchema.type).toBe('object'); + }); + + test('get_balance tool should have correct schema structure', () => { + const toolSchema = { + name: 'get_balance', + description: 'Get the TBNB balance of a BSC testnet address', + inputSchema: { + type: 'object', + properties: { + address: { + type: 'string', + description: 'The BSC testnet address to check', + }, + }, + required: ['address'], + }, + }; + + expect(toolSchema).toHaveProperty('name'); + expect(toolSchema).toHaveProperty('description'); + expect(toolSchema).toHaveProperty('inputSchema'); + expect(toolSchema.inputSchema.required).toContain('address'); + }); +}); diff --git a/typescript/faucet-mcp/package.json b/typescript/faucet-mcp/package.json new file mode 100644 index 0000000..8e7ca75 --- /dev/null +++ b/typescript/faucet-mcp/package.json @@ -0,0 +1,41 @@ +{ + "name": "tbnb-faucet-mcp", + "version": "1.0.0", + "description": "MCP server for distributing testnet BNB tokens on BSC testnet", + "type": "module", + "main": "index.js", + "scripts": { + "start": "node index.js", + "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js", + "test:watch": "node --experimental-vm-modules node_modules/jest/bin/jest.js --watch", + "test:coverage": "node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage" + }, + "keywords": [ + "mcp", + "model-context-protocol", + "bnb", + "testnet", + "faucet", + "blockchain" + ], + "author": "", + "license": "MIT", + "dependencies": { + "@modelcontextprotocol/sdk": "^0.5.0", + "ethers": "^6.9.0" + }, + "devDependencies": { + "@jest/globals": "^29.7.0", + "jest": "^29.7.0" + }, + "engines": { + "node": ">=18.0.0" + }, + "jest": { + "testEnvironment": "node", + "transform": {}, + "moduleNameMapper": { + "^(\\.{1,2}/.*)\\.js$": "$1" + } + } +} diff --git a/typescript/mini-subgraph-event-listener/README.md b/typescript/mini-subgraph-event-listener/README.md new file mode 100644 index 0000000..5aff529 --- /dev/null +++ b/typescript/mini-subgraph-event-listener/README.md @@ -0,0 +1,81 @@ +# Mini Subgraph Event Listener + +A small **BNBChain Cookbook** demo for listening to and querying blockchain events from **BNB Smart Chain (BSC)** smart contracts. Query past events or listen in real-time as new events are emitted. + +![Screenshot](./mini-subgraph-event-listener.png) + +## What it does + +- **Query past events** — Fetch events from a specified block range on BSC. +- **Real-time listening** — Subscribe to new events as they're emitted on-chain. +- **Event parsing** — Automatically decode event parameters using Solidity event signatures. +- **Dark-mode UI** — Modern interface with left info pane and right interaction pane. + +## Tech stack + +- **TypeScript** +- **ethers.js v6** — Blockchain interaction and event parsing +- **Vite** — Build + dev server +- **Vitest** — Unit tests + +## Quick start + +### 1. Clone and run (recommended) + +From the project directory: + +```bash +chmod +x clone-and-run.sh +./clone-and-run.sh +``` + +The script installs deps, seeds `.env` from `.env.example`, runs tests, and starts the dev server. Open the dev server URL (e.g. `http://localhost:5173`). + +### 2. Manual setup + +```bash +npm install +cp .env.example .env +# Edit .env if needed (VITE_BSC_RPC_URL is optional, defaults to public BSC RPC) +npm test +npm run dev +``` + +Then open the dev server URL (e.g. `http://localhost:5173`). + +## Usage + +1. **Enter contract address** — Use a BSC contract address (e.g., WBNB: `0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c`). +2. **Select or enter event signature** — Choose from sample events or enter a custom one in Solidity format: + ``` + event Transfer(address indexed from, address indexed to, uint256 value) + ``` +3. **Query past events** — Specify block range and click "Query Events". +4. **Listen in real-time** — Click "Start Listening" to receive new events as they're emitted. + +## Example contracts + +- **WBNB (Wrapped BNB)**: `0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c` +- **BUSD**: `0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56` + +Both support standard ERC20 events like `Transfer` and `Approval`. + +## Scripts + +| Command | Description | +|---------------|----------------------------| +| `npm run dev` | Start Vite dev server | +| `npm run build` | Production build | +| `npm run preview` | Serve `dist/` | +| `npm test` | Run Vitest unit tests | + +## Project layout + +- `src/app.ts` — Core event listening and querying logic. +- `src/frontend.ts` — UI (dark theme, info + interaction panes). +- `index.html` — Entry page. +- `tests/app.test.ts` — Unit tests for all app functions. + +## License + +MIT. diff --git a/typescript/mini-subgraph-event-listener/app.test.ts b/typescript/mini-subgraph-event-listener/app.test.ts new file mode 100644 index 0000000..3240c0f --- /dev/null +++ b/typescript/mini-subgraph-event-listener/app.test.ts @@ -0,0 +1,153 @@ +import { describe, it, expect } from "vitest"; +import { + createBscProvider, + parseEventLog, + isValidAddress, + isValidEventSignature, + getSampleEventSignatures, + getCurrentBlockNumber, + queryPastEvents, +} from "./app.js"; +import { JsonRpcProvider, Log } from "ethers"; + +describe("createBscProvider", () => { + it("creates a provider with default BSC RPC", () => { + const provider = createBscProvider(); + expect(provider).toBeInstanceOf(JsonRpcProvider); + }); + + it("creates a provider with custom RPC URL", () => { + const customUrl = "https://bsc-dataseed1.bnbchain.org"; + const provider = createBscProvider(customUrl); + expect(provider).toBeInstanceOf(JsonRpcProvider); + }); +}); + +describe("isValidAddress", () => { + it("returns true for valid Ethereum address", () => { + expect(isValidAddress("0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c")).toBe(true); + expect(isValidAddress("0x0000000000000000000000000000000000000000")).toBe(true); + }); + + it("returns false for invalid addresses", () => { + expect(isValidAddress("")).toBe(false); + expect(isValidAddress("0x123")).toBe(false); + expect(isValidAddress("bb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c")).toBe(false); + expect(isValidAddress("0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c123")).toBe(false); + }); +}); + +describe("isValidEventSignature", () => { + it("returns true for valid event signatures", () => { + expect(isValidEventSignature("event Transfer(address indexed from, address indexed to, uint256 value)")).toBe(true); + expect(isValidEventSignature("event Approval(address indexed owner, address indexed spender, uint256 value)")).toBe(true); + expect(isValidEventSignature("event PairCreated(address indexed token0, address indexed token1, address pair, uint256)")).toBe(true); + }); + + it("returns false for invalid event signatures", () => { + expect(isValidEventSignature("")).toBe(false); + expect(isValidEventSignature("Transfer(address, address, uint256)")).toBe(false); + expect(isValidEventSignature("function transfer()")).toBe(false); + expect(isValidEventSignature("event")).toBe(false); + }); +}); + +describe("getSampleEventSignatures", () => { + it("returns sample event signatures", () => { + const samples = getSampleEventSignatures(); + expect(samples).toBeDefined(); + expect(samples.Transfer).toContain("event Transfer"); + expect(samples.Approval).toContain("event Approval"); + expect(samples["PancakeSwap Pair Created"]).toContain("event PairCreated"); + }); + + it("all returned signatures are valid", () => { + const samples = getSampleEventSignatures(); + for (const sig of Object.values(samples)) { + expect(isValidEventSignature(sig)).toBe(true); + } + }); +}); + +describe("parseEventLog", () => { + it("parses a log into EventData structure", () => { + const mockLog: Log = { + blockNumber: 12345, + blockHash: "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890", + transactionHash: "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", + address: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c", + topics: ["0x1234"], + data: "0x5678", + index: 0, + removed: false, + }; + + const eventData = parseEventLog(mockLog, "Transfer"); + expect(eventData.blockNumber).toBe(12345); + expect(eventData.blockHash).toBe(mockLog.blockHash); + expect(eventData.transactionHash).toBe(mockLog.transactionHash); + expect(eventData.address).toBe(mockLog.address); + expect(eventData.eventName).toBe("Transfer"); + expect(eventData.topics).toEqual(mockLog.topics); + expect(eventData.data).toBe(mockLog.data); + }); + + it("handles logs without event name", () => { + const mockLog: Log = { + blockNumber: 12345, + blockHash: "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890", + transactionHash: "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", + address: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c", + topics: ["0x1234"], + data: "0x5678", + index: 0, + removed: false, + }; + + const eventData = parseEventLog(mockLog); + expect(eventData.eventName).toBe("Unknown"); + }); +}); + +describe("getCurrentBlockNumber", () => { + it("returns a valid block number", async () => { + const provider = createBscProvider(); + const blockNumber = await getCurrentBlockNumber(provider); + expect(typeof blockNumber).toBe("number"); + expect(blockNumber).toBeGreaterThan(0); + }, 10000); +}); + +describe("queryPastEvents", () => { + it("handles invalid contract address gracefully", async () => { + const provider = createBscProvider(); + await expect( + queryPastEvents( + provider, + "0xinvalid", + "event Transfer(address indexed from, address indexed to, uint256 value)", + 0, + 100 + ) + ).rejects.toThrow(); + }, 10000); + + it("handles invalid event signature gracefully", async () => { + const provider = createBscProvider(); + await expect( + queryPastEvents( + provider, + "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c", + "invalid signature", + 0, + 100 + ) + ).rejects.toThrow("Invalid event signature format"); + }, 10000); +}); + +// Note: Real event querying tests would require: +// - A known contract with known events +// - Specific block ranges where events exist +// - More complex mocking or integration test setup +// For a mini demo, the above tests cover the core validation and parsing logic. diff --git a/typescript/mini-subgraph-event-listener/app.ts b/typescript/mini-subgraph-event-listener/app.ts new file mode 100644 index 0000000..b030d8f --- /dev/null +++ b/typescript/mini-subgraph-event-listener/app.ts @@ -0,0 +1,215 @@ +/** + * Mini Subgraph Event Listener — core logic for BNB Smart Chain (BSC). + * Listens to and queries blockchain events from smart contracts. + */ + +import { JsonRpcProvider, Contract, EventLog, Log } from "ethers"; + +/** BSC mainnet RPC URL. */ +export const DEFAULT_BSC_RPC = "https://bsc-dataseed.bnbchain.org"; + +/** Event data structure for display. */ +export interface EventData { + blockNumber: number; + blockHash: string; + transactionHash: string; + address: string; + eventName: string; + args: Record; + topics: string[]; + data: string; + timestamp?: number; +} + +/** + * Creates a provider for BSC mainnet. + */ +export function createBscProvider(rpcUrl?: string): JsonRpcProvider { + return new JsonRpcProvider(rpcUrl || DEFAULT_BSC_RPC); +} + +/** + * Parses an event log into a structured EventData object. + */ +export function parseEventLog( + log: EventLog | Log, + eventName?: string +): EventData { + const eventLog = log as EventLog; + return { + blockNumber: log.blockNumber, + blockHash: log.blockHash, + transactionHash: log.transactionHash, + address: log.address, + eventName: eventName || "Unknown", + args: eventLog.args ? Object.fromEntries( + Object.entries(eventLog.args).filter(([k]) => !/^\d+$/.test(k)) + ) : {}, + topics: log.topics, + data: log.data, + }; +} + +/** + * Queries past events from a contract. + */ +export async function queryPastEvents( + provider: JsonRpcProvider, + contractAddress: string, + eventSignature: string, + fromBlock: number, + toBlock: number | "latest" +): Promise { + try { + // Validate address first + if (!isValidAddress(contractAddress)) { + throw new Error("Invalid contract address"); + } + + // Validate event signature format + if (!isValidEventSignature(eventSignature)) { + throw new Error("Invalid event signature format"); + } + + let contract: Contract; + try { + contract = new Contract(contractAddress, [eventSignature], provider); + } catch (error) { + throw new Error( + `Failed to create contract interface: ${error instanceof Error ? error.message : String(error)}` + ); + } + + const eventName = eventSignature.match(/event\s+(\w+)/)?.[1] || "Unknown"; + + const toBlockNum = toBlock === "latest" ? await provider.getBlockNumber() : toBlock; + + let filter; + try { + filter = contract.filters[eventName](); + } catch (error) { + throw new Error( + `Failed to create event filter: ${error instanceof Error ? error.message : String(error)}` + ); + } + + const logs = await provider.getLogs({ + address: contractAddress, + topics: filter.topics, + fromBlock, + toBlock: toBlockNum, + }); + + const events: EventData[] = []; + for (const log of logs) { + try { + const parsed = contract.interface.parseLog({ + topics: log.topics, + data: log.data, + }); + if (parsed) { + events.push(parseEventLog(log as EventLog, parsed.name)); + } else { + events.push(parseEventLog(log)); + } + } catch { + events.push(parseEventLog(log)); + } + } + + return events; + } catch (error) { + throw new Error( + `Failed to query events: ${error instanceof Error ? error.message : String(error)}` + ); + } +} + +/** + * Sets up a real-time event listener for a contract. + */ +export function setupEventListener( + provider: JsonRpcProvider, + contractAddress: string, + eventSignature: string, + onEvent: (event: EventData) => void +): () => void { + try { + const contract = new Contract(contractAddress, [eventSignature], provider); + const eventName = eventSignature.match(/event\s+(\w+)/)?.[1] || "Unknown"; + + const filter = contract.filters[eventName](); + + const listener = async (log: Log) => { + try { + const parsed = contract.interface.parseLog({ + topics: log.topics, + data: log.data, + }); + if (parsed) { + onEvent(parseEventLog(log as EventLog, parsed.name)); + } else { + onEvent(parseEventLog(log)); + } + } catch { + onEvent(parseEventLog(log)); + } + }; + + provider.on(filter, listener); + + // Return cleanup function + return () => { + provider.off(filter, listener); + }; + } catch (error) { + throw new Error( + `Failed to setup listener: ${error instanceof Error ? error.message : String(error)}` + ); + } +} + +/** + * Gets the current block number. + */ +export async function getCurrentBlockNumber( + provider: JsonRpcProvider +): Promise { + return await provider.getBlockNumber(); +} + +/** + * Gets block timestamp. + */ +export async function getBlockTimestamp( + provider: JsonRpcProvider, + blockNumber: number +): Promise { + const block = await provider.getBlock(blockNumber); + return block?.timestamp || 0; +} + +/** + * Validates an Ethereum address. + */ +export function isValidAddress(address: string): boolean { + return /^0x[a-fA-F0-9]{40}$/.test(address); +} + +/** + * Validates an event signature format. + */ +export function isValidEventSignature(signature: string): boolean { + return /^event\s+\w+\([^)]*\)/.test(signature.trim()); +} + +/** + * Gets a sample event signature for common ERC20 events. + */ +export function getSampleEventSignatures(): Record { + return { + Transfer: "event Transfer(address indexed from, address indexed to, uint256 value)", + Approval: "event Approval(address indexed owner, address indexed spender, uint256 value)", + "PancakeSwap Pair Created": "event PairCreated(address indexed token0, address indexed token1, address pair, uint256)", + }; +} diff --git a/typescript/mini-subgraph-event-listener/clone-and-run.sh b/typescript/mini-subgraph-event-listener/clone-and-run.sh new file mode 100644 index 0000000..0723c3f --- /dev/null +++ b/typescript/mini-subgraph-event-listener/clone-and-run.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Mini Subgraph Event Listener — clone-and-run script. +# Run from repo root or from this project directory. +# Pre-seeds .env for a hassle-free evaluator run. + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +cd "$SCRIPT_DIR" + +echo "[1/5] Ensuring .env..." +if [[ ! -f .env ]]; then + if [[ -f .env.example ]]; then + cp .env.example .env + echo " Created .env from .env.example" + else + echo "VITE_BSC_RPC_URL=https://bsc-dataseed.bnbchain.org" > .env + echo " Created .env with default BSC RPC" + fi +else + echo " .env already exists" +fi + +echo "[2/5] Installing dependencies..." +npm install + +echo "[3/5] Running unit tests..." +npm test + +echo "[4/5] Building..." +npm run build + +echo "[5/5] Starting dev server..." +npm run dev diff --git a/typescript/mini-subgraph-event-listener/frontend.ts b/typescript/mini-subgraph-event-listener/frontend.ts new file mode 100644 index 0000000..db452dc --- /dev/null +++ b/typescript/mini-subgraph-event-listener/frontend.ts @@ -0,0 +1,545 @@ +/** + * Mini Subgraph Event Listener — UI. + * Dark-mode layout: left info pane, right interaction pane. + */ + +import { + createBscProvider, + queryPastEvents, + setupEventListener, + getCurrentBlockNumber, + getBlockTimestamp, + isValidAddress, + isValidEventSignature, + getSampleEventSignatures, + type EventData, +} from "./app.js"; + +const ROOT_ID = "root"; + +function injectStyles(): void { + const css = ` + :root { + --bg: #0d0f14; + --surface: #161a22; + --surface-hover: #1c212c; + --border: #2a3142; + --muted: #6b7280; + --text: #e2e8f0; + --accent: #f59e0b; + --accent-dim: #b45309; + --success: #22c55e; + --error: #ef4444; + --mono: "JetBrains Mono", ui-monospace, monospace; + --sans: "Outfit", system-ui, sans-serif; + } + * { box-sizing: border-box; margin: 0; padding: 0; } + html, body { height: 100%; } + body { + font-family: var(--sans); + background: var(--bg); + color: var(--text); + line-height: 1.5; + -webkit-font-smoothing: antialiased; + } + #${ROOT_ID} { + display: grid; + grid-template-columns: 360px 1fr; + min-height: 100vh; + } + @media (max-width: 900px) { + #${ROOT_ID} { grid-template-columns: 1fr; } + } + .info-pane { + background: var(--surface); + border-right: 1px solid var(--border); + padding: 1.5rem 1.25rem; + overflow-y: auto; + } + .info-pane h1 { + font-size: 1.1rem; + font-weight: 600; + margin-bottom: 0.5rem; + color: var(--accent); + } + .info-pane h2 { + font-size: 0.9rem; + font-weight: 500; + margin-top: 1.25rem; + margin-bottom: 0.4rem; + color: var(--text); + } + .info-pane p, .info-pane li { + font-size: 0.85rem; + color: var(--muted); + margin-bottom: 0.5rem; + } + .info-pane ul { padding-left: 1rem; margin-bottom: 0.5rem; } + .info-pane code { + font-family: var(--mono); + font-size: 0.8rem; + background: var(--bg); + padding: 0.15rem 0.35rem; + border-radius: 4px; + color: var(--accent); + } + .interaction-pane { + padding: 1.5rem 2rem; + overflow-y: auto; + } + .interaction-pane h2 { + font-size: 1rem; + font-weight: 600; + margin-bottom: 1rem; + color: var(--text); + } + .card { + background: var(--surface); + border: 1px solid var(--border); + border-radius: 10px; + padding: 1.25rem; + margin-bottom: 1rem; + } + .card h3 { + font-size: 0.9rem; + font-weight: 500; + margin-bottom: 0.75rem; + color: var(--muted); + } + .input-group { + margin-bottom: 1rem; + } + .input-group label { + display: block; + font-size: 0.85rem; + color: var(--muted); + margin-bottom: 0.4rem; + } + .input-group input, .input-group textarea, .input-group select { + width: 100%; + font-family: var(--mono); + font-size: 0.85rem; + padding: 0.6rem; + background: var(--bg); + border: 1px solid var(--border); + border-radius: 6px; + color: var(--text); + outline: none; + } + .input-group input:focus, .input-group textarea:focus, .input-group select:focus { + border-color: var(--accent); + } + .input-group textarea { + resize: vertical; + min-height: 80px; + } + .btn { + display: inline-flex; + align-items: center; + gap: 0.5rem; + font-family: var(--sans); + font-size: 0.9rem; + font-weight: 500; + padding: 0.6rem 1.1rem; + border: none; + border-radius: 8px; + cursor: pointer; + transition: background 0.15s, transform 0.1s; + } + .btn:active { transform: scale(0.98); } + .btn-primary { + background: var(--accent); + color: var(--bg); + } + .btn-primary:hover { background: var(--accent-dim); filter: brightness(1.1); } + .btn-secondary { + background: var(--surface-hover); + color: var(--text); + border: 1px solid var(--border); + } + .btn-secondary:hover { background: var(--border); } + .btn-danger { + background: var(--error); + color: white; + } + .btn-danger:hover { filter: brightness(1.1); } + .btn:disabled { opacity: 0.5; cursor: not-allowed; } + .flex { display: flex; flex-wrap: wrap; gap: 0.5rem; } + .mb-1 { margin-bottom: 1rem; } + .badge { + font-size: 0.75rem; + padding: 0.2rem 0.5rem; + border-radius: 4px; + background: var(--bg); + color: var(--muted); + } + .badge.success { color: var(--success); } + .badge.error { color: var(--error); } + .events-list { + max-height: 400px; + overflow-y: auto; + margin-top: 1rem; + } + .event-item { + background: var(--bg); + border: 1px solid var(--border); + border-radius: 6px; + padding: 0.75rem; + margin-bottom: 0.5rem; + font-family: var(--mono); + font-size: 0.75rem; + } + .event-item-header { + color: var(--accent); + margin-bottom: 0.4rem; + font-weight: 500; + } + .event-item-detail { + color: var(--muted); + margin-top: 0.3rem; + word-break: break-all; + } + .event-item-detail strong { + color: var(--text); + } + .err { + color: var(--error); + font-size: 0.85rem; + margin-top: 0.5rem; + } + .success-msg { + color: var(--success); + font-size: 0.85rem; + margin-top: 0.5rem; + } + `; + const el = document.createElement("style"); + el.textContent = css; + document.head.appendChild(el); +} + +function renderInfoPane(): string { + return ` +
+

Mini Subgraph Event Listener

+

Listen to and query blockchain events from BNB Smart Chain (BSC) smart contracts in real-time or from past blocks.

+ +

What are blockchain events?

+

Events are logs emitted by smart contracts. They're a gas-efficient way to record important state changes (transfers, approvals, etc.) that can be queried later.

+ +

How it works

+
    +
  • Query past events — Fetch events from a range of blocks.
  • +
  • Listen in real-time — Subscribe to new events as they're emitted.
  • +
  • Event parsing — Automatically decode event parameters using the ABI signature.
  • +
+ +

Event signature

+

Provide the event signature in Solidity format, e.g.:

+ event Transfer(address indexed from, address indexed to, uint256 value) + +

This demo

+

Enter a contract address and event signature, then either query past events or start listening for new ones. Common ERC20 events like Transfer work well for testing.

+ +

Example contracts

+
    +
  • BNB (Wrapped): 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c
  • +
  • BUSD: 0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56
  • +
+
+ `; +} + +function renderInteractionPane(): string { + const samples = getSampleEventSignatures(); + const sampleOptions = Object.entries(samples) + .map(([name, sig]) => ``) + .join(""); + + return ` +
+

Interact

+ +
+

Configuration

+
+ + +
+
+ + + +
+
+ Status: Ready + Current block: — +
+
+ +
+

Query Past Events

+
+ + +
+
+ + +
+
+ +
+
+
+
+ +
+

Real-time Listener

+
+ + +
+
+
+
+
+ `; +} + +function render(): void { + const root = document.getElementById(ROOT_ID); + if (!root) return; + injectStyles(); + root.innerHTML = renderInfoPane() + renderInteractionPane(); +} + +function escapeHtml(s: string): string { + return s + .replace(/&/g, "&") + .replace(//g, ">") + .replace(/"/g, """) + .replace(/'/g, "'"); +} + +function formatEventData(event: EventData): string { + const argsStr = Object.entries(event.args) + .map(([k, v]) => `${escapeHtml(k)}: ${escapeHtml(String(v))}`) + .join("
"); + + return ` +
+
${escapeHtml(event.eventName)}
+
Block: ${event.blockNumber}
+
Tx: ${event.transactionHash}
+
Address: ${event.address}
+ ${argsStr ? `
${argsStr}
` : ""} +
+ `; +} + +let state: { + provider: ReturnType | null; + cleanup: (() => void) | null; + currentBlock: number | null; +} = { + provider: null, + cleanup: null, + currentBlock: null, +}; + +function updateStatus(message: string, isError = false): void { + const badge = document.getElementById("status-badge"); + if (badge) { + badge.textContent = `Status: ${message}`; + badge.className = `badge ${isError ? "error" : "success"}`; + } +} + +function updateBlockNumber(block: number): void { + const badge = document.getElementById("block-badge"); + if (badge) badge.textContent = `Current block: ${block}`; + state.currentBlock = block; +} + +function getInput(id: string): HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | null { + return document.getElementById(id) as HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | null; +} + +function getButton(action: string): HTMLButtonElement | null { + return document.querySelector(`[data-action="${action}"]`); +} + +async function initProvider(): Promise { + if (!state.provider) { + const rpcUrl = import.meta.env.VITE_BSC_RPC_URL || undefined; + state.provider = createBscProvider(rpcUrl); + try { + const block = await getCurrentBlockNumber(state.provider); + updateBlockNumber(block); + updateStatus("Connected"); + } catch (error) { + updateStatus(`Connection failed: ${error instanceof Error ? error.message : String(error)}`, true); + } + } +} + +async function onQueryEvents(): Promise { + const btn = getButton("query"); + if (!btn) return; + btn.disabled = true; + + const statusEl = document.getElementById("query-status"); + const eventsEl = document.getElementById("query-events"); + if (statusEl) statusEl.innerHTML = ""; + if (eventsEl) eventsEl.innerHTML = ""; + + try { + await initProvider(); + if (!state.provider) throw new Error("Provider not initialized"); + + const address = getInput("contract-address")?.value.trim() || ""; + const sig = getInput("event-signature")?.value.trim() || ""; + const fromBlockStr = getInput("from-block")?.value.trim() || ""; + const toBlockStr = getInput("to-block")?.value.trim() || "latest"; + + if (!address || !isValidAddress(address)) { + if (statusEl) statusEl.innerHTML = `
Invalid contract address
`; + return; + } + + if (!sig || !isValidEventSignature(sig)) { + if (statusEl) statusEl.innerHTML = `
Invalid event signature
`; + return; + } + + const currentBlock = state.currentBlock || await getCurrentBlockNumber(state.provider); + const fromBlock = fromBlockStr ? parseInt(fromBlockStr, 10) : Math.max(0, currentBlock - 1000); + const toBlock = toBlockStr === "latest" ? "latest" : parseInt(toBlockStr, 10); + + if (statusEl) statusEl.innerHTML = `
Querying events...
`; + + const events = await queryPastEvents(state.provider, address, sig, fromBlock, toBlock); + + if (statusEl) { + statusEl.innerHTML = `
Found ${events.length} event(s)
`; + } + + if (eventsEl && events.length > 0) { + eventsEl.innerHTML = events.map(formatEventData).join(""); + } else if (eventsEl) { + eventsEl.innerHTML = `
No events found in the specified range.
`; + } + } catch (error) { + if (statusEl) { + statusEl.innerHTML = `
${escapeHtml(error instanceof Error ? error.message : String(error))}
`; + } + } finally { + btn.disabled = false; + } +} + +function onStartListening(): void { + const startBtn = getButton("start-listening"); + const stopBtn = getButton("stop-listening"); + if (!startBtn || !stopBtn) return; + + const statusEl = document.getElementById("listener-status"); + const eventsEl = document.getElementById("listener-events"); + if (statusEl) statusEl.innerHTML = ""; + if (eventsEl) eventsEl.innerHTML = ""; + + (async () => { + try { + await initProvider(); + if (!state.provider) throw new Error("Provider not initialized"); + + const address = getInput("contract-address")?.value.trim() || ""; + const sig = getInput("event-signature")?.value.trim() || ""; + + if (!address || !isValidAddress(address)) { + if (statusEl) statusEl.innerHTML = `
Invalid contract address
`; + return; + } + + if (!sig || !isValidEventSignature(sig)) { + if (statusEl) statusEl.innerHTML = `
Invalid event signature
`; + return; + } + + if (state.cleanup) { + state.cleanup(); + } + + if (statusEl) statusEl.innerHTML = `
Listening for events...
`; + + state.cleanup = setupEventListener( + state.provider, + address, + sig, + (event) => { + if (eventsEl) { + const existing = eventsEl.innerHTML; + eventsEl.innerHTML = formatEventData(event) + existing; + } + } + ); + + startBtn.disabled = true; + stopBtn.disabled = false; + updateStatus("Listening"); + } catch (error) { + if (statusEl) { + statusEl.innerHTML = `
${escapeHtml(error instanceof Error ? error.message : String(error))}
`; + } + } + })(); +} + +function onStopListening(): void { + const startBtn = getButton("start-listening"); + const stopBtn = getButton("stop-listening"); + if (!startBtn || !stopBtn) return; + + if (state.cleanup) { + state.cleanup(); + state.cleanup = null; + } + + startBtn.disabled = false; + stopBtn.disabled = true; + updateStatus("Stopped"); + + const statusEl = document.getElementById("listener-status"); + if (statusEl) { + statusEl.innerHTML = `
Listener stopped.
`; + } +} + +function bind(): void { + getButton("query")?.addEventListener("click", onQueryEvents); + getButton("start-listening")?.addEventListener("click", onStartListening); + getButton("stop-listening")?.addEventListener("click", onStopListening); + + const sigSelect = getInput("event-signature-select"); + const sigTextarea = getInput("event-signature") as HTMLTextAreaElement; + + sigSelect?.addEventListener("change", () => { + const value = (sigSelect as HTMLSelectElement).value; + if (value && sigTextarea) { + sigTextarea.value = value; + } + }); +} + +function init(): void { + render(); + bind(); + initProvider(); +} + +init(); diff --git a/typescript/mini-subgraph-event-listener/index.html b/typescript/mini-subgraph-event-listener/index.html new file mode 100644 index 0000000..1354905 --- /dev/null +++ b/typescript/mini-subgraph-event-listener/index.html @@ -0,0 +1,18 @@ + + + + + + Mini Subgraph Event Listener — BNB Cookbook + + + + + +
+ + + diff --git a/typescript/mini-subgraph-event-listener/mini-subgraph-event-listener.png b/typescript/mini-subgraph-event-listener/mini-subgraph-event-listener.png new file mode 100644 index 0000000..e162187 Binary files /dev/null and b/typescript/mini-subgraph-event-listener/mini-subgraph-event-listener.png differ diff --git a/typescript/mini-subgraph-event-listener/package-lock.json b/typescript/mini-subgraph-event-listener/package-lock.json new file mode 100644 index 0000000..d6286f4 --- /dev/null +++ b/typescript/mini-subgraph-event-listener/package-lock.json @@ -0,0 +1,2664 @@ +{ + "name": "mini-subgraph-event-listener", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "mini-subgraph-event-listener", + "version": "1.0.0", + "dependencies": { + "ethers": "^6.13.0" + }, + "devDependencies": { + "@types/node": "^22.9.0", + "typescript": "^5.6.3", + "vite": "^6.0.0", + "vitest": "^2.1.4" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@adraffy/ens-normalize": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz", + "integrity": "sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==", + "license": "MIT" + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz", + "integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz", + "integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz", + "integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz", + "integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz", + "integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz", + "integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz", + "integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz", + "integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz", + "integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz", + "integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz", + "integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz", + "integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz", + "integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz", + "integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz", + "integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz", + "integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz", + "integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz", + "integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz", + "integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz", + "integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz", + "integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz", + "integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz", + "integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz", + "integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz", + "integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz", + "integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, + "node_modules/@noble/curves": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", + "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", + "license": "MIT", + "dependencies": { + "@noble/hashes": "1.3.2" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/hashes": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", + "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", + "license": "MIT", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.56.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.56.0.tgz", + "integrity": "sha512-LNKIPA5k8PF1+jAFomGe3qN3bbIgJe/IlpDBwuVjrDKrJhVWywgnJvflMt/zkbVNLFtF1+94SljYQS6e99klnw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.56.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.56.0.tgz", + "integrity": "sha512-lfbVUbelYqXlYiU/HApNMJzT1E87UPGvzveGg2h0ktUNlOCxKlWuJ9jtfvs1sKHdwU4fzY7Pl8sAl49/XaEk6Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.56.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.56.0.tgz", + "integrity": "sha512-EgxD1ocWfhoD6xSOeEEwyE7tDvwTgZc8Bss7wCWe+uc7wO8G34HHCUH+Q6cHqJubxIAnQzAsyUsClt0yFLu06w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.56.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.56.0.tgz", + "integrity": "sha512-1vXe1vcMOssb/hOF8iv52A7feWW2xnu+c8BV4t1F//m9QVLTfNVpEdja5ia762j/UEJe2Z1jAmEqZAK42tVW3g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.56.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.56.0.tgz", + "integrity": "sha512-bof7fbIlvqsyv/DtaXSck4VYQ9lPtoWNFCB/JY4snlFuJREXfZnm+Ej6yaCHfQvofJDXLDMTVxWscVSuQvVWUQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.56.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.56.0.tgz", + "integrity": "sha512-KNa6lYHloW+7lTEkYGa37fpvPq+NKG/EHKM8+G/g9WDU7ls4sMqbVRV78J6LdNuVaeeK5WB9/9VAFbKxcbXKYg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.56.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.56.0.tgz", + "integrity": "sha512-E8jKK87uOvLrrLN28jnAAAChNq5LeCd2mGgZF+fGF5D507WlG/Noct3lP/QzQ6MrqJ5BCKNwI9ipADB6jyiq2A==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.56.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.56.0.tgz", + "integrity": "sha512-jQosa5FMYF5Z6prEpTCCmzCXz6eKr/tCBssSmQGEeozA9tkRUty/5Vx06ibaOP9RCrW1Pvb8yp3gvZhHwTDsJw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.56.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.56.0.tgz", + "integrity": "sha512-uQVoKkrC1KGEV6udrdVahASIsaF8h7iLG0U0W+Xn14ucFwi6uS539PsAr24IEF9/FoDtzMeeJXJIBo5RkbNWvQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.56.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.56.0.tgz", + "integrity": "sha512-vLZ1yJKLxhQLFKTs42RwTwa6zkGln+bnXc8ueFGMYmBTLfNu58sl5/eXyxRa2RarTkJbXl8TKPgfS6V5ijNqEA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.56.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.56.0.tgz", + "integrity": "sha512-FWfHOCub564kSE3xJQLLIC/hbKqHSVxy8vY75/YHHzWvbJL7aYJkdgwD/xGfUlL5UV2SB7otapLrcCj2xnF1dg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.56.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.56.0.tgz", + "integrity": "sha512-z1EkujxIh7nbrKL1lmIpqFTc/sr0u8Uk0zK/qIEFldbt6EDKWFk/pxFq3gYj4Bjn3aa9eEhYRlL3H8ZbPT1xvA==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.56.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.56.0.tgz", + "integrity": "sha512-iNFTluqgdoQC7AIE8Q34R3AuPrJGJirj5wMUErxj22deOcY7XwZRaqYmB6ZKFHoVGqRcRd0mqO+845jAibKCkw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.56.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.56.0.tgz", + "integrity": "sha512-MtMeFVlD2LIKjp2sE2xM2slq3Zxf9zwVuw0jemsxvh1QOpHSsSzfNOTH9uYW9i1MXFxUSMmLpeVeUzoNOKBaWg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.56.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.56.0.tgz", + "integrity": "sha512-in+v6wiHdzzVhYKXIk5U74dEZHdKN9KH0Q4ANHOTvyXPG41bajYRsy7a8TPKbYPl34hU7PP7hMVHRvv/5aCSew==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.56.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.56.0.tgz", + "integrity": "sha512-yni2raKHB8m9NQpI9fPVwN754mn6dHQSbDTwxdr9SE0ks38DTjLMMBjrwvB5+mXrX+C0npX0CVeCUcvvvD8CNQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.56.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.56.0.tgz", + "integrity": "sha512-zhLLJx9nQPu7wezbxt2ut+CI4YlXi68ndEve16tPc/iwoylWS9B3FxpLS2PkmfYgDQtosah07Mj9E0khc3Y+vQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.56.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.56.0.tgz", + "integrity": "sha512-MVC6UDp16ZSH7x4rtuJPAEoE1RwS8N4oK9DLHy3FTEdFoUTCFVzMfJl/BVJ330C+hx8FfprA5Wqx4FhZXkj2Kw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.56.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.56.0.tgz", + "integrity": "sha512-ZhGH1eA4Qv0lxaV00azCIS1ChedK0V32952Md3FtnxSqZTBTd6tgil4nZT5cU8B+SIw3PFYkvyR4FKo2oyZIHA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.56.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.56.0.tgz", + "integrity": "sha512-O16XcmyDeFI9879pEcmtWvD/2nyxR9mF7Gs44lf1vGGx8Vg2DRNx11aVXBEqOQhWb92WN4z7fW/q4+2NYzCbBA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.56.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.56.0.tgz", + "integrity": "sha512-LhN/Reh+7F3RCgQIRbgw8ZMwUwyqJM+8pXNT6IIJAqm2IdKkzpCh/V9EdgOMBKuebIrzswqy4ATlrDgiOwbRcQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.56.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.56.0.tgz", + "integrity": "sha512-kbFsOObXp3LBULg1d3JIUQMa9Kv4UitDmpS+k0tinPBz3watcUiV2/LUDMMucA6pZO3WGE27P7DsfaN54l9ing==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.56.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.56.0.tgz", + "integrity": "sha512-vSSgny54D6P4vf2izbtFm/TcWYedw7f8eBrOiGGecyHyQB9q4Kqentjaj8hToe+995nob/Wv48pDqL5a62EWtg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.56.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.56.0.tgz", + "integrity": "sha512-FeCnkPCTHQJFbiGG49KjV5YGW/8b9rrXAM2Mz2kiIoktq2qsJxRD5giEMEOD2lPdgs72upzefaUvS+nc8E3UzQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.56.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.56.0.tgz", + "integrity": "sha512-H8AE9Ur/t0+1VXujj90w0HrSOuv0Nq9r1vSZF2t5km20NTfosQsGGUXDaKdQZzwuLts7IyL1fYT4hM95TI9c4g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "22.19.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.7.tgz", + "integrity": "sha512-MciR4AKGHWl7xwxkBa6xUGxQJ4VBOmPTF7sL+iGzuahOFaO0jHCsuEfS80pan1ef4gWId1oWOweIhrDEYLuaOw==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@vitest/expect": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.9.tgz", + "integrity": "sha512-UJCIkTBenHeKT1TTlKMJWy1laZewsRIzYighyYiJKZreqtdxSos/S1t+ktRMQWu2CKqaarrkeszJx1cgC5tGZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "2.1.9", + "@vitest/utils": "2.1.9", + "chai": "^5.1.2", + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/pretty-format": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.9.tgz", + "integrity": "sha512-KhRIdGV2U9HOUzxfiHmY8IFHTdqtOhIzCpd8WRdJiE7D/HUcZVD0EgQCVjm+Q9gkUXWgBvMmTtZgIG48wq7sOQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.9.tgz", + "integrity": "sha512-ZXSSqTFIrzduD63btIfEyOmNcBmQvgOVsPNPe0jYtESiXkhd8u2erDLnMxmGrDCwHCCHE7hxwRDCT3pt0esT4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "2.1.9", + "pathe": "^1.1.2" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.9.tgz", + "integrity": "sha512-oBO82rEjsxLNJincVhLhaxxZdEtV0EFHMK5Kmx5sJ6H9L183dHECjiefOAdnqpIgT5eZwT04PoggUnW88vOBNQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "2.1.9", + "magic-string": "^0.30.12", + "pathe": "^1.1.2" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.9.tgz", + "integrity": "sha512-E1B35FwzXXTs9FHNK6bDszs7mtydNi5MIfUWpceJ8Xbfb1gBMscAnwLbEu+B44ed6W3XjL9/ehLPHR1fkf1KLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyspy": "^3.0.2" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.9.tgz", + "integrity": "sha512-v0psaMSkNJ3A2NMrUEHFRzJtDPFn+/VWZ5WxImB21T9fjucJRmS7xCS3ppEnARb9y11OAzaD+P2Ps+b+BGX5iQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "2.1.9", + "loupe": "^3.1.2", + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/aes-js": { + "version": "4.0.0-beta.5", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz", + "integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==", + "license": "MIT" + }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/chai": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.3.3.tgz", + "integrity": "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/check-error": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.3.tgz", + "integrity": "sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 16" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-eql": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/es-module-lexer": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", + "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==", + "dev": true, + "license": "MIT" + }, + "node_modules/esbuild": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz", + "integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.25.12", + "@esbuild/android-arm": "0.25.12", + "@esbuild/android-arm64": "0.25.12", + "@esbuild/android-x64": "0.25.12", + "@esbuild/darwin-arm64": "0.25.12", + "@esbuild/darwin-x64": "0.25.12", + "@esbuild/freebsd-arm64": "0.25.12", + "@esbuild/freebsd-x64": "0.25.12", + "@esbuild/linux-arm": "0.25.12", + "@esbuild/linux-arm64": "0.25.12", + "@esbuild/linux-ia32": "0.25.12", + "@esbuild/linux-loong64": "0.25.12", + "@esbuild/linux-mips64el": "0.25.12", + "@esbuild/linux-ppc64": "0.25.12", + "@esbuild/linux-riscv64": "0.25.12", + "@esbuild/linux-s390x": "0.25.12", + "@esbuild/linux-x64": "0.25.12", + "@esbuild/netbsd-arm64": "0.25.12", + "@esbuild/netbsd-x64": "0.25.12", + "@esbuild/openbsd-arm64": "0.25.12", + "@esbuild/openbsd-x64": "0.25.12", + "@esbuild/openharmony-arm64": "0.25.12", + "@esbuild/sunos-x64": "0.25.12", + "@esbuild/win32-arm64": "0.25.12", + "@esbuild/win32-ia32": "0.25.12", + "@esbuild/win32-x64": "0.25.12" + } + }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/ethers": { + "version": "6.16.0", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.16.0.tgz", + "integrity": "sha512-U1wulmetNymijEhpSEQ7Ct/P/Jw9/e7R1j5XIbPRydgV2DjLVMsULDlNksq3RQnFgKoLlZf88ijYtWEXcPa07A==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/ethers-io/" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@adraffy/ens-normalize": "1.10.1", + "@noble/curves": "1.2.0", + "@noble/hashes": "1.3.2", + "@types/node": "22.7.5", + "aes-js": "4.0.0-beta.5", + "tslib": "2.7.0", + "ws": "8.17.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/ethers/node_modules/@types/node": { + "version": "22.7.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", + "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==", + "license": "MIT", + "dependencies": { + "undici-types": "~6.19.2" + } + }, + "node_modules/ethers/node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "license": "MIT" + }, + "node_modules/expect-type": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.3.0.tgz", + "integrity": "sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/loupe": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.1.tgz", + "integrity": "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/pathe": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/pathval": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.1.tgz", + "integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.16" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.6", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", + "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.11", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/rollup": { + "version": "4.56.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.56.0.tgz", + "integrity": "sha512-9FwVqlgUHzbXtDg9RCMgodF3Ua4Na6Gau+Sdt9vyCN4RhHfVKX2DCHy3BjMLTDd47ITDhYAnTwGulWTblJSDLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.8" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.56.0", + "@rollup/rollup-android-arm64": "4.56.0", + "@rollup/rollup-darwin-arm64": "4.56.0", + "@rollup/rollup-darwin-x64": "4.56.0", + "@rollup/rollup-freebsd-arm64": "4.56.0", + "@rollup/rollup-freebsd-x64": "4.56.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.56.0", + "@rollup/rollup-linux-arm-musleabihf": "4.56.0", + "@rollup/rollup-linux-arm64-gnu": "4.56.0", + "@rollup/rollup-linux-arm64-musl": "4.56.0", + "@rollup/rollup-linux-loong64-gnu": "4.56.0", + "@rollup/rollup-linux-loong64-musl": "4.56.0", + "@rollup/rollup-linux-ppc64-gnu": "4.56.0", + "@rollup/rollup-linux-ppc64-musl": "4.56.0", + "@rollup/rollup-linux-riscv64-gnu": "4.56.0", + "@rollup/rollup-linux-riscv64-musl": "4.56.0", + "@rollup/rollup-linux-s390x-gnu": "4.56.0", + "@rollup/rollup-linux-x64-gnu": "4.56.0", + "@rollup/rollup-linux-x64-musl": "4.56.0", + "@rollup/rollup-openbsd-x64": "4.56.0", + "@rollup/rollup-openharmony-arm64": "4.56.0", + "@rollup/rollup-win32-arm64-msvc": "4.56.0", + "@rollup/rollup-win32-ia32-msvc": "4.56.0", + "@rollup/rollup-win32-x64-gnu": "4.56.0", + "@rollup/rollup-win32-x64-msvc": "4.56.0", + "fsevents": "~2.3.2" + } + }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true, + "license": "ISC" + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true, + "license": "MIT" + }, + "node_modules/std-env": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.10.0.tgz", + "integrity": "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinybench": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyexec": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", + "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyglobby": { + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinypool": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz", + "integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.0.0 || >=20.0.0" + } + }, + "node_modules/tinyrainbow": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-1.2.0.tgz", + "integrity": "sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-3.0.2.tgz", + "integrity": "sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tslib": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", + "license": "0BSD" + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/vite": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.1.tgz", + "integrity": "sha512-+Oxm7q9hDoLMyJOYfUYBuHQo+dkAloi33apOPP56pzj+vsdJDzr+j1NISE5pyaAuKL4A3UD34qd0lx5+kfKp2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.25.0", + "fdir": "^6.4.4", + "picomatch": "^4.0.2", + "postcss": "^8.5.3", + "rollup": "^4.34.9", + "tinyglobby": "^0.2.13" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", + "jiti": ">=1.21.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vite-node": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.9.tgz", + "integrity": "sha512-AM9aQ/IPrW/6ENLQg3AGY4K1N2TGZdR5e4gu/MmmR2xR3Ll1+dib+nook92g4TV3PXVyeyxdWwtaCAiUL0hMxA==", + "dev": true, + "license": "MIT", + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.3.7", + "es-module-lexer": "^1.5.4", + "pathe": "^1.1.2", + "vite": "^5.0.0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vite-node/node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, + "node_modules/vite-node/node_modules/vite": { + "version": "5.4.21", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.21.tgz", + "integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.21.3", + "postcss": "^8.4.43", + "rollup": "^4.20.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vitest": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.9.tgz", + "integrity": "sha512-MSmPM9REYqDGBI8439mA4mWhV5sKmDlBKWIYbA3lRb2PTHACE0mgKwA8yQ2xq9vxDTuk4iPrECBAEW2aoFXY0Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/expect": "2.1.9", + "@vitest/mocker": "2.1.9", + "@vitest/pretty-format": "^2.1.9", + "@vitest/runner": "2.1.9", + "@vitest/snapshot": "2.1.9", + "@vitest/spy": "2.1.9", + "@vitest/utils": "2.1.9", + "chai": "^5.1.2", + "debug": "^4.3.7", + "expect-type": "^1.1.0", + "magic-string": "^0.30.12", + "pathe": "^1.1.2", + "std-env": "^3.8.0", + "tinybench": "^2.9.0", + "tinyexec": "^0.3.1", + "tinypool": "^1.0.1", + "tinyrainbow": "^1.2.0", + "vite": "^5.0.0", + "vite-node": "2.1.9", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@types/node": "^18.0.0 || >=20.0.0", + "@vitest/browser": "2.1.9", + "@vitest/ui": "2.1.9", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, + "node_modules/vitest/node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@vitest/mocker": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.9.tgz", + "integrity": "sha512-tVL6uJgoUdi6icpxmdrn5YNo3g3Dxv+IHJBr0GXHaEdTcw3F+cPKnsXFhli6nO+f/6SDKPHEK1UN+k+TQv0Ehg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "2.1.9", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.12" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^5.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/vitest/node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, + "node_modules/vitest/node_modules/vite": { + "version": "5.4.21", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.21.tgz", + "integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.21.3", + "postcss": "^8.4.43", + "rollup": "^4.20.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/why-is-node-running": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ws": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + } + } +} diff --git a/typescript/mini-subgraph-event-listener/package.json b/typescript/mini-subgraph-event-listener/package.json new file mode 100644 index 0000000..4bbcfc0 --- /dev/null +++ b/typescript/mini-subgraph-event-listener/package.json @@ -0,0 +1,25 @@ +{ + "name": "mini-subgraph-event-listener", + "version": "1.0.0", + "description": "Mini subgraph event listener for BNB Smart Chain (BSC) — listen to and query blockchain events", + "type": "module", + "scripts": { + "dev": "vite", + "start": "vite", + "build": "vite build", + "preview": "vite preview", + "test": "vitest run" + }, + "engines": { + "node": ">=18" + }, + "dependencies": { + "ethers": "^6.13.0" + }, + "devDependencies": { + "@types/node": "^22.9.0", + "typescript": "^5.6.3", + "vite": "^6.0.0", + "vitest": "^2.1.4" + } +} diff --git a/typescript/mini-subgraph-event-listener/tsconfig.json b/typescript/mini-subgraph-event-listener/tsconfig.json new file mode 100644 index 0000000..e17e60a --- /dev/null +++ b/typescript/mini-subgraph-event-listener/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "ESNext", + "moduleResolution": "bundler", + "lib": ["ES2022", "DOM", "DOM.Iterable"], + "outDir": "dist", + "rootDir": ".", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "types": ["node"] + }, + "include": ["*.ts"], + "exclude": ["node_modules", "dist"] +} diff --git a/typescript/mini-subgraph-event-listener/vite.config.ts b/typescript/mini-subgraph-event-listener/vite.config.ts new file mode 100644 index 0000000..cbf6642 --- /dev/null +++ b/typescript/mini-subgraph-event-listener/vite.config.ts @@ -0,0 +1,14 @@ +import { defineConfig } from "vite"; + +export default defineConfig({ + root: ".", + build: { + outDir: "dist", + rollupOptions: { + input: "index.html", + }, + }, + resolve: { + alias: {}, + }, +}); diff --git a/typescript/mini-subgraph-event-listener/vitest.config.ts b/typescript/mini-subgraph-event-listener/vitest.config.ts new file mode 100644 index 0000000..3f824fb --- /dev/null +++ b/typescript/mini-subgraph-event-listener/vitest.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + globals: true, + environment: "node", + }, +});