This will generate a new random wallet and return the mnemonic words as well as the first 10 addresses of the wallet.
Send ETP or MST
As Metaverse is UTXO based you need to specify the inputs and outputs of the transaction. The following example creates a basic P2PKH (pay to public key hash) transaction.
For standard transaction the transaction builder is the preferred way so the next examples will use the transaction builder only.
Deposit
In order to create a deposit and get interest you just have to add a lock output to a transaction. Possible values for the duration are: 25200, 108000, 331200, 655200 and 1314000 blocks on the mainnet.
The reward transaction will be generated by the miner of the block that will contain the transaction.
Issue asset
In order to issue a new asset add an asset issue output to a transaction. Please make sure that the asset symbol is unique. Precision must be in range 0..19 and the maximum supply is must be provided as a quantity of the smallest unit. An asset with 1000 tokens that should have a precision of 2 decimals must be provided as 1000000 and precision 2. The transaction fee must be 10 ETP.
To attach a message to any transaction there is a function called addMessage. If you use the transaction builder you can use the messages parameter to add an array of messages that will be added to the transaction. For manual addition of messages you can do the following:
You can also easily decode a hex encoded transaction.
Metaverse.transaction.decode(rawtx)
Not all information about the previous outputs of the inputs are enoded in a raw transaction. If you want to encode the transaction again you have to add the missing values to the inputs.