import { createUnitConverters , NetworkType } from '@bitaccess/coinlib-common' ; import { bitcoinish } from '@bitaccess/coinlib-bitcoin' ; import * as bitcoin from 'bitcoinjs-lib-bigint' ; import { DECIMAL_PLACES , NETWORKS } from './constants' ; const { getMultisigPaymentScript , getSinglesigPaymentScript , publicKeyToAddress , publicKeyToKeyPair , publicKeyToString , publicKeyToBuffer , privateKeyToKeyPair , privateKeyToAddress , } = bitcoinish ; export { getMultisigPaymentScript , getSinglesigPaymentScript , publicKeyToAddress , publicKeyToKeyPair , publicKeyToString , publicKeyToBuffer , privateKeyToKeyPair , privateKeyToAddress , } ; const { toMainDenominationBigNumber , toMainDenominationString , toMainDenominationNumber , toBaseDenominationBigNumber , toBaseDenominationString , toBaseDenominationNumber , } = createUnitConverters ( DECIMAL_PLACES ) ; export { toMainDenominationBigNumber , toMainDenominationString , toMainDenominationNumber , toBaseDenominationBigNumber , toBaseDenominationString , toBaseDenominationNumber , } ; export function isValidAddress ( address , networkType ) { return bitcoinish . isValidAddress ( address , NETWORKS [ networkType ] ) ; } export function standardizeAddress ( address , networkType ) { return bitcoinish . standardizeAddress ( address , NETWORKS [ networkType ] ) ; } export function isValidPublicKey ( publicKey , networkType ) { return bitcoinish . isValidPublicKey ( publicKey , NETWORKS [ networkType ] ) ; } export function isValidExtraId ( extraId ) { return false ; } export function isValidPrivateKey ( privateKey , networkType ) { return bitcoinish . isValidPrivateKey ( privateKey , NETWORKS [ networkType ] ) ; } export function estimateDogeTxSize ( inputCounts , outputCounts , networkType ) { return bitcoinish . estimateTxSize ( inputCounts , outputCounts , ( address ) => bitcoin . address . toOutputScript ( address , NETWORKS [ networkType ] ) ) ; }