Please help me understand https://testnodes.wavesnodes.com/api-docs/index.html I use this api and this library https://github.com/wavesplatform/waves-transactions I cannot send a transaction using the manual to the library or directly by POST request for api.
common mistakes:
Error: State check failed. Reason: Script doesn’t exist and proof
Error: State check failed. Reason: Transactions from non-scripted accounts must have exactly 1 proof
A POST request for url / addresses also gives an error. Provided API key is not correct. Here is my code:
const { transfer, broadcast } = require("@waves/waves-transactions");
const seed =
"ride flee tenant tuna share buyer work west amateur review time kick";
const signedTranserTx = transfer(
{
amount: 1,
recipient: "3NBVqYXrapgJP9atQccdBPAgJPwHDKkh6A8"
},
seed
);
const nodeUrl = "http://testnodes.wavesnodes.com";
broadcast(signedTranserTx , nodeUrl)
.then(resp => console.log(resp))
.catch(err => console.error(err));
If you use Waves transactions api, the request should be signed already and you can post it to /transactions/broadcast. Then you don't need your own node and you don't need your own API Key. in your code, I see several mistakes here:
const nodeUrl = "https://testnodes.wavesnodes.com/";Here is the code: