{
  "openapi": "3.0.0",
  "info": {
    "title": "server",
    "version": "1.0.0"
  },
  "paths": {
    "/clients/{client_id}": {
      "get": {
        "summary": "Fetch a client",
        "description": "Returns the client's id, name, and API key. The path `client_id` must equal the authenticated caller.",
        "operationId": "api_client_get_run",
        "parameters": [
          {
            "name": "client_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key for authentication",
            "required": true,
            "schema": {},
            "example": "aabbccdd"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientGetResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "summary": "Update a client",
        "description": "Updates `name` and/or `api_key`. The new `api_key` should be generated by the caller via `POST /prepare/random` (length 16, hex-encoded). Replacing it invalidates the current one. The path `client_id` must equal the authenticated caller.",
        "operationId": "api_client_update_run",
        "parameters": [
          {
            "name": "client_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key for authentication",
            "required": true,
            "schema": {},
            "example": "aabbccdd"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientUpdateResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/approvers": {
      "get": {
        "summary": "List approvers",
        "description": "Returns all approvers belonging to the authenticated client",
        "operationId": "api_approver_list_run",
        "parameters": [
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key for authentication",
            "required": true,
            "schema": {},
            "example": "aabbccdd"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApproverListResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Add a new approver",
        "description": "Adds a new approver to the authenticated client. If `approving_key` is omitted the approver is created with Invited status and no authorization record; they must complete setup on first login. When `approving_key` is provided the approver is Active immediately.",
        "operationId": "api_approver_add_run",
        "parameters": [
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key for authentication",
            "required": true,
            "schema": {},
            "example": "aabbccdd"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApproverAddRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApproverAddResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/approvers/{approver_id}": {
      "delete": {
        "summary": "Remove an approver",
        "description": "Removes an approver and their unassigned authorization records. Returns 409 if the approver has any authorization assigned to a wallet (cannot safely remove).",
        "operationId": "api_approver_remove_run",
        "parameters": [
          {
            "name": "approver_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key for authentication",
            "required": true,
            "schema": {},
            "example": "aabbccdd"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApproverRemoveResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/approvers/{approver_id}/password": {
      "get": {
        "summary": "Get initial password for an invited approver",
        "description": "Returns the stored initial password only while the approver's status is Invited. Once the approver changes their password (status becomes Active), this returns 403.",
        "operationId": "api_approver_get_password_run",
        "parameters": [
          {
            "name": "approver_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key for authentication",
            "required": true,
            "schema": {},
            "example": "aabbccdd"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApproverGetPasswordResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "summary": "Change approver password",
        "description": "Verifies the old password, sets the new password hash, and sets status to Active. Called on first login (invited approver) or from the change-password drawer.",
        "operationId": "api_approver_change_password_run",
        "parameters": [
          {
            "name": "approver_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key for authentication",
            "required": true,
            "schema": {},
            "example": "aabbccdd"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApproverChangePasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApproverChangePasswordResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/authorizations": {
      "get": {
        "summary": "List authorizations",
        "description": "Returns authorization records for the authenticated client. Pass `?unassigned=true` to list only pre-registered records not yet assigned to a wallet (useful for the wallet creation flow).",
        "operationId": "api_authorization_list_run",
        "parameters": [
          {
            "name": "unassigned",
            "in": "query",
            "schema": {
              "type": "boolean",
              "nullable": true
            }
          },
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key for authentication",
            "required": true,
            "schema": {},
            "example": "aabbccdd"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthorizationListResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Pre-register a passkey",
        "description": "Creates an unassigned authorization record holding the approver's passkey. The record can later be assigned to a wallet by supplying the same key in POST /wallets or PUT /wallets/<wallet_id>.",
        "operationId": "api_authorization_add_run",
        "parameters": [
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key for authentication",
            "required": true,
            "schema": {},
            "example": "aabbccdd"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthorizationAddRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthorizationAddResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/authorizations/{authorization_id}": {
      "delete": {
        "summary": "Remove an authorization",
        "description": "Deletes an unassigned authorization (one with no wallet_id). Returns 409 Conflict if the authorization is assigned to a wallet. Returns 404 if the authorization does not exist or does not belong to the client.",
        "operationId": "api_authorization_remove_run",
        "parameters": [
          {
            "name": "authorization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key for authentication",
            "required": true,
            "schema": {},
            "example": "aabbccdd"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthorizationRemoveResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/wallets": {
      "get": {
        "summary": "List wallets",
        "description": "Returns wallets (with label, threshold, custodial flag, and approver count) for the authenticated client.",
        "operationId": "api_wallet_list_run",
        "parameters": [
          {
            "name": "approver_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64",
              "nullable": true
            }
          },
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key for authentication",
            "required": true,
            "schema": {},
            "example": "aabbccdd"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletListResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Add a new wallet",
        "description": "Adds a new wallet to the vault and returns the wallet ID",
        "operationId": "api_wallet_add_run",
        "parameters": [
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key for authentication",
            "required": true,
            "schema": {},
            "example": "aabbccdd"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WalletAddRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletAddResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/wallets/{wallet_id}/authorizations": {
      "get": {
        "summary": "List authorizations assigned to a wallet",
        "description": "Returns all authorization records assigned to the given wallet, including the name and email of the approver for each.",
        "operationId": "api_wallet_authorization_list_run",
        "parameters": [
          {
            "name": "wallet_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key for authentication",
            "required": true,
            "schema": {},
            "example": "aabbccdd"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletAuthorizationListResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/wallets/{wallet_id}": {
      "get": {
        "summary": "Get wallet data",
        "description": "Fetches wallet data from the vault",
        "operationId": "api_wallet_get_run",
        "parameters": [
          {
            "name": "wallet_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key for authentication",
            "required": true,
            "schema": {},
            "example": "aabbccdd"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletGetResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "summary": "Update a wallet",
        "description": "Updates an existing wallet in the vault (Please add a wallet first)",
        "operationId": "api_wallet_update_run",
        "parameters": [
          {
            "name": "wallet_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key for authentication",
            "required": true,
            "schema": {},
            "example": "aabbccdd"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WalletUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletUpdateResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/wallets/{wallet_id}/{network}/addresses": {
      "get": {
        "summary": "Get a list of existing addresses",
        "description": "Get a list of existing addresses from vault for a given wallet and network. Pass `current=true` to return only the current address (ignores `from_index` and `limit`).",
        "operationId": "api_address_list_run",
        "parameters": [
          {
            "name": "wallet_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "network",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ApiNetwork"
            }
          },
          {
            "name": "from_index",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "uint",
              "minimum": 0.0,
              "nullable": true
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "uint",
              "minimum": 0.0,
              "nullable": true
            }
          },
          {
            "name": "current",
            "in": "query",
            "schema": {
              "type": "boolean",
              "nullable": true
            }
          },
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key for authentication",
            "required": true,
            "schema": {},
            "example": "aabbccdd"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddressListResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Generate a new address",
        "description": "Generates a new address on the vault and returns it",
        "operationId": "api_address_generate_run",
        "parameters": [
          {
            "name": "wallet_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "network",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ApiNetwork"
            }
          },
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key for authentication",
            "required": true,
            "schema": {},
            "example": "aabbccdd"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddressGenerateResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/wallets/{wallet_id}/{network}/transactions": {
      "get": {
        "summary": "Get a list of transactions for a wallet on a network",
        "description": "Fetches on-chain receives for every wallet address and inserts any previously-unseen ones into `tbl_transaction`, then returns the full list (Sends + Receives) from the DB, newest first. Each row includes a server-built block-explorer link.",
        "operationId": "api_transaction_list_run",
        "parameters": [
          {
            "name": "wallet_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "network",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ApiNetwork"
            }
          },
          {
            "name": "from_index",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "uint",
              "minimum": 0.0,
              "nullable": true
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "uint",
              "minimum": 0.0,
              "nullable": true
            }
          },
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key for authentication",
            "required": true,
            "schema": {},
            "example": "aabbccdd"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionListResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Sign and send a transaction",
        "description": "Sign and send a transaction for a given wallet and network.",
        "operationId": "api_transaction_post_run",
        "parameters": [
          {
            "name": "wallet_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "network",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ApiNetwork"
            }
          },
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key for authentication",
            "required": true,
            "schema": {},
            "example": "aabbccdd"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransactionPostRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionPostResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/wallets/{wallet_id}/{network}/transactions/round1": {
      "post": {
        "summary": "Mpc sign transaction - round 1",
        "description": "Generate round 1 message for a given wallet and network.",
        "operationId": "api_transaction_post_round1_run",
        "parameters": [
          {
            "name": "wallet_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "network",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ApiNetwork"
            }
          },
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key for authentication",
            "required": true,
            "schema": {},
            "example": "aabbccdd"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransactionPostRound1Request"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignRound1Response"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/wallets/{wallet_id}/{network}/transactions/round2": {
      "post": {
        "summary": "Mpc sign transaction - round 2",
        "description": "Sign (round 2) and send a transaction for a given wallet and network.",
        "operationId": "api_transaction_post_round2_run",
        "parameters": [
          {
            "name": "wallet_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "network",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ApiNetwork"
            }
          },
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key for authentication",
            "required": true,
            "schema": {},
            "example": "aabbccdd"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransactionPostRound2Request"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionPostRound2Response"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/wallets/{wallet_id}/{network}/balance": {
      "get": {
        "summary": "Get current balance(s)",
        "description": "Get current balance(s) for a given wallet, and network's coins",
        "operationId": "api_balance_get_run",
        "parameters": [
          {
            "name": "wallet_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "network",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ApiNetwork"
            }
          },
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key for authentication",
            "required": true,
            "schema": {},
            "example": "aabbccdd"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceGetResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/wallets/{wallet_id}/requests": {
      "get": {
        "summary": "List requests for a wallet (newest first)",
        "operationId": "api_request_list_run",
        "parameters": [
          {
            "name": "wallet_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key for authentication",
            "required": true,
            "schema": {},
            "example": "aabbccdd"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestListResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create a new wallet update / transaction request",
        "description": "The creator's first approval (signed payload) is recorded atomically with the request, so if the wallet's threshold is 1 the request is processed immediately.",
        "operationId": "api_request_add_run",
        "parameters": [
          {
            "name": "wallet_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key for authentication",
            "required": true,
            "schema": {},
            "example": "aabbccdd"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestAddRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestAddResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/wallets/{wallet_id}/requests/{request_id}": {
      "get": {
        "summary": "Fetch a single request with all approvals",
        "operationId": "api_request_get_run",
        "parameters": [
          {
            "name": "wallet_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "request_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key for authentication",
            "required": true,
            "schema": {},
            "example": "aabbccdd"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestGetResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/wallets/{wallet_id}/requests/{request_id}/approvals": {
      "post": {
        "summary": "Cast an approval or rejection on a request",
        "operationId": "api_approval_add_run",
        "parameters": [
          {
            "name": "wallet_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "request_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key for authentication",
            "required": true,
            "schema": {},
            "example": "aabbccdd"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApprovalAddRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalAddResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/clients/{client_id}/logs": {
      "get": {
        "summary": "List audit logs for a client (newest first)",
        "description": "Returns paginated audit log entries for the authenticated client. Optional filters narrow by action name(s), wallet, approver (actor), target id, or time range (`from`/`to` as RFC 3339). Repeat `action=Name` to filter on multiple actions (logical OR). `approver_id` matches `actor_id` only when `actor_type == Approver`. The path's `client_id` must equal the authenticated client.",
        "operationId": "api_log_list_run",
        "parameters": [
          {
            "name": "client_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from_index",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64",
              "nullable": true
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64",
              "nullable": true
            }
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "wallet_id",
            "in": "query",
            "schema": {
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "approver_id",
            "in": "query",
            "schema": {
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "target_id",
            "in": "query",
            "schema": {
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key for authentication",
            "required": true,
            "schema": {},
            "example": "aabbccdd"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogListResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/clients/{client_id}/logs/{log_id}/target": {
      "get": {
        "summary": "Fetch the current state of the entity targeted by an audit log row",
        "description": "Looks up the log by `log_id`, dispatches on its `target_type`, and returns the affected entity's fields. The wallet UI calls this when the user expands a log row in the audit panel — replacing the frozen JSON snapshot the old `detail` column used to provide.\n\nReturns `target: null` (HTTP 200) when the target entity has been deleted since the log was written, or for `LogTargetType::Approval` (no handler currently writes approval-targeted logs, so there is nothing to look up).",
        "operationId": "api_log_target_get_run",
        "parameters": [
          {
            "name": "client_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "log_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key for authentication",
            "required": true,
            "schema": {},
            "example": "aabbccdd"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogTargetResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/prepare/nonce": {
      "post": {
        "summary": "Generate a nonce on HSM",
        "description": "Generate a nonce on the HSM for use in transaction signing.",
        "operationId": "api_nonce_generate_run",
        "parameters": [
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key for authentication",
            "required": true,
            "schema": {},
            "example": "aabbccdd"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NonceGenerateResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/prepare/random": {
      "post": {
        "summary": "Generate random bytes on HSM",
        "description": "Generate random bytes on the HSM for use in transaction signing.",
        "operationId": "api_random_generate_run",
        "parameters": [
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key for authentication",
            "required": true,
            "schema": {},
            "example": "aabbccdd"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RandomGenerateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RandomGenerateResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/prepare/pubkey": {
      "get": {
        "summary": "Get the public key for the import key on the HSM",
        "description": "Get the public key for the import key on the HSM.",
        "operationId": "api_pubkey_get_run",
        "parameters": [
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key for authentication",
            "required": true,
            "schema": {},
            "example": "aabbccdd"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PubkeyResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/prepare/fee": {
      "get": {
        "summary": "Get fee estimate",
        "description": "Get the current fee estimate for a transaction for a specific network.",
        "operationId": "api_fee_get_run",
        "parameters": [
          {
            "name": "network",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "coin",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "amount",
            "in": "query",
            "schema": {
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key for authentication",
            "required": true,
            "schema": {},
            "example": "aabbccdd"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeeGetResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ClientGetResponse": {
        "type": "object",
        "required": [
          "api_key",
          "client_id",
          "name"
        ],
        "properties": {
          "client_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "api_key": {
            "type": "string"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "type": "string"
          }
        }
      },
      "ClientUpdateResponse": {
        "type": "object",
        "required": [
          "api_key",
          "client_id",
          "name"
        ],
        "properties": {
          "client_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "api_key": {
            "type": "string"
          }
        }
      },
      "ClientUpdateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "description": "New client name (1-100 chars, trimmed). Omit to leave unchanged.",
            "default": null,
            "type": "string",
            "nullable": true
          },
          "api_key": {
            "description": "New API key (32 hex chars). Omit to leave unchanged. Typically sourced by the caller from `POST /prepare/random` with length 16.",
            "default": null,
            "type": "string",
            "nullable": true
          }
        }
      },
      "ApproverAddResponse": {
        "type": "object",
        "required": [
          "approver_id"
        ],
        "properties": {
          "approver_id": {
            "description": "ID of the newly created approver",
            "type": "string"
          },
          "authorization_id": {
            "description": "ID of the pre-registered (unassigned) authorization record — null for invited approvers",
            "type": "string",
            "nullable": true
          }
        }
      },
      "ApproverAddRequest": {
        "type": "object",
        "required": [
          "email",
          "name",
          "password"
        ],
        "properties": {
          "name": {
            "description": "Approver display name",
            "type": "string"
          },
          "email": {
            "description": "Approver email address",
            "type": "string"
          },
          "password": {
            "description": "Approver password (plaintext; hashed server-side)",
            "type": "string"
          },
          "approver_type": {
            "description": "Approver type — required when approving_key is provided",
            "allOf": [
              {
                "$ref": "#/components/schemas/ApproverType"
              }
            ],
            "nullable": true
          },
          "approving_key": {
            "description": "Approver public key (66 hex chars) — omit to create an invited approver with no passkey yet",
            "type": "string",
            "nullable": true
          },
          "encryption_key": {
            "description": "Approver encryption key (64 hex chars, optional)",
            "type": "string",
            "nullable": true
          }
        },
        "example": {
          "approver_type": "Sim",
          "approving_key": "025152bf606a9c5a8ee2bfee72659dd62f9ce943c4ac0edabd0a46651eed2bba30",
          "email": "bob@example.com",
          "encryption_key": "754c8a0aeba9a96f715a3f60e36acfefd544c7daeab89bf729f226aeee95300d",
          "name": "Bob",
          "password": "hunter2"
        }
      },
      "ApproverType": {
        "type": "string",
        "enum": [
          "Sim",
          "Passkey"
        ]
      },
      "ApproverListResponse": {
        "type": "object",
        "required": [
          "approvers"
        ],
        "properties": {
          "approvers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApproverListItem"
            }
          }
        }
      },
      "ApproverListItem": {
        "type": "object",
        "required": [
          "approver_id",
          "email",
          "name",
          "status"
        ],
        "properties": {
          "approver_id": {
            "description": "Approver ID",
            "type": "string"
          },
          "name": {
            "description": "Display name",
            "type": "string"
          },
          "email": {
            "description": "Email address",
            "type": "string"
          },
          "status": {
            "description": "Status: \"Invited\" or \"Active\"",
            "type": "string"
          }
        }
      },
      "ApproverRemoveResponse": {
        "type": "object"
      },
      "ApproverGetPasswordResponse": {
        "type": "object",
        "required": [
          "password"
        ],
        "properties": {
          "password": {
            "description": "Initial plaintext password for the invited approver",
            "type": "string"
          }
        }
      },
      "ApproverChangePasswordResponse": {
        "type": "object"
      },
      "ApproverChangePasswordRequest": {
        "type": "object",
        "required": [
          "new_password",
          "old_password"
        ],
        "properties": {
          "old_password": {
            "description": "Current password (plaintext)",
            "type": "string"
          },
          "new_password": {
            "description": "New password (plaintext; hashed server-side)",
            "type": "string"
          }
        }
      },
      "AuthorizationAddResponse": {
        "type": "object",
        "required": [
          "authorization_id"
        ],
        "properties": {
          "authorization_id": {
            "description": "ID of the newly created (unassigned) authorization record",
            "type": "string"
          }
        }
      },
      "AuthorizationAddRequest": {
        "type": "object",
        "required": [
          "approver_id",
          "approver_type",
          "approving_key",
          "label"
        ],
        "properties": {
          "approver_id": {
            "description": "Approver ID to register the key for",
            "type": "integer",
            "format": "int64"
          },
          "approver_type": {
            "description": "Approver type (Sim or Passkey)",
            "allOf": [
              {
                "$ref": "#/components/schemas/ApproverType"
              }
            ]
          },
          "approving_key": {
            "description": "Approving public key (66 hex chars, secp256k1)",
            "type": "string"
          },
          "encryption_key": {
            "description": "Encryption public key (64 hex chars, x25519; required for non-custodial)",
            "type": "string",
            "nullable": true
          },
          "label": {
            "description": "Label used when the passkey was created",
            "type": "string"
          }
        },
        "example": {
          "approver_id": 1,
          "approver_type": "Sim",
          "approving_key": "032d4857675adebaf06f3a7e643ba78c3ac476a60c930fb300f71cfd967ddb0c43",
          "encryption_key": "abb361891b0401dd4399bae3b0931b02a3c61877b34d2330f68998558cd6c351",
          "label": ""
        }
      },
      "AuthorizationListResponse": {
        "type": "object",
        "required": [
          "authorizations"
        ],
        "properties": {
          "authorizations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AuthorizationListItem"
            }
          }
        }
      },
      "AuthorizationListItem": {
        "type": "object",
        "required": [
          "approver_id",
          "approver_type",
          "approving_key",
          "authorization_id",
          "label"
        ],
        "properties": {
          "authorization_id": {
            "description": "Authorization ID",
            "type": "string"
          },
          "approver_id": {
            "description": "Approver ID",
            "type": "string"
          },
          "wallet_id": {
            "description": "Wallet ID this authorization is assigned to, or null if unassigned",
            "type": "string",
            "nullable": true
          },
          "wallet_label": {
            "description": "Label of the assigned wallet, or null if unassigned",
            "type": "string",
            "nullable": true
          },
          "approving_key": {
            "description": "Approving public key (66 hex chars)",
            "type": "string"
          },
          "encryption_key": {
            "description": "Encryption public key (64 hex chars), if set",
            "type": "string",
            "nullable": true
          },
          "approver_type": {
            "description": "Approver type",
            "allOf": [
              {
                "$ref": "#/components/schemas/ApproverType"
              }
            ]
          },
          "label": {
            "description": "Label used when the passkey was created",
            "type": "string"
          }
        }
      },
      "AuthorizationRemoveResponse": {
        "type": "object",
        "required": [
          "authorization_id"
        ],
        "properties": {
          "authorization_id": {
            "description": "ID of the deleted authorization",
            "type": "string"
          }
        }
      },
      "WalletAddResponse": {
        "type": "object",
        "required": [
          "wallet_id"
        ],
        "properties": {
          "wallet_id": {
            "description": "Wallet ID of the new wallet",
            "type": "string"
          }
        }
      },
      "WalletAddRequest": {
        "type": "object",
        "required": [
          "approvers",
          "custodial",
          "label",
          "threshold"
        ],
        "properties": {
          "label": {
            "description": "Display label for the wallet",
            "type": "string"
          },
          "threshold": {
            "description": "Threshold of approvers required to sign a transaction",
            "type": "integer",
            "format": "uint8",
            "minimum": 0.0
          },
          "approvers": {
            "description": "List of approvers' public keys",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "custodial": {
            "description": "Whether the wallet is custodial or non-custodial",
            "type": "boolean"
          },
          "encrypted_hsm_share": {
            "description": "Optional encrypted HSM share for non-custodial wallets (not required for custodial wallets)",
            "type": "string",
            "nullable": true
          },
          "encrypted_client_shares": {
            "description": "Optional encrypted client shares for non-custodial wallets (not required for custodial wallets)",
            "type": "array",
            "items": {
              "type": "array",
              "items": [
                {
                  "type": "string"
                },
                {
                  "type": "string"
                }
              ],
              "maxItems": 2,
              "minItems": 2
            },
            "nullable": true
          }
        },
        "example": {
          "approvers": [
            "032d4857675adebaf06f3a7e643ba78c3ac476a60c930fb300f71cfd967ddb0c43",
            "025152bf606a9c5a8ee2bfee72659dd62f9ce943c4ac0edabd0a46651eed2bba30",
            "021a55df1fc74e82df506a46ed38642c3497c8cc1794a116347a10603de037d525"
          ],
          "custodial": true,
          "encrypted_client_shares": null,
          "encrypted_hsm_share": null,
          "label": "Test Wallet",
          "threshold": 2
        }
      },
      "WalletAuthorizationListResponse": {
        "type": "object",
        "required": [
          "authorizations"
        ],
        "properties": {
          "authorizations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WalletAuthorizationListItem"
            }
          }
        }
      },
      "WalletAuthorizationListItem": {
        "type": "object",
        "required": [
          "approver_email",
          "approver_id",
          "approver_name",
          "approver_type",
          "approving_key",
          "authorization_id",
          "label"
        ],
        "properties": {
          "authorization_id": {
            "description": "Authorization ID",
            "type": "string"
          },
          "approver_id": {
            "description": "Approver ID",
            "type": "string"
          },
          "approving_key": {
            "description": "Approving public key (66 hex chars)",
            "type": "string"
          },
          "encryption_key": {
            "description": "Encryption public key (64 hex chars), if set",
            "type": "string",
            "nullable": true
          },
          "approver_type": {
            "description": "Approver type",
            "allOf": [
              {
                "$ref": "#/components/schemas/ApproverType"
              }
            ]
          },
          "label": {
            "description": "Label used when the passkey was created",
            "type": "string"
          },
          "approver_name": {
            "description": "Approver name",
            "type": "string"
          },
          "approver_email": {
            "description": "Approver email",
            "type": "string"
          }
        }
      },
      "WalletGetResponse": {
        "type": "object",
        "required": [
          "wallet_data"
        ],
        "properties": {
          "wallet_data": {
            "$ref": "#/components/schemas/WalletData"
          }
        }
      },
      "WalletData": {
        "type": "object",
        "required": [
          "approvers",
          "asset_policies",
          "custodial",
          "id",
          "label",
          "threshold",
          "transaction_windows",
          "version"
        ],
        "properties": {
          "version": {
            "description": "Version of the wallet data format",
            "type": "integer",
            "format": "uint8",
            "minimum": 0.0
          },
          "id": {
            "description": "Wallet ID",
            "type": "string"
          },
          "label": {
            "description": "Display label for the wallet",
            "type": "string"
          },
          "threshold": {
            "description": "Threshold of approvers required to sign a transaction",
            "type": "integer",
            "format": "uint8",
            "minimum": 0.0
          },
          "custodial": {
            "description": "Whether the wallet is custodial or non-custodial",
            "type": "boolean"
          },
          "approvers": {
            "description": "List of approvers' approving_key 33B (secp256k1 public key with 0x02/0x03 prefix) and optional encryption_key 32B (x25519 public key) public keys",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "transaction_windows": {
            "description": "Recurring weekly windows during which transaction signing is permitted, expressed in the OSM `opening_hours` dialect. `\"24/7\"` means always allowed. Otherwise a `'; '`-separated list of `<day-range> HH:MM-HH:MM (UTC-offset)` entries. Every entry MUST end with a `(UTC[±H[:MM]])` suffix to fix that tx_window's timezone offset, e.g. `\"Mo-Fr 09:00-17:00 (UTC)\"`, `\"Mo-Fr 09:00-17:00 (UTC-5); Sa 10:00-14:00 (UTC+9)\"`. Plain `\"(UTC)\"` denotes zero offset.",
            "type": "string"
          },
          "asset_policies": {
            "description": "Per-coin policy constraints. At most one policy per coin.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AssetPolicy"
            }
          }
        }
      },
      "AssetPolicy": {
        "type": "object",
        "required": [
          "coin",
          "max_amount",
          "to_addresses"
        ],
        "properties": {
          "coin": {
            "$ref": "#/components/schemas/Coin"
          },
          "max_amount": {
            "type": "string"
          },
          "to_addresses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SavedAddress"
            }
          }
        }
      },
      "Coin": {
        "type": "string",
        "enum": [
          "BTC",
          "ETH",
          "USDT"
        ]
      },
      "SavedAddress": {
        "type": "object",
        "required": [
          "address",
          "label"
        ],
        "properties": {
          "label": {
            "type": "string"
          },
          "address": {
            "type": "string"
          }
        }
      },
      "WalletListResponse": {
        "type": "object",
        "required": [
          "wallets"
        ],
        "properties": {
          "wallets": {
            "description": "All wallets for the authenticated client",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WalletListItem"
            }
          }
        }
      },
      "WalletListItem": {
        "type": "object",
        "required": [
          "approvable_request_count",
          "approver_count",
          "custodial",
          "label",
          "pending_request_count",
          "threshold",
          "wallet_id"
        ],
        "properties": {
          "wallet_id": {
            "description": "Wallet ID",
            "type": "string"
          },
          "label": {
            "description": "Display label",
            "type": "string"
          },
          "threshold": {
            "description": "Number of approvers required to sign",
            "type": "integer",
            "format": "uint8",
            "minimum": 0.0
          },
          "custodial": {
            "description": "Custodial vs. non-custodial",
            "type": "boolean"
          },
          "approver_count": {
            "description": "Number of approvers currently assigned to this wallet",
            "type": "integer",
            "format": "uint32",
            "minimum": 0.0
          },
          "pending_request_count": {
            "description": "Number of requests on this wallet still awaiting approval",
            "type": "integer",
            "format": "uint32",
            "minimum": 0.0
          },
          "approvable_request_count": {
            "description": "Number of pending requests the calling approver can still approve",
            "type": "integer",
            "format": "uint32",
            "minimum": 0.0
          }
        }
      },
      "WalletUpdateResponse": {
        "type": "object",
        "required": [
          "wallet_id"
        ],
        "properties": {
          "wallet_id": {
            "description": "Wallet ID of the updated wallet",
            "type": "string"
          }
        }
      },
      "WalletUpdateRequest": {
        "type": "object",
        "required": [
          "approvals",
          "request_type",
          "wallet_data"
        ],
        "properties": {
          "request_type": {
            "description": "Type of update: AuthorizationUpdate (approvers/threshold) or PolicyUpdate (transaction_windows/asset_policies). The vault rejects requests that mutate fields outside the declared class.",
            "allOf": [
              {
                "$ref": "#/components/schemas/RequestType"
              }
            ]
          },
          "wallet_data": {
            "description": "New wallet state",
            "allOf": [
              {
                "$ref": "#/components/schemas/WalletData"
              }
            ]
          },
          "approvals": {
            "description": "Approver signatures authorizing this update",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Approval"
            }
          },
          "encrypted_hsm_share": {
            "description": "Optional encrypted HSM share for non-custodial wallets (not required for custodial wallets)",
            "type": "string",
            "nullable": true
          },
          "encrypted_client_shares": {
            "description": "Optional encrypted client shares for non-custodial wallets (not required for custodial wallets)",
            "type": "array",
            "items": {
              "type": "array",
              "items": [
                {
                  "type": "string"
                },
                {
                  "type": "string"
                }
              ],
              "maxItems": 2,
              "minItems": 2
            },
            "nullable": true
          }
        },
        "example": {
          "approvals": [
            {
              "mechanism": "Pure",
              "mechanism_data": "",
              "pubkey": "032d4857675adebaf06f3a7e643ba78c3ac476a60c930fb300f71cfd967ddb0c43",
              "signature": "0f1acce48368baed9ca88345c3ba10fdb2b5a774214e65fa154f3e23ecc884b4c6d74ea496e82ad3b191d05912592e01ab0befb867ab63853e82b49ff2c975ac"
            },
            {
              "mechanism": "Pure",
              "mechanism_data": "",
              "pubkey": "025152bf606a9c5a8ee2bfee72659dd62f9ce943c4ac0edabd0a46651eed2bba30",
              "signature": "9d06eac6651bad9045b69c22c058b4e2e3b24a85e0927cfd10c01468600a9c881838b03f129b5a59fafc0b152da7376d8bae7302a82dc348c609e73fc0fdaaf7"
            }
          ],
          "encrypted_client_shares": null,
          "encrypted_hsm_share": null,
          "request_type": "AuthorizationUpdate",
          "wallet_data": {
            "approvers": [
              "032d4857675adebaf06f3a7e643ba78c3ac476a60c930fb300f71cfd967ddb0c43",
              "025152bf606a9c5a8ee2bfee72659dd62f9ce943c4ac0edabd0a46651eed2bba30",
              "021a55df1fc74e82df506a46ed38642c3497c8cc1794a116347a10603de037d525"
            ],
            "asset_policies": [],
            "custodial": true,
            "id": "1234605616436508552",
            "label": "Test Wallet",
            "threshold": 2,
            "transaction_windows": "24/7",
            "version": 1
          }
        }
      },
      "RequestType": {
        "type": "string",
        "enum": [
          "AuthorizationUpdate",
          "Transaction",
          "PolicyUpdate"
        ]
      },
      "Approval": {
        "type": "object",
        "required": [
          "mechanism",
          "mechanism_data",
          "pubkey",
          "signature"
        ],
        "properties": {
          "pubkey": {
            "type": "string"
          },
          "signature": {
            "type": "string"
          },
          "mechanism": {
            "$ref": "#/components/schemas/Mechanism"
          },
          "mechanism_data": {
            "type": "string"
          }
        }
      },
      "Mechanism": {
        "type": "string",
        "enum": [
          "Pure",
          "WebAuthn"
        ]
      },
      "AddressGenerateResponse": {
        "type": "object",
        "required": [
          "address"
        ],
        "properties": {
          "address": {
            "description": "New address generated on the vault",
            "type": "string"
          }
        }
      },
      "ApiNetwork": {
        "$ref": "#/components/schemas/Network"
      },
      "Network": {
        "type": "string",
        "enum": [
          "Bitcoin",
          "Ethereum"
        ]
      },
      "AddressListResponse": {
        "type": "object",
        "required": [
          "addresses"
        ],
        "properties": {
          "addresses": {
            "description": "Existing addresses on the vault",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "TransactionPostResponse": {
        "type": "object",
        "required": [
          "tx_hash"
        ],
        "properties": {
          "tx_hash": {
            "type": "string"
          }
        }
      },
      "TransactionPostRequest": {
        "type": "object",
        "required": [
          "approval_data",
          "approvals"
        ],
        "properties": {
          "approval_data": {
            "$ref": "#/components/schemas/ApprovalData"
          },
          "approvals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Approval"
            }
          }
        },
        "example": {
          "approval_data": {
            "amount": "1000000",
            "coin": "BTC",
            "fee": "1000",
            "from": "bcrt1q52dee6y5k93ppk32j94l2gnx4x0qveeywlu7zn",
            "network": "Bitcoin",
            "nonce": "1234605616436508552",
            "to": "bcrt1q6e8dwy92pchev7jlvt3p9d97npst723usq90pr",
            "version": 1
          },
          "approvals": [
            {
              "mechanism": "Pure",
              "mechanism_data": "",
              "pubkey": "032d4857675adebaf06f3a7e643ba78c3ac476a60c930fb300f71cfd967ddb0c43",
              "signature": "25a1e6a6e68d579d2204f9418c3d44a160c356cc3056529a0855212e93082fbbcd479e92cbca3a44325455b50b9af599b9ea5e7a7491c11988cc12f8984b1b63"
            },
            {
              "mechanism": "Pure",
              "mechanism_data": "",
              "pubkey": "025152bf606a9c5a8ee2bfee72659dd62f9ce943c4ac0edabd0a46651eed2bba30",
              "signature": "81a08e40afb7528bbdcd2b9dda2e1063cfa352e8100b66424ea3849fbd66aaaeae86104b575e94f18bb39ef15c0c016a8d1a76e893f139909b46627e66bdc11d"
            }
          ]
        }
      },
      "ApprovalData": {
        "type": "object",
        "required": [
          "amount",
          "coin",
          "fee",
          "from",
          "network",
          "nonce",
          "to",
          "version"
        ],
        "properties": {
          "version": {
            "type": "integer",
            "format": "uint8",
            "minimum": 0.0
          },
          "nonce": {
            "type": "string"
          },
          "amount": {
            "type": "string"
          },
          "coin": {
            "$ref": "#/components/schemas/Coin"
          },
          "fee": {
            "type": "string"
          },
          "network": {
            "$ref": "#/components/schemas/Network"
          },
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          }
        }
      },
      "SignRound1Response": {
        "type": "object",
        "required": [
          "co_signer_enc_client_share",
          "co_signer_pubkey",
          "mpc_messages",
          "mpc_tx_id"
        ],
        "properties": {
          "mpc_tx_id": {
            "type": "string"
          },
          "co_signer_pubkey": {
            "type": "string"
          },
          "co_signer_enc_client_share": {
            "type": "string"
          },
          "mpc_messages": {
            "type": "string"
          }
        }
      },
      "TransactionPostRound1Request": {
        "type": "object",
        "required": [
          "approval_data",
          "approvals"
        ],
        "properties": {
          "approval_data": {
            "$ref": "#/components/schemas/ApprovalData"
          },
          "approvals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Approval"
            }
          }
        },
        "example": {
          "approval_data": {
            "amount": "1000000",
            "coin": "BTC",
            "fee": "1000",
            "from": "bcrt1q52dee6y5k93ppk32j94l2gnx4x0qveeywlu7zn",
            "network": "Bitcoin",
            "nonce": "1234605616436508552",
            "to": "bcrt1q6e8dwy92pchev7jlvt3p9d97npst723usq90pr",
            "version": 1
          },
          "approvals": [
            {
              "mechanism": "Pure",
              "mechanism_data": "",
              "pubkey": "032d4857675adebaf06f3a7e643ba78c3ac476a60c930fb300f71cfd967ddb0c43",
              "signature": "25a1e6a6e68d579d2204f9418c3d44a160c356cc3056529a0855212e93082fbbcd479e92cbca3a44325455b50b9af599b9ea5e7a7491c11988cc12f8984b1b63"
            },
            {
              "mechanism": "Pure",
              "mechanism_data": "",
              "pubkey": "025152bf606a9c5a8ee2bfee72659dd62f9ce943c4ac0edabd0a46651eed2bba30",
              "signature": "81a08e40afb7528bbdcd2b9dda2e1063cfa352e8100b66424ea3849fbd66aaaeae86104b575e94f18bb39ef15c0c016a8d1a76e893f139909b46627e66bdc11d"
            }
          ]
        }
      },
      "TransactionPostRound2Response": {
        "type": "object",
        "required": [
          "tx_hash"
        ],
        "properties": {
          "tx_hash": {
            "type": "string"
          }
        }
      },
      "TransactionPostRound2Request": {
        "type": "object",
        "required": [
          "mpc_messages",
          "mpc_tx_id"
        ],
        "properties": {
          "mpc_tx_id": {
            "type": "string"
          },
          "mpc_messages": {
            "type": "string"
          }
        },
        "example": {
          "mpc_messages": "",
          "mpc_tx_id": "7003007892889639312"
        }
      },
      "TransactionListResponse": {
        "type": "object",
        "required": [
          "transactions"
        ],
        "properties": {
          "transactions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TransactionItem"
            }
          }
        }
      },
      "TransactionItem": {
        "description": "Unified transaction row returned to the wallet. Both Sends and Receives are sourced from `tbl_transaction`; on each list call the server also pulls fresh chain history for the wallet's addresses and inserts any previously-unseen Receives into the DB so subsequent reads are cached.",
        "type": "object",
        "required": [
          "amount",
          "asset",
          "created_at",
          "explore_link",
          "from",
          "network",
          "status",
          "to",
          "transaction_id",
          "transaction_type",
          "tx_hash",
          "wallet_id"
        ],
        "properties": {
          "transaction_id": {
            "type": "string"
          },
          "wallet_id": {
            "type": "string"
          },
          "request_id": {
            "type": "string",
            "nullable": true
          },
          "transaction_type": {
            "$ref": "#/components/schemas/TransactionType"
          },
          "asset": {
            "$ref": "#/components/schemas/Coin"
          },
          "network": {
            "$ref": "#/components/schemas/Network"
          },
          "amount": {
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/TransactionStatus"
          },
          "created_at": {
            "type": "string"
          },
          "tx_hash": {
            "type": "string"
          },
          "explore_link": {
            "type": "string"
          }
        }
      },
      "TransactionType": {
        "type": "string",
        "enum": [
          "Send",
          "Receive"
        ]
      },
      "TransactionStatus": {
        "type": "string",
        "enum": [
          "Submitted",
          "Confirmed",
          "Failed"
        ]
      },
      "BalanceGetResponse": {
        "type": "object",
        "required": [
          "detail",
          "sum"
        ],
        "properties": {
          "sum": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CoinAmount"
            }
          },
          "detail": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AddressCoinAmount"
            }
          }
        }
      },
      "CoinAmount": {
        "type": "object",
        "required": [
          "amount",
          "coin"
        ],
        "properties": {
          "coin": {
            "$ref": "#/components/schemas/Coin"
          },
          "amount": {
            "type": "integer",
            "format": "uint128",
            "minimum": 0.0
          }
        }
      },
      "AddressCoinAmount": {
        "type": "object",
        "required": [
          "address",
          "coin_amounts"
        ],
        "properties": {
          "address": {
            "type": "string"
          },
          "coin_amounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CoinAmount"
            }
          }
        }
      },
      "RequestAddResponse": {
        "type": "object",
        "required": [
          "request_id",
          "request_status"
        ],
        "properties": {
          "request_id": {
            "type": "string"
          },
          "request_status": {
            "description": "Status of the request after the creator's first approval has been recorded",
            "allOf": [
              {
                "$ref": "#/components/schemas/RequestStatus"
              }
            ]
          },
          "sign_round1_response": {
            "description": "For non-custodial transaction requests whose threshold is met immediately (e.g. threshold=1), the MPC round1 payload that the creator must forward through approver `coSign` and back via `/transactions/round2`. Absent when round1 didn't fire (custodial wallet, threshold not yet met, etc.).",
            "allOf": [
              {
                "$ref": "#/components/schemas/SignRound1Response"
              }
            ],
            "nullable": true
          }
        }
      },
      "RequestStatus": {
        "type": "string",
        "enum": [
          "Approving",
          "Approved",
          "Done",
          "Rejected",
          "Failed"
        ]
      },
      "RequestAddRequest": {
        "type": "object",
        "required": [
          "approval_payload_json",
          "authorization_id",
          "request_payload_json",
          "request_type"
        ],
        "properties": {
          "request_type": {
            "description": "0 = WalletUpdate, 1 = Transaction (sign + send)",
            "allOf": [
              {
                "$ref": "#/components/schemas/RequestType"
              }
            ]
          },
          "request_payload_json": {
            "description": "Serialized request payload: - WalletUpdate: JSON-encoded shared::WalletData - Transaction: JSON-encoded shared::ApprovalData (nonce assigned by the creator)",
            "type": "string"
          },
          "authorization_id": {
            "description": "Authorization row of the creator (used to record the creator's first approval). Must belong to the authenticated client and to this wallet.",
            "type": "string"
          },
          "approval_payload_json": {
            "description": "Creator's first approval, JSON-encoded (e.g. JSON-encoded shared::Approval).",
            "type": "string"
          },
          "comment": {
            "description": "Optional free-form comment",
            "default": "",
            "type": "string"
          },
          "encrypted_hsm_share": {
            "description": "Non-custodial WalletUpdate reshare output: hex-encoded server-side share encrypted with the HSM's import key. Required for non-custodial WalletUpdate requests; must be None otherwise.",
            "default": null,
            "type": "string",
            "nullable": true
          },
          "encrypted_client_shares": {
            "description": "Non-custodial WalletUpdate reshare output: per-approver encrypted client shares as (encryption_pubkey_hex, encrypted_share_hex). Required for non-custodial WalletUpdate requests; must be None otherwise.",
            "default": null,
            "type": "array",
            "items": {
              "type": "array",
              "items": [
                {
                  "type": "string"
                },
                {
                  "type": "string"
                }
              ],
              "maxItems": 2,
              "minItems": 2
            },
            "nullable": true
          }
        }
      },
      "RequestListResponse": {
        "type": "object",
        "required": [
          "requests"
        ],
        "properties": {
          "requests": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RequestListItem"
            }
          }
        }
      },
      "RequestListItem": {
        "type": "object",
        "required": [
          "approved_by_authorization_ids",
          "comment",
          "created_at",
          "request_id",
          "request_payload_json",
          "request_type",
          "status",
          "wallet_id"
        ],
        "properties": {
          "request_id": {
            "type": "string"
          },
          "wallet_id": {
            "type": "string"
          },
          "request_type": {
            "$ref": "#/components/schemas/RequestType"
          },
          "status": {
            "$ref": "#/components/schemas/RequestStatus"
          },
          "request_payload_json": {
            "type": "string"
          },
          "comment": {
            "type": "string"
          },
          "approved_by_authorization_ids": {
            "description": "Authorization IDs that have cast a non-rejection approval on this request",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "created_at": {
            "description": "Creation timestamp in RFC3339 (UTC).",
            "type": "string"
          }
        }
      },
      "RequestGetResponse": {
        "type": "object",
        "required": [
          "approvals",
          "comment",
          "created_at",
          "created_by_approver_id",
          "created_by_email",
          "created_by_name",
          "request_id",
          "request_payload_json",
          "request_type",
          "status",
          "wallet_id"
        ],
        "properties": {
          "request_id": {
            "type": "string"
          },
          "wallet_id": {
            "type": "string"
          },
          "request_type": {
            "$ref": "#/components/schemas/RequestType"
          },
          "status": {
            "$ref": "#/components/schemas/RequestStatus"
          },
          "request_payload_json": {
            "type": "string"
          },
          "comment": {
            "type": "string"
          },
          "approvals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApprovalItem"
            }
          },
          "created_at": {
            "description": "Creation timestamp in RFC3339 (UTC).",
            "type": "string"
          },
          "created_by_approver_id": {
            "type": "string"
          },
          "created_by_name": {
            "type": "string"
          },
          "created_by_email": {
            "type": "string"
          },
          "transaction": {
            "description": "For Transaction requests with status Done: the broadcast transaction row. None for WalletUpdate requests or transactions not yet broadcast.",
            "allOf": [
              {
                "$ref": "#/components/schemas/TransactionItem"
              }
            ],
            "nullable": true
          },
          "fail_reason": {
            "description": "Populated when `status == Failed`: explains why the request failed.",
            "type": "string",
            "nullable": true
          }
        }
      },
      "ApprovalItem": {
        "type": "object",
        "required": [
          "approval_id",
          "approval_payload_json",
          "approver_email",
          "approver_id",
          "approver_name",
          "authorization_id",
          "created_at"
        ],
        "properties": {
          "approval_id": {
            "type": "string"
          },
          "authorization_id": {
            "type": "string"
          },
          "approval_payload_json": {
            "type": "string"
          },
          "rejection_reason": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "description": "Approval creation timestamp in RFC3339 (UTC).",
            "type": "string"
          },
          "approver_id": {
            "type": "string"
          },
          "approver_name": {
            "type": "string"
          },
          "approver_email": {
            "type": "string"
          }
        }
      },
      "ApprovalAddResponse": {
        "type": "object",
        "required": [
          "approval_id",
          "request_status"
        ],
        "properties": {
          "approval_id": {
            "type": "string"
          },
          "request_status": {
            "description": "New status of the parent request",
            "allOf": [
              {
                "$ref": "#/components/schemas/RequestStatus"
              }
            ]
          },
          "sign_round1_response": {
            "description": "For non-custodial transaction requests whose threshold was met by this approval, the MPC round1 payload that this approver must forward through `coSign` and back via `/transactions/round2`. Absent otherwise.",
            "allOf": [
              {
                "$ref": "#/components/schemas/SignRound1Response"
              }
            ],
            "nullable": true
          }
        }
      },
      "ApprovalAddRequest": {
        "type": "object",
        "required": [
          "authorization_id"
        ],
        "properties": {
          "authorization_id": {
            "description": "Authorization row used to produce the signature (must belong to the client and to this wallet)",
            "type": "string"
          },
          "approval_payload_json": {
            "description": "Serialized approval payload (e.g. JSON-encoded shared::Approval) when approving (omit `rejection_reason`)",
            "default": null,
            "type": "string",
            "nullable": true
          },
          "rejection_reason": {
            "description": "Reason for rejection; provide exactly this when rejecting (omit `approval_payload_json`)",
            "default": null,
            "type": "string",
            "nullable": true
          }
        }
      },
      "LogListResponse": {
        "type": "object",
        "required": [
          "logs"
        ],
        "properties": {
          "logs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LogItem"
            }
          }
        }
      },
      "LogItem": {
        "description": "One audit log row, formatted for the wallet UI / external auditing tools. IDs are serialized as decimal strings because JS can't represent i64.",
        "type": "object",
        "required": [
          "action",
          "actor_id",
          "actor_name",
          "actor_type",
          "client_id",
          "created_at",
          "log_id",
          "result",
          "target_id",
          "target_type"
        ],
        "properties": {
          "log_id": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "client_id": {
            "type": "string"
          },
          "wallet_id": {
            "type": "string",
            "nullable": true
          },
          "actor_id": {
            "type": "string"
          },
          "actor_type": {
            "$ref": "#/components/schemas/LogActorType"
          },
          "target_id": {
            "type": "string"
          },
          "target_type": {
            "$ref": "#/components/schemas/LogTargetType"
          },
          "action": {
            "$ref": "#/components/schemas/LogAction"
          },
          "result": {
            "$ref": "#/components/schemas/LogResult"
          },
          "actor_name": {
            "type": "string"
          },
          "actor_email": {
            "type": "string",
            "nullable": true
          },
          "actor_ip": {
            "type": "string",
            "nullable": true
          },
          "fail_reason": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "LogActorType": {
        "description": "Who performed an audited action.",
        "type": "string",
        "enum": [
          "Client",
          "Approver"
        ]
      },
      "LogTargetType": {
        "description": "What kind of entity the audit log's `target_id` points to. Stored as the explicit i16 discriminant in `tbl_log.target_type`. Wire format is the variant name (e.g. `\"Wallet\"`). Discriminants must never be reused or renumbered: existing rows reference them by value.",
        "type": "string",
        "enum": [
          "Client",
          "Approver",
          "Authorization",
          "Request",
          "Approval",
          "Wallet",
          "Transaction",
          "Address"
        ]
      },
      "LogAction": {
        "description": "Stable taxonomy of audit log actions. Stored as the explicit i16 discriminant in `tbl_log.action`. The JSON wire format uses serde's default — the variant name verbatim (e.g. `\"WalletCreate\"`) — which is also what the wallet UI renders, so no separate string mapping is needed. Discriminants must never be reused or renumbered: existing rows reference them by value.",
        "type": "string",
        "enum": [
          "WalletCreate",
          "WalletUpdate",
          "AddressGenerate",
          "ApproverCreate",
          "ApproverRemove",
          "ApproverPasswordChange",
          "AuthorizationAssign",
          "AuthorizationUnassign",
          "RequestCreate",
          "RequestApprove",
          "RequestReject",
          "TransactionBroadcast",
          "TransactionMpcRound1",
          "TransactionMpcRound2",
          "ClientCreate",
          "ClientUpdate",
          "AuthLoginSuccess",
          "AuthLoginFailure",
          "RequestProcessApproved",
          "RequestProcessCompleted",
          "RequestProcessFailed",
          "AuthLogout"
        ]
      },
      "LogResult": {
        "type": "string",
        "enum": [
          "Success",
          "Failure"
        ]
      },
      "LogTargetResponse": {
        "description": "Response wrapper for the polymorphic log-target lookup. `target` is the fetched entity's fields as a JSON object (the shape varies by `target_type`), or `null` when the target row no longer exists — the audit log keeps no DB-level FKs precisely so a deleted entity does not orphan or block its log rows.",
        "type": "object",
        "properties": {
          "target": {
            "nullable": true
          }
        }
      },
      "NonceGenerateResponse": {
        "type": "object",
        "required": [
          "nonce"
        ],
        "properties": {
          "nonce": {
            "type": "string"
          }
        }
      },
      "RandomGenerateResponse": {
        "type": "object",
        "required": [
          "random_bytes"
        ],
        "properties": {
          "random_bytes": {
            "type": "string"
          }
        }
      },
      "RandomGenerateRequest": {
        "type": "object",
        "required": [
          "length"
        ],
        "properties": {
          "length": {
            "description": "Length of random bytes to generate (in bytes)",
            "type": "integer",
            "format": "uint32",
            "minimum": 0.0
          }
        }
      },
      "PubkeyResponse": {
        "type": "object",
        "required": [
          "pubkey"
        ],
        "properties": {
          "pubkey": {
            "type": "string"
          }
        }
      },
      "FeeGetResponse": {
        "type": "object",
        "required": [
          "fast",
          "regular"
        ],
        "properties": {
          "regular": {
            "type": "integer",
            "format": "uint128",
            "minimum": 0.0
          },
          "fast": {
            "type": "integer",
            "format": "uint128",
            "minimum": 0.0
          }
        }
      }
    }
  }
}