@eluvio/elv-client-js 4.0.27 → 4.0.28

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.
@@ -14,8 +14,6 @@ var permissionLevels = require("./client/ContentAccess").permissionLevels;
14
14
  var _require = require("./LogMessage"),
15
15
  LogMessage = _require.LogMessage;
16
16
  var Crypto = require("./Crypto");
17
- var _require2 = require("./walletClient/index"),
18
- ElvWalletClient = _require2.ElvWalletClient;
19
17
  var FrameClient = /*#__PURE__*/function () {
20
18
  "use strict";
21
19
 
@@ -160,15 +158,12 @@ var FrameClient = /*#__PURE__*/function () {
160
158
  _iterator2.f();
161
159
  }
162
160
  this.walletClient = {};
163
- var forbiddenMethods = ElvWalletClient.ForbiddenMethods();
164
- var _iterator3 = _createForOfIteratorHelper(Object.getOwnPropertyNames(ElvWalletClient.prototype)),
161
+ // Dynamically defined wallet client methods defined in AllowedWalletClientMethods
162
+ var _iterator3 = _createForOfIteratorHelper(this.AllowedWalletClientMethods()),
165
163
  _step3;
166
164
  try {
167
165
  var _loop3 = function _loop3() {
168
166
  var methodName = _step3.value;
169
- if (forbiddenMethods.includes(methodName)) {
170
- return "continue";
171
- }
172
167
  _this.walletClient[methodName] = /*#__PURE__*/function () {
173
168
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(args) {
174
169
  var callback;
@@ -202,8 +197,7 @@ var FrameClient = /*#__PURE__*/function () {
202
197
  }();
203
198
  };
204
199
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
205
- var _ret = _loop3();
206
- if (_ret === "continue") continue;
200
+ _loop3();
207
201
  }
208
202
  } catch (err) {
209
203
  _iterator3.e(err);
@@ -462,6 +456,11 @@ var FrameClient = /*#__PURE__*/function () {
462
456
  value: function AllowedUserProfileMethods() {
463
457
  return ["AccessLevel", "CollectedTags", "CreateWallet", "DeleteUserMetadata", "MergeUserMetadata", "PublicUserMetadata", "ReplaceUserMetadata", "TenantId", "UserMetadata", "UserProfileImage", "UserWalletAddress", "UserWalletObjectInfo", "WalletAddress"];
464
458
  }
459
+ }, {
460
+ key: "AllowedWalletClientMethods",
461
+ value: function AllowedWalletClientMethods() {
462
+ return ["AcceptMarketplaceOffer", "AddNotificationListener", "AvailableMarketplaces", "CanSign", "CastVote", "ClaimItem", "ClaimStatus", "CollectionRedemptionStatus", "CreateListing", "CreateMarketplaceOffer", "DropStatus", "ExchangeRate", "FilteredQuery", "LatestMarketplaceHash", "Leaderboard", "Listing", "ListingAttributes", "ListingEditionNames", "ListingNames", "ListingPurchaseStatus", "ListingStats", "ListingStatus", "Listings", "LoadAvailableMarketplaces", "LoadDrop", "LoadMarketplace", "Marketplace", "MarketplaceCSS", "MarketplaceInfo", "MarketplaceOffers", "MarketplaceStock", "MintingStatus", "NFT", "NFTContractStats", "Notifications", "PackOpenStatus", "Profile", "ProfileMetadata", "PurchaseStatus", "PushNotification", "RejectMarketplaceOffer", "RemoveListing", "RemoveMarketplaceOffer", "RemoveProfileMetadata", "RevokeVote", "Sales", "SalesNames", "SalesStats", "SetProfileMetadata", "SubmitDropVote", "TenantConfiguration", "TransferNFT", "Transfers", "UserAddress", "UserInfo", "UserItemAttributes", "UserItemEditionNames", "UserItemNames", "UserItems", "UserListings", "UserNameToAddress", "UserSales", "UserTransfers", "UserWalletBalance", "VoteStatus"];
463
+ }
465
464
  }], [{
466
465
  key: "PromptedMethods",
467
466
  value: function PromptedMethods() {
@@ -480,7 +479,7 @@ var FrameClient = /*#__PURE__*/function () {
480
479
  }]);
481
480
  return FrameClient;
482
481
  }();
483
- var _require3 = require("./client/Files"),
484
- UploadFiles = _require3.UploadFiles;
482
+ var _require2 = require("./client/Files"),
483
+ UploadFiles = _require2.UploadFiles;
485
484
  FrameClient.prototype.UploadFiles = UploadFiles;
486
485
  exports.FrameClient = FrameClient;
@@ -27,7 +27,7 @@ var WalletConfiguration = {
27
27
  appUrl: "https://wallet.contentfabric.io"
28
28
  }
29
29
  },
30
- __MARKETPLACE_ORDER: ["PREVIEW", "masked-singer-brazil-marketplace", "de228e92-ed45-4fe0-8e52-658cf366e962", "wwe-marketplace-main", "maskverse-marketplace", "dolly-marketplace", "eluvio-live-marketplace-sonark", "cirkay-marketplace", "eluvio-live-marketplace-fuudge", "oc-marketplace", "emp-marketplace", "microsoft", "indieflix-marketplace", "angels-airwaves-marketplace", "realcannonballrun-marketplace"]
30
+ __MARKETPLACE_ORDER: ["PREVIEW", "masked-singer-brazil-marketplace", "eluvio-live-marketplace-globo-taf", "de228e92-ed45-4fe0-8e52-658cf366e962", "wwe-marketplace-main", "maskverse-marketplace", "dolly-marketplace", "eluvio-live-marketplace-sonark", "cirkay-marketplace", "eluvio-live-marketplace-fuudge", "oc-marketplace", "emp-marketplace", "microsoft", "indieflix-marketplace", "angels-airwaves-marketplace", "realcannonballrun-marketplace"]
31
31
  };
