A simple and easy to use interface library for interacting with MyMonero or Monero light weight compatible servers.
⚠️ This project is under heavy development. Expect bugs & breaking changes.
npm i @mymonero/mymonero-wallet-manager
Initialize the WABridge class which loads and prepares the WebAssembly.
const WalletManager = await require('@mymonero/mymonero-wallet-manager')({})
const walletManager = new WalletManager('STAGENET', 'https://stagenet-api.mymonero.rtfm.net')
await walletManager.init()
Creates a new wallet.
wallet = await walletManager.createWallet('name')
console.log(wallet.serialize())
Opens existing wallet and registers it with the light wallet server.
wallet = await walletManager.importWallet('name', 'seed phrase')
console.log(wallet.serialize())
Opens existing wallet and registers it with the light wallet server.
wallet = await walletManager.importWalletKeys(name, address, privateViewKey, privateSpendKey)
console.log(wallet.serialize())
Opens existing wallet and registers it with the light wallet server.
const options = {}
wallet = await walletManager.openWallet(options))
console.log(wallet.serialize())
Creates new wallet and registers it with the light wallet server.
wallet = await walletManager.createWallet(name)
console.log(wallet.serialize())
Fetches the latest exchange rates for fiat currencies.
const exchangeRates = await walletManager.exchangeRates()
Syncs transactions and blockchain details from the light wallet server
wallet.sync()
Logs in to or registers with the light wallet server
wallet.login(address, privateViewKey)
Estimates the send fee
wallet.estimateFee()
Send funds to a single or multiple destinations
const options = {
destinations: [
{
to_address: '55zEF8bGuQVSSCeg5Bnh5G6CZoJKDLUWE7q91hxABeaJCb9VUpFrKro6np9tuHEG1uMM1st9b2xJDa7pgTBRRkvu7p3Y9U5',
send_amount: '0.1'
}
],
shouldSweep: false,
priority: 1
}
const hash = await wallet.transfer(options).catch(err => {
console.log(err.message)
})
See LICENSE.txt
for license.
All source code copyright © 2022 by MyMonero. All rights reserved.