Commit Graph

537 Commits

Author SHA1 Message Date
michaelessiet
6635d0e934 fix: failing CI workflow 2025-01-15 15:45:30 +01:00
aryan
a65463a77b chore: docs + lint 2025-01-15 02:55:30 +05:30
aryan
47be1a8359 Feat: Drift integration (#207)
# Pull Request Description

This PR adds [Drift protocol](https://drift.trade) to SolanaAgentKit.
Functionality implemented includes:
1. Vault management: creation, depositing, trading, and withdrawal
2. Perpetual trading: trade opening, closing, and order creation
3. Account management: create, deposit, withdraw, lend and borrow

## Changes Made
This PR adds the following changes:
<!-- List the key changes made in this PR -->
- This PR adds drift protocol to the SDK
  
## Implementation Details
<!-- Provide technical details about the implementation -->
- This integration required the following SDKs to be installed
`@drift-labs/sdk`, `@drift-labs/vaults`.
- These SDKs were required in order to interface with the Drift programs
- These SDKs also provided utility functions and constants that made
integration a whole lot easier

## Transaction executed by agent and prompts used
<!-- If applicable, provide example usage, transactions, or screenshots
-->
Example transaction: 
<img width="771" alt="Screenshot 2025-01-14 at 21 20 42"
src="https://github.com/user-attachments/assets/da4639c6-ffd7-461e-bb36-a31435dbbb52"
/>
<img width="771" alt="Screenshot 2025-01-14 at 21 21 56"
src="https://github.com/user-attachments/assets/90652b78-9c6e-4e16-8cd0-13d276ac5747"
/>
<img width="771" alt="Screenshot 2025-01-14 at 21 23 28"
src="https://github.com/user-attachments/assets/40a63cd5-5a7f-491b-80c0-905335713bc8"
/>
<img width="771" alt="Screenshot 2025-01-14 at 21 25 40"
src="https://github.com/user-attachments/assets/ec380ded-486d-4403-88c4-207948f3dbc3"
/>
<img width="771" alt="Screenshot 2025-01-14 at 21 27 30"
src="https://github.com/user-attachments/assets/0a4d80a3-f352-497e-9030-462856b9a783"
/>

**Transaction Links**:
-
https://solscan.io/tx/4BondSu3JArkMiHYwFbaExweu3DMcBKiks4uP7oKdmj7Tb3NzdvX5foPdFhbXiSgfmG3t8MtHchkPHshN1d1i5qx
-
https://solscan.io/tx/3qEr1hPCmcmn4nmf31RJAP7ZjkWLm5ehmYfxEUvK8S1jLAUAiVwy35P7oVv5xTEoPr168oRCXZP2zcaq6K6V2bdD

-https://solscan.io/tx/22zDZ8CUn11yRWR8Guj5p7X2r5XSUyFo12FxHReAdauuzwaM9Pg3VsP5uJf8LopzAm4yYtgBMzd59m96KtZf8TPf

## Prompt Used
<!-- If relevant, include the prompt or configuration used -->
```
Create a drift account and deposit 2 usdc into my drift account
```

## Additional Notes
<!-- Any additional information that reviewers should know -->

## Checklist
- [x] I have tested these changes locally
- [x] I have updated the documentation
- [x] I have added a transaction link
- [x] I have added the prompt used to test it
2025-01-15 02:44:45 +05:30
Michael Essiet
ea96aa2d79 Merge branch 'main' into feat/drift-tool 2025-01-14 21:35:11 +01:00
michaelessiet
fd95ac8682 chore: drift integration docs 2025-01-14 21:07:24 +01:00
michaelessiet
2f05af13cb fix: drift vault deposits and withdrawals 2025-01-14 20:33:18 +01:00
michaelessiet
4d50d2f260 fix: drift vault experience 2025-01-14 15:08:18 +01:00
michaelessiet
f0d84f6924 feat: add drift functions to agent class 2025-01-14 12:43:28 +01:00
Arihant Bansal
6233203361 feat: update contributing docs (#206)
# Pull Request Description

## Related Issue
Fixes # (issue number)

## Changes Made
This PR adds the following changes:
<!-- List the key changes made in this PR -->
- 
- 
  
## Implementation Details
<!-- Provide technical details about the implementation -->
- 
- 

## Transaction executed by agent 
<!-- If applicable, provide example usage, transactions, or screenshots
-->
Example transaction: 

## Prompt Used
<!-- If relevant, include the prompt or configuration used -->
```
```

## Additional Notes
<!-- Any additional information that reviewers should know -->

## Checklist
- [ ] I have tested these changes locally
- [ ] I have updated the documentation
- [ ] I have added a transaction link
- [ ] I have added the prompt used to test it
2025-01-14 16:25:35 +05:30
Arihant Bansal
82847f5723 feat: update contributing docs 2025-01-14 16:20:56 +05:30
michaelessiet
69cfcd90d2 merge: main. Also removed eslint config from discord bot starter it was conflicting with global eslint config 2025-01-13 21:42:22 +01:00
michaelessiet
60adc8d8c5 feat + fix: add action to get user drift account info and fix deposit, borrow, lend and withdraw on drift 2025-01-13 21:17:53 +01:00
aryan
a32959f9d3 Helius sdk (#160)
# Pull Request Description

## Related Issue
Fixes #157 

## Changes Made
This PR adds the following changes:
<!-- List the key changes made in this PR -->
- Added tool to parse Transactions in human readable format
- Get all assets owned by a Public key
- Create , Get and Delete Webhooks for real time notifications
- Send a transaction with priority fee using Helius API
  
## Implementation Details
<!-- Provide technical details about the implementation -->
- Used Helius API's to implement the changes


## Transaction executed by agent 
<!-- If applicable, provide example usage, transactions, or screenshots
-->
![Screenshot 2025-01-07
160320](https://github.com/user-attachments/assets/66327de0-c069-45d4-88d4-3891bef61eca)
![Screenshot 2025-01-07
170044](https://github.com/user-attachments/assets/f90ae856-f43b-4ab6-8905-1b7ad28ac2d7)
![Screenshot 2025-01-09
012651](https://github.com/user-attachments/assets/242db155-c3b8-4bcf-953f-a7a0fe9aada7)
![Screenshot 2025-01-09
012730](https://github.com/user-attachments/assets/d98c1589-5716-4068-bee8-be01cb27b4cc)
![Screenshot 2025-01-09
021915](https://github.com/user-attachments/assets/98ffdf1b-86fb-4ff1-b62f-9eb32d1d0ecb)
![Screenshot 2025-01-10
151839](https://github.com/user-attachments/assets/bb36ca67-d6b3-4cc0-b514-282cc765c6c1)
Transaction id for priority fee 
```34iEaLyeQc71rrv5bwV49LkfxbsYqFeWS3rV7wxKM2MHiNrfj9QxkdfFjkquBdneubyp6PsNVATRSit4ATseGKtH```




## Prompt Used
<!-- If relevant, include the prompt or configuration used -->
```parse this transaction for me
5Mp5eVCdjY2i4uk7oEs3kKSqNab49cauuJANuQhiNq9tWKPRe7QmS65amhTGzYfMGfoNB64kY3Jjzrh8Fy4D8FV6```
```give me assets owned by this address BVdNLvyG2DNiWAXBE9qAmc4MTQXymd5Bzfo9xrQSUzVP limit 3```
```send 0.0001 sol to Eo2ciguhMLmcTWXELuEQPdu7DWZt67LHXb2rdHZUbot7 with
high priority```


## Additional Notes
<!-- Any additional information that reviewers should know -->

## Checklist
- [x] I have tested these changes locally
- [ ] I have updated the documentation
- [x] I have added a transaction link
- [x] I have added the prompt used to test it
2025-01-13 17:59:33 +05:30
shivaji43
20360ba523 fix: remove unncesary import 2025-01-13 17:43:32 +05:30
shivaji43
9d1623ed7e added actions for tools 2025-01-13 17:37:20 +05:30
shivaji43
40193b75e8 fix:deleted unncessary files 2025-01-13 17:37:05 +05:30
shivaji43
71bfbc6bd8 feat:added spl token support to priority fee transaction 2025-01-13 17:37:05 +05:30
shivaji43
be3f158aaa fix : able to send transaction with priority fee 2025-01-13 17:37:05 +05:30
shivaji43
53ee654202 feat:added webhooks for live notifications 2025-01-13 17:37:05 +05:30
shivaji43
e09c6b5d0b fix:added solana tool in createSolanaTools 2025-01-13 17:37:04 +05:30
shivaji43
4a270c4a0d feat: send transaction with proiority fee 2025-01-13 17:37:04 +05:30
shivaji43
2de1a7365d added helius api key to config type 2025-01-13 17:37:04 +05:30
shivaji43
79bcad3a39 fix:changed .env.example 2025-01-13 17:37:04 +05:30
shivaji43
96608fd7a9 fix: removed unnecessary logs 2025-01-13 17:37:04 +05:30
shivaji43
418f55178a feat:parsing transactions and getting all Assets 2025-01-13 17:37:04 +05:30
shivaji43
58a9edd7e2 refactored code 2025-01-13 17:37:04 +05:30
aryan
fcbb2e18c6 chore: docs + version 2025-01-13 03:33:04 +05:30
aryan
4c4cbb013e chore: update contribution docs, unify squads tools, add actions (#191)
# Pull Request Description

## Changes Made
This PR adds the following changes:
<!-- List the key changes made in this PR -->
- Update contribution docs on how to add your own tool
- Update docs
- Unify squads tools
- Add actions for squads tools
- Add other missing actions
- Cleanup code
  
## Transaction executed by agent 
<!-- If applicable, provide example usage, transactions, or screenshots
-->
Example transaction: 

## Prompt Used
<!-- If relevant, include the prompt or configuration used -->
```
```

## Additional Notes
<!-- Any additional information that reviewers should know -->

## Checklist
- [x] I have tested these changes locally
- [x] I have updated the documentation
- [ ] I have added a transaction link
- [ ] I have added the prompt used to test it
2025-01-12 22:55:23 +05:30
aryan
87db99a996 Implement Discord bot starter template (#129)
# Pull Request Description

## Changes Made
This PR introduces a starter template example project for creating a
Discord Bot built to interact with the user and perform actions using
the Solana Agent Kit.

## Implementation Details
The bot uses the latest version of discord.js and has an ability to
process DMs on Discord, perform actions using the agent kit and reply
back to the user.

[Link to demo
video](https://bafybeidjub6alzloxx2on5df6j5dhfse7txemivcbjohxzlqkxuz5ymqlm.ipfs.web3approved.com/?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjaWQiOiJiYWZ5YmVpZGp1YjZhbHpsb3h4Mm9uNWRmNmo1ZGhmc2U3dHhlbWl2Y2Jqb2h4emxxa3h1ejV5bXFsbSIsInByb2plY3RfdXVpZCI6IjRlOTEzNjIzLTI0N2ItNDAwMC1iNjUwLTgyNzI0MzBhMzk3MCIsImlhdCI6MTczNTk4Njc5Niwic3ViIjoiSVBGUy10b2tlbiJ9.vF6R99GnycpALTbPPmVJUXWvqXHYGkhfBIMaF1wVvkk)

## Checklist
- [x] I have tested these changes locally
- [x] I have updated the documentation
- [x] I have added a transaction link
- [x] I have added the prompt used to test it
2025-01-12 14:32:55 +05:30
Arihant Bansal
bb6d51471c feat: fix merge 2025-01-12 09:52:11 +05:30
michaelessiet
25f0f503cb feat: drift perp trade, account creation, withdraw, and deposit 2025-01-12 01:33:11 +01:00
aryan
8e2fe87c1c Added advanced telegram bot examples (#193)
# Pull Request Description

## Related Issue
Fixes #192 

## Changes Made
This PR adds the following changes:

Now we have the below detailed examples in the tg bot examples:

1. **Basic TG Bot**: This guide explains how to run a simple Solana
Agent Kit on a Telegram bot for a single user.

2. **Advanced TG Bot**: This guide includes advanced features such as:
    - Storing chat history for each user in a PostgreSQL database.
    - Maintaining a unique wallet for each user in a Firebase database.
    - Managing the chats of multiple users simultaneously.

3. **Group TG Bot**: This example demonstrates how to create a Telegram
bot using the Solana Agent Kit by Send AI. It includes advanced features
such as:
    - Storing chat history for each user in a PostgreSQL database.
    - Maintaining a unique wallet for each user in a Firebase database.
- This special bot can be run in Telegram groups and handle private
conversations, such as wallet addresses, in private chats. It works in
groups, maintains a separate context for each user, responds to each
user by tagging them, and can handle multiple requests simultaneously.
It will only reply if the bot is tagged in the group or its message is
replied to.

## Checklist
- [ x ] I have tested these changes locally
2025-01-12 02:56:46 +05:30
aryan
eb25c6b07b feat: move to tsx (#194)
Doing this because couple of folks (including myself) have faced issues
running `pnpm run test` on our local machines. `ts-node` has an open
issue on this, where it occasionally won't execute ESM files with the
new Typescript version (post v5.5)
https://github.com/TypeStrong/ts-node/issues/2086
2025-01-12 02:55:58 +05:30
aryan
dca508bda6 Refactored code to separate files protocol wise (#180)
Refactored code to separate files on a protocol folder basis and updated
agent code to be more maintainable..
This pull request was created for
https://app.gib.work/bounties/0b78790e-6d48-4ec3-b67f-46c96dac6b7d in an
attempt to solve a bounty #173 . Payment for the bounty is immediately
sent to the contributor after merge.
2025-01-12 02:51:32 +05:30
Arihant Bansal
338cc410ea feat: move to tsx 2025-01-12 00:16:13 +05:30
Arpit Singh Bhatia
14d4d468bb Minor changes 2025-01-11 23:50:21 +05:30
Arihant Bansal
8eb9e9be81 chore: docs 2025-01-11 23:33:36 +05:30
Arihant Bansal
ba9f6a9423 feat: add rest of squads actions 2025-01-11 23:33:14 +05:30
Arihant Bansal
ea6430129b feat: add more squads actions 2025-01-11 23:24:58 +05:30
Arihant Bansal
cd72af002e feat: add squads actions 2025-01-11 23:15:37 +05:30
Arihant Bansal
b93b961a9e fix 2025-01-11 23:04:53 +05:30
Arihant Bansal
b8d02de046 chore: fix contribution docs 2025-01-11 22:59:21 +05:30
Arihant Bansal
83a7616367 chore: combine all multisig tools in one 2025-01-11 22:44:45 +05:30
Arihant Bansal
9aa74ceab0 chore: remove unnecessary commented function 2025-01-11 22:39:52 +05:30
Arihant Bansal
80fb0c4d5f fix 2025-01-11 22:38:46 +05:30
0xCipherCoder
a6f9b05e2a Updated protocol name instead of library name 2025-01-11 21:27:54 +05:30
0xCipherCoder
af85a502e0 Removed types in solayer 2025-01-11 14:42:51 +05:30
0xCipherCoder
48c81ac7e0 Added fix for the issue 2025-01-11 14:41:55 +05:30
0xCipherCoder
f1b8a118ac Merged main 2025-01-11 10:09:56 +05:30
0xCipherCoder
04a27f974c Merged main 2025-01-11 10:09:09 +05:30