{ "openapi": "3.0.3", "info": { "title": "Alephium API", "version": "2.13.0" }, "servers": [ { "url": "../" }, { "url": "{protocol}://{host}:{port}", "variables": { "protocol": { "enum": [ "http", "https" ], "default": "http" }, "host": { "default": "127.0.0.1" }, "port": { "default": "12973" } } } ], "paths": { "/wallets": { "get": { "tags": [ "Wallets" ], "summary": "List available wallets", "operationId": "getWallets", "responses": { "200": { "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/WalletStatus" } }, "example": [ { "walletName": "wallet-super-name", "locked": true } ] } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } }, "put": { "tags": [ "Wallets" ], "summary": "Restore a wallet from your mnemonic", "operationId": "putWallets", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WalletRestore" }, "examples": { "Example0": { "summary": "User", "value": { "password": "my-secret-password", "mnemonic": "vault alarm sad mass witness property virus style good flower rice alpha viable evidence run glare pretty scout evil judge enroll refuse another lava", "walletName": "wallet-super-name" } }, "Example1": { "summary": "Miner (w/o pass phrase)", "value": { "password": "my-secret-password", "mnemonic": "vault alarm sad mass witness property virus style good flower rice alpha viable evidence run glare pretty scout evil judge enroll refuse another lava", "walletName": "wallet-super-name", "isMiner": true } }, "Example2": { "summary": "Miner (with pass phrase)", "value": { "password": "my-secret-password", "mnemonic": "vault alarm sad mass witness property virus style good flower rice alpha viable evidence run glare pretty scout evil judge enroll refuse another lava", "walletName": "wallet-super-name", "isMiner": true, "mnemonicPassphrase": "optional-mnemonic-passphrase" } } } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WalletRestoreResult" }, "example": { "walletName": "wallet-super-name" } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } }, "post": { "tags": [ "Wallets" ], "summary": "Create a new wallet", "description": "A new wallet will be created and respond with a mnemonic. Make sure to keep that mnemonic safely as it will allows you to recover your wallet. Default mnemonic size is 24, (options: 12, 15, 18, 21, 24).", "operationId": "postWallets", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WalletCreation" }, "examples": { "Example0": { "summary": "User", "value": { "password": "my-secret-password", "walletName": "wallet-super-name" } }, "Example1": { "summary": "Miner (w/o pass phrase)", "value": { "password": "my-secret-password", "walletName": "wallet-super-name", "isMiner": true, "mnemonicSize": 24 } }, "Example2": { "summary": "Miner (with pass phrase)", "value": { "password": "my-secret-password", "walletName": "wallet-super-name", "isMiner": true, "mnemonicPassphrase": "optional-mnemonic-passphrase", "mnemonicSize": 24 } } } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WalletCreationResult" }, "example": { "walletName": "wallet-super-name", "mnemonic": "vault alarm sad mass witness property virus style good flower rice alpha viable evidence run glare pretty scout evil judge enroll refuse another lava" } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/wallets/{wallet_name}": { "get": { "tags": [ "Wallets" ], "summary": "Get wallet's status", "operationId": "getWalletsWallet_name", "parameters": [ { "name": "wallet_name", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WalletStatus" }, "example": { "walletName": "wallet-super-name", "locked": true } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } }, "delete": { "tags": [ "Wallets" ], "summary": "Delete your wallet file (can be recovered with your mnemonic)", "operationId": "deleteWalletsWallet_name", "parameters": [ { "name": "wallet_name", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WalletDeletion" }, "example": { "password": "my-secret-password" } } }, "required": true }, "responses": { "200": { }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/wallets/{wallet_name}/lock": { "post": { "tags": [ "Wallets" ], "summary": "Lock your wallet", "operationId": "postWalletsWallet_nameLock", "parameters": [ { "name": "wallet_name", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/wallets/{wallet_name}/unlock": { "post": { "tags": [ "Wallets" ], "summary": "Unlock your wallet", "operationId": "postWalletsWallet_nameUnlock", "parameters": [ { "name": "wallet_name", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WalletUnlock" }, "examples": { "Example0": { "summary": "Default", "value": { "password": "my-secret-password" } }, "Example1": { "summary": "More Settings (with pass phrase)", "value": { "password": "my-secret-password", "mnemonicPassphrase": "optional-mnemonic-passphrase" } } } } }, "required": true }, "responses": { "200": { }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/wallets/{wallet_name}/balances": { "get": { "tags": [ "Wallets" ], "summary": "Get your total balance", "operationId": "getWalletsWallet_nameBalances", "parameters": [ { "name": "wallet_name", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Format 1: `1000000000000000000`\n\nFormat 2: `x.y ALPH`, where `1 ALPH = 1000000000000000000\n\nField fromPublicKeyType can be `default` or `bip340-schnorr`", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Balances" }, "example": { "totalBalance": "10000000000000000000", "totalBalanceHint": "10 ALPH", "balances": [ { "address": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "balance": "10000000000000000000", "balanceHint": "10 ALPH", "lockedBalance": "0", "lockedBalanceHint": "0 ALPH" } ] } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/wallets/{wallet_name}/reveal-mnemonic": { "post": { "tags": [ "Wallets" ], "summary": "Reveal your mnemonic. !!! use it with caution !!!", "operationId": "postWalletsWallet_nameReveal-mnemonic", "parameters": [ { "name": "wallet_name", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RevealMnemonic" }, "example": { "password": "my-secret-password" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RevealMnemonicResult" }, "example": { "mnemonic": "vault alarm sad mass witness property virus style good flower rice alpha viable evidence run glare pretty scout evil judge enroll refuse another lava" } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/wallets/{wallet_name}/transfer": { "post": { "tags": [ "Wallets" ], "summary": "Transfer ALPH from the active address", "operationId": "postWalletsWallet_nameTransfer", "parameters": [ { "name": "wallet_name", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Format 1: `1000000000000000000`\n\nFormat 2: `x.y ALPH`, where `1 ALPH = 1000000000000000000\n\nField fromPublicKeyType can be `default` or `bip340-schnorr`", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Transfer" }, "examples": { "Example0": { "summary": "Default", "value": { "destinations": [ { "address": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "attoAlphAmount": "2000000000000000000" } ] } }, "Example1": { "summary": "More settings", "value": { "destinations": [ { "address": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "attoAlphAmount": "2000000000000000000", "tokens": [ { "id": "2d11fd6c12435ffb07aaed4d190a505b621b927a5f6e51b61ce0ebe186397bdd", "amount": "42000000000000000000" }, { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "1000000000000000000000" } ], "lockTime": 1611041396892 } ], "gas": 20000, "gasPrice": "100000000000", "utxosLimit": 512 } } } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TransferResult" }, "example": { "txId": "503bfb16230888af4924aa8f8250d7d348b862e267d75d3147f1998050b6da69", "fromGroup": 2, "toGroup": 1 } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/wallets/{wallet_name}/sweep-active-address": { "post": { "tags": [ "Wallets" ], "summary": "Transfer all unlocked ALPH from the active address to another address", "operationId": "postWalletsWallet_nameSweep-active-address", "parameters": [ { "name": "wallet_name", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Sweep" }, "examples": { "Example0": { "summary": "Default", "value": { "toAddress": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y" } }, "Example1": { "summary": "More settings", "value": { "toAddress": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "lockTime": 1611041396892, "gasAmount": 20000, "gasPrice": "100000000000", "utxosLimit": 512 } } } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TransferResults" }, "example": { "results": [ { "txId": "503bfb16230888af4924aa8f8250d7d348b862e267d75d3147f1998050b6da69", "fromGroup": 2, "toGroup": 1 } ] } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/wallets/{wallet_name}/sweep-all-addresses": { "post": { "tags": [ "Wallets" ], "summary": "Transfer unlocked ALPH from all addresses (including all mining addresses if applicable) to another address", "operationId": "postWalletsWallet_nameSweep-all-addresses", "parameters": [ { "name": "wallet_name", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Sweep" }, "examples": { "Example0": { "summary": "Default", "value": { "toAddress": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y" } }, "Example1": { "summary": "More settings", "value": { "toAddress": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "lockTime": 1611041396892, "gasAmount": 20000, "gasPrice": "100000000000", "utxosLimit": 512 } } } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TransferResults" }, "example": { "results": [ { "txId": "503bfb16230888af4924aa8f8250d7d348b862e267d75d3147f1998050b6da69", "fromGroup": 2, "toGroup": 1 } ] } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/wallets/{wallet_name}/sign": { "post": { "tags": [ "Wallets" ], "summary": "Sign the given data and return back the signature", "operationId": "postWalletsWallet_nameSign", "parameters": [ { "name": "wallet_name", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Sign" }, "example": { "data": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SignResult" }, "example": { "signature": "9e1a35b2931bd04e6780d01c36e3e5337941aa80f173cfe4f4e249c44ab135272b834c1a639db9c89d673a8a30524042b0469672ca845458a5a0cf2cad53221b" } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/wallets/{wallet_name}/addresses": { "get": { "tags": [ "Wallets" ], "summary": "List all your wallet's addresses", "operationId": "getWalletsWallet_nameAddresses", "parameters": [ { "name": "wallet_name", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Addresses" }, "example": { "activeAddress": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "addresses": [ { "address": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "publicKey": "d1b70d2226308b46da297486adb6b4f1a8c1842cb159ac5ec04f384fe2d6f5da28", "group": 0, "path": "m/44'/1234'/O'/O/O" } ] } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/wallets/{wallet_name}/addresses/{address}": { "get": { "tags": [ "Wallets" ], "summary": "Get address' info", "operationId": "getWalletsWallet_nameAddressesAddress", "parameters": [ { "name": "wallet_name", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "address", "in": "path", "required": true, "schema": { "type": "string", "format": "address" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AddressInfo" }, "example": { "address": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "publicKey": "d1b70d2226308b46da297486adb6b4f1a8c1842cb159ac5ec04f384fe2d6f5da28", "group": 0, "path": "m/44'/1234'/O'/O/O" } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/wallets/{wallet_name}/miner-addresses": { "get": { "tags": [ "Miners" ], "summary": "List all miner addresses per group", "description": "This endpoint can only be called if the wallet was created with the `isMiner = true` flag", "operationId": "getWalletsWallet_nameMiner-addresses", "parameters": [ { "name": "wallet_name", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/MinerAddressesInfo" } }, "example": [ { "addresses": [ { "address": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "publicKey": "d1b70d2226308b46da297486adb6b4f1a8c1842cb159ac5ec04f384fe2d6f5da28", "group": 0, "path": "m/44'/1234'/O'/O/O" } ] } ] } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/wallets/{wallet_name}/derive-next-address": { "post": { "tags": [ "Wallets" ], "summary": "Derive your next address", "description": "Cannot be called from a miner wallet", "operationId": "postWalletsWallet_nameDerive-next-address", "parameters": [ { "name": "wallet_name", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "group", "in": "query", "required": false, "schema": { "type": "integer", "format": "int32" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AddressInfo" }, "example": { "address": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "publicKey": "d1b70d2226308b46da297486adb6b4f1a8c1842cb159ac5ec04f384fe2d6f5da28", "group": 0, "path": "m/44'/1234'/O'/O/O" } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/wallets/{wallet_name}/derive-next-miner-addresses": { "post": { "tags": [ "Miners" ], "summary": "Derive your next miner addresses for each group", "description": "Your wallet need to have been created with the miner flag set to true", "operationId": "postWalletsWallet_nameDerive-next-miner-addresses", "parameters": [ { "name": "wallet_name", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/AddressInfo" } }, "example": [ { "address": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "publicKey": "d1b70d2226308b46da297486adb6b4f1a8c1842cb159ac5ec04f384fe2d6f5da28", "group": 0, "path": "m/44'/1234'/O'/O/O" } ] } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/wallets/{wallet_name}/change-active-address": { "post": { "tags": [ "Wallets" ], "summary": "Choose the active address", "operationId": "postWalletsWallet_nameChange-active-address", "parameters": [ { "name": "wallet_name", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChangeActiveAddress" }, "example": { "address": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y" } } }, "required": true }, "responses": { "200": { }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/infos/node": { "get": { "tags": [ "Infos" ], "summary": "Get info about that node", "operationId": "getInfosNode", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NodeInfo" }, "example": { "buildInfo": { "releaseVersion": "1.2.3", "commit": "47c01136d52cdf29062f6a3598a36ebc1e4dc57e" }, "upnp": true, "externalAddress": { "addr": "1.2.3.4", "port": 12344 } } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/infos/version": { "get": { "tags": [ "Infos" ], "summary": "Get version about that node", "operationId": "getInfosVersion", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NodeVersion" }, "example": { "version": "v0.0.1" } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/infos/chain-params": { "get": { "tags": [ "Infos" ], "summary": "Get key params about your blockchain", "operationId": "getInfosChain-params", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChainParams" }, "example": { "networkId": 0, "numZerosAtLeastInHash": 18, "groupNumPerBroker": 1, "groups": 2 } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/infos/self-clique": { "get": { "tags": [ "Infos" ], "summary": "Get info about your own clique", "operationId": "getInfosSelf-clique", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SelfClique" }, "example": { "cliqueId": "d1b70d2226308b46da297486adb6b4f1a8c1842cb159ac5ec04f384fe2d6f5da28", "nodes": [ { "address": "1.2.3.4", "restPort": 12377, "wsPort": 12366, "minerApiPort": 12355 } ], "selfReady": true, "synced": true } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/infos/inter-clique-peer-info": { "get": { "tags": [ "Infos" ], "summary": "Get infos about the inter cliques", "operationId": "getInfosInter-clique-peer-info", "responses": { "200": { "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/InterCliquePeerInfo" } }, "example": [ { "cliqueId": "d1b70d2226308b46da297486adb6b4f1a8c1842cb159ac5ec04f384fe2d6f5da28", "brokerId": 1, "groupNumPerBroker": 1, "address": { "addr": "1.2.3.4", "port": 12344 }, "isSynced": true, "clientVersion": "v1.0.0" } ] } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/infos/discovered-neighbors": { "get": { "tags": [ "Infos" ], "summary": "Get discovered neighbors", "operationId": "getInfosDiscovered-neighbors", "responses": { "200": { "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/BrokerInfo" } }, "example": [ { "cliqueId": "d1b70d2226308b46da297486adb6b4f1a8c1842cb159ac5ec04f384fe2d6f5da28", "brokerId": 1, "brokerNum": 1, "address": { "addr": "1.2.3.4", "port": 12344 } } ] } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/infos/misbehaviors": { "get": { "tags": [ "Infos" ], "summary": "Get the misbehaviors of peers", "operationId": "getInfosMisbehaviors", "responses": { "200": { "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/PeerMisbehavior" } }, "example": [ { "peer": "1.2.3.4", "status": { "type": "Penalty", "value": 42 } } ] } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } }, "post": { "tags": [ "Infos" ], "summary": "Ban/Unban given peers", "operationId": "postInfosMisbehaviors", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MisbehaviorAction" }, "examples": { "Example0": { "summary": "Unban", "value": { "type": "Unban", "peers": [ "1.2.3.4" ] } }, "Example1": { "summary": "Ban", "value": { "type": "Ban", "peers": [ "1.2.3.4" ] } } } } }, "required": true }, "responses": { "200": { }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/infos/unreachable": { "get": { "tags": [ "Infos" ], "summary": "Get the unreachable brokers", "operationId": "getInfosUnreachable", "responses": { "200": { "content": { "application/json": { "schema": { "type": "array", "items": { "type": "string", "format": "inet-address" } }, "example": [ "1.2.3.4" ] } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/infos/discovery": { "post": { "tags": [ "Infos" ], "summary": "Set brokers to be unreachable/reachable", "operationId": "postInfosDiscovery", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DiscoveryAction" }, "examples": { "Example0": { "summary": "Set unreachable", "value": { "type": "Unreachable", "peers": [ "1.2.3.4" ] } }, "Example1": { "summary": "Set reachable", "value": { "type": "Reachable", "peers": [ "1.2.3.4" ] } } } } }, "required": true }, "responses": { "200": { }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/infos/history-hashrate": { "get": { "tags": [ "Infos" ], "summary": "Get history average hashrate on the given time interval", "operationId": "getInfosHistory-hashrate", "parameters": [ { "name": "fromTs", "in": "query", "required": true, "schema": { "type": "integer", "format": "int64", "minimum": "0" } }, { "name": "toTs", "in": "query", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": "0" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "string" }, "example": { "hashrate": "100 MH/s" } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/infos/current-hashrate": { "get": { "tags": [ "Infos" ], "summary": "Get average hashrate from `now - timespan(millis)` to `now`", "operationId": "getInfosCurrent-hashrate", "parameters": [ { "name": "timespan", "in": "query", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": "1" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "string" }, "example": { "hashrate": "100 MH/s" } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/infos/current-difficulty": { "get": { "tags": [ "Infos" ], "summary": "Get the average difficulty of the latest blocks from all shards", "operationId": "getInfosCurrent-difficulty", "responses": { "200": { "content": { "application/json": { "schema": { "type": "string", "format": "bigint" }, "example": { "difficulty": "224000000000000" } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/blockflow/blocks": { "get": { "tags": [ "Blockflow" ], "summary": "List blocks on the given time interval", "operationId": "getBlockflowBlocks", "parameters": [ { "name": "fromTs", "in": "query", "required": true, "schema": { "type": "integer", "format": "int64", "minimum": "0" } }, { "name": "toTs", "in": "query", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": "0" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BlocksPerTimeStampRange" }, "example": { "blocks": [ [ { "hash": "bdaf9dc514ce7d34b6474b8ca10a3dfb93ba997cb9d5ff1ea724ebe2af48abe5", "timestamp": 1611041396892, "chainFrom": 1, "chainTo": 2, "height": 42, "deps": [ "bdaf9dc514ce7d34b6474b8ca10a3dfb93ba997cb9d5ff1ea724ebe2af48abe5", "bdaf9dc514ce7d34b6474b8ca10a3dfb93ba997cb9d5ff1ea724ebe2af48abe5" ], "transactions": [ { "unsigned": { "txId": "503bfb16230888af4924aa8f8250d7d348b862e267d75d3147f1998050b6da69", "version": 1, "networkId": 1, "gasAmount": 20000, "gasPrice": "100000000000", "inputs": [ { "outputRef": { "hint": 23412, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" }, "unlockScript": "00d1b70d2226308b46da297486adb6b4f1a8c1842cb159ac5ec04f384fe2d6f5da28" } ], "fixedOutputs": [ { "hint": 1, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "attoAlphAmount": "2000000000000000000", "address": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "tokens": [ { "id": "2d11fd6c12435ffb07aaed4d190a505b621b927a5f6e51b61ce0ebe186397bdd", "amount": "42000000000000000000" }, { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "1000000000000000000000" } ], "lockTime": 1611041396892, "message": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" } ] }, "scriptExecutionOk": true, "contractInputs": [ { "hint": 23412, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" } ], "generatedOutputs": [ { "type": "AssetOutput", "hint": 1, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "attoAlphAmount": "2000000000000000000", "address": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "tokens": [ { "id": "2d11fd6c12435ffb07aaed4d190a505b621b927a5f6e51b61ce0ebe186397bdd", "amount": "42000000000000000000" }, { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "1000000000000000000000" } ], "lockTime": 1611041396892, "message": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" }, { "type": "ContractOutput", "hint": 1, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "attoAlphAmount": "2000000000000000000", "address": "uomjgUz6D4tLejTkQtbNJMY8apAjTm1bgQf7em1wDV7S", "tokens": [ { "id": "2d11fd6c12435ffb07aaed4d190a505b621b927a5f6e51b61ce0ebe186397bdd", "amount": "42000000000000000000" }, { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "1000000000000000000000" } ] } ], "inputSignatures": [ "9e1a35b2931bd04e6780d01c36e3e5337941aa80f173cfe4f4e249c44ab135272b834c1a639db9c89d673a8a30524042b0469672ca845458a5a0cf2cad53221b" ], "scriptSignatures": [ "9e1a35b2931bd04e6780d01c36e3e5337941aa80f173cfe4f4e249c44ab135272b834c1a639db9c89d673a8a30524042b0469672ca845458a5a0cf2cad53221b" ] } ], "nonce": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "version": 1, "depStateHash": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "txsHash": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "target": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" } ] ] } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/blockflow/blocks-with-events": { "get": { "tags": [ "Blockflow" ], "summary": "List blocks with events on the given time interval", "operationId": "getBlockflowBlocks-with-events", "parameters": [ { "name": "fromTs", "in": "query", "required": true, "schema": { "type": "integer", "format": "int64", "minimum": "0" } }, { "name": "toTs", "in": "query", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": "0" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BlocksAndEventsPerTimeStampRange" }, "example": { "blocksAndEvents": [ [ { "block": { "hash": "bdaf9dc514ce7d34b6474b8ca10a3dfb93ba997cb9d5ff1ea724ebe2af48abe5", "timestamp": 1611041396892, "chainFrom": 1, "chainTo": 2, "height": 42, "deps": [ "bdaf9dc514ce7d34b6474b8ca10a3dfb93ba997cb9d5ff1ea724ebe2af48abe5", "bdaf9dc514ce7d34b6474b8ca10a3dfb93ba997cb9d5ff1ea724ebe2af48abe5" ], "transactions": [ { "unsigned": { "txId": "503bfb16230888af4924aa8f8250d7d348b862e267d75d3147f1998050b6da69", "version": 1, "networkId": 1, "gasAmount": 20000, "gasPrice": "100000000000", "inputs": [ { "outputRef": { "hint": 23412, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" }, "unlockScript": "00d1b70d2226308b46da297486adb6b4f1a8c1842cb159ac5ec04f384fe2d6f5da28" } ], "fixedOutputs": [ { "hint": 1, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "attoAlphAmount": "2000000000000000000", "address": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "tokens": [ { "id": "2d11fd6c12435ffb07aaed4d190a505b621b927a5f6e51b61ce0ebe186397bdd", "amount": "42000000000000000000" }, { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "1000000000000000000000" } ], "lockTime": 1611041396892, "message": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" } ] }, "scriptExecutionOk": true, "contractInputs": [ { "hint": 23412, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" } ], "generatedOutputs": [ { "type": "AssetOutput", "hint": 1, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "attoAlphAmount": "2000000000000000000", "address": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "tokens": [ { "id": "2d11fd6c12435ffb07aaed4d190a505b621b927a5f6e51b61ce0ebe186397bdd", "amount": "42000000000000000000" }, { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "1000000000000000000000" } ], "lockTime": 1611041396892, "message": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" }, { "type": "ContractOutput", "hint": 1, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "attoAlphAmount": "2000000000000000000", "address": "uomjgUz6D4tLejTkQtbNJMY8apAjTm1bgQf7em1wDV7S", "tokens": [ { "id": "2d11fd6c12435ffb07aaed4d190a505b621b927a5f6e51b61ce0ebe186397bdd", "amount": "42000000000000000000" }, { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "1000000000000000000000" } ] } ], "inputSignatures": [ "9e1a35b2931bd04e6780d01c36e3e5337941aa80f173cfe4f4e249c44ab135272b834c1a639db9c89d673a8a30524042b0469672ca845458a5a0cf2cad53221b" ], "scriptSignatures": [ "9e1a35b2931bd04e6780d01c36e3e5337941aa80f173cfe4f4e249c44ab135272b834c1a639db9c89d673a8a30524042b0469672ca845458a5a0cf2cad53221b" ] } ], "nonce": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "version": 1, "depStateHash": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "txsHash": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "target": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" }, "events": [ { "txId": "503bfb16230888af4924aa8f8250d7d348b862e267d75d3147f1998050b6da69", "contractAddress": "vSxdLL2kE3o6vJBdKkdgmS3W39G3ZEmFHpo2y1jnbzBq", "eventIndex": 1, "fields": [ { "type": "Address", "value": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y" }, { "type": "U256", "value": "10" } ] } ] } ] ] } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/blockflow/blocks/{block_hash}": { "get": { "tags": [ "Blockflow" ], "summary": "Get a block with hash", "operationId": "getBlockflowBlocksBlock_hash", "parameters": [ { "name": "block_hash", "in": "path", "required": true, "schema": { "type": "string", "format": "block-hash" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BlockEntry" }, "example": { "hash": "bdaf9dc514ce7d34b6474b8ca10a3dfb93ba997cb9d5ff1ea724ebe2af48abe5", "timestamp": 1611041396892, "chainFrom": 1, "chainTo": 2, "height": 42, "deps": [ "bdaf9dc514ce7d34b6474b8ca10a3dfb93ba997cb9d5ff1ea724ebe2af48abe5", "bdaf9dc514ce7d34b6474b8ca10a3dfb93ba997cb9d5ff1ea724ebe2af48abe5" ], "transactions": [ { "unsigned": { "txId": "503bfb16230888af4924aa8f8250d7d348b862e267d75d3147f1998050b6da69", "version": 1, "networkId": 1, "gasAmount": 20000, "gasPrice": "100000000000", "inputs": [ { "outputRef": { "hint": 23412, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" }, "unlockScript": "00d1b70d2226308b46da297486adb6b4f1a8c1842cb159ac5ec04f384fe2d6f5da28" } ], "fixedOutputs": [ { "hint": 1, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "attoAlphAmount": "2000000000000000000", "address": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "tokens": [ { "id": "2d11fd6c12435ffb07aaed4d190a505b621b927a5f6e51b61ce0ebe186397bdd", "amount": "42000000000000000000" }, { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "1000000000000000000000" } ], "lockTime": 1611041396892, "message": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" } ] }, "scriptExecutionOk": true, "contractInputs": [ { "hint": 23412, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" } ], "generatedOutputs": [ { "type": "AssetOutput", "hint": 1, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "attoAlphAmount": "2000000000000000000", "address": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "tokens": [ { "id": "2d11fd6c12435ffb07aaed4d190a505b621b927a5f6e51b61ce0ebe186397bdd", "amount": "42000000000000000000" }, { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "1000000000000000000000" } ], "lockTime": 1611041396892, "message": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" }, { "type": "ContractOutput", "hint": 1, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "attoAlphAmount": "2000000000000000000", "address": "uomjgUz6D4tLejTkQtbNJMY8apAjTm1bgQf7em1wDV7S", "tokens": [ { "id": "2d11fd6c12435ffb07aaed4d190a505b621b927a5f6e51b61ce0ebe186397bdd", "amount": "42000000000000000000" }, { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "1000000000000000000000" } ] } ], "inputSignatures": [ "9e1a35b2931bd04e6780d01c36e3e5337941aa80f173cfe4f4e249c44ab135272b834c1a639db9c89d673a8a30524042b0469672ca845458a5a0cf2cad53221b" ], "scriptSignatures": [ "9e1a35b2931bd04e6780d01c36e3e5337941aa80f173cfe4f4e249c44ab135272b834c1a639db9c89d673a8a30524042b0469672ca845458a5a0cf2cad53221b" ] } ], "nonce": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "version": 1, "depStateHash": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "txsHash": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "target": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/blockflow/blocks-with-events/{block_hash}": { "get": { "tags": [ "Blockflow" ], "summary": "Get a block and events with hash", "operationId": "getBlockflowBlocks-with-eventsBlock_hash", "parameters": [ { "name": "block_hash", "in": "path", "required": true, "schema": { "type": "string", "format": "block-hash" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BlockAndEvents" }, "example": { "block": { "hash": "bdaf9dc514ce7d34b6474b8ca10a3dfb93ba997cb9d5ff1ea724ebe2af48abe5", "timestamp": 1611041396892, "chainFrom": 1, "chainTo": 2, "height": 42, "deps": [ "bdaf9dc514ce7d34b6474b8ca10a3dfb93ba997cb9d5ff1ea724ebe2af48abe5", "bdaf9dc514ce7d34b6474b8ca10a3dfb93ba997cb9d5ff1ea724ebe2af48abe5" ], "transactions": [ { "unsigned": { "txId": "503bfb16230888af4924aa8f8250d7d348b862e267d75d3147f1998050b6da69", "version": 1, "networkId": 1, "gasAmount": 20000, "gasPrice": "100000000000", "inputs": [ { "outputRef": { "hint": 23412, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" }, "unlockScript": "00d1b70d2226308b46da297486adb6b4f1a8c1842cb159ac5ec04f384fe2d6f5da28" } ], "fixedOutputs": [ { "hint": 1, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "attoAlphAmount": "2000000000000000000", "address": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "tokens": [ { "id": "2d11fd6c12435ffb07aaed4d190a505b621b927a5f6e51b61ce0ebe186397bdd", "amount": "42000000000000000000" }, { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "1000000000000000000000" } ], "lockTime": 1611041396892, "message": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" } ] }, "scriptExecutionOk": true, "contractInputs": [ { "hint": 23412, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" } ], "generatedOutputs": [ { "type": "AssetOutput", "hint": 1, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "attoAlphAmount": "2000000000000000000", "address": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "tokens": [ { "id": "2d11fd6c12435ffb07aaed4d190a505b621b927a5f6e51b61ce0ebe186397bdd", "amount": "42000000000000000000" }, { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "1000000000000000000000" } ], "lockTime": 1611041396892, "message": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" }, { "type": "ContractOutput", "hint": 1, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "attoAlphAmount": "2000000000000000000", "address": "uomjgUz6D4tLejTkQtbNJMY8apAjTm1bgQf7em1wDV7S", "tokens": [ { "id": "2d11fd6c12435ffb07aaed4d190a505b621b927a5f6e51b61ce0ebe186397bdd", "amount": "42000000000000000000" }, { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "1000000000000000000000" } ] } ], "inputSignatures": [ "9e1a35b2931bd04e6780d01c36e3e5337941aa80f173cfe4f4e249c44ab135272b834c1a639db9c89d673a8a30524042b0469672ca845458a5a0cf2cad53221b" ], "scriptSignatures": [ "9e1a35b2931bd04e6780d01c36e3e5337941aa80f173cfe4f4e249c44ab135272b834c1a639db9c89d673a8a30524042b0469672ca845458a5a0cf2cad53221b" ] } ], "nonce": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "version": 1, "depStateHash": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "txsHash": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "target": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" }, "events": [ { "txId": "503bfb16230888af4924aa8f8250d7d348b862e267d75d3147f1998050b6da69", "contractAddress": "vSxdLL2kE3o6vJBdKkdgmS3W39G3ZEmFHpo2y1jnbzBq", "eventIndex": 1, "fields": [ { "type": "Address", "value": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y" }, { "type": "U256", "value": "10" } ] } ] } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/blockflow/is-block-in-main-chain": { "get": { "tags": [ "Blockflow" ], "summary": "Check if the block is in main chain", "operationId": "getBlockflowIs-block-in-main-chain", "parameters": [ { "name": "blockHash", "in": "query", "required": true, "schema": { "type": "string", "format": "block-hash" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "boolean" }, "example": true } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/addresses/{address}/balance": { "get": { "tags": [ "Addresses" ], "summary": "Get the balance of an address", "operationId": "getAddressesAddressBalance", "parameters": [ { "name": "address", "in": "path", "required": true, "schema": { "type": "string", "format": "address" } }, { "name": "mempool", "in": "query", "required": false, "schema": { "type": "boolean" } } ], "responses": { "200": { "description": "Format 1: `1000000000000000000`\n\nFormat 2: `x.y ALPH`, where `1 ALPH = 1000000000000000000\n\nField fromPublicKeyType can be `default` or `bip340-schnorr`", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Balance" }, "examples": { "Example0": { "summary": "Default", "value": { "balance": "10000000000000000000", "balanceHint": "10 ALPH", "lockedBalance": "5000000000000000000", "lockedBalanceHint": "5 ALPH", "tokenBalances": [ { "id": "2d11fd6c12435ffb07aaed4d190a505b621b927a5f6e51b61ce0ebe186397bdd", "amount": "42000000000000000000" }, { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "1000000000000000000000" } ], "lockedTokenBalances": [ { "id": "20aa1fcc865087d7788302d087e4bc76691218ce5d5013dd1cedaabfac19cca4", "amount": "65000000000000000000" } ], "utxoNum": 3 } }, "Example1": { "summary": "More settings", "value": { "balance": "10000000000000000000", "balanceHint": "10 ALPH", "lockedBalance": "5000000000000000000", "lockedBalanceHint": "5 ALPH", "tokenBalances": [ { "id": "2d11fd6c12435ffb07aaed4d190a505b621b927a5f6e51b61ce0ebe186397bdd", "amount": "42000000000000000000" }, { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "1000000000000000000000" } ], "lockedTokenBalances": [ { "id": "20aa1fcc865087d7788302d087e4bc76691218ce5d5013dd1cedaabfac19cca4", "amount": "65000000000000000000" } ], "utxoNum": 3, "warning": "Result might not include all utxos and is maybe unprecise" } } } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/addresses/{address}/utxos": { "get": { "tags": [ "Addresses" ], "summary": "Get the UTXOs of an address", "operationId": "getAddressesAddressUtxos", "parameters": [ { "name": "address", "in": "path", "required": true, "schema": { "type": "string", "format": "address" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UTXOs" }, "examples": { "Example0": { "summary": "Default", "value": { "utxos": [ { "ref": { "hint": 23412, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" }, "amount": "10000000000000000000", "tokens": [ { "id": "2d11fd6c12435ffb07aaed4d190a505b621b927a5f6e51b61ce0ebe186397bdd", "amount": "42000000000000000000" }, { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "1000000000000000000000" } ], "lockTime": 1611041396892, "additionalData": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" } ] } }, "Example1": { "summary": "More settings", "value": { "utxos": [ { "ref": { "hint": 23412, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" }, "amount": "10000000000000000000", "tokens": [ { "id": "2d11fd6c12435ffb07aaed4d190a505b621b927a5f6e51b61ce0ebe186397bdd", "amount": "42000000000000000000" }, { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "1000000000000000000000" } ], "lockTime": 1611041396892, "additionalData": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" } ], "warning": "Result might not contains all utxos" } } } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/addresses/{address}/group": { "get": { "tags": [ "Addresses" ], "summary": "Get the group of an address", "operationId": "getAddressesAddressGroup", "parameters": [ { "name": "address", "in": "path", "required": true, "schema": { "type": "string", "format": "address" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Group" }, "example": { "group": 2 } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/blockflow/hashes": { "get": { "tags": [ "Blockflow" ], "summary": "Get all block's hashes at given height for given groups", "operationId": "getBlockflowHashes", "parameters": [ { "name": "fromGroup", "in": "query", "required": true, "schema": { "type": "integer", "format": "int32" } }, { "name": "toGroup", "in": "query", "required": true, "schema": { "type": "integer", "format": "int32" } }, { "name": "height", "in": "query", "required": true, "schema": { "type": "integer", "format": "int32" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HashesAtHeight" }, "example": { "headers": [ "bdaf9dc514ce7d34b6474b8ca10a3dfb93ba997cb9d5ff1ea724ebe2af48abe5", "bdaf9dc514ce7d34b6474b8ca10a3dfb93ba997cb9d5ff1ea724ebe2af48abe5", "bdaf9dc514ce7d34b6474b8ca10a3dfb93ba997cb9d5ff1ea724ebe2af48abe5" ] } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/blockflow/chain-info": { "get": { "tags": [ "Blockflow" ], "summary": "Get infos about the chain from the given groups", "operationId": "getBlockflowChain-info", "parameters": [ { "name": "fromGroup", "in": "query", "required": true, "schema": { "type": "integer", "format": "int32" } }, { "name": "toGroup", "in": "query", "required": true, "schema": { "type": "integer", "format": "int32" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChainInfo" }, "example": { "currentHeight": 42 } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/blockflow/headers/{block_hash}": { "get": { "tags": [ "Blockflow" ], "summary": "Get block header", "operationId": "getBlockflowHeadersBlock_hash", "parameters": [ { "name": "block_hash", "in": "path", "required": true, "schema": { "type": "string", "format": "block-hash" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BlockHeaderEntry" }, "example": { "hash": "bdaf9dc514ce7d34b6474b8ca10a3dfb93ba997cb9d5ff1ea724ebe2af48abe5", "timestamp": 1611041396892, "chainFrom": 1, "chainTo": 2, "height": 42, "deps": [ "bdaf9dc514ce7d34b6474b8ca10a3dfb93ba997cb9d5ff1ea724ebe2af48abe5", "bdaf9dc514ce7d34b6474b8ca10a3dfb93ba997cb9d5ff1ea724ebe2af48abe5" ] } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/transactions/build": { "post": { "tags": [ "Transactions" ], "summary": "Build an unsigned transaction to a number of recipients", "operationId": "postTransactionsBuild", "requestBody": { "description": "Format 1: `1000000000000000000`\n\nFormat 2: `x.y ALPH`, where `1 ALPH = 1000000000000000000\n\nField fromPublicKeyType can be `default` or `bip340-schnorr`", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BuildTransaction" }, "examples": { "Example0": { "summary": "Default", "value": { "fromPublicKey": "d1b70d2226308b46da297486adb6b4f1a8c1842cb159ac5ec04f384fe2d6f5da28", "destinations": [ { "address": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "attoAlphAmount": "2000000000000000000" } ] } }, "Example1": { "summary": "More settings", "value": { "fromPublicKey": "d1b70d2226308b46da297486adb6b4f1a8c1842cb159ac5ec04f384fe2d6f5da28", "fromPublicKeyType": "bip340-schnorr", "destinations": [ { "address": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "attoAlphAmount": "2000000000000000000", "tokens": [ { "id": "2d11fd6c12435ffb07aaed4d190a505b621b927a5f6e51b61ce0ebe186397bdd", "amount": "42000000000000000000" }, { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "1000000000000000000000" } ], "lockTime": 1611041396892 } ], "utxos": [ { "hint": 23412, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" } ], "gasAmount": 20000, "gasPrice": "100000000000" } } } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BuildTransactionResult" }, "example": { "unsignedTx": "35d1b2a520a0da34c5eb8d712aa9cc", "gasAmount": 20000, "gasPrice": "100000000000", "txId": "503bfb16230888af4924aa8f8250d7d348b862e267d75d3147f1998050b6da69", "fromGroup": 2, "toGroup": 1 } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/transactions/build-multi-addresses": { "post": { "tags": [ "Transactions" ], "summary": "Build an unsigned transaction with multiple addresses to a number of recipients", "operationId": "postTransactionsBuild-multi-addresses", "requestBody": { "description": "Format 1: `1000000000000000000`\n\nFormat 2: `x.y ALPH`, where `1 ALPH = 1000000000000000000\n\nField fromPublicKeyType can be `default` or `bip340-schnorr`", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BuildMultiAddressesTransaction" }, "examples": { "Example": { "summary": "Default", "value": { "from": [ { "fromPublicKey": "d1b70d2226308b46da297486adb6b4f1a8c1842cb159ac5ec04f384fe2d6f5da28", "destinations": [ { "address": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "attoAlphAmount": "2000000000000000000" } ] } ] } } } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BuildTransactionResult" }, "example": { "unsignedTx": "35d1b2a520a0da34c5eb8d712aa9cc", "gasAmount": 20000, "gasPrice": "100000000000", "txId": "503bfb16230888af4924aa8f8250d7d348b862e267d75d3147f1998050b6da69", "fromGroup": 2, "toGroup": 1 } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/transactions/sweep-address/build": { "post": { "tags": [ "Transactions" ], "summary": "Build unsigned transactions to send all unlocked ALPH and token balances of one address to another address", "operationId": "postTransactionsSweep-addressBuild", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BuildSweepAddressTransactions" }, "examples": { "Example0": { "summary": "Default", "value": { "fromPublicKey": "d1b70d2226308b46da297486adb6b4f1a8c1842cb159ac5ec04f384fe2d6f5da28", "toAddress": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y" } }, "Example1": { "summary": "More settings", "value": { "fromPublicKey": "d1b70d2226308b46da297486adb6b4f1a8c1842cb159ac5ec04f384fe2d6f5da28", "toAddress": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "maxAttoAlphPerUTXO": "1000000000000000000", "lockTime": 1611041396892, "gasAmount": 20000, "gasPrice": "100000000000" } } } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BuildSweepAddressTransactionsResult" }, "example": { "unsignedTxs": [ { "txId": "503bfb16230888af4924aa8f8250d7d348b862e267d75d3147f1998050b6da69", "unsignedTx": "35d1b2a520a0da34c5eb8d712aa9cc", "gasAmount": 20000, "gasPrice": "100000000000" } ], "fromGroup": 2, "toGroup": 1 } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/transactions/submit": { "post": { "tags": [ "Transactions" ], "summary": "Submit a signed transaction", "operationId": "postTransactionsSubmit", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubmitTransaction" }, "example": { "unsignedTx": "35d1b2a520a0da34c5eb8d712aa9cc", "signature": "9e1a35b2931bd04e6780d01c36e3e5337941aa80f173cfe4f4e249c44ab135272b834c1a639db9c89d673a8a30524042b0469672ca845458a5a0cf2cad53221b" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubmitTxResult" }, "example": { "txId": "503bfb16230888af4924aa8f8250d7d348b862e267d75d3147f1998050b6da69", "fromGroup": 2, "toGroup": 1 } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/transactions/decode-unsigned-tx": { "post": { "tags": [ "Transactions" ], "summary": "Decode an unsigned transaction", "operationId": "postTransactionsDecode-unsigned-tx", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DecodeUnsignedTx" }, "example": { "unsignedTx": "35d1b2a520a0da34c5eb8d712aa9cc" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DecodeUnsignedTxResult" }, "example": { "fromGroup": 1, "toGroup": 2, "unsignedTx": { "txId": "503bfb16230888af4924aa8f8250d7d348b862e267d75d3147f1998050b6da69", "version": 1, "networkId": 1, "gasAmount": 20000, "gasPrice": "100000000000", "inputs": [ { "outputRef": { "hint": 23412, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" }, "unlockScript": "00d1b70d2226308b46da297486adb6b4f1a8c1842cb159ac5ec04f384fe2d6f5da28" } ], "fixedOutputs": [ { "hint": 1, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "attoAlphAmount": "2000000000000000000", "address": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "tokens": [ { "id": "2d11fd6c12435ffb07aaed4d190a505b621b927a5f6e51b61ce0ebe186397bdd", "amount": "42000000000000000000" }, { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "1000000000000000000000" } ], "lockTime": 1611041396892, "message": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" } ] } } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/transactions/details/{txId}": { "get": { "tags": [ "Transactions" ], "summary": "Get transaction details", "operationId": "getTransactionsDetailsTxid", "parameters": [ { "name": "txId", "in": "path", "required": true, "schema": { "type": "string", "format": "32-byte-hash" } }, { "name": "fromGroup", "in": "query", "required": false, "schema": { "type": "integer", "format": "int32" } }, { "name": "toGroup", "in": "query", "required": false, "schema": { "type": "integer", "format": "int32" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Transaction" }, "examples": { "Example": { "summary": "Default", "value": { "unsigned": { "txId": "503bfb16230888af4924aa8f8250d7d348b862e267d75d3147f1998050b6da69", "version": 1, "networkId": 1, "gasAmount": 20000, "gasPrice": "100000000000", "inputs": [ { "outputRef": { "hint": 23412, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" }, "unlockScript": "00d1b70d2226308b46da297486adb6b4f1a8c1842cb159ac5ec04f384fe2d6f5da28" } ], "fixedOutputs": [ { "hint": 1, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "attoAlphAmount": "2000000000000000000", "address": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "tokens": [ { "id": "2d11fd6c12435ffb07aaed4d190a505b621b927a5f6e51b61ce0ebe186397bdd", "amount": "42000000000000000000" }, { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "1000000000000000000000" } ], "lockTime": 1611041396892, "message": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" } ] }, "scriptExecutionOk": true, "contractInputs": [ { "hint": 23412, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" } ], "generatedOutputs": [ { "type": "AssetOutput", "hint": 1, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "attoAlphAmount": "2000000000000000000", "address": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "tokens": [ { "id": "2d11fd6c12435ffb07aaed4d190a505b621b927a5f6e51b61ce0ebe186397bdd", "amount": "42000000000000000000" }, { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "1000000000000000000000" } ], "lockTime": 1611041396892, "message": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" }, { "type": "ContractOutput", "hint": 1, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "attoAlphAmount": "2000000000000000000", "address": "uomjgUz6D4tLejTkQtbNJMY8apAjTm1bgQf7em1wDV7S", "tokens": [ { "id": "2d11fd6c12435ffb07aaed4d190a505b621b927a5f6e51b61ce0ebe186397bdd", "amount": "42000000000000000000" }, { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "1000000000000000000000" } ] } ], "inputSignatures": [ "9e1a35b2931bd04e6780d01c36e3e5337941aa80f173cfe4f4e249c44ab135272b834c1a639db9c89d673a8a30524042b0469672ca845458a5a0cf2cad53221b" ], "scriptSignatures": [ "9e1a35b2931bd04e6780d01c36e3e5337941aa80f173cfe4f4e249c44ab135272b834c1a639db9c89d673a8a30524042b0469672ca845458a5a0cf2cad53221b" ] } } } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/transactions/status": { "get": { "tags": [ "Transactions" ], "summary": "Get tx status", "operationId": "getTransactionsStatus", "parameters": [ { "name": "txId", "in": "query", "required": true, "schema": { "type": "string", "format": "32-byte-hash" } }, { "name": "fromGroup", "in": "query", "required": false, "schema": { "type": "integer", "format": "int32" } }, { "name": "toGroup", "in": "query", "required": false, "schema": { "type": "integer", "format": "int32" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TxStatus" }, "examples": { "Example0": { "value": { "type": "Confirmed", "blockHash": "bdaf9dc514ce7d34b6474b8ca10a3dfb93ba997cb9d5ff1ea724ebe2af48abe5", "txIndex": 0, "chainConfirmations": 1, "fromGroupConfirmations": 2, "toGroupConfirmations": 3 } }, "Example1": { "summary": "Tx is still in mempool", "value": { "type": "MemPooled" } }, "Example2": { "summary": "Cannot find tx with the id", "value": { "type": "TxNotFound" } } } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/mempool/transactions": { "get": { "tags": [ "Mempool" ], "summary": "List mempool transactions", "operationId": "getMempoolTransactions", "responses": { "200": { "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/MempoolTransactions" } }, "example": [ { "fromGroup": 0, "toGroup": 1, "transactions": [ { "unsigned": { "txId": "503bfb16230888af4924aa8f8250d7d348b862e267d75d3147f1998050b6da69", "version": 1, "networkId": 1, "gasAmount": 20000, "gasPrice": "100000000000", "inputs": [ { "outputRef": { "hint": 23412, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" }, "unlockScript": "00d1b70d2226308b46da297486adb6b4f1a8c1842cb159ac5ec04f384fe2d6f5da28" } ], "fixedOutputs": [ { "hint": 1, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "attoAlphAmount": "2000000000000000000", "address": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "tokens": [ { "id": "2d11fd6c12435ffb07aaed4d190a505b621b927a5f6e51b61ce0ebe186397bdd", "amount": "42000000000000000000" }, { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "1000000000000000000000" } ], "lockTime": 1611041396892, "message": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef" } ] }, "inputSignatures": [ "9e1a35b2931bd04e6780d01c36e3e5337941aa80f173cfe4f4e249c44ab135272b834c1a639db9c89d673a8a30524042b0469672ca845458a5a0cf2cad53221b" ], "scriptSignatures": [ "9e1a35b2931bd04e6780d01c36e3e5337941aa80f173cfe4f4e249c44ab135272b834c1a639db9c89d673a8a30524042b0469672ca845458a5a0cf2cad53221b" ] } ] } ] } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } }, "delete": { "tags": [ "Mempool" ], "summary": "Remove all transactions from mempool", "operationId": "deleteMempoolTransactions", "responses": { "200": { }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/mempool/transactions/rebroadcast": { "put": { "tags": [ "Mempool" ], "summary": "Rebroadcase a mempool transaction to the network", "operationId": "putMempoolTransactionsRebroadcast", "parameters": [ { "name": "txId", "in": "query", "required": true, "schema": { "type": "string", "format": "32-byte-hash" } } ], "responses": { "200": { }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/mempool/transactions/validate": { "put": { "tags": [ "Mempool" ], "summary": "Validate all mempool transactions and remove invalid ones", "operationId": "putMempoolTransactionsValidate", "responses": { "200": { }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/contracts/compile-script": { "post": { "tags": [ "Contracts" ], "summary": "Compile a script", "operationId": "postContractsCompile-script", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Script" }, "example": { "code": "TxScript Main { let token = Token(#36cdbfabca2d71622b6) token.withdraw(@1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y, 1024) }", "compilerOptions": { "ignoreUnusedConstantsWarnings": true } } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CompileScriptResult" }, "example": { "version": "v0.0.1", "name": "Main", "bytecodeTemplate": "35d1b2a520a0da34c5eb8d712aa9cc", "bytecodeDebugPatch": "=1-1+ef", "fields": { "names": [ "aa", "bb", "cc", "dd", "ee" ], "types": [ "Bool", "U256", "I256", "ByteVec", "Address" ], "isMutable": [ false, true, false, true, false ] }, "functions": [ { "name": "bar", "usePreapprovedAssets": false, "useAssetsInContract": false, "isPublic": true, "paramNames": [ "a", "b", "c", "d", "e" ], "paramTypes": [ "Bool", "U256", "I256", "ByteVec", "Address" ], "paramIsMutable": [ false, true, false, true, false ], "returnTypes": [ "U256", "I256", "ByteVec", "Address" ] } ], "warnings": [ "Found unused fields in Foo: a" ] } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/contracts/unsigned-tx/execute-script": { "post": { "tags": [ "Contracts" ], "summary": "Build an unsigned script", "operationId": "postContractsUnsigned-txExecute-script", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BuildExecuteScriptTx" }, "examples": { "Example0": { "summary": "Default", "value": { "fromPublicKey": "d1b70d2226308b46da297486adb6b4f1a8c1842cb159ac5ec04f384fe2d6f5da28", "bytecode": "35d1b2a520a0da34c5eb8d712aa9cc" } }, "Example1": { "summary": "More settings", "value": { "fromPublicKey": "d1b70d2226308b46da297486adb6b4f1a8c1842cb159ac5ec04f384fe2d6f5da28", "fromPublicKeyType": "default", "bytecode": "35d1b2a520a0da34c5eb8d712aa9cc", "attoAlphAmount": "1000000000000000", "tokens": [ { "id": "2d11fd6c12435ffb07aaed4d190a505b621b927a5f6e51b61ce0ebe186397bdd", "amount": "42000000000000000000" }, { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "1000000000000000000000" } ], "gasAmount": 20000, "gasPrice": "100000000000" } } } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BuildExecuteScriptTxResult" }, "example": { "fromGroup": 2, "toGroup": 2, "unsignedTx": "35d1b2a520a0da34c5eb8d712aa9cc", "gasAmount": 20000, "gasPrice": "100000000000", "txId": "503bfb16230888af4924aa8f8250d7d348b862e267d75d3147f1998050b6da69" } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/contracts/compile-contract": { "post": { "tags": [ "Contracts" ], "summary": "Compile a smart contract", "operationId": "postContractsCompile-contract", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Contract" }, "example": { "code": "Contract Foo(bar: ByteVec) {\n pub fn baz(amount: U256) -> () {\nissueToken!(amount)\n}}", "compilerOptions": { "ignoreUnusedConstantsWarnings": true } } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CompileContractResult" }, "example": { "version": "v0.0.1", "name": "Foo", "bytecode": "35d1b2a520a0da34c5eb8d712aa9cc", "bytecodeDebugPatch": "=1-1+ef", "codeHash": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "codeHashDebug": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "fields": { "names": [ "aa", "bb", "cc", "dd", "ee" ], "types": [ "Bool", "U256", "I256", "ByteVec", "Address" ], "isMutable": [ false, true, false, true, false ] }, "functions": [ { "name": "bar", "usePreapprovedAssets": false, "useAssetsInContract": false, "isPublic": true, "paramNames": [ "a", "b", "c", "d", "e" ], "paramTypes": [ "Bool", "U256", "I256", "ByteVec", "Address" ], "paramIsMutable": [ false, true, false, true, false ], "returnTypes": [ "U256", "I256", "ByteVec", "Address" ] } ], "constants": [ { "name": "A", "value": { "type": "Bool", "value": true } } ], "enums": [ { "name": "Color", "fields": [ { "name": "Red", "value": { "type": "U256", "value": "0" } }, { "name": "Blue", "value": { "type": "U256", "value": "1" } } ] } ], "events": [ { "name": "Bar", "fieldNames": [ "a", "b", "d", "e" ], "fieldTypes": [ "Bool", "U256", "ByteVec", "Address" ] } ], "warnings": [ "Found unused fields in Foo: a" ], "stdInterfaceId": "0001" } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/contracts/compile-project": { "post": { "tags": [ "Contracts" ], "summary": "Compile a project", "operationId": "postContractsCompile-project", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Project" }, "example": { "code": "Contract Foo() {\n pub fn foo() -> () {}\n }\n TxScript Main(id: ByteVec) {\n Foo(id).foo() \n}", "compilerOptions": { "ignoreUnusedConstantsWarnings": true } } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CompileProjectResult" }, "example": { "contracts": [ { "version": "v0.0.1", "name": "Foo", "bytecode": "35d1b2a520a0da34c5eb8d712aa9cc", "bytecodeDebugPatch": "=1-1+ef", "codeHash": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "codeHashDebug": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "fields": { "names": [ "aa", "bb", "cc", "dd", "ee" ], "types": [ "Bool", "U256", "I256", "ByteVec", "Address" ], "isMutable": [ false, true, false, true, false ] }, "functions": [ { "name": "bar", "usePreapprovedAssets": false, "useAssetsInContract": false, "isPublic": true, "paramNames": [ "a", "b", "c", "d", "e" ], "paramTypes": [ "Bool", "U256", "I256", "ByteVec", "Address" ], "paramIsMutable": [ false, true, false, true, false ], "returnTypes": [ "U256", "I256", "ByteVec", "Address" ] } ], "constants": [ { "name": "A", "value": { "type": "Bool", "value": true } } ], "enums": [ { "name": "Color", "fields": [ { "name": "Red", "value": { "type": "U256", "value": "0" } }, { "name": "Blue", "value": { "type": "U256", "value": "1" } } ] } ], "events": [ { "name": "Bar", "fieldNames": [ "a", "b", "d", "e" ], "fieldTypes": [ "Bool", "U256", "ByteVec", "Address" ] } ], "warnings": [ "Found unused fields in Foo: a" ], "stdInterfaceId": "0001" } ], "scripts": [ { "version": "v0.0.1", "name": "Main", "bytecodeTemplate": "35d1b2a520a0da34c5eb8d712aa9cc", "bytecodeDebugPatch": "=1-1+ef", "fields": { "names": [ "aa", "bb", "cc", "dd", "ee" ], "types": [ "Bool", "U256", "I256", "ByteVec", "Address" ], "isMutable": [ false, true, false, true, false ] }, "functions": [ { "name": "bar", "usePreapprovedAssets": false, "useAssetsInContract": false, "isPublic": true, "paramNames": [ "a", "b", "c", "d", "e" ], "paramTypes": [ "Bool", "U256", "I256", "ByteVec", "Address" ], "paramIsMutable": [ false, true, false, true, false ], "returnTypes": [ "U256", "I256", "ByteVec", "Address" ] } ], "warnings": [ "Found unused fields in Foo: a" ] } ], "structs": [ { "name": "Foo", "fieldNames": [ "amount", "id" ], "fieldTypes": [ "U256", "ByteVec" ], "isMutable": [ false, true ] } ] } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/contracts/unsigned-tx/deploy-contract": { "post": { "tags": [ "Contracts" ], "summary": "Build an unsigned contract", "operationId": "postContractsUnsigned-txDeploy-contract", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BuildDeployContractTx" }, "examples": { "Example0": { "summary": "Default", "value": { "fromPublicKey": "d1b70d2226308b46da297486adb6b4f1a8c1842cb159ac5ec04f384fe2d6f5da28", "bytecode": "35d1b2a520a0da34c5eb8d712aa9cc" } }, "Example1": { "summary": "More settings", "value": { "fromPublicKey": "d1b70d2226308b46da297486adb6b4f1a8c1842cb159ac5ec04f384fe2d6f5da28", "fromPublicKeyType": "bip340-schnorr", "bytecode": "35d1b2a520a0da34c5eb8d712aa9cc", "initialAttoAlphAmount": "2000000000000000000", "initialTokenAmounts": [ { "id": "2d11fd6c12435ffb07aaed4d190a505b621b927a5f6e51b61ce0ebe186397bdd", "amount": "42000000000000000000" }, { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "1000000000000000000000" } ], "issueTokenAmount": "2000000000000000000", "issueTokenTo": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "gasAmount": 20000, "gasPrice": "100000000000" } } } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BuildDeployContractTxResult" }, "example": { "fromGroup": 2, "toGroup": 2, "unsignedTx": "35d1b2a520a0da34c5eb8d712aa9cc", "gasAmount": 20000, "gasPrice": "100000000000", "txId": "503bfb16230888af4924aa8f8250d7d348b862e267d75d3147f1998050b6da69", "contractAddress": "vSxdLL2kE3o6vJBdKkdgmS3W39G3ZEmFHpo2y1jnbzBq" } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/contracts/{address}/state": { "get": { "tags": [ "Contracts" ], "summary": "Get contract state", "operationId": "getContractsAddressState", "parameters": [ { "name": "address", "in": "path", "required": true, "schema": { "type": "string", "format": "address" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ContractState" }, "example": { "address": "vYZdgzNHHp7Qh9U5Rrv5H65eSJCGQTXEC4yuQCZ7mosA", "bytecode": "00010700000000000118", "codeHash": "c49d951065f85d0c673d33930e8476240c010a52313f99889ae06d9f0d92d2f9", "initialStateHash": "e195a4e597e62a6802a456224008b896566b7c961023954fab808a0f83d8ad63", "immFields": [ { "type": "U256", "value": "1000000000000000000" } ], "mutFields": [ { "type": "U256", "value": "2000000000000000000" } ], "asset": { "attoAlphAmount": "2000000000000000000", "tokens": [ { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "2000000000" } ] } } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/contracts/test-contract": { "post": { "tags": [ "Contracts" ], "summary": "Test contract", "operationId": "postContractsTest-contract", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TestContract" }, "example": { "group": 0, "address": "tgx7VNFoP9DJiFMFgXXtafQZkUvyEdDHT9ryamHJYrjq", "bytecode": "00010700000000000118", "initialImmFields": [ { "type": "U256", "value": "1000000000000000000" } ], "initialMutFields": [ { "type": "U256", "value": "2000000000000000000" } ], "initialAsset": { "attoAlphAmount": "1000000000000000000", "tokens": [ { "id": "2d11fd6c12435ffb07aaed4d190a505b621b927a5f6e51b61ce0ebe186397bdd", "amount": "1000000000" } ] }, "methodIndex": 0, "args": [ { "type": "U256", "value": "1000000000000000000" } ], "existingContracts": [ { "address": "vYZdgzNHHp7Qh9U5Rrv5H65eSJCGQTXEC4yuQCZ7mosA", "bytecode": "00010700000000000118", "codeHash": "c49d951065f85d0c673d33930e8476240c010a52313f99889ae06d9f0d92d2f9", "initialStateHash": "e195a4e597e62a6802a456224008b896566b7c961023954fab808a0f83d8ad63", "immFields": [ { "type": "U256", "value": "1000000000000000000" } ], "mutFields": [ { "type": "U256", "value": "2000000000000000000" } ], "asset": { "attoAlphAmount": "2000000000000000000", "tokens": [ { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "2000000000" } ] } } ], "inputAssets": [ { "address": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "asset": { "attoAlphAmount": "3000000000000000000", "tokens": [ { "id": "20aa1fcc865087d7788302d087e4bc76691218ce5d5013dd1cedaabfac19cca4", "amount": "3000000000" } ] } } ] } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TestContractResult" }, "example": { "address": "uomjgUz6D4tLejTkQtbNJMY8apAjTm1bgQf7em1wDV7S", "codeHash": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "returns": [ { "type": "U256", "value": "1000000000000000000" } ], "gasUsed": 20000, "contracts": [ { "address": "vYZdgzNHHp7Qh9U5Rrv5H65eSJCGQTXEC4yuQCZ7mosA", "bytecode": "00010700000000000118", "codeHash": "c49d951065f85d0c673d33930e8476240c010a52313f99889ae06d9f0d92d2f9", "initialStateHash": "e195a4e597e62a6802a456224008b896566b7c961023954fab808a0f83d8ad63", "immFields": [ { "type": "U256", "value": "1000000000000000000" } ], "mutFields": [ { "type": "U256", "value": "2000000000000000000" } ], "asset": { "attoAlphAmount": "2000000000000000000", "tokens": [ { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "2000000000" } ] } } ], "txInputs": [ "uomjgUz6D4tLejTkQtbNJMY8apAjTm1bgQf7em1wDV7S" ], "txOutputs": [ { "type": "ContractOutput", "hint": 1234, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "attoAlphAmount": "1000000000000000000", "address": "uomjgUz6D4tLejTkQtbNJMY8apAjTm1bgQf7em1wDV7S", "tokens": [ { "id": "2d11fd6c12435ffb07aaed4d190a505b621b927a5f6e51b61ce0ebe186397bdd", "amount": "42000000000000000000" }, { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "1000000000000000000000" } ] } ], "events": [ { "blockHash": "bdaf9dc514ce7d34b6474b8ca10a3dfb93ba997cb9d5ff1ea724ebe2af48abe5", "contractAddress": "vSxdLL2kE3o6vJBdKkdgmS3W39G3ZEmFHpo2y1jnbzBq", "eventIndex": 1, "fields": [ { "type": "Address", "value": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y" }, { "type": "U256", "value": "10" } ] } ], "debugMessages": [ { "contractAddress": "uomjgUz6D4tLejTkQtbNJMY8apAjTm1bgQf7em1wDV7S", "message": "Debugging!" } ] } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/contracts/call-contract": { "post": { "tags": [ "Contracts" ], "summary": "Call contract", "operationId": "postContractsCall-contract", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CallContract" }, "example": { "group": 0, "worldStateBlockHash": "bdaf9dc514ce7d34b6474b8ca10a3dfb93ba997cb9d5ff1ea724ebe2af48abe5", "txId": "503bfb16230888af4924aa8f8250d7d348b862e267d75d3147f1998050b6da69", "address": "tgx7VNFoP9DJiFMFgXXtafQZkUvyEdDHT9ryamHJYrjq", "methodIndex": 0, "args": [ { "type": "U256", "value": "0" } ], "existingContracts": [ "uomjgUz6D4tLejTkQtbNJMY8apAjTm1bgQf7em1wDV7S" ], "inputAssets": [ { "address": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "asset": { "attoAlphAmount": "3000000000000000000", "tokens": [ { "id": "20aa1fcc865087d7788302d087e4bc76691218ce5d5013dd1cedaabfac19cca4", "amount": "3000000000" } ] } } ] } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CallContractResult" }, "example": { "type": "CallContractSucceeded", "returns": [ { "type": "U256", "value": "0" } ], "gasUsed": 20000, "contracts": [ { "address": "vYZdgzNHHp7Qh9U5Rrv5H65eSJCGQTXEC4yuQCZ7mosA", "bytecode": "00010700000000000118", "codeHash": "c49d951065f85d0c673d33930e8476240c010a52313f99889ae06d9f0d92d2f9", "initialStateHash": "e195a4e597e62a6802a456224008b896566b7c961023954fab808a0f83d8ad63", "immFields": [ { "type": "U256", "value": "1000000000000000000" } ], "mutFields": [ { "type": "U256", "value": "2000000000000000000" } ], "asset": { "attoAlphAmount": "2000000000000000000", "tokens": [ { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "2000000000" } ] } } ], "txInputs": [ "uomjgUz6D4tLejTkQtbNJMY8apAjTm1bgQf7em1wDV7S" ], "txOutputs": [ { "type": "ContractOutput", "hint": 1, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "attoAlphAmount": "1000000000000000000", "address": "uomjgUz6D4tLejTkQtbNJMY8apAjTm1bgQf7em1wDV7S", "tokens": [ { "id": "2d11fd6c12435ffb07aaed4d190a505b621b927a5f6e51b61ce0ebe186397bdd", "amount": "42000000000000000000" }, { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "1000000000000000000000" } ] } ], "events": [ { "blockHash": "bdaf9dc514ce7d34b6474b8ca10a3dfb93ba997cb9d5ff1ea724ebe2af48abe5", "contractAddress": "vSxdLL2kE3o6vJBdKkdgmS3W39G3ZEmFHpo2y1jnbzBq", "eventIndex": 1, "fields": [ { "type": "Address", "value": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y" }, { "type": "U256", "value": "10" } ] } ], "debugMessages": [ { "contractAddress": "uomjgUz6D4tLejTkQtbNJMY8apAjTm1bgQf7em1wDV7S", "message": "Debugging!" } ] } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/contracts/multicall-contract": { "post": { "tags": [ "Contracts" ], "summary": "Multiple call contract", "operationId": "postContractsMulticall-contract", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MultipleCallContract" }, "example": { "calls": [ { "group": 0, "worldStateBlockHash": "bdaf9dc514ce7d34b6474b8ca10a3dfb93ba997cb9d5ff1ea724ebe2af48abe5", "txId": "503bfb16230888af4924aa8f8250d7d348b862e267d75d3147f1998050b6da69", "address": "tgx7VNFoP9DJiFMFgXXtafQZkUvyEdDHT9ryamHJYrjq", "methodIndex": 0, "args": [ { "type": "U256", "value": "0" } ], "existingContracts": [ "uomjgUz6D4tLejTkQtbNJMY8apAjTm1bgQf7em1wDV7S" ], "inputAssets": [ { "address": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "asset": { "attoAlphAmount": "3000000000000000000", "tokens": [ { "id": "20aa1fcc865087d7788302d087e4bc76691218ce5d5013dd1cedaabfac19cca4", "amount": "3000000000" } ] } } ] } ] } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MultipleCallContractResult" }, "example": { "results": [ { "type": "CallContractSucceeded", "returns": [ { "type": "U256", "value": "0" } ], "gasUsed": 20000, "contracts": [ { "address": "vYZdgzNHHp7Qh9U5Rrv5H65eSJCGQTXEC4yuQCZ7mosA", "bytecode": "00010700000000000118", "codeHash": "c49d951065f85d0c673d33930e8476240c010a52313f99889ae06d9f0d92d2f9", "initialStateHash": "e195a4e597e62a6802a456224008b896566b7c961023954fab808a0f83d8ad63", "immFields": [ { "type": "U256", "value": "1000000000000000000" } ], "mutFields": [ { "type": "U256", "value": "2000000000000000000" } ], "asset": { "attoAlphAmount": "2000000000000000000", "tokens": [ { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "2000000000" } ] } } ], "txInputs": [ "uomjgUz6D4tLejTkQtbNJMY8apAjTm1bgQf7em1wDV7S" ], "txOutputs": [ { "type": "ContractOutput", "hint": 1, "key": "798e9e137aec7c2d59d9655b4ffa640f301f628bf7c365083bb255f6aa5f89ef", "attoAlphAmount": "1000000000000000000", "address": "uomjgUz6D4tLejTkQtbNJMY8apAjTm1bgQf7em1wDV7S", "tokens": [ { "id": "2d11fd6c12435ffb07aaed4d190a505b621b927a5f6e51b61ce0ebe186397bdd", "amount": "42000000000000000000" }, { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "1000000000000000000000" } ] } ], "events": [ { "blockHash": "bdaf9dc514ce7d34b6474b8ca10a3dfb93ba997cb9d5ff1ea724ebe2af48abe5", "contractAddress": "vSxdLL2kE3o6vJBdKkdgmS3W39G3ZEmFHpo2y1jnbzBq", "eventIndex": 1, "fields": [ { "type": "Address", "value": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y" }, { "type": "U256", "value": "10" } ] } ], "debugMessages": [ { "contractAddress": "uomjgUz6D4tLejTkQtbNJMY8apAjTm1bgQf7em1wDV7S", "message": "Debugging!" } ] } ] } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/multisig/address": { "post": { "tags": [ "Multi-signature" ], "summary": "Create the multisig address and unlock script", "operationId": "postMultisigAddress", "requestBody": { "description": "Format 1: `1000000000000000000`\n\nFormat 2: `x.y ALPH`, where `1 ALPH = 1000000000000000000\n\nField fromPublicKeyType can be `default` or `bip340-schnorr`", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BuildMultisigAddress" }, "example": { "keys": [ "d1b70d2226308b46da297486adb6b4f1a8c1842cb159ac5ec04f384fe2d6f5da28", "d1b70d2226308b46da297486adb6b4f1a8c1842cb159ac5ec04f384fe2d6f5da28" ], "mrequired": 1 } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BuildMultisigAddressResult" }, "example": { "address": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y" } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/multisig/build": { "post": { "tags": [ "Multi-signature" ], "summary": "Build a multisig unsigned transaction", "operationId": "postMultisigBuild", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BuildMultisig" }, "examples": { "Example0": { "summary": "Default", "value": { "fromAddress": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "fromPublicKeys": [ "d1b70d2226308b46da297486adb6b4f1a8c1842cb159ac5ec04f384fe2d6f5da28" ], "destinations": [ { "address": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "attoAlphAmount": "2000000000000000000" } ] } }, "Example1": { "summary": "More settings", "value": { "fromAddress": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "fromPublicKeys": [ "d1b70d2226308b46da297486adb6b4f1a8c1842cb159ac5ec04f384fe2d6f5da28" ], "destinations": [ { "address": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "attoAlphAmount": "2000000000000000000", "tokens": [ { "id": "2d11fd6c12435ffb07aaed4d190a505b621b927a5f6e51b61ce0ebe186397bdd", "amount": "42000000000000000000" }, { "id": "bd165d20bd063c7a023d22232a1e75bf46e904067f92b49323fe89fa0fd586bf", "amount": "1000000000000000000000" } ], "lockTime": 1611041396892 } ], "gas": 20000, "gasPrice": "100000000000" } } } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BuildTransactionResult" }, "example": { "unsignedTx": "35d1b2a520a0da34c5eb8d712aa9cc", "gasAmount": 20000, "gasPrice": "100000000000", "txId": "503bfb16230888af4924aa8f8250d7d348b862e267d75d3147f1998050b6da69", "fromGroup": 2, "toGroup": 1 } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/multisig/sweep": { "post": { "tags": [ "Multi-signature" ], "summary": "Sweep all unlocked ALPH and token balances of a multisig address to another address", "operationId": "postMultisigSweep", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BuildSweepMultisig" }, "examples": { "Example0": { "summary": "Default", "value": { "fromAddress": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "fromPublicKeys": [ "d1b70d2226308b46da297486adb6b4f1a8c1842cb159ac5ec04f384fe2d6f5da28" ], "toAddress": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y" } }, "Example1": { "summary": "More settings", "value": { "fromAddress": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "fromPublicKeys": [ "d1b70d2226308b46da297486adb6b4f1a8c1842cb159ac5ec04f384fe2d6f5da28" ], "toAddress": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y", "maxAttoAlphPerUTXO": "1000000000000000000", "lockTime": 1611041396892, "gasAmount": 20000, "gasPrice": "100000000000", "utxosLimit": 10, "targetBlockHash": "bdaf9dc514ce7d34b6474b8ca10a3dfb93ba997cb9d5ff1ea724ebe2af48abe5" } } } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BuildSweepAddressTransactionsResult" }, "example": { "unsignedTxs": [ { "txId": "503bfb16230888af4924aa8f8250d7d348b862e267d75d3147f1998050b6da69", "unsignedTx": "35d1b2a520a0da34c5eb8d712aa9cc", "gasAmount": 20000, "gasPrice": "100000000000" } ], "fromGroup": 2, "toGroup": 1 } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/multisig/submit": { "post": { "tags": [ "Multi-signature" ], "summary": "Submit a multi-signed transaction", "operationId": "postMultisigSubmit", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubmitMultisig" }, "example": { "unsignedTx": "35d1b2a520a0da34c5eb8d712aa9cc", "signatures": [ "9e1a35b2931bd04e6780d01c36e3e5337941aa80f173cfe4f4e249c44ab135272b834c1a639db9c89d673a8a30524042b0469672ca845458a5a0cf2cad53221b" ] } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubmitTxResult" }, "example": { "txId": "503bfb16230888af4924aa8f8250d7d348b862e267d75d3147f1998050b6da69", "fromGroup": 2, "toGroup": 1 } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/miners/cpu-mining": { "post": { "tags": [ "Miners" ], "summary": "Execute an action on CPU miner. !!! for test only !!!", "operationId": "postMinersCpu-mining", "parameters": [ { "name": "action", "in": "query", "required": true, "schema": { "type": "string" }, "examples": { "Start mining": { "value": "start-mining" }, "Stop mining": { "value": "stop-mining" } } } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "boolean" }, "example": true } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/miners/cpu-mining/mine-one-block": { "post": { "tags": [ "Miners" ], "summary": "Mine a block on CPU miner. !!! for test only !!!", "operationId": "postMinersCpu-miningMine-one-block", "parameters": [ { "name": "fromGroup", "in": "query", "required": true, "schema": { "type": "integer", "format": "int32" } }, { "name": "toGroup", "in": "query", "required": true, "schema": { "type": "integer", "format": "int32" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "boolean" }, "example": true } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/miners/addresses": { "get": { "tags": [ "Miners" ], "summary": "List miner's addresses", "operationId": "getMinersAddresses", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MinerAddresses" }, "example": { "addresses": [ "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y" ] } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } }, "put": { "tags": [ "Miners" ], "summary": "Update miner's addresses, but better to use user.conf instead", "operationId": "putMinersAddresses", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MinerAddresses" }, "example": { "addresses": [ "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y" ] } } }, "required": true }, "responses": { "200": { }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/events/contract/{contractAddress}": { "get": { "tags": [ "Events" ], "summary": "Get events for a contract within a counter range", "operationId": "getEventsContractContractaddress", "parameters": [ { "name": "contractAddress", "in": "path", "required": true, "schema": { "type": "string", "format": "address" } }, { "name": "start", "in": "query", "required": true, "schema": { "type": "integer", "format": "int32" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "format": "int32" } }, { "name": "group", "in": "query", "required": false, "schema": { "type": "integer", "format": "int32" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ContractEvents" }, "example": { "events": [ { "blockHash": "bdaf9dc514ce7d34b6474b8ca10a3dfb93ba997cb9d5ff1ea724ebe2af48abe5", "txId": "503bfb16230888af4924aa8f8250d7d348b862e267d75d3147f1998050b6da69", "eventIndex": 1, "fields": [ { "type": "Address", "value": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y" }, { "type": "U256", "value": "10" } ] } ], "nextStart": 2 } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/events/contract/{contractAddress}/current-count": { "get": { "tags": [ "Events" ], "summary": "Get current value of the events counter for a contract", "operationId": "getEventsContractContractaddressCurrent-count", "parameters": [ { "name": "contractAddress", "in": "path", "required": true, "schema": { "type": "string", "format": "address" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "integer", "format": "int32" }, "example": 100 } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/events/tx-id/{txId}": { "get": { "tags": [ "Events" ], "summary": "Get contract events for a transaction", "operationId": "getEventsTx-idTxid", "parameters": [ { "name": "txId", "in": "path", "required": true, "schema": { "type": "string", "format": "32-byte-hash" } }, { "name": "group", "in": "query", "required": false, "schema": { "type": "integer", "format": "int32" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ContractEventsByTxId" }, "example": { "events": [ { "blockHash": "bdaf9dc514ce7d34b6474b8ca10a3dfb93ba997cb9d5ff1ea724ebe2af48abe5", "contractAddress": "vSxdLL2kE3o6vJBdKkdgmS3W39G3ZEmFHpo2y1jnbzBq", "eventIndex": 1, "fields": [ { "type": "Address", "value": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y" }, { "type": "U256", "value": "10" } ] } ] } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/events/block-hash/{blockHash}": { "get": { "tags": [ "Events" ], "summary": "Get contract events for a block", "operationId": "getEventsBlock-hashBlockhash", "parameters": [ { "name": "blockHash", "in": "path", "required": true, "schema": { "type": "string", "format": "block-hash" } }, { "name": "group", "in": "query", "required": false, "schema": { "type": "integer", "format": "int32" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ContractEventsByBlockHash" }, "example": { "events": [ { "txId": "503bfb16230888af4924aa8f8250d7d348b862e267d75d3147f1998050b6da69", "contractAddress": "vSxdLL2kE3o6vJBdKkdgmS3W39G3ZEmFHpo2y1jnbzBq", "eventIndex": 1, "fields": [ { "type": "Address", "value": "1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y" }, { "type": "U256", "value": "10" } ] } ] } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/utils/verify-signature": { "post": { "tags": [ "Utils" ], "summary": "Verify the SecP256K1 signature of some data", "operationId": "postUtilsVerify-signature", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VerifySignature" }, "example": { "data": "35d1b2a520a0da34c5eb8d712aa9cc", "signature": "9e1a35b2931bd04e6780d01c36e3e5337941aa80f173cfe4f4e249c44ab135272b834c1a639db9c89d673a8a30524042b0469672ca845458a5a0cf2cad53221b", "publicKey": "d1b70d2226308b46da297486adb6b4f1a8c1842cb159ac5ec04f384fe2d6f5da28" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "type": "boolean" }, "example": true } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/utils/target-to-hashrate": { "post": { "tags": [ "Utils" ], "summary": "Convert a target to hashrate", "operationId": "postUtilsTarget-to-hashrate", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TargetToHashrate" }, "example": { "target": "1b032b55" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Result" }, "example": { "hashrate": "355255758493400" } } } }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } }, "/utils/check-hash-indexing": { "put": { "tags": [ "Utils" ], "summary": "Check and repair the indexing of block hashes", "operationId": "putUtilsCheck-hash-indexing", "responses": { "200": { }, "400": { "description": "BadRequest", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" }, "example": { "detail": "Something bad in the request" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" }, "example": { "detail": "You shall not pass" } } } }, "404": { "description": "NotFound", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" }, "example": { "resource": "wallet-name", "detail": "wallet-name not found" } } } }, "500": { "description": "InternalServerError", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" }, "example": { "detail": "Ouch" } } } }, "503": { "description": "ServiceUnavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" }, "example": { "detail": "Self clique unsynced" } } } } } } } }, "components": { "schemas": { "AddressBalance": { "required": [ "address", "balance", "balanceHint", "lockedBalance", "lockedBalanceHint" ], "type": "object", "properties": { "address": { "type": "string", "format": "address" }, "balance": { "type": "string", "format": "uint256" }, "balanceHint": { "type": "string", "format": "x.x ALPH" }, "lockedBalance": { "type": "string", "format": "uint256" }, "lockedBalanceHint": { "type": "string", "format": "x.x ALPH" }, "warning": { "type": "string" } } }, "AddressInfo": { "required": [ "address", "publicKey", "group", "path" ], "type": "object", "properties": { "address": { "type": "string", "format": "address" }, "publicKey": { "type": "string", "format": "public-key" }, "group": { "type": "integer", "format": "group-index" }, "path": { "type": "string" } } }, "Addresses": { "required": [ "activeAddress", "addresses" ], "type": "object", "properties": { "activeAddress": { "type": "string", "format": "address" }, "addresses": { "type": "array", "items": { "$ref": "#/components/schemas/AddressInfo" } } } }, "AssetInput": { "required": [ "outputRef", "unlockScript" ], "type": "object", "properties": { "outputRef": { "$ref": "#/components/schemas/OutputRef" }, "unlockScript": { "type": "string", "format": "hex-string" } } }, "AssetOutput": { "required": [ "hint", "key", "attoAlphAmount", "address", "tokens", "lockTime", "message", "type" ], "type": "object", "properties": { "hint": { "type": "integer", "format": "int32" }, "key": { "type": "string", "format": "32-byte-hash" }, "attoAlphAmount": { "type": "string", "format": "uint256" }, "address": { "type": "string", "format": "address" }, "tokens": { "type": "array", "items": { "$ref": "#/components/schemas/Token" } }, "lockTime": { "type": "integer", "format": "int64" }, "message": { "type": "string", "format": "hex-string" }, "type": { "type": "string" } } }, "AssetState": { "required": [ "attoAlphAmount" ], "type": "object", "properties": { "attoAlphAmount": { "type": "string", "format": "uint256" }, "tokens": { "type": "array", "items": { "$ref": "#/components/schemas/Token" } } } }, "BadRequest": { "required": [ "detail" ], "type": "object", "properties": { "detail": { "type": "string" } } }, "Balance": { "required": [ "balance", "balanceHint", "lockedBalance", "lockedBalanceHint", "utxoNum" ], "type": "object", "properties": { "balance": { "type": "string", "format": "uint256" }, "balanceHint": { "type": "string", "format": "x.x ALPH" }, "lockedBalance": { "type": "string", "format": "uint256" }, "lockedBalanceHint": { "type": "string", "format": "x.x ALPH" }, "tokenBalances": { "type": "array", "items": { "$ref": "#/components/schemas/Token" } }, "lockedTokenBalances": { "type": "array", "items": { "$ref": "#/components/schemas/Token" } }, "utxoNum": { "type": "integer", "format": "int32" }, "warning": { "type": "string" } } }, "Balances": { "required": [ "totalBalance", "totalBalanceHint", "balances" ], "type": "object", "properties": { "totalBalance": { "type": "string", "format": "uint256" }, "totalBalanceHint": { "type": "string", "format": "x.x ALPH" }, "balances": { "type": "array", "items": { "$ref": "#/components/schemas/AddressBalance" } } } }, "Ban": { "required": [ "peers", "type" ], "type": "object", "properties": { "peers": { "type": "array", "items": { "type": "string", "format": "inet-address" } }, "type": { "type": "string" } } }, "Banned": { "required": [ "until", "type" ], "type": "object", "properties": { "until": { "type": "integer", "format": "int64" }, "type": { "type": "string" } } }, "BlockAndEvents": { "required": [ "block", "events" ], "type": "object", "properties": { "block": { "$ref": "#/components/schemas/BlockEntry" }, "events": { "type": "array", "items": { "$ref": "#/components/schemas/ContractEventByBlockHash" } } } }, "BlockEntry": { "required": [ "hash", "timestamp", "chainFrom", "chainTo", "height", "deps", "transactions", "nonce", "version", "depStateHash", "txsHash", "target" ], "type": "object", "properties": { "hash": { "type": "string", "format": "block-hash" }, "timestamp": { "type": "integer", "format": "int64" }, "chainFrom": { "type": "integer", "format": "int32" }, "chainTo": { "type": "integer", "format": "int32" }, "height": { "type": "integer", "format": "int32" }, "deps": { "type": "array", "items": { "type": "string", "format": "block-hash" } }, "transactions": { "type": "array", "items": { "$ref": "#/components/schemas/Transaction" } }, "nonce": { "type": "string", "format": "hex-string" }, "version": { "type": "integer" }, "depStateHash": { "type": "string", "format": "32-byte-hash" }, "txsHash": { "type": "string", "format": "32-byte-hash" }, "target": { "type": "string", "format": "hex-string" } } }, "BlockHeaderEntry": { "required": [ "hash", "timestamp", "chainFrom", "chainTo", "height", "deps" ], "type": "object", "properties": { "hash": { "type": "string", "format": "block-hash" }, "timestamp": { "type": "integer", "format": "int64" }, "chainFrom": { "type": "integer", "format": "int32" }, "chainTo": { "type": "integer", "format": "int32" }, "height": { "type": "integer", "format": "int32" }, "deps": { "type": "array", "items": { "type": "string", "format": "block-hash" } } } }, "BlocksAndEventsPerTimeStampRange": { "required": [ "blocksAndEvents" ], "type": "object", "properties": { "blocksAndEvents": { "type": "array", "items": { "type": "array", "items": { "$ref": "#/components/schemas/BlockAndEvents" } } } } }, "BlocksPerTimeStampRange": { "required": [ "blocks" ], "type": "object", "properties": { "blocks": { "type": "array", "items": { "type": "array", "items": { "$ref": "#/components/schemas/BlockEntry" } } } } }, "BrokerInfo": { "required": [ "cliqueId", "brokerId", "brokerNum", "address" ], "type": "object", "properties": { "cliqueId": { "type": "string", "format": "clique-id" }, "brokerId": { "type": "integer", "format": "int32" }, "brokerNum": { "type": "integer", "format": "int32" }, "address": { "required": [ "addr", "port" ], "type": "object", "properties": { "addr": { "type": "string" }, "port": { "type": "integer", "format": "int32" } }, "format": "inet-socket-address" } } }, "BuildDeployContractTx": { "required": [ "fromPublicKey", "bytecode" ], "type": "object", "properties": { "fromPublicKey": { "type": "string", "format": "hex-string" }, "fromPublicKeyType": { "type": "string", "format": "hex-string" }, "bytecode": { "type": "string", "format": "hex-string" }, "initialAttoAlphAmount": { "type": "string", "format": "uint256" }, "initialTokenAmounts": { "type": "array", "items": { "$ref": "#/components/schemas/Token" } }, "issueTokenAmount": { "type": "string", "format": "uint256" }, "issueTokenTo": { "type": "string", "format": "address" }, "gasAmount": { "type": "integer", "format": "gas" }, "gasPrice": { "type": "string", "format": "uint256" }, "targetBlockHash": { "type": "string", "format": "block-hash" } } }, "BuildDeployContractTxResult": { "required": [ "fromGroup", "toGroup", "unsignedTx", "gasAmount", "gasPrice", "txId", "contractAddress" ], "type": "object", "properties": { "fromGroup": { "type": "integer", "format": "int32" }, "toGroup": { "type": "integer", "format": "int32" }, "unsignedTx": { "type": "string" }, "gasAmount": { "type": "integer", "format": "gas" }, "gasPrice": { "type": "string", "format": "uint256" }, "txId": { "type": "string", "format": "32-byte-hash" }, "contractAddress": { "type": "string", "format": "address" } } }, "BuildExecuteScriptTx": { "required": [ "fromPublicKey", "bytecode" ], "type": "object", "properties": { "fromPublicKey": { "type": "string", "format": "hex-string" }, "fromPublicKeyType": { "type": "string", "format": "hex-string" }, "bytecode": { "type": "string", "format": "hex-string" }, "attoAlphAmount": { "type": "string", "format": "uint256" }, "tokens": { "type": "array", "items": { "$ref": "#/components/schemas/Token" } }, "gasAmount": { "type": "integer", "format": "gas" }, "gasPrice": { "type": "string", "format": "uint256" }, "targetBlockHash": { "type": "string", "format": "block-hash" } } }, "BuildExecuteScriptTxResult": { "required": [ "fromGroup", "toGroup", "unsignedTx", "gasAmount", "gasPrice", "txId" ], "type": "object", "properties": { "fromGroup": { "type": "integer", "format": "int32" }, "toGroup": { "type": "integer", "format": "int32" }, "unsignedTx": { "type": "string" }, "gasAmount": { "type": "integer", "format": "gas" }, "gasPrice": { "type": "string", "format": "uint256" }, "txId": { "type": "string", "format": "32-byte-hash" } } }, "BuildInfo": { "required": [ "releaseVersion", "commit" ], "type": "object", "properties": { "releaseVersion": { "type": "string" }, "commit": { "type": "string" } } }, "BuildMultiAddressesTransaction": { "required": [ "from" ], "type": "object", "properties": { "from": { "type": "array", "items": { "$ref": "#/components/schemas/Source" } }, "gasPrice": { "type": "string", "format": "uint256" }, "targetBlockHash": { "type": "string", "format": "block-hash" } } }, "BuildMultisig": { "required": [ "fromAddress", "fromPublicKeys", "destinations" ], "type": "object", "properties": { "fromAddress": { "type": "string", "format": "address" }, "fromPublicKeys": { "type": "array", "items": { "type": "string", "format": "public-key" } }, "destinations": { "type": "array", "items": { "$ref": "#/components/schemas/Destination" } }, "gas": { "type": "integer", "format": "gas" }, "gasPrice": { "type": "string", "format": "uint256" } } }, "BuildMultisigAddress": { "required": [ "keys", "mrequired" ], "type": "object", "properties": { "keys": { "type": "array", "items": { "type": "string", "format": "public-key" } }, "mrequired": { "type": "integer", "format": "int32" } } }, "BuildMultisigAddressResult": { "required": [ "address" ], "type": "object", "properties": { "address": { "type": "string", "format": "address" } } }, "BuildSweepAddressTransactions": { "required": [ "fromPublicKey", "toAddress" ], "type": "object", "properties": { "fromPublicKey": { "type": "string", "format": "public-key" }, "toAddress": { "type": "string", "format": "address" }, "maxAttoAlphPerUTXO": { "type": "string", "format": "uint256" }, "lockTime": { "type": "integer", "format": "int64" }, "gasAmount": { "type": "integer", "format": "gas" }, "gasPrice": { "type": "string", "format": "uint256" }, "targetBlockHash": { "type": "string", "format": "block-hash" } } }, "BuildSweepAddressTransactionsResult": { "required": [ "unsignedTxs", "fromGroup", "toGroup" ], "type": "object", "properties": { "unsignedTxs": { "type": "array", "items": { "$ref": "#/components/schemas/SweepAddressTransaction" } }, "fromGroup": { "type": "integer", "format": "int32" }, "toGroup": { "type": "integer", "format": "int32" } } }, "BuildSweepMultisig": { "required": [ "fromAddress", "fromPublicKeys", "toAddress" ], "type": "object", "properties": { "fromAddress": { "type": "string", "format": "address" }, "fromPublicKeys": { "type": "array", "items": { "type": "string", "format": "public-key" } }, "toAddress": { "type": "string", "format": "address" }, "maxAttoAlphPerUTXO": { "type": "string", "format": "uint256" }, "lockTime": { "type": "integer", "format": "int64" }, "gasAmount": { "type": "integer", "format": "gas" }, "gasPrice": { "type": "string", "format": "uint256" }, "utxosLimit": { "type": "integer", "format": "int32" }, "targetBlockHash": { "type": "string", "format": "block-hash" } } }, "BuildTransaction": { "required": [ "fromPublicKey", "destinations" ], "type": "object", "properties": { "fromPublicKey": { "type": "string", "format": "hex-string" }, "fromPublicKeyType": { "type": "string", "format": "hex-string" }, "destinations": { "type": "array", "items": { "$ref": "#/components/schemas/Destination" } }, "utxos": { "type": "array", "items": { "$ref": "#/components/schemas/OutputRef" } }, "gasAmount": { "type": "integer", "format": "gas" }, "gasPrice": { "type": "string", "format": "uint256" }, "targetBlockHash": { "type": "string", "format": "block-hash" } } }, "BuildTransactionResult": { "required": [ "unsignedTx", "gasAmount", "gasPrice", "txId", "fromGroup", "toGroup" ], "type": "object", "properties": { "unsignedTx": { "type": "string" }, "gasAmount": { "type": "integer", "format": "gas" }, "gasPrice": { "type": "string", "format": "uint256" }, "txId": { "type": "string", "format": "32-byte-hash" }, "fromGroup": { "type": "integer", "format": "int32" }, "toGroup": { "type": "integer", "format": "int32" } } }, "CallContract": { "required": [ "group", "address", "methodIndex" ], "type": "object", "properties": { "group": { "type": "integer", "format": "int32" }, "worldStateBlockHash": { "type": "string", "format": "block-hash" }, "txId": { "type": "string", "format": "32-byte-hash" }, "address": { "type": "string", "format": "address" }, "callerAddress": { "type": "string", "format": "address" }, "methodIndex": { "type": "integer", "format": "int32" }, "args": { "type": "array", "items": { "$ref": "#/components/schemas/Val" } }, "existingContracts": { "type": "array", "items": { "type": "string", "format": "address" } }, "inputAssets": { "type": "array", "items": { "$ref": "#/components/schemas/TestInputAsset" } } } }, "CallContractFailed": { "required": [ "error", "type" ], "type": "object", "properties": { "error": { "type": "string" }, "type": { "type": "string" } } }, "CallContractResult": { "oneOf": [ { "$ref": "#/components/schemas/CallContractFailed" }, { "$ref": "#/components/schemas/CallContractSucceeded" } ], "discriminator": { "propertyName": "type", "mapping": { "CallContractFailed": "#/components/schemas/CallContractFailed", "CallContractSucceeded": "#/components/schemas/CallContractSucceeded" } } }, "CallContractSucceeded": { "required": [ "returns", "gasUsed", "contracts", "txInputs", "txOutputs", "events", "debugMessages", "type" ], "type": "object", "properties": { "returns": { "type": "array", "items": { "$ref": "#/components/schemas/Val" } }, "gasUsed": { "type": "integer", "format": "int32" }, "contracts": { "type": "array", "items": { "$ref": "#/components/schemas/ContractState" } }, "txInputs": { "type": "array", "items": { "type": "string", "format": "address" } }, "txOutputs": { "type": "array", "items": { "$ref": "#/components/schemas/Output" } }, "events": { "type": "array", "items": { "$ref": "#/components/schemas/ContractEventByTxId" } }, "debugMessages": { "type": "array", "items": { "$ref": "#/components/schemas/DebugMessage" } }, "type": { "type": "string" } } }, "ChainInfo": { "required": [ "currentHeight" ], "type": "object", "properties": { "currentHeight": { "type": "integer", "format": "int32" } } }, "ChainParams": { "required": [ "networkId", "numZerosAtLeastInHash", "groupNumPerBroker", "groups" ], "type": "object", "properties": { "networkId": { "type": "integer" }, "numZerosAtLeastInHash": { "type": "integer", "format": "int32" }, "groupNumPerBroker": { "type": "integer", "format": "int32" }, "groups": { "type": "integer", "format": "int32" } } }, "ChangeActiveAddress": { "required": [ "address" ], "type": "object", "properties": { "address": { "type": "string", "format": "address" } } }, "CompileContractResult": { "required": [ "version", "name", "bytecode", "bytecodeDebugPatch", "codeHash", "codeHashDebug", "fields", "functions", "constants", "enums", "events", "warnings" ], "type": "object", "properties": { "version": { "type": "string" }, "name": { "type": "string" }, "bytecode": { "type": "string" }, "bytecodeDebugPatch": { "type": "string" }, "codeHash": { "type": "string", "format": "32-byte-hash" }, "codeHashDebug": { "type": "string", "format": "32-byte-hash" }, "fields": { "$ref": "#/components/schemas/FieldsSig" }, "functions": { "type": "array", "items": { "$ref": "#/components/schemas/FunctionSig" } }, "constants": { "type": "array", "items": { "$ref": "#/components/schemas/Constant" } }, "enums": { "type": "array", "items": { "$ref": "#/components/schemas/Enum" } }, "events": { "type": "array", "items": { "$ref": "#/components/schemas/EventSig" } }, "warnings": { "type": "array", "items": { "type": "string" } }, "stdInterfaceId": { "type": "string" } } }, "CompileProjectResult": { "required": [ "contracts", "scripts" ], "type": "object", "properties": { "contracts": { "type": "array", "items": { "$ref": "#/components/schemas/CompileContractResult" } }, "scripts": { "type": "array", "items": { "$ref": "#/components/schemas/CompileScriptResult" } }, "structs": { "type": "array", "items": { "$ref": "#/components/schemas/StructSig" } } } }, "CompileScriptResult": { "required": [ "version", "name", "bytecodeTemplate", "bytecodeDebugPatch", "fields", "functions", "warnings" ], "type": "object", "properties": { "version": { "type": "string" }, "name": { "type": "string" }, "bytecodeTemplate": { "type": "string" }, "bytecodeDebugPatch": { "type": "string" }, "fields": { "$ref": "#/components/schemas/FieldsSig" }, "functions": { "type": "array", "items": { "$ref": "#/components/schemas/FunctionSig" } }, "warnings": { "type": "array", "items": { "type": "string" } } } }, "CompilerOptions": { "type": "object", "properties": { "ignoreUnusedConstantsWarnings": { "type": "boolean" }, "ignoreUnusedVariablesWarnings": { "type": "boolean" }, "ignoreUnusedFieldsWarnings": { "type": "boolean" }, "ignoreUnusedPrivateFunctionsWarnings": { "type": "boolean" }, "ignoreUpdateFieldsCheckWarnings": { "type": "boolean" }, "ignoreCheckExternalCallerWarnings": { "type": "boolean" } } }, "Confirmed": { "required": [ "blockHash", "txIndex", "chainConfirmations", "fromGroupConfirmations", "toGroupConfirmations", "type" ], "type": "object", "properties": { "blockHash": { "type": "string", "format": "block-hash" }, "txIndex": { "type": "integer", "format": "int32" }, "chainConfirmations": { "type": "integer", "format": "int32" }, "fromGroupConfirmations": { "type": "integer", "format": "int32" }, "toGroupConfirmations": { "type": "integer", "format": "int32" }, "type": { "type": "string" } } }, "Constant": { "required": [ "name", "value" ], "type": "object", "properties": { "name": { "type": "string" }, "value": { "$ref": "#/components/schemas/Val" } } }, "Contract": { "required": [ "code" ], "type": "object", "properties": { "code": { "type": "string" }, "compilerOptions": { "$ref": "#/components/schemas/CompilerOptions" } } }, "ContractEvent": { "required": [ "blockHash", "txId", "eventIndex", "fields" ], "type": "object", "properties": { "blockHash": { "type": "string", "format": "block-hash" }, "txId": { "type": "string", "format": "32-byte-hash" }, "eventIndex": { "type": "integer", "format": "int32" }, "fields": { "type": "array", "items": { "$ref": "#/components/schemas/Val" } } } }, "ContractEventByBlockHash": { "required": [ "txId", "contractAddress", "eventIndex", "fields" ], "type": "object", "properties": { "txId": { "type": "string", "format": "32-byte-hash" }, "contractAddress": { "type": "string", "format": "address" }, "eventIndex": { "type": "integer", "format": "int32" }, "fields": { "type": "array", "items": { "$ref": "#/components/schemas/Val" } } } }, "ContractEventByTxId": { "required": [ "blockHash", "contractAddress", "eventIndex", "fields" ], "type": "object", "properties": { "blockHash": { "type": "string", "format": "block-hash" }, "contractAddress": { "type": "string", "format": "address" }, "eventIndex": { "type": "integer", "format": "int32" }, "fields": { "type": "array", "items": { "$ref": "#/components/schemas/Val" } } } }, "ContractEvents": { "required": [ "events", "nextStart" ], "type": "object", "properties": { "events": { "type": "array", "items": { "$ref": "#/components/schemas/ContractEvent" } }, "nextStart": { "type": "integer", "format": "int32" } } }, "ContractEventsByBlockHash": { "required": [ "events" ], "type": "object", "properties": { "events": { "type": "array", "items": { "$ref": "#/components/schemas/ContractEventByBlockHash" } } } }, "ContractEventsByTxId": { "required": [ "events" ], "type": "object", "properties": { "events": { "type": "array", "items": { "$ref": "#/components/schemas/ContractEventByTxId" } } } }, "ContractOutput": { "required": [ "hint", "key", "attoAlphAmount", "address", "tokens", "type" ], "type": "object", "properties": { "hint": { "type": "integer", "format": "int32" }, "key": { "type": "string", "format": "32-byte-hash" }, "attoAlphAmount": { "type": "string", "format": "uint256" }, "address": { "type": "string", "format": "address" }, "tokens": { "type": "array", "items": { "$ref": "#/components/schemas/Token" } }, "type": { "type": "string" } } }, "ContractState": { "required": [ "address", "bytecode", "codeHash", "immFields", "mutFields", "asset" ], "type": "object", "properties": { "address": { "type": "string", "format": "address" }, "bytecode": { "type": "string", "format": "contract" }, "codeHash": { "type": "string", "format": "32-byte-hash" }, "initialStateHash": { "type": "string", "format": "32-byte-hash" }, "immFields": { "type": "array", "items": { "$ref": "#/components/schemas/Val" } }, "mutFields": { "type": "array", "items": { "$ref": "#/components/schemas/Val" } }, "asset": { "$ref": "#/components/schemas/AssetState" } } }, "DebugMessage": { "required": [ "contractAddress", "message" ], "type": "object", "properties": { "contractAddress": { "type": "string", "format": "address" }, "message": { "type": "string" } } }, "DecodeUnsignedTx": { "required": [ "unsignedTx" ], "type": "object", "properties": { "unsignedTx": { "type": "string" } } }, "DecodeUnsignedTxResult": { "required": [ "fromGroup", "toGroup", "unsignedTx" ], "type": "object", "properties": { "fromGroup": { "type": "integer", "format": "int32" }, "toGroup": { "type": "integer", "format": "int32" }, "unsignedTx": { "$ref": "#/components/schemas/UnsignedTx" } } }, "Destination": { "required": [ "address", "attoAlphAmount" ], "type": "object", "properties": { "address": { "type": "string", "format": "address" }, "attoAlphAmount": { "type": "string", "format": "uint256" }, "tokens": { "type": "array", "items": { "$ref": "#/components/schemas/Token" } }, "lockTime": { "type": "integer", "format": "int64" }, "message": { "type": "string", "format": "hex-string" } } }, "DiscoveryAction": { "oneOf": [ { "$ref": "#/components/schemas/Reachable" }, { "$ref": "#/components/schemas/Unreachable" } ], "discriminator": { "propertyName": "type", "mapping": { "Reachable": "#/components/schemas/Reachable", "Unreachable": "#/components/schemas/Unreachable" } } }, "Enum": { "required": [ "name", "fields" ], "type": "object", "properties": { "name": { "type": "string" }, "fields": { "type": "array", "items": { "$ref": "#/components/schemas/EnumField" } } } }, "EnumField": { "required": [ "name", "value" ], "type": "object", "properties": { "name": { "type": "string" }, "value": { "$ref": "#/components/schemas/Val" } } }, "EventSig": { "required": [ "name", "fieldNames", "fieldTypes" ], "type": "object", "properties": { "name": { "type": "string" }, "fieldNames": { "type": "array", "items": { "type": "string" } }, "fieldTypes": { "type": "array", "items": { "type": "string" } } } }, "FieldsSig": { "required": [ "names", "types", "isMutable" ], "type": "object", "properties": { "names": { "type": "array", "items": { "type": "string" } }, "types": { "type": "array", "items": { "type": "string" } }, "isMutable": { "type": "array", "items": { "type": "boolean" } } } }, "FixedAssetOutput": { "required": [ "hint", "key", "attoAlphAmount", "address", "tokens", "lockTime", "message" ], "type": "object", "properties": { "hint": { "type": "integer", "format": "int32" }, "key": { "type": "string", "format": "32-byte-hash" }, "attoAlphAmount": { "type": "string", "format": "uint256" }, "address": { "type": "string", "format": "address" }, "tokens": { "type": "array", "items": { "$ref": "#/components/schemas/Token" } }, "lockTime": { "type": "integer", "format": "int64" }, "message": { "type": "string", "format": "hex-string" } } }, "FunctionSig": { "required": [ "name", "usePreapprovedAssets", "useAssetsInContract", "isPublic", "paramNames", "paramTypes", "paramIsMutable", "returnTypes" ], "type": "object", "properties": { "name": { "type": "string" }, "usePreapprovedAssets": { "type": "boolean" }, "useAssetsInContract": { "type": "boolean" }, "isPublic": { "type": "boolean" }, "paramNames": { "type": "array", "items": { "type": "string" } }, "paramTypes": { "type": "array", "items": { "type": "string" } }, "paramIsMutable": { "type": "array", "items": { "type": "boolean" } }, "returnTypes": { "type": "array", "items": { "type": "string" } } } }, "Group": { "required": [ "group" ], "type": "object", "properties": { "group": { "type": "integer", "format": "int32" } } }, "HashesAtHeight": { "required": [ "headers" ], "type": "object", "properties": { "headers": { "type": "array", "items": { "type": "string", "format": "block-hash" } } } }, "InterCliquePeerInfo": { "required": [ "cliqueId", "brokerId", "groupNumPerBroker", "address", "isSynced", "clientVersion" ], "type": "object", "properties": { "cliqueId": { "type": "string", "format": "clique-id" }, "brokerId": { "type": "integer", "format": "int32" }, "groupNumPerBroker": { "type": "integer", "format": "int32" }, "address": { "required": [ "addr", "port" ], "type": "object", "properties": { "addr": { "type": "string" }, "port": { "type": "integer", "format": "int32" } }, "format": "inet-socket-address" }, "isSynced": { "type": "boolean" }, "clientVersion": { "type": "string" } } }, "InternalServerError": { "required": [ "detail" ], "type": "object", "properties": { "detail": { "type": "string" } } }, "MemPooled": { "required": [ "type" ], "type": "object", "properties": { "type": { "type": "string" } } }, "MempoolTransactions": { "required": [ "fromGroup", "toGroup", "transactions" ], "type": "object", "properties": { "fromGroup": { "type": "integer", "format": "int32" }, "toGroup": { "type": "integer", "format": "int32" }, "transactions": { "type": "array", "items": { "$ref": "#/components/schemas/TransactionTemplate" } } } }, "MinerAddresses": { "required": [ "addresses" ], "type": "object", "properties": { "addresses": { "type": "array", "items": { "type": "string", "format": "address" } } } }, "MinerAddressesInfo": { "required": [ "addresses" ], "type": "object", "properties": { "addresses": { "type": "array", "items": { "$ref": "#/components/schemas/AddressInfo" } } } }, "MisbehaviorAction": { "oneOf": [ { "$ref": "#/components/schemas/Ban" }, { "$ref": "#/components/schemas/Unban" } ], "discriminator": { "propertyName": "type", "mapping": { "Ban": "#/components/schemas/Ban", "Unban": "#/components/schemas/Unban" } } }, "MultipleCallContract": { "required": [ "calls" ], "type": "object", "properties": { "calls": { "type": "array", "items": { "$ref": "#/components/schemas/CallContract" } } } }, "MultipleCallContractResult": { "required": [ "results" ], "type": "object", "properties": { "results": { "type": "array", "items": { "$ref": "#/components/schemas/CallContractResult" } } } }, "NodeInfo": { "required": [ "buildInfo", "upnp" ], "type": "object", "properties": { "buildInfo": { "$ref": "#/components/schemas/BuildInfo" }, "upnp": { "type": "boolean" }, "externalAddress": { "required": [ "addr", "port" ], "type": "object", "properties": { "addr": { "type": "string" }, "port": { "type": "integer", "format": "int32" } }, "format": "inet-socket-address" } } }, "NodeVersion": { "required": [ "version" ], "type": "object", "properties": { "version": { "type": "string", "format": "semver" } } }, "NotFound": { "required": [ "detail", "resource" ], "type": "object", "properties": { "detail": { "type": "string" }, "resource": { "type": "string" } } }, "Output": { "oneOf": [ { "$ref": "#/components/schemas/AssetOutput" }, { "$ref": "#/components/schemas/ContractOutput" } ], "discriminator": { "propertyName": "type", "mapping": { "AssetOutput": "#/components/schemas/AssetOutput", "ContractOutput": "#/components/schemas/ContractOutput" } } }, "OutputRef": { "required": [ "hint", "key" ], "type": "object", "properties": { "hint": { "type": "integer", "format": "int32" }, "key": { "type": "string", "format": "32-byte-hash" } } }, "PeerAddress": { "required": [ "address", "restPort", "wsPort", "minerApiPort" ], "type": "object", "properties": { "address": { "type": "string", "format": "inet-address" }, "restPort": { "type": "integer", "format": "int32" }, "wsPort": { "type": "integer", "format": "int32" }, "minerApiPort": { "type": "integer", "format": "int32" } } }, "PeerMisbehavior": { "required": [ "peer", "status" ], "type": "object", "properties": { "peer": { "type": "string", "format": "inet-address" }, "status": { "$ref": "#/components/schemas/PeerStatus" } } }, "PeerStatus": { "oneOf": [ { "$ref": "#/components/schemas/Banned" }, { "$ref": "#/components/schemas/Penalty" } ], "discriminator": { "propertyName": "type", "mapping": { "Banned": "#/components/schemas/Banned", "Penalty": "#/components/schemas/Penalty" } } }, "Penalty": { "required": [ "value", "type" ], "type": "object", "properties": { "value": { "type": "integer", "format": "int32" }, "type": { "type": "string" } } }, "Project": { "required": [ "code" ], "type": "object", "properties": { "code": { "type": "string" }, "compilerOptions": { "$ref": "#/components/schemas/CompilerOptions" } } }, "Reachable": { "required": [ "peers", "type" ], "type": "object", "properties": { "peers": { "type": "array", "items": { "type": "string", "format": "inet-address" } }, "type": { "type": "string" } } }, "Result": { "required": [ "hashrate" ], "type": "object", "properties": { "hashrate": { "type": "string", "format": "bigint" } } }, "RevealMnemonic": { "required": [ "password" ], "type": "object", "properties": { "password": { "type": "string" } } }, "RevealMnemonicResult": { "required": [ "mnemonic" ], "type": "object", "properties": { "mnemonic": { "type": "string" } } }, "Script": { "required": [ "code" ], "type": "object", "properties": { "code": { "type": "string" }, "compilerOptions": { "$ref": "#/components/schemas/CompilerOptions" } } }, "SelfClique": { "required": [ "cliqueId", "nodes", "selfReady", "synced" ], "type": "object", "properties": { "cliqueId": { "type": "string", "format": "clique-id" }, "nodes": { "type": "array", "items": { "$ref": "#/components/schemas/PeerAddress" } }, "selfReady": { "type": "boolean" }, "synced": { "type": "boolean" } } }, "ServiceUnavailable": { "required": [ "detail" ], "type": "object", "properties": { "detail": { "type": "string" } } }, "Sign": { "required": [ "data" ], "type": "object", "properties": { "data": { "type": "string" } } }, "SignResult": { "required": [ "signature" ], "type": "object", "properties": { "signature": { "type": "string", "format": "signature" } } }, "Source": { "required": [ "fromPublicKey", "destinations" ], "type": "object", "properties": { "fromPublicKey": { "type": "string", "format": "hex-string" }, "destinations": { "type": "array", "items": { "$ref": "#/components/schemas/Destination" } }, "fromPublicKeyType": { "type": "string", "format": "hex-string" }, "gasAmount": { "type": "integer", "format": "gas" }, "utxos": { "type": "array", "items": { "$ref": "#/components/schemas/OutputRef" } } } }, "StructSig": { "required": [ "name", "fieldNames", "fieldTypes", "isMutable" ], "type": "object", "properties": { "name": { "type": "string" }, "fieldNames": { "type": "array", "items": { "type": "string" } }, "fieldTypes": { "type": "array", "items": { "type": "string" } }, "isMutable": { "type": "array", "items": { "type": "boolean" } } } }, "SubmitMultisig": { "required": [ "unsignedTx", "signatures" ], "type": "object", "properties": { "unsignedTx": { "type": "string" }, "signatures": { "type": "array", "items": { "type": "string", "format": "signature" } } } }, "SubmitTransaction": { "required": [ "unsignedTx", "signature" ], "type": "object", "properties": { "unsignedTx": { "type": "string" }, "signature": { "type": "string", "format": "signature" } } }, "SubmitTxResult": { "required": [ "txId", "fromGroup", "toGroup" ], "type": "object", "properties": { "txId": { "type": "string", "format": "32-byte-hash" }, "fromGroup": { "type": "integer", "format": "int32" }, "toGroup": { "type": "integer", "format": "int32" } } }, "Sweep": { "required": [ "toAddress" ], "type": "object", "properties": { "toAddress": { "type": "string", "format": "address" }, "lockTime": { "type": "integer", "format": "int64" }, "gasAmount": { "type": "integer", "format": "gas" }, "gasPrice": { "type": "string", "format": "uint256" }, "utxosLimit": { "type": "integer", "format": "int32" }, "targetBlockHash": { "type": "string", "format": "block-hash" } } }, "SweepAddressTransaction": { "required": [ "txId", "unsignedTx", "gasAmount", "gasPrice" ], "type": "object", "properties": { "txId": { "type": "string", "format": "32-byte-hash" }, "unsignedTx": { "type": "string" }, "gasAmount": { "type": "integer", "format": "gas" }, "gasPrice": { "type": "string", "format": "uint256" } } }, "TargetToHashrate": { "required": [ "target" ], "type": "object", "properties": { "target": { "type": "string", "format": "hex-string" } } }, "TestContract": { "required": [ "bytecode" ], "type": "object", "properties": { "group": { "type": "integer", "format": "int32" }, "blockHash": { "type": "string", "format": "block-hash" }, "blockTimeStamp": { "type": "integer", "format": "int64" }, "txId": { "type": "string", "format": "32-byte-hash" }, "address": { "type": "string", "format": "address" }, "callerAddress": { "type": "string", "format": "address" }, "bytecode": { "type": "string", "format": "contract" }, "initialImmFields": { "type": "array", "items": { "$ref": "#/components/schemas/Val" } }, "initialMutFields": { "type": "array", "items": { "$ref": "#/components/schemas/Val" } }, "initialAsset": { "$ref": "#/components/schemas/AssetState" }, "methodIndex": { "type": "integer", "format": "int32" }, "args": { "type": "array", "items": { "$ref": "#/components/schemas/Val" } }, "existingContracts": { "type": "array", "items": { "$ref": "#/components/schemas/ContractState" } }, "inputAssets": { "type": "array", "items": { "$ref": "#/components/schemas/TestInputAsset" } } } }, "TestContractResult": { "required": [ "address", "codeHash", "returns", "gasUsed", "contracts", "txInputs", "txOutputs", "events", "debugMessages" ], "type": "object", "properties": { "address": { "type": "string", "format": "address" }, "codeHash": { "type": "string", "format": "32-byte-hash" }, "returns": { "type": "array", "items": { "$ref": "#/components/schemas/Val" } }, "gasUsed": { "type": "integer", "format": "int32" }, "contracts": { "type": "array", "items": { "$ref": "#/components/schemas/ContractState" } }, "txInputs": { "type": "array", "items": { "type": "string", "format": "address" } }, "txOutputs": { "type": "array", "items": { "$ref": "#/components/schemas/Output" } }, "events": { "type": "array", "items": { "$ref": "#/components/schemas/ContractEventByTxId" } }, "debugMessages": { "type": "array", "items": { "$ref": "#/components/schemas/DebugMessage" } } } }, "TestInputAsset": { "required": [ "address", "asset" ], "type": "object", "properties": { "address": { "type": "string", "format": "address" }, "asset": { "$ref": "#/components/schemas/AssetState" } } }, "Token": { "required": [ "id", "amount" ], "type": "object", "properties": { "id": { "type": "string", "format": "32-byte-hash" }, "amount": { "type": "string", "format": "uint256" } } }, "Transaction": { "required": [ "unsigned", "scriptExecutionOk", "contractInputs", "generatedOutputs", "inputSignatures", "scriptSignatures" ], "type": "object", "properties": { "unsigned": { "$ref": "#/components/schemas/UnsignedTx" }, "scriptExecutionOk": { "type": "boolean" }, "contractInputs": { "type": "array", "items": { "$ref": "#/components/schemas/OutputRef" } }, "generatedOutputs": { "type": "array", "items": { "$ref": "#/components/schemas/Output" } }, "inputSignatures": { "type": "array", "items": { "type": "string", "format": "hex-string" } }, "scriptSignatures": { "type": "array", "items": { "type": "string", "format": "hex-string" } } } }, "TransactionTemplate": { "required": [ "unsigned", "inputSignatures", "scriptSignatures" ], "type": "object", "properties": { "unsigned": { "$ref": "#/components/schemas/UnsignedTx" }, "inputSignatures": { "type": "array", "items": { "type": "string", "format": "hex-string" } }, "scriptSignatures": { "type": "array", "items": { "type": "string", "format": "hex-string" } } } }, "Transfer": { "required": [ "destinations" ], "type": "object", "properties": { "destinations": { "type": "array", "items": { "$ref": "#/components/schemas/Destination" } }, "gas": { "type": "integer", "format": "gas" }, "gasPrice": { "type": "string", "format": "uint256" }, "utxosLimit": { "type": "integer", "format": "int32" } } }, "TransferResult": { "required": [ "txId", "fromGroup", "toGroup" ], "type": "object", "properties": { "txId": { "type": "string", "format": "32-byte-hash" }, "fromGroup": { "type": "integer", "format": "group-index" }, "toGroup": { "type": "integer", "format": "group-index" } } }, "TransferResults": { "required": [ "results" ], "type": "object", "properties": { "results": { "type": "array", "items": { "$ref": "#/components/schemas/TransferResult" } } } }, "TxNotFound": { "required": [ "type" ], "type": "object", "properties": { "type": { "type": "string" } } }, "TxStatus": { "oneOf": [ { "$ref": "#/components/schemas/Confirmed" }, { "$ref": "#/components/schemas/MemPooled" }, { "$ref": "#/components/schemas/TxNotFound" } ], "discriminator": { "propertyName": "type", "mapping": { "Confirmed": "#/components/schemas/Confirmed", "MemPooled": "#/components/schemas/MemPooled", "TxNotFound": "#/components/schemas/TxNotFound" } } }, "UTXO": { "required": [ "ref", "amount" ], "type": "object", "properties": { "ref": { "$ref": "#/components/schemas/OutputRef" }, "amount": { "type": "string", "format": "uint256" }, "tokens": { "type": "array", "items": { "$ref": "#/components/schemas/Token" } }, "lockTime": { "type": "integer", "format": "int64" }, "additionalData": { "type": "string", "format": "hex-string" } } }, "UTXOs": { "required": [ "utxos" ], "type": "object", "properties": { "utxos": { "type": "array", "items": { "$ref": "#/components/schemas/UTXO" } }, "warning": { "type": "string" } } }, "Unauthorized": { "required": [ "detail" ], "type": "object", "properties": { "detail": { "type": "string" } } }, "Unban": { "required": [ "peers", "type" ], "type": "object", "properties": { "peers": { "type": "array", "items": { "type": "string", "format": "inet-address" } }, "type": { "type": "string" } } }, "Unreachable": { "required": [ "peers", "type" ], "type": "object", "properties": { "peers": { "type": "array", "items": { "type": "string", "format": "inet-address" } }, "type": { "type": "string" } } }, "UnsignedTx": { "required": [ "txId", "version", "networkId", "gasAmount", "gasPrice", "inputs", "fixedOutputs" ], "type": "object", "properties": { "txId": { "type": "string", "format": "32-byte-hash" }, "version": { "type": "integer" }, "networkId": { "type": "integer" }, "scriptOpt": { "type": "string", "format": "script" }, "gasAmount": { "type": "integer", "format": "int32" }, "gasPrice": { "type": "string", "format": "uint256" }, "inputs": { "type": "array", "items": { "$ref": "#/components/schemas/AssetInput" } }, "fixedOutputs": { "type": "array", "items": { "$ref": "#/components/schemas/FixedAssetOutput" } } } }, "Val": { "oneOf": [ { "$ref": "#/components/schemas/ValAddress" }, { "$ref": "#/components/schemas/ValArray" }, { "$ref": "#/components/schemas/ValBool" }, { "$ref": "#/components/schemas/ValByteVec" }, { "$ref": "#/components/schemas/ValI256" }, { "$ref": "#/components/schemas/ValU256" } ], "discriminator": { "propertyName": "type", "mapping": { "ValAddress": "#/components/schemas/ValAddress", "ValArray": "#/components/schemas/ValArray", "ValBool": "#/components/schemas/ValBool", "ValByteVec": "#/components/schemas/ValByteVec", "ValI256": "#/components/schemas/ValI256", "ValU256": "#/components/schemas/ValU256" } } }, "ValAddress": { "required": [ "value", "type" ], "type": "object", "properties": { "value": { "type": "string", "format": "address" }, "type": { "type": "string" } } }, "ValArray": { "required": [ "value", "type" ], "type": "object", "properties": { "value": { "type": "array", "items": { "$ref": "#/components/schemas/Val" } }, "type": { "type": "string" } } }, "ValBool": { "required": [ "value", "type" ], "type": "object", "properties": { "value": { "type": "boolean" }, "type": { "type": "string" } } }, "ValByteVec": { "required": [ "value", "type" ], "type": "object", "properties": { "value": { "type": "string", "format": "hex-string" }, "type": { "type": "string" } } }, "ValI256": { "required": [ "value", "type" ], "type": "object", "properties": { "value": { "type": "string", "format": "bigint" }, "type": { "type": "string" } } }, "ValU256": { "required": [ "value", "type" ], "type": "object", "properties": { "value": { "type": "string", "format": "uint256" }, "type": { "type": "string" } } }, "VerifySignature": { "required": [ "data", "signature", "publicKey" ], "type": "object", "properties": { "data": { "type": "string", "format": "hex-string" }, "signature": { "type": "string", "format": "signature" }, "publicKey": { "type": "string", "format": "public-key" } } }, "WalletCreation": { "required": [ "password", "walletName" ], "type": "object", "properties": { "password": { "type": "string" }, "walletName": { "type": "string" }, "isMiner": { "type": "boolean" }, "mnemonicPassphrase": { "type": "string" }, "mnemonicSize": { "type": "integer" } } }, "WalletCreationResult": { "required": [ "walletName", "mnemonic" ], "type": "object", "properties": { "walletName": { "type": "string" }, "mnemonic": { "type": "string" } } }, "WalletDeletion": { "required": [ "password" ], "type": "object", "properties": { "password": { "type": "string" } } }, "WalletRestore": { "required": [ "password", "mnemonic", "walletName" ], "type": "object", "properties": { "password": { "type": "string" }, "mnemonic": { "type": "string" }, "walletName": { "type": "string" }, "isMiner": { "type": "boolean" }, "mnemonicPassphrase": { "type": "string" } } }, "WalletRestoreResult": { "required": [ "walletName" ], "type": "object", "properties": { "walletName": { "type": "string" } } }, "WalletStatus": { "required": [ "walletName", "locked" ], "type": "object", "properties": { "walletName": { "type": "string" }, "locked": { "type": "boolean" } } }, "WalletUnlock": { "required": [ "password" ], "type": "object", "properties": { "password": { "type": "string" }, "mnemonicPassphrase": { "type": "string" } } } } } }