mirror of
https://github.com/d0zingcat/solana-agent-kit.git
synced 2026-05-17 15:10:27 +00:00
Merge branch 'sendaifun:main' into feature/totalbalance
This commit is contained in:
@@ -1,9 +1,16 @@
|
||||
import { HermesClient } from "@pythnetwork/hermes-client";
|
||||
import { OraclePrice } from "flash-sdk";
|
||||
import { AnchorProvider, BN, Wallet } from "@coral-xyz/anchor";
|
||||
import { PoolConfig, Token, Referral, PerpetualsClient } from "flash-sdk";
|
||||
import {
|
||||
PoolConfig,
|
||||
Token,
|
||||
Referral,
|
||||
PerpetualsClient,
|
||||
Privilege,
|
||||
} from "flash-sdk";
|
||||
import { Cluster, PublicKey, Connection, Keypair } from "@solana/web3.js";
|
||||
import { getAssociatedTokenAddressSync } from "@solana/spl-token";
|
||||
import { SolanaAgentKit } from "../index";
|
||||
|
||||
const POOL_NAMES = [
|
||||
"Crypto.1",
|
||||
@@ -278,3 +285,16 @@ export function createPerpClient(
|
||||
{},
|
||||
);
|
||||
}
|
||||
|
||||
export function get_flash_privilege(agent: SolanaAgentKit): Privilege {
|
||||
const FLASH_PRIVILEGE = agent.config.FLASH_PRIVILEGE || "None";
|
||||
|
||||
switch (FLASH_PRIVILEGE.toLowerCase()) {
|
||||
case "referral":
|
||||
return Privilege.Referral;
|
||||
case "nft":
|
||||
return Privilege.NFT;
|
||||
default:
|
||||
return Privilege.None;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user