Skip to content

Commit 42b64f2

Browse files
authored
Fix/actions (#106)
# 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
2 parents 18b7190 + ff26c25 commit 42b64f2

38 files changed

+122
-68
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "solana-agent-kit",
3-
"version": "1.3.3",
3+
"version": "1.3.4",
44
"description": "connect any ai agents to solana protocols",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/actions/balance.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { z } from "zod";
55
import { get_balance } from "../tools";
66

77
const balanceAction: Action = {
8-
name: "solana_balance",
8+
name: "BALANCE_ACTION",
99
similes: [
1010
"check balance",
1111
"get wallet balance",

src/actions/compressedAirdrop.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { z } from "zod";
44
import { sendCompressedAirdrop } from "../tools";
55

66
const compressedAirdropAction: Action = {
7-
name: "solana_compressed_airdrop",
7+
name: "COMPRESSED_AIRDROP",
88
similes: [
99
"ZK Compressed airdrop",
1010
"Airdrop tokens with compression",

src/actions/createGibworkTask.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { PublicKey } from "@solana/web3.js";
55
import { create_gibwork_task } from "../tools";
66

77
const createGibworkTaskAction: Action = {
8-
name: "solana_create_gibwork_task",
8+
name: "CREATE_GIBWORK_TASK",
99
similes: [
1010
"create task",
1111
"post job",

src/actions/createImage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { z } from "zod";
44
import { create_image } from "../tools/create_image";
55

66
const createImageAction: Action = {
7-
name: "solana_create_image",
7+
name: "CREATE_IMAGE",
88
similes: [
99
"generate image",
1010
"create artwork",

src/actions/createOpenbookMarket.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { PublicKey } from "@solana/web3.js";
55
import { openbookCreateMarket } from "../tools";
66

77
const createOpenbookMarketAction: Action = {
8-
name: "solana_create_openbook_market",
8+
name: "CREATE_OPENBOOK_MARKET",
99
similes: [
1010
"create openbook market",
1111
"setup trading market",

src/actions/createOrcaSingleSidedWhirlpool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const FEE_TIERS = {
2020
} as const;
2121

2222
const createOrcaSingleSidedWhirlpoolAction: Action = {
23-
name: "solana_create_orca_single_sided_whirlpool",
23+
name: "CREATE_ORCA_SINGLE_SIDED_WHIRLPOOL",
2424
similes: [
2525
"create orca whirlpool",
2626
"setup orca single sided pool",

src/actions/deployCollection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ interface CollectionOptions {
1010
}
1111

1212
const deployCollectionAction: Action = {
13-
name: "solana_deploy_collection",
13+
name: "DEPLOY_COLLECTION",
1414
similes: [
1515
"create collection",
1616
"launch collection",

src/actions/deployToken.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { z } from "zod";
44
import { deploy_token } from "../tools";
55

66
const deployTokenAction: Action = {
7-
name: "deploy_token",
7+
name: "DEPLOY_TOKEN",
88
similes: [
99
"create token",
1010
"launch token",

src/actions/fetchPrice.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { PublicKey } from "@solana/web3.js";
55
import { fetchPrice } from "../tools";
66

77
const fetchPriceAction: Action = {
8-
name: "solana_fetch_price",
8+
name: "FETCH_PRICE",
99
similes: [
1010
"get token price",
1111
"check price",

src/actions/getAllDomainsTLDs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { z } from "zod";
44
import { getAllDomainsTLDs } from "../tools";
55

66
const getAllDomainsTLDsAction: Action = {
7-
name: "solana_get_all_tlds",
7+
name: "GET_ALL_TLDS",
88
similes: [
99
"list domain tlds",
1010
"get domain extensions",

src/actions/getAllRegisteredAllDomains.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { z } from "zod";
44
import { getAllRegisteredAllDomains } from "../tools";
55

66
const getAllRegisteredAllDomainsAction: Action = {
7-
name: "solana_get_all_registered_all_domains",
7+
name: "GET_ALL_REGISTERED_ALL_DOMAINS",
88
similes: [
99
"list registered domains",
1010
"get all domains",

src/actions/getMainAllDomainsDomain.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { PublicKey } from "@solana/web3.js";
55
import { getMainAllDomainsDomain } from "../tools";
66

77
const getMainAllDomainsDomainAction: Action = {
8-
name: "solana_get_main_domain",
8+
name: "GET_MAIN_ALL_DOMAINS_DOMAIN",
99
similes: [
1010
"get main domain",
1111
"fetch primary domain",

src/actions/getOwnedAllDomains.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { PublicKey } from "@solana/web3.js";
55
import { getOwnedAllDomains } from "../tools";
66

77
const getOwnedAllDomainsAction: Action = {
8-
name: "solana_get_owned_all_domains",
8+
name: "GET_OWNED_ALL_DOMAINS",
99
similes: [
1010
"list owned domains",
1111
"get my domains",

src/actions/getOwnedDomainsForTLD.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { z } from "zod";
44
import { getOwnedDomainsForTLD } from "../tools";
55

66
const getOwnedDomainsForTLDAction: Action = {
7-
name: "solana_get_owned_tld_domains",
7+
name: "GET_OWNED_DOMAINS_FOR_TLD",
88
similes: [
99
"list owned domains for tld",
1010
"get my domains for extension",

src/actions/getPrimaryDomain.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { PublicKey } from "@solana/web3.js";
55
import { getPrimaryDomain } from "../tools";
66

77
const getPrimaryDomainAction: Action = {
8-
name: "solana_get_domain",
8+
name: "GET_PRIMARY_DOMAIN",
99
similes: [
1010
"get primary domain",
1111
"lookup primary domain",

src/actions/getTPS.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { z } from "zod";
44
import { getTPS } from "../tools";
55

66
const getTPSAction: Action = {
7-
name: "solana_get_tps",
7+
name: "GET_TPS",
88
similes: [
99
"get transactions per second",
1010
"check network speed",

src/actions/getTokenData.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { JupiterTokenData } from "../types";
66
import { getTokenAddressFromTicker, getTokenDataByAddress } from "../tools";
77

88
const getTokenDataAction: Action = {
9-
name: "solana_token_data",
9+
name: "GET_TOKEN_DATA",
1010
similes: [
1111
"get token info",
1212
"token details",

src/actions/index.ts

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -27,35 +27,35 @@ import raydiumCreateAmmV4Action from "./raydiumCreateAmmV4";
2727
import createOrcaSingleSidedWhirlpoolAction from "./createOrcaSingleSidedWhirlpool";
2828
import launchPumpfunTokenAction from "./launchPumpfunToken";
2929

30-
export const actions = [
31-
deployTokenAction,
32-
balanceAction,
33-
transferAction,
34-
deployCollectionAction,
35-
mintNFTAction,
36-
tradeAction,
37-
requestFundsAction,
38-
resolveDomainAction,
39-
getTokenDataAction,
40-
getTPSAction,
41-
fetchPriceAction,
42-
stakeWithJupAction,
43-
registerDomainAction,
44-
lendAssetAction,
45-
createGibworkTaskAction,
46-
resolveSolDomainAction,
47-
pythFetchPriceAction,
48-
getOwnedDomainsForTLDAction,
49-
getPrimaryDomainAction,
50-
getAllDomainsTLDsAction,
51-
getOwnedAllDomainsAction,
52-
createImageAction,
53-
getMainAllDomainsDomainAction,
54-
getAllRegisteredAllDomainsAction,
55-
raydiumCreateCpmmAction,
56-
raydiumCreateAmmV4Action,
57-
createOrcaSingleSidedWhirlpoolAction,
58-
launchPumpfunTokenAction,
59-
];
30+
export const ACTIONS = {
31+
"DEPLOY_TOKEN_ACTION" : deployTokenAction,
32+
"BALANCE_ACTION" : balanceAction,
33+
"TRANSFER_ACTION" : transferAction,
34+
"DEPLOY_COLLECTION_ACTION" : deployCollectionAction,
35+
"MINT_NFT_ACTION" : mintNFTAction,
36+
"TRADE_ACTION" : tradeAction,
37+
"REQUEST_FUNDS_ACTION" : requestFundsAction,
38+
"RESOLVE_DOMAIN_ACTION" : resolveDomainAction,
39+
"GET_TOKEN_DATA_ACTION" : getTokenDataAction,
40+
"GET_TPS_ACTION" : getTPSAction,
41+
"FETCH_PRICE_ACTION" : fetchPriceAction,
42+
"STAKE_WITH_JUP_ACTION" : stakeWithJupAction,
43+
"REGISTER_DOMAIN_ACTION" : registerDomainAction,
44+
"LEND_ASSET_ACTION" : lendAssetAction,
45+
"CREATE_GIBWORK_TASK_ACTION" : createGibworkTaskAction,
46+
"RESOLVE_SOL_DOMAIN_ACTION" : resolveSolDomainAction,
47+
"PYTH_FETCH_PRICE_ACTION" : pythFetchPriceAction,
48+
"GET_OWNED_DOMAINS_FOR_TLD_ACTION" : getOwnedDomainsForTLDAction,
49+
"GET_PRIMARY_DOMAIN_ACTION" : getPrimaryDomainAction,
50+
"GET_ALL_DOMAINS_TLDS_ACTION" : getAllDomainsTLDsAction,
51+
"GET_OWNED_ALL_DOMAINS_ACTION" : getOwnedAllDomainsAction,
52+
"CREATE_IMAGE_ACTION" : createImageAction,
53+
"GET_MAIN_ALL_DOMAINS_DOMAIN_ACTION" : getMainAllDomainsDomainAction,
54+
"GET_ALL_REGISTERED_ALL_DOMAINS_ACTION" : getAllRegisteredAllDomainsAction,
55+
"RAYDIUM_CREATE_CPMM_ACTION" : raydiumCreateCpmmAction,
56+
"RAYDIUM_CREATE_AMM_V4_ACTION" : raydiumCreateAmmV4Action,
57+
"CREATE_ORCA_SINGLE_SIDED_WHIRLPOOL_ACTION" : createOrcaSingleSidedWhirlpoolAction,
58+
"LAUNCH_PUMPFUN_TOKEN_ACTION" : launchPumpfunTokenAction,
59+
};
6060

6161
export type { Action, ActionExample, Handler } from "../types/action";

src/actions/launchPumpfunToken.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { z } from "zod";
44
import { launchPumpFunToken } from "../tools";
55

66
const launchPumpfunTokenAction: Action = {
7-
name: "solana_launch_pumpfun_token",
7+
name: "LAUNCH_PUMPFUN_TOKEN",
88
similes: [
99
"create pumpfun token",
1010
"launch token on pumpfun",

src/actions/lendAsset.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { z } from "zod";
44
import { lendAsset } from "../tools";
55

66
const lendAssetAction: Action = {
7-
name: "solana_lend_asset",
7+
name: "LEND_ASSET",
88
similes: [
99
"lend usdc",
1010
"deposit for yield",

src/actions/mintNFT.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { z } from "zod";
55
import { mintCollectionNFT } from "../tools";
66

77
const mintNFTAction: Action = {
8-
name: "solana_mint_nft",
8+
name: "MINT_NFT",
99
similes: [
1010
"mint nft",
1111
"create nft",

src/actions/pythFetchPrice.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { z } from "zod";
44
import { pythFetchPrice } from "../tools";
55

66
const pythFetchPriceAction: Action = {
7-
name: "solana_pyth_fetch_price",
7+
name: "PYTH_FETCH_PRICE",
88
similes: [
99
"get pyth price",
1010
"check pyth price",

src/actions/raydiumCreateAmmV4.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import BN from "bn.js";
66
import { raydiumCreateAmmV4 } from "../tools";
77

88
const raydiumCreateAmmV4Action: Action = {
9-
name: "raydium_create_ammV4",
9+
name: "RAYDIUM_CREATE_AMM_V4",
1010
similes: [
1111
"create raydium v4 pool",
1212
"setup raydium v4 liquidity pool",

src/actions/raydiumCreateClmm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Decimal from "decimal.js";
77
import { raydiumCreateClmm } from "../tools";
88

99
const raydiumCreateClmmAction: Action = {
10-
name: "raydium_create_clmm",
10+
name: "RAYDIUM_CREATE_CLMM",
1111
similes: [
1212
"create clmm pool",
1313
"create concentrated liquidity pool",

src/actions/raydiumCreateCpmm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import BN from "bn.js";
66
import { raydiumCreateCpmm } from "../tools";
77

88
const raydiumCreateCpmmAction: Action = {
9-
name: "solana_raydium_create_cpmm",
9+
name: "RAYDIUM_CREATE_CPMM",
1010
similes: [
1111
"create raydium pool",
1212
"setup raydium liquidity pool",

src/actions/registerDomain.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { z } from "zod";
44
import { registerDomain } from "../tools";
55

66
const registerDomainAction: Action = {
7-
name: "solana_register_domain",
7+
name: "REGISTER_DOMAIN",
88
similes: [
99
"register domain",
1010
"buy domain",

src/actions/requestFunds.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { z } from "zod";
44
import { request_faucet_funds } from "../tools";
55

66
const requestFundsAction: Action = {
7-
name: "solana_request_funds",
7+
name: "REQUEST_FUNDS",
88
similes: [
99
"request sol",
1010
"get test sol",

src/actions/resolveDomain.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { z } from "zod";
44
import { resolveAllDomains } from "../tools";
55

66
const resolveDomainAction: Action = {
7-
name: "solana_resolve_all_domains",
7+
name: "RESOLVE_ALL_DOMAINS",
88
similes: [
99
"resolve domain",
1010
"lookup domain",

src/actions/resolveSolDomain.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { z } from "zod";
44
import { resolveSolDomain } from "../tools";
55

66
const resolveSolDomainAction: Action = {
7-
name: "solana_resolve_sol_domain",
7+
name: "RESOLVE_SOL_DOMAIN",
88
similes: [
99
"resolve sol domain",
1010
"lookup sol domain",

src/actions/stakeWithJup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { z } from "zod";
44
import { stakeWithJup } from "../tools";
55

66
const stakeWithJupAction: Action = {
7-
name: "solana_stake_with_jup",
7+
name: "STAKE_WITH_JUPITER",
88
similes: [
99
"stake sol",
1010
"stake with jupiter",

src/actions/tokenDataByTicker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { z } from "zod";
44
import { getTokenDataByTicker } from "../tools";
55

66
const tokenDataByTickerAction: Action = {
7-
name: "solana_token_data_by_ticker",
7+
name: "GET_TOKEN_DATA_BY_TICKER",
88
similes: [
99
"token data by ticker",
1010
"fetch token info by ticker",

src/actions/trade.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { z } from "zod";
55
import { trade } from "../tools";
66

77
const tradeAction: Action = {
8-
name: "solana_trade",
8+
name: "TRADE",
99
similes: [
1010
"swap tokens",
1111
"exchange tokens",

src/actions/transfer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { z } from "zod";
55
import { transfer } from "../tools";
66

77
const transferAction: Action = {
8-
name: "solana_transfer",
8+
name: "TRANSFER",
99
similes: [
1010
"send tokens",
1111
"transfer funds",

src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ export { SolanaAgentKit, createSolanaTools };
77
export * from "./types";
88

99
// Export action system
10-
export * from "./actions";
11-
export * from "./types/action";
10+
export { ACTIONS } from "./actions";
1211
export * from "./utils/actionExecutor";

0 commit comments

Comments
 (0)