# Sign Message

This example show how to sign message with the help of injected enzyme wallet.

# Javascript

import { web3FromAddress } from '@polkadot/extension-dapp';

// finds an injector for an address
const injector = await web3FromAddress('5DTestUPts3kjeXSTMyerHihn1uwMfLj8vU8sqF7qYrFabHE');

// sets the signer for the address on the @polkadot/api
api.setSigner(injector.signer);

// address and data will passed through signRaw params, the API then calls the extension to present
// to the user and get it signed. It will return signed signature.  
injector.signer.signRaw({
          address: '5C5555yEXUcmEJ5kkcCMvdZjUo7NGJiQJMS7vZXEeoMhj3VQ',
          data: isHexData ? '0x68656c6c6f20776f726c64' : stringToHex('Test message'),
          type: 'bytes'
        });
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

Once you click on allow, It will sign the message and return the reponse in hex format.