@eluvio/elv-client-js 4.0.10 → 4.0.11

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.
Files changed (40) hide show
  1. package/dist/ElvClient-min.js +10 -11
  2. package/dist/ElvClient-node-min.js +10 -11
  3. package/dist/ElvFrameClient-min.js +10 -11
  4. package/dist/ElvPermissionsClient-min.js +9 -10
  5. package/dist/ElvWalletClient-min.js +9 -10
  6. package/dist/ElvWalletClient-node-min.js +9 -10
  7. package/dist/src/AuthorizationClient.js +2070 -1550
  8. package/dist/src/ContentObjectVerification.js +185 -134
  9. package/dist/src/Crypto.js +319 -224
  10. package/dist/src/ElvClient.js +1114 -822
  11. package/dist/src/ElvWallet.js +106 -64
  12. package/dist/src/EthClient.js +974 -719
  13. package/dist/src/FrameClient.js +318 -222
  14. package/dist/src/HttpClient.js +154 -112
  15. package/dist/src/Id.js +6 -1
  16. package/dist/src/LogMessage.js +8 -4
  17. package/dist/src/PermissionsClient.js +1271 -973
  18. package/dist/src/RemoteSigner.js +232 -161
  19. package/dist/src/UserProfileClient.js +1038 -781
  20. package/dist/src/Utils.js +299 -159
  21. package/dist/src/Validation.js +17 -2
  22. package/dist/src/client/ABRPublishing.js +942 -772
  23. package/dist/src/client/AccessGroups.js +1095 -849
  24. package/dist/src/client/ContentAccess.js +4196 -3323
  25. package/dist/src/client/ContentManagement.js +2288 -1814
  26. package/dist/src/client/Contracts.js +614 -468
  27. package/dist/src/client/Files.js +1831 -1490
  28. package/dist/src/client/NFT.js +116 -94
  29. package/dist/src/client/NTP.js +425 -326
  30. package/dist/src/index.js +5 -2
  31. package/dist/src/walletClient/ClientMethods.js +1763 -1368
  32. package/dist/src/walletClient/Configuration.js +2 -4
  33. package/dist/src/walletClient/Notifications.js +127 -98
  34. package/dist/src/walletClient/Profile.js +246 -184
  35. package/dist/src/walletClient/Utils.js +122 -76
  36. package/dist/src/walletClient/index.js +1496 -1171
  37. package/package.json +1 -1
  38. package/src/AuthorizationClient.js +5 -5
  39. package/src/client/Files.js +1 -1
  40. package/testScripts/CreateMezMonolithic.js +0 -779
@@ -1,21 +1,26 @@
1
1
  var _regeneratorRuntime = require("@babel/runtime/regenerator");
2
+
2
3
  var _defineProperty = require("@babel/runtime/helpers/defineProperty");
4
+
3
5
  var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
6
+
4
7
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
8
+
5
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; }
10
+
6
11
  /**
7
12
  * Methods for creating and managing NFTs
8
13
  *
9
14
  * @module ElvClient/NFT
10
15
  */
11
-
12
16
  var UUID = require("uuid");
17
+
13
18
  var UrlJoin = require("url-join");
14
- var _require = require("../Validation"),
15
- ValidateAddress = _require.ValidateAddress,
16
- ValidateObject = _require.ValidateObject,
17
- ValidatePresence = _require.ValidatePresence;
18
19
 
20
+ var _require = require("../Validation"),
21
+ ValidateAddress = _require.ValidateAddress,
22
+ ValidateObject = _require.ValidateObject,
23
+ ValidatePresence = _require.ValidatePresence;
19
24
  /**
20
25
  * Mint NFTs for the specified user
21
26
  *
@@ -33,68 +38,76 @@ var _require = require("../Validation"),
33
38
  *
34
39
  * @return Promise<Object> - An object containing the address for whom the NFT was minted and the transactionId of the minting request.
35
40
  */
