Update get_asset.ts

This commit is contained in:
Damjan
2025-01-18 10:06:09 +01:00
parent 925d0cf82b
commit 331482ac6a
2 changed files with 5 additions and 7 deletions

View File

@@ -3,10 +3,10 @@ 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();
@@ -14,9 +14,7 @@ export class SolanaGetAssetTool extends Tool {
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",

View File

@@ -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)