Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

sign_doc_sha256

SHA-256 digest of a SignDoc's canonical JSON. The 32-byte payload that gets signed.

Signature

def sign_doc_sha256(sign_doc: SignDoc) -> bytes

Example

from dango.utils.signing import sign_doc_sha256
from dango.utils.types import SignDoc
 
digest = sign_doc_sha256(sign_doc)
assert len(digest) == 32

Parameters

sign_docSignDoc. The TypedDict with sender, gas_limit, messages, data.

Returns

bytes — exactly 32 bytes (the SHA-256 digest of sign_doc_canonical_json(sign_doc)).

Notes

  • Exposed for test and integration code that needs to verify the digest without re-deriving the canonical-JSON contract.

See also