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

Reorganized Langchain, Actions, and Tools into Protocol-Specific Directories #179

Closed
wants to merge 3 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
248 changes: 129 additions & 119 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Action } from "../types/action";
import { SolanaAgentKit } from "../agent";
import { Action } from "../../types/action";
import { SolanaAgentKit } from "../../agent";
import { z } from "zod";
import { create_image } from "../tools/create_image";
import { create_image } from "../../tools/agent/create_image";

const createImageAction: Action = {
name: "CREATE_IMAGE",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { z } from "zod";
import { SolanaAgentKit } from "..";
import { get_wallet_address } from "../tools";
import { Action } from "../types/action";
import { SolanaAgentKit } from "../..";
import { get_wallet_address } from "../../tools";
import { Action } from "../../types/action";

const getWalletAddressAction: Action = {
name: "GET_WALLET_ADDRESS",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Action } from "../types/action";
import { SolanaAgentKit } from "../agent";
import { Action } from "../../types/action";
import { SolanaAgentKit } from "../../agent";
import { z } from "zod";
import { PublicKey } from "@solana/web3.js";
import { getPrimaryDomain } from "../tools";
import { getPrimaryDomain } from "../../tools";

const getPrimaryDomainAction: Action = {
name: "GET_PRIMARY_DOMAIN",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Action } from "../types/action";
import { SolanaAgentKit } from "../agent";
import { Action } from "../../types/action";
import { SolanaAgentKit } from "../../agent";
import { z } from "zod";
import { registerDomain } from "../tools";
import { registerDomain } from "../../tools";

const registerDomainAction: Action = {
name: "REGISTER_DOMAIN",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Action } from "../types/action";
import { SolanaAgentKit } from "../agent";
import { Action } from "../../types/action";
import { SolanaAgentKit } from "../../agent";
import { z } from "zod";
import { resolveSolDomain } from "../tools";
import { resolveSolDomain } from "../../tools";

const resolveSolDomainAction: Action = {
name: "RESOLVE_SOL_DOMAIN",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Action } from "../types/action";
import { SolanaAgentKit } from "../agent";
import { Action } from "../../types/action";
import { SolanaAgentKit } from "../../agent";
import { z } from "zod";
import { flashCloseTrade } from "../tools";
import { flashCloseTrade } from "../../tools";

const flashCloseTradeAction: Action = {
name: "FLASH_CLOSE_TRADE",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Action } from "../types/action";
import { SolanaAgentKit } from "../agent";
import { Action } from "../../types/action";
import { SolanaAgentKit } from "../../agent";
import { z } from "zod";
import { flashOpenTrade } from "../tools";
import { flashOpenTrade } from "../../tools";

const flashOpenTradeAction: Action = {
name: "FLASH_OPEN_TRADE",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Action } from "../types/action";
import { SolanaAgentKit } from "../agent";
import { Action } from "../../types/action";
import { SolanaAgentKit } from "../../agent";
import { z } from "zod";
import { PublicKey } from "@solana/web3.js";
import { create_gibwork_task } from "../tools";
import { create_gibwork_task } from "../../tools";

const createGibworkTaskAction: Action = {
name: "CREATE_GIBWORK_TASK",
Expand Down
64 changes: 32 additions & 32 deletions src/actions/index.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
import deployTokenAction from "./deployToken";
import balanceAction from "./balance";
import transferAction from "./transfer";
import deployCollectionAction from "./deployCollection";
import mintNFTAction from "./mintNFT";
import tradeAction from "./trade";
import requestFundsAction from "./requestFunds";
import resolveDomainAction from "./resolveDomain";
import getTokenDataAction from "./getTokenData";
import getTPSAction from "./getTPS";
import fetchPriceAction from "./fetchPrice";
import stakeWithJupAction from "./stakeWithJup";
import stakeWithSolayerAction from "./stakeWithSolayer";
import registerDomainAction from "./registerDomain";
import lendAssetAction from "./lendAsset";
import createGibworkTaskAction from "./createGibworkTask";
import resolveSolDomainAction from "./resolveSolDomain";
import pythFetchPriceAction from "./pythFetchPrice";
import getOwnedDomainsForTLDAction from "./getOwnedDomainsForTLD";
import getPrimaryDomainAction from "./getPrimaryDomain";
import getAllDomainsTLDsAction from "./getAllDomainsTLDs";
import getOwnedAllDomainsAction from "./getOwnedAllDomains";
import createImageAction from "./createImage";
import getMainAllDomainsDomainAction from "./getMainAllDomainsDomain";
import getAllRegisteredAllDomainsAction from "./getAllRegisteredAllDomains";
import raydiumCreateCpmmAction from "./raydiumCreateCpmm";
import raydiumCreateAmmV4Action from "./raydiumCreateAmmV4";
import createOrcaSingleSidedWhirlpoolAction from "./createOrcaSingleSidedWhirlpool";
import launchPumpfunTokenAction from "./launchPumpfunToken";
import getWalletAddressAction from "./getWalletAddress";
import flashOpenTradeAction from "./flashOpenTrade";
import flashCloseTradeAction from "./flashCloseTrade";
import deployTokenAction from "./metaplex/deployToken";
import balanceAction from "./solana_native/balance";
import transferAction from "./solana_native/transfer";
import deployCollectionAction from "./metaplex/deployCollection";
import mintNFTAction from "./metaplex/mintNFT";
import tradeAction from "./jupiter/trade";
import requestFundsAction from "./solana_native/requestFunds";
import resolveDomainAction from "./onsol_labs/resolveDomain";
import getTokenDataAction from "./jupiter/getTokenData";
import getTPSAction from "./solana_native/getTPS";
import fetchPriceAction from "./jupiter/fetchPrice";
import stakeWithJupAction from "./jupiter/stakeWithJup";
import stakeWithSolayerAction from "./solayer/stakeWithSolayer";
import registerDomainAction from "./bonfida/registerDomain";
import lendAssetAction from "./lulo/lendAsset";
import createGibworkTaskAction from "./gibwork/createGibworkTask";
import resolveSolDomainAction from "./bonfida/resolveSolDomain";
import pythFetchPriceAction from "./pyth/pythFetchPrice";
import getOwnedDomainsForTLDAction from "./onsol_labs/getOwnedDomainsForTLD";
import getPrimaryDomainAction from "./bonfida/getPrimaryDomain";
import getAllDomainsTLDsAction from "./onsol_labs/getAllDomainsTLDs";
import getOwnedAllDomainsAction from "./onsol_labs/getOwnedAllDomains";
import createImageAction from "./agent/createImage";
import getMainAllDomainsDomainAction from "./onsol_labs/getMainAllDomainsDomain";
import getAllRegisteredAllDomainsAction from "./onsol_labs/getAllRegisteredAllDomains";
import raydiumCreateCpmmAction from "./raydium/raydiumCreateCpmm";
import raydiumCreateAmmV4Action from "./raydium/raydiumCreateAmmV4";
import createOrcaSingleSidedWhirlpoolAction from "./orca/createOrcaSingleSidedWhirlpool";
import launchPumpfunTokenAction from "./pumpfun/launchPumpfunToken";
import getWalletAddressAction from "./agent/getWalletAddress";
import flashOpenTradeAction from "./flash/flashOpenTrade";
import flashCloseTradeAction from "./flash/flashCloseTrade";

export const ACTIONS = {
WALLET_ADDRESS_ACTION: getWalletAddressAction,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Action } from "../types/action";
import { SolanaAgentKit } from "../agent";
import { Action } from "../../types/action";
import { SolanaAgentKit } from "../../agent";
import { z } from "zod";
import { PublicKey } from "@solana/web3.js";
import { fetchPrice } from "../tools";
import { fetchPrice } from "../../tools";

const fetchPriceAction: Action = {
name: "FETCH_PRICE",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Action } from "../types/action";
import { SolanaAgentKit } from "../agent";
import { Action } from "../../types/action";
import { SolanaAgentKit } from "../../agent";
import { z } from "zod";
import { PublicKey } from "@solana/web3.js";
import { JupiterTokenData } from "../types";
import { getTokenAddressFromTicker, getTokenDataByAddress } from "../tools";
import { JupiterTokenData } from "../../types";
import { getTokenAddressFromTicker, getTokenDataByAddress } from "../../tools";

const getTokenDataAction: Action = {
name: "GET_TOKEN_DATA",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Action } from "../types/action";
import { SolanaAgentKit } from "../agent";
import { Action } from "../../types/action";
import { SolanaAgentKit } from "../../agent";
import { z } from "zod";
import { stakeWithJup } from "../tools";
import { stakeWithJup } from "../../tools";

const stakeWithJupAction: Action = {
name: "STAKE_WITH_JUPITER",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Action } from "../types/action";
import { SolanaAgentKit } from "../agent";
import { Action } from "../../types/action";
import { SolanaAgentKit } from "../../agent";
import { z } from "zod";
import { getTokenDataByTicker } from "../tools";
import { getTokenDataByTicker } from "../../tools";

const tokenDataByTickerAction: Action = {
name: "GET_TOKEN_DATA_BY_TICKER",
Expand Down
6 changes: 3 additions & 3 deletions src/actions/trade.ts → src/actions/jupiter/trade.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { PublicKey } from "@solana/web3.js";
import { Action } from "../types/action";
import { SolanaAgentKit } from "../agent";
import { Action } from "../../types/action";
import { SolanaAgentKit } from "../../agent";
import { z } from "zod";
import { trade } from "../tools";
import { trade } from "../../tools";

const tradeAction: Action = {
name: "TRADE",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Action } from "../types/action";
import { SolanaAgentKit } from "../agent";
import { Action } from "../../types/action";
import { SolanaAgentKit } from "../../agent";
import { z } from "zod";
import { sendCompressedAirdrop } from "../tools";
import { sendCompressedAirdrop } from "../../tools";

const compressedAirdropAction: Action = {
name: "COMPRESSED_AIRDROP",
Expand Down
6 changes: 3 additions & 3 deletions src/actions/lendAsset.ts → src/actions/lulo/lendAsset.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Action } from "../types/action";
import { SolanaAgentKit } from "../agent";
import { Action } from "../../types/action";
import { SolanaAgentKit } from "../../agent";
import { z } from "zod";
import { lendAsset } from "../tools";
import { lendAsset } from "../../tools";

const lendAssetAction: Action = {
name: "LEND_ASSET",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Action } from "../types/action";
import { SolanaAgentKit } from "../agent";
import { Action } from "../../types/action";
import { SolanaAgentKit } from "../../agent";
import { z } from "zod";
import { deploy_collection } from "../tools";
import { deploy_collection } from "../../tools";

interface CollectionOptions {
name: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Action } from "../types/action";
import { SolanaAgentKit } from "../agent";
import { Action } from "../../types/action";
import { SolanaAgentKit } from "../../agent";
import { z } from "zod";
import { deploy_token } from "../tools";
import { deploy_token } from "../../tools";

const deployTokenAction: Action = {
name: "DEPLOY_TOKEN",
Expand Down
6 changes: 3 additions & 3 deletions src/actions/mintNFT.ts → src/actions/metaplex/mintNFT.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { PublicKey } from "@solana/web3.js";
import { Action } from "../types/action";
import { SolanaAgentKit } from "../agent";
import { Action } from "../../types/action";
import { SolanaAgentKit } from "../../agent";
import { z } from "zod";
import { mintCollectionNFT } from "../tools";
import { mintCollectionNFT } from "../../tools";

const mintNFTAction: Action = {
name: "MINT_NFT",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Action } from "../types/action";
import { SolanaAgentKit } from "../agent";
import { Action } from "../../types/action";
import { SolanaAgentKit } from "../../agent";
import { z } from "zod";
import { getAllDomainsTLDs } from "../tools";
import { getAllDomainsTLDs } from "../../tools";

const getAllDomainsTLDsAction: Action = {
name: "GET_ALL_TLDS",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Action } from "../types/action";
import { SolanaAgentKit } from "../agent";
import { Action } from "../../types/action";
import { SolanaAgentKit } from "../../agent";
import { z } from "zod";
import { getAllRegisteredAllDomains } from "../tools";
import { getAllRegisteredAllDomains } from "../../tools";

const getAllRegisteredAllDomainsAction: Action = {
name: "GET_ALL_REGISTERED_ALL_DOMAINS",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Action } from "../types/action";
import { SolanaAgentKit } from "../agent";
import { Action } from "../../types/action";
import { SolanaAgentKit } from "../../agent";
import { z } from "zod";
import { PublicKey } from "@solana/web3.js";
import { getMainAllDomainsDomain } from "../tools";
import { getMainAllDomainsDomain } from "../../tools";

const getMainAllDomainsDomainAction: Action = {
name: "GET_MAIN_ALL_DOMAINS_DOMAIN",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Action } from "../types/action";
import { SolanaAgentKit } from "../agent";
import { Action } from "../../types/action";
import { SolanaAgentKit } from "../../agent";
import { z } from "zod";
import { PublicKey } from "@solana/web3.js";
import { getOwnedAllDomains } from "../tools";
import { getOwnedAllDomains } from "../../tools";

const getOwnedAllDomainsAction: Action = {
name: "GET_OWNED_ALL_DOMAINS",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Action } from "../types/action";
import { SolanaAgentKit } from "../agent";
import { Action } from "../../types/action";
import { SolanaAgentKit } from "../../agent";
import { z } from "zod";
import { getOwnedDomainsForTLD } from "../tools";
import { getOwnedDomainsForTLD } from "../../tools";

const getOwnedDomainsForTLDAction: Action = {
name: "GET_OWNED_DOMAINS_FOR_TLD",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Action } from "../types/action";
import { SolanaAgentKit } from "../agent";
import { Action } from "../../types/action";
import { SolanaAgentKit } from "../../agent";
import { z } from "zod";
import { resolveAllDomains } from "../tools";
import { resolveAllDomains } from "../../tools";

const resolveDomainAction: Action = {
name: "RESOLVE_ALL_DOMAINS",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Action } from "../types/action";
import { SolanaAgentKit } from "../agent";
import { Action } from "../../types/action";
import { SolanaAgentKit } from "../../agent";
import { z } from "zod";
import { PublicKey } from "@solana/web3.js";
import { Decimal } from "decimal.js";
import { orcaCreateSingleSidedLiquidityPool } from "../tools";
import { orcaCreateSingleSidedLiquidityPool } from "../../tools";

// Fee tiers mapping from the original tool
const FEE_TIERS = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Action } from "../types/action";
import { SolanaAgentKit } from "../agent";
import { Action } from "../../types/action";
import { SolanaAgentKit } from "../../agent";
import { z } from "zod";
import { launchPumpFunToken } from "../tools";
import { launchPumpFunToken } from "../../tools";

const launchPumpfunTokenAction: Action = {
name: "LAUNCH_PUMPFUN_TOKEN",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Action } from "../types/action";
import { SolanaAgentKit } from "../agent";
import { Action } from "../../types/action";
import { SolanaAgentKit } from "../../agent";
import { z } from "zod";
import { fetchPythPrice, fetchPythPriceFeedID } from "../tools";
import { fetchPythPrice, fetchPythPriceFeedID } from "../../tools";

const pythFetchPriceAction: Action = {
name: "PYTH_FETCH_PRICE",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Action } from "../types/action";
import { SolanaAgentKit } from "../agent";
import { Action } from "../../types/action";
import { SolanaAgentKit } from "../../agent";
import { z } from "zod";
import { PublicKey } from "@solana/web3.js";
import { openbookCreateMarket } from "../tools";
import { openbookCreateMarket } from "../../tools";

const createOpenbookMarketAction: Action = {
name: "CREATE_OPENBOOK_MARKET",
Expand Down
Loading
Loading