feat: langchain integration

This commit is contained in:
fm2055
2024-12-16 23:00:31 +08:00
parent 8927ac4130
commit ff8cb4b842
5 changed files with 103 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
import { getPrimaryDomain } from "@bonfida/spl-name-service";
import { getPrimaryDomain as _getPrimaryDomain } from "@bonfida/spl-name-service";
import { PublicKey } from "@solana/web3.js";
import { SolanaAgentKit } from "../index";
@@ -14,12 +14,12 @@ import { SolanaAgentKit } from "../index";
* @returns A promise that resolves to the primary .sol domain as a string
* @throws Error if the domain is stale or if the domain resolution fails
*/
export async function get_primary_domain(
export async function getPrimaryDomain(
agent: SolanaAgentKit,
account: PublicKey
): Promise<string> {
try {
const { reverse, stale } = await getPrimaryDomain(
const { reverse, stale } = await _getPrimaryDomain(
agent.connection,
account
);

View File

@@ -6,6 +6,8 @@ export * from "./mint_nft";
export * from "./transfer";
export * from "./trade";
export * from "./register_domain";
export * from "./resolve_sol_domain";
export * from "./get_primary_domain";
export * from "./launch_pumpfun_token";
export * from "./lend";
export * from "./get_tps";

View File

@@ -14,7 +14,7 @@ import { SolanaAgentKit } from "../index";
* @returns A promise that resolves to the corresponding Solana PublicKey
* @throws Error if the domain resolution fails
*/
export async function resolve_sol_domain(
export async function resolveSolDomain(
agent: SolanaAgentKit,
domain: string
): Promise<PublicKey> {