square-codeReact-Modal

Wallet Connection React-Modal

t:connect provides a built-in Wallet Connection React-Modal, developed in React, that simplifies the process of connecting users via supported wallets to Tezos and Etherlink. Leveraging React Provider and Hook technology, this ready-to-use modal component facilitates state management and enables seamless integration into the component tree. Developers can easily embed it into their Telegram Mini App, allowing users to securely and effortlessly connect their wallets.

Features of the Wallet Connection React-Modal

  • User-Friendly Interface: An intuitive UI that guides users through the wallet connection process.

  • Multi-Chain Support: Supports both Tezos and Etherlink, offering flexibility for various applications.

  • Multiple Wallet Options: Compatible with a range of wallets like Altme, MetaMask, Trust Wallet, and more.

  • Secure Authentication: Ensures that user credentials and private keys remain secure during the connection.

The TConnectModalProvider

The TConnectModalProvider has eight properties:

// API-key to get access to our service
apiKey: string; 
circle-info

Wondering how to obatin an api key? see: Getting Started

// The URL used to establish a connection
bridgeUrl: string;
circle-info

Note that the bridgeUrlparameter must always be set to "https://tconnect.io", as this is the hosted location of the bridge.

// Name of your application
appName: string;

The TConnectModal Hook

How to use the Wallet Connection React-Modal

1
2

Setup the React-Modal Provider

We recommend first providing the TConnectModalProvider.

3

Display the Wallet Connection React-Modal

Now, within the provider, in this example in MyComponent component, the openModal method can be called to display the modal for wallet selection.

React-Modal Workflow

1

Blockchain Selection

The modal first provides the option to choose the blockchain to be used. The user can select between Tezos and Etherlink.

2

Wallet Selection

After selecting the Blockchain, the user is prompted to choose a wallet. The list of available wallets is automatically filtered based on the previously chosen blockchain.

3

Wallet Connection Execution

Once a wallet is selected, the user is redirected to the wallet and prompted to authorize the connection.

4

Connection Established

After a successful connection, the modal closes, and the developer gets the provider from the modal hook.

5

Disconnection

If connection is established, you can open the modal and disconnect.

Last updated