@eluvio/elv-client-js 3.2.11 → 3.2.14
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/ElvWalletClient-min.js +1 -1
- package/dist/ElvWalletClient-node-min.js +2 -2
- package/dist/src/index.js +2 -2
- package/dist/src/walletClient/ClientMethods.js +204 -148
- package/dist/src/walletClient/index.js +151 -123
- package/package.json +1 -1
- package/src/index.js +2 -2
- package/src/walletClient/ClientMethods.js +43 -13
- package/src/walletClient/index.js +94 -54
- package/testScripts/Test.js +33 -0
- package/testScripts/TestMarketplaceClient.js +0 -25
|
@@ -295,7 +295,7 @@ exports.UserItemInfo = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerator
|
|
|
295
295
|
* @param {string=} contractAddress - Filter results by the address of the NFT contract
|
|
296
296
|
* @param {string=} tokenId - Filter by token ID (if filtering by contract address)
|
|
297
297
|
* @param {Object=} marketplaceParams - Filter results by marketplace
|
|
298
|
-
* @param {integer
|
|
298
|
+
* @param {Array<integer>=} collectionIndexes - If filtering by marketplace, filter by collection(s). The index refers to the index in the array `marketplace.collections`
|
|
299
299
|
*
|
|
300
300
|
* @returns {Promise<Object>} - Results of the query and pagination info
|
|
301
301
|
*/
|
|
@@ -514,11 +514,10 @@ exports.TenantConfiguration = /*#__PURE__*/function () {
|
|
|
514
514
|
case 7:
|
|
515
515
|
_context7.prev = 7;
|
|
516
516
|
_context7.t0 = _context7["catch"](1);
|
|
517
|
-
this.Log("Failed to load tenant configuration", true);
|
|
518
|
-
this.Log(_context7.t0, true);
|
|
517
|
+
this.Log("Failed to load tenant configuration", true, _context7.t0);
|
|
519
518
|
return _context7.abrupt("return", {});
|
|
520
519
|
|
|
521
|
-
case
|
|
520
|
+
case 11:
|
|
522
521
|
case "end":
|
|
523
522
|
return _context7.stop();
|
|
524
523
|
}
|
|
@@ -1072,7 +1071,7 @@ exports.Listing = /*#__PURE__*/function () {
|
|
|
1072
1071
|
* <br /><br />
|
|
1073
1072
|
* NOTE: This string must be an <b>exact match</b> on the item name.
|
|
1074
1073
|
* You can retrieve all available item names from the <a href="#.ListingNames">ListingNames method</a>.
|
|
1075
|
-
* @param {string
|
|
1074
|
+
* @param {Array<string>=} editionFilters - Filter results by item edition.
|
|
1076
1075
|
* <br /><br />
|
|
1077
1076
|
* NOTE: This string must be an <b>exact match</b> on the edition name.
|
|
1078
1077
|
* You can retrieve all available item edition names from the <a href="#.ListingEditionNames">ListingEditionNames method</a>.
|
|
@@ -1080,12 +1079,13 @@ exports.Listing = /*#__PURE__*/function () {
|
|
|
1080
1079
|
* <br /><br />
|
|
1081
1080
|
* NOTE: These filters must be an <b>exact match</b> on the attribute name and value.
|
|
1082
1081
|
* You can retrieve all available item attributes from the <a href="#.ListingAttributes">ListingAttributes method</a>.
|
|
1082
|
+
* @param {Object=} priceRange - Filter min and/or max price (e.g. `{min: 1}` `{max: 2}` `{min: 1.50, max: 10.50})
|
|
1083
1083
|
* @param {string=} sellerAddress - Filter by a specific seller
|
|
1084
1084
|
* @param {string=} contractAddress - Filter results by the address of the NFT contract
|
|
1085
1085
|
* @param {string=} tokenId - Filter by token ID (if filtering by contract address)
|
|
1086
1086
|
* @param {string=} currency - Filter results by purchase currency. Available options: `usdc`
|
|
1087
1087
|
* @param {Object=} marketplaceParams - Filter results by marketplace
|
|
1088
|
-
* @param {integer
|
|
1088
|
+
* @param {Array<integer>=} collectionIndexes - If filtering by marketplace, filter by collection(s). The index refers to the index in the array `marketplace.collections`
|
|
1089
1089
|
* @param {integer=} lastNDays - Filter by results listed in the past N days
|
|
1090
1090
|
*
|
|
1091
1091
|
* @returns {Promise<Object>} - Results of the query and pagination info
|
|
@@ -1122,7 +1122,7 @@ exports.Listings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRunt
|
|
|
1122
1122
|
* <br /><br />
|
|
1123
1123
|
* NOTE: This string must be an <b>exact match</b> on the item name.
|
|
1124
1124
|
* You can retrieve all available item names from the <a href="#.ListingNames">ListingNames method</a>.
|
|
1125
|
-
* @param {string
|
|
1125
|
+
* @param {Array<string>} editionFilters - Filter results by item edition.
|
|
1126
1126
|
* <br /><br />
|
|
1127
1127
|
* NOTE: This string must be an <b>exact match</b> on the edition name.
|
|
1128
1128
|
* You can retrieve all available item edition names from the <a href="#.ListingEditionNames">ListingEditionNames method</a>.
|
|
@@ -1130,12 +1130,13 @@ exports.Listings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRunt
|
|
|
1130
1130
|
* <br /><br />
|
|
1131
1131
|
* NOTE: These filters must be an <b>exact match</b> on the attribute name and value.
|
|
1132
1132
|
* You can retrieve all available item attributes from the <a href="#.ListingAttributes">ListingAttributes method</a>.
|
|
1133
|
+
* @param {Object=} priceRange - Filter min and/or max price (e.g. `{min: 1}` `{max: 2}` `{min: 1.50, max: 10.50})
|
|
1133
1134
|
* @param {string=} sellerAddress - Filter by a specific seller
|
|
1134
1135
|
* @param {string=} contractAddress - Filter results by the address of the NFT contract
|
|
1135
1136
|
* @param {string=} tokenId - Filter by token ID (if filtering by contract address)
|
|
1136
1137
|
* @param {string=} currency - Filter results by purchase currency. Available options: `usdc`
|
|
1137
1138
|
* @param {Object=} marketplaceParams - Filter results by marketplace
|
|
1138
|
-
* @param {integer
|
|
1139
|
+
* @param {Array<integer>=} collectionIndexes - If filtering by marketplace, filter by collection(s). The index refers to the index in the array `marketplace.collections`
|
|
1139
1140
|
* @param {integer=} lastNDays - Filter by results listed in the past N days
|
|
1140
1141
|
*
|
|
1141
1142
|
* @returns {Promise<Object>} - Statistics about listings. All prices in USD.
|
|
@@ -1171,7 +1172,7 @@ exports.ListingStats = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerator
|
|
|
1171
1172
|
* <br /><br />
|
|
1172
1173
|
* NOTE: This string must be an <b>exact match</b> on the item name.
|
|
1173
1174
|
* You can retrieve all available item names from the <a href="#.ListingNames">ListingNames method</a>.
|
|
1174
|
-
* @param {string
|
|
1175
|
+
* @param {Array<string>} editionFilters - Filter results by item edition.
|
|
1175
1176
|
* <br /><br />
|
|
1176
1177
|
* NOTE: This string must be an <b>exact match</b> on the edition name.
|
|
1177
1178
|
* You can retrieve all available item edition names from the <a href="#.ListingEditionNames">ListingEditionNames method</a>.
|
|
@@ -1184,7 +1185,7 @@ exports.ListingStats = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerator
|
|
|
1184
1185
|
* @param {string=} tokenId - Filter by token ID (if filtering by contract address)
|
|
1185
1186
|
* @param {string=} currency - Filter results by purchase currency. Available options: `usdc`
|
|
1186
1187
|
* @param {Object=} marketplaceParams - Filter results by marketplace
|
|
1187
|
-
* @param {integer
|
|
1188
|
+
* @param {Array<integer>=} collectionIndexes - If filtering by marketplace, filter by collection(s). The index refers to the index in the array `marketplace.collections`
|
|
1188
1189
|
* @param {integer=} lastNDays - Filter by results listed in the past N days
|
|
1189
1190
|
*
|
|
1190
1191
|
* @returns {Promise<Object>} - Results of the query and pagination info
|
|
@@ -1220,7 +1221,7 @@ exports.Sales = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
|
|
1220
1221
|
* <br /><br />
|
|
1221
1222
|
* NOTE: This string must be an <b>exact match</b> on the item name.
|
|
1222
1223
|
* You can retrieve all available item names from the <a href="#.ListingNames">ListingNames method</a>.
|
|
1223
|
-
* @param {string
|
|
1224
|
+
* @param {Array<string>} editionFilters - Filter results by item edition.
|
|
1224
1225
|
* <br /><br />
|
|
1225
1226
|
* NOTE: This string must be an <b>exact match</b> on the edition name.
|
|
1226
1227
|
* You can retrieve all available item edition names from the <a href="#.ListingEditionNames">ListingEditionNames method</a>.
|
|
@@ -1233,7 +1234,7 @@ exports.Sales = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
|
|
1233
1234
|
* @param {string=} tokenId - Filter by token ID (if filtering by contract address)
|
|
1234
1235
|
* @param {string=} currency - Filter results by purchase currency. Available options: `usdc`
|
|
1235
1236
|
* @param {Object=} marketplaceParams - Filter results by marketplace
|
|
1236
|
-
* @param {integer
|
|
1237
|
+
* @param {Array<integer>=} collectionIndexes - If filtering by marketplace, filter by collection(s). The index refers to the index in the array `marketplace.collections`
|
|
1237
1238
|
* @param {integer=} lastNDays - Filter by results listed in the past N days
|
|
1238
1239
|
*
|
|
1239
1240
|
* @returns {Promise<Object>} - Results of the query and pagination info
|
|
@@ -1269,7 +1270,7 @@ exports.Transfers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRun
|
|
|
1269
1270
|
* <br /><br />
|
|
1270
1271
|
* NOTE: This string must be an <b>exact match</b> on the item name.
|
|
1271
1272
|
* You can retrieve all available item names from the <a href="#.ListingNames">ListingNames method</a>.
|
|
1272
|
-
* @param {string
|
|
1273
|
+
* @param {Array<string>} editionFilters - Filter results by item edition.
|
|
1273
1274
|
* <br /><br />
|
|
1274
1275
|
* NOTE: This string must be an <b>exact match</b> on the edition name.
|
|
1275
1276
|
* You can retrieve all available item edition names from the <a href="#.ListingEditionNames">ListingEditionNames method</a>.
|
|
@@ -1282,7 +1283,7 @@ exports.Transfers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRun
|
|
|
1282
1283
|
* @param {string=} tokenId - Filter by token ID (if filtering by contract address)
|
|
1283
1284
|
* @param {string=} currency - Filter results by purchase currency. Available options: `usdc`
|
|
1284
1285
|
* @param {Object=} marketplaceParams - Filter results by marketplace
|
|
1285
|
-
* @param {integer
|
|
1286
|
+
* @param {Array<integer>=} collectionIndexes - If filtering by marketplace, filter by collection(s). The index refers to the index in the array `marketplace.collections`
|
|
1286
1287
|
* @param {integer=} lastNDays - Filter by results listed in the past N days
|
|
1287
1288
|
*
|
|
1288
1289
|
* @returns {Promise<Object>} - Statistics about sales. All prices in USD.
|
|
@@ -1636,6 +1637,60 @@ exports.ListingAttributes = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regene
|
|
|
1636
1637
|
}
|
|
1637
1638
|
}, _callee26, this);
|
|
1638
1639
|
}));
|
|
1640
|
+
/* PURCHASE / CLAIM */
|
|
1641
|
+
|
|
1642
|
+
/**
|
|
1643
|
+
* Claim the specified item from the specified marketplace
|
|
1644
|
+
*
|
|
1645
|
+
* Use the <a href="#.ClaimStatus">ClaimStatus</a> method to check minting status after claiming
|
|
1646
|
+
*
|
|
1647
|
+
* @methodGroup Purchase
|
|
1648
|
+
* @namedParams
|
|
1649
|
+
* @param {Object} marketplaceParams - Parameters of the marketplace
|
|
1650
|
+
* @param {string} sku - The SKU of the item to claime
|
|
1651
|
+
*/
|
|
1652
|
+
|
|
1653
|
+
exports.ClaimItem = /*#__PURE__*/function () {
|
|
1654
|
+
var _ref51 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27(_ref50) {
|
|
1655
|
+
var marketplaceParams, sku, marketplaceInfo;
|
|
1656
|
+
return _regeneratorRuntime.wrap(function _callee27$(_context27) {
|
|
1657
|
+
while (1) {
|
|
1658
|
+
switch (_context27.prev = _context27.next) {
|
|
1659
|
+
case 0:
|
|
1660
|
+
marketplaceParams = _ref50.marketplaceParams, sku = _ref50.sku;
|
|
1661
|
+
_context27.next = 3;
|
|
1662
|
+
return this.MarketplaceInfo({
|
|
1663
|
+
marketplaceParams: marketplaceParams
|
|
1664
|
+
});
|
|
1665
|
+
|
|
1666
|
+
case 3:
|
|
1667
|
+
marketplaceInfo = _context27.sent;
|
|
1668
|
+
_context27.next = 6;
|
|
1669
|
+
return this.client.authClient.MakeAuthServiceRequest({
|
|
1670
|
+
method: "POST",
|
|
1671
|
+
path: UrlJoin("as", "wlt", "act", marketplaceInfo.tenant_id),
|
|
1672
|
+
body: {
|
|
1673
|
+
op: "nft-claim",
|
|
1674
|
+
sid: marketplaceInfo.marketplaceId,
|
|
1675
|
+
sku: sku
|
|
1676
|
+
},
|
|
1677
|
+
headers: {
|
|
1678
|
+
Authorization: "Bearer ".concat(this.AuthToken())
|
|
1679
|
+
}
|
|
1680
|
+
});
|
|
1681
|
+
|
|
1682
|
+
case 6:
|
|
1683
|
+
case "end":
|
|
1684
|
+
return _context27.stop();
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
}, _callee27, this);
|
|
1688
|
+
}));
|
|
1689
|
+
|
|
1690
|
+
return function (_x14) {
|
|
1691
|
+
return _ref51.apply(this, arguments);
|
|
1692
|
+
};
|
|
1693
|
+
}();
|
|
1639
1694
|
/* MINTING STATUS */
|
|
1640
1695
|
|
|
1641
1696
|
/**
|
|
@@ -1649,62 +1704,63 @@ exports.ListingAttributes = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regene
|
|
|
1649
1704
|
* @returns {Promise<Object>} - The status of the purchase
|
|
1650
1705
|
*/
|
|
1651
1706
|
|
|
1707
|
+
|
|
1652
1708
|
exports.ListingPurchaseStatus = /*#__PURE__*/function () {
|
|
1653
|
-
var
|
|
1709
|
+
var _ref53 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28(_ref52) {
|
|
1654
1710
|
var listingId, confirmationId, listingStatus, statuses;
|
|
1655
|
-
return _regeneratorRuntime.wrap(function
|
|
1711
|
+
return _regeneratorRuntime.wrap(function _callee28$(_context28) {
|
|
1656
1712
|
while (1) {
|
|
1657
|
-
switch (
|
|
1713
|
+
switch (_context28.prev = _context28.next) {
|
|
1658
1714
|
case 0:
|
|
1659
|
-
listingId =
|
|
1660
|
-
|
|
1661
|
-
|
|
1715
|
+
listingId = _ref52.listingId, confirmationId = _ref52.confirmationId;
|
|
1716
|
+
_context28.prev = 1;
|
|
1717
|
+
_context28.next = 4;
|
|
1662
1718
|
return this.ListingStatus({
|
|
1663
1719
|
listingId: listingId
|
|
1664
1720
|
});
|
|
1665
1721
|
|
|
1666
1722
|
case 4:
|
|
1667
|
-
listingStatus =
|
|
1723
|
+
listingStatus = _context28.sent;
|
|
1668
1724
|
|
|
1669
1725
|
if (listingStatus) {
|
|
1670
|
-
|
|
1726
|
+
_context28.next = 7;
|
|
1671
1727
|
break;
|
|
1672
1728
|
}
|
|
1673
1729
|
|
|
1674
1730
|
throw Error("Unable to find info for listing " + listingId);
|
|
1675
1731
|
|
|
1676
1732
|
case 7:
|
|
1677
|
-
|
|
1733
|
+
_context28.next = 9;
|
|
1678
1734
|
return this.MintingStatus({
|
|
1679
1735
|
tenantId: listingStatus.tenant
|
|
1680
1736
|
});
|
|
1681
1737
|
|
|
1682
1738
|
case 9:
|
|
1683
|
-
statuses =
|
|
1684
|
-
return
|
|
1739
|
+
statuses = _context28.sent;
|
|
1740
|
+
return _context28.abrupt("return", statuses.find(function (status) {
|
|
1685
1741
|
return status.op === "nft-transfer" && status.extra && status.extra[0] === confirmationId;
|
|
1686
1742
|
}) || {
|
|
1687
1743
|
status: "none"
|
|
1688
1744
|
});
|
|
1689
1745
|
|
|
1690
1746
|
case 13:
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
this.Log(
|
|
1694
|
-
return
|
|
1747
|
+
_context28.prev = 13;
|
|
1748
|
+
_context28.t0 = _context28["catch"](1);
|
|
1749
|
+
this.Log(_context28.t0, true);
|
|
1750
|
+
return _context28.abrupt("return", {
|
|
1695
1751
|
status: "unknown"
|
|
1696
1752
|
});
|
|
1697
1753
|
|
|
1698
1754
|
case 17:
|
|
1699
1755
|
case "end":
|
|
1700
|
-
return
|
|
1756
|
+
return _context28.stop();
|
|
1701
1757
|
}
|
|
1702
1758
|
}
|
|
1703
|
-
},
|
|
1759
|
+
}, _callee28, this, [[1, 13]]);
|
|
1704
1760
|
}));
|
|
1705
1761
|
|
|
1706
|
-
return function (
|
|
1707
|
-
return
|
|
1762
|
+
return function (_x15) {
|
|
1763
|
+
return _ref53.apply(this, arguments);
|
|
1708
1764
|
};
|
|
1709
1765
|
}();
|
|
1710
1766
|
/**
|
|
@@ -1720,52 +1776,52 @@ exports.ListingPurchaseStatus = /*#__PURE__*/function () {
|
|
|
1720
1776
|
|
|
1721
1777
|
|
|
1722
1778
|
exports.PurchaseStatus = /*#__PURE__*/function () {
|
|
1723
|
-
var
|
|
1779
|
+
var _ref55 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29(_ref54) {
|
|
1724
1780
|
var marketplaceParams, confirmationId, marketplaceInfo, statuses;
|
|
1725
|
-
return _regeneratorRuntime.wrap(function
|
|
1781
|
+
return _regeneratorRuntime.wrap(function _callee29$(_context29) {
|
|
1726
1782
|
while (1) {
|
|
1727
|
-
switch (
|
|
1783
|
+
switch (_context29.prev = _context29.next) {
|
|
1728
1784
|
case 0:
|
|
1729
|
-
marketplaceParams =
|
|
1730
|
-
|
|
1731
|
-
|
|
1785
|
+
marketplaceParams = _ref54.marketplaceParams, confirmationId = _ref54.confirmationId;
|
|
1786
|
+
_context29.prev = 1;
|
|
1787
|
+
_context29.next = 4;
|
|
1732
1788
|
return this.MarketplaceInfo({
|
|
1733
1789
|
marketplaceParams: marketplaceParams
|
|
1734
1790
|
});
|
|
1735
1791
|
|
|
1736
1792
|
case 4:
|
|
1737
|
-
marketplaceInfo =
|
|
1738
|
-
|
|
1793
|
+
marketplaceInfo = _context29.sent;
|
|
1794
|
+
_context29.next = 7;
|
|
1739
1795
|
return this.MintingStatus({
|
|
1740
1796
|
tenantId: marketplaceInfo.tenant_id
|
|
1741
1797
|
});
|
|
1742
1798
|
|
|
1743
1799
|
case 7:
|
|
1744
|
-
statuses =
|
|
1745
|
-
return
|
|
1800
|
+
statuses = _context29.sent;
|
|
1801
|
+
return _context29.abrupt("return", statuses.find(function (status) {
|
|
1746
1802
|
return status.op === "nft-buy" && status.confirmationId === confirmationId;
|
|
1747
1803
|
}) || {
|
|
1748
1804
|
status: "none"
|
|
1749
1805
|
});
|
|
1750
1806
|
|
|
1751
1807
|
case 11:
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
this.Log(
|
|
1755
|
-
return
|
|
1808
|
+
_context29.prev = 11;
|
|
1809
|
+
_context29.t0 = _context29["catch"](1);
|
|
1810
|
+
this.Log(_context29.t0, true);
|
|
1811
|
+
return _context29.abrupt("return", {
|
|
1756
1812
|
status: "unknown"
|
|
1757
1813
|
});
|
|
1758
1814
|
|
|
1759
1815
|
case 15:
|
|
1760
1816
|
case "end":
|
|
1761
|
-
return
|
|
1817
|
+
return _context29.stop();
|
|
1762
1818
|
}
|
|
1763
1819
|
}
|
|
1764
|
-
},
|
|
1820
|
+
}, _callee29, this, [[1, 11]]);
|
|
1765
1821
|
}));
|
|
1766
1822
|
|
|
1767
|
-
return function (
|
|
1768
|
-
return
|
|
1823
|
+
return function (_x16) {
|
|
1824
|
+
return _ref55.apply(this, arguments);
|
|
1769
1825
|
};
|
|
1770
1826
|
}();
|
|
1771
1827
|
/**
|
|
@@ -1781,52 +1837,52 @@ exports.PurchaseStatus = /*#__PURE__*/function () {
|
|
|
1781
1837
|
|
|
1782
1838
|
|
|
1783
1839
|
exports.ClaimStatus = /*#__PURE__*/function () {
|
|
1784
|
-
var
|
|
1840
|
+
var _ref57 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30(_ref56) {
|
|
1785
1841
|
var marketplaceParams, sku, marketplaceInfo, statuses;
|
|
1786
|
-
return _regeneratorRuntime.wrap(function
|
|
1842
|
+
return _regeneratorRuntime.wrap(function _callee30$(_context30) {
|
|
1787
1843
|
while (1) {
|
|
1788
|
-
switch (
|
|
1844
|
+
switch (_context30.prev = _context30.next) {
|
|
1789
1845
|
case 0:
|
|
1790
|
-
marketplaceParams =
|
|
1791
|
-
|
|
1792
|
-
|
|
1846
|
+
marketplaceParams = _ref56.marketplaceParams, sku = _ref56.sku;
|
|
1847
|
+
_context30.prev = 1;
|
|
1848
|
+
_context30.next = 4;
|
|
1793
1849
|
return this.MarketplaceInfo({
|
|
1794
1850
|
marketplaceParams: marketplaceParams
|
|
1795
1851
|
});
|
|
1796
1852
|
|
|
1797
1853
|
case 4:
|
|
1798
|
-
marketplaceInfo =
|
|
1799
|
-
|
|
1854
|
+
marketplaceInfo = _context30.sent;
|
|
1855
|
+
_context30.next = 7;
|
|
1800
1856
|
return this.MintingStatus({
|
|
1801
1857
|
tenantId: marketplaceInfo.tenantId
|
|
1802
1858
|
});
|
|
1803
1859
|
|
|
1804
1860
|
case 7:
|
|
1805
|
-
statuses =
|
|
1806
|
-
return
|
|
1861
|
+
statuses = _context30.sent;
|
|
1862
|
+
return _context30.abrupt("return", statuses.find(function (status) {
|
|
1807
1863
|
return status.op === "nft-claim" && status.marketplaceId === marketplaceInfo.marketplaceId && status.confirmationId === sku;
|
|
1808
1864
|
}) || {
|
|
1809
1865
|
status: "none"
|
|
1810
1866
|
});
|
|
1811
1867
|
|
|
1812
1868
|
case 11:
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
this.Log(
|
|
1816
|
-
return
|
|
1869
|
+
_context30.prev = 11;
|
|
1870
|
+
_context30.t0 = _context30["catch"](1);
|
|
1871
|
+
this.Log(_context30.t0, true);
|
|
1872
|
+
return _context30.abrupt("return", {
|
|
1817
1873
|
status: "unknown"
|
|
1818
1874
|
});
|
|
1819
1875
|
|
|
1820
1876
|
case 15:
|
|
1821
1877
|
case "end":
|
|
1822
|
-
return
|
|
1878
|
+
return _context30.stop();
|
|
1823
1879
|
}
|
|
1824
1880
|
}
|
|
1825
|
-
},
|
|
1881
|
+
}, _callee30, this, [[1, 11]]);
|
|
1826
1882
|
}));
|
|
1827
1883
|
|
|
1828
|
-
return function (
|
|
1829
|
-
return
|
|
1884
|
+
return function (_x17) {
|
|
1885
|
+
return _ref57.apply(this, arguments);
|
|
1830
1886
|
};
|
|
1831
1887
|
}();
|
|
1832
1888
|
/**
|
|
@@ -1842,52 +1898,52 @@ exports.ClaimStatus = /*#__PURE__*/function () {
|
|
|
1842
1898
|
|
|
1843
1899
|
|
|
1844
1900
|
exports.PackOpenStatus = /*#__PURE__*/function () {
|
|
1845
|
-
var
|
|
1901
|
+
var _ref59 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31(_ref58) {
|
|
1846
1902
|
var contractAddress, tokenId, tenantConfig, statuses;
|
|
1847
|
-
return _regeneratorRuntime.wrap(function
|
|
1903
|
+
return _regeneratorRuntime.wrap(function _callee31$(_context31) {
|
|
1848
1904
|
while (1) {
|
|
1849
|
-
switch (
|
|
1905
|
+
switch (_context31.prev = _context31.next) {
|
|
1850
1906
|
case 0:
|
|
1851
|
-
contractAddress =
|
|
1852
|
-
|
|
1853
|
-
|
|
1907
|
+
contractAddress = _ref58.contractAddress, tokenId = _ref58.tokenId;
|
|
1908
|
+
_context31.prev = 1;
|
|
1909
|
+
_context31.next = 4;
|
|
1854
1910
|
return this.TenantConfiguration({
|
|
1855
1911
|
contractAddress: contractAddress
|
|
1856
1912
|
});
|
|
1857
1913
|
|
|
1858
1914
|
case 4:
|
|
1859
|
-
tenantConfig =
|
|
1860
|
-
|
|
1915
|
+
tenantConfig = _context31.sent;
|
|
1916
|
+
_context31.next = 7;
|
|
1861
1917
|
return this.MintingStatus({
|
|
1862
1918
|
tenantId: tenantConfig.tenant
|
|
1863
1919
|
});
|
|
1864
1920
|
|
|
1865
1921
|
case 7:
|
|
1866
|
-
statuses =
|
|
1867
|
-
return
|
|
1922
|
+
statuses = _context31.sent;
|
|
1923
|
+
return _context31.abrupt("return", statuses.find(function (status) {
|
|
1868
1924
|
return status.op === "nft-open" && Utils.EqualAddress(contractAddress, status.address) && status.tokenId === tokenId;
|
|
1869
1925
|
}) || {
|
|
1870
1926
|
status: "none"
|
|
1871
1927
|
});
|
|
1872
1928
|
|
|
1873
1929
|
case 11:
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
this.Log(
|
|
1877
|
-
return
|
|
1930
|
+
_context31.prev = 11;
|
|
1931
|
+
_context31.t0 = _context31["catch"](1);
|
|
1932
|
+
this.Log(_context31.t0, true);
|
|
1933
|
+
return _context31.abrupt("return", {
|
|
1878
1934
|
status: "unknown"
|
|
1879
1935
|
});
|
|
1880
1936
|
|
|
1881
1937
|
case 15:
|
|
1882
1938
|
case "end":
|
|
1883
|
-
return
|
|
1939
|
+
return _context31.stop();
|
|
1884
1940
|
}
|
|
1885
1941
|
}
|
|
1886
|
-
},
|
|
1942
|
+
}, _callee31, this, [[1, 11]]);
|
|
1887
1943
|
}));
|
|
1888
1944
|
|
|
1889
|
-
return function (
|
|
1890
|
-
return
|
|
1945
|
+
return function (_x18) {
|
|
1946
|
+
return _ref59.apply(this, arguments);
|
|
1891
1947
|
};
|
|
1892
1948
|
}();
|
|
1893
1949
|
/**
|
|
@@ -1903,60 +1959,60 @@ exports.PackOpenStatus = /*#__PURE__*/function () {
|
|
|
1903
1959
|
|
|
1904
1960
|
|
|
1905
1961
|
exports.CollectionRedemptionStatus = /*#__PURE__*/function () {
|
|
1906
|
-
var
|
|
1962
|
+
var _ref61 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32(_ref60) {
|
|
1907
1963
|
var marketplaceParams, confirmationId, statuses;
|
|
1908
|
-
return _regeneratorRuntime.wrap(function
|
|
1964
|
+
return _regeneratorRuntime.wrap(function _callee32$(_context32) {
|
|
1909
1965
|
while (1) {
|
|
1910
|
-
switch (
|
|
1966
|
+
switch (_context32.prev = _context32.next) {
|
|
1911
1967
|
case 0:
|
|
1912
|
-
marketplaceParams =
|
|
1913
|
-
|
|
1914
|
-
|
|
1968
|
+
marketplaceParams = _ref60.marketplaceParams, confirmationId = _ref60.confirmationId;
|
|
1969
|
+
_context32.prev = 1;
|
|
1970
|
+
_context32.next = 4;
|
|
1915
1971
|
return this.MintingStatus({
|
|
1916
1972
|
marketplaceParams: marketplaceParams
|
|
1917
1973
|
});
|
|
1918
1974
|
|
|
1919
1975
|
case 4:
|
|
1920
|
-
statuses =
|
|
1921
|
-
return
|
|
1976
|
+
statuses = _context32.sent;
|
|
1977
|
+
return _context32.abrupt("return", statuses.find(function (status) {
|
|
1922
1978
|
return status.op === "nft-redeem" && status.confirmationId === confirmationId;
|
|
1923
1979
|
}) || {
|
|
1924
1980
|
status: "none"
|
|
1925
1981
|
});
|
|
1926
1982
|
|
|
1927
1983
|
case 8:
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
this.Log(
|
|
1931
|
-
return
|
|
1984
|
+
_context32.prev = 8;
|
|
1985
|
+
_context32.t0 = _context32["catch"](1);
|
|
1986
|
+
this.Log(_context32.t0, true);
|
|
1987
|
+
return _context32.abrupt("return", {
|
|
1932
1988
|
status: "unknown"
|
|
1933
1989
|
});
|
|
1934
1990
|
|
|
1935
1991
|
case 12:
|
|
1936
1992
|
case "end":
|
|
1937
|
-
return
|
|
1993
|
+
return _context32.stop();
|
|
1938
1994
|
}
|
|
1939
1995
|
}
|
|
1940
|
-
},
|
|
1996
|
+
}, _callee32, this, [[1, 8]]);
|
|
1941
1997
|
}));
|
|
1942
1998
|
|
|
1943
|
-
return function (
|
|
1944
|
-
return
|
|
1999
|
+
return function (_x19) {
|
|
2000
|
+
return _ref61.apply(this, arguments);
|
|
1945
2001
|
};
|
|
1946
2002
|
}();
|
|
1947
2003
|
/* EVENTS */
|
|
1948
2004
|
|
|
1949
2005
|
|
|
1950
2006
|
exports.LoadDrop = /*#__PURE__*/function () {
|
|
1951
|
-
var
|
|
2007
|
+
var _ref63 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33(_ref62) {
|
|
1952
2008
|
var _this2 = this;
|
|
1953
2009
|
|
|
1954
2010
|
var tenantSlug, eventSlug, dropId, mainSiteHash, event, eventId;
|
|
1955
|
-
return _regeneratorRuntime.wrap(function
|
|
2011
|
+
return _regeneratorRuntime.wrap(function _callee33$(_context33) {
|
|
1956
2012
|
while (1) {
|
|
1957
|
-
switch (
|
|
2013
|
+
switch (_context33.prev = _context33.next) {
|
|
1958
2014
|
case 0:
|
|
1959
|
-
tenantSlug =
|
|
2015
|
+
tenantSlug = _ref62.tenantSlug, eventSlug = _ref62.eventSlug, dropId = _ref62.dropId;
|
|
1960
2016
|
|
|
1961
2017
|
if (!this.drops) {
|
|
1962
2018
|
this.drops = {};
|
|
@@ -1971,18 +2027,18 @@ exports.LoadDrop = /*#__PURE__*/function () {
|
|
|
1971
2027
|
}
|
|
1972
2028
|
|
|
1973
2029
|
if (this.drops[tenantSlug][eventSlug][dropId]) {
|
|
1974
|
-
|
|
2030
|
+
_context33.next = 16;
|
|
1975
2031
|
break;
|
|
1976
2032
|
}
|
|
1977
2033
|
|
|
1978
|
-
|
|
2034
|
+
_context33.next = 7;
|
|
1979
2035
|
return this.client.LatestVersionHash({
|
|
1980
2036
|
objectId: this.mainSiteId
|
|
1981
2037
|
});
|
|
1982
2038
|
|
|
1983
2039
|
case 7:
|
|
1984
|
-
mainSiteHash =
|
|
1985
|
-
|
|
2040
|
+
mainSiteHash = _context33.sent;
|
|
2041
|
+
_context33.next = 10;
|
|
1986
2042
|
return this.client.ContentObjectMetadata({
|
|
1987
2043
|
versionHash: mainSiteHash,
|
|
1988
2044
|
metadataSubtree: UrlJoin("public", "asset_metadata", "tenants", tenantSlug, "sites", eventSlug, "info"),
|
|
@@ -1995,17 +2051,17 @@ exports.LoadDrop = /*#__PURE__*/function () {
|
|
|
1995
2051
|
});
|
|
1996
2052
|
|
|
1997
2053
|
case 10:
|
|
1998
|
-
|
|
2054
|
+
_context33.t0 = _context33.sent;
|
|
1999
2055
|
|
|
2000
|
-
if (
|
|
2001
|
-
|
|
2056
|
+
if (_context33.t0) {
|
|
2057
|
+
_context33.next = 13;
|
|
2002
2058
|
break;
|
|
2003
2059
|
}
|
|
2004
2060
|
|
|
2005
|
-
|
|
2061
|
+
_context33.t0 = [];
|
|
2006
2062
|
|
|
2007
2063
|
case 13:
|
|
2008
|
-
event =
|
|
2064
|
+
event = _context33.t0;
|
|
2009
2065
|
eventId = Utils.DecodeVersionHash(event["."].source).objectId;
|
|
2010
2066
|
event.drops.forEach(function (drop) {
|
|
2011
2067
|
drop = _objectSpread(_objectSpread({}, drop), {}, {
|
|
@@ -2016,37 +2072,37 @@ exports.LoadDrop = /*#__PURE__*/function () {
|
|
|
2016
2072
|
});
|
|
2017
2073
|
|
|
2018
2074
|
case 16:
|
|
2019
|
-
return
|
|
2075
|
+
return _context33.abrupt("return", this.drops[dropId]);
|
|
2020
2076
|
|
|
2021
2077
|
case 17:
|
|
2022
2078
|
case "end":
|
|
2023
|
-
return
|
|
2079
|
+
return _context33.stop();
|
|
2024
2080
|
}
|
|
2025
2081
|
}
|
|
2026
|
-
},
|
|
2082
|
+
}, _callee33, this);
|
|
2027
2083
|
}));
|
|
2028
2084
|
|
|
2029
|
-
return function (
|
|
2030
|
-
return
|
|
2085
|
+
return function (_x20) {
|
|
2086
|
+
return _ref63.apply(this, arguments);
|
|
2031
2087
|
};
|
|
2032
2088
|
}();
|
|
2033
2089
|
|
|
2034
2090
|
exports.SubmitDropVote = /*#__PURE__*/function () {
|
|
2035
|
-
var
|
|
2091
|
+
var _ref65 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34(_ref64) {
|
|
2036
2092
|
var marketplaceParams, eventId, dropId, sku, marketplaceInfo;
|
|
2037
|
-
return _regeneratorRuntime.wrap(function
|
|
2093
|
+
return _regeneratorRuntime.wrap(function _callee34$(_context34) {
|
|
2038
2094
|
while (1) {
|
|
2039
|
-
switch (
|
|
2095
|
+
switch (_context34.prev = _context34.next) {
|
|
2040
2096
|
case 0:
|
|
2041
|
-
marketplaceParams =
|
|
2042
|
-
|
|
2097
|
+
marketplaceParams = _ref64.marketplaceParams, eventId = _ref64.eventId, dropId = _ref64.dropId, sku = _ref64.sku;
|
|
2098
|
+
_context34.next = 3;
|
|
2043
2099
|
return this.MarketplaceInfo({
|
|
2044
2100
|
marketplaceParams: marketplaceParams
|
|
2045
2101
|
});
|
|
2046
2102
|
|
|
2047
2103
|
case 3:
|
|
2048
|
-
marketplaceInfo =
|
|
2049
|
-
|
|
2104
|
+
marketplaceInfo = _context34.sent;
|
|
2105
|
+
_context34.next = 6;
|
|
2050
2106
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
2051
2107
|
path: UrlJoin("as", "wlt", "act", marketplaceInfo.tenant_id),
|
|
2052
2108
|
method: "POST",
|
|
@@ -2063,27 +2119,27 @@ exports.SubmitDropVote = /*#__PURE__*/function () {
|
|
|
2063
2119
|
|
|
2064
2120
|
case 6:
|
|
2065
2121
|
case "end":
|
|
2066
|
-
return
|
|
2122
|
+
return _context34.stop();
|
|
2067
2123
|
}
|
|
2068
2124
|
}
|
|
2069
|
-
},
|
|
2125
|
+
}, _callee34, this);
|
|
2070
2126
|
}));
|
|
2071
2127
|
|
|
2072
|
-
return function (
|
|
2073
|
-
return
|
|
2128
|
+
return function (_x21) {
|
|
2129
|
+
return _ref65.apply(this, arguments);
|
|
2074
2130
|
};
|
|
2075
2131
|
}();
|
|
2076
2132
|
|
|
2077
2133
|
exports.DropStatus = /*#__PURE__*/function () {
|
|
2078
|
-
var
|
|
2134
|
+
var _ref67 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35(_ref66) {
|
|
2079
2135
|
var marketplace, eventId, dropId, response;
|
|
2080
|
-
return _regeneratorRuntime.wrap(function
|
|
2136
|
+
return _regeneratorRuntime.wrap(function _callee35$(_context35) {
|
|
2081
2137
|
while (1) {
|
|
2082
|
-
switch (
|
|
2138
|
+
switch (_context35.prev = _context35.next) {
|
|
2083
2139
|
case 0:
|
|
2084
|
-
marketplace =
|
|
2085
|
-
|
|
2086
|
-
|
|
2140
|
+
marketplace = _ref66.marketplace, eventId = _ref66.eventId, dropId = _ref66.dropId;
|
|
2141
|
+
_context35.prev = 1;
|
|
2142
|
+
_context35.next = 4;
|
|
2087
2143
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
2088
2144
|
path: UrlJoin("as", "wlt", "act", marketplace.tenant_id, eventId, dropId),
|
|
2089
2145
|
method: "GET",
|
|
@@ -2093,28 +2149,28 @@ exports.DropStatus = /*#__PURE__*/function () {
|
|
|
2093
2149
|
}));
|
|
2094
2150
|
|
|
2095
2151
|
case 4:
|
|
2096
|
-
response =
|
|
2097
|
-
return
|
|
2152
|
+
response = _context35.sent;
|
|
2153
|
+
return _context35.abrupt("return", response.sort(function (a, b) {
|
|
2098
2154
|
return a.ts > b.ts ? 1 : -1;
|
|
2099
2155
|
})[0] || {
|
|
2100
2156
|
status: "none"
|
|
2101
2157
|
});
|
|
2102
2158
|
|
|
2103
2159
|
case 8:
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
this.Log(
|
|
2107
|
-
return
|
|
2160
|
+
_context35.prev = 8;
|
|
2161
|
+
_context35.t0 = _context35["catch"](1);
|
|
2162
|
+
this.Log(_context35.t0, true);
|
|
2163
|
+
return _context35.abrupt("return", "");
|
|
2108
2164
|
|
|
2109
2165
|
case 12:
|
|
2110
2166
|
case "end":
|
|
2111
|
-
return
|
|
2167
|
+
return _context35.stop();
|
|
2112
2168
|
}
|
|
2113
2169
|
}
|
|
2114
|
-
},
|
|
2170
|
+
}, _callee35, this, [[1, 8]]);
|
|
2115
2171
|
}));
|
|
2116
2172
|
|
|
2117
|
-
return function (
|
|
2118
|
-
return
|
|
2173
|
+
return function (_x22) {
|
|
2174
|
+
return _ref67.apply(this, arguments);
|
|
2119
2175
|
};
|
|
2120
2176
|
}();
|