consumes: - application/json info: description: Thyra HTTP server API. title: massastation version: 0.2.0 produces: - application/json schemes: - http - https swagger: "2.0" paths: /all/domains: get: description: Returns all domains registered in the blockchain network MassaServer is connected to. operationId: allDomainsGetter produces: - application/json responses: "200": description: All domains returned. schema: type: array items: $ref: "#/definitions/Registry" "400": description: Bad request. schema: $ref: "#/definitions/Error" "500": description: Internal Server Error - The server has encountered a situation it does not know how to handle. schema: $ref: "#/definitions/Error" /cmd/executeFunction: post: description: Calls the given function from the given smart contract. operationId: cmdExecuteFunction parameters: - in: body name: body required: true x-nullable: false schema: type: object required: - nickname - name - at default: nickname: "test" name: "test" at: "A1MrqLgWq5XXDpTBH6fzXHUg7E8M5U2fYDAF3E1xnUSzyZuKpMh" args: "" gas: price: 0 limit: 700000000 coins: 0 expiry: 3 fee: 0 keyId: default properties: nickname: description: Wallet's short name. type: string x-nullable: false name: description: Function name to call. type: string x-nullable: false at: description: Smart contract address exporting the function to call. type: string x-nullable: false args: description: Arguments to pass to the function. type: string default: "" gas: type: object description: Gas attibutes. Has is a virtual resource consumed by node while running smart contract. properties: price: type: number description: Price of a gas unit. default: 0 limit: type: integer description: Maximum number of gas unit that a node will be able consume. default: 700000000 coins: description: Set the fee amount (in massa) that will be given to the block creator. type: number default: 0 expiry: description: Set the expiry duration (in number of slots) of the transaction. type: integer default: 3 fee: description: Set the fee amount (in massa) that will be given to the block creator. type: number default: 0 keyId: description: Defines the key to used to sign the transaction. type: string default: default produces: - application/json responses: "200": description: OK. schema: type: string description: Operation id. "422": description: Unprocessable Entity - syntax is correct, but the server was unable to process the contained instructions. schema: $ref: "#/definitions/Error" "500": description: Internal Server Error - The server has encountered a situation it does not know how to handle. schema: $ref: "#/definitions/Error" /cmd/deploySC: post: description: Deploys the given smart contract to the blockchain network. operationId: cmdDeploySC consumes: - multipart/form-data parameters: - in: formData name: walletNickname type: string required: true x-nullable: false description: Name of the wallet used to deploy the smart contract. - in: formData name: smartContract type: file required: true x-nullable: false description: Smart contract file in a Wasm format. - in : formData name : gasPrice type: integer format: uint64 minimum: 0 description : Price of a gas unit. default : 0 - in : formData name : gasLimit type : integer format: uint64 minimum: 0 description: Maximum number of gas unit that a node will be able to consume. default: 700000000 - in: formData name : coins type: integer format: uint64 minimum: 0 description: Set the number of coins that will be sent along the deployment call. default: 0 - in: formData name : expiry type : integer format: uint64 minimum: 0 description: Set the expiry duration (in number of slots) of the transaction. default: 2 - in: formData name : fee type : integer minimum: 0 format: uint64 description: Set the fee amount (in massa) that will be given to the block creator. default : 0 - in: formData name: datastore type: string default: "" description: b64 encoded datastore that will be sent along the smart contract. produces: - application/json responses: "200": description: OK. schema: type: string description: Operation id. "400": description: Bad request. schema: $ref: "#/definitions/Error" "422": description: Unprocessable Entity - syntax is correct, but the server was unable to process the contained instructions. schema: $ref: "#/definitions/Error" "500": description: Internal Server Error - The server has encountered a situation it does not know how to handle. schema: $ref: "#/definitions/Error" /kpi: get: operationId: kpi parameters: - name: scope in: query type: array minItems: 0 uniqueItems: true collectionFormat: csv items: type: string enum: [wallet, node, stacking, blockchain] produces: - application/json responses: "200": description: kpi message. schema: type: object properties: wallet: type: array items: type: object properties: coin: type: string balance: type: number node: type: array items: type: object properties: memory: type: array items: type: number cpu: type: array items: type: number storage: type: array items: type: number network: type: array items: type: number stacking: type: array items: type: object properties: address: type: string rolls: type: integer slashing: type: integer gains: type: number /massa/addresses: get: description: Retrieves requested information about the given addresses. operationId: massaGetAddresses parameters: - in: query name: attributes type : array collectionFormat: multi description: | Specifies the attributes to return. If no attributes are provided, they are all returned. Possible values: | Attribute | Content | | ----------- | -----------| | balance | the pending balances (takes into account pending/non-final operations) and the final balances (takes into account only final operations). | items : type: string enum: [balance] - in: query name : addresses required : true x-nullable: false type : array collectionFormat: multi description : list of wanted addresses items: type: string produces: - application/json responses: "200": description: Addresses' infos retrieved schema: type : object properties: addressesAttributes: type: object additionalProperties: description : address key type: object properties: balance: type: object properties: pending: type: string final: type: string "400": description: Bad request. schema: $ref: "#/definitions/Error" "500": description: Internal Server Error - The server has encountered a situation it does not know how to handle. schema: $ref: "#/definitions/Error" /massa/node: get: summary: Get Massa network infos description: Returns the currently used massa node infos operationId: getNode produces: - application/json responses: "200": description: Massa node schema: $ref: '#/definitions/MassaNodeItem' "404": description: Not found. schema: $ref: "#/definitions/Error" "500": description: Internal Server Error - The server has encountered a situation it does not know how to handle. schema: $ref: "#/definitions/Error" /my/domains/{nickname}: get: description: Retrieves the list of domains owned by the given wallet. operationId: myDomainsGetter parameters: - in: path name: nickname type: string required : true description: Wallet's short name. produces: - application/json responses: "200": description: Domains returned. May be empty. schema: type: array items: $ref: "#/definitions/Websites" "400": description: Bad request. schema: $ref: "#/definitions/Error" "500": description: Internal Server Error - The server has encountered a situation it does not know how to handle. schema: $ref: "#/definitions/Error" /plugin-manager: post: description: Install a plugin from a given URL. operationId: pluginManagerInstall parameters: - in: query name: source type: string format: url required: true x-nullable: false description: URL from which to retrieve the plug-in. produces: - application/json responses: "204": description: Plugin successfully installed "400": description: Bad request. schema: $ref: "#/definitions/Error" "404": description: Not found. schema: $ref: "#/definitions/Error" "422": description: Unprocessable Entity - The syntax is correct, but the server was unable to process the contained instructions. schema: $ref: "#/definitions/Error" "500": description: Internal Server Error - The server has encountered a situation it does not know how to handle. schema: $ref: "#/definitions/Error" get: description: List all installed plugins. operationId: pluginManagerList responses: "200": description: List all installed plugins. schema: type: array items: type: object properties: id: description: Plugin identifier. type: string x-nullable: false name: description: Plugin name. type: string x-nullable: false description: description: Plugin description. type: string x-nullable: false home: description: Plugin home Url. type: string x-nullable: false status: description: Plugin status. enum: ["Starting", "Up", "Down", "ShuttingDown", "Crashed"] x-nullable: false logo: description: Plugin logo Url. type: string x-nullable: false version: description: Plugin version. type: string x-nullable: false "400": description: Bad request. schema: $ref: "#/definitions/Error" "404": description: Not found. schema: $ref: "#/definitions/Error" "422": description: Unprocessable Entity - The syntax is correct, but the server was unable to process the contained instructions. schema: $ref: "#/definitions/Error" "500": description: Internal Server Error - The server has encountered a situation it does not know how to handle. schema: $ref: "#/definitions/Error" /plugin-manager/register: post: description: Register a plugin. This is used by plugins to register themselves to the plugin manager. operationId: pluginManagerRegister parameters: - in: body name: body required: true x-nullable: false schema: type: object required: - id - name - author - description - logo - url - api-spec properties: id: description: Plugin identifier. type: string x-nullable: false name: description: Plugin name. type: string x-nullable: false author: description: Plugin author. type: string x-nullable: false description: description: Plugin description. type: string x-nullable: false logo: description: Plugin logo. type: string x-nullable: false home: description: Plugin home url. type: string x-nullable: false url: description: URL authority to use to connect to the plugin type: string x-nullable: false api_spec: description: Plugin API specification type: string x-nullable: false responses: "204": description: Plugin successfully installed "400": description: Bad request. schema: $ref: "#/definitions/Error" "404": description: Not found. schema: $ref: "#/definitions/Error" "422": description: Unprocessable Entity - The syntax is correct, but the server was unable to process the contained instructions. schema: $ref: "#/definitions/Error" "500": description: Internal Server Error - The server has encountered a situation it does not know how to handle. schema: $ref: "#/definitions/Error" /plugin-manager/{id}: get: description: Returns the given plugin status. operationId: pluginManagerGetInformation parameters: - in: path name: id type: string required : true description: Plugin identifier. responses: "200": description: Get execution information from the plugin. schema: type: object properties: status: description: Plugin status. type: string enum: ["Starting", "Up", "Down", "ShuttingDown", "Crashed"] x-nullable: false "400": description: Bad request. schema: $ref: "#/definitions/Error" "404": description: Not found. schema: $ref: "#/definitions/Error" "422": description: Unprocessable Entity - The syntax is correct, but the server was unable to process the contained instructions. schema: $ref: "#/definitions/Error" "500": description: Internal Server Error - The server has encountered a situation it does not know how to handle. schema: $ref: "#/definitions/Error" delete: description: Uninstall the given plugin from the system. operationId: pluginManagerUninstall parameters: - in: path name: id required : true type: string description: Plugin identifier. responses: "204": description: Plugin successfuly remove from the system. "400": description: Bad request. schema: $ref: "#/definitions/Error" "404": description: Not found. schema: $ref: "#/definitions/Error" "422": description: Unprocessable Entity - The syntax is correct, but the server was unable to process the contained instructions. schema: $ref: "#/definitions/Error" "500": description: Internal Server Error - The server has encountered a situation it does not know how to handle. schema: $ref: "#/definitions/Error" /plugin-manager/{id}/execute: post: description: Execute a command on the given plugin such as update, stop, start, restart. operationId: pluginManagerExecuteCommand parameters: - in: path name: id type: string required : true description: Plugin unique identifier. - in: body name: body required: true x-nullable: false schema: type: object required: - command properties: command: description: Command to execute. type: string enum: ["update", "stop", "start", "restart"] x-nullable: false responses: "204": description: Command successfuly executed. "400": description: Bad request. schema: $ref: "#/definitions/Error" "404": description: Not found. schema: $ref: "#/definitions/Error" "422": description: Unprocessable Entity - The syntax is correct, but the server was unable to process the contained instructions. schema: $ref: "#/definitions/Error" "500": description: Internal Server Error - The server has encountered a situation it does not know how to handle. schema: $ref: "#/definitions/Error" "501": description: Not Implemented - the server does not support the functionality required to fulfill the request. schema: $ref: "#/definitions/Error" /plugin-store: get: summary: Get list of available plugins from store description: Returns a list of PluginStoreItem structs operationId: getPluginStore produces: - application/json responses: "200": description: List of plugins schema: type: array items: $ref: '#/definitions/PluginStoreItem' "400": description: Bad request. schema: $ref: "#/definitions/Error" "404": description: Not found. schema: $ref: "#/definitions/Error" "422": description: Unprocessable Entity - The syntax is correct, but the server was unable to process the contained instructions. schema: $ref: "#/definitions/Error" "500": description: Internal Server Error - The server has encountered a situation it does not know how to handle. schema: $ref: "#/definitions/Error" /events/{str}/{caller}: get: description: Returns the event matching the given data content and caller. operationId: eventsGetter produces: - application/json parameters: - in: path required : true name: str type: string description: Data content of the event. - in: path name: caller required : true type: string description: Creator of the transaction that triggered the event. responses: "200": description: Event retrieved schema: $ref: "#/definitions/Events" "400": description: Bad request. schema: $ref: "#/definitions/Error" "500": description: Internal Server Error - The server has encountered a situation it does not know how to handle. schema: $ref: "#/definitions/Error" /home/{resource}: get: description: Frontend router for the MassaStation home page. operationId: MassaStationHome produces: - application/json - text/javascript - text/html - text/css - text/webp - image/png parameters: - in: path name: resource required : true type: string description: Website resource. responses: "200": description: Page found "404": description: Resource not found. schema: $ref: "#/definitions/Error" /web/{resource}: get: description: Frontend router for the MassaStation. operationId: MassaStationWebApp produces: - application/json - text/javascript - text/html - text/css - text/webp - image/png parameters: - in: path name: resource required : true type: string description: Website resource. responses: "200": description: Page found "404": description: Resource not found. schema: $ref: "#/definitions/Error" /plugin/{author-name}/{plugin-name}: get: operationId: pluginRouter description: virtual endpoint handling requests for third party plugin. The actual handler is defined as an HTTP handler middleware. parameters: - in: path name: author-name type: string required : true description: Author of the plugin. - in: path name: plugin-name required : true type: string description: Name of the plugin. responses: "200": description: Dumb response. All content and HTTP code are possible for this endpoint. /store/{resource}: get: description: Frontend router for the Thyra plugin manager page. operationId: thyraPluginManager produces: - application/json - text/javascript - text/html - text/css - text/webp - image/png parameters: - in: path name: resource required : true type: string description: Website resource. responses: "200": description: Page found "404": description: Resource not found. schema: $ref: "#/definitions/Error" /search/{resource}: get: description: Frontend router for the web-on-chain search page. operationId: WebOnChainSearch produces: - application/json - text/javascript - text/html - text/css - text/webp - image/png parameters: - in: path name: resource required : true type: string description: Website resource. responses: "200": description: Page found /websiteUploader/{resource}: get: description: Frontend router for the Thyra website creator page. operationId: websiteUploader produces: - application/json - text/javascript - text/html - text/css - text/webp - image/png parameters: - in: path name: resource required : true type: string description: Website resource. responses: "200": description: Page found "404": description: Resource not found. schema: $ref: "#/definitions/Error" /websiteUploader/prepare: put: summary: Deploys the given website on the blockchain. description: The given URL will first be added to the DNS if available and then the website will be deployed. operationId: websiteUploaderPrepare consumes: - multipart/form-data parameters: - in: formData name: url type: string pattern: "^[a-z0-9]+$" required: true x-nullable: false description: URL without dot (.), upper case and special characters - in: formData name: nickname type: string required: true x-nullable: false description: Name of the Wallet in which the website will be deployed. - in: formData name: zipfile type: file required: true x-nullable: false description: Website contents in a ZIP file. produces: - application/json responses: "200": description: New website created. schema: $ref: "#/definitions/Websites" "400": description: Bad request. schema: $ref: "#/definitions/Error" "422": description: Unprocessable Entity - syntax is correct, but the server was unable to process the contained instructions. schema: $ref: "#/definitions/Error" "500": description: Internal Server Error - The server has encountered a situation it does not know how to handle. schema: $ref: "#/definitions/Error" /websiteUploader/upload: post: summary: Uploads the given website on the blockchain. description: The website must have been deployed before using the prepare endpoint. This endpoint is usually used to edit an existing website. operationId: websiteUploaderUpload consumes: - multipart/form-data parameters: - in: formData name: address type: string required: true x-nullable: false description: Address where to deploy website. The account must have been prepare to receive a website. - in: formData name: nickname type: string required: true x-nullable: false description: Wallet's nickname to be used for receiving the website - in: formData name: zipfile type: file required: true x-nullable: false description: Website contents in a ZIP file. produces: - application/json responses: "200": description: Website's chunk deployed. schema: $ref: "#/definitions/Websites" "400": description: Bad request. schema: $ref: "#/definitions/Error" "422": description: Unprocessable Entity - syntax is correct, but the server was unable to process the contained instructions. schema: $ref: "#/definitions/Error" "500": description: Internal Server Error - The server has encountered a situation it does not know how to handle. schema: $ref: "#/definitions/Error" /websiteUploader/uploadMissingChunks: post: description: Re-upload missing chunks of a website on the blockchain. This allows to fix a website that has been partially uploaded as a lower cost than re-uploading the whole website. operationId: websiteUploadMissingChunks consumes: - multipart/form-data parameters: - in: formData name: address type: string required: true x-nullable: false description: Address where to deploy website. The account must have been prepare to receive a website. - in: formData name: nickname type: string required: true x-nullable: false description: Wallet's nickname to be used for receiving the website - in: formData name: zipfile type: file required: true x-nullable: false description: Website contents in a ZIP file. - in: formData name: missedChunks type: string required: true x-nullable: false description: Website missing chunks produces: - application/json responses: "200": description: Website's chunk deployed. schema: $ref: "#/definitions/Websites" "400": description: Bad request. schema: $ref: "#/definitions/Error" "422": description: Unprocessable Entity - syntax is correct, but the server was unable to process the contained instructions. schema: $ref: "#/definitions/Error" "500": description: Internal Server Error - The server has encountered a situation it does not know how to handle. schema: $ref: "#/definitions/Error" definitions: Error: type: object description: Error object. required: - code - message properties: code: description: error code. type: string x-nullable: false message: description: error message. type: string x-nullable: false Websites: type: object description: Websites object (V0). properties: name: description: Website's name. type: string address: description: Website's address. type: string brokenChunks: description: Array of empty chunks if website contains preventing the website to load. type: array items: type: string Events: type: object description: Events object (V0) properties: data: description: Event data. type: string address: description: Event caller. type: string Registry: type: object description: Registry object (V0). properties: name: description: Website's name. type: string address: description: Website's address. type: string metadata: description: byte array as string including created_at and updated_at values type: string format: byte PluginStoreItem: type: object description: Plugin item from store. properties: name: type: string description: type: string version: type: string url: type: string file: $ref: '#/definitions/File' os: type: string required: - name - description - version - url - file File: type: object properties: url: type: string checksum: type: string required: - url - checksum MassaNodeItem: type: object description: Massa node infos. properties: network: enum: ["testnet", "labnet", "localhost", "buildnet"] url: type: string dns: type: string required: - network - url