Options
All
  • Public
  • Public/Protected
  • All
Menu

Module core/src

Index

Type Aliases

Attribute: { display_type?: string; trait_type?: string; value: string | number }

Type declaration

  • Optional display_type?: string
  • Optional trait_type?: string
  • value: string | number
IAuctionOptions: { connection: Connection; wallet: Wallet }

Type declaration

  • connection: Connection
  • wallet: Wallet
Receipt: PublicKey
ReceiptAddress: PublicKey
ReceiptType: "purchase_receipt" | "listing_receipt" | "cancel_receipt" | "cancel_listing_receipt" | "bid_receipt" | "cancel_bid_receipt"
TransactionSignature: string | undefined

Variables

AUCTION_HOUSE: "auction_house" = 'auction_house'
AUCTION_HOUSE_PROGRAM_ID: PublicKey = ...
MINT_CONFIG: { mintRoyalties: number; seller_fee_basis_points: number } = ...

Type declaration

  • mintRoyalties: number
  • seller_fee_basis_points: number
MIRAGE_AUCTION_HOUSE: PublicKey = ...
MIRAGE_AUCTION_HOUSE_AUTHORITY: PublicKey = ...
NFT_STORAGE_API_KEY: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6ZXRocjoweEZDQjI0MDFEMTRGODk3OUViNkEzNDdhMWQ3MEMxMjQzMWI1OUUwZkMiLCJpc3MiOiJuZnQtc3RvcmFnZSIsImlhdCI6MTY0OTA4OTIxMzMyNSwibmFtZSI6Ik1pcnJvcldvcmxkX0RldmVsb3BtZW50X0tleSJ9.COpqZqwBbDM1bBgYuIiaQxsGRQc0gphXGCBMsRhAHk8" = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6ZXRocjoweEZDQjI0MDFEMTRGODk3OUViNkEzNDdhMWQ3MEMxMjQzMWI1OUUwZkMiLCJpc3MiOiJuZnQtc3RvcmFnZSIsImlhdCI6MTY0OTA4OTIxMzMyNSwibmFtZSI6Ik1pcnJvcldvcmxkX0RldmVsb3BtZW50X0tleSJ9.COpqZqwBbDM1bBgYuIiaQxsGRQc0gphXGCBMsRhAHk8'
SIGNER: "signer" = 'signer'
SPL_ASSOCIATED_TOKEN_ACCOUNT_PROGRAM_ID: PublicKey = ...
TOKEN_METADATA_PROGRAM_ID: PublicKey = ...
WRAPPED_SOL_MINT: PublicKey = ...

Functions

  • getAccountInfo(connection: Connection, address: PublicKey, commitment?: Commitment, programId?: PublicKey): Promise<{ address: PublicKey; amount: any; closeAuthority: any; delegate: any; delegatedAmount: any; isFrozen: boolean; isInitialized: boolean; isNative: boolean; mint: any; owner: any; rentExemptReserve: any }>
  • Parameters

    • connection: Connection
    • address: PublicKey
    • Optional commitment: Commitment
    • programId: PublicKey = TOKEN_PROGRAM_ID

    Returns Promise<{ address: PublicKey; amount: any; closeAuthority: any; delegate: any; delegatedAmount: any; isFrozen: boolean; isInitialized: boolean; isNative: boolean; mint: any; owner: any; rentExemptReserve: any }>

  • getAtaForMint(mint: PublicKey, address: PublicKey): [PublicKey, number]
  • Get associated token for mint

    Parameters

    • mint: PublicKey
    • address: PublicKey

    Returns [PublicKey, number]

  • getMetadata(mint: PublicKey): PublicKey
  • Get metadatata account for mint

    Parameters

    • mint: PublicKey

    Returns PublicKey

  • getNftOwner(mint: string | PublicKey, connection: Connection): Promise<readonly [string, PublicKey, Buffer | ParsedAccountData]>
  • Parameters

    • mint: string | PublicKey
    • connection: Connection

    Returns Promise<readonly [string, PublicKey, Buffer | ParsedAccountData]>

  • getTokenTransactions(mint: string | PublicKey, auctionHouse: PublicKey, connection: Connection): Promise<(TransactionReceipt | undefined)[]>
  • Get Token Transactions

    Parameters

    • mint: string | PublicKey
    • auctionHouse: PublicKey
    • connection: Connection

    Returns Promise<(TransactionReceipt | undefined)[]>

  • isPdaAddressInitialize(connection: Connection, pdaAddress: PublicKey): Promise<boolean>
  • Parameters

    • connection: Connection
    • pdaAddress: PublicKey

    Returns Promise<boolean>

  • processCreatorShares(creators: { address: string; share: number }[], authorityAddress: PublicKey, authorityRoyaltyPercentage?: number): { address: string; share: number }[]
  • Processes creator shares and adds the auctionhouse as one of the authorities on the mint. It then provides the authorityAddress and gives it a royalty percentage equal to the authorityRoyaltyPercentage of the cumulative total shares of all the creators.

    e.g.

    example
     const auctionHouseAuthority = new PublicKey("3MtckfRX4VRJ1yUmPHpKZstAQ8S3WfhRnNJLT8LqTZEr")
    const authorityRoyaltyPercentage = 5

    processCreatorShares([
    {
    address: "Betkx8CfRUwQAqZZRqKt13zo4t9awNFeriD2bMAq2xfJ",
    share: 43
    },
    {
    address: "Dn4D8vVvpKzCALq1X5jasPrwvs5kXnSJtfbji4iZaq6R",
    share: 1232
    }
    ], auctionHouseAuthority, authorityRoyaltyPercentage);

    Yields:

    [
    {
    address: 'Betkx8CfRUwQAqZZRqKt13zo4t9awNFeriD2bMAq2xfJ',
    share: 3
    },
    {
    address: 'Dn4D8vVvpKzCALq1X5jasPrwvs5kXnSJtfbji4iZaq6R',
    share: 92
    },
    {
    address: '3MtckfRX4VRJ1yUmPHpKZstAQ8S3WfhRnNJLT8LqTZEr',
    share: 5
    }
    ]

    Parameters

    • creators: { address: string; share: number }[]

      Array of creators

    • authorityAddress: PublicKey

      Address of the auctionhouse authority

    • authorityRoyaltyPercentage: number = 4.25

      Percentage of royalties to be added to the marketplace

    Returns { address: string; share: number }[]

  • uploadNFTFileToStorage(image: null | File, metadataJson: MetadataObject, isAnimation?: boolean, nftStorageKey?: string): Promise<undefined | readonly [string, string] | readonly [string]>
  • Uploads an NFT's image or video or file to decentralized storage.

    Parameters

    • image: null | File
    • metadataJson: MetadataObject
    • isAnimation: boolean = false
    • nftStorageKey: string = NFT_STORAGE_API_KEY

      API key provided by https://nft.storage. See documentation at:

    Returns Promise<undefined | readonly [string, string] | readonly [string]>

Generated using TypeDoc