@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/RemoteSigner.js
DELETED
|
@@ -1,385 +0,0 @@
|
|
|
1
|
-
var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
2
|
-
var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
3
|
-
var _classCallCheck = require("@babel/runtime/helpers/classCallCheck");
|
|
4
|
-
var _createClass = require("@babel/runtime/helpers/createClass");
|
|
5
|
-
var _inherits = require("@babel/runtime/helpers/inherits");
|
|
6
|
-
var _possibleConstructorReturn = require("@babel/runtime/helpers/possibleConstructorReturn");
|
|
7
|
-
var _getPrototypeOf = require("@babel/runtime/helpers/getPrototypeOf");
|
|
8
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
10
|
-
var Ethers = require("ethers");
|
|
11
|
-
var Utils = require("./Utils");
|
|
12
|
-
var HttpClient = require("./HttpClient");
|
|
13
|
-
var UrlJoin = require("url-join");
|
|
14
|
-
var UUID = require("uuid");
|
|
15
|
-
var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
16
|
-
"use strict";
|
|
17
|
-
|
|
18
|
-
_inherits(RemoteSigner, _Ethers$Signer);
|
|
19
|
-
var _super = _createSuper(RemoteSigner);
|
|
20
|
-
function RemoteSigner(_ref) {
|
|
21
|
-
var _this;
|
|
22
|
-
var signerURIs = _ref.signerURIs,
|
|
23
|
-
idToken = _ref.idToken,
|
|
24
|
-
authToken = _ref.authToken,
|
|
25
|
-
tenantId = _ref.tenantId,
|
|
26
|
-
provider = _ref.provider,
|
|
27
|
-
_ref$extraData = _ref.extraData,
|
|
28
|
-
extraData = _ref$extraData === void 0 ? {} : _ref$extraData,
|
|
29
|
-
_ref$unsignedPublicAu = _ref.unsignedPublicAuth,
|
|
30
|
-
unsignedPublicAuth = _ref$unsignedPublicAu === void 0 ? false : _ref$unsignedPublicAu;
|
|
31
|
-
_classCallCheck(this, RemoteSigner);
|
|
32
|
-
_this = _super.call(this);
|
|
33
|
-
_this.remoteSigner = true;
|
|
34
|
-
_this.unsignedPublicAuth = unsignedPublicAuth;
|
|
35
|
-
_this.HttpClient = new HttpClient({
|
|
36
|
-
uris: signerURIs
|
|
37
|
-
});
|
|
38
|
-
_this.idToken = idToken;
|
|
39
|
-
_this.tenantId = tenantId;
|
|
40
|
-
_this.authToken = authToken;
|
|
41
|
-
_this.extraLoginData = extraData || {};
|
|
42
|
-
_this.provider = provider;
|
|
43
|
-
_this.signatureCache = {};
|
|
44
|
-
return _this;
|
|
45
|
-
}
|
|
46
|
-
_createClass(RemoteSigner, [{
|
|
47
|
-
key: "Initialize",
|
|
48
|
-
value: function () {
|
|
49
|
-
var _Initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
50
|
-
var _yield$Utils$Response, addr, eth, token, keys, address;
|
|
51
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
52
|
-
while (1) switch (_context.prev = _context.next) {
|
|
53
|
-
case 0:
|
|
54
|
-
if (this.authToken) {
|
|
55
|
-
_context.next = 10;
|
|
56
|
-
break;
|
|
57
|
-
}
|
|
58
|
-
_context.next = 3;
|
|
59
|
-
return Utils.ResponseToJson(this.HttpClient.Request({
|
|
60
|
-
path: UrlJoin("as", "wlt", "login", "jwt"),
|
|
61
|
-
method: "POST",
|
|
62
|
-
body: this.tenantId ? {
|
|
63
|
-
tid: this.tenantId,
|
|
64
|
-
ext: this.extraLoginData || {}
|
|
65
|
-
} : {
|
|
66
|
-
ext: this.extraLoginData || {}
|
|
67
|
-
},
|
|
68
|
-
headers: {
|
|
69
|
-
Authorization: "Bearer ".concat(this.idToken)
|
|
70
|
-
}
|
|
71
|
-
}));
|
|
72
|
-
case 3:
|
|
73
|
-
_yield$Utils$Response = _context.sent;
|
|
74
|
-
addr = _yield$Utils$Response.addr;
|
|
75
|
-
eth = _yield$Utils$Response.eth;
|
|
76
|
-
token = _yield$Utils$Response.token;
|
|
77
|
-
this.authToken = token;
|
|
78
|
-
this.address = Utils.FormatAddress(addr);
|
|
79
|
-
this.id = eth;
|
|
80
|
-
case 10:
|
|
81
|
-
if (this.address) {
|
|
82
|
-
_context.next = 16;
|
|
83
|
-
break;
|
|
84
|
-
}
|
|
85
|
-
_context.next = 13;
|
|
86
|
-
return Utils.ResponseToJson(this.HttpClient.Request({
|
|
87
|
-
method: "GET",
|
|
88
|
-
path: UrlJoin("as", "wlt", "keys"),
|
|
89
|
-
headers: {
|
|
90
|
-
Authorization: "Bearer ".concat(this.authToken)
|
|
91
|
-
}
|
|
92
|
-
}));
|
|
93
|
-
case 13:
|
|
94
|
-
keys = _context.sent;
|
|
95
|
-
address = keys.eth[0];
|
|
96
|
-
if (address && address.startsWith("0x")) {
|
|
97
|
-
this.address = address;
|
|
98
|
-
} else {
|
|
99
|
-
this.address = Utils.HashToAddress(keys.eth[0]);
|
|
100
|
-
}
|
|
101
|
-
case 16:
|
|
102
|
-
this.id = this.address ? "ikms".concat(Utils.AddressToHash(this.address)) : undefined;
|
|
103
|
-
this.signer = this.provider.getSigner(this.address);
|
|
104
|
-
case 18:
|
|
105
|
-
case "end":
|
|
106
|
-
return _context.stop();
|
|
107
|
-
}
|
|
108
|
-
}, _callee, this);
|
|
109
|
-
}));
|
|
110
|
-
function Initialize() {
|
|
111
|
-
return _Initialize.apply(this, arguments);
|
|
112
|
-
}
|
|
113
|
-
return Initialize;
|
|
114
|
-
}()
|
|
115
|
-
}, {
|
|
116
|
-
key: "RetrieveCSAT",
|
|
117
|
-
value: function () {
|
|
118
|
-
var _RetrieveCSAT = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
|
119
|
-
var email, nonce, tenantId, _ref2$force, force, response;
|
|
120
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
121
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
122
|
-
case 0:
|
|
123
|
-
email = _ref2.email, nonce = _ref2.nonce, tenantId = _ref2.tenantId, _ref2$force = _ref2.force, force = _ref2$force === void 0 ? false : _ref2$force;
|
|
124
|
-
nonce = nonce || Utils.B58(UUID.parse(UUID.v4()));
|
|
125
|
-
_context2.next = 4;
|
|
126
|
-
return Utils.ResponseToJson(this.HttpClient.Request({
|
|
127
|
-
method: "POST",
|
|
128
|
-
body: {
|
|
129
|
-
email: email,
|
|
130
|
-
nonce: nonce,
|
|
131
|
-
force: force,
|
|
132
|
-
tid: tenantId
|
|
133
|
-
},
|
|
134
|
-
path: UrlJoin("as", "wlt", "sign", "csat"),
|
|
135
|
-
headers: {
|
|
136
|
-
Authorization: "Bearer ".concat(this.authToken)
|
|
137
|
-
}
|
|
138
|
-
}));
|
|
139
|
-
case 4:
|
|
140
|
-
response = _context2.sent;
|
|
141
|
-
response.nonce = nonce;
|
|
142
|
-
return _context2.abrupt("return", response);
|
|
143
|
-
case 7:
|
|
144
|
-
case "end":
|
|
145
|
-
return _context2.stop();
|
|
146
|
-
}
|
|
147
|
-
}, _callee2, this);
|
|
148
|
-
}));
|
|
149
|
-
function RetrieveCSAT(_x) {
|
|
150
|
-
return _RetrieveCSAT.apply(this, arguments);
|
|
151
|
-
}
|
|
152
|
-
return RetrieveCSAT;
|
|
153
|
-
}()
|
|
154
|
-
}, {
|
|
155
|
-
key: "CSATStatus",
|
|
156
|
-
value: function () {
|
|
157
|
-
var _CSATStatus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
|
|
158
|
-
var accessToken, response;
|
|
159
|
-
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
160
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
161
|
-
case 0:
|
|
162
|
-
accessToken = _ref3.accessToken;
|
|
163
|
-
_context3.prev = 1;
|
|
164
|
-
_context3.next = 4;
|
|
165
|
-
return Utils.ResponseToJson(this.HttpClient.Request({
|
|
166
|
-
method: "POST",
|
|
167
|
-
path: UrlJoin("as", "wlt", "login", "status"),
|
|
168
|
-
headers: {
|
|
169
|
-
Authorization: "Bearer ".concat(accessToken)
|
|
170
|
-
}
|
|
171
|
-
}));
|
|
172
|
-
case 4:
|
|
173
|
-
response = _context3.sent;
|
|
174
|
-
return _context3.abrupt("return", response && response.is_active);
|
|
175
|
-
case 8:
|
|
176
|
-
_context3.prev = 8;
|
|
177
|
-
_context3.t0 = _context3["catch"](1);
|
|
178
|
-
return _context3.abrupt("return", !_context3.t0 || _context3.t0.status !== 403);
|
|
179
|
-
case 11:
|
|
180
|
-
case "end":
|
|
181
|
-
return _context3.stop();
|
|
182
|
-
}
|
|
183
|
-
}, _callee3, this, [[1, 8]]);
|
|
184
|
-
}));
|
|
185
|
-
function CSATStatus(_x2) {
|
|
186
|
-
return _CSATStatus.apply(this, arguments);
|
|
187
|
-
}
|
|
188
|
-
return CSATStatus;
|
|
189
|
-
}()
|
|
190
|
-
}, {
|
|
191
|
-
key: "ReleaseCSAT",
|
|
192
|
-
value: function () {
|
|
193
|
-
var _ReleaseCSAT = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref4) {
|
|
194
|
-
var accessToken;
|
|
195
|
-
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
196
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
197
|
-
case 0:
|
|
198
|
-
accessToken = _ref4.accessToken;
|
|
199
|
-
_context4.next = 3;
|
|
200
|
-
return Utils.ResponseToJson(this.HttpClient.Request({
|
|
201
|
-
method: "POST",
|
|
202
|
-
path: UrlJoin("as", "wlt", "login", "release"),
|
|
203
|
-
headers: {
|
|
204
|
-
Authorization: "Bearer ".concat(accessToken)
|
|
205
|
-
}
|
|
206
|
-
}));
|
|
207
|
-
case 3:
|
|
208
|
-
return _context4.abrupt("return", _context4.sent);
|
|
209
|
-
case 4:
|
|
210
|
-
case "end":
|
|
211
|
-
return _context4.stop();
|
|
212
|
-
}
|
|
213
|
-
}, _callee4, this);
|
|
214
|
-
}));
|
|
215
|
-
function ReleaseCSAT(_x3) {
|
|
216
|
-
return _ReleaseCSAT.apply(this, arguments);
|
|
217
|
-
}
|
|
218
|
-
return ReleaseCSAT;
|
|
219
|
-
}() // Overrides
|
|
220
|
-
}, {
|
|
221
|
-
key: "getAddress",
|
|
222
|
-
value: function getAddress() {
|
|
223
|
-
return this.address;
|
|
224
|
-
}
|
|
225
|
-
}, {
|
|
226
|
-
key: "signDigest",
|
|
227
|
-
value: function () {
|
|
228
|
-
var _signDigest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(digest) {
|
|
229
|
-
var _this2 = this;
|
|
230
|
-
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
231
|
-
while (1) switch (_context6.prev = _context6.next) {
|
|
232
|
-
case 0:
|
|
233
|
-
if (!this.signatureCache[digest]) {
|
|
234
|
-
this.signatureCache[digest] = new Promise( /*#__PURE__*/function () {
|
|
235
|
-
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(resolve, reject) {
|
|
236
|
-
var signature;
|
|
237
|
-
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
238
|
-
while (1) switch (_context5.prev = _context5.next) {
|
|
239
|
-
case 0:
|
|
240
|
-
_context5.prev = 0;
|
|
241
|
-
_context5.next = 3;
|
|
242
|
-
return Utils.ResponseToJson(_this2.HttpClient.Request({
|
|
243
|
-
method: "POST",
|
|
244
|
-
path: UrlJoin("as", "wlt", "sign", "eth", _this2.id),
|
|
245
|
-
headers: {
|
|
246
|
-
Authorization: "Bearer ".concat(_this2.authToken)
|
|
247
|
-
},
|
|
248
|
-
body: {
|
|
249
|
-
hash: digest
|
|
250
|
-
}
|
|
251
|
-
}));
|
|
252
|
-
case 3:
|
|
253
|
-
signature = _context5.sent;
|
|
254
|
-
signature.v = parseInt(signature.v, 16);
|
|
255
|
-
signature.recoveryParam = signature.v - 27;
|
|
256
|
-
resolve(signature);
|
|
257
|
-
_context5.next = 12;
|
|
258
|
-
break;
|
|
259
|
-
case 9:
|
|
260
|
-
_context5.prev = 9;
|
|
261
|
-
_context5.t0 = _context5["catch"](0);
|
|
262
|
-
reject(_context5.t0);
|
|
263
|
-
case 12:
|
|
264
|
-
case "end":
|
|
265
|
-
return _context5.stop();
|
|
266
|
-
}
|
|
267
|
-
}, _callee5, null, [[0, 9]]);
|
|
268
|
-
}));
|
|
269
|
-
return function (_x5, _x6) {
|
|
270
|
-
return _ref5.apply(this, arguments);
|
|
271
|
-
};
|
|
272
|
-
}());
|
|
273
|
-
}
|
|
274
|
-
_context6.next = 3;
|
|
275
|
-
return this.signatureCache[digest];
|
|
276
|
-
case 3:
|
|
277
|
-
return _context6.abrupt("return", _context6.sent);
|
|
278
|
-
case 4:
|
|
279
|
-
case "end":
|
|
280
|
-
return _context6.stop();
|
|
281
|
-
}
|
|
282
|
-
}, _callee6, this);
|
|
283
|
-
}));
|
|
284
|
-
function signDigest(_x4) {
|
|
285
|
-
return _signDigest.apply(this, arguments);
|
|
286
|
-
}
|
|
287
|
-
return signDigest;
|
|
288
|
-
}()
|
|
289
|
-
}, {
|
|
290
|
-
key: "signMessage",
|
|
291
|
-
value: function () {
|
|
292
|
-
var _signMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(message) {
|
|
293
|
-
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
294
|
-
while (1) switch (_context7.prev = _context7.next) {
|
|
295
|
-
case 0:
|
|
296
|
-
_context7.t0 = Promise;
|
|
297
|
-
_context7.t1 = Ethers.utils;
|
|
298
|
-
_context7.t2 = "0x";
|
|
299
|
-
_context7.next = 5;
|
|
300
|
-
return this.signDigest(Ethers.utils.hashMessage(message));
|
|
301
|
-
case 5:
|
|
302
|
-
_context7.t3 = _context7.sent;
|
|
303
|
-
_context7.t4 = _context7.t2.concat.call(_context7.t2, _context7.t3);
|
|
304
|
-
_context7.t5 = _context7.t1.joinSignature.call(_context7.t1, _context7.t4);
|
|
305
|
-
return _context7.abrupt("return", _context7.t0.resolve.call(_context7.t0, _context7.t5));
|
|
306
|
-
case 9:
|
|
307
|
-
case "end":
|
|
308
|
-
return _context7.stop();
|
|
309
|
-
}
|
|
310
|
-
}, _callee7, this);
|
|
311
|
-
}));
|
|
312
|
-
function signMessage(_x7) {
|
|
313
|
-
return _signMessage.apply(this, arguments);
|
|
314
|
-
}
|
|
315
|
-
return signMessage;
|
|
316
|
-
}()
|
|
317
|
-
}, {
|
|
318
|
-
key: "sign",
|
|
319
|
-
value: function () {
|
|
320
|
-
var _sign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(transaction) {
|
|
321
|
-
var signature;
|
|
322
|
-
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
323
|
-
while (1) switch (_context8.prev = _context8.next) {
|
|
324
|
-
case 0:
|
|
325
|
-
_context8.next = 2;
|
|
326
|
-
return Ethers.utils.resolveProperties(transaction);
|
|
327
|
-
case 2:
|
|
328
|
-
transaction = _context8.sent;
|
|
329
|
-
_context8.next = 5;
|
|
330
|
-
return this.signDigest(Ethers.utils.keccak256(Ethers.utils.serializeTransaction(transaction)));
|
|
331
|
-
case 5:
|
|
332
|
-
signature = _context8.sent;
|
|
333
|
-
return _context8.abrupt("return", Ethers.utils.serializeTransaction(transaction, signature));
|
|
334
|
-
case 7:
|
|
335
|
-
case "end":
|
|
336
|
-
return _context8.stop();
|
|
337
|
-
}
|
|
338
|
-
}, _callee8, this);
|
|
339
|
-
}));
|
|
340
|
-
function sign(_x8) {
|
|
341
|
-
return _sign.apply(this, arguments);
|
|
342
|
-
}
|
|
343
|
-
return sign;
|
|
344
|
-
}()
|
|
345
|
-
}, {
|
|
346
|
-
key: "sendTransaction",
|
|
347
|
-
value: function () {
|
|
348
|
-
var _sendTransaction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(transaction) {
|
|
349
|
-
var _this3 = this;
|
|
350
|
-
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
351
|
-
while (1) switch (_context9.prev = _context9.next) {
|
|
352
|
-
case 0:
|
|
353
|
-
if (!(transaction.nonce == null)) {
|
|
354
|
-
_context9.next = 5;
|
|
355
|
-
break;
|
|
356
|
-
}
|
|
357
|
-
transaction = Ethers.utils.shallowCopy(transaction);
|
|
358
|
-
_context9.next = 4;
|
|
359
|
-
return this.provider.getTransactionCount(this.address, "pending");
|
|
360
|
-
case 4:
|
|
361
|
-
transaction.nonce = _context9.sent;
|
|
362
|
-
case 5:
|
|
363
|
-
return _context9.abrupt("return", this.populateTransaction(transaction, this.provider, this.address).then(function (tx) {
|
|
364
|
-
return _this3.sign(tx).then(function (signedTransaction) {
|
|
365
|
-
return _this3.provider.sendTransaction(signedTransaction);
|
|
366
|
-
});
|
|
367
|
-
}));
|
|
368
|
-
case 6:
|
|
369
|
-
case "end":
|
|
370
|
-
return _context9.stop();
|
|
371
|
-
}
|
|
372
|
-
}, _callee9, this);
|
|
373
|
-
}));
|
|
374
|
-
function sendTransaction(_x9) {
|
|
375
|
-
return _sendTransaction.apply(this, arguments);
|
|
376
|
-
}
|
|
377
|
-
return sendTransaction;
|
|
378
|
-
}()
|
|
379
|
-
}, {
|
|
380
|
-
key: "connect",
|
|
381
|
-
value: function connect() {}
|
|
382
|
-
}]);
|
|
383
|
-
return RemoteSigner;
|
|
384
|
-
}(Ethers.Signer);
|
|
385
|
-
module.exports = RemoteSigner;
|