@eluvio/elv-client-js 4.0.10 → 4.0.12

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 (78) hide show
  1. package/dist/.keep +0 -0
  2. package/dist/ElvClient-min.js +10 -10
  3. package/dist/ElvClient-node-min.js +3 -3
  4. package/dist/ElvFrameClient-min.js +10 -10
  5. package/dist/ElvWalletClient-min.js +9 -9
  6. package/dist/ElvWalletClient-node-min.js +3 -3
  7. package/dist/src/AuthorizationClient.js +7 -8
  8. package/dist/src/client/Files.js +2 -1
  9. package/package.json +4 -21
  10. package/src/AuthorizationClient.js +5 -5
  11. package/src/client/Files.js +1 -1
  12. package/dist/AccessClient-min.js +0 -54
  13. package/dist/AccessClient-node-min.js +0 -74
  14. package/dist/src/AccessClient.js +0 -798
  15. package/dist/src/LimitedMap.js +0 -120
  16. package/dist/src/client/Access.js +0 -1
  17. package/dist/src/client/Management.js +0 -1606
  18. package/dist/src/contracts/AccessIndexor.js +0 -831
  19. package/dist/src/contracts/Accessible.js +0 -31
  20. package/dist/src/contracts/AdmgrAdvertisement.js +0 -695
  21. package/dist/src/contracts/AdmgrCampaign.js +0 -648
  22. package/dist/src/contracts/AdmgrCampaignManager.js +0 -493
  23. package/dist/src/contracts/AdmgrCommercialOffering.js +0 -622
  24. package/dist/src/contracts/AdmgrCommercialOfferingManager.js +0 -413
  25. package/dist/src/contracts/AdmgrMarketPlace.js +0 -413
  26. package/dist/src/contracts/AvailsDelivery.js +0 -535
  27. package/dist/src/contracts/BaseAccessControlGroup.js +0 -1221
  28. package/dist/src/contracts/BaseAccessWallet.js +0 -1575
  29. package/dist/src/contracts/BaseAccessWalletFactory.js +0 -93
  30. package/dist/src/contracts/BaseContent.js +0 -1104
  31. package/dist/src/contracts/BaseContentFactory.js +0 -99
  32. package/dist/src/contracts/BaseContentFactoryExt.js +0 -219
  33. package/dist/src/contracts/BaseContentSpace.js +0 -1346
  34. package/dist/src/contracts/BaseContentType.js +0 -353
  35. package/dist/src/contracts/BaseFactory.js +0 -107
  36. package/dist/src/contracts/BaseGroupFactory.js +0 -93
  37. package/dist/src/contracts/BaseLibrary.js +0 -1035
  38. package/dist/src/contracts/BaseLibraryFactory.js +0 -96
  39. package/dist/src/contracts/Certifyer.js +0 -87
  40. package/dist/src/contracts/Container.js +0 -543
  41. package/dist/src/contracts/Content.js +0 -432
  42. package/dist/src/contracts/Editable.js +0 -295
  43. package/dist/src/contracts/FactorySpace.js +0 -57
  44. package/dist/src/contracts/KmsSpace.js +0 -52
  45. package/dist/src/contracts/LvProvider.js +0 -512
  46. package/dist/src/contracts/LvRecordableStream.js +0 -1026
  47. package/dist/src/contracts/LvRecording.js +0 -627
  48. package/dist/src/contracts/LvStreamRightsHolder.js +0 -551
  49. package/dist/src/contracts/MetaObject.js +0 -110
  50. package/dist/src/contracts/Node.js +0 -167
  51. package/dist/src/contracts/NodeSpace.js +0 -18
  52. package/dist/src/contracts/NodeSpaceImpl.js +0 -273
  53. package/dist/src/contracts/Ownable.js +0 -87
  54. package/dist/src/contracts/PaymentService.js +0 -616
  55. package/dist/src/contracts/Precompile.js +0 -15
  56. package/dist/src/contracts/SampleContentAdMarketplace.js +0 -564
  57. package/dist/src/contracts/SampleContentAdvertising.js +0 -444
  58. package/dist/src/contracts/SampleContentHelloWorld.js +0 -459
  59. package/dist/src/contracts/SampleContentLicensing.js +0 -618
  60. package/dist/src/contracts/SampleContentSigned.js +0 -447
  61. package/dist/src/contracts/SampleInstance.js +0 -438
  62. package/dist/src/contracts/SampleInstanceFactory.js +0 -451
  63. package/dist/src/contracts/Transactable.js +0 -82
  64. package/dist/src/contracts/UserSpace.js +0 -18
  65. package/dist/src/contracts/UserSpaceImpl.js +0 -43
  66. package/dist/src/contracts/Utils.js +0 -18
  67. package/dist/src/contracts/Verifier.js +0 -53
  68. package/dist/src/contracts/strings.js +0 -4
  69. package/dist/src/contracts/v2/BaseContentFactoryExt.js +0 -219
  70. package/dist/src/contracts/v2/FactorySpace.js +0 -57
  71. package/dist/src/contracts/v2/KmsSpace.js +0 -52
  72. package/dist/src/contracts/v2/NodeSpaceImpl.js +0 -273
  73. package/dist/src/contracts/v2/UserSpaceImpl.js +0 -43
  74. package/dist/src/marketplaceClient/ClientMethods.js +0 -1918
  75. package/dist/src/marketplaceClient/Configuration.js +0 -29
  76. package/dist/src/marketplaceClient/Utils.js +0 -304
  77. package/dist/src/marketplaceClient/index.js +0 -1553
  78. package/testScripts/CreateMezMonolithic.js +0 -779
