@eluvio/elv-client-js 4.0.11 → 4.0.13
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/dist/.keep +0 -0
- package/dist/ElvClient-min.js +11 -10
- package/dist/ElvClient-node-min.js +11 -10
- package/dist/ElvFrameClient-min.js +11 -10
- package/dist/ElvPermissionsClient-min.js +10 -9
- package/dist/ElvWalletClient-min.js +10 -9
- package/dist/ElvWalletClient-node-min.js +10 -9
- package/dist/src/AuthorizationClient.js +1555 -2076
- package/dist/src/ContentObjectVerification.js +134 -185
- package/dist/src/Crypto.js +224 -319
- package/dist/src/ElvClient.js +822 -1114
- package/dist/src/ElvWallet.js +64 -106
- package/dist/src/EthClient.js +719 -974
- package/dist/src/FrameClient.js +223 -319
- package/dist/src/HttpClient.js +117 -156
- package/dist/src/Id.js +1 -6
- package/dist/src/LogMessage.js +4 -8
- package/dist/src/PermissionsClient.js +973 -1271
- package/dist/src/RemoteSigner.js +161 -232
- package/dist/src/UserProfileClient.js +781 -1038
- package/dist/src/Utils.js +159 -299
- package/dist/src/Validation.js +2 -17
- package/dist/src/client/ABRPublishing.js +828 -958
- package/dist/src/client/AccessGroups.js +849 -1095
- package/dist/src/client/ContentAccess.js +3323 -4195
- package/dist/src/client/ContentManagement.js +1818 -2290
- package/dist/src/client/Contracts.js +468 -614
- package/dist/src/client/Files.js +1506 -1846
- package/dist/src/client/NFT.js +94 -116
- package/dist/src/client/NTP.js +326 -425
- package/dist/src/index.js +2 -5
- package/dist/src/walletClient/ClientMethods.js +1368 -1763
- package/dist/src/walletClient/Configuration.js +5 -3
- package/dist/src/walletClient/Notifications.js +98 -127
- package/dist/src/walletClient/Profile.js +184 -246
- package/dist/src/walletClient/Utils.js +76 -122
- package/dist/src/walletClient/index.js +1171 -1496
- package/package.json +4 -21
- package/src/FrameClient.js +1 -0
- package/src/HttpClient.js +4 -2
- package/src/client/ABRPublishing.js +126 -105
- package/src/client/ContentAccess.js +1 -0
- package/src/client/ContentManagement.js +4 -2
- package/src/walletClient/Configuration.js +3 -2
- package/dist/AccessClient-min.js +0 -54
- package/dist/AccessClient-node-min.js +0 -74
- package/dist/src/AccessClient.js +0 -798
- package/dist/src/LimitedMap.js +0 -120
- package/dist/src/client/Access.js +0 -1
- package/dist/src/client/Management.js +0 -1606
- package/dist/src/contracts/AccessIndexor.js +0 -831
- package/dist/src/contracts/Accessible.js +0 -31
- package/dist/src/contracts/AdmgrAdvertisement.js +0 -695
- package/dist/src/contracts/AdmgrCampaign.js +0 -648
- package/dist/src/contracts/AdmgrCampaignManager.js +0 -493
- package/dist/src/contracts/AdmgrCommercialOffering.js +0 -622
- package/dist/src/contracts/AdmgrCommercialOfferingManager.js +0 -413
- package/dist/src/contracts/AdmgrMarketPlace.js +0 -413
- package/dist/src/contracts/AvailsDelivery.js +0 -535
- package/dist/src/contracts/BaseAccessControlGroup.js +0 -1221
- package/dist/src/contracts/BaseAccessWallet.js +0 -1575
- package/dist/src/contracts/BaseAccessWalletFactory.js +0 -93
- package/dist/src/contracts/BaseContent.js +0 -1104
- package/dist/src/contracts/BaseContentFactory.js +0 -99
- package/dist/src/contracts/BaseContentFactoryExt.js +0 -219
- package/dist/src/contracts/BaseContentSpace.js +0 -1346
- package/dist/src/contracts/BaseContentType.js +0 -353
- package/dist/src/contracts/BaseFactory.js +0 -107
- package/dist/src/contracts/BaseGroupFactory.js +0 -93
- package/dist/src/contracts/BaseLibrary.js +0 -1035
- package/dist/src/contracts/BaseLibraryFactory.js +0 -96
- package/dist/src/contracts/Certifyer.js +0 -87
- package/dist/src/contracts/Container.js +0 -543
- package/dist/src/contracts/Content.js +0 -432
- package/dist/src/contracts/Editable.js +0 -295
- package/dist/src/contracts/FactorySpace.js +0 -57
- package/dist/src/contracts/KmsSpace.js +0 -52
- package/dist/src/contracts/LvProvider.js +0 -512
- package/dist/src/contracts/LvRecordableStream.js +0 -1026
- package/dist/src/contracts/LvRecording.js +0 -627
- package/dist/src/contracts/LvStreamRightsHolder.js +0 -551
- package/dist/src/contracts/MetaObject.js +0 -110
- package/dist/src/contracts/Node.js +0 -167
- package/dist/src/contracts/NodeSpace.js +0 -18
- package/dist/src/contracts/NodeSpaceImpl.js +0 -273
- package/dist/src/contracts/Ownable.js +0 -87
- package/dist/src/contracts/PaymentService.js +0 -616
- package/dist/src/contracts/Precompile.js +0 -15
- package/dist/src/contracts/SampleContentAdMarketplace.js +0 -564
- package/dist/src/contracts/SampleContentAdvertising.js +0 -444
- package/dist/src/contracts/SampleContentHelloWorld.js +0 -459
- package/dist/src/contracts/SampleContentLicensing.js +0 -618
- package/dist/src/contracts/SampleContentSigned.js +0 -447
- package/dist/src/contracts/SampleInstance.js +0 -438
- package/dist/src/contracts/SampleInstanceFactory.js +0 -451
- package/dist/src/contracts/Transactable.js +0 -82
- package/dist/src/contracts/UserSpace.js +0 -18
- package/dist/src/contracts/UserSpaceImpl.js +0 -43
- package/dist/src/contracts/Utils.js +0 -18
- package/dist/src/contracts/Verifier.js +0 -53
- package/dist/src/contracts/strings.js +0 -4
- package/dist/src/contracts/v2/BaseContentFactoryExt.js +0 -219
- package/dist/src/contracts/v2/FactorySpace.js +0 -57
- package/dist/src/contracts/v2/KmsSpace.js +0 -52
- package/dist/src/contracts/v2/NodeSpaceImpl.js +0 -273
- package/dist/src/contracts/v2/UserSpaceImpl.js +0 -43
- package/dist/src/marketplaceClient/ClientMethods.js +0 -1918
- package/dist/src/marketplaceClient/Configuration.js +0 -29
- package/dist/src/marketplaceClient/Utils.js +0 -304
- package/dist/src/marketplaceClient/index.js +0 -1553
- package/utilities/ListAccessGroups.js +0 -34
package/dist/src/RemoteSigner.js
CHANGED
|
@@ -1,51 +1,33 @@
|
|
|
1
1
|
var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
2
|
-
|
|
3
2
|
var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
4
|
-
|
|
5
3
|
var _classCallCheck = require("@babel/runtime/helpers/classCallCheck");
|
|
6
|
-
|
|
7
4
|
var _createClass = require("@babel/runtime/helpers/createClass");
|
|
8
|
-
|
|
9
5
|
var _inherits = require("@babel/runtime/helpers/inherits");
|
|
10
|
-
|
|
11
6
|
var _possibleConstructorReturn = require("@babel/runtime/helpers/possibleConstructorReturn");
|
|
12
|
-
|
|
13
7
|
var _getPrototypeOf = require("@babel/runtime/helpers/getPrototypeOf");
|
|
14
|
-
|
|
15
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); }; }
|
|
16
|
-
|
|
17
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; } }
|
|
18
|
-
|
|
19
10
|
var Ethers = require("ethers");
|
|
20
|
-
|
|
21
11
|
var Utils = require("./Utils");
|
|
22
|
-
|
|
23
12
|
var HttpClient = require("./HttpClient");
|
|
24
|
-
|
|
25
13
|
var UrlJoin = require("url-join");
|
|
26
|
-
|
|
27
14
|
var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
28
15
|
"use strict";
|
|
29
16
|
|
|
30
17
|
_inherits(RemoteSigner, _Ethers$Signer);
|
|
31
|
-
|
|
32
18
|
var _super = _createSuper(RemoteSigner);
|
|
33
|
-
|
|
34
19
|
function RemoteSigner(_ref) {
|
|
35
20
|
var _this;
|
|
36
|
-
|
|
37
21
|
var signerURIs = _ref.signerURIs,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
22
|
+
idToken = _ref.idToken,
|
|
23
|
+
authToken = _ref.authToken,
|
|
24
|
+
tenantId = _ref.tenantId,
|
|
25
|
+
provider = _ref.provider,
|
|
26
|
+
_ref$extraData = _ref.extraData,
|
|
27
|
+
extraData = _ref$extraData === void 0 ? {} : _ref$extraData,
|
|
28
|
+
_ref$unsignedPublicAu = _ref.unsignedPublicAuth,
|
|
29
|
+
unsignedPublicAuth = _ref$unsignedPublicAu === void 0 ? false : _ref$unsignedPublicAu;
|
|
47
30
|
_classCallCheck(this, RemoteSigner);
|
|
48
|
-
|
|
49
31
|
_this = _super.call(this);
|
|
50
32
|
_this.remoteSigner = true;
|
|
51
33
|
_this.unsignedPublicAuth = unsignedPublicAuth;
|
|
@@ -60,177 +42,148 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
|
60
42
|
_this.signatureCache = {};
|
|
61
43
|
return _this;
|
|
62
44
|
}
|
|
63
|
-
|
|
64
45
|
_createClass(RemoteSigner, [{
|
|
65
46
|
key: "Initialize",
|
|
66
47
|
value: function () {
|
|
67
48
|
var _Initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
68
49
|
var _yield$Utils$Response, addr, eth, token, keys, address;
|
|
69
|
-
|
|
70
50
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
71
|
-
while (1) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
headers: {
|
|
90
|
-
Authorization: "Bearer ".concat(this.idToken)
|
|
91
|
-
}
|
|
92
|
-
}));
|
|
93
|
-
|
|
94
|
-
case 3:
|
|
95
|
-
_yield$Utils$Response = _context.sent;
|
|
96
|
-
addr = _yield$Utils$Response.addr;
|
|
97
|
-
eth = _yield$Utils$Response.eth;
|
|
98
|
-
token = _yield$Utils$Response.token;
|
|
99
|
-
this.authToken = token;
|
|
100
|
-
this.address = Utils.FormatAddress(addr);
|
|
101
|
-
this.id = eth;
|
|
102
|
-
|
|
103
|
-
case 10:
|
|
104
|
-
if (this.address) {
|
|
105
|
-
_context.next = 16;
|
|
106
|
-
break;
|
|
51
|
+
while (1) switch (_context.prev = _context.next) {
|
|
52
|
+
case 0:
|
|
53
|
+
if (this.authToken) {
|
|
54
|
+
_context.next = 10;
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
_context.next = 3;
|
|
58
|
+
return Utils.ResponseToJson(this.HttpClient.Request({
|
|
59
|
+
path: UrlJoin("as", "wlt", "login", "jwt"),
|
|
60
|
+
method: "POST",
|
|
61
|
+
body: this.tenantId ? {
|
|
62
|
+
tid: this.tenantId,
|
|
63
|
+
ext: this.extraLoginData || {}
|
|
64
|
+
} : {
|
|
65
|
+
ext: this.extraLoginData || {}
|
|
66
|
+
},
|
|
67
|
+
headers: {
|
|
68
|
+
Authorization: "Bearer ".concat(this.idToken)
|
|
107
69
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
70
|
+
}));
|
|
71
|
+
case 3:
|
|
72
|
+
_yield$Utils$Response = _context.sent;
|
|
73
|
+
addr = _yield$Utils$Response.addr;
|
|
74
|
+
eth = _yield$Utils$Response.eth;
|
|
75
|
+
token = _yield$Utils$Response.token;
|
|
76
|
+
this.authToken = token;
|
|
77
|
+
this.address = Utils.FormatAddress(addr);
|
|
78
|
+
this.id = eth;
|
|
79
|
+
case 10:
|
|
80
|
+
if (this.address) {
|
|
81
|
+
_context.next = 16;
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
_context.next = 13;
|
|
85
|
+
return Utils.ResponseToJson(this.HttpClient.Request({
|
|
86
|
+
method: "GET",
|
|
87
|
+
path: UrlJoin("as", "wlt", "keys"),
|
|
88
|
+
headers: {
|
|
89
|
+
Authorization: "Bearer ".concat(this.authToken)
|
|
126
90
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
91
|
+
}));
|
|
92
|
+
case 13:
|
|
93
|
+
keys = _context.sent;
|
|
94
|
+
address = keys.eth[0];
|
|
95
|
+
if (address && address.startsWith("0x")) {
|
|
96
|
+
this.address = address;
|
|
97
|
+
} else {
|
|
98
|
+
this.address = Utils.HashToAddress(keys.eth[0]);
|
|
99
|
+
}
|
|
100
|
+
case 16:
|
|
101
|
+
this.id = this.address ? "ikms".concat(Utils.AddressToHash(this.address)) : undefined;
|
|
102
|
+
this.signer = this.provider.getSigner(this.address);
|
|
103
|
+
case 18:
|
|
104
|
+
case "end":
|
|
105
|
+
return _context.stop();
|
|
136
106
|
}
|
|
137
107
|
}, _callee, this);
|
|
138
108
|
}));
|
|
139
|
-
|
|
140
109
|
function Initialize() {
|
|
141
110
|
return _Initialize.apply(this, arguments);
|
|
142
111
|
}
|
|
143
|
-
|
|
144
112
|
return Initialize;
|
|
145
113
|
}() // Overrides
|
|
146
|
-
|
|
147
114
|
}, {
|
|
148
115
|
key: "getAddress",
|
|
149
116
|
value: function getAddress() {
|
|
150
117
|
return this.address;
|
|
151
118
|
}
|
|
119
|
+
|
|
152
120
|
/**
|
|
153
121
|
* Sign a hashed piece of data
|
|
154
122
|
* @param {String} digest - Hex string of hashed data
|
|
155
123
|
* @returns - the signed message as a hex string
|
|
156
124
|
*/
|
|
157
|
-
|
|
158
125
|
}, {
|
|
159
126
|
key: "signDigest",
|
|
160
127
|
value: function () {
|
|
161
128
|
var _signDigest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(digest) {
|
|
162
129
|
var _this2 = this;
|
|
163
|
-
|
|
164
130
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
165
|
-
while (1) {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
var
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
_context3.next = 3;
|
|
217
|
-
return this.signatureCache[digest];
|
|
218
|
-
|
|
219
|
-
case 3:
|
|
220
|
-
return _context3.abrupt("return", _context3.sent);
|
|
221
|
-
|
|
222
|
-
case 4:
|
|
223
|
-
case "end":
|
|
224
|
-
return _context3.stop();
|
|
225
|
-
}
|
|
131
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
132
|
+
case 0:
|
|
133
|
+
if (!this.signatureCache[digest]) {
|
|
134
|
+
this.signatureCache[digest] = new Promise( /*#__PURE__*/function () {
|
|
135
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(resolve, reject) {
|
|
136
|
+
var signature;
|
|
137
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
138
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
139
|
+
case 0:
|
|
140
|
+
_context2.prev = 0;
|
|
141
|
+
_context2.next = 3;
|
|
142
|
+
return Utils.ResponseToJson(_this2.HttpClient.Request({
|
|
143
|
+
method: "POST",
|
|
144
|
+
path: UrlJoin("as", "wlt", "sign", "eth", _this2.id),
|
|
145
|
+
headers: {
|
|
146
|
+
Authorization: "Bearer ".concat(_this2.authToken)
|
|
147
|
+
},
|
|
148
|
+
body: {
|
|
149
|
+
hash: digest
|
|
150
|
+
}
|
|
151
|
+
}));
|
|
152
|
+
case 3:
|
|
153
|
+
signature = _context2.sent;
|
|
154
|
+
signature.v = parseInt(signature.v, 16);
|
|
155
|
+
signature.recoveryParam = signature.v - 27;
|
|
156
|
+
resolve(signature);
|
|
157
|
+
_context2.next = 12;
|
|
158
|
+
break;
|
|
159
|
+
case 9:
|
|
160
|
+
_context2.prev = 9;
|
|
161
|
+
_context2.t0 = _context2["catch"](0);
|
|
162
|
+
reject(_context2.t0);
|
|
163
|
+
case 12:
|
|
164
|
+
case "end":
|
|
165
|
+
return _context2.stop();
|
|
166
|
+
}
|
|
167
|
+
}, _callee2, null, [[0, 9]]);
|
|
168
|
+
}));
|
|
169
|
+
return function (_x2, _x3) {
|
|
170
|
+
return _ref2.apply(this, arguments);
|
|
171
|
+
};
|
|
172
|
+
}());
|
|
173
|
+
}
|
|
174
|
+
_context3.next = 3;
|
|
175
|
+
return this.signatureCache[digest];
|
|
176
|
+
case 3:
|
|
177
|
+
return _context3.abrupt("return", _context3.sent);
|
|
178
|
+
case 4:
|
|
179
|
+
case "end":
|
|
180
|
+
return _context3.stop();
|
|
226
181
|
}
|
|
227
182
|
}, _callee3, this);
|
|
228
183
|
}));
|
|
229
|
-
|
|
230
184
|
function signDigest(_x) {
|
|
231
185
|
return _signDigest.apply(this, arguments);
|
|
232
186
|
}
|
|
233
|
-
|
|
234
187
|
return signDigest;
|
|
235
188
|
}()
|
|
236
189
|
}, {
|
|
@@ -238,33 +191,27 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
|
238
191
|
value: function () {
|
|
239
192
|
var _signMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(message) {
|
|
240
193
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
241
|
-
while (1) {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
case 9:
|
|
257
|
-
case "end":
|
|
258
|
-
return _context4.stop();
|
|
259
|
-
}
|
|
194
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
195
|
+
case 0:
|
|
196
|
+
_context4.t0 = Promise;
|
|
197
|
+
_context4.t1 = Ethers.utils;
|
|
198
|
+
_context4.t2 = "0x";
|
|
199
|
+
_context4.next = 5;
|
|
200
|
+
return this.signDigest(Ethers.utils.hashMessage(message));
|
|
201
|
+
case 5:
|
|
202
|
+
_context4.t3 = _context4.sent;
|
|
203
|
+
_context4.t4 = _context4.t2.concat.call(_context4.t2, _context4.t3);
|
|
204
|
+
_context4.t5 = _context4.t1.joinSignature.call(_context4.t1, _context4.t4);
|
|
205
|
+
return _context4.abrupt("return", _context4.t0.resolve.call(_context4.t0, _context4.t5));
|
|
206
|
+
case 9:
|
|
207
|
+
case "end":
|
|
208
|
+
return _context4.stop();
|
|
260
209
|
}
|
|
261
210
|
}, _callee4, this);
|
|
262
211
|
}));
|
|
263
|
-
|
|
264
212
|
function signMessage(_x4) {
|
|
265
213
|
return _signMessage.apply(this, arguments);
|
|
266
214
|
}
|
|
267
|
-
|
|
268
215
|
return signMessage;
|
|
269
216
|
}()
|
|
270
217
|
}, {
|
|
@@ -273,33 +220,26 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
|
273
220
|
var _sign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(transaction) {
|
|
274
221
|
var signature;
|
|
275
222
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
276
|
-
while (1) {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
case 7:
|
|
292
|
-
case "end":
|
|
293
|
-
return _context5.stop();
|
|
294
|
-
}
|
|
223
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
224
|
+
case 0:
|
|
225
|
+
_context5.next = 2;
|
|
226
|
+
return Ethers.utils.resolveProperties(transaction);
|
|
227
|
+
case 2:
|
|
228
|
+
transaction = _context5.sent;
|
|
229
|
+
_context5.next = 5;
|
|
230
|
+
return this.signDigest(Ethers.utils.keccak256(Ethers.utils.serializeTransaction(transaction)));
|
|
231
|
+
case 5:
|
|
232
|
+
signature = _context5.sent;
|
|
233
|
+
return _context5.abrupt("return", Ethers.utils.serializeTransaction(transaction, signature));
|
|
234
|
+
case 7:
|
|
235
|
+
case "end":
|
|
236
|
+
return _context5.stop();
|
|
295
237
|
}
|
|
296
238
|
}, _callee5, this);
|
|
297
239
|
}));
|
|
298
|
-
|
|
299
240
|
function sign(_x5) {
|
|
300
241
|
return _sign.apply(this, arguments);
|
|
301
242
|
}
|
|
302
|
-
|
|
303
243
|
return sign;
|
|
304
244
|
}()
|
|
305
245
|
}, {
|
|
@@ -307,50 +247,39 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
|
307
247
|
value: function () {
|
|
308
248
|
var _sendTransaction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(transaction) {
|
|
309
249
|
var _this3 = this;
|
|
310
|
-
|
|
311
250
|
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
312
|
-
while (1) {
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
}));
|
|
333
|
-
|
|
334
|
-
case 6:
|
|
335
|
-
case "end":
|
|
336
|
-
return _context6.stop();
|
|
337
|
-
}
|
|
251
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
252
|
+
case 0:
|
|
253
|
+
if (!(transaction.nonce == null)) {
|
|
254
|
+
_context6.next = 5;
|
|
255
|
+
break;
|
|
256
|
+
}
|
|
257
|
+
transaction = Ethers.utils.shallowCopy(transaction);
|
|
258
|
+
_context6.next = 4;
|
|
259
|
+
return this.provider.getTransactionCount(this.address, "pending");
|
|
260
|
+
case 4:
|
|
261
|
+
transaction.nonce = _context6.sent;
|
|
262
|
+
case 5:
|
|
263
|
+
return _context6.abrupt("return", Ethers.utils.populateTransaction(transaction, this.provider, this.address).then(function (tx) {
|
|
264
|
+
return _this3.sign(tx).then(function (signedTransaction) {
|
|
265
|
+
return _this3.provider.sendTransaction(signedTransaction);
|
|
266
|
+
});
|
|
267
|
+
}));
|
|
268
|
+
case 6:
|
|
269
|
+
case "end":
|
|
270
|
+
return _context6.stop();
|
|
338
271
|
}
|
|
339
272
|
}, _callee6, this);
|
|
340
273
|
}));
|
|
341
|
-
|
|
342
274
|
function sendTransaction(_x6) {
|
|
343
275
|
return _sendTransaction.apply(this, arguments);
|
|
344
276
|
}
|
|
345
|
-
|
|
346
277
|
return sendTransaction;
|
|
347
278
|
}()
|
|
348
279
|
}, {
|
|
349
280
|
key: "connect",
|
|
350
281
|
value: function connect() {}
|
|
351
282
|
}]);
|
|
352
|
-
|
|
353
283
|
return RemoteSigner;
|
|
354
284
|
}(Ethers.Signer);
|
|
355
|
-
|
|
356
285
|
module.exports = RemoteSigner;
|