@xoxno/sdk-js 0.1.337 → 0.1.339

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.cjs.js CHANGED
@@ -1 +1 @@
1
- (()=>{"use strict";var t,e,i,a,n,r,o,s,c,l,d,g,h,u,p,f,T,m,y,w,E,S,A,k,v={d:(t,e)=>{for(var i in e)v.o(e,i)&&!v.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})}},C={};v.r(C),v.d(C,{ActivityChain:()=>u,AssetCategory:()=>d,AuctionType:()=>m,AuctionTypes:()=>l,Chain:()=>H,CollectionModule:()=>Y,CollectionStatsOrderBy:()=>h,CollectionStatsSelectFields:()=>g,CollectionsFieldsToSelect:()=>s,CollectionsOrderBy:()=>r,CommonModule:()=>et,DropsOderBy:()=>a,EventUserRolePermission:()=>b,EventUserRoles:()=>W,FieldsToSelect:()=>e,GlobalOfferFieldsToSelect:()=>c,GlobalOfferOrderBy:()=>o,IEventCategory:()=>k,IssuingType:()=>y,Marketplace:()=>t,NFTModule:()=>Z,NftActivityType:()=>p,OfferType:()=>S,OrderByTradingActivity:()=>f,PoolType:()=>w,SearchOrderBy:()=>i,SelectFieldsTradingActivity:()=>T,StakingModule:()=>tt,StakingStatus:()=>E,SuggestOrderBy:()=>n,Type:()=>A,UserModule:()=>Q,XOXNOClient:()=>G,eventCategories:()=>q,eventPermissions:()=>F,eventRoles:()=>L,eventSubCategories:()=>P,getEventCategories:()=>x,getEventSubCategories:()=>M,isValidCollectionTicker:()=>z,isValidNftIdentifier:()=>K}),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"}(n||(n={})),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"}(r||(r={})),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"}(o||(o={})),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"}(c||(c={})),function(t){t.FixedPrice="FixedPrice",t.Auctions="Auctions",t.All="All",t.AllListed="AllListed"}(l||(l={})),function(t){t.ALL="all",t.Trade="trade",t.P2P="p2p",t.Staking="staking",t.Minting="minting"}(d||(d={})),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"}(h||(h={})),function(t){t.MVX="MVX",t.SUI="SUI"}(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.Staked="staked",t.Unbounding="unstaked",t.Available="available"}(E||(E={})),function(t){t.Received="received",t.Placed="placed"}(S||(S={})),function(t){t.NonFungibleESDT="NonFungibleESDT"}(A||(A={})),function(t){t.FESTIVAL="festival",t.CONFERENCE="conference",t.NETWORKING="networking",t.MEETUP="meetup",t.WEB3="web3",t.ENTERTAINMENT="entertainment"}(k||(k={}));const q=Object.values(k);var N,I,D,O,_,R;!function(t){t.MUSIC="music",t.ARTS_AND_CULTURE="arts-and-culture",t.FOOD_AND_DRINK="food-and-drink",t.LIFESTYLE_AND_WELLNESS="lifestyle-and-wellness",t.LOCAL_AND_COMMUNITY="local-and-community"}(N||(N={})),function(t){t.TECHNOLOGY_AND_INNOVATION="technology-and-innovation",t.BUSINESS_AND_FINANCE="business-and-finance",t.HEALTHCARE_AND_SCIENCE="healthcare-and-science",t.EDUCATION_AND_LEARNING="education-and-learning",t.MARKETING_AND_MEDIA="marketing-and-media"}(I||(I={})),function(t){t.INDUSTRY_SPECIFIC="industry-specific",t.CAREER_DEVELOPMENT="career-development",t.INVESTOR_AND_STARTUPS="investor-and-startups",t.SOCIAL_IMPACT="social-impact",t.PERSONAL_DEVELOPMENT="personal-development"}(D||(D={})),function(t){t.HOBBIES_AND_INTERESTS="hobbies-and-interests",t.PROFESSIONAL_GROUPS="professional-groups",t.SOCIAL_GATHERING="social-gathering",t.EDUCATION_AND_SKILLS="education-and-skills",t.FAMILY_AND_KIDS="family-and-kids"}(O||(O={})),function(t){t.BLOCKCHAIN_AND_CRYPTOCURRENCY="blockchain-and-cryptocurrency",t.METAVERSE_AND_VR="metaverse-and-vr",t.DEFI_AND_FINANCE="defi-and-finance",t.DAO_AND_GOVERNANCE="dao-and-governance",t.WEB3_STARTUPS="web3-startups"}(_||(_={})),function(t){t.LIVE_MUSIC="live-music",t.COMEDY_SHOWS="comedy-shows",t.THEATRE_AND_PERFORMANCE="theatre-and-performance",t.MOVIES="movies",t.NIGHTLIFE_AND_CLUBBING="nightlife-and-clubbing"}(R||(R={}));const P={festival:Object.values(N),conference:Object.values(I),networking:Object.values(D),meetup:Object.values(O),web3:Object.values(_),entertainment:Object.values(R)};async function x(){return q}async function M(t){return P[t]}var W,b;!function(t){t.EVENT_MANAGER="event-manager",t.CHECK_IN_MANAGER="check-in-manager",t.EVENT_READER="event-reader"}(W||(W={})),function(t){t.EVENT_READER_VIEW="event-reader-view",t.EVENT_MANAGER_EDIT_PAGE="event-manager-edit-page",t.EVENT_MANAGER_CREATE_TICKET="event-manager-create-ticket",t.EVENT_MANAGER_EDIT_TICKET="event-manager-edit-ticket",t.EVENT_MANAGER_DELETE_TICKET="event-manager-delete-ticket",t.EVENT_MANAGER_EDIT_GUEST="event-manager-edit-guest",t.EVENT_MANAGER_CREATE_STAGE="event-manager-create-stage",t.EVENT_MANAGER_EDIT_STAGE="event-manager-edit-stage"}(b||(b={}));const L=Object.values(W),F=Object.values(b),V="https://api.xoxno.com",$="erd1qqqqqqqqqqqqqpgq705fxpfrjne0tl3ece0rrspykq88mynn4kxs2cg43s",B="erd1qqqqqqqqqqqqqpgqd9rvv2n378e27jcts8vfwynpx0gfl5ufz6hqhfy0u0",U="erd1qqqqqqqqqqqqqpgq8xwzu82v8ex3h4ayl5lsvxqxnhecpwyvwe0sf2qj4e";var H;!function(t){t.MAINNET="1",t.DEVNET="D"}(H||(H={}));class G{static instance;apiUrl;apiKey;chain;config;constructor(t=V,e="",i){this.apiUrl=t,this.apiKey=e,this.chain=i,this.config=i==H.MAINNET?{mediaUrl:"https://media.xoxno.com",gatewayUrl:"https://gateway.xoxno.com",XO_SC:"erd1qqqqqqqqqqqqqpgq6wegs2xkypfpync8mn2sa5cmpqjlvrhwz5nqgepyg8",FM_SC:$,DR_SC:B,KG_SC:U,Staking_SC:"erd1qqqqqqqqqqqqqpgqvpkd3g3uwludduv3797j54qt6c888wa59w2shntt6z",Manager_SC:"erd1qqqqqqqqqqqqqpgqg9fa0dmpn8fu3fnleeqn5zt8rl8mdqjkys5s2gtas7",P2P_SC:"erd1qqqqqqqqqqqqqpgq47y8hnct68v6asjv6gxem6h9rumn9frzah0skhxxt6"}:{mediaUrl:"https://devnet-media.xoxno.com",gatewayUrl:"https://devnet-gateway.xoxno.com",XO_SC:"erd1qqqqqqqqqqqqqpgql0dnz6n5hpuw8cptlt00khd0nn4ja8eadsfq2xrqw4",FM_SC:$,DR_SC:B,KG_SC:U,Staking_SC:"erd1qqqqqqqqqqqqqpgqsc5hnewwpep8qq0d7kjjzrquapuucrygah0s85zres",Manager_SC:"erd1qqqqqqqqqqqqqpgqluclyhfsa2uw7q9cjwd8knk989hg57u8ah0slq2nlr",P2P_SC:"erd1qqqqqqqqqqqqqpgqfja7ukpngrun78ueq583l0vd6aj4ekhrah0sa9wyrv"}}static init({apiUrl:t=V,apiKey:e="",chain:i=H.MAINNET}={}){if(null==G.instance||null==G.instance){if(i==H.DEVNET)return G.instance=new G(t??"https://devnet-api.xoxno.com",e,i),G.instance;G.instance=new G(t,e,i)}return G.instance}static getInstance(){if(null==G.instance||null==G.instance)throw new Error("XOXNOClient is not initialized");return G.instance}fetchWithTimeout=async(t,e={})=>{const i=e?.headers?.Authorization,a="Bearer undefined"===i?void 0:i,n={"Accept-Encoding":"gzip,deflate,br",Referer:"https://xoxno.sdk","User-Agent":"XOXNO/1.0/SDK",..."POST"===e.method?{"Content-Type":"application/json"}:{},...a?{Authorization:a}:{}},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=await fetch(r,{...e,cache:"no-store",...Object.keys(n).length?{headers:n}:{},method:e.method??"GET"});if(!o.ok){const e=await o.text();let i;try{i=JSON.parse(e)}catch(t){i={message:e}}throw new Error(`${t}: ${o.status};${o.statusText};${i.message}`)}return o.json()}}const j=async(t,e)=>{if(t.top&&t.top>100)throw new Error("Top cannot be greater than 100");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,eventIdentifier:t.eventIdentifier||void 0,range:i},strictSelect:t.strictSelect,includeCount:t.includeCount||!1,orderBy:t.orderBy,select:t.select,top:t.top||35,skip:t.skip||0},n=await e.fetchWithTimeout("/activity/query",{params:{filter:JSON.stringify(a)},next:{tags:["getActivity"]}});return{...n,getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)},empty:0===n.resources.length}},z=t=>{const e=t.length>=4&&t.length<=40||/^0x[a-fA-F0-9]{1,64}::[a-zA-Z0-9_]+::[a-zA-Z0-9_]+(<.+>)?$/.test(decodeURIComponent(t)),i=/^[A-Z0-9]{3,10}-[a-z0-9]{6}$/.test(t);return e||i},K=t=>{const e=/^0x[a-fA-F0-9]{1,64}$/.test(t),i=/^[A-Za-z0-9]{3,10}-[A-Za-z0-9]{6}-[A-Za-z0-9]{2,7}(?:-\d+(?:-[A-Za-z0-9]+)?)?$/.test(t);return e||i};class Y{api;constructor(){this.api=G.getInstance()}getCollectionProfile=async t=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/profile`,{next:{tags:["getCollectionProfile"]}})};getDailyTrending=async()=>await this.api.fetchWithTimeout("/nfts/getDailyTrending",{next:{tags:["getDailyTrending"]}});getCollectionFloorPrice=async(t,e="EGLD")=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/floor-price`,{next:{tags:["getCollectionFloorPrice"]},params:{token:e}})};getCollectionAttributes=async t=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/attributes`,{next:{tags:["getCollectionAttributes"]}})};getNFTs=async t=>{if(t?.collections?.forEach((t=>{if(!z(t))throw new Error("Invalid collection ticker: "+t)})),t.top&&t.top>100)throw new Error("Top cannot be greater than 100");const e=[];t.priceRange&&e.push({...t.priceRange,field:t.auctionType==l.Auctions?"saleInfo.currentBidShort":"saleInfo.minBidShort"}),t.rankRange&&e.push({...t.rankRange,field:"metadata.rarity.rank"});const i={name:t.name,filters:{dataType:t.dataType??["nft"],activeAuction:t.activeAuctions,identifier:t.identifiers,collection:t.collections??[],onSale:t.onlyOnSale,saleInfo:{seller:t.listedBy||[],marketplace:t.listedOnlyOn||void 0,paymentToken:t.listedInToken||[],auctionType:t.auctionType==l.Auctions?["NftBid","SftAll"]:t.auctionType==l.FixedPrice?["Nft","SftOnePerPayment"]:t.auctionType==l.AllListed?["NftBid","SftAll","Nft","SftOnePerPayment"]:void 0},owner:t.ownedBy||[],verifiedOnly:t.onlyVerified||!1,metadata:{attributes:t.attributes||void 0},range:e,nonce:t.nonces||void 0,cp_staked:t.isStaked??void 0},applyNftExtraDetails:t.applyNftExtraDetails,orderBy:t.orderBy||[],select:t.onlySelectFields||[],strictSelect:t.strictSelect||!1,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"]}}),getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)}}};getSearchNFTs=async t=>{if(t?.collections?.forEach((t=>{if(!z(t))throw new Error("Invalid collection ticker: "+t)})),t.top&&t.top>100)throw new Error("Top cannot be greater than 100");const e=[];t.priceRange&&e.push({...t.priceRange,field:t.auctionType==l.Auctions?"saleInfo.currentBidShort":"saleInfo.minBidShort"}),t.rankRange&&e.push({...t.rankRange,field:"metadata.rarity.rank"});const i={name:t.name,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==l.Auctions?["NftBid","SftAll"]:t.auctionType==l.FixedPrice?["Nft","SftOnePerPayment"]:t.auctionType==l.AllListed?["NftBid","SftAll","Nft","SftOnePerPayment"]:void 0},owner:t.ownedBy||[],verifiedOnly:t.onlyVerified||!1,metadata:{attributes:t.attributes||void 0},range:e,nonce:t.nonces||void 0,cp_staked:t.isStaked??void 0},applyNftExtraDetails:t.applyNftExtraDetails,orderBy:t.orderBy||[],select:t.onlySelectFields||[],strictSelect:t.strictSelect||!1,includeCount:t.includeCount||!1,top:t.top||35,skip:t.skip||0};return{...await this.api.fetchWithTimeout("/nft/search/query",{params:{filter:JSON.stringify(i)},next:{tags:["getCollectionNFTs"]}}),getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)}}};suggestCollections=async t=>{if(t.top&&t.top>100)throw new Error("Top cannot be greater than 100");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"]}})};collectionListingsAnalytics=async t=>await this.api.fetchWithTimeout(`/collection/${t}/listings`,{next:{tags:["collection/${ticker}/listings"]}});getTradingActivity=async t=>await j(t,this.api);getOffers=async t=>await this.api.fetchWithTimeout("/nft/offer/query",{params:{filter:JSON.stringify(t)},next:{tags:["/nft/offer/query"]}});getCollections=async t=>{if(t?.top&&t.top>100)throw new Error("Top cannot be greater than 100");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"]}});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>100)throw new Error("Top cannot be greater than 100");const e={skip:t?.skip||0,top:t?.top||25,select:t?.onlySelectFields||[],filters:{collection:t?.collections||[],withAttributes:t?.withAttributes,isActive:t?.onlyActive,offerId:t?.offerIds,owner:t?.ownedBy,marketplace:t?.listedOnlyOn,range:t?.priceRange?{...t.priceRange,type:"priceShort"}:void 0,attributes:t?.attributes},orderBy:t?.orderBy||[o.PriceHighToLow]},i=await this.api.fetchWithTimeout("/collection/global-offer/query",{params:{filter:JSON.stringify(e)},next:{tags:["getGlobalOffers"]}});return{...i,getNextPagePayload:{...t,skip:(t?.top||25)+i.lastSkip}}};getCollectionVolume=async(t,e,i,a)=>{if(!z(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"]}})};getMarketplaceVolume=async(t,e,i)=>await this.api.fetchWithTimeout(`/analytics/volume?startTime=${t}&endTime=${e}&bin=${i}`,{next:{tags:["getMarketplaceVolume"]}});getCollectionOwners=async t=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/holders`,{next:{tags:["getCollectionOwners"]}})};getExportOwners=async t=>{if(!z(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>100)throw new Error("Top cannot be greater than 100");return{...await this.api.fetchWithTimeout("/collection/stats/query",{params:{filter:JSON.stringify(t)},next:{tags:["collectionStatistics"]}}),getNextPagePayload:{...t,skip:t.skip+t.top}}};getCollectionStats=async t=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/stats`,{next:{tags:["collectionStatistics"]}})};getAwaitEmpty=async t=>new Promise((e=>{setTimeout((()=>{e(!0)}),t)}));getCollectionMintInfo=async({ticker:t,extra:e})=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/drop-info`,{next:{tags:[`/collection/${t}/drop-info`]},...e})};getCollectionRanks=async({ticker:t,extra:e})=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/ranks`,{next:{tags:[`/collection/${t}/ranks`]},...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`]},...i});getCollectionGraphData=async(t,e,i,a)=>{if(!z(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`]}})};getPinnedCollections=async t=>await this.api.fetchWithTimeout("/collection/pinned"+(t?`?chain=${t}`:""),{next:{tags:["/collection/pinned"]}});getPinnedDrops=async t=>await this.api.fetchWithTimeout("/collection/pinned-drops"+(t?`?chain=${t}`:""),{next:{tags:["/collection/pinned-drops"]}});getSearchDrops=async t=>{if(t?.collections?.forEach((t=>{if(!z(t))throw new Error("Invalid collection ticker: "+t)})),t.top&&t.top>100)throw new Error("Top cannot be greater than 100");const e=[];t.timeRange&&e.push({...t.timeRange,field:"startTime"});const i={name:t.name,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/search",{params:{filter:JSON.stringify(i)},next:{tags:["/collection/drops/search"]}}),getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)}}};getDrops=async t=>{if(t?.collections?.forEach((t=>{if(!z(t))throw new Error("Invalid collection ticker: "+t)})),t.top&&t.top>100)throw new Error("Top cannot be greater than 100");const e=[];t.timeRange&&e.push({...t.timeRange,field:"startTime"});const i={name:t.name,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"]}}),getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)}}};getCollectionStakingSummary=async({collection:t,extra:e})=>{if(!z(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(!z(t))throw new Error("Invalid collection ticker: "+t)})),await this.api.fetchWithTimeout("/collection/floor-price",{params:{collection:t.join(",")}}))}const J=t=>{let e=t.toString(16);return e.length%2!=0&&(e="0"+e),e},X=t=>!!t&&(t.includes("erd1")&&62===t.length||/^0x[a-fA-F0-9]{64}$/.test(t));class Z{api;constructor(){this.api=G.getInstance()}getNFTByIdentifier=async(t,e)=>{if(!K(t))throw new Error("Invalid identifier: "+t);return await this.api.fetchWithTimeout(`/nft/${t}`,{...e})};getNFTsOffers=async(t,e=0,i=25)=>{if(!K(t))throw new Error("Invalid identifier: "+t);return await this.api.fetchWithTimeout(`/nft/${t}/offers?skip=${e}&top=${i}`,{next:{tags:["getNFTsOffers"]}})};getNFTByCollectionAndNonce=async(t,e)=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);const i=await this.api.fetchWithTimeout(`/${((t,e)=>[t,J(e)].join("-"))(t,e)}`);return i};getPinnedNFTs=async t=>await this.api.fetchWithTimeout("/nft/pinned"+(t?`?chain=${t}`:""),{next:{tags:["/nft/pinned"]}});getNFTByCollectionAndNonceHex=async(t,e)=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);return e.length%2!=0&&(e="0"+e),await this.api.fetchWithTimeout(`/${[t,e].join("-")}`)};getTradingActivity=async t=>await j(t,this.api)}class Q{api;collection;constructor(){this.api=G.getInstance(),this.collection=new Y}getUserProfile=async t=>{if(!X(t))throw new Error("Invalid address:"+t);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(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/network-account`)};getUserTokenInventory=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/token-inventory`)};getUserSummaryInventory=async(t,e=!0)=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/inventory-summary?activeAuction=${e}`)};getUserNFTs=async t=>await this.collection.getNFTs(t);getUserOffers=async t=>{if(!X(t.address))throw new Error("Invalid address:"+t.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>100)throw new Error("Top cannot be greater than 100");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"]}})};getTradingActivity=async t=>await j(t,this.api);getUserCreatorProfile=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/creator/profile`)};getCreatorListings=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/creator/listing`)};getCreatorEvents=async(t,e)=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/creator/events`,{...e})};getUserStakingSummary=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/summary`)};getUserStakingAailable=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/available-pools`)};getUserCreatorInfo=async(t,e)=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/creator/details`,{...e})};getUserCollectionStaking=async(t,e)=>{if(!X(t))throw new Error("Invalid address:"+t);if(!z(e))throw new Error("Invalid collection ticker: "+e);return await this.api.fetchWithTimeout(`/user/${t}/staking/collection/${e}`)};getUserPoolStaking=async(t,e,i)=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/pool/${e}/nfts?status=${i}`)};getOwnedPoolsByAddress=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/owned-pools`)};getUserAnalyticsSummary=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/analytics/volume`)};getUserFavoriteNFTs=async(t,e,i)=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/favorite/nfts`,{params:{top:e,skip:i}})};getUserFavoriteCollectionTickers=async t=>{if(!X(t))throw new Error("Invalid address:"+t);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,orderDirection:a})=>{if(t&&t>35)throw new Error("Top cannot be greater than 100");return await this.api.fetchWithTimeout("/user/stats",{params:{top:t,skip:e,orderBy:i,orderDirection:a??"desc"},next:{tags:["/user/stats"]}})};getStakingCreatorInfo=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/creator`,{next:{tags:[`/user/${t}/staking/creator`]}})};getUsersDrop=async({top:t,skip:e,address:i})=>{if(t&&t>35)throw new Error("Top cannot be greater than 100");if(i&&!X(i))throw new Error("Invalid address:"+i);return await this.api.fetchWithTimeout("/user/xoxno-drop",{params:{top:t,skip:e,...i?{address:i}:{}},next:{tags:["/user/xoxno-drop"]}})};getUserOwnerCollections=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/owned-collections`)};getRoyaltiesSharesCreator=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/launchpad/${t}/shareholders/royalties`)};getMintSharesCreator=async(t,e)=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/launchpad/${t}/shareholders/collection/${e}`)}}class tt{api;constructor(){this.api=G.getInstance()}getPoolDetails=async t=>await this.api.fetchWithTimeout(`/pool/${t}/profile`)}class et{api;constructor(){this.api=G.getInstance()}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={};return e&&(i={identifier:e.join(",")}),t&&(i={...i,category:t.join(",")}),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"]}});getAnalyticsOverview=async()=>await this.api.fetchWithTimeout("/analytics/overview",{next:{tags:["/analytics/overview"]}});suggestResults=async t=>{if(t.top&&t.top>100)throw new Error("Top cannot be greater than 100");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"]}})};getExploreStaking=async()=>await this.api.fetchWithTimeout("/collection/staking/explore",{next:{tags:["/collection/staking/explore"]}})}module.exports=C})();
1
+ (()=>{"use strict";var t,e,i,a,n,r,o,s,c,l,d,g,h,u,p,f,T,m,y,w,E,S,A,k,v={d:(t,e)=>{for(var i in e)v.o(e,i)&&!v.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})}},C={};v.r(C),v.d(C,{ActivityChain:()=>u,AssetCategory:()=>d,AuctionType:()=>m,AuctionTypes:()=>l,Chain:()=>H,CollectionModule:()=>Y,CollectionStatsOrderBy:()=>h,CollectionStatsSelectFields:()=>g,CollectionsFieldsToSelect:()=>s,CollectionsOrderBy:()=>r,CommonModule:()=>et,DropsOderBy:()=>a,EventUserRolePermission:()=>b,EventUserRoles:()=>W,FieldsToSelect:()=>e,GlobalOfferFieldsToSelect:()=>c,GlobalOfferOrderBy:()=>o,IEventCategory:()=>k,IssuingType:()=>y,Marketplace:()=>t,NFTModule:()=>Z,NftActivityType:()=>p,OfferType:()=>S,OrderByTradingActivity:()=>f,PoolType:()=>w,SearchOrderBy:()=>i,SelectFieldsTradingActivity:()=>T,StakingModule:()=>tt,StakingStatus:()=>E,SuggestOrderBy:()=>n,Type:()=>A,UserModule:()=>Q,XOXNOClient:()=>G,eventCategories:()=>q,eventPermissions:()=>F,eventRoles:()=>L,eventSubCategories:()=>P,getEventCategories:()=>x,getEventSubCategories:()=>M,isValidCollectionTicker:()=>z,isValidNftIdentifier:()=>K}),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"}(n||(n={})),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"}(r||(r={})),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"}(o||(o={})),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"}(c||(c={})),function(t){t.FixedPrice="FixedPrice",t.Auctions="Auctions",t.All="All",t.AllListed="AllListed"}(l||(l={})),function(t){t.ALL="all",t.Trade="trade",t.P2P="p2p",t.Staking="staking",t.Minting="minting"}(d||(d={})),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"}(h||(h={})),function(t){t.MVX="MVX",t.SUI="SUI"}(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.Staked="staked",t.Unbounding="unstaked",t.Available="available"}(E||(E={})),function(t){t.Received="received",t.Placed="placed"}(S||(S={})),function(t){t.NonFungibleESDT="NonFungibleESDT"}(A||(A={})),function(t){t.FESTIVAL="festival",t.CONFERENCE="conference",t.NETWORKING="networking",t.MEETUP="meetup",t.WEB3="web3",t.ENTERTAINMENT="entertainment"}(k||(k={}));const q=Object.values(k);var N,I,D,O,_,R;!function(t){t.MUSIC="music",t.ARTS_AND_CULTURE="arts-and-culture",t.FOOD_AND_DRINK="food-and-drink",t.LIFESTYLE_AND_WELLNESS="lifestyle-and-wellness",t.LOCAL_AND_COMMUNITY="local-and-community"}(N||(N={})),function(t){t.TECHNOLOGY_AND_INNOVATION="technology-and-innovation",t.BUSINESS_AND_FINANCE="business-and-finance",t.HEALTHCARE_AND_SCIENCE="healthcare-and-science",t.EDUCATION_AND_LEARNING="education-and-learning",t.MARKETING_AND_MEDIA="marketing-and-media"}(I||(I={})),function(t){t.INDUSTRY_SPECIFIC="industry-specific",t.CAREER_DEVELOPMENT="career-development",t.INVESTOR_AND_STARTUPS="investor-and-startups",t.SOCIAL_IMPACT="social-impact",t.PERSONAL_DEVELOPMENT="personal-development"}(D||(D={})),function(t){t.HOBBIES_AND_INTERESTS="hobbies-and-interests",t.PROFESSIONAL_GROUPS="professional-groups",t.SOCIAL_GATHERING="social-gathering",t.EDUCATION_AND_SKILLS="education-and-skills",t.FAMILY_AND_KIDS="family-and-kids"}(O||(O={})),function(t){t.BLOCKCHAIN_AND_CRYPTOCURRENCY="blockchain-and-cryptocurrency",t.METAVERSE_AND_VR="metaverse-and-vr",t.DEFI_AND_FINANCE="defi-and-finance",t.DAO_AND_GOVERNANCE="dao-and-governance",t.WEB3_STARTUPS="web3-startups"}(_||(_={})),function(t){t.LIVE_MUSIC="live-music",t.COMEDY_SHOWS="comedy-shows",t.THEATRE_AND_PERFORMANCE="theatre-and-performance",t.MOVIES="movies",t.NIGHTLIFE_AND_CLUBBING="nightlife-and-clubbing"}(R||(R={}));const P={festival:Object.values(N),conference:Object.values(I),networking:Object.values(D),meetup:Object.values(O),web3:Object.values(_),entertainment:Object.values(R)};async function x(){return q}async function M(t){return P[t]}var W,b;!function(t){t.EVENT_MANAGER="event-manager",t.CHECK_IN_MANAGER="check-in-manager",t.EVENT_READER="event-reader"}(W||(W={})),function(t){t.EVENT_READER_VIEW="event-reader-view",t.EVENT_MANAGER_EDIT_PAGE="event-manager-edit-page",t.EVENT_MANAGER_CREATE_TICKET="event-manager-create-ticket",t.EVENT_MANAGER_EDIT_TICKET="event-manager-edit-ticket",t.EVENT_MANAGER_DELETE_TICKET="event-manager-delete-ticket",t.EVENT_MANAGER_EDIT_GUEST="event-manager-edit-guest",t.EVENT_MANAGER_CREATE_STAGE="event-manager-create-stage",t.EVENT_MANAGER_EDIT_STAGE="event-manager-edit-stage"}(b||(b={}));const L=Object.values(W),F=Object.values(b),V="https://api.xoxno.com",$="erd1qqqqqqqqqqqqqpgq705fxpfrjne0tl3ece0rrspykq88mynn4kxs2cg43s",B="erd1qqqqqqqqqqqqqpgqd9rvv2n378e27jcts8vfwynpx0gfl5ufz6hqhfy0u0",U="erd1qqqqqqqqqqqqqpgq8xwzu82v8ex3h4ayl5lsvxqxnhecpwyvwe0sf2qj4e";var H;!function(t){t.MAINNET="1",t.DEVNET="D"}(H||(H={}));class G{static instance;apiUrl;apiKey;chain;config;constructor(t=V,e="",i){this.apiUrl=t,this.apiKey=e,this.chain=i,this.config=i==H.MAINNET?{mediaUrl:"https://media.xoxno.com",gatewayUrl:"https://gateway.xoxno.com",XO_SC:"erd1qqqqqqqqqqqqqpgq6wegs2xkypfpync8mn2sa5cmpqjlvrhwz5nqgepyg8",FM_SC:$,DR_SC:B,KG_SC:U,Staking_SC:"erd1qqqqqqqqqqqqqpgqvpkd3g3uwludduv3797j54qt6c888wa59w2shntt6z",Manager_SC:"erd1qqqqqqqqqqqqqpgqg9fa0dmpn8fu3fnleeqn5zt8rl8mdqjkys5s2gtas7",P2P_SC:"erd1qqqqqqqqqqqqqpgq47y8hnct68v6asjv6gxem6h9rumn9frzah0skhxxt6"}:{mediaUrl:"https://devnet-media.xoxno.com",gatewayUrl:"https://devnet-gateway.xoxno.com",XO_SC:"erd1qqqqqqqqqqqqqpgql0dnz6n5hpuw8cptlt00khd0nn4ja8eadsfq2xrqw4",FM_SC:$,DR_SC:B,KG_SC:U,Staking_SC:"erd1qqqqqqqqqqqqqpgqsc5hnewwpep8qq0d7kjjzrquapuucrygah0s85zres",Manager_SC:"erd1qqqqqqqqqqqqqpgqluclyhfsa2uw7q9cjwd8knk989hg57u8ah0slq2nlr",P2P_SC:"erd1qqqqqqqqqqqqqpgqfja7ukpngrun78ueq583l0vd6aj4ekhrah0sa9wyrv"}}static init({apiUrl:t=V,apiKey:e="",chain:i=H.MAINNET}={}){if(null==G.instance||null==G.instance){if(i==H.DEVNET)return G.instance=new G(t??"https://devnet-api.xoxno.com",e,i),G.instance;G.instance=new G(t,e,i)}return G.instance}static getInstance(){if(null==G.instance||null==G.instance)throw new Error("XOXNOClient is not initialized");return G.instance}fetchWithTimeout=async(t,e={})=>{const i=e?.headers?.Authorization,a="Bearer undefined"===i?void 0:i,n={"Accept-Encoding":"gzip,deflate,br",Referer:"https://xoxno.sdk","User-Agent":"XOXNO/1.0/SDK",..."POST"===e.method?{"Content-Type":"application/json"}:{},...a?{Authorization:a}:{}},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=await fetch(r,{...e,cache:"no-store",...Object.keys(n).length?{headers:n}:{},method:e.method??"GET"});if(!o.ok){const e=await o.text();let i;try{i=JSON.parse(e)}catch(t){i={message:e}}throw new Error(`${t}: ${o.status};${o.statusText};${i.message}`)}return o.json()}}const j=async(t,e)=>{if(t.top&&t.top>100)throw new Error("Top cannot be greater than 100");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,chain:t.chain,from:t.from,to:t.to,activityAddress:t.wallets||void 0,source:t.source||void 0,activityType:t.activityType||void 0,eventIdentifier:t.eventIdentifier||void 0,range:i},strictSelect:t.strictSelect,includeCount:t.includeCount||!1,orderBy:t.orderBy,select:t.select,top:t.top||35,skip:t.skip||0},n=await e.fetchWithTimeout("/activity/query",{params:{filter:JSON.stringify(a)},next:{tags:["getActivity"]}});return{...n,getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)},empty:0===n.resources.length}},z=t=>{const e=t.length>=4&&t.length<=40||/^0x[a-fA-F0-9]{1,64}::[a-zA-Z0-9_]+::[a-zA-Z0-9_]+(<.+>)?$/.test(decodeURIComponent(t)),i=/^[A-Z0-9]{3,10}-[a-z0-9]{6}$/.test(t);return e||i},K=t=>{const e=/^0x[a-fA-F0-9]{1,64}$/.test(t),i=/^[A-Za-z0-9]{3,10}-[A-Za-z0-9]{6}-[A-Za-z0-9]{2,7}(?:-\d+(?:-[A-Za-z0-9]+)?)?$/.test(t);return e||i};class Y{api;constructor(){this.api=G.getInstance()}getCollectionProfile=async t=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/profile`,{next:{tags:["getCollectionProfile"]}})};getDailyTrending=async()=>await this.api.fetchWithTimeout("/nfts/getDailyTrending",{next:{tags:["getDailyTrending"]}});getCollectionFloorPrice=async(t,e="EGLD")=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/floor-price`,{next:{tags:["getCollectionFloorPrice"]},params:{token:e}})};getCollectionAttributes=async t=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/attributes`,{next:{tags:["getCollectionAttributes"]}})};getNFTs=async t=>{if(t?.collections?.forEach((t=>{if(!z(t))throw new Error("Invalid collection ticker: "+t)})),t.top&&t.top>100)throw new Error("Top cannot be greater than 100");const e=[];t.priceRange&&e.push({...t.priceRange,field:t.auctionType==l.Auctions?"saleInfo.currentBidShort":"saleInfo.minBidShort"}),t.rankRange&&e.push({...t.rankRange,field:"metadata.rarity.rank"});const i={name:t.name,filters:{dataType:t.dataType??["nft"],activeAuction:t.activeAuctions,identifier:t.identifiers,collection:t.collections??[],chain:t.chain??[],onSale:t.onlyOnSale,saleInfo:{seller:t.listedBy||[],marketplace:t.listedOnlyOn||void 0,paymentToken:t.listedInToken||[],auctionType:t.auctionType==l.Auctions?["NftBid","SftAll"]:t.auctionType==l.FixedPrice?["Nft","SftOnePerPayment"]:t.auctionType==l.AllListed?["NftBid","SftAll","Nft","SftOnePerPayment"]:void 0},owner:t.ownedBy||[],verifiedOnly:t.onlyVerified||!1,metadata:{attributes:t.attributes||void 0},range:e,nonce:t.nonces||void 0,cp_staked:t.isStaked??void 0},applyNftExtraDetails:t.applyNftExtraDetails,orderBy:t.orderBy||[],select:t.onlySelectFields||[],strictSelect:t.strictSelect||!1,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"]}}),getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)}}};getSearchNFTs=async t=>{if(t?.collections?.forEach((t=>{if(!z(t))throw new Error("Invalid collection ticker: "+t)})),t.top&&t.top>100)throw new Error("Top cannot be greater than 100");const e=[];t.priceRange&&e.push({...t.priceRange,field:t.auctionType==l.Auctions?"saleInfo.currentBidShort":"saleInfo.minBidShort"}),t.rankRange&&e.push({...t.rankRange,field:"metadata.rarity.rank"});const i={name:t.name,filters:{dataType:t.dataType??["nft"],activeAuction:t.activeAuctions,collection:t.collections??[],chain:t.chain??[],onSale:t.onlyOnSale,saleInfo:{seller:t.listedBy||[],marketplace:t.listedOnlyOn||void 0,paymentToken:t.listedInToken||[],auctionType:t.auctionType==l.Auctions?["NftBid","SftAll"]:t.auctionType==l.FixedPrice?["Nft","SftOnePerPayment"]:t.auctionType==l.AllListed?["NftBid","SftAll","Nft","SftOnePerPayment"]:void 0},owner:t.ownedBy||[],verifiedOnly:t.onlyVerified||!1,metadata:{attributes:t.attributes||void 0},range:e,nonce:t.nonces||void 0,cp_staked:t.isStaked??void 0},applyNftExtraDetails:t.applyNftExtraDetails,orderBy:t.orderBy||[],select:t.onlySelectFields||[],strictSelect:t.strictSelect||!1,includeCount:t.includeCount||!1,top:t.top||35,skip:t.skip||0};return{...await this.api.fetchWithTimeout("/nft/search/query",{params:{filter:JSON.stringify(i)},next:{tags:["getCollectionNFTs"]}}),getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)}}};suggestCollections=async t=>{if(t.top&&t.top>100)throw new Error("Top cannot be greater than 100");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"]}})};collectionListingsAnalytics=async t=>await this.api.fetchWithTimeout(`/collection/${t}/listings`,{next:{tags:["collection/${ticker}/listings"]}});getTradingActivity=async t=>await j(t,this.api);getOffers=async t=>await this.api.fetchWithTimeout("/nft/offer/query",{params:{filter:JSON.stringify(t)},next:{tags:["/nft/offer/query"]}});getCollections=async t=>{if(t?.top&&t.top>100)throw new Error("Top cannot be greater than 100");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},...t?.chain&&t.chain.length>0&&{chain:t.chain}},orderBy:[t?.orderBy||"statistics.tradeData.weekEgldVolume desc"]},i=await this.api.fetchWithTimeout("/collection/query",{params:{filter:JSON.stringify(e)},next:{tags:["getCollections"]}});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>100)throw new Error("Top cannot be greater than 100");const e={skip:t?.skip||0,top:t?.top||25,select:t?.onlySelectFields||[],filters:{collection:t?.collections||[],withAttributes:t?.withAttributes,isActive:t?.onlyActive,offerId:t?.offerIds,owner:t?.ownedBy,marketplace:t?.listedOnlyOn,range:t?.priceRange?{...t.priceRange,type:"priceShort"}:void 0,attributes:t?.attributes},orderBy:t?.orderBy||[o.PriceHighToLow]},i=await this.api.fetchWithTimeout("/collection/global-offer/query",{params:{filter:JSON.stringify(e)},next:{tags:["getGlobalOffers"]}});return{...i,getNextPagePayload:{...t,skip:(t?.top||25)+i.lastSkip}}};getCollectionVolume=async(t,e,i,a)=>{if(!z(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"]}})};getMarketplaceVolume=async(t,e,i)=>await this.api.fetchWithTimeout(`/analytics/volume?startTime=${t}&endTime=${e}&bin=${i}`,{next:{tags:["getMarketplaceVolume"]}});getCollectionOwners=async t=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/holders`,{next:{tags:["getCollectionOwners"]}})};getExportOwners=async t=>{if(!z(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>100)throw new Error("Top cannot be greater than 100");return{...await this.api.fetchWithTimeout("/collection/stats/query",{params:{filter:JSON.stringify(t)},next:{tags:["collectionStatistics"]}}),getNextPagePayload:{...t,skip:t.skip+t.top}}};getCollectionStats=async t=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/stats`,{next:{tags:["collectionStatistics"]}})};getAwaitEmpty=async t=>new Promise((e=>{setTimeout((()=>{e(!0)}),t)}));getCollectionMintInfo=async({ticker:t,extra:e})=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/drop-info`,{next:{tags:[`/collection/${t}/drop-info`]},...e})};getCollectionRanks=async({ticker:t,extra:e})=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/ranks`,{next:{tags:[`/collection/${t}/ranks`]},...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`]},...i});getCollectionGraphData=async(t,e,i,a)=>{if(!z(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`]}})};getPinnedCollections=async t=>await this.api.fetchWithTimeout("/collection/pinned"+(t?`?chain=${t}`:""),{next:{tags:["/collection/pinned"]}});getPinnedDrops=async t=>await this.api.fetchWithTimeout("/collection/pinned-drops"+(t?`?chain=${t}`:""),{next:{tags:["/collection/pinned-drops"]}});getSearchDrops=async t=>{if(t?.collections?.forEach((t=>{if(!z(t))throw new Error("Invalid collection ticker: "+t)})),t.top&&t.top>100)throw new Error("Top cannot be greater than 100");const e=[];t.timeRange&&e.push({...t.timeRange,field:"startTime"});const i={name:t.name,filters:{collection:t.collections??[],verifiedOnly:t.onlyVerified||!1,mintToken:t.listedInToken||void 0,range:e,chain:t.chain??[]},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/search",{params:{filter:JSON.stringify(i)},next:{tags:["/collection/drops/search"]}}),getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)}}};getDrops=async t=>{if(t?.collections?.forEach((t=>{if(!z(t))throw new Error("Invalid collection ticker: "+t)})),t.top&&t.top>100)throw new Error("Top cannot be greater than 100");const e=[];t.timeRange&&e.push({...t.timeRange,field:"startTime"});const i={name:t.name,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"]}}),getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)}}};getCollectionStakingSummary=async({collection:t,extra:e})=>{if(!z(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(!z(t))throw new Error("Invalid collection ticker: "+t)})),await this.api.fetchWithTimeout("/collection/floor-price",{params:{collection:t.join(",")}}))}const J=t=>{let e=t.toString(16);return e.length%2!=0&&(e="0"+e),e},X=t=>!!t&&(t.includes("erd1")&&62===t.length||/^0x[a-fA-F0-9]{64}$/.test(t));class Z{api;constructor(){this.api=G.getInstance()}getNFTByIdentifier=async(t,e)=>{if(!K(t))throw new Error("Invalid identifier: "+t);return await this.api.fetchWithTimeout(`/nft/${t}`,{...e})};getNFTsOffers=async(t,e=0,i=25)=>{if(!K(t))throw new Error("Invalid identifier: "+t);return await this.api.fetchWithTimeout(`/nft/${t}/offers?skip=${e}&top=${i}`,{next:{tags:["getNFTsOffers"]}})};getNFTByCollectionAndNonce=async(t,e)=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);const i=await this.api.fetchWithTimeout(`/${((t,e)=>[t,J(e)].join("-"))(t,e)}`);return i};getPinnedNFTs=async t=>await this.api.fetchWithTimeout("/nft/pinned"+(t?`?chain=${t}`:""),{next:{tags:["/nft/pinned"]}});getNFTByCollectionAndNonceHex=async(t,e)=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);return e.length%2!=0&&(e="0"+e),await this.api.fetchWithTimeout(`/${[t,e].join("-")}`)};getTradingActivity=async t=>await j(t,this.api)}class Q{api;collection;constructor(){this.api=G.getInstance(),this.collection=new Y}getUserProfile=async t=>{if(!X(t))throw new Error("Invalid address:"+t);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(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/network-account`)};getUserTokenInventory=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/token-inventory`)};getUserSummaryInventory=async(t,e=!0)=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/inventory-summary?activeAuction=${e}`)};getUserNFTs=async t=>await this.collection.getNFTs(t);getUserOffers=async t=>{if(!X(t.address))throw new Error("Invalid address:"+t.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>100)throw new Error("Top cannot be greater than 100");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"]}})};getTradingActivity=async t=>await j(t,this.api);getUserCreatorProfile=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/creator/profile`)};getCreatorListings=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/creator/listing`)};getCreatorEvents=async(t,e)=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/creator/events`,{...e})};getUserStakingSummary=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/summary`)};getUserStakingAailable=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/available-pools`)};getUserCreatorInfo=async(t,e)=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/creator/details`,{...e})};getUserCollectionStaking=async(t,e)=>{if(!X(t))throw new Error("Invalid address:"+t);if(!z(e))throw new Error("Invalid collection ticker: "+e);return await this.api.fetchWithTimeout(`/user/${t}/staking/collection/${e}`)};getUserPoolStaking=async(t,e,i)=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/pool/${e}/nfts?status=${i}`)};getOwnedPoolsByAddress=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/owned-pools`)};getUserAnalyticsSummary=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/analytics/volume`)};getUserFavoriteNFTs=async(t,e,i)=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/favorite/nfts`,{params:{top:e,skip:i}})};getUserFavoriteCollectionTickers=async t=>{if(!X(t))throw new Error("Invalid address:"+t);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,orderDirection:a})=>{if(t&&t>35)throw new Error("Top cannot be greater than 100");return await this.api.fetchWithTimeout("/user/stats",{params:{top:t,skip:e,orderBy:i,orderDirection:a??"desc"},next:{tags:["/user/stats"]}})};getStakingCreatorInfo=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/creator`,{next:{tags:[`/user/${t}/staking/creator`]}})};getUsersDrop=async({top:t,skip:e,address:i})=>{if(t&&t>35)throw new Error("Top cannot be greater than 100");if(i&&!X(i))throw new Error("Invalid address:"+i);return await this.api.fetchWithTimeout("/user/xoxno-drop",{params:{top:t,skip:e,...i?{address:i}:{}},next:{tags:["/user/xoxno-drop"]}})};getUserOwnerCollections=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/owned-collections`)};getRoyaltiesSharesCreator=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/launchpad/${t}/shareholders/royalties`)};getMintSharesCreator=async(t,e)=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/launchpad/${t}/shareholders/collection/${e}`)}}class tt{api;constructor(){this.api=G.getInstance()}getPoolDetails=async t=>await this.api.fetchWithTimeout(`/pool/${t}/profile`)}class et{api;constructor(){this.api=G.getInstance()}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={};return e&&(i={identifier:e.join(",")}),t&&(i={...i,category:t.join(",")}),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"]}});getAnalyticsOverview=async()=>await this.api.fetchWithTimeout("/analytics/overview",{next:{tags:["/analytics/overview"]}});suggestResults=async t=>{if(t.top&&t.top>100)throw new Error("Top cannot be greater than 100");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"]}})};getExploreStaking=async()=>await this.api.fetchWithTimeout("/collection/staking/explore",{next:{tags:["/collection/staking/explore"]}})}module.exports=C})();
package/dist/index.esm.js CHANGED
@@ -1 +1 @@
1
- var t,e,i,a,n,r,o,s,c,l,d,g,h,u,p,f,T,m,y,w,E,S,A,k,v={d:(t,e)=>{for(var i in e)v.o(e,i)&&!v.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},C={};v.d(C,{TR:()=>u,$C:()=>d,Yo:()=>m,LU:()=>l,sW:()=>H,X$:()=>K,JA:()=>h,he:()=>g,cO:()=>s,t7:()=>r,MD:()=>et,Gq:()=>a,vY:()=>M,Pz:()=>L,h4:()=>e,wT:()=>c,JM:()=>o,Ow:()=>k,Vx:()=>y,O8:()=>t,s0:()=>Z,o:()=>p,p4:()=>S,AQ:()=>f,J1:()=>w,g6:()=>i,cB:()=>T,Gt:()=>tt,iE:()=>E,I_:()=>n,ZU:()=>A,Us:()=>Q,GW:()=>G,L_:()=>q,t8:()=>F,Gm:()=>b,tN:()=>P,br:()=>x,Ld:()=>W,PG:()=>z,y_:()=>J}),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"}(n||(n={})),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"}(r||(r={})),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"}(o||(o={})),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"}(c||(c={})),function(t){t.FixedPrice="FixedPrice",t.Auctions="Auctions",t.All="All",t.AllListed="AllListed"}(l||(l={})),function(t){t.ALL="all",t.Trade="trade",t.P2P="p2p",t.Staking="staking",t.Minting="minting"}(d||(d={})),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"}(h||(h={})),function(t){t.MVX="MVX",t.SUI="SUI"}(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.Staked="staked",t.Unbounding="unstaked",t.Available="available"}(E||(E={})),function(t){t.Received="received",t.Placed="placed"}(S||(S={})),function(t){t.NonFungibleESDT="NonFungibleESDT"}(A||(A={})),function(t){t.FESTIVAL="festival",t.CONFERENCE="conference",t.NETWORKING="networking",t.MEETUP="meetup",t.WEB3="web3",t.ENTERTAINMENT="entertainment"}(k||(k={}));const q=Object.values(k);var N,I,D,O,_,R;!function(t){t.MUSIC="music",t.ARTS_AND_CULTURE="arts-and-culture",t.FOOD_AND_DRINK="food-and-drink",t.LIFESTYLE_AND_WELLNESS="lifestyle-and-wellness",t.LOCAL_AND_COMMUNITY="local-and-community"}(N||(N={})),function(t){t.TECHNOLOGY_AND_INNOVATION="technology-and-innovation",t.BUSINESS_AND_FINANCE="business-and-finance",t.HEALTHCARE_AND_SCIENCE="healthcare-and-science",t.EDUCATION_AND_LEARNING="education-and-learning",t.MARKETING_AND_MEDIA="marketing-and-media"}(I||(I={})),function(t){t.INDUSTRY_SPECIFIC="industry-specific",t.CAREER_DEVELOPMENT="career-development",t.INVESTOR_AND_STARTUPS="investor-and-startups",t.SOCIAL_IMPACT="social-impact",t.PERSONAL_DEVELOPMENT="personal-development"}(D||(D={})),function(t){t.HOBBIES_AND_INTERESTS="hobbies-and-interests",t.PROFESSIONAL_GROUPS="professional-groups",t.SOCIAL_GATHERING="social-gathering",t.EDUCATION_AND_SKILLS="education-and-skills",t.FAMILY_AND_KIDS="family-and-kids"}(O||(O={})),function(t){t.BLOCKCHAIN_AND_CRYPTOCURRENCY="blockchain-and-cryptocurrency",t.METAVERSE_AND_VR="metaverse-and-vr",t.DEFI_AND_FINANCE="defi-and-finance",t.DAO_AND_GOVERNANCE="dao-and-governance",t.WEB3_STARTUPS="web3-startups"}(_||(_={})),function(t){t.LIVE_MUSIC="live-music",t.COMEDY_SHOWS="comedy-shows",t.THEATRE_AND_PERFORMANCE="theatre-and-performance",t.MOVIES="movies",t.NIGHTLIFE_AND_CLUBBING="nightlife-and-clubbing"}(R||(R={}));const P={festival:Object.values(N),conference:Object.values(I),networking:Object.values(D),meetup:Object.values(O),web3:Object.values(_),entertainment:Object.values(R)};async function x(){return q}async function W(t){return P[t]}var L,M;!function(t){t.EVENT_MANAGER="event-manager",t.CHECK_IN_MANAGER="check-in-manager",t.EVENT_READER="event-reader"}(L||(L={})),function(t){t.EVENT_READER_VIEW="event-reader-view",t.EVENT_MANAGER_EDIT_PAGE="event-manager-edit-page",t.EVENT_MANAGER_CREATE_TICKET="event-manager-create-ticket",t.EVENT_MANAGER_EDIT_TICKET="event-manager-edit-ticket",t.EVENT_MANAGER_DELETE_TICKET="event-manager-delete-ticket",t.EVENT_MANAGER_EDIT_GUEST="event-manager-edit-guest",t.EVENT_MANAGER_CREATE_STAGE="event-manager-create-stage",t.EVENT_MANAGER_EDIT_STAGE="event-manager-edit-stage"}(M||(M={}));const b=Object.values(L),F=Object.values(M),V="https://api.xoxno.com",$="erd1qqqqqqqqqqqqqpgq705fxpfrjne0tl3ece0rrspykq88mynn4kxs2cg43s",U="erd1qqqqqqqqqqqqqpgqd9rvv2n378e27jcts8vfwynpx0gfl5ufz6hqhfy0u0",B="erd1qqqqqqqqqqqqqpgq8xwzu82v8ex3h4ayl5lsvxqxnhecpwyvwe0sf2qj4e";var H;!function(t){t.MAINNET="1",t.DEVNET="D"}(H||(H={}));class G{static instance;apiUrl;apiKey;chain;config;constructor(t=V,e="",i){this.apiUrl=t,this.apiKey=e,this.chain=i,this.config=i==H.MAINNET?{mediaUrl:"https://media.xoxno.com",gatewayUrl:"https://gateway.xoxno.com",XO_SC:"erd1qqqqqqqqqqqqqpgq6wegs2xkypfpync8mn2sa5cmpqjlvrhwz5nqgepyg8",FM_SC:$,DR_SC:U,KG_SC:B,Staking_SC:"erd1qqqqqqqqqqqqqpgqvpkd3g3uwludduv3797j54qt6c888wa59w2shntt6z",Manager_SC:"erd1qqqqqqqqqqqqqpgqg9fa0dmpn8fu3fnleeqn5zt8rl8mdqjkys5s2gtas7",P2P_SC:"erd1qqqqqqqqqqqqqpgq47y8hnct68v6asjv6gxem6h9rumn9frzah0skhxxt6"}:{mediaUrl:"https://devnet-media.xoxno.com",gatewayUrl:"https://devnet-gateway.xoxno.com",XO_SC:"erd1qqqqqqqqqqqqqpgql0dnz6n5hpuw8cptlt00khd0nn4ja8eadsfq2xrqw4",FM_SC:$,DR_SC:U,KG_SC:B,Staking_SC:"erd1qqqqqqqqqqqqqpgqsc5hnewwpep8qq0d7kjjzrquapuucrygah0s85zres",Manager_SC:"erd1qqqqqqqqqqqqqpgqluclyhfsa2uw7q9cjwd8knk989hg57u8ah0slq2nlr",P2P_SC:"erd1qqqqqqqqqqqqqpgqfja7ukpngrun78ueq583l0vd6aj4ekhrah0sa9wyrv"}}static init({apiUrl:t=V,apiKey:e="",chain:i=H.MAINNET}={}){if(null==G.instance||null==G.instance){if(i==H.DEVNET)return G.instance=new G(t??"https://devnet-api.xoxno.com",e,i),G.instance;G.instance=new G(t,e,i)}return G.instance}static getInstance(){if(null==G.instance||null==G.instance)throw new Error("XOXNOClient is not initialized");return G.instance}fetchWithTimeout=async(t,e={})=>{const i=e?.headers?.Authorization,a="Bearer undefined"===i?void 0:i,n={"Accept-Encoding":"gzip,deflate,br",Referer:"https://xoxno.sdk","User-Agent":"XOXNO/1.0/SDK",..."POST"===e.method?{"Content-Type":"application/json"}:{},...a?{Authorization:a}:{}},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=await fetch(r,{...e,cache:"no-store",...Object.keys(n).length?{headers:n}:{},method:e.method??"GET"});if(!o.ok){const e=await o.text();let i;try{i=JSON.parse(e)}catch(t){i={message:e}}throw new Error(`${t}: ${o.status};${o.statusText};${i.message}`)}return o.json()}}const j=async(t,e)=>{if(t.top&&t.top>100)throw new Error("Top cannot be greater than 100");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,eventIdentifier:t.eventIdentifier||void 0,range:i},strictSelect:t.strictSelect,includeCount:t.includeCount||!1,orderBy:t.orderBy,select:t.select,top:t.top||35,skip:t.skip||0},n=await e.fetchWithTimeout("/activity/query",{params:{filter:JSON.stringify(a)},next:{tags:["getActivity"]}});return{...n,getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)},empty:0===n.resources.length}},z=t=>{const e=t.length>=4&&t.length<=40||/^0x[a-fA-F0-9]{1,64}::[a-zA-Z0-9_]+::[a-zA-Z0-9_]+(<.+>)?$/.test(decodeURIComponent(t)),i=/^[A-Z0-9]{3,10}-[a-z0-9]{6}$/.test(t);return e||i},J=t=>{const e=/^0x[a-fA-F0-9]{1,64}$/.test(t),i=/^[A-Za-z0-9]{3,10}-[A-Za-z0-9]{6}-[A-Za-z0-9]{2,7}(?:-\d+(?:-[A-Za-z0-9]+)?)?$/.test(t);return e||i};class K{api;constructor(){this.api=G.getInstance()}getCollectionProfile=async t=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/profile`,{next:{tags:["getCollectionProfile"]}})};getDailyTrending=async()=>await this.api.fetchWithTimeout("/nfts/getDailyTrending",{next:{tags:["getDailyTrending"]}});getCollectionFloorPrice=async(t,e="EGLD")=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/floor-price`,{next:{tags:["getCollectionFloorPrice"]},params:{token:e}})};getCollectionAttributes=async t=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/attributes`,{next:{tags:["getCollectionAttributes"]}})};getNFTs=async t=>{if(t?.collections?.forEach((t=>{if(!z(t))throw new Error("Invalid collection ticker: "+t)})),t.top&&t.top>100)throw new Error("Top cannot be greater than 100");const e=[];t.priceRange&&e.push({...t.priceRange,field:t.auctionType==l.Auctions?"saleInfo.currentBidShort":"saleInfo.minBidShort"}),t.rankRange&&e.push({...t.rankRange,field:"metadata.rarity.rank"});const i={name:t.name,filters:{dataType:t.dataType??["nft"],activeAuction:t.activeAuctions,identifier:t.identifiers,collection:t.collections??[],onSale:t.onlyOnSale,saleInfo:{seller:t.listedBy||[],marketplace:t.listedOnlyOn||void 0,paymentToken:t.listedInToken||[],auctionType:t.auctionType==l.Auctions?["NftBid","SftAll"]:t.auctionType==l.FixedPrice?["Nft","SftOnePerPayment"]:t.auctionType==l.AllListed?["NftBid","SftAll","Nft","SftOnePerPayment"]:void 0},owner:t.ownedBy||[],verifiedOnly:t.onlyVerified||!1,metadata:{attributes:t.attributes||void 0},range:e,nonce:t.nonces||void 0,cp_staked:t.isStaked??void 0},applyNftExtraDetails:t.applyNftExtraDetails,orderBy:t.orderBy||[],select:t.onlySelectFields||[],strictSelect:t.strictSelect||!1,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"]}}),getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)}}};getSearchNFTs=async t=>{if(t?.collections?.forEach((t=>{if(!z(t))throw new Error("Invalid collection ticker: "+t)})),t.top&&t.top>100)throw new Error("Top cannot be greater than 100");const e=[];t.priceRange&&e.push({...t.priceRange,field:t.auctionType==l.Auctions?"saleInfo.currentBidShort":"saleInfo.minBidShort"}),t.rankRange&&e.push({...t.rankRange,field:"metadata.rarity.rank"});const i={name:t.name,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==l.Auctions?["NftBid","SftAll"]:t.auctionType==l.FixedPrice?["Nft","SftOnePerPayment"]:t.auctionType==l.AllListed?["NftBid","SftAll","Nft","SftOnePerPayment"]:void 0},owner:t.ownedBy||[],verifiedOnly:t.onlyVerified||!1,metadata:{attributes:t.attributes||void 0},range:e,nonce:t.nonces||void 0,cp_staked:t.isStaked??void 0},applyNftExtraDetails:t.applyNftExtraDetails,orderBy:t.orderBy||[],select:t.onlySelectFields||[],strictSelect:t.strictSelect||!1,includeCount:t.includeCount||!1,top:t.top||35,skip:t.skip||0};return{...await this.api.fetchWithTimeout("/nft/search/query",{params:{filter:JSON.stringify(i)},next:{tags:["getCollectionNFTs"]}}),getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)}}};suggestCollections=async t=>{if(t.top&&t.top>100)throw new Error("Top cannot be greater than 100");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"]}})};collectionListingsAnalytics=async t=>await this.api.fetchWithTimeout(`/collection/${t}/listings`,{next:{tags:["collection/${ticker}/listings"]}});getTradingActivity=async t=>await j(t,this.api);getOffers=async t=>await this.api.fetchWithTimeout("/nft/offer/query",{params:{filter:JSON.stringify(t)},next:{tags:["/nft/offer/query"]}});getCollections=async t=>{if(t?.top&&t.top>100)throw new Error("Top cannot be greater than 100");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"]}});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>100)throw new Error("Top cannot be greater than 100");const e={skip:t?.skip||0,top:t?.top||25,select:t?.onlySelectFields||[],filters:{collection:t?.collections||[],withAttributes:t?.withAttributes,isActive:t?.onlyActive,offerId:t?.offerIds,owner:t?.ownedBy,marketplace:t?.listedOnlyOn,range:t?.priceRange?{...t.priceRange,type:"priceShort"}:void 0,attributes:t?.attributes},orderBy:t?.orderBy||[o.PriceHighToLow]},i=await this.api.fetchWithTimeout("/collection/global-offer/query",{params:{filter:JSON.stringify(e)},next:{tags:["getGlobalOffers"]}});return{...i,getNextPagePayload:{...t,skip:(t?.top||25)+i.lastSkip}}};getCollectionVolume=async(t,e,i,a)=>{if(!z(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"]}})};getMarketplaceVolume=async(t,e,i)=>await this.api.fetchWithTimeout(`/analytics/volume?startTime=${t}&endTime=${e}&bin=${i}`,{next:{tags:["getMarketplaceVolume"]}});getCollectionOwners=async t=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/holders`,{next:{tags:["getCollectionOwners"]}})};getExportOwners=async t=>{if(!z(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>100)throw new Error("Top cannot be greater than 100");return{...await this.api.fetchWithTimeout("/collection/stats/query",{params:{filter:JSON.stringify(t)},next:{tags:["collectionStatistics"]}}),getNextPagePayload:{...t,skip:t.skip+t.top}}};getCollectionStats=async t=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/stats`,{next:{tags:["collectionStatistics"]}})};getAwaitEmpty=async t=>new Promise((e=>{setTimeout((()=>{e(!0)}),t)}));getCollectionMintInfo=async({ticker:t,extra:e})=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/drop-info`,{next:{tags:[`/collection/${t}/drop-info`]},...e})};getCollectionRanks=async({ticker:t,extra:e})=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/ranks`,{next:{tags:[`/collection/${t}/ranks`]},...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`]},...i});getCollectionGraphData=async(t,e,i,a)=>{if(!z(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`]}})};getPinnedCollections=async t=>await this.api.fetchWithTimeout("/collection/pinned"+(t?`?chain=${t}`:""),{next:{tags:["/collection/pinned"]}});getPinnedDrops=async t=>await this.api.fetchWithTimeout("/collection/pinned-drops"+(t?`?chain=${t}`:""),{next:{tags:["/collection/pinned-drops"]}});getSearchDrops=async t=>{if(t?.collections?.forEach((t=>{if(!z(t))throw new Error("Invalid collection ticker: "+t)})),t.top&&t.top>100)throw new Error("Top cannot be greater than 100");const e=[];t.timeRange&&e.push({...t.timeRange,field:"startTime"});const i={name:t.name,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/search",{params:{filter:JSON.stringify(i)},next:{tags:["/collection/drops/search"]}}),getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)}}};getDrops=async t=>{if(t?.collections?.forEach((t=>{if(!z(t))throw new Error("Invalid collection ticker: "+t)})),t.top&&t.top>100)throw new Error("Top cannot be greater than 100");const e=[];t.timeRange&&e.push({...t.timeRange,field:"startTime"});const i={name:t.name,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"]}}),getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)}}};getCollectionStakingSummary=async({collection:t,extra:e})=>{if(!z(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(!z(t))throw new Error("Invalid collection ticker: "+t)})),await this.api.fetchWithTimeout("/collection/floor-price",{params:{collection:t.join(",")}}))}const Y=t=>{let e=t.toString(16);return e.length%2!=0&&(e="0"+e),e},X=t=>!!t&&(t.includes("erd1")&&62===t.length||/^0x[a-fA-F0-9]{64}$/.test(t));class Z{api;constructor(){this.api=G.getInstance()}getNFTByIdentifier=async(t,e)=>{if(!J(t))throw new Error("Invalid identifier: "+t);return await this.api.fetchWithTimeout(`/nft/${t}`,{...e})};getNFTsOffers=async(t,e=0,i=25)=>{if(!J(t))throw new Error("Invalid identifier: "+t);return await this.api.fetchWithTimeout(`/nft/${t}/offers?skip=${e}&top=${i}`,{next:{tags:["getNFTsOffers"]}})};getNFTByCollectionAndNonce=async(t,e)=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);const i=await this.api.fetchWithTimeout(`/${((t,e)=>[t,Y(e)].join("-"))(t,e)}`);return i};getPinnedNFTs=async t=>await this.api.fetchWithTimeout("/nft/pinned"+(t?`?chain=${t}`:""),{next:{tags:["/nft/pinned"]}});getNFTByCollectionAndNonceHex=async(t,e)=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);return e.length%2!=0&&(e="0"+e),await this.api.fetchWithTimeout(`/${[t,e].join("-")}`)};getTradingActivity=async t=>await j(t,this.api)}class Q{api;collection;constructor(){this.api=G.getInstance(),this.collection=new K}getUserProfile=async t=>{if(!X(t))throw new Error("Invalid address:"+t);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(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/network-account`)};getUserTokenInventory=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/token-inventory`)};getUserSummaryInventory=async(t,e=!0)=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/inventory-summary?activeAuction=${e}`)};getUserNFTs=async t=>await this.collection.getNFTs(t);getUserOffers=async t=>{if(!X(t.address))throw new Error("Invalid address:"+t.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>100)throw new Error("Top cannot be greater than 100");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"]}})};getTradingActivity=async t=>await j(t,this.api);getUserCreatorProfile=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/creator/profile`)};getCreatorListings=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/creator/listing`)};getCreatorEvents=async(t,e)=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/creator/events`,{...e})};getUserStakingSummary=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/summary`)};getUserStakingAailable=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/available-pools`)};getUserCreatorInfo=async(t,e)=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/creator/details`,{...e})};getUserCollectionStaking=async(t,e)=>{if(!X(t))throw new Error("Invalid address:"+t);if(!z(e))throw new Error("Invalid collection ticker: "+e);return await this.api.fetchWithTimeout(`/user/${t}/staking/collection/${e}`)};getUserPoolStaking=async(t,e,i)=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/pool/${e}/nfts?status=${i}`)};getOwnedPoolsByAddress=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/owned-pools`)};getUserAnalyticsSummary=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/analytics/volume`)};getUserFavoriteNFTs=async(t,e,i)=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/favorite/nfts`,{params:{top:e,skip:i}})};getUserFavoriteCollectionTickers=async t=>{if(!X(t))throw new Error("Invalid address:"+t);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,orderDirection:a})=>{if(t&&t>35)throw new Error("Top cannot be greater than 100");return await this.api.fetchWithTimeout("/user/stats",{params:{top:t,skip:e,orderBy:i,orderDirection:a??"desc"},next:{tags:["/user/stats"]}})};getStakingCreatorInfo=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/creator`,{next:{tags:[`/user/${t}/staking/creator`]}})};getUsersDrop=async({top:t,skip:e,address:i})=>{if(t&&t>35)throw new Error("Top cannot be greater than 100");if(i&&!X(i))throw new Error("Invalid address:"+i);return await this.api.fetchWithTimeout("/user/xoxno-drop",{params:{top:t,skip:e,...i?{address:i}:{}},next:{tags:["/user/xoxno-drop"]}})};getUserOwnerCollections=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/owned-collections`)};getRoyaltiesSharesCreator=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/launchpad/${t}/shareholders/royalties`)};getMintSharesCreator=async(t,e)=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/launchpad/${t}/shareholders/collection/${e}`)}}class tt{api;constructor(){this.api=G.getInstance()}getPoolDetails=async t=>await this.api.fetchWithTimeout(`/pool/${t}/profile`)}class et{api;constructor(){this.api=G.getInstance()}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={};return e&&(i={identifier:e.join(",")}),t&&(i={...i,category:t.join(",")}),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"]}});getAnalyticsOverview=async()=>await this.api.fetchWithTimeout("/analytics/overview",{next:{tags:["/analytics/overview"]}});suggestResults=async t=>{if(t.top&&t.top>100)throw new Error("Top cannot be greater than 100");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"]}})};getExploreStaking=async()=>await this.api.fetchWithTimeout("/collection/staking/explore",{next:{tags:["/collection/staking/explore"]}})}var it=C.TR,at=C.$C,nt=C.Yo,rt=C.LU,ot=C.sW,st=C.X$,ct=C.JA,lt=C.he,dt=C.cO,gt=C.t7,ht=C.MD,ut=C.Gq,pt=C.vY,ft=C.Pz,Tt=C.h4,mt=C.wT,yt=C.JM,wt=C.Ow,Et=C.Vx,St=C.O8,At=C.s0,kt=C.o,vt=C.p4,Ct=C.AQ,qt=C.J1,Nt=C.g6,It=C.cB,Dt=C.Gt,Ot=C.iE,_t=C.I_,Rt=C.ZU,Pt=C.Us,xt=C.GW,Wt=C.L_,Lt=C.t8,Mt=C.Gm,bt=C.tN,Ft=C.br,Vt=C.Ld,$t=C.PG,Ut=C.y_;export{it as ActivityChain,at as AssetCategory,nt as AuctionType,rt as AuctionTypes,ot as Chain,st as CollectionModule,ct as CollectionStatsOrderBy,lt as CollectionStatsSelectFields,dt as CollectionsFieldsToSelect,gt as CollectionsOrderBy,ht as CommonModule,ut as DropsOderBy,pt as EventUserRolePermission,ft as EventUserRoles,Tt as FieldsToSelect,mt as GlobalOfferFieldsToSelect,yt as GlobalOfferOrderBy,wt as IEventCategory,Et as IssuingType,St as Marketplace,At as NFTModule,kt as NftActivityType,vt as OfferType,Ct as OrderByTradingActivity,qt as PoolType,Nt as SearchOrderBy,It as SelectFieldsTradingActivity,Dt as StakingModule,Ot as StakingStatus,_t as SuggestOrderBy,Rt as Type,Pt as UserModule,xt as XOXNOClient,Wt as eventCategories,Lt as eventPermissions,Mt as eventRoles,bt as eventSubCategories,Ft as getEventCategories,Vt as getEventSubCategories,$t as isValidCollectionTicker,Ut as isValidNftIdentifier};
1
+ var t,e,i,a,n,r,o,s,c,l,d,h,g,u,p,f,T,m,y,w,E,S,A,k,v={d:(t,e)=>{for(var i in e)v.o(e,i)&&!v.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},C={};v.d(C,{TR:()=>u,$C:()=>d,Yo:()=>m,LU:()=>l,sW:()=>H,X$:()=>K,JA:()=>g,he:()=>h,cO:()=>s,t7:()=>r,MD:()=>et,Gq:()=>a,vY:()=>M,Pz:()=>L,h4:()=>e,wT:()=>c,JM:()=>o,Ow:()=>k,Vx:()=>y,O8:()=>t,s0:()=>Z,o:()=>p,p4:()=>S,AQ:()=>f,J1:()=>w,g6:()=>i,cB:()=>T,Gt:()=>tt,iE:()=>E,I_:()=>n,ZU:()=>A,Us:()=>Q,GW:()=>G,L_:()=>q,t8:()=>F,Gm:()=>b,tN:()=>P,br:()=>x,Ld:()=>W,PG:()=>z,y_:()=>J}),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"}(n||(n={})),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"}(r||(r={})),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"}(o||(o={})),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"}(c||(c={})),function(t){t.FixedPrice="FixedPrice",t.Auctions="Auctions",t.All="All",t.AllListed="AllListed"}(l||(l={})),function(t){t.ALL="all",t.Trade="trade",t.P2P="p2p",t.Staking="staking",t.Minting="minting"}(d||(d={})),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"}(g||(g={})),function(t){t.MVX="MVX",t.SUI="SUI"}(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.Staked="staked",t.Unbounding="unstaked",t.Available="available"}(E||(E={})),function(t){t.Received="received",t.Placed="placed"}(S||(S={})),function(t){t.NonFungibleESDT="NonFungibleESDT"}(A||(A={})),function(t){t.FESTIVAL="festival",t.CONFERENCE="conference",t.NETWORKING="networking",t.MEETUP="meetup",t.WEB3="web3",t.ENTERTAINMENT="entertainment"}(k||(k={}));const q=Object.values(k);var N,I,D,O,_,R;!function(t){t.MUSIC="music",t.ARTS_AND_CULTURE="arts-and-culture",t.FOOD_AND_DRINK="food-and-drink",t.LIFESTYLE_AND_WELLNESS="lifestyle-and-wellness",t.LOCAL_AND_COMMUNITY="local-and-community"}(N||(N={})),function(t){t.TECHNOLOGY_AND_INNOVATION="technology-and-innovation",t.BUSINESS_AND_FINANCE="business-and-finance",t.HEALTHCARE_AND_SCIENCE="healthcare-and-science",t.EDUCATION_AND_LEARNING="education-and-learning",t.MARKETING_AND_MEDIA="marketing-and-media"}(I||(I={})),function(t){t.INDUSTRY_SPECIFIC="industry-specific",t.CAREER_DEVELOPMENT="career-development",t.INVESTOR_AND_STARTUPS="investor-and-startups",t.SOCIAL_IMPACT="social-impact",t.PERSONAL_DEVELOPMENT="personal-development"}(D||(D={})),function(t){t.HOBBIES_AND_INTERESTS="hobbies-and-interests",t.PROFESSIONAL_GROUPS="professional-groups",t.SOCIAL_GATHERING="social-gathering",t.EDUCATION_AND_SKILLS="education-and-skills",t.FAMILY_AND_KIDS="family-and-kids"}(O||(O={})),function(t){t.BLOCKCHAIN_AND_CRYPTOCURRENCY="blockchain-and-cryptocurrency",t.METAVERSE_AND_VR="metaverse-and-vr",t.DEFI_AND_FINANCE="defi-and-finance",t.DAO_AND_GOVERNANCE="dao-and-governance",t.WEB3_STARTUPS="web3-startups"}(_||(_={})),function(t){t.LIVE_MUSIC="live-music",t.COMEDY_SHOWS="comedy-shows",t.THEATRE_AND_PERFORMANCE="theatre-and-performance",t.MOVIES="movies",t.NIGHTLIFE_AND_CLUBBING="nightlife-and-clubbing"}(R||(R={}));const P={festival:Object.values(N),conference:Object.values(I),networking:Object.values(D),meetup:Object.values(O),web3:Object.values(_),entertainment:Object.values(R)};async function x(){return q}async function W(t){return P[t]}var L,M;!function(t){t.EVENT_MANAGER="event-manager",t.CHECK_IN_MANAGER="check-in-manager",t.EVENT_READER="event-reader"}(L||(L={})),function(t){t.EVENT_READER_VIEW="event-reader-view",t.EVENT_MANAGER_EDIT_PAGE="event-manager-edit-page",t.EVENT_MANAGER_CREATE_TICKET="event-manager-create-ticket",t.EVENT_MANAGER_EDIT_TICKET="event-manager-edit-ticket",t.EVENT_MANAGER_DELETE_TICKET="event-manager-delete-ticket",t.EVENT_MANAGER_EDIT_GUEST="event-manager-edit-guest",t.EVENT_MANAGER_CREATE_STAGE="event-manager-create-stage",t.EVENT_MANAGER_EDIT_STAGE="event-manager-edit-stage"}(M||(M={}));const b=Object.values(L),F=Object.values(M),V="https://api.xoxno.com",$="erd1qqqqqqqqqqqqqpgq705fxpfrjne0tl3ece0rrspykq88mynn4kxs2cg43s",U="erd1qqqqqqqqqqqqqpgqd9rvv2n378e27jcts8vfwynpx0gfl5ufz6hqhfy0u0",B="erd1qqqqqqqqqqqqqpgq8xwzu82v8ex3h4ayl5lsvxqxnhecpwyvwe0sf2qj4e";var H;!function(t){t.MAINNET="1",t.DEVNET="D"}(H||(H={}));class G{static instance;apiUrl;apiKey;chain;config;constructor(t=V,e="",i){this.apiUrl=t,this.apiKey=e,this.chain=i,this.config=i==H.MAINNET?{mediaUrl:"https://media.xoxno.com",gatewayUrl:"https://gateway.xoxno.com",XO_SC:"erd1qqqqqqqqqqqqqpgq6wegs2xkypfpync8mn2sa5cmpqjlvrhwz5nqgepyg8",FM_SC:$,DR_SC:U,KG_SC:B,Staking_SC:"erd1qqqqqqqqqqqqqpgqvpkd3g3uwludduv3797j54qt6c888wa59w2shntt6z",Manager_SC:"erd1qqqqqqqqqqqqqpgqg9fa0dmpn8fu3fnleeqn5zt8rl8mdqjkys5s2gtas7",P2P_SC:"erd1qqqqqqqqqqqqqpgq47y8hnct68v6asjv6gxem6h9rumn9frzah0skhxxt6"}:{mediaUrl:"https://devnet-media.xoxno.com",gatewayUrl:"https://devnet-gateway.xoxno.com",XO_SC:"erd1qqqqqqqqqqqqqpgql0dnz6n5hpuw8cptlt00khd0nn4ja8eadsfq2xrqw4",FM_SC:$,DR_SC:U,KG_SC:B,Staking_SC:"erd1qqqqqqqqqqqqqpgqsc5hnewwpep8qq0d7kjjzrquapuucrygah0s85zres",Manager_SC:"erd1qqqqqqqqqqqqqpgqluclyhfsa2uw7q9cjwd8knk989hg57u8ah0slq2nlr",P2P_SC:"erd1qqqqqqqqqqqqqpgqfja7ukpngrun78ueq583l0vd6aj4ekhrah0sa9wyrv"}}static init({apiUrl:t=V,apiKey:e="",chain:i=H.MAINNET}={}){if(null==G.instance||null==G.instance){if(i==H.DEVNET)return G.instance=new G(t??"https://devnet-api.xoxno.com",e,i),G.instance;G.instance=new G(t,e,i)}return G.instance}static getInstance(){if(null==G.instance||null==G.instance)throw new Error("XOXNOClient is not initialized");return G.instance}fetchWithTimeout=async(t,e={})=>{const i=e?.headers?.Authorization,a="Bearer undefined"===i?void 0:i,n={"Accept-Encoding":"gzip,deflate,br",Referer:"https://xoxno.sdk","User-Agent":"XOXNO/1.0/SDK",..."POST"===e.method?{"Content-Type":"application/json"}:{},...a?{Authorization:a}:{}},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=await fetch(r,{...e,cache:"no-store",...Object.keys(n).length?{headers:n}:{},method:e.method??"GET"});if(!o.ok){const e=await o.text();let i;try{i=JSON.parse(e)}catch(t){i={message:e}}throw new Error(`${t}: ${o.status};${o.statusText};${i.message}`)}return o.json()}}const j=async(t,e)=>{if(t.top&&t.top>100)throw new Error("Top cannot be greater than 100");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,chain:t.chain,from:t.from,to:t.to,activityAddress:t.wallets||void 0,source:t.source||void 0,activityType:t.activityType||void 0,eventIdentifier:t.eventIdentifier||void 0,range:i},strictSelect:t.strictSelect,includeCount:t.includeCount||!1,orderBy:t.orderBy,select:t.select,top:t.top||35,skip:t.skip||0},n=await e.fetchWithTimeout("/activity/query",{params:{filter:JSON.stringify(a)},next:{tags:["getActivity"]}});return{...n,getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)},empty:0===n.resources.length}},z=t=>{const e=t.length>=4&&t.length<=40||/^0x[a-fA-F0-9]{1,64}::[a-zA-Z0-9_]+::[a-zA-Z0-9_]+(<.+>)?$/.test(decodeURIComponent(t)),i=/^[A-Z0-9]{3,10}-[a-z0-9]{6}$/.test(t);return e||i},J=t=>{const e=/^0x[a-fA-F0-9]{1,64}$/.test(t),i=/^[A-Za-z0-9]{3,10}-[A-Za-z0-9]{6}-[A-Za-z0-9]{2,7}(?:-\d+(?:-[A-Za-z0-9]+)?)?$/.test(t);return e||i};class K{api;constructor(){this.api=G.getInstance()}getCollectionProfile=async t=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/profile`,{next:{tags:["getCollectionProfile"]}})};getDailyTrending=async()=>await this.api.fetchWithTimeout("/nfts/getDailyTrending",{next:{tags:["getDailyTrending"]}});getCollectionFloorPrice=async(t,e="EGLD")=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/floor-price`,{next:{tags:["getCollectionFloorPrice"]},params:{token:e}})};getCollectionAttributes=async t=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/attributes`,{next:{tags:["getCollectionAttributes"]}})};getNFTs=async t=>{if(t?.collections?.forEach((t=>{if(!z(t))throw new Error("Invalid collection ticker: "+t)})),t.top&&t.top>100)throw new Error("Top cannot be greater than 100");const e=[];t.priceRange&&e.push({...t.priceRange,field:t.auctionType==l.Auctions?"saleInfo.currentBidShort":"saleInfo.minBidShort"}),t.rankRange&&e.push({...t.rankRange,field:"metadata.rarity.rank"});const i={name:t.name,filters:{dataType:t.dataType??["nft"],activeAuction:t.activeAuctions,identifier:t.identifiers,collection:t.collections??[],chain:t.chain??[],onSale:t.onlyOnSale,saleInfo:{seller:t.listedBy||[],marketplace:t.listedOnlyOn||void 0,paymentToken:t.listedInToken||[],auctionType:t.auctionType==l.Auctions?["NftBid","SftAll"]:t.auctionType==l.FixedPrice?["Nft","SftOnePerPayment"]:t.auctionType==l.AllListed?["NftBid","SftAll","Nft","SftOnePerPayment"]:void 0},owner:t.ownedBy||[],verifiedOnly:t.onlyVerified||!1,metadata:{attributes:t.attributes||void 0},range:e,nonce:t.nonces||void 0,cp_staked:t.isStaked??void 0},applyNftExtraDetails:t.applyNftExtraDetails,orderBy:t.orderBy||[],select:t.onlySelectFields||[],strictSelect:t.strictSelect||!1,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"]}}),getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)}}};getSearchNFTs=async t=>{if(t?.collections?.forEach((t=>{if(!z(t))throw new Error("Invalid collection ticker: "+t)})),t.top&&t.top>100)throw new Error("Top cannot be greater than 100");const e=[];t.priceRange&&e.push({...t.priceRange,field:t.auctionType==l.Auctions?"saleInfo.currentBidShort":"saleInfo.minBidShort"}),t.rankRange&&e.push({...t.rankRange,field:"metadata.rarity.rank"});const i={name:t.name,filters:{dataType:t.dataType??["nft"],activeAuction:t.activeAuctions,collection:t.collections??[],chain:t.chain??[],onSale:t.onlyOnSale,saleInfo:{seller:t.listedBy||[],marketplace:t.listedOnlyOn||void 0,paymentToken:t.listedInToken||[],auctionType:t.auctionType==l.Auctions?["NftBid","SftAll"]:t.auctionType==l.FixedPrice?["Nft","SftOnePerPayment"]:t.auctionType==l.AllListed?["NftBid","SftAll","Nft","SftOnePerPayment"]:void 0},owner:t.ownedBy||[],verifiedOnly:t.onlyVerified||!1,metadata:{attributes:t.attributes||void 0},range:e,nonce:t.nonces||void 0,cp_staked:t.isStaked??void 0},applyNftExtraDetails:t.applyNftExtraDetails,orderBy:t.orderBy||[],select:t.onlySelectFields||[],strictSelect:t.strictSelect||!1,includeCount:t.includeCount||!1,top:t.top||35,skip:t.skip||0};return{...await this.api.fetchWithTimeout("/nft/search/query",{params:{filter:JSON.stringify(i)},next:{tags:["getCollectionNFTs"]}}),getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)}}};suggestCollections=async t=>{if(t.top&&t.top>100)throw new Error("Top cannot be greater than 100");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"]}})};collectionListingsAnalytics=async t=>await this.api.fetchWithTimeout(`/collection/${t}/listings`,{next:{tags:["collection/${ticker}/listings"]}});getTradingActivity=async t=>await j(t,this.api);getOffers=async t=>await this.api.fetchWithTimeout("/nft/offer/query",{params:{filter:JSON.stringify(t)},next:{tags:["/nft/offer/query"]}});getCollections=async t=>{if(t?.top&&t.top>100)throw new Error("Top cannot be greater than 100");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},...t?.chain&&t.chain.length>0&&{chain:t.chain}},orderBy:[t?.orderBy||"statistics.tradeData.weekEgldVolume desc"]},i=await this.api.fetchWithTimeout("/collection/query",{params:{filter:JSON.stringify(e)},next:{tags:["getCollections"]}});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>100)throw new Error("Top cannot be greater than 100");const e={skip:t?.skip||0,top:t?.top||25,select:t?.onlySelectFields||[],filters:{collection:t?.collections||[],withAttributes:t?.withAttributes,isActive:t?.onlyActive,offerId:t?.offerIds,owner:t?.ownedBy,marketplace:t?.listedOnlyOn,range:t?.priceRange?{...t.priceRange,type:"priceShort"}:void 0,attributes:t?.attributes},orderBy:t?.orderBy||[o.PriceHighToLow]},i=await this.api.fetchWithTimeout("/collection/global-offer/query",{params:{filter:JSON.stringify(e)},next:{tags:["getGlobalOffers"]}});return{...i,getNextPagePayload:{...t,skip:(t?.top||25)+i.lastSkip}}};getCollectionVolume=async(t,e,i,a)=>{if(!z(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"]}})};getMarketplaceVolume=async(t,e,i)=>await this.api.fetchWithTimeout(`/analytics/volume?startTime=${t}&endTime=${e}&bin=${i}`,{next:{tags:["getMarketplaceVolume"]}});getCollectionOwners=async t=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/holders`,{next:{tags:["getCollectionOwners"]}})};getExportOwners=async t=>{if(!z(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>100)throw new Error("Top cannot be greater than 100");return{...await this.api.fetchWithTimeout("/collection/stats/query",{params:{filter:JSON.stringify(t)},next:{tags:["collectionStatistics"]}}),getNextPagePayload:{...t,skip:t.skip+t.top}}};getCollectionStats=async t=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/stats`,{next:{tags:["collectionStatistics"]}})};getAwaitEmpty=async t=>new Promise((e=>{setTimeout((()=>{e(!0)}),t)}));getCollectionMintInfo=async({ticker:t,extra:e})=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/drop-info`,{next:{tags:[`/collection/${t}/drop-info`]},...e})};getCollectionRanks=async({ticker:t,extra:e})=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/ranks`,{next:{tags:[`/collection/${t}/ranks`]},...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`]},...i});getCollectionGraphData=async(t,e,i,a)=>{if(!z(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`]}})};getPinnedCollections=async t=>await this.api.fetchWithTimeout("/collection/pinned"+(t?`?chain=${t}`:""),{next:{tags:["/collection/pinned"]}});getPinnedDrops=async t=>await this.api.fetchWithTimeout("/collection/pinned-drops"+(t?`?chain=${t}`:""),{next:{tags:["/collection/pinned-drops"]}});getSearchDrops=async t=>{if(t?.collections?.forEach((t=>{if(!z(t))throw new Error("Invalid collection ticker: "+t)})),t.top&&t.top>100)throw new Error("Top cannot be greater than 100");const e=[];t.timeRange&&e.push({...t.timeRange,field:"startTime"});const i={name:t.name,filters:{collection:t.collections??[],verifiedOnly:t.onlyVerified||!1,mintToken:t.listedInToken||void 0,range:e,chain:t.chain??[]},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/search",{params:{filter:JSON.stringify(i)},next:{tags:["/collection/drops/search"]}}),getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)}}};getDrops=async t=>{if(t?.collections?.forEach((t=>{if(!z(t))throw new Error("Invalid collection ticker: "+t)})),t.top&&t.top>100)throw new Error("Top cannot be greater than 100");const e=[];t.timeRange&&e.push({...t.timeRange,field:"startTime"});const i={name:t.name,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"]}}),getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)}}};getCollectionStakingSummary=async({collection:t,extra:e})=>{if(!z(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(!z(t))throw new Error("Invalid collection ticker: "+t)})),await this.api.fetchWithTimeout("/collection/floor-price",{params:{collection:t.join(",")}}))}const Y=t=>{let e=t.toString(16);return e.length%2!=0&&(e="0"+e),e},X=t=>!!t&&(t.includes("erd1")&&62===t.length||/^0x[a-fA-F0-9]{64}$/.test(t));class Z{api;constructor(){this.api=G.getInstance()}getNFTByIdentifier=async(t,e)=>{if(!J(t))throw new Error("Invalid identifier: "+t);return await this.api.fetchWithTimeout(`/nft/${t}`,{...e})};getNFTsOffers=async(t,e=0,i=25)=>{if(!J(t))throw new Error("Invalid identifier: "+t);return await this.api.fetchWithTimeout(`/nft/${t}/offers?skip=${e}&top=${i}`,{next:{tags:["getNFTsOffers"]}})};getNFTByCollectionAndNonce=async(t,e)=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);const i=await this.api.fetchWithTimeout(`/${((t,e)=>[t,Y(e)].join("-"))(t,e)}`);return i};getPinnedNFTs=async t=>await this.api.fetchWithTimeout("/nft/pinned"+(t?`?chain=${t}`:""),{next:{tags:["/nft/pinned"]}});getNFTByCollectionAndNonceHex=async(t,e)=>{if(!z(t))throw new Error("Invalid collection ticker: "+t);return e.length%2!=0&&(e="0"+e),await this.api.fetchWithTimeout(`/${[t,e].join("-")}`)};getTradingActivity=async t=>await j(t,this.api)}class Q{api;collection;constructor(){this.api=G.getInstance(),this.collection=new K}getUserProfile=async t=>{if(!X(t))throw new Error("Invalid address:"+t);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(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/network-account`)};getUserTokenInventory=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/token-inventory`)};getUserSummaryInventory=async(t,e=!0)=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/inventory-summary?activeAuction=${e}`)};getUserNFTs=async t=>await this.collection.getNFTs(t);getUserOffers=async t=>{if(!X(t.address))throw new Error("Invalid address:"+t.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>100)throw new Error("Top cannot be greater than 100");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"]}})};getTradingActivity=async t=>await j(t,this.api);getUserCreatorProfile=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/creator/profile`)};getCreatorListings=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/creator/listing`)};getCreatorEvents=async(t,e)=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/creator/events`,{...e})};getUserStakingSummary=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/summary`)};getUserStakingAailable=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/available-pools`)};getUserCreatorInfo=async(t,e)=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/creator/details`,{...e})};getUserCollectionStaking=async(t,e)=>{if(!X(t))throw new Error("Invalid address:"+t);if(!z(e))throw new Error("Invalid collection ticker: "+e);return await this.api.fetchWithTimeout(`/user/${t}/staking/collection/${e}`)};getUserPoolStaking=async(t,e,i)=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/pool/${e}/nfts?status=${i}`)};getOwnedPoolsByAddress=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/owned-pools`)};getUserAnalyticsSummary=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/analytics/volume`)};getUserFavoriteNFTs=async(t,e,i)=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/favorite/nfts`,{params:{top:e,skip:i}})};getUserFavoriteCollectionTickers=async t=>{if(!X(t))throw new Error("Invalid address:"+t);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,orderDirection:a})=>{if(t&&t>35)throw new Error("Top cannot be greater than 100");return await this.api.fetchWithTimeout("/user/stats",{params:{top:t,skip:e,orderBy:i,orderDirection:a??"desc"},next:{tags:["/user/stats"]}})};getStakingCreatorInfo=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/creator`,{next:{tags:[`/user/${t}/staking/creator`]}})};getUsersDrop=async({top:t,skip:e,address:i})=>{if(t&&t>35)throw new Error("Top cannot be greater than 100");if(i&&!X(i))throw new Error("Invalid address:"+i);return await this.api.fetchWithTimeout("/user/xoxno-drop",{params:{top:t,skip:e,...i?{address:i}:{}},next:{tags:["/user/xoxno-drop"]}})};getUserOwnerCollections=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/owned-collections`)};getRoyaltiesSharesCreator=async t=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/launchpad/${t}/shareholders/royalties`)};getMintSharesCreator=async(t,e)=>{if(!X(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/launchpad/${t}/shareholders/collection/${e}`)}}class tt{api;constructor(){this.api=G.getInstance()}getPoolDetails=async t=>await this.api.fetchWithTimeout(`/pool/${t}/profile`)}class et{api;constructor(){this.api=G.getInstance()}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={};return e&&(i={identifier:e.join(",")}),t&&(i={...i,category:t.join(",")}),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"]}});getAnalyticsOverview=async()=>await this.api.fetchWithTimeout("/analytics/overview",{next:{tags:["/analytics/overview"]}});suggestResults=async t=>{if(t.top&&t.top>100)throw new Error("Top cannot be greater than 100");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"]}})};getExploreStaking=async()=>await this.api.fetchWithTimeout("/collection/staking/explore",{next:{tags:["/collection/staking/explore"]}})}var it=C.TR,at=C.$C,nt=C.Yo,rt=C.LU,ot=C.sW,st=C.X$,ct=C.JA,lt=C.he,dt=C.cO,ht=C.t7,gt=C.MD,ut=C.Gq,pt=C.vY,ft=C.Pz,Tt=C.h4,mt=C.wT,yt=C.JM,wt=C.Ow,Et=C.Vx,St=C.O8,At=C.s0,kt=C.o,vt=C.p4,Ct=C.AQ,qt=C.J1,Nt=C.g6,It=C.cB,Dt=C.Gt,Ot=C.iE,_t=C.I_,Rt=C.ZU,Pt=C.Us,xt=C.GW,Wt=C.L_,Lt=C.t8,Mt=C.Gm,bt=C.tN,Ft=C.br,Vt=C.Ld,$t=C.PG,Ut=C.y_;export{it as ActivityChain,at as AssetCategory,nt as AuctionType,rt as AuctionTypes,ot as Chain,st as CollectionModule,ct as CollectionStatsOrderBy,lt as CollectionStatsSelectFields,dt as CollectionsFieldsToSelect,ht as CollectionsOrderBy,gt as CommonModule,ut as DropsOderBy,pt as EventUserRolePermission,ft as EventUserRoles,Tt as FieldsToSelect,mt as GlobalOfferFieldsToSelect,yt as GlobalOfferOrderBy,wt as IEventCategory,Et as IssuingType,St as Marketplace,At as NFTModule,kt as NftActivityType,vt as OfferType,Ct as OrderByTradingActivity,qt as PoolType,Nt as SearchOrderBy,It as SelectFieldsTradingActivity,Dt as StakingModule,Ot as StakingStatus,_t as SuggestOrderBy,Rt as Type,Pt as UserModule,xt as XOXNOClient,Wt as eventCategories,Lt as eventPermissions,Mt as eventRoles,bt as eventSubCategories,Ft as getEventCategories,Vt as getEventSubCategories,$t as isValidCollectionTicker,Ut as isValidNftIdentifier};
@@ -236,6 +236,7 @@ export declare enum GlobalOfferFieldsToSelect {
236
236
  export interface Filter {
237
237
  dataType?: string[];
238
238
  identifier?: string[];
239
+ chain?: ActivityChain[];
239
240
  collection?: string[];
240
241
  mintToken?: string[];
241
242
  type?: string[];
@@ -289,6 +290,7 @@ export interface GetNFTsArgs {
289
290
  auctionType: AuctionTypes;
290
291
  /** If set, will return only NFTs from the specified collections */
291
292
  collections?: string[];
293
+ chain?: ActivityChain[];
292
294
  /** If set, will return only NFTs from verified collections */
293
295
  onlyVerified?: boolean;
294
296
  /** If true, will return only NFTs that are on sale */
@@ -346,6 +348,7 @@ export interface GETDropsArgs {
346
348
  name?: string;
347
349
  /** If set, will return only NFTs from the specified collections */
348
350
  collections?: string[];
351
+ chain?: ActivityChain[];
349
352
  /** If set, will return only NFTs from verified collections */
350
353
  onlyVerified?: boolean;
351
354
  /** If set, will return only NFTs listed in the specified tokens */
@@ -454,6 +457,7 @@ export type TradingActivity = {
454
457
  export interface GetCollectionsArgs {
455
458
  /** The collections to fetch the profile */
456
459
  collections?: string[];
460
+ chain?: ActivityChain[];
457
461
  /** If true, will return only NFTs that are mintable */
458
462
  onlyMintable?: boolean;
459
463
  /** The number of results to return */
@@ -1,4 +1,5 @@
1
1
  import type { Marketplace, MetadataAttribute, RangeFilter, TradingActivity } from './collection';
2
+ import type { ActivityChain } from './nft';
2
3
  export declare enum NftActivityType {
3
4
  NFT_CREATE = "nftCreate",
4
5
  NFT_BURN = "nftBurn",
@@ -32,6 +33,7 @@ export interface TradingActivityQueryFilter {
32
33
  eventIdentifier?: string[];
33
34
  from?: string[];
34
35
  to?: string[];
36
+ chain?: ActivityChain[];
35
37
  activityData?: {
36
38
  collection?: string[];
37
39
  identifier?: string[];
@@ -48,6 +50,7 @@ export interface TradingActivityQueryFilter {
48
50
  export interface TradincActivityArgs {
49
51
  /** The collections to fetch the trading activity from */
50
52
  collections?: string[];
53
+ chain?: ActivityChain[];
51
54
  /** The identifier of the NFTs to fetch the trading activity from */
52
55
  identifiers?: string[];
53
56
  /** The wallets for which to fetch the trading activity */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xoxno/sdk-js",
3
- "version": "0.1.337",
3
+ "version": "0.1.339",
4
4
  "description": "The SDK to interact with the XOXNO Protocol!",
5
5
  "type": "module",
6
6
  "exports": {