import BN from 'bn.js' ; import RadixNodeConnection from '../universe/RadixNodeConnection' ; import RadixPOWTask from '../pow/RadixPOWTask' ; import { RadixAtom } from '../atommodel' ; import { powTargetFromAtomSize , RadixPOW } from '../..' ; export default class RadixFeeProvider { param { number } universeMagicNumber param { RadixAtom } atom returns public static async generatePOWFee ( universeMagicNumber , atom ) { const target = Buffer . from ( '0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF' , 'hex' ) ; const seed = atom . getHash ( ) ; const powTask = new RadixPOWTask ( universeMagicNumber , seed , target ) ; const pow = await powTask . computePow ( ) ; return pow ; } }