diff --git a/modules/api/dapps.js b/modules/api/dapps.js index b7882dd..4893282 100644 --- a/modules/api/dapps.js +++ b/modules/api/dapps.js @@ -42,6 +42,7 @@ Dapps.prototype.getGenesis = function (cb) { * @param opts.secret - Secret of account to withdrawal * @param opts.amount - Amount to withdrawal * @param opts.recipientId - Recipient of withdrawal + * @param opts.dappId - id of the dapp account * @param opts.transactionId - Transaction id of request to withdrawal. * @param opts.secondSecret - Second secret to withdrawal (optional). * @param opts.publicKey - Public key of account (optional). diff --git a/modules/blockchain/accounts.js b/modules/blockchain/accounts.js index eb9a475..04f1207 100644 --- a/modules/blockchain/accounts.js +++ b/modules/blockchain/accounts.js @@ -114,11 +114,14 @@ Accounts.prototype.getExecutor = function (cb) { var keypair = modules.api.crypto.keypair(process.argv[2]); modules.api.dapps.getGenesis(function (err, res) { var address = self.generateAddressByPublicKey(keypair.publicKey.toString("hex")); + var parts = process.argv[1].split('/'); // /path/to/the/dapps/dappId/index.js + var dappId = parts[parts.length-2]; private.executor = { address: address, keypair: keypair, secret: process.argv[2], - isAuthor: res.authorId == address + isAuthor: res.authorId == address, + dappId: dappId } cb(err, private.executor); }); diff --git a/modules/system/sync.js b/modules/system/sync.js index d9d82bd..fd62185 100644 --- a/modules/system/sync.js +++ b/modules/system/sync.js @@ -184,6 +184,7 @@ private.withdrawalSync = function (cb) { secret: executor.secret, amount: transaction.amount, recipientId: address, + dappId: executor.dappId, transactionId: transaction.id, multisigAccountPublicKey: executor.keypair.publicKey.toString("hex") }, cb);