use-truapi
Accounts

useSignRawUnwatermarked

Deprecated bare-byte signature for runtimes that verify an unwatermarked ownership proof

useSignRawUnwatermarked signs bytes with the product account without the <Bytes> watermark that useSignRaw adds. It exists for runtimes that verify a bare-byte ownership proof, the People chain's register_person lite_identity_proof being the one that forced it, and nothing else should use it: an unwatermarked signature can authorize a transaction, so the host logs a deprecation warning and shows a stronger confirmation prompt.

It is deprecated on the host side too and disappears once runtimes accept watermarked proofs. Host-only: standalone sign rejects with HostUnavailableError.

Usage

import { useSignRawUnwatermarked } from "@use-truapi/react";

function RegisterPerson({ proofBytes }: { proofBytes: Uint8Array }) {
  const { sign, isPending } = useSignRawUnwatermarked();
  return (
    <button type="button" disabled={isPending} onClick={() => sign(proofBytes).then(submitRegistration)}>
      Register
    </button>
  );
}
<script setup lang="ts">
import { useSignRawUnwatermarked } from "@use-truapi/vue";

const props = defineProps<{ proofBytes: Uint8Array }>();
const { sign, isPending } = useSignRawUnwatermarked();
</script>

<template>
  <button type="button" :disabled="isPending" @click="sign(props.proofBytes).then(submitRegistration)">Register</button>
</template>

API reference

React

function useSignRawUnwatermarked(options?): NamedMutation<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>> & object;

Sign bytes with the product account without the <Bytes> watermark, for runtimes that verify a bare-byte ownership proof (People chain's register_person). The host shows a stronger confirmation because such a signature can authorize a transaction; prefer useSignRaw everywhere a runtime does not force otherwise. Host-only.

Parameters

ParameterType
options?{ mutation?: MutationOptions<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>; }
options.mutation?MutationOptions<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>

Returns

NamedMutation<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>> & object

Deprecated

Temporary compatibility path, deprecated host-side too; disappears once runtimes accept watermarked proofs.

Vue

function useSignRawUnwatermarked(options?): NamedMutation<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>> & object;

Sign bytes with the product account without the <Bytes> watermark, for runtimes that verify a bare-byte ownership proof (People chain's register_person). The host shows a stronger confirmation because such a signature can authorize a transaction; prefer useSignRaw everywhere a runtime does not force otherwise. Host-only.

Parameters

ParameterType
options?{ mutation?: MutationOptions<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>; }
options.mutation?MutationOptions<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>

Returns

NamedMutation<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>> & object

Deprecated

Temporary compatibility path, deprecated host-side too; disappears once runtimes accept watermarked proofs.

On this page