-
Notifications
You must be signed in to change notification settings - Fork 0
/
testWaves.js
28 lines (23 loc) · 969 Bytes
/
testWaves.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const { issue, broadcast } = require('@waves/waves-transactions')
const { Signer } = require('@waves/signer')
const { ProviderKeeper } = require('@waves/provider-keeper')
function createToken() {
const nodeUrl = 'https://nodes-testnet.wavesnodes.com' // Testnet node
const seed = process.env.SEED_PHRASE
// Issue transaction: specify token params
const myToken = {
name: 'Spring 200',
description:
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
quantity: 100000, // Real amount (1000) multiplied by 10^decimals (100); set 1 for NFT
reissuable: true, // Set false for NFT
decimals: 2, // Set 0 for NFT
chainId: 'T', // Testnet; set 'W' for Mainnet
}
const issueTx = issue(myToken, seed) // Create and sign Issue transaction
broadcast(issueTx, nodeUrl)
.then((resp) => console.log(resp))
.catch((e) => {
console.log(e)
})
}