@eluvio/elv-client-js 3.1.96 → 3.1.97
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 +11 -15
- package/dist/ElvClient-node-min.js +13 -17
- package/dist/ElvFrameClient-min.js +9 -13
- package/dist/ElvPermissionsClient-min.js +9 -13
- package/dist/src/AuthorizationClient.js +1980 -2238
- package/dist/src/ContentObjectVerification.js +173 -164
- package/dist/src/Crypto.js +324 -376
- package/dist/src/ElvClient.js +1019 -1182
- package/dist/src/ElvWallet.js +95 -119
- package/dist/src/EthClient.js +896 -1040
- package/dist/src/FrameClient.js +300 -331
- package/dist/src/HttpClient.js +147 -153
- package/dist/src/Id.js +3 -1
- package/dist/src/PermissionsClient.js +1168 -1294
- package/dist/src/RemoteSigner.js +211 -263
- package/dist/src/UserProfileClient.js +1023 -1164
- package/dist/src/Utils.js +197 -209
- package/dist/src/client/ABRPublishing.js +858 -895
- package/dist/src/client/AccessGroups.js +959 -1102
- package/dist/src/client/ContentAccess.js +3434 -3727
- package/dist/src/client/ContentManagement.js +2068 -2252
- package/dist/src/client/Contracts.js +563 -647
- package/dist/src/client/Files.js +1757 -1886
- package/dist/src/client/NFT.js +112 -126
- package/dist/src/client/NTP.js +422 -478
- package/package-lock.json +22001 -0
- package/package.json +1 -1
- package/src/Utils.js +22 -0
package/dist/src/client/NFT.js
CHANGED
|
@@ -2,11 +2,9 @@ var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
|
2
2
|
|
|
3
3
|
var _defineProperty = require("@babel/runtime/helpers/defineProperty");
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
6
6
|
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
10
8
|
|
|
11
9
|
/**
|
|
12
10
|
* Methods for creating and managing NFTs
|
|
@@ -40,74 +38,68 @@ var _require = require("../Validation"),
|
|
|
40
38
|
*/
|
|
41
39
|
|
|
42
40
|
|
|
43
|
-
exports.MintNFT =
|
|
44
|
-
var
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
return _context.stop();
|
|
102
|
-
}
|
|
41
|
+
exports.MintNFT = function _callee(_ref) {
|
|
42
|
+
var tenantId, address, marketplaceId, items, _ref$extraData, extraData, requestBody, transactionId, mintSignature;
|
|
43
|
+
|
|
44
|
+
return _regeneratorRuntime.async(function _callee$(_context) {
|
|
45
|
+
while (1) {
|
|
46
|
+
switch (_context.prev = _context.next) {
|
|
47
|
+
case 0:
|
|
48
|
+
tenantId = _ref.tenantId, address = _ref.address, marketplaceId = _ref.marketplaceId, items = _ref.items, _ref$extraData = _ref.extraData, extraData = _ref$extraData === void 0 ? {} : _ref$extraData;
|
|
49
|
+
ValidatePresence("tenantId", tenantId);
|
|
50
|
+
ValidatePresence("address", address);
|
|
51
|
+
ValidatePresence("marketplaceId", marketplaceId);
|
|
52
|
+
ValidatePresence("items", items);
|
|
53
|
+
ValidateObject(marketplaceId);
|
|
54
|
+
ValidateAddress(address);
|
|
55
|
+
requestBody = {
|
|
56
|
+
tickets: null,
|
|
57
|
+
products: items.map(function (item) {
|
|
58
|
+
return {
|
|
59
|
+
sku: item.sku,
|
|
60
|
+
quant: item.quantity || 1,
|
|
61
|
+
extra: item.tokenId ? _objectSpread({}, item.extraData || {}, {
|
|
62
|
+
token_id: item.tokenId
|
|
63
|
+
}) : _objectSpread({}, item.extraData || {})
|
|
64
|
+
};
|
|
65
|
+
}),
|
|
66
|
+
ident: address,
|
|
67
|
+
cust_name: address,
|
|
68
|
+
extra: _objectSpread({}, extraData, {
|
|
69
|
+
elv_addr: address
|
|
70
|
+
})
|
|
71
|
+
};
|
|
72
|
+
transactionId = this.utils.B58(UUID.parse(UUID.v4()));
|
|
73
|
+
requestBody.ts = Date.now();
|
|
74
|
+
requestBody.trans_id = transactionId;
|
|
75
|
+
_context.next = 13;
|
|
76
|
+
return _regeneratorRuntime.awrap(this.Sign(JSON.stringify(requestBody)));
|
|
77
|
+
|
|
78
|
+
case 13:
|
|
79
|
+
mintSignature = _context.sent;
|
|
80
|
+
_context.next = 16;
|
|
81
|
+
return _regeneratorRuntime.awrap(this.authClient.MakeAuthServiceRequest({
|
|
82
|
+
method: "POST",
|
|
83
|
+
path: UrlJoin("/as/tnt/trans/base", tenantId, marketplaceId),
|
|
84
|
+
body: requestBody,
|
|
85
|
+
headers: {
|
|
86
|
+
"Authorization": "Bearer ".concat(mintSignature)
|
|
87
|
+
}
|
|
88
|
+
}));
|
|
89
|
+
|
|
90
|
+
case 16:
|
|
91
|
+
return _context.abrupt("return", {
|
|
92
|
+
address: address,
|
|
93
|
+
transactionId: transactionId
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
case 17:
|
|
97
|
+
case "end":
|
|
98
|
+
return _context.stop();
|
|
103
99
|
}
|
|
104
|
-
}
|
|
105
|
-
})
|
|
106
|
-
|
|
107
|
-
return function (_x) {
|
|
108
|
-
return _ref2.apply(this, arguments);
|
|
109
|
-
};
|
|
110
|
-
}();
|
|
100
|
+
}
|
|
101
|
+
}, null, this);
|
|
102
|
+
};
|
|
111
103
|
/**
|
|
112
104
|
* Retrieve information about transactions for the specified collection
|
|
113
105
|
*
|
|
@@ -126,59 +118,53 @@ exports.MintNFT = /*#__PURE__*/function () {
|
|
|
126
118
|
*/
|
|
127
119
|
|
|
128
120
|
|
|
129
|
-
exports.CollectionTransactions =
|
|
130
|
-
var
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
return _context2.stop();
|
|
176
|
-
}
|
|
121
|
+
exports.CollectionTransactions = function _callee2(_ref2) {
|
|
122
|
+
var tenantId, collectionId, _ref2$filterOptions, filterOptions, ts, queryParams, allowedOptions, path, signature;
|
|
123
|
+
|
|
124
|
+
return _regeneratorRuntime.async(function _callee2$(_context2) {
|
|
125
|
+
while (1) {
|
|
126
|
+
switch (_context2.prev = _context2.next) {
|
|
127
|
+
case 0:
|
|
128
|
+
tenantId = _ref2.tenantId, collectionId = _ref2.collectionId, _ref2$filterOptions = _ref2.filterOptions, filterOptions = _ref2$filterOptions === void 0 ? {} : _ref2$filterOptions;
|
|
129
|
+
ts = Date.now();
|
|
130
|
+
queryParams = {
|
|
131
|
+
ts: ts
|
|
132
|
+
};
|
|
133
|
+
allowedOptions = {
|
|
134
|
+
"email": "email",
|
|
135
|
+
"fromOrdinal": "from_ord",
|
|
136
|
+
"max": "max",
|
|
137
|
+
"status": "status",
|
|
138
|
+
"transactionId": "trans_id"
|
|
139
|
+
};
|
|
140
|
+
Object.keys(allowedOptions).forEach(function (option) {
|
|
141
|
+
if (filterOptions[option]) {
|
|
142
|
+
queryParams[allowedOptions[option]] = filterOptions[option];
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
path = this.AuthHttpClient.BaseURI().path(UrlJoin("/tnt", "trans", tenantId, collectionId)).query(queryParams).hash("").resource();
|
|
146
|
+
_context2.next = 8;
|
|
147
|
+
return _regeneratorRuntime.awrap(this.Sign(path));
|
|
148
|
+
|
|
149
|
+
case 8:
|
|
150
|
+
signature = _context2.sent;
|
|
151
|
+
_context2.next = 11;
|
|
152
|
+
return _regeneratorRuntime.awrap(this.utils.ResponseToJson(this.authClient.MakeAuthServiceRequest({
|
|
153
|
+
method: "GET",
|
|
154
|
+
path: UrlJoin("as", "tnt", "trans", tenantId, collectionId),
|
|
155
|
+
queryParams: queryParams,
|
|
156
|
+
headers: {
|
|
157
|
+
"Authorization": "Bearer ".concat(signature)
|
|
158
|
+
}
|
|
159
|
+
})));
|
|
160
|
+
|
|
161
|
+
case 11:
|
|
162
|
+
return _context2.abrupt("return", _context2.sent);
|
|
163
|
+
|
|
164
|
+
case 12:
|
|
165
|
+
case "end":
|
|
166
|
+
return _context2.stop();
|
|
177
167
|
}
|
|
178
|
-
}
|
|
179
|
-
})
|
|
180
|
-
|
|
181
|
-
return function (_x2) {
|
|
182
|
-
return _ref4.apply(this, arguments);
|
|
183
|
-
};
|
|
184
|
-
}();
|
|
168
|
+
}
|
|
169
|
+
}, null, this);
|
|
170
|
+
};
|