Skip to content

Commit

Permalink
correct calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
lsaether committed Oct 12, 2018
1 parent 715238d commit 53bdeec
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/GasEstimation/BlockScaleFetchingService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@ export class BlockScaleFetchingService implements IGasPriceFetchingService {

const json = await response.json();

const toGwei = (val: number) => {
const gwei = 1000000000;
return val * gwei;
};

return {
average: new BigNumber(json.standard),
fast: new BigNumber(json.fast),
fastest: new BigNumber(json.fastest),
safeLow: new BigNumber(json.safeLow)
average: new BigNumber(toGwei(json.standard)),
fast: new BigNumber(toGwei(json.fast)),
fastest: new BigNumber(toGwei(json.fastest)),
safeLow: new BigNumber(toGwei(json.safeLow))
};
}
}

0 comments on commit 53bdeec

Please sign in to comment.