Class: Network

protocol.Network

new Network(options)

Represents a network.

Parameters:
Name Type Description
options Object | NetworkType

See module:network.

Source:

Members

(static) primary :Network

Default network.

Type:
  • Network
Source:

(static) type :String

Default network type.

Type:
  • String
Source:

Methods

(static) create(options) → {Network}

Create a network. Get existing network if possible.

Parameters:
Name Type Description
options NetworkType | Object
Source:
Returns:
Type
Network

(static) ensure(type) → {Network}

Get a network with a string or a Network object.

Parameters:
Name Type Description
type NetworkType | Network

Network type.

Source:
Returns:
Type
Network

(static) fromMagic() → {Network}

Get a network by its magic number.

Source:
Returns:
Type
Network

(static) get(type) → {Network}

Get a network with a string or a Network object.

Parameters:
Name Type Description
type NetworkType | Network

Network type.

Source:
Returns:
Type
Network

(static) isNetwork(obj) → {Boolean}

Test an object to see if it is a Network.

Parameters:
Name Type Description
obj Object
Source:
Returns:
Type
Boolean

(static) set(type) → {Network}

Set the default network. This network will be used if nothing is passed as the network option for certain objects.

Parameters:
Name Type Description
type NetworkType

Network type.

Source:
Returns:
Type
Network

_init(bit) → {Object}

Get a deployment by bit index.

Parameters:
Name Type Description
bit Number
Source:
Returns:
Type
Object

byBit(bit) → {Object}

Get a deployment by bit index.

Parameters:
Name Type Description
bit Number
Source:
Returns:
Type
Object

inspect() → {String}

Inspect the network.

Source:
Returns:
Type
String

now() → {Number}

Get network adjusted time.

Source:
Returns:
Type
Number

toString() → {String}

Convert the network to a string.

Source:
Returns:
Type
String