1 | # neon-js
|
2 |
|
3 | Constructed package using:
|
4 |
|
5 | - `neon-core`
|
6 | - `neon-api`
|
7 | - `neon-nep5`
|
8 |
|
9 | In addition, this package exposes a high level semantic API binding for beginner usage. The semantic API can be found in the default export of the package.
|
10 |
|
11 | ```js
|
12 | const Neon = require("cityofzion/neon-js");
|
13 |
|
14 | console.log(Neon); // {wallet, tx, api, nep5, etc...}
|
15 |
|
16 | const NeonJs = neon.default;
|
17 |
|
18 | console.log(NeonJs); // {create, get, sign, verify,...}
|
19 | ```
|
20 |
|
21 | The semantic API follows a convention of Verb-Noun. Any extra words beyond the first 2 is collapsed into the Noun and camelcased.
|
22 |
|
23 | ```js
|
24 | NeonJs.create.stringStream("1234");
|
25 | NeonJs.encrypt.privateKey("key");
|
26 | ```
|
27 |
|
28 | The exceptions to this rule are the managed methods provided by `api`:
|
29 |
|
30 | ```js
|
31 | NeonJs.sendAsset
|
32 | NeonJs.claimGas
|
33 | NeonJs.doInvoke
|
34 | NeonJs.setupVote
|
35 | ```
|