diff --git a/public/rpc_schemas/chain_getBlockHash.json b/public/rpc_schemas/chain_getBlockHash.json index da404f5..3172ec3 100644 --- a/public/rpc_schemas/chain_getBlockHash.json +++ b/public/rpc_schemas/chain_getBlockHash.json @@ -2,13 +2,6 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "chain_getBlockHash params", "oneOf": [ - { - "type": "object", - "description": "{} or { blockNumber }.", - "maxProperties": 1, - "additionalProperties": false, - "properties": { "blockNumber": { "type": "number" } } - }, { "type": "array", "description": "[] or [blockNumber].", diff --git a/public/rpc_schemas/state_getReadProof.json b/public/rpc_schemas/state_getReadProof.json index 21bcdec..790194d 100644 --- a/public/rpc_schemas/state_getReadProof.json +++ b/public/rpc_schemas/state_getReadProof.json @@ -2,20 +2,6 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "state_getReadProof params", "oneOf": [ - { - "type": "object", - "description": "{ keys } or { keys, at }.", - "required": ["keys"], - "additionalProperties": false, - "properties": { - "keys": { - "type": "array", - "description": "Storage keys to prove.", - "items": { "$ref": "./common.json#/$defs/hex" } - }, - "at": { "$ref": "./common.json#/$defs/hex" } - } - }, { "type": "array", "description": "[keys] or [keys, at].", @@ -29,6 +15,21 @@ }, { "$ref": "./common.json#/$defs/hex" } ] + }, + { + "type": "object", + "description": "{ keys } or { keys, at } or { keys, hash }.", + "required": ["keys"], + "additionalProperties": false, + "properties": { + "keys": { + "type": "array", + "description": "Storage keys to prove.", + "items": { "$ref": "./common.json#/$defs/hex" } + }, + "at": { "$ref": "./common.json#/$defs/hex" }, + "hash": { "$ref": "./common.json#/$defs/hex" } + } } ] } diff --git a/src/pages/RpcCalls/RpcCalls.tsx b/src/pages/RpcCalls/RpcCalls.tsx index 8dc8f0b..fc79ec3 100644 --- a/src/pages/RpcCalls/RpcCalls.tsx +++ b/src/pages/RpcCalls/RpcCalls.tsx @@ -27,7 +27,7 @@ export const RpcCalls = withSubscribe( const methods = useStateObservable(chainRpcMethods$) const setSchema = useRef<((method: string | null) => void) | null>(null) const [method, _setMethod] = useState(null) - const [params, setParams] = useState("{\n \n}") + const [params, setParams] = useState("[\n \n]") const theme = useTheme() const setMethod = (method: string | null) => { @@ -77,28 +77,25 @@ export const RpcCalls = withSubscribe( if (!model) return setSchema.current = (method) => { - monaco.languages.json.jsonDefaults.setDiagnosticsOptions( - method - ? { - validate: true, - schemas: [ - { - uri: `${SCHEMA_URL}/rpc_schemas/${method}.json`, - fileMatch: [model.uri.toString()], - }, - ], - enableSchemaRequest: true, - schemaRequest: "ignore", - } - : { - validate: false, - }, - ) + monaco.languages.json.jsonDefaults.setDiagnosticsOptions({ + validate: true, + schemas: method + ? [ + { + uri: `${SCHEMA_URL}/rpc_schemas/${method}.json`, + fileMatch: [model.uri.toString()], + }, + ] + : [], + enableSchemaRequest: true, + schemaRequest: "ignore", + }) monaco.languages.json.jsonDefaults.setModeConfiguration( method - ? { completionItems: true } + ? { completionItems: true, diagnostics: true } : { completionItems: false, + diagnostics: true, }, ) }