@eluvio/elv-client-js 4.0.76 → 4.0.78
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/ElvClient-min.js +18 -10
- package/dist/ElvClient-node-min.js +18 -10
- package/dist/ElvFrameClient-min.js +9 -9
- package/dist/ElvPermissionsClient-min.js +10 -10
- package/dist/ElvWalletClient-min.js +18 -10
- package/dist/ElvWalletClient-node-min.js +18 -10
- package/dist/src/AuthorizationClient.js +18 -12
- package/dist/src/Crypto.js +2 -2
- package/dist/src/ElvClient.js +111 -76
- package/dist/src/EthClient.js +2 -2
- package/dist/src/FrameClient.js +4 -4
- package/dist/src/PermissionsClient.js +2 -2
- package/dist/src/Utils.js +6 -5
- package/dist/src/abr_profiles/abr_profile_live_drm.js +1621 -0
- package/dist/src/abr_profiles/abr_profile_live_to_vod.js +1599 -0
- package/dist/src/client/ABRPublishing.js +2 -2
- package/dist/src/client/AccessGroups.js +19 -20
- package/dist/src/client/ContentAccess.js +48 -28
- package/dist/src/client/ContentManagement.js +3 -3
- package/dist/src/client/Contracts.js +235 -203
- package/dist/src/client/Files.js +2 -2
- package/dist/src/client/LiveConf.js +152 -21
- package/dist/src/client/LiveStream.js +1376 -1248
- package/dist/src/client/NFT.js +2 -2
- package/dist/src/contracts/v3b/BaseAccessControlGroup.js +1704 -0
- package/dist/src/walletClient/ClientMethods.js +423 -280
- package/dist/src/walletClient/Profile.js +2 -2
- package/dist/src/walletClient/Utils.js +7 -3
- package/dist/src/walletClient/index.js +124 -44
- package/package.json +2 -1
- package/src/FrameClient.js +4 -0
- package/src/abr_profiles/abr_profile_live_drm.js +1907 -0
- package/src/abr_profiles/abr_profile_live_to_vod.js +1885 -0
- package/src/client/ContentAccess.js +21 -0
- package/src/client/LiveConf.js +133 -17
- package/src/client/LiveStream.js +907 -947
- package/testScripts/Test.js +7 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var _defineProperty = require("@babel/runtime/helpers/defineProperty");
|
|
2
2
|
var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
3
3
|
var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
4
|
-
function ownKeys(
|
|
5
|
-
function _objectSpread(
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
6
|
var Utils = require("../Utils");
|
|
7
7
|
var UrlJoin = require("url-join");
|
|
8
8
|
var _require = require("./Utils"),
|
|
@@ -1851,6 +1851,48 @@ exports.ListingAttributes = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regene
|
|
|
1851
1851
|
|
|
1852
1852
|
/* PURCHASE / CLAIM */
|
|
1853
1853
|
|
|
1854
|
+
/**
|
|
1855
|
+
* Claim the specified gift code
|
|
1856
|
+
*
|
|
1857
|
+
* Use the <a href="#.GiftClaimStatus">GiftClaimStatus</a> method to check minting status after claiming
|
|
1858
|
+
*
|
|
1859
|
+
* @methodGroup Purchase
|
|
1860
|
+
* @namedParams
|
|
1861
|
+
* @param {string} code - The OTP gift code to claim
|
|
1862
|
+
*
|
|
1863
|
+
* @returns {Promise<Object>} - Information about the claim, including the tenant associated with the item, the gift ID and the status op key
|
|
1864
|
+
*/
|
|
1865
|
+
exports.ClaimGift = /*#__PURE__*/function () {
|
|
1866
|
+
var _ref66 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33(_ref65) {
|
|
1867
|
+
var code;
|
|
1868
|
+
return _regeneratorRuntime.wrap(function _callee33$(_context33) {
|
|
1869
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
1870
|
+
case 0:
|
|
1871
|
+
code = _ref65.code;
|
|
1872
|
+
_context33.next = 3;
|
|
1873
|
+
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
1874
|
+
method: "POST",
|
|
1875
|
+
path: UrlJoin("as", "wlt", "gifts", "claim"),
|
|
1876
|
+
body: {
|
|
1877
|
+
otp_code: code
|
|
1878
|
+
},
|
|
1879
|
+
headers: {
|
|
1880
|
+
Authorization: "Bearer ".concat(this.AuthToken())
|
|
1881
|
+
}
|
|
1882
|
+
}));
|
|
1883
|
+
case 3:
|
|
1884
|
+
return _context33.abrupt("return", _context33.sent);
|
|
1885
|
+
case 4:
|
|
1886
|
+
case "end":
|
|
1887
|
+
return _context33.stop();
|
|
1888
|
+
}
|
|
1889
|
+
}, _callee33, this);
|
|
1890
|
+
}));
|
|
1891
|
+
return function (_x19) {
|
|
1892
|
+
return _ref66.apply(this, arguments);
|
|
1893
|
+
};
|
|
1894
|
+
}();
|
|
1895
|
+
|
|
1854
1896
|
/**
|
|
1855
1897
|
* Claim the specified item from the specified marketplace
|
|
1856
1898
|
*
|
|
@@ -1863,19 +1905,19 @@ exports.ListingAttributes = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regene
|
|
|
1863
1905
|
* @param {string=} email - Email address of the user. If specified, this will bind the user to the tenant of the specified marketplace
|
|
1864
1906
|
*/
|
|
1865
1907
|
exports.ClaimItem = /*#__PURE__*/function () {
|
|
1866
|
-
var
|
|
1908
|
+
var _ref68 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34(_ref67) {
|
|
1867
1909
|
var marketplaceParams, sku, email, marketplaceInfo;
|
|
1868
|
-
return _regeneratorRuntime.wrap(function
|
|
1869
|
-
while (1) switch (
|
|
1910
|
+
return _regeneratorRuntime.wrap(function _callee34$(_context34) {
|
|
1911
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
1870
1912
|
case 0:
|
|
1871
|
-
marketplaceParams =
|
|
1872
|
-
|
|
1913
|
+
marketplaceParams = _ref67.marketplaceParams, sku = _ref67.sku, email = _ref67.email;
|
|
1914
|
+
_context34.next = 3;
|
|
1873
1915
|
return this.MarketplaceInfo({
|
|
1874
1916
|
marketplaceParams: marketplaceParams
|
|
1875
1917
|
});
|
|
1876
1918
|
case 3:
|
|
1877
|
-
marketplaceInfo =
|
|
1878
|
-
|
|
1919
|
+
marketplaceInfo = _context34.sent;
|
|
1920
|
+
_context34.next = 6;
|
|
1879
1921
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1880
1922
|
method: "POST",
|
|
1881
1923
|
path: UrlJoin("as", "wlt", "act", marketplaceInfo.tenant_id),
|
|
@@ -1891,12 +1933,12 @@ exports.ClaimItem = /*#__PURE__*/function () {
|
|
|
1891
1933
|
});
|
|
1892
1934
|
case 6:
|
|
1893
1935
|
case "end":
|
|
1894
|
-
return
|
|
1936
|
+
return _context34.stop();
|
|
1895
1937
|
}
|
|
1896
|
-
},
|
|
1938
|
+
}, _callee34, this);
|
|
1897
1939
|
}));
|
|
1898
|
-
return function (
|
|
1899
|
-
return
|
|
1940
|
+
return function (_x20) {
|
|
1941
|
+
return _ref68.apply(this, arguments);
|
|
1900
1942
|
};
|
|
1901
1943
|
}();
|
|
1902
1944
|
|
|
@@ -1914,18 +1956,18 @@ exports.ClaimItem = /*#__PURE__*/function () {
|
|
|
1914
1956
|
* @param {string} cancelUrl - The URL to redirect back to upon cancellation of purchase
|
|
1915
1957
|
*/
|
|
1916
1958
|
exports.PurchaseItem = /*#__PURE__*/function () {
|
|
1917
|
-
var
|
|
1959
|
+
var _ref70 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35(_ref69) {
|
|
1918
1960
|
var marketplaceParams, sku, confirmationId, successUrl, cancelUrl, marketplaceInfo;
|
|
1919
|
-
return _regeneratorRuntime.wrap(function
|
|
1920
|
-
while (1) switch (
|
|
1961
|
+
return _regeneratorRuntime.wrap(function _callee35$(_context35) {
|
|
1962
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
1921
1963
|
case 0:
|
|
1922
|
-
marketplaceParams =
|
|
1923
|
-
|
|
1964
|
+
marketplaceParams = _ref69.marketplaceParams, sku = _ref69.sku, confirmationId = _ref69.confirmationId, successUrl = _ref69.successUrl, cancelUrl = _ref69.cancelUrl;
|
|
1965
|
+
_context35.next = 3;
|
|
1924
1966
|
return this.MarketplaceInfo({
|
|
1925
1967
|
marketplaceParams: marketplaceParams
|
|
1926
1968
|
});
|
|
1927
1969
|
case 3:
|
|
1928
|
-
marketplaceInfo =
|
|
1970
|
+
marketplaceInfo = _context35.sent;
|
|
1929
1971
|
window.location.href = this.FlowURL({
|
|
1930
1972
|
type: "action",
|
|
1931
1973
|
flow: "purchase",
|
|
@@ -1941,12 +1983,12 @@ exports.PurchaseItem = /*#__PURE__*/function () {
|
|
|
1941
1983
|
});
|
|
1942
1984
|
case 5:
|
|
1943
1985
|
case "end":
|
|
1944
|
-
return
|
|
1986
|
+
return _context35.stop();
|
|
1945
1987
|
}
|
|
1946
|
-
},
|
|
1988
|
+
}, _callee35, this);
|
|
1947
1989
|
}));
|
|
1948
|
-
return function (
|
|
1949
|
-
return
|
|
1990
|
+
return function (_x21) {
|
|
1991
|
+
return _ref70.apply(this, arguments);
|
|
1950
1992
|
};
|
|
1951
1993
|
}();
|
|
1952
1994
|
|
|
@@ -1964,22 +2006,22 @@ exports.PurchaseItem = /*#__PURE__*/function () {
|
|
|
1964
2006
|
* @param {string} cancelUrl - The URL to redirect back to upon cancellation of purchase
|
|
1965
2007
|
*/
|
|
1966
2008
|
exports.PurchaseListing = /*#__PURE__*/function () {
|
|
1967
|
-
var
|
|
2009
|
+
var _ref72 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36(_ref71) {
|
|
1968
2010
|
var marketplaceParams, listingId, confirmationId, successUrl, cancelUrl, marketplaceInfo;
|
|
1969
|
-
return _regeneratorRuntime.wrap(function
|
|
1970
|
-
while (1) switch (
|
|
2011
|
+
return _regeneratorRuntime.wrap(function _callee36$(_context36) {
|
|
2012
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
1971
2013
|
case 0:
|
|
1972
|
-
marketplaceParams =
|
|
2014
|
+
marketplaceParams = _ref71.marketplaceParams, listingId = _ref71.listingId, confirmationId = _ref71.confirmationId, successUrl = _ref71.successUrl, cancelUrl = _ref71.cancelUrl;
|
|
1973
2015
|
if (!marketplaceParams) {
|
|
1974
|
-
|
|
2016
|
+
_context36.next = 5;
|
|
1975
2017
|
break;
|
|
1976
2018
|
}
|
|
1977
|
-
|
|
2019
|
+
_context36.next = 4;
|
|
1978
2020
|
return this.MarketplaceInfo({
|
|
1979
2021
|
marketplaceParams: marketplaceParams
|
|
1980
2022
|
});
|
|
1981
2023
|
case 4:
|
|
1982
|
-
marketplaceInfo =
|
|
2024
|
+
marketplaceInfo = _context36.sent;
|
|
1983
2025
|
case 5:
|
|
1984
2026
|
window.location.href = this.FlowURL({
|
|
1985
2027
|
type: "action",
|
|
@@ -1996,12 +2038,12 @@ exports.PurchaseListing = /*#__PURE__*/function () {
|
|
|
1996
2038
|
});
|
|
1997
2039
|
case 6:
|
|
1998
2040
|
case "end":
|
|
1999
|
-
return
|
|
2041
|
+
return _context36.stop();
|
|
2000
2042
|
}
|
|
2001
|
-
},
|
|
2043
|
+
}, _callee36, this);
|
|
2002
2044
|
}));
|
|
2003
|
-
return function (
|
|
2004
|
-
return
|
|
2045
|
+
return function (_x22) {
|
|
2046
|
+
return _ref72.apply(this, arguments);
|
|
2005
2047
|
};
|
|
2006
2048
|
}();
|
|
2007
2049
|
|
|
@@ -2018,51 +2060,51 @@ exports.PurchaseListing = /*#__PURE__*/function () {
|
|
|
2018
2060
|
* @returns {Promise<Object>} - The status of the purchase
|
|
2019
2061
|
*/
|
|
2020
2062
|
exports.ListingPurchaseStatus = /*#__PURE__*/function () {
|
|
2021
|
-
var
|
|
2063
|
+
var _ref74 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee37(_ref73) {
|
|
2022
2064
|
var listingId, confirmationId, listingStatus, statuses;
|
|
2023
|
-
return _regeneratorRuntime.wrap(function
|
|
2024
|
-
while (1) switch (
|
|
2065
|
+
return _regeneratorRuntime.wrap(function _callee37$(_context37) {
|
|
2066
|
+
while (1) switch (_context37.prev = _context37.next) {
|
|
2025
2067
|
case 0:
|
|
2026
|
-
listingId =
|
|
2027
|
-
|
|
2028
|
-
|
|
2068
|
+
listingId = _ref73.listingId, confirmationId = _ref73.confirmationId;
|
|
2069
|
+
_context37.prev = 1;
|
|
2070
|
+
_context37.next = 4;
|
|
2029
2071
|
return this.ListingStatus({
|
|
2030
2072
|
listingId: listingId
|
|
2031
2073
|
});
|
|
2032
2074
|
case 4:
|
|
2033
|
-
listingStatus =
|
|
2075
|
+
listingStatus = _context37.sent;
|
|
2034
2076
|
if (listingStatus) {
|
|
2035
|
-
|
|
2077
|
+
_context37.next = 7;
|
|
2036
2078
|
break;
|
|
2037
2079
|
}
|
|
2038
2080
|
throw Error("Unable to find info for listing " + listingId);
|
|
2039
2081
|
case 7:
|
|
2040
|
-
|
|
2082
|
+
_context37.next = 9;
|
|
2041
2083
|
return this.MintingStatus({
|
|
2042
2084
|
tenantId: listingStatus.tenant
|
|
2043
2085
|
});
|
|
2044
2086
|
case 9:
|
|
2045
|
-
statuses =
|
|
2046
|
-
return
|
|
2087
|
+
statuses = _context37.sent;
|
|
2088
|
+
return _context37.abrupt("return", statuses.find(function (status) {
|
|
2047
2089
|
return status.op === "nft-transfer" && status.extra && status.extra[0] === confirmationId;
|
|
2048
2090
|
}) || {
|
|
2049
2091
|
status: "none"
|
|
2050
2092
|
});
|
|
2051
2093
|
case 13:
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
this.Log(
|
|
2055
|
-
return
|
|
2094
|
+
_context37.prev = 13;
|
|
2095
|
+
_context37.t0 = _context37["catch"](1);
|
|
2096
|
+
this.Log(_context37.t0, true);
|
|
2097
|
+
return _context37.abrupt("return", {
|
|
2056
2098
|
status: "unknown"
|
|
2057
2099
|
});
|
|
2058
2100
|
case 17:
|
|
2059
2101
|
case "end":
|
|
2060
|
-
return
|
|
2102
|
+
return _context37.stop();
|
|
2061
2103
|
}
|
|
2062
|
-
},
|
|
2104
|
+
}, _callee37, this, [[1, 13]]);
|
|
2063
2105
|
}));
|
|
2064
|
-
return function (
|
|
2065
|
-
return
|
|
2106
|
+
return function (_x23) {
|
|
2107
|
+
return _ref74.apply(this, arguments);
|
|
2066
2108
|
};
|
|
2067
2109
|
}();
|
|
2068
2110
|
|
|
@@ -2077,45 +2119,45 @@ exports.ListingPurchaseStatus = /*#__PURE__*/function () {
|
|
|
2077
2119
|
* @returns {Promise<Object>} - The minting status of the purchaseed item(s)
|
|
2078
2120
|
*/
|
|
2079
2121
|
exports.PurchaseStatus = /*#__PURE__*/function () {
|
|
2080
|
-
var
|
|
2122
|
+
var _ref76 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee38(_ref75) {
|
|
2081
2123
|
var marketplaceParams, confirmationId, marketplaceInfo, statuses;
|
|
2082
|
-
return _regeneratorRuntime.wrap(function
|
|
2083
|
-
while (1) switch (
|
|
2124
|
+
return _regeneratorRuntime.wrap(function _callee38$(_context38) {
|
|
2125
|
+
while (1) switch (_context38.prev = _context38.next) {
|
|
2084
2126
|
case 0:
|
|
2085
|
-
marketplaceParams =
|
|
2086
|
-
|
|
2087
|
-
|
|
2127
|
+
marketplaceParams = _ref75.marketplaceParams, confirmationId = _ref75.confirmationId;
|
|
2128
|
+
_context38.prev = 1;
|
|
2129
|
+
_context38.next = 4;
|
|
2088
2130
|
return this.MarketplaceInfo({
|
|
2089
2131
|
marketplaceParams: marketplaceParams
|
|
2090
2132
|
});
|
|
2091
2133
|
case 4:
|
|
2092
|
-
marketplaceInfo =
|
|
2093
|
-
|
|
2134
|
+
marketplaceInfo = _context38.sent;
|
|
2135
|
+
_context38.next = 7;
|
|
2094
2136
|
return this.MintingStatus({
|
|
2095
2137
|
tenantId: marketplaceInfo.tenant_id
|
|
2096
2138
|
});
|
|
2097
2139
|
case 7:
|
|
2098
|
-
statuses =
|
|
2099
|
-
return
|
|
2140
|
+
statuses = _context38.sent;
|
|
2141
|
+
return _context38.abrupt("return", statuses.find(function (status) {
|
|
2100
2142
|
return status.op === "nft-buy" && status.confirmationId === confirmationId;
|
|
2101
2143
|
}) || {
|
|
2102
2144
|
status: "none"
|
|
2103
2145
|
});
|
|
2104
2146
|
case 11:
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
this.Log(
|
|
2108
|
-
return
|
|
2147
|
+
_context38.prev = 11;
|
|
2148
|
+
_context38.t0 = _context38["catch"](1);
|
|
2149
|
+
this.Log(_context38.t0, true);
|
|
2150
|
+
return _context38.abrupt("return", {
|
|
2109
2151
|
status: "unknown"
|
|
2110
2152
|
});
|
|
2111
2153
|
case 15:
|
|
2112
2154
|
case "end":
|
|
2113
|
-
return
|
|
2155
|
+
return _context38.stop();
|
|
2114
2156
|
}
|
|
2115
|
-
},
|
|
2157
|
+
}, _callee38, this, [[1, 11]]);
|
|
2116
2158
|
}));
|
|
2117
|
-
return function (
|
|
2118
|
-
return
|
|
2159
|
+
return function (_x24) {
|
|
2160
|
+
return _ref76.apply(this, arguments);
|
|
2119
2161
|
};
|
|
2120
2162
|
}();
|
|
2121
2163
|
|
|
@@ -2130,45 +2172,146 @@ exports.PurchaseStatus = /*#__PURE__*/function () {
|
|
|
2130
2172
|
* @returns {Promise<Object>} - The minting status of the claim
|
|
2131
2173
|
*/
|
|
2132
2174
|
exports.ClaimStatus = /*#__PURE__*/function () {
|
|
2133
|
-
var
|
|
2175
|
+
var _ref78 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee39(_ref77) {
|
|
2134
2176
|
var marketplaceParams, sku, marketplaceInfo, statuses;
|
|
2135
|
-
return _regeneratorRuntime.wrap(function
|
|
2136
|
-
while (1) switch (
|
|
2177
|
+
return _regeneratorRuntime.wrap(function _callee39$(_context39) {
|
|
2178
|
+
while (1) switch (_context39.prev = _context39.next) {
|
|
2137
2179
|
case 0:
|
|
2138
|
-
marketplaceParams =
|
|
2139
|
-
|
|
2140
|
-
|
|
2180
|
+
marketplaceParams = _ref77.marketplaceParams, sku = _ref77.sku;
|
|
2181
|
+
_context39.prev = 1;
|
|
2182
|
+
_context39.next = 4;
|
|
2141
2183
|
return this.MarketplaceInfo({
|
|
2142
2184
|
marketplaceParams: marketplaceParams
|
|
2143
2185
|
});
|
|
2144
2186
|
case 4:
|
|
2145
|
-
marketplaceInfo =
|
|
2146
|
-
|
|
2187
|
+
marketplaceInfo = _context39.sent;
|
|
2188
|
+
_context39.next = 7;
|
|
2147
2189
|
return this.MintingStatus({
|
|
2148
2190
|
tenantId: marketplaceInfo.tenantId
|
|
2149
2191
|
});
|
|
2150
2192
|
case 7:
|
|
2151
|
-
statuses =
|
|
2152
|
-
return
|
|
2193
|
+
statuses = _context39.sent;
|
|
2194
|
+
return _context39.abrupt("return", statuses.find(function (status) {
|
|
2153
2195
|
return status.op === "nft-claim" && status.marketplaceId === marketplaceInfo.marketplaceId && status.confirmationId === sku;
|
|
2154
2196
|
}) || {
|
|
2155
2197
|
status: "none"
|
|
2156
2198
|
});
|
|
2157
2199
|
case 11:
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
this.Log(
|
|
2161
|
-
return
|
|
2200
|
+
_context39.prev = 11;
|
|
2201
|
+
_context39.t0 = _context39["catch"](1);
|
|
2202
|
+
this.Log(_context39.t0, true);
|
|
2203
|
+
return _context39.abrupt("return", {
|
|
2162
2204
|
status: "unknown"
|
|
2163
2205
|
});
|
|
2164
2206
|
case 15:
|
|
2165
2207
|
case "end":
|
|
2166
|
-
return
|
|
2208
|
+
return _context39.stop();
|
|
2167
2209
|
}
|
|
2168
|
-
},
|
|
2210
|
+
}, _callee39, this, [[1, 11]]);
|
|
2169
2211
|
}));
|
|
2170
|
-
return function (
|
|
2171
|
-
return
|
|
2212
|
+
return function (_x25) {
|
|
2213
|
+
return _ref78.apply(this, arguments);
|
|
2214
|
+
};
|
|
2215
|
+
}();
|
|
2216
|
+
|
|
2217
|
+
/**
|
|
2218
|
+
* Return status of the specified gift claim
|
|
2219
|
+
*
|
|
2220
|
+
* @methodGroup Status
|
|
2221
|
+
* @namedParams
|
|
2222
|
+
* @param {Object} marketplaceParams - Parameters of the marketplace
|
|
2223
|
+
* @param {string=} confirmationId - The confirmation ID of the gift purchase
|
|
2224
|
+
* @param {string=} giftId - The ID of the claimed gift
|
|
2225
|
+
*
|
|
2226
|
+
* @returns {Promise<Object>} - The transfer status of the gift claim
|
|
2227
|
+
*/
|
|
2228
|
+
exports.GiftClaimStatus = /*#__PURE__*/function () {
|
|
2229
|
+
var _ref80 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee40(_ref79) {
|
|
2230
|
+
var marketplaceParams, confirmationId, giftId, marketplaceInfo, statuses, responses;
|
|
2231
|
+
return _regeneratorRuntime.wrap(function _callee40$(_context40) {
|
|
2232
|
+
while (1) switch (_context40.prev = _context40.next) {
|
|
2233
|
+
case 0:
|
|
2234
|
+
marketplaceParams = _ref79.marketplaceParams, confirmationId = _ref79.confirmationId, giftId = _ref79.giftId;
|
|
2235
|
+
_context40.prev = 1;
|
|
2236
|
+
_context40.next = 4;
|
|
2237
|
+
return this.MarketplaceInfo({
|
|
2238
|
+
marketplaceParams: marketplaceParams
|
|
2239
|
+
});
|
|
2240
|
+
case 4:
|
|
2241
|
+
marketplaceInfo = _context40.sent;
|
|
2242
|
+
_context40.next = 7;
|
|
2243
|
+
return this.MintingStatus({
|
|
2244
|
+
tenantId: marketplaceInfo.tenantId
|
|
2245
|
+
});
|
|
2246
|
+
case 7:
|
|
2247
|
+
statuses = _context40.sent;
|
|
2248
|
+
// Status is a list of transfer statuses, may be multiple if quantity > 1
|
|
2249
|
+
responses = statuses.filter(function (status) {
|
|
2250
|
+
return status.op === "nft-transfer" && (confirmationId && status.confirmationId === confirmationId || giftId && status.giftId === giftId);
|
|
2251
|
+
}) || {
|
|
2252
|
+
status: "none"
|
|
2253
|
+
};
|
|
2254
|
+
if (!(responses.length === 0)) {
|
|
2255
|
+
_context40.next = 13;
|
|
2256
|
+
break;
|
|
2257
|
+
}
|
|
2258
|
+
return _context40.abrupt("return", {
|
|
2259
|
+
status: "none"
|
|
2260
|
+
});
|
|
2261
|
+
case 13:
|
|
2262
|
+
if (!responses.find(function (response) {
|
|
2263
|
+
return response.status === "failed";
|
|
2264
|
+
})) {
|
|
2265
|
+
_context40.next = 17;
|
|
2266
|
+
break;
|
|
2267
|
+
}
|
|
2268
|
+
return _context40.abrupt("return", {
|
|
2269
|
+
status: "failed",
|
|
2270
|
+
op: "nft-transfer",
|
|
2271
|
+
transfer_statuses: responses
|
|
2272
|
+
});
|
|
2273
|
+
case 17:
|
|
2274
|
+
if (!responses.find(function (response) {
|
|
2275
|
+
return response.status !== "complete";
|
|
2276
|
+
})) {
|
|
2277
|
+
_context40.next = 21;
|
|
2278
|
+
break;
|
|
2279
|
+
}
|
|
2280
|
+
return _context40.abrupt("return", {
|
|
2281
|
+
status: "pending",
|
|
2282
|
+
op: "nft-transfer",
|
|
2283
|
+
transfer_statuses: responses
|
|
2284
|
+
});
|
|
2285
|
+
case 21:
|
|
2286
|
+
return _context40.abrupt("return", {
|
|
2287
|
+
status: "complete",
|
|
2288
|
+
op: "nft-transfer",
|
|
2289
|
+
transfer_statuses: responses,
|
|
2290
|
+
items: responses.map(function (response) {
|
|
2291
|
+
return {
|
|
2292
|
+
token_addr: response.address,
|
|
2293
|
+
token_id_str: response.tokenId
|
|
2294
|
+
};
|
|
2295
|
+
})
|
|
2296
|
+
});
|
|
2297
|
+
case 22:
|
|
2298
|
+
_context40.next = 28;
|
|
2299
|
+
break;
|
|
2300
|
+
case 24:
|
|
2301
|
+
_context40.prev = 24;
|
|
2302
|
+
_context40.t0 = _context40["catch"](1);
|
|
2303
|
+
this.Log(_context40.t0, true);
|
|
2304
|
+
return _context40.abrupt("return", {
|
|
2305
|
+
status: "unknown"
|
|
2306
|
+
});
|
|
2307
|
+
case 28:
|
|
2308
|
+
case "end":
|
|
2309
|
+
return _context40.stop();
|
|
2310
|
+
}
|
|
2311
|
+
}, _callee40, this, [[1, 24]]);
|
|
2312
|
+
}));
|
|
2313
|
+
return function (_x26) {
|
|
2314
|
+
return _ref80.apply(this, arguments);
|
|
2172
2315
|
};
|
|
2173
2316
|
}();
|
|
2174
2317
|
|
|
@@ -2183,45 +2326,45 @@ exports.ClaimStatus = /*#__PURE__*/function () {
|
|
|
2183
2326
|
* @returns {Promise<Object>} - The status of the pack opening
|
|
2184
2327
|
*/
|
|
2185
2328
|
exports.PackOpenStatus = /*#__PURE__*/function () {
|
|
2186
|
-
var
|
|
2329
|
+
var _ref82 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee41(_ref81) {
|
|
2187
2330
|
var contractAddress, tokenId, tenantConfig, statuses;
|
|
2188
|
-
return _regeneratorRuntime.wrap(function
|
|
2189
|
-
while (1) switch (
|
|
2331
|
+
return _regeneratorRuntime.wrap(function _callee41$(_context41) {
|
|
2332
|
+
while (1) switch (_context41.prev = _context41.next) {
|
|
2190
2333
|
case 0:
|
|
2191
|
-
contractAddress =
|
|
2192
|
-
|
|
2193
|
-
|
|
2334
|
+
contractAddress = _ref81.contractAddress, tokenId = _ref81.tokenId;
|
|
2335
|
+
_context41.prev = 1;
|
|
2336
|
+
_context41.next = 4;
|
|
2194
2337
|
return this.TenantConfiguration({
|
|
2195
2338
|
contractAddress: contractAddress
|
|
2196
2339
|
});
|
|
2197
2340
|
case 4:
|
|
2198
|
-
tenantConfig =
|
|
2199
|
-
|
|
2341
|
+
tenantConfig = _context41.sent;
|
|
2342
|
+
_context41.next = 7;
|
|
2200
2343
|
return this.MintingStatus({
|
|
2201
2344
|
tenantId: tenantConfig.tenant
|
|
2202
2345
|
});
|
|
2203
2346
|
case 7:
|
|
2204
|
-
statuses =
|
|
2205
|
-
return
|
|
2347
|
+
statuses = _context41.sent;
|
|
2348
|
+
return _context41.abrupt("return", statuses.find(function (status) {
|
|
2206
2349
|
return status.op === "nft-open" && Utils.EqualAddress(contractAddress, status.address) && status.tokenId === tokenId;
|
|
2207
2350
|
}) || {
|
|
2208
2351
|
status: "none"
|
|
2209
2352
|
});
|
|
2210
2353
|
case 11:
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
this.Log(
|
|
2214
|
-
return
|
|
2354
|
+
_context41.prev = 11;
|
|
2355
|
+
_context41.t0 = _context41["catch"](1);
|
|
2356
|
+
this.Log(_context41.t0, true);
|
|
2357
|
+
return _context41.abrupt("return", {
|
|
2215
2358
|
status: "unknown"
|
|
2216
2359
|
});
|
|
2217
2360
|
case 15:
|
|
2218
2361
|
case "end":
|
|
2219
|
-
return
|
|
2362
|
+
return _context41.stop();
|
|
2220
2363
|
}
|
|
2221
|
-
},
|
|
2364
|
+
}, _callee41, this, [[1, 11]]);
|
|
2222
2365
|
}));
|
|
2223
|
-
return function (
|
|
2224
|
-
return
|
|
2366
|
+
return function (_x27) {
|
|
2367
|
+
return _ref82.apply(this, arguments);
|
|
2225
2368
|
};
|
|
2226
2369
|
}();
|
|
2227
2370
|
|
|
@@ -2236,39 +2379,39 @@ exports.PackOpenStatus = /*#__PURE__*/function () {
|
|
|
2236
2379
|
* @returns {Promise<Object>} - The status of the collection redemption
|
|
2237
2380
|
*/
|
|
2238
2381
|
exports.CollectionRedemptionStatus = /*#__PURE__*/function () {
|
|
2239
|
-
var
|
|
2382
|
+
var _ref84 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42(_ref83) {
|
|
2240
2383
|
var marketplaceParams, confirmationId, statuses;
|
|
2241
|
-
return _regeneratorRuntime.wrap(function
|
|
2242
|
-
while (1) switch (
|
|
2384
|
+
return _regeneratorRuntime.wrap(function _callee42$(_context42) {
|
|
2385
|
+
while (1) switch (_context42.prev = _context42.next) {
|
|
2243
2386
|
case 0:
|
|
2244
|
-
marketplaceParams =
|
|
2245
|
-
|
|
2246
|
-
|
|
2387
|
+
marketplaceParams = _ref83.marketplaceParams, confirmationId = _ref83.confirmationId;
|
|
2388
|
+
_context42.prev = 1;
|
|
2389
|
+
_context42.next = 4;
|
|
2247
2390
|
return this.MintingStatus({
|
|
2248
2391
|
marketplaceParams: marketplaceParams
|
|
2249
2392
|
});
|
|
2250
2393
|
case 4:
|
|
2251
|
-
statuses =
|
|
2252
|
-
return
|
|
2394
|
+
statuses = _context42.sent;
|
|
2395
|
+
return _context42.abrupt("return", statuses.find(function (status) {
|
|
2253
2396
|
return status.op === "nft-redeem" && status.confirmationId === confirmationId;
|
|
2254
2397
|
}) || {
|
|
2255
2398
|
status: "none"
|
|
2256
2399
|
});
|
|
2257
2400
|
case 8:
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
this.Log(
|
|
2261
|
-
return
|
|
2401
|
+
_context42.prev = 8;
|
|
2402
|
+
_context42.t0 = _context42["catch"](1);
|
|
2403
|
+
this.Log(_context42.t0, true);
|
|
2404
|
+
return _context42.abrupt("return", {
|
|
2262
2405
|
status: "unknown"
|
|
2263
2406
|
});
|
|
2264
2407
|
case 12:
|
|
2265
2408
|
case "end":
|
|
2266
|
-
return
|
|
2409
|
+
return _context42.stop();
|
|
2267
2410
|
}
|
|
2268
|
-
},
|
|
2411
|
+
}, _callee42, this, [[1, 8]]);
|
|
2269
2412
|
}));
|
|
2270
|
-
return function (
|
|
2271
|
-
return
|
|
2413
|
+
return function (_x28) {
|
|
2414
|
+
return _ref84.apply(this, arguments);
|
|
2272
2415
|
};
|
|
2273
2416
|
}();
|
|
2274
2417
|
|
|
@@ -2286,51 +2429,51 @@ exports.CollectionRedemptionStatus = /*#__PURE__*/function () {
|
|
|
2286
2429
|
* @returns {Promise<Object>} - The status of the offer redemption
|
|
2287
2430
|
*/
|
|
2288
2431
|
exports.RedeemableOfferStatus = /*#__PURE__*/function () {
|
|
2289
|
-
var
|
|
2432
|
+
var _ref86 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43(_ref85) {
|
|
2290
2433
|
var tenantId, marketplaceParams, contractAddress, tokenId, offerId, statuses;
|
|
2291
|
-
return _regeneratorRuntime.wrap(function
|
|
2292
|
-
while (1) switch (
|
|
2434
|
+
return _regeneratorRuntime.wrap(function _callee43$(_context43) {
|
|
2435
|
+
while (1) switch (_context43.prev = _context43.next) {
|
|
2293
2436
|
case 0:
|
|
2294
|
-
tenantId =
|
|
2295
|
-
|
|
2296
|
-
|
|
2437
|
+
tenantId = _ref85.tenantId, marketplaceParams = _ref85.marketplaceParams, contractAddress = _ref85.contractAddress, tokenId = _ref85.tokenId, offerId = _ref85.offerId;
|
|
2438
|
+
_context43.prev = 1;
|
|
2439
|
+
_context43.next = 4;
|
|
2297
2440
|
return this.MintingStatus({
|
|
2298
2441
|
marketplaceParams: marketplaceParams,
|
|
2299
2442
|
tenantId: tenantId
|
|
2300
2443
|
});
|
|
2301
2444
|
case 4:
|
|
2302
|
-
statuses =
|
|
2445
|
+
statuses = _context43.sent;
|
|
2303
2446
|
contractAddress = Utils.FormatAddress(contractAddress);
|
|
2304
|
-
return
|
|
2305
|
-
return status.op === "nft-offer-redeem" && Utils.EqualAddress(status.address, contractAddress) && status.tokenId === (tokenId || "").toString() && status.
|
|
2447
|
+
return _context43.abrupt("return", statuses.find(function (status) {
|
|
2448
|
+
return status.op === "nft-offer-redeem" && Utils.EqualAddress(status.address, contractAddress) && status.tokenId === (tokenId || "").toString() && status.offerId === (offerId || "").toString();
|
|
2306
2449
|
}) || {
|
|
2307
2450
|
status: "none"
|
|
2308
2451
|
});
|
|
2309
2452
|
case 9:
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
this.Log(
|
|
2313
|
-
return
|
|
2453
|
+
_context43.prev = 9;
|
|
2454
|
+
_context43.t0 = _context43["catch"](1);
|
|
2455
|
+
this.Log(_context43.t0, true);
|
|
2456
|
+
return _context43.abrupt("return", {
|
|
2314
2457
|
status: "unknown"
|
|
2315
2458
|
});
|
|
2316
2459
|
case 13:
|
|
2317
2460
|
case "end":
|
|
2318
|
-
return
|
|
2461
|
+
return _context43.stop();
|
|
2319
2462
|
}
|
|
2320
|
-
},
|
|
2463
|
+
}, _callee43, this, [[1, 9]]);
|
|
2321
2464
|
}));
|
|
2322
|
-
return function (
|
|
2323
|
-
return
|
|
2465
|
+
return function (_x29) {
|
|
2466
|
+
return _ref86.apply(this, arguments);
|
|
2324
2467
|
};
|
|
2325
2468
|
}();
|
|
2326
2469
|
exports.RedeemableCustomFulfillmentInfo = /*#__PURE__*/function () {
|
|
2327
|
-
var
|
|
2470
|
+
var _ref88 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(_ref87) {
|
|
2328
2471
|
var redeemableTransactionId;
|
|
2329
|
-
return _regeneratorRuntime.wrap(function
|
|
2330
|
-
while (1) switch (
|
|
2472
|
+
return _regeneratorRuntime.wrap(function _callee44$(_context44) {
|
|
2473
|
+
while (1) switch (_context44.prev = _context44.next) {
|
|
2331
2474
|
case 0:
|
|
2332
|
-
redeemableTransactionId =
|
|
2333
|
-
|
|
2475
|
+
redeemableTransactionId = _ref87.redeemableTransactionId;
|
|
2476
|
+
_context44.next = 3;
|
|
2334
2477
|
return Utils.ResponseToJson(this.stateStoreClient.Request({
|
|
2335
2478
|
method: "GET",
|
|
2336
2479
|
path: UrlJoin("code-fulfillment", this.network === "main" ? "main" : "demov3", "fulfill", redeemableTransactionId),
|
|
@@ -2339,28 +2482,28 @@ exports.RedeemableCustomFulfillmentInfo = /*#__PURE__*/function () {
|
|
|
2339
2482
|
}
|
|
2340
2483
|
}));
|
|
2341
2484
|
case 3:
|
|
2342
|
-
return
|
|
2485
|
+
return _context44.abrupt("return", _context44.sent);
|
|
2343
2486
|
case 4:
|
|
2344
2487
|
case "end":
|
|
2345
|
-
return
|
|
2488
|
+
return _context44.stop();
|
|
2346
2489
|
}
|
|
2347
|
-
},
|
|
2490
|
+
}, _callee44, this);
|
|
2348
2491
|
}));
|
|
2349
|
-
return function (
|
|
2350
|
-
return
|
|
2492
|
+
return function (_x30) {
|
|
2493
|
+
return _ref88.apply(this, arguments);
|
|
2351
2494
|
};
|
|
2352
2495
|
}();
|
|
2353
2496
|
|
|
2354
2497
|
/* EVENTS */
|
|
2355
2498
|
|
|
2356
2499
|
exports.LoadDrop = /*#__PURE__*/function () {
|
|
2357
|
-
var
|
|
2500
|
+
var _ref90 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45(_ref89) {
|
|
2358
2501
|
var _this = this;
|
|
2359
2502
|
var tenantSlug, eventSlug, dropId, event, eventId;
|
|
2360
|
-
return _regeneratorRuntime.wrap(function
|
|
2361
|
-
while (1) switch (
|
|
2503
|
+
return _regeneratorRuntime.wrap(function _callee45$(_context45) {
|
|
2504
|
+
while (1) switch (_context45.prev = _context45.next) {
|
|
2362
2505
|
case 0:
|
|
2363
|
-
tenantSlug =
|
|
2506
|
+
tenantSlug = _ref89.tenantSlug, eventSlug = _ref89.eventSlug, dropId = _ref89.dropId;
|
|
2364
2507
|
if (!this.drops) {
|
|
2365
2508
|
this.drops = {};
|
|
2366
2509
|
}
|
|
@@ -2371,10 +2514,10 @@ exports.LoadDrop = /*#__PURE__*/function () {
|
|
|
2371
2514
|
this.drops[tenantSlug][eventSlug] = {};
|
|
2372
2515
|
}
|
|
2373
2516
|
if (this.drops[tenantSlug][eventSlug][dropId]) {
|
|
2374
|
-
|
|
2517
|
+
_context45.next = 13;
|
|
2375
2518
|
break;
|
|
2376
2519
|
}
|
|
2377
|
-
|
|
2520
|
+
_context45.next = 7;
|
|
2378
2521
|
return this.client.ContentObjectMetadata({
|
|
2379
2522
|
libraryId: this.mainSiteLibraryId,
|
|
2380
2523
|
objectId: this.mainSiteId,
|
|
@@ -2387,14 +2530,14 @@ exports.LoadDrop = /*#__PURE__*/function () {
|
|
|
2387
2530
|
noAuth: true
|
|
2388
2531
|
});
|
|
2389
2532
|
case 7:
|
|
2390
|
-
|
|
2391
|
-
if (
|
|
2392
|
-
|
|
2533
|
+
_context45.t0 = _context45.sent;
|
|
2534
|
+
if (_context45.t0) {
|
|
2535
|
+
_context45.next = 10;
|
|
2393
2536
|
break;
|
|
2394
2537
|
}
|
|
2395
|
-
|
|
2538
|
+
_context45.t0 = [];
|
|
2396
2539
|
case 10:
|
|
2397
|
-
event =
|
|
2540
|
+
event = _context45.t0;
|
|
2398
2541
|
eventId = Utils.DecodeVersionHash(event["."].source).objectId;
|
|
2399
2542
|
event.drops.forEach(function (drop) {
|
|
2400
2543
|
drop = _objectSpread(_objectSpread({}, drop), {}, {
|
|
@@ -2404,31 +2547,31 @@ exports.LoadDrop = /*#__PURE__*/function () {
|
|
|
2404
2547
|
_this.drops[drop.uuid] = drop;
|
|
2405
2548
|
});
|
|
2406
2549
|
case 13:
|
|
2407
|
-
return
|
|
2550
|
+
return _context45.abrupt("return", this.drops[dropId]);
|
|
2408
2551
|
case 14:
|
|
2409
2552
|
case "end":
|
|
2410
|
-
return
|
|
2553
|
+
return _context45.stop();
|
|
2411
2554
|
}
|
|
2412
|
-
},
|
|
2555
|
+
}, _callee45, this);
|
|
2413
2556
|
}));
|
|
2414
|
-
return function (
|
|
2415
|
-
return
|
|
2557
|
+
return function (_x31) {
|
|
2558
|
+
return _ref90.apply(this, arguments);
|
|
2416
2559
|
};
|
|
2417
2560
|
}();
|
|
2418
2561
|
exports.SubmitDropVote = /*#__PURE__*/function () {
|
|
2419
|
-
var
|
|
2562
|
+
var _ref92 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(_ref91) {
|
|
2420
2563
|
var marketplaceParams, eventId, dropId, sku, marketplaceInfo;
|
|
2421
|
-
return _regeneratorRuntime.wrap(function
|
|
2422
|
-
while (1) switch (
|
|
2564
|
+
return _regeneratorRuntime.wrap(function _callee46$(_context46) {
|
|
2565
|
+
while (1) switch (_context46.prev = _context46.next) {
|
|
2423
2566
|
case 0:
|
|
2424
|
-
marketplaceParams =
|
|
2425
|
-
|
|
2567
|
+
marketplaceParams = _ref91.marketplaceParams, eventId = _ref91.eventId, dropId = _ref91.dropId, sku = _ref91.sku;
|
|
2568
|
+
_context46.next = 3;
|
|
2426
2569
|
return this.MarketplaceInfo({
|
|
2427
2570
|
marketplaceParams: marketplaceParams
|
|
2428
2571
|
});
|
|
2429
2572
|
case 3:
|
|
2430
|
-
marketplaceInfo =
|
|
2431
|
-
|
|
2573
|
+
marketplaceInfo = _context46.sent;
|
|
2574
|
+
_context46.next = 6;
|
|
2432
2575
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
2433
2576
|
path: UrlJoin("as", "wlt", "act", marketplaceInfo.tenant_id),
|
|
2434
2577
|
method: "POST",
|
|
@@ -2444,23 +2587,23 @@ exports.SubmitDropVote = /*#__PURE__*/function () {
|
|
|
2444
2587
|
});
|
|
2445
2588
|
case 6:
|
|
2446
2589
|
case "end":
|
|
2447
|
-
return
|
|
2590
|
+
return _context46.stop();
|
|
2448
2591
|
}
|
|
2449
|
-
},
|
|
2592
|
+
}, _callee46, this);
|
|
2450
2593
|
}));
|
|
2451
|
-
return function (
|
|
2452
|
-
return
|
|
2594
|
+
return function (_x32) {
|
|
2595
|
+
return _ref92.apply(this, arguments);
|
|
2453
2596
|
};
|
|
2454
2597
|
}();
|
|
2455
2598
|
exports.DropStatus = /*#__PURE__*/function () {
|
|
2456
|
-
var
|
|
2599
|
+
var _ref94 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47(_ref93) {
|
|
2457
2600
|
var marketplace, eventId, dropId, response;
|
|
2458
|
-
return _regeneratorRuntime.wrap(function
|
|
2459
|
-
while (1) switch (
|
|
2601
|
+
return _regeneratorRuntime.wrap(function _callee47$(_context47) {
|
|
2602
|
+
while (1) switch (_context47.prev = _context47.next) {
|
|
2460
2603
|
case 0:
|
|
2461
|
-
marketplace =
|
|
2462
|
-
|
|
2463
|
-
|
|
2604
|
+
marketplace = _ref93.marketplace, eventId = _ref93.eventId, dropId = _ref93.dropId;
|
|
2605
|
+
_context47.prev = 1;
|
|
2606
|
+
_context47.next = 4;
|
|
2464
2607
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
2465
2608
|
path: UrlJoin("as", "wlt", "act", marketplace.tenant_id, eventId, dropId),
|
|
2466
2609
|
method: "GET",
|
|
@@ -2469,25 +2612,25 @@ exports.DropStatus = /*#__PURE__*/function () {
|
|
|
2469
2612
|
}
|
|
2470
2613
|
}));
|
|
2471
2614
|
case 4:
|
|
2472
|
-
response =
|
|
2473
|
-
return
|
|
2615
|
+
response = _context47.sent;
|
|
2616
|
+
return _context47.abrupt("return", response.sort(function (a, b) {
|
|
2474
2617
|
return a.ts > b.ts ? 1 : -1;
|
|
2475
2618
|
})[0] || {
|
|
2476
2619
|
status: "none"
|
|
2477
2620
|
});
|
|
2478
2621
|
case 8:
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
this.Log(
|
|
2482
|
-
return
|
|
2622
|
+
_context47.prev = 8;
|
|
2623
|
+
_context47.t0 = _context47["catch"](1);
|
|
2624
|
+
this.Log(_context47.t0, true);
|
|
2625
|
+
return _context47.abrupt("return", "");
|
|
2483
2626
|
case 12:
|
|
2484
2627
|
case "end":
|
|
2485
|
-
return
|
|
2628
|
+
return _context47.stop();
|
|
2486
2629
|
}
|
|
2487
|
-
},
|
|
2630
|
+
}, _callee47, this, [[1, 8]]);
|
|
2488
2631
|
}));
|
|
2489
|
-
return function (
|
|
2490
|
-
return
|
|
2632
|
+
return function (_x33) {
|
|
2633
|
+
return _ref94.apply(this, arguments);
|
|
2491
2634
|
};
|
|
2492
2635
|
}();
|
|
2493
2636
|
|
|
@@ -2509,12 +2652,12 @@ exports.DropStatus = /*#__PURE__*/function () {
|
|
|
2509
2652
|
* @returns {Promise<Array<Object>>} - Offers matching the specified filters
|
|
2510
2653
|
*/
|
|
2511
2654
|
exports.MarketplaceOffers = /*#__PURE__*/function () {
|
|
2512
|
-
var
|
|
2513
|
-
var contractAddress, tokenId, buyerAddress, sellerAddress, statuses,
|
|
2514
|
-
return _regeneratorRuntime.wrap(function
|
|
2515
|
-
while (1) switch (
|
|
2655
|
+
var _ref96 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(_ref95) {
|
|
2656
|
+
var contractAddress, tokenId, buyerAddress, sellerAddress, statuses, _ref95$start, start, _ref95$limit, limit, path, queryParams, offers;
|
|
2657
|
+
return _regeneratorRuntime.wrap(function _callee48$(_context48) {
|
|
2658
|
+
while (1) switch (_context48.prev = _context48.next) {
|
|
2516
2659
|
case 0:
|
|
2517
|
-
contractAddress =
|
|
2660
|
+
contractAddress = _ref95.contractAddress, tokenId = _ref95.tokenId, buyerAddress = _ref95.buyerAddress, sellerAddress = _ref95.sellerAddress, statuses = _ref95.statuses, _ref95$start = _ref95.start, start = _ref95$start === void 0 ? 0 : _ref95$start, _ref95$limit = _ref95.limit, limit = _ref95$limit === void 0 ? 10 : _ref95$limit;
|
|
2518
2661
|
path = UrlJoin("as", "mkt", "offers", "ls");
|
|
2519
2662
|
if (buyerAddress) {
|
|
2520
2663
|
path = UrlJoin(path, "b", Utils.FormatAddress(buyerAddress));
|
|
@@ -2534,15 +2677,15 @@ exports.MarketplaceOffers = /*#__PURE__*/function () {
|
|
|
2534
2677
|
if (statuses && statuses.length > 0) {
|
|
2535
2678
|
queryParams.include = statuses.join(",");
|
|
2536
2679
|
}
|
|
2537
|
-
|
|
2680
|
+
_context48.next = 8;
|
|
2538
2681
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
2539
2682
|
path: path,
|
|
2540
2683
|
method: "GET",
|
|
2541
2684
|
queryParams: queryParams
|
|
2542
2685
|
}));
|
|
2543
2686
|
case 8:
|
|
2544
|
-
offers =
|
|
2545
|
-
return
|
|
2687
|
+
offers = _context48.sent;
|
|
2688
|
+
return _context48.abrupt("return", offers.map(function (offer) {
|
|
2546
2689
|
return _objectSpread(_objectSpread({}, offer), {}, {
|
|
2547
2690
|
created: offer.created * 1000,
|
|
2548
2691
|
updated: offer.updated * 1000,
|
|
@@ -2551,12 +2694,12 @@ exports.MarketplaceOffers = /*#__PURE__*/function () {
|
|
|
2551
2694
|
}));
|
|
2552
2695
|
case 10:
|
|
2553
2696
|
case "end":
|
|
2554
|
-
return
|
|
2697
|
+
return _context48.stop();
|
|
2555
2698
|
}
|
|
2556
|
-
},
|
|
2699
|
+
}, _callee48, this);
|
|
2557
2700
|
}));
|
|
2558
|
-
return function (
|
|
2559
|
-
return
|
|
2701
|
+
return function (_x34) {
|
|
2702
|
+
return _ref96.apply(this, arguments);
|
|
2560
2703
|
};
|
|
2561
2704
|
}();
|
|
2562
2705
|
|
|
@@ -2576,17 +2719,17 @@ exports.MarketplaceOffers = /*#__PURE__*/function () {
|
|
|
2576
2719
|
* @returns {Promise<Object>} - Info about the created/updated offer
|
|
2577
2720
|
*/
|
|
2578
2721
|
exports.CreateMarketplaceOffer = /*#__PURE__*/function () {
|
|
2579
|
-
var
|
|
2722
|
+
var _ref98 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(_ref97) {
|
|
2580
2723
|
var contractAddress, tokenId, offerId, price, expiresAt, response;
|
|
2581
|
-
return _regeneratorRuntime.wrap(function
|
|
2582
|
-
while (1) switch (
|
|
2724
|
+
return _regeneratorRuntime.wrap(function _callee49$(_context49) {
|
|
2725
|
+
while (1) switch (_context49.prev = _context49.next) {
|
|
2583
2726
|
case 0:
|
|
2584
|
-
contractAddress =
|
|
2727
|
+
contractAddress = _ref97.contractAddress, tokenId = _ref97.tokenId, offerId = _ref97.offerId, price = _ref97.price, expiresAt = _ref97.expiresAt;
|
|
2585
2728
|
if (!offerId) {
|
|
2586
|
-
|
|
2729
|
+
_context49.next = 7;
|
|
2587
2730
|
break;
|
|
2588
2731
|
}
|
|
2589
|
-
|
|
2732
|
+
_context49.next = 4;
|
|
2590
2733
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
2591
2734
|
path: UrlJoin("as", "wlt", "mkt", "offers", offerId),
|
|
2592
2735
|
method: "PUT",
|
|
@@ -2599,11 +2742,11 @@ exports.CreateMarketplaceOffer = /*#__PURE__*/function () {
|
|
|
2599
2742
|
}
|
|
2600
2743
|
}));
|
|
2601
2744
|
case 4:
|
|
2602
|
-
response =
|
|
2603
|
-
|
|
2745
|
+
response = _context49.sent;
|
|
2746
|
+
_context49.next = 10;
|
|
2604
2747
|
break;
|
|
2605
2748
|
case 7:
|
|
2606
|
-
|
|
2749
|
+
_context49.next = 9;
|
|
2607
2750
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
2608
2751
|
path: UrlJoin("as", "wlt", "mkt", "offers", contractAddress, tokenId),
|
|
2609
2752
|
method: "POST",
|
|
@@ -2618,17 +2761,17 @@ exports.CreateMarketplaceOffer = /*#__PURE__*/function () {
|
|
|
2618
2761
|
}
|
|
2619
2762
|
}));
|
|
2620
2763
|
case 9:
|
|
2621
|
-
response =
|
|
2764
|
+
response = _context49.sent;
|
|
2622
2765
|
case 10:
|
|
2623
|
-
return
|
|
2766
|
+
return _context49.abrupt("return", response.offer_id);
|
|
2624
2767
|
case 11:
|
|
2625
2768
|
case "end":
|
|
2626
|
-
return
|
|
2769
|
+
return _context49.stop();
|
|
2627
2770
|
}
|
|
2628
|
-
},
|
|
2771
|
+
}, _callee49, this);
|
|
2629
2772
|
}));
|
|
2630
|
-
return function (
|
|
2631
|
-
return
|
|
2773
|
+
return function (_x35) {
|
|
2774
|
+
return _ref98.apply(this, arguments);
|
|
2632
2775
|
};
|
|
2633
2776
|
}();
|
|
2634
2777
|
|
|
@@ -2642,13 +2785,13 @@ exports.CreateMarketplaceOffer = /*#__PURE__*/function () {
|
|
|
2642
2785
|
* @param {string} offerId - The ID of the offer
|
|
2643
2786
|
*/
|
|
2644
2787
|
exports.RemoveMarketplaceOffer = /*#__PURE__*/function () {
|
|
2645
|
-
var
|
|
2788
|
+
var _ref100 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(_ref99) {
|
|
2646
2789
|
var offerId;
|
|
2647
|
-
return _regeneratorRuntime.wrap(function
|
|
2648
|
-
while (1) switch (
|
|
2790
|
+
return _regeneratorRuntime.wrap(function _callee50$(_context50) {
|
|
2791
|
+
while (1) switch (_context50.prev = _context50.next) {
|
|
2649
2792
|
case 0:
|
|
2650
|
-
offerId =
|
|
2651
|
-
|
|
2793
|
+
offerId = _ref99.offerId;
|
|
2794
|
+
_context50.next = 3;
|
|
2652
2795
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
2653
2796
|
path: UrlJoin("as", "wlt", "mkt", "offers", offerId),
|
|
2654
2797
|
method: "DELETE",
|
|
@@ -2657,15 +2800,15 @@ exports.RemoveMarketplaceOffer = /*#__PURE__*/function () {
|
|
|
2657
2800
|
}
|
|
2658
2801
|
});
|
|
2659
2802
|
case 3:
|
|
2660
|
-
return
|
|
2803
|
+
return _context50.abrupt("return", _context50.sent);
|
|
2661
2804
|
case 4:
|
|
2662
2805
|
case "end":
|
|
2663
|
-
return
|
|
2806
|
+
return _context50.stop();
|
|
2664
2807
|
}
|
|
2665
|
-
},
|
|
2808
|
+
}, _callee50, this);
|
|
2666
2809
|
}));
|
|
2667
|
-
return function (
|
|
2668
|
-
return
|
|
2810
|
+
return function (_x36) {
|
|
2811
|
+
return _ref100.apply(this, arguments);
|
|
2669
2812
|
};
|
|
2670
2813
|
}();
|
|
2671
2814
|
|
|
@@ -2679,13 +2822,13 @@ exports.RemoveMarketplaceOffer = /*#__PURE__*/function () {
|
|
|
2679
2822
|
* @param {string} offerId - The ID of the offer
|
|
2680
2823
|
*/
|
|
2681
2824
|
exports.AcceptMarketplaceOffer = /*#__PURE__*/function () {
|
|
2682
|
-
var
|
|
2825
|
+
var _ref102 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51(_ref101) {
|
|
2683
2826
|
var offerId;
|
|
2684
|
-
return _regeneratorRuntime.wrap(function
|
|
2685
|
-
while (1) switch (
|
|
2827
|
+
return _regeneratorRuntime.wrap(function _callee51$(_context51) {
|
|
2828
|
+
while (1) switch (_context51.prev = _context51.next) {
|
|
2686
2829
|
case 0:
|
|
2687
|
-
offerId =
|
|
2688
|
-
|
|
2830
|
+
offerId = _ref101.offerId;
|
|
2831
|
+
_context51.next = 3;
|
|
2689
2832
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
2690
2833
|
path: UrlJoin("as", "wlt", "mkt", "offers", "accept", offerId),
|
|
2691
2834
|
method: "PUT",
|
|
@@ -2694,15 +2837,15 @@ exports.AcceptMarketplaceOffer = /*#__PURE__*/function () {
|
|
|
2694
2837
|
}
|
|
2695
2838
|
});
|
|
2696
2839
|
case 3:
|
|
2697
|
-
return
|
|
2840
|
+
return _context51.abrupt("return", _context51.sent);
|
|
2698
2841
|
case 4:
|
|
2699
2842
|
case "end":
|
|
2700
|
-
return
|
|
2843
|
+
return _context51.stop();
|
|
2701
2844
|
}
|
|
2702
|
-
},
|
|
2845
|
+
}, _callee51, this);
|
|
2703
2846
|
}));
|
|
2704
|
-
return function (
|
|
2705
|
-
return
|
|
2847
|
+
return function (_x37) {
|
|
2848
|
+
return _ref102.apply(this, arguments);
|
|
2706
2849
|
};
|
|
2707
2850
|
}();
|
|
2708
2851
|
|
|
@@ -2716,13 +2859,13 @@ exports.AcceptMarketplaceOffer = /*#__PURE__*/function () {
|
|
|
2716
2859
|
* @param {string} offerId - The ID of the offer
|
|
2717
2860
|
*/
|
|
2718
2861
|
exports.RejectMarketplaceOffer = /*#__PURE__*/function () {
|
|
2719
|
-
var
|
|
2862
|
+
var _ref104 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52(_ref103) {
|
|
2720
2863
|
var offerId;
|
|
2721
|
-
return _regeneratorRuntime.wrap(function
|
|
2722
|
-
while (1) switch (
|
|
2864
|
+
return _regeneratorRuntime.wrap(function _callee52$(_context52) {
|
|
2865
|
+
while (1) switch (_context52.prev = _context52.next) {
|
|
2723
2866
|
case 0:
|
|
2724
|
-
offerId =
|
|
2725
|
-
|
|
2867
|
+
offerId = _ref103.offerId;
|
|
2868
|
+
_context52.next = 3;
|
|
2726
2869
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
2727
2870
|
path: UrlJoin("as", "wlt", "mkt", "offers", "decline", offerId),
|
|
2728
2871
|
method: "PUT",
|
|
@@ -2731,15 +2874,15 @@ exports.RejectMarketplaceOffer = /*#__PURE__*/function () {
|
|
|
2731
2874
|
}
|
|
2732
2875
|
});
|
|
2733
2876
|
case 3:
|
|
2734
|
-
return
|
|
2877
|
+
return _context52.abrupt("return", _context52.sent);
|
|
2735
2878
|
case 4:
|
|
2736
2879
|
case "end":
|
|
2737
|
-
return
|
|
2880
|
+
return _context52.stop();
|
|
2738
2881
|
}
|
|
2739
|
-
},
|
|
2882
|
+
}, _callee52, this);
|
|
2740
2883
|
}));
|
|
2741
|
-
return function (
|
|
2742
|
-
return
|
|
2884
|
+
return function (_x38) {
|
|
2885
|
+
return _ref104.apply(this, arguments);
|
|
2743
2886
|
};
|
|
2744
2887
|
}();
|
|
2745
2888
|
|
|
@@ -2756,13 +2899,13 @@ exports.RejectMarketplaceOffer = /*#__PURE__*/function () {
|
|
|
2756
2899
|
* @returns {Promise<Object>} - Info about the voting event, including the current user's votes and the current total voting tally
|
|
2757
2900
|
*/
|
|
2758
2901
|
exports.VoteStatus = /*#__PURE__*/function () {
|
|
2759
|
-
var
|
|
2902
|
+
var _ref106 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee53(_ref105) {
|
|
2760
2903
|
var tenantId, votingEventId;
|
|
2761
|
-
return _regeneratorRuntime.wrap(function
|
|
2762
|
-
while (1) switch (
|
|
2904
|
+
return _regeneratorRuntime.wrap(function _callee53$(_context53) {
|
|
2905
|
+
while (1) switch (_context53.prev = _context53.next) {
|
|
2763
2906
|
case 0:
|
|
2764
|
-
tenantId =
|
|
2765
|
-
|
|
2907
|
+
tenantId = _ref105.tenantId, votingEventId = _ref105.votingEventId;
|
|
2908
|
+
_context53.next = 3;
|
|
2766
2909
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
2767
2910
|
path: UrlJoin("as", "votes", tenantId, votingEventId),
|
|
2768
2911
|
headers: {
|
|
@@ -2770,15 +2913,15 @@ exports.VoteStatus = /*#__PURE__*/function () {
|
|
|
2770
2913
|
}
|
|
2771
2914
|
}));
|
|
2772
2915
|
case 3:
|
|
2773
|
-
return
|
|
2916
|
+
return _context53.abrupt("return", _context53.sent);
|
|
2774
2917
|
case 4:
|
|
2775
2918
|
case "end":
|
|
2776
|
-
return
|
|
2919
|
+
return _context53.stop();
|
|
2777
2920
|
}
|
|
2778
|
-
},
|
|
2921
|
+
}, _callee53, this);
|
|
2779
2922
|
}));
|
|
2780
|
-
return function (
|
|
2781
|
-
return
|
|
2923
|
+
return function (_x39) {
|
|
2924
|
+
return _ref106.apply(this, arguments);
|
|
2782
2925
|
};
|
|
2783
2926
|
}();
|
|
2784
2927
|
|
|
@@ -2796,13 +2939,13 @@ exports.VoteStatus = /*#__PURE__*/function () {
|
|
|
2796
2939
|
* @returns {Promise<Object>} - Info about the voting event, including the current user's votes and the current total voting tally
|
|
2797
2940
|
*/
|
|
2798
2941
|
exports.CastVote = /*#__PURE__*/function () {
|
|
2799
|
-
var
|
|
2942
|
+
var _ref108 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee54(_ref107) {
|
|
2800
2943
|
var tenantId, votingEventId, sku;
|
|
2801
|
-
return _regeneratorRuntime.wrap(function
|
|
2802
|
-
while (1) switch (
|
|
2944
|
+
return _regeneratorRuntime.wrap(function _callee54$(_context54) {
|
|
2945
|
+
while (1) switch (_context54.prev = _context54.next) {
|
|
2803
2946
|
case 0:
|
|
2804
|
-
tenantId =
|
|
2805
|
-
|
|
2947
|
+
tenantId = _ref107.tenantId, votingEventId = _ref107.votingEventId, sku = _ref107.sku;
|
|
2948
|
+
_context54.next = 3;
|
|
2806
2949
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
2807
2950
|
path: UrlJoin("as", "votes", tenantId, votingEventId, sku),
|
|
2808
2951
|
method: "POST",
|
|
@@ -2811,15 +2954,15 @@ exports.CastVote = /*#__PURE__*/function () {
|
|
|
2811
2954
|
}
|
|
2812
2955
|
}));
|
|
2813
2956
|
case 3:
|
|
2814
|
-
return
|
|
2957
|
+
return _context54.abrupt("return", _context54.sent);
|
|
2815
2958
|
case 4:
|
|
2816
2959
|
case "end":
|
|
2817
|
-
return
|
|
2960
|
+
return _context54.stop();
|
|
2818
2961
|
}
|
|
2819
|
-
},
|
|
2962
|
+
}, _callee54, this);
|
|
2820
2963
|
}));
|
|
2821
|
-
return function (
|
|
2822
|
-
return
|
|
2964
|
+
return function (_x40) {
|
|
2965
|
+
return _ref108.apply(this, arguments);
|
|
2823
2966
|
};
|
|
2824
2967
|
}();
|
|
2825
2968
|
|
|
@@ -2837,13 +2980,13 @@ exports.CastVote = /*#__PURE__*/function () {
|
|
|
2837
2980
|
* @returns {Promise<Object>} - Info about the voting event, including the current user's votes and the current total voting tally
|
|
2838
2981
|
*/
|
|
2839
2982
|
exports.RevokeVote = /*#__PURE__*/function () {
|
|
2840
|
-
var
|
|
2983
|
+
var _ref110 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee55(_ref109) {
|
|
2841
2984
|
var tenantId, votingEventId, sku;
|
|
2842
|
-
return _regeneratorRuntime.wrap(function
|
|
2843
|
-
while (1) switch (
|
|
2985
|
+
return _regeneratorRuntime.wrap(function _callee55$(_context55) {
|
|
2986
|
+
while (1) switch (_context55.prev = _context55.next) {
|
|
2844
2987
|
case 0:
|
|
2845
|
-
tenantId =
|
|
2846
|
-
|
|
2988
|
+
tenantId = _ref109.tenantId, votingEventId = _ref109.votingEventId, sku = _ref109.sku;
|
|
2989
|
+
_context55.next = 3;
|
|
2847
2990
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
2848
2991
|
path: UrlJoin("as", "votes", tenantId, votingEventId, sku),
|
|
2849
2992
|
method: "DELETE",
|
|
@@ -2852,14 +2995,14 @@ exports.RevokeVote = /*#__PURE__*/function () {
|
|
|
2852
2995
|
}
|
|
2853
2996
|
}));
|
|
2854
2997
|
case 3:
|
|
2855
|
-
return
|
|
2998
|
+
return _context55.abrupt("return", _context55.sent);
|
|
2856
2999
|
case 4:
|
|
2857
3000
|
case "end":
|
|
2858
|
-
return
|
|
3001
|
+
return _context55.stop();
|
|
2859
3002
|
}
|
|
2860
|
-
},
|
|
3003
|
+
}, _callee55, this);
|
|
2861
3004
|
}));
|
|
2862
|
-
return function (
|
|
2863
|
-
return
|
|
3005
|
+
return function (_x41) {
|
|
3006
|
+
return _ref110.apply(this, arguments);
|
|
2864
3007
|
};
|
|
2865
3008
|
}();
|