From 6b88b5b4fe2efa0cb0cc072a770ce855acab5430 Mon Sep 17 00:00:00 2001 From: Vergill Lemmert <39799314+VergillR@users.noreply.github.com> Date: Wed, 3 Apr 2019 13:17:19 +0200 Subject: [PATCH] Fix createAndSign examples Added the correct call when using dpos.txs.createAndSign. --- src/pages/quick-start/CreateATransaction.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pages/quick-start/CreateATransaction.md b/src/pages/quick-start/CreateATransaction.md index b047cff..caacd5b 100644 --- a/src/pages/quick-start/CreateATransaction.md +++ b/src/pages/quick-start/CreateATransaction.md @@ -41,14 +41,14 @@ from [link href="pages/quick-start/CreateAnAccount"]Creating an Account[/link] a our secret. ```javascript -var sendTx = dpos.txs.createAndSign({ +var sendTx = dpos.txs.createAndSign( { kind: 'send', amount: 100000000, // Satoshi recipient: '12345678901234567R' }, mnemonic -}) +) ``` If we inspect our `sendTx` object, we will see a Transaction object already @@ -97,7 +97,7 @@ can do this through the `dpos-offline` API as well. We can pass in a custom fee to our `createAndSign` function through the `fee` property ```javascript -var sendTx = dpos.txs.createAndSign({ +var sendTx = dpos.txs.createAndSign( { kind: 'send', amount: 100000000, @@ -105,7 +105,7 @@ var sendTx = dpos.txs.createAndSign({ fee: 20000000 //custom fee }, mnemonic -}) +) ``` and the function will apply the fee to the end transaction object. @@ -129,7 +129,7 @@ timestamps are also known as a `nonce`. We can set the `nonce` of our transaction through the `createAndSign` function. ```javascript -var sendTx = dpos.txs.createAndSign({ +var sendTx = dpos.txs.createAndSign( { kind: 'send', amount: 100000000, @@ -137,7 +137,7 @@ var sendTx = dpos.txs.createAndSign({ nonce: 77512518 // custom timestamp }, mnemonic -}) +) ``` We can easily get the current timestamp by using the `txs.createNonce` function