-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
47 additions
and
47 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[package] | ||
name = "listen-core" | ||
name = "listen-kit" | ||
version = "0.2.0" | ||
edition = "2021" | ||
license = "MIT" | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# listen-kit | ||
|
||
Blazingly fast actions for AI Agents | ||
|
||
## Quick Start | ||
|
||
```rust | ||
use listen_kit::{actions::Actions, util::env, constants::WSOL}; | ||
use solana_sdk::native_token::sol_to_lamports; | ||
|
||
#[tokio::main] | ||
async fn main() { | ||
dotenv::dotenv().ok(); | ||
let actions = Actions::new(env("PRIVATE_KEY"), env("RPC_URL")); | ||
|
||
let balance = actions.get_balance().await.unwrap(); | ||
println!("Balance: {}", balance); | ||
|
||
let mint = "9BB6NFEcjBCtnNLFko2FqVQBq8HHM13kCyYcdQbgpump".to_string(); | ||
let price = actions.fetch_token_price(mint.clone()).await.unwrap(); | ||
println!("Price: {}", price); | ||
|
||
// Trade 0.01 SOL for $Fartcoin | ||
let slippage_bps = 100; | ||
let tx_id = actions.trade( | ||
WSOL.to_string(), | ||
sol_to_lamports(0.01), | ||
mint, | ||
slippage_bps | ||
).await.unwrap(); | ||
println!("Signature: {}", tx_id); | ||
} | ||
``` |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
pub mod actions; | ||
pub mod agent; | ||
pub mod balance; | ||
pub mod constants; | ||
pub mod deploy_token; | ||
pub mod jito; | ||
pub mod jup; | ||
pub mod price; | ||
pub mod pump; | ||
pub mod trade; | ||
pub mod transfer; | ||
pub mod util; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.