fix: 🐛 Remove references to 'this'

main
Keith Irwin 2024-04-20 18:54:38 -06:00
parent 3e2fcb806c
commit e8c91e260c
Signed by: ki9
GPG Key ID: DF773B3F4A88DA86
2 changed files with 11 additions and 18 deletions

27
main.js
View File

@ -5,33 +5,26 @@ module.exports = class Wallet {
address; viewKey; restoreHeight;
constructor (settings) {
this.url = `${settings.url}/json_rpc`
this.wallet = settings.filename
this.password = settings.password
this.address = settings.address
this.viewKey = settings.viewKey
this.spendKey = settings.spendKey
this.restoreHeight = settings.restoreHeight
// Open wallet
try {
this.rpc('open_wallet', {
filename: this.wallet,
password: this.password,
filename: settings.wallet,
password: settings.password,
})
console.log(`Opened wallet "${this.wallet}".`)
console.log(`Opened wallet "${settings.wallet}".`)
} catch (openErr) {
console.log(`Failed to open wallet "${this.wallet}".`)
console.log(`Failed to open wallet "${settings.wallet}".`)
// create wallet
try {
this.rpc('generate_from_keys', {
restore_height: this.restoreHeight,
filename: this.wallet,
address: this.address,
spendKey: this.spendKey,
viewKey: this.viewKey,
password: this.password
restore_height: settings.restoreHeight,
filename: settings.wallet,
address: settings.address,
spendKey: settings.spendKey,
viewKey: settings.viewKey,
password: settings.password
})
console.log(`Created wallet "${this.wallet}".`)
} catch (createErr) {

View File

@ -1,7 +1,7 @@
{
"name": "monero-wallet-rpc-js",
"type": "commonjs",
"version": "1.1.6",
"version": "1.1.7",
"description": "Javascript wrapper for monero-wallet-rpc calls",
"main": "main.js",
"scripts": {