Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix createAndSign examples #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/pages/quick-start/CreateATransaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -97,15 +97,15 @@ 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,
recipient: '12345678901234567R',
fee: 20000000 //custom fee
},
mnemonic
})
)
```

and the function will apply the fee to the end transaction object.
Expand All @@ -129,15 +129,15 @@ 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,
recipient: '12345678901234567R',
nonce: 77512518 // custom timestamp
},
mnemonic
})
)
```

We can easily get the current timestamp by using the `txs.createNonce` function
Expand Down