@flipflop-sdk/tools
Version:
[](https://deepwiki.com/flipflop-fun/sdk) [](https://badge.fury.io/js/%40flipflop-sdk%2Ftools) [ • 3.8 kB
TypeScript
import { PublicKey, Connection, VersionedTransaction, AccountInfo, BlockhashWithExpiryBlockHeight, Transaction } from "@solana/web3.js";
import * as anchor from '@coral-xyz/anchor';
import { FairMintToken } from '../types/fair_mint_token';
import { NetworkConfigs, ResponseData } from "../types/common";
import { BN } from "@coral-xyz/anchor";
import { AnchorWallet } from "@solana/wallet-adapter-react";
export declare const BN_MILLION: anchor.BN;
export declare const BN_LAMPORTS_PER_SOL: anchor.BN;
export declare const connection: (rpc: string) => Connection;
export declare const mintAccount: (program: anchor.Program<FairMintToken>, tokenName: string, tokenSymbol: string) => PublicKey;
export declare const configAccount: (program: anchor.Program<FairMintToken>, mintAccount: PublicKey) => PublicKey;
export declare const systemConfigAccount: (program: anchor.Program<FairMintToken>, systemMangerAccount: PublicKey) => PublicKey;
export declare const referralAccount: (program: anchor.Program<FairMintToken>, mintAccount: PublicKey, refAccount: PublicKey) => PublicKey;
export declare const getReferrerCodeHash: (program: anchor.Program<FairMintToken>, code: string) => PublicKey;
export declare const refundAccountPda: (program: anchor.Program<FairMintToken>, mintAccount: PublicKey, userAccount: PublicKey) => PublicKey;
export declare const getReferralDataByCodeHash: (rpc: string, program: anchor.Program<FairMintToken>, codeHash: PublicKey) => Promise<ResponseData>;
export declare const getTokenBalance: (ata: PublicKey, connection: Connection) => Promise<number | null>;
export declare const getSystemConfig: (program: anchor.Program<FairMintToken>, network: keyof NetworkConfigs) => Promise<ResponseData>;
export declare function getFeeValue(feeRate: BN, difficultyCoefficient: number, referrerAtaBalance: BN, totalSupply: BN): [BN, BN];
export declare const numberStringToBN: (decimalStr: string) => BN;
export declare const metadataAccountPda: (network: keyof NetworkConfigs, mintAccount: PublicKey) => PublicKey;
export declare const getSolanaBalance: (publicKey: PublicKey, connection: Connection) => Promise<number>;
export declare const compareMints: (mintA: PublicKey, mintB: PublicKey) => number;
export declare function getLegacyTokenMetadata(metadataAccountInfo: AccountInfo<Buffer> | null): Promise<ResponseData>;
export declare const processVersionedTransaction: (versionedTx: VersionedTransaction, connection: Connection, wallet: AnchorWallet, latestBlockhash: BlockhashWithExpiryBlockHeight, confirmLevel?: "processed" | "confirmed" | "finalized") => Promise<{
success: boolean;
message: string;
data: {
tx: string;
};
} | {
success: boolean;
message: any;
data?: undefined;
}>;
export declare const mintBy: (network: keyof NetworkConfigs, program: anchor.Program<FairMintToken>, mintAccount: PublicKey, configAccount: PublicKey, referralAccount: PublicKey, referrerMain: PublicKey, tokenMetadata: {
name: string;
symbol: string;
}, codeHash: PublicKey, account: AnchorWallet, systemConfigAccount: PublicKey, connection: Connection, lookupTableAddress: PublicKey, protocolFeeAccount: PublicKey) => Promise<ResponseData>;
export declare const cleanMetadata: (metadata: {
name: string;
symbol: string;
uri: string;
}) => {
name: string;
symbol: string;
uri: string;
};
export declare const processTransaction: (tx: Transaction, connection: Connection, wallet: AnchorWallet, successMessage: string, extraData: {}) => Promise<{
success: boolean;
message: string;
data?: undefined;
} | {
success: boolean;
message: string;
data: {
tx: string;
};
}>;
export declare const parseConfigData: (program: anchor.Program<FairMintToken>, configAccount: PublicKey) => Promise<any>;