Nodejs script for programmatic WebDollar transactions (Experimental)
10K+
Nodejs script for programmatic WebDollar transactions (Experimental). The scripts are making HTTP requests to full nodes in order to push transactions in the WebDollar network.
Important: Full nodes have to be started with the WALLET_SECRET_URL environment variable (set to at least 30 characters). The private API is not going to be accessible otherwise.
Several scripts were developed to exemplify how to call the private API endpoints from Nodejs:
The wallet from which transactions are sent must first be imported on the full node. After the wallet is imported, funds can be sent from the wallet.
IMPORT_WALLET -> CREATE_TRANSACTION
Notice: It is recommended to wait a few seconds between API calls.
The scripts rely on WebDollar's private API endpoints.
API_URL: The url of the deployed full node (port included), example: https://wd.hoste.ro:40000WALLET_SECRET_URL: The 30 characters string set to the WALLET_SECRET_URL environment variable, example: 7f55a0ed8b021080de00960cc73768fbURL: API_URL/WALLET_SECRET_URL/wallets/import/ADDRESS/PUBLIC_KEY/PRIVATE_KEY
They can be found in the exported wallet file:
{ "version":"0.1", "address":"WEBD$gD1Km74GiVeTX3NqeY31iJ49FfdCAFCB0P$", "publicKey":"063373759855cd4ac52fae078e9f36dfdba420191beb9e3a1dbc5b7205e66292", "privateKey":"80cd858e76bd2b253b634d71bd2c8ea97314154020f63ab4baf2e4d605630529c7063373759855cd4ac52fae078e9f36dfdba420191beb9e3a1dbc5b7205e66292e8d1ce62" }
ADDRESS: The wallet's public address (might have to be encoded)PUBLIC_KEY: The wallet's public keyPRIVATE_KEY: The wallet's private keyURL: API_URL/WALLET_SECRET_URL/wallets/create-transaction/FROM_ADDRESS/TO_ADDRESS/AMOUNT/FEE
FROM_ADDRESS: The WEBD address to send the funds from (must be imported first, might have to be encoded)TO_ADDRESS: The WEBD address to send the funds to (might have to be encoded)AMOUNT: Number expressed in WEBDFEE: Number expressed in WEBDThe methods described are experimental and although they work, they are be vulnerable to attacks. No security practices have been implemented.
Content type
Image
Digest
Size
44.9 MB
Last updated
almost 6 years ago
docker pull morion4000/webdollar-transactions-script