How to use the lisk-sdk.BigNum function in lisk-sdk

To help you get started, we’ve selected a few lisk-sdk 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-examples / cashback / cashback_transaction.js View on Github external
undoAsset(store) {
		const errors = super.undoAsset(store);

		const sender = store.account.get(this.senderId);
		const updatedSenderBalanceAfterBonus = new BigNum(sender.balance).sub(
			new BigNum(this.amount).div(10)
		);
		const updatedSender = {
			...sender,
			balance: updatedSenderBalanceAfterBonus.toString(),
		};
		store.account.set(sender.address, updatedSender);

		return errors;
	}
}
github LiskHQ / lisk-sdk-examples / cashback / cashback_transaction.js View on Github external
applyAsset(store) {
		const errors = super.applyAsset(store);

		const sender = store.account.get(this.senderId);
		const updatedSenderBalanceAfterBonus = new BigNum(sender.balance).add(
			new BigNum(this.amount).div(10)
		);
		const updatedSender = {
			...sender,
			balance: updatedSenderBalanceAfterBonus.toString(),
		};
		store.account.set(sender.address, updatedSender);

		return errors;
	}
github LiskHQ / lisk-sdk-examples / cashback / cashback_transaction.js View on Github external
undoAsset(store) {
		const errors = super.undoAsset(store);

		const sender = store.account.get(this.senderId);
		const updatedSenderBalanceAfterBonus = new BigNum(sender.balance).sub(
			new BigNum(this.amount).div(10)
		);
		const updatedSender = {
			...sender,
			balance: updatedSenderBalanceAfterBonus.toString(),
		};
		store.account.set(sender.address, updatedSender);

		return errors;
	}
}
github LiskHQ / lisk-sdk-examples / cashback / cashback_transaction.js View on Github external
applyAsset(store) {
		const errors = super.applyAsset(store);

		const sender = store.account.get(this.senderId);
		const updatedSenderBalanceAfterBonus = new BigNum(sender.balance).add(
			new BigNum(this.amount).div(10)
		);
		const updatedSender = {
			...sender,
			balance: updatedSenderBalanceAfterBonus.toString(),
		};
		store.account.set(sender.address, updatedSender);

		return errors;
	}