@xoxno/sdk-js 0.0.1 → 0.0.2-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/npm-publish.yml +33 -0
- package/README.md +22 -0
- package/dist/xoxno.min.js +1 -0
- package/package.json +1 -1
- package/src/launchpad/__tests__/market.test.ts +25 -0
- package/src/launchpad/index.ts +166 -0
- package/coverage/clover.xml +0 -280
- package/coverage/coverage-final.json +0 -12
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/collection/index.html +0 -116
- package/coverage/lcov-report/collection/index.ts.html +0 -559
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -161
- package/coverage/lcov-report/interactions/index.html +0 -116
- package/coverage/lcov-report/interactions/index.ts.html +0 -775
- package/coverage/lcov-report/nft/index.html +0 -116
- package/coverage/lcov-report/nft/index.ts.html +0 -379
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -196
- package/coverage/lcov-report/utils/SmartContractAbis.ts.html +0 -331
- package/coverage/lcov-report/utils/SmartContractService.ts.html +0 -136
- package/coverage/lcov-report/utils/api.ts.html +0 -484
- package/coverage/lcov-report/utils/const.ts.html +0 -163
- package/coverage/lcov-report/utils/getActivity.ts.html +0 -250
- package/coverage/lcov-report/utils/helpers.ts.html +0 -127
- package/coverage/lcov-report/utils/index.html +0 -221
- package/coverage/lcov-report/utils/regex.ts.html +0 -106
- package/coverage/lcov-report/utils/scCalls.ts.html +0 -229
- package/coverage/lcov.info +0 -525
- package/docs/.nojekyll +0 -1
- package/docs/assets/highlight.css +0 -64
- package/docs/assets/main.js +0 -58
- package/docs/assets/search.js +0 -1
- package/docs/assets/style.css +0 -1279
- package/docs/classes/collection.CollectionModule.html +0 -232
- package/docs/classes/interactions.SCInteraction.html +0 -370
- package/docs/classes/nft.NFTModule.html +0 -208
- package/docs/classes/utils_SmartContractAbis.SmartContractAbis.html +0 -198
- package/docs/classes/utils_api.APIClient.html +0 -212
- package/docs/classes/utils_scCalls.ContractQueryRunner.html +0 -129
- package/docs/enums/types_collection.FieldsToSelect.html +0 -186
- package/docs/enums/types_collection.Marketplace.html +0 -102
- package/docs/enums/types_collection.SearchOrderBy.html +0 -130
- package/docs/enums/types_trading.OrderByTradingActivity.html +0 -102
- package/docs/enums/types_trading.SelectFieldsTradingActivity.html +0 -144
- package/docs/enums/utils_api.Chain.html +0 -88
- package/docs/functions/utils_SmartContractService.getSmartContract.html +0 -77
- package/docs/functions/utils_getActivity.getActivity.html +0 -89
- package/docs/functions/utils_helpers.getIdentifierFromColAndNonce.html +0 -76
- package/docs/functions/utils_helpers.nonceToHex.html +0 -74
- package/docs/functions/utils_regex.isValidCollectionTicker.html +0 -74
- package/docs/functions/utils_regex.isValidNftIdentifier.html +0 -74
- package/docs/index.html +0 -55
- package/docs/interfaces/types_collection.AttributeData.html +0 -99
- package/docs/interfaces/types_collection.Filter.html +0 -157
- package/docs/interfaces/types_collection.GlobalOffer.html +0 -176
- package/docs/interfaces/types_collection.ICollectionAttributes.html +0 -85
- package/docs/interfaces/types_collection.ICollectionProfile.html +0 -263
- package/docs/interfaces/types_collection.IMintInfo.html +0 -155
- package/docs/interfaces/types_collection.ISocials.html +0 -127
- package/docs/interfaces/types_collection.MetadataAttribute.html +0 -92
- package/docs/interfaces/types_collection.SearchNFTs.html +0 -127
- package/docs/interfaces/types_collection.SearchNFTsArgs.html +0 -225
- package/docs/interfaces/types_collection.SearchNFTsResponse.html +0 -132
- package/docs/interfaces/types_collection.TradingActivity.html +0 -232
- package/docs/interfaces/types_collection.TraitValues.html +0 -85
- package/docs/interfaces/types_nft.GameData.html +0 -92
- package/docs/interfaces/types_nft.NFTAttribute.html +0 -127
- package/docs/interfaces/types_nft.NFTMetadata.html +0 -104
- package/docs/interfaces/types_nft.NftData.html +0 -253
- package/docs/interfaces/types_nft.NftValue.html +0 -106
- package/docs/interfaces/types_nft.OffersInfo.html +0 -169
- package/docs/interfaces/types_nft.OriginalMedia.html +0 -92
- package/docs/interfaces/types_nft.SaleInfoNft.html +0 -211
- package/docs/interfaces/types_trading.TradincActivityArgs.html +0 -225
- package/docs/interfaces/types_trading.TradingActivityQueryFilter.html +0 -151
- package/docs/interfaces/types_trading.TradingActivityResponse.html +0 -106
- package/docs/modules/collection.html +0 -71
- package/docs/modules/interactions.html +0 -71
- package/docs/modules/nft.html +0 -71
- package/docs/modules/types.html +0 -189
- package/docs/modules/types_collection.html +0 -104
- package/docs/modules/types_interactions.html +0 -69
- package/docs/modules/types_nft.html +0 -85
- package/docs/modules/types_trading.html +0 -82
- package/docs/modules/utils_SmartContractAbis.html +0 -71
- package/docs/modules/utils_SmartContractService.html +0 -71
- package/docs/modules/utils_api.html +0 -76
- package/docs/modules/utils_const.html +0 -95
- package/docs/modules/utils_getActivity.html +0 -71
- package/docs/modules/utils_helpers.html +0 -73
- package/docs/modules/utils_regex.html +0 -73
- package/docs/modules/utils_scCalls.html +0 -71
- package/docs/modules.html +0 -76
- package/docs/types/types_interactions.Offer.html +0 -89
- package/docs/variables/utils_const.API_URL.html +0 -76
- package/docs/variables/utils_const.API_URL_DEV.html +0 -76
- package/docs/variables/utils_const.DR_SC.html +0 -76
- package/docs/variables/utils_const.FM_SC.html +0 -76
- package/docs/variables/utils_const.KG_SC.html +0 -76
- package/docs/variables/utils_const.Manager_SC.html +0 -76
- package/docs/variables/utils_const.Manager_SC_DEV.html +0 -76
- package/docs/variables/utils_const.P2P_SC.html +0 -76
- package/docs/variables/utils_const.P2P_SC_DEV.html +0 -76
- package/docs/variables/utils_const.Staking_SC.html +0 -76
- package/docs/variables/utils_const.Staking_SC_DEV.html +0 -76
- package/docs/variables/utils_const.XOXNO_SC.html +0 -76
- package/docs/variables/utils_const.XOXNO_SC_DEV.html +0 -76
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
|
2
|
+
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
|
|
3
|
+
|
|
4
|
+
name: Node.js Package
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
release:
|
|
8
|
+
types: [created]
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v3
|
|
15
|
+
- uses: actions/setup-node@v3
|
|
16
|
+
with:
|
|
17
|
+
node-version: 16
|
|
18
|
+
- run: npm ci
|
|
19
|
+
- run: npm test
|
|
20
|
+
|
|
21
|
+
publish-npm:
|
|
22
|
+
needs: build
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v3
|
|
26
|
+
- uses: actions/setup-node@v3
|
|
27
|
+
with:
|
|
28
|
+
node-version: 16
|
|
29
|
+
registry-url: https://registry.npmjs.org/
|
|
30
|
+
- run: npm ci
|
|
31
|
+
- run: npm publish
|
|
32
|
+
env:
|
|
33
|
+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
package/README.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# XOXNO SDK
|
|
2
|
+
|
|
3
|
+
XOXNO SDK is a JavaScript library that simplifies the interaction with the XOXNO Protocol for developers. It includes a set of helper functions and modules that make it easy to fetch, filter, and interact with data from the XOXNO Protocol and its NFT marketplace.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Installation](#installation)
|
|
8
|
+
- [Usage](#usage)
|
|
9
|
+
- [Initialization](#initialization)
|
|
10
|
+
- [Fetching Data](#fetching-data)
|
|
11
|
+
- [Interacting with the Smart Contract](#interacting-with-the-smart-contract)
|
|
12
|
+
- [Testing](#testing)
|
|
13
|
+
- [Contributing](#contributing)
|
|
14
|
+
- [License](#license)
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
To install the XOXNO SDK, simply run the following command in your project's root directory:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install xoxno-sdk
|
|
22
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.XOXNO=e():t.XOXNO=e()}(self,(()=>(()=>{"use strict";var t={d:(e,o)=>{for(var i in o)t.o(o,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:o[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{XOXNO:()=>r});class o{static instance;apiUrl;apiKey;constructor(t,e){this.apiUrl=t,this.apiKey=e}static init(t,e){return o.instance||(o.instance=new o(t,e)),o.instance}static getClient(){if(!o.instance)throw new Error("APIClient has not been initialized");return o.instance}fetchWithTimeout=async(t,e={},o=4e4)=>{const i=new AbortController,{signal:n}=i,r=Math.round((new Date).getTime()/1e3),a=setTimeout((()=>{i.abort()}),o);let s;const c={"Accept-Encoding":"gzip,deflate,br","xo-time":`Sent-At:${r}`,Referer:"https://xoxno.dev","User-Agent":"XOXNO/1.0/SDK",..."POST"===e.method?{"Content-Type":"application/json"}:{},...e.headers??{}};try{if(s=await fetch(`${this.apiUrl}${t}${e.params?"?"+Object.keys(e.params).map((t=>`${t}=${encodeURIComponent(e.params[t])}`)).join("&"):""}`,{signal:n,...e,...Object.keys(c).length?{headers:c}:{},method:e.method??"GET"}),!s.ok){const t=await(s?.text());throw new Error(t)}return clearTimeout(a),await s.json()}catch(o){throw new Error("Something went wrong inside fetchWithTimeout "+t+" "+JSON.stringify(e)+" "+o)}}}const i=t=>/^[A-Z0-9]{3,10}-[a-z0-9]{6}$/.test(t);class n{api;constructor(){this.api=o.getClient()}getCollectionProfile=async t=>{if(!i(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/getCollectionProfile/${t}`)};getCollectionFloorPrice=async(t,e="EGLD")=>{if(!i(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/getFloorPrice/${t}/${e}`)};getCollectionAttributes=async t=>{if(!i(t))throw new Error("Invalid collection ticker: "+t);return await this.api.fetchWithTimeout(`/getCollectionAttributes/${t}`)};searchNFTs=async t=>{if(!i(t.collection))throw new Error("Invalid collection ticker: "+t.collection);if(t.top&&t.top>35)throw new Error("Top cannot be greater than 35");const e={filters:{onSale:t.onlyOnSale||!1,marketplace:t.listedOnlyOn||void 0,auctionTypes:t.onlyOnSale?t.onlyAuctions?["NftBid","SftAll"]:["Nft","SftOnePerPayment"]:void 0,tokens:t.listedInToken||void 0,attributes:t.attributes||void 0,range:t.priceRange?{...t.priceRange,type:t.onlyAuctions?"saleInfoNft/current_bid_short":"saleInfoNft/min_bid_short"}:void 0,rankRange:t.rankRange||void 0,levelRange:t.cantinaLevelRange||void 0},name:t.searchName||"",orderBy:t.orderBy||void 0,collection:t.collection,top:t.top||35,skip:t.skip||0},o=Buffer.from(JSON.stringify(e)).toString("base64"),n=await this.api.fetchWithTimeout(`/searchNFTs/${o}`);return{...n,getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)},hasMoreResults:n.resultsCount>(t.skip??0)+(t.top??35)}};getTradingActivity=async t=>await(async(t,e)=>{if(t.top&&t.top>35)throw new Error("Top cannot be greater than 35");const o={filters:{collection:t.collections,identifier:t.identifier||void 0,address:t.owners||void 0,tokens:t.placedInToken||void 0,marketplace:t.marketplaces||void 0,action:t.actions||void 0,range:t.priceRange,rankRange:t.rankRange,timestampRange:t.timestampRange,attributes:t.attributes},orderBy:t.orderBy,select:t.select,top:t.top||35,skip:t.skip||0},i=Buffer.from(JSON.stringify(o)).toString("base64"),n=await e.fetchWithTimeout(`/getTradingActivity/${i}`);return{...n,getNextPagePayload:{...t,skip:(t.skip??0)+(t.top??35)},empty:0===n.resources.length}})(t,this.api)}class r{collection;constructor(t="https://proxy-api.xoxno.com",e=""){o.init(t,e),this.collection=new n}}return e})()));
|
package/package.json
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { LaunchpadModule } from '../index';
|
|
2
|
+
import { APIClient } from '../../utils/api';
|
|
3
|
+
|
|
4
|
+
describe('SCInteraction', () => {
|
|
5
|
+
let sc: LaunchpadModule;
|
|
6
|
+
beforeAll(async () => {
|
|
7
|
+
APIClient.init();
|
|
8
|
+
sc = await LaunchpadModule.init(
|
|
9
|
+
'erd1qqqqqqqqqqqqqpgqtwtp5uz97u232zvzd973upqxwe2xnqv2ys5s3c7jx9'
|
|
10
|
+
);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('should return all the unique tags of the launchpad SC', async () => {
|
|
14
|
+
const tags = await sc.getAllUniqueTags();
|
|
15
|
+
expect(tags).toBeDefined();
|
|
16
|
+
expect(tags).toContain('Elonverse');
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('should return all the unique stages of a collection from the launchpad SC', async () => {
|
|
20
|
+
const tags = await sc.getStages('Elonverse');
|
|
21
|
+
expect(tags).toBeDefined();
|
|
22
|
+
// expect(tags).toContain('Elonverse');
|
|
23
|
+
console.log(tags);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { SmartContract, Address, Interaction } from '@multiversx/sdk-core/out';
|
|
2
|
+
import { SmartContractAbis } from '../utils/SmartContractAbis';
|
|
3
|
+
import { getSmartContract } from '../utils/SmartContractService';
|
|
4
|
+
import { ContractQueryRunner } from '../utils/scCalls';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* LaunchpadModule provides methods to interact with the minter smart contract.
|
|
8
|
+
* @class
|
|
9
|
+
*/
|
|
10
|
+
export class LaunchpadModule {
|
|
11
|
+
private minter: SmartContract;
|
|
12
|
+
private call: ContractQueryRunner;
|
|
13
|
+
/**
|
|
14
|
+
* @constructor
|
|
15
|
+
* @param {SmartContract} minterAbiXOXNO - The minter smart contract instance.
|
|
16
|
+
*/
|
|
17
|
+
constructor(minterAbiXOXNO: SmartContract) {
|
|
18
|
+
this.minter = minterAbiXOXNO;
|
|
19
|
+
this.call = new ContractQueryRunner();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Executes the provided interaction and returns the result.
|
|
24
|
+
* @private
|
|
25
|
+
* @param {Interaction} interaction - The smart contract interaction.
|
|
26
|
+
* @returns {Promise<any>} The result of the interaction.
|
|
27
|
+
*/
|
|
28
|
+
private async getResult(interaction: Interaction) {
|
|
29
|
+
return await this.call.runQuery(this.minter, interaction);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Initializes the LaunchpadModule with a minter smart contract instance.
|
|
34
|
+
* @static
|
|
35
|
+
* @param {string} minterSC - The minter smart contract address.
|
|
36
|
+
* @returns {Promise<LaunchpadModule>} A new instance of LaunchpadModule.
|
|
37
|
+
*/
|
|
38
|
+
static async init(minterSC: string) {
|
|
39
|
+
const minterAbiXOXNO = await SmartContractAbis.getMinter();
|
|
40
|
+
const minter_abi = getSmartContract(
|
|
41
|
+
minterAbiXOXNO,
|
|
42
|
+
new Address(minterSC),
|
|
43
|
+
'Minter'
|
|
44
|
+
);
|
|
45
|
+
return new LaunchpadModule(minter_abi);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Fetches all unique tags from the minter smart contract.
|
|
50
|
+
* @public
|
|
51
|
+
* @returns {Promise<string[]>} An array of unique tags.
|
|
52
|
+
*/
|
|
53
|
+
public getAllUniqueTags = async (): Promise<string[]> => {
|
|
54
|
+
const interaction = this.minter.methods.collections();
|
|
55
|
+
const result = await this.getResult(interaction);
|
|
56
|
+
return result.firstValue?.valueOf().map((x: any) => x.toString());
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Fetches the global buy count for a user and tag.
|
|
61
|
+
* @public
|
|
62
|
+
* @param {string} user - The user's address.
|
|
63
|
+
* @param {string} tag - The tag.
|
|
64
|
+
* @returns {Promise<number>} The global buy count.
|
|
65
|
+
*/
|
|
66
|
+
public getWalletGlobalBuyCount = async (
|
|
67
|
+
user: string,
|
|
68
|
+
tag: string
|
|
69
|
+
): Promise<number> => {
|
|
70
|
+
const interaction = this.minter.methods.buysPerWallet([user, tag]);
|
|
71
|
+
const result = await this.getResult(interaction);
|
|
72
|
+
return result.firstValue?.valueOf();
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Fetches the stage buy count for a user, tag, and stage.
|
|
77
|
+
* @public
|
|
78
|
+
* @param {string} user - The user's address.
|
|
79
|
+
* @param {string} tag - The tag.
|
|
80
|
+
* @param {string} stage - The stage.
|
|
81
|
+
* @returns {Promise<number>} The stage buy count.
|
|
82
|
+
*/
|
|
83
|
+
public getWalletStageBuyCount = async (
|
|
84
|
+
user: string,
|
|
85
|
+
tag: string,
|
|
86
|
+
stage: string
|
|
87
|
+
): Promise<number> => {
|
|
88
|
+
const interaction = this.minter.methods.buysStagePerWallet([
|
|
89
|
+
user,
|
|
90
|
+
tag,
|
|
91
|
+
stage,
|
|
92
|
+
]);
|
|
93
|
+
const result = await this.getResult(interaction);
|
|
94
|
+
return result.firstValue?.valueOf();
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Fetches the local owner's address from the minter smart contract.
|
|
99
|
+
* @public
|
|
100
|
+
* @returns {Promise<string>} The local owner's address.
|
|
101
|
+
*/
|
|
102
|
+
public getLocalOwner = async (): Promise<string> => {
|
|
103
|
+
const interaction = this.minter.methods.localOwner();
|
|
104
|
+
const result = await this.getResult(interaction);
|
|
105
|
+
return result.firstValue?.valueOf();
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Fetches the launchpad cut fee percentage from the minter smart contract.
|
|
110
|
+
* @public
|
|
111
|
+
* @returns {Promise<number>} The launchpad cut fee percentage.
|
|
112
|
+
*/
|
|
113
|
+
|
|
114
|
+
public getLaunchpadCutFee = async (): Promise<number> => {
|
|
115
|
+
const interaction = this.minter.methods.cutPercentage();
|
|
116
|
+
const result = await this.getResult(interaction);
|
|
117
|
+
return result.firstValue?.valueOf();
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Fetches the stage whitelist of wallets for a tag and stage.
|
|
122
|
+
* @public
|
|
123
|
+
* @param {string} tag - The tag.
|
|
124
|
+
* @param {string} stage - The stage.
|
|
125
|
+
* @returns {Promise<string[]>} An array of whitelisted wallet addresses.
|
|
126
|
+
*/
|
|
127
|
+
public getStageWhitelist = async (
|
|
128
|
+
tag: string,
|
|
129
|
+
stage: string
|
|
130
|
+
): Promise<string[]> => {
|
|
131
|
+
const interaction = this.minter.methods.getWhitelistedWallets([tag, stage]);
|
|
132
|
+
const result = await this.getResult(interaction);
|
|
133
|
+
return result.firstValue?.valueOf().map((x: any) => x.toString());
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Fetches the list of stages for a tag.
|
|
138
|
+
* @public
|
|
139
|
+
* @param {string} tag - The tag.
|
|
140
|
+
* @returns {Promise<string[]>} An array of stages.
|
|
141
|
+
*/
|
|
142
|
+
public getStages = async (tag: string): Promise<string[]> => {
|
|
143
|
+
const interaction = this.minter.methods.mintStage([tag]);
|
|
144
|
+
const result = await this.getResult(interaction);
|
|
145
|
+
return result.firstValue?.valueOf().map((x: any) => {
|
|
146
|
+
const body = x[1].valueOf();
|
|
147
|
+
body.name = body.name.toString();
|
|
148
|
+
body.tag = body.name.toString();
|
|
149
|
+
body.start_time = parseInt(body.start_time.toString());
|
|
150
|
+
body.end_time = parseInt(body.end_time.toString());
|
|
151
|
+
body.mint_limit = parseInt(body.mint_limit.toString());
|
|
152
|
+
body.mint_count = parseInt(body.mint_count.toString());
|
|
153
|
+
body.max_per_wallet = parseInt(body.max_per_wallet.toString());
|
|
154
|
+
body.prices = body.prices.map((x: any) => {
|
|
155
|
+
const pr = x.valueOf();
|
|
156
|
+
return {
|
|
157
|
+
...pr,
|
|
158
|
+
token_nonce: parseInt(pr.token_nonce.toString()),
|
|
159
|
+
amount: pr.amount.toString(),
|
|
160
|
+
};
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
return body;
|
|
164
|
+
});
|
|
165
|
+
};
|
|
166
|
+
}
|
package/coverage/clover.xml
DELETED
|
@@ -1,280 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<coverage generated="1680310460170" clover="3.2.0">
|
|
3
|
-
<project timestamp="1680310460170" name="All files">
|
|
4
|
-
<metrics statements="229" coveredstatements="184" conditionals="101" coveredconditionals="68" methods="48" coveredmethods="41" elements="378" coveredelements="293" complexity="0" loc="229" ncloc="229" packages="4" files="11" classes="11"/>
|
|
5
|
-
<package name="collection">
|
|
6
|
-
<metrics statements="31" coveredstatements="26" conditionals="46" coveredconditionals="31" methods="6" coveredmethods="6"/>
|
|
7
|
-
<file name="index.ts" path="/Users/truststaking/Documents/GitHub/xoxno-sdk-js/src/collection/index.ts">
|
|
8
|
-
<metrics statements="31" coveredstatements="26" conditionals="46" coveredconditionals="31" methods="6" coveredmethods="6"/>
|
|
9
|
-
<line num="9" count="1" type="stmt"/>
|
|
10
|
-
<line num="10" count="1" type="stmt"/>
|
|
11
|
-
<line num="11" count="1" type="stmt"/>
|
|
12
|
-
<line num="22" count="1" type="stmt"/>
|
|
13
|
-
<line num="25" count="2" type="stmt"/>
|
|
14
|
-
<line num="34" count="2" type="stmt"/>
|
|
15
|
-
<line num="37" count="1" type="cond" truecount="0" falsecount="1"/>
|
|
16
|
-
<line num="38" count="0" type="stmt"/>
|
|
17
|
-
<line num="40" count="1" type="stmt"/>
|
|
18
|
-
<line num="43" count="1" type="stmt"/>
|
|
19
|
-
<line num="53" count="2" type="stmt"/>
|
|
20
|
-
<line num="57" count="1" type="cond" truecount="0" falsecount="1"/>
|
|
21
|
-
<line num="58" count="0" type="stmt"/>
|
|
22
|
-
<line num="60" count="1" type="stmt"/>
|
|
23
|
-
<line num="63" count="1" type="stmt"/>
|
|
24
|
-
<line num="72" count="2" type="stmt"/>
|
|
25
|
-
<line num="75" count="1" type="cond" truecount="0" falsecount="1"/>
|
|
26
|
-
<line num="76" count="0" type="stmt"/>
|
|
27
|
-
<line num="78" count="1" type="stmt"/>
|
|
28
|
-
<line num="81" count="1" type="stmt"/>
|
|
29
|
-
<line num="90" count="2" type="stmt"/>
|
|
30
|
-
<line num="93" count="2" type="cond" truecount="0" falsecount="1"/>
|
|
31
|
-
<line num="94" count="0" type="stmt"/>
|
|
32
|
-
<line num="97" count="2" type="cond" truecount="2" falsecount="1"/>
|
|
33
|
-
<line num="98" count="0" type="stmt"/>
|
|
34
|
-
<line num="101" count="2" type="stmt"/>
|
|
35
|
-
<line num="131" count="2" type="stmt"/>
|
|
36
|
-
<line num="132" count="2" type="stmt"/>
|
|
37
|
-
<line num="135" count="2" type="stmt"/>
|
|
38
|
-
<line num="153" count="2" type="stmt"/>
|
|
39
|
-
<line num="156" count="2" type="stmt"/>
|
|
40
|
-
</file>
|
|
41
|
-
</package>
|
|
42
|
-
<package name="interactions">
|
|
43
|
-
<metrics statements="71" coveredstatements="67" conditionals="4" coveredconditionals="1" methods="18" coveredmethods="17"/>
|
|
44
|
-
<file name="index.ts" path="/Users/truststaking/Documents/GitHub/xoxno-sdk-js/src/interactions/index.ts">
|
|
45
|
-
<metrics statements="71" coveredstatements="67" conditionals="4" coveredconditionals="1" methods="18" coveredmethods="17"/>
|
|
46
|
-
<line num="1" count="1" type="stmt"/>
|
|
47
|
-
<line num="6" count="1" type="stmt"/>
|
|
48
|
-
<line num="8" count="1" type="stmt"/>
|
|
49
|
-
<line num="9" count="1" type="stmt"/>
|
|
50
|
-
<line num="10" count="1" type="stmt"/>
|
|
51
|
-
<line num="11" count="1" type="stmt"/>
|
|
52
|
-
<line num="13" count="1" type="stmt"/>
|
|
53
|
-
<line num="17" count="1" type="stmt"/>
|
|
54
|
-
<line num="18" count="1" type="stmt"/>
|
|
55
|
-
<line num="22" count="1" type="stmt"/>
|
|
56
|
-
<line num="23" count="1" type="stmt"/>
|
|
57
|
-
<line num="24" count="1" type="stmt"/>
|
|
58
|
-
<line num="30" count="1" type="stmt"/>
|
|
59
|
-
<line num="34" count="14" type="stmt"/>
|
|
60
|
-
<line num="42" count="1" type="stmt"/>
|
|
61
|
-
<line num="43" count="1" type="stmt"/>
|
|
62
|
-
<line num="44" count="1" type="stmt"/>
|
|
63
|
-
<line num="45" count="1" type="stmt"/>
|
|
64
|
-
<line num="52" count="1" type="stmt"/>
|
|
65
|
-
<line num="53" count="1" type="stmt"/>
|
|
66
|
-
<line num="54" count="1" type="stmt"/>
|
|
67
|
-
<line num="55" count="1" type="stmt"/>
|
|
68
|
-
<line num="63" count="1" type="stmt"/>
|
|
69
|
-
<line num="64" count="2" type="stmt"/>
|
|
70
|
-
<line num="65" count="2" type="stmt"/>
|
|
71
|
-
<line num="66" count="5072" type="stmt"/>
|
|
72
|
-
<line num="81" count="1" type="stmt"/>
|
|
73
|
-
<line num="85" count="1" type="cond" truecount="0" falsecount="1"/>
|
|
74
|
-
<line num="86" count="0" type="stmt"/>
|
|
75
|
-
<line num="88" count="1" type="stmt"/>
|
|
76
|
-
<line num="97" count="0" type="stmt"/>
|
|
77
|
-
<line num="108" count="1" type="stmt"/>
|
|
78
|
-
<line num="111" count="2" type="stmt"/>
|
|
79
|
-
<line num="112" count="2" type="stmt"/>
|
|
80
|
-
<line num="113" count="2" type="stmt"/>
|
|
81
|
-
<line num="114" count="2" type="stmt"/>
|
|
82
|
-
<line num="115" count="2" type="stmt"/>
|
|
83
|
-
<line num="116" count="2" type="stmt"/>
|
|
84
|
-
<line num="119" count="2" type="stmt"/>
|
|
85
|
-
<line num="120" count="2" type="stmt"/>
|
|
86
|
-
<line num="121" count="2" type="stmt"/>
|
|
87
|
-
<line num="122" count="2" type="cond" truecount="1" falsecount="1"/>
|
|
88
|
-
<line num="123" count="0" type="stmt"/>
|
|
89
|
-
<line num="132" count="2" type="stmt"/>
|
|
90
|
-
<line num="134" count="2" type="stmt"/>
|
|
91
|
-
<line num="135" count="2" type="stmt"/>
|
|
92
|
-
<line num="136" count="2" type="stmt"/>
|
|
93
|
-
<line num="138" count="2" type="stmt"/>
|
|
94
|
-
<line num="139" count="2" type="stmt"/>
|
|
95
|
-
<line num="140" count="2" type="cond" truecount="0" falsecount="1"/>
|
|
96
|
-
<line num="141" count="0" type="stmt"/>
|
|
97
|
-
<line num="147" count="2" type="stmt"/>
|
|
98
|
-
<line num="154" count="1" type="stmt"/>
|
|
99
|
-
<line num="155" count="1" type="stmt"/>
|
|
100
|
-
<line num="156" count="1" type="stmt"/>
|
|
101
|
-
<line num="163" count="1" type="stmt"/>
|
|
102
|
-
<line num="164" count="1" type="stmt"/>
|
|
103
|
-
<line num="165" count="1" type="stmt"/>
|
|
104
|
-
<line num="172" count="1" type="stmt"/>
|
|
105
|
-
<line num="173" count="1" type="stmt"/>
|
|
106
|
-
<line num="174" count="1" type="stmt"/>
|
|
107
|
-
<line num="181" count="1" type="stmt"/>
|
|
108
|
-
<line num="182" count="1" type="stmt"/>
|
|
109
|
-
<line num="183" count="1" type="stmt"/>
|
|
110
|
-
<line num="193" count="1" type="stmt"/>
|
|
111
|
-
<line num="196" count="1" type="stmt"/>
|
|
112
|
-
<line num="208" count="1" type="stmt"/>
|
|
113
|
-
<line num="211" count="1" type="stmt"/>
|
|
114
|
-
<line num="224" count="1" type="stmt"/>
|
|
115
|
-
<line num="227" count="755" type="stmt"/>
|
|
116
|
-
<line num="228" count="1" type="stmt"/>
|
|
117
|
-
</file>
|
|
118
|
-
</package>
|
|
119
|
-
<package name="nft">
|
|
120
|
-
<metrics statements="25" coveredstatements="21" conditionals="4" coveredconditionals="0" methods="5" coveredmethods="5"/>
|
|
121
|
-
<file name="index.ts" path="/Users/truststaking/Documents/GitHub/xoxno-sdk-js/src/nft/index.ts">
|
|
122
|
-
<metrics statements="25" coveredstatements="21" conditionals="4" coveredconditionals="0" methods="5" coveredmethods="5"/>
|
|
123
|
-
<line num="3" count="1" type="stmt"/>
|
|
124
|
-
<line num="4" count="1" type="stmt"/>
|
|
125
|
-
<line num="5" count="1" type="stmt"/>
|
|
126
|
-
<line num="6" count="1" type="stmt"/>
|
|
127
|
-
<line num="17" count="1" type="stmt"/>
|
|
128
|
-
<line num="20" count="1" type="stmt"/>
|
|
129
|
-
<line num="28" count="1" type="stmt"/>
|
|
130
|
-
<line num="29" count="1" type="cond" truecount="0" falsecount="1"/>
|
|
131
|
-
<line num="30" count="0" type="stmt"/>
|
|
132
|
-
<line num="32" count="1" type="stmt"/>
|
|
133
|
-
<line num="35" count="1" type="stmt"/>
|
|
134
|
-
<line num="45" count="1" type="stmt"/>
|
|
135
|
-
<line num="49" count="1" type="cond" truecount="0" falsecount="1"/>
|
|
136
|
-
<line num="50" count="0" type="stmt"/>
|
|
137
|
-
<line num="53" count="1" type="stmt"/>
|
|
138
|
-
<line num="56" count="1" type="stmt"/>
|
|
139
|
-
<line num="67" count="1" type="stmt"/>
|
|
140
|
-
<line num="72" count="1" type="cond" truecount="0" falsecount="1"/>
|
|
141
|
-
<line num="73" count="0" type="stmt"/>
|
|
142
|
-
<line num="76" count="1" type="cond" truecount="0" falsecount="1"/>
|
|
143
|
-
<line num="77" count="0" type="stmt"/>
|
|
144
|
-
<line num="80" count="1" type="stmt"/>
|
|
145
|
-
<line num="83" count="1" type="stmt"/>
|
|
146
|
-
<line num="93" count="1" type="stmt"/>
|
|
147
|
-
<line num="96" count="2" type="stmt"/>
|
|
148
|
-
</file>
|
|
149
|
-
</package>
|
|
150
|
-
<package name="utils">
|
|
151
|
-
<metrics statements="102" coveredstatements="70" conditionals="47" coveredconditionals="36" methods="19" coveredmethods="13"/>
|
|
152
|
-
<file name="SmartContractAbis.ts" path="/Users/truststaking/Documents/GitHub/xoxno-sdk-js/src/utils/SmartContractAbis.ts">
|
|
153
|
-
<metrics statements="33" coveredstatements="8" conditionals="6" coveredconditionals="1" methods="6" coveredmethods="1"/>
|
|
154
|
-
<line num="1" count="1" type="stmt"/>
|
|
155
|
-
<line num="2" count="1" type="stmt"/>
|
|
156
|
-
<line num="4" count="1" type="stmt"/>
|
|
157
|
-
<line num="13" count="1" type="cond" truecount="1" falsecount="0"/>
|
|
158
|
-
<line num="14" count="1" type="stmt"/>
|
|
159
|
-
<line num="17" count="1" type="stmt"/>
|
|
160
|
-
<line num="18" count="1" type="stmt"/>
|
|
161
|
-
<line num="21" count="1" type="stmt"/>
|
|
162
|
-
<line num="24" count="0" type="cond" truecount="0" falsecount="1"/>
|
|
163
|
-
<line num="25" count="0" type="stmt"/>
|
|
164
|
-
<line num="28" count="0" type="stmt"/>
|
|
165
|
-
<line num="29" count="0" type="stmt"/>
|
|
166
|
-
<line num="32" count="0" type="stmt"/>
|
|
167
|
-
<line num="36" count="0" type="cond" truecount="0" falsecount="1"/>
|
|
168
|
-
<line num="37" count="0" type="stmt"/>
|
|
169
|
-
<line num="40" count="0" type="stmt"/>
|
|
170
|
-
<line num="41" count="0" type="stmt"/>
|
|
171
|
-
<line num="44" count="0" type="stmt"/>
|
|
172
|
-
<line num="48" count="0" type="cond" truecount="0" falsecount="1"/>
|
|
173
|
-
<line num="49" count="0" type="stmt"/>
|
|
174
|
-
<line num="52" count="0" type="stmt"/>
|
|
175
|
-
<line num="53" count="0" type="stmt"/>
|
|
176
|
-
<line num="56" count="0" type="stmt"/>
|
|
177
|
-
<line num="60" count="0" type="cond" truecount="0" falsecount="1"/>
|
|
178
|
-
<line num="61" count="0" type="stmt"/>
|
|
179
|
-
<line num="64" count="0" type="stmt"/>
|
|
180
|
-
<line num="65" count="0" type="stmt"/>
|
|
181
|
-
<line num="68" count="0" type="stmt"/>
|
|
182
|
-
<line num="72" count="0" type="cond" truecount="0" falsecount="1"/>
|
|
183
|
-
<line num="73" count="0" type="stmt"/>
|
|
184
|
-
<line num="76" count="0" type="stmt"/>
|
|
185
|
-
<line num="77" count="0" type="stmt"/>
|
|
186
|
-
<line num="80" count="0" type="stmt"/>
|
|
187
|
-
</file>
|
|
188
|
-
<file name="SmartContractService.ts" path="/Users/truststaking/Documents/GitHub/xoxno-sdk-js/src/utils/SmartContractService.ts">
|
|
189
|
-
<metrics statements="3" coveredstatements="3" conditionals="0" coveredconditionals="0" methods="1" coveredmethods="1"/>
|
|
190
|
-
<line num="1" count="1" type="stmt"/>
|
|
191
|
-
<line num="8" count="1" type="stmt"/>
|
|
192
|
-
<line num="13" count="1" type="stmt"/>
|
|
193
|
-
</file>
|
|
194
|
-
<file name="api.ts" path="/Users/truststaking/Documents/GitHub/xoxno-sdk-js/src/utils/api.ts">
|
|
195
|
-
<metrics statements="22" coveredstatements="19" conditionals="19" coveredconditionals="14" methods="5" coveredmethods="4"/>
|
|
196
|
-
<line num="1" count="3" type="stmt"/>
|
|
197
|
-
<line num="2" count="3" type="stmt"/>
|
|
198
|
-
<line num="20" count="3" type="stmt"/>
|
|
199
|
-
<line num="36" count="3" type="stmt"/>
|
|
200
|
-
<line num="37" count="3" type="stmt"/>
|
|
201
|
-
<line num="38" count="3" type="stmt"/>
|
|
202
|
-
<line num="39" count="3" type="stmt"/>
|
|
203
|
-
<line num="66" count="3" type="cond" truecount="1" falsecount="0"/>
|
|
204
|
-
<line num="67" count="3" type="stmt"/>
|
|
205
|
-
<line num="69" count="3" type="stmt"/>
|
|
206
|
-
<line num="73" count="5" type="cond" truecount="0" falsecount="1"/>
|
|
207
|
-
<line num="74" count="0" type="stmt"/>
|
|
208
|
-
<line num="76" count="5" type="stmt"/>
|
|
209
|
-
<line num="79" count="3" type="stmt"/>
|
|
210
|
-
<line num="84" count="12" type="stmt"/>
|
|
211
|
-
<line num="86" count="12" type="stmt"/>
|
|
212
|
-
<line num="96" count="12" type="stmt"/>
|
|
213
|
-
<line num="97" count="12" type="stmt"/>
|
|
214
|
-
<line num="103" count="0" type="stmt"/>
|
|
215
|
-
<line num="118" count="12" type="stmt"/>
|
|
216
|
-
<line num="120" count="12" type="stmt"/>
|
|
217
|
-
<line num="122" count="0" type="stmt"/>
|
|
218
|
-
</file>
|
|
219
|
-
<file name="const.ts" path="/Users/truststaking/Documents/GitHub/xoxno-sdk-js/src/utils/const.ts">
|
|
220
|
-
<metrics statements="13" coveredstatements="13" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0"/>
|
|
221
|
-
<line num="1" count="3" type="stmt"/>
|
|
222
|
-
<line num="2" count="3" type="stmt"/>
|
|
223
|
-
<line num="4" count="3" type="stmt"/>
|
|
224
|
-
<line num="6" count="3" type="stmt"/>
|
|
225
|
-
<line num="8" count="3" type="stmt"/>
|
|
226
|
-
<line num="10" count="3" type="stmt"/>
|
|
227
|
-
<line num="12" count="3" type="stmt"/>
|
|
228
|
-
<line num="14" count="3" type="stmt"/>
|
|
229
|
-
<line num="16" count="3" type="stmt"/>
|
|
230
|
-
<line num="19" count="3" type="stmt"/>
|
|
231
|
-
<line num="21" count="3" type="stmt"/>
|
|
232
|
-
<line num="23" count="3" type="stmt"/>
|
|
233
|
-
<line num="25" count="3" type="stmt"/>
|
|
234
|
-
</file>
|
|
235
|
-
<file name="getActivity.ts" path="/Users/truststaking/Documents/GitHub/xoxno-sdk-js/src/utils/getActivity.ts">
|
|
236
|
-
<metrics statements="7" coveredstatements="6" conditionals="21" coveredconditionals="20" methods="1" coveredmethods="1"/>
|
|
237
|
-
<line num="15" count="2" type="stmt"/>
|
|
238
|
-
<line num="19" count="4" type="cond" truecount="2" falsecount="1"/>
|
|
239
|
-
<line num="20" count="0" type="stmt"/>
|
|
240
|
-
<line num="23" count="4" type="stmt"/>
|
|
241
|
-
<line num="42" count="4" type="stmt"/>
|
|
242
|
-
<line num="43" count="4" type="stmt"/>
|
|
243
|
-
<line num="47" count="4" type="stmt"/>
|
|
244
|
-
</file>
|
|
245
|
-
<file name="helpers.ts" path="/Users/truststaking/Documents/GitHub/xoxno-sdk-js/src/utils/helpers.ts">
|
|
246
|
-
<metrics statements="7" coveredstatements="7" conditionals="1" coveredconditionals="1" methods="2" coveredmethods="2"/>
|
|
247
|
-
<line num="1" count="1" type="stmt"/>
|
|
248
|
-
<line num="2" count="1" type="stmt"/>
|
|
249
|
-
<line num="3" count="1" type="cond" truecount="1" falsecount="0"/>
|
|
250
|
-
<line num="4" count="1" type="stmt"/>
|
|
251
|
-
<line num="6" count="1" type="stmt"/>
|
|
252
|
-
<line num="9" count="1" type="stmt"/>
|
|
253
|
-
<line num="13" count="1" type="stmt"/>
|
|
254
|
-
</file>
|
|
255
|
-
<file name="regex.ts" path="/Users/truststaking/Documents/GitHub/xoxno-sdk-js/src/utils/regex.ts">
|
|
256
|
-
<metrics statements="4" coveredstatements="4" conditionals="0" coveredconditionals="0" methods="2" coveredmethods="2"/>
|
|
257
|
-
<line num="1" count="2" type="stmt"/>
|
|
258
|
-
<line num="2" count="7" type="stmt"/>
|
|
259
|
-
<line num="5" count="2" type="stmt"/>
|
|
260
|
-
<line num="6" count="1" type="stmt"/>
|
|
261
|
-
</file>
|
|
262
|
-
<file name="scCalls.ts" path="/Users/truststaking/Documents/GitHub/xoxno-sdk-js/src/utils/scCalls.ts">
|
|
263
|
-
<metrics statements="13" coveredstatements="10" conditionals="0" coveredconditionals="0" methods="2" coveredmethods="2"/>
|
|
264
|
-
<line num="1" count="1" type="stmt"/>
|
|
265
|
-
<line num="6" count="1" type="stmt"/>
|
|
266
|
-
<line num="12" count="1" type="stmt"/>
|
|
267
|
-
<line num="14" count="1" type="stmt"/>
|
|
268
|
-
<line num="16" count="1" type="stmt"/>
|
|
269
|
-
<line num="19" count="1" type="stmt"/>
|
|
270
|
-
<line num="20" count="1" type="stmt"/>
|
|
271
|
-
<line num="29" count="14" type="stmt"/>
|
|
272
|
-
<line num="31" count="14" type="stmt"/>
|
|
273
|
-
<line num="33" count="14" type="stmt"/>
|
|
274
|
-
<line num="38" count="0" type="stmt"/>
|
|
275
|
-
<line num="43" count="0" type="stmt"/>
|
|
276
|
-
<line num="45" count="0" type="stmt"/>
|
|
277
|
-
</file>
|
|
278
|
-
</package>
|
|
279
|
-
</project>
|
|
280
|
-
</coverage>
|