@eluvio/elv-client-js 4.0.37 → 4.0.38
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 +2 -2
- package/dist/ElvWalletClient-node-min.js +9 -9
- package/dist/src/walletClient/ClientMethods.js +569 -716
- package/dist/src/walletClient/Configuration.js +1 -1
- package/dist/src/walletClient/index.js +34 -77
- package/package.json +1 -1
- package/src/walletClient/Utils.js +3 -1
- package/src/walletClient/index.js +94 -24
- package/utilities/GenerateFabricToken.js +23 -0
|
@@ -651,48 +651,6 @@ exports.ExchangeRate = /*#__PURE__*/function () {
|
|
|
651
651
|
};
|
|
652
652
|
}();
|
|
653
653
|
|
|
654
|
-
/**
|
|
655
|
-
* Retrieve custom CSS for the specified tenant
|
|
656
|
-
*
|
|
657
|
-
* @methodGroup Tenants
|
|
658
|
-
* @namedParams
|
|
659
|
-
* @param {Object} tenantSlug
|
|
660
|
-
*
|
|
661
|
-
* @returns {Promise<string>} - The CSS of the tenant
|
|
662
|
-
*/
|
|
663
|
-
exports.TenantCSS = /*#__PURE__*/function () {
|
|
664
|
-
var _ref23 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(_ref22) {
|
|
665
|
-
var tenantSlug;
|
|
666
|
-
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
667
|
-
while (1) switch (_context11.prev = _context11.next) {
|
|
668
|
-
case 0:
|
|
669
|
-
tenantSlug = _ref22.tenantSlug;
|
|
670
|
-
if (this.cachedCSS[tenantSlug]) {
|
|
671
|
-
_context11.next = 5;
|
|
672
|
-
break;
|
|
673
|
-
}
|
|
674
|
-
_context11.next = 4;
|
|
675
|
-
return this.client.ContentObjectMetadata({
|
|
676
|
-
libraryId: this.mainSiteLibraryId,
|
|
677
|
-
objectId: this.mainSiteId,
|
|
678
|
-
metadataSubtree: UrlJoin("/public", "asset_metadata", "tenants", tenantSlug, "info", "branding", "wallet_css"),
|
|
679
|
-
authorizationToken: this.publicStaticToken
|
|
680
|
-
});
|
|
681
|
-
case 4:
|
|
682
|
-
this.cachedCSS[tenantSlug] = _context11.sent;
|
|
683
|
-
case 5:
|
|
684
|
-
return _context11.abrupt("return", this.cachedCSS[tenantSlug] || "");
|
|
685
|
-
case 6:
|
|
686
|
-
case "end":
|
|
687
|
-
return _context11.stop();
|
|
688
|
-
}
|
|
689
|
-
}, _callee11, this);
|
|
690
|
-
}));
|
|
691
|
-
return function (_x4) {
|
|
692
|
-
return _ref23.apply(this, arguments);
|
|
693
|
-
};
|
|
694
|
-
}();
|
|
695
|
-
|
|
696
654
|
/* MARKETPLACE */
|
|
697
655
|
|
|
698
656
|
/**
|
|
@@ -707,12 +665,12 @@ exports.TenantCSS = /*#__PURE__*/function () {
|
|
|
707
665
|
* @returns {Promise<Object>} - Stock info for items in the marketplace
|
|
708
666
|
*/
|
|
709
667
|
exports.MarketplaceStock = /*#__PURE__*/function () {
|
|
710
|
-
var
|
|
668
|
+
var _ref23 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(_ref22) {
|
|
711
669
|
var marketplaceParams, tenantId, marketplaceInfo;
|
|
712
|
-
return _regeneratorRuntime.wrap(function
|
|
713
|
-
while (1) switch (
|
|
670
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
671
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
714
672
|
case 0:
|
|
715
|
-
marketplaceParams =
|
|
673
|
+
marketplaceParams = _ref22.marketplaceParams, tenantId = _ref22.tenantId;
|
|
716
674
|
if (!tenantId) {
|
|
717
675
|
marketplaceInfo = this.MarketplaceInfo({
|
|
718
676
|
marketplaceParams: marketplaceParams
|
|
@@ -720,10 +678,10 @@ exports.MarketplaceStock = /*#__PURE__*/function () {
|
|
|
720
678
|
tenantId = marketplaceInfo.tenantId;
|
|
721
679
|
}
|
|
722
680
|
if (!this.loggedIn) {
|
|
723
|
-
|
|
681
|
+
_context11.next = 6;
|
|
724
682
|
break;
|
|
725
683
|
}
|
|
726
|
-
|
|
684
|
+
_context11.next = 5;
|
|
727
685
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
728
686
|
path: UrlJoin("as", "wlt", "nft", "info", tenantId),
|
|
729
687
|
method: "GET",
|
|
@@ -732,23 +690,23 @@ exports.MarketplaceStock = /*#__PURE__*/function () {
|
|
|
732
690
|
}
|
|
733
691
|
}));
|
|
734
692
|
case 5:
|
|
735
|
-
return
|
|
693
|
+
return _context11.abrupt("return", _context11.sent);
|
|
736
694
|
case 6:
|
|
737
|
-
|
|
695
|
+
_context11.next = 8;
|
|
738
696
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
739
697
|
path: UrlJoin("as", "nft", "stock", tenantId),
|
|
740
698
|
method: "GET"
|
|
741
699
|
}));
|
|
742
700
|
case 8:
|
|
743
|
-
return
|
|
701
|
+
return _context11.abrupt("return", _context11.sent);
|
|
744
702
|
case 9:
|
|
745
703
|
case "end":
|
|
746
|
-
return
|
|
704
|
+
return _context11.stop();
|
|
747
705
|
}
|
|
748
|
-
},
|
|
706
|
+
}, _callee11, this);
|
|
749
707
|
}));
|
|
750
|
-
return function (
|
|
751
|
-
return
|
|
708
|
+
return function (_x4) {
|
|
709
|
+
return _ref23.apply(this, arguments);
|
|
752
710
|
};
|
|
753
711
|
}();
|
|
754
712
|
|
|
@@ -765,13 +723,13 @@ exports.MarketplaceStock = /*#__PURE__*/function () {
|
|
|
765
723
|
*
|
|
766
724
|
* @returns {Promise<Object>} - Info about the marketplace
|
|
767
725
|
*/
|
|
768
|
-
exports.MarketplaceInfo = function (
|
|
769
|
-
var marketplaceParams =
|
|
770
|
-
var
|
|
771
|
-
tenantSlug =
|
|
772
|
-
marketplaceSlug =
|
|
773
|
-
marketplaceId =
|
|
774
|
-
marketplaceHash =
|
|
726
|
+
exports.MarketplaceInfo = function (_ref24) {
|
|
727
|
+
var marketplaceParams = _ref24.marketplaceParams;
|
|
728
|
+
var _ref25 = marketplaceParams || {},
|
|
729
|
+
tenantSlug = _ref25.tenantSlug,
|
|
730
|
+
marketplaceSlug = _ref25.marketplaceSlug,
|
|
731
|
+
marketplaceId = _ref25.marketplaceId,
|
|
732
|
+
marketplaceHash = _ref25.marketplaceHash;
|
|
775
733
|
var marketplaceInfo;
|
|
776
734
|
if (tenantSlug && marketplaceSlug) {
|
|
777
735
|
marketplaceInfo = (this.availableMarketplaces[tenantSlug] || {})[marketplaceSlug];
|
|
@@ -795,21 +753,21 @@ exports.MarketplaceInfo = function (_ref26) {
|
|
|
795
753
|
* @returns {Promise<string>} - The CSS of the marketplace
|
|
796
754
|
*/
|
|
797
755
|
exports.MarketplaceCSS = /*#__PURE__*/function () {
|
|
798
|
-
var
|
|
756
|
+
var _ref27 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(_ref26) {
|
|
799
757
|
var marketplaceParams, marketplaceInfo, marketplaceHash;
|
|
800
|
-
return _regeneratorRuntime.wrap(function
|
|
801
|
-
while (1) switch (
|
|
758
|
+
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
759
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
802
760
|
case 0:
|
|
803
|
-
marketplaceParams =
|
|
761
|
+
marketplaceParams = _ref26.marketplaceParams;
|
|
804
762
|
marketplaceInfo = this.MarketplaceInfo({
|
|
805
763
|
marketplaceParams: marketplaceParams
|
|
806
764
|
});
|
|
807
765
|
marketplaceHash = marketplaceInfo.marketplaceHash;
|
|
808
766
|
if (this.cachedCSS[marketplaceHash]) {
|
|
809
|
-
|
|
767
|
+
_context12.next = 7;
|
|
810
768
|
break;
|
|
811
769
|
}
|
|
812
|
-
|
|
770
|
+
_context12.next = 6;
|
|
813
771
|
return this.client.ContentObjectMetadata({
|
|
814
772
|
versionHash: marketplaceHash,
|
|
815
773
|
metadataSubtree: "public/asset_metadata/info/branding/custom_css",
|
|
@@ -817,17 +775,17 @@ exports.MarketplaceCSS = /*#__PURE__*/function () {
|
|
|
817
775
|
noAuth: true
|
|
818
776
|
});
|
|
819
777
|
case 6:
|
|
820
|
-
this.cachedCSS[marketplaceHash] =
|
|
778
|
+
this.cachedCSS[marketplaceHash] = _context12.sent;
|
|
821
779
|
case 7:
|
|
822
|
-
return
|
|
780
|
+
return _context12.abrupt("return", this.cachedCSS[marketplaceHash] || "");
|
|
823
781
|
case 8:
|
|
824
782
|
case "end":
|
|
825
|
-
return
|
|
783
|
+
return _context12.stop();
|
|
826
784
|
}
|
|
827
|
-
},
|
|
785
|
+
}, _callee12, this);
|
|
828
786
|
}));
|
|
829
|
-
return function (
|
|
830
|
-
return
|
|
787
|
+
return function (_x5) {
|
|
788
|
+
return _ref27.apply(this, arguments);
|
|
831
789
|
};
|
|
832
790
|
}();
|
|
833
791
|
|
|
@@ -841,29 +799,29 @@ exports.MarketplaceCSS = /*#__PURE__*/function () {
|
|
|
841
799
|
*
|
|
842
800
|
* @returns {Promise<Object>} - Info about available marketplaces
|
|
843
801
|
*/
|
|
844
|
-
exports.AvailableMarketplaces = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
845
|
-
var
|
|
802
|
+
exports.AvailableMarketplaces = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13() {
|
|
803
|
+
var _ref29,
|
|
846
804
|
organizeById,
|
|
847
|
-
|
|
805
|
+
_ref29$forceReload,
|
|
848
806
|
forceReload,
|
|
849
|
-
|
|
850
|
-
return _regeneratorRuntime.wrap(function
|
|
851
|
-
while (1) switch (
|
|
807
|
+
_args13 = arguments;
|
|
808
|
+
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
809
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
852
810
|
case 0:
|
|
853
|
-
|
|
811
|
+
_ref29 = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {}, organizeById = _ref29.organizeById, _ref29$forceReload = _ref29.forceReload, forceReload = _ref29$forceReload === void 0 ? false : _ref29$forceReload;
|
|
854
812
|
if (!forceReload) {
|
|
855
|
-
|
|
813
|
+
_context13.next = 4;
|
|
856
814
|
break;
|
|
857
815
|
}
|
|
858
|
-
|
|
816
|
+
_context13.next = 4;
|
|
859
817
|
return this.LoadAvailableMarketplaces(true);
|
|
860
818
|
case 4:
|
|
861
|
-
return
|
|
819
|
+
return _context13.abrupt("return", _objectSpread({}, organizeById ? this.availableMarketplacesById : this.availableMarketplaces));
|
|
862
820
|
case 5:
|
|
863
821
|
case "end":
|
|
864
|
-
return
|
|
822
|
+
return _context13.stop();
|
|
865
823
|
}
|
|
866
|
-
},
|
|
824
|
+
}, _callee13, this);
|
|
867
825
|
}));
|
|
868
826
|
|
|
869
827
|
/**
|
|
@@ -878,21 +836,21 @@ exports.AvailableMarketplaces = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_re
|
|
|
878
836
|
* @returns {Promise<Object>} - The full information for the marketplace
|
|
879
837
|
*/
|
|
880
838
|
exports.Marketplace = /*#__PURE__*/function () {
|
|
881
|
-
var
|
|
839
|
+
var _ref31 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(_ref30) {
|
|
882
840
|
var marketplaceParams;
|
|
883
|
-
return _regeneratorRuntime.wrap(function
|
|
884
|
-
while (1) switch (
|
|
841
|
+
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
842
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
885
843
|
case 0:
|
|
886
|
-
marketplaceParams =
|
|
887
|
-
return
|
|
844
|
+
marketplaceParams = _ref30.marketplaceParams;
|
|
845
|
+
return _context14.abrupt("return", this.LoadMarketplace(marketplaceParams));
|
|
888
846
|
case 2:
|
|
889
847
|
case "end":
|
|
890
|
-
return
|
|
848
|
+
return _context14.stop();
|
|
891
849
|
}
|
|
892
|
-
},
|
|
850
|
+
}, _callee14, this);
|
|
893
851
|
}));
|
|
894
|
-
return function (
|
|
895
|
-
return
|
|
852
|
+
return function (_x6) {
|
|
853
|
+
return _ref31.apply(this, arguments);
|
|
896
854
|
};
|
|
897
855
|
}();
|
|
898
856
|
|
|
@@ -908,27 +866,27 @@ exports.Marketplace = /*#__PURE__*/function () {
|
|
|
908
866
|
* @returns {Promise<Object>} - Information about the specified contract
|
|
909
867
|
*/
|
|
910
868
|
exports.NFTContractStats = /*#__PURE__*/function () {
|
|
911
|
-
var
|
|
869
|
+
var _ref33 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(_ref32) {
|
|
912
870
|
var contractAddress;
|
|
913
|
-
return _regeneratorRuntime.wrap(function
|
|
914
|
-
while (1) switch (
|
|
871
|
+
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
872
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
915
873
|
case 0:
|
|
916
|
-
contractAddress =
|
|
917
|
-
|
|
874
|
+
contractAddress = _ref32.contractAddress;
|
|
875
|
+
_context15.next = 3;
|
|
918
876
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
919
877
|
path: UrlJoin("as", "nft", "info", contractAddress),
|
|
920
878
|
method: "GET"
|
|
921
879
|
}));
|
|
922
880
|
case 3:
|
|
923
|
-
return
|
|
881
|
+
return _context15.abrupt("return", _context15.sent);
|
|
924
882
|
case 4:
|
|
925
883
|
case "end":
|
|
926
|
-
return
|
|
884
|
+
return _context15.stop();
|
|
927
885
|
}
|
|
928
|
-
},
|
|
886
|
+
}, _callee15, this);
|
|
929
887
|
}));
|
|
930
|
-
return function (
|
|
931
|
-
return
|
|
888
|
+
return function (_x7) {
|
|
889
|
+
return _ref33.apply(this, arguments);
|
|
932
890
|
};
|
|
933
891
|
}();
|
|
934
892
|
|
|
@@ -941,77 +899,77 @@ exports.NFTContractStats = /*#__PURE__*/function () {
|
|
|
941
899
|
* @param {string} tokenId - The token ID of the NFT
|
|
942
900
|
*/
|
|
943
901
|
exports.NFT = /*#__PURE__*/function () {
|
|
944
|
-
var
|
|
902
|
+
var _ref35 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(_ref34) {
|
|
945
903
|
var tokenId, contractAddress, nft, assetMetadata, localizedMetadata;
|
|
946
|
-
return _regeneratorRuntime.wrap(function
|
|
947
|
-
while (1) switch (
|
|
904
|
+
return _regeneratorRuntime.wrap(function _callee16$(_context16) {
|
|
905
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
948
906
|
case 0:
|
|
949
|
-
tokenId =
|
|
950
|
-
|
|
951
|
-
|
|
907
|
+
tokenId = _ref34.tokenId, contractAddress = _ref34.contractAddress;
|
|
908
|
+
_context16.t0 = FormatNFTDetails;
|
|
909
|
+
_context16.next = 4;
|
|
952
910
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
953
911
|
path: UrlJoin("as", "nft", "info", contractAddress, tokenId),
|
|
954
912
|
method: "GET"
|
|
955
913
|
}));
|
|
956
914
|
case 4:
|
|
957
|
-
|
|
958
|
-
nft = (0,
|
|
959
|
-
|
|
915
|
+
_context16.t1 = _context16.sent;
|
|
916
|
+
nft = (0, _context16.t0)(_context16.t1);
|
|
917
|
+
_context16.next = 8;
|
|
960
918
|
return this.client.ContentObjectMetadata({
|
|
961
919
|
versionHash: nft.details.VersionHash,
|
|
962
920
|
metadataSubtree: "public/asset_metadata/nft",
|
|
963
921
|
produceLinkUrls: true
|
|
964
922
|
});
|
|
965
923
|
case 8:
|
|
966
|
-
|
|
967
|
-
if (
|
|
968
|
-
|
|
924
|
+
_context16.t2 = _context16.sent;
|
|
925
|
+
if (_context16.t2) {
|
|
926
|
+
_context16.next = 11;
|
|
969
927
|
break;
|
|
970
928
|
}
|
|
971
|
-
|
|
929
|
+
_context16.t2 = {};
|
|
972
930
|
case 11:
|
|
973
|
-
assetMetadata =
|
|
931
|
+
assetMetadata = _context16.t2;
|
|
974
932
|
nft.metadata = MergeWith({}, assetMetadata, nft.metadata, function (a, b) {
|
|
975
933
|
return b === null || b === "" ? a : undefined;
|
|
976
934
|
});
|
|
977
935
|
if (!this.localization) {
|
|
978
|
-
|
|
936
|
+
_context16.next = 21;
|
|
979
937
|
break;
|
|
980
938
|
}
|
|
981
|
-
|
|
939
|
+
_context16.next = 16;
|
|
982
940
|
return this.client.ContentObjectMetadata({
|
|
983
941
|
versionHash: nft.details.VersionHash,
|
|
984
942
|
metadataSubtree: UrlJoin("public", "asset_metadata", "localizations", this.localization, "nft"),
|
|
985
943
|
produceLinkUrls: true
|
|
986
944
|
});
|
|
987
945
|
case 16:
|
|
988
|
-
|
|
989
|
-
if (
|
|
990
|
-
|
|
946
|
+
_context16.t3 = _context16.sent;
|
|
947
|
+
if (_context16.t3) {
|
|
948
|
+
_context16.next = 19;
|
|
991
949
|
break;
|
|
992
950
|
}
|
|
993
|
-
|
|
951
|
+
_context16.t3 = {};
|
|
994
952
|
case 19:
|
|
995
|
-
localizedMetadata =
|
|
953
|
+
localizedMetadata = _context16.t3;
|
|
996
954
|
nft.metadata = MergeWith({}, nft.metadata, localizedMetadata, function (a, b) {
|
|
997
955
|
return b === null || b === "" ? a : undefined;
|
|
998
956
|
});
|
|
999
957
|
case 21:
|
|
1000
|
-
|
|
958
|
+
_context16.next = 23;
|
|
1001
959
|
return this.TenantConfiguration({
|
|
1002
960
|
contractAddress: contractAddress
|
|
1003
961
|
});
|
|
1004
962
|
case 23:
|
|
1005
|
-
nft.config =
|
|
1006
|
-
return
|
|
963
|
+
nft.config = _context16.sent;
|
|
964
|
+
return _context16.abrupt("return", FormatNFTMetadata(this, nft));
|
|
1007
965
|
case 25:
|
|
1008
966
|
case "end":
|
|
1009
|
-
return
|
|
967
|
+
return _context16.stop();
|
|
1010
968
|
}
|
|
1011
|
-
},
|
|
969
|
+
}, _callee16, this);
|
|
1012
970
|
}));
|
|
1013
|
-
return function (
|
|
1014
|
-
return
|
|
971
|
+
return function (_x8) {
|
|
972
|
+
return _ref35.apply(this, arguments);
|
|
1015
973
|
};
|
|
1016
974
|
}();
|
|
1017
975
|
|
|
@@ -1027,19 +985,19 @@ exports.NFT = /*#__PURE__*/function () {
|
|
|
1027
985
|
* @param {string} targetAddress - The address to which to transfer the NFT
|
|
1028
986
|
*/
|
|
1029
987
|
exports.TransferNFT = /*#__PURE__*/function () {
|
|
1030
|
-
var
|
|
988
|
+
var _ref37 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(_ref36) {
|
|
1031
989
|
var contractAddress, tokenId, targetAddress;
|
|
1032
|
-
return _regeneratorRuntime.wrap(function
|
|
1033
|
-
while (1) switch (
|
|
990
|
+
return _regeneratorRuntime.wrap(function _callee17$(_context17) {
|
|
991
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
1034
992
|
case 0:
|
|
1035
|
-
contractAddress =
|
|
993
|
+
contractAddress = _ref36.contractAddress, tokenId = _ref36.tokenId, targetAddress = _ref36.targetAddress;
|
|
1036
994
|
if (!(!targetAddress || !Utils.ValidAddress(targetAddress))) {
|
|
1037
|
-
|
|
995
|
+
_context17.next = 3;
|
|
1038
996
|
break;
|
|
1039
997
|
}
|
|
1040
998
|
throw Error("Eluvio Wallet Client: Invalid or missing target address in UserTransferNFT");
|
|
1041
999
|
case 3:
|
|
1042
|
-
|
|
1000
|
+
_context17.next = 5;
|
|
1043
1001
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1044
1002
|
path: UrlJoin("as", "wlt", "mkt", "xfer"),
|
|
1045
1003
|
method: "POST",
|
|
@@ -1053,15 +1011,15 @@ exports.TransferNFT = /*#__PURE__*/function () {
|
|
|
1053
1011
|
}
|
|
1054
1012
|
});
|
|
1055
1013
|
case 5:
|
|
1056
|
-
return
|
|
1014
|
+
return _context17.abrupt("return", _context17.sent);
|
|
1057
1015
|
case 6:
|
|
1058
1016
|
case "end":
|
|
1059
|
-
return
|
|
1017
|
+
return _context17.stop();
|
|
1060
1018
|
}
|
|
1061
|
-
},
|
|
1019
|
+
}, _callee17, this);
|
|
1062
1020
|
}));
|
|
1063
|
-
return function (
|
|
1064
|
-
return
|
|
1021
|
+
return function (_x9) {
|
|
1022
|
+
return _ref37.apply(this, arguments);
|
|
1065
1023
|
};
|
|
1066
1024
|
}();
|
|
1067
1025
|
|
|
@@ -1077,43 +1035,43 @@ exports.TransferNFT = /*#__PURE__*/function () {
|
|
|
1077
1035
|
* @returns {Promise<Object>} - The status of the listing
|
|
1078
1036
|
*/
|
|
1079
1037
|
exports.ListingStatus = /*#__PURE__*/function () {
|
|
1080
|
-
var
|
|
1038
|
+
var _ref39 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(_ref38) {
|
|
1081
1039
|
var listingId;
|
|
1082
|
-
return _regeneratorRuntime.wrap(function
|
|
1083
|
-
while (1) switch (
|
|
1040
|
+
return _regeneratorRuntime.wrap(function _callee18$(_context18) {
|
|
1041
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
1084
1042
|
case 0:
|
|
1085
|
-
listingId =
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1043
|
+
listingId = _ref38.listingId;
|
|
1044
|
+
_context18.prev = 1;
|
|
1045
|
+
_context18.t0 = Utils;
|
|
1046
|
+
_context18.next = 5;
|
|
1089
1047
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1090
1048
|
path: UrlJoin("as", "mkt", "status", listingId),
|
|
1091
1049
|
method: "GET"
|
|
1092
1050
|
});
|
|
1093
1051
|
case 5:
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
return
|
|
1052
|
+
_context18.t1 = _context18.sent;
|
|
1053
|
+
_context18.next = 8;
|
|
1054
|
+
return _context18.t0.ResponseToJson.call(_context18.t0, _context18.t1);
|
|
1097
1055
|
case 8:
|
|
1098
|
-
return
|
|
1056
|
+
return _context18.abrupt("return", _context18.sent);
|
|
1099
1057
|
case 11:
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
if (!(
|
|
1103
|
-
|
|
1058
|
+
_context18.prev = 11;
|
|
1059
|
+
_context18.t2 = _context18["catch"](1);
|
|
1060
|
+
if (!(_context18.t2.status === 404)) {
|
|
1061
|
+
_context18.next = 15;
|
|
1104
1062
|
break;
|
|
1105
1063
|
}
|
|
1106
|
-
return
|
|
1064
|
+
return _context18.abrupt("return");
|
|
1107
1065
|
case 15:
|
|
1108
|
-
throw
|
|
1066
|
+
throw _context18.t2;
|
|
1109
1067
|
case 16:
|
|
1110
1068
|
case "end":
|
|
1111
|
-
return
|
|
1069
|
+
return _context18.stop();
|
|
1112
1070
|
}
|
|
1113
|
-
},
|
|
1071
|
+
}, _callee18, this, [[1, 11]]);
|
|
1114
1072
|
}));
|
|
1115
|
-
return function (
|
|
1116
|
-
return
|
|
1073
|
+
return function (_x10) {
|
|
1074
|
+
return _ref39.apply(this, arguments);
|
|
1117
1075
|
};
|
|
1118
1076
|
}();
|
|
1119
1077
|
|
|
@@ -1129,35 +1087,35 @@ exports.ListingStatus = /*#__PURE__*/function () {
|
|
|
1129
1087
|
* @returns {Promise<Object>} - The listing
|
|
1130
1088
|
*/
|
|
1131
1089
|
exports.Listing = /*#__PURE__*/function () {
|
|
1132
|
-
var
|
|
1090
|
+
var _ref41 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(_ref40) {
|
|
1133
1091
|
var listingId;
|
|
1134
|
-
return _regeneratorRuntime.wrap(function
|
|
1135
|
-
while (1) switch (
|
|
1092
|
+
return _regeneratorRuntime.wrap(function _callee19$(_context19) {
|
|
1093
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
1136
1094
|
case 0:
|
|
1137
|
-
listingId =
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1095
|
+
listingId = _ref40.listingId;
|
|
1096
|
+
_context19.t0 = FormatNFT;
|
|
1097
|
+
_context19.t1 = this;
|
|
1098
|
+
_context19.t2 = Utils;
|
|
1099
|
+
_context19.next = 6;
|
|
1142
1100
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1143
1101
|
path: UrlJoin("as", "mkt", "l", listingId),
|
|
1144
1102
|
method: "GET"
|
|
1145
1103
|
});
|
|
1146
1104
|
case 6:
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
return
|
|
1105
|
+
_context19.t3 = _context19.sent;
|
|
1106
|
+
_context19.next = 9;
|
|
1107
|
+
return _context19.t2.ResponseToJson.call(_context19.t2, _context19.t3);
|
|
1150
1108
|
case 9:
|
|
1151
|
-
|
|
1152
|
-
return
|
|
1109
|
+
_context19.t4 = _context19.sent;
|
|
1110
|
+
return _context19.abrupt("return", (0, _context19.t0)(_context19.t1, _context19.t4));
|
|
1153
1111
|
case 11:
|
|
1154
1112
|
case "end":
|
|
1155
|
-
return
|
|
1113
|
+
return _context19.stop();
|
|
1156
1114
|
}
|
|
1157
|
-
},
|
|
1115
|
+
}, _callee19, this);
|
|
1158
1116
|
}));
|
|
1159
|
-
return function (
|
|
1160
|
-
return
|
|
1117
|
+
return function (_x11) {
|
|
1118
|
+
return _ref41.apply(this, arguments);
|
|
1161
1119
|
};
|
|
1162
1120
|
}();
|
|
1163
1121
|
|
|
@@ -1194,19 +1152,19 @@ exports.Listing = /*#__PURE__*/function () {
|
|
|
1194
1152
|
*
|
|
1195
1153
|
* @returns {Promise<Object>} - Results of the query and pagination info
|
|
1196
1154
|
*/
|
|
1197
|
-
exports.Listings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1198
|
-
var
|
|
1199
|
-
return _regeneratorRuntime.wrap(function
|
|
1200
|
-
while (1) switch (
|
|
1155
|
+
exports.Listings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20() {
|
|
1156
|
+
var _args20 = arguments;
|
|
1157
|
+
return _regeneratorRuntime.wrap(function _callee20$(_context20) {
|
|
1158
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
1201
1159
|
case 0:
|
|
1202
|
-
return
|
|
1160
|
+
return _context20.abrupt("return", this.FilteredQuery(_objectSpread({
|
|
1203
1161
|
mode: "listings"
|
|
1204
|
-
},
|
|
1162
|
+
}, _args20[0] || {})));
|
|
1205
1163
|
case 1:
|
|
1206
1164
|
case "end":
|
|
1207
|
-
return
|
|
1165
|
+
return _context20.stop();
|
|
1208
1166
|
}
|
|
1209
|
-
},
|
|
1167
|
+
}, _callee20, this);
|
|
1210
1168
|
}));
|
|
1211
1169
|
|
|
1212
1170
|
/**
|
|
@@ -1241,19 +1199,19 @@ exports.Listings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRunt
|
|
|
1241
1199
|
*
|
|
1242
1200
|
* @returns {Promise<Object>} - Statistics about listings. All prices in USD.
|
|
1243
1201
|
*/
|
|
1244
|
-
exports.ListingStats = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1245
|
-
var
|
|
1246
|
-
return _regeneratorRuntime.wrap(function
|
|
1247
|
-
while (1) switch (
|
|
1202
|
+
exports.ListingStats = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21() {
|
|
1203
|
+
var _args21 = arguments;
|
|
1204
|
+
return _regeneratorRuntime.wrap(function _callee21$(_context21) {
|
|
1205
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
1248
1206
|
case 0:
|
|
1249
|
-
return
|
|
1207
|
+
return _context21.abrupt("return", this.FilteredQuery(_objectSpread({
|
|
1250
1208
|
mode: "listing-stats"
|
|
1251
|
-
},
|
|
1209
|
+
}, _args21[0] || {})));
|
|
1252
1210
|
case 1:
|
|
1253
1211
|
case "end":
|
|
1254
|
-
return
|
|
1212
|
+
return _context21.stop();
|
|
1255
1213
|
}
|
|
1256
|
-
},
|
|
1214
|
+
}, _callee21, this);
|
|
1257
1215
|
}));
|
|
1258
1216
|
|
|
1259
1217
|
/**
|
|
@@ -1287,19 +1245,19 @@ exports.ListingStats = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerator
|
|
|
1287
1245
|
*
|
|
1288
1246
|
* @returns {Promise<Object>} - Results of the query and pagination info
|
|
1289
1247
|
*/
|
|
1290
|
-
exports.Sales = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1291
|
-
var
|
|
1292
|
-
return _regeneratorRuntime.wrap(function
|
|
1293
|
-
while (1) switch (
|
|
1248
|
+
exports.Sales = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22() {
|
|
1249
|
+
var _args22 = arguments;
|
|
1250
|
+
return _regeneratorRuntime.wrap(function _callee22$(_context22) {
|
|
1251
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
1294
1252
|
case 0:
|
|
1295
|
-
return
|
|
1253
|
+
return _context22.abrupt("return", this.FilteredQuery(_objectSpread({
|
|
1296
1254
|
mode: "sales"
|
|
1297
|
-
},
|
|
1255
|
+
}, _args22[0] || {})));
|
|
1298
1256
|
case 1:
|
|
1299
1257
|
case "end":
|
|
1300
|
-
return
|
|
1258
|
+
return _context22.stop();
|
|
1301
1259
|
}
|
|
1302
|
-
},
|
|
1260
|
+
}, _callee22, this);
|
|
1303
1261
|
}));
|
|
1304
1262
|
|
|
1305
1263
|
/**
|
|
@@ -1333,19 +1291,19 @@ exports.Sales = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
|
|
1333
1291
|
*
|
|
1334
1292
|
* @returns {Promise<Object>} - Results of the query and pagination info
|
|
1335
1293
|
*/
|
|
1336
|
-
exports.Transfers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1337
|
-
var
|
|
1338
|
-
return _regeneratorRuntime.wrap(function
|
|
1339
|
-
while (1) switch (
|
|
1294
|
+
exports.Transfers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23() {
|
|
1295
|
+
var _args23 = arguments;
|
|
1296
|
+
return _regeneratorRuntime.wrap(function _callee23$(_context23) {
|
|
1297
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
1340
1298
|
case 0:
|
|
1341
|
-
return
|
|
1299
|
+
return _context23.abrupt("return", this.FilteredQuery(_objectSpread({
|
|
1342
1300
|
mode: "transfers"
|
|
1343
|
-
},
|
|
1301
|
+
}, _args23[0] || {})));
|
|
1344
1302
|
case 1:
|
|
1345
1303
|
case "end":
|
|
1346
|
-
return
|
|
1304
|
+
return _context23.stop();
|
|
1347
1305
|
}
|
|
1348
|
-
},
|
|
1306
|
+
}, _callee23, this);
|
|
1349
1307
|
}));
|
|
1350
1308
|
|
|
1351
1309
|
/**
|
|
@@ -1379,19 +1337,19 @@ exports.Transfers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRun
|
|
|
1379
1337
|
*
|
|
1380
1338
|
* @returns {Promise<Object>} - Statistics about sales. All prices in USD.
|
|
1381
1339
|
*/
|
|
1382
|
-
exports.SalesStats = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1383
|
-
var
|
|
1384
|
-
return _regeneratorRuntime.wrap(function
|
|
1385
|
-
while (1) switch (
|
|
1340
|
+
exports.SalesStats = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24() {
|
|
1341
|
+
var _args24 = arguments;
|
|
1342
|
+
return _regeneratorRuntime.wrap(function _callee24$(_context24) {
|
|
1343
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
1386
1344
|
case 0:
|
|
1387
|
-
return
|
|
1345
|
+
return _context24.abrupt("return", this.FilteredQuery(_objectSpread({
|
|
1388
1346
|
mode: "sales-stats"
|
|
1389
|
-
},
|
|
1347
|
+
}, _args24[0] || {})));
|
|
1390
1348
|
case 1:
|
|
1391
1349
|
case "end":
|
|
1392
|
-
return
|
|
1350
|
+
return _context24.stop();
|
|
1393
1351
|
}
|
|
1394
|
-
},
|
|
1352
|
+
}, _callee24, this);
|
|
1395
1353
|
}));
|
|
1396
1354
|
|
|
1397
1355
|
/**
|
|
@@ -1407,68 +1365,68 @@ exports.SalesStats = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRu
|
|
|
1407
1365
|
* @returns {Promise<Array|Object>} - Returns a list of leaderboard rankings or, if userAddress is specified, ranking for that user.
|
|
1408
1366
|
*/
|
|
1409
1367
|
exports.Leaderboard = /*#__PURE__*/function () {
|
|
1410
|
-
var
|
|
1368
|
+
var _ref48 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25(_ref47) {
|
|
1411
1369
|
var userAddress,
|
|
1412
1370
|
marketplaceParams,
|
|
1413
1371
|
params,
|
|
1414
|
-
|
|
1415
|
-
return _regeneratorRuntime.wrap(function
|
|
1416
|
-
while (1) switch (
|
|
1372
|
+
_args25 = arguments;
|
|
1373
|
+
return _regeneratorRuntime.wrap(function _callee25$(_context25) {
|
|
1374
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
1417
1375
|
case 0:
|
|
1418
|
-
userAddress =
|
|
1376
|
+
userAddress = _ref47.userAddress, marketplaceParams = _ref47.marketplaceParams;
|
|
1419
1377
|
if (!userAddress) {
|
|
1420
|
-
|
|
1378
|
+
_context25.next = 20;
|
|
1421
1379
|
break;
|
|
1422
1380
|
}
|
|
1423
1381
|
params = {
|
|
1424
1382
|
addr: Utils.FormatAddress(userAddress)
|
|
1425
1383
|
};
|
|
1426
1384
|
if (!marketplaceParams) {
|
|
1427
|
-
|
|
1385
|
+
_context25.next = 10;
|
|
1428
1386
|
break;
|
|
1429
1387
|
}
|
|
1430
|
-
|
|
1431
|
-
|
|
1388
|
+
_context25.t0 = "tenant:eq:";
|
|
1389
|
+
_context25.next = 7;
|
|
1432
1390
|
return this.MarketplaceInfo({
|
|
1433
1391
|
marketplaceParams: marketplaceParams
|
|
1434
1392
|
});
|
|
1435
1393
|
case 7:
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
params.filter = [
|
|
1394
|
+
_context25.t1 = _context25.sent.tenantId;
|
|
1395
|
+
_context25.t2 = _context25.t0.concat.call(_context25.t0, _context25.t1);
|
|
1396
|
+
params.filter = [_context25.t2];
|
|
1439
1397
|
case 10:
|
|
1440
|
-
|
|
1441
|
-
|
|
1398
|
+
_context25.t4 = Utils;
|
|
1399
|
+
_context25.next = 13;
|
|
1442
1400
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1443
1401
|
path: UrlJoin("as", "wlt", "ranks"),
|
|
1444
1402
|
method: "GET",
|
|
1445
1403
|
queryParams: params
|
|
1446
1404
|
});
|
|
1447
1405
|
case 13:
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
return
|
|
1406
|
+
_context25.t5 = _context25.sent;
|
|
1407
|
+
_context25.next = 16;
|
|
1408
|
+
return _context25.t4.ResponseToJson.call(_context25.t4, _context25.t5);
|
|
1451
1409
|
case 16:
|
|
1452
|
-
|
|
1453
|
-
if (
|
|
1454
|
-
|
|
1410
|
+
_context25.t3 = _context25.sent;
|
|
1411
|
+
if (_context25.t3) {
|
|
1412
|
+
_context25.next = 19;
|
|
1455
1413
|
break;
|
|
1456
1414
|
}
|
|
1457
|
-
|
|
1415
|
+
_context25.t3 = [];
|
|
1458
1416
|
case 19:
|
|
1459
|
-
return
|
|
1417
|
+
return _context25.abrupt("return", _context25.t3[0]);
|
|
1460
1418
|
case 20:
|
|
1461
|
-
return
|
|
1419
|
+
return _context25.abrupt("return", this.FilteredQuery(_objectSpread({
|
|
1462
1420
|
mode: "leaderboard"
|
|
1463
|
-
},
|
|
1421
|
+
}, _args25[0] || {})));
|
|
1464
1422
|
case 21:
|
|
1465
1423
|
case "end":
|
|
1466
|
-
return
|
|
1424
|
+
return _context25.stop();
|
|
1467
1425
|
}
|
|
1468
|
-
},
|
|
1426
|
+
}, _callee25, this);
|
|
1469
1427
|
}));
|
|
1470
|
-
return function (
|
|
1471
|
-
return
|
|
1428
|
+
return function (_x12) {
|
|
1429
|
+
return _ref48.apply(this, arguments);
|
|
1472
1430
|
};
|
|
1473
1431
|
}();
|
|
1474
1432
|
|
|
@@ -1487,19 +1445,19 @@ exports.Leaderboard = /*#__PURE__*/function () {
|
|
|
1487
1445
|
* @returns {Promise<string>} - The listing ID of the created listing
|
|
1488
1446
|
*/
|
|
1489
1447
|
exports.CreateListing = /*#__PURE__*/function () {
|
|
1490
|
-
var
|
|
1448
|
+
var _ref50 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26(_ref49) {
|
|
1491
1449
|
var contractAddress, tokenId, price, listingId;
|
|
1492
|
-
return _regeneratorRuntime.wrap(function
|
|
1493
|
-
while (1) switch (
|
|
1450
|
+
return _regeneratorRuntime.wrap(function _callee26$(_context26) {
|
|
1451
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
1494
1452
|
case 0:
|
|
1495
|
-
contractAddress =
|
|
1453
|
+
contractAddress = _ref49.contractAddress, tokenId = _ref49.tokenId, price = _ref49.price, listingId = _ref49.listingId;
|
|
1496
1454
|
contractAddress = Utils.FormatAddress(contractAddress);
|
|
1497
1455
|
if (!listingId) {
|
|
1498
|
-
|
|
1456
|
+
_context26.next = 12;
|
|
1499
1457
|
break;
|
|
1500
1458
|
}
|
|
1501
|
-
|
|
1502
|
-
|
|
1459
|
+
_context26.t0 = Utils;
|
|
1460
|
+
_context26.next = 6;
|
|
1503
1461
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1504
1462
|
path: UrlJoin("as", "wlt", "mkt"),
|
|
1505
1463
|
method: "PUT",
|
|
@@ -1512,14 +1470,14 @@ exports.CreateListing = /*#__PURE__*/function () {
|
|
|
1512
1470
|
}
|
|
1513
1471
|
});
|
|
1514
1472
|
case 6:
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
return
|
|
1473
|
+
_context26.t1 = _context26.sent;
|
|
1474
|
+
_context26.next = 9;
|
|
1475
|
+
return _context26.t0.ResponseToFormat.call(_context26.t0, "text", _context26.t1);
|
|
1518
1476
|
case 9:
|
|
1519
|
-
return
|
|
1477
|
+
return _context26.abrupt("return", _context26.sent);
|
|
1520
1478
|
case 12:
|
|
1521
|
-
|
|
1522
|
-
|
|
1479
|
+
_context26.t2 = Utils;
|
|
1480
|
+
_context26.next = 15;
|
|
1523
1481
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1524
1482
|
path: UrlJoin("as", "wlt", "mkt"),
|
|
1525
1483
|
method: "POST",
|
|
@@ -1533,19 +1491,19 @@ exports.CreateListing = /*#__PURE__*/function () {
|
|
|
1533
1491
|
}
|
|
1534
1492
|
});
|
|
1535
1493
|
case 15:
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
return
|
|
1494
|
+
_context26.t3 = _context26.sent;
|
|
1495
|
+
_context26.next = 18;
|
|
1496
|
+
return _context26.t2.ResponseToJson.call(_context26.t2, _context26.t3);
|
|
1539
1497
|
case 18:
|
|
1540
|
-
return
|
|
1498
|
+
return _context26.abrupt("return", _context26.sent);
|
|
1541
1499
|
case 19:
|
|
1542
1500
|
case "end":
|
|
1543
|
-
return
|
|
1501
|
+
return _context26.stop();
|
|
1544
1502
|
}
|
|
1545
|
-
},
|
|
1503
|
+
}, _callee26, this);
|
|
1546
1504
|
}));
|
|
1547
|
-
return function (
|
|
1548
|
-
return
|
|
1505
|
+
return function (_x13) {
|
|
1506
|
+
return _ref50.apply(this, arguments);
|
|
1549
1507
|
};
|
|
1550
1508
|
}();
|
|
1551
1509
|
|
|
@@ -1559,13 +1517,13 @@ exports.CreateListing = /*#__PURE__*/function () {
|
|
|
1559
1517
|
* @param {string} listingId - The ID of the listing to remove
|
|
1560
1518
|
*/
|
|
1561
1519
|
exports.RemoveListing = /*#__PURE__*/function () {
|
|
1562
|
-
var
|
|
1520
|
+
var _ref52 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27(_ref51) {
|
|
1563
1521
|
var listingId;
|
|
1564
|
-
return _regeneratorRuntime.wrap(function
|
|
1565
|
-
while (1) switch (
|
|
1522
|
+
return _regeneratorRuntime.wrap(function _callee27$(_context27) {
|
|
1523
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
1566
1524
|
case 0:
|
|
1567
|
-
listingId =
|
|
1568
|
-
|
|
1525
|
+
listingId = _ref51.listingId;
|
|
1526
|
+
_context27.next = 3;
|
|
1569
1527
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1570
1528
|
path: UrlJoin("as", "wlt", "mkt", listingId),
|
|
1571
1529
|
method: "DELETE",
|
|
@@ -1575,12 +1533,12 @@ exports.RemoveListing = /*#__PURE__*/function () {
|
|
|
1575
1533
|
});
|
|
1576
1534
|
case 3:
|
|
1577
1535
|
case "end":
|
|
1578
|
-
return
|
|
1536
|
+
return _context27.stop();
|
|
1579
1537
|
}
|
|
1580
|
-
},
|
|
1538
|
+
}, _callee27, this);
|
|
1581
1539
|
}));
|
|
1582
|
-
return function (
|
|
1583
|
-
return
|
|
1540
|
+
return function (_x14) {
|
|
1541
|
+
return _ref52.apply(this, arguments);
|
|
1584
1542
|
};
|
|
1585
1543
|
}();
|
|
1586
1544
|
|
|
@@ -1596,25 +1554,25 @@ exports.RemoveListing = /*#__PURE__*/function () {
|
|
|
1596
1554
|
* @returns {Promise<Array<String>>} - A list of item names
|
|
1597
1555
|
*/
|
|
1598
1556
|
exports.SalesNames = /*#__PURE__*/function () {
|
|
1599
|
-
var
|
|
1557
|
+
var _ref54 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28(_ref53) {
|
|
1600
1558
|
var marketplaceParams, tenantId;
|
|
1601
|
-
return _regeneratorRuntime.wrap(function
|
|
1602
|
-
while (1) switch (
|
|
1559
|
+
return _regeneratorRuntime.wrap(function _callee28$(_context28) {
|
|
1560
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
1603
1561
|
case 0:
|
|
1604
|
-
marketplaceParams =
|
|
1562
|
+
marketplaceParams = _ref53.marketplaceParams;
|
|
1605
1563
|
if (!marketplaceParams) {
|
|
1606
|
-
|
|
1564
|
+
_context28.next = 5;
|
|
1607
1565
|
break;
|
|
1608
1566
|
}
|
|
1609
|
-
|
|
1567
|
+
_context28.next = 4;
|
|
1610
1568
|
return this.MarketplaceInfo({
|
|
1611
1569
|
marketplaceParams: marketplaceParams
|
|
1612
1570
|
});
|
|
1613
1571
|
case 4:
|
|
1614
|
-
tenantId =
|
|
1572
|
+
tenantId = _context28.sent.tenantId;
|
|
1615
1573
|
case 5:
|
|
1616
|
-
|
|
1617
|
-
|
|
1574
|
+
_context28.t0 = Utils;
|
|
1575
|
+
_context28.next = 8;
|
|
1618
1576
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1619
1577
|
path: UrlJoin("as", "mkt", "names", "hst"),
|
|
1620
1578
|
method: "GET",
|
|
@@ -1623,19 +1581,19 @@ exports.SalesNames = /*#__PURE__*/function () {
|
|
|
1623
1581
|
} : {}
|
|
1624
1582
|
});
|
|
1625
1583
|
case 8:
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
return
|
|
1584
|
+
_context28.t1 = _context28.sent;
|
|
1585
|
+
_context28.next = 11;
|
|
1586
|
+
return _context28.t0.ResponseToJson.call(_context28.t0, _context28.t1);
|
|
1629
1587
|
case 11:
|
|
1630
|
-
return
|
|
1588
|
+
return _context28.abrupt("return", _context28.sent);
|
|
1631
1589
|
case 12:
|
|
1632
1590
|
case "end":
|
|
1633
|
-
return
|
|
1591
|
+
return _context28.stop();
|
|
1634
1592
|
}
|
|
1635
|
-
},
|
|
1593
|
+
}, _callee28, this);
|
|
1636
1594
|
}));
|
|
1637
|
-
return function (
|
|
1638
|
-
return
|
|
1595
|
+
return function (_x15) {
|
|
1596
|
+
return _ref54.apply(this, arguments);
|
|
1639
1597
|
};
|
|
1640
1598
|
}();
|
|
1641
1599
|
|
|
@@ -1651,25 +1609,25 @@ exports.SalesNames = /*#__PURE__*/function () {
|
|
|
1651
1609
|
* @returns {Promise<Array<String>>} - A list of item names
|
|
1652
1610
|
*/
|
|
1653
1611
|
exports.ListingNames = /*#__PURE__*/function () {
|
|
1654
|
-
var
|
|
1612
|
+
var _ref56 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29(_ref55) {
|
|
1655
1613
|
var marketplaceParams, tenantId;
|
|
1656
|
-
return _regeneratorRuntime.wrap(function
|
|
1657
|
-
while (1) switch (
|
|
1614
|
+
return _regeneratorRuntime.wrap(function _callee29$(_context29) {
|
|
1615
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
1658
1616
|
case 0:
|
|
1659
|
-
marketplaceParams =
|
|
1617
|
+
marketplaceParams = _ref55.marketplaceParams;
|
|
1660
1618
|
if (!marketplaceParams) {
|
|
1661
|
-
|
|
1619
|
+
_context29.next = 5;
|
|
1662
1620
|
break;
|
|
1663
1621
|
}
|
|
1664
|
-
|
|
1622
|
+
_context29.next = 4;
|
|
1665
1623
|
return this.MarketplaceInfo({
|
|
1666
1624
|
marketplaceParams: marketplaceParams
|
|
1667
1625
|
});
|
|
1668
1626
|
case 4:
|
|
1669
|
-
tenantId =
|
|
1627
|
+
tenantId = _context29.sent.tenantId;
|
|
1670
1628
|
case 5:
|
|
1671
|
-
|
|
1672
|
-
|
|
1629
|
+
_context29.t0 = Utils;
|
|
1630
|
+
_context29.next = 8;
|
|
1673
1631
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1674
1632
|
path: UrlJoin("as", "mkt", "names"),
|
|
1675
1633
|
method: "GET",
|
|
@@ -1678,19 +1636,19 @@ exports.ListingNames = /*#__PURE__*/function () {
|
|
|
1678
1636
|
} : {}
|
|
1679
1637
|
});
|
|
1680
1638
|
case 8:
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
return
|
|
1684
|
-
case 11:
|
|
1685
|
-
return
|
|
1639
|
+
_context29.t1 = _context29.sent;
|
|
1640
|
+
_context29.next = 11;
|
|
1641
|
+
return _context29.t0.ResponseToJson.call(_context29.t0, _context29.t1);
|
|
1642
|
+
case 11:
|
|
1643
|
+
return _context29.abrupt("return", _context29.sent);
|
|
1686
1644
|
case 12:
|
|
1687
1645
|
case "end":
|
|
1688
|
-
return
|
|
1646
|
+
return _context29.stop();
|
|
1689
1647
|
}
|
|
1690
|
-
},
|
|
1648
|
+
}, _callee29, this);
|
|
1691
1649
|
}));
|
|
1692
|
-
return function (
|
|
1693
|
-
return
|
|
1650
|
+
return function (_x16) {
|
|
1651
|
+
return _ref56.apply(this, arguments);
|
|
1694
1652
|
};
|
|
1695
1653
|
}();
|
|
1696
1654
|
|
|
@@ -1704,14 +1662,14 @@ exports.ListingNames = /*#__PURE__*/function () {
|
|
|
1704
1662
|
* @returns {Promise<Array<String>>} - A list of item editions
|
|
1705
1663
|
*/
|
|
1706
1664
|
exports.ListingEditionNames = /*#__PURE__*/function () {
|
|
1707
|
-
var
|
|
1665
|
+
var _ref58 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30(_ref57) {
|
|
1708
1666
|
var displayName;
|
|
1709
|
-
return _regeneratorRuntime.wrap(function
|
|
1710
|
-
while (1) switch (
|
|
1667
|
+
return _regeneratorRuntime.wrap(function _callee30$(_context30) {
|
|
1668
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
1711
1669
|
case 0:
|
|
1712
|
-
displayName =
|
|
1713
|
-
|
|
1714
|
-
|
|
1670
|
+
displayName = _ref57.displayName;
|
|
1671
|
+
_context30.t0 = Utils;
|
|
1672
|
+
_context30.next = 4;
|
|
1715
1673
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1716
1674
|
path: UrlJoin("as", "mkt", "editions"),
|
|
1717
1675
|
queryParams: {
|
|
@@ -1720,19 +1678,19 @@ exports.ListingEditionNames = /*#__PURE__*/function () {
|
|
|
1720
1678
|
method: "GET"
|
|
1721
1679
|
});
|
|
1722
1680
|
case 4:
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
return
|
|
1681
|
+
_context30.t1 = _context30.sent;
|
|
1682
|
+
_context30.next = 7;
|
|
1683
|
+
return _context30.t0.ResponseToJson.call(_context30.t0, _context30.t1);
|
|
1726
1684
|
case 7:
|
|
1727
|
-
return
|
|
1685
|
+
return _context30.abrupt("return", _context30.sent);
|
|
1728
1686
|
case 8:
|
|
1729
1687
|
case "end":
|
|
1730
|
-
return
|
|
1688
|
+
return _context30.stop();
|
|
1731
1689
|
}
|
|
1732
|
-
},
|
|
1690
|
+
}, _callee30, this);
|
|
1733
1691
|
}));
|
|
1734
|
-
return function (
|
|
1735
|
-
return
|
|
1692
|
+
return function (_x17) {
|
|
1693
|
+
return _ref58.apply(this, arguments);
|
|
1736
1694
|
};
|
|
1737
1695
|
}();
|
|
1738
1696
|
|
|
@@ -1748,38 +1706,38 @@ exports.ListingEditionNames = /*#__PURE__*/function () {
|
|
|
1748
1706
|
*
|
|
1749
1707
|
* @returns {Promise<Array<String>>} - A list of valid attributes
|
|
1750
1708
|
*/
|
|
1751
|
-
exports.ListingAttributes = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1752
|
-
var
|
|
1709
|
+
exports.ListingAttributes = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31() {
|
|
1710
|
+
var _ref60,
|
|
1753
1711
|
marketplaceParams,
|
|
1754
1712
|
displayName,
|
|
1755
1713
|
filters,
|
|
1756
1714
|
attributes,
|
|
1757
|
-
|
|
1758
|
-
return _regeneratorRuntime.wrap(function
|
|
1759
|
-
while (1) switch (
|
|
1715
|
+
_args31 = arguments;
|
|
1716
|
+
return _regeneratorRuntime.wrap(function _callee31$(_context31) {
|
|
1717
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
1760
1718
|
case 0:
|
|
1761
|
-
|
|
1719
|
+
_ref60 = _args31.length > 0 && _args31[0] !== undefined ? _args31[0] : {}, marketplaceParams = _ref60.marketplaceParams, displayName = _ref60.displayName;
|
|
1762
1720
|
filters = [];
|
|
1763
1721
|
if (!marketplaceParams) {
|
|
1764
|
-
|
|
1722
|
+
_context31.next = 10;
|
|
1765
1723
|
break;
|
|
1766
1724
|
}
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1725
|
+
_context31.t0 = filters;
|
|
1726
|
+
_context31.t1 = "tenant:eq:";
|
|
1727
|
+
_context31.next = 7;
|
|
1770
1728
|
return this.MarketplaceInfo({
|
|
1771
1729
|
marketplaceParams: marketplaceParams
|
|
1772
1730
|
});
|
|
1773
1731
|
case 7:
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1732
|
+
_context31.t2 = _context31.sent.tenantId;
|
|
1733
|
+
_context31.t3 = _context31.t1.concat.call(_context31.t1, _context31.t2);
|
|
1734
|
+
_context31.t0.push.call(_context31.t0, _context31.t3);
|
|
1777
1735
|
case 10:
|
|
1778
1736
|
if (displayName) {
|
|
1779
1737
|
filters.push("nft/display_name:eq:".concat(displayName));
|
|
1780
1738
|
}
|
|
1781
|
-
|
|
1782
|
-
|
|
1739
|
+
_context31.t4 = Utils;
|
|
1740
|
+
_context31.next = 14;
|
|
1783
1741
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1784
1742
|
path: UrlJoin("as", "mkt", "attributes"),
|
|
1785
1743
|
method: "GET",
|
|
@@ -1788,27 +1746,27 @@ exports.ListingAttributes = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regene
|
|
|
1788
1746
|
}
|
|
1789
1747
|
});
|
|
1790
1748
|
case 14:
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
return
|
|
1749
|
+
_context31.t5 = _context31.sent;
|
|
1750
|
+
_context31.next = 17;
|
|
1751
|
+
return _context31.t4.ResponseToJson.call(_context31.t4, _context31.t5);
|
|
1794
1752
|
case 17:
|
|
1795
|
-
attributes =
|
|
1796
|
-
return
|
|
1797
|
-
var trait_type =
|
|
1798
|
-
values =
|
|
1753
|
+
attributes = _context31.sent;
|
|
1754
|
+
return _context31.abrupt("return", attributes.map(function (_ref61) {
|
|
1755
|
+
var trait_type = _ref61.trait_type,
|
|
1756
|
+
values = _ref61.values;
|
|
1799
1757
|
return {
|
|
1800
1758
|
name: trait_type,
|
|
1801
1759
|
values: values
|
|
1802
1760
|
};
|
|
1803
|
-
}).filter(function (
|
|
1804
|
-
var name =
|
|
1761
|
+
}).filter(function (_ref62) {
|
|
1762
|
+
var name = _ref62.name;
|
|
1805
1763
|
return !["Content Fabric Hash", "Total Minted Supply", "Creator"].includes(name);
|
|
1806
1764
|
}));
|
|
1807
1765
|
case 19:
|
|
1808
1766
|
case "end":
|
|
1809
|
-
return
|
|
1767
|
+
return _context31.stop();
|
|
1810
1768
|
}
|
|
1811
|
-
},
|
|
1769
|
+
}, _callee31, this);
|
|
1812
1770
|
}));
|
|
1813
1771
|
|
|
1814
1772
|
/* PURCHASE / CLAIM */
|
|
@@ -1825,19 +1783,19 @@ exports.ListingAttributes = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regene
|
|
|
1825
1783
|
* @param {string=} email - Email address of the user. If specified, this will bind the user to the tenant of the specified marketplace
|
|
1826
1784
|
*/
|
|
1827
1785
|
exports.ClaimItem = /*#__PURE__*/function () {
|
|
1828
|
-
var
|
|
1786
|
+
var _ref64 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32(_ref63) {
|
|
1829
1787
|
var marketplaceParams, sku, email, marketplaceInfo;
|
|
1830
|
-
return _regeneratorRuntime.wrap(function
|
|
1831
|
-
while (1) switch (
|
|
1788
|
+
return _regeneratorRuntime.wrap(function _callee32$(_context32) {
|
|
1789
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
1832
1790
|
case 0:
|
|
1833
|
-
marketplaceParams =
|
|
1834
|
-
|
|
1791
|
+
marketplaceParams = _ref63.marketplaceParams, sku = _ref63.sku, email = _ref63.email;
|
|
1792
|
+
_context32.next = 3;
|
|
1835
1793
|
return this.MarketplaceInfo({
|
|
1836
1794
|
marketplaceParams: marketplaceParams
|
|
1837
1795
|
});
|
|
1838
1796
|
case 3:
|
|
1839
|
-
marketplaceInfo =
|
|
1840
|
-
|
|
1797
|
+
marketplaceInfo = _context32.sent;
|
|
1798
|
+
_context32.next = 6;
|
|
1841
1799
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1842
1800
|
method: "POST",
|
|
1843
1801
|
path: UrlJoin("as", "wlt", "act", marketplaceInfo.tenant_id),
|
|
@@ -1853,117 +1811,12 @@ exports.ClaimItem = /*#__PURE__*/function () {
|
|
|
1853
1811
|
});
|
|
1854
1812
|
case 6:
|
|
1855
1813
|
case "end":
|
|
1856
|
-
return
|
|
1857
|
-
}
|
|
1858
|
-
}, _callee33, this);
|
|
1859
|
-
}));
|
|
1860
|
-
return function (_x19) {
|
|
1861
|
-
return _ref66.apply(this, arguments);
|
|
1862
|
-
};
|
|
1863
|
-
}();
|
|
1864
|
-
|
|
1865
|
-
/**
|
|
1866
|
-
* Redirect to the wallet app to purchase the specified item from the specified marketplace
|
|
1867
|
-
*
|
|
1868
|
-
* Use the <a href="#.PurchaseStatus">PurchaseStatus</a> method to check minting status after purchasing
|
|
1869
|
-
*
|
|
1870
|
-
* @methodGroup Purchase
|
|
1871
|
-
* @namedParams
|
|
1872
|
-
* @param {Object} marketplaceParams - Parameters of the marketplace
|
|
1873
|
-
* @param {string} sku - The SKU of the item to claim
|
|
1874
|
-
* @param {string=} confirmationId - Confirmation ID with which to reference this purchase. If not specified, a confirmation ID will be automatically generated. On success, the user will be returned to `successUrl` with the `confirmationId` as a URL parameter.
|
|
1875
|
-
* @param {string} successUrl - The URL to redirect back to upon successful purchase
|
|
1876
|
-
* @param {string} cancelUrl - The URL to redirect back to upon cancellation of purchase
|
|
1877
|
-
*/
|
|
1878
|
-
exports.PurchaseItem = /*#__PURE__*/function () {
|
|
1879
|
-
var _ref68 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34(_ref67) {
|
|
1880
|
-
var marketplaceParams, sku, confirmationId, successUrl, cancelUrl, marketplaceInfo;
|
|
1881
|
-
return _regeneratorRuntime.wrap(function _callee34$(_context34) {
|
|
1882
|
-
while (1) switch (_context34.prev = _context34.next) {
|
|
1883
|
-
case 0:
|
|
1884
|
-
marketplaceParams = _ref67.marketplaceParams, sku = _ref67.sku, confirmationId = _ref67.confirmationId, successUrl = _ref67.successUrl, cancelUrl = _ref67.cancelUrl;
|
|
1885
|
-
_context34.next = 3;
|
|
1886
|
-
return this.MarketplaceInfo({
|
|
1887
|
-
marketplaceParams: marketplaceParams
|
|
1888
|
-
});
|
|
1889
|
-
case 3:
|
|
1890
|
-
marketplaceInfo = _context34.sent;
|
|
1891
|
-
window.location.href = this.FlowURL({
|
|
1892
|
-
type: "action",
|
|
1893
|
-
flow: "purchase",
|
|
1894
|
-
marketplaceId: marketplaceInfo.marketplaceId,
|
|
1895
|
-
parameters: {
|
|
1896
|
-
sku: sku,
|
|
1897
|
-
confirmationId: confirmationId,
|
|
1898
|
-
successUrl: successUrl,
|
|
1899
|
-
cancelUrl: cancelUrl,
|
|
1900
|
-
login: true,
|
|
1901
|
-
auth: this.ClientAuthToken()
|
|
1902
|
-
}
|
|
1903
|
-
});
|
|
1904
|
-
case 5:
|
|
1905
|
-
case "end":
|
|
1906
|
-
return _context34.stop();
|
|
1907
|
-
}
|
|
1908
|
-
}, _callee34, this);
|
|
1909
|
-
}));
|
|
1910
|
-
return function (_x20) {
|
|
1911
|
-
return _ref68.apply(this, arguments);
|
|
1912
|
-
};
|
|
1913
|
-
}();
|
|
1914
|
-
|
|
1915
|
-
/**
|
|
1916
|
-
* Redirect to the wallet app to purchase the specified listing
|
|
1917
|
-
*
|
|
1918
|
-
* Use the <a href="#.PurchaseStatus">ListingPurchaseStatus</a> method to check minting status after purchasing
|
|
1919
|
-
*
|
|
1920
|
-
* @methodGroup Purchase
|
|
1921
|
-
* @namedParams
|
|
1922
|
-
* @param {Object=} marketplaceParams - Parameters of the marketplace
|
|
1923
|
-
* @param {string} listingId - The SKU of the item to claim
|
|
1924
|
-
* @param {string=} confirmationId - Confirmation ID with which to reference this purchase. If not specified, a confirmation ID will be automatically generated. On success, the user will be returned to `successUrl` with the `confirmationId` as a URL parameter.
|
|
1925
|
-
* @param {string} successUrl - The URL to redirect back to upon successful purchase
|
|
1926
|
-
* @param {string} cancelUrl - The URL to redirect back to upon cancellation of purchase
|
|
1927
|
-
*/
|
|
1928
|
-
exports.PurchaseListing = /*#__PURE__*/function () {
|
|
1929
|
-
var _ref70 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35(_ref69) {
|
|
1930
|
-
var marketplaceParams, listingId, confirmationId, successUrl, cancelUrl, marketplaceInfo;
|
|
1931
|
-
return _regeneratorRuntime.wrap(function _callee35$(_context35) {
|
|
1932
|
-
while (1) switch (_context35.prev = _context35.next) {
|
|
1933
|
-
case 0:
|
|
1934
|
-
marketplaceParams = _ref69.marketplaceParams, listingId = _ref69.listingId, confirmationId = _ref69.confirmationId, successUrl = _ref69.successUrl, cancelUrl = _ref69.cancelUrl;
|
|
1935
|
-
if (!marketplaceParams) {
|
|
1936
|
-
_context35.next = 5;
|
|
1937
|
-
break;
|
|
1938
|
-
}
|
|
1939
|
-
_context35.next = 4;
|
|
1940
|
-
return this.MarketplaceInfo({
|
|
1941
|
-
marketplaceParams: marketplaceParams
|
|
1942
|
-
});
|
|
1943
|
-
case 4:
|
|
1944
|
-
marketplaceInfo = _context35.sent;
|
|
1945
|
-
case 5:
|
|
1946
|
-
window.location.href = this.FlowURL({
|
|
1947
|
-
type: "action",
|
|
1948
|
-
flow: "purchase",
|
|
1949
|
-
marketplaceId: marketplaceInfo && marketplaceInfo.marketplaceId,
|
|
1950
|
-
parameters: {
|
|
1951
|
-
listingId: listingId,
|
|
1952
|
-
confirmationId: confirmationId,
|
|
1953
|
-
successUrl: successUrl,
|
|
1954
|
-
cancelUrl: cancelUrl,
|
|
1955
|
-
login: true,
|
|
1956
|
-
auth: this.ClientAuthToken()
|
|
1957
|
-
}
|
|
1958
|
-
});
|
|
1959
|
-
case 6:
|
|
1960
|
-
case "end":
|
|
1961
|
-
return _context35.stop();
|
|
1814
|
+
return _context32.stop();
|
|
1962
1815
|
}
|
|
1963
|
-
},
|
|
1816
|
+
}, _callee32, this);
|
|
1964
1817
|
}));
|
|
1965
|
-
return function (
|
|
1966
|
-
return
|
|
1818
|
+
return function (_x18) {
|
|
1819
|
+
return _ref64.apply(this, arguments);
|
|
1967
1820
|
};
|
|
1968
1821
|
}();
|
|
1969
1822
|
|
|
@@ -1980,51 +1833,51 @@ exports.PurchaseListing = /*#__PURE__*/function () {
|
|
|
1980
1833
|
* @returns {Promise<Object>} - The status of the purchase
|
|
1981
1834
|
*/
|
|
1982
1835
|
exports.ListingPurchaseStatus = /*#__PURE__*/function () {
|
|
1983
|
-
var
|
|
1836
|
+
var _ref66 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33(_ref65) {
|
|
1984
1837
|
var listingId, confirmationId, listingStatus, statuses;
|
|
1985
|
-
return _regeneratorRuntime.wrap(function
|
|
1986
|
-
while (1) switch (
|
|
1838
|
+
return _regeneratorRuntime.wrap(function _callee33$(_context33) {
|
|
1839
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
1987
1840
|
case 0:
|
|
1988
|
-
listingId =
|
|
1989
|
-
|
|
1990
|
-
|
|
1841
|
+
listingId = _ref65.listingId, confirmationId = _ref65.confirmationId;
|
|
1842
|
+
_context33.prev = 1;
|
|
1843
|
+
_context33.next = 4;
|
|
1991
1844
|
return this.ListingStatus({
|
|
1992
1845
|
listingId: listingId
|
|
1993
1846
|
});
|
|
1994
1847
|
case 4:
|
|
1995
|
-
listingStatus =
|
|
1848
|
+
listingStatus = _context33.sent;
|
|
1996
1849
|
if (listingStatus) {
|
|
1997
|
-
|
|
1850
|
+
_context33.next = 7;
|
|
1998
1851
|
break;
|
|
1999
1852
|
}
|
|
2000
1853
|
throw Error("Unable to find info for listing " + listingId);
|
|
2001
1854
|
case 7:
|
|
2002
|
-
|
|
1855
|
+
_context33.next = 9;
|
|
2003
1856
|
return this.MintingStatus({
|
|
2004
1857
|
tenantId: listingStatus.tenant
|
|
2005
1858
|
});
|
|
2006
1859
|
case 9:
|
|
2007
|
-
statuses =
|
|
2008
|
-
return
|
|
1860
|
+
statuses = _context33.sent;
|
|
1861
|
+
return _context33.abrupt("return", statuses.find(function (status) {
|
|
2009
1862
|
return status.op === "nft-transfer" && status.extra && status.extra[0] === confirmationId;
|
|
2010
1863
|
}) || {
|
|
2011
1864
|
status: "none"
|
|
2012
1865
|
});
|
|
2013
1866
|
case 13:
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
this.Log(
|
|
2017
|
-
return
|
|
1867
|
+
_context33.prev = 13;
|
|
1868
|
+
_context33.t0 = _context33["catch"](1);
|
|
1869
|
+
this.Log(_context33.t0, true);
|
|
1870
|
+
return _context33.abrupt("return", {
|
|
2018
1871
|
status: "unknown"
|
|
2019
1872
|
});
|
|
2020
1873
|
case 17:
|
|
2021
1874
|
case "end":
|
|
2022
|
-
return
|
|
1875
|
+
return _context33.stop();
|
|
2023
1876
|
}
|
|
2024
|
-
},
|
|
1877
|
+
}, _callee33, this, [[1, 13]]);
|
|
2025
1878
|
}));
|
|
2026
|
-
return function (
|
|
2027
|
-
return
|
|
1879
|
+
return function (_x19) {
|
|
1880
|
+
return _ref66.apply(this, arguments);
|
|
2028
1881
|
};
|
|
2029
1882
|
}();
|
|
2030
1883
|
|
|
@@ -2039,45 +1892,45 @@ exports.ListingPurchaseStatus = /*#__PURE__*/function () {
|
|
|
2039
1892
|
* @returns {Promise<Object>} - The minting status of the purchaseed item(s)
|
|
2040
1893
|
*/
|
|
2041
1894
|
exports.PurchaseStatus = /*#__PURE__*/function () {
|
|
2042
|
-
var
|
|
1895
|
+
var _ref68 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34(_ref67) {
|
|
2043
1896
|
var marketplaceParams, confirmationId, marketplaceInfo, statuses;
|
|
2044
|
-
return _regeneratorRuntime.wrap(function
|
|
2045
|
-
while (1) switch (
|
|
1897
|
+
return _regeneratorRuntime.wrap(function _callee34$(_context34) {
|
|
1898
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
2046
1899
|
case 0:
|
|
2047
|
-
marketplaceParams =
|
|
2048
|
-
|
|
2049
|
-
|
|
1900
|
+
marketplaceParams = _ref67.marketplaceParams, confirmationId = _ref67.confirmationId;
|
|
1901
|
+
_context34.prev = 1;
|
|
1902
|
+
_context34.next = 4;
|
|
2050
1903
|
return this.MarketplaceInfo({
|
|
2051
1904
|
marketplaceParams: marketplaceParams
|
|
2052
1905
|
});
|
|
2053
1906
|
case 4:
|
|
2054
|
-
marketplaceInfo =
|
|
2055
|
-
|
|
1907
|
+
marketplaceInfo = _context34.sent;
|
|
1908
|
+
_context34.next = 7;
|
|
2056
1909
|
return this.MintingStatus({
|
|
2057
1910
|
tenantId: marketplaceInfo.tenant_id
|
|
2058
1911
|
});
|
|
2059
1912
|
case 7:
|
|
2060
|
-
statuses =
|
|
2061
|
-
return
|
|
1913
|
+
statuses = _context34.sent;
|
|
1914
|
+
return _context34.abrupt("return", statuses.find(function (status) {
|
|
2062
1915
|
return status.op === "nft-buy" && status.confirmationId === confirmationId;
|
|
2063
1916
|
}) || {
|
|
2064
1917
|
status: "none"
|
|
2065
1918
|
});
|
|
2066
1919
|
case 11:
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
this.Log(
|
|
2070
|
-
return
|
|
1920
|
+
_context34.prev = 11;
|
|
1921
|
+
_context34.t0 = _context34["catch"](1);
|
|
1922
|
+
this.Log(_context34.t0, true);
|
|
1923
|
+
return _context34.abrupt("return", {
|
|
2071
1924
|
status: "unknown"
|
|
2072
1925
|
});
|
|
2073
1926
|
case 15:
|
|
2074
1927
|
case "end":
|
|
2075
|
-
return
|
|
1928
|
+
return _context34.stop();
|
|
2076
1929
|
}
|
|
2077
|
-
},
|
|
1930
|
+
}, _callee34, this, [[1, 11]]);
|
|
2078
1931
|
}));
|
|
2079
|
-
return function (
|
|
2080
|
-
return
|
|
1932
|
+
return function (_x20) {
|
|
1933
|
+
return _ref68.apply(this, arguments);
|
|
2081
1934
|
};
|
|
2082
1935
|
}();
|
|
2083
1936
|
|
|
@@ -2092,45 +1945,45 @@ exports.PurchaseStatus = /*#__PURE__*/function () {
|
|
|
2092
1945
|
* @returns {Promise<Object>} - The minting status of the claim
|
|
2093
1946
|
*/
|
|
2094
1947
|
exports.ClaimStatus = /*#__PURE__*/function () {
|
|
2095
|
-
var
|
|
1948
|
+
var _ref70 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35(_ref69) {
|
|
2096
1949
|
var marketplaceParams, sku, marketplaceInfo, statuses;
|
|
2097
|
-
return _regeneratorRuntime.wrap(function
|
|
2098
|
-
while (1) switch (
|
|
1950
|
+
return _regeneratorRuntime.wrap(function _callee35$(_context35) {
|
|
1951
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
2099
1952
|
case 0:
|
|
2100
|
-
marketplaceParams =
|
|
2101
|
-
|
|
2102
|
-
|
|
1953
|
+
marketplaceParams = _ref69.marketplaceParams, sku = _ref69.sku;
|
|
1954
|
+
_context35.prev = 1;
|
|
1955
|
+
_context35.next = 4;
|
|
2103
1956
|
return this.MarketplaceInfo({
|
|
2104
1957
|
marketplaceParams: marketplaceParams
|
|
2105
1958
|
});
|
|
2106
1959
|
case 4:
|
|
2107
|
-
marketplaceInfo =
|
|
2108
|
-
|
|
1960
|
+
marketplaceInfo = _context35.sent;
|
|
1961
|
+
_context35.next = 7;
|
|
2109
1962
|
return this.MintingStatus({
|
|
2110
1963
|
tenantId: marketplaceInfo.tenantId
|
|
2111
1964
|
});
|
|
2112
1965
|
case 7:
|
|
2113
|
-
statuses =
|
|
2114
|
-
return
|
|
1966
|
+
statuses = _context35.sent;
|
|
1967
|
+
return _context35.abrupt("return", statuses.find(function (status) {
|
|
2115
1968
|
return status.op === "nft-claim" && status.marketplaceId === marketplaceInfo.marketplaceId && status.confirmationId === sku;
|
|
2116
1969
|
}) || {
|
|
2117
1970
|
status: "none"
|
|
2118
1971
|
});
|
|
2119
1972
|
case 11:
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
this.Log(
|
|
2123
|
-
return
|
|
1973
|
+
_context35.prev = 11;
|
|
1974
|
+
_context35.t0 = _context35["catch"](1);
|
|
1975
|
+
this.Log(_context35.t0, true);
|
|
1976
|
+
return _context35.abrupt("return", {
|
|
2124
1977
|
status: "unknown"
|
|
2125
1978
|
});
|
|
2126
1979
|
case 15:
|
|
2127
1980
|
case "end":
|
|
2128
|
-
return
|
|
1981
|
+
return _context35.stop();
|
|
2129
1982
|
}
|
|
2130
|
-
},
|
|
1983
|
+
}, _callee35, this, [[1, 11]]);
|
|
2131
1984
|
}));
|
|
2132
|
-
return function (
|
|
2133
|
-
return
|
|
1985
|
+
return function (_x21) {
|
|
1986
|
+
return _ref70.apply(this, arguments);
|
|
2134
1987
|
};
|
|
2135
1988
|
}();
|
|
2136
1989
|
|
|
@@ -2145,45 +1998,45 @@ exports.ClaimStatus = /*#__PURE__*/function () {
|
|
|
2145
1998
|
* @returns {Promise<Object>} - The status of the pack opening
|
|
2146
1999
|
*/
|
|
2147
2000
|
exports.PackOpenStatus = /*#__PURE__*/function () {
|
|
2148
|
-
var
|
|
2001
|
+
var _ref72 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36(_ref71) {
|
|
2149
2002
|
var contractAddress, tokenId, tenantConfig, statuses;
|
|
2150
|
-
return _regeneratorRuntime.wrap(function
|
|
2151
|
-
while (1) switch (
|
|
2003
|
+
return _regeneratorRuntime.wrap(function _callee36$(_context36) {
|
|
2004
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
2152
2005
|
case 0:
|
|
2153
|
-
contractAddress =
|
|
2154
|
-
|
|
2155
|
-
|
|
2006
|
+
contractAddress = _ref71.contractAddress, tokenId = _ref71.tokenId;
|
|
2007
|
+
_context36.prev = 1;
|
|
2008
|
+
_context36.next = 4;
|
|
2156
2009
|
return this.TenantConfiguration({
|
|
2157
2010
|
contractAddress: contractAddress
|
|
2158
2011
|
});
|
|
2159
2012
|
case 4:
|
|
2160
|
-
tenantConfig =
|
|
2161
|
-
|
|
2013
|
+
tenantConfig = _context36.sent;
|
|
2014
|
+
_context36.next = 7;
|
|
2162
2015
|
return this.MintingStatus({
|
|
2163
2016
|
tenantId: tenantConfig.tenant
|
|
2164
2017
|
});
|
|
2165
2018
|
case 7:
|
|
2166
|
-
statuses =
|
|
2167
|
-
return
|
|
2019
|
+
statuses = _context36.sent;
|
|
2020
|
+
return _context36.abrupt("return", statuses.find(function (status) {
|
|
2168
2021
|
return status.op === "nft-open" && Utils.EqualAddress(contractAddress, status.address) && status.tokenId === tokenId;
|
|
2169
2022
|
}) || {
|
|
2170
2023
|
status: "none"
|
|
2171
2024
|
});
|
|
2172
2025
|
case 11:
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
this.Log(
|
|
2176
|
-
return
|
|
2026
|
+
_context36.prev = 11;
|
|
2027
|
+
_context36.t0 = _context36["catch"](1);
|
|
2028
|
+
this.Log(_context36.t0, true);
|
|
2029
|
+
return _context36.abrupt("return", {
|
|
2177
2030
|
status: "unknown"
|
|
2178
2031
|
});
|
|
2179
2032
|
case 15:
|
|
2180
2033
|
case "end":
|
|
2181
|
-
return
|
|
2034
|
+
return _context36.stop();
|
|
2182
2035
|
}
|
|
2183
|
-
},
|
|
2036
|
+
}, _callee36, this, [[1, 11]]);
|
|
2184
2037
|
}));
|
|
2185
|
-
return function (
|
|
2186
|
-
return
|
|
2038
|
+
return function (_x22) {
|
|
2039
|
+
return _ref72.apply(this, arguments);
|
|
2187
2040
|
};
|
|
2188
2041
|
}();
|
|
2189
2042
|
|
|
@@ -2198,39 +2051,39 @@ exports.PackOpenStatus = /*#__PURE__*/function () {
|
|
|
2198
2051
|
* @returns {Promise<Object>} - The status of the collection redemption
|
|
2199
2052
|
*/
|
|
2200
2053
|
exports.CollectionRedemptionStatus = /*#__PURE__*/function () {
|
|
2201
|
-
var
|
|
2054
|
+
var _ref74 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee37(_ref73) {
|
|
2202
2055
|
var marketplaceParams, confirmationId, statuses;
|
|
2203
|
-
return _regeneratorRuntime.wrap(function
|
|
2204
|
-
while (1) switch (
|
|
2056
|
+
return _regeneratorRuntime.wrap(function _callee37$(_context37) {
|
|
2057
|
+
while (1) switch (_context37.prev = _context37.next) {
|
|
2205
2058
|
case 0:
|
|
2206
|
-
marketplaceParams =
|
|
2207
|
-
|
|
2208
|
-
|
|
2059
|
+
marketplaceParams = _ref73.marketplaceParams, confirmationId = _ref73.confirmationId;
|
|
2060
|
+
_context37.prev = 1;
|
|
2061
|
+
_context37.next = 4;
|
|
2209
2062
|
return this.MintingStatus({
|
|
2210
2063
|
marketplaceParams: marketplaceParams
|
|
2211
2064
|
});
|
|
2212
2065
|
case 4:
|
|
2213
|
-
statuses =
|
|
2214
|
-
return
|
|
2066
|
+
statuses = _context37.sent;
|
|
2067
|
+
return _context37.abrupt("return", statuses.find(function (status) {
|
|
2215
2068
|
return status.op === "nft-redeem" && status.confirmationId === confirmationId;
|
|
2216
2069
|
}) || {
|
|
2217
2070
|
status: "none"
|
|
2218
2071
|
});
|
|
2219
2072
|
case 8:
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
this.Log(
|
|
2223
|
-
return
|
|
2073
|
+
_context37.prev = 8;
|
|
2074
|
+
_context37.t0 = _context37["catch"](1);
|
|
2075
|
+
this.Log(_context37.t0, true);
|
|
2076
|
+
return _context37.abrupt("return", {
|
|
2224
2077
|
status: "unknown"
|
|
2225
2078
|
});
|
|
2226
2079
|
case 12:
|
|
2227
2080
|
case "end":
|
|
2228
|
-
return
|
|
2081
|
+
return _context37.stop();
|
|
2229
2082
|
}
|
|
2230
|
-
},
|
|
2083
|
+
}, _callee37, this, [[1, 8]]);
|
|
2231
2084
|
}));
|
|
2232
|
-
return function (
|
|
2233
|
-
return
|
|
2085
|
+
return function (_x23) {
|
|
2086
|
+
return _ref74.apply(this, arguments);
|
|
2234
2087
|
};
|
|
2235
2088
|
}();
|
|
2236
2089
|
|
|
@@ -2248,51 +2101,51 @@ exports.CollectionRedemptionStatus = /*#__PURE__*/function () {
|
|
|
2248
2101
|
* @returns {Promise<Object>} - The status of the offer redemption
|
|
2249
2102
|
*/
|
|
2250
2103
|
exports.RedeemableOfferStatus = /*#__PURE__*/function () {
|
|
2251
|
-
var
|
|
2104
|
+
var _ref76 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee38(_ref75) {
|
|
2252
2105
|
var tenantId, marketplaceParams, contractAddress, tokenId, offerId, statuses;
|
|
2253
|
-
return _regeneratorRuntime.wrap(function
|
|
2254
|
-
while (1) switch (
|
|
2106
|
+
return _regeneratorRuntime.wrap(function _callee38$(_context38) {
|
|
2107
|
+
while (1) switch (_context38.prev = _context38.next) {
|
|
2255
2108
|
case 0:
|
|
2256
|
-
tenantId =
|
|
2257
|
-
|
|
2258
|
-
|
|
2109
|
+
tenantId = _ref75.tenantId, marketplaceParams = _ref75.marketplaceParams, contractAddress = _ref75.contractAddress, tokenId = _ref75.tokenId, offerId = _ref75.offerId;
|
|
2110
|
+
_context38.prev = 1;
|
|
2111
|
+
_context38.next = 4;
|
|
2259
2112
|
return this.MintingStatus({
|
|
2260
2113
|
marketplaceParams: marketplaceParams,
|
|
2261
2114
|
tenantId: tenantId
|
|
2262
2115
|
});
|
|
2263
2116
|
case 4:
|
|
2264
|
-
statuses =
|
|
2117
|
+
statuses = _context38.sent;
|
|
2265
2118
|
contractAddress = Utils.FormatAddress(contractAddress);
|
|
2266
|
-
return
|
|
2119
|
+
return _context38.abrupt("return", statuses.find(function (status) {
|
|
2267
2120
|
return status.op === "nft-offer-redeem" && Utils.EqualAddress(status.address, contractAddress) && status.tokenId === (tokenId || "").toString() && status.extra && typeof status.extra[0] !== "undefined" && status.extra[0].toString() === (offerId || "").toString();
|
|
2268
2121
|
}) || {
|
|
2269
2122
|
status: "none"
|
|
2270
2123
|
});
|
|
2271
2124
|
case 9:
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
this.Log(
|
|
2275
|
-
return
|
|
2125
|
+
_context38.prev = 9;
|
|
2126
|
+
_context38.t0 = _context38["catch"](1);
|
|
2127
|
+
this.Log(_context38.t0, true);
|
|
2128
|
+
return _context38.abrupt("return", {
|
|
2276
2129
|
status: "unknown"
|
|
2277
2130
|
});
|
|
2278
2131
|
case 13:
|
|
2279
2132
|
case "end":
|
|
2280
|
-
return
|
|
2133
|
+
return _context38.stop();
|
|
2281
2134
|
}
|
|
2282
|
-
},
|
|
2135
|
+
}, _callee38, this, [[1, 9]]);
|
|
2283
2136
|
}));
|
|
2284
|
-
return function (
|
|
2285
|
-
return
|
|
2137
|
+
return function (_x24) {
|
|
2138
|
+
return _ref76.apply(this, arguments);
|
|
2286
2139
|
};
|
|
2287
2140
|
}();
|
|
2288
2141
|
exports.RedeemableCustomFulfillmentInfo = /*#__PURE__*/function () {
|
|
2289
|
-
var
|
|
2142
|
+
var _ref78 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee39(_ref77) {
|
|
2290
2143
|
var redeemableTransactionId;
|
|
2291
|
-
return _regeneratorRuntime.wrap(function
|
|
2292
|
-
while (1) switch (
|
|
2144
|
+
return _regeneratorRuntime.wrap(function _callee39$(_context39) {
|
|
2145
|
+
while (1) switch (_context39.prev = _context39.next) {
|
|
2293
2146
|
case 0:
|
|
2294
|
-
redeemableTransactionId =
|
|
2295
|
-
|
|
2147
|
+
redeemableTransactionId = _ref77.redeemableTransactionId;
|
|
2148
|
+
_context39.next = 3;
|
|
2296
2149
|
return Utils.ResponseToJson(this.stateStoreClient.Request({
|
|
2297
2150
|
method: "GET",
|
|
2298
2151
|
path: UrlJoin("code-fulfillment", this.network === "main" ? "main" : "demov3", "fulfill", redeemableTransactionId),
|
|
@@ -2301,28 +2154,28 @@ exports.RedeemableCustomFulfillmentInfo = /*#__PURE__*/function () {
|
|
|
2301
2154
|
}
|
|
2302
2155
|
}));
|
|
2303
2156
|
case 3:
|
|
2304
|
-
return
|
|
2157
|
+
return _context39.abrupt("return", _context39.sent);
|
|
2305
2158
|
case 4:
|
|
2306
2159
|
case "end":
|
|
2307
|
-
return
|
|
2160
|
+
return _context39.stop();
|
|
2308
2161
|
}
|
|
2309
|
-
},
|
|
2162
|
+
}, _callee39, this);
|
|
2310
2163
|
}));
|
|
2311
|
-
return function (
|
|
2312
|
-
return
|
|
2164
|
+
return function (_x25) {
|
|
2165
|
+
return _ref78.apply(this, arguments);
|
|
2313
2166
|
};
|
|
2314
2167
|
}();
|
|
2315
2168
|
|
|
2316
2169
|
/* EVENTS */
|
|
2317
2170
|
|
|
2318
2171
|
exports.LoadDrop = /*#__PURE__*/function () {
|
|
2319
|
-
var
|
|
2172
|
+
var _ref80 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee40(_ref79) {
|
|
2320
2173
|
var _this = this;
|
|
2321
2174
|
var tenantSlug, eventSlug, dropId, event, eventId;
|
|
2322
|
-
return _regeneratorRuntime.wrap(function
|
|
2323
|
-
while (1) switch (
|
|
2175
|
+
return _regeneratorRuntime.wrap(function _callee40$(_context40) {
|
|
2176
|
+
while (1) switch (_context40.prev = _context40.next) {
|
|
2324
2177
|
case 0:
|
|
2325
|
-
tenantSlug =
|
|
2178
|
+
tenantSlug = _ref79.tenantSlug, eventSlug = _ref79.eventSlug, dropId = _ref79.dropId;
|
|
2326
2179
|
if (!this.drops) {
|
|
2327
2180
|
this.drops = {};
|
|
2328
2181
|
}
|
|
@@ -2333,10 +2186,10 @@ exports.LoadDrop = /*#__PURE__*/function () {
|
|
|
2333
2186
|
this.drops[tenantSlug][eventSlug] = {};
|
|
2334
2187
|
}
|
|
2335
2188
|
if (this.drops[tenantSlug][eventSlug][dropId]) {
|
|
2336
|
-
|
|
2189
|
+
_context40.next = 13;
|
|
2337
2190
|
break;
|
|
2338
2191
|
}
|
|
2339
|
-
|
|
2192
|
+
_context40.next = 7;
|
|
2340
2193
|
return this.client.ContentObjectMetadata({
|
|
2341
2194
|
libraryId: this.mainSiteLibraryId,
|
|
2342
2195
|
objectId: this.mainSiteId,
|
|
@@ -2349,14 +2202,14 @@ exports.LoadDrop = /*#__PURE__*/function () {
|
|
|
2349
2202
|
noAuth: true
|
|
2350
2203
|
});
|
|
2351
2204
|
case 7:
|
|
2352
|
-
|
|
2353
|
-
if (
|
|
2354
|
-
|
|
2205
|
+
_context40.t0 = _context40.sent;
|
|
2206
|
+
if (_context40.t0) {
|
|
2207
|
+
_context40.next = 10;
|
|
2355
2208
|
break;
|
|
2356
2209
|
}
|
|
2357
|
-
|
|
2210
|
+
_context40.t0 = [];
|
|
2358
2211
|
case 10:
|
|
2359
|
-
event =
|
|
2212
|
+
event = _context40.t0;
|
|
2360
2213
|
eventId = Utils.DecodeVersionHash(event["."].source).objectId;
|
|
2361
2214
|
event.drops.forEach(function (drop) {
|
|
2362
2215
|
drop = _objectSpread(_objectSpread({}, drop), {}, {
|
|
@@ -2366,31 +2219,31 @@ exports.LoadDrop = /*#__PURE__*/function () {
|
|
|
2366
2219
|
_this.drops[drop.uuid] = drop;
|
|
2367
2220
|
});
|
|
2368
2221
|
case 13:
|
|
2369
|
-
return
|
|
2222
|
+
return _context40.abrupt("return", this.drops[dropId]);
|
|
2370
2223
|
case 14:
|
|
2371
2224
|
case "end":
|
|
2372
|
-
return
|
|
2225
|
+
return _context40.stop();
|
|
2373
2226
|
}
|
|
2374
|
-
},
|
|
2227
|
+
}, _callee40, this);
|
|
2375
2228
|
}));
|
|
2376
|
-
return function (
|
|
2377
|
-
return
|
|
2229
|
+
return function (_x26) {
|
|
2230
|
+
return _ref80.apply(this, arguments);
|
|
2378
2231
|
};
|
|
2379
2232
|
}();
|
|
2380
2233
|
exports.SubmitDropVote = /*#__PURE__*/function () {
|
|
2381
|
-
var
|
|
2234
|
+
var _ref82 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee41(_ref81) {
|
|
2382
2235
|
var marketplaceParams, eventId, dropId, sku, marketplaceInfo;
|
|
2383
|
-
return _regeneratorRuntime.wrap(function
|
|
2384
|
-
while (1) switch (
|
|
2236
|
+
return _regeneratorRuntime.wrap(function _callee41$(_context41) {
|
|
2237
|
+
while (1) switch (_context41.prev = _context41.next) {
|
|
2385
2238
|
case 0:
|
|
2386
|
-
marketplaceParams =
|
|
2387
|
-
|
|
2239
|
+
marketplaceParams = _ref81.marketplaceParams, eventId = _ref81.eventId, dropId = _ref81.dropId, sku = _ref81.sku;
|
|
2240
|
+
_context41.next = 3;
|
|
2388
2241
|
return this.MarketplaceInfo({
|
|
2389
2242
|
marketplaceParams: marketplaceParams
|
|
2390
2243
|
});
|
|
2391
2244
|
case 3:
|
|
2392
|
-
marketplaceInfo =
|
|
2393
|
-
|
|
2245
|
+
marketplaceInfo = _context41.sent;
|
|
2246
|
+
_context41.next = 6;
|
|
2394
2247
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
2395
2248
|
path: UrlJoin("as", "wlt", "act", marketplaceInfo.tenant_id),
|
|
2396
2249
|
method: "POST",
|
|
@@ -2406,23 +2259,23 @@ exports.SubmitDropVote = /*#__PURE__*/function () {
|
|
|
2406
2259
|
});
|
|
2407
2260
|
case 6:
|
|
2408
2261
|
case "end":
|
|
2409
|
-
return
|
|
2262
|
+
return _context41.stop();
|
|
2410
2263
|
}
|
|
2411
|
-
},
|
|
2264
|
+
}, _callee41, this);
|
|
2412
2265
|
}));
|
|
2413
|
-
return function (
|
|
2414
|
-
return
|
|
2266
|
+
return function (_x27) {
|
|
2267
|
+
return _ref82.apply(this, arguments);
|
|
2415
2268
|
};
|
|
2416
2269
|
}();
|
|
2417
2270
|
exports.DropStatus = /*#__PURE__*/function () {
|
|
2418
|
-
var
|
|
2271
|
+
var _ref84 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42(_ref83) {
|
|
2419
2272
|
var marketplace, eventId, dropId, response;
|
|
2420
|
-
return _regeneratorRuntime.wrap(function
|
|
2421
|
-
while (1) switch (
|
|
2273
|
+
return _regeneratorRuntime.wrap(function _callee42$(_context42) {
|
|
2274
|
+
while (1) switch (_context42.prev = _context42.next) {
|
|
2422
2275
|
case 0:
|
|
2423
|
-
marketplace =
|
|
2424
|
-
|
|
2425
|
-
|
|
2276
|
+
marketplace = _ref83.marketplace, eventId = _ref83.eventId, dropId = _ref83.dropId;
|
|
2277
|
+
_context42.prev = 1;
|
|
2278
|
+
_context42.next = 4;
|
|
2426
2279
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
2427
2280
|
path: UrlJoin("as", "wlt", "act", marketplace.tenant_id, eventId, dropId),
|
|
2428
2281
|
method: "GET",
|
|
@@ -2431,25 +2284,25 @@ exports.DropStatus = /*#__PURE__*/function () {
|
|
|
2431
2284
|
}
|
|
2432
2285
|
}));
|
|
2433
2286
|
case 4:
|
|
2434
|
-
response =
|
|
2435
|
-
return
|
|
2287
|
+
response = _context42.sent;
|
|
2288
|
+
return _context42.abrupt("return", response.sort(function (a, b) {
|
|
2436
2289
|
return a.ts > b.ts ? 1 : -1;
|
|
2437
2290
|
})[0] || {
|
|
2438
2291
|
status: "none"
|
|
2439
2292
|
});
|
|
2440
2293
|
case 8:
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
this.Log(
|
|
2444
|
-
return
|
|
2294
|
+
_context42.prev = 8;
|
|
2295
|
+
_context42.t0 = _context42["catch"](1);
|
|
2296
|
+
this.Log(_context42.t0, true);
|
|
2297
|
+
return _context42.abrupt("return", "");
|
|
2445
2298
|
case 12:
|
|
2446
2299
|
case "end":
|
|
2447
|
-
return
|
|
2300
|
+
return _context42.stop();
|
|
2448
2301
|
}
|
|
2449
|
-
},
|
|
2302
|
+
}, _callee42, this, [[1, 8]]);
|
|
2450
2303
|
}));
|
|
2451
|
-
return function (
|
|
2452
|
-
return
|
|
2304
|
+
return function (_x28) {
|
|
2305
|
+
return _ref84.apply(this, arguments);
|
|
2453
2306
|
};
|
|
2454
2307
|
}();
|
|
2455
2308
|
|
|
@@ -2471,12 +2324,12 @@ exports.DropStatus = /*#__PURE__*/function () {
|
|
|
2471
2324
|
* @returns {Promise<Array<Object>>} - Offers matching the specified filters
|
|
2472
2325
|
*/
|
|
2473
2326
|
exports.MarketplaceOffers = /*#__PURE__*/function () {
|
|
2474
|
-
var
|
|
2475
|
-
var contractAddress, tokenId, buyerAddress, sellerAddress, statuses,
|
|
2476
|
-
return _regeneratorRuntime.wrap(function
|
|
2477
|
-
while (1) switch (
|
|
2327
|
+
var _ref86 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43(_ref85) {
|
|
2328
|
+
var contractAddress, tokenId, buyerAddress, sellerAddress, statuses, _ref85$start, start, _ref85$limit, limit, path, queryParams, offers;
|
|
2329
|
+
return _regeneratorRuntime.wrap(function _callee43$(_context43) {
|
|
2330
|
+
while (1) switch (_context43.prev = _context43.next) {
|
|
2478
2331
|
case 0:
|
|
2479
|
-
contractAddress =
|
|
2332
|
+
contractAddress = _ref85.contractAddress, tokenId = _ref85.tokenId, buyerAddress = _ref85.buyerAddress, sellerAddress = _ref85.sellerAddress, statuses = _ref85.statuses, _ref85$start = _ref85.start, start = _ref85$start === void 0 ? 0 : _ref85$start, _ref85$limit = _ref85.limit, limit = _ref85$limit === void 0 ? 10 : _ref85$limit;
|
|
2480
2333
|
path = UrlJoin("as", "mkt", "offers", "ls");
|
|
2481
2334
|
if (buyerAddress) {
|
|
2482
2335
|
path = UrlJoin(path, "b", Utils.FormatAddress(buyerAddress));
|
|
@@ -2496,15 +2349,15 @@ exports.MarketplaceOffers = /*#__PURE__*/function () {
|
|
|
2496
2349
|
if (statuses && statuses.length > 0) {
|
|
2497
2350
|
queryParams.include = statuses.join(",");
|
|
2498
2351
|
}
|
|
2499
|
-
|
|
2352
|
+
_context43.next = 8;
|
|
2500
2353
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
2501
2354
|
path: path,
|
|
2502
2355
|
method: "GET",
|
|
2503
2356
|
queryParams: queryParams
|
|
2504
2357
|
}));
|
|
2505
2358
|
case 8:
|
|
2506
|
-
offers =
|
|
2507
|
-
return
|
|
2359
|
+
offers = _context43.sent;
|
|
2360
|
+
return _context43.abrupt("return", offers.map(function (offer) {
|
|
2508
2361
|
return _objectSpread(_objectSpread({}, offer), {}, {
|
|
2509
2362
|
created: offer.created * 1000,
|
|
2510
2363
|
updated: offer.updated * 1000,
|
|
@@ -2513,12 +2366,12 @@ exports.MarketplaceOffers = /*#__PURE__*/function () {
|
|
|
2513
2366
|
}));
|
|
2514
2367
|
case 10:
|
|
2515
2368
|
case "end":
|
|
2516
|
-
return
|
|
2369
|
+
return _context43.stop();
|
|
2517
2370
|
}
|
|
2518
|
-
},
|
|
2371
|
+
}, _callee43, this);
|
|
2519
2372
|
}));
|
|
2520
|
-
return function (
|
|
2521
|
-
return
|
|
2373
|
+
return function (_x29) {
|
|
2374
|
+
return _ref86.apply(this, arguments);
|
|
2522
2375
|
};
|
|
2523
2376
|
}();
|
|
2524
2377
|
|
|
@@ -2538,17 +2391,17 @@ exports.MarketplaceOffers = /*#__PURE__*/function () {
|
|
|
2538
2391
|
* @returns {Promise<Object>} - Info about the created/updated offer
|
|
2539
2392
|
*/
|
|
2540
2393
|
exports.CreateMarketplaceOffer = /*#__PURE__*/function () {
|
|
2541
|
-
var
|
|
2394
|
+
var _ref88 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(_ref87) {
|
|
2542
2395
|
var contractAddress, tokenId, offerId, price, expiresAt, response;
|
|
2543
|
-
return _regeneratorRuntime.wrap(function
|
|
2544
|
-
while (1) switch (
|
|
2396
|
+
return _regeneratorRuntime.wrap(function _callee44$(_context44) {
|
|
2397
|
+
while (1) switch (_context44.prev = _context44.next) {
|
|
2545
2398
|
case 0:
|
|
2546
|
-
contractAddress =
|
|
2399
|
+
contractAddress = _ref87.contractAddress, tokenId = _ref87.tokenId, offerId = _ref87.offerId, price = _ref87.price, expiresAt = _ref87.expiresAt;
|
|
2547
2400
|
if (!offerId) {
|
|
2548
|
-
|
|
2401
|
+
_context44.next = 7;
|
|
2549
2402
|
break;
|
|
2550
2403
|
}
|
|
2551
|
-
|
|
2404
|
+
_context44.next = 4;
|
|
2552
2405
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
2553
2406
|
path: UrlJoin("as", "wlt", "mkt", "offers", offerId),
|
|
2554
2407
|
method: "PUT",
|
|
@@ -2561,11 +2414,11 @@ exports.CreateMarketplaceOffer = /*#__PURE__*/function () {
|
|
|
2561
2414
|
}
|
|
2562
2415
|
}));
|
|
2563
2416
|
case 4:
|
|
2564
|
-
response =
|
|
2565
|
-
|
|
2417
|
+
response = _context44.sent;
|
|
2418
|
+
_context44.next = 10;
|
|
2566
2419
|
break;
|
|
2567
2420
|
case 7:
|
|
2568
|
-
|
|
2421
|
+
_context44.next = 9;
|
|
2569
2422
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
2570
2423
|
path: UrlJoin("as", "wlt", "mkt", "offers", contractAddress, tokenId),
|
|
2571
2424
|
method: "POST",
|
|
@@ -2580,17 +2433,17 @@ exports.CreateMarketplaceOffer = /*#__PURE__*/function () {
|
|
|
2580
2433
|
}
|
|
2581
2434
|
}));
|
|
2582
2435
|
case 9:
|
|
2583
|
-
response =
|
|
2436
|
+
response = _context44.sent;
|
|
2584
2437
|
case 10:
|
|
2585
|
-
return
|
|
2438
|
+
return _context44.abrupt("return", response.offer_id);
|
|
2586
2439
|
case 11:
|
|
2587
2440
|
case "end":
|
|
2588
|
-
return
|
|
2441
|
+
return _context44.stop();
|
|
2589
2442
|
}
|
|
2590
|
-
},
|
|
2443
|
+
}, _callee44, this);
|
|
2591
2444
|
}));
|
|
2592
|
-
return function (
|
|
2593
|
-
return
|
|
2445
|
+
return function (_x30) {
|
|
2446
|
+
return _ref88.apply(this, arguments);
|
|
2594
2447
|
};
|
|
2595
2448
|
}();
|
|
2596
2449
|
|
|
@@ -2604,13 +2457,13 @@ exports.CreateMarketplaceOffer = /*#__PURE__*/function () {
|
|
|
2604
2457
|
* @param {string} offerId - The ID of the offer
|
|
2605
2458
|
*/
|
|
2606
2459
|
exports.RemoveMarketplaceOffer = /*#__PURE__*/function () {
|
|
2607
|
-
var
|
|
2460
|
+
var _ref90 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45(_ref89) {
|
|
2608
2461
|
var offerId;
|
|
2609
|
-
return _regeneratorRuntime.wrap(function
|
|
2610
|
-
while (1) switch (
|
|
2462
|
+
return _regeneratorRuntime.wrap(function _callee45$(_context45) {
|
|
2463
|
+
while (1) switch (_context45.prev = _context45.next) {
|
|
2611
2464
|
case 0:
|
|
2612
|
-
offerId =
|
|
2613
|
-
|
|
2465
|
+
offerId = _ref89.offerId;
|
|
2466
|
+
_context45.next = 3;
|
|
2614
2467
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
2615
2468
|
path: UrlJoin("as", "wlt", "mkt", "offers", offerId),
|
|
2616
2469
|
method: "DELETE",
|
|
@@ -2619,15 +2472,15 @@ exports.RemoveMarketplaceOffer = /*#__PURE__*/function () {
|
|
|
2619
2472
|
}
|
|
2620
2473
|
});
|
|
2621
2474
|
case 3:
|
|
2622
|
-
return
|
|
2475
|
+
return _context45.abrupt("return", _context45.sent);
|
|
2623
2476
|
case 4:
|
|
2624
2477
|
case "end":
|
|
2625
|
-
return
|
|
2478
|
+
return _context45.stop();
|
|
2626
2479
|
}
|
|
2627
|
-
},
|
|
2480
|
+
}, _callee45, this);
|
|
2628
2481
|
}));
|
|
2629
|
-
return function (
|
|
2630
|
-
return
|
|
2482
|
+
return function (_x31) {
|
|
2483
|
+
return _ref90.apply(this, arguments);
|
|
2631
2484
|
};
|
|
2632
2485
|
}();
|
|
2633
2486
|
|
|
@@ -2641,13 +2494,13 @@ exports.RemoveMarketplaceOffer = /*#__PURE__*/function () {
|
|
|
2641
2494
|
* @param {string} offerId - The ID of the offer
|
|
2642
2495
|
*/
|
|
2643
2496
|
exports.AcceptMarketplaceOffer = /*#__PURE__*/function () {
|
|
2644
|
-
var
|
|
2497
|
+
var _ref92 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(_ref91) {
|
|
2645
2498
|
var offerId;
|
|
2646
|
-
return _regeneratorRuntime.wrap(function
|
|
2647
|
-
while (1) switch (
|
|
2499
|
+
return _regeneratorRuntime.wrap(function _callee46$(_context46) {
|
|
2500
|
+
while (1) switch (_context46.prev = _context46.next) {
|
|
2648
2501
|
case 0:
|
|
2649
|
-
offerId =
|
|
2650
|
-
|
|
2502
|
+
offerId = _ref91.offerId;
|
|
2503
|
+
_context46.next = 3;
|
|
2651
2504
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
2652
2505
|
path: UrlJoin("as", "wlt", "mkt", "offers", "accept", offerId),
|
|
2653
2506
|
method: "PUT",
|
|
@@ -2656,15 +2509,15 @@ exports.AcceptMarketplaceOffer = /*#__PURE__*/function () {
|
|
|
2656
2509
|
}
|
|
2657
2510
|
});
|
|
2658
2511
|
case 3:
|
|
2659
|
-
return
|
|
2512
|
+
return _context46.abrupt("return", _context46.sent);
|
|
2660
2513
|
case 4:
|
|
2661
2514
|
case "end":
|
|
2662
|
-
return
|
|
2515
|
+
return _context46.stop();
|
|
2663
2516
|
}
|
|
2664
|
-
},
|
|
2517
|
+
}, _callee46, this);
|
|
2665
2518
|
}));
|
|
2666
|
-
return function (
|
|
2667
|
-
return
|
|
2519
|
+
return function (_x32) {
|
|
2520
|
+
return _ref92.apply(this, arguments);
|
|
2668
2521
|
};
|
|
2669
2522
|
}();
|
|
2670
2523
|
|
|
@@ -2678,13 +2531,13 @@ exports.AcceptMarketplaceOffer = /*#__PURE__*/function () {
|
|
|
2678
2531
|
* @param {string} offerId - The ID of the offer
|
|
2679
2532
|
*/
|
|
2680
2533
|
exports.RejectMarketplaceOffer = /*#__PURE__*/function () {
|
|
2681
|
-
var
|
|
2534
|
+
var _ref94 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47(_ref93) {
|
|
2682
2535
|
var offerId;
|
|
2683
|
-
return _regeneratorRuntime.wrap(function
|
|
2684
|
-
while (1) switch (
|
|
2536
|
+
return _regeneratorRuntime.wrap(function _callee47$(_context47) {
|
|
2537
|
+
while (1) switch (_context47.prev = _context47.next) {
|
|
2685
2538
|
case 0:
|
|
2686
|
-
offerId =
|
|
2687
|
-
|
|
2539
|
+
offerId = _ref93.offerId;
|
|
2540
|
+
_context47.next = 3;
|
|
2688
2541
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
2689
2542
|
path: UrlJoin("as", "wlt", "mkt", "offers", "decline", offerId),
|
|
2690
2543
|
method: "PUT",
|
|
@@ -2693,15 +2546,15 @@ exports.RejectMarketplaceOffer = /*#__PURE__*/function () {
|
|
|
2693
2546
|
}
|
|
2694
2547
|
});
|
|
2695
2548
|
case 3:
|
|
2696
|
-
return
|
|
2549
|
+
return _context47.abrupt("return", _context47.sent);
|
|
2697
2550
|
case 4:
|
|
2698
2551
|
case "end":
|
|
2699
|
-
return
|
|
2552
|
+
return _context47.stop();
|
|
2700
2553
|
}
|
|
2701
|
-
},
|
|
2554
|
+
}, _callee47, this);
|
|
2702
2555
|
}));
|
|
2703
|
-
return function (
|
|
2704
|
-
return
|
|
2556
|
+
return function (_x33) {
|
|
2557
|
+
return _ref94.apply(this, arguments);
|
|
2705
2558
|
};
|
|
2706
2559
|
}();
|
|
2707
2560
|
|
|
@@ -2718,13 +2571,13 @@ exports.RejectMarketplaceOffer = /*#__PURE__*/function () {
|
|
|
2718
2571
|
* @returns {Promise<Object>} - Info about the voting event, including the current user's votes and the current total voting tally
|
|
2719
2572
|
*/
|
|
2720
2573
|
exports.VoteStatus = /*#__PURE__*/function () {
|
|
2721
|
-
var
|
|
2574
|
+
var _ref96 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(_ref95) {
|
|
2722
2575
|
var tenantId, votingEventId;
|
|
2723
|
-
return _regeneratorRuntime.wrap(function
|
|
2724
|
-
while (1) switch (
|
|
2576
|
+
return _regeneratorRuntime.wrap(function _callee48$(_context48) {
|
|
2577
|
+
while (1) switch (_context48.prev = _context48.next) {
|
|
2725
2578
|
case 0:
|
|
2726
|
-
tenantId =
|
|
2727
|
-
|
|
2579
|
+
tenantId = _ref95.tenantId, votingEventId = _ref95.votingEventId;
|
|
2580
|
+
_context48.next = 3;
|
|
2728
2581
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
2729
2582
|
path: UrlJoin("as", "votes", tenantId, votingEventId),
|
|
2730
2583
|
headers: {
|
|
@@ -2732,15 +2585,15 @@ exports.VoteStatus = /*#__PURE__*/function () {
|
|
|
2732
2585
|
}
|
|
2733
2586
|
}));
|
|
2734
2587
|
case 3:
|
|
2735
|
-
return
|
|
2588
|
+
return _context48.abrupt("return", _context48.sent);
|
|
2736
2589
|
case 4:
|
|
2737
2590
|
case "end":
|
|
2738
|
-
return
|
|
2591
|
+
return _context48.stop();
|
|
2739
2592
|
}
|
|
2740
|
-
},
|
|
2593
|
+
}, _callee48, this);
|
|
2741
2594
|
}));
|
|
2742
|
-
return function (
|
|
2743
|
-
return
|
|
2595
|
+
return function (_x34) {
|
|
2596
|
+
return _ref96.apply(this, arguments);
|
|
2744
2597
|
};
|
|
2745
2598
|
}();
|
|
2746
2599
|
|
|
@@ -2758,13 +2611,13 @@ exports.VoteStatus = /*#__PURE__*/function () {
|
|
|
2758
2611
|
* @returns {Promise<Object>} - Info about the voting event, including the current user's votes and the current total voting tally
|
|
2759
2612
|
*/
|
|
2760
2613
|
exports.CastVote = /*#__PURE__*/function () {
|
|
2761
|
-
var
|
|
2614
|
+
var _ref98 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(_ref97) {
|
|
2762
2615
|
var tenantId, votingEventId, sku;
|
|
2763
|
-
return _regeneratorRuntime.wrap(function
|
|
2764
|
-
while (1) switch (
|
|
2616
|
+
return _regeneratorRuntime.wrap(function _callee49$(_context49) {
|
|
2617
|
+
while (1) switch (_context49.prev = _context49.next) {
|
|
2765
2618
|
case 0:
|
|
2766
|
-
tenantId =
|
|
2767
|
-
|
|
2619
|
+
tenantId = _ref97.tenantId, votingEventId = _ref97.votingEventId, sku = _ref97.sku;
|
|
2620
|
+
_context49.next = 3;
|
|
2768
2621
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
2769
2622
|
path: UrlJoin("as", "votes", tenantId, votingEventId, sku),
|
|
2770
2623
|
method: "POST",
|
|
@@ -2773,15 +2626,15 @@ exports.CastVote = /*#__PURE__*/function () {
|
|
|
2773
2626
|
}
|
|
2774
2627
|
}));
|
|
2775
2628
|
case 3:
|
|
2776
|
-
return
|
|
2629
|
+
return _context49.abrupt("return", _context49.sent);
|
|
2777
2630
|
case 4:
|
|
2778
2631
|
case "end":
|
|
2779
|
-
return
|
|
2632
|
+
return _context49.stop();
|
|
2780
2633
|
}
|
|
2781
|
-
},
|
|
2634
|
+
}, _callee49, this);
|
|
2782
2635
|
}));
|
|
2783
|
-
return function (
|
|
2784
|
-
return
|
|
2636
|
+
return function (_x35) {
|
|
2637
|
+
return _ref98.apply(this, arguments);
|
|
2785
2638
|
};
|
|
2786
2639
|
}();
|
|
2787
2640
|
|
|
@@ -2799,13 +2652,13 @@ exports.CastVote = /*#__PURE__*/function () {
|
|
|
2799
2652
|
* @returns {Promise<Object>} - Info about the voting event, including the current user's votes and the current total voting tally
|
|
2800
2653
|
*/
|
|
2801
2654
|
exports.RevokeVote = /*#__PURE__*/function () {
|
|
2802
|
-
var
|
|
2655
|
+
var _ref100 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(_ref99) {
|
|
2803
2656
|
var tenantId, votingEventId, sku;
|
|
2804
|
-
return _regeneratorRuntime.wrap(function
|
|
2805
|
-
while (1) switch (
|
|
2657
|
+
return _regeneratorRuntime.wrap(function _callee50$(_context50) {
|
|
2658
|
+
while (1) switch (_context50.prev = _context50.next) {
|
|
2806
2659
|
case 0:
|
|
2807
|
-
tenantId =
|
|
2808
|
-
|
|
2660
|
+
tenantId = _ref99.tenantId, votingEventId = _ref99.votingEventId, sku = _ref99.sku;
|
|
2661
|
+
_context50.next = 3;
|
|
2809
2662
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
2810
2663
|
path: UrlJoin("as", "votes", tenantId, votingEventId, sku),
|
|
2811
2664
|
method: "DELETE",
|
|
@@ -2814,14 +2667,14 @@ exports.RevokeVote = /*#__PURE__*/function () {
|
|
|
2814
2667
|
}
|
|
2815
2668
|
}));
|
|
2816
2669
|
case 3:
|
|
2817
|
-
return
|
|
2670
|
+
return _context50.abrupt("return", _context50.sent);
|
|
2818
2671
|
case 4:
|
|
2819
2672
|
case "end":
|
|
2820
|
-
return
|
|
2673
|
+
return _context50.stop();
|
|
2821
2674
|
}
|
|
2822
|
-
},
|
|
2675
|
+
}, _callee50, this);
|
|
2823
2676
|
}));
|
|
2824
|
-
return function (
|
|
2825
|
-
return
|
|
2677
|
+
return function (_x36) {
|
|
2678
|
+
return _ref100.apply(this, arguments);
|
|
2826
2679
|
};
|
|
2827
2680
|
}();
|