Selecting Environments and Networks

How to select an environment

By default, you will connect to our production environment

// use production environment
const venlyConnect = new VenlyConnect('CLIENT_ID');

To connect to the sandbox environment you add the parameter environment

// use staging environment
const venlyConnect = new VenlyConnect('CLIENT_ID', { environment: 'sandbox'});

How to select a network

By default, you will connect to the blockchain network as described above. Mainnet when connecting to our production environment and a certain testnet when connecting to staging.

//Using the default Kovan Ethereum testnet
{
  "walletId" : "cdc4c08a-b8fa-4e4c-z5a2-92c87b80f174",
  "to" : "0xdc71b72db51e227e65a45004ab2798d31e8934c9",
  "secretType" : "ETHEREUM",
  "data" : "0x",
  "value" : 1.15
}

By making use of the network object, you can change the node endpoint. In the example below we are connecting to the Rinkeby Ethereum testnet, instead of the default Kovan testnet.

//Using a custom node to connect to the Rinkeby Ethereum testnet
{
  "walletId" : "cdc4c08a-b8fa-4e4c-z5a2-92c87b80f174",
  "to" : "0xdc71b72db51e227e65a45004ab2798d31e8934c9",
  "secretType" : "VECHAIN",
  "data" : "0x",
  "value" : 1.15
}