mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-04 11:55:50 +00:00
13025 lines
569 KiB
HTML
13025 lines
569 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||
<meta name="viewport" content="width=device-width">
|
||
|
||
<title>rippled - Ripple Developer Portal</title>
|
||
|
||
<!-- favicon -->
|
||
<link rel="icon" href="favicon.ico" type="image/x-icon">
|
||
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
|
||
|
||
<!-- jQuery -->
|
||
<script src="assets/vendor/jquery-1.11.1.min.js"></script>
|
||
|
||
<!-- Custom Stylesheets. ripple.css includes bootstrap, font stuff -->
|
||
<link href="assets/css/ripple.css" rel="stylesheet" />
|
||
<link href="assets/css/devportal.css" rel="stylesheet" />
|
||
|
||
<!-- Bootstrap JS -->
|
||
<script src="assets/vendor/bootstrap.min.js"></script>
|
||
|
||
|
||
<!-- syntax highlighting -->
|
||
<link rel="stylesheet" href="assets/vendor/docco.min.css" />
|
||
<script src="assets/vendor/highlight.min.js"></script>
|
||
|
||
<!-- syntax selection js -->
|
||
<script src="assets/js/multicodetab.js"></script>
|
||
<script>
|
||
$(document).ready(function() {
|
||
$(".multicode").minitabs();
|
||
hljs.initHighlighting();
|
||
make_code_expandable();
|
||
});
|
||
</script>
|
||
|
||
<script src="assets/js/expandcode.js"></script>
|
||
<script src="assets/js/fixsidebarscroll.js"></script>
|
||
|
||
<!-- fontawesome icons -->
|
||
<link rel="stylesheet" href="assets/vendor/fontawesome/css/font-awesome.min.css" />
|
||
|
||
</head>
|
||
|
||
<body class="page page-template page-template-template-dev-portal page-template-template-dev-portal-php sidebar-primary wpb-js-composer js-comp-ver-3.6.2 vc_responsive">
|
||
<header role="banner" class="banner navbar navbar-default navbar-fixed-top initial_header">
|
||
<div class="container">
|
||
<div class="navbar-header">
|
||
<a href="index.html" class="navbar-brand"><img src="assets/img/ripple-logo-color.png" class="logo"></a>
|
||
</div><!-- /.navbar-header -->
|
||
<div class="nav">
|
||
<div class="draft-warning">DRAFT PAGE</div>
|
||
</div><!-- /.nav -->
|
||
|
||
</div><!-- /.container -->
|
||
|
||
<div class="subnav dev_nav">
|
||
<div class="container">
|
||
<ul id="menu-dev-menu" class="menu">
|
||
<li class="dropdown">
|
||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">References <span class="caret"></span></a>
|
||
<ul class="dropdown-menu" role="menu">
|
||
<li><a href="reference-rippleapi.html">RippleAPI</a></li>
|
||
<li><a href="reference-rippled.html">rippled</a></li>
|
||
<li><a href="reference-transaction-format.html">Transaction Format</a></li>
|
||
<li><a href="reference-ledger-format.html">Ledger Format</a></li>
|
||
<li><a href="reference-data-api.html">Ripple Data API v2</a></li>
|
||
</ul>
|
||
</li>
|
||
<li class="dropdown">
|
||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Tutorials <span class="caret"></span></a>
|
||
<ul class="dropdown-menu" role="menu">
|
||
<li><a href="tutorial-multisign.html">How to Multi-Sign</a></li>
|
||
<li><a href="concept-issuing-and-operational-addresses.html">Issuing and Operational Addresses</a></li>
|
||
<li><a href="tutorial-reliable-transaction-submission.html">Reliable Transaction Submission</a></li>
|
||
<li><a href="tutorial-rippleapi-beginners-guide.html">RippleAPI Beginners Guide</a></li>
|
||
<li><a href="tutorial-rippled-setup.html">rippled Setup</a></li>
|
||
<li><a href="tutorial-gateway-guide.html">Gateway Guide</a></li>
|
||
</ul>
|
||
</li>
|
||
<li class="dropdown">
|
||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">RCL Features <span class="caret"></span></a>
|
||
<ul class="dropdown-menu" role="menu">
|
||
<li><a href="concept-amendments.html">Amendments</a></li>
|
||
<li><a href="concept-fee-voting.html">Fee Voting</a></li>
|
||
<li><a href="concept-fees.html">Fees (Disambiguation)</a></li>
|
||
<li><a href="concept-freeze.html">Freeze</a></li>
|
||
<li><a href="concept-paths.html">Paths</a></li>
|
||
<li><a href="concept-reserves.html">Reserves</a></li>
|
||
<li><a href="concept-stand-alone-mode.html">Stand-Alone Mode</a></li>
|
||
<li><a href="concept-transaction-cost.html">Transaction Cost</a></li>
|
||
<li><a href="concept-transfer-fees.html">Transfer Fees</a></li>
|
||
<li><a href="concept-noripple.html">Understanding the NoRipple flag</a></li>
|
||
</ul>
|
||
</li>
|
||
<li class="dropdown">
|
||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">API Tools <span class="caret"></span></a>
|
||
<ul class="dropdown-menu" role="menu">
|
||
<li><a href="ripple-api-tool.html">WebSocket API Tool</a></li>
|
||
<li><a href="data-api-v2-tool.html">Data API v2 Tool</a></li>
|
||
<li><a href="tool-jsonrpc.html">rippled JSON-RPC Tool</a></li>
|
||
</ul>
|
||
</li>
|
||
|
||
<li class="dropdown">
|
||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Resources <span class="caret"></span></a>
|
||
<ul class="dropdown-menu" role="menu">
|
||
<li><a href="https://forum.ripple.com/viewforum.php?f=2">Forums</a></li>
|
||
<li><a href="https://www.bountysource.com/teams/ripple/bounties">Bounties</a></li>
|
||
<li><a href="https://ripplelabs.atlassian.net/">Bug Tracking</a></li>
|
||
<li><a href="https://ripple.com/category/dev-blog/">Dev Blog</a></li>
|
||
<li><a href="https://ripple.com/press-releases/">Press Center</a></li>
|
||
<li><a href="https://ripple.com/brand-guidelines/">Brand Guidelines</a></li>
|
||
</ul>
|
||
<li><a href="https://github.com/ripple/ripple-dev-portal" title="GitHub">Site Source</a></li>
|
||
</ul><!-- /#dev-menu -->
|
||
</div><!-- /.subnav .container -->
|
||
</div><!-- /.subnav -->
|
||
</header>
|
||
|
||
|
||
<div class="wrap container" role="document">
|
||
<aside class="sidebar" role="complementary">
|
||
<div class="dev_nav_wrapper">
|
||
<div id="cont">
|
||
<h5>In this category:</h5>
|
||
<ul class="dev_nav_sidebar">
|
||
<li class="level-1"><a href="index.html">Category: References</a></li>
|
||
<li class="level-2"><a href="reference-rippleapi.html">RippleAPI</a></li>
|
||
<li class="level-2"><a href="reference-rippled.html">rippled</a></li>
|
||
<li class="level-2"><a href="reference-transaction-format.html">Transaction Format</a></li>
|
||
<li class="level-2"><a href="reference-ledger-format.html">Ledger Format</a></li>
|
||
<li class="level-2"><a href="reference-data-api.html">Ripple Data API v2</a></li>
|
||
</ul>
|
||
<hr />
|
||
<h5>In this page:</h5>
|
||
<ul class="dev_nav_sidebar" id="dactyl_toc_sidebar">
|
||
<li class="level-1"><a href="#rippled">rippled</a></li>
|
||
<li class="level-1"><a href="#websocket-and-json-rpc-apis">WebSocket and JSON-RPC APIs</a></li>
|
||
<li class="level-2"><a href="#changes-to-the-apis">Changes to the APIs</a></li>
|
||
<li class="level-2"><a href="#connecting-to-rippled">Connecting to rippled</a></li>
|
||
<li class="level-3"><a href="#websocket-api">WebSocket API</a></li>
|
||
<li class="level-3"><a href="#json-rpc">JSON-RPC</a></li>
|
||
<li class="level-3"><a href="#commandline">Commandline</a></li>
|
||
<li class="level-2"><a href="#example-request">Example Request</a></li>
|
||
<li class="level-2"><a href="#response-formatting">Response Formatting</a></li>
|
||
<li class="level-2"><a href="#error-responses">Error Responses</a></li>
|
||
<li class="level-3"><a href="#caution-on-errors">Caution on Errors</a></li>
|
||
<li class="level-3"><a href="#universal-errors">Universal Errors</a></li>
|
||
<li class="level-2"><a href="#formatting-conventions">Formatting Conventions</a></li>
|
||
<li class="level-2"><a href="#basic-data-types">Basic Data Types</a></li>
|
||
<li class="level-3"><a href="#addresses">Addresses</a></li>
|
||
<li class="level-3"><a href="#hashes">Hashes</a></li>
|
||
<li class="level-3"><a href="#account-sequence">Account Sequence</a></li>
|
||
<li class="level-3"><a href="#ledger-index">Ledger Index</a></li>
|
||
<li class="level-3"><a href="#specifying-ledgers">Specifying Ledgers</a></li>
|
||
<li class="level-2"><a href="#currencies">Currencies</a></li>
|
||
<li class="level-3"><a href="#specifying-currency-amounts">Specifying Currency Amounts</a></li>
|
||
<li class="level-3"><a href="#currency-codes">Currency Codes</a></li>
|
||
<li class="level-2"><a href="#specifying-time">Specifying Time</a></li>
|
||
<li class="level-2"><a href="#possible-server-states">Possible Server States</a></li>
|
||
<li class="level-2"><a href="#markers-and-pagination">Markers and Pagination</a></li>
|
||
<li class="level-2"><a href="#modifying-the-ledger">Modifying the Ledger</a></li>
|
||
<li class="level-1"><a href="#api-methods">API Methods</a></li>
|
||
<li class="level-2"><a href="#list-of-public-commands">List of Public Commands</a></li>
|
||
<li class="level-2"><a href="#list-of-admin-commands">List of Admin Commands</a></li>
|
||
<li class="level-2"><a href="#commandline-access">Commandline Access</a></li>
|
||
<li class="level-1"><a href="#account-information">Account Information</a></li>
|
||
<li class="level-2"><a href="#account-currencies">account_currencies</a></li>
|
||
<li class="level-2"><a href="#account-info">account_info</a></li>
|
||
<li class="level-2"><a href="#account-lines">account_lines</a></li>
|
||
<li class="level-2"><a href="#account-offers">account_offers</a></li>
|
||
<li class="level-2"><a href="#account-objects">account_objects</a></li>
|
||
<li class="level-2"><a href="#account-tx">account_tx</a></li>
|
||
<li class="level-2"><a href="#noripple-check">noripple_check</a></li>
|
||
<li class="level-2"><a href="#gateway-balances">gateway_balances</a></li>
|
||
<li class="level-2"><a href="#wallet-propose">wallet_propose</a></li>
|
||
<li class="level-1"><a href="#ledger-information">Ledger Information</a></li>
|
||
<li class="level-2"><a href="#ledger">ledger</a></li>
|
||
<li class="level-2"><a href="#ledger-closed">ledger_closed</a></li>
|
||
<li class="level-2"><a href="#ledger-current">ledger_current</a></li>
|
||
<li class="level-2"><a href="#ledger-data">ledger_data</a></li>
|
||
<li class="level-2"><a href="#ledger-entry">ledger_entry</a></li>
|
||
<li class="level-2"><a href="#ledger-request">ledger_request</a></li>
|
||
<li class="level-2"><a href="#ledger-accept">ledger_accept</a></li>
|
||
<li class="level-1"><a href="#transactions">Transactions</a></li>
|
||
<li class="level-2"><a href="#tx">tx</a></li>
|
||
<li class="level-2"><a href="#transaction-entry">transaction_entry</a></li>
|
||
<li class="level-2"><a href="#tx-history">tx_history</a></li>
|
||
<li class="level-2"><a href="#path-find">path_find</a></li>
|
||
<li class="level-3"><a href="#path-find-create">path_find create</a></li>
|
||
<li class="level-3"><a href="#path-find-close">path_find close</a></li>
|
||
<li class="level-3"><a href="#path-find-status">path_find status</a></li>
|
||
<li class="level-2"><a href="#ripple-path-find">ripple_path_find</a></li>
|
||
<li class="level-2"><a href="#sign">sign</a></li>
|
||
<li class="level-3"><a href="#auto-fillable-fields">Auto-Fillable Fields</a></li>
|
||
<li class="level-2"><a href="#sign-for">sign_for</a></li>
|
||
<li class="level-2"><a href="#submit">submit</a></li>
|
||
<li class="level-3"><a href="#submit-only-mode">Submit-Only Mode</a></li>
|
||
<li class="level-3"><a href="#sign-and-submit-mode">Sign-and-Submit Mode</a></li>
|
||
<li class="level-2"><a href="#submit-multisigned">submit_multisigned</a></li>
|
||
<li class="level-2"><a href="#book-offers">book_offers</a></li>
|
||
<li class="level-1"><a href="#subscriptions">Subscriptions</a></li>
|
||
<li class="level-2"><a href="#subscribe">subscribe</a></li>
|
||
<li class="level-3"><a href="#ledger-stream">Ledger Stream</a></li>
|
||
<li class="level-3"><a href="#validations-stream">Validations Stream</a></li>
|
||
<li class="level-3"><a href="#transaction-streams">Transaction Streams</a></li>
|
||
<li class="level-3"><a href="#peer-status-stream">Peer Status Stream</a></li>
|
||
<li class="level-3"><a href="#order-book-streams">Order Book Streams</a></li>
|
||
<li class="level-2"><a href="#unsubscribe">unsubscribe</a></li>
|
||
<li class="level-1"><a href="#server-information">Server Information</a></li>
|
||
<li class="level-2"><a href="#server-info">server_info</a></li>
|
||
<li class="level-2"><a href="#server-state">server_state</a></li>
|
||
<li class="level-2"><a href="#can-delete">can_delete</a></li>
|
||
<li class="level-2"><a href="#consensus-info">consensus_info</a></li>
|
||
<li class="level-2"><a href="#fetch-info">fetch_info</a></li>
|
||
<li class="level-2"><a href="#feature">feature</a></li>
|
||
<li class="level-2"><a href="#fee">fee</a></li>
|
||
<li class="level-2"><a href="#get-counts">get_counts</a></li>
|
||
<li class="level-2"><a href="#ledger-cleaner">ledger_cleaner</a></li>
|
||
<li class="level-2"><a href="#log-level">log_level</a></li>
|
||
<li class="level-2"><a href="#logrotate">logrotate</a></li>
|
||
<li class="level-2"><a href="#validation-create">validation_create</a></li>
|
||
<li class="level-2"><a href="#validation-seed">validation_seed</a></li>
|
||
<li class="level-2"><a href="#peers">peers</a></li>
|
||
<li class="level-2"><a href="#print">print</a></li>
|
||
<li class="level-1"><a href="#convenience-functions">Convenience Functions</a></li>
|
||
<li class="level-2"><a href="#ping">ping</a></li>
|
||
<li class="level-2"><a href="#random">random</a></li>
|
||
<li class="level-2"><a href="#json">json</a></li>
|
||
<li class="level-2"><a href="#connect">connect</a></li>
|
||
<li class="level-2"><a href="#stop">stop</a></li>
|
||
<li class="level-1"><a href="#peer-protocol">Peer Protocol</a></li>
|
||
<li class="level-2"><a href="#configuring-the-peer-protocol">Configuring the Peer Protocol</a></li>
|
||
<li class="level-2"><a href="#peer-crawler">Peer Crawler</a></li>
|
||
<li class="level-3"><a href="#concealing-peer-information">Concealing Peer Information</a></li>
|
||
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
</aside>
|
||
<main class="main" role="main">
|
||
<div class='content'>
|
||
<h1 id="rippled">rippled</h1>
|
||
<p>The core peer-to-peer server that manages the Ripple Consensus Ledger (RCL) is called <code>rippled</code>. Each <code>rippled</code> server connects to a network of peers, relays cryptographically signed transactions, and maintains a local copy of the complete shared global ledger. The source code for <code>rippled</code> is written in C++, and is <a href="https://github.com/ripple/rippled">available on GitHub under an open-source license</a>.</p>
|
||
<ul>
|
||
<li><a href="tutorial-rippled-setup.html"><code>rippled</code> Setup</a></li>
|
||
<li><a href="#api-methods">API Reference</a></li>
|
||
<li><a href="reference-transaction-format.html">Transaction Reference</a></li>
|
||
<li>JavaScript Client Library - <a href="reference-rippleapi.html">RippleAPI</a></li>
|
||
</ul>
|
||
<h1 id="websocket-and-json-rpc-apis">WebSocket and JSON-RPC APIs</h1>
|
||
<p>If you want to communicate directly with a <code>rippled</code> server, you can use either the WebSocket API or the JSON-RPC API. Both APIs use the same list of commands, with almost entirely the same parameters in each command. Alternatively, you can use <a href="reference-rippleapi.html">RippleAPI</a>, which is a simplified JavaScript client library, which communicates directly with a <code>rippled</code> server from <a href="http://nodejs.org/">Node.js</a> or a web browser.</p>
|
||
<ul>
|
||
<li>The WebSocket API uses the <a href="http://www.html5rocks.com/en/tutorials/websockets/basics/">WebSocket protocol</a>, available in most browsers and Javascript implementations, to achieve persistent two-way communication. There is not a 1:1 correlation between requests and responses. Some requests prompt the server to send multiple messages back asynchronously; other times, responses may arrive in a different order than the requests that prompted them. The <code>rippled</code> server can be configured to accept secured (wss:), unsecured (ws:) WebSocket connections, or both.</li>
|
||
<li>The JSON-RPC API relies on request-response communication via HTTP or HTTPS. (The <code>rippled</code> server can be configured to accept HTTP, HTTPS, or both.) For commands that prompt multiple responses, you can provide a callback URL.</li>
|
||
<li>The <code>rippled</code> program can also be used as a quick commandline client to make JSON-RPC requests to a running <code>rippled</code> server. This is only intended for administrative purposes, and is not a supported API.</li>
|
||
</ul>
|
||
<p>In general, we recommend using WebSocket, because WebSocket's push paradigm has less latency and less network overhead. WebSocket is also more reliable; you can worry less about missing messages and establishing multiple connections. On the other hand, there is widespread support for JSON-RPC because you can use a standard HTTP library to connect to <code>rippled</code>'s JSON-RPC API.</p>
|
||
<h2 id="changes-to-the-apis">Changes to the APIs</h2>
|
||
<p>The WebSocket and JSON-RPC APIs are still in development, and are subject to change. If you want to be notified of upcoming changes and future versions of <code>rippled</code>, subscribe to the Ripple Server mailing list:</p>
|
||
<p><a href="https://groups.google.com/forum/#!forum/ripple-server">https://groups.google.com/forum/#!forum/ripple-server</a></p>
|
||
<h2 id="connecting-to-rippled">Connecting to rippled</h2>
|
||
<p>Before you can run any commands against a <code>rippled</code> server, you must know which server you are connecting to. Most servers are configured not to accept API requests directly from the outside network.</p>
|
||
<p>Alternatively, you can <a href="tutorial-rippled-setup.html">run your own local copy of <code>rippled</code></a>. This is required if you want to access any of the <a href="#list-of-admin-commands">Admin Commands</a>. In this case, you should use whatever IP and port you configured the server to bind. (For example, <code>127.0.0.1:54321</code>) Additionally, to access admin functionality, you must connect from a port/IP address marked as admin in the config file.</p>
|
||
<p>The <a href="https://github.com/ripple/rippled/blob/d7def5509d8338b1e46c0adf309b5912e5168af0/doc/rippled-example.cfg#L831-L854">example config file</a> listens for connections on the local loopback network (127.0.0.1), with JSON-RPC (HTTP) on port 5005 and WebSocket (WS) on port 6006, and treats all connected clients as admin.</p>
|
||
<h3 id="websocket-api">WebSocket API</h3>
|
||
<p>If you are looking to try out some methods on the Ripple Consensus Ledger, you can skip writing your own WebSocket code and go straight to using the API at the <a href="ripple-api-tool.html">Ripple WebSocket API Tool</a>. Later on, when you want to connect to your own <code>rippled</code> server, you can build your own client in Javascript to run in a browser (See <a href="http://www.websocket.org/echo.html">this example</a> ) or possibly <a href="https://github.com/einaros/ws">Node.js</a>.</p>
|
||
<h4 id="request-formatting">Request Formatting</h4>
|
||
<p>After you open a WebSocket to the <code>rippled</code> server, you can send commands as a <a href="http://www.w3schools.com/json/">JSON</a> object, with the following attributes:</p>
|
||
<ul>
|
||
<li>Put command name in top-level <code>"command"</code> field</li>
|
||
<li>All the relevant parameters for the command are also in the top level</li>
|
||
<li>Optionally include an <code>"id"</code> field with an arbitrary value. The response to this request uses the same <code>"id"</code> field. This way, even if responses arrive out of order, you know which request prompted which response.</li>
|
||
</ul>
|
||
<p>The response comes as a JSON object.</p>
|
||
<h4 id="public-servers">Public Servers</h4>
|
||
<p>Currently Ripple (the company) maintains a set of public WebSocket servers at:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Domain</th>
|
||
<th>Port</th>
|
||
<th>Notes</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>s1.ripple.com</td>
|
||
<td>443</td>
|
||
<td><code>wss://</code> only; general purpose server</td>
|
||
</tr>
|
||
<tr>
|
||
<td>s2.ripple.com</td>
|
||
<td>443</td>
|
||
<td><code>wss://</code> only; full-history server</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>These public servers are not for sustained or business use, and they may become unavailable at any time. For regular use, you should run your own <code>rippled</code> server or contract someone you trust to do so.</p>
|
||
<h3 id="json-rpc">JSON-RPC</h3>
|
||
<p>You can use any HTTP client (like <a href="https://addons.mozilla.org/en-US/firefox/addon/poster/">Poster for Firefox</a> or <a href="https://chrome.google.com/webstore/detail/postman-rest-client/fdmmgilgnpjigdojojpjoooidkmcomcm?hl=en">Postman for Chrome</a>) to make JSON-RPC calls a <code>rippled</code> server. Most programming languages have a library for making HTTP requests built in.</p>
|
||
<h4 id="request-formatting-1">Request Formatting</h4>
|
||
<p>To make a JSON-RPC request, send an HTTP <strong>POST</strong> request to the root path (<code>/</code>) on the port and IP where the <code>rippled</code> server is listening for JSON-RPC connections. You can use HTTP/1.0 or HTTP/1.1. If you use HTTPS, you should use TLS v1.2. For security reasons, <code>rippled</code> <em>does not support</em> SSL v3 or earlier.</p>
|
||
<p>Always include a <code>Content-Type</code> header with the value <code>application/json</code>.</p>
|
||
<p>If you plan on making multiple requests, use <a href="http://tools.ietf.org/html/rfc7230#section-6.3">Keep-Alives</a> so that you do not have to close and re-open the connection in between requests.</p>
|
||
<p>Send request body as a <a href="http://www.w3schools.com/json/">JSON</a> object with the following attributes:</p>
|
||
<ul>
|
||
<li>Put the command in the top-level <code>"method"</code> field</li>
|
||
<li>Include a top-level <code>"params"</code> field. The contents of this field should be <strong>a one-item array</strong> containing only a nested JSON object with all the parameters for the command.</li>
|
||
</ul>
|
||
<p>The response is also a JSON object.</p>
|
||
<h4 id="public-servers-1">Public Servers</h4>
|
||
<p>Currently, Ripple (the company) maintains a set of public JSON-RPC servers at:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Domain</th>
|
||
<th>Port</th>
|
||
<th>Notes</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>s1.ripple.com</td>
|
||
<td>51234</td>
|
||
<td>General purpose server</td>
|
||
</tr>
|
||
<tr>
|
||
<td>s2.ripple.com</td>
|
||
<td>51234</td>
|
||
<td>Full-history server</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>These public servers are not for sustained or business use, and they may become unavailable at any time. For regular use, you should run your own <code>rippled</code> server or contract someone you trust to do so.</p>
|
||
<h3 id="commandline">Commandline</h3>
|
||
<p>The commandline interface connects to the same service as the JSON-RPC one, so the public servers and server configuration are the same. As a commandline client, <code>rippled</code> connects to the local instance. For example:</p>
|
||
<pre><code>rippled --conf=/etc/rippled.cfg server_info
|
||
</code></pre>
|
||
<h4 id="request-formatting-2">Request Formatting</h4>
|
||
<p>The commandline puts the command after any normal (dash-prefaced) commandline options, followed by a limited set of parameters, separated by spaces. For any parameter values that might contain spaces or other unusual characters, use single-quotes to encapsulate them.</p>
|
||
<h2 id="example-request">Example Request</h2>
|
||
<div class="multicode" id="code-0"><ul class="codetabs"><li><a href="#code-0-0">WebSocket</a></li><li><a href="#code-0-1">JSON-RPC</a></li><li><a href="#code-0-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-0-0" style="position: static;"><pre><code>{
|
||
"id": 2,
|
||
"command": "account_info",
|
||
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"strict": true,
|
||
"ledger_index": "validated"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-0-1" style="position: static;"><pre><code>POST http://s1.ripple.com:51234/
|
||
{
|
||
"method": "account_info",
|
||
"params": [
|
||
{
|
||
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"strict": true,
|
||
"ledger_index": "validated"
|
||
}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-0-2" style="position: static;"><pre><code>rippled account_info r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59 validated true
|
||
</code></pre></div>
|
||
</div>
|
||
<h2 id="response-formatting">Response Formatting</h2>
|
||
<h4 id="example-successful-response">Example Successful Response</h4>
|
||
<div class="multicode" id="code-1"><ul class="codetabs"><li><a href="#code-1-0">WebSocket</a></li><li><a href="#code-1-1">JSON-RPC</a></li><li><a href="#code-1-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-1-0" style="position: static;"><pre><code>{
|
||
"id": 2,
|
||
"status": "success",
|
||
"type": "response",
|
||
"result": {
|
||
"account_data": {
|
||
"Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"Balance": "27389517749",
|
||
"Flags": 0,
|
||
"LedgerEntryType": "AccountRoot",
|
||
"OwnerCount": 18,
|
||
"PreviousTxnID": "B6B410172C0B65575D89E464AF5B99937CC568822929ABF87DA75CBD11911932",
|
||
"PreviousTxnLgrSeq": 6592159,
|
||
"Sequence": 1400,
|
||
"index": "4F83A2CF7E70F77F79A307E6A472BFC2585B806A70833CCD1C26105BAE0D6E05"
|
||
},
|
||
"ledger_index": 6760970
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-1-1" style="position: static;"><pre><code>HTTP Status: 200 OK
|
||
{
|
||
"result": {
|
||
"account_data": {
|
||
"Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"Balance": "27389517749",
|
||
"Flags": 0,
|
||
"LedgerEntryType": "AccountRoot",
|
||
"OwnerCount": 18,
|
||
"PreviousTxnID": "B6B410172C0B65575D89E464AF5B99937CC568822929ABF87DA75CBD11911932",
|
||
"PreviousTxnLgrSeq": 6592159,
|
||
"Sequence": 1400,
|
||
"index": "4F83A2CF7E70F77F79A307E6A472BFC2585B806A70833CCD1C26105BAE0D6E05"
|
||
},
|
||
"ledger_index": 6761012,
|
||
"status": "success"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-1-2" style="position: static;"><pre><code>{
|
||
"result": {
|
||
"account_data": {
|
||
"Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"Balance": "27389517749",
|
||
"Flags": 0,
|
||
"LedgerEntryType": "AccountRoot",
|
||
"OwnerCount": 18,
|
||
"PreviousTxnID": "B6B410172C0B65575D89E464AF5B99937CC568822929ABF87DA75CBD11911932",
|
||
"PreviousTxnLgrSeq": 6592159,
|
||
"Sequence": 1400,
|
||
"index": "4F83A2CF7E70F77F79A307E6A472BFC2585B806A70833CCD1C26105BAE0D6E05"
|
||
},
|
||
"ledger_index": 6761012,
|
||
"status": "success"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The fields of a successful response include:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td><code>id</code></td>
|
||
<td>(Varies)</td>
|
||
<td>(WebSocket only) ID provided in the request that prompted this response</td>
|
||
</tr>
|
||
<tr>
|
||
<td><code>status</code> (WebSocket) <br> <code>result.status</code> (JSON-RPC and Commandline)</td>
|
||
<td>String</td>
|
||
<td><code>"success"</code> if the request was successful. In the WebSocket API responses, this is included at the top level; in JSON-RPC and Commandline responses, this is included as a sub-field of the <code>"result"</code> object.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><code>type</code></td>
|
||
<td>String</td>
|
||
<td>(WebSocket only) Typically <code>"response"</code>, which indicates a successful response to a command. Asynchronous notifications use a different value such as <code>"ledgerClosed"</code> or <code>"transaction"</code>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><code>result</code></td>
|
||
<td>Object</td>
|
||
<td>The result of the query; contents vary depending on the command.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="commandline-1">Commandline</h4>
|
||
<p>The response format for commandline methods is the same as JSON-RPC responses, because they use the same interface.</p>
|
||
<h2 id="error-responses">Error Responses</h2>
|
||
<p>It is impossible to list all the possible ways an error can occur. Some may occur in the transport layer (for example, loss of network connectivity), in which case the results vary depending on what client and transport you are using. However, if the <code>rippled</code> server successfully receives your request, it tries to respond in a standardized error format.</p>
|
||
<p>Some example errors:</p>
|
||
<div class="multicode" id="code-2"><ul class="codetabs"><li><a href="#code-2-0">WebSocket</a></li><li><a href="#code-2-1">JSON-RPC</a></li><li><a href="#code-2-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-2-0" style="position: static;"><pre><code>{
|
||
"id": 3,
|
||
"status": "error",
|
||
"type": "response",
|
||
"error": "ledgerIndexMalformed",
|
||
"request": {
|
||
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"command": "account_info",
|
||
"id": 3,
|
||
"ledger_index": "-",
|
||
"strict": true
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-2-1" style="position: static;"><pre><code>HTTP Status: 200 OK
|
||
{
|
||
"result": {
|
||
"error": "ledgerIndexMalformed",
|
||
"request": {
|
||
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"command": "account_info",
|
||
"ledger_index": "-",
|
||
"strict": true
|
||
},
|
||
"status": "error"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-2-2" style="position: static;"><pre><code>{
|
||
"result": {
|
||
"error": "ledgerIndexMalformed",
|
||
"request": {
|
||
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"command": "account_info",
|
||
"ledger_index": "-",
|
||
"strict": true
|
||
},
|
||
"status": "error"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<h4 id="websocket-api-error-response-format">WebSocket API Error Response Format</h4>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>id</td>
|
||
<td>(Varies)</td>
|
||
<td>ID provided in the Web Socket request that prompted this response</td>
|
||
</tr>
|
||
<tr>
|
||
<td>status</td>
|
||
<td>String</td>
|
||
<td><code>"error"</code> if the request caused an error</td>
|
||
</tr>
|
||
<tr>
|
||
<td>type</td>
|
||
<td>String</td>
|
||
<td>Typically <code>"response"</code>, which indicates a successful response to a command.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>error</td>
|
||
<td>String</td>
|
||
<td>A unique code for the type of error that occurred</td>
|
||
</tr>
|
||
<tr>
|
||
<td>request</td>
|
||
<td>Object</td>
|
||
<td>A copy of the request that prompted this error, in JSON format. <strong>Caution:</strong> If the request contained any account secrets, they are copied here!</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="json-rpc-api-error-response-format">JSON-RPC API Error Response Format</h4>
|
||
<p>Some JSON-RPC request respond with an error code on the HTTP layer. In these cases, the response is a plain-text explanation in the response body. For example, if you forgot to specify the command in the <code>method</code> parameter, the response is like this:</p>
|
||
<pre><code>HTTP Status: 400 Bad Request
|
||
Null method
|
||
</code></pre>
|
||
<p>For other errors that returned with HTTP status code 200 OK, the responses are formatted in JSON, with the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>result</td>
|
||
<td>Object</td>
|
||
<td>Object containing the response to the query</td>
|
||
</tr>
|
||
<tr>
|
||
<td>result.error</td>
|
||
<td>String</td>
|
||
<td>A unique code for the type of error that occurred</td>
|
||
</tr>
|
||
<tr>
|
||
<td>result.status</td>
|
||
<td>String</td>
|
||
<td><code>"error"</code> if the request caused an error</td>
|
||
</tr>
|
||
<tr>
|
||
<td>result.request</td>
|
||
<td>Object</td>
|
||
<td>A copy of the request that prompted this error, in JSON format. <strong>Caution:</strong> If the request contained any account secrets, they are copied here! <strong>Note:</strong> The request is re-formatted in WebSocket format, regardless of the request made.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h3 id="caution-on-errors">Caution on Errors</h3>
|
||
<p>When your request results in an error, the entire request is copied back as part of the response, so that you can try to debug the error. However, this also includes any secrets that were passed as part of the request. When sharing error messages, be very careful not to accidentally expose important account secrets to others.</p>
|
||
<h3 id="universal-errors">Universal Errors</h3>
|
||
<p>All methods can potentially return any of the following values for the <code>error</code> code:</p>
|
||
<ul>
|
||
<li><code>unknownCmd</code> - The request does not contain a <a href="#api-methods">command</a> that the <code>rippled</code> server recognizes.</li>
|
||
<li><code>jsonInvalid</code> - (WebSocket only) The request is not a proper JSON object.<ul>
|
||
<li>JSON-RPC returns a 400 Bad Request HTTP error in this case instead.</li>
|
||
</ul>
|
||
</li>
|
||
<li><code>missingCommand</code> - (WebSocket only) The request did not specify a <code>command</code> field.<ul>
|
||
<li>JSON-RPC returns a 400 Bad Request HTTP error in this case instead.</li>
|
||
</ul>
|
||
</li>
|
||
<li><code>tooBusy</code> - The server is under too much load to do this command right now. Generally not returned if you are connected as an admin.</li>
|
||
<li><code>noNetwork</code> - The server is having trouble connecting to the rest of the Ripple Network (and is not running in stand-alone mode).</li>
|
||
<li><code>noCurrent</code> - The server does not know what the current ledger is, due to high load, network problems, validator failures, incorrect configuration, or some other problem.</li>
|
||
<li><code>noClosed</code> - The server does not have a closed ledger, typically because it has not finished starting up.</li>
|
||
<li><code>wsTextRequired</code> - (WebSocket only) The request's <a href="https://tools.ietf.org/html/rfc6455#section-5.2">opcode</a> is not text.</li>
|
||
</ul>
|
||
<h2 id="formatting-conventions">Formatting Conventions</h2>
|
||
<p>The WebSocket and JSON-RPC APIs generally take the same arguments, although they're provided in a different way (See <a href="#request-formatting">Request Formatting</a> for details). Many similar parameters appear throughout the APIs, and there are conventions for how to specify these parameters.</p>
|
||
<p>All field names are case-sensitive. In responses, fields that are taken directly from Ledger Node or Transaction objects start with upper-case letters. Other fields, including ones that are dynamically generated for a response, are lower case.</p>
|
||
<h2 id="basic-data-types">Basic Data Types</h2>
|
||
<p>Different types of objects are uniquely identified in different ways:</p>
|
||
<p><em>Accounts</em> are identified by their base-58 <a href="#addresses">Address</a>, for example <code>"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59"</code>. Addresses always start with "r". Many <code>rippled</code> methods also accept a hexadecimal representation.</p>
|
||
<p><em>Transactions</em> are identified by a <a href="#hashes">Hash</a> of the transaction's binary format. You can also identify a transaction by its sending account and <a href="#account-sequence">Sequence Number</a>.</p>
|
||
<p>Each closed <em>Ledger</em> has a <a href="#ledger-index">Ledger Index</a> and a <a href="#hashes">Hash</a> value. When <a href="#specifying-ledgers">Specifying a Ledger Instance</a> you can use either one.</p>
|
||
<h3 id="addresses">Addresses</h3>
|
||
<p>Ripple Accounts are identified by a base-58 Ripple Address, which is derived from the account's master public key. An address is represented as a String in JSON, with the following characteristics:</p>
|
||
<ul>
|
||
<li>Between 25 and 35 characters in length</li>
|
||
<li>Starts with the character <code>r</code></li>
|
||
<li>Case-sensitive</li>
|
||
<li><a href="https://wiki.ripple.com/Encodings">Base-58</a> encoded using only the following characters: <code>rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz</code> That's alphanumeric characters, excluding zero (<code>0</code>), capital O (<code>O</code>), capital I (<code>I</code>), and lowercase L (<code>l</code>).</li>
|
||
<li>Contains error-checking that makes it unlikely that a randomly-generated string is a valid address.</li>
|
||
</ul>
|
||
<h4 id="special-addresses">Special Addresses</h4>
|
||
<p>Some addresses have special meaning, or historical uses, in the Ripple Consensus Ledger. In many cases, these are "black hole" addresses, meaning the address is not derived from a known secret key. Since it is almost impossible to guess a secret key from only an address, any XRP possessed by those addresses is lost forever.</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Address</th>
|
||
<th>Name</th>
|
||
<th>Meaning</th>
|
||
<th>Black Hole?</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>rrrrrrrrrrrrrrrrrrrrrhoLvTp</td>
|
||
<td>ACCOUNT_ZERO</td>
|
||
<td>An address that is the base-58 encoding of the value <code>0</code>. In peer-to-peer communications, <code>rippled</code> uses this address as the issuer for XRP.</td>
|
||
<td>Yes</td>
|
||
</tr>
|
||
<tr>
|
||
<td>rrrrrrrrrrrrrrrrrrrrBZbvji</td>
|
||
<td>ACCOUNT_ONE</td>
|
||
<td>An address that is the base-58 encoding of the value <code>1</code>. In the ledger, <a href="reference-ledger-format.html#ripplestate">RippleState entries</a> use this address as a placeholder for the issuer of a trust line balance.</td>
|
||
<td>Yes</td>
|
||
</tr>
|
||
<tr>
|
||
<td>rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh</td>
|
||
<td>The genesis account</td>
|
||
<td>When <code>rippled</code> starts a new genesis ledger from scratch (for example, in stand-alone mode), this account holds all the XRP. This address is generated from the seed value "masterpassphrase" which is <a href="https://github.com/ripple/rippled/blob/94ed5b3a53077d815ad0dd65d490c8d37a147361/src/ripple/app/ledger/Ledger.cpp#L184">hard-coded</a>.</td>
|
||
<td>No</td>
|
||
</tr>
|
||
<tr>
|
||
<td>rrrrrrrrrrrrrrrrrNAMEtxvNvQ</td>
|
||
<td>Ripple Name reservation black-hole</td>
|
||
<td>In the past, Ripple asked users to send XRP to this account to reserve Ripple Names.</td>
|
||
<td>Yes</td>
|
||
</tr>
|
||
<tr>
|
||
<td>rrrrrrrrrrrrrrrrrrrn5RM1rHd</td>
|
||
<td>NaN Address</td>
|
||
<td>Previous versions of <a href="https://github.com/ripple/ripple-lib">ripple-lib</a> generated this address when base-58 encoding the value <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN">NaN</a>.</td>
|
||
<td>Yes</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h3 id="hashes">Hashes</h3>
|
||
<p>Many objects in Ripple, particularly transactions and ledgers, are uniquely identified by a 256-bit hash value. This value is typically calculated as a "SHA-512Half", which calculates a <a href="http://dx.doi.org/10.6028/NIST.FIPS.180-4">SHA-512</a> hash from some contents, then takes the first 64 characters of the hexadecimal representation. Since the hash of an object is derived from the contents in a way that is extremely unlikely to produce collisions, two objects with the same hash can be considered the same.</p>
|
||
<p>A Ripple hash value has the following characteristics:</p>
|
||
<ul>
|
||
<li>Exactly 64 characters in length</li>
|
||
<li><a href="https://en.wikipedia.org/wiki/Hexadecimal">Hexadecimal</a> character set: 0-9 and A-F.</li>
|
||
<li>Typically written in upper case.</li>
|
||
</ul>
|
||
<p class="devportal-callout note"><strong>Note:</strong> SHA-512Half has similar security to the officially-defined <em>SHA-512/256</em> hash function. However, Ripple's usage predates SHA-512/256 and is also easier to implement on top of an existing SHA-512 function. (As of this writing, SHA-512 support in cryptographic libraries is much more common than for SHA-512/256.)</p>
|
||
<h3 id="account-sequence">Account Sequence</h3>
|
||
<p>A Sequence number is a 32-bit unsigned integer used to identify a transaction or Offer relative to a specific account.</p>
|
||
<p>Every <a href="reference-ledger-format.html#accountroot">account object in the Ripple Consensus Ledger</a> has a Sequence number, which starts at 1. For a transaction to be relayed to the network and possibly included in a validated ledger, it must have a <code>Sequence</code> field that matches the sending account's current <code>Sequence</code> number. An account's Sequence field is incremented whenever a transaction from that account is included in a validated ledger (regardless of whether the transaction succeeded or failed). This preserves the order of transactions submitted by an account, and differentiates transactions that would otherwise be the same.</p>
|
||
<p>Every <a href="reference-ledger-format.html#offer">Offer node in the Ripple Consensus Ledger</a> is marked with the sending <code>Account</code> <a href="#addresses">Address</a> and the <code>Sequence</code> value of the <a href="reference-transaction-format.html#offercreate">OfferCreate transaction</a> that created it. These two fields, together, uniquely identify the Offer.</p>
|
||
<h3 id="ledger-index">Ledger Index</h3>
|
||
<p>A ledger index is a 32-bit unsigned integer used to identify a ledger. The ledger index is also known as the ledger's sequence number. The very first ledger was ledger index 1, and each new ledger has a ledger index 1 higher than that of the ledger immediately before it.</p>
|
||
<p>The ledger index indicates the order of the ledgers; the <a href="#hashes">Hash</a> value identifies the exact contents of the ledger. Two ledgers with the same hash are always the same. For validated ledgers, hash values and sequence numbers are equally valid and correlate 1:1. However, this is not true for in-progress ledgers:</p>
|
||
<ul>
|
||
<li>Two different <code>rippled</code> servers may have different contents for a current ledger with the same ledger index, due to latency in propagating transactions throughout the network.</li>
|
||
<li>There may be multiple closed ledger versions competing to be validated by consensus. These ledger versions have the same sequence number but different contents (and different hashes). Only one of these closed ledgers can become validated.</li>
|
||
<li>A current ledger's contents change over time, which would cause its hash to change, even though its ledger index number stays the same. The hash of a ledger is not calculated until the ledger is closed.</li>
|
||
</ul>
|
||
<h3 id="specifying-ledgers">Specifying Ledgers</h3>
|
||
<p>Many API methods require you to specify an instance of the ledger, with the data retrieved being considered up-to-date as of that particular version of the shared ledger. The commands that accept a ledger version all work the same way. There are three ways you can specify which ledger you want to use:</p>
|
||
<ol>
|
||
<li>Specify a ledger by its <a href="#ledger-index">Ledger Index</a> in the <code>ledger_index</code> parameter. Each closed ledger has an identifying sequence number that is 1 higher than the previously-validated ledger. (The Genesis Ledger has sequence number 0)</li>
|
||
<li>Specify a ledger by its <a href="#hashes">Hash</a> value in the <code>ledger_hash</code> parameter.</li>
|
||
<li>Specify a ledger by one of the following shortcuts, in the <code>ledger_index</code> parameter:<ul>
|
||
<li><code>validated</code> for the most recent ledger that has been validated by the whole network</li>
|
||
<li><code>closed</code> for the most recent ledger that has been closed for modifications and proposed for validation by the node</li>
|
||
<li><code>current</code> for the node's current working version of the ledger.</li>
|
||
</ul>
|
||
</li>
|
||
</ol>
|
||
<p>There is also a deprecated <code>ledger</code> parameter which accepts any of the above three formats. <em>Do not</em> use this parameter; it may be removed without further notice.</p>
|
||
<p>If you do not specify a ledger, the <code>current</code> (in-progress) ledger is chosen by default. If you provide more than one field specifying ledgers, the deprecated <code>ledger</code> field is used first if it exists, falling back to <code>ledger_hash</code>. The <code>ledger_index</code> field is ignored unless neither of the other two are present.</p>
|
||
<p class="devportal-callout note"><strong>Note:</strong> Do not rely on this default behavior for specifying a ledger; it is subject to change. Always specify a ledger version in the request if you can.</p>
|
||
<h2 id="currencies">Currencies</h2>
|
||
<p>There are two kinds of currencies in the Ripple Consensus Ledger: XRP, and everything else. There are many differences between the two:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>XRP</th>
|
||
<th>Issued Currencies</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>Has no issuer.</td>
|
||
<td>Always issued by a Ripple account</td>
|
||
</tr>
|
||
<tr>
|
||
<td>Specified as a string</td>
|
||
<td>Specified as an object</td>
|
||
</tr>
|
||
<tr>
|
||
<td>Tracked in <a href="reference-ledger-format.html#accountroot">accounts</a></td>
|
||
<td>Tracked in <a href="reference-ledger-format.html#ripplestate">trust lines</a></td>
|
||
</tr>
|
||
<tr>
|
||
<td>Can never be created; can only be destroyed</td>
|
||
<td>Can be issued or redeemed freely</td>
|
||
</tr>
|
||
<tr>
|
||
<td>Maximum value <code>100000000000</code> (<code>1e11</code>)</td>
|
||
<td>Maximum value <code>9999999999999999e80</code></td>
|
||
</tr>
|
||
<tr>
|
||
<td>Precise to the nearest <a href="#xrp">"drop"</a> (0.000001 XRP)</td>
|
||
<td>15 decimal digits of precision, with a minimum nonzero absolute value of <code>1000000000000000e-96</code></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p class="devportal-callout caution"><strong>Caution:</strong> Ripple uses decimal math with different precision than typical floating-point numbers, so currency amounts are always presented as strings.</p>
|
||
<h3 id="specifying-currency-amounts">Specifying Currency Amounts</h3>
|
||
<p>Some API methods require you to specify an amount of currency. Depending on whether you are dealing in the network's native XRP currency or other currency units (called <em>issuances</em>), the style for specifying it is very different.</p>
|
||
<h4 id="xrp">XRP</h4>
|
||
<p>Amounts of XRP are represented as strings. (XRP has precision equivalent to a 64-bit integer, but JSON integers are limited to 32 bits, so XRP can overflow if represented in a JSON integer.) XRP is formally specified in "drops", which are equivalent to 0.000001 (one 1-millionth) of an XRP each. Thus, to represent 1.0 XRP in a JSON document, you would write:</p>
|
||
<pre><code>"1000000"
|
||
</code></pre>
|
||
<p><strong>Do not specify XRP as an object.</strong></p>
|
||
<p>Unit tests are permitted to submit values of XRP (not drops) with a decimal point - for example, "1.23" meaning 1.23 XRP. All other cases should always specify XRP in drops, with no decimal point: e.g. "1230000" meaning 1.23 XRP.</p>
|
||
<h4 id="non-xrp">Non-XRP</h4>
|
||
<p>If you are specifying non-XRP currency (including fiat dollars, precious metals, cryptocurrencies, or other custom currency) you must specify it with a currency specification object. This is a JSON object with three fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td><code>currency</code></td>
|
||
<td>String - <a href="#currency-codes">Currency Code</a></td>
|
||
<td>Arbitrary code for currency to issue. Cannot be <code>XRP</code>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><code>value</code></td>
|
||
<td>String</td>
|
||
<td>Quoted decimal representation of the amount of currency. This can include scientific notation, such as <code>1.23e11</code> meaning 123,000,000,000. Both <code>e</code> and <code>E</code> may be used.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><code>issuer</code></td>
|
||
<td>String</td>
|
||
<td>Unique account address of the entity issuing the currency. In other words, the person or business where the currency can be redeemed.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p class="devportal-callout caution"><strong>Caution:</strong> These field names are case-sensitive.</p>
|
||
<p>For example, to represent $153.75 US dollars issued by account <code>r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59</code>, you would specify:</p>
|
||
<pre><code>{
|
||
"currency": "USD",
|
||
"value": "153.75",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59"
|
||
}
|
||
</code></pre>
|
||
<p>Unit tests are permitted to submit amounts of non-XRP currencies as a slash-separated string in the format <code>"amount/currency/issuer"</code>. All other cases should use the JSON object format above.</p>
|
||
<h4 id="specifying-currencies-without-amounts">Specifying Currencies Without Amounts</h4>
|
||
<p>If you are specifying a non-XRP currency without an amount (typically for defining an order book of currency exchange offers) you should specify it as above, but omit the <code>value</code> field.</p>
|
||
<p>If you are specifying XRP without an amount (typically for defining an order book) you should specify it as a JSON object with <em>only</em> a <code>currency</code> field. Never include an <code>issuer</code> field for XRP.</p>
|
||
<p>Finally, if the recipient account of the payment trusts multiple issuers for a currency, you can indicate that the payment should be made in any combination of issuers that the recipient accepts. To do this, specify the recipient account's address as the <code>issuer</code> value in the JSON object.</p>
|
||
<h3 id="currency-codes">Currency Codes</h3>
|
||
<p>There are two kinds of currency code in the Ripple Consensus Ledger:</p>
|
||
<ul>
|
||
<li>Three-character currency code. We recommend using all-uppercase <a href="http://www.xe.com/iso4217.php">ISO 4217 Currency Codes</a>. However, any combination of the following characters is permitted: all uppercase and lowercase letters, digits, as well as the symbols <code>?</code>, <code>!</code>, <code>@</code>, <code>#</code>, <code>$</code>, <code>%</code>, <code>^</code>, <code>&</code>, <code>*</code>, <code><</code>, <code>></code>, <code>(</code>, <code>)</code>, <code>{</code>, <code>}</code>, <code>[</code>, <code>]</code>, and <code>|</code>. The currency code <code>XRP</code> (all-uppercase) is reserved for XRP and cannot be used by issued currencies.</li>
|
||
<li>160-bit hexadecimal values, such as <code>0158415500000000C1F76FF6ECB0BAC600000000</code>, according to Ripple's internal <a href="https://wiki.ripple.com/Currency_format">Currency Format</a>. This representation is uncommon.</li>
|
||
</ul>
|
||
<h2 id="specifying-time">Specifying Time</h2>
|
||
<p>The <code>rippled</code> server and its APIs represent time as an unsigned integer. This number measures the number of seconds since the "Ripple Epoch" of January 1, 2000 (00:00 UTC). This is like the way the <a href="http://en.wikipedia.org/wiki/Unix_time">Unix epoch</a> works, except the Ripple Epoch is 946684800 seconds after the Unix Epoch.</p>
|
||
<p>Don't convert Ripple Epoch times to UNIX Epoch times in 32-bit variables: this could lead to integer overflows.</p>
|
||
<h2 id="possible-server-states">Possible Server States</h2>
|
||
<p>Depending on how the <code>rippled</code> server is configured, how long it has been running, and other factors, a server may be participating in the global Ripple Network to different degrees. This is represented as the <code>server_state</code> field in the responses to the <a href="#server-info"><code>server_info</code></a> and <a href="#server-state"><code>server_state</code></a> commands. The possible responses follow a range of ascending interaction, with each later value superseding the previous one. Their definitions are as follows (in order of increasing priority):</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Value</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>disconnected</td>
|
||
<td>The server is not connected to the Ripple Network whatsoever. It may be running in offline mode, or it may not be able to access the network for whatever reason.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>connected</td>
|
||
<td>The server believes it is connected to the network.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>syncing</td>
|
||
<td>The server is currently behind on ledger versions. (It is normal for a server to spend a few minutes catching up after you start it.)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>tracking</td>
|
||
<td>The server is in agreement with the network</td>
|
||
</tr>
|
||
<tr>
|
||
<td>full</td>
|
||
<td>The server is fully caught-up with the network and could participate in validation, but is not doing so (possibly because it has not been configured as a validator).</td>
|
||
</tr>
|
||
<tr>
|
||
<td>validating</td>
|
||
<td>The server is currently participating in validation of the ledger</td>
|
||
</tr>
|
||
<tr>
|
||
<td>proposing</td>
|
||
<td>The server is participating in validation of the ledger and currently proposing its own version.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p class="devportal-callout note"><strong>Note:</strong> The distinction between <code>full</code>, <code>validating</code>, and <code>proposing</code> is based on synchronization with the rest of the global network, and it is normal for a server to fluctuate between these states as a course of general operation.</p>
|
||
<h2 id="markers-and-pagination">Markers and Pagination</h2>
|
||
<p>Some methods return more data than can efficiently fit into one response. When there are more results than contained, the response includes a <code>marker</code> field. You can use this to retrieve more pages of data across multiple calls. In each request, pass the <code>marker</code> value from the previous response to resume from the point where you left off. If the <code>marker</code> is omitted from a response, then you have reached the end of the data set.</p>
|
||
<p>The format of the <code>marker</code> field is intentionally undefined. Each server can define a <code>marker</code> field as desired, so it may take the form of a string, a nested object, or another type. Different servers, and different methods provided by the same server, can have different <code>marker</code> definitions. Each <code>marker</code> is ephemeral, and may not work as expected after 10 minutes.</p>
|
||
<h2 id="modifying-the-ledger">Modifying the Ledger</h2>
|
||
<p>All changes to the Ripple Consensus Ledger (RCL) happen as the result of transactions. The only API methods that can change the contents of the RCL are the <a href="#submit"><code>submit</code> command</a> and the <a href="#submit-multisigned"><code>submit_multisigned</code> command</a>. Most other methods represent different ways to view the data represented in the RCL. The remaining commands generate data for your convenience. (The <a href="#wallet-propose"><code>wallet_propose</code></a>, <a href="#path-find"><code>path_find</code></a>, and <a href="#random"><code>random</code></a> commands fall into this category.)</p>
|
||
<p>For more information on the various transactions you can submit, see the <a href="reference-transaction-format.html">Transaction Format</a>.</p>
|
||
<h1 id="api-methods">API Methods</h1>
|
||
<p>API methods for the Websocket and JSON-RPC APIs are defined by command names, and are divided into Public Commands and Admin Commands. Public Commands are not necessarily meant for the general public, but they are used by any client attached to the server. (Think of Public Commands as being for members or customers of the organization running the server, while the Admin Commands are for the personnel in charge of keeping the server operational.) Public Commands include the general operations for Ripple use, including checking the state of the ledger, finding a path to connecting users, and submitting a transaction, among others. Admin Commands, on the other hand, are meant only for the operators of the server, and include commands for managing the state of the server, the nodes it uses for validation, and other administrative features.</p>
|
||
<h2 id="list-of-public-commands">List of Public Commands</h2>
|
||
<ul>
|
||
<li><a href="#account-currencies"><code>account_currencies</code> - Get a list of currencies an account can send or receive</a></li>
|
||
<li><a href="#account-info"><code>account_info</code> - Get basic data about an account</a></li>
|
||
<li><a href="#account-lines"><code>account_lines</code> - Get info about an account's trust lines</a></li>
|
||
<li><a href="#account-objects"><code>account_objects</code> - Get all ledger objects owned by an account</a></li>
|
||
<li><a href="#account-offers"><code>account_offers</code> - Get info about an account's currency exchange offers</a></li>
|
||
<li><a href="#account-tx"><code>account_tx</code> - Get info about an account's transactions</a></li>
|
||
<li><a href="#book-offers"><code>book_offers</code> - Get info about offers to exchange two currencies</a></li>
|
||
<li><a href="#gateway-balances"><code>gateway_balances</code> - Calculate total amounts issued by an account</a></li>
|
||
<li><a href="#ledger"><code>ledger</code> - Get info about a ledger version</a></li>
|
||
<li><a href="#ledger-closed"><code>ledger_closed</code> - Get the latest closed ledger version</a></li>
|
||
<li><a href="#ledger-current"><code>ledger_current</code> - Get the current working ledger version</a></li>
|
||
<li><a href="#ledger-data"><code>ledger_data</code> - Get the raw contents of a ledger version</a></li>
|
||
<li><a href="#ledger-entry"><code>ledger_entry</code> - Get one element from a ledger version</a></li>
|
||
<li><a href="#noripple-check"><code>noripple_check</code> - Get recommended changes to an account's DefaultRipple and NoRipple settings</a></li>
|
||
<li><a href="#path-find"><code>path_find</code> - Find a path for a payment between two accounts and receive updates</a></li>
|
||
<li><a href="#ping"><code>ping</code> - Confirm connectivity with the server</a></li>
|
||
<li><a href="#random"><code>random</code> - Generate a random number</a></li>
|
||
<li><a href="#ripple-path-find"><code>ripple_path_find</code> - Find a path for payment between two accounts, once</a></li>
|
||
<li><a href="#server-info"><code>server_info</code> - Retrieve status of the server in human-readable format</a></li>
|
||
<li><a href="#server-state"><code>server_state</code> - Retrieve status of the server in machine-readable format</a></li>
|
||
<li><a href="#sign"><code>sign</code> - Cryptographically sign a transaction</a></li>
|
||
<li><a href="#sign-for"><code>sign_for</code> - Contribute to a multi-signature</a></li>
|
||
<li><a href="#submit"><code>submit</code> - Send a transaction to the network</a></li>
|
||
<li><a href="#submit-multisigned"><code>submit_multisigned</code> - Send a multi-signed transaction to the network</a></li>
|
||
<li><a href="#subscribe"><code>subscribe</code> - Listen for updates about a particular subject</a></li>
|
||
<li><a href="#transaction-entry"><code>transaction_entry</code> - Retrieve info about a transaction from a particular ledger version</a></li>
|
||
<li><a href="#tx"><code>tx</code> - Retrieve info about a transaction from all the ledgers on hand</a></li>
|
||
<li><a href="#tx-history"><code>tx_history</code> - Retrieve info about all recent transactions</a></li>
|
||
<li><a href="#unsubscribe"><code>unsubscribe</code> - Stop listening for updates about a particular subject</a></li>
|
||
</ul>
|
||
<p>The <code>owner_info</code> command is deprecated. Use <a href="#account-objects"><code>account_objects</code></a> instead.</p>
|
||
<h2 id="list-of-admin-commands">List of Admin Commands</h2>
|
||
<ul>
|
||
<li><a href="#can-delete"><code>can_delete</code> - Allow online deletion of ledgers up to a specific ledger</a></li>
|
||
<li><a href="#connect"><code>connect</code> - Force the rippled server to connect to a specific peer</a></li>
|
||
<li><a href="#consensus-info"><code>consensus_info</code> - Get information about the state of consensus as it happens</a></li>
|
||
<li><a href="#feature"><code>feature</code> - Get information about protocol amendments</a></li>
|
||
<li><a href="#fee"><code>fee</code> - Get information about transaction cost</a></li>
|
||
<li><a href="#fetch-info"><code>fetch_info</code> - Get information about the server's sync with the network</a></li>
|
||
<li><a href="#get-counts"><code>get_counts</code> - Get statistics about the server's internals and memory usage</a></li>
|
||
<li><a href="#ledger-accept"><code>ledger_accept</code> - Close and advance the ledger in stand-alone mode</a></li>
|
||
<li><a href="#ledger-cleaner"><code>ledger_cleaner</code> - Configure the ledger cleaner service to check for corrupted data</a></li>
|
||
<li><a href="#ledger-request"><code>ledger_request</code> - Query a peer server for a specific ledger version</a></li>
|
||
<li><a href="#log-level"><code>log_level</code> - Get or modify log verbosity</a></li>
|
||
<li><a href="#logrotate"><code>logrotate</code> - Reopen the log file</a></li>
|
||
<li><a href="#peers"><code>peers</code> - Get information about the peer servers connected</a></li>
|
||
<li><a href="#print"><code>print</code> - Get information about internal subsystems</a></li>
|
||
<li><a href="#stop"><code>stop</code> - Shut down the rippled server</a></li>
|
||
<li><a href="#validation-create"><code>validation_create</code> - Generate keys for a new rippled validator</a></li>
|
||
<li><a href="#validation-seed"><code>validation_seed</code> - Temporarily set key to be used for validating</a></li>
|
||
<li><a href="#wallet-propose"><code>wallet_propose</code> - Generate keys for a new account</a></li>
|
||
</ul>
|
||
<p>The following admin commands are deprecated and may be removed without further notice:</p>
|
||
<ul>
|
||
<li><code>ledger_header</code> - Use the <a href="#ledger"><code>ledger</code> command</a> instead.</li>
|
||
<li><code>unl_add</code>, <code>unl_delete</code>, <code>unl_list</code>, <code>unl_load</code>, <code>unl_network</code>, <code>unl_reset</code>, <code>unl_score</code> - Use the configuration file for UNL management instead.</li>
|
||
<li><code>wallet_seed</code> - Use <a href="#wallet-propose"><code>wallet_propose</code></a> instead.</li>
|
||
</ul>
|
||
<h2 id="commandline-access">Commandline Access</h2>
|
||
<p>You can use the <code>rippled</code> application (as a separate instance) as a JSON-RPC client. In this mode, it has syntax for triggering most API methods with a single line from the command prompt, as described in each method. However, some methods or options don't have commandline syntax. For otherwise unsupported syntax, you can use the following method:</p>
|
||
<ul>
|
||
<li><a href="#json"><code>json</code> - Pass JSON through the commandline</a></li>
|
||
</ul>
|
||
<h1 id="account-information">Account Information</h1>
|
||
<p>Accounts are the core unit of authentication in the Ripple Consensus Ledger. Each account can hold balances in multiple currencies, and all transactions must be signed by an account's secret key. In order for an account to exist in a validated ledger version, it must hold a minimum reserve amount of XRP. (The <a href="concept-reserves.html">reserve for an account</a> increases with the amount of data it owns in the shared ledger.) It is expected that accounts correspond loosely to individual users.</p>
|
||
<h2 id="account-currencies">account_currencies</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/df966a9ac6dd986585ecccb206aff24452e41a30/src/ripple/rpc/handlers/AccountCurrencies.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>account_currencies</code> command retrieves a list of currencies that an account can send or receive, based on its trust lines. (This is not a thoroughly confirmed list, but it can be used to populate user interfaces.)</p>
|
||
<h4 id="request-format">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-3"><ul class="codetabs"><li><a href="#code-3-0">WebSocket</a></li><li><a href="#code-3-1">JSON-RPC</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-3-0" style="position: static;"><pre><code>{
|
||
"command": "account_currencies",
|
||
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"strict": true,
|
||
"ledger_index": "validated"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-3-1" style="position: static;"><pre><code>{
|
||
"method": "account_currencies",
|
||
"params": [
|
||
{
|
||
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"account_index": 0,
|
||
"ledger_index": "validated",
|
||
"strict": true
|
||
}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p><a class="button" href="ripple-api-tool.html#account_currencies">Try it! ></a></p>
|
||
<p>The request includes the following parameters:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>account</td>
|
||
<td>String</td>
|
||
<td>A unique identifier for the account, most commonly the account's <a href="#addresses">Address</a>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>strict</td>
|
||
<td>Boolean</td>
|
||
<td>(Optional) If true, only accept an address or public key for the account parameter. Defaults to false.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_hash</td>
|
||
<td>String</td>
|
||
<td>(Optional) A 20-byte hex string for the ledger version to use. (See <a href="#specifying-ledgers">Specifying a Ledger</a>)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>String or Unsigned Integer</td>
|
||
<td>(Optional) The sequence number of the ledger to use, or a shortcut string to choose a ledger automatically. (See <a href="#specifying-ledgers">Specifying a Ledger</a>)</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>The following field is deprecated and should not be provided: <code>account_index</code>.</p>
|
||
<h4 id="response-format">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-4"><ul class="codetabs"><li><a href="#code-4-0">WebSocket</a></li><li><a href="#code-4-1">JSON-RPC</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-4-0" style="position: static;"><pre><code>{
|
||
"result": {
|
||
"ledger_index": 11775844,
|
||
"receive_currencies": [
|
||
"BTC",
|
||
"CNY",
|
||
"DYM",
|
||
"EUR",
|
||
"JOE",
|
||
"MXN",
|
||
"USD",
|
||
"015841551A748AD2C1F76FF6ECB0CCCD00000000"
|
||
],
|
||
"send_currencies": [
|
||
"ASP",
|
||
"BTC",
|
||
"CHF",
|
||
"CNY",
|
||
"DYM",
|
||
"EUR",
|
||
"JOE",
|
||
"JPY",
|
||
"MXN",
|
||
"USD"
|
||
],
|
||
"validated": true
|
||
},
|
||
"status": "success",
|
||
"type": "response"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-4-1" style="position: static;"><pre><code>200 OK
|
||
{
|
||
"result": {
|
||
"ledger_index": 11775823,
|
||
"receive_currencies": [
|
||
"BTC",
|
||
"CNY",
|
||
"DYM",
|
||
"EUR",
|
||
"JOE",
|
||
"MXN",
|
||
"USD",
|
||
"015841551A748AD2C1F76FF6ECB0CCCD00000000"
|
||
],
|
||
"send_currencies": [
|
||
"ASP",
|
||
"BTC",
|
||
"CHF",
|
||
"CNY",
|
||
"DYM",
|
||
"EUR",
|
||
"JOE",
|
||
"JPY",
|
||
"MXN",
|
||
"USD"
|
||
],
|
||
"status": "success",
|
||
"validated": true
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>ledger_hash</td>
|
||
<td>String - <a href="#hashes">Hash</a></td>
|
||
<td>(May be omitted) The identifying hash of the ledger version used to retrieve this data, as hex.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>Integer - <a href="#ledger-index">Ledger Index</a></td>
|
||
<td>The sequence number of the ledger version used to retrieve this data.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>receive_currencies</td>
|
||
<td>Array of Strings</td>
|
||
<td>Array of <a href="#currency-codes">Currency Code</a>s for currencies that this account can receive.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>send_currencies</td>
|
||
<td>Array of Strings</td>
|
||
<td>Array of <a href="#currency-codes">Currency Code</a>s for currencies that this account can send.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>validated</td>
|
||
<td>Boolean</td>
|
||
<td>If <code>true</code>, this data comes from a validated ledger.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p class="devportal-callout note"><strong>Note:</strong> The currencies that an account can send or receive are defined based on a check of its trust lines. If an account has a trust line for a currency and enough room to increase its balance, it can receive that currency. If the trust line's balance can go down, the account can send that currency. This method <em>doesn't</em> check whether the trust line is <a href="concept-freeze.html">frozen</a> or authorized.</p>
|
||
<h4 id="possible-errors">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>invalidParams</code> - One or more fields are specified incorrectly, or one or more required fields are missing.</li>
|
||
<li><code>actNotFound</code> - The address specified in the <code>account</code> field of the request does not correspond to an account in the ledger.</li>
|
||
<li><code>lgrNotFound</code> - The ledger specified by the <code>ledger_hash</code> or <code>ledger_index</code> does not exist, or it does exist but the server does not have it.</li>
|
||
</ul>
|
||
<h2 id="account-info">account_info</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/AccountInfo.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>account_info</code> command retrieves information about an account, its activity, and its XRP balance. All information retrieved is relative to a particular version of the ledger.</p>
|
||
<h4 id="request-format-1">Request Format</h4>
|
||
<p>An example of an account_info request:</p>
|
||
<div class="multicode" id="code-5"><ul class="codetabs"><li><a href="#code-5-0">WebSocket</a></li><li><a href="#code-5-1">JSON-RPC</a></li><li><a href="#code-5-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-5-0" style="position: static;"><pre><code>{
|
||
"id": 2,
|
||
"command": "account_info",
|
||
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"strict": true,
|
||
"ledger_index": "validated"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-5-1" style="position: static;"><pre><code>{
|
||
"method": "account_info",
|
||
"params": [
|
||
{
|
||
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"strict": true,
|
||
"ledger_index": "validated"
|
||
}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-5-2" style="position: static;"><pre><code>#Syntax: account_info account [ledger_index|ledger_hash] [strict]
|
||
rippled account_info r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59 true
|
||
</code></pre></div>
|
||
</div>
|
||
<p><a class="button" href="ripple-api-tool.html#account_info">Try it! ></a></p>
|
||
<p>The request contains the following parameters:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>account</td>
|
||
<td>String</td>
|
||
<td>A unique identifier for the account, most commonly the account's <a href="#addresses">Address</a>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>strict</td>
|
||
<td>Boolean</td>
|
||
<td>(Optional, defaults to False) If set to True, then the <code>account</code> field only accepts a public key or Ripple address.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_hash</td>
|
||
<td>String</td>
|
||
<td>(Optional) A 20-byte hex string for the ledger version to use. (See <a href="#specifying-ledgers">Specifying a Ledger</a>)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>String or Unsigned Integer</td>
|
||
<td>(Optional) The sequence number of the ledger to use, or a shortcut string to choose a ledger automatically. (See <a href="#specifying-ledgers">Specifying a Ledger</a>)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>signer_lists</td>
|
||
<td>Boolean</td>
|
||
<td>(Optional) If <code>true</code>, and the <a href="concept-amendments.html#multisign">MultiSign amendment</a> is enabled, also returns any <a href="reference-ledger-format.html#signerlist">SignerList objects</a> associated with this account. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.31.0">version 0.31.0</a>)</em></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>The following fields are deprecated and should not be provided: <code>ident</code>, <code>ledger</code>.</p>
|
||
<h4 id="response-format-1">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-6"><ul class="codetabs"><li><a href="#code-6-0">WebSocket</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-6-0" style="position: static;"><pre><code>{
|
||
"id": 5,
|
||
"status": "success",
|
||
"type": "response",
|
||
"result": {
|
||
"account_data": {
|
||
"Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"Balance": "27389517749",
|
||
"Flags": 0,
|
||
"LedgerEntryType": "AccountRoot",
|
||
"OwnerCount": 18,
|
||
"PreviousTxnID": "2F804E1A00DBCBDAFBDB7D001409F79FE196785EB68FBA463E5924002BE4DEE9",
|
||
"PreviousTxnLgrSeq": 6405716,
|
||
"Sequence": 1400,
|
||
"index": "4F83A2CF7E70F77F79A307E6A472BFC2585B806A70833CCD1C26105BAE0D6E05"
|
||
},
|
||
"ledger_current_index": 6507948
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with the result containing the requested account, its data, and a ledger to which it applies, as the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>account_data</td>
|
||
<td>Object</td>
|
||
<td>The <a href="reference-ledger-format.html#accountroot">AccountRoot ledger node</a> with this account's information, as stored in the ledger.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>signer_lists</td>
|
||
<td>Array</td>
|
||
<td>(Omitted unless the request specified <code>signer_lists</code> and at least one SignerList is associated with the account.) Array of <a href="reference-ledger-format.html#signerlist">SignerList ledger nodes</a> associated with this account for <a href="reference-transaction-format.html#multi-signing">Multi-Signing</a>. Since an account can own at most 1 SignerList, this array should always have exactly 1 member if it is present. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.31.0">version 0.31.0</a>)</em></td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_current_index</td>
|
||
<td>Integer</td>
|
||
<td>(Omitted if <code>ledger_index</code> is provided instead) The sequence number of the most-current ledger, which was used when retrieving this information. The information does not contain any changes from ledgers newer than this one.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>Integer</td>
|
||
<td>(Omitted if <code>ledger_current_index</code> is provided instead) The sequence number of the ledger used when retrieving this information. The information does not contain any changes from ledgers newer than this one.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>validated</td>
|
||
<td>Boolean</td>
|
||
<td>True if this data is from a validated ledger version; if omitted or set to false, this data is not final. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.26.0">version 0.26.0</a>)</em></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="possible-errors-1">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>invalidParams</code> - One or more fields are specified incorrectly, or one or more required fields are missing.</li>
|
||
<li><code>actNotFound</code> - The address specified in the <code>account</code> field of the request does not correspond to an account in the ledger.</li>
|
||
<li><code>lgrNotFound</code> - The ledger specified by the <code>ledger_hash</code> or <code>ledger_index</code> does not exist, or it does exist but the server does not have it.</li>
|
||
</ul>
|
||
<h2 id="account-lines">account_lines</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/AccountLines.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>account_lines</code> method returns information about the account's lines of trust, including balances in all non-XRP currencies and assets. All information retrieved is relative to a particular version of the ledger.</p>
|
||
<h4 id="request-format-2">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-7"><ul class="codetabs"><li><a href="#code-7-0">WebSocket</a></li><li><a href="#code-7-1">JSON-RPC</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-7-0" style="position: static;"><pre><code>{
|
||
"id": 1,
|
||
"command": "account_lines",
|
||
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"ledger": "current"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-7-1" style="position: static;"><pre><code>{
|
||
"method": "account_lines",
|
||
"params": [
|
||
{
|
||
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"ledger": "current"
|
||
}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p><a class="button" href="ripple-api-tool.html#account_lines">Try it! ></a></p>
|
||
<p>The request accepts the following paramters:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>account</td>
|
||
<td>String</td>
|
||
<td>A unique identifier for the account, most commonly the account's <a href="#addresses">Address</a>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_hash</td>
|
||
<td>String</td>
|
||
<td>(Optional) A 20-byte hex string for the ledger version to use. (See <a href="#specifying-ledgers">Specifying a Ledger</a>)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>String or Unsigned Integer</td>
|
||
<td>(Optional) The sequence number of the ledger to use, or a shortcut string to choose a ledger automatically. (See <a href="#specifying-ledgers">Specifying a Ledger</a>)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>peer</td>
|
||
<td>String</td>
|
||
<td>(Optional) The <a href="#addresses">Address</a> of a second account. If provided, show only lines of trust connecting the two accounts.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>limit</td>
|
||
<td>Integer</td>
|
||
<td>(Optional, default varies) Limit the number of transactions to retrieve. The server is not required to honor this value. Cannot be smaller than 10 or larger than 400. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.26.4">version 0.26.4</a>)</em></td>
|
||
</tr>
|
||
<tr>
|
||
<td>marker</td>
|
||
<td><a href="#markers-and-pagination">(Not Specified)</a></td>
|
||
<td>(Optional) Server-provided value to specify where to resume retrieving data from. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.26.4">version 0.26.4</a>)</em></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>The following parameters are deprecated and may be removed without further notice: <code>ledger</code> and <code>peer_index</code>.</p>
|
||
<h4 id="response-format-2">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-8"><ul class="codetabs"><li><a href="#code-8-0">WebSocket</a></li><li><a href="#code-8-1">JSON-RPC</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-8-0" style="position: static;"><pre><code>{
|
||
"id": 1,
|
||
"status": "success",
|
||
"type": "response",
|
||
"result": {
|
||
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"lines": [
|
||
{
|
||
"account": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
|
||
"balance": "0",
|
||
"currency": "ASP",
|
||
"limit": "0",
|
||
"limit_peer": "10",
|
||
"quality_in": 0,
|
||
"quality_out": 0
|
||
},
|
||
{
|
||
"account": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
|
||
"balance": "0",
|
||
"currency": "XAU",
|
||
"limit": "0",
|
||
"limit_peer": "0",
|
||
"no_ripple": true,
|
||
"no_ripple_peer": true,
|
||
"quality_in": 0,
|
||
"quality_out": 0
|
||
},
|
||
{
|
||
"account": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
||
"balance": "3.497605752725159",
|
||
"currency": "USD",
|
||
"limit": "5",
|
||
"limit_peer": "0",
|
||
"no_ripple": true,
|
||
"quality_in": 0,
|
||
"quality_out": 0
|
||
}
|
||
]
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-8-1" style="position: static;"><pre><code>200 OK
|
||
{
|
||
"result": {
|
||
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"lines": [
|
||
{
|
||
"account": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
|
||
"balance": "0",
|
||
"currency": "ASP",
|
||
"limit": "0",
|
||
"limit_peer": "10",
|
||
"quality_in": 0,
|
||
"quality_out": 0
|
||
},
|
||
{
|
||
"account": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
|
||
"balance": "0",
|
||
"currency": "XAU",
|
||
"limit": "0",
|
||
"limit_peer": "0",
|
||
"no_ripple": true,
|
||
"no_ripple_peer": true,
|
||
"quality_in": 0,
|
||
"quality_out": 0
|
||
},
|
||
{
|
||
"account": "rs9M85karFkCRjvc6KMWn8Coigm9cbcgcx",
|
||
"balance": "0",
|
||
"currency": "015841551A748AD2C1F76FF6ECB0CCCD00000000",
|
||
"limit": "10.01037626125837",
|
||
"limit_peer": "0",
|
||
"no_ripple": true,
|
||
"quality_in": 0,
|
||
"quality_out": 0
|
||
}
|
||
],
|
||
"status": "success"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing the address of the account and an array of trust-line objects. Specifically, the result object contains the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>account</td>
|
||
<td>String</td>
|
||
<td>Unique <a href="#addresses">Address</a> of the account this request corresponds to. This is the "perspective account" for purpose of the trust lines.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>lines</td>
|
||
<td>Array</td>
|
||
<td>Array of trust-line objects, as described below. If the number of trust-lines is large, only returns up to the <code>limit</code> at a time.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_current_index</td>
|
||
<td>Integer</td>
|
||
<td>(Omitted if <code>ledger_hash</code> or <code>ledger_index</code> provided) Sequence number of the ledger version used when retrieving this data. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.26.4-sp1">version 0.26.4-sp1</a>)</em></td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>Integer</td>
|
||
<td>(Omitted if <code>ledger_current_index</code> provided instead) Sequence number, provided in the request, of the ledger version that was used when retrieving this data. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.26.4-sp1">version 0.26.4-sp1</a>)</em></td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_hash</td>
|
||
<td>String</td>
|
||
<td>(May be omitted) Hex hash, provided in the request, of the ledger version that was used when retrieving this data. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.26.4-sp1">version 0.26.4-sp1</a>)</em></td>
|
||
</tr>
|
||
<tr>
|
||
<td>marker</td>
|
||
<td><a href="#markers-and-pagination">(Not Specified)</a></td>
|
||
<td>Server-defined value. Pass this to the next call to resume where this call left off. Omitted when there are no additional pages after this one. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.26.4">version 0.26.4</a>)</em></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>Each trust-line object has some combination of the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>account</td>
|
||
<td>String</td>
|
||
<td>The unique <a href="#addresses">Address</a> of the counterparty to this trust line.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>balance</td>
|
||
<td>String</td>
|
||
<td>Representation of the numeric balance currently held against this line. A positive balance means that the perspective account holds value; a negative balance means that the perspective account owes value.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>currency</td>
|
||
<td>String</td>
|
||
<td>A <a href="#currency-codes">Currency Code</a> identifying what currency this trust line can hold.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>limit</td>
|
||
<td>String</td>
|
||
<td>The maximum amount of the given currency that this account is willing to owe the peer account</td>
|
||
</tr>
|
||
<tr>
|
||
<td>limit_peer</td>
|
||
<td>String</td>
|
||
<td>The maximum amount of currency that the counterparty account is willing to owe the perspective account</td>
|
||
</tr>
|
||
<tr>
|
||
<td>quality_in</td>
|
||
<td>Unsigned Integer</td>
|
||
<td>Rate at which the account values incoming balances on this trust line, as a ratio of this value per 1 billion units. (For example, a value of 500 million represents a 0.5:1 ratio.) As a special case, 0 is treated as a 1:1 ratio.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>quality_out</td>
|
||
<td>Unsigned Integer</td>
|
||
<td>Rate at which the account values outgoing balances on this trust line, as a ratio of this value per 1 billion units. (For example, a value of 500 million represents a 0.5:1 ratio.) As a special case, 0 is treated as a 1:1 ratio.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>no_ripple</td>
|
||
<td>Boolean</td>
|
||
<td>(May be omitted) <code>true</code> if this account has enabled the <a href="concept-noripple.html">NoRipple flag</a> for this line. If omitted, that is the same as <code>false</code>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>no_ripple_peer</td>
|
||
<td>Boolean</td>
|
||
<td>(May be omitted) <code>true</code> if the peer account has enabled the <a href="concept-noripple.html">NoRipple flag</a>. If omitted, that is the same as <code>false</code>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>freeze</td>
|
||
<td>Boolean</td>
|
||
<td>(May be omitted) <code>true</code> if this account has <a href="concept-freeze.html">frozen</a> this trust line. If omitted, that is the same as <code>false</code>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>freeze_peer</td>
|
||
<td>Boolean</td>
|
||
<td>(May be omitted) <code>true</code> if the peer account has <a href="concept-freeze.html">frozen</a> this trust line. If omitted, that is the same as <code>false</code>.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="possible-errors-2">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>invalidParams</code> - One or more fields are specified incorrectly, or one or more required fields are missing.</li>
|
||
<li><code>actNotFound</code> - The <a href="#addresses">Address</a> specified in the <code>account</code> field of the request does not correspond to an account in the ledger.</li>
|
||
<li><code>lgrNotFound</code> - The ledger specified by the <code>ledger_hash</code> or <code>ledger_index</code> does not exist, or it does exist but the server does not have it.</li>
|
||
<li><code>actMalformed</code> - If the <code>marker</code> field provided is not acceptable.</li>
|
||
</ul>
|
||
<h2 id="account-offers">account_offers</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/AccountOffers.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>account_offers</code> method retrieves a list of offers made by a given account that are outstanding as of a particular ledger version.</p>
|
||
<h4 id="request-format-3">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-9"><ul class="codetabs"><li><a href="#code-9-0">WebSocket</a></li><li><a href="#code-9-1">JSON-RPC</a></li><li><a href="#code-9-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-9-0" style="position: static;"><pre><code>{
|
||
"id": 2,
|
||
"command": "account_offers",
|
||
"account": "rpP2JgiMyTF5jR5hLG3xHCPi1knBb1v9cM",
|
||
"ledger": "current"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-9-1" style="position: static;"><pre><code>{
|
||
"method": "account_offers",
|
||
"params": [
|
||
{
|
||
"account": "rpP2JgiMyTF5jR5hLG3xHCPi1knBb1v9cM",
|
||
"ledger_index": "current"
|
||
}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-9-2" style="position: static;"><pre><code>#Syntax: account_offers account [ledger_index]
|
||
rippled account_offers r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59 current
|
||
</code></pre></div>
|
||
</div>
|
||
<p><a class="button" href="ripple-api-tool.html#account_offers">Try it! ></a></p>
|
||
<p>A request can include the following parameters:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>account</td>
|
||
<td>String</td>
|
||
<td>A unique identifier for the account, most commonly the account's <a href="#addresses">Address</a>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger</td>
|
||
<td>Unsigned integer, or String</td>
|
||
<td>(Deprecated, Optional) A unique identifier for the ledger version to use, such as a ledger sequence number, a hash, or a shortcut such as "validated".</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_hash</td>
|
||
<td>String</td>
|
||
<td>(Optional) A 20-byte hex string identifying the ledger version to use.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>(Optional) <a href="#ledger-index">Ledger Index</a></td>
|
||
<td>(Optional, defaults to <code>current</code>) The sequence number of the ledger to use, or "current", "closed", or "validated" to select a ledger dynamically. (See <a href="#specifying-ledgers">Specifying Ledgers</a>)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>limit</td>
|
||
<td>Integer</td>
|
||
<td>(Optional, default varies) Limit the number of transactions to retrieve. The server is not required to honor this value. Cannot be lower than 10 or higher than 400. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.26.4">version 0.26.4</a>)</em></td>
|
||
</tr>
|
||
<tr>
|
||
<td>marker</td>
|
||
<td><a href="#markers-and-pagination">(Not Specified)</a></td>
|
||
<td>Server-provided value to specify where to resume retrieving data from. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.26.4">version 0.26.4</a>)</em></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>The following parameter is deprecated and may be removed without further notice: <code>ledger</code>.</p>
|
||
<h4 id="response-format-3">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-10"><ul class="codetabs"><li><a href="#code-10-0">WebSocket</a></li><li><a href="#code-10-1">JSON-RPC</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-10-0" style="position: static;"><pre><code>{
|
||
"id": 9,
|
||
"status": "success",
|
||
"type": "response",
|
||
"result": {
|
||
"account": "rpP2JgiMyTF5jR5hLG3xHCPi1knBb1v9cM",
|
||
"ledger_current_index": 18539550,
|
||
"offers": [
|
||
{
|
||
"flags": 0,
|
||
"quality": "0.00000000574666765650638",
|
||
"seq": 6577664,
|
||
"taker_gets": "33687728098",
|
||
"taker_pays": {
|
||
"currency": "EUR",
|
||
"issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq",
|
||
"value": "193.5921774819578"
|
||
}
|
||
},
|
||
{
|
||
"flags": 0,
|
||
"quality": "7989247009094510e-27",
|
||
"seq": 6572128,
|
||
"taker_gets": "2361918758",
|
||
"taker_pays": {
|
||
"currency": "XAU",
|
||
"issuer": "rrh7rf1gV2pXAoqA8oYbpHd8TKv5ZQeo67",
|
||
"value": "0.01886995237307572"
|
||
}
|
||
},
|
||
|
||
...
|
||
|
||
],
|
||
"validated": false
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-10-1" style="position: static;"><pre><code>200 OK
|
||
{
|
||
"result": {
|
||
"account": "rpP2JgiMyTF5jR5hLG3xHCPi1knBb1v9cM",
|
||
"ledger_current_index": 18539596,
|
||
"offers": [{
|
||
"flags": 0,
|
||
"quality": "0.000000007599140009999998",
|
||
"seq": 6578020,
|
||
"taker_gets": "29740867287",
|
||
"taker_pays": {
|
||
"currency": "USD",
|
||
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
||
"value": "226.0050145327418"
|
||
}
|
||
}, {
|
||
"flags": 0,
|
||
"quality": "7989247009094510e-27",
|
||
"seq": 6572128,
|
||
"taker_gets": "2361918758",
|
||
"taker_pays": {
|
||
"currency": "XAU",
|
||
"issuer": "rrh7rf1gV2pXAoqA8oYbpHd8TKv5ZQeo67",
|
||
"value": "0.01886995237307572"
|
||
}
|
||
}, {
|
||
"flags": 0,
|
||
"quality": "0.00000004059594001318974",
|
||
"seq": 6576905,
|
||
"taker_gets": "3892952574",
|
||
"taker_pays": {
|
||
"currency": "CNY",
|
||
"issuer": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y",
|
||
"value": "158.0380691682966"
|
||
}
|
||
},
|
||
|
||
...
|
||
|
||
],
|
||
"status": "success",
|
||
"validated": false
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>account</td>
|
||
<td>String</td>
|
||
<td>Unique <a href="#addresses">Address</a> identifying the account that made the offers</td>
|
||
</tr>
|
||
<tr>
|
||
<td>offers</td>
|
||
<td>Array</td>
|
||
<td>Array of objects, where each object represents an offer made by this account that is outstanding as of the requested ledger version. If the number of offers is large, only returns up to <code>limit</code> at a time.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_current_index</td>
|
||
<td>Integer</td>
|
||
<td>(Omitted if <code>ledger_hash</code> or <code>ledger_index</code> provided) Sequence number of the ledger version used when retrieving this data. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.26.4-sp1">version 0.26.4-sp1</a>)</em></td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>Integer</td>
|
||
<td>(Omitted if <code>ledger_current_index</code> provided instead) Sequence number, provided in the request, of the ledger version that was used when retrieving this data. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.26.4-sp1">version 0.26.4-sp1</a>)</em></td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_hash</td>
|
||
<td>String</td>
|
||
<td>(May be omitted) Hex hash, provided in the request, of the ledger version that was used when retrieving this data. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.26.4-sp1">version 0.26.4-sp1</a>)</em></td>
|
||
</tr>
|
||
<tr>
|
||
<td>marker</td>
|
||
<td><a href="#markers-and-pagination">(Not Specified)</a></td>
|
||
<td>Server-defined value. Pass this to the next call to resume where this call left off. Omitted when there are no pages of information after this one. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.26.4">version 0.26.4</a>)</em></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>Each offer object contains the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>flags</td>
|
||
<td>Unsigned integer</td>
|
||
<td>Options set for this offer entry as bit-flags.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>seq</td>
|
||
<td>Unsigned integer</td>
|
||
<td>Sequence number of the transaction that created this entry. (Transaction <a href="#account-sequence">sequence numbers</a> are relative to accounts.)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>taker_gets</td>
|
||
<td>String or Object</td>
|
||
<td>The amount the account accepting the offer receives, as a String representing an amount in XRP, or a currency specification object. (See <a href="#specifying-currency-amounts">Specifying Currency Amounts</a>)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>taker_pays</td>
|
||
<td>String or Object</td>
|
||
<td>The amount the account accepting the offer provides, as a String representing an amount in XRP, or a currency specification object. (See <a href="#specifying-currency-amounts">Specifying Currency Amounts</a>)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>quality</td>
|
||
<td>Number</td>
|
||
<td>The exchange rate of the offer, as the ratio of the original <code>taker_pays</code> divided by the original <code>taker_gets</code>. When executing offers, the offer with the most favorable (lowest) quality is consumed first; offers with the same quality are executed from oldest to newest. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.29.0">version 0.29.0</a>)</em></td>
|
||
</tr>
|
||
<tr>
|
||
<td>expiration</td>
|
||
<td>Unsigned integer</td>
|
||
<td>(May be omitted) A time after which this offer is considered unfunded, as <a href="#specifying-time">the number of seconds since the Ripple Epoch</a>. See also: <a href="reference-transaction-format.html#expiration">Offer Expiration</a>. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.30.1">version 0.30.1</a>)</em></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="possible-errors-3">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>invalidParams</code> - One or more fields are specified incorrectly, or one or more required fields are missing.</li>
|
||
<li><code>actNotFound</code> - The <a href="#addresses">Address</a> specified in the <code>account</code> field of the request does not correspond to an account in the ledger.</li>
|
||
<li><code>lgrNotFound</code> - The ledger specified by the <code>ledger_hash</code> or <code>ledger_index</code> does not exist, or it does exist but the server does not have it.</li>
|
||
<li><code>actMalformed</code> - If the <code>marker</code> field provided is not acceptable.</li>
|
||
</ul>
|
||
<h2 id="account-objects">account_objects</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/399c43cae6e90a428e9ce6a988123972b0f03c99/src/ripple/rpc/handlers/AccountObjects.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>account_objects</code> command returns the raw <a href="reference-ledger-format.html">ledger format</a> for all objects owned by an account, such as <a href="reference-transaction-format.html#lifecycle-of-an-offer">outstanding offers</a>, trust lines in non-default state, and <a href="reference-transaction-format.html#multi-signing">signer lists</a>. For getting the balance of an account's trust lines, we recommend <a href="#account-lines"><code>account_lines</code></a> instead.</p>
|
||
<h4 id="request-format-4">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-11"><ul class="codetabs"><li><a href="#code-11-0">WebSocket</a></li><li><a href="#code-11-1">JSON-RPC</a></li><li><a href="#code-11-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-11-0" style="position: static;"><pre><code>{
|
||
"id": 1,
|
||
"command": "account_objects",
|
||
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"ledger_index": "validated",
|
||
"type": "state",
|
||
"limit": 10
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-11-1" style="position: static;"><pre><code>{
|
||
"method": "account_objects",
|
||
"params": [
|
||
{
|
||
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"ledger_index": "validated",
|
||
"limit": 10,
|
||
"type": "state"
|
||
}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-11-2" style="position: static;"><pre><code>#Syntax: account_objects <account> [<ledger>]
|
||
rippled account_objects r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59 validated
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The request includes the following parameters:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>account</td>
|
||
<td>String</td>
|
||
<td>A unique identifier for the account, most commonly the account's address.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>type</td>
|
||
<td>String</td>
|
||
<td>(Optional) If included, filter results to include only this type of ledger node. Valid types include <code>state</code> (trust lines), <code>offer</code> (offers), and <code>ticket</code> (part of the forthcoming signing process).</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_hash</td>
|
||
<td>String</td>
|
||
<td>(Optional) A 20-byte hex string for the ledger version to use. (See <a href="#specifying-ledgers">Specifying a Ledger</a>)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>String or Unsigned Integer</td>
|
||
<td>(Optional) The sequence number of the ledger to use, or a shortcut string to choose a ledger automatically. (See <a href="#specifying-ledgers">Specifying a Ledger</a>)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>limit</td>
|
||
<td>Unsigned Integer</td>
|
||
<td>(Optional) The maximum number of objects to include in the results. Cannot be less than 10 or higher than 400 on non-admin connections. Defaults to 200.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>marker</td>
|
||
<td><a href="#markers-and-pagination">(Not Specified)</a></td>
|
||
<td>(Optional) Server-provided value to specify where to resume retrieving data from.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="response-format-4">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-12"><ul class="codetabs"><li><a href="#code-12-0">WebSocket</a></li><li><a href="#code-12-1">JSON-RPC</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-12-0" style="position: static;"><pre><code>{
|
||
"id": 8,
|
||
"status": "success",
|
||
"type": "response",
|
||
"result": {
|
||
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"account_objects": [
|
||
{
|
||
"Balance": {
|
||
"currency": "ASP",
|
||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||
"value": "0"
|
||
},
|
||
"Flags": 65536,
|
||
"HighLimit": {
|
||
"currency": "ASP",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "0"
|
||
},
|
||
"HighNode": "0000000000000000",
|
||
"LedgerEntryType": "RippleState",
|
||
"LowLimit": {
|
||
"currency": "ASP",
|
||
"issuer": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
|
||
"value": "10"
|
||
},
|
||
"LowNode": "0000000000000000",
|
||
"PreviousTxnID": "BF7555B0F018E3C5E2A3FF9437A1A5092F32903BE246202F988181B9CED0D862",
|
||
"PreviousTxnLgrSeq": 1438879,
|
||
"index": "2243B0B630EA6F7330B654EFA53E27A7609D9484E535AB11B7F946DF3D247CE9"
|
||
},
|
||
{
|
||
"Balance": {
|
||
"currency": "XAU",
|
||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||
"value": "0"
|
||
},
|
||
"Flags": 3342336,
|
||
"HighLimit": {
|
||
"currency": "XAU",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "0"
|
||
},
|
||
"HighNode": "0000000000000000",
|
||
"LedgerEntryType": "RippleState",
|
||
"LowLimit": {
|
||
"currency": "XAU",
|
||
"issuer": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
|
||
"value": "0"
|
||
},
|
||
"LowNode": "0000000000000000",
|
||
"PreviousTxnID": "79B26D7D34B950AC2C2F91A299A6888FABB376DD76CFF79D56E805BF439F6942",
|
||
"PreviousTxnLgrSeq": 5982530,
|
||
"index": "9ED4406351B7A511A012A9B5E7FE4059FA2F7650621379C0013492C315E25B97"
|
||
},
|
||
{
|
||
"Balance": {
|
||
"currency": "USD",
|
||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||
"value": "0"
|
||
},
|
||
"Flags": 1114112,
|
||
"HighLimit": {
|
||
"currency": "USD",
|
||
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
||
"value": "0"
|
||
},
|
||
"HighNode": "0000000000000000",
|
||
"LedgerEntryType": "RippleState",
|
||
"LowLimit": {
|
||
"currency": "USD",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "5"
|
||
},
|
||
"LowNode": "0000000000000000",
|
||
"PreviousTxnID": "6FE8C824364FB1195BCFEDCB368DFEE3980F7F78D3BF4DC4174BB4C86CF8C5CE",
|
||
"PreviousTxnLgrSeq": 10555014,
|
||
"index": "2DECFAC23B77D5AEA6116C15F5C6D4669EBAEE9E7EE050A40FE2B1E47B6A9419"
|
||
},
|
||
{
|
||
"Balance": {
|
||
"currency": "MXN",
|
||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||
"value": "481.992867407479"
|
||
},
|
||
"Flags": 65536,
|
||
"HighLimit": {
|
||
"currency": "MXN",
|
||
"issuer": "rHpXfibHgSb64n8kK9QWDpdbfqSpYbM9a4",
|
||
"value": "0"
|
||
},
|
||
"HighNode": "0000000000000000",
|
||
"LedgerEntryType": "RippleState",
|
||
"LowLimit": {
|
||
"currency": "MXN",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "1000"
|
||
},
|
||
"LowNode": "0000000000000000",
|
||
"PreviousTxnID": "A467BACE5F183CDE1F075F72435FE86BAD8626ED1048EDEFF7562A4CC76FD1C5",
|
||
"PreviousTxnLgrSeq": 3316170,
|
||
"index": "EC8B9B6B364AF6CB6393A423FDD2DDBA96375EC772E6B50A3581E53BFBDFDD9A"
|
||
},
|
||
{
|
||
"Balance": {
|
||
"currency": "EUR",
|
||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||
"value": "0.793598266778297"
|
||
},
|
||
"Flags": 1114112,
|
||
"HighLimit": {
|
||
"currency": "EUR",
|
||
"issuer": "rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun",
|
||
"value": "0"
|
||
},
|
||
"HighNode": "0000000000000000",
|
||
"LedgerEntryType": "RippleState",
|
||
"LowLimit": {
|
||
"currency": "EUR",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "1"
|
||
},
|
||
"LowNode": "0000000000000000",
|
||
"PreviousTxnID": "E9345D44433EA368CFE1E00D84809C8E695C87FED18859248E13662D46A0EC46",
|
||
"PreviousTxnLgrSeq": 5447146,
|
||
"index": "4513749B30F4AF8DA11F077C448128D6486BF12854B760E4E5808714588AA915"
|
||
},
|
||
{
|
||
"Balance": {
|
||
"currency": "CNY",
|
||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||
"value": "0"
|
||
},
|
||
"Flags": 2228224,
|
||
"HighLimit": {
|
||
"currency": "CNY",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "3"
|
||
},
|
||
"HighNode": "0000000000000000",
|
||
"LedgerEntryType": "RippleState",
|
||
"LowLimit": {
|
||
"currency": "CNY",
|
||
"issuer": "rnuF96W4SZoCJmbHYBFoJZpR8eCaxNvekK",
|
||
"value": "0"
|
||
},
|
||
"LowNode": "0000000000000008",
|
||
"PreviousTxnID": "2FDDC81F4394695B01A47913BEC4281AC9A283CC8F903C14ADEA970F60E57FCF",
|
||
"PreviousTxnLgrSeq": 5949673,
|
||
"index": "578C327DA8944BDE2E10C9BA36AFA2F43E06C8D1E8819FB225D266CBBCFDE5CE"
|
||
},
|
||
{
|
||
"Balance": {
|
||
"currency": "DYM",
|
||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||
"value": "1.336889190631542"
|
||
},
|
||
"Flags": 65536,
|
||
"HighLimit": {
|
||
"currency": "DYM",
|
||
"issuer": "rGwUWgN5BEg3QGNY3RX2HfYowjUTZdid3E",
|
||
"value": "0"
|
||
},
|
||
"HighNode": "0000000000000000",
|
||
"LedgerEntryType": "RippleState",
|
||
"LowLimit": {
|
||
"currency": "DYM",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "3"
|
||
},
|
||
"LowNode": "0000000000000000",
|
||
"PreviousTxnID": "6DA2BD02DFB83FA4DAFC2651860B60071156171E9C021D9E0372A61A477FFBB1",
|
||
"PreviousTxnLgrSeq": 8818732,
|
||
"index": "5A2A5FF12E71AEE57564E624117BBA68DEF78CD564EF6259F92A011693E027C7"
|
||
},
|
||
{
|
||
"Balance": {
|
||
"currency": "CHF",
|
||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||
"value": "-0.3488146605801446"
|
||
},
|
||
"Flags": 131072,
|
||
"HighLimit": {
|
||
"currency": "CHF",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "0"
|
||
},
|
||
"HighNode": "0000000000000000",
|
||
"LedgerEntryType": "RippleState",
|
||
"LowLimit": {
|
||
"currency": "CHF",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"value": "0"
|
||
},
|
||
"LowNode": "000000000000008C",
|
||
"PreviousTxnID": "722394372525A13D1EAAB005642F50F05A93CF63F7F472E0F91CDD6D38EB5869",
|
||
"PreviousTxnLgrSeq": 2687590,
|
||
"index": "F2DBAD20072527F6AD02CE7F5A450DBC72BE2ABB91741A8A3ADD30D5AD7A99FB"
|
||
},
|
||
{
|
||
"Balance": {
|
||
"currency": "BTC",
|
||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||
"value": "0"
|
||
},
|
||
"Flags": 131072,
|
||
"HighLimit": {
|
||
"currency": "BTC",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "3"
|
||
},
|
||
"HighNode": "0000000000000000",
|
||
"LedgerEntryType": "RippleState",
|
||
"LowLimit": {
|
||
"currency": "BTC",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"value": "0"
|
||
},
|
||
"LowNode": "0000000000000043",
|
||
"PreviousTxnID": "03EDF724397D2DEE70E49D512AECD619E9EA536BE6CFD48ED167AE2596055C9A",
|
||
"PreviousTxnLgrSeq": 8317037,
|
||
"index": "767C12AF647CDF5FEB9019B37018748A79C50EDAF87E8D4C7F39F78AA7CA9765"
|
||
},
|
||
{
|
||
"Balance": {
|
||
"currency": "USD",
|
||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||
"value": "-16.00534471983042"
|
||
},
|
||
"Flags": 131072,
|
||
"HighLimit": {
|
||
"currency": "USD",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "5000"
|
||
},
|
||
"HighNode": "0000000000000000",
|
||
"LedgerEntryType": "RippleState",
|
||
"LowLimit": {
|
||
"currency": "USD",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"value": "0"
|
||
},
|
||
"LowNode": "000000000000004A",
|
||
"PreviousTxnID": "CFFF5CFE623C9543308C6529782B6A6532207D819795AAFE85555DB8BF390FE7",
|
||
"PreviousTxnLgrSeq": 14365854,
|
||
"index": "826CF5BFD28F3934B518D0BDF3231259CBD3FD0946E3C3CA0C97D2C75D2D1A09"
|
||
}
|
||
],
|
||
"ledger_hash": "053DF17D2289D1C4971C22F235BC1FCA7D4B3AE966F842E5819D0749E0B8ECD3",
|
||
"ledger_index": 14378733,
|
||
"limit": 10,
|
||
"marker": "F60ADF645E78B69857D2E4AEC8B7742FEABC8431BD8611D099B428C3E816DF93,94A9F05FEF9A153229E2E997E64919FD75AAE2028C8153E8EBDB4440BD3ECBB5",
|
||
"validated": true
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-12-1" style="position: static;"><pre><code>200 OK
|
||
{
|
||
"result": {
|
||
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"account_objects": [
|
||
{
|
||
"Balance": {
|
||
"currency": "ASP",
|
||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||
"value": "0"
|
||
},
|
||
"Flags": 65536,
|
||
"HighLimit": {
|
||
"currency": "ASP",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "0"
|
||
},
|
||
"HighNode": "0000000000000000",
|
||
"LedgerEntryType": "RippleState",
|
||
"LowLimit": {
|
||
"currency": "ASP",
|
||
"issuer": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
|
||
"value": "10"
|
||
},
|
||
"LowNode": "0000000000000000",
|
||
"PreviousTxnID": "BF7555B0F018E3C5E2A3FF9437A1A5092F32903BE246202F988181B9CED0D862",
|
||
"PreviousTxnLgrSeq": 1438879,
|
||
"index": "2243B0B630EA6F7330B654EFA53E27A7609D9484E535AB11B7F946DF3D247CE9"
|
||
},
|
||
{
|
||
"Balance": {
|
||
"currency": "XAU",
|
||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||
"value": "0"
|
||
},
|
||
"Flags": 3342336,
|
||
"HighLimit": {
|
||
"currency": "XAU",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "0"
|
||
},
|
||
"HighNode": "0000000000000000",
|
||
"LedgerEntryType": "RippleState",
|
||
"LowLimit": {
|
||
"currency": "XAU",
|
||
"issuer": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
|
||
"value": "0"
|
||
},
|
||
"LowNode": "0000000000000000",
|
||
"PreviousTxnID": "79B26D7D34B950AC2C2F91A299A6888FABB376DD76CFF79D56E805BF439F6942",
|
||
"PreviousTxnLgrSeq": 5982530,
|
||
"index": "9ED4406351B7A511A012A9B5E7FE4059FA2F7650621379C0013492C315E25B97"
|
||
},
|
||
{
|
||
"Balance": {
|
||
"currency": "USD",
|
||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||
"value": "0"
|
||
},
|
||
"Flags": 1114112,
|
||
"HighLimit": {
|
||
"currency": "USD",
|
||
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
||
"value": "0"
|
||
},
|
||
"HighNode": "0000000000000000",
|
||
"LedgerEntryType": "RippleState",
|
||
"LowLimit": {
|
||
"currency": "USD",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "5"
|
||
},
|
||
"LowNode": "0000000000000000",
|
||
"PreviousTxnID": "6FE8C824364FB1195BCFEDCB368DFEE3980F7F78D3BF4DC4174BB4C86CF8C5CE",
|
||
"PreviousTxnLgrSeq": 10555014,
|
||
"index": "2DECFAC23B77D5AEA6116C15F5C6D4669EBAEE9E7EE050A40FE2B1E47B6A9419"
|
||
},
|
||
{
|
||
"Balance": {
|
||
"currency": "MXN",
|
||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||
"value": "481.992867407479"
|
||
},
|
||
"Flags": 65536,
|
||
"HighLimit": {
|
||
"currency": "MXN",
|
||
"issuer": "rHpXfibHgSb64n8kK9QWDpdbfqSpYbM9a4",
|
||
"value": "0"
|
||
},
|
||
"HighNode": "0000000000000000",
|
||
"LedgerEntryType": "RippleState",
|
||
"LowLimit": {
|
||
"currency": "MXN",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "1000"
|
||
},
|
||
"LowNode": "0000000000000000",
|
||
"PreviousTxnID": "A467BACE5F183CDE1F075F72435FE86BAD8626ED1048EDEFF7562A4CC76FD1C5",
|
||
"PreviousTxnLgrSeq": 3316170,
|
||
"index": "EC8B9B6B364AF6CB6393A423FDD2DDBA96375EC772E6B50A3581E53BFBDFDD9A"
|
||
},
|
||
{
|
||
"Balance": {
|
||
"currency": "EUR",
|
||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||
"value": "0.793598266778297"
|
||
},
|
||
"Flags": 1114112,
|
||
"HighLimit": {
|
||
"currency": "EUR",
|
||
"issuer": "rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun",
|
||
"value": "0"
|
||
},
|
||
"HighNode": "0000000000000000",
|
||
"LedgerEntryType": "RippleState",
|
||
"LowLimit": {
|
||
"currency": "EUR",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "1"
|
||
},
|
||
"LowNode": "0000000000000000",
|
||
"PreviousTxnID": "E9345D44433EA368CFE1E00D84809C8E695C87FED18859248E13662D46A0EC46",
|
||
"PreviousTxnLgrSeq": 5447146,
|
||
"index": "4513749B30F4AF8DA11F077C448128D6486BF12854B760E4E5808714588AA915"
|
||
},
|
||
{
|
||
"Balance": {
|
||
"currency": "CNY",
|
||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||
"value": "0"
|
||
},
|
||
"Flags": 2228224,
|
||
"HighLimit": {
|
||
"currency": "CNY",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "3"
|
||
},
|
||
"HighNode": "0000000000000000",
|
||
"LedgerEntryType": "RippleState",
|
||
"LowLimit": {
|
||
"currency": "CNY",
|
||
"issuer": "rnuF96W4SZoCJmbHYBFoJZpR8eCaxNvekK",
|
||
"value": "0"
|
||
},
|
||
"LowNode": "0000000000000008",
|
||
"PreviousTxnID": "2FDDC81F4394695B01A47913BEC4281AC9A283CC8F903C14ADEA970F60E57FCF",
|
||
"PreviousTxnLgrSeq": 5949673,
|
||
"index": "578C327DA8944BDE2E10C9BA36AFA2F43E06C8D1E8819FB225D266CBBCFDE5CE"
|
||
},
|
||
{
|
||
"Balance": {
|
||
"currency": "DYM",
|
||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||
"value": "1.336889190631542"
|
||
},
|
||
"Flags": 65536,
|
||
"HighLimit": {
|
||
"currency": "DYM",
|
||
"issuer": "rGwUWgN5BEg3QGNY3RX2HfYowjUTZdid3E",
|
||
"value": "0"
|
||
},
|
||
"HighNode": "0000000000000000",
|
||
"LedgerEntryType": "RippleState",
|
||
"LowLimit": {
|
||
"currency": "DYM",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "3"
|
||
},
|
||
"LowNode": "0000000000000000",
|
||
"PreviousTxnID": "6DA2BD02DFB83FA4DAFC2651860B60071156171E9C021D9E0372A61A477FFBB1",
|
||
"PreviousTxnLgrSeq": 8818732,
|
||
"index": "5A2A5FF12E71AEE57564E624117BBA68DEF78CD564EF6259F92A011693E027C7"
|
||
},
|
||
{
|
||
"Balance": {
|
||
"currency": "CHF",
|
||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||
"value": "-0.3488146605801446"
|
||
},
|
||
"Flags": 131072,
|
||
"HighLimit": {
|
||
"currency": "CHF",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "0"
|
||
},
|
||
"HighNode": "0000000000000000",
|
||
"LedgerEntryType": "RippleState",
|
||
"LowLimit": {
|
||
"currency": "CHF",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"value": "0"
|
||
},
|
||
"LowNode": "000000000000008C",
|
||
"PreviousTxnID": "722394372525A13D1EAAB005642F50F05A93CF63F7F472E0F91CDD6D38EB5869",
|
||
"PreviousTxnLgrSeq": 2687590,
|
||
"index": "F2DBAD20072527F6AD02CE7F5A450DBC72BE2ABB91741A8A3ADD30D5AD7A99FB"
|
||
},
|
||
{
|
||
"Balance": {
|
||
"currency": "BTC",
|
||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||
"value": "0"
|
||
},
|
||
"Flags": 131072,
|
||
"HighLimit": {
|
||
"currency": "BTC",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "3"
|
||
},
|
||
"HighNode": "0000000000000000",
|
||
"LedgerEntryType": "RippleState",
|
||
"LowLimit": {
|
||
"currency": "BTC",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"value": "0"
|
||
},
|
||
"LowNode": "0000000000000043",
|
||
"PreviousTxnID": "03EDF724397D2DEE70E49D512AECD619E9EA536BE6CFD48ED167AE2596055C9A",
|
||
"PreviousTxnLgrSeq": 8317037,
|
||
"index": "767C12AF647CDF5FEB9019B37018748A79C50EDAF87E8D4C7F39F78AA7CA9765"
|
||
},
|
||
{
|
||
"Balance": {
|
||
"currency": "USD",
|
||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||
"value": "-16.00534471983042"
|
||
},
|
||
"Flags": 131072,
|
||
"HighLimit": {
|
||
"currency": "USD",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "5000"
|
||
},
|
||
"HighNode": "0000000000000000",
|
||
"LedgerEntryType": "RippleState",
|
||
"LowLimit": {
|
||
"currency": "USD",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"value": "0"
|
||
},
|
||
"LowNode": "000000000000004A",
|
||
"PreviousTxnID": "CFFF5CFE623C9543308C6529782B6A6532207D819795AAFE85555DB8BF390FE7",
|
||
"PreviousTxnLgrSeq": 14365854,
|
||
"index": "826CF5BFD28F3934B518D0BDF3231259CBD3FD0946E3C3CA0C97D2C75D2D1A09"
|
||
}
|
||
],
|
||
"ledger_hash": "4C99E5F63C0D0B1C2283B4F5DCE2239F80CE92E8B1A6AED1E110C198FC96E659",
|
||
"ledger_index": 14380380,
|
||
"limit": 10,
|
||
"marker": "F60ADF645E78B69857D2E4AEC8B7742FEABC8431BD8611D099B428C3E816DF93,94A9F05FEF9A153229E2E997E64919FD75AAE2028C8153E8EBDB4440BD3ECBB5",
|
||
"status": "success",
|
||
"validated": true
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>account</td>
|
||
<td>String</td>
|
||
<td>Unique <a href="#addresses">Address</a> of the account this request corresponds to</td>
|
||
</tr>
|
||
<tr>
|
||
<td>account_objects</td>
|
||
<td>Array</td>
|
||
<td>Array of objects owned by this account. Each object is in its raw <a href="reference-ledger-format.html">ledger format</a>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_hash</td>
|
||
<td>String</td>
|
||
<td>(May be omitted) The identifying hash of the ledger that was used to generate this response.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>Number</td>
|
||
<td>(May be omitted) The sequence number of the ledger version that was used to generate this response.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_current_index</td>
|
||
<td>Number</td>
|
||
<td>(May be omitted) The sequence number of the current in-progress ledger version that was used to generate this response.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>limit</td>
|
||
<td>Number</td>
|
||
<td>(May be omitted) The limit that was used in this request, if any.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>marker</td>
|
||
<td><a href="#markers-and-pagination">(Not Specified)</a></td>
|
||
<td>Server-defined value. Pass this to the next call to resume where this call left off. Omitted when there are no additional pages after this one.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>validated</td>
|
||
<td>Boolean</td>
|
||
<td>If <code>true</code>, this information comes from ledger version that has been validated by consensus.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="possible-errors-4">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>invalidParams</code> - One or more fields are specified incorrectly, or one or more required fields are missing.</li>
|
||
<li><code>actNotFound</code> - The <a href="#addresses">Address</a> specified in the <code>account</code> field of the request does not correspond to an account in the ledger.</li>
|
||
<li><code>lgrNotFound</code> - The ledger specified by the <code>ledger_hash</code> or <code>ledger_index</code> does not exist, or it does exist but the server does not have it.</li>
|
||
</ul>
|
||
<h2 id="account-tx">account_tx</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/AccountTx.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>account_tx</code> method retrieves a list of transactions that involved the specified account.</p>
|
||
<h4 id="request-format-5">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-13"><ul class="codetabs"><li><a href="#code-13-0">WebSocket</a></li><li><a href="#code-13-1">JSON-RPC</a></li><li><a href="#code-13-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-13-0" style="position: static;"><pre><code>{
|
||
"id": 2,
|
||
"command": "account_tx",
|
||
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"ledger_index_min": -1,
|
||
"ledger_index_max": -1,
|
||
"binary": false,
|
||
"count": false,
|
||
"limit": 2,
|
||
"forward": false
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-13-1" style="position: static;"><pre><code>{
|
||
"method": "account_tx",
|
||
"params": [
|
||
{
|
||
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"binary": false,
|
||
"count": false,
|
||
"descending": false,
|
||
"forward": false,
|
||
"ledger_index_max": -1,
|
||
"ledger_index_min": -1,
|
||
"limit": 2,
|
||
"offset": 1
|
||
}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-13-2" style="position: static;"><pre><code>#Syntax account_tx account [ledger_index_min [ledger_index_max [limit]]] [binary] [count] [forward]
|
||
rippled account_tx r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59 -1 -1 2 false false false
|
||
</code></pre></div>
|
||
</div>
|
||
<p><a class="button" href="ripple-api-tool.html#account_tx">Try it! ></a></p>
|
||
<p>The request includes the following parameters:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>account</td>
|
||
<td>String</td>
|
||
<td>A unique identifier for the account, most commonly the account's address.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index_min</td>
|
||
<td>Integer</td>
|
||
<td>Use to specify the earliest ledger to include transactions from. A value of <code>-1</code> instructs the server to use the earliest validated ledger version available.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index_max</td>
|
||
<td>Integer</td>
|
||
<td>Use to specify the most recent ledger to include transactions from. A value of <code>-1</code> instructs the server to use the most recent validated ledger version available.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_hash</td>
|
||
<td>String</td>
|
||
<td>(Optional) Use instead of ledger_index_min and ledger_index_max to look for transactions from a single ledger only. (See <a href="#specifying-ledgers">Specifying a Ledger</a>)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>String or Unsigned Integer</td>
|
||
<td>(Optional) Use instead of ledger_index_min and ledger_index_max to look for transactions from a single ledger only. (See <a href="#specifying-ledgers">Specifying a Ledger</a>)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>binary</td>
|
||
<td>Boolean</td>
|
||
<td>(Optional, defaults to False) If set to True, return transactions as hex strings instead of JSON.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>forward</td>
|
||
<td>boolean</td>
|
||
<td>(Optional, defaults to False) If set to True, return values indexed with the oldest ledger first. Otherwise, the results are indexed with the newest ledger first. (Each page of results may not be internally ordered, but the pages are overall ordered.)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>limit</td>
|
||
<td>Integer</td>
|
||
<td>(Optional, default varies) Limit the number of transactions to retrieve. The server is not required to honor this value.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>marker</td>
|
||
<td><a href="#markers-and-pagination">(Not Specified)</a></td>
|
||
<td>Server-provided value to specify where to resume retrieving data from. This value is stable even if there is a change in the server's range of available ledgers.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p><a href="https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/AccountTxSwitch.cpp" title="Source">[Source]<br/></a>
|
||
There is also a deprecated legacy variation of the <code>account_tx</code> method. For that reason, we recommend <em>not using any of the following fields</em>: <code>offset</code>, <code>count</code>, <code>descending</code>, <code>ledger_max</code>, <code>ledger_min</code>.</p>
|
||
<h5 id="iterating-over-queried-data"><strong>Iterating over queried data</strong></h5>
|
||
<p>As with other paginated methods, you can use the <code>marker</code> field to return multiple pages of data.</p>
|
||
<p>In the time between requests, <code>"ledger_index_min": -1</code> and <code>"ledger_index_max": -1</code> may change to refer to different ledger versions than they did before. The <code>marker</code> field can safely paginate even if there are changes in the ledger range from the request, so long as the marker does not indicate a point outside the range of ledgers specified in the request.</p>
|
||
<h4 id="response-format-5">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-14"><ul class="codetabs"><li><a href="#code-14-0">WebSocket</a></li><li><a href="#code-14-1">JSON-RPC</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-14-0" style="position: static;"><pre><code>{
|
||
"id": 2,
|
||
"status": "success",
|
||
"type": "response",
|
||
"result": {
|
||
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"ledger_index_max": 6542489,
|
||
"ledger_index_min": 32570,
|
||
"limit": 2,
|
||
"offset": 1,
|
||
"transactions": [
|
||
{
|
||
"meta": {
|
||
"AffectedNodes": [
|
||
{
|
||
"ModifiedNode": {
|
||
"FinalFields": {
|
||
"Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"Balance": "9999999980",
|
||
"Flags": 0,
|
||
"OwnerCount": 2,
|
||
"Sequence": 3
|
||
},
|
||
"LedgerEntryType": "AccountRoot",
|
||
"LedgerIndex": "4F83A2CF7E70F77F79A307E6A472BFC2585B806A70833CCD1C26105BAE0D6E05",
|
||
"PreviousFields": {
|
||
"Balance": "9999999990",
|
||
"OwnerCount": 1,
|
||
"Sequence": 2
|
||
},
|
||
"PreviousTxnID": "389720F6FD8A144F171708F9ECB334D704CBCFEFBCDA152D931AC34FB5F9E32B",
|
||
"PreviousTxnLgrSeq": 95405
|
||
}
|
||
},
|
||
{
|
||
"CreatedNode": {
|
||
"LedgerEntryType": "RippleState",
|
||
"LedgerIndex": "718C6D58DD3BBAAAEBFE48B8FBE3C32C9F6F2EBC395233BA95D0057078EE07DB",
|
||
"NewFields": {
|
||
"Balance": {
|
||
"currency": "USD",
|
||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||
"value": "0"
|
||
},
|
||
"Flags": 131072,
|
||
"HighLimit": {
|
||
"currency": "USD",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "100"
|
||
},
|
||
"LowLimit": {
|
||
"currency": "USD",
|
||
"issuer": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV",
|
||
"value": "0"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"ModifiedNode": {
|
||
"FinalFields": {
|
||
"Flags": 0,
|
||
"Owner": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV",
|
||
"RootIndex": "77F65EFF930ED7E93C6CC839C421E394D6B1B6A47CEA8A140D63EC9C712F46F5"
|
||
},
|
||
"LedgerEntryType": "DirectoryNode",
|
||
"LedgerIndex": "77F65EFF930ED7E93C6CC839C421E394D6B1B6A47CEA8A140D63EC9C712F46F5"
|
||
}
|
||
},
|
||
{
|
||
"ModifiedNode": {
|
||
"FinalFields": {
|
||
"Account": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV",
|
||
"Balance": "78991384535796",
|
||
"Flags": 0,
|
||
"OwnerCount": 3,
|
||
"Sequence": 188
|
||
},
|
||
"LedgerEntryType": "AccountRoot",
|
||
"LedgerIndex": "B33FDD5CF3445E1A7F2BE9B06336BEBD73A5E3EE885D3EF93F7E3E2992E46F1A",
|
||
"PreviousTxnID": "E9E1988A0F061679E5D14DE77DB0163CE0BBDC00F29E396FFD1DA0366E7D8904",
|
||
"PreviousTxnLgrSeq": 195455
|
||
}
|
||
},
|
||
{
|
||
"ModifiedNode": {
|
||
"FinalFields": {
|
||
"ExchangeRate": "4E11C37937E08000",
|
||
"Flags": 0,
|
||
"RootIndex": "F60ADF645E78B69857D2E4AEC8B7742FEABC8431BD8611D099B428C3E816DF93",
|
||
"TakerGetsCurrency": "0000000000000000000000000000000000000000",
|
||
"TakerGetsIssuer": "0000000000000000000000000000000000000000",
|
||
"TakerPaysCurrency": "0000000000000000000000004254430000000000",
|
||
"TakerPaysIssuer": "5E7B112523F68D2F5E879DB4EAC51C6698A69304"
|
||
},
|
||
"LedgerEntryType": "DirectoryNode",
|
||
"LedgerIndex": "F60ADF645E78B69857D2E4AEC8B7742FEABC8431BD8611D099B428C3E816DF93"
|
||
}
|
||
}
|
||
],
|
||
"TransactionIndex": 0,
|
||
"TransactionResult": "tesSUCCESS"
|
||
},
|
||
"tx": {
|
||
"Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"Fee": "10",
|
||
"Flags": 0,
|
||
"LimitAmount": {
|
||
"currency": "USD",
|
||
"issuer": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV",
|
||
"value": "100"
|
||
},
|
||
"Sequence": 2,
|
||
"SigningPubKey": "02BC8C02199949B15C005B997E7C8594574E9B02BA2D0628902E0532989976CF9D",
|
||
"TransactionType": "TrustSet",
|
||
"TxnSignature": "304402200EF81EC32E0DFA9BE376B20AFCA11765ED9FEA04CA8B77C7178DAA699F7F5AFF02202DA484DBD66521AC317D84F7717EC4614E2F5DB743E313E8B48440499CC0DBA4",
|
||
"date": 413620090,
|
||
"hash": "002AA492496A1543DBD3680BF8CF21B6D6A078CE4A01D2C1A4B63778033792CE",
|
||
"inLedger": 195480,
|
||
"ledger_index": 195480
|
||
},
|
||
"validated": true
|
||
},
|
||
{
|
||
"meta": {
|
||
"AffectedNodes": [
|
||
{
|
||
"ModifiedNode": {
|
||
"FinalFields": {
|
||
"Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"Balance": "9999999970",
|
||
"Flags": 0,
|
||
"OwnerCount": 3,
|
||
"Sequence": 4
|
||
},
|
||
"LedgerEntryType": "AccountRoot",
|
||
"LedgerIndex": "4F83A2CF7E70F77F79A307E6A472BFC2585B806A70833CCD1C26105BAE0D6E05",
|
||
"PreviousFields": {
|
||
"Balance": "9999999980",
|
||
"OwnerCount": 2,
|
||
"Sequence": 3
|
||
},
|
||
"PreviousTxnID": "002AA492496A1543DBD3680BF8CF21B6D6A078CE4A01D2C1A4B63778033792CE",
|
||
"PreviousTxnLgrSeq": 195480
|
||
}
|
||
},
|
||
{
|
||
"ModifiedNode": {
|
||
"FinalFields": {
|
||
"Flags": 0,
|
||
"Owner": "r3PDtZSa5LiYp1Ysn1vMuMzB59RzV3W9QH",
|
||
"RootIndex": "A39F044D860C5B5846AA7E0FAAD44DC8897F0A62B2F628AA073B21B3EC146010"
|
||
},
|
||
"LedgerEntryType": "DirectoryNode",
|
||
"LedgerIndex": "A39F044D860C5B5846AA7E0FAAD44DC8897F0A62B2F628AA073B21B3EC146010"
|
||
}
|
||
},
|
||
{
|
||
"ModifiedNode": {
|
||
"LedgerEntryType": "AccountRoot",
|
||
"LedgerIndex": "E0D7BDE68B468FF0B8D948FD865576517DA987569833A05374ADB9A72E870A06",
|
||
"PreviousTxnID": "0222B59280D165D40C464EA75AAD08A4D152C46A38C0625DEECF6EE87FC5B9E1",
|
||
"PreviousTxnLgrSeq": 343555
|
||
}
|
||
},
|
||
{
|
||
"CreatedNode": {
|
||
"LedgerEntryType": "RippleState",
|
||
"LedgerIndex": "EA4BF03B4700123CDFFB6EB09DC1D6E28D5CEB7F680FB00FC24BC1C3BB2DB959",
|
||
"NewFields": {
|
||
"Balance": {
|
||
"currency": "USD",
|
||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||
"value": "0"
|
||
},
|
||
"Flags": 131072,
|
||
"HighLimit": {
|
||
"currency": "USD",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "100"
|
||
},
|
||
"LowLimit": {
|
||
"currency": "USD",
|
||
"issuer": "r3PDtZSa5LiYp1Ysn1vMuMzB59RzV3W9QH",
|
||
"value": "0"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"ModifiedNode": {
|
||
"FinalFields": {
|
||
"ExchangeRate": "4E11C37937E08000",
|
||
"Flags": 0,
|
||
"RootIndex": "F60ADF645E78B69857D2E4AEC8B7742FEABC8431BD8611D099B428C3E816DF93",
|
||
"TakerGetsCurrency": "0000000000000000000000000000000000000000",
|
||
"TakerGetsIssuer": "0000000000000000000000000000000000000000",
|
||
"TakerPaysCurrency": "0000000000000000000000004254430000000000",
|
||
"TakerPaysIssuer": "5E7B112523F68D2F5E879DB4EAC51C6698A69304"
|
||
},
|
||
"LedgerEntryType": "DirectoryNode",
|
||
"LedgerIndex": "F60ADF645E78B69857D2E4AEC8B7742FEABC8431BD8611D099B428C3E816DF93"
|
||
}
|
||
}
|
||
],
|
||
"TransactionIndex": 0,
|
||
"TransactionResult": "tesSUCCESS"
|
||
},
|
||
"tx": {
|
||
"Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"Fee": "10",
|
||
"Flags": 0,
|
||
"LimitAmount": {
|
||
"currency": "USD",
|
||
"issuer": "r3PDtZSa5LiYp1Ysn1vMuMzB59RzV3W9QH",
|
||
"value": "100"
|
||
},
|
||
"Sequence": 3,
|
||
"SigningPubKey": "02BC8C02199949B15C005B997E7C8594574E9B02BA2D0628902E0532989976CF9D",
|
||
"TransactionType": "TrustSet",
|
||
"TxnSignature": "3044022058A89552068D1A274EE72BA71363E33E54E6608BC28A84DEC6EE530FC2B5C979022029F4D1EA1237A1F717C5F5EC526E6CFB6DF54C30BADD25EDDE7D2FDBC8F17E34",
|
||
"date": 416347560,
|
||
"hash": "53354D84BAE8FDFC3F4DA879D984D24B929E7FEB9100D2AD9EFCD2E126BCCDC8",
|
||
"inLedger": 343570,
|
||
"ledger_index": 343570
|
||
},
|
||
"validated": true
|
||
}
|
||
],
|
||
"validated": true
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-14-1" style="position: static;"><pre><code>200 OK
|
||
{
|
||
"result": {
|
||
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"ledger_index_max": 8696227,
|
||
"ledger_index_min": 32570,
|
||
"limit": 2,
|
||
"offset": 1,
|
||
"status": "success",
|
||
"transactions": [
|
||
{
|
||
"meta": {
|
||
"AffectedNodes": [
|
||
{
|
||
"ModifiedNode": {
|
||
"FinalFields": {
|
||
"Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"Balance": "9999999980",
|
||
"Flags": 0,
|
||
"OwnerCount": 2,
|
||
"Sequence": 3
|
||
},
|
||
"LedgerEntryType": "AccountRoot",
|
||
"LedgerIndex": "4F83A2CF7E70F77F79A307E6A472BFC2585B806A70833CCD1C26105BAE0D6E05",
|
||
"PreviousFields": {
|
||
"Balance": "9999999990",
|
||
"OwnerCount": 1,
|
||
"Sequence": 2
|
||
},
|
||
"PreviousTxnID": "389720F6FD8A144F171708F9ECB334D704CBCFEFBCDA152D931AC34FB5F9E32B",
|
||
"PreviousTxnLgrSeq": 95405
|
||
}
|
||
},
|
||
{
|
||
"CreatedNode": {
|
||
"LedgerEntryType": "RippleState",
|
||
"LedgerIndex": "718C6D58DD3BBAAAEBFE48B8FBE3C32C9F6F2EBC395233BA95D0057078EE07DB",
|
||
"NewFields": {
|
||
"Balance": {
|
||
"currency": "USD",
|
||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||
"value": "0"
|
||
},
|
||
"Flags": 131072,
|
||
"HighLimit": {
|
||
"currency": "USD",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "100"
|
||
},
|
||
"LowLimit": {
|
||
"currency": "USD",
|
||
"issuer": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV",
|
||
"value": "0"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"ModifiedNode": {
|
||
"FinalFields": {
|
||
"Flags": 0,
|
||
"Owner": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV",
|
||
"RootIndex": "77F65EFF930ED7E93C6CC839C421E394D6B1B6A47CEA8A140D63EC9C712F46F5"
|
||
},
|
||
"LedgerEntryType": "DirectoryNode",
|
||
"LedgerIndex": "77F65EFF930ED7E93C6CC839C421E394D6B1B6A47CEA8A140D63EC9C712F46F5"
|
||
}
|
||
},
|
||
{
|
||
"ModifiedNode": {
|
||
"FinalFields": {
|
||
"Account": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV",
|
||
"Balance": "78991384535796",
|
||
"Flags": 0,
|
||
"OwnerCount": 3,
|
||
"Sequence": 188
|
||
},
|
||
"LedgerEntryType": "AccountRoot",
|
||
"LedgerIndex": "B33FDD5CF3445E1A7F2BE9B06336BEBD73A5E3EE885D3EF93F7E3E2992E46F1A",
|
||
"PreviousTxnID": "E9E1988A0F061679E5D14DE77DB0163CE0BBDC00F29E396FFD1DA0366E7D8904",
|
||
"PreviousTxnLgrSeq": 195455
|
||
}
|
||
},
|
||
{
|
||
"ModifiedNode": {
|
||
"FinalFields": {
|
||
"ExchangeRate": "4E11C37937E08000",
|
||
"Flags": 0,
|
||
"RootIndex": "F60ADF645E78B69857D2E4AEC8B7742FEABC8431BD8611D099B428C3E816DF93",
|
||
"TakerGetsCurrency": "0000000000000000000000000000000000000000",
|
||
"TakerGetsIssuer": "0000000000000000000000000000000000000000",
|
||
"TakerPaysCurrency": "0000000000000000000000004254430000000000",
|
||
"TakerPaysIssuer": "5E7B112523F68D2F5E879DB4EAC51C6698A69304"
|
||
},
|
||
"LedgerEntryType": "DirectoryNode",
|
||
"LedgerIndex": "F60ADF645E78B69857D2E4AEC8B7742FEABC8431BD8611D099B428C3E816DF93"
|
||
}
|
||
}
|
||
],
|
||
"TransactionIndex": 0,
|
||
"TransactionResult": "tesSUCCESS"
|
||
},
|
||
"tx": {
|
||
"Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"Fee": "10",
|
||
"Flags": 0,
|
||
"LimitAmount": {
|
||
"currency": "USD",
|
||
"issuer": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV",
|
||
"value": "100"
|
||
},
|
||
"Sequence": 2,
|
||
"SigningPubKey": "02BC8C02199949B15C005B997E7C8594574E9B02BA2D0628902E0532989976CF9D",
|
||
"TransactionType": "TrustSet",
|
||
"TxnSignature": "304402200EF81EC32E0DFA9BE376B20AFCA11765ED9FEA04CA8B77C7178DAA699F7F5AFF02202DA484DBD66521AC317D84F7717EC4614E2F5DB743E313E8B48440499CC0DBA4",
|
||
"date": 413620090,
|
||
"hash": "002AA492496A1543DBD3680BF8CF21B6D6A078CE4A01D2C1A4B63778033792CE",
|
||
"inLedger": 195480,
|
||
"ledger_index": 195480
|
||
},
|
||
"validated": true
|
||
},
|
||
{
|
||
"meta": {
|
||
"AffectedNodes": [
|
||
{
|
||
"ModifiedNode": {
|
||
"FinalFields": {
|
||
"Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"Balance": "9999999970",
|
||
"Flags": 0,
|
||
"OwnerCount": 3,
|
||
"Sequence": 4
|
||
},
|
||
"LedgerEntryType": "AccountRoot",
|
||
"LedgerIndex": "4F83A2CF7E70F77F79A307E6A472BFC2585B806A70833CCD1C26105BAE0D6E05",
|
||
"PreviousFields": {
|
||
"Balance": "9999999980",
|
||
"OwnerCount": 2,
|
||
"Sequence": 3
|
||
},
|
||
"PreviousTxnID": "002AA492496A1543DBD3680BF8CF21B6D6A078CE4A01D2C1A4B63778033792CE",
|
||
"PreviousTxnLgrSeq": 195480
|
||
}
|
||
},
|
||
{
|
||
"ModifiedNode": {
|
||
"FinalFields": {
|
||
"Flags": 0,
|
||
"Owner": "r3PDtZSa5LiYp1Ysn1vMuMzB59RzV3W9QH",
|
||
"RootIndex": "A39F044D860C5B5846AA7E0FAAD44DC8897F0A62B2F628AA073B21B3EC146010"
|
||
},
|
||
"LedgerEntryType": "DirectoryNode",
|
||
"LedgerIndex": "A39F044D860C5B5846AA7E0FAAD44DC8897F0A62B2F628AA073B21B3EC146010"
|
||
}
|
||
},
|
||
{
|
||
"ModifiedNode": {
|
||
"LedgerEntryType": "AccountRoot",
|
||
"LedgerIndex": "E0D7BDE68B468FF0B8D948FD865576517DA987569833A05374ADB9A72E870A06",
|
||
"PreviousTxnID": "0222B59280D165D40C464EA75AAD08A4D152C46A38C0625DEECF6EE87FC5B9E1",
|
||
"PreviousTxnLgrSeq": 343555
|
||
}
|
||
},
|
||
{
|
||
"CreatedNode": {
|
||
"LedgerEntryType": "RippleState",
|
||
"LedgerIndex": "EA4BF03B4700123CDFFB6EB09DC1D6E28D5CEB7F680FB00FC24BC1C3BB2DB959",
|
||
"NewFields": {
|
||
"Balance": {
|
||
"currency": "USD",
|
||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||
"value": "0"
|
||
},
|
||
"Flags": 131072,
|
||
"HighLimit": {
|
||
"currency": "USD",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "100"
|
||
},
|
||
"LowLimit": {
|
||
"currency": "USD",
|
||
"issuer": "r3PDtZSa5LiYp1Ysn1vMuMzB59RzV3W9QH",
|
||
"value": "0"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"ModifiedNode": {
|
||
"FinalFields": {
|
||
"ExchangeRate": "4E11C37937E08000",
|
||
"Flags": 0,
|
||
"RootIndex": "F60ADF645E78B69857D2E4AEC8B7742FEABC8431BD8611D099B428C3E816DF93",
|
||
"TakerGetsCurrency": "0000000000000000000000000000000000000000",
|
||
"TakerGetsIssuer": "0000000000000000000000000000000000000000",
|
||
"TakerPaysCurrency": "0000000000000000000000004254430000000000",
|
||
"TakerPaysIssuer": "5E7B112523F68D2F5E879DB4EAC51C6698A69304"
|
||
},
|
||
"LedgerEntryType": "DirectoryNode",
|
||
"LedgerIndex": "F60ADF645E78B69857D2E4AEC8B7742FEABC8431BD8611D099B428C3E816DF93"
|
||
}
|
||
}
|
||
],
|
||
"TransactionIndex": 0,
|
||
"TransactionResult": "tesSUCCESS"
|
||
},
|
||
"tx": {
|
||
"Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"Fee": "10",
|
||
"Flags": 0,
|
||
"LimitAmount": {
|
||
"currency": "USD",
|
||
"issuer": "r3PDtZSa5LiYp1Ysn1vMuMzB59RzV3W9QH",
|
||
"value": "100"
|
||
},
|
||
"Sequence": 3,
|
||
"SigningPubKey": "02BC8C02199949B15C005B997E7C8594574E9B02BA2D0628902E0532989976CF9D",
|
||
"TransactionType": "TrustSet",
|
||
"TxnSignature": "3044022058A89552068D1A274EE72BA71363E33E54E6608BC28A84DEC6EE530FC2B5C979022029F4D1EA1237A1F717C5F5EC526E6CFB6DF54C30BADD25EDDE7D2FDBC8F17E34",
|
||
"date": 416347560,
|
||
"hash": "53354D84BAE8FDFC3F4DA879D984D24B929E7FEB9100D2AD9EFCD2E126BCCDC8",
|
||
"inLedger": 343570,
|
||
"ledger_index": 343570
|
||
},
|
||
"validated": true
|
||
}
|
||
],
|
||
"validated": true
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>account</td>
|
||
<td>String</td>
|
||
<td>Unique <a href="#addresses">Address</a> identifying the related account</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index_min</td>
|
||
<td>Integer</td>
|
||
<td>The sequence number of the earliest ledger actually searched for transactions.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index_max</td>
|
||
<td>Integer</td>
|
||
<td>The sequence number of the most recent ledger actually searched for transactions.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>limit</td>
|
||
<td>Integer</td>
|
||
<td>The <code>limit</code> value used in the request. (This may differ from the actual limit value enforced by the server.)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>marker</td>
|
||
<td><a href="#markers-and-pagination">(Not Specified)</a></td>
|
||
<td>Server-defined value. Pass this to the next call to resume where this call left off.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>offset</td>
|
||
<td>Integer</td>
|
||
<td>The <code>offset</code> value used in the request.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>transactions</td>
|
||
<td>Array</td>
|
||
<td>Array of transactions matching the request's criteria, as explained below.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>validated</td>
|
||
<td>Boolean</td>
|
||
<td>If included and set to <code>true</code>, the information in this request comes from a validated ledger version. Otherwise, the information is subject to change.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p class="devportal-callout note"><strong>Note:</strong> The server may respond with different values of <code>ledger_index_min</code> and <code>ledger_index_max</code> than you provided in the request, for example if it did not have the versions you specified on hand.</p>
|
||
<p>Each transaction object includes the following fields, depending on whether it was requested in JSON or hex string (<code>"binary":true</code>) format.</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>Integer</td>
|
||
<td>The sequence number of the ledger version that included this transaction.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>meta</td>
|
||
<td>Object (JSON) or String (Binary)</td>
|
||
<td>If <code>binary</code> is True, then this is a hex string of the transaction metadata. Otherwise, the transaction metadata is included in JSON format.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>tx</td>
|
||
<td>Object</td>
|
||
<td>(JSON mode only) JSON object defining the transaction</td>
|
||
</tr>
|
||
<tr>
|
||
<td>tx_blob</td>
|
||
<td>String</td>
|
||
<td>(Binary mode only) Unique hashed String representing the transaction.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>validated</td>
|
||
<td>Boolean</td>
|
||
<td>Whether or not the transaction is included in a validated ledger. Any transaction not yet in a validated ledger is subject to change.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="possible-errors-5">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>invalidParams</code> - One or more fields are specified incorrectly, or one or more required fields are missing.</li>
|
||
<li><code>actMalformed</code> - The <a href="#addresses">Address</a> specified in the <code>account</code> field of the request is not formatted properly.</li>
|
||
<li><code>actBitcoin</code> - The <a href="#addresses">Address</a> specified in the <code>account</code> field is formatted like a Bitcoin address instead of a Ripple address.</li>
|
||
<li><code>lgrIdxsInvalid</code> - The ledger specified by the <code>ledger_index_min</code> or <code>ledger_index_max</code> does not exist, or if it does exist but the server does not have it.</li>
|
||
</ul>
|
||
<h2 id="noripple-check">noripple_check</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/9111ad1a9dc37d49d085aa317712625e635197c0/src/ripple/rpc/handlers/NoRippleCheck.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>noripple_check</code> command provides a quick way to check the status of <a href="concept-noripple.html">the DefaultRipple field for an account and the NoRipple flag of its trust lines</a>, compared with the recommended settings.</p>
|
||
<h4 id="request-format-6">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-15"><ul class="codetabs"><li><a href="#code-15-0">WebSocket</a></li><li><a href="#code-15-1">JSON-RPC</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-15-0" style="position: static;"><pre><code>{
|
||
"id": 0,
|
||
"command": "noripple_check",
|
||
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"role": "gateway",
|
||
"ledger_index": "current",
|
||
"limit": 2,
|
||
"transactions": true
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-15-1" style="position: static;"><pre><code>{
|
||
"method": "noripple_check",
|
||
"params": [
|
||
{
|
||
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"ledger_index": "current",
|
||
"limit": 2,
|
||
"role": "gateway",
|
||
"transactions": true
|
||
}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p class="devportal-callout note"><strong>Note:</strong> There is no command-line syntax for this method. Use the <a href="#json"><code>json</code> command</a> to access this from the command line.</p>
|
||
<p>The request includes the following parameters:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>account</td>
|
||
<td>String</td>
|
||
<td>A unique identifier for the account, most commonly the account's address.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>role</td>
|
||
<td>String</td>
|
||
<td>Whether the address refers to a <code>gateway</code> or <code>user</code>. Recommendations depend on the role of the account. Issuers must have DefaultRipple enabled and must disable NoRipple on all trust lines. Users should have DefaultRipple disabled, and should enable NoRipple on all trust lines.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>transactions</td>
|
||
<td>Boolean</td>
|
||
<td>(Optional) If <code>true</code>, include an array of suggested <a href="reference-transaction-format.html">transactions</a>, as JSON objects, that you can sign and submit to fix the problems. Defaults to false.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>limit</td>
|
||
<td>Unsigned Integer</td>
|
||
<td>(Optional) The maximum number of trust line problems to include in the results. Defaults to 300.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_hash</td>
|
||
<td>String</td>
|
||
<td>(Optional) A 20-byte hex string for the ledger version to use. (See <a href="#specifying-ledgers">Specifying a Ledger</a>)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>String or Unsigned Integer</td>
|
||
<td>(Optional) The sequence number of the ledger to use, or a shortcut string to choose a ledger automatically. (See <a href="#specifying-ledgers">Specifying a Ledger</a>)</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="response-format-6">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-16"><ul class="codetabs"><li><a href="#code-16-0">WebSocket</a></li><li><a href="#code-16-1">JSON-RPC</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-16-0" style="position: static;"><pre><code>{
|
||
"id": 0,
|
||
"status": "success",
|
||
"type": "response",
|
||
"result": {
|
||
"ledger_current_index": 14342939,
|
||
"problems": [
|
||
"You should immediately set your default ripple flag",
|
||
"You should clear the no ripple flag on your XAU line to r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
|
||
"You should clear the no ripple flag on your USD line to rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q"
|
||
],
|
||
"transactions": [
|
||
{
|
||
"Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"Fee": 10000,
|
||
"Sequence": 1406,
|
||
"SetFlag": 8,
|
||
"TransactionType": "AccountSet"
|
||
},
|
||
{
|
||
"Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"Fee": 10000,
|
||
"Flags": 262144,
|
||
"LimitAmount": {
|
||
"currency": "XAU",
|
||
"issuer": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
|
||
"value": "0"
|
||
},
|
||
"Sequence": 1407,
|
||
"TransactionType": "TrustSet"
|
||
},
|
||
{
|
||
"Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"Fee": 10000,
|
||
"Flags": 262144,
|
||
"LimitAmount": {
|
||
"currency": "USD",
|
||
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
||
"value": "5"
|
||
},
|
||
"Sequence": 1408,
|
||
"TransactionType": "TrustSet"
|
||
}
|
||
],
|
||
"validated": false
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-16-1" style="position: static;"><pre><code>200 OK
|
||
{
|
||
"result": {
|
||
"ledger_current_index": 14380381,
|
||
"problems": [
|
||
"You should immediately set your default ripple flag",
|
||
"You should clear the no ripple flag on your XAU line to r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
|
||
"You should clear the no ripple flag on your USD line to rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
||
],
|
||
"status": "success",
|
||
"transactions": [
|
||
{
|
||
"Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"Fee": 10000,
|
||
"Sequence": 1406,
|
||
"SetFlag": 8,
|
||
"TransactionType": "AccountSet"
|
||
},
|
||
{
|
||
"Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"Fee": 10000,
|
||
"Flags": 262144,
|
||
"LimitAmount": {
|
||
"currency": "XAU",
|
||
"issuer": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
|
||
"value": "0"
|
||
},
|
||
"Sequence": 1407,
|
||
"TransactionType": "TrustSet"
|
||
},
|
||
{
|
||
"Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"Fee": 10000,
|
||
"Flags": 262144,
|
||
"LimitAmount": {
|
||
"currency": "USD",
|
||
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
||
"value": "5"
|
||
},
|
||
"Sequence": 1408,
|
||
"TransactionType": "TrustSet"
|
||
}
|
||
],
|
||
"validated": false
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>ledger_current_index</td>
|
||
<td>Number</td>
|
||
<td>The sequence number of the ledger used to calculate these results.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>problems</td>
|
||
<td>Array</td>
|
||
<td>Array of strings with human-readable descriptions of the problems. This includes up to one entry if the account's DefaultRipple setting is not as recommended, plus up to <code>limit</code> entries for trust lines whose NoRipple setting is not as recommended.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>transactions</td>
|
||
<td>Array</td>
|
||
<td>(May be omitted) If the request specified <code>transactions</code> as <code>true</code>, this is an array of JSON objects, each of which is the JSON form of a <a href="reference-transaction-format.html">transaction</a> that should fix one of the described problems. The length of this array is the same as the <code>problems</code> array, and each entry is intended to fix the problem described at the same index into that array.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="possible-errors-6">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>invalidParams</code> - One or more fields are specified incorrectly, or one or more required fields are missing.</li>
|
||
<li><code>actNotFound</code> - The <a href="#addresses">Address</a> specified in the <code>account</code> field of the request does not correspond to an account in the ledger.</li>
|
||
<li><code>lgrNotFound</code> - The ledger specified by the <code>ledger_hash</code> or <code>ledger_index</code> does not exist, or it does exist but the server does not have it.</li>
|
||
</ul>
|
||
<h2 id="gateway-balances">gateway_balances</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/9111ad1a9dc37d49d085aa317712625e635197c0/src/ripple/rpc/handlers/GatewayBalances.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>gateway_balances</code> command calculates the total balances issued by a given account, optionally excluding amounts held by <a href="concept-issuing-and-operational-addresses.html">operational addresses</a>. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.28.2">version 0.28.2</a>.)</em></p>
|
||
<h4 id="request-format-7">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-17"><ul class="codetabs"><li><a href="#code-17-0">WebSocket</a></li><li><a href="#code-17-1">JSON-RPC</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-17-0" style="position: static;"><pre><code>{
|
||
"id": "example_gateway_balances_1",
|
||
"command": "gateway_balances",
|
||
"account": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
||
"strict": true,
|
||
"hotwallet": ["rKm4uWpg9tfwbVSeATv4KxDe6mpE9yPkgJ","ra7JkEzrgeKHdzKgo4EUUVBnxggY4z37kt"],
|
||
"ledger_index": "validated"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-17-1" style="position: static;"><pre><code>{
|
||
"method": "gateway_balances",
|
||
"params": [
|
||
{
|
||
"account": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
||
"hotwallet": [
|
||
"rKm4uWpg9tfwbVSeATv4KxDe6mpE9yPkgJ",
|
||
"ra7JkEzrgeKHdzKgo4EUUVBnxggY4z37kt"
|
||
],
|
||
"ledger_index": "validated",
|
||
"strict": true
|
||
}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The request includes the following parameters:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>account</td>
|
||
<td>String</td>
|
||
<td>The <a href="#addresses">Address</a> to check. This should be the <a href="concept-issuing-and-operational-addresses.html">issuing address</a></td>
|
||
</tr>
|
||
<tr>
|
||
<td>strict</td>
|
||
<td>Boolean</td>
|
||
<td>(Optional) If true, only accept an address or public key for the account parameter. Defaults to false.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>hotwallet</td>
|
||
<td>String or Array</td>
|
||
<td>An <a href="concept-issuing-and-operational-addresses.html">operational address</a> to exclude from the balances issued, or an array of such addresses.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_hash</td>
|
||
<td>String</td>
|
||
<td>(Optional) A 20-byte hex string for the ledger version to use. (See <a href="#specifying-ledgers">Specifying a Ledger</a>)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>String or Unsigned Integer</td>
|
||
<td>(Optional) The sequence number of the ledger version to use, or a shortcut string to choose a ledger automatically. (See <a href="#specifying-ledgers">Specifying a Ledger</a>)</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="response-format-7">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-18"><ul class="codetabs"><li><a href="#code-18-0">WebSocket</a></li><li><a href="#code-18-1">JSON-RPC</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-18-0" style="position: static;"><pre><code>{
|
||
"id": 3,
|
||
"status": "success",
|
||
"type": "response",
|
||
"result": {
|
||
"account": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
||
"assets": {
|
||
"r9F6wk8HkXrgYWoJ7fsv4VrUBVoqDVtzkH": [
|
||
{
|
||
"currency": "BTC",
|
||
"value": "5444166510000000e-26"
|
||
}
|
||
],
|
||
"rPFLkxQk6xUGdGYEykqe7PR25Gr7mLHDc8": [
|
||
{
|
||
"currency": "EUR",
|
||
"value": "4000000000000000e-27"
|
||
}
|
||
],
|
||
"rPU6VbckqCLW4kb51CWqZdxvYyQrQVsnSj": [
|
||
{
|
||
"currency": "BTC",
|
||
"value": "1029900000000000e-26"
|
||
}
|
||
],
|
||
"rpR95n1iFkTqpoy1e878f4Z1pVHVtWKMNQ": [
|
||
{
|
||
"currency": "BTC",
|
||
"value": "4000000000000000e-30"
|
||
}
|
||
],
|
||
"rwmUaXsWtXU4Z843xSYwgt1is97bgY8yj6": [
|
||
{
|
||
"currency": "BTC",
|
||
"value": "8700000000000000e-30"
|
||
}
|
||
]
|
||
},
|
||
"balances": {
|
||
"rKm4uWpg9tfwbVSeATv4KxDe6mpE9yPkgJ": [
|
||
{
|
||
"currency": "EUR",
|
||
"value": "29826.1965999999"
|
||
}
|
||
],
|
||
"ra7JkEzrgeKHdzKgo4EUUVBnxggY4z37kt": [
|
||
{
|
||
"currency": "USD",
|
||
"value": "13857.70416"
|
||
}
|
||
]
|
||
},
|
||
"ledger_hash": "61DDBF304AF6E8101576BF161D447CA8E4F0170DDFBEAFFD993DC9383D443388",
|
||
"ledger_index": 14483195,
|
||
"obligations": {
|
||
"BTC": "5908.324927635318",
|
||
"EUR": "992471.7419793958",
|
||
"GBP": "4991.38706013193",
|
||
"USD": "1997134.20229482"
|
||
},
|
||
"validated": true
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-18-1" style="position: static;"><pre><code>200 OK
|
||
{
|
||
"result": {
|
||
"account": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
||
"assets": {
|
||
"r9F6wk8HkXrgYWoJ7fsv4VrUBVoqDVtzkH": [
|
||
{
|
||
"currency": "BTC",
|
||
"value": "5444166510000000e-26"
|
||
}
|
||
],
|
||
"rPFLkxQk6xUGdGYEykqe7PR25Gr7mLHDc8": [
|
||
{
|
||
"currency": "EUR",
|
||
"value": "4000000000000000e-27"
|
||
}
|
||
],
|
||
"rPU6VbckqCLW4kb51CWqZdxvYyQrQVsnSj": [
|
||
{
|
||
"currency": "BTC",
|
||
"value": "1029900000000000e-26"
|
||
}
|
||
],
|
||
"rpR95n1iFkTqpoy1e878f4Z1pVHVtWKMNQ": [
|
||
{
|
||
"currency": "BTC",
|
||
"value": "4000000000000000e-30"
|
||
}
|
||
],
|
||
"rwmUaXsWtXU4Z843xSYwgt1is97bgY8yj6": [
|
||
{
|
||
"currency": "BTC",
|
||
"value": "8700000000000000e-30"
|
||
}
|
||
]
|
||
},
|
||
"balances": {
|
||
"rKm4uWpg9tfwbVSeATv4KxDe6mpE9yPkgJ": [
|
||
{
|
||
"currency": "EUR",
|
||
"value": "29826.1965999999"
|
||
}
|
||
],
|
||
"ra7JkEzrgeKHdzKgo4EUUVBnxggY4z37kt": [
|
||
{
|
||
"currency": "USD",
|
||
"value": "13857.70416"
|
||
}
|
||
]
|
||
},
|
||
"ledger_hash": "980FECF48CA4BFDEC896692C31A50D484BDFE865EC101B00259C413AA3DBD672",
|
||
"ledger_index": 14483212,
|
||
"obligations": {
|
||
"BTC": "5908.324927635318",
|
||
"EUR": "992471.7419793958",
|
||
"GBP": "4991.38706013193",
|
||
"USD": "1997134.20229482"
|
||
},
|
||
"status": "success",
|
||
"validated": true
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p class="devportal-callout note"><strong>Note:</strong> There is no command-line syntax for this method. Use the <a href="#json"><code>json</code> command</a> to access this from the command line.</p>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>obligations</td>
|
||
<td>Object</td>
|
||
<td>(Omitted if empty) Total amounts issued to addresses not excluded, as a map of currencies to the total value issued.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>balances</td>
|
||
<td>Object</td>
|
||
<td>(Omitted if empty) Amounts issued to the <code>hotwallet</code> addresses from the request. The keys are addresses and the values are arrays of currency amounts they hold.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>assets</td>
|
||
<td>Object</td>
|
||
<td>(Omitted if empty) Total amounts held that are issued by others. In the recommended configuration, the <a href="concept-issuing-and-operational-addresses.html">issuing address</a> should have none.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_hash</td>
|
||
<td>String</td>
|
||
<td>(May be omitted) The identifying hash of the ledger that was used to generate this response.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>Number</td>
|
||
<td>(May be omitted) The sequence number of the ledger version that was used to generate this response.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_current_index</td>
|
||
<td>Number</td>
|
||
<td>(May be omitted) The sequence number of the current in-progress ledger version that was used to generate this response.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="possible-errors-7">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>invalidParams</code> - One or more fields are specified incorrectly, or one or more required fields are missing.</li>
|
||
<li><code>invalidHotWallet</code> - One or more of the addresses specified in the <code>hotwallet</code> field is not the <a href="#addresses">Address</a> of an account holding currency issued by the account from the request.</li>
|
||
<li><code>actNotFound</code> - The <a href="#addresses">Address</a> specified in the <code>account</code> field of the request does not correspond to an account in the ledger.</li>
|
||
<li><code>lgrNotFound</code> - The ledger specified by the <code>ledger_hash</code> or <code>ledger_index</code> does not exist, or it does exist but the server does not have it.</li>
|
||
</ul>
|
||
<h2 id="wallet-propose">wallet_propose</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/WalletPropose.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>Use the <code>wallet_propose</code> method to generate a key pair and Ripple <a href="#addresses">address</a>. This command only generates keys, and does not affect the Ripple Consensus Ledger itself in any way. To become a funded address stored in the ledger, the address must <a href="reference-transaction-format.html#creating-accounts">receive a Payment transaction</a> that provides enough XRP to meet the <a href="concept-reserves.html">reserve requirement</a>.</p>
|
||
<p><em>The <code>wallet_propose</code> request is an <a href="#connecting-to-rippled">admin command</a> that cannot be run by unpriviledged users!</em> (This command is restricted to protect against people sniffing network traffic for account secrets, since admin commands are not usually transmitted over the outside network.)</p>
|
||
<p><em>(Updated in <a href="https://github.com/ripple/rippled/releases/tag/0.31.0">version 0.31.0</a>)</em></p>
|
||
<h4 id="request-format-8">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-19"><ul class="codetabs"><li><a href="#code-19-0">WebSocket (with key type)</a></li><li><a href="#code-19-1">WebSocket (no key type)</a></li><li><a href="#code-19-2">JSON-RPC (with key type)</a></li><li><a href="#code-19-3">JSON-RPC (no key type)</a></li><li><a href="#code-19-4">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-19-0" style="position: static;"><pre><code>{
|
||
"command": "wallet_propose",
|
||
"seed": "snoPBrXtMeMyMHUVTgbuqAfg1SUTb",
|
||
"key_type": "secp256k1"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-19-1" style="position: static;"><pre><code>{
|
||
"command": "wallet_propose",
|
||
"passphrase": "masterpassphrase"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-19-2" style="position: static;"><pre><code>{
|
||
"method": "wallet_propose",
|
||
"params": [
|
||
{
|
||
"seed": "snoPBrXtMeMyMHUVTgbuqAfg1SUTb",
|
||
"key_type": "secp256k1"
|
||
}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-19-3" style="position: static;"><pre><code>{
|
||
"method": "wallet_propose",
|
||
"params": [
|
||
{
|
||
"passphrase": "snoPBrXtMeMyMHUVTgbuqAfg1SUTb"
|
||
}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-19-4" style="position: static;"><pre><code>#Syntax: wallet_propose [passphrase]
|
||
rippled wallet_propose masterpassphrase
|
||
</code></pre></div>
|
||
</div>
|
||
<p>There are two valid modes for this command, depending on whether the request specifies the <code>key_type</code> parameter. If you omit the <code>key_type</code>, the request takes <em>only</em> the following parameter (ignoring others):</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>passphrase</td>
|
||
<td>String</td>
|
||
<td>(Optional) Generate a key pair and address from this seed value using the elliptic curve secp256k1. This value can be formatted in hexadecimal, base-58, RFC-1751, or as an arbitrary string. If omitted, use a random seed.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>If you specify the <code>key_type</code>, you must provide at most one of the following fields: <code>passphrase</code>, <code>seed</code>, or <code>seed_hex</code>. (If you omit all three, <code>rippled</code> uses a random seed.) In this mode, the request parameters are as follows:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>key_type</td>
|
||
<td>String</td>
|
||
<td>Which elliptic curve to use for this key pair. Valid values are <code>ed25519</code> and <code>secp256k1</code>. <strong>Caution:</strong> <a href="https://ed25519.cr.yp.to/">Ed25519</a> support is experimental.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>passphrase</td>
|
||
<td>String</td>
|
||
<td>(Optional) Generate the key pair and address from this seed value. This is interpreted as a string only. Cannot be used with <code>seed</code> or <code>seed_hex</code>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>seed</td>
|
||
<td>String</td>
|
||
<td>(Optional) Generate the key pair and address from this base-58-encoded seed value. Cannot be used with <code>passphrase</code> or <code>seed_hex</code>. Ignored unless <code>key_type</code> is provided.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>seed_hex</td>
|
||
<td>String</td>
|
||
<td>(Optional) Generate the key pair and address from this seed value in hexadecimal format. Cannot be used with <code>passphrase</code> or <code>seed</code>. Ignored unless <code>key_type</code> is provided.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>The commandline version of this command cannot generate Ed25519 keys.</p>
|
||
<h5 id="specifying-a-seed">Specifying a Seed</h5>
|
||
<p class="devportal-callout caution"><strong>Caution:</strong> For most cases, you should use a seed value generated from a strong source of randomness. Anyone who knows the seed value for an address has full power to <a href="reference-transaction-format.html#authorizing-transactions">send transactions signed by that address</a>. Generally, running this command with no parameters is a good way to generate a random seed.</p>
|
||
<p>Cases where you would specify a known seed include:</p>
|
||
<ul>
|
||
<li>Re-calculating your address when you only know the seed associated with that address</li>
|
||
<li>Testing <code>rippled</code> functionality</li>
|
||
<li><a href="tutorial-rippled-setup.html#account-domain">Validator domain verification</a></li>
|
||
</ul>
|
||
<p>If you do specify a seed, you can specify it in any of the following formats:</p>
|
||
<ul>
|
||
<li>As a <a href="https://en.wikipedia.org/wiki/Base58">base-58</a> secret key format string. Example: <code>snoPBrXtMeMyMHUVTgbuqAfg1SUTb</code>.</li>
|
||
<li>As an <a href="https://tools.ietf.org/html/rfc1751">RFC-1751</a> format string (secp256k1 key pairs only). Example: <code>I IRE BOND BOW TRIO LAID SEAT GOAL HEN IBIS IBIS DARE</code>.</li>
|
||
<li>As a 128-bit <a href="https://en.wikipedia.org/wiki/Hexadecimal">hexadecimal</a> string. Example: <code>DEDCE9CE67B451D852FD4E846FCDE31C</code>.</li>
|
||
<li>An arbitrary string to use as a seed value. For example: <code>masterpassphrase</code>.</li>
|
||
</ul>
|
||
<h4 id="response-format-8">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-20"><ul class="codetabs"><li><a href="#code-20-0">WebSocket</a></li><li><a href="#code-20-1">JSON-RPC</a></li><li><a href="#code-20-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-20-0" style="position: static;"><pre><code>{
|
||
"id": 2,
|
||
"status": "success",
|
||
"type": "response",
|
||
"result": {
|
||
"account_id": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||
"key_type": "secp256k1",
|
||
"master_key": "I IRE BOND BOW TRIO LAID SEAT GOAL HEN IBIS IBIS DARE",
|
||
"master_seed": "snoPBrXtMeMyMHUVTgbuqAfg1SUTb",
|
||
"master_seed_hex": "DEDCE9CE67B451D852FD4E846FCDE31C",
|
||
"public_key": "aBQG8RQAzjs1eTKFEAQXr2gS4utcDiEC9wmi7pfUPTi27VCahwgw",
|
||
"public_key_hex": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-20-1" style="position: static;"><pre><code>{
|
||
"result": {
|
||
"account_id": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||
"key_type": "secp256k1",
|
||
"master_key": "I IRE BOND BOW TRIO LAID SEAT GOAL HEN IBIS IBIS DARE",
|
||
"master_seed": "snoPBrXtMeMyMHUVTgbuqAfg1SUTb",
|
||
"master_seed_hex": "DEDCE9CE67B451D852FD4E846FCDE31C",
|
||
"public_key": "aBQG8RQAzjs1eTKFEAQXr2gS4utcDiEC9wmi7pfUPTi27VCahwgw",
|
||
"public_key_hex": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
|
||
"status": "success"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-20-2" style="position: static;"><pre><code>Loading: "/etc/rippled.cfg"
|
||
Connecting to 127.0.0.1:5005
|
||
{
|
||
"result" : {
|
||
"account_id" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||
"key_type" : "secp256k1",
|
||
"master_key" : "I IRE BOND BOW TRIO LAID SEAT GOAL HEN IBIS IBIS DARE",
|
||
"master_seed" : "snoPBrXtMeMyMHUVTgbuqAfg1SUTb",
|
||
"master_seed_hex" : "DEDCE9CE67B451D852FD4E846FCDE31C",
|
||
"public_key" : "aBQG8RQAzjs1eTKFEAQXr2gS4utcDiEC9wmi7pfUPTi27VCahwgw",
|
||
"public_key_hex" : "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
|
||
"status" : "success"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing various important information about the new account, including the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>master_seed</td>
|
||
<td>String</td>
|
||
<td>The master seed from which all other information about this account is derived, in Ripple's base-58 encoded string format. This is the private key of the key pair.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>master_seed_hex</td>
|
||
<td>String</td>
|
||
<td>The master seed, in hex format.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>master_key</td>
|
||
<td>String</td>
|
||
<td>The master seed, in <a href="http://tools.ietf.org/html/rfc1751">RFC 1751</a> format.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>account_id</td>
|
||
<td>String</td>
|
||
<td>The <a href="#addresses">Address</a> of the account.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>public_key</td>
|
||
<td>String</td>
|
||
<td>The public key of the account, in encoded string format.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>public_key_hex</td>
|
||
<td>String</td>
|
||
<td>The public key of the account, in hex format.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>The key generated by this method can also be used as a regular key for an account if you use the <a href="reference-transaction-format.html#setregularkey">SetRegularKey transaction type</a> to do so.</p>
|
||
<h4 id="possible-errors-8">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>invalidParams</code> - One or more fields are specified incorrectly.</li>
|
||
<li><code>badSeed</code> - The request specified a disallowed seed value (in the <code>passphrase</code>, <code>seed</code>, or <code>seed_hex</code> fields), such as an empty string, or a string resembling a Ripple address.</li>
|
||
</ul>
|
||
<h1 id="ledger-information">Ledger Information</h1>
|
||
<p>The globally-shared ledger is the core of the Ripple Network. Each <code>rippled</code> server keeps a current version of the ledger, which contains all the accounts, transactions, offers, and other data in the network in an optimized tree format. As transactions and offers are proposed, each server incorporates them into its current copy of the ledger, closes it periodically, and (if configured) participates in advancing the globally-validated version. After the network reaches consensus, that ledger version is validated and becomes permanently immutable. Any transactions that were not included in one ledger become candidates to be included in the next validated version.</p>
|
||
<h2 id="ledger">ledger</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/LedgerHandler.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>Retrieve information about the public ledger.</p>
|
||
<h4 id="request-format-9">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-21"><ul class="codetabs"><li><a href="#code-21-0">WebSocket</a></li><li><a href="#code-21-1">JSON-RPC</a></li><li><a href="#code-21-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-21-0" style="position: static;"><pre><code>{
|
||
"id": 14,
|
||
"command": "ledger",
|
||
"ledger_index": "validated",
|
||
"full": false,
|
||
"accounts": false,
|
||
"transactions": false,
|
||
"expand": false,
|
||
"owner_funds": false
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-21-1" style="position: static;"><pre><code>{
|
||
"method": "ledger",
|
||
"params": [
|
||
{
|
||
"ledger_index": "validated",
|
||
"accounts": false,
|
||
"full": false,
|
||
"transactions": false,
|
||
"expand": false,
|
||
"owner_funds": false
|
||
}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-21-2" style="position: static;"><pre><code>#Syntax: ledger ledger_index|ledger_hash [full|tx]
|
||
# "full" is equivalent to "full": true
|
||
# "tx" is equivalent to "transactions": true
|
||
rippled ledger current
|
||
</code></pre></div>
|
||
</div>
|
||
<p><a class="button" href="ripple-api-tool.html#ledger">Try it! ></a></p>
|
||
<p>The request can contain the following parameters:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>ledger_hash</td>
|
||
<td>String</td>
|
||
<td>(Optional) A 20-byte hex string for the ledger version to use. (See <a href="#specifying-ledgers">Specifying a Ledger</a>).</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>String or Unsigned Integer</td>
|
||
<td>(Optional) The sequence number of the ledger to use, or a shortcut string to choose a ledger automatically. (See <a href="#specifying-ledgers">Specifying a Ledger</a>)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>full</td>
|
||
<td>Boolean</td>
|
||
<td>(Optional, defaults to false) <strong>Admin required</strong> If true, return full information on the entire ledger. Ignored if you did not specify a ledger. (Equivalent to enabling <code>transactions</code>, <code>accounts</code>, and <code>expand</code>.) <strong>Caution:</strong> This is a very large amount of data -- on the order of several hundred megabytes!</td>
|
||
</tr>
|
||
<tr>
|
||
<td>accounts</td>
|
||
<td>Boolean</td>
|
||
<td>(Optional, defaults to false) <strong>Admin required.</strong> If true, return information on accounts in the ledger. Ignored if you did not specify a ledger. <strong>Caution:</strong> This returns a very large amount of data!</td>
|
||
</tr>
|
||
<tr>
|
||
<td>transactions</td>
|
||
<td>Boolean</td>
|
||
<td>(Optional, defaults to false) If true, return information on transactions in the specified ledger version. Ignored if you did not specify a ledger.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>expand</td>
|
||
<td>Boolean</td>
|
||
<td>(Optional, defaults to false) Provide full JSON-formatted information for transaction/account information instead of only hashes. Ignored unless you requested transactions, accounts, or both.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>owner_funds</td>
|
||
<td>Boolean</td>
|
||
<td>(Optional, defaults to false) Include <code>owner_funds</code> field in the metadata of OfferCreate transactions in the response. Ignored unless transactions are included and <code>expand</code> is true.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>binary</td>
|
||
<td>Boolean</td>
|
||
<td>(Optional, defaults to false) If <code>transactions</code> and <code>expand</code> are both true, and this option is also true, return transaction information in binary format instead of JSON format. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.28.0">version 0.28.0</a>)</em></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>The <code>ledger</code> field is deprecated and may be removed without further notice.</p>
|
||
<h4 id="response-format-9">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-22"><ul class="codetabs"><li><a href="#code-22-0">WebSocket</a></li><li><a href="#code-22-1">JSON-RPC</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-22-0" style="position: static;"><pre><code>{
|
||
"id": 4,
|
||
"status": "success",
|
||
"type": "response",
|
||
"result": {
|
||
"ledger": {
|
||
"accepted": true,
|
||
"account_hash": "FD2709F6C07284C3EE85EDE32AC452D9013A89D9B9E781D67D9784457E86A9BB",
|
||
"close_flags": 0,
|
||
"close_time": 508541181,
|
||
"close_time_human": "2016-Feb-11 21:26:21",
|
||
"close_time_resolution": 10,
|
||
"closed": true,
|
||
"hash": "F1433E9D15F33E746B8820DEEE4879F48181704364E459332561DF8E52E4EB7E",
|
||
"ledger_hash": "F1433E9D15F33E746B8820DEEE4879F48181704364E459332561DF8E52E4EB7E",
|
||
"ledger_index": "18851530",
|
||
"parent_close_time": 508541180,
|
||
"parent_hash": "8300B70AA5A865961DED7DAC5B88047028762D5946ECA887D09D32DE442E2305",
|
||
"seqNum": "18851530",
|
||
"totalCoins": "99998102799411646",
|
||
"total_coins": "99998102799411646",
|
||
"transaction_hash": "E0DB0471A1D198611E1C050ADA4AE74EEB38CEC26E0550663E0FCB1364212A3B"
|
||
},
|
||
"ledger_hash": "F1433E9D15F33E746B8820DEEE4879F48181704364E459332561DF8E52E4EB7E",
|
||
"ledger_index": 18851530,
|
||
"validated": true
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-22-1" style="position: static;"><pre><code>200 OK
|
||
{
|
||
"result": {
|
||
"ledger": {
|
||
"accepted": true,
|
||
"account_hash": "B089E7CD4F5167249951611AAEC863D4BF84FF098500E9CB50561F1A89EED825",
|
||
"close_flags": 0,
|
||
"close_time": 508541222,
|
||
"close_time_human": "2016-Feb-11 21:27:02",
|
||
"close_time_resolution": 10,
|
||
"closed": true,
|
||
"hash": "85E6D422F1A3AE0BEA315C4F09CD0B45022312A4BBF0D308246E901536B61157",
|
||
"ledger_hash": "85E6D422F1A3AE0BEA315C4F09CD0B45022312A4BBF0D308246E901536B61157",
|
||
"ledger_index": "18851543",
|
||
"parent_close_time": 508541221,
|
||
"parent_hash": "C382DB117F2D5AAECFBFB43EA509F8E56D6E1D1297CE00C0D02A3EE695ABB78F",
|
||
"seqNum": "18851543",
|
||
"totalCoins": "99998102795090646",
|
||
"total_coins": "99998102795090646",
|
||
"transaction_hash": "BEC71A3CAD11BFC4E4013CD109F220E0850E9A3808B15FAA6DAE4D898970EFAF"
|
||
},
|
||
"ledger_hash": "85E6D422F1A3AE0BEA315C4F09CD0B45022312A4BBF0D308246E901536B61157",
|
||
"ledger_index": 18851543,
|
||
"status": "success",
|
||
"validated": true
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing information about the ledger, including the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>ledger</td>
|
||
<td>Object</td>
|
||
<td>The complete header data of this ledger.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger.account_hash</td>
|
||
<td>String</td>
|
||
<td>Hash of all account state information in this ledger, as hex</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger.accounts</td>
|
||
<td>Array</td>
|
||
<td>(Omitted unless requested) All the <a href="reference-ledger-format.html">account-state information</a> in this ledger.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger.close_time</td>
|
||
<td>Integer</td>
|
||
<td>The time this ledger was closed, in seconds since the <a href="#specifying-time">Ripple Epoch</a></td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger.close_time_human</td>
|
||
<td>String</td>
|
||
<td>The time this ledger was closed, in human-readable format</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger.close_time_resolution</td>
|
||
<td>Integer</td>
|
||
<td>Ledger close times are rounded to within this many seconds.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger.closed</td>
|
||
<td>Boolean</td>
|
||
<td>Whether or not this ledger has been closed</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger.ledger_hash</td>
|
||
<td>String</td>
|
||
<td>Unique identifying hash of the entire ledger.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger.ledger_index</td>
|
||
<td>String</td>
|
||
<td>The <a href="#ledger-index">Ledger Index</a> of this ledger, as a quoted integer</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger.parent_hash</td>
|
||
<td>String</td>
|
||
<td>Unique identifying hash of the ledger that came immediately before this one.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger.total_coins</td>
|
||
<td>String</td>
|
||
<td>Total number of XRP drops in the network, as a quoted integer. (This decreases as transaction costs destroy XRP.)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger.transaction_hash</td>
|
||
<td>String</td>
|
||
<td>Hash of the transaction information included in this ledger, as hex</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger.transactions</td>
|
||
<td>Array</td>
|
||
<td>(Omitted unless requested) Transactions applied in this ledger version. By default, members are the transactions' identifying <a href="#hashes">Hash</a> strings. If expanded, contains full representations of the transactions instead, in either JSON or binary depending on whether the request specified <code>binary</code> as true.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_hash</td>
|
||
<td>String</td>
|
||
<td>Unique identifying hash of the entire ledger.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>Number</td>
|
||
<td>The <a href="#ledger-index">Ledger Index</a> of this ledger.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>The following fields are deprecated and may be removed without further notice: <code>accepted</code>, <code>hash</code>, <code>seqNum</code>, <code>totalCoins</code>.</p>
|
||
<p><strong>Note on <code>owner_funds</code>:</strong> If the request specified <code>"owner_funds": true</code> and expanded transactions, the response has a field <code>owner_funds</code> in the <code>metaData</code> object of each <a href="reference-transaction-format.html#offercreate">OfferCreate-type transaction</a>. The purpose of this field is to make it easier to track the <a href="reference-transaction-format.html#lifecycle-of-an-offer">funding status of offers</a> with each new validated ledger. This field is defined slightly different than the version of this field in <a href="#order-book-streams">Order Book subscription streams</a>:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Value</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>owner_funds</td>
|
||
<td>String</td>
|
||
<td>Numeric amount of the <code>TakerGets</code> currency that the <code>Account</code> sending this OfferCreate transaction has after the execution of all transactions in this ledger. This does not check whether the currency amount is <a href="concept-freeze.html">frozen</a>.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="possible-errors-9">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>invalidParams</code> - One or more fields are specified incorrectly, or one or more required fields are missing.</li>
|
||
<li><code>lgrNotFound</code> - The ledger specified by the <code>ledger_hash</code> or <code>ledger_index</code> does not exist, or it does exist but the server does not have it.</li>
|
||
<li><code>noPermission</code> - If you specified <code>full</code> or <code>accounts</code> as true, but are not connected to the server as an admin (usually, admin requires connecting on a local port).</li>
|
||
</ul>
|
||
<h2 id="ledger-closed">ledger_closed</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/LedgerClosed.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>ledger_closed</code> method returns the unique identifiers of the most recently closed ledger. (This ledger is not necessarily validated and immutable yet.)</p>
|
||
<h4 id="request-format-10">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-23"><ul class="codetabs"><li><a href="#code-23-0">WebSocket</a></li><li><a href="#code-23-1">JSON-RPC</a></li><li><a href="#code-23-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-23-0" style="position: static;"><pre><code>{
|
||
"id": 2,
|
||
"command": "ledger_closed"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-23-1" style="position: static;"><pre><code>{
|
||
"method": "ledger_closed",
|
||
"params": [
|
||
{}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-23-2" style="position: static;"><pre><code>#Syntax: ledger_closed
|
||
rippled ledger_closed
|
||
</code></pre></div>
|
||
</div>
|
||
<p><a class="button" href="ripple-api-tool.html#ledger_closed">Try it! ></a></p>
|
||
<p>This method accepts no parameters.</p>
|
||
<h4 id="response-format-10">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-24"><ul class="codetabs"><li><a href="#code-24-0">WebSocket</a></li><li><a href="#code-24-1">JSON-RPC</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-24-0" style="position: static;"><pre><code>{
|
||
"id": 1,
|
||
"status": "success",
|
||
"type": "response",
|
||
"result": {
|
||
"ledger_hash": "17ACB57A0F73B5160713E81FE72B2AC9F6064541004E272BD09F257D57C30C02",
|
||
"ledger_index": 6643099
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-24-1" style="position: static;"><pre><code>200 OK
|
||
{
|
||
"result": {
|
||
"ledger_hash": "8B5A0C5F6B198254A6E411AF55C29EE40AA86251D2E78DD0BB17647047FA9C24",
|
||
"ledger_index": 8696231,
|
||
"status": "success"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>ledger_hash</td>
|
||
<td>String</td>
|
||
<td>20-byte hex string with a unique hash of the ledger</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>Unsigned Integer</td>
|
||
<td>Sequence number of this ledger</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="possible-errors-10">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
</ul>
|
||
<h2 id="ledger-current">ledger_current</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/LedgerCurrent.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>ledger_current</code> method returns the unique identifiers of the current in-progress ledger. This command is mostly useful for testing, because the ledger returned is still in flux.</p>
|
||
<h4 id="request-format-11">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-25"><ul class="codetabs"><li><a href="#code-25-0">WebSocket</a></li><li><a href="#code-25-1">JSON-RPC</a></li><li><a href="#code-25-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-25-0" style="position: static;"><pre><code>{
|
||
"id": 2,
|
||
"command": "ledger_current"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-25-1" style="position: static;"><pre><code>{
|
||
"method": "ledger_current",
|
||
"params": [
|
||
{}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-25-2" style="position: static;"><pre><code>#Syntax: ledger_current
|
||
rippled ledger_current
|
||
</code></pre></div>
|
||
</div>
|
||
<p><a class="button" href="ripple-api-tool.html#ledger_current">Try it! ></a></p>
|
||
<p>The request contains no parameters.</p>
|
||
<h4 id="response-format-11">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-26"><ul class="codetabs"><li><a href="#code-26-0">WebSocket</a></li><li><a href="#code-26-1">JSON-RPC</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-26-0" style="position: static;"><pre><code>{
|
||
"id": 2,
|
||
"status": "success",
|
||
"type": "response",
|
||
"result": {
|
||
"ledger_current_index": 6643240
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-26-1" style="position: static;"><pre><code>200 OK
|
||
{
|
||
"result": {
|
||
"ledger_current_index": 8696233,
|
||
"status": "success"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing the following field:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>ledger_current_index</td>
|
||
<td>Unsigned Integer</td>
|
||
<td>Sequence number of this ledger</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>A <code>ledger_hash</code> field is not provided, because the hash of the current ledger is constantly changing along with its contents.</p>
|
||
<h4 id="possible-errors-11">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
</ul>
|
||
<h2 id="ledger-data">ledger_data</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/LedgerData.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>ledger_data</code> method retrieves contents of the specified ledger. You can iterate through several calls to retrieve the entire contents of a single ledger version.</p>
|
||
<h4 id="request-format-12">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-27"><ul class="codetabs"><li><a href="#code-27-0">WebSocket</a></li><li><a href="#code-27-1">JSON-RPC</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-27-0" style="position: static;"><pre><code>{
|
||
"id": 2,
|
||
"ledger_hash": "842B57C1CC0613299A686D3E9F310EC0422C84D3911E5056389AA7E5808A93C8",
|
||
"command": "ledger_data",
|
||
"limit": 5,
|
||
"binary": true
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-27-1" style="position: static;"><pre><code>{
|
||
"method": "ledger_data",
|
||
"params": [
|
||
{
|
||
"binary": true,
|
||
"ledger_hash": "842B57C1CC0613299A686D3E9F310EC0422C84D3911E5056389AA7E5808A93C8",
|
||
"limit": 5
|
||
}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p class="devportal-callout note"><strong>Note:</strong> There is no commandline syntax for <code>ledger_data</code>. You can use the <a href="#json"><code>json</code> command</a> to access this method from the commandline instead.</p>
|
||
<p>A request can include the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>id</td>
|
||
<td>(Arbitrary)</td>
|
||
<td>(WebSocket only) Any identifier to separate this request from others in case the responses are delayed or out of order.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_hash</td>
|
||
<td>String</td>
|
||
<td>(Optional) A 20-byte hex string for the ledger version to use. (See <a href="#specifying-ledgers">Specifying a Ledger</a>)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>String or Unsigned Integer</td>
|
||
<td>(Optional) The sequence number of the ledger to use, or a shortcut string to choose a ledger automatically. (See <a href="#specifying-ledgers">Specifying a Ledger</a>)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>binary</td>
|
||
<td>Boolean</td>
|
||
<td>(Optional, defaults to False) If set to true, return data nodes as hashed hex strings instead of JSON.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>limit</td>
|
||
<td>Integer</td>
|
||
<td>(Optional, default varies) Limit the number of nodes to retrieve. The server is not required to honor this value.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>marker</td>
|
||
<td><a href="#markers-and-pagination">(Not Specified)</a></td>
|
||
<td>Server-provided value to specify where to resume retrieving data from.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>The <code>ledger</code> field is deprecated and may be removed without further notice.</p>
|
||
<h4 id="response-format-12">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-28"><ul class="codetabs"><li><a href="#code-28-0">WebSocket (binary:true)</a></li><li><a href="#code-28-1">WebSocket (binary:false)</a></li><li><a href="#code-28-2">JSON-RPC (binary:true)</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-28-0" style="position: static;"><pre><code>{
|
||
"id": 2,
|
||
"result": {
|
||
"ledger_hash": "842B57C1CC0613299A686D3E9F310EC0422C84D3911E5056389AA7E5808A93C8",
|
||
"ledger_index": "6885842",
|
||
"marker": "0002A590029B53BE7857EFF9985F770EC792CE483720EB5E963C4D6A607D43DF",
|
||
"state": [
|
||
{
|
||
"data": "11006122000000002400000001250062FEA42D0000000055C204A65CF2542946289A3358C67D991B5E135FABFA89F271DBA7A150C08CA0466240000000354540208114C909F42250CFE8F12A7A1A0DFBD3CBD20F32CD79",
|
||
"index": "00001A2969BE1FC85F1D7A55282FA2E6D95C71D2E4B9C0FDD3D9994F3C00FF8F"
|
||
},
|
||
{
|
||
"data": "11006F22000000002400000003250035788533000000000000000034000000000000000055555B93628BF3EC318892BB7C7CDCB6732FF53D12B6EEC4FAF60DD1AEE1C6101F501071633D7DE1B6AEB32F87F1A73258B13FC8CC32942D53A66D4F038D7EA4C6800064D4838D7EA4C68000000000000000000000000000425443000000000035DD7DF146893456296BF4061FBE68735D28F3286540000000000F42408114A4B8F5F7B644AEDC3447F9459C132EEB016A133B",
|
||
"index": "000037C6659BB98F8D09F2F4CFEB27DE8EFEAFE54DD9E1C13AECDF5794B0C0F5"
|
||
},
|
||
{
|
||
"data": "11006F2200020000240000000A250067395C33000000000000000034000000000000000055A160BC41A45B6BB118DF23D77E4FF23C723431B917F50DCB41319ECC2821F34C5010DFA3B6DDAB58C7E8E5D944E736DA4B7046C30E4F460FD9DE4C1AA535D3D0C00064D554C88B43EFA00000000000000000000000000055534400000000000A20B3C85F482532A9578DBB3950B85CA06594D165400000B59B9F780081148366FB9ACD2A0FD822E31112D2EB6F98C317C2C1",
|
||
"index": "0000A8791F78CC9B39200E12A9BDAACCF40A72A512FA815525CFC9BA772990F7"
|
||
},
|
||
{
|
||
"data": "1100612200000000240000000125003E742F2D0000000055286498B513710CFEB2D723A554C7557983D1952DF4DEE342C40DCB43067C9A21624000000306DC42008114225BAB89C4A4B94624BB069D6DB3C819F934991C",
|
||
"index": "0000B717320558E2DE1A3B9FDB24E9A695BF05D1A44E4A4683212BB1DD0FBA23"
|
||
},
|
||
{
|
||
"data": "110072220002000025000B65783700000000000000003800000000000000005587591A63051645F37B85D1FBA55EE69B1C96BFF16904F5C99F03FB93D42D03756280000000000000000000000000000000000000004254430000000000000000000000000000000000000000000000000166800000000000000000000000000000000000000042544300000000000A20B3C85F482532A9578DBB3950B85CA06594D167D4C38D7EA4C680000000000000000000000000004254430000000000C795FDF8A637BCAAEDAD1C434033506236C82A2D",
|
||
"index": "000103996A3BAD918657F86E12A67D693E8FC8A814DA4B958A244B5F14D93E58"
|
||
}
|
||
]
|
||
},
|
||
"status": "success",
|
||
"type": "response"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-28-1" style="position: static;"><pre><code>{
|
||
"id": 2,
|
||
"result": {
|
||
"ledger_hash": "842B57C1CC0613299A686D3E9F310EC0422C84D3911E5056389AA7E5808A93C8",
|
||
"ledger_index": "6885842",
|
||
"marker": "0002A590029B53BE7857EFF9985F770EC792CE483720EB5E963C4D6A607D43DF",
|
||
"state": [
|
||
{
|
||
"Account": "rKKzk9ghA2iuy3imqMXUHJqdRPMtNDGf4c",
|
||
"Balance": "893730848",
|
||
"Flags": 0,
|
||
"LedgerEntryType": "AccountRoot",
|
||
"OwnerCount": 0,
|
||
"PreviousTxnID": "C204A65CF2542946289A3358C67D991B5E135FABFA89F271DBA7A150C08CA046",
|
||
"PreviousTxnLgrSeq": 6487716,
|
||
"Sequence": 1,
|
||
"index": "00001A2969BE1FC85F1D7A55282FA2E6D95C71D2E4B9C0FDD3D9994F3C00FF8F"
|
||
},
|
||
{
|
||
"Account": "rGryPmNWFognBgMtr9k4quqPbbEcCrhNmD",
|
||
"BookDirectory": "71633D7DE1B6AEB32F87F1A73258B13FC8CC32942D53A66D4F038D7EA4C68000",
|
||
"BookNode": "0000000000000000",
|
||
"Flags": 0,
|
||
"LedgerEntryType": "Offer",
|
||
"OwnerNode": "0000000000000000",
|
||
"PreviousTxnID": "555B93628BF3EC318892BB7C7CDCB6732FF53D12B6EEC4FAF60DD1AEE1C6101F",
|
||
"PreviousTxnLgrSeq": 3504261,
|
||
"Sequence": 3,
|
||
"TakerGets": "1000000",
|
||
"TakerPays": {
|
||
"currency": "BTC",
|
||
"issuer": "rnuF96W4SZoCJmbHYBFoJZpR8eCaxNvekK",
|
||
"value": "1"
|
||
},
|
||
"index": "000037C6659BB98F8D09F2F4CFEB27DE8EFEAFE54DD9E1C13AECDF5794B0C0F5"
|
||
},
|
||
{
|
||
"Account": "rUy8tW38MW9ma7kSjRgB2GHtTkQAFRyrN8",
|
||
"BookDirectory": "DFA3B6DDAB58C7E8E5D944E736DA4B7046C30E4F460FD9DE4C1AA535D3D0C000",
|
||
"BookNode": "0000000000000000",
|
||
"Flags": 131072,
|
||
"LedgerEntryType": "Offer",
|
||
"OwnerNode": "0000000000000000",
|
||
"PreviousTxnID": "A160BC41A45B6BB118DF23D77E4FF23C723431B917F50DCB41319ECC2821F34C",
|
||
"PreviousTxnLgrSeq": 6764892,
|
||
"Sequence": 10,
|
||
"TakerGets": "780000000000",
|
||
"TakerPays": {
|
||
"currency": "USD",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"value": "5850"
|
||
},
|
||
"index": "0000A8791F78CC9B39200E12A9BDAACCF40A72A512FA815525CFC9BA772990F7"
|
||
},
|
||
{
|
||
"Account": "rh3C81VfNDhhWPQWCU8ZGgknvdgNUvRtM9",
|
||
"Balance": "13000000000",
|
||
"Flags": 0,
|
||
"LedgerEntryType": "AccountRoot",
|
||
"OwnerCount": 0,
|
||
"PreviousTxnID": "286498B513710CFEB2D723A554C7557983D1952DF4DEE342C40DCB43067C9A21",
|
||
"PreviousTxnLgrSeq": 4092975,
|
||
"Sequence": 1,
|
||
"index": "0000B717320558E2DE1A3B9FDB24E9A695BF05D1A44E4A4683212BB1DD0FBA23"
|
||
},
|
||
{
|
||
"Balance": {
|
||
"currency": "BTC",
|
||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||
"value": "0"
|
||
},
|
||
"Flags": 131072,
|
||
"HighLimit": {
|
||
"currency": "BTC",
|
||
"issuer": "rKUK9omZqVEnraCipKNFb5q4tuNTeqEDZS",
|
||
"value": "10"
|
||
},
|
||
"HighNode": "0000000000000000",
|
||
"LedgerEntryType": "RippleState",
|
||
"LowLimit": {
|
||
"currency": "BTC",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"value": "0"
|
||
},
|
||
"LowNode": "0000000000000000",
|
||
"PreviousTxnID": "87591A63051645F37B85D1FBA55EE69B1C96BFF16904F5C99F03FB93D42D0375",
|
||
"PreviousTxnLgrSeq": 746872,
|
||
"index": "000103996A3BAD918657F86E12A67D693E8FC8A814DA4B958A244B5F14D93E58"
|
||
}
|
||
]
|
||
},
|
||
"status": "success",
|
||
"type": "response"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-28-2" style="position: static;"><pre><code>200 OK
|
||
{
|
||
"result": {
|
||
"ledger_hash": "842B57C1CC0613299A686D3E9F310EC0422C84D3911E5056389AA7E5808A93C8",
|
||
"ledger_index": "6885842",
|
||
"marker": "0002A590029B53BE7857EFF9985F770EC792CE483720EB5E963C4D6A607D43DF",
|
||
"state": [
|
||
{
|
||
"data": "11006122000000002400000001250062FEA42D0000000055C204A65CF2542946289A3358C67D991B5E135FABFA89F271DBA7A150C08CA0466240000000354540208114C909F42250CFE8F12A7A1A0DFBD3CBD20F32CD79",
|
||
"index": "00001A2969BE1FC85F1D7A55282FA2E6D95C71D2E4B9C0FDD3D9994F3C00FF8F"
|
||
},
|
||
{
|
||
"data": "11006F22000000002400000003250035788533000000000000000034000000000000000055555B93628BF3EC318892BB7C7CDCB6732FF53D12B6EEC4FAF60DD1AEE1C6101F501071633D7DE1B6AEB32F87F1A73258B13FC8CC32942D53A66D4F038D7EA4C6800064D4838D7EA4C68000000000000000000000000000425443000000000035DD7DF146893456296BF4061FBE68735D28F3286540000000000F42408114A4B8F5F7B644AEDC3447F9459C132EEB016A133B",
|
||
"index": "000037C6659BB98F8D09F2F4CFEB27DE8EFEAFE54DD9E1C13AECDF5794B0C0F5"
|
||
},
|
||
{
|
||
"data": "11006F2200020000240000000A250067395C33000000000000000034000000000000000055A160BC41A45B6BB118DF23D77E4FF23C723431B917F50DCB41319ECC2821F34C5010DFA3B6DDAB58C7E8E5D944E736DA4B7046C30E4F460FD9DE4C1AA535D3D0C00064D554C88B43EFA00000000000000000000000000055534400000000000A20B3C85F482532A9578DBB3950B85CA06594D165400000B59B9F780081148366FB9ACD2A0FD822E31112D2EB6F98C317C2C1",
|
||
"index": "0000A8791F78CC9B39200E12A9BDAACCF40A72A512FA815525CFC9BA772990F7"
|
||
},
|
||
{
|
||
"data": "1100612200000000240000000125003E742F2D0000000055286498B513710CFEB2D723A554C7557983D1952DF4DEE342C40DCB43067C9A21624000000306DC42008114225BAB89C4A4B94624BB069D6DB3C819F934991C",
|
||
"index": "0000B717320558E2DE1A3B9FDB24E9A695BF05D1A44E4A4683212BB1DD0FBA23"
|
||
},
|
||
{
|
||
"data": "110072220002000025000B65783700000000000000003800000000000000005587591A63051645F37B85D1FBA55EE69B1C96BFF16904F5C99F03FB93D42D03756280000000000000000000000000000000000000004254430000000000000000000000000000000000000000000000000166800000000000000000000000000000000000000042544300000000000A20B3C85F482532A9578DBB3950B85CA06594D167D4C38D7EA4C680000000000000000000000000004254430000000000C795FDF8A637BCAAEDAD1C434033506236C82A2D",
|
||
"index": "000103996A3BAD918657F86E12A67D693E8FC8A814DA4B958A244B5F14D93E58"
|
||
}
|
||
],
|
||
"status": "success"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>Unsigned Integer</td>
|
||
<td>Sequence number of this ledger</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_hash</td>
|
||
<td>String</td>
|
||
<td>Unique identifying hash of the entire ledger.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>state</td>
|
||
<td>Array</td>
|
||
<td>Array of JSON objects containing data from the tree, as defined below</td>
|
||
</tr>
|
||
<tr>
|
||
<td>marker</td>
|
||
<td><a href="#markers-and-pagination">(Not Specified)</a></td>
|
||
<td>Server-defined value. Pass this to the next call to resume where this call left off.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>The format of each object in the <code>state</code> array depends on whether <code>binary</code> was set to true or not in the request. Each <code>state</code> object may include the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>data</td>
|
||
<td>String</td>
|
||
<td>(Only included if <code>"binary":true</code>) Hex representation of the requested data</td>
|
||
</tr>
|
||
<tr>
|
||
<td>LedgerEntryType</td>
|
||
<td>String</td>
|
||
<td>(Only included if <code>"binary":false</code>) String indicating what type of ledger node this object represents. See <a href="reference-ledger-format.html">ledger format</a> for the full list.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>(Additional fields)</td>
|
||
<td>(Various)</td>
|
||
<td>(Only included if <code>"binary":false</code>) Additional fields describing this object, depending on which LedgerEntryType it is.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>index</td>
|
||
<td>String</td>
|
||
<td>Unique identifier for this ledger entry, as hex.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="possible-errors-12">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a></li>
|
||
<li><code>invalidParams</code> - One or more fields are specified incorrectly, or one or more required fields are missing.</li>
|
||
<li><code>lgrNotFound</code> - The ledger specified by the <code>ledger_hash</code> or <code>ledger_index</code> does not exist, or it does exist but the server does not have it.</li>
|
||
</ul>
|
||
<h2 id="ledger-entry">ledger_entry</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/LedgerEntry.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>ledger_entry</code> method returns a single ledger node from the Ripple Consensus Ledger in its raw format. See <a href="reference-ledger-format.html">ledger format</a> for information on the different types of objects you can retrieve.</p>
|
||
<p class="devportal-callout note"><strong>Note:</strong> There is no commandline version of this method. You can use the <a href="#json"><code>json</code> command</a> to access this method from the commandline instead.</p>
|
||
<h4 id="request-format-13">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-29"><ul class="codetabs"><li><a href="#code-29-0">WebSocket</a></li><li><a href="#code-29-1">JSON-RPC</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-29-0" style="position: static;"><pre><code>{
|
||
"id": 3,
|
||
"command": "ledger_entry",
|
||
"type": "account_root",
|
||
"account_root": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"ledger_index": "validated"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-29-1" style="position: static;"><pre><code>{
|
||
"method": "ledger_entry",
|
||
"params": [
|
||
{
|
||
"account_root": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"ledger_index": "validated",
|
||
"type": "account_root"
|
||
}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p><a class="button" href="ripple-api-tool.html#ledger_entry">Try it! ></a></p>
|
||
<p>This method can retrieve several different types of data. You can select which type of item to retrieve by passing the appropriate parameters. Specifically, you should provide exactly one of the following fields:</p>
|
||
<ol>
|
||
<li><code>index</code> - Retrieve any type of ledger node by its unique index</li>
|
||
<li><code>account_root</code> - Retrieve an <a href="reference-ledger-format.html#accountroot">AccountRoot node</a>. This is roughly equivalent to the <a href="#account-info">account_info</a> command.</li>
|
||
<li><code>directory</code> - Retrieve a <a href="reference-ledger-format.html#directorynode">DirectoryNode</a>, which contains a list of other nodes</li>
|
||
<li><code>offer</code> - Retrieve an <a href="reference-ledger-format.html#offer">Offer node</a>, which defines an offer to exchange currency</li>
|
||
<li><code>ripple_state</code> - Retrieve a <a href="reference-ledger-format.html#ripplestate">RippleState node</a>, which tracks a (non-XRP) currency balance between two accounts.</li>
|
||
</ol>
|
||
<p>If you specify more than one of the above items, the server retrieves only of them; it is undefined which it chooses.</p>
|
||
<p>The full list of parameters recognized by this method is as follows:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>index</td>
|
||
<td>String</td>
|
||
<td>(Optional) Specify the unique identifier of a single ledger entry to retrieve.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>account_root</td>
|
||
<td>String - <a href="#addresses">Address</a></td>
|
||
<td>(Optional) Specify an <a href="reference-ledger-format.html#accountroot">AccountRoot node</a> to retrieve.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>directory</td>
|
||
<td>Object or String</td>
|
||
<td>(Optional) Specify a <a href="reference-ledger-format.html#directorynode">DirectoryNode</a>. (Directory nodes each contain a list of IDs for things contained in them.) If a string, interpret as the <a href="reference-ledger-format.html#tree-format">unique index</a> to the directory, in hex. If an object, requires either <code>dir_root</code> or <code>owner</code> as a sub-field, plus optionally a <code>sub_index</code> sub-field.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>directory.sub_index</td>
|
||
<td>Unsigned Integer</td>
|
||
<td>(Optional) If provided, jumps to a further sub-node in the <a href="reference-ledger-format.html#directorynode">DirectoryNode</a>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>directory.dir_root</td>
|
||
<td>String</td>
|
||
<td>(Required if <code>directory</code> is specified as an object and <code>directory.owner</code> is not provided) Unique index identifying the directory to retrieve, as a hex string.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>directory.owner</td>
|
||
<td>String</td>
|
||
<td>(Required if <code>directory</code> is specified as an object and <code>directory.dir_root</code> is not provided) Unique address of the account associated with this directory</td>
|
||
</tr>
|
||
<tr>
|
||
<td>offer</td>
|
||
<td>Object or String</td>
|
||
<td>(Optional) Specify an <a href="reference-ledger-format.html#offer">Offer node</a> to retrieve. If a string, interpret as the <a href="reference-ledger-format.html#tree-format">unique index</a> to the Offer. If an object, requires the sub-fields <code>account</code> and <code>seq</code> to uniquely identify the offer.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>offer.account</td>
|
||
<td>String - <a href="#addresses">Address</a></td>
|
||
<td>(Required if <code>offer</code> specified) The account that placed the offer.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>offer.seq</td>
|
||
<td>Unsigned Integer</td>
|
||
<td>(Required if <code>offer</code> specified) The sequence number of the transaction that created the Offer node.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ripple_state</td>
|
||
<td>Object</td>
|
||
<td>(Optional) Object specifying the RippleState (trust line) node to retrieve. The <code>accounts</code> and <code>currency</code> sub-fields are required to uniquely specify the RippleState entry to retrieve.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ripple_state.accounts</td>
|
||
<td>Array</td>
|
||
<td>(Required if <code>ripple_state</code> specified) 2-length array of account <a href="#addresses">Address</a>es, defining the two accounts linked by this <a href="reference-ledger-format.html#ripplestate">RippleState node</a></td>
|
||
</tr>
|
||
<tr>
|
||
<td>ripple_state.currency</td>
|
||
<td>String</td>
|
||
<td>(Required if <code>ripple_state</code> specified) <a href="#currency-codes">Currency Code</a> of the <a href="reference-ledger-format.html#ripplestate">RippleState node</a> to retrieve.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>binary</td>
|
||
<td>Boolean</td>
|
||
<td>(Optional, defaults to false) If true, return the requested ledger node's contents as a hex string. Otherwise, return data in JSON format.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_hash</td>
|
||
<td>String</td>
|
||
<td>(Optional) A 20-byte hex string for the ledger version to use. (See <a href="#specifying-ledgers">Specifying a Ledger</a>)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>String or Unsigned Integer</td>
|
||
<td>(Optional) The sequence number of the ledger to use, or a shortcut string to choose a ledger automatically. (See <a href="#specifying-ledgers">Specifying a Ledger</a>)</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>The <code>generator</code> and <code>ledger</code> parameters are deprecated and may be removed without further notice.</p>
|
||
<h4 id="response-format-13">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-30"><ul class="codetabs"><li><a href="#code-30-0">WebSocket</a></li><li><a href="#code-30-1">JSON-RPC</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-30-0" style="position: static;"><pre><code> "id": 3,
|
||
"result": {
|
||
"index": "4F83A2CF7E70F77F79A307E6A472BFC2585B806A70833CCD1C26105BAE0D6E05",
|
||
"ledger_index": 6889347,
|
||
"node": {
|
||
"Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"Balance": "27389517749",
|
||
"Flags": 0,
|
||
"LedgerEntryType": "AccountRoot",
|
||
"OwnerCount": 18,
|
||
"PreviousTxnID": "B6B410172C0B65575D89E464AF5B99937CC568822929ABF87DA75CBD11911932",
|
||
"PreviousTxnLgrSeq": 6592159,
|
||
"Sequence": 1400,
|
||
"index": "4F83A2CF7E70F77F79A307E6A472BFC2585B806A70833CCD1C26105BAE0D6E05"
|
||
}
|
||
},
|
||
"status": "success",
|
||
"type": "response"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-30-1" style="position: static;"><pre><code>200 OK
|
||
{
|
||
"result": {
|
||
"index": "4F83A2CF7E70F77F79A307E6A472BFC2585B806A70833CCD1C26105BAE0D6E05",
|
||
"ledger_index": 8696234,
|
||
"node": {
|
||
"Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"Balance": "13176802787",
|
||
"Flags": 0,
|
||
"LedgerEntryType": "AccountRoot",
|
||
"OwnerCount": 17,
|
||
"PreviousTxnID": "E5D0235A236F7CD162C1AB87A0325056AE61CFC63D92D1494AB5D826AAD0CDCA",
|
||
"PreviousTxnLgrSeq": 8554742,
|
||
"Sequence": 1406,
|
||
"index": "4F83A2CF7E70F77F79A307E6A472BFC2585B806A70833CCD1C26105BAE0D6E05"
|
||
},
|
||
"status": "success",
|
||
"validated": true
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>index</td>
|
||
<td>String</td>
|
||
<td>Unique identifying key for this ledger_entry</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>Unsigned Integer</td>
|
||
<td>Unique sequence number of the ledger from which this data was retrieved</td>
|
||
</tr>
|
||
<tr>
|
||
<td>node</td>
|
||
<td>Object</td>
|
||
<td>(Omitted if <code>"binary": true</code> specified.) Object containing the data of this ledger node, according to the <a href="reference-ledger-format.html">ledger format</a>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>node_binary</td>
|
||
<td>String</td>
|
||
<td>(Omitted unless <code>"binary":true</code> specified) Binary data of the ledger node, as hex.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="possible-errors-13">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>invalidParams</code> - One or more fields are specified incorrectly, or one or more required fields are missing.</li>
|
||
<li><code>lgrNotFound</code> - The ledger specified by the <code>ledger_hash</code> or <code>ledger_index</code> does not exist, or it does exist but the server does not have it.</li>
|
||
</ul>
|
||
<h2 id="ledger-request">ledger_request</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/e980e69eca9ea843d200773eb1f43abe3848f1a0/src/ripple/rpc/handlers/LedgerRequest.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>ledger_request</code> command tells server to fetch a specific ledger version from its connected peers. This only works if one of the server's immediately-connected peers has that ledger. You may need to run the command several times to completely fetch a ledger.</p>
|
||
<p><em>The <code>ledger_request</code> request is an <a href="#connecting-to-rippled">admin command</a> that cannot be run by unpriviledged users!</em></p>
|
||
<h4 id="request-format-14">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-31"><ul class="codetabs"><li><a href="#code-31-0">WebSocket</a></li><li><a href="#code-31-1">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-31-0" style="position: static;"><pre><code>{
|
||
"id": 102,
|
||
"command": "ledger_request",
|
||
"ledger_index": 13800000
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-31-1" style="position: static;"><pre><code>rippled ledger_request 13800000
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The request includes the following parameters:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>Number</td>
|
||
<td>(Optional) Retrieve the specified ledger by its <a href="#ledger-index">Ledger Index</a>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_hash</td>
|
||
<td>String</td>
|
||
<td>(Optional) Retrieve the specified ledger by its identifying <a href="#hashes">Hash</a>.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>You must provide either <code>ledger_index</code> or <code>ledger_hash</code> but not both.</p>
|
||
<h4 id="response-format-14">Response Format</h4>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>. However, the request returns a failure response if it does not have the specified ledger <em>even if it successfully instructed the <code>rippled</code> server to start retrieving the ledger</em>.</p>
|
||
<p class="devportal-callout note"><strong>Note:</strong> To retrieve a ledger, the rippled server must have a direct peer with that ledger in its history. If none of the peers have the requested ledger, you can use the <a href="#connect"><code>connect</code> command</a> or the <code>fixed_ips</code> section of the config file to add Ripple's full-history server at <code>s2.ripple.com</code> and then make the <code>ledger_request</code> request again.</p>
|
||
<p>A failure response indicates the status of fetching the ledger. A successful response contains the information for the ledger in a similar format to the <a href="#ledger"><code>ledger</code> command</a>.</p>
|
||
<div class="multicode" id="code-32"><ul class="codetabs"><li><a href="#code-32-0">Commandline (failure)</a></li><li><a href="#code-32-1">Commandline (in-progress)</a></li><li><a href="#code-32-2">Commandline (success)</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-32-0" style="position: static;"><pre><code>Loading: "/etc/rippled.cfg"
|
||
Connecting to 127.0.0.1:5005
|
||
{
|
||
"result" : {
|
||
"acquiring" : {
|
||
"hash" : "01DDD89B6605E20338B8EEB8EB2B0E0DD2F685A2B164F3790C4D634B5734CC26",
|
||
"have_header" : false,
|
||
"peers" : 2,
|
||
"timeouts" : 0
|
||
},
|
||
"error" : "lgrNotFound",
|
||
"error_code" : 20,
|
||
"error_message" : "acquiring ledger containing requested index",
|
||
"request" : {
|
||
"command" : "ledger_request",
|
||
"ledger_index" : 18851277
|
||
},
|
||
"status" : "error"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-32-1" style="position: static;"><pre><code>Loading: "/etc/rippled.cfg"
|
||
Connecting to 127.0.0.1:5005
|
||
{
|
||
"result" : {
|
||
"hash" : "EB68B5B4F6F06BF59B6D7532BCB98BB98E2F10C2435D895217AA0AA7E910FBD5",
|
||
"have_header" : true,
|
||
"have_state" : false,
|
||
"have_transactions" : false,
|
||
"needed_state_hashes" : [
|
||
"C46F7B9E795135447AF24BAF999AB8FC1612A997F6EAAF8B784C226FF0BD8E25",
|
||
"E48F528E4FC2A1DC492C6264B27B420E2285B2A3ECF3A253DB480DA5BFB7F858",
|
||
"B62CD0B2E1277F78BC279FA037F3F747587299B60D23A551C3F63DD137DC0CF8",
|
||
"30014C55701FB8426E496A47B297BEC9E8F5BFA47763CC22DBD9024CC81D39DD",
|
||
"7EB59A853913898FCEA7B701637F33B1054BD36C32A0B910B612EFB9CDFF6334",
|
||
"07ECAD3066D62583883979A2FADAADC8F7D89FA07375843C8A47452639AB2421",
|
||
"97A87E5246AF78463485CB27E08D561E22AAF33D5E2F08FE2FACAE0D05CB5478",
|
||
"50A0525E238629B32324C9F59B4ECBEFE3C21DC726DB9AB3B6758BD1838DFF68",
|
||
"8C541B1ED47C9282E2A28F0B7F3DDFADF06644CAB71B15A3E67D04C5FAFE9BF4",
|
||
"2C6CC536C778D8C0F601E35DA7DD9888C288897E4F603E76357CE2F47E8A7A9F",
|
||
"309E78DEC67D5725476A59E114850556CC693FB6D92092997ADE97E3EFF473CC",
|
||
"8EFF61B6A636AF6B4314CAC0C08F4FED0759E1F782178A822EDE98275E5E4B10",
|
||
"9535645E5D249AC0B6126005B79BB981CBA00286E00154D20A3BCF65743EA3CA",
|
||
"69F5D6FCB41D1E6CEA5ADD42CBD194086B45E957D497DF7AEE62ADAD485660CE",
|
||
"07E93A95DBB0B8A00925DE0DF6D27E41CACC77EF75055A89815006109D82EAD3",
|
||
"7FDF25F660235DCAD649676E3E6729DF920A9B0B4B6A3B090A3C64D7BDE2FB20"
|
||
],
|
||
"needed_transaction_hashes" : [
|
||
"BA914854F2F5EDFCBD6E3E0B168E5D4CD0FC92927BEE408C6BD38D4F52505A34",
|
||
"AE3A2DB537B01EB33BB3A677242DE52C9AE0A64BD9222EE55E52855276E7EA2A",
|
||
"E145F737B255D93769673CBA6DEBA4F6AC7387A309DAACC72EA5B07ECF03C215",
|
||
"073A118552AA60E1D3C6BE6F65E4AFA01C582D9C41CCC2887244C19D9BFA7741",
|
||
"562DB8580CD3FE19AF5CEA61C2858C10091151B924DBF2AEB7CBB8722E683204",
|
||
"437C0D1C2391057079E9539CF028823D29E6437A965284F6E54CEBF1D25C5D56",
|
||
"1F069486AF5533883609E5C8DB907E97273D9A782DF26F5E5811F1C42ED63A3D",
|
||
"CAA6B7DA68EBA71254C218C81A9EA029A179694BDD0D75A49FB03A7D57BCEE49"
|
||
],
|
||
"peers" : 6,
|
||
"status" : "success",
|
||
"timeouts" : 1
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-32-2" style="position: static;"><pre><code>Loading: "/etc/rippled.cfg"
|
||
Connecting to 127.0.0.1:5005
|
||
{
|
||
"result" : {
|
||
"ledger" : {
|
||
"accepted" : true,
|
||
"account_hash" : "84EBB27D9510AD5B9A3A328201921B3FD418D4A349E85D3DC69E33C7B506407F",
|
||
"close_time" : 486691300,
|
||
"close_time_human" : "2015-Jun-04 00:01:40",
|
||
"close_time_resolution" : 10,
|
||
"closed" : true,
|
||
"hash" : "DCF5D723ECEE1EF56D2B0024CD9BDFF2D8E3DC211BD2B9460165922564ACD863",
|
||
"ledger_hash" : "DCF5D723ECEE1EF56D2B0024CD9BDFF2D8E3DC211BD2B9460165922564ACD863",
|
||
"ledger_index" : "13840000",
|
||
"parent_hash" : "8A3F6FBC62C11DE4538D969F9C7966234635FE6CEB1133DDC37220978F8100A9",
|
||
"seqNum" : "13840000",
|
||
"totalCoins" : "99999022883526403",
|
||
"total_coins" : "99999022883526403",
|
||
"transaction_hash" : "3D759EF3AF1AE2F78716A8CCB2460C3030F82687E54206E883703372B9E1770C"
|
||
},
|
||
"ledger_index" : 13840000,
|
||
"status" : "success"
|
||
}
|
||
}
|
||
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The three possible response formats are as follows:</p>
|
||
<ol>
|
||
<li>When returning a <code>lgrNotFound</code> error, the response has a field, <code>acquiring</code> with a <a href="#ledger-request-object">Ledger Request Object</a> indicating the progress of fetching the ledger from the peer-to-peer network.</li>
|
||
<li>When the response shows the server is currently fetching the ledger, the body of the result is a <a href="#ledger-request-object">Ledger Request Object</a> indicating the progress of fetching the ledger from the peer-to-peer network.</li>
|
||
<li>When the ledger is fully available, the response is a representation of the <a href="reference-ledger-format.html#header-format">ledger header</a>.</li>
|
||
</ol>
|
||
<h4 id="ledger-request-object">Ledger Request Object</h4>
|
||
<p>When the server is in the progress of fetching a ledger, but has not yet finished, the <code>rippled</code> server returns a ledger request object indicating its progress towards fetching the ledger. This object has the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>hash</td>
|
||
<td>String</td>
|
||
<td>(May be omitted) The <a href="#hashes">Hash</a> of the requested ledger, if the server knows it.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>have_header</td>
|
||
<td>Boolean</td>
|
||
<td>Whether the server has the header section of the requested ledger.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>have_state</td>
|
||
<td>Boolean</td>
|
||
<td>(May be omitted) Whether the server has the <a href="reference-ledger-format.html#tree-format">account-state section</a> of the requested ledger.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>have_transactions</td>
|
||
<td>Boolean</td>
|
||
<td>(May be omitted) Whether the server has the transaction section of the requested ledger.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>needed_state_hashes</td>
|
||
<td>Array of Strings</td>
|
||
<td>(May be omitted) Up to 16 hashes of nodes in the <a href="reference-ledger-format.html#tree-format">state tree</a> that the server still needs to retrieve.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>needed_transaction_hashes</td>
|
||
<td>Array of Strings</td>
|
||
<td>(May be omitted) Up to 16 hashes of nodes in the transaction tree that the server still needs to retrieve.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>peers</td>
|
||
<td>Number</td>
|
||
<td>How many peers the server is querying to find this ledger.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>timeouts</td>
|
||
<td>Number</td>
|
||
<td>Number of times fetching this ledger has timed out so far.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="possible-errors-14">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>invalidParams</code> - One or more fields are specified incorrectly, or one or more required fields are missing. This error can also occur if you specify a ledger index equal or higher than the current in-progress ledger.</li>
|
||
<li><code>lgrNotFound</code> - If the ledger is not yet available. This indicates that the server has started fetching the ledger, although it may fail if none of its connected peers have the requested ledger. <em>(<strong>Note:</strong> Prior to <a href="https://github.com/ripple/rippled/releases/tag/0.30.1">version 0.30.1</a>, this error used the code <code>ledgerNotFound</code> instead.)</em></li>
|
||
</ul>
|
||
<h2 id="ledger-accept">ledger_accept</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/a61ffab3f9010d8accfaa98aa3cacc7d38e74121/src/ripple/rpc/handlers/LedgerAccept.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>ledger_accept</code> method forces the server to close the current-working ledger and move to the next ledger number. This method is intended for testing purposes only, and is only available when the <code>rippled</code> server is running stand-alone mode.</p>
|
||
<p><em>The <code>ledger_accept</code> method is an <a href="#connecting-to-rippled">admin command</a> that cannot be run by unpriviledged users!</em></p>
|
||
<h4 id="request-format-15">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-33"><ul class="codetabs"><li><a href="#code-33-0">WebSocket</a></li><li><a href="#code-33-1">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-33-0" style="position: static;"><pre><code>{
|
||
"id": "Accept my ledger!",
|
||
"command": "ledger_accept"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-33-1" style="position: static;"><pre><code>#Syntax: ledger_accept
|
||
rippled ledger_accept
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The request accepts no parameters.</p>
|
||
<h4 id="response-format-15">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<pre><code class="js">{
|
||
"id": "Accept my ledger!",
|
||
"status": "success",
|
||
"type": "response",
|
||
"result": {
|
||
"ledger_current_index": 6643240
|
||
}
|
||
}
|
||
</code></pre>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing the following field:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>ledger_current_index</td>
|
||
<td>Unsigned Integer</td>
|
||
<td>Sequence number of the newly created 'current' ledger</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p class="devportal-callout note"><strong>Note:</strong> When you close a ledger, <code>rippled</code> determines the canonical order of transactions in that ledger and replays them. This can change the outcome of transactions that were provisionally applied to the current ledger.</p>
|
||
<h4 id="possible-errors-15">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>notStandAlone</code> - If the <code>rippled</code> server is not currently running in stand-alone mode.</li>
|
||
</ul>
|
||
<h1 id="transactions">Transactions</h1>
|
||
<p>Transactions are the only thing that can modify the shared global ledger of the Ripple Network. All business on the Ripple Network takes the form of transactions, which include not only payments, but also currency-exchange offers, account settings, and changes to the properties of the network itself (like adopting new features).</p>
|
||
<p>There are several sources of complication in transactions. Unlike traditional banking, where a trusted third party (the bank, or the <a href="http://en.wikipedia.org/wiki/Automated_Clearing_House">ACH</a>) verifies the participants' identities and ensures their balances are adjusted accurately, Ripple uses cryptography and decentralized computing power to do the same thing. Sending XRP, the Ripple Network's native crypto-currency, requires no third party aside from the distributed network itself. However, that is missing out on the key feature of Ripple: unlike individual crypto-currencies, the Ripple Network natively supports balances in any currency. This brings far more power, but it also means that the system must account for <a href="http://en.wikipedia.org/wiki/Counterparty_risk#Counterparty_risk">counterparty risk</a>, currency conversions, and other issues. The Ripple Network must be robust to keep track of which transactions have been completely validated, even when subject to hardware failures, attacks, or natural disasters.</p>
|
||
<h2 id="tx">tx</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/Tx.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>tx</code> method retrieves information on a single transaction.</p>
|
||
<h4 id="request-format-16">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-34"><ul class="codetabs"><li><a href="#code-34-0">WebSocket</a></li><li><a href="#code-34-1">JSON-RPC</a></li><li><a href="#code-34-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-34-0" style="position: static;"><pre><code>{
|
||
"id": 1,
|
||
"command": "tx",
|
||
"transaction": "E08D6E9754025BA2534A78707605E0601F03ACE063687A0CA1BDDACFCD1698C7",
|
||
"binary": false
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-34-1" style="position: static;"><pre><code>{
|
||
"method": "tx",
|
||
"params": [
|
||
{
|
||
"transaction": "E08D6E9754025BA2534A78707605E0601F03ACE063687A0CA1BDDACFCD1698C7",
|
||
"binary": false
|
||
}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-34-2" style="position: static;"><pre><code>#Syntax: tx transaction [binary]
|
||
rippled tx E08D6E9754025BA2534A78707605E0601F03ACE063687A0CA1BDDACFCD1698C7 false
|
||
</code></pre></div>
|
||
</div>
|
||
<p><a class="button" href="ripple-api-tool.html#tx">Try it! ></a></p>
|
||
<p>The request includes the following parameters:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>transaction</td>
|
||
<td>String</td>
|
||
<td>The 256-bit hash of the transaction, as hex.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>binary</td>
|
||
<td>Boolean</td>
|
||
<td>(Optional, defaults to false) If true, return transaction data and metadata as hex strings instead of JSON</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="response-format-16">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-35"><ul class="codetabs"><li><a href="#code-35-0">WebSocket</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-35-0" style="position: static;"><pre><code>{
|
||
"id": 1,
|
||
"result": {
|
||
"Account": "r3PDtZSa5LiYp1Ysn1vMuMzB59RzV3W9QH",
|
||
"Amount": {
|
||
"currency": "USD",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "1"
|
||
},
|
||
"Destination": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"Fee": "10",
|
||
"Flags": 0,
|
||
"Paths": [
|
||
[
|
||
{
|
||
"account": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV",
|
||
"currency": "USD",
|
||
"issuer": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV",
|
||
"type": 49,
|
||
"type_hex": "0000000000000031"
|
||
}
|
||
],
|
||
[
|
||
{
|
||
"account": "rD1jovjQeEpvaDwn9wKaYokkXXrqo4D23x",
|
||
"currency": "USD",
|
||
"issuer": "rD1jovjQeEpvaDwn9wKaYokkXXrqo4D23x",
|
||
"type": 49,
|
||
"type_hex": "0000000000000031"
|
||
},
|
||
{
|
||
"account": "rB5TihdPbKgMrkFqrqUC3yLdE8hhv4BdeY",
|
||
"currency": "USD",
|
||
"issuer": "rB5TihdPbKgMrkFqrqUC3yLdE8hhv4BdeY",
|
||
"type": 49,
|
||
"type_hex": "0000000000000031"
|
||
},
|
||
{
|
||
"account": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV",
|
||
"currency": "USD",
|
||
"issuer": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV",
|
||
"type": 49,
|
||
"type_hex": "0000000000000031"
|
||
}
|
||
]
|
||
],
|
||
"SendMax": {
|
||
"currency": "USD",
|
||
"issuer": "r3PDtZSa5LiYp1Ysn1vMuMzB59RzV3W9QH",
|
||
"value": "1.01"
|
||
},
|
||
"Sequence": 88,
|
||
"SigningPubKey": "02EAE5DAB54DD8E1C49641D848D5B97D1B29149106174322EDF98A1B2CCE5D7F8E",
|
||
"TransactionType": "Payment",
|
||
"TxnSignature": "30440220791B6A3E036ECEFFE99E8D4957564E8C84D1548C8C3E80A87ED1AA646ECCFB16022037C5CAC97E34E3021EBB426479F2ACF3ACA75DB91DCC48D1BCFB4CF547CFEAA0",
|
||
"hash": "E08D6E9754025BA2534A78707605E0601F03ACE063687A0CA1BDDACFCD1698C7",
|
||
"inLedger": 348734,
|
||
"ledger_index": 348734,
|
||
"meta": {
|
||
"AffectedNodes": [
|
||
{
|
||
"ModifiedNode": {
|
||
"FinalFields": {
|
||
"Account": "r3PDtZSa5LiYp1Ysn1vMuMzB59RzV3W9QH",
|
||
"Balance": "59328999119",
|
||
"Flags": 0,
|
||
"OwnerCount": 11,
|
||
"Sequence": 89
|
||
},
|
||
"LedgerEntryType": "AccountRoot",
|
||
"LedgerIndex": "E0D7BDE68B468FF0B8D948FD865576517DA987569833A05374ADB9A72E870A06",
|
||
"PreviousFields": {
|
||
"Balance": "59328999129",
|
||
"Sequence": 88
|
||
},
|
||
"PreviousTxnID": "C26AA6B4F7C3B9F55E17CD0D11F12032A1C7AD2757229FFD277C9447A8815E6E",
|
||
"PreviousTxnLgrSeq": 348700
|
||
}
|
||
},
|
||
{
|
||
"ModifiedNode": {
|
||
"FinalFields": {
|
||
"Balance": {
|
||
"currency": "USD",
|
||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||
"value": "-1"
|
||
},
|
||
"Flags": 131072,
|
||
"HighLimit": {
|
||
"currency": "USD",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "100"
|
||
},
|
||
"HighNode": "0000000000000000",
|
||
"LowLimit": {
|
||
"currency": "USD",
|
||
"issuer": "r3PDtZSa5LiYp1Ysn1vMuMzB59RzV3W9QH",
|
||
"value": "0"
|
||
},
|
||
"LowNode": "0000000000000000"
|
||
},
|
||
"LedgerEntryType": "RippleState",
|
||
"LedgerIndex": "EA4BF03B4700123CDFFB6EB09DC1D6E28D5CEB7F680FB00FC24BC1C3BB2DB959",
|
||
"PreviousFields": {
|
||
"Balance": {
|
||
"currency": "USD",
|
||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||
"value": "0"
|
||
}
|
||
},
|
||
"PreviousTxnID": "53354D84BAE8FDFC3F4DA879D984D24B929E7FEB9100D2AD9EFCD2E126BCCDC8",
|
||
"PreviousTxnLgrSeq": 343570
|
||
}
|
||
}
|
||
],
|
||
"TransactionIndex": 0,
|
||
"TransactionResult": "tesSUCCESS"
|
||
},
|
||
"validated": true
|
||
},
|
||
"status": "success",
|
||
"type": "response"
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing the fields of the <a href="reference-transaction-format.html">Transaction object</a> as well as the following additional fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>hash</td>
|
||
<td>String</td>
|
||
<td>The SHA-512 hash of the transaction</td>
|
||
</tr>
|
||
<tr>
|
||
<td>inLedger</td>
|
||
<td>Unsigned Integer</td>
|
||
<td>(Deprecated) Alias for <code>ledger_index</code>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>Unsigned Integer</td>
|
||
<td>The sequence number of the ledger that includes this transaction.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>meta</td>
|
||
<td>Object</td>
|
||
<td>Various metadata about the transaction.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>validated</td>
|
||
<td>Boolean</td>
|
||
<td>True if this data is from a validated ledger version; if omitted or set to false, this data is not final.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>(Various)</td>
|
||
<td>(Various)</td>
|
||
<td>Other fields from the <a href="reference-transaction-format.html">Transaction object</a></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="possible-errors-16">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>invalidParams</code> - One or more fields are specified incorrectly, or one or more required fields are missing.</li>
|
||
<li><code>txnNotFound</code> - Either the transaction does not exist, or it was part of an older ledger version that <code>rippled</code> does not have available.</li>
|
||
</ul>
|
||
<h2 id="transaction-entry">transaction_entry</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/TransactionEntry.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>transaction_entry</code> method retrieves information on a single transaction from a specific ledger version. (The <a href="#tx"><code>tx</code></a> command, by contrast, searches all ledgers for the specified transaction. We recommend using that method instead.)</p>
|
||
<h4 id="request-format-17">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-36"><ul class="codetabs"><li><a href="#code-36-0">WebSocket</a></li><li><a href="#code-36-1">JSON-RPC</a></li><li><a href="#code-36-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-36-0" style="position: static;"><pre><code>{
|
||
"id": 4,
|
||
"command": "transaction_entry",
|
||
"tx_hash": "E08D6E9754025BA2534A78707605E0601F03ACE063687A0CA1BDDACFCD1698C7",
|
||
"ledger_index": 348734
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-36-1" style="position: static;"><pre><code>{
|
||
"method": "transaction_entry",
|
||
"params": [
|
||
{
|
||
"tx_hash": "E08D6E9754025BA2534A78707605E0601F03ACE063687A0CA1BDDACFCD1698C7",
|
||
"ledger_index": 348734
|
||
}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-36-2" style="position: static;"><pre><code>#Syntax: transaction_entry transaction_hash ledger_index|ledger_hash
|
||
rippled transaction_entry E08D6E9754025BA2534A78707605E0601F03ACE063687A0CA1BDDACFCD1698C7 348734
|
||
</code></pre></div>
|
||
</div>
|
||
<p><a class="button" href="ripple-api-tool.html#transaction_entry">Try it! ></a></p>
|
||
<p>The request includes the following parameters:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>ledger_hash</td>
|
||
<td>String</td>
|
||
<td>(Optional) A 20-byte hex string for the ledger version to use. (See <a href="#specifying-ledgers">Specifying a Ledger</a>)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>String or Unsigned Integer</td>
|
||
<td>(Optional) The sequence number of the ledger to use, or a shortcut string to choose a ledger automatically. (See <a href="#specifying-ledgers">Specifying a Ledger</a>)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>tx_hash</td>
|
||
<td>String</td>
|
||
<td>Unique hash of the transaction you are looking up</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p class="devportal-callout note"><strong>Note:</strong> This method does not support retrieving information from the current in-progress ledger. You must specify a ledger version in either <code>ledger_index</code> or <code>ledger_hash</code>.</p>
|
||
<h4 id="response-format-17">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-37"><ul class="codetabs"><li><a href="#code-37-0">WebSocket</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-37-0" style="position: static;"><pre><code>{
|
||
"id": 4,
|
||
"result": {
|
||
"ledger_index": 348734,
|
||
"metadata": {
|
||
"AffectedNodes": [
|
||
{
|
||
"ModifiedNode": {
|
||
"FinalFields": {
|
||
"Account": "r3PDtZSa5LiYp1Ysn1vMuMzB59RzV3W9QH",
|
||
"Balance": "59328999119",
|
||
"Flags": 0,
|
||
"OwnerCount": 11,
|
||
"Sequence": 89
|
||
},
|
||
"LedgerEntryType": "AccountRoot",
|
||
"LedgerIndex": "E0D7BDE68B468FF0B8D948FD865576517DA987569833A05374ADB9A72E870A06",
|
||
"PreviousFields": {
|
||
"Balance": "59328999129",
|
||
"Sequence": 88
|
||
},
|
||
"PreviousTxnID": "C26AA6B4F7C3B9F55E17CD0D11F12032A1C7AD2757229FFD277C9447A8815E6E",
|
||
"PreviousTxnLgrSeq": 348700
|
||
}
|
||
},
|
||
{
|
||
"ModifiedNode": {
|
||
"FinalFields": {
|
||
"Balance": {
|
||
"currency": "USD",
|
||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||
"value": "-1"
|
||
},
|
||
"Flags": 131072,
|
||
"HighLimit": {
|
||
"currency": "USD",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "100"
|
||
},
|
||
"HighNode": "0000000000000000",
|
||
"LowLimit": {
|
||
"currency": "USD",
|
||
"issuer": "r3PDtZSa5LiYp1Ysn1vMuMzB59RzV3W9QH",
|
||
"value": "0"
|
||
},
|
||
"LowNode": "0000000000000000"
|
||
},
|
||
"LedgerEntryType": "RippleState",
|
||
"LedgerIndex": "EA4BF03B4700123CDFFB6EB09DC1D6E28D5CEB7F680FB00FC24BC1C3BB2DB959",
|
||
"PreviousFields": {
|
||
"Balance": {
|
||
"currency": "USD",
|
||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||
"value": "0"
|
||
}
|
||
},
|
||
"PreviousTxnID": "53354D84BAE8FDFC3F4DA879D984D24B929E7FEB9100D2AD9EFCD2E126BCCDC8",
|
||
"PreviousTxnLgrSeq": 343570
|
||
}
|
||
}
|
||
],
|
||
"TransactionIndex": 0,
|
||
"TransactionResult": "tesSUCCESS"
|
||
},
|
||
"tx_json": {
|
||
"Account": "r3PDtZSa5LiYp1Ysn1vMuMzB59RzV3W9QH",
|
||
"Amount": {
|
||
"currency": "USD",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "1"
|
||
},
|
||
"Destination": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"Fee": "10",
|
||
"Flags": 0,
|
||
"Paths": [
|
||
[
|
||
{
|
||
"account": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV",
|
||
"currency": "USD",
|
||
"issuer": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV",
|
||
"type": 49,
|
||
"type_hex": "0000000000000031"
|
||
}
|
||
],
|
||
[
|
||
{
|
||
"account": "rD1jovjQeEpvaDwn9wKaYokkXXrqo4D23x",
|
||
"currency": "USD",
|
||
"issuer": "rD1jovjQeEpvaDwn9wKaYokkXXrqo4D23x",
|
||
"type": 49,
|
||
"type_hex": "0000000000000031"
|
||
},
|
||
{
|
||
"account": "rB5TihdPbKgMrkFqrqUC3yLdE8hhv4BdeY",
|
||
"currency": "USD",
|
||
"issuer": "rB5TihdPbKgMrkFqrqUC3yLdE8hhv4BdeY",
|
||
"type": 49,
|
||
"type_hex": "0000000000000031"
|
||
},
|
||
{
|
||
"account": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV",
|
||
"currency": "USD",
|
||
"issuer": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV",
|
||
"type": 49,
|
||
"type_hex": "0000000000000031"
|
||
}
|
||
]
|
||
],
|
||
"SendMax": {
|
||
"currency": "USD",
|
||
"issuer": "r3PDtZSa5LiYp1Ysn1vMuMzB59RzV3W9QH",
|
||
"value": "1.01"
|
||
},
|
||
"Sequence": 88,
|
||
"SigningPubKey": "02EAE5DAB54DD8E1C49641D848D5B97D1B29149106174322EDF98A1B2CCE5D7F8E",
|
||
"TransactionType": "Payment",
|
||
"TxnSignature": "30440220791B6A3E036ECEFFE99E8D4957564E8C84D1548C8C3E80A87ED1AA646ECCFB16022037C5CAC97E34E3021EBB426479F2ACF3ACA75DB91DCC48D1BCFB4CF547CFEAA0",
|
||
"hash": "E08D6E9754025BA2534A78707605E0601F03ACE063687A0CA1BDDACFCD1698C7",
|
||
"inLedger": 348734,
|
||
"ledger_index": 348734
|
||
}
|
||
},
|
||
"status": "success",
|
||
"type": "response"
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>Unsigned Integer</td>
|
||
<td>Sequence number of the ledger version the transaction was found in; this is the same as the one from the request.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_hash</td>
|
||
<td>String</td>
|
||
<td>(May be omitted) Unique hash of the ledger version the transaction was found in; this is the same as the one from the request.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>metadata</td>
|
||
<td>Object</td>
|
||
<td>Various metadata about the transaction.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>tx_json</td>
|
||
<td>Object</td>
|
||
<td>JSON representation of the <a href="reference-transaction-format.html">Transaction object</a></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>There are a couple possible reasons the server may fail to find the transaction:</p>
|
||
<ul>
|
||
<li>The transaction does not exist</li>
|
||
<li>The transaction exists, but not in the specified ledger version</li>
|
||
<li>The server does not have the specified ledger version available. Another server that has the correct version on hand may have a different response.</li>
|
||
</ul>
|
||
<h4 id="possible-errors-17">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>fieldNotFoundTransaction</code> - The <code>tx_hash</code> field was omitted from the request</li>
|
||
<li><code>notYetImplemented</code> - A ledger version was not specified in the request.</li>
|
||
<li><code>lgrNotFound</code> - The ledger specified by the <code>ledger_hash</code> or <code>ledger_index</code> does not exist, or it does exist but the server does not have it.</li>
|
||
<li><code>transactionNotFound</code> - The transaction specified in the request could not be found in the specified ledger. (It might be in a different ledger version, or it might not be available at all.)</li>
|
||
</ul>
|
||
<!-- I think ledgerNotFound ( https://github.com/ripple/rippled/blob/develop/src/ripple/rpc/handlers/TransactionEntry.cpp#L62 ) should not occur because lookupLedger would have errored out first. -->
|
||
<h2 id="tx-history">tx_history</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/TxHistory.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>tx_history</code> method retrieves some of the most recent transactions made.</p>
|
||
<p class="devportal-callout caution"><strong>Caution:</strong> This method is deprecated, and may be removed without further notice.</p>
|
||
<h4 id="request-format-18">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-38"><ul class="codetabs"><li><a href="#code-38-0">WebSocket</a></li><li><a href="#code-38-1">JSON-RPC</a></li><li><a href="#code-38-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-38-0" style="position: static;"><pre><code>{
|
||
"id": 5,
|
||
"command": "tx_history",
|
||
"start": 0
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-38-1" style="position: static;"><pre><code>{
|
||
"method": "tx_history",
|
||
"params": [
|
||
{
|
||
"start": 0
|
||
}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-38-2" style="position: static;"><pre><code>#Syntax: tx_history [start]
|
||
rippled tx_history 0
|
||
</code></pre></div>
|
||
</div>
|
||
<p><a class="button" href="ripple-api-tool.html#tx_history">Try it! ></a></p>
|
||
<p>The request includes the following parameters:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>start</td>
|
||
<td>Unsigned Integer</td>
|
||
<td>Number of transactions to skip over.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="response-format-18">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-39"><ul class="codetabs"><li><a href="#code-39-0">WebSocket</a></li><li><a href="#code-39-1">JSON-RPC</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-39-0" style="position: static;"><pre><code>{
|
||
"id": 2,
|
||
"status": "success",
|
||
"type": "response",
|
||
"result": {
|
||
"index": 0,
|
||
"txs": [
|
||
{
|
||
"Account": "r9bf8V4ae5xReYnKPXgnwERDFPoW34FhGy",
|
||
"Fee": "12",
|
||
"Flags": 2147483648,
|
||
"LastLedgerSequence": 6907169,
|
||
"Sequence": 3276,
|
||
"SigningPubKey": "03B7857216DF96BABCC839686670A67602B3EE50D0F12B41C15F73760B8ED394C1",
|
||
"TransactionType": "AccountSet",
|
||
"TxnSignature": "3045022100CC0A2688DC36DC47BDBD5A571407316DD16A6CB3289E60C9589531707D30EBDB022010A2ED1F8562FEF61461B89E90E9D7245F5DD1AAE6680401A60F7FDA60184312",
|
||
"hash": "30FF69D2F2C2FF517A82EC8BA62AA4879E27A6EAF2C9B4AA422B77C23CD11B35",
|
||
"inLedger": 6907162,
|
||
"ledger_index": 6907162
|
||
},
|
||
{
|
||
"Account": "rHsZHqa5oMQNL5hFm4kfLd47aEMYjPstpg",
|
||
"Fee": "15",
|
||
"Flags": 0,
|
||
"Sequence": 1479735,
|
||
"SigningPubKey": "025718736160FA6632F48EA4354A35AB0340F8D7DC7083799B9C57C3E937D71851",
|
||
"TakerGets": "9999999999",
|
||
"TakerPays": {
|
||
"currency": "USD",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"value": "48.050907917"
|
||
},
|
||
"TransactionType": "OfferCreate",
|
||
"TxnSignature": "3045022100C110F47609CED085E0C184396877685ACAFF0A5846C859E9A57A8E238788FAE2022042A578D36F3D911E2536A39D74B10A741EF4C77B40738DB66E9E4FA85B797DF2",
|
||
"hash": "A5DE72E2E97CB0FA548713FB7C8542FD1A9723EC556D386F13B25F052435B29F",
|
||
"inLedger": 6907162,
|
||
"ledger_index": 6907162
|
||
},
|
||
{
|
||
"Account": "r9bf8V4ae5xReYnKPXgnwERDFPoW34FhGy",
|
||
"Fee": "12",
|
||
"Flags": 2147483648,
|
||
"LastLedgerSequence": 6907169,
|
||
"Sequence": 3275,
|
||
"SigningPubKey": "03B7857216DF96BABCC839686670A67602B3EE50D0F12B41C15F73760B8ED394C1",
|
||
"TransactionType": "AccountSet",
|
||
"TxnSignature": "3044022030E4CCDCBA8D9984C16AD9807D0FE654D4C558C08728B33A6D9F4D05DA811CF102202A6B53015583A6C24054EE93D9B9DDF0D17133676848304BBA5156DD2C2875BE",
|
||
"hash": "55DFC8F7EF3976B5968DC462D91B29274E8097C35D43D6B3740AB20584336A9C",
|
||
"inLedger": 6907162,
|
||
"ledger_index": 6907162
|
||
},
|
||
{
|
||
"Account": "rHsZHqa5oMQNL5hFm4kfLd47aEMYjPstpg",
|
||
"Fee": "15",
|
||
"Flags": 131072,
|
||
"Sequence": 1479734,
|
||
"SigningPubKey": "025718736160FA6632F48EA4354A35AB0340F8D7DC7083799B9C57C3E937D71851",
|
||
"TakerGets": {
|
||
"currency": "BTC",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"value": "0.009194668"
|
||
},
|
||
"TakerPays": "1073380944",
|
||
"TransactionType": "OfferCreate",
|
||
"TxnSignature": "304402202C0D26EABE058FCE8B6862EF5CAB70674637CE32B1B4E2F3551B9D5A2E1CDC7E02202C191D2697C65478BC2C1489721EB5799A6F3D4A1ECD8FE87A0C4FDCA3704A03",
|
||
"hash": "2499BAE9947BE731D7FE2F8E7B6A55E1E5B43BA8D3A9F22E39F79A0CC027A1C8",
|
||
"inLedger": 6907161,
|
||
"ledger_index": 6907161
|
||
},
|
||
{
|
||
"Account": "rHsZHqa5oMQNL5hFm4kfLd47aEMYjPstpg",
|
||
"Fee": "15",
|
||
"Flags": 131072,
|
||
"Sequence": 1479733,
|
||
"SigningPubKey": "025718736160FA6632F48EA4354A35AB0340F8D7DC7083799B9C57C3E937D71851",
|
||
"TakerGets": {
|
||
"currency": "USD",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"value": "5.298037873"
|
||
},
|
||
"TakerPays": {
|
||
"currency": "BTC",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"value": "0.008937558999999999"
|
||
},
|
||
"TransactionType": "OfferCreate",
|
||
"TxnSignature": "3044022075EF6054ABD08F9B8287314AD4904944A74A6C3BBED9D035BCE7D409FC46E49E022025CFEE7F72BEC1F87EA83E3565CB653643A57CDD13661798D6B70F47AF63FDB6",
|
||
"hash": "F873CB065791DDD503580931A500BB896B9DBAFC9C285C1159B884354F3EF48B",
|
||
"inLedger": 6907161,
|
||
"ledger_index": 6907161
|
||
},
|
||
{
|
||
"Account": "rHsZHqa5oMQNL5hFm4kfLd47aEMYjPstpg",
|
||
"Fee": "15",
|
||
"Flags": 0,
|
||
"OfferSequence": 1479726,
|
||
"Sequence": 1479732,
|
||
"SigningPubKey": "025718736160FA6632F48EA4354A35AB0340F8D7DC7083799B9C57C3E937D71851",
|
||
"TransactionType": "OfferCancel",
|
||
"TxnSignature": "3045022100E82B813DA3896051EAAA3D53E197F8F426DF4E51F07A2AB83E43B10CD4008D8402204D93BABA74E63E775D44D77F4F9B07D69B0C86930F2865BBBBD2DC956FA8AE4E",
|
||
"hash": "203613CFA3CB7BFBCFABBBCF80D932DFBBFDECCBB869CCDBE756EAA4C8EEA41D",
|
||
"inLedger": 6907161,
|
||
"ledger_index": 6907161
|
||
},
|
||
{
|
||
"Account": "rHsZHqa5oMQNL5hFm4kfLd47aEMYjPstpg",
|
||
"Fee": "15",
|
||
"Flags": 0,
|
||
"OfferSequence": 1479725,
|
||
"Sequence": 1479731,
|
||
"SigningPubKey": "025718736160FA6632F48EA4354A35AB0340F8D7DC7083799B9C57C3E937D71851",
|
||
"TransactionType": "OfferCancel",
|
||
"TxnSignature": "30440220678FF2E754A879EAE72207F191614BBA01B8088CD174AF509E9AA11448798CD502205B326E187A0530E4E90BDD1ED875492836657E4D593FBD655F64604178693D2F",
|
||
"hash": "1CF4D0D583F6FC85BFD15A0BEF5E4779A8ACAD0DE43823F07C9CC2A20E29E422",
|
||
"inLedger": 6907161,
|
||
"ledger_index": 6907161
|
||
},
|
||
{
|
||
"Account": "rHsZHqa5oMQNL5hFm4kfLd47aEMYjPstpg",
|
||
"Fee": "15",
|
||
"Flags": 0,
|
||
"OfferSequence": 1479724,
|
||
"Sequence": 1479730,
|
||
"SigningPubKey": "025718736160FA6632F48EA4354A35AB0340F8D7DC7083799B9C57C3E937D71851",
|
||
"TransactionType": "OfferCancel",
|
||
"TxnSignature": "3045022100A5533E81A67B6A88B674864E898FDF31D83787FECE496544EBEE88E6FC220500022002438599B2A0E4F70C2B46FB049CD339F76E466399CA4A8F72C4ADA03F615D90",
|
||
"hash": "D96EC06F2ADF3CF7ED59BD76B8F1BDB127CDE46B45977B477703DB05B8DF5208",
|
||
"inLedger": 6907161,
|
||
"ledger_index": 6907161
|
||
},
|
||
{
|
||
"Account": "rHsZHqa5oMQNL5hFm4kfLd47aEMYjPstpg",
|
||
"Fee": "15",
|
||
"Flags": 0,
|
||
"OfferSequence": 1479723,
|
||
"Sequence": 1479729,
|
||
"SigningPubKey": "025718736160FA6632F48EA4354A35AB0340F8D7DC7083799B9C57C3E937D71851",
|
||
"TransactionType": "OfferCancel",
|
||
"TxnSignature": "304402206DEF8C70103AE45BCED6762B238E6F155A57D46300E8FF0A1CD0197362483CAE022007BBDFD93A0BC2473EE4537B44095D1BB5EB83F76661A14230FB3B27C4EABB6D",
|
||
"hash": "089D22F601FB52D0E55A8E27D393F05570DC24E92028BB9D9DCAD7BC3337ADF9",
|
||
"inLedger": 6907161,
|
||
"ledger_index": 6907161
|
||
},
|
||
{
|
||
"Account": "rHsZHqa5oMQNL5hFm4kfLd47aEMYjPstpg",
|
||
"Fee": "15",
|
||
"Flags": 0,
|
||
"OfferSequence": 1479722,
|
||
"Sequence": 1479728,
|
||
"SigningPubKey": "025718736160FA6632F48EA4354A35AB0340F8D7DC7083799B9C57C3E937D71851",
|
||
"TransactionType": "OfferCancel",
|
||
"TxnSignature": "3044022065051B7240DE1D46865453B3D7F8FC59FB2B9FD609196AB394F857B75E2B8409022044683F3A35740FC97655A8A4516184D8C582E5D88CA360301B1AD308F4126763",
|
||
"hash": "F6A660EF99E32D02B9AF761B14993CA1ED8BAF3507F580D90A7759ABFAF0284E",
|
||
"inLedger": 6907161,
|
||
"ledger_index": 6907161
|
||
},
|
||
{
|
||
"Account": "rUBLCjWdsPPMkppdFXVJWhHnr3FNqCzgG3",
|
||
"Fee": "15",
|
||
"Flags": 0,
|
||
"LastLedgerSequence": 6907168,
|
||
"Sequence": 173286,
|
||
"SigningPubKey": "03D606359EEA9C0A49CA9EF55F6AED6C8AEDDE604223C1BE51A2D0460A725CF173",
|
||
"TakerGets": {
|
||
"currency": "BTC",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"value": "0.44942631"
|
||
},
|
||
"TakerPays": {
|
||
"currency": "USD",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"value": "260"
|
||
},
|
||
"TransactionType": "OfferCreate",
|
||
"TxnSignature": "304502205395AF4127AD0B890AC9C47F765B4F4046C70C3DFC6F8DCD2729552FAA97F13C022100C8C2DBA6A466D76D0F103AC88DB166D1EC7F6339238E2C4245C2C26308B38058",
|
||
"hash": "F20F06F36B5FEFF43DD1E8AEDBE9A0ECEF0CE41402AE6F0FE4BEE1F2F82A4D54",
|
||
"inLedger": 6907161,
|
||
"ledger_index": 6907161
|
||
},
|
||
{
|
||
"Account": "rDVynssGDojUPpM4abx9rxYeHG4HiLGxC",
|
||
"Fee": "15",
|
||
"Flags": 2147483648,
|
||
"LastLedgerSequence": 6907169,
|
||
"OfferSequence": 859,
|
||
"Sequence": 860,
|
||
"SigningPubKey": "02C37DA8D793142BD190CE13BB697521A89D1DC318A045816EE657F42527EBFC4E",
|
||
"TakerGets": "19871628459",
|
||
"TakerPays": {
|
||
"currency": "BTC",
|
||
"issuer": "rfYv1TXnwgDDK4WQNbFALykYuEBnrR4pDX",
|
||
"value": "0.166766470665369"
|
||
},
|
||
"TransactionType": "OfferCreate",
|
||
"TxnSignature": "3044022074737D253A0DB39DBB6C63E5BD522C1313CC57658B0A567E1F1DD3414DA3817502201F333D81F29845C53A0271D0C5B005DEE4A250529DAD1A880838E242D358EE35",
|
||
"hash": "AD197326AEF75AA466F32FEA87358C9FB587F1C1ABF41C73E2C3EFDD83B6F33B",
|
||
"inLedger": 6907161,
|
||
"ledger_index": 6907161
|
||
},
|
||
{
|
||
"Account": "rHsZHqa5oMQNL5hFm4kfLd47aEMYjPstpg",
|
||
"Fee": "15",
|
||
"Flags": 0,
|
||
"OfferSequence": 1479721,
|
||
"Sequence": 1479727,
|
||
"SigningPubKey": "025718736160FA6632F48EA4354A35AB0340F8D7DC7083799B9C57C3E937D71851",
|
||
"TransactionType": "OfferCancel",
|
||
"TxnSignature": "3045022100CCD7336F78291E1BCAA4F86695119175E0DBC26281B2F13B30A24C726419DFCA022062547E0A4894CEAE87C42CABA94E0731134560F07D8860AE62F4A87AFD16BC43",
|
||
"hash": "20353EA4152C32E63941DE2F3175BA69657BA9FAB39D22BCE38B6CA1B3734D4B",
|
||
"inLedger": 6907161,
|
||
"ledger_index": 6907161
|
||
},
|
||
{
|
||
"Account": "r9bf8V4ae5xReYnKPXgnwERDFPoW34FhGy",
|
||
"Fee": "12",
|
||
"Flags": 2147483648,
|
||
"LastLedgerSequence": 6907168,
|
||
"Sequence": 3274,
|
||
"SigningPubKey": "03B7857216DF96BABCC839686670A67602B3EE50D0F12B41C15F73760B8ED394C1",
|
||
"TransactionType": "AccountSet",
|
||
"TxnSignature": "3045022100F8412BBB1DB830F314F7400E99570A9F92668ACCDEA6096144A47EDF98E18D5D02204AD89122224F353155EACC30F80BA214350968F744A480B4CD5A3174B473D6AF",
|
||
"hash": "16F266ABCC617CF906A25AA83BDDAD2577125E6A692A36543934AA0F0C3B77C0",
|
||
"inLedger": 6907161,
|
||
"ledger_index": 6907161
|
||
},
|
||
{
|
||
"Account": "r9bf8V4ae5xReYnKPXgnwERDFPoW34FhGy",
|
||
"Fee": "12",
|
||
"Flags": 2147483648,
|
||
"LastLedgerSequence": 6907167,
|
||
"Sequence": 3273,
|
||
"SigningPubKey": "03B7857216DF96BABCC839686670A67602B3EE50D0F12B41C15F73760B8ED394C1",
|
||
"TakerGets": "5397",
|
||
"TakerPays": {
|
||
"currency": "USD",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"value": "0.00002593363079073453"
|
||
},
|
||
"TransactionType": "OfferCreate",
|
||
"TxnSignature": "3044022061685E23375A299747DE45DA302966C6AF8C07D2DA9BEBB4F5572E3B02C6564D02207187E626EC817EFAFFAD002E75FC16E17A5BD54DA41D4E339F3C2A9F86FFD523",
|
||
"hash": "C9112B7C246FC8A9B377BD762F1D64F0DCA1128D55254A442E5735935A09D83E",
|
||
"inLedger": 6907160,
|
||
"ledger_index": 6907160
|
||
},
|
||
{
|
||
"Account": "rBHMbioz9znTCqgjZ6Nx43uWY43kToEPa9",
|
||
"Amount": {
|
||
"currency": "USD",
|
||
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
||
"value": "4"
|
||
},
|
||
"Destination": "r4X3WWZ3UZMDw3Z7T32FXK2NAaiitSWZ9c",
|
||
"Fee": "12",
|
||
"Flags": 0,
|
||
"LastLedgerSequence": 6907168,
|
||
"Paths": [
|
||
[
|
||
{
|
||
"account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
},
|
||
{
|
||
"currency": "XRP",
|
||
"type": 16,
|
||
"type_hex": "0000000000000010"
|
||
},
|
||
{
|
||
"currency": "USD",
|
||
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
||
"type": 48,
|
||
"type_hex": "0000000000000030"
|
||
},
|
||
{
|
||
"account": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
}
|
||
],
|
||
[
|
||
{
|
||
"account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
},
|
||
{
|
||
"currency": "USD",
|
||
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
||
"type": 48,
|
||
"type_hex": "0000000000000030"
|
||
},
|
||
{
|
||
"account": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
}
|
||
],
|
||
[
|
||
{
|
||
"account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
},
|
||
{
|
||
"currency": "XRP",
|
||
"type": 16,
|
||
"type_hex": "0000000000000010"
|
||
},
|
||
{
|
||
"currency": "USD",
|
||
"issuer": "rwmUaXsWtXU4Z843xSYwgt1is97bgY8yj6",
|
||
"type": 48,
|
||
"type_hex": "0000000000000030"
|
||
},
|
||
{
|
||
"account": "rwmUaXsWtXU4Z843xSYwgt1is97bgY8yj6",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
},
|
||
{
|
||
"account": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
}
|
||
],
|
||
[
|
||
{
|
||
"account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
},
|
||
{
|
||
"currency": "XRP",
|
||
"type": 16,
|
||
"type_hex": "0000000000000010"
|
||
},
|
||
{
|
||
"currency": "USD",
|
||
"issuer": "rfsEoNBUBbvkf4jPcFe2u9CyaQagLVHGfP",
|
||
"type": 48,
|
||
"type_hex": "0000000000000030"
|
||
},
|
||
{
|
||
"account": "rfsEoNBUBbvkf4jPcFe2u9CyaQagLVHGfP",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
},
|
||
{
|
||
"account": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
}
|
||
]
|
||
],
|
||
"SendMax": {
|
||
"currency": "USD",
|
||
"issuer": "rBHMbioz9znTCqgjZ6Nx43uWY43kToEPa9",
|
||
"value": "4.132649022"
|
||
},
|
||
"Sequence": 4660,
|
||
"SigningPubKey": "03DFEFC9A95AEF55232A2B89867745CE45373F5CE23C34D51D21343CEA92BD61AD",
|
||
"TransactionType": "Payment",
|
||
"TxnSignature": "30450220636E405B96C998BF5EBB665D519FA8B4431A6CB5962F754EEDD48EBE95F8C45F02210097851E297FEDA44F7DFED844AE109CF2D968BD58CD3C0E951B435278A91002FA",
|
||
"hash": "5007E8ECAE64482D258E915FFDEFAF2FE35ED9520BA7BB424BE280691F997435",
|
||
"inLedger": 6907160,
|
||
"ledger_index": 6907160
|
||
},
|
||
{
|
||
"Account": "rfESTMcbvbvCBqU1FTvGWiJP8cmUSu4GKg",
|
||
"Amount": {
|
||
"currency": "BTC",
|
||
"issuer": "rTJdjjQ5wWAMh8TL1ToXXD2mZzesa6DSX",
|
||
"value": "0.0998"
|
||
},
|
||
"Destination": "r3AWbdp2jQLXLywJypdoNwVSvr81xs3uhn",
|
||
"Fee": "10",
|
||
"Flags": 2147483648,
|
||
"InvoiceID": "A98FD36C17BE2B8511AD36DC335478E7E89F06262949F36EB88E2D683BBCC50A",
|
||
"SendMax": {
|
||
"currency": "BTC",
|
||
"issuer": "rTJdjjQ5wWAMh8TL1ToXXD2mZzesa6DSX",
|
||
"value": "0.100798"
|
||
},
|
||
"Sequence": 18697,
|
||
"SigningPubKey": "025D9E40A50D78347EB8AFF7A36222BBE173CB9D06E68D109D189FF8616FC21107",
|
||
"TransactionType": "Payment",
|
||
"TxnSignature": "3044022007AA39E0117963ABF03BAEF0C5AB45862093525344362D34B9F6BA8373A0C9DC02206AB4FE915F4CBDA84E668F7F21A9914DC95C83A72FB3F9A114B10D4ECB697A25",
|
||
"hash": "C738A5095DCE3A256C843AA48BB26F0339EAD3FF09B6D75C2EF50C4AD4B4D17C",
|
||
"inLedger": 6907159,
|
||
"ledger_index": 6907159
|
||
},
|
||
{
|
||
"Account": "rHsZHqa5oMQNL5hFm4kfLd47aEMYjPstpg",
|
||
"Fee": "15",
|
||
"Flags": 0,
|
||
"Sequence": 1479726,
|
||
"SigningPubKey": "025718736160FA6632F48EA4354A35AB0340F8D7DC7083799B9C57C3E937D71851",
|
||
"TakerGets": "37284087",
|
||
"TakerPays": {
|
||
"currency": "NZD",
|
||
"issuer": "rsP3mgGb2tcYUrxiLFiHJiQXhsziegtwBc",
|
||
"value": "0.291570426"
|
||
},
|
||
"TransactionType": "OfferCreate",
|
||
"TxnSignature": "3045022100F246F043C97C0DA7947793E9390DBA5AB0C6EB4A0165DADF0E96C939B70D113C0220797F572368EF68490813663C0E2ACF03424CB73B64F3D6C8508C7E8F6D2CC767",
|
||
"hash": "CAE39A38C222DF0BBC9AA25D30320220DC216646CE0A447F330BE279B20BD008",
|
||
"inLedger": 6907159,
|
||
"ledger_index": 6907159
|
||
},
|
||
{
|
||
"Account": "rHsZHqa5oMQNL5hFm4kfLd47aEMYjPstpg",
|
||
"Fee": "15",
|
||
"Flags": 0,
|
||
"Sequence": 1479725,
|
||
"SigningPubKey": "025718736160FA6632F48EA4354A35AB0340F8D7DC7083799B9C57C3E937D71851",
|
||
"TakerGets": "10000000000",
|
||
"TakerPays": {
|
||
"currency": "BTC",
|
||
"issuer": "ra9eZxMbJrUcgV8ui7aPc161FgrqWScQxV",
|
||
"value": "0.091183099"
|
||
},
|
||
"TransactionType": "OfferCreate",
|
||
"TxnSignature": "30440220376E6D149435B87CA761ED1A9BD205BA93C0C30D6EB1FB26D8B5D06A55977F510220213E882DD43BC78C96B51E43273D9BD451F8337DDF6960CBFB9802A347FF18E4",
|
||
"hash": "CC07A503ED60F14AF023AB839C726B73591DE5C986D1234671E2518D8F840E12",
|
||
"inLedger": 6907159,
|
||
"ledger_index": 6907159
|
||
},
|
||
{
|
||
"Account": "rHsZHqa5oMQNL5hFm4kfLd47aEMYjPstpg",
|
||
"Fee": "15",
|
||
"Flags": 0,
|
||
"Sequence": 1479724,
|
||
"SigningPubKey": "025718736160FA6632F48EA4354A35AB0340F8D7DC7083799B9C57C3E937D71851",
|
||
"TakerGets": "9094329166",
|
||
"TakerPays": {
|
||
"currency": "XAG",
|
||
"issuer": "r9Dr5xwkeLegBeXq6ujinjSBLQzQ1zQGjH",
|
||
"value": "3.022830117"
|
||
},
|
||
"TransactionType": "OfferCreate",
|
||
"TxnSignature": "3045022100CFD63762B3809B37B6A1294C4B4C8DA39023D66893045BA4AA9767DD8570A8F9022005F42B08E94190637158E80DAE99F3FB104EC2AA30F69BBA3417E5BBCDB5DB77",
|
||
"hash": "64029D736C34D21CDB100D976A06A988E2CA6E3BBC0DDFCE840D9619B853B47C",
|
||
"inLedger": 6907159,
|
||
"ledger_index": 6907159
|
||
}
|
||
]
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-39-1" style="position: static;"><pre><code>200 OK
|
||
{
|
||
"result": {
|
||
"index": 0,
|
||
"status": "success",
|
||
"txs": [
|
||
{
|
||
"Account": "rPJnufUfjS22swpE7mWRkn2VRNGnHxUSYc",
|
||
"Fee": "10",
|
||
"Flags": 2147483648,
|
||
"Sequence": 567546,
|
||
"SigningPubKey": "0317766BFFC0AAF5DB4AFDE23236624304AC4BC903AA8B172AE468F6B512616D6A",
|
||
"TakerGets": {
|
||
"currency": "BTC",
|
||
"issuer": "rNPRNzBB92BVpAhhZr4iXDTveCgV5Pofm9",
|
||
"value": "1.12582"
|
||
},
|
||
"TakerPays": {
|
||
"currency": "ILS",
|
||
"issuer": "rNPRNzBB92BVpAhhZr4iXDTveCgV5Pofm9",
|
||
"value": "1981.893528"
|
||
},
|
||
"TransactionType": "OfferCreate",
|
||
"TxnSignature": "3045022100C66F3EE8F955724D750D148E3BB9DCAC16A002F9E4FC612C03AFBE9D8C13888902202607508AD0546C496093C9743B13FD596A1F5BE2B778EFE85BDB99F0E5B1D55F",
|
||
"hash": "A95C701F6120061BC40323AE846BBDA51576E67EC38105030BE75C1D32231B61",
|
||
"inLedger": 8696235,
|
||
"ledger_index": 8696235
|
||
},
|
||
{
|
||
"Account": "rwpxNWdpKu2QVgrh5LQXEygYLshhgnRL1Y",
|
||
"Fee": "10",
|
||
"Flags": 2147483648,
|
||
"Sequence": 1865518,
|
||
"SigningPubKey": "02BD6F0CFD0182F2F408512286A0D935C58FF41169DAC7E721D159D711695DFF85",
|
||
"TakerGets": {
|
||
"currency": "LTC",
|
||
"issuer": "rNPRNzBB92BVpAhhZr4iXDTveCgV5Pofm9",
|
||
"value": "1.12095"
|
||
},
|
||
"TakerPays": {
|
||
"currency": "ILS",
|
||
"issuer": "rNPRNzBB92BVpAhhZr4iXDTveCgV5Pofm9",
|
||
"value": "20.77526133899999"
|
||
},
|
||
"TransactionType": "OfferCreate",
|
||
"TxnSignature": "304402203F7435A2587A71878B09129A1F4C05066CE6E6463A4A10CD5C40C15FCBD9E42502207E0CB8421FEA4CE8FC052E5A63ACD2444ADAE253B174A153A1DBE901E21B3695",
|
||
"hash": "A8C79DF180167E4D1281247325E2869984F54CBFA68631C1AF13DA346E6B3370",
|
||
"inLedger": 8696235,
|
||
"ledger_index": 8696235
|
||
},
|
||
{
|
||
"Account": "rMWUykAmNQDaM9poSes8VLDZDDKEbmo7MX",
|
||
"Fee": "10",
|
||
"Flags": 2147483648,
|
||
"Sequence": 1886203,
|
||
"SigningPubKey": "0256C64F0378DCCCB4E0224B36F7ED1E5586455FF105F760245ADB35A8B03A25FD",
|
||
"TakerGets": {
|
||
"currency": "LTC",
|
||
"issuer": "rNPRNzBB92BVpAhhZr4iXDTveCgV5Pofm9",
|
||
"value": "24.154"
|
||
},
|
||
"TakerPays": {
|
||
"currency": "BTC",
|
||
"issuer": "rNPRNzBB92BVpAhhZr4iXDTveCgV5Pofm9",
|
||
"value": "0.26907556"
|
||
},
|
||
"TransactionType": "OfferCreate",
|
||
"TxnSignature": "30440220102CF96A86AF56BA11698C70D60F22436D763634FEA179D2FF45EB329CFF1CF8022029BF9301B11D09B38EBD4E8EB445ECC53B98C4F0CA7E19BE895272085ED6DBA2",
|
||
"hash": "9EE340379612529F308CA1E4619EC0C8842C1D4308FCA136E25316CE28C28189",
|
||
"inLedger": 8696235,
|
||
"ledger_index": 8696235
|
||
},
|
||
{
|
||
"Account": "rJJksugQDMVu12NrZyw3C55fEUmPtRYVRC",
|
||
"Fee": "10",
|
||
"Flags": 2147483648,
|
||
"Sequence": 119205,
|
||
"SigningPubKey": "03B918730C9FA2451284A00B1EFD08E9BEFD735D84CE09C6B3D7CB8FB0D1F9A84F",
|
||
"TakerGets": "10136500000",
|
||
"TakerPays": {
|
||
"currency": "USD",
|
||
"issuer": "rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun",
|
||
"value": "50"
|
||
},
|
||
"TransactionType": "OfferCreate",
|
||
"TxnSignature": "3044022044DB48A760AA7FBA2B1840E1357EF6B1EA9CC9DBBFFB5415C6BE301597B66766022021AA86070416330312E3AFC938376AD0A67A28195D7CD92EC8B03A6039D5C86C",
|
||
"hash": "8149067582081FA1499A53841642345D21FE0750E29C61C6DC3C914E0D1819AB",
|
||
"inLedger": 8696235,
|
||
"ledger_index": 8696235
|
||
},
|
||
{
|
||
"Account": "rLPrL6KUtVZZbDfJMjDXzTKkwH39Udfw6e",
|
||
"Fee": "10",
|
||
"Flags": 2147483648,
|
||
"Sequence": 428775,
|
||
"SigningPubKey": "03B2B67209DBDE2FA68555FB10BD791C4732C685349979FDC47D0DEF2B27EFA364",
|
||
"TakerGets": {
|
||
"currency": "PPC",
|
||
"issuer": "rNPRNzBB92BVpAhhZr4iXDTveCgV5Pofm9",
|
||
"value": "8.0635"
|
||
},
|
||
"TakerPays": {
|
||
"currency": "BTC",
|
||
"issuer": "rNPRNzBB92BVpAhhZr4iXDTveCgV5Pofm9",
|
||
"value": "0.01355474349999999"
|
||
},
|
||
"TransactionType": "OfferCreate",
|
||
"TxnSignature": "3045022100EDDC17FE2C32DEAD8ED5D9540B2ECE25D6CD1C65414211D2E4F98FC5BDABB99E0220389D6B3DE8BA50D27406BCE28E67D1E270C6A3A854CDEF25F042BBA52CDB53F8",
|
||
"hash": "70B7DB8E2BD65E554CBF418D591E050A6FD0A387E9500ED0B79BEB775019D9CA",
|
||
"inLedger": 8696235,
|
||
"ledger_index": 8696235
|
||
},
|
||
{
|
||
"Account": "rM7WN56kktEkE5qKwNkQ1af4BZ56bynVUf",
|
||
"Fee": "10",
|
||
"Flags": 2147483648,
|
||
"Sequence": 435008,
|
||
"SigningPubKey": "0256AE48790FEF5F61C1AB3765287EABCBE6B47C5098271F596A576DF7CFA15720",
|
||
"TakerGets": {
|
||
"currency": "PPC",
|
||
"issuer": "rNPRNzBB92BVpAhhZr4iXDTveCgV5Pofm9",
|
||
"value": "0.365"
|
||
},
|
||
"TakerPays": {
|
||
"currency": "ILS",
|
||
"issuer": "rNPRNzBB92BVpAhhZr4iXDTveCgV5Pofm9",
|
||
"value": "0.9977421"
|
||
},
|
||
"TransactionType": "OfferCreate",
|
||
"TxnSignature": "3044022057ECAE71B36746AA1574936B03016DC5747EB7DBBA7D85533063E8D35DD2BAF402204F37BCA51CB0D943758BCA89641C2655FB76F20B8AD1883A3ABF232D1E964E80",
|
||
"hash": "572B0B2E96F4A9A88C7EDBDEB6D90AD2975528478186D9179AEC0E366D2778FC",
|
||
"inLedger": 8696235,
|
||
"ledger_index": 8696235
|
||
},
|
||
{
|
||
"Account": "rLjhDX8zT6vy8T7hjUDvK48wTy5SYFpfwZ",
|
||
"Fee": "10",
|
||
"Flags": 2147483648,
|
||
"OfferSequence": 432536,
|
||
"Sequence": 432561,
|
||
"SigningPubKey": "03892D08CE3CE600369BA83A92C3C7785FEA162739643358F1F35F8BE672AFD4A3",
|
||
"TransactionType": "OfferCancel",
|
||
"TxnSignature": "3045022100C25CE3756EB273F6ADD219E951DB7585ADFAF28090BEA3510458785D2EB91866022057A480F167F6D7263CDBFB0E13D571041313F6476176FFE2645CE867BA85DC2D",
|
||
"hash": "521D7F2CF76DEAC8ED695AC5570DFF1E445EB8C599158A351BD46F1D34528373",
|
||
"inLedger": 8696235,
|
||
"ledger_index": 8696235
|
||
},
|
||
{
|
||
"Account": "rn694SpeUFw3VJwapyRKx6bpru3ZpDHzji",
|
||
"Fee": "10",
|
||
"Flags": 2147483648,
|
||
"Sequence": 396235,
|
||
"SigningPubKey": "03896496732D098F2D8EE22D65ED9A88C0FF116785AE448EA1F521534C7C5BC6E3",
|
||
"TakerGets": {
|
||
"currency": "ILS",
|
||
"issuer": "rNPRNzBB92BVpAhhZr4iXDTveCgV5Pofm9",
|
||
"value": "0.700491"
|
||
},
|
||
"TakerPays": {
|
||
"currency": "NMC",
|
||
"issuer": "rNPRNzBB92BVpAhhZr4iXDTveCgV5Pofm9",
|
||
"value": "0.22"
|
||
},
|
||
"TransactionType": "OfferCreate",
|
||
"TxnSignature": "30440220218B5B90AB26EAE9FC9833E580653B20A15CEE86E8F1166F626FCDF4EFD4146902207FD99E35EE67E45142776CCD8F910A9E6E1A3C498737B59F182C73183C63D51F",
|
||
"hash": "454479D7EEE4081CF25378571D74858C01B0B43D3A2530781647BD40CD0465E5",
|
||
"inLedger": 8696235,
|
||
"ledger_index": 8696235
|
||
},
|
||
{
|
||
"Account": "rRh634Y6QtoqkwTTrGzX66UYoCAvgE6jL",
|
||
"Fee": "10",
|
||
"Flags": 2147483648,
|
||
"Sequence": 676061,
|
||
"SigningPubKey": "030BB49C591C9CD65C945D4B78332F27633D7771E6CF4D4B942D26BA40748BB8B4",
|
||
"TakerGets": {
|
||
"currency": "BTC",
|
||
"issuer": "rNPRNzBB92BVpAhhZr4iXDTveCgV5Pofm9",
|
||
"value": "0.09675"
|
||
},
|
||
"TakerPays": "10527647107",
|
||
"TransactionType": "OfferCreate",
|
||
"TxnSignature": "3044022014196BC5867AC2689F7EF31F23E4B2D1D1B7755465AC388B20F8E7721333EEE302201575263F381755E47AFCD37C1D5CCA4C012D624E7947140B40ABF1975959AA78",
|
||
"hash": "22B2F477ADE9C22599EB5CEF70B3377C0478D708D74A47866D9E59B7A2CF57CF",
|
||
"inLedger": 8696235,
|
||
"ledger_index": 8696235
|
||
},
|
||
{
|
||
"Account": "rJJksugQDMVu12NrZyw3C55fEUmPtRYVRC",
|
||
"Fee": "10",
|
||
"Flags": 2147483648,
|
||
"OfferSequence": 119183,
|
||
"Sequence": 119204,
|
||
"SigningPubKey": "03B918730C9FA2451284A00B1EFD08E9BEFD735D84CE09C6B3D7CB8FB0D1F9A84F",
|
||
"TransactionType": "OfferCancel",
|
||
"TxnSignature": "30440220481760ED4F771F960F37FDF32DDEC70D10F9D5F9868571A58D6F5C09D75B71DE022049B35BEA448686D0929271E64EADA684D7684A9195D22826288AD9D9526B4FE9",
|
||
"hash": "5E0E42BDDC7A929875F5E9214AB00C3673CC047833C0EFC093532F2EE1F790C2",
|
||
"inLedger": 8696234,
|
||
"ledger_index": 8696234
|
||
},
|
||
{
|
||
"Account": "rM7WN56kktEkE5qKwNkQ1af4BZ56bynVUf",
|
||
"Fee": "10",
|
||
"Flags": 2147483648,
|
||
"OfferSequence": 434977,
|
||
"Sequence": 435007,
|
||
"SigningPubKey": "0256AE48790FEF5F61C1AB3765287EABCBE6B47C5098271F596A576DF7CFA15720",
|
||
"TransactionType": "OfferCancel",
|
||
"TxnSignature": "304402204B04325A39F3D394A7EBC91CE3A1232E538EFFC80014473C97E84310886A19B302205B2D18C544086BB99E49A1037B65ADDF4864DA60545E33E4116A41599EEE63E3",
|
||
"hash": "E8E55606C757219A740AFA0700506FE99781797E2F54A5144EF43582C65BF0F2",
|
||
"inLedger": 8696234,
|
||
"ledger_index": 8696234
|
||
},
|
||
{
|
||
"Account": "rLPrL6KUtVZZbDfJMjDXzTKkwH39Udfw6e",
|
||
"Fee": "10",
|
||
"Flags": 2147483648,
|
||
"OfferSequence": 428744,
|
||
"Sequence": 428774,
|
||
"SigningPubKey": "03B2B67209DBDE2FA68555FB10BD791C4732C685349979FDC47D0DEF2B27EFA364",
|
||
"TransactionType": "OfferCancel",
|
||
"TxnSignature": "304402202BCB4FCE73C3417AD3E67D795077DE025E766A9136CA20D5B07DA28EA717643E0220579CA32A7BB225DA01999637B316BF7D3902059F9A8DDB2D721F8A62685E5BB7",
|
||
"hash": "E86788EC72CA9CFBBAE4C399744C6B7495E3F6443FE87D7A4118F16FA4A316DB",
|
||
"inLedger": 8696234,
|
||
"ledger_index": 8696234
|
||
},
|
||
{
|
||
"Account": "rHsZHqa5oMQNL5hFm4kfLd47aEMYjPstpg",
|
||
"Fee": "64",
|
||
"Flags": 0,
|
||
"Sequence": 4216371,
|
||
"SigningPubKey": "025718736160FA6632F48EA4354A35AB0340F8D7DC7083799B9C57C3E937D71851",
|
||
"TakerGets": "12566721624",
|
||
"TakerPays": {
|
||
"currency": "USD",
|
||
"issuer": "rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun",
|
||
"value": "74.999999999"
|
||
},
|
||
"TransactionType": "OfferCreate",
|
||
"TxnSignature": "3045022100D0FA06A78D3333D35C798B45590CD47BD844164ED25FCA4149F5F0CF24BE9A380220243EB636C656D1FBA6888CE8E2873CDA40FE6DE5987BE2FF1C418610D8BDC300",
|
||
"hash": "DD4CAD3EBCF67CE9B184A917FF2C78A80F0FE40A01187840E0EBC6B479DBFE1A",
|
||
"inLedger": 8696234,
|
||
"ledger_index": 8696234
|
||
},
|
||
{
|
||
"Account": "rJJksugQDMVu12NrZyw3C55fEUmPtRYVRC",
|
||
"Fee": "10",
|
||
"Flags": 2147483648,
|
||
"OfferSequence": 119182,
|
||
"Sequence": 119203,
|
||
"SigningPubKey": "03B918730C9FA2451284A00B1EFD08E9BEFD735D84CE09C6B3D7CB8FB0D1F9A84F",
|
||
"TransactionType": "OfferCancel",
|
||
"TxnSignature": "304402202F13D25C82240ABBBEE0D7E8BC2351C49FD6FDD62359EA232233C5A6C989BFAA022005A521A2C5A67BAC27218A6AD9E6917689CBD2F9BB9CE884B6B0EAAEDDEC2057",
|
||
"hash": "C9D8A2ECE636057E8255A231E6C6B6464A730155BA0E75B5111A81EA769FBC89",
|
||
"inLedger": 8696234,
|
||
"ledger_index": 8696234
|
||
},
|
||
{
|
||
"Account": "rGJrzrNBfv6ndJmzt1hTUJVx7z8o2bg3of",
|
||
"Fee": "15",
|
||
"Flags": 2147483648,
|
||
"LastLedgerSequence": 8696241,
|
||
"OfferSequence": 1579754,
|
||
"Sequence": 1579755,
|
||
"SigningPubKey": "03325EB29A014DDE22289D0EA989861D481D54D54C727578AB6C2F18BC342D3829",
|
||
"TransactionType": "OfferCancel",
|
||
"TxnSignature": "3045022100C9F283D461F8A56575A56F8AA31F84683AB0B44D58C9EFD5DC20D448D8AC13E3022012E0A8726BE2D900C4FB7A61AB8FBFEBEBE1F12B2A9880A2BA2AB8D3EC61CB8C",
|
||
"hash": "C4953FE328D54E9104F66253AF50AEBC26E30D5826B433465A795262DFA75B48",
|
||
"inLedger": 8696234,
|
||
"ledger_index": 8696234
|
||
},
|
||
{
|
||
"Account": "rn694SpeUFw3VJwapyRKx6bpru3ZpDHzji",
|
||
"Fee": "10",
|
||
"Flags": 2147483648,
|
||
"Sequence": 396234,
|
||
"SigningPubKey": "03896496732D098F2D8EE22D65ED9A88C0FF116785AE448EA1F521534C7C5BC6E3",
|
||
"TakerGets": {
|
||
"currency": "ILS",
|
||
"issuer": "rNPRNzBB92BVpAhhZr4iXDTveCgV5Pofm9",
|
||
"value": "0.3335471399999999"
|
||
},
|
||
"TakerPays": {
|
||
"currency": "NMC",
|
||
"issuer": "rNPRNzBB92BVpAhhZr4iXDTveCgV5Pofm9",
|
||
"value": "0.102"
|
||
},
|
||
"TransactionType": "OfferCreate",
|
||
"TxnSignature": "3045022100DEA2B6D5B0D555D54A4EB7A8FADC187F44C6A9CF7282A1D5491538200DFC97DA022033A52D1EC219553C86DB829108BB5A52B49ED7EF0A566941665DE7FFF70917ED",
|
||
"hash": "A6BE633AECE9FF9CA83D67D09E7EF67F614A9D8B952D7AFB5CB630D03C54C9FC",
|
||
"inLedger": 8696234,
|
||
"ledger_index": 8696234
|
||
},
|
||
{
|
||
"Account": "rwpxNWdpKu2QVgrh5LQXEygYLshhgnRL1Y",
|
||
"Fee": "10",
|
||
"Flags": 2147483648,
|
||
"OfferSequence": 1865490,
|
||
"Sequence": 1865517,
|
||
"SigningPubKey": "02BD6F0CFD0182F2F408512286A0D935C58FF41169DAC7E721D159D711695DFF85",
|
||
"TransactionType": "OfferCancel",
|
||
"TxnSignature": "3044022074A4E9859A5A94169B2C902F074AA964C45E2B86EABEA73E83E083E1EC7549A402203E8F4D46705AFEDFC78C2D40FAA036792E6485AF8CADF7445EA3D427E9DC2474",
|
||
"hash": "A49285E2CA7C5765B68A41EF4A8A65AD5CC7D4EF6C7B7F6D5040B2DE429E0125",
|
||
"inLedger": 8696234,
|
||
"ledger_index": 8696234
|
||
},
|
||
{
|
||
"Account": "rPJnufUfjS22swpE7mWRkn2VRNGnHxUSYc",
|
||
"Fee": "10",
|
||
"Flags": 2147483648,
|
||
"Sequence": 567545,
|
||
"SigningPubKey": "0317766BFFC0AAF5DB4AFDE23236624304AC4BC903AA8B172AE468F6B512616D6A",
|
||
"TakerGets": {
|
||
"currency": "BTC",
|
||
"issuer": "rNPRNzBB92BVpAhhZr4iXDTveCgV5Pofm9",
|
||
"value": "0.66099"
|
||
},
|
||
"TakerPays": {
|
||
"currency": "ILS",
|
||
"issuer": "rNPRNzBB92BVpAhhZr4iXDTveCgV5Pofm9",
|
||
"value": "1157.5521276"
|
||
},
|
||
"TransactionType": "OfferCreate",
|
||
"TxnSignature": "3045022100CABC7C1F9FB42C8498E1E9C6C5E8482F325D39B15D9DAE4BD9878D5E508B8FDD0220407B059A22BBBF4FC4AE18BEDCD2DDA80109EE7226D679A8A3BBFC108EFDD3AB",
|
||
"hash": "A0BED2F5A85C48A2AFBA252FF91FD2D5C90A6D6B769068B18891B031812E2AC0",
|
||
"inLedger": 8696234,
|
||
"ledger_index": 8696234
|
||
},
|
||
{
|
||
"Account": "rLLq27Wat93Gxkq5mV5GxtKkT146Su949V",
|
||
"Fee": "10",
|
||
"Flags": 2147483648,
|
||
"Sequence": 722529,
|
||
"SigningPubKey": "02A1BC1CCFACECD00ADC6EE990E2E27148E00D5386A99791F25B6A880BCEC94EC9",
|
||
"TakerGets": "130272502088",
|
||
"TakerPays": {
|
||
"currency": "BTC",
|
||
"issuer": "rNPRNzBB92BVpAhhZr4iXDTveCgV5Pofm9",
|
||
"value": "1.3177"
|
||
},
|
||
"TransactionType": "OfferCreate",
|
||
"TxnSignature": "30440220436C4A368D534FE1E9A2596C51D1D54931432B789F249E312877FF9B38A3F4D502202A2DBF9517358C009FBEA61EE927DAF72A065A840C7B9136B10C125F25FCD175",
|
||
"hash": "9627AEFC735A848AAE6C36D1089CB8797373DBE95B60E89F5412508CA907243A",
|
||
"inLedger": 8696234,
|
||
"ledger_index": 8696234
|
||
},
|
||
{
|
||
"Account": "rMWUykAmNQDaM9poSes8VLDZDDKEbmo7MX",
|
||
"Fee": "10",
|
||
"Flags": 2147483648,
|
||
"OfferSequence": 1886173,
|
||
"Sequence": 1886202,
|
||
"SigningPubKey": "0256C64F0378DCCCB4E0224B36F7ED1E5586455FF105F760245ADB35A8B03A25FD",
|
||
"TransactionType": "OfferCancel",
|
||
"TxnSignature": "304402202C7BD2C125A0B837CBD2E2FF568AEA1E0EE94615B22564A51C0434460C506C6F02204E39A7BD49086AA794B20F4EE28656217561909ECFBB18636CD400AB33AB0B17",
|
||
"hash": "57277F527B8EBD68FE85906E613338D68F8F8BC4EB3D1748D9A204D7CDC3E174",
|
||
"inLedger": 8696234,
|
||
"ledger_index": 8696234
|
||
}
|
||
]
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>index</td>
|
||
<td>Unsigned Integer</td>
|
||
<td>The value of <code>start</code> used in the request.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>txs</td>
|
||
<td>Array</td>
|
||
<td>Array of transaction objects.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>The fields included in each transaction object vary slightly depending on the type of transaction. See <a href="reference-transaction-format.html">Transaction Format</a> for details.</p>
|
||
<h4 id="possible-errors-18">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>invalidParams</code> - One or more fields are specified incorrectly, or one or more required fields are missing.</li>
|
||
<li><code>noPermission</code> - The <code>start</code> field specified was greater than 10000, but you are not connected to the server as an admin.</li>
|
||
</ul>
|
||
<h2 id="path-find">path_find</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/PathFind.cpp" title="Source">[Source]<br/></a></p>
|
||
<p><em>WebSocket API only!</em> The <code>path_find</code> method searches for a <a href="concept-paths.html">path</a> along which a transaction can possibly be made, and periodically sends updates when the path changes over time. For a simpler version that is supported by JSON-RPC, see <a href="#ripple-path-find"><code>ripple_path_find</code></a>. For payments occurring strictly in XRP, it is not necessary to find a path, because XRP can be sent directly to any account.</p>
|
||
<p>There are three different modes, or sub-commands, of the path_find command. Specify which one you want with the <code>subcommand</code> parameter:</p>
|
||
<ul>
|
||
<li><code>create</code> - Start sending pathfinding information</li>
|
||
<li><code>close</code> - Stop sending pathfinding information</li>
|
||
<li><code>status</code> - Get the information of the currently-open pathfinding request</li>
|
||
</ul>
|
||
<p>Although the <code>rippled</code> server tries to find the cheapest path or combination of paths for making a payment, it is not guaranteed that the paths returned by this method are, in fact, the best paths. Due to server load, pathfinding may not find the best results. Additionally, you should be careful with the pathfinding results from untrusted servers. A server could be modified to return less-than-optimal paths to earn money for its operators. If you do not have your own server that you can trust with pathfinding, you should compare the results of pathfinding from multiple servers run by different parties, to minimize the risk of a single server returning poor results. (<strong>Note:</strong> A server returning less-than-optimal results is not necessarily proof of malicious behavior; it could also be a symptom of heavy server load.)</p>
|
||
<h3 id="path-find-create">path_find create</h3>
|
||
<p><a href="https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/PathFind.cpp#L38" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>create</code> subcommand of <code>path_find</code> creates an ongoing request to find possible paths along which a payment transaction could be made from one specified account such that another account receives a desired amount of some currency. The initial response contains a suggested path between the two addresses that would result in the desired amount being received. After that, the server sends additional messages, with <code>"type": "path_find"</code>, with updates to the potential paths. The frequency of updates is left to the discretion of the server, but it usually means once every few seconds when there is a new ledger version.</p>
|
||
<p>A client can only have one pathfinding request open at a time. If another pathfinding request is already open on the same connection, the old request is automatically closed and replaced with the new request.</p>
|
||
<h4 id="request-format-19">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-40"><ul class="codetabs"><li><a href="#code-40-0">WebSocket</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-40-0" style="position: static;"><pre><code>{
|
||
"id": 8,
|
||
"command": "path_find",
|
||
"subcommand": "create",
|
||
"source_account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"destination_account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"destination_amount": {
|
||
"value": "0.001",
|
||
"currency": "USD",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p><a class="button" href="ripple-api-tool.html#path_find">Try it! ></a></p>
|
||
<p>The request includes the following parameters:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>subcommand</td>
|
||
<td>String</td>
|
||
<td>Use <code>"create"</code> to send the create subcommand</td>
|
||
</tr>
|
||
<tr>
|
||
<td>source_account</td>
|
||
<td>String</td>
|
||
<td>Unique address of the account to find a path from. (In other words, the account that would be sending a payment.)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>destination_account</td>
|
||
<td>String</td>
|
||
<td>Unique address of the account to find a path to. (In other words, the account that would receive a payment.)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>destination_amount</td>
|
||
<td>String or Object</td>
|
||
<td><a href="#specifying-currency-amounts">Currency amount</a> that the destination account would receive in a transaction. <strong>Special case:</strong> <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.30.0">version 0.30.0</a>)</em> You can specify <code>"-1"</code> (for XRP) or provide -1 as the contents of the <code>value</code> field (for non-XRP currencies). This requests a path to deliver as much as possible, while spending no more than the amount specified in <code>send_max</code> (if provided).</td>
|
||
</tr>
|
||
<tr>
|
||
<td>send_max</td>
|
||
<td>String or Object</td>
|
||
<td>(Optional) <a href="#specifying-currency-amounts">Currency amount</a> that would be spent in the transaction. Not compatible with <code>source_currencies</code>. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.30.0">version 0.30.0</a>)</em></td>
|
||
</tr>
|
||
<tr>
|
||
<td>paths</td>
|
||
<td>Array</td>
|
||
<td>(Optional) Array of arrays of objects, representing <a href="concept-paths.html">payment paths</a> to check. You can use this to keep updated on changes to particular paths you already know about, or to check the overall cost to make a payment along a certain path.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>The server also recognizes the following fields, but the results of using them are not guaranteed: <code>source_currencies</code>, <code>bridges</code>. These fields should be considered reserved for future use.</p>
|
||
<h4 id="response-format-19">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-41"><ul class="codetabs"><li><a href="#code-41-0">WebSocket</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-41-0" style="position: static;"><pre><code>{
|
||
"id": 1,
|
||
"status": "success",
|
||
"type": "response",
|
||
"result": {
|
||
"alternatives": [
|
||
{
|
||
"paths_computed": [
|
||
[
|
||
{
|
||
"currency": "USD",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 48,
|
||
"type_hex": "0000000000000030"
|
||
},
|
||
{
|
||
"account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
}
|
||
],
|
||
[
|
||
{
|
||
"currency": "USD",
|
||
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
||
"type": 48,
|
||
"type_hex": "0000000000000030"
|
||
},
|
||
{
|
||
"account": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
}
|
||
],
|
||
[
|
||
{
|
||
"currency": "USD",
|
||
"issuer": "r9vbV3EHvXWjSkeQ6CAcYVPGeq7TuiXY2X",
|
||
"type": 48,
|
||
"type_hex": "0000000000000030"
|
||
},
|
||
{
|
||
"account": "r9vbV3EHvXWjSkeQ6CAcYVPGeq7TuiXY2X",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
}
|
||
],
|
||
[
|
||
{
|
||
"currency": "USD",
|
||
"issuer": "rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun",
|
||
"type": 48,
|
||
"type_hex": "0000000000000030"
|
||
},
|
||
{
|
||
"account": "rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
}
|
||
]
|
||
],
|
||
"source_amount": "251686"
|
||
},
|
||
{
|
||
"paths_computed": [
|
||
[
|
||
{
|
||
"account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
},
|
||
{
|
||
"currency": "USD",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 48,
|
||
"type_hex": "0000000000000030"
|
||
},
|
||
{
|
||
"account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
}
|
||
],
|
||
[
|
||
{
|
||
"account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
},
|
||
{
|
||
"currency": "USD",
|
||
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
||
"type": 48,
|
||
"type_hex": "0000000000000030"
|
||
},
|
||
{
|
||
"account": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
}
|
||
],
|
||
[
|
||
{
|
||
"account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
},
|
||
{
|
||
"currency": "USD",
|
||
"issuer": "rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun",
|
||
"type": 48,
|
||
"type_hex": "0000000000000030"
|
||
},
|
||
{
|
||
"account": "rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
}
|
||
]
|
||
],
|
||
"source_amount": {
|
||
"currency": "BTC",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "0.000001541291269274307"
|
||
}
|
||
},
|
||
{
|
||
"paths_computed": [
|
||
[
|
||
{
|
||
"account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
},
|
||
{
|
||
"currency": "USD",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 48,
|
||
"type_hex": "0000000000000030"
|
||
},
|
||
{
|
||
"account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
}
|
||
]
|
||
],
|
||
"source_amount": {
|
||
"currency": "CHF",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "0.0009211546262510451"
|
||
}
|
||
},
|
||
{
|
||
"paths_computed": [
|
||
[
|
||
{
|
||
"account": "razqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
},
|
||
{
|
||
"currency": "USD",
|
||
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
||
"type": 48,
|
||
"type_hex": "0000000000000030"
|
||
},
|
||
{
|
||
"account": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
}
|
||
],
|
||
[
|
||
{
|
||
"account": "razqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
},
|
||
{
|
||
"currency": "USD",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 48,
|
||
"type_hex": "0000000000000030"
|
||
},
|
||
{
|
||
"account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
}
|
||
]
|
||
],
|
||
"source_amount": {
|
||
"currency": "CNY",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "0.006293562"
|
||
}
|
||
},
|
||
{
|
||
"paths_computed": [
|
||
[
|
||
{
|
||
"account": "rGwUWgN5BEg3QGNY3RX2HfYowjUTZdid3E",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
},
|
||
{
|
||
"currency": "USD",
|
||
"issuer": "rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun",
|
||
"type": 48,
|
||
"type_hex": "0000000000000030"
|
||
},
|
||
{
|
||
"account": "rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
}
|
||
],
|
||
[
|
||
{
|
||
"account": "rGwUWgN5BEg3QGNY3RX2HfYowjUTZdid3E",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
},
|
||
{
|
||
"currency": "USD",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 48,
|
||
"type_hex": "0000000000000030"
|
||
},
|
||
{
|
||
"account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
}
|
||
],
|
||
[
|
||
{
|
||
"account": "rGwUWgN5BEg3QGNY3RX2HfYowjUTZdid3E",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
},
|
||
{
|
||
"currency": "USD",
|
||
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
||
"type": 48,
|
||
"type_hex": "0000000000000030"
|
||
},
|
||
{
|
||
"account": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
}
|
||
]
|
||
],
|
||
"source_amount": {
|
||
"currency": "DYM",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "0.0007157142857142858"
|
||
}
|
||
},
|
||
{
|
||
"paths_computed": [
|
||
[
|
||
{
|
||
"account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
},
|
||
{
|
||
"currency": "USD",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 48,
|
||
"type_hex": "0000000000000030"
|
||
},
|
||
{
|
||
"account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
}
|
||
],
|
||
[
|
||
{
|
||
"account": "rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
},
|
||
{
|
||
"currency": "USD",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 48,
|
||
"type_hex": "0000000000000030"
|
||
},
|
||
{
|
||
"account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
}
|
||
],
|
||
[
|
||
{
|
||
"account": "rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
},
|
||
{
|
||
"currency": "USD",
|
||
"issuer": "rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun",
|
||
"type": 48,
|
||
"type_hex": "0000000000000030"
|
||
},
|
||
{
|
||
"account": "rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
}
|
||
]
|
||
],
|
||
"source_amount": {
|
||
"currency": "EUR",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "0.0007409623616236163"
|
||
}
|
||
},
|
||
{
|
||
"paths_computed": [
|
||
[
|
||
{
|
||
"account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
},
|
||
{
|
||
"currency": "USD",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 48,
|
||
"type_hex": "0000000000000030"
|
||
},
|
||
{
|
||
"account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
}
|
||
]
|
||
],
|
||
"source_amount": {
|
||
"currency": "JPY",
|
||
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"value": "0.103412412"
|
||
}
|
||
}
|
||
],
|
||
"destination_account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"destination_amount": {
|
||
"currency": "USD",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"value": "0.001"
|
||
},
|
||
"id": 1,
|
||
"source_account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"full_reply": false
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The initial response follows the <a href="#response-formatting">standard format</a>, with a successful result containing the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>alternatives</td>
|
||
<td>Array</td>
|
||
<td>Array of objects with suggested <a href="concept-paths.html">paths</a> to take, as described below. If empty, then no paths were found connecting the source and destination accounts.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>destination_account</td>
|
||
<td>String</td>
|
||
<td>Unique address of the account that would receive a transaction</td>
|
||
</tr>
|
||
<tr>
|
||
<td>destination_amount</td>
|
||
<td>String or Object</td>
|
||
<td><a href="#specifying-currency-amounts">Currency amount</a> that the destination would receive in a transaction</td>
|
||
</tr>
|
||
<tr>
|
||
<td>id</td>
|
||
<td>(Various)</td>
|
||
<td>(WebSocket only) The ID provided in the WebSocket request is included again at this level.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>source_account</td>
|
||
<td>String</td>
|
||
<td>Unique address that would send a transaction</td>
|
||
</tr>
|
||
<tr>
|
||
<td>full_reply</td>
|
||
<td>Boolean</td>
|
||
<td>If <code>false</code>, this is the result of an incomplete search. A later reply may have a better path. If <code>true</code>, then this is the best path found. (It is still theoretically possible that a better path could exist, but <code>rippled</code> won't find it.) Until you close the pathfinding request, <code>rippled</code> continues to send updates each time a new ledger closes. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.29.0">version 0.29.0</a>)</em></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>Each element in the <code>alternatives</code> array is an object that represents a path from one possible source currency (held by the initiating account) to the destination account and currency. This object has the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>paths_computed</td>
|
||
<td>Array</td>
|
||
<td>Array of arrays of objects defining <a href="concept-paths.html">payment paths</a></td>
|
||
</tr>
|
||
<tr>
|
||
<td>source_amount</td>
|
||
<td>String or Object</td>
|
||
<td><a href="#specifying-currency-amounts">Currency amount</a> that the source would have to send along this path for the destination to receive the desired amount</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="possible-errors-19">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>invalidParams</code> - One or more fields are specified incorrectly, or one or more required fields are missing.</li>
|
||
<li><code>noEvents</code> - You are using a protocol that does not support asynchronous callbacks, for example JSON-RPC. (See <a href="#ripple-path-find">ripple_path_find</a> for a pathfinding method that <em>is</em> compatible with JSON-RPC.)</li>
|
||
</ul>
|
||
<h4 id="asynchronous-follow-ups">Asynchronous Follow-ups</h4>
|
||
<p>In addition to the initial response, the server sends more messages in a similar format to update on the status of <a href="concept-paths.html">payment paths</a> over time. These messages include the <code>id</code> of the original WebSocket request so you can tell which request prompted them, and the field <code>"type": "path_find"</code> at the top level to indicate that they are additional responses. The other fields are defined in the same way as the initial response.</p>
|
||
<p>If the follow-up includes <code>"full_reply": true</code>, then this is the best path that rippled can find as of the current ledger.</p>
|
||
<p>Here is an example of an asychronous follow-up from a path_find create request:</p>
|
||
<div class="multicode" id="code-42"><ul class="codetabs"><li><a href="#code-42-0">WebSocket</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-42-0" style="position: static;"><pre><code>{
|
||
"id": 1,
|
||
"type": "path_find",
|
||
"alternatives": [
|
||
/* paths omitted from this example; same format as the initial response */
|
||
],
|
||
"destination_account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"destination_amount": {
|
||
"currency": "USD",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"value": "0.001"
|
||
},
|
||
"source_account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59"
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<h3 id="path-find-close">path_find close</h3>
|
||
<p><a href="https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/PathFind.cpp#L46" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>close</code> subcommand of <code>path_find</code> instructs the server to stop sending information about the current open pathfinding request.</p>
|
||
<h4 id="request-format-20">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-43"><ul class="codetabs"><li><a href="#code-43-0">WebSocket</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-43-0" style="position: static;"><pre><code>{
|
||
"id": 57,
|
||
"command": "path_find",
|
||
"subcommand": "close"
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The request includes the following parameters:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>subcommand</td>
|
||
<td>String</td>
|
||
<td>Use <code>"close"</code> to send the close subcommand</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="response-format-20">Response Format</h4>
|
||
<p>If a pathfinding request was successfully closed, the response follows the same format as the initial response to <a href="#path-find-create"><code>path_find create</code></a>, plus the following field:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>closed</td>
|
||
<td>Boolean</td>
|
||
<td>The value <code>true</code> indicates this reply is in response to a <code>path_find close</code> command.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>If there was no outstanding pathfinding request, an error is returned instead.</p>
|
||
<h4 id="possible-errors-20">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>invalidParams</code> - If any fields are specified incorrectly, or any required fields are missing.</li>
|
||
<li><code>noEvents</code> - If you tried to use this method on a protocol that does not support asynchronous callbacks, for example JSON-RPC. (See <a href="#ripple-path-find">ripple_path_find</a> for a pathfinding method that <em>is</em> compatible with JSON-RPC.)</li>
|
||
<li><code>noPathRequest</code> - You tried to close a pathfinding request when there is not an open one.</li>
|
||
</ul>
|
||
<h3 id="path-find-status">path_find status</h3>
|
||
<p><a href="https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/PathFind.cpp#L57" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>status</code> subcommand of <code>path_find</code> requests an immediate update about the client's currently-open pathfinding request.</p>
|
||
<h4 id="request-format-21">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-44"><ul class="codetabs"><li><a href="#code-44-0">WebSocket</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-44-0" style="position: static;"><pre><code>{
|
||
"id": 58,
|
||
"command": "path_find",
|
||
"subcommand": "status"
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The request includes the following parameters:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>subcommand</td>
|
||
<td>String</td>
|
||
<td>Use <code>"status"</code> to send the status subcommand</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="response-format-21">Response Format</h4>
|
||
<p>If a pathfinding request is open, the response follows the same format as the initial response to <a href="#path-find-create"><code>path_find create</code></a>, plus the following field:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>status</td>
|
||
<td>Boolean</td>
|
||
<td>The value <code>true</code> indicates this reply is in response to a <code>path_find status</code> command.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>If there was no outstanding pathfinding request, an error is returned instead.</p>
|
||
<h4 id="possible-errors-21">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>invalidParams</code> - One or more fields are specified incorrectly, or one or more required fields are missing.</li>
|
||
<li><code>noEvents</code> - You are using a protocol that does not support asynchronous callbacks, for example JSON-RPC. (See <a href="#ripple-path-find">ripple_path_find</a> for a pathfinding method that <em>is</em> compatible with JSON-RPC.)</li>
|
||
<li><code>noPathRequest</code> - You tried to check the status of a pathfinding request when there is not an open one.</li>
|
||
</ul>
|
||
<h2 id="ripple-path-find">ripple_path_find</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/RipplePathFind.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>ripple_path_find</code> method is a simplified version of <a href="#path-find"><code>path_find</code></a> that provides a single response with a <a href="concept-paths.html">payment path</a> you can use right away. It is available in both the WebSocket and JSON-RPC APIs. However, the results tend to become outdated as time passes. Instead of making multiple calls to stay updated, you should use <a href="#path-find"><code>path_find</code></a> instead where possible.</p>
|
||
<p>Although the <code>rippled</code> server tries to find the cheapest path or combination of paths for making a payment, it is not guaranteed that the paths returned by this method are, in fact, the best paths.</p>
|
||
<p class="devportal-callout caution"><strong>Caution:</strong> Be careful with the pathfinding results from untrusted servers. A server could be modified to return less-than-optimal paths to earn money for its operators. A server may also return poor results when under heavy load. If you do not have your own server that you can trust with pathfinding, you should compare the results of pathfinding from multiple servers run by different parties, to minimize the risk of a single server returning poor results.</p>
|
||
<h4 id="request-format-22">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-45"><ul class="codetabs"><li><a href="#code-45-0">WebSocket</a></li><li><a href="#code-45-1">JSON-RPC</a></li><li><a href="#code-45-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-45-0" style="position: static;"><pre><code>{
|
||
"id": 8,
|
||
"command": "ripple_path_find",
|
||
"source_account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"source_currencies": [
|
||
{
|
||
"currency": "XRP"
|
||
},
|
||
{
|
||
"currency": "USD"
|
||
}
|
||
],
|
||
"destination_account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"destination_amount": {
|
||
"value": "0.001",
|
||
"currency": "USD",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-45-1" style="position: static;"><pre><code>{
|
||
"method": "ripple_path_find",
|
||
"params": [
|
||
{
|
||
"destination_account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"destination_amount": {
|
||
"currency": "USD",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"value": "0.001"
|
||
},
|
||
"source_account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"source_currencies": [
|
||
{
|
||
"currency": "XRP"
|
||
},
|
||
{
|
||
"currency": "USD"
|
||
}
|
||
]
|
||
}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-45-2" style="position: static;"><pre><code>#Syntax ripple_path_find json ledger_index|ledger_hash
|
||
rippled ripple_path_find '{"source_account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", "source_currencies": [ { "currency": "XRP" }, { "currency": "USD" } ], "destination_account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", "destination_amount": { "value": "0.001", "currency": "USD", "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B" } }'
|
||
</code></pre></div>
|
||
</div>
|
||
<p><a class="button" href="ripple-api-tool.html#ripple_path_find">Try it! ></a></p>
|
||
<p>The request includes the following parameters:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>source_account</td>
|
||
<td>String</td>
|
||
<td>Unique address of the account that would send funds in a transaction</td>
|
||
</tr>
|
||
<tr>
|
||
<td>destination_account</td>
|
||
<td>String</td>
|
||
<td>Unique address of the account that would receive funds in a transaction</td>
|
||
</tr>
|
||
<tr>
|
||
<td>destination_amount</td>
|
||
<td>String or Object</td>
|
||
<td><a href="#specifying-currency-amounts">Currency amount</a> that the destination account would receive in a transaction. <strong>Special case:</strong> <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.30.0">version 0.30.0</a>)</em> You can specify <code>"-1"</code> (for XRP) or provide -1 as the contents of the <code>value</code> field (for non-XRP currencies). This requests a path to deliver as much as possible, while spending no more than the amount specified in <code>send_max</code> (if provided).</td>
|
||
</tr>
|
||
<tr>
|
||
<td>send_max</td>
|
||
<td>String or Object</td>
|
||
<td>(Optional) <a href="#specifying-currency-amounts">Currency amount</a> that would be spent in the transaction. Cannot be used with <code>source_currencies</code>. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.30.0">version 0.30.0</a>)</em></td>
|
||
</tr>
|
||
<tr>
|
||
<td>source_currencies</td>
|
||
<td>Array</td>
|
||
<td>(Optional) Array of currencies that the source account might want to spend. Each entry in the array should be a JSON object with a mandatory <code>currency</code> field and optional <code>issuer</code> field, like how <a href="#specifying-currency-amounts">currency amounts</a> are specified. Cannot contain more than <strong>18</strong> source currencies. By default, uses all source currencies available up to a maximum of <strong>88</strong> different currency/issuer pairs.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_hash</td>
|
||
<td>String</td>
|
||
<td>(Optional) A 20-byte hex string for the ledger version to use. (See <a href="#specifying-ledgers">Specifying a Ledger</a>)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>String or Unsigned Integer</td>
|
||
<td>(Optional) The sequence number of the ledger to use, or a shortcut string to choose a ledger automatically. (See <a href="#specifying-ledgers">Specifying a Ledger</a>)</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="response-format-22">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-46"><ul class="codetabs"><li><a href="#code-46-0">WebSocket</a></li><li><a href="#code-46-1">JSON-RPC</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-46-0" style="position: static;"><pre><code>{
|
||
"id": 8,
|
||
"status": "success",
|
||
"type": "response",
|
||
"result": {
|
||
"alternatives": [
|
||
{
|
||
"paths_canonical": [],
|
||
"paths_computed": [
|
||
[
|
||
{
|
||
"currency": "USD",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 48,
|
||
"type_hex": "0000000000000030"
|
||
},
|
||
{
|
||
"account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
}
|
||
],
|
||
[
|
||
{
|
||
"currency": "USD",
|
||
"issuer": "rrpNnNLKrartuEqfJGpqyDwPj1AFPg9vn1",
|
||
"type": 48,
|
||
"type_hex": "0000000000000030"
|
||
},
|
||
{
|
||
"account": "rrpNnNLKrartuEqfJGpqyDwPj1AFPg9vn1",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
},
|
||
{
|
||
"account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
}
|
||
],
|
||
[
|
||
{
|
||
"currency": "USD",
|
||
"issuer": "rrpNnNLKrartuEqfJGpqyDwPj1AFPg9vn1",
|
||
"type": 48,
|
||
"type_hex": "0000000000000030"
|
||
},
|
||
{
|
||
"account": "rrpNnNLKrartuEqfJGpqyDwPj1AFPg9vn1",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
},
|
||
{
|
||
"account": "rLpq4LgabRfm1xEX5dpWfJovYBH6g7z99q",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
},
|
||
{
|
||
"account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
}
|
||
],
|
||
[
|
||
{
|
||
"currency": "USD",
|
||
"issuer": "rrpNnNLKrartuEqfJGpqyDwPj1AFPg9vn1",
|
||
"type": 48,
|
||
"type_hex": "0000000000000030"
|
||
},
|
||
{
|
||
"account": "rrpNnNLKrartuEqfJGpqyDwPj1AFPg9vn1",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
},
|
||
{
|
||
"account": "rPuBoajMjFoDjweJBrtZEBwUMkyruxpwwV",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
},
|
||
{
|
||
"account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
}
|
||
]
|
||
],
|
||
"source_amount": "256987"
|
||
}
|
||
],
|
||
"destination_account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"destination_currencies": [
|
||
"015841551A748AD2C1F76FF6ECB0CCCD00000000",
|
||
"JOE",
|
||
"DYM",
|
||
"EUR",
|
||
"CNY",
|
||
"MXN",
|
||
"BTC",
|
||
"USD",
|
||
"XRP"
|
||
]
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-46-1" style="position: static;"><pre><code>200 OK
|
||
{
|
||
"result": {
|
||
"alternatives": [
|
||
{
|
||
"paths_canonical": [],
|
||
"paths_computed": [
|
||
[
|
||
{
|
||
"currency": "USD",
|
||
"issuer": "rpDMez6pm6dBve2TJsmDpv7Yae6V5Pyvy2",
|
||
"type": 48,
|
||
"type_hex": "0000000000000030"
|
||
},
|
||
{
|
||
"account": "rpDMez6pm6dBve2TJsmDpv7Yae6V5Pyvy2",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
},
|
||
{
|
||
"account": "rfDeu7TPUmyvUrffexjMjq3mMcSQHZSYyA",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
},
|
||
{
|
||
"account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
}
|
||
],
|
||
[
|
||
{
|
||
"currency": "USD",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 48,
|
||
"type_hex": "0000000000000030"
|
||
},
|
||
{
|
||
"account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
}
|
||
],
|
||
[
|
||
{
|
||
"currency": "USD",
|
||
"issuer": "rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun",
|
||
"type": 48,
|
||
"type_hex": "0000000000000030"
|
||
},
|
||
{
|
||
"account": "rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
},
|
||
{
|
||
"account": "raspZSGNiTKi5jmvFxUYCuYXPv1V8WhL5g",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
},
|
||
{
|
||
"account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
}
|
||
],
|
||
[
|
||
{
|
||
"currency": "USD",
|
||
"issuer": "rpHgehzdpfWRXKvSv6duKvVuo1aZVimdaT",
|
||
"type": 48,
|
||
"type_hex": "0000000000000030"
|
||
},
|
||
{
|
||
"account": "rpHgehzdpfWRXKvSv6duKvVuo1aZVimdaT",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
},
|
||
{
|
||
"account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"type": 1,
|
||
"type_hex": "0000000000000001"
|
||
}
|
||
]
|
||
],
|
||
"source_amount": "207414"
|
||
}
|
||
],
|
||
"destination_account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"destination_currencies": [
|
||
"USD",
|
||
"JOE",
|
||
"BTC",
|
||
"DYM",
|
||
"CNY",
|
||
"EUR",
|
||
"015841551A748AD2C1F76FF6ECB0CCCD00000000",
|
||
"MXN",
|
||
"XRP"
|
||
],
|
||
"status": "success"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>alternatives</td>
|
||
<td>Array</td>
|
||
<td>Array of objects with possible paths to take, as described below. If empty, then there are no paths connecting the source and destination accounts.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>destination_account</td>
|
||
<td>String</td>
|
||
<td>Unique address of the account that would receive a payment transaction</td>
|
||
</tr>
|
||
<tr>
|
||
<td>destination_currencies</td>
|
||
<td>Array</td>
|
||
<td>Array of strings representing the currencies that the destination accepts, as 3-letter codes like <code>"USD"</code> or as 40-character hex like <code>"015841551A748AD2C1F76FF6ECB0CCCD00000000"</code></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>Each element in the <code>alternatives</code> array is an object that represents a path from one possible source currency (held by the initiating account) to the destination account and currency. This object has the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>paths_computed</td>
|
||
<td>Array</td>
|
||
<td>Array of arrays of objects defining <a href="concept-paths.html">payment paths</a></td>
|
||
</tr>
|
||
<tr>
|
||
<td>source_amount</td>
|
||
<td>String or Object</td>
|
||
<td><a href="#specifying-currency-amounts">Currency amount</a> that the source would have to send along this path for the destination to receive the desired amount</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>The following fields are deprecated, and may be omitted: <code>paths_canonical</code>, and <code>paths_expanded</code>. If they appear, you should disregard them.</p>
|
||
<h4 id="possible-errors-22">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>tooBusy</code> - The server is under too much load to calculate paths. Not returned if you are connected as an admin.</li>
|
||
<li><code>invalidParams</code> - One or more fields are specified incorrectly, or one or more required fields are missing.</li>
|
||
<li><code>srcActMissing</code> - The <code>source_account</code> field is omitted from the request.</li>
|
||
<li><code>srcActMalformed</code> - The <code>source_account</code> field in the request is not formatted properly.</li>
|
||
<li><code>dstActMissing</code> - The <code>destination_account</code> field is omitted from the request.</li>
|
||
<li><code>dstActMalformed</code> - The <code>destination_account</code> field in the request is not formatted properly.</li>
|
||
<li><code>srcCurMalformed</code> - The <code>source_currencies</code> field is not formatted properly.</li>
|
||
<li><code>srcIsrMalformed</code> - The <code>issuer</code> field of one or more of the currency objects in the request is not valid.</li>
|
||
</ul>
|
||
<h2 id="sign">sign</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/SignHandler.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>sign</code> method takes a <a href="reference-transaction-format.html">transaction in JSON format</a> and a secret key, and returns a signed binary representation of the transaction. The result is always different, even when you provide the same transaction JSON and secret key. To contribute one signature to a multi-signed transaction, use the <a href="#sign-for"><code>sign_for</code> command</a> instead.</p>
|
||
<p class="devportal-callout caution"><strong>Caution:</strong> Unless you run the <code>rippled</code> server yourself, you should do <a href="reference-rippleapi.html#sign">local signing with RippleAPI</a> instead of using this command. An untrustworthy server could change the transaction before signing it, or use your secret key to sign additional arbitrary transactions as if they came from you.</p>
|
||
<h4 id="request-format-23">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-47"><ul class="codetabs"><li><a href="#code-47-0">WebSocket</a></li><li><a href="#code-47-1">JSON-RPC</a></li><li><a href="#code-47-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-47-0" style="position: static;"><pre><code>{
|
||
"id": 2,
|
||
"command": "sign",
|
||
"tx_json" : {
|
||
"TransactionType" : "Payment",
|
||
"Account" : "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||
"Destination" : "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
|
||
"Amount" : {
|
||
"currency" : "USD",
|
||
"value" : "1",
|
||
"issuer" : "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
|
||
}
|
||
},
|
||
"secret" : "s████████████████████████████",
|
||
"offline": false,
|
||
"fee_mult_max": 1000
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-47-1" style="position: static;"><pre><code>{
|
||
"method": "sign",
|
||
"params": [
|
||
{
|
||
"offline": false,
|
||
"secret": "s████████████████████████████",
|
||
"tx_json": {
|
||
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||
"Amount": {
|
||
"currency": "USD",
|
||
"issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||
"value": "1"
|
||
},
|
||
"Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
|
||
"TransactionType": "Payment"
|
||
},
|
||
"fee_mult_max": 1000
|
||
}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-47-2" style="position: static;"><pre><code>#Syntax: sign secret tx_json [offline]
|
||
rippled sign s████████████████████████████ '{"TransactionType": "Payment", "Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX", "Amount": { "currency": "USD", "value": "1", "issuer" : "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn" }, "Sequence": 360, "Fee": "10000"}' offline
|
||
</code></pre></div>
|
||
</div>
|
||
<p><a class="button" href="ripple-api-tool.html#sign">Try it! ></a></p>
|
||
<p>To sign a transaction, you must provide a secret key that can <a href="reference-transaction-format.html#authorizing-transactions">authorize the transaction</a>. You can do this in a few ways:</p>
|
||
<ul>
|
||
<li>Provide a <code>secret</code> value and omit the <code>key_type</code> field. This value can be formatted as base-58 seed, RFC-1751, hexadecimal, or as a string passphrase. (secp256k1 keys only)</li>
|
||
<li>Provide a <code>key_type</code> value and exactly one of <code>seed</code>, <code>seed_hex</code>, or <code>passphrase</code>. Omit the <code>secret</code> field. (Not supported by the commandline syntax.)</li>
|
||
</ul>
|
||
<p>The request includes the following parameters:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>tx_json</td>
|
||
<td>Object</td>
|
||
<td><a href="reference-transaction-format.html">Transaction definition</a> in JSON format</td>
|
||
</tr>
|
||
<tr>
|
||
<td>secret</td>
|
||
<td>String</td>
|
||
<td>(Optional) Secret key of the account supplying the transaction, used to sign it. Do not send your secret to untrusted servers or through unsecured network connections. Cannot be used with <code>key_type</code>, <code>seed</code>, <code>seed_hex</code>, or <code>passphrase</code>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>seed</td>
|
||
<td>String</td>
|
||
<td>(Optional) Secret key of the account supplying the transaction, used to sign it. Must be in base-58 format. If provided, you must also specify the <code>key_type</code>. Cannot be used with <code>secret</code>, <code>seed_hex</code>, or <code>passphrase</code>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>seed_hex</td>
|
||
<td>String</td>
|
||
<td>(Optional) Secret key of the account supplying the transaction, used to sign it. Must be in hexadecimal format. If provided, you must also specify the <code>key_type</code>. Cannot be used with <code>secret</code>, <code>seed</code>, or <code>passphrase</code>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>passphrase</td>
|
||
<td>String</td>
|
||
<td>(Optional) Secret key of the account supplying the transaction, used to sign it, as a string passphrase. If provided, you must also specify the <code>key_type</code>. Cannot be used with <code>secret</code>, <code>seed</code>, or <code>seed_hex</code>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>key_type</td>
|
||
<td>String</td>
|
||
<td>(Optional) Type of cryptographic key provided in this request. Valid types are <code>secp256k1</code> or <code>ed25519</code>. Defaults to <code>secp256k1</code>. Cannot be used with <code>secret</code>. <strong>Caution:</strong> Ed25519 support is experimental.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>offline</td>
|
||
<td>Boolean</td>
|
||
<td>(Optional, defaults to false) If true, when constructing the transaction, do not try to automatically fill in or validate values.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>build_path</td>
|
||
<td>Boolean</td>
|
||
<td>(Optional) If provided for a Payment-type transaction, automatically fill in the <code>Paths</code> field before signing. <strong>Caution:</strong> The server looks for the presence or absence of this field, not its value. This behavior may change.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>fee_mult_max</td>
|
||
<td>Integer</td>
|
||
<td>(Optional, defaults to 10; recommended value 1000) Limits how high the <a href="reference-transaction-format.html#auto-fillable-fields">automatically-provided <code>Fee</code> field</a> can be. Signing fails with the error <code>rpcHIGH_FEE</code> if the current <a href="concept-transaction-cost.html#local-load-cost">load multiplier on the transaction cost</a> is greater than (<code>fee_mult_max</code> ÷ <code>fee_div_max</code>). Ignored if you specify the <code>Fee</code> field of the transaction (<a href="concept-transaction-cost.html">transaction cost</a>).</td>
|
||
</tr>
|
||
<tr>
|
||
<td>fee_div_max</td>
|
||
<td>Integer</td>
|
||
<td>(Optional, defaults to 1) Signing fails with the error <code>rpcHIGH_FEE</code> if the current <a href="concept-transaction-cost.html#local-load-cost">load multiplier on the transaction cost</a> is greater than (<code>fee_mult_max</code> ÷ <code>fee_div_max</code>). Ignored if you specify the <code>Fee</code> field of the transaction (<a href="concept-transaction-cost.html">transaction cost</a>). <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.30.1">version 0.30.1</a>)</em></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h3 id="auto-fillable-fields">Auto-Fillable Fields</h3>
|
||
<p>The server automatically tries to fill in certain fields in <code>tx_json</code> (the <a href="reference-transaction-format.html">Transaction object</a>) automatically if you omit them. The server provides the following fields before signing, unless the request specified <code>offline</code> as <code>true</code>:</p>
|
||
<ul>
|
||
<li><code>Sequence</code> - The server automatically uses the next Sequence number from the sender's account information.<ul>
|
||
<li class="devportal-callout caution"><strong>Caution:</strong> The next sequence number for the account is not incremented until this transaction is applied. If you sign multiple transactions without submitting and waiting for the response to each one, you must manually provide the correct sequence numbers for each transaction after the first.</li>
|
||
</ul>
|
||
</li>
|
||
<li><code>Fee</code> - If you omit the <code>Fee</code> parameter, the server tries to fill in an appropriate transaction cost automatically. On the production Ripple Consensus Ledger, this fails with <code>rpcHIGH_FEE</code> unless you provide an appropriate <code>fee_mult_max</code> value.<ul>
|
||
<li>The <code>fee_mult_max</code> and <code>fee_div_max</code> parameters limit how high the automatically-provided transaction cost can be, in terms of the load-scaling multiplier that gets applied to the <a href="concept-transaction-cost.html#reference-transaction-cost">reference transaction cost</a>. The default settings return an error if the automatically-provided value would use greater than a 10× multiplier. However, the production Ripple Consensus Ledger <a href="concept-transaction-cost.html#current-transaction-cost">typically has a 1000× load multiplier</a>.</li>
|
||
<li>The commandline syntax does not support <code>fee_mult_max</code> and <code>fee_div_max</code>. For the production Ripple Consensus Ledger, you must provide a <code>Fee</code> value.</li>
|
||
<li class="devportal-callout caution"><strong>Caution:</strong> A malicious server can specify an excessively high transaction cost, ignoring the values of <code>fee_mult_max</code> and <code>fee_div_max</code>.</li>
|
||
</ul>
|
||
</li>
|
||
<li><code>Paths</code> - For Payment-type transactions (excluding XRP-to-XRP transfers), the Paths field can be automatically filled, as if you did a <a href="#ripple-path-find">ripple_path_find</a>. Only filled if <code>build_path</code> is provided.</li>
|
||
</ul>
|
||
<h4 id="response-format-23">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-48"><ul class="codetabs"><li><a href="#code-48-0">WebSocket</a></li><li><a href="#code-48-1">JSON-RPC</a></li><li><a href="#code-48-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-48-0" style="position: static;"><pre><code>{
|
||
"id": 2,
|
||
"status": "success",
|
||
"type": "response",
|
||
"result": {
|
||
"tx_blob": "1200002280000000240000016861D4838D7EA4C6800000000000000000000000000055534400000000004B4E9C06F24296074F7BC48F92A97916C6DC5EA9684000000000002710732103AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB7446304402200E5C2DD81FDF0BE9AB2A8D797885ED49E804DBF28E806604D878756410CA98B102203349581946B0DDA06B36B35DBC20EDA27552C1F167BCF5C6ECFF49C6A46F858081144B4E9C06F24296074F7BC48F92A97916C6DC5EA983143E9D4A2B8AA0780F682D136F7A56D6724EF53754",
|
||
"tx_json": {
|
||
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||
"Amount": {
|
||
"currency": "USD",
|
||
"issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||
"value": "1"
|
||
},
|
||
"Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
|
||
"Fee": "10000",
|
||
"Flags": 2147483648,
|
||
"Sequence": 360,
|
||
"SigningPubKey": "03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB",
|
||
"TransactionType": "Payment",
|
||
"TxnSignature": "304402200E5C2DD81FDF0BE9AB2A8D797885ED49E804DBF28E806604D878756410CA98B102203349581946B0DDA06B36B35DBC20EDA27552C1F167BCF5C6ECFF49C6A46F8580",
|
||
"hash": "4D5D90890F8D49519E4151938601EF3D0B30B16CD6A519D9C99102C9FA77F7E0"
|
||
}
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-48-1" style="position: static;"><pre><code>200 OK
|
||
{
|
||
"result": {
|
||
"status": "success",
|
||
"tx_blob": "1200002280000000240000016861D4838D7EA4C6800000000000000000000000000055534400000000004B4E9C06F24296074F7BC48F92A97916C6DC5EA9684000000000002710732103AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB7446304402200E5C2DD81FDF0BE9AB2A8D797885ED49E804DBF28E806604D878756410CA98B102203349581946B0DDA06B36B35DBC20EDA27552C1F167BCF5C6ECFF49C6A46F858081144B4E9C06F24296074F7BC48F92A97916C6DC5EA983143E9D4A2B8AA0780F682D136F7A56D6724EF53754",
|
||
"tx_json": {
|
||
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||
"Amount": {
|
||
"currency": "USD",
|
||
"issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||
"value": "1"
|
||
},
|
||
"Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
|
||
"Fee": "10000",
|
||
"Flags": 2147483648,
|
||
"Sequence": 360,
|
||
"SigningPubKey": "03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB",
|
||
"TransactionType": "Payment",
|
||
"TxnSignature": "304402200E5C2DD81FDF0BE9AB2A8D797885ED49E804DBF28E806604D878756410CA98B102203349581946B0DDA06B36B35DBC20EDA27552C1F167BCF5C6ECFF49C6A46F8580",
|
||
"hash": "4D5D90890F8D49519E4151938601EF3D0B30B16CD6A519D9C99102C9FA77F7E0"
|
||
}
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-48-2" style="position: static;"><pre><code>Loading: "/etc/rippled.cfg"
|
||
Connecting to 127.0.0.1:5005
|
||
{
|
||
"result" : {
|
||
"status" : "success",
|
||
"tx_blob" : "1200002280000000240000016861D4838D7EA4C6800000000000000000000000000055534400000000004B4E9C06F24296074F7BC48F92A97916C6DC5EA9684000000000002710732103AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB7447304502210094D24C795CFFA8E46FE338AF63421DA5CE5E171ED56F8E4CE70FFABA15D3CFA2022063994C52BF0393C8157EBFFCDE6A7E7EDC7B16A462CA53214F64CC8FCBB5E54A81144B4E9C06F24296074F7BC48F92A97916C6DC5EA983143E9D4A2B8AA0780F682D136F7A56D6724EF53754",
|
||
"tx_json" : {
|
||
"Account" : "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||
"Amount" : {
|
||
"currency" : "USD",
|
||
"issuer" : "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||
"value" : "1"
|
||
},
|
||
"Destination" : "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
|
||
"Fee" : "10000",
|
||
"Flags" : 2147483648,
|
||
"Sequence" : 360,
|
||
"SigningPubKey" : "03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB",
|
||
"TransactionType" : "Payment",
|
||
"TxnSignature" : "304502210094D24C795CFFA8E46FE338AF63421DA5CE5E171ED56F8E4CE70FFABA15D3CFA2022063994C52BF0393C8157EBFFCDE6A7E7EDC7B16A462CA53214F64CC8FCBB5E54A",
|
||
"hash" : "DE80DA6FF9F93FE4CE87C99441F403E0290E35867FF48382204CB89975BF343E"
|
||
}
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>tx_blob</td>
|
||
<td>String</td>
|
||
<td>Binary representation of the fully-qualified, signed transaction, as hex</td>
|
||
</tr>
|
||
<tr>
|
||
<td>tx_json</td>
|
||
<td>Object</td>
|
||
<td>JSON specification of the <a href="reference-transaction-format.html">complete transaction</a> as signed, including any fields that were automatically filled in</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p class="devportal-callout caution"><strong>Caution:</strong> If this command results in an error messages, the message can contain the secret key from the request. Make sure that these errors are not visible to others.</p>
|
||
<ul>
|
||
<li>Do not write this error to a log file that can be seen by multiple people.</li>
|
||
<li>Do not paste this error to a public place for debugging.</li>
|
||
<li>Do not display the error message on a website, even by accident.</li>
|
||
</ul>
|
||
<h4 id="possible-errors-23">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>invalidParams</code> - One or more fields are specified incorrectly, or one or more required fields are missing.</li>
|
||
<li><code>highFee</code> - The current load-based multiplier to the transaction cost exceeds the limit for an automatically-provided transaction cost. Either specify a higher <code>fee_mult_max</code> (at least 1000) in the request or manually provide a value in the <code>Fee</code> field of the <code>tx_json</code>.</li>
|
||
<li><code>tooBusy</code> - The transaction did not include paths, but the server is too busy to do pathfinding right now. Does not occur if you are connected as an admin.</li>
|
||
<li><code>noPath</code> - The transaction did not include paths, and the server was unable to find a path by which this payment can occur.</li>
|
||
</ul>
|
||
<h2 id="sign-for">sign_for</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/release/src/ripple/rpc/handlers/SignFor.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>sign_for</code> command provides one signature for a <a href="reference-transaction-format.html#multi-signing">multi-signed transaction</a>.</p>
|
||
<p>This command requires the <a href="concept-amendments.html#multisign">MultiSign amendment</a> to be enabled. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.31.0">version 0.31.0</a>)</em></p>
|
||
<h4 id="request-format-24">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-49"><ul class="codetabs"><li><a href="#code-49-0">WebSocket</a></li><li><a href="#code-49-1">JSON-RPC</a></li><li><a href="#code-49-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-49-0" style="position: static;"><pre><code>{
|
||
"id": "sign_for_example",
|
||
"command": "sign_for",
|
||
"account": "rLFd1FzHMScFhLsXeaxStzv3UC97QHGAbM",
|
||
"seed": "s████████████████████████████",
|
||
"key_type": "ed25519",
|
||
"tx_json": {
|
||
"TransactionType": "TrustSet",
|
||
"Account": "rEuLyBCvcw4CFmzv8RepSiAoNgF8tTGJQC",
|
||
"Flags": 262144,
|
||
"LimitAmount": {
|
||
"currency": "USD",
|
||
"issuer": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||
"value": "100"
|
||
},
|
||
"Sequence": 2,
|
||
"SigningPubKey": "",
|
||
"Fee": "30000"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-49-1" style="position: static;"><pre><code>POST http://localhost:5005/
|
||
{
|
||
"method": "sign_for",
|
||
"params": [{
|
||
"account": "rLFd1FzHMScFhLsXeaxStzv3UC97QHGAbM",
|
||
"seed": "s████████████████████████████",
|
||
"key_type": "ed25519",
|
||
"tx_json": {
|
||
"TransactionType": "TrustSet",
|
||
"Account": "rEuLyBCvcw4CFmzv8RepSiAoNgF8tTGJQC",
|
||
"Flags": 262144,
|
||
"LimitAmount": {
|
||
"currency": "USD",
|
||
"issuer": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||
"value": "100"
|
||
},
|
||
"Sequence": 2,
|
||
"SigningPubKey": "",
|
||
"Fee": "30000"
|
||
}
|
||
}]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-49-2" style="position: static;"><pre><code>#Syntax: rippled sign_for <signer_address> <signer_secret> [offline]
|
||
rippled sign_for rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW s████████████████████████████ '{
|
||
"TransactionType": "TrustSet",
|
||
"Account": "rEuLyBCvcw4CFmzv8RepSiAoNgF8tTGJQC",
|
||
"Flags": 262144,
|
||
"LimitAmount": {
|
||
"currency": "USD",
|
||
"issuer": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||
"value": "100"
|
||
},
|
||
"Sequence": 2,
|
||
"SigningPubKey": "",
|
||
"Fee": "30000"
|
||
}'
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The request includes the following parameters:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>account</td>
|
||
<td>String - <a href="#addresses">Address</a></td>
|
||
<td>The address which is providing the signature.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>tx_json</td>
|
||
<td>Object</td>
|
||
<td>The <a href="reference-transaction-format.html">Transaction</a> to sign. Unlike using the <a href="#sign"><code>sign</code> command</a>, all fields of the transaction must be provided, including <code>Fee</code> and <code>Sequence</code>. The transaction must include the field <code>SigningPubKey</code> with an empty string as the value. The object may optionally contain a <code>Signers</code> array with previously-collected signatures.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>secret</td>
|
||
<td>String</td>
|
||
<td>(Optional) The secret key to sign with. (Cannot be used with <code>key_type</code>.)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>passphrase</td>
|
||
<td>String</td>
|
||
<td>(Optional) A passphrase to use as the secret key to sign with.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>seed</td>
|
||
<td>String</td>
|
||
<td>(Optional) A base-58-encoded secret key to sign with.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>seed_hex</td>
|
||
<td>String</td>
|
||
<td>(Optional) A hexadecimal secret key to sign with.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>key_type</td>
|
||
<td>String</td>
|
||
<td>(Optional) The type of key to use for signing. This can be <code>secp256k1</code> or <code>ed25519</code>. (Ed25519 support is experimental.)</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>You must provide exactly 1 field with the secret key. You can use any of the following fields: <code>secret</code>, <code>passphrase</code>, <code>seed</code>, or <code>seed_hex</code>.</p>
|
||
<h4 id="response-format-24">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-50"><ul class="codetabs"><li><a href="#code-50-0">WebSocket</a></li><li><a href="#code-50-1">JSON-RPC</a></li><li><a href="#code-50-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-50-0" style="position: static;"><pre><code>{
|
||
"id": "sign_for_example",
|
||
"status": "success",
|
||
"type": "response",
|
||
"result": {
|
||
"tx_blob": "1200142200040000240000000263D5038D7EA4C680000000000000000000000000005553440000000000B5F762798A53D543A014CAF8B297CFF8F2F937E868400000000000753073008114A3780F5CB5A44D366520FC44055E8ED44D9A2270F3E0107321EDDF4ECB8F34A168143B928D48EFE625501FB8552403BBBD3FC038A5788951D7707440C3DCA3FEDE6D785398EEAB10A46B44047FF1B0863FC4313051FB292C991D1E3A9878FABB301128FE4F86F3D8BE4706D53FA97F5536DBD31AF14CD83A5ACDEB068114D96CB910955AB40A0E987EEE82BB3CEDD4441AAAE1F1",
|
||
"tx_json": {
|
||
"Account": "rEuLyBCvcw4CFmzv8RepSiAoNgF8tTGJQC",
|
||
"Fee": "30000",
|
||
"Flags": 262144,
|
||
"LimitAmount": {
|
||
"currency": "USD",
|
||
"issuer": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||
"value": "100"
|
||
},
|
||
"Sequence": 2,
|
||
"Signers": [
|
||
{
|
||
"Signer": {
|
||
"Account": "rLFd1FzHMScFhLsXeaxStzv3UC97QHGAbM",
|
||
"SigningPubKey": "EDDF4ECB8F34A168143B928D48EFE625501FB8552403BBBD3FC038A5788951D770",
|
||
"TxnSignature": "C3DCA3FEDE6D785398EEAB10A46B44047FF1B0863FC4313051FB292C991D1E3A9878FABB301128FE4F86F3D8BE4706D53FA97F5536DBD31AF14CD83A5ACDEB06"
|
||
}
|
||
}
|
||
],
|
||
"SigningPubKey": "",
|
||
"TransactionType": "TrustSet",
|
||
"hash": "5216A13A3E3CF662352F0B430C7D82B7450415B6883DD428B5EC1DF1DE45DD8C"
|
||
}
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-50-1" style="position: static;"><pre><code>200 OK
|
||
{
|
||
"result" : {
|
||
"status" : "success",
|
||
"tx_blob" : "1200142200040000240000000263D5038D7EA4C680000000000000000000000000005553440000000000B5F762798A53D543A014CAF8B297CFF8F2F937E868400000000000753073008114A3780F5CB5A44D366520FC44055E8ED44D9A2270F3E010732102B3EC4E5DD96029A647CFA20DA07FE1F85296505552CCAC114087E66B46BD77DF744730450221009C195DBBF7967E223D8626CA19CF02073667F2B22E206727BFE848FF42BEAC8A022048C323B0BED19A988BDBEFA974B6DE8AA9DCAE250AA82BBD1221787032A864E58114204288D2E47F8EF6C99BCC457966320D12409711E1F1",
|
||
"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"
|
||
}
|
||
}
|
||
],
|
||
"SigningPubKey" : "",
|
||
"TransactionType" : "TrustSet",
|
||
"hash" : "A94A6417D1A7AAB059822B894E13D322ED3712F7212CE9257801F96DE6C3F6AE"
|
||
}
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-50-2" style="position: static;"><pre><code>Loading: "/etc/rippled.cfg"
|
||
Connecting to 127.0.0.1:5005
|
||
{
|
||
"result" : {
|
||
"status" : "success",
|
||
"tx_blob" : "1200142200040000240000000263D5038D7EA4C680000000000000000000000000005553440000000000B5F762798A53D543A014CAF8B297CFF8F2F937E868400000000000753073008114A3780F5CB5A44D366520FC44055E8ED44D9A2270F3E010732102B3EC4E5DD96029A647CFA20DA07FE1F85296505552CCAC114087E66B46BD77DF744730450221009C195DBBF7967E223D8626CA19CF02073667F2B22E206727BFE848FF42BEAC8A022048C323B0BED19A988BDBEFA974B6DE8AA9DCAE250AA82BBD1221787032A864E58114204288D2E47F8EF6C99BCC457966320D12409711E1F1",
|
||
"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"
|
||
}
|
||
}
|
||
],
|
||
"SigningPubKey" : "",
|
||
"TransactionType" : "TrustSet",
|
||
"hash" : "A94A6417D1A7AAB059822B894E13D322ED3712F7212CE9257801F96DE6C3F6AE"
|
||
}
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>tx_blob</td>
|
||
<td>String</td>
|
||
<td>Hexadecimal representation of the signed transaction, including the newly-added signature. If it has enough signatures, you can <a href="#submit-only-mode">submit this string using the <code>submit</code> command</a>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>tx_json</td>
|
||
<td>Object</td>
|
||
<td>The <a href="reference-transaction-format.html">transaction specification</a> in JSON format, with the newly-added signature in the <code>Signers</code> array. If it has enough signatures, you can submit this object using the <a href="#submit-multisigned"><code>submit_multisigned</code> command</a>.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="possible-errors-24">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>invalidParams</code> - One or more fields are specified incorrectly, or one or more required fields are missing.</li>
|
||
<li><code>srcActNotFound</code> - If the <code>Account</code> from the transaction is not a funded address in the ledger.</li>
|
||
<li><code>srcActMalformed</code> - If the signing address (<code>account</code> field) from the request is not validly formed.</li>
|
||
<li><code>badSeed</code> - The seed value supplied was invalidly-formatted.</li>
|
||
<li><code>badSecret</code> - The secret value supplied was invalidly-formatted.</li>
|
||
</ul>
|
||
<h2 id="submit">submit</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/Submit.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>submit</code> method applies a <a href="reference-transaction-format.html">transaction</a> and sends it to the network to be confirmed and included in future ledgers.</p>
|
||
<p>This command has two modes:</p>
|
||
<ul>
|
||
<li>Submit-only mode takes a signed, serialized transaction as a binary blob, and submits it to the network as-is. Since signed transaction objects are immutable, no part of the transaction can be modified or automatically filled in after submission.</li>
|
||
<li>Sign-and-submit mode takes a JSON-formatted Transaction object, completes and signs the transaction in the same manner as the <a href="#sign">sign command</a>, and then submits the signed transaction. We recommend only using this mode for testing and development.</li>
|
||
</ul>
|
||
<p>To send a transaction as robustly as possible, you should construct and <a href="#sign"><code>sign</code></a> it in advance, persist it somewhere that you can access even after a power outage, then <code>submit</code> it as a <code>tx_blob</code>. After submission, monitor the network with the <a href="#tx"><code>tx</code></a> command to see if the transaction was successfully applied; if a restart or other problem occurs, you can safely re-submit the <code>tx_blob</code> transaction: it won't be applied twice since it has the same sequence number as the old transaction.</p>
|
||
<h3 id="submit-only-mode">Submit-Only Mode</h3>
|
||
<p>A submit-only request includes the following parameters:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>tx_blob</td>
|
||
<td>String</td>
|
||
<td>Hex representation of the signed transaction to submit. This can be a <a href="reference-transaction-format.html#multi-signing">multi-signed transaction</a>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>fail_hard</td>
|
||
<td>Boolean</td>
|
||
<td>(Optional, defaults to false) If true, and the transaction fails locally, do not retry or relay the transaction to other servers</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="request-format-25">Request Format</h4>
|
||
<div class="multicode" id="code-51"><ul class="codetabs"><li><a href="#code-51-0">WebSocket</a></li><li><a href="#code-51-1">JSON-RPC</a></li><li><a href="#code-51-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-51-0" style="position: static;"><pre><code>{
|
||
"id": 3,
|
||
"command": "submit",
|
||
"tx_blob": "1200002280000000240000001E61D4838D7EA4C6800000000000000000000000000055534400000000004B4E9C06F24296074F7BC48F92A97916C6DC5EA968400000000000000B732103AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB7447304502210095D23D8AF107DF50651F266259CC7139D0CD0C64ABBA3A958156352A0D95A21E02207FCF9B77D7510380E49FF250C21B57169E14E9B4ACFD314CEDC79DDD0A38B8A681144B4E9C06F24296074F7BC48F92A97916C6DC5EA983143E9D4A2B8AA0780F682D136F7A56D6724EF53754"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-51-1" style="position: static;"><pre><code>{
|
||
"method": "submit",
|
||
"params": [
|
||
{
|
||
"tx_blob": "1200002280000000240000000361D4838D7EA4C6800000000000000000000000000055534400000000004B4E9C06F24296074F7BC48F92A97916C6DC5EA968400000000000000A732103AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB74473045022100D184EB4AE5956FF600E7536EE459345C7BBCF097A84CC61A93B9AF7197EDB98702201CEA8009B7BEEBAA2AACC0359B41C427C1C5B550A4CA4B80CF2174AF2D6D5DCE81144B4E9C06F24296074F7BC48F92A97916C6DC5EA983143E9D4A2B8AA0780F682D136F7A56D6724EF53754"
|
||
}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-51-2" style="position: static;"><pre><code>#Syntax: submit tx_blob
|
||
submit 1200002280000000240000000361D4838D7EA4C6800000000000000000000000000055534400000000004B4E9C06F24296074F7BC48F92A97916C6DC5EA968400000000000000A732103AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB74473045022100D184EB4AE5956FF600E7536EE459345C7BBCF097A84CC61A93B9AF7197EDB98702201CEA8009B7BEEBAA2AACC0359B41C427C1C5B550A4CA4B80CF2174AF2D6D5DCE81144B4E9C06F24296074F7BC48F92A97916C6DC5EA983143E9D4A2B8AA0780F682D136F7A56D6724EF53754
|
||
</code></pre></div>
|
||
</div>
|
||
<p><a class="button" href="ripple-api-tool.html#submit">Try it! ></a></p>
|
||
<h3 id="sign-and-submit-mode">Sign-and-Submit Mode</h3>
|
||
<p>This mode signs a transaction and immediately submits it. This mode is intended to be used for testing. You cannot use this mode for <a href="reference-transaction-format.html#multi-signing">multi-signed transactions</a>.</p>
|
||
<p>You can provide the secret key used to sign the transaction in the following ways:</p>
|
||
<ul>
|
||
<li>Provide a <code>secret</code> value and omit the <code>key_type</code> field. This value can be formatted as base-58 seed, RFC-1751, hexadecimal, or as a string passphrase. (secp256k1 keys only)</li>
|
||
<li>Provide a <code>key_type</code> value and exactly one of <code>seed</code>, <code>seed_hex</code>, or <code>passphrase</code>. Omit the <code>secret</code> field. (Not supported by the commandline syntax.)</li>
|
||
</ul>
|
||
<p>The request includes the following parameters:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>tx_json</td>
|
||
<td>Object</td>
|
||
<td><a href="reference-transaction-format.html">Transaction definition</a> in JSON format, optionally omitting any auto-fillable fields.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>secret</td>
|
||
<td>String</td>
|
||
<td>(Optional) Secret key of the account supplying the transaction, used to sign it. Do not send your secret to untrusted servers or through unsecured network connections. Cannot be used with <code>key_type</code>, <code>seed</code>, <code>seed_hex</code>, or <code>passphrase</code>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>seed</td>
|
||
<td>String</td>
|
||
<td>(Optional) Secret key of the account supplying the transaction, used to sign it. Must be in base-58 format. If provided, you must also specify the <code>key_type</code>. Cannot be used with <code>secret</code>, <code>seed_hex</code>, or <code>passphrase</code>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>seed_hex</td>
|
||
<td>String</td>
|
||
<td>(Optional) Secret key of the account supplying the transaction, used to sign it. Must be in hexadecimal format. If provided, you must also specify the <code>key_type</code>. Cannot be used with <code>secret</code>, <code>seed</code>, or <code>passphrase</code>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>passphrase</td>
|
||
<td>String</td>
|
||
<td>(Optional) Secret key of the account supplying the transaction, used to sign it, as a string passphrase. If provided, you must also specify the <code>key_type</code>. Cannot be used with <code>secret</code>, <code>seed</code>, or <code>seed_hex</code>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>key_type</td>
|
||
<td>String</td>
|
||
<td>(Optional) Type of cryptographic key provided in this request. Valid types are <code>secp256k1</code> or <code>ed25519</code>. Defaults to <code>secp256k1</code>. Cannot be used with <code>secret</code>. <strong>Caution:</strong> Ed25519 support is experimental.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>fail_hard</td>
|
||
<td>Boolean</td>
|
||
<td>(Optional, defaults to false) If true, and the transaction fails locally, do not retry or relay the transaction to other servers</td>
|
||
</tr>
|
||
<tr>
|
||
<td>offline</td>
|
||
<td>Boolean</td>
|
||
<td>(Optional, defaults to false) If true, when constructing the transaction, do not try to automatically fill in or validate values.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>build_path</td>
|
||
<td>Boolean</td>
|
||
<td>(Optional) If provided for a Payment-type transaction, automatically fill in the <code>Paths</code> field before signing. You must omit this field if the transaction is a direct XRP-to-XRP transfer. <strong>Caution:</strong> The server looks for the presence or absence of this field, not its value. This behavior may change.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>fee_mult_max</td>
|
||
<td>Integer</td>
|
||
<td>(Optional, defaults to 10, recommended value 1000) If the <code>Fee</code> parameter is omitted, this field limits the automatically-provided <code>Fee</code> value so that it is less than or equal to the long-term base transaction cost times this value.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>fee_div_max</td>
|
||
<td>Integer</td>
|
||
<td>(Optional, defaults to 1) Used with <code>fee_mult_max</code> to create a fractional multiplier for the limit. Specifically, the server multiplies its base <a href="concept-transaction-cost.html">transaction cost</a> by <code>fee_mult_max</code>, then divides by this value (rounding down to an integer) to get a limit. If the automatically-provided <code>Fee</code> value would be over the limit, the submit command fails. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.30.1">version 0.30.1</a>)</em></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>See the <a href="#sign">sign command</a> for detailed information on how the server automatically fills in certain fields.</p>
|
||
<h4 id="request-format-26">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-52"><ul class="codetabs"><li><a href="#code-52-0">WebSocket</a></li><li><a href="#code-52-1">JSON-RPC</a></li><li><a href="#code-52-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-52-0" style="position: static;"><pre><code>{
|
||
"id": 2,
|
||
"command": "submit",
|
||
"tx_json" : {
|
||
"TransactionType" : "Payment",
|
||
"Account" : "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||
"Destination" : "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
|
||
"Amount" : {
|
||
"currency" : "USD",
|
||
"value" : "1",
|
||
"issuer" : "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
|
||
}
|
||
},
|
||
"secret" : "s████████████████████████████",
|
||
"offline": false,
|
||
"fee_mult_max": 1000
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-52-1" style="position: static;"><pre><code>{
|
||
"method": "submit",
|
||
"params": [
|
||
{
|
||
"offline": false,
|
||
"secret": "s████████████████████████████",
|
||
"tx_json": {
|
||
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||
"Amount": {
|
||
"currency": "USD",
|
||
"issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||
"value": "1"
|
||
},
|
||
"Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
|
||
"TransactionType": "Payment"
|
||
},
|
||
"fee_mult_max": 1000
|
||
}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-52-2" style="position: static;"><pre><code>#Syntax: submit secret json [offline]
|
||
rippled submit s████████████████████████████ '{"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "Amount": { "currency": "USD", "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "value": "1" }, "Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX", "TransactionType": "Payment", "Fee": "10000"}'
|
||
</code></pre></div>
|
||
</div>
|
||
<p><a class="button" href="ripple-api-tool.html#submit">Try it! ></a></p>
|
||
<h4 id="response-format-25">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-53"><ul class="codetabs"><li><a href="#code-53-0">WebSocket</a></li><li><a href="#code-53-1">JSON-RPC</a></li><li><a href="#code-53-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-53-0" style="position: static;"><pre><code>{
|
||
"id": 1,
|
||
"status": "success",
|
||
"type": "response",
|
||
"result": {
|
||
"engine_result": "tesSUCCESS",
|
||
"engine_result_code": 0,
|
||
"engine_result_message": "The transaction was applied. Only final in a validated ledger.",
|
||
"tx_blob": "1200002280000000240000016861D4838D7EA4C6800000000000000000000000000055534400000000004B4E9C06F24296074F7BC48F92A97916C6DC5EA9684000000000002710732103AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB7446304402200E5C2DD81FDF0BE9AB2A8D797885ED49E804DBF28E806604D878756410CA98B102203349581946B0DDA06B36B35DBC20EDA27552C1F167BCF5C6ECFF49C6A46F858081144B4E9C06F24296074F7BC48F92A97916C6DC5EA983143E9D4A2B8AA0780F682D136F7A56D6724EF53754",
|
||
"tx_json": {
|
||
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||
"Amount": {
|
||
"currency": "USD",
|
||
"issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||
"value": "1"
|
||
},
|
||
"Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
|
||
"Fee": "10000",
|
||
"Flags": 2147483648,
|
||
"Sequence": 360,
|
||
"SigningPubKey": "03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB",
|
||
"TransactionType": "Payment",
|
||
"TxnSignature": "304402200E5C2DD81FDF0BE9AB2A8D797885ED49E804DBF28E806604D878756410CA98B102203349581946B0DDA06B36B35DBC20EDA27552C1F167BCF5C6ECFF49C6A46F8580",
|
||
"hash": "4D5D90890F8D49519E4151938601EF3D0B30B16CD6A519D9C99102C9FA77F7E0"
|
||
}
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-53-1" style="position: static;"><pre><code>{
|
||
"result": {
|
||
"engine_result": "tesSUCCESS",
|
||
"engine_result_code": 0,
|
||
"engine_result_message": "The transaction was applied. Only final in a validated ledger.",
|
||
"status": "success",
|
||
"tx_blob": "1200002280000000240000016961D4838D7EA4C6800000000000000000000000000055534400000000004B4E9C06F24296074F7BC48F92A97916C6DC5EA9684000000000002710732103AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB74473045022100A7CCD11455E47547FF617D5BFC15D120D9053DFD0536B044F10CA3631CD609E502203B61DEE4AC027C5743A1B56AF568D1E2B8E79BB9E9E14744AC87F38375C3C2F181144B4E9C06F24296074F7BC48F92A97916C6DC5EA983143E9D4A2B8AA0780F682D136F7A56D6724EF53754",
|
||
"tx_json": {
|
||
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||
"Amount": {
|
||
"currency": "USD",
|
||
"issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||
"value": "1"
|
||
},
|
||
"Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
|
||
"Fee": "10000",
|
||
"Flags": 2147483648,
|
||
"Sequence": 361,
|
||
"SigningPubKey": "03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB",
|
||
"TransactionType": "Payment",
|
||
"TxnSignature": "3045022100A7CCD11455E47547FF617D5BFC15D120D9053DFD0536B044F10CA3631CD609E502203B61DEE4AC027C5743A1B56AF568D1E2B8E79BB9E9E14744AC87F38375C3C2F1",
|
||
"hash": "5B31A7518DC304D5327B4887CD1F7DC2C38D5F684170097020C7C9758B973847"
|
||
}
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-53-2" style="position: static;"><pre><code>Loading: "/etc/rippled.cfg"
|
||
Connecting to 127.0.0.1:5005
|
||
{
|
||
"result" : {
|
||
"engine_result" : "tesSUCCESS",
|
||
"engine_result_code" : 0,
|
||
"engine_result_message" : "The transaction was applied. Only final in a validated ledger.",
|
||
"status" : "success",
|
||
"tx_blob" : "1200002280000000240000016A61D4838D7EA4C6800000000000000000000000000055534400000000004B4E9C06F24296074F7BC48F92A97916C6DC5EA9684000000000002710732103AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB74473045022100FBBF74057359EC31C3647AD3B33D8954730E9879C35034374858A76B7CFA643102200EAA08C61071396E9CF0987FBEA16CF113CBD8068AA221214D165F151285EECD81144B4E9C06F24296074F7BC48F92A97916C6DC5EA983143E9D4A2B8AA0780F682D136F7A56D6724EF53754",
|
||
"tx_json" : {
|
||
"Account" : "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||
"Amount" : {
|
||
"currency" : "USD",
|
||
"issuer" : "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||
"value" : "1"
|
||
},
|
||
"Destination" : "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
|
||
"Fee" : "10000",
|
||
"Flags" : 2147483648,
|
||
"Sequence" : 362,
|
||
"SigningPubKey" : "03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB",
|
||
"TransactionType" : "Payment",
|
||
"TxnSignature" : "3045022100FBBF74057359EC31C3647AD3B33D8954730E9879C35034374858A76B7CFA643102200EAA08C61071396E9CF0987FBEA16CF113CBD8068AA221214D165F151285EECD",
|
||
"hash" : "CB98A6FA1FAC47F9FCC6A233EB46F8F9AF59CC69BD69AE6D06F298F6FF52162A"
|
||
}
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>engine_result</td>
|
||
<td>String</td>
|
||
<td>Code indicating the preliminary result of the transaction, for example <code>tesSUCCESS</code></td>
|
||
</tr>
|
||
<tr>
|
||
<td>engine_result_code</td>
|
||
<td>Integer</td>
|
||
<td>Numeric code indicating the preliminary result of the transaction, directly correlated to <code>engine_result</code></td>
|
||
</tr>
|
||
<tr>
|
||
<td>engine_result_message</td>
|
||
<td>String</td>
|
||
<td>Human-readable explanation of the transaction's preliminary result</td>
|
||
</tr>
|
||
<tr>
|
||
<td>tx_blob</td>
|
||
<td>String</td>
|
||
<td>The complete transaction in hex string format</td>
|
||
</tr>
|
||
<tr>
|
||
<td>tx_json</td>
|
||
<td>Object</td>
|
||
<td>The complete transaction in JSON format</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p class="devportal-callout caution"><strong>Caution:</strong> Even if the WebSocket response has <code>"status":"success"</code>, indicating that the command was successfully received, that does <em>not</em> indicate that the transaction executed successfully. Many situations can prevent a transaction from processing successfully, such as a lack of trust lines connecting the two accounts in a payment, or changes in the state of the ledger since the time the transaction was constructed. Even if nothing is wrong, it may take several seconds to close and validate the ledger version that includes the transaction. See the <a href="reference-transaction-format.html#full-transaction-response-list">full list of transaction responses</a> for details, and do not consider the transaction's results final until they appear in a validated ledger version.</p>
|
||
<p class="devportal-callout caution"><strong>Caution:</strong> If this command results in an error messages, the message can contain the secret key from the request. (This is not a problem if the request contained a signed tx_blob instead.) Make sure that these errors are not visible to others.</p>
|
||
<ul>
|
||
<li>Do not write an error including your secret key to a log file that can be seen by multiple people.</li>
|
||
<li>Do not paste an error including your secret key to a public place for debugging.</li>
|
||
<li>Do not display an error message including your secret key on a website, even by accident.</li>
|
||
</ul>
|
||
<h4 id="possible-errors-25">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>invalidTransaction</code> - The transaction is malformed or otherwise invalid.</li>
|
||
<li><code>invalidParams</code> - One or more fields are specified incorrectly, or one or more required fields are missing.</li>
|
||
<li><code>highFee</code> - The <code>fee_mult_max</code> parameter was specified, but the server's current fee multiplier exceeds the specified one. (Sign-and-Submit mode only)</li>
|
||
<li><code>tooBusy</code> - The transaction did not include paths, but the server is too busy to do pathfinding right now. Does not occur if you are connected as an admin. (Sign-and-Submit mode only)</li>
|
||
<li><code>noPath</code> - The transaction did not include paths, and the server was unable to find a path by which this payment can occur. (Sign-and-Submit mode only)</li>
|
||
<li><code>internalTransaction</code> - An internal error occurred when processing the transaction. This could be caused by many aspects of the transaction, including a bad signature or some fields being malformed.</li>
|
||
<li><code>internalSubmit</code> - An internal error occurred when submitting the transaction. This could be caused by many aspects of the transaction, including a bad signature or some fields being malformed.</li>
|
||
<li><code>internalJson</code> - An internal error occurred when serializing the transaction to JSON. This could be caused by many aspects of the transaction, including a bad signature or some fields being malformed.</li>
|
||
</ul>
|
||
<h2 id="submit-multisigned">submit_multisigned</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/release/src/ripple/rpc/handlers/SubmitMultiSigned.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>submit_multisigned</code> command applies a <a href="reference-transaction-format.html#multi-signing">multi-signed</a> transaction and sends it to the network to be included in future ledgers. (You can also submit multi-signed transactions in binary form using the <a href="#submit-only-mode"><code>submit</code> command in submit-only mode</a>.)</p>
|
||
<p>This command requires the <a href="concept-amendments.html#multisign">MultiSign amendment</a> to be enabled. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.31.0">version 0.31.0</a>)</em></p>
|
||
<h4 id="request-format-27">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-54"><ul class="codetabs"><li><a href="#code-54-0">WebSocket</a></li><li><a href="#code-54-1">JSON-RPC</a></li><li><a href="#code-54-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-54-0" style="position: static;"><pre><code>{
|
||
"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"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-54-1" style="position: static;"><pre><code>{
|
||
"method": "submit_multisigned",
|
||
"params": [
|
||
{
|
||
"tx_json": {
|
||
"Account": "rEuLyBCvcw4CFmzv8RepSiAoNgF8tTGJQC",
|
||
"Fee": "30000",
|
||
"Flags": 262144,
|
||
"LimitAmount": {
|
||
"currency": "USD",
|
||
"issuer": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||
"value": "0"
|
||
},
|
||
"Sequence": 4,
|
||
"Signers": [
|
||
{
|
||
"Signer": {
|
||
"Account": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW",
|
||
"SigningPubKey": "02B3EC4E5DD96029A647CFA20DA07FE1F85296505552CCAC114087E66B46BD77DF",
|
||
"TxnSignature": "3045022100CC9C56DF51251CB04BB047E5F3B5EF01A0F4A8A549D7A20A7402BF54BA744064022061EF8EF1BCCBF144F480B32508B1D10FD4271831D5303F920DE41C64671CB5B7"
|
||
}
|
||
},
|
||
{
|
||
"Signer": {
|
||
"Account": "raKEEVSGnKSD9Zyvxu4z6Pqpm4ABH8FS6n",
|
||
"SigningPubKey": "03398A4EDAE8EE009A5879113EAA5BA15C7BB0F612A87F4103E793AC919BD1E3C1",
|
||
"TxnSignature": "3045022100FEE8D8FA2D06CE49E9124567DCA265A21A9F5465F4A9279F075E4CE27E4430DE022042D5305777DA1A7801446780308897699412E4EDF0E1AEFDF3C8A0532BDE4D08"
|
||
}
|
||
}
|
||
],
|
||
"SigningPubKey": "",
|
||
"TransactionType": "TrustSet",
|
||
"hash": "81A477E2A362D171BB16BE17B4120D9F809A327FA00242ABCA867283BEA2F4F8"
|
||
}
|
||
}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-54-2" style="position: static;"><pre><code>#Syntax: submit_multisigned <tx_json>
|
||
rippled submit_multisigned '{
|
||
"Account": "rEuLyBCvcw4CFmzv8RepSiAoNgF8tTGJQC",
|
||
"Fee": "30000",
|
||
"Flags": 262144,
|
||
"LimitAmount": {
|
||
"currency": "USD",
|
||
"issuer": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||
"value": "0"
|
||
},
|
||
"Sequence": 4,
|
||
"Signers": [
|
||
{
|
||
"Signer": {
|
||
"Account": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW",
|
||
"SigningPubKey": "02B3EC4E5DD96029A647CFA20DA07FE1F85296505552CCAC114087E66B46BD77DF",
|
||
"TxnSignature": "3045022100CC9C56DF51251CB04BB047E5F3B5EF01A0F4A8A549D7A20A7402BF54BA744064022061EF8EF1BCCBF144F480B32508B1D10FD4271831D5303F920DE41C64671CB5B7"
|
||
}
|
||
},
|
||
{
|
||
"Signer": {
|
||
"Account": "raKEEVSGnKSD9Zyvxu4z6Pqpm4ABH8FS6n",
|
||
"SigningPubKey": "03398A4EDAE8EE009A5879113EAA5BA15C7BB0F612A87F4103E793AC919BD1E3C1",
|
||
"TxnSignature": "3045022100FEE8D8FA2D06CE49E9124567DCA265A21A9F5465F4A9279F075E4CE27E4430DE022042D5305777DA1A7801446780308897699412E4EDF0E1AEFDF3C8A0532BDE4D08"
|
||
}
|
||
}
|
||
],
|
||
"SigningPubKey": "",
|
||
"TransactionType": "TrustSet",
|
||
"hash": "81A477E2A362D171BB16BE17B4120D9F809A327FA00242ABCA867283BEA2F4F8"
|
||
}'
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The request includes the following parameters:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>tx_json</td>
|
||
<td>Object</td>
|
||
<td><a href="reference-transaction-format.html">Transaction in JSON format</a> with an array of <code>Signers</code>. To be successful, the weights of the signatures must be equal or higher than the quorum of the <a href="reference-ledger-format.html#signerlist">SignerList</a>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>fail_hard</td>
|
||
<td>Boolean</td>
|
||
<td>(Optional, defaults to false) If true, and the transaction fails locally, do not retry or relay the transaction to other servers.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="response-format-26">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-55"><ul class="codetabs"><li><a href="#code-55-0">WebSocket</a></li><li><a href="#code-55-1">JSON-RPC</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-55-0" style="position: static;"><pre><code>{
|
||
"id": "submit_multisigned_example",
|
||
"status": "success",
|
||
"type": "response",
|
||
"result": {
|
||
"engine_result": "tesSUCCESS",
|
||
"engine_result_code": 0,
|
||
"engine_result_message": "The transaction was applied. Only final in a validated ledger.",
|
||
"tx_blob": "1200142200040000240000000263D5038D7EA4C680000000000000000000000000005553440000000000B5F762798A53D543A014CAF8B297CFF8F2F937E868400000000000753073008114A3780F5CB5A44D366520FC44055E8ED44D9A2270F3E010732102B3EC4E5DD96029A647CFA20DA07FE1F85296505552CCAC114087E66B46BD77DF744730450221009C195DBBF7967E223D8626CA19CF02073667F2B22E206727BFE848FF42BEAC8A022048C323B0BED19A988BDBEFA974B6DE8AA9DCAE250AA82BBD1221787032A864E58114204288D2E47F8EF6C99BCC457966320D12409711E1E0107321028FFB276505F9AC3F57E8D5242B386A597EF6C40A7999F37F1948636FD484E25B744630440220680BBD745004E9CFB6B13A137F505FB92298AD309071D16C7B982825188FD1AE022004200B1F7E4A6A84BB0E4FC09E1E3BA2B66EBD32F0E6D121A34BA3B04AD99BC181147908A7F0EDD48EA896C3580A399F0EE78611C8E3E1F1",
|
||
"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"
|
||
}
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-55-1" style="position: static;"><pre><code>200 OK
|
||
{
|
||
"result": {
|
||
"engine_result": "tesSUCCESS",
|
||
"engine_result_code": 0,
|
||
"engine_result_message": "The transaction was applied. Only final in a validated ledger.",
|
||
"status": "success",
|
||
"tx_blob": "120014220004000024000000046380000000000000000000000000000000000000005553440000000000B5F762798A53D543A014CAF8B297CFF8F2F937E868400000000000753073008114A3780F5CB5A44D366520FC44055E8ED44D9A2270F3E010732102B3EC4E5DD96029A647CFA20DA07FE1F85296505552CCAC114087E66B46BD77DF74473045022100CC9C56DF51251CB04BB047E5F3B5EF01A0F4A8A549D7A20A7402BF54BA744064022061EF8EF1BCCBF144F480B32508B1D10FD4271831D5303F920DE41C64671CB5B78114204288D2E47F8EF6C99BCC457966320D12409711E1E010732103398A4EDAE8EE009A5879113EAA5BA15C7BB0F612A87F4103E793AC919BD1E3C174473045022100FEE8D8FA2D06CE49E9124567DCA265A21A9F5465F4A9279F075E4CE27E4430DE022042D5305777DA1A7801446780308897699412E4EDF0E1AEFDF3C8A0532BDE4D0881143A4C02EA95AD6AC3BED92FA036E0BBFB712C030CE1F1",
|
||
"tx_json": {
|
||
"Account": "rEuLyBCvcw4CFmzv8RepSiAoNgF8tTGJQC",
|
||
"Fee": "30000",
|
||
"Flags": 262144,
|
||
"LimitAmount": {
|
||
"currency": "USD",
|
||
"issuer": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||
"value": "0"
|
||
},
|
||
"Sequence": 4,
|
||
"Signers": [
|
||
{
|
||
"Signer": {
|
||
"Account": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW",
|
||
"SigningPubKey": "02B3EC4E5DD96029A647CFA20DA07FE1F85296505552CCAC114087E66B46BD77DF",
|
||
"TxnSignature": "3045022100CC9C56DF51251CB04BB047E5F3B5EF01A0F4A8A549D7A20A7402BF54BA744064022061EF8EF1BCCBF144F480B32508B1D10FD4271831D5303F920DE41C64671CB5B7"
|
||
}
|
||
},
|
||
{
|
||
"Signer": {
|
||
"Account": "raKEEVSGnKSD9Zyvxu4z6Pqpm4ABH8FS6n",
|
||
"SigningPubKey": "03398A4EDAE8EE009A5879113EAA5BA15C7BB0F612A87F4103E793AC919BD1E3C1",
|
||
"TxnSignature": "3045022100FEE8D8FA2D06CE49E9124567DCA265A21A9F5465F4A9279F075E4CE27E4430DE022042D5305777DA1A7801446780308897699412E4EDF0E1AEFDF3C8A0532BDE4D08"
|
||
}
|
||
}
|
||
],
|
||
"SigningPubKey": "",
|
||
"TransactionType": "TrustSet",
|
||
"hash": "81A477E2A362D171BB16BE17B4120D9F809A327FA00242ABCA867283BEA2F4F8"
|
||
}
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>engine_result</td>
|
||
<td>String</td>
|
||
<td>Code indicating the preliminary result of the transaction, for example <code>tesSUCCESS</code></td>
|
||
</tr>
|
||
<tr>
|
||
<td>engine_result_code</td>
|
||
<td>Integer</td>
|
||
<td>Numeric code indicating the preliminary result of the transaction, directly correlated to <code>engine_result</code></td>
|
||
</tr>
|
||
<tr>
|
||
<td>engine_result_message</td>
|
||
<td>String</td>
|
||
<td>Human-readable explanation of the preliminary transaction result</td>
|
||
</tr>
|
||
<tr>
|
||
<td>tx_blob</td>
|
||
<td>String</td>
|
||
<td>The complete <a href="reference-transaction-format.html">transaction</a> in hex string format</td>
|
||
</tr>
|
||
<tr>
|
||
<td>tx_json</td>
|
||
<td>Object</td>
|
||
<td>The complete <a href="reference-transaction-format.html">transaction</a> in JSON format</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="possible-errors-26">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>invalidParams</code> - One or more fields are specified incorrectly, or one or more required fields are missing.</li>
|
||
<li><code>srcActMalformed</code> - The <code>Account</code> field from the <code>tx_json</code> was invalid or missing.</li>
|
||
<li><code>internal</code> - An internal error occurred. This includes the case where a signature is not valid for the transaction JSON provided.</li>
|
||
</ul>
|
||
<h2 id="book-offers">book_offers</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/develop/src/ripple/rpc/handlers/BookOffers.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>book_offers</code> method retrieves a list of offers, also known as the <a href="http://www.investopedia.com/terms/o/order-book.asp">order book</a>, between two currencies. If the results are very large, a partial result is returned with a marker so that later requests can resume from where the previous one left off.</p>
|
||
<h4 id="request-format-28">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-56"><ul class="codetabs"><li><a href="#code-56-0">WebSocket</a></li><li><a href="#code-56-1">JSON-RPC</a></li><li><a href="#code-56-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-56-0" style="position: static;"><pre><code>{
|
||
"id": 4,
|
||
"command": "book_offers",
|
||
"taker": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"taker_gets": {
|
||
"currency": "XRP"
|
||
},
|
||
"taker_pays": {
|
||
"currency": "USD",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
|
||
},
|
||
"limit": 10
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-56-1" style="position: static;"><pre><code>{
|
||
"method": "book_offers",
|
||
"params": [
|
||
{
|
||
"taker": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||
"taker_gets": {
|
||
"currency": "XRP"
|
||
},
|
||
"taker_pays": {
|
||
"currency": "USD",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
},
|
||
"limit": 10
|
||
}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-56-2" style="position: static;"><pre><code>#Syntax: book_offers taker_pays taker_gets [taker [ledger [limit] ] ]
|
||
rippled book_offers 'USD/rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B' 'EUR/rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B'
|
||
</code></pre></div>
|
||
</div>
|
||
<p><a class="button" href="ripple-api-tool.html#book_offers">Try it! ></a></p>
|
||
<p>The request includes the following parameters:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>ledger_hash</td>
|
||
<td>String</td>
|
||
<td>(Optional) A 20-byte hex string for the ledger version to use. (See <a href="#specifying-ledgers">Specifying a Ledger</a>)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>String or Unsigned Integer</td>
|
||
<td>(Optional) The sequence number of the ledger to use, or a shortcut string to choose a ledger automatically. (See <a href="#specifying-ledgers">Specifying a Ledger</a>)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>limit</td>
|
||
<td>Unsigned Integer</td>
|
||
<td>(Optional) If provided, the server does not provide more than this many offers in the results. The total number of results returned may be fewer than the limit, because the server omits unfunded offers.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>taker</td>
|
||
<td>String</td>
|
||
<td>(Optional, defaults to [ACCOUNT_ONE][]) The <a href="#addresses">Address</a> of an account to use as a perspective. (This affects which unfunded offers are returned.)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>taker_gets</td>
|
||
<td>Object</td>
|
||
<td>Specification of which currency the account taking the offer would receive, as an object with <code>currency</code> and <code>issuer</code> fields (omit issuer for XRP), like <a href="#specifying-currency-amounts">currency amounts</a>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>taker_pays</td>
|
||
<td>Object</td>
|
||
<td>Specification of which currency the account taking the offer would pay, as an object with <code>currency</code> and <code>issuer</code> fields (omit issuer for XRP), like <a href="#specifying-currency-amounts">currency amounts</a>.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>Normally, offers that are not funded are omitted; however, offers made by the specified <code>taker</code> account are always displayed. This allows you to look up your own unfunded offers to cancel them with an OfferCancel transaction.</p>
|
||
<h4 id="response-format-27">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-57"><ul class="codetabs"><li><a href="#code-57-0">WebSocket</a></li><li><a href="#code-57-1">JSON-RPC</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-57-0" style="position: static;"><pre><code>{
|
||
"id": 11,
|
||
"status": "success",
|
||
"type": "response",
|
||
"result": {
|
||
"ledger_current_index": 7035305,
|
||
"offers": [
|
||
{
|
||
"Account": "rM3X3QSr8icjTGpaF52dozhbT2BZSXJQYM",
|
||
"BookDirectory": "7E5F614417C2D0A7CEFEB73C4AA773ED5B078DE2B5771F6D55055E4C405218EB",
|
||
"BookNode": "0000000000000000",
|
||
"Flags": 0,
|
||
"LedgerEntryType": "Offer",
|
||
"OwnerNode": "0000000000000AE0",
|
||
"PreviousTxnID": "6956221794397C25A53647182E5C78A439766D600724074C99D78982E37599F1",
|
||
"PreviousTxnLgrSeq": 7022646,
|
||
"Sequence": 264542,
|
||
"TakerGets": {
|
||
"currency": "EUR",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"value": "17.90363633316433"
|
||
},
|
||
"TakerPays": {
|
||
"currency": "USD",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"value": "27.05340557506234"
|
||
},
|
||
"index": "96A9104BF3137131FF8310B9174F3B37170E2144C813CA2A1695DF2C5677E811",
|
||
"quality": "1.511056473200875"
|
||
},
|
||
{
|
||
"Account": "rhsxKNyN99q6vyYCTHNTC1TqWCeHr7PNgp",
|
||
"BookDirectory": "7E5F614417C2D0A7CEFEB73C4AA773ED5B078DE2B5771F6D5505DCAA8FE12000",
|
||
"BookNode": "0000000000000000",
|
||
"Flags": 131072,
|
||
"LedgerEntryType": "Offer",
|
||
"OwnerNode": "0000000000000001",
|
||
"PreviousTxnID": "8AD748CD489F7FF34FCD4FB73F77F1901E27A6EFA52CCBB0CCDAAB934E5E754D",
|
||
"PreviousTxnLgrSeq": 7007546,
|
||
"Sequence": 265,
|
||
"TakerGets": {
|
||
"currency": "EUR",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"value": "2.542743233917848"
|
||
},
|
||
"TakerPays": {
|
||
"currency": "USD",
|
||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||
"value": "4.19552633596446"
|
||
},
|
||
"index": "7001797678E886E22D6DE11AF90DF1E08F4ADC21D763FAFB36AF66894D695235",
|
||
"quality": "1.65"
|
||
}
|
||
]
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-57-1" style="position: static;"><pre><code>200 OK
|
||
{
|
||
"result": {
|
||
"ledger_current_index": 8696243,
|
||
"offers": [],
|
||
"status": "success",
|
||
"validated": false
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>ledger_current_index</td>
|
||
<td>Integer</td>
|
||
<td>(Omitted if ledger version provided) Sequence number of the ledger version used when retrieving this data.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>Integer</td>
|
||
<td>(Omitted if ledger_current_index provided instead) Sequence number, provided in the request, of the ledger version that was used when retrieving this data.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_hash</td>
|
||
<td>String</td>
|
||
<td>(May be omitted) Hex hash, provided in the request, of the ledger version that was used when retrieving this data.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>offers</td>
|
||
<td>Array</td>
|
||
<td>Array of offer objects, each of which has the fields of an <a href="reference-transaction-format.html#offercreate">OfferCreate transaction</a></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>In addition to the standard Offer fields, the following fields may be included in members of the <code>offers</code> array:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>taker_gets_funded</td>
|
||
<td>String (XRP) or Object (non-XRP)</td>
|
||
<td>(Only included in partially-funded offers) The maximum amount of currency that the taker can get, given the funding status of the offer.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>taker_pays_funded</td>
|
||
<td>String (XRP) or Object (non-XRP)</td>
|
||
<td>(Only included in partially-funded offers) The maximum amount of currency that the taker would pay, given the funding status of the offer.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>quality</td>
|
||
<td>Number</td>
|
||
<td>The exchange rate, as the ratio <code>taker_pays</code> divided by <code>taker_gets</code>. For fairness, offers that have the same quality are automatically taken first-in, first-out. (In other words, if multiple people offer to exchange currency at the same rate, the oldest offer is taken first.)</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="possible-errors-27">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>invalidParams</code> - One or more fields are specified incorrectly, or one or more required fields are missing.</li>
|
||
<li><code>lgrNotFound</code> - The ledger specified by the <code>ledger_hash</code> or <code>ledger_index</code> does not exist, or it does exist but the server does not have it.</li>
|
||
<li><code>srcCurMalformed</code> - The <code>taker_pays</code> field in the request is not formatted properly.</li>
|
||
<li><code>dstAmtMalformed</code> - The <code>taker_gets</code> field in the request is not formatted properly.</li>
|
||
<li><code>srcIsrMalformed</code> - The <code>issuer</code> field of the <code>taker_pays</code> field in the request is not valid.</li>
|
||
<li><code>dstIsrMalformed</code> - The <code>issuer</code> field of the <code>taker_gets</code> field in the request is not valid.</li>
|
||
<li><code>badMarket</code> - The desired order book does not exist; for example, offers to exchange a currency for itself.</li>
|
||
</ul>
|
||
<h1 id="subscriptions">Subscriptions</h1>
|
||
<p>Using subscriptions, you can have the server push updates to your client when various events happen, so that you can know and react right away. Subscriptions are only supported in the WebSocket API, where you can receive additional responses in the same channel.</p>
|
||
<p>JSON-RPC support for subscription callbacks is deprecated and may not work as expected.</p>
|
||
<h2 id="subscribe">subscribe</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/Subscribe.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>subscribe</code> method requests periodic notifications from the server when certain events happen.</p>
|
||
<h4 id="request-format-29">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-58"><ul class="codetabs"><li><a href="#code-58-0">Subscribe to accounts</a></li><li><a href="#code-58-1">Subscribe to order book</a></li><li><a href="#code-58-2">Subscribe to ledger stream</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-58-0" style="position: static;"><pre><code>{
|
||
"id": "Example watch Bitstamp's hot wallet",
|
||
"command": "subscribe",
|
||
"accounts": ["rrpNnNLKrartuEqfJGpqyDwPj1AFPg9vn1"]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-58-1" style="position: static;"><pre><code>{
|
||
"id": "Example subscribe to XRP/GateHub USD order book",
|
||
"command": "subscribe",
|
||
"books": [
|
||
{
|
||
"taker_pays": {
|
||
"currency": "XRP"
|
||
},
|
||
"taker_gets": {
|
||
"currency": "USD",
|
||
"issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq"
|
||
},
|
||
"snapshot": true
|
||
}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-58-2" style="position: static;"><pre><code>{
|
||
"id": "Example watch for new validated ledgers",
|
||
"command": "subscribe",
|
||
"streams": ["ledger"]
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p><a class="button" href="ripple-api-tool.html#subscribe">Try it! ></a></p>
|
||
<p>The request includes the following parameters:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>streams</td>
|
||
<td>Array</td>
|
||
<td>(Optional) Array of string names of generic streams to subscribe to, as explained below</td>
|
||
</tr>
|
||
<tr>
|
||
<td>accounts</td>
|
||
<td>Array</td>
|
||
<td>(Optional) Array with the unique base-58 addresses of accounts to monitor for validated transactions. The server sends a notification for any transaction that affects at least one of these accounts.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>accounts_proposed</td>
|
||
<td>Array</td>
|
||
<td>(Optional) Like <code>accounts</code>, but include transactions that are not yet finalized.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>books</td>
|
||
<td>Array</td>
|
||
<td>(Optional) Array of objects defining <a href="http://www.investopedia.com/terms/o/order-book.asp">order books</a> to monitor for updates, as detailed below.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>url</td>
|
||
<td>String</td>
|
||
<td>(Optional for Websocket; Required otherwise) URL where the server sends a JSON-RPC callbacks for each event. <em>Admin-only.</em></td>
|
||
</tr>
|
||
<tr>
|
||
<td>url_username</td>
|
||
<td>String</td>
|
||
<td>(Optional) Username to provide for basic authentication at the callback URL.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>url_password</td>
|
||
<td>String</td>
|
||
<td>(Optional) Password to provide for basic authentication at the callback URL.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>The following parameters are deprecated and may be removed without further notice: <code>user</code>, <code>password</code>, <code>rt_accounts</code>.</p>
|
||
<p>The <code>streams</code> parameter provides access to the following default streams of information:</p>
|
||
<ul>
|
||
<li><code>server</code> - Sends a message whenever the status of the <code>rippled</code> server (for example, network connectivity) changes</li>
|
||
<li><code>ledger</code> - Sends a message whenever the consensus process declares a new validated ledger</li>
|
||
<li><code>transactions</code> - Sends a message whenever a transaction is included in a closed ledger</li>
|
||
<li><code>transactions_proposed</code> - Sends a message whenever a transaction is included in a closed ledger, as well as some transactions that have not yet been included in a validated ledger and may never be. Not all proposed transactions appear before validation.
|
||
<strong>Note:</strong> <a href="reference-transaction-format.html#result-categories">Even some transactions that don't succeed are included</a> in validated ledgers, because they take the anti-spam transaction fee.</li>
|
||
<li><code>validations</code> - Sends a message whenever the server receives a validation message from a server it trusts. (An individual <code>rippled</code> declares a ledger validated when the server receives validation messages from at least a quorum of trusted validators.)</li>
|
||
<li><code>peer_status</code> - <strong>(Admin only)</strong> Information about connected peer <code>rippled</code> servers, especially with regards to the consensus process.</li>
|
||
</ul>
|
||
<p>Each member of the <code>books</code> array, if provided, is an object with the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>taker_gets</td>
|
||
<td>Object</td>
|
||
<td>Specification of which currency the account taking the offer would receive, as a <a href="#specifying-currencies-without-amounts">currency object with no amount</a>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>taker_pays</td>
|
||
<td>Object</td>
|
||
<td>Specification of which currency the account taking the offer would pay, as a <a href="#specifying-currencies-without-amounts">currency object with no amount</a>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>taker</td>
|
||
<td>String</td>
|
||
<td>Unique base-58 account address to use as a perspective for viewing offers. (This affects the funding status and fees of offers.)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>snapshot</td>
|
||
<td>Boolean</td>
|
||
<td>(Optional, defaults to false) If true, return the current state of the order book once when you subscribe before sending updates</td>
|
||
</tr>
|
||
<tr>
|
||
<td>both</td>
|
||
<td>Boolean</td>
|
||
<td>(Optional, defaults to false) If true, return both sides of the order book.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="response-format-28">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-59"><ul class="codetabs"><li><a href="#code-59-0">WebSocket</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-59-0" style="position: static;"><pre><code>{
|
||
"id": "Example watch Bitstamp's hot wallet",
|
||
"status": "success",
|
||
"type": "response",
|
||
"result": {}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>. The fields contained in the response vary depending on what subscriptions were included in the request.</p>
|
||
<ul>
|
||
<li><code>accounts</code> and <code>accounts_proposed</code> - No fields returned</li>
|
||
<li><em>Stream: server</em> - Information about the server status, such as <code>load_base</code> (the current load level of the server), <code>random</code> (a randomly-generated value), and others, subject to change.</li>
|
||
<li><em>Stream: transactions</em>, <em>Stream: transactions_proposed</em>, and <em>Stream: validations</em> - No fields returned</li>
|
||
<li><em>Stream: ledger</em> - Information about the ledgers on hand and current fee schedule, such as <code>fee_base</code> (current base fee for transactions in XRP), <code>fee_ref</code> (current base fee for transactions in fee units), <code>ledger_hash</code> (hash of the latest validated ledger), <code>reserve_base</code> (minimum reserve for accounts), and more.</li>
|
||
<li><code>books</code> - No fields returned by default. If <code>"snapshot": true</code> is set in the request, returns <code>offers</code> (an array of offer definition objects defining the order book)</li>
|
||
</ul>
|
||
<h4 id="possible-errors-28">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>invalidParams</code> - One or more fields are specified incorrectly, or one or more required fields are missing.</li>
|
||
<li><code>noPermission</code> - The request included the <code>url</code> field, but you are not connected as an admin.</li>
|
||
<li><code>unknownStream</code> - One or more the members of the <code>streams</code> field in the request was not recognized as a valid stream name.</li>
|
||
<li><code>malformedStream</code> - The <code>streams</code> field of the request was not formatted properly.</li>
|
||
<li><code>malformedAccount</code> - One of the addresses in the <code>accounts</code> or <code>accounts_proposed</code> fields of the request is not a properly-formatted Ripple address. (<strong>Note:</strong>: You <em>can</em> subscribe to the stream of an address that does not yet have an entry in the global ledger to get a message when that address becomes funded.)</li>
|
||
<li><code>srcCurMalformed</code> - One or more <code>taker_pays</code> sub-fields of the <code>books</code> field in the request is not formatted properly.</li>
|
||
<li><code>dstAmtMalformed</code> - One or more <code>taker_gets</code> sub-fields of the <code>books</code> field in the request is not formatted properly.</li>
|
||
<li><code>srcIsrMalformed</code> - The <code>issuer</code> field of one or more <code>taker_pays</code> sub-fields of the <code>books</code> field in the request is not valid.</li>
|
||
<li><code>dstIsrMalformed</code> - The <code>issuer</code> field of one or more <code>taker_gets</code> sub-fields of the <code>books</code> field in the request is not valid.</li>
|
||
<li><code>badMarket</code> - One or more desired order books in the <code>books</code> field does not exist; for example, offers to exchange a currency for itself.</li>
|
||
</ul>
|
||
<p>When you subscribe to a particular stream, you receive periodic responses on that stream until you unsubscribe or close the WebSocket connection. The content of those responses depends on what you subscribed to. Here are some examples:</p>
|
||
<h3 id="ledger-stream">Ledger Stream</h3>
|
||
<p>The <code>ledger</code> stream only sends <code>ledgerClosed</code> messages when <a href="https://ripple.com/knowledge_center/the-ripple-ledger-consensus-process/">the consensus process</a> declares a new validated ledger. The message identifies the ledger and provides some information about its contents.</p>
|
||
<pre><code>{
|
||
"type": "ledgerClosed",
|
||
"fee_base": 10,
|
||
"fee_ref": 10,
|
||
"ledger_hash": "687F604EF6B2F67319E8DCC8C66EF49D84D18A1E18F948421FC24D2C7C3DB464",
|
||
"ledger_index": 7125358,
|
||
"ledger_time": 455751310,
|
||
"reserve_base": 20000000,
|
||
"reserve_inc": 5000000,
|
||
"txn_count": 7,
|
||
"validated_ledgers": "32570-7125358"
|
||
}
|
||
</code></pre>
|
||
<p>The fields from a ledger stream message are as follows:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>type</td>
|
||
<td>String</td>
|
||
<td><code>ledgerClosed</code> indicates this is from the ledger stream</td>
|
||
</tr>
|
||
<tr>
|
||
<td>fee_base</td>
|
||
<td>Unsigned Integer</td>
|
||
<td>Cost of the 'reference transaction' in drops of XRP. (See <a href="concept-transaction-cost.html">Transaction Cost</a> If the ledger includes a <a href="reference-transaction-format.html#setfee">SetFee pseudo-transaction</a> the new transaction cost applies to all transactions after this ledger.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>fee_ref</td>
|
||
<td>Unsigned Integer</td>
|
||
<td>Cost of the 'reference transaction' in 'fee units'.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_hash</td>
|
||
<td>String</td>
|
||
<td>Unique hash of the ledger that was closed, as hex</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>Unsigned Integer</td>
|
||
<td>Sequence number of the ledger that was closed</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_time</td>
|
||
<td>Unsigned Integer</td>
|
||
<td>The time this ledger was closed, in seconds since the <a href="#specifying-time">Ripple Epoch</a></td>
|
||
</tr>
|
||
<tr>
|
||
<td>reserve_base</td>
|
||
<td>Unsigned Integer</td>
|
||
<td>The minimum reserve, in drops of XRP, that is required for an account. If the ledger includes a <a href="reference-transaction-format.html#setfee">SetFee pseudo-transaction</a> the new base reserve applies after this ledger.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>reserve_inc</td>
|
||
<td>Unsigned Integer</td>
|
||
<td>The increase in account reserve that is added for each item the account owns, such as offers or trust lines. If the ledger includes a <a href="reference-transaction-format.html#setfee">SetFee pseudo-transaction</a> the new owner reserve applies after this ledger.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>txn_count</td>
|
||
<td>Unsigned Integer</td>
|
||
<td>Number of new transactions included in this ledger</td>
|
||
</tr>
|
||
<tr>
|
||
<td>validated_ledgers</td>
|
||
<td>String</td>
|
||
<td>(May be omitted) Range of ledgers that the server has available. This may be discontiguous. This field is not returned if the server is not connected to the network, or if it is connected but has not yet obtained a ledger from the network.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h3 id="validations-stream">Validations Stream</h3>
|
||
<p><em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.29.0">version 0.29.0</a>)</em></p>
|
||
<p>The validations stream sends messages whenever it receives validation messages, also called validation votes, from validators it trusts. The message looks like the following:</p>
|
||
<pre><code>{
|
||
"type": "validationReceived",
|
||
"ledger_hash": "8F77146B9DFE3E48213677DA0826839DFA3666228322684DF5D775A8A4F76401",
|
||
"ledger_index": "20504721",
|
||
"signature": "3045022100DFFE4A50B4BD3BD33C280E3DEC9897413C299036531F3156FFDEEDED9E47005702202725D2DDF8F7F8E7C0D89787C0291D3CBE5FE3BF66503FC3AE77ADE15A78B0D9",
|
||
"validation_public_key": "n9LDGC4SaEgtVXSjFNKHh6BPSUAuccZ8uKdEAoQUDQ1x2jqunEXr"
|
||
}
|
||
</code></pre>
|
||
<p>The fields from a validations stream message are as follows:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>type</td>
|
||
<td>String</td>
|
||
<td><code>validationReceived</code> indicates this is from the validations stream</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_hash</td>
|
||
<td>String</td>
|
||
<td>The identifying hash of the proposed ledger is being validated.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>String - Integer</td>
|
||
<td>The <a href="#ledger-index">Ledger Index</a> of the proposed ledger. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.31.0">version 0.31.0</a>)</em></td>
|
||
</tr>
|
||
<tr>
|
||
<td>signature</td>
|
||
<td>String</td>
|
||
<td>The signature that the validator used to sign its vote for this ledger.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>validation_public_key</td>
|
||
<td>String</td>
|
||
<td>The base-58 encoded public key from the key-pair that the validator used to sign the message. This identifies the validator sending the message and can also be used to verify the <code>signature</code>.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h3 id="transaction-streams">Transaction Streams</h3>
|
||
<p>Many subscriptions result in messages about transactions, including the following:</p>
|
||
<ul>
|
||
<li>The <code>transactions</code> stream</li>
|
||
<li>The <code>transactions_proposed</code> stream</li>
|
||
<li><code>accounts</code> subscriptions</li>
|
||
<li><code>accounts_proposed</code> subscriptions</li>
|
||
<li><code>book</code> (Order Book) subscriptions</li>
|
||
</ul>
|
||
<p>The <code>transactions_proposed</code> stream, strictly speaking, is a superset of the <code>transactions</code> stream: it includes all validated transactions, as well as some suggested transactions that have not yet been included in a validated ledger and may never be. You can identify these "in-flight" transactions by their fields:</p>
|
||
<ul>
|
||
<li>The <code>validated</code> field is missing or has a value of <code>false</code>.</li>
|
||
<li>There is no <code>meta</code> or <code>metadata</code> field.</li>
|
||
<li>Instead of <code>ledger_hash</code> and <code>ledger_index</code> fields specifying in which ledger version the transactions were finalized, there is a <code>ledger_current_index</code> field specifying in which ledger version they are currently proposed.</li>
|
||
</ul>
|
||
<p>Otherwise, the messages from the <code>transactions_proposed</code> stream are the same as ones from the <code>transactions</code> stream.</p>
|
||
<p>Since the only thing that can modify an account or an order book is a transaction, the messages that are sent as a result of subscribing to particular <code>accounts</code> or <code>books</code> also take the form of transaction messages, the same as the ones in the <code>transactions</code> stream. The only difference is that you only receive messages for transactions that affect the accounts or order books you're watching.</p>
|
||
<p>The <code>accounts_proposed</code> subscription works the same way, except it also includes unconfirmed transactions, like the <code>transactions_proposed</code> stream, for the accounts you're watching.</p>
|
||
<pre><code>{
|
||
"status": "closed",
|
||
"type": "transaction",
|
||
"engine_result": "tesSUCCESS",
|
||
"engine_result_code": 0,
|
||
"engine_result_message": "The transaction was applied.",
|
||
"ledger_hash": "989AFBFD65D820C6BD85301B740F5D592F060668A90EEF5EC1815EBA27D58FE8",
|
||
"ledger_index": 7125442,
|
||
"meta": {
|
||
"AffectedNodes": [
|
||
{
|
||
"ModifiedNode": {
|
||
"FinalFields": {
|
||
"Flags": 0,
|
||
"IndexPrevious": "0000000000000000",
|
||
"Owner": "rRh634Y6QtoqkwTTrGzX66UYoCAvgE6jL",
|
||
"RootIndex": "ABD8CE2D1205D0C062876E9E1F3CBDC902ED8EF4E8D3D071B962C7ED0E113E68"
|
||
},
|
||
"LedgerEntryType": "DirectoryNode",
|
||
"LedgerIndex": "0BBDEE7D0BE120F7BF27640B5245EBFE0C5FD5281988BA823C44477A70262A4D"
|
||
}
|
||
},
|
||
{
|
||
"DeletedNode": {
|
||
"FinalFields": {
|
||
"Account": "rRh634Y6QtoqkwTTrGzX66UYoCAvgE6jL",
|
||
"BookDirectory": "892E892DC63D8F70DCF5C9ECF29394FF7DD3DC6F47DB8EB34A03920BFC5E99BE",
|
||
"BookNode": "0000000000000000",
|
||
"Flags": 0,
|
||
"OwnerNode": "000000000000006E",
|
||
"PreviousTxnID": "58A17D95770F8D07E08B81A85896F4032A328B6C2BDCDEC0A00F3EF3914DCF0A",
|
||
"PreviousTxnLgrSeq": 7125330,
|
||
"Sequence": 540691,
|
||
"TakerGets": "4401967683",
|
||
"TakerPays": {
|
||
"currency": "BTC",
|
||
"issuer": "rNPRNzBB92BVpAhhZr4iXDTveCgV5Pofm9",
|
||
"value": "0.04424"
|
||
}
|
||
},
|
||
"LedgerEntryType": "Offer",
|
||
"LedgerIndex": "386B7803A9210747941B0D079BB408F31ACB1CB98832184D0287A1CBF4FE6D00"
|
||
}
|
||
},
|
||
{
|
||
"DeletedNode": {
|
||
"FinalFields": {
|
||
"ExchangeRate": "4A03920BFC5E99BE",
|
||
"Flags": 0,
|
||
"RootIndex": "892E892DC63D8F70DCF5C9ECF29394FF7DD3DC6F47DB8EB34A03920BFC5E99BE",
|
||
"TakerGetsCurrency": "0000000000000000000000000000000000000000",
|
||
"TakerGetsIssuer": "0000000000000000000000000000000000000000",
|
||
"TakerPaysCurrency": "0000000000000000000000004254430000000000",
|
||
"TakerPaysIssuer": "92D705968936C419CE614BF264B5EEB1CEA47FF4"
|
||
},
|
||
"LedgerEntryType": "DirectoryNode",
|
||
"LedgerIndex": "892E892DC63D8F70DCF5C9ECF29394FF7DD3DC6F47DB8EB34A03920BFC5E99BE"
|
||
}
|
||
},
|
||
{
|
||
"ModifiedNode": {
|
||
"FinalFields": {
|
||
"Account": "rRh634Y6QtoqkwTTrGzX66UYoCAvgE6jL",
|
||
"Balance": "11133297300",
|
||
"Flags": 0,
|
||
"OwnerCount": 9,
|
||
"Sequence": 540706
|
||
},
|
||
"LedgerEntryType": "AccountRoot",
|
||
"LedgerIndex": "A6C2532E1008A513B3F822A92B8E5214BD0D413DC20AD3631C1A39AD6B36CD07",
|
||
"PreviousFields": {
|
||
"Balance": "11133297310",
|
||
"OwnerCount": 10,
|
||
"Sequence": 540705
|
||
},
|
||
"PreviousTxnID": "484D57DFC4E446DA83B4540305F0CE836D4E007361542EC12CC0FFB5F0A1BE3A",
|
||
"PreviousTxnLgrSeq": 7125358
|
||
}
|
||
}
|
||
],
|
||
"TransactionIndex": 1,
|
||
"TransactionResult": "tesSUCCESS"
|
||
},
|
||
"transaction": {
|
||
"Account": "rRh634Y6QtoqkwTTrGzX66UYoCAvgE6jL",
|
||
"Fee": "10",
|
||
"Flags": 2147483648,
|
||
"OfferSequence": 540691,
|
||
"Sequence": 540705,
|
||
"SigningPubKey": "030BB49C591C9CD65C945D4B78332F27633D7771E6CF4D4B942D26BA40748BB8B4",
|
||
"TransactionType": "OfferCancel",
|
||
"TxnSignature": "30450221008223604A383F3AED25D53CE7C874700619893A6EEE4336508312217850A9722302205E0614366E174F2DFF78B879F310DB0B3F6DA1967E52A32F65E25DCEC622CD68",
|
||
"date": 455751680,
|
||
"hash": "94CF924C774DFDBE474A2A7E40AEA70E7E15D130C8CBEF8AF1D2BE97A8269F14"
|
||
},
|
||
"validated": true
|
||
}
|
||
</code></pre>
|
||
<p>Transaction stream messages have the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>type</td>
|
||
<td>String</td>
|
||
<td><code>transaction</code> indicates this is the notification of a transaction, which could come from several possible streams.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>engine_result</td>
|
||
<td>String</td>
|
||
<td>String <a href="reference-transaction-format.html#result-categories">Transaction result code</a></td>
|
||
</tr>
|
||
<tr>
|
||
<td>engine_result_code</td>
|
||
<td>Number</td>
|
||
<td>Numeric <a href="reference-transaction-format.html#result-categories">transaction response code</a>, if applicable.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>engine_result_message</td>
|
||
<td>String</td>
|
||
<td>Human-readable explanation for the transaction response</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_current_index</td>
|
||
<td>Unsigned Integer</td>
|
||
<td>(Omitted for validated transactions) Sequence number of the current ledger version for which this transaction is currently proposed</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_hash</td>
|
||
<td>String</td>
|
||
<td>(Omitted for unvalidated transactions) Unique hash of the ledger version that includes this transaction, as hex</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>Unsigned Integer</td>
|
||
<td>(Omitted for unvalidated transactions) Sequence number of the ledger version that includes this transaction</td>
|
||
</tr>
|
||
<tr>
|
||
<td>meta</td>
|
||
<td>Object</td>
|
||
<td>(Omitted for unvalidated transactions) Various metadata about the transaction, including which ledger entries it affected</td>
|
||
</tr>
|
||
<tr>
|
||
<td>transaction</td>
|
||
<td>Object</td>
|
||
<td>The <a href="reference-transaction-format.html">definition of the transaction</a> in JSON format</td>
|
||
</tr>
|
||
<tr>
|
||
<td>validated</td>
|
||
<td>Boolean</td>
|
||
<td>If true, this transaction is included in a validated ledger. Responses from the <code>transaction</code> stream should always be validated.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h3 id="peer-status-stream">Peer Status Stream</h3>
|
||
<p>The admin-only <code>peer_status</code> stream reports a large amount of information on the activities of other <code>rippled</code> servers to which this server is connected, in particular their status in the consensus process.</p>
|
||
<p>Example of a Peer Status stream message:</p>
|
||
<pre><code>{
|
||
"action": "CLOSING_LEDGER",
|
||
"date": 508546525,
|
||
"ledger_hash": "4D4CD9CD543F0C1EF023CC457F5BEFEA59EEF73E4552542D40E7C4FA08D3C320",
|
||
"ledger_index": 18853106,
|
||
"ledger_index_max": 18853106,
|
||
"ledger_index_min": 18852082,
|
||
"type": "peerStatusChange"
|
||
}
|
||
</code></pre>
|
||
<p>Peer Status stream messages represent some event where the status of the peer <code>rippled</code> server changed. These messages are JSON objects with the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Value</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>type</td>
|
||
<td>String</td>
|
||
<td><code>peerStatusChange</code> indicates this comes from the Peer Status stream.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>action</td>
|
||
<td>String</td>
|
||
<td>The type of event that prompted this message. See <a href="#peer-status-events">Peer Status Events</a> for possible values.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>date</td>
|
||
<td>Number</td>
|
||
<td>The time this event occurred, in seconds since the <a href="#specifying-time">Ripple Epoch</a>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_hash</td>
|
||
<td>String</td>
|
||
<td>(May be omitted) The identifying <a href="#hashes">Hash</a> of a ledger version to which this message pertains.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index</td>
|
||
<td>Number</td>
|
||
<td>(May be omitted) The <a href="#ledger-index">Ledger Index</a> of a ledger version to which this message pertains.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index_max</td>
|
||
<td>Number</td>
|
||
<td>(May be omitted) The largest <a href="#ledger-index">Ledger Index</a> the peer has currently available.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger_index_min</td>
|
||
<td>Number</td>
|
||
<td>(May be omitted) The smallest <a href="#ledger-index">Ledger Index</a> the peer has currently available.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="peer-status-events">Peer Status Events</h4>
|
||
<p>The <code>action</code> field of a Peer Status stream message can have the following values:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Value</th>
|
||
<th>Meaning</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>CLOSING_LEDGER</td>
|
||
<td>The peer closed a ledger version with this <a href="#ledger-index">Ledger Index</a>, which usually means it is about to start consensus.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ACCEPTED_LEDGER</td>
|
||
<td>The peer built this ledger version as the result of a consensus round. <strong>Note:</strong> This ledger is still not certain to become immutably validated.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>SWITCHED_LEDGER</td>
|
||
<td>The peer concluded it was not following the rest of the network and switched to a different ledger version.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>LOST_SYNC</td>
|
||
<td>The peer fell behind the rest of the network in tracking which ledger versions are validated and which are undergoing consensus.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h3 id="order-book-streams">Order Book Streams</h3>
|
||
<p>When you subscribe to one or more order books with the <code>books</code> field, you get back any transactions that affect those order books.</p>
|
||
<p>Example order book stream message:</p>
|
||
<pre><code>{
|
||
"engine_result": "tesSUCCESS",
|
||
"engine_result_code": 0,
|
||
"engine_result_message": "The transaction was applied. Only final in a validated ledger.",
|
||
"ledger_hash": "08547DD866F099CCB3666F113116B7AA2DF520FA2E3011DD1FF9C9C04A6C7C3E",
|
||
"ledger_index": 18852105,
|
||
"meta": {
|
||
"AffectedNodes": [{
|
||
"ModifiedNode": {
|
||
"FinalFields": {
|
||
"Account": "rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw",
|
||
"AccountTxnID": "D295E2BE50E3B78AED24790D7B9096996DAF43F095BF17DB83EEACC283D14050",
|
||
"Balance": "3070332374272",
|
||
"Flags": 0,
|
||
"OwnerCount": 23,
|
||
"RegularKey": "r9S56zu6QeJD5d8A7QMfLAeYavgB9dhaX4",
|
||
"Sequence": 12142921
|
||
},
|
||
"LedgerEntryType": "AccountRoot",
|
||
"LedgerIndex": "2880A9B4FB90A306B576C2D532BFE390AB3904642647DCF739492AA244EF46D1",
|
||
"PreviousFields": {
|
||
"AccountTxnID": "3CA3422B0E42D76A7A677B0BA0BE72DFCD93676E0C80F8D2EB27C04BD8457A0F",
|
||
"Balance": "3070332385272",
|
||
"Sequence": 12142920
|
||
},
|
||
"PreviousTxnID": "3CA3422B0E42D76A7A677B0BA0BE72DFCD93676E0C80F8D2EB27C04BD8457A0F",
|
||
"PreviousTxnLgrSeq": 18852102
|
||
}
|
||
}, {
|
||
"ModifiedNode": {
|
||
"FinalFields": {
|
||
"Flags": 0,
|
||
"IndexPrevious": "00000000000022D2",
|
||
"Owner": "rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw",
|
||
"RootIndex": "F435FBBEC9654204D7151A01E686BAA8CB325A472D7B61C7916EA58B59355767"
|
||
},
|
||
"LedgerEntryType": "DirectoryNode",
|
||
"LedgerIndex": "29A543B6681AD7FC8AFBD1386DAE7385F02F9B8C4756A467DF6834AB54BBC9DB"
|
||
}
|
||
}, {
|
||
"ModifiedNode": {
|
||
"FinalFields": {
|
||
"ExchangeRate": "4C1BA999A513EF78",
|
||
"Flags": 0,
|
||
"RootIndex": "79C54A4EBD69AB2EADCE313042F36092BE432423CC6A4F784C1BA999A513EF78",
|
||
"TakerGetsCurrency": "0000000000000000000000000000000000000000",
|
||
"TakerGetsIssuer": "0000000000000000000000000000000000000000",
|
||
"TakerPaysCurrency": "0000000000000000000000005553440000000000",
|
||
"TakerPaysIssuer": "2ADB0B3959D60A6E6991F729E1918B7163925230"
|
||
},
|
||
"LedgerEntryType": "DirectoryNode",
|
||
"LedgerIndex": "79C54A4EBD69AB2EADCE313042F36092BE432423CC6A4F784C1BA999A513EF78"
|
||
}
|
||
}, {
|
||
"CreatedNode": {
|
||
"LedgerEntryType": "Offer",
|
||
"LedgerIndex": "92E235EE80D2B28A89BEE2C905D4545C2A004FD5D4097679C8A3FB25507FD9EB",
|
||
"NewFields": {
|
||
"Account": "rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw",
|
||
"BookDirectory": "79C54A4EBD69AB2EADCE313042F36092BE432423CC6A4F784C1BA999A513EF78",
|
||
"Expiration": 508543674,
|
||
"OwnerNode": "00000000000022F4",
|
||
"Sequence": 12142920,
|
||
"TakerGets": "6537121438",
|
||
"TakerPays": {
|
||
"currency": "USD",
|
||
"issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq",
|
||
"value": "50.9"
|
||
}
|
||
}
|
||
}
|
||
}, {
|
||
"DeletedNode": {
|
||
"FinalFields": {
|
||
"Account": "rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw",
|
||
"BookDirectory": "79C54A4EBD69AB2EADCE313042F36092BE432423CC6A4F784C1BA999A513EF78",
|
||
"BookNode": "0000000000000000",
|
||
"Expiration": 508543133,
|
||
"Flags": 0,
|
||
"OwnerNode": "00000000000022F4",
|
||
"PreviousTxnID": "58B3279C2D56AAC3D9B06106E637C01E3D911E9D31E2FE4EA0D886AC9F4DEE1E",
|
||
"PreviousTxnLgrSeq": 18851945,
|
||
"Sequence": 12142889,
|
||
"TakerGets": "6537121438",
|
||
"TakerPays": {
|
||
"currency": "USD",
|
||
"issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq",
|
||
"value": "50.9"
|
||
}
|
||
},
|
||
"LedgerEntryType": "Offer",
|
||
"LedgerIndex": "D3436CE21925E1CB12C5C444963B47D7EA0CD9A0E387926DC76B23FE5CD1C15F"
|
||
}
|
||
}],
|
||
"TransactionIndex": 26,
|
||
"TransactionResult": "tesSUCCESS"
|
||
},
|
||
"status": "closed",
|
||
"transaction": {
|
||
"Account": "rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw",
|
||
"Expiration": 508543674,
|
||
"Fee": "11000",
|
||
"Flags": 2147483648,
|
||
"LastLedgerSequence": 18852106,
|
||
"OfferSequence": 12142889,
|
||
"Sequence": 12142920,
|
||
"SigningPubKey": "034841BF24BD72C7CC371EBD87CCBF258D8ADB05C18DE207130364A97D8A3EA524",
|
||
"TakerGets": "6537121438",
|
||
"TakerPays": {
|
||
"currency": "USD",
|
||
"issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq",
|
||
"value": "50.9"
|
||
},
|
||
"TransactionType": "OfferCreate",
|
||
"TxnSignature": "3045022100B9AD678A773FB61F8F9B565713C80CBF187A2F9EB8E9CE0DAC7B839CA6F4B04C02200613D173A0636CD9BE13F2E3EBD13A16932B5B7D8A96BB5F6D561CA5CDBC4AD3",
|
||
"date": 508543090,
|
||
"hash": "D295E2BE50E3B78AED24790D7B9096996DAF43F095BF17DB83EEACC283D14050",
|
||
"owner_funds": "3070197374272"
|
||
},
|
||
"type": "transaction",
|
||
"validated": true
|
||
}
|
||
</code></pre>
|
||
<p>The format of an order book stream message is the same as that of <a href="#transaction-streams">transaction stream messages</a>, except that <code>OfferCreate</code> transactions also contain the following field:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Value</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>transaction.owner_funds</td>
|
||
<td>String</td>
|
||
<td>Numeric amount of the <code>TakerGets</code> currency that the <code>Account</code> sending this OfferCreate transaction has after executing this transaction. This does not check whether the currency amount is <a href="concept-freeze.html">frozen</a>.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h2 id="unsubscribe">unsubscribe</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/Unsubscribe.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>unsubscribe</code> command tells the server to stop sending messages for a particular subscription or set of subscriptions.</p>
|
||
<h4 id="request-format-30">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-60"><ul class="codetabs"><li><a href="#code-60-0">WebSocket</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-60-0" style="position: static;"><pre><code>{
|
||
"id": "Unsubscribe a lot of stuff",
|
||
"command": "unsubscribe",
|
||
"streams": ["ledger","server","transactions","transactions_proposed"],
|
||
"accounts": ["rrpNnNLKrartuEqfJGpqyDwPj1AFPg9vn1"],
|
||
"accounts_proposed": ["rrpNnNLKrartuEqfJGpqyDwPj1AFPg9vn1"],
|
||
"books": [
|
||
{
|
||
"taker_pays": {
|
||
"currency": "XRP"
|
||
},
|
||
"taker_gets": {
|
||
"currency": "USD",
|
||
"issuer": "rUQTpMqAF5jhykj4FExVeXakrZpiKF6cQV"
|
||
},
|
||
"both": true
|
||
}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p><a class="button" href="ripple-api-tool.html#unsubscribe">Try it! ></a></p>
|
||
<p>The parameters in the request are specified almost exactly like the parameters to <a href="#subscribe"><code>subscribe</code></a>, except that they are used to define which subscriptions to end instead. The parameters are:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>streams</td>
|
||
<td>Array</td>
|
||
<td>(Optional) Array of string names of generic streams to unsubscribe from, including <code>ledger</code>, <code>server</code>, <code>transactions</code>, and <code>transactions_proposed</code>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>accounts</td>
|
||
<td>Array</td>
|
||
<td>(Optional) Array of unique base-58 account addresses to stop receiving updates for. (This only stops those messages if you previously subscribed to those accounts specifically. You cannot use this to filter accounts out of the general transactions stream.)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>accounts_proposed</td>
|
||
<td>Array</td>
|
||
<td>(Optional) Like <code>accounts</code>, but for <code>accounts_proposed</code> subscriptions that included not-yet-validated transactions.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>books</td>
|
||
<td>Array</td>
|
||
<td>(Optional) Array of objects defining order books to unsubscribe from, as explained below.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>The <code>rt_accounts</code> and <code>url</code> parameters, and the <code>rt_transactions</code> stream name, are deprecated and may be removed without further notice.</p>
|
||
<p>The objects in the <code>books</code> array are defined almost like the ones from subscribe, except that they don't have all the fields. The fields they have are as follows:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>taker_gets</td>
|
||
<td>Object</td>
|
||
<td>Specification of which currency the account taking the offer would receive, as an object with <code>currency</code> and <code>issuer</code> fields (omit issuer for XRP), like <a href="#specifying-currency-amounts">currency amounts</a>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>taker_pays</td>
|
||
<td>Object</td>
|
||
<td>Specification of which currency the account taking the offer would pay, as an object with <code>currency</code> and <code>issuer</code> fields (omit issuer for XRP), like <a href="#specifying-currency-amounts">currency amounts</a>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>both</td>
|
||
<td>Boolean</td>
|
||
<td>(Optional, defaults to false) If true, remove a subscription for both sides of the order book.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="response-format-29">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-61"><ul class="codetabs"><li><a href="#code-61-0">WebSocket</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-61-0" style="position: static;"><pre><code>{
|
||
"id": "Unsubscribe a lot of stuff",
|
||
"result": {},
|
||
"status": "success",
|
||
"type": "response"
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing no fields.</p>
|
||
<h4 id="possible-errors-29">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>invalidParams</code> - One or more fields are specified incorrectly, or one or more required fields are missing.</li>
|
||
<li><code>noPermission</code> - The request included the <code>url</code> field, but you are not connected as an admin.</li>
|
||
<li><code>malformedStream</code> - The <code>streams</code> field of the request was not formatted properly.</li>
|
||
<li><code>malformedAccount</code> - One of the addresses in the <code>accounts</code> or <code>accounts_proposed</code> fields of the request is not a properly-formatted Ripple address.<ul>
|
||
<li class="devportal-callout note"><strong>Note:</strong>: You <em>can</em> subscribe to the stream of an address that does not yet have an entry in the global ledger to get a message when that address becomes funded.</li>
|
||
</ul>
|
||
</li>
|
||
<li><code>srcCurMalformed</code> - One or more <code>taker_pays</code> sub-fields of the <code>books</code> field in the request is not formatted properly.</li>
|
||
<li><code>dstAmtMalformed</code> - One or more <code>taker_gets</code> sub-fields of the <code>books</code> field in the request is not formatted properly.</li>
|
||
<li><code>srcIsrMalformed</code> - The <code>issuer</code> field of one or more <code>taker_pays</code> sub-fields of the <code>books</code> field in the request is not valid.</li>
|
||
<li><code>dstIsrMalformed</code> - The <code>issuer</code> field of one or more <code>taker_gets</code> sub-fields of the <code>books</code> field in the request is not valid.</li>
|
||
<li><code>badMarket</code> - One or more desired order books in the <code>books</code> field does not exist; for example, offers to exchange a currency for itself.</li>
|
||
</ul>
|
||
<h1 id="server-information">Server Information</h1>
|
||
<p>There are also commands that retrieve information about the current state of the server. These may be useful for monitoring the health of the server, or in preparing for making other API methods. For example, you may query for the current fee schedule before sending a transaction, or you may check which ledger versions are available before digging into the ledger history for a specific record.</p>
|
||
<h2 id="server-info">server_info</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/ServerInfo.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>server_info</code> command asks the server for a human-readable version of various information about the <code>rippled</code> server being queried.</p>
|
||
<h4 id="request-format-31">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-62"><ul class="codetabs"><li><a href="#code-62-0">WebSocket</a></li><li><a href="#code-62-1">JSON-RPC</a></li><li><a href="#code-62-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-62-0" style="position: static;"><pre><code>{
|
||
"id": 1,
|
||
"command": "server_info"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-62-1" style="position: static;"><pre><code>{
|
||
"method": "server_info",
|
||
"params": [
|
||
{}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-62-2" style="position: static;"><pre><code>#Syntax: server_info
|
||
rippled server_info
|
||
</code></pre></div>
|
||
</div>
|
||
<p><a class="button" href="ripple-api-tool.html#server_info">Try it! ></a></p>
|
||
<p>The request does not takes any parameters.</p>
|
||
<h4 id="response-format-30">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-63"><ul class="codetabs"><li><a href="#code-63-0">WebSocket</a></li><li><a href="#code-63-1">JSON-RPC</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-63-0" style="position: static;"><pre><code>{
|
||
"id": 1,
|
||
"status": "success",
|
||
"type": "response",
|
||
"result": {
|
||
"info": {
|
||
"build_version": "0.30.1-rc3",
|
||
"complete_ledgers": "18611104-18614732",
|
||
"hostid": "trace",
|
||
"io_latency_ms": 1,
|
||
"last_close": {
|
||
"converge_time_s": 4.003,
|
||
"proposers": 5
|
||
},
|
||
"load": {
|
||
"job_types": [
|
||
{
|
||
"job_type": "untrustedProposal",
|
||
"per_second": 2
|
||
},
|
||
{
|
||
"in_progress": 1,
|
||
"job_type": "clientCommand"
|
||
},
|
||
{
|
||
"job_type": "transaction",
|
||
"per_second": 4
|
||
},
|
||
{
|
||
"job_type": "batch",
|
||
"per_second": 3
|
||
},
|
||
{
|
||
"job_type": "writeObjects",
|
||
"per_second": 2
|
||
},
|
||
{
|
||
"job_type": "trustedProposal",
|
||
"per_second": 1
|
||
},
|
||
{
|
||
"job_type": "peerCommand",
|
||
"per_second": 108
|
||
},
|
||
{
|
||
"job_type": "diskAccess",
|
||
"per_second": 1
|
||
},
|
||
{
|
||
"job_type": "processTransaction",
|
||
"per_second": 4
|
||
},
|
||
{
|
||
"job_type": "WriteNode",
|
||
"per_second": 63
|
||
}
|
||
],
|
||
"threads": 6
|
||
},
|
||
"load_factor": 1000,
|
||
"load_factor_net": 1000,
|
||
"peers": 10,
|
||
"pubkey_node": "n94UE1ukbq6pfZY9j54sv2A1UrEeHZXLbns3xK5CzU9NbNREytaa",
|
||
"pubkey_validator": "n9KM73uq5BM3Fc6cxG3k5TruvbLc8Ffq17JZBmWC4uP4csL4rFST",
|
||
"server_state": "proposing",
|
||
"state_accounting": {
|
||
"connected": {
|
||
"duration_us": "150510079",
|
||
"transitions": 1
|
||
},
|
||
"disconnected": {
|
||
"duration_us": "1827731",
|
||
"transitions": 1
|
||
},
|
||
"full": {
|
||
"duration_us": "166972201508",
|
||
"transitions": 1853
|
||
},
|
||
"syncing": {
|
||
"duration_us": "6249156726",
|
||
"transitions": 1854
|
||
},
|
||
"tracking": {
|
||
"duration_us": "13035222",
|
||
"transitions": 1854
|
||
}
|
||
},
|
||
"uptime": 173379,
|
||
"validated_ledger": {
|
||
"age": 3,
|
||
"base_fee_xrp": 0.00001,
|
||
"hash": "04F7CF4EACC57140C8088F6BFDC8A824BB3ED5717C3DAA6642101F9FB446226C",
|
||
"reserve_base_xrp": 20,
|
||
"reserve_inc_xrp": 5,
|
||
"seq": 18614732
|
||
},
|
||
"validation_quorum": 4
|
||
}
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-63-1" style="position: static;"><pre><code>200 OK
|
||
{
|
||
"result" : {
|
||
"info" : {
|
||
"build_version" : "0.30.1-rc3",
|
||
"complete_ledgers" : "18611104-18614536",
|
||
"hostid" : "trace",
|
||
"io_latency_ms" : 1,
|
||
"last_close" : {
|
||
"converge_time_s" : 3.002,
|
||
"proposers" : 5
|
||
},
|
||
"load" : {
|
||
"job_types" : [
|
||
{
|
||
"job_type" : "untrustedProposal",
|
||
"per_second" : 3
|
||
},
|
||
{
|
||
"in_progress" : 1,
|
||
"job_type" : "clientCommand"
|
||
},
|
||
{
|
||
"job_type" : "writeObjects",
|
||
"per_second" : 1
|
||
},
|
||
{
|
||
"job_type" : "trustedProposal",
|
||
"per_second" : 1
|
||
},
|
||
{
|
||
"job_type" : "peerCommand",
|
||
"per_second" : 61
|
||
},
|
||
{
|
||
"job_type" : "WriteNode",
|
||
"per_second" : 41
|
||
}
|
||
],
|
||
"threads" : 6
|
||
},
|
||
"load_factor" : 1000,
|
||
"load_factor_net" : 1000,
|
||
"peers" : 10,
|
||
"pubkey_node" : "n94UE1ukbq6pfZY9j54sv2A1UrEeHZXLbns3xK5CzU9NbNREytaa",
|
||
"pubkey_validator" : "n9KM73uq5BM3Fc6cxG3k5TruvbLc8Ffq17JZBmWC4uP4csL4rFST",
|
||
"server_state" : "proposing",
|
||
"state_accounting" : {
|
||
"connected" : {
|
||
"duration_us" : "150510079",
|
||
"transitions" : 1
|
||
},
|
||
"disconnected" : {
|
||
"duration_us" : "1827731",
|
||
"transitions" : 1
|
||
},
|
||
"full" : {
|
||
"duration_us" : "166170134942",
|
||
"transitions" : 1838
|
||
},
|
||
"syncing" : {
|
||
"duration_us" : "6196072160",
|
||
"transitions" : 1839
|
||
},
|
||
"tracking" : {
|
||
"duration_us" : "9023236",
|
||
"transitions" : 1839
|
||
}
|
||
},
|
||
"uptime" : 172520,
|
||
"validated_ledger" : {
|
||
"age" : 4,
|
||
"base_fee_xrp" : 1e-05,
|
||
"hash" : "B69EDD86AB57C6F80F5AA6D4246AC2C9EC0BE0E49649FBC46EEE12DE56500DCA",
|
||
"reserve_base_xrp" : 20,
|
||
"reserve_inc_xrp" : 5,
|
||
"seq" : 18614536
|
||
},
|
||
"validation_quorum" : 4
|
||
},
|
||
"status" : "success"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing an <code>info</code> object as its only field.</p>
|
||
<p>The <code>info</code> object may have some arrangement of the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>build_version</td>
|
||
<td>String</td>
|
||
<td>The version number of the running <code>rippled</code> version.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>complete_ledgers</td>
|
||
<td>String</td>
|
||
<td>Range expression indicating the sequence numbers of the ledger versions the local rippled has in its database. It is possible to be a disjoint sequence, e.g. "2500-5000,32570-7695432".</td>
|
||
</tr>
|
||
<tr>
|
||
<td>hostid</td>
|
||
<td>String</td>
|
||
<td>On an admin request, returns the hostname of the server running the <code>rippled</code> instance; otherwise, returns a unique four letter word.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>io_latency_ms</td>
|
||
<td>Number</td>
|
||
<td>Amount of time spent waiting for I/O operations, in milliseconds. If this number is not very, very low, then the <code>rippled</code> server is probably having serious load issues.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>last_close</td>
|
||
<td>Object</td>
|
||
<td>Information about the last time the server closed a ledger, including the amount of time it took to reach a consensus and the number of trusted validators participating.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>load</td>
|
||
<td>Object</td>
|
||
<td><em>Admin only</em> Detailed information about the current load state of the server</td>
|
||
</tr>
|
||
<tr>
|
||
<td>load.job_types</td>
|
||
<td>Array</td>
|
||
<td><em>Admin only</em> Information about the rate of different types of jobs the server is doing and how much time it spends on each.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>load.threads</td>
|
||
<td>Number</td>
|
||
<td><em>Admin only</em> The number of threads in the server's main job pool.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>load_factor</td>
|
||
<td>Number</td>
|
||
<td>The load factor the server is currently enforcing, as a multiplier on the base transaction cost. The load factor is determined by the highest of the individual server's load factor, cluster's load factor, and the overall network's load factor. <strong>Note:</strong> This <code>load_factor</code> is calculated as the ratio of the <code>load_factor</code> and the <code>load_base</code> that are reported by the <a href="#server-state"><code>server_state</code> command</a></td>
|
||
</tr>
|
||
<tr>
|
||
<td>peers</td>
|
||
<td>Number</td>
|
||
<td>How many other <code>rippled</code> servers the node is currently connected to.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>pubkey_node</td>
|
||
<td>String</td>
|
||
<td>Public key used to verify this node for internal communications; this key is automatically generated by the server the first time it starts up. (If deleted, the node can create a new pair of keys.)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>pubkey_validator</td>
|
||
<td>String</td>
|
||
<td><em>Admin only</em> Public key used by this node to sign ledger validations.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>server_state</td>
|
||
<td>String</td>
|
||
<td>A string indicating to what extent the server is participating in the network. See <a href="#possible-server-states">Possible Server States</a> for more details.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>state_accounting</td>
|
||
<td>Object</td>
|
||
<td>A map of various <a href="#possible-server-states">server states</a> with information about the time the server spends in each. This can be useful for tracking the long-term health of your server's connectivity to the network. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.30.1">version 0.30.1</a>)</em></td>
|
||
</tr>
|
||
<tr>
|
||
<td>state_accounting.*.duration_us</td>
|
||
<td>String</td>
|
||
<td>The number of microseconds the server has spent in this state. (This is updated whenever the server transitions into another state.) <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.30.1">version 0.30.1</a>)</em></td>
|
||
</tr>
|
||
<tr>
|
||
<td>state_accounting.*.transitions</td>
|
||
<td>Number</td>
|
||
<td>The number of times the server has transitioned into this state. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.30.1">version 0.30.1</a>)</em></td>
|
||
</tr>
|
||
<tr>
|
||
<td>uptime</td>
|
||
<td>Number</td>
|
||
<td>Number of consecutive seconds that the server has been operational. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.30.1">version 0.30.1</a>)</em></td>
|
||
</tr>
|
||
<tr>
|
||
<td>validated_ledger</td>
|
||
<td>Object</td>
|
||
<td>Information about the fully-validated ledger with the highest <a href="#ledger-index">Ledger Index</a> (the most recent)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>validated_ledger.age</td>
|
||
<td>Number</td>
|
||
<td>The time since the ledger was closed, in seconds</td>
|
||
</tr>
|
||
<tr>
|
||
<td>validated_ledger.base_fee_xrp</td>
|
||
<td>Number</td>
|
||
<td>Base fee, in XRP. This may be represented in scientific notation such as 1e-05 for 0.00005</td>
|
||
</tr>
|
||
<tr>
|
||
<td>validated_ledger.hash</td>
|
||
<td>String</td>
|
||
<td>Unique hash for the ledger, as hex</td>
|
||
</tr>
|
||
<tr>
|
||
<td>validated_ledger.reserve_base_xrp</td>
|
||
<td>Unsigned Integer</td>
|
||
<td>Minimum amount of XRP (not drops) necessary for every account to keep in reserve</td>
|
||
</tr>
|
||
<tr>
|
||
<td>validated_ledger.reserve_inc_xrp</td>
|
||
<td>Unsigned Integer</td>
|
||
<td>Amount of XRP (not drops) added to the account reserve for each object an account owns in the ledger</td>
|
||
</tr>
|
||
<tr>
|
||
<td>validated_ledger.seq</td>
|
||
<td>Number - <a href="#ledger-index">Ledger Index</a></td>
|
||
<td>The ledger index of the latest validate ledger</td>
|
||
</tr>
|
||
<tr>
|
||
<td>validation_quorum</td>
|
||
<td>Number</td>
|
||
<td>Minimum number of trusted validations required to validate a ledger version. Some circumstances may cause the server to require more validations.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="possible-errors-30">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
</ul>
|
||
<h2 id="server-state">server_state</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/ServerState.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>server_state</code> command asks the server for various machine-readable information about the <code>rippled</code> server's current state. The results are almost the same as <a href="#server-info"><code>server_info</code></a>, but using units that are easier to process instead of easier to read. (For example, XRP values are given in integer drops instead of scientific notation or decimal values, and time is given in milliseconds instead of seconds.)</p>
|
||
<h4 id="request-format-32">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-64"><ul class="codetabs"><li><a href="#code-64-0">WebSocket</a></li><li><a href="#code-64-1">JSON-RPC</a></li><li><a href="#code-64-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-64-0" style="position: static;"><pre><code>{
|
||
"id": 2,
|
||
"command": "server_state"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-64-1" style="position: static;"><pre><code>{
|
||
"method": "server_state",
|
||
"params": [
|
||
{}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-64-2" style="position: static;"><pre><code>#Syntax: server_state
|
||
rippled server_state
|
||
</code></pre></div>
|
||
</div>
|
||
<p><a class="button" href="ripple-api-tool.html#server_state">Try it! ></a></p>
|
||
<p>The request does not takes any parameters.</p>
|
||
<h4 id="response-format-31">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-65"><ul class="codetabs"><li><a href="#code-65-0">WebSocket</a></li><li><a href="#code-65-1">JSON-RPC</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-65-0" style="position: static;"><pre><code>{
|
||
"id": 2,
|
||
"status": "success",
|
||
"type": "response",
|
||
"result": {
|
||
"state": {
|
||
"build_version": "0.30.1-rc3",
|
||
"complete_ledgers": "18611104-18615049",
|
||
"io_latency_ms": 1,
|
||
"last_close": {
|
||
"converge_time": 3003,
|
||
"proposers": 5
|
||
},
|
||
"load": {
|
||
"job_types": [
|
||
{
|
||
"job_type": "untrustedProposal",
|
||
"peak_time": 1,
|
||
"per_second": 3
|
||
},
|
||
{
|
||
"in_progress": 1,
|
||
"job_type": "clientCommand"
|
||
},
|
||
{
|
||
"avg_time": 12,
|
||
"job_type": "writeObjects",
|
||
"peak_time": 345,
|
||
"per_second": 2
|
||
},
|
||
{
|
||
"job_type": "trustedProposal",
|
||
"per_second": 1
|
||
},
|
||
{
|
||
"job_type": "peerCommand",
|
||
"per_second": 64
|
||
},
|
||
{
|
||
"avg_time": 33,
|
||
"job_type": "diskAccess",
|
||
"peak_time": 526
|
||
},
|
||
{
|
||
"job_type": "WriteNode",
|
||
"per_second": 55
|
||
}
|
||
],
|
||
"threads": 6
|
||
},
|
||
"load_base": 256,
|
||
"load_factor": 256000,
|
||
"peers": 10,
|
||
"pubkey_node": "n94UE1ukbq6pfZY9j54sv2A1UrEeHZXLbns3xK5CzU9NbNREytaa",
|
||
"pubkey_validator": "n9KM73uq5BM3Fc6cxG3k5TruvbLc8Ffq17JZBmWC4uP4csL4rFST",
|
||
"server_state": "proposing",
|
||
"state_accounting": {
|
||
"connected": {
|
||
"duration_us": "150510079",
|
||
"transitions": 1
|
||
},
|
||
"disconnected": {
|
||
"duration_us": "1827731",
|
||
"transitions": 1
|
||
},
|
||
"full": {
|
||
"duration_us": "168295542987",
|
||
"transitions": 1865
|
||
},
|
||
"syncing": {
|
||
"duration_us": "6294237352",
|
||
"transitions": 1866
|
||
},
|
||
"tracking": {
|
||
"duration_us": "13035524",
|
||
"transitions": 1866
|
||
}
|
||
},
|
||
"uptime": 174748,
|
||
"validated_ledger": {
|
||
"base_fee": 10,
|
||
"close_time": 507693650,
|
||
"hash": "FEB17B15FB64E3AF8D371E6AAFCFD8B92775BB80AB953803BD73EA8EC75ECA34",
|
||
"reserve_base": 20000000,
|
||
"reserve_inc": 5000000,
|
||
"seq": 18615049
|
||
},
|
||
"validation_quorum": 4
|
||
}
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-65-1" style="position: static;"><pre><code>200 OK
|
||
{
|
||
"result" : {
|
||
"state" : {
|
||
"build_version" : "0.30.1-rc3",
|
||
"complete_ledgers" : "18611104-18615037",
|
||
"io_latency_ms" : 1,
|
||
"last_close" : {
|
||
"converge_time" : 2001,
|
||
"proposers" : 5
|
||
},
|
||
"load" : {
|
||
"job_types" : [
|
||
{
|
||
"job_type" : "untrustedProposal",
|
||
"per_second" : 2
|
||
},
|
||
{
|
||
"in_progress" : 1,
|
||
"job_type" : "clientCommand"
|
||
},
|
||
{
|
||
"job_type" : "writeObjects",
|
||
"per_second" : 2
|
||
},
|
||
{
|
||
"avg_time" : 2,
|
||
"job_type" : "acceptLedger",
|
||
"peak_time" : 6
|
||
},
|
||
{
|
||
"job_type" : "trustedProposal",
|
||
"per_second" : 1
|
||
},
|
||
{
|
||
"job_type" : "peerCommand",
|
||
"per_second" : 80
|
||
},
|
||
{
|
||
"job_type" : "diskAccess",
|
||
"per_second" : 1
|
||
},
|
||
{
|
||
"job_type" : "WriteNode",
|
||
"per_second" : 91
|
||
}
|
||
],
|
||
"threads" : 6
|
||
},
|
||
"load_base" : 256,
|
||
"load_factor" : 256000,
|
||
"peers" : 10,
|
||
"pubkey_node" : "n94UE1ukbq6pfZY9j54sv2A1UrEeHZXLbns3xK5CzU9NbNREytaa",
|
||
"pubkey_validator" : "n9KM73uq5BM3Fc6cxG3k5TruvbLc8Ffq17JZBmWC4uP4csL4rFST",
|
||
"server_state" : "proposing",
|
||
"state_accounting" : {
|
||
"connected" : {
|
||
"duration_us" : "150510079",
|
||
"transitions" : 1
|
||
},
|
||
"disconnected" : {
|
||
"duration_us" : "1827731",
|
||
"transitions" : 1
|
||
},
|
||
"full" : {
|
||
"duration_us" : "168241260112",
|
||
"transitions" : 1865
|
||
},
|
||
"syncing" : {
|
||
"duration_us" : "6294237352",
|
||
"transitions" : 1866
|
||
},
|
||
"tracking" : {
|
||
"duration_us" : "13035524",
|
||
"transitions" : 1866
|
||
}
|
||
},
|
||
"uptime" : 174693,
|
||
"validated_ledger" : {
|
||
"base_fee" : 10,
|
||
"close_time" : 507693592,
|
||
"hash" : "1C26209AE593C7EB5123363B3152D86514845FBD42CC6B05111D57F62D02B113",
|
||
"reserve_base" : 20000000,
|
||
"reserve_inc" : 5000000,
|
||
"seq" : 18615037
|
||
},
|
||
"validation_quorum" : 4
|
||
},
|
||
"status" : "success"
|
||
}
|
||
}
|
||
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing a <code>state</code> object as its only field.</p>
|
||
<p>The <code>state</code> object may have some arrangement of the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>build_version</td>
|
||
<td>String</td>
|
||
<td>The version number of the running <code>rippled</code> version.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>complete_ledgers</td>
|
||
<td>String</td>
|
||
<td>Range expression indicating the sequence numbers of the ledger versions the local rippled has in its database. It is possible to be a disjoint sequence, e.g. "2500-5000,32570-7695432".</td>
|
||
</tr>
|
||
<tr>
|
||
<td>io_latency_ms</td>
|
||
<td>Number</td>
|
||
<td>Amount of time spent waiting for I/O operations, in milliseconds. If this number is not very, very low, then the <code>rippled</code> server is probably having serious load issues.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>load</td>
|
||
<td>Object</td>
|
||
<td><em>Admin only</em> Detailed information about the current load state of the server</td>
|
||
</tr>
|
||
<tr>
|
||
<td>load.job_types</td>
|
||
<td>Array</td>
|
||
<td><em>Admin only</em> Information about the rate of different types of jobs the server is doing and how much time it spends on each.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>load.threads</td>
|
||
<td>Number</td>
|
||
<td><em>Admin only</em> The number of threads in the server's main job pool.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>load_base</td>
|
||
<td>Number</td>
|
||
<td>This amount of server load is the baseline that is used to decide how much to charge in transaction fees; if the <code>load_factor</code> is equal to the <code>load_base</code> then only the base fee is enforced; if the <code>load_factor</code> is double the <code>load_base</code> then transaction fees are doubled.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>load_factor</td>
|
||
<td>Number</td>
|
||
<td>The load factor the server is currently enforcing. The ratio between this value and the load_base determines the multiplier for transaction fees. The load factor is determined by the highest of the individual server's load factor, cluster's load factor, and the overall network's load factor.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>peers</td>
|
||
<td>Number</td>
|
||
<td>How many other <code>rippled</code> servers the node is currently connected to.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>pubkey_node</td>
|
||
<td>String</td>
|
||
<td>Public key used by this server (along with the corresponding private key) for secure communications between nodes. This key pair is automatically created and stored in <code>rippled</code>'s local database the first time it starts up; if lost or deleted, a new key pair can be generated with no ill effects.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>pubkey_validator</td>
|
||
<td>String</td>
|
||
<td><em>Admin only</em> Public key of the keypair used by this server to sign proposed ledgers for validation.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>server_state</td>
|
||
<td>String</td>
|
||
<td>A string indicating to what extent the server is participating in the network. See <a href="#possible-server-states">Possible Server States</a> for more details.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>state_accounting</td>
|
||
<td>Object</td>
|
||
<td>A map of various <a href="#possible-server-states">server states</a> with information about the time the server spends in each. This can be useful for tracking the long-term health of your server's connectivity to the network. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.30.1">version 0.30.1</a>)</em></td>
|
||
</tr>
|
||
<tr>
|
||
<td>state_accounting.*.duration_us</td>
|
||
<td>String</td>
|
||
<td>The number of microseconds the server has spent in this state. (This is updated whenever the server transitions into another state.) <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.30.1">version 0.30.1</a>)</em></td>
|
||
</tr>
|
||
<tr>
|
||
<td>state_accounting.*.transitions</td>
|
||
<td>Number</td>
|
||
<td>The number of times the server has transitioned into this state. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.30.1">version 0.30.1</a>)</em></td>
|
||
</tr>
|
||
<tr>
|
||
<td>uptime</td>
|
||
<td>Number</td>
|
||
<td>Number of consecutive seconds that the server has been operational. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.30.1">version 0.30.1</a>)</em></td>
|
||
</tr>
|
||
<tr>
|
||
<td>validated_ledger</td>
|
||
<td>Object</td>
|
||
<td>Information about the fully-validated ledger with the highest sequence number (the most recent)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>validated_ledger.base_fee</td>
|
||
<td>Unsigned Integer</td>
|
||
<td>Base fee, in drops of XRP, for propagating a transaction to the network.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>validated_ledger.close_time</td>
|
||
<td>Number</td>
|
||
<td>Time this ledger was closed, in seconds since the <a href="#specifying-time">Ripple Epoch</a></td>
|
||
</tr>
|
||
<tr>
|
||
<td>validated_ledger.hash</td>
|
||
<td>String</td>
|
||
<td>Unique hash of this ledger version, as hex</td>
|
||
</tr>
|
||
<tr>
|
||
<td>validated_ledger.reserve_base</td>
|
||
<td>Unsigned Integer</td>
|
||
<td>Minimum amount, in drops of XRP, necessary for every account to keep in reserve</td>
|
||
</tr>
|
||
<tr>
|
||
<td>validated_ledger.reserve_inc</td>
|
||
<td>Unsigned Integer</td>
|
||
<td>Amount, in drops of XRP, that is added to the account reserve for each item the account owns in the ledger.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>validated_ledger.seq</td>
|
||
<td>Unsigned Integer</td>
|
||
<td>Unique sequence number of this ledger</td>
|
||
</tr>
|
||
<tr>
|
||
<td>validation_quorum</td>
|
||
<td>Number</td>
|
||
<td>Minimum number of trusted validations required to validate a ledger version. Some circumstances may cause the server to require more validations.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="possible-errors-31">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
</ul>
|
||
<h2 id="can-delete">can_delete</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/develop/src/ripple/rpc/handlers/CanDelete.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>With <code>online_delete</code> and <code>advisory_delete</code> configuration options enabled, the <code>can_delete</code> method informs the rippled server of the latest ledger which may be deleted.</p>
|
||
<p><em>The <code>can_delete</code> method is an <a href="#connecting-to-rippled">admin command</a> that cannot be run by unpriviledged users.</em></p>
|
||
<h4 id="request-format-33">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-66"><ul class="codetabs"><li><a href="#code-66-0">WebSocket</a></li><li><a href="#code-66-1">JSON-RPC</a></li><li><a href="#code-66-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-66-0" style="position: static;"><pre><code>{
|
||
"id": 2,
|
||
"command": "can_delete",
|
||
"can_delete": 11320417
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-66-1" style="position: static;"><pre><code>{
|
||
"method": "can_delete",
|
||
"params": [
|
||
{
|
||
"can_delete": 11320417
|
||
}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-66-2" style="position: static;"><pre><code>#Syntax can_delete [<ledger_index>|<ledger_hash>|now|always|never]
|
||
rippled can_delete 11320417
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The request includes the following optional parameter:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>can_delete</td>
|
||
<td>String or Integer</td>
|
||
<td>The maximum ledger to allow to be deleted. For <code>ledger_index</code> or <code>ledger_hash</code>, see <a href="#specifying-ledgers">Specifying a Ledger</a>. <code>never</code> sets the value to 0, and effectively disables online deletion until another <code>can_delete</code> is appropriately called. <code>always</code> sets the value to the maximum possible ledger (4294967295), and online deletion occurs as of each configured <code>online_delete</code> interval. <code>now</code> triggers online deletion at the next validated ledger that meets or exceeds the configured <code>online_delete</code> interval, but no further.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>If no parameter is specified, no change is made.</p>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with
|
||
a successful result containing the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>can_delete</td>
|
||
<td>Integer</td>
|
||
<td>The maximum ledger index that may be removed by the online deletion routine.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>Use this command with no parameter to query the existing <code>can_delete</code> setting.</p>
|
||
<h4 id="possible-errors-32">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>notEnabled</code> - Not enabled in configuration.</li>
|
||
<li><code>notReady</code> - Not ready to handle this request.</li>
|
||
<li><code>lgrNotFound</code> - Ledger not found.</li>
|
||
<li><code>invalidParams</code> - Invalid parameters.</li>
|
||
</ul>
|
||
<h2 id="consensus-info">consensus_info</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/a61ffab3f9010d8accfaa98aa3cacc7d38e74121/src/ripple/rpc/handlers/ConsensusInfo.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>consensus_info</code> command provides information about the consensus process for debugging purposes.</p>
|
||
<p><em>The <code>consensus_info</code> method is an <a href="#connecting-to-rippled">admin command</a> that cannot be run by unpriviledged users.</em></p>
|
||
<h4 id="request-format-34">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-67"><ul class="codetabs"><li><a href="#code-67-0">WebSocket</a></li><li><a href="#code-67-1">JSON-RPC</a></li><li><a href="#code-67-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-67-0" style="position: static;"><pre><code>{
|
||
"id": 99,
|
||
"command": "consensus_info"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-67-1" style="position: static;"><pre><code>{
|
||
"method": "consensus_info",
|
||
"params": [
|
||
{}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-67-2" style="position: static;"><pre><code>#Syntax: consensus_info
|
||
rippled consensus_info
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The request has no parameters.</p>
|
||
<h4 id="response-format-32">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-68"><ul class="codetabs"><li><a href="#code-68-0">JSON-RPC</a></li><li><a href="#code-68-1">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-68-0" style="position: static;"><pre><code>{
|
||
"result" : {
|
||
"info" : {
|
||
"acquired" : {
|
||
"4BC2CE596CBD1321775320E2067F9C06D3862826212C16EF42ABB6A2B0414306" : "acquired"
|
||
},
|
||
"close_granularity" : 10,
|
||
"close_percent" : 50,
|
||
"close_resolution" : 10,
|
||
"close_times" : {
|
||
"486082972" : 1,
|
||
"486082973" : 4
|
||
},
|
||
"current_ms" : 1003,
|
||
"have_time_consensus" : false,
|
||
"ledger_seq" : 13701086,
|
||
"our_position" : {
|
||
"close_time" : 486082973,
|
||
"previous_ledger" : "0BB01379B51234BAAF501A71C7AB147F595460B689BB9E8252A0B87B5A483623",
|
||
"propose_seq" : 0,
|
||
"transaction_hash" : "4BC2CE596CBD1321775320E2067F9C06D3862826212C16EF42ABB6A2B0414306"
|
||
},
|
||
"peer_positions" : {
|
||
"0A2EAF919033A036D363D4E5610A66209DDBE8EE" : {
|
||
"close_time" : 486082972,
|
||
"peer_id" : "n9KiYM9CgngLvtRCQHZwgC2gjpdaZcCcbt3VboxiNFcKuwFVujzS",
|
||
"previous_ledger" : "0BB01379B51234BAAF501A71C7AB147F595460B689BB9E8252A0B87B5A483623",
|
||
"propose_seq" : 0,
|
||
"transaction_hash" : "4BC2CE596CBD1321775320E2067F9C06D3862826212C16EF42ABB6A2B0414306"
|
||
},
|
||
"1567A8C953A86F8428C7B01641D79BBF2FD508F3" : {
|
||
"close_time" : 486082973,
|
||
"peer_id" : "n9LdgEtkmGB9E2h3K4Vp7iGUaKuq23Zr32ehxiU8FWY7xoxbWTSA",
|
||
"previous_ledger" : "0BB01379B51234BAAF501A71C7AB147F595460B689BB9E8252A0B87B5A483623",
|
||
"propose_seq" : 0,
|
||
"transaction_hash" : "4BC2CE596CBD1321775320E2067F9C06D3862826212C16EF42ABB6A2B0414306"
|
||
},
|
||
"202397A81F20B44CF44EA99AF761295E5A8397D2" : {
|
||
"close_time" : 486082973,
|
||
"peer_id" : "n9MD5h24qrQqiyBC8aeqqCWvpiBiYQ3jxSr91uiDvmrkyHRdYLUj",
|
||
"previous_ledger" : "0BB01379B51234BAAF501A71C7AB147F595460B689BB9E8252A0B87B5A483623",
|
||
"propose_seq" : 0,
|
||
"transaction_hash" : "4BC2CE596CBD1321775320E2067F9C06D3862826212C16EF42ABB6A2B0414306"
|
||
},
|
||
"5C29005CF4FB479FC49EEFB4A5B075C86DD963CC" : {
|
||
"close_time" : 486082973,
|
||
"peer_id" : "n9L81uNCaPgtUJfaHh89gmdvXKAmSt5Gdsw2g1iPWaPkAHW5Nm4C",
|
||
"previous_ledger" : "0BB01379B51234BAAF501A71C7AB147F595460B689BB9E8252A0B87B5A483623",
|
||
"propose_seq" : 0,
|
||
"transaction_hash" : "4BC2CE596CBD1321775320E2067F9C06D3862826212C16EF42ABB6A2B0414306"
|
||
},
|
||
"EFC49EB648E557CC50A72D715249B80E071F7705" : {
|
||
"close_time" : 486082973,
|
||
"peer_id" : "n949f75evCHwgyP4fPVgaHqNHxUVN15PsJEZ3B3HnXPcPjcZAoy7",
|
||
"previous_ledger" : "0BB01379B51234BAAF501A71C7AB147F595460B689BB9E8252A0B87B5A483623",
|
||
"propose_seq" : 0,
|
||
"transaction_hash" : "4BC2CE596CBD1321775320E2067F9C06D3862826212C16EF42ABB6A2B0414306"
|
||
}
|
||
},
|
||
"previous_mseconds" : 2005,
|
||
"previous_proposers" : 5,
|
||
"proposers" : 5,
|
||
"proposing" : false,
|
||
"state" : "consensus",
|
||
"synched" : true,
|
||
"validating" : false
|
||
},
|
||
"status" : "success"
|
||
}
|
||
}
|
||
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-68-1" style="position: static;"><pre><code>Loading: "/etc/rippled.cfg"
|
||
Connecting to 127.0.0.1:5005
|
||
{
|
||
"result" : {
|
||
"info" : {
|
||
"acquired" : {
|
||
"4BC2CE596CBD1321775320E2067F9C06D3862826212C16EF42ABB6A2B0414306" : "acquired"
|
||
},
|
||
"close_granularity" : 10,
|
||
"close_percent" : 50,
|
||
"close_resolution" : 10,
|
||
"close_times" : {
|
||
"486082972" : 1,
|
||
"486082973" : 4
|
||
},
|
||
"current_ms" : 1003,
|
||
"have_time_consensus" : false,
|
||
"ledger_seq" : 13701086,
|
||
"our_position" : {
|
||
"close_time" : 486082973,
|
||
"previous_ledger" : "0BB01379B51234BAAF501A71C7AB147F595460B689BB9E8252A0B87B5A483623",
|
||
"propose_seq" : 0,
|
||
"transaction_hash" : "4BC2CE596CBD1321775320E2067F9C06D3862826212C16EF42ABB6A2B0414306"
|
||
},
|
||
"peer_positions" : {
|
||
"0A2EAF919033A036D363D4E5610A66209DDBE8EE" : {
|
||
"close_time" : 486082972,
|
||
"peer_id" : "n9KiYM9CgngLvtRCQHZwgC2gjpdaZcCcbt3VboxiNFcKuwFVujzS",
|
||
"previous_ledger" : "0BB01379B51234BAAF501A71C7AB147F595460B689BB9E8252A0B87B5A483623",
|
||
"propose_seq" : 0,
|
||
"transaction_hash" : "4BC2CE596CBD1321775320E2067F9C06D3862826212C16EF42ABB6A2B0414306"
|
||
},
|
||
"1567A8C953A86F8428C7B01641D79BBF2FD508F3" : {
|
||
"close_time" : 486082973,
|
||
"peer_id" : "n9LdgEtkmGB9E2h3K4Vp7iGUaKuq23Zr32ehxiU8FWY7xoxbWTSA",
|
||
"previous_ledger" : "0BB01379B51234BAAF501A71C7AB147F595460B689BB9E8252A0B87B5A483623",
|
||
"propose_seq" : 0,
|
||
"transaction_hash" : "4BC2CE596CBD1321775320E2067F9C06D3862826212C16EF42ABB6A2B0414306"
|
||
},
|
||
"202397A81F20B44CF44EA99AF761295E5A8397D2" : {
|
||
"close_time" : 486082973,
|
||
"peer_id" : "n9MD5h24qrQqiyBC8aeqqCWvpiBiYQ3jxSr91uiDvmrkyHRdYLUj",
|
||
"previous_ledger" : "0BB01379B51234BAAF501A71C7AB147F595460B689BB9E8252A0B87B5A483623",
|
||
"propose_seq" : 0,
|
||
"transaction_hash" : "4BC2CE596CBD1321775320E2067F9C06D3862826212C16EF42ABB6A2B0414306"
|
||
},
|
||
"5C29005CF4FB479FC49EEFB4A5B075C86DD963CC" : {
|
||
"close_time" : 486082973,
|
||
"peer_id" : "n9L81uNCaPgtUJfaHh89gmdvXKAmSt5Gdsw2g1iPWaPkAHW5Nm4C",
|
||
"previous_ledger" : "0BB01379B51234BAAF501A71C7AB147F595460B689BB9E8252A0B87B5A483623",
|
||
"propose_seq" : 0,
|
||
"transaction_hash" : "4BC2CE596CBD1321775320E2067F9C06D3862826212C16EF42ABB6A2B0414306"
|
||
},
|
||
"EFC49EB648E557CC50A72D715249B80E071F7705" : {
|
||
"close_time" : 486082973,
|
||
"peer_id" : "n949f75evCHwgyP4fPVgaHqNHxUVN15PsJEZ3B3HnXPcPjcZAoy7",
|
||
"previous_ledger" : "0BB01379B51234BAAF501A71C7AB147F595460B689BB9E8252A0B87B5A483623",
|
||
"propose_seq" : 0,
|
||
"transaction_hash" : "4BC2CE596CBD1321775320E2067F9C06D3862826212C16EF42ABB6A2B0414306"
|
||
}
|
||
},
|
||
"previous_mseconds" : 2005,
|
||
"previous_proposers" : 5,
|
||
"proposers" : 5,
|
||
"proposing" : false,
|
||
"state" : "consensus",
|
||
"synched" : true,
|
||
"validating" : false
|
||
},
|
||
"status" : "success"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>info</td>
|
||
<td>Object</td>
|
||
<td>Information that may be useful for debugging consensus. This output is subject to change without notice.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>The following is an incomplete summary of fields that may be contained in the <code>info</code> object:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>ledger_seq</td>
|
||
<td>Number</td>
|
||
<td>The sequence number of the ledger currently in the consensus process</td>
|
||
</tr>
|
||
<tr>
|
||
<td>our_position</td>
|
||
<td>Object</td>
|
||
<td>This server's expectation for the ledger in the consensus process.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>peer_positions</td>
|
||
<td>Object</td>
|
||
<td>Map of peers and their proposed versions of the ledger in the consensus process.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>proposers</td>
|
||
<td>Number</td>
|
||
<td>The number of trusted validators participating in this consensus process. Which validators are trusted depends on this server's configuration.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>synched</td>
|
||
<td>Boolean</td>
|
||
<td>Whether this server considers itself in sync with the network.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>state</td>
|
||
<td>String</td>
|
||
<td>What part of the consensus process is currently in progress: <code>open</code>, <code>consensus</code>, <code>finished</code>, or <code>accepted</code>.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>It is also normal to get a minimal result where the only field in <code>info</code> is <code>"consensus": "none"</code>. This indicates that the server is in between consensus rounds.</p>
|
||
<p>The results of the <code>consensus_info</code> command can vary dramatically if you run it several times, even in short succession.</p>
|
||
<h4 id="possible-errors-33">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
</ul>
|
||
<h2 id="fetch-info">fetch_info</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/315a8b6b602798a4cff4d8e1911936011e12abdb/src/ripple/rpc/handlers/FetchInfo.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>fetch_info</code> command returns information about objects that this server is currently fetching from the network, and how many peers have that information. It can also be used to reset current fetches.</p>
|
||
<p><em>The <code>fetch_info</code> method is an <a href="#connecting-to-rippled">admin command</a> that cannot be run by unpriviledged users.</em></p>
|
||
<h4 id="request-format-35">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-69"><ul class="codetabs"><li><a href="#code-69-0">WebSocket</a></li><li><a href="#code-69-1">JSON-RPC</a></li><li><a href="#code-69-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-69-0" style="position: static;"><pre><code>{
|
||
"id": 91,
|
||
"command": "fetch_info",
|
||
"clear": false
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-69-1" style="position: static;"><pre><code>{
|
||
"method": "fetch_info",
|
||
"params": [
|
||
{
|
||
"clear": false
|
||
}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-69-2" style="position: static;"><pre><code>#Syntax: fetch_info [clear]
|
||
rippled fetch_info
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The request includes the following parameters:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>clear</td>
|
||
<td>Boolean</td>
|
||
<td>If <code>true</code>, reset current fetches. Otherwise, only get status of fetches in progress.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="response-format-33">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-70"><ul class="codetabs"><li><a href="#code-70-0">JSON-RPC</a></li><li><a href="#code-70-1">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-70-0" style="position: static;"><pre><code>{
|
||
"result" : {
|
||
"info" : {
|
||
"348928" : {
|
||
"hash" : "C26D432B06F84861BCACD7942EDC3FE0B2E1DEB966A9E516A0FD275A375C2010",
|
||
"have_header" : true,
|
||
"have_state" : false,
|
||
"have_transactions" : true,
|
||
"needed_state_hashes" : [
|
||
"BF8DC6B1E10D1D3565BF0649075D22EBFD34F751AFCC0E53E81D74786BC88922",
|
||
"34E37A71CB51A12C73A435250E6A6349F7884C7EEBA6B88FA31F0244E967E88F",
|
||
"BFB7D3008A7D61FD6A0538D1C2E70CFB94CE8DC66606319C372F278A48629765",
|
||
"41C0C61D701FB1EA586F0EF1FC7A91FEC476D979589DA60507F05C13F7C21975",
|
||
"6DDE8840A2C3C7FF05E5FFEE4D06408694C16A8357338FE0C4581DC3D8A00BBA",
|
||
"6C69D833B582C849917806FA009518832BB50E900E43716FD7CC1966428DD0CF",
|
||
"1EDC020CFC4AF19B625C52E20B66D6AE672821CCC461E8A9C457A3B2955657F7",
|
||
"FC0616A66A2B0589CA513F3341D4EA51E782C4601E5072308478E3CC19264640",
|
||
"19FC607B5DE1B64681A676EC1ED5507B9555B0E098CD9D898320297DE1A64033",
|
||
"5E128D3FC990074E35687387A14AA12D9FD287E5AB57CB9B2FD83DE635DF5CA9",
|
||
"DE72820F3981770F2AA8770BC233B80661F1A452819D8529008875FF8DED87A9",
|
||
"3ACB84BEE2C45556351FF60FD787D235C9CF5623FB8A35B01446B773598E7CC0",
|
||
"0DD3A8DF69874148057F1F2BF305442FF2E89A76A08B4CC8C051E2ED69B874F3",
|
||
"4AE9A9C4F12A5BD0355037DA40A0B145420A2168A9FEDE43E643BD13062F8ECE",
|
||
"08CBF8CFFEC207F5AC4E4F24BC447011FD8C79D25B344281FBFB4732D7058ED4",
|
||
"779B2577C5C4BAED6657421448EA506BBF50F86BE363E0924127C4EA17A58BBE"
|
||
],
|
||
"peers" : 2,
|
||
"timeouts" : 0
|
||
}
|
||
},
|
||
"status" : "success"
|
||
}
|
||
}
|
||
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-70-1" style="position: static;"><pre><code>Loading: "/etc/rippled.cfg"
|
||
Connecting to 127.0.0.1:5005
|
||
{
|
||
"result" : {
|
||
"info" : {
|
||
"348928" : {
|
||
"hash" : "C26D432B06F84861BCACD7942EDC3FE0B2E1DEB966A9E516A0FD275A375C2010",
|
||
"have_header" : true,
|
||
"have_state" : false,
|
||
"have_transactions" : true,
|
||
"needed_state_hashes" : [
|
||
"BF8DC6B1E10D1D3565BF0649075D22EBFD34F751AFCC0E53E81D74786BC88922",
|
||
"34E37A71CB51A12C73A435250E6A6349F7884C7EEBA6B88FA31F0244E967E88F",
|
||
"BFB7D3008A7D61FD6A0538D1C2E70CFB94CE8DC66606319C372F278A48629765",
|
||
"41C0C61D701FB1EA586F0EF1FC7A91FEC476D979589DA60507F05C13F7C21975",
|
||
"6DDE8840A2C3C7FF05E5FFEE4D06408694C16A8357338FE0C4581DC3D8A00BBA",
|
||
"6C69D833B582C849917806FA009518832BB50E900E43716FD7CC1966428DD0CF",
|
||
"1EDC020CFC4AF19B625C52E20B66D6AE672821CCC461E8A9C457A3B2955657F7",
|
||
"FC0616A66A2B0589CA513F3341D4EA51E782C4601E5072308478E3CC19264640",
|
||
"19FC607B5DE1B64681A676EC1ED5507B9555B0E098CD9D898320297DE1A64033",
|
||
"5E128D3FC990074E35687387A14AA12D9FD287E5AB57CB9B2FD83DE635DF5CA9",
|
||
"DE72820F3981770F2AA8770BC233B80661F1A452819D8529008875FF8DED87A9",
|
||
"3ACB84BEE2C45556351FF60FD787D235C9CF5623FB8A35B01446B773598E7CC0",
|
||
"0DD3A8DF69874148057F1F2BF305442FF2E89A76A08B4CC8C051E2ED69B874F3",
|
||
"4AE9A9C4F12A5BD0355037DA40A0B145420A2168A9FEDE43E643BD13062F8ECE",
|
||
"08CBF8CFFEC207F5AC4E4F24BC447011FD8C79D25B344281FBFB4732D7058ED4",
|
||
"779B2577C5C4BAED6657421448EA506BBF50F86BE363E0924127C4EA17A58BBE"
|
||
],
|
||
"peers" : 2,
|
||
"timeouts" : 0
|
||
}
|
||
},
|
||
"status" : "success"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>info</td>
|
||
<td>Object</td>
|
||
<td>Map of objects being fetched and the status of that object being fetched. A ledger being fetched may be identified by its sequence number; ledgers and other objects being fetched may also be identified by their hashes.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>The fields describing a fetch in progress are subject to change without notice. The following fields may be included:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>hash</td>
|
||
<td>String</td>
|
||
<td>The hash of the object being fetched.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>have_header</td>
|
||
<td>Boolean</td>
|
||
<td>For a ledger, whether this server has already obtained the ledger's header section.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>have_transactions</td>
|
||
<td>Boolean</td>
|
||
<td>For a ledger, whether this server has already obtained the transaction section of that ledger.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>needed_state_hashes</td>
|
||
<td>Array of (Hash) Strings</td>
|
||
<td>The hash values of state nodes still needed from this object. If more than 16 are needed, the response contains only the first 16.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>peers</td>
|
||
<td>Number</td>
|
||
<td>The number of peers who have this object available.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>timeouts</td>
|
||
<td>Number</td>
|
||
<td>The number of times that fetching this object has resulted in a timeout (2.5 seconds).</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="possible-errors-34">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
</ul>
|
||
<h2 id="feature">feature</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/develop/src/ripple/rpc/handlers/Feature1.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>feature</code> command returns information about <a href="concept-amendments.html">amendments</a> this server knows about, including whether they are enabled and whether the server is voting in favor of those amendments in the <a href="concept-amendments.html#amendment-process">amendment process</a>. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.31.0">version 0.31.0</a>)</em></p>
|
||
<p>You can use the <code>feature</code> command to temporarily configure the server to vote against or in favor of an amendment. This change does not persist if you restart the server. To make lasting changes in amendment voting, use the <code>rippled.cfg</code> file. See <a href="concept-amendments.html#configuring-amendment-voting">Configuring Amendment Voting</a> for more information.</p>
|
||
<p><em>The <code>feature</code> method is an <a href="#connecting-to-rippled">admin command</a> that cannot be run by unpriviledged users.</em></p>
|
||
<h4 id="request-format-36">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-71"><ul class="codetabs"><li><a href="#code-71-0">WebSocket - list all</a></li><li><a href="#code-71-1">WebSocket - reject</a></li><li><a href="#code-71-2">JSON-RPC</a></li><li><a href="#code-71-3">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-71-0" style="position: static;"><pre><code>{
|
||
"id": "list_all_features",
|
||
"command": "feature"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-71-1" style="position: static;"><pre><code>{
|
||
"id": "reject_multi_sign",
|
||
"command": "feature",
|
||
"feature": "4C97EBA926031A7CF7D7B36FDE3ED66DDA5421192D63DE53FFB46E43B9DC8373",
|
||
"vetoed": true
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-71-2" style="position: static;"><pre><code>{
|
||
"method": "feature",
|
||
"params": [
|
||
{
|
||
"feature": "4C97EBA926031A7CF7D7B36FDE3ED66DDA5421192D63DE53FFB46E43B9DC8373",
|
||
"vetoed": false
|
||
}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-71-3" style="position: static;"><pre><code>#Syntax: feature [<feature_id> [accept|reject]]
|
||
rippled feature 4C97EBA926031A7CF7D7B36FDE3ED66DDA5421192D63DE53FFB46E43B9DC8373 accept
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The request includes the following parameters:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>feature</td>
|
||
<td>String</td>
|
||
<td>(Optional) The unique ID of an amendment, as hexadecimal; or the short name of the amendment. If provided, limits the response to one amendment. Otherwise, the response lists all amendments.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>vetoed</td>
|
||
<td>Boolean</td>
|
||
<td>(Optional; ignored unless <code>feature</code> also specified) If true, instructs the server to vote against the amendment specified by <code>feature</code>. If false, instructs the server to vote in favor of the amendment.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p class="devportal-callout note"><strong>Note:</strong> You can configure your server to vote in favor of a new amendment, even if the server does not currently know how to apply that amendment, by specifying the amendment ID in the <code>feature</code> field. For example, you might want to do this if you plan to upgrade soon to a new <code>rippled</code> version that <em>does</em> support the amendment.</p>
|
||
<h4 id="response-format-34">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-72"><ul class="codetabs"><li><a href="#code-72-0">WebSocket - list all</a></li><li><a href="#code-72-1">WebSocket - reject</a></li><li><a href="#code-72-2">JSON-RPC</a></li><li><a href="#code-72-3">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-72-0" style="position: static;"><pre><code>{
|
||
"id": "list_all_features",
|
||
"status": "success",
|
||
"type": "response",
|
||
"result": {
|
||
"features": {
|
||
"42426C4D4F1009EE67080A9B7965B44656D7714D104A72F9B4369F97ABF044EE": {
|
||
"enabled": false,
|
||
"name": "FeeEscalation",
|
||
"supported": true,
|
||
"vetoed": false
|
||
},
|
||
"4C97EBA926031A7CF7D7B36FDE3ED66DDA5421192D63DE53FFB46E43B9DC8373": {
|
||
"enabled": false,
|
||
"name": "MultiSign",
|
||
"supported": true,
|
||
"vetoed": false
|
||
},
|
||
"6781F8368C4771B83E8B821D88F580202BCB4228075297B19E4FDC5233F1EFDC": {
|
||
"enabled": false,
|
||
"name": "TrustSetAuth",
|
||
"supported": true,
|
||
"vetoed": false
|
||
},
|
||
"C1B8D934087225F509BEB5A8EC24447854713EE447D277F69545ABFA0E0FD490": {
|
||
"enabled": false,
|
||
"name": "Tickets",
|
||
"supported": true,
|
||
"vetoed": false
|
||
},
|
||
"DA1BD556B42D85EA9C84066D028D355B52416734D3283F85E216EA5DA6DB7E13": {
|
||
"enabled": false,
|
||
"name": "SusPay",
|
||
"supported": true,
|
||
"vetoed": false
|
||
}
|
||
}
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-72-1" style="position: static;"><pre><code>{
|
||
"id": "reject_multi_sign",
|
||
"status": "success",
|
||
"type": "response",
|
||
"result": {
|
||
"features": {
|
||
"4C97EBA926031A7CF7D7B36FDE3ED66DDA5421192D63DE53FFB46E43B9DC8373": {
|
||
"enabled": false,
|
||
"name": "MultiSign",
|
||
"supported": true,
|
||
"vetoed": true
|
||
}
|
||
}
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-72-2" style="position: static;"><pre><code>200 OK
|
||
{
|
||
"result": {
|
||
"4C97EBA926031A7CF7D7B36FDE3ED66DDA5421192D63DE53FFB46E43B9DC8373": {
|
||
"enabled": false,
|
||
"name": "MultiSign",
|
||
"supported": true,
|
||
"vetoed": false
|
||
},
|
||
"status": "success"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-72-3" style="position: static;"><pre><code>Loading: "/etc/rippled.cfg"
|
||
Connecting to 127.0.0.1:5005
|
||
{
|
||
"result": {
|
||
"4C97EBA926031A7CF7D7B36FDE3ED66DDA5421192D63DE53FFB46E43B9DC8373": {
|
||
"enabled": false,
|
||
"name": "MultiSign",
|
||
"supported": true,
|
||
"vetoed": false
|
||
},
|
||
"status": "success"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing <strong>a map of amendments</strong> as a JSON object. The keys of the object are amendment IDs. The values for each key are <em>amendment objects</em> that describe the status of the amendment with that ID. If the request specified a <code>feature</code>, the map contains only the requested amendment object, after applying any changes from the request. Each amendment object has the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>enabled</td>
|
||
<td>Boolean</td>
|
||
<td>Whether this amendment is currently enabled in the latest ledger.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>name</td>
|
||
<td>String</td>
|
||
<td>(May be omitted) The human-readable name for this amendment, if known.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>supported</td>
|
||
<td>Boolean</td>
|
||
<td>Whether this server knows how to apply this amendment.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>vetoed</td>
|
||
<td>Boolean</td>
|
||
<td>Whether the server has been instructed to vote against this amendment.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p class="devportal-callout caution"><strong>Caution:</strong> The <code>name</code> for an amendment does not strictly indicate what that amendment does. The name is not guaranteed to be unique or consistent across servers.</p>
|
||
<h4 id="possible-errors-35">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>badFeature</code> - The <code>feature</code> specified was invalidly formatted, or the server does not know an amendment with that name.</li>
|
||
</ul>
|
||
<h2 id="fee">fee</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/release/src/ripple/rpc/handlers/Fee1.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>fee</code> command reports the current state of the open-ledger requirements for the <a href="concept-transaction-cost.html">transaction cost</a>. This requires the <a href="concept-amendments.html#feeescalation">FeeEscalation amendment</a> to be enabled. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.31.0">version 0.31.0</a>)</em></p>
|
||
<p><em>The <code>fee</code> method is an <a href="#connecting-to-rippled">admin command</a> that cannot be run by unpriviledged users.</em></p>
|
||
<h4 id="request-format-37">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-73"><ul class="codetabs"><li><a href="#code-73-0">WebSocket</a></li><li><a href="#code-73-1">JSON-RPC</a></li><li><a href="#code-73-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-73-0" style="position: static;"><pre><code>{
|
||
"id": "fee_websocket_example",
|
||
"command": "fee"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-73-1" style="position: static;"><pre><code>{
|
||
"method": "fee",
|
||
"params": [{}]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-73-2" style="position: static;"><pre><code>#Syntax: fee
|
||
rippled fee
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The request does not include any parameters.</p>
|
||
<h4 id="response-format-35">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-74"><ul class="codetabs"><li><a href="#code-74-0">WebSocket</a></li><li><a href="#code-74-1">JSON-RPC</a></li><li><a href="#code-74-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-74-0" style="position: static;"><pre><code>{
|
||
"id": "fee_websocket_example",
|
||
"status": "success",
|
||
"type": "response",
|
||
"result": {
|
||
"current_ledger_size": "14",
|
||
"current_queue_size": "0",
|
||
"drops": {
|
||
"base_fee": "10",
|
||
"median_fee": "11000",
|
||
"minimum_fee": "10",
|
||
"open_ledger_fee": "10"
|
||
},
|
||
"expected_ledger_size": "24",
|
||
"levels": {
|
||
"median_level": "281600",
|
||
"minimum_level": "256",
|
||
"open_ledger_level": "256",
|
||
"reference_level": "256"
|
||
},
|
||
"max_queue_size": "480"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-74-1" style="position: static;"><pre><code>200 OK
|
||
{
|
||
"result": {
|
||
"current_ledger_size": "56",
|
||
"current_queue_size": "11",
|
||
"drops": {
|
||
"base_fee": "10",
|
||
"median_fee": "10000",
|
||
"minimum_fee": "10",
|
||
"open_ledger_fee": "2653937"
|
||
},
|
||
"expected_ledger_size": "55",
|
||
"levels": {
|
||
"median_level": "256000",
|
||
"minimum_level": "256",
|
||
"open_ledger_level": "67940792",
|
||
"reference_level": "256"
|
||
},
|
||
"max_queue_size": "1100",
|
||
"status": "success"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-74-2" style="position: static;"><pre><code>Loading: "/etc/rippled.cfg"
|
||
Connecting to 127.0.0.1:5005
|
||
{
|
||
"result" : {
|
||
"current_ledger_size" : "16",
|
||
"current_queue_size" : "2",
|
||
"drops" : {
|
||
"base_fee" : "10",
|
||
"median_fee" : "11000",
|
||
"minimum_fee" : "10",
|
||
"open_ledger_fee" : "3203982"
|
||
},
|
||
"expected_ledger_size" : "15",
|
||
"levels" : {
|
||
"median_level" : "281600",
|
||
"minimum_level" : "256",
|
||
"open_ledger_level" : "82021944",
|
||
"reference_level" : "256"
|
||
},
|
||
"max_queue_size" : "300",
|
||
"status" : "success"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>current_ledger_size</td>
|
||
<td>String (Integer)</td>
|
||
<td>Number of transactions provisionally included in the in-progress ledger.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>current_queue_size</td>
|
||
<td>String (Integer)</td>
|
||
<td>Number of transactions currently queued for the next ledger.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>drops</td>
|
||
<td>Object</td>
|
||
<td>Various information about the transaction cost (the <code>Fee</code> field of a transaction), in <a href="#specifying-currency-amounts">drops of xrp</a>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>drops.base_fee</td>
|
||
<td>String (Integer)</td>
|
||
<td>The transaction cost required for a <a href="concept-transaction-cost.html#reference-transaction-cost">reference transaction</a> to be included in a ledger under minimum load, represented in drops of XRP.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>drops.median_fee</td>
|
||
<td>String (Integer)</td>
|
||
<td>An approximation of the median transaction cost among transactions included in the previous validated ledger, represented in drops of XRP.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>drops.minimum_fee</td>
|
||
<td>String (Integer)</td>
|
||
<td>The minimum transaction cost for a <a href="concept-transaction-cost.html#reference-transaction-cost">reference transaction</a> to be queued for a later ledger, represented in drops of XRP. If greater than <code>base_fee</code>, the transaction queue is full.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>drops.open_ledger_fee</td>
|
||
<td>String (Integer)</td>
|
||
<td>The minimum transaction cost that a <a href="concept-transaction-cost.html#reference-transaction-cost">reference transaction</a> must pay to be included in the current open ledger, represented in drops of XRP.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>expected_ledger_size</td>
|
||
<td>String (Integer)</td>
|
||
<td>The approximate number of transactions expected to be included in the current ledger. This is based on the number of transactions in the previous ledger.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>levels</td>
|
||
<td>Object</td>
|
||
<td>Various information about the transaction cost, in <em>fee levels</em>. The ratio in fee levels applies to any transaction relative to the minimum cost of that particular transaction.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>levels.median_level</td>
|
||
<td>String (Integer)</td>
|
||
<td>The median transaction cost among transactions in the previous validated ledger, represented in fee levels.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>levels.minimum_level</td>
|
||
<td>String (Integer)</td>
|
||
<td>The minimum transaction cost required to be queued for a future ledger, represented in fee levels.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>levels.open_ledger_level</td>
|
||
<td>String (Integer)</td>
|
||
<td>The minimum transaction cost required to be included in the current open ledger, represented in fee levels.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>levels.reference_level</td>
|
||
<td>String (Integer)</td>
|
||
<td>The equivalent of the minimum transaction cost, represented in fee levels.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>max_queue_size</td>
|
||
<td>String (Integer)</td>
|
||
<td>The maximum number of transactions that the <a href="concept-transaction-cost.html#queued-transactions">transaction queue</a> can currently hold.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="possible-errors-36">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
</ul>
|
||
<h2 id="get-counts">get_counts</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/c7118a183a660648aa88a3546a6b2c5bce858440/src/ripple/rpc/handlers/GetCounts.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>get_counts</code> command provides various stats about the health of the server, mostly the number of objects of different types that it currently holds in memory.</p>
|
||
<p><em>The <code>get_counts</code> method is an <a href="#connecting-to-rippled">admin command</a> that cannot be run by unpriviledged users.</em></p>
|
||
<h4 id="request-format-38">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-75"><ul class="codetabs"><li><a href="#code-75-0">WebSocket</a></li><li><a href="#code-75-1">JSON-RPC</a></li><li><a href="#code-75-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-75-0" style="position: static;"><pre><code>{
|
||
"id": 90,
|
||
"command": "get_counts",
|
||
"min_count": 100
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-75-1" style="position: static;"><pre><code>{
|
||
"method": "get_counts",
|
||
"params": [
|
||
{
|
||
"min_count": 100
|
||
}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-75-2" style="position: static;"><pre><code>#Syntax: get_counts [min_count]
|
||
rippled get_counts 100
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The request includes the following parameters:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>min_count</td>
|
||
<td>Number (Unsigned Integer)</td>
|
||
<td>Only return fields with a value at least this high.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="response-format-36">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-76"><ul class="codetabs"><li><a href="#code-76-0">JSON-RPC</a></li><li><a href="#code-76-1">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-76-0" style="position: static;"><pre><code>{
|
||
"result" : {
|
||
"AL_hit_rate" : 48.36725616455078,
|
||
"HashRouterEntry" : 3048,
|
||
"Ledger" : 46,
|
||
"NodeObject" : 10417,
|
||
"SLE_hit_rate" : 64.62035369873047,
|
||
"STArray" : 1299,
|
||
"STLedgerEntry" : 646,
|
||
"STObject" : 6987,
|
||
"STTx" : 4104,
|
||
"STValidation" : 610,
|
||
"Transaction" : 4069,
|
||
"dbKBLedger" : 10733,
|
||
"dbKBTotal" : 39069,
|
||
"dbKBTransaction" : 26982,
|
||
"fullbelow_size" : 0,
|
||
"historical_perminute" : 0,
|
||
"ledger_hit_rate" : 71.0565185546875,
|
||
"node_hit_rate" : 3.808214902877808,
|
||
"node_read_bytes" : 393611911,
|
||
"node_reads_hit" : 1283098,
|
||
"node_reads_total" : 679410,
|
||
"node_writes" : 1744285,
|
||
"node_written_bytes" : 794368909,
|
||
"status" : "success",
|
||
"treenode_cache_size" : 6650,
|
||
"treenode_track_size" : 598631,
|
||
"uptime" : "3 hours, 50 minutes, 27 seconds",
|
||
"write_load" : 0
|
||
}
|
||
}
|
||
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-76-1" style="position: static;"><pre><code>Loading: "/etc/rippled.cfg"
|
||
Connecting to 127.0.0.1:5005
|
||
{
|
||
"result" : {
|
||
"AL_hit_rate" : 48.36725616455078,
|
||
"HashRouterEntry" : 3048,
|
||
"Ledger" : 46,
|
||
"NodeObject" : 10417,
|
||
"SLE_hit_rate" : 64.62035369873047,
|
||
"STArray" : 1299,
|
||
"STLedgerEntry" : 646,
|
||
"STObject" : 6987,
|
||
"STTx" : 4104,
|
||
"STValidation" : 610,
|
||
"Transaction" : 4069,
|
||
"dbKBLedger" : 10733,
|
||
"dbKBTotal" : 39069,
|
||
"dbKBTransaction" : 26982,
|
||
"fullbelow_size" : 0,
|
||
"historical_perminute" : 0,
|
||
"ledger_hit_rate" : 71.0565185546875,
|
||
"node_hit_rate" : 3.808214902877808,
|
||
"node_read_bytes" : 393611911,
|
||
"node_reads_hit" : 1283098,
|
||
"node_reads_total" : 679410,
|
||
"node_writes" : 1744285,
|
||
"node_written_bytes" : 794368909,
|
||
"status" : "success",
|
||
"treenode_cache_size" : 6650,
|
||
"treenode_track_size" : 598631,
|
||
"uptime" : "3 hours, 50 minutes, 27 seconds",
|
||
"write_load" : 0
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>. The list of fields contained in the result is subject to change without notice, but it may contain any of the following (among others):</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>Transaction</td>
|
||
<td>Number</td>
|
||
<td>The number of <code>Transaction</code> objects in memory</td>
|
||
</tr>
|
||
<tr>
|
||
<td>Ledger</td>
|
||
<td>Number</td>
|
||
<td>The number of ledgers in memory</td>
|
||
</tr>
|
||
<tr>
|
||
<td>uptime</td>
|
||
<td>String</td>
|
||
<td>The amount of time this server has been running uninterrupted.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>For most other entries, the value indicates the number of objects of that type currently in memory.</p>
|
||
<h4 id="possible-errors-37">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>invalidParams</code> - One or more fields are specified incorrectly, or one or more required fields are missing.</li>
|
||
</ul>
|
||
<h2 id="ledger-cleaner">ledger_cleaner</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/df54b47cd0957a31837493cd69e4d9aade0b5055/src/ripple/rpc/handlers/LedgerCleaner.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>ledger_cleaner</code> command controls the <a href="https://github.com/ripple/rippled/blob/f313caaa73b0ac89e793195dcc2a5001786f916f/src/ripple/app/ledger/README.md#the-ledger-cleaner">Ledger Cleaner</a>, an asynchronous maintenance process that can find and repair corruption in rippled's database of ledgers.</p>
|
||
<p><em>The <code>ledger_cleaner</code> method is an <a href="#connecting-to-rippled">admin command</a> that cannot be run by unpriviledged users.</em></p>
|
||
<h4 id="request-format-39">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-77"><ul class="codetabs"><li><a href="#code-77-0">WebSocket</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-77-0" style="position: static;"><pre><code>{
|
||
"command": "ledger_cleaner",
|
||
"max_ledger": 13818756,
|
||
"min_ledger": 13818000,
|
||
"stop": false
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The request includes the following parameters:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>ledger</td>
|
||
<td>Number (Ledger Sequence Number)</td>
|
||
<td>(Optional) If provided, check and correct this specific ledger only.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>max_ledger</td>
|
||
<td>Number (Ledger Sequence Number)</td>
|
||
<td>(Optional) Configure the ledger cleaner to check ledgers with sequence numbers equal or lower than this.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>min_ledger</td>
|
||
<td>Number (Ledger Sequence Number)</td>
|
||
<td>(Optional) Configure the ledger cleaner to check ledgers with sequence numbers equal or higher than this.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>full</td>
|
||
<td>Boolean</td>
|
||
<td>(Optional) If true, fix ledger state nodes and transations in the specified ledger(s). Defaults to false. Automatically set to <code>true</code> if <code>ledger</code> is provided.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>fix_txns</td>
|
||
<td>Boolean</td>
|
||
<td>(Optional) If true, correct transaction in the specified ledger(s). Overrides <code>full</code> if provided.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>check_nodes</td>
|
||
<td>Boolean</td>
|
||
<td>(Optional) If true, correct ledger state nodes in the specified ledger(s). Overrides <code>full</code> if provided.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>stop</td>
|
||
<td>Boolean</td>
|
||
<td>(Optional) If true, disable the ledger cleaner.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="response-format-37">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-78"><ul class="codetabs"><li><a href="#code-78-0">JSON-RPC</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-78-0" style="position: static;"><pre><code>200 OK
|
||
{
|
||
"result" : {
|
||
"message" : "Cleaner configured",
|
||
"status" : "success"
|
||
}
|
||
}
|
||
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>message</td>
|
||
<td>String</td>
|
||
<td><code>Cleaner configured</code> on success.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="possible-errors-38">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>internal</code> if one the parameters was specified in a way that the server couldn't interpret. (This is a bug, and it should return <code>invalidParams</code> instead.)</li>
|
||
</ul>
|
||
<h2 id="log-level">log_level</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/155fcdbcd0b4927152892c8c8be01d9cf62bed68/src/ripple/rpc/handlers/LogLevel.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>log_level</code> command changes the <code>rippled</code> server's logging verbosity, or returns the current logging level for each category (called a <em>partition</em>) of log messages.</p>
|
||
<p><em>The <code>log_level</code> method is an <a href="#connecting-to-rippled">admin command</a> that cannot be run by unpriviledged users.</em></p>
|
||
<h4 id="request-format-40">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-79"><ul class="codetabs"><li><a href="#code-79-0">WebSocket</a></li><li><a href="#code-79-1">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-79-0" style="position: static;"><pre><code>{
|
||
"id": "ll1",
|
||
"command": "log_level",
|
||
"severity": "debug",
|
||
"partition": "PathRequest"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-79-1" style="position: static;"><pre><code>#Syntax: log_level [[partition] severity]
|
||
rippled log_level PathRequest debug
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The request includes the following parameters:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>severity</td>
|
||
<td>String</td>
|
||
<td>(Optional) What level of verbosity to set logging at. Valid values are, in order from least to most verbose: <code>fatal</code>, <code>error</code>, <code>warn</code>, <code>info</code>, <code>debug</code>, and <code>trace</code>. If omitted, return current log verbosity for all categories.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>partition</td>
|
||
<td>String</td>
|
||
<td>(Optional) Ignored unless <code>severity</code> is provided. Which logging category to modify. If omitted, or if provided with the value <code>base</code>, set logging level for all categories.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="response-format-38">Response Format</h4>
|
||
<p>Examples of successful responses:</p>
|
||
<div class="multicode" id="code-80"><ul class="codetabs"><li><a href="#code-80-0">Commandline (set log level)</a></li><li><a href="#code-80-1">Commandline (check log levels)</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-80-0" style="position: static;"><pre><code>Loading: "/etc/rippled.cfg"
|
||
Connecting to 127.0.0.1:5005
|
||
{
|
||
"result" : {
|
||
"status" : "success"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-80-1" style="position: static;"><pre><code>Loading: "/etc/rippled.cfg"
|
||
Connecting to 127.0.0.1:5005
|
||
{
|
||
"result" : {
|
||
"levels" : {
|
||
"AmendmentTable" : "Error",
|
||
"Application" : "Error",
|
||
"CancelOffer" : "Error",
|
||
"Collector" : "Error",
|
||
"CreateOffer" : "Error",
|
||
"DeferredCredits" : "Error",
|
||
"FeeVote" : "Error",
|
||
"InboundLedger" : "Error",
|
||
"JobQueue" : "Error",
|
||
"Ledger" : "Error",
|
||
"LedgerCleaner" : "Error",
|
||
"LedgerConsensus" : "Error",
|
||
"LedgerEntrySet" : "Error",
|
||
"LedgerMaster" : "Error",
|
||
"LedgerTiming" : "Error",
|
||
"LoadManager" : "Error",
|
||
"LoadMonitor" : "Error",
|
||
"NetworkOPs" : "Error",
|
||
"NodeObject" : "Error",
|
||
"OrderBookDB" : "Error",
|
||
"Overlay" : "Error",
|
||
"PathRequest" : "Debug",
|
||
"Payment" : "Error",
|
||
"Peer" : "Error",
|
||
"PeerFinder" : "Error",
|
||
"Protocol" : "Error",
|
||
"RPC" : "Error",
|
||
"RPCErr" : "Error",
|
||
"RPCHandler" : "Error",
|
||
"RPCManager" : "Error",
|
||
"Resolver" : "Error",
|
||
"Resource" : "Error",
|
||
"RippleCalc" : "Error",
|
||
"SHAMap" : "Error",
|
||
"SHAMapStore" : "Error",
|
||
"SNTPClient" : "Error",
|
||
"STAmount" : "Error",
|
||
"SerializedLedger" : "Error",
|
||
"Server" : "Error",
|
||
"SetAccount" : "Error",
|
||
"SetTrust" : "Error",
|
||
"TaggedCache" : "Error",
|
||
"TransactionAcquire" : "Error",
|
||
"TransactionEngine" : "Error",
|
||
"UVL" : "Error",
|
||
"UniqueNodeList" : "Error",
|
||
"Validations" : "Error",
|
||
"WALCheckpointer" : "Error",
|
||
"WebSocket" : "Trace",
|
||
"base" : "Error"
|
||
},
|
||
"status" : "success"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>. The response format depends on whether the request specified a <code>severity</code>. If it did, the log level is changed and a successful result contains no additional fields.</p>
|
||
<p>Otherwise, the request contains the following field:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>level</td>
|
||
<td>Object</td>
|
||
<td>The current log levels of each category. This list of categories is subject to change without notice in future releases. You can use the field names as values to <code>partition</code> in requests to this command.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="possible-errors-39">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>invalidParams</code> - One or more fields are specified incorrectly, or one or more required fields are missing.</li>
|
||
</ul>
|
||
<h2 id="logrotate">logrotate</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/743bd6c9175c472814448ea889413be79dfd1c07/src/ripple/rpc/handlers/LogRotate.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>logrotate</code> command closes and reopens the log file. This is intended to help with log rotation on Linux file systems.</p>
|
||
<p><em>The <code>logrotate</code> method is an <a href="#connecting-to-rippled">admin command</a> that cannot be run by unpriviledged users.</em></p>
|
||
<h4 id="request-format-41">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-81"><ul class="codetabs"><li><a href="#code-81-0">WebSocket</a></li><li><a href="#code-81-1">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-81-0" style="position: static;"><pre><code>{
|
||
"id": "lr1",
|
||
"command": "logrotate"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-81-1" style="position: static;"><pre><code>rippled logrotate
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The request includes no parameters.</p>
|
||
<h4 id="response-format-39">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-82"><ul class="codetabs"><li><a href="#code-82-0">JSON-RPC</a></li><li><a href="#code-82-1">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-82-0" style="position: static;"><pre><code>200 OK
|
||
{
|
||
"result" : {
|
||
"message" : "The log file was closed and reopened.",
|
||
"status" : "success"
|
||
}
|
||
}
|
||
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-82-1" style="position: static;"><pre><code>Loading: "/etc/rippled.cfg"
|
||
Connecting to 127.0.0.1:5005
|
||
{
|
||
"result" : {
|
||
"message" : "The log file was closed and reopened.",
|
||
"status" : "success"
|
||
}
|
||
}
|
||
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>message</td>
|
||
<td>String</td>
|
||
<td>On success, contains the message <code>The log file was closed and reopened.</code></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="possible-errors-40">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
</ul>
|
||
<h2 id="validation-create">validation_create</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/315a8b6b602798a4cff4d8e1911936011e12abdb/src/ripple/rpc/handlers/ValidationCreate.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>Use the <code>validation_create</code> command to generate the keys for a rippled <a href="tutorial-rippled-setup.html#validator-setup">validating node</a>. Similar to the <a href="#wallet-propose">wallet_propose</a> command, this command makes no real changes, but only generates a set of keys in the proper format.</p>
|
||
<p><em>The <code>validation_create</code> method is an <a href="#connecting-to-rippled">admin command</a> that cannot be run by unpriviledged users.</em></p>
|
||
<h4 id="request-format-42">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-83"><ul class="codetabs"><li><a href="#code-83-0">WebSocket</a></li><li><a href="#code-83-1">JSON-RPC</a></li><li><a href="#code-83-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-83-0" style="position: static;"><pre><code>{
|
||
"id": 0,
|
||
"command": "validation_create",
|
||
"secret": "BAWL MAN JADE MOON DOVE GEM SON NOW HAD ADEN GLOW TIRE"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-83-1" style="position: static;"><pre><code>{
|
||
"method": "validation_create",
|
||
"params": [
|
||
{
|
||
"secret": "BAWL MAN JADE MOON DOVE GEM SON NOW HAD ADEN GLOW TIRE"
|
||
}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-83-2" style="position: static;"><pre><code>#Syntax: validation_create [secret]
|
||
rippled validation_create "BAWL MAN JADE MOON DOVE GEM SON NOW HAD ADEN GLOW TIRE"
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The request includes the following parameters:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>secret</td>
|
||
<td>String</td>
|
||
<td>(Optional) Use this value as a seed to generate the credentials. The same secret always generates the same credentials. You can provide the seed in <a href="https://tools.ietf.org/html/rfc1751">RFC-1751</a> format or Ripple's base-58 format. If omitted, generate a random seed.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p class="devportal-callout note"><strong>Note:</strong> The security of your validator depends on the entropy of your seed. Do not use a secret value that is not sufficiently randomized for real business purposes. We recommend omitting the <code>secret</code> when generating new credentials for the first time.</p>
|
||
<h4 id="response-format-40">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-84"><ul class="codetabs"><li><a href="#code-84-0">JSON-RPC</a></li><li><a href="#code-84-1">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-84-0" style="position: static;"><pre><code>{
|
||
"result" : {
|
||
"status" : "success",
|
||
"validation_key" : "FAWN JAVA JADE HEAL VARY HER REEL SHAW GAIL ARCH BEN IRMA",
|
||
"validation_public_key" : "n9Mxf6qD4J55XeLSCEpqaePW4GjoCR5U1ZeGZGJUCNe3bQa4yQbG",
|
||
"validation_seed" : "ssZkdwURFMBXenJPbrpE14b6noJSu"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-84-1" style="position: static;"><pre><code>Loading: "/etc/rippled.cfg"
|
||
Connecting to 127.0.0.1:5005
|
||
{
|
||
"result" : {
|
||
"status" : "success",
|
||
"validation_key" : "FAWN JAVA JADE HEAL VARY HER REEL SHAW GAIL ARCH BEN IRMA",
|
||
"validation_public_key" : "n9Mxf6qD4J55XeLSCEpqaePW4GjoCR5U1ZeGZGJUCNe3bQa4yQbG",
|
||
"validation_seed" : "ssZkdwURFMBXenJPbrpE14b6noJSu"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>validation_key</td>
|
||
<td>String</td>
|
||
<td>The secret key for these validation credentials, in <a href="https://tools.ietf.org/html/rfc1751">RFC-1751</a> format.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>validation_public_key</td>
|
||
<td>String</td>
|
||
<td>The public key for these validation credentials, in Ripple's base-58 encoded string format.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>validation_seed</td>
|
||
<td>String</td>
|
||
<td>The secret key for these validation credentials, in Ripple's base-58 encoded string format.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="possible-errors-41">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>badSeed</code> - The request provided an invalid seed value. This usually means that the seed value appears to be a valid string of a different format, such as an account address or validation public key.</li>
|
||
</ul>
|
||
<h2 id="validation-seed">validation_seed</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/a61ffab3f9010d8accfaa98aa3cacc7d38e74121/src/ripple/rpc/handlers/ValidationSeed.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>validation_seed</code> command temporarily sets the secret value that rippled uses to sign validations. This value resets based on the config file when you restart the server.</p>
|
||
<p><em>The <code>validation_seed</code> request is an <a href="#connecting-to-rippled">admin command</a> that cannot be run by unpriviledged users!</em></p>
|
||
<h4 id="request-format-43">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-85"><ul class="codetabs"><li><a href="#code-85-0">WebSocket</a></li><li><a href="#code-85-1">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-85-0" style="position: static;"><pre><code>{
|
||
"id": "set_seed_1",
|
||
"command": "validation_seed",
|
||
"secret": "BAWL MAN JADE MOON DOVE GEM SON NOW HAD ADEN GLOW TIRE"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-85-1" style="position: static;"><pre><code>#Syntax: validation_seed [secret]
|
||
rippled validation_seed 'BAWL MAN JADE MOON DOVE GEM SON NOW HAD ADEN GLOW TIRE'
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The request includes the following parameters:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>secret</td>
|
||
<td>String</td>
|
||
<td>(Optional) If present, use this value as the secret value for the validating key pair. Valid formats include base-58, <a href="https://tools.ietf.org/html/rfc1751">RFC-1751</a>, or as a passphrase. If omitted, disables proposing validations to the network.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="response-format-41">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-86"><ul class="codetabs"><li><a href="#code-86-0">JSON-RPC</a></li><li><a href="#code-86-1">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-86-0" style="position: static;"><pre><code>200 OK
|
||
{
|
||
"result" : {
|
||
"status" : "success",
|
||
"validation_key" : "BAWL MAN JADE MOON DOVE GEM SON NOW HAD ADEN GLOW TIRE",
|
||
"validation_public_key" : "n9Jx6RS6zSgqsgnuWJifNA9EqgjTKAywqYNReK5NRd1yLBbfC3ng",
|
||
"validation_seed" : "snjJkyBGogTem5dFGbcRaThKq2Rt3"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-86-1" style="position: static;"><pre><code>Loading: "/etc/rippled.cfg"
|
||
Connecting to 127.0.0.1:5005
|
||
{
|
||
"result" : {
|
||
"status" : "success",
|
||
"validation_key" : "BAWL MAN JADE MOON DOVE GEM SON NOW HAD ADEN GLOW TIRE",
|
||
"validation_public_key" : "n9Jx6RS6zSgqsgnuWJifNA9EqgjTKAywqYNReK5NRd1yLBbfC3ng",
|
||
"validation_seed" : "snjJkyBGogTem5dFGbcRaThKq2Rt3"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>validation_key</td>
|
||
<td>String</td>
|
||
<td>(Omitted if proposing disabled) The secret key for these validation credentials, in <a href="https://tools.ietf.org/html/rfc1751">RFC-1751</a> format.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>validation_public_key</td>
|
||
<td>String</td>
|
||
<td>(Omitted if proposing disabled) The public key for these validation credentials, in Ripple's base-58 encoded string format.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>validation_seed</td>
|
||
<td>String</td>
|
||
<td>(Omitted if proposing disabled) The secret key for these validation credentials, in Ripple's base-58 encoded string format.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="possible-errors-42">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>badSeed</code> - The request provided an invalid secret value. This usually means that the secret value appears to be a valid string of a different format, such as an account address or validation public key.</li>
|
||
</ul>
|
||
<h2 id="peers">peers</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/52f298f150fc1530d201d3140c80d3eaf781cb5f/src/ripple/rpc/handlers/Peers.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>peers</code> command returns a list of all other <code>rippled</code> servers currently connected to this one, including information on their connection and sync status.</p>
|
||
<p><em>The <code>peers</code> request is an <a href="#connecting-to-rippled">admin command</a> that cannot be run by unpriviledged users!</em></p>
|
||
<h4 id="request-format-44">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-87"><ul class="codetabs"><li><a href="#code-87-0">WebSocket</a></li><li><a href="#code-87-1">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-87-0" style="position: static;"><pre><code>{
|
||
"id": 2,
|
||
"command": "peers"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-87-1" style="position: static;"><pre><code>rippled peers
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The request includes no additional parameters.</p>
|
||
<h4 id="response-format-42">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-88"><ul class="codetabs"><li><a href="#code-88-0">WebSocket</a></li><li><a href="#code-88-1">JSON-RPC</a></li><li><a href="#code-88-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-88-0" style="position: static;"><pre><code>{
|
||
"id": 2,
|
||
"status": "success",
|
||
"type": "response",
|
||
"result": {
|
||
"cluster": {},
|
||
"peers": [
|
||
{
|
||
"address": "184.172.237.226:51235",
|
||
"complete_ledgers": "14534883 - 18828973",
|
||
"latency": 117,
|
||
"ledger": "50A2577CE6EB8A92847C443BDA45F5C5F0A22B9C6F4B47DBA0C12BDA75001D01",
|
||
"load": 54,
|
||
"public_key": "n9KNYm52mgcUQ7R2RA4kyw9Nk1yc6S35PaiuyqjYsy6UjhCXpw12",
|
||
"uptime": 55036,
|
||
"version": "rippled-0.30.0-hf1"
|
||
},
|
||
{
|
||
"address": "54.186.248.91:51235",
|
||
"complete_ledgers": "18827949 - 18828973",
|
||
"latency": 91,
|
||
"ledger": "50A2577CE6EB8A92847C443BDA45F5C5F0A22B9C6F4B47DBA0C12BDA75001D01",
|
||
"load": 62,
|
||
"public_key": "n9MT5EjnV912KGuBUqPs4tpdhzMPGcnDBrTuWkD9sWQHJ1kDcUcz",
|
||
"uptime": 83814,
|
||
"version": "rippled-0.30.1"
|
||
},
|
||
{
|
||
"address": "54.84.21.230:51235",
|
||
"complete_ledgers": "18827949 - 18828973",
|
||
"latency": 202,
|
||
"ledger": "50A2577CE6EB8A92847C443BDA45F5C5F0A22B9C6F4B47DBA0C12BDA75001D01",
|
||
"load": 60,
|
||
"public_key": "n9KJb7NMxGySRcjCqh69xEPMUhwJx22qntYYXsnUqYgjsJhNoW7g",
|
||
"uptime": 99625,
|
||
"version": "rippled-0.30.1"
|
||
},
|
||
{
|
||
"address": "72.251.233.162:51235",
|
||
"complete_ledgers": "18827949 - 18828973",
|
||
"latency": 36,
|
||
"ledger": "50A2577CE6EB8A92847C443BDA45F5C5F0A22B9C6F4B47DBA0C12BDA75001D01",
|
||
"load": 66,
|
||
"public_key": "n9M8RSk6hrvXZKFQ6CxPbJsjt73xW1xsnjn7G69VAMbE2j4sBQNQ",
|
||
"uptime": 99619,
|
||
"version": "rippled-0.30.1"
|
||
},
|
||
{
|
||
"address": "162.217.98.136:51235",
|
||
"complete_ledgers": "32570 - 18828973",
|
||
"latency": 118,
|
||
"ledger": "50A2577CE6EB8A92847C443BDA45F5C5F0A22B9C6F4B47DBA0C12BDA75001D01",
|
||
"load": 69,
|
||
"public_key": "n944PcXEoZaiEHnwFD92xA4bxsS7jjYb27WcdDQwkHYyk1MWTEsX",
|
||
"uptime": 99625,
|
||
"version": "rippled-0.30.1"
|
||
},
|
||
{
|
||
"address": "72.251.233.163:51235",
|
||
"complete_ledgers": "18827949 - 18828973",
|
||
"latency": 51,
|
||
"ledger": "50A2577CE6EB8A92847C443BDA45F5C5F0A22B9C6F4B47DBA0C12BDA75001D01",
|
||
"load": 61,
|
||
"public_key": "n94ne2Z5dX8qcJNa8cPtAbtn21gEaCoEduS8TwdGAhi1iLfCUMDm",
|
||
"uptime": 99625,
|
||
"version": "rippled-0.30.1"
|
||
},
|
||
{
|
||
"address": "54.186.73.52:51235",
|
||
"complete_ledgers": "18827949 - 18828973",
|
||
"latency": 72,
|
||
"ledger": "50A2577CE6EB8A92847C443BDA45F5C5F0A22B9C6F4B47DBA0C12BDA75001D01",
|
||
"load": 60,
|
||
"public_key": "n9JySgyBVcQKvyDoeRKg7s2Mm6ZcFHk22vUZb3o1HSosWxcj9xPt",
|
||
"uptime": 99625,
|
||
"version": "rippled-0.30.1"
|
||
},
|
||
{
|
||
"address": "72.251.233.165:51235",
|
||
"complete_ledgers": "18827949 - 18828973",
|
||
"latency": 40,
|
||
"ledger": "50A2577CE6EB8A92847C443BDA45F5C5F0A22B9C6F4B47DBA0C12BDA75001D01",
|
||
"load": 63,
|
||
"public_key": "n9M77Uc9CSaSFZqt5V7sxPR4kFwbha7hwUFBD5v5kZt2SQjBeoDs",
|
||
"uptime": 99625,
|
||
"version": "rippled-0.30.1"
|
||
},
|
||
{
|
||
"address": "72.251.232.173:51235",
|
||
"complete_ledgers": "32570 - 18828973",
|
||
"latency": 40,
|
||
"ledger": "50A2577CE6EB8A92847C443BDA45F5C5F0A22B9C6F4B47DBA0C12BDA75001D01",
|
||
"load": 71,
|
||
"public_key": "n9JveA1hHDGjZECaYC7KM4JP8NXXzNXAxixbzcLTGnrsFZsA9AD1",
|
||
"uptime": 99625,
|
||
"version": "rippled-0.31.0-b6"
|
||
},
|
||
{
|
||
"address": "98.167.120.212:51235",
|
||
"complete_ledgers": "18828845 - 18828973",
|
||
"latency": 99,
|
||
"ledger": "50A2577CE6EB8A92847C443BDA45F5C5F0A22B9C6F4B47DBA0C12BDA75001D01",
|
||
"load": 60,
|
||
"public_key": "n9LDBRoqPYY7RdkNXbX1dqZXVtUKcSqzs2CZPhTH7ymA9X7Xzmpj",
|
||
"uptime": 99625,
|
||
"version": "rippled-0.30.1-rc4"
|
||
}
|
||
]
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-88-1" style="position: static;"><pre><code>{
|
||
"result" : {
|
||
"cluster" : {},
|
||
"peers" : [
|
||
{
|
||
"address" : "184.172.237.226:51235",
|
||
"complete_ledgers" : "14535005 - 18828957",
|
||
"latency" : 114,
|
||
"ledger" : "80FCB89BC5B90D2B9C2CE33786738809796F04FB9CB1E5EEE768DD9A9C399FB0",
|
||
"load" : 47,
|
||
"public_key" : "n9KNYm52mgcUQ7R2RA4kyw9Nk1yc6S35PaiuyqjYsy6UjhCXpw12",
|
||
"uptime" : 54976,
|
||
"version" : "rippled-0.30.0-hf1"
|
||
},
|
||
{
|
||
"address" : "54.186.248.91:51235",
|
||
"complete_ledgers" : "18827934 - 18828958",
|
||
"latency" : 68,
|
||
"ledger" : "9447480E351221123B1A454356435A66C188D9794B0197A060637E19F074B421",
|
||
"load" : 56,
|
||
"public_key" : "n9MT5EjnV912KGuBUqPs4tpdhzMPGcnDBrTuWkD9sWQHJ1kDcUcz",
|
||
"uptime" : 83754,
|
||
"version" : "rippled-0.30.1"
|
||
},
|
||
{
|
||
"address" : "54.84.21.230:51235",
|
||
"complete_ledgers" : "18827934 - 18828958",
|
||
"latency" : 135,
|
||
"ledger" : "9447480E351221123B1A454356435A66C188D9794B0197A060637E19F074B421",
|
||
"load" : 54,
|
||
"public_key" : "n9KJb7NMxGySRcjCqh69xEPMUhwJx22qntYYXsnUqYgjsJhNoW7g",
|
||
"uptime" : 99565,
|
||
"version" : "rippled-0.30.1"
|
||
},
|
||
{
|
||
"address" : "72.251.233.162:51235",
|
||
"complete_ledgers" : "18827934 - 18828958",
|
||
"latency" : 24,
|
||
"ledger" : "9447480E351221123B1A454356435A66C188D9794B0197A060637E19F074B421",
|
||
"load" : 61,
|
||
"public_key" : "n9M8RSk6hrvXZKFQ6CxPbJsjt73xW1xsnjn7G69VAMbE2j4sBQNQ",
|
||
"uptime" : 99560,
|
||
"version" : "rippled-0.30.1"
|
||
},
|
||
{
|
||
"address" : "162.217.98.136:51235",
|
||
"complete_ledgers" : "32570 - 18828958",
|
||
"latency" : 88,
|
||
"ledger" : "9447480E351221123B1A454356435A66C188D9794B0197A060637E19F074B421",
|
||
"load" : 55,
|
||
"public_key" : "n944PcXEoZaiEHnwFD92xA4bxsS7jjYb27WcdDQwkHYyk1MWTEsX",
|
||
"uptime" : 99566,
|
||
"version" : "rippled-0.30.1"
|
||
},
|
||
{
|
||
"address" : "72.251.233.163:51235",
|
||
"complete_ledgers" : "18827934 - 18828958",
|
||
"latency" : 24,
|
||
"ledger" : "9447480E351221123B1A454356435A66C188D9794B0197A060637E19F074B421",
|
||
"load" : 56,
|
||
"public_key" : "n94ne2Z5dX8qcJNa8cPtAbtn21gEaCoEduS8TwdGAhi1iLfCUMDm",
|
||
"uptime" : 99566,
|
||
"version" : "rippled-0.30.1"
|
||
},
|
||
{
|
||
"address" : "54.186.73.52:51235",
|
||
"complete_ledgers" : "18827934 - 18828958",
|
||
"latency" : 51,
|
||
"ledger" : "9447480E351221123B1A454356435A66C188D9794B0197A060637E19F074B421",
|
||
"load" : 56,
|
||
"public_key" : "n9JySgyBVcQKvyDoeRKg7s2Mm6ZcFHk22vUZb3o1HSosWxcj9xPt",
|
||
"uptime" : 99566,
|
||
"version" : "rippled-0.30.1"
|
||
},
|
||
{
|
||
"address" : "72.251.233.165:51235",
|
||
"complete_ledgers" : "18827934 - 18828958",
|
||
"latency" : 25,
|
||
"ledger" : "9447480E351221123B1A454356435A66C188D9794B0197A060637E19F074B421",
|
||
"load" : 56,
|
||
"public_key" : "n9M77Uc9CSaSFZqt5V7sxPR4kFwbha7hwUFBD5v5kZt2SQjBeoDs",
|
||
"uptime" : 99566,
|
||
"version" : "rippled-0.30.1"
|
||
},
|
||
{
|
||
"address" : "72.251.232.173:51235",
|
||
"complete_ledgers" : "32570 - 18828958",
|
||
"latency" : 24,
|
||
"ledger" : "9447480E351221123B1A454356435A66C188D9794B0197A060637E19F074B421",
|
||
"load" : 81,
|
||
"public_key" : "n9JveA1hHDGjZECaYC7KM4JP8NXXzNXAxixbzcLTGnrsFZsA9AD1",
|
||
"uptime" : 99566,
|
||
"version" : "rippled-0.31.0-b6"
|
||
},
|
||
{
|
||
"address" : "98.167.120.212:51235",
|
||
"complete_ledgers" : "18828830 - 18828957",
|
||
"latency" : 137,
|
||
"ledger" : "9447480E351221123B1A454356435A66C188D9794B0197A060637E19F074B421",
|
||
"load" : 54,
|
||
"public_key" : "n9LDBRoqPYY7RdkNXbX1dqZXVtUKcSqzs2CZPhTH7ymA9X7Xzmpj",
|
||
"uptime" : 99566,
|
||
"version" : "rippled-0.30.1-rc4"
|
||
}
|
||
],
|
||
"status" : "success"
|
||
}
|
||
}
|
||
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-88-2" style="position: static;"><pre><code>Loading: "/etc/rippled.cfg"
|
||
Connecting to 127.0.0.1:5005
|
||
{
|
||
"result" : {
|
||
"cluster" : {},
|
||
"peers" : [
|
||
{
|
||
"address" : "72.251.232.173:51235",
|
||
"complete_ledgers" : "32570 - 18851276",
|
||
"latency" : 22,
|
||
"ledger" : "592C723DDBB1C5119F0D8288894060C83C8C2975A061D7C9971427D6798098F5",
|
||
"load" : 20,
|
||
"public_key" : "n9JveA1hHDGjZECaYC7KM4JP8NXXzNXAxixbzcLTGnrsFZsA9AD1",
|
||
"uptime" : 26,
|
||
"version" : "rippled-0.31.0-b6"
|
||
},
|
||
{
|
||
"address" : "169.53.155.36:51235",
|
||
"complete_ledgers" : "12920801 - 18851275",
|
||
"latency" : 127,
|
||
"load" : 16,
|
||
"public_key" : "n9L42gouyppsmsMXXUdByXnVDUZv1eu6KLZUWUkNHsukzv3pr7po",
|
||
"uptime" : 18,
|
||
"version" : "rippled-0.30.0-hf1"
|
||
},
|
||
{
|
||
"address" : "169.53.155.44:51235",
|
||
"complete_ledgers" : "12920779 - 18851276",
|
||
"latency" : 20,
|
||
"ledger" : "592C723DDBB1C5119F0D8288894060C83C8C2975A061D7C9971427D6798098F5",
|
||
"load" : 49,
|
||
"public_key" : "n94BpoEqEf1PxpAv3Bmyy2WoKHyeMpHPH4tcj6P9NW98zdzEyRhi",
|
||
"uptime" : 50,
|
||
"version" : "rippled-0.30.0-hf1"
|
||
},
|
||
{
|
||
"address" : "192.170.145.77:51235",
|
||
"complete_ledgers" : "32570 - 18851277",
|
||
"latency" : 145,
|
||
"ledger" : "592C723DDBB1C5119F0D8288894060C83C8C2975A061D7C9971427D6798098F5",
|
||
"load" : 29,
|
||
"public_key" : "n9LwcmtjDAJQz4u8DZCMGQ9GXHuMEV4Cf8KpPL9NgqAV2puxdYc2",
|
||
"uptime" : 51,
|
||
"version" : "rippled-0.30.1"
|
||
},
|
||
{
|
||
"address" : "162.217.98.136:51235",
|
||
"complete_ledgers" : "32570 - 18851277",
|
||
"latency" : 83,
|
||
"ledger" : "592C723DDBB1C5119F0D8288894060C83C8C2975A061D7C9971427D6798098F5",
|
||
"load" : 30,
|
||
"public_key" : "n944PcXEoZaiEHnwFD92xA4bxsS7jjYb27WcdDQwkHYyk1MWTEsX",
|
||
"uptime" : 50,
|
||
"version" : "rippled-0.30.1"
|
||
},
|
||
{
|
||
"address" : "184.172.237.241:51235",
|
||
"complete_ledgers" : "14153089 - 18851277",
|
||
"latency" : 104,
|
||
"ledger" : "592C723DDBB1C5119F0D8288894060C83C8C2975A061D7C9971427D6798098F5",
|
||
"load" : 29,
|
||
"public_key" : "n9L3LdCTVYUhCKtQtxiHrQ5ocNXVqZFiEJpF5pX9DXahYLrvi5R7",
|
||
"uptime" : 51,
|
||
"version" : "rippled-0.30.0-hf1"
|
||
},
|
||
{
|
||
"address" : "99.110.49.91:51301",
|
||
"complete_ledgers" : "32570 - 18851277",
|
||
"latency" : 152,
|
||
"ledger" : "592C723DDBB1C5119F0D8288894060C83C8C2975A061D7C9971427D6798098F5",
|
||
"load" : 55,
|
||
"public_key" : "n9LGv3xKVqhxq6vcTfmJZhxyhjywsZbvJvpFbZRXzzz5uQ64xTLy",
|
||
"uptime" : 51,
|
||
"version" : "rippled-0.31.0-b6"
|
||
},
|
||
{
|
||
"address" : "169.53.155.45:51235",
|
||
"complete_ledgers" : "12920779 - 18851277",
|
||
"latency" : 15,
|
||
"ledger" : "592C723DDBB1C5119F0D8288894060C83C8C2975A061D7C9971427D6798098F5",
|
||
"load" : 30,
|
||
"public_key" : "n9MRiHyMk43YpqATWeT8Zyu4HJq1btb5oNKmnHTkLJKQg9LQQq3v",
|
||
"uptime" : 51,
|
||
"version" : "rippled-0.30.0-hf1"
|
||
},
|
||
{
|
||
"address" : "54.186.248.91:51235",
|
||
"complete_ledgers" : "18850253 - 18851277",
|
||
"latency" : 63,
|
||
"ledger" : "592C723DDBB1C5119F0D8288894060C83C8C2975A061D7C9971427D6798098F5",
|
||
"load" : 36,
|
||
"public_key" : "n9MT5EjnV912KGuBUqPs4tpdhzMPGcnDBrTuWkD9sWQHJ1kDcUcz",
|
||
"uptime" : 51,
|
||
"version" : "rippled-0.30.1"
|
||
}
|
||
],
|
||
"status" : "success"
|
||
}
|
||
}
|
||
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing a JSON object with the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>cluster</td>
|
||
<td>Object</td>
|
||
<td>Summary of other <code>rippled</code> servers in the same cluster, if <a href="tutorial-rippled-setup.html#clustering">configured as a cluster</a>. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.30.1">version 0.30.1</a>)</em></td>
|
||
</tr>
|
||
<tr>
|
||
<td>peers</td>
|
||
<td>Array</td>
|
||
<td>Array of peer objects.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>Each field of the <code>cluster</code> object is the public key of that <code>rippled</code> server's identifying keypair. (This is the same value that that server returns as <code>pubkey_node</code> in the <a href="#server-info"><code>server_info</code> command</a>.) The contents of that field are an object with the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>tag</td>
|
||
<td>String</td>
|
||
<td>The display name for this cluster member as defined in the config file.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>fee</td>
|
||
<td>Number</td>
|
||
<td>(May be omitted) The load multiplier this cluster member is applying to the <a href="concept-transaction-cost.html">transaction cost</a></td>
|
||
</tr>
|
||
<tr>
|
||
<td>age</td>
|
||
<td>Number</td>
|
||
<td>The number of seconds since the last cluster report from this cluster member.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>Each member of the <code>peers</code> array is a peer object with the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>address</td>
|
||
<td>String</td>
|
||
<td>The IP address and port where this peer is connected</td>
|
||
</tr>
|
||
<tr>
|
||
<td>cluster</td>
|
||
<td>Boolean</td>
|
||
<td>(May be omitted) If <code>true</code>, the current server and the peer server are part of the same <code>rippled</code> cluster.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>name</td>
|
||
<td>String</td>
|
||
<td>(May be omitted) If the peer is part of the same cluster, this is the display name for that node as defined in the config file.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>complete_ledgers</td>
|
||
<td>String</td>
|
||
<td>Range expression indicating the sequence numbers of the ledger versions the peer <code>rippled</code> has available</td>
|
||
</tr>
|
||
<tr>
|
||
<td>inbound</td>
|
||
<td>Boolean</td>
|
||
<td>(May be omitted) If <code>true</code>, the peer is connecting to the local server.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>latency</td>
|
||
<td>Number</td>
|
||
<td>The network latency to the peer (in milliseconds)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ledger</td>
|
||
<td>String</td>
|
||
<td>The hash of the peer's most recently closed ledger</td>
|
||
</tr>
|
||
<tr>
|
||
<td>load</td>
|
||
<td>Number</td>
|
||
<td>A measure of the amount of load the peer server is putting on the local server. Larger numbers indicate more load. (The units by which load is measured are not formally defined.)</td>
|
||
</tr>
|
||
<tr>
|
||
<td>protocol</td>
|
||
<td>String</td>
|
||
<td>(May be omitted) The protocol version that the peer is using, if not the same as the local server.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>public_key</td>
|
||
<td>String</td>
|
||
<td>(May be omitted) A public key that can be used to verify the integrity of the peer's messages. This is not the same key that is used for validations, but it follows the same format.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>sanity</td>
|
||
<td>String</td>
|
||
<td>(May be omitted) Whether this peer is following the same rules and ledger sequence as the current server. A value of <code>insane</code> probably indicates that the peer is part of a parallel network. The value <code>unknown</code> indicates that the current server is unsure whether the peer is compatible. <!-- STYLE_OVERRIDE: insane --></td>
|
||
</tr>
|
||
<tr>
|
||
<td>status</td>
|
||
<td>String</td>
|
||
<td>(May be omitted) The most recent status message from the peer. Could be <code>connecting</code>, <code>connected</code>, <code>monitoring</code>, <code>validating</code>, or <code>shutting</code>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>uptime</td>
|
||
<td>Number</td>
|
||
<td>The number of seconds that your <code>rippled</code> server has been continuously connected to this peer. <em>(New in <a href="https://github.com/ripple/rippled/releases/tag/0.30.1">version 0.30.1</a>)</em></td>
|
||
</tr>
|
||
<tr>
|
||
<td>version</td>
|
||
<td>string</td>
|
||
<td>(May be omitted) The <code>rippled</code> version number of the peer server</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="possible-errors-43">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
</ul>
|
||
<h2 id="print">print</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/315a8b6b602798a4cff4d8e1911936011e12abdb/src/ripple/rpc/handlers/Print.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>print</code> command returns the current status of various internal subsystems, including peers, the ledger cleaner, and the resource manager.</p>
|
||
<p><em>The <code>print</code> request is an <a href="#connecting-to-rippled">admin command</a> that cannot be run by unpriviledged users!</em></p>
|
||
<h4 id="request-format-45">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-89"><ul class="codetabs"><li><a href="#code-89-0">WebSocket</a></li><li><a href="#code-89-1">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-89-0" style="position: static;"><pre><code>{
|
||
"id": "print_req_1",
|
||
"command": "print"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-89-1" style="position: static;"><pre><code>rippled print
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The request includes no parameters.</p>
|
||
<h4 id="response-format-43">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-90"><ul class="codetabs"><li><a href="#code-90-0">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-90-0" style="position: static;"><pre><code>Loading: "/etc/rippled.cfg"
|
||
Connecting to 127.0.0.1:5005
|
||
{
|
||
"result" : {
|
||
"app" : {
|
||
"ledgercleaner" : {
|
||
"status" : "idle"
|
||
},
|
||
"peers" : {
|
||
"peerfinder" : {
|
||
"bootcache" : {
|
||
"entries" : 109
|
||
},
|
||
"config" : {
|
||
"auto_connect" : "true",
|
||
"features" : "",
|
||
"max_peers" : 21,
|
||
"out_peers" : 10,
|
||
"port" : 51235,
|
||
"want_incoming" : "true"
|
||
},
|
||
"counts" : {
|
||
"accept" : 0,
|
||
"close" : 0,
|
||
"cluster" : "0",
|
||
"connect" : 0,
|
||
"fixed" : "0",
|
||
"in" : "0/11",
|
||
"out" : "10/10",
|
||
"total" : "10"
|
||
},
|
||
"fixed" : 0,
|
||
"livecache" : {
|
||
"entries" : [
|
||
{
|
||
"address" : "23.239.3.247:51235",
|
||
"expires" : "30000000000 nanoseconds",
|
||
"hops" : 2
|
||
},
|
||
{
|
||
"address" : "192.170.145.88:51235",
|
||
"expires" : "30000000000 nanoseconds",
|
||
"hops" : 1
|
||
},
|
||
{
|
||
"address" : "198.204.238.130:51235",
|
||
"expires" : "26000024558 nanoseconds",
|
||
"hops" : 1
|
||
},
|
||
{
|
||
"address" : "203.127.12.115:51235",
|
||
"expires" : "26000024558 nanoseconds",
|
||
"hops" : 2
|
||
},
|
||
{
|
||
"address" : "212.83.147.67:51235",
|
||
"expires" : "26000024558 nanoseconds",
|
||
"hops" : 2
|
||
}
|
||
],
|
||
"hist" : "0, 10, 74, 10, 0, 0, 0, 0",
|
||
"size" : "94"
|
||
},
|
||
"peers" : [
|
||
{
|
||
"local_address" : "10.1.10.78:48923",
|
||
"remote_address" : "52.24.43.83:51235",
|
||
"state" : "active"
|
||
},
|
||
{
|
||
"local_address" : "10.1.10.78:50004",
|
||
"remote_address" : "52.26.205.197:51235",
|
||
"state" : "active"
|
||
},
|
||
{
|
||
"local_address" : "10.1.10.78:37019",
|
||
"remote_address" : "168.1.60.132:51235",
|
||
"state" : "active"
|
||
},
|
||
{
|
||
"local_address" : "10.1.10.78:38775",
|
||
"remote_address" : "192.170.145.88:51235",
|
||
"state" : "active"
|
||
},
|
||
{
|
||
"local_address" : "10.1.10.78:34793",
|
||
"remote_address" : "198.204.238.130:51235",
|
||
"state" : "active"
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"resource" : {
|
||
"admin" : [
|
||
{
|
||
"balance" : 0,
|
||
"count" : 1,
|
||
"name" : "\"127.0.0.1\""
|
||
}
|
||
],
|
||
"inactive" : [],
|
||
"inbound" : [],
|
||
"outbound" : [
|
||
{
|
||
"balance" : 23,
|
||
"count" : 1,
|
||
"name" : "93.190.138.234:51235"
|
||
},
|
||
{
|
||
"balance" : 35,
|
||
"count" : 1,
|
||
"name" : "198.204.238.130:51235"
|
||
},
|
||
{
|
||
"balance" : 31,
|
||
"count" : 1,
|
||
"name" : "52.26.205.197:51235"
|
||
},
|
||
{
|
||
"balance" : 32,
|
||
"count" : 1,
|
||
"name" : "54.186.73.52:51235"
|
||
},
|
||
{
|
||
"balance" : 15,
|
||
"count" : 1,
|
||
"name" : "72.251.233.164:51235"
|
||
}
|
||
]
|
||
},
|
||
"server" : {
|
||
"active" : "2",
|
||
"hist" : "16",
|
||
"history" : [
|
||
{
|
||
"bytes_in" : "214",
|
||
"bytes_out" : "11688",
|
||
"elapsed" : "0 seconds",
|
||
"id" : "16",
|
||
"requests" : 1,
|
||
"when" : "2015-Jun-16 16:33:50"
|
||
},
|
||
{
|
||
"bytes_in" : "214",
|
||
"bytes_out" : "11431",
|
||
"elapsed" : "0 seconds",
|
||
"id" : "15",
|
||
"requests" : 1,
|
||
"when" : "2015-Jun-16 16:11:59"
|
||
},
|
||
{
|
||
"bytes_in" : "227",
|
||
"bytes_out" : "337",
|
||
"elapsed" : "0 seconds",
|
||
"id" : "3",
|
||
"requests" : 1,
|
||
"when" : "2015-Jun-16 14:57:23"
|
||
},
|
||
{
|
||
"bytes_in" : "214",
|
||
"bytes_out" : "2917",
|
||
"elapsed" : "0 seconds",
|
||
"id" : "2",
|
||
"requests" : 1,
|
||
"when" : "2015-Jun-16 12:39:29"
|
||
},
|
||
{
|
||
"bytes_in" : "220",
|
||
"bytes_out" : "1426",
|
||
"elapsed" : "0 seconds",
|
||
"id" : "1",
|
||
"requests" : 1,
|
||
"when" : "2015-Jun-16 12:39:13"
|
||
}
|
||
]
|
||
},
|
||
"validators" : {}
|
||
},
|
||
"status" : "success"
|
||
}
|
||
}
|
||
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>. Additional fields in the result depend on the internal state of the <code>rippled</code> server. The results of this command are subject to change without notice.</p>
|
||
<h4 id="possible-errors-44">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
</ul>
|
||
<h1 id="convenience-functions">Convenience Functions</h1>
|
||
<p>The rippled server also provides a few commands purely for convenience.</p>
|
||
<h2 id="ping">ping</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/Ping.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>ping</code> command returns an acknowledgement, so that clients can test the connection status and latency.</p>
|
||
<h4 id="request-format-46">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-91"><ul class="codetabs"><li><a href="#code-91-0">WebSocket</a></li><li><a href="#code-91-1">JSON-RPC</a></li><li><a href="#code-91-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-91-0" style="position: static;"><pre><code>{
|
||
"id": 1,
|
||
"command": "ping"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-91-1" style="position: static;"><pre><code>{
|
||
"method": "ping",
|
||
"params": [
|
||
{}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-91-2" style="position: static;"><pre><code>#Syntax: ping
|
||
rippled ping
|
||
</code></pre></div>
|
||
</div>
|
||
<p><a class="button" href="ripple-api-tool.html#ping">Try it! ></a></p>
|
||
<p>The request includes no parameters.</p>
|
||
<h4 id="response-format-44">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-92"><ul class="codetabs"><li><a href="#code-92-0">WebSocket</a></li><li><a href="#code-92-1">JSON-RPC</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-92-0" style="position: static;"><pre><code>{
|
||
"id": 1,
|
||
"result": {},
|
||
"status": "success",
|
||
"type": "response"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-92-1" style="position: static;"><pre><code>200 OK
|
||
{
|
||
"result": {
|
||
"status": "success"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing no fields. The client can measure the round-trip time from request to response as latency.</p>
|
||
<h4 id="possible-errors-45">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
</ul>
|
||
<h2 id="random">random</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/Random.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>random</code> command provides a random number to be used as a source of entropy for random number generation by clients.</p>
|
||
<h4 id="request-format-47">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-93"><ul class="codetabs"><li><a href="#code-93-0">WebSocket</a></li><li><a href="#code-93-1">JSON-RPC</a></li><li><a href="#code-93-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-93-0" style="position: static;"><pre><code>{
|
||
"id": 1,
|
||
"command": "random"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-93-1" style="position: static;"><pre><code>{
|
||
"method": "random",
|
||
"params": [
|
||
{}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-93-2" style="position: static;"><pre><code>#Syntax: random
|
||
rippled random
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The request includes no parameters.</p>
|
||
<h4 id="response-format-45">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-94"><ul class="codetabs"><li><a href="#code-94-0">WebSocket</a></li><li><a href="#code-94-1">JSON-RPC</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-94-0" style="position: static;"><pre><code>{
|
||
"id": 1,
|
||
"result": {
|
||
"random": "8ED765AEBBD6767603C2C9375B2679AEC76E6A8133EF59F04F9FC1AAA70E41AF"
|
||
},
|
||
"status": "success",
|
||
"type": "response"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-94-1" style="position: static;"><pre><code>200 OK
|
||
{
|
||
"result": {
|
||
"random": "4E57146AA47BC6E88FDFE8BAA235B900126C916B6CC521550996F590487B837A",
|
||
"status": "success"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing the following field:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>random</td>
|
||
<td>String</td>
|
||
<td>Random 256-bit hex value.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="possible-errors-46">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>internal</code> - Some internal error occurred, possibly relating to the random number generator.</li>
|
||
</ul>
|
||
<h2 id="json">json</h2>
|
||
<p>The <code>json</code> method is a proxy to running other commands, and accepts the parameters for the command as a JSON value. It is <em>exclusive to the Commandline client</em>, and intended for cases where the commandline syntax for specifying parameters is inadequate or undesirable.</p>
|
||
<h4 id="request-format-48">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-95"><ul class="codetabs"><li><a href="#code-95-0">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-95-0" style="position: static;"><pre><code># Syntax: json method json_stanza
|
||
rippled -q json ledger_closed '{}'
|
||
</code></pre></div>
|
||
</div>
|
||
<h4 id="response-format-46">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-96"><ul class="codetabs"><li><a href="#code-96-0">WebSocket</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-96-0" style="position: static;"><pre><code>{
|
||
"result" : {
|
||
"ledger_hash" : "8047C3ECF1FA66326C1E57694F6814A1C32867C04D3D68A851367EE2F89BBEF3",
|
||
"ledger_index" : 390308,
|
||
"status" : "success"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with whichever fields are appropriate to the type of command made.</p>
|
||
<h2 id="connect">connect</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/a61ffab3f9010d8accfaa98aa3cacc7d38e74121/src/ripple/rpc/handlers/Connect.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>The <code>connect</code> command forces the rippled server to connect to a specific peer rippled server.</p>
|
||
<p><em>The <code>connect</code> request is an <a href="#connecting-to-rippled">admin command</a> that cannot be run by unpriviledged users!</em></p>
|
||
<h4 id="request-format-49">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-97"><ul class="codetabs"><li><a href="#code-97-0">WebSocket</a></li><li><a href="#code-97-1">JSON-RPC</a></li><li><a href="#code-97-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-97-0" style="position: static;"><pre><code>{
|
||
"command": "connect",
|
||
"ip": "192.170.145.88",
|
||
"port": 51235
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-97-1" style="position: static;"><pre><code>{
|
||
"method": "connect",
|
||
"params": [
|
||
{
|
||
"ip": "192.170.145.88",
|
||
"port": 51235
|
||
}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-97-2" style="position: static;"><pre><code>#Syntax: connect ip [port]
|
||
rippled connect 192.170.145.88 51235
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The request includes the following parameters:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>ip</td>
|
||
<td>String</td>
|
||
<td>IP address of the server to connect to</td>
|
||
</tr>
|
||
<tr>
|
||
<td>port</td>
|
||
<td>Number</td>
|
||
<td>(Optional) Port number to use when connecting. Defaults to 6561.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="response-format-47">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-98"><ul class="codetabs"><li><a href="#code-98-0">JSON-RPC</a></li><li><a href="#code-98-1">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-98-0" style="position: static;"><pre><code>{
|
||
"result" : {
|
||
"message" : "connecting",
|
||
"status" : "success"
|
||
}
|
||
}
|
||
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-98-1" style="position: static;"><pre><code>Loading: "/etc/rippled.cfg"
|
||
Connecting to 127.0.0.1:5005
|
||
{
|
||
"result" : {
|
||
"message" : "connecting",
|
||
"status" : "success"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>message</td>
|
||
<td>String</td>
|
||
<td>The value <code>connecting</code>, if the command was successful.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="possible-errors-47">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
<li><code>invalidParams</code> - One or more fields are specified incorrectly, or one or more required fields are missing.</li>
|
||
<li>Cannot connect in standalone mode - Network-related commands are disabled in stand-alone mode.</li>
|
||
</ul>
|
||
<h2 id="stop">stop</h2>
|
||
<p><a href="https://github.com/ripple/rippled/blob/develop/src/ripple/rpc/handlers/Stop.cpp" title="Source">[Source]<br/></a></p>
|
||
<p>Gracefully shuts down the server.</p>
|
||
<p><em>The <code>stop</code> request is an <a href="#connecting-to-rippled">admin command</a> that cannot be run by unpriviledged users!</em></p>
|
||
<h4 id="request-format-50">Request Format</h4>
|
||
<p>An example of the request format:</p>
|
||
<div class="multicode" id="code-99"><ul class="codetabs"><li><a href="#code-99-0">WebSocket</a></li><li><a href="#code-99-1">JSON-RPC</a></li><li><a href="#code-99-2">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-99-0" style="position: static;"><pre><code>{
|
||
"id": 0,
|
||
"command": "stop"
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-99-1" style="position: static;"><pre><code>{
|
||
"method": "stop",
|
||
"params": [
|
||
{}
|
||
]
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-99-2" style="position: static;"><pre><code>rippled stop
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The request includes no parameters.</p>
|
||
<h4 id="response-format-48">Response Format</h4>
|
||
<p>An example of a successful response:</p>
|
||
<div class="multicode" id="code-100"><ul class="codetabs"><li><a href="#code-100-0">JSON-RPC</a></li><li><a href="#code-100-1">Commandline</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-100-0" style="position: static;"><pre><code>{
|
||
"result" : {
|
||
"message" : "ripple server stopping",
|
||
"status" : "success"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-100-1" style="position: static;"><pre><code>Loading: "/etc/rippled.cfg"
|
||
Connecting to 127.0.0.1:5005
|
||
{
|
||
"result" : {
|
||
"message" : "ripple server stopping",
|
||
"status" : "success"
|
||
}
|
||
}
|
||
</code></pre></div>
|
||
</div>
|
||
<p>The response follows the <a href="#response-formatting">standard format</a>, with a successful result containing the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Type</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>message</td>
|
||
<td>String</td>
|
||
<td><code>ripple server stopping</code> on success.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="possible-errors-48">Possible Errors</h4>
|
||
<ul>
|
||
<li>Any of the <a href="#universal-errors">universal error types</a>.</li>
|
||
</ul>
|
||
<h1 id="peer-protocol">Peer Protocol</h1>
|
||
<p>Servers in the Ripple Consensus Ledger communicate to each other using the Ripple peer protocol, also known as RTXP. Peer servers connect via HTTPS and then perform an <a href="https://tools.ietf.org/html/rfc7230#section-6.7">HTTP upgrade</a> to RTXP. (For more information, see the <a href="https://github.com/ripple/rippled/blob/906ef761bab95f80b0a7e0cab3b4c594b226cf57/src/ripple/overlay/README.md#handshake">Overlay Network</a> article in the <a href="https://github.com/ripple/rippled"><code>rippled</code> repository</a>.)</p>
|
||
<h2 id="configuring-the-peer-protocol">Configuring the Peer Protocol</h2>
|
||
<p>In order to participate in the Ripple Consensus Ledger, <code>rippled</code> servers connects to arbitrary peers using the peer protocol. (All such peers are treated as untrusted, unless they are <a href="tutorial-rippled-setup.html#clustering">clustered</a> with the current server.)</p>
|
||
<p>Ideally, the server should be able to send <em>and</em> receive connections on the peer port. You should forward the port used for the peer protocol through your firewall to the <code>rippled</code> server. The <a href="https://github.com/ripple/rippled/blob/develop/doc/rippled-example.cfg">default <code>rippled</code> configuration file</a> listens for incoming peer protocol connections on port 51235 on all network interfaces. You can change the port used by editing the appropriate stanza in your <code>rippled.cfg</code> file.</p>
|
||
<p>Example:</p>
|
||
<pre><code>[port_peer]
|
||
port = 51235
|
||
ip = 0.0.0.0
|
||
protocol = peer
|
||
</code></pre>
|
||
<h2 id="peer-crawler">Peer Crawler</h2>
|
||
<p>The Peer Crawler asks a <code>rippled</code> server to report information about the other <code>rippled</code> servers it is connected to as peers. The <a href="#peers"><code>peers</code> command</a> in the <a href="#websocket-and-json-rpc-apis">WebSocket and JSON-RPC APIs</a> also returns a similar, more comprehensive set of information, but requires <a href="#connecting-to-rippled">administrative access</a> to the server. The Peer Crawler response is available to other servers on a non-privileged basis through the Peer Protocol (RTXP) port.</p>
|
||
<h4 id="request-format-51">Request Format</h4>
|
||
<p>To request the Peer Crawler information, make the following HTTP request:</p>
|
||
<ul>
|
||
<li><strong>Protocol:</strong> https</li>
|
||
<li><strong>HTTP Method:</strong> GET</li>
|
||
<li><strong>Host:</strong> (any <code>rippled</code> server, by hostname or IP address)</li>
|
||
<li><strong>Port:</strong> (port number where the <code>rippled</code> server uses the Peer Protocol, typically 51235)</li>
|
||
<li><strong>Path:</strong> <code>/crawl</code></li>
|
||
<li><strong>Notes:</strong> Most <code>rippled</code> servers use a self-signed certificate to respond to the request. By default, most tools (including web browsers) flag or block such responses for being untrusted. You must ignore the certificate checking (for example, if using cURL, add the <code>--insecure</code> flag) to display a response from those servers.</li>
|
||
</ul>
|
||
<h4 id="response-format-49">Response Format</h4>
|
||
<p>The response has the status code <strong>200 OK</strong> and a JSON object in the message body.</p>
|
||
<p>The JSON object has the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Value</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td><code>overlay.active</code></td>
|
||
<td>Array</td>
|
||
<td>Array of Peer Objects, where each member is a peer that is connected to this server.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>Each member of the <code>active</code> array is a Peer Object with the following fields:</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Field</th>
|
||
<th>Value</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td><code>ip</code></td>
|
||
<td>String (IPv4 Address)</td>
|
||
<td>The IP address of this connected peer.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><code>port</code></td>
|
||
<td>String (Number)</td>
|
||
<td>The port number on the peer server that serves RTXP. Typically 51235.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><code>public_key</code></td>
|
||
<td>String (Base-64 Encoded)</td>
|
||
<td>The public key of the ECDSA key pair used by this peer to sign RTXP messages. (This is the same data as the <code>pubkey_node</code> reported in the peer server's <a href="#server-info"><code>server_info</code> command</a>.)</td>
|
||
</tr>
|
||
<tr>
|
||
<td><code>type</code></td>
|
||
<td>String</td>
|
||
<td>The value <code>in</code> or <code>out</code>, indicating whether the TCP connection to the peer is incoming or outgoing.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><code>uptime</code></td>
|
||
<td>Number</td>
|
||
<td>The number of seconds the server has been has been connected to this peer.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><code>version</code></td>
|
||
<td>String</td>
|
||
<td>The <code>rippled</code> version number the peer reports to be using.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="example">Example</h4>
|
||
<p>Request:</p>
|
||
<div class="multicode" id="code-101"><ul class="codetabs"><li><a href="#code-101-0">HTTP</a></li><li><a href="#code-101-1">cURL</a></li></ul>
|
||
|
||
<div class="code_sample" id="code-101-0" style="position: static;"><pre><code>GET https://s1.ripple.com:51235/crawl
|
||
</code></pre></div>
|
||
|
||
<div class="code_sample" id="code-101-1" style="position: static;"><pre><code>curl -k https://s1.ripple.com:51235/crawl
|
||
</code></pre></div>
|
||
</div>
|
||
<p>Response:</p>
|
||
<pre><code class="json">200 OK
|
||
{
|
||
"overlay": {
|
||
"active": [{
|
||
"ip": "208.43.252.243",
|
||
"port": "51235",
|
||
"public_key": "A2GayQNaj7qbqLFiCFW2UXtAnEPghP/KWVqix2gUa6dM",
|
||
"type": "out",
|
||
"uptime": 107926,
|
||
"version": "rippled-0.31.0-rc1"
|
||
}, {
|
||
"ip": "184.172.237.226",
|
||
"port": "51235",
|
||
"public_key": "Asv/wKq/dqMWbP2M4eR+QvkuojYMLRXhKhIPnW40bsaF",
|
||
"type": "out",
|
||
"uptime": 247376,
|
||
"version": "rippled-0.31.0-rc1"
|
||
}, {
|
||
"ip": "54.186.73.52",
|
||
"port": "51235",
|
||
"public_key": "AjikFnq0P2XybCyREr2KPiqXqJteqwPwVRVbVK+93+3o",
|
||
"type": "out",
|
||
"uptime": 328776,
|
||
"version": "rippled-0.31.0-rc1"
|
||
}, {
|
||
"ip": "169.53.155.59",
|
||
"port": "51235",
|
||
"public_key": "AyIcVhAhOGnP0vtfCt+HKUrx9B2fDvP/4XUkOtVQ37g/",
|
||
"type": "out",
|
||
"uptime": 328776,
|
||
"version": "rippled-0.31.1"
|
||
}, {
|
||
"ip": "169.53.155.44",
|
||
"port": "51235",
|
||
"public_key": "AuVZszWXgMgM8YuTVhQsGE9OciEeBD8aMVe1mFid3n63",
|
||
"type": "out",
|
||
"uptime": 328776,
|
||
"version": "rippled-0.32.0-b12"
|
||
}, {
|
||
"ip": "184.173.45.39",
|
||
"port": "51235",
|
||
"public_key": "Ao2GbGbp2QYQ2B4S9ckCtON7CsZdXqdK5Yon4x7qmWFm",
|
||
"type": "out",
|
||
"uptime": 63336,
|
||
"version": "rippled-0.31.0-rc1"
|
||
}, {
|
||
"ip": "169.53.155.34",
|
||
"port": "51235",
|
||
"public_key": "A3inNJsIQzO7z7SS7uB9DyvN0wsiS9it/RGY/kNx6KEG",
|
||
"type": "out",
|
||
"uptime": 328776,
|
||
"version": "rippled-0.31.0-rc1"
|
||
}, {
|
||
"ip": "169.53.155.45",
|
||
"port": "51235",
|
||
"public_key": "AglUUjwXTC2kUlK41WjDs2eAVN0SnlMpzYA9lEgB0UGP",
|
||
"type": "out",
|
||
"uptime": 65443,
|
||
"version": "rippled-0.31.0-rc1"
|
||
}, {
|
||
"ip": "99.110.49.91",
|
||
"port": "51301",
|
||
"public_key": "AuQDH0o+4fpl2n+pR5U0Y4FTj0oGr4iEKe0MObPcSYj9",
|
||
"type": "out",
|
||
"uptime": 328776,
|
||
"version": "rippled-0.32.0-b9"
|
||
}, {
|
||
"ip": "169.53.155.36",
|
||
"port": "51235",
|
||
"public_key": "AsR4xub7MLg2Zl5Fwd/n7dTz7mhbBoSyCc/v9bnubrVy",
|
||
"type": "out",
|
||
"uptime": 328776,
|
||
"version": "rippled-0.31.0-rc1"
|
||
}]
|
||
}
|
||
}
|
||
</code></pre>
|
||
<h3 id="concealing-peer-information">Concealing Peer Information</h3>
|
||
<p>You can use the <code>[peer_private]</code> stanza of the <code>rippled</code> config file to request that peer servers do not report your IP address in the Peer Crawler response. You cannot force peers you do not control to follow this request, if they run custom software. However, you can use this to hide the IP addresses of <code>rippled</code> servers you control that <em>only</em> connect to peers you control (using <code>[ips_fixed]</code> and a firewall). This can help to protect important <a href="tutorial-rippled-setup.html#types-of-rippled-servers">validating servers</a>.</p>
|
||
<p>Example:</p>
|
||
<pre><code># Configuration on a private server that only connects through
|
||
# a second rippled server at IP address 10.1.10.55
|
||
[ips_fixed]
|
||
10.1.10.55
|
||
|
||
[peer_private]
|
||
1
|
||
</code></pre>
|
||
<!---- rippled release notes links ---->
|
||
</div>
|
||
</main>
|
||
</div>
|
||
|
||
<footer class="content-info" role="contentinfo">
|
||
<div class="container">
|
||
<div class="row">
|
||
|
||
<section class="col-sm-3 widget nav_menu-3 widget_nav_menu">
|
||
<h4>Resources<hr></h4>
|
||
<ul id="menu-resources" class="menu">
|
||
<li class="menu-insights"><a href="https://ripple.com/insights/">Insights</a></li>
|
||
<li class="menu-press-center"><a href="https://ripple.com/press-center/">Press Center</a></li>
|
||
<li class="menu-media-resources"><a href="https://ripple.com/media-resources/">Media Resources</a></li>
|
||
<li class="menu-videos"><a href="https://ripple.com/videos/">Videos</a></li>
|
||
<li class="menu-whitepapers-reports"><a href="https://ripple.com/whitepapers-reports/">Whitepapers & Reports</a></li>
|
||
<li class="menu-xrp-portal"><a href="https://ripple.com/xrp-portal/">XRP Portal</a></li>
|
||
</ul>
|
||
</section>
|
||
|
||
<section class="col-sm-3 widget nav_menu-5 widget_nav_menu">
|
||
<h4>Regulators<hr></h4>
|
||
<ul id="menu-compliance-regulatory-relations" class="menu"><li class="menu-compliance"><a href="https://ripple.com/compliance/">Compliance</a></li>
|
||
<li class="menu-policy-framework"><a href="https://ripple.com/policy-framework/">Policy Framework</a></li>
|
||
</ul>
|
||
</section>
|
||
|
||
<section class="col-sm-3 widget nav_menu-4 widget_nav_menu">
|
||
<h4>Support<hr></h4>
|
||
<ul id="menu-dev-footer-menu" class="menu">
|
||
<li class="menu-contact-us"><a href="https://ripple.com/contact/">Contact Us</a></li>
|
||
<li class="active menu-developer-center"><a href="https://ripple.com/build/">Developer Center</a></li>
|
||
<li class="menu-knowledge-center"><a href="https://ripple.com/learn/">Knowledge Center</a></li>
|
||
<li class="menu-ripple-forum"><a target="_blank" href="https://forum.ripple.com/">Ripple Forum</a></li>
|
||
</ul>
|
||
</section>
|
||
|
||
<section class="col-sm-3 widget nav_menu-2 widget_nav_menu">
|
||
<h4>About<hr></h4>
|
||
<ul id="menu-company-footer" class="menu">
|
||
<li class="menu-our-company"><a href="https://ripple.com/company/">Our Company</a></li>
|
||
<li class="menu-careers"><a href="https://ripple.com/company/careers/">Careers</a></li>
|
||
</ul>
|
||
</section>
|
||
|
||
<div class="col-sm-12 absolute_bottom_footer">
|
||
<div class="col-sm-8">
|
||
<span>© 2013-2015 Ripple Labs, Inc. All Rights Reserved.</span>
|
||
<span><a href="https://ripple.com/terms-of-use/">Terms</a></span>
|
||
<span><a href="https://ripple.com/privacy-policy/">Privacy</a></span>
|
||
</div>
|
||
</div><!-- /.absolute_bottom_footer -->
|
||
|
||
</div><!-- /.row -->
|
||
</div><!-- /.container -->
|
||
</footer>
|
||
</body>
|
||
</html>
|