{
  "openrpc": "1.0.0-rc1",
  "info": {
    "title": "Monero OpenRPC Specification",
    "version": "0.2.0",
    "description": "OpenRPC specification for Monero's JSON-RPC interfaces (monerod daemon + monero-wallet-rpc). Deliverable for the bounties.monero.social 'Monero OpenRPC Specification' bounty (1.213 XMR). Amounts are atomic units (piconero) as integers; addresses/txids are strings. Authored by Clara Oswald (disclosed automated operator of the XMR Income Engine). XMR tip/payout: 45bovHGLsAgihEWXgjoTwuBaUq1LogHCjeBYBN3xfN4J7gspatfQtb2WsyfsqX4dqMWUPXAEYFKV88zf9BpDFMM3HjnA7MC. Schemas reflect common RPC method signatures; confirm field lists against your daemon/wallet-rpc version.",
    "license": {
      "name": "MIT"
    }
  },
  "servers": [
    {
      "name": "monero-daemon",
      "url": "http://localhost:18081/json_rpc"
    },
    {
      "name": "monero-wallet-rpc",
      "url": "http://localhost:18083/json_rpc"
    }
  ],
  "methods": [
    {
      "name": "get_height",
      "summary": "Current blockchain height of the daemon.",
      "servers": [
        {
          "name": "monero-daemon"
        }
      ],
      "params": [],
      "result": {
        "name": "result",
        "schema": {
          "type": "object",
          "properties": {
            "height": {
              "type": "integer",
              "description": "Top block height (genesis = 1)."
            },
            "status": {
              "type": "string"
            },
            "untrusted": {
              "type": "boolean"
            }
          },
          "required": [
            "height",
            "status"
          ]
        }
      }
    },
    {
      "name": "get_info",
      "summary": "Various daemon state info.",
      "servers": [
        {
          "name": "monero-daemon"
        }
      ],
      "params": [],
      "result": {
        "name": "result",
        "schema": {
          "type": "object",
          "properties": {
            "height": {
              "type": "integer"
            },
            "target_height": {
              "type": "integer"
            },
            "difficulty": {
              "type": "integer"
            },
            "tx_count": {
              "type": "integer"
            },
            "tx_pool_size": {
              "type": "integer"
            },
            "incoming_connections_count": {
              "type": "integer"
            },
            "outgoing_connections_count": {
              "type": "integer"
            },
            "status": {
              "type": "string"
            }
          }
        }
      }
    },
    {
      "name": "get_version",
      "summary": "Daemon or wallet version.",
      "servers": [
        {
          "name": "monero-daemon"
        },
        {
          "name": "monero-wallet-rpc"
        }
      ],
      "params": [],
      "result": {
        "name": "result",
        "schema": {
          "type": "object",
          "properties": {
            "version": {
              "type": "integer",
              "description": "Version as 0xMMMMmmuu (major/minor/micro)."
            },
            "release": {
              "type": "boolean",
              "description": "True if this is an official release build."
            }
          },
          "required": [
            "version"
          ]
        }
      }
    },
    {
      "name": "get_block",
      "summary": "Block header + (optional) blob by height or hash.",
      "servers": [
        {
          "name": "monero-daemon"
        }
      ],
      "params": [
        {
          "name": "height",
          "required": false,
          "schema": {
            "type": "integer"
          }
        },
        {
          "name": "hash",
          "required": false,
          "schema": {
            "type": "string"
          }
        }
      ],
      "result": {
        "name": "result",
        "schema": {
          "type": "object",
          "properties": {
            "blob": {
              "type": "string"
            },
            "block_header": {
              "type": "object"
            },
            "json": {
              "type": "object"
            },
            "status": {
              "type": "string"
            }
          }
        }
      }
    },
    {
      "name": "send_raw_transaction",
      "summary": "Relay a raw hex transaction to the network.",
      "servers": [
        {
          "name": "monero-daemon"
        }
      ],
      "params": [
        {
          "name": "tx_as_hex",
          "required": true,
          "schema": {
            "type": "string",
            "description": "Signed tx hex."
          }
        }
      ],
      "result": {
        "name": "result",
        "schema": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string"
            },
            "tx_hash": {
              "type": "string"
            },
            "reason": {
              "type": "string"
            }
          },
          "required": [
            "status"
          ]
        }
      }
    },
    {
      "name": "get_balance",
      "summary": "Wallet balance for an account.",
      "servers": [
        {
          "name": "monero-wallet-rpc"
        }
      ],
      "params": [
        {
          "name": "account_index",
          "required": true,
          "schema": {
            "type": "integer"
          }
        },
        {
          "name": "address_indices",
          "required": false,
          "schema": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          }
        }
      ],
      "result": {
        "name": "result",
        "schema": {
          "type": "object",
          "properties": {
            "balance": {
              "type": "integer",
              "description": "Total, atomic units."
            },
            "unlocked_balance": {
              "type": "integer",
              "description": "Spendable, atomic units."
            },
            "per_subaddress": {
              "type": "array",
              "items": {
                "type": "object"
              }
            }
          },
          "required": [
            "balance",
            "unlocked_balance"
          ]
        }
      }
    },
    {
      "name": "get_address",
      "summary": "Wallet address(es) for an account.",
      "servers": [
        {
          "name": "monero-wallet-rpc"
        }
      ],
      "params": [
        {
          "name": "account_index",
          "required": true,
          "schema": {
            "type": "integer"
          }
        },
        {
          "name": "address_index",
          "required": false,
          "schema": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          }
        }
      ],
      "result": {
        "name": "result",
        "schema": {
          "type": "object",
          "properties": {
            "address": {
              "type": "string"
            },
            "addresses": {
              "type": "array",
              "items": {
                "type": "object"
              }
            }
          },
          "required": [
            "address"
          ]
        }
      }
    },
    {
      "name": "make_integrated_address",
      "summary": "Build an integrated address (standard address + 64-hex payment id).",
      "servers": [
        {
          "name": "monero-wallet-rpc"
        }
      ],
      "params": [
        {
          "name": "standard_address",
          "required": false,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "payment_id",
          "required": false,
          "schema": {
            "type": "string",
            "description": "Optional 64-hex payment id; random if omitted."
          }
        }
      ],
      "result": {
        "name": "result",
        "schema": {
          "type": "object",
          "properties": {
            "integrated_address": {
              "type": "string"
            },
            "payment_id": {
              "type": "string"
            }
          },
          "required": [
            "integrated_address",
            "payment_id"
          ]
        }
      }
    },
    {
      "name": "get_payments",
      "summary": "Incoming payments matching a payment id.",
      "servers": [
        {
          "name": "monero-wallet-rpc"
        }
      ],
      "params": [
        {
          "name": "payment_id",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "result": {
        "name": "result",
        "schema": {
          "type": "object",
          "properties": {
            "payments": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "payment_id": {
                    "type": "string"
                  },
                  "tx_hash": {
                    "type": "string"
                  },
                  "amount": {
                    "type": "integer"
                  },
                  "block_height": {
                    "type": "integer"
                  },
                  "unlock_time": {
                    "type": "integer"
                  },
                  "subaddr_index": {
                    "type": "object"
                  }
                }
              }
            }
          }
        }
      }
    },
    {
      "name": "transfer",
      "summary": "Send XMR to one or more destinations.",
      "servers": [
        {
          "name": "monero-wallet-rpc"
        }
      ],
      "params": [
        {
          "name": "destinations",
          "required": true,
          "schema": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "amount": {
                  "type": "integer",
                  "description": "Atomic units."
                },
                "address": {
                  "type": "string"
                }
              },
              "required": [
                "amount",
                "address"
              ]
            }
          }
        },
        {
          "name": "account_index",
          "required": false,
          "schema": {
            "type": "integer",
            "default": 0
          }
        },
        {
          "name": "priority",
          "required": false,
          "schema": {
            "type": "integer",
            "description": "1 slow .. 4 fastest."
          }
        },
        {
          "name": "payment_id",
          "required": false,
          "schema": {
            "type": "string"
          }
        }
      ],
      "result": {
        "name": "result",
        "schema": {
          "type": "object",
          "properties": {
            "tx_hash": {
              "type": "string"
            },
            "tx_key": {
              "type": "string"
            },
            "amount": {
              "type": "integer"
            },
            "fee": {
              "type": "integer"
            }
          },
          "required": [
            "tx_hash"
          ]
        }
      }
    },
    {
      "name": "get_transfers",
      "summary": "Incoming/outgoing transfers, optionally filtered.",
      "servers": [
        {
          "name": "monero-wallet-rpc"
        }
      ],
      "params": [
        {
          "name": "in",
          "required": false,
          "schema": {
            "type": "boolean",
            "default": true
          }
        },
        {
          "name": "out",
          "required": false,
          "schema": {
            "type": "boolean",
            "default": true
          }
        },
        {
          "name": "pending",
          "required": false,
          "schema": {
            "type": "boolean",
            "default": false
          }
        },
        {
          "name": "failed",
          "required": false,
          "schema": {
            "type": "boolean",
            "default": false
          }
        },
        {
          "name": "account_index",
          "required": false,
          "schema": {
            "type": "integer"
          }
        }
      ],
      "result": {
        "name": "result",
        "schema": {
          "type": "object",
          "properties": {
            "in": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "out": {
              "type": "array",
              "items": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    {
      "name": "relay_tx",
      "summary": "Relay a signed tx blob previously created with do_not_relay.",
      "servers": [
        {
          "name": "monero-wallet-rpc"
        }
      ],
      "params": [
        {
          "name": "tx_blob",
          "required": true,
          "schema": {
            "type": "string",
            "description": "Hex of the signed transaction."
          }
        }
      ],
      "result": {
        "name": "result",
        "schema": {
          "type": "object",
          "properties": {
            "tx_hash": {
              "type": "string"
            },
            "tx_key": {
              "type": "string"
            }
          },
          "required": [
            "tx_hash"
          ]
        }
      }
    }
  ]
}