Skip to content

Commit

Permalink
pequenas correções após revisão
Browse files Browse the repository at this point in the history
  • Loading branch information
antonioconselheiro committed Dec 5, 2023
1 parent dcf73b1 commit 1b3f797
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/btc2poke/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ class main {
}

async checkGold(nostrBoot: NostrBoot): Promise<void> {
console.info('bitcoin price checking in gold...');
console.info('bitcoin price checking in GOLD...');
const bitcoinPrice = await this.bitcoinPriceService.getBitcoinPrice('XAUT');
console.info('bitcoin price: ', bitcoinPrice);
const pokemon = this.bitcoinToPokemonService.convertFromGold(bitcoinPrice);
const status = this.publishMemoryService.getStatus(pokemon.id, 'gold');
let message = '';

if (status === PostContentStatus.NOT_PUBLISHED_RECENTLY) {
message = this.generateDolarMessage(pokemon, bitcoinPrice);
message = this.generateGoldMessage(pokemon, bitcoinPrice);
} else if (status === PostContentStatus.RECENT_POST) {
message = this.generateDolarMessage(pokemon, bitcoinPrice, true);
message = this.generateGoldMessage(pokemon, bitcoinPrice, true);
} else if (status === PostContentStatus.LAST_POST) {
console.info('already posted this, ignoring...', pokemon);
}
Expand All @@ -63,7 +63,7 @@ class main {
}

async checkDolar(nostrBoot: NostrBoot): Promise<void> {
console.info('bitcoin price checking in usd...');
console.info('bitcoin price checking in DOLAR...');
const bitcoinPrice = await this.bitcoinPriceService.getBitcoinPrice('USD');
console.info('bitcoin price: ', bitcoinPrice);
const pokemon = this.bitcoinToPokemonService.convertFromDolar(bitcoinPrice);
Expand Down
1 change: 1 addition & 0 deletions packages/btc2poke/src/publish-memory.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export class PublishMemoryService {
dolar: [],
gold: []
};

private constructor() {
this.loadFile();
}
Expand Down

0 comments on commit 1b3f797

Please sign in to comment.