Signing Messages

When the web application is connected to OneKey, it can also request that the user signs a given message.

In order to send a message for the user to sign, the web application must:

  • Provide UTF-8 encoded string.

  • Have it be signed by the user's OneKey Wallet.

The method call will return a Promise for an object containing the signatures.

const res = await provider.request({
  method: 'near_signMessages',
  params: {
    messages: ['hello world', 'onekey near wallet'], // must be Array type
  },
});
console.log('near_signMessages', res, res.signatures);

Last updated