@eluvio/elv-client-js 3.1.91 → 3.1.94
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/ElvClient-min.js +7 -7
- package/dist/ElvClient-node-min.js +12 -12
- package/dist/ElvFrameClient-min.js +6 -6
- package/dist/ElvPermissionsClient-min.js +5 -5
- package/dist/src/AuthorizationClient.js +2 -2
- package/dist/src/HttpClient.js +2 -2
- package/dist/src/UserProfileClient.js +31 -18
- package/dist/src/Utils.js +173 -1
- package/dist/src/client/ContentAccess.js +67 -50
- package/dist/src/client/ContentManagement.js +20 -12
- package/dist/src/client/NFT.js +23 -68
- package/package-lock.json +15239 -910
- package/package.json +2 -1
- package/src/HttpClient.js +2 -2
- package/src/Utils.js +119 -0
- package/src/client/ABRPublishing.js +2 -1
- package/src/client/NFT.js +14 -49
- package/testScripts/VariantABRProfile.js +45 -0
- package/utilities/SimpleIngest.js +245 -0
package/dist/src/client/NFT.js
CHANGED
|
@@ -25,9 +25,8 @@ var _require = require("../Validation"),
|
|
|
25
25
|
* @methodGroup Minting
|
|
26
26
|
* @namedParams
|
|
27
27
|
* @param {string} tenantId - The ID of the tenant
|
|
28
|
-
* @param {string=} email - The email of the NFT recipient
|
|
29
28
|
* @param {string=} address - The address of the NFT recipient
|
|
30
|
-
* @param {string}
|
|
29
|
+
* @param {string} marketplaceId - The ID of the marketplace containing the NFT
|
|
31
30
|
* @param {Array<Object>} items - List of items
|
|
32
31
|
* @param {string} items.sku - SKU of the NFT
|
|
33
32
|
* @param {number=} items.quantity=1 - Number to mint
|
|
@@ -40,59 +39,22 @@ var _require = require("../Validation"),
|
|
|
40
39
|
|
|
41
40
|
|
|
42
41
|
exports.MintNFT = function _callee(_ref) {
|
|
43
|
-
var tenantId,
|
|
42
|
+
var tenantId, address, marketplaceId, items, _ref$extraData, extraData, requestBody, transactionId, mintSignature;
|
|
44
43
|
|
|
45
44
|
return _regeneratorRuntime.async(function _callee$(_context) {
|
|
46
45
|
while (1) {
|
|
47
46
|
switch (_context.prev = _context.next) {
|
|
48
47
|
case 0:
|
|
49
|
-
tenantId = _ref.tenantId,
|
|
48
|
+
tenantId = _ref.tenantId, address = _ref.address, marketplaceId = _ref.marketplaceId, items = _ref.items, _ref$extraData = _ref.extraData, extraData = _ref$extraData === void 0 ? {} : _ref$extraData;
|
|
50
49
|
ValidatePresence("tenantId", tenantId);
|
|
51
|
-
ValidatePresence("
|
|
52
|
-
ValidatePresence("
|
|
50
|
+
ValidatePresence("address", address);
|
|
51
|
+
ValidatePresence("marketplaceId", marketplaceId);
|
|
53
52
|
ValidatePresence("items", items);
|
|
54
|
-
ValidateObject(
|
|
55
|
-
|
|
56
|
-
accountInitializationBody = {
|
|
57
|
-
ts: Date.now()
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
if (email) {
|
|
61
|
-
accountInitializationBody.email = email;
|
|
62
|
-
} else {
|
|
63
|
-
accountInitializationBody.addr = address;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
_context.next = 10;
|
|
67
|
-
return _regeneratorRuntime.awrap(this.Sign(JSON.stringify(accountInitializationBody)));
|
|
68
|
-
|
|
69
|
-
case 10:
|
|
70
|
-
accountInitializationSignature = _context.sent;
|
|
71
|
-
_context.t0 = _regeneratorRuntime;
|
|
72
|
-
_context.t1 = this.utils;
|
|
73
|
-
_context.next = 15;
|
|
74
|
-
return _regeneratorRuntime.awrap(this.authClient.MakeAuthServiceRequest({
|
|
75
|
-
method: "POST",
|
|
76
|
-
path: "/as/tnt/prov/eth/".concat(tenantId),
|
|
77
|
-
body: accountInitializationBody,
|
|
78
|
-
headers: {
|
|
79
|
-
"Authorization": "Bearer ".concat(accountInitializationSignature)
|
|
80
|
-
}
|
|
81
|
-
}));
|
|
82
|
-
|
|
83
|
-
case 15:
|
|
84
|
-
_context.t2 = _context.sent;
|
|
85
|
-
_context.t3 = _context.t1.ResponseToJson.call(_context.t1, _context.t2);
|
|
86
|
-
_context.next = 19;
|
|
87
|
-
return _context.t0.awrap.call(_context.t0, _context.t3);
|
|
88
|
-
|
|
89
|
-
case 19:
|
|
90
|
-
_ref2 = _context.sent;
|
|
91
|
-
addr = _ref2.addr;
|
|
92
|
-
address = this.utils.FormatAddress(addr);
|
|
53
|
+
ValidateObject(marketplaceId);
|
|
54
|
+
ValidateAddress(address);
|
|
93
55
|
requestBody = {
|
|
94
|
-
|
|
95
|
-
|
|
56
|
+
tickets: null,
|
|
57
|
+
products: items.map(function (item) {
|
|
96
58
|
return {
|
|
97
59
|
sku: item.sku,
|
|
98
60
|
quant: item.quantity || 1,
|
|
@@ -101,44 +63,37 @@ exports.MintNFT = function _callee(_ref) {
|
|
|
101
63
|
}) : _objectSpread({}, item.extraData || {})
|
|
102
64
|
};
|
|
103
65
|
}),
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
66
|
+
ident: address,
|
|
67
|
+
cust_name: address,
|
|
68
|
+
extra: _objectSpread({}, extraData, {
|
|
69
|
+
elv_addr: address
|
|
70
|
+
})
|
|
107
71
|
};
|
|
108
|
-
ValidateAddress(address);
|
|
109
|
-
|
|
110
|
-
if (email) {
|
|
111
|
-
requestBody.email = email;
|
|
112
|
-
} else {
|
|
113
|
-
requestBody.addr = address;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
requestBody.extra.elv_addr = address;
|
|
117
72
|
transactionId = this.utils.B58(UUID.parse(UUID.v4()));
|
|
118
73
|
requestBody.ts = Date.now();
|
|
119
74
|
requestBody.trans_id = transactionId;
|
|
120
|
-
_context.next =
|
|
75
|
+
_context.next = 13;
|
|
121
76
|
return _regeneratorRuntime.awrap(this.Sign(JSON.stringify(requestBody)));
|
|
122
77
|
|
|
123
|
-
case
|
|
78
|
+
case 13:
|
|
124
79
|
mintSignature = _context.sent;
|
|
125
|
-
_context.next =
|
|
80
|
+
_context.next = 16;
|
|
126
81
|
return _regeneratorRuntime.awrap(this.authClient.MakeAuthServiceRequest({
|
|
127
82
|
method: "POST",
|
|
128
|
-
path: "/as/
|
|
83
|
+
path: UrlJoin("/as/tnt/trans/base", tenantId, marketplaceId),
|
|
129
84
|
body: requestBody,
|
|
130
85
|
headers: {
|
|
131
86
|
"Authorization": "Bearer ".concat(mintSignature)
|
|
132
87
|
}
|
|
133
88
|
}));
|
|
134
89
|
|
|
135
|
-
case
|
|
90
|
+
case 16:
|
|
136
91
|
return _context.abrupt("return", {
|
|
137
92
|
address: address,
|
|
138
93
|
transactionId: transactionId
|
|
139
94
|
});
|
|
140
95
|
|
|
141
|
-
case
|
|
96
|
+
case 17:
|
|
142
97
|
case "end":
|
|
143
98
|
return _context.stop();
|
|
144
99
|
}
|
|
@@ -163,14 +118,14 @@ exports.MintNFT = function _callee(_ref) {
|
|
|
163
118
|
*/
|
|
164
119
|
|
|
165
120
|
|
|
166
|
-
exports.CollectionTransactions = function _callee2(
|
|
167
|
-
var tenantId, collectionId,
|
|
121
|
+
exports.CollectionTransactions = function _callee2(_ref2) {
|
|
122
|
+
var tenantId, collectionId, _ref2$filterOptions, filterOptions, ts, queryParams, allowedOptions, path, signature;
|
|
168
123
|
|
|
169
124
|
return _regeneratorRuntime.async(function _callee2$(_context2) {
|
|
170
125
|
while (1) {
|
|
171
126
|
switch (_context2.prev = _context2.next) {
|
|
172
127
|
case 0:
|
|
173
|
-
tenantId =
|
|
128
|
+
tenantId = _ref2.tenantId, collectionId = _ref2.collectionId, _ref2$filterOptions = _ref2.filterOptions, filterOptions = _ref2$filterOptions === void 0 ? {} : _ref2$filterOptions;
|
|
174
129
|
ts = Date.now();
|
|
175
130
|
queryParams = {
|
|
176
131
|
ts: ts
|