@@ -1,29 +0,0 @@
1
- var WalletConfiguration = {
2
- demo: {
3
- configUrl: "https://demov3.net955210.contentfabric.io/config",
4
- staging: {
5
- siteId: "iq__2gkNh8CCZqFFnoRpEUmz7P3PaBQG",
6
- purchaseMode: "develop",
7
- appUrl: "https://core.test.contentfabric.io/wallet-demo"
8
- }
9
- },
10
- main: {
11
- configUrl: "https://main.net955305.contentfabric.io/config",
12
- staging: {
13
- siteId: "iq__inauxD1KLyKWPHargCWjdCh2ayr",
14
- purchaseMode: "production",
15
- appUrl: "https://core.test.contentfabric.io/wallet"
16
- },
17
- production: {
18
- siteId: "iq__suqRJUt2vmXsyiWS5ZaSGwtFU9R",
19
- purchaseMode: "production",
20
- appUrl: "https://wallet.contentfabric.io"
21
- }
22
- },
23
- __MARKETPLACE_ORDER: ["dolly-marketplace", "oc-marketplace", "maskverse-marketplace", "emp-marketplace", "marketplace-elevenation", "indieflix-marketplace", "angels-airwaves-marketplace"]
24
- }; // No production environment on demo
25
-
26
- WalletConfiguration.demo.production = WalletConfiguration.demo.staging; // Allow demo to be referred to as demov3
27
-
28
- WalletConfiguration.demov3 = WalletConfiguration.demo;
29
- module.exports = WalletConfiguration;
@@ -1,304 +0,0 @@
1
- var _regeneratorRuntime = require("@babel/runtime/regenerator");
2
-
3
- var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
4
-
5
- var _defineProperty = require("@babel/runtime/helpers/defineProperty");
6
-
7
- var _slicedToArray = require("@babel/runtime/helpers/slicedToArray");
8
-
9
- 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; }
10
-
11
- 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; }
12
-
13
- var Utils = require("../Utils");
14
-
15
- var RarityToPercentage = function RarityToPercentage(rarity) {
16
- if (!rarity) {
17
- return "";
18
- }
19
-
20
- rarity = rarity.toString();
21
-
22
- if (!rarity.includes("/")) {
23
- return rarity;
24
- }
25
-
26
- var _rarity$split = rarity.split("/"),
27
- _rarity$split2 = _slicedToArray(_rarity$split, 2),
28
- numerator = _rarity$split2[0],
29
- denominator = _rarity$split2[1];
30
-
31
- var percentage = 100 * parseInt(numerator) / parseInt(denominator);
32
-
33
- if (percentage < 1) {
34
- percentage = percentage.toFixed(2);
35
- } else {
36
- percentage = percentage.toFixed(1).toString().replace(".0", "");
37
- }
38
-
39
- return percentage;
40
- }; // Format NFT or listing result into consistent format
41
-
42
-
43
- var FormatNFTDetails = function FormatNFTDetails(entry) {
44
- var isListing = !!entry.id;
45
- var metadata = (isListing ? entry.nft : entry.meta) || {};
46
- var info = isListing ? entry.info : entry;
47
- var details = {
48
- USDCAccepted: !!(entry.accepts || []).find(function (entry) {
49
- return entry.type === "sol";
50
- }),
51
- USDCOnly: ((entry.accepts || []).find(function (entry) {
52
- return entry.type === "sol";
53
- }) || {}).preferred,
54
- TenantId: entry.tenant || entry.tenant_id,
55
- ContractAddr: info.contract_addr,
56
- ContractId: "ictr".concat(Utils.AddressToHash(info.contract_addr)),
57
- ContractName: info.contract_name,
58
- Cap: info.cap,
59
- TokenIdStr: info.token_id_str,
60
- TokenUri: info.token_uri,
61
- TokenOrdinal: info.ordinal,
62
- TokenHold: info.hold,
63
- TokenHoldDate: info.hold ? new Date(parseInt(info.hold) * 1000) : undefined,
64
- TokenOwner: info.token_owner ? Utils.FormatAddress(info.token_owner) : "",
65
- VersionHash: (info.token_uri || "").split("/").find(function (s) {
66
- return (s || "").startsWith("hq__");
67
- })
68
- };
69
-
70
- if (isListing) {
71
- details = _objectSpread(_objectSpread({}, details), {}, {
72
- // Listing specific fields
73
- ListingId: entry.id,
74
- CreatedAt: entry.created * 1000,
75
- UpdatedAt: entry.updated * 1000,
76
- CheckoutLockedUntil: entry.checkout ? entry.checkout * 1000 : undefined,
77
- SellerAddress: Utils.FormatAddress(entry.seller),
78
- Price: entry.price,
79
- Fee: entry.fee
80
- });
81
- }
82
-
83
- return {
84
- metadata: metadata,
85
- details: details
86
- };
87
- };
88
-
89
- exports.FormatNFTDetails = FormatNFTDetails;
90
-
91
- var FormatNFTMetadata = function FormatNFTMetadata(nft) {
92
- nft.formatted = true; // Surface relevant details to top level
93
-
94
- nft.contractAddress = nft.details.ContractAddr;
95
- nft.contractId = nft.details.ContractId;
96
- nft.tokenId = nft.details.TokenIdStr;
97
- nft.name = nft.metadata.display_name;
98
-
99
- if (nft.details.ListingId) {
100
- nft.listingId = nft.details.ListingId;
101
- } // Format traits
102
-
103
-
104
- var FILTERED_ATTRIBUTES = ["Content Fabric Hash", "Creator", "Total Minted Supply"];
105
- nft.metadata.attributes = (nft.metadata.attributes || []).filter(function (attribute) {
106
- return attribute && !FILTERED_ATTRIBUTES.includes(attribute.trait_type);
107
- }).map(function (trait) {
108
- return _objectSpread(_objectSpread({}, trait), {}, {
109
- name: trait.trait_type,
110
- rarity_percent: RarityToPercentage(trait.rarity)
111
- });
112
- }); // Generate embed URLs for additional media
113
-
114
- if (nft.metadata.additional_media) {
115
- nft.metadata.additional_media = nft.metadata.additional_media.map(function (media) {
116
- try {
117
- // Generate embed URLs for additional media
118
- var mediaType = (media.media_type || "").toLowerCase();
119
-
120
- if (mediaType === "image") {
121
- return _objectSpread(_objectSpread({}, media), {}, {
122
- embed_url: media.media_file.url
123
- });
124
- }
125
-
126
- var embedUrl = new URL("https://embed.v3.contentfabric.io");
127
- embedUrl.searchParams.set("p", "");
128
- embedUrl.searchParams.set("net", rootStore.network === "demo" ? "demo" : "main");
129
- embedUrl.searchParams.set("ath", rootStore.authToken);
130
-
131
- if (mediaType === "video") {
132
- embedUrl.searchParams.set("vid", LinkTargetHash(media.media_link));
133
- embedUrl.searchParams.set("ct", "h");
134
- embedUrl.searchParams.set("ap", "");
135
- } else if (mediaType === "ebook") {
136
- embedUrl.searchParams.set("type", "ebook");
137
- embedUrl.searchParams.set("vid", media.media_file["."].container);
138
- embedUrl.searchParams.set("murl", btoa(media.media_file.url));
139
- }
140
-
141
- return _objectSpread(_objectSpread({}, media), {}, {
142
- embed_url: embedUrl.toString()
143
- });
144
- } catch (error) {
145
- return media;
146
- }
147
- });
148
- } // Generate embed URLs for pack opening animations
149
-
150
-
151
- ["open_animation", "open_animation__mobile", "reveal_animation", "reveal_animation_mobile"].forEach(function (key) {
152
- try {
153
- if (nft.metadata.pack_options && nft.metadata.pack_options[key]) {
154
- var embedUrl = new URL("https://embed.v3.contentfabric.io");
155
- embedUrl.searchParams.set("p", "");
156
- embedUrl.searchParams.set("net", rootStore.network === "demo" ? "demo" : "main");
157
- embedUrl.searchParams.set("ath", rootStore.authToken || rootStore.staticToken);
158
- embedUrl.searchParams.set("vid", LinkTargetHash(nft.metadata.pack_options[key]));
159
- embedUrl.searchParams.set("ap", "");
160
-
161
- if (!key.startsWith("reveal")) {
162
- embedUrl.searchParams.set("m", "");
163
- embedUrl.searchParams.set("lp", "");
164
- }
165
-
166
- nft.metadata.pack_options["".concat(key, "_embed_url")] = embedUrl.toString();
167
- } // eslint-disable-next-line no-empty
168
-
169
- } catch (error) {}
170
- });
171
- return nft;
172
- };
173
-
174
- exports.FormatNFTMetadata = FormatNFTMetadata;
175
-
176
- exports.FormatNFT = function (item) {
177
- return FormatNFTMetadata(FormatNFTDetails(item));
178
- };
179
-
180
- exports.LinkTargetHash = function (link) {
181
- if (!link) {
182
- return;
183
- }
184
-
185
- if (link["."] && link["."].source) {
186
- return link["."].source;
187
- }
188
-
189
- if (link["/"] && link["/"].startsWith("/qfab/")) {
190
- return link["/"].split("/").find(function (segment) {
191
- return segment.startsWith("hq__");
192
- });
193
- }
194
-
195
- if (link["."] && link["."].container) {
196
- return link["."].container;
197
- }
198
- }; // https://stackoverflow.com/questions/4068373/center-a-popup-window-on-screen
199
-
200
-
201
- var Popup = function Popup(_ref) {
202
- var url = _ref.url,
203
- title = _ref.title,
204
- w = _ref.w,
205
- h = _ref.h;
206
- // Fixes dual-screen position
207
- var dualScreenLeft = window.screenLeft || window.screenX;
208
- var dualScreenTop = window.screenTop || window.screenY;
209
- var width = window.innerWidth || document.documentElement.clientWidth || screen.width;
210
- var height = window.innerHeight || document.documentElement.clientHeight || screen.height;
211
- var systemZoom = width / window.screen.availWidth;
212
- var left = (width - w) / 2 / systemZoom + dualScreenLeft;
213
- var top = (height - h) / 2 / systemZoom + dualScreenTop;
214
- var newWindow = window.open(url, title, "\n width=".concat(w / systemZoom, ",\n height=").concat(h / systemZoom, ",\n top=").concat(top, ",\n left=").concat(left, "\n "));
215
- if (window.focus) newWindow.focus();
216
- return newWindow;
217
- };
218
-
219
- exports.ActionPopup = /*#__PURE__*/function () {
220
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref2) {
221
- var _ref2$mode, mode, url, onMessage, onCancel;
222
-
223
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
224
- while (1) {
225
- switch (_context3.prev = _context3.next) {
226
- case 0:
227
- _ref2$mode = _ref2.mode, mode = _ref2$mode === void 0 ? "tab" : _ref2$mode, url = _ref2.url, onMessage = _ref2.onMessage, onCancel = _ref2.onCancel;
228
- _context3.next = 3;
229
- return new Promise(function (resolve) {
230
- var newWindow = mode === "popup" ? Popup({
231
- url: url,
232
- title: "Eluvio Media Wallet",
233
- w: 500,
234
- h: 850
235
- }) : window.open(url);
236
- var closeCheck = setInterval( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
237
- return _regeneratorRuntime.wrap(function _callee$(_context) {
238
- while (1) {
239
- switch (_context.prev = _context.next) {
240
- case 0:
241
- if (!newWindow.closed) {
242
- _context.next = 6;
243
- break;
244
- }
245
-
246
- clearInterval(closeCheck);
247
-
248
- if (!onCancel) {
249
- _context.next = 5;
250
- break;
251
- }
252
-
253
- _context.next = 5;
254
- return onCancel();
255
-
256
- case 5:
257
- resolve();
258
-
259
- case 6:
260
- case "end":
261
- return _context.stop();
262
- }
263
- }
264
- }, _callee);
265
- })), 500);
266
- window.addEventListener("message", /*#__PURE__*/function () {
267
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(event) {
268
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
269
- while (1) {
270
- switch (_context2.prev = _context2.next) {
271
- case 0:
272
- _context2.next = 2;
273
- return onMessage(event, function () {
274
- clearInterval(closeCheck);
275
- newWindow.close();
276
- resolve();
277
- });
278
-
279
- case 2:
280
- case "end":
281
- return _context2.stop();
282
- }
283
- }
284
- }, _callee2);
285
- }));
286
-
287
- return function (_x2) {
288
- return _ref5.apply(this, arguments);
289
- };
290
- }());
291
- });
292
-
293
- case 3:
294
- case "end":
295
- return _context3.stop();
296
- }
297
- }
298
- }, _callee3);
299
- }));
300
-
301
- return function (_x) {
302
- return _ref3.apply(this, arguments);
303
- };
304
- }();