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

# public/auth

> JSON-RPC method `public/auth` on the trading socket. The signed message is exactly `Sign in to Joyride\n\nWallet: {wallet}\nNonce: {nonce}`. A wallet with no account is refused with `1001`; signing in never creates an account.



## AsyncAPI

````yaml _generated/asyncapi.yaml public.auth
id: public.auth
title: public/auth
description: >-
  JSON-RPC method `public/auth` on the trading socket. The signed message is
  exactly `Sign in to Joyride\n\nWallet: {wallet}\nNonce: {nonce}`. A wallet
  with no account is refused with `1001`; signing in never creates an account.
servers:
  - id: trading
    protocol: wss
    host: joyride.exchange
    bindings: []
    variables: []
address: /
parameters: []
bindings: []
operations:
  - &ref_1
    id: public.auth.request
    title: Request
    type: receive
    messages:
      - &ref_3
        id: request
        contentType: application/json
        payload:
          - name: Request params
            type: object
            properties:
              - name: wallet
                type: string
                description: Base58 Ed25519 public key.
                required: true
              - name: signature
                type: string
                description: Ed25519 signature over the UTF-8 bytes of `message`; base58
                required: true
              - name: message
                type: string
                description: >-
                  Exactly `Sign in to Joyride\n\nWallet: {wallet}\nNonce:
                  {nonce}`; any byte difference is `1001`.
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          additionalProperties: false
          required:
            - wallet
            - signature
            - message
          properties:
            wallet:
              type: string
              description: Base58 Ed25519 public key.
              x-parser-schema-id: <anonymous-schema-5>
            signature:
              type: string
              description: Ed25519 signature over the UTF-8 bytes of `message`; base58
              hex or base64 of 64 bytes.: null
              x-parser-schema-id: <anonymous-schema-6>
            message:
              type: string
              description: >-
                Exactly `Sign in to Joyride\n\nWallet: {wallet}\nNonce:
                {nonce}`; any byte difference is `1001`.
              x-parser-schema-id: <anonymous-schema-7>
          x-parser-schema-id: AuthParams
        title: Request params
        example: |-
          {
            "wallet": "7Gx2XvMk9Z1sZbY3qJ8pKcWnD4tFhRr6sA2eLmN5uVwQ",
            "signature": "<base58 signature>",
            "message": "Sign in to Joyride\\n\\nWallet: 7Gx2XvMk9Z1sZbY3qJ8pKcWnD4tFhRr6sA2eLmN5uVwQ\\nNonce: 3fA9kLm2PqRs7TuVwXyZ1bCdEfGh4JkL"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: request
    bindings: []
    extensions: &ref_0
      - id: x-parser-unique-object-id
        value: public.auth
  - &ref_2
    id: public.auth.reply
    title: Reply
    type: send
    messages:
      - &ref_4
        id: result
        contentType: application/json
        payload:
          - name: Result
            type: object
            properties:
              - name: wallet
                type: string
                required: true
              - name: account_id
                type: integer
                required: true
              - name: roles
                type: array
                description: >-
                  `rfq_quoter` for an account the exchange has designated as a
                  market maker; empty for every other account.
                required: true
                properties:
                  - name: item
                    type: string
                    enumValues:
                      - rfq_quoter
                      - admin
                    required: false
              - name: session_token
                type: string
                description: JWT (HS256); valid until its `exp`
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - wallet
            - account_id
            - roles
            - session_token
          properties:
            wallet:
              type: string
              x-parser-schema-id: <anonymous-schema-8>
            account_id:
              type: integer
              minimum: 1
              x-parser-schema-id: <anonymous-schema-9>
            roles:
              type: array
              items:
                type: string
                enum:
                  - rfq_quoter
                  - admin
                x-parser-schema-id: <anonymous-schema-11>
              description: >-
                `rfq_quoter` for an account the exchange has designated as a
                market maker; empty for every other account.
              x-parser-schema-id: <anonymous-schema-10>
            session_token:
              type: string
              description: JWT (HS256); valid until its `exp`
              24 hours by default; no revocation. Also the Bearer token for the query API.: null
              x-parser-schema-id: <anonymous-schema-12>
          x-parser-schema-id: AuthResult
        title: Result
        example: |-
          {
            "wallet": "7Gx2XvMk9Z1sZbY3qJ8pKcWnD4tFhRr6sA2eLmN5uVwQ",
            "account_id": 1042,
            "roles": [
              "rfq_quoter"
            ],
            "session_token": "<jwt>"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: result
      - &ref_5
        id: error
        contentType: application/json
        payload:
          - name: Error
            description: >-
              `1001` for an authentication or session failure, `-32602` for
              malformed params on a `public/*` method.
            type: object
            properties:
              - name: code
                type: integer
                description: >-
                  `1001` not authenticated (bad signature, expired or reused
                  nonce, expired or invalid token, unknown or reassigned
                  account, 60-second idle reap); `-32602` invalid params;
                  `-32700`, `-32600`, `-32601`, `-32603` per JSON-RPC 2.0.
                required: true
              - name: message
                type: string
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          description: The `error` object of a `public/*` failure.
          required:
            - code
            - message
          properties:
            code:
              type: integer
              description: >-
                `1001` not authenticated (bad signature, expired or reused
                nonce, expired or invalid token, unknown or reassigned account,
                60-second idle reap); `-32602` invalid params; `-32700`,
                `-32600`, `-32601`, `-32603` per JSON-RPC 2.0.
              x-parser-schema-id: <anonymous-schema-3>
            message:
              type: string
              x-parser-schema-id: <anonymous-schema-4>
          x-parser-schema-id: JsonRpcError
        title: Error
        description: >-
          `1001` for an authentication or session failure, `-32602` for
          malformed params on a `public/*` method.
        example: |-
          {
            "code": 1001,
            "message": "unknown account"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: error
    bindings: []
    extensions: *ref_0
sendOperations:
  - *ref_1
receiveOperations:
  - *ref_2
sendMessages:
  - *ref_3
receiveMessages:
  - *ref_4
  - *ref_5
extensions:
  - id: x-parser-unique-object-id
    value: public.auth
securitySchemes: []

````

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