@eluvio/elv-client-js 4.0.26 → 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.
@@ -58,6 +58,8 @@ class ElvWalletClient {
58
58
  this.cachedCSS = {};
59
59
 
60
60
  this.utils = client.utils;
61
+
62
+ this.ForbiddenMethods = ElvWalletClient.ForbiddenMethods;
61
63
  }
62
64
 
63
65
  Log(message, error=false, errorObject) {
@@ -75,6 +77,33 @@ class ElvWalletClient {
75
77
  }
76
78
  }
77
79
 
80
+ // Methods forbidden from usage by FrameClient
81
+ static ForbiddenMethods() {
82
+ return [
83
+ "constructor",
84
+ "Authenticate",
85
+ "AuthenticateOAuth",
86
+ "AuthenticateExternalWallet",
87
+ "AuthToken",
88
+ "ClientAuthToken",
89
+ "Initialize",
90
+ "Log",
91
+ "LogIn",
92
+ "LogOut",
93
+ "PersonalSign",
94
+ "SetAuthorization",
95
+ "SignMetamask"
96
+ ];
97
+ }
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
+
78
107
  /**
79
108
  * Initialize the wallet client.
80
109
  *
@@ -100,7 +129,8 @@ class ElvWalletClient {
100
129
  localization,
101
130
  marketplaceParams,
102
131
  previewMarketplaceId,
103
- storeAuthToken=true
132
+ storeAuthToken=true,
133
+ skipMarketplaceLoad=false
104
134
  }) {
105
135
  let { tenantSlug, marketplaceSlug, marketplaceId, marketplaceHash } = (marketplaceParams || {});
106
136
 
@@ -155,7 +185,9 @@ class ElvWalletClient {
155
185
  }
156
186
  }
157
187
 
158
- await walletClient.LoadAvailableMarketplaces();
188
+ if(!skipMarketplaceLoad) {
189
+ await walletClient.LoadAvailableMarketplaces();
190
+ }
159
191
 
160
192
  return walletClient;
161
193
  }