Skip to main content

Sign Payload

RAW#

import { DAppClient, SigningType } from "@airgap/beacon-sdk";
const dAppClient = new DAppClient({ name: "Beacon Docs" });
const response = await dAppClient.requestSignPayload({
signingType: SigningType.RAW,
payload: "any string that will be signed",
});
console.log(`Signature: ${response.signature}`);
https://example.com

HEX Prefixed With 03#

import { DAppClient, SigningType } from "@airgap/beacon-sdk";
const dAppClient = new DAppClient({ name: "Beacon Docs" });
const response = await dAppClient.requestSignPayload({
signingType: SigningType.MICHELINE,
// This hex string needs to be prefixed with 05
// The following is packed data, it can also be signed by Kukai
payload:
"05010000004254657a6f73205369676e6564204d6573736167653a206d79646170702e636f6d20323032312d30312d31345431353a31363a30345a2048656c6c6f20776f726c6421",
});
console.log(`Signature: ${response.signature}`);
https://example.com

HEX Prefixed With 05#

import { DAppClient, SigningType } from "@airgap/beacon-sdk";
const dAppClient = new DAppClient({ name: "Beacon Docs" });
const response = await dAppClient.requestSignPayload({
signingType: SigningType.OPERATION,
payload: "0300", // This hex string needs to be prefixed with 03
});
console.log(`Signature: ${response.signature}`);
https://example.com