Merge branch 'main' into feat/squads_multisig

This commit is contained in:
A91y
2024-12-30 11:02:17 +05:30
46 changed files with 5105 additions and 234 deletions

View File

@@ -6,6 +6,7 @@ import {
deploy_collection,
deploy_token,
get_balance,
get_balance_other,
getTPS,
resolveSolDomain,
getPrimaryDomain,
@@ -66,12 +67,12 @@ export class SolanaAgentKit {
public connection: Connection;
public wallet: Keypair;
public wallet_address: PublicKey;
public openai_api_key: string;
public openai_api_key: string | null;
constructor(
private_key: string,
rpc_url = "https://api.mainnet-beta.solana.com",
openai_api_key: string,
openai_api_key: string | null = null,
) {
this.connection = new Connection(rpc_url);
this.wallet = Keypair.fromSecretKey(bs58.decode(private_key));
@@ -104,6 +105,13 @@ export class SolanaAgentKit {
return get_balance(this, token_address);
}
async getBalanceOther(
walletAddress: PublicKey,
tokenAddress?: PublicKey,
): Promise<number> {
return get_balance_other(this, walletAddress, tokenAddress);
}
async mintNFT(
collectionMint: PublicKey,
metadata: Parameters<typeof mintCollectionNFT>[2],