Merge branch 'master' into issue-2486

This commit is contained in:
Amarantha Kulkarni
2024-03-22 21:20:18 -07:00
committed by GitHub
17 changed files with 302 additions and 1778 deletions

View File

@@ -44,8 +44,7 @@ labels:
{% /tabs %}
<!-- To DO: Add an example command to the assets/js/apitool-methods-ws.js file. The WebSocket Tool requires access to a publicly available Clio server.
[試してみる >](websocket-api-tool.html#nft_history)-->
[試してみる >](/resources/dev-tools/websocket-api-tool#nft_history)
リクエストには以下のパラメーターが含まれます。

View File

@@ -41,8 +41,7 @@ labels:
{% /tabs %}
<!-- To DO: Add an example command to the assets/js/apitool-methods-ws.js file. The WebSocket Tool requires access to a publicly available Clio server.
[試してみる >](websocket-api-tool.html#nft_info)-->
[試してみる >](/resources/dev-tools/websocket-api-tool#nft_info)
リクエストには以下のパラメーターが含まれます。
@@ -128,17 +127,17 @@ labels:
レスポンスは[標準フォーマット][] に従い、成功すると以下のフィールドをいくつか並べた`nft_info`レスポンスオブジェクトが返されます。
| `Field` | 型 | 説明 |
|:----------------------------------|:-------------------|:---------------------|
|:----------------------------------|:------|:---------------------|
| `nft_id` | 文字列 | 非代替性トークン(NFT)の一意の識別子。 |
| `ledger_index` | 整数 | NFT がミント(作成)された、所有者が変わった(取引された)、バーンされた(破棄された)など、このNFTの状態が変更された最新のレジャーバージョンの[レジャーインデックス][]。返される情報には、リクエストされたレジャーと比較して直近に起こったことが含まれます。 |
| `owner` | 文字列 | このレジャーインデックスにおけるこのNFTの所有者のアカウントID。 |
| `is_burned` | 真偽値 | NFTがこのレジャーでバーンされていれば`true`を、そうでなければ`false`を返します。 |
| `flags ` | 整数 | このNFTのフラグ |
| `transfer_fee` | 整数 | このNFTの送金手数料。送金手数料の詳細については、[NFTokenMintのフィールド](../../../protocol/transactions/types/nftokenmint.md#nftokenmint-フィールド)をご覧ください。 |
| `issuer` | 文字列 | このNFTの発行者を示すアカウントID。|
| `issuer` | 文字列 | このNFTの発行者を示すアカウントID。|
| `nft_taxon` | 整数 | このNFTのTaxon。 |
| `nft_sequence` | 整数 | このNFTのシーケンス番号. |
| `uri` | 文字列 または `null` | _(NFTがこのレジャーでバーンされている場合は省略)_ NFTがこのレジャーでバーンされておらず、URIを持っていない場合、このフィールドは`null`です。NFTがこのレジャーでバーンされておらず、URIを持ってい場合、このフィールドはNFTのデコードされたURIを含む文字列です。注意: バーンされたトークンのURIを取得する必要がある場合、トークンの`nft_info`をリクエストし直してください。その際、`ledger_index`にはトークンがバーンされたインデックスの一つ前({_トークンがバーンされたレジャーインデックス_} - 1を指定してください。 |
| `uri` | 文字列 | このNFTのURI。NFTがURIを持っていない場合、空の文字列を返します。 {% badge href="https://github.com/XRPLF/clio/releases/tag/2.0.0" %}更新: Clio v2.0.0{% /badge %} |
## 考えられるエラー

View File

@@ -100,7 +100,9 @@ export function Badge(props: {
"廃止": "red", // ja: obsolete
"撤回": "red", // ja: withdrawn/removed/vetoed
"new in": "blue",
"新規": "blue", // ja: new in"
"新規": "blue", // ja: new in
"updated in": "blue",
"更新": "blue", // ja: updated in
"in development": "lightgrey",
"開発中": "lightgrey", // ja: in development
}

View File

@@ -7,8 +7,6 @@ top_nav_grouping: Article Types
---
# Introduction
![Howdy!](/docs/img/introduction1-howdy.png)
The XRP Ledger is a blockchain that permanently records digital transactions of tokens between accounts. The sections below expand on the concepts introduced in that sentence.
{% child-pages /%}

View File

@@ -44,8 +44,7 @@ An example of the request format:
{% /tabs %}
<!-- To DO: Add an example command to the assets/js/apitool-methods-ws.js file. The WebSocket Tool requires access to a publicly available Clio server.
[Try it! >](websocket-api-tool.html#nft_history)-->
[Try it! >](/resources/dev-tools/websocket-api-tool#nft_history)
The request contains the following parameters:

View File

@@ -41,8 +41,7 @@ An example of the request format:
{% /tabs %}
<!-- To DO: Add an example command to the assets/js/apitool-methods-ws.js file. The WebSocket Tool requires access to a publicly available Clio server.
[Try it! >](websocket-api-tool.html#nft_info)-->
[Try it! >](/resources/dev-tools/websocket-api-tool#nft_info)
The request contains the following parameters:
@@ -138,7 +137,7 @@ The response follows the [standard format][], with a successful result containin
| `issuer` | String | The account ID which denotes the issuer of this NFT. |
| `nft_taxon` | Integer | The NFTs taxon. |
| `nft_serial` | Integer | The NFTs sequence number. |
| `uri` | String | _(Omitted if the NFT is burned at this ledger.)_. This field is an empty string if the NFT is not burned at this ledger but does not have a URI. If the NFT is not burned at this ledger and it does have a URI, this field is a string containing the URI of the NFT. NOTE: If you need to retrieve the URI of a burnt token, re-request `nft_info` for this token, specifying the `ledger_index` as the one previous to the index where this token was burned ({_ledger-index-where-token-was-burned_} - 1). |
| `uri` | String | The NFT's URI, or an empty string if the NFT does not have a URI. {% badge href="https://github.com/XRPLF/clio/releases/tag/2.0.0" %}Updated in: Clio v2.0.0{% /badge %} |
## Possible Errors

View File

@@ -22,8 +22,7 @@ An example of the request format:
}
```
<!-- To DO: Add an example command to the assets/js/apitool-methods-ws.js file. The WebSocket Tool requires access to a publicly available Clio server.
[Try it! >](websocket-api-tool.html#nft_history)-->
[Try it! >](/resources/dev-tools/websocket-api-tool#nfts_by_issuer)
The request contains the following parameters:

View File

@@ -58,7 +58,7 @@ An example of the request format:
{% /tabs %}
[Try it! >](/resources/dev-tools/websocket-api-tool?server=wss%3A%2F%2Famm.devnet.rippletest.net%3A51233%2F#amm_info)
[Try it! >](/resources/dev-tools/websocket-api-tool?server=wss%3A%2F%2Fs.altnet.rippletest.net%3A51233%2F#amm_info)
The request includes the following parameters:

View File

@@ -4,8 +4,8 @@
"methods": [
{
"name": "account_channels",
"description": "Returns information about an account's <a href='payment-channels.html'>payment channels</a>.",
"link": "account_channels.html",
"description": "Returns information about an account's <a href='/docs/concepts/payment-types/payment-channels/'>payment channels</a>.",
"link": "/docs/references/http-websocket-apis/public-api-methods/account-methods/account_channels",
"body": {
"id": 1,
"command": "account_channels",
@@ -17,7 +17,7 @@
{
"name": "account_currencies",
"description": "Retrieves a list of currencies that an account can send or receive, based on its trust lines.",
"link": "account_currencies.html",
"link": "/docs/references/http-websocket-apis/public-api-methods/account-methods/account_currencies",
"body": {
"command": "account_currencies",
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
@@ -27,7 +27,7 @@
{
"name": "account_info",
"description": "Retrieves information about an account, its activity, and its XRP balance.",
"link": "account_info.html",
"link": "/docs/references/http-websocket-apis/public-api-methods/account-methods/account_info",
"body": {
"id": 2,
"command": "account_info",
@@ -39,7 +39,7 @@
{
"name": "account_lines",
"description": "Retrieves information about an account's trust lines, including balances for all non-XRP currencies and assets.",
"link": "account_lines.html",
"link": "/docs/references/http-websocket-apis/public-api-methods/account-methods/account_lines",
"body": {
"id": 2,
"command": "account_lines",
@@ -50,7 +50,7 @@
{
"name": "account_nfts",
"description": "Retrieves NFTs owned by an account.",
"link": "account_nfts.html",
"link": "/docs/references/http-websocket-apis/public-api-methods/account-methods/account_nfts",
"body": {
"command": "account_nfts",
"account": "rsuHaTvJh1bDmDoxX9QcKP7HEBSBt4XsHx",
@@ -60,7 +60,7 @@
{
"name": "account_objects",
"description": "Returns the raw ledger format for all objects owned by an account.",
"link": "account_objects.html",
"link": "/docs/references/http-websocket-apis/public-api-methods/account-methods/account_objects",
"body": {
"id": 1,
"command": "account_objects",
@@ -73,7 +73,7 @@
{
"name": "account_offers",
"description": "Retrieves a list of offers made by a given account that are outstanding as of a particular ledger version.",
"link": "account_offers.html",
"link": "/docs/references/http-websocket-apis/public-api-methods/account-methods/account_offers",
"body": {
"id": 2,
"command": "account_offers",
@@ -83,7 +83,7 @@
{
"name": "account_tx",
"description": "Retrieves a list of transactions that affected the specified account.",
"link": "account_tx.html",
"link": "/docs/references/http-websocket-apis/public-api-methods/account-methods/account_tx",
"body": {
"id": 2,
"command": "account_tx",
@@ -98,7 +98,7 @@
{
"name": "gateway_balances",
"description": "Calculates the total balances issued by a given account, optionally excluding amounts held by operational addresses.",
"link": "gateway_balances.html",
"link": "/docs/references/http-websocket-apis/public-api-methods/account-methods/gateway_balances",
"body": {
"id": "example_gateway_balances_1",
"command": "gateway_balances",
@@ -113,7 +113,7 @@
{
"name": "noripple_check",
"description": "Compares an account's Default Ripple and No Ripple flags to the recommended settings.",
"link": "noripple_check.html",
"link": "/docs/references/http-websocket-apis/public-api-methods/account-methods/noripple_check",
"body": {
"id": 0,
"command": "noripple_check",
@@ -132,7 +132,7 @@
{
"name": "ledger",
"description": "Retrieves information about the public ledger.",
"link": "ledger.html",
"link": "/docs/references/http-websocket-apis/public-api-methods/ledger-methods/ledger",
"body": {
"id": 14,
"command": "ledger",
@@ -147,7 +147,7 @@
{
"name": "ledger_closed",
"description": "Returns the unique identifiers of the most recently closed ledger. (This ledger is not necessarily validated and immutable yet.)",
"link": "ledger_closed.html",
"link": "/docs/references/http-websocket-apis/public-api-methods/ledger-methods/ledger_closed",
"body": {
"id": 2,
"command": "ledger_closed"
@@ -156,7 +156,7 @@
{
"name": "ledger_current",
"description": "Returns the unique identifiers of the current in-progress ledger.",
"link": "ledger_closed.html",
"link": "/docs/references/http-websocket-apis/public-api-methods/ledger-methods/ledger_current",
"body": {
"id": 2,
"command": "ledger_current"
@@ -165,7 +165,7 @@
{
"name": "ledger_data",
"description": "Retrieves contents of the specified ledger.",
"link": "ledger_data.html",
"link": "/docs/references/http-websocket-apis/public-api-methods/ledger-methods/ledger_data",
"body": {
"id": 2,
"ledger_hash": "842B57C1CC0613299A686D3E9F310EC0422C84D3911E5056389AA7E5808A93C8",
@@ -173,166 +173,6 @@
"limit": 5,
"binary": true
}
},
{
"name": "ledger_entry - by object ID",
"description": "Returns an object by its unique ID.",
"link": "ledger_entry.html#get-ledger-object-by-id",
"body": {
"command": "ledger_entry",
"index": "7DB0788C020F02780A673DC74757F23823FA3014C1866E72CC4CD8B226CD6EF4",
"ledger_index": "validated"
}
},
{
"name": "ledger_entry - AccountRoot",
"description": "Returns a single account in its raw ledger format.",
"link": "ledger_entry.html#get-accountroot-object",
"body": {
"id": "example_get_accountroot",
"command": "ledger_entry",
"account_root": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"ledger_index": "validated"
}
},
{
"name": "ledger_entry - AMM",
"description": "Returns a single Automated Market Maker object in its raw ledger format.",
"link": "ledger_entry.html#get-amm-object",
"body": {
"id": "example_get_amm",
"command": "ledger_entry",
"amm": {
"asset": {
"currency": "XRP"
},
"asset2": {
"currency": "TST",
"issuer": "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
}
},
"ledger_index": "validated"
}
},
{
"name": "ledger_entry - DirectoryNode",
"description": "Returns a directory object in its raw ledger format.",
"link": "ledger_entry.html#get-directorynode-object",
"body": {
"id": "example_get_directorynode",
"command": "ledger_entry",
"directory": {
"owner": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"sub_index": 0
},
"ledger_index": "validated"
}
},
{
"name": "ledger_entry - NFT Page",
"description": "Returns an NFT Page object in its raw ledger format.",
"link": "ledger_entry.html#get-nft-page",
"body": {
"id": "example_get_nft_page",
"command": "ledger_entry",
"nft_page": "255DD86DDF59D778081A06D02701E9B2C9F4F01DFFFFFFFFFFFFFFFFFFFFFFFF",
"ledger_index": "validated"
}
},
{
"name": "ledger_entry - Offer",
"description": "Returns an Offer object in its raw ledger format.",
"link": "ledger_entry.html#get-offer-object",
"body": {
"id": "example_get_offer",
"command": "ledger_entry",
"offer": {
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"seq": 359
},
"ledger_index": "validated"
}
},
{
"name": "ledger_entry - RippleState",
"description": "Returns a RippleState object in its raw ledger format.",
"link": "ledger_entry.html#get-ripplestate-object",
"body": {
"id": "example_get_ripplestate",
"command": "ledger_entry",
"ripple_state": {
"accounts": [
"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW"
],
"currency": "USD"
},
"ledger_index": "validated"
}
},
{
"name": "ledger_entry - Check",
"description": "Returns a Check object in its raw ledger format.",
"link": "ledger_entry.html#get-check-object",
"body": {
"id": "example_get_check",
"command": "ledger_entry",
"check": "C4A46CCD8F096E994C4B0DEAB6CE98E722FC17D7944C28B95127C2659C47CBEB",
"ledger_index": "validated"
}
},
{
"name": "ledger_entry - Escrow",
"description": "Returns an Escrow object in its raw ledger format.",
"link": "ledger_entry.html#get-escrow-object",
"body": {
"id": "example_get_escrow",
"command": "ledger_entry",
"escrow": {
"owner": "rL4fPHi2FWGwRGRQSH7gBcxkuo2b9NTjKK",
"seq": 126
},
"ledger_index": "validated"
}
},
{
"name": "ledger_entry - PayChannel",
"description": "Returns a PayChannel object in its raw ledger format.",
"link": "ledger_entry.html#get-paychannel-object",
"body": {
"id": "example_get_paychannel",
"command": "ledger_entry",
"payment_channel": "C7F634794B79DB40E87179A9D1BF05D05797AE7E92DF8E93FD6656E8C4BE3AE7",
"ledger_index": "validated"
}
},
{
"name": "ledger_entry - DepositPreauth",
"description": "Returns a DepositPreauth object in its raw ledger format.",
"link": "ledger_entry.html#get-depositpreauth-object",
"body": {
"id": "example_get_deposit_preauth",
"command": "ledger_entry",
"deposit_preauth": {
"owner": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"authorized": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX"
},
"ledger_index": "validated"
}
},
{
"name": "ledger_entry - Ticket",
"description": "Returns a Ticket object in its raw ledger format.",
"link": "ledger_entry.html#get-ticket-object",
"body": {
"id": "example_get_ticket",
"command": "ledger_entry",
"ticket": {
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"ticket_seq": 389
},
"ledger_index": "validated"
}
}
]
},
@@ -342,7 +182,7 @@
{
"name": "submit",
"description": "Submits a transaction to the network to be confirmed and included in future ledgers.",
"link": "submit.html",
"link": "/docs/references/http-websocket-apis/public-api-methods/transaction-methods/submit",
"body": {
"id": "example_submit",
"command": "submit",
@@ -352,7 +192,7 @@
{
"name": "submit_multisigned",
"description": "Submits a multi-signed transaction to the network to be confirmed and included in future ledgers.",
"link": "submit_multisigned.html",
"link": "/docs/references/http-websocket-apis/public-api-methods/transaction-methods/submit_multisigned",
"body": {
"id": "submit_multisigned_example",
"command": "submit_multisigned",
@@ -391,7 +231,7 @@
{
"name": "transaction_entry",
"description": "Retrieves information on a single transaction from a specific ledger version.",
"link": "transaction_entry.html",
"link": "/docs/references/http-websocket-apis/public-api-methods/transaction-methods/transaction_entry",
"body": {
"id": 4,
"command": "transaction_entry",
@@ -402,7 +242,7 @@
{
"name": "tx",
"description": "Retrieves information on a single transaction.",
"link": "tx.html",
"link": "/docs/references/http-websocket-apis/public-api-methods/transaction-methods/tx",
"body": {
"id": 1,
"command": "tx",
@@ -413,12 +253,28 @@
]
},
{
"group": "Path and Order Book Methods",
"group": "Path and DEX Methods",
"methods": [
{
"name": "amm_info",
"description": "Looks up info on an Automated Market Maker instance.",
"link": "/docs/references/http-websocket-apis/public-api-methods/path-and-order-book-methods/amm_info",
"status": "not_enabled",
"body": {
"command": "amm_info",
"asset": {
"currency": "XRP"
},
"asset2": {
"currency": "TST",
"issuer": "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
}
}
},
{
"name": "book_offers",
"description": "Retrieves a list of offers, also known as the order book, between two currencies.",
"link": "book_offers.html",
"link": "/docs/references/http-websocket-apis/public-api-methods/path-and-order-book-methods/book_offers/",
"body": {
"id": 4,
"command": "book_offers",
@@ -436,7 +292,7 @@
{
"name": "deposit_authorized",
"description": "Checks whether one account is authorized to send payments directly to another.",
"link": "deposit_authorized.html",
"link": "/docs/references/http-websocket-apis/public-api-methods/path-and-order-book-methods/deposit_authorized",
"body": {
"id": 1,
"command": "deposit_authorized",
@@ -448,7 +304,7 @@
{
"name": "nft_buy_offers",
"description": "Retrieves offers to buy a given NFT.",
"link": "nft_buy_offers.html",
"link": "/docs/references/http-websocket-apis/public-api-methods/path-and-order-book-methods/nft_buy_offers",
"body": {
"command": "nft_buy_offers",
"nft_id": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007",
@@ -458,7 +314,7 @@
{
"name": "nft_sell_offers",
"description": "Retrieves offers to sell a given NFT.",
"link": "nft_sell_offers.html",
"link": "/docs/references/http-websocket-apis/public-api-methods/path-and-order-book-methods/nft_sell_offers",
"body": {
"command": "nft_sell_offers",
"nft_id": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007",
@@ -468,7 +324,7 @@
{
"name": "path_find",
"description": "Searches for a path along which a payment can possibly be made, and periodically sends updates when the path changes over time.",
"link": "path_find.html",
"link": "/docs/references/http-websocket-apis/public-api-methods/path-and-order-book-methods/path_find",
"ws_only": true,
"body": {
"id": 8,
@@ -486,7 +342,7 @@
{
"name": "ripple_path_find",
"description": "Searches one time for a payment path.",
"link": "ripple_path_find.html",
"link": "/docs/references/http-websocket-apis/public-api-methods/path-and-order-book-methods/ripple_path_find",
"body": {
"id": 8,
"command": "ripple_path_find",
@@ -506,20 +362,44 @@
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
}
}
}
]
},
{
"name": "amm_info",
"description": "Looks up info on an Automated Market Maker instance.",
"link": "amm_info.html",
"group": "NFT Methods",
"methods": [
{
"name": "nft_history",
"description": "Get past transaction metadata for an NFT (Clio only).",
"link": "/docs/references/http-websocket-apis/public-api-methods/clio-methods/nft_history",
"clio_only": true,
"body": {
"command": "amm_info",
"asset": {
"currency": "XRP"
},
"asset2": {
"currency": "TST",
"issuer": "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
"id": "example_nft_history",
"command": "nft_history",
"nft_id": "000827106807BF848FACD972F2F617E27003D75B2CAAC9816CEE14840521D1E9"
}
},
{
"name": "nft_info",
"description": "Get info about an NFT (Clio only).",
"clio_only": true,
"link": "/docs/references/http-websocket-apis/public-api-methods/clio-methods/nft_info",
"body": {
"id": "example_nft_info",
"command": "nft_info",
"nft_id": "000827106807BF848FACD972F2F617E27003D75B2CAAC9816CEE14840521D1E9"
}
},
{
"name": "nfts_by_issuer",
"description": "Get a list of NFTs issued by a specific account, optionally filtered by taxon (Clio only).",
"clio_only": true,
"link": "/docs/references/http-websocket-apis/public-api-methods/clio-methods/nfts_by_issuer",
"body": {
"id": "example_nfts_by_issuer",
"command": "nfts_by_issuer",
"issuer": "rwVhZJLcdtioxdETLq31Ne2K97xm4zA8Jv",
"nft_taxon": 0
}
}
]
@@ -530,7 +410,7 @@
{
"name": "channel_authorize",
"description": "Creates a signature that can be used to redeem a specific amount of XRP from a payment channel.",
"link": "channel_authorize.html",
"link": "/docs/references/http-websocket-apis/public-api-methods/payment-channel-methods/channel_authorize",
"body": {
"id": "channel_authorize_example_id1",
"command": "channel_authorize",
@@ -542,7 +422,7 @@
{
"name": "channel_verify",
"description": "Checks the validity of a signature that can be used to redeem a specific amount of XRP from a payment channel.",
"link": "channel_verify.html",
"link": "/docs/references/http-websocket-apis/public-api-methods/payment-channel-methods/channel_verify",
"body": {
"id": 1,
"command": "channel_verify",
@@ -560,7 +440,7 @@
{
"name": "subscribe",
"description": "Requests periodic notifications from the server when certain events happen.",
"link": "subscribe.html",
"link": "/docs/references/http-websocket-apis/public-api-methods/subscription-methods/subscribe",
"body": {
"id": "Example watch one account and all new ledgers",
"command": "subscribe",
@@ -575,7 +455,7 @@
{
"name": "unsubscribe",
"description": "Tells the server to stop sending messages for a particular subscription or set of subscriptions.",
"link": "unsubscribe.html",
"link": "/docs/references/http-websocket-apis/public-api-methods/subscription-methods/unsubscribe",
"body": {
"id": "Example stop watching one account and new ledgers",
"command": "unsubscribe",
@@ -595,16 +475,25 @@
{
"name": "fee",
"description": "Reports the current state of the open-ledger requirements for the transaction cost.",
"link": "fee.html",
"link": "/docs/references/http-websocket-apis/public-api-methods/server-info-methods/fee",
"body": {
"id": "fee_websocket_example",
"command": "fee"
}
},
{
"name": "server_definitions",
"description": "Returns an SDK-compatible definitions.json, generated from the rippled server being queried.",
"link": "/docs/references/http-websocket-apis/public-api-methods/server-info-methods/server_definitions",
"body": {
"id": 1,
"command": "server_definitions"
}
},
{
"name": "server_info",
"description": "Reports a human-readable version of various information about the rippled server being queried.",
"link": "server_info.html",
"link": "/docs/references/http-websocket-apis/public-api-methods/server-info-methods/server_info",
"body": {
"id": 1,
"command": "server_info"
@@ -613,7 +502,7 @@
{
"name": "server_state",
"description": "Reports a machine-readable version of various information about the rippled server being queried.",
"link": "server_state.html",
"link": "/docs/references/http-websocket-apis/public-api-methods/server-info-methods/server_state",
"body": {
"id": 1,
"command": "server_state"
@@ -627,7 +516,7 @@
{
"name": "ping",
"description": "Checks that the connection is working.",
"link": "ping.html",
"link": "/docs/references/http-websocket-apis/public-api-methods/utility-methods/ping",
"body": {
"id": 1,
"command": "ping"
@@ -636,12 +525,178 @@
{
"name": "random",
"description": "Provides a random number, which may be a useful source of entropy for clients.",
"link": "random.html",
"link": "/docs/references/http-websocket-apis/public-api-methods/utility-methods/random",
"body": {
"id": 1,
"command": "random"
}
}
]
},
{
"group": "Ledger Entry Examples",
"methods": [
{
"name": "ledger_entry - by object ID",
"description": "Returns an object by its unique ID.",
"link": "/docs/references/http-websocket-apis/public-api-methods/ledger-methods/ledger_entry#get-ledger-object-by-id",
"body": {
"command": "ledger_entry",
"index": "7DB0788C020F02780A673DC74757F23823FA3014C1866E72CC4CD8B226CD6EF4",
"ledger_index": "validated"
}
},
{
"name": "ledger_entry - AccountRoot",
"description": "Returns a single account in its raw ledger format.",
"link": "/docs/references/http-websocket-apis/public-api-methods/ledger-methods/ledger_entry#get-accountroot-object",
"body": {
"id": "example_get_accountroot",
"command": "ledger_entry",
"account_root": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"ledger_index": "validated"
}
},
{
"name": "ledger_entry - AMM",
"description": "Returns a single Automated Market Maker object in its raw ledger format.",
"link": "/docs/references/http-websocket-apis/public-api-methods/ledger-methods/ledger_entry#get-amm-object",
"status": "not_enabled",
"body": {
"id": "example_get_amm",
"command": "ledger_entry",
"amm": {
"asset": {
"currency": "XRP"
},
"asset2": {
"currency": "TST",
"issuer": "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
}
},
"ledger_index": "validated"
}
},
{
"name": "ledger_entry - DirectoryNode",
"description": "Returns a directory object in its raw ledger format.",
"link": "/docs/references/http-websocket-apis/public-api-methods/ledger-methods/ledger_entry#get-directorynode-object",
"body": {
"id": "example_get_directorynode",
"command": "ledger_entry",
"directory": {
"owner": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"sub_index": 0
},
"ledger_index": "validated"
}
},
{
"name": "ledger_entry - NFT Page",
"description": "Returns an NFT Page object in its raw ledger format.",
"link": "/docs/references/http-websocket-apis/public-api-methods/ledger-methods/ledger_entry#get-nft-page",
"body": {
"id": "example_get_nft_page",
"command": "ledger_entry",
"nft_page": "255DD86DDF59D778081A06D02701E9B2C9F4F01DFFFFFFFFFFFFFFFFFFFFFFFF",
"ledger_index": "validated"
}
},
{
"name": "ledger_entry - Offer",
"description": "Returns an Offer object in its raw ledger format.",
"link": "/docs/references/http-websocket-apis/public-api-methods/ledger-methods/ledger_entry#get-offer-object",
"body": {
"id": "example_get_offer",
"command": "ledger_entry",
"offer": {
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"seq": 359
},
"ledger_index": "validated"
}
},
{
"name": "ledger_entry - RippleState",
"description": "Returns a RippleState object in its raw ledger format.",
"link": "/docs/references/http-websocket-apis/public-api-methods/ledger-methods/ledger_entry#get-ripplestate-object",
"body": {
"id": "example_get_ripplestate",
"command": "ledger_entry",
"ripple_state": {
"accounts": [
"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW"
],
"currency": "USD"
},
"ledger_index": "validated"
}
},
{
"name": "ledger_entry - Check",
"description": "Returns a Check object in its raw ledger format.",
"link": "/docs/references/http-websocket-apis/public-api-methods/ledger-methods/ledger_entry#get-check-object",
"body": {
"id": "example_get_check",
"command": "ledger_entry",
"check": "C4A46CCD8F096E994C4B0DEAB6CE98E722FC17D7944C28B95127C2659C47CBEB",
"ledger_index": "validated"
}
},
{
"name": "ledger_entry - Escrow",
"description": "Returns an Escrow object in its raw ledger format.",
"link": "/docs/references/http-websocket-apis/public-api-methods/ledger-methods/ledger_entry#get-escrow-object",
"body": {
"id": "example_get_escrow",
"command": "ledger_entry",
"escrow": {
"owner": "rL4fPHi2FWGwRGRQSH7gBcxkuo2b9NTjKK",
"seq": 126
},
"ledger_index": "validated"
}
},
{
"name": "ledger_entry - PayChannel",
"description": "Returns a PayChannel object in its raw ledger format.",
"link": "/docs/references/http-websocket-apis/public-api-methods/ledger-methods/ledger_entry#get-paychannel-object",
"body": {
"id": "example_get_paychannel",
"command": "ledger_entry",
"payment_channel": "C7F634794B79DB40E87179A9D1BF05D05797AE7E92DF8E93FD6656E8C4BE3AE7",
"ledger_index": "validated"
}
},
{
"name": "ledger_entry - DepositPreauth",
"description": "Returns a DepositPreauth object in its raw ledger format.",
"link": "/docs/references/http-websocket-apis/public-api-methods/ledger-methods/ledger_entry#get-depositpreauth-object",
"body": {
"id": "example_get_deposit_preauth",
"command": "ledger_entry",
"deposit_preauth": {
"owner": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"authorized": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX"
},
"ledger_index": "validated"
}
},
{
"name": "ledger_entry - Ticket",
"description": "Returns a Ticket object in its raw ledger format.",
"link": "/docs/references/http-websocket-apis/public-api-methods/ledger-methods/ledger_entry#get-ticket-object",
"body": {
"id": "example_get_ticket",
"command": "ledger_entry",
"ticket": {
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"ticket_seq": 389
},
"ledger_index": "validated"
}
}
]
}
]

View File

@@ -43,6 +43,14 @@ export const RightSideBar: React.FC<RightSideBarProps> = ({
<i className="fa fa-flask"></i>
</span>
)}
{method.clio_only && (
<span
className="status clio_only"
title="This method is only available from the Clio server."
>
<i className=" fa fa-exclamation-circle"></i>
</span>
)}
</Link>
</li>
))}

View File

@@ -4,7 +4,8 @@ export interface CommandMethod {
link: string
body: any
ws_only?: boolean,
status?: 'not_enabled'
status?: 'not_enabled',
clio_only?: boolean
}
export interface CommandGroup {

File diff suppressed because one or more lines are too long

View File

@@ -1,583 +0,0 @@
//---------- List of requests ------------------------//
// Must be loaded after apitool-rest.js //
//var DOC_BASE = "reference-data-api.html";
//var URL_BASE = "https://data-staging.ripple.com";
var DEFAULT_ADDRESS_1 = "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn";
var KRW_TRADER_ADDRESS = "rsyDrDi9Emy6vPU78qdxovmNpmj5Qh4NKw";
var JPY_TRADER_ADDRESS = "rK5j9n8baXfL4gzUoZsfxBvvsv97P5swaV";
var DEFAULT_HASH = "9D591B18EDDD34F0B6CF4223A2940AEA2C3CC778925BABF289E0011CD8FA056E";
var DEFAULT_LEDGER = "3170DA37CE2B7F045F889594CBC323D88686D2E90E8FFD2BBCD9BAD12E416DB5";
var VALIDATOR_PUBKEY = "nHUon2tpyJEHHYGmxqeGu37cvPYHzrMtUNQFVdCgGNvEkjmCpTqK";
var LEDGER_WITH_VALIDATIONS = "A10E9E338BA365D2B768814EC8B0A9A2D8322C0040735E20624AF711C5A593E7";
// general methods -----------------------------------//
Request("LEDGER CONTENTS");
Request('Get Ledger', {
method: GET,
path: "/v2/ledgers/{:ledger_identifier}?{:query_params}",
description: "Get a ledger by its sequence number or identifying hash.",
link: "#get-ledger",
params: {
"{:ledger_identifier}": DEFAULT_LEDGER,
"{:query_params}": "transactions=true&binary=false&expand=true"
}
});
Request('Get Transaction', {
method: GET,
path: "/v2/transactions/{:hash}?{:query_params}",
description: "Get a transaction by its identifying hash.",
link: "#get-transaction",
params: {
"{:hash}": DEFAULT_HASH,
"{:query_params}": "binary=false"
}
});
Request('Get Transactions', {
method: GET,
path: "/v2/transactions/?{:query_params}",
description: "Search through all transactions",
link: "#get-transactions",
params: {
"{:query_params}": "descending=true&limit=3&result=tesSUCCESS&type=OfferCreate"
}
});
Request('Get Payments', {
method: GET,
path: "/v2/payments/{:currency}?{:query_params}",
description: "Get Payments over time, where Payments are defined as Payment-type transactions where the sender of the transaction is not also the destination. ",
link: "#get-payments",
params: {
"{:currency}": "BTC+rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
"{:query_params}": "limit=2"
}
});
Request('Get Exchanges', {
method: GET,
path: "/v2/exchanges/{:base}/{:counter}?{:query_params}",
description: "Get exchanges for a currency pair over time.",
link: "#get-exchanges",
params: {
"{:base}": "USD+rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
"{:counter}": "XRP",
"{:query_params}": "descending=true&limit=3&result=tesSUCCESS&type=OfferCreate"
}
});
Request('Get Exchange Rates', {
method: GET,
path: "/v2/exchange_rates/{:base}/{:counter}?{:query_params}",
description: "Get an exchange rate for a given currency pair at a specific time.",
link: "#get-exchange-rates",
params: {
"{:base}": "USD+rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
"{:counter}": "XRP",
"{:query_params}": "date=2015-11-13T00:00:00Z"
}
});
Request('Normalize', {
method: GET,
path: "/v2/normalize?{:query_params}",
description: "Convert an amount from one currency and issuer to another, using the network exchange rates.",
link: "#normalize",
params: {
"{:query_params}": "amount=100&currency=XRP&exchange_currency=USD&exchange_issuer=rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q"
}
});
Request('Get Daily Reports', {
method: GET,
path: "/v2/reports/{:date}?{:query_params}",
description: "Get an aggregated summary of payments per account for one day.",
link: "#get-daily-reports",
params: {
"{:date}": "2015-08-19T00:00:00Z",
"{:query_params}": "accounts=true&payments=true"
}
});
Request('Get Stats', {
method: GET,
path: "/v2/stats/?{:query_params}",
description: "Get an aggregated summary of payments per account for one day.",
link: "#get-daily-summary",
params: {
"{:query_params}": "start=2015-08-30&end=2015-08-31&interval=day&family=metric&metrics=accounts_created,exchanges_count,ledger_count,payments_count"
}
});
Request('Get Capitalization', {
method: GET,
path: "/v2/capitalization/{:currency}?{:query_params}",
description: "Get capitalization data for a specific currency and issuer.",
link: "#get-capitalization",
params: {
"{:currency}": "USD+rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
"{:query_params}": "start=2015-01-01T00:00:00Z&end=2015-10-31&interval=month"
}
});
Request('Get Active Accounts', {
method: GET,
path: "/v2/active_accounts/{:base}/{:counter}?{:query_params}",
description: "Get information on which accounts are actively trading in a specific currency pair.",
link: "#get-active-accounts",
params: {
"{:base}": "USD+rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
"{:counter}": "XRP",
"{:query_params}": "period=7day"
}
});
Request('Get Exchange Volume', {
method: GET,
path: "/v2/network/exchange_volume?{:query_params}",
description: "Get aggregated exchange volume for a given time period.",
link: "#get-exchange-volume",
params: {
"{:query_params}": "start=2015-10-01T00:00:00&end=2015-11-15T00:00:00&interval=week&exchange_currency=USD&exchange_issuer=rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q"
}
});
Request('Get Payment Volume', {
method: GET,
path: "/v2/network/payment_volume?{:query_params}",
description: "Get aggregated payment volume for a given time period.",
link: "#get-exchange-volume",
params: {
"{:query_params}": "start=2015-10-01T00:00:00&end=2015-11-15T00:00:00&interval=week&exchange_currency=USD&exchange_issuer=rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q"
}
});
Request('Get Issued Value', {
method: GET,
path: "/v2/network/issued_value?{:query_params}",
description: "Get aggregated payment volume for a given time period.",
link: "#get-exchange-volume",
params: {
"{:query_params}": "start=2015-10-01T00:00:00&end=2015-11-15T00:00:00&exchange_currency=USD&exchange_issuer=rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q"
}
});
Request('Get XRP Distribution', {
method: GET,
path: "/v2/network/xrp_distribution?{:query_params}",
description: "Get info on how much XRP is available and how much has been distributed outside of Ripple (the company).",
link: "#get-xrp-distribution",
params: {
"{:query_params}": "limit=3&descending=true"
}
});
Request('Get Top Currencies', {
method: GET,
path: "/v2/network/top_currencies/{:date}?{:query_params}",
description: "Get most used currencies for a given date.",
link: "#get-top-currencies",
params: {
"{:date}": "2016-04-14",
"{:query_params}": "limit=2"
}
});
Request('Get Top Markets', {
method: GET,
path: "/v2/network/top_markets/{:date}",
description: "Get most active markets for a given date.",
link: "#get-top-currencies",
params: {
"{:date}": "2016-04-15"
}
});
// account methods -----------------------------------//
Request("ACCOUNTS");
Request('Get Account', {
method: GET,
path: "/v2/accounts/{:address}",
description: "Get creation info for a specific account.",
link: "#get-account",
params: {
"{:address}": DEFAULT_ADDRESS_1
}
});
Request('Get Accounts', {
method: GET,
path: "/v2/accounts/?{:query_params}",
description: "Get info for all account creations.",
link: "#get-accounts",
params: {
"{:query_params}": "descending=true&parent=rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
}
});
Request('Get Account Balances', {
method: GET,
path: "/v2/accounts/{:address}/balances?{:query_params}",
description: "Get a given account's balances at a given time.",
link: "#get-account-balances",
params: {
"{:address}": DEFAULT_ADDRESS_1,
"{:query_params}": "currency=USD&date=2015-01-01T00:00:00Z&limit=3"
}
});
Request('Get Account Orders', {
method: GET,
path: "/v2/accounts/{:address}/orders?{:query_params}",
description: "Get orders in the order books, placed by a specific account.",
link: "#get-account-orders",
params: {
"{:address}": JPY_TRADER_ADDRESS,
"{:query_params}": "limit=2&date=2015-11-11T00:00:00Z"
}
});
Request('Get Account Transaction History', {
method: GET,
path: "/v2/accounts/{:address}/transactions?{:query_params}",
description: "Get transactions that affected the given account.",
link: "#get-account-transaction-history",
params: {
"{:address}": DEFAULT_ADDRESS_1,
"{:query_params}": "type=Payment&result=tesSUCCESS&limit=3"
}
});
Request('Get Transaction By Account and Sequence', {
method: GET,
path: "/v2/accounts/{:address}/transactions/{:sequence}?{:query_params}",
description: "Get a transaction using the sending account and sequence number.",
link: "#get-transaction-by-account-and-sequence",
params: {
"{:address}": DEFAULT_ADDRESS_1,
"{:sequence}": 10,
"{:query_params}": "binary=true"
}
});
Request('Get Account Payments', {
method: GET,
path: "/v2/accounts/{:address}/payments?{:query_params}",
description: "Get payments to and from a given account.",
link: "#get-account-payments",
params: {
"{:address}": DEFAULT_ADDRESS_1,
"{:query_params}": "currency=USD&limit=3"
}
});
Request('Get Account Exchanges - All', {
method: GET,
path: "/v2/accounts/{:address}/exchanges?{:query_params}",
description: "Get all currency changes in which a given account participated.",
link: "#get-account-exchanges",
params: {
"{:address}": KRW_TRADER_ADDRESS,
"{:query_params}": "start=2015-08-01T00:00:00Z&end=2015-08-31T00:00:00Z"
}
});
Request('Get Account Exchanges - Single Currency Pair', {
method: GET,
path: "/v2/accounts/{:address}/exchanges/{:base}/{:counter}?{:query_params}",
description: "Get exchanges of a specific currency pair in which a given account participated.",
link: "#get-account-exchanges",
params: {
"{:address}": KRW_TRADER_ADDRESS,
"{:base}": "KRW+rUkMKjQitpgAM5WTGk79xpjT38DEJY283d",
"{:counter}": "XRP",
"{:query_params}": "start=2015-08-08T00:00:00Z&end=2015-08-31T00:00:00Z&limit=2"
}
});
Request('Get Account Balance Changes', {
method: GET,
path: "/v2/accounts/{:address}/balance_changes?{:query_params}",
description: "Get detailed account of all changes to an account's balance.",
link: "#get-account-balance-changes",
params: {
"{:address}": DEFAULT_ADDRESS_1,
"{:query_params}": "descending=true&limit=3"
}
});
Request('Get Account Reports By Day', {
method: GET,
path: "/v2/accounts/{:address}/reports/{:date}?{:query_params}",
description: "Get summary of account activity for a given account on a certain day.",
link: "#get-account-reports",
params: {
"{:address}": DEFAULT_ADDRESS_1,
"{:date}": "2015-08-27T00:00:00",
"{:query_params}": "accounts=true&payments=true&descending=true"
}
});
Request('Get Account Reports Range', {
method: GET,
path: "/v2/accounts/{:address}/reports?{:query_params}",
description: "Get multiple daily summaries of account activity.",
link: "#get-account-reports",
params: {
"{:address}": DEFAULT_ADDRESS_1,
"{:query_params}": "accounts=true&payments=true&descending=true"
}
});
Request('Get Account Transaction Stats', {
method: GET,
path: "/v2/accounts/{:address}/stats/transactions?{:query_params}",
description: "Get daily summaries of transaction activity for an account.",
link: "#get-account-transaction-stats",
params: {
"{:address}": DEFAULT_ADDRESS_1,
"{:query_params}": "limit=2&descending=true"
}
})
Request('Get Account Value Stats', {
method: GET,
path: "/v2/accounts/{:address}/stats/value?{:query_params}",
description: "Get daily summaries of the currency held by an account.",
link: "#get-account-value-stats",
params: {
"{:address}": DEFAULT_ADDRESS_1,
"{:query_params}": "limit=2&descending=true"
}
})
//-------------- Validation Network 00----------------//
Request("VALIDATION NETWORK");
Request('Get Transaction Costs', {
method: GET,
path: "/v2/network/fees?{:query_params}",
description: "Get stats on the transaction cost.",
link: "#get-transaction-costs",
params: {
"{:query_params}": "interval=day&limit=3&descending=true"
}
});
Request('Get Ledger Validations', {
method: GET,
path: "/v2/ledgers/{:ledger_hash}/validations?{:query_params}",
description: "Get data on validations for a specific ledger hash.",
link: "#get-ledger-validations",
params: {
"{:ledger_hash}": LEDGER_WITH_VALIDATIONS,
"{:query_params}": "limit=2"
}
});
Request('Get Ledger Validation', {
method: GET,
path: "/v2/ledgers/{:ledger_hash}/validations/{:validation_public_key}",
description: "Get data on validation for a specific ledger hash by a specific validator.",
link: "#get-ledger-validation",
params: {
"{:ledger_hash}": LEDGER_WITH_VALIDATIONS,
"{:validation_public_key}": VALIDATOR_PUBKEY
}
});
Request('Get Topology', {
method: GET,
path: "/v2/network/topology?{:query_params}",
description: "Get topology of servers running the Ripple peer-to-peer network.",
link: "#get-topology",
params: {
"{:query_params}": "verbose=true"
}
});
Request('Get Topology Nodes', {
method: GET,
path: "/v2/network/topology/nodes?{:query_params}",
description: "Get data on servers running the Ripple peer-to-peer network.",
link: "#get-topology-nodes",
params: {
"{:query_params}": "verbose=true"
}
});
Request('Get Topology Node', {
method: GET,
path: "/v2/network/topology/nodes/{:pubkey}",
description: "Get data on servers running the Ripple peer-to-peer network.",
link: "#get-topology-nodes",
params: {
"{:pubkey}": "n94h5KNspwUGLaGcdHGxruYNmExWHjPkLcMvwsNrivR9czRp6Lor"
}
});
Request('Get Topology Links', {
method: GET,
path: "/v2/network/topology/links?{:query_params}",
description: "Get links in the topology of servers running the Ripple peer-to-peer network.",
link: "#get-topology-links",
params: {
"{:query_params}": "verbose=true"
}
});
// Removed in v2.4.0
// Request('Get Validations', {
// method: GET,
// path: "/v2/network/validations?{:query_params}",
// description: "Get validation votes.",
// link: "#get-validations",
// params: {
// "{:query_params}": "limit=3&descending=true"
// }
// });
Request('Get Validator', {
method: GET,
path: "/v2/network/validators/{:validation_public_key}?{:query_params}",
description: "Get details of a single validator by validation public key.",
link: "#get-validator",
params: {
"{:validation_public_key}": VALIDATOR_PUBKEY,
"{:query_params}": "verbose=true"
}
});
Request('Get Validators', {
method: GET,
path: "/v2/network/validators?{:query_params}",
description: "Get details of known validators.",
link: "#get-validators",
params: {
"{:validation_public_key}": VALIDATOR_PUBKEY,
"{:query_params}": "format=json"
}
});
// Removed in v2.4.0
// Request('Get Validator Validations', {
// method: GET,
// path: "/v2/network/validators/{:validation_public_key}/validations?{:query_params}",
// description: "Get validation votes from a single validator.",
// link: "#get-validator-validations",
// params: {
// "{:validation_public_key}": VALIDATOR_PUBKEY,
// "{:query_params}": "limit=3"
// }
// });
Request('Get Single Validator Reports', {
method: GET,
path: "/v2/network/validators/{:validation_public_key}/reports?{:query_params}",
description: "Get validation vote stats for a single validator over time.",
link: "#get-single-validator-reports",
params: {
"{:validation_public_key}": VALIDATOR_PUBKEY,
"{:query_params}": "format=json"
}
});
Request('Get Daily Validator Reports', {
method: GET,
path: "/v2/network/validator_reports?{:query_params}",
description: "Get validation vote stats for all validators for a single day.",
link: "#get-single-validator-reports",
params: {
"{:query_params}": "format=json"
}
});
Request('Get Validator Manifests', {
method: GET,
path: "/v2/network/validators/{:validation_public_key}/manifests",
description: "Get validation vote stats for all validators for a single day.",
link: "#get-validator-manifests",
params: {
"{:validation_public_key}": VALIDATOR_PUBKEY,
"{:query_params}": "format=json"
}
});
//-------------- Gateway Information -----------------//
Request("GATEWAY INFORMATION");
Request('Get All Gateways', {
method: GET,
path: "/v2/gateways",
description: "Get information about known gateways.",
link: "#get-all-gateways",
params: {}
});
Request('Get Gateway', {
method: GET,
path: "/v2/gateways/{:gateway}",
description: "Get information about a specific known gateway.",
link: "#get-gateway",
params: {
"{:gateway}": "Gatehub"
}
});
//-------------- Health Checks -----------------------//
Request("HEALTH CHECKS");
Request('API Health Check', {
method: GET,
path: "/v2/health/api?{:query_params}",
description: "Check the health of the API service.",
link: "#health-check-api",
params: {
"{:query_params}": "verbose=true"
}
});
Request('Importer Health Check', {
method: GET,
path: "/v2/health/importer?{:query_params}",
description: "Check the health of the Ledger Importer service.",
link: "#health-check-ledger-importer",
params: {
"{:query_params}": "verbose=true"
}
});
Request('Nodes ETL Health Check', {
method: GET,
path: "/v2/health/nodes_etl?{:query_params}",
description: "Check the health of the Extract, Transform, Load service for network topology data.",
link: "#health-check-nodes-etl",
params: {
"{:query_params}": "verbose=true"
}
});
Request('Validations ETL Health Check', {
method: GET,
path: "/v2/health/nodes_etl?{:query_params}",
description: "Check the health of the Extract, Transform, Load service for ledger validations.",
link: "#health-check-validations-etl",
params: {
"{:query_params}": "verbose=true"
}
});
//---------- End req. List ---------------------------//

View File

@@ -1,34 +0,0 @@
//---------- List of requests ------------------------//
// Must be loaded after apitool-rest.js //
//var DOC_BASE = "reference-rippled.html";
//var URL_BASE = "https://s2.ripple.com:51234";
var DEFAULT_ADDRESS_1 = "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn";
var KRW_TRADER_ADDRESS = "rsyDrDi9Emy6vPU78qdxovmNpmj5Qh4NKw";
var JPY_TRADER_ADDRESS = "rK5j9n8baXfL4gzUoZsfxBvvsv97P5swaV";
var DEFAULT_HASH = "9D591B18EDDD34F0B6CF4223A2940AEA2C3CC778925BABF289E0011CD8FA056E";
var DEFAULT_LEDGER = "3170DA37CE2B7F045F889594CBC323D88686D2E90E8FFD2BBCD9BAD12E416DB5";
// general methods -----------------------------------//
Request("ACCOUNT INFORMATION");
Request('account_currencies', {
method: POST,
path: "/",
description: "Retrieves a simple list of currencies that an account can send or receive, based on its trust lines.",
link: "#account-currencies",
params: {},
body: {
"method": "account_currencies",
"params": [
{
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"account_index": 0,
"ledger_index": "validated",
"strict": true
}
]
}
});

View File

@@ -1,630 +0,0 @@
DEFAULT_ADDRESS_1 = "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
DEFAULT_ADDRESS_2 = "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX"
TST_ISSUER = "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
Request("Account Methods")
Request('account_channels', {
description: "Returns information about an account's <a href='payment-channels.html'>payment channels</a>.",
link: "account_channels.html",
body: {
"id": 1,
"command": "account_channels",
"account": DEFAULT_ADDRESS_1,
"destination_account": DEFAULT_ADDRESS_2,
"ledger_index": "validated"
}
})
Request('account_currencies', {
description: "Retrieves a list of currencies that an account can send or receive, based on its trust lines.",
link: "account_currencies.html",
body: {
"command": "account_currencies",
"account": DEFAULT_ADDRESS_1,
"ledger_index": "validated"
}
})
Request('account_info', {
description: "Retrieves information about an account, its activity, and its XRP balance.",
link: "account_info.html",
body: {
"id": 2,
"command": "account_info",
"account": DEFAULT_ADDRESS_1,
"ledger_index": "current",
"queue": true
}
})
Request('account_lines', {
description: "Retrieves information about an account's trust lines, including balances for all non-XRP currencies and assets.",
link: "account_lines.html",
body: {
"id": 2,
"command": "account_lines",
"account": DEFAULT_ADDRESS_1,
"ledger_index": "validated"
}
})
Request('account_nfts', {
description: "Retrieves NFTs owned by an account.",
link: "account_nfts.html",
body: {
"command": "account_nfts",
"account": "rsuHaTvJh1bDmDoxX9QcKP7HEBSBt4XsHx",
"ledger_index": "validated"
}
})
Request('account_objects', {
description: "Returns the raw ledger format for all objects owned by an account.",
link: "account_objects.html",
body: {
"id": 1,
"command": "account_objects",
"account": DEFAULT_ADDRESS_1,
"ledger_index": "validated",
"type": "state",
"limit": 10
}
})
Request('account_offers', {
description: "Retrieves a list of offers made by a given account that are outstanding as of a particular ledger version.",
link: "account_offers.html",
body: {
"id": 2,
"command": "account_offers",
"account": DEFAULT_ADDRESS_1
}
})
Request('account_tx', {
description: "Retrieves a list of transactions that affected the specified account.",
link: "account_tx.html",
body: {
"id": 2,
"command": "account_tx",
"account": DEFAULT_ADDRESS_1,
"ledger_index_min": -1,
"ledger_index_max": -1,
"binary": false,
"limit": 2,
"forward": false
}
})
Request('gateway_balances', {
description: "Calculates the total balances issued by a given account, optionally excluding amounts held by operational addresses.",
link: "gateway_balances.html",
body: {
"id": "example_gateway_balances_1",
"command": "gateway_balances",
"account": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", // btc2ripple
"hotwallet": [
"rKm4uWpg9tfwbVSeATv4KxDe6mpE9yPkgJ",
"ra7JkEzrgeKHdzKgo4EUUVBnxggY4z37kt"
],
"ledger_index": "validated"
}
})
Request('noripple_check', {
description: "Compares an account's Default Ripple and No Ripple flags to the recommended settings.",
link: "noripple_check.html",
body: {
"id": 0,
"command": "noripple_check",
"account": DEFAULT_ADDRESS_1,
"role": "gateway",
"ledger_index": "current",
"limit": 2,
"transactions": true
}
})
Request("Ledger Methods")
Request('ledger', {
description: "Retrieves information about the public ledger.",
link: "ledger.html",
body: {
"id": 14,
"command": "ledger",
"ledger_index": "validated",
"full": false,
"accounts": false,
"transactions": false,
"expand": false,
"owner_funds": false
}
})
Request('ledger_closed', {
description: "Returns the unique identifiers of the most recently closed ledger. (This ledger is not necessarily validated and immutable yet.)",
link: "ledger_closed.html",
body: {
"id": 2,
"command": "ledger_closed"
}
})
Request('ledger_current', {
description: "Returns the unique identifiers of the current in-progress ledger.",
link: "ledger_closed.html",
body: {
"id": 2,
"command": "ledger_current"
}
})
Request('ledger_data', {
description: "Retrieves contents of the specified ledger.",
link: "ledger_data.html",
body: {
"id": 2,
"ledger_hash": "842B57C1CC0613299A686D3E9F310EC0422C84D3911E5056389AA7E5808A93C8",
"command": "ledger_data",
"limit": 5,
"binary": true
}
})
Request('ledger_entry - by object ID', {
description: "Returns an object by its unique ID.",
link: "ledger_entry.html#get-ledger-object-by-id",
body: {
"command": "ledger_entry",
"index": "7DB0788C020F02780A673DC74757F23823FA3014C1866E72CC4CD8B226CD6EF4",
"ledger_index": "validated"
}
})
Request('ledger_entry - AccountRoot', {
description: "Returns a single account in its raw ledger format.",
link: "ledger_entry.html#get-accountroot-object",
body: {
"id": "example_get_accountroot",
"command": "ledger_entry",
"account_root": DEFAULT_ADDRESS_1,
"ledger_index": "validated"
}
})
Request('ledger_entry - AMM', {
description: "Returns a single Automated Market Maker object in its raw ledger format.",
link: "ledger_entry.html#get-amm-object",
status: "not_enabled",
body: {
"id": "example_get_amm",
"command": "ledger_entry",
"amm": {
"asset": {
"currency": "XRP"
},
"asset2": {
"currency" : "TST",
"issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
}
},
"ledger_index": "validated"
}
})
Request('ledger_entry - DirectoryNode', {
description: "Returns a directory object in its raw ledger format.",
link: "ledger_entry.html#get-directorynode-object",
body: {
"id": "example_get_directorynode",
"command": "ledger_entry",
"directory": {
"owner": DEFAULT_ADDRESS_1,
"sub_index": 0
},
"ledger_index": "validated"
}
})
Request('ledger_entry - NFT Page', {
description: "Returns an NFT Page object in its raw ledger format.",
link: "ledger_entry.html#get-nft-page",
body: {
"id": "example_get_nft_page",
"command": "ledger_entry",
"nft_page": "255DD86DDF59D778081A06D02701E9B2C9F4F01DFFFFFFFFFFFFFFFFFFFFFFFF",
"ledger_index": "validated"
}
})
Request('ledger_entry - Offer', {
description: "Returns an Offer object in its raw ledger format.",
link: "ledger_entry.html#get-offer-object",
body: {
"id": "example_get_offer",
"command": "ledger_entry",
"offer": {
"account": DEFAULT_ADDRESS_1,
"seq": 359
},
"ledger_index": "validated"
}
})
Request('ledger_entry - RippleState', {
description: "Returns a RippleState object in its raw ledger format.",
link: "ledger_entry.html#get-ripplestate-object",
body: {
"id": "example_get_ripplestate",
"command": "ledger_entry",
"ripple_state": {
"accounts": [
DEFAULT_ADDRESS_1,
"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW"
],
"currency": "USD"
},
"ledger_index": "validated"
}
})
Request('ledger_entry - Check', {
description: "Returns a Check object in its raw ledger format.",
link: "ledger_entry.html#get-check-object",
body: {
"id": "example_get_check",
"command": "ledger_entry",
"check": "C4A46CCD8F096E994C4B0DEAB6CE98E722FC17D7944C28B95127C2659C47CBEB",
"ledger_index": "validated"
}
})
Request('ledger_entry - Escrow', {
description: "Returns an Escrow object in its raw ledger format.",
link: "ledger_entry.html#get-escrow-object",
body: {
"id": "example_get_escrow",
"command": "ledger_entry",
"escrow": { // This is a long-lasting Escrow found in public data
"owner": "rL4fPHi2FWGwRGRQSH7gBcxkuo2b9NTjKK",
"seq": 126
},
"ledger_index": "validated"
}
})
Request('ledger_entry - PayChannel', {
description: "Returns a PayChannel object in its raw ledger format.",
link: "ledger_entry.html#get-paychannel-object",
body: {
"id": "example_get_paychannel",
"command": "ledger_entry",
"payment_channel": "C7F634794B79DB40E87179A9D1BF05D05797AE7E92DF8E93FD6656E8C4BE3AE7",
"ledger_index": "validated"
}
})
Request('ledger_entry - DepositPreauth', {
description: "Returns a DepositPreauth object in its raw ledger format.",
link: "ledger_entry.html#get-depositpreauth-object",
body: {
"id": "example_get_deposit_preauth",
"command": "ledger_entry",
"deposit_preauth": {
"owner": DEFAULT_ADDRESS_1,
"authorized": DEFAULT_ADDRESS_2
},
"ledger_index": "validated"
}
})
Request('ledger_entry - Ticket', {
description: "Returns a Ticket object in its raw ledger format.",
link: "ledger_entry.html#get-ticket-object",
body: {
"id": "example_get_ticket",
"command": "ledger_entry",
"ticket": {
"account": DEFAULT_ADDRESS_1,
"ticket_seq": 389 // This is a real ticket on Mainnet.
},
"ledger_index": "validated"
}
})
Request("Transaction Methods")
// Signing methods are not provided here because they're admin-only by default.
// (Sending your secret to another server is extremely insecure and could cause
// someone else to take over your account, steal all your money, etc.)
Request('submit', {
description: "Submits a transaction to the network to be confirmed and included in future ledgers.",
link: "submit.html",
body: {
"id": "example_submit",
"command": "submit",
"tx_blob": "1200002280000000240000001E61D4838D7EA4C6800000000000000000000000000055534400000000004B4E9C06F24296074F7BC48F92A97916C6DC5EA968400000000000000B732103AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB7447304502210095D23D8AF107DF50651F266259CC7139D0CD0C64ABBA3A958156352A0D95A21E02207FCF9B77D7510380E49FF250C21B57169E14E9B4ACFD314CEDC79DDD0A38B8A681144B4E9C06F24296074F7BC48F92A97916C6DC5EA983143E9D4A2B8AA0780F682D136F7A56D6724EF53754"
}
})
Request('submit_multisigned', {
description: "Submits a multi-signed transaction to the network to be confirmed and included in future ledgers.",
link: "submit_multisigned.html",
body: {
"id": "submit_multisigned_example",
"command": "submit_multisigned",
"tx_json": {
"Account": "rEuLyBCvcw4CFmzv8RepSiAoNgF8tTGJQC",
"Fee": "30000",
"Flags": 262144,
"LimitAmount": {
"currency": "USD",
"issuer": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"value": "100"
},
"Sequence": 2,
"Signers": [{
"Signer": {
"Account": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW",
"SigningPubKey": "02B3EC4E5DD96029A647CFA20DA07FE1F85296505552CCAC114087E66B46BD77DF",
"TxnSignature": "30450221009C195DBBF7967E223D8626CA19CF02073667F2B22E206727BFE848FF42BEAC8A022048C323B0BED19A988BDBEFA974B6DE8AA9DCAE250AA82BBD1221787032A864E5"
}
}, {
"Signer": {
"Account": "rUpy3eEg8rqjqfUoLeBnZkscbKbFsKXC3v",
"SigningPubKey": "028FFB276505F9AC3F57E8D5242B386A597EF6C40A7999F37F1948636FD484E25B",
"TxnSignature": "30440220680BBD745004E9CFB6B13A137F505FB92298AD309071D16C7B982825188FD1AE022004200B1F7E4A6A84BB0E4FC09E1E3BA2B66EBD32F0E6D121A34BA3B04AD99BC1"
}
}],
"SigningPubKey": "",
"TransactionType": "TrustSet",
"hash": "BD636194C48FD7A100DE4C972336534C8E710FD008C0F3CF7BC5BF34DAF3C3E6"
}
}
})
Request('transaction_entry', {
description: "Retrieves information on a single transaction from a specific ledger version.",
link: "transaction_entry.html",
body: {
"id": 4,
"command": "transaction_entry",
"tx_hash": "E08D6E9754025BA2534A78707605E0601F03ACE063687A0CA1BDDACFCD1698C7",
"ledger_index": 348734
}
})
Request('tx', {
description: "Retrieves information on a single transaction.",
link: "tx.html",
body: {
"id": 1,
"command": "tx",
"transaction": "E08D6E9754025BA2534A78707605E0601F03ACE063687A0CA1BDDACFCD1698C7",
"binary": false
}
})
Request("Path and Order Book Methods")
Request('book_offers', {
description: "Retrieves a list of offers, also known as the order book, between two currencies.",
link: "book_offers.html",
body: {
"id": 4,
"command": "book_offers",
"taker": DEFAULT_ADDRESS_1,
"taker_gets": {
"currency": "XRP"
},
"taker_pays": {
"currency": "USD",
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
},
"limit": 10
}
})
Request('deposit_authorized', {
description: "Checks whether one account is authorized to send payments directly to another.",
link: "deposit_authorized.html",
body: {
"id": 1,
"command": "deposit_authorized",
"source_account": DEFAULT_ADDRESS_1,
"destination_account": DEFAULT_ADDRESS_2,
"ledger_index": "validated"
}
})
Request('nft_buy_offers', {
description: "Retrieves offers to buy a given NFT.",
link: "nft_buy_offers.html",
body: {
"command": "nft_buy_offers",
"nft_id": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007",
"ledger_index": "validated"
}
})
Request('nft_sell_offers', {
description: "Retrieves offers to sell a given NFT.",
link: "nft_sell_offers.html",
body: {
"command": "nft_sell_offers",
"nft_id": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007",
"ledger_index": "validated"
}
})
Request('path_find', {
description: "Searches for a path along which a payment can possibly be made, and periodically sends updates when the path changes over time.",
link: "path_find.html",
ws_only: true,
body: {
"id": 8,
"command": "path_find",
"subcommand": "create",
"source_account": DEFAULT_ADDRESS_1,
"destination_account": DEFAULT_ADDRESS_1,
"destination_amount": {
"value": "0.001",
"currency": "USD",
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
}
}
})
Request('ripple_path_find', {
description: "Searches one time for a payment path.",
link: "ripple_path_find.html",
body: {
"id": 8,
"command": "ripple_path_find",
"source_account": DEFAULT_ADDRESS_1,
"source_currencies": [
{
"currency": "XRP"
},
{
"currency": "USD"
}
],
"destination_account": DEFAULT_ADDRESS_1,
"destination_amount": {
"value": "0.001",
"currency": "USD",
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
}
}
})
Request('amm_info', {
description: "Looks up info on an Automated Market Maker instance.",
link: "amm_info.html",
status: "not_enabled",
body: {
"command": "amm_info",
"asset": {
"currency": "XRP"
},
"asset2": {
"currency": "TST",
"issuer": TST_ISSUER
}
}
})
Request("Payment Channel Methods")
Request('channel_authorize', {
description: "Creates a signature that can be used to redeem a specific amount of XRP from a payment channel.",
link: "channel_authorize.html",
body: {
"id": "channel_authorize_example_id1",
"command": "channel_authorize",
"channel_id": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3",
"secret": "s████████████████████████████",
"amount": "1000000"
}
})
Request('channel_verify', {
description: "Checks the validity of a signature that can be used to redeem a specific amount of XRP from a payment channel.",
link: "channel_verify.html",
body: {
"id": 1,
"command": "channel_verify",
"channel_id": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3",
"signature": "304402204EF0AFB78AC23ED1C472E74F4299C0C21F1B21D07EFC0A3838A420F76D783A400220154FB11B6F54320666E4C36CA7F686C16A3A0456800BBC43746F34AF50290064",
"public_key": "aB44YfzW24VDEJQ2UuLPV2PvqcPCSoLnL7y5M1EzhdW4LnK5xMS3",
"amount": "1000000"
}
})
Request("Subscription Methods")
Request('subscribe', {
description: "Requests periodic notifications from the server when certain events happen.",
link: "subscribe.html",
body: {
"id": "Example watch one account and all new ledgers",
"command": "subscribe",
"streams": ["ledger"],
"accounts": ["rrpNnNLKrartuEqfJGpqyDwPj1AFPg9vn1"]
}
})
Request('unsubscribe', {
description: "Tells the server to stop sending messages for a particular subscription or set of subscriptions.",
link: "unsubscribe.html",
body: {
"id": "Example stop watching one account and new ledgers",
"command": "unsubscribe",
"streams": ["ledger"],
"accounts": ["rrpNnNLKrartuEqfJGpqyDwPj1AFPg9vn1"]
}
})
Request("Server Info Methods")
Request('fee', {
description: "Reports the current state of the open-ledger requirements for the transaction cost.",
link: "fee.html",
body: {
"id": "fee_websocket_example",
"command": "fee"
}
})
Request('server_definitions', {
description: "Returns an SDK-compatible definitions.json, generated from the rippled server being queried.",
link: "server_definitions.html",
body: {
"id": 1,
"command": "server_definitions"
}
})
Request('server_info', {
description: "Reports a human-readable version of various information about the rippled server being queried.",
link: "server_info.html",
body: {
"id": 1,
"command": "server_info"
}
})
Request('server_state', {
description: "Reports a machine-readable version of various information about the rippled server being queried.",
link: "server_state.html",
body: {
"id": 1,
"command": "server_state",
"ledger_index": "current"
}
})
Request("Utility Methods")
Request('ping', {
description: "Checks that the connection is working.",
link: "ping.html",
body: {
"id": 1,
"command": "ping"
}
})
Request('random', {
description: "Provides a random number, which may be a useful source of entropy for clients.",
link: "random.html",
body: {
"id": 1,
"command": "random"
}
})

View File

@@ -1,297 +0,0 @@
var commandlist = $("#command_list");
var request_body = $("#request_body");
var request_button = $("#request_button");
var response_body = $("#response_body");
var response_code = $("#rest_responsecode");
var rest_url = $('#rest_url');
var rest_method = $("#rest_method");
var selected_command = $("#selected_command");
var spinner = $(".loader");
var reminders = $("#rest_url_wrapper .rest_reminders");
var test_warning = $("#test_warning");
var GET = "GET";
var POST = "POST";
var PUT = "PUT";
var DELETE = "DELETE";
function slugify(str) {
str = str.replace(/^\s+|\s+$/g, ''); // trim
str = str.toLowerCase();
// remove accents, swap ñ for n, etc
var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;";
var to = "aaaaeeeeiiiioooouuuunc------";
for (var i=0, l=from.length ; i<l ; i++) {
str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
}
str = str.replace(/[^a-z0-9 -]/g, '') // remove invalid chars
.replace(/\s+/g, '-') // collapse whitespace and replace by -
.replace(/-+/g, '-'); // collapse dashes
return str;
}
//Build requests
var requests = { };
var requestlist = [];
function Request(name, obj) {
if (obj === undefined) {
requestlist.push({slug: null,name: name});//separator
return null;
}
obj.name = name;
obj.slug = slugify(name);
requests[obj.slug] = obj;
requestlist.push(obj);
return obj;
};
function generate_table_of_contents() {
$.each(requestlist, function(i, req) {
if (req.slug === null) {
commandlist.append("<li class='separator'>"+req.name+"</li>");
} else {
commandlist.append("<li><a href='#"+req.slug+"'>"+req.name+"</a></li>");
}
});
}
function make_commands_clickable() {
commandlist.children("li").click(function() {
var cmd = slugify($(this).text().trim());
if (!requests[cmd]) return;
select_request(cmd, true);
window.location.hash = cmd;
$(this).siblings().removeClass('selected');
$(this).addClass('selected');
});
}
var cm_request = CodeMirror(request_body.get(0), {
mode: 'javascript',
json: true,
smartIndent: false
});
var cm_response = CodeMirror(response_body.get(0), {
mode: 'javascript',
json: true,
smartIndent: false,
readOnly: true
});
function update_method(el) {
if (el === undefined) {
method = $(this).val();
} else {
method = $(el).val();
}
if (method == GET) {
request_body.hide();
} else {
request_body.show();
cm_request.refresh();
}
}
function change_path(command) {
rest_url.empty();
reminders.html("&nbsp;");
var re = /(\{:[^}]+\})/g; // match stuff like {:address}
params = command.path.split(re);
//console.log(params);
for (i=0; i<params.length; i++) {
if (params[i].match(/\{:[^}]+\}/) !== null) {
if (command.params === undefined || command.params[params[i]] === undefined) {
var default_val = params[i];
} else {
var default_val = command.params[params[i]];
}
//rest_url.append("<span class='editable' contenteditable='true' id='resturl_"+params[i]+"'>"+default_val+"</span>");
var new_div = $("<div>").appendTo(rest_url);
var new_param = $("<input type='text' id='resturl_"+params[i]+"' value='"+default_val+"' class='editable' title='"+params[i]+"' />").appendTo(new_div);
new_param.autosizeInput({"space": 0});
//var new_label = $("<label class='reminder' for='resturl_"+params[i]+"'>"+params[i]+"</label>").appendTo(new_div);
} else {
rest_url.append("<span class='non_editable'>"+params[i]+"</span>");
}
}
}
function select_request(request) {
if (request === undefined) {
var el = commandlist.children("li:not(.separator)").eq(0);
request = slugify(el.text());
/* var keys = Object.keys(requests);
var index = keys.indexOf(cmd);
if (index === -1) return;*/
} else {
var el = commandlist.find("li a[href='#"+request+"']").parent();
}
$(el).siblings().removeClass('selected');
$(el).addClass('selected');
command = requests[request];
if (command.test_only === true) {
test_warning.show();
} else {
test_warning.hide();
}
if (command.description) {
$(description).html(command.description);
if (command.link) {
$(description).append(" <a class='button btn btn-outline-secondary' href='" +
DOC_BASE+command.link+"'>Read more</a>");
}
$(description).show();
} else if (command.link) {
$(description).html("<a class='link_underline' href='" + DOC_BASE+
command.link+"'>Read more</a>");
} else {
$(description).hide();
}
selected_command.html($('<a>')
.attr('href', DOC_BASE+command.link)
.text(command.name));
change_path(command);
request_button.val(command.method);
request_button.text(command.method+" request");
update_method(request_button);
if (command.hasOwnProperty("body")) {
cm_request.setValue(JSON.stringify(command.body, null, 2));
} else {
//No body, so wipe out the current contents.
cm_request.setValue("");
}
cm_request.refresh();
reset_response_area();
};
function get_path() {
s = "";
rest_url.find(".non_editable, .editable").each(function() {
if (this.tagName == "INPUT") {
s += $(this).val();
} else {
s += $(this).text();
}
});
return s;
}
function send_request() {
//var method = rest_method.val();
var method = request_button.val();
if (method != GET && method != POST && method != PUT && method != DELETE) {
console.log("ERROR: unrecognized http method");
return;
}
//var path = rest_url.val();
var path = get_path();
$(this).addClass('depressed');
response_body.addClass('obscured');
var original_cmd = requests[slugify(selected_command.text())];
if (original_cmd.hasOwnProperty("body")) {
var body = cm_request.getValue();
$.ajax({
type: method,
url: URL_BASE + path,
data: body,
contentType: 'application/json',
processData: false
}).done(success_output).fail(error_output).always(reset_sending_status);
} else {
$.ajax({
type: method,
url: URL_BASE + path
}).done(success_output).fail(error_output).always(reset_sending_status);
}
spinner.show();
}
function error_output(xhr,status,statusText) {
response_code.text(xhr.status+" "+xhr.statusText);
cm_response.setValue(xhr.responseText);
}
function success_output(body,status,xhr) {
response_code.text(xhr.status+" "+xhr.statusText);
cm_response.setValue(JSON.stringify(body, null, 2));
}
function reset_sending_status() {
response_body.removeClass('obscured');
request_button.removeClass('depressed');
spinner.hide();
}
function reset_response_area() {
cm_response.setValue("");
response_code.text("");
}
function change_base_url(u) {
window.URL_BASE = u;
$("#rest_host").text(u);
}
$(document).ready(function() {
//wait for the Requests to be populated by another file
generate_table_of_contents();
make_commands_clickable();
if (window.location.hash) {
var cmd = window.location.hash.slice(1).toLowerCase();
select_request(cmd);
} else {
select_request();
}
if (urlParams["base_url"]) {
change_base_url(urlParams["base_url"]);
}
request_button.click(send_request);
});
var urlParams;
(window.onpopstate = function () {
var match,
pl = /\+/g, // Regex for replacing addition symbol with a space
search = /([^&=]+)=?([^&]*)/g,
decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); },
query = window.location.search.substring(1);
urlParams = {};
while (match = search.exec(query))
urlParams[decode(match[1])] = decode(match[2]);
})();

View File

@@ -1,5 +1,14 @@
/* Dev Tool styles stuff ---------------------------------------------------- */
.command-list-wrapper {
// WebSocket Tool right sidebar
position: sticky;
top: calc(var(--navbar-height) + var(--toc-offset-top));
max-height: calc(100vh - var(--navbar-height) - var(--toc-offset-top));
overflow-y: auto;
width: var(--toc-width);
}
#tx-sender-history .list-group-item {
font-size: small;
color: $gray-600;