Skip to content

Commit

Permalink
Fix/actions (#106)
Browse files Browse the repository at this point in the history
# Pull Request Description

## Changes Made
This PR adds the following changes:
- Fixes the naming for each action 
  
## Checklist
- [ Y] I have tested these changes locally
- [ Y] I have updated the documentation
  • Loading branch information
thearyanag authored Dec 31, 2024
2 parents 18b7190 + ff26c25 commit 42b64f2
Show file tree
Hide file tree
Showing 38 changed files with 122 additions and 68 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "solana-agent-kit",
"version": "1.3.3",
"version": "1.3.4",
"description": "connect any ai agents to solana protocols",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/balance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { z } from "zod";
import { get_balance } from "../tools";

const balanceAction: Action = {
name: "solana_balance",
name: "BALANCE_ACTION",
similes: [
"check balance",
"get wallet balance",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/compressedAirdrop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { z } from "zod";
import { sendCompressedAirdrop } from "../tools";

const compressedAirdropAction: Action = {
name: "solana_compressed_airdrop",
name: "COMPRESSED_AIRDROP",
similes: [
"ZK Compressed airdrop",
"Airdrop tokens with compression",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/createGibworkTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { PublicKey } from "@solana/web3.js";
import { create_gibwork_task } from "../tools";

const createGibworkTaskAction: Action = {
name: "solana_create_gibwork_task",
name: "CREATE_GIBWORK_TASK",
similes: [
"create task",
"post job",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/createImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { z } from "zod";
import { create_image } from "../tools/create_image";

const createImageAction: Action = {
name: "solana_create_image",
name: "CREATE_IMAGE",
similes: [
"generate image",
"create artwork",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/createOpenbookMarket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { PublicKey } from "@solana/web3.js";
import { openbookCreateMarket } from "../tools";

const createOpenbookMarketAction: Action = {
name: "solana_create_openbook_market",
name: "CREATE_OPENBOOK_MARKET",
similes: [
"create openbook market",
"setup trading market",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/createOrcaSingleSidedWhirlpool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const FEE_TIERS = {
} as const;

const createOrcaSingleSidedWhirlpoolAction: Action = {
name: "solana_create_orca_single_sided_whirlpool",
name: "CREATE_ORCA_SINGLE_SIDED_WHIRLPOOL",
similes: [
"create orca whirlpool",
"setup orca single sided pool",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/deployCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface CollectionOptions {
}

const deployCollectionAction: Action = {
name: "solana_deploy_collection",
name: "DEPLOY_COLLECTION",
similes: [
"create collection",
"launch collection",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/deployToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { z } from "zod";
import { deploy_token } from "../tools";

const deployTokenAction: Action = {
name: "deploy_token",
name: "DEPLOY_TOKEN",
similes: [
"create token",
"launch token",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/fetchPrice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { PublicKey } from "@solana/web3.js";
import { fetchPrice } from "../tools";

const fetchPriceAction: Action = {
name: "solana_fetch_price",
name: "FETCH_PRICE",
similes: [
"get token price",
"check price",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/getAllDomainsTLDs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { z } from "zod";
import { getAllDomainsTLDs } from "../tools";

const getAllDomainsTLDsAction: Action = {
name: "solana_get_all_tlds",
name: "GET_ALL_TLDS",
similes: [
"list domain tlds",
"get domain extensions",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/getAllRegisteredAllDomains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { z } from "zod";
import { getAllRegisteredAllDomains } from "../tools";

const getAllRegisteredAllDomainsAction: Action = {
name: "solana_get_all_registered_all_domains",
name: "GET_ALL_REGISTERED_ALL_DOMAINS",
similes: [
"list registered domains",
"get all domains",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/getMainAllDomainsDomain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { PublicKey } from "@solana/web3.js";
import { getMainAllDomainsDomain } from "../tools";

const getMainAllDomainsDomainAction: Action = {
name: "solana_get_main_domain",
name: "GET_MAIN_ALL_DOMAINS_DOMAIN",
similes: [
"get main domain",
"fetch primary domain",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/getOwnedAllDomains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { PublicKey } from "@solana/web3.js";
import { getOwnedAllDomains } from "../tools";

const getOwnedAllDomainsAction: Action = {
name: "solana_get_owned_all_domains",
name: "GET_OWNED_ALL_DOMAINS",
similes: [
"list owned domains",
"get my domains",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/getOwnedDomainsForTLD.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { z } from "zod";
import { getOwnedDomainsForTLD } from "../tools";

const getOwnedDomainsForTLDAction: Action = {
name: "solana_get_owned_tld_domains",
name: "GET_OWNED_DOMAINS_FOR_TLD",
similes: [
"list owned domains for tld",
"get my domains for extension",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/getPrimaryDomain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { PublicKey } from "@solana/web3.js";
import { getPrimaryDomain } from "../tools";

const getPrimaryDomainAction: Action = {
name: "solana_get_domain",
name: "GET_PRIMARY_DOMAIN",
similes: [
"get primary domain",
"lookup primary domain",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/getTPS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { z } from "zod";
import { getTPS } from "../tools";

const getTPSAction: Action = {
name: "solana_get_tps",
name: "GET_TPS",
similes: [
"get transactions per second",
"check network speed",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/getTokenData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { JupiterTokenData } from "../types";
import { getTokenAddressFromTicker, getTokenDataByAddress } from "../tools";

const getTokenDataAction: Action = {
name: "solana_token_data",
name: "GET_TOKEN_DATA",
similes: [
"get token info",
"token details",
Expand Down
60 changes: 30 additions & 30 deletions src/actions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,35 @@ import raydiumCreateAmmV4Action from "./raydiumCreateAmmV4";
import createOrcaSingleSidedWhirlpoolAction from "./createOrcaSingleSidedWhirlpool";
import launchPumpfunTokenAction from "./launchPumpfunToken";

export const actions = [
deployTokenAction,
balanceAction,
transferAction,
deployCollectionAction,
mintNFTAction,
tradeAction,
requestFundsAction,
resolveDomainAction,
getTokenDataAction,
getTPSAction,
fetchPriceAction,
stakeWithJupAction,
registerDomainAction,
lendAssetAction,
createGibworkTaskAction,
resolveSolDomainAction,
pythFetchPriceAction,
getOwnedDomainsForTLDAction,
getPrimaryDomainAction,
getAllDomainsTLDsAction,
getOwnedAllDomainsAction,
createImageAction,
getMainAllDomainsDomainAction,
getAllRegisteredAllDomainsAction,
raydiumCreateCpmmAction,
raydiumCreateAmmV4Action,
createOrcaSingleSidedWhirlpoolAction,
launchPumpfunTokenAction,
];
export const ACTIONS = {
"DEPLOY_TOKEN_ACTION" : deployTokenAction,
"BALANCE_ACTION" : balanceAction,
"TRANSFER_ACTION" : transferAction,
"DEPLOY_COLLECTION_ACTION" : deployCollectionAction,
"MINT_NFT_ACTION" : mintNFTAction,
"TRADE_ACTION" : tradeAction,
"REQUEST_FUNDS_ACTION" : requestFundsAction,
"RESOLVE_DOMAIN_ACTION" : resolveDomainAction,
"GET_TOKEN_DATA_ACTION" : getTokenDataAction,
"GET_TPS_ACTION" : getTPSAction,
"FETCH_PRICE_ACTION" : fetchPriceAction,
"STAKE_WITH_JUP_ACTION" : stakeWithJupAction,
"REGISTER_DOMAIN_ACTION" : registerDomainAction,
"LEND_ASSET_ACTION" : lendAssetAction,
"CREATE_GIBWORK_TASK_ACTION" : createGibworkTaskAction,
"RESOLVE_SOL_DOMAIN_ACTION" : resolveSolDomainAction,
"PYTH_FETCH_PRICE_ACTION" : pythFetchPriceAction,
"GET_OWNED_DOMAINS_FOR_TLD_ACTION" : getOwnedDomainsForTLDAction,
"GET_PRIMARY_DOMAIN_ACTION" : getPrimaryDomainAction,
"GET_ALL_DOMAINS_TLDS_ACTION" : getAllDomainsTLDsAction,
"GET_OWNED_ALL_DOMAINS_ACTION" : getOwnedAllDomainsAction,
"CREATE_IMAGE_ACTION" : createImageAction,
"GET_MAIN_ALL_DOMAINS_DOMAIN_ACTION" : getMainAllDomainsDomainAction,
"GET_ALL_REGISTERED_ALL_DOMAINS_ACTION" : getAllRegisteredAllDomainsAction,
"RAYDIUM_CREATE_CPMM_ACTION" : raydiumCreateCpmmAction,
"RAYDIUM_CREATE_AMM_V4_ACTION" : raydiumCreateAmmV4Action,
"CREATE_ORCA_SINGLE_SIDED_WHIRLPOOL_ACTION" : createOrcaSingleSidedWhirlpoolAction,
"LAUNCH_PUMPFUN_TOKEN_ACTION" : launchPumpfunTokenAction,
};

export type { Action, ActionExample, Handler } from "../types/action";
2 changes: 1 addition & 1 deletion src/actions/launchPumpfunToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { z } from "zod";
import { launchPumpFunToken } from "../tools";

const launchPumpfunTokenAction: Action = {
name: "solana_launch_pumpfun_token",
name: "LAUNCH_PUMPFUN_TOKEN",
similes: [
"create pumpfun token",
"launch token on pumpfun",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/lendAsset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { z } from "zod";
import { lendAsset } from "../tools";

const lendAssetAction: Action = {
name: "solana_lend_asset",
name: "LEND_ASSET",
similes: [
"lend usdc",
"deposit for yield",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/mintNFT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { z } from "zod";
import { mintCollectionNFT } from "../tools";

const mintNFTAction: Action = {
name: "solana_mint_nft",
name: "MINT_NFT",
similes: [
"mint nft",
"create nft",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/pythFetchPrice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { z } from "zod";
import { pythFetchPrice } from "../tools";

const pythFetchPriceAction: Action = {
name: "solana_pyth_fetch_price",
name: "PYTH_FETCH_PRICE",
similes: [
"get pyth price",
"check pyth price",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/raydiumCreateAmmV4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import BN from "bn.js";
import { raydiumCreateAmmV4 } from "../tools";

const raydiumCreateAmmV4Action: Action = {
name: "raydium_create_ammV4",
name: "RAYDIUM_CREATE_AMM_V4",
similes: [
"create raydium v4 pool",
"setup raydium v4 liquidity pool",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/raydiumCreateClmm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Decimal from "decimal.js";
import { raydiumCreateClmm } from "../tools";

const raydiumCreateClmmAction: Action = {
name: "raydium_create_clmm",
name: "RAYDIUM_CREATE_CLMM",
similes: [
"create clmm pool",
"create concentrated liquidity pool",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/raydiumCreateCpmm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import BN from "bn.js";
import { raydiumCreateCpmm } from "../tools";

const raydiumCreateCpmmAction: Action = {
name: "solana_raydium_create_cpmm",
name: "RAYDIUM_CREATE_CPMM",
similes: [
"create raydium pool",
"setup raydium liquidity pool",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/registerDomain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { z } from "zod";
import { registerDomain } from "../tools";

const registerDomainAction: Action = {
name: "solana_register_domain",
name: "REGISTER_DOMAIN",
similes: [
"register domain",
"buy domain",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/requestFunds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { z } from "zod";
import { request_faucet_funds } from "../tools";

const requestFundsAction: Action = {
name: "solana_request_funds",
name: "REQUEST_FUNDS",
similes: [
"request sol",
"get test sol",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/resolveDomain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { z } from "zod";
import { resolveAllDomains } from "../tools";

const resolveDomainAction: Action = {
name: "solana_resolve_all_domains",
name: "RESOLVE_ALL_DOMAINS",
similes: [
"resolve domain",
"lookup domain",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/resolveSolDomain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { z } from "zod";
import { resolveSolDomain } from "../tools";

const resolveSolDomainAction: Action = {
name: "solana_resolve_sol_domain",
name: "RESOLVE_SOL_DOMAIN",
similes: [
"resolve sol domain",
"lookup sol domain",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/stakeWithJup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { z } from "zod";
import { stakeWithJup } from "../tools";

const stakeWithJupAction: Action = {
name: "solana_stake_with_jup",
name: "STAKE_WITH_JUPITER",
similes: [
"stake sol",
"stake with jupiter",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/tokenDataByTicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { z } from "zod";
import { getTokenDataByTicker } from "../tools";

const tokenDataByTickerAction: Action = {
name: "solana_token_data_by_ticker",
name: "GET_TOKEN_DATA_BY_TICKER",
similes: [
"token data by ticker",
"fetch token info by ticker",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/trade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { z } from "zod";
import { trade } from "../tools";

const tradeAction: Action = {
name: "solana_trade",
name: "TRADE",
similes: [
"swap tokens",
"exchange tokens",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { z } from "zod";
import { transfer } from "../tools";

const transferAction: Action = {
name: "solana_transfer",
name: "TRANSFER",
similes: [
"send tokens",
"transfer funds",
Expand Down
3 changes: 1 addition & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ export { SolanaAgentKit, createSolanaTools };
export * from "./types";

// Export action system
export * from "./actions";
export * from "./types/action";
export { ACTIONS } from "./actions";
export * from "./utils/actionExecutor";
Loading

0 comments on commit 42b64f2

Please sign in to comment.