How to use the @liskhq/lisk-transactions.DelegateTransaction 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-sdk / protocol-specs / utils / chain_state_builder.js View on Github external
for: delegateAddress => {
				const sender = Object.values(this.state.accounts).find(
					anAccount => anAccount.address === delegateAddress,
				);
				const registerDelegateTx = new DelegateTransaction({
					timestamp: this.timestamp,
					asset: {
						delegate: {
							username: delegateName,
						},
					},
				});

				registerDelegateTx.sign(sender.passphrase);

				// Push it to pending transaction
				this.state.pendingTransactions.push(registerDelegateTx);
				this.lastTransactionId = registerDelegateTx._id;
				return this;
			},
		};