|
| 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. |
0 commit comments