0.1.0 • Published 7 months ago

@iqai/plugin-wallet v0.1.0

Weekly downloads
-
License
-
Repository
-
Last release
7 months ago

šŸŽ› Plugin Wallet

A plugin for interacting with blockchain wallets to fetch holdings and transaction history across multiple chains.


šŸ“Œ Overview

The Plugin Wallet provides an interface to interact with blockchain wallets. It enables users to:

āœ… View token holdings and balances across chains
āœ… Check transaction history on supported blockchains
āœ… Support multiple chains including Ethereum, Polygon, Fraxtal, and more

All data is fetched using the Covalent API.


šŸ›  Installation

Install the plugin using pnpm:

pnpm add @iqai/plugin-wallet

āš™ Configuration

Set up your environment with the required API configuration:

šŸ”§ Variable NamešŸ“œ Description
COVALENT_API_KEYYour Covalent API key for blockchain data access
WALLET_ADDRESSDefault wallet address to use when none is provided

šŸš€ Usage

Import and initialize the plugin:

import { createWalletPlugin } from "@iqai/plugin-wallet";

// Initialize the plugin
const plugin = await createWalletPlugin({
  covalentApiKey: process.env.COVALENT_API_KEY,
  defaultAddress: process.env.WALLET_ADDRESS,
});

šŸŽÆ Actions

WALLET_GET_HOLDINGS

Fetch token holdings for a specific wallet on a blockchain.

šŸ’¬ Examples:

  • "get my holdings on fraxtal"
  • "show my tokens on eth-mainnet"
  • "get holdings of 0x1234...5678 on polygon"
  • "check holdings on base-mainnet"

WALLET_GET_TRANSACTIONS

Retrieve transaction history for a wallet on a blockchain.

šŸ’¬ Examples:

  • "get my transactions on fraxtal"
  • "show my recent transactions on ethereum"
  • "view transaction history of 0x1234...5678 on polygon"
  • "get my last 5 txns on fraxtal"

šŸ“œ Response Format

Actions return structured responses including:

āœ” Token balances with USD values
āœ” Transaction details with timestamps and status
āœ” Gas information
āœ” Other relevant metadata


āŒ Error Handling

The plugin handles various error scenarios:

  • Invalid chain names
  • API connection errors
  • Request validation errors
  • Rate limiting issues

🌐 Supported Chains

The plugin supports all chains available in the Covalent API, including:

  • Ethereum (eth-mainnet)
  • Polygon (matic-mainnet)
  • Binance Smart Chain (bsc-mainnet)
  • Fraxtal (fraxtal-mainnet)
  • Avalanche (avalanche-mainnet)
  • Arbitrum (arbitrum-mainnet)
  • Optimism (optimism-mainnet)
  • Base (base-mainnet)
  • And many more

Covalent API integration enables complete blockchain data access across multiple networks from a single source.

0.1.0

7 months ago

0.0.2

8 months ago