import { RenNetwork } from "@renproject/utils" ; import { Blockchair } from "./APIs/blockchair" ; import { Blockstream } from "./APIs/blockstream" ; import { SoChain } from "./APIs/sochain" ; import { BitcoinBaseChain } from "./base" ; import { BitcoinNetworkConfig , BitcoinNetworkConfigMap , BitcoinNetworkInput , } from "./utils/types" ; import { resolveBitcoinNetworkConfig , StandardBitcoinExplorer , } from "./utils/utils" ; const BitcoinMainnet = { label : "Bitcoin" , selector : "Bitcoin" , nativeAsset : { name : "Bitcoin" , symbol : "BTC" , decimals : 8 , } , averageConfirmationTime : 60 * 10 , explorer : StandardBitcoinExplorer ( "https://live.blockcypher.com/btc/" ) , p2shPrefix : Buffer . from ( [ 0x05 ] ) , providers : [ new Blockstream ( ) , new Blockchair ( ) , { api : new SoChain ( ) , priority : 15 } , ] , } ; const BitcoinTestnet = { label : "Bitcoin Testnet" , selector : "Bitcoin" , nativeAsset : { name : "Testnet Bitcoin" , symbol : "BTC" , decimals : 8 , } , averageConfirmationTime : 60 * 10 , isTestnet : true , explorer : StandardBitcoinExplorer ( "https://live.blockcypher.com/btc-testnet/" ) , p2shPrefix : Buffer . from ( [ 0xc4 ] ) , providers : [ new Blockstream ( { testnet : true } ) , ] , } ; /**
 * The Bitcoin class adds support for the asset BTC.
 */ export class Bitcoin extends BitcoinBaseChain { public static chain = "Bitcoin" ; public static configMap : BitcoinNetworkConfigMap = { [ RenNetwork . Mainnet ] : BitcoinMainnet , [ RenNetwork . Testnet ] : BitcoinTestnet , [ RenNetwork . Devnet ] : BitcoinTestnet , } ; public configMap = Bitcoin . configMap ; public static assets = { BTC : "BTC" , } ; public assets = Bitcoin . assets ; public constructor ( { network } ) { super ( { network : resolveBitcoinNetworkConfig ( Bitcoin . configMap , network ) , } ) ; } }