diff --git a/crates/sui-json-rpc-types/src/sui_transaction.rs b/crates/sui-json-rpc-types/src/sui_transaction.rs index 67859f5591354..d67345aa35db1 100644 --- a/crates/sui-json-rpc-types/src/sui_transaction.rs +++ b/crates/sui-json-rpc-types/src/sui_transaction.rs @@ -2345,7 +2345,7 @@ impl From for SuiTransactionBlockEffects { #[serde_as] #[derive(Clone, Debug, JsonSchema, Serialize, Deserialize)] pub enum TransactionFilter { - /// Query by checkpoint. + /// CURRENTLY NOT SUPPORTED. Query by checkpoint. Checkpoint( #[schemars(with = "BigInt")] #[serde_as(as = "Readable, _>")] @@ -2369,7 +2369,7 @@ pub enum TransactionFilter { ToAddress(SuiAddress), /// Query by sender and recipient address. FromAndToAddress { from: SuiAddress, to: SuiAddress }, - /// Query txs that have a given address as sender or recipient. + /// CURRENTLY NOT SUPPORTED. Query txs that have a given address as sender or recipient. FromOrToAddress { addr: SuiAddress }, /// Query by transaction kind TransactionKind(String), diff --git a/crates/sui-open-rpc/spec/openrpc.json b/crates/sui-open-rpc/spec/openrpc.json index de8467490bdab..26f66bbd1f1a9 100644 --- a/crates/sui-open-rpc/spec/openrpc.json +++ b/crates/sui-open-rpc/spec/openrpc.json @@ -10724,7 +10724,7 @@ "TransactionFilter": { "oneOf": [ { - "description": "Query by checkpoint.", + "description": "CURRENTLY NOT SUPPORTED. Query by checkpoint.", "type": "object", "required": [ "Checkpoint" @@ -10860,7 +10860,7 @@ "additionalProperties": false }, { - "description": "Query txs that have a given address as sender or recipient.", + "description": "CURRENTLY NOT SUPPORTED. Query txs that have a given address as sender or recipient.", "type": "object", "required": [ "FromOrToAddress" diff --git a/docs/site/src/components/API/api-ref/compnav.js b/docs/site/src/components/API/api-ref/compnav.js new file mode 100644 index 0000000000000..03009d56a5984 --- /dev/null +++ b/docs/site/src/components/API/api-ref/compnav.js @@ -0,0 +1,29 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import React from "react"; +import Link from "@docusaurus/Link"; + +const CompNav = (props) => { + const { json, apis } = props; + + return ( +
+
+

Component schemas

+ {Object.keys(json["components"]["schemas"]).map((component) => { + return ( +
+ + {component} + +
+ )})} +
+
+ ); +}; + +export default CompNav; diff --git a/docs/site/src/components/API/api-ref/components.js b/docs/site/src/components/API/api-ref/components.js new file mode 100644 index 0000000000000..c95234a23d486 --- /dev/null +++ b/docs/site/src/components/API/api-ref/components.js @@ -0,0 +1,326 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import React, { useRef } from "react"; +import Link from "@docusaurus/Link"; +import Markdown from "markdown-to-jsx"; +import { Light as SyntaxHighlighter } from "react-syntax-highlighter"; +import js from "react-syntax-highlighter/dist/esm/languages/hljs/json"; +import docco from "react-syntax-highlighter/dist/esm/styles/hljs/docco"; +import dark from "react-syntax-highlighter/dist/esm/styles/hljs/dracula"; +import ScrollSpy from "react-ui-scrollspy"; + +SyntaxHighlighter.registerLanguage("json", js); + +const pillStyle = + "p-2 border border-solid border-sui-blue-dark rounded-lg max-w-max bg-sui-ghost-white dark:bg-sui-gray-90"; + +const RefLink = (props) => { + const { refer } = props; + const link = refer.substring(refer.lastIndexOf("/") + 1); + return {link}; +}; + +const Of = (props) => { + const { of, type } = props; + return ( + <> + {of.map((o) => { + if (o["$ref"]) { + return ( +
+

+ +

+ {o.description && ( +

+ {o.description} +

+ )} +
+ ); + } else if (o.type && o.type === "object") { + return ( +
+

+ Object +

+ {o.description && ( +

+ {o.description} +

+ )} + {o.properties && ( + + )} +
+ ); + } else if (o.type && o.type === "string") { + return ( +
+

+ String{" "} + {o.enum && o.enum.length > 0 && ( + + enum: [ {o.enum.map((e) => `"${e}"`).join(" | ")} ] + + )} +

+ {o.description && ( +

+ {o.description} +

+ )} +
+ ); + } else if (o.type && o.type === "integer") { + return ( +
+

+ {o.type[0].toUpperCase()} + {o.type.substring(1)}<{o.format}> Minimum: {o.minimum} +

+ {o.description && {o.description}} +
+ ); + } else if (o.type && o.type === "boolean") { + return ( +
+

+ Boolean +

+ {o.description && {o.description}} +
+ ); + } else if (o.type && o.type === "array") { + return ( +
+

+ [ + {o.items && + Object.keys(o.items).map((k) => { + if (k === "$ref") { + return ; + } + })} + ] +

+ {o.description && ( +

+ {o.description} +

+ )} +
+ ); + } else if (o.anyOf) { + return ; + } else if (o.type) { + return

{o.type}

; + } + })} + + ); +}; + +const AllOf = (props) => { + const { allof } = props; + return ( +
+ +
+ ); +}; + +const AnyOf = (props) => { + const { anyof } = props; + return ( +
+

+ Any of +

+
+ +
+
+ ); +}; + +const AnyOfInline = (props) => { + const { anyof, pill } = props; + return ( +
+ {anyof.map((a, i) => { + if (a["$ref"]) { + return ( + <> + + {i % 2 === 0 ? " | " : ""} + + ); + } + if (a.type) { + return ( + <> + {a.type} + {i % 2 === 0 ? " | " : ""} + + ); + } + })} +
+ ); +}; + +const OneOf = (props) => { + const { oneof } = props; + return ( +
+

+ One of +

+
+ +
+
+ ); +}; + +const PropertiesTable = (props) => { + const { properties, schema } = props; + if (!properties) { + return; + } + return ( + + + + + + + + + + + {properties.map(([k, v]) => ( + <> + + + + + + + {v.type === "object" ? ( + + + + + ) : ( + "" + )} + + ))} + +
PropertyTypeReq?Description
{k} + {Array.isArray(v.type) ? v.type.join(" | ") : v.type} + {v.enum && + ` enum [ ${v.enum.map((e) => `"${e}"`).join(" | ")} ]`} + {v["$ref"] && } + {v.anyOf && } + {v.allOf && } + {v.oneOf && "ONEOFCELL"} + {v === true && "true"} + + {schema.required && schema.required.includes(k) ? "Yes" : "No"} + {v.description && v.description}
+ {v.additionalProperties && "Additional properties"} + + {v.additionalProperties && v.additionalProperties["$ref"] && ( + + )} + {!v.additionalProperties && v.properties && ( + + )} + {v.additionalProperties && + v.additionalProperties.type && + v.additionalProperties.type} + {v.additionalProperties && v.additionalProperties.anyOf && ( + + )} + {v.additionalProperties && + v.additionalProperties === true && + "true"} +
+ ); +}; + +const Components = (props) => { + const { schemas } = props; + const names = Object.keys(schemas); + const parentScrollContainerRef = () => { + (useRef < React.HTMLDivElement) | (null > null); + }; + return ( +
+

Component schemas

+ + {names && + names.map((name) => { + return ( +
+

{name}

+ + {schemas[name].description && ( +

+ {schemas[name].description} +

+ )} + {schemas[name].type && ( +

+ {schemas[name].type[0].toUpperCase()} + {schemas[name].type.substring(1)} + {schemas[name].enum && + ` enum [ ${schemas[name].enum.map((e) => `"${e}"`).join(" | ")} ]`} +

+ )} + + {schemas[name].properties && ( + + )} + {schemas[name].allOf && } + {schemas[name].oneOf && } + {schemas[name].anyOf && } + {schemas[name]["$ref"] && ( + + )} +
+ + Toggle raw JSON + +
+                    {`"${name}":  ${JSON.stringify(schemas[name], null, 2)}`}
+                  
+
+
+ ); + })} +
+
+ ); +}; + +export default Components; diff --git a/docs/site/src/components/API/api-ref/refnav.js b/docs/site/src/components/API/api-ref/refnav.js index d7398e6b35903..003903cf8023f 100644 --- a/docs/site/src/components/API/api-ref/refnav.js +++ b/docs/site/src/components/API/api-ref/refnav.js @@ -9,7 +9,7 @@ const RefNav = (props) => { const { json, apis } = props; return ( -
+
@@ -40,6 +40,7 @@ const RefNav = (props) => { ); })} +
); })} diff --git a/docs/site/src/components/API/api-ref/result.js b/docs/site/src/components/API/api-ref/result.js index 542536775dd5c..45eb1f021d34b 100644 --- a/docs/site/src/components/API/api-ref/result.js +++ b/docs/site/src/components/API/api-ref/result.js @@ -41,7 +41,6 @@ const Property = (props) => { const Result = (props) => { const { json, result } = props; - //console.log(result) const hasRef = typeof result.schema["$ref"] !== "undefined"; let refObj = {}; diff --git a/docs/site/src/components/API/index.js b/docs/site/src/components/API/index.js index ccc5fbd053362..f2fe2f1aa21b7 100644 --- a/docs/site/src/components/API/index.js +++ b/docs/site/src/components/API/index.js @@ -4,7 +4,9 @@ import React, { useState, useEffect } from "react"; import ExecutionEnvironment from "@docusaurus/ExecutionEnvironment"; import RefNav from "./api-ref/refnav"; +import CompNav from "./api-ref/compnav"; import Methods from "./api-ref/method"; +import Components from "./api-ref/components"; import ScrollSpy from "react-ui-scrollspy"; @@ -81,6 +83,7 @@ const Rpc = () => {
+
@@ -89,12 +92,15 @@ const Rpc = () => {

Sui JSON-RPC Reference - Version: {openrpc.info.version}

- +

{openrpc.info.description}

+ + +
-
+