Skip to main content

BulletinBoard

The BulletinBoard contract serves as a centralized event emitter for NFT marketplace activities. It provides a standardized way to broadcast and track various marketplace events such as:

  • New collection listings
  • Offers made on NFTs
  • Offer cancellations
  • Bids placed on NFTs
  • Bid cancellations
  • Completed sales

While anyone can emit events through this contract, all events are prefixed with "BB_" to distinguish them from events emitted directly by NFT contracts. This helps maintain clarity in event tracking and marketplace activity monitoring.

Hierarchy

  • unknown
    • BulletinBoard

Index

Constructors

constructor

Properties

admin

admin: any = ...

events

events: { bid: typeof BB_BidEvent; cancelBid: typeof BB_CancelBidEvent; cancelOffer: typeof BB_CancelOfferEvent; changeAdmin: typeof BB_ChangeAdminEvent; newCollection: typeof BB_NewCollectionEvent; offer: typeof BB_OfferEvent; sale: typeof BB_SaleEvent; setFee: any; upgradeVerificationKey: typeof BB_UpgradeVerificationKeyEvent; withdraw: any } = ...

Type declaration

fee

fee: any = ...

Methods

bid

  • bid(collection: PublicKey, nft: PublicKey, bid: PublicKey, price: UInt64): Promise<void>
  • Emits a bid event.


    Parameters

    • collection: PublicKey

      The collection address.

    • nft: PublicKey

      The NFT address.

    • bid: PublicKey

      The bid address.

    • price: UInt64

      The price.

    Returns Promise<void>

cancelBid

  • cancelBid(collection: PublicKey, nft: PublicKey, bid: PublicKey): Promise<void>
  • Emits a cancel bid event.


    Parameters

    • collection: PublicKey

      The collection address.

    • nft: PublicKey

      The NFT address.

    • bid: PublicKey

      The bid address.

    Returns Promise<void>

cancelOffer

  • cancelOffer(collection: PublicKey, nft: PublicKey): Promise<void>
  • Emits a cancel offer event.


    Parameters

    • collection: PublicKey

      The collection address.

    • nft: PublicKey

      The NFT address.

    Returns Promise<void>

changeAdmin

  • changeAdmin(admin: PublicKey): Promise<void>
  • Changes the contract's admin


    Parameters

    • admin: PublicKey

      The new admin.

    Returns Promise<void>

deploy

ensureOwnerSignature

  • ensureOwnerSignature(): Promise<AccountUpdate>
  • Ensures that the transaction is authorized by the contract owner.


    Returns Promise<AccountUpdate>

    A signed AccountUpdate from the admin.

newCollection

  • newCollection(collection: PublicKey): Promise<void>
  • Emits a new collection event.


    Parameters

    • collection: PublicKey

      The collection address.

    Returns Promise<void>

offer

  • offer(collection: PublicKey, nft: PublicKey, offer: PublicKey, price: UInt64): Promise<void>
  • Emits an offer event.


    Parameters

    • collection: PublicKey

      The collection address.

    • nft: PublicKey

      The NFT address.

    • offer: PublicKey

      The offer address.

    • price: UInt64

      The price.

    Returns Promise<void>

payFee

  • payFee(): Promise<any>
  • Pays the fee to prevent spamming the BulletinBoard with fake events.


    Returns Promise<any>

sale

  • sale(collection: PublicKey, nft: PublicKey, buyer: PublicKey, price: UInt64): Promise<void>
  • Emits a sale event.


    Parameters

    • collection: PublicKey

      The collection address.

    • nft: PublicKey

      The NFT address.

    • buyer: PublicKey

      The buyer address.

    • price: UInt64

      The price.

    Returns Promise<void>

setFee

  • setFee(fee: UInt64): Promise<void>
  • Changes the contract's fee


    Parameters

    • fee: UInt64

      The new fee.

    Returns Promise<void>

upgradeVerificationKey

  • upgradeVerificationKey(vk: VerificationKey): Promise<void>
  • Upgrades the contract's verification key after validating with the upgrade authority.


    Parameters

    • vk: VerificationKey

      The new verification key to upgrade to.

    Returns Promise<void>

withdraw

  • withdraw(amount: UInt64): Promise<void>
  • Withdraws the fee by admin


    Parameters

    • amount: UInt64

    Returns Promise<void>