mirror of
https://github.com/d0zingcat/solana-agent-kit.git
synced 2026-06-01 23:26:52 +00:00
chore: docs + lint
This commit is contained in:
@@ -794,8 +794,6 @@ export class SolanaFlashOpenTrade extends Tool {
|
||||
try {
|
||||
const parsedInput = JSON.parse(input);
|
||||
|
||||
console.log(parsedInput);
|
||||
|
||||
// Validate input parameters
|
||||
if (!parsedInput.token) {
|
||||
throw new Error("Token is required, received: " + parsedInput.token);
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
import { PublicKey, ComputeBudgetProgram } from "@solana/web3.js";
|
||||
import {
|
||||
PerpetualsClient,
|
||||
OraclePrice,
|
||||
PoolConfig,
|
||||
Privilege,
|
||||
Side,
|
||||
} from "flash-sdk";
|
||||
import { ComputeBudgetProgram } from "@solana/web3.js";
|
||||
import { PoolConfig, Privilege, Side } from "flash-sdk";
|
||||
import { BN } from "@coral-xyz/anchor";
|
||||
import { SolanaAgentKit } from "../index";
|
||||
import {
|
||||
@@ -54,7 +48,7 @@ export async function flashCloseTrade(
|
||||
const [targetSymbol, collateralSymbol] = marketData.tokenPair.split("/");
|
||||
|
||||
// Fetch oracle prices
|
||||
const [targetPrice, collateralPrice] = await Promise.all([
|
||||
const [targetPrice] = await Promise.all([
|
||||
fetchOraclePrice(targetSymbol),
|
||||
fetchOraclePrice(collateralSymbol),
|
||||
]);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { PublicKey, ComputeBudgetProgram } from "@solana/web3.js";
|
||||
import { ComputeBudgetProgram } from "@solana/web3.js";
|
||||
import {
|
||||
PerpetualsClient,
|
||||
OraclePrice,
|
||||
|
||||
@@ -49,4 +49,4 @@ export * from "./transfer";
|
||||
export * from "./withdraw_all";
|
||||
|
||||
export * from "./flash_open_trade";
|
||||
export * from "./flash_close_trade";
|
||||
export * from "./flash_close_trade";
|
||||
|
||||
@@ -238,7 +238,7 @@ export async function getNftTradingAccountInfo(
|
||||
nftOwnerRebateTokenAccountPk,
|
||||
);
|
||||
if (!accountExists) {
|
||||
console.log(
|
||||
console.error(
|
||||
"NFT owner rebate token account does not exist and may need to be created",
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user