Skip to content

Commit 0497c71

Browse files
feat(new-plugin): Eliza OmniFlix Plugin (elizaOS#2693)
* added OmniFlix-Plugin * added characters in gitignore * added variable of OmniFlix in env example * Update .env.example --------- Co-authored-by: vinay-maggidi <vinay@layerzerox.com>
1 parent ec07774 commit 0497c71

38 files changed

+3688
-0
lines changed

.env.example

+7
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,13 @@ EMAIL_INCOMING_PORT=993 # Default port for secure IMAP
797797
EMAIL_INCOMING_USER=
798798
EMAIL_INCOMING_PASS=
799799

800+
801+
# Omniflix
802+
OMNIFLIX_API_URL= # https://rest.omniflix.network
803+
OMNIFLIX_MNEMONIC= # your mnemonic 12 words or 24 words
804+
OMNIFLIX_RPC_ENDPOINT= # https://rpc.omniflix.network
805+
OMNIFLIX_PRIVATE_KEY= # your private key
806+
800807
# Suno AI Music Generation
801808
SUNO_API_KEY=
802809

agent/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@
119119
"@elizaos/plugin-chainbase": "workspace:*",
120120
"@elizaos/plugin-dkg": "workspace:*",
121121
"@elizaos/plugin-email": "workspace:*",
122+
"@elizaos/plugin-omniflix": "workspace:*",
122123
"@elizaos/plugin-suno": "workspace:*",
123124
"@elizaos/plugin-udio": "workspace:*",
124125
"readline": "1.3.0",

agent/src/index.ts

+5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { SlackClientInterface } from "@elizaos/client-slack";
1212
import { TelegramClientInterface } from "@elizaos/client-telegram";
1313
import { TwitterClientInterface } from "@elizaos/client-twitter";
1414
import { FarcasterClientInterface } from "@elizaos/client-farcaster";
15+
import { OmniflixPlugin } from "@elizaos/plugin-omniflix";
1516
import { JeeterClientInterface } from "@elizaos/client-simsai";
1617

1718
import { DirectClient } from "@elizaos/client-direct";
@@ -1033,6 +1034,10 @@ export async function createAgent(
10331034
getSecret(character, "SGX"))
10341035
? teeLogPlugin
10351036
: null,
1037+
getSecret(character, "OMNIFLIX_API_URL") &&
1038+
getSecret(character, "OMNIFLIX_MNEMONIC")
1039+
? OmniflixPlugin
1040+
: null,
10361041
getSecret(character, "COINBASE_API_KEY") &&
10371042
getSecret(character, "COINBASE_PRIVATE_KEY") &&
10381043
getSecret(character, "COINBASE_NOTIFICATION_URI")

characters/omniflix.character.json

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"name": "Omniflix",
3+
"clients": ["telegram"],
4+
"modelProvider": "akash_chat_api",
5+
"settings": {
6+
"secrets": {},
7+
"voice": {
8+
"model": "en_US-male-medium"
9+
}
10+
},
11+
"plugins": ["@elizaos/plugin-omniflix"],
12+
"bio": [
13+
"I am an Omniflix assistant designed to interact directly with your connected wallet for blockchain operations.",
14+
"I perform actions such as sending tokens, voting on proposals, and managing staking directly using your wallet once connected.",
15+
"I request only the necessary details to execute actions and do not require the wallet address separately."
16+
],
17+
"lore": [],
18+
"knowledge": [
19+
"I can execute token transfers, staking, unstaking, and governance actions directly with the connected wallet.",
20+
"I ensure all actions are verified and secure before execution.",
21+
"I support creating new denominations (denoms) directly through your wallet."
22+
],
23+
"messageExamples": [],
24+
"postExamples": [],
25+
"topics": [
26+
"Direct wallet operations",
27+
"Token management",
28+
"Secure transaction execution"
29+
],
30+
"style": {
31+
"all": [
32+
"Direct",
33+
"Precise",
34+
"Factual",
35+
"Data-driven"
36+
],
37+
"chat": [
38+
"Clear",
39+
"Verification-focused",
40+
"Data-driven"
41+
],
42+
"post": []
43+
},
44+
"adjectives": [
45+
"Accurate",
46+
"Methodical",
47+
"Wallet-integrated"
48+
]
49+
}

