How to use the lisk-elements.default.transfer function in lisk-elements

To help you get started, we’ve selected a few lisk-elements 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 / test / functional / http / post / 7.dapps.out_transfer.js View on Github external
it('without should fail', () => {
				transaction = lisk.transfer.createOutTransfer(
					randomUtil.guestbookDapp.id,
					randomUtil.transaction().id,
					accountFixtures.genesis.address,
					Date.now(),
					account.passphrase
				);
				delete transaction.asset.outTransfer.dappId;

				return sendTransactionPromise(
					transaction,
					errorCodes.PROCESSING_ERROR
				).then(res => {
					expect(res.body.message).to.be.equal(
						'Invalid transaction body - Failed to validate outTransfer schema: Missing required property: dappId'
					);
					badTransactions.push(transaction);
github LiskHQ / lisk-sdk / test / functional / http / post / 7.dapps.out_transfer.js View on Github external
it('using unknown dapp id should fail', () => {
			var unknownDappId = '1';
			transaction = lisk.transfer.createOutTransfer(
				unknownDappId,
				randomUtil.transaction().id,
				accountFixtures.genesis.address,
				1,
				account.passphrase
			);

			return sendTransactionPromise(
				transaction,
				errorCodes.PROCESSING_ERROR
			).then(res => {
				expect(res.body.message).to.be.equal(
					`Application not found: ${unknownDappId}`
				);
				badTransactions.push(transaction);
			});
github LiskHQ / lisk-sdk / test / functional / http / post / 6.dapps.in_transfer.js View on Github external
it('without should fail', () => {
				transaction = lisk.transfer.createInTransfer(
					randomUtil.guestbookDapp.id,
					Date.now(),
					accountFixtures.genesis.passphrase
				);
				delete transaction.asset.inTransfer.dappId;

				return sendTransactionPromise(
					transaction,
					errorCodes.PROCESSING_ERROR
				).then(res => {
					expect(res.body.message).to.be.equal(
						'Invalid transaction body - Failed to validate inTransfer schema: Missing required property: dappId'
					);
					badTransactions.push(transaction);
				});
			});
github LiskHQ / lisk-sdk / test / functional / http / post / 6.dapps.in_transfer.js View on Github external
it('with number should fail', () => {
				transaction = lisk.transfer.createInTransfer(
					randomUtil.guestbookDapp.id,
					Date.now(),
					accountFixtures.genesis.passphrase
				);
				transaction.asset.inTransfer.dappId = 1.2;

				return sendTransactionPromise(
					transaction,
					errorCodes.PROCESSING_ERROR
				).then(res => {
					expect(res.body.message).to.be.equal(
						"Invalid transaction body - Failed to validate inTransfer schema: Expected type string but found type number, Object didn't pass validation for format id: 1.2"
					);
					badTransactions.push(transaction);
				});
			});