eSealing - Connecting browser Wallet

Hi!

I would like to recreate a similar button functionality as you have here for connecting the browser wallet. However I am having difficulties finding some source code, apart from the front end React bit, I am looking for the Backend/rust part? Can someone guide me a bit here?

Thanks ind advance!

Hello tel

We will get back to you shortly.

Regards,
Concordium Tech Support

The browser wallet is only at the front end (the browser wallet is installed at the user’s browser and also the private keys in the browser wallet are ONLY at the user’s machine). Therefore the backend cannot connect or access the browser wallet to initiate a transaction to be sent via the browser wallet.
The code that is linked to the connect button can be found in the front-end/React part of the project here:

The eSealing example sends all transactions from the frontend via the Concordium browser wallet (or wallet connect - mobile wallets) to the blockchain, there is no Rust/backend that sends transactions in the eSealing example.

I am happy to point out additional parts in the front end if you need further help with how the “Use Browser Wallet” button works at the front end.

3 Likes

Hi!

I might be wrong in my backend expression, but not excactly what I mean.

I am working on building a Python application and would like to use the “connect to browser wallet” button. But the front end bit I will make differently, so I am looking for how to implement the “connection” functionality on its own.
Until now I have used the concordium-client command line commands to run as functions in the app, so I would expect something similar? :slight_smile:

Or if I can convert this tsx to python? :thinking:

We have a list of SDKs that we currently support here:
https://developer.concordium.software/en/mainnet/net/guides/sdks-apis.html#sdks-apis

Python SDK is not among them at the moment, also we have discussed including it and it could be added in the future (no timeline/promise so).

2 Likes

So all the connection functionality happens in React in the example?

As I understand this React script (and its siblings) are refering to rust functionality that you have build to support this React script. Is this conceptually correct? :slight_smile:

And if so where do I find that code it is refering to?

Thanks for the continous help! :slight_smile:

The browser wallet hosts the private keys corresponding to the accounts of the
user and a https link that points to a server that hosts a Concordium node.

Your front-end code that is run in the browser constructs the transaction object and sends it to the Concordium Wallet for Web. The transaction object is signed by the private key hosted in the Concordium Wallet for Web and transmitted to a server hosted by Conocrdium via HTTPS. This server has access to a Concordium node and converts the request (including the signed transaction object) that comes via HTTPS from the Concordium Wallet for Web to a request that the Concordium node can execute.

2 Likes

I am not sure if I am missing the point, but where do these imports come from? Are they not originating from concordium (in rust)?

import {
    ConnectorType,
    useWalletConnectorSelector,
    WalletConnection,
    WalletConnectionProps,
} from '@concordium/react-components';

The eSealing example uses the react-components and the wallet-connectors packages from this repo; These components are written in TypeScript:

Since you ask about the BrowserWallet specifically:

3 Likes

Thanks a lot! I think that was what I was looking for! :slight_smile:

1 Like