@xoxno/sdk-js 0.1.92-alpha → 0.1.93-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1 +1 @@
1
- var t,e,a,i,r,o,s,n,l,c,d,g,h,u,p,f,m,T,y,w,S,k,q={d:(t,e)=>{for(var a in e)q.o(e,a)&&!q.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},v={};q.d(v,{$C:()=>d,Yo:()=>T,LU:()=>c,sW:()=>W,X$:()=>M,JA:()=>u,he:()=>h,cO:()=>n,t7:()=>o,iQ:()=>g,MD:()=>F,Gq:()=>i,h4:()=>e,wT:()=>l,JM:()=>s,Vx:()=>y,O8:()=>t,s0:()=>$,o:()=>p,p4:()=>S,AQ:()=>f,J1:()=>w,g6:()=>a,cB:()=>m,Gt:()=>b,I_:()=>r,ZU:()=>k,Us:()=>V,GW:()=>I}),function(t){t.XO="xoxno",t.FM="frameit",t.DR="deadrare",t.KG="krogan"}(t||(t={})),function(t){t.Rank="metadata.rarity.rank",t.Attributes="metadata.attributes",t.Description="metadata.description",t.Name="name",t.OnSale="onSale",t.SaleInfo="saleInfo",t.Royalties="royalties",t.Identifier="identifier",t.Collection="collection",t.OriginalURL="url",t.Nonce="nonce",t.ContentType="originalMedia.contentType",t.WasProcessed="wasProcessed",t.AvifURL="avifUrl",t.WebpURL="webpUrl",t.Type="type"}(e||(e={})),function(t){t.PriceHighToLow="saleInfo.minBidShort desc",t.PriceLowToHigh="saleInfo.minBidShort asc",t.MaxPriceHighToLow="saleInfo.maxBidShort desc",t.MaxPriceLowToHigh="saleInfo.maxBidShort asc",t.BidPriceHighToLow="saleInfo.currentBidShort desc",t.BidPriceLowToHigh="saleInfo.currentBidShort asc",t.RarityHighToLow="metadata.rarity.rank desc",t.RarityLowToHigh="metadata.rarity.rank asc",t.NonceHighToLow="nonce desc",t.NonceLowToHigh="nonce asc",t.RecentListed="saleInfo.timestamp desc",t.OldestListed="saleInfo.timestamp asc",t.EndingLate="saleInfo.deadline desc",t.EndingSoon="saleInfo.deadline asc"}(a||(a={})),function(t){t.EndingLate="startTime desc",t.EndingSoon="startTime asc"}(i||(i={})),function(t){t.TotalVolumeHighToLow="statistics/tradeData/totalEgldVolume desc",t.FollowersHighToLow="statistics/other/followCount desc",t.IsVerifiedTrueToFalse="isVerified desc",t.HasImageTrueToFalse="profile desc",t.HasBannerTrueToFalse="banner desc"}(r||(r={})),function(t){t.WeekVolumeHighToLow="statistics.tradeData.weekEgldVolume desc",t.WeekVolumeLowToHigh="statistics.tradeData.weekEgldVolume asc",t.DailyVolumeHighToLow="statistics.tradeData.dayEgldVolume desc",t.DailyVolumeLowToHigh="statistics.tradeData.dayEgldVolume asc",t.TotalVolumeHighToLow="statistics.tradeData.totalEgldVolume desc",t.TotalVolumeLowToHigh="statistics.tradeData.totalEgldVolume asc",t.AvgVolumePriceHighToLow="statistics.tradeData.averageEgldPrice desc",t.AvgVolumePriceLowToHigh="statistics.tradeData.averageEgldPrice asc",t.ATHHighToLow="statistics.tradeData.athEgldPrice desc",t.ATHLowToHigh="statistics.tradeData.athEgldPrice asc",t.TotalTradesHighToLow="statistics.tradeData.totalTrades desc",t.TotalTradesLowToHigh="statistics.tradeData.totalTrades asc",t.SupplyHighToLow="statistics.other.nftCount desc",t.SupplyLowToHigh="statistics.other.nftCount asc",t.FollowersHighToLow="statistics.other.followCount desc",t.FollowersLowToHigh="statistics.other.followCount asc"}(o||(o={})),function(t){t.PriceHighToLow="priceShort desc",t.PriceLowToHigh="priceShort asc",t.OfferIdHighToLow="offerIddesc",t.OfferIdLowToHigh="offerId asc",t.RecentListed="timestamp desc",t.OldestListed="timestamp asc"}(s||(s={})),function(t){t.Profile="profile",t.Description="description",t.Creator="creator",t.Owner="owner",t.Socials="socials",t.Type="type",t.HasStaking="hasStaking",t.Name="name",t.Banner="banner",t.IsVerified="isVerified",t.IsMintable="isMintable",t.Statistics="statistics",t.Collection="collection"}(n||(n={})),function(t){t.Attributes="attributes",t.Collection="collection",t.Marketplace="marketplace",t.PaymentToken="paymentToken",t.LongPrice="price",t.ShortPrice="priceShort"}(l||(l={})),function(t){t.FixedPrice="FixedPrice",t.Auctions="Auctions",t.All="All",t.AllListed="AllListed"}(c||(c={})),function(t){t.ALL="all",t.Trade="trade",t.P2P="p2p",t.Staking="staking",t.Minting="minting"}(d||(d={})),function(t){t.TotalVolume="TotalVolume",t.TotalTrades="TotalTrades",t.DailyVolume="DailyVolume",t.Last2DaysVolume="Last2DaysVolume",t.DailyTrades="DailyTrades",t.Last2DaysTrades="Last2DaysTrades",t.WeekTrades="WeekTrades",t.LastWeekTrades="LastWeekTrades",t.WeekVolume="WeekVolume",t.LastWeekVolume="LastWeekVolume",t.WeeklyTradesMargin="WeeklyTradesMargin",t.DailyTradesMargin="DailyTradesMargin",t.WeeklyVolumeMargin="WeeklyVolumeMargin",t.DailyVolumeEgldMargin="DailyVolumeEgldMargin",t.CollectionAthTrade="CollectionAthTrade"}(g||(g={})),function(t){t.TradingStats="tradingStats"}(h||(h={})),function(t){t.ListedCountDesc="tradingStats.listedCount DESC",t.ListedCountAsc="tradingStats.listedCount ASC",t.FloorPriceDesc="tradingStats.floorPrice DESC",t.FloorPriceAsc="tradingStats.floorPrice ASC",t.TotalVolumeDesc="tradingStats.totalVolume DESC",t.TotalVolumeAsc="tradingStats.totalVolume ASC",t.TotalTradesDesc="tradingStats.totalTrades DESC",t.TotalTradesAsc="tradingStats.totalTrades ASC",t.AllTimeHighDesc="tradingStats.allTimeHigh.price DESC",t.AllTimeHighAsc="tradingStats.allTimeHigh.price ASC",t.DayVolumeDesc="tradingStats.day.volume DESC",t.DayVolumeAsc="tradingStats.day.volume ASC",t.DayVolumeMarginDesc="tradingStats.day.volumeMargin DESC",t.DayVolumeMarginAsc="tradingStats.day.volumeMargin ASC",t.DayTradesDesc="tradingStats.day.trades DESC",t.DayTradesAsc="tradingStats.day.trades ASC",t.DayTradesMarginDesc="tradingStats.day.tradesMargin DESC",t.DayTradesMarginAsc="tradingStats.day.tradesMargin ASC",t.WeekVolumeDesc="tradingStats.week.volume DESC",t.WeekVolumeAsc="tradingStats.week.volume ASC",t.WeekVolumeMarginDesc="tradingStats.week.volumeMargin DESC",t.WeekVolumeMarginAsc="tradingStats.week.volumeMargin ASC",t.WeekTradesDesc="tradingStats.week.trades DESC",t.WeekTradesAsc="tradingStats.week.trades ASC",t.WeekTradesMarginDesc="tradingStats.week.tradesMargin DESC",t.WeekTradesMarginAsc="tradingStats.week.tradesMargin ASC",t.MonthVolumeDesc="tradingStats.month.volume DESC",t.MonthVolumeAsc="tradingStats.month.volume ASC",t.MonthVolumeMarginDesc="tradingStats.month.volumeMargin DESC",t.MonthVolumeMarginAsc="tradingStats.month.volumeMargin ASC",t.MonthTradesDesc="tradingStats.month.trades DESC",t.MonthTradesAsc="tradingStats.month.trades ASC",t.MonthTradesMarginDesc="tradingStats.month.tradesMargin DESC",t.MonthTradesMarginAsc="tradingStats.month.tradesMargin ASC",t.YearVolumeDesc="tradingStats.year.volume DESC",t.YearVolumeAsc="tradingStats.year.volume ASC",t.YearVolumeMarginDesc="tradingStats.year.volumeMargin DESC",t.YearVolumeMarginAsc="tradingStats.year.volumeMargin ASC",t.YearTradesDesc="tradingStats.year.trades DESC",t.YearTradesAsc="tradingStats.year.trades ASC",t.YearTradesMarginDesc="tradingStats.year.tradesMargin DESC",t.YearTradesMarginAsc="tradingStats.year.tradesMargin ASC"}(u||(u={})),function(t){t.NFT_CREATE="nftCreate",t.NFT_BURN="nftBurn",t.NFT_UPDATE="nftUpdate",t.NFT_TRANSFER="nftTransfer",t.LISTING_CREATE="listingCreate",t.LISTING_WITHDRAW="listingWithdraw",t.LISTING_UPDATE="listingUpdate",t.AUCTION_BID="auctionBid",t.AUCTION_OUT_BID="auctionOutBid",t.OFFER_CREATE="offerCreate",t.OFFER_WITHDRAW="offerWithdraw",t.OFFER_REJECT="offerReject",t.GLOBAL_OFFER_CREATE="globalOfferCreate",t.GLOBAL_OFFER_WITHDRAW="globalOfferWithdraw",t.TRADE="trade",t.BULK_TRADE="bulkTrade",t.AUCTION_TRADE="auctionTrade",t.OTHER_TRADE="otherTrade",t.OFFER_TRADE="offerTrade",t.GLOBAL_OFFER_TRADE="globalOfferTrade",t.STAKE="stake",t.UN_STAKE="unStake"}(p||(p={})),function(t){t.PriceHighToLow="activityData.egldValue desc",t.PriceLowToHigh="activityData.egldValue asc",t.RecentPlaced="timestamp desc",t.OldestPlaced="timestamp asc"}(f||(f={})),function(t){t[t.attributes=0]="attributes",t[t.collection=1]="collection",t[t.offer_id=2]="offer_id",t[t.owner=3]="owner",t[t.short_price=4]="short_price",t[t.price=5]="price",t[t.id=6]="id",t[t.dataType=7]="dataType",t[t.marketplace=8]="marketplace",t[t.payment_token=9]="payment_token"}(m||(m={})),function(t){t[t.NftBid=0]="NftBid",t[t.Nft=1]="Nft",t[t.SftAll=2]="SftAll",t[t.SftOnePerPayment=3]="SftOnePerPayment"}(T||(T={})),function(t){t.Dynamic="Dynamic",t.Fixed="Fixed"}(y||(y={})),function(t){t.Duo="Duo",t.Single="Single",t.Perk="Perk"}(w||(w={})),function(t){t.Received="received",t.Placed="placed"}(S||(S={})),function(t){t.NonFungibleESDT="NonFungibleESDT"}(k||(k={}));const E="https://api.xoxno.com",A="erd1qqqqqqqqqqqqqpgq705fxpfrjne0tl3ece0rrspykq88mynn4kxs2cg43s",C="erd1qqqqqqqqqqqqqpgqd9rvv2n378e27jcts8vfwynpx0gfl5ufz6hqhfy0u0",D="erd1qqqqqqqqqqqqqpgq8xwzu82v8ex3h4ayl5lsvxqxnhecpwyvwe0sf2qj4e";var W;!function(t){t.MAINNET="1",t.DEVNET="D"}(W||(W={}));class I{static instance;apiUrl;apiKey;chain;config;constructor(t=E,e="",a=W.MAINNET){this.apiUrl=t,this.apiKey=e,this.chain=a,this.config=a===W.MAINNET?{XO_SC:"erd1qqqqqqqqqqqqqpgq6wegs2xkypfpync8mn2sa5cmpqjlvrhwz5nqgepyg8",FM_SC:A,DR_SC:C,KG_SC:D,Staking_SC:"erd1qqqqqqqqqqqqqpgqvpkd3g3uwludduv3797j54qt6c888wa59w2shntt6z",Manager_SC:"erd1qqqqqqqqqqqqqpgqg9fa0dmpn8fu3fnleeqn5zt8rl8mdqjkys5s2gtas7",P2P_SC:"erd1qqqqqqqqqqqqqpgq47y8hnct68v6asjv6gxem6h9rumn9frzah0skhxxt6"}:{XO_SC:"erd1qqqqqqqqqqqqqpgqn4fnwl43hhchz9emdy66eh5azzhl599zd8ssxjdyh3",FM_SC:A,DR_SC:C,KG_SC:D,Staking_SC:"erd1qqqqqqqqqqqqqpgqmkt2fvumf0zgum5qd0awl2l46x2pxdgmr5rswjr6r8",Manager_SC:"erd1qqqqqqqqqqqqqpgq6sysl7mga393a850xemfpawaqanf4da5d8ssp3xamn",P2P_SC:"erd1qqqqqqqqqqqqqpgqhuvnvkwwmucdzy3g7pvgvjumjfcgfwf69w2svch5c2"}}static init({apiUrl:t=E,apiKey:e="",chain:a=W.MAINNET}={}){return I.instance||(a==W.DEVNET&&(I.instance=new I("https://api-dev.xoxno.com",e,a)),I.instance=new I(t,e,a)),I.instance}fetchWithTimeout=async(t,e={},a=4e4)=>{const i={"Accept-Encoding":"gzip,deflate,br",Referer:"https://xoxno.sdk","User-Agent":"XOXNO/1.0/SDK",..."POST"===e.method?{"Content-Type":"application/json"}:{},...e.headers??{}},r=`${"string"==typeof t&&t.startsWith("/")?`${this.apiUrl}${t}`:t}${e.params?"?"+Object.keys(e.params).map((t=>`${t}=${encodeURIComponent(e.params[t])}`)).join("&"):""}`,o=new AbortController;setTimeout((()=>o.abort()),a);const s=await fetch(r,{...e,...e?.next&&e.next.revalidate?{}:{cache:"no-store"},signal:o.signal,...Object.keys(i).length?{headers:i}:{},method:e.method??"GET"});if(!s.ok)throw new Error((await s.json()).message.toString());return s.json()}}const x=async(t,e)=>{if(t.top&&t.top>35)throw new Error("Top cannot be greater than 35");const a=[];t.priceRange&&a.push({...t.priceRange,field:"activityData.egldValue"}),t.timestampRange&&a.push({...t.timestampRange,field:"timestamp"});const i={filters:{activityData:null==t.from&&null==t.to?{collection:t.collections,identifier:t.identifiers||void 0}:void 0,from:t.from,to:t.to,activityAddress:t.wallets||void 0,source:t.source||void 0,activityType:t.activityType||void 0,range:a},strictSelect:t.strictSelect,orderBy:t.orderBy,select:t.select,top:t.top||35,skip:t.skip||0},r=await e.fetchWithTimeout("/activity/query",{params:{filter:JSON.stringify(i)},next:{tags:["getActivity"],revalidate:180}});return{...r,getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)},empty:0===r.resources.length}},O=t=>/^[A-Z0-9]{3,10}-[a-z0-9]{6}$/.test(t),P=t=>/^[A-Za-z0-9]{3,10}-[A-Za-z0-9]{6}-[A-Za-z0-9]{2,5}(?:-\d+(?:-[A-Za-z0-9]+)?)?$/.test(t);class M{api;constructor(){this.api=I.init()}getCollectionProfile=async t=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/profile`,{next:{tags:["getCollectionProfile"],revalidate:30}})};getDailyTrending=async()=>await this.api.fetchWithTimeout("/nfts/getDailyTrending",{next:{tags:["getDailyTrending"],revalidate:180}});getCollectionFloorPrice=async(t,e="EGLD")=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);const a=await this.api.fetchWithTimeout(`/collection/${t}/floor-price`,{next:{tags:["getCollectionFloorPrice"]},params:{token:e}});return a?.price?a.price:0};getCollectionAttributes=async t=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/attributes`,{next:{tags:["getCollectionAttributes"],revalidate:180}})};getNFTs=async t=>{if(t?.collections?.forEach((t=>{if(!O(t))throw new Error("Invalid collection ticker: "+t)})),t.top&&t.top>35)throw new Error("Top cannot be greater than 35");const e=[];t.priceRange&&e.push({...t.priceRange,field:t.auctionType==c.Auctions?"saleInfo.currentBidShort":"saleInfo.minBidShort"}),t.rankRange&&e.push({...t.rankRange,field:"metadata.rarity.rank"});const a={filters:{dataType:t.dataType??["nft"],activeAuction:t.activeAuctions,collection:t.collections??[],onSale:t.onlyOnSale,saleInfo:{seller:t.listedBy||[],marketplace:t.listedOnlyOn||void 0,paymentToken:t.listedInToken||[],auctionType:t.auctionType==c.Auctions?["NftBid","SftAll"]:t.auctionType==c.FixedPrice?["Nft","SftOnePerPayment"]:t.auctionType==c.AllListed?["NftBid","SftAll","Nft","SftOnePerPayment"]:void 0},owner:t.ownedBy||[],verifiedOnly:t.onlyVerified||!1,metadata:{attributes:t.attributes||void 0},range:e,cp_staked:t.isStaked||void 0},applyNftExtraDetails:t.applyNftExtraDetails,orderBy:t.orderBy||[],select:t.onlySelectFields||[],includeCount:t.includeCount||!1,top:t.top||35,skip:t.skip||0};return{...await this.api.fetchWithTimeout("/nft/query",{params:{filter:JSON.stringify(a)},next:{tags:["getCollectionNFTs"]},cache:"no-store"}),getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)}}};suggestCollections=async t=>{if(t.top&&t.top>35)throw new Error("Top cannot be greater than 35");if(!t.name)throw new Error("Name is required");const e={name:t.name,top:t.top||35,skip:t.skip||0};return await this.api.fetchWithTimeout("/collection/search",{params:{filter:JSON.stringify(e)},next:{tags:["/collection/search"],revalidate:180}})};collectionListingsAnalytics=async t=>await this.api.fetchWithTimeout(`/collection/${t}/listings`,{next:{tags:["collection/${ticker}/listings"],revalidate:500}});getTradingActivity=async t=>await x(t,this.api);getCollections=async t=>{if(t?.top&&t.top>25)throw new Error("Top cannot be greater than 25");const e={skip:t?.skip||0,top:t?.top||25,select:t?.onlySelectFields||[],filters:{dataType:"collectionProfile",isMintable:t?.onlyMintable||void 0,...t?.collections&&t.collections.length>0&&{collection:t.collections}},orderBy:[t?.orderBy||"statistics.tradeData.weekEgldVolume desc"]},a=await this.api.fetchWithTimeout("/collection/query",{params:{filter:JSON.stringify(e)},next:{tags:["getCollections"],revalidate:180}});return{results:a,resultsCount:a.length,empty:0===a.length,getNextPagePayload:{...t,skip:(t?.skip||0)+(t?.top||25)},hasMoreResults:a.length>=(t?.top||25)}};getGlobalOffers=async t=>{if(t?.top&&t.top>25)throw new Error("Top cannot be greater than 25");const e={skip:t?.skip||0,top:t?.top||25,select:t?.onlySelectFields||[],filters:{collection:t?.collections||[],withAttributes:t?.withAttributes??!1,isActive:t?.onlyActive??!0,offerId:t?.offerIds,owner:t?.ownedBy,marketplace:t?.listedOnlyOn,range:t?.priceRange?{...t.priceRange,type:"priceShort"}:void 0,attributes:t?.attributes},orderBy:[t?.orderBy||s.PriceHighToLow]},a=await this.api.fetchWithTimeout("/collection/global-offer/query",{params:{filter:JSON.stringify(e)},next:{tags:["getGlobalOffers"],revalidate:12}});return{...a,getNextPagePayload:{...t,skip:(t?.top||25)+a.lastSkip}}};getCollectionVolume=async(t,e,a,i)=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/analytics/volume?startTime=${e}&endTime=${a}&bin=${i}`,{next:{tags:["getCollectionVolume"],revalidate:180}})};getMarketplaceVolume=async(t,e,a)=>await this.api.fetchWithTimeout(`/analytics/volume?startTime=${t}&endTime=${e}&bin=${a}`,{next:{tags:["getMarketplaceVolume"],revalidate:180}});getCollectionOwners=async t=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/holders`,{next:{tags:["getCollectionOwners"],revalidate:500}})};getExportOwners=async t=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/holders?exportHolders=true`,{next:{tags:["getExportOwners"]}})};getCollectionsStatistics=async t=>{if(t?.top&&t.top>25)throw new Error("Top cannot be greater than 25");return{...await this.api.fetchWithTimeout("/collection/stats/query",{params:{filter:JSON.stringify(t)},next:{tags:["collectionStatistics"],revalidate:12}}),getNextPagePayload:{...t,skip:t.skip+t.top}}};getCollectionStats=async t=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/stats`,{next:{tags:["collectionStatistics"],revalidate:12}})};getAwaitEmpty=async t=>new Promise((e=>{setTimeout((()=>{e(!0)}),t)}));getCollectionMintInfo=async({ticker:t,extra:e})=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/drop-info`,{next:{tags:[`/collection/${t}/drop-info`],revalidate:12},...e})};getCollectionRanks=async({ticker:t,extra:e})=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/ranks`,{next:{tags:[`/collection/${t}/ranks`],revalidate:60},...e})};getDropInfo=async({collectionTag:t,creatorTag:e,extra:a})=>await this.api.fetchWithTimeout(`/collection/${e}/${t}/drop-info`,{next:{tags:[`/collection/${e}/${t}/drop-info`],revalidate:12},...a});getCollectionGraphData=async(t,e,a,i)=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/analytics/volume`,{params:{startTime:e,endTime:a,bin:i},next:{tags:[`/collection/${t}/analytics/volume`],revalidate:60}})};getPinnedCollections=async()=>await this.api.fetchWithTimeout("/collection/pinned",{next:{tags:["/collection/pinned"],revalidate:60}});getDrops=async t=>{if(t?.collections?.forEach((t=>{if(!O(t))throw new Error("Invalid collection ticker: "+t)})),t.top&&t.top>35)throw new Error("Top cannot be greater than 35");const e=[];t.timeRange&&e.push({...t.timeRange,field:"startTime"});const a={filters:{collection:t.collections??[],verifiedOnly:t.onlyVerified||!1,mintToken:t.listedInToken||void 0,range:e},orderBy:t.orderBy||[],select:t.onlySelectFields||[],includeCount:t.includeCount||!1,top:t.top||35,skip:t.skip||0};return{...await this.api.fetchWithTimeout("/collection/drops/query",{params:{filter:JSON.stringify(a)},next:{tags:["/collection/drops/query"]},cache:"no-store"}),getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)}}};getCollectionStakingSummary=async({collection:t,extra:e})=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/staking/summary`,{...e})};getCollectionsFloor=async t=>{t?.forEach((t=>{if(!O(t))throw new Error("Invalid collection ticker: "+t)}));return await this.api.fetchWithTimeout("/collection/floor-price",{params:{collection:t.join(",")}})}}const L=t=>{let e=t.toString(16);return e.length%2!=0&&(e="0"+e),e},N=t=>{try{return t.includes("erd1")}catch(t){return!1}};class ${api;constructor(){this.api=I.init()}getNFTByIdentifier=async t=>{if(!P(t))throw new Error("Invalid identifier: "+t);return await this.api.fetchWithTimeout(`/nft/${t}`)};getNFTsOffers=async(t,e=0,a=25)=>{if(!P(t))throw new Error("Invalid identifier: "+t);return await this.api.fetchWithTimeout(`/nft/${t}/offers?skip=${e}&top=${a}`,{next:{tags:["getNFTsOffers"],revalidate:12}})};getNFTByCollectionAndNonce=async(t,e)=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);const a=await this.api.fetchWithTimeout(`/${((t,e)=>[t,L(e)].join("-"))(t,e)}`);return a};getNFTByCollectionAndNonceHex=async(t,e)=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);e.length%2!=0&&(e="0"+e);return await this.api.fetchWithTimeout(`/${[t,e].join("-")}`)};getTradingActivity=async t=>await x(t,this.api)}class V{api;collection;constructor(){this.api=I.init(),this.collection=new M}getUserProfile=async t=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/profile`)};getBulkAccounts=async t=>await this.api.fetchWithTimeout("/user/network-account",{method:"POST",body:JSON.stringify(t)});getUserAccount=async t=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/network-account`)};getUserTokenInventory=async t=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/token-inventory`)};getUserSummaryInventory=async t=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/inventory-summary`)};getUserNFTs=async t=>await this.collection.getNFTs(t);getUserOffers=async t=>{if(!N(t.address))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t.address}/offers`,{params:{type:t.type,skip:t.skip,top:t.top}})};suggestUsers=async t=>{if(t.top&&t.top>35)throw new Error("Top cannot be greater than 35");if(!t.name)throw new Error("Name is required");const e={name:t.name,top:t.top||35,skip:t.skip||0};return await this.api.fetchWithTimeout("/user/search",{params:{filter:JSON.stringify(e)},next:{tags:["/search/global"],revalidate:180}})};getTradingActivity=async t=>await x(t,this.api);getUserCreatorProfile=async t=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/creator/profile`)};getCreatorListings=async t=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/creator/listing`)};getUserStakingSummary=async t=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/staking/summary`)};getUserStakingAailable=async t=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/staking/available-pools`)};getUserCreatorInfo=async t=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/creator/details`)};getUserCollectionStaking=async(t,e)=>{if(!N(t))throw new Error("Invalid address");if(!O(e))throw new Error("Invalid collection ticker: "+e);return await this.api.fetchWithTimeout(`/user/${t}/staking/collection/${e}`)};getUserPoolStaking=async(t,e)=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/staking/pool/${e}`)};getAvailableNFTsForStakingPool=async(t,e)=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/staking/pool/${e}/nfts`)};getOwnedPoolsByAddress=async t=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/staking/owned-pools`)};getUserAnalyticsSummary=async t=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/analytics/volume`)};getUserFavoriteNFTs=async(t,e,a)=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/favorite/nfts`,{params:{top:e,skip:a}})};getUserFavoriteCollectionTickers=async t=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/favorite/collections`)};getIsCreatorRegistered=async t=>await this.api.fetchWithTimeout(`/user/${t}/creator/is-registered`);getUsersStats=async({top:t,skip:e,orderBy:a})=>{if(t&&t>35)throw new Error("Top cannot be greater than 35");return await this.api.fetchWithTimeout("/user/stats",{params:{top:t,skip:e,orderBy:a??"totalVolume"},next:{tags:["/user/stats"],revalidate:180}})};getAccountNFTsToStake=async(t,e)=>await this.api.fetchWithTimeout(`/user/${t}/staking/pool/${e}/available-nfts`,{next:{tags:[`/user/${t}/staking/pool/${e}/available-nfts`],revalidate:30}});getStakingCreatorInfo=async t=>await this.api.fetchWithTimeout(`/user/${t}/staking/creator`,{next:{tags:[`/user/${t}/staking/creator`],revalidate:30}});getUsersDrop=async({top:t,skip:e,address:a})=>{if(t&&t>35)throw new Error("Top cannot be greater than 35");if(a&&!N(a))throw new Error("Invalid address");return await this.api.fetchWithTimeout("/user/xoxno-drop",{params:{top:t,skip:e,...a?{address:a}:{}},next:{tags:["/user/xoxno-drop"],revalidate:30}})};getUserOwnerCollections=async t=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/staking/owned-collections`)};getRoyaltiesSharesCreator=async t=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/launchpad/${t}/shareholders/royalties`)};getMintSharesCreator=async(t,e)=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/launchpad/${t}/shareholders/collection/${e}`)}}class b{api;constructor(){this.api=I.init()}getPoolDetails=async t=>await this.api.fetchWithTimeout(`/pool/${t}/profile`)}class F{api;constructor(){this.api=I.init()}getTokensUsdPrice=async()=>await this.api.fetchWithTimeout("/tokens/usd-price");getAshSwapAmount=async({originalToken:t,originalTokenValue:e,paymentToken:a})=>await this.api.fetchWithTimeout("/ash/min-token-quantity",{params:{originalToken:t,originalTokenValue:e,paymentToken:a}});getFungibleTokens=async(t=[d.ALL],e)=>{let a={};e&&(a={identifier:e.join(",")}),t&&(a={...a,category:t.join(",")});return await this.api.fetchWithTimeout("/tokens",{params:a})};getGlobalGraphData=async(t,e,a)=>await this.api.fetchWithTimeout("/analytics/volume",{params:{startTime:t,endTime:e,bin:a},next:{tags:["/analytics/volume"],revalidate:60}});getAnalyticsOverview=async()=>await this.api.fetchWithTimeout("/analytics/overview",{next:{tags:["/analytics/overview"],revalidate:60}});suggestResults=async t=>{if(t.top&&t.top>35)throw new Error("Top cannot be greater than 35");if(!t.name)throw new Error("Name is required");const e={name:t.name,top:t.top||35,skip:t.skip||0};return await this.api.fetchWithTimeout("/search",{params:{filter:JSON.stringify(e)},next:{tags:["/search/global"],revalidate:180}})};getExploreStaking=async()=>await this.api.fetchWithTimeout("/collection/staking/explore",{next:{tags:["/collection/staking/explore"],revalidate:60}})}var R=v.$C,B=v.Yo,H=v.LU,U=v.sW,_=v.X$,j=v.JA,G=v.he,z=v.cO,J=v.t7,K=v.iQ,Y=v.MD,X=v.Gq,Z=v.h4,Q=v.wT,tt=v.JM,et=v.Vx,at=v.O8,it=v.s0,rt=v.o,ot=v.p4,st=v.AQ,nt=v.J1,lt=v.g6,ct=v.cB,dt=v.Gt,gt=v.I_,ht=v.ZU,ut=v.Us,pt=v.GW;export{R as AssetCategory,B as AuctionType,H as AuctionTypes,U as Chain,_ as CollectionModule,j as CollectionStatsOrderBy,G as CollectionStatsSelectFields,z as CollectionsFieldsToSelect,J as CollectionsOrderBy,K as CollectionsSummaryFilter,Y as CommonModule,X as DropsOderBy,Z as FieldsToSelect,Q as GlobalOfferFieldsToSelect,tt as GlobalOfferOrderBy,et as IssuingType,at as Marketplace,it as NFTModule,rt as NftActivityType,ot as OfferType,st as OrderByTradingActivity,nt as PoolType,lt as SearchOrderBy,ct as SelectFieldsTradingActivity,dt as StakingModule,gt as SuggestOrderBy,ht as Type,ut as UserModule,pt as XOXNOClient};
1
+ var t,e,a,i,r,o,s,n,l,c,d,h,g,u,p,f,T,m,y,w,S,k,q={d:(t,e)=>{for(var a in e)q.o(e,a)&&!q.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},v={};q.d(v,{$C:()=>d,Yo:()=>m,LU:()=>c,sW:()=>W,X$:()=>M,JA:()=>u,he:()=>g,cO:()=>n,t7:()=>o,iQ:()=>h,MD:()=>F,Gq:()=>i,h4:()=>e,wT:()=>l,JM:()=>s,Vx:()=>y,O8:()=>t,s0:()=>$,o:()=>p,p4:()=>S,AQ:()=>f,J1:()=>w,g6:()=>a,cB:()=>T,Gt:()=>b,I_:()=>r,ZU:()=>k,Us:()=>V,GW:()=>I}),function(t){t.XO="xoxno",t.FM="frameit",t.DR="deadrare",t.KG="krogan"}(t||(t={})),function(t){t.Rank="metadata.rarity.rank",t.Attributes="metadata.attributes",t.Description="metadata.description",t.Name="name",t.OnSale="onSale",t.SaleInfo="saleInfo",t.Royalties="royalties",t.Identifier="identifier",t.Collection="collection",t.OriginalURL="url",t.Nonce="nonce",t.ContentType="originalMedia.contentType",t.WasProcessed="wasProcessed",t.AvifURL="avifUrl",t.WebpURL="webpUrl",t.Type="type"}(e||(e={})),function(t){t.PriceHighToLow="saleInfo.minBidShort desc",t.PriceLowToHigh="saleInfo.minBidShort asc",t.MaxPriceHighToLow="saleInfo.maxBidShort desc",t.MaxPriceLowToHigh="saleInfo.maxBidShort asc",t.BidPriceHighToLow="saleInfo.currentBidShort desc",t.BidPriceLowToHigh="saleInfo.currentBidShort asc",t.RarityHighToLow="metadata.rarity.rank desc",t.RarityLowToHigh="metadata.rarity.rank asc",t.NonceHighToLow="nonce desc",t.NonceLowToHigh="nonce asc",t.RecentListed="saleInfo.timestamp desc",t.OldestListed="saleInfo.timestamp asc",t.EndingLate="saleInfo.deadline desc",t.EndingSoon="saleInfo.deadline asc"}(a||(a={})),function(t){t.EndingLate="startTime desc",t.EndingSoon="startTime asc"}(i||(i={})),function(t){t.TotalVolumeHighToLow="statistics/tradeData/totalEgldVolume desc",t.FollowersHighToLow="statistics/other/followCount desc",t.IsVerifiedTrueToFalse="isVerified desc",t.HasImageTrueToFalse="profile desc",t.HasBannerTrueToFalse="banner desc"}(r||(r={})),function(t){t.WeekVolumeHighToLow="statistics.tradeData.weekEgldVolume desc",t.WeekVolumeLowToHigh="statistics.tradeData.weekEgldVolume asc",t.DailyVolumeHighToLow="statistics.tradeData.dayEgldVolume desc",t.DailyVolumeLowToHigh="statistics.tradeData.dayEgldVolume asc",t.TotalVolumeHighToLow="statistics.tradeData.totalEgldVolume desc",t.TotalVolumeLowToHigh="statistics.tradeData.totalEgldVolume asc",t.AvgVolumePriceHighToLow="statistics.tradeData.averageEgldPrice desc",t.AvgVolumePriceLowToHigh="statistics.tradeData.averageEgldPrice asc",t.ATHHighToLow="statistics.tradeData.athEgldPrice desc",t.ATHLowToHigh="statistics.tradeData.athEgldPrice asc",t.TotalTradesHighToLow="statistics.tradeData.totalTrades desc",t.TotalTradesLowToHigh="statistics.tradeData.totalTrades asc",t.SupplyHighToLow="statistics.other.nftCount desc",t.SupplyLowToHigh="statistics.other.nftCount asc",t.FollowersHighToLow="statistics.other.followCount desc",t.FollowersLowToHigh="statistics.other.followCount asc"}(o||(o={})),function(t){t.PriceHighToLow="priceShort desc",t.PriceLowToHigh="priceShort asc",t.OfferIdHighToLow="offerIddesc",t.OfferIdLowToHigh="offerId asc",t.RecentListed="timestamp desc",t.OldestListed="timestamp asc"}(s||(s={})),function(t){t.Profile="profile",t.Description="description",t.Creator="creator",t.Owner="owner",t.Socials="socials",t.Type="type",t.HasStaking="hasStaking",t.Name="name",t.Banner="banner",t.IsVerified="isVerified",t.IsMintable="isMintable",t.Statistics="statistics",t.Collection="collection"}(n||(n={})),function(t){t.Attributes="attributes",t.Collection="collection",t.Marketplace="marketplace",t.PaymentToken="paymentToken",t.LongPrice="price",t.ShortPrice="priceShort"}(l||(l={})),function(t){t.FixedPrice="FixedPrice",t.Auctions="Auctions",t.All="All",t.AllListed="AllListed"}(c||(c={})),function(t){t.ALL="all",t.Trade="trade",t.P2P="p2p",t.Staking="staking",t.Minting="minting"}(d||(d={})),function(t){t.TotalVolume="TotalVolume",t.TotalTrades="TotalTrades",t.DailyVolume="DailyVolume",t.Last2DaysVolume="Last2DaysVolume",t.DailyTrades="DailyTrades",t.Last2DaysTrades="Last2DaysTrades",t.WeekTrades="WeekTrades",t.LastWeekTrades="LastWeekTrades",t.WeekVolume="WeekVolume",t.LastWeekVolume="LastWeekVolume",t.WeeklyTradesMargin="WeeklyTradesMargin",t.DailyTradesMargin="DailyTradesMargin",t.WeeklyVolumeMargin="WeeklyVolumeMargin",t.DailyVolumeEgldMargin="DailyVolumeEgldMargin",t.CollectionAthTrade="CollectionAthTrade"}(h||(h={})),function(t){t.TradingStats="tradingStats"}(g||(g={})),function(t){t.ListedCountDesc="tradingStats.listedCount DESC",t.ListedCountAsc="tradingStats.listedCount ASC",t.FloorPriceDesc="tradingStats.floorPrice DESC",t.FloorPriceAsc="tradingStats.floorPrice ASC",t.TotalVolumeDesc="tradingStats.totalVolume DESC",t.TotalVolumeAsc="tradingStats.totalVolume ASC",t.TotalTradesDesc="tradingStats.totalTrades DESC",t.TotalTradesAsc="tradingStats.totalTrades ASC",t.AllTimeHighDesc="tradingStats.allTimeHigh.price DESC",t.AllTimeHighAsc="tradingStats.allTimeHigh.price ASC",t.DayVolumeDesc="tradingStats.day.volume DESC",t.DayVolumeAsc="tradingStats.day.volume ASC",t.DayVolumeMarginDesc="tradingStats.day.volumeMargin DESC",t.DayVolumeMarginAsc="tradingStats.day.volumeMargin ASC",t.DayTradesDesc="tradingStats.day.trades DESC",t.DayTradesAsc="tradingStats.day.trades ASC",t.DayTradesMarginDesc="tradingStats.day.tradesMargin DESC",t.DayTradesMarginAsc="tradingStats.day.tradesMargin ASC",t.WeekVolumeDesc="tradingStats.week.volume DESC",t.WeekVolumeAsc="tradingStats.week.volume ASC",t.WeekVolumeMarginDesc="tradingStats.week.volumeMargin DESC",t.WeekVolumeMarginAsc="tradingStats.week.volumeMargin ASC",t.WeekTradesDesc="tradingStats.week.trades DESC",t.WeekTradesAsc="tradingStats.week.trades ASC",t.WeekTradesMarginDesc="tradingStats.week.tradesMargin DESC",t.WeekTradesMarginAsc="tradingStats.week.tradesMargin ASC",t.MonthVolumeDesc="tradingStats.month.volume DESC",t.MonthVolumeAsc="tradingStats.month.volume ASC",t.MonthVolumeMarginDesc="tradingStats.month.volumeMargin DESC",t.MonthVolumeMarginAsc="tradingStats.month.volumeMargin ASC",t.MonthTradesDesc="tradingStats.month.trades DESC",t.MonthTradesAsc="tradingStats.month.trades ASC",t.MonthTradesMarginDesc="tradingStats.month.tradesMargin DESC",t.MonthTradesMarginAsc="tradingStats.month.tradesMargin ASC",t.YearVolumeDesc="tradingStats.year.volume DESC",t.YearVolumeAsc="tradingStats.year.volume ASC",t.YearVolumeMarginDesc="tradingStats.year.volumeMargin DESC",t.YearVolumeMarginAsc="tradingStats.year.volumeMargin ASC",t.YearTradesDesc="tradingStats.year.trades DESC",t.YearTradesAsc="tradingStats.year.trades ASC",t.YearTradesMarginDesc="tradingStats.year.tradesMargin DESC",t.YearTradesMarginAsc="tradingStats.year.tradesMargin ASC"}(u||(u={})),function(t){t.NFT_CREATE="nftCreate",t.NFT_BURN="nftBurn",t.NFT_UPDATE="nftUpdate",t.NFT_TRANSFER="nftTransfer",t.LISTING_CREATE="listingCreate",t.LISTING_WITHDRAW="listingWithdraw",t.LISTING_UPDATE="listingUpdate",t.AUCTION_BID="auctionBid",t.AUCTION_OUT_BID="auctionOutBid",t.OFFER_CREATE="offerCreate",t.OFFER_WITHDRAW="offerWithdraw",t.OFFER_REJECT="offerReject",t.GLOBAL_OFFER_CREATE="globalOfferCreate",t.GLOBAL_OFFER_WITHDRAW="globalOfferWithdraw",t.TRADE="trade",t.BULK_TRADE="bulkTrade",t.AUCTION_TRADE="auctionTrade",t.OTHER_TRADE="otherTrade",t.OFFER_TRADE="offerTrade",t.GLOBAL_OFFER_TRADE="globalOfferTrade",t.STAKE="stake",t.UN_STAKE="unStake"}(p||(p={})),function(t){t.PriceHighToLow="activityData.egldValue desc",t.PriceLowToHigh="activityData.egldValue asc",t.RecentPlaced="timestamp desc",t.OldestPlaced="timestamp asc"}(f||(f={})),function(t){t[t.attributes=0]="attributes",t[t.collection=1]="collection",t[t.offer_id=2]="offer_id",t[t.owner=3]="owner",t[t.short_price=4]="short_price",t[t.price=5]="price",t[t.id=6]="id",t[t.dataType=7]="dataType",t[t.marketplace=8]="marketplace",t[t.payment_token=9]="payment_token"}(T||(T={})),function(t){t[t.NftBid=0]="NftBid",t[t.Nft=1]="Nft",t[t.SftAll=2]="SftAll",t[t.SftOnePerPayment=3]="SftOnePerPayment"}(m||(m={})),function(t){t.Dynamic="Dynamic",t.Fixed="Fixed"}(y||(y={})),function(t){t.Duo="Duo",t.Single="Single",t.Perk="Perk"}(w||(w={})),function(t){t.Received="received",t.Placed="placed"}(S||(S={})),function(t){t.NonFungibleESDT="NonFungibleESDT"}(k||(k={}));const E="https://api.xoxno.com",A="erd1qqqqqqqqqqqqqpgq705fxpfrjne0tl3ece0rrspykq88mynn4kxs2cg43s",C="erd1qqqqqqqqqqqqqpgqd9rvv2n378e27jcts8vfwynpx0gfl5ufz6hqhfy0u0",D="erd1qqqqqqqqqqqqqpgq8xwzu82v8ex3h4ayl5lsvxqxnhecpwyvwe0sf2qj4e";var W;!function(t){t.MAINNET="1",t.DEVNET="D"}(W||(W={}));class I{static instance;apiUrl;apiKey;chain;config;constructor(t=E,e="",a=W.MAINNET){this.apiUrl=t,this.apiKey=e,this.chain=a,this.config=a===W.MAINNET?{XO_SC:"erd1qqqqqqqqqqqqqpgq6wegs2xkypfpync8mn2sa5cmpqjlvrhwz5nqgepyg8",FM_SC:A,DR_SC:C,KG_SC:D,Staking_SC:"erd1qqqqqqqqqqqqqpgqvpkd3g3uwludduv3797j54qt6c888wa59w2shntt6z",Manager_SC:"erd1qqqqqqqqqqqqqpgqg9fa0dmpn8fu3fnleeqn5zt8rl8mdqjkys5s2gtas7",P2P_SC:"erd1qqqqqqqqqqqqqpgq47y8hnct68v6asjv6gxem6h9rumn9frzah0skhxxt6"}:{XO_SC:"erd1qqqqqqqqqqqqqpgql0dnz6n5hpuw8cptlt00khd0nn4ja8eadsfq2xrqw4",FM_SC:A,DR_SC:C,KG_SC:D,Staking_SC:"erd1qqqqqqqqqqqqqpgqsc5hnewwpep8qq0d7kjjzrquapuucrygah0s85zres",Manager_SC:"erd1qqqqqqqqqqqqqpgqluclyhfsa2uw7q9cjwd8knk989hg57u8ah0slq2nlr",P2P_SC:"erd1qqqqqqqqqqqqqpgqfja7ukpngrun78ueq583l0vd6aj4ekhrah0sa9wyrv"}}static init({apiUrl:t=E,apiKey:e="",chain:a=W.MAINNET}={}){if(!I.instance){if(a==W.DEVNET)return I.instance=new I(t??"https://devnet-api.xoxno.com",e,a),I.instance;I.instance=new I(t,e,a)}return I.instance}fetchWithTimeout=async(t,e={},a=4e4)=>{const i={"Accept-Encoding":"gzip,deflate,br",Referer:"https://xoxno.sdk","User-Agent":"XOXNO/1.0/SDK",..."POST"===e.method?{"Content-Type":"application/json"}:{},...e.headers??{}},r=`${"string"==typeof t&&t.startsWith("/")?`${this.apiUrl}${t}`:t}${e.params?"?"+Object.keys(e.params).map((t=>`${t}=${encodeURIComponent(e.params[t])}`)).join("&"):""}`,o=new AbortController;setTimeout((()=>o.abort()),a);const s=await fetch(r,{...e,...e?.next&&e.next.revalidate?{}:{cache:"no-store"},signal:o.signal,...Object.keys(i).length?{headers:i}:{},method:e.method??"GET"});if(!s.ok)throw new Error((await s.json()).message.toString());return s.json()}}const x=async(t,e)=>{if(t.top&&t.top>35)throw new Error("Top cannot be greater than 35");const a=[];t.priceRange&&a.push({...t.priceRange,field:"activityData.egldValue"}),t.timestampRange&&a.push({...t.timestampRange,field:"timestamp"});const i={filters:{activityData:null==t.from&&null==t.to?{collection:t.collections,identifier:t.identifiers||void 0}:void 0,from:t.from,to:t.to,activityAddress:t.wallets||void 0,source:t.source||void 0,activityType:t.activityType||void 0,range:a},strictSelect:t.strictSelect,orderBy:t.orderBy,select:t.select,top:t.top||35,skip:t.skip||0},r=await e.fetchWithTimeout("/activity/query",{params:{filter:JSON.stringify(i)},next:{tags:["getActivity"],revalidate:180}});return{...r,getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)},empty:0===r.resources.length}},O=t=>/^[A-Z0-9]{3,10}-[a-z0-9]{6}$/.test(t),P=t=>/^[A-Za-z0-9]{3,10}-[A-Za-z0-9]{6}-[A-Za-z0-9]{2,5}(?:-\d+(?:-[A-Za-z0-9]+)?)?$/.test(t);class M{api;constructor(){this.api=I.init()}getCollectionProfile=async t=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/profile`,{next:{tags:["getCollectionProfile"],revalidate:30}})};getDailyTrending=async()=>await this.api.fetchWithTimeout("/nfts/getDailyTrending",{next:{tags:["getDailyTrending"],revalidate:180}});getCollectionFloorPrice=async(t,e="EGLD")=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);const a=await this.api.fetchWithTimeout(`/collection/${t}/floor-price`,{next:{tags:["getCollectionFloorPrice"]},params:{token:e}});return a?.price?a.price:0};getCollectionAttributes=async t=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/attributes`,{next:{tags:["getCollectionAttributes"],revalidate:180}})};getNFTs=async t=>{if(t?.collections?.forEach((t=>{if(!O(t))throw new Error("Invalid collection ticker: "+t)})),t.top&&t.top>35)throw new Error("Top cannot be greater than 35");const e=[];t.priceRange&&e.push({...t.priceRange,field:t.auctionType==c.Auctions?"saleInfo.currentBidShort":"saleInfo.minBidShort"}),t.rankRange&&e.push({...t.rankRange,field:"metadata.rarity.rank"});const a={filters:{dataType:t.dataType??["nft"],activeAuction:t.activeAuctions,collection:t.collections??[],onSale:t.onlyOnSale,saleInfo:{seller:t.listedBy||[],marketplace:t.listedOnlyOn||void 0,paymentToken:t.listedInToken||[],auctionType:t.auctionType==c.Auctions?["NftBid","SftAll"]:t.auctionType==c.FixedPrice?["Nft","SftOnePerPayment"]:t.auctionType==c.AllListed?["NftBid","SftAll","Nft","SftOnePerPayment"]:void 0},owner:t.ownedBy||[],verifiedOnly:t.onlyVerified||!1,metadata:{attributes:t.attributes||void 0},range:e,cp_staked:t.isStaked||void 0},applyNftExtraDetails:t.applyNftExtraDetails,orderBy:t.orderBy||[],select:t.onlySelectFields||[],includeCount:t.includeCount||!1,top:t.top||35,skip:t.skip||0};return{...await this.api.fetchWithTimeout("/nft/query",{params:{filter:JSON.stringify(a)},next:{tags:["getCollectionNFTs"]},cache:"no-store"}),getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)}}};suggestCollections=async t=>{if(t.top&&t.top>35)throw new Error("Top cannot be greater than 35");if(!t.name)throw new Error("Name is required");const e={name:t.name,top:t.top||35,skip:t.skip||0};return await this.api.fetchWithTimeout("/collection/search",{params:{filter:JSON.stringify(e)},next:{tags:["/collection/search"],revalidate:180}})};collectionListingsAnalytics=async t=>await this.api.fetchWithTimeout(`/collection/${t}/listings`,{next:{tags:["collection/${ticker}/listings"],revalidate:500}});getTradingActivity=async t=>await x(t,this.api);getCollections=async t=>{if(t?.top&&t.top>25)throw new Error("Top cannot be greater than 25");const e={skip:t?.skip||0,top:t?.top||25,select:t?.onlySelectFields||[],filters:{dataType:"collectionProfile",isMintable:t?.onlyMintable||void 0,...t?.collections&&t.collections.length>0&&{collection:t.collections}},orderBy:[t?.orderBy||"statistics.tradeData.weekEgldVolume desc"]},a=await this.api.fetchWithTimeout("/collection/query",{params:{filter:JSON.stringify(e)},next:{tags:["getCollections"],revalidate:180}});return{results:a,resultsCount:a.length,empty:0===a.length,getNextPagePayload:{...t,skip:(t?.skip||0)+(t?.top||25)},hasMoreResults:a.length>=(t?.top||25)}};getGlobalOffers=async t=>{if(t?.top&&t.top>25)throw new Error("Top cannot be greater than 25");const e={skip:t?.skip||0,top:t?.top||25,select:t?.onlySelectFields||[],filters:{collection:t?.collections||[],withAttributes:t?.withAttributes??!1,isActive:t?.onlyActive??!0,offerId:t?.offerIds,owner:t?.ownedBy,marketplace:t?.listedOnlyOn,range:t?.priceRange?{...t.priceRange,type:"priceShort"}:void 0,attributes:t?.attributes},orderBy:[t?.orderBy||s.PriceHighToLow]},a=await this.api.fetchWithTimeout("/collection/global-offer/query",{params:{filter:JSON.stringify(e)},next:{tags:["getGlobalOffers"],revalidate:12}});return{...a,getNextPagePayload:{...t,skip:(t?.top||25)+a.lastSkip}}};getCollectionVolume=async(t,e,a,i)=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/analytics/volume?startTime=${e}&endTime=${a}&bin=${i}`,{next:{tags:["getCollectionVolume"],revalidate:180}})};getMarketplaceVolume=async(t,e,a)=>await this.api.fetchWithTimeout(`/analytics/volume?startTime=${t}&endTime=${e}&bin=${a}`,{next:{tags:["getMarketplaceVolume"],revalidate:180}});getCollectionOwners=async t=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/holders`,{next:{tags:["getCollectionOwners"],revalidate:500}})};getExportOwners=async t=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/holders?exportHolders=true`,{next:{tags:["getExportOwners"]}})};getCollectionsStatistics=async t=>{if(t?.top&&t.top>25)throw new Error("Top cannot be greater than 25");return{...await this.api.fetchWithTimeout("/collection/stats/query",{params:{filter:JSON.stringify(t)},next:{tags:["collectionStatistics"],revalidate:12}}),getNextPagePayload:{...t,skip:t.skip+t.top}}};getCollectionStats=async t=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/stats`,{next:{tags:["collectionStatistics"],revalidate:12}})};getAwaitEmpty=async t=>new Promise((e=>{setTimeout((()=>{e(!0)}),t)}));getCollectionMintInfo=async({ticker:t,extra:e})=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/drop-info`,{next:{tags:[`/collection/${t}/drop-info`],revalidate:12},...e})};getCollectionRanks=async({ticker:t,extra:e})=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/ranks`,{next:{tags:[`/collection/${t}/ranks`],revalidate:60},...e})};getDropInfo=async({collectionTag:t,creatorTag:e,extra:a})=>await this.api.fetchWithTimeout(`/collection/${e}/${t}/drop-info`,{next:{tags:[`/collection/${e}/${t}/drop-info`],revalidate:12},...a});getCollectionGraphData=async(t,e,a,i)=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/analytics/volume`,{params:{startTime:e,endTime:a,bin:i},next:{tags:[`/collection/${t}/analytics/volume`],revalidate:60}})};getPinnedCollections=async()=>await this.api.fetchWithTimeout("/collection/pinned",{next:{tags:["/collection/pinned"],revalidate:60}});getDrops=async t=>{if(t?.collections?.forEach((t=>{if(!O(t))throw new Error("Invalid collection ticker: "+t)})),t.top&&t.top>35)throw new Error("Top cannot be greater than 35");const e=[];t.timeRange&&e.push({...t.timeRange,field:"startTime"});const a={filters:{collection:t.collections??[],verifiedOnly:t.onlyVerified||!1,mintToken:t.listedInToken||void 0,range:e},orderBy:t.orderBy||[],select:t.onlySelectFields||[],includeCount:t.includeCount||!1,top:t.top||35,skip:t.skip||0};return{...await this.api.fetchWithTimeout("/collection/drops/query",{params:{filter:JSON.stringify(a)},next:{tags:["/collection/drops/query"]},cache:"no-store"}),getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)}}};getCollectionStakingSummary=async({collection:t,extra:e})=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/staking/summary`,{...e})};getCollectionsFloor=async t=>{t?.forEach((t=>{if(!O(t))throw new Error("Invalid collection ticker: "+t)}));return await this.api.fetchWithTimeout("/collection/floor-price",{params:{collection:t.join(",")}})}}const L=t=>{let e=t.toString(16);return e.length%2!=0&&(e="0"+e),e},N=t=>{try{return t.includes("erd1")}catch(t){return!1}};class ${api;constructor(){this.api=I.init()}getNFTByIdentifier=async t=>{if(!P(t))throw new Error("Invalid identifier: "+t);return await this.api.fetchWithTimeout(`/nft/${t}`)};getNFTsOffers=async(t,e=0,a=25)=>{if(!P(t))throw new Error("Invalid identifier: "+t);return await this.api.fetchWithTimeout(`/nft/${t}/offers?skip=${e}&top=${a}`,{next:{tags:["getNFTsOffers"],revalidate:12}})};getNFTByCollectionAndNonce=async(t,e)=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);const a=await this.api.fetchWithTimeout(`/${((t,e)=>[t,L(e)].join("-"))(t,e)}`);return a};getNFTByCollectionAndNonceHex=async(t,e)=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);e.length%2!=0&&(e="0"+e);return await this.api.fetchWithTimeout(`/${[t,e].join("-")}`)};getTradingActivity=async t=>await x(t,this.api)}class V{api;collection;constructor(){this.api=I.init(),this.collection=new M}getUserProfile=async t=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/profile`)};getBulkAccounts=async t=>await this.api.fetchWithTimeout("/user/network-account",{method:"POST",body:JSON.stringify(t)});getUserAccount=async t=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/network-account`)};getUserTokenInventory=async t=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/token-inventory`)};getUserSummaryInventory=async t=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/inventory-summary`)};getUserNFTs=async t=>await this.collection.getNFTs(t);getUserOffers=async t=>{if(!N(t.address))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t.address}/offers`,{params:{type:t.type,skip:t.skip,top:t.top}})};suggestUsers=async t=>{if(t.top&&t.top>35)throw new Error("Top cannot be greater than 35");if(!t.name)throw new Error("Name is required");const e={name:t.name,top:t.top||35,skip:t.skip||0};return await this.api.fetchWithTimeout("/user/search",{params:{filter:JSON.stringify(e)},next:{tags:["/search/global"],revalidate:180}})};getTradingActivity=async t=>await x(t,this.api);getUserCreatorProfile=async t=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/creator/profile`)};getCreatorListings=async t=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/creator/listing`)};getUserStakingSummary=async t=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/staking/summary`)};getUserStakingAailable=async t=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/staking/available-pools`)};getUserCreatorInfo=async t=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/creator/details`)};getUserCollectionStaking=async(t,e)=>{if(!N(t))throw new Error("Invalid address");if(!O(e))throw new Error("Invalid collection ticker: "+e);return await this.api.fetchWithTimeout(`/user/${t}/staking/collection/${e}`)};getUserPoolStaking=async(t,e)=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/staking/pool/${e}`)};getAvailableNFTsForStakingPool=async(t,e)=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/staking/pool/${e}/nfts`)};getOwnedPoolsByAddress=async t=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/staking/owned-pools`)};getUserAnalyticsSummary=async t=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/analytics/volume`)};getUserFavoriteNFTs=async(t,e,a)=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/favorite/nfts`,{params:{top:e,skip:a}})};getUserFavoriteCollectionTickers=async t=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/favorite/collections`)};getIsCreatorRegistered=async t=>await this.api.fetchWithTimeout(`/user/${t}/creator/is-registered`);getUsersStats=async({top:t,skip:e,orderBy:a})=>{if(t&&t>35)throw new Error("Top cannot be greater than 35");return await this.api.fetchWithTimeout("/user/stats",{params:{top:t,skip:e,orderBy:a??"totalVolume"},next:{tags:["/user/stats"],revalidate:180}})};getAccountNFTsToStake=async(t,e)=>await this.api.fetchWithTimeout(`/user/${t}/staking/pool/${e}/available-nfts`,{next:{tags:[`/user/${t}/staking/pool/${e}/available-nfts`],revalidate:30}});getStakingCreatorInfo=async t=>await this.api.fetchWithTimeout(`/user/${t}/staking/creator`,{next:{tags:[`/user/${t}/staking/creator`],revalidate:30}});getUsersDrop=async({top:t,skip:e,address:a})=>{if(t&&t>35)throw new Error("Top cannot be greater than 35");if(a&&!N(a))throw new Error("Invalid address");return await this.api.fetchWithTimeout("/user/xoxno-drop",{params:{top:t,skip:e,...a?{address:a}:{}},next:{tags:["/user/xoxno-drop"],revalidate:30}})};getUserOwnerCollections=async t=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/staking/owned-collections`)};getRoyaltiesSharesCreator=async t=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/launchpad/${t}/shareholders/royalties`)};getMintSharesCreator=async(t,e)=>{if(!N(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/launchpad/${t}/shareholders/collection/${e}`)}}class b{api;constructor(){this.api=I.init()}getPoolDetails=async t=>await this.api.fetchWithTimeout(`/pool/${t}/profile`)}class F{api;constructor(){this.api=I.init()}getTokensUsdPrice=async()=>await this.api.fetchWithTimeout("/tokens/usd-price");getAshSwapAmount=async({originalToken:t,originalTokenValue:e,paymentToken:a})=>await this.api.fetchWithTimeout("/ash/min-token-quantity",{params:{originalToken:t,originalTokenValue:e,paymentToken:a}});getFungibleTokens=async(t=[d.ALL],e)=>{let a={};e&&(a={identifier:e.join(",")}),t&&(a={...a,category:t.join(",")});return await this.api.fetchWithTimeout("/tokens",{params:a})};getGlobalGraphData=async(t,e,a)=>await this.api.fetchWithTimeout("/analytics/volume",{params:{startTime:t,endTime:e,bin:a},next:{tags:["/analytics/volume"],revalidate:60}});getAnalyticsOverview=async()=>await this.api.fetchWithTimeout("/analytics/overview",{next:{tags:["/analytics/overview"],revalidate:60}});suggestResults=async t=>{if(t.top&&t.top>35)throw new Error("Top cannot be greater than 35");if(!t.name)throw new Error("Name is required");const e={name:t.name,top:t.top||35,skip:t.skip||0};return await this.api.fetchWithTimeout("/search",{params:{filter:JSON.stringify(e)},next:{tags:["/search/global"],revalidate:180}})};getExploreStaking=async()=>await this.api.fetchWithTimeout("/collection/staking/explore",{next:{tags:["/collection/staking/explore"],revalidate:60}})}var R=v.$C,B=v.Yo,H=v.LU,U=v.sW,_=v.X$,j=v.JA,G=v.he,J=v.cO,z=v.t7,K=v.iQ,Y=v.MD,X=v.Gq,Z=v.h4,Q=v.wT,tt=v.JM,et=v.Vx,at=v.O8,it=v.s0,rt=v.o,ot=v.p4,st=v.AQ,nt=v.J1,lt=v.g6,ct=v.cB,dt=v.Gt,ht=v.I_,gt=v.ZU,ut=v.Us,pt=v.GW;export{R as AssetCategory,B as AuctionType,H as AuctionTypes,U as Chain,_ as CollectionModule,j as CollectionStatsOrderBy,G as CollectionStatsSelectFields,J as CollectionsFieldsToSelect,z as CollectionsOrderBy,K as CollectionsSummaryFilter,Y as CommonModule,X as DropsOderBy,Z as FieldsToSelect,Q as GlobalOfferFieldsToSelect,tt as GlobalOfferOrderBy,et as IssuingType,at as Marketplace,it as NFTModule,rt as NftActivityType,ot as OfferType,st as OrderByTradingActivity,nt as PoolType,lt as SearchOrderBy,ct as SelectFieldsTradingActivity,dt as StakingModule,ht as SuggestOrderBy,gt as Type,ut as UserModule,pt as XOXNOClient};
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["@xoxno/sdk-js"]=e():t["@xoxno/sdk-js"]=e()}(this,(()=>(()=>{"use strict";var t,e,i,a,r,o,n,s,l,c,d,g,h,u,p,f,m,y,T,w,S,k,q={d:(t,e)=>{for(var i in e)q.o(e,i)&&!q.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},v={};q.r(v),q.d(v,{AssetCategory:()=>d,AuctionType:()=>y,AuctionTypes:()=>c,Chain:()=>x,CollectionModule:()=>M,CollectionStatsOrderBy:()=>u,CollectionStatsSelectFields:()=>h,CollectionsFieldsToSelect:()=>s,CollectionsOrderBy:()=>o,CollectionsSummaryFilter:()=>g,CommonModule:()=>F,DropsOderBy:()=>a,FieldsToSelect:()=>e,GlobalOfferFieldsToSelect:()=>l,GlobalOfferOrderBy:()=>n,IssuingType:()=>T,Marketplace:()=>t,NFTModule:()=>L,NftActivityType:()=>p,OfferType:()=>S,OrderByTradingActivity:()=>f,PoolType:()=>w,SearchOrderBy:()=>i,SelectFieldsTradingActivity:()=>m,StakingModule:()=>V,SuggestOrderBy:()=>r,Type:()=>k,UserModule:()=>$,XOXNOClient:()=>W}),function(t){t.XO="xoxno",t.FM="frameit",t.DR="deadrare",t.KG="krogan"}(t||(t={})),function(t){t.Rank="metadata.rarity.rank",t.Attributes="metadata.attributes",t.Description="metadata.description",t.Name="name",t.OnSale="onSale",t.SaleInfo="saleInfo",t.Royalties="royalties",t.Identifier="identifier",t.Collection="collection",t.OriginalURL="url",t.Nonce="nonce",t.ContentType="originalMedia.contentType",t.WasProcessed="wasProcessed",t.AvifURL="avifUrl",t.WebpURL="webpUrl",t.Type="type"}(e||(e={})),function(t){t.PriceHighToLow="saleInfo.minBidShort desc",t.PriceLowToHigh="saleInfo.minBidShort asc",t.MaxPriceHighToLow="saleInfo.maxBidShort desc",t.MaxPriceLowToHigh="saleInfo.maxBidShort asc",t.BidPriceHighToLow="saleInfo.currentBidShort desc",t.BidPriceLowToHigh="saleInfo.currentBidShort asc",t.RarityHighToLow="metadata.rarity.rank desc",t.RarityLowToHigh="metadata.rarity.rank asc",t.NonceHighToLow="nonce desc",t.NonceLowToHigh="nonce asc",t.RecentListed="saleInfo.timestamp desc",t.OldestListed="saleInfo.timestamp asc",t.EndingLate="saleInfo.deadline desc",t.EndingSoon="saleInfo.deadline asc"}(i||(i={})),function(t){t.EndingLate="startTime desc",t.EndingSoon="startTime asc"}(a||(a={})),function(t){t.TotalVolumeHighToLow="statistics/tradeData/totalEgldVolume desc",t.FollowersHighToLow="statistics/other/followCount desc",t.IsVerifiedTrueToFalse="isVerified desc",t.HasImageTrueToFalse="profile desc",t.HasBannerTrueToFalse="banner desc"}(r||(r={})),function(t){t.WeekVolumeHighToLow="statistics.tradeData.weekEgldVolume desc",t.WeekVolumeLowToHigh="statistics.tradeData.weekEgldVolume asc",t.DailyVolumeHighToLow="statistics.tradeData.dayEgldVolume desc",t.DailyVolumeLowToHigh="statistics.tradeData.dayEgldVolume asc",t.TotalVolumeHighToLow="statistics.tradeData.totalEgldVolume desc",t.TotalVolumeLowToHigh="statistics.tradeData.totalEgldVolume asc",t.AvgVolumePriceHighToLow="statistics.tradeData.averageEgldPrice desc",t.AvgVolumePriceLowToHigh="statistics.tradeData.averageEgldPrice asc",t.ATHHighToLow="statistics.tradeData.athEgldPrice desc",t.ATHLowToHigh="statistics.tradeData.athEgldPrice asc",t.TotalTradesHighToLow="statistics.tradeData.totalTrades desc",t.TotalTradesLowToHigh="statistics.tradeData.totalTrades asc",t.SupplyHighToLow="statistics.other.nftCount desc",t.SupplyLowToHigh="statistics.other.nftCount asc",t.FollowersHighToLow="statistics.other.followCount desc",t.FollowersLowToHigh="statistics.other.followCount asc"}(o||(o={})),function(t){t.PriceHighToLow="priceShort desc",t.PriceLowToHigh="priceShort asc",t.OfferIdHighToLow="offerIddesc",t.OfferIdLowToHigh="offerId asc",t.RecentListed="timestamp desc",t.OldestListed="timestamp asc"}(n||(n={})),function(t){t.Profile="profile",t.Description="description",t.Creator="creator",t.Owner="owner",t.Socials="socials",t.Type="type",t.HasStaking="hasStaking",t.Name="name",t.Banner="banner",t.IsVerified="isVerified",t.IsMintable="isMintable",t.Statistics="statistics",t.Collection="collection"}(s||(s={})),function(t){t.Attributes="attributes",t.Collection="collection",t.Marketplace="marketplace",t.PaymentToken="paymentToken",t.LongPrice="price",t.ShortPrice="priceShort"}(l||(l={})),function(t){t.FixedPrice="FixedPrice",t.Auctions="Auctions",t.All="All",t.AllListed="AllListed"}(c||(c={})),function(t){t.ALL="all",t.Trade="trade",t.P2P="p2p",t.Staking="staking",t.Minting="minting"}(d||(d={})),function(t){t.TotalVolume="TotalVolume",t.TotalTrades="TotalTrades",t.DailyVolume="DailyVolume",t.Last2DaysVolume="Last2DaysVolume",t.DailyTrades="DailyTrades",t.Last2DaysTrades="Last2DaysTrades",t.WeekTrades="WeekTrades",t.LastWeekTrades="LastWeekTrades",t.WeekVolume="WeekVolume",t.LastWeekVolume="LastWeekVolume",t.WeeklyTradesMargin="WeeklyTradesMargin",t.DailyTradesMargin="DailyTradesMargin",t.WeeklyVolumeMargin="WeeklyVolumeMargin",t.DailyVolumeEgldMargin="DailyVolumeEgldMargin",t.CollectionAthTrade="CollectionAthTrade"}(g||(g={})),function(t){t.TradingStats="tradingStats"}(h||(h={})),function(t){t.ListedCountDesc="tradingStats.listedCount DESC",t.ListedCountAsc="tradingStats.listedCount ASC",t.FloorPriceDesc="tradingStats.floorPrice DESC",t.FloorPriceAsc="tradingStats.floorPrice ASC",t.TotalVolumeDesc="tradingStats.totalVolume DESC",t.TotalVolumeAsc="tradingStats.totalVolume ASC",t.TotalTradesDesc="tradingStats.totalTrades DESC",t.TotalTradesAsc="tradingStats.totalTrades ASC",t.AllTimeHighDesc="tradingStats.allTimeHigh.price DESC",t.AllTimeHighAsc="tradingStats.allTimeHigh.price ASC",t.DayVolumeDesc="tradingStats.day.volume DESC",t.DayVolumeAsc="tradingStats.day.volume ASC",t.DayVolumeMarginDesc="tradingStats.day.volumeMargin DESC",t.DayVolumeMarginAsc="tradingStats.day.volumeMargin ASC",t.DayTradesDesc="tradingStats.day.trades DESC",t.DayTradesAsc="tradingStats.day.trades ASC",t.DayTradesMarginDesc="tradingStats.day.tradesMargin DESC",t.DayTradesMarginAsc="tradingStats.day.tradesMargin ASC",t.WeekVolumeDesc="tradingStats.week.volume DESC",t.WeekVolumeAsc="tradingStats.week.volume ASC",t.WeekVolumeMarginDesc="tradingStats.week.volumeMargin DESC",t.WeekVolumeMarginAsc="tradingStats.week.volumeMargin ASC",t.WeekTradesDesc="tradingStats.week.trades DESC",t.WeekTradesAsc="tradingStats.week.trades ASC",t.WeekTradesMarginDesc="tradingStats.week.tradesMargin DESC",t.WeekTradesMarginAsc="tradingStats.week.tradesMargin ASC",t.MonthVolumeDesc="tradingStats.month.volume DESC",t.MonthVolumeAsc="tradingStats.month.volume ASC",t.MonthVolumeMarginDesc="tradingStats.month.volumeMargin DESC",t.MonthVolumeMarginAsc="tradingStats.month.volumeMargin ASC",t.MonthTradesDesc="tradingStats.month.trades DESC",t.MonthTradesAsc="tradingStats.month.trades ASC",t.MonthTradesMarginDesc="tradingStats.month.tradesMargin DESC",t.MonthTradesMarginAsc="tradingStats.month.tradesMargin ASC",t.YearVolumeDesc="tradingStats.year.volume DESC",t.YearVolumeAsc="tradingStats.year.volume ASC",t.YearVolumeMarginDesc="tradingStats.year.volumeMargin DESC",t.YearVolumeMarginAsc="tradingStats.year.volumeMargin ASC",t.YearTradesDesc="tradingStats.year.trades DESC",t.YearTradesAsc="tradingStats.year.trades ASC",t.YearTradesMarginDesc="tradingStats.year.tradesMargin DESC",t.YearTradesMarginAsc="tradingStats.year.tradesMargin ASC"}(u||(u={})),function(t){t.NFT_CREATE="nftCreate",t.NFT_BURN="nftBurn",t.NFT_UPDATE="nftUpdate",t.NFT_TRANSFER="nftTransfer",t.LISTING_CREATE="listingCreate",t.LISTING_WITHDRAW="listingWithdraw",t.LISTING_UPDATE="listingUpdate",t.AUCTION_BID="auctionBid",t.AUCTION_OUT_BID="auctionOutBid",t.OFFER_CREATE="offerCreate",t.OFFER_WITHDRAW="offerWithdraw",t.OFFER_REJECT="offerReject",t.GLOBAL_OFFER_CREATE="globalOfferCreate",t.GLOBAL_OFFER_WITHDRAW="globalOfferWithdraw",t.TRADE="trade",t.BULK_TRADE="bulkTrade",t.AUCTION_TRADE="auctionTrade",t.OTHER_TRADE="otherTrade",t.OFFER_TRADE="offerTrade",t.GLOBAL_OFFER_TRADE="globalOfferTrade",t.STAKE="stake",t.UN_STAKE="unStake"}(p||(p={})),function(t){t.PriceHighToLow="activityData.egldValue desc",t.PriceLowToHigh="activityData.egldValue asc",t.RecentPlaced="timestamp desc",t.OldestPlaced="timestamp asc"}(f||(f={})),function(t){t[t.attributes=0]="attributes",t[t.collection=1]="collection",t[t.offer_id=2]="offer_id",t[t.owner=3]="owner",t[t.short_price=4]="short_price",t[t.price=5]="price",t[t.id=6]="id",t[t.dataType=7]="dataType",t[t.marketplace=8]="marketplace",t[t.payment_token=9]="payment_token"}(m||(m={})),function(t){t[t.NftBid=0]="NftBid",t[t.Nft=1]="Nft",t[t.SftAll=2]="SftAll",t[t.SftOnePerPayment=3]="SftOnePerPayment"}(y||(y={})),function(t){t.Dynamic="Dynamic",t.Fixed="Fixed"}(T||(T={})),function(t){t.Duo="Duo",t.Single="Single",t.Perk="Perk"}(w||(w={})),function(t){t.Received="received",t.Placed="placed"}(S||(S={})),function(t){t.NonFungibleESDT="NonFungibleESDT"}(k||(k={}));const E="https://api.xoxno.com",A="erd1qqqqqqqqqqqqqpgq705fxpfrjne0tl3ece0rrspykq88mynn4kxs2cg43s",C="erd1qqqqqqqqqqqqqpgqd9rvv2n378e27jcts8vfwynpx0gfl5ufz6hqhfy0u0",D="erd1qqqqqqqqqqqqqpgq8xwzu82v8ex3h4ayl5lsvxqxnhecpwyvwe0sf2qj4e";var x;!function(t){t.MAINNET="1",t.DEVNET="D"}(x||(x={}));class W{static instance;apiUrl;apiKey;chain;config;constructor(t=E,e="",i=x.MAINNET){this.apiUrl=t,this.apiKey=e,this.chain=i,this.config=i===x.MAINNET?{XO_SC:"erd1qqqqqqqqqqqqqpgq6wegs2xkypfpync8mn2sa5cmpqjlvrhwz5nqgepyg8",FM_SC:A,DR_SC:C,KG_SC:D,Staking_SC:"erd1qqqqqqqqqqqqqpgqvpkd3g3uwludduv3797j54qt6c888wa59w2shntt6z",Manager_SC:"erd1qqqqqqqqqqqqqpgqg9fa0dmpn8fu3fnleeqn5zt8rl8mdqjkys5s2gtas7",P2P_SC:"erd1qqqqqqqqqqqqqpgq47y8hnct68v6asjv6gxem6h9rumn9frzah0skhxxt6"}:{XO_SC:"erd1qqqqqqqqqqqqqpgqn4fnwl43hhchz9emdy66eh5azzhl599zd8ssxjdyh3",FM_SC:A,DR_SC:C,KG_SC:D,Staking_SC:"erd1qqqqqqqqqqqqqpgqmkt2fvumf0zgum5qd0awl2l46x2pxdgmr5rswjr6r8",Manager_SC:"erd1qqqqqqqqqqqqqpgq6sysl7mga393a850xemfpawaqanf4da5d8ssp3xamn",P2P_SC:"erd1qqqqqqqqqqqqqpgqhuvnvkwwmucdzy3g7pvgvjumjfcgfwf69w2svch5c2"}}static init({apiUrl:t=E,apiKey:e="",chain:i=x.MAINNET}={}){return W.instance||(i==x.DEVNET&&(W.instance=new W("https://api-dev.xoxno.com",e,i)),W.instance=new W(t,e,i)),W.instance}fetchWithTimeout=async(t,e={},i=4e4)=>{const a={"Accept-Encoding":"gzip,deflate,br",Referer:"https://xoxno.sdk","User-Agent":"XOXNO/1.0/SDK",..."POST"===e.method?{"Content-Type":"application/json"}:{},...e.headers??{}},r=`${"string"==typeof t&&t.startsWith("/")?`${this.apiUrl}${t}`:t}${e.params?"?"+Object.keys(e.params).map((t=>`${t}=${encodeURIComponent(e.params[t])}`)).join("&"):""}`,o=new AbortController;setTimeout((()=>o.abort()),i);const n=await fetch(r,{...e,...e?.next&&e.next.revalidate?{}:{cache:"no-store"},signal:o.signal,...Object.keys(a).length?{headers:a}:{},method:e.method??"GET"});if(!n.ok)throw new Error((await n.json()).message.toString());return n.json()}}const I=async(t,e)=>{if(t.top&&t.top>35)throw new Error("Top cannot be greater than 35");const i=[];t.priceRange&&i.push({...t.priceRange,field:"activityData.egldValue"}),t.timestampRange&&i.push({...t.timestampRange,field:"timestamp"});const a={filters:{activityData:null==t.from&&null==t.to?{collection:t.collections,identifier:t.identifiers||void 0}:void 0,from:t.from,to:t.to,activityAddress:t.wallets||void 0,source:t.source||void 0,activityType:t.activityType||void 0,range:i},strictSelect:t.strictSelect,orderBy:t.orderBy,select:t.select,top:t.top||35,skip:t.skip||0},r=await e.fetchWithTimeout("/activity/query",{params:{filter:JSON.stringify(a)},next:{tags:["getActivity"],revalidate:180}});return{...r,getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)},empty:0===r.resources.length}},O=t=>/^[A-Z0-9]{3,10}-[a-z0-9]{6}$/.test(t),P=t=>/^[A-Za-z0-9]{3,10}-[A-Za-z0-9]{6}-[A-Za-z0-9]{2,5}(?:-\d+(?:-[A-Za-z0-9]+)?)?$/.test(t);class M{api;constructor(){this.api=W.init()}getCollectionProfile=async t=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/profile`,{next:{tags:["getCollectionProfile"],revalidate:30}})};getDailyTrending=async()=>await this.api.fetchWithTimeout("/nfts/getDailyTrending",{next:{tags:["getDailyTrending"],revalidate:180}});getCollectionFloorPrice=async(t,e="EGLD")=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);const i=await this.api.fetchWithTimeout(`/collection/${t}/floor-price`,{next:{tags:["getCollectionFloorPrice"]},params:{token:e}});return i?.price?i.price:0};getCollectionAttributes=async t=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/attributes`,{next:{tags:["getCollectionAttributes"],revalidate:180}})};getNFTs=async t=>{if(t?.collections?.forEach((t=>{if(!O(t))throw new Error("Invalid collection ticker: "+t)})),t.top&&t.top>35)throw new Error("Top cannot be greater than 35");const e=[];t.priceRange&&e.push({...t.priceRange,field:t.auctionType==c.Auctions?"saleInfo.currentBidShort":"saleInfo.minBidShort"}),t.rankRange&&e.push({...t.rankRange,field:"metadata.rarity.rank"});const i={filters:{dataType:t.dataType??["nft"],activeAuction:t.activeAuctions,collection:t.collections??[],onSale:t.onlyOnSale,saleInfo:{seller:t.listedBy||[],marketplace:t.listedOnlyOn||void 0,paymentToken:t.listedInToken||[],auctionType:t.auctionType==c.Auctions?["NftBid","SftAll"]:t.auctionType==c.FixedPrice?["Nft","SftOnePerPayment"]:t.auctionType==c.AllListed?["NftBid","SftAll","Nft","SftOnePerPayment"]:void 0},owner:t.ownedBy||[],verifiedOnly:t.onlyVerified||!1,metadata:{attributes:t.attributes||void 0},range:e,cp_staked:t.isStaked||void 0},applyNftExtraDetails:t.applyNftExtraDetails,orderBy:t.orderBy||[],select:t.onlySelectFields||[],includeCount:t.includeCount||!1,top:t.top||35,skip:t.skip||0};return{...await this.api.fetchWithTimeout("/nft/query",{params:{filter:JSON.stringify(i)},next:{tags:["getCollectionNFTs"]},cache:"no-store"}),getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)}}};suggestCollections=async t=>{if(t.top&&t.top>35)throw new Error("Top cannot be greater than 35");if(!t.name)throw new Error("Name is required");const e={name:t.name,top:t.top||35,skip:t.skip||0};return await this.api.fetchWithTimeout("/collection/search",{params:{filter:JSON.stringify(e)},next:{tags:["/collection/search"],revalidate:180}})};collectionListingsAnalytics=async t=>await this.api.fetchWithTimeout(`/collection/${t}/listings`,{next:{tags:["collection/${ticker}/listings"],revalidate:500}});getTradingActivity=async t=>await I(t,this.api);getCollections=async t=>{if(t?.top&&t.top>25)throw new Error("Top cannot be greater than 25");const e={skip:t?.skip||0,top:t?.top||25,select:t?.onlySelectFields||[],filters:{dataType:"collectionProfile",isMintable:t?.onlyMintable||void 0,...t?.collections&&t.collections.length>0&&{collection:t.collections}},orderBy:[t?.orderBy||"statistics.tradeData.weekEgldVolume desc"]},i=await this.api.fetchWithTimeout("/collection/query",{params:{filter:JSON.stringify(e)},next:{tags:["getCollections"],revalidate:180}});return{results:i,resultsCount:i.length,empty:0===i.length,getNextPagePayload:{...t,skip:(t?.skip||0)+(t?.top||25)},hasMoreResults:i.length>=(t?.top||25)}};getGlobalOffers=async t=>{if(t?.top&&t.top>25)throw new Error("Top cannot be greater than 25");const e={skip:t?.skip||0,top:t?.top||25,select:t?.onlySelectFields||[],filters:{collection:t?.collections||[],withAttributes:t?.withAttributes??!1,isActive:t?.onlyActive??!0,offerId:t?.offerIds,owner:t?.ownedBy,marketplace:t?.listedOnlyOn,range:t?.priceRange?{...t.priceRange,type:"priceShort"}:void 0,attributes:t?.attributes},orderBy:[t?.orderBy||n.PriceHighToLow]},i=await this.api.fetchWithTimeout("/collection/global-offer/query",{params:{filter:JSON.stringify(e)},next:{tags:["getGlobalOffers"],revalidate:12}});return{...i,getNextPagePayload:{...t,skip:(t?.top||25)+i.lastSkip}}};getCollectionVolume=async(t,e,i,a)=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/analytics/volume?startTime=${e}&endTime=${i}&bin=${a}`,{next:{tags:["getCollectionVolume"],revalidate:180}})};getMarketplaceVolume=async(t,e,i)=>await this.api.fetchWithTimeout(`/analytics/volume?startTime=${t}&endTime=${e}&bin=${i}`,{next:{tags:["getMarketplaceVolume"],revalidate:180}});getCollectionOwners=async t=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/holders`,{next:{tags:["getCollectionOwners"],revalidate:500}})};getExportOwners=async t=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/holders?exportHolders=true`,{next:{tags:["getExportOwners"]}})};getCollectionsStatistics=async t=>{if(t?.top&&t.top>25)throw new Error("Top cannot be greater than 25");return{...await this.api.fetchWithTimeout("/collection/stats/query",{params:{filter:JSON.stringify(t)},next:{tags:["collectionStatistics"],revalidate:12}}),getNextPagePayload:{...t,skip:t.skip+t.top}}};getCollectionStats=async t=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/stats`,{next:{tags:["collectionStatistics"],revalidate:12}})};getAwaitEmpty=async t=>new Promise((e=>{setTimeout((()=>{e(!0)}),t)}));getCollectionMintInfo=async({ticker:t,extra:e})=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/drop-info`,{next:{tags:[`/collection/${t}/drop-info`],revalidate:12},...e})};getCollectionRanks=async({ticker:t,extra:e})=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/ranks`,{next:{tags:[`/collection/${t}/ranks`],revalidate:60},...e})};getDropInfo=async({collectionTag:t,creatorTag:e,extra:i})=>await this.api.fetchWithTimeout(`/collection/${e}/${t}/drop-info`,{next:{tags:[`/collection/${e}/${t}/drop-info`],revalidate:12},...i});getCollectionGraphData=async(t,e,i,a)=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/analytics/volume`,{params:{startTime:e,endTime:i,bin:a},next:{tags:[`/collection/${t}/analytics/volume`],revalidate:60}})};getPinnedCollections=async()=>await this.api.fetchWithTimeout("/collection/pinned",{next:{tags:["/collection/pinned"],revalidate:60}});getDrops=async t=>{if(t?.collections?.forEach((t=>{if(!O(t))throw new Error("Invalid collection ticker: "+t)})),t.top&&t.top>35)throw new Error("Top cannot be greater than 35");const e=[];t.timeRange&&e.push({...t.timeRange,field:"startTime"});const i={filters:{collection:t.collections??[],verifiedOnly:t.onlyVerified||!1,mintToken:t.listedInToken||void 0,range:e},orderBy:t.orderBy||[],select:t.onlySelectFields||[],includeCount:t.includeCount||!1,top:t.top||35,skip:t.skip||0};return{...await this.api.fetchWithTimeout("/collection/drops/query",{params:{filter:JSON.stringify(i)},next:{tags:["/collection/drops/query"]},cache:"no-store"}),getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)}}};getCollectionStakingSummary=async({collection:t,extra:e})=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/staking/summary`,{...e})};getCollectionsFloor=async t=>{t?.forEach((t=>{if(!O(t))throw new Error("Invalid collection ticker: "+t)}));return await this.api.fetchWithTimeout("/collection/floor-price",{params:{collection:t.join(",")}})}}const N=t=>{let e=t.toString(16);return e.length%2!=0&&(e="0"+e),e},b=t=>{try{return t.includes("erd1")}catch(t){return!1}};class L{api;constructor(){this.api=W.init()}getNFTByIdentifier=async t=>{if(!P(t))throw new Error("Invalid identifier: "+t);return await this.api.fetchWithTimeout(`/nft/${t}`)};getNFTsOffers=async(t,e=0,i=25)=>{if(!P(t))throw new Error("Invalid identifier: "+t);return await this.api.fetchWithTimeout(`/nft/${t}/offers?skip=${e}&top=${i}`,{next:{tags:["getNFTsOffers"],revalidate:12}})};getNFTByCollectionAndNonce=async(t,e)=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);const i=await this.api.fetchWithTimeout(`/${((t,e)=>[t,N(e)].join("-"))(t,e)}`);return i};getNFTByCollectionAndNonceHex=async(t,e)=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);e.length%2!=0&&(e="0"+e);return await this.api.fetchWithTimeout(`/${[t,e].join("-")}`)};getTradingActivity=async t=>await I(t,this.api)}class ${api;collection;constructor(){this.api=W.init(),this.collection=new M}getUserProfile=async t=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/profile`)};getBulkAccounts=async t=>await this.api.fetchWithTimeout("/user/network-account",{method:"POST",body:JSON.stringify(t)});getUserAccount=async t=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/network-account`)};getUserTokenInventory=async t=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/token-inventory`)};getUserSummaryInventory=async t=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/inventory-summary`)};getUserNFTs=async t=>await this.collection.getNFTs(t);getUserOffers=async t=>{if(!b(t.address))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t.address}/offers`,{params:{type:t.type,skip:t.skip,top:t.top}})};suggestUsers=async t=>{if(t.top&&t.top>35)throw new Error("Top cannot be greater than 35");if(!t.name)throw new Error("Name is required");const e={name:t.name,top:t.top||35,skip:t.skip||0};return await this.api.fetchWithTimeout("/user/search",{params:{filter:JSON.stringify(e)},next:{tags:["/search/global"],revalidate:180}})};getTradingActivity=async t=>await I(t,this.api);getUserCreatorProfile=async t=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/creator/profile`)};getCreatorListings=async t=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/creator/listing`)};getUserStakingSummary=async t=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/staking/summary`)};getUserStakingAailable=async t=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/staking/available-pools`)};getUserCreatorInfo=async t=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/creator/details`)};getUserCollectionStaking=async(t,e)=>{if(!b(t))throw new Error("Invalid address");if(!O(e))throw new Error("Invalid collection ticker: "+e);return await this.api.fetchWithTimeout(`/user/${t}/staking/collection/${e}`)};getUserPoolStaking=async(t,e)=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/staking/pool/${e}`)};getAvailableNFTsForStakingPool=async(t,e)=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/staking/pool/${e}/nfts`)};getOwnedPoolsByAddress=async t=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/staking/owned-pools`)};getUserAnalyticsSummary=async t=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/analytics/volume`)};getUserFavoriteNFTs=async(t,e,i)=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/favorite/nfts`,{params:{top:e,skip:i}})};getUserFavoriteCollectionTickers=async t=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/favorite/collections`)};getIsCreatorRegistered=async t=>await this.api.fetchWithTimeout(`/user/${t}/creator/is-registered`);getUsersStats=async({top:t,skip:e,orderBy:i})=>{if(t&&t>35)throw new Error("Top cannot be greater than 35");return await this.api.fetchWithTimeout("/user/stats",{params:{top:t,skip:e,orderBy:i??"totalVolume"},next:{tags:["/user/stats"],revalidate:180}})};getAccountNFTsToStake=async(t,e)=>await this.api.fetchWithTimeout(`/user/${t}/staking/pool/${e}/available-nfts`,{next:{tags:[`/user/${t}/staking/pool/${e}/available-nfts`],revalidate:30}});getStakingCreatorInfo=async t=>await this.api.fetchWithTimeout(`/user/${t}/staking/creator`,{next:{tags:[`/user/${t}/staking/creator`],revalidate:30}});getUsersDrop=async({top:t,skip:e,address:i})=>{if(t&&t>35)throw new Error("Top cannot be greater than 35");if(i&&!b(i))throw new Error("Invalid address");return await this.api.fetchWithTimeout("/user/xoxno-drop",{params:{top:t,skip:e,...i?{address:i}:{}},next:{tags:["/user/xoxno-drop"],revalidate:30}})};getUserOwnerCollections=async t=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/staking/owned-collections`)};getRoyaltiesSharesCreator=async t=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/launchpad/${t}/shareholders/royalties`)};getMintSharesCreator=async(t,e)=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/launchpad/${t}/shareholders/collection/${e}`)}}class V{api;constructor(){this.api=W.init()}getPoolDetails=async t=>await this.api.fetchWithTimeout(`/pool/${t}/profile`)}class F{api;constructor(){this.api=W.init()}getTokensUsdPrice=async()=>await this.api.fetchWithTimeout("/tokens/usd-price");getAshSwapAmount=async({originalToken:t,originalTokenValue:e,paymentToken:i})=>await this.api.fetchWithTimeout("/ash/min-token-quantity",{params:{originalToken:t,originalTokenValue:e,paymentToken:i}});getFungibleTokens=async(t=[d.ALL],e)=>{let i={};e&&(i={identifier:e.join(",")}),t&&(i={...i,category:t.join(",")});return await this.api.fetchWithTimeout("/tokens",{params:i})};getGlobalGraphData=async(t,e,i)=>await this.api.fetchWithTimeout("/analytics/volume",{params:{startTime:t,endTime:e,bin:i},next:{tags:["/analytics/volume"],revalidate:60}});getAnalyticsOverview=async()=>await this.api.fetchWithTimeout("/analytics/overview",{next:{tags:["/analytics/overview"],revalidate:60}});suggestResults=async t=>{if(t.top&&t.top>35)throw new Error("Top cannot be greater than 35");if(!t.name)throw new Error("Name is required");const e={name:t.name,top:t.top||35,skip:t.skip||0};return await this.api.fetchWithTimeout("/search",{params:{filter:JSON.stringify(e)},next:{tags:["/search/global"],revalidate:180}})};getExploreStaking=async()=>await this.api.fetchWithTimeout("/collection/staking/explore",{next:{tags:["/collection/staking/explore"],revalidate:60}})}return v})()));
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["@xoxno/sdk-js"]=e():t["@xoxno/sdk-js"]=e()}(this,(()=>(()=>{"use strict";var t,e,i,a,r,o,n,s,l,c,d,g,h,u,p,f,y,m,T,w,S,k,q={d:(t,e)=>{for(var i in e)q.o(e,i)&&!q.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},v={};q.r(v),q.d(v,{AssetCategory:()=>d,AuctionType:()=>m,AuctionTypes:()=>c,Chain:()=>W,CollectionModule:()=>M,CollectionStatsOrderBy:()=>u,CollectionStatsSelectFields:()=>h,CollectionsFieldsToSelect:()=>s,CollectionsOrderBy:()=>o,CollectionsSummaryFilter:()=>g,CommonModule:()=>F,DropsOderBy:()=>a,FieldsToSelect:()=>e,GlobalOfferFieldsToSelect:()=>l,GlobalOfferOrderBy:()=>n,IssuingType:()=>T,Marketplace:()=>t,NFTModule:()=>L,NftActivityType:()=>p,OfferType:()=>S,OrderByTradingActivity:()=>f,PoolType:()=>w,SearchOrderBy:()=>i,SelectFieldsTradingActivity:()=>y,StakingModule:()=>V,SuggestOrderBy:()=>r,Type:()=>k,UserModule:()=>$,XOXNOClient:()=>I}),function(t){t.XO="xoxno",t.FM="frameit",t.DR="deadrare",t.KG="krogan"}(t||(t={})),function(t){t.Rank="metadata.rarity.rank",t.Attributes="metadata.attributes",t.Description="metadata.description",t.Name="name",t.OnSale="onSale",t.SaleInfo="saleInfo",t.Royalties="royalties",t.Identifier="identifier",t.Collection="collection",t.OriginalURL="url",t.Nonce="nonce",t.ContentType="originalMedia.contentType",t.WasProcessed="wasProcessed",t.AvifURL="avifUrl",t.WebpURL="webpUrl",t.Type="type"}(e||(e={})),function(t){t.PriceHighToLow="saleInfo.minBidShort desc",t.PriceLowToHigh="saleInfo.minBidShort asc",t.MaxPriceHighToLow="saleInfo.maxBidShort desc",t.MaxPriceLowToHigh="saleInfo.maxBidShort asc",t.BidPriceHighToLow="saleInfo.currentBidShort desc",t.BidPriceLowToHigh="saleInfo.currentBidShort asc",t.RarityHighToLow="metadata.rarity.rank desc",t.RarityLowToHigh="metadata.rarity.rank asc",t.NonceHighToLow="nonce desc",t.NonceLowToHigh="nonce asc",t.RecentListed="saleInfo.timestamp desc",t.OldestListed="saleInfo.timestamp asc",t.EndingLate="saleInfo.deadline desc",t.EndingSoon="saleInfo.deadline asc"}(i||(i={})),function(t){t.EndingLate="startTime desc",t.EndingSoon="startTime asc"}(a||(a={})),function(t){t.TotalVolumeHighToLow="statistics/tradeData/totalEgldVolume desc",t.FollowersHighToLow="statistics/other/followCount desc",t.IsVerifiedTrueToFalse="isVerified desc",t.HasImageTrueToFalse="profile desc",t.HasBannerTrueToFalse="banner desc"}(r||(r={})),function(t){t.WeekVolumeHighToLow="statistics.tradeData.weekEgldVolume desc",t.WeekVolumeLowToHigh="statistics.tradeData.weekEgldVolume asc",t.DailyVolumeHighToLow="statistics.tradeData.dayEgldVolume desc",t.DailyVolumeLowToHigh="statistics.tradeData.dayEgldVolume asc",t.TotalVolumeHighToLow="statistics.tradeData.totalEgldVolume desc",t.TotalVolumeLowToHigh="statistics.tradeData.totalEgldVolume asc",t.AvgVolumePriceHighToLow="statistics.tradeData.averageEgldPrice desc",t.AvgVolumePriceLowToHigh="statistics.tradeData.averageEgldPrice asc",t.ATHHighToLow="statistics.tradeData.athEgldPrice desc",t.ATHLowToHigh="statistics.tradeData.athEgldPrice asc",t.TotalTradesHighToLow="statistics.tradeData.totalTrades desc",t.TotalTradesLowToHigh="statistics.tradeData.totalTrades asc",t.SupplyHighToLow="statistics.other.nftCount desc",t.SupplyLowToHigh="statistics.other.nftCount asc",t.FollowersHighToLow="statistics.other.followCount desc",t.FollowersLowToHigh="statistics.other.followCount asc"}(o||(o={})),function(t){t.PriceHighToLow="priceShort desc",t.PriceLowToHigh="priceShort asc",t.OfferIdHighToLow="offerIddesc",t.OfferIdLowToHigh="offerId asc",t.RecentListed="timestamp desc",t.OldestListed="timestamp asc"}(n||(n={})),function(t){t.Profile="profile",t.Description="description",t.Creator="creator",t.Owner="owner",t.Socials="socials",t.Type="type",t.HasStaking="hasStaking",t.Name="name",t.Banner="banner",t.IsVerified="isVerified",t.IsMintable="isMintable",t.Statistics="statistics",t.Collection="collection"}(s||(s={})),function(t){t.Attributes="attributes",t.Collection="collection",t.Marketplace="marketplace",t.PaymentToken="paymentToken",t.LongPrice="price",t.ShortPrice="priceShort"}(l||(l={})),function(t){t.FixedPrice="FixedPrice",t.Auctions="Auctions",t.All="All",t.AllListed="AllListed"}(c||(c={})),function(t){t.ALL="all",t.Trade="trade",t.P2P="p2p",t.Staking="staking",t.Minting="minting"}(d||(d={})),function(t){t.TotalVolume="TotalVolume",t.TotalTrades="TotalTrades",t.DailyVolume="DailyVolume",t.Last2DaysVolume="Last2DaysVolume",t.DailyTrades="DailyTrades",t.Last2DaysTrades="Last2DaysTrades",t.WeekTrades="WeekTrades",t.LastWeekTrades="LastWeekTrades",t.WeekVolume="WeekVolume",t.LastWeekVolume="LastWeekVolume",t.WeeklyTradesMargin="WeeklyTradesMargin",t.DailyTradesMargin="DailyTradesMargin",t.WeeklyVolumeMargin="WeeklyVolumeMargin",t.DailyVolumeEgldMargin="DailyVolumeEgldMargin",t.CollectionAthTrade="CollectionAthTrade"}(g||(g={})),function(t){t.TradingStats="tradingStats"}(h||(h={})),function(t){t.ListedCountDesc="tradingStats.listedCount DESC",t.ListedCountAsc="tradingStats.listedCount ASC",t.FloorPriceDesc="tradingStats.floorPrice DESC",t.FloorPriceAsc="tradingStats.floorPrice ASC",t.TotalVolumeDesc="tradingStats.totalVolume DESC",t.TotalVolumeAsc="tradingStats.totalVolume ASC",t.TotalTradesDesc="tradingStats.totalTrades DESC",t.TotalTradesAsc="tradingStats.totalTrades ASC",t.AllTimeHighDesc="tradingStats.allTimeHigh.price DESC",t.AllTimeHighAsc="tradingStats.allTimeHigh.price ASC",t.DayVolumeDesc="tradingStats.day.volume DESC",t.DayVolumeAsc="tradingStats.day.volume ASC",t.DayVolumeMarginDesc="tradingStats.day.volumeMargin DESC",t.DayVolumeMarginAsc="tradingStats.day.volumeMargin ASC",t.DayTradesDesc="tradingStats.day.trades DESC",t.DayTradesAsc="tradingStats.day.trades ASC",t.DayTradesMarginDesc="tradingStats.day.tradesMargin DESC",t.DayTradesMarginAsc="tradingStats.day.tradesMargin ASC",t.WeekVolumeDesc="tradingStats.week.volume DESC",t.WeekVolumeAsc="tradingStats.week.volume ASC",t.WeekVolumeMarginDesc="tradingStats.week.volumeMargin DESC",t.WeekVolumeMarginAsc="tradingStats.week.volumeMargin ASC",t.WeekTradesDesc="tradingStats.week.trades DESC",t.WeekTradesAsc="tradingStats.week.trades ASC",t.WeekTradesMarginDesc="tradingStats.week.tradesMargin DESC",t.WeekTradesMarginAsc="tradingStats.week.tradesMargin ASC",t.MonthVolumeDesc="tradingStats.month.volume DESC",t.MonthVolumeAsc="tradingStats.month.volume ASC",t.MonthVolumeMarginDesc="tradingStats.month.volumeMargin DESC",t.MonthVolumeMarginAsc="tradingStats.month.volumeMargin ASC",t.MonthTradesDesc="tradingStats.month.trades DESC",t.MonthTradesAsc="tradingStats.month.trades ASC",t.MonthTradesMarginDesc="tradingStats.month.tradesMargin DESC",t.MonthTradesMarginAsc="tradingStats.month.tradesMargin ASC",t.YearVolumeDesc="tradingStats.year.volume DESC",t.YearVolumeAsc="tradingStats.year.volume ASC",t.YearVolumeMarginDesc="tradingStats.year.volumeMargin DESC",t.YearVolumeMarginAsc="tradingStats.year.volumeMargin ASC",t.YearTradesDesc="tradingStats.year.trades DESC",t.YearTradesAsc="tradingStats.year.trades ASC",t.YearTradesMarginDesc="tradingStats.year.tradesMargin DESC",t.YearTradesMarginAsc="tradingStats.year.tradesMargin ASC"}(u||(u={})),function(t){t.NFT_CREATE="nftCreate",t.NFT_BURN="nftBurn",t.NFT_UPDATE="nftUpdate",t.NFT_TRANSFER="nftTransfer",t.LISTING_CREATE="listingCreate",t.LISTING_WITHDRAW="listingWithdraw",t.LISTING_UPDATE="listingUpdate",t.AUCTION_BID="auctionBid",t.AUCTION_OUT_BID="auctionOutBid",t.OFFER_CREATE="offerCreate",t.OFFER_WITHDRAW="offerWithdraw",t.OFFER_REJECT="offerReject",t.GLOBAL_OFFER_CREATE="globalOfferCreate",t.GLOBAL_OFFER_WITHDRAW="globalOfferWithdraw",t.TRADE="trade",t.BULK_TRADE="bulkTrade",t.AUCTION_TRADE="auctionTrade",t.OTHER_TRADE="otherTrade",t.OFFER_TRADE="offerTrade",t.GLOBAL_OFFER_TRADE="globalOfferTrade",t.STAKE="stake",t.UN_STAKE="unStake"}(p||(p={})),function(t){t.PriceHighToLow="activityData.egldValue desc",t.PriceLowToHigh="activityData.egldValue asc",t.RecentPlaced="timestamp desc",t.OldestPlaced="timestamp asc"}(f||(f={})),function(t){t[t.attributes=0]="attributes",t[t.collection=1]="collection",t[t.offer_id=2]="offer_id",t[t.owner=3]="owner",t[t.short_price=4]="short_price",t[t.price=5]="price",t[t.id=6]="id",t[t.dataType=7]="dataType",t[t.marketplace=8]="marketplace",t[t.payment_token=9]="payment_token"}(y||(y={})),function(t){t[t.NftBid=0]="NftBid",t[t.Nft=1]="Nft",t[t.SftAll=2]="SftAll",t[t.SftOnePerPayment=3]="SftOnePerPayment"}(m||(m={})),function(t){t.Dynamic="Dynamic",t.Fixed="Fixed"}(T||(T={})),function(t){t.Duo="Duo",t.Single="Single",t.Perk="Perk"}(w||(w={})),function(t){t.Received="received",t.Placed="placed"}(S||(S={})),function(t){t.NonFungibleESDT="NonFungibleESDT"}(k||(k={}));const E="https://api.xoxno.com",A="erd1qqqqqqqqqqqqqpgq705fxpfrjne0tl3ece0rrspykq88mynn4kxs2cg43s",C="erd1qqqqqqqqqqqqqpgqd9rvv2n378e27jcts8vfwynpx0gfl5ufz6hqhfy0u0",D="erd1qqqqqqqqqqqqqpgq8xwzu82v8ex3h4ayl5lsvxqxnhecpwyvwe0sf2qj4e";var W;!function(t){t.MAINNET="1",t.DEVNET="D"}(W||(W={}));class I{static instance;apiUrl;apiKey;chain;config;constructor(t=E,e="",i=W.MAINNET){this.apiUrl=t,this.apiKey=e,this.chain=i,this.config=i===W.MAINNET?{XO_SC:"erd1qqqqqqqqqqqqqpgq6wegs2xkypfpync8mn2sa5cmpqjlvrhwz5nqgepyg8",FM_SC:A,DR_SC:C,KG_SC:D,Staking_SC:"erd1qqqqqqqqqqqqqpgqvpkd3g3uwludduv3797j54qt6c888wa59w2shntt6z",Manager_SC:"erd1qqqqqqqqqqqqqpgqg9fa0dmpn8fu3fnleeqn5zt8rl8mdqjkys5s2gtas7",P2P_SC:"erd1qqqqqqqqqqqqqpgq47y8hnct68v6asjv6gxem6h9rumn9frzah0skhxxt6"}:{XO_SC:"erd1qqqqqqqqqqqqqpgql0dnz6n5hpuw8cptlt00khd0nn4ja8eadsfq2xrqw4",FM_SC:A,DR_SC:C,KG_SC:D,Staking_SC:"erd1qqqqqqqqqqqqqpgqsc5hnewwpep8qq0d7kjjzrquapuucrygah0s85zres",Manager_SC:"erd1qqqqqqqqqqqqqpgqluclyhfsa2uw7q9cjwd8knk989hg57u8ah0slq2nlr",P2P_SC:"erd1qqqqqqqqqqqqqpgqfja7ukpngrun78ueq583l0vd6aj4ekhrah0sa9wyrv"}}static init({apiUrl:t=E,apiKey:e="",chain:i=W.MAINNET}={}){if(!I.instance){if(i==W.DEVNET)return I.instance=new I(t??"https://devnet-api.xoxno.com",e,i),I.instance;I.instance=new I(t,e,i)}return I.instance}fetchWithTimeout=async(t,e={},i=4e4)=>{const a={"Accept-Encoding":"gzip,deflate,br",Referer:"https://xoxno.sdk","User-Agent":"XOXNO/1.0/SDK",..."POST"===e.method?{"Content-Type":"application/json"}:{},...e.headers??{}},r=`${"string"==typeof t&&t.startsWith("/")?`${this.apiUrl}${t}`:t}${e.params?"?"+Object.keys(e.params).map((t=>`${t}=${encodeURIComponent(e.params[t])}`)).join("&"):""}`,o=new AbortController;setTimeout((()=>o.abort()),i);const n=await fetch(r,{...e,...e?.next&&e.next.revalidate?{}:{cache:"no-store"},signal:o.signal,...Object.keys(a).length?{headers:a}:{},method:e.method??"GET"});if(!n.ok)throw new Error((await n.json()).message.toString());return n.json()}}const x=async(t,e)=>{if(t.top&&t.top>35)throw new Error("Top cannot be greater than 35");const i=[];t.priceRange&&i.push({...t.priceRange,field:"activityData.egldValue"}),t.timestampRange&&i.push({...t.timestampRange,field:"timestamp"});const a={filters:{activityData:null==t.from&&null==t.to?{collection:t.collections,identifier:t.identifiers||void 0}:void 0,from:t.from,to:t.to,activityAddress:t.wallets||void 0,source:t.source||void 0,activityType:t.activityType||void 0,range:i},strictSelect:t.strictSelect,orderBy:t.orderBy,select:t.select,top:t.top||35,skip:t.skip||0},r=await e.fetchWithTimeout("/activity/query",{params:{filter:JSON.stringify(a)},next:{tags:["getActivity"],revalidate:180}});return{...r,getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)},empty:0===r.resources.length}},O=t=>/^[A-Z0-9]{3,10}-[a-z0-9]{6}$/.test(t),P=t=>/^[A-Za-z0-9]{3,10}-[A-Za-z0-9]{6}-[A-Za-z0-9]{2,5}(?:-\d+(?:-[A-Za-z0-9]+)?)?$/.test(t);class M{api;constructor(){this.api=I.init()}getCollectionProfile=async t=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/profile`,{next:{tags:["getCollectionProfile"],revalidate:30}})};getDailyTrending=async()=>await this.api.fetchWithTimeout("/nfts/getDailyTrending",{next:{tags:["getDailyTrending"],revalidate:180}});getCollectionFloorPrice=async(t,e="EGLD")=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);const i=await this.api.fetchWithTimeout(`/collection/${t}/floor-price`,{next:{tags:["getCollectionFloorPrice"]},params:{token:e}});return i?.price?i.price:0};getCollectionAttributes=async t=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/attributes`,{next:{tags:["getCollectionAttributes"],revalidate:180}})};getNFTs=async t=>{if(t?.collections?.forEach((t=>{if(!O(t))throw new Error("Invalid collection ticker: "+t)})),t.top&&t.top>35)throw new Error("Top cannot be greater than 35");const e=[];t.priceRange&&e.push({...t.priceRange,field:t.auctionType==c.Auctions?"saleInfo.currentBidShort":"saleInfo.minBidShort"}),t.rankRange&&e.push({...t.rankRange,field:"metadata.rarity.rank"});const i={filters:{dataType:t.dataType??["nft"],activeAuction:t.activeAuctions,collection:t.collections??[],onSale:t.onlyOnSale,saleInfo:{seller:t.listedBy||[],marketplace:t.listedOnlyOn||void 0,paymentToken:t.listedInToken||[],auctionType:t.auctionType==c.Auctions?["NftBid","SftAll"]:t.auctionType==c.FixedPrice?["Nft","SftOnePerPayment"]:t.auctionType==c.AllListed?["NftBid","SftAll","Nft","SftOnePerPayment"]:void 0},owner:t.ownedBy||[],verifiedOnly:t.onlyVerified||!1,metadata:{attributes:t.attributes||void 0},range:e,cp_staked:t.isStaked||void 0},applyNftExtraDetails:t.applyNftExtraDetails,orderBy:t.orderBy||[],select:t.onlySelectFields||[],includeCount:t.includeCount||!1,top:t.top||35,skip:t.skip||0};return{...await this.api.fetchWithTimeout("/nft/query",{params:{filter:JSON.stringify(i)},next:{tags:["getCollectionNFTs"]},cache:"no-store"}),getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)}}};suggestCollections=async t=>{if(t.top&&t.top>35)throw new Error("Top cannot be greater than 35");if(!t.name)throw new Error("Name is required");const e={name:t.name,top:t.top||35,skip:t.skip||0};return await this.api.fetchWithTimeout("/collection/search",{params:{filter:JSON.stringify(e)},next:{tags:["/collection/search"],revalidate:180}})};collectionListingsAnalytics=async t=>await this.api.fetchWithTimeout(`/collection/${t}/listings`,{next:{tags:["collection/${ticker}/listings"],revalidate:500}});getTradingActivity=async t=>await x(t,this.api);getCollections=async t=>{if(t?.top&&t.top>25)throw new Error("Top cannot be greater than 25");const e={skip:t?.skip||0,top:t?.top||25,select:t?.onlySelectFields||[],filters:{dataType:"collectionProfile",isMintable:t?.onlyMintable||void 0,...t?.collections&&t.collections.length>0&&{collection:t.collections}},orderBy:[t?.orderBy||"statistics.tradeData.weekEgldVolume desc"]},i=await this.api.fetchWithTimeout("/collection/query",{params:{filter:JSON.stringify(e)},next:{tags:["getCollections"],revalidate:180}});return{results:i,resultsCount:i.length,empty:0===i.length,getNextPagePayload:{...t,skip:(t?.skip||0)+(t?.top||25)},hasMoreResults:i.length>=(t?.top||25)}};getGlobalOffers=async t=>{if(t?.top&&t.top>25)throw new Error("Top cannot be greater than 25");const e={skip:t?.skip||0,top:t?.top||25,select:t?.onlySelectFields||[],filters:{collection:t?.collections||[],withAttributes:t?.withAttributes??!1,isActive:t?.onlyActive??!0,offerId:t?.offerIds,owner:t?.ownedBy,marketplace:t?.listedOnlyOn,range:t?.priceRange?{...t.priceRange,type:"priceShort"}:void 0,attributes:t?.attributes},orderBy:[t?.orderBy||n.PriceHighToLow]},i=await this.api.fetchWithTimeout("/collection/global-offer/query",{params:{filter:JSON.stringify(e)},next:{tags:["getGlobalOffers"],revalidate:12}});return{...i,getNextPagePayload:{...t,skip:(t?.top||25)+i.lastSkip}}};getCollectionVolume=async(t,e,i,a)=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/analytics/volume?startTime=${e}&endTime=${i}&bin=${a}`,{next:{tags:["getCollectionVolume"],revalidate:180}})};getMarketplaceVolume=async(t,e,i)=>await this.api.fetchWithTimeout(`/analytics/volume?startTime=${t}&endTime=${e}&bin=${i}`,{next:{tags:["getMarketplaceVolume"],revalidate:180}});getCollectionOwners=async t=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/holders`,{next:{tags:["getCollectionOwners"],revalidate:500}})};getExportOwners=async t=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/holders?exportHolders=true`,{next:{tags:["getExportOwners"]}})};getCollectionsStatistics=async t=>{if(t?.top&&t.top>25)throw new Error("Top cannot be greater than 25");return{...await this.api.fetchWithTimeout("/collection/stats/query",{params:{filter:JSON.stringify(t)},next:{tags:["collectionStatistics"],revalidate:12}}),getNextPagePayload:{...t,skip:t.skip+t.top}}};getCollectionStats=async t=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/stats`,{next:{tags:["collectionStatistics"],revalidate:12}})};getAwaitEmpty=async t=>new Promise((e=>{setTimeout((()=>{e(!0)}),t)}));getCollectionMintInfo=async({ticker:t,extra:e})=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/drop-info`,{next:{tags:[`/collection/${t}/drop-info`],revalidate:12},...e})};getCollectionRanks=async({ticker:t,extra:e})=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/ranks`,{next:{tags:[`/collection/${t}/ranks`],revalidate:60},...e})};getDropInfo=async({collectionTag:t,creatorTag:e,extra:i})=>await this.api.fetchWithTimeout(`/collection/${e}/${t}/drop-info`,{next:{tags:[`/collection/${e}/${t}/drop-info`],revalidate:12},...i});getCollectionGraphData=async(t,e,i,a)=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/analytics/volume`,{params:{startTime:e,endTime:i,bin:a},next:{tags:[`/collection/${t}/analytics/volume`],revalidate:60}})};getPinnedCollections=async()=>await this.api.fetchWithTimeout("/collection/pinned",{next:{tags:["/collection/pinned"],revalidate:60}});getDrops=async t=>{if(t?.collections?.forEach((t=>{if(!O(t))throw new Error("Invalid collection ticker: "+t)})),t.top&&t.top>35)throw new Error("Top cannot be greater than 35");const e=[];t.timeRange&&e.push({...t.timeRange,field:"startTime"});const i={filters:{collection:t.collections??[],verifiedOnly:t.onlyVerified||!1,mintToken:t.listedInToken||void 0,range:e},orderBy:t.orderBy||[],select:t.onlySelectFields||[],includeCount:t.includeCount||!1,top:t.top||35,skip:t.skip||0};return{...await this.api.fetchWithTimeout("/collection/drops/query",{params:{filter:JSON.stringify(i)},next:{tags:["/collection/drops/query"]},cache:"no-store"}),getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)}}};getCollectionStakingSummary=async({collection:t,extra:e})=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/staking/summary`,{...e})};getCollectionsFloor=async t=>{t?.forEach((t=>{if(!O(t))throw new Error("Invalid collection ticker: "+t)}));return await this.api.fetchWithTimeout("/collection/floor-price",{params:{collection:t.join(",")}})}}const N=t=>{let e=t.toString(16);return e.length%2!=0&&(e="0"+e),e},b=t=>{try{return t.includes("erd1")}catch(t){return!1}};class L{api;constructor(){this.api=I.init()}getNFTByIdentifier=async t=>{if(!P(t))throw new Error("Invalid identifier: "+t);return await this.api.fetchWithTimeout(`/nft/${t}`)};getNFTsOffers=async(t,e=0,i=25)=>{if(!P(t))throw new Error("Invalid identifier: "+t);return await this.api.fetchWithTimeout(`/nft/${t}/offers?skip=${e}&top=${i}`,{next:{tags:["getNFTsOffers"],revalidate:12}})};getNFTByCollectionAndNonce=async(t,e)=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);const i=await this.api.fetchWithTimeout(`/${((t,e)=>[t,N(e)].join("-"))(t,e)}`);return i};getNFTByCollectionAndNonceHex=async(t,e)=>{if(!O(t))throw new Error("Invalid collection ticker: "+t);e.length%2!=0&&(e="0"+e);return await this.api.fetchWithTimeout(`/${[t,e].join("-")}`)};getTradingActivity=async t=>await x(t,this.api)}class ${api;collection;constructor(){this.api=I.init(),this.collection=new M}getUserProfile=async t=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/profile`)};getBulkAccounts=async t=>await this.api.fetchWithTimeout("/user/network-account",{method:"POST",body:JSON.stringify(t)});getUserAccount=async t=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/network-account`)};getUserTokenInventory=async t=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/token-inventory`)};getUserSummaryInventory=async t=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/inventory-summary`)};getUserNFTs=async t=>await this.collection.getNFTs(t);getUserOffers=async t=>{if(!b(t.address))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t.address}/offers`,{params:{type:t.type,skip:t.skip,top:t.top}})};suggestUsers=async t=>{if(t.top&&t.top>35)throw new Error("Top cannot be greater than 35");if(!t.name)throw new Error("Name is required");const e={name:t.name,top:t.top||35,skip:t.skip||0};return await this.api.fetchWithTimeout("/user/search",{params:{filter:JSON.stringify(e)},next:{tags:["/search/global"],revalidate:180}})};getTradingActivity=async t=>await x(t,this.api);getUserCreatorProfile=async t=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/creator/profile`)};getCreatorListings=async t=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/creator/listing`)};getUserStakingSummary=async t=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/staking/summary`)};getUserStakingAailable=async t=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/staking/available-pools`)};getUserCreatorInfo=async t=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/creator/details`)};getUserCollectionStaking=async(t,e)=>{if(!b(t))throw new Error("Invalid address");if(!O(e))throw new Error("Invalid collection ticker: "+e);return await this.api.fetchWithTimeout(`/user/${t}/staking/collection/${e}`)};getUserPoolStaking=async(t,e)=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/staking/pool/${e}`)};getAvailableNFTsForStakingPool=async(t,e)=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/staking/pool/${e}/nfts`)};getOwnedPoolsByAddress=async t=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/staking/owned-pools`)};getUserAnalyticsSummary=async t=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/analytics/volume`)};getUserFavoriteNFTs=async(t,e,i)=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/favorite/nfts`,{params:{top:e,skip:i}})};getUserFavoriteCollectionTickers=async t=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/favorite/collections`)};getIsCreatorRegistered=async t=>await this.api.fetchWithTimeout(`/user/${t}/creator/is-registered`);getUsersStats=async({top:t,skip:e,orderBy:i})=>{if(t&&t>35)throw new Error("Top cannot be greater than 35");return await this.api.fetchWithTimeout("/user/stats",{params:{top:t,skip:e,orderBy:i??"totalVolume"},next:{tags:["/user/stats"],revalidate:180}})};getAccountNFTsToStake=async(t,e)=>await this.api.fetchWithTimeout(`/user/${t}/staking/pool/${e}/available-nfts`,{next:{tags:[`/user/${t}/staking/pool/${e}/available-nfts`],revalidate:30}});getStakingCreatorInfo=async t=>await this.api.fetchWithTimeout(`/user/${t}/staking/creator`,{next:{tags:[`/user/${t}/staking/creator`],revalidate:30}});getUsersDrop=async({top:t,skip:e,address:i})=>{if(t&&t>35)throw new Error("Top cannot be greater than 35");if(i&&!b(i))throw new Error("Invalid address");return await this.api.fetchWithTimeout("/user/xoxno-drop",{params:{top:t,skip:e,...i?{address:i}:{}},next:{tags:["/user/xoxno-drop"],revalidate:30}})};getUserOwnerCollections=async t=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/user/${t}/staking/owned-collections`)};getRoyaltiesSharesCreator=async t=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/launchpad/${t}/shareholders/royalties`)};getMintSharesCreator=async(t,e)=>{if(!b(t))throw new Error("Invalid address");return await this.api.fetchWithTimeout(`/launchpad/${t}/shareholders/collection/${e}`)}}class V{api;constructor(){this.api=I.init()}getPoolDetails=async t=>await this.api.fetchWithTimeout(`/pool/${t}/profile`)}class F{api;constructor(){this.api=I.init()}getTokensUsdPrice=async()=>await this.api.fetchWithTimeout("/tokens/usd-price");getAshSwapAmount=async({originalToken:t,originalTokenValue:e,paymentToken:i})=>await this.api.fetchWithTimeout("/ash/min-token-quantity",{params:{originalToken:t,originalTokenValue:e,paymentToken:i}});getFungibleTokens=async(t=[d.ALL],e)=>{let i={};e&&(i={identifier:e.join(",")}),t&&(i={...i,category:t.join(",")});return await this.api.fetchWithTimeout("/tokens",{params:i})};getGlobalGraphData=async(t,e,i)=>await this.api.fetchWithTimeout("/analytics/volume",{params:{startTime:t,endTime:e,bin:i},next:{tags:["/analytics/volume"],revalidate:60}});getAnalyticsOverview=async()=>await this.api.fetchWithTimeout("/analytics/overview",{next:{tags:["/analytics/overview"],revalidate:60}});suggestResults=async t=>{if(t.top&&t.top>35)throw new Error("Top cannot be greater than 35");if(!t.name)throw new Error("Name is required");const e={name:t.name,top:t.top||35,skip:t.skip||0};return await this.api.fetchWithTimeout("/search",{params:{filter:JSON.stringify(e)},next:{tags:["/search/global"],revalidate:180}})};getExploreStaking=async()=>await this.api.fetchWithTimeout("/collection/staking/explore",{next:{tags:["/collection/staking/explore"],revalidate:60}})}return v})()));
@@ -1 +1 @@
1
- var e,t={4487:(e,t,n)=>{n.d(t,{$C:()=>x,Yo:()=>p,LU:()=>v,JA:()=>E,he:()=>I,cO:()=>O,t7:()=>D,iQ:()=>b,Gq:()=>q,h4:()=>S,wT:()=>C,JM:()=>k,Vx:()=>M,xR:()=>$,O8:()=>y,o:()=>F,p4:()=>P,AQ:()=>V,J1:()=>R,$5:()=>X,g6:()=>_,cB:()=>L,I_:()=>A,ZU:()=>B});const a="https://api.xoxno.com",i="erd1qqqqqqqqqqqqqpgq705fxpfrjne0tl3ece0rrspykq88mynn4kxs2cg43s",r="erd1qqqqqqqqqqqqqpgqd9rvv2n378e27jcts8vfwynpx0gfl5ufz6hqhfy0u0",s="erd1qqqqqqqqqqqqqpgq8xwzu82v8ex3h4ayl5lsvxqxnhecpwyvwe0sf2qj4e";var o;!function(e){e.MAINNET="1",e.DEVNET="D"}(o||(o={}));class c{static instance;apiUrl;apiKey;chain;config;constructor(e=a,t="",n=o.MAINNET){this.apiUrl=e,this.apiKey=t,this.chain=n,this.config=n===o.MAINNET?{XO_SC:"erd1qqqqqqqqqqqqqpgq6wegs2xkypfpync8mn2sa5cmpqjlvrhwz5nqgepyg8",FM_SC:i,DR_SC:r,KG_SC:s,Staking_SC:"erd1qqqqqqqqqqqqqpgqvpkd3g3uwludduv3797j54qt6c888wa59w2shntt6z",Manager_SC:"erd1qqqqqqqqqqqqqpgqg9fa0dmpn8fu3fnleeqn5zt8rl8mdqjkys5s2gtas7",P2P_SC:"erd1qqqqqqqqqqqqqpgq47y8hnct68v6asjv6gxem6h9rumn9frzah0skhxxt6"}:{XO_SC:"erd1qqqqqqqqqqqqqpgqn4fnwl43hhchz9emdy66eh5azzhl599zd8ssxjdyh3",FM_SC:i,DR_SC:r,KG_SC:s,Staking_SC:"erd1qqqqqqqqqqqqqpgqmkt2fvumf0zgum5qd0awl2l46x2pxdgmr5rswjr6r8",Manager_SC:"erd1qqqqqqqqqqqqqpgq6sysl7mga393a850xemfpawaqanf4da5d8ssp3xamn",P2P_SC:"erd1qqqqqqqqqqqqqpgqhuvnvkwwmucdzy3g7pvgvjumjfcgfwf69w2svch5c2"}}static init({apiUrl:e=a,apiKey:t="",chain:n=o.MAINNET}={}){return c.instance||(n==o.DEVNET&&(c.instance=new c("https://api-dev.xoxno.com",t,n)),c.instance=new c(e,t,n)),c.instance}fetchWithTimeout=async(e,t={},n=4e4)=>{const a={"Accept-Encoding":"gzip,deflate,br",Referer:"https://xoxno.sdk","User-Agent":"XOXNO/1.0/SDK",..."POST"===t.method?{"Content-Type":"application/json"}:{},...t.headers??{}},i=`${"string"==typeof e&&e.startsWith("/")?`${this.apiUrl}${e}`:e}${t.params?"?"+Object.keys(t.params).map((e=>`${e}=${encodeURIComponent(t.params[e])}`)).join("&"):""}`,r=new AbortController;setTimeout((()=>r.abort()),n);const s=await fetch(i,{...t,...t?.next&&t.next.revalidate?{}:{cache:"no-store"},signal:r.signal,...Object.keys(a).length?{headers:a}:{},method:t.method??"GET"});if(!s.ok)throw new Error((await s.json()).message.toString());return s.json()}}var l=n(2528),d=n(8403);class u{proxy;parser=new l.ResultsParser;constructor(){const e=c.init().apiUrl;this.proxy=new d.ProxyNetworkProvider(e,{timeout:1e4})}async runQuery(e,t){try{const e=await this.proxy.queryContract(t.buildQuery());return this.parser.parseQueryResponse(e,t.getEndpoint())}catch(n){throw console.log(`Unexpected error when running query '${t.buildQuery().func}' to sc '${e.getAddress().bech32()}' `),console.error(n),n}}}var h=n(4966);class g{static manager;static exchange;static minter;static market;static staking;static p2p;static async getMarket(){if(!g.market){const e=await c.init().fetchWithTimeout("https://media.xoxno.com/smartcontractabi/esdt-nft-marketplace.abi.json",{next:{tags:["getMarket"]}}),t=h.AbiRegistry.create(e);g.market=t}return g.market}static async getManager(){if(!g.manager){const e=await c.init().fetchWithTimeout("https://media.xoxno.com/smartcontractabi/manage.json",{next:{tags:["getManager"]}}),t=h.AbiRegistry.create(e);g.manager=t}return g.manager}static async getMinter(){if(!g.minter){const e=await c.init().fetchWithTimeout("https://media.xoxno.com/smartcontractabi/minter.json",{next:{tags:["getMinter"]}}),t=h.AbiRegistry.create(e);g.minter=t}return g.minter}static async getStaking(){if(!g.staking){const e=await c.init().fetchWithTimeout("https://media.xoxno.com/smartcontractabi/staking-nfts.abi.json",{next:{tags:["getStaking"]}}),t=h.AbiRegistry.create(e);g.staking=t}return g.staking}static async getExchange(){if(!g.exchange){const e=await c.init().fetchWithTimeout("https://media.xoxno.com/smartcontractabi/rs-exchange.abi.json",{next:{tags:["getExchange"]}}),t=h.AbiRegistry.create(e);g.exchange=t}return g.exchange}static async getP2P(){if(!g.p2p){const e=await c.init().fetchWithTimeout("https://media.xoxno.com/smartcontractabi/p2p.abi.json",{next:{tags:["getP2P"],revalidate:500}}),t=h.AbiRegistry.create(e);g.p2p=t}return g.p2p}}var m=n(236),f=n(1998);const w=(e,t)=>new f.SmartContract({address:new m.Address(t),abi:e});var p,T=n(4473);!function(e){e[e.NftBid=0]="NftBid",e[e.Nft=1]="Nft",e[e.SftAll=2]="SftAll",e[e.SftOnePerPayment=3]="SftOnePerPayment"}(p||(p={}));var y,S,_,q,A,D,k,O,C,v,x,b,I,E,F,V,L,M,R,P,B,N=n(1594),U=n.n(N),G=n(7586),W=n(3145),H=n(5766),j=n(3979),z=n(5132);class X{xo;call;api;constructor(e){this.xo=e,this.call=new u,this.api=c.init()}static async init(){const e=c.init().config,t=await g.getMarket(),n=w(t,e.XO_SC);return new X(n)}async getResult(e){return await this.call.runQuery(this.xo,e)}getMarketplaceFees=async()=>{const e=this.xo.methods.getMarketplaceCutPercentage(),t=await this.getResult(e);return parseInt(t.firstValue?.valueOf())};getAcceptedPaymentTokens=async()=>{const e=this.xo.methods.getAcceptedTokens(),t=await this.getResult(e);return t.firstValue?.valueOf()};getGlobalOfferIDs=async()=>{const e=this.xo.methods.getGlobalOffers(),t=await this.getResult(e);return t.firstValue?.valueOf().map((e=>parseInt(e)))};async getUserPoolBalance(e,t,n){const a=await this.getResult(this.xo.methods.userDeposit([e,t,n]));return a?.firstValue?new T.BigUIntValue(a.firstValue.valueOf().amount).valueOf().shiftedBy(-18).toNumber():0}isOfferActive(e,t){return e<=t}getGlobalOfferData=async e=>{const t=this.xo.methods.getGlobalOffer([e]),n=await this.getResult(t),a=n.firstValue?.valueOf();return a.offer_id=parseInt(a.offer_id.valueOf()),a.marketplace="XO",a.short_price=parseFloat(new T.BigUIntValue(a.price).valueOf().shiftedBy(-18).toString()),a.new_version=Boolean(a.new_version),a.new_version?a.isActive=!0:a.isActive=this.isOfferActive(a.short_price,await this.getUserPoolBalance(a.owner,a.payment_token,a.payment_nonce)),a.quantity=parseInt(a.quantity.valueOf()),a.payment_nonce=parseInt(a.payment_nonce.valueOf()),a.price=a.price.valueOf(),a.timestamp=parseInt(a.timestamp.valueOf()),a.owner=a.owner.valueOf().toString(),a.attributes&&(a.attributes=JSON.parse(Buffer.from(a.attributes.valueOf().toString(),"base64").toString("ascii"))),a};getAuctionInfo=async e=>{const t=this.xo.methods.getFullAuctionData([e]),n=await this.getResult(t),a=n.firstValue?.valueOf();return a?(a.auctioned_token_nonce=parseInt(a.auctioned_token_nonce.valueOf()),a.nr_auctioned_tokens=parseInt(a.nr_auctioned_tokens.valueOf()),a.auction_type=a.auction_type.name,a.payment_token_nonce=parseInt(a.payment_token_nonce.valueOf()),a.min_bid=a.min_bid.valueOf(),a.max_bid=a.max_bid.valueOf(),a.start_time=parseInt(a.start_time.valueOf()),a.deadline=parseInt(a.deadline.valueOf()),a.original_owner=a.original_owner.valueOf().toString(),a.current_winner=a.current_winner.valueOf().toString(),a.current_bid=a.current_bid.valueOf().toString(),a.marketplace_cut_percentage=a.marketplace_cut_percentage.valueOf(),a.creator_royalties_percentage=a.creator_royalties_percentage.valueOf(),a):null};async getListingsCount(){const e=await this.getResult(this.xo.methods.getListingsCount());return parseInt(e.firstValue?.valueOf())}async getOffersCount(){const e=await this.getResult(this.xo.methods.getOffersCount());return parseInt(e.firstValue?.valueOf())}async getGlobalOffersCount(){const e=await this.getResult(this.xo.methods.getGlobalOffersCount());return parseInt(e.firstValue?.valueOf())}async getCollectionsCount(){const e=await this.getResult(this.xo.methods.getCollectionsCount());return parseInt(e.firstValue?.valueOf())}async isCollectionListed(e){const t=await this.getResult(this.xo.methods.isCollectionListed([e]));return Boolean(t.firstValue?.valueOf())}async getCollectionNFTsOnSaleCount(e){const t=await this.getResult(this.xo.methods.getTokenItemsForSaleCount([e]));return parseInt(t.firstValue?.valueOf())}async getAuctionIDsForCollection(e){const t=await this.getResult(this.xo.methods.getAuctionsForTicker([e])),n=t.firstValue?.valueOf().map((e=>parseInt(e)));return n}withdrawAuctions(e,t,n){if("XO"===n){const n=this.xo.methods.withdraw(e);return t.nonce&&n.withNonce(t.nonce),n.withChainID(this.api.chain).withSender(new m.Address(t.address)).withGasLimit(Math.min(6e8,15e6+5e6*e.length))}throw new Error("Market not supported")}withdrawGlobalOffer(e,t){const n=this.xo.methods.withdrawGlobalOffer([e]);return t.nonce&&n.withNonce(t.nonce),n.withChainID(this.api.chain).withSender(new m.Address(t.address)).withGasLimit(15e6)}acceptGlobalOffer({signature:e,offer_id:t,auction_id_opt:n,nft:a,address:i,nonce:r}){const s=e?this.xo.methods.acceptGlobalOffer([t,n,e]):this.xo.methods.acceptGlobalOffer([t,n]);return s.withSender(new m.Address(i)),a&&s.withSingleESDTNFTTransfer(z.TokenTransfer.semiFungible(a.collection,a.nonce,a.amount??1)),r&&s.withNonce(r),s.withChainID(this.api.chain).withGasLimit(3e7)}sendGlobalOffer({payment_token:e,payment_nonce:t,price:n,collection:a,attributes:i,depositAmount:r,address:s,nonce:o}){const c=i?this.xo.methods.sendGlobalOffer([e,t,z.TokenTransfer.egldFromAmount(n).toString(),a,i]):this.xo.methods.sendGlobalOffer([e,t,z.TokenTransfer.egldFromAmount(n).toString(),a]);return o&&c.withNonce(o),c.withSender(new m.Address(s)),r&&c.withValue(z.TokenTransfer.egldFromAmount(r)),c.withChainID(this.api.chain).withGasLimit(3e7)}sendCustomOffer({payment_token:e,payment_nonce:t,price:n,deadline:a,nft:i,depositAmount:r,address:s,nonce:o}){const c=this.xo.methods.sendOffer([e,t,z.TokenTransfer.egldFromAmount(n).toString(),i.collection,i.nonce,i.amount??1,a]);return o&&c.withNonce(o),c.withSender(new m.Address(s)),r&&c.withValue(z.TokenTransfer.egldFromAmount(r)),c.withChainID(this.api.chain).withGasLimit(3e7)}withdrawCustomOffer(e,t){const n=this.xo.methods.withdrawOffer([e]);return t.nonce&&n.withNonce(t.nonce),n.withSender(new m.Address(t.address)),n.withChainID(this.api.chain).withGasLimit(15e6)}declineCustomOffer(e,t,n){const a=this.xo.methods.declineOffer([e]);return t.nonce&&a.withNonce(t.nonce),a.withSender(new m.Address(t.address)),n&&a.withSingleESDTNFTTransfer(z.TokenTransfer.semiFungible(n.collection,n.nonce,n.amount??1)),a.withChainID(this.api.chain).withGasLimit(2e7)}acceptCustomOffer(e,t,n){const a=this.xo.methods.acceptOffer([e]);return t.nonce&&a.withNonce(t.nonce),a.withSender(new m.Address(t.address)),n&&a.withSingleESDTNFTTransfer(z.TokenTransfer.semiFungible(n.collection,n.nonce,n.amount??1)),a.withChainID(this.api.chain).withGasLimit(3e7)}endAuction(e,t,n="XO"){if("XO"==n){const n=this.xo.methods.endAuction([e]);return t.nonce&&n.withNonce(t.nonce),n.withSender(new m.Address(t.address)),n.withChainID(this.api.chain).withGasLimit(15e6)}throw new Error("Market not supported")}bidOnAuctionId(e,t,n,a,i){const r=this.xo.methods.bid([e,t,n]);if(!a.amount)throw new Error("Payment amount is required");return i.nonce&&r.withNonce(i.nonce),r.withSender(new m.Address(i.address)),"EGLD"==a.collection&&a.amount?r.withValue(z.TokenTransfer.egldFromAmount(a.amount)):r.withSingleESDTTransfer(z.TokenTransfer.fungibleFromAmount(a.collection,a.amount,a.decimals??18)),r.withChainID(this.api.chain).withGasLimit(3e7)}bulkBuy(e,t,n){const a=this.xo.methods.bid(e);if(n.nonce&&a.withNonce(n.nonce),a.withSender(new m.Address(n.address)),!t.amount)throw new Error("Payment amount is required");return"EGLD"==t.collection&&t.amount?a.withValue(z.TokenTransfer.egldFromAmount(t.amount)):a.withSingleESDTTransfer(z.TokenTransfer.fungibleFromAmount(t.collection,t.amount,t.decimals??18)),a.withChainID(this.api.chain).withGasLimit(Math.min(6e8,2e7+5e6*e.length))}async buyAuctionById({auctionID:e,collection:t,nonce:n,paymentAmount:a,quantity:i=1,token:r="EGLD",withCheck:s=!0,isBigUintPayment:o=!1,address:c,nonce:l,isBid:d=!1,decimals:u=18,market:h="XO"}){if("XO"!==h)throw new Error("Market not supported");if(!e)throw new Error("AuctionID not provided");let g=null;if(!a||!r||!t||!n||s){if(g=await this.getAuctionInfo(e),null===g)throw new Error("Auction not found");if(g.auction_type===p.Nft||g.auction_type===p.SftOnePerPayment)throw new Error("Auction type is not NFT or SftOnePerPayment")}const f=g?.payment_token_type??r,w=!!g||o;let T=d?g?.max_bid??a:g?.min_bid??a;if(!T)throw new Error("Payment amount not provided");const y=this.xo.methods.buy([e,g?.auctioned_token_type??t,g?.auctioned_token_nonce??n,i??1]);if(l&&y.withNonce(l),y.withSender(new m.Address(c)),"EGLD"===r)y.withValue(w?z.TokenTransfer.egldFromBigInteger(new(U())(T).multipliedBy(i)):z.TokenTransfer.egldFromAmount(new(U())(T).multipliedBy(i)));else{if(!w){if(g=await this.getAuctionInfo(e),null===g)throw new Error("Auction not found");T=d?g.max_bid:g.min_bid}y.withSingleESDTTransfer(z.TokenTransfer.fungibleFromBigInteger(f,T,u))}return y.withChainID(this.api.chain).withGasLimit(2e7)}async changeListing(e,t){const n=new G.StructType("BulkUpdateListing",[new H.FieldDefinition("payment_token_type","",new W.TokenIdentifierType),new H.FieldDefinition("new_price","",new T.BigUIntType),new H.FieldDefinition("auction_id","",new T.U64Type),new H.FieldDefinition("deadline","",new T.U64Type)]),a=[];e.forEach((({paymentToken:e,price:t,auctionID:i,deadline:r})=>{a.push(new G.Struct(n,[new H.Field(new W.TokenIdentifierValue(e),"payment_token_type"),new H.Field(new T.BigUIntValue(t),"new_price"),new H.Field(new T.U64Value(i),"auction_id"),new H.Field(new T.U64Value(r),"deadline")]))}));const i=this.xo.methods.changeListing(a);return t.nonce&&i.withNonce(t.nonce),i.withSender(new m.Address(t.address)),i.withChainID(this.api.chain).withGasLimit(Math.min(6e8,8e6+2e6*e.length))}async listNFTs(e,t){const n=new G.StructType("BulkListing",[new H.FieldDefinition("min_bid","",new T.BigUIntType),new H.FieldDefinition("max_bid","",new T.BigUIntType),new H.FieldDefinition("deadline","",new T.U64Type),new H.FieldDefinition("accepted_payment_token","",new W.TokenIdentifierType),new H.FieldDefinition("bid","",new j.BooleanType),new H.FieldDefinition("opt_sft_max_one_per_payment","",new j.BooleanType),new H.FieldDefinition("opt_start_time","",new T.U64Type),new H.FieldDefinition("collection","",new W.TokenIdentifierType),new H.FieldDefinition("nonce","",new T.U64Type),new H.FieldDefinition("nft_amount","",new T.BigUIntType)]),a=[],i=[];e.forEach((e=>{const t=e.accepted_payment_token_decimals??18,r=new(U())(e.min_bid).shiftedBy(t),s=new(U())(e.max_bid??0).shiftedBy(t);i.push(z.TokenTransfer.semiFungible(e.collection,e.nonce,e.nft_amount)),a.push(new G.Struct(n,[new H.Field(new T.BigUIntValue(r),"min_bid"),new H.Field(new T.BigUIntValue(s),"max_bid"),new H.Field(new T.U64Value(new(U())(e.deadline??0)),"deadline"),new H.Field(new W.TokenIdentifierValue(e.accepted_payment_token??"EGLD"),"accepted_payment_token"),new H.Field(new j.BooleanValue(e.bid??!1),"bid"),new H.Field(new j.BooleanValue(e.isSFTPack??!1),"opt_sft_max_one_per_payment"),new H.Field(new T.U64Value(new(U())(e.opt_start_time?e.opt_start_time:0)),"opt_start_time"),new H.Field(new W.TokenIdentifierValue(e.collection),"collection"),new H.Field(new T.U64Value(e.nonce),"nonce"),new H.Field(new T.BigUIntValue(new(U())(e.nft_amount)),"nft_amount")]))}));const r=this.xo.methods.listings(a);return t.nonce&&r.withNonce(t.nonce),r.withSender(new m.Address(t.address)),r.withMultiESDTNFTTransfer(i),r.withChainID(this.api.chain).withGasLimit(Math.min(6e8,8e6+2e6*e.length))}}class ${minter;call;constructor(e){this.minter=e,this.call=new u}async getResult(e){return await this.call.runQuery(this.minter,e)}static async init(e){const t=await g.getMinter(),n=w(t,e);return new $(n)}getAllUniqueTags=async()=>{const e=this.minter.methods.collections(),t=await this.getResult(e);return t.firstValue?.valueOf().map((e=>e.toString()))};getWalletGlobalBuyCount=async(e,t)=>{const n=this.minter.methods.buysPerWallet([e,t]),a=await this.getResult(n);return a.firstValue?.valueOf()};getWalletStageBuyCount=async(e,t,n)=>{const a=this.minter.methods.buysStagePerWallet([e,t,n]),i=await this.getResult(a);return i.firstValue?.valueOf()};getLocalOwner=async()=>{const e=this.minter.methods.localOwner(),t=await this.getResult(e);return t.firstValue?.valueOf()};getLaunchpadCutFee=async()=>{const e=this.minter.methods.cutPercentage(),t=await this.getResult(e);return t.firstValue?.valueOf()};getStageWhitelist=async(e,t)=>{const n=this.minter.methods.getWhitelistedWallets([e,t]),a=await this.getResult(n);return a.firstValue?.valueOf().map((e=>e.toString()))};getStages=async e=>{const t=this.minter.methods.mintStage([e]),n=await this.getResult(t);return n.firstValue?.valueOf().map((e=>{const t=e[1].valueOf();return t.name=t.name.toString(),t.tag=t.name.toString(),t.start_time=parseInt(t.start_time.toString()),t.end_time=parseInt(t.end_time.toString()),t.mint_limit=parseInt(t.mint_limit.toString()),t.mint_count=parseInt(t.mint_count.toString()),t.max_per_wallet=parseInt(t.max_per_wallet.toString()),t.prices=t.prices.map((e=>{const t=e.valueOf();return{...t,token_nonce:parseInt(t.token_nonce.toString()),amount:t.amount.toString()}})),t}))}}!function(e){e.XO="xoxno",e.FM="frameit",e.DR="deadrare",e.KG="krogan"}(y||(y={})),function(e){e.Rank="metadata.rarity.rank",e.Attributes="metadata.attributes",e.Description="metadata.description",e.Name="name",e.OnSale="onSale",e.SaleInfo="saleInfo",e.Royalties="royalties",e.Identifier="identifier",e.Collection="collection",e.OriginalURL="url",e.Nonce="nonce",e.ContentType="originalMedia.contentType",e.WasProcessed="wasProcessed",e.AvifURL="avifUrl",e.WebpURL="webpUrl",e.Type="type"}(S||(S={})),function(e){e.PriceHighToLow="saleInfo.minBidShort desc",e.PriceLowToHigh="saleInfo.minBidShort asc",e.MaxPriceHighToLow="saleInfo.maxBidShort desc",e.MaxPriceLowToHigh="saleInfo.maxBidShort asc",e.BidPriceHighToLow="saleInfo.currentBidShort desc",e.BidPriceLowToHigh="saleInfo.currentBidShort asc",e.RarityHighToLow="metadata.rarity.rank desc",e.RarityLowToHigh="metadata.rarity.rank asc",e.NonceHighToLow="nonce desc",e.NonceLowToHigh="nonce asc",e.RecentListed="saleInfo.timestamp desc",e.OldestListed="saleInfo.timestamp asc",e.EndingLate="saleInfo.deadline desc",e.EndingSoon="saleInfo.deadline asc"}(_||(_={})),function(e){e.EndingLate="startTime desc",e.EndingSoon="startTime asc"}(q||(q={})),function(e){e.TotalVolumeHighToLow="statistics/tradeData/totalEgldVolume desc",e.FollowersHighToLow="statistics/other/followCount desc",e.IsVerifiedTrueToFalse="isVerified desc",e.HasImageTrueToFalse="profile desc",e.HasBannerTrueToFalse="banner desc"}(A||(A={})),function(e){e.WeekVolumeHighToLow="statistics.tradeData.weekEgldVolume desc",e.WeekVolumeLowToHigh="statistics.tradeData.weekEgldVolume asc",e.DailyVolumeHighToLow="statistics.tradeData.dayEgldVolume desc",e.DailyVolumeLowToHigh="statistics.tradeData.dayEgldVolume asc",e.TotalVolumeHighToLow="statistics.tradeData.totalEgldVolume desc",e.TotalVolumeLowToHigh="statistics.tradeData.totalEgldVolume asc",e.AvgVolumePriceHighToLow="statistics.tradeData.averageEgldPrice desc",e.AvgVolumePriceLowToHigh="statistics.tradeData.averageEgldPrice asc",e.ATHHighToLow="statistics.tradeData.athEgldPrice desc",e.ATHLowToHigh="statistics.tradeData.athEgldPrice asc",e.TotalTradesHighToLow="statistics.tradeData.totalTrades desc",e.TotalTradesLowToHigh="statistics.tradeData.totalTrades asc",e.SupplyHighToLow="statistics.other.nftCount desc",e.SupplyLowToHigh="statistics.other.nftCount asc",e.FollowersHighToLow="statistics.other.followCount desc",e.FollowersLowToHigh="statistics.other.followCount asc"}(D||(D={})),function(e){e.PriceHighToLow="priceShort desc",e.PriceLowToHigh="priceShort asc",e.OfferIdHighToLow="offerIddesc",e.OfferIdLowToHigh="offerId asc",e.RecentListed="timestamp desc",e.OldestListed="timestamp asc"}(k||(k={})),function(e){e.Profile="profile",e.Description="description",e.Creator="creator",e.Owner="owner",e.Socials="socials",e.Type="type",e.HasStaking="hasStaking",e.Name="name",e.Banner="banner",e.IsVerified="isVerified",e.IsMintable="isMintable",e.Statistics="statistics",e.Collection="collection"}(O||(O={})),function(e){e.Attributes="attributes",e.Collection="collection",e.Marketplace="marketplace",e.PaymentToken="paymentToken",e.LongPrice="price",e.ShortPrice="priceShort"}(C||(C={})),function(e){e.FixedPrice="FixedPrice",e.Auctions="Auctions",e.All="All",e.AllListed="AllListed"}(v||(v={})),function(e){e.ALL="all",e.Trade="trade",e.P2P="p2p",e.Staking="staking",e.Minting="minting"}(x||(x={})),function(e){e.TotalVolume="TotalVolume",e.TotalTrades="TotalTrades",e.DailyVolume="DailyVolume",e.Last2DaysVolume="Last2DaysVolume",e.DailyTrades="DailyTrades",e.Last2DaysTrades="Last2DaysTrades",e.WeekTrades="WeekTrades",e.LastWeekTrades="LastWeekTrades",e.WeekVolume="WeekVolume",e.LastWeekVolume="LastWeekVolume",e.WeeklyTradesMargin="WeeklyTradesMargin",e.DailyTradesMargin="DailyTradesMargin",e.WeeklyVolumeMargin="WeeklyVolumeMargin",e.DailyVolumeEgldMargin="DailyVolumeEgldMargin",e.CollectionAthTrade="CollectionAthTrade"}(b||(b={})),function(e){e.TradingStats="tradingStats"}(I||(I={})),function(e){e.ListedCountDesc="tradingStats.listedCount DESC",e.ListedCountAsc="tradingStats.listedCount ASC",e.FloorPriceDesc="tradingStats.floorPrice DESC",e.FloorPriceAsc="tradingStats.floorPrice ASC",e.TotalVolumeDesc="tradingStats.totalVolume DESC",e.TotalVolumeAsc="tradingStats.totalVolume ASC",e.TotalTradesDesc="tradingStats.totalTrades DESC",e.TotalTradesAsc="tradingStats.totalTrades ASC",e.AllTimeHighDesc="tradingStats.allTimeHigh.price DESC",e.AllTimeHighAsc="tradingStats.allTimeHigh.price ASC",e.DayVolumeDesc="tradingStats.day.volume DESC",e.DayVolumeAsc="tradingStats.day.volume ASC",e.DayVolumeMarginDesc="tradingStats.day.volumeMargin DESC",e.DayVolumeMarginAsc="tradingStats.day.volumeMargin ASC",e.DayTradesDesc="tradingStats.day.trades DESC",e.DayTradesAsc="tradingStats.day.trades ASC",e.DayTradesMarginDesc="tradingStats.day.tradesMargin DESC",e.DayTradesMarginAsc="tradingStats.day.tradesMargin ASC",e.WeekVolumeDesc="tradingStats.week.volume DESC",e.WeekVolumeAsc="tradingStats.week.volume ASC",e.WeekVolumeMarginDesc="tradingStats.week.volumeMargin DESC",e.WeekVolumeMarginAsc="tradingStats.week.volumeMargin ASC",e.WeekTradesDesc="tradingStats.week.trades DESC",e.WeekTradesAsc="tradingStats.week.trades ASC",e.WeekTradesMarginDesc="tradingStats.week.tradesMargin DESC",e.WeekTradesMarginAsc="tradingStats.week.tradesMargin ASC",e.MonthVolumeDesc="tradingStats.month.volume DESC",e.MonthVolumeAsc="tradingStats.month.volume ASC",e.MonthVolumeMarginDesc="tradingStats.month.volumeMargin DESC",e.MonthVolumeMarginAsc="tradingStats.month.volumeMargin ASC",e.MonthTradesDesc="tradingStats.month.trades DESC",e.MonthTradesAsc="tradingStats.month.trades ASC",e.MonthTradesMarginDesc="tradingStats.month.tradesMargin DESC",e.MonthTradesMarginAsc="tradingStats.month.tradesMargin ASC",e.YearVolumeDesc="tradingStats.year.volume DESC",e.YearVolumeAsc="tradingStats.year.volume ASC",e.YearVolumeMarginDesc="tradingStats.year.volumeMargin DESC",e.YearVolumeMarginAsc="tradingStats.year.volumeMargin ASC",e.YearTradesDesc="tradingStats.year.trades DESC",e.YearTradesAsc="tradingStats.year.trades ASC",e.YearTradesMarginDesc="tradingStats.year.tradesMargin DESC",e.YearTradesMarginAsc="tradingStats.year.tradesMargin ASC"}(E||(E={})),function(e){e.NFT_CREATE="nftCreate",e.NFT_BURN="nftBurn",e.NFT_UPDATE="nftUpdate",e.NFT_TRANSFER="nftTransfer",e.LISTING_CREATE="listingCreate",e.LISTING_WITHDRAW="listingWithdraw",e.LISTING_UPDATE="listingUpdate",e.AUCTION_BID="auctionBid",e.AUCTION_OUT_BID="auctionOutBid",e.OFFER_CREATE="offerCreate",e.OFFER_WITHDRAW="offerWithdraw",e.OFFER_REJECT="offerReject",e.GLOBAL_OFFER_CREATE="globalOfferCreate",e.GLOBAL_OFFER_WITHDRAW="globalOfferWithdraw",e.TRADE="trade",e.BULK_TRADE="bulkTrade",e.AUCTION_TRADE="auctionTrade",e.OTHER_TRADE="otherTrade",e.OFFER_TRADE="offerTrade",e.GLOBAL_OFFER_TRADE="globalOfferTrade",e.STAKE="stake",e.UN_STAKE="unStake"}(F||(F={})),function(e){e.PriceHighToLow="activityData.egldValue desc",e.PriceLowToHigh="activityData.egldValue asc",e.RecentPlaced="timestamp desc",e.OldestPlaced="timestamp asc"}(V||(V={})),function(e){e[e.attributes=0]="attributes",e[e.collection=1]="collection",e[e.offer_id=2]="offer_id",e[e.owner=3]="owner",e[e.short_price=4]="short_price",e[e.price=5]="price",e[e.id=6]="id",e[e.dataType=7]="dataType",e[e.marketplace=8]="marketplace",e[e.payment_token=9]="payment_token"}(L||(L={})),function(e){e.Dynamic="Dynamic",e.Fixed="Fixed"}(M||(M={})),function(e){e.Duo="Duo",e.Single="Single",e.Perk="Perk"}(R||(R={})),function(e){e.Received="received",e.Placed="placed"}(P||(P={})),function(e){e.NonFungibleESDT="NonFungibleESDT"}(B||(B={}))},5340:()=>{},9838:()=>{}},n={};function a(e){var i=n[e];if(void 0!==i)return i.exports;var r=n[e]={exports:{}};return t[e].call(r.exports,r,r.exports,a),r.exports}a.m=t,e=[],a.O=(t,n,i,r)=>{if(!n){var s=1/0;for(d=0;d<e.length;d++){for(var[n,i,r]=e[d],o=!0,c=0;c<n.length;c++)(!1&r||s>=r)&&Object.keys(a.O).every((e=>a.O[e](n[c])))?n.splice(c--,1):(o=!1,r<s&&(s=r));if(o){e.splice(d--,1);var l=i();void 0!==l&&(t=l)}}return t}r=r||0;for(var d=e.length;d>0&&e[d-1][2]>r;d--)e[d]=e[d-1];e[d]=[n,i,r]},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={954:0};a.O.j=t=>0===e[t];var t=(t,n)=>{var i,r,[s,o,c]=n,l=0;if(s.some((t=>0!==e[t]))){for(i in o)a.o(o,i)&&(a.m[i]=o[i]);if(c)var d=c(a)}for(t&&t(n);l<s.length;l++)r=s[l],a.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return a.O(d)},n=this.webpackChunk_xoxno_sdk_js=this.webpackChunk_xoxno_sdk_js||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var i=a.O(void 0,[711],(()=>a(4487))),r=(i=a.O(i)).$C,s=i.Yo,o=i.LU,c=i.JA,l=i.he,d=i.cO,u=i.t7,h=i.iQ,g=i.Gq,m=i.h4,f=i.wT,w=i.JM,p=i.Vx,T=i.xR,y=i.O8,S=i.o,_=i.p4,q=i.AQ,A=i.J1,D=i.$5,k=i.g6,O=i.cB,C=i.I_,v=i.ZU;export{r as AssetCategory,s as AuctionType,o as AuctionTypes,c as CollectionStatsOrderBy,l as CollectionStatsSelectFields,d as CollectionsFieldsToSelect,u as CollectionsOrderBy,h as CollectionsSummaryFilter,g as DropsOderBy,m as FieldsToSelect,f as GlobalOfferFieldsToSelect,w as GlobalOfferOrderBy,p as IssuingType,T as LaunchpadModule,y as Marketplace,S as NftActivityType,_ as OfferType,q as OrderByTradingActivity,A as PoolType,D as SCInteraction,k as SearchOrderBy,O as SelectFieldsTradingActivity,C as SuggestOrderBy,v as Type};
1
+ var e,t={4487:(e,t,n)=>{n.d(t,{$C:()=>x,Yo:()=>p,LU:()=>v,JA:()=>E,he:()=>I,cO:()=>O,t7:()=>k,iQ:()=>b,Gq:()=>_,h4:()=>S,wT:()=>C,JM:()=>D,Vx:()=>M,xR:()=>z,O8:()=>y,o:()=>F,p4:()=>P,AQ:()=>V,J1:()=>R,$5:()=>$,g6:()=>q,cB:()=>L,I_:()=>A,ZU:()=>B});const a="https://api.xoxno.com",i="erd1qqqqqqqqqqqqqpgq705fxpfrjne0tl3ece0rrspykq88mynn4kxs2cg43s",r="erd1qqqqqqqqqqqqqpgqd9rvv2n378e27jcts8vfwynpx0gfl5ufz6hqhfy0u0",s="erd1qqqqqqqqqqqqqpgq8xwzu82v8ex3h4ayl5lsvxqxnhecpwyvwe0sf2qj4e";var o;!function(e){e.MAINNET="1",e.DEVNET="D"}(o||(o={}));class c{static instance;apiUrl;apiKey;chain;config;constructor(e=a,t="",n=o.MAINNET){this.apiUrl=e,this.apiKey=t,this.chain=n,this.config=n===o.MAINNET?{XO_SC:"erd1qqqqqqqqqqqqqpgq6wegs2xkypfpync8mn2sa5cmpqjlvrhwz5nqgepyg8",FM_SC:i,DR_SC:r,KG_SC:s,Staking_SC:"erd1qqqqqqqqqqqqqpgqvpkd3g3uwludduv3797j54qt6c888wa59w2shntt6z",Manager_SC:"erd1qqqqqqqqqqqqqpgqg9fa0dmpn8fu3fnleeqn5zt8rl8mdqjkys5s2gtas7",P2P_SC:"erd1qqqqqqqqqqqqqpgq47y8hnct68v6asjv6gxem6h9rumn9frzah0skhxxt6"}:{XO_SC:"erd1qqqqqqqqqqqqqpgql0dnz6n5hpuw8cptlt00khd0nn4ja8eadsfq2xrqw4",FM_SC:i,DR_SC:r,KG_SC:s,Staking_SC:"erd1qqqqqqqqqqqqqpgqsc5hnewwpep8qq0d7kjjzrquapuucrygah0s85zres",Manager_SC:"erd1qqqqqqqqqqqqqpgqluclyhfsa2uw7q9cjwd8knk989hg57u8ah0slq2nlr",P2P_SC:"erd1qqqqqqqqqqqqqpgqfja7ukpngrun78ueq583l0vd6aj4ekhrah0sa9wyrv"}}static init({apiUrl:e=a,apiKey:t="",chain:n=o.MAINNET}={}){if(!c.instance){if(n==o.DEVNET)return c.instance=new c(e??"https://devnet-api.xoxno.com",t,n),c.instance;c.instance=new c(e,t,n)}return c.instance}fetchWithTimeout=async(e,t={},n=4e4)=>{const a={"Accept-Encoding":"gzip,deflate,br",Referer:"https://xoxno.sdk","User-Agent":"XOXNO/1.0/SDK",..."POST"===t.method?{"Content-Type":"application/json"}:{},...t.headers??{}},i=`${"string"==typeof e&&e.startsWith("/")?`${this.apiUrl}${e}`:e}${t.params?"?"+Object.keys(t.params).map((e=>`${e}=${encodeURIComponent(t.params[e])}`)).join("&"):""}`,r=new AbortController;setTimeout((()=>r.abort()),n);const s=await fetch(i,{...t,...t?.next&&t.next.revalidate?{}:{cache:"no-store"},signal:r.signal,...Object.keys(a).length?{headers:a}:{},method:t.method??"GET"});if(!s.ok)throw new Error((await s.json()).message.toString());return s.json()}}var l=n(2528),d=n(8403);class u{proxy;parser=new l.ResultsParser;constructor(){const e=c.init().apiUrl;this.proxy=new d.ProxyNetworkProvider(e,{timeout:1e4})}async runQuery(e,t){try{const e=await this.proxy.queryContract(t.buildQuery());return this.parser.parseQueryResponse(e,t.getEndpoint())}catch(n){throw console.log(`Unexpected error when running query '${t.buildQuery().func}' to sc '${e.getAddress().bech32()}' `),console.error(n),n}}}var h=n(4966);class g{static manager;static exchange;static minter;static market;static staking;static p2p;static async getMarket(){if(!g.market){const e=await c.init().fetchWithTimeout("https://media.xoxno.com/smartcontractabi/esdt-nft-marketplace.abi.json",{next:{tags:["getMarket"]}}),t=h.AbiRegistry.create(e);g.market=t}return g.market}static async getManager(){if(!g.manager){const e=await c.init().fetchWithTimeout("https://media.xoxno.com/smartcontractabi/manage.json",{next:{tags:["getManager"]}}),t=h.AbiRegistry.create(e);g.manager=t}return g.manager}static async getMinter(){if(!g.minter){const e=await c.init().fetchWithTimeout("https://media.xoxno.com/smartcontractabi/minter.json",{next:{tags:["getMinter"]}}),t=h.AbiRegistry.create(e);g.minter=t}return g.minter}static async getStaking(){if(!g.staking){const e=await c.init().fetchWithTimeout("https://media.xoxno.com/smartcontractabi/staking-nfts.abi.json",{next:{tags:["getStaking"]}}),t=h.AbiRegistry.create(e);g.staking=t}return g.staking}static async getExchange(){if(!g.exchange){const e=await c.init().fetchWithTimeout("https://media.xoxno.com/smartcontractabi/rs-exchange.abi.json",{next:{tags:["getExchange"]}}),t=h.AbiRegistry.create(e);g.exchange=t}return g.exchange}static async getP2P(){if(!g.p2p){const e=await c.init().fetchWithTimeout("https://media.xoxno.com/smartcontractabi/p2p.abi.json",{next:{tags:["getP2P"],revalidate:500}}),t=h.AbiRegistry.create(e);g.p2p=t}return g.p2p}}var m=n(236),f=n(1998);const w=(e,t)=>new f.SmartContract({address:new m.Address(t),abi:e});var p,T=n(4473);!function(e){e[e.NftBid=0]="NftBid",e[e.Nft=1]="Nft",e[e.SftAll=2]="SftAll",e[e.SftOnePerPayment=3]="SftOnePerPayment"}(p||(p={}));var y,S,q,_,A,k,D,O,C,v,x,b,I,E,F,V,L,M,R,P,B,N=n(1594),U=n.n(N),G=n(7586),W=n(3145),H=n(5766),j=n(3979),X=n(5132);class ${xo;call;api;constructor(e){this.xo=e,this.call=new u,this.api=c.init()}static async init(){const e=c.init().config,t=await g.getMarket(),n=w(t,e.XO_SC);return new $(n)}async getResult(e){return await this.call.runQuery(this.xo,e)}getMarketplaceFees=async()=>{const e=this.xo.methods.getMarketplaceCutPercentage(),t=await this.getResult(e);return parseInt(t.firstValue?.valueOf())};getAcceptedPaymentTokens=async()=>{const e=this.xo.methods.getAcceptedTokens(),t=await this.getResult(e);return t.firstValue?.valueOf()};getGlobalOfferIDs=async()=>{const e=this.xo.methods.getGlobalOffers(),t=await this.getResult(e);return t.firstValue?.valueOf().map((e=>parseInt(e)))};async getUserPoolBalance(e,t,n){const a=await this.getResult(this.xo.methods.userDeposit([e,t,n]));return a?.firstValue?new T.BigUIntValue(a.firstValue.valueOf().amount).valueOf().shiftedBy(-18).toNumber():0}isOfferActive(e,t){return e<=t}getGlobalOfferData=async e=>{const t=this.xo.methods.getGlobalOffer([e]),n=await this.getResult(t),a=n.firstValue?.valueOf();return a.offer_id=parseInt(a.offer_id.valueOf()),a.marketplace="XO",a.short_price=parseFloat(new T.BigUIntValue(a.price).valueOf().shiftedBy(-18).toString()),a.new_version=Boolean(a.new_version),a.new_version?a.isActive=!0:a.isActive=this.isOfferActive(a.short_price,await this.getUserPoolBalance(a.owner,a.payment_token,a.payment_nonce)),a.quantity=parseInt(a.quantity.valueOf()),a.payment_nonce=parseInt(a.payment_nonce.valueOf()),a.price=a.price.valueOf(),a.timestamp=parseInt(a.timestamp.valueOf()),a.owner=a.owner.valueOf().toString(),a.attributes&&(a.attributes=JSON.parse(Buffer.from(a.attributes.valueOf().toString(),"base64").toString("ascii"))),a};getAuctionInfo=async e=>{const t=this.xo.methods.getFullAuctionData([e]),n=await this.getResult(t),a=n.firstValue?.valueOf();return a?(a.auctioned_token_nonce=parseInt(a.auctioned_token_nonce.valueOf()),a.nr_auctioned_tokens=parseInt(a.nr_auctioned_tokens.valueOf()),a.auction_type=a.auction_type.name,a.payment_token_nonce=parseInt(a.payment_token_nonce.valueOf()),a.min_bid=a.min_bid.valueOf(),a.max_bid=a.max_bid.valueOf(),a.start_time=parseInt(a.start_time.valueOf()),a.deadline=parseInt(a.deadline.valueOf()),a.original_owner=a.original_owner.valueOf().toString(),a.current_winner=a.current_winner.valueOf().toString(),a.current_bid=a.current_bid.valueOf().toString(),a.marketplace_cut_percentage=a.marketplace_cut_percentage.valueOf(),a.creator_royalties_percentage=a.creator_royalties_percentage.valueOf(),a):null};async getListingsCount(){const e=await this.getResult(this.xo.methods.getListingsCount());return parseInt(e.firstValue?.valueOf())}async getOffersCount(){const e=await this.getResult(this.xo.methods.getOffersCount());return parseInt(e.firstValue?.valueOf())}async getGlobalOffersCount(){const e=await this.getResult(this.xo.methods.getGlobalOffersCount());return parseInt(e.firstValue?.valueOf())}async getCollectionsCount(){const e=await this.getResult(this.xo.methods.getCollectionsCount());return parseInt(e.firstValue?.valueOf())}async isCollectionListed(e){const t=await this.getResult(this.xo.methods.isCollectionListed([e]));return Boolean(t.firstValue?.valueOf())}async getCollectionNFTsOnSaleCount(e){const t=await this.getResult(this.xo.methods.getTokenItemsForSaleCount([e]));return parseInt(t.firstValue?.valueOf())}async getAuctionIDsForCollection(e){const t=await this.getResult(this.xo.methods.getAuctionsForTicker([e])),n=t.firstValue?.valueOf().map((e=>parseInt(e)));return n}withdrawAuctions(e,t,n){if("XO"===n){const n=this.xo.methods.withdraw(e);return t.nonce&&n.withNonce(t.nonce),n.withChainID(this.api.chain).withSender(new m.Address(t.address)).withGasLimit(Math.min(6e8,15e6+5e6*e.length))}throw new Error("Market not supported")}withdrawGlobalOffer(e,t){const n=this.xo.methods.withdrawGlobalOffer([e]);return t.nonce&&n.withNonce(t.nonce),n.withChainID(this.api.chain).withSender(new m.Address(t.address)).withGasLimit(15e6)}acceptGlobalOffer({signature:e,offer_id:t,auction_id_opt:n,nft:a,address:i,nonce:r}){const s=e?this.xo.methods.acceptGlobalOffer([t,n,e]):this.xo.methods.acceptGlobalOffer([t,n]);return s.withSender(new m.Address(i)),a&&s.withSingleESDTNFTTransfer(X.TokenTransfer.semiFungible(a.collection,a.nonce,a.amount??1)),r&&s.withNonce(r),s.withChainID(this.api.chain).withGasLimit(3e7)}sendGlobalOffer({payment_token:e,payment_nonce:t,price:n,collection:a,attributes:i,depositAmount:r,address:s,nonce:o}){const c=i?this.xo.methods.sendGlobalOffer([e,t,X.TokenTransfer.egldFromAmount(n).toString(),a,i]):this.xo.methods.sendGlobalOffer([e,t,X.TokenTransfer.egldFromAmount(n).toString(),a]);return o&&c.withNonce(o),c.withSender(new m.Address(s)),r&&c.withValue(X.TokenTransfer.egldFromAmount(r)),c.withChainID(this.api.chain).withGasLimit(3e7)}sendCustomOffer({payment_token:e,payment_nonce:t,price:n,deadline:a,nft:i,depositAmount:r,address:s,nonce:o}){const c=this.xo.methods.sendOffer([e,t,X.TokenTransfer.egldFromAmount(n).toString(),i.collection,i.nonce,i.amount??1,a]);return o&&c.withNonce(o),c.withSender(new m.Address(s)),r&&c.withValue(X.TokenTransfer.egldFromAmount(r)),c.withChainID(this.api.chain).withGasLimit(3e7)}withdrawCustomOffer(e,t){const n=this.xo.methods.withdrawOffer([e]);return t.nonce&&n.withNonce(t.nonce),n.withSender(new m.Address(t.address)),n.withChainID(this.api.chain).withGasLimit(15e6)}declineCustomOffer(e,t,n){const a=this.xo.methods.declineOffer([e]);return t.nonce&&a.withNonce(t.nonce),a.withSender(new m.Address(t.address)),n&&a.withSingleESDTNFTTransfer(X.TokenTransfer.semiFungible(n.collection,n.nonce,n.amount??1)),a.withChainID(this.api.chain).withGasLimit(2e7)}acceptCustomOffer(e,t,n){const a=this.xo.methods.acceptOffer([e]);return t.nonce&&a.withNonce(t.nonce),a.withSender(new m.Address(t.address)),n&&a.withSingleESDTNFTTransfer(X.TokenTransfer.semiFungible(n.collection,n.nonce,n.amount??1)),a.withChainID(this.api.chain).withGasLimit(3e7)}endAuction(e,t,n="XO"){if("XO"==n){const n=this.xo.methods.endAuction([e]);return t.nonce&&n.withNonce(t.nonce),n.withSender(new m.Address(t.address)),n.withChainID(this.api.chain).withGasLimit(15e6)}throw new Error("Market not supported")}bidOnAuctionId(e,t,n,a,i){const r=this.xo.methods.bid([e,t,n]);if(!a.amount)throw new Error("Payment amount is required");return i.nonce&&r.withNonce(i.nonce),r.withSender(new m.Address(i.address)),"EGLD"==a.collection&&a.amount?r.withValue(X.TokenTransfer.egldFromAmount(a.amount)):r.withSingleESDTTransfer(X.TokenTransfer.fungibleFromAmount(a.collection,a.amount,a.decimals??18)),r.withChainID(this.api.chain).withGasLimit(3e7)}bulkBuy(e,t,n){const a=this.xo.methods.bid(e);if(n.nonce&&a.withNonce(n.nonce),a.withSender(new m.Address(n.address)),!t.amount)throw new Error("Payment amount is required");return"EGLD"==t.collection&&t.amount?a.withValue(X.TokenTransfer.egldFromAmount(t.amount)):a.withSingleESDTTransfer(X.TokenTransfer.fungibleFromAmount(t.collection,t.amount,t.decimals??18)),a.withChainID(this.api.chain).withGasLimit(Math.min(6e8,2e7+5e6*e.length))}async buyAuctionById({auctionID:e,collection:t,nonce:n,paymentAmount:a,quantity:i=1,token:r="EGLD",withCheck:s=!0,isBigUintPayment:o=!1,address:c,nonce:l,isBid:d=!1,decimals:u=18,market:h="XO"}){if("XO"!==h)throw new Error("Market not supported");if(!e)throw new Error("AuctionID not provided");let g=null;if(!a||!r||!t||!n||s){if(g=await this.getAuctionInfo(e),null===g)throw new Error("Auction not found");if(g.auction_type===p.Nft||g.auction_type===p.SftOnePerPayment)throw new Error("Auction type is not NFT or SftOnePerPayment")}const f=g?.payment_token_type??r,w=!!g||o;let T=d?g?.max_bid??a:g?.min_bid??a;if(!T)throw new Error("Payment amount not provided");const y=this.xo.methods.buy([e,g?.auctioned_token_type??t,g?.auctioned_token_nonce??n,i??1]);if(l&&y.withNonce(l),y.withSender(new m.Address(c)),"EGLD"===r)y.withValue(w?X.TokenTransfer.egldFromBigInteger(new(U())(T).multipliedBy(i)):X.TokenTransfer.egldFromAmount(new(U())(T).multipliedBy(i)));else{if(!w){if(g=await this.getAuctionInfo(e),null===g)throw new Error("Auction not found");T=d?g.max_bid:g.min_bid}y.withSingleESDTTransfer(X.TokenTransfer.fungibleFromBigInteger(f,T,u))}return y.withChainID(this.api.chain).withGasLimit(2e7)}async changeListing(e,t){const n=new G.StructType("BulkUpdateListing",[new H.FieldDefinition("payment_token_type","",new W.TokenIdentifierType),new H.FieldDefinition("new_price","",new T.BigUIntType),new H.FieldDefinition("auction_id","",new T.U64Type),new H.FieldDefinition("deadline","",new T.U64Type)]),a=[];e.forEach((({paymentToken:e,price:t,auctionID:i,deadline:r})=>{a.push(new G.Struct(n,[new H.Field(new W.TokenIdentifierValue(e),"payment_token_type"),new H.Field(new T.BigUIntValue(t),"new_price"),new H.Field(new T.U64Value(i),"auction_id"),new H.Field(new T.U64Value(r),"deadline")]))}));const i=this.xo.methods.changeListing(a);return t.nonce&&i.withNonce(t.nonce),i.withSender(new m.Address(t.address)),i.withChainID(this.api.chain).withGasLimit(Math.min(6e8,8e6+2e6*e.length))}async listNFTs(e,t){const n=new G.StructType("BulkListing",[new H.FieldDefinition("min_bid","",new T.BigUIntType),new H.FieldDefinition("max_bid","",new T.BigUIntType),new H.FieldDefinition("deadline","",new T.U64Type),new H.FieldDefinition("accepted_payment_token","",new W.TokenIdentifierType),new H.FieldDefinition("bid","",new j.BooleanType),new H.FieldDefinition("opt_sft_max_one_per_payment","",new j.BooleanType),new H.FieldDefinition("opt_start_time","",new T.U64Type),new H.FieldDefinition("collection","",new W.TokenIdentifierType),new H.FieldDefinition("nonce","",new T.U64Type),new H.FieldDefinition("nft_amount","",new T.BigUIntType)]),a=[],i=[];e.forEach((e=>{const t=e.accepted_payment_token_decimals??18,r=new(U())(e.min_bid).shiftedBy(t),s=new(U())(e.max_bid??0).shiftedBy(t);i.push(X.TokenTransfer.semiFungible(e.collection,e.nonce,e.nft_amount)),a.push(new G.Struct(n,[new H.Field(new T.BigUIntValue(r),"min_bid"),new H.Field(new T.BigUIntValue(s),"max_bid"),new H.Field(new T.U64Value(new(U())(e.deadline??0)),"deadline"),new H.Field(new W.TokenIdentifierValue(e.accepted_payment_token??"EGLD"),"accepted_payment_token"),new H.Field(new j.BooleanValue(e.bid??!1),"bid"),new H.Field(new j.BooleanValue(e.isSFTPack??!1),"opt_sft_max_one_per_payment"),new H.Field(new T.U64Value(new(U())(e.opt_start_time?e.opt_start_time:0)),"opt_start_time"),new H.Field(new W.TokenIdentifierValue(e.collection),"collection"),new H.Field(new T.U64Value(e.nonce),"nonce"),new H.Field(new T.BigUIntValue(new(U())(e.nft_amount)),"nft_amount")]))}));const r=this.xo.methods.listings(a);return t.nonce&&r.withNonce(t.nonce),r.withSender(new m.Address(t.address)),r.withMultiESDTNFTTransfer(i),r.withChainID(this.api.chain).withGasLimit(Math.min(6e8,8e6+2e6*e.length))}}class z{minter;call;constructor(e){this.minter=e,this.call=new u}async getResult(e){return await this.call.runQuery(this.minter,e)}static async init(e){const t=await g.getMinter(),n=w(t,e);return new z(n)}getAllUniqueTags=async()=>{const e=this.minter.methods.collections(),t=await this.getResult(e);return t.firstValue?.valueOf().map((e=>e.toString()))};getWalletGlobalBuyCount=async(e,t)=>{const n=this.minter.methods.buysPerWallet([e,t]),a=await this.getResult(n);return a.firstValue?.valueOf()};getWalletStageBuyCount=async(e,t,n)=>{const a=this.minter.methods.buysStagePerWallet([e,t,n]),i=await this.getResult(a);return i.firstValue?.valueOf()};getLocalOwner=async()=>{const e=this.minter.methods.localOwner(),t=await this.getResult(e);return t.firstValue?.valueOf()};getLaunchpadCutFee=async()=>{const e=this.minter.methods.cutPercentage(),t=await this.getResult(e);return t.firstValue?.valueOf()};getStageWhitelist=async(e,t)=>{const n=this.minter.methods.getWhitelistedWallets([e,t]),a=await this.getResult(n);return a.firstValue?.valueOf().map((e=>e.toString()))};getStages=async e=>{const t=this.minter.methods.mintStage([e]),n=await this.getResult(t);return n.firstValue?.valueOf().map((e=>{const t=e[1].valueOf();return t.name=t.name.toString(),t.tag=t.name.toString(),t.start_time=parseInt(t.start_time.toString()),t.end_time=parseInt(t.end_time.toString()),t.mint_limit=parseInt(t.mint_limit.toString()),t.mint_count=parseInt(t.mint_count.toString()),t.max_per_wallet=parseInt(t.max_per_wallet.toString()),t.prices=t.prices.map((e=>{const t=e.valueOf();return{...t,token_nonce:parseInt(t.token_nonce.toString()),amount:t.amount.toString()}})),t}))}}!function(e){e.XO="xoxno",e.FM="frameit",e.DR="deadrare",e.KG="krogan"}(y||(y={})),function(e){e.Rank="metadata.rarity.rank",e.Attributes="metadata.attributes",e.Description="metadata.description",e.Name="name",e.OnSale="onSale",e.SaleInfo="saleInfo",e.Royalties="royalties",e.Identifier="identifier",e.Collection="collection",e.OriginalURL="url",e.Nonce="nonce",e.ContentType="originalMedia.contentType",e.WasProcessed="wasProcessed",e.AvifURL="avifUrl",e.WebpURL="webpUrl",e.Type="type"}(S||(S={})),function(e){e.PriceHighToLow="saleInfo.minBidShort desc",e.PriceLowToHigh="saleInfo.minBidShort asc",e.MaxPriceHighToLow="saleInfo.maxBidShort desc",e.MaxPriceLowToHigh="saleInfo.maxBidShort asc",e.BidPriceHighToLow="saleInfo.currentBidShort desc",e.BidPriceLowToHigh="saleInfo.currentBidShort asc",e.RarityHighToLow="metadata.rarity.rank desc",e.RarityLowToHigh="metadata.rarity.rank asc",e.NonceHighToLow="nonce desc",e.NonceLowToHigh="nonce asc",e.RecentListed="saleInfo.timestamp desc",e.OldestListed="saleInfo.timestamp asc",e.EndingLate="saleInfo.deadline desc",e.EndingSoon="saleInfo.deadline asc"}(q||(q={})),function(e){e.EndingLate="startTime desc",e.EndingSoon="startTime asc"}(_||(_={})),function(e){e.TotalVolumeHighToLow="statistics/tradeData/totalEgldVolume desc",e.FollowersHighToLow="statistics/other/followCount desc",e.IsVerifiedTrueToFalse="isVerified desc",e.HasImageTrueToFalse="profile desc",e.HasBannerTrueToFalse="banner desc"}(A||(A={})),function(e){e.WeekVolumeHighToLow="statistics.tradeData.weekEgldVolume desc",e.WeekVolumeLowToHigh="statistics.tradeData.weekEgldVolume asc",e.DailyVolumeHighToLow="statistics.tradeData.dayEgldVolume desc",e.DailyVolumeLowToHigh="statistics.tradeData.dayEgldVolume asc",e.TotalVolumeHighToLow="statistics.tradeData.totalEgldVolume desc",e.TotalVolumeLowToHigh="statistics.tradeData.totalEgldVolume asc",e.AvgVolumePriceHighToLow="statistics.tradeData.averageEgldPrice desc",e.AvgVolumePriceLowToHigh="statistics.tradeData.averageEgldPrice asc",e.ATHHighToLow="statistics.tradeData.athEgldPrice desc",e.ATHLowToHigh="statistics.tradeData.athEgldPrice asc",e.TotalTradesHighToLow="statistics.tradeData.totalTrades desc",e.TotalTradesLowToHigh="statistics.tradeData.totalTrades asc",e.SupplyHighToLow="statistics.other.nftCount desc",e.SupplyLowToHigh="statistics.other.nftCount asc",e.FollowersHighToLow="statistics.other.followCount desc",e.FollowersLowToHigh="statistics.other.followCount asc"}(k||(k={})),function(e){e.PriceHighToLow="priceShort desc",e.PriceLowToHigh="priceShort asc",e.OfferIdHighToLow="offerIddesc",e.OfferIdLowToHigh="offerId asc",e.RecentListed="timestamp desc",e.OldestListed="timestamp asc"}(D||(D={})),function(e){e.Profile="profile",e.Description="description",e.Creator="creator",e.Owner="owner",e.Socials="socials",e.Type="type",e.HasStaking="hasStaking",e.Name="name",e.Banner="banner",e.IsVerified="isVerified",e.IsMintable="isMintable",e.Statistics="statistics",e.Collection="collection"}(O||(O={})),function(e){e.Attributes="attributes",e.Collection="collection",e.Marketplace="marketplace",e.PaymentToken="paymentToken",e.LongPrice="price",e.ShortPrice="priceShort"}(C||(C={})),function(e){e.FixedPrice="FixedPrice",e.Auctions="Auctions",e.All="All",e.AllListed="AllListed"}(v||(v={})),function(e){e.ALL="all",e.Trade="trade",e.P2P="p2p",e.Staking="staking",e.Minting="minting"}(x||(x={})),function(e){e.TotalVolume="TotalVolume",e.TotalTrades="TotalTrades",e.DailyVolume="DailyVolume",e.Last2DaysVolume="Last2DaysVolume",e.DailyTrades="DailyTrades",e.Last2DaysTrades="Last2DaysTrades",e.WeekTrades="WeekTrades",e.LastWeekTrades="LastWeekTrades",e.WeekVolume="WeekVolume",e.LastWeekVolume="LastWeekVolume",e.WeeklyTradesMargin="WeeklyTradesMargin",e.DailyTradesMargin="DailyTradesMargin",e.WeeklyVolumeMargin="WeeklyVolumeMargin",e.DailyVolumeEgldMargin="DailyVolumeEgldMargin",e.CollectionAthTrade="CollectionAthTrade"}(b||(b={})),function(e){e.TradingStats="tradingStats"}(I||(I={})),function(e){e.ListedCountDesc="tradingStats.listedCount DESC",e.ListedCountAsc="tradingStats.listedCount ASC",e.FloorPriceDesc="tradingStats.floorPrice DESC",e.FloorPriceAsc="tradingStats.floorPrice ASC",e.TotalVolumeDesc="tradingStats.totalVolume DESC",e.TotalVolumeAsc="tradingStats.totalVolume ASC",e.TotalTradesDesc="tradingStats.totalTrades DESC",e.TotalTradesAsc="tradingStats.totalTrades ASC",e.AllTimeHighDesc="tradingStats.allTimeHigh.price DESC",e.AllTimeHighAsc="tradingStats.allTimeHigh.price ASC",e.DayVolumeDesc="tradingStats.day.volume DESC",e.DayVolumeAsc="tradingStats.day.volume ASC",e.DayVolumeMarginDesc="tradingStats.day.volumeMargin DESC",e.DayVolumeMarginAsc="tradingStats.day.volumeMargin ASC",e.DayTradesDesc="tradingStats.day.trades DESC",e.DayTradesAsc="tradingStats.day.trades ASC",e.DayTradesMarginDesc="tradingStats.day.tradesMargin DESC",e.DayTradesMarginAsc="tradingStats.day.tradesMargin ASC",e.WeekVolumeDesc="tradingStats.week.volume DESC",e.WeekVolumeAsc="tradingStats.week.volume ASC",e.WeekVolumeMarginDesc="tradingStats.week.volumeMargin DESC",e.WeekVolumeMarginAsc="tradingStats.week.volumeMargin ASC",e.WeekTradesDesc="tradingStats.week.trades DESC",e.WeekTradesAsc="tradingStats.week.trades ASC",e.WeekTradesMarginDesc="tradingStats.week.tradesMargin DESC",e.WeekTradesMarginAsc="tradingStats.week.tradesMargin ASC",e.MonthVolumeDesc="tradingStats.month.volume DESC",e.MonthVolumeAsc="tradingStats.month.volume ASC",e.MonthVolumeMarginDesc="tradingStats.month.volumeMargin DESC",e.MonthVolumeMarginAsc="tradingStats.month.volumeMargin ASC",e.MonthTradesDesc="tradingStats.month.trades DESC",e.MonthTradesAsc="tradingStats.month.trades ASC",e.MonthTradesMarginDesc="tradingStats.month.tradesMargin DESC",e.MonthTradesMarginAsc="tradingStats.month.tradesMargin ASC",e.YearVolumeDesc="tradingStats.year.volume DESC",e.YearVolumeAsc="tradingStats.year.volume ASC",e.YearVolumeMarginDesc="tradingStats.year.volumeMargin DESC",e.YearVolumeMarginAsc="tradingStats.year.volumeMargin ASC",e.YearTradesDesc="tradingStats.year.trades DESC",e.YearTradesAsc="tradingStats.year.trades ASC",e.YearTradesMarginDesc="tradingStats.year.tradesMargin DESC",e.YearTradesMarginAsc="tradingStats.year.tradesMargin ASC"}(E||(E={})),function(e){e.NFT_CREATE="nftCreate",e.NFT_BURN="nftBurn",e.NFT_UPDATE="nftUpdate",e.NFT_TRANSFER="nftTransfer",e.LISTING_CREATE="listingCreate",e.LISTING_WITHDRAW="listingWithdraw",e.LISTING_UPDATE="listingUpdate",e.AUCTION_BID="auctionBid",e.AUCTION_OUT_BID="auctionOutBid",e.OFFER_CREATE="offerCreate",e.OFFER_WITHDRAW="offerWithdraw",e.OFFER_REJECT="offerReject",e.GLOBAL_OFFER_CREATE="globalOfferCreate",e.GLOBAL_OFFER_WITHDRAW="globalOfferWithdraw",e.TRADE="trade",e.BULK_TRADE="bulkTrade",e.AUCTION_TRADE="auctionTrade",e.OTHER_TRADE="otherTrade",e.OFFER_TRADE="offerTrade",e.GLOBAL_OFFER_TRADE="globalOfferTrade",e.STAKE="stake",e.UN_STAKE="unStake"}(F||(F={})),function(e){e.PriceHighToLow="activityData.egldValue desc",e.PriceLowToHigh="activityData.egldValue asc",e.RecentPlaced="timestamp desc",e.OldestPlaced="timestamp asc"}(V||(V={})),function(e){e[e.attributes=0]="attributes",e[e.collection=1]="collection",e[e.offer_id=2]="offer_id",e[e.owner=3]="owner",e[e.short_price=4]="short_price",e[e.price=5]="price",e[e.id=6]="id",e[e.dataType=7]="dataType",e[e.marketplace=8]="marketplace",e[e.payment_token=9]="payment_token"}(L||(L={})),function(e){e.Dynamic="Dynamic",e.Fixed="Fixed"}(M||(M={})),function(e){e.Duo="Duo",e.Single="Single",e.Perk="Perk"}(R||(R={})),function(e){e.Received="received",e.Placed="placed"}(P||(P={})),function(e){e.NonFungibleESDT="NonFungibleESDT"}(B||(B={}))},5340:()=>{},9838:()=>{}},n={};function a(e){var i=n[e];if(void 0!==i)return i.exports;var r=n[e]={exports:{}};return t[e].call(r.exports,r,r.exports,a),r.exports}a.m=t,e=[],a.O=(t,n,i,r)=>{if(!n){var s=1/0;for(d=0;d<e.length;d++){for(var[n,i,r]=e[d],o=!0,c=0;c<n.length;c++)(!1&r||s>=r)&&Object.keys(a.O).every((e=>a.O[e](n[c])))?n.splice(c--,1):(o=!1,r<s&&(s=r));if(o){e.splice(d--,1);var l=i();void 0!==l&&(t=l)}}return t}r=r||0;for(var d=e.length;d>0&&e[d-1][2]>r;d--)e[d]=e[d-1];e[d]=[n,i,r]},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={954:0};a.O.j=t=>0===e[t];var t=(t,n)=>{var i,r,[s,o,c]=n,l=0;if(s.some((t=>0!==e[t]))){for(i in o)a.o(o,i)&&(a.m[i]=o[i]);if(c)var d=c(a)}for(t&&t(n);l<s.length;l++)r=s[l],a.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return a.O(d)},n=this.webpackChunk_xoxno_sdk_js=this.webpackChunk_xoxno_sdk_js||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var i=a.O(void 0,[711],(()=>a(4487))),r=(i=a.O(i)).$C,s=i.Yo,o=i.LU,c=i.JA,l=i.he,d=i.cO,u=i.t7,h=i.iQ,g=i.Gq,m=i.h4,f=i.wT,w=i.JM,p=i.Vx,T=i.xR,y=i.O8,S=i.o,q=i.p4,_=i.AQ,A=i.J1,k=i.$5,D=i.g6,O=i.cB,C=i.I_,v=i.ZU;export{r as AssetCategory,s as AuctionType,o as AuctionTypes,c as CollectionStatsOrderBy,l as CollectionStatsSelectFields,d as CollectionsFieldsToSelect,u as CollectionsOrderBy,h as CollectionsSummaryFilter,g as DropsOderBy,m as FieldsToSelect,f as GlobalOfferFieldsToSelect,w as GlobalOfferOrderBy,p as IssuingType,T as LaunchpadModule,y as Marketplace,S as NftActivityType,q as OfferType,_ as OrderByTradingActivity,A as PoolType,k as SCInteraction,D as SearchOrderBy,O as SelectFieldsTradingActivity,C as SuggestOrderBy,v as Type};
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@xoxno/sdk-js"]=t():e["@xoxno/sdk-js"]=t()}(this,(()=>(()=>{var e,t={4487:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AssetCategory:()=>x,AuctionType:()=>p,AuctionTypes:()=>v,CollectionStatsOrderBy:()=>I,CollectionStatsSelectFields:()=>E,CollectionsFieldsToSelect:()=>O,CollectionsOrderBy:()=>A,CollectionsSummaryFilter:()=>b,DropsOderBy:()=>q,FieldsToSelect:()=>S,GlobalOfferFieldsToSelect:()=>C,GlobalOfferOrderBy:()=>D,IssuingType:()=>M,LaunchpadModule:()=>K,Marketplace:()=>y,NftActivityType:()=>F,OfferType:()=>R,OrderByTradingActivity:()=>V,PoolType:()=>P,SCInteraction:()=>X,SearchOrderBy:()=>_,SelectFieldsTradingActivity:()=>L,SuggestOrderBy:()=>k,Type:()=>B});const a="https://api.xoxno.com",i="erd1qqqqqqqqqqqqqpgq705fxpfrjne0tl3ece0rrspykq88mynn4kxs2cg43s",r="erd1qqqqqqqqqqqqqpgqd9rvv2n378e27jcts8vfwynpx0gfl5ufz6hqhfy0u0",o="erd1qqqqqqqqqqqqqpgq8xwzu82v8ex3h4ayl5lsvxqxnhecpwyvwe0sf2qj4e";var s;!function(e){e.MAINNET="1",e.DEVNET="D"}(s||(s={}));class c{static instance;apiUrl;apiKey;chain;config;constructor(e=a,t="",n=s.MAINNET){this.apiUrl=e,this.apiKey=t,this.chain=n,this.config=n===s.MAINNET?{XO_SC:"erd1qqqqqqqqqqqqqpgq6wegs2xkypfpync8mn2sa5cmpqjlvrhwz5nqgepyg8",FM_SC:i,DR_SC:r,KG_SC:o,Staking_SC:"erd1qqqqqqqqqqqqqpgqvpkd3g3uwludduv3797j54qt6c888wa59w2shntt6z",Manager_SC:"erd1qqqqqqqqqqqqqpgqg9fa0dmpn8fu3fnleeqn5zt8rl8mdqjkys5s2gtas7",P2P_SC:"erd1qqqqqqqqqqqqqpgq47y8hnct68v6asjv6gxem6h9rumn9frzah0skhxxt6"}:{XO_SC:"erd1qqqqqqqqqqqqqpgqn4fnwl43hhchz9emdy66eh5azzhl599zd8ssxjdyh3",FM_SC:i,DR_SC:r,KG_SC:o,Staking_SC:"erd1qqqqqqqqqqqqqpgqmkt2fvumf0zgum5qd0awl2l46x2pxdgmr5rswjr6r8",Manager_SC:"erd1qqqqqqqqqqqqqpgq6sysl7mga393a850xemfpawaqanf4da5d8ssp3xamn",P2P_SC:"erd1qqqqqqqqqqqqqpgqhuvnvkwwmucdzy3g7pvgvjumjfcgfwf69w2svch5c2"}}static init({apiUrl:e=a,apiKey:t="",chain:n=s.MAINNET}={}){return c.instance||(n==s.DEVNET&&(c.instance=new c("https://api-dev.xoxno.com",t,n)),c.instance=new c(e,t,n)),c.instance}fetchWithTimeout=async(e,t={},n=4e4)=>{const a={"Accept-Encoding":"gzip,deflate,br",Referer:"https://xoxno.sdk","User-Agent":"XOXNO/1.0/SDK",..."POST"===t.method?{"Content-Type":"application/json"}:{},...t.headers??{}},i=`${"string"==typeof e&&e.startsWith("/")?`${this.apiUrl}${e}`:e}${t.params?"?"+Object.keys(t.params).map((e=>`${e}=${encodeURIComponent(t.params[e])}`)).join("&"):""}`,r=new AbortController;setTimeout((()=>r.abort()),n);const o=await fetch(i,{...t,...t?.next&&t.next.revalidate?{}:{cache:"no-store"},signal:r.signal,...Object.keys(a).length?{headers:a}:{},method:t.method??"GET"});if(!o.ok)throw new Error((await o.json()).message.toString());return o.json()}}var l=n(2528),d=n(8403);class u{proxy;parser=new l.ResultsParser;constructor(){const e=c.init().apiUrl;this.proxy=new d.ProxyNetworkProvider(e,{timeout:1e4})}async runQuery(e,t){try{const e=await this.proxy.queryContract(t.buildQuery());return this.parser.parseQueryResponse(e,t.getEndpoint())}catch(n){throw console.log(`Unexpected error when running query '${t.buildQuery().func}' to sc '${e.getAddress().bech32()}' `),console.error(n),n}}}var h=n(4966);class g{static manager;static exchange;static minter;static market;static staking;static p2p;static async getMarket(){if(!g.market){const e=await c.init().fetchWithTimeout("https://media.xoxno.com/smartcontractabi/esdt-nft-marketplace.abi.json",{next:{tags:["getMarket"]}}),t=h.AbiRegistry.create(e);g.market=t}return g.market}static async getManager(){if(!g.manager){const e=await c.init().fetchWithTimeout("https://media.xoxno.com/smartcontractabi/manage.json",{next:{tags:["getManager"]}}),t=h.AbiRegistry.create(e);g.manager=t}return g.manager}static async getMinter(){if(!g.minter){const e=await c.init().fetchWithTimeout("https://media.xoxno.com/smartcontractabi/minter.json",{next:{tags:["getMinter"]}}),t=h.AbiRegistry.create(e);g.minter=t}return g.minter}static async getStaking(){if(!g.staking){const e=await c.init().fetchWithTimeout("https://media.xoxno.com/smartcontractabi/staking-nfts.abi.json",{next:{tags:["getStaking"]}}),t=h.AbiRegistry.create(e);g.staking=t}return g.staking}static async getExchange(){if(!g.exchange){const e=await c.init().fetchWithTimeout("https://media.xoxno.com/smartcontractabi/rs-exchange.abi.json",{next:{tags:["getExchange"]}}),t=h.AbiRegistry.create(e);g.exchange=t}return g.exchange}static async getP2P(){if(!g.p2p){const e=await c.init().fetchWithTimeout("https://media.xoxno.com/smartcontractabi/p2p.abi.json",{next:{tags:["getP2P"],revalidate:500}}),t=h.AbiRegistry.create(e);g.p2p=t}return g.p2p}}var m=n(236),f=n(1998);const w=(e,t)=>new f.SmartContract({address:new m.Address(t),abi:e});var p,T=n(4473);!function(e){e[e.NftBid=0]="NftBid",e[e.Nft=1]="Nft",e[e.SftAll=2]="SftAll",e[e.SftOnePerPayment=3]="SftOnePerPayment"}(p||(p={}));var y,S,_,q,k,A,D,O,C,v,x,b,E,I,F,V,L,M,P,R,B,N=n(1594),U=n.n(N),W=n(7586),H=n(3145),G=n(5766),j=n(3979),z=n(5132);class X{xo;call;api;constructor(e){this.xo=e,this.call=new u,this.api=c.init()}static async init(){const e=c.init().config,t=await g.getMarket(),n=w(t,e.XO_SC);return new X(n)}async getResult(e){return await this.call.runQuery(this.xo,e)}getMarketplaceFees=async()=>{const e=this.xo.methods.getMarketplaceCutPercentage(),t=await this.getResult(e);return parseInt(t.firstValue?.valueOf())};getAcceptedPaymentTokens=async()=>{const e=this.xo.methods.getAcceptedTokens(),t=await this.getResult(e);return t.firstValue?.valueOf()};getGlobalOfferIDs=async()=>{const e=this.xo.methods.getGlobalOffers(),t=await this.getResult(e);return t.firstValue?.valueOf().map((e=>parseInt(e)))};async getUserPoolBalance(e,t,n){const a=await this.getResult(this.xo.methods.userDeposit([e,t,n]));return a?.firstValue?new T.BigUIntValue(a.firstValue.valueOf().amount).valueOf().shiftedBy(-18).toNumber():0}isOfferActive(e,t){return e<=t}getGlobalOfferData=async e=>{const t=this.xo.methods.getGlobalOffer([e]),n=await this.getResult(t),a=n.firstValue?.valueOf();return a.offer_id=parseInt(a.offer_id.valueOf()),a.marketplace="XO",a.short_price=parseFloat(new T.BigUIntValue(a.price).valueOf().shiftedBy(-18).toString()),a.new_version=Boolean(a.new_version),a.new_version?a.isActive=!0:a.isActive=this.isOfferActive(a.short_price,await this.getUserPoolBalance(a.owner,a.payment_token,a.payment_nonce)),a.quantity=parseInt(a.quantity.valueOf()),a.payment_nonce=parseInt(a.payment_nonce.valueOf()),a.price=a.price.valueOf(),a.timestamp=parseInt(a.timestamp.valueOf()),a.owner=a.owner.valueOf().toString(),a.attributes&&(a.attributes=JSON.parse(Buffer.from(a.attributes.valueOf().toString(),"base64").toString("ascii"))),a};getAuctionInfo=async e=>{const t=this.xo.methods.getFullAuctionData([e]),n=await this.getResult(t),a=n.firstValue?.valueOf();return a?(a.auctioned_token_nonce=parseInt(a.auctioned_token_nonce.valueOf()),a.nr_auctioned_tokens=parseInt(a.nr_auctioned_tokens.valueOf()),a.auction_type=a.auction_type.name,a.payment_token_nonce=parseInt(a.payment_token_nonce.valueOf()),a.min_bid=a.min_bid.valueOf(),a.max_bid=a.max_bid.valueOf(),a.start_time=parseInt(a.start_time.valueOf()),a.deadline=parseInt(a.deadline.valueOf()),a.original_owner=a.original_owner.valueOf().toString(),a.current_winner=a.current_winner.valueOf().toString(),a.current_bid=a.current_bid.valueOf().toString(),a.marketplace_cut_percentage=a.marketplace_cut_percentage.valueOf(),a.creator_royalties_percentage=a.creator_royalties_percentage.valueOf(),a):null};async getListingsCount(){const e=await this.getResult(this.xo.methods.getListingsCount());return parseInt(e.firstValue?.valueOf())}async getOffersCount(){const e=await this.getResult(this.xo.methods.getOffersCount());return parseInt(e.firstValue?.valueOf())}async getGlobalOffersCount(){const e=await this.getResult(this.xo.methods.getGlobalOffersCount());return parseInt(e.firstValue?.valueOf())}async getCollectionsCount(){const e=await this.getResult(this.xo.methods.getCollectionsCount());return parseInt(e.firstValue?.valueOf())}async isCollectionListed(e){const t=await this.getResult(this.xo.methods.isCollectionListed([e]));return Boolean(t.firstValue?.valueOf())}async getCollectionNFTsOnSaleCount(e){const t=await this.getResult(this.xo.methods.getTokenItemsForSaleCount([e]));return parseInt(t.firstValue?.valueOf())}async getAuctionIDsForCollection(e){const t=await this.getResult(this.xo.methods.getAuctionsForTicker([e])),n=t.firstValue?.valueOf().map((e=>parseInt(e)));return n}withdrawAuctions(e,t,n){if("XO"===n){const n=this.xo.methods.withdraw(e);return t.nonce&&n.withNonce(t.nonce),n.withChainID(this.api.chain).withSender(new m.Address(t.address)).withGasLimit(Math.min(6e8,15e6+5e6*e.length))}throw new Error("Market not supported")}withdrawGlobalOffer(e,t){const n=this.xo.methods.withdrawGlobalOffer([e]);return t.nonce&&n.withNonce(t.nonce),n.withChainID(this.api.chain).withSender(new m.Address(t.address)).withGasLimit(15e6)}acceptGlobalOffer({signature:e,offer_id:t,auction_id_opt:n,nft:a,address:i,nonce:r}){const o=e?this.xo.methods.acceptGlobalOffer([t,n,e]):this.xo.methods.acceptGlobalOffer([t,n]);return o.withSender(new m.Address(i)),a&&o.withSingleESDTNFTTransfer(z.TokenTransfer.semiFungible(a.collection,a.nonce,a.amount??1)),r&&o.withNonce(r),o.withChainID(this.api.chain).withGasLimit(3e7)}sendGlobalOffer({payment_token:e,payment_nonce:t,price:n,collection:a,attributes:i,depositAmount:r,address:o,nonce:s}){const c=i?this.xo.methods.sendGlobalOffer([e,t,z.TokenTransfer.egldFromAmount(n).toString(),a,i]):this.xo.methods.sendGlobalOffer([e,t,z.TokenTransfer.egldFromAmount(n).toString(),a]);return s&&c.withNonce(s),c.withSender(new m.Address(o)),r&&c.withValue(z.TokenTransfer.egldFromAmount(r)),c.withChainID(this.api.chain).withGasLimit(3e7)}sendCustomOffer({payment_token:e,payment_nonce:t,price:n,deadline:a,nft:i,depositAmount:r,address:o,nonce:s}){const c=this.xo.methods.sendOffer([e,t,z.TokenTransfer.egldFromAmount(n).toString(),i.collection,i.nonce,i.amount??1,a]);return s&&c.withNonce(s),c.withSender(new m.Address(o)),r&&c.withValue(z.TokenTransfer.egldFromAmount(r)),c.withChainID(this.api.chain).withGasLimit(3e7)}withdrawCustomOffer(e,t){const n=this.xo.methods.withdrawOffer([e]);return t.nonce&&n.withNonce(t.nonce),n.withSender(new m.Address(t.address)),n.withChainID(this.api.chain).withGasLimit(15e6)}declineCustomOffer(e,t,n){const a=this.xo.methods.declineOffer([e]);return t.nonce&&a.withNonce(t.nonce),a.withSender(new m.Address(t.address)),n&&a.withSingleESDTNFTTransfer(z.TokenTransfer.semiFungible(n.collection,n.nonce,n.amount??1)),a.withChainID(this.api.chain).withGasLimit(2e7)}acceptCustomOffer(e,t,n){const a=this.xo.methods.acceptOffer([e]);return t.nonce&&a.withNonce(t.nonce),a.withSender(new m.Address(t.address)),n&&a.withSingleESDTNFTTransfer(z.TokenTransfer.semiFungible(n.collection,n.nonce,n.amount??1)),a.withChainID(this.api.chain).withGasLimit(3e7)}endAuction(e,t,n="XO"){if("XO"==n){const n=this.xo.methods.endAuction([e]);return t.nonce&&n.withNonce(t.nonce),n.withSender(new m.Address(t.address)),n.withChainID(this.api.chain).withGasLimit(15e6)}throw new Error("Market not supported")}bidOnAuctionId(e,t,n,a,i){const r=this.xo.methods.bid([e,t,n]);if(!a.amount)throw new Error("Payment amount is required");return i.nonce&&r.withNonce(i.nonce),r.withSender(new m.Address(i.address)),"EGLD"==a.collection&&a.amount?r.withValue(z.TokenTransfer.egldFromAmount(a.amount)):r.withSingleESDTTransfer(z.TokenTransfer.fungibleFromAmount(a.collection,a.amount,a.decimals??18)),r.withChainID(this.api.chain).withGasLimit(3e7)}bulkBuy(e,t,n){const a=this.xo.methods.bid(e);if(n.nonce&&a.withNonce(n.nonce),a.withSender(new m.Address(n.address)),!t.amount)throw new Error("Payment amount is required");return"EGLD"==t.collection&&t.amount?a.withValue(z.TokenTransfer.egldFromAmount(t.amount)):a.withSingleESDTTransfer(z.TokenTransfer.fungibleFromAmount(t.collection,t.amount,t.decimals??18)),a.withChainID(this.api.chain).withGasLimit(Math.min(6e8,2e7+5e6*e.length))}async buyAuctionById({auctionID:e,collection:t,nonce:n,paymentAmount:a,quantity:i=1,token:r="EGLD",withCheck:o=!0,isBigUintPayment:s=!1,address:c,nonce:l,isBid:d=!1,decimals:u=18,market:h="XO"}){if("XO"!==h)throw new Error("Market not supported");if(!e)throw new Error("AuctionID not provided");let g=null;if(!a||!r||!t||!n||o){if(g=await this.getAuctionInfo(e),null===g)throw new Error("Auction not found");if(g.auction_type===p.Nft||g.auction_type===p.SftOnePerPayment)throw new Error("Auction type is not NFT or SftOnePerPayment")}const f=g?.payment_token_type??r,w=!!g||s;let T=d?g?.max_bid??a:g?.min_bid??a;if(!T)throw new Error("Payment amount not provided");const y=this.xo.methods.buy([e,g?.auctioned_token_type??t,g?.auctioned_token_nonce??n,i??1]);if(l&&y.withNonce(l),y.withSender(new m.Address(c)),"EGLD"===r)y.withValue(w?z.TokenTransfer.egldFromBigInteger(new(U())(T).multipliedBy(i)):z.TokenTransfer.egldFromAmount(new(U())(T).multipliedBy(i)));else{if(!w){if(g=await this.getAuctionInfo(e),null===g)throw new Error("Auction not found");T=d?g.max_bid:g.min_bid}y.withSingleESDTTransfer(z.TokenTransfer.fungibleFromBigInteger(f,T,u))}return y.withChainID(this.api.chain).withGasLimit(2e7)}async changeListing(e,t){const n=new W.StructType("BulkUpdateListing",[new G.FieldDefinition("payment_token_type","",new H.TokenIdentifierType),new G.FieldDefinition("new_price","",new T.BigUIntType),new G.FieldDefinition("auction_id","",new T.U64Type),new G.FieldDefinition("deadline","",new T.U64Type)]),a=[];e.forEach((({paymentToken:e,price:t,auctionID:i,deadline:r})=>{a.push(new W.Struct(n,[new G.Field(new H.TokenIdentifierValue(e),"payment_token_type"),new G.Field(new T.BigUIntValue(t),"new_price"),new G.Field(new T.U64Value(i),"auction_id"),new G.Field(new T.U64Value(r),"deadline")]))}));const i=this.xo.methods.changeListing(a);return t.nonce&&i.withNonce(t.nonce),i.withSender(new m.Address(t.address)),i.withChainID(this.api.chain).withGasLimit(Math.min(6e8,8e6+2e6*e.length))}async listNFTs(e,t){const n=new W.StructType("BulkListing",[new G.FieldDefinition("min_bid","",new T.BigUIntType),new G.FieldDefinition("max_bid","",new T.BigUIntType),new G.FieldDefinition("deadline","",new T.U64Type),new G.FieldDefinition("accepted_payment_token","",new H.TokenIdentifierType),new G.FieldDefinition("bid","",new j.BooleanType),new G.FieldDefinition("opt_sft_max_one_per_payment","",new j.BooleanType),new G.FieldDefinition("opt_start_time","",new T.U64Type),new G.FieldDefinition("collection","",new H.TokenIdentifierType),new G.FieldDefinition("nonce","",new T.U64Type),new G.FieldDefinition("nft_amount","",new T.BigUIntType)]),a=[],i=[];e.forEach((e=>{const t=e.accepted_payment_token_decimals??18,r=new(U())(e.min_bid).shiftedBy(t),o=new(U())(e.max_bid??0).shiftedBy(t);i.push(z.TokenTransfer.semiFungible(e.collection,e.nonce,e.nft_amount)),a.push(new W.Struct(n,[new G.Field(new T.BigUIntValue(r),"min_bid"),new G.Field(new T.BigUIntValue(o),"max_bid"),new G.Field(new T.U64Value(new(U())(e.deadline??0)),"deadline"),new G.Field(new H.TokenIdentifierValue(e.accepted_payment_token??"EGLD"),"accepted_payment_token"),new G.Field(new j.BooleanValue(e.bid??!1),"bid"),new G.Field(new j.BooleanValue(e.isSFTPack??!1),"opt_sft_max_one_per_payment"),new G.Field(new T.U64Value(new(U())(e.opt_start_time?e.opt_start_time:0)),"opt_start_time"),new G.Field(new H.TokenIdentifierValue(e.collection),"collection"),new G.Field(new T.U64Value(e.nonce),"nonce"),new G.Field(new T.BigUIntValue(new(U())(e.nft_amount)),"nft_amount")]))}));const r=this.xo.methods.listings(a);return t.nonce&&r.withNonce(t.nonce),r.withSender(new m.Address(t.address)),r.withMultiESDTNFTTransfer(i),r.withChainID(this.api.chain).withGasLimit(Math.min(6e8,8e6+2e6*e.length))}}class K{minter;call;constructor(e){this.minter=e,this.call=new u}async getResult(e){return await this.call.runQuery(this.minter,e)}static async init(e){const t=await g.getMinter(),n=w(t,e);return new K(n)}getAllUniqueTags=async()=>{const e=this.minter.methods.collections(),t=await this.getResult(e);return t.firstValue?.valueOf().map((e=>e.toString()))};getWalletGlobalBuyCount=async(e,t)=>{const n=this.minter.methods.buysPerWallet([e,t]),a=await this.getResult(n);return a.firstValue?.valueOf()};getWalletStageBuyCount=async(e,t,n)=>{const a=this.minter.methods.buysStagePerWallet([e,t,n]),i=await this.getResult(a);return i.firstValue?.valueOf()};getLocalOwner=async()=>{const e=this.minter.methods.localOwner(),t=await this.getResult(e);return t.firstValue?.valueOf()};getLaunchpadCutFee=async()=>{const e=this.minter.methods.cutPercentage(),t=await this.getResult(e);return t.firstValue?.valueOf()};getStageWhitelist=async(e,t)=>{const n=this.minter.methods.getWhitelistedWallets([e,t]),a=await this.getResult(n);return a.firstValue?.valueOf().map((e=>e.toString()))};getStages=async e=>{const t=this.minter.methods.mintStage([e]),n=await this.getResult(t);return n.firstValue?.valueOf().map((e=>{const t=e[1].valueOf();return t.name=t.name.toString(),t.tag=t.name.toString(),t.start_time=parseInt(t.start_time.toString()),t.end_time=parseInt(t.end_time.toString()),t.mint_limit=parseInt(t.mint_limit.toString()),t.mint_count=parseInt(t.mint_count.toString()),t.max_per_wallet=parseInt(t.max_per_wallet.toString()),t.prices=t.prices.map((e=>{const t=e.valueOf();return{...t,token_nonce:parseInt(t.token_nonce.toString()),amount:t.amount.toString()}})),t}))}}!function(e){e.XO="xoxno",e.FM="frameit",e.DR="deadrare",e.KG="krogan"}(y||(y={})),function(e){e.Rank="metadata.rarity.rank",e.Attributes="metadata.attributes",e.Description="metadata.description",e.Name="name",e.OnSale="onSale",e.SaleInfo="saleInfo",e.Royalties="royalties",e.Identifier="identifier",e.Collection="collection",e.OriginalURL="url",e.Nonce="nonce",e.ContentType="originalMedia.contentType",e.WasProcessed="wasProcessed",e.AvifURL="avifUrl",e.WebpURL="webpUrl",e.Type="type"}(S||(S={})),function(e){e.PriceHighToLow="saleInfo.minBidShort desc",e.PriceLowToHigh="saleInfo.minBidShort asc",e.MaxPriceHighToLow="saleInfo.maxBidShort desc",e.MaxPriceLowToHigh="saleInfo.maxBidShort asc",e.BidPriceHighToLow="saleInfo.currentBidShort desc",e.BidPriceLowToHigh="saleInfo.currentBidShort asc",e.RarityHighToLow="metadata.rarity.rank desc",e.RarityLowToHigh="metadata.rarity.rank asc",e.NonceHighToLow="nonce desc",e.NonceLowToHigh="nonce asc",e.RecentListed="saleInfo.timestamp desc",e.OldestListed="saleInfo.timestamp asc",e.EndingLate="saleInfo.deadline desc",e.EndingSoon="saleInfo.deadline asc"}(_||(_={})),function(e){e.EndingLate="startTime desc",e.EndingSoon="startTime asc"}(q||(q={})),function(e){e.TotalVolumeHighToLow="statistics/tradeData/totalEgldVolume desc",e.FollowersHighToLow="statistics/other/followCount desc",e.IsVerifiedTrueToFalse="isVerified desc",e.HasImageTrueToFalse="profile desc",e.HasBannerTrueToFalse="banner desc"}(k||(k={})),function(e){e.WeekVolumeHighToLow="statistics.tradeData.weekEgldVolume desc",e.WeekVolumeLowToHigh="statistics.tradeData.weekEgldVolume asc",e.DailyVolumeHighToLow="statistics.tradeData.dayEgldVolume desc",e.DailyVolumeLowToHigh="statistics.tradeData.dayEgldVolume asc",e.TotalVolumeHighToLow="statistics.tradeData.totalEgldVolume desc",e.TotalVolumeLowToHigh="statistics.tradeData.totalEgldVolume asc",e.AvgVolumePriceHighToLow="statistics.tradeData.averageEgldPrice desc",e.AvgVolumePriceLowToHigh="statistics.tradeData.averageEgldPrice asc",e.ATHHighToLow="statistics.tradeData.athEgldPrice desc",e.ATHLowToHigh="statistics.tradeData.athEgldPrice asc",e.TotalTradesHighToLow="statistics.tradeData.totalTrades desc",e.TotalTradesLowToHigh="statistics.tradeData.totalTrades asc",e.SupplyHighToLow="statistics.other.nftCount desc",e.SupplyLowToHigh="statistics.other.nftCount asc",e.FollowersHighToLow="statistics.other.followCount desc",e.FollowersLowToHigh="statistics.other.followCount asc"}(A||(A={})),function(e){e.PriceHighToLow="priceShort desc",e.PriceLowToHigh="priceShort asc",e.OfferIdHighToLow="offerIddesc",e.OfferIdLowToHigh="offerId asc",e.RecentListed="timestamp desc",e.OldestListed="timestamp asc"}(D||(D={})),function(e){e.Profile="profile",e.Description="description",e.Creator="creator",e.Owner="owner",e.Socials="socials",e.Type="type",e.HasStaking="hasStaking",e.Name="name",e.Banner="banner",e.IsVerified="isVerified",e.IsMintable="isMintable",e.Statistics="statistics",e.Collection="collection"}(O||(O={})),function(e){e.Attributes="attributes",e.Collection="collection",e.Marketplace="marketplace",e.PaymentToken="paymentToken",e.LongPrice="price",e.ShortPrice="priceShort"}(C||(C={})),function(e){e.FixedPrice="FixedPrice",e.Auctions="Auctions",e.All="All",e.AllListed="AllListed"}(v||(v={})),function(e){e.ALL="all",e.Trade="trade",e.P2P="p2p",e.Staking="staking",e.Minting="minting"}(x||(x={})),function(e){e.TotalVolume="TotalVolume",e.TotalTrades="TotalTrades",e.DailyVolume="DailyVolume",e.Last2DaysVolume="Last2DaysVolume",e.DailyTrades="DailyTrades",e.Last2DaysTrades="Last2DaysTrades",e.WeekTrades="WeekTrades",e.LastWeekTrades="LastWeekTrades",e.WeekVolume="WeekVolume",e.LastWeekVolume="LastWeekVolume",e.WeeklyTradesMargin="WeeklyTradesMargin",e.DailyTradesMargin="DailyTradesMargin",e.WeeklyVolumeMargin="WeeklyVolumeMargin",e.DailyVolumeEgldMargin="DailyVolumeEgldMargin",e.CollectionAthTrade="CollectionAthTrade"}(b||(b={})),function(e){e.TradingStats="tradingStats"}(E||(E={})),function(e){e.ListedCountDesc="tradingStats.listedCount DESC",e.ListedCountAsc="tradingStats.listedCount ASC",e.FloorPriceDesc="tradingStats.floorPrice DESC",e.FloorPriceAsc="tradingStats.floorPrice ASC",e.TotalVolumeDesc="tradingStats.totalVolume DESC",e.TotalVolumeAsc="tradingStats.totalVolume ASC",e.TotalTradesDesc="tradingStats.totalTrades DESC",e.TotalTradesAsc="tradingStats.totalTrades ASC",e.AllTimeHighDesc="tradingStats.allTimeHigh.price DESC",e.AllTimeHighAsc="tradingStats.allTimeHigh.price ASC",e.DayVolumeDesc="tradingStats.day.volume DESC",e.DayVolumeAsc="tradingStats.day.volume ASC",e.DayVolumeMarginDesc="tradingStats.day.volumeMargin DESC",e.DayVolumeMarginAsc="tradingStats.day.volumeMargin ASC",e.DayTradesDesc="tradingStats.day.trades DESC",e.DayTradesAsc="tradingStats.day.trades ASC",e.DayTradesMarginDesc="tradingStats.day.tradesMargin DESC",e.DayTradesMarginAsc="tradingStats.day.tradesMargin ASC",e.WeekVolumeDesc="tradingStats.week.volume DESC",e.WeekVolumeAsc="tradingStats.week.volume ASC",e.WeekVolumeMarginDesc="tradingStats.week.volumeMargin DESC",e.WeekVolumeMarginAsc="tradingStats.week.volumeMargin ASC",e.WeekTradesDesc="tradingStats.week.trades DESC",e.WeekTradesAsc="tradingStats.week.trades ASC",e.WeekTradesMarginDesc="tradingStats.week.tradesMargin DESC",e.WeekTradesMarginAsc="tradingStats.week.tradesMargin ASC",e.MonthVolumeDesc="tradingStats.month.volume DESC",e.MonthVolumeAsc="tradingStats.month.volume ASC",e.MonthVolumeMarginDesc="tradingStats.month.volumeMargin DESC",e.MonthVolumeMarginAsc="tradingStats.month.volumeMargin ASC",e.MonthTradesDesc="tradingStats.month.trades DESC",e.MonthTradesAsc="tradingStats.month.trades ASC",e.MonthTradesMarginDesc="tradingStats.month.tradesMargin DESC",e.MonthTradesMarginAsc="tradingStats.month.tradesMargin ASC",e.YearVolumeDesc="tradingStats.year.volume DESC",e.YearVolumeAsc="tradingStats.year.volume ASC",e.YearVolumeMarginDesc="tradingStats.year.volumeMargin DESC",e.YearVolumeMarginAsc="tradingStats.year.volumeMargin ASC",e.YearTradesDesc="tradingStats.year.trades DESC",e.YearTradesAsc="tradingStats.year.trades ASC",e.YearTradesMarginDesc="tradingStats.year.tradesMargin DESC",e.YearTradesMarginAsc="tradingStats.year.tradesMargin ASC"}(I||(I={})),function(e){e.NFT_CREATE="nftCreate",e.NFT_BURN="nftBurn",e.NFT_UPDATE="nftUpdate",e.NFT_TRANSFER="nftTransfer",e.LISTING_CREATE="listingCreate",e.LISTING_WITHDRAW="listingWithdraw",e.LISTING_UPDATE="listingUpdate",e.AUCTION_BID="auctionBid",e.AUCTION_OUT_BID="auctionOutBid",e.OFFER_CREATE="offerCreate",e.OFFER_WITHDRAW="offerWithdraw",e.OFFER_REJECT="offerReject",e.GLOBAL_OFFER_CREATE="globalOfferCreate",e.GLOBAL_OFFER_WITHDRAW="globalOfferWithdraw",e.TRADE="trade",e.BULK_TRADE="bulkTrade",e.AUCTION_TRADE="auctionTrade",e.OTHER_TRADE="otherTrade",e.OFFER_TRADE="offerTrade",e.GLOBAL_OFFER_TRADE="globalOfferTrade",e.STAKE="stake",e.UN_STAKE="unStake"}(F||(F={})),function(e){e.PriceHighToLow="activityData.egldValue desc",e.PriceLowToHigh="activityData.egldValue asc",e.RecentPlaced="timestamp desc",e.OldestPlaced="timestamp asc"}(V||(V={})),function(e){e[e.attributes=0]="attributes",e[e.collection=1]="collection",e[e.offer_id=2]="offer_id",e[e.owner=3]="owner",e[e.short_price=4]="short_price",e[e.price=5]="price",e[e.id=6]="id",e[e.dataType=7]="dataType",e[e.marketplace=8]="marketplace",e[e.payment_token=9]="payment_token"}(L||(L={})),function(e){e.Dynamic="Dynamic",e.Fixed="Fixed"}(M||(M={})),function(e){e.Duo="Duo",e.Single="Single",e.Perk="Perk"}(P||(P={})),function(e){e.Received="received",e.Placed="placed"}(R||(R={})),function(e){e.NonFungibleESDT="NonFungibleESDT"}(B||(B={}))},5340:()=>{},9838:()=>{}},n={};function a(e){var i=n[e];if(void 0!==i)return i.exports;var r=n[e]={exports:{}};return t[e].call(r.exports,r,r.exports,a),r.exports}a.m=t,e=[],a.O=(t,n,i,r)=>{if(!n){var o=1/0;for(d=0;d<e.length;d++){for(var[n,i,r]=e[d],s=!0,c=0;c<n.length;c++)(!1&r||o>=r)&&Object.keys(a.O).every((e=>a.O[e](n[c])))?n.splice(c--,1):(s=!1,r<o&&(o=r));if(s){e.splice(d--,1);var l=i();void 0!==l&&(t=l)}}return t}r=r||0;for(var d=e.length;d>0&&e[d-1][2]>r;d--)e[d]=e[d-1];e[d]=[n,i,r]},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={954:0};a.O.j=t=>0===e[t];var t=(t,n)=>{var i,r,[o,s,c]=n,l=0;if(o.some((t=>0!==e[t]))){for(i in s)a.o(s,i)&&(a.m[i]=s[i]);if(c)var d=c(a)}for(t&&t(n);l<o.length;l++)r=o[l],a.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return a.O(d)},n=this.webpackChunk_xoxno_sdk_js=this.webpackChunk_xoxno_sdk_js||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var i=a.O(void 0,[711],(()=>a(4487)));return i=a.O(i)})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@xoxno/sdk-js"]=t():e["@xoxno/sdk-js"]=t()}(this,(()=>(()=>{var e,t={4487:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AssetCategory:()=>b,AuctionType:()=>p,AuctionTypes:()=>v,CollectionStatsOrderBy:()=>I,CollectionStatsSelectFields:()=>E,CollectionsFieldsToSelect:()=>O,CollectionsOrderBy:()=>A,CollectionsSummaryFilter:()=>x,DropsOderBy:()=>_,FieldsToSelect:()=>S,GlobalOfferFieldsToSelect:()=>C,GlobalOfferOrderBy:()=>D,IssuingType:()=>M,LaunchpadModule:()=>K,Marketplace:()=>y,NftActivityType:()=>F,OfferType:()=>R,OrderByTradingActivity:()=>V,PoolType:()=>P,SCInteraction:()=>z,SearchOrderBy:()=>q,SelectFieldsTradingActivity:()=>L,SuggestOrderBy:()=>k,Type:()=>B});const a="https://api.xoxno.com",i="erd1qqqqqqqqqqqqqpgq705fxpfrjne0tl3ece0rrspykq88mynn4kxs2cg43s",r="erd1qqqqqqqqqqqqqpgqd9rvv2n378e27jcts8vfwynpx0gfl5ufz6hqhfy0u0",o="erd1qqqqqqqqqqqqqpgq8xwzu82v8ex3h4ayl5lsvxqxnhecpwyvwe0sf2qj4e";var s;!function(e){e.MAINNET="1",e.DEVNET="D"}(s||(s={}));class c{static instance;apiUrl;apiKey;chain;config;constructor(e=a,t="",n=s.MAINNET){this.apiUrl=e,this.apiKey=t,this.chain=n,this.config=n===s.MAINNET?{XO_SC:"erd1qqqqqqqqqqqqqpgq6wegs2xkypfpync8mn2sa5cmpqjlvrhwz5nqgepyg8",FM_SC:i,DR_SC:r,KG_SC:o,Staking_SC:"erd1qqqqqqqqqqqqqpgqvpkd3g3uwludduv3797j54qt6c888wa59w2shntt6z",Manager_SC:"erd1qqqqqqqqqqqqqpgqg9fa0dmpn8fu3fnleeqn5zt8rl8mdqjkys5s2gtas7",P2P_SC:"erd1qqqqqqqqqqqqqpgq47y8hnct68v6asjv6gxem6h9rumn9frzah0skhxxt6"}:{XO_SC:"erd1qqqqqqqqqqqqqpgql0dnz6n5hpuw8cptlt00khd0nn4ja8eadsfq2xrqw4",FM_SC:i,DR_SC:r,KG_SC:o,Staking_SC:"erd1qqqqqqqqqqqqqpgqsc5hnewwpep8qq0d7kjjzrquapuucrygah0s85zres",Manager_SC:"erd1qqqqqqqqqqqqqpgqluclyhfsa2uw7q9cjwd8knk989hg57u8ah0slq2nlr",P2P_SC:"erd1qqqqqqqqqqqqqpgqfja7ukpngrun78ueq583l0vd6aj4ekhrah0sa9wyrv"}}static init({apiUrl:e=a,apiKey:t="",chain:n=s.MAINNET}={}){if(!c.instance){if(n==s.DEVNET)return c.instance=new c(e??"https://devnet-api.xoxno.com",t,n),c.instance;c.instance=new c(e,t,n)}return c.instance}fetchWithTimeout=async(e,t={},n=4e4)=>{const a={"Accept-Encoding":"gzip,deflate,br",Referer:"https://xoxno.sdk","User-Agent":"XOXNO/1.0/SDK",..."POST"===t.method?{"Content-Type":"application/json"}:{},...t.headers??{}},i=`${"string"==typeof e&&e.startsWith("/")?`${this.apiUrl}${e}`:e}${t.params?"?"+Object.keys(t.params).map((e=>`${e}=${encodeURIComponent(t.params[e])}`)).join("&"):""}`,r=new AbortController;setTimeout((()=>r.abort()),n);const o=await fetch(i,{...t,...t?.next&&t.next.revalidate?{}:{cache:"no-store"},signal:r.signal,...Object.keys(a).length?{headers:a}:{},method:t.method??"GET"});if(!o.ok)throw new Error((await o.json()).message.toString());return o.json()}}var l=n(2528),d=n(8403);class u{proxy;parser=new l.ResultsParser;constructor(){const e=c.init().apiUrl;this.proxy=new d.ProxyNetworkProvider(e,{timeout:1e4})}async runQuery(e,t){try{const e=await this.proxy.queryContract(t.buildQuery());return this.parser.parseQueryResponse(e,t.getEndpoint())}catch(n){throw console.log(`Unexpected error when running query '${t.buildQuery().func}' to sc '${e.getAddress().bech32()}' `),console.error(n),n}}}var h=n(4966);class g{static manager;static exchange;static minter;static market;static staking;static p2p;static async getMarket(){if(!g.market){const e=await c.init().fetchWithTimeout("https://media.xoxno.com/smartcontractabi/esdt-nft-marketplace.abi.json",{next:{tags:["getMarket"]}}),t=h.AbiRegistry.create(e);g.market=t}return g.market}static async getManager(){if(!g.manager){const e=await c.init().fetchWithTimeout("https://media.xoxno.com/smartcontractabi/manage.json",{next:{tags:["getManager"]}}),t=h.AbiRegistry.create(e);g.manager=t}return g.manager}static async getMinter(){if(!g.minter){const e=await c.init().fetchWithTimeout("https://media.xoxno.com/smartcontractabi/minter.json",{next:{tags:["getMinter"]}}),t=h.AbiRegistry.create(e);g.minter=t}return g.minter}static async getStaking(){if(!g.staking){const e=await c.init().fetchWithTimeout("https://media.xoxno.com/smartcontractabi/staking-nfts.abi.json",{next:{tags:["getStaking"]}}),t=h.AbiRegistry.create(e);g.staking=t}return g.staking}static async getExchange(){if(!g.exchange){const e=await c.init().fetchWithTimeout("https://media.xoxno.com/smartcontractabi/rs-exchange.abi.json",{next:{tags:["getExchange"]}}),t=h.AbiRegistry.create(e);g.exchange=t}return g.exchange}static async getP2P(){if(!g.p2p){const e=await c.init().fetchWithTimeout("https://media.xoxno.com/smartcontractabi/p2p.abi.json",{next:{tags:["getP2P"],revalidate:500}}),t=h.AbiRegistry.create(e);g.p2p=t}return g.p2p}}var m=n(236),f=n(1998);const w=(e,t)=>new f.SmartContract({address:new m.Address(t),abi:e});var p,T=n(4473);!function(e){e[e.NftBid=0]="NftBid",e[e.Nft=1]="Nft",e[e.SftAll=2]="SftAll",e[e.SftOnePerPayment=3]="SftOnePerPayment"}(p||(p={}));var y,S,q,_,k,A,D,O,C,v,b,x,E,I,F,V,L,M,P,R,B,N=n(1594),U=n.n(N),W=n(7586),H=n(3145),G=n(5766),j=n(3979),X=n(5132);class z{xo;call;api;constructor(e){this.xo=e,this.call=new u,this.api=c.init()}static async init(){const e=c.init().config,t=await g.getMarket(),n=w(t,e.XO_SC);return new z(n)}async getResult(e){return await this.call.runQuery(this.xo,e)}getMarketplaceFees=async()=>{const e=this.xo.methods.getMarketplaceCutPercentage(),t=await this.getResult(e);return parseInt(t.firstValue?.valueOf())};getAcceptedPaymentTokens=async()=>{const e=this.xo.methods.getAcceptedTokens(),t=await this.getResult(e);return t.firstValue?.valueOf()};getGlobalOfferIDs=async()=>{const e=this.xo.methods.getGlobalOffers(),t=await this.getResult(e);return t.firstValue?.valueOf().map((e=>parseInt(e)))};async getUserPoolBalance(e,t,n){const a=await this.getResult(this.xo.methods.userDeposit([e,t,n]));return a?.firstValue?new T.BigUIntValue(a.firstValue.valueOf().amount).valueOf().shiftedBy(-18).toNumber():0}isOfferActive(e,t){return e<=t}getGlobalOfferData=async e=>{const t=this.xo.methods.getGlobalOffer([e]),n=await this.getResult(t),a=n.firstValue?.valueOf();return a.offer_id=parseInt(a.offer_id.valueOf()),a.marketplace="XO",a.short_price=parseFloat(new T.BigUIntValue(a.price).valueOf().shiftedBy(-18).toString()),a.new_version=Boolean(a.new_version),a.new_version?a.isActive=!0:a.isActive=this.isOfferActive(a.short_price,await this.getUserPoolBalance(a.owner,a.payment_token,a.payment_nonce)),a.quantity=parseInt(a.quantity.valueOf()),a.payment_nonce=parseInt(a.payment_nonce.valueOf()),a.price=a.price.valueOf(),a.timestamp=parseInt(a.timestamp.valueOf()),a.owner=a.owner.valueOf().toString(),a.attributes&&(a.attributes=JSON.parse(Buffer.from(a.attributes.valueOf().toString(),"base64").toString("ascii"))),a};getAuctionInfo=async e=>{const t=this.xo.methods.getFullAuctionData([e]),n=await this.getResult(t),a=n.firstValue?.valueOf();return a?(a.auctioned_token_nonce=parseInt(a.auctioned_token_nonce.valueOf()),a.nr_auctioned_tokens=parseInt(a.nr_auctioned_tokens.valueOf()),a.auction_type=a.auction_type.name,a.payment_token_nonce=parseInt(a.payment_token_nonce.valueOf()),a.min_bid=a.min_bid.valueOf(),a.max_bid=a.max_bid.valueOf(),a.start_time=parseInt(a.start_time.valueOf()),a.deadline=parseInt(a.deadline.valueOf()),a.original_owner=a.original_owner.valueOf().toString(),a.current_winner=a.current_winner.valueOf().toString(),a.current_bid=a.current_bid.valueOf().toString(),a.marketplace_cut_percentage=a.marketplace_cut_percentage.valueOf(),a.creator_royalties_percentage=a.creator_royalties_percentage.valueOf(),a):null};async getListingsCount(){const e=await this.getResult(this.xo.methods.getListingsCount());return parseInt(e.firstValue?.valueOf())}async getOffersCount(){const e=await this.getResult(this.xo.methods.getOffersCount());return parseInt(e.firstValue?.valueOf())}async getGlobalOffersCount(){const e=await this.getResult(this.xo.methods.getGlobalOffersCount());return parseInt(e.firstValue?.valueOf())}async getCollectionsCount(){const e=await this.getResult(this.xo.methods.getCollectionsCount());return parseInt(e.firstValue?.valueOf())}async isCollectionListed(e){const t=await this.getResult(this.xo.methods.isCollectionListed([e]));return Boolean(t.firstValue?.valueOf())}async getCollectionNFTsOnSaleCount(e){const t=await this.getResult(this.xo.methods.getTokenItemsForSaleCount([e]));return parseInt(t.firstValue?.valueOf())}async getAuctionIDsForCollection(e){const t=await this.getResult(this.xo.methods.getAuctionsForTicker([e])),n=t.firstValue?.valueOf().map((e=>parseInt(e)));return n}withdrawAuctions(e,t,n){if("XO"===n){const n=this.xo.methods.withdraw(e);return t.nonce&&n.withNonce(t.nonce),n.withChainID(this.api.chain).withSender(new m.Address(t.address)).withGasLimit(Math.min(6e8,15e6+5e6*e.length))}throw new Error("Market not supported")}withdrawGlobalOffer(e,t){const n=this.xo.methods.withdrawGlobalOffer([e]);return t.nonce&&n.withNonce(t.nonce),n.withChainID(this.api.chain).withSender(new m.Address(t.address)).withGasLimit(15e6)}acceptGlobalOffer({signature:e,offer_id:t,auction_id_opt:n,nft:a,address:i,nonce:r}){const o=e?this.xo.methods.acceptGlobalOffer([t,n,e]):this.xo.methods.acceptGlobalOffer([t,n]);return o.withSender(new m.Address(i)),a&&o.withSingleESDTNFTTransfer(X.TokenTransfer.semiFungible(a.collection,a.nonce,a.amount??1)),r&&o.withNonce(r),o.withChainID(this.api.chain).withGasLimit(3e7)}sendGlobalOffer({payment_token:e,payment_nonce:t,price:n,collection:a,attributes:i,depositAmount:r,address:o,nonce:s}){const c=i?this.xo.methods.sendGlobalOffer([e,t,X.TokenTransfer.egldFromAmount(n).toString(),a,i]):this.xo.methods.sendGlobalOffer([e,t,X.TokenTransfer.egldFromAmount(n).toString(),a]);return s&&c.withNonce(s),c.withSender(new m.Address(o)),r&&c.withValue(X.TokenTransfer.egldFromAmount(r)),c.withChainID(this.api.chain).withGasLimit(3e7)}sendCustomOffer({payment_token:e,payment_nonce:t,price:n,deadline:a,nft:i,depositAmount:r,address:o,nonce:s}){const c=this.xo.methods.sendOffer([e,t,X.TokenTransfer.egldFromAmount(n).toString(),i.collection,i.nonce,i.amount??1,a]);return s&&c.withNonce(s),c.withSender(new m.Address(o)),r&&c.withValue(X.TokenTransfer.egldFromAmount(r)),c.withChainID(this.api.chain).withGasLimit(3e7)}withdrawCustomOffer(e,t){const n=this.xo.methods.withdrawOffer([e]);return t.nonce&&n.withNonce(t.nonce),n.withSender(new m.Address(t.address)),n.withChainID(this.api.chain).withGasLimit(15e6)}declineCustomOffer(e,t,n){const a=this.xo.methods.declineOffer([e]);return t.nonce&&a.withNonce(t.nonce),a.withSender(new m.Address(t.address)),n&&a.withSingleESDTNFTTransfer(X.TokenTransfer.semiFungible(n.collection,n.nonce,n.amount??1)),a.withChainID(this.api.chain).withGasLimit(2e7)}acceptCustomOffer(e,t,n){const a=this.xo.methods.acceptOffer([e]);return t.nonce&&a.withNonce(t.nonce),a.withSender(new m.Address(t.address)),n&&a.withSingleESDTNFTTransfer(X.TokenTransfer.semiFungible(n.collection,n.nonce,n.amount??1)),a.withChainID(this.api.chain).withGasLimit(3e7)}endAuction(e,t,n="XO"){if("XO"==n){const n=this.xo.methods.endAuction([e]);return t.nonce&&n.withNonce(t.nonce),n.withSender(new m.Address(t.address)),n.withChainID(this.api.chain).withGasLimit(15e6)}throw new Error("Market not supported")}bidOnAuctionId(e,t,n,a,i){const r=this.xo.methods.bid([e,t,n]);if(!a.amount)throw new Error("Payment amount is required");return i.nonce&&r.withNonce(i.nonce),r.withSender(new m.Address(i.address)),"EGLD"==a.collection&&a.amount?r.withValue(X.TokenTransfer.egldFromAmount(a.amount)):r.withSingleESDTTransfer(X.TokenTransfer.fungibleFromAmount(a.collection,a.amount,a.decimals??18)),r.withChainID(this.api.chain).withGasLimit(3e7)}bulkBuy(e,t,n){const a=this.xo.methods.bid(e);if(n.nonce&&a.withNonce(n.nonce),a.withSender(new m.Address(n.address)),!t.amount)throw new Error("Payment amount is required");return"EGLD"==t.collection&&t.amount?a.withValue(X.TokenTransfer.egldFromAmount(t.amount)):a.withSingleESDTTransfer(X.TokenTransfer.fungibleFromAmount(t.collection,t.amount,t.decimals??18)),a.withChainID(this.api.chain).withGasLimit(Math.min(6e8,2e7+5e6*e.length))}async buyAuctionById({auctionID:e,collection:t,nonce:n,paymentAmount:a,quantity:i=1,token:r="EGLD",withCheck:o=!0,isBigUintPayment:s=!1,address:c,nonce:l,isBid:d=!1,decimals:u=18,market:h="XO"}){if("XO"!==h)throw new Error("Market not supported");if(!e)throw new Error("AuctionID not provided");let g=null;if(!a||!r||!t||!n||o){if(g=await this.getAuctionInfo(e),null===g)throw new Error("Auction not found");if(g.auction_type===p.Nft||g.auction_type===p.SftOnePerPayment)throw new Error("Auction type is not NFT or SftOnePerPayment")}const f=g?.payment_token_type??r,w=!!g||s;let T=d?g?.max_bid??a:g?.min_bid??a;if(!T)throw new Error("Payment amount not provided");const y=this.xo.methods.buy([e,g?.auctioned_token_type??t,g?.auctioned_token_nonce??n,i??1]);if(l&&y.withNonce(l),y.withSender(new m.Address(c)),"EGLD"===r)y.withValue(w?X.TokenTransfer.egldFromBigInteger(new(U())(T).multipliedBy(i)):X.TokenTransfer.egldFromAmount(new(U())(T).multipliedBy(i)));else{if(!w){if(g=await this.getAuctionInfo(e),null===g)throw new Error("Auction not found");T=d?g.max_bid:g.min_bid}y.withSingleESDTTransfer(X.TokenTransfer.fungibleFromBigInteger(f,T,u))}return y.withChainID(this.api.chain).withGasLimit(2e7)}async changeListing(e,t){const n=new W.StructType("BulkUpdateListing",[new G.FieldDefinition("payment_token_type","",new H.TokenIdentifierType),new G.FieldDefinition("new_price","",new T.BigUIntType),new G.FieldDefinition("auction_id","",new T.U64Type),new G.FieldDefinition("deadline","",new T.U64Type)]),a=[];e.forEach((({paymentToken:e,price:t,auctionID:i,deadline:r})=>{a.push(new W.Struct(n,[new G.Field(new H.TokenIdentifierValue(e),"payment_token_type"),new G.Field(new T.BigUIntValue(t),"new_price"),new G.Field(new T.U64Value(i),"auction_id"),new G.Field(new T.U64Value(r),"deadline")]))}));const i=this.xo.methods.changeListing(a);return t.nonce&&i.withNonce(t.nonce),i.withSender(new m.Address(t.address)),i.withChainID(this.api.chain).withGasLimit(Math.min(6e8,8e6+2e6*e.length))}async listNFTs(e,t){const n=new W.StructType("BulkListing",[new G.FieldDefinition("min_bid","",new T.BigUIntType),new G.FieldDefinition("max_bid","",new T.BigUIntType),new G.FieldDefinition("deadline","",new T.U64Type),new G.FieldDefinition("accepted_payment_token","",new H.TokenIdentifierType),new G.FieldDefinition("bid","",new j.BooleanType),new G.FieldDefinition("opt_sft_max_one_per_payment","",new j.BooleanType),new G.FieldDefinition("opt_start_time","",new T.U64Type),new G.FieldDefinition("collection","",new H.TokenIdentifierType),new G.FieldDefinition("nonce","",new T.U64Type),new G.FieldDefinition("nft_amount","",new T.BigUIntType)]),a=[],i=[];e.forEach((e=>{const t=e.accepted_payment_token_decimals??18,r=new(U())(e.min_bid).shiftedBy(t),o=new(U())(e.max_bid??0).shiftedBy(t);i.push(X.TokenTransfer.semiFungible(e.collection,e.nonce,e.nft_amount)),a.push(new W.Struct(n,[new G.Field(new T.BigUIntValue(r),"min_bid"),new G.Field(new T.BigUIntValue(o),"max_bid"),new G.Field(new T.U64Value(new(U())(e.deadline??0)),"deadline"),new G.Field(new H.TokenIdentifierValue(e.accepted_payment_token??"EGLD"),"accepted_payment_token"),new G.Field(new j.BooleanValue(e.bid??!1),"bid"),new G.Field(new j.BooleanValue(e.isSFTPack??!1),"opt_sft_max_one_per_payment"),new G.Field(new T.U64Value(new(U())(e.opt_start_time?e.opt_start_time:0)),"opt_start_time"),new G.Field(new H.TokenIdentifierValue(e.collection),"collection"),new G.Field(new T.U64Value(e.nonce),"nonce"),new G.Field(new T.BigUIntValue(new(U())(e.nft_amount)),"nft_amount")]))}));const r=this.xo.methods.listings(a);return t.nonce&&r.withNonce(t.nonce),r.withSender(new m.Address(t.address)),r.withMultiESDTNFTTransfer(i),r.withChainID(this.api.chain).withGasLimit(Math.min(6e8,8e6+2e6*e.length))}}class K{minter;call;constructor(e){this.minter=e,this.call=new u}async getResult(e){return await this.call.runQuery(this.minter,e)}static async init(e){const t=await g.getMinter(),n=w(t,e);return new K(n)}getAllUniqueTags=async()=>{const e=this.minter.methods.collections(),t=await this.getResult(e);return t.firstValue?.valueOf().map((e=>e.toString()))};getWalletGlobalBuyCount=async(e,t)=>{const n=this.minter.methods.buysPerWallet([e,t]),a=await this.getResult(n);return a.firstValue?.valueOf()};getWalletStageBuyCount=async(e,t,n)=>{const a=this.minter.methods.buysStagePerWallet([e,t,n]),i=await this.getResult(a);return i.firstValue?.valueOf()};getLocalOwner=async()=>{const e=this.minter.methods.localOwner(),t=await this.getResult(e);return t.firstValue?.valueOf()};getLaunchpadCutFee=async()=>{const e=this.minter.methods.cutPercentage(),t=await this.getResult(e);return t.firstValue?.valueOf()};getStageWhitelist=async(e,t)=>{const n=this.minter.methods.getWhitelistedWallets([e,t]),a=await this.getResult(n);return a.firstValue?.valueOf().map((e=>e.toString()))};getStages=async e=>{const t=this.minter.methods.mintStage([e]),n=await this.getResult(t);return n.firstValue?.valueOf().map((e=>{const t=e[1].valueOf();return t.name=t.name.toString(),t.tag=t.name.toString(),t.start_time=parseInt(t.start_time.toString()),t.end_time=parseInt(t.end_time.toString()),t.mint_limit=parseInt(t.mint_limit.toString()),t.mint_count=parseInt(t.mint_count.toString()),t.max_per_wallet=parseInt(t.max_per_wallet.toString()),t.prices=t.prices.map((e=>{const t=e.valueOf();return{...t,token_nonce:parseInt(t.token_nonce.toString()),amount:t.amount.toString()}})),t}))}}!function(e){e.XO="xoxno",e.FM="frameit",e.DR="deadrare",e.KG="krogan"}(y||(y={})),function(e){e.Rank="metadata.rarity.rank",e.Attributes="metadata.attributes",e.Description="metadata.description",e.Name="name",e.OnSale="onSale",e.SaleInfo="saleInfo",e.Royalties="royalties",e.Identifier="identifier",e.Collection="collection",e.OriginalURL="url",e.Nonce="nonce",e.ContentType="originalMedia.contentType",e.WasProcessed="wasProcessed",e.AvifURL="avifUrl",e.WebpURL="webpUrl",e.Type="type"}(S||(S={})),function(e){e.PriceHighToLow="saleInfo.minBidShort desc",e.PriceLowToHigh="saleInfo.minBidShort asc",e.MaxPriceHighToLow="saleInfo.maxBidShort desc",e.MaxPriceLowToHigh="saleInfo.maxBidShort asc",e.BidPriceHighToLow="saleInfo.currentBidShort desc",e.BidPriceLowToHigh="saleInfo.currentBidShort asc",e.RarityHighToLow="metadata.rarity.rank desc",e.RarityLowToHigh="metadata.rarity.rank asc",e.NonceHighToLow="nonce desc",e.NonceLowToHigh="nonce asc",e.RecentListed="saleInfo.timestamp desc",e.OldestListed="saleInfo.timestamp asc",e.EndingLate="saleInfo.deadline desc",e.EndingSoon="saleInfo.deadline asc"}(q||(q={})),function(e){e.EndingLate="startTime desc",e.EndingSoon="startTime asc"}(_||(_={})),function(e){e.TotalVolumeHighToLow="statistics/tradeData/totalEgldVolume desc",e.FollowersHighToLow="statistics/other/followCount desc",e.IsVerifiedTrueToFalse="isVerified desc",e.HasImageTrueToFalse="profile desc",e.HasBannerTrueToFalse="banner desc"}(k||(k={})),function(e){e.WeekVolumeHighToLow="statistics.tradeData.weekEgldVolume desc",e.WeekVolumeLowToHigh="statistics.tradeData.weekEgldVolume asc",e.DailyVolumeHighToLow="statistics.tradeData.dayEgldVolume desc",e.DailyVolumeLowToHigh="statistics.tradeData.dayEgldVolume asc",e.TotalVolumeHighToLow="statistics.tradeData.totalEgldVolume desc",e.TotalVolumeLowToHigh="statistics.tradeData.totalEgldVolume asc",e.AvgVolumePriceHighToLow="statistics.tradeData.averageEgldPrice desc",e.AvgVolumePriceLowToHigh="statistics.tradeData.averageEgldPrice asc",e.ATHHighToLow="statistics.tradeData.athEgldPrice desc",e.ATHLowToHigh="statistics.tradeData.athEgldPrice asc",e.TotalTradesHighToLow="statistics.tradeData.totalTrades desc",e.TotalTradesLowToHigh="statistics.tradeData.totalTrades asc",e.SupplyHighToLow="statistics.other.nftCount desc",e.SupplyLowToHigh="statistics.other.nftCount asc",e.FollowersHighToLow="statistics.other.followCount desc",e.FollowersLowToHigh="statistics.other.followCount asc"}(A||(A={})),function(e){e.PriceHighToLow="priceShort desc",e.PriceLowToHigh="priceShort asc",e.OfferIdHighToLow="offerIddesc",e.OfferIdLowToHigh="offerId asc",e.RecentListed="timestamp desc",e.OldestListed="timestamp asc"}(D||(D={})),function(e){e.Profile="profile",e.Description="description",e.Creator="creator",e.Owner="owner",e.Socials="socials",e.Type="type",e.HasStaking="hasStaking",e.Name="name",e.Banner="banner",e.IsVerified="isVerified",e.IsMintable="isMintable",e.Statistics="statistics",e.Collection="collection"}(O||(O={})),function(e){e.Attributes="attributes",e.Collection="collection",e.Marketplace="marketplace",e.PaymentToken="paymentToken",e.LongPrice="price",e.ShortPrice="priceShort"}(C||(C={})),function(e){e.FixedPrice="FixedPrice",e.Auctions="Auctions",e.All="All",e.AllListed="AllListed"}(v||(v={})),function(e){e.ALL="all",e.Trade="trade",e.P2P="p2p",e.Staking="staking",e.Minting="minting"}(b||(b={})),function(e){e.TotalVolume="TotalVolume",e.TotalTrades="TotalTrades",e.DailyVolume="DailyVolume",e.Last2DaysVolume="Last2DaysVolume",e.DailyTrades="DailyTrades",e.Last2DaysTrades="Last2DaysTrades",e.WeekTrades="WeekTrades",e.LastWeekTrades="LastWeekTrades",e.WeekVolume="WeekVolume",e.LastWeekVolume="LastWeekVolume",e.WeeklyTradesMargin="WeeklyTradesMargin",e.DailyTradesMargin="DailyTradesMargin",e.WeeklyVolumeMargin="WeeklyVolumeMargin",e.DailyVolumeEgldMargin="DailyVolumeEgldMargin",e.CollectionAthTrade="CollectionAthTrade"}(x||(x={})),function(e){e.TradingStats="tradingStats"}(E||(E={})),function(e){e.ListedCountDesc="tradingStats.listedCount DESC",e.ListedCountAsc="tradingStats.listedCount ASC",e.FloorPriceDesc="tradingStats.floorPrice DESC",e.FloorPriceAsc="tradingStats.floorPrice ASC",e.TotalVolumeDesc="tradingStats.totalVolume DESC",e.TotalVolumeAsc="tradingStats.totalVolume ASC",e.TotalTradesDesc="tradingStats.totalTrades DESC",e.TotalTradesAsc="tradingStats.totalTrades ASC",e.AllTimeHighDesc="tradingStats.allTimeHigh.price DESC",e.AllTimeHighAsc="tradingStats.allTimeHigh.price ASC",e.DayVolumeDesc="tradingStats.day.volume DESC",e.DayVolumeAsc="tradingStats.day.volume ASC",e.DayVolumeMarginDesc="tradingStats.day.volumeMargin DESC",e.DayVolumeMarginAsc="tradingStats.day.volumeMargin ASC",e.DayTradesDesc="tradingStats.day.trades DESC",e.DayTradesAsc="tradingStats.day.trades ASC",e.DayTradesMarginDesc="tradingStats.day.tradesMargin DESC",e.DayTradesMarginAsc="tradingStats.day.tradesMargin ASC",e.WeekVolumeDesc="tradingStats.week.volume DESC",e.WeekVolumeAsc="tradingStats.week.volume ASC",e.WeekVolumeMarginDesc="tradingStats.week.volumeMargin DESC",e.WeekVolumeMarginAsc="tradingStats.week.volumeMargin ASC",e.WeekTradesDesc="tradingStats.week.trades DESC",e.WeekTradesAsc="tradingStats.week.trades ASC",e.WeekTradesMarginDesc="tradingStats.week.tradesMargin DESC",e.WeekTradesMarginAsc="tradingStats.week.tradesMargin ASC",e.MonthVolumeDesc="tradingStats.month.volume DESC",e.MonthVolumeAsc="tradingStats.month.volume ASC",e.MonthVolumeMarginDesc="tradingStats.month.volumeMargin DESC",e.MonthVolumeMarginAsc="tradingStats.month.volumeMargin ASC",e.MonthTradesDesc="tradingStats.month.trades DESC",e.MonthTradesAsc="tradingStats.month.trades ASC",e.MonthTradesMarginDesc="tradingStats.month.tradesMargin DESC",e.MonthTradesMarginAsc="tradingStats.month.tradesMargin ASC",e.YearVolumeDesc="tradingStats.year.volume DESC",e.YearVolumeAsc="tradingStats.year.volume ASC",e.YearVolumeMarginDesc="tradingStats.year.volumeMargin DESC",e.YearVolumeMarginAsc="tradingStats.year.volumeMargin ASC",e.YearTradesDesc="tradingStats.year.trades DESC",e.YearTradesAsc="tradingStats.year.trades ASC",e.YearTradesMarginDesc="tradingStats.year.tradesMargin DESC",e.YearTradesMarginAsc="tradingStats.year.tradesMargin ASC"}(I||(I={})),function(e){e.NFT_CREATE="nftCreate",e.NFT_BURN="nftBurn",e.NFT_UPDATE="nftUpdate",e.NFT_TRANSFER="nftTransfer",e.LISTING_CREATE="listingCreate",e.LISTING_WITHDRAW="listingWithdraw",e.LISTING_UPDATE="listingUpdate",e.AUCTION_BID="auctionBid",e.AUCTION_OUT_BID="auctionOutBid",e.OFFER_CREATE="offerCreate",e.OFFER_WITHDRAW="offerWithdraw",e.OFFER_REJECT="offerReject",e.GLOBAL_OFFER_CREATE="globalOfferCreate",e.GLOBAL_OFFER_WITHDRAW="globalOfferWithdraw",e.TRADE="trade",e.BULK_TRADE="bulkTrade",e.AUCTION_TRADE="auctionTrade",e.OTHER_TRADE="otherTrade",e.OFFER_TRADE="offerTrade",e.GLOBAL_OFFER_TRADE="globalOfferTrade",e.STAKE="stake",e.UN_STAKE="unStake"}(F||(F={})),function(e){e.PriceHighToLow="activityData.egldValue desc",e.PriceLowToHigh="activityData.egldValue asc",e.RecentPlaced="timestamp desc",e.OldestPlaced="timestamp asc"}(V||(V={})),function(e){e[e.attributes=0]="attributes",e[e.collection=1]="collection",e[e.offer_id=2]="offer_id",e[e.owner=3]="owner",e[e.short_price=4]="short_price",e[e.price=5]="price",e[e.id=6]="id",e[e.dataType=7]="dataType",e[e.marketplace=8]="marketplace",e[e.payment_token=9]="payment_token"}(L||(L={})),function(e){e.Dynamic="Dynamic",e.Fixed="Fixed"}(M||(M={})),function(e){e.Duo="Duo",e.Single="Single",e.Perk="Perk"}(P||(P={})),function(e){e.Received="received",e.Placed="placed"}(R||(R={})),function(e){e.NonFungibleESDT="NonFungibleESDT"}(B||(B={}))},5340:()=>{},9838:()=>{}},n={};function a(e){var i=n[e];if(void 0!==i)return i.exports;var r=n[e]={exports:{}};return t[e].call(r.exports,r,r.exports,a),r.exports}a.m=t,e=[],a.O=(t,n,i,r)=>{if(!n){var o=1/0;for(d=0;d<e.length;d++){for(var[n,i,r]=e[d],s=!0,c=0;c<n.length;c++)(!1&r||o>=r)&&Object.keys(a.O).every((e=>a.O[e](n[c])))?n.splice(c--,1):(s=!1,r<o&&(o=r));if(s){e.splice(d--,1);var l=i();void 0!==l&&(t=l)}}return t}r=r||0;for(var d=e.length;d>0&&e[d-1][2]>r;d--)e[d]=e[d-1];e[d]=[n,i,r]},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={954:0};a.O.j=t=>0===e[t];var t=(t,n)=>{var i,r,[o,s,c]=n,l=0;if(o.some((t=>0!==e[t]))){for(i in s)a.o(s,i)&&(a.m[i]=s[i]);if(c)var d=c(a)}for(t&&t(n);l<o.length;l++)r=o[l],a.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return a.O(d)},n=this.webpackChunk_xoxno_sdk_js=this.webpackChunk_xoxno_sdk_js||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var i=a.O(void 0,[711],(()=>a(4487)));return i=a.O(i)})()));
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/utils/api.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AACnE,oBAAY,KAAK;IACf,OAAO,MAAM;IACb,MAAM,MAAM;CACb;AACD,qBAAa,WAAW;IACtB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAc;IAC9B,MAAM,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,MAAM,CAAS;IAChB,KAAK,EAAE,QAAQ,CAAC;IAChB,MAAM,EAAE;QACb,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IAEF,OAAO;WA8BO,IAAI,CAAC,EACjB,MAAgB,EAChB,MAAW,EACX,KAAqB,GACtB,GAAE,OAAO,CAAC;QACT,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,KAAK,CAAC;KACf,CAAM,GAAG,WAAW;IAUd,gBAAgB,YACf,MAAM,YACH,OAAO,MAAM,EAAE,GAAG,CAAC,uBAE3B,QAAQ,CAAC,CAAC,CAqCX;CACH"}
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/utils/api.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AACnE,oBAAY,KAAK;IACf,OAAO,MAAM;IACb,MAAM,MAAM;CACb;AACD,qBAAa,WAAW;IACtB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAc;IAC9B,MAAM,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,MAAM,CAAS;IAChB,KAAK,EAAE,QAAQ,CAAC;IAChB,MAAM,EAAE;QACb,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IAEF,OAAO;WA8BO,IAAI,CAAC,EACjB,MAAgB,EAChB,MAAW,EACX,KAAqB,GACtB,GAAE,OAAO,CAAC;QACT,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,KAAK,CAAC;KACf,CAAM,GAAG,WAAW;IAed,gBAAgB,YACf,MAAM,YACH,OAAO,MAAM,EAAE,GAAG,CAAC,uBAE3B,QAAQ,CAAC,CAAC,CAqCX;CACH"}
@@ -1,5 +1,5 @@
1
1
  export declare const API_URL = "https://api.xoxno.com";
2
- export declare const API_URL_DEV = "https://api-dev.xoxno.com";
2
+ export declare const API_URL_DEV = "https://devnet-api.xoxno.com";
3
3
  export declare const XOXNO_SC = "erd1qqqqqqqqqqqqqpgq6wegs2xkypfpync8mn2sa5cmpqjlvrhwz5nqgepyg8";
4
4
  export declare const FM_SC = "erd1qqqqqqqqqqqqqpgq705fxpfrjne0tl3ece0rrspykq88mynn4kxs2cg43s";
5
5
  export declare const DR_SC = "erd1qqqqqqqqqqqqqpgqd9rvv2n378e27jcts8vfwynpx0gfl5ufz6hqhfy0u0";
@@ -7,8 +7,8 @@ export declare const KG_SC = "erd1qqqqqqqqqqqqqpgq8xwzu82v8ex3h4ayl5lsvxqxnhecpw
7
7
  export declare const Staking_SC = "erd1qqqqqqqqqqqqqpgqvpkd3g3uwludduv3797j54qt6c888wa59w2shntt6z";
8
8
  export declare const Manager_SC = "erd1qqqqqqqqqqqqqpgqg9fa0dmpn8fu3fnleeqn5zt8rl8mdqjkys5s2gtas7";
9
9
  export declare const P2P_SC = "erd1qqqqqqqqqqqqqpgq47y8hnct68v6asjv6gxem6h9rumn9frzah0skhxxt6";
10
- export declare const XOXNO_SC_DEV = "erd1qqqqqqqqqqqqqpgqn4fnwl43hhchz9emdy66eh5azzhl599zd8ssxjdyh3";
11
- export declare const Staking_SC_DEV = "erd1qqqqqqqqqqqqqpgqmkt2fvumf0zgum5qd0awl2l46x2pxdgmr5rswjr6r8";
12
- export declare const Manager_SC_DEV = "erd1qqqqqqqqqqqqqpgq6sysl7mga393a850xemfpawaqanf4da5d8ssp3xamn";
13
- export declare const P2P_SC_DEV = "erd1qqqqqqqqqqqqqpgqhuvnvkwwmucdzy3g7pvgvjumjfcgfwf69w2svch5c2";
10
+ export declare const XOXNO_SC_DEV = "erd1qqqqqqqqqqqqqpgql0dnz6n5hpuw8cptlt00khd0nn4ja8eadsfq2xrqw4";
11
+ export declare const Staking_SC_DEV = "erd1qqqqqqqqqqqqqpgqsc5hnewwpep8qq0d7kjjzrquapuucrygah0s85zres";
12
+ export declare const Manager_SC_DEV = "erd1qqqqqqqqqqqqqpgqluclyhfsa2uw7q9cjwd8knk989hg57u8ah0slq2nlr";
13
+ export declare const P2P_SC_DEV = "erd1qqqqqqqqqqqqqpgqfja7ukpngrun78ueq583l0vd6aj4ekhrah0sa9wyrv";
14
14
  //# sourceMappingURL=const.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"const.d.ts","sourceRoot":"","sources":["../../src/utils/const.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,0BAA0B,CAAC;AAC/C,eAAO,MAAM,WAAW,8BAA8B,CAAC;AAEvD,eAAO,MAAM,QAAQ,mEAC6C,CAAC;AACnE,eAAO,MAAM,KAAK,mEACgD,CAAC;AACnE,eAAO,MAAM,KAAK,mEACgD,CAAC;AACnE,eAAO,MAAM,KAAK,mEACgD,CAAC;AACnE,eAAO,MAAM,UAAU,mEAC2C,CAAC;AACnE,eAAO,MAAM,UAAU,mEAC2C,CAAC;AACnE,eAAO,MAAM,MAAM,mEAC+C,CAAC;AAEnE,eAAO,MAAM,YAAY,mEACyC,CAAC;AACnE,eAAO,MAAM,cAAc,mEACuC,CAAC;AACnE,eAAO,MAAM,cAAc,mEACuC,CAAC;AACnE,eAAO,MAAM,UAAU,mEAC2C,CAAC"}
1
+ {"version":3,"file":"const.d.ts","sourceRoot":"","sources":["../../src/utils/const.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,0BAA0B,CAAC;AAC/C,eAAO,MAAM,WAAW,iCAAiC,CAAC;AAE1D,eAAO,MAAM,QAAQ,mEAC6C,CAAC;AACnE,eAAO,MAAM,KAAK,mEACgD,CAAC;AACnE,eAAO,MAAM,KAAK,mEACgD,CAAC;AACnE,eAAO,MAAM,KAAK,mEACgD,CAAC;AACnE,eAAO,MAAM,UAAU,mEAC2C,CAAC;AACnE,eAAO,MAAM,UAAU,mEAC2C,CAAC;AACnE,eAAO,MAAM,MAAM,mEAC+C,CAAC;AAEnE,eAAO,MAAM,YAAY,mEACyC,CAAC;AACnE,eAAO,MAAM,cAAc,mEACuC,CAAC;AACnE,eAAO,MAAM,cAAc,mEACuC,CAAC;AACnE,eAAO,MAAM,UAAU,mEAC2C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xoxno/sdk-js",
3
- "version": "0.1.92-alpha",
3
+ "version": "0.1.93-alpha",
4
4
  "description": "The SDK to interact with the XOXNO Protocol!",
5
5
  "type": "commonjs",
6
6
  "exports": {