From 446d70b982427526f0f135ed8b1e35113abe5bfd Mon Sep 17 00:00:00 2001 From: Oliver Eggert Date: Mon, 23 Sep 2024 16:29:44 -0700 Subject: [PATCH 1/4] clarify decimal input and hexadecimal api response --- .../protocol/ledger-data/ledger-entry-types/oracle.md | 2 +- docs/references/protocol/transactions/types/oracleset.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/references/protocol/ledger-data/ledger-entry-types/oracle.md b/docs/references/protocol/ledger-data/ledger-entry-types/oracle.md index 1213e90e98..f6c5ae5e10 100644 --- a/docs/references/protocol/ledger-data/ledger-entry-types/oracle.md +++ b/docs/references/protocol/ledger-data/ledger-entry-types/oracle.md @@ -59,7 +59,7 @@ A price oracle object can store information for up to 10 token pairs. |---------------------|-----------|---------------|-----------|-------------| | `BaseAsset` | String | Currency | Yes | The primary asset in a trading pair. Any valid identifier, such as a stock symbol, bond CUSIP, or currency code is allowed. | | `QuoteAsset` | String | Currency | Yes | The quote asset in a trading pair. The quote asset denotes the price of one unit of the base asset. | -| `AssetPrice` | Number | UInt64 | No | The asset price after applying the `Scale` precision level. It's not included if the last update transaction didn't include the `BaseAsset`/`QuoteAsset` pair. | +| `AssetPrice` | Number | UInt64 | No | The asset price after applying the `Scale` precision level. It's not included if the last update transaction didn't include the `BaseAsset`/`QuoteAsset` pair. Displayed in hexadecimal format. | | `Scale` | Number | UInt8 | No | The scaling factor to apply to an asset price. For example, if `Scale` is 6 and original price is 0.155, then the scaled price is 155000. Valid scale ranges are 0-10. It's not included if the last update transaction didn't include the `BaseAsset`/`QuoteAsset` pair. | diff --git a/docs/references/protocol/transactions/types/oracleset.md b/docs/references/protocol/transactions/types/oracleset.md index 0ebe260903..fc0f66f9b4 100644 --- a/docs/references/protocol/transactions/types/oracleset.md +++ b/docs/references/protocol/transactions/types/oracleset.md @@ -56,9 +56,9 @@ Creates a new `Oracle` ledger entry or updates the fields of an existing one, us | Field | JSON Type | Internal Type | Required? | Description | |---------------------|-----------|---------------|-----------|-------------| | `BaseAsset` | String | Currency | Yes | The primary asset in a trading pair. Any valid identifier, such as a stock symbol, bond CUSIP, or currency code is allowed. For example, in the BTC/USD pair, BTC is the base asset; in 912810RR9/BTC, 912810RR9 is the base asset. | -| `QuoteAsset` | String | Currency | Yes | The quote asset in a trading pair. The quote asset denotes the price of one unit of the base asset. For example, in the BTC/USD pair, USD is the quote asset; in 912810RR9/BTC, BTC is the quote asset. | -| `AssetPrice` | Number | UInt64 | No | The asset price after applying the `Scale` precision level. If it is not included, the PriceData object will be deleted. | -| `Scale` | Number | UInt8 | No | The scaling factor to apply to an asset price. For example, if `Scale` is 6 and original price is 0.155, then the scaled price is 155000. Valid scale ranges are 0-10. The default value is 0. | +| `QuoteAsset` | String | Currency | Yes | The quote asset in a trading pair. The quote asset denotes the price of one unit of the base asset. For example, in the BTC/USD pair, BTC is the base asset; in 912810RR9/BTC, 912810RR9 is the base asset. | +| `AssetPrice` | Number | UInt64 | No | The asset price after applying the `Scale` precision level. It's not included if the last update transaction didn't include the `BaseAsset`/`QuoteAsset` pair. Must be in decimal format. | +| `Scale` | Number | UInt8 | No | The scaling factor to apply to an asset price. For example, if `Scale` is 6 and original price is 0.155, then the scaled price is 155000. Valid scale ranges are 0-10. It's not included if the last update transaction didn't include the `BaseAsset`/`QuoteAsset` pair.| `PriceData` is created or updated, following these rules: From cad8664fc3faa7928a53c76692773cc312e16336 Mon Sep 17 00:00:00 2001 From: Oliver Eggert Date: Mon, 4 Nov 2024 15:46:59 -0800 Subject: [PATCH 2/4] hex/decimal clarificatoin --- docs/references/protocol/transactions/types/oracleset.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/references/protocol/transactions/types/oracleset.md b/docs/references/protocol/transactions/types/oracleset.md index fc0f66f9b4..62e6151e7b 100644 --- a/docs/references/protocol/transactions/types/oracleset.md +++ b/docs/references/protocol/transactions/types/oracleset.md @@ -57,7 +57,7 @@ Creates a new `Oracle` ledger entry or updates the fields of an existing one, us |---------------------|-----------|---------------|-----------|-------------| | `BaseAsset` | String | Currency | Yes | The primary asset in a trading pair. Any valid identifier, such as a stock symbol, bond CUSIP, or currency code is allowed. For example, in the BTC/USD pair, BTC is the base asset; in 912810RR9/BTC, 912810RR9 is the base asset. | | `QuoteAsset` | String | Currency | Yes | The quote asset in a trading pair. The quote asset denotes the price of one unit of the base asset. For example, in the BTC/USD pair, BTC is the base asset; in 912810RR9/BTC, 912810RR9 is the base asset. | -| `AssetPrice` | Number | UInt64 | No | The asset price after applying the `Scale` precision level. It's not included if the last update transaction didn't include the `BaseAsset`/`QuoteAsset` pair. Must be in decimal format. | +| `AssetPrice` | String | UInt64 | No | The asset price after applying the `Scale` precision level. It's not included if the last update transaction didn't include the `BaseAsset`/`QuoteAsset` pair. It's recommended you provide this value as a hexadecimal, but [client libraries](https://xrpl.org/docs/references#client-libraries) will accept decimal inputs and convert to hexadecimal. | | `Scale` | Number | UInt8 | No | The scaling factor to apply to an asset price. For example, if `Scale` is 6 and original price is 0.155, then the scaled price is 155000. Valid scale ranges are 0-10. It's not included if the last update transaction didn't include the `BaseAsset`/`QuoteAsset` pair.| `PriceData` is created or updated, following these rules: From 629a0a33e377923e08f7e97ab45818deb2c4c001 Mon Sep 17 00:00:00 2001 From: Oliver Eggert Date: Mon, 4 Nov 2024 16:23:06 -0800 Subject: [PATCH 3/4] fix json type --- .../protocol/ledger-data/ledger-entry-types/oracle.md | 2 +- docs/references/protocol/transactions/types/oracleset.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/references/protocol/ledger-data/ledger-entry-types/oracle.md b/docs/references/protocol/ledger-data/ledger-entry-types/oracle.md index f6c5ae5e10..91ce3675b9 100644 --- a/docs/references/protocol/ledger-data/ledger-entry-types/oracle.md +++ b/docs/references/protocol/ledger-data/ledger-entry-types/oracle.md @@ -59,7 +59,7 @@ A price oracle object can store information for up to 10 token pairs. |---------------------|-----------|---------------|-----------|-------------| | `BaseAsset` | String | Currency | Yes | The primary asset in a trading pair. Any valid identifier, such as a stock symbol, bond CUSIP, or currency code is allowed. | | `QuoteAsset` | String | Currency | Yes | The quote asset in a trading pair. The quote asset denotes the price of one unit of the base asset. | -| `AssetPrice` | Number | UInt64 | No | The asset price after applying the `Scale` precision level. It's not included if the last update transaction didn't include the `BaseAsset`/`QuoteAsset` pair. Displayed in hexadecimal format. | +| `AssetPrice` | String | UInt64 | No | The asset price after applying the `Scale` precision level. It's not included if the last update transaction didn't include the `BaseAsset`/`QuoteAsset` pair. Displayed in hexadecimal format. | | `Scale` | Number | UInt8 | No | The scaling factor to apply to an asset price. For example, if `Scale` is 6 and original price is 0.155, then the scaled price is 155000. Valid scale ranges are 0-10. It's not included if the last update transaction didn't include the `BaseAsset`/`QuoteAsset` pair. | diff --git a/docs/references/protocol/transactions/types/oracleset.md b/docs/references/protocol/transactions/types/oracleset.md index 62e6151e7b..8225e7709c 100644 --- a/docs/references/protocol/transactions/types/oracleset.md +++ b/docs/references/protocol/transactions/types/oracleset.md @@ -57,7 +57,7 @@ Creates a new `Oracle` ledger entry or updates the fields of an existing one, us |---------------------|-----------|---------------|-----------|-------------| | `BaseAsset` | String | Currency | Yes | The primary asset in a trading pair. Any valid identifier, such as a stock symbol, bond CUSIP, or currency code is allowed. For example, in the BTC/USD pair, BTC is the base asset; in 912810RR9/BTC, 912810RR9 is the base asset. | | `QuoteAsset` | String | Currency | Yes | The quote asset in a trading pair. The quote asset denotes the price of one unit of the base asset. For example, in the BTC/USD pair, BTC is the base asset; in 912810RR9/BTC, 912810RR9 is the base asset. | -| `AssetPrice` | String | UInt64 | No | The asset price after applying the `Scale` precision level. It's not included if the last update transaction didn't include the `BaseAsset`/`QuoteAsset` pair. It's recommended you provide this value as a hexadecimal, but [client libraries](https://xrpl.org/docs/references#client-libraries) will accept decimal inputs and convert to hexadecimal. | +| `AssetPrice` | String | UInt64 | No | The asset price after applying the `Scale` precision level. It's not included if the last update transaction didn't include the `BaseAsset`/`QuoteAsset` pair. It's recommended you provide this value as a hexadecimal, but [client libraries](https://xrpl.org/docs/references#client-libraries) will accept decimal numbers and convert to hexadecimal strings. | | `Scale` | Number | UInt8 | No | The scaling factor to apply to an asset price. For example, if `Scale` is 6 and original price is 0.155, then the scaled price is 155000. Valid scale ranges are 0-10. It's not included if the last update transaction didn't include the `BaseAsset`/`QuoteAsset` pair.| `PriceData` is created or updated, following these rules: From e520211135c6d47fd0fde98f574483cc1bb59c2b Mon Sep 17 00:00:00 2001 From: amarantha-k Date: Tue, 5 Nov 2024 13:57:12 -0800 Subject: [PATCH 4/4] Remove obsolete files --- .../clio-methods/version.md | 111 ---------------- .../server-info-methods/version.md | 124 ------------------ 2 files changed, 235 deletions(-) delete mode 100644 @i18n/ja/docs/references/http-websocket-apis/public-api-methods/clio-methods/version.md delete mode 100644 @i18n/ja/docs/references/http-websocket-apis/public-api-methods/server-info-methods/version.md diff --git a/@i18n/ja/docs/references/http-websocket-apis/public-api-methods/clio-methods/version.md b/@i18n/ja/docs/references/http-websocket-apis/public-api-methods/clio-methods/version.md deleted file mode 100644 index 79e12a6a6d..0000000000 --- a/@i18n/ja/docs/references/http-websocket-apis/public-api-methods/clio-methods/version.md +++ /dev/null @@ -1,111 +0,0 @@ ---- -seo: - description: APIバージョン情報を取得します。 -labels: - - コアサーバ ---- -# version -[[ソース]](https://github.com/XRPLF/clio/blob/develop/src/rpc/handlers/VersionHandler.hpp "ソース") - -`version`コマンドは、[Clioサーバ](../../../../concepts/networks-and-servers/the-clio-server.md)のAPIバージョン情報を取得します。`rippled`サーバーの場合は、代わりに[`version` (`rippled`)](../server-info-methods/version.md)をご覧ください。{% badge href="https://github.com/XRPLF/clio/releases/tag/1.0.0" %}新規: Clio v2.0.0{% /badge %} - - -## リクエストのフォーマット -リクエストフォーマットの例: - -{% tabs %} - -{% tab label="WebSocket" %} -```json -{ - "command": "version" -} -``` -{% /tab %} - -{% tab label="JSON-RPC" %} -```json -{ - "method": "version", - "params": [ - {} - ] -} -``` -{% /tab %} - -{% /tabs %} - - - -リクエストはパラメーターを必要としません。 - -## レスポンスのフォーマット - -成功したレスポンスの例: - -{% tabs %} - -{% tab label="WebSocket" %} -```json -{ - "result": { - "version": { - "first": 1, - "last": 2, - "good": 1 - } - }, - "status": "success", - "type": "response", - "warnings": [ - { - "id": 2001, - "message": "This is a clio server. clio only serves validated data. If you want to talk to rippled, include 'ledger_index':'current' in your request" - } - ] -} -``` -{% /tab %} - -{% tab label="JSON-RPC" %} -```json -200 OK - -{ - "result": { - "version": { - "first": 1, - "last": 2, - "good": 1 - } - }, - "status": "success", - "type": "response", - "warnings": [ - { - "id":2001, - "message":"This is a clio server. clio only serves validated data. If you want to talk to rippled, include 'ledger_index':'current' in your request" - } - ] -} -``` -{% /tab %} - -{% /tabs %} - -レスポンスは[標準フォーマット][]に従い、成功した結果は`info`オブジェクトのみを含むものとなります。 - -`version`オブジェクトは、次のフィールドのいずれかを返します。 - -| フィールド | 型 | 説明 | -|:-----------|:-------|:------------------------------| -| `first` | 文字列 | サポートされる最低のAPIリリース | -| `last` | 文字列 | サポートされる最高のAPIリリース | -| `good` | 文字列 | 指定されていない場合のデフォルトのAPI | - -## 考えられるエラー - -* [汎用エラータイプ][]のいずれか。 - -{% raw-partial file="/docs/_snippets/common-links.md" /%} diff --git a/@i18n/ja/docs/references/http-websocket-apis/public-api-methods/server-info-methods/version.md b/@i18n/ja/docs/references/http-websocket-apis/public-api-methods/server-info-methods/version.md deleted file mode 100644 index 76b5741109..0000000000 --- a/@i18n/ja/docs/references/http-websocket-apis/public-api-methods/server-info-methods/version.md +++ /dev/null @@ -1,124 +0,0 @@ ---- -seo: - description: APIバージョン情報を取得します。 -labels: - - コアサーバ ---- -# version - -[[ソース]](https://github.com/XRPLF/rippled/blob/develop/src/ripple/beast/core/SemanticVersion.cpp "ソース") - -`version`コマンドは、rippledサーバーのAPIバージョン情報を取得します。`Clio`サーバーの場合は、代わりに[`version` (`clio`)](../clio-methods/version.md)をご覧ください。 - - -## リクエストのフォーマット -リクエストフォーマットの例: - -{% tabs %} - -{% tab label="WebSocket" %} -```json -{ - "command": "version" -} -``` -{% /tab %} - -{% tab label="JSON-RPC" %} -```json -{ - "method": "version", - "params": [ - {} - ] -} -``` -{% /tab %} - -{% tab label="コマンドライン" %} -```sh -#Syntax: version -rippled version -``` -{% /tab %} - -{% /tabs %} - -[試してみる >](/resources/dev-tools/websocket-api-tool#version) - -リクエストはパラメーターを必要としません。 - - -## レスポンスのフォーマット - -成功したレスポンスの例: - -{% tabs %} - -{% tab label="WebSocket" %} -```json -{ - "result": { - "version": { - "first": "1.0.0", - "good": "1.0.0", - "last": "1.0.0" - } - }, - "status": "success", - "type": "response" -} -``` -{% /tab %} - -{% tab label="JSON-RPC" %} -```json -200 OK - -{ - "result": { - "version": { - "first": "1.0.0", - "good": "1.0.0", - "last": "1.0.0" - } - }, - "status": "success", - "type": "response" -} -``` -{% /tab %} - -{% tab label="コマンドライン" %} -```json -{ - "result": { - "version": { - "first": "1.0.0", - "good": "1.0.0", - "last": "1.0.0" - } - }, - "status": "success", - "type": "response" -} -``` -{% /tab %} - -{% /tabs %} - -レスポンスは[標準フォーマット][]に従い、成功した結果は`version`オブジェクトのみを含むものとなります。 - -`version`オブジェクトは、次のフィールドのいずれかを返します。 - -| フィールド | 型 | 説明 | -|:-----------|:-------|:------------------------------| -| `first` | 文字列 | サポートされる最低のAPIリリース | -| `last` | 文字列 | サポートされる最高のAPIリリース | -| `good` | 文字列 | 指定されていない場合のデフォルトのAPI | - -### 考えられるエラー - -* [汎用エラータイプ][]のいずれか。 - -{% raw-partial file="/docs/_snippets/common-links.md" /%}