From 9a323ab5a42b1ae00738d05d17655bb2bf15732a Mon Sep 17 00:00:00 2001 From: nk_ysg Date: Thu, 28 Nov 2024 15:32:16 +0800 Subject: [PATCH] fix starcoin-rpc-api schema --- rpc/api/generated_rpc_schema/account.json | 20 +- rpc/api/generated_rpc_schema/chain.json | 107 ++- .../generated_rpc_schema/contract_api.json | 58 +- rpc/api/generated_rpc_schema/node.json | 14 - rpc/api/generated_rpc_schema/state.json | 617 +++++++++++++++--- .../generated_rpc_schema/sync_manager.json | 7 - rpc/api/generated_rpc_schema/txpool.json | 10 +- 7 files changed, 652 insertions(+), 181 deletions(-) diff --git a/rpc/api/generated_rpc_schema/account.json b/rpc/api/generated_rpc_schema/account.json index 14737cde2b..a6cd2b3b40 100644 --- a/rpc/api/generated_rpc_schema/account.json +++ b/rpc/api/generated_rpc_schema/account.json @@ -656,7 +656,7 @@ ], "properties": { "init_script": { - "description": "Call a Move script function.", + "description": "Call a Move entry function.", "type": [ "object", "null" @@ -712,14 +712,14 @@ "additionalProperties": false }, { - "description": "A transaction that executes an existing script function published on-chain.", + "description": "A transaction that executes an existing entry function published on-chain.", "type": "object", "required": [ - "ScriptFunction" + "EntryFunction" ], "properties": { - "ScriptFunction": { - "description": "Call a Move script function.", + "EntryFunction": { + "description": "Call a Move entry function.", "type": "object", "required": [ "args", @@ -940,7 +940,7 @@ ], "properties": { "init_script": { - "description": "Call a Move script function.", + "description": "Call a Move entry function.", "type": [ "object", "null" @@ -996,14 +996,14 @@ "additionalProperties": false }, { - "description": "A transaction that executes an existing script function published on-chain.", + "description": "A transaction that executes an existing entry function published on-chain.", "type": "object", "required": [ - "ScriptFunction" + "EntryFunction" ], "properties": { - "ScriptFunction": { - "description": "Call a Move script function.", + "EntryFunction": { + "description": "Call a Move entry function.", "type": "object", "required": [ "args", diff --git a/rpc/api/generated_rpc_schema/chain.json b/rpc/api/generated_rpc_schema/chain.json index c677f92582..1fbfb6aa86 100644 --- a/rpc/api/generated_rpc_schema/chain.json +++ b/rpc/api/generated_rpc_schema/chain.json @@ -166,13 +166,6 @@ "type": "string", "format": "AccountAddress" }, - "author_auth_key": { - "description": "Block author auth key.", - "type": [ - "string", - "null" - ] - }, "block_accumulator_root": { "description": "The block accumulator root hash.", "type": "string", @@ -609,13 +602,6 @@ "type": "string", "format": "AccountAddress" }, - "author_auth_key": { - "description": "Block author auth key.", - "type": [ - "string", - "null" - ] - }, "block_accumulator_root": { "description": "The block accumulator root hash.", "type": "string", @@ -737,13 +723,6 @@ "type": "string", "format": "AccountAddress" }, - "author_auth_key": { - "description": "Block author auth key.", - "type": [ - "string", - "null" - ] - }, "block_accumulator_root": { "description": "The block accumulator root hash.", "type": "string", @@ -1182,13 +1161,6 @@ "type": "string", "format": "AccountAddress" }, - "author_auth_key": { - "description": "Block author auth key.", - "type": [ - "string", - "null" - ] - }, "block_accumulator_root": { "description": "The block accumulator root hash.", "type": "string", @@ -1310,13 +1282,6 @@ "type": "string", "format": "AccountAddress" }, - "author_auth_key": { - "description": "Block author auth key.", - "type": [ - "string", - "null" - ] - }, "block_accumulator_root": { "description": "The block accumulator root hash.", "type": "string", @@ -1763,13 +1728,6 @@ "type": "string", "format": "AccountAddress" }, - "author_auth_key": { - "description": "Block author auth key.", - "type": [ - "string", - "null" - ] - }, "block_accumulator_root": { "description": "The block accumulator root hash.", "type": "string", @@ -1891,13 +1849,6 @@ "type": "string", "format": "AccountAddress" }, - "author_auth_key": { - "description": "Block author auth key.", - "type": [ - "string", - "null" - ] - }, "block_accumulator_root": { "description": "The block accumulator root hash.", "type": "string", @@ -3055,7 +3006,22 @@ }, "event_key": { "description": "A struct that represents a globally unique id for an Event stream that a user can listen to. By design, the lower part of EventKey is the same as account address.", - "type": "string" + "type": "object", + "required": [ + "account_address", + "creation_number" + ], + "properties": { + "account_address": { + "type": "string", + "format": "AccountAddress" + }, + "creation_number": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + } }, "event_seq_number": { "type": "string" @@ -3121,7 +3087,22 @@ ], "items": { "description": "A struct that represents a globally unique id for an Event stream that a user can listen to. By design, the lower part of EventKey is the same as account address.", - "type": "string" + "type": "object", + "required": [ + "account_address", + "creation_number" + ], + "properties": { + "account_address": { + "type": "string", + "format": "AccountAddress" + }, + "creation_number": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + } } }, "from_block": { @@ -3229,7 +3210,22 @@ }, "event_key": { "description": "A struct that represents a globally unique id for an Event stream that a user can listen to. By design, the lower part of EventKey is the same as account address.", - "type": "string" + "type": "object", + "required": [ + "account_address", + "creation_number" + ], + "properties": { + "account_address": { + "type": "string", + "format": "AccountAddress" + }, + "creation_number": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + } }, "event_seq_number": { "type": "string" @@ -3309,13 +3305,6 @@ "type": "string", "format": "AccountAddress" }, - "author_auth_key": { - "description": "Block author auth key.", - "type": [ - "string", - "null" - ] - }, "block_accumulator_root": { "description": "The block accumulator root hash.", "type": "string", diff --git a/rpc/api/generated_rpc_schema/contract_api.json b/rpc/api/generated_rpc_schema/contract_api.json index 6378e32f39..ebfc656eb6 100644 --- a/rpc/api/generated_rpc_schema/contract_api.json +++ b/rpc/api/generated_rpc_schema/contract_api.json @@ -1037,7 +1037,22 @@ }, "event_key": { "description": "A struct that represents a globally unique id for an Event stream that a user can listen to. By design, the lower part of EventKey is the same as account address.", - "type": "string" + "type": "object", + "required": [ + "account_address", + "creation_number" + ], + "properties": { + "account_address": { + "type": "string", + "format": "AccountAddress" + }, + "creation_number": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + } }, "event_seq_number": { "type": "string" @@ -1384,6 +1399,18 @@ } }, "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ResourceGroup" + ], + "properties": { + "ResourceGroup": { + "type": "string" + } + }, + "additionalProperties": false } ] } @@ -2328,7 +2355,22 @@ }, "event_key": { "description": "A struct that represents a globally unique id for an Event stream that a user can listen to. By design, the lower part of EventKey is the same as account address.", - "type": "string" + "type": "object", + "required": [ + "account_address", + "creation_number" + ], + "properties": { + "account_address": { + "type": "string", + "format": "AccountAddress" + }, + "creation_number": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + } }, "event_seq_number": { "type": "string" @@ -2675,6 +2717,18 @@ } }, "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ResourceGroup" + ], + "properties": { + "ResourceGroup": { + "type": "string" + } + }, + "additionalProperties": false } ] } diff --git a/rpc/api/generated_rpc_schema/node.json b/rpc/api/generated_rpc_schema/node.json index f84e0d1dcb..ca593d72ec 100644 --- a/rpc/api/generated_rpc_schema/node.json +++ b/rpc/api/generated_rpc_schema/node.json @@ -297,13 +297,6 @@ "type": "string", "format": "AccountAddress" }, - "author_auth_key": { - "description": "Block author auth key.", - "type": [ - "string", - "null" - ] - }, "block_accumulator_root": { "description": "The block accumulator root hash.", "type": "string", @@ -550,13 +543,6 @@ "type": "string", "format": "AccountAddress" }, - "author_auth_key": { - "description": "Block author auth key.", - "type": [ - "string", - "null" - ] - }, "block_accumulator_root": { "description": "The block accumulator root hash.", "type": "string", diff --git a/rpc/api/generated_rpc_schema/state.json b/rpc/api/generated_rpc_schema/state.json index 7d94fcc4a7..01fe3fc98b 100644 --- a/rpc/api/generated_rpc_schema/state.json +++ b/rpc/api/generated_rpc_schema/state.json @@ -9,30 +9,94 @@ "name": "state.get", "params": [ { - "name": "access_path", + "name": "state_key", "schema": { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "AccessPath", + "title": "StateKey", "type": "object", "required": [ - "address", - "path" + "deserialized", + "encoded", + "hash_value" ], "properties": { - "address": { - "type": "string", - "format": "AccountAddress" + "deserialized": { + "$ref": "#/definitions/StateKey" + }, + "encoded": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } }, - "path": { + "hash_value": { + "type": "string", + "format": "HashValue" + } + }, + "definitions": { + "StateKey": { "oneOf": [ { "type": "object", "required": [ - "Code" + "AccessPath" ], "properties": { - "Code": { - "type": "string" + "AccessPath": { + "type": "object", + "required": [ + "address", + "path" + ], + "properties": { + "address": { + "type": "string", + "format": "AccountAddress" + }, + "path": { + "oneOf": [ + { + "type": "object", + "required": [ + "Code" + ], + "properties": { + "Code": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "Resource" + ], + "properties": { + "Resource": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ResourceGroup" + ], + "properties": { + "ResourceGroup": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + } } }, "additionalProperties": false @@ -40,11 +104,38 @@ { "type": "object", "required": [ - "Resource" + "TableItem" ], "properties": { - "Resource": { - "type": "string" + "TableItem": { + "type": "object", + "required": [ + "handle", + "key" + ], + "properties": { + "handle": { + "type": "string", + "format": "AccountAddress" + }, + "key": { + "type": "string", + "format": "bytes" + } + } + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "Raw" + ], + "properties": { + "Raw": { + "type": "string", + "format": "bytes" } }, "additionalProperties": false @@ -56,7 +147,7 @@ } ], "result": { - "name": "Option < Vec < u8 > >", + "name": "Option < Bytes >", "schema": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Nullable_Array_of_uint8", @@ -86,7 +177,7 @@ } ], "result": { - "name": "Option < Vec < u8 > >", + "name": "Option < Bytes >", "schema": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Nullable_Array_of_uint8", @@ -106,30 +197,94 @@ "name": "state.get_with_proof", "params": [ { - "name": "access_path", + "name": "state_key", "schema": { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "AccessPath", + "title": "StateKey", "type": "object", "required": [ - "address", - "path" + "deserialized", + "encoded", + "hash_value" ], "properties": { - "address": { - "type": "string", - "format": "AccountAddress" + "deserialized": { + "$ref": "#/definitions/StateKey" + }, + "encoded": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } }, - "path": { + "hash_value": { + "type": "string", + "format": "HashValue" + } + }, + "definitions": { + "StateKey": { "oneOf": [ { "type": "object", "required": [ - "Code" + "AccessPath" ], "properties": { - "Code": { - "type": "string" + "AccessPath": { + "type": "object", + "required": [ + "address", + "path" + ], + "properties": { + "address": { + "type": "string", + "format": "AccountAddress" + }, + "path": { + "oneOf": [ + { + "type": "object", + "required": [ + "Code" + ], + "properties": { + "Code": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "Resource" + ], + "properties": { + "Resource": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ResourceGroup" + ], + "properties": { + "ResourceGroup": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + } } }, "additionalProperties": false @@ -137,11 +292,38 @@ { "type": "object", "required": [ - "Resource" + "TableItem" ], "properties": { - "Resource": { - "type": "string" + "TableItem": { + "type": "object", + "required": [ + "handle", + "key" + ], + "properties": { + "handle": { + "type": "string", + "format": "AccountAddress" + }, + "key": { + "type": "string", + "format": "bytes" + } + } + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "Raw" + ], + "properties": { + "Raw": { + "type": "string", + "format": "bytes" } }, "additionalProperties": false @@ -253,30 +435,94 @@ "name": "state.get_with_proof_raw", "params": [ { - "name": "access_path", + "name": "state_key", "schema": { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "AccessPath", + "title": "StateKey", "type": "object", "required": [ - "address", - "path" + "deserialized", + "encoded", + "hash_value" ], "properties": { - "address": { - "type": "string", - "format": "AccountAddress" + "deserialized": { + "$ref": "#/definitions/StateKey" + }, + "encoded": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } }, - "path": { + "hash_value": { + "type": "string", + "format": "HashValue" + } + }, + "definitions": { + "StateKey": { "oneOf": [ { "type": "object", "required": [ - "Code" + "AccessPath" ], "properties": { - "Code": { - "type": "string" + "AccessPath": { + "type": "object", + "required": [ + "address", + "path" + ], + "properties": { + "address": { + "type": "string", + "format": "AccountAddress" + }, + "path": { + "oneOf": [ + { + "type": "object", + "required": [ + "Code" + ], + "properties": { + "Code": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "Resource" + ], + "properties": { + "Resource": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ResourceGroup" + ], + "properties": { + "ResourceGroup": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + } } }, "additionalProperties": false @@ -284,11 +530,38 @@ { "type": "object", "required": [ - "Resource" + "TableItem" ], "properties": { - "Resource": { - "type": "string" + "TableItem": { + "type": "object", + "required": [ + "handle", + "key" + ], + "properties": { + "handle": { + "type": "string", + "format": "AccountAddress" + }, + "key": { + "type": "string", + "format": "bytes" + } + } + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "Raw" + ], + "properties": { + "Raw": { + "type": "string", + "format": "bytes" } }, "additionalProperties": false @@ -322,14 +595,11 @@ } ], "result": { - "name": "Option < AccountState >", + "name": "AccountState", "schema": { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Nullable_AccountState", - "type": [ - "object", - "null" - ], + "title": "AccountState", + "type": "object", "required": [ "storage_roots" ], @@ -765,30 +1035,94 @@ "name": "state.get_with_proof_by_root", "params": [ { - "name": "access_path", + "name": "state_key", "schema": { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "AccessPath", + "title": "StateKey", "type": "object", "required": [ - "address", - "path" + "deserialized", + "encoded", + "hash_value" ], "properties": { - "address": { - "type": "string", - "format": "AccountAddress" + "deserialized": { + "$ref": "#/definitions/StateKey" + }, + "encoded": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } }, - "path": { + "hash_value": { + "type": "string", + "format": "HashValue" + } + }, + "definitions": { + "StateKey": { "oneOf": [ { "type": "object", "required": [ - "Code" + "AccessPath" ], "properties": { - "Code": { - "type": "string" + "AccessPath": { + "type": "object", + "required": [ + "address", + "path" + ], + "properties": { + "address": { + "type": "string", + "format": "AccountAddress" + }, + "path": { + "oneOf": [ + { + "type": "object", + "required": [ + "Code" + ], + "properties": { + "Code": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "Resource" + ], + "properties": { + "Resource": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ResourceGroup" + ], + "properties": { + "ResourceGroup": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + } } }, "additionalProperties": false @@ -796,11 +1130,38 @@ { "type": "object", "required": [ - "Resource" + "TableItem" ], "properties": { - "Resource": { - "type": "string" + "TableItem": { + "type": "object", + "required": [ + "handle", + "key" + ], + "properties": { + "handle": { + "type": "string", + "format": "AccountAddress" + }, + "key": { + "type": "string", + "format": "bytes" + } + } + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "Raw" + ], + "properties": { + "Raw": { + "type": "string", + "format": "bytes" } }, "additionalProperties": false @@ -921,30 +1282,94 @@ "name": "state.get_with_proof_by_root_raw", "params": [ { - "name": "access_path", + "name": "state_key", "schema": { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "AccessPath", + "title": "StateKey", "type": "object", "required": [ - "address", - "path" + "deserialized", + "encoded", + "hash_value" ], "properties": { - "address": { - "type": "string", - "format": "AccountAddress" + "deserialized": { + "$ref": "#/definitions/StateKey" + }, + "encoded": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } }, - "path": { + "hash_value": { + "type": "string", + "format": "HashValue" + } + }, + "definitions": { + "StateKey": { "oneOf": [ { "type": "object", "required": [ - "Code" + "AccessPath" ], "properties": { - "Code": { - "type": "string" + "AccessPath": { + "type": "object", + "required": [ + "address", + "path" + ], + "properties": { + "address": { + "type": "string", + "format": "AccountAddress" + }, + "path": { + "oneOf": [ + { + "type": "object", + "required": [ + "Code" + ], + "properties": { + "Code": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "Resource" + ], + "properties": { + "Resource": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ResourceGroup" + ], + "properties": { + "ResourceGroup": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + } } }, "additionalProperties": false @@ -952,11 +1377,38 @@ { "type": "object", "required": [ - "Resource" + "TableItem" ], "properties": { - "Resource": { - "type": "string" + "TableItem": { + "type": "object", + "required": [ + "handle", + "key" + ], + "properties": { + "handle": { + "type": "string", + "format": "AccountAddress" + }, + "key": { + "type": "string", + "format": "bytes" + } + } + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "Raw" + ], + "properties": { + "Raw": { + "type": "string", + "format": "bytes" } }, "additionalProperties": false @@ -999,14 +1451,11 @@ } ], "result": { - "name": "Option < TableInfoView >", + "name": "TableInfoView", "schema": { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Nullable_table_info", - "type": [ - "object", - "null" - ], + "title": "table_info", + "type": "object", "required": [ "key_type", "value_type" diff --git a/rpc/api/generated_rpc_schema/sync_manager.json b/rpc/api/generated_rpc_schema/sync_manager.json index 0288d0b53f..6044824db8 100644 --- a/rpc/api/generated_rpc_schema/sync_manager.json +++ b/rpc/api/generated_rpc_schema/sync_manager.json @@ -51,13 +51,6 @@ "type": "string", "format": "AccountAddress" }, - "author_auth_key": { - "description": "Block author auth key. this field is deprecated", - "type": [ - "string", - "null" - ] - }, "block_accumulator_root": { "description": "The parent block info's block accumulator root hash.", "type": "string", diff --git a/rpc/api/generated_rpc_schema/txpool.json b/rpc/api/generated_rpc_schema/txpool.json index ef7f061abd..8eb3f5a85f 100644 --- a/rpc/api/generated_rpc_schema/txpool.json +++ b/rpc/api/generated_rpc_schema/txpool.json @@ -173,7 +173,7 @@ ], "properties": { "init_script": { - "description": "Call a Move script function.", + "description": "Call a Move entry function.", "type": [ "object", "null" @@ -229,14 +229,14 @@ "additionalProperties": false }, { - "description": "A transaction that executes an existing script function published on-chain.", + "description": "A transaction that executes an existing entry function published on-chain.", "type": "object", "required": [ - "ScriptFunction" + "EntryFunction" ], "properties": { - "ScriptFunction": { - "description": "Call a Move script function.", + "EntryFunction": { + "description": "Call a Move entry function.", "type": "object", "required": [ "args",