A CLI agent for intent-driven token swaps on the NEAR blockchain using Intents powered by 1click api, built with @iqai/adk
. This project enables safe, automated, and user-friendly NEAR token swaps using natural language prompts.
- Intent-based NEAR token swaps via CLI
- Automated account import and token discovery
- Handles NEAR and NEP-141 tokens with correct decimal scaling
- Built-in session management and safety checks
- Extensible with new tools and services
-
Clone the repository:
git clone https://github.com/IQAICOM/near-intents-agent.git cd near-intents-agent
-
Install dependencies:
pnpm install
-
Set up environment variables:
cp example.env .env # Edit .env and provide your GOOGLE_API_KEY and (optionally) NEAR credentials
GOOGLE_API_KEY
is required for some agent features (get it here).USER_ACCOUNT_ID
andUSER_ACCOUNT_KEY
are needed for NEAR account operations.NEAR_NODE_URL
defaults to public mainnet if not set.
-
Run the agent:
pnpm dev
Variable | Required | Description |
---|---|---|
GOOGLE_API_KEY |
Yes | Google API key for agent features |
USER_ACCOUNT_ID |
Optional | NEAR account ID for swaps (required for account operations) |
USER_ACCOUNT_KEY |
Optional | NEAR private key (format: ed25519:...) |
NEAR_NODE_URL |
Optional | NEAR RPC endpoint (defaults to public mainnet) |
DEBUG |
Optional | Set to "true" for debug output |
PATH |
Yes | System PATH (inherited automatically in most environments) |
- Start the CLI and follow prompts to perform NEAR swaps
- The agent will import your NEAR account (if credentials are provided) and fetch available tokens.
- All token amounts must be input using the correct decimals (see CLI instructions for details).
- Type
quit
orexit
to end the session.
- Build:
pnpm build
- Start (prod):
pnpm start
- Dev mode:
pnpm dev
- Lint:
pnpm lint
- Format:
pnpm format
- Fork the repository
- Create a feature branch (
git checkout -b feature/your-feature
) - Commit your changes
- Push and open a Pull Request
MIT License – see LICENSE for details.