Matthew M
Matthew M

Reputation: 11

How sign a message on Near with Meteor Wallet in js app?

I would like to get the signature of a message 'hello' on Near in my Next Js app.

I wanted to use this code : https://docs.near.org/develop/integrate/backend-login, but I did not manage to connect to Meteor wallet and get the signature.

Do you know how to handle it ? Do you have any code to share ?

I implemented to logic on https://docs.near.org/develop/integrate/backend-login, but I don't understand how to connect to Meteor.

What I want is that the user sign a message in a wallet, and then I get the signature of the message 'hello'.

Upvotes: 0

Views: 209

Answers (1)

Kujtim Prenku
Kujtim Prenku

Reputation: 11

the docs here: https://docs.near.org/develop/integrate/backend-login assume that you have already setup the wallet selector.

To communicate with Meteor Wallet you need to use Wallet Selector on the frontend and add setupMeteorWallet to modules: https://github.com/near/wallet-selector#installation-and-usage

After you setup the wallet selector you can communicate with Meteor Wallet like this:

const meteor = await selector.wallet("meteor-wallet");

const signedMessage = await meteor.signMessage(params);

Upvotes: 1

Related Questions