Changing network

The default network is the Kleverchain Mainnet, but if you want to use the Kleverchain Testnet or a local version of the Kleverchain, you can change the kleverWeb provider object by setting it before calling the initialize function.

The providers should be set only once, possibly in the outermost scope of the application that need access to creating transactions, to avoid any conflicts.

Eg: Set it inside a group of Routes, Context, or in the application entry point.

import { web, IProvider } from '@klever/sdk-web';
...
  const provider:IProvider = {
      api: 'https://api.testnet.klever.finance',
      node: 'https://node.testnet.klever.finance'
  };

  web.setProvider(provider);
  
  web.initialize();
...

Last updated