constructor

The Flux constructors allows for the possibility of some customisation.

Example

Import Flux from 'flux-sdk';
const fluxTestnet = new Flux();
const fluxLocalnet = new Flux(
"custom",
"http://localhost:{INDEX_NODE_PORT}"
);

Parameters

Parameter

Type

Description

Required

network

string

The name of the network you want to connect to. Defaults to "testnet".

"mainnet" | "testnet" | "custom"

False

indexNodeUrl

string

The Flux index node endpoint that will be used to fetch data. For now defaults to:"http://localhost:3000"

But in the future this will default to our public index node.

False

keyStore

KeyStore

Custom KeyStore object, this is where signIn credentials are stored. Defaults to browser's local storage, which works only for every web application.

This parameter should only be required for custom solutions that don't have access to thewindow object.

False