Skip to content

ledger_nonce

  • Write a 32 byte random value to the write_ptr

C

int64_t ledger_nonce (
uint32_t write_ptr,
uint32_t write_len
);
uint8_t n[32];
int64_t bytes_written =
ledger_nonce(n, 32);
NameTypeDescription
write_ptruint32_tPointer to a buffer of a suitable size to store the output. Should be at least 32 bytes.
write_lenuint32_tLength of the output buffer.
TypeDescription
ErrorCode | ByteArrayReturns an error code if an error occurs, or an array representing the nonce of the current ledger. specified outside of hook memory.