Nodejs 12+
NPM 6+
npm install MadBase/MadNetWallet-JS
Supports SECP256k1 and BN curve types.
SECP256k1 (curve = 1)
BN (curve = 2)
const MadWallet = require("madwalletjs");
const madWallet = new MadWallet(${CHAIN_ID}, ${MADNET_RPC})
await madWallet.Account.addAccount(${PRIVATE_KEY}, ${CURVE})
await madWallet.Account.addAccount(privateKey, 1);
await madWallet.Transaction.createValueStore(0x${FROM}, ${VALUE}, 0x${TO}, ${TO_CURVE})
await madWallet.Transaction.createValueStore(0x4240A00833065c29D1EB117e200a87c95D640289, 10, 0x219D27f4DBf2831f45Dd55436dE084571Ae2cE15, 2)
--
await madWallet.Transaction.createValueStore(madWallet.Account.accounts[0]["address"], 1, madWallet.Account.accounts[0]["address"], 1)
await madWallet.Transaction.createDataStore(0x${FROM}, ${INDEX}, ${DURATION}, ${RAW_DATA}, !(optional){ISSUED_AT_EPOCH})
await madWallet.Transaction.createDataStore(0x4240A00833065c29D1EB117e200a87c95D640289, "0xA", 20, "0xC0FFEE")
--
await madWallet.Transaction.createDataStore(madWallet.Account.accounts[0]["address"], "0xA", 1, "0xC0FFEE", 1)
await madWallet.sendTransaction(!(optional){CHANGE_ADDRESS}, !(optional){CHANGE_ADDRESS_CURVE}, !(optional)[{UTXOIDs}])
await madWallet.Transaction.sendTx()
--
await madWallet.Transaction.sendTx(0x4240A00833065c29D1EB117e200a87c95D640289, 2)
--
await madWallet.Transaction.sendTx(0x4240A00833065c29D1EB117e200a87c95D640289, 2, [0197314d4f3e46eb7dd8cd7bcd2daf5305a4c8f9089ae6e9a1552350dfce56ac])
- Account
- Transaction
- RPC
Details on these modules can be found in the generated docs
- Create the docs
npm run build-docs
- Open index with a browser
firefox docs/index.html
Create .env in tests/ to specify account, chainId, and RPC
Some tests will be skipped if .env variables are not present
- Run tests
npm test