32
32
 
33
33
  // No production environment on demo
@@ -1517,6 +1517,16 @@ var ElvWalletClient = /*#__PURE__*/function () {
1517
1517
  return ["constructor", "Authenticate", "AuthenticateOAuth", "AuthenticateExternalWallet", "AuthToken", "ClientAuthToken", "Initialize", "Log", "LogIn", "LogOut", "PersonalSign", "SetAuthorization", "SignMetamask"];
1518
1518
  }
1519
1519
 
1520
+ // Used to generate AllowedWalletClientMethods for FrameClient
1521
+ // Note: Do not import ElvWalletClient in FrameClient directly
1522
+ }, {
1523
+ key: "AllowedMethods",
1524
+ value: function AllowedMethods() {
1525
+ return Object.getOwnPropertyNames(ElvWalletClient.prototype).filter(function (methodName) {
1526
+ return !ElvWalletClient.ForbiddenMethods().includes(methodName);
1527
+ }).sort();
1528
+ }
1529
+
1520
1530
  /**
1521
1531
  * Initialize the wallet client.
1522
1532
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eluvio/elv-client-js",
3
- "version": "4.0.27",
3
+ "version": "4.0.28",
4
4
  "description": "Javascript client for the Eluvio Content Fabric",
5
5
  "main": "src/index.js",
6
6
  "author": "Kevin Talmadge",
@@ -3,7 +3,6 @@ const Utils = require("./Utils");
3
3
  const permissionLevels = require("./client/ContentAccess").permissionLevels;
4
4
  const {LogMessage} = require("./LogMessage");
5
5
  const Crypto = require("./Crypto");
6
- const { ElvWalletClient } = require("./walletClient/index");
7
6
 
8
7
  class FrameClient {
9
8
  Log(message, error = false) {
@@ -91,10 +90,8 @@ class FrameClient {
91
90
  }
92
91
 
93
92
  this.walletClient = {};
94
- const forbiddenMethods = ElvWalletClient.ForbiddenMethods();
95
- for(const methodName of Object.getOwnPropertyNames(ElvWalletClient.prototype)) {
96
- if(forbiddenMethods.includes(methodName)) { continue; }
97
-
93
+ // Dynamically defined wallet client methods defined in AllowedWalletClientMethods
94
+ for(const methodName of this.AllowedWalletClientMethods()) {
98
95
  this.walletClient[methodName] = async (args) => {
99
96
  let callback = args && args.callback;
100
97
  if(callback) { delete args.callback; }
@@ -504,6 +501,76 @@ class FrameClient {
504
501
  "WalletAddress"
505
502
  ];
506
503
  }
504
+
505
+ AllowedWalletClientMethods() {
506
+ return [
507
+ "AcceptMarketplaceOffer",
508
+ "AddNotificationListener",
509
+ "AvailableMarketplaces",
510
+ "CanSign",
511
+ "CastVote",
512
+ "ClaimItem",
513
+ "ClaimStatus",
514
+ "CollectionRedemptionStatus",
515
+ "CreateListing",
516
+ "CreateMarketplaceOffer",
517
+ "DropStatus",
518
+ "ExchangeRate",
519
+ "FilteredQuery",
520
+ "LatestMarketplaceHash",
521
+ "Leaderboard",
522
+ "Listing",
523
+ "ListingAttributes",
524
+ "ListingEditionNames",
525
+ "ListingNames",
526
+ "ListingPurchaseStatus",
527
+ "ListingStats",
528
+ "ListingStatus",
529
+ "Listings",
530
+ "LoadAvailableMarketplaces",
531
+ "LoadDrop",
532
+ "LoadMarketplace",
533
+ "Marketplace",
534
+ "MarketplaceCSS",
535
+ "MarketplaceInfo",
536
+ "MarketplaceOffers",
537
+ "MarketplaceStock",
538
+ "MintingStatus",
539
+ "NFT",
540
+ "NFTContractStats",
541
+ "Notifications",
542
+ "PackOpenStatus",
543
+ "Profile",
544
+ "ProfileMetadata",
545
+ "PurchaseStatus",
546
+ "PushNotification",
547
+ "RejectMarketplaceOffer",
548
+ "RemoveListing",
549
+ "RemoveMarketplaceOffer",
550
+ "RemoveProfileMetadata",
551
+ "RevokeVote",
552
+ "Sales",
553
+ "SalesNames",
554
+ "SalesStats",
555
+ "SetProfileMetadata",
556
+ "SubmitDropVote",
557
+ "TenantConfiguration",
558
+ "TransferNFT",
559
+ "Transfers",
560
+ "UserAddress",
561
+ "UserInfo",
562
+ "UserItemAttributes",
563
+ "UserItemEditionNames",
564
+ "UserItemNames",
565
+ "UserItems",
566
+ "UserListings",
567
+ "UserNameToAddress",
568
+ "UserSales",
569
+ "UserTransfers",
570
+ "UserWalletBalance",
571
+ "VoteStatus"
572
+ ];
573
+ }
507
574
  }
508
575
 
509
576
  const { UploadFiles } = require("./client/Files");
@@ -30,6 +30,7 @@ let WalletConfiguration = {
30
30
  __MARKETPLACE_ORDER: [
31
31
  "PREVIEW",
32
32
  "masked-singer-brazil-marketplace",
33
+ "eluvio-live-marketplace-globo-taf",
33
34
  "de228e92-ed45-4fe0-8e52-658cf366e962",
34
35
  "wwe-marketplace-main",
35
36
  "maskverse-marketplace",
@@ -96,6 +96,14 @@ class ElvWalletClient {
96
96
  ];
97
97
  }
98
98
 
99
+ // Used to generate AllowedWalletClientMethods for FrameClient
100
+ // Note: Do not import ElvWalletClient in FrameClient directly
101
+ static AllowedMethods() {
102
+ return Object.getOwnPropertyNames(ElvWalletClient.prototype)
103
+ .filter(methodName => !ElvWalletClient.ForbiddenMethods().includes(methodName))
104
+ .sort();
105
+ }
106
+
99
107
  /**
100
108
  * Initialize the wallet client.
101
109
  *