@eluvio/elv-client-js 3.2.12 → 3.2.13
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 +1 -1
- package/dist/ElvWalletClient-node-min.js +2 -2
- package/dist/src/index.js +2 -2
- package/dist/src/walletClient/ClientMethods.js +2 -3
- package/dist/src/walletClient/index.js +61 -30
- package/package.json +1 -1
- package/src/index.js +2 -2
- package/src/walletClient/ClientMethods.js +1 -2
- package/src/walletClient/index.js +38 -17
- package/testScripts/TestMarketplaceClient.js +0 -25
package/dist/src/index.js
CHANGED
|
@@ -2,10 +2,10 @@ var _require = require("./ElvClient.js"),
|
|
|
2
2
|
ElvClient = _require.ElvClient;
|
|
3
3
|
|
|
4
4
|
var _require2 = require("./walletClient/index.js"),
|
|
5
|
-
|
|
5
|
+
ElvWalletClient = _require2.ElvWalletClient;
|
|
6
6
|
|
|
7
7
|
var Utils = require("./Utils.js");
|
|
8
8
|
|
|
9
9
|
exports.ElvClient = ElvClient;
|
|
10
|
-
exports.
|
|
10
|
+
exports.ElvWalletClient = ElvWalletClient;
|
|
11
11
|
exports.Utils = Utils;
|
|
@@ -514,11 +514,10 @@ exports.TenantConfiguration = /*#__PURE__*/function () {
|
|
|
514
514
|
case 7:
|
|
515
515
|
_context7.prev = 7;
|
|
516
516
|
_context7.t0 = _context7["catch"](1);
|
|
517
|
-
this.Log("Failed to load tenant configuration", true);
|
|
518
|
-
this.Log(_context7.t0, true);
|
|
517
|
+
this.Log("Failed to load tenant configuration", true, _context7.t0);
|
|
519
518
|
return _context7.abrupt("return", {});
|
|
520
519
|
|
|
521
|
-
case
|
|
520
|
+
case 11:
|
|
522
521
|
case "end":
|
|
523
522
|
return _context7.stop();
|
|
524
523
|
}
|
|
@@ -33,6 +33,7 @@ var Utils = require("../Utils");
|
|
|
33
33
|
var Ethers = require("ethers");
|
|
34
34
|
|
|
35
35
|
var inBrowser = typeof window !== "undefined";
|
|
36
|
+
var embedded = inBrowser && window.top !== window.self;
|
|
36
37
|
/**
|
|
37
38
|
* Use the <a href="#.Initialize">Initialize</a> method to initialize a new client.
|
|
38
39
|
*
|
|
@@ -75,6 +76,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
75
76
|
key: "Log",
|
|
76
77
|
value: function Log(message) {
|
|
77
78
|
var error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
79
|
+
var errorObject = arguments.length > 2 ? arguments[2] : undefined;
|
|
78
80
|
|
|
79
81
|
if (error) {
|
|
80
82
|
// eslint-disable-next-line no-console
|
|
@@ -83,6 +85,11 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
83
85
|
// eslint-disable-next-line no-console
|
|
84
86
|
console.log("Eluvio Wallet Client:", message);
|
|
85
87
|
}
|
|
88
|
+
|
|
89
|
+
if (errorObject) {
|
|
90
|
+
// eslint-disable-next-line no-console
|
|
91
|
+
console.error(errorObject);
|
|
92
|
+
}
|
|
86
93
|
}
|
|
87
94
|
/**
|
|
88
95
|
* Initialize the wallet client.
|
|
@@ -210,7 +217,16 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
210
217
|
url = new URL(this.appUrl);
|
|
211
218
|
url.hash = UrlJoin("/action", "sign", Utils.B58(JSON.stringify(parameters)));
|
|
212
219
|
url.searchParams.set("origin", window.location.origin);
|
|
213
|
-
|
|
220
|
+
|
|
221
|
+
if (!(!embedded && window.location.origin === url.origin)) {
|
|
222
|
+
_context3.next = 27;
|
|
223
|
+
break;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
throw Error("ElvWalletClient: Unable to sign");
|
|
227
|
+
|
|
228
|
+
case 27:
|
|
229
|
+
_context3.next = 29;
|
|
214
230
|
return new Promise( /*#__PURE__*/function () {
|
|
215
231
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(resolve, reject) {
|
|
216
232
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
@@ -275,10 +291,10 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
275
291
|
};
|
|
276
292
|
}());
|
|
277
293
|
|
|
278
|
-
case
|
|
294
|
+
case 29:
|
|
279
295
|
return _context3.abrupt("return", _context3.sent);
|
|
280
296
|
|
|
281
|
-
case
|
|
297
|
+
case 30:
|
|
282
298
|
case "end":
|
|
283
299
|
return _context3.stop();
|
|
284
300
|
}
|
|
@@ -558,7 +574,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
558
574
|
this.client.SetStaticToken({
|
|
559
575
|
token: decodedToken.fabricToken
|
|
560
576
|
});
|
|
561
|
-
return _context7.abrupt("return", this.SetAuthorization(decodedToken));
|
|
577
|
+
return _context7.abrupt("return", this.SetAuthorization(_objectSpread({}, decodedToken)));
|
|
562
578
|
|
|
563
579
|
case 15:
|
|
564
580
|
case "end":
|
|
@@ -670,7 +686,8 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
670
686
|
expiresAt: expiresAt,
|
|
671
687
|
signerURIs: signerURIs,
|
|
672
688
|
walletType: "Custodial",
|
|
673
|
-
walletName: "Eluvio"
|
|
689
|
+
walletName: "Eluvio",
|
|
690
|
+
register: true
|
|
674
691
|
}),
|
|
675
692
|
signingToken: this.SetAuthorization({
|
|
676
693
|
clusterToken: this.client.signer.authToken,
|
|
@@ -775,7 +792,8 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
775
792
|
address: address,
|
|
776
793
|
expiresAt: expiresAt,
|
|
777
794
|
walletType: "External",
|
|
778
|
-
walletName: walletName
|
|
795
|
+
walletName: walletName,
|
|
796
|
+
register: true
|
|
779
797
|
}));
|
|
780
798
|
|
|
781
799
|
case 9:
|
|
@@ -821,6 +839,8 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
821
839
|
}, {
|
|
822
840
|
key: "SetAuthorization",
|
|
823
841
|
value: function SetAuthorization(_ref10) {
|
|
842
|
+
var _this3 = this;
|
|
843
|
+
|
|
824
844
|
var clusterToken = _ref10.clusterToken,
|
|
825
845
|
fabricToken = _ref10.fabricToken,
|
|
826
846
|
tenantId = _ref10.tenantId,
|
|
@@ -829,7 +849,9 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
829
849
|
expiresAt = _ref10.expiresAt,
|
|
830
850
|
signerURIs = _ref10.signerURIs,
|
|
831
851
|
walletType = _ref10.walletType,
|
|
832
|
-
walletName = _ref10.walletName
|
|
852
|
+
walletName = _ref10.walletName,
|
|
853
|
+
_ref10$register = _ref10.register,
|
|
854
|
+
register = _ref10$register === void 0 ? false : _ref10$register;
|
|
833
855
|
address = this.client.utils.FormatAddress(address);
|
|
834
856
|
this.__authorization = {
|
|
835
857
|
fabricToken: fabricToken,
|
|
@@ -859,6 +881,18 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
859
881
|
} catch (error) {}
|
|
860
882
|
}
|
|
861
883
|
|
|
884
|
+
if (register) {
|
|
885
|
+
this.client.authClient.MakeAuthServiceRequest({
|
|
886
|
+
path: "/as/wlt/register",
|
|
887
|
+
method: "POST",
|
|
888
|
+
headers: {
|
|
889
|
+
Authorization: "Bearer ".concat(this.AuthToken())
|
|
890
|
+
}
|
|
891
|
+
})["catch"](function (error) {
|
|
892
|
+
_this3.Log("Failed to register account: ", true, error);
|
|
893
|
+
});
|
|
894
|
+
}
|
|
895
|
+
|
|
862
896
|
return token;
|
|
863
897
|
}
|
|
864
898
|
}, {
|
|
@@ -926,7 +960,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
926
960
|
key: "LoadAvailableMarketplaces",
|
|
927
961
|
value: function () {
|
|
928
962
|
var _LoadAvailableMarketplaces = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
|
|
929
|
-
var
|
|
963
|
+
var _this4 = this;
|
|
930
964
|
|
|
931
965
|
var forceReload,
|
|
932
966
|
mainSiteHash,
|
|
@@ -983,7 +1017,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
983
1017
|
try {
|
|
984
1018
|
var versionHash = metadata[tenantSlug].marketplaces[marketplaceSlug]["."].source;
|
|
985
1019
|
|
|
986
|
-
var objectId =
|
|
1020
|
+
var objectId = _this4.utils.DecodeVersionHash(versionHash).objectId;
|
|
987
1021
|
|
|
988
1022
|
availableMarketplaces[tenantSlug][marketplaceSlug] = _objectSpread(_objectSpread({}, metadata[tenantSlug].marketplaces[marketplaceSlug].info || {}), {}, {
|
|
989
1023
|
tenantName: metadata[tenantSlug].marketplaces[marketplaceSlug].info.tenant_name,
|
|
@@ -997,21 +1031,19 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
997
1031
|
})
|
|
998
1032
|
});
|
|
999
1033
|
availableMarketplacesById[objectId] = availableMarketplaces[tenantSlug][marketplaceSlug];
|
|
1000
|
-
|
|
1034
|
+
_this4.marketplaceHashes[objectId] = versionHash; // Fill out selected marketplace info
|
|
1001
1035
|
|
|
1002
|
-
if (
|
|
1003
|
-
if (
|
|
1004
|
-
|
|
1036
|
+
if (_this4.selectedMarketplaceInfo) {
|
|
1037
|
+
if (_this4.selectedMarketplaceInfo.tenantSlug === tenantSlug && _this4.selectedMarketplaceInfo.marketplaceSlug === marketplaceSlug || _this4.selectedMarketplaceInfo.marketplaceId === objectId) {
|
|
1038
|
+
_this4.selectedMarketplaceInfo = availableMarketplaces[tenantSlug][marketplaceSlug];
|
|
1005
1039
|
}
|
|
1006
1040
|
}
|
|
1007
1041
|
} catch (error) {
|
|
1008
|
-
|
|
1042
|
+
_this4.Log("Eluvio Wallet Client: Unable to load info for marketplace ".concat(tenantSlug, "/").concat(marketplaceSlug), true);
|
|
1009
1043
|
}
|
|
1010
1044
|
});
|
|
1011
1045
|
} catch (error) {
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
_this3.Log(error, true);
|
|
1046
|
+
_this4.Log("Eluvio Wallet Client: Failed to load tenant info ".concat(tenantSlug), true, error);
|
|
1015
1047
|
}
|
|
1016
1048
|
});
|
|
1017
1049
|
this.availableMarketplaces = availableMarketplaces;
|
|
@@ -1078,7 +1110,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
1078
1110
|
key: "LoadMarketplace",
|
|
1079
1111
|
value: function () {
|
|
1080
1112
|
var _LoadMarketplace = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(marketplaceParams) {
|
|
1081
|
-
var
|
|
1113
|
+
var _this5 = this;
|
|
1082
1114
|
|
|
1083
1115
|
var marketplaceInfo, marketplaceId, marketplaceHash, marketplace;
|
|
1084
1116
|
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
@@ -1133,7 +1165,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
1133
1165
|
break;
|
|
1134
1166
|
}
|
|
1135
1167
|
|
|
1136
|
-
if (
|
|
1168
|
+
if (_this5.loggedIn) {
|
|
1137
1169
|
_context14.next = 5;
|
|
1138
1170
|
break;
|
|
1139
1171
|
}
|
|
@@ -1145,7 +1177,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
1145
1177
|
case 5:
|
|
1146
1178
|
_context14.prev = 5;
|
|
1147
1179
|
_context14.next = 8;
|
|
1148
|
-
return
|
|
1180
|
+
return _this5.client.ContentObjectMetadata({
|
|
1149
1181
|
versionHash: LinkTargetHash(item.nft_template),
|
|
1150
1182
|
metadataSubtree: "permissioned"
|
|
1151
1183
|
});
|
|
@@ -1195,8 +1227,8 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
1195
1227
|
var embedUrl = new URL("https://embed.v3.contentfabric.io");
|
|
1196
1228
|
var targetHash = LinkTargetHash(marketplace.storefront[key]);
|
|
1197
1229
|
embedUrl.searchParams.set("p", "");
|
|
1198
|
-
embedUrl.searchParams.set("net",
|
|
1199
|
-
embedUrl.searchParams.set("ath", (
|
|
1230
|
+
embedUrl.searchParams.set("net", _this5.network === "main" ? "main" : "demo");
|
|
1231
|
+
embedUrl.searchParams.set("ath", (_this5.__authorization || {}).authToken || _this5.publicStaticToken);
|
|
1200
1232
|
embedUrl.searchParams.set("vid", targetHash);
|
|
1201
1233
|
embedUrl.searchParams.set("ap", "");
|
|
1202
1234
|
|
|
@@ -1402,26 +1434,26 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
1402
1434
|
|
|
1403
1435
|
if (priceRange) {
|
|
1404
1436
|
if (priceRange.min) {
|
|
1405
|
-
filters.push("price:
|
|
1437
|
+
filters.push("price:gte:".concat(parseFloat(priceRange.min)));
|
|
1406
1438
|
}
|
|
1407
1439
|
|
|
1408
1440
|
if (priceRange.max) {
|
|
1409
|
-
filters.push("price:
|
|
1441
|
+
filters.push("price:lte:".concat(parseFloat(priceRange.max)));
|
|
1410
1442
|
}
|
|
1411
1443
|
}
|
|
1412
1444
|
|
|
1413
1445
|
if (tokenIdRange) {
|
|
1414
1446
|
if (tokenIdRange.min) {
|
|
1415
|
-
filters.push("info/
|
|
1447
|
+
filters.push("info/token_id:gte:".concat(parseInt(tokenIdRange.min)));
|
|
1416
1448
|
}
|
|
1417
1449
|
|
|
1418
1450
|
if (tokenIdRange.max) {
|
|
1419
|
-
filters.push("info/
|
|
1451
|
+
filters.push("info/token_id:lte:".concat(parseInt(tokenIdRange.max)));
|
|
1420
1452
|
}
|
|
1421
1453
|
}
|
|
1422
1454
|
|
|
1423
1455
|
if (capLimit) {
|
|
1424
|
-
filters.push("info/cap:
|
|
1456
|
+
filters.push("info/cap:lte:".concat(parseInt(capLimit)));
|
|
1425
1457
|
}
|
|
1426
1458
|
|
|
1427
1459
|
_context16.t0 = mode;
|
|
@@ -1643,11 +1675,10 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
1643
1675
|
case 13:
|
|
1644
1676
|
_context17.prev = 13;
|
|
1645
1677
|
_context17.t0 = _context17["catch"](6);
|
|
1646
|
-
this.Log("Failed to retrieve minting status", true);
|
|
1647
|
-
this.Log(_context17.t0);
|
|
1678
|
+
this.Log("Failed to retrieve minting status", true, _context17.t0);
|
|
1648
1679
|
return _context17.abrupt("return", []);
|
|
1649
1680
|
|
|
1650
|
-
case
|
|
1681
|
+
case 17:
|
|
1651
1682
|
case "end":
|
|
1652
1683
|
return _context17.stop();
|
|
1653
1684
|
}
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const {ElvClient} = require("./ElvClient.js");
|
|
2
|
-
const {
|
|
2
|
+
const {ElvWalletClient} = require("./walletClient/index.js");
|
|
3
3
|
const Utils = require("./Utils.js");
|
|
4
4
|
|
|
5
5
|
exports.ElvClient = ElvClient;
|
|
6
|
-
exports.
|
|
6
|
+
exports.ElvWalletClient = ElvWalletClient;
|
|
7
7
|
exports.Utils = Utils;
|
|
@@ -317,8 +317,7 @@ exports.TenantConfiguration = async function({tenantId, contractAddress}) {
|
|
|
317
317
|
})
|
|
318
318
|
);
|
|
319
319
|
} catch(error) {
|
|
320
|
-
this.Log("Failed to load tenant configuration", true);
|
|
321
|
-
this.Log(error, true);
|
|
320
|
+
this.Log("Failed to load tenant configuration", true, error);
|
|
322
321
|
|
|
323
322
|
return {};
|
|
324
323
|
}
|
|
@@ -6,6 +6,7 @@ const Utils = require("../Utils");
|
|
|
6
6
|
const Ethers = require("ethers");
|
|
7
7
|
|
|
8
8
|
const inBrowser = typeof window !== "undefined";
|
|
9
|
+
const embedded = inBrowser && window.top !== window.self;
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Use the <a href="#.Initialize">Initialize</a> method to initialize a new client.
|
|
@@ -39,7 +40,7 @@ class ElvWalletClient {
|
|
|
39
40
|
this.utils = client.utils;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
Log(message, error=false) {
|
|
43
|
+
Log(message, error=false, errorObject) {
|
|
43
44
|
if(error) {
|
|
44
45
|
// eslint-disable-next-line no-console
|
|
45
46
|
console.error("Eluvio Wallet Client:", message);
|
|
@@ -47,6 +48,11 @@ class ElvWalletClient {
|
|
|
47
48
|
// eslint-disable-next-line no-console
|
|
48
49
|
console.log("Eluvio Wallet Client:", message);
|
|
49
50
|
}
|
|
51
|
+
|
|
52
|
+
if(errorObject) {
|
|
53
|
+
// eslint-disable-next-line no-console
|
|
54
|
+
console.error(errorObject);
|
|
55
|
+
}
|
|
50
56
|
}
|
|
51
57
|
|
|
52
58
|
/**
|
|
@@ -130,8 +136,7 @@ class ElvWalletClient {
|
|
|
130
136
|
CanSign() {
|
|
131
137
|
if(!this.loggedIn) { return false; }
|
|
132
138
|
|
|
133
|
-
return !!this.__authorization.clusterToken ||
|
|
134
|
-
(inBrowser && !!(this.UserInfo().walletName.toLowerCase() === "metamask" && window.ethereum && window.ethereum.isMetaMask && window.ethereum.chainId));
|
|
139
|
+
return !!this.__authorization.clusterToken || (inBrowser && !!(this.UserInfo().walletName.toLowerCase() === "metamask" && window.ethereum && window.ethereum.isMetaMask && window.ethereum.chainId));
|
|
135
140
|
}
|
|
136
141
|
|
|
137
142
|
/**
|
|
@@ -182,6 +187,11 @@ class ElvWalletClient {
|
|
|
182
187
|
url.hash = UrlJoin("/action", "sign", Utils.B58(JSON.stringify(parameters)));
|
|
183
188
|
url.searchParams.set("origin", window.location.origin);
|
|
184
189
|
|
|
190
|
+
if(!embedded && window.location.origin === url.origin) {
|
|
191
|
+
// Already in wallet app, but still can't sign
|
|
192
|
+
throw Error("ElvWalletClient: Unable to sign");
|
|
193
|
+
}
|
|
194
|
+
|
|
185
195
|
return await new Promise(async (resolve, reject) => {
|
|
186
196
|
await ActionPopup({
|
|
187
197
|
mode: "tab",
|
|
@@ -339,7 +349,7 @@ class ElvWalletClient {
|
|
|
339
349
|
|
|
340
350
|
this.client.SetStaticToken({token: decodedToken.fabricToken});
|
|
341
351
|
|
|
342
|
-
return this.SetAuthorization(decodedToken);
|
|
352
|
+
return this.SetAuthorization({...decodedToken});
|
|
343
353
|
}
|
|
344
354
|
|
|
345
355
|
/**
|
|
@@ -396,7 +406,8 @@ class ElvWalletClient {
|
|
|
396
406
|
expiresAt,
|
|
397
407
|
signerURIs,
|
|
398
408
|
walletType: "Custodial",
|
|
399
|
-
walletName: "Eluvio"
|
|
409
|
+
walletName: "Eluvio",
|
|
410
|
+
register: true
|
|
400
411
|
}),
|
|
401
412
|
signingToken: this.SetAuthorization({
|
|
402
413
|
clusterToken: this.client.signer.authToken,
|
|
@@ -444,7 +455,7 @@ class ElvWalletClient {
|
|
|
444
455
|
addEthereumPrefix: false
|
|
445
456
|
});
|
|
446
457
|
|
|
447
|
-
return this.SetAuthorization({fabricToken, address, expiresAt, walletType: "External", walletName});
|
|
458
|
+
return this.SetAuthorization({fabricToken, address, expiresAt, walletType: "External", walletName, register: true});
|
|
448
459
|
}
|
|
449
460
|
|
|
450
461
|
/**
|
|
@@ -468,7 +479,7 @@ class ElvWalletClient {
|
|
|
468
479
|
return this.__authorization.fabricToken;
|
|
469
480
|
}
|
|
470
481
|
|
|
471
|
-
SetAuthorization({clusterToken, fabricToken, tenantId, address, email, expiresAt, signerURIs, walletType, walletName}) {
|
|
482
|
+
SetAuthorization({clusterToken, fabricToken, tenantId, address, email, expiresAt, signerURIs, walletType, walletName, register=false}) {
|
|
472
483
|
address = this.client.utils.FormatAddress(address);
|
|
473
484
|
|
|
474
485
|
this.__authorization = {
|
|
@@ -502,6 +513,19 @@ class ElvWalletClient {
|
|
|
502
513
|
} catch(error) {}
|
|
503
514
|
}
|
|
504
515
|
|
|
516
|
+
if(register) {
|
|
517
|
+
this.client.authClient.MakeAuthServiceRequest({
|
|
518
|
+
path: "/as/wlt/register",
|
|
519
|
+
method: "POST",
|
|
520
|
+
headers: {
|
|
521
|
+
Authorization: `Bearer ${this.AuthToken()}`
|
|
522
|
+
}
|
|
523
|
+
})
|
|
524
|
+
.catch(error => {
|
|
525
|
+
this.Log("Failed to register account: ", true, error);
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
|
|
505
529
|
return token;
|
|
506
530
|
}
|
|
507
531
|
|
|
@@ -524,7 +548,6 @@ class ElvWalletClient {
|
|
|
524
548
|
}
|
|
525
549
|
|
|
526
550
|
|
|
527
|
-
|
|
528
551
|
// Internal loading methods
|
|
529
552
|
|
|
530
553
|
|
|
@@ -597,8 +620,7 @@ class ElvWalletClient {
|
|
|
597
620
|
}
|
|
598
621
|
});
|
|
599
622
|
} catch(error) {
|
|
600
|
-
this.Log(`Eluvio Wallet Client: Failed to load tenant info ${tenantSlug}`, true);
|
|
601
|
-
this.Log(error, true);
|
|
623
|
+
this.Log(`Eluvio Wallet Client: Failed to load tenant info ${tenantSlug}`, true, error);
|
|
602
624
|
}
|
|
603
625
|
});
|
|
604
626
|
|
|
@@ -831,26 +853,26 @@ class ElvWalletClient {
|
|
|
831
853
|
|
|
832
854
|
if(priceRange) {
|
|
833
855
|
if(priceRange.min) {
|
|
834
|
-
filters.push(`price:
|
|
856
|
+
filters.push(`price:ge:${parseFloat(priceRange.min)}`);
|
|
835
857
|
}
|
|
836
858
|
|
|
837
859
|
if(priceRange.max) {
|
|
838
|
-
filters.push(`price:
|
|
860
|
+
filters.push(`price:le:${parseFloat(priceRange.max)}`);
|
|
839
861
|
}
|
|
840
862
|
}
|
|
841
863
|
|
|
842
864
|
if(tokenIdRange) {
|
|
843
865
|
if(tokenIdRange.min) {
|
|
844
|
-
filters.push(`info/
|
|
866
|
+
filters.push(`info/token_id:ge:${parseInt(tokenIdRange.min)}`);
|
|
845
867
|
}
|
|
846
868
|
|
|
847
869
|
if(tokenIdRange.max) {
|
|
848
|
-
filters.push(`info/
|
|
870
|
+
filters.push(`info/token_id:le:${parseInt(tokenIdRange.max)}`);
|
|
849
871
|
}
|
|
850
872
|
}
|
|
851
873
|
|
|
852
874
|
if(capLimit) {
|
|
853
|
-
filters.push(`info/cap:
|
|
875
|
+
filters.push(`info/cap:le:${parseInt(capLimit)}`);
|
|
854
876
|
}
|
|
855
877
|
|
|
856
878
|
|
|
@@ -996,8 +1018,7 @@ class ElvWalletClient {
|
|
|
996
1018
|
})
|
|
997
1019
|
.sort((a, b) => a.ts < b.ts ? 1 : -1);
|
|
998
1020
|
} catch(error) {
|
|
999
|
-
this.Log("Failed to retrieve minting status", true);
|
|
1000
|
-
this.Log(error);
|
|
1021
|
+
this.Log("Failed to retrieve minting status", true, error);
|
|
1001
1022
|
|
|
1002
1023
|
return [];
|
|
1003
1024
|
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
const { ElvMarketplaceClient } = require("../src/walletClient/ElvMarketplaceClient");
|
|
2
|
-
const ClientConfiguration = require("../TestConfiguration.json");
|
|
3
|
-
|
|
4
|
-
const Test = async () => {
|
|
5
|
-
try {
|
|
6
|
-
const idToken = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Inlwd1ZUbXJkWENkYU5tcjAzVGRDaCJ9.eyJodHRwczovL2F1dGguY29udGVudGZhYnJpYy5pby9nZW8iOnsiY291bnRyeV9jb2RlIjoiVVMiLCJjb3VudHJ5X2NvZGUzIjoiVVNBIiwiY291bnRyeV9uYW1lIjoiVW5pdGVkIFN0YXRlcyIsImNpdHlfbmFtZSI6IlJhbmNobyBDb3Jkb3ZhIiwibGF0aXR1ZGUiOjM4LjYxMDYsImxvbmdpdHVkZSI6LTEyMS4yNzg5LCJ0aW1lX3pvbmUiOiJBbWVyaWNhL0xvc19BbmdlbGVzIiwiY29udGluZW50X2NvZGUiOiJOQSIsInN1YmRpdmlzaW9uX2NvZGUiOiJDQSIsInN1YmRpdmlzaW9uX25hbWUiOiJDYWxpZm9ybmlhIn0sIm5pY2tuYW1lIjoia2V2aW4rNyIsIm5hbWUiOiJrZXZpbis3QGVsdXYuaW8iLCJwaWN0dXJlIjoiaHR0cHM6Ly9zLmdyYXZhdGFyLmNvbS9hdmF0YXIvZmQ0MzE3ZjhmN2YzMGM1NWRlMDZhMjljYTFjYjY5ZjE_cz00ODAmcj1wZyZkPWh0dHBzJTNBJTJGJTJGY2RuLmF1dGgwLmNvbSUyRmF2YXRhcnMlMkZrZS5wbmciLCJ1cGRhdGVkX2F0IjoiMjAyMi0wNi0xN1QxOTo1Nzo0NC4yODZaIiwiZW1haWwiOiJrZXZpbis3QGVsdXYuaW8iLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsImlzcyI6Imh0dHBzOi8vYXV0aC5jb250ZW50ZmFicmljLmlvLyIsInN1YiI6ImF1dGgwfDYxNjY3NzE3ODk5YjkyMDA3MGYzNGFjNCIsImF1ZCI6Ik9OeXViUDlyRkk1Qkh6bVlnbFFLQloxYkJiaXlvQjNTIiwiaWF0IjoxNjU1NDk1ODY1LCJleHAiOjE2NTU1MzE4NjUsIm5vbmNlIjoiY0c4MlFrTkplV2wwU1U1RVVrOUpaR1kwTW1oRlZXaFpOSE5LVGxZNU5VWjJjRmwwWkhwVmIxQjJNQT09In0.dPBk0hGjHAW5Dz8yfhW0IEG-ArJ258Q7x3dYMz0tIIj9EUY438issp0rJwfoAVWu4hw6SBUGNS2bnAZ9bvhag8IMZm_YYRfKTnY7gV7ST_-ni72mQ04F2Kpc9H2jzNKwRWqdKdXy3Rp0YoIR1PYOTwk2BWJtiqoyA11og-QNiI4pBEhZ6JRyDO7693jPoGXdUPJpXPHsfEJqLbGM8BYcv5X-PwVnU8TzSqgFpB5G4pZSfnoyz26wbmpFs5jc2_QgWAIvc94pW-cwpMbfpHb10LejrBFbO9FW3Sv6eOPY9W-AuxAj1UT-ZDJytNRD72R0aFKlv8r0fvOiTDWGXE4P5g";
|
|
7
|
-
|
|
8
|
-
const marketplaceClient = await ElvMarketplaceClient.Initialize({
|
|
9
|
-
configUrl: ClientConfiguration["config-url"]
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
const token = await marketplaceClient.AuthenticateOAuth({
|
|
13
|
-
idToken
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
console.log(token);
|
|
17
|
-
} catch(error) {
|
|
18
|
-
console.error(error);
|
|
19
|
-
console.error(JSON.stringify(error, null, 2));
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
process.exit(0);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
Test();
|