@aeternity/aepp-sdk 8.2.0 → 10.0.0-beta.1
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/README.md +16 -9
- package/dist/aepp-sdk.browser-script.js +1 -1
- package/dist/aepp-sdk.browser-script.js.LICENSE.txt +0 -9
- package/dist/aepp-sdk.browser-script.js.map +1 -1
- package/dist/aepp-sdk.browser.js +1 -1
- package/dist/aepp-sdk.browser.js.map +1 -1
- package/dist/aepp-sdk.js +1 -1
- package/dist/aepp-sdk.js.map +1 -1
- package/es/account/base.js +33 -119
- package/es/account/base.js.map +1 -1
- package/es/account/memory.js +17 -19
- package/es/account/memory.js.map +1 -1
- package/es/account/multiple.js +75 -154
- package/es/account/multiple.js.map +1 -1
- package/es/ae/aens.js +164 -599
- package/es/ae/aens.js.map +1 -1
- package/es/ae/contract.js +108 -916
- package/es/ae/contract.js.map +1 -1
- package/es/ae/index.js +89 -250
- package/es/ae/index.js.map +1 -1
- package/es/ae/oracle.js +132 -500
- package/es/ae/oracle.js.map +1 -1
- package/es/chain/index.js +4 -23
- package/es/chain/index.js.map +1 -1
- package/es/chain/node.js +292 -1018
- package/es/chain/node.js.map +1 -1
- package/es/channel/handlers.js +597 -1086
- package/es/channel/handlers.js.map +1 -1
- package/es/channel/index.js +203 -451
- package/es/channel/index.js.map +1 -1
- package/es/channel/internal.js +129 -301
- package/es/channel/internal.js.map +1 -1
- package/es/contract/aci/index.js +319 -491
- package/es/contract/aci/index.js.map +1 -1
- package/es/contract/aci/transformation.js +35 -711
- package/es/contract/aci/transformation.js.map +1 -1
- package/es/contract/compiler.js +129 -203
- package/es/contract/compiler.js.map +1 -1
- package/es/contract/ga/helpers.js +17 -122
- package/es/contract/ga/helpers.js.map +1 -1
- package/es/contract/ga/index.js +102 -247
- package/es/contract/ga/index.js.map +1 -1
- package/es/contract/index.js +1 -1
- package/es/contract/index.js.map +1 -1
- package/es/index.js +2 -3
- package/es/index.js.map +1 -1
- package/es/node-pool/index.js +54 -73
- package/es/node-pool/index.js.map +1 -1
- package/es/node.js +56 -157
- package/es/node.js.map +1 -1
- package/es/other.d.ts +1 -1
- package/es/tx/builder/helpers.js +49 -89
- package/es/tx/builder/helpers.js.map +1 -1
- package/es/tx/builder/index.js +205 -303
- package/es/tx/builder/index.js.map +1 -1
- package/es/tx/builder/schema.js +585 -573
- package/es/tx/builder/schema.js.map +1 -1
- package/es/tx/index.js +1 -1
- package/es/tx/index.js.map +1 -1
- package/es/tx/tx-object.js +105 -135
- package/es/tx/tx-object.js.map +1 -1
- package/es/tx/tx.js +810 -1586
- package/es/tx/tx.js.map +1 -1
- package/es/tx/validator.js +191 -426
- package/es/tx/validator.js.map +1 -1
- package/es/utils/aepp-wallet-communication/connection/browser-runtime.js +17 -21
- package/es/utils/aepp-wallet-communication/connection/browser-runtime.js.map +1 -1
- package/es/utils/aepp-wallet-communication/connection/browser-window-message.js +38 -74
- package/es/utils/aepp-wallet-communication/connection/browser-window-message.js.map +1 -1
- package/es/utils/aepp-wallet-communication/content-script-bridge.js +14 -15
- package/es/utils/aepp-wallet-communication/content-script-bridge.js.map +1 -1
- package/es/utils/aepp-wallet-communication/helpers.js +60 -105
- package/es/utils/aepp-wallet-communication/helpers.js.map +1 -1
- package/es/utils/aepp-wallet-communication/rpc/aepp-rpc.js +179 -510
- package/es/utils/aepp-wallet-communication/rpc/aepp-rpc.js.map +1 -1
- package/es/utils/aepp-wallet-communication/rpc/rpc-client.js +70 -89
- package/es/utils/aepp-wallet-communication/rpc/rpc-client.js.map +1 -1
- package/es/utils/aepp-wallet-communication/rpc/wallet-rpc.js +354 -603
- package/es/utils/aepp-wallet-communication/rpc/wallet-rpc.js.map +1 -1
- package/es/utils/aepp-wallet-communication/schema.js +43 -39
- package/es/utils/aepp-wallet-communication/schema.js.map +1 -1
- package/es/utils/aepp-wallet-communication/wallet-detector.js +32 -58
- package/es/utils/aepp-wallet-communication/wallet-detector.js.map +1 -1
- package/es/utils/amount-formatter.js +41 -61
- package/es/utils/amount-formatter.js.map +1 -1
- package/es/utils/async-init.js +28 -64
- package/es/utils/async-init.js.map +1 -1
- package/es/utils/bignumber.js +3 -11
- package/es/utils/bignumber.js.map +1 -1
- package/es/utils/bytes.js +5 -9
- package/es/utils/bytes.js.map +1 -1
- package/es/utils/crypto.js +49 -75
- package/es/utils/crypto.js.map +1 -1
- package/es/utils/hd-wallet.js +45 -81
- package/es/utils/hd-wallet.js.map +1 -1
- package/es/utils/json-big.js +16 -49
- package/es/utils/json-big.js.map +1 -1
- package/es/utils/keystore.js +81 -246
- package/es/utils/keystore.js.map +1 -1
- package/es/utils/mptree.js +88 -134
- package/es/utils/mptree.js.map +1 -1
- package/es/utils/other.js +10 -60
- package/es/utils/other.js.map +1 -1
- package/es/utils/semver-satisfies.js +9 -28
- package/es/utils/semver-satisfies.js.map +1 -1
- package/es/utils/string.js +4 -13
- package/es/utils/string.js.map +1 -1
- package/es/utils/swagger.js +85 -218
- package/es/utils/swagger.js.map +1 -1
- package/package.json +52 -43
- package/src/account/base.js +8 -9
- package/src/account/multiple.js +20 -16
- package/src/ae/aens.js +25 -21
- package/src/ae/contract.js +65 -246
- package/src/ae/index.js +31 -7
- package/src/ae/oracle.js +21 -17
- package/src/chain/index.js +2 -12
- package/src/chain/node.js +26 -29
- package/src/channel/handlers.js +0 -1
- package/src/channel/index.js +4 -5
- package/src/contract/aci/index.js +221 -106
- package/src/contract/aci/transformation.js +30 -422
- package/src/contract/compiler.js +45 -4
- package/src/contract/ga/helpers.js +2 -12
- package/src/contract/ga/index.js +22 -26
- package/src/index.js +2 -4
- package/src/node-pool/index.js +21 -12
- package/src/node.js +22 -26
- package/src/tx/builder/helpers.js +12 -24
- package/src/tx/builder/index.js +18 -15
- package/src/tx/builder/schema.js +43 -108
- package/src/tx/tx-object.js +0 -2
- package/src/tx/tx.js +157 -144
- package/src/tx/validator.js +134 -202
- package/src/utils/aepp-wallet-communication/rpc/aepp-rpc.js +1 -3
- package/src/utils/aepp-wallet-communication/rpc/wallet-rpc.js +9 -10
- package/src/utils/aepp-wallet-communication/schema.js +1 -3
- package/src/utils/amount-formatter.ts +1 -1
- package/src/utils/bignumber.ts +2 -1
- package/src/utils/crypto.js +4 -17
- package/src/utils/other.ts +1 -1
- package/src/utils/semver-satisfies.ts +1 -1
- package/src/utils/swagger.js +24 -7
- package/CHANGELOG.md +0 -1716
- package/src/contract/aci/helpers.js +0 -140
package/es/channel/index.js
CHANGED
|
@@ -1,29 +1,3 @@
|
|
|
1
|
-
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
2
|
-
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
|
3
|
-
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
4
|
-
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
|
|
5
|
-
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
|
6
|
-
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
|
7
|
-
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
|
8
|
-
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
|
9
|
-
import _reduce from "ramda/src/reduce";
|
|
10
|
-
import _typeof from "@babel/runtime-corejs3/helpers/typeof";
|
|
11
|
-
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/asyncToGenerator";
|
|
12
|
-
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
13
|
-
import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
|
|
14
|
-
import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
|
|
15
|
-
|
|
16
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) { symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
17
|
-
|
|
18
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context10; _forEachInstanceProperty(_context10 = ownKeys(Object(source), true)).call(_context10, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { var _context11; _forEachInstanceProperty(_context11 = ownKeys(Object(source))).call(_context11, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
19
|
-
|
|
20
|
-
import _reduceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reduce";
|
|
21
|
-
import _Object$entries from "@babel/runtime-corejs3/core-js-stable/object/entries";
|
|
22
|
-
import _parseInt from "@babel/runtime-corejs3/core-js-stable/parse-int";
|
|
23
|
-
import _Promise from "@babel/runtime-corejs3/core-js-stable/promise";
|
|
24
|
-
import _JSON$stringify from "@babel/runtime-corejs3/core-js-stable/json/stringify";
|
|
25
|
-
import _setTimeout from "@babel/runtime-corejs3/core-js-stable/set-timeout";
|
|
26
|
-
|
|
27
1
|
/*
|
|
28
2
|
* ISC License (ISC)
|
|
29
3
|
* Copyright (c) 2018 aeternity developers
|
|
@@ -55,14 +29,11 @@ import * as handlers from './handlers';
|
|
|
55
29
|
import { eventEmitters, status as channelStatus, state as channelState, initialize, enqueueAction, send, channelId, call, disconnect as channelDisconnect, fsmId as channelFsmId } from './internal';
|
|
56
30
|
|
|
57
31
|
function snakeToPascalObjKeys(obj) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
val = _ref2[1];
|
|
64
|
-
|
|
65
|
-
return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, snakeToPascal(key), val));
|
|
32
|
+
return Object.entries(obj).reduce((result, _ref) => {
|
|
33
|
+
let [key, val] = _ref;
|
|
34
|
+
return { ...result,
|
|
35
|
+
[snakeToPascal(key)]: val
|
|
36
|
+
};
|
|
66
37
|
}, {});
|
|
67
38
|
}
|
|
68
39
|
/**
|
|
@@ -121,8 +92,8 @@ function status() {
|
|
|
121
92
|
*/
|
|
122
93
|
|
|
123
94
|
|
|
124
|
-
function state() {
|
|
125
|
-
return
|
|
95
|
+
async function state() {
|
|
96
|
+
return snakeToPascalObjKeys(await call(this, 'channels.get.offchain_state', {}));
|
|
126
97
|
}
|
|
127
98
|
/**
|
|
128
99
|
* Get current round
|
|
@@ -134,40 +105,17 @@ function state() {
|
|
|
134
105
|
*/
|
|
135
106
|
|
|
136
107
|
|
|
137
|
-
function _state() {
|
|
138
|
-
_state = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
139
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context3) {
|
|
140
|
-
while (1) {
|
|
141
|
-
switch (_context3.prev = _context3.next) {
|
|
142
|
-
case 0:
|
|
143
|
-
_context3.t0 = snakeToPascalObjKeys;
|
|
144
|
-
_context3.next = 3;
|
|
145
|
-
return call(this, 'channels.get.offchain_state', {});
|
|
146
|
-
|
|
147
|
-
case 3:
|
|
148
|
-
_context3.t1 = _context3.sent;
|
|
149
|
-
return _context3.abrupt("return", (0, _context3.t0)(_context3.t1));
|
|
150
|
-
|
|
151
|
-
case 5:
|
|
152
|
-
case "end":
|
|
153
|
-
return _context3.stop();
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}, _callee2, this);
|
|
157
|
-
}));
|
|
158
|
-
return _state.apply(this, arguments);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
108
|
function round() {
|
|
162
|
-
|
|
109
|
+
const state = channelState.get(this);
|
|
163
110
|
|
|
164
111
|
if (!state) {
|
|
165
112
|
return null;
|
|
166
113
|
}
|
|
167
114
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
115
|
+
const {
|
|
116
|
+
txType,
|
|
117
|
+
tx
|
|
118
|
+
} = unpackTx(channelState.get(this)).tx.encodedTx;
|
|
171
119
|
|
|
172
120
|
switch (txType) {
|
|
173
121
|
case TX_TYPE.channelCreate:
|
|
@@ -176,7 +124,7 @@ function round() {
|
|
|
176
124
|
case TX_TYPE.channelOffChain:
|
|
177
125
|
case TX_TYPE.channelWithdraw:
|
|
178
126
|
case TX_TYPE.channelDeposit:
|
|
179
|
-
return
|
|
127
|
+
return parseInt(tx.round, 10);
|
|
180
128
|
|
|
181
129
|
default:
|
|
182
130
|
return null;
|
|
@@ -231,28 +179,24 @@ function fsmId() {
|
|
|
231
179
|
|
|
232
180
|
|
|
233
181
|
function update(from, to, amount, sign, metadata) {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
return new _Promise(function (resolve, reject) {
|
|
237
|
-
enqueueAction(_this, function (channel, state) {
|
|
238
|
-
return state.handler === handlers.channelOpen;
|
|
239
|
-
}, function (channel, state) {
|
|
182
|
+
return new Promise((resolve, reject) => {
|
|
183
|
+
enqueueAction(this, (channel, state) => state.handler === handlers.channelOpen, (channel, state) => {
|
|
240
184
|
send(channel, {
|
|
241
185
|
jsonrpc: '2.0',
|
|
242
186
|
method: 'channels.update.new',
|
|
243
187
|
params: {
|
|
244
|
-
from
|
|
245
|
-
to
|
|
246
|
-
amount
|
|
188
|
+
from,
|
|
189
|
+
to,
|
|
190
|
+
amount,
|
|
247
191
|
meta: metadata
|
|
248
192
|
}
|
|
249
193
|
});
|
|
250
194
|
return {
|
|
251
195
|
handler: handlers.awaitingOffChainTx,
|
|
252
196
|
state: {
|
|
253
|
-
resolve
|
|
254
|
-
reject
|
|
255
|
-
sign
|
|
197
|
+
resolve,
|
|
198
|
+
reject,
|
|
199
|
+
sign
|
|
256
200
|
}
|
|
257
201
|
};
|
|
258
202
|
});
|
|
@@ -278,8 +222,15 @@ function update(from, to, amount, sign, metadata) {
|
|
|
278
222
|
*/
|
|
279
223
|
|
|
280
224
|
|
|
281
|
-
function poi(
|
|
282
|
-
|
|
225
|
+
async function poi(_ref2) {
|
|
226
|
+
let {
|
|
227
|
+
accounts,
|
|
228
|
+
contracts
|
|
229
|
+
} = _ref2;
|
|
230
|
+
return (await call(this, 'channels.get.poi', {
|
|
231
|
+
accounts,
|
|
232
|
+
contracts
|
|
233
|
+
})).poi;
|
|
283
234
|
}
|
|
284
235
|
/**
|
|
285
236
|
* Get balances
|
|
@@ -302,35 +253,10 @@ function poi(_x) {
|
|
|
302
253
|
*/
|
|
303
254
|
|
|
304
255
|
|
|
305
|
-
function
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
while (1) {
|
|
310
|
-
switch (_context4.prev = _context4.next) {
|
|
311
|
-
case 0:
|
|
312
|
-
accounts = _ref3.accounts, contracts = _ref3.contracts;
|
|
313
|
-
_context4.next = 3;
|
|
314
|
-
return call(this, 'channels.get.poi', {
|
|
315
|
-
accounts: accounts,
|
|
316
|
-
contracts: contracts
|
|
317
|
-
});
|
|
318
|
-
|
|
319
|
-
case 3:
|
|
320
|
-
return _context4.abrupt("return", _context4.sent.poi);
|
|
321
|
-
|
|
322
|
-
case 4:
|
|
323
|
-
case "end":
|
|
324
|
-
return _context4.stop();
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
}, _callee3, this);
|
|
328
|
-
}));
|
|
329
|
-
return _poi.apply(this, arguments);
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
function balances(_x2) {
|
|
333
|
-
return _balances.apply(this, arguments);
|
|
256
|
+
async function balances(accounts) {
|
|
257
|
+
return Object.fromEntries((await call(this, 'channels.get.balances', {
|
|
258
|
+
accounts
|
|
259
|
+
})).map(item => [item.account, item.balance]));
|
|
334
260
|
}
|
|
335
261
|
/**
|
|
336
262
|
* Leave channel
|
|
@@ -352,45 +278,9 @@ function balances(_x2) {
|
|
|
352
278
|
*/
|
|
353
279
|
|
|
354
280
|
|
|
355
|
-
function _balances() {
|
|
356
|
-
_balances = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(accounts) {
|
|
357
|
-
return _regeneratorRuntime.wrap(function _callee4$(_context5) {
|
|
358
|
-
while (1) {
|
|
359
|
-
switch (_context5.prev = _context5.next) {
|
|
360
|
-
case 0:
|
|
361
|
-
_context5.t0 = _reduce;
|
|
362
|
-
|
|
363
|
-
_context5.t1 = function (acc, item) {
|
|
364
|
-
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, item.account, item.balance));
|
|
365
|
-
};
|
|
366
|
-
|
|
367
|
-
_context5.t2 = {};
|
|
368
|
-
_context5.next = 5;
|
|
369
|
-
return call(this, 'channels.get.balances', {
|
|
370
|
-
accounts: accounts
|
|
371
|
-
});
|
|
372
|
-
|
|
373
|
-
case 5:
|
|
374
|
-
_context5.t3 = _context5.sent;
|
|
375
|
-
return _context5.abrupt("return", (0, _context5.t0)(_context5.t1, _context5.t2, _context5.t3));
|
|
376
|
-
|
|
377
|
-
case 7:
|
|
378
|
-
case "end":
|
|
379
|
-
return _context5.stop();
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
}, _callee4, this);
|
|
383
|
-
}));
|
|
384
|
-
return _balances.apply(this, arguments);
|
|
385
|
-
}
|
|
386
|
-
|
|
387
281
|
function leave() {
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
return new _Promise(function (resolve, reject) {
|
|
391
|
-
enqueueAction(_this2, function (channel, state) {
|
|
392
|
-
return state.handler === handlers.channelOpen;
|
|
393
|
-
}, function (channel, state) {
|
|
282
|
+
return new Promise((resolve, reject) => {
|
|
283
|
+
enqueueAction(this, (channel, state) => state.handler === handlers.channelOpen, (channel, state) => {
|
|
394
284
|
send(channel, {
|
|
395
285
|
jsonrpc: '2.0',
|
|
396
286
|
method: 'channels.leave',
|
|
@@ -399,8 +289,8 @@ function leave() {
|
|
|
399
289
|
return {
|
|
400
290
|
handler: handlers.awaitingLeave,
|
|
401
291
|
state: {
|
|
402
|
-
resolve
|
|
403
|
-
reject
|
|
292
|
+
resolve,
|
|
293
|
+
reject
|
|
404
294
|
}
|
|
405
295
|
};
|
|
406
296
|
});
|
|
@@ -421,12 +311,8 @@ function leave() {
|
|
|
421
311
|
|
|
422
312
|
|
|
423
313
|
function shutdown(sign) {
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
return new _Promise(function (resolve, reject) {
|
|
427
|
-
enqueueAction(_this3, function (channel, state) {
|
|
428
|
-
return state.handler === handlers.channelOpen;
|
|
429
|
-
}, function (channel, state) {
|
|
314
|
+
return new Promise((resolve, reject) => {
|
|
315
|
+
enqueueAction(this, (channel, state) => state.handler === handlers.channelOpen, (channel, state) => {
|
|
430
316
|
send(channel, {
|
|
431
317
|
jsonrpc: '2.0',
|
|
432
318
|
method: 'channels.shutdown',
|
|
@@ -435,9 +321,9 @@ function shutdown(sign) {
|
|
|
435
321
|
return {
|
|
436
322
|
handler: handlers.awaitingShutdownTx,
|
|
437
323
|
state: {
|
|
438
|
-
sign
|
|
439
|
-
resolve
|
|
440
|
-
reject
|
|
324
|
+
sign,
|
|
325
|
+
resolve,
|
|
326
|
+
reject
|
|
441
327
|
}
|
|
442
328
|
};
|
|
443
329
|
});
|
|
@@ -492,33 +378,29 @@ function shutdown(sign) {
|
|
|
492
378
|
|
|
493
379
|
|
|
494
380
|
function withdraw(amount, sign) {
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
return new _Promise(function (resolve, reject) {
|
|
503
|
-
enqueueAction(_this4, function (channel, state) {
|
|
504
|
-
return state.handler === handlers.channelOpen;
|
|
505
|
-
}, function (channel, state) {
|
|
381
|
+
let {
|
|
382
|
+
onOnChainTx,
|
|
383
|
+
onOwnWithdrawLocked,
|
|
384
|
+
onWithdrawLocked
|
|
385
|
+
} = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
386
|
+
return new Promise((resolve, reject) => {
|
|
387
|
+
enqueueAction(this, (channel, state) => state.handler === handlers.channelOpen, (channel, state) => {
|
|
506
388
|
send(channel, {
|
|
507
389
|
jsonrpc: '2.0',
|
|
508
390
|
method: 'channels.withdraw',
|
|
509
391
|
params: {
|
|
510
|
-
amount
|
|
392
|
+
amount
|
|
511
393
|
}
|
|
512
394
|
});
|
|
513
395
|
return {
|
|
514
396
|
handler: handlers.awaitingWithdrawTx,
|
|
515
397
|
state: {
|
|
516
|
-
sign
|
|
517
|
-
resolve
|
|
518
|
-
reject
|
|
519
|
-
onOnChainTx
|
|
520
|
-
onOwnWithdrawLocked
|
|
521
|
-
onWithdrawLocked
|
|
398
|
+
sign,
|
|
399
|
+
resolve,
|
|
400
|
+
reject,
|
|
401
|
+
onOnChainTx,
|
|
402
|
+
onOwnWithdrawLocked,
|
|
403
|
+
onWithdrawLocked
|
|
522
404
|
}
|
|
523
405
|
};
|
|
524
406
|
});
|
|
@@ -574,33 +456,29 @@ function withdraw(amount, sign) {
|
|
|
574
456
|
|
|
575
457
|
|
|
576
458
|
function deposit(amount, sign) {
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
return new _Promise(function (resolve, reject) {
|
|
585
|
-
enqueueAction(_this5, function (channel, state) {
|
|
586
|
-
return state.handler === handlers.channelOpen;
|
|
587
|
-
}, function (channel, state) {
|
|
459
|
+
let {
|
|
460
|
+
onOnChainTx,
|
|
461
|
+
onOwnDepositLocked,
|
|
462
|
+
onDepositLocked
|
|
463
|
+
} = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
464
|
+
return new Promise((resolve, reject) => {
|
|
465
|
+
enqueueAction(this, (channel, state) => state.handler === handlers.channelOpen, (channel, state) => {
|
|
588
466
|
send(channel, {
|
|
589
467
|
jsonrpc: '2.0',
|
|
590
468
|
method: 'channels.deposit',
|
|
591
469
|
params: {
|
|
592
|
-
amount
|
|
470
|
+
amount
|
|
593
471
|
}
|
|
594
472
|
});
|
|
595
473
|
return {
|
|
596
474
|
handler: handlers.awaitingDepositTx,
|
|
597
475
|
state: {
|
|
598
|
-
sign
|
|
599
|
-
resolve
|
|
600
|
-
reject
|
|
601
|
-
onOnChainTx
|
|
602
|
-
onOwnDepositLocked
|
|
603
|
-
onDepositLocked
|
|
476
|
+
sign,
|
|
477
|
+
resolve,
|
|
478
|
+
reject,
|
|
479
|
+
onOnChainTx,
|
|
480
|
+
onOwnDepositLocked,
|
|
481
|
+
onDepositLocked
|
|
604
482
|
}
|
|
605
483
|
};
|
|
606
484
|
});
|
|
@@ -640,25 +518,23 @@ function deposit(amount, sign) {
|
|
|
640
518
|
*/
|
|
641
519
|
|
|
642
520
|
|
|
643
|
-
function createContract(
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
return new
|
|
652
|
-
enqueueAction(
|
|
653
|
-
return state.handler === handlers.channelOpen;
|
|
654
|
-
}, function (channel, state) {
|
|
521
|
+
function createContract(_ref3, sign) {
|
|
522
|
+
let {
|
|
523
|
+
code,
|
|
524
|
+
callData,
|
|
525
|
+
deposit,
|
|
526
|
+
vmVersion,
|
|
527
|
+
abiVersion
|
|
528
|
+
} = _ref3;
|
|
529
|
+
return new Promise((resolve, reject) => {
|
|
530
|
+
enqueueAction(this, (channel, state) => state.handler === handlers.channelOpen, (channel, state) => {
|
|
655
531
|
send(channel, {
|
|
656
532
|
jsonrpc: '2.0',
|
|
657
533
|
method: 'channels.update.new_contract',
|
|
658
534
|
params: {
|
|
659
|
-
code
|
|
535
|
+
code,
|
|
660
536
|
call_data: callData,
|
|
661
|
-
deposit
|
|
537
|
+
deposit,
|
|
662
538
|
vm_version: vmVersion,
|
|
663
539
|
abi_version: abiVersion
|
|
664
540
|
}
|
|
@@ -666,9 +542,9 @@ function createContract(_ref6, sign) {
|
|
|
666
542
|
return {
|
|
667
543
|
handler: handlers.awaitingNewContractTx,
|
|
668
544
|
state: {
|
|
669
|
-
sign
|
|
670
|
-
resolve
|
|
671
|
-
reject
|
|
545
|
+
sign,
|
|
546
|
+
resolve,
|
|
547
|
+
reject
|
|
672
548
|
}
|
|
673
549
|
};
|
|
674
550
|
});
|
|
@@ -712,22 +588,20 @@ function createContract(_ref6, sign) {
|
|
|
712
588
|
*/
|
|
713
589
|
|
|
714
590
|
|
|
715
|
-
function callContract(
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
return new
|
|
723
|
-
enqueueAction(
|
|
724
|
-
return state.handler === handlers.channelOpen;
|
|
725
|
-
}, function (channel, state) {
|
|
591
|
+
function callContract(_ref4, sign) {
|
|
592
|
+
let {
|
|
593
|
+
amount,
|
|
594
|
+
callData,
|
|
595
|
+
contract,
|
|
596
|
+
abiVersion
|
|
597
|
+
} = _ref4;
|
|
598
|
+
return new Promise((resolve, reject) => {
|
|
599
|
+
enqueueAction(this, (channel, state) => state.handler === handlers.channelOpen, (channel, state) => {
|
|
726
600
|
send(channel, {
|
|
727
601
|
jsonrpc: '2.0',
|
|
728
602
|
method: 'channels.update.call_contract',
|
|
729
603
|
params: {
|
|
730
|
-
amount
|
|
604
|
+
amount,
|
|
731
605
|
call_data: callData,
|
|
732
606
|
contract_id: contract,
|
|
733
607
|
abi_version: abiVersion
|
|
@@ -736,9 +610,9 @@ function callContract(_ref7, sign) {
|
|
|
736
610
|
return {
|
|
737
611
|
handler: handlers.awaitingCallContractUpdateTx,
|
|
738
612
|
state: {
|
|
739
|
-
resolve
|
|
740
|
-
reject
|
|
741
|
-
sign
|
|
613
|
+
resolve,
|
|
614
|
+
reject,
|
|
615
|
+
sign
|
|
742
616
|
}
|
|
743
617
|
};
|
|
744
618
|
});
|
|
@@ -773,45 +647,40 @@ function callContract(_ref7, sign) {
|
|
|
773
647
|
*/
|
|
774
648
|
|
|
775
649
|
|
|
776
|
-
function forceProgress(
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
return new _Promise(function (resolve, reject) {
|
|
793
|
-
enqueueAction(_this8, function (channel, state) {
|
|
794
|
-
return state.handler === handlers.channelOpen;
|
|
795
|
-
}, function (channel, state) {
|
|
650
|
+
function forceProgress(_ref5, sign) {
|
|
651
|
+
let {
|
|
652
|
+
amount,
|
|
653
|
+
callData,
|
|
654
|
+
contract,
|
|
655
|
+
abiVersion,
|
|
656
|
+
gas = 1000000,
|
|
657
|
+
gasPrice = 1000000000,
|
|
658
|
+
nonce
|
|
659
|
+
} = _ref5;
|
|
660
|
+
let {
|
|
661
|
+
onOnChainTx
|
|
662
|
+
} = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
663
|
+
return new Promise((resolve, reject) => {
|
|
664
|
+
enqueueAction(this, (channel, state) => state.handler === handlers.channelOpen, (channel, state) => {
|
|
796
665
|
send(channel, {
|
|
797
666
|
jsonrpc: '2.0',
|
|
798
667
|
method: 'channels.force_progress',
|
|
799
668
|
params: {
|
|
800
|
-
amount
|
|
669
|
+
amount,
|
|
801
670
|
call_data: callData,
|
|
802
671
|
contract_id: contract,
|
|
803
672
|
abi_version: abiVersion,
|
|
804
673
|
gas_price: gasPrice,
|
|
805
|
-
gas
|
|
674
|
+
gas
|
|
806
675
|
}
|
|
807
676
|
});
|
|
808
677
|
return {
|
|
809
678
|
handler: handlers.awaitingCallContractForceProgressUpdate,
|
|
810
679
|
state: {
|
|
811
|
-
resolve
|
|
812
|
-
reject
|
|
813
|
-
sign
|
|
814
|
-
onOnChainTx
|
|
680
|
+
resolve,
|
|
681
|
+
reject,
|
|
682
|
+
sign,
|
|
683
|
+
onOnChainTx
|
|
815
684
|
}
|
|
816
685
|
};
|
|
817
686
|
});
|
|
@@ -846,8 +715,19 @@ function forceProgress(_ref8, sign) {
|
|
|
846
715
|
*/
|
|
847
716
|
|
|
848
717
|
|
|
849
|
-
function callContractStatic(
|
|
850
|
-
|
|
718
|
+
async function callContractStatic(_ref6) {
|
|
719
|
+
let {
|
|
720
|
+
amount,
|
|
721
|
+
callData,
|
|
722
|
+
contract,
|
|
723
|
+
abiVersion
|
|
724
|
+
} = _ref6;
|
|
725
|
+
return snakeToPascalObjKeys(await call(this, 'channels.dry_run.call_contract', {
|
|
726
|
+
amount,
|
|
727
|
+
call_data: callData,
|
|
728
|
+
contract_id: contract,
|
|
729
|
+
abi_version: abiVersion
|
|
730
|
+
}));
|
|
851
731
|
}
|
|
852
732
|
/**
|
|
853
733
|
* Get contract call result
|
|
@@ -870,39 +750,17 @@ function callContractStatic(_x3) {
|
|
|
870
750
|
*/
|
|
871
751
|
|
|
872
752
|
|
|
873
|
-
function
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
return call(this, 'channels.dry_run.call_contract', {
|
|
884
|
-
amount: amount,
|
|
885
|
-
call_data: callData,
|
|
886
|
-
contract_id: contract,
|
|
887
|
-
abi_version: abiVersion
|
|
888
|
-
});
|
|
889
|
-
|
|
890
|
-
case 4:
|
|
891
|
-
_context6.t1 = _context6.sent;
|
|
892
|
-
return _context6.abrupt("return", (0, _context6.t0)(_context6.t1));
|
|
893
|
-
|
|
894
|
-
case 6:
|
|
895
|
-
case "end":
|
|
896
|
-
return _context6.stop();
|
|
897
|
-
}
|
|
898
|
-
}
|
|
899
|
-
}, _callee5, this);
|
|
753
|
+
async function getContractCall(_ref7) {
|
|
754
|
+
let {
|
|
755
|
+
caller,
|
|
756
|
+
contract,
|
|
757
|
+
round
|
|
758
|
+
} = _ref7;
|
|
759
|
+
return snakeToPascalObjKeys(await call(this, 'channels.get.contract_call', {
|
|
760
|
+
caller_id: caller,
|
|
761
|
+
contract_id: contract,
|
|
762
|
+
round
|
|
900
763
|
}));
|
|
901
|
-
return _callContractStatic.apply(this, arguments);
|
|
902
|
-
}
|
|
903
|
-
|
|
904
|
-
function getContractCall(_x4) {
|
|
905
|
-
return _getContractCall.apply(this, arguments);
|
|
906
764
|
}
|
|
907
765
|
/**
|
|
908
766
|
* Get contract latest state
|
|
@@ -917,38 +775,13 @@ function getContractCall(_x4) {
|
|
|
917
775
|
*/
|
|
918
776
|
|
|
919
777
|
|
|
920
|
-
function
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
caller = _ref11.caller, contract = _ref11.contract, round = _ref11.round;
|
|
928
|
-
_context7.t0 = snakeToPascalObjKeys;
|
|
929
|
-
_context7.next = 4;
|
|
930
|
-
return call(this, 'channels.get.contract_call', {
|
|
931
|
-
caller_id: caller,
|
|
932
|
-
contract_id: contract,
|
|
933
|
-
round: round
|
|
934
|
-
});
|
|
935
|
-
|
|
936
|
-
case 4:
|
|
937
|
-
_context7.t1 = _context7.sent;
|
|
938
|
-
return _context7.abrupt("return", (0, _context7.t0)(_context7.t1));
|
|
939
|
-
|
|
940
|
-
case 6:
|
|
941
|
-
case "end":
|
|
942
|
-
return _context7.stop();
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
|
-
}, _callee6, this);
|
|
946
|
-
}));
|
|
947
|
-
return _getContractCall.apply(this, arguments);
|
|
948
|
-
}
|
|
949
|
-
|
|
950
|
-
function getContractState(_x5) {
|
|
951
|
-
return _getContractState.apply(this, arguments);
|
|
778
|
+
async function getContractState(contract) {
|
|
779
|
+
const result = await call(this, 'channels.get.contract', {
|
|
780
|
+
pubkey: contract
|
|
781
|
+
});
|
|
782
|
+
return snakeToPascalObjKeys({ ...result,
|
|
783
|
+
contract: snakeToPascalObjKeys(result.contract)
|
|
784
|
+
});
|
|
952
785
|
}
|
|
953
786
|
/**
|
|
954
787
|
* Clean up all locally stored contract calls
|
|
@@ -962,41 +795,9 @@ function getContractState(_x5) {
|
|
|
962
795
|
*/
|
|
963
796
|
|
|
964
797
|
|
|
965
|
-
function _getContractState() {
|
|
966
|
-
_getContractState = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(contract) {
|
|
967
|
-
var result;
|
|
968
|
-
return _regeneratorRuntime.wrap(function _callee7$(_context8) {
|
|
969
|
-
while (1) {
|
|
970
|
-
switch (_context8.prev = _context8.next) {
|
|
971
|
-
case 0:
|
|
972
|
-
_context8.next = 2;
|
|
973
|
-
return call(this, 'channels.get.contract', {
|
|
974
|
-
pubkey: contract
|
|
975
|
-
});
|
|
976
|
-
|
|
977
|
-
case 2:
|
|
978
|
-
result = _context8.sent;
|
|
979
|
-
return _context8.abrupt("return", snakeToPascalObjKeys(_objectSpread(_objectSpread({}, result), {}, {
|
|
980
|
-
contract: snakeToPascalObjKeys(result.contract)
|
|
981
|
-
})));
|
|
982
|
-
|
|
983
|
-
case 4:
|
|
984
|
-
case "end":
|
|
985
|
-
return _context8.stop();
|
|
986
|
-
}
|
|
987
|
-
}
|
|
988
|
-
}, _callee7, this);
|
|
989
|
-
}));
|
|
990
|
-
return _getContractState.apply(this, arguments);
|
|
991
|
-
}
|
|
992
|
-
|
|
993
798
|
function cleanContractCalls() {
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
return new _Promise(function (resolve, reject) {
|
|
997
|
-
enqueueAction(_this9, function (channel, state) {
|
|
998
|
-
return state.handler === handlers.channelOpen;
|
|
999
|
-
}, function (channel, state) {
|
|
799
|
+
return new Promise((resolve, reject) => {
|
|
800
|
+
enqueueAction(this, (channel, state) => state.handler === handlers.channelOpen, (channel, state) => {
|
|
1000
801
|
send(channel, {
|
|
1001
802
|
jsonrpc: '2.0',
|
|
1002
803
|
method: 'channels.clean_contract_calls',
|
|
@@ -1005,8 +806,8 @@ function cleanContractCalls() {
|
|
|
1005
806
|
return {
|
|
1006
807
|
handler: handlers.awaitingCallsPruned,
|
|
1007
808
|
state: {
|
|
1008
|
-
resolve
|
|
1009
|
-
reject
|
|
809
|
+
resolve,
|
|
810
|
+
reject
|
|
1010
811
|
}
|
|
1011
812
|
};
|
|
1012
813
|
});
|
|
@@ -1031,35 +832,28 @@ function cleanContractCalls() {
|
|
|
1031
832
|
|
|
1032
833
|
|
|
1033
834
|
function sendMessage(message, recipient) {
|
|
1034
|
-
|
|
835
|
+
let info = message;
|
|
1035
836
|
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
if (_typeof(message) === 'object') {
|
|
1039
|
-
info = _JSON$stringify(message);
|
|
837
|
+
if (typeof message === 'object') {
|
|
838
|
+
info = JSON.stringify(message);
|
|
1040
839
|
}
|
|
1041
840
|
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
});
|
|
1051
|
-
};
|
|
841
|
+
const doSend = channel => send(channel, {
|
|
842
|
+
jsonrpc: '2.0',
|
|
843
|
+
method: 'channels.message',
|
|
844
|
+
params: {
|
|
845
|
+
info,
|
|
846
|
+
to: recipient
|
|
847
|
+
}
|
|
848
|
+
});
|
|
1052
849
|
|
|
1053
850
|
if (this.status() === 'connecting') {
|
|
1054
|
-
|
|
851
|
+
const onStatusChanged = status => {
|
|
1055
852
|
if (status !== 'connecting') {
|
|
1056
853
|
// For some reason we can't immediately send a message when connection is
|
|
1057
854
|
// established. Thus we wait 500ms which seems to work.
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
}, 500);
|
|
1061
|
-
|
|
1062
|
-
_this10.off('statusChanged', onStatusChanged);
|
|
855
|
+
setTimeout(() => doSend(this), 500);
|
|
856
|
+
this.off('statusChanged', onStatusChanged);
|
|
1063
857
|
}
|
|
1064
858
|
};
|
|
1065
859
|
|
|
@@ -1069,8 +863,13 @@ function sendMessage(message, recipient) {
|
|
|
1069
863
|
}
|
|
1070
864
|
}
|
|
1071
865
|
|
|
1072
|
-
function reconnect(
|
|
1073
|
-
|
|
866
|
+
async function reconnect(options, txParams) {
|
|
867
|
+
const {
|
|
868
|
+
sign
|
|
869
|
+
} = options;
|
|
870
|
+
return Channel({ ...options,
|
|
871
|
+
reconnectTx: await sign('reconnect', buildTx(txParams, TX_TYPE.channelReconnect).tx)
|
|
872
|
+
});
|
|
1074
873
|
}
|
|
1075
874
|
/**
|
|
1076
875
|
* Channel
|
|
@@ -1122,85 +921,38 @@ function reconnect(_x6, _x7) {
|
|
|
1122
921
|
*/
|
|
1123
922
|
|
|
1124
923
|
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
return _regeneratorRuntime.wrap(function _callee8$(_context9) {
|
|
1129
|
-
while (1) {
|
|
1130
|
-
switch (_context9.prev = _context9.next) {
|
|
1131
|
-
case 0:
|
|
1132
|
-
sign = options.sign;
|
|
1133
|
-
_context9.t0 = Channel;
|
|
1134
|
-
_context9.t1 = _objectSpread;
|
|
1135
|
-
_context9.t2 = _objectSpread({}, options);
|
|
1136
|
-
_context9.t3 = {};
|
|
1137
|
-
_context9.next = 7;
|
|
1138
|
-
return sign('reconnect', buildTx(txParams, TX_TYPE.channelReconnect).tx);
|
|
1139
|
-
|
|
1140
|
-
case 7:
|
|
1141
|
-
_context9.t4 = _context9.sent;
|
|
1142
|
-
_context9.t5 = {
|
|
1143
|
-
reconnectTx: _context9.t4
|
|
1144
|
-
};
|
|
1145
|
-
_context9.t6 = (0, _context9.t1)(_context9.t2, _context9.t3, _context9.t5);
|
|
1146
|
-
return _context9.abrupt("return", (0, _context9.t0)(_context9.t6));
|
|
1147
|
-
|
|
1148
|
-
case 11:
|
|
1149
|
-
case "end":
|
|
1150
|
-
return _context9.stop();
|
|
1151
|
-
}
|
|
1152
|
-
}
|
|
1153
|
-
}, _callee8);
|
|
1154
|
-
}));
|
|
1155
|
-
return _reconnect.apply(this, arguments);
|
|
1156
|
-
}
|
|
1157
|
-
|
|
1158
|
-
var Channel = AsyncInit.compose({
|
|
1159
|
-
init: function init(options) {
|
|
1160
|
-
var _this11 = this;
|
|
1161
|
-
|
|
1162
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
1163
|
-
return _regeneratorRuntime.wrap(function _callee$(_context2) {
|
|
1164
|
-
while (1) {
|
|
1165
|
-
switch (_context2.prev = _context2.next) {
|
|
1166
|
-
case 0:
|
|
1167
|
-
initialize(_this11, options);
|
|
1168
|
-
|
|
1169
|
-
case 1:
|
|
1170
|
-
case "end":
|
|
1171
|
-
return _context2.stop();
|
|
1172
|
-
}
|
|
1173
|
-
}
|
|
1174
|
-
}, _callee);
|
|
1175
|
-
}))();
|
|
924
|
+
const Channel = AsyncInit.compose({
|
|
925
|
+
async init(options) {
|
|
926
|
+
initialize(this, options);
|
|
1176
927
|
},
|
|
928
|
+
|
|
1177
929
|
methods: {
|
|
1178
|
-
on
|
|
1179
|
-
off
|
|
1180
|
-
status
|
|
1181
|
-
state
|
|
1182
|
-
round
|
|
1183
|
-
id
|
|
1184
|
-
fsmId
|
|
1185
|
-
update
|
|
1186
|
-
poi
|
|
1187
|
-
balances
|
|
1188
|
-
leave
|
|
1189
|
-
shutdown
|
|
1190
|
-
sendMessage
|
|
1191
|
-
withdraw
|
|
1192
|
-
deposit
|
|
1193
|
-
createContract
|
|
1194
|
-
callContract
|
|
1195
|
-
callContractStatic
|
|
1196
|
-
getContractCall
|
|
1197
|
-
getContractState
|
|
1198
|
-
disconnect
|
|
1199
|
-
cleanContractCalls
|
|
1200
|
-
forceProgress
|
|
930
|
+
on,
|
|
931
|
+
off,
|
|
932
|
+
status,
|
|
933
|
+
state,
|
|
934
|
+
round,
|
|
935
|
+
id,
|
|
936
|
+
fsmId,
|
|
937
|
+
update,
|
|
938
|
+
poi,
|
|
939
|
+
balances,
|
|
940
|
+
leave,
|
|
941
|
+
shutdown,
|
|
942
|
+
sendMessage,
|
|
943
|
+
withdraw,
|
|
944
|
+
deposit,
|
|
945
|
+
createContract,
|
|
946
|
+
callContract,
|
|
947
|
+
callContractStatic,
|
|
948
|
+
getContractCall,
|
|
949
|
+
getContractState,
|
|
950
|
+
disconnect,
|
|
951
|
+
cleanContractCalls,
|
|
952
|
+
forceProgress
|
|
1201
953
|
},
|
|
1202
954
|
statics: {
|
|
1203
|
-
reconnect
|
|
955
|
+
reconnect
|
|
1204
956
|
}
|
|
1205
957
|
});
|
|
1206
958
|
export default Channel;
|