Skip to content

Commit e80c2e6

Browse files
boohyunsikboosik-riverbankwtfsayocoderabbitai[bot]
authored
feat(plugin-new): initia plugin + chore revert to integrationTests from stable releave 0.1.7 (elizaOS#2448)
* init: initia plugin * Update packages/plugin-initia/src/actions/transfer.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update agent/src/index.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update .env.example * Update README.md * Update dev.sh * testing back integrationTests from stable release 0.1.7 --------- Co-authored-by: riverbank-dev <158454692+boosik-riverbank@users.noreply.github.com> Co-authored-by: Sayo <hi@sayo.wtf> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Sayo <82053242+wtfsayo@users.noreply.github.com>
1 parent b77b995 commit e80c2e6

File tree

14 files changed

+449
-69
lines changed

14 files changed

+449
-69
lines changed

.env.example

+6
Original file line numberDiff line numberDiff line change
@@ -712,3 +712,9 @@ PYTH_TEST_ID02=0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ac
712712
# Router Nitro EVM Configuration
713713
ROUTER_NITRO_EVM_ADDRESS=
714714
ROUTER_NITRO_EVM_PRIVATE_KEY=
715+
716+
717+
# Initia Plugin Configuration
718+
INITIA_PRIVATE_KEY= # Your Initia wallet private key
719+
INITIA_NODE_URL= # Initia node URL (default: testnet)
720+
INITIA_CHAIN_ID=initia-test # Chain ID (default: testnet)
+40-41
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,44 @@
11
name: Integration Tests
22
on:
3-
push:
4-
branches: ["*"]
5-
pull_request:
6-
branches: ["*"]
3+
push:
4+
branches:
5+
- "*"
6+
pull_request_target:
7+
branches:
8+
- "*"
79

810
jobs:
9-
integration-tests:
10-
runs-on: ubuntu-latest
11-
env:
12-
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
13-
steps:
14-
- uses: actions/checkout@v4
15-
16-
- name: Setup Node.js
17-
uses: actions/setup-node@v4
18-
with:
19-
node-version: '23.3'
20-
21-
- name: Cache pnpm
22-
uses: actions/cache@v4
23-
with:
24-
path: |
25-
~/.pnpm-store
26-
**/node_modules
27-
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
28-
restore-keys: ${{ runner.os }}-pnpm-
29-
30-
- name: Setup pnpm
31-
uses: pnpm/action-setup@v3
32-
with:
33-
version: 9.15.0
34-
35-
- name: Install dependencies
36-
run: pnpm install --no-frozen-lockfile
37-
38-
- name: Build packages
39-
run: pnpm build
40-
41-
- name: Run integration tests
42-
env:
43-
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
44-
COINBASE_COMMERCE_KEY: ${{ secrets.COINBASE_COMMERCE_KEY }}
45-
run: pnpm run integrationTests
11+
integration-tests:
12+
runs-on: ubuntu-latest
13+
env:
14+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: pnpm/action-setup@v3
19+
with:
20+
version: 9.4.0
21+
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: "23"
25+
cache: "pnpm"
26+
27+
- name: Clean up
28+
run: pnpm clean
29+
30+
- name: Install dependencies
31+
run: pnpm install -r --no-frozen-lockfile
32+
33+
- name: Build packages
34+
run: pnpm build
35+
36+
- name: Check for API key
37+
run: |
38+
if [ -z "$OPENAI_API_KEY" ]; then
39+
echo "Error: OPENAI_API_KEY is not set."
40+
exit 1
41+
fi
42+
43+
- name: Run integration tests
44+
run: pnpm run integrationTests

.github/workflows/smoke-tests.yml

+21-28
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,28 @@
11
name: smoke-test
22
on:
3-
push:
4-
branches:
5-
- "*"
6-
pull_request:
7-
branches:
8-
- "*"
3+
push:
4+
branches:
5+
- "*"
6+
pull_request:
7+
branches:
8+
- "*"
99

1010
jobs:
11-
smoke-tests:
12-
runs-on: ubuntu-latest
13-
container:
14-
image: node:23-bullseye
15-
env:
16-
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
17-
steps:
18-
- uses: actions/checkout@v4
11+
smoke-tests:
12+
runs-on: ubuntu-latest
13+
env:
14+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
15+
steps:
16+
- uses: actions/checkout@v4
1917

20-
- name: Cache pnpm
21-
uses: actions/cache@v4
22-
with:
23-
path: |
24-
~/.pnpm-store
25-
**/node_modules
26-
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
27-
restore-keys: ${{ runner.os }}-pnpm-
18+
- uses: pnpm/action-setup@v3
19+
with:
20+
version: 9.4.0
2821

29-
- name: Setup pnpm
30-
uses: pnpm/action-setup@v3
31-
with:
32-
version: 9.15.0
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: "23"
25+
cache: "pnpm"
3326

34-
- name: Run smoke tests
35-
run: pnpm run smokeTests
27+
- name: Run smoke tests
28+
run: pnpm run smokeTests

agent/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"@elizaos/plugin-goat": "workspace:*",
5858
"@elizaos/plugin-lensNetwork": "workspace:*",
5959
"@elizaos/plugin-icp": "workspace:*",
60+
"@elizaos/plugin-initia": "workspace:*",
6061
"@elizaos/plugin-image-generation": "workspace:*",
6162
"@elizaos/plugin-movement": "workspace:*",
6263
"@elizaos/plugin-massa": "workspace:*",

agent/src/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ import { flowPlugin } from "@elizaos/plugin-flow";
7676
import { fuelPlugin } from "@elizaos/plugin-fuel";
7777
import { genLayerPlugin } from "@elizaos/plugin-genlayer";
7878
import { gitcoinPassportPlugin } from "@elizaos/plugin-gitcoin-passport";
79+
import { initiaPlugin } from "@elizaos/plugin-initia";
7980
import { imageGenerationPlugin } from "@elizaos/plugin-image-generation";
8081
import { lensPlugin } from "@elizaos/plugin-lensNetwork";
8182
import { multiversxPlugin } from "@elizaos/plugin-multiversx";
@@ -1097,6 +1098,7 @@ export async function createAgent(
10971098
getSecret(character, "HOLDSTATION_PRIVATE_KEY")
10981099
? holdstationPlugin
10991100
: null,
1101+
getSecret(character, "INITIA_PRIVATE_KEY") ? initiaPlugin : null,
11001102
].filter(Boolean),
11011103
providers: [],
11021104
actions: [],

packages/plugin-initia/README.md

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# @elizaos/plugin-initia
2+
3+
Initia plugin for Eliza OS.
4+
5+
## Overview
6+
7+
This plugin provides functionality to:
8+
9+
- Transfer INIT token
10+
11+
## Installation
12+
13+
```bash
14+
pnpm install @elizaos/plugin-initia
15+
```
16+
17+
## Configuration
18+
19+
```bash
20+
INITIA_PRIVATE_KEY=0x1234...abcd
21+
INITIA_NODE_URL=https://...
22+
INITIA_CHAIN_ID=initiaion-2
23+
```
24+
25+
## Features
26+
27+
28+
### Token transfer
29+
30+
Send token to recipient:
31+
```typescript
32+
User: "Send 1 INIT to init14l3c2vxrdvu6y0sqykppey930s4kufsvt97aeu";
33+
Assistant: "Sure! I am going to send 1 INIT to init14l3c2vxrdvu6y0sqykppey930s4kufsvt97aeu";
34+
```
35+
36+
## Development
37+
38+
### Building
39+
40+
```bash
41+
pnpm run build
42+
```
43+
44+
### Testing
45+
46+
```bash
47+
pnpm run test
48+
```
49+
50+
## Dependencies
51+
52+
- `@initia/initia.js`: Official initia js SDK
53+
54+
## Future Enhancements
55+
56+
1. Execute other messages like delegate, undelegate.
57+
2. Interacting with minitia.
58+
59+
60+
## License
61+
62+
This plugin is part of the Eliza project. See the main project repository for license information.

packages/plugin-initia/package.json

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "@elizaos/plugin-initia",
3+
"version": "0.1.8+build.1",
4+
"type": "module",
5+
"main": "dist/index.js",
6+
"module": "dist/index.js",
7+
"types": "dist/index.d.ts",
8+
"exports": {
9+
"./package.json": "./package.json",
10+
".": {
11+
"import": {
12+
"@elizaos/source": "./src/index.ts",
13+
"types": "./dist/index.d.ts",
14+
"default": "./dist/index.js"
15+
}
16+
}
17+
},
18+
"files": [
19+
"dist"
20+
],
21+
"scripts": {
22+
"build": "tsup --format esm --dts",
23+
"dev": "tsup --format esm --dts --watch",
24+
"test": "vitest run"
25+
},
26+
"author": "boosik",
27+
"license": "ISC",
28+
"description": "",
29+
"dependencies": {
30+
"@elizaos/core": "workspace:*",
31+
"@elizaos/plugin-trustdb": "workspace:*",
32+
"@elizaos/plugin-tee": "workspace:*",
33+
"@initia/initia.js": "^0.2.26"
34+
},
35+
"devDependencies": {
36+
"@types/node": "^22.10.1"
37+
}
38+
}

0 commit comments

Comments
 (0)