@axonfi/plugin-elizaos 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,57 @@
1
+ # @axonfi/plugin-elizaos
2
+
3
+ ElizaOS plugin for [Axon](https://axonfi.xyz) — treasury and payment infrastructure for AI agents.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @axonfi/plugin-elizaos @axonfi/sdk
9
+ ```
10
+
11
+ ## Configuration
12
+
13
+ Add these environment variables (or character settings):
14
+
15
+ | Variable | Required | Description |
16
+ |----------|----------|-------------|
17
+ | `AXON_BOT_PRIVATE_KEY` | Yes | Bot's private key (EIP-712 signer) |
18
+ | `AXON_VAULT_ADDRESS` | Yes | Axon vault contract address |
19
+ | `AXON_CHAIN_ID` | Yes | Chain ID (8453=Base, 42161=Arbitrum, 84532=Base Sepolia) |
20
+ | `AXON_RELAYER_URL` | No | Relayer URL (defaults to `https://relay.axonfi.xyz`) |
21
+
22
+ ## Usage
23
+
24
+ ```typescript
25
+ import { axonPlugin } from "@axonfi/plugin-elizaos";
26
+
27
+ const agent = new AgentRuntime({
28
+ // ...
29
+ plugins: [axonPlugin],
30
+ });
31
+ ```
32
+
33
+ ## Actions
34
+
35
+ | Action | Description | Example |
36
+ |--------|-------------|---------|
37
+ | `AXON_SEND_PAYMENT` | Send token payments | "Send 50 USDC to 0xabc..." |
38
+ | `AXON_SWAP_TOKENS` | In-vault token swaps | "Swap 100 USDC to WETH" |
39
+ | `AXON_EXECUTE_PROTOCOL` | DeFi protocol calls | Requires structured input |
40
+ | `AXON_CHECK_BALANCE` | Check vault balance | "What's my balance?" |
41
+
42
+ ## Provider
43
+
44
+ **AXON_VAULT_CONTEXT** — Automatically injects vault balance and status into the agent's context on every message (cached 30s).
45
+
46
+ ## How It Works
47
+
48
+ The plugin is a thin adapter between ElizaOS and `@axonfi/sdk`. Your bot signs EIP-712 intents — the Axon relayer validates, simulates, and submits transactions on-chain. The bot never needs ETH for gas.
49
+
50
+ ```
51
+ Agent receives message → Action extracts params → SDK signs EIP-712 intent
52
+ → Relayer validates + executes → txHash returned to conversation
53
+ ```
54
+
55
+ ## License
56
+
57
+ MIT
@@ -0,0 +1,24 @@
1
+ import { Service, IAgentRuntime, Action, Provider, Plugin } from '@elizaos/core';
2
+ import { AxonClient } from '@axonfi/sdk';
3
+
4
+ declare class AxonService extends Service {
5
+ static serviceType: string;
6
+ capabilityDescription: string;
7
+ client: AxonClient;
8
+ static start(runtime: IAgentRuntime): Promise<AxonService>;
9
+ stop(): Promise<void>;
10
+ }
11
+
12
+ declare const sendPaymentAction: Action;
13
+
14
+ declare const swapTokensAction: Action;
15
+
16
+ declare const executeProtocolAction: Action;
17
+
18
+ declare const checkBalanceAction: Action;
19
+
20
+ declare const vaultContextProvider: Provider;
21
+
22
+ declare const axonPlugin: Plugin;
23
+
24
+ export { AxonService, axonPlugin, checkBalanceAction, axonPlugin as default, executeProtocolAction, sendPaymentAction, swapTokensAction, vaultContextProvider };