You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

24 lines
515 B

// @flow
import type { CryptoCurrency } from '@ledgerhq/live-common/lib/types'
type ConfirmationDefaults = {
confirmationsNb: ?{
min: number,
def: number,
max: number,
},
}
export const currencySettingsDefaults = ({
blockAvgTime,
}: CryptoCurrency): ConfirmationDefaults => {
let confirmationsNb
if (blockAvgTime) {
const def = Math.ceil((30 * 60) / blockAvgTime) // 30 min approx validation
confirmationsNb = { min: 1, def, max: 2 * def }
}
return {
confirmationsNb,
}
}