41
+
42
+
36
43
  exports.MintNFT = /*#__PURE__*/function () {
37
44
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
38
45
  var tenantId, address, marketplaceId, items, _ref$extraData, extraData, requestBody, transactionId, mintSignature;
46
+
39
47
  return _regeneratorRuntime.wrap(function _callee$(_context) {
40
- while (1) switch (_context.prev = _context.next) {
41
- case 0:
42
- tenantId = _ref.tenantId, address = _ref.address, marketplaceId = _ref.marketplaceId, items = _ref.items, _ref$extraData = _ref.extraData, extraData = _ref$extraData === void 0 ? {} : _ref$extraData;
43
- ValidatePresence("tenantId", tenantId);
44
- ValidatePresence("address", address);
45
- ValidatePresence("marketplaceId", marketplaceId);
46
- ValidatePresence("items", items);
47
- ValidateObject(marketplaceId);
48
- ValidateAddress(address);
49
- requestBody = {
50
- tickets: null,
51
- products: items.map(function (item) {
52
- return {
53
- sku: item.sku,
54
- quant: item.quantity || 1,
55
- extra: item.tokenId ? _objectSpread(_objectSpread({}, item.extraData || {}), {}, {
56
- token_id: item.tokenId
57
- }) : _objectSpread({}, item.extraData || {})
58
- };
59
- }),
60
- ident: address,
61
- cust_name: address,
62
- extra: _objectSpread(_objectSpread({}, extraData), {}, {
63
- elv_addr: address
64
- })
65
- };
66
- transactionId = this.utils.B58(UUID.parse(UUID.v4()));
67
- requestBody.ts = Date.now();
68
- requestBody.trans_id = transactionId;
69
- _context.next = 13;
70
- return this.Sign(JSON.stringify(requestBody));
71
- case 13:
72
- mintSignature = _context.sent;
73
- _context.next = 16;
74
- return this.authClient.MakeAuthServiceRequest({
75
- method: "POST",
76
- path: UrlJoin("/as/tnt/trans/base", tenantId, marketplaceId),
77
- body: requestBody,
78
- headers: {
79
- "Authorization": "Bearer ".concat(mintSignature)
80
- }
81
- });
82
- case 16:
83
- return _context.abrupt("return", {
84
- address: address,
85
- transactionId: transactionId
86
- });
87
- case 17:
88
- case "end":
89
- return _context.stop();
48
+ while (1) {
49
+ switch (_context.prev = _context.next) {
50
+ case 0:
51
+ tenantId = _ref.tenantId, address = _ref.address, marketplaceId = _ref.marketplaceId, items = _ref.items, _ref$extraData = _ref.extraData, extraData = _ref$extraData === void 0 ? {} : _ref$extraData;
52
+ ValidatePresence("tenantId", tenantId);
53
+ ValidatePresence("address", address);
54
+ ValidatePresence("marketplaceId", marketplaceId);
55
+ ValidatePresence("items", items);
56
+ ValidateObject(marketplaceId);
57
+ ValidateAddress(address);
58
+ requestBody = {
59
+ tickets: null,
60
+ products: items.map(function (item) {
61
+ return {
62
+ sku: item.sku,
63
+ quant: item.quantity || 1,
64
+ extra: item.tokenId ? _objectSpread(_objectSpread({}, item.extraData || {}), {}, {
65
+ token_id: item.tokenId
66
+ }) : _objectSpread({}, item.extraData || {})
67
+ };
68
+ }),
69
+ ident: address,
70
+ cust_name: address,
71
+ extra: _objectSpread(_objectSpread({}, extraData), {}, {
72
+ elv_addr: address
73
+ })
74
+ };
75
+ transactionId = this.utils.B58(UUID.parse(UUID.v4()));
76
+ requestBody.ts = Date.now();
77
+ requestBody.trans_id = transactionId;
78
+ _context.next = 13;
79
+ return this.Sign(JSON.stringify(requestBody));
80
+
81
+ case 13:
82
+ mintSignature = _context.sent;
83
+ _context.next = 16;
84
+ return this.authClient.MakeAuthServiceRequest({
85
+ method: "POST",
86
+ path: UrlJoin("/as/tnt/trans/base", tenantId, marketplaceId),
87
+ body: requestBody,
88
+ headers: {
89
+ "Authorization": "Bearer ".concat(mintSignature)
90
+ }
91
+ });
92
+
93
+ case 16:
94
+ return _context.abrupt("return", {
95
+ address: address,
96
+ transactionId: transactionId
97
+ });
98
+
99
+ case 17:
100
+ case "end":
101
+ return _context.stop();
102
+ }
90
103
  }
91
104
  }, _callee, this);
92
105
  }));
