Skip to content

Commit

Permalink
Update get_asset.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitrov-d committed Jan 18, 2025
1 parent 925d0cf commit 331482a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions src/langchain/metaplex/get_asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,18 @@ import { SolanaAgentKit } from "../../agent";

export class SolanaGetAssetTool extends Tool {
name = "solana_get_asset";
description = `Fetch asset details using the Metaplex DAS API.
description = `Fetch asset details for a given asset ID using the Metaplex DAS API.
Inputs (input is a JSON string):
assetId: string, eg "Asset ID" (required)`;
Inputs (input is a string):
eg "8TrvJBRa6Pzb9BDadqroHhWTHxaxK8Ws8r91oZ2jxaVV" (required)`;

constructor(private solanaKit: SolanaAgentKit) {
super();
}

protected async _call(input: string): Promise<string> {
try {
const parsedInput = JSON.parse(input);

const result = await this.solanaKit.getAsset(parsedInput.assetId);
const result = await this.solanaKit.getAsset(input);

return JSON.stringify({
status: "success",
Expand Down
2 changes: 1 addition & 1 deletion src/langchain/metaplex/get_assets_by_authority.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { SolanaAgentKit } from "../../agent";

export class SolanaGetAssetsByAuthorityTool extends Tool {
name = "solana_get_assets_by_authority";
description = `Fetch a list of assets owned by a specific address using the Metaplex DAS API.
description = `Fetch a list of assets by a specific authority address using the Metaplex DAS API.
Inputs (input is a JSON string):
authority: string, eg "mRdta4rc2RtsxEUDYuvKLamMZAdW6qHcwuq866Skxxv" (required)
Expand Down

0 comments on commit 331482a

Please sign in to comment.