hodl-wallet 1.2.8 → 1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.mjs +8 -9
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -270,7 +270,6 @@ class Wallet {
270
270
  }
271
271
 
272
272
  console.log(table.toString());
273
- console.log('');
274
273
  }
275
274
 
276
275
  async transferFunds() {
@@ -324,10 +323,10 @@ class Wallet {
324
323
  }
325
324
 
326
325
  const receipt = await this.web3.eth.sendSignedTransaction(signedTx.rawTransaction);
327
- this.displayTransactionResult(address, token, amount, receipt);
326
+ this.displayTransactionResult(address, token, amount, receipt.transactionHash);
328
327
 
329
328
  // Add transaction to history
330
- this.addToTransactions(address, token, amount, receipt);
329
+ this.addToTransactions(address, token, amount, receipt.transactionHash);
331
330
 
332
331
  if (!addressBook.some(entry => entry.address === address)) {
333
332
  await this.addToAddressBook(address);
@@ -368,13 +367,13 @@ class Wallet {
368
367
  }).replace(/(\d{2})\/(\d{2})\/(\d{4})/, '$3-$2-$1').replace(",", "");
369
368
  }
370
369
 
371
- addToTransactions(recipient, token, amount, receipt) {
370
+ addToTransactions(recipient, token, amount, hash) {
372
371
  const transaction = {
373
372
  timestamp: new Date().toISOString(),
374
373
  recipient,
375
374
  token,
376
375
  amount,
377
- hash: receipt.transactionHash
376
+ hash
378
377
  };
379
378
  this.db.add('transactions', this.account.address, this.selectedNetwork.nativeToken, transaction);
380
379
  }
@@ -418,7 +417,7 @@ class Wallet {
418
417
  });
419
418
 
420
419
  table.push([name, address]);
421
- console.log('\n' + table.toString());
420
+ console.log(table.toString());
422
421
  }
423
422
  }
424
423
 
@@ -517,11 +516,11 @@ class Wallet {
517
516
  date,
518
517
  address,
519
518
  token,
520
- amount.toFixed(3)
519
+ parseFloat(amount).toFixed(3)
521
520
  ]);
522
521
  table.push([{ colSpan: 4, content: this.selectedNetwork.explorer + hash }]);
523
522
 
524
- console.log('\n' + table.toString());
523
+ console.log(table.toString());
525
524
  }
526
525
 
527
526
  clearAccountData() {
@@ -552,7 +551,7 @@ class Wallet {
552
551
  table.push(['WARNING', "Please keep your private-key secure. Never share it."]);
553
552
  }
554
553
 
555
- console.log('\n' + table.toString());
554
+ console.log(table.toString());
556
555
  }
557
556
 
558
557
  async switchNetwork() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hodl-wallet",
3
- "version": "1.2.8",
3
+ "version": "1.3.4",
4
4
  "description": "🧊 HODL Wallet - Fast CLI crypto wallet!",
5
5
  "author": "Martin Clasen",
6
6
  "repository": {