File tree Expand file tree Collapse file tree 4 files changed +13
-0
lines changed
Expand file tree Collapse file tree 4 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ async function refreshPortfolio() {
4242
4343 await _Portfolio2 . default . addMissingCoins ( ) ;
4444
45+ _Portfolio2 . default . removeCoin ( 'USDT' ) ;
46+
4547 console . log ( _Portfolio2 . default . getOutput ( ) ) ;
4648 } catch ( error ) {
4749 console . log ( error ) ;
Original file line number Diff line number Diff line change @@ -54,6 +54,11 @@ var Portfolio = function () {
5454 highestRank = coin . getRank ( ) > highestRank ? coin . getRank ( ) : highestRank ;
5555 }
5656 }
57+ } , {
58+ key : 'removeCoin' ,
59+ value : function removeCoin ( symbol ) {
60+ delete portfolio [ symbol ] ;
61+ }
5762 } , {
5863 key : 'addCoins' ,
5964 value : async function addCoins ( coins ) {
Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ async function refreshPortfolio() {
2323
2424 await Portfolio . addMissingCoins ( )
2525
26+ Portfolio . removeCoin ( 'USDT' )
27+
2628 console . log ( Portfolio . getOutput ( ) )
2729 } catch ( error ) {
2830 console . log ( error )
Original file line number Diff line number Diff line change @@ -26,6 +26,10 @@ export default class Portfolio {
2626 }
2727 }
2828
29+ static removeCoin ( symbol ) {
30+ delete portfolio [ symbol ]
31+ }
32+
2933 static async addCoins ( coins ) {
3034 return new Promise ( async ( resolve ) => {
3135 for ( let index in coins ) {
You can’t perform that action at this time.
0 commit comments