@blockchaincommons/gstp - v1.0.0-beta.2
    Preparing search index...

    Class SealedResponse

    A response with its sender, state and the peer's continuation.

    Implements

    • ToEnvelope
    Index
    • get isErr(): boolean

      Whether the response is a failure (early or not).

      Returns boolean

    • get id(): ARID | undefined

      The request id; undefined on an early failure.

      Returns ARID | undefined

    • get result(): Envelope

      The 'result'; Envelope[General] on a failure.

      Returns Envelope

    • get error(): Envelope

      The 'error'; Envelope[General] on a success.

      Returns Envelope

    • get state(): Envelope | undefined

      The sender's state, when any.

      Returns Envelope | undefined

    • get peerContinuation(): Envelope | undefined

      The peer's continuation, when any.

      Returns Envelope | undefined

    • With a 'result'; undefined sets a null result, as the reference's with_optional_result(None). Envelope[General] on a response that is not a success, where the reference panics.

      Parameters

      • result: EnvelopeInput | undefined

      Returns SealedResponse

    • With an 'error'; undefined leaves the response unchanged, as the reference's with_optional_error(None). Envelope[General] on a success, where the reference panics.

      Parameters

      • error: EnvelopeInput | undefined

      Returns SealedResponse

    • The request id; Envelope[General] on an early failure, which has none.

      Returns ARID

    • The 'result' leaf decoded by decoder, as the reference's extract_result::<T>.

      Type Parameters

      • T

      Parameters

      • decoder: CborDecoder<T>

      Returns T

    • The 'error' leaf decoded by decoder, as the reference's extract_error::<T>.

      Type Parameters

      • T

      Parameters

      • decoder: CborDecoder<T>

      Returns T

    • With the sender's state (undefined clears it); StateOnFailedResponse unless the response is a success.

      Parameters

      • state: EnvelopeInput | undefined

      Returns SealedResponse

    • With the peer's continuation (undefined clears it); not an Envelope is a TypeError.

      Parameters

      • peerContinuation: Envelope | undefined

      Returns SealedResponse

    • The response with 'sender', the sender's continuation when there is state (with validUntil, encrypted to the sender) and the peer continuation; signed by signer and encrypted to recipients. With no options: unsigned, unsealed.

      Parameters

      Returns Envelope

    • SealedResponse(<summary>, state: <flat>, peer_continuation: None|Some), the reference's Display.

      Returns string