spark_flashnet_signStructuredMessage
Use the spark_flashnet_signStructuredMessage method to request a signature from the user’s Spark wallet on a structured Flashnet message.
The wallet will only sign if the message is:
A valid Flashnet intent (e.g. swap, liquidity, pool creation, deposit confirmation, clawback).
The payload must match one of the supported Flashnet intent schemas (see
spark_flashnet_signIntent):
A Flashnet authentication challenge for JWT issueance
the payload must be a string prefixed with:
FLASHNET_AUTH_CHALLENGE_V1: <32 random bytes>
Any other message is rejected to prevent unsafe signing.
The wallet ensures users see a clear review screen of what they’re signing (“What You See Is What You Sign”), preventing arbitrary or unsafe message signing.
Parameters
{
message: string; // raw structured message
}Examples
Flashnet intent (executeSwap):
Flashnet JWT issuance challenge:
Responses
✅ Success
❌ Error
Common error cases:
Message not valid JSON (when intent expected).
Message doesn’t match any supported Flashnet intent schema.
JWT challenge missing the required
FLASHNET_AUTH_CHALLENGE_V1:prefix.User rejects the request in the wallet.
Last updated