@flipflop-sdk/tools
Version:
[](https://deepwiki.com/flipflop-fun/sdk) [](https://badge.fury.io/js/%40flipflop-sdk%2Ftools) [ • 2.69 kB
TypeScript
import { BN } from "@coral-xyz/anchor";
import { AnchorWallet } from "@solana/wallet-adapter-react";
import { Connection, PublicKey } from "@solana/web3.js";
export type ResponseData = {
success: boolean;
message?: string;
data?: any;
};
export type RemainingAccount = {
pubkey: PublicKey;
isSigner: boolean;
isWritable: boolean;
};
export type SuccessResponseData = {
publicKey: string;
tokenAccount: string;
wsolAccount: string;
tx: string;
tokenUrl: string;
};
export type ConfigData = {
admin: PublicKey;
feeRate: BN;
mintSizeEpoch: BN;
};
export type TokenMetadataIPFS = {
name?: string;
symbol?: string;
image?: string;
header?: string;
description?: string;
extensions?: TokenMetadataExtensions;
attributes?: string[];
};
export type TokenMetadataExtensions = {
twitter?: string;
discord?: string;
website?: string;
github?: string;
medium?: string;
telegram?: string;
};
export type MintButtonProps = {
network: keyof NetworkConfigs;
rpc: string;
mintAddress: string;
urcCode: string;
wallet: AnchorWallet;
connection: Connection;
showRefundButton: boolean;
showUrcButton: boolean;
mintButtonTitle?: string;
mintButtonStyle?: Object;
refundButtonStyle?: Object;
refundButtonTitle?: string;
informationStyle?: Object;
generateURCStyle?: Object;
flipflopLogoStyle?: Object;
onMintStart?: () => void;
onMintError?: (error: string) => void;
onMintSuccess?: (data: SuccessResponseData) => void;
onRefundStart?: () => void;
onRefundError?: (error: string) => void;
onRefundSuccess?: (data: SuccessResponseData) => void;
};
export type RefundButtonProps = {
network: keyof NetworkConfigs;
mintAddress: string;
wallet: AnchorWallet;
connection: Connection;
tokenInfo: {
tokenName: string;
tokenSymbol: string;
};
buttonTitle?: string;
buttonStyle?: Object;
informationStyle?: Object;
generateURCStyle?: Object;
flipflopLogoStyle?: Object;
onStart?: () => void;
onError?: (error: string) => void;
onSuccess?: (data: SuccessResponseData) => void;
};
export interface NetworkConfig {
programId: string;
frontendUrl: string;
systemDeployer: PublicKey;
protocolFeeAccount: PublicKey;
allowOwnerOffCurveForProtocolFeeAccount: boolean;
tokenMetadataProgramId: PublicKey;
cpSwapProgram: PublicKey;
cpSwapConfigAddress: PublicKey;
createPoolFeeReceive: PublicKey;
addressLookupTableAddress: PublicKey;
}
export interface NetworkConfigs {
devnet: NetworkConfig;
mainnet: NetworkConfig;
}