@noves/eliza-plugin-noves
Version:
ElizaOS plugin for blockchain data using Noves Intents
73 lines (64 loc) • 2.13 kB
TypeScript
import { Action, Plugin } from '@elizaos/core';
import { z } from 'zod';
/**
* Validation schemas for inputs
*/
declare const addressSchema: z.ZodString;
declare const txHashSchema: z.ZodString;
declare const chainSchema: z.ZodEnum<["ethereum", "polygon", "base", "arbitrum", "optimism", "bsc"]>;
/**
* Supported blockchain chains
*/
type SupportedChain = z.infer<typeof chainSchema>;
/**
* Extracted blockchain data from text
*/
interface BlockchainData {
addresses: string[];
txHashes: string[];
chains: string[];
}
/**
* Token price request parameters
*/
interface TokenPriceParams {
chain: SupportedChain;
token_address: string;
timestamp?: string;
}
/**
* Action: Get Recent Transactions
* Handles queries like: "what was the activity of 0x625758C705bf970375fF780f3544C1ddc8eeb6Ab on ethereum?"
*/
declare const getRecentTxsAction: Action;
/**
* Action: Get Translated Transaction
* Handles queries like: "what happened in 0x700d06dc473f95530a0dfa04c1fe679aecd722d2a14e07170704fb7a8d2381f6 on ethereum?"
*/
declare const getTranslatedTxAction: Action;
/**
* Action: Get Token Price
* Handles queries like: "what is the price of the 0xae7ab96520de3a18e5e111b5eaab095312d7fe84 token on ethereum?"
*/
declare const getTokenPriceAction: Action;
/**
* Rate limiting utility to prevent API abuse
* 2 second intervals, max 30 requests per minute
*/
declare class RateLimiter {
private requests;
private lastRequest;
private readonly maxRequests;
private readonly windowMs;
private readonly minInterval;
waitForNextRequest(): Promise<void>;
}
declare const rateLimiter: RateLimiter;
/**
* Utility to extract addresses, tx hashes, and chains from text
*/
declare function extractBlockchainData(text: string): BlockchainData;
declare const novesPlugin: Plugin & {
repository?: string;
};
export { type BlockchainData, RateLimiter, type SupportedChain, type TokenPriceParams, addressSchema, chainSchema, novesPlugin as default, extractBlockchainData, getRecentTxsAction, getTokenPriceAction, getTranslatedTxAction, novesPlugin, rateLimiter, txHashSchema };