asyncapi: 3.0.0
info:
  title: Triport — Base JSON-RPC Pub/Sub
  version: 0.1.0-n7-base-01
  description: Frozen Base pub/sub contract. App-facing Flashblocks topics remain documented/unknown; they are not aliases for the raw feed.
defaultContentType: application/json
servers:
  production: {$ref: '_shared.yaml#/servers/production'}
channels:
  basePubSub:
    address: /ws/base/{key}
    parameters:
      key: {description: Triport API key; never an upstream provider key.}
    x-scope: base:ws
    x-tier-required: basic
    x-tier-category: base_ws_pubsub
    x-triport-tier:
      feature_id: base_ws_pubsub
      minimum_tier: basic
      tiers:
        free:
          allowed: false
        basic:
          allowed: true
          subscriptions:
            max_connections: 1
            max_subscriptions_per_connection: 10
            allowed_methods: ["newHeads", "logs"]
        pro:
          allowed: true
          subscriptions:
            max_connections: 2
            max_subscriptions_per_connection: 10
            allowed_methods: ["newHeads", "logs", "newPendingTransactions"]
        business:
          allowed: true
          subscriptions:
            max_connections: 4
            max_subscriptions_per_connection: 10
            allowed_methods: ["newHeads", "logs", "newPendingTransactions"]
        enterprise:
          allowed: true
          subscriptions:
            max_connections: 4
            max_subscriptions_per_connection: 10
            allowed_methods: ["newHeads", "logs", "newPendingTransactions"]
    x-source-sha256: '7ef8de887793da452239eb285d45dafe2aa5e1a71d02fb366cb87ca983f231ff'
    messages:
      Subscribe: {$ref: '#/components/messages/Subscribe'}
      Notification: {$ref: '#/components/messages/Notification'}
      WSError: {$ref: '_shared.yaml#/components/messages/WSError'}
operations:
  subscribeBase:
    action: send
    channel: {$ref: '#/channels/basePubSub'}
    messages: [{$ref: '#/channels/basePubSub/messages/Subscribe'}]
  receiveBase:
    action: receive
    channel: {$ref: '#/channels/basePubSub'}
    messages: [{$ref: '#/channels/basePubSub/messages/Notification'}, {$ref: '#/channels/basePubSub/messages/WSError'}]
components:
  schemas:
    SubscribeRequest:
      type: object
      required: [jsonrpc, id, method, params]
      properties:
        jsonrpc: {type: string, const: '2.0'}
        id: {oneOf: [{type: integer}, {type: string}]}
        method: {type: string, const: eth_subscribe}
        params:
          type: array
          minItems: 1
          prefixItems:
            - {type: string, enum: [newHeads, logs, newPendingTransactions, newFlashblockTransactions, pendingLogs, newFlashblocks]}
    NotificationEnvelope:
      type: object
      required: [jsonrpc, method, params]
      properties:
        jsonrpc: {type: string, const: '2.0'}
        method: {type: string, const: eth_subscription}
        params:
          type: object
          required: [subscription, result]
          properties:
            subscription: {type: string}
            result: {}
  messages:
    Subscribe:
      title: eth_subscribe
      x-topic-status:
        newHeads: {availability: unknown, validation: positive_fixture}
        logs: {availability: unknown, validation: documented}
        newPendingTransactions: {availability: unknown, validation: positive_fixture}
        newFlashblockTransactions: {availability: unknown, validation: documented}
        pendingLogs: {availability: unknown, validation: documented}
        newFlashblocks: {availability: unknown, validation: documented}
      payload: {$ref: '#/components/schemas/SubscribeRequest'}
    Notification:
      title: Base subscription notification
      payload: {$ref: '#/components/schemas/NotificationEnvelope'}
