> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kuru.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Subscribe to transaction

> Recover a pending or retained Relay transaction outcome after reconnecting.

Send `transaction.subscribe` with the server-assigned `requestId` and `txHash` from an earlier `BROADCAST` response. The authenticated WebSocket must be bound to the same trading wallet. This method does **not** rebroadcast the transaction.

New WebSocket submissions automatically receive outcomes on their submitting connection; explicit subscription is primarily for reconnect recovery. For a pending transaction, Relay responds `SUBSCRIBED` and later sends `transaction.outcome`. If its terminal outcome is still retained, Relay sends that outcome immediately instead.

Relay retains the latest **4,096 terminal outcomes per signer**, shared across users. The limit is by count, not age, and replay may be unavailable after a signer restart. If the submission response was lost before either `requestId` or `txHash` arrived, a connection-local WS `id` cannot be used as a cross-connection lookup key. See [Relay errors and outcomes](/api/relay/errors#connection-closure-and-recovery) for the CLOID and chain-state recovery path.


## AsyncAPI

````yaml api/relay/asyncapi.yaml transactionSubscribe
id: transactionSubscribe
title: Subscribe to transaction outcome
description: Recover a known transaction by its Relay request ID and transaction hash.
servers:
  - id: mainnet
    protocol: wss
    host: relay.mainnet.kuru.io
    bindings: []
    variables: []
  - id: testnet
    protocol: wss
    host: relay.testnet.kuru.io
    bindings: []
    variables: []
address: /relay/ws
parameters: []
bindings:
  - protocol: ws
    version: 0.1.0
    value:
      method: GET
      query:
        type: object
        required:
          - account_id
        properties:
          account_id:
            type: string
            pattern: ^[1-9][0-9]*$
            maxLength: 13
            description: >-
              Exactly one canonical positive uint40 Kuru trading account ID (1
              through 1099511627775), without leading zero, sign, or whitespace.
            examples: &ref_0
              - '123'
    schemaProperties:
      - name: method
        type: string
        description: GET
        required: false
      - name: query
        type: object
        required: false
        properties:
          - name: account_id
            type: string
            description: >-
              Exactly one canonical positive uint40 Kuru trading account ID (1
              through 1099511627775), without leading zero, sign, or whitespace.
            examples: *ref_0
            required: true
operations:
  - &ref_2
    id: transactionSubscribe
    title: Transaction subscribe
    type: receive
    messages:
      - &ref_4
        id: request
        contentType: application/json
        payload:
          - name: transaction.subscribe
            type: object
            properties:
              - name: id
                type: string
                description: Connection-local correlation ID.
                required: true
              - name: method
                type: string
                description: transaction.subscribe
                required: true
              - name: payload
                type: object
                required: true
                properties:
                  - name: requestId
                    type: string
                    required: true
                  - name: txHash
                    type: string
                    required: true
        headers: []
        jsonPayloadSchema:
          type: object
          additionalProperties: false
          required:
            - id
            - method
            - payload
          properties:
            id:
              type: string
              minLength: 1
              maxLength: 128
              description: Connection-local correlation ID.
              x-parser-schema-id: <anonymous-schema-29>
            method:
              type: string
              const: transaction.subscribe
              x-parser-schema-id: <anonymous-schema-30>
            payload:
              type: object
              additionalProperties: false
              required:
                - requestId
                - txHash
              properties:
                requestId:
                  type: string
                  pattern: >-
                    ^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
                  x-parser-schema-id: <anonymous-schema-32>
                txHash:
                  type: string
                  pattern: ^0x[0-9a-f]{64}$
                  x-parser-schema-id: <anonymous-schema-33>
              x-parser-schema-id: <anonymous-schema-31>
          x-parser-schema-id: TransactionSubscribeRequest
        title: transaction.subscribe
        example: |-
          {
            "id": "sub-1",
            "method": "transaction.subscribe",
            "payload": {
              "requestId": "018f5ef2-88a1-7b41-a826-4b679010f87f",
              "txHash": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: request
    bindings: []
    extensions: &ref_1
      - id: x-parser-unique-object-id
        value: transactionSubscribe
  - &ref_3
    id: transactionSubscribed
    title: Transaction subscribed
    type: send
    messages:
      - &ref_5
        id: subscribed
        contentType: application/json
        payload:
          - name: SUBSCRIBED acknowledgement
            type: object
            properties:
              - name: id
                type: string
                description: Correlation ID from transaction.subscribe.
                required: true
              - name: status
                type: string
                description: SUBSCRIBED
                required: true
              - name: requestId
                type: string
                required: true
              - name: txHash
                type: string
                required: true
              - name: retryable
                type: boolean
                description: false
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          additionalProperties: false
          required:
            - id
            - status
            - requestId
            - txHash
            - retryable
          description: >-
            Pending transaction only. A retained terminal transaction returns
            TransactionOutcome immediately instead.
          properties:
            id:
              type: string
              description: Correlation ID from transaction.subscribe.
              x-parser-schema-id: <anonymous-schema-34>
            status:
              type: string
              const: SUBSCRIBED
              x-parser-schema-id: <anonymous-schema-35>
            requestId:
              type: string
              x-parser-schema-id: <anonymous-schema-36>
            txHash:
              type: string
              x-parser-schema-id: <anonymous-schema-37>
            retryable:
              type: boolean
              const: false
              x-parser-schema-id: <anonymous-schema-38>
          x-parser-schema-id: TransactionSubscribed
        title: SUBSCRIBED acknowledgement
        example: |-
          {
            "id": "sub-1",
            "status": "SUBSCRIBED",
            "requestId": "018f5ef2-88a1-7b41-a826-4b679010f87f",
            "txHash": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            "retryable": false
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: subscribed
    bindings: []
    extensions: *ref_1
sendOperations:
  - *ref_2
receiveOperations:
  - *ref_3
sendMessages:
  - *ref_4
receiveMessages:
  - *ref_5
extensions:
  - id: x-parser-unique-object-id
    value: transactionSubscribe
securitySchemes:
  - id: bearerAuth
    name: bearerAuth
    type: http
    description: Wallet-bound JWT supplied in the WebSocket upgrade Authorization header.
    scheme: bearer
    bearerFormat: JWT
    extensions: []

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.