@xoxno/sdk-js 0.1.355 → 1.0.1
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 +1 -1
- package/dist/index.d.ts +1 -6
- package/dist/index.esm.js +1 -1
- package/dist/interactions/index.d.ts +27 -4
- package/dist/{types/interactions.d.ts → interactions/types.d.ts} +5 -39
- package/dist/interactor.cjs.js +1 -1
- package/dist/interactor.d.ts +0 -2
- package/dist/interactor.esm.js +1 -1
- package/dist/sdk/endpoints.d.ts +19 -0
- package/dist/sdk/index.d.ts +86 -0
- package/dist/sdk/swagger.d.ts +1708 -0
- package/dist/sdk/utils.d.ts +9 -0
- package/dist/utils/api.d.ts +3 -2
- package/package.json +7 -7
- package/dist/collection/index.d.ts +0 -294
- package/dist/common/index.d.ts +0 -72
- package/dist/nft/index.d.ts +0 -75
- package/dist/staking/index.d.ts +0 -11
- package/dist/types/collection.d.ts +0 -733
- package/dist/types/common.d.ts +0 -71
- package/dist/types/event.d.ts +0 -195
- package/dist/types/index.d.ts +0 -23
- package/dist/types/nft.d.ts +0 -129
- package/dist/types/staking.d.ts +0 -68
- package/dist/types/trading.d.ts +0 -111
- package/dist/types/user.d.ts +0 -290
- package/dist/users/index.d.ts +0 -201
- /package/dist/{utils/types.d.ts → sdk/parseSwagger.d.ts} +0 -0
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var t,e,i,a,r,n,o,s,c,l,d,h,u,g,f,T,p,m,E,y,w,S,A,q={d:(t,e)=>{for(var i in e)q.o(e,i)&&!q.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},C={};q.r(C),q.d(C,{ActivityChain:()=>g,AssetCategory:()=>d,AuctionType:()=>m,AuctionTypes:()=>l,Chain:()=>B,CollectionModule:()=>it,CollectionStatsOrderBy:()=>u,CollectionStatsSelectFields:()=>h,CollectionsFieldsToSelect:()=>s,CollectionsOrderBy:()=>n,CommonModule:()=>ct,DropsOderBy:()=>a,EventUserRolePermission:()=>P,EventUserRoles:()=>L,FieldsToSelect:()=>e,GlobalOfferFieldsToSelect:()=>c,GlobalOfferOrderBy:()=>o,IEventCategory:()=>A,IssuingType:()=>E,Marketplace:()=>t,NFTModule:()=>nt,NftActivityType:()=>f,OfferType:()=>V,OrderByTradingActivity:()=>T,PoolType:()=>y,SearchOrderBy:()=>i,SelectFieldsTradingActivity:()=>p,StakingModule:()=>st,StakingStatus:()=>w,SuggestOrderBy:()=>r,Type:()=>S,UserModule:()=>ot,XOXNOClient:()=>j,eventCategories:()=>v,eventPermissions:()=>F,eventRoles:()=>$,eventSubCategories:()=>M,getEventCategories:()=>R,getEventSubCategories:()=>W,isValidCollectionTicker:()=>X,isValidNftIdentifier:()=>Z}),function(t){t.XO="xoxno",t.FM="frameit",t.DR="deadrare",t.KG="krogan"}(t||(t={})),function(t){t.Rank="metadata.rarity.rank",t.Attributes="metadata.attributes",t.Description="metadata.description",t.Name="name",t.OnSale="onSale",t.SaleInfo="saleInfo",t.Royalties="royalties",t.Identifier="identifier",t.Collection="collection",t.OriginalURL="url",t.Nonce="nonce",t.ContentType="originalMedia.contentType",t.WasProcessed="wasProcessed",t.AvifURL="avifUrl",t.WebpURL="webpUrl",t.Type="type"}(e||(e={})),function(t){t.PriceHighToLow="saleInfo.minBidShort desc",t.PriceLowToHigh="saleInfo.minBidShort asc",t.MaxPriceHighToLow="saleInfo.maxBidShort desc",t.MaxPriceLowToHigh="saleInfo.maxBidShort asc",t.BidPriceHighToLow="saleInfo.currentBidShort desc",t.BidPriceLowToHigh="saleInfo.currentBidShort asc",t.RarityHighToLow="metadata.rarity.rank desc",t.RarityLowToHigh="metadata.rarity.rank asc",t.NonceHighToLow="nonce desc",t.NonceLowToHigh="nonce asc",t.RecentListed="saleInfo.timestamp desc",t.OldestListed="saleInfo.timestamp asc",t.EndingLate="saleInfo.deadline desc",t.EndingSoon="saleInfo.deadline asc"}(i||(i={})),function(t){t.EndingLate="startTime desc",t.EndingSoon="startTime asc"}(a||(a={})),function(t){t.TotalVolumeHighToLow="statistics/tradeData/totalEgldVolume desc",t.FollowersHighToLow="statistics/other/followCount desc",t.IsVerifiedTrueToFalse="isVerified desc",t.HasImageTrueToFalse="profile desc",t.HasBannerTrueToFalse="banner desc"}(r||(r={})),function(t){t.WeekVolumeHighToLow="statistics.tradeData.weekEgldVolume desc",t.WeekVolumeLowToHigh="statistics.tradeData.weekEgldVolume asc",t.DailyVolumeHighToLow="statistics.tradeData.dayEgldVolume desc",t.DailyVolumeLowToHigh="statistics.tradeData.dayEgldVolume asc",t.TotalVolumeHighToLow="statistics.tradeData.totalEgldVolume desc",t.TotalVolumeLowToHigh="statistics.tradeData.totalEgldVolume asc",t.AvgVolumePriceHighToLow="statistics.tradeData.averageEgldPrice desc",t.AvgVolumePriceLowToHigh="statistics.tradeData.averageEgldPrice asc",t.ATHHighToLow="statistics.tradeData.athEgldPrice desc",t.ATHLowToHigh="statistics.tradeData.athEgldPrice asc",t.TotalTradesHighToLow="statistics.tradeData.totalTrades desc",t.TotalTradesLowToHigh="statistics.tradeData.totalTrades asc",t.SupplyHighToLow="statistics.other.nftCount desc",t.SupplyLowToHigh="statistics.other.nftCount asc",t.FollowersHighToLow="statistics.other.followCount desc",t.FollowersLowToHigh="statistics.other.followCount asc"}(n||(n={})),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"}(u||(u={})),function(t){t.MVX="MVX",t.SUI="SUI"}(g||(g={})),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"}(f||(f={})),function(t){t.PriceHighToLow="activityData.egldValue desc",t.PriceLowToHigh="activityData.egldValue asc",t.RecentPlaced="timestamp desc",t.OldestPlaced="timestamp asc"}(T||(T={})),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"}(p||(p={})),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"}(E||(E={})),function(t){t.Duo="Duo",t.Single="Single",t.Perk="Perk"}(y||(y={})),function(t){t.Staked="staked",t.Unbounding="unstaked",t.Available="available"}(w||(w={})),function(t){t.NonFungibleESDT="NonFungibleESDT"}(S||(S={})),function(t){t.FESTIVAL="festival",t.CONFERENCE="conference",t.NETWORKING="networking",t.MEETUP="meetup",t.WEB3="web3",t.ENTERTAINMENT="entertainment"}(A||(A={}));const v=Object.values(A);var D,I,k,N,_,O;!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"}(D||(D={})),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"}(k||(k={})),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"}(N||(N={})),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"}(O||(O={}));const M={festival:Object.values(D),conference:Object.values(I),networking:Object.values(k),meetup:Object.values(N),web3:Object.values(_),entertainment:Object.values(O)};async function R(){return v}async function W(t){return M[t]}var L,P;!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"}(P||(P={}));const $=Object.values(L),F=Object.values(P);var V;!function(t){t.Received="received",t.Placed="placed"}(V||(V={}));const b="https://api.xoxno.com",U="erd1qqqqqqqqqqqqqpgq705fxpfrjne0tl3ece0rrspykq88mynn4kxs2cg43s",H="erd1qqqqqqqqqqqqqpgqd9rvv2n378e27jcts8vfwynpx0gfl5ufz6hqhfy0u0",x="erd1qqqqqqqqqqqqqpgq8xwzu82v8ex3h4ayl5lsvxqxnhecpwyvwe0sf2qj4e";var B;!function(t){t.MAINNET="1",t.DEVNET="D"}(B||(B={}));class j{static instance;apiUrl;apiKey;chain;config;constructor(t=b,e="",i){this.apiUrl=t,this.apiKey=e,this.chain=i,this.config=i==B.MAINNET?{mediaUrl:"https://media.xoxno.com",gatewayUrl:"https://gateway.xoxno.com",XO_SC:"erd1qqqqqqqqqqqqqpgq6wegs2xkypfpync8mn2sa5cmpqjlvrhwz5nqgepyg8",FM_SC:U,DR_SC:H,KG_SC:x,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:U,DR_SC:H,KG_SC:x,Staking_SC:"erd1qqqqqqqqqqqqqpgqsc5hnewwpep8qq0d7kjjzrquapuucrygah0s85zres",Manager_SC:"erd1qqqqqqqqqqqqqpgqluclyhfsa2uw7q9cjwd8knk989hg57u8ah0slq2nlr",P2P_SC:"erd1qqqqqqqqqqqqqpgqfja7ukpngrun78ueq583l0vd6aj4ekhrah0sa9wyrv"}}static init({apiUrl:t=b,apiKey:e="",chain:i=B.MAINNET}={}){if(null==j.instance||null==j.instance){if(i==B.DEVNET)return j.instance=new j(t??"https://devnet-api.xoxno.com",e,i),j.instance;j.instance=new j(t,e,i)}return j.instance}static getInstance(){if(null==j.instance||null==j.instance)throw new Error("XOXNOClient is not initialized");return j.instance}fetchWithTimeout=async(t,e={})=>{const i=e?.headers?.Authorization,a="Bearer undefined"===i?void 0:i,r={"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}:{}},n=`${"string"==typeof t&&t.startsWith("/")?`${this.apiUrl}${t}`:t}${e.params?"?"+Object.entries(e.params).flatMap((([t,e])=>Array.isArray(e)?e.map((e=>`${t}=${encodeURIComponent(e)}`)):`${t}=${encodeURIComponent(e)}`)).join("&"):""}`,o=await fetch(n,{...e,cache:"no-store",...Object.keys(r).length?{headers:r}:{},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()}}class G extends Error{constructor(t){super(`Invalid collection ticker: ${t}`)}}class z extends Error{constructor(t){super(`Invalid address: ${t}`)}}class K extends Error{constructor(t){super(`Invalid NFT identifier: ${t}`)}}class Y extends Error{constructor(t){super(`Top cannot be greater than 100, found ${t}`)}}const X=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},Z=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};function J(t,e){if(!X(t))throw new G(t);return e}function Q(t,e){if(!X(t))throw new z(t);return e}function tt(t){return J(t,Promise.resolve())}function et(t,e){if(t.top&&t.top>100)throw new Y(t.top);return e(JSON.stringify(t))}class it{api;constructor(){this.api=j.getInstance()}getCollectionProfile=async t=>J(t,this.api.fetchWithTimeout(`/collection/${t}/profile`));getCollectionFloorPrice=async(t,e="EGLD")=>J(t,this.api.fetchWithTimeout(`/collection/${t}/floor-price`,{params:{token:e}}));getCollectionAttributes=async t=>J(t,this.api.fetchWithTimeout(`/collection/${t}/attributes`));getNFTs=async t=>(t.filters.collection?.forEach((t=>{tt(t)})),et(t,(t=>this.api.fetchWithTimeout("/nft/query",{params:{filter:t}}))));getSearchNFTs=async t=>(t.filters.collection?.forEach((t=>{tt(t)})),et(t,(t=>this.api.fetchWithTimeout("/nft/search/query",{params:{filter:t}}))));suggestCollections=async t=>et(t,(t=>this.api.fetchWithTimeout("/collection/search",{params:{filter:t}})));collectionListingsAnalytics=async t=>await this.api.fetchWithTimeout(`/collection/${t}/listings`);getOffers=async t=>et(t,(t=>this.api.fetchWithTimeout("/nft/offer/query",{params:{filter:t}})));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)}});return{results:i,count:i.length,hasMoreResults:i.length>=(t?.top||25)}};getGlobalOffers=async t=>et(t,(t=>this.api.fetchWithTimeout("/collection/global-offer/query",{params:{filter:t}})));getCollectionVolume=async(t,e,i,a)=>{if(!X(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/analytics/volume?startTime=${e}&endTime=${i}&bin=${a}`)};getMarketplaceVolume=async(t,e,i,a)=>await this.api.fetchWithTimeout(`/analytics/volume?startTime=${t}&endTime=${e}&bin=${i}${a?.length?a.map((t=>`&chain=${t}`)).join(""):""}`);getCollectionOwners=async t=>{if(!X(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/holders`)};getExportOwners=async t=>{if(!X(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/holders?exportHolders=true`)};getCollectionsStatistics=async t=>et(t,(t=>this.api.fetchWithTimeout("/collection/stats/query",{params:{filter:t}})));getCollectionStats=async t=>{if(!X(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/stats`)};getAwaitEmpty=async t=>new Promise((e=>{setTimeout((()=>{e(!0)}),t)}));getCollectionMintInfo=async({ticker:t,extra:e})=>{if(!X(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/drop-info`,e)};getCollectionRanks=async({ticker:t,extra:e})=>{if(!X(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/ranks`,e)};getDropInfo=async({collectionTag:t,creatorTag:e,extra:i})=>await this.api.fetchWithTimeout(`/collection/${e}/${t}/drop-info`,i);getCollectionGraphData=async(t,e,i,a)=>{if(!X(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/analytics/volume`,{params:{startTime:e,endTime:i,bin:a}})};getPinnedCollections=async t=>await this.api.fetchWithTimeout("/collection/pinned"+(t?`?chain=${t}`:""));getPinnedDrops=async t=>await this.api.fetchWithTimeout("/collection/pinned-drops"+(t?`?chain=${t}`:""));getSearchDrops=async t=>et(t,(t=>this.api.fetchWithTimeout("/collection/drops/search",{params:{filter:t}})));getDrops=async t=>(t.filters.collection?.forEach((t=>{tt(t)})),et(t,(t=>this.api.fetchWithTimeout("/collection/drops/query",{params:{filter:t}}))));getCollectionStakingSummary=async({collection:t,extra:e})=>{if(!X(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(!X(t))throw new Error("Invalid collection ticker: "+t)})),await this.api.fetchWithTimeout("/collection/floor-price",{params:{collection:t.join(",")}}))}const at=t=>{let e=t.toString(16);return e.length%2!=0&&(e="0"+e),e},rt=t=>!!t&&(t.includes("erd1")&&62===t.length||/^0x[a-fA-F0-9]{64}$/.test(t));class nt{api;constructor(){this.api=j.getInstance()}getNFTByIdentifier=async(t,e)=>{if(!Z(t))throw new Error("Invalid identifier: "+t);return await this.api.fetchWithTimeout(`/nft/${t}`,{...e})};getNFTsOffers=async({identifier:t,...e})=>function(t,e){if(!Z(t))throw new K(t);return e}(t,et(e,(()=>this.api.fetchWithTimeout(`/nft/${t}/offers`,{params:e}))));getNFTByCollectionAndNonce=async(t,e)=>{if(!X(t))throw new Error("Invalid collection ticker: "+t);const i=await this.api.fetchWithTimeout(`/${((t,e)=>[t,at(e)].join("-"))(t,e)}`);return i};getDailyTrending=async()=>await this.api.fetchWithTimeout("/nfts/getDailyTrending");getPinnedNFTs=async t=>await this.api.fetchWithTimeout("/nft/pinned"+(t?`?chain=${t}`:""));getNFTByCollectionAndNonceHex=async(t,e)=>{if(!X(t))throw new Error("Invalid collection ticker: "+t);return e.length%2!=0&&(e="0"+e),await this.api.fetchWithTimeout(`/${[t,e].join("-")}`)}}class ot{api;collection;constructor(){this.api=j.getInstance(),this.collection=new it}getUserProfile=async t=>{if(!rt(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(!rt(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/network-account`)};getUserTokenInventory=async t=>{if(!rt(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/token-inventory`)};getUserSummaryInventory=async(t,e=!0)=>{if(!rt(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({identifier:t,...e})=>Q(t,et(e,(()=>this.api.fetchWithTimeout(`/user/${t}/offers`,{params:e}))));suggestUsers=async t=>et(t,(t=>this.api.fetchWithTimeout("/user/search",{params:{filter:t}})));getUserCreatorProfile=async t=>{if(!rt(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/creator/profile`)};getCreatorListings=async t=>{if(!rt(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/creator/listing`)};getCreatorEvents=async(t,e)=>{if(!rt(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/creator/events`,{...e})};getUserStakingSummary=async t=>{if(!rt(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/summary`)};getUserStakingAailable=async t=>{if(!rt(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/available-pools`)};getUserCreatorInfo=async(t,e)=>{if(!rt(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/creator/details`,{...e})};getUserCollectionStaking=async(t,e)=>{if(!rt(t))throw new Error("Invalid address:"+t);if(!X(e))throw new Error("Invalid collection ticker: "+e);return await this.api.fetchWithTimeout(`/user/${t}/staking/collection/${e}`)};getUserPoolStaking=async(t,e,i)=>{if(!rt(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/pool/${e}/nfts?status=${i}`)};getOwnedPoolsByAddress=async t=>{if(!rt(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/owned-pools`)};getUserAnalyticsSummary=async t=>{if(!rt(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/analytics/volume`)};getUserFavoriteNFTs=async({identifier:t,...e})=>Q(t,et(e,(()=>this.api.fetchWithTimeout(`/user/${t}/favorite/nfts`,{params:e}))));getUserFavoriteCollectionTickers=async t=>{if(!rt(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"}})};getStakingCreatorInfo=async t=>{if(!rt(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/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&&!rt(i))throw new Error("Invalid address:"+i);return await this.api.fetchWithTimeout("/user/xoxno-drop",{params:{top:t,skip:e,...i?{address:i}:{}}})};getUserOwnerCollections=async t=>{if(!rt(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/owned-collections`)};getRoyaltiesSharesCreator=async t=>{if(!rt(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/launchpad/${t}/shareholders/royalties`)};getMintSharesCreator=async(t,e)=>{if(!rt(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/launchpad/${t}/shareholders/collection/${e}`)}}class st{api;constructor(){this.api=j.getInstance()}getPoolDetails=async t=>await this.api.fetchWithTimeout(`/pool/${t}/profile`)}class ct{api;constructor(){this.api=j.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,i)=>{let a={};return e&&(a={identifier:e.join(",")}),t&&(a={...a,category:t.join(",")}),i&&(a={...a,chain:i.join(",")}),await this.api.fetchWithTimeout("/tokens",{params:a})};getAnalyticsOverview=async t=>await this.api.fetchWithTimeout(`/analytics/overview${t?.length?t.map(((t,e)=>`${e?"&":"?"}chain=${t}`)).join(""):""}`);suggestResults=async t=>et(t,(t=>this.api.fetchWithTimeout("/search",{params:{filter:t}})));getExploreStaking=async()=>await this.api.fetchWithTimeout("/collection/staking/explore");getTradingActivity=async t=>et(t,(t=>this.api.fetchWithTimeout("/activity/query",{params:{filter:t}})))}module.exports=C})();
|
|
1
|
+
(()=>{"use strict";var t={d:(e,u)=>{for(var o in u)t.o(u,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:u[o]})},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})}},e={};t.r(e),t.d(e,{XOXNOClient:()=>p,buildSdk:()=>f,isValidCollectionTicker:()=>d,isValidNftIdentifier:()=>s});const u="https://api.xoxno.com",o="erd1qqqqqqqqqqqqqpgq705fxpfrjne0tl3ece0rrspykq88mynn4kxs2cg43s",i="erd1qqqqqqqqqqqqqpgqd9rvv2n378e27jcts8vfwynpx0gfl5ufz6hqhfy0u0",n="erd1qqqqqqqqqqqqqpgq8xwzu82v8ex3h4ayl5lsvxqxnhecpwyvwe0sf2qj4e";var r;!function(t){t.MAINNET="1",t.DEVNET="D"}(r||(r={}));class p{static instance;apiUrl;apiKey;chain;config;constructor(t=u,e="",p){this.apiUrl=t,this.apiKey=e,this.chain=p,this.config=p==r.MAINNET?{mediaUrl:"https://media.xoxno.com",gatewayUrl:"https://gateway.xoxno.com",XO_SC:"erd1qqqqqqqqqqqqqpgq6wegs2xkypfpync8mn2sa5cmpqjlvrhwz5nqgepyg8",FM_SC:o,DR_SC:i,KG_SC:n,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:o,DR_SC:i,KG_SC:n,Staking_SC:"erd1qqqqqqqqqqqqqpgqsc5hnewwpep8qq0d7kjjzrquapuucrygah0s85zres",Manager_SC:"erd1qqqqqqqqqqqqqpgqluclyhfsa2uw7q9cjwd8knk989hg57u8ah0slq2nlr",P2P_SC:"erd1qqqqqqqqqqqqqpgqfja7ukpngrun78ueq583l0vd6aj4ekhrah0sa9wyrv"}}static init({apiUrl:t=u,apiKey:e="",chain:o=r.MAINNET}={}){if(null==p.instance||null==p.instance){if(o==r.DEVNET)return p.instance=new p(t??"https://devnet-api.xoxno.com",e,o),p.instance;p.instance=new p(t,e,o)}return p.instance}static getInstance(){if(null==p.instance||null==p.instance)throw new Error("XOXNOClient is not initialized");return p.instance}fetchWithTimeout=async(t,{params:e,...u}={})=>{const o=u?.headers?.Authorization,i="Bearer undefined"===o?void 0:o,n={...u.headers,Referer:"https://xoxno.sdk","User-Agent":"XOXNO/1.0/SDK",..."PUT"===u.method?{}:{"Content-Type":"application/json"},...i?{Authorization:i}:{}},r=`${"string"==typeof t&&t.startsWith("/")?`${this.apiUrl}${t}`:t}${e?"?"+Object.entries(e).flatMap((([t,e])=>Array.isArray(e)?e.map((e=>`${t}=${encodeURIComponent(e)}`)):`${t}=${encodeURIComponent(e)}`)).join("&"):""}`,p={...u,...Object.keys(n).length?{headers:n}:{},method:u.method??"GET"},d=await fetch(r,p);if(!d.ok){const e=await d.text();let u;try{u=JSON.parse(e)}catch(t){u={message:e}}throw new Error(`${t}: ${d.status};${d.statusText};${u.message}`)}return"application/json"===d.headers.get("Content-Type")?d.json():d.text()}}const d=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)),u=/^[A-Z0-9]{3,10}-[a-z0-9]{6}$/.test(t);return e||u},s=t=>{const e=/^0x[a-fA-F0-9]{1,64}$/.test(t),u=/^[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||u};class c extends Error{constructor(t){super(`Invalid collection ticker: ${t}`)}}class y extends Error{constructor(t){super(`Invalid address: ${t}`)}}Error,Error;const a=t=>!!t&&(t.includes("erd1")&&62===t.length||/^0x[a-fA-F0-9]{64}$/.test(t)),l={"/user/login":{input:{},output:{},POST:{input:{},output:{},body:{}}},"/user/:address/network-account":{input:{},output:{}},"/user/:address/token-inventory":{input:{},output:{}},"/user/network-account":{input:{},output:{},POST:{input:{},output:{},body:{}}},"/user/me/profile":{input:{},output:{},securityMode:"requiredAny"},"/user/:address/profile":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/me":{input:{},output:{},securityMode:"requiredAny"},"/user/me/settings":{input:{},output:{},securityMode:"requiredAny"},"/user/me/settings/notification-preferences":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/me/settings/email":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"},DELETE:{input:{},output:{},body:{},securityMode:"requiredJwt"}},"/user/me/settings/phone":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/me/settings/billing":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/me/settings/verify-email":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/buy/signature":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/upload-picture":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/upload-banner":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/reset-picture":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/reset-banner":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:tag/creator/is-registered":{input:{},output:{}},"/user/:address/creator/profile":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/creator/upload-picture":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/creator/upload-banner":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/creator/reset-picture":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/creator/reset-banner":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/favorite/collections":{input:{},output:{}},"/user/favorite/:favoriteId":{input:{},output:{},securityMode:"requiredAny"},"/user/:address/follow":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/favorite/users":{input:{},output:{}},"/tokens":{input:{},output:{}},"/tokens/swap":{input:{},output:{}},"/tokens/usd-price":{input:{},output:{}},"/tokens/egld/fiat-price":{input:{},output:{}},"/tokens/xoxno":{input:{},output:{}},"/tokens/egld":{input:{},output:{}},"/tokens/sui":{input:{},output:{}},"/tokens/xoxno/info":{input:{},output:{}},"/tokens/xoxno/liquid":{input:{},output:{}},"/liquid/xoxno/stats":{input:{},output:{}},"/liquid/egld/stats":{input:{},output:{}},"/liquid/xoxno/rate":{input:{},output:{}},"/liquid/xoxno/liquid-supply":{input:{},output:{}},"/liquid/xoxno/staked":{input:{},output:{}},"/analytics/marketplace-unique-users":{input:{},output:{}},"/liquid/egld/rate":{input:{},output:{}},"/liquid/egld/liquid-supply":{input:{},output:{}},"/liquid/egld/staked":{input:{},output:{}},"/liquid/egld/pending-fees":{input:{},output:{}},"/liquid/egld/pending-undelegate":{input:{},output:{}},"/liquid/egld/pending-delegate":{input:{},output:{}},"/liquid/egld/execute-delegate":{input:{},output:{}},"/liquid/egld/execute-undelegate":{input:{},output:{}},"/liquid/egld/protocol-apr":{input:{},output:{}},"/liquid/egld/providers":{input:{},output:{}},"/ash/min-token-quantity":{input:{},output:{}},"/ash/max-token-quantity":{input:{},output:{}},"/arda/max-token-quantity":{input:{},output:{}},"/arda/min-token-quantity":{input:{},output:{}},"/lending/market/:token/profile":{input:{},output:{}},"/lending/market/query":{input:{},output:{}},"/user/lending/:address":{input:{},output:{}},"/lending/market/indexes":{input:{},output:{}},"/user/lending/position/:identifier":{input:{},output:{}},"/user/lending/image/:nonce":{input:{},output:{}},"/lending/market/emode-categories":{input:{},output:{}},"/lending/market/:token/emode-categories":{input:{},output:{}},"/lending/market/:token/analytics":{input:{},output:{}},"/lending/leaderboard":{input:{},output:{}},"/lending/stats":{input:{},output:{}},"/lending/market/prices":{input:{},output:{}},"/nft/query":{input:{},output:{}},"/nft/:identifier/like":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/inventory-summary":{input:{},output:{}},"/user/:address/offers":{input:{},output:{}},"/nft/offer/query":{input:{},output:{}},"/nft/offer/:identifier":{input:{},output:{}},"/user/:address/favorite/nfts":{input:{},output:{}},"/collection/:collection/attributes":{input:{},output:{}},"/nft/:identifier/offers":{input:{},output:{}},"/collection/:collection/ranks":{input:{},output:{}},"/collection/:collection/listings":{input:{},output:{}},"/nft/pinned":{input:{},output:{}},"/nft/sign-withdraw":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/collection/:collection/sign-offer":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/collection/:collection/sign-mint":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/nft/:identifier":{input:{},output:{}},"/collection/:collection/profile":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/collection/:collection/floor-price":{input:{},output:{}},"/collection/floor-price":{input:{},output:{}},"/collection/pinned":{input:{},output:{}},"/collection/pinned-drops":{input:{},output:{}},"/collection/:collection/pinned-drops":{input:{},output:{}},"/collection/:collection/pinned":{input:{},output:{}},"/collection/:collection/follow":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/collection/query":{input:{},output:{}},"/collection/drops/query":{input:{},output:{}},"/collection/:collection/drop-info":{input:{},output:{},securityMode:"optionalAny"},"/collection/:creatorTag/:collectionTag/drop-info":{input:{},output:{},securityMode:"optionalAny"},"/collection/:collection/upload-picture":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/collection/:collection/upload-banner":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/collection/:collection/reset-picture":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/collection/:collection/reset-banner":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/collection/:collection/holders":{input:{},output:{}},"/collection/:collection/owner":{input:{},output:{}},"/collection/:collection/stats":{input:{},output:{}},"/collection/stats/query":{input:{},output:{}},"/collection/global-offer/query":{input:{},output:{}},"/user/:address/creator/listing":{input:{},output:{}},"/user/:address/creator/details":{input:{},output:{}},"/pool/:poolId/profile":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/pool/:poolId/whitelist":{input:{},output:{}},"/pool/:poolId/upload-picture":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/staking/available-pools":{input:{},output:{}},"/user/:address/staking/owned-collections":{input:{},output:{}},"/user/:address/staking/owned-pools":{input:{},output:{}},"/user/:address/staking/summary":{input:{},output:{}},"/user/:address/staking/creator":{input:{},output:{}},"/user/:address/staking/collection/:collection":{input:{},output:{}},"/user/:address/staking/pool/:poolId/nfts":{input:{},output:{}},"/collection/:collection/staking/summary":{input:{},output:{},securityMode:"optionalAny"},"/collection/:collection/staking/delegators":{input:{},output:{}},"/collection/staking/explore":{input:{},output:{}},"/user/:creatorTag/owned-services":{input:{},output:{}},"/search":{input:{},output:{}},"/user/search":{input:{},output:{}},"/collection/search":{input:{},output:{}},"/collection/drops/search":{input:{},output:{}},"/nft/search/query":{input:{},output:{}},"/user/notifications":{input:{},output:{},securityMode:"requiredAny"},"/user/notifications/unread-count":{input:{},output:{},securityMode:"requiredAny"},"/user/notifications/clear":{input:{},output:{},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/notifications/read":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/mobile/device/register":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredWeb2"}},"/mobile/device/:deviceId":{input:{},output:{},securityMode:"requiredWeb2",DELETE:{input:{},output:{},body:{},securityMode:"requiredWeb2"}},"/mobile/history":{input:{},output:{},securityMode:"requiredAny"},"/mobile/history/unread-count":{input:{},output:{},securityMode:"requiredAny"},"/mobile/history/:notificationId/read":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/mobile/history/read-all":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/mobile/history/clear-all":{input:{},output:{},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/eventNotifications/event/:eventId/update":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/eventNotifications/event/:eventId/reminder":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/eventNotifications/creator/marketing":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/eventNotifications/user/:userId/direct":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/native-token":{input:{},output:{}},"/user/web2":{input:{},output:{},securityMode:"requiredWeb2"},"/user/web2/session-cookie":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredWeb2"}},"/user/web2/wallet":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredWeb2"}},"/user/web2/wallet-switch":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredWeb2"}},"/user/web2/wallet-link":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredWeb2"}},"/user/web2/:index/wallet-link":{input:{},output:{},DELETE:{input:{},output:{},body:{},securityMode:"requiredWeb2"}},"/user/web2/shards":{input:{},output:{},securityMode:"requiredWeb2"},"/lending/market-sc":{input:{},output:{}},"/lending/market/:token/price/egld":{input:{},output:{}},"/faucet":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/activity/query":{input:{},output:{}},"/activity/:identifier":{input:{},output:{}},"/analytics/volume":{input:{},output:{}},"/collection/:collection/analytics/volume":{input:{},output:{}},"/user/:address/analytics/volume":{input:{},output:{}},"/analytics/overview":{input:{},output:{}},"/user/stats":{input:{},output:{}},"/user/xoxno-drop":{input:{},output:{}},"/user/me/xoxno-drop":{input:{},output:{},securityMode:"requiredAny"},"/transactions/:txHash/status":{input:{},output:{}},"/transactions":{input:{},output:{},POST:{input:{},output:{},body:{}}},"/transactions/batch":{input:{},output:{},POST:{input:{},output:{},body:{}}},"/user/chat/message":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/chat/conversation":{input:{},output:{},securityMode:"requiredAny"},"/user/chat/conversation/:conversationId":{input:{},output:{},securityMode:"requiredAny",DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/chat/conversation-summary":{input:{},output:{},securityMode:"requiredAny"},"/user/chat/conversation/:conversationId/message/:messageId":{input:{},output:{},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/chat/block":{input:{},output:{},securityMode:"requiredAny"},"/user/chat/block/:address":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/chat/token":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/countries":{input:{},output:{}},"/event":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId":{input:{},output:{},securityMode:"optionalAny",PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/profile/query":{input:{},output:{}},"/event/:eventId/profile":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/background":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/description":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/description/image":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/description/image/:imageId":{input:{},output:{},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/register":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/ticket":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/ticket/:ticketId":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/ticket/:ticketId/profile":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/stage":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/stage/:stageId":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/calculate-prices":{input:{},output:{},POST:{input:{},output:{},body:{}}},"/event/:eventId/validate-discount":{input:{},output:{},POST:{input:{},output:{},body:{}}},"/user/:address/creator/events":{input:{},output:{},securityMode:"optionalAny"},"/event/:eventId/invite":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/invite/query":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/invite/:inviteId":{input:{},output:{}},"/event/:eventId/voucher/query":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/questions":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/question":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/question/:questionId":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/invite/:inviteId/claim":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/invite/:inviteId/cancel":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/guest/query":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/guest/:address":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/guest-export":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/role":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"},securityMode:"requiredAny"},"/event/:eventId/role/:address":{input:{},output:{},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"},securityMode:"requiredAny"},"/event/:eventId/guest":{input:{},output:{},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/role/:roleId/accept":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/roleId/:roleId":{input:{},output:{}},"/user/me/event":{input:{},output:{},securityMode:"requiredAny"},"/user/me/events/past":{input:{},output:{},securityMode:"requiredAny"},"/user/me/events/hosted":{input:{},output:{},securityMode:"requiredAny"},"/user/me/events/upcoming":{input:{},output:{},securityMode:"requiredAny"},"/user/me/event/badge":{input:{},output:{},securityMode:"requiredAny"},"/user/me/event/badge/payload":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/scan":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/voucher":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/voucher/:voucherCode":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/manual-check-in":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/guest/:guestId/answered-questions":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/guest/approve":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/ticket/:ticketId/google/class":{input:{},output:{},POST:{input:{},output:{},body:{}}},"/event/:eventId/guest/:address/google/pass":{input:{},output:{}},"/event/profile/location":{input:{},output:{}},"/event/:eventId/referral-config":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/referral-config/:configId":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/referral-configs":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/referral":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/referral/:referralCode":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/referrals":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/referrals/self-serviced":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/notify-attendees":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/notify/global-broadcast":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}}},q=["PATCH","POST","DELETE","PUT"],v=t=>t.replace(/-([a-z])/g,((t,e)=>e.toUpperCase())),b=()=>({static:{},params:{},leaves:[]});function f(t){const e=function(){const t=b();for(const[e,u]of Object.entries(l)){const o=e.split("/").filter(Boolean);let i=t;for(const t of o)if(t.startsWith(":")){const e=v(t.slice(1));i=i.params[e]||=b()}else{const e=v(t);i=i.static[e]||=b()}i.leaves.push({rawPath:e,def:u})}return t}(),u=(e,o)=>{const i={};for(const{rawPath:u,def:n}of e.leaves){const e=v(u.split("/").pop().replace(/^:/,"")),r=A(u,n,o,t);i[e]=r}for(const[t,n]of Object.entries(e.static)){const e=u(n,o);let r=e;if(e&&"object"==typeof e&&t in e&&"function"==typeof e[t]){const u=e[t],o=Object.fromEntries(Object.entries(e).filter((([e])=>e!==t)));1===u.length||(Object.assign(u,o),r=u)}void 0===i[t]?i[t]=r:"function"==typeof i[t]?Object.assign(i[t],r):"function"==typeof r?(Object.assign(r,i[t]),i[t]=r):Object.assign(i[t],r)}for(const[t,n]of Object.entries(e.params)){const e=e=>{const i=u(n,{...o,[t]:e});if(i&&"object"==typeof i&&1===Object.keys(i).length&&t in i&&"function"==typeof i[t]){const e=i[t],u=(...t)=>e(...t);return Object.assign(u,e),u}return i};if(i[t]){const u=i[t];i[t]=t=>({...u(t),...e(t)})}else i[t]=e}return i};return u(e,{})}function A(t,e,u,o){const{input:i,output:n,...r}=e,p=(e={})=>{const i={...u,...e},n=t.replace(/:([a-zA-Z_]+)/g,((t,e)=>`${i[e]}`)),r=[...t.matchAll(/:([a-zA-Z_]+)/g)].map((t=>t[1])),p=Object.fromEntries(Object.entries(i).filter((([t])=>!r.includes(t)))),s=/:address[^A-Z]/.test(t)||"address"in p,l=/:collection[^A-Z]/.test(t)||"collection"in p;if(s){const t=i.address;if(!a(t))throw new y(t)}if(l){const t=i.collection;if(Array.isArray(t)?t.some((t=>!d(t))):!d(t))throw new c(t)}const q=Object.fromEntries(Object.entries(p).map((([t,e])=>[t,"filter"===t?JSON.stringify(e):Array.isArray(e)?e.join(","):e]))),{body:v,auth:b,...f}=q,A=v?JSON.stringify(v):void 0,g=b?`Bearer ${b}`:void 0;return o.fetchWithTimeout(n,{...e,params:f,body:A,headers:{...e.headers,...g?{Authorization:g}:{}}})},s=(t={})=>p(t);for(const t of Object.keys(r))q.includes(t)&&(s[t]=e=>p({...e,method:e.method??t.toUpperCase()}));return s}module.exports=e})();
|
package/dist/index.d.ts
CHANGED
package/dist/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var t,e,a,i,r,n,s,o,c,l,d,h,u,g,f,T,p,m,E,w,y,S,A,q={d:(t,e)=>{for(var a in e)q.o(e,a)&&!q.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},C={};q.d(C,{TR:()=>g,$C:()=>d,Yo:()=>m,LU:()=>l,sW:()=>B,X$:()=>at,JA:()=>u,he:()=>h,cO:()=>o,t7:()=>n,MD:()=>ct,Gq:()=>i,vY:()=>$,Pz:()=>L,h4:()=>e,wT:()=>c,JM:()=>s,Ow:()=>A,Vx:()=>E,O8:()=>t,s0:()=>nt,o:()=>f,p4:()=>V,AQ:()=>T,J1:()=>w,g6:()=>a,cB:()=>p,Gt:()=>ot,iE:()=>y,I_:()=>r,ZU:()=>S,Us:()=>st,GW:()=>G,L_:()=>v,t8:()=>U,Gm:()=>P,tN:()=>M,br:()=>W,Ld:()=>R,PG:()=>X,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"}(a||(a={})),function(t){t.EndingLate="startTime desc",t.EndingSoon="startTime asc"}(i||(i={})),function(t){t.TotalVolumeHighToLow="statistics/tradeData/totalEgldVolume desc",t.FollowersHighToLow="statistics/other/followCount desc",t.IsVerifiedTrueToFalse="isVerified desc",t.HasImageTrueToFalse="profile desc",t.HasBannerTrueToFalse="banner desc"}(r||(r={})),function(t){t.WeekVolumeHighToLow="statistics.tradeData.weekEgldVolume desc",t.WeekVolumeLowToHigh="statistics.tradeData.weekEgldVolume asc",t.DailyVolumeHighToLow="statistics.tradeData.dayEgldVolume desc",t.DailyVolumeLowToHigh="statistics.tradeData.dayEgldVolume asc",t.TotalVolumeHighToLow="statistics.tradeData.totalEgldVolume desc",t.TotalVolumeLowToHigh="statistics.tradeData.totalEgldVolume asc",t.AvgVolumePriceHighToLow="statistics.tradeData.averageEgldPrice desc",t.AvgVolumePriceLowToHigh="statistics.tradeData.averageEgldPrice asc",t.ATHHighToLow="statistics.tradeData.athEgldPrice desc",t.ATHLowToHigh="statistics.tradeData.athEgldPrice asc",t.TotalTradesHighToLow="statistics.tradeData.totalTrades desc",t.TotalTradesLowToHigh="statistics.tradeData.totalTrades asc",t.SupplyHighToLow="statistics.other.nftCount desc",t.SupplyLowToHigh="statistics.other.nftCount asc",t.FollowersHighToLow="statistics.other.followCount desc",t.FollowersLowToHigh="statistics.other.followCount asc"}(n||(n={})),function(t){t.PriceHighToLow="priceShort desc",t.PriceLowToHigh="priceShort asc",t.OfferIdHighToLow="offerIddesc",t.OfferIdLowToHigh="offerId asc",t.RecentListed="timestamp desc",t.OldestListed="timestamp asc"}(s||(s={})),function(t){t.Profile="profile",t.Description="description",t.Creator="creator",t.Owner="owner",t.Socials="socials",t.Type="type",t.HasStaking="hasStaking",t.Name="name",t.Banner="banner",t.IsVerified="isVerified",t.IsMintable="isMintable",t.Statistics="statistics",t.Collection="collection"}(o||(o={})),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"}(u||(u={})),function(t){t.MVX="MVX",t.SUI="SUI"}(g||(g={})),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"}(f||(f={})),function(t){t.PriceHighToLow="activityData.egldValue desc",t.PriceLowToHigh="activityData.egldValue asc",t.RecentPlaced="timestamp desc",t.OldestPlaced="timestamp asc"}(T||(T={})),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"}(p||(p={})),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"}(E||(E={})),function(t){t.Duo="Duo",t.Single="Single",t.Perk="Perk"}(w||(w={})),function(t){t.Staked="staked",t.Unbounding="unstaked",t.Available="available"}(y||(y={})),function(t){t.NonFungibleESDT="NonFungibleESDT"}(S||(S={})),function(t){t.FESTIVAL="festival",t.CONFERENCE="conference",t.NETWORKING="networking",t.MEETUP="meetup",t.WEB3="web3",t.ENTERTAINMENT="entertainment"}(A||(A={}));const v=Object.values(A);var D,I,k,N,_,O;!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"}(D||(D={})),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"}(k||(k={})),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"}(N||(N={})),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"}(O||(O={}));const M={festival:Object.values(D),conference:Object.values(I),networking:Object.values(k),meetup:Object.values(N),web3:Object.values(_),entertainment:Object.values(O)};async function W(){return v}async function R(t){return M[t]}var L,$;!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"}($||($={}));const P=Object.values(L),U=Object.values($);var V;!function(t){t.Received="received",t.Placed="placed"}(V||(V={}));const F="https://api.xoxno.com",b="erd1qqqqqqqqqqqqqpgq705fxpfrjne0tl3ece0rrspykq88mynn4kxs2cg43s",x="erd1qqqqqqqqqqqqqpgqd9rvv2n378e27jcts8vfwynpx0gfl5ufz6hqhfy0u0",H="erd1qqqqqqqqqqqqqpgq8xwzu82v8ex3h4ayl5lsvxqxnhecpwyvwe0sf2qj4e";var B;!function(t){t.MAINNET="1",t.DEVNET="D"}(B||(B={}));class G{static instance;apiUrl;apiKey;chain;config;constructor(t=F,e="",a){this.apiUrl=t,this.apiKey=e,this.chain=a,this.config=a==B.MAINNET?{mediaUrl:"https://media.xoxno.com",gatewayUrl:"https://gateway.xoxno.com",XO_SC:"erd1qqqqqqqqqqqqqpgq6wegs2xkypfpync8mn2sa5cmpqjlvrhwz5nqgepyg8",FM_SC:b,DR_SC:x,KG_SC:H,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:b,DR_SC:x,KG_SC:H,Staking_SC:"erd1qqqqqqqqqqqqqpgqsc5hnewwpep8qq0d7kjjzrquapuucrygah0s85zres",Manager_SC:"erd1qqqqqqqqqqqqqpgqluclyhfsa2uw7q9cjwd8knk989hg57u8ah0slq2nlr",P2P_SC:"erd1qqqqqqqqqqqqqpgqfja7ukpngrun78ueq583l0vd6aj4ekhrah0sa9wyrv"}}static init({apiUrl:t=F,apiKey:e="",chain:a=B.MAINNET}={}){if(null==G.instance||null==G.instance){if(a==B.DEVNET)return G.instance=new G(t??"https://devnet-api.xoxno.com",e,a),G.instance;G.instance=new G(t,e,a)}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 a=e?.headers?.Authorization,i="Bearer undefined"===a?void 0:a,r={"Accept-Encoding":"gzip,deflate,br",Referer:"https://xoxno.sdk","User-Agent":"XOXNO/1.0/SDK",..."POST"===e.method?{"Content-Type":"application/json"}:{},...i?{Authorization:i}:{}},n=`${"string"==typeof t&&t.startsWith("/")?`${this.apiUrl}${t}`:t}${e.params?"?"+Object.entries(e.params).flatMap((([t,e])=>Array.isArray(e)?e.map((e=>`${t}=${encodeURIComponent(e)}`)):`${t}=${encodeURIComponent(e)}`)).join("&"):""}`,s=await fetch(n,{...e,cache:"no-store",...Object.keys(r).length?{headers:r}:{},method:e.method??"GET"});if(!s.ok){const e=await s.text();let a;try{a=JSON.parse(e)}catch(t){a={message:e}}throw new Error(`${t}: ${s.status};${s.statusText};${a.message}`)}return s.json()}}class j extends Error{constructor(t){super(`Invalid collection ticker: ${t}`)}}class z extends Error{constructor(t){super(`Invalid address: ${t}`)}}class K extends Error{constructor(t){super(`Invalid NFT identifier: ${t}`)}}class Y extends Error{constructor(t){super(`Top cannot be greater than 100, found ${t}`)}}const X=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)),a=/^[A-Z0-9]{3,10}-[a-z0-9]{6}$/.test(t);return e||a},J=t=>{const e=/^0x[a-fA-F0-9]{1,64}$/.test(t),a=/^[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||a};function Z(t,e){if(!X(t))throw new j(t);return e}function Q(t,e){if(!X(t))throw new z(t);return e}function tt(t){return Z(t,Promise.resolve())}function et(t,e){if(t.top&&t.top>100)throw new Y(t.top);return e(JSON.stringify(t))}class at{api;constructor(){this.api=G.getInstance()}getCollectionProfile=async t=>Z(t,this.api.fetchWithTimeout(`/collection/${t}/profile`));getCollectionFloorPrice=async(t,e="EGLD")=>Z(t,this.api.fetchWithTimeout(`/collection/${t}/floor-price`,{params:{token:e}}));getCollectionAttributes=async t=>Z(t,this.api.fetchWithTimeout(`/collection/${t}/attributes`));getNFTs=async t=>(t.filters.collection?.forEach((t=>{tt(t)})),et(t,(t=>this.api.fetchWithTimeout("/nft/query",{params:{filter:t}}))));getSearchNFTs=async t=>(t.filters.collection?.forEach((t=>{tt(t)})),et(t,(t=>this.api.fetchWithTimeout("/nft/search/query",{params:{filter:t}}))));suggestCollections=async t=>et(t,(t=>this.api.fetchWithTimeout("/collection/search",{params:{filter:t}})));collectionListingsAnalytics=async t=>await this.api.fetchWithTimeout(`/collection/${t}/listings`);getOffers=async t=>et(t,(t=>this.api.fetchWithTimeout("/nft/offer/query",{params:{filter:t}})));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"]},a=await this.api.fetchWithTimeout("/collection/query",{params:{filter:JSON.stringify(e)}});return{results:a,count:a.length,hasMoreResults:a.length>=(t?.top||25)}};getGlobalOffers=async t=>et(t,(t=>this.api.fetchWithTimeout("/collection/global-offer/query",{params:{filter:t}})));getCollectionVolume=async(t,e,a,i)=>{if(!X(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/analytics/volume?startTime=${e}&endTime=${a}&bin=${i}`)};getMarketplaceVolume=async(t,e,a,i)=>await this.api.fetchWithTimeout(`/analytics/volume?startTime=${t}&endTime=${e}&bin=${a}${i?.length?i.map((t=>`&chain=${t}`)).join(""):""}`);getCollectionOwners=async t=>{if(!X(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/holders`)};getExportOwners=async t=>{if(!X(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/holders?exportHolders=true`)};getCollectionsStatistics=async t=>et(t,(t=>this.api.fetchWithTimeout("/collection/stats/query",{params:{filter:t}})));getCollectionStats=async t=>{if(!X(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/stats`)};getAwaitEmpty=async t=>new Promise((e=>{setTimeout((()=>{e(!0)}),t)}));getCollectionMintInfo=async({ticker:t,extra:e})=>{if(!X(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/drop-info`,e)};getCollectionRanks=async({ticker:t,extra:e})=>{if(!X(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/ranks`,e)};getDropInfo=async({collectionTag:t,creatorTag:e,extra:a})=>await this.api.fetchWithTimeout(`/collection/${e}/${t}/drop-info`,a);getCollectionGraphData=async(t,e,a,i)=>{if(!X(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/collection/${t}/analytics/volume`,{params:{startTime:e,endTime:a,bin:i}})};getPinnedCollections=async t=>await this.api.fetchWithTimeout("/collection/pinned"+(t?`?chain=${t}`:""));getPinnedDrops=async t=>await this.api.fetchWithTimeout("/collection/pinned-drops"+(t?`?chain=${t}`:""));getSearchDrops=async t=>et(t,(t=>this.api.fetchWithTimeout("/collection/drops/search",{params:{filter:t}})));getDrops=async t=>(t.filters.collection?.forEach((t=>{tt(t)})),et(t,(t=>this.api.fetchWithTimeout("/collection/drops/query",{params:{filter:t}}))));getCollectionStakingSummary=async({collection:t,extra:e})=>{if(!X(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(!X(t))throw new Error("Invalid collection ticker: "+t)})),await this.api.fetchWithTimeout("/collection/floor-price",{params:{collection:t.join(",")}}))}const it=t=>{let e=t.toString(16);return e.length%2!=0&&(e="0"+e),e},rt=t=>!!t&&(t.includes("erd1")&&62===t.length||/^0x[a-fA-F0-9]{64}$/.test(t));class nt{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({identifier:t,...e})=>function(t,e){if(!J(t))throw new K(t);return e}(t,et(e,(()=>this.api.fetchWithTimeout(`/nft/${t}/offers`,{params:e}))));getNFTByCollectionAndNonce=async(t,e)=>{if(!X(t))throw new Error("Invalid collection ticker: "+t);const a=await this.api.fetchWithTimeout(`/${((t,e)=>[t,it(e)].join("-"))(t,e)}`);return a};getDailyTrending=async()=>await this.api.fetchWithTimeout("/nfts/getDailyTrending");getPinnedNFTs=async t=>await this.api.fetchWithTimeout("/nft/pinned"+(t?`?chain=${t}`:""));getNFTByCollectionAndNonceHex=async(t,e)=>{if(!X(t))throw new Error("Invalid collection ticker: "+t);return e.length%2!=0&&(e="0"+e),await this.api.fetchWithTimeout(`/${[t,e].join("-")}`)}}class st{api;collection;constructor(){this.api=G.getInstance(),this.collection=new at}getUserProfile=async t=>{if(!rt(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(!rt(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/network-account`)};getUserTokenInventory=async t=>{if(!rt(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/token-inventory`)};getUserSummaryInventory=async(t,e=!0)=>{if(!rt(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({identifier:t,...e})=>Q(t,et(e,(()=>this.api.fetchWithTimeout(`/user/${t}/offers`,{params:e}))));suggestUsers=async t=>et(t,(t=>this.api.fetchWithTimeout("/user/search",{params:{filter:t}})));getUserCreatorProfile=async t=>{if(!rt(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/creator/profile`)};getCreatorListings=async t=>{if(!rt(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/creator/listing`)};getCreatorEvents=async(t,e)=>{if(!rt(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/creator/events`,{...e})};getUserStakingSummary=async t=>{if(!rt(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/summary`)};getUserStakingAailable=async t=>{if(!rt(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/available-pools`)};getUserCreatorInfo=async(t,e)=>{if(!rt(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/creator/details`,{...e})};getUserCollectionStaking=async(t,e)=>{if(!rt(t))throw new Error("Invalid address:"+t);if(!X(e))throw new Error("Invalid collection ticker: "+e);return await this.api.fetchWithTimeout(`/user/${t}/staking/collection/${e}`)};getUserPoolStaking=async(t,e,a)=>{if(!rt(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/pool/${e}/nfts?status=${a}`)};getOwnedPoolsByAddress=async t=>{if(!rt(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/owned-pools`)};getUserAnalyticsSummary=async t=>{if(!rt(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/analytics/volume`)};getUserFavoriteNFTs=async({identifier:t,...e})=>Q(t,et(e,(()=>this.api.fetchWithTimeout(`/user/${t}/favorite/nfts`,{params:e}))));getUserFavoriteCollectionTickers=async t=>{if(!rt(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:a,orderDirection:i})=>{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:a,orderDirection:i??"desc"}})};getStakingCreatorInfo=async t=>{if(!rt(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/creator`)};getUsersDrop=async({top:t,skip:e,address:a})=>{if(t&&t>35)throw new Error("Top cannot be greater than 100");if(a&&!rt(a))throw new Error("Invalid address:"+a);return await this.api.fetchWithTimeout("/user/xoxno-drop",{params:{top:t,skip:e,...a?{address:a}:{}}})};getUserOwnerCollections=async t=>{if(!rt(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/user/${t}/staking/owned-collections`)};getRoyaltiesSharesCreator=async t=>{if(!rt(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/launchpad/${t}/shareholders/royalties`)};getMintSharesCreator=async(t,e)=>{if(!rt(t))throw new Error("Invalid address:"+t);return await this.api.fetchWithTimeout(`/launchpad/${t}/shareholders/collection/${e}`)}}class ot{api;constructor(){this.api=G.getInstance()}getPoolDetails=async t=>await this.api.fetchWithTimeout(`/pool/${t}/profile`)}class ct{api;constructor(){this.api=G.getInstance()}getTokensUsdPrice=async()=>await this.api.fetchWithTimeout("/tokens/usd-price");getAshSwapAmount=async({originalToken:t,originalTokenValue:e,paymentToken:a})=>await this.api.fetchWithTimeout("/ash/min-token-quantity",{params:{originalToken:t,originalTokenValue:e,paymentToken:a}});getFungibleTokens=async(t=[d.ALL],e,a)=>{let i={};return e&&(i={identifier:e.join(",")}),t&&(i={...i,category:t.join(",")}),a&&(i={...i,chain:a.join(",")}),await this.api.fetchWithTimeout("/tokens",{params:i})};getAnalyticsOverview=async t=>await this.api.fetchWithTimeout(`/analytics/overview${t?.length?t.map(((t,e)=>`${e?"&":"?"}chain=${t}`)).join(""):""}`);suggestResults=async t=>et(t,(t=>this.api.fetchWithTimeout("/search",{params:{filter:t}})));getExploreStaking=async()=>await this.api.fetchWithTimeout("/collection/staking/explore");getTradingActivity=async t=>et(t,(t=>this.api.fetchWithTimeout("/activity/query",{params:{filter:t}})))}var lt=C.TR,dt=C.$C,ht=C.Yo,ut=C.LU,gt=C.sW,ft=C.X$,Tt=C.JA,pt=C.he,mt=C.cO,Et=C.t7,wt=C.MD,yt=C.Gq,St=C.vY,At=C.Pz,qt=C.h4,Ct=C.wT,vt=C.JM,Dt=C.Ow,It=C.Vx,kt=C.O8,Nt=C.s0,_t=C.o,Ot=C.p4,Mt=C.AQ,Wt=C.J1,Rt=C.g6,Lt=C.cB,$t=C.Gt,Pt=C.iE,Ut=C.I_,Vt=C.ZU,Ft=C.Us,bt=C.GW,xt=C.L_,Ht=C.t8,Bt=C.Gm,Gt=C.tN,jt=C.br,zt=C.Ld,Kt=C.PG,Yt=C.y_;export{lt as ActivityChain,dt as AssetCategory,ht as AuctionType,ut as AuctionTypes,gt as Chain,ft as CollectionModule,Tt as CollectionStatsOrderBy,pt as CollectionStatsSelectFields,mt as CollectionsFieldsToSelect,Et as CollectionsOrderBy,wt as CommonModule,yt as DropsOderBy,St as EventUserRolePermission,At as EventUserRoles,qt as FieldsToSelect,Ct as GlobalOfferFieldsToSelect,vt as GlobalOfferOrderBy,Dt as IEventCategory,It as IssuingType,kt as Marketplace,Nt as NFTModule,_t as NftActivityType,Ot as OfferType,Mt as OrderByTradingActivity,Wt as PoolType,Rt as SearchOrderBy,Lt as SelectFieldsTradingActivity,$t as StakingModule,Pt as StakingStatus,Ut as SuggestOrderBy,Vt as Type,Ft as UserModule,bt as XOXNOClient,xt as eventCategories,Ht as eventPermissions,Bt as eventRoles,Gt as eventSubCategories,jt as getEventCategories,zt as getEventSubCategories,Kt as isValidCollectionTicker,Yt as isValidNftIdentifier};
|
|
1
|
+
var t={d:(e,u)=>{for(var o in u)t.o(u,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:u[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{GW:()=>p,bn:()=>A,PG:()=>d,y_:()=>s});const u="https://api.xoxno.com",o="erd1qqqqqqqqqqqqqpgq705fxpfrjne0tl3ece0rrspykq88mynn4kxs2cg43s",i="erd1qqqqqqqqqqqqqpgqd9rvv2n378e27jcts8vfwynpx0gfl5ufz6hqhfy0u0",n="erd1qqqqqqqqqqqqqpgq8xwzu82v8ex3h4ayl5lsvxqxnhecpwyvwe0sf2qj4e";var r;!function(t){t.MAINNET="1",t.DEVNET="D"}(r||(r={}));class p{static instance;apiUrl;apiKey;chain;config;constructor(t=u,e="",p){this.apiUrl=t,this.apiKey=e,this.chain=p,this.config=p==r.MAINNET?{mediaUrl:"https://media.xoxno.com",gatewayUrl:"https://gateway.xoxno.com",XO_SC:"erd1qqqqqqqqqqqqqpgq6wegs2xkypfpync8mn2sa5cmpqjlvrhwz5nqgepyg8",FM_SC:o,DR_SC:i,KG_SC:n,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:o,DR_SC:i,KG_SC:n,Staking_SC:"erd1qqqqqqqqqqqqqpgqsc5hnewwpep8qq0d7kjjzrquapuucrygah0s85zres",Manager_SC:"erd1qqqqqqqqqqqqqpgqluclyhfsa2uw7q9cjwd8knk989hg57u8ah0slq2nlr",P2P_SC:"erd1qqqqqqqqqqqqqpgqfja7ukpngrun78ueq583l0vd6aj4ekhrah0sa9wyrv"}}static init({apiUrl:t=u,apiKey:e="",chain:o=r.MAINNET}={}){if(null==p.instance||null==p.instance){if(o==r.DEVNET)return p.instance=new p(t??"https://devnet-api.xoxno.com",e,o),p.instance;p.instance=new p(t,e,o)}return p.instance}static getInstance(){if(null==p.instance||null==p.instance)throw new Error("XOXNOClient is not initialized");return p.instance}fetchWithTimeout=async(t,{params:e,...u}={})=>{const o=u?.headers?.Authorization,i="Bearer undefined"===o?void 0:o,n={...u.headers,Referer:"https://xoxno.sdk","User-Agent":"XOXNO/1.0/SDK",..."PUT"===u.method?{}:{"Content-Type":"application/json"},...i?{Authorization:i}:{}},r=`${"string"==typeof t&&t.startsWith("/")?`${this.apiUrl}${t}`:t}${e?"?"+Object.entries(e).flatMap((([t,e])=>Array.isArray(e)?e.map((e=>`${t}=${encodeURIComponent(e)}`)):`${t}=${encodeURIComponent(e)}`)).join("&"):""}`,p={...u,...Object.keys(n).length?{headers:n}:{},method:u.method??"GET"},d=await fetch(r,p);if(!d.ok){const e=await d.text();let u;try{u=JSON.parse(e)}catch(t){u={message:e}}throw new Error(`${t}: ${d.status};${d.statusText};${u.message}`)}return"application/json"===d.headers.get("Content-Type")?d.json():d.text()}}const d=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)),u=/^[A-Z0-9]{3,10}-[a-z0-9]{6}$/.test(t);return e||u},s=t=>{const e=/^0x[a-fA-F0-9]{1,64}$/.test(t),u=/^[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||u};class c extends Error{constructor(t){super(`Invalid collection ticker: ${t}`)}}class y extends Error{constructor(t){super(`Invalid address: ${t}`)}}Error,Error;const a=t=>!!t&&(t.includes("erd1")&&62===t.length||/^0x[a-fA-F0-9]{64}$/.test(t)),l={"/user/login":{input:{},output:{},POST:{input:{},output:{},body:{}}},"/user/:address/network-account":{input:{},output:{}},"/user/:address/token-inventory":{input:{},output:{}},"/user/network-account":{input:{},output:{},POST:{input:{},output:{},body:{}}},"/user/me/profile":{input:{},output:{},securityMode:"requiredAny"},"/user/:address/profile":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/me":{input:{},output:{},securityMode:"requiredAny"},"/user/me/settings":{input:{},output:{},securityMode:"requiredAny"},"/user/me/settings/notification-preferences":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/me/settings/email":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"},DELETE:{input:{},output:{},body:{},securityMode:"requiredJwt"}},"/user/me/settings/phone":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/me/settings/billing":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/me/settings/verify-email":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/buy/signature":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/upload-picture":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/upload-banner":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/reset-picture":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/reset-banner":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:tag/creator/is-registered":{input:{},output:{}},"/user/:address/creator/profile":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/creator/upload-picture":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/creator/upload-banner":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/creator/reset-picture":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/creator/reset-banner":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/favorite/collections":{input:{},output:{}},"/user/favorite/:favoriteId":{input:{},output:{},securityMode:"requiredAny"},"/user/:address/follow":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/favorite/users":{input:{},output:{}},"/tokens":{input:{},output:{}},"/tokens/swap":{input:{},output:{}},"/tokens/usd-price":{input:{},output:{}},"/tokens/egld/fiat-price":{input:{},output:{}},"/tokens/xoxno":{input:{},output:{}},"/tokens/egld":{input:{},output:{}},"/tokens/sui":{input:{},output:{}},"/tokens/xoxno/info":{input:{},output:{}},"/tokens/xoxno/liquid":{input:{},output:{}},"/liquid/xoxno/stats":{input:{},output:{}},"/liquid/egld/stats":{input:{},output:{}},"/liquid/xoxno/rate":{input:{},output:{}},"/liquid/xoxno/liquid-supply":{input:{},output:{}},"/liquid/xoxno/staked":{input:{},output:{}},"/analytics/marketplace-unique-users":{input:{},output:{}},"/liquid/egld/rate":{input:{},output:{}},"/liquid/egld/liquid-supply":{input:{},output:{}},"/liquid/egld/staked":{input:{},output:{}},"/liquid/egld/pending-fees":{input:{},output:{}},"/liquid/egld/pending-undelegate":{input:{},output:{}},"/liquid/egld/pending-delegate":{input:{},output:{}},"/liquid/egld/execute-delegate":{input:{},output:{}},"/liquid/egld/execute-undelegate":{input:{},output:{}},"/liquid/egld/protocol-apr":{input:{},output:{}},"/liquid/egld/providers":{input:{},output:{}},"/ash/min-token-quantity":{input:{},output:{}},"/ash/max-token-quantity":{input:{},output:{}},"/arda/max-token-quantity":{input:{},output:{}},"/arda/min-token-quantity":{input:{},output:{}},"/lending/market/:token/profile":{input:{},output:{}},"/lending/market/query":{input:{},output:{}},"/user/lending/:address":{input:{},output:{}},"/lending/market/indexes":{input:{},output:{}},"/user/lending/position/:identifier":{input:{},output:{}},"/user/lending/image/:nonce":{input:{},output:{}},"/lending/market/emode-categories":{input:{},output:{}},"/lending/market/:token/emode-categories":{input:{},output:{}},"/lending/market/:token/analytics":{input:{},output:{}},"/lending/leaderboard":{input:{},output:{}},"/lending/stats":{input:{},output:{}},"/lending/market/prices":{input:{},output:{}},"/nft/query":{input:{},output:{}},"/nft/:identifier/like":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/inventory-summary":{input:{},output:{}},"/user/:address/offers":{input:{},output:{}},"/nft/offer/query":{input:{},output:{}},"/nft/offer/:identifier":{input:{},output:{}},"/user/:address/favorite/nfts":{input:{},output:{}},"/collection/:collection/attributes":{input:{},output:{}},"/nft/:identifier/offers":{input:{},output:{}},"/collection/:collection/ranks":{input:{},output:{}},"/collection/:collection/listings":{input:{},output:{}},"/nft/pinned":{input:{},output:{}},"/nft/sign-withdraw":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/collection/:collection/sign-offer":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/collection/:collection/sign-mint":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/nft/:identifier":{input:{},output:{}},"/collection/:collection/profile":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/collection/:collection/floor-price":{input:{},output:{}},"/collection/floor-price":{input:{},output:{}},"/collection/pinned":{input:{},output:{}},"/collection/pinned-drops":{input:{},output:{}},"/collection/:collection/pinned-drops":{input:{},output:{}},"/collection/:collection/pinned":{input:{},output:{}},"/collection/:collection/follow":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/collection/query":{input:{},output:{}},"/collection/drops/query":{input:{},output:{}},"/collection/:collection/drop-info":{input:{},output:{},securityMode:"optionalAny"},"/collection/:creatorTag/:collectionTag/drop-info":{input:{},output:{},securityMode:"optionalAny"},"/collection/:collection/upload-picture":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/collection/:collection/upload-banner":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/collection/:collection/reset-picture":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/collection/:collection/reset-banner":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/collection/:collection/holders":{input:{},output:{}},"/collection/:collection/owner":{input:{},output:{}},"/collection/:collection/stats":{input:{},output:{}},"/collection/stats/query":{input:{},output:{}},"/collection/global-offer/query":{input:{},output:{}},"/user/:address/creator/listing":{input:{},output:{}},"/user/:address/creator/details":{input:{},output:{}},"/pool/:poolId/profile":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/pool/:poolId/whitelist":{input:{},output:{}},"/pool/:poolId/upload-picture":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/staking/available-pools":{input:{},output:{}},"/user/:address/staking/owned-collections":{input:{},output:{}},"/user/:address/staking/owned-pools":{input:{},output:{}},"/user/:address/staking/summary":{input:{},output:{}},"/user/:address/staking/creator":{input:{},output:{}},"/user/:address/staking/collection/:collection":{input:{},output:{}},"/user/:address/staking/pool/:poolId/nfts":{input:{},output:{}},"/collection/:collection/staking/summary":{input:{},output:{},securityMode:"optionalAny"},"/collection/:collection/staking/delegators":{input:{},output:{}},"/collection/staking/explore":{input:{},output:{}},"/user/:creatorTag/owned-services":{input:{},output:{}},"/search":{input:{},output:{}},"/user/search":{input:{},output:{}},"/collection/search":{input:{},output:{}},"/collection/drops/search":{input:{},output:{}},"/nft/search/query":{input:{},output:{}},"/user/notifications":{input:{},output:{},securityMode:"requiredAny"},"/user/notifications/unread-count":{input:{},output:{},securityMode:"requiredAny"},"/user/notifications/clear":{input:{},output:{},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/notifications/read":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/mobile/device/register":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredWeb2"}},"/mobile/device/:deviceId":{input:{},output:{},securityMode:"requiredWeb2",DELETE:{input:{},output:{},body:{},securityMode:"requiredWeb2"}},"/mobile/history":{input:{},output:{},securityMode:"requiredAny"},"/mobile/history/unread-count":{input:{},output:{},securityMode:"requiredAny"},"/mobile/history/:notificationId/read":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/mobile/history/read-all":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/mobile/history/clear-all":{input:{},output:{},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/eventNotifications/event/:eventId/update":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/eventNotifications/event/:eventId/reminder":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/eventNotifications/creator/marketing":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/eventNotifications/user/:userId/direct":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/native-token":{input:{},output:{}},"/user/web2":{input:{},output:{},securityMode:"requiredWeb2"},"/user/web2/session-cookie":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredWeb2"}},"/user/web2/wallet":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredWeb2"}},"/user/web2/wallet-switch":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredWeb2"}},"/user/web2/wallet-link":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredWeb2"}},"/user/web2/:index/wallet-link":{input:{},output:{},DELETE:{input:{},output:{},body:{},securityMode:"requiredWeb2"}},"/user/web2/shards":{input:{},output:{},securityMode:"requiredWeb2"},"/lending/market-sc":{input:{},output:{}},"/lending/market/:token/price/egld":{input:{},output:{}},"/faucet":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/activity/query":{input:{},output:{}},"/activity/:identifier":{input:{},output:{}},"/analytics/volume":{input:{},output:{}},"/collection/:collection/analytics/volume":{input:{},output:{}},"/user/:address/analytics/volume":{input:{},output:{}},"/analytics/overview":{input:{},output:{}},"/user/stats":{input:{},output:{}},"/user/xoxno-drop":{input:{},output:{}},"/user/me/xoxno-drop":{input:{},output:{},securityMode:"requiredAny"},"/transactions/:txHash/status":{input:{},output:{}},"/transactions":{input:{},output:{},POST:{input:{},output:{},body:{}}},"/transactions/batch":{input:{},output:{},POST:{input:{},output:{},body:{}}},"/user/chat/message":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/chat/conversation":{input:{},output:{},securityMode:"requiredAny"},"/user/chat/conversation/:conversationId":{input:{},output:{},securityMode:"requiredAny",DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/chat/conversation-summary":{input:{},output:{},securityMode:"requiredAny"},"/user/chat/conversation/:conversationId/message/:messageId":{input:{},output:{},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/chat/block":{input:{},output:{},securityMode:"requiredAny"},"/user/chat/block/:address":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/chat/token":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/countries":{input:{},output:{}},"/event":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId":{input:{},output:{},securityMode:"optionalAny",PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/profile/query":{input:{},output:{}},"/event/:eventId/profile":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/background":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/description":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/description/image":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/description/image/:imageId":{input:{},output:{},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/register":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/ticket":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/ticket/:ticketId":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/ticket/:ticketId/profile":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/stage":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/stage/:stageId":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/calculate-prices":{input:{},output:{},POST:{input:{},output:{},body:{}}},"/event/:eventId/validate-discount":{input:{},output:{},POST:{input:{},output:{},body:{}}},"/user/:address/creator/events":{input:{},output:{},securityMode:"optionalAny"},"/event/:eventId/invite":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/invite/query":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/invite/:inviteId":{input:{},output:{}},"/event/:eventId/voucher/query":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/questions":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/question":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/question/:questionId":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/invite/:inviteId/claim":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/invite/:inviteId/cancel":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/guest/query":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/guest/:address":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/guest-export":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/role":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"},securityMode:"requiredAny"},"/event/:eventId/role/:address":{input:{},output:{},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"},securityMode:"requiredAny"},"/event/:eventId/guest":{input:{},output:{},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/role/:roleId/accept":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/roleId/:roleId":{input:{},output:{}},"/user/me/event":{input:{},output:{},securityMode:"requiredAny"},"/user/me/events/past":{input:{},output:{},securityMode:"requiredAny"},"/user/me/events/hosted":{input:{},output:{},securityMode:"requiredAny"},"/user/me/events/upcoming":{input:{},output:{},securityMode:"requiredAny"},"/user/me/event/badge":{input:{},output:{},securityMode:"requiredAny"},"/user/me/event/badge/payload":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/scan":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/voucher":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/voucher/:voucherCode":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/manual-check-in":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/guest/:guestId/answered-questions":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/guest/approve":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/ticket/:ticketId/google/class":{input:{},output:{},POST:{input:{},output:{},body:{}}},"/event/:eventId/guest/:address/google/pass":{input:{},output:{}},"/event/profile/location":{input:{},output:{}},"/event/:eventId/referral-config":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/referral-config/:configId":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/referral-configs":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/referral":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/referral/:referralCode":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/referrals":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/referrals/self-serviced":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/notify-attendees":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/notify/global-broadcast":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}}},q=["PATCH","POST","DELETE","PUT"],v=t=>t.replace(/-([a-z])/g,((t,e)=>e.toUpperCase())),b=()=>({static:{},params:{},leaves:[]});function A(t){const e=function(){const t=b();for(const[e,u]of Object.entries(l)){const o=e.split("/").filter(Boolean);let i=t;for(const t of o)if(t.startsWith(":")){const e=v(t.slice(1));i=i.params[e]||=b()}else{const e=v(t);i=i.static[e]||=b()}i.leaves.push({rawPath:e,def:u})}return t}(),u=(e,o)=>{const i={};for(const{rawPath:u,def:n}of e.leaves){const e=v(u.split("/").pop().replace(/^:/,"")),r=f(u,n,o,t);i[e]=r}for(const[t,n]of Object.entries(e.static)){const e=u(n,o);let r=e;if(e&&"object"==typeof e&&t in e&&"function"==typeof e[t]){const u=e[t],o=Object.fromEntries(Object.entries(e).filter((([e])=>e!==t)));1===u.length||(Object.assign(u,o),r=u)}void 0===i[t]?i[t]=r:"function"==typeof i[t]?Object.assign(i[t],r):"function"==typeof r?(Object.assign(r,i[t]),i[t]=r):Object.assign(i[t],r)}for(const[t,n]of Object.entries(e.params)){const e=e=>{const i=u(n,{...o,[t]:e});if(i&&"object"==typeof i&&1===Object.keys(i).length&&t in i&&"function"==typeof i[t]){const e=i[t],u=(...t)=>e(...t);return Object.assign(u,e),u}return i};if(i[t]){const u=i[t];i[t]=t=>({...u(t),...e(t)})}else i[t]=e}return i};return u(e,{})}function f(t,e,u,o){const{input:i,output:n,...r}=e,p=(e={})=>{const i={...u,...e},n=t.replace(/:([a-zA-Z_]+)/g,((t,e)=>`${i[e]}`)),r=[...t.matchAll(/:([a-zA-Z_]+)/g)].map((t=>t[1])),p=Object.fromEntries(Object.entries(i).filter((([t])=>!r.includes(t)))),s=/:address[^A-Z]/.test(t)||"address"in p,l=/:collection[^A-Z]/.test(t)||"collection"in p;if(s){const t=i.address;if(!a(t))throw new y(t)}if(l){const t=i.collection;if(Array.isArray(t)?t.some((t=>!d(t))):!d(t))throw new c(t)}const q=Object.fromEntries(Object.entries(p).map((([t,e])=>[t,"filter"===t?JSON.stringify(e):Array.isArray(e)?e.join(","):e]))),{body:v,auth:b,...A}=q,f=v?JSON.stringify(v):void 0,g=b?`Bearer ${b}`:void 0;return o.fetchWithTimeout(n,{...e,params:A,body:f,headers:{...e.headers,...g?{Authorization:g}:{}}})},s=(t={})=>p(t);for(const t of Object.keys(r))q.includes(t)&&(s[t]=e=>p({...e,method:e.method??t.toUpperCase()}));return s}var g=e.GW,M=e.bn,T=e.PG,m=e.y_;export{g as XOXNOClient,M as buildSdk,T as isValidCollectionTicker,m as isValidNftIdentifier};
|
|
@@ -1,7 +1,29 @@
|
|
|
1
1
|
import type { IPlainTransactionObject } from '@multiversx/sdk-core/out/interface';
|
|
2
|
-
import type { NftDoc } from '@xoxno/types';
|
|
3
|
-
import type {
|
|
4
|
-
|
|
2
|
+
import type { GlobalOfferDoc, NftDoc } from '@xoxno/types';
|
|
3
|
+
import type { AcceptGlobalOffer, ChangeListing, NewListingArgs, Payment, SendCustomOffer, SendGlobalOffer, WithSenderAndNonce } from './types';
|
|
4
|
+
declare enum AuctionType {
|
|
5
|
+
NftBid = 0,
|
|
6
|
+
Nft = 1,
|
|
7
|
+
SftAll = 2,
|
|
8
|
+
SftOnePerPayment = 3
|
|
9
|
+
}
|
|
10
|
+
interface Auction {
|
|
11
|
+
auctioned_token_type: string;
|
|
12
|
+
auctioned_token_nonce: number;
|
|
13
|
+
nr_auctioned_tokens: number;
|
|
14
|
+
auction_type: AuctionType;
|
|
15
|
+
payment_token_type: string;
|
|
16
|
+
payment_token_nonce: number;
|
|
17
|
+
min_bid: string;
|
|
18
|
+
max_bid: string;
|
|
19
|
+
start_time: number;
|
|
20
|
+
deadline: number;
|
|
21
|
+
original_owner: string;
|
|
22
|
+
current_bid: string;
|
|
23
|
+
current_winner: string;
|
|
24
|
+
marketplace_cut_percentage: string;
|
|
25
|
+
creator_royalties_percentage: string;
|
|
26
|
+
}
|
|
5
27
|
export declare class SCInteraction {
|
|
6
28
|
private xo;
|
|
7
29
|
private api;
|
|
@@ -43,7 +65,7 @@ export declare class SCInteraction {
|
|
|
43
65
|
*
|
|
44
66
|
* @returns An object containing the global offer data for the offer with the given id. If the global offer id is invalid, the return value will be null.
|
|
45
67
|
*/
|
|
46
|
-
getGlobalOfferData: (global_offer_id: number) => Promise<
|
|
68
|
+
getGlobalOfferData: (global_offer_id: number) => Promise<GlobalOfferDoc>;
|
|
47
69
|
/**
|
|
48
70
|
* Returns the auction struct for the given id.
|
|
49
71
|
*
|
|
@@ -253,3 +275,4 @@ export declare class SCInteraction {
|
|
|
253
275
|
changeListing(listings: ChangeListing[], sender: WithSenderAndNonce, marketplace: string): Promise<IPlainTransactionObject>;
|
|
254
276
|
listNFTs(listings: NewListingArgs[], sender: WithSenderAndNonce): Promise<IPlainTransactionObject>;
|
|
255
277
|
}
|
|
278
|
+
export {};
|
|
@@ -1,44 +1,9 @@
|
|
|
1
1
|
import type { BytesValue } from '@multiversx/sdk-core/out/smartcontracts/typesystem/bytes';
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
quantity: number;
|
|
6
|
-
payment_token: string;
|
|
7
|
-
payment_nonce: number;
|
|
8
|
-
price: number;
|
|
9
|
-
timestamp: number;
|
|
10
|
-
owner: string;
|
|
11
|
-
attributes: Array<{
|
|
12
|
-
trait_type: string;
|
|
13
|
-
value: string;
|
|
14
|
-
}>;
|
|
15
|
-
new_version: boolean;
|
|
16
|
-
price_long: string;
|
|
17
|
-
};
|
|
18
|
-
export declare enum AuctionType {
|
|
19
|
-
NftBid = 0,
|
|
20
|
-
Nft = 1,
|
|
21
|
-
SftAll = 2,
|
|
22
|
-
SftOnePerPayment = 3
|
|
23
|
-
}
|
|
24
|
-
export interface Auction {
|
|
25
|
-
auctioned_token_type: string;
|
|
26
|
-
auctioned_token_nonce: number;
|
|
27
|
-
nr_auctioned_tokens: number;
|
|
28
|
-
auction_type: AuctionType;
|
|
29
|
-
payment_token_type: string;
|
|
30
|
-
payment_token_nonce: number;
|
|
31
|
-
min_bid: string;
|
|
32
|
-
max_bid: string;
|
|
33
|
-
start_time: number;
|
|
34
|
-
deadline: number;
|
|
35
|
-
original_owner: string;
|
|
36
|
-
current_bid: string;
|
|
37
|
-
current_winner: string;
|
|
38
|
-
marketplace_cut_percentage: string;
|
|
39
|
-
creator_royalties_percentage: string;
|
|
2
|
+
export interface WithSenderAndNonce {
|
|
3
|
+
address: string;
|
|
4
|
+
nonce?: number;
|
|
40
5
|
}
|
|
41
|
-
|
|
6
|
+
interface NFTBody {
|
|
42
7
|
collection: string;
|
|
43
8
|
nonce: number;
|
|
44
9
|
amount?: number;
|
|
@@ -95,3 +60,4 @@ export interface NewListingArgs {
|
|
|
95
60
|
nonce: number;
|
|
96
61
|
nft_amount: number;
|
|
97
62
|
}
|
|
63
|
+
export {};
|