Solace Protocol
  • Get Started
    • Solace Protocol
  • Integration
    • Web (Alpha Version)
      • 🙏 Setting Up
      • 💳 Connecting/Creating a Wallet
      • 🗝️ Session Key Usage
    • React Native (Alpha Version)
      • 🙏 Setting Up
      • ⛓️ Connecting using Solace Connect
      • 🔑 Session Key Usage
  • Solace Contract Connect
    • Adding Contracts
    • Adding Functions
  • Resources
    • How does Solace Work?
    • Solace Wallet Lifecycle
    • Meta Transactions
    • ERC-4337 & Sessions
Powered by GitBook
On this page
  1. Integration
  2. React Native (Alpha Version)

⛓️ 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);
Previous🙏 Setting UpNext🔑 Session Key Usage

Last updated 1 year ago