Network

Network

The Network class provides helper methods to get the passphrase or id for different stellar networks. It also provides the Network.current class method that returns the network that will be used by this process for the purposes of generating signatures.

You should select network your app will use before adding the first signature. You can use the use, usePublicNetwork and useTestNetwork helper methods.

Creates a new Network object.

Constructor

new Network(networkPassphrase)

Deprecated:
  • Yes
Source:
Parameters:
Name Type Description
networkPassphrase string

Network passphrase

Methods

(static) current() → {Network}

Source:
Returns:
Type:
Network

Currently selected network

(static) use(network) → {void}

Use network defined by Network object.

Source:
Parameters:
Name Type Description
network Network

Network to use

Returns:
Type:
void

(static) usePublicNetwork() → {void}

Use Stellar Public Network

Source:
Returns:
Type:
void

(static) useTestNetwork() → {void}

Use test network.

Source:
Returns:
Type:
void

networkId() → {string}

Source:
Returns:
Type:
string

Network ID (SHA-256 hash of network passphrase)

networkPassphrase() → {string}

Source:
Returns:
Type:
string

Network passphrase