candy-machine-assistant
Version:
A tool to assist in the connecting to candy machines, mint accounts and confirm NFT transactions based on Solana's Metaplex NFTs.
68 lines (67 loc) • 3.03 kB
TypeScript
/// <reference types="bn.js" />
import * as anchor from "@project-serum/anchor";
import { Transaction } from "@solana/web3.js";
export declare const CANDY_MACHINE_PROGRAM: anchor.web3.PublicKey;
export declare const TOKEN_METADATA_PROGRAM_ID: anchor.web3.PublicKey;
interface CandyMachineState {
authority: anchor.web3.PublicKey;
itemsAvailable: number;
itemsRedeemed: number;
itemsRemaining: number;
treasury: anchor.web3.PublicKey;
tokenMint: null | anchor.web3.PublicKey;
isSoldOut: boolean;
isActive: boolean;
isPresale: boolean;
isWhitelistOnly: boolean;
goLiveDate: null | anchor.BN;
price: anchor.BN;
gatekeeper: null | {
expireOnUse: boolean;
gatekeeperNetwork: anchor.web3.PublicKey;
};
endSettings: null | {
number: anchor.BN;
endSettingType: any;
};
whitelistMintSettings: null | {
mode: any;
mint: anchor.web3.PublicKey;
presale: boolean;
discountPrice: null | anchor.BN;
};
hiddenSettings: null | {
name: string;
uri: string;
hash: Uint8Array;
};
retainAuthority: boolean;
}
export interface CandyMachineAccount {
id: anchor.web3.PublicKey;
program: anchor.Program;
state: CandyMachineState;
}
export declare const awaitTransactionSignatureConfirmation: (txid: anchor.web3.TransactionSignature, timeout: number, connection: anchor.web3.Connection, queryStatus?: boolean) => Promise<anchor.web3.SignatureStatus | null | void>;
export declare const getCandyMachineState: (anchorWallet: anchor.Wallet, candyMachineId: anchor.web3.PublicKey, connection: anchor.web3.Connection) => Promise<CandyMachineAccount>;
export declare const getMetadataPDA: (mint: anchor.web3.PublicKey) => Promise<anchor.web3.PublicKey>;
export declare const getCandyMachineCreator: (candyMachine: anchor.web3.PublicKey) => Promise<[anchor.web3.PublicKey, number]>;
export declare const getCollectionPDA: (candyMachineAddress: anchor.web3.PublicKey) => Promise<[anchor.web3.PublicKey, number]>;
export interface CollectionData {
mint: anchor.web3.PublicKey;
candyMachine: anchor.web3.PublicKey;
}
export declare const getCollectionAuthorityRecordPDA: (mint: anchor.web3.PublicKey, newAuthority: anchor.web3.PublicKey) => Promise<anchor.web3.PublicKey>;
export declare type SetupState = {
mint: anchor.web3.Keypair;
userTokenAccount: anchor.web3.PublicKey;
transaction: string;
};
export declare const createAccountsForMint: (candyMachine: CandyMachineAccount, payer: anchor.web3.PublicKey) => Promise<SetupState>;
declare type MintResult = {
mintTxId: string;
metadataKey: anchor.web3.PublicKey;
};
export declare const mintOneToken: (candyMachine: CandyMachineAccount, payer: anchor.web3.PublicKey, beforeTransactions?: Transaction[], afterTransactions?: Transaction[], setupState?: SetupState | undefined) => Promise<MintResult | null>;
export declare const shortenAddress: (address: string, chars?: number) => string;
export {};