Added openapi response schema for validateaddress

This commit is contained in:
kexkey
2021-11-18 11:23:05 -05:00
parent 4d4bee3fca
commit d42ba92593
2 changed files with 29 additions and 5 deletions

View File

@@ -761,7 +761,7 @@ GET http://cyphernode:8888/validateaddress/address
GET http://cyphernode:8888/validateaddress/tb1p5cyxnuxmeuwuvkwfem96lqzszd02n6xdcjrs20cac6yqjjwudpxqp3mvzv GET http://cyphernode:8888/validateaddress/tb1p5cyxnuxmeuwuvkwfem96lqzszd02n6xdcjrs20cac6yqjjwudpxqp3mvzv
``` ```
Proxy response: Proxy response for a valid address:
```json ```json
{ {
@@ -774,6 +774,14 @@ Proxy response:
} }
``` ```
Proxy response for an invalid address:
```json
{
"isvalid": false
}
```
### Spend coins from spending wallet (called by your application) ### Spend coins from spending wallet (called by your application)
Calls sendtoaddress RPC on the spending wallet with supplied info. Can supply an eventMessage to be published on successful spending. eventMessage should be base64 encoded to avoid dealing with escaping special characters. Calls sendtoaddress RPC on the spending wallet with supplied info. Can supply an eventMessage to be published on successful spending. eventMessage should be base64 encoded to avoid dealing with escaping special characters.

View File

@@ -1201,12 +1201,28 @@ paths:
operationId: "validateAddress" operationId: "validateAddress"
responses: responses:
'200': '200':
description: "successful operation" description: "operation successful"
content: content:
application/json: application/json:
schema: schema:
# TODO: describe response
type: "object" type: "object"
required:
- "isvalid"
properties:
isvalid:
type: "boolean"
address:
$ref: '#/components/schemas/TypeAddressString'
scriptPubKey:
type: "string"
isscript:
type: "boolean"
iswitness:
type: "boolean"
witness_version:
type: "number"
witness_program:
type: "string"
'403': '403':
$ref: '#/components/schemas/ApiResponseNotAllowed' $ref: '#/components/schemas/ApiResponseNotAllowed'
'503': '503':
@@ -3084,9 +3100,9 @@ components:
type: "string" type: "string"
pattern: "^[a-fA-F0-9]+$" pattern: "^[a-fA-F0-9]+$"
TypeAddressString: TypeAddressString:
description: "base58 check encoded address" description: "base58 or base32 check encoded address"
type: "string" type: "string"
pattern: "^[a-km-zA-HJ-NP-Z1-9]{26,35}$" pattern: "^(bc1|tb1|bcrt1)[ac-hj-np-z02-9]{9,71}|[123mn][a-km-zA-HJ-NP-Z1-9]{26,33}$"
TypeXpubString: TypeXpubString:
description: "base58 check encoded xpub" description: "base58 check encoded xpub"
type: "string" type: "string"