refactored code

This commit is contained in:
shivaji43
2025-01-12 12:13:37 +05:30
parent fcbb2e18c6
commit 58a9edd7e2
17 changed files with 776 additions and 0 deletions

View File

@@ -76,6 +76,12 @@ import {
multisig_reject_proposal,
multisig_approve_proposal,
multisig_execute_proposal,
parseTransaction,
sendTransactionWithPriorityFee,
getAssetsByOwner,
getHeliusWebhook,
create_HeliusWebhook,
deleteHeliusWebhook,
} from "../tools";
import {
Config,
@@ -90,6 +96,8 @@ import {
OrderParams,
FlashTradeParams,
FlashCloseTradeParams,
HeliusWebhookIdResponse,
HeliusWebhookResponse,
} from "../types";
/**
@@ -654,4 +662,36 @@ export class SolanaAgentKit {
): Promise<string> {
return multisig_execute_proposal(this, transactionIndex);
}
async CreateWebhook(
accountAddresses: string[],
webhookURL: string,
): Promise<HeliusWebhookResponse> {
return create_HeliusWebhook(this, accountAddresses, webhookURL);
}
async getWebhook(id: string): Promise<HeliusWebhookIdResponse> {
return getHeliusWebhook(this, id);
}
async deleteWebhook(webhookID: string): Promise<any> {
return deleteHeliusWebhook(this, webhookID);
}
async heliusParseTransactions(transactionId: string): Promise<any> {
return parseTransaction(this, transactionId);
}
async getAllAssetsbyOwner(owner: PublicKey, limit: number): Promise<any> {
return getAssetsByOwner(this, owner, limit);
}
async sendTranctionWithPriority(
priorityLevel: string,
amount: number,
to: PublicKey,
splmintAddress?: PublicKey,
): Promise<{ transactionId: string; fee: number }> {
return sendTransactionWithPriorityFee(
this,
priorityLevel,
amount,
to,
splmintAddress,
);
}
}