Behold waves-transactions an npm package that simplifies creating and signing transactions for Waves blockchain.
This is the library WavesIDE and REPL are based on.
Enough words, just an example:
const { transfer } = require("waves-transactions")
const seed = 'mySecretSeed'
transfer(seed, {
amount: 1,
recipient: '3P6fVra21KmTfWHBdib45iYV6aFduh4WwC2',
//attachment?: 'string',
//feeAssetId?: 'ID',
//assetId: '8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS', //WBTC
//fee?: 100000,
//timestamp?: Date.now(),
})
You have your transfer signed with privateKey generated from seed.
- Fee is calculated for you.
- Timestamp fallbacks to Date.now().
- Sender public key is created from seed you provided.
Everything can be overrided on your desire, but this is simplistic example to dive you in.
Check out full docs on GitHub Pages.
Check out sources on GitHub.
Questions are welcome!
Thoughts are welcome!
Criticism is welcome!