All Downloads are FREE. Search and download functionalities are using the official Maven repository.

public.swagger-docs.openapi.json Maven / Gradle / Ivy

There is a newer version: 0.7.15
Show newest version
{
	"openapi": "3.0.0",
	"info": {
		"title": "Convex REST API",
		"version": "1.0"
	},
	"servers": [
		{
			"url": "/api/v1",
			"description": "Local API server"
		}
	],
	"paths": {
		"/createAccount": {
			"post": {
				"operationId": "createAccount",
				"summary": "Create account",
				"description": "Requests creation of a user account by the Peer. The Peer should create an account with the specified public key, assuming it allows the user to request this.",
				"requestBody": {
					"content": {
						"application/json": {
							"schema": {
								"type": "object"
							},
							"example": {
								"accountKey": "0x1234567812345678123456781234567812345678123456781234567812345678"
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "Normal response",
						"content": {
							"application/json": {
								"schema": {
									"type": "object"
								},
								"example": {
									"address": 13
								}
							}
						}
					},
					"400": {
						"description": "Bad request, probably a missing or badly formatted accountKey."
					}
				}
			}
		},
		"/query": {
			"post": {
				"operationId": "query",
				"summary": "Execute Query",
				"description": "Requests execution of a query by the Peer, using the current network state.",
				"requestBody": {
					"content": {
						"application/json": {
							"schema": {
								"type": "object"
							},
							"example": {
								"address": "#1245",
								"source": "(+ 1 2 3 4)"
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "Normal response",
						"content": {
							"application/json": {
								"schema": {
									"type": "object"
								},
								"example": {
									"value": 10
								}
							}
						}
					},
					"400": {
						"description": "Bad query request."
					}
				}
			}
		},
		"/faucet": {
			"post": {
				"operationId": "faucet",
				"summary": "Request Coins from Faucet",
				"description": "Requests for free coins.",
				"requestBody": {
					"content": {
						"application/json": {
							"schema": {
								"type": "object"
							},
							"example": {
								"address": 13,
								"amount": 10000000
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "Normal response",
						"content": {
							"application/json": {
								"schema": {
									"type": "object"
								},
								"example": {
									"value": 10
								}
							}
						}
					},
					"400": {
						"description": "Bad query request."
					}
				}
			}
		},
		"/accounts/{id}": {
			"get": {
				"operationId": "accountDetails",
				"summary": "Request account details for a specific address",
				"description": "Requests a summary of information for a specific account.",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"schema": {
							"type": "integer"
						},
						"required": true,
						"description": "Numerical Account Address to query",
						"example": 10
					}
				],
				"responses": {
					"200": {
						"description": "Normal response",
						"content": {
							"application/json": {
								"schema": {
									"type": "object"
								},
								"example": {
									"sequence": 0,
									"address": 10,
									"memorySize": 8193,
									"balance": 0,
									"allowance": 0,
									"type": "actor"
								}
							}
						}
					},
					"404": {
						"description": "Account not found.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object"
								},
								"example": {
									"errorCode": "NOBODY",
									"source": "Server",
									"value": "The Account requested does not exist."
								}
							}
						}
					}
				}
			}
		},
		"/transaction/prepare": {
			"post": {
				"operationId": "prepareTransaction",
				"summary": "Prepare a transaction",
				"description": "Requests that the server prepare a transaction for execution on the network. Most importantly, the Server should confirm the hash of the transaction which can subsequently be signed by the client. Clients may choose to independently validate that the transaction hash is correct.",
				"requestBody": {
					"content": {
						"application/json": {
							"schema": {
								"type": "object"
							},
							"example": {
								"address": 9,
								"source": "(map inc [1 2 3])"
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "Normal response when successfully prepared.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object"
								},
								"example": {
									"address": 9,
									"hash": "0xbadb861fc51d49e0212c0304b1890da42e4a4b54228986be17de8d7dccd845e2",
									"sequence": 0,
									"source": "(map inc [1 2 3])"
								}
							}
						}
					},
					"400": {
						"description": "Bad transaction preparation request."
					}
				}
			}
		},
		"/transaction/submit": {
			"post": {
				"operationId": "submitTransaction",
				"summary": "Submit a signed transaction",
				"description": "Requests that the server submit a transaction for execution on the network.",
				"requestBody": {
					"content": {
						"application/json": {
							"schema": {
								"type": "object"
							},
							"example": {
								"address": 9,
								"accountKey": "0x1ee6d2eCAB45DFC7e46d52B73ec2b3Ef65B95967c69b0BC8A106e97C214bb812",
								"hash": "0xbadb861fc51d49e0212c0304b1890da42e4a4b54228986be17de8d7dccd845e2",
								"sig": "0xce31365976f0c5a5922f65f47999907f5fab475cce1fdad0ff53baaf800036a4ed1783b6dbb98b14a25e1bfffd140749223f6914b86533e6fa9811de0733cc0b"
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "Normal response when successfully executed.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object"
								},
								"example": {
									"value": "[1, 2, 3]"
								}
							}
						}
					},
					"400": {
						"description": "Bad transaction request."
					}
				}
			}
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy