@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.
Files changed (125) hide show
  1. package/package.json +1 -1
  2. package/src/FrameClient.js +2 -0
  3. package/dist/ElvClient-min.js +0 -67
  4. package/dist/ElvClient-node-min.js +0 -66
  5. package/dist/ElvFrameClient-min.js +0 -60
  6. package/dist/ElvPermissionsClient-min.js +0 -60
  7. package/dist/ElvWalletClient-min.js +0 -67
  8. package/dist/ElvWalletClient-node-min.js +0 -66
  9. package/dist/src/AuthorizationClient.js +0 -2157
  10. package/dist/src/ContentObjectAudit.js +0 -175
  11. package/dist/src/ContentObjectVerification.js +0 -281
  12. package/dist/src/Crypto.js +0 -412
  13. package/dist/src/ElvClient.js +0 -2049
  14. package/dist/src/ElvWallet.js +0 -245
  15. package/dist/src/EthClient.js +0 -1154
  16. package/dist/src/FrameClient.js +0 -485
  17. package/dist/src/HttpClient.js +0 -315
  18. package/dist/src/Id.js +0 -21
  19. package/dist/src/LogMessage.js +0 -25
  20. package/dist/src/PermissionsClient.js +0 -1544
  21. package/dist/src/RemoteSigner.js +0 -385
  22. package/dist/src/UserProfileClient.js +0 -1450
  23. package/dist/src/Utils.js +0 -894
  24. package/dist/src/Validation.js +0 -121
  25. package/dist/src/abr_profiles/abr_profile_live_drm.js +0 -1661
  26. package/dist/src/abr_profiles/abr_profile_live_to_vod.js +0 -1606
  27. package/dist/src/client/ABRPublishing.js +0 -1018
  28. package/dist/src/client/AccessGroups.js +0 -1503
  29. package/dist/src/client/ContentAccess.js +0 -5173
  30. package/dist/src/client/ContentManagement.js +0 -2680
  31. package/dist/src/client/Contracts.js +0 -1520
  32. package/dist/src/client/Files.js +0 -2181
  33. package/dist/src/client/LiveConf.js +0 -567
  34. package/dist/src/client/LiveStream.js +0 -2638
  35. package/dist/src/client/NFT.js +0 -162
  36. package/dist/src/client/NTP.js +0 -581
  37. package/dist/src/contracts/v2/AccessIndexor.js +0 -831
  38. package/dist/src/contracts/v2/Accessible.js +0 -31
  39. package/dist/src/contracts/v2/BaseAccessControlGroup.js +0 -1263
  40. package/dist/src/contracts/v2/BaseAccessWallet.js +0 -1609
  41. package/dist/src/contracts/v2/BaseAccessWalletFactory.js +0 -93
  42. package/dist/src/contracts/v2/BaseContent.js +0 -1076
  43. package/dist/src/contracts/v2/BaseContentFactory.js +0 -219
  44. package/dist/src/contracts/v2/BaseContentSpace.js +0 -1352
  45. package/dist/src/contracts/v2/BaseContentType.js +0 -364
  46. package/dist/src/contracts/v2/BaseFactory.js +0 -107
  47. package/dist/src/contracts/v2/BaseGroupFactory.js +0 -93
  48. package/dist/src/contracts/v2/BaseLibrary.js +0 -1041
  49. package/dist/src/contracts/v2/BaseLibraryFactory.js +0 -96
  50. package/dist/src/contracts/v2/Certifyer.js +0 -86
  51. package/dist/src/contracts/v2/Container.js +0 -540
  52. package/dist/src/contracts/v2/Content.js +0 -443
  53. package/dist/src/contracts/v2/Editable.js +0 -306
  54. package/dist/src/contracts/v2/ExternalUserWallet.js +0 -379
  55. package/dist/src/contracts/v2/IFactorySpace.js +0 -57
  56. package/dist/src/contracts/v2/IKmsSpace.js +0 -52
  57. package/dist/src/contracts/v2/INodeSpace.js +0 -18
  58. package/dist/src/contracts/v2/IUserSpace.js +0 -18
  59. package/dist/src/contracts/v2/LvRecordableStream.js +0 -1037
  60. package/dist/src/contracts/v2/LvRecording.js +0 -627
  61. package/dist/src/contracts/v2/LvStreamRightsHolder.js +0 -562
  62. package/dist/src/contracts/v2/MetaObject.js +0 -119
  63. package/dist/src/contracts/v2/Node.js +0 -167
  64. package/dist/src/contracts/v2/NodeSpace.js +0 -273
  65. package/dist/src/contracts/v2/Ownable.js +0 -87
  66. package/dist/src/contracts/v2/PaymentService.js +0 -627
  67. package/dist/src/contracts/v2/Precompile.js +0 -15
  68. package/dist/src/contracts/v2/Transactable.js +0 -82
  69. package/dist/src/contracts/v2/UserSpace.js +0 -29
  70. package/dist/src/contracts/v2/Utils.js +0 -18
  71. package/dist/src/contracts/v2/Verifier.js +0 -53
  72. package/dist/src/contracts/v2/strings.js +0 -4
  73. package/dist/src/contracts/v3/AccessIndexor.js +0 -774
  74. package/dist/src/contracts/v3/Accessible.js +0 -232
  75. package/dist/src/contracts/v3/Adminable.js +0 -107
  76. package/dist/src/contracts/v3/AvailsDelivery.js +0 -586
  77. package/dist/src/contracts/v3/BaseAccessControlGroup.js +0 -1603
  78. package/dist/src/contracts/v3/BaseAccessWallet.js +0 -1628
  79. package/dist/src/contracts/v3/BaseAccessWalletFactory.js +0 -112
  80. package/dist/src/contracts/v3/BaseContent.js +0 -1312
  81. package/dist/src/contracts/v3/BaseContentFactory.js +0 -183
  82. package/dist/src/contracts/v3/BaseContentFactoryExt.js +0 -175
  83. package/dist/src/contracts/v3/BaseContentSpace.js +0 -1515
  84. package/dist/src/contracts/v3/BaseContentType.js +0 -527
  85. package/dist/src/contracts/v3/BaseFactory.js +0 -126
  86. package/dist/src/contracts/v3/BaseGroupFactory.js +0 -112
  87. package/dist/src/contracts/v3/BaseLibrary.js +0 -1204
  88. package/dist/src/contracts/v3/BaseLibraryFactory.js +0 -115
  89. package/dist/src/contracts/v3/BaseTenantSpace.js +0 -1587
  90. package/dist/src/contracts/v3/Certifyer.js +0 -86
  91. package/dist/src/contracts/v3/Container.js +0 -739
  92. package/dist/src/contracts/v3/Content.js +0 -438
  93. package/dist/src/contracts/v3/CounterObject.js +0 -243
  94. package/dist/src/contracts/v3/Editable.js +0 -519
  95. package/dist/src/contracts/v3/EncToken.js +0 -4
  96. package/dist/src/contracts/v3/ExternalUserWallet.js +0 -587
  97. package/dist/src/contracts/v3/IAdmin.js +0 -18
  98. package/dist/src/contracts/v3/IFactorySpace.js +0 -57
  99. package/dist/src/contracts/v3/IKmsSpace.js +0 -52
  100. package/dist/src/contracts/v3/INodeSpace.js +0 -18
  101. package/dist/src/contracts/v3/IUserSpace.js +0 -32
  102. package/dist/src/contracts/v3/LvRecordableStream.js +0 -1032
  103. package/dist/src/contracts/v3/LvRecording.js +0 -650
  104. package/dist/src/contracts/v3/LvStreamRightsHolder.js +0 -557
  105. package/dist/src/contracts/v3/MetaObject.js +0 -144
  106. package/dist/src/contracts/v3/Node.js +0 -178
  107. package/dist/src/contracts/v3/NodeSpace.js +0 -284
  108. package/dist/src/contracts/v3/Ownable.js +0 -98
  109. package/dist/src/contracts/v3/PaymentService.js +0 -622
  110. package/dist/src/contracts/v3/Precompile.js +0 -26
  111. package/dist/src/contracts/v3/TenantFuncsBase.js +0 -351
  112. package/dist/src/contracts/v3/Transactable.js +0 -82
  113. package/dist/src/contracts/v3/UserSpace.js +0 -43
  114. package/dist/src/contracts/v3/Utils.js +0 -18
  115. package/dist/src/contracts/v3/Verifier.js +0 -53
  116. package/dist/src/contracts/v3/strings.js +0 -4
  117. package/dist/src/contracts/v3b/BaseAccessControlGroup.js +0 -1704
  118. package/dist/src/events/Topics.js +0 -1793
  119. package/dist/src/index.js +0 -8
  120. package/dist/src/walletClient/ClientMethods.js +0 -3102
  121. package/dist/src/walletClient/Configuration.js +0 -38
  122. package/dist/src/walletClient/Notifications.js +0 -168
  123. package/dist/src/walletClient/Profile.js +0 -332
  124. package/dist/src/walletClient/Utils.js +0 -281
  125. package/dist/src/walletClient/index.js +0 -2106
