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

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

customNodeUrl

string

If you want to connect to a specific near node or network you can pass in the node's endpoint here. (only works for `"custom"` network connections.

False

customWalletUrl

string

If you want to connect to a specific near web wallet you can pass in the wallet's endpoint here. (only works for `"custom"` network connections.

False