{ "openapi": "3.0.0", "components": { "examples": {}, "headers": {}, "parameters": {}, "requestBodies": {}, "responses": {}, "schemas": { "NftDetails": { "properties": { "tokenId": { "type": "string" }, "contractAddress": { "type": "string" }, "projectName": { "type": "string" }, "lendingData": { "properties": { "isRedeemed": { "type": "boolean" }, "claimedYield": { "type": "string" }, "yield": { "type": "string" }, "lendingEnd": { "type": "number", "format": "double" }, "lendingStart": { "type": "number", "format": "double" }, "principle": { "type": "string" } }, "required": [ "isRedeemed", "claimedYield", "yield", "lendingEnd", "lendingStart", "principle" ], "type": "object" }, "metadata": { "properties": { "image": { "type": "string" } }, "required": [ "image" ], "type": "object" } }, "required": [ "tokenId", "contractAddress", "projectName", "lendingData", "metadata" ], "type": "object", "additionalProperties": false }, "UserDetails": { "properties": { "points": { "type": "number", "format": "double" }, "rank": { "type": "number", "format": "double" }, "ownedNfts": { "items": { "$ref": "#/components/schemas/NftDetails" }, "type": "array" } }, "required": [ "points", "rank", "ownedNfts" ], "type": "object", "additionalProperties": false }, "FailedResult": { "properties": { "success": { "type": "boolean", "enum": [ false ], "nullable": false }, "errorMessage": { "type": "string" }, "errorCode": { "type": "number", "format": "double" } }, "required": [ "success", "errorMessage" ], "type": "object", "additionalProperties": false }, "InternalServerErrorResult": { "$ref": "#/components/schemas/FailedResult" }, "FieldErrors": { "description": "comes from the `tsoa` package, but we don't want it as a dependency just for this type", "properties": {}, "type": "object", "additionalProperties": { "properties": { "value": {}, "message": { "type": "string" } }, "required": [ "message" ], "type": "object" } }, "ValidateErrorResult": { "properties": { "message": { "type": "string", "enum": [ "Validation Failed" ], "nullable": false }, "details": { "$ref": "#/components/schemas/FieldErrors" } }, "required": [ "message" ], "type": "object", "additionalProperties": false }, "Summary": { "properties": { "totalLoaned": { "type": "number", "format": "double" }, "totalRepaid": { "type": "number", "format": "double" }, "userCount": { "type": "number", "format": "double" } }, "required": [ "totalLoaned", "totalRepaid", "userCount" ], "type": "object", "additionalProperties": false }, "DeviceHistory": { "properties": { "eventTime": { "type": "number", "format": "double" }, "eventDescription": { "type": "string" } }, "required": [ "eventTime", "eventDescription" ], "type": "object", "additionalProperties": false }, "DailyDeviceSummary": { "properties": { "date": { "type": "string" }, "dailyMileage": { "type": "number", "format": "double" }, "dailyDrivingTime": { "type": "number", "format": "double" } }, "required": [ "date", "dailyMileage", "dailyDrivingTime" ], "type": "object", "additionalProperties": false }, "DeviceDetails": { "properties": { "deviceId": { "type": "number", "format": "double" }, "totalMileage": { "type": "number", "format": "double" }, "totalDrivingTime": { "type": "number", "format": "double" }, "assetType": { "type": "string" }, "vehicleModel": { "type": "string" }, "history": { "items": { "$ref": "#/components/schemas/DeviceHistory" }, "type": "array" }, "dailySummary": { "items": { "$ref": "#/components/schemas/DailyDeviceSummary" }, "type": "array" } }, "required": [ "deviceId", "totalMileage", "totalDrivingTime", "assetType", "vehicleModel", "history", "dailySummary" ], "type": "object", "additionalProperties": false }, "SignatureInfo": { "properties": { "signature": { "type": "string" }, "amount": { "type": "number", "format": "double" } }, "required": [ "signature", "amount" ], "type": "object" }, "PresaleParticipation": { "properties": { "buyable": { "$ref": "#/components/schemas/SignatureInfo" }, "amountBought": { "type": "number", "format": "double", "description": "recall: you don't have to purchase the full whitelist amount at once\n so we have to keep track of how much was been bought so far so they can buy the rest later" } }, "required": [ "amountBought" ], "type": "object" }, "NftHistoryEventType": { "enum": [ "contract_created", "mint", "activate", "claim", "redeem" ], "type": "string" }, "NftHistoryEvent": { "properties": { "timestamp": { "type": "number", "format": "double" }, "transactionHash": { "type": "string" }, "projectName": { "type": "string" }, "price": { "type": "string" }, "eventType": { "$ref": "#/components/schemas/NftHistoryEventType" } }, "required": [ "timestamp", "transactionHash", "eventType" ], "type": "object" }, "NftHistory": { "properties": { "address": { "type": "string" }, "history": { "items": { "$ref": "#/components/schemas/NftHistoryEvent" }, "type": "array" } }, "required": [ "address", "history" ], "type": "object", "additionalProperties": false }, "NftContractDetails": { "properties": { "name": { "type": "string" }, "symbol": { "type": "string" }, "chainId": { "type": "string" }, "address": { "type": "string" }, "supplyCap": { "type": "string" }, "mintedAmount": { "type": "string" }, "leaseStart": { "type": "number", "format": "double" }, "leaseEnd": { "type": "number", "format": "double" }, "minYield": { "type": "string" }, "accepted_token": { "type": "string" }, "presalePrice": { "type": "string" }, "publicsalePrice": { "type": "string" }, "metadata": {}, "activated": { "type": "boolean" }, "owner": { "type": "string" }, "signerAddress": { "type": "string" }, "isPresale": { "type": "boolean" }, "isPublicsale": { "type": "boolean" } }, "required": [ "name", "symbol", "chainId", "address", "supplyCap", "mintedAmount", "leaseStart", "leaseEnd", "minYield", "accepted_token", "presalePrice", "publicsalePrice", "metadata", "activated", "owner", "signerAddress", "isPresale", "isPublicsale" ], "type": "object", "additionalProperties": false }, "NftContractDetailsResponse": { "properties": { "details": { "allOf": [ { "$ref": "#/components/schemas/NftContractDetails" } ], "nullable": true } }, "required": [ "details" ], "type": "object", "description": "Wrap in a type to get around this issue\nhttps://github.com/openapi-ts/openapi-typescript/issues/1695" }, "NftContract": { "properties": { "name": { "type": "string" }, "symbol": { "type": "string" }, "chainId": { "type": "string" }, "address": { "type": "string" }, "leaseStart": { "type": "number", "format": "double" }, "leaseEnd": { "type": "number", "format": "double" } }, "required": [ "name", "symbol", "chainId", "address", "leaseStart", "leaseEnd" ], "type": "object", "additionalProperties": false } }, "securitySchemes": {} }, "info": { "title": "@harvest-flow/api", "version": "1.0.0", "description": "Webserver REST API for the middleware to interact with game node.", "license": { "name": "ISC" }, "contact": {} }, "paths": { "/user_details": { "get": { "operationId": "GetUserDetails", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserDetails" } } } }, "422": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorResult" }, "examples": { "Example 1": {} } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerErrorResult" }, "examples": { "Example 1": {} } } } } }, "security": [], "parameters": [ { "in": "query", "name": "userAddress", "required": true, "schema": { "type": "string" } } ] } }, "/summary": { "get": { "operationId": "GetSummary", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Summary" } } } }, "422": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorResult" }, "examples": { "Example 1": {} } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerErrorResult" }, "examples": { "Example 1": {} } } } } }, "security": [], "parameters": [] } }, "/rwaData": { "get": { "operationId": "GetRwaData", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeviceDetails" } } } }, "422": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorResult" }, "examples": { "Example 1": {} } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerErrorResult" }, "examples": { "Example 1": {} } } } } }, "security": [], "parameters": [ { "in": "query", "name": "contractAddress", "required": true, "schema": { "type": "string" } }, { "in": "query", "name": "tokenId", "required": true, "schema": { "type": "string" } } ] } }, "/presale": { "get": { "operationId": "ForAddress", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PresaleParticipation" } } } }, "422": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorResult" }, "examples": { "Example 1": {} } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerErrorResult" }, "examples": { "Example 1": {} } } } } }, "security": [], "parameters": [ { "in": "query", "name": "contractAddress", "required": true, "schema": { "type": "string" } }, { "in": "query", "name": "userAddress", "required": true, "schema": { "type": "string" } } ] } }, "/nft_history/user": { "get": { "operationId": "GetUserHistory", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NftHistory" } } } }, "422": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorResult" }, "examples": { "Example 1": {} } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerErrorResult" }, "examples": { "Example 1": {} } } } } }, "security": [], "parameters": [ { "in": "query", "name": "userAddress", "required": true, "schema": { "type": "string" } } ] } }, "/nft_history/project": { "get": { "operationId": "GetProjectHistory", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NftHistory" } } } } }, "security": [], "parameters": [ { "in": "query", "name": "contractAddress", "required": true, "schema": { "type": "string" } } ] } }, "/nft": { "get": { "operationId": "GetTokenDetails", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NftDetails" } } } }, "422": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorResult" }, "examples": { "Example 1": {} } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerErrorResult" }, "examples": { "Example 1": {} } } } } }, "security": [], "parameters": [ { "in": "query", "name": "contractAddress", "required": true, "schema": { "type": "string" } }, { "in": "query", "name": "tokenId", "required": true, "schema": { "type": "string" } } ] } }, "/nft_details": { "get": { "operationId": "GetProjectDetails", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NftContractDetailsResponse" } } } }, "204": { "description": "", "content": { "application/json": { "schema": { "type": "number", "enum": [ null ], "nullable": true }, "examples": { "Example 1": {} } } } }, "422": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorResult" }, "examples": { "Example 1": {} } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerErrorResult" }, "examples": { "Example 1": {} } } } } }, "security": [], "parameters": [ { "in": "query", "name": "contractAddress", "required": true, "schema": { "type": "string" } } ] } }, "/all_nft": { "get": { "operationId": "GetAllNfts", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/NftContract" }, "type": "array" } } } }, "422": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorResult" }, "examples": { "Example 1": {} } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerErrorResult" }, "examples": { "Example 1": {} } } } } }, "security": [], "parameters": [ { "in": "query", "name": "justActive", "required": false, "schema": { "default": true, "type": "boolean" } } ] } } }, "servers": [ { "url": "/" } ] }