@hashgraphonline/hedera-agent-kit
Version:
Build LLM-powered applications that interact with the Hedera Network. Create conversational agents that can understand user requests in natural language and execute Hedera transactions, or build backend systems that leverage AI for on-chain operations.
42 lines (41 loc) • 1.57 kB
JavaScript
import { z } from "zod";
import { BaseHederaQueryTool } from "./index20.js";
const GetOutstandingAirdropsZodSchema = z.object({
accountId: z.string().describe('The account ID that sent the airdrops (e.g., "0.0.123")'),
limit: z.number().optional().describe("Maximum number of airdrops to return"),
order: z.enum(["asc", "desc"]).optional().describe("Order of results"),
receiverId: z.string().optional().describe("Filter by receiver account ID"),
serialNumber: z.string().optional().describe("Filter by NFT serial number"),
tokenId: z.string().optional().describe("Filter by token ID")
});
class HederaGetOutstandingAirdropsTool extends BaseHederaQueryTool {
constructor(params) {
super(params);
this.name = "hedera-get-outstanding-airdrops";
this.description = "Retrieves outstanding token airdrops that have been sent by an account but not yet claimed.";
this.specificInputSchema = GetOutstandingAirdropsZodSchema;
this.namespace = "account";
}
async executeQuery(args) {
this.logger.info(
`Getting outstanding airdrops for account: ${args.accountId}`
);
const airdrops = await this.hederaKit.query().getOutstandingTokenAirdrops(args);
if (airdrops === null) {
return {
success: false,
error: `Could not retrieve outstanding airdrops for account ${args.accountId}`
};
}
return {
success: true,
accountId: args.accountId,
airdrops,
count: airdrops.length
};
}
}
export {
HederaGetOutstandingAirdropsTool
};
//# sourceMappingURL=index80.js.map