diff --git a/dist/paratii.core.js b/dist/paratii.core.js index 30885df..e3e8c97 100644 --- a/dist/paratii.core.js +++ b/dist/paratii.core.js @@ -65,7 +65,7 @@ var ParatiiCore = exports.ParatiiCore = function () { (0, _createClass3.default)(ParatiiCore, [{ key: 'migrateAccount', value: function migrateAccount(newAccount) { - var oldAccount, vids, i, vid, ptiBalance; + var oldAccount, vids, i, vid, didVideoApply, ptiBalance; return _regenerator2.default.async(function migrateAccount$(_context) { while (1) { switch (_context.prev = _context.next) { @@ -81,7 +81,7 @@ var ParatiiCore = exports.ParatiiCore = function () { case 5: if ((_context.t1 = _context.t0()).done) { - _context.next = 14; + _context.next = 18; break; } @@ -92,24 +92,33 @@ var ParatiiCore = exports.ParatiiCore = function () { case 10: _context.next = 12; - return _regenerator2.default.awrap(this.paratii.eth.tcr.exit(vid.id)); + return _regenerator2.default.awrap(this.config.paratii.eth.tcr.didVideoApply(vid.id)); case 12: - _context.next = 5; - break; + didVideoApply = _context.sent; + + if (!didVideoApply) { + _context.next = 16; + break; + } - case 14: _context.next = 16; - return _regenerator2.default.awrap(this.paratii.eth.balanceOf(oldAccount, 'PTI')); + return _regenerator2.default.awrap(this.paratii.eth.tcr.exit(vid.id)); case 16: - ptiBalance = _context.sent; + _context.next = 5; + break; - console.log(ptiBalance); + case 18: _context.next = 20; - return _regenerator2.default.awrap(this.paratii.eth.transfer(newAccount, ptiBalance, 'PTI')); + return _regenerator2.default.awrap(this.paratii.eth.balanceOf(oldAccount, 'PTI')); case 20: + ptiBalance = _context.sent; + _context.next = 23; + return _regenerator2.default.awrap(this.paratii.eth.transfer(newAccount, ptiBalance, 'PTI')); + + case 23: case 'end': return _context.stop(); } diff --git a/dist/paratii.eth.tcr.js b/dist/paratii.eth.tcr.js index 45e041b..e052dee 100644 --- a/dist/paratii.eth.tcr.js +++ b/dist/paratii.eth.tcr.js @@ -241,40 +241,36 @@ var ParatiiEthTcr = exports.ParatiiEthTcr = function () { case 19: // console.log('tx: ', tx) vId = void 0; - _context5.prev = 20; - vId = (0, _utils.getInfoFromLogs)(tx, '_Application', 'videoId', 1); - _context5.next = 28; - break; - - case 24: - _context5.prev = 24; - _context5.t1 = _context5['catch'](20); - - if (!_context5.t1) { - _context5.next = 28; - break; + try { + vId = (0, _utils.getInfoFromLogs)(tx, '_Application', 'videoId', 1); + } catch (e) { + // FIXME: thsi error should be thrown + if (e) { + console.log(tx); + // throw (e) + // return false + } } - return _context5.abrupt('return', false); + // console.log('vId: ', vId) - case 28: if (!vId) { - _context5.next = 32; + _context5.next = 25; break; } return _context5.abrupt('return', true); - case 32: + case 25: return _context5.abrupt('return', false); - case 33: + case 26: case 'end': return _context5.stop(); } } - }, null, this, [[10, 16], [20, 24]]); + }, null, this, [[10, 16]]); } /** diff --git a/docs/htmldoc/ParatiiIPFS.html b/docs/htmldoc/ParatiiIPFS.html index 7753f50..f0e877c 100644 --- a/docs/htmldoc/ParatiiIPFS.html +++ b/docs/htmldoc/ParatiiIPFS.html @@ -2045,7 +2045,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:37+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/classes.list.html b/docs/htmldoc/classes.list.html index 8ca0cd6..686f66b 100644 --- a/docs/htmldoc/classes.list.html +++ b/docs/htmldoc/classes.list.html @@ -247,7 +247,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:36+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/global.html b/docs/htmldoc/global.html index 4cfb7ff..22342bc 100644 --- a/docs/htmldoc/global.html +++ b/docs/htmldoc/global.html @@ -402,7 +402,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:36+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/index.html b/docs/htmldoc/index.html index 63b4286..4bd765e 100644 --- a/docs/htmldoc/index.html +++ b/docs/htmldoc/index.html @@ -93,7 +93,7 @@
-

paratii.js

CircleCI

+

paratii.js

CircleCI

paratii.js is the main entry point and abstraction layer to interact with the Paratii platform.

More information about the Paratii Project can be found on paratii.video, or in our blueprint. Join the discussion on gitter.

How to use it

Here is a code snippet which will upload a video to Paratii and transcode it:

@@ -156,7 +156,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:36+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/paratii.core.html b/docs/htmldoc/paratii.core.html index 3fa5973..a2b2f76 100644 --- a/docs/htmldoc/paratii.core.html +++ b/docs/htmldoc/paratii.core.html @@ -392,7 +392,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:36+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/paratii.core.js.html b/docs/htmldoc/paratii.core.js.html index 83ed08d..4b4060c 100644 --- a/docs/htmldoc/paratii.core.js.html +++ b/docs/htmldoc/paratii.core.js.html @@ -118,12 +118,15 @@

Source: paratii.core.js

for (let i in vids) { let vid = vids[i] await this.vids.update(vid.id, {owner: newAccount}) - await this.paratii.eth.tcr.exit(vid.id) + let didVideoApply = await this.config.paratii.eth.tcr.didVideoApply(vid.id) + if (didVideoApply) { + // removing video from statke + await this.paratii.eth.tcr.exit(vid.id) + } } // transfer all PTI to the new account let ptiBalance = await this.paratii.eth.balanceOf(oldAccount, 'PTI') - console.log(ptiBalance) await this.paratii.eth.transfer(newAccount, ptiBalance, 'PTI') // FIXME: need to call tc.apply(vid.id) with newAccount as sender (how to do that?) } @@ -169,7 +172,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:36+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/paratii.core.users.html b/docs/htmldoc/paratii.core.users.html index eee9d5a..831abeb 100644 --- a/docs/htmldoc/paratii.core.users.html +++ b/docs/htmldoc/paratii.core.users.html @@ -824,7 +824,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:36+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/paratii.core.users.js.html b/docs/htmldoc/paratii.core.users.js.html index 96d1ce4..18ab716 100644 --- a/docs/htmldoc/paratii.core.users.js.html +++ b/docs/htmldoc/paratii.core.users.js.html @@ -209,7 +209,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:36+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/paratii.core.vids.html b/docs/htmldoc/paratii.core.vids.html index 708f9c3..2e92eab 100644 --- a/docs/htmldoc/paratii.core.vids.html +++ b/docs/htmldoc/paratii.core.vids.html @@ -2220,7 +2220,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:36+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/paratii.core.vids.js.html b/docs/htmldoc/paratii.core.vids.js.html index c2ca079..dd63268 100644 --- a/docs/htmldoc/paratii.core.vids.js.html +++ b/docs/htmldoc/paratii.core.vids.js.html @@ -353,7 +353,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:36+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/paratii.db.html b/docs/htmldoc/paratii.db.html index 17a4acf..2cefa6c 100644 --- a/docs/htmldoc/paratii.db.html +++ b/docs/htmldoc/paratii.db.html @@ -301,7 +301,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:36+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/paratii.db.js.html b/docs/htmldoc/paratii.db.js.html index 1b2f91f..c26868e 100644 --- a/docs/htmldoc/paratii.db.js.html +++ b/docs/htmldoc/paratii.db.js.html @@ -146,7 +146,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:36+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/paratii.db.users.html b/docs/htmldoc/paratii.db.users.html index 1d5d0b5..a8e680f 100644 --- a/docs/htmldoc/paratii.db.users.html +++ b/docs/htmldoc/paratii.db.users.html @@ -628,7 +628,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:36+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/paratii.db.users.js.html b/docs/htmldoc/paratii.db.users.js.html index 2bb8111..d78f09e 100644 --- a/docs/htmldoc/paratii.db.users.js.html +++ b/docs/htmldoc/paratii.db.users.js.html @@ -163,7 +163,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:36+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/paratii.db.vids.html b/docs/htmldoc/paratii.db.vids.html index a0c6f3f..f400612 100644 --- a/docs/htmldoc/paratii.db.vids.html +++ b/docs/htmldoc/paratii.db.vids.html @@ -635,7 +635,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:36+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/paratii.db.vids.js.html b/docs/htmldoc/paratii.db.vids.js.html index be593bf..8eb1e6d 100644 --- a/docs/htmldoc/paratii.db.vids.js.html +++ b/docs/htmldoc/paratii.db.vids.js.html @@ -188,7 +188,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:36+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/paratii.eth.events.html b/docs/htmldoc/paratii.eth.events.html index d4cc9dc..57dd8a0 100644 --- a/docs/htmldoc/paratii.eth.events.html +++ b/docs/htmldoc/paratii.eth.events.html @@ -1316,7 +1316,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:37+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/paratii.eth.events.js.html b/docs/htmldoc/paratii.eth.events.js.html index ab943b7..26f8c38 100644 --- a/docs/htmldoc/paratii.eth.events.js.html +++ b/docs/htmldoc/paratii.eth.events.js.html @@ -325,7 +325,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:36+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/paratii.eth.html b/docs/htmldoc/paratii.eth.html index 9acd986..f58ae17 100644 --- a/docs/htmldoc/paratii.eth.html +++ b/docs/htmldoc/paratii.eth.html @@ -2651,7 +2651,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:37+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/paratii.eth.js.html b/docs/htmldoc/paratii.eth.js.html index 821f5dc..4ef137a 100644 --- a/docs/htmldoc/paratii.eth.js.html +++ b/docs/htmldoc/paratii.eth.js.html @@ -533,7 +533,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:36+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/paratii.eth.tcr.html b/docs/htmldoc/paratii.eth.tcr.html index e64c013..3e7cfbc 100644 --- a/docs/htmldoc/paratii.eth.tcr.html +++ b/docs/htmldoc/paratii.eth.tcr.html @@ -1335,7 +1335,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:37+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/paratii.eth.tcr.js.html b/docs/htmldoc/paratii.eth.tcr.js.html index 6f32ad3..4979ed1 100644 --- a/docs/htmldoc/paratii.eth.tcr.js.html +++ b/docs/htmldoc/paratii.eth.tcr.js.html @@ -176,7 +176,9 @@

Source: paratii.eth.tcr.js

} catch (e) { // FIXME: thsi error should be thrown if (e) { - return false + console.log(tx) + // throw (e) + // return false } } @@ -291,7 +293,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:36+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/paratii.eth.users.html b/docs/htmldoc/paratii.eth.users.html index fc9a0ba..dd3f503 100644 --- a/docs/htmldoc/paratii.eth.users.html +++ b/docs/htmldoc/paratii.eth.users.html @@ -1175,7 +1175,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:37+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/paratii.eth.users.js.html b/docs/htmldoc/paratii.eth.users.js.html index d1d83ff..63b9f1d 100644 --- a/docs/htmldoc/paratii.eth.users.js.html +++ b/docs/htmldoc/paratii.eth.users.js.html @@ -223,7 +223,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:36+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/paratii.eth.vids.html b/docs/htmldoc/paratii.eth.vids.html index fa64491..133572f 100644 --- a/docs/htmldoc/paratii.eth.vids.html +++ b/docs/htmldoc/paratii.eth.vids.html @@ -2717,7 +2717,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:37+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/paratii.eth.vids.js.html b/docs/htmldoc/paratii.eth.vids.js.html index eb4b4c3..c60880f 100644 --- a/docs/htmldoc/paratii.eth.vids.js.html +++ b/docs/htmldoc/paratii.eth.vids.js.html @@ -450,7 +450,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:36+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/paratii.eth.vouchers.html b/docs/htmldoc/paratii.eth.vouchers.html index eca1b24..c12c2b2 100644 --- a/docs/htmldoc/paratii.eth.vouchers.html +++ b/docs/htmldoc/paratii.eth.vouchers.html @@ -1047,7 +1047,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:37+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/paratii.eth.vouchers.js.html b/docs/htmldoc/paratii.eth.vouchers.js.html index 5379c15..f0977ce 100644 --- a/docs/htmldoc/paratii.eth.vouchers.js.html +++ b/docs/htmldoc/paratii.eth.vouchers.js.html @@ -253,7 +253,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:36+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/paratii.eth.wallet.html b/docs/htmldoc/paratii.eth.wallet.html index fb169cc..646bd01 100644 --- a/docs/htmldoc/paratii.eth.wallet.html +++ b/docs/htmldoc/paratii.eth.wallet.html @@ -1008,7 +1008,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:37+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/paratii.eth.wallet.js.html b/docs/htmldoc/paratii.eth.wallet.js.html index 02ab2eb..d42be95 100644 --- a/docs/htmldoc/paratii.eth.wallet.js.html +++ b/docs/htmldoc/paratii.eth.wallet.js.html @@ -224,7 +224,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:36+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/paratii.html b/docs/htmldoc/paratii.html index ea404fb..d55d976 100644 --- a/docs/htmldoc/paratii.html +++ b/docs/htmldoc/paratii.html @@ -1035,7 +1035,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:36+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/paratii.ipfs.js.html b/docs/htmldoc/paratii.ipfs.js.html index 7b3277c..28990e6 100644 --- a/docs/htmldoc/paratii.ipfs.js.html +++ b/docs/htmldoc/paratii.ipfs.js.html @@ -422,7 +422,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:36+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/paratii.ipfs.uploader.html b/docs/htmldoc/paratii.ipfs.uploader.html index c86bac1..5087ec8 100644 --- a/docs/htmldoc/paratii.ipfs.uploader.html +++ b/docs/htmldoc/paratii.ipfs.uploader.html @@ -2713,7 +2713,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:37+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/paratii.ipfs.uploader.js.html b/docs/htmldoc/paratii.ipfs.uploader.js.html index 61c9a09..02118f5 100644 --- a/docs/htmldoc/paratii.ipfs.uploader.js.html +++ b/docs/htmldoc/paratii.ipfs.uploader.js.html @@ -861,7 +861,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:36+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/paratii.js.html b/docs/htmldoc/paratii.js.html index f8640a8..b907e2d 100644 --- a/docs/htmldoc/paratii.js.html +++ b/docs/htmldoc/paratii.js.html @@ -245,7 +245,7 @@ Documentation generated by JSDoc 3.5.5 - on 2018-04-06T14:20:36+02:00 + on 2018-04-06T15:09:04+02:00 using the DocStrap template. diff --git a/docs/htmldoc/quicksearch.html b/docs/htmldoc/quicksearch.html index 9feae3d..0e69d5b 100644 --- a/docs/htmldoc/quicksearch.html +++ b/docs/htmldoc/quicksearch.html @@ -7,7 +7,7 @@