@xoxno/sdk-js 0.0.10-alpha → 0.0.12-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/README.md +26 -7
- package/dist/collection/index.d.ts +2 -3
- package/dist/collection/index.js +7 -6
- package/dist/collection/index.js.map +1 -1
- package/dist/index.d.ts +4 -13
- package/dist/index.js +9 -19
- package/dist/index.js.map +1 -1
- package/dist/interactions/index.d.ts +1 -1
- package/dist/interactions/index.js +6 -4
- package/dist/interactions/index.js.map +1 -1
- package/dist/launchpad/index.d.ts +1 -1
- package/dist/launchpad/index.js +1 -2
- package/dist/launchpad/index.js.map +1 -1
- package/dist/nft/index.d.ts +2 -3
- package/dist/nft/index.js +7 -6
- package/dist/nft/index.js.map +1 -1
- package/dist/staking/index.d.ts +31 -0
- package/dist/staking/index.js +70 -0
- package/dist/staking/index.js.map +1 -0
- package/dist/types/nft.d.ts +6 -5
- package/dist/types/staking.d.ts +42 -0
- package/dist/types/staking.js +14 -0
- package/dist/types/staking.js.map +1 -0
- package/dist/types/trading.d.ts +2 -2
- package/dist/types/user.d.ts +152 -0
- package/dist/types/user.js +13 -0
- package/dist/types/user.js.map +1 -0
- package/dist/users/index.d.ts +56 -0
- package/dist/users/index.js +110 -0
- package/dist/users/index.js.map +1 -0
- package/dist/utils/api.d.ts +3 -3
- package/dist/utils/api.js +10 -10
- package/dist/utils/api.js.map +1 -1
- package/dist/utils/getActivity.d.ts +2 -2
- package/dist/utils/getActivity.js +1 -1
- package/dist/utils/getActivity.js.map +1 -1
- package/dist/utils/helpers.d.ts +2 -0
- package/dist/utils/helpers.js +12 -1
- package/dist/utils/helpers.js.map +1 -1
- package/dist/utils/scCalls.js +5 -2
- package/dist/utils/scCalls.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -6,17 +6,36 @@ XOXNO SDK is a JavaScript library that simplifies the interaction with the XOXNO
|
|
|
6
6
|
|
|
7
7
|
- [Installation](#installation)
|
|
8
8
|
- [Usage](#usage)
|
|
9
|
-
|
|
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)
|
|
9
|
+
- [Documentation](#docs)
|
|
15
10
|
|
|
16
11
|
## Installation
|
|
17
12
|
|
|
18
13
|
To install the XOXNO SDK, simply run the following command in your project's root directory:
|
|
19
14
|
|
|
20
15
|
```bash
|
|
21
|
-
npm
|
|
16
|
+
npm i @xoxno/sdk-js
|
|
22
17
|
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
The SDK follows a scheleton model where the API configuration has to be initiated only once anywhere in your application
|
|
22
|
+
|
|
23
|
+
```javascript
|
|
24
|
+
import { XOXNOClient } from '@xoxno/sdk-js';
|
|
25
|
+
XOXNOClient.init();
|
|
26
|
+
// By default calling init() without arguments will set the entire SDK to the mainnet ENV using the public API https://api.xoxno.com
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
After the client has been created you can now import different modules anywhere in the application:
|
|
30
|
+
|
|
31
|
+
```javascript
|
|
32
|
+
import CollectionModule from '@xoxno/sdk-js';
|
|
33
|
+
const collection = new CollectionModule(); // In case the above .init() call was not set before creating any module instance will auto trigger .init() using the default parameters described above
|
|
34
|
+
const profile = await collection.getCollectionProfile('MONKEY-ac9bdf');
|
|
35
|
+
// or similar with
|
|
36
|
+
const profile = await new CollectionModule().getCollectionProfile('MONKEY-ac9bdf');
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Docs
|
|
40
|
+
|
|
41
|
+
For more modules and typescript interfaces you can check our documentation at [https://sdk.xoxno.com](https://sdk.xoxno.com)
|
|
@@ -6,10 +6,9 @@ import { TradincActivityArgs, TradingActivityResponse } from '../types/trading';
|
|
|
6
6
|
* collection attributes, and searching NFTs within a collection.
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
|
-
* const
|
|
10
|
-
* const collectionModule = xoxno.collection;
|
|
9
|
+
* const collectionModule = new CollectionModule();
|
|
11
10
|
*/
|
|
12
|
-
export
|
|
11
|
+
export default class CollectionModule {
|
|
13
12
|
private api;
|
|
14
13
|
constructor();
|
|
15
14
|
/**
|
package/dist/collection/index.js
CHANGED
|
@@ -8,9 +8,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
|
|
13
|
-
const api_1 = require("../utils/api");
|
|
15
|
+
const api_1 = __importDefault(require("../utils/api"));
|
|
14
16
|
const getActivity_1 = require("../utils/getActivity");
|
|
15
17
|
const regex_1 = require("../utils/regex");
|
|
16
18
|
/**
|
|
@@ -19,8 +21,7 @@ const regex_1 = require("../utils/regex");
|
|
|
19
21
|
* collection attributes, and searching NFTs within a collection.
|
|
20
22
|
*
|
|
21
23
|
* @example
|
|
22
|
-
* const
|
|
23
|
-
* const collectionModule = xoxno.collection;
|
|
24
|
+
* const collectionModule = new CollectionModule();
|
|
24
25
|
*/
|
|
25
26
|
class CollectionModule {
|
|
26
27
|
constructor() {
|
|
@@ -147,8 +148,8 @@ class CollectionModule {
|
|
|
147
148
|
hasMoreResults: response.length >= ((args === null || args === void 0 ? void 0 : args.top) || 25),
|
|
148
149
|
};
|
|
149
150
|
});
|
|
150
|
-
this.api = api_1.
|
|
151
|
+
this.api = api_1.default.getClient();
|
|
151
152
|
}
|
|
152
153
|
}
|
|
153
|
-
exports.
|
|
154
|
+
exports.default = CollectionModule;
|
|
154
155
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/collection/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/collection/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAUA,uDAAuC;AACvC,sDAAmD;AACnD,0CAAyD;AAEzD;;;;;;;GAOG;AACH,MAAqB,gBAAgB;IAEnC;QAIA;;;;;WAKG;QACI,yBAAoB,GAAG,CAC5B,UAAkB,EACW,EAAE;YAC/B,IAAI,CAAC,IAAA,+BAAuB,EAAC,UAAU,CAAC,EAAE;gBACxC,MAAM,IAAI,KAAK,CAAC,6BAA6B,GAAG,UAAU,CAAC,CAAC;aAC7D;YACD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAC9C,yBAAyB,UAAU,EAAE,CACtC,CAAC;YACF,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAA,CAAC;QAEF;;;;;;WAMG;QACI,4BAAuB,GAAG,CAC/B,UAAkB,EAClB,KAAK,GAAG,MAAM,EACG,EAAE;YACnB,IAAI,CAAC,IAAA,+BAAuB,EAAC,UAAU,CAAC,EAAE;gBACxC,MAAM,IAAI,KAAK,CAAC,6BAA6B,GAAG,UAAU,CAAC,CAAC;aAC7D;YACD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAC9C,kBAAkB,UAAU,IAAI,KAAK,EAAE,CACxC,CAAC;YACF,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAA,CAAC;QAEF;;;;;WAKG;QACI,4BAAuB,GAAG,CAC/B,UAAkB,EACc,EAAE;YAClC,IAAI,CAAC,IAAA,+BAAuB,EAAC,UAAU,CAAC,EAAE;gBACxC,MAAM,IAAI,KAAK,CAAC,6BAA6B,GAAG,UAAU,CAAC,CAAC;aAC7D;YACD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAC9C,4BAA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AAE,QAAQ,CAAC,MAAM,IAAI,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,GAAG,KAAI,EAAE,CAAC;aACrD,CAAC;QACJ,CAAC,CAAA,CAAC;QAhLA,IAAI,CAAC,GAAG,GAAG,aAAW,CAAC,SAAS,EAAE,CAAC;IACrC,CAAC;CAgLF;AApLD,mCAoLC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,8 @@
|
|
|
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
|
-
}
|
|
13
1
|
export * from './types';
|
|
14
|
-
export
|
|
2
|
+
export { default as Collection } from './collection';
|
|
15
3
|
export * from './launchpad';
|
|
16
4
|
export * from './interactions';
|
|
17
5
|
export * from './nft';
|
|
6
|
+
export * from './users';
|
|
7
|
+
export * from './staking';
|
|
8
|
+
export * from './utils/api';
|
package/dist/index.js
CHANGED
|
@@ -13,28 +13,18 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
13
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
16
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
18
|
-
const api_1 = require("./utils/api");
|
|
19
|
-
const const_1 = require("./utils/const");
|
|
20
|
-
/**
|
|
21
|
-
* Represents an XOXNO Marketplace SDK, providing a simplified interface for
|
|
22
|
-
* interacting with an XOXNO API.
|
|
23
|
-
*/
|
|
24
|
-
class XOXNO {
|
|
25
|
-
/**
|
|
26
|
-
* Creates a new XOXNO instance.
|
|
27
|
-
* @param apiUrl - The base URL of the XOXNO API.
|
|
28
|
-
* @param apiKey - The API key for accessing the XOXNO API.
|
|
29
|
-
*/
|
|
30
|
-
constructor(apiUrl = const_1.API_URL, apiKey = '') {
|
|
31
|
-
api_1.APIClient.init(apiUrl, apiKey);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
exports.XOXNO = XOXNO;
|
|
20
|
+
exports.Collection = void 0;
|
|
35
21
|
__exportStar(require("./types"), exports);
|
|
36
|
-
|
|
22
|
+
var collection_1 = require("./collection");
|
|
23
|
+
Object.defineProperty(exports, "Collection", { enumerable: true, get: function () { return __importDefault(collection_1).default; } });
|
|
37
24
|
__exportStar(require("./launchpad"), exports);
|
|
38
25
|
__exportStar(require("./interactions"), exports);
|
|
39
26
|
__exportStar(require("./nft"), exports);
|
|
27
|
+
__exportStar(require("./users"), exports);
|
|
28
|
+
__exportStar(require("./staking"), exports);
|
|
29
|
+
__exportStar(require("./utils/api"), exports);
|
|
40
30
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,2CAAqD;AAA5C,yHAAA,OAAO,OAAc;AAC9B,8CAA4B;AAC5B,iDAA+B;AAC/B,wCAAsB;AACtB,0CAAwB;AACxB,4CAA0B;AAC1B,8CAA4B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GlobalOffer } from '../types/collection';
|
|
2
2
|
import type { SmartContract } from '@multiversx/sdk-core/out/smartcontracts/smartContract';
|
|
3
|
-
export
|
|
3
|
+
export default class SCInteraction {
|
|
4
4
|
private xo;
|
|
5
5
|
private call;
|
|
6
6
|
constructor(marketAbiXOXNO: SmartContract);
|
|
@@ -8,9 +8,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
|
|
13
|
-
const api_1 = require("../utils/api");
|
|
15
|
+
const api_1 = __importDefault(require("../utils/api"));
|
|
14
16
|
const scCalls_1 = require("../utils/scCalls");
|
|
15
17
|
const SmartContractAbis_1 = require("../utils/SmartContractAbis");
|
|
16
18
|
const SmartContractService_1 = require("../utils/SmartContractService");
|
|
@@ -85,7 +87,7 @@ class SCInteraction {
|
|
|
85
87
|
}
|
|
86
88
|
static create() {
|
|
87
89
|
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
-
const config = api_1.
|
|
90
|
+
const config = api_1.default.getClient().config;
|
|
89
91
|
const marketAbiXOXNO = yield SmartContractAbis_1.SmartContractAbis.getMarket();
|
|
90
92
|
const xo_abi = (0, SmartContractService_1.getSmartContract)(marketAbiXOXNO, config.XO_SC);
|
|
91
93
|
return new SCInteraction(xo_abi);
|
|
@@ -205,5 +207,5 @@ class SCInteraction {
|
|
|
205
207
|
});
|
|
206
208
|
}
|
|
207
209
|
}
|
|
208
|
-
exports.
|
|
210
|
+
exports.default = SCInteraction;
|
|
209
211
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interact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multiversx/sdk-core/out/smartcontracts/smar
|
|
|
3
3
|
* LaunchpadModule provides methods to interact with the minter smart contract.
|
|
4
4
|
* @class
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export default class LaunchpadModule {
|
|
7
7
|
private minter;
|
|
8
8
|
private call;
|
|
9
9
|
/**
|
package/dist/launchpad/index.js
CHANGED
|
@@ -9,7 +9,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.LaunchpadModule = void 0;
|
|
13
12
|
const SmartContractAbis_1 = require("../utils/SmartContractAbis");
|
|
14
13
|
const SmartContractService_1 = require("../utils/SmartContractService");
|
|
15
14
|
const scCalls_1 = require("../utils/scCalls");
|
|
@@ -154,5 +153,5 @@ class LaunchpadModule {
|
|
|
154
153
|
});
|
|
155
154
|
}
|
|
156
155
|
}
|
|
157
|
-
exports.
|
|
156
|
+
exports.default = LaunchpadModule;
|
|
158
157
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/launchpad/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/launchpad/index.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,kEAA+D;AAC/D,wEAAiE;AACjE,8CAAuD;AAGvD;;;GAGG;AACH,MAAqB,eAAe;IAGlC;;;OAGG;IACH,YAAY,cAA6B;QA2BzC;;;;WAIG;QACI,qBAAgB,GAAG,GAA4B,EAAE;;YACtD,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;YACtD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;YACjD,OAAO,MAAA,MAAM,CAAC,UAAU,0CAAE,OAAO,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AAC,CAAC;YAC9D,OAAO,IAAI,eAAe,CAAC,UAAU,CAAC,CAAC;QACzC,CAAC;KAAA;CAwHF;AAxJD,kCAwJC"}
|
package/dist/nft/index.d.ts
CHANGED
|
@@ -5,10 +5,9 @@ import { TradingActivityResponse, TradincActivityArgs } from '../types/trading';
|
|
|
5
5
|
* It includes methods for getting single NFT information, and searching NFTs by collection and nonce.
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
|
-
* const
|
|
9
|
-
* const nftModule = xoxno.nft;
|
|
8
|
+
* const nftModule = new NFTModule();
|
|
10
9
|
*/
|
|
11
|
-
export
|
|
10
|
+
export default class NFTModule {
|
|
12
11
|
private api;
|
|
13
12
|
constructor();
|
|
14
13
|
/**
|
package/dist/nft/index.js
CHANGED
|
@@ -8,9 +8,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
|
|
13
|
-
const api_1 = require("../utils/api");
|
|
15
|
+
const api_1 = __importDefault(require("../utils/api"));
|
|
14
16
|
const getActivity_1 = require("../utils/getActivity");
|
|
15
17
|
const helpers_1 = require("../utils/helpers");
|
|
16
18
|
const regex_1 = require("../utils/regex");
|
|
@@ -19,8 +21,7 @@ const regex_1 = require("../utils/regex");
|
|
|
19
21
|
* It includes methods for getting single NFT information, and searching NFTs by collection and nonce.
|
|
20
22
|
*
|
|
21
23
|
* @example
|
|
22
|
-
* const
|
|
23
|
-
* const nftModule = xoxno.nft;
|
|
24
|
+
* const nftModule = new NFTModule();
|
|
24
25
|
*/
|
|
25
26
|
class NFTModule {
|
|
26
27
|
constructor() {
|
|
@@ -80,8 +81,8 @@ class NFTModule {
|
|
|
80
81
|
this.getTradingActivity = (args) => __awaiter(this, void 0, void 0, function* () {
|
|
81
82
|
return yield (0, getActivity_1.getActivity)(args, this.api);
|
|
82
83
|
});
|
|
83
|
-
this.api = api_1.
|
|
84
|
+
this.api = api_1.default.getClient();
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
|
-
exports.
|
|
87
|
+
exports.default = NFTModule;
|
|
87
88
|
//# sourceMappingURL=index.js.map
|
package/dist/nft/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/nft/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/nft/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAEA,uDAAuC;AACvC,sDAAmD;AACnD,8CAAgE;AAChE,0CAA+E;AAE/E;;;;;;GAMG;AAEH,MAAqB,SAAS;IAE5B;QAIA;;;;WAIG;QACI,uBAAkB,GAAG,CAAO,UAAkB,EAAoB,EAAE;YACzE,IAAI,CAAC,IAAA,4BAAoB,EAAC,UAAU,CAAC,EAAE;gBACrC,MAAM,IAAI,KAAK,CAAC,sBAAsB,GAAG,UAAU,CAAC,CAAC;aACtD;YACD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAC9C,SAAS,UAAU,EAAE,CACtB,CAAC;YACF,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAA,CAAC;QAEF;;;;;;WAMG;QACI,+BAA0B,GAAG,CAClC,UAAkB,EAClB,KAAa,EACK,EAAE;YACpB,IAAI,CAAC,IAAA,+BAAuB,EAAC,UAAU,CAAC,EAAE;gBACxC,MAAM,IAAI,KAAK,CAAC,6BAA6B,GAAG,UAAU,CAAC,CAAC;aAC7D;YAED,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAC9C,SAAS,IAAA,sCAA4B,EAAC,UAAU,EAAE,KAAK,CAAC,EAAE,CAC3D,CAAC;YACF,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAA,CAAC;QAEF;;;;;;WAMG;QAEI,kCAA6B,GAAG,CACrC,UAAkB,EAClB,QAAgB,EACE,EAAE;YACpB,iCAAiC;YACjC,IAAI,CAAC,IAAA,+BAAuB,EAAC,UAAU,CAAC,EAAE;gBACxC,MAAM,IAAI,KAAK,CAAC,6BAA6B,GAAG,UAAU,CAAC,CAAC;aAC7D;YACD,6BAA6B;YAC7B,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,EAAE;gBAC7B,QAAQ,GAAG,GAAG,GAAG,QAAQ,CAAC;aAC3B;YACD,qBAAqB;YACrB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAC9C,SAAS,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAC5C,CAAC;YACF,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAA,CAAC;QAEF;;;;;;WAMG;QACI,uBAAkB,GAAG,CAC1B,IAAyB,EACS,EAAE;YACpC,OAAO,MAAM,IAAA,yBAAW,EAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;QAC3C,CAAC,CAAA,CAAC;QA7EA,IAAI,CAAC,GAAG,GAAG,aAAW,CAAC,SAAS,EAAE,CAAC;IACrC,CAAC;CA6EF;AAjFD,4BAiFC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { StakingPool } from '../types/staking';
|
|
2
|
+
import { Nfts } from '../types/user';
|
|
3
|
+
export default class StakingModule {
|
|
4
|
+
private api;
|
|
5
|
+
constructor();
|
|
6
|
+
/**
|
|
7
|
+
* Returns all staking pools
|
|
8
|
+
*
|
|
9
|
+
* @returns {StakingPool[]}
|
|
10
|
+
*/
|
|
11
|
+
getAllStakingPools: () => Promise<StakingPool[]>;
|
|
12
|
+
/**
|
|
13
|
+
* Returns the staking pool by id
|
|
14
|
+
*
|
|
15
|
+
* @returns {StakingPool}
|
|
16
|
+
*/
|
|
17
|
+
getStakingPoolInfo: (poolId: number) => Promise<StakingPool>;
|
|
18
|
+
/**
|
|
19
|
+
* Returns the staking pool by id
|
|
20
|
+
* @param poolId - The pool id
|
|
21
|
+
* @param address - The user's address
|
|
22
|
+
* @param tickers - The collection tickers
|
|
23
|
+
* @returns {Nfts} - A list of token ids and the price
|
|
24
|
+
* @example
|
|
25
|
+
* const nfts = await new StakingModule().getStakableNFTsByWallet(1, 'erd111', ['EGIRL-absd123']);
|
|
26
|
+
* @throws an error if the pool id is not a number
|
|
27
|
+
* @throws an error if the address is not valid
|
|
28
|
+
* @throws an error if the tickers are not valid
|
|
29
|
+
**/
|
|
30
|
+
getStakableNFTsByWallet: (poolId: number, address: string, tickers: string[]) => Promise<Nfts>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const api_1 = __importDefault(require("../utils/api"));
|
|
16
|
+
const helpers_1 = require("../utils/helpers");
|
|
17
|
+
class StakingModule {
|
|
18
|
+
constructor() {
|
|
19
|
+
/**
|
|
20
|
+
* Returns all staking pools
|
|
21
|
+
*
|
|
22
|
+
* @returns {StakingPool[]}
|
|
23
|
+
*/
|
|
24
|
+
this.getAllStakingPools = () => __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
const response = yield this.api.fetchWithTimeout('/getStakingPools');
|
|
26
|
+
return response;
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* Returns the staking pool by id
|
|
30
|
+
*
|
|
31
|
+
* @returns {StakingPool}
|
|
32
|
+
*/
|
|
33
|
+
this.getStakingPoolInfo = (poolId) => __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
if (typeof poolId !== 'number')
|
|
35
|
+
throw new Error('Invalid pool id');
|
|
36
|
+
const response = yield this.api.fetchWithTimeout(`/getPoolDetails/${poolId}`);
|
|
37
|
+
return response;
|
|
38
|
+
});
|
|
39
|
+
/**
|
|
40
|
+
* Returns the staking pool by id
|
|
41
|
+
* @param poolId - The pool id
|
|
42
|
+
* @param address - The user's address
|
|
43
|
+
* @param tickers - The collection tickers
|
|
44
|
+
* @returns {Nfts} - A list of token ids and the price
|
|
45
|
+
* @example
|
|
46
|
+
* const nfts = await new StakingModule().getStakableNFTsByWallet(1, 'erd111', ['EGIRL-absd123']);
|
|
47
|
+
* @throws an error if the pool id is not a number
|
|
48
|
+
* @throws an error if the address is not valid
|
|
49
|
+
* @throws an error if the tickers are not valid
|
|
50
|
+
**/
|
|
51
|
+
this.getStakableNFTsByWallet = (poolId, address, tickers) => __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
if (typeof poolId !== 'number')
|
|
53
|
+
throw new Error('Invalid pool id');
|
|
54
|
+
if (!(0, helpers_1.isAddressValid)(address))
|
|
55
|
+
throw new Error('Invalid address');
|
|
56
|
+
const response = yield this.api.fetchWithTimeout('/getNftsForStake', {
|
|
57
|
+
method: 'POST',
|
|
58
|
+
body: JSON.stringify({
|
|
59
|
+
poolId,
|
|
60
|
+
address,
|
|
61
|
+
tickers,
|
|
62
|
+
}),
|
|
63
|
+
});
|
|
64
|
+
return response;
|
|
65
|
+
});
|
|
66
|
+
this.api = api_1.default.getClient();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.default = StakingModule;
|
|
70
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/staking/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAEA,uDAAuC;AACvC,8CAAkD;AAElD,MAAqB,aAAa;IAEhC;QAIA;;;;WAIG;QACI,uBAAkB,GAAG,GAAiC,EAAE;YAC7D,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAC9C,kBAAkB,CACnB,CAAC;YACF,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAA,CAAC;QAEF;;;;WAIG;QACI,uBAAkB,GAAG,CAAO,MAAc,EAAwB,EAAE;YACzE,IAAI,OAAO,MAAM,KAAK,QAAQ;gBAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;YACnE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAC9C,mBAAmB,MAAM,EAAE,CAC5B,CAAC;YACF,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAA,CAAC;QAEF;;;;;;;;;;;YAWI;QACG,4BAAuB,GAAG,CAC/B,MAAc,EACd,OAAe,EACf,OAAiB,EACF,EAAE;YACjB,IAAI,OAAO,MAAM,KAAK,QAAQ;gBAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;YACnE,IAAI,CAAC,IAAA,wBAAc,EAAC,OAAO,CAAC;gBAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;YACjE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAO,kBAAkB,EAAE;gBACzE,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;oBACnB,MAAM;oBACN,OAAO;oBACP,OAAO;iBACR,CAAC;aACH,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAA,CAAC;QAxDA,IAAI,CAAC,GAAG,GAAG,aAAW,CAAC,SAAS,EAAE,CAAC;IACrC,CAAC;CAwDF;AA5DD,gCA4DC"}
|
package/dist/types/nft.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
value: string;
|
|
1
|
+
import { MetadataAttribute } from './collection';
|
|
2
|
+
export interface NFTAttribute extends MetadataAttribute {
|
|
4
3
|
occurance: number;
|
|
5
4
|
rarity: number;
|
|
6
5
|
frequency: number;
|
|
@@ -9,8 +8,8 @@ export interface NFTAttribute {
|
|
|
9
8
|
}
|
|
10
9
|
export interface NFTMetadata {
|
|
11
10
|
description?: string;
|
|
12
|
-
attributes
|
|
13
|
-
rarity
|
|
11
|
+
attributes?: NFTAttribute[];
|
|
12
|
+
rarity?: {
|
|
14
13
|
rank: number;
|
|
15
14
|
};
|
|
16
15
|
}
|
|
@@ -90,4 +89,6 @@ export interface NftData {
|
|
|
90
89
|
isVerified: boolean;
|
|
91
90
|
isVisible: boolean;
|
|
92
91
|
nftValue?: NftValue;
|
|
92
|
+
pool_id?: number;
|
|
93
|
+
isStaked?: boolean;
|
|
93
94
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { TickerElement } from './user';
|
|
2
|
+
export type StakingPool = {
|
|
3
|
+
name: string;
|
|
4
|
+
collections: TickerElement[];
|
|
5
|
+
pool_type: PoolType;
|
|
6
|
+
issuing_type: IssuingType;
|
|
7
|
+
pool_id: number;
|
|
8
|
+
pool_total_staked?: number;
|
|
9
|
+
whitelist_pool: boolean;
|
|
10
|
+
is_active: boolean;
|
|
11
|
+
is_stake_enabled: boolean;
|
|
12
|
+
expiration_in_days: number;
|
|
13
|
+
profile: string;
|
|
14
|
+
unbound_period: number;
|
|
15
|
+
reward_per_epoch: Reward[];
|
|
16
|
+
reward_balance: Reward[];
|
|
17
|
+
start_issuing: number;
|
|
18
|
+
start_issuing_timestamp: number;
|
|
19
|
+
deadline_issuing: number;
|
|
20
|
+
deadline_issuing_timestamp: number;
|
|
21
|
+
cut_fees: number;
|
|
22
|
+
max_stake_per_pool: number;
|
|
23
|
+
reward_tokens: string[];
|
|
24
|
+
reward_per_epoch_per_nft: Reward[];
|
|
25
|
+
max_stake_per_wallet: number;
|
|
26
|
+
is_verified: boolean;
|
|
27
|
+
percent_filled: number | null;
|
|
28
|
+
currentEpoch: number;
|
|
29
|
+
owner: string;
|
|
30
|
+
};
|
|
31
|
+
export declare enum IssuingType {
|
|
32
|
+
Dynamic = "Dynamic",
|
|
33
|
+
Fixed = "Fixed"
|
|
34
|
+
}
|
|
35
|
+
export declare enum PoolType {
|
|
36
|
+
Duo = "Duo",
|
|
37
|
+
Single = "Single"
|
|
38
|
+
}
|
|
39
|
+
export type Reward = {
|
|
40
|
+
value: number;
|
|
41
|
+
ticker: string;
|
|
42
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PoolType = exports.IssuingType = void 0;
|
|
4
|
+
var IssuingType;
|
|
5
|
+
(function (IssuingType) {
|
|
6
|
+
IssuingType["Dynamic"] = "Dynamic";
|
|
7
|
+
IssuingType["Fixed"] = "Fixed";
|
|
8
|
+
})(IssuingType = exports.IssuingType || (exports.IssuingType = {}));
|
|
9
|
+
var PoolType;
|
|
10
|
+
(function (PoolType) {
|
|
11
|
+
PoolType["Duo"] = "Duo";
|
|
12
|
+
PoolType["Single"] = "Single";
|
|
13
|
+
})(PoolType = exports.PoolType || (exports.PoolType = {}));
|
|
14
|
+
//# sourceMappingURL=staking.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"staking.js","sourceRoot":"","sources":["../../src/types/staking.ts"],"names":[],"mappings":";;;AAgCA,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,8BAAe,CAAA;AACjB,CAAC,EAHW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAGtB;AAED,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,uBAAW,CAAA;IACX,6BAAiB,CAAA;AACnB,CAAC,EAHW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAGnB"}
|
package/dist/types/trading.d.ts
CHANGED
|
@@ -31,8 +31,8 @@ export interface TradincActivityArgs {
|
|
|
31
31
|
collections?: string[];
|
|
32
32
|
/** The identifier of the NFTs to fetch the trading activity from */
|
|
33
33
|
identifiers?: string[];
|
|
34
|
-
/** The
|
|
35
|
-
|
|
34
|
+
/** The wallets for which to fetch the trading activity */
|
|
35
|
+
wallets?: string[];
|
|
36
36
|
/** The marketplaces to fetch the trading activity from */
|
|
37
37
|
marketplaces?: Marketplace[];
|
|
38
38
|
/** The tokens to fetch the trading activity from */
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { MetadataAttribute } from './collection';
|
|
2
|
+
import { NftData } from './nft';
|
|
3
|
+
export interface IUserProfile {
|
|
4
|
+
dataType: 'userProfile';
|
|
5
|
+
hasKYC?: boolean;
|
|
6
|
+
address: string;
|
|
7
|
+
isBanned: boolean;
|
|
8
|
+
isVerified: boolean;
|
|
9
|
+
socials: ISocials;
|
|
10
|
+
favorites: string[];
|
|
11
|
+
joinedDate: number;
|
|
12
|
+
id: string;
|
|
13
|
+
profile: string;
|
|
14
|
+
banner: string;
|
|
15
|
+
description: string;
|
|
16
|
+
herotag: string;
|
|
17
|
+
isCreator: boolean;
|
|
18
|
+
creatorInfo: {
|
|
19
|
+
contractAddress?: string;
|
|
20
|
+
name?: string;
|
|
21
|
+
};
|
|
22
|
+
isPoolOwner: boolean;
|
|
23
|
+
followedCollections: string[];
|
|
24
|
+
userDeposit: UserDeposit[];
|
|
25
|
+
_ts: number;
|
|
26
|
+
shard: number;
|
|
27
|
+
}
|
|
28
|
+
export interface UserDeposit {
|
|
29
|
+
balanceShort: number;
|
|
30
|
+
balance: string;
|
|
31
|
+
paymentToken: string;
|
|
32
|
+
paymentTokenNonce: number;
|
|
33
|
+
}
|
|
34
|
+
export interface ISocials {
|
|
35
|
+
twitter?: string;
|
|
36
|
+
instagram?: string;
|
|
37
|
+
website?: string;
|
|
38
|
+
telegram?: string;
|
|
39
|
+
discord?: string;
|
|
40
|
+
facebook?: string;
|
|
41
|
+
youtube?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface UserInventory {
|
|
44
|
+
nftsWorth: number;
|
|
45
|
+
groupedByCollection: GroupedByCollection[];
|
|
46
|
+
}
|
|
47
|
+
export interface GroupedByCollection {
|
|
48
|
+
name: string;
|
|
49
|
+
type: string;
|
|
50
|
+
image: string;
|
|
51
|
+
ticker: string;
|
|
52
|
+
isVerified: boolean;
|
|
53
|
+
isVisible: boolean;
|
|
54
|
+
nftsCount: number;
|
|
55
|
+
nfts: NftData[];
|
|
56
|
+
bids: NftData[];
|
|
57
|
+
floorWorth: number;
|
|
58
|
+
maxWorth: number;
|
|
59
|
+
floorPrice: number;
|
|
60
|
+
totalWorth: number;
|
|
61
|
+
}
|
|
62
|
+
export interface UserOffers {
|
|
63
|
+
nftsWorth: number;
|
|
64
|
+
groupedByCollection: OffersGroupedByCollection[];
|
|
65
|
+
}
|
|
66
|
+
export interface OffersGroupedByCollection {
|
|
67
|
+
name: string;
|
|
68
|
+
type: string;
|
|
69
|
+
image: string;
|
|
70
|
+
ticker: string;
|
|
71
|
+
isVerified: boolean;
|
|
72
|
+
isVisible: boolean;
|
|
73
|
+
offers: Offer[];
|
|
74
|
+
globalOffers: GlobalOffer[];
|
|
75
|
+
}
|
|
76
|
+
export interface GlobalOffer {
|
|
77
|
+
dataType: string;
|
|
78
|
+
offer_id: number;
|
|
79
|
+
collection: string;
|
|
80
|
+
quantity: number;
|
|
81
|
+
payment_token: string;
|
|
82
|
+
payment_nonce: number;
|
|
83
|
+
price: string;
|
|
84
|
+
short_price: number;
|
|
85
|
+
owner: string;
|
|
86
|
+
marketplace: string;
|
|
87
|
+
timestamp: number;
|
|
88
|
+
attributes: MetadataAttribute[];
|
|
89
|
+
id: string;
|
|
90
|
+
uniqueKey: string;
|
|
91
|
+
_ts: number;
|
|
92
|
+
isActive: boolean;
|
|
93
|
+
}
|
|
94
|
+
export declare enum OfferType {
|
|
95
|
+
Received = "Received",
|
|
96
|
+
Sent = "Sent"
|
|
97
|
+
}
|
|
98
|
+
export interface Offer {
|
|
99
|
+
offerType: OfferType;
|
|
100
|
+
identifier: string;
|
|
101
|
+
webpUrl: string;
|
|
102
|
+
avifUrl: string;
|
|
103
|
+
onSale: boolean;
|
|
104
|
+
url: string;
|
|
105
|
+
collection: string;
|
|
106
|
+
onDR: boolean;
|
|
107
|
+
onFM: boolean;
|
|
108
|
+
onKG: boolean;
|
|
109
|
+
name: string;
|
|
110
|
+
nonce: number;
|
|
111
|
+
offer_id: number;
|
|
112
|
+
payment_token: string;
|
|
113
|
+
payment_nonce: number;
|
|
114
|
+
price: string;
|
|
115
|
+
price_short: number;
|
|
116
|
+
deadline: number;
|
|
117
|
+
timestamp: number;
|
|
118
|
+
owner: string;
|
|
119
|
+
quantity: number;
|
|
120
|
+
EgldValue: number;
|
|
121
|
+
UsdValue: number;
|
|
122
|
+
isActive: boolean;
|
|
123
|
+
ownerUsername: string;
|
|
124
|
+
}
|
|
125
|
+
export type UserStakingInfo = {
|
|
126
|
+
pool_id: number;
|
|
127
|
+
pool_type: string;
|
|
128
|
+
unClaimedReward: UnClaimedReward[];
|
|
129
|
+
reward_token: string[];
|
|
130
|
+
name: string;
|
|
131
|
+
profile: string;
|
|
132
|
+
ticker: TickerElement[];
|
|
133
|
+
nfts: Nfts;
|
|
134
|
+
};
|
|
135
|
+
export type Nfts = {
|
|
136
|
+
count: number;
|
|
137
|
+
resultsCount: number;
|
|
138
|
+
results: NftData[];
|
|
139
|
+
empty: boolean;
|
|
140
|
+
};
|
|
141
|
+
export declare enum Type {
|
|
142
|
+
NonFungibleESDT = "NonFungibleESDT"
|
|
143
|
+
}
|
|
144
|
+
export type TickerElement = {
|
|
145
|
+
ticker: string;
|
|
146
|
+
name: string;
|
|
147
|
+
};
|
|
148
|
+
export type UnClaimedReward = {
|
|
149
|
+
reward_token: string;
|
|
150
|
+
reward_token_nonce: string;
|
|
151
|
+
amount: number;
|
|
152
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Type = exports.OfferType = void 0;
|
|
4
|
+
var OfferType;
|
|
5
|
+
(function (OfferType) {
|
|
6
|
+
OfferType["Received"] = "Received";
|
|
7
|
+
OfferType["Sent"] = "Sent";
|
|
8
|
+
})(OfferType = exports.OfferType || (exports.OfferType = {}));
|
|
9
|
+
var Type;
|
|
10
|
+
(function (Type) {
|
|
11
|
+
Type["NonFungibleESDT"] = "NonFungibleESDT";
|
|
12
|
+
})(Type = exports.Type || (exports.Type = {}));
|
|
13
|
+
//# sourceMappingURL=user.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/types/user.ts"],"names":[],"mappings":";;;AAqGA,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,kCAAqB,CAAA;IACrB,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAGpB;AA+CD,IAAY,IAEX;AAFD,WAAY,IAAI;IACd,2CAAmC,CAAA;AACrC,CAAC,EAFW,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAEf"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { NftData, TradincActivityArgs, TradingActivityResponse } from '../types';
|
|
2
|
+
import { IUserProfile, UserInventory, UserOffers, UserStakingInfo } from '../types/user';
|
|
3
|
+
export default class UserModule {
|
|
4
|
+
private api;
|
|
5
|
+
constructor();
|
|
6
|
+
/**
|
|
7
|
+
* Returns the user profile
|
|
8
|
+
*
|
|
9
|
+
* @param {String} address - Address of the user
|
|
10
|
+
* @returns {IUserProfile}
|
|
11
|
+
*/
|
|
12
|
+
getUserProfile: (address: string) => Promise<IUserProfile>;
|
|
13
|
+
/**
|
|
14
|
+
* Gets user's inventory
|
|
15
|
+
*
|
|
16
|
+
* @param {String} address - User's address
|
|
17
|
+
* @returns {UserInventory} User's inventory
|
|
18
|
+
*/
|
|
19
|
+
getUserInventory: (address: string) => Promise<UserInventory>;
|
|
20
|
+
/**
|
|
21
|
+
* Fetches the user's NFTs listed on the marketplaces
|
|
22
|
+
* @param address - The user's address
|
|
23
|
+
* @returns {UserInventory} - A list of token ids and the price
|
|
24
|
+
*/
|
|
25
|
+
getUserListedInventory: (address: string) => Promise<UserInventory>;
|
|
26
|
+
/**
|
|
27
|
+
* @name getUserOffers
|
|
28
|
+
* @description Fetches all offers sent or received associated with a user address
|
|
29
|
+
* @param {String} address - The user's wallet address
|
|
30
|
+
* @returns {UserOffers} - The user's listings
|
|
31
|
+
*/
|
|
32
|
+
getUserOffers: (address: string) => Promise<UserOffers>;
|
|
33
|
+
/**
|
|
34
|
+
* Gets all NFTs from a collection by a specific user address
|
|
35
|
+
*
|
|
36
|
+
* @param {String} address - Address of the user
|
|
37
|
+
* @param {String} collection - Collection ticker
|
|
38
|
+
* @returns {NftData[]} A list of NFTs
|
|
39
|
+
*/
|
|
40
|
+
getUserNFTsByCollection: (address: string, collection: string) => Promise<NftData[]>;
|
|
41
|
+
/**
|
|
42
|
+
* Retrieves trading history based on the provided arguments.
|
|
43
|
+
*
|
|
44
|
+
* @param {TradincActivityArgs} args - The arguments for filtering the trading activity.
|
|
45
|
+
* @returns {Promise<TradingActivityResponse>} A promise resolving to a TradingActivityResponse object containing the activity.
|
|
46
|
+
* @throws {Error} Throws an error if the 'top' argument is greater than 35.
|
|
47
|
+
*/
|
|
48
|
+
getTradingActivity: (args: TradincActivityArgs) => Promise<TradingActivityResponse>;
|
|
49
|
+
/** Gets user's staking info
|
|
50
|
+
* @param {String} address - User's address
|
|
51
|
+
* @returns {UserStakingInfo} User's staking info
|
|
52
|
+
* @throws {Error} Throws an error if the address is invalid
|
|
53
|
+
* @example const userStakingInfo = await new UserModule().getUserStakingInfo('erd11...');
|
|
54
|
+
* */
|
|
55
|
+
getUserStakingInfo: (address: string) => Promise<UserStakingInfo[]>;
|
|
56
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const api_1 = __importDefault(require("../utils/api"));
|
|
16
|
+
const getActivity_1 = require("../utils/getActivity");
|
|
17
|
+
const helpers_1 = require("../utils/helpers");
|
|
18
|
+
const regex_1 = require("../utils/regex");
|
|
19
|
+
class UserModule {
|
|
20
|
+
constructor() {
|
|
21
|
+
/**
|
|
22
|
+
* Returns the user profile
|
|
23
|
+
*
|
|
24
|
+
* @param {String} address - Address of the user
|
|
25
|
+
* @returns {IUserProfile}
|
|
26
|
+
*/
|
|
27
|
+
this.getUserProfile = (address) => __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
if (!(0, helpers_1.isAddressValid)(address))
|
|
29
|
+
throw new Error('Invalid address');
|
|
30
|
+
const response = yield this.api.fetchWithTimeout(`/getUserProfile/${address}`);
|
|
31
|
+
return response;
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
* Gets user's inventory
|
|
35
|
+
*
|
|
36
|
+
* @param {String} address - User's address
|
|
37
|
+
* @returns {UserInventory} User's inventory
|
|
38
|
+
*/
|
|
39
|
+
this.getUserInventory = (address) => __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
if (!(0, helpers_1.isAddressValid)(address))
|
|
41
|
+
throw new Error('Invalid address');
|
|
42
|
+
const response = yield this.api.fetchWithTimeout(`/accounts/${address}/inventory`);
|
|
43
|
+
return response;
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* Fetches the user's NFTs listed on the marketplaces
|
|
47
|
+
* @param address - The user's address
|
|
48
|
+
* @returns {UserInventory} - A list of token ids and the price
|
|
49
|
+
*/
|
|
50
|
+
this.getUserListedInventory = (address) => __awaiter(this, void 0, void 0, function* () {
|
|
51
|
+
if (!(0, helpers_1.isAddressValid)(address))
|
|
52
|
+
throw new Error('Invalid address');
|
|
53
|
+
const response = yield this.api.fetchWithTimeout(`/accounts/${address}/listings`);
|
|
54
|
+
return response;
|
|
55
|
+
});
|
|
56
|
+
/**
|
|
57
|
+
* @name getUserOffers
|
|
58
|
+
* @description Fetches all offers sent or received associated with a user address
|
|
59
|
+
* @param {String} address - The user's wallet address
|
|
60
|
+
* @returns {UserOffers} - The user's listings
|
|
61
|
+
*/
|
|
62
|
+
this.getUserOffers = (address) => __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
if (!(0, helpers_1.isAddressValid)(address))
|
|
64
|
+
throw new Error('Invalid address');
|
|
65
|
+
const response = yield this.api.fetchWithTimeout(`/accounts/${address}/listings`);
|
|
66
|
+
return response;
|
|
67
|
+
});
|
|
68
|
+
/**
|
|
69
|
+
* Gets all NFTs from a collection by a specific user address
|
|
70
|
+
*
|
|
71
|
+
* @param {String} address - Address of the user
|
|
72
|
+
* @param {String} collection - Collection ticker
|
|
73
|
+
* @returns {NftData[]} A list of NFTs
|
|
74
|
+
*/
|
|
75
|
+
this.getUserNFTsByCollection = (address, collection) => __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
if (!(0, helpers_1.isAddressValid)(address))
|
|
77
|
+
throw new Error('Invalid address');
|
|
78
|
+
if (!(0, regex_1.isValidCollectionTicker)(collection)) {
|
|
79
|
+
throw new Error('Invalid collection ticker: ' + collection);
|
|
80
|
+
}
|
|
81
|
+
const response = yield this.api.fetchWithTimeout(`/getAccountInventory/${address}/${collection}`);
|
|
82
|
+
return response;
|
|
83
|
+
});
|
|
84
|
+
/**
|
|
85
|
+
* Retrieves trading history based on the provided arguments.
|
|
86
|
+
*
|
|
87
|
+
* @param {TradincActivityArgs} args - The arguments for filtering the trading activity.
|
|
88
|
+
* @returns {Promise<TradingActivityResponse>} A promise resolving to a TradingActivityResponse object containing the activity.
|
|
89
|
+
* @throws {Error} Throws an error if the 'top' argument is greater than 35.
|
|
90
|
+
*/
|
|
91
|
+
this.getTradingActivity = (args) => __awaiter(this, void 0, void 0, function* () {
|
|
92
|
+
return yield (0, getActivity_1.getActivity)(args, this.api);
|
|
93
|
+
});
|
|
94
|
+
/** Gets user's staking info
|
|
95
|
+
* @param {String} address - User's address
|
|
96
|
+
* @returns {UserStakingInfo} User's staking info
|
|
97
|
+
* @throws {Error} Throws an error if the address is invalid
|
|
98
|
+
* @example const userStakingInfo = await new UserModule().getUserStakingInfo('erd11...');
|
|
99
|
+
* */
|
|
100
|
+
this.getUserStakingInfo = (address) => __awaiter(this, void 0, void 0, function* () {
|
|
101
|
+
if (!(0, helpers_1.isAddressValid)(address))
|
|
102
|
+
throw new Error('Invalid address');
|
|
103
|
+
const response = yield this.api.fetchWithTimeout(`/getUserStakingInfo/${address}`);
|
|
104
|
+
return response;
|
|
105
|
+
});
|
|
106
|
+
this.api = api_1.default.getClient();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
exports.default = UserModule;
|
|
110
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/users/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAWA,uDAAuC;AACvC,sDAAmD;AACnD,8CAAkD;AAClD,0CAAyD;AAEzD,MAAqB,UAAU;IAE7B;QAGA;;;;;WAKG;QACI,mBAAc,GAAG,CAAO,OAAe,EAAyB,EAAE;YACvE,IAAI,CAAC,IAAA,wBAAc,EAAC,OAAO,CAAC;gBAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;YACjE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAC9C,mBAAmB,OAAO,EAAE,CAC7B,CAAC;YACF,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAA,CAAC;QAEF;;;;;WAKG;QAEI,qBAAgB,GAAG,CAAO,OAAe,EAA0B,EAAE;YAC1E,IAAI,CAAC,IAAA,wBAAc,EAAC,OAAO,CAAC;gBAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;YACjE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAC9C,aAAa,OAAO,YAAY,CACjC,CAAC;YACF,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAA,CAAC;QAEF;;;;WAIG;QACI,2BAAsB,GAAG,CAC9B,OAAe,EACS,EAAE;YAC1B,IAAI,CAAC,IAAA,wBAAc,EAAC,OAAO,CAAC;gBAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;YACjE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC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M,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAC9C,uBAAuB,OAAO,EAAE,CACjC,CAAC;YACF,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAA,CAAC;QA/GA,IAAI,CAAC,GAAG,GAAG,aAAW,CAAC,SAAS,EAAE,CAAC;IACrC,CAAC;CA+GF;AAnHD,6BAmHC"}
|
package/dist/utils/api.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export declare enum Chain {
|
|
|
2
2
|
MAINNET = "1",
|
|
3
3
|
DEVNET = "D"
|
|
4
4
|
}
|
|
5
|
-
export
|
|
5
|
+
export default class XOXNOClient {
|
|
6
6
|
private static instance;
|
|
7
7
|
apiUrl: string;
|
|
8
8
|
private apiKey;
|
|
@@ -17,7 +17,7 @@ export declare class APIClient {
|
|
|
17
17
|
P2P_SC: string;
|
|
18
18
|
};
|
|
19
19
|
private constructor();
|
|
20
|
-
static init(apiUrl?: string, apiKey?: string, chain?: Chain):
|
|
21
|
-
static getClient():
|
|
20
|
+
static init(apiUrl?: string, apiKey?: string, chain?: Chain): XOXNOClient;
|
|
21
|
+
static getClient(): XOXNOClient;
|
|
22
22
|
fetchWithTimeout: <T>(path: string, options?: Record<string, unknown>, timeout?: number) => Promise<T>;
|
|
23
23
|
}
|
package/dist/utils/api.js
CHANGED
|
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.
|
|
15
|
+
exports.Chain = void 0;
|
|
16
16
|
const axios_1 = __importDefault(require("axios"));
|
|
17
17
|
const const_1 = require("./const");
|
|
18
18
|
var Chain;
|
|
@@ -20,8 +20,8 @@ var Chain;
|
|
|
20
20
|
Chain["MAINNET"] = "1";
|
|
21
21
|
Chain["DEVNET"] = "D";
|
|
22
22
|
})(Chain = exports.Chain || (exports.Chain = {}));
|
|
23
|
-
class
|
|
24
|
-
constructor(apiUrl, apiKey, chain) {
|
|
23
|
+
class XOXNOClient {
|
|
24
|
+
constructor(apiUrl = const_1.API_URL, apiKey = '', chain = Chain.MAINNET) {
|
|
25
25
|
this.fetchWithTimeout = (path, options = {}, timeout = 40000) => __awaiter(this, void 0, void 0, function* () {
|
|
26
26
|
var _a, _b;
|
|
27
27
|
const timestamp = Math.round(new Date().getTime() / 1000);
|
|
@@ -75,17 +75,17 @@ class APIClient {
|
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
77
|
static init(apiUrl = const_1.API_URL, apiKey = '', chain = Chain.MAINNET) {
|
|
78
|
-
if (!
|
|
79
|
-
|
|
78
|
+
if (!XOXNOClient.instance) {
|
|
79
|
+
XOXNOClient.instance = new XOXNOClient(apiUrl, apiKey, chain);
|
|
80
80
|
}
|
|
81
|
-
return
|
|
81
|
+
return XOXNOClient.instance;
|
|
82
82
|
}
|
|
83
83
|
static getClient() {
|
|
84
|
-
if (!
|
|
85
|
-
|
|
84
|
+
if (!XOXNOClient.instance) {
|
|
85
|
+
this.init();
|
|
86
86
|
}
|
|
87
|
-
return
|
|
87
|
+
return XOXNOClient.instance;
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
exports.
|
|
90
|
+
exports.default = XOXNOClient;
|
|
91
91
|
//# sourceMappingURL=api.js.map
|
package/dist/utils/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/utils/api.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,mCAaiB;AACjB,IAAY,KAGX;AAHD,WAAY,KAAK;IACf,sBAAa,CAAA;IACb,qBAAY,CAAA;AACd,CAAC,EAHW,KAAK,GAAL,aAAK,KAAL,aAAK,QAGhB;AACD,
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/utils/api.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,k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CAAC,QAAQ,GAAG,IAAI,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;SAC/D;QACD,OAAO,WAAW,CAAC,QAAQ,CAAC;IAC9B,CAAC;IAEM,MAAM,CAAC,SAAS;QACrB,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE;YACzB,IAAI,CAAC,IAAI,EAAE,CAAC;SACb;QACD,OAAO,WAAW,CAAC,QAAQ,CAAC;IAC9B,CAAC;CAwDF;AArHD,8BAqHC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TradincActivityArgs, TradingActivityResponse } from '../types/trading';
|
|
2
|
-
import
|
|
2
|
+
import XOXNOClient from '../utils/api';
|
|
3
3
|
/**
|
|
4
4
|
* Fetches the trading activity of the given collections
|
|
5
5
|
* @param args - The trading activity arguments
|
|
@@ -7,4 +7,4 @@ import { APIClient } from '../utils/api';
|
|
|
7
7
|
* @returns - The trading activity response
|
|
8
8
|
* @throws - If the top is greater than 35
|
|
9
9
|
*/
|
|
10
|
-
export declare const getActivity: (args: TradincActivityArgs, api:
|
|
10
|
+
export declare const getActivity: (args: TradincActivityArgs, api: XOXNOClient) => Promise<TradingActivityResponse>;
|
|
@@ -26,7 +26,7 @@ const getActivity = (args, api) => __awaiter(void 0, void 0, void 0, function* (
|
|
|
26
26
|
filters: {
|
|
27
27
|
collection: args.collections,
|
|
28
28
|
identifier: args.identifiers || undefined,
|
|
29
|
-
address: args.
|
|
29
|
+
address: args.wallets || undefined,
|
|
30
30
|
tokens: args.placedInToken || undefined,
|
|
31
31
|
marketplace: args.marketplaces || undefined,
|
|
32
32
|
action: args.actions || undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getActivity.js","sourceRoot":"","sources":["../../src/utils/getActivity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAOA;;;;;;GAMG;AACI,MAAM,WAAW,GAAG,CACzB,IAAyB,EACzB,
|
|
1
|
+
{"version":3,"file":"getActivity.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IAAI,mCAAI,CAAC,CAAC,GAAG,CAAC,MAAA,IAAI,CAAC,GAAG,mCAAI,EAAE,CAAC,KAE3C,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,IACtC;AACJ,CAAC,CAAA,CAAC;AAxCW,QAAA,WAAW,eAwCtB"}
|
package/dist/utils/helpers.d.ts
CHANGED
package/dist/utils/helpers.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getIdentifierFromColAndNonce = exports.nonceToHex = void 0;
|
|
3
|
+
exports.isAddressValid = exports.getIdentifierFromColAndNonce = exports.nonceToHex = void 0;
|
|
4
|
+
const address_1 = require("@multiversx/sdk-core/out/address");
|
|
4
5
|
const nonceToHex = (nonce) => {
|
|
5
6
|
let nonceHex = nonce.toString(16);
|
|
6
7
|
if (nonceHex.length % 2 !== 0) {
|
|
@@ -13,4 +14,14 @@ const getIdentifierFromColAndNonce = (collection, nonce) => {
|
|
|
13
14
|
return [collection, (0, exports.nonceToHex)(nonce)].join('-');
|
|
14
15
|
};
|
|
15
16
|
exports.getIdentifierFromColAndNonce = getIdentifierFromColAndNonce;
|
|
17
|
+
const isAddressValid = (address) => {
|
|
18
|
+
try {
|
|
19
|
+
new address_1.Address(address);
|
|
20
|
+
return true && address.includes('erd1');
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
exports.isAddressValid = isAddressValid;
|
|
16
27
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/utils/helpers.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/utils/helpers.ts"],"names":[],"mappings":";;;AAAA,8DAA2D;AAEpD,MAAM,UAAU,GAAG,CAAC,KAAa,EAAU,EAAE;IAClD,IAAI,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAClC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,EAAE;QAC7B,QAAQ,GAAG,GAAG,GAAG,QAAQ,CAAC;KAC3B;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AANW,QAAA,UAAU,cAMrB;AAEK,MAAM,4BAA4B,GAAG,CAC1C,UAAkB,EAClB,KAAa,EACL,EAAE;IACV,OAAO,CAAC,UAAU,EAAE,IAAA,kBAAU,EAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACnD,CAAC,CAAC;AALW,QAAA,4BAA4B,gCAKvC;AAEK,MAAM,cAAc,GAAG,CAAC,OAAwB,EAAW,EAAE;IAClE,IAAI;QACF,IAAI,iBAAO,CAAC,OAAO,CAAC,CAAC;QACrB,OAAO,IAAI,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;KACzC;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,KAAK,CAAC;KACd;AACH,CAAC,CAAC;AAPW,QAAA,cAAc,kBAOzB"}
|
package/dist/utils/scCalls.js
CHANGED
|
@@ -8,15 +8,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.ContractQueryRunner = void 0;
|
|
13
16
|
const sdk_network_providers_1 = require("@multiversx/sdk-network-providers");
|
|
14
|
-
const api_1 = require("./api");
|
|
17
|
+
const api_1 = __importDefault(require("./api"));
|
|
15
18
|
const resultsParser_1 = require("@multiversx/sdk-core/out/smartcontracts/resultsParser");
|
|
16
19
|
class ContractQueryRunner {
|
|
17
20
|
constructor() {
|
|
18
21
|
this.parser = new resultsParser_1.ResultsParser();
|
|
19
|
-
const api = api_1.
|
|
22
|
+
const api = api_1.default.getClient().apiUrl;
|
|
20
23
|
this.proxy = new sdk_network_providers_1.ProxyNetworkProvider(api, {
|
|
21
24
|
timeout: 10000,
|
|
22
25
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scCalls.js","sourceRoot":"","sources":["../../src/utils/scCalls.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scCalls.js","sourceRoot":"","sources":["../../src/utils/scCalls.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6EAG2C;AAG3C,gDAAgC;AAChC,yFAAsF;AAKtF,MAAa,mBAAmB;IAI9B;QAFiB,WAAM,GAAkB,IAAI,6BAAa,EAAE,CAAC;QAG3D,MAAM,GAAG,GAAG,aAAW,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC;QAC3C,IAAI,CAAC,KAAK,GAAG,IAAI,4CAAoB,CAAC,GAAG,EAAE;YACzC,OAAO,EAAE,KAAK;SACf,CAAC,CAAC;IACL,CAAC;IAEK,QAAQ,CACZ,QAAuB,EACvB,WAAwB;;YAExB,IAAI;gBACF,MAAM,aAAa,GACjB,MAAM,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC,CAAC;gBAE3D,OAAO,IAAI,CAAC,MAAM,CAAC,kBAAkB,CACnC,aAAa,EACb,WAAW,CAAC,WAAW,EAAE,CAC1B,CAAC;aACH;YAAC,OAAO,KAAK,EAAE;gBACd,OAAO,CAAC,GAAG,CACT,wCACE,WAAW,CAAC,UAAU,EAAE,CAAC,IAC3B,YAAY,QAAQ,CAAC,UAAU,EAAE,CAAC,MAAM,EAAE,IAAI,CAC/C,CAAC;gBACF,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBAErB,MAAM,KAAK,CAAC;aACb;QACH,CAAC;KAAA;CACF;AAlCD,kDAkCC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xoxno/sdk-js",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12-alpha",
|
|
4
4
|
"description": "The SDK to interact with the XOXNO Protocol!",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"scripts": {
|
|
9
9
|
"test": "jest",
|
|
10
10
|
"build": "tsc -p tsconfig.json",
|
|
11
|
-
"lint": "eslint 'src/**/*.ts'",
|
|
11
|
+
"lint": "eslint 'src/**/*.ts' --fix",
|
|
12
12
|
"format": "prettier --write 'src/**/*.ts'",
|
|
13
13
|
"commit": "git-cz",
|
|
14
14
|
"release": "semantic-release",
|