Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support plugin-navi #3417

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,10 @@ PINATA_API_SECRET= # Pinata API secret
SUI_PRIVATE_KEY= # Sui Mnemonic Seed Phrase (`sui keytool generate ed25519`) , Also support `suiprivatekeyxxxx` (sui keytool export --key-identity 0x63)
SUI_NETWORK= # must be one of mainnet, testnet, devnet, localnet

# Navi Settings
NAVI_PRIVATE_KEY= # Navi private key
NAVI_NETWORK=testnet # must be one of mainnet, testnet, devnet, custom rpc url

# Mina Settings
MINA_PRIVATE_KEY= # Mina Mnemonic Seed Phrase: https://docs.minaprotocol.com/using-mina/install-a-wallet
MINA_NETWORK=devnet # must be one of mainnet, testnet, devnet, localnet
Expand Down
1 change: 1 addition & 0 deletions agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
"@elizaos/plugin-imgflip": "workspace:*",
"@elizaos/plugin-ethstorage": "workspace:*",
"@elizaos/plugin-mina": "workspace:*",
"@elizaos/plugin-navi": "workspace:*",
"@elizaos/plugin-email-automation": "workspace:*",
"@elizaos/plugin-dcap": "workspace:*",
"@elizaos/plugin-form": "workspace:*",
Expand Down
2 changes: 2 additions & 0 deletions agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ import { imgflipPlugin } from "@elizaos/plugin-imgflip";
import { ethstoragePlugin } from "@elizaos/plugin-ethstorage";
import { zerionPlugin } from "@elizaos/plugin-zerion";
import { minaPlugin } from "@elizaos/plugin-mina";
import { naviPlugin } from "@elizaos/plugin-navi";
import { ankrPlugin } from "@elizaos/plugin-ankr";
import { formPlugin } from "@elizaos/plugin-form";
import { MongoClient } from "mongodb";
Expand Down Expand Up @@ -1283,6 +1284,7 @@ export async function createAgent(
? ethstoragePlugin
: null,
getSecret(character, "MINA_PRIVATE_KEY") ? minaPlugin : null,
getSecret(character, "NAVI_PRIVATE_KEY")? naviPlugin : null,
getSecret(character, "FORM_PRIVATE_KEY") ? formPlugin : null,
getSecret(character, "ANKR_WALLET") ? ankrPlugin : null,
getSecret(character, "DCAP_EVM_PRIVATE_KEY") &&
Expand Down
2 changes: 1 addition & 1 deletion client/src/lib/info.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version": "0.1.9"}
{"version": "0.25.6-alpha.1"}
3 changes: 3 additions & 0 deletions packages/plugin-navi/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
dist/
.DS_Store
6 changes: 6 additions & 0 deletions packages/plugin-navi/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*

!dist/**
!package.json
!readme.md
!tsup.config.ts
110 changes: 110 additions & 0 deletions packages/plugin-navi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# @elizaos/plugin-navi

Core NAVI Liquidity Protocol plugin for Eliza OS that provides essential services and actions for token operations and wallet management.

## Overview

This plugin provides functionality to:

- Check Wallet Balance
- Supply Token to NAVI
- Borrow Token from NAVI
- Repay Debt to NAVI
- Withdraw Token from NAVI

## Installation

```bash
npm install @elizaos/plugin-navi
```

## Configuration

The plugin requires the following environment variables:

```env
NAVI_PRIVATE_KEY=your_private_key
NAVI_NETWORK=mainnet|devnet
```

## Usage

Import and register the plugin in your Eliza configuration:

```typescript
import { naviPlugin } from "@elizaos/plugin-navi";

export default {
plugins: [naviPlugin],
// ... other configuration
};
```

## Features

### Check Wallet Balance

Query wallet balance and portfolio value:

```typescript
// Example conversation
User: "What's my wallet balance?";
Assistant: "Your wallet contains 10.5 SUI ($42.00 USD)...";
```

## API Reference

### Actions

- `GET_BALANCE`: Check Wallet Balance

### Providers

- `walletProvider`: Manages wallet interactions with the NAVI Liquidity Protocol, including balance queries and portfolio tracking

## Development

### Building

```bash
npm run build
```

### Testing

```bash
npm run test
```

## Dependencies

- `navi-sdk`: NAVI SDK Project for Sui Defi Ecosystem
- `node-cache`: Caching implementation
- Other standard dependencies listed in package.json

## Contributing

Contributions are welcome! Please see the [CONTRIBUTING.md](CONTRIBUTING.md) file for more information.

## Credits

This plugin integrates with and builds upon several key technologies:

- [NAVI Blockchain](https://naviprotocol.com/): NAVI is the first Native One-Stop Liquidity Protocol on Sui. It enables users to participate as liquidity providers or borrowers within the Sui Ecosystem.
- [node-cache](https://www.npmjs.com/package/node-cache): Caching implementation

Special thanks to:

- The NAVI team for developing NAVI Liquidity Protocol
- The NAVI Developer community
- The Eliza community for their contributions and feedback

For more information about NAVI blockchain capabilities:

- [NAVI Liquidity Protocol](https://naviprotocol.io/)
- [NAVI Dashboard](https://app.naviprotocol.io/)
- [NAVI GitHub Repository](https://github.com/naviprotocol)

## License

This plugin is part of the Eliza project. See the main project repository for license information.
42 changes: 42 additions & 0 deletions packages/plugin-navi/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "@elizaos/plugin-navi",
"version": "0.25.6-alpha.1",
"type": "module",
"main": "dist/index.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"import": {
"@elizaos/source": "./src/index.ts",
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
},
"files": [
"dist"
],
"dependencies": {
"@elizaos/core": "workspace:*",
"@mysten/sui": "^1.16.0",
"bignumber.js": "9.1.2",
"navi-sdk": "^1.4.27",
"node-cache": "5.1.2",
"tsup": "8.3.5",
"vitest": "3.0.5",
"zod": "^3.24.1"
},
"scripts": {
"build": "tsup --format esm --dts",
"test": "vitest run"
},
"peerDependencies": {
"form-data": "4.0.1",
"whatwg-url": "7.1.0"
},
"publishConfig": {
"access": "public"
}
}
Loading
Loading