How to use the @liskhq/lisk-transactions.utils.getTransactionId function in @liskhq/lisk-transactions

To help you get started, we’ve selected a few @liskhq/lisk-transactions examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LiskHQ / lisk-desktop / src / utils / hwManager.js View on Github external
...castVotes({ ...votesChunks[i], timeOffset }),
        senderPublicKey: account.publicKey,
        recipientId: account.address,
      };

      // eslint-disable-next-line no-await-in-loop
      const signature = await signTransaction({
        deviceId: account.hwInfo.deviceId,
        index: account.hwInfo.derivationIndex,
        tx: transactionObject,
      });

      signedTransactions.push({
        ...transactionObject,
        signature,
        id: utils.getTransactionId({ ...transactionObject, signature }),
      });
    }

    return signedTransactions;
  } catch (error) {
    throw new Error(i18next.t(
      'The transaction has been canceled on your {{model}}',
      { model: account.hwInfo.deviceModel },
    ));
  }
};
github LiskHQ / lisk-desktop / src / utils / hwManager.js View on Github external
const signSendTransaction = async (account, data) => {
  const transactionObject = {
    ...transfer(data),
    senderPublicKey: account.info.LSK.publicKey,
  };

  const transaction = {
    deviceId: account.hwInfo.deviceId,
    index: account.hwInfo.derivationIndex,
    tx: transactionObject,
  };

  try {
    const signature = await signTransaction(transaction);
    const signedTransaction = { ...transactionObject, signature };
    const result = { ...signedTransaction, id: utils.getTransactionId(signedTransaction) };
    return result;
  } catch (error) {
    throw new Error(error);
  }
};