@eluvio/elv-client-js 3.2.25 → 3.2.27

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eluvio/elv-client-js",
3
- "version": "3.2.25",
3
+ "version": "3.2.27",
4
4
  "description": "Javascript client for the Eluvio Content Fabric",
5
5
  "main": "src/index.js",
6
6
  "author": "Kevin Talmadge",
@@ -1101,9 +1101,10 @@ exports.ListingAttributes = async function({marketplaceParams, displayName}={})
1101
1101
  * @methodGroup Purchase
1102
1102
  * @namedParams
1103
1103
  * @param {Object} marketplaceParams - Parameters of the marketplace
1104
- * @param {string} sku - The SKU of the item to claime
1104
+ * @param {string} sku - The SKU of the item to claim
1105
+ * @param {string=} email - Email address of the user. If specified, this will bind the user to the tenant of the specified marketplace
1105
1106
  */
1106
- exports.ClaimItem = async function({marketplaceParams, sku}) {
1107
+ exports.ClaimItem = async function({marketplaceParams, sku, email}) {
1107
1108
  const marketplaceInfo = await this.MarketplaceInfo({marketplaceParams});
1108
1109
 
1109
1110
  await this.client.authClient.MakeAuthServiceRequest({
@@ -1112,7 +1113,8 @@ exports.ClaimItem = async function({marketplaceParams, sku}) {
1112
1113
  body: {
1113
1114
  op: "nft-claim",
1114
1115
  sid: marketplaceInfo.marketplaceId,
1115
- sku
1116
+ sku,
1117
+ email
1116
1118
  },
1117
1119
  headers: {
1118
1120
  Authorization: `Bearer ${this.AuthToken()}`
@@ -76,10 +76,12 @@ class ElvWalletClient {
76
76
  * @param {string} mode=production - Environment to use (`production`, `staging`)
77
77
  * @param {Object=} marketplaceParams - Marketplace parameters
78
78
  * @param {boolean=} storeAuthToken=true - If specified, auth tokens will be stored in localstorage (if available)
79
+ * @param {Object=} client - Existing instance of ElvClient to use instead of initializing a new one
79
80
  *
80
81
  * @returns {Promise<ElvWalletClient>}
81
82
  */
82
83
  static async Initialize({
84
+ client,
83
85
  appId="general",
84
86
  network="main",
85
87
  mode="production",
@@ -95,7 +97,9 @@ class ElvWalletClient {
95
97
  throw Error(`ElvWalletClient: Invalid mode ${mode}`);
96
98
  }
97
99
 
98
- const client = await ElvClient.FromNetworkName({networkName: network, assumeV3: true});
100
+ if(!client) {
101
+ client = await ElvClient.FromNetworkName({networkName: network, assumeV3: true});
102
+ }
99
103
 
100
104
  let previewMarketplaceHash = previewMarketplaceId;
101
105
  if(previewMarketplaceHash && !previewMarketplaceHash.startsWith("hq__")) {