Marketplace Widgets

Hey there,

I am using marketplace widgets version 3.5.17 and identity verification code. It looks like I want to subscribe to this event m-marketplace_tx_id_verify.

The problem is you only send that event out if deferIdentityVerification is true. But passing in data-emits-identity-verify={true} does not make that true in the state. I have to mutate it roughly like so -

  useEffect(() => {
    if (window === undefined) return;

    // Set event listener for m-marketplace_tx_id_verify
    window.addEventListener("m-marketplace_tx_id_verify", (event) => {
      console.log("Event received: ", event);
    });

    // Wait for window.mMarketplaceStore to be defined
    const interval = setInterval(() => {
      // @ts-ignore
      if (window.mMarketplaceStore) {
        console.log("mMarketplaceStore is defined");
        clearInterval(interval);

        // @ts-ignore
        window.mMarketplaceStore._mutations[
          `${MARKETPLACE_ADDRESS}-${LISTING_ID}/setDeferIdentityVerification`
        ]?.[0](true);
      }
    }, 100);
  }, [isClient]);

It would be nice if by adding that prop, this would be set by default. Looks like back in versions 2.4.x of the widget this behavior was present.

Also in the _getEndpoint() function - could you add support for sepolia (11155111) please?

It seems like there are 2 functions for it if you ctrl+f here _getEndpoint

https://marketplace.manifoldxyz.dev/3.5.17/marketplace.umd.js

The end effect of this is that no listings on sepolia show bid history.

Try 3.5.18. Both issues fixed (data-emits-identity-verify will now properly set the internal state so events get emitted as expected and triggers what you need).

Thanks Wilkins :slight_smile: that fixed it!

Hey Wilkins! Re-opening this. Could you also add a watcher to the state.walletAddress ?

The behavior I am seeing is that if your wallet is not connected on initial load, then in setOfferHistory this if doesn’t get hit -

          if (offer.offerer.toLowerCase() === window.ManifoldEthereumProvider.selectedAddress()) {
            commit('setUserOfferBase', offer.amount);
            if (offer.accepted) {
              commit('setUserOfferAccepted', true);
            }
          }

because it goes through the list of all offers and the window.ManifoldEthereumProvider.selectedAddress() is undefined. So it never commits the setUserOfferBase. You then see “Place Offer” which passes increase: false to the contract and reverts cause the user already has an offer.

It does seem like if you are already connected, it works properly (because setOfferHistory gets run on initial load).

Could you dispatch setOfferHistory anytime state.walletAddress changes?

this.$store.dispatch(`${this.mmid}/setOfferHistory`, {
            root: true
          });

Can you see if 3.5.19 resolves your issue?

That works, thank you :slight_smile: