/// /// import { Metaplex, Nft } from '@metaplex-foundation/js'; import { Commitment, Connection, PublicKey, RpcResponseAndContext, SignatureResult, Transaction } from '@solana/web3.js'; import type { Wallet } from '@project-serum/anchor'; import { Program, Provider } from '@project-serum/anchor'; import { MetadataObject } from './types'; import { AuctionHouseIDL } from './auctionHouseIdl'; import { BidReceipt, ListingReceipt, PurchaseReceipt } from '@metaplex-foundation/mpl-auction-house/dist/src/generated/accounts'; import { CreateMarketplaceActionOptions, CreateMarketplaceOptions } from './mirage-transactions/create-marketplace'; import { UpdateMarketplaceOptions } from './mirage-transactions/update-marketplace'; export interface IMirageOptions { connection: Connection; wallet: Wallet; NFTStorageAPIKey?: string; mintConfig?: { seller_fee_basis_points: number; mintRoyalties: number; }; marketplace: { authority: PublicKey; /** * Marketplace Trading Currency. If not provided, it defaults * to SOL. */ treasuryMint?: PublicKey; }; } export declare type ReceiptType = 'purchase_receipt' | 'listing_receipt' | 'cancel_receipt' | 'cancel_listing_receipt' | 'bid_receipt' | 'cancel_bid_receipt'; export declare type ReceiptAddress = PublicKey; export interface TransactionReceipt extends Omit, Omit, Omit { receipt_type: ReceiptType; createdAt: number; cancelledAt: number; price: number; tokenSize: number; } export declare type TransactionSignature = string | undefined; export declare class Mirage { auctionHouseAuthority: PublicKey; _treasuryMint: PublicKey; auctionHouse?: PublicKey; _provider?: Provider; program?: Program; connection: Connection; wallet: Wallet; NFTStorageAPIKey: string; mintConfig: IMirageOptions['mintConfig']; metaplex: Metaplex; constructor({ connection, wallet, mintConfig: userMintConfig, marketplace }: IMirageOptions); setup(): Promise; /** Get user's NFTs */ getUserNfts(publicKey: PublicKey): Promise; /** Get single NFT by mint */ getNft(mintKey: PublicKey): Promise; /** Gets the owner of an NFT */ getNftOwner(mint: string | PublicKey): Promise; /** Determines whether the client is the owner of the auctionhouse */ get clientIsOwner(): boolean; /** Get the auction house addresses by the owner */ getAuctionHouseAddress(treasuryMint?: PublicKey): Promise<[PublicKey, number]>; /** Loads provider instance */ getProvider(commitment?: Commitment): Promise; /** Loads auctionhouse program */ loadAuctionHouseProgram(): Promise>; /** * Fetches an auctionHouse object * @param auctionHouse */ fetchAuctionHouse(auctionHouse: PublicKey): Promise<{ feeAmount: number; treasuryAmount: number; auctionHouseFeeAccount: PublicKey; auctionHouseTreasury: PublicKey; treasuryWithdrawalDestination: PublicKey; feeWithdrawalDestination: PublicKey; treasuryMint: PublicKey; authority: PublicKey; creator: PublicKey; bump: number; treasuryBump: number; feePayerBump: number; sellerFeeBasisPoints: number; requiresSignOff: boolean; canChangeSalePrice: boolean; }>; /** * Create listing transaction * @param mint * @param listingPrice * @param sellerPublicKey */ createListTransaction(mint: PublicKey, listingPrice: number, sellerPublicKey: PublicKey): Promise; /** * Lists an NFT for sale. * @param mint NFT mint address to be sold * @param _listingPrice price at which NFT will be sold */ listToken(mint: string, _listingPrice: number): Promise, ReceiptAddress, TransactionSignature]>; /** * Creates Buy transaction Object * @param mint * @param listingPrice * @param buyerPublicKey * @param connection */ createBuyTransaction(mint: PublicKey, listingPrice: number, buyerPublicKey: PublicKey, connection?: Connection): Promise; /** * Creates Update Listing transaction Object * @param mint * @param currentListingPrice * @param newListingPrice * @param sellerPublicKey * @param auctionHouseAuthority * @param connection */ createUpdateListingTransaction(mint: PublicKey, currentListingPrice: number, newListingPrice: number, sellerPublicKey: PublicKey, auctionHouseAuthority?: PublicKey, connection?: Connection): Promise; /** * Purchases an NFT that has been listed on sale * @param mint NFT mint address to be bought * @param _buyerPrice price at which NFT will be bought. This MUST match the selling price of the NFT */ buyToken(mint: string, _buyerPrice: number): Promise, ReceiptAddress, TransactionSignature]>; /** * Updates a current listing * @param mint * @param currentListingPrice * @param newListingPrice */ updateListing(mint: string, currentListingPrice: number, newListingPrice: number): Promise, ReceiptAddress, TransactionSignature]>; /** * Creates Cancel Listing transaction Object * @param mint * @param currentListingPrice * @param sellerPublicKey * @param auctionHouseAuthority * @param connection * @param __DANGEROUSLY_INSET_SELLER__ */ createCancelListingTransaction(mint: PublicKey, currentListingPrice: number, sellerPublicKey: PublicKey, auctionHouseAuthority?: PublicKey, connection?: Connection, __DANGEROUSLY_INSET_SELLER__?: string): Promise; /** * Cancels a listing for sell or buy instructions for an NFT * @param mint NFT mint address whose listing is to be cancelled * @param currentListingPrice price at which NFT was listed * @param __DANGEROUSLY_INSET_SELLER__ */ cancelListing(mint: string, currentListingPrice: number, __DANGEROUSLY_INSET_SELLER__?: string): Promise, ReceiptAddress, TransactionSignature]>; /** * Creates Transfer transaction Object * @param mint * @param recipient * @param holderPublicKey * @param auctionHouseAuthority * @param connection * @param __DANGEROUSLY_INSET_SELLER__ */ createTransferTransaction(mint: PublicKey, recipient: PublicKey, holderPublicKey: PublicKey, auctionHouseAuthority?: PublicKey, connection?: Connection, __DANGEROUSLY_INSET_SELLER__?: string): Promise; createCreateMarketplaceTransaction(auctionHouseAuthority: CreateMarketplaceOptions['owner'], sellerFeeBasisPoints: CreateMarketplaceOptions['sellerFeeBasisPoints'], treasuryMint?: CreateMarketplaceOptions['treasuryMint'], feeWithdrawalDestination?: CreateMarketplaceOptions['feeWithdrawalDestination'], treasuryWithdrawalDestination?: CreateMarketplaceOptions['treasuryWithdrawalDestination'], requiresSignOff?: CreateMarketplaceOptions['requiresSignOff'], canChangeSalePrice?: CreateMarketplaceOptions['canChangeSalePrice'], storeFrontUrl?: string, feePayer?: PublicKey): Promise; createUpdateMarketplaceTransaction(authority: UpdateMarketplaceOptions['authority'], sellerFeeBasisPoints: UpdateMarketplaceOptions['sellerFeeBasisPoints'], newAuthority?: UpdateMarketplaceOptions['newAuthority'], treasuryMint?: UpdateMarketplaceOptions['treasuryMint'], feeWithdrawalDestination?: UpdateMarketplaceOptions['feeWithdrawalDestination'], treasuryWithdrawalDestination?: UpdateMarketplaceOptions['treasuryWithdrawalDestination'], requiresSignOff?: UpdateMarketplaceOptions['requiresSignOff'], canChangeSalePrice?: UpdateMarketplaceOptions['canChangeSalePrice'], storeFrontUrl?: string, feePayer?: PublicKey): Promise; /** * Sends an NFT to a new user. * @param mint NFT mint address to transfer to a new user * @param recipient Recipient's publicKey */ transferNft(mint: string | PublicKey, recipient: string | PublicKey): Promise<[RpcResponseAndContext, TransactionSignature]>; /** * Creates a new marketplace instance for the user. * @param options */ createMarketplace(options: CreateMarketplaceActionOptions): Promise<(string | RpcResponseAndContext)[]>; updateMarketplace(options: UpdateMarketplaceOptions): Promise<(string | RpcResponseAndContext)[]>; /** * Mints a new NFT on Solana. There are 2 approaches to using this function. * 1. If you already have your files uploaded to the blockchain, then there is no * need to perform a new upload. Simply provide the necessary metadata URI / tokenURI. * 2. If you choose to provide a file/image/video for your NFT, then it will be uploaded * to a decentralized storage service before minting. * @param metadata Object for metadata according to Metaplex NFT standard. @see https://docs.metaplex.com/token-metadata/specification#full-metadata-struct * @param metadataLink URL for your token metadata. If provided, then upload is ignored. * @param file */ mintNft(metadata: MetadataObject, metadataLink?: string, file?: File): Promise; /** * Get token transactions * @param mint * @param auctionHouseAddress */ getTokenTransactions(mint: string | PublicKey, auctionHouseAddress?: string | PublicKey): Promise<(TransactionReceipt | undefined)[]>; /** * Signs a transaction object * @param txt * @param wallet */ signTransaction(txt: Transaction, wallet: Wallet): Promise; static getTokenAmount(anchorProgram: Program, account: PublicKey, mint: PublicKey): Promise; } //# sourceMappingURL=mirage.d.ts.map