SIWW
  • Sign-in with Wallet (SIWW)
  • Specifications
    • Abstract
    • Motivation
    • Open source libraries
    • Security considerations
  • Use Cases
    • NodeJS - Backend implementation
      • 1. Setup passport-wallet
      • 2. Connect to SIWW
      • 3. Manage your authentication token
      • 4. Add authentication routes
      • 5. Code the views
      • 6. Full sample app
      • 7. Debugging and Q&A
    • ReactJS - connect to backend
      • 1. Add a login route
      • 2. Redirect the route to your backend
    • JS - Native calls to SIWW libs
      • 1. Initialize SIWW client lib
      • 2. Connect to a Wallet
      • 3. Create a message
      • 4. Send a message
      • 5. React JS App
    • Authenticating as an end-user
      • 1. Have a wallet available
      • 2. Connecting and signing
Powered by GitBook
On this page
  1. Use Cases
  2. JS - Native calls to SIWW libs

2. Connect to a Wallet

Good to know: wallet connection is per target application domain. If a wallet was connected to a domain in the past, unless the user removes this setting from the configuration of the wallet, it will always be connected at startup of a new browsing session for this same domain.

// request the user to accept / refuse a connection with a specific wallet
let objConnect = await this.siwc.async_connectWallet(_id);

Remember that the async_connectWallet function above will return after some time (the time for the user to reply in the wallet). You have the choice to "await" this function call, or to let it go and get called back on the onNotifyConnectedWallet callback (see initialization params)

The _id parameter used as input of async_connectWallet is the ID of the wallet, as disclosed by the wallet itself. You get the list of all possible IDs at startup thanks to the onNotifyAccessibleWallets which returns the list of all available wallet IDs.

Previous1. Initialize SIWW client libNext3. Create a message

Last updated 2 years ago