Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
snowypowers committed Aug 14, 2018
2 parents a1806fa + 8ed0ad8 commit 73bbb53
Show file tree
Hide file tree
Showing 42 changed files with 4,536 additions and 1,410 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ node_modules

/docs/_build/
build
/lib/

# Logs
*.log
Expand Down
26 changes: 26 additions & 0 deletions debug/vote.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
var Neon = require('../lib/index')

const config = {
net: 'TestNet',
// ALq7AWrhAueN6mJNqk6FHJjnsEoPRytLdW
account: new Neon.wallet.Account(
'L1QqQJnpBwbsPGAuutuzPTac8piqvbR1HRjrY5qHup48TBCBFe4g'
),
candidateKeys: [
'030ef96257401b803da5dd201233e2be828795672b775dd674d69df83f7aec1e36',
'0327da12b5c40200e9f65569476bbff2218da4f32548ff43b6387ec1416a231ee8'
]
}

Neon.api
.setupVote(config)
.then(res => {
console.log(res)
console.log(res.tx.descriptors[0])
console.log(res.tx.serialize(true))
})
.catch(err => {
console.log(err)
console.log(err.tx.descriptors[0])
console.log(err.tx.serialize(true))
})
6 changes: 6 additions & 0 deletions docs/api-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,18 @@ This set of methods rely on the NEO node having version >= 2.3.3. The method use
```js
import Neon from '@cityofzion/neon-js'
const rpxScriptHash = Neon.CONST.CONTRACTS.TEST_RPX
const nxtScriptHash = Neon.CONST.CONTRACTS.TEST_NXT
Neon.get.tokenInfo('http://seed1.neo.org:20332', rpxScriptHash)
Neon.get.tokenBalance('http://seed1.neo.org:20332', rpxScriptHash, address)

import { api } from '@cityofzion/neon-js'
api.nep5.getTokenInfo('http://seed1.neo.org:20332', rpxScriptHash)
api.nep5.getTokenBalance('http://seed1.neo.org:20332', rpxScriptHash)
api.nep5.getTokenBalances(
'http://seed1.neo.org:20332',
[rpxScriptHash, nxtScriptHash],
address
)
// This is a combination of both info and balance within a single call
api.nep5.getToken('http://seed1.neo.org:20332', rpxScriptHash, address)
```
2 changes: 1 addition & 1 deletion docs/guides-basic-privnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const config = {
```
For this example, we have a neoscan service setup serving our private net. The `name` field will be the name which we reference this in `neon-js`.

Now, we contruct the `Network` object and add it to our `networks`:
Now, we construct the `Network` object and add it to our `networks`:

```js
const privateNet = new rpc.Network(config)
Expand Down
2 changes: 1 addition & 1 deletion docs/guides-basic_invoke.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,6 @@ A high-level example of a response:

## About asset-less transactions

Currently, the fees for transactions are zero, making it possible for us to send transactions that are without any assets attached to them. This is done through attching an extra `Script` attribute. The value of this attribute is the scripthash of your address. This ties the transaction to an address so that the node knows who the signature came from.
Currently, the fees for transactions are zero, making it possible for us to send transactions that are without any assets attached to them. This is done through attaching an extra `Script` attribute. The value of this attribute is the scripthash of your address. This ties the transaction to an address so that the node knows who the signature came from.

However, you will realise that without transaction inputs, it results in the possibility of collisions for transactions hashes. This is solved by attaching a nonce in the form of a remark. In `neon-js`, the `doInvoke` method detects if there are no assets attached and inserts the nonce. This nonce is crafted using a random hexstring with the current timestamp.
2 changes: 1 addition & 1 deletion docs/guides-basic_sendasset.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: Basic - Sending assets

This is a basic tutorial to send assets using the `sendAsset` method.

`neon-js` provides out-of-the-box functionality for sending assets, claiming gas and invoking smart contracts. In this tutorial, I will be demostrating how to use the high level functions to send some native assets.
`neon-js` provides out-of-the-box functionality for sending assets, claiming gas and invoking smart contracts. In this tutorial, I will be demonstrating how to use the high level functions to send some native assets.

For clarification, when we talk about assets, we are referring to native assets such as NEO or GAS. NEP5 tokens are not considered assets as they are records within smart contracts. Thus, this is not applicable for sending those tokens.

Expand Down
26 changes: 0 additions & 26 deletions lib/browser.js

This file was deleted.

Binary file removed lib/browser.js.gz
Binary file not shown.
19 changes: 0 additions & 19 deletions lib/index.js

This file was deleted.

Binary file removed lib/index.js.gz
Binary file not shown.
Loading

0 comments on commit 73bbb53

Please sign in to comment.