@eluvio/elv-client-js 4.0.111 → 4.0.113
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/package.json +1 -1
- package/src/FrameClient.js +2 -0
- package/dist/ElvClient-min.js +0 -67
- package/dist/ElvClient-node-min.js +0 -66
- package/dist/ElvFrameClient-min.js +0 -60
- package/dist/ElvPermissionsClient-min.js +0 -60
- package/dist/ElvWalletClient-min.js +0 -67
- package/dist/ElvWalletClient-node-min.js +0 -66
- package/dist/src/AuthorizationClient.js +0 -2157
- package/dist/src/ContentObjectAudit.js +0 -175
- package/dist/src/ContentObjectVerification.js +0 -281
- package/dist/src/Crypto.js +0 -412
- package/dist/src/ElvClient.js +0 -2049
- package/dist/src/ElvWallet.js +0 -245
- package/dist/src/EthClient.js +0 -1154
- package/dist/src/FrameClient.js +0 -485
- package/dist/src/HttpClient.js +0 -315
- package/dist/src/Id.js +0 -21
- package/dist/src/LogMessage.js +0 -25
- package/dist/src/PermissionsClient.js +0 -1544
- package/dist/src/RemoteSigner.js +0 -385
- package/dist/src/UserProfileClient.js +0 -1450
- package/dist/src/Utils.js +0 -894
- package/dist/src/Validation.js +0 -121
- package/dist/src/abr_profiles/abr_profile_live_drm.js +0 -1661
- package/dist/src/abr_profiles/abr_profile_live_to_vod.js +0 -1606
- package/dist/src/client/ABRPublishing.js +0 -1018
- package/dist/src/client/AccessGroups.js +0 -1503
- package/dist/src/client/ContentAccess.js +0 -5173
- package/dist/src/client/ContentManagement.js +0 -2680
- package/dist/src/client/Contracts.js +0 -1520
- package/dist/src/client/Files.js +0 -2181
- package/dist/src/client/LiveConf.js +0 -567
- package/dist/src/client/LiveStream.js +0 -2638
- package/dist/src/client/NFT.js +0 -162
- package/dist/src/client/NTP.js +0 -581
- package/dist/src/contracts/v2/AccessIndexor.js +0 -831
- package/dist/src/contracts/v2/Accessible.js +0 -31
- package/dist/src/contracts/v2/BaseAccessControlGroup.js +0 -1263
- package/dist/src/contracts/v2/BaseAccessWallet.js +0 -1609
- package/dist/src/contracts/v2/BaseAccessWalletFactory.js +0 -93
- package/dist/src/contracts/v2/BaseContent.js +0 -1076
- package/dist/src/contracts/v2/BaseContentFactory.js +0 -219
- package/dist/src/contracts/v2/BaseContentSpace.js +0 -1352
- package/dist/src/contracts/v2/BaseContentType.js +0 -364
- package/dist/src/contracts/v2/BaseFactory.js +0 -107
- package/dist/src/contracts/v2/BaseGroupFactory.js +0 -93
- package/dist/src/contracts/v2/BaseLibrary.js +0 -1041
- package/dist/src/contracts/v2/BaseLibraryFactory.js +0 -96
- package/dist/src/contracts/v2/Certifyer.js +0 -86
- package/dist/src/contracts/v2/Container.js +0 -540
- package/dist/src/contracts/v2/Content.js +0 -443
- package/dist/src/contracts/v2/Editable.js +0 -306
- package/dist/src/contracts/v2/ExternalUserWallet.js +0 -379
- package/dist/src/contracts/v2/IFactorySpace.js +0 -57
- package/dist/src/contracts/v2/IKmsSpace.js +0 -52
- package/dist/src/contracts/v2/INodeSpace.js +0 -18
- package/dist/src/contracts/v2/IUserSpace.js +0 -18
- package/dist/src/contracts/v2/LvRecordableStream.js +0 -1037
- package/dist/src/contracts/v2/LvRecording.js +0 -627
- package/dist/src/contracts/v2/LvStreamRightsHolder.js +0 -562
- package/dist/src/contracts/v2/MetaObject.js +0 -119
- package/dist/src/contracts/v2/Node.js +0 -167
- package/dist/src/contracts/v2/NodeSpace.js +0 -273
- package/dist/src/contracts/v2/Ownable.js +0 -87
- package/dist/src/contracts/v2/PaymentService.js +0 -627
- package/dist/src/contracts/v2/Precompile.js +0 -15
- package/dist/src/contracts/v2/Transactable.js +0 -82
- package/dist/src/contracts/v2/UserSpace.js +0 -29
- package/dist/src/contracts/v2/Utils.js +0 -18
- package/dist/src/contracts/v2/Verifier.js +0 -53
- package/dist/src/contracts/v2/strings.js +0 -4
- package/dist/src/contracts/v3/AccessIndexor.js +0 -774
- package/dist/src/contracts/v3/Accessible.js +0 -232
- package/dist/src/contracts/v3/Adminable.js +0 -107
- package/dist/src/contracts/v3/AvailsDelivery.js +0 -586
- package/dist/src/contracts/v3/BaseAccessControlGroup.js +0 -1603
- package/dist/src/contracts/v3/BaseAccessWallet.js +0 -1628
- package/dist/src/contracts/v3/BaseAccessWalletFactory.js +0 -112
- package/dist/src/contracts/v3/BaseContent.js +0 -1312
- package/dist/src/contracts/v3/BaseContentFactory.js +0 -183
- package/dist/src/contracts/v3/BaseContentFactoryExt.js +0 -175
- package/dist/src/contracts/v3/BaseContentSpace.js +0 -1515
- package/dist/src/contracts/v3/BaseContentType.js +0 -527
- package/dist/src/contracts/v3/BaseFactory.js +0 -126
- package/dist/src/contracts/v3/BaseGroupFactory.js +0 -112
- package/dist/src/contracts/v3/BaseLibrary.js +0 -1204
- package/dist/src/contracts/v3/BaseLibraryFactory.js +0 -115
- package/dist/src/contracts/v3/BaseTenantSpace.js +0 -1587
- package/dist/src/contracts/v3/Certifyer.js +0 -86
- package/dist/src/contracts/v3/Container.js +0 -739
- package/dist/src/contracts/v3/Content.js +0 -438
- package/dist/src/contracts/v3/CounterObject.js +0 -243
- package/dist/src/contracts/v3/Editable.js +0 -519
- package/dist/src/contracts/v3/EncToken.js +0 -4
- package/dist/src/contracts/v3/ExternalUserWallet.js +0 -587
- package/dist/src/contracts/v3/IAdmin.js +0 -18
- package/dist/src/contracts/v3/IFactorySpace.js +0 -57
- package/dist/src/contracts/v3/IKmsSpace.js +0 -52
- package/dist/src/contracts/v3/INodeSpace.js +0 -18
- package/dist/src/contracts/v3/IUserSpace.js +0 -32
- package/dist/src/contracts/v3/LvRecordableStream.js +0 -1032
- package/dist/src/contracts/v3/LvRecording.js +0 -650
- package/dist/src/contracts/v3/LvStreamRightsHolder.js +0 -557
- package/dist/src/contracts/v3/MetaObject.js +0 -144
- package/dist/src/contracts/v3/Node.js +0 -178
- package/dist/src/contracts/v3/NodeSpace.js +0 -284
- package/dist/src/contracts/v3/Ownable.js +0 -98
- package/dist/src/contracts/v3/PaymentService.js +0 -622
- package/dist/src/contracts/v3/Precompile.js +0 -26
- package/dist/src/contracts/v3/TenantFuncsBase.js +0 -351
- package/dist/src/contracts/v3/Transactable.js +0 -82
- package/dist/src/contracts/v3/UserSpace.js +0 -43
- package/dist/src/contracts/v3/Utils.js +0 -18
- package/dist/src/contracts/v3/Verifier.js +0 -53
- package/dist/src/contracts/v3/strings.js +0 -4
- package/dist/src/contracts/v3b/BaseAccessControlGroup.js +0 -1704
- package/dist/src/events/Topics.js +0 -1793
- package/dist/src/index.js +0 -8
- package/dist/src/walletClient/ClientMethods.js +0 -3102
- package/dist/src/walletClient/Configuration.js +0 -38
- package/dist/src/walletClient/Notifications.js +0 -168
- package/dist/src/walletClient/Profile.js +0 -332
- package/dist/src/walletClient/Utils.js +0 -281
- package/dist/src/walletClient/index.js +0 -2106
package/dist/src/client/NFT.js
DELETED
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
2
|
-
var _defineProperty = require("@babel/runtime/helpers/defineProperty");
|
|
3
|
-
var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
4
|
-
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; }
|
|
5
|
-
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; }
|
|
6
|
-
/**
|
|
7
|
-
* Methods for creating and managing NFTs
|
|
8
|
-
*
|
|
9
|
-
* @module ElvClient/NFT
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
var UUID = require("uuid");
|
|
13
|
-
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
|
-
* Mint NFTs for the specified user
|
|
21
|
-
*
|
|
22
|
-
* @methodGroup Minting
|
|
23
|
-
* @namedParams
|
|
24
|
-
* @param {string} tenantId - The ID of the tenant
|
|
25
|
-
* @param {string=} address - The address of the NFT recipient
|
|
26
|
-
* @param {string} marketplaceId - The ID of the marketplace containing the NFT
|
|
27
|
-
* @param {Array<Object>} items - List of items
|
|
28
|
-
* @param {string} items.sku - SKU of the NFT
|
|
29
|
-
* @param {number=} items.quantity=1 - Number to mint
|
|
30
|
-
* @param {(string | Array<string>)=} items.tokenId - Custom token IDs for these items (must be unique).
|
|
31
|
-
* @param {Object=} items.extraData={} - Additional data to put in the transaction
|
|
32
|
-
* @param {Object=} extraData={} - Additional data to put in the transaction
|
|
33
|
-
*
|
|
34
|
-
* @return Promise<Object> - An object containing the address for whom the NFT was minted and the transactionId of the minting request.
|
|
35
|
-
*/
|
|
36
|
-
exports.MintNFT = /*#__PURE__*/function () {
|
|
37
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
38
|
-
var tenantId, address, marketplaceId, items, _ref$extraData, extraData, requestBody, transactionId, mintSignature;
|
|
39
|
-
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();
|
|
90
|
-
}
|
|
91
|
-
}, _callee, this);
|
|
92
|
-
}));
|
|
93
|
-
return function (_x) {
|
|
94
|
-
return _ref2.apply(this, arguments);
|
|
95
|
-
};
|
|
96
|
-
}();
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Retrieve information about transactions for the specified collection
|
|
100
|
-
*
|
|
101
|
-
* @methodGroup Transactions
|
|
102
|
-
* @namedParams
|
|
103
|
-
* @param {string} tenantId - The ID of the tenant
|
|
104
|
-
* @param {string} collectionId - The ID of the NFT collection containing the NFT
|
|
105
|
-
* @param {Object=} filterOptions={} - Options for filtering transactions
|
|
106
|
-
* @param {string=} filterOptions.email - Filter transactions by email.
|
|
107
|
-
* @param {string=} filterOptions.transactionId - Filter transactions by transaction ID.
|
|
108
|
-
* @param {string=} filterOptions.max - The maximum number of transactions to return. Default is 500.
|
|
109
|
-
* @param {string=} filterOptions.status -- Filter transactions by status. Allowed statuses are 'complete', 'failed' and (empty), meaning unprocessed.
|
|
110
|
-
* @param {string=} filterOptions.fromOrdinal - The internal transaction ordinal to start from. Note that negative values are supported and are interpreted as meaning 'from the last current transaction'. Default is 0 - i.e. the beginning.
|
|
111
|
-
*
|
|
112
|
-
* @return Promise<Array<Object>> - A list of transactions matching the specified filters.
|
|
113
|
-
*/
|
|
114
|
-
exports.CollectionTransactions = /*#__PURE__*/function () {
|
|
115
|
-
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref3) {
|
|
116
|
-
var tenantId, collectionId, _ref3$filterOptions, filterOptions, ts, queryParams, allowedOptions, path, signature;
|
|
117
|
-
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();
|
|
156
|
-
}
|
|
157
|
-
}, _callee2, this);
|
|
158
|
-
}));
|
|
159
|
-
return function (_x2) {
|
|
160
|
-
return _ref4.apply(this, arguments);
|
|
161
|
-
};
|
|
162
|
-
}();
|