@@ -1,245 +0,0 @@
1
- var _regeneratorRuntime = require("@babel/runtime/regenerator");
2
- var _typeof = require("@babel/runtime/helpers/typeof");
3
- var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
4
- var _classCallCheck = require("@babel/runtime/helpers/classCallCheck");
5
- var _createClass = require("@babel/runtime/helpers/createClass");
6
- var Ethers = require("ethers");
7
- var ElvWallet = /*#__PURE__*/function () {
8
- "use strict";
9
-
10
- /**
11
- * Create a new ElvWallet connected to the given provider
12
- *
13
- * NOTE: It is recommended to initialize wallets from the ElvClient, not using this constructor
14
- *
15
- * @see ElvClient#GenerateWallet()
16
- */
17
- function ElvWallet(provider) {
18
- _classCallCheck(this, ElvWallet);
19
- this.provider = provider;
20
- this.signers = {};
21
- }
22
-
23
- /**
24
- * Generate a mnemonic that can be used to initialize a private key
25
- *
26
- * @returns {string} - Space-separated list of random words
27
- */
28
- _createClass(ElvWallet, [{
29
- key: "GenerateMnemonic",
30
- value: function GenerateMnemonic() {
31
- return Ethers.Wallet.createRandom().mnemonic.phrase;
32
- }
33
-
34
- /**
35
- * Generate a private key from the given mnemonic
36
- *
37
- * @namedParams
38
- * @param {string=} accountName - Name of account to save in wallet. Account will be saved in the wallet if provided.
39
- * @param {string} mnemonic - Mnemonic from which to generate a private key
40
- *
41
- * @returns {Signer} - Signer with the generated private key, connected to the provider
42
- */
43
- }, {
44
- key: "AddAccountFromMnemonic",
45
- value: function AddAccountFromMnemonic(_ref) {
46
- var accountName = _ref.accountName,
47
- mnemonic = _ref.mnemonic;
48
- var signer = Ethers.Wallet.fromMnemonic(mnemonic);
49
- return this.AddAccount({
50
- accountName: accountName,
51
- privateKey: signer.privateKey
52
- });
53
- }
54
-
55
- /**
56
- * Add an account from an encrypted private key (Ethereum keystore format)
57
- *
58
- * @namedParams
59
- * @param {string=} accountName - Name of account to save in wallet. Account will be saved in the wallet if provided.
60
- * @param {string} encryptedPrivateKey - Encrypted private key to decrypt
61
- * @params {string} password - Password with which to decrypt the private key
62
- *
63
- * @returns {Promise<Signer>} - Signer with the decrypted private key, connected to the provider
64
- */
65
- }, {
66
- key: "AddAccountFromEncryptedPK",
67
- value: function () {
68
- var _AddAccountFromEncryptedPK = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref2) {
69
- var accountName, encryptedPrivateKey, password, signer;
70
- return _regeneratorRuntime.wrap(function _callee$(_context) {
71
- while (1) switch (_context.prev = _context.next) {
72
- case 0:
73
- accountName = _ref2.accountName, encryptedPrivateKey = _ref2.encryptedPrivateKey, password = _ref2.password;
74
- if (_typeof(encryptedPrivateKey) === "object") {
75
- encryptedPrivateKey = JSON.stringify(encryptedPrivateKey);
76
- }
77
- _context.next = 4;
78
- return Ethers.Wallet.fromEncryptedJson(encryptedPrivateKey, password);
79
- case 4:
80
- signer = _context.sent;
81
- return _context.abrupt("return", this.AddAccount({
82
- accountName: accountName,
83
- privateKey: signer.privateKey
84
- }));
85
- case 6:
86
- case "end":
87
- return _context.stop();
88
- }
89
- }, _callee, this);
90
- }));
91
- function AddAccountFromEncryptedPK(_x) {
92
- return _AddAccountFromEncryptedPK.apply(this, arguments);
93
- }
94
- return AddAccountFromEncryptedPK;
95
- }()
96
- /**
97
- * Add an account from a private key (Ethereum keystore format)
98
- *
99
- * @namedParams
100
- * @param {string=} accountName - Name of account to save in wallet. Account will be saved in the wallet if provided.
101
- * @param {string} privateKey - Private key to use
102
- *
103
- * @returns {Signer} - Signer with the private key, connected to the provider
104
- */
105
- }, {
106
- key: "AddAccount",
107
- value: function AddAccount(_ref3) {
108
- var accountName = _ref3.accountName,
109
- privateKey = _ref3.privateKey;
110
- try {
111
- var signer = new Ethers.Wallet(privateKey);
112
- signer = signer.connect(this.provider);
113
- if (accountName) {
114
- this.signers[accountName] = signer;
115
- }
116
- return signer;
117
- } catch (error) {
118
- throw Error("Invalid private key");
119
- }
120
- }
121
-
122
- /**
123
- * Get the balance of the account. The account to query can be specified either by
124
- * passing the signer object, or by passing the account name of a saved account
125
- *
126
- * Note: Either the signer OR the account name should be specified
127
- *
128
- * @namedParams
129
- * @param {string=} accountName - Saved account to query the account balance of
130
- * @param {Signer=} signer - Signer to query the account balance of
131
- *
132
- * @returns {number} - Account balance of the specified account, in ETH
133
- */
134
- }, {
135
- key: "GetAccountBalance",
136
- value: function () {
137
- var _GetAccountBalance = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref4) {
138
- var accountName, signer, accountSigner;
139
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
140
- while (1) switch (_context2.prev = _context2.next) {
141
- case 0:
142
- accountName = _ref4.accountName, signer = _ref4.signer;
143
- accountSigner = signer || this.GetAccount({
144
- accountName: accountName
145
- });
146
- if (accountSigner) {
147
- _context2.next = 4;
148
- break;
149
- }
150
- throw Error("Unknown account: " + accountName);
151
- case 4:
152
- _context2.t0 = Ethers.utils;
153
- _context2.next = 7;
154
- return accountSigner.getBalance();
155
- case 7:
156
- _context2.t1 = _context2.sent;
157
- return _context2.abrupt("return", _context2.t0.formatEther.call(_context2.t0, _context2.t1));
158
- case 9:
159
- case "end":
160
- return _context2.stop();
161
- }
162
- }, _callee2, this);
163
- }));
164
- function GetAccountBalance(_x2) {
165
- return _GetAccountBalance.apply(this, arguments);
166
- }
167
- return GetAccountBalance;
168
- }()
169
- /**
170
- * Generate the encrypted private key (Ethereum keystore format) of the signer's private key
171
- * The private key to decrypt can be specified either by passing the signer object, or by passing
172
- * the account name of a saved account
173
- *
174
- * Note: Either the signer OR the account name should be specified
175
- *
176
- * @namedParams
177
- * @param {string=} accountName - Saved account to encrypt the private key of
178
- * @param {string=} signer - Signer to encrypt the private key of
179
- * @param {string} password - Password to encrypt the private key with
180
- *
181
- * @returns {Promise<string>} - The encrypted private key (in Ethereum keystore format)
182
- */
183
- }, {
184
- key: "GenerateEncryptedPrivateKey",
185
- value: function () {
186
- var _GenerateEncryptedPrivateKey = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref5) {
187
- var accountName, signer, password, options, accountSigner;
188
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
189
- while (1) switch (_context3.prev = _context3.next) {
190
- case 0:
191
- accountName = _ref5.accountName, signer = _ref5.signer, password = _ref5.password, options = _ref5.options;
192
- accountSigner = signer || this.GetAccount({
193
- accountName: accountName
194
- });
195
- if (accountSigner) {
196
- _context3.next = 4;
197
- break;
198
- }
199
- throw Error("Unknown account: " + accountName);
200
- case 4:
201
- _context3.next = 6;
202
- return accountSigner.encrypt(password, options);
203
- case 6:
204
- return _context3.abrupt("return", _context3.sent);
205
- case 7:
206
- case "end":
207
- return _context3.stop();
208
- }
209
- }, _callee3, this);
210
- }));
211
- function GenerateEncryptedPrivateKey(_x3) {
212
- return _GenerateEncryptedPrivateKey.apply(this, arguments);
213
- }
214
- return GenerateEncryptedPrivateKey;
215
- }()
216
- /**
217
- * Get the signer of a previously saved account by name
218
- *
219
- * @namedParams
220
- * @param {string} accountName - Name of the account
221
- * @returns {(Signer|undefined)} - Signer of the saved account, if it exists
222
- */
223
- }, {
224
- key: "GetAccount",
225
- value: function GetAccount(_ref6) {
226
- var accountName = _ref6.accountName;
227
- return this.signers[accountName];
228
- }
229
-
230
- /**
231
- * Remove a previously saved account from this wallet
232
- *
233
- * @namedParams
234
- * @param {string} accountName - Name of the account to delete
235
- */
236
- }, {
237
- key: "RemoveAccount",
238
- value: function RemoveAccount(_ref7) {
239
- var accountName = _ref7.accountName;
240
- delete this.signers[accountName];
241
- }
242
- }]);
243
- return ElvWallet;
244
- }();
245
- module.exports = ElvWallet;