π΄stx_signStructuredMessage
Request parameters
Description
import { cvToHex, stringAsciiCV, tupleCV, uintCV } from "@stacks/transactions";
import { request } from "sats-connect";
const response = await request("stx_signStructuredMessage", {
message: cvToHex(tupleCV({ hello: stringAsciiCV("world") })).slice(2), // remove 0x,
domain: cvToHex(
tupleCV({
name: stringAsciiCV("sats-connect-example"),
version: stringAsciiCV("1.2.3"),
"chain-id": uintCV(chainIds[network]),
})
).slice(2),
});
if (response.status === "success") {
alert("Success! Check the console for the response.");
console.log(response.result);
} else {
console.error(
"Something went wrong. Check the console for the response."
);
console.error(response);
}Property
Description
Last updated