⛓️ Connecting using Solace Connect

Initialize SolaceConnect

You can initialize the SolaceConnect by providing the project id, JSON-RPC provider and optionally a mode. The mode could be 'local' or not provided.

const solaceConnect = new SolaceConnect(projectId, provider, mode);

Connect to Solace Wallet

Establish a connection with the Solace Wallet using the connect method:

solaceConnect.connect().then((solaceAddress) => {
  console.log("Connected to Solace Wallet: " + solaceAddress);
}).catch((err) => {
  console.error("Failed to connect: ", err);
});

Check Connection

You can check if the SDK is connected to the Solace Wallet with the isConnected method:

const isConnected = solaceConnect.isConnected();
console.log("Is connected: " + isConnected);

Last updated