https://github.com/arkerlabs/waves-nodejs
A library to use Waves blockchain from node.js
https://github.com/arkerlabs/waves-nodejs
Last synced: about 2 months ago
JSON representation
A library to use Waves blockchain from node.js
- Host: GitHub
- URL: https://github.com/arkerlabs/waves-nodejs
- Owner: ArkerLabs
- Created: 2017-10-17T17:56:47.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-09-25T11:01:04.000Z (over 6 years ago)
- Last Synced: 2025-04-12T10:06:51.824Z (about 2 months ago)
- Language: JavaScript
- Size: 43.9 KB
- Stars: 9
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Waves Node JS API
=====
[](https://badge.fury.io/js/waves-nodejs)A library to use [Waves](wavesplatform.com) blockchain from node.js based on [WavesDevKit](https://github.com/wavesplatform/WavesDevKit)
## Getting started
```bash
npm install waves-nodejs --save
```## REST Methods
### Send asset transaction to a node
```javascript
var Waves = require('waves-nodejs');Waves.api.sendAsset(
'nodeUrl',
'assetId',
'seed',
'recipient address',
1, // amount
1, // fee
'feeAssetId',
'attachment'
).then(function(data) {
console.log(data);
}, function(err) {
console.error(err);
});
```## API Methods
```javascript
var Waves = require('waves-nodejs');Waves.getPublicKey(secretPhrase);
Waves.getPrivateKey(secretPhrase);
Waves.appendUint8Arrays(array1, array2);
Waves.appendNonce(originalSeed);
Waves.keccakHash(messageBytes);
Waves.blake2bHash(messageBytes);
Waves.hashChain(noncedSecretPhraseBytes);
Waves.sign(privateKey, dataToSign);
Waves.buildAccountSeedHash(seedBytes);
Waves.buildPublicKey(seedBytes);
Waves.buildPrivateKey(seedBytes);
Waves.shortToByteArray(value);
Waves.byteArrayWithSize(byteArray);
Waves.base58StringToByteArray(base58String);
Waves.longToByteArray(value);
Waves.signatureAssetData(senderPublicKey, assetId, feeAssetId, timestamp, amount, fee, recipient, attachment);
Waves.generateSeed();
```
## TODOAdd all REST API methods