@eluvio/elv-client-js 3.2.1 → 3.2.5

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 (34) hide show
  1. package/dist/ElvClient-min.js +15 -11
  2. package/dist/ElvClient-node-min.js +17 -13
  3. package/dist/ElvFrameClient-min.js +12 -8
  4. package/dist/ElvPermissionsClient-min.js +13 -9
  5. package/dist/ElvWalletClient-min.js +58 -0
  6. package/dist/ElvWalletClient-node-min.js +78 -0
  7. package/dist/src/AuthorizationClient.js +2248 -1990
  8. package/dist/src/ContentObjectVerification.js +164 -173
  9. package/dist/src/Crypto.js +376 -324
  10. package/dist/src/ElvClient.js +1182 -1019
  11. package/dist/src/ElvWallet.js +119 -95
  12. package/dist/src/EthClient.js +1040 -896
  13. package/dist/src/FrameClient.js +331 -300
  14. package/dist/src/HttpClient.js +153 -147
  15. package/dist/src/Id.js +1 -3
  16. package/dist/src/PermissionsClient.js +1294 -1168
  17. package/dist/src/RemoteSigner.js +263 -211
  18. package/dist/src/UserProfileClient.js +1164 -1023
  19. package/dist/src/Utils.js +209 -181
  20. package/dist/src/client/ABRPublishing.js +895 -858
  21. package/dist/src/client/AccessGroups.js +1102 -959
  22. package/dist/src/client/ContentAccess.js +3724 -3431
  23. package/dist/src/client/ContentManagement.js +2252 -2068
  24. package/dist/src/client/Contracts.js +647 -563
  25. package/dist/src/client/Files.js +1886 -1757
  26. package/dist/src/client/NFT.js +126 -112
  27. package/dist/src/client/NTP.js +478 -422
  28. package/dist/src/walletClient/ClientMethods.js +1029 -879
  29. package/dist/src/walletClient/Utils.js +84 -70
  30. package/dist/src/walletClient/index.js +1200 -1088
  31. package/package.json +4 -2
  32. package/src/Utils.js +0 -1
  33. package/src/walletClient/ClientMethods.js +37 -5
  34. package/utilities/ProductionMasterCreate.js +2 -2
@@ -2,9 +2,11 @@ var _regeneratorRuntime = require("@babel/runtime/regenerator");
2
2
 
3
3
  var _defineProperty = require("@babel/runtime/helpers/defineProperty");
4
4
 
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; }
5
+ var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
6
6
 
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; }
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
+
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; }
8
10
 
9
11
  /**
10
12
  * Methods for creating and managing NFTs
@@ -38,68 +40,74 @@ var _require = require("../Validation"),
38
40
  */
39
41
 
40
42
 
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();
43
+ exports.MintNFT = /*#__PURE__*/function () {
44
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
45
+ var tenantId, address, marketplaceId, items, _ref$extraData, extraData, requestBody, transactionId, mintSignature;
46
+
47
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
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
+ }
99
103
  }
100
- }
101
- }, null, this);
102
- };
104
+ }, _callee, this);
105
+ }));
106
+
107
+ return function (_x) {
108
+ return _ref2.apply(this, arguments);
109
+ };
110
+ }();
103
111
  /**
104
112
  * Retrieve information about transactions for the specified collection
105
113
  *
@@ -118,53 +126,59 @@ exports.MintNFT = function _callee(_ref) {
118
126
  */
119
127
 
120
128
 
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();
129
+ exports.CollectionTransactions = /*#__PURE__*/function () {
130
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref3) {
131
+ var tenantId, collectionId, _ref3$filterOptions, filterOptions, ts, queryParams, allowedOptions, path, signature;
132
+
133
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
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
+ }
167
177
  }
168
- }
169
- }, null, this);
170
- };
178
+ }, _callee2, this);
179
+ }));
180
+
181
+ return function (_x2) {
182
+ return _ref4.apply(this, arguments);
183
+ };
184
+ }();