Skip to main content

Sign Payload

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.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 03#

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

RAW#

warning

Not all wallets support the RAW signing type. Additionally, the signatures can be different depending on the wallet that was used. For the preferred way of signing arbitrary data, please check the docs here: https://tezostaquito.io/docs/signing/#generating-a-signature-with-beacon-sdk

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