packages/plugin-omniflix/.npmignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*
2+
3+
!dist/**
4+
!package.json
5+
!readme.md
6+
!tsup.config.ts

packages/plugin-omniflix/README

+223
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
# @elizaos/plugin-omniflix
2+
3+
A plugin for ElizaOS that enables interaction with the OmniFlix Network blockchain.
4+
5+
## Table of Contents
6+
7+
- [Installation](#installation)
8+
- [Configuration](#configuration)
9+
- [Features](#features)
10+
- [Integration](#integration)
11+
- [Technical Details](#technical-details)
12+
13+
## Installation
14+
15+
```bash
16+
npm install @elizaos/plugin-omniflix
17+
```
18+
19+
## Configuration
20+
21+
### Environment Variables
22+
23+
```env
24+
# Required: RPC endpoint for OmniFlix Network
25+
OMNIFLIX_RPC_ENDPOINT="https://rpc.omniflix.network:443"
26+
27+
# Required: API endpoint for OmniFlix Network
28+
OMNIFLIX_API_URL="https://rest.omniflix.network"
29+
30+
# Required: Either mnemonic or private key (one is required)
31+
OMNIFLIX_MNEMONIC="your mnemonic"
32+
# OR
33+
OMNIFLIX_PRIVATE_KEY="your hex private key"
34+
```
35+
36+
### Network Configuration
37+
38+
You can configure different networks by updating the endpoints:
39+
40+
#### Mainnet (Default)
41+
42+
```env
43+
OMNIFLIX_RPC_ENDPOINT="https://rpc.omniflix.network"
44+
OMNIFLIX_API_URL="https://rest.omniflix.network"
45+
```
46+
47+
#### Testnet
48+
49+
```env
50+
OMNIFLIX_RPC_ENDPOINT="https://rpc.testnet.omniflix.network"
51+
OMNIFLIX_API_URL="https://api.testnet.omniflix.network"
52+
```
53+
54+
Note: Make sure to use the appropriate network endpoints based on your requirements. The mainnet endpoints should be used for production environments, while testnet are suitable for testing.
55+
56+
## Features
57+
58+
### 1. Bank Operations
59+
60+
#### Check Balance
61+
62+
```
63+
Commands:
64+
- What is my balance?
65+
- How many FLIX do I have?
66+
- Check my wallet balance
67+
```
68+
69+
#### Send Tokens
70+
71+
```
72+
Commands:
73+
- Send 100 FLIX to omniflix1abc123...
74+
- Transfer 50 FLIX to omniflix1xyz789...
75+
```
76+
77+
#### Check Staked Balance
78+
79+
```
80+
Commands:
81+
- What is my staked balance?
82+
- Show my delegated FLIX
83+
- Check my staking balance
84+
```
85+
86+
### 2. Staking Operations
87+
88+
#### Delegate Tokens
89+
90+
```
91+
Commands:
92+
- Delegate 100 FLIX to omniflixvaloper1abc123...
93+
- Stake 50 FLIX with validator omniflixvaloper1xyz789...
94+
```
95+
96+
#### Undelegate Tokens
97+
98+
```
99+
Commands:
100+
- Undelegate 100 FLIX from omniflixvaloper1abc123...
101+
- Unstake 50 FLIX from validator omniflixvaloper1xyz789...
102+
```
103+
104+
#### Redelegate Tokens
105+
106+
```
107+
Commands:
108+
- Redelegate 100 FLIX from omniflixvaloper1abc123... to omniflixvaloper1def456...
109+
- Move 50 FLIX stake from validator1 to validator2
110+
```
111+
112+
#### Cancel Unbonding
113+
114+
```
115+
Commands:
116+
- Cancel unbonding of 100 FLIX from omniflixvaloper1abc123... at creation height 123456
117+
- Stop unbonding 50 FLIX from validator omniflixvaloper1xyz789... at creation height 789012
118+
- Cancel unbonding delegation with:
119+
- Amount: 100 FLIX
120+
- Validator: omniflixvaloper1abc123...
121+
- Creation Height: 123456
122+
```
123+
124+
Note: Creation height is required for canceling unbonding operations. You can find the creation height:
125+
126+
- In the unbonding delegation response
127+
- Through the chain explorer
128+
- From the original unbonding transaction
129+
130+
### 3. Governance Operations
131+
132+
#### Vote on Proposals
133+
134+
```
135+
Commands:
136+
- Vote yes on proposal 1
137+
- Vote no on proposal 2
138+
- Vote abstain on proposal 3
139+
- Vote no_with_veto on proposal 4
140+
141+
142+
Valid Options:
143+
- yes
144+
- no
145+
- abstain
146+
- no_with_veto
147+
148+
Note: proposal Id and vote option is required for voting on proposals or it will take unspecified vote option. You can find the proposal ID:
149+
150+
- In the proposal response
151+
- Through the chain explorer
152+
- From the original proposal transaction
153+
```
154+
155+
## Integration
156+
157+
### Basic Setup
158+
159+
1. Import the plugin:
160+
161+
```typescript
162+
import { OmniflixPlugin } from "@elizaos/plugin-omniflix";
163+
```
164+
165+
2. Register with ElizaOS:
166+
167+
```typescript
168+
import { Eliza } from "@elizaos/core";
169+
170+
const eliza = new Eliza();
171+
eliza.registerPlugin(OmniflixPlugin);
172+
```
173+
174+
### Example Usage
175+
176+
```typescript
177+
import { voteOnProposal } from "@elizaos/plugin-omniflix";
178+
179+
// Vote on a proposal
180+
const voteOnProposal = await voteOnProposal(
181+
{
182+
proposalId: "1",
183+
vote: "YES",
184+
},
185+
{
186+
apiEndpoint: "https://rest.omniflix.network",
187+
rpcEndpoint: "https://rpc.omniflix.network:443",
188+
}
189+
);
190+
```
191+
192+
## Technical Details
193+
194+
### Token Denominations
195+
196+
- Display denomination: FLIX
197+
- Base denomination: uflix (auto-converted by plugin)
198+
199+
### Address Formats
200+
201+
- Wallet addresses: Start with `omniflix`
202+
- Validator addresses: Start with `omniflixvaloper`
203+
204+
### Staking Parameters
205+
206+
- Unbonding period: 28 days
207+
- Redelegation: Has cooldown period
208+
- Delegation: Minimum amount may apply
209+
- Unbonding cancellation requires:
210+
- Validator address
211+
- Amount
212+
- Creation height (block height when unbonding started)
213+
- Must be within unbonding period
214+
215+
### Governance Rules
216+
217+
- Voting eligibility: Proposals must be in voting period
218+
- Voting frequency: One vote per address per proposal
219+
- Voting power: Proportional to staked amount
220+
221+
## License
222+
223+
This plugin is part of the ElizaOS project. See LICENSE file for details.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import eslintGlobalConfig from "../../eslint.config.mjs";
2+
3+
export default [...eslintGlobalConfig];

packages/plugin-omniflix/package.json

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "@elizaos/plugin-omniflix",
3+
"version": "0.1.7-alpha.2",
4+
"main": "dist/index.js",
5+
"type": "module",
6+
"types": "dist/index.d.ts",
7+
"dependencies": {
8+
"@coral-xyz/anchor": "0.30.1",
9+
"@cosmjs/proto-signing": "^0.32.4",
10+
"@cosmjs/stargate": "^0.32.4",
11+
"@cosmjs/encoding": "^0.32.4",
12+
"@elizaos/core": "workspace:*",
13+
"@elizaos/plugin-tee": "workspace:*",
14+
"@elizaos/plugin-trustdb": "workspace:*",
15+
"bs58": "6.0.0",
16+
"bech32": "2.0.0",
17+
"cosmjs-types": "^0.8.0",
18+
"node-cache": "5.1.2",
19+
"tsup": "8.3.5",
20+
"vitest": "2.1.4"
21+
},
22+
"scripts": {
23+
"build": "tsup --format esm --dts",
24+
"dev": "tsup --format esm --dts --watch",
25+
"lint": "eslint --fix --cache .",
26+
"test": "vitest run"
27+
},
28+
"peerDependencies": {
29+
"form-data": "4.0.1",
30+
"whatwg-url": "7.1.0"
31+
}
32+
}

0 commit comments

Comments
 (0)