UNPKG

@flipflop-sdk/node

Version:

FlipFlop Node.js SDK for programmatic token operations

42 lines (41 loc) 3.47 kB
import { Connection, Keypair, PublicKey, VersionedTransaction, AddressLookupTableAccount } from "@solana/web3.js"; import { Program, Provider } from "@coral-xyz/anchor"; import { FairMintToken } from "./types/fair_mint_token"; import { ConfigAccountData, MintTokenResponse, ProviderAndProgram, ReferralAccountData } from "./types"; import { ApiResponse } from "./raydium/types"; export declare const initProvider: (rpc: Connection, account: Keypair) => Promise<ProviderAndProgram>; export declare const initProviderNoSigner: (rpc: Connection) => Promise<ProviderAndProgram>; export declare const getTokenBalance: (publicKey: PublicKey, connection: Connection) => Promise<number>; export declare const loadKeypairFromFile: (filePath: string) => Keypair; export declare const checkAccountExists: (rpc: Connection, account: PublicKey) => Promise<boolean>; export declare const getSolanaBalance: (rpc: Connection, account: PublicKey) => Promise<number>; export declare const loadKeypairFromBase58: (base58Key: string) => Keypair; export declare const cleanTokenName: (str: string) => string; export declare const parseConfigData: (program: Program<FairMintToken>, configAccount: PublicKey) => Promise<ConfigAccountData>; export declare const getLegacyTokenMetadata: (connection: Connection, metadataAccountPda: PublicKey, debug?: boolean) => Promise<any>; export declare const mintBy: (provider: Provider, program: Program<FairMintToken>, mintAccount: PublicKey, configAccount: PublicKey, referralAccount: PublicKey, referrerMain: PublicKey, tokenMetadata: { name: string; symbol: string; }, codeHash: PublicKey, account: Keypair, systemConfigAccount: PublicKey, connection: Connection, lookupTableAddress: PublicKey, protocolFeeAccount: PublicKey) => Promise<ApiResponse<MintTokenResponse>>; export declare const processVersionedTransaction: (messageV0: VersionedTransaction, connection: Connection, wallet: Keypair, confirmLevel?: "processed" | "confirmed" | "finalized") => Promise<{ success: boolean; message: string; data?: undefined; } | { success: boolean; message: string; data: { tx: string; }; }>; export declare const compareMints: (mintA: PublicKey, mintB: PublicKey) => number; export declare const getAuthAddress: (programId: PublicKey) => [PublicKey, number]; export declare const getPoolAddress: (ammConfig: PublicKey, tokenMint0: PublicKey, tokenMint1: PublicKey, programId: PublicKey) => [PublicKey, number]; export declare const getPoolVaultAddress: (pool: PublicKey, vaultTokenMint: PublicKey, programId: PublicKey) => [PublicKey, number]; export declare const getPoolLpMintAddress: (pool: PublicKey, programId: PublicKey) => [PublicKey, number]; export declare const getOrcleAccountAddress: (pool: PublicKey, programId: PublicKey) => [PublicKey, number]; export declare const getMetadataByMint: (rpc: Connection, mintAccount: PublicKey) => Promise<any>; export declare const getReferralDataByCodeHash: (connection: Connection, program: Program<FairMintToken>, codeHash: PublicKey) => Promise<any>; export declare const getURCDetails: (connection: Connection, program: Program<FairMintToken>, urcCode: string) => Promise<ReferralAccountData>; export declare const createAddressLookupTable: (connection: Connection, payer: Keypair, addresses: PublicKey[]) => Promise<AddressLookupTableAccount>; export declare const createLookupTable: (connection: Connection, payer: Keypair) => Promise<AddressLookupTableAccount>;