@xoxno/sdk-js 0.0.5-alpha → 0.0.6-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,59 @@
1
+ import { CollectionsNFTsResponse, GetCollectionsArgs, ICollectionAttributes, ICollectionProfile, SearchNFTsArgs, SearchNFTsResponse } from '../types/collection';
2
+ import { TradincActivityArgs, TradingActivityResponse } from '../types/trading';
3
+ /**
4
+ * CollectionModule provides a set of methods to interact with NFT collections.
5
+ * It includes methods for getting collection profile information, floor price,
6
+ * collection attributes, and searching NFTs within a collection.
7
+ *
8
+ * @example
9
+ * const xoxno = new XOXNO({ apiURL: 'https://api.xoxno.com', apiKey: 'your-api-key' });
10
+ * const collectionModule = xoxno.collection;
11
+ */
12
+ export declare class CollectionModule {
13
+ private api;
14
+ constructor();
15
+ /**
16
+ * Fetches the profile of a collection.
17
+ * @param collection - The ticker of the collection.
18
+ * @returns A Promise that resolves to the ICollectionProfile object.
19
+ * @throws An error if the provided collection ticker is invalid.
20
+ */
21
+ getCollectionProfile: (collection: string) => Promise<ICollectionProfile>;
22
+ /**
23
+ * Fetches the floor price of a collection.
24
+ * @param collection - The ticker of the collection.
25
+ * @param token - The token for the floor price calculation (default: 'EGLD').
26
+ * @returns A Promise that resolves to the collection's floor price as a number.
27
+ * @throws An error if the provided collection ticker is invalid.
28
+ */
29
+ getCollectionFloorPrice: (collection: string, token?: string) => Promise<number>;
30
+ /**
31
+ * Fetches the attributes of a collection.
32
+ * @param collection - The ticker of the collection.
33
+ * @returns A Promise that resolves to the ICollectionAttributes object.
34
+ * @throws An error if the provided collection ticker is invalid.
35
+ */
36
+ getCollectionAttributes: (collection: string) => Promise<ICollectionAttributes>;
37
+ /**
38
+ * Searches for NFTs in a collection based on the provided arguments.
39
+ * @param {SearchNFTsArgs} args - The SearchNFTsArgs object containing the search parameters.
40
+ * @returns {Promise<SearchNFTsResponse>} A Promise that resolves to the SearchNFTsResponse object.
41
+ * @throws An error if the provided collection ticker is invalid or if the 'top' value is greater than 35.
42
+ */
43
+ searchNFTs: (args: SearchNFTsArgs) => Promise<SearchNFTsResponse>;
44
+ /**
45
+ * Retrieves trading history based on the provided arguments.
46
+ *
47
+ * @param {TradincActivityArgs} args - The arguments for filtering the trading activity.
48
+ * @returns {Promise<TradingActivityResponse>} A promise resolving to a TradingActivityResponse object containing the activity.
49
+ * @throws {Error} Throws an error if the 'top' argument is greater than 35.
50
+ */
51
+ getTradingActivity: (args: TradincActivityArgs) => Promise<TradingActivityResponse>;
52
+ /**
53
+ * Searches for NFTs in a collection based on the provided arguments.
54
+ * @param {GetCollectionsArgs} args - The SearchNFTsArgs object containing the search parameters.
55
+ * @returns {Promise<CollectionsNFTsResponse>} A Promise that resolves to the CollectionsNFTsResponse object.
56
+ * @throws An error if the provided collection ticker is invalid or if the 'top' value is greater than 35.
57
+ */
58
+ getCollections: (args?: GetCollectionsArgs) => Promise<CollectionsNFTsResponse>;
59
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Represents an XOXNO Marketplace SDK, providing a simplified interface for
3
+ * interacting with an XOXNO API.
4
+ */
5
+ export declare class XOXNO {
6
+ /**
7
+ * Creates a new XOXNO instance.
8
+ * @param apiUrl - The base URL of the XOXNO API.
9
+ * @param apiKey - The API key for accessing the XOXNO API.
10
+ */
11
+ constructor(apiUrl?: string, apiKey?: string);
12
+ }
@@ -0,0 +1 @@
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.XOXNO=t():e.XOXNO=t()}(self,(()=>(()=>{"use strict";var e={140:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.APIClient=t.Chain=void 0;const i=o(n(218)),s=n(617);var a;!function(e){e.MAINNET="1",e.DEVNET="D"}(a=t.Chain||(t.Chain={}));class c{constructor(e,t,n){this.fetchWithTimeout=(e,t={},n=4e4)=>r(this,void 0,void 0,(function*(){var r,o;const s=Math.round((new Date).getTime()/1e3),a=Object.assign(Object.assign({"Accept-Encoding":"gzip,deflate,br","xo-time":`Sent-At:${s}`,Referer:"https://xoxno.sdk","User-Agent":"XOXNO/1.0/SDK"},"POST"===t.method?{"Content-Type":"application/json"}:{}),null!==(r=t.headers)&&void 0!==r?r:{});try{const{data:r}=yield(0,i.default)(`${this.apiUrl}${e}${t.params?"?"+Object.keys(t.params).map((e=>`${e}=${encodeURIComponent(t.params[e])}`)).join("&"):""}`,Object.assign(Object.assign(Object.assign({timeout:n},t),Object.keys(a).length?{headers:a}:{}),{method:null!==(o=t.method)&&void 0!==o?o:"GET"}));return r}catch(n){throw new Error("Something went wrong inside fetchWithTimeout "+e+" "+JSON.stringify(t)+" "+n)}})),this.apiUrl=e,this.apiKey=t,this.chain=n,this.config=n===a.MAINNET?{XO_SC:s.XOXNO_SC,FM_SC:s.FM_SC,DR_SC:s.DR_SC,KG_SC:s.KG_SC,Staking_SC:s.Staking_SC,Manager_SC:s.Manager_SC,P2P_SC:s.P2P_SC}:{XO_SC:s.XOXNO_SC_DEV,FM_SC:s.FM_SC,DR_SC:s.DR_SC,KG_SC:s.KG_SC,Staking_SC:s.Staking_SC_DEV,Manager_SC:s.Manager_SC_DEV,P2P_SC:s.P2P_SC_DEV}}static init(e=s.API_URL,t="",n=a.MAINNET){return c.instance||(c.instance=new c(e,t,n)),c.instance}static getClient(){if(!c.instance)throw new Error("APIClient has not been initialized");return c.instance}}t.APIClient=c},617:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.P2P_SC_DEV=t.Manager_SC_DEV=t.Staking_SC_DEV=t.XOXNO_SC_DEV=t.P2P_SC=t.Manager_SC=t.Staking_SC=t.KG_SC=t.DR_SC=t.FM_SC=t.XOXNO_SC=t.API_URL_DEV=t.API_URL=void 0,t.API_URL="https://api.xoxno.com",t.API_URL_DEV="https://api-dev.xoxno.com",t.XOXNO_SC="erd1qqqqqqqqqqqqqpgq6wegs2xkypfpync8mn2sa5cmpqjlvrhwz5nqgepyg8",t.FM_SC="erd1qqqqqqqqqqqqqpgq705fxpfrjne0tl3ece0rrspykq88mynn4kxs2cg43s",t.DR_SC="erd1qqqqqqqqqqqqqpgqd9rvv2n378e27jcts8vfwynpx0gfl5ufz6hqhfy0u0",t.KG_SC="erd1qqqqqqqqqqqqqpgq8xwzu82v8ex3h4ayl5lsvxqxnhecpwyvwe0sf2qj4e",t.Staking_SC="erd1qqqqqqqqqqqqqpgqvpkd3g3uwludduv3797j54qt6c888wa59w2shntt6z",t.Manager_SC="erd1qqqqqqqqqqqqqpgqg9fa0dmpn8fu3fnleeqn5zt8rl8mdqjkys5s2gtas7",t.P2P_SC="erd1qqqqqqqqqqqqqpgq47y8hnct68v6asjv6gxem6h9rumn9frzah0skhxxt6",t.XOXNO_SC_DEV="erd1qqqqqqqqqqqqqpgqn4fnwl43hhchz9emdy66eh5azzhl599zd8ssxjdyh3",t.Staking_SC_DEV="erd1qqqqqqqqqqqqqpgqmkt2fvumf0zgum5qd0awl2l46x2pxdgmr5rswjr6r8",t.Manager_SC_DEV="erd1qqqqqqqqqqqqqpgq6sysl7mga393a850xemfpawaqanf4da5d8ssp3xamn",t.P2P_SC_DEV="erd1qqqqqqqqqqqqqpgqhuvnvkwwmucdzy3g7pvgvjumjfcgfwf69w2svch5c2"},218:(e,t,n)=>{function r(e,t){return function(){return e.apply(t,arguments)}}const{toString:o}=Object.prototype,{getPrototypeOf:i}=Object,s=(a=Object.create(null),e=>{const t=o.call(e);return a[t]||(a[t]=t.slice(8,-1).toLowerCase())});var a;const c=e=>(e=e.toLowerCase(),t=>s(t)===e),u=e=>t=>typeof t===e,{isArray:l}=Array,f=u("undefined"),d=c("ArrayBuffer"),p=u("string"),h=u("function"),m=u("number"),g=e=>null!==e&&"object"==typeof e,y=e=>{if("object"!==s(e))return!1;const t=i(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},b=c("Date"),q=c("File"),w=c("Blob"),S=c("FileList"),E=c("URLSearchParams");function O(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),l(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let s;for(r=0;r<i;r++)s=o[r],t.call(null,e[s],s,e)}}function _(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const C="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,R=e=>!f(e)&&e!==C,v=(A="undefined"!=typeof Uint8Array&&i(Uint8Array),e=>A&&e instanceof A);var A;const x=c("HTMLFormElement"),j=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),P=c("RegExp"),T=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};O(n,((n,o)=>{!1!==t(n,o,e)&&(r[o]=n)})),Object.defineProperties(e,r)},N="abcdefghijklmnopqrstuvwxyz",D="0123456789",U={DIGIT:D,ALPHA:N,ALPHA_DIGIT:N+N.toUpperCase()+D};var F={isArray:l,isArrayBuffer:d,isBuffer:function(e){return null!==e&&!f(e)&&null!==e.constructor&&!f(e.constructor)&&h(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{const t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||o.call(e)===t||h(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&d(e.buffer),t},isString:p,isNumber:m,isBoolean:e=>!0===e||!1===e,isObject:g,isPlainObject:y,isUndefined:f,isDate:b,isFile:q,isBlob:w,isRegExp:P,isFunction:h,isStream:e=>g(e)&&h(e.pipe),isURLSearchParams:E,isTypedArray:v,isFileList:S,forEach:O,merge:function e(){const{caseless:t}=R(this)&&this||{},n={},r=(r,o)=>{const i=t&&_(n,o)||o;y(n[i])&&y(r)?n[i]=e(n[i],r):y(r)?n[i]=e({},r):l(r)?n[i]=r.slice():n[i]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&O(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:o}={})=>(O(t,((t,o)=>{n&&h(t)?e[o]=r(t,n):e[o]=t}),{allOwnKeys:o}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,s,a;const c={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)a=o[s],r&&!r(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==n&&i(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:s,kindOfTest:c,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(l(e))return e;let t=e.length;if(!m(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:x,hasOwnProperty:j,hasOwnProp:j,reduceDescriptors:T,freezeMethods:e=>{T(e,((t,n)=>{if(h(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];h(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return l(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:_,global:C,isContextDefined:R,ALPHABET:U,generateString:(e=16,t=U.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&h(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(g(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=l(e)?[]:{};return O(e,((e,t)=>{const i=n(e,r+1);!f(i)&&(o[t]=i)})),t[r]=void 0,o}}return e};return n(e,0)}};function L(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}F.inherits(L,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:F.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const k=L.prototype,B={};function M(e){return F.isPlainObject(e)||F.isArray(e)}function I(e){return F.endsWith(e,"[]")?e.slice(0,-2):e}function z(e,t,n){return e?e.concat(t).map((function(e,t){return e=I(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{B[e]={value:e}})),Object.defineProperties(L,B),Object.defineProperty(k,"isAxiosError",{value:!0}),L.from=(e,t,n,r,o,i)=>{const s=Object.create(k);return F.toFlatObject(e,s,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),L.call(s,e.message,t,n,r,o),s.cause=e,s.name=e.name,i&&Object.assign(s,i),s};const V=F.toFlatObject(F,{},null,(function(e){return/^is[A-Z]/.test(e)}));function X(e,t,n){if(!F.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=F.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!F.isUndefined(t[e])}))).metaTokens,o=n.visitor||u,i=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&F.isSpecCompliantForm(t);if(!F.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(F.isDate(e))return e.toISOString();if(!a&&F.isBlob(e))throw new L("Blob is not supported. Use a Buffer instead.");return F.isArrayBuffer(e)||F.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(F.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(F.isArray(e)&&function(e){return F.isArray(e)&&!e.some(M)}(e)||(F.isFileList(e)||F.endsWith(n,"[]"))&&(a=F.toArray(e)))return n=I(n),a.forEach((function(e,r){!F.isUndefined(e)&&null!==e&&t.append(!0===s?z([n],r,i):null===s?n:n+"[]",c(e))})),!1;return!!M(e)||(t.append(z(o,n,i),c(e)),!1)}const l=[],f=Object.assign(V,{defaultVisitor:u,convertValue:c,isVisitable:M});if(!F.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!F.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),F.forEach(n,(function(n,i){!0===(!(F.isUndefined(n)||null===n)&&o.call(t,n,F.isString(i)?i.trim():i,r,f))&&e(n,r?r.concat(i):[i])})),l.pop()}}(e),t}function H(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function K(e,t){this._pairs=[],e&&X(e,this,t)}const J=K.prototype;function W(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function G(e,t,n){if(!t)return e;const r=n&&n.encode||W,o=n&&n.serialize;let i;if(i=o?o(t,n):F.isURLSearchParams(t)?t.toString():new K(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}J.append=function(e,t){this._pairs.push([e,t])},J.toString=function(e){const t=e?function(t){return e.call(this,t,H)}:H;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var $=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){F.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Q={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Z={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:K,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};function Y(e){function t(e,n,r,o){let i=e[o++];const s=Number.isFinite(+i),a=o>=e.length;return i=!i&&F.isArray(r)?r.length:i,a?(F.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!s):(r[i]&&F.isObject(r[i])||(r[i]=[]),t(e,n,r[i],o)&&F.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}(r[i])),!s)}if(F.isFormData(e)&&F.isFunction(e.entries)){const n={};return F.forEachEntry(e,((e,r)=>{t(function(e){return F.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const ee={"Content-Type":void 0},te={transitional:Q,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=F.isObject(e);if(o&&F.isHTMLForm(e)&&(e=new FormData(e)),F.isFormData(e))return r&&r?JSON.stringify(Y(e)):e;if(F.isArrayBuffer(e)||F.isBuffer(e)||F.isStream(e)||F.isFile(e)||F.isBlob(e))return e;if(F.isArrayBufferView(e))return e.buffer;if(F.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return X(e,new Z.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return Z.isNode&&F.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((i=F.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return X(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(F.isString(e))try{return(0,JSON.parse)(e),F.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||te.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&F.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw L.from(e,L.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Z.classes.FormData,Blob:Z.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};F.forEach(["delete","get","head"],(function(e){te.headers[e]={}})),F.forEach(["post","put","patch"],(function(e){te.headers[e]=F.merge(ee)}));var ne=te;const re=F.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),oe=Symbol("internals");function ie(e){return e&&String(e).trim().toLowerCase()}function se(e){return!1===e||null==e?e:F.isArray(e)?e.map(se):String(e)}function ae(e,t,n,r,o){return F.isFunction(r)?r.call(this,t,n):(o&&(t=n),F.isString(t)?F.isString(r)?-1!==t.indexOf(r):F.isRegExp(r)?r.test(t):void 0:void 0)}class ce{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=ie(t);if(!o)throw new Error("header name must be a non-empty string");const i=F.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=se(e))}const i=(e,t)=>F.forEach(e,((e,n)=>o(e,n,t)));return F.isPlainObject(e)||e instanceof this.constructor?i(e,t):F.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z]+$/.test(e.trim())?i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&re[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&o(t,e,n),this}get(e,t){if(e=ie(e)){const n=F.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(F.isFunction(t))return t.call(this,e,n);if(F.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ie(e)){const n=F.findKey(this,e);return!(!n||void 0===this[n]||t&&!ae(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=ie(e)){const o=F.findKey(n,e);!o||t&&!ae(0,n[o],o,t)||(delete n[o],r=!0)}}return F.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!ae(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return F.forEach(this,((r,o)=>{const i=F.findKey(n,o);if(i)return t[i]=se(r),void delete t[o];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();s!==o&&delete t[o],t[s]=se(r),n[s]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return F.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&F.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[oe]=this[oe]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=ie(e);t[r]||(function(e,t){const n=F.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return F.isArray(e)?e.forEach(r):r(e),this}}ce.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),F.freezeMethods(ce.prototype),F.freezeMethods(ce);var ue=ce;function le(e,t){const n=this||ne,r=t||n,o=ue.from(r.headers);let i=r.data;return F.forEach(e,(function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)})),o.normalize(),i}function fe(e){return!(!e||!e.__CANCEL__)}function de(e,t,n){L.call(this,null==e?"canceled":e,L.ERR_CANCELED,t,n),this.name="CanceledError"}F.inherits(de,L,{__CANCEL__:!0});var pe=Z.isStandardBrowserEnv?{write:function(e,t,n,r,o,i){const s=[];s.push(e+"="+encodeURIComponent(t)),F.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),F.isString(r)&&s.push("path="+r),F.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function he(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var me=Z.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=F.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function ge(e,t){let n=0;const r=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,s=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=r[s];o||(o=c),n[i]=a,r[i]=c;let l=s,f=0;for(;l!==i;)f+=n[l++],l%=e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),c-o<t)return;const d=u&&c-u;return d?Math.round(1e3*f/d):void 0}}(50,250);return o=>{const i=o.loaded,s=o.lengthComputable?o.total:void 0,a=i-n,c=r(a);n=i;const u={loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&i<=s?(s-i)/c:void 0,event:o};u[t?"download":"upload"]=!0,e(u)}}const ye={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const o=ue.from(e.headers).normalize(),i=e.responseType;let s;function a(){e.cancelToken&&e.cancelToken.unsubscribe(s),e.signal&&e.signal.removeEventListener("abort",s)}F.isFormData(r)&&(Z.isStandardBrowserEnv||Z.isStandardBrowserWebWorkerEnv)&&o.setContentType(!1);let c=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(t+":"+n))}const u=he(e.baseURL,e.url);function l(){if(!c)return;const r=ue.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new L("Request failed with status code "+n.status,[L.ERR_BAD_REQUEST,L.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),a()}),(function(e){n(e),a()}),{data:i&&"text"!==i&&"json"!==i?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:r,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),G(u,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=l:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(l)},c.onabort=function(){c&&(n(new L("Request aborted",L.ECONNABORTED,e,c)),c=null)},c.onerror=function(){n(new L("Network Error",L.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||Q;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new L(t,r.clarifyTimeoutError?L.ETIMEDOUT:L.ECONNABORTED,e,c)),c=null},Z.isStandardBrowserEnv){const t=(e.withCredentials||me(u))&&e.xsrfCookieName&&pe.read(e.xsrfCookieName);t&&o.set(e.xsrfHeaderName,t)}void 0===r&&o.setContentType(null),"setRequestHeader"in c&&F.forEach(o.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),F.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),i&&"json"!==i&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",ge(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",ge(e.onUploadProgress)),(e.cancelToken||e.signal)&&(s=t=>{c&&(n(!t||t.type?new de(null,e,c):t),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(s),e.signal&&(e.signal.aborted?s():e.signal.addEventListener("abort",s)));const f=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);f&&-1===Z.protocols.indexOf(f)?n(new L("Unsupported protocol "+f+":",L.ERR_BAD_REQUEST,e)):c.send(r||null)}))}};F.forEach(ye,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));function be(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new de(null,e)}function qe(e){return be(e),e.headers=ue.from(e.headers),e.data=le.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),(e=>{e=F.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let o=0;o<t&&(n=e[o],!(r=F.isString(n)?ye[n.toLowerCase()]:n));o++);if(!r){if(!1===r)throw new L(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(F.hasOwnProp(ye,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`)}if(!F.isFunction(r))throw new TypeError("adapter is not a function");return r})(e.adapter||ne.adapter)(e).then((function(t){return be(e),t.data=le.call(e,e.transformResponse,t),t.headers=ue.from(t.headers),t}),(function(t){return fe(t)||(be(e),t&&t.response&&(t.response.data=le.call(e,e.transformResponse,t.response),t.response.headers=ue.from(t.response.headers))),Promise.reject(t)}))}const we=e=>e instanceof ue?e.toJSON():e;function Se(e,t){t=t||{};const n={};function r(e,t,n){return F.isPlainObject(e)&&F.isPlainObject(t)?F.merge.call({caseless:n},e,t):F.isPlainObject(t)?F.merge({},t):F.isArray(t)?t.slice():t}function o(e,t,n){return F.isUndefined(t)?F.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function i(e,t){if(!F.isUndefined(t))return r(void 0,t)}function s(e,t){return F.isUndefined(t)?F.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t)=>o(we(e),we(t),!0)};return F.forEach(Object.keys(e).concat(Object.keys(t)),(function(r){const i=c[r]||o,s=i(e[r],t[r],r);F.isUndefined(s)&&i!==a||(n[r]=s)})),n}const Ee={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Ee[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Oe={};Ee.transitional=function(e,t,n){function r(e,t){return"[Axios v1.3.4] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new L(r(o," has been removed"+(t?" in "+t:"")),L.ERR_DEPRECATED);return t&&!Oe[o]&&(Oe[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}};var _e={assertOptions:function(e,t,n){if("object"!=typeof e)throw new L("options must be an object",L.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=t[i];if(s){const t=e[i],n=void 0===t||s(t,i,e);if(!0!==n)throw new L("option "+i+" must be "+n,L.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new L("Unknown option "+i,L.ERR_BAD_OPTION)}},validators:Ee};const Ce=_e.validators;class Re{constructor(e){this.defaults=e,this.interceptors={request:new $,response:new $}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Se(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;let i;void 0!==n&&_e.assertOptions(n,{silentJSONParsing:Ce.transitional(Ce.boolean),forcedJSONParsing:Ce.transitional(Ce.boolean),clarifyTimeoutError:Ce.transitional(Ce.boolean)},!1),void 0!==r&&_e.assertOptions(r,{encode:Ce.function,serialize:Ce.function},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase(),i=o&&F.merge(o.common,o[t.method]),i&&F.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=ue.concat(i,o);const s=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,f=0;if(!a){const e=[qe.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,c),l=e.length,u=Promise.resolve(t);f<l;)u=u.then(e[f++],e[f++]);return u}l=s.length;let d=t;for(f=0;f<l;){const e=s[f++],t=s[f++];try{d=e(d)}catch(e){t.call(this,e);break}}try{u=qe.call(this,d)}catch(e){return Promise.reject(e)}for(f=0,l=c.length;f<l;)u=u.then(c[f++],c[f++]);return u}getUri(e){return G(he((e=Se(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}F.forEach(["delete","get","head","options"],(function(e){Re.prototype[e]=function(t,n){return this.request(Se(n||{},{method:e,url:t,data:(n||{}).data}))}})),F.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(Se(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Re.prototype[e]=t(),Re.prototype[e+"Form"]=t(!0)}));var ve=Re;class Ae{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new de(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Ae((function(t){e=t})),cancel:e}}}var xe=Ae;const je={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(je).forEach((([e,t])=>{je[t]=e}));var Pe=je;const Te=function e(t){const n=new ve(t),o=r(ve.prototype.request,n);return F.extend(o,ve.prototype,n,{allOwnKeys:!0}),F.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return e(Se(t,n))},o}(ne);Te.Axios=ve,Te.CanceledError=de,Te.CancelToken=xe,Te.isCancel=fe,Te.VERSION="1.3.4",Te.toFormData=X,Te.AxiosError=L,Te.Cancel=Te.CanceledError,Te.all=function(e){return Promise.all(e)},Te.spread=function(e){return function(t){return e.apply(null,t)}},Te.isAxiosError=function(e){return F.isObject(e)&&!0===e.isAxiosError},Te.mergeConfig=Se,Te.AxiosHeaders=ue,Te.formToJSON=e=>Y(F.isHTMLForm(e)?new FormData(e):e),Te.HttpStatusCode=Pe,Te.default=Te,e.exports=Te}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();var r={};return(()=>{var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.XOXNO=void 0;const t=n(140),o=n(617);e.XOXNO=class{constructor(e=o.API_URL,n=""){t.APIClient.init(e,n)}}})(),r})()));
@@ -0,0 +1,79 @@
1
+ import { GlobalOffer } from '../types/collection';
2
+ import type { SmartContract } from '@multiversx/sdk-core/out/smartcontracts/smartContract';
3
+ export declare class SCInteraction {
4
+ private xo;
5
+ private call;
6
+ constructor(marketAbiXOXNO: SmartContract);
7
+ static create(): Promise<SCInteraction>;
8
+ private getResult;
9
+ /**
10
+ * Gets the percentage of each transaction that will be paid to the marketplace.
11
+ *
12
+ * @returns The percentage of each transaction that will be paid to the marketplace.
13
+ */
14
+ getMarketplaceFees: () => Promise<number>;
15
+ /**
16
+ * Retrieves the list of accepted payment tokens.
17
+ * @returns {string[]} A list of accepted payment tokens.
18
+ */
19
+ getAcceptedPaymentTokens: () => Promise<string[]>;
20
+ /**
21
+ * This function returns a list of IDs of global offers.
22
+ * @returns {number[]} a list of IDs of global offers.
23
+ */
24
+ getGlobalOfferIDs: () => Promise<number[]>;
25
+ /**
26
+ * Gets the balance of a user in a token of a specific pool.
27
+ * @param address The address of the user.
28
+ * @param token The token address.
29
+ * @param nonce The nonce of the pool.
30
+ * @returns {number} The balance of the user in the token of the pool.
31
+ */
32
+ getUserPoolBalance(address: string, token: string, nonce: number): Promise<number>;
33
+ private isOfferActive;
34
+ /**
35
+ * Returns the global offer data for the offer with the given id.
36
+ *
37
+ * @param global_offer_id The id of the global offer for which to return the data.
38
+ *
39
+ * @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.
40
+ */
41
+ getGlobalOfferData: (global_offer_id: number) => Promise<GlobalOffer>;
42
+ /** Gets the number of listings.
43
+ * @returns {number} The number of listings.
44
+ * */
45
+ getListingsCount(): Promise<number>;
46
+ /** Gets the number of custom offers.
47
+ * @returns {number} The number of custom offers.
48
+ * */
49
+ getOffersCount(): Promise<number>;
50
+ /** Gets the number of global offers.
51
+ * @returns {number} The number of global offers.
52
+ * */
53
+ getGlobalOffersCount(): Promise<number>;
54
+ /** Gets the number of collections listed.
55
+ * @returns {number} The number of collections listed.
56
+ * */
57
+ getCollectionsCount(): Promise<number>;
58
+ /**
59
+ * Checks whether a collection is listed with at least 1 NFT.
60
+ *
61
+ * @param collection name of the collection
62
+ * @return true if the collection is listed, false otherwise
63
+ */
64
+ isCollectionListed(collection: string): Promise<boolean>;
65
+ /** Gets the on sale NFT count of the collection.
66
+ *
67
+ * @param collection The collection identifier for which one wants to get the on sale NFT count.
68
+ *
69
+ * @returns {number} The on sale NFT count of the collection.
70
+ * */
71
+ getCollectionNFTsOnSaleCount(collection: string): Promise<number>;
72
+ /** Gets the active unique auction IDs of collection.
73
+ *
74
+ * @param collection The collection identifier for which one wants to get the active unique auction IDs.
75
+ *
76
+ * @returns {number[]} The active unique auction IDs of collection.
77
+ * */
78
+ getAuctionIDsForCollection(collection: string): Promise<number[]>;
79
+ }
@@ -0,0 +1,78 @@
1
+ import type { SmartContract } from '@multiversx/sdk-core/out/smartcontracts/smartContract';
2
+ /**
3
+ * LaunchpadModule provides methods to interact with the minter smart contract.
4
+ * @class
5
+ */
6
+ export declare class LaunchpadModule {
7
+ private minter;
8
+ private call;
9
+ /**
10
+ * @constructor
11
+ * @param {SmartContract} minterAbiXOXNO - The minter smart contract instance.
12
+ */
13
+ constructor(minterAbiXOXNO: SmartContract);
14
+ /**
15
+ * Executes the provided interaction and returns the result.
16
+ * @private
17
+ * @param {Interaction} interaction - The smart contract interaction.
18
+ * @returns {Promise<any>} The result of the interaction.
19
+ */
20
+ private getResult;
21
+ /**
22
+ * Initializes the LaunchpadModule with a minter smart contract instance.
23
+ * @static
24
+ * @param {string} minterSC - The minter smart contract address.
25
+ * @returns {Promise<LaunchpadModule>} A new instance of LaunchpadModule.
26
+ */
27
+ static init(minterSC: string): Promise<LaunchpadModule>;
28
+ /**
29
+ * Fetches all unique tags from the minter smart contract.
30
+ * @public
31
+ * @returns {Promise<string[]>} An array of unique tags.
32
+ */
33
+ getAllUniqueTags: () => Promise<string[]>;
34
+ /**
35
+ * Fetches the global buy count for a user and tag.
36
+ * @public
37
+ * @param {string} user - The user's address.
38
+ * @param {string} tag - The tag.
39
+ * @returns {Promise<number>} The global buy count.
40
+ */
41
+ getWalletGlobalBuyCount: (user: string, tag: string) => Promise<number>;
42
+ /**
43
+ * Fetches the stage buy count for a user, tag, and stage.
44
+ * @public
45
+ * @param {string} user - The user's address.
46
+ * @param {string} tag - The tag.
47
+ * @param {string} stage - The stage.
48
+ * @returns {Promise<number>} The stage buy count.
49
+ */
50
+ getWalletStageBuyCount: (user: string, tag: string, stage: string) => Promise<number>;
51
+ /**
52
+ * Fetches the local owner's address from the minter smart contract.
53
+ * @public
54
+ * @returns {Promise<string>} The local owner's address.
55
+ */
56
+ getLocalOwner: () => Promise<string>;
57
+ /**
58
+ * Fetches the launchpad cut fee percentage from the minter smart contract.
59
+ * @public
60
+ * @returns {Promise<number>} The launchpad cut fee percentage.
61
+ */
62
+ getLaunchpadCutFee: () => Promise<number>;
63
+ /**
64
+ * Fetches the stage whitelist of wallets for a tag and stage.
65
+ * @public
66
+ * @param {string} tag - The tag.
67
+ * @param {string} stage - The stage.
68
+ * @returns {Promise<string[]>} An array of whitelisted wallet addresses.
69
+ */
70
+ getStageWhitelist: (tag: string, stage: string) => Promise<string[]>;
71
+ /**
72
+ * Fetches the list of stages for a tag.
73
+ * @public
74
+ * @param {string} tag - The tag.
75
+ * @returns {Promise<string[]>} An array of stages.
76
+ */
77
+ getStages: (tag: string) => Promise<string[]>;
78
+ }
@@ -0,0 +1,44 @@
1
+ import { NftData } from '../types/nft';
2
+ import { TradingActivityResponse, TradincActivityArgs } from '../types/trading';
3
+ /**
4
+ * NFTModule provides a set of methods to interact with single NFTs.
5
+ * It includes methods for getting single NFT information, and searching NFTs by collection and nonce.
6
+ *
7
+ * @example
8
+ * const xoxno = new XOXNO({ apiURL: 'https://api.xoxno.com', apiKey: 'your-api-key' });
9
+ * const nftModule = xoxno.nft;
10
+ */
11
+ export declare class NFTModule {
12
+ private api;
13
+ constructor();
14
+ /**
15
+ * Get the NFT data for the specified identifier.
16
+ * @param identifier The NFT identifier. Must be a valid NFT identifier.
17
+ * @returns {Promise<NftData>} The NFT data.
18
+ */
19
+ getNFTByIdentifier: (identifier: string) => Promise<NftData>;
20
+ /**
21
+ * Gets an NFT by collection and nonce.
22
+ * @param collection The collection ticker.
23
+ * @param nonce The nonce of the NFT.
24
+ * @returns {Promise<NftData>} The NFT data.
25
+ * @throws Throws an error when the collection ticker is invalid.
26
+ */
27
+ getNFTByCollectionAndNonce: (collection: string, nonce: number) => Promise<NftData>;
28
+ /**
29
+ * Get NFT by collection and nonce hex
30
+ *
31
+ * @param collection - collection ticker
32
+ * @param nonceHex - nonce hex
33
+ * @return {Promise<NftData>} NFT data
34
+ */
35
+ getNFTByCollectionAndNonceHex: (collection: string, nonceHex: string) => Promise<NftData>;
36
+ /**
37
+ * Retrieves trading history based on the provided arguments.
38
+ *
39
+ * @param {TradincActivityArgs} args - The arguments for filtering the trading activity.
40
+ * @returns {Promise<TradingActivityResponse>} A promise resolving to a TradingActivityResponse object containing the activity.
41
+ * @throws {Error} Throws an error if the 'top' argument is greater than 35.
42
+ */
43
+ getTradingActivity: (args: TradincActivityArgs) => Promise<TradingActivityResponse>;
44
+ }
@@ -0,0 +1,313 @@
1
+ import { NftData } from './nft';
2
+ export interface ISocials {
3
+ twitter: string;
4
+ instagram: string;
5
+ website: string;
6
+ telegram: string;
7
+ discord: string;
8
+ facebook: string;
9
+ youtube: string;
10
+ }
11
+ export interface IMintInfo {
12
+ contractAddress: string;
13
+ totalNftMinted: number;
14
+ collectionTag: string;
15
+ cid: string;
16
+ mediaType: string;
17
+ collectionSize: number;
18
+ nftTransferLimited: string;
19
+ allowsPublicBurn: string;
20
+ kycRequired: string;
21
+ allowsRefund: string;
22
+ hasReveal: string;
23
+ }
24
+ export interface ICollectionProfile {
25
+ dataType: 'collectionProfile';
26
+ collection: string;
27
+ name: string;
28
+ description: string;
29
+ isVisible: boolean;
30
+ isVerified: boolean;
31
+ profile: string;
32
+ banner: string;
33
+ statistics: {
34
+ tradeData: {
35
+ dayEgldVolume: number;
36
+ weekEgldVolume: number;
37
+ totalEgldVolume: number;
38
+ averageEgldPrice: number;
39
+ athEgldPrice: number;
40
+ athTxHash: string;
41
+ totalTrades: number;
42
+ };
43
+ mintData: {
44
+ totalMintEgldVolume: number;
45
+ weekMintEgldVolume: number;
46
+ dayMintEgldVolume: number;
47
+ };
48
+ other: {
49
+ nftCount: number;
50
+ followCount: number;
51
+ holdersCount?: number;
52
+ };
53
+ };
54
+ owner: string;
55
+ creator: string;
56
+ isMintable: boolean;
57
+ mintInfo: IMintInfo;
58
+ mintStages: {
59
+ name: string;
60
+ collectionTag: string;
61
+ mintEnabled: boolean;
62
+ isWhitelist: boolean;
63
+ startTime: number;
64
+ endTime: number;
65
+ mintLimit: number;
66
+ mintCount: number;
67
+ prices: {
68
+ tokenIdentifier: string;
69
+ tokenNonce: string;
70
+ amount: string;
71
+ }[];
72
+ walletLimit: number;
73
+ }[];
74
+ hasStaking: boolean;
75
+ id: string;
76
+ socials: ISocials;
77
+ type: string;
78
+ lastVerifiedTimestamp: number;
79
+ lastVerifiedBy: string;
80
+ _ts: number;
81
+ }
82
+ export interface AttributeData {
83
+ attributeOccurrence: number;
84
+ FloorPrice: number;
85
+ OnSale: number;
86
+ }
87
+ export interface MetadataAttribute {
88
+ trait_type: string;
89
+ value: string;
90
+ }
91
+ export interface TraitValues {
92
+ [traitValue: string]: AttributeData;
93
+ }
94
+ export interface ICollectionAttributes {
95
+ [traitType: string]: TraitValues;
96
+ }
97
+ export declare enum Marketplace {
98
+ XO = "XO",
99
+ FM = "FM",
100
+ DR = "DR",
101
+ KG = "KG"
102
+ }
103
+ export interface GlobalOffer {
104
+ attributes: MetadataAttribute[];
105
+ collection: string;
106
+ isActive: boolean;
107
+ marketplace: string;
108
+ offer_id: number;
109
+ owner: string;
110
+ ownerProfile?: string;
111
+ ownerUsername?: string;
112
+ payment_nonce: number;
113
+ payment_token: string;
114
+ price: string;
115
+ quantity: number;
116
+ short_price: number;
117
+ timestamp: number;
118
+ }
119
+ export declare enum FieldsToSelect {
120
+ Rank = "metadata/rarity/rank",
121
+ Attributes = "metadata/attributes",
122
+ Description = "metadata/description",
123
+ Name = "name",
124
+ OnSale = "onSale",
125
+ SaleInfo = "saleInfoNft",
126
+ Royalties = "royalties",
127
+ Identifier = "identifier",
128
+ Collection = "collection",
129
+ OriginalURL = "url",
130
+ Nonce = "nonce",
131
+ ContentType = "originalMedia/contentType",
132
+ WasProcessed = "wasProcessed",
133
+ AvifURL = "avifUrl",
134
+ WebpURL = "webpUrl",
135
+ Type = "type"
136
+ }
137
+ export declare enum SearchOrderBy {
138
+ PriceHighToLow = "saleInfoNft/min_bid_short desc",
139
+ PriceLowToHigh = "saleInfoNft/min_bid_short asc",
140
+ RarityHighToLow = "metadata/rarity/rank desc",
141
+ RarityLowToHigh = "metadata/rarity/rank asc",
142
+ NonceHighToLow = "nonce desc",
143
+ NonceLowToHigh = "nonce asc",
144
+ RecentListed = "saleInfoNft/timestamp desc",
145
+ OldestListed = "saleInfoNft/timestamp asc"
146
+ }
147
+ export declare enum CollectionsOrderBy {
148
+ WeekVolumeHighToLow = "statistics.tradeData.weekEgldVolume desc",
149
+ WeekVolumeLowToHigh = "statistics.tradeData.weekEgldVolume asc",
150
+ DailyVolumeHighToLow = "statistics.tradeData.dayEgldVolume desc",
151
+ DailyVolumeLowToHigh = "statistics.tradeData.dayEgldVolume asc",
152
+ TotalVolumeHighToLow = "statistics.tradeData.totalEgldVolume desc",
153
+ TotalVolumeLowToHigh = "statistics.tradeData.totalEgldVolume asc",
154
+ AvgVolumePriceHighToLow = "statistics.tradeData.averageEgldPrice desc",
155
+ AvgVolumePriceLowToHigh = "statistics.tradeData.averageEgldPrice asc",
156
+ ATHHighToLow = "statistics.tradeData.athEgldPrice desc",
157
+ ATHLowToHigh = "statistics.tradeData.athEgldPrice asc",
158
+ TotalTradesHighToLow = "statistics.tradeData.totalTrades desc",
159
+ TotalTradesLowToHigh = "statistics.tradeData.totalTrades asc",
160
+ SupplyHighToLow = "statistics.other.nftCount desc",
161
+ SupplyLowToHigh = "statistics.other.nftCount asc",
162
+ FollowersHighToLow = "statistics.other.followCount desc",
163
+ FollowersLowToHigh = "statistics.other.followCount asc"
164
+ }
165
+ export declare enum CollectionsFieldsToSelect {
166
+ Profile = "profile",
167
+ Description = "description",
168
+ Creator = "creator",
169
+ Owner = "owner",
170
+ Socials = "socials",
171
+ Type = "type",
172
+ HasStaking = "hasStaking",
173
+ MintInfo = "mintInfo",
174
+ MintStages = "mintStages",
175
+ Name = "name",
176
+ Banner = "banner",
177
+ IsVerified = "isVerified",
178
+ IsMintable = "isMintable",
179
+ Statistics = "statistics",
180
+ Collection = "collection"
181
+ }
182
+ export interface Filter {
183
+ marketplace?: Marketplace[];
184
+ onSale?: boolean;
185
+ auctionTypes?: string[];
186
+ tokens?: string[];
187
+ attributes?: MetadataAttribute[];
188
+ range?: {
189
+ min: number;
190
+ max: number;
191
+ type: string;
192
+ };
193
+ rankRange?: {
194
+ min?: number;
195
+ max?: number;
196
+ };
197
+ levelRange?: {
198
+ min?: number;
199
+ max?: number;
200
+ };
201
+ }
202
+ export interface SearchNFTs {
203
+ filters: Filter;
204
+ name?: string;
205
+ orderBy?: SearchOrderBy[];
206
+ collection: string;
207
+ top: number;
208
+ skip: number;
209
+ select?: FieldsToSelect[];
210
+ }
211
+ export interface SearchNFTsArgs {
212
+ /** The collection to search in */
213
+ collection: string;
214
+ /** If true, will return only NFTs that are on sale */
215
+ onlyOnSale?: boolean;
216
+ /** If true, will return only NFTs that are on auction */
217
+ onlyAuctions?: boolean;
218
+ /** If set, will return only NFTs with a price in the specified range */
219
+ priceRange?: {
220
+ min: number;
221
+ max: number;
222
+ };
223
+ /** If set, will return only NFTs listed in the specified tokens */
224
+ listedInToken?: string[];
225
+ /** If set, will return only NFTs with a rank in the specified range */
226
+ rankRange?: {
227
+ min: number;
228
+ max: number;
229
+ };
230
+ /** If set, will return only NFTs with a cantina level in the specified range */
231
+ cantinaLevelRange?: {
232
+ min: number;
233
+ max: number;
234
+ };
235
+ /** If set, will return only NFTs with a name that contains the specified string */
236
+ searchName?: string;
237
+ /** The number of results to return */
238
+ top?: number;
239
+ /** The order by to use */
240
+ skip?: number;
241
+ /** The order of the results based on a field */
242
+ orderBy?: SearchOrderBy[];
243
+ /** If set, will return only the specified fields */
244
+ onlySelectFields?: FieldsToSelect[];
245
+ /** If set, will return only NFTs listed in the specified marketplaces */
246
+ listedOnlyOn?: Marketplace[];
247
+ /** If set, will return only NFTs with the specified attributes */
248
+ attributes?: MetadataAttribute[];
249
+ }
250
+ export interface SearchNFTsResponse {
251
+ /** The total count of the results for the specific query */
252
+ count: number;
253
+ /** The results count for the current page */
254
+ resultsCount: number;
255
+ /** The results for the current page */
256
+ results: NftData[];
257
+ /** If the results are empty */
258
+ empty: boolean;
259
+ /** The payload to use to get the next page */
260
+ getNextPagePayload: SearchNFTsArgs;
261
+ /** If there are more results to fetch */
262
+ hasMoreResults: boolean;
263
+ }
264
+ export interface TradingActivity {
265
+ action: string;
266
+ attributes: MetadataAttribute[];
267
+ avifUrl: string;
268
+ buyer: string;
269
+ buyerUsername: string;
270
+ collection: string;
271
+ egldValue: number;
272
+ id: string;
273
+ identifier: string;
274
+ marketplace: Marketplace;
275
+ name: string;
276
+ paymentToken: string;
277
+ price: number;
278
+ rank: number;
279
+ seller: string;
280
+ sellerUsername: string;
281
+ timestamp: number;
282
+ txHash: string;
283
+ url: string;
284
+ usdPrice: number;
285
+ webpUrl: string;
286
+ _ts: number;
287
+ }
288
+ export interface GetCollectionsArgs {
289
+ /** The collections to fetch the profile */
290
+ collections?: string[];
291
+ /** If true, will return only NFTs that are mintable */
292
+ onlyMintable?: boolean;
293
+ /** The number of results to return */
294
+ top?: number;
295
+ /** The order by to use */
296
+ skip?: number;
297
+ /** The order of the results based on a field */
298
+ orderBy?: CollectionsOrderBy;
299
+ /** If set, will return only the specified fields */
300
+ onlySelectFields?: CollectionsFieldsToSelect[];
301
+ }
302
+ export interface CollectionsNFTsResponse {
303
+ /** The results count for the current page */
304
+ resultsCount: number;
305
+ /** The results for the current page */
306
+ results: ICollectionProfile[];
307
+ /** If the results are empty */
308
+ empty: boolean;
309
+ /** The payload to use to get the next page */
310
+ getNextPagePayload: GetCollectionsArgs;
311
+ /** If there are more results to fetch */
312
+ hasMoreResults: boolean;
313
+ }
@@ -0,0 +1,3 @@
1
+ export * from './collection';
2
+ export * from './nft';
3
+ export * from './trading';
@@ -0,0 +1,16 @@
1
+ export type Offer = {
2
+ offer_id: number;
3
+ collection: string;
4
+ quantity: number;
5
+ payment_token: string;
6
+ payment_nonce: number;
7
+ price: number;
8
+ timestamp: number;
9
+ owner: string;
10
+ attributes: Array<{
11
+ trait_type: string;
12
+ value: string;
13
+ }>;
14
+ new_version: boolean;
15
+ price_long: string;
16
+ };
@@ -0,0 +1,93 @@
1
+ export interface NFTAttribute {
2
+ trait_type: string;
3
+ value: string;
4
+ occurance: number;
5
+ rarity: number;
6
+ frequency: number;
7
+ OnSale?: number;
8
+ FloorPrice?: number;
9
+ }
10
+ export interface NFTMetadata {
11
+ description?: string;
12
+ attributes: NFTAttribute[];
13
+ rarity: {
14
+ rank: number;
15
+ };
16
+ }
17
+ export interface OriginalMedia {
18
+ contentType: string;
19
+ contentLength: number;
20
+ }
21
+ export interface SaleInfoNft {
22
+ auction_id: number;
23
+ seller: string;
24
+ current_winner: string;
25
+ min_bid: string;
26
+ max_bid: string;
27
+ current_bid: string;
28
+ start_time: number;
29
+ deadline: number;
30
+ accepted_payment_token: string;
31
+ accepted_payment_token_nonce: number;
32
+ auction_type: string;
33
+ timestamp: number;
34
+ min_bid_short: number;
35
+ max_bid_short: number;
36
+ current_bid_short: number;
37
+ quantity: null | number;
38
+ marketplace: string;
39
+ usd: string;
40
+ usd_max_bid: string;
41
+ }
42
+ export interface NftValue {
43
+ floorValue: number;
44
+ avgValue: number;
45
+ maxValue: number;
46
+ collectionFp: number;
47
+ }
48
+ export interface GameData {
49
+ name: string;
50
+ value: number;
51
+ }
52
+ export interface OffersInfo {
53
+ EgldValue: number;
54
+ UsdValue: number;
55
+ deadline: number;
56
+ isActive: boolean;
57
+ offer_id: number;
58
+ owner: string;
59
+ ownerUsername: string;
60
+ payment_nonce: number;
61
+ payment_token: string;
62
+ price: string;
63
+ price_short: number;
64
+ quantity: number;
65
+ timestamp: number;
66
+ }
67
+ export interface NftData {
68
+ identifier: string;
69
+ collection: string;
70
+ attributes?: string;
71
+ nonce: number;
72
+ type: string;
73
+ name: string;
74
+ creator?: string;
75
+ royalties: number;
76
+ url: string;
77
+ avifUrl: string;
78
+ webpUrl: string;
79
+ wasProcessed: boolean;
80
+ onSale: boolean;
81
+ hasOffers?: boolean;
82
+ metadata: NFTMetadata;
83
+ originalMedia: OriginalMedia;
84
+ saleInfoNft: SaleInfoNft;
85
+ offersInfo: OffersInfo[];
86
+ gameData: GameData[];
87
+ owner?: string;
88
+ ownerCount?: number;
89
+ ownerUsername?: string;
90
+ isVerified: boolean;
91
+ isVisible: boolean;
92
+ nftValue?: NftValue;
93
+ }
@@ -0,0 +1,91 @@
1
+ import { Marketplace, MetadataAttribute, TradingActivity } from './collection';
2
+ export interface TradingActivityQueryFilter {
3
+ filters: {
4
+ collection?: string[];
5
+ identifier?: string[];
6
+ address?: string[];
7
+ tokens?: string[];
8
+ marketplace?: Marketplace[];
9
+ action?: string[];
10
+ range?: {
11
+ min: number;
12
+ max: number;
13
+ };
14
+ rankRange?: {
15
+ min: number;
16
+ max: number;
17
+ };
18
+ timestampRange?: {
19
+ min: number;
20
+ max: number;
21
+ };
22
+ attributes?: MetadataAttribute[];
23
+ };
24
+ top: number;
25
+ skip: number;
26
+ select?: SelectFieldsTradingActivity[];
27
+ orderBy?: OrderByTradingActivity[];
28
+ }
29
+ export interface TradincActivityArgs {
30
+ /** The collections to fetch the trading activity from */
31
+ collections?: string[];
32
+ /** The identifier of the NFTs to fetch the trading activity from */
33
+ identifiers?: string[];
34
+ /** The owners of the NFTs to fetch the trading activity from */
35
+ owners?: string[];
36
+ /** The marketplaces to fetch the trading activity from */
37
+ marketplaces?: Marketplace[];
38
+ /** The tokens to fetch the trading activity from */
39
+ placedInToken?: string[];
40
+ /** The price range to fetch the trading activity from */
41
+ priceRange?: {
42
+ min: number;
43
+ max: number;
44
+ };
45
+ /** The rank range to fetch the trading activity from */
46
+ rankRange?: {
47
+ min: number;
48
+ max: number;
49
+ };
50
+ /** The timestamp range to fetch the trading activity from */
51
+ timestampRange?: {
52
+ min: number;
53
+ max: number;
54
+ };
55
+ /** The number of results to return */
56
+ top?: number;
57
+ /** The number of results to skip */
58
+ skip?: number;
59
+ /** The actions to fetch the trading activity from */
60
+ actions?: string[];
61
+ /** The fields to select from the trading activity */
62
+ select?: SelectFieldsTradingActivity[];
63
+ /** The fields to order the trading activity by */
64
+ orderBy?: OrderByTradingActivity[];
65
+ /** The attributes to fetch the trading activity from */
66
+ attributes?: MetadataAttribute[];
67
+ }
68
+ export declare enum OrderByTradingActivity {
69
+ PriceHighToLow = "short_price desc",
70
+ PriceLowToHigh = "short_price asc",
71
+ RecentPlaced = "timestamp desc",
72
+ OldestPlaced = "timestamp asc"
73
+ }
74
+ export declare enum SelectFieldsTradingActivity {
75
+ 'attributes' = 0,
76
+ 'collection' = 1,
77
+ 'offer_id' = 2,
78
+ 'owner' = 3,
79
+ 'short_price' = 4,
80
+ 'price' = 5,
81
+ 'id' = 6,
82
+ 'dataType' = 7,
83
+ 'marketplace' = 8,
84
+ 'payment_token' = 9
85
+ }
86
+ export interface TradingActivityResponse {
87
+ hasMoreResults: boolean;
88
+ resources: TradingActivity[];
89
+ getNextPagePayload: TradincActivityArgs;
90
+ empty: boolean;
91
+ }
@@ -0,0 +1,15 @@
1
+ import { AbiRegistry } from '@multiversx/sdk-core';
2
+ export declare class SmartContractAbis {
3
+ private static manager;
4
+ private static exchange;
5
+ private static minter;
6
+ private static market;
7
+ private static staking;
8
+ private static p2p;
9
+ static getMarket(): Promise<AbiRegistry>;
10
+ static getManager(): Promise<AbiRegistry>;
11
+ static getMinter(): Promise<AbiRegistry>;
12
+ static getStaking(): Promise<AbiRegistry>;
13
+ static getExchange(): Promise<AbiRegistry>;
14
+ static getP2P(): Promise<AbiRegistry>;
15
+ }
@@ -0,0 +1,3 @@
1
+ import { SmartContract } from '@multiversx/sdk-core/out/smartcontracts/smartContract';
2
+ import type { AbiRegistry } from '@multiversx/sdk-core/out/smartcontracts/typesystem/abiRegistry';
3
+ export declare const getSmartContract: (abiRegistry: AbiRegistry, address: string) => SmartContract;
@@ -0,0 +1,23 @@
1
+ export declare enum Chain {
2
+ MAINNET = "1",
3
+ DEVNET = "D"
4
+ }
5
+ export declare class APIClient {
6
+ private static instance;
7
+ apiUrl: string;
8
+ private apiKey;
9
+ chain: Chain;
10
+ config: {
11
+ XO_SC: string;
12
+ FM_SC: string;
13
+ DR_SC: string;
14
+ KG_SC: string;
15
+ Staking_SC: string;
16
+ Manager_SC: string;
17
+ P2P_SC: string;
18
+ };
19
+ private constructor();
20
+ static init(apiUrl?: string, apiKey?: string, chain?: Chain): APIClient;
21
+ static getClient(): APIClient;
22
+ fetchWithTimeout: <T>(path: string, options?: Record<string, unknown>, timeout?: number) => Promise<T>;
23
+ }
@@ -0,0 +1,13 @@
1
+ export declare const API_URL = "https://api.xoxno.com";
2
+ export declare const API_URL_DEV = "https://api-dev.xoxno.com";
3
+ export declare const XOXNO_SC = "erd1qqqqqqqqqqqqqpgq6wegs2xkypfpync8mn2sa5cmpqjlvrhwz5nqgepyg8";
4
+ export declare const FM_SC = "erd1qqqqqqqqqqqqqpgq705fxpfrjne0tl3ece0rrspykq88mynn4kxs2cg43s";
5
+ export declare const DR_SC = "erd1qqqqqqqqqqqqqpgqd9rvv2n378e27jcts8vfwynpx0gfl5ufz6hqhfy0u0";
6
+ export declare const KG_SC = "erd1qqqqqqqqqqqqqpgq8xwzu82v8ex3h4ayl5lsvxqxnhecpwyvwe0sf2qj4e";
7
+ export declare const Staking_SC = "erd1qqqqqqqqqqqqqpgqvpkd3g3uwludduv3797j54qt6c888wa59w2shntt6z";
8
+ export declare const Manager_SC = "erd1qqqqqqqqqqqqqpgqg9fa0dmpn8fu3fnleeqn5zt8rl8mdqjkys5s2gtas7";
9
+ export declare const P2P_SC = "erd1qqqqqqqqqqqqqpgq47y8hnct68v6asjv6gxem6h9rumn9frzah0skhxxt6";
10
+ export declare const XOXNO_SC_DEV = "erd1qqqqqqqqqqqqqpgqn4fnwl43hhchz9emdy66eh5azzhl599zd8ssxjdyh3";
11
+ export declare const Staking_SC_DEV = "erd1qqqqqqqqqqqqqpgqmkt2fvumf0zgum5qd0awl2l46x2pxdgmr5rswjr6r8";
12
+ export declare const Manager_SC_DEV = "erd1qqqqqqqqqqqqqpgq6sysl7mga393a850xemfpawaqanf4da5d8ssp3xamn";
13
+ export declare const P2P_SC_DEV = "erd1qqqqqqqqqqqqqpgqhuvnvkwwmucdzy3g7pvgvjumjfcgfwf69w2svch5c2";
@@ -0,0 +1,10 @@
1
+ import { TradincActivityArgs, TradingActivityResponse } from '../types/trading';
2
+ import { APIClient } from '../utils/api';
3
+ /**
4
+ * Fetches the trading activity of the given collections
5
+ * @param args - The trading activity arguments
6
+ * @param api - The API client
7
+ * @returns - The trading activity response
8
+ * @throws - If the top is greater than 35
9
+ */
10
+ export declare const getActivity: (args: TradincActivityArgs, api: APIClient) => Promise<TradingActivityResponse>;
@@ -0,0 +1,2 @@
1
+ export declare const nonceToHex: (nonce: number) => string;
2
+ export declare const getIdentifierFromColAndNonce: (collection: string, nonce: number) => string;
@@ -0,0 +1,2 @@
1
+ export declare const isValidCollectionTicker: (ticker: string) => boolean;
2
+ export declare const isValidNftIdentifier: (identifier: string) => boolean;
@@ -0,0 +1,9 @@
1
+ import type { SmartContract } from '@multiversx/sdk-core/out/smartcontracts/smartContract';
2
+ import type { Interaction } from '@multiversx/sdk-core/out/smartcontracts/interaction';
3
+ import type { TypedOutcomeBundle } from '@multiversx/sdk-core/out/smartcontracts/interface';
4
+ export declare class ContractQueryRunner {
5
+ private readonly proxy;
6
+ private readonly parser;
7
+ constructor();
8
+ runQuery(contract: SmartContract, interaction: Interaction): Promise<TypedOutcomeBundle>;
9
+ }
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@xoxno/sdk-js",
3
- "version": "0.0.5-alpha",
3
+ "version": "0.0.6-alpha",
4
4
  "description": "The SDK to interact with the XOXNO Protocol!",
5
- "main": "./dist/xoxno.min.js",
5
+ "main": "./dist/index.min.js",
6
+ "types": "./dist/index.d.js",
6
7
  "scripts": {
7
8
  "test": "jest",
8
9
  "build": "webpack",
package/src/index.ts CHANGED
@@ -1,4 +1,3 @@
1
- import { CollectionModule } from './collection';
2
1
  import { APIClient } from './utils/api';
3
2
  import { API_URL } from './utils/const';
4
3
 
@@ -7,7 +6,6 @@ import { API_URL } from './utils/const';
7
6
  * interacting with an XOXNO API.
8
7
  */
9
8
  export class XOXNO {
10
- public collection: CollectionModule;
11
9
  /**
12
10
  * Creates a new XOXNO instance.
13
11
  * @param apiUrl - The base URL of the XOXNO API.
@@ -15,6 +13,5 @@ export class XOXNO {
15
13
  */
16
14
  constructor(apiUrl: string = API_URL, apiKey = '') {
17
15
  APIClient.init(apiUrl, apiKey);
18
- this.collection = new CollectionModule();
19
16
  }
20
17
  }
package/tsconfig.json CHANGED
@@ -1,14 +1,26 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "target": "ESNext",
4
- "module": "ESNext",
5
- "outDir": "./dist",
3
+ "module": "CommonJS",
4
+ "target": "es2015",
5
+ "outDir": "dist",
6
+ "lib": ["ES2015", "DOM"],
7
+ "sourceMap": true,
8
+ "allowJs": true,
6
9
  "strict": true,
7
- "esModuleInterop": true,
8
- "isolatedModules": true,
10
+ "strictPropertyInitialization": true,
11
+ "strictNullChecks": true,
9
12
  "skipLibCheck": true,
10
- "moduleResolution": "node",
11
- "forceConsistentCasingInFileNames": true
13
+ "noImplicitReturns": true,
14
+ "noFallthroughCasesInSwitch": true,
15
+ "noUnusedParameters": true,
16
+ "esModuleInterop": true,
17
+ "declaration": true
12
18
  },
13
- "include": ["src"]
19
+ "include": ["src"],
20
+ "exclude": [
21
+ "node_modules",
22
+ "dist",
23
+ "**/*.test.d.ts",
24
+ "**/*.test.ts",
25
+ ]
14
26
  }
package/webpack.config.js CHANGED
@@ -6,7 +6,7 @@ module.exports = {
6
6
  entry: './src/index.ts',
7
7
  output: {
8
8
  path: path.resolve(__dirname, 'dist'),
9
- filename: 'xoxno.min.js',
9
+ filename: 'index.min.js',
10
10
  library: {
11
11
  name: 'XOXNO',
12
12
  type: 'umd',
package/dist/xoxno.min.js DELETED
@@ -1 +0,0 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.XOXNO=t():e.XOXNO=t()}(self,(()=>(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function n(e,t){return function(){return e.apply(t,arguments)}}e.r(t),e.d(t,{XOXNO:()=>We});const{toString:r}=Object.prototype,{getPrototypeOf:o}=Object,i=(s=Object.create(null),e=>{const t=r.call(e);return s[t]||(s[t]=t.slice(8,-1).toLowerCase())});var s;const a=e=>(e=e.toLowerCase(),t=>i(t)===e),c=e=>t=>typeof t===e,{isArray:l}=Array,u=c("undefined"),f=a("ArrayBuffer"),d=c("string"),p=c("function"),h=c("number"),m=e=>null!==e&&"object"==typeof e,g=e=>{if("object"!==i(e))return!1;const t=o(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},y=a("Date"),b=a("File"),w=a("Blob"),q=a("FileList"),E=a("URLSearchParams");function O(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),l(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let s;for(r=0;r<i;r++)s=o[r],t.call(null,e[s],s,e)}}function S(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const R="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,v=e=>!u(e)&&e!==R,T=(A="undefined"!=typeof Uint8Array&&o(Uint8Array),e=>A&&e instanceof A);var A;const N=a("HTMLFormElement"),C=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),x=a("RegExp"),j=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};O(n,((n,o)=>{!1!==t(n,o,e)&&(r[o]=n)})),Object.defineProperties(e,r)},P="abcdefghijklmnopqrstuvwxyz",k="0123456789",_={DIGIT:k,ALPHA:P,ALPHA_DIGIT:P+P.toUpperCase()+k},B={isArray:l,isArrayBuffer:f,isBuffer:function(e){return null!==e&&!u(e)&&null!==e.constructor&&!u(e.constructor)&&p(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{const t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||r.call(e)===t||p(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&f(e.buffer),t},isString:d,isNumber:h,isBoolean:e=>!0===e||!1===e,isObject:m,isPlainObject:g,isUndefined:u,isDate:y,isFile:b,isBlob:w,isRegExp:x,isFunction:p,isStream:e=>m(e)&&p(e.pipe),isURLSearchParams:E,isTypedArray:T,isFileList:q,forEach:O,merge:function e(){const{caseless:t}=v(this)&&this||{},n={},r=(r,o)=>{const i=t&&S(n,o)||o;g(n[i])&&g(r)?n[i]=e(n[i],r):g(r)?n[i]=e({},r):l(r)?n[i]=r.slice():n[i]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&O(arguments[e],r);return n},extend:(e,t,r,{allOwnKeys:o}={})=>(O(t,((t,o)=>{r&&p(t)?e[o]=n(t,r):e[o]=t}),{allOwnKeys:o}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,s,a;const c={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;)a=i[s],r&&!r(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==n&&o(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:i,kindOfTest:a,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(l(e))return e;let t=e.length;if(!h(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:N,hasOwnProperty:C,hasOwnProp:C,reduceDescriptors:j,freezeMethods:e=>{j(e,((t,n)=>{if(p(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];p(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return l(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:S,global:R,isContextDefined:v,ALPHABET:_,generateString:(e=16,t=_.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&p(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(m(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=l(e)?[]:{};return O(e,((e,t)=>{const i=n(e,r+1);!u(i)&&(o[t]=i)})),t[r]=void 0,o}}return e};return n(e,0)}};function U(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}B.inherits(U,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:B.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const F=U.prototype,D={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{D[e]={value:e}})),Object.defineProperties(U,D),Object.defineProperty(F,"isAxiosError",{value:!0}),U.from=(e,t,n,r,o,i)=>{const s=Object.create(F);return B.toFlatObject(e,s,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),U.call(s,e.message,t,n,r,o),s.cause=e,s.name=e.name,i&&Object.assign(s,i),s};const L=U;function I(e){return B.isPlainObject(e)||B.isArray(e)}function M(e){return B.endsWith(e,"[]")?e.slice(0,-2):e}function z(e,t,n){return e?e.concat(t).map((function(e,t){return e=M(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const J=B.toFlatObject(B,{},null,(function(e){return/^is[A-Z]/.test(e)})),W=function(e,t,n){if(!B.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=B.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!B.isUndefined(t[e])}))).metaTokens,o=n.visitor||l,i=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&B.isSpecCompliantForm(t);if(!B.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(B.isDate(e))return e.toISOString();if(!a&&B.isBlob(e))throw new L("Blob is not supported. Use a Buffer instead.");return B.isArrayBuffer(e)||B.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(B.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(B.isArray(e)&&function(e){return B.isArray(e)&&!e.some(I)}(e)||(B.isFileList(e)||B.endsWith(n,"[]"))&&(a=B.toArray(e)))return n=M(n),a.forEach((function(e,r){!B.isUndefined(e)&&null!==e&&t.append(!0===s?z([n],r,i):null===s?n:n+"[]",c(e))})),!1;return!!I(e)||(t.append(z(o,n,i),c(e)),!1)}const u=[],f=Object.assign(J,{defaultVisitor:l,convertValue:c,isVisitable:I});if(!B.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!B.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),B.forEach(n,(function(n,i){!0===(!(B.isUndefined(n)||null===n)&&o.call(t,n,B.isString(i)?i.trim():i,r,f))&&e(n,r?r.concat(i):[i])})),u.pop()}}(e),t};function H(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function $(e,t){this._pairs=[],e&&W(e,this,t)}const K=$.prototype;K.append=function(e,t){this._pairs.push([e,t])},K.toString=function(e){const t=e?function(t){return e.call(this,t,H)}:H;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const V=$;function X(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function G(e,t,n){if(!t)return e;const r=n&&n.encode||X,o=n&&n.serialize;let i;if(i=o?o(t,n):B.isURLSearchParams(t)?t.toString():new V(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}const Q=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){B.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Z={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Y={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:V,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]},ee=function(e){function t(e,n,r,o){let i=e[o++];const s=Number.isFinite(+i),a=o>=e.length;return i=!i&&B.isArray(r)?r.length:i,a?(B.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!s):(r[i]&&B.isObject(r[i])||(r[i]=[]),t(e,n,r[i],o)&&B.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}(r[i])),!s)}if(B.isFormData(e)&&B.isFunction(e.entries)){const n={};return B.forEachEntry(e,((e,r)=>{t(function(e){return B.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null},te={"Content-Type":void 0},ne={transitional:Z,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=B.isObject(e);if(o&&B.isHTMLForm(e)&&(e=new FormData(e)),B.isFormData(e))return r&&r?JSON.stringify(ee(e)):e;if(B.isArrayBuffer(e)||B.isBuffer(e)||B.isStream(e)||B.isFile(e)||B.isBlob(e))return e;if(B.isArrayBufferView(e))return e.buffer;if(B.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return W(e,new Y.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return Y.isNode&&B.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((i=B.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return W(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(B.isString(e))try{return(0,JSON.parse)(e),B.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ne.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&B.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw L.from(e,L.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Y.classes.FormData,Blob:Y.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};B.forEach(["delete","get","head"],(function(e){ne.headers[e]={}})),B.forEach(["post","put","patch"],(function(e){ne.headers[e]=B.merge(te)}));const re=ne,oe=B.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ie=Symbol("internals");function se(e){return e&&String(e).trim().toLowerCase()}function ae(e){return!1===e||null==e?e:B.isArray(e)?e.map(ae):String(e)}function ce(e,t,n,r,o){return B.isFunction(r)?r.call(this,t,n):(o&&(t=n),B.isString(t)?B.isString(r)?-1!==t.indexOf(r):B.isRegExp(r)?r.test(t):void 0:void 0)}class le{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=se(t);if(!o)throw new Error("header name must be a non-empty string");const i=B.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=ae(e))}const i=(e,t)=>B.forEach(e,((e,n)=>o(e,n,t)));return B.isPlainObject(e)||e instanceof this.constructor?i(e,t):B.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z]+$/.test(e.trim())?i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&oe[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&o(t,e,n),this}get(e,t){if(e=se(e)){const n=B.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(B.isFunction(t))return t.call(this,e,n);if(B.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=se(e)){const n=B.findKey(this,e);return!(!n||void 0===this[n]||t&&!ce(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=se(e)){const o=B.findKey(n,e);!o||t&&!ce(0,n[o],o,t)||(delete n[o],r=!0)}}return B.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!ce(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return B.forEach(this,((r,o)=>{const i=B.findKey(n,o);if(i)return t[i]=ae(r),void delete t[o];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();s!==o&&delete t[o],t[s]=ae(r),n[s]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return B.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&B.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[ie]=this[ie]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=se(e);t[r]||(function(e,t){const n=B.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return B.isArray(e)?e.forEach(r):r(e),this}}le.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),B.freezeMethods(le.prototype),B.freezeMethods(le);const ue=le;function fe(e,t){const n=this||re,r=t||n,o=ue.from(r.headers);let i=r.data;return B.forEach(e,(function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)})),o.normalize(),i}function de(e){return!(!e||!e.__CANCEL__)}function pe(e,t,n){L.call(this,null==e?"canceled":e,L.ERR_CANCELED,t,n),this.name="CanceledError"}B.inherits(pe,L,{__CANCEL__:!0});const he=pe,me=Y.isStandardBrowserEnv?{write:function(e,t,n,r,o,i){const s=[];s.push(e+"="+encodeURIComponent(t)),B.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),B.isString(r)&&s.push("path="+r),B.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function ge(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const ye=Y.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=B.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function be(e,t){let n=0;const r=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,s=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=r[s];o||(o=c),n[i]=a,r[i]=c;let u=s,f=0;for(;u!==i;)f+=n[u++],u%=e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),c-o<t)return;const d=l&&c-l;return d?Math.round(1e3*f/d):void 0}}(50,250);return o=>{const i=o.loaded,s=o.lengthComputable?o.total:void 0,a=i-n,c=r(a);n=i;const l={loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&i<=s?(s-i)/c:void 0,event:o};l[t?"download":"upload"]=!0,e(l)}}const we={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const o=ue.from(e.headers).normalize(),i=e.responseType;let s;function a(){e.cancelToken&&e.cancelToken.unsubscribe(s),e.signal&&e.signal.removeEventListener("abort",s)}B.isFormData(r)&&(Y.isStandardBrowserEnv||Y.isStandardBrowserWebWorkerEnv)&&o.setContentType(!1);let c=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(t+":"+n))}const l=ge(e.baseURL,e.url);function u(){if(!c)return;const r=ue.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new L("Request failed with status code "+n.status,[L.ERR_BAD_REQUEST,L.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),a()}),(function(e){n(e),a()}),{data:i&&"text"!==i&&"json"!==i?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:r,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),G(l,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=u:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(u)},c.onabort=function(){c&&(n(new L("Request aborted",L.ECONNABORTED,e,c)),c=null)},c.onerror=function(){n(new L("Network Error",L.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||Z;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new L(t,r.clarifyTimeoutError?L.ETIMEDOUT:L.ECONNABORTED,e,c)),c=null},Y.isStandardBrowserEnv){const t=(e.withCredentials||ye(l))&&e.xsrfCookieName&&me.read(e.xsrfCookieName);t&&o.set(e.xsrfHeaderName,t)}void 0===r&&o.setContentType(null),"setRequestHeader"in c&&B.forEach(o.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),B.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),i&&"json"!==i&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",be(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",be(e.onUploadProgress)),(e.cancelToken||e.signal)&&(s=t=>{c&&(n(!t||t.type?new he(null,e,c):t),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(s),e.signal&&(e.signal.aborted?s():e.signal.addEventListener("abort",s)));const f=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(l);f&&-1===Y.protocols.indexOf(f)?n(new L("Unsupported protocol "+f+":",L.ERR_BAD_REQUEST,e)):c.send(r||null)}))}};B.forEach(we,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));function qe(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new he(null,e)}function Ee(e){return qe(e),e.headers=ue.from(e.headers),e.data=fe.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),(e=>{e=B.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let o=0;o<t&&(n=e[o],!(r=B.isString(n)?we[n.toLowerCase()]:n));o++);if(!r){if(!1===r)throw new L(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(B.hasOwnProp(we,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`)}if(!B.isFunction(r))throw new TypeError("adapter is not a function");return r})(e.adapter||re.adapter)(e).then((function(t){return qe(e),t.data=fe.call(e,e.transformResponse,t),t.headers=ue.from(t.headers),t}),(function(t){return de(t)||(qe(e),t&&t.response&&(t.response.data=fe.call(e,e.transformResponse,t.response),t.response.headers=ue.from(t.response.headers))),Promise.reject(t)}))}const Oe=e=>e instanceof ue?e.toJSON():e;function Se(e,t){t=t||{};const n={};function r(e,t,n){return B.isPlainObject(e)&&B.isPlainObject(t)?B.merge.call({caseless:n},e,t):B.isPlainObject(t)?B.merge({},t):B.isArray(t)?t.slice():t}function o(e,t,n){return B.isUndefined(t)?B.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function i(e,t){if(!B.isUndefined(t))return r(void 0,t)}function s(e,t){return B.isUndefined(t)?B.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t)=>o(Oe(e),Oe(t),!0)};return B.forEach(Object.keys(e).concat(Object.keys(t)),(function(r){const i=c[r]||o,s=i(e[r],t[r],r);B.isUndefined(s)&&i!==a||(n[r]=s)})),n}const Re={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Re[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const ve={};Re.transitional=function(e,t,n){function r(e,t){return"[Axios v1.3.4] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new L(r(o," has been removed"+(t?" in "+t:"")),L.ERR_DEPRECATED);return t&&!ve[o]&&(ve[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}};const Te={assertOptions:function(e,t,n){if("object"!=typeof e)throw new L("options must be an object",L.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=t[i];if(s){const t=e[i],n=void 0===t||s(t,i,e);if(!0!==n)throw new L("option "+i+" must be "+n,L.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new L("Unknown option "+i,L.ERR_BAD_OPTION)}},validators:Re},Ae=Te.validators;class Ne{constructor(e){this.defaults=e,this.interceptors={request:new Q,response:new Q}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Se(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;let i;void 0!==n&&Te.assertOptions(n,{silentJSONParsing:Ae.transitional(Ae.boolean),forcedJSONParsing:Ae.transitional(Ae.boolean),clarifyTimeoutError:Ae.transitional(Ae.boolean)},!1),void 0!==r&&Te.assertOptions(r,{encode:Ae.function,serialize:Ae.function},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase(),i=o&&B.merge(o.common,o[t.method]),i&&B.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=ue.concat(i,o);const s=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const c=[];let l;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let u,f=0;if(!a){const e=[Ee.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,c),u=e.length,l=Promise.resolve(t);f<u;)l=l.then(e[f++],e[f++]);return l}u=s.length;let d=t;for(f=0;f<u;){const e=s[f++],t=s[f++];try{d=e(d)}catch(e){t.call(this,e);break}}try{l=Ee.call(this,d)}catch(e){return Promise.reject(e)}for(f=0,u=c.length;f<u;)l=l.then(c[f++],c[f++]);return l}getUri(e){return G(ge((e=Se(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}B.forEach(["delete","get","head","options"],(function(e){Ne.prototype[e]=function(t,n){return this.request(Se(n||{},{method:e,url:t,data:(n||{}).data}))}})),B.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(Se(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Ne.prototype[e]=t(),Ne.prototype[e+"Form"]=t(!0)}));const Ce=Ne;class xe{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new he(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new xe((function(t){e=t})),cancel:e}}}const je=xe,Pe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Pe).forEach((([e,t])=>{Pe[t]=e}));const ke=Pe,_e=function e(t){const r=new Ce(t),o=n(Ce.prototype.request,r);return B.extend(o,Ce.prototype,r,{allOwnKeys:!0}),B.extend(o,r,null,{allOwnKeys:!0}),o.create=function(n){return e(Se(t,n))},o}(re);_e.Axios=Ce,_e.CanceledError=he,_e.CancelToken=je,_e.isCancel=de,_e.VERSION="1.3.4",_e.toFormData=W,_e.AxiosError=L,_e.Cancel=_e.CanceledError,_e.all=function(e){return Promise.all(e)},_e.spread=function(e){return function(t){return e.apply(null,t)}},_e.isAxiosError=function(e){return B.isObject(e)&&!0===e.isAxiosError},_e.mergeConfig=Se,_e.AxiosHeaders=ue,_e.formToJSON=e=>ee(B.isHTMLForm(e)?new FormData(e):e),_e.HttpStatusCode=ke,_e.default=_e;const Be=_e,Ue="https://api.xoxno.com",Fe="erd1qqqqqqqqqqqqqpgq705fxpfrjne0tl3ece0rrspykq88mynn4kxs2cg43s",De="erd1qqqqqqqqqqqqqpgqd9rvv2n378e27jcts8vfwynpx0gfl5ufz6hqhfy0u0",Le="erd1qqqqqqqqqqqqqpgq8xwzu82v8ex3h4ayl5lsvxqxnhecpwyvwe0sf2qj4e";var Ie;!function(e){e.MAINNET="1",e.DEVNET="D"}(Ie||(Ie={}));class Me{static instance;apiUrl;apiKey;chain;config;constructor(e,t,n){this.apiUrl=e,this.apiKey=t,this.chain=n,this.config=n===Ie.MAINNET?{XO_SC:"erd1qqqqqqqqqqqqqpgq6wegs2xkypfpync8mn2sa5cmpqjlvrhwz5nqgepyg8",FM_SC:Fe,DR_SC:De,KG_SC:Le,Staking_SC:"erd1qqqqqqqqqqqqqpgqvpkd3g3uwludduv3797j54qt6c888wa59w2shntt6z",Manager_SC:"erd1qqqqqqqqqqqqqpgqg9fa0dmpn8fu3fnleeqn5zt8rl8mdqjkys5s2gtas7",P2P_SC:"erd1qqqqqqqqqqqqqpgq47y8hnct68v6asjv6gxem6h9rumn9frzah0skhxxt6"}:{XO_SC:"erd1qqqqqqqqqqqqqpgqn4fnwl43hhchz9emdy66eh5azzhl599zd8ssxjdyh3",FM_SC:Fe,DR_SC:De,KG_SC:Le,Staking_SC:"erd1qqqqqqqqqqqqqpgqmkt2fvumf0zgum5qd0awl2l46x2pxdgmr5rswjr6r8",Manager_SC:"erd1qqqqqqqqqqqqqpgq6sysl7mga393a850xemfpawaqanf4da5d8ssp3xamn",P2P_SC:"erd1qqqqqqqqqqqqqpgqhuvnvkwwmucdzy3g7pvgvjumjfcgfwf69w2svch5c2"}}static init(e=Ue,t="",n=Ie.MAINNET){return Me.instance||(Me.instance=new Me(e,t,n)),Me.instance}static getClient(){if(!Me.instance)throw new Error("APIClient has not been initialized");return Me.instance}fetchWithTimeout=async(e,t={},n=4e4)=>{const r={"Accept-Encoding":"gzip,deflate,br","xo-time":`Sent-At:${Math.round((new Date).getTime()/1e3)}`,Referer:"https://xoxno.sdk","User-Agent":"XOXNO/1.0/SDK",..."POST"===t.method?{"Content-Type":"application/json"}:{},...t.headers??{}};try{const{data:o}=await Be(`${this.apiUrl}${e}${t.params?"?"+Object.keys(t.params).map((e=>`${e}=${encodeURIComponent(t.params[e])}`)).join("&"):""}`,{timeout:n,...t,...Object.keys(r).length?{headers:r}:{},method:t.method??"GET"});return o}catch(n){throw new Error("Something went wrong inside fetchWithTimeout "+e+" "+JSON.stringify(t)+" "+n)}}}const ze=e=>/^[A-Z0-9]{3,10}-[a-z0-9]{6}$/.test(e);class Je{api;constructor(){this.api=Me.getClient()}getCollectionProfile=async e=>{if(!ze(e))throw new Error("Invalid collection ticker: "+e);return await this.api.fetchWithTimeout(`/getCollectionProfile/${e}`)};getCollectionFloorPrice=async(e,t="EGLD")=>{if(!ze(e))throw new Error("Invalid collection ticker: "+e);return await this.api.fetchWithTimeout(`/getFloorPrice/${e}/${t}`)};getCollectionAttributes=async e=>{if(!ze(e))throw new Error("Invalid collection ticker: "+e);return await this.api.fetchWithTimeout(`/getCollectionAttributes/${e}`)};searchNFTs=async e=>{if(!ze(e.collection))throw new Error("Invalid collection ticker: "+e.collection);if(e.top&&e.top>35)throw new Error("Top cannot be greater than 35");const t={filters:{onSale:e.onlyOnSale||!1,marketplace:e.listedOnlyOn||void 0,auctionTypes:e.onlyOnSale?e.onlyAuctions?["NftBid","SftAll"]:["Nft","SftOnePerPayment"]:void 0,tokens:e.listedInToken||void 0,attributes:e.attributes||void 0,range:e.priceRange?{...e.priceRange,type:e.onlyAuctions?"saleInfoNft/current_bid_short":"saleInfoNft/min_bid_short"}:void 0,rankRange:e.rankRange||void 0,levelRange:e.cantinaLevelRange||void 0},name:e.searchName||"",orderBy:e.orderBy||void 0,collection:e.collection,select:e.onlySelectFields||void 0,top:e.top||35,skip:e.skip||0},n=Buffer.from(JSON.stringify(t)).toString("base64"),r=await this.api.fetchWithTimeout(`/searchNFTs/${n}`);return{...r,getNextPagePayload:{...e,skip:(e.skip??0)+(e.top??35)},hasMoreResults:r.resultsCount>(e.skip??0)+(e.top??35)}};getTradingActivity=async e=>await(async(e,t)=>{if(e.top&&e.top>35)throw new Error("Top cannot be greater than 35");const n={filters:{collection:e.collections,identifier:e.identifiers||void 0,address:e.owners||void 0,tokens:e.placedInToken||void 0,marketplace:e.marketplaces||void 0,action:e.actions||void 0,range:e.priceRange,rankRange:e.rankRange,timestampRange:e.timestampRange,attributes:e.attributes},orderBy:e.orderBy,select:e.select,top:e.top||35,skip:e.skip||0},r=Buffer.from(JSON.stringify(n)).toString("base64"),o=await t.fetchWithTimeout(`/getTradingActivity/${r}`);return{...o,getNextPagePayload:{...e,skip:(e.skip??0)+(e.top??35)},empty:0===o.resources.length}})(e,this.api);getCollections=async e=>{if(e?.top&&e.top>25)throw new Error("Top cannot be greater than 25");const t={skip:e?.skip||0,top:e?.top||25,select:e?.onlySelectFields||[],filters:{dataType:"collectionProfile",isMintable:e?.onlyMintable||void 0,...e?.collections&&e.collections.length>0&&{collection:e.collections}},orderBy:[e?.orderBy||"statistics.tradeData.weekEgldVolume desc"]},n=Buffer.from(JSON.stringify(t)).toString("base64"),r=await this.api.fetchWithTimeout(`/collections/${n}`);return{results:r,resultsCount:r.length,empty:0===r.length,getNextPagePayload:{...e,skip:(e?.skip||0)+(e?.top||25)},hasMoreResults:r.length<(e?.top||25)}}}class We{collection;constructor(e=Ue,t=""){Me.init(e,t),this.collection=new Je}}return t})()));