Skip to main content

answer_payload

Function answer_payload 

Source
pub fn answer_payload(
    turn_id: &str,
    call_id: &str,
    index: u32,
    question_args_json: &str,
    state: &str,
    selected_index: Option<u32>,
    selected_label: &str,
    answered_by: &str,
    conversation_id: &str,
    nonce: &str,
    signer: &ApprovalSigner,
) -> (Vec<u8>, Vec<u8>, Vec<u8>)
Expand description

JSON payload for a question_response event.

The signature commits to the canonical (unsigned) JSON form: the question identity (call_id, index, question_args_json), the resolution (state/selected_index/selected_label), who resolved it (answered_by, empty for AUTO_RESOLVED_STATE), and the conversation/nonce binding. signed_by/signature_hex are populated after the signer runs and are NOT covered by the signature.

Returns (full_payload_bytes, signature_bytes, public_key_bytes).