How to use the @liskhq/lisk-client.transaction function in @liskhq/lisk-client

To help you get started, we’ve selected a few @liskhq/lisk-client 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 / rawTransactionWrapper.js View on Github external
export const createRawVoteTX = (senderPublicKey, recipientId, votedList, unvotedList) => {
  const transaction = {
    type: transactionTypes.vote,
    amount: '0',
    fee: Lisk.transaction.constants.VOTE_FEE.toString(),
    senderPublicKey,
    recipientId,
    timestamp: Lisk.transaction.utils.getTimeFromBlockchainEpoch() - 100,
    asset: { votes: concatVoteLists(votedList, unvotedList) },
  };
  return transaction;
};
// eslint-disable-next-line max-len
github LiskHQ / lisk-desktop / src / utils / rawTransactionWrapper.js View on Github external
export const createRawVoteTX = (senderPublicKey, recipientId, votedList, unvotedList) => {
  const transaction = {
    type: transactionTypes.vote,
    amount: '0',
    fee: Lisk.transaction.constants.VOTE_FEE.toString(),
    senderPublicKey,
    recipientId,
    timestamp: Lisk.transaction.utils.getTimeFromBlockchainEpoch() - 100,
    asset: { votes: concatVoteLists(votedList, unvotedList) },
  };
  return transaction;
};
// eslint-disable-next-line max-len
github LiskHQ / lisk-desktop / src / utils / api / delegates.js View on Github external
return new Promise((resolve, reject) => {
    const transaction = Lisk.transaction.registerDelegate({ ...data });
    liskAPIClient.transactions
      .broadcast(transaction)
      .then(() => {
        resolve(transaction);
      })
      .catch(reject);
  });
};
github LiskHQ / lisk-desktop / src / utils / hacks.js View on Github external
export const getTimeOffset = state => (
  state.blocks && state.blocks.latestBlocks[0] && state.blocks.latestBlocks[0].timestamp
    ? state.blocks.latestBlocks[0].timestamp - Lisk.transaction.utils.getTimeFromBlockchainEpoch()
    : 0
);
github LiskHQ / lisk-desktop / src / utils / api / delegates.js View on Github external
  .map(({ votes, unvotes }) => (Lisk.transaction.castVotes(
    {
      votes,
      unvotes,
      passphrase,
      secondPassphrase,
      timeOffset,
    },
  ))))
);
github LiskHQ / lisk-desktop / src / utils / api / lsk / transactions.js View on Github external
export const create = (transaction, transactionType) => new Promise((resolve, reject) => {
  try {
    const tx = Lisk.transaction[transactionType](transaction);
    resolve(tx);
  } catch (error) {
    reject(error);
  }
});
github LiskHQ / lisk-desktop / app / src / utils.js View on Github external
export const getTransactionBytes = transaction => Lisk.transaction.utils.getTransactionBytes(transaction);
github LiskHQ / lisk-desktop / src / utils / api / lsk / transactions.js View on Github external
new Promise((resolve, reject) => {
    const txId = Lisk.transaction.transfer({
      amount,
      data,
      passphrase,
      recipientId,
      secondPassphrase,
      timeOffset,
    });

    getAPIClient(networkConfig).transactions.broadcast(txId)
      .then(resolve(txId))
      .catch(reject);
  });
github LiskHQ / lisk-desktop / src / utils / rawTransactionWrapper.js View on Github external
export const calculateTxId = transaction => Lisk.transaction.utils.getTransactionId(transaction);