{ "openapi": "3.0.3", "info": { "title": "emily-openapi-spec", "description": "", "license": { "name": "" }, "version": "0.1.0" }, "servers": [ { "url": "http://localhost:3031", "description": "Local Emily server" }, { "url": "https://sbtc-emily.com", "description": "Production Emily server" }, { "url": "https://temp.sbtc-emily-dev.com", "description": "Testnet Emily server" } ], "paths": { "/chainstate": { "get": { "tags": [ "chainstate" ], "summary": "Get chain tip handler.", "operationId": "getChainTip", "responses": { "200": { "description": "Chain tip retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Chainstate" } } } }, "404": { "description": "Address not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "405": { "description": "Method not allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } }, "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } }, "options": { "tags": [ "CORS" ], "summary": "CORS support", "description": "Handles CORS preflight requests", "parameters": [], "responses": {}, "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } } }, "/chainstate/{height}": { "get": { "tags": [ "chainstate" ], "summary": "Get chainstate handler.", "operationId": "getChainstateAtHeight", "parameters": [ { "name": "height", "in": "path", "description": "Height of the blockchain data to receive.", "required": true, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "Chainstate retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Chainstate" } } } }, "400": { "description": "Invalid request body", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Address not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "405": { "description": "Method not allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } }, "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } }, "options": { "tags": [ "CORS" ], "summary": "CORS support", "description": "Handles CORS preflight requests", "parameters": [ { "name": "height", "in": "path", "description": "Height of the blockchain data to receive.", "required": true, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": {}, "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } } }, "/deposit": { "get": { "tags": [ "deposit" ], "summary": "Get deposits handler.", "operationId": "getDeposits", "parameters": [ { "name": "status", "in": "query", "description": "the status to search by when getting all deposits.", "required": true, "schema": { "$ref": "#/components/schemas/DepositStatus" } }, { "name": "nextToken", "in": "query", "description": "the next token value from the previous return of this api call.", "required": false, "schema": { "type": "string", "nullable": true } }, { "name": "pageSize", "in": "query", "description": "the maximum number of items in the response list.", "required": false, "schema": { "type": "integer", "format": "int32", "nullable": true, "minimum": 0 } } ], "responses": { "200": { "description": "Deposits retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetDepositsResponse" } } } }, "400": { "description": "Invalid request body", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Address not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "405": { "description": "Method not allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } }, "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } }, "post": { "tags": [ "deposit" ], "summary": "Create deposit handler.", "operationId": "createDeposit", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateDepositRequestBody" } } }, "required": true }, "responses": { "200": { "description": "Deposit already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Deposit" } } } }, "201": { "description": "Deposit created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Deposit" } } } }, "400": { "description": "Invalid request body", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Address not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "405": { "description": "Method not allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } }, "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } }, "put": { "tags": [ "deposit" ], "summary": "Update deposits handler.", "operationId": "updateDepositsSigner", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateDepositsRequestBody" } } }, "required": true }, "responses": { "200": { "description": "Deposits updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateDepositsResponse" } } } }, "400": { "description": "Invalid request body", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Address not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "405": { "description": "Method not allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } }, "security": [ { "ApiGatewayKey": [] } ], "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } }, "options": { "tags": [ "CORS" ], "summary": "CORS support", "description": "Handles CORS preflight requests", "parameters": [], "responses": {}, "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } } }, "/deposit/recipient/{recipient}": { "get": { "tags": [ "deposit" ], "summary": "Get deposits by recipient handler.", "operationId": "getDepositsForRecipient", "parameters": [ { "name": "recipient", "in": "path", "description": "the recipient to search by when getting all deposits.", "required": true, "schema": { "type": "string" } }, { "name": "nextToken", "in": "query", "description": "the next token value from the previous return of this api call.", "required": false, "schema": { "type": "string", "nullable": true } }, { "name": "pageSize", "in": "query", "description": "the maximum number of items in the response list.", "required": false, "schema": { "type": "integer", "format": "int32", "nullable": true, "minimum": 0 } } ], "responses": { "200": { "description": "Deposits retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetDepositsResponse" } } } }, "400": { "description": "Invalid request body", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Address not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "405": { "description": "Method not allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } }, "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } }, "options": { "tags": [ "CORS" ], "summary": "CORS support", "description": "Handles CORS preflight requests", "parameters": [ { "name": "recipient", "in": "path", "description": "the recipient to search by when getting all deposits.", "required": true, "schema": { "type": "string" } } ], "responses": {}, "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } } }, "/deposit/reclaim-pubkeys/{reclaimPubkeys}": { "get": { "tags": [ "deposit" ], "summary": "Get deposits by recipient handler.", "operationId": "getDepositsForReclaimPubkeys", "parameters": [ { "name": "reclaimPubkeys", "in": "path", "description": "The dash-separated list of hex-encoded x-only pubkeys used to generate the reclaim_script.", "required": true, "schema": { "type": "string" } }, { "name": "nextToken", "in": "query", "description": "the next token value from the previous return of this api call.", "required": false, "schema": { "type": "string", "nullable": true } }, { "name": "pageSize", "in": "query", "description": "the maximum number of items in the response list.", "required": false, "schema": { "type": "integer", "format": "int32", "nullable": true, "minimum": 0 } } ], "responses": { "200": { "description": "Deposits retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetDepositsResponse" } } } }, "400": { "description": "Invalid request body", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Address not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "405": { "description": "Method not allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } }, "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } }, "options": { "tags": [ "CORS" ], "summary": "CORS support", "description": "Handles CORS preflight requests", "parameters": [ { "name": "reclaimPubkeys", "in": "path", "description": "The dash-separated list of hex-encoded x-only pubkeys used to generate the reclaim_script.", "required": true, "schema": { "type": "string" } } ], "responses": {}, "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } } }, "/deposit/{txid}": { "get": { "tags": [ "deposit" ], "summary": "Get deposits for transaction handler.", "operationId": "getDepositsForTransaction", "parameters": [ { "name": "txid", "in": "path", "description": "txid associated with the Deposit.", "required": true, "schema": { "type": "string" } }, { "name": "nextToken", "in": "query", "description": "the next token value from the previous return of this api call.", "required": false, "schema": { "type": "string", "nullable": true } }, { "name": "pageSize", "in": "query", "description": "the maximum number of items in the response list.", "required": false, "schema": { "type": "integer", "format": "int32", "nullable": true, "minimum": 0 } } ], "responses": { "200": { "description": "Deposits retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetDepositsForTransactionResponse" } } } }, "400": { "description": "Invalid request body", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Address not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "405": { "description": "Method not allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } }, "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } }, "options": { "tags": [ "CORS" ], "summary": "CORS support", "description": "Handles CORS preflight requests", "parameters": [ { "name": "txid", "in": "path", "description": "txid associated with the Deposit.", "required": true, "schema": { "type": "string" } } ], "responses": {}, "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } } }, "/deposit/{txid}/{index}": { "get": { "tags": [ "deposit" ], "summary": "Get deposit handler.", "operationId": "getDeposit", "parameters": [ { "name": "txid", "in": "path", "description": "txid associated with the Deposit.", "required": true, "schema": { "type": "string" } }, { "name": "index", "in": "path", "description": "output index associated with the Deposit.", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Deposit retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Deposit" } } } }, "400": { "description": "Invalid request body", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Address not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "405": { "description": "Method not allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } }, "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } }, "options": { "tags": [ "CORS" ], "summary": "CORS support", "description": "Handles CORS preflight requests", "parameters": [ { "name": "txid", "in": "path", "description": "txid associated with the Deposit.", "required": true, "schema": { "type": "string" } }, { "name": "index", "in": "path", "description": "output index associated with the Deposit.", "required": true, "schema": { "type": "string" } } ], "responses": {}, "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } } }, "/health": { "get": { "tags": [ "health" ], "summary": "Get health handler.", "operationId": "checkHealth", "responses": { "200": { "description": "Successfully retrieved health data.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HealthData" } } } }, "400": { "description": "Invalid request body", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Address not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "405": { "description": "Method not allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } }, "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } }, "options": { "tags": [ "CORS" ], "summary": "CORS support", "description": "Handles CORS preflight requests", "parameters": [], "responses": {}, "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } } }, "/limits": { "get": { "tags": [ "limits" ], "summary": "Get the global limits.", "operationId": "getLimits", "responses": { "200": { "description": "Limits retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Limits" } } } }, "405": { "description": "Method not allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } }, "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } }, "options": { "tags": [ "CORS" ], "summary": "CORS support", "description": "Handles CORS preflight requests", "parameters": [], "responses": {}, "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } } }, "/limits/{account}": { "get": { "tags": [ "limits" ], "summary": "Get limits for account handler.", "operationId": "getLimitsForAccount", "parameters": [ { "name": "account", "in": "path", "description": "The account for which to get the limits.", "required": true, "schema": { "type": "string" } } ], "responses": { "201": { "description": "Account limits retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AccountLimits" } } } }, "400": { "description": "Invalid request body", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Address not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "405": { "description": "Method not allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } }, "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } }, "options": { "tags": [ "CORS" ], "summary": "CORS support", "description": "Handles CORS preflight requests", "parameters": [ { "name": "account", "in": "path", "description": "The account for which to get the limits.", "required": true, "schema": { "type": "string" } } ], "responses": {}, "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } } }, "/start_throttle": { "post": { "tags": [ "throttle" ], "summary": "Try to turn on throttle mode", "operationId": "startThrottle", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ThrottleRequest" } } }, "required": true }, "responses": { "200": { "description": "Throttle started successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Limits" } } } }, "403": { "description": "Key is revoked", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Throttle key not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } }, "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } }, "options": { "tags": [ "CORS" ], "summary": "CORS support", "description": "Handles CORS preflight requests", "parameters": [], "responses": {}, "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } } }, "/withdrawal": { "get": { "tags": [ "withdrawal" ], "summary": "Get withdrawals handler.", "operationId": "getWithdrawals", "parameters": [ { "name": "status", "in": "query", "description": "the status to search by when getting all withdrawals.", "required": true, "schema": { "$ref": "#/components/schemas/WithdrawalStatus" } }, { "name": "nextToken", "in": "query", "description": "the next token value from the previous return of this api call.", "required": false, "schema": { "type": "string", "nullable": true } }, { "name": "pageSize", "in": "query", "description": "the maximum number of items in the response list.", "required": false, "schema": { "type": "integer", "format": "int32", "nullable": true, "minimum": 0 } } ], "responses": { "200": { "description": "Withdrawals retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetWithdrawalsResponse" } } } }, "400": { "description": "Invalid request body", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Address not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "405": { "description": "Method not allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } }, "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } }, "put": { "tags": [ "withdrawal" ], "summary": "Update withdrawals handler.", "operationId": "updateWithdrawalsSigner", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateWithdrawalsRequestBody" } } }, "required": true }, "responses": { "200": { "description": "Withdrawals updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateWithdrawalsResponse" } } } }, "400": { "description": "Invalid request body", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Address not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "405": { "description": "Method not allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } }, "security": [ { "ApiGatewayKey": [] } ], "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } }, "options": { "tags": [ "CORS" ], "summary": "CORS support", "description": "Handles CORS preflight requests", "parameters": [], "responses": {}, "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } } }, "/withdrawal/recipient/{recipient}": { "get": { "tags": [ "withdrawal" ], "summary": "Get withdrawals by recipient handler.", "operationId": "getWithdrawalsForRecipient", "parameters": [ { "name": "recipient", "in": "path", "description": "The recipient's hex-encoded scriptPubKey, used to filter withdrawals.", "required": true, "schema": { "type": "string" } }, { "name": "nextToken", "in": "query", "description": "the next token value from the previous return of this api call.", "required": false, "schema": { "type": "string", "nullable": true } }, { "name": "pageSize", "in": "query", "description": "the maximum number of items in the response list.", "required": false, "schema": { "type": "integer", "format": "int32", "nullable": true, "minimum": 0 } } ], "responses": { "200": { "description": "Withdrawals retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetWithdrawalsResponse" } } } }, "400": { "description": "Invalid request body", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Address not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "405": { "description": "Method not allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } }, "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } }, "options": { "tags": [ "CORS" ], "summary": "CORS support", "description": "Handles CORS preflight requests", "parameters": [ { "name": "recipient", "in": "path", "description": "The recipient's hex-encoded scriptPubKey, used to filter withdrawals.", "required": true, "schema": { "type": "string" } } ], "responses": {}, "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } } }, "/withdrawal/sender/{sender}": { "get": { "tags": [ "withdrawal" ], "summary": "Get withdrawals by sender handler.", "operationId": "getWithdrawalsForSender", "parameters": [ { "name": "sender", "in": "path", "description": "The sender's Stacks principal, used to filter withdrawals.", "required": true, "schema": { "type": "string" } }, { "name": "nextToken", "in": "query", "description": "the next token value from the previous return of this api call.", "required": false, "schema": { "type": "string", "nullable": true } }, { "name": "pageSize", "in": "query", "description": "the maximum number of items in the response list.", "required": false, "schema": { "type": "integer", "format": "int32", "nullable": true, "minimum": 0 } } ], "responses": { "200": { "description": "Withdrawals retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetWithdrawalsResponse" } } } }, "400": { "description": "Invalid request body", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Address not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "405": { "description": "Method not allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } }, "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } }, "options": { "tags": [ "CORS" ], "summary": "CORS support", "description": "Handles CORS preflight requests", "parameters": [ { "name": "sender", "in": "path", "description": "The sender's Stacks principal, used to filter withdrawals.", "required": true, "schema": { "type": "string" } } ], "responses": {}, "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } } }, "/withdrawal/{id}": { "get": { "tags": [ "withdrawal" ], "summary": "Get withdrawal handler.", "operationId": "getWithdrawal", "parameters": [ { "name": "id", "in": "path", "description": "id associated with the Withdrawal", "required": true, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "Withdrawal retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Withdrawal" } } } }, "400": { "description": "Invalid request body", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Address not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "405": { "description": "Method not allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } }, "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } }, "options": { "tags": [ "CORS" ], "summary": "CORS support", "description": "Handles CORS preflight requests", "parameters": [ { "name": "id", "in": "path", "description": "id associated with the Withdrawal", "required": true, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": {}, "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OperationLambda}/invocations" } } } } }, "components": { "schemas": { "AccountLimits": { "type": "object", "description": "The representation of a limit for a specific account.", "properties": { "pegCap": { "type": "integer", "format": "int64", "description": "Represents the current sBTC limits.", "nullable": true, "minimum": 0 }, "perDepositCap": { "type": "integer", "format": "int64", "description": "Per deposit cap. If none then the cap is the same as the global per deposit cap.", "nullable": true, "minimum": 0 }, "perDepositMinimum": { "type": "integer", "format": "int64", "description": "Per deposit minimum. If none then there is no minimum.", "nullable": true, "minimum": 0 }, "perWithdrawalCap": { "type": "integer", "format": "int64", "description": "Per withdrawal cap. If none then the cap is the same as the global per withdrawal cap.", "nullable": true, "minimum": 0 }, "rollingWithdrawalBlocks": { "type": "integer", "format": "int64", "description": "Number of blocks that define the rolling withdrawal window.", "nullable": true, "minimum": 0 }, "rollingWithdrawalCap": { "type": "integer", "format": "int64", "description": "Maximum total sBTC that can be withdrawn within the rolling withdrawal window.", "nullable": true, "minimum": 0 }, "throttleModeInitiator": { "type": "string", "description": "Throttle key initiated throttle", "nullable": true } } }, "Chainstate": { "type": "object", "description": "Chainstate.", "required": [ "stacksBlockHeight", "stacksBlockHash" ], "properties": { "bitcoinBlockHeight": { "type": "integer", "format": "int64", "description": "Bitcoin block height", "nullable": true, "minimum": 0 }, "stacksBlockHash": { "type": "string", "description": "Stacks block hash at the height." }, "stacksBlockHeight": { "type": "integer", "format": "int64", "description": "Stacks block height.", "minimum": 0 } } }, "CreateDepositRequestBody": { "type": "object", "description": "Request structure for create deposit request.", "required": [ "bitcoinTxid", "bitcoinTxOutputIndex", "reclaimScript", "depositScript", "transactionHex" ], "properties": { "bitcoinTxOutputIndex": { "type": "integer", "format": "int32", "description": "Output index on the bitcoin transaction associated with this specific deposit.", "minimum": 0 }, "bitcoinTxid": { "type": "string", "description": "Bitcoin transaction id." }, "depositScript": { "type": "string", "description": "Deposit script." }, "reclaimScript": { "type": "string", "description": "Reclaim script." }, "transactionHex": { "type": "string", "description": "The raw transaction hex." } } }, "Deposit": { "type": "object", "description": "Deposit.", "required": [ "bitcoinTxid", "bitcoinTxOutputIndex", "recipient", "amount", "lastUpdateHeight", "lastUpdateBlockHash", "status", "statusMessage", "parameters", "reclaimScript", "depositScript" ], "properties": { "amount": { "type": "integer", "format": "int64", "description": "Amount of BTC being deposited in satoshis.", "minimum": 0 }, "bitcoinTxOutputIndex": { "type": "integer", "format": "int32", "description": "Output index on the bitcoin transaction associated with this specific deposit.", "minimum": 0 }, "bitcoinTxid": { "type": "string", "description": "Bitcoin transaction id." }, "depositScript": { "type": "string", "description": "Raw deposit script binary in hex." }, "fulfillment": { "allOf": [ { "$ref": "#/components/schemas/Fulfillment" } ], "nullable": true }, "lastUpdateBlockHash": { "type": "string", "description": "The most recent Stacks block hash the API was aware of when the deposit was last\nupdated. If the most recent update is tied to an artifact on the Stacks blockchain\nthen this hash is the Stacks block hash that contains that artifact." }, "lastUpdateHeight": { "type": "integer", "format": "int64", "description": "The most recent Stacks block height the API was aware of when the deposit was last\nupdated. If the most recent update is tied to an artifact on the Stacks blockchain\nthen this height is the Stacks block height that contains that artifact.", "minimum": 0 }, "parameters": { "$ref": "#/components/schemas/DepositParameters" }, "recipient": { "type": "string", "description": "Stacks address to received the deposited sBTC." }, "reclaimScript": { "type": "string", "description": "Raw reclaim script binary in hex." }, "replacedByTx": { "type": "string", "description": "Transaction ID of the transaction that replaced this one via RBF.", "nullable": true }, "status": { "$ref": "#/components/schemas/DepositStatus" }, "statusMessage": { "type": "string", "description": "The status message of the deposit." } } }, "DepositInfo": { "type": "object", "description": "Reduced version of the Deposit data.", "required": [ "bitcoinTxid", "bitcoinTxOutputIndex", "recipient", "amount", "lastUpdateHeight", "lastUpdateBlockHash", "status", "reclaimScript", "depositScript" ], "properties": { "amount": { "type": "integer", "format": "int64", "description": "Amount of BTC being deposited in satoshis.", "minimum": 0 }, "bitcoinTxOutputIndex": { "type": "integer", "format": "int32", "description": "Output index on the bitcoin transaction associated with this specific deposit.", "minimum": 0 }, "bitcoinTxid": { "type": "string", "description": "Bitcoin transaction id." }, "depositScript": { "type": "string", "description": "Raw deposit script binary in hex." }, "lastUpdateBlockHash": { "type": "string", "description": "The most recent Stacks block hash the API was aware of when the deposit was last\nupdated. If the most recent update is tied to an artifact on the Stacks blockchain\nthen this hash is the Stacks block hash that contains that artifact." }, "lastUpdateHeight": { "type": "integer", "format": "int64", "description": "The most recent Stacks block height the API was aware of when the deposit was last\nupdated. If the most recent update is tied to an artifact on the Stacks blockchain\nthen this height is the Stacks block height that contains that artifact.", "minimum": 0 }, "recipient": { "type": "string", "description": "Stacks address to received the deposited sBTC." }, "reclaimScript": { "type": "string", "description": "Raw reclaim script binary in hex." }, "status": { "$ref": "#/components/schemas/DepositStatus" } } }, "DepositParameters": { "type": "object", "description": "Deposit parameters.", "required": [ "maxFee", "lockTime" ], "properties": { "lockTime": { "type": "integer", "format": "int32", "description": "Bitcoin block height at which the reclaim script becomes executable.", "minimum": 0 }, "maxFee": { "type": "integer", "format": "int64", "description": "Maximum fee the signers are allowed to take from the deposit to facilitate\nthe transaction.", "minimum": 0 } } }, "DepositStatus": { "type": "string", "description": "The status of the in-flight sBTC deposit.", "enum": [ "pending", "accepted", "confirmed", "failed", "rbf" ] }, "DepositUpdate": { "type": "object", "description": "A singular Deposit update that contains only the fields pertinent\nto updating the status of a deposit. This includes the key related\ndata in addition to status history related data.", "required": [ "bitcoinTxid", "bitcoinTxOutputIndex", "status", "statusMessage" ], "properties": { "bitcoinTxOutputIndex": { "type": "integer", "format": "int32", "description": "Output index on the bitcoin transaction associated with this specific deposit.", "minimum": 0 }, "bitcoinTxid": { "type": "string", "description": "Bitcoin transaction id." }, "fulfillment": { "allOf": [ { "$ref": "#/components/schemas/Fulfillment" } ], "nullable": true }, "replacedByTx": { "type": "string", "description": "Transaction ID of the transaction that replaced this one via RBF.", "nullable": true }, "status": { "$ref": "#/components/schemas/DepositStatus" }, "statusMessage": { "type": "string", "description": "The status message of the deposit." } } }, "DepositWithStatus": { "type": "object", "description": "Wrapper for deposit with status code. Used for multi-status responses.\nNote: logically, exactly one field among `error` and `deposit` should be `None`,\nand exactly one should be `Some`, so, storing them as `Result` would be more correct.\nHowever, utopia, which we use for openAPI schema generation, does not allow `Result`\nusage in its structs, and we have to use two `Option`s", "required": [ "status" ], "properties": { "deposit": { "allOf": [ { "$ref": "#/components/schemas/Deposit" } ], "nullable": true }, "error": { "type": "string", "description": "A string explaining the error that occurred during the deposit update.", "nullable": true }, "status": { "type": "integer", "format": "int32", "description": "HTTP status code for the deposit processing result.", "minimum": 0 } } }, "ErrorResponse": { "type": "object", "description": "Structure representing an error response\nThis is used to serialize error messages in HTTP responses", "required": [ "message" ], "properties": { "message": { "type": "string" } } }, "ExpectedFulfillmentInfo": { "type": "object", "description": "Expected information about future fulfillment of the withdrawal.\nThis struct represents _estimate_ of how fulfillment for the\nwithdrawal will look like. This estimation is for reference only,\nand does not provide any guarantees.", "properties": { "bitcoinBlockHeight": { "type": "integer", "format": "int64", "description": "The estimated bitcoin block height for the bitcoin block confirming\nthe transaction fulling the withdrawal request. This value is\nestimated by Emily once when the withdrawal request is initially\nreceived.", "nullable": true, "minimum": 0 }, "bitcoinTxid": { "type": "string", "description": "The expected txid of the sweep transaction fulfilling the withdrawal\nrequest. This field is populated once, it is not updated if there is\nan RBF transaction that also fulfills the request.", "nullable": true } } }, "Fulfillment": { "type": "object", "description": "Data about the fulfillment of an sBTC Operation.", "required": [ "BitcoinTxid", "BitcoinTxIndex", "StacksTxid", "BitcoinBlockHash", "BitcoinBlockHeight", "BtcFee" ], "properties": { "BitcoinBlockHash": { "type": "string", "description": "Bitcoin block hash of the block that contains the bitcoin transaction that fulfilled\nthis transaction." }, "BitcoinBlockHeight": { "type": "integer", "format": "int64", "description": "Bitcoin block height of the block that contains the bitcoin transaction that fulfilled\nthis transaction.", "minimum": 0 }, "BitcoinTxIndex": { "type": "integer", "format": "int32", "description": "Bitcoin transaction output index of the Bitcoin transaction that fulfilled the\noperation that corresponds to the fulfillment of this specific operation.", "minimum": 0 }, "BitcoinTxid": { "type": "string", "description": "Bitcoin transaction id of the Bitcoin transaction that fulfilled the operation." }, "BtcFee": { "type": "integer", "format": "int64", "description": "Satoshis consumed to fulfill the sBTC operation.", "minimum": 0 }, "StacksTxid": { "type": "string", "description": "Stacks transaction Id that fulfilled this operation." } } }, "GetDepositsForTransactionResponse": { "type": "object", "description": "Response to get deposits for transaction request.", "required": [ "deposits" ], "properties": { "deposits": { "type": "array", "items": { "$ref": "#/components/schemas/Deposit" }, "description": "Deposits." }, "nextToken": { "type": "string", "description": "Next token for the search.", "nullable": true } } }, "GetDepositsResponse": { "type": "object", "description": "Response to get deposits request.", "required": [ "deposits" ], "properties": { "deposits": { "type": "array", "items": { "$ref": "#/components/schemas/DepositInfo" }, "description": "Deposit infos: deposits with a little less data." }, "nextToken": { "type": "string", "description": "Next token for the search.", "nullable": true } } }, "GetWithdrawalsResponse": { "type": "object", "description": "Response to get withdrawals request.", "required": [ "withdrawals" ], "properties": { "nextToken": { "type": "string", "description": "Next token for the search.", "nullable": true }, "withdrawals": { "type": "array", "items": { "$ref": "#/components/schemas/WithdrawalInfo" }, "description": "Withdrawal infos: withdrawals with a little less data." } } }, "HealthData": { "type": "object", "description": "Struct that represents the current status of the API.", "required": [ "version" ], "properties": { "version": { "type": "string", "description": "The version of the API." } } }, "Limits": { "type": "object", "description": "Represents the current sBTC limits.", "required": [ "accountCaps" ], "properties": { "accountCaps": { "type": "object", "description": "Represents the individual limits for requests coming from different accounts.", "additionalProperties": { "$ref": "#/components/schemas/AccountLimits" } }, "availableToWithdraw": { "type": "integer", "format": "int64", "description": "Total amount sBTC still available for withdrawals in current window. All withdrawals except rejected\ncounted here", "nullable": true, "minimum": 0 }, "pegCap": { "type": "integer", "format": "int64", "description": "Represents the total cap for all pegged-in BTC/sBTC.", "nullable": true, "minimum": 0 }, "perDepositCap": { "type": "integer", "format": "int64", "description": "Per deposit cap. If none then there is no cap.", "nullable": true, "minimum": 0 }, "perDepositMinimum": { "type": "integer", "format": "int64", "description": "Per deposit minimum. If none then there is no minimum.", "nullable": true, "minimum": 0 }, "perWithdrawalCap": { "type": "integer", "format": "int64", "description": "Per withdrawal cap. If none then there is no cap.", "nullable": true, "minimum": 0 }, "rollingWithdrawalBlocks": { "type": "integer", "format": "int64", "description": "Number of blocks that define the rolling withdrawal window.", "nullable": true, "minimum": 0 }, "rollingWithdrawalCap": { "type": "integer", "format": "int64", "description": "Maximum total sBTC that can be withdrawn within the rolling withdrawal window.", "nullable": true, "minimum": 0 }, "throttleModeInitiator": { "type": "string", "description": "Name of key which triggered throttle mode (if throttle mode is active)", "nullable": true } } }, "ThrottleRequest": { "type": "object", "description": "Represents the throttle reqwest", "required": [ "name", "secret" ], "properties": { "name": { "type": "string", "description": "The name of the key." }, "secret": { "type": "string", "description": "The secret associated with this key." } } }, "UpdateDepositsRequestBody": { "type": "object", "description": "Request structure for update deposit request.", "required": [ "deposits" ], "properties": { "deposits": { "type": "array", "items": { "$ref": "#/components/schemas/DepositUpdate" }, "description": "Bitcoin transaction id." } } }, "UpdateDepositsResponse": { "type": "object", "description": "Response to update deposits request.", "required": [ "deposits" ], "properties": { "deposits": { "type": "array", "items": { "$ref": "#/components/schemas/DepositWithStatus" }, "description": "Deposit infos: deposits with a little less data." } } }, "UpdateWithdrawalsRequestBody": { "type": "object", "description": "Request structure for the create withdrawal request.", "required": [ "withdrawals" ], "properties": { "withdrawals": { "type": "array", "items": { "$ref": "#/components/schemas/WithdrawalUpdate" }, "description": "Withdrawal updates to execute." } } }, "UpdateWithdrawalsResponse": { "type": "object", "description": "Response to update withdrawals request.", "required": [ "withdrawals" ], "properties": { "withdrawals": { "type": "array", "items": { "$ref": "#/components/schemas/WithdrawalWithStatus" }, "description": "Updated withdrawals." } } }, "Withdrawal": { "type": "object", "description": "Withdrawal.", "required": [ "requestId", "stacksBlockHash", "stacksBlockHeight", "recipient", "sender", "amount", "lastUpdateHeight", "lastUpdateBlockHash", "status", "statusMessage", "parameters", "expectedFulfillmentInfo", "txid" ], "properties": { "amount": { "type": "integer", "format": "int64", "description": "Amount of BTC being withdrawn in satoshis.", "minimum": 0 }, "expectedFulfillmentInfo": { "$ref": "#/components/schemas/ExpectedFulfillmentInfo" }, "fulfillment": { "allOf": [ { "$ref": "#/components/schemas/Fulfillment" } ], "nullable": true }, "lastUpdateBlockHash": { "type": "string", "description": "The most recent Stacks block hash the API was aware of when the withdrawal was last\nupdated. If the most recent update is tied to an artifact on the Stacks blockchain\nthen this hash is the Stacks block hash that contains that artifact." }, "lastUpdateHeight": { "type": "integer", "format": "int64", "description": "The most recent Stacks block height the API was aware of when the withdrawal was last\nupdated. If the most recent update is tied to an artifact on the Stacks blockchain\nthen this height is the Stacks block height that contains that artifact.", "minimum": 0 }, "parameters": { "$ref": "#/components/schemas/WithdrawalParameters" }, "recipient": { "type": "string", "description": "The recipient's hex-encoded Bitcoin scriptPubKey." }, "requestId": { "type": "integer", "format": "int64", "description": "The id of the Stacks withdrawal request that initiated the sBTC operation.", "minimum": 0 }, "sender": { "type": "string", "description": "The sender's hex-encoded Stacks principal." }, "stacksBlockHash": { "type": "string", "description": "The stacks block hash in which this request id was initiated." }, "stacksBlockHeight": { "type": "integer", "format": "int64", "description": "The height of the Stacks block in which this request id was initiated.", "minimum": 0 }, "status": { "$ref": "#/components/schemas/WithdrawalStatus" }, "statusMessage": { "type": "string", "description": "The status message of the withdrawal." }, "txid": { "type": "string", "description": "The hex encoded txid of the stacks transaction that generated this event." } } }, "WithdrawalInfo": { "type": "object", "description": "Reduced version of the Withdrawal.", "required": [ "requestId", "stacksBlockHash", "stacksBlockHeight", "recipient", "sender", "amount", "lastUpdateHeight", "lastUpdateBlockHash", "status", "txid" ], "properties": { "amount": { "type": "integer", "format": "int64", "description": "Amount of BTC being withdrawn in satoshis.", "minimum": 0 }, "lastUpdateBlockHash": { "type": "string", "description": "The most recent Stacks block hash the API was aware of when the withdrawal was last\nupdated. If the most recent update is tied to an artifact on the Stacks blockchain\nthen this hash is the Stacks block hash that contains that artifact." }, "lastUpdateHeight": { "type": "integer", "format": "int64", "description": "The most recent Stacks block height the API was aware of when the withdrawal was last\nupdated. If the most recent update is tied to an artifact on the Stacks blockchain\nthen this height is the Stacks block height that contains that artifact.", "minimum": 0 }, "recipient": { "type": "string", "description": "The recipient's hex-encoded Bitcoin scriptPubKey." }, "requestId": { "type": "integer", "format": "int64", "description": "The id of the Stacks withdrawal request that initiated the sBTC operation.", "minimum": 0 }, "sender": { "type": "string", "description": "The sender's hex-encoded Stacks principal." }, "stacksBlockHash": { "type": "string", "description": "The stacks block hash in which this request id was initiated." }, "stacksBlockHeight": { "type": "integer", "format": "int64", "description": "The height of the Stacks block in which this request id was initiated.", "minimum": 0 }, "status": { "$ref": "#/components/schemas/WithdrawalStatus" }, "txid": { "type": "string", "description": "The hex encoded txid of the stacks transaction that generated this event." } } }, "WithdrawalParameters": { "type": "object", "description": "Withdrawal parameters.", "required": [ "maxFee" ], "properties": { "maxFee": { "type": "integer", "format": "int64", "description": "Maximum fee the signers are allowed to take from the withdrawal to facilitate\nthe inclusion of the transaction onto the Bitcoin blockchain.", "minimum": 0 } } }, "WithdrawalStatus": { "type": "string", "description": "The status of the in-flight sBTC withdrawal.", "enum": [ "pending", "accepted", "confirmed", "failed" ] }, "WithdrawalUpdate": { "type": "object", "description": "A singular Withdrawal update that contains only the fields pertinent\nto updating the status of a withdrawal. This includes the key related\ndata in addition to status history related data.", "required": [ "requestId", "status", "statusMessage" ], "properties": { "expectedFulfillmentInfo": { "allOf": [ { "$ref": "#/components/schemas/ExpectedFulfillmentInfo" } ], "nullable": true }, "fulfillment": { "allOf": [ { "$ref": "#/components/schemas/Fulfillment" } ], "nullable": true }, "requestId": { "type": "integer", "format": "int64", "description": "The id of the Stacks withdrawal request that initiated the sBTC operation.", "minimum": 0 }, "status": { "$ref": "#/components/schemas/WithdrawalStatus" }, "statusMessage": { "type": "string", "description": "The status message of the withdrawal." } } }, "WithdrawalWithStatus": { "type": "object", "description": "Wrapper for withdrawal with status code. Used for multi-status responses.\nNote: logically, exactly one field among `error` and `withdrawal` should be `None`,\nand exactly one should be `Some`, so, storing them as `Result` would be more correct.\nHowever, utopia, which we use for openAPI schema generation, does not allow `Result`\nusage in its structs, and we have to use two `Option`s", "required": [ "status" ], "properties": { "error": { "type": "string", "description": "String explaining error occured during updating the withdrawal.", "nullable": true }, "status": { "type": "integer", "format": "int32", "description": "HTTP status code for the withdrawal processing result.", "minimum": 0 }, "withdrawal": { "allOf": [ { "$ref": "#/components/schemas/Withdrawal" } ], "nullable": true } } } }, "securitySchemes": { "ApiGatewayKey": { "type": "apiKey", "in": "header", "name": "x-api-key", "description": "AWS Apigateway key" } } } }