Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Runtime/codebase/IWalletBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@ public interface IWalletBase
/// <returns></returns>
Task<byte[]> SignMessage(byte[] message);

/// <summary>
/// Sign a UTF-8 encoded string message
/// </summary>
/// <param name="message">The string message to sign</param>
/// <returns>The signature bytes</returns>
Task<byte[]> SignMessage(string message);

/// <summary>
/// Sign and send a transaction
/// </summary>
Expand Down
11 changes: 11 additions & 0 deletions Runtime/codebase/WalletBase.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using Cysharp.Threading.Tasks;
Expand Down Expand Up @@ -264,6 +265,16 @@ public virtual async Task<RequestResult<string>> SignAndSendTransaction
/// <inheritdoc />
public abstract Task<byte[]> SignMessage(byte[] message);

/// <summary>
/// Sign a UTF-8 encoded string message
/// </summary>
/// <param name="message">The string message to sign</param>
/// <returns>The signature bytes</returns>
public Task<byte[]> SignMessage(string message)
{
return SignMessage(Encoding.UTF8.GetBytes(message));
}

/// <summary>
/// Airdrop sol on wallet
/// </summary>
Expand Down