chore: docs + lint

This commit is contained in:
aryan
2025-01-04 03:42:56 +05:30
parent da09193d9d
commit 7c3f4180a0
35 changed files with 71 additions and 66 deletions

View File

@@ -2,7 +2,6 @@ import { Action } from "../types/action";
import { SolanaAgentKit } from "../agent";
import { z } from "zod";
import { PublicKey } from "@solana/web3.js";
import { BN } from "@coral-xyz/anchor";
import { Decimal } from "decimal.js";
import { orcaCreateSingleSidedLiquidityPool } from "../tools";

View File

@@ -16,6 +16,7 @@ export async function getMainAllDomainsDomain(
mainDomain = await _getFavoriteDomain(agent.connection, owner);
return mainDomain.stale ? null : mainDomain.reverse;
} catch (error: any) {
console.error(error);
return null;
}
}

View File

@@ -29,7 +29,8 @@ export async function getPrimaryDomain(
);
}
return reverse;
} catch (error) {
} catch (error: any) {
console.error(error);
throw new Error(
`Failed to get primary domain for account: ${account.toBase58()}`,
);

View File

@@ -1,5 +1,5 @@
import exp from "constants";
export * from "./get_wallet_address";
export * from "./request_faucet_funds";
export * from "./get_wallet_address";
export * from "./request_faucet_funds";
export * from "./deploy_token";

View File

@@ -24,7 +24,8 @@ export async function resolveSolDomain(
try {
return await resolve(agent.connection, domain);
} catch (error) {
} catch (error: any) {
console.error(error);
throw new Error(`Failed to resolve domain: ${domain}`);
}
}

View File

@@ -88,6 +88,7 @@ export async function sendCompressedAirdrop(
agent.wallet.publicKey,
);
} catch (error) {
console.error(error);
throw new Error(
"Source token account not found and failed to create it. Please add funds to your wallet and try again.",
);

View File

@@ -33,6 +33,7 @@ export async function listNFTForSale(
throw new Error(`You don't own this NFT (${nftMint.toString()})`);
}
} catch (error: any) {
console.error(error);
throw new Error(
`No token account found for mint ${nftMint.toString()}. Make sure you own this NFT.`,
);