#
constructor
The constructor of the Computer
class creates an instance. It's functionality is described in this API documentation.
#
Type
new (config: {
chain?: 'LTC' | 'BTC' | 'DOGE',
network?: 'mainnet' | 'testnet' | 'regtest',
mnemonic?: string,
path?: string,
passphrase?: string
addressType?: 'p2pkh' | 'p2wpkh' | 'p2tr',
url?: string,
satPerByte?: number,
dustRelayFee?: number,
moduleStorageType?: 'taproot' | 'multisig'
}) => Computer
#
Syntax
new Computer(config)
#
Parameters
#
config
A configuration object
#
Return Value
An instance of the Computer class
#
Examples
import { Computer } from '@bitcoin-computer/lib'
// Bitcoin Computer on LTC regtest connected to the public node https://rltc.node.bitcoincomputer.io
const computer1 = new Computer()
// Bitcoin Computer on BTC regtest
const computer2 = new Computer({
chain: 'BTC'
})
// Bitcoin Computer with custom parameters
const computer3 = new Computer({
chain: 'LTC'
network: 'mainnet',
mnemonic: 'replace this seed'
addressType: 'p2wpkh',
path: "m/44'/0'/0'/0",
url: 'https://my-ltc-node.com',
satPerByte: 1
})