-
Notifications
You must be signed in to change notification settings - Fork 1
/
constants.ts
50 lines (40 loc) · 1.64 KB
/
constants.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import { BN, Wallet } from "@project-serum/anchor";
import { PublicKey, Connection } from "@solana/web3.js";
import { loadKeypairFromFile, loadIdl } from "./src/helpers/helpers";
const rpcURl =
"https://lb.drpc.org/ogrpc?network=solana&dkey=AieoLqQV-UyrpLOR2Ir6a0BVT2QzHZgR764stigucSjy";
const helius_api_key = "ee3680cf-196e-475b-8f62-812d6b540435";
const rpcurlHelius =
"https://mainnet.helius.rpc.com/?api-key=ee3680cf-196e-475b-8f62-812d6b540435";
const quickNodeRpc =
"https://floral-responsive-aura.solana-mainnet.quiknode.pro/27668ddeedee2cab8681e0847d72968cb6d495da/";
const connectionQuickNode = new Connection(quickNodeRpc, "confirmed");
const connectionHelius = new Connection(rpcurlHelius, "confirmed");
const keypairPath = "./res/wallets/mainWallet.json";
const walletSec = loadKeypairFromFile(keypairPath);
const wallet = new Wallet(walletSec);
const idl = loadIdl();
const programId = new PublicKey("6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P");
// Accounts required for the buy instruction
const global = new PublicKey("4wTV1YmiEkRvAtNtsSGPtUrqRYQMe5SKy2uB4Jjaxnjf"); // PublicKey of the global account
const feeRecipient = new PublicKey(
"CebN5WGQ4jvEPvsVU4EoHEpgzq1VV7AbicfhtW4xC9iM"
); // PublicKey of the fee recipient account
const eventAuthority = new PublicKey(
"Ce6TQqeHC9p8KetsN6JsjHK7UTZk7nasjjnr7XxXp9F1"
);
// PublicKey of the associated user account
const user = wallet.publicKey;
const amount = new BN(35528); // Amount to buy
const maxSolCost = new BN(1000000); // Maximum SOL cost
export {
connectionQuickNode,
connectionHelius,
wallet,
idl,
global,
eventAuthority,
feeRecipient,
programId,
helius_api_key,
};