UNPKG

@mojito-inc/secondary-market

Version:

Mojito secondary market is the platform to purchase NFT.

2 lines (1 loc) 1.19 kB
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@mui/material/useMediaQuery");exports.default=()=>{const a=e((e=>e.breakpoints.down("sm"))),t=async e=>{var a;return await(null===(a=null==e?void 0:e.publicKey)||void 0===a?void 0:a.toBase58())||""};return{checkForMismatchWalletAddress:async(e,l,o)=>{var i,n;try{if("magic"===(null==l?void 0:l.toLowerCase())||a)return{isMismatched:!0,address:e};if("undefined"!=typeof window){const a=window,o=(null===(i=null==a?void 0:a.phantom)||void 0===i?void 0:i.solana)||(null==a?void 0:a.solana),r=null===(n=null==a?void 0:a.backpack)||void 0===n?void 0:n.solana;let d;"phantom"===(null==l?void 0:l.toLowerCase())&&(null==o?void 0:o.isPhantom)&&(null==o?void 0:o.isConnected)?d=await t(o):"backpack"===(null==l?void 0:l.toLowerCase())&&r&&(d=await t(r));return{isMismatched:d===e,address:d}}return{isMismatched:!0,address:e}}catch(a){throw null==o||o({key:"Additional Data",value:{currentAppWalletAddress:e,providerType:l}},{exception:a,hint:{data:{path:"Inside an useSolanaWalletPolling",currentAppWalletAddress:e,providerType:l}}}),Error("Unable to detect wallet. Please try again or reconnect the wallet.")}}}};