[#btck_script_pubkey_to_bytes] = btck_script_pubkey_to_bytes :mrdocs: Serializes the script pubkey through the passed in callback to bytes. == Synopsis Declared in `<kernel/bitcoinkernel.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[nodiscard, __nonnull__]] int btck_script_pubkey_to_bytes( xref:btck_ScriptPubkey-0e.adoc[btck_ScriptPubkey] const* script_pubkey, xref:btck_WriteBytes.adoc[btck_WriteBytes] writer, void* user_data); ---- == Return Value 0 on success. [NOTE] ==== The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^]. ==== == Parameters [cols="1,4"] |=== | Name| Description | *script_pubkey* [in] | Non‐null. | *writer* [in] | Non‐null, callback to a write bytes function. | *user_data* [in] | Holds a user‐defined opaque structure that will be passed back through the writer callback. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#