connect

Setup a connection between the client and Flux Protocol smart contract.

To connect to the Flux Protocol smart contracts, which are deployed on NEAR protocol, we'll have to call the connect method.

Example

Import Flux from 'flux-sdk';
const flux = new Flux();
flux.connect("fluxprotocol-phase-point-two").then(() => {
console.log("connected to:", flux);
});

Parameters

Parameter

Type

Description

Required

contractId

string

The top-level contract id of the latest version of Flux Protocol. (Right now: "fluxprotocol-phase-point-two")

True

keyStore

KeyStore

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

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

False

accountId

string

The accountId of the account you want to use to interact with the protocol. Only should be provided for server-side applications.

False