getNetwork

Returns the network.

Type

;() => 'mainnet' | 'testnet' | 'regtest'

Return Value

Returns a string encoding the network.

Example

import { Computer } from '@bitcoin-computer/lib'
import { expect } from '../../utils/index.js'

describe('getNetwork', () => {
  it('Should return the network', async () => {
    // Create wallet with a specific network
    const computer = new Computer({ network: 'mainnet', mode: 'prod' })

    // Check network
    expect(computer.getNetwork()).eq('mainnet')
  })
})

Source