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

Refactor Langchain file #175

Closed
wants to merge 5 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
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,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 { 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,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
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
6 changes: 3 additions & 3 deletions src/actions/lendAsset.ts → src/actions/Jupiter/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 { 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 { create_image } from "../tools/create_image";
import { create_image } from "../../tools/Metaplex/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 { 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,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
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,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,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 BN from "bn.js";
import { raydiumCreateAmmV4 } from "../tools";
import { raydiumCreateAmmV4 } from "../../tools";

const raydiumCreateAmmV4Action: Action = {
name: "RAYDIUM_CREATE_AMM_V4",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
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 { BN } from "@coral-xyz/anchor";
import Decimal from "decimal.js";
import { raydiumCreateClmm } from "../tools";
import { raydiumCreateClmm } from "../../tools";

const raydiumCreateClmmAction: Action = {
name: "RAYDIUM_CREATE_CLMM",
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 BN from "bn.js";
import { raydiumCreateCpmm } from "../tools";
import { raydiumCreateCpmm } from "../../tools";

const raydiumCreateCpmmAction: Action = {
name: "RAYDIUM_CREATE_CPMM",
Expand Down
6 changes: 3 additions & 3 deletions src/actions/balance.ts → src/actions/Solana/balance.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 { get_balance } from "../tools";
import { get_balance } from "../../tools";

const balanceAction: Action = {
name: "BALANCE_ACTION",
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 { closeEmptyTokenAccounts } from "../tools";
import { closeEmptyTokenAccounts } from "../../tools";

const closeEmptyTokenAccountsAction: Action = {
name: "CLOSE_EMPTY_TOKEN_ACCOUNTS",
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/getTPS.ts → src/actions/Solana/getTPS.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 { getTPS } from "../tools";
import { getTPS } from "../../tools";

const getTPSAction: Action = {
name: "GET_TPS",
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
Loading