Class MarketplaceV3Offers<TContract>

Handles marketplace offers

Type Parameters

  • TContract extends OffersLogic

Hierarchy

  • MarketplaceV3Offers

Implements

  • DetectableFeature

Constructors

Properties

acceptOffer: {
    prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Accept an offer

      Parameters

      • Rest ...args: [offerId: BigNumberish]

      Returns Promise<TResult>

      the transaction receipt

      Example

      // The ID of the offer you want to accept
      const offerId = 0;

      await contract.offers.acceptOffer(offerId);

      Twfeature

      Offers

  • prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>)
      • (...args): Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
      • Parameters

        • Rest ...args: [offerId: BigNumberish]

        Returns Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>

cancelOffer: {
    prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Cancel an offer

      Parameters

      • Rest ...args: [offerId: BigNumberish]

      Returns Promise<TResult>

      the transaction receipt

      Remarks

      Cancel an offer on the marketplace

      Example

      // The ID of the offer you want to cancel
      const offerId = "0";

      await contract.offers.cancelOffer(offerId);

      Twfeature

      Offers

  • prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>)
      • (...args): Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
      • Parameters

        • Rest ...args: [offerId: BigNumberish]

        Returns Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>

contractWrapper: ContractWrapper<OffersLogic>
encoder: ContractEncoder<OffersLogic>
estimator: GasCostEstimator<OffersLogic>
events: ContractEvents<OffersLogic>
featureName: "Offers" = FEATURE_OFFERS.name
interceptor: ContractInterceptor<OffersLogic>
makeOffer: {
    prepare: ((...args) => Promise<Transaction<TransactionResultWithId>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Make an offer

      Parameters

      • Rest ...args: [offer: {
            assetContractAddress: string;
            currencyContractAddress?: string;
            endTimestamp?: number | Date;
            quantity?: string | number | bigint | BigNumber;
            tokenId: Object;
            totalPrice: string | number;
        }]

      Returns Promise<TResult>

      the transaction receipt and the id of the newly created offer

      Remarks

      Make an offer on the marketplace for an asset.

      Example

      // Data of the offer you want to make
      const offer = {
      // address of the contract the asset you want to make an offer for
      assetContractAddress: "0x...",
      // token ID of the asset you want to buy
      tokenId: "0",
      // how many of the asset you want to buy
      quantity: 1,
      // address of the currency contract that you offer to pay in
      currencyContractAddress: NATIVE_TOKEN_ADDRESS,
      // Total price you offer to pay for the mentioned token(s)
      totalPrice: "1.5",
      // Offer valid until
      endTimestamp: new Date(),
      }

      const tx = await contract.offers.makeOffer(offer);
      const receipt = tx.receipt; // the transaction receipt
      const id = tx.id; // the id of the newly created offer

      Twfeature

      Offers

  • prepare: ((...args) => Promise<Transaction<TransactionResultWithId>>)
      • (...args): Promise<Transaction<TransactionResultWithId>>
      • Parameters

        • Rest ...args: [offer: {
              assetContractAddress: string;
              currencyContractAddress?: string;
              endTimestamp?: number | Date;
              quantity?: string | number | bigint | BigNumber;
              tokenId: Object;
              totalPrice: string | number;
          }]

        Returns Promise<Transaction<TransactionResultWithId>>

storage: ThirdwebStorage<IpfsUploadBatchOptions>

Methods

Generated using TypeDoc