obyte.js
GitHubDiscord
0.1.8
0.1.8
  • Obyte.js
  • Getting started
    • Quick start
    • Testnet
  • Client
    • Subscribe
    • Just saying
  • API
    • Get witnesses
    • Get peers
    • Get joint
    • Get last MCI
    • Get history
    • Get attestation
    • Get attestations
    • Get bots
    • Get asset metadata
    • Get definition
    • Get balances
    • Get profile units
    • Dry run AA (testnet)
    • Get AA state vars (testnet)
    • Get AAs by base AAs (testnet)
    • Get AA responses (testnet)
    • Core
      • Catchup
      • Get hash tree
      • Get light props
      • Post joint
      • Pick divisible coins for amount
      • Heartbeat
  • Post
    • Address definition change
    • Attestation
    • Asset
    • Asset attestors
    • Data
    • Data feed
    • Definition
    • Definition template
    • Payment
    • Poll
    • Vote
    • Profile
    • Text
  • Utils
    • Sign message
    • Generate a random address
    • Get definition address
    • Is valid address
    • Keep connection alive
  • About
    • About
    • Links
    • Tutorials
Powered by GitBook
On this page
  • Example
  • Returns
  1. Utils

Sign message

Example

const { signMessage } = require('obyte/lib/utils');

const signedMessage = signMessage('Hello world', wif);

Returns

{
  version: '1.0',
  signed_message: 'Hello world',
  authors: [
    {
      address: 'TMWNLXR42CKIP4A774BQGNVBZAPHY7GH',
      definition: [
        'sig',
        {
          pubkey: 'AsD2GQ3+CSHfFO9CfX8+gBxmxSm9TGweKjWVie0rt/0p'
        }
      ],
      authentifiers: {
        r: 'Xfw43Kiu+q+L/1b+z+daKe784V3KcvxWXedwcyC/Yvp+ziR1Jomo7Og7ZoPUPUwQeM4UPpIVU/cTtgurH0LzvA=='
      }
    }
  ]
}

PreviousTextNextGenerate a random address

Last updated 5 years ago