Creates and signs BurnTransaction.
You can use this function with multiple seeds. In this case it will sign transaction accordingly and will add one proof per seed. Also you can use already signed BurnTransaction as a second argument.
const { burn } = require('waves-transactions')
const seed = 'b716885e9ba64442b4f1263c8e2d8671e98b800c60ec4dc2a27c83e5f9002b18'
const params = {
assetId: '4uK8i4ThRGbehENwa6MxyLtxAjAo1Rj9fduborGExarC',
quantity: 100,
//timestamp: Date.now(),
//fee: 100000,
//chainId: 'W',
}
const signedBurnTx = burn(params, seed)
{
"id": "548rzUHdDQwq5EfCe43Mp45QvBFwPwqMhxH25q85UWet",
"type": 6,
"version": 2,
"chainId": "W",
"fee": 100000,
"senderPublicKey": "G62H1XE5rnaCgCCURV5pWwQHzWezZB7VkkVgqthdKgkj",
"timestamp": 1542716926582,
"proofs": [
"3Z8sH3Hfmye21kvL7cc4oCUZLPqdsREsDeBHNYwavmgd4wL5iQy4SEbMW9Nnak8C6QDWtjePi2g3NuxgGTfZ8Awh"
],
"assetId": "4uK8i4ThRGbehENwa6MxyLtxAjAo1Rj9fduborGExarC",
"quantity": 100
}
Creates and signs CancelLeaseTransaction.
You can use this function with multiple seeds. In this case it will sign transaction accordingly and will add one proof per seed. Also you can use already signed CancelLeaseTransaction as a second argument.
const { cancelLease } = require('waves-transactions')
const seed = 'b716885e9ba64442b4f1263c8e2d8671e98b800c60ec4dc2a27c83e5f9002b18'
const params = {
leaseId: '2fYhSNrXpyKgbtHzh5tnpvnQYuL7JpBFMBthPSGFrqqg',
//timestamp: Date.now(),
//fee: 100000,
//chainId: 'W'
}
const signedCancelLeaseTx = cancelLease(params, seed)
{
"id": "2LBjRAviJu8B9Kjdw5D582AsLcZJu6UPsuAGCJ3QYJgw",
"type": 9,
"version": 2,
"fee": 100000,
"senderPublicKey": "G62H1XE5rnaCgCCURV5pWwQHzWezZB7VkkVgqthdKgkj",
"timestamp": 1542716926616,
"chainId": "W",
"proofs": [
"3j64VHFfM3F3gL97mxmDzhX8HHcbHS8vZEuzY96vGoRURPkgaqT1AZyUD9ToWZ4HdVCi15tS7nrAcDiA4zUamj1N"
],
"leaseId": "2fYhSNrXpyKgbtHzh5tnpvnQYuL7JpBFMBthPSGFrqqg"
}
Creates and signs DataTransaction.
You can use this function with multiple seeds. In this case it will sign transaction accordingly and will add one proof per seed. Also you can use already signed DataTransaction as a second argument.
const { data } = require('waves-transactions')
const seed = 'b716885e9ba64442b4f1263c8e2d8671e98b800c60ec4dc2a27c83e5f9002b18'
const params = {
data: [
{ key: 'integerVal', value: 1 },
{ key: 'booleanVal', value: true },
{ key: 'stringVal', value: 'hello' },
{ key: 'binaryVal', value: [1, 2, 3, 4] },
],
//timestamp: Date.now(),
//fee: 100000 + bytes.length * 100000
}
const signedDataTx = data(params, seed)
{
"id": "9ysRcXjwpHq46PUSamfWMnq2nUWoFS9rAnDgs4ynqRvU",
"type": 12,
"version": 1,
"senderPublicKey": "G62H1XE5rnaCgCCURV5pWwQHzWezZB7VkkVgqthdKgkj",
"fee": 100000,
"timestamp": 1542716926639,
"proofs": [
"MbAgcTmniTasof8SuogFComQZB4fGV9UTbbKV1rTwgakb8xiDTmk47dkCKX8Y5xXAK848rSL4jJjarMLFiyifoy"
],
"data": [
{
"type": "integer",
"key": "integerVal",
"value": 1
},
{
"type": "boolean",
"key": "booleanVal",
"value": true
},
{
"type": "string",
"key": "stringVal",
"value": "hello"
},
{
"type": "binary",
"key": "binaryVal",
"value": "base64:AQIDBA=="
}
]
}
Creates and signs IssueTransaction.
You can use this function with multiple seeds. In this case it will sign transaction accordingly and will add one proof per seed. Also you can use already signed IssueTransaction as a second argument.
const { issue } = require('waves-transactions')
const seed = 'b716885e9ba64442b4f1263c8e2d8671e98b800c60ec4dc2a27c83e5f9002b18'
const params = {
name: 'SCAM TOKEN',
description: 'Awesome token that will tokenize tokenization tokenized',
quantity: 1000000,
//reissuable: false
//decimals: 8
//timestamp: Date.now(),
//fee: 100000000,
//chainId: 'W'
}
const signedIssueTx = issue(params, seed)
{
"id": "DfUFknABSQxug8KybQGfVhctjGQduzzSyygZHK2Wz6E7",
"type": 3,
"version": 2,
"decimals": 8,
"reissuable": false,
"fee": 100000000,
"senderPublicKey": "G62H1XE5rnaCgCCURV5pWwQHzWezZB7VkkVgqthdKgkj",
"timestamp": 1542716926677,
"chainId": "W",
"proofs": [
"65QRNNAaKVp9F6Nb9AijmGtfv9pN4zTb9QCF9jYenEVUyLs9dihktfUPVH6deU7BiW9cypbVytDwkT6vJSooYPw4"
],
"name": "SCAM TOKEN",
"description": "Awesome token that will tokenize tokenization tokenized",
"quantity": 1000000
}
Creates and signs LeaseTransaction.
You can use this function with multiple seeds. In this case it will sign transaction accordingly and will add one proof per seed. Also you can use already signed LeaseTransaction as a second argument.
const { lease } = require('waves-transactions')
const seed = 'b716885e9ba64442b4f1263c8e2d8671e98b800c60ec4dc2a27c83e5f9002b18'
const params = {
amount: 100,
recipient: '3P23fi1qfVw6RVDn4CH2a5nNouEtWNQ4THs',
//timestamp: Date.now(),
//fee: 100000,
}
const signedLeaseTx = lease(params, seed)
{
"id": "DZqFQ6dRK4BDzMita1tQKa1q6PT3usPTmFwViMkdyi4Y",
"type": 8,
"version": 2,
"fee": 100000,
"senderPublicKey": "G62H1XE5rnaCgCCURV5pWwQHzWezZB7VkkVgqthdKgkj",
"timestamp": 1542716926694,
"proofs": [
"5sV8pS6ZJiRgP8miARCAiSASSm2tmoUUjwfJTYUryCkGhHHmSbyFJhEMd24RPJfCGsMSaJSVwhZkcXUL3XoMoARb"
],
"amount": 100,
"recipient": "3P23fi1qfVw6RVDn4CH2a5nNouEtWNQ4THs"
}
Creates and signs MassTransferTransaction.
You can use this function with multiple seeds. In this case it will sign transaction accordingly and will add one proof per seed. Also you can use already signed MassTransferTransaction as a second argument.
const { massTransfer } = require('waves-transactions')
const seed = 'b716885e9ba64442b4f1263c8e2d8671e98b800c60ec4dc2a27c83e5f9002b18'
const params = {
transfers: [
{
amount: 100,
recipient: '3P23fi1qfVw6RVDn4CH2a5nNouEtWNQ4THs',
},
{
amount: 200,
recipient: '3PPnqZznWJbPG2Z1Y35w8tZzskiq5AMfUXr',
},
],
//timestamp: Date.now(),
//fee: 100000 + transfers.length * 50000,
}
const signedMassTransferTx = massTransfer(params, seed)
{
"id": "35uNumuZsWNcXRSemRDzTTaeYyhQL9CVPCkNL4hJcqAU",
"type": 11,
"version": 1,
"fee": 200000,
"senderPublicKey": "G62H1XE5rnaCgCCURV5pWwQHzWezZB7VkkVgqthdKgkj",
"timestamp": 1542716926707,
"proofs": [
"5HRHX7fEh8dWcHiN8oXRGrhvZ69NdqS5LByFGoSD5TfU31mAB931fqVaKqL7jmTvZEf6aYMPLELsmUnKNVMwMr1X"
],
"transfers": [
{
"amount": 100,
"recipient": "3P23fi1qfVw6RVDn4CH2a5nNouEtWNQ4THs"
},
{
"amount": 200,
"recipient": "3PPnqZznWJbPG2Z1Y35w8tZzskiq5AMfUXr"
}
]
}
Creates and signs Order.
You can use this function with multiple seeds. In this case it will sign order accordingly and will add one proof per seed. Also you can use already signed Order as a second agrument.
const { order } = require('waves-transactions')
const seed = 'b716885e9ba64442b4f1263c8e2d8671e98b800c60ec4dc2a27c83e5f9002b18'
const params = {
amount: 100000000, //1 waves
price: 10, //for 0.00000010 BTC
priceAsset: '8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS',
matcherPublicKey: '7kPFrHDiGw1rCm7LPszuECwWYL3dMf6iMifLRDJQZMzy',
orderType: 'buy'
}
const signedOrder = order(params, seed)
{
"id": "47YGqHdHtNPjcjE69E9EX9aD9bpC8PRKr4kp5AcZKHFq",
"orderType": "buy",
"assetPair": {
"priceAsset": "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS"
},
"price": 10,
"amount": 100000000,
"timestamp": 1540898977249,
"expiration": 1542626977249,
"matcherFee": 300000,
"matcherPublicKey": "7kPFrHDiGw1rCm7LPszuECwWYL3dMf6iMifLRDJQZMzy",
"senderPublicKey": "G62H1XE5rnaCgCCURV5pWwQHzWezZB7VkkVgqthdKgkj",
"proofs": [
"4MbaDLkx9ezV1DrcGRfXRfnMBtYLaeLYBe6YGqkkuq1Pe6U9Qc5Cv7Fy1zYyGatbg47U5j374iAQFbLLZiYBChgU"
]
}
Creates and signs ReissueTransaction.
You can use this function with multiple seeds. In this case it will sign transaction accordingly and will add one proof per seed. Also you can use already signed ReissueTransaction as a second argument.
const { reissue } = require('waves-transactions')
const seed = 'b716885e9ba64442b4f1263c8e2d8671e98b800c60ec4dc2a27c83e5f9002b18'
const params = {
quantity: 10000,
assetId: '3toqCSpAHShatE75UFKxqymuWFr8nxuxD7UcLjdxVFLx',
reissuable: false,
//timestamp: Date.now(),
//fee: 100000000,
//chainId: 'W'
}
const signedReissueTx = reissue(params, seed)
{
"id": "7HR6PGb2eP1bDs1AQ3fVXrNAKU6Ay57pwUPLW2aLUBP4",
"type": 5,
"version": 2,
"chainId": "W",
"fee": 100000000,
"senderPublicKey": "G62H1XE5rnaCgCCURV5pWwQHzWezZB7VkkVgqthdKgkj",
"timestamp": 1542716926734,
"proofs": [
"8kuyzXRnMyVxoCwDZr5MspPq89YBJEnUgZ3NFSMqA2mUQP6cseXy6ncJoRDVfNw8vhuen8u5z8popPLQXbhA31U"
],
"quantity": 10000,
"assetId": "3toqCSpAHShatE75UFKxqymuWFr8nxuxD7UcLjdxVFLx",
"reissuable": false
}
Creates and signs SetScriptTransaction.
You can use this function with multiple seeds. In this case it will sign transaction accordingly and will add one proof per seed. Also you can use already signed SetScriptTransaction as a second argument.
const { setScript } = require('waves-transactions')
const seed = 'b716885e9ba64442b4f1263c8e2d8671e98b800c60ec4dc2a27c83e5f9002b18'
const params = {
script: 'AQa3b8tH', //true
//timestamp: Date.now(),
//fee: 100000,
//chainId: 'W'
}
const signedSetScriptTx = setScript(params, seed)
{
"id": "3L4sr1dDwMsevcebSMeDqqcRGzXe6emcKS8Rj5QCzBFX",
"type": 13,
"version": 1,
"fee": 1000000,
"senderPublicKey": "G62H1XE5rnaCgCCURV5pWwQHzWezZB7VkkVgqthdKgkj",
"timestamp": 1542716926767,
"chainId": "W",
"proofs": [
"43NxBX1vtjxYUA89tupNTu9pjTPhtrGqMFg9ytapFDtAGegCnhFkMcsnKHtzpTxAk34v1VmzuoLC5McSdn2KU5N5"
],
"script": "base64:AQa3b8tH"
}
Creates and signs TransferTransaction.
You can use this function with multiple seeds. In this case it will sign transaction accordingly and will add one proof per seed. Also you can use already signed TransferTransaction as a second argument.
const { transfer } = require('waves-transactions')
const seed = 'b716885e9ba64442b4f1263c8e2d8671e98b800c60ec4dc2a27c83e5f9002b18'
//Transfering 1 WAVES
const params = {
amount: 100000000,
recipient: '3P23fi1qfVw6RVDn4CH2a5nNouEtWNQ4THs',
//feeAssetId: undefined
//assetId: undefined
//attachment: undefined
//timestamp: Date.now(),
//fee: 100000,
}
const signedTransferTx = transfer(params, seed)
{
"id": "8oH5RKNJzqbAWVbqqcb9nwDoCb3osZiouLXJMzj65n6g",
"type": 4,
"version": 2,
"fee": 100000,
"senderPublicKey": "G62H1XE5rnaCgCCURV5pWwQHzWezZB7VkkVgqthdKgkj",
"timestamp": 1542716926744,
"proofs": [
"MxK7z1Lm9EYqrWwDLJ6hEtqc3dXt2XUgMrd9pBoF5zJGWDBaYboe1EcncfQZxx18WrxkT4pA4QMhBTvbFT32eB1"
],
"amount": 100000000,
"recipient": "3P23fi1qfVw6RVDn4CH2a5nNouEtWNQ4THs"
}
Generated using TypeDoc
Creates and signs AliasTransaction.
You can use this function with multiple seeds. In this case it will sign transaction accordingly and will add one proof per seed. Also you can use already signed AliasTransaction as a second argument.
Usage
const { alias } = require('waves-transactions') const seed = 'b716885e9ba64442b4f1263c8e2d8671e98b800c60ec4dc2a27c83e5f9002b18' const params = { alias: 'MyNewAlias', //timestamp: Date.now(), //fee: 100000, //chainId: 'W', } const signedAliasTx = alias(params, seed)
Output
{ "id": "DWhcVAbj6By4HRtEceuMLRp4TUXZ1rg3TvJgZPadJnK1", "type": 10, "version": 2, "fee": 100000, "senderPublicKey": "G62H1XE5rnaCgCCURV5pWwQHzWezZB7VkkVgqthdKgkj", "timestamp": 1542716926756, "proofs": [ "5hFwgio5eVWZLVzEsdmr62QtJvTJKAkEofvcnyviAAmBMDNrzX5ZuPpXgyMDrA5drMtUYbFmbUYVzWCZNuxowUMC" ], "alias": "MyNewAlias" }