106
+
93
107
  return function (_x) {
94
108
  return _ref2.apply(this, arguments);
95
109
  };
96
110
  }();
97
-
98
111
  /**
99
112
  * Retrieve information about transactions for the specified collection
100
113
  *
@@ -111,51 +124,60 @@ exports.MintNFT = /*#__PURE__*/function () {
111
124
  *
112
125
  * @return Promise<Array<Object>> - A list of transactions matching the specified filters.
113
126
  */
127
+
128
+
114
129
  exports.CollectionTransactions = /*#__PURE__*/function () {
115
130
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref3) {
116
131
  var tenantId, collectionId, _ref3$filterOptions, filterOptions, ts, queryParams, allowedOptions, path, signature;
132
+
117
133
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
118
- while (1) switch (_context2.prev = _context2.next) {
119
- case 0:
120
- tenantId = _ref3.tenantId, collectionId = _ref3.collectionId, _ref3$filterOptions = _ref3.filterOptions, filterOptions = _ref3$filterOptions === void 0 ? {} : _ref3$filterOptions;
121
- ts = Date.now();
122
- queryParams = {
123
- ts: ts
124
- };
125
- allowedOptions = {
126
- "email": "email",
127
- "fromOrdinal": "from_ord",
128
- "max": "max",
129
- "status": "status",
130
- "transactionId": "trans_id"
131
- };
132
- Object.keys(allowedOptions).forEach(function (option) {
133
- if (filterOptions[option]) {
134
- queryParams[allowedOptions[option]] = filterOptions[option];
135
- }
136
- });
137
- path = this.AuthHttpClient.BaseURI().path(UrlJoin("/tnt", "trans", tenantId, collectionId)).query(queryParams).hash("").resource();
138
- _context2.next = 8;
139
- return this.Sign(path);
140
- case 8:
141
- signature = _context2.sent;
142
- _context2.next = 11;
143
- return this.utils.ResponseToJson(this.authClient.MakeAuthServiceRequest({
144
- method: "GET",
145
- path: UrlJoin("as", "tnt", "trans", tenantId, collectionId),
146
- queryParams: queryParams,
147
- headers: {
148
- "Authorization": "Bearer ".concat(signature)
149
- }
150
- }));
151
- case 11:
152
- return _context2.abrupt("return", _context2.sent);
153
- case 12:
154
- case "end":
155
- return _context2.stop();
134
+ while (1) {
135
+ switch (_context2.prev = _context2.next) {
136
+ case 0:
137
+ tenantId = _ref3.tenantId, collectionId = _ref3.collectionId, _ref3$filterOptions = _ref3.filterOptions, filterOptions = _ref3$filterOptions === void 0 ? {} : _ref3$filterOptions;
138
+ ts = Date.now();
139
+ queryParams = {
140
+ ts: ts
141
+ };
142
+ allowedOptions = {
143
+ "email": "email",
144
+ "fromOrdinal": "from_ord",
145
+ "max": "max",
146
+ "status": "status",
147
+ "transactionId": "trans_id"
148
+ };
149
+ Object.keys(allowedOptions).forEach(function (option) {
150
+ if (filterOptions[option]) {
151
+ queryParams[allowedOptions[option]] = filterOptions[option];
152
+ }
153
+ });
154
+ path = this.AuthHttpClient.BaseURI().path(UrlJoin("/tnt", "trans", tenantId, collectionId)).query(queryParams).hash("").resource();
155
+ _context2.next = 8;
156
+ return this.Sign(path);
157
+
158
+ case 8:
159
+ signature = _context2.sent;
160
+ _context2.next = 11;
161
+ return this.utils.ResponseToJson(this.authClient.MakeAuthServiceRequest({
162
+ method: "GET",
163
+ path: UrlJoin("as", "tnt", "trans", tenantId, collectionId),
164
+ queryParams: queryParams,
165
+ headers: {
166
+ "Authorization": "Bearer ".concat(signature)
167
+ }
168
+ }));
169
+
170
+ case 11:
171
+ return _context2.abrupt("return", _context2.sent);
172
+
173
+ case 12:
174
+ case "end":
175
+ return _context2.stop();
176
+ }
156
177
  }
157
178
  }, _callee2, this);
158
179
  }));
180
+
159
181
  return function (_x2) {
160
182
  return _ref4.apply(this, arguments);
161
183
  };