@xoxno/sdk-js 0.1.76-alpha → 0.1.77-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/dist/711.heavy.bundle.js +2 -0
- package/dist/711.heavy.bundle.js.LICENSE.txt +10 -0
- package/{out/cjs → dist}/collection/index.d.ts +13 -5
- package/dist/collection/index.d.ts.map +1 -0
- package/{out/cjs → dist}/common/index.d.ts +10 -1
- package/dist/common/index.d.ts.map +1 -0
- package/{out/cjs → dist}/index.large.d.ts +1 -0
- package/dist/index.large.d.ts.map +1 -0
- package/{out/cjs/index.d.ts → dist/index.light.d.ts} +1 -2
- package/dist/index.light.d.ts.map +1 -0
- package/{out/cjs → dist}/interactions/index.d.ts +1 -0
- package/dist/interactions/index.d.ts.map +1 -0
- package/{out/cjs → dist}/launchpad/index.d.ts +1 -0
- package/dist/launchpad/index.d.ts.map +1 -0
- package/dist/main.heavy.bundle.js +1 -0
- package/dist/main.light.bundle.js +1 -0
- package/{out/cjs → dist}/nft/index.d.ts +1 -0
- package/dist/nft/index.d.ts.map +1 -0
- package/{out/cjs → dist}/staking/index.d.ts +1 -0
- package/dist/staking/index.d.ts.map +1 -0
- package/{out/cjs → dist}/types/collection.d.ts +34 -6
- package/dist/types/collection.d.ts.map +1 -0
- package/{out/cjs → dist}/types/common.d.ts +10 -0
- package/dist/types/common.d.ts.map +1 -0
- package/{out/cjs → dist}/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -0
- package/{out/cjs → dist}/types/interactions.d.ts +1 -0
- package/dist/types/interactions.d.ts.map +1 -0
- package/{out/cjs → dist}/types/nft.d.ts +1 -0
- package/dist/types/nft.d.ts.map +1 -0
- package/{out/cjs → dist}/types/staking.d.ts +25 -1
- package/dist/types/staking.d.ts.map +1 -0
- package/{out/cjs → dist}/types/trading.d.ts +1 -0
- package/dist/types/trading.d.ts.map +1 -0
- package/{out/cjs → dist}/types/user.d.ts +60 -0
- package/dist/types/user.d.ts.map +1 -0
- package/{out/cjs → dist}/users/index.d.ts +36 -4
- package/dist/users/index.d.ts.map +1 -0
- package/{out/cjs → dist}/utils/SmartContractAbis.d.ts +1 -0
- package/dist/utils/SmartContractAbis.d.ts.map +1 -0
- package/{out/cjs → dist}/utils/SmartContractService.d.ts +1 -0
- package/dist/utils/SmartContractService.d.ts.map +1 -0
- package/{out/cjs → dist}/utils/api.d.ts +1 -0
- package/dist/utils/api.d.ts.map +1 -0
- package/{out/cjs → dist}/utils/const.d.ts +1 -0
- package/dist/utils/const.d.ts.map +1 -0
- package/{out/cjs → dist}/utils/getActivity.d.ts +2 -1
- package/dist/utils/getActivity.d.ts.map +1 -0
- package/{out/cjs → dist}/utils/helpers.d.ts +1 -0
- package/dist/utils/helpers.d.ts.map +1 -0
- package/{out/cjs → dist}/utils/regex.d.ts +1 -0
- package/dist/utils/regex.d.ts.map +1 -0
- package/{out/cjs → dist}/utils/scCalls.d.ts +1 -0
- package/dist/utils/scCalls.d.ts.map +1 -0
- package/package.json +18 -11
- package/out/cjs/collection/index.js +0 -625
- package/out/cjs/collection/index.js.map +0 -1
- package/out/cjs/common/index.js +0 -141
- package/out/cjs/common/index.js.map +0 -1
- package/out/cjs/index.js +0 -26
- package/out/cjs/index.js.map +0 -1
- package/out/cjs/index.large.js +0 -19
- package/out/cjs/index.large.js.map +0 -1
- package/out/cjs/interactions/index.js +0 -678
- package/out/cjs/interactions/index.js.map +0 -1
- package/out/cjs/launchpad/index.js +0 -158
- package/out/cjs/launchpad/index.js.map +0 -1
- package/out/cjs/nft/index.js +0 -121
- package/out/cjs/nft/index.js.map +0 -1
- package/out/cjs/staking/index.js +0 -29
- package/out/cjs/staking/index.js.map +0 -1
- package/out/cjs/types/collection.js +0 -195
- package/out/cjs/types/collection.js.map +0 -1
- package/out/cjs/types/common.js +0 -3
- package/out/cjs/types/common.js.map +0 -1
- package/out/cjs/types/index.js +0 -24
- package/out/cjs/types/index.js.map +0 -1
- package/out/cjs/types/interactions.js +0 -11
- package/out/cjs/types/interactions.js.map +0 -1
- package/out/cjs/types/nft.js +0 -3
- package/out/cjs/types/nft.js.map +0 -1
- package/out/cjs/types/staking.js +0 -15
- package/out/cjs/types/staking.js.map +0 -1
- package/out/cjs/types/trading.js +0 -52
- package/out/cjs/types/trading.js.map +0 -1
- package/out/cjs/types/user.js +0 -13
- package/out/cjs/types/user.js.map +0 -1
- package/out/cjs/users/index.js +0 -335
- package/out/cjs/users/index.js.map +0 -1
- package/out/cjs/utils/SmartContractAbis.js +0 -103
- package/out/cjs/utils/SmartContractAbis.js.map +0 -1
- package/out/cjs/utils/SmartContractService.js +0 -13
- package/out/cjs/utils/SmartContractService.js.map +0 -1
- package/out/cjs/utils/api.js +0 -79
- package/out/cjs/utils/api.js.map +0 -1
- package/out/cjs/utils/const.js +0 -17
- package/out/cjs/utils/const.js.map +0 -1
- package/out/cjs/utils/getActivity.js +0 -65
- package/out/cjs/utils/getActivity.js.map +0 -1
- package/out/cjs/utils/helpers.js +0 -27
- package/out/cjs/utils/helpers.js.map +0 -1
- package/out/cjs/utils/regex.js +0 -12
- package/out/cjs/utils/regex.js.map +0 -1
- package/out/cjs/utils/scCalls.js +0 -39
- package/out/cjs/utils/scCalls.js.map +0 -1
- package/out/src/collection/__tests__/collection.test.js +0 -2
- package/out/src/collection/__tests__/collection.test.js.map +0 -1
- package/out/src/collection/index.js +0 -2
- package/out/src/collection/index.js.map +0 -1
- package/out/src/common/index.js +0 -2
- package/out/src/common/index.js.map +0 -1
- package/out/src/index.js +0 -2
- package/out/src/index.js.map +0 -1
- package/out/src/index.large.js +0 -2
- package/out/src/index.large.js.map +0 -1
- package/out/src/interactions/__tests__/market.test.js +0 -2
- package/out/src/interactions/__tests__/market.test.js.map +0 -1
- package/out/src/interactions/index.js +0 -2
- package/out/src/interactions/index.js.map +0 -1
- package/out/src/launchpad/__tests__/market.test.js +0 -2
- package/out/src/launchpad/__tests__/market.test.js.map +0 -1
- package/out/src/launchpad/index.js +0 -2
- package/out/src/launchpad/index.js.map +0 -1
- package/out/src/nft/__tests__/nft.test.js +0 -2
- package/out/src/nft/__tests__/nft.test.js.map +0 -1
- package/out/src/nft/index.js +0 -2
- package/out/src/nft/index.js.map +0 -1
- package/out/src/staking/index.js +0 -2
- package/out/src/staking/index.js.map +0 -1
- package/out/src/types/collection.js +0 -2
- package/out/src/types/collection.js.map +0 -1
- package/out/src/types/common.js +0 -2
- package/out/src/types/common.js.map +0 -1
- package/out/src/types/index.js +0 -2
- package/out/src/types/index.js.map +0 -1
- package/out/src/types/interactions.js +0 -2
- package/out/src/types/interactions.js.map +0 -1
- package/out/src/types/nft.js +0 -2
- package/out/src/types/nft.js.map +0 -1
- package/out/src/types/staking.js +0 -2
- package/out/src/types/staking.js.map +0 -1
- package/out/src/types/trading.js +0 -2
- package/out/src/types/trading.js.map +0 -1
- package/out/src/types/user.js +0 -2
- package/out/src/types/user.js.map +0 -1
- package/out/src/users/__tests__/user.test.js +0 -2
- package/out/src/users/__tests__/user.test.js.map +0 -1
- package/out/src/users/index.js +0 -2
- package/out/src/users/index.js.map +0 -1
- package/out/src/utils/SmartContractAbis.js +0 -2
- package/out/src/utils/SmartContractAbis.js.map +0 -1
- package/out/src/utils/SmartContractService.js +0 -2
- package/out/src/utils/SmartContractService.js.map +0 -1
- package/out/src/utils/api.js +0 -2
- package/out/src/utils/api.js.map +0 -1
- package/out/src/utils/const.js +0 -2
- package/out/src/utils/const.js.map +0 -1
- package/out/src/utils/getActivity.js +0 -2
- package/out/src/utils/getActivity.js.map +0 -1
- package/out/src/utils/helpers.js +0 -2
- package/out/src/utils/helpers.js.map +0 -1
- package/out/src/utils/regex.js +0 -2
- package/out/src/utils/regex.js.map +0 -1
- package/out/src/utils/scCalls.js +0 -2
- package/out/src/utils/scCalls.js.map +0 -1
package/out/cjs/types/nft.js
DELETED
package/out/cjs/types/nft.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nft.js","sourceRoot":"","sources":["../../../src/types/nft.ts"],"names":[],"mappings":""}
|
package/out/cjs/types/staking.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
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 = IssuingType = {}));
|
|
9
|
-
var PoolType;
|
|
10
|
-
(function (PoolType) {
|
|
11
|
-
PoolType["Duo"] = "Duo";
|
|
12
|
-
PoolType["Single"] = "Single";
|
|
13
|
-
PoolType["Perk"] = "Perk";
|
|
14
|
-
})(PoolType || (exports.PoolType = PoolType = {}));
|
|
15
|
-
//# sourceMappingURL=staking.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"staking.js","sourceRoot":"","sources":["../../../src/types/staking.ts"],"names":[],"mappings":";;;AAuCA,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,8BAAe,CAAA;AACjB,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB;AAED,IAAY,QAIX;AAJD,WAAY,QAAQ;IAClB,uBAAW,CAAA;IACX,6BAAiB,CAAA;IACjB,yBAAa,CAAA;AACf,CAAC,EAJW,QAAQ,wBAAR,QAAQ,QAInB"}
|
package/out/cjs/types/trading.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SelectFieldsTradingActivity = exports.OrderByTradingActivity = exports.NftActivityType = void 0;
|
|
4
|
-
var NftActivityType;
|
|
5
|
-
(function (NftActivityType) {
|
|
6
|
-
// MVX Built-in
|
|
7
|
-
NftActivityType["NFT_CREATE"] = "nftCreate";
|
|
8
|
-
NftActivityType["NFT_BURN"] = "nftBurn";
|
|
9
|
-
NftActivityType["NFT_UPDATE"] = "nftUpdate";
|
|
10
|
-
NftActivityType["NFT_TRANSFER"] = "nftTransfer";
|
|
11
|
-
// Marketplace
|
|
12
|
-
NftActivityType["LISTING_CREATE"] = "listingCreate";
|
|
13
|
-
NftActivityType["LISTING_WITHDRAW"] = "listingWithdraw";
|
|
14
|
-
NftActivityType["LISTING_UPDATE"] = "listingUpdate";
|
|
15
|
-
NftActivityType["AUCTION_BID"] = "auctionBid";
|
|
16
|
-
NftActivityType["AUCTION_OUT_BID"] = "auctionOutBid";
|
|
17
|
-
NftActivityType["OFFER_CREATE"] = "offerCreate";
|
|
18
|
-
NftActivityType["OFFER_WITHDRAW"] = "offerWithdraw";
|
|
19
|
-
NftActivityType["OFFER_REJECT"] = "offerReject";
|
|
20
|
-
NftActivityType["GLOBAL_OFFER_CREATE"] = "globalOfferCreate";
|
|
21
|
-
NftActivityType["GLOBAL_OFFER_WITHDRAW"] = "globalOfferWithdraw";
|
|
22
|
-
NftActivityType["TRADE"] = "trade";
|
|
23
|
-
NftActivityType["BULK_TRADE"] = "bulkTrade";
|
|
24
|
-
NftActivityType["AUCTION_TRADE"] = "auctionTrade";
|
|
25
|
-
NftActivityType["OTHER_TRADE"] = "otherTrade";
|
|
26
|
-
NftActivityType["OFFER_TRADE"] = "offerTrade";
|
|
27
|
-
NftActivityType["GLOBAL_OFFER_TRADE"] = "globalOfferTrade";
|
|
28
|
-
// Staking
|
|
29
|
-
NftActivityType["STAKE"] = "stake";
|
|
30
|
-
NftActivityType["UN_STAKE"] = "unStake";
|
|
31
|
-
})(NftActivityType || (exports.NftActivityType = NftActivityType = {}));
|
|
32
|
-
var OrderByTradingActivity;
|
|
33
|
-
(function (OrderByTradingActivity) {
|
|
34
|
-
OrderByTradingActivity["PriceHighToLow"] = "activityData.egldValue desc";
|
|
35
|
-
OrderByTradingActivity["PriceLowToHigh"] = "activityData.egldValue asc";
|
|
36
|
-
OrderByTradingActivity["RecentPlaced"] = "timestamp desc";
|
|
37
|
-
OrderByTradingActivity["OldestPlaced"] = "timestamp asc";
|
|
38
|
-
})(OrderByTradingActivity || (exports.OrderByTradingActivity = OrderByTradingActivity = {}));
|
|
39
|
-
var SelectFieldsTradingActivity;
|
|
40
|
-
(function (SelectFieldsTradingActivity) {
|
|
41
|
-
SelectFieldsTradingActivity[SelectFieldsTradingActivity["attributes"] = 0] = "attributes";
|
|
42
|
-
SelectFieldsTradingActivity[SelectFieldsTradingActivity["collection"] = 1] = "collection";
|
|
43
|
-
SelectFieldsTradingActivity[SelectFieldsTradingActivity["offer_id"] = 2] = "offer_id";
|
|
44
|
-
SelectFieldsTradingActivity[SelectFieldsTradingActivity["owner"] = 3] = "owner";
|
|
45
|
-
SelectFieldsTradingActivity[SelectFieldsTradingActivity["short_price"] = 4] = "short_price";
|
|
46
|
-
SelectFieldsTradingActivity[SelectFieldsTradingActivity["price"] = 5] = "price";
|
|
47
|
-
SelectFieldsTradingActivity[SelectFieldsTradingActivity["id"] = 6] = "id";
|
|
48
|
-
SelectFieldsTradingActivity[SelectFieldsTradingActivity["dataType"] = 7] = "dataType";
|
|
49
|
-
SelectFieldsTradingActivity[SelectFieldsTradingActivity["marketplace"] = 8] = "marketplace";
|
|
50
|
-
SelectFieldsTradingActivity[SelectFieldsTradingActivity["payment_token"] = 9] = "payment_token";
|
|
51
|
-
})(SelectFieldsTradingActivity || (exports.SelectFieldsTradingActivity = SelectFieldsTradingActivity = {}));
|
|
52
|
-
//# sourceMappingURL=trading.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trading.js","sourceRoot":"","sources":["../../../src/types/trading.ts"],"names":[],"mappings":";;;AAOA,IAAY,eA0BX;AA1BD,WAAY,eAAe;IACzB,eAAe;IACf,2CAAwB,CAAA;IACxB,uCAAoB,CAAA;IACpB,2CAAwB,CAAA;IACxB,+CAA4B,CAAA;IAC5B,cAAc;IACd,mDAAgC,CAAA;IAChC,uDAAoC,CAAA;IACpC,mDAAgC,CAAA;IAChC,6CAA0B,CAAA;IAC1B,oDAAiC,CAAA;IACjC,+CAA4B,CAAA;IAC5B,mDAAgC,CAAA;IAChC,+CAA4B,CAAA;IAC5B,4DAAyC,CAAA;IACzC,gEAA6C,CAAA;IAC7C,kCAAe,CAAA;IACf,2CAAwB,CAAA;IACxB,iDAA8B,CAAA;IAC9B,6CAA0B,CAAA;IAC1B,6CAA0B,CAAA;IAC1B,0DAAuC,CAAA;IACvC,UAAU;IACV,kCAAe,CAAA;IACf,uCAAoB,CAAA;AACtB,CAAC,EA1BW,eAAe,+BAAf,eAAe,QA0B1B;AAgED,IAAY,sBAKX;AALD,WAAY,sBAAsB;IAChC,wEAA8C,CAAA;IAC9C,uEAA6C,CAAA;IAC7C,yDAA+B,CAAA;IAC/B,wDAA8B,CAAA;AAChC,CAAC,EALW,sBAAsB,sCAAtB,sBAAsB,QAKjC;AAED,IAAY,2BAWX;AAXD,WAAY,2BAA2B;IACrC,yFAAY,CAAA;IACZ,yFAAY,CAAA;IACZ,qFAAU,CAAA;IACV,+EAAO,CAAA;IACP,2FAAa,CAAA;IACb,+EAAO,CAAA;IACP,yEAAI,CAAA;IACJ,qFAAU,CAAA;IACV,2FAAa,CAAA;IACb,+FAAe,CAAA;AACjB,CAAC,EAXW,2BAA2B,2CAA3B,2BAA2B,QAWtC"}
|
package/out/cjs/types/user.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
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["Placed"] = "placed";
|
|
8
|
-
})(OfferType || (exports.OfferType = OfferType = {}));
|
|
9
|
-
var Type;
|
|
10
|
-
(function (Type) {
|
|
11
|
-
Type["NonFungibleESDT"] = "NonFungibleESDT";
|
|
12
|
-
})(Type || (exports.Type = Type = {}));
|
|
13
|
-
//# sourceMappingURL=user.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../../src/types/user.ts"],"names":[],"mappings":";;;AA+EA,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,kCAAqB,CAAA;IACrB,8BAAiB,CAAA;AACnB,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AA2CD,IAAY,IAEX;AAFD,WAAY,IAAI;IACd,2CAAmC,CAAA;AACrC,CAAC,EAFW,IAAI,oBAAJ,IAAI,QAEf"}
|
package/out/cjs/users/index.js
DELETED
|
@@ -1,335 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.UserModule = void 0;
|
|
13
|
-
const index_1 = require("../index");
|
|
14
|
-
const getActivity_1 = require("../utils/getActivity");
|
|
15
|
-
const helpers_1 = require("../utils/helpers");
|
|
16
|
-
const regex_1 = require("../utils/regex");
|
|
17
|
-
class UserModule {
|
|
18
|
-
constructor() {
|
|
19
|
-
/**
|
|
20
|
-
* Returns the user profile
|
|
21
|
-
*
|
|
22
|
-
* @param {String} address - Address of the user
|
|
23
|
-
* @returns {IUserProfile}
|
|
24
|
-
*/
|
|
25
|
-
this.getUserProfile = (address) => __awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
if (!(0, helpers_1.isAddressValid)(address))
|
|
27
|
-
throw new Error('Invalid address');
|
|
28
|
-
const response = yield this.api.fetchWithTimeout(`/user/${address}/profile`);
|
|
29
|
-
return response;
|
|
30
|
-
});
|
|
31
|
-
/**
|
|
32
|
-
* Returns the wallet accounts
|
|
33
|
-
*
|
|
34
|
-
* @param {String[]} addresses - Addresses of the user
|
|
35
|
-
* @returns {BulkAccount[]}
|
|
36
|
-
*/
|
|
37
|
-
this.getBulkAccounts = (addresses) => __awaiter(this, void 0, void 0, function* () {
|
|
38
|
-
const response = yield this.api.fetchWithTimeout(`/user/network-account`, {
|
|
39
|
-
method: 'POST',
|
|
40
|
-
body: JSON.stringify(addresses),
|
|
41
|
-
});
|
|
42
|
-
return response;
|
|
43
|
-
});
|
|
44
|
-
/**
|
|
45
|
-
* Returns the user account info that inclues nonce, guardian data, esdtTokens
|
|
46
|
-
*
|
|
47
|
-
* @param {String} address - Address of the user
|
|
48
|
-
* @returns {UserAccountInfo}
|
|
49
|
-
*/
|
|
50
|
-
this.getUserAccount = (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(`/user/${address}/network-account`);
|
|
54
|
-
return response;
|
|
55
|
-
});
|
|
56
|
-
/**
|
|
57
|
-
* Returns the user account info that inclues nonce, guardian data, esdtTokens
|
|
58
|
-
*
|
|
59
|
-
* @param {String} address - Address of the user
|
|
60
|
-
* @returns {UserAccountInfo}
|
|
61
|
-
*/
|
|
62
|
-
this.getUserTokenInventory = (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(`/user/${address}/token-inventory`);
|
|
66
|
-
return response;
|
|
67
|
-
});
|
|
68
|
-
/**
|
|
69
|
-
* Gets user's inventory
|
|
70
|
-
*
|
|
71
|
-
* @param {String} address - User's address
|
|
72
|
-
* @returns {UserInventory} User's inventory
|
|
73
|
-
*/
|
|
74
|
-
this.getUserSummaryInventory = (address) => __awaiter(this, void 0, void 0, function* () {
|
|
75
|
-
if (!(0, helpers_1.isAddressValid)(address))
|
|
76
|
-
throw new Error('Invalid address');
|
|
77
|
-
const response = yield this.api.fetchWithTimeout(`/user/${address}/inventory-summary`);
|
|
78
|
-
return response;
|
|
79
|
-
});
|
|
80
|
-
/**
|
|
81
|
-
* Fetches the user's NFTs listed on the marketplaces
|
|
82
|
-
* @param address - The user's address
|
|
83
|
-
* @returns {UserInventory} - A list of token ids and the price
|
|
84
|
-
*/
|
|
85
|
-
this.getUserNFTs = (args) => __awaiter(this, void 0, void 0, function* () {
|
|
86
|
-
return yield this.collection.getNFTs(args);
|
|
87
|
-
});
|
|
88
|
-
/**
|
|
89
|
-
* @name getUserOffers
|
|
90
|
-
* @description Fetches all offers sent or received associated with a user address
|
|
91
|
-
* @param {String} address - The user's wallet address
|
|
92
|
-
* @returns {UserOffers} - The user's listings
|
|
93
|
-
*/
|
|
94
|
-
this.getUserOffers = (args) => __awaiter(this, void 0, void 0, function* () {
|
|
95
|
-
if (!(0, helpers_1.isAddressValid)(args.address))
|
|
96
|
-
throw new Error('Invalid address');
|
|
97
|
-
const response = yield this.api.fetchWithTimeout(`/user/${args.address}/offers`, {
|
|
98
|
-
params: {
|
|
99
|
-
type: args.type,
|
|
100
|
-
skip: args.skip,
|
|
101
|
-
top: args.top,
|
|
102
|
-
},
|
|
103
|
-
});
|
|
104
|
-
return response;
|
|
105
|
-
});
|
|
106
|
-
/**
|
|
107
|
-
* @public
|
|
108
|
-
* @async
|
|
109
|
-
* @function suggestUsers
|
|
110
|
-
* @param {SuggestNFTsArgs} args - An object containing the necessary parameters to fetch suggested users results.
|
|
111
|
-
* @returns {Promise<SuggestResults>} A promise that resolves to the fetched users results.
|
|
112
|
-
*
|
|
113
|
-
* This function fetches suggested users results based on the provided arguments. It takes an object with the following properties:
|
|
114
|
-
* - name (string): The name to search for (required).
|
|
115
|
-
* - top (number, optional): The maximum number of results to return (default is 35, cannot be greater than 35).
|
|
116
|
-
* - skip (number, optional): The number of results to skip (default is 0).
|
|
117
|
-
*
|
|
118
|
-
* Finally, it returns a promise that resolves to the fetched users results.
|
|
119
|
-
*/
|
|
120
|
-
this.suggestUsers = (args) => __awaiter(this, void 0, void 0, function* () {
|
|
121
|
-
if (args.top && args.top > 35) {
|
|
122
|
-
throw new Error('Top cannot be greater than 35');
|
|
123
|
-
}
|
|
124
|
-
if (!args.name) {
|
|
125
|
-
throw new Error('Name is required');
|
|
126
|
-
}
|
|
127
|
-
const payloadBody = {
|
|
128
|
-
name: args.name,
|
|
129
|
-
top: args.top || 35,
|
|
130
|
-
skip: args.skip || 0,
|
|
131
|
-
};
|
|
132
|
-
return yield this.api.fetchWithTimeout(`/user/search`, {
|
|
133
|
-
params: {
|
|
134
|
-
filter: JSON.stringify(payloadBody),
|
|
135
|
-
},
|
|
136
|
-
next: {
|
|
137
|
-
tags: ['/search/global'],
|
|
138
|
-
revalidate: 180,
|
|
139
|
-
},
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
|
-
/**
|
|
143
|
-
* Retrieves trading history based on the provided arguments.
|
|
144
|
-
*
|
|
145
|
-
* @param {TradincActivityArgs} args - The arguments for filtering the trading activity.
|
|
146
|
-
* @returns {Promise<TradingActivityResponse>} A promise resolving to a TradingActivityResponse object containing the activity.
|
|
147
|
-
* @throws {Error} Throws an error if the 'top' argument is greater than 35.
|
|
148
|
-
*/
|
|
149
|
-
this.getTradingActivity = (args) => __awaiter(this, void 0, void 0, function* () {
|
|
150
|
-
return yield (0, getActivity_1.getActivity)(args, this.api);
|
|
151
|
-
});
|
|
152
|
-
/** Gets user's creator profile
|
|
153
|
-
* @param {String} address - User's address
|
|
154
|
-
* @returns {CreatorProfile} User's creator profile struct
|
|
155
|
-
* @throws {Error} Throws an error if the address is invalid
|
|
156
|
-
* */
|
|
157
|
-
this.getUserCreatorProfile = (address) => __awaiter(this, void 0, void 0, function* () {
|
|
158
|
-
if (!(0, helpers_1.isAddressValid)(address))
|
|
159
|
-
throw new Error('Invalid address');
|
|
160
|
-
const response = yield this.api.fetchWithTimeout(`/user/${address}/creator/profile`);
|
|
161
|
-
return response;
|
|
162
|
-
});
|
|
163
|
-
/** Gets user's creator profile
|
|
164
|
-
* @param {String} address - User's address
|
|
165
|
-
* @returns {IMintInfo[]} User's creator profile struct
|
|
166
|
-
* @throws {Error} Throws an error if the address is invalid
|
|
167
|
-
* */
|
|
168
|
-
this.getCreatorListings = (address) => __awaiter(this, void 0, void 0, function* () {
|
|
169
|
-
if (!(0, helpers_1.isAddressValid)(address))
|
|
170
|
-
throw new Error('Invalid address');
|
|
171
|
-
const response = yield this.api.fetchWithTimeout(`/user/${address}/creator/listing`);
|
|
172
|
-
return response;
|
|
173
|
-
});
|
|
174
|
-
/** Gets user's staking info
|
|
175
|
-
* @param {String} address - User's address
|
|
176
|
-
* @returns {UserStakingSummary[]} User's staking info
|
|
177
|
-
* @throws {Error} Throws an error if the address is invalid
|
|
178
|
-
* */
|
|
179
|
-
this.getUserStakingSummary = (address) => __awaiter(this, void 0, void 0, function* () {
|
|
180
|
-
if (!(0, helpers_1.isAddressValid)(address))
|
|
181
|
-
throw new Error('Invalid address');
|
|
182
|
-
const response = yield this.api.fetchWithTimeout(`/user/${address}/staking/summary`);
|
|
183
|
-
return response;
|
|
184
|
-
});
|
|
185
|
-
/** Gets user's staking info
|
|
186
|
-
* @param {String} address - User's address
|
|
187
|
-
* @returns {UserStakingAvaiblePools[]} User's staking info
|
|
188
|
-
* @throws {Error} Throws an error if the address is invalid
|
|
189
|
-
* */
|
|
190
|
-
this.getUserStakingAailable = (address) => __awaiter(this, void 0, void 0, function* () {
|
|
191
|
-
if (!(0, helpers_1.isAddressValid)(address))
|
|
192
|
-
throw new Error('Invalid address');
|
|
193
|
-
const response = yield this.api.fetchWithTimeout(`/user/${address}/staking/available-pools`);
|
|
194
|
-
return response;
|
|
195
|
-
});
|
|
196
|
-
/** Gets user's creator info
|
|
197
|
-
* @param {String} address - User's address
|
|
198
|
-
* @returns {CreatorInfo} User's creator info
|
|
199
|
-
* @throws {Error} Throws an error if the address is invalid
|
|
200
|
-
* */
|
|
201
|
-
this.getUserCreatorInfo = (address) => __awaiter(this, void 0, void 0, function* () {
|
|
202
|
-
if (!(0, helpers_1.isAddressValid)(address))
|
|
203
|
-
throw new Error('Invalid address');
|
|
204
|
-
const response = yield this.api.fetchWithTimeout(`/user/${address}/creator/details`);
|
|
205
|
-
return response;
|
|
206
|
-
});
|
|
207
|
-
/** Gets pool details
|
|
208
|
-
* @param {String} address - User's address
|
|
209
|
-
* @param {String} collection - Collection ticker
|
|
210
|
-
* @returns {UserCollectionStaking} User's creator info
|
|
211
|
-
* @throws {Error} Throws an error if the address is invalid
|
|
212
|
-
* */
|
|
213
|
-
this.getUserCollectionStaking = (address, collection) => __awaiter(this, void 0, void 0, function* () {
|
|
214
|
-
if (!(0, helpers_1.isAddressValid)(address))
|
|
215
|
-
throw new Error('Invalid address');
|
|
216
|
-
if (!(0, regex_1.isValidCollectionTicker)(collection)) {
|
|
217
|
-
throw new Error('Invalid collection ticker: ' + collection);
|
|
218
|
-
}
|
|
219
|
-
const response = yield this.api.fetchWithTimeout(`/user/${address}/staking/collection/${collection}`);
|
|
220
|
-
return response;
|
|
221
|
-
});
|
|
222
|
-
/** Gets pool details
|
|
223
|
-
* @param {number} poolId - User's address
|
|
224
|
-
* @returns {CreatoPoolDetailsrInfo} User's creator info
|
|
225
|
-
* @throws {Error} Throws an error if the address is invalid
|
|
226
|
-
* */
|
|
227
|
-
this.getUserPoolStaking = (address, poolId) => __awaiter(this, void 0, void 0, function* () {
|
|
228
|
-
if (!(0, helpers_1.isAddressValid)(address))
|
|
229
|
-
throw new Error('Invalid address');
|
|
230
|
-
const response = yield this.api.fetchWithTimeout(`/user/${address}/staking/pool/${poolId}`);
|
|
231
|
-
return response;
|
|
232
|
-
});
|
|
233
|
-
/** Gets pool details
|
|
234
|
-
* @param {number} poolId - User's address
|
|
235
|
-
* @returns {CreatoPoolDetailsrInfo} User's creator info
|
|
236
|
-
* @throws {Error} Throws an error if the address is invalid
|
|
237
|
-
* */
|
|
238
|
-
this.getAvailableNFTsForStakingPool = (address, poolId) => __awaiter(this, void 0, void 0, function* () {
|
|
239
|
-
if (!(0, helpers_1.isAddressValid)(address))
|
|
240
|
-
throw new Error('Invalid address');
|
|
241
|
-
const response = yield this.api.fetchWithTimeout(`/user/${address}/staking/pool/${poolId}/nfts`);
|
|
242
|
-
return response;
|
|
243
|
-
});
|
|
244
|
-
/** Gets owned pools by address
|
|
245
|
-
* @param {string} address - User's address
|
|
246
|
-
* @returns {PoolDetails[]} User pools
|
|
247
|
-
* @throws {Error} Throws an error if the address is invalid
|
|
248
|
-
* */
|
|
249
|
-
this.getOwnedPoolsByAddress = (address) => __awaiter(this, void 0, void 0, function* () {
|
|
250
|
-
if (!(0, helpers_1.isAddressValid)(address))
|
|
251
|
-
throw new Error('Invalid address');
|
|
252
|
-
const response = yield this.api.fetchWithTimeout(`/user/${address}/staking/owned-pools`);
|
|
253
|
-
return response;
|
|
254
|
-
});
|
|
255
|
-
/**
|
|
256
|
-
* Gets user's analytics summary
|
|
257
|
-
*
|
|
258
|
-
* @param {String} address - User's address
|
|
259
|
-
* @returns {UserAnalyticSummary} User's analytics summary
|
|
260
|
-
*/
|
|
261
|
-
this.getUserAnalyticsSummary = (address) => __awaiter(this, void 0, void 0, function* () {
|
|
262
|
-
if (!(0, helpers_1.isAddressValid)(address))
|
|
263
|
-
throw new Error('Invalid address');
|
|
264
|
-
const response = yield this.api.fetchWithTimeout(`/user/${address}/analytics/volume`);
|
|
265
|
-
return response;
|
|
266
|
-
});
|
|
267
|
-
/** Gets user's favorite NFTs
|
|
268
|
-
* @param {String} address - User's address
|
|
269
|
-
* @param {number} top - Top
|
|
270
|
-
* @param {number} skip - Skip
|
|
271
|
-
* @returns {NftData[]} Array of NFTs
|
|
272
|
-
* @throws {Error} Throws an error if the address is invalid
|
|
273
|
-
* */
|
|
274
|
-
this.getUserFavoriteNFTs = (address, top, skip) => __awaiter(this, void 0, void 0, function* () {
|
|
275
|
-
if (!(0, helpers_1.isAddressValid)(address))
|
|
276
|
-
throw new Error('Invalid address');
|
|
277
|
-
const response = yield this.api.fetchWithTimeout(`/user/${address}/favorite/nfts`, {
|
|
278
|
-
params: {
|
|
279
|
-
top,
|
|
280
|
-
skip,
|
|
281
|
-
},
|
|
282
|
-
});
|
|
283
|
-
return response;
|
|
284
|
-
});
|
|
285
|
-
/** Gets user's favorite collection tickers
|
|
286
|
-
* @param {String} address - User's address
|
|
287
|
-
* @returns {String[]} Array of tickers
|
|
288
|
-
* @throws {Error} Throws an error if the address is invalid
|
|
289
|
-
* */
|
|
290
|
-
this.getUserFavoriteCollectionTickers = (address) => __awaiter(this, void 0, void 0, function* () {
|
|
291
|
-
if (!(0, helpers_1.isAddressValid)(address))
|
|
292
|
-
throw new Error('Invalid address');
|
|
293
|
-
const response = yield this.api.fetchWithTimeout(`/user/${address}/favorite/collections`);
|
|
294
|
-
return response;
|
|
295
|
-
});
|
|
296
|
-
/** Get if the creator tag is registered already
|
|
297
|
-
* @param {String} creatorTag - The creator tag that needs to be checked
|
|
298
|
-
* @returns {StatusResponse} True or false
|
|
299
|
-
* */
|
|
300
|
-
this.getIsCreatorRegistered = (creatorTag) => __awaiter(this, void 0, void 0, function* () {
|
|
301
|
-
const response = yield this.api.fetchWithTimeout(`/user/${creatorTag}/creator/is-registered`);
|
|
302
|
-
return response;
|
|
303
|
-
});
|
|
304
|
-
/**
|
|
305
|
-
* @public
|
|
306
|
-
* @async
|
|
307
|
-
* @function getUsersStats
|
|
308
|
-
* @param {SuggestNFTsArgs} args - An object containing the necessary parameters to fetch suggested users results.
|
|
309
|
-
* @returns {Promise<SuggestResults>} A promise that resolves to the fetched users results.
|
|
310
|
-
*/
|
|
311
|
-
this.getUsersStats = (args) => __awaiter(this, void 0, void 0, function* () {
|
|
312
|
-
if (args.top && args.top > 35) {
|
|
313
|
-
throw new Error('Top cannot be greater than 35');
|
|
314
|
-
}
|
|
315
|
-
if (!args.name) {
|
|
316
|
-
throw new Error('Name is required');
|
|
317
|
-
}
|
|
318
|
-
return yield this.api.fetchWithTimeout(`/user/stats`, {
|
|
319
|
-
params: {
|
|
320
|
-
top: args.top,
|
|
321
|
-
skip: args.skip,
|
|
322
|
-
orderBy: args.orderBy,
|
|
323
|
-
},
|
|
324
|
-
next: {
|
|
325
|
-
tags: ['/search/global'],
|
|
326
|
-
revalidate: 180,
|
|
327
|
-
},
|
|
328
|
-
});
|
|
329
|
-
});
|
|
330
|
-
this.api = index_1.XOXNOClient.init();
|
|
331
|
-
this.collection = new index_1.CollectionModule();
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
exports.UserModule = UserModule;
|
|
335
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/users/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oCAAyD;AA4BzD,sDAAmD;AACnD,8CAAkD;AAClD,0CAAyD;AAEzD,MAAa,UAAU;IAGrB;QAKA;;;;;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,SAAS,OAAO,UAAU,CAC3B,CAAC;YACF,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAA,CAAC;QAEF;;;;;WAKG;QACI,oBAAe,GAAG,CACvB,SA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,CAAiB,aAAa,EAAE;gBACpE,MAAM,EAAE;oBACN,GAAG,EAAE,IAAI,CAAC,GAAG;oBACb,IAAI,EAAE,IAAI,CAAC,IAAI;oBACf,OAAO,EAAE,IAAI,CAAC,OAAO;iBACtB;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,CAAC,gBAAgB,CAAC;oBACxB,UAAU,EAAE,GAAG;iBAChB;aACF,CAAC,CAAC;QACL,CAAC,CAAA,CAAC;QA/ZA,IAAI,CAAC,GAAG,GAAG,mBAAW,CAAC,IAAI,EAAE,CAAC;QAC9B,IAAI,CAAC,UAAU,GAAG,IAAI,wBAAgB,EAAE,CAAC;IAC3C,CAAC;CA8ZF;AApaD,gCAoaC"}
|
|
@@ -1,103 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.SmartContractAbis = void 0;
|
|
13
|
-
const abiRegistry_1 = require("@multiversx/sdk-core/out/smartcontracts/typesystem/abiRegistry");
|
|
14
|
-
const api_1 = require("./api");
|
|
15
|
-
class SmartContractAbis {
|
|
16
|
-
static getMarket() {
|
|
17
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
-
if (!SmartContractAbis.market) {
|
|
19
|
-
const data = yield api_1.XOXNOClient.init().fetchWithTimeout('https://media.xoxno.com/smartcontractabi/esdt-nft-marketplace.abi.json', {
|
|
20
|
-
next: {
|
|
21
|
-
tags: ['getMarket'],
|
|
22
|
-
},
|
|
23
|
-
});
|
|
24
|
-
const abiRegistry = abiRegistry_1.AbiRegistry.create(data);
|
|
25
|
-
SmartContractAbis.market = abiRegistry;
|
|
26
|
-
}
|
|
27
|
-
return SmartContractAbis.market;
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
static getManager() {
|
|
31
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
if (!SmartContractAbis.manager) {
|
|
33
|
-
const data = yield api_1.XOXNOClient.init().fetchWithTimeout('https://media.xoxno.com/smartcontractabi/manage.json', {
|
|
34
|
-
next: {
|
|
35
|
-
tags: ['getManager'],
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
const abiRegistry = abiRegistry_1.AbiRegistry.create(data);
|
|
39
|
-
SmartContractAbis.manager = abiRegistry;
|
|
40
|
-
}
|
|
41
|
-
return SmartContractAbis.manager;
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
static getMinter() {
|
|
45
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
-
if (!SmartContractAbis.minter) {
|
|
47
|
-
const data = yield api_1.XOXNOClient.init().fetchWithTimeout('https://media.xoxno.com/smartcontractabi/minter.json', {
|
|
48
|
-
next: {
|
|
49
|
-
tags: ['getMinter'],
|
|
50
|
-
},
|
|
51
|
-
});
|
|
52
|
-
const abiRegistry = abiRegistry_1.AbiRegistry.create(data);
|
|
53
|
-
SmartContractAbis.minter = abiRegistry;
|
|
54
|
-
}
|
|
55
|
-
return SmartContractAbis.minter;
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
static getStaking() {
|
|
59
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
-
if (!SmartContractAbis.staking) {
|
|
61
|
-
const data = yield api_1.XOXNOClient.init().fetchWithTimeout('https://media.xoxno.com/smartcontractabi/staking-nfts.abi.json', {
|
|
62
|
-
next: {
|
|
63
|
-
tags: ['getStaking'],
|
|
64
|
-
},
|
|
65
|
-
});
|
|
66
|
-
const abiRegistry = abiRegistry_1.AbiRegistry.create(data);
|
|
67
|
-
SmartContractAbis.staking = abiRegistry;
|
|
68
|
-
}
|
|
69
|
-
return SmartContractAbis.staking;
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
static getExchange() {
|
|
73
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
-
if (!SmartContractAbis.exchange) {
|
|
75
|
-
const data = yield api_1.XOXNOClient.init().fetchWithTimeout('https://media.xoxno.com/smartcontractabi/rs-exchange.abi.json', {
|
|
76
|
-
next: {
|
|
77
|
-
tags: ['getExchange'],
|
|
78
|
-
},
|
|
79
|
-
});
|
|
80
|
-
const abiRegistry = abiRegistry_1.AbiRegistry.create(data);
|
|
81
|
-
SmartContractAbis.exchange = abiRegistry;
|
|
82
|
-
}
|
|
83
|
-
return SmartContractAbis.exchange;
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
static getP2P() {
|
|
87
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
-
if (!SmartContractAbis.p2p) {
|
|
89
|
-
const data = yield api_1.XOXNOClient.init().fetchWithTimeout('https://media.xoxno.com/smartcontractabi/p2p.abi.json', {
|
|
90
|
-
next: {
|
|
91
|
-
tags: ['getP2P'],
|
|
92
|
-
revalidate: 500,
|
|
93
|
-
},
|
|
94
|
-
});
|
|
95
|
-
const abiRegistry = abiRegistry_1.AbiRegistry.create(data);
|
|
96
|
-
SmartContractAbis.p2p = abiRegistry;
|
|
97
|
-
}
|
|
98
|
-
return SmartContractAbis.p2p;
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
exports.SmartContractAbis = SmartContractAbis;
|
|
103
|
-
//# sourceMappingURL=SmartContractAbis.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SmartContract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AAI,EAAE;wBACJ,IAAI,EAAE,CAAC,QAAQ,CAAC;wBAChB,UAAU,EAAE,GAAG;qBAChB;iBACF,CACF,CAAC;gBACF,MAAM,WAAW,GAAG,yBAAW,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;gBAC7C,iBAAiB,CAAC,GAAG,GAAG,WAAW,CAAC;YACtC,CAAC;YAED,OAAO,iBAAiB,CAAC,GAAG,CAAC;QAC/B,CAAC;KAAA;CACF;AA9GD,8CA8GC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSmartContract = void 0;
|
|
4
|
-
const address_1 = require("@multiversx/sdk-core/out/address");
|
|
5
|
-
const smartContract_1 = require("@multiversx/sdk-core/out/smartcontracts/smartContract");
|
|
6
|
-
const getSmartContract = (abiRegistry, address) => {
|
|
7
|
-
return new smartContract_1.SmartContract({
|
|
8
|
-
address: new address_1.Address(address),
|
|
9
|
-
abi: abiRegistry,
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
|
-
exports.getSmartContract = getSmartContract;
|
|
13
|
-
//# sourceMappingURL=SmartContractService.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SmartContractService.js","sourceRoot":"","sources":["../../../src/utils/SmartContractService.ts"],"names":[],"mappings":";;;AAAA,8DAA2D;AAC3D,yFAAsF;AAG/E,MAAM,gBAAgB,GAAG,CAAC,WAAwB,EAAE,OAAe,EAAE,EAAE;IAC5E,OAAO,IAAI,6BAAa,CAAC;QACvB,OAAO,EAAE,IAAI,iBAAO,CAAC,OAAO,CAAC;QAC7B,GAAG,EAAE,WAAW;KACjB,CAAC,CAAC;AACL,CAAC,CAAC;AALW,QAAA,gBAAgB,oBAK3B"}
|