Rise Wallet
  • 🙌Introduction
    • Self-Custody
    • Best Practices
    • Bigger Picture
  • Features
    • ✨Active on Devnet
  • Integrations
    • ⛓️Integrate Rise Wallet
      • With the Wallet Adapter
      • Without the Wallet Adapter
        • Detecting the Provider
        • Establishing Connection
        • Sending Transactions
        • Signing Transactions
        • Signing Messages
    • 🎭Profile Picture Protocol
      • Get a Wallet's Profile Picture
      • Set a NFT as a Profile Picture
      • Clear Profile Picture
    • ⚡Rise Notifications
      • Sending Notifications
      • User Perspective
        • Notification Center
        • Subscription Management
      • API Endpoints
        • Broadcast Endpoint
        • Unicast Endpoint
        • List Casts Endpoint
        • View Cast Endpoint
        • Check Key Subscription Status
Powered by GitBook
On this page
  1. Integrations
  2. Integrate Rise Wallet
  3. Without the Wallet Adapter

Signing Messages

Once an application is connected to the Rise Wallet via connect method, it can also request that the user signs a given message using window.rise.signMessage().Applications are free to write their own messages which will be displayed to users from within Rise Wallet's signature prompt. Message signatures do not involve network fees and are a convenient way for apps to verify ownership of an address. It takes one parameter listed below:

{
   address?: boolean; // To include the address of the account in the message
   application?: boolean; // To include the domain of the dapp
   chainId?: boolean; // To include the current chain id the wallet is connected to
   message: string; // The message to be signed and displayed to the user
   nonce: string; // A nonce the app should generate,
 }

Below is an example code describing the way to sign a message.

const signature = await window.rise.signMessage({
  address: true,
  application: true,
  chainId: true,
  message: "This is a message",
  nonce: 123,
});
console.log(signature)
// {
//  address: true
//  application: "localhost:5001"
//  chainId: 33
//  fullMessage: "APTOS\naddress: true\napplication: localhost:5001\nchainId: 33\nmessage: This is a message\nnonce: 123"
//  message: "This is a message"
//  nonce: 123
//  prefix: "APTOS"
//  publicKey: "0x71c87ca87e89dd7d02d224465cc40a1aafb10a76a91a0857ddac29fe0c3cdf23"
//  signature: "0xd4bfd19381d4e2d1ae06f530a4390c671baa8427829a9deeb457cada04a58e7cf22bc9bfc1049586628eed09ba356fcd8abdc67b7830dbe3bc4de1df0e88fc0e"
// }
PreviousSigning TransactionsNextProfile Picture Protocol

Last updated 2 years ago

⛓️