mirror of
https://github.com/alexgo-io/stacks-blockchain-api.git
synced 2026-04-28 21:05:36 +08:00
chore: define full rpc request bodies in json schema
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "RpcAddressBalanceNotificationResponse",
|
||||
"description": "",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"jsonrpc",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"properties": {
|
||||
"jsonrpc": {
|
||||
"type": "string",
|
||||
"enum": ["2.0"]
|
||||
},
|
||||
"method": {
|
||||
"type": "string",
|
||||
"enum": ["address_balance_update"]
|
||||
},
|
||||
"params": {
|
||||
"$ref": "./rpc-address-balance-notification-params.schema.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "RpcAddressBalanceSubscriptionRequest",
|
||||
"description": "",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"jsonrpc",
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"properties": {
|
||||
"jsonrpc": {
|
||||
"type": "string",
|
||||
"enum": ["2.0"]
|
||||
},
|
||||
"id": {
|
||||
"type": ["number", "string"]
|
||||
},
|
||||
"method": {
|
||||
"type": "string",
|
||||
"enum": ["address_balance_update"]
|
||||
},
|
||||
"params": {
|
||||
"$ref": "./rpc-address-balance-subscription-params.schema.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "RpcAddressTxNotificationResponse",
|
||||
"description": "",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"jsonrpc",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"properties": {
|
||||
"jsonrpc": {
|
||||
"type": "string",
|
||||
"enum": ["2.0"]
|
||||
},
|
||||
"method": {
|
||||
"type": "string",
|
||||
"enum": ["address_tx_update"]
|
||||
},
|
||||
"params": {
|
||||
"$ref": "./rpc-address-tx-notification-params.schema.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "RpcAddressTxSubscriptionRequest",
|
||||
"description": "",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"jsonrpc",
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"properties": {
|
||||
"jsonrpc": {
|
||||
"type": "string",
|
||||
"enum": ["2.0"]
|
||||
},
|
||||
"id": {
|
||||
"type": ["number", "string"]
|
||||
},
|
||||
"method": {
|
||||
"type": "string",
|
||||
"enum": ["address_tx_update"]
|
||||
},
|
||||
"params": {
|
||||
"$ref": "./rpc-address-tx-subscription-params.schema.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "RpcTxUpdateNotificationResponse",
|
||||
"description": "",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"jsonrpc",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"properties": {
|
||||
"jsonrpc": {
|
||||
"type": "string",
|
||||
"enum": ["2.0"]
|
||||
},
|
||||
"method": {
|
||||
"type": "string",
|
||||
"enum": ["tx_update"]
|
||||
},
|
||||
"params": {
|
||||
"$ref": "./rpc-tx-update-notification-params.schema.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "RpcTxUpdateSubscriptionRequest",
|
||||
"description": "",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"jsonrpc",
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"properties": {
|
||||
"jsonrpc": {
|
||||
"type": "string",
|
||||
"enum": ["2.0"]
|
||||
},
|
||||
"id": {
|
||||
"type": ["number", "string"]
|
||||
},
|
||||
"method": {
|
||||
"type": "string",
|
||||
"enum": ["tx_update"]
|
||||
},
|
||||
"params": {
|
||||
"$ref": "./rpc-tx-update-subscription-params.schema.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
39
docs/index.d.ts
vendored
39
docs/index.d.ts
vendored
@@ -1025,11 +1025,24 @@ export interface RpcAddressBalanceNotificationParams {
|
||||
balance: string;
|
||||
}
|
||||
|
||||
export interface RpcAddressBalanceNotificationResponse {
|
||||
jsonrpc: "2.0";
|
||||
method: "address_balance_update";
|
||||
params: RpcAddressBalanceNotificationParams;
|
||||
}
|
||||
|
||||
export interface RpcAddressBalanceSubscriptionParams {
|
||||
event: "address_balance_update";
|
||||
address: string;
|
||||
}
|
||||
|
||||
export interface RpcAddressBalanceSubscriptionRequest {
|
||||
jsonrpc: "2.0";
|
||||
id: number | string;
|
||||
method: "address_balance_update";
|
||||
params: RpcAddressBalanceSubscriptionParams;
|
||||
}
|
||||
|
||||
export interface RpcAddressTxNotificationParams {
|
||||
address: string;
|
||||
tx_id: string;
|
||||
@@ -1037,11 +1050,24 @@ export interface RpcAddressTxNotificationParams {
|
||||
tx_status: TransactionStatus;
|
||||
}
|
||||
|
||||
export interface RpcAddressTxNotificationResponse {
|
||||
jsonrpc: "2.0";
|
||||
method: "address_tx_update";
|
||||
params: RpcAddressTxNotificationParams;
|
||||
}
|
||||
|
||||
export interface RpcAddressTxSubscriptionParams {
|
||||
event: "address_tx_update";
|
||||
address: string;
|
||||
}
|
||||
|
||||
export interface RpcAddressTxSubscriptionRequest {
|
||||
jsonrpc: "2.0";
|
||||
id: number | string;
|
||||
method: "address_tx_update";
|
||||
params: RpcAddressTxSubscriptionParams;
|
||||
}
|
||||
|
||||
export type RpcSubscriptionType = "tx_update" | "address_tx_update" | "address_balance_update";
|
||||
|
||||
export interface RpcTxUpdateNotificationParams {
|
||||
@@ -1050,8 +1076,21 @@ export interface RpcTxUpdateNotificationParams {
|
||||
tx_status: TransactionStatus;
|
||||
}
|
||||
|
||||
export interface RpcTxUpdateNotificationResponse {
|
||||
jsonrpc: "2.0";
|
||||
method: "tx_update";
|
||||
params: RpcTxUpdateNotificationParams;
|
||||
}
|
||||
|
||||
export interface RpcTxUpdateSubscriptionParams {
|
||||
event: "tx_update";
|
||||
tx_id: string;
|
||||
}
|
||||
|
||||
export interface RpcTxUpdateSubscriptionRequest {
|
||||
jsonrpc: "2.0";
|
||||
id: number | string;
|
||||
method: "tx_update";
|
||||
params: RpcTxUpdateSubscriptionParams;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user