mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-05 04:15:50 +00:00
6257 lines
215 KiB
HTML
6257 lines
215 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>Ripple Data API v2 - 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>
|
|
|
|
</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-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-rippleapi.html">RippleAPI</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-rippleapi-beginners-guide.html">RippleAPI Beginners Guide</a></li>
|
|
<li><a href="tutorial-rippled-setup.html">rippled Setup</a></li>
|
|
<li><a href="tutorial-reliable-transaction-submission.html">Reliable Transaction Submission</a></li>
|
|
<li><a href="tutorial-multisign.html">How to Multi-Sign</a></li>
|
|
</ul>
|
|
</li>
|
|
<li class="dropdown">
|
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Concepts <span class="caret"></span></a>
|
|
<ul class="dropdown-menu" role="menu">
|
|
<li><a href="concept-paths.html">Paths</a></li>
|
|
<li><a href="concept-fees.html">Fees (Disambiguation)</a></li>
|
|
<li><a href="concept-transfer-fees.html">Transfer Fees</a></li>
|
|
<li><a href="concept-transaction-cost.html">Transaction Cost</a></li>
|
|
<li><a href="concept-fee-voting.html">Fee Voting</a></li>
|
|
<li><a href="concept-reserves.html">Reserves</a></li>
|
|
<li><a href="concept-freeze.html">Freeze</a></li>
|
|
<li><a href="concept-amendments.html">Amendments</a></li>
|
|
<li><a href="concept-stand-alone-mode.html">Stand-Alone Mode</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">Best Practices <span class="caret"></span></a>
|
|
<ul class="dropdown-menu" role="menu">
|
|
<li><a href="concept-issuing-and-operational-addresses.html">Issuing and Operational Addresses</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">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-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-rippleapi.html">RippleAPI</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="#ripple-data-api-v2">Ripple Data API v2</a></li>
|
|
<li class="level-2"><a href="#more-information">More Information</a></li>
|
|
<li class="level-1"><a href="#api-method-reference">API Method Reference</a></li>
|
|
<li class="level-2"><a href="#get-ledger">Get Ledger</a></li>
|
|
<li class="level-2"><a href="#get-transaction">Get Transaction</a></li>
|
|
<li class="level-2"><a href="#get-transactions">Get Transactions</a></li>
|
|
<li class="level-2"><a href="#get-payments">Get Payments</a></li>
|
|
<li class="level-2"><a href="#get-exchanges">Get Exchanges</a></li>
|
|
<li class="level-2"><a href="#get-exchange-rates">Get Exchange Rates</a></li>
|
|
<li class="level-2"><a href="#normalize">Normalize</a></li>
|
|
<li class="level-2"><a href="#get-daily-reports">Get Daily Reports</a></li>
|
|
<li class="level-2"><a href="#get-stats">Get Stats</a></li>
|
|
<li class="level-2"><a href="#get-capitalization">Get Capitalization</a></li>
|
|
<li class="level-2"><a href="#get-active-accounts">Get Active Accounts</a></li>
|
|
<li class="level-2"><a href="#get-exchange-volume">Get Exchange Volume</a></li>
|
|
<li class="level-2"><a href="#get-payment-volume">Get Payment Volume</a></li>
|
|
<li class="level-2"><a href="#get-issued-value">Get Issued Value</a></li>
|
|
<li class="level-2"><a href="#get-top-currencies">Get Top Currencies</a></li>
|
|
<li class="level-2"><a href="#get-top-markets">Get Top Markets</a></li>
|
|
<li class="level-2"><a href="#get-all-gateways">Get All Gateways</a></li>
|
|
<li class="level-2"><a href="#get-gateway">Get Gateway</a></li>
|
|
<li class="level-2"><a href="#get-currency-image">Get Currency Image</a></li>
|
|
<li class="level-2"><a href="#get-accounts">Get Accounts</a></li>
|
|
<li class="level-2"><a href="#get-account">Get Account</a></li>
|
|
<li class="level-2"><a href="#get-account-balances">Get Account Balances</a></li>
|
|
<li class="level-2"><a href="#get-account-orders">Get Account Orders</a></li>
|
|
<li class="level-2"><a href="#get-account-transaction-history">Get Account Transaction History</a></li>
|
|
<li class="level-2"><a href="#get-transaction-by-account-and-sequence">Get Transaction By Account And Sequence</a></li>
|
|
<li class="level-2"><a href="#get-account-payments">Get Account Payments</a></li>
|
|
<li class="level-2"><a href="#get-account-exchanges">Get Account Exchanges</a></li>
|
|
<li class="level-2"><a href="#get-account-balance-changes">Get Account Balance Changes</a></li>
|
|
<li class="level-2"><a href="#get-account-reports">Get Account Reports</a></li>
|
|
<li class="level-2"><a href="#get-account-transaction-stats">Get Account Transaction Stats</a></li>
|
|
<li class="level-2"><a href="#get-account-value-stats">Get Account Value Stats</a></li>
|
|
<li class="level-2"><a href="#health-check-api">Health Check - API</a></li>
|
|
<li class="level-2"><a href="#health-check-ledger-importer">Health Check - Ledger Importer</a></li>
|
|
<li class="level-1"><a href="#api-conventions">API Conventions</a></li>
|
|
<li class="level-2"><a href="#basic-types">Basic Types</a></li>
|
|
<li class="level-3"><a href="#numbers-and-precision">Numbers and Precision</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="#timestamps">Timestamps</a></li>
|
|
<li class="level-3"><a href="#ledger-index">Ledger Index</a></li>
|
|
<li class="level-3"><a href="#account-sequence">Account Sequence</a></li>
|
|
<li class="level-3"><a href="#currency-code">Currency Code</a></li>
|
|
<li class="level-2"><a href="#pagination">Pagination</a></li>
|
|
<li class="level-2"><a href="#transaction-objects">Transaction Objects</a></li>
|
|
<li class="level-3"><a href="#full-json-format">Full JSON Format</a></li>
|
|
<li class="level-3"><a href="#binary-format">Binary Format</a></li>
|
|
<li class="level-2"><a href="#ledger-objects">Ledger Objects</a></li>
|
|
<li class="level-3"><a href="#genesis-ledger">Genesis Ledger</a></li>
|
|
<li class="level-2"><a href="#account-creation-objects">Account Creation Objects</a></li>
|
|
<li class="level-2"><a href="#exchange-objects">Exchange Objects</a></li>
|
|
<li class="level-2"><a href="#reports-objects">Reports Objects</a></li>
|
|
<li class="level-2"><a href="#payment-summary-objects">Payment Summary Objects</a></li>
|
|
<li class="level-2"><a href="#payment-objects">Payment Objects</a></li>
|
|
<li class="level-2"><a href="#balance-objects-and-balance-change-objects">Balance Objects and Balance Change Objects</a></li>
|
|
<li class="level-2"><a href="#balance-change-descriptors">Balance Change Descriptors</a></li>
|
|
<li class="level-3"><a href="#change-types">Change Types</a></li>
|
|
<li class="level-2"><a href="#volume-objects">Volume Objects</a></li>
|
|
<li class="level-1"><a href="#running-the-historical-database">Running the Historical Database</a></li>
|
|
<li class="level-2"><a href="#installation">Installation</a></li>
|
|
<li class="level-3"><a href="#dependencies">Dependencies</a></li>
|
|
<li class="level-3"><a href="#installation-process">Installation Process</a></li>
|
|
<li class="level-3"><a href="#tests">Tests</a></li>
|
|
<li class="level-3"><a href="#services">Services</a></li>
|
|
<li class="level-2"><a href="#importing-data">Importing Data</a></li>
|
|
<li class="level-3"><a href="#live-ledger-importer">Live Ledger Importer</a></li>
|
|
<li class="level-3"><a href="#backfiller">Backfiller</a></li>
|
|
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</aside>
|
|
<main class="main" role="main">
|
|
<div class='content'>
|
|
<h1 id="ripple-data-api-v2">Ripple Data API v2</h1>
|
|
<p>The Ripple Data API v2 provides access to information about changes in the Ripple Consensus Ledger, including transaction history and processed analytical data. This information is stored in a database for easy access, which frees <code>rippled</code> servers to maintain fewer historical ledger versions. Additionally, the Data API v2 acts as data source for applications such as <a href="https://www.ripplecharts.com/">Ripple Charts</a> and <a href="https://www.ripple.com">ripple.com</a>.</p>
|
|
<p>Ripple provides a live instance of the Data API with as complete a transaction record as possible at the following address:</p>
|
|
<p><a href="https://data.ripple.com"><strong>https://data.ripple.com</strong></a></p>
|
|
<h2 id="more-information">More Information</h2>
|
|
<p>The Ripple Data API v2 replaces the Historical Database v1 and the <a href="https://github.com/ripple/ripple-data-api/">Charts API</a>.</p>
|
|
<ul>
|
|
<li><a href="#api-method-reference">API Methods</a></li>
|
|
<li><a href="#api-conventions">API Conventions</a></li>
|
|
<li><a href="#running-the-historical-database">Setup (local instance)</a></li>
|
|
<li><a href="https://github.com/ripple/rippled-historical-database">Source Code on Github</a></li>
|
|
<li><a href="https://github.com/ripple/rippled-historical-database/releases">Release Notes</a></li>
|
|
</ul>
|
|
<h1 id="api-method-reference">API Method Reference</h1>
|
|
<p>The Data API v2 provides a REST API with the following methods:</p>
|
|
<p>General Methods:</p>
|
|
<ul>
|
|
<li><a href="#get-ledger">Get Ledger - <code>GET /v2/ledgers/{:ledger_identifier}</code></a></li>
|
|
<li><a href="#get-transaction">Get Transaction - <code>GET /v2/transactions/{:hash}</code></a></li>
|
|
<li><a href="#get-transactions">Get Transactions - <code>GET /v2/transactions/</code></a></li>
|
|
<li><a href="#get-payments">Get Payments - <code>GET /v2/payments/{:currency}</code></a></li>
|
|
<li><a href="#get-exchanges">Get Exchanges - <code>GET /v2/exchanges/{:base}/{:counter}</code></a></li>
|
|
<li><a href="#get-exchange-rates">Get Exchange Rates - <code>GET /v2/exchange_rates/{:base}/{:counter}</code></a></li>
|
|
<li><a href="#normalize">Normalize - <code>GET /v2/normalize</code></a></li>
|
|
<li><a href="#get-daily-reports">Get Daily Reports - <code>GET /v2/reports/</code></a></li>
|
|
<li><a href="#get-stats">Get Stats - <code>GET /v2/stats/</code></a></li>
|
|
<li><a href="#get-capitalization">Get Capitalization - <code>GET /v2/capitalization/{:currency}</code></a></li>
|
|
<li><a href="#get-active-accounts">Get Active Accounts - <code>GET /v2/active_accounts/{:base}/{:counter}</code></a></li>
|
|
<li><a href="#get-exchange-volume">Get Exchange Volume - <code>GET /v2/network/exchange_volume</code></a></li>
|
|
<li><a href="#get-payment-volume">Get Payment Volume - <code>GET /v2/network/payment_volume</code></a></li>
|
|
<li><a href="#get-issued-value">Get Issued Value - <code>GET /v2/network/issued_value</code></a></li>
|
|
<li><a href="#get-top-currencies">Get Top Currencies - <code>GET /v2/network/top_currencies</code></a></li>
|
|
<li><a href="#get-top-markets">Get Top Markets - <code>GET /v2/network/top_markets</code></a></li>
|
|
<li><a href="#get-all-gateways">Get All Gateways - <code>GET /v2/gateways</code></a></li>
|
|
<li><a href="#get-gateway">Get Gateway - <code>GET /v2/gateways/{:gateway}</code></a></li>
|
|
<li><a href="#get-currency-image">Get Currency Image - <code>GET /v2/currencies/{:currencyimage}</code></a></li>
|
|
</ul>
|
|
<p>Account Methods:</p>
|
|
<ul>
|
|
<li><a href="#get-account">Get Account - <code>GET /v2/accounts/{:address}</code></a></li>
|
|
<li><a href="#get-accounts">Get Accounts - <code>GET /v2/accounts</code></a></li>
|
|
<li><a href="#get-account-balances">Get Account Balances - <code>GET /v2/accounts/{:address}/balances</code></a></li>
|
|
<li><a href="#get-account-orders">Get Account Orders - <code>GET /v2/accounts/{:address}/orders</code></a></li>
|
|
<li><a href="#get-account-transaction-history">Get Account Transaction History - <code>GET /v2/accounts/{:address}/transactions</code></a></li>
|
|
<li><a href="#get-transaction-by-account-and-sequence">Get Transaction By Account and Sequence - <code>GET /v2/accounts/{:address}/transactions/{:sequence}</code></a></li>
|
|
<li><a href="#get-account-payments">Get Account Payments - <code>GET /v2/accounts/{:address}/payments</code></a></li>
|
|
<li><a href="#get-account-exchanges">Get Account Exchanges - <code>GET /v2/accounts/{:address}/exchanges</code></a></li>
|
|
<li><a href="#get-account-balance-changes">Get Account Balance Changes - <code>GET /v2/accounts/{:address}/balance_changes</code></a></li>
|
|
<li><a href="#get-account-reports">Get Account Reports - <code>GET /v2/accounts/{:address}/reports</code></a></li>
|
|
<li><a href="#get-account-transaction-stats">Get Account Transaction Stats - <code>GET /v2/accounts/{:address}/stats/transactions</code></a></li>
|
|
<li><a href="#get-account-value-stats">Get Account Value Stats - <code>GET /v2/accounts/{:address}/stats/value</code></a></li>
|
|
</ul>
|
|
<p>Health Checks:</p>
|
|
<ul>
|
|
<li><a href="#health-check-api">API Health Check - <code>GET /v2/health/api</code></a></li>
|
|
<li><a href="#health-check-ledger-importer">Importer Health Check - <code>GET /v2/health/importer</code></a></li>
|
|
</ul>
|
|
<h2 id="get-ledger">Get Ledger</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/develop/api/routesV2/getLedger.js" title="Source">[Source]<br/></a></p>
|
|
<p>Retrieve a specific Ledger by hash, index, date, or latest validated.</p>
|
|
<h4 id="request-format">Request Format</h4>
|
|
<div class="multicode" id="code-0"><ul class="codetabs"><li><a href="#code-0-0">REST</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-0-0" style="position: static;"><pre><code>GET /v2/ledgers/{:identifier}
|
|
</code></pre></div>
|
|
</div>
|
|
<p><a class="button" href="data-api-v2-tool.html#get-ledger">Try it! ></a></p>
|
|
<p>The following URL parameters are required by this API endpoint:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>ledger_identifier</td>
|
|
<td>Ledger <a href="#hashes">Hash</a>, <a href="#ledger-index">Ledger Index</a>, or <a href="#timestamps">Timestamp</a></td>
|
|
<td>(Optional) An identifier for the ledger to retrieve: either the full hash in hex, an integer sequence number, or a date-time. If a date-time is provided, retrieve the ledger that was most recently closed at that time. If omitted, retrieve the latest validated ledger.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Optionally, you can also include the following query parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>transactions</td>
|
|
<td>Boolean</td>
|
|
<td>If <code>true</code>, include the identifying hashes of all transactions that are part of this ledger.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>binary</td>
|
|
<td>Boolean</td>
|
|
<td>If <code>true</code>, include all transactions from this ledger as hex-formatted binary data. (If provided, overrides <code>transactions</code>.)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>expand</td>
|
|
<td>Boolean</td>
|
|
<td>If <code>true</code>, include all transactions from this ledger as nested JSON objects. (If provided, overrides <code>binary</code> and <code>transactions</code>.)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="response-format">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong> and has a JSON body with the following:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>result</td>
|
|
<td>String</td>
|
|
<td>The value <code>success</code> indicates that this is a successful response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>ledger</td>
|
|
<td><a href="#ledger-objects">Ledger object</a></td>
|
|
<td>The requested ledger</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="example">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v2/ledgers/3170DA37CE2B7F045F889594CBC323D88686D2E90E8FFD2BBCD9BAD12E416DB5
|
|
</code></pre>
|
|
<p>Response:</p>
|
|
<pre><code>200 OK
|
|
{
|
|
"result": "success",
|
|
"ledger": {
|
|
"ledger_hash": "3170da37ce2b7f045f889594cbc323d88686d2e90e8ffd2bbcd9bad12e416db5",
|
|
"ledger_index": 8317037,
|
|
"parent_hash": "aff6e04f07f441abc6b4133f8c50c65935b817a85b895f06dba098b3fbc1be90",
|
|
"total_coins": 99999980165594400,
|
|
"close_time_res": 10,
|
|
"accounts_hash": "8ad73e49a34d8b9c31bc13b8a97c56981e45ee70225ef4892e8b198fec5a1f7d",
|
|
"transactions_hash": "33e0b9c5fd7766343e67854aed4222f5ed9c9507e0ec0d7ae7d54d0f17adb98e",
|
|
"close_time": 1408047740,
|
|
"close_time_human": "2014-08-14T20:22:20+00:00"
|
|
}
|
|
}
|
|
</code></pre>
|
|
<h2 id="get-transaction">Get Transaction</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/develop/api/routesV2/getTransactions.js" title="Source">[Source]<br/></a></p>
|
|
<p>Retrieve a specific transaction by its identifying hash.</p>
|
|
<h4 id="request-format-1">Request Format</h4>
|
|
<div class="multicode" id="code-1"><ul class="codetabs"><li><a href="#code-1-0">REST</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-1-0" style="position: static;"><pre><code>GET /v2/transactions/{:hash}
|
|
</code></pre></div>
|
|
</div>
|
|
<p><a class="button" href="data-api-v2-tool.html#get-transaction">Try it! ></a></p>
|
|
<p>The following URL parameters are required by this API endpoint:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>hash</td>
|
|
<td>String - <a href="#hashes">Hash</a></td>
|
|
<td>The identifying hash of the transaction.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Optionally, you can also include the following query parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>binary</td>
|
|
<td>Boolean</td>
|
|
<td>If <code>true</code>, return transaction data in binary format, as a hex string. Otherwise, return transaction data as nested JSON. Defaults to false.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="response-format-1">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong> and has a JSON body with the following:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>result</td>
|
|
<td>String</td>
|
|
<td>The value <code>success</code> indicates that this is a successful response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>transaction</td>
|
|
<td><a href="#transaction-objects">Transaction object</a></td>
|
|
<td>The requested transaction</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="example-1">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v2/transactions/03EDF724397D2DEE70E49D512AECD619E9EA536BE6CFD48ED167AE2596055C9A
|
|
</code></pre>
|
|
<p>Response (trimmed for size):</p>
|
|
<pre><code class="js">200 OK
|
|
{
|
|
"result": "success",
|
|
"transaction": {
|
|
"ledger_index": 8317037,
|
|
"date": "2014-08-14T20:22:20+00:00",
|
|
"hash": "03EDF724397D2DEE70E49D512AECD619E9EA536BE6CFD48ED167AE2596055C9A",
|
|
"tx": {
|
|
"TransactionType": "OfferCreate",
|
|
"Flags": 131072,
|
|
"Sequence": 159244,
|
|
"TakerPays": {
|
|
"value": "0.001567373",
|
|
"currency": "BTC",
|
|
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
|
|
},
|
|
"TakerGets": "146348921",
|
|
"Fee": "64",
|
|
"SigningPubKey": "02279DDA900BC53575FC5DFA217113A5B21C1ACB2BB2AEFDD60EA478A074E9E264",
|
|
"TxnSignature": "3045022100D81FFECC36A3DEF0922EB5D16F1AA5AA0804C30A18ED3B512093A75E87C81AD602206B221E22A4E3158785C109E7508624AD3DE5C0E06108D34FA709FCC9575C9441",
|
|
"Account": "r2d2iZiCcJmNL6vhUGFjs8U8BuUq6BnmT"
|
|
},
|
|
"meta": {
|
|
"TransactionIndex": 0,
|
|
"AffectedNodes": [
|
|
{
|
|
"ModifiedNode": {
|
|
"LedgerEntryType": "AccountRoot",
|
|
"PreviousTxnLgrSeq": 8317036,
|
|
"PreviousTxnID": "A56793D47925BED682BFF754806121E3C0281E63C24B62ADF7078EF86CC2AA53",
|
|
"LedgerIndex": "2880A9B4FB90A306B576C2D532BFE390AB3904642647DCF739492AA244EF46D1",
|
|
"PreviousFields": {
|
|
"Balance": "275716601760"
|
|
},
|
|
"FinalFields": {
|
|
"Flags": 0,
|
|
"Sequence": 326323,
|
|
"OwnerCount": 27,
|
|
"Balance": "275862935331",
|
|
"Account": "rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw",
|
|
"RegularKey": "rfYqosNivHQFJ6KpArouxoci3QE3huKNYe"
|
|
}
|
|
}
|
|
},
|
|
|
|
...
|
|
],
|
|
"TransactionResult": "tesSUCCESS"
|
|
}
|
|
}
|
|
}
|
|
</code></pre>
|
|
<h2 id="get-transactions">Get Transactions</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/develop/api/routesV2/getTransactions.js" title="Source">[Source]<br/></a></p>
|
|
<p>Retrieve transactions by time</p>
|
|
<h4 id="request-format-2">Request Format</h4>
|
|
<div class="multicode" id="code-2"><ul class="codetabs"><li><a href="#code-2-0">REST</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-2-0" style="position: static;"><pre><code>GET /v2/transactions/
|
|
</code></pre></div>
|
|
</div>
|
|
<p><a class="button" href="data-api-v2-tool.html#get-transactions">Try it! ></a></p>
|
|
<p>Optionally, you can include the following query parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>start</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>Filter results to this time and later.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>end</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>Filter results to this time and earlier.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>descending</td>
|
|
<td>Boolean</td>
|
|
<td>If true, return results in reverse chronological order. Defaults to false.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Filter transactions to a specific <a href="reference-transaction-format.html">transaction type</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>result</td>
|
|
<td>String</td>
|
|
<td>Filter transactions for a specific <a href="reference-transaction-format.html#transaction-results">transaction result</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>binary</td>
|
|
<td>Boolean</td>
|
|
<td>If true, return transactions in binary form. Defaults to false.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>limit</td>
|
|
<td>Integer</td>
|
|
<td>Maximum results per page. Defaults to 20. Cannot be more than 100.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>marker</td>
|
|
<td>String</td>
|
|
<td><a href="#pagination">Pagination</a> marker from a previous response.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="response-format-2">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong> and has a JSON body with the following:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>result</td>
|
|
<td>String</td>
|
|
<td>The value <code>success</code> indicates that this is a successful response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>count</td>
|
|
<td>Integer</td>
|
|
<td>Number of Transactions returned.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>marker</td>
|
|
<td>String</td>
|
|
<td>(May be omitted) Pagination marker</td>
|
|
</tr>
|
|
<tr>
|
|
<td>transactions</td>
|
|
<td>Array of <a href="#transaction-objects">Transaction object</a></td>
|
|
<td>The requested transactions</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="example-2">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v2/transactions/?result=tecPATH_DRY&limit=2&type=Payment
|
|
</code></pre>
|
|
<p>Response:</p>
|
|
<pre><code>{
|
|
"result": "success",
|
|
"count": 2,
|
|
"marker": "20130106022000|000000053869|00000",
|
|
"transactions": [
|
|
{
|
|
"hash": "B8E4335A94438EC8209135A4E861A4C88F988C651B819DDAF2E8C55F9B41E589",
|
|
"date": "2013-01-02T20:13:40+00:00",
|
|
"ledger_index": 40752,
|
|
"ledger_hash": "55A900C2BA9483DC83F8FC065DE7789570662365BDE98EB75C5F4CE4F9B43214",
|
|
"tx": {
|
|
"TransactionType": "Payment",
|
|
"Flags": 0,
|
|
"Sequence": 61,
|
|
"Amount": {
|
|
"value": "96",
|
|
"currency": "USD",
|
|
"issuer": "rJ6VE6L87yaVmdyxa9jZFXSAdEFSoTGPbE"
|
|
},
|
|
"Fee": "10",
|
|
"SigningPubKey": "02082622E4DA1DC6EA6B38A48956D816881E000ACF0C5F5B52863B9F698799D474",
|
|
"TxnSignature": "304402200A0746192EBC7BC3C1B9D657F42B6345A49D75FE23EF340CB6F0427254C139D00220446BF9169C94AEDC87F56D01DB011866E2A67E2AADDCC45C4D11422550D044CB",
|
|
"Account": "rB5TihdPbKgMrkFqrqUC3yLdE8hhv4BdeY",
|
|
"Destination": "rJ6VE6L87yaVmdyxa9jZFXSAdEFSoTGPbE"
|
|
},
|
|
"meta": {
|
|
"TransactionIndex": 0,
|
|
"AffectedNodes": [
|
|
{
|
|
"ModifiedNode": {
|
|
"LedgerEntryType": "AccountRoot",
|
|
"PreviousTxnLgrSeq": 40212,
|
|
"PreviousTxnID": "F491DC8B5E51045D4420297293199039D5AE1EA0C6D62CAD9A973E3C89E40CD6",
|
|
"LedgerIndex": "9B242A0D59328CE964FFFBFF7D3BBF8B024F9CB1A212923727B42F24ADC93930",
|
|
"PreviousFields": {
|
|
"Sequence": 61,
|
|
"Balance": "8178999999999400"
|
|
},
|
|
"FinalFields": {
|
|
"Flags": 0,
|
|
"Sequence": 62,
|
|
"OwnerCount": 6,
|
|
"Balance": "8178999999999390",
|
|
"Account": "rB5TihdPbKgMrkFqrqUC3yLdE8hhv4BdeY"
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"TransactionResult": "tecPATH_DRY"
|
|
}
|
|
},
|
|
{
|
|
"hash": "1E1C14BF5E61682F3DC9D035D9908816497B8E8843E05C0EE98E06DFDDDAE920",
|
|
"date": "2013-01-05T08:43:10+00:00",
|
|
"ledger_index": 51819,
|
|
"ledger_hash": "88ED10E4E31FC7580285CF173B264690B0E8688A3FC9F5F9C62F1A295B96269D",
|
|
"tx": {
|
|
"TransactionType": "Payment",
|
|
"Flags": 0,
|
|
"Sequence": 10,
|
|
"Amount": {
|
|
"value": "2",
|
|
"currency": "EUR",
|
|
"issuer": "rfitr7nL7MX85LLKJce7E3ATQjSiyUPDfj"
|
|
},
|
|
"Fee": "10",
|
|
"SigningPubKey": "03FDDCD97668B686100E60653FD1E5210A8310616669AACB3A1FCC6D2C090CCB32",
|
|
"TxnSignature": "304402204F9BB7E37C14A3A3762E2A7DADB9A28D1AFFB3797521229B6FB98BA666B5491B02204F69AAEAFAC8FA473E52042FF06035AB3618A54E0B76C9852766D55184E98598",
|
|
"Account": "rhdAw3LiEfWWmSrbnZG3udsN7PoWKT56Qo",
|
|
"Destination": "rfitr7nL7MX85LLKJce7E3ATQjSiyUPDfj"
|
|
},
|
|
"meta": {
|
|
"TransactionIndex": 0,
|
|
"AffectedNodes": [
|
|
{
|
|
"ModifiedNode": {
|
|
"LedgerEntryType": "AccountRoot",
|
|
"PreviousTxnLgrSeq": 51814,
|
|
"PreviousTxnID": "5EC1C179996BD87E2EB11FE60A37ADD0FB2229ADC7D13B204FAB04FABED8A38D",
|
|
"LedgerIndex": "AC1B67084F84839A3158A4E38618218BF9016047B1EE435AECD4B02226AB2105",
|
|
"PreviousFields": {
|
|
"Sequence": 10,
|
|
"Balance": "10000999910"
|
|
},
|
|
"FinalFields": {
|
|
"Flags": 0,
|
|
"Sequence": 11,
|
|
"OwnerCount": 2,
|
|
"Balance": "10000999900",
|
|
"Account": "rhdAw3LiEfWWmSrbnZG3udsN7PoWKT56Qo"
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"TransactionResult": "tecPATH_DRY"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
</code></pre>
|
|
<h2 id="get-payments">Get Payments</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/develop/api/routesV2/getPayments.js" title="Source">[Source]<br/></a></p>
|
|
<p>Retrieve Payments over time, where Payments are defined as <code>Payment</code> type transactions where the sender of the transaction is not also the destination. <em>(New in <a href="https://github.com/ripple/rippled-historical-database/releases/tag/v2.0.4">v2.0.4</a>)</em></p>
|
|
<p>Results can be returned as individual payments, or aggregated to a specific list of intervals if currency and issuer are provided.</p>
|
|
<h4 id="request-format-3">Request Format</h4>
|
|
<div class="multicode" id="code-3"><ul class="codetabs"><li><a href="#code-3-0">REST - All Currencies</a></li><li><a href="#code-3-1">REST - Specific Currency</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-3-0" style="position: static;"><pre><code>GET /v2/payments/
|
|
</code></pre></div>
|
|
|
|
<div class="code_sample" id="code-3-1" style="position: static;"><pre><code>GET /v2/payments/{:currency}
|
|
</code></pre></div>
|
|
</div>
|
|
<p><a class="button" href="data-api-v2-tool.html#get-payments">Try it! ></a></p>
|
|
<p>This method accepts the following URL parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>:currency</td>
|
|
<td>String</td>
|
|
<td>(Optional) Currency code, followed by <code>+</code> and a counterparty address. (Or just <code>XRP</code>.) If omitted, return payments for all currencies.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Optionally, you can also include the following query parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>start</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>Filter results to this time and later.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>end</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>Filter results to this time and earlier.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>interval</td>
|
|
<td>String</td>
|
|
<td>If provided and <code>currency</code> is also specified, return results aggregated into intervals of the specified length instead of individual payments. Valid intervals are <code>day</code>, <code>week</code>, or <code>month</code>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>descending</td>
|
|
<td>Boolean</td>
|
|
<td>Reverse chronological order.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>limit</td>
|
|
<td>Integer</td>
|
|
<td>Maximum results per page. Defaults to 200. Cannot be more than 1000.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>marker</td>
|
|
<td>String</td>
|
|
<td><a href="#pagination">Pagination</a> key from previously returned response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>format</td>
|
|
<td>String</td>
|
|
<td>Format of returned results: <code>csv</code> or <code>json</code>. Defaults to <code>json</code>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="response-format-3">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong> and has a JSON body with the following:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>result</td>
|
|
<td>String</td>
|
|
<td>The value <code>success</code> indicates that this is a successful response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>count</td>
|
|
<td>Integer</td>
|
|
<td>Number of Transactions returned</td>
|
|
</tr>
|
|
<tr>
|
|
<td>marker</td>
|
|
<td>String</td>
|
|
<td>(May be omitted) <a href="#pagination">Pagination</a> marker</td>
|
|
</tr>
|
|
<tr>
|
|
<td>payments</td>
|
|
<td>Array of <a href="#payment-objects">Payment Objects</a>, or array of aggregate objects</td>
|
|
<td>The requested payments</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h5 id="aggregate-results">Aggregate Results</h5>
|
|
<p>If the request specifies a <code>currency</code> and an <code>interval</code>, the result includes objects summarizing activity over a specific time period instead of listing individual payments. Each interval summary object has the following fields:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>count</td>
|
|
<td>Number</td>
|
|
<td>The number of payments that occurred during this interval.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>currency</td>
|
|
<td>String - Currency Code</td>
|
|
<td>This summary describes payments that delivered the specified currency.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>issuer</td>
|
|
<td>String - Address</td>
|
|
<td>(Omitted for XRP) This summary describes payments that delivered the currency issued by this address.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>start</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>The start time of this interval</td>
|
|
</tr>
|
|
<tr>
|
|
<td>total_amount</td>
|
|
<td>Number</td>
|
|
<td>The amount of the <code>currency</code> delivered during this interval.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>average_amount</td>
|
|
<td>Number</td>
|
|
<td>The average amount of currency delivered by a single payment during this interval.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="example-3">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v2/payments/BTC+rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q?limit=2
|
|
</code></pre>
|
|
<p>Response:</p>
|
|
<pre><code>200 OK
|
|
{
|
|
"result": "success",
|
|
"count": 2,
|
|
"marker": "20131124004240|000003504935|00002",
|
|
"payments": [
|
|
{
|
|
"amount": "100.0",
|
|
"delivered_amount": "100.0",
|
|
"destination_balance_changes": [
|
|
{
|
|
"counterparty": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
|
"currency": "BTC",
|
|
"value": "100"
|
|
}
|
|
],
|
|
"transaction_cost": "1.0E-5",
|
|
"source_balance_changes": [
|
|
{
|
|
"counterparty": "rwm98fCBS8tV1YB8CGho8zUPW5J7N41th2",
|
|
"currency": "BTC",
|
|
"value": "-100"
|
|
}
|
|
],
|
|
"tx_index": 3,
|
|
"currency": "BTC",
|
|
"destination": "rwm98fCBS8tV1YB8CGho8zUPW5J7N41th2",
|
|
"executed_time": "2013-09-27T04:03:00Z",
|
|
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
|
"ledger_index": 2424349,
|
|
"source": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
|
"source_currency": "BTC",
|
|
"tx_hash": "EDDE2601C38F886E1183B5E7E1BFD936105C76E3648E3FAD2A6C55E90BABDB47"
|
|
},
|
|
{
|
|
"amount": "0.2",
|
|
"delivered_amount": "0.2",
|
|
"destination_balance_changes": [
|
|
{
|
|
"counterparty": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
|
"currency": "BTC",
|
|
"value": "0.2"
|
|
}
|
|
],
|
|
"transaction_cost": "1.5E-5",
|
|
"max_amount": "0.202",
|
|
"source_balance_changes": [
|
|
{
|
|
"counterparty": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
|
"currency": "BTC",
|
|
"value": "-0.2"
|
|
}
|
|
],
|
|
"tx_index": 1,
|
|
"currency": "BTC",
|
|
"destination": "rHfcNvcg8pBqBxtSvD9Ma8gF17uxauB31o",
|
|
"executed_time": "2013-11-20T23:52:30Z",
|
|
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
|
"ledger_index": 3445885,
|
|
"source": "rwm98fCBS8tV1YB8CGho8zUPW5J7N41th2",
|
|
"source_currency": "BTC",
|
|
"tx_hash": "F30D6CED4B0C37660F6DD741C9CA49F0BCB2D2648CDB8FC8AD6CFD86A86384E2"
|
|
}
|
|
]
|
|
}
|
|
</code></pre>
|
|
<h2 id="get-exchanges">Get Exchanges</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/develop/api/routesV2/getExchanges.js" title="Source">[Source]<br/></a></p>
|
|
<p>Retrieve Exchanges for a given currency pair over time. Results can be returned as individual exchanges or aggregated to a specific list of intervals</p>
|
|
<h4 id="request-format-4">Request Format</h4>
|
|
<div class="multicode" id="code-4"><ul class="codetabs"><li><a href="#code-4-0">REST</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-4-0" style="position: static;"><pre><code>GET /v2/exchanges/{:base}/{:counter}
|
|
</code></pre></div>
|
|
</div>
|
|
<p><a class="button" href="data-api-v2-tool.html#get-exchanges">Try it! ></a></p>
|
|
<p>This method requires the following URL parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>base</td>
|
|
<td>String</td>
|
|
<td>Base currency of the pair, as a <a href="#currency-code">Currency Code</a>, followed by <code>+</code> and the issuer <a href="#addresses">Address</a> unless it's XRP.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>counter</td>
|
|
<td>String</td>
|
|
<td>Counter currency of the pair, as a <a href="#currency-code">Currency Code</a>, followed by <code>+</code> and the issuer <a href="#addresses">Address</a> unless it's XRP.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Optionally, you can also include the following query parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>start</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>Filter results to this time and later.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>end</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>Filter results to this time and earlier.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>interval</td>
|
|
<td>String</td>
|
|
<td>Aggregation interval: <code>1minute</code>, <code>5minute</code>, <code>15minute</code>, <code>30minute</code>, <code>1hour</code>, <code>2hour</code>, <code>4hour</code>, <code>1day</code>, <code>3day</code>, <code>7day</code>, or <code>1month</code>. Defaults to non-aggregated results.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>descending</td>
|
|
<td>Boolean</td>
|
|
<td>If true, return results in reverse chronological order.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reduce</td>
|
|
<td>Boolean</td>
|
|
<td>Aggregate all individual results. Defaults to false.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>limit</td>
|
|
<td>Integer</td>
|
|
<td>Maximum results per page (defaults to 200). Cannot be more than 20,000 if <code>reduce</code> is true. Otherwise cannot be more than 1,000.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>marker</td>
|
|
<td>String</td>
|
|
<td><a href="#pagination">Pagination</a> key from previously returned response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>autobridged</td>
|
|
<td>Boolean</td>
|
|
<td>If true, filter results to autobridged exchanges only.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>format</td>
|
|
<td>String</td>
|
|
<td>Format of returned results: <code>csv</code> or <code>json</code>. Defaults to <code>json</code></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="response-format-4">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong> and has a JSON body with the following:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>result</td>
|
|
<td>String</td>
|
|
<td>The value <code>success</code> indicates that this is a successful response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>count</td>
|
|
<td>Integer</td>
|
|
<td>Number of Transactions returned.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>marker</td>
|
|
<td>String</td>
|
|
<td>(May be omitted) <a href="#pagination">Pagination</a> marker</td>
|
|
</tr>
|
|
<tr>
|
|
<td>exchanges</td>
|
|
<td>Array of <a href="#exchange-objects">Exchange Objects</a></td>
|
|
<td>The requested exchanges</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="example-4">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v2/exchanges/USD+rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q/XRP?descending=true&limit=3&result=tesSUCCESS&type=OfferCreate
|
|
</code></pre>
|
|
<p>Response:</p>
|
|
<pre><code>{
|
|
"result": "success",
|
|
"count": 3,
|
|
"marker": "USD|rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q|XRP||20151021222220|000016612683|00017|00000",
|
|
"exchanges": [
|
|
{
|
|
"base_amount": 4.98954834453577,
|
|
"counter_amount": 1047.806201,
|
|
"node_index": 9,
|
|
"rate": 210.00021000021,
|
|
"tx_index": 0,
|
|
"buyer": "rpP2JgiMyTF5jR5hLG3xHCPi1knBb1v9cM",
|
|
"executed_time": "2015-10-21T23:09:50",
|
|
"ledger_index": 16613308,
|
|
"offer_sequence": 1010056,
|
|
"provider": "rpP2JgiMyTF5jR5hLG3xHCPi1knBb1v9cM",
|
|
"seller": "rK2o63evRPdRoMT2ZaW72wsHsFzcjnRLLq",
|
|
"taker": "rK2o63evRPdRoMT2ZaW72wsHsFzcjnRLLq",
|
|
"tx_hash": "25600A10E5395D45A9D514E1EC3D98C341C5451FD21C48FA9D104C310EC29D6B",
|
|
"tx_type": "Payment",
|
|
"base_currency": "USD",
|
|
"base_issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
|
"counter_currency": "XRP"
|
|
},
|
|
{
|
|
"base_amount": 0.0004716155440678037,
|
|
"counter_amount": 0.1,
|
|
"node_index": 3,
|
|
"rate": 212.03711637126,
|
|
"tx_index": 0,
|
|
"buyer": "rfh3pFHkCXv3TgzsEJgyCzF1CduZHCLi9o",
|
|
"executed_time": "2015-10-21T23:09:50",
|
|
"ledger_index": 16613308,
|
|
"offer_sequence": 158081,
|
|
"provider": "rfh3pFHkCXv3TgzsEJgyCzF1CduZHCLi9o",
|
|
"seller": "rK2o63evRPdRoMT2ZaW72wsHsFzcjnRLLq",
|
|
"taker": "rK2o63evRPdRoMT2ZaW72wsHsFzcjnRLLq",
|
|
"tx_hash": "25600A10E5395D45A9D514E1EC3D98C341C5451FD21C48FA9D104C310EC29D6B",
|
|
"tx_type": "Payment",
|
|
"base_currency": "USD",
|
|
"base_issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
|
"counter_currency": "XRP"
|
|
},
|
|
{
|
|
"base_amount": 0.0004714169229390923,
|
|
"counter_amount": 0.1,
|
|
"node_index": 3,
|
|
"rate": 212.1264535361624,
|
|
"tx_index": 17,
|
|
"autobridged_currency": "USD",
|
|
"autobridged_issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
|
"buyer": "rfh3pFHkCXv3TgzsEJgyCzF1CduZHCLi9o",
|
|
"executed_time": "2015-10-21T22:22:20",
|
|
"ledger_index": 16612683,
|
|
"offer_sequence": 158059,
|
|
"provider": "rfh3pFHkCXv3TgzsEJgyCzF1CduZHCLi9o",
|
|
"seller": "rpP2JgiMyTF5jR5hLG3xHCPi1knBb1v9cM",
|
|
"taker": "rpP2JgiMyTF5jR5hLG3xHCPi1knBb1v9cM",
|
|
"tx_hash": "F05F670B06D641D7F6FE18E450DDB2C7A4DDF76D580C34C820939DC22AD9F582",
|
|
"tx_type": "OfferCreate",
|
|
"base_currency": "USD",
|
|
"base_issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
|
"counter_currency": "XRP"
|
|
}
|
|
]
|
|
}
|
|
</code></pre>
|
|
<h2 id="get-exchange-rates">Get Exchange Rates</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/develop/api/routesV2/getExchangeRate.js" title="Source">[Source]<br/></a></p>
|
|
<p>Retrieve an exchange rate for a given currency pair at a specific time.</p>
|
|
<h4 id="request-format-5">Request Format</h4>
|
|
<div class="multicode" id="code-5"><ul class="codetabs"><li><a href="#code-5-0">REST</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-5-0" style="position: static;"><pre><code>GET /v2/exchange_rates/{:base}/{:counter}
|
|
</code></pre></div>
|
|
</div>
|
|
<p><a class="button" href="data-api-v2-tool.html#get-exchange-rates">Try it! ></a></p>
|
|
<p>This method requires the following URL parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>:base</td>
|
|
<td>String</td>
|
|
<td>Base currency of the pair, as a <a href="#currency-code">Currency Code</a>, followed by <code>+</code> and the issuer <a href="#addresses">Address</a> unless it's XRP.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>:counter</td>
|
|
<td>String</td>
|
|
<td>Counter currency of the pair, as a <a href="#currency-code">Currency Code</a>, followed by <code>+</code> and the issuer <a href="#addresses">Address</a> unless it's XRP.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Optionally, you can also include the following query parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>date</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>Return an exchange rate for the specified time. Defaults to the current time.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>strict</td>
|
|
<td>Boolean</td>
|
|
<td>If false, allow rates derived from less than 10 exchanges. Defaults to true.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="response-format-5">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong> and has a JSON body with the following:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>result</td>
|
|
<td>String</td>
|
|
<td>The value <code>success</code> indicates that this is a successful response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>rate</td>
|
|
<td>Number</td>
|
|
<td>The requested exchange rate, or <code>0</code> if the exchange rate could not be determined.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>All exchange rates are calcuated by converting the base currency and counter currency to XRP.</p>
|
|
<p>The rate is derived from the volume weighted average over the calendar day specified, averaged with the volume weighted average of the last 50 trades within the last 14 days.</p>
|
|
<h4 id="example-5">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v2/exchange_rates/USD+rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q/XRP?date=2015-11-13T00:00:00Z
|
|
</code></pre>
|
|
<p>Response:</p>
|
|
<pre><code>{
|
|
"result": "success",
|
|
"rate": "224.65709"
|
|
}
|
|
</code></pre>
|
|
<h2 id="normalize">Normalize</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/develop/api/routesV2/normalize.js" title="Source">[Source]<br/></a></p>
|
|
<p>Convert an amount from one currency and issuer to another, using the network exchange rates.</p>
|
|
<h4 id="request-format-6">Request Format</h4>
|
|
<div class="multicode" id="code-6"><ul class="codetabs"><li><a href="#code-6-0">REST</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-6-0" style="position: static;"><pre><code>GET /v2/normalize
|
|
</code></pre></div>
|
|
</div>
|
|
<p><a class="button" href="data-api-v2-tool.html#normalize">Try it! ></a></p>
|
|
<p>This method uses the following query parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>amount</td>
|
|
<td>Number</td>
|
|
<td>(Required) Amount of currency to normalize</td>
|
|
</tr>
|
|
<tr>
|
|
<td>currency</td>
|
|
<td>String - <a href="#currency-code">Currency Code</a></td>
|
|
<td>The currency code of the <code>amount</code> to convert from. (Defaults to XRP.)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>issuer</td>
|
|
<td>String - <a href="#addresses">Address</a></td>
|
|
<td>The issuer of the currency to convert from. (Required if <code>currency</code> is not XRP.)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>exchange_currency</td>
|
|
<td>String - <a href="#currency-code">Currency Code</a></td>
|
|
<td>The currency to convert to. (Defaults to XRP.)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>exchange_issuer</td>
|
|
<td>String - <a href="#addresses">Address</a></td>
|
|
<td>The issuer of the currency to convert to. (Required if <code>exchange_currency</code> is not XRP.)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>date</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>Convert according to the exchange rate at this time. (Defaults to the current time.)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>strict</td>
|
|
<td>Boolean</td>
|
|
<td>If true, do not use exchange rates that are determined by less than 10 exchanges. (Defaults to true.)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="response-format-6">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong> and has a JSON body with the following:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>result</td>
|
|
<td>String</td>
|
|
<td>The value <code>success</code> indicates that this is a successful response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>amount</td>
|
|
<td>Number</td>
|
|
<td>Pre-conversion amount specified in the request</td>
|
|
</tr>
|
|
<tr>
|
|
<td>converted</td>
|
|
<td>Number</td>
|
|
<td>Post-conversion amount of the <code>exchange_currency</code>, or <code>0</code> if the exchange rate could not be determined.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>rate</td>
|
|
<td>Number</td>
|
|
<td>Exchange rate used to calculate the conversion, or <code>0</code> if the exchange rate could not be determined.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>All exchange rates are calculating by converting both currencies to XRP.</p>
|
|
<h4 id="example-6">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v2/normalize?amount=100&currency=XRP&exchange_currency=USD&exchange_issuer=rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q
|
|
</code></pre>
|
|
<p>Response:</p>
|
|
<pre><code>{
|
|
"result": "success",
|
|
"amount": "100",
|
|
"converted": "0.4267798022744489",
|
|
"rate": "0.0042677980"
|
|
}
|
|
</code></pre>
|
|
<h2 id="get-daily-reports">Get Daily Reports</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/develop/api/routesV2/reports.js" title="Source">[Source]<br/></a></p>
|
|
<p>Retrieve per account per day aggregated payment summaries</p>
|
|
<h4 id="request-format-7">Request Format</h4>
|
|
<div class="multicode" id="code-7"><ul class="codetabs"><li><a href="#code-7-0">REST</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-7-0" style="position: static;"><pre><code>GET /v2/reports/{:date}
|
|
</code></pre></div>
|
|
</div>
|
|
<p><a class="button" href="data-api-v2-tool.html#get-daily-reports">Try it! ></a></p>
|
|
<p>This method uses the following URL parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>date</td>
|
|
<td>String</td>
|
|
<td>(Optional) UTC query date. If omitted, use the current day.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Optionally, you can also include the following query parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>accounts</td>
|
|
<td>Boolean</td>
|
|
<td>If true, include lists of counterparty accounts. Defaults to false.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>payments</td>
|
|
<td>Boolean</td>
|
|
<td>If true, include lists of individual payments. Defaults to false.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>format</td>
|
|
<td>String</td>
|
|
<td>Format of returned results: <code>csv</code> or <code>json</code>. Defaults to <code>json</code>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>limit</td>
|
|
<td>Integer</td>
|
|
<td>Maximum results per page. Defaults to 200. Cannot be more than 1000.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>marker</td>
|
|
<td>String</td>
|
|
<td><a href="#pagination">Pagination</a> key from previously returned response</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="response-format-7">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong> and has a JSON body with the following:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>result</td>
|
|
<td>String</td>
|
|
<td>The value <code>success</code> indicates that this is a successful response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>date</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>The date for which this report applies.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>count</td>
|
|
<td>Integer</td>
|
|
<td>Number of reports returned.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>marker</td>
|
|
<td>String</td>
|
|
<td>(May be omitted) <a href="#pagination">Pagination</a> marker.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reports</td>
|
|
<td>Array of <a href="#reports-objects">Reports Objects</a></td>
|
|
<td>The requested reports. Each report pertains to a single account.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p><strong>WARNING:</strong> This method may return a very large amount of data (more than 1 megabyte), which may cause poor performance in your client application.</p>
|
|
<h4 id="example-7">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v2/reports/2015-08-19T00:00:00Z?accounts=true&payments=true
|
|
</code></pre>
|
|
<p>Response (trimmed for size):</p>
|
|
<pre><code>{
|
|
"result": "success",
|
|
"date": "2015-08-19T00:00:00Z",
|
|
"count": 2,
|
|
"marker": "20150819000000|r2nt4zXDP6Be5FNrLsiuuTEBETbGR9RFw",
|
|
"reports": [
|
|
{
|
|
"account": "r2LXq2rZWSgQ1thhKiEytzi1smg6oEn8A",
|
|
"date": "2015-08-19T00:00:00Z",
|
|
"high_value_received": "7000",
|
|
"high_value_sent": "3400",
|
|
"payments": [
|
|
{
|
|
"tx_hash": "A032EFBB219B1102BBD9BCCB91EDC6EAA8185509574FA476A2D3FE6BA79B04EF",
|
|
"amount": "1700",
|
|
"type": "received"
|
|
},
|
|
{
|
|
"tx_hash": "8B059360DC83777CDCABA84824C169651AFD6A7AB44E8742A3B8C6BC2AAF7384",
|
|
"amount": "40",
|
|
"type": "received"
|
|
},
|
|
|
|
...(additional results trimmed)...
|
|
|
|
{
|
|
"tx_hash": "76041BD6546389B5EC2CDBAA543200CF7B8D300F34F908BA5CA8523B0CA158C8",
|
|
"amount": "1400",
|
|
"type": "sent"
|
|
}
|
|
],
|
|
"payments_received": 155,
|
|
"payments_sent": 49,
|
|
"receiving_counterparties": [
|
|
"rDMFJrKg2jyoNG6WDWJknXDEKZ6ywNFGwD",
|
|
"r4XXHxraHLuCiLmLMw96FTPXXywZSnWSyR",
|
|
|
|
...(additional results trimmed)...
|
|
|
|
|
|
"rp1C4Ld6uGjurFpempUJ8q5hPSWhak5EQf"
|
|
],
|
|
"sending_counterparties": [
|
|
"rwxcJVWZSEgN2DmLZYYjyagHjMx5jQ7BAa",
|
|
|
|
...(additional results trimmed)...
|
|
|
|
|
|
"rBK1rLjbWsSU9EuST1cAz9RsiYdJPVGXXA"
|
|
],
|
|
"total_value": "210940",
|
|
"total_value_received": "100540",
|
|
"total_value_sent": "110400"
|
|
},
|
|
{
|
|
"account": "r2adXWaWFJt9mHeoWN77iHJozDz2FDAPA",
|
|
"date": "2015-08-19T00:00:00Z",
|
|
"high_value_received": "7400",
|
|
"high_value_sent": "15900",
|
|
"payments": [
|
|
{
|
|
"tx_hash": "9C7EA76D467AE58E6AEFAAC7994D42FB4E7FA72BFA22F90260937386D76BDB64",
|
|
"amount": "900",
|
|
"type": "sent"
|
|
},
|
|
|
|
...(additional results trimmed)...
|
|
|
|
|
|
{
|
|
"tx_hash": "EC25427964419394BB5D06343BC74235C33655C1F70523C688F9A201957D65BA",
|
|
"amount": "100",
|
|
"type": "sent"
|
|
}
|
|
],
|
|
"payments_received": 43,
|
|
"payments_sent": 62,
|
|
"receiving_counterparties": [
|
|
"rB4cyZxrBrTmJcWZSBc8YoW2t3bafiKRp",
|
|
|
|
...(additional results trimmed)...
|
|
|
|
|
|
"rKybkw3Pu74VfJfrWr7QJbVPJNarnKP2EJ"
|
|
],
|
|
"sending_counterparties": [
|
|
"rNRCXw8PQRjvTwMDDLZVvuLHSKqqXUXQHv",
|
|
"r7CLMVEuNvK2yXTPLPnkWMqzkkXuopWeL",
|
|
|
|
...(additional results trimmed)...
|
|
|
|
|
|
"ranyeoYRhvwiFABzDvxSVyqQKp1bMkFsaX"
|
|
],
|
|
"total_value": "117600",
|
|
"total_value_received": "54700",
|
|
"total_value_sent": "62900"
|
|
}
|
|
]
|
|
}
|
|
</code></pre>
|
|
<h2 id="get-stats">Get Stats</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/develop/api/routesV2/stats.js" title="Source">[Source]<br/></a></p>
|
|
<p>Retrieve statistics about transaction activity in the Ripple Consensus Ledger, divided into intervals of time.</p>
|
|
<h4 id="request-format-8">Request Format</h4>
|
|
<div class="multicode" id="code-8"><ul class="codetabs"><li><a href="#code-8-0">REST</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-8-0" style="position: static;"><pre><code>GET /v2/stats
|
|
</code></pre></div>
|
|
</div>
|
|
<p><a class="button" href="data-api-v2-tool.html#get-stats">Try it! ></a></p>
|
|
<p>Optionally, you can also include the following query parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>family</td>
|
|
<td>String</td>
|
|
<td>If provided, filter results to a single family of stats: <code>type</code>, <code>result</code>, or <code>metric</code>. By default, provides all stats from all families.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>metrics</td>
|
|
<td>String</td>
|
|
<td>Filter results to one or more metrics (in a comma-separated list). Requires the <code>family</code> of the metrics to be specified. By default, provides all metrics in the family.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>start</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>Filter results to this time and later.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>end</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>Filter results to this time and earlier</td>
|
|
</tr>
|
|
<tr>
|
|
<td>interval</td>
|
|
<td>String</td>
|
|
<td>Aggregation interval (<code>hour</code>,<code>day</code>,<code>week</code>, defaults to <code>day</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>limit</td>
|
|
<td>Integer</td>
|
|
<td>Maximum results per page. Defaults to 200. Cannot be more than 1000.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>marker</td>
|
|
<td>String</td>
|
|
<td><a href="#pagination">Pagination</a> key from previously returned response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>descending</td>
|
|
<td>Boolean</td>
|
|
<td>If true, return results in reverse chronological order. Defaults to false.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>format</td>
|
|
<td>String</td>
|
|
<td>Format of returned results: <code>csv</code> or <code>json</code>. Defaults to <code>json</code>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h5 id="families-and-metrics">Families and Metrics</h5>
|
|
<p>The <code>family</code> and <code>metrics</code> query parameters provide a way to filter results to a specific subset of all metrics available for transactions in any given interval. Each metric is tied to a specific family, as follows:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Family</th>
|
|
<th>Included Metrics</th>
|
|
<th>Meaning</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>All Ripple <a href="reference-transaction-format.html">transaction types</a>, including <code>Payment</code>, <code>AccountSet</code>, <code>OfferCreate</code>, and others.</td>
|
|
<td>Number of transactions of the given type that occurred during the interval.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>result</td>
|
|
<td>All <a href="reference-transaction-format.html#transaction-results">transaction result codes</a> (string codes, not the numeric codes), including <code>tesSUCCESS</code>, <code>tecPATH_DRY</code>, and many others.</td>
|
|
<td>Number of transactions that resulted in the given code during the interval.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>metric</td>
|
|
<td>Data-API defined Special Transaction Metrics.</td>
|
|
<td>(Varies)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h5 id="special-transaction-metrics">Special Transaction Metrics</h5>
|
|
<p>The Data API derives the following values for every interval. These metrics are part of the <code>metric</code> family.</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>accounts_created</td>
|
|
<td>Number</td>
|
|
<td>The number of new accounts funded during this interval.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>exchanges_count</td>
|
|
<td>Number</td>
|
|
<td>The number of currency exchanges that occurred during this interval.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>ledger_count</td>
|
|
<td>Number</td>
|
|
<td>The number of ledgers closed during this interval.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>ledger_interval</td>
|
|
<td>Number</td>
|
|
<td>The average number of seconds between ledgers closing during this interval.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>payments_count</td>
|
|
<td>Number</td>
|
|
<td>The number of payments from one account to another during this interval.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>tx_per_ledger</td>
|
|
<td>Number</td>
|
|
<td>The average number of transactions per ledger in this interval.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>If any of the metrics have a value of 0, they are omitted from the results.</p>
|
|
<h4 id="response-format-8">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong> and has a JSON body with the following:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>result</td>
|
|
<td>String</td>
|
|
<td>The value <code>success</code> indicates that this is a successful response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>count</td>
|
|
<td>Integer</td>
|
|
<td>Number of reports returned.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>marker</td>
|
|
<td>String</td>
|
|
<td>(May be omitted) <a href="#pagination">Pagination</a> marker</td>
|
|
</tr>
|
|
<tr>
|
|
<td>stats</td>
|
|
<td>Array of stats objects</td>
|
|
<td>The requested stats. Omits metrics with a value of 0, and intervals that have no nonzero metrics.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="example-8">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v2/stats/?start=2015-08-30&end=2015-08-31&interval=day&family=metric&metrics=accounts_created,exchanges_count,ledger_count,payments_count
|
|
</code></pre>
|
|
<p>Response:</p>
|
|
<pre><code>{
|
|
"result": "success",
|
|
"count": 2,
|
|
"stats": [
|
|
{
|
|
"accounts_created": 15,
|
|
"exchanges_count": 19368,
|
|
"ledger_count": 20307,
|
|
"payments_count": 24763,
|
|
"date": "2015-08-30T00:00:00Z"
|
|
},
|
|
{
|
|
"accounts_created": 18,
|
|
"exchanges_count": 17192,
|
|
"ledger_count": 19971,
|
|
"payments_count": 30894,
|
|
"date": "2015-08-31T00:00:00Z"
|
|
}
|
|
]
|
|
}
|
|
</code></pre>
|
|
<h2 id="get-capitalization">Get Capitalization</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/develop/api/routesV2/capitalization.js" title="Source">[Source]<br/></a></p>
|
|
<p>Get the total amount of a single currency issued by a single issuer, also known as the <a href="https://en.wikipedia.org/wiki/Market_capitalization">market capitalization</a>. <em>(New in <a href="https://github.com/ripple/rippled-historical-database/releases/tag/v2.0.4">v2.0.4</a>)</em></p>
|
|
<h4 id="request-format-9">Request Format</h4>
|
|
<div class="multicode" id="code-9"><ul class="codetabs"><li><a href="#code-9-0">REST</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-9-0" style="position: static;"><pre><code>GET /v2/capitaliztion/{:currency}
|
|
</code></pre></div>
|
|
</div>
|
|
<p><a class="button" href="data-api-v2-tool.html#get-capitalization">Try it! ></a></p>
|
|
<p>This method requires the following URL parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>:currency</td>
|
|
<td>String</td>
|
|
<td>Currency to look up, in the form of <a href="#currency-code">currency</a>+<a href="#addresses">issuer</a>. XRP is disallowed.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Optionally, you can also include the following query parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>start</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>Start time of query range. Defaults to <code>2013-01-01T00:00:00Z</code>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>end</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>End time of query range. Defaults to the current time.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>interval</td>
|
|
<td>String</td>
|
|
<td>Aggregation interval - <code>day</code>, <code>week</code>, or <code>month</code>. Defaults to <code>day</code>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>limit</td>
|
|
<td>Integer</td>
|
|
<td>Maximum results per page. Defaults to 200. Cannot be more than 1000.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>marker</td>
|
|
<td>String</td>
|
|
<td><a href="#pagination">Pagination</a> key from previously returned response</td>
|
|
</tr>
|
|
<tr>
|
|
<td>descending</td>
|
|
<td>Boolean</td>
|
|
<td>If true, return results in reverse chronological order. Defaults to false.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>adjusted</td>
|
|
<td>Boolean</td>
|
|
<td>If true, do not count known issuer-owned wallets towards market capitalization. Defaults to true.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>format</td>
|
|
<td>String</td>
|
|
<td>Format of returned results: <code>csv</code> or <code>json</code>. Defaults to <code>json</code>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>If the request omits both <code>start</code> and <code>end</code>, the API returns only the most recent sample.</p>
|
|
<h4 id="response-format-9">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong> and has a JSON body with the following:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>result</td>
|
|
<td>String</td>
|
|
<td>The value <code>success</code> indicates that this is a successful response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>count</td>
|
|
<td>Integer</td>
|
|
<td>Number of reports returned.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>currency</td>
|
|
<td>String</td>
|
|
<td>Currency requested</td>
|
|
</tr>
|
|
<tr>
|
|
<td>issuer</td>
|
|
<td>String</td>
|
|
<td>Issuer requested</td>
|
|
</tr>
|
|
<tr>
|
|
<td>marker</td>
|
|
<td>String</td>
|
|
<td>(May be omitted) <a href="#pagination">Pagination</a> marker</td>
|
|
</tr>
|
|
<tr>
|
|
<td>rows</td>
|
|
<td>Array of issuer capitalization objects</td>
|
|
<td>The requested capitalization data</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Each <strong>issuer capitalization object</strong> has the following fields:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>date</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>The start time of the interval this object represents.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>amount</td>
|
|
<td><a href="#numbers-and-precision">String - Number</a></td>
|
|
<td>The total amount of currency issued by the issuer as of the start of this interval.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="example-9">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v2/capitalization/USD+rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q?start=2015-01-01T00:00:00Z&end=2015-10-31&interval=month
|
|
</code></pre>
|
|
<p>Response:</p>
|
|
<pre><code>200 OK
|
|
{
|
|
"result": "success",
|
|
"currency": "USD",
|
|
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
|
"count": 10,
|
|
"rows": [
|
|
{
|
|
"date": "2015-01-01T00:00:00Z",
|
|
"amount": "4212940.254176095"
|
|
},
|
|
{
|
|
"date": "2015-02-01T00:00:00Z",
|
|
"amount": "5102817.663782776"
|
|
},
|
|
{
|
|
"date": "2015-03-01T00:00:00Z",
|
|
"amount": "4179270.8503426993"
|
|
},
|
|
{
|
|
"date": "2015-04-01T00:00:00Z",
|
|
"amount": "2609239.954946732"
|
|
},
|
|
{
|
|
"date": "2015-05-01T00:00:00Z",
|
|
"amount": "2262976.3681027396"
|
|
},
|
|
{
|
|
"date": "2015-06-01T00:00:00Z",
|
|
"amount": "2401904.277326213"
|
|
},
|
|
{
|
|
"date": "2015-07-01T00:00:00Z",
|
|
"amount": "2007614.760195671"
|
|
},
|
|
{
|
|
"date": "2015-08-01T00:00:00Z",
|
|
"amount": "2286058.6013003727"
|
|
},
|
|
{
|
|
"date": "2015-09-01T00:00:00Z",
|
|
"amount": "2070512.4729615194"
|
|
},
|
|
{
|
|
"date": "2015-10-01T00:00:00Z",
|
|
"amount": "2140238.7719266433"
|
|
}
|
|
]
|
|
}
|
|
</code></pre>
|
|
<h2 id="get-active-accounts">Get Active Accounts</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/develop/api/routesV2/activeAccounts.js" title="Source">[Source]<br/></a></p>
|
|
<p>Get information on which accounts are actively trading in a specific currency pair. <em>(New in <a href="https://github.com/ripple/rippled-historical-database/releases/tag/v2.0.4">v2.0.4</a>)</em></p>
|
|
<h4 id="request-format-10">Request Format</h4>
|
|
<div class="multicode" id="code-10"><ul class="codetabs"><li><a href="#code-10-0">REST</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-10-0" style="position: static;"><pre><code>GET /v2/active_accounts/{:base}/{:counter}
|
|
</code></pre></div>
|
|
</div>
|
|
<p><a class="button" href="data-api-v2-tool.html#get-active-accounts">Try it! ></a></p>
|
|
<p>This method requires the following URL parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>:base</td>
|
|
<td>String</td>
|
|
<td>Base currency of the pair, as a <a href="#currency-code">Currency Code</a>, followed by <code>+</code> and the issuer <a href="#addresses">Address</a> unless it's XRP.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>:counter</td>
|
|
<td>String</td>
|
|
<td>Counter currency of the pair, as a <a href="#currency-code">Currency Code</a>, followed by <code>+</code> and the issuer <a href="#addresses">Address</a> unless it's XRP.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Optionally, you can also include the following query parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>period</td>
|
|
<td>String</td>
|
|
<td>Get results for trading activity during a chosen time period. Valid periods are <code>1day</code>, <code>3day</code>, or <code>7day</code>. Defaults to <code>1day</code>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>date</td>
|
|
<td>String</td>
|
|
<td>Get results for the period starting at this time. Defaults to the most recent period available.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>include_exchanges</td>
|
|
<td>Boolean</td>
|
|
<td>Include individual exchanges for each account in the results.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>format</td>
|
|
<td>String</td>
|
|
<td>Format of returned results: <code>csv</code> or <code>json</code>. Defaults to <code>json</code>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="response-format-10">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong> and has a JSON body with the following:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>result</td>
|
|
<td>String</td>
|
|
<td>The value <code>success</code> indicates that this is a successful response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>count</td>
|
|
<td>Integer</td>
|
|
<td>Number of accounts returned.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>exchanges_count</td>
|
|
<td>Integer</td>
|
|
<td>Total number of exchanges in the period.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>accounts</td>
|
|
<td>Array of active Account Trading Objects</td>
|
|
<td>Active trading accounts for the period</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Each "Account Trading Object" describes the activity of a single account during the period, and has the following fields:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>buy</td>
|
|
<td>Object</td>
|
|
<td>Summary of currency exchanges buying the base currency</td>
|
|
</tr>
|
|
<tr>
|
|
<td>buy.base_volume</td>
|
|
<td>Number</td>
|
|
<td>Amount of base currency the account bought in this period.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>buy.counter_volume</td>
|
|
<td>Number</td>
|
|
<td>Amount of counter currency the account sold in this period.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>buy.count</td>
|
|
<td>Number</td>
|
|
<td>Number of trades that bought the base currency in this period.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>sell</td>
|
|
<td>Object</td>
|
|
<td>Summary of currency changes selling the base currency</td>
|
|
</tr>
|
|
<tr>
|
|
<td>sell.base_volume</td>
|
|
<td>Number</td>
|
|
<td>Amount of the base currency the account sold this period.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>sell.counter_volume</td>
|
|
<td>Number</td>
|
|
<td>Amount of the counter currency the account bought this period.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>sell.count</td>
|
|
<td>Number</td>
|
|
<td>Number of trades that sold the base currency.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>account</td>
|
|
<td>String - Address</td>
|
|
<td>The address whose activity this object describes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>base_volume</td>
|
|
<td>Number</td>
|
|
<td>The total volume of the base currency the account bought and sold in this period.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>counter_volume</td>
|
|
<td>Number</td>
|
|
<td>The total volume of the counter currency the account bought and sold in this period.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>count</td>
|
|
<td>Number</td>
|
|
<td>The total number of exchanges the account made during this period.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="example-10">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v2/active_accounts/XRP/USD+rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q
|
|
</code></pre>
|
|
<p>Response:</p>
|
|
<pre><code>{
|
|
"result": "success",
|
|
"count": 12,
|
|
"exchanges_count": 11,
|
|
"accounts": [
|
|
{
|
|
"buy": {
|
|
"base_volume": 0,
|
|
"counter_volume": 0,
|
|
"count": 0
|
|
},
|
|
"sell": {
|
|
"base_volume": 13084.822874,
|
|
"counter_volume": 54.499328645454604,
|
|
"count": 4
|
|
},
|
|
"account": "rGBQhB8EH5DmqMmfKPLchpqr3MR19pv6zN",
|
|
"base_volume": 13084.822874,
|
|
"counter_volume": 54.499328645454604,
|
|
"count": 4
|
|
},
|
|
{
|
|
"buy": {
|
|
"base_volume": 12597.822874,
|
|
"counter_volume": 52.4909286454546,
|
|
"count": 1
|
|
},
|
|
"sell": {
|
|
"base_volume": 0,
|
|
"counter_volume": 0,
|
|
"count": 0
|
|
},
|
|
"account": "rQE5Z3FgVnRMbVfS6xiVQFgB4J3X162FVD",
|
|
"base_volume": 12597.822874,
|
|
"counter_volume": 52.4909286454546,
|
|
"count": 1
|
|
},
|
|
|
|
... (additional results trimmed)...
|
|
|
|
{
|
|
"buy": {
|
|
"base_volume": 1.996007,
|
|
"counter_volume": 0.008782427920595,
|
|
"count": 1
|
|
},
|
|
"sell": {
|
|
"base_volume": 0,
|
|
"counter_volume": 0,
|
|
"count": 0
|
|
},
|
|
"account": "rD8LigXE7165r3VWhSQ4FwzJy7PNrTMwUq",
|
|
"base_volume": 1.996007,
|
|
"counter_volume": 0.008782427920595,
|
|
"count": 1
|
|
},
|
|
{
|
|
"buy": {
|
|
"base_volume": 0,
|
|
"counter_volume": 0,
|
|
"count": 0
|
|
},
|
|
"sell": {
|
|
"base_volume": 0.1,
|
|
"counter_volume": 0.0004821658905462904,
|
|
"count": 1
|
|
},
|
|
"account": "rfh3pFHkCXv3TgzsEJgyCzF1CduZHCLi9o",
|
|
"base_volume": 0.1,
|
|
"counter_volume": 0.0004821658905462904,
|
|
"count": 1
|
|
}
|
|
]
|
|
}
|
|
</code></pre>
|
|
<h2 id="get-exchange-volume">Get Exchange Volume</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/develop/api/routesV2/network/getMetric.js" title="Source">[Source]<br/></a></p>
|
|
<p>Get aggregated exchange volume for a given time period. <em>(New in <a href="https://github.com/ripple/rippled-historical-database/releases/tag/v2.0.4">v2.0.4</a>)</em></p>
|
|
<p>The API returns results in units of a single <em>display currency</em> rather than many different currencies. The conversion uses standard rates to and from XRP.</p>
|
|
<h4 id="request-format-11">Request Format</h4>
|
|
<div class="multicode" id="code-11"><ul class="codetabs"><li><a href="#code-11-0">REST</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-11-0" style="position: static;"><pre><code>GET /v2/network/exchange_volume
|
|
</code></pre></div>
|
|
</div>
|
|
<p><a class="button" href="data-api-v2-tool.html#get-exchange-volume">Try it! ></a></p>
|
|
<p>Optionally, you can include the following query parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>start</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>Start time of query range. Defaults to the start of the most recent interval.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>end</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>End time of query range. Defaults to the end of the most recent interval.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>interval</td>
|
|
<td>String</td>
|
|
<td>Aggregation interval - valid intervals are <code>day</code>, <code>week</code>, or <code>month</code>. Defaults to <code>day</code>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>exchange_currency</td>
|
|
<td>String - <a href="#currency-code">Currency Code</a></td>
|
|
<td>Normalize all amounts to use this as a display currency. If not XRP, <code>exchange_issuer</code> is also required. Defaults to XRP.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>exchange_issuer</td>
|
|
<td>String - <a href="#addresses">Address</a></td>
|
|
<td>Normalize results to the specified <code>currency</code> issued by this issuer.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>limit</td>
|
|
<td>Integer</td>
|
|
<td>Maximum results per page. Defaults to 200. Cannot be more than 1000.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>marker</td>
|
|
<td>String</td>
|
|
<td><a href="#pagination">Pagination</a> key from previously returned response</td>
|
|
</tr>
|
|
<tr>
|
|
<td>format</td>
|
|
<td>String</td>
|
|
<td>Format of returned results: <code>csv</code> or <code>json</code>. Defaults to <code>json</code>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="response-format-11">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong> and has a JSON body with the following:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>result</td>
|
|
<td>String</td>
|
|
<td>The value <code>success</code> indicates that this is a successful response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>count</td>
|
|
<td>Integer</td>
|
|
<td>Number of results returned.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>rows</td>
|
|
<td>Array of exchange <a href="#volume-objects">Volume Objects</a></td>
|
|
<td>Exchange volumes for each interval in the requested time period. (By default, this method only returns the most recent interval.)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Each object in the <code>components</code> array of the Volume Objects represent the volume of exchanges in a market between two currencies, and has the following fields:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>count</td>
|
|
<td>Number</td>
|
|
<td>The number of exchanges in this market during this interval.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>rate</td>
|
|
<td>Number</td>
|
|
<td>The exchange rate from the base currency to the display currency.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>amount</td>
|
|
<td>Number</td>
|
|
<td>The amount of volume in the market, in units of the base currency.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>base</td>
|
|
<td>Object</td>
|
|
<td>The <code>currency</code> and <code>issuer</code> that identify the base currency of this market. There is no <code>issuer</code> for XRP.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>counter</td>
|
|
<td>Object</td>
|
|
<td>The <code>currency</code> and <code>issuer</code> that identify the counter currency of this market. There is no <code>issuer</code> for XRP.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>converted_amount</td>
|
|
<td>Number</td>
|
|
<td>The total amount of volume in the market, converted to the display currency. <em>(Before <a href="https://github.com/ripple/rippled-historical-database/releases/tag/v2.1.0">v2.1.0</a>, this was <code>convertedAmount</code>.)</em></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="example-11">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v2/network/exchange_volume?exchange_currency=USD&exchange_issuer=rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B
|
|
</code></pre>
|
|
<p>Response:</p>
|
|
<pre><code>{
|
|
"result": "success",
|
|
"count": 1,
|
|
"rows": [
|
|
{
|
|
"components": [
|
|
{
|
|
"count": 1711,
|
|
"rate": 5.514373809662552e-8,
|
|
"amount": 333.7038784107369,
|
|
"base": {
|
|
"currency": "BTC",
|
|
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
|
|
},
|
|
"counter": {
|
|
"currency": "XRP"
|
|
},
|
|
"converted_amount": 117720.99268355068
|
|
},
|
|
{
|
|
"count": 1977,
|
|
"rate": 0.000019601413454357618,
|
|
"amount": 74567.72531650064,
|
|
"base": {
|
|
"currency": "USD",
|
|
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
|
|
},
|
|
"counter": {
|
|
"currency": "XRP"
|
|
},
|
|
"converted_amount": 74003.51871932109
|
|
},
|
|
|
|
... (additional results trimmed) ...
|
|
|
|
{
|
|
"count": 3,
|
|
"rate": 0.022999083584408355,
|
|
"amount": 85.40728674708998,
|
|
"base": {
|
|
"currency": "CNY",
|
|
"issuer": "razqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA"
|
|
},
|
|
"counter": {
|
|
"currency": "USD",
|
|
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
|
|
},
|
|
"converted_amount": 12.72863756671683
|
|
},
|
|
{
|
|
"count": 3,
|
|
"rate": 1.7749889023209692e-7,
|
|
"amount": 570.687912196755,
|
|
"base": {
|
|
"currency": "JPY",
|
|
"issuer": "r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN"
|
|
},
|
|
"counter": {
|
|
"currency": "BTC",
|
|
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q"
|
|
},
|
|
"converted_amount": 4.4137945368632545
|
|
}
|
|
],
|
|
"count": 11105,
|
|
"endTime": "2015-09-11T19:58:58+00:00",
|
|
"exchange": {
|
|
"currency": "USD",
|
|
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
|
|
},
|
|
"exchangeRate": 0.004410567085248279,
|
|
"startTime": "2015-11-10T00:06:04+00:00",
|
|
"total": 442442.5974313684
|
|
}
|
|
]
|
|
}
|
|
</code></pre>
|
|
<h2 id="get-payment-volume">Get Payment Volume</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/develop/api/routesV2/network/getMetric.js" title="Source">[Source]<br/></a></p>
|
|
<p>Get aggregated payment volume for a given time period. <em>(New in <a href="https://github.com/ripple/rippled-historical-database/releases/tag/v2.0.4">v2.0.4</a>)</em></p>
|
|
<p>The API returns results in units of a single <em>display currency</em> rather than many different currencies. The conversion uses standard rates to and from XRP.</p>
|
|
<h4 id="request-format-12">Request Format</h4>
|
|
<div class="multicode" id="code-12"><ul class="codetabs"><li><a href="#code-12-0">REST</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-12-0" style="position: static;"><pre><code>GET /v2/network/payment_volume
|
|
</code></pre></div>
|
|
</div>
|
|
<p><a class="button" href="data-api-v2-tool.html#get-payment-volume">Try it! ></a></p>
|
|
<p>Optionally, you can include the following query parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>start</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>Start time of query range. Defaults to the start of the most recent interval.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>end</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>End time of query range. Defaults to the end of the most recent interval.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>interval</td>
|
|
<td>String</td>
|
|
<td>Aggregation interval - valid intervals are <code>day</code>, <code>week</code>, or <code>month</code>. Defaults to <code>day</code>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>exchange_currency</td>
|
|
<td>String - <a href="#currency-code">Currency Code</a></td>
|
|
<td>Normalize all amounts to use this as a display currency. If not XRP, <code>exchange_issuer</code> is also required. Defaults to XRP.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>exchange_issuer</td>
|
|
<td>String - <a href="#addresses">Address</a></td>
|
|
<td>Normalize results to the specified <code>currency</code> issued by this issuer.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>limit</td>
|
|
<td>Integer</td>
|
|
<td>Maximum results per page. Defaults to 200. Cannot be more than 1000.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>marker</td>
|
|
<td>String</td>
|
|
<td><a href="#pagination">Pagination</a> key from previously returned response</td>
|
|
</tr>
|
|
<tr>
|
|
<td>format</td>
|
|
<td>String</td>
|
|
<td>Format of returned results: <code>csv</code> or <code>json</code>. Defaults to <code>json</code>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="response-format-12">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong> and has a JSON body with the following:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>result</td>
|
|
<td>String</td>
|
|
<td>The value <code>success</code> indicates that this is a successful response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>count</td>
|
|
<td>Integer</td>
|
|
<td>Number of results returned.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>rows</td>
|
|
<td>Array of payment <a href="#volume-objects">Volume Objects</a></td>
|
|
<td>Payment volumes for each interval in the requested time period. (By default, this method only returns the most recent interval.)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Each object in the <code>components</code> array of the Volume Objects represent the volume of payments for one currencies and issuer, and has the following fields:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>currency</td>
|
|
<td>String - <a href="#currency-code">Currency Code</a></td>
|
|
<td>The currency of this payment volume object.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>issuer</td>
|
|
<td>String - <a href="#addresses">Address</a></td>
|
|
<td>(Omitted for XRP) The issuer of this payment volume object.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>amount</td>
|
|
<td>Number</td>
|
|
<td>Total payment volume for this currency during the interval, in units of the currency itself.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>count</td>
|
|
<td>Number</td>
|
|
<td>The total number of payments in this currency</td>
|
|
</tr>
|
|
<tr>
|
|
<td>rate</td>
|
|
<td>Number</td>
|
|
<td>The exchange rate between this currency and the display currency.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>converted_amount</td>
|
|
<td>Number</td>
|
|
<td>Total payment volume for this currency, converted to the display currency. <em>(Before <a href="https://github.com/ripple/rippled-historical-database/releases/tag/v2.1.0">v2.1.0</a>, this was <code>convertedAmount</code>.)</em></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="example-12">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v2/network/payment_volume
|
|
</code></pre>
|
|
<p>Response:</p>
|
|
<pre><code>{
|
|
"result": "success",
|
|
"count": 1,
|
|
"rows": [
|
|
{
|
|
"components": [
|
|
{
|
|
"currency": "USD",
|
|
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
|
"amount": 87279.59029136538,
|
|
"count": 331,
|
|
"rate": 0.004412045860957953,
|
|
"converted_amount": 19782113.1153009
|
|
},
|
|
{
|
|
"currency": "USD",
|
|
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
|
"amount": 0,
|
|
"count": 0,
|
|
"rate": 0.00451165816091143,
|
|
"converted_amount": 0
|
|
},
|
|
{
|
|
"currency": "BTC",
|
|
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
|
"amount": 279.03077460240354,
|
|
"count": 107,
|
|
"rate": 0.000013312520335244644,
|
|
"converted_amount": 20960026.169024874
|
|
},
|
|
|
|
... (additional results trimmed) ...
|
|
|
|
{
|
|
"currency": "MXN",
|
|
"issuer": "rG6FZ31hDHN1K5Dkbma3PSB5uVCuVVRzfn",
|
|
"amount": 49263.13280138676,
|
|
"count": 19,
|
|
"rate": 0.07640584677247926,
|
|
"converted_amount": 644756.0609868265
|
|
},
|
|
{
|
|
"currency": "XRP",
|
|
"amount": 296246369.30089426,
|
|
"count": 8691,
|
|
"rate": 1,
|
|
"converted_amount": 296246369.30089426
|
|
}
|
|
],
|
|
"count": 9388,
|
|
"endTime": "2015-09-11T19:58:59+00:00",
|
|
"exchange": {
|
|
"currency": "XRP"
|
|
},
|
|
"exchangeRate": 1,
|
|
"startTime": "2015-11-10T00:19:04+00:00",
|
|
"total": 390754174.7837752
|
|
}
|
|
]
|
|
}
|
|
</code></pre>
|
|
<h2 id="get-issued-value">Get Issued Value</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/develop/api/routesV2/network/getMetric.js" title="Source">[Source]<br/></a></p>
|
|
<p>Get the total value of all currencies issued by a selection of major gateways over time. By default, returns only the most recent measurement. <em>(New in <a href="https://github.com/ripple/rippled-historical-database/releases/tag/v2.0.4">v2.0.4</a>)</em></p>
|
|
<p>The API returns results in units of a single <em>display currency</em> rather than many different currencies. The conversion uses standard rates to and from XRP.</p>
|
|
<h4 id="request-format-13">Request Format</h4>
|
|
<div class="multicode" id="code-13"><ul class="codetabs"><li><a href="#code-13-0">REST</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-13-0" style="position: static;"><pre><code>GET /v2/network/issued_value
|
|
</code></pre></div>
|
|
</div>
|
|
<p><a class="button" href="data-api-v2-tool.html#get-issued-value">Try it! ></a></p>
|
|
<p>Optionally, you can include the following query parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>start</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>Start time of query range. Defaults to the start of the most recent interval.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>end</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>End time of query range. Defaults to the end of the most recent interval.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>exchange_currency</td>
|
|
<td>String - <a href="#currency-code">Currency Code</a></td>
|
|
<td>Normalize all amounts to use this as a display currency. If not XRP, <code>exchange_issuer</code> is also required. Defaults to XRP.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>exchange_issuer</td>
|
|
<td>String - <a href="#addresses">Address</a></td>
|
|
<td>Normalize results to the specified <code>currency</code> issued by this issuer.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>limit</td>
|
|
<td>Integer</td>
|
|
<td>Maximum results per page. Defaults to 200. Cannot be more than 1000.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>marker</td>
|
|
<td>String</td>
|
|
<td><a href="#pagination">Pagination</a> key from previously returned response</td>
|
|
</tr>
|
|
<tr>
|
|
<td>format</td>
|
|
<td>String</td>
|
|
<td>Format of returned results: <code>csv</code> or <code>json</code>. Defaults to <code>json</code>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="response-format-13">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong> and has a JSON body with the following:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>result</td>
|
|
<td>String</td>
|
|
<td>The value <code>success</code> indicates that this is a successful response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>count</td>
|
|
<td>Integer</td>
|
|
<td>Number of results returned.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>rows</td>
|
|
<td>Array of Issued Value Objects</td>
|
|
<td>Aggregated capitalization at the requested point(s) in time.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Each Issued Value Object represents the total value issued at one point in time, and has the following fields:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>components</td>
|
|
<td>Array of Objects</td>
|
|
<td>The data on individual issuers that was used to assemble this total.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>exchange</td>
|
|
<td>Object</td>
|
|
<td>Indicates the display currency used, as with fields <code>currency</code> and (except for XRP) <code>issuer</code>. All amounts are normalized by first converting to XRP, and then to the display currency specified in the request.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>exchangeRate</td>
|
|
<td>Number</td>
|
|
<td>The exchange rate to the displayed currency from XRP.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>time</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>The time at which this data was measured.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>total</td>
|
|
<td>Number</td>
|
|
<td>Total value of all issued assets at this time, in units of the display currency.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="example-13">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v2/network/issued_value?start=2015-10-01T00:00:00&end=2015-10-01T00:00:00&exchange_currency=USD&exchange_issuer=rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q
|
|
</code></pre>
|
|
<p>Response:</p>
|
|
<pre><code>{
|
|
"result": "success",
|
|
"count": 1,
|
|
"rows": [
|
|
{
|
|
"components": [
|
|
{
|
|
"currency": "USD",
|
|
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
|
"amount": "2177473.2843876695",
|
|
"rate": "0.000028818194",
|
|
"converted_amount": "2166521.1303508882"
|
|
},
|
|
{
|
|
"currency": "USD",
|
|
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
|
"amount": "1651297.315492664",
|
|
"rate": "0.000028888001",
|
|
"converted_amount": "1639021.4313562333"
|
|
},
|
|
|
|
... (additional results trimmed for size) ...
|
|
|
|
{
|
|
"currency": "MXN",
|
|
"issuer": "rG6FZ31hDHN1K5Dkbma3PSB5uVCuVVRzfn",
|
|
"amount": "2288827.2376308907",
|
|
"rate": "0.00050850375",
|
|
"converted_amount": "129061.20018881827"
|
|
}
|
|
],
|
|
"exchange": {
|
|
"currency": "USD",
|
|
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q"
|
|
},
|
|
"total": "8338101.394233938",
|
|
"exchange_rate": "0.0053547404",
|
|
"date": "2015-10-01T00:00:00Z"
|
|
}
|
|
]
|
|
}
|
|
</code></pre>
|
|
<h2 id="get-top-currencies">Get Top Currencies</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/develop/api/routesV2/network/topCurrencies.js" title="Source">[Source]<br/></a></p>
|
|
<p>Returns the top currencies on the Ripple Consensus Ledger, ordered from highest rank to lowest. The ranking is determined by the volume and count of transactions and the number of unique counterparties. By default, returns results for the 30-day rolling window ending on the current date. You can specify a date to get results for the 30-day window ending on that date. <em>(New in <a href="https://github.com/ripple/rippled-historical-database/releases/tag/v2.1.0">v2.1.0</a>)</em></p>
|
|
<h4 id="request-format-14">Request Format</h4>
|
|
<div class="multicode" id="code-14"><ul class="codetabs"><li><a href="#code-14-0">Most Recent</a></li><li><a href="#code-14-1">By Date</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-14-0" style="position: static;"><pre><code>GET /v2/network/top_currencies
|
|
</code></pre></div>
|
|
|
|
<div class="code_sample" id="code-14-1" style="position: static;"><pre><code>GET /v2/network/top_currencies/2016-01-01
|
|
</code></pre></div>
|
|
</div>
|
|
<p><a class="button" href="data-api-v2-tool.html#get-top-currencies">Try it! ></a></p>
|
|
<p>This method does not accept any query parameters.</p>
|
|
<h4 id="response-format-14">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong> and has a JSON body with the following:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>result</td>
|
|
<td>String</td>
|
|
<td>The value <code>success</code> indicates that this is a successful response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>date</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>The time at which this data was measured.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>count</td>
|
|
<td>Integer</td>
|
|
<td>Number of objects in the <code>currencies</code> field.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>currencies</td>
|
|
<td>Array of Top Currency Objects</td>
|
|
<td>The top currencies for this data sample. Each member represents one currency, by currency code and issuer.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Each Top Currency Object has the following fields:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>currency</td>
|
|
<td>String - <a href="#currency-code">Currency Code</a></td>
|
|
<td>The currency this object describes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>issuer</td>
|
|
<td>String - <a href="#addresses">Address</a></td>
|
|
<td>The Ripple address that issues this currency</td>
|
|
</tr>
|
|
<tr>
|
|
<td>avg_exchange_count</td>
|
|
<td><a href="#numbers-and-precision">String - Number</a></td>
|
|
<td>Daily average number of <a href="#exchange-objects">exchanges</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>avg_exchange_volume</td>
|
|
<td><a href="#numbers-and-precision">String - Number</a></td>
|
|
<td>Daily average volume of exchanges, normalized to XRP</td>
|
|
</tr>
|
|
<tr>
|
|
<td>avg_payment_count</td>
|
|
<td><a href="#numbers-and-precision">String - Number</a></td>
|
|
<td>Daily average number of <a href="#payment-objects">payments</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>avg_payment_volume</td>
|
|
<td><a href="#numbers-and-precision">String - Number</a></td>
|
|
<td>Daily average volume of payments, normalized to XRP</td>
|
|
</tr>
|
|
<tr>
|
|
<td>issued_value</td>
|
|
<td><a href="#numbers-and-precision">String - Number</a></td>
|
|
<td>Total amount of this currency issued by this issuer, normalized to XRP</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="example-14">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v2/network/top_currencies/2015-12-31
|
|
</code></pre>
|
|
<p>Response:</p>
|
|
<pre><code>{
|
|
result: "success",
|
|
date: "2015-12-31T00:00:00Z",
|
|
count: 41,
|
|
currencies: [
|
|
{
|
|
avg_exchange_count: "4652.1612903225805",
|
|
avg_exchange_volume: "5.872515158748898E7",
|
|
avg_payment_count: "406.5625",
|
|
avg_payment_volume: "592537.1043782063",
|
|
issued_value: "3.3304427137620807E8",
|
|
currency: "USD",
|
|
issuer: "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
|
|
},
|
|
{
|
|
avg_exchange_count: "6083.193548387097",
|
|
avg_exchange_volume: "3.558897661266646E7",
|
|
avg_payment_count: "520.71875",
|
|
avg_payment_volume: "3507232.307236187",
|
|
issued_value: "1.1695602455168623E8",
|
|
currency: "CNY",
|
|
issuer: "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y"
|
|
},
|
|
{
|
|
avg_exchange_count: "3715.0967741935483",
|
|
avg_exchange_volume: "3.7346262589967564E7",
|
|
avg_payment_count: "163.1875",
|
|
avg_payment_volume: "775.0342076125125",
|
|
issued_value: "1.906530130641547E8",
|
|
currency: "BTC",
|
|
issuer: "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
|
|
},
|
|
...
|
|
]
|
|
}
|
|
</code></pre>
|
|
<h2 id="get-top-markets">Get Top Markets</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/develop/api/routesV2/network/topMarkets.js" title="Source">[Source]<br/></a></p>
|
|
<p>Returns the top exchange markets on the Ripple Consensus Ledger, ordered from highest rank to lowest. The rank is determined by the number and volume of exchanges and the number of counterparties participating. By default, returns top markets for the 30-day rolling window ending on the current date. You can specify a date to get results for the 30-day window ending on that date. <em>(New in <a href="https://github.com/ripple/rippled-historical-database/releases/tag/v2.1.0">v2.1.0</a>)</em></p>
|
|
<h4 id="request-format-15">Request Format</h4>
|
|
<div class="multicode" id="code-15"><ul class="codetabs"><li><a href="#code-15-0">Most Recent</a></li><li><a href="#code-15-1">By Date</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-15-0" style="position: static;"><pre><code>GET /v2/network/top_markets
|
|
</code></pre></div>
|
|
|
|
<div class="code_sample" id="code-15-1" style="position: static;"><pre><code>GET /v2/network/top_markets/2016-01-01
|
|
</code></pre></div>
|
|
</div>
|
|
<p>This method does not accept any query parameters.</p>
|
|
<p><a class="button" href="data-api-v2-tool.html#get-top-markets">Try it! ></a></p>
|
|
<h4 id="response-format-15">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong> and has a JSON body with the following:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>result</td>
|
|
<td>String</td>
|
|
<td>The value <code>success</code> indicates that this is a successful response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>date</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>The end of the rolling window over which this data was calculated.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>count</td>
|
|
<td>Integer</td>
|
|
<td>Number of results in the <code>markets</code> field.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>markets</td>
|
|
<td>Array of Top Market Objects</td>
|
|
<td>The top markets for this data sample. Each member represents a currency pair.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Each Top Market object has the following fields:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>base_currency</td>
|
|
<td>String - <a href="#currency-code">Currency Code</a></td>
|
|
<td>The base currency for this market</td>
|
|
</tr>
|
|
<tr>
|
|
<td>base_issuer</td>
|
|
<td>String - <a href="#addresses">Address</a></td>
|
|
<td>(Omitted if <code>base_currency</code> is XRP) The Ripple address that issues the base currency</td>
|
|
</tr>
|
|
<tr>
|
|
<td>counter_currency</td>
|
|
<td>String - <a href="#currency-code">Currency Code</a></td>
|
|
<td>The counter currency for this market</td>
|
|
</tr>
|
|
<tr>
|
|
<td>counter_issuer</td>
|
|
<td>String - <a href="#addresses">Address</a></td>
|
|
<td>(Omitted if <code>counter_currency</code> is XRP) The Ripple address that issues the counter currency</td>
|
|
</tr>
|
|
<tr>
|
|
<td>avg_base_volume</td>
|
|
<td>String</td>
|
|
<td>Daily average volume in terms of the base currency</td>
|
|
</tr>
|
|
<tr>
|
|
<td>avg_counter_volume</td>
|
|
<td>String</td>
|
|
<td>Daily average volume in terms of the counter currency</td>
|
|
</tr>
|
|
<tr>
|
|
<td>avg_exchange_count</td>
|
|
<td>String</td>
|
|
<td>Daily average number of <a href="#exchange-objects">exchanges</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>avg_volume</td>
|
|
<td>String</td>
|
|
<td>Daily average volume, normalized to XRP</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="example-15">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v2/network/top_markets/2015-12-31
|
|
</code></pre>
|
|
<p>Response:</p>
|
|
<pre><code>{
|
|
result: "success",
|
|
date: "2015-12-31T00:00:00Z",
|
|
count: 56,
|
|
markets: [
|
|
{
|
|
avg_base_volume: "116180.98607935428",
|
|
avg_counter_volume: "1.6657039295476614E7",
|
|
avg_exchange_count: "1521.4603174603174",
|
|
avg_volume: "1.6657039295476614E7",
|
|
base_currency: "USD",
|
|
base_issuer: "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
|
counter_currency: "XRP"
|
|
},
|
|
{
|
|
avg_base_volume: "410510.0286920887",
|
|
avg_counter_volume: "9117398.719214212",
|
|
avg_exchange_count: "1902.1587301587301",
|
|
avg_volume: "9117398.719214212",
|
|
base_currency: "CNY",
|
|
base_issuer: "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y",
|
|
counter_currency: "XRP"
|
|
},
|
|
{
|
|
avg_base_volume: "178.06809101586364",
|
|
avg_counter_volume: "1.1343000055456754E7",
|
|
avg_exchange_count: "1224.2857142857142",
|
|
avg_volume: "1.1343000055456754E7",
|
|
base_currency: "BTC",
|
|
base_issuer: "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
|
counter_currency: "XRP"
|
|
},
|
|
...
|
|
]
|
|
}
|
|
</code></pre>
|
|
<h2 id="get-all-gateways">Get All Gateways</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/develop/api/routesV2/gateways.js" title="Source">[Source]<br/></a></p>
|
|
<p>Get information about <a href="https://github.com/ripple/rippled-historical-database/blob/v2.0.4/api/gateways/gateways.json">known gateways</a>. <em>(New in <a href="https://github.com/ripple/rippled-historical-database/releases/tag/v2.0.4">v2.0.4</a>)</em></p>
|
|
<h4 id="request-format-16">Request Format</h4>
|
|
<div class="multicode" id="code-16"><ul class="codetabs"><li><a href="#code-16-0">REST</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-16-0" style="position: static;"><pre><code>GET /v2/gateways/
|
|
</code></pre></div>
|
|
</div>
|
|
<p><a class="button" href="data-api-v2-tool.html#get-all-gateways">Try it! ></a></p>
|
|
<p>This method takes no query parameters.</p>
|
|
<h4 id="response-format-16">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong> and has a JSON body.</p>
|
|
<p>Each field in the top level JSON object is a <a href="#currency-code">Currency Code</a>. The content of each field is an array of objects, representing gateways that issue that currency. Each object has the following fields:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>name</td>
|
|
<td>String</td>
|
|
<td>A human-readable proper name for the gateway.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>account</td>
|
|
<td>String - <a href="#addresses">Address</a></td>
|
|
<td>The issuing account (cold wallet) that issues the currency.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>featured</td>
|
|
<td>Boolean</td>
|
|
<td>Whether this gateway is considered a "featured" issuer of the currency. Ripple decides which gateways to feature based on responsible business practices, volume, and other measures.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>label</td>
|
|
<td>String</td>
|
|
<td>(May be omitted) Only provided when the <a href="#currency-code">Currency Code</a> is a 40-character hexadecimal value. This is an alternate human-readable name for the currency issued by this gateway.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>assets</td>
|
|
<td>Array of Strings</td>
|
|
<td>Graphics filenames available for this gateway, if any. (Mostly, these are logos used by Ripple Charts.)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="example-16">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v2/gateways/
|
|
</code></pre>
|
|
<p>Response:</p>
|
|
<pre><code>{
|
|
"AUD": [
|
|
{
|
|
"name": "Bitstamp",
|
|
"account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
|
"featured": false,
|
|
"assets": [
|
|
"logo.grayscale.svg",
|
|
"logo.svg"
|
|
]
|
|
},
|
|
{
|
|
"name": "Coinex",
|
|
"account": "rsP3mgGb2tcYUrxiLFiHJiQXhsziegtwBc",
|
|
"featured": false,
|
|
"assets": []
|
|
}
|
|
],
|
|
|
|
... (additional results trimmed) ...
|
|
|
|
"0158415500000000C1F76FF6ECB0BAC600000000": [
|
|
{
|
|
"name": "GBI",
|
|
"account": "rrh7rf1gV2pXAoqA8oYbpHd8TKv5ZQeo67",
|
|
"featured": false,
|
|
"label": "XAU (-0.5pa)",
|
|
"assets": []
|
|
}
|
|
],
|
|
"KRW": [
|
|
{
|
|
"name": "EXRP",
|
|
"account": "rPxU6acYni7FcXzPCMeaPSwKcuS2GTtNVN",
|
|
"featured": true,
|
|
"assets": []
|
|
},
|
|
{
|
|
"name": "Pax Moneta",
|
|
"account": "rUkMKjQitpgAM5WTGk79xpjT38DEJY283d",
|
|
"featured": false,
|
|
"assets": []
|
|
}
|
|
]
|
|
}
|
|
</code></pre>
|
|
<h2 id="get-gateway">Get Gateway</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/develop/api/routesV2/gateways.js" title="Source">[Source]<br/></a></p>
|
|
<p>Get information about a specific gateway from <a href="https://github.com/ripple/rippled-historical-database/blob/v2.0.4/api/gateways/gateways.json">the Data API's list of known gateways</a>. <em>(New in <a href="https://github.com/ripple/rippled-historical-database/releases/tag/v2.0.4">v2.0.4</a>)</em></p>
|
|
<h4 id="request-format-17">Request Format</h4>
|
|
<div class="multicode" id="code-17"><ul class="codetabs"><li><a href="#code-17-0">REST</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-17-0" style="position: static;"><pre><code>GET /v2/gateways/{:gateway}
|
|
</code></pre></div>
|
|
</div>
|
|
<p><a class="button" href="data-api-v2-tool.html#get-gateway">Try it! ></a></p>
|
|
<p>This method requires the following URL parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>:gateway</td>
|
|
<td>String</td>
|
|
<td>The issuing <a href="#addresses">Address</a>, <a href="https://en.wikipedia.org/wiki/Percent-encoding">URL-encoded name</a>, or normalized name of the gateway.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>This method takes no query parameters.</p>
|
|
<h4 id="response-format-17">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong> and has a JSON body with the following:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>name</td>
|
|
<td>String</td>
|
|
<td>Human-readable name of the gateway</td>
|
|
</tr>
|
|
<tr>
|
|
<td>start_date</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>The approximate date of the first time exchanges for this gateway's currencies appeared in the ledger.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>accounts</td>
|
|
<td>Array</td>
|
|
<td>A list of <a href="concept-issuing-and-operational-addresses.html">issuing addresses</a> (cold wallets) used by this gateway. (Gateways may use different issuing accounts for different currencies.)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>hotwallets</td>
|
|
<td>Array of <a href="#addresses">Address</a>es</td>
|
|
<td>The addresses of the Ripple accounts this gateway uses as <a href="concept-issuing-and-operational-addresses.html">operational addresses</a> (hot wallets).</td>
|
|
</tr>
|
|
<tr>
|
|
<td>domain</td>
|
|
<td>String</td>
|
|
<td>The domain name where this gateway does business. Typically the gateway hosts a <a href="https://wiki.ripple.com/Ripple.txt"><code>ripple.txt</code></a> there.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>normalized</td>
|
|
<td>String</td>
|
|
<td>A normalized version of the <code>name</code> field suitable for including in URLs.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>assets</td>
|
|
<td>Array of Strings</td>
|
|
<td>Graphics filenames available for this gateway, if any. (Mostly, these are logos used by Ripple Charts.)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Each object in the <code>accounts</code> field array has the following fields:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>address</td>
|
|
<td>String</td>
|
|
<td>The <a href="#addresses">Address</a> of an <a href="concept-issuing-and-operational-addresses.html">issuing address</a> (cold wallet) used by this gateway.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>currencies</td>
|
|
<td>Object</td>
|
|
<td>Each field in this object is a <a href="#currency-code">Currency Code</a> corresponding to a currency issued from this address. Each value is an object with a <code>featured</code> boolean indicating whether that currency is featured. Ripple decides which currencies and gateways to feature based on responsible business practices, volume, and other measures.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="example-17">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v2/gateways/Gatehub
|
|
</code></pre>
|
|
<p>Response:</p>
|
|
<pre><code>200 OK
|
|
{
|
|
"name": "Gatehub",
|
|
"start_date": "2015-02-15T00:00:00Z",
|
|
"accounts": [
|
|
{
|
|
"address": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq",
|
|
"currencies": {
|
|
"EUR": {
|
|
"featured": true
|
|
},
|
|
"USD": {
|
|
"featured": true
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"hotwallets": [
|
|
"rhotcWYdfn6qxhVMbPKGDF3XCKqwXar5J4"
|
|
],
|
|
"domain": "gatehub.net",
|
|
"normalized": "gatehub",
|
|
"assets": [
|
|
"logo.grayscale.svg",
|
|
"logo.svg"
|
|
]
|
|
}
|
|
</code></pre>
|
|
<h2 id="get-currency-image">Get Currency Image</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/v0.0.4-rc2/api/routesV2/gateways.js#L196" title="Source">[Source]<br/></a></p>
|
|
<p>Retrieve vector icons for various currencies. <em>(New in <a href="https://github.com/ripple/rippled-historical-database/releases/tag/v2.0.4">v2.0.4</a>)</em></p>
|
|
<h4 id="request-format-18">Request Format</h4>
|
|
<div class="multicode" id="code-18"><ul class="codetabs"><li><a href="#code-18-0">REST</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-18-0" style="position: static;"><pre><code>GET /v2/currencies/{:currencyimage}
|
|
</code></pre></div>
|
|
</div>
|
|
<p>This method requires the following URL parameter:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>:currencyimage</td>
|
|
<td>String</td>
|
|
<td>An image file for a currency, such as <code>xrp.svg</code>. See <a href="https://github.com/ripple/rippled-historical-database/tree/develop/api/gateways/currencyAssets">the source code</a> for a list of available images.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="response-format-18">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong> and has a <strong>Content-Type</strong> header of <code>image/svg+xml</code> to indicate that the contents are XML representing a file in <a href="https://en.wikipedia.org/wiki/Scalable_Vector_Graphics">SVG format</a>.</p>
|
|
<h4 id="example-18">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v2/currencies/mxn.svg
|
|
</code></pre>
|
|
<p>Response</p>
|
|
<pre><code>200 OK
|
|
Content-Type: image/svg+xml
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
width="200px" height="200px" viewBox="0 0 200 200" enable-background="new 0 0 200 200" xml:space="preserve">
|
|
<g>
|
|
<path fill="#FC6E74" d="M105.1,181.5c-12.2,0-24-2.1-35.1-6.2c-11.1-4.1-21.6-10.5-31.1-19.1l-1.3-1.2l18.8-22.3l1.4,1.2
|
|
c7.4,6.4,14.9,11.3,22.4,14.7c7.4,3.4,16,5.1,25.5,5.1c8,0,14.4-1.7,19-5c4.5-3.2,6.7-7.3,6.7-12.7c0-3-0.4-5.2-1.3-7.1
|
|
c-0.8-1.8-2.4-3.6-4.8-5.4c-2.4-1.8-5.9-3.5-10.2-5.1c-4.5-1.6-10.3-3.2-17.5-4.8c-8.3-1.9-15.8-4.1-22.4-6.6
|
|
c-6.6-2.5-12.3-5.6-16.8-9.2C54,94.3,50.4,89.8,48,84.5c-2.4-5.2-3.6-11.6-3.6-18.9c0-7.4,1.4-13.8,4.1-19.5
|
|
c2.7-5.8,6.6-10.7,11.4-14.8c4.8-4.1,10.6-7.3,17.3-9.5c6.7-2.3,14-3.4,21.9-3.4c11.6,0,22.2,1.7,31.4,5.1
|
|
c9.3,3.4,18.1,8.4,26.2,14.8l1.4,1.1l-16.8,23.6l-1.5-1.1c-6.9-5-13.9-9-20.7-11.6c-6.7-2.6-13.6-4-20.4-4
|
|
c-7.5,0-13.4,1.6-17.5,4.9c-4,3.2-6,7-6,11.6c0,3.1,0.5,5.5,1.4,7.5c0.9,2,2.6,3.8,5,5.4c2.6,1.8,6.3,3.4,10.9,5
|
|
c4.8,1.6,10.9,3.3,18.2,5c8.3,2.1,15.7,4.4,22,7c6.5,2.6,12,5.8,16.3,9.5c4.3,3.8,7.7,8.3,9.9,13.3c2.2,5,3.4,10.9,3.4,17.5
|
|
c0,7.9-1.4,14.7-4.2,20.7c-2.8,6-6.8,11.1-11.9,15.3c-5,4.1-11.1,7.3-18.1,9.4C121.2,180.5,113.4,181.5,105.1,181.5z"/>
|
|
<rect x="86.7" y="0" fill="#FC6E74" width="26.5" height="40.1"/>
|
|
<rect x="86.5" y="159.2" fill="#FC6E74" width="27" height="40.8"/>
|
|
</g>
|
|
</svg>
|
|
</code></pre>
|
|
<h2 id="get-accounts">Get Accounts</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/develop/api/routesV2/accounts.js" title="Source">[Source]<br/></a></p>
|
|
<p>Retrieve information about the creation of new accounts in the Ripple Consensus Ledger.</p>
|
|
<h4 id="request-format-19">Request Format</h4>
|
|
<div class="multicode" id="code-19"><ul class="codetabs"><li><a href="#code-19-0">REST</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-19-0" style="position: static;"><pre><code>GET /v2/accounts
|
|
</code></pre></div>
|
|
</div>
|
|
<p><a class="button" href="data-api-v2-tool.html#get-accounts">Try it! ></a></p>
|
|
<p>Optionally, you can include the following query parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>start</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>Start time of query range</td>
|
|
</tr>
|
|
<tr>
|
|
<td>end</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>End time of query range</td>
|
|
</tr>
|
|
<tr>
|
|
<td>interval</td>
|
|
<td>String</td>
|
|
<td>Aggregation interval (<code>hour</code>,<code>day</code>,<code>week</code>). If omitted, return individual accounts. Not compatible with the <code>parent</code> parameter.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>limit</td>
|
|
<td>Integer</td>
|
|
<td>Maximum results per page. Defaults to 200. Cannot be more than 1,000.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>marker</td>
|
|
<td>String</td>
|
|
<td><a href="#pagination">Pagination</a> key from previously returned response</td>
|
|
</tr>
|
|
<tr>
|
|
<td>descending</td>
|
|
<td>Boolean</td>
|
|
<td>Reverse chronological order</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parent</td>
|
|
<td>String</td>
|
|
<td>Filter results to children of the specified parent account. Not compatible with the <code>interval</code> parameter.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reduce</td>
|
|
<td>Boolean</td>
|
|
<td>Return a count of results only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>format</td>
|
|
<td>String</td>
|
|
<td>Format of returned results: <code>csv</code> or <code>json</code>. Defaults to <code>json</code>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="response-format-19">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong> and has a JSON body with the following:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>result</td>
|
|
<td>String</td>
|
|
<td>The value <code>success</code> indicates that this is a successful response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>count</td>
|
|
<td>Integer</td>
|
|
<td>Number of accounts returned.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>marker</td>
|
|
<td>String</td>
|
|
<td>(May be omitted) <a href="#pagination">Pagination</a> marker</td>
|
|
</tr>
|
|
<tr>
|
|
<td>accounts</td>
|
|
<td>Array</td>
|
|
<td>If the request used the <code>interval</code> query parameter, each member of the array is an interval object. Otherwise, this field is an array of <a href="#account-creation-objects">account creation objects</a>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h5 id="interval-objects">Interval Objects</h5>
|
|
<p>If the request uses the <code>interval</code> query parameter, the response has an array of interval objects, each of which represents the number of accounts created during a single interval. Interval objects have the following fields:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>date</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>The time at which this interval starts. (The length of the interval is determined by the request.)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>count</td>
|
|
<td>Number</td>
|
|
<td>How many accounts were created in this interval.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="example-19">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v1/accounts?parent=rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn
|
|
</code></pre>
|
|
<p>Response:</p>
|
|
<pre><code>{
|
|
"result": "success",
|
|
"count": 3,
|
|
"accounts": [
|
|
{
|
|
"balance": "20.0",
|
|
"account": "raKEEVSGnKSD9Zyvxu4z6Pqpm4ABH8FS6n",
|
|
"executed_time": "2015-02-09T23:31:40+00:00",
|
|
"ledger_index": 11620700,
|
|
"parent": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
|
"tx_hash": "1D381C0FCA00E8C34A6D4D3A91DAC9F3697B4E66BC49ED3D9B2D6F57D7F15E2E"
|
|
},
|
|
{
|
|
"balance": "30",
|
|
"account": "rUpy3eEg8rqjqfUoLeBnZkscbKbFsKXC3v",
|
|
"executed_time": "2015-06-16T21:15:40+00:00",
|
|
"ledger_index": 14090928,
|
|
"parent": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
|
"tx_hash": "60B614622FC67DFCA8D796D7F6AF0B7AEC5E59BB268EA032F810395407DDF8D5"
|
|
},
|
|
{
|
|
"balance": "50",
|
|
"account": "rLFd1FzHMScFhLsXeaxStzv3UC97QHGAbM",
|
|
"executed_time": "2015-09-23T23:05:20+00:00",
|
|
"ledger_index": 16061430,
|
|
"parent": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
|
"tx_hash": "FAE331A6D5CB83BCE832E7EBEDBD807EDEFFAF39AB241683EE81A0326A1A6748"
|
|
}
|
|
]
|
|
}
|
|
</code></pre>
|
|
<h2 id="get-account">Get Account</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/develop/api/routesV2/getAccount.js" title="Source">[Source]<br/></a></p>
|
|
<p>Get creation info for a specific ripple account</p>
|
|
<h4 id="request-format-20">Request Format</h4>
|
|
<div class="multicode" id="code-20"><ul class="codetabs"><li><a href="#code-20-0">REST</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-20-0" style="position: static;"><pre><code>GET /v2/accounts/{:address}
|
|
</code></pre></div>
|
|
</div>
|
|
<p><a class="button" href="data-api-v2-tool.html#get-account">Try it! ></a></p>
|
|
<p>This method requires the following URL parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>address</td>
|
|
<td>String</td>
|
|
<td>Ripple address to query</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="response-format-20">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong> and has a JSON body with the following:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>result</td>
|
|
<td>String</td>
|
|
<td>The value <code>success</code> indicates that this is a successful response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>account</td>
|
|
<td>Object - <a href="#account-creation-objects">Account Creation</a></td>
|
|
<td>The requested account</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="example-20">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v2/accounts/rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn
|
|
</code></pre>
|
|
<p>Response:</p>
|
|
<pre><code>{
|
|
"result": "success",
|
|
"account": {
|
|
"address": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
|
"parent": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
|
|
"initial_balance": "100.0",
|
|
"inception": "2014-05-29T17:05:20+00:00",
|
|
"ledger_index": 6902264,
|
|
"tx_hash": "074415C5DC6DB0029E815EA6FC2629FBC29A2C9D479F5D040AFF94ED58ECC820"
|
|
}
|
|
}
|
|
</code></pre>
|
|
<h2 id="get-account-balances">Get Account Balances</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/develop/api/routesV2/accountBalances.js" title="Source">[Source]<br/></a></p>
|
|
<p>Get all balances held or owed by a specific Ripple account.</p>
|
|
<div class="multicode" id="code-21"><ul class="codetabs"><li><a href="#code-21-0">REST</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-21-0" style="position: static;"><pre><code>GET /v2/accounts/{:address}/balances
|
|
</code></pre></div>
|
|
</div>
|
|
<p><a class="button" href="data-api-v2-tool.html#get-account-balances">Try it! ></a></p>
|
|
<p>This method requires the following URL parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>address</td>
|
|
<td>String</td>
|
|
<td>Ripple address to query</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Optionally, you can also include the following query parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>ledger_index</td>
|
|
<td>Integer</td>
|
|
<td>Index of ledger for historical balances.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>ledger_hash</td>
|
|
<td>String</td>
|
|
<td>Ledger hash for historical balances.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>date</td>
|
|
<td>String</td>
|
|
<td>UTC date for historical balances.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>currency</td>
|
|
<td>String</td>
|
|
<td>Restrict results to specified currency.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>counterparty</td>
|
|
<td>String</td>
|
|
<td>Restrict results to specified counterparty/issuer.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>limit</td>
|
|
<td>Integer</td>
|
|
<td>Maximum results per page. Defaults to 200. Cannot be greater than 400, but you can use the value <code>all</code> to return all results. (Caution: When using limit=all to retrieve very many results, the request may time out. Large gateways can have several tens of thousands of results.)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>format</td>
|
|
<td>String</td>
|
|
<td>Format of returned results: <code>csv</code> or <code>json</code>. Defaults to <code>json</code>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="response-format-21">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong> and has a JSON body with the following:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>result</td>
|
|
<td>String</td>
|
|
<td>The value <code>success</code> indicates that this is a successful response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>ledger_index</td>
|
|
<td>Integer</td>
|
|
<td>ledger index for balances query.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>close_time</td>
|
|
<td>String</td>
|
|
<td>close time of the ledger.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>limit</td>
|
|
<td>String</td>
|
|
<td>number of results returned, if limit was exceeded.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>marker</td>
|
|
<td>String</td>
|
|
<td>(May be omitted) <a href="#pagination">Pagination</a> marker.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>balances</td>
|
|
<td>Array of <a href="#balance-objects-and-balance-change-objects">Balance Object</a>s</td>
|
|
<td>The requested balances.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="example-21">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v2/accounts/rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn/balances?currency=USD&date=2015-01-01T00:00:00Z&limit=3
|
|
</code></pre>
|
|
<p>Response:</p>
|
|
<pre><code>{
|
|
"result": "success",
|
|
"ledger_index": 10852618,
|
|
"close_time": "2015-01-01T00:00:00Z",
|
|
"limit": 3,
|
|
"balances": [
|
|
{
|
|
"currency": "USD",
|
|
"counterparty": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
|
|
"value": "-11.0301"
|
|
},
|
|
{
|
|
"currency": "USD",
|
|
"counterparty": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
|
"value": "0.0001"
|
|
},
|
|
{
|
|
"currency": "USD",
|
|
"counterparty": "rweYz56rfmQ98cAdRaeTxQS9wVMGnrdsFp",
|
|
"value": "0"
|
|
}
|
|
]
|
|
}
|
|
</code></pre>
|
|
<h2 id="get-account-orders">Get Account Orders</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/develop/api/routesV2/accountOrders.js" title="Source">[Source]<br/></a></p>
|
|
<p>Get orders in the order books, placed by a specific account. This does not return orders that have already been filled.</p>
|
|
<h4 id="request-format-21">Request Format</h4>
|
|
<div class="multicode" id="code-22"><ul class="codetabs"><li><a href="#code-22-0">REST</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-22-0" style="position: static;"><pre><code>GET /v2/account/{:address}/orders
|
|
</code></pre></div>
|
|
</div>
|
|
<p><a class="button" href="data-api-v2-tool.html#get-account-orders">Try it! ></a></p>
|
|
<p>This method requires the following URL parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>address</td>
|
|
<td>String - <a href="#addresses">Address</a></td>
|
|
<td>Ripple address to query</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Optionally, you can also include the following query parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>ledger_index</td>
|
|
<td>Integer</td>
|
|
<td>Get orders as of this ledger. Not compatible with <code>ledger_hash</code> or <code>date</code>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>ledger_hash</td>
|
|
<td>String</td>
|
|
<td>Get orders as of this ledger. Not compatible with <code>ledger_index</code> or <code>date</code>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>date</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>Get orders at this time. Not compatible with <code>ledger_index</code> or <code>ledger_hash</code>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>limit</td>
|
|
<td>Integer</td>
|
|
<td>Maximum results per page. Defaults to 200. Cannot be greater than 400.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>format</td>
|
|
<td>String</td>
|
|
<td>Format of returned results: <code>csv</code> or <code>json</code>. Defaults to <code>json</code>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>If none of <code>ledger_index</code>, <code>ledger_hash</code>, or <code>date</code> are specified, the API uses the most current data available.</p>
|
|
<h4 id="response-format-22">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong> and has a JSON body with the following:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>result</td>
|
|
<td>String</td>
|
|
<td>The value <code>success</code> indicates that this is a successful response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>ledger_index</td>
|
|
<td>Integer</td>
|
|
<td><code>ledger_index</code> of the ledger version used.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>close_time</td>
|
|
<td>String</td>
|
|
<td>Close time of the ledger version used.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>limit</td>
|
|
<td>String</td>
|
|
<td>The <code>limit</code> from the request.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>orders</td>
|
|
<td>Array of order objects</td>
|
|
<td>The requested orders.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Each order object has the following fields:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>specification</td>
|
|
<td>Object</td>
|
|
<td>Details of this order's current state.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>specification.direction</td>
|
|
<td>String</td>
|
|
<td>Either <code>buy</code> or <code>sell</code>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>specification.quantity</td>
|
|
<td><a href="#balance-objects-and-balance-change-objects">Balance Object</a></td>
|
|
<td>The maximum amount of the base currency this order would buy or sell (depending on the direction). This value decreases as the order gets partially filled.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>specification.totalPrice</td>
|
|
<td><a href="#balance-objects-and-balance-change-objects">Balance Object</a></td>
|
|
<td>The maximum amount of the counter currency that will be spent or gained in order to buy or sell the base currency. This value decreases as the order gets partially filled.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>properties</td>
|
|
<td>Object</td>
|
|
<td>Details of how the order was placed.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>properties.maker</td>
|
|
<td>String - <a href="#addresses">Address</a></td>
|
|
<td>The Ripple account that placed the order.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>properties.sequence</td>
|
|
<td>Number</td>
|
|
<td>The sequence number of the transaction that placed this order.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>properties.makerExchangeRate</td>
|
|
<td><a href="#numbers-and-precision">String - Number</a></td>
|
|
<td>The exchange rate from the point of view of the account that submitted the order.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="example-22">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v2/accounts/rK5j9n8baXfL4gzUoZsfxBvvsv97P5swaV/orders?limit=2&date=2015-11-11T00:00:00Z
|
|
</code></pre>
|
|
<p>Response:</p>
|
|
<pre><code>{
|
|
"result": "success",
|
|
"ledger_index": 17007855,
|
|
"close_time": "2015-11-11T00:00:00Z",
|
|
"limit": 2,
|
|
"orders": [
|
|
{
|
|
"specification": {
|
|
"direction": "buy",
|
|
"quantity": {
|
|
"currency": "JPY",
|
|
"value": "56798.00687665813",
|
|
"counterparty": "r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN"
|
|
},
|
|
"totalPrice": {
|
|
"currency": "USD",
|
|
"value": "433.792841227449",
|
|
"counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
|
|
}
|
|
},
|
|
"properties": {
|
|
"maker": "rK5j9n8baXfL4gzUoZsfxBvvsv97P5swaV",
|
|
"sequence": 7418286,
|
|
"makerExchangeRate": "130.9334813270407"
|
|
}
|
|
},
|
|
{
|
|
"specification": {
|
|
"direction": "buy",
|
|
"quantity": {
|
|
"currency": "JPY",
|
|
"value": "11557.02705273459",
|
|
"counterparty": "r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN"
|
|
},
|
|
"totalPrice": {
|
|
"currency": "USD",
|
|
"value": "87.570156003591",
|
|
"counterparty": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq"
|
|
}
|
|
},
|
|
"properties": {
|
|
"maker": "rK5j9n8baXfL4gzUoZsfxBvvsv97P5swaV",
|
|
"sequence": 7418322,
|
|
"makerExchangeRate": "131.9744942815983"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
</code></pre>
|
|
<h2 id="get-account-transaction-history">Get Account Transaction History</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/develop/api/routesV2/accountTransactions.js" title="Source">[Source]<br/></a></p>
|
|
<p>Retrieve a history of transactions that affected a specific account. This includes all transactions the account sent, payments the account received, and payments that rippled through the account.</p>
|
|
<h4 id="request-format-22">Request Format</h4>
|
|
<div class="multicode" id="code-23"><ul class="codetabs"><li><a href="#code-23-0">REST</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-23-0" style="position: static;"><pre><code>GET /v2/accounts/{:address}/transactions
|
|
</code></pre></div>
|
|
</div>
|
|
<p><a class="button" href="data-api-v2-tool.html#get-account-transaction-history">Try it! ></a></p>
|
|
<p>This method requires the following URL parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>:address</td>
|
|
<td>String - <a href="#addresses">Address</a></td>
|
|
<td>Ripple address to query</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Optionally, you can also include the following query parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>start</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>Start time of query range. Defaults to the earliest date available.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>end</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>End time of query range. Defaults to the current date.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>min_sequence</td>
|
|
<td>String</td>
|
|
<td>Minimum sequence number to query</td>
|
|
</tr>
|
|
<tr>
|
|
<td>max_sequence</td>
|
|
<td>String</td>
|
|
<td>Max sequence number to query</td>
|
|
</tr>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Restrict results to a specified <a href="reference-transaction-format.html">transaction type</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>result</td>
|
|
<td>String</td>
|
|
<td>Restrict results to specified transaction result</td>
|
|
</tr>
|
|
<tr>
|
|
<td>binary</td>
|
|
<td>Boolean</td>
|
|
<td>Return results in binary format</td>
|
|
</tr>
|
|
<tr>
|
|
<td>descending</td>
|
|
<td>Boolean</td>
|
|
<td>Reverse chronological order</td>
|
|
</tr>
|
|
<tr>
|
|
<td>limit</td>
|
|
<td>Integer</td>
|
|
<td>Maximum results per page. Defaults to 20. Cannot be more than 1,000.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>marker</td>
|
|
<td>String</td>
|
|
<td><a href="#pagination">Pagination</a> key from previously returned response</td>
|
|
</tr>
|
|
<tr>
|
|
<td>format</td>
|
|
<td>String</td>
|
|
<td>Format of returned results: <code>csv</code> or <code>json</code>. Defaults to <code>json</code>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="response-format-23">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong> and has a JSON body with the following:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>result</td>
|
|
<td>String</td>
|
|
<td>The value <code>success</code> indicates that this is a successful response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>count</td>
|
|
<td>Integer</td>
|
|
<td>The number of objects contained in the <code>transactions</code> field.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>marker</td>
|
|
<td>String</td>
|
|
<td>(May be omitted) <a href="#pagination">Pagination</a> marker</td>
|
|
</tr>
|
|
<tr>
|
|
<td>transactions</td>
|
|
<td>Array of <a href="#transaction-objects">transaction objects</a></td>
|
|
<td>All transactions matching the request.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="example-23">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v2/accounts/rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn/transactions?type=Payment&result=tesSUCCESS&limit=1
|
|
</code></pre>
|
|
<p>Response:</p>
|
|
<pre><code>{
|
|
"result": "success",
|
|
"count": 1,
|
|
"marker": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn|20140602224750|000006979192|00001",
|
|
"transactions": [
|
|
{
|
|
"hash": "074415C5DC6DB0029E815EA6FC2629FBC29A2C9D479F5D040AFF94ED58ECC820",
|
|
"date": "2014-05-29T17:05:20+00:00",
|
|
"ledger_index": 6902264,
|
|
"tx": {
|
|
"TransactionType": "Payment",
|
|
"Flags": 0,
|
|
"Sequence": 1,
|
|
"LastLedgerSequence": 6902266,
|
|
"Amount": "100000000",
|
|
"Fee": "12",
|
|
"SigningPubKey": "032ECFCC409F02057D8556988B89E17D48ECFC8373965036C6BA294AA2B7972971",
|
|
"TxnSignature": "30450221008D8E251DA5EA17A29CC9192717860F3B4047E74DF005127A65D9140CAE870C0902201C8E4548D2D3BA11B3E13CE8A167EBC076920E2B1C38547275CAA75FEC436EB9",
|
|
"Account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
|
|
"Destination": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
|
|
},
|
|
"meta": {
|
|
"TransactionIndex": 1,
|
|
"AffectedNodes": [
|
|
{
|
|
"CreatedNode": {
|
|
"LedgerEntryType": "AccountRoot",
|
|
"LedgerIndex": "13F1A95D7AAB7108D5CE7EEAF504B2894B8C674E6D68499076441C4837282BF8",
|
|
"NewFields": {
|
|
"Sequence": 1,
|
|
"Balance": "100000000",
|
|
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"ModifiedNode": {
|
|
"LedgerEntryType": "AccountRoot",
|
|
"PreviousTxnLgrSeq": 6486567,
|
|
"PreviousTxnID": "FF9BFF3C200B475CA7EE54F9A98EAB7E92BBDBD2DBE95AC854405D8A85C9D535",
|
|
"LedgerIndex": "43EA78783A089B137D5E87610DF3BD4129F989EDD02EFAF6C265924D3A0EF8CE",
|
|
"PreviousFields": {
|
|
"Sequence": 1,
|
|
"Balance": "1000000000"
|
|
},
|
|
"FinalFields": {
|
|
"Flags": 0,
|
|
"Sequence": 2,
|
|
"OwnerCount": 0,
|
|
"Balance": "899999988",
|
|
"Account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX"
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"TransactionResult": "tesSUCCESS"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
</code></pre>
|
|
<h2 id="get-transaction-by-account-and-sequence">Get Transaction By Account And Sequence</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/develop/api/routesV2/accountTxSeq.js" title="Source">[Source]<br/></a></p>
|
|
<p>Retrieve a specifc transaction originating from a specified account</p>
|
|
<h4 id="request-format-23">Request Format</h4>
|
|
<div class="multicode" id="code-24"><ul class="codetabs"><li><a href="#code-24-0">REST</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-24-0" style="position: static;"><pre><code>GET /v2/accounts/{:address}/transactions/{:sequence}
|
|
</code></pre></div>
|
|
</div>
|
|
<p><a class="button" href="data-api-v2-tool.html#get-transaction-by-account-and-sequence">Try it! ></a></p>
|
|
<p>This method requires the following URL parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>:address</td>
|
|
<td>String</td>
|
|
<td>Ripple address to query</td>
|
|
</tr>
|
|
<tr>
|
|
<td>:sequence</td>
|
|
<td>Integer</td>
|
|
<td>Transaction sequence</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Optionally, you can also include the following query parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>binary</td>
|
|
<td>Boolean</td>
|
|
<td>Return transaction in binary format</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="response-format-24">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong> and has a JSON body with the following:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>result</td>
|
|
<td>String</td>
|
|
<td>The value <code>success</code> indicates that this is a successful response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>transaction</td>
|
|
<td><a href="#transaction-objects">transaction object</a></td>
|
|
<td>requested transaction</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="example-24">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v2/accounts/rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn/transactions/10?binary=true
|
|
</code></pre>
|
|
<p>Response:</p>
|
|
<pre><code>{
|
|
"result": "success",
|
|
"transaction": {
|
|
"hash": "4BFFBB86C12659B6C5BB88F0EB859356DE3433EBACBFD9F50F6E70B2C05CCFE0",
|
|
"date": "2014-09-15T19:59:10+00:00",
|
|
"ledger_index": 8889812,
|
|
"tx": "1200052200000000240000000A68400000000000000A732103AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB74473045022100AA4AF08726FCF0F28AA4A841C45F975C3BF1545648F6907DCB33F6E3DD7E85D6022037365B80AB1972BF8A4280009A0DBCF16A1D562ED0489B155750E48CC939039981144B4E9C06F24296074F7BC48F92A97916C6DC5EA9",
|
|
"meta": "201C00000003F8E5110061250087A5C555CBCA96F4C42E0EBC0E75C5AD84B3403FEDF824A7DAFA45ADCA6ECB66AA143C1B5613F1A95D7AAB7108D5CE7EEAF504B2894B8C674E6D68499076441C4837282BF8E6240000000A62400000000DB5852F8814D3484B9ED2556DCE16A3B928B438BA6EE0FF0989E1E72200010000240000000B2D0000000062400000000DB5852572110000000000000000000000070000000300770A6D64756F31332E636F6D81144B4E9C06F24296074F7BC48F92A97916C6DC5EA9E1E1F1031000"
|
|
}
|
|
}
|
|
</code></pre>
|
|
<h2 id="get-account-payments">Get Account Payments</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/develop/api/routesV2/accountPayments.js" title="Source">[Source]<br/></a></p>
|
|
<p>Retrieve a payments for a specified account</p>
|
|
<h4 id="request-format-24">Request Format</h4>
|
|
<div class="multicode" id="code-25"><ul class="codetabs"><li><a href="#code-25-0">REST</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-25-0" style="position: static;"><pre><code>GET /v2/accounts/{:address}/payments
|
|
</code></pre></div>
|
|
</div>
|
|
<p><a class="button" href="data-api-v2-tool.html#get-account-payments">Try it! ></a></p>
|
|
<p>This method requires the following URL parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>:address</td>
|
|
<td>String</td>
|
|
<td>Ripple address to query.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Optionally, you can also include the following query parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>start</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>Start time of query range</td>
|
|
</tr>
|
|
<tr>
|
|
<td>end</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>End time of query range</td>
|
|
</tr>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of payment - <code>sent</code> or <code>received</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>currency</td>
|
|
<td>String - <a href="#currency-code">Currency Code</a></td>
|
|
<td>Filter results to specified currency</td>
|
|
</tr>
|
|
<tr>
|
|
<td>issuer</td>
|
|
<td>String - <a href="#addresses">Address</a></td>
|
|
<td>Filter results to specified issuer</td>
|
|
</tr>
|
|
<tr>
|
|
<td>source_tag</td>
|
|
<td>Integer</td>
|
|
<td>Filter results to specified source tag</td>
|
|
</tr>
|
|
<tr>
|
|
<td>destination_tag</td>
|
|
<td>Integer</td>
|
|
<td>Filter results to specified destination tag</td>
|
|
</tr>
|
|
<tr>
|
|
<td>descending</td>
|
|
<td>Boolean</td>
|
|
<td>Reverse chronological order</td>
|
|
</tr>
|
|
<tr>
|
|
<td>limit</td>
|
|
<td>Integer</td>
|
|
<td>Maximum results per page. Defaults to 200. Cannot be more than 1,000.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>marker</td>
|
|
<td>String</td>
|
|
<td><a href="#pagination">Pagination</a> key from previously returned response</td>
|
|
</tr>
|
|
<tr>
|
|
<td>format</td>
|
|
<td>String</td>
|
|
<td>Format of returned results: <code>csv</code> or <code>json</code>. Defaults to <code>json</code>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="response-format-25">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong> and has a JSON body with the following:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>result</td>
|
|
<td>String</td>
|
|
<td>The value <code>success</code> indicates that this is a successful response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>count</td>
|
|
<td>Integer</td>
|
|
<td>The number of objects contained in the <code>payments</code> field.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>marker</td>
|
|
<td>String</td>
|
|
<td>(May be omitted) <a href="#pagination">Pagination</a> marker</td>
|
|
</tr>
|
|
<tr>
|
|
<td>payments</td>
|
|
<td>Array of <a href="#payment-objects">payment objects</a></td>
|
|
<td>All payments matching the request.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="example-25">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v2/accounts/rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn/payments?currency=USD&limit=1
|
|
</code></pre>
|
|
<p>Response:</p>
|
|
<pre><code>{
|
|
"result": "success",
|
|
"count": 1,
|
|
"marker": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn|20140604191650|000007013674|00000",
|
|
"payments": [
|
|
{
|
|
"amount": "1.0",
|
|
"delivered_amount": "1.0",
|
|
"destination_balance_changes": [
|
|
{
|
|
"counterparty": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
|
"currency": "USD",
|
|
"value": "1"
|
|
}
|
|
],
|
|
"source_balance_changes": [
|
|
{
|
|
"counterparty": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
|
|
"currency": "USD",
|
|
"value": "-1"
|
|
}
|
|
],
|
|
"tx_index": 1,
|
|
"currency": "USD",
|
|
"destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
|
|
"executed_time": "2014-06-02T22:47:50Z",
|
|
"issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
|
"ledger_index": 6979192,
|
|
"source": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
|
"source_currency": "USD",
|
|
"tx_hash": "7BF105CFE4EFE78ADB63FE4E03A851440551FE189FD4B51CAAD9279C9F534F0E",
|
|
"transaction_cost": "1.0E-5"
|
|
}
|
|
]
|
|
}
|
|
</code></pre>
|
|
<h2 id="get-account-exchanges">Get Account Exchanges</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/develop/api/routesV2/accountExchanges.js" title="Source">[Source]<br/></a></p>
|
|
<p>Retrieve Exchanges for a given account over time.</p>
|
|
<h4 id="request-format-25">Request Format</h4>
|
|
<p>There are two variations on this method:</p>
|
|
<div class="multicode" id="code-26"><ul class="codetabs"><li><a href="#code-26-0">REST - All Exchanges</a></li><li><a href="#code-26-1">REST - Specific Currency Pair</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-26-0" style="position: static;"><pre><code>GET /v2/accounts/{:address}/exchanges/
|
|
</code></pre></div>
|
|
|
|
<div class="code_sample" id="code-26-1" style="position: static;"><pre><code>GET /v2/accounts/{:address}/exchanges/{:base}/{:counter}
|
|
</code></pre></div>
|
|
</div>
|
|
<p><a class="button" href="data-api-v2-tool.html#get-account-exchanges-all">Try it! ></a></p>
|
|
<p>This method requires the following URL parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>:address</td>
|
|
<td>String</td>
|
|
<td>Ripple address to query.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>:base</td>
|
|
<td>String</td>
|
|
<td>Base currency of the pair, as a <a href="#currency-code">Currency Code</a>, followed by <code>+</code> and the issuer <a href="#addresses">Address</a> unless it's XRP.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>:counter</td>
|
|
<td>String</td>
|
|
<td>Counter currency of the pair, as a <a href="#currency-code">Currency Code</a>, followed by <code>+</code> and the issuer <a href="#addresses">Address</a> unless it's XRP.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Optionally, you can also include the following query parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>start</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>Start time of query range</td>
|
|
</tr>
|
|
<tr>
|
|
<td>end</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>End time of query range</td>
|
|
</tr>
|
|
<tr>
|
|
<td>descending</td>
|
|
<td>Boolean</td>
|
|
<td>Reverse chronological order</td>
|
|
</tr>
|
|
<tr>
|
|
<td>limit</td>
|
|
<td>Integer</td>
|
|
<td>Maximum results per page. Defaults to 200. Cannot be more than 1000.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>marker</td>
|
|
<td>String</td>
|
|
<td><a href="#pagination">Pagination</a> key from previously returned response</td>
|
|
</tr>
|
|
<tr>
|
|
<td>format</td>
|
|
<td>String</td>
|
|
<td>Format of returned results: <code>csv</code> or <code>json</code>. Defaults to <code>json</code>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="response-format-26">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong> and has a JSON body with the following:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>result</td>
|
|
<td>String</td>
|
|
<td>The value <code>success</code> indicates that this is a successful response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>count</td>
|
|
<td>Integer</td>
|
|
<td>Number of exchanges returned.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>marker</td>
|
|
<td>String</td>
|
|
<td>(May be omitted) <a href="#pagination">Pagination</a> marker</td>
|
|
</tr>
|
|
<tr>
|
|
<td>exchanges</td>
|
|
<td>Array of <a href="#exchange-objects">Exchange Objects</a></td>
|
|
<td>The requested exchanges</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="example-26">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v2/accounts/rsyDrDi9Emy6vPU78qdxovmNpmj5Qh4NKw/exchanges/KRW+rUkMKjQitpgAM5WTGk79xpjT38DEJY283d/XRP?start=2015-08-08T00:00:00Z&end=2015-08-31T00:00:00Z&limit=2
|
|
|
|
</code></pre>
|
|
<p>Response:</p>
|
|
<pre><code>{
|
|
"result": "success",
|
|
"count": 2,
|
|
"marker": "rsyDrDi9Emy6vPU78qdxovmNpmj5Qh4NKw|20150810014200|000015162386|00013|00003",
|
|
"exchanges": [
|
|
{
|
|
"base_amount": 209.3501241148,
|
|
"counter_amount": 20.424402,
|
|
"rate": 0.097560973925,
|
|
"autobridged_currency": "USD",
|
|
"autobridged_issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
|
"base_currency": "KRW",
|
|
"base_issuer": "rUkMKjQitpgAM5WTGk79xpjT38DEJY283d",
|
|
"buyer": "rnAqwsu2BEbCjacoZmsXrpViqd3miZhHbT",
|
|
"counter_currency": "XRP",
|
|
"executed_time": "2015-08-08T02:57:40",
|
|
"ledger_index": 15122851,
|
|
"offer_sequence": "1738",
|
|
"provider": "rsyDrDi9Emy6vPU78qdxovmNpmj5Qh4NKw",
|
|
"seller": "rsyDrDi9Emy6vPU78qdxovmNpmj5Qh4NKw",
|
|
"taker": "rnAqwsu2BEbCjacoZmsXrpViqd3miZhHbT",
|
|
"tx_hash": "506D109A609A5E0778276CCBB125A4AA7B78428059F069A2CB4F739B861C0C49",
|
|
"tx_type": "OfferCreate"
|
|
},
|
|
{
|
|
"base_amount": 86355.6498758851,
|
|
"counter_amount": 8424.941452,
|
|
"rate": 0.097560975618,
|
|
"base_currency": "KRW",
|
|
"base_issuer": "rUkMKjQitpgAM5WTGk79xpjT38DEJY283d",
|
|
"buyer": "r9xQi5YT8jqVM3wZhbiV94ZKKvGHaVeSDj",
|
|
"client": "rt1.1-26-gbeb68ab",
|
|
"counter_currency": "XRP",
|
|
"executed_time": "2015-08-08T07:15:00",
|
|
"ledger_index": 15126536,
|
|
"offer_sequence": "1738",
|
|
"provider": "rsyDrDi9Emy6vPU78qdxovmNpmj5Qh4NKw",
|
|
"seller": "rsyDrDi9Emy6vPU78qdxovmNpmj5Qh4NKw",
|
|
"taker": "r9xQi5YT8jqVM3wZhbiV94ZKKvGHaVeSDj",
|
|
"tx_hash": "C897A595DED16ADF5AD52E6FD9CE5DE65C78A93CCAA62A85248DC3015A78F5C4",
|
|
"tx_type": "Payment"
|
|
}
|
|
]
|
|
}
|
|
</code></pre>
|
|
<h2 id="get-account-balance-changes">Get Account Balance Changes</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/develop/api/routesV2/accountBalanceChanges.js" title="Source">[Source]<br/></a></p>
|
|
<p>Retrieve Balance changes for a given account over time.</p>
|
|
<h4 id="request-format-26">Request Format</h4>
|
|
<div class="multicode" id="code-27"><ul class="codetabs"><li><a href="#code-27-0">REST</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-27-0" style="position: static;"><pre><code>GET /v2/accounts/{:address}/balance_changes/
|
|
</code></pre></div>
|
|
</div>
|
|
<p><a class="button" href="data-api-v2-tool.html#get-account-balance-changes">Try it! ></a></p>
|
|
<p>This method requires the following URL parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>:address</td>
|
|
<td>String</td>
|
|
<td>Ripple address to query.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Optionally, you can also include the following query parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>currency</td>
|
|
<td>String</td>
|
|
<td>Restrict results to specified currency.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>counterparty</td>
|
|
<td>String</td>
|
|
<td>Restrict results to specified counterparty/issuer.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>start</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>Start time of query range.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>end</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>End time of query range.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>descending</td>
|
|
<td>Boolean</td>
|
|
<td>If true, return results in reverse chronological order. Defaults to false.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>limit</td>
|
|
<td>Integer</td>
|
|
<td>Maximum results per page. Defaults to 200. Cannot be more than 1000.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>marker</td>
|
|
<td>String</td>
|
|
<td><a href="#pagination">Pagination</a> key from previously returned response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>format</td>
|
|
<td>String</td>
|
|
<td>Format of returned results: <code>csv</code> or<code>json</code>. Defaults to <code>json</code>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="response-format-27">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong> and has a JSON body with the following:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>result</td>
|
|
<td>String</td>
|
|
<td>The value <code>success</code> indicates that this is a successful response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>count</td>
|
|
<td>Integer</td>
|
|
<td>Number of balance changes returned.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>marker</td>
|
|
<td>String</td>
|
|
<td>(May be omitted) <a href="#pagination">Pagination</a> marker.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>exchanges</td>
|
|
<td>Array of <a href="#balance-change-descriptors">balance change descriptors</a></td>
|
|
<td>The requested balance changes.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="example-27">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v2/accounts/rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn/balance_changes?descending=true&limit=3
|
|
</code></pre>
|
|
<p>Response:</p>
|
|
<pre><code>{
|
|
"result": "success",
|
|
"count": 3,
|
|
"marker": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn|20160122235211|000018425487|00010|00001",
|
|
"balance_changes": [
|
|
{
|
|
"amount_change": "-0.012",
|
|
"final_balance": "75.169663",
|
|
"tx_index": 7,
|
|
"change_type": "transaction_cost",
|
|
"currency": "XRP",
|
|
"executed_time": "2016-01-29T22:57:20Z",
|
|
"ledger_index": 18555460,
|
|
"tx_hash": "2B44EBE00728D04658E597A85EC4F71D20503B31ABBF556764AD8F7A80BA72F6"
|
|
},
|
|
{
|
|
"amount_change": "-25.0",
|
|
"final_balance": "75.181663",
|
|
"node_index": 1,
|
|
"tx_index": 4,
|
|
"change_type": "payment_source",
|
|
"currency": "XRP",
|
|
"executed_time": "2016-01-26T08:32:20Z",
|
|
"ledger_index": 18489336,
|
|
"tx_hash": "E5C6DD25B2DCF534056D98A2EFE3B7CFAE4EBC624854DE3FA436F733A56D8BD9"
|
|
},
|
|
{
|
|
"amount_change": "-0.01",
|
|
"final_balance": "100.181663",
|
|
"tx_index": 4,
|
|
"change_type": "transaction_cost",
|
|
"currency": "XRP",
|
|
"executed_time": "2016-01-26T08:32:20Z",
|
|
"ledger_index": 18489336,
|
|
"tx_hash": "E5C6DD25B2DCF534056D98A2EFE3B7CFAE4EBC624854DE3FA436F733A56D8BD9"
|
|
}
|
|
]
|
|
}
|
|
</code></pre>
|
|
<h2 id="get-account-reports">Get Account Reports</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/develop/api/routesV2/accountReports.js" title="Source">[Source]<br/></a></p>
|
|
<p>Retrieve daily summaries of payment activity for an account.</p>
|
|
<div class="multicode" id="code-28"><ul class="codetabs"><li><a href="#code-28-0">REST - Date Omitted</a></li><li><a href="#code-28-1">REST - Date Specified</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-28-0" style="position: static;"><pre><code>GET /v2/accounts/{:address}/reports/
|
|
</code></pre></div>
|
|
|
|
<div class="code_sample" id="code-28-1" style="position: static;"><pre><code>GET /v2/accounts/{:address}/reports/{:date}
|
|
</code></pre></div>
|
|
</div>
|
|
<p><a class="button" href="data-api-v2-tool.html#get-account-reports-by-day">Try it! ></a></p>
|
|
<p>This method requires the following URL parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>:address</td>
|
|
<td>String</td>
|
|
<td>Ripple address to query.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>:date</td>
|
|
<td>String</td>
|
|
<td>(Optional) UTC date for single report. If omitted, use the <code>start</code> and <code>end</code> query parameters.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Optionally, you can also include the following query parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>start</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>Start time of query range. Defaults to start of current date. Ignored if <code>date</code> specified.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>end</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>End time of query range. Defaults to current date. Ignored if <code>date</code> specified.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>accounts</td>
|
|
<td>Boolean</td>
|
|
<td>If true, provide lists with addresses of all <code>sending_counterparties</code> and <code>receiving_counterparties</code> in results. Otherwise, return only the number of sending and receiving counterparties.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>payments</td>
|
|
<td>Boolean</td>
|
|
<td>Include <a href="#payment-summary-objects">Payment Summary Objects</a> in the <code>payments</code> field for each interval, with the payments that occurred during that interval.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>descending</td>
|
|
<td>Boolean</td>
|
|
<td>If true, sort results with most recent first. By default, sort results with oldest first.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>format</td>
|
|
<td>String</td>
|
|
<td>Format of returned results: <code>csv</code> or <code>json</code>. Defaults to <code>json</code>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="response-format-28">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong> and has a JSON body with the following:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>result</td>
|
|
<td>String</td>
|
|
<td>The value <code>success</code> indicates that this is a successful response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>count</td>
|
|
<td>Integer</td>
|
|
<td>Number of reports in the <code>reports</code> field.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reports</td>
|
|
<td>Array of <a href="#reports-objects">Reports Objects</a></td>
|
|
<td>Daily summaries of account activity for the given account and date range.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="example-28">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v2/accounts/rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q/reports?start=2015-08-28T00:00:00&end=2015-08-28T00:00:00&accounts=true&payments=true&descending=true
|
|
</code></pre>
|
|
<p>Response:</p>
|
|
<pre><code>{
|
|
"result": "success",
|
|
"count": 1,
|
|
"reports": [
|
|
{
|
|
"account": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
|
"date": "2015-08-28T00:00:00+00:00",
|
|
"high_value_received": 89500.74142547617,
|
|
"high_value_sent": 0,
|
|
"payments": [
|
|
{
|
|
"tx_hash": "F2323EE7494384E77ABB18F31981FEE8C31767BBD27515B55FC3BD6792C4E408",
|
|
"amount": 2.7,
|
|
"currency": "BTC",
|
|
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
|
"type": "received"
|
|
},
|
|
{
|
|
"tx_hash": "FEAD462738EE430E154FF3122D3EE2DD27DDD8BEFBA080A60FE91B78E8865365",
|
|
"amount": 3,
|
|
"currency": "BTC",
|
|
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
|
"type": "received"
|
|
},
|
|
{
|
|
"tx_hash": "383B1D1EABB646AB2EFBBF9E8967FE279BFE5EF86A3B6BCD5BDA287210053116",
|
|
"amount": 0.14,
|
|
"currency": "BTC",
|
|
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
|
"type": "received"
|
|
}
|
|
],
|
|
"payments_received": 3,
|
|
"payments_sent": 0,
|
|
"receiving_counterparties": [],
|
|
"sending_counterparties": [
|
|
"rhi4zZdCeFdfTokzek8D7p9bUWmtEFCZAe",
|
|
"rP1hkW1LCiVos6FpzU7itmm9Tk29yqvyk5"
|
|
],
|
|
"total_value": 174019.58324753598,
|
|
"total_value_received": 174019.58324753598,
|
|
"total_value_sent": 0
|
|
}
|
|
]
|
|
}
|
|
</code></pre>
|
|
<h2 id="get-account-transaction-stats">Get Account Transaction Stats</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/develop/api/routesV2/accountStats.js" title="Source">[Source]<br/></a></p>
|
|
<p>Retrieve daily summaries of transaction activity for an account. <em>(New in <a href="https://github.com/ripple/rippled-historical-database/releases/tag/v2.1.0">v2.1.0</a>.)</em></p>
|
|
<div class="multicode" id="code-29"><ul class="codetabs"><li><a href="#code-29-0">REST</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-29-0" style="position: static;"><pre><code>GET /v2/accounts/{:address}/stats/transactions
|
|
</code></pre></div>
|
|
</div>
|
|
<p><a class="button" href="data-api-v2-tool.html#get-account-transaction-stats">Try it! ></a></p>
|
|
<p>This method requires the following URL parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>:address</td>
|
|
<td>String</td>
|
|
<td>Ripple address to query.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Optionally, you can also include the following query parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>start</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>Start time of query range. Defaults to the earliest date available.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>end</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>End time of query range. Defaults to the current date.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>limit</td>
|
|
<td>Integer</td>
|
|
<td>Maximum results per page. Defaults to 200. Cannot be more than 1000.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>descending</td>
|
|
<td>Boolean</td>
|
|
<td>If true, sort results with most recent first. By default, sort results with oldest first.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>marker</td>
|
|
<td>String</td>
|
|
<td><a href="#pagination">Pagination</a> key from previously returned response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>format</td>
|
|
<td>String</td>
|
|
<td>Format of returned results: <code>csv</code> or <code>json</code>. Defaults to <code>json</code>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="response-format-29">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong> and has a JSON body with the following:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>result</td>
|
|
<td>String</td>
|
|
<td>The value <code>success</code> indicates that this is a successful response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>count</td>
|
|
<td>Integer</td>
|
|
<td>Number of transaction stats objects in the <code>rows</code> field.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>rows</td>
|
|
<td>Array of Transaction Stats Objects</td>
|
|
<td>Daily summaries of account transaction activity for the given account.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Each Transaction Stats Object has the following fields:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>date</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>This object describes activity on this date.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>transaction_count</td>
|
|
<td>Integer</td>
|
|
<td>The total number of transactions sent by the account on this date.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>result</td>
|
|
<td>Object</td>
|
|
<td>Map of <a href="reference-transaction-format.html#transaction-results">transaction result codes</a>, indicating how many of each result code occurred in the transactions sent by this account on this date.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>Object</td>
|
|
<td>Map of <a href="reference-transaction-format.html">transaction types</a>, indicating how many of each transaction type the account sent on this date.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="example-29">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v2/accounts/rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX/stats/transactions?start=2015-01-01&limit=2
|
|
</code></pre>
|
|
<p>Response:</p>
|
|
<pre><code>{
|
|
"result": "success",
|
|
"count": 2,
|
|
"marker": "rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX|20150116000000",
|
|
"rows": [
|
|
{
|
|
"date": "2015-01-14T00:00:00Z",
|
|
"transaction_count": 44,
|
|
"result": {
|
|
"tecUNFUNDED_PAYMENT": 1,
|
|
"tesSUCCESS": 43
|
|
},
|
|
"type": {
|
|
"Payment": 42,
|
|
"TrustSet": 2
|
|
}
|
|
},
|
|
{
|
|
"date": "2015-01-15T00:00:00Z",
|
|
"transaction_count": 116,
|
|
"result": {
|
|
"tesSUCCESS": 116
|
|
},
|
|
"type": {
|
|
"Payment": 116
|
|
}
|
|
}
|
|
]
|
|
}
|
|
</code></pre>
|
|
<h2 id="get-account-value-stats">Get Account Value Stats</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/develop/api/routesV2/accountStats.js" title="Source">[Source]<br/></a></p>
|
|
<p>Retrieve daily summaries of transaction activity for an account. <em>(New in <a href="https://github.com/ripple/rippled-historical-database/releases/tag/v2.1.0">v2.1.0</a>.)</em></p>
|
|
<div class="multicode" id="code-30"><ul class="codetabs"><li><a href="#code-30-0">REST</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-30-0" style="position: static;"><pre><code>GET /v2/accounts/{:address}/stats/value
|
|
</code></pre></div>
|
|
</div>
|
|
<p><a class="button" href="data-api-v2-tool.html#get-account-value-stats">Try it! ></a></p>
|
|
<p>This method requires the following URL parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>:address</td>
|
|
<td>String</td>
|
|
<td>Ripple address to query.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Optionally, you can also include the following query parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>start</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>Start time of query range. Defaults to the start of the most recent interval.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>end</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>End time of query range. Defaults to the end of the most recent interval.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>limit</td>
|
|
<td>Integer</td>
|
|
<td>Maximum results per page. Defaults to 200. Cannot be more than 1000.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>marker</td>
|
|
<td>String</td>
|
|
<td><a href="#pagination">Pagination</a> key from previously returned response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>descending</td>
|
|
<td>Boolean</td>
|
|
<td>If true, sort results with most recent first. By default, sort results with oldest first.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>format</td>
|
|
<td>String</td>
|
|
<td>Format of returned results: <code>csv</code> or <code>json</code>. Defaults to <code>json</code>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="response-format-30">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong> and has a JSON body with the following:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>result</td>
|
|
<td>String</td>
|
|
<td>The value <code>success</code> indicates that this is a successful response.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>count</td>
|
|
<td>Integer</td>
|
|
<td>Number of value stats objects in the <code>rows</code> field.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>rows</td>
|
|
<td>Array of Value Stats Objects</td>
|
|
<td>Daily summaries of account value for the given account.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Each Value Stats Object has the following fields:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>date</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>This object describes activity on this date.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>value</td>
|
|
<td><a href="#numbers-and-precision">String - Number</a></td>
|
|
<td>The total of all currency held by this account, normalized to XRP.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>balance_change_count</td>
|
|
<td>Number</td>
|
|
<td>The number of times the account's balance changed on this date.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="example-30">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v2/accounts/rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX/stats/value?limit=2&descending=true
|
|
</code></pre>
|
|
<p>Response:</p>
|
|
<pre><code>{
|
|
"result": "success",
|
|
"count": 2,
|
|
"marker": "rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX|20160412000000",
|
|
"rows": [
|
|
{
|
|
"date": "2016-04-14T00:00:00Z",
|
|
"account_value": "7.666658705139822E7",
|
|
"balance_change_count": 58
|
|
},
|
|
{
|
|
"date": "2016-04-13T00:00:00Z",
|
|
"account_value": "1.0022208004947332E8",
|
|
"balance_change_count": 184
|
|
}
|
|
]
|
|
}
|
|
</code></pre>
|
|
<h2 id="health-check-api">Health Check - API</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/develop/api/routesV2/checkHealth.js" title="Source">[Source]<br/></a></p>
|
|
<p>Check the health of the API service.</p>
|
|
<div class="multicode" id="code-31"><ul class="codetabs"><li><a href="#code-31-0">REST</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-31-0" style="position: static;"><pre><code>GET /v2/health/api
|
|
</code></pre></div>
|
|
</div>
|
|
<p>Optionally, you can also include the following query parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>threshold</td>
|
|
<td>Integer</td>
|
|
<td>Consider the API unhealthy if the database does not respond within this amount of time, in seconds. Defaults to 5 seconds.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>verbose</td>
|
|
<td>Boolean</td>
|
|
<td>If true, return a JSON response with data points. By default, return an integer value only.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="response-format-31">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong>. By default, the response body is an <strong>integer health value only</strong>.</p>
|
|
<p>The health value <code>0</code> always indicates a healthy status. Other health values are defined as follows:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Value</th>
|
|
<th>Meaning</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>0</code></td>
|
|
<td>API service is up, and response time to HBase is less than <code>threshold</code> value from request.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>1</code></td>
|
|
<td>API service is up, but response time to HBase is greater than <code>threshold</code> value from request.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>2</code></td>
|
|
<td>API service was unable to contact HBase, or received an error in connecting.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>If the request specifies <code>verbose=true</code> in the query parameters, the response body is a JSON object, with the following fields:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>score</td>
|
|
<td>0-2</td>
|
|
<td>Health value, as defined above.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>response_time</td>
|
|
<td>String - Human-readable time</td>
|
|
<td>The actual response time of the database.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>response_time_threshold</td>
|
|
<td>String - Human-readable time</td>
|
|
<td>The maximum response time to be considered healthy.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="example-31">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v2/health/api?verbose=true
|
|
</code></pre>
|
|
<p>Response:</p>
|
|
<pre><code>{
|
|
"score": 0,
|
|
"response_time": "0.014s",
|
|
"response_time_threshold": "5s"
|
|
}
|
|
</code></pre>
|
|
<h2 id="health-check-ledger-importer">Health Check - Ledger Importer</h2>
|
|
<p><a href="https://github.com/ripple/rippled-historical-database/blob/develop/api/routesV2/checkHealth.js" title="Source">[Source]<br/></a></p>
|
|
<p>Check the health of the Ledger Importer Service.</p>
|
|
<div class="multicode" id="code-32"><ul class="codetabs"><li><a href="#code-32-0">REST - Importer Health</a></li></ul>
|
|
|
|
<div class="code_sample" id="code-32-0" style="position: static;"><pre><code>GET /v2/health/importer
|
|
</code></pre></div>
|
|
</div>
|
|
<p>Optionally, you can also include the following query parameters:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>threshold</td>
|
|
<td>Integer</td>
|
|
<td>Consider the Importer unhealthy if more than this amount of time, in seconds, has elapsed since the latest validated ledger was imported. Defaults to 300 seconds.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>threshold2</td>
|
|
<td>Integer</td>
|
|
<td>Consider the Importer unhealthy if more than this amount of time, in seconds, has elapsed since the latest ledger of any kind was imported. Defaults to 60 seconds.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>verbose</td>
|
|
<td>Boolean</td>
|
|
<td>If true, return a JSON response with data points. By default, return an integer value only.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="response-format-32">Response Format</h4>
|
|
<p>A successful response uses the HTTP code <strong>200 OK</strong>. By default, the response body is an <strong>integer health value only</strong>.</p>
|
|
<p>The health value <code>0</code> always indicates a healthy status. Other health values are defined as follows:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Value</th>
|
|
<th>Meaning</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>0</code></td>
|
|
<td>The most recent imported ledger was less than <code>threshold2</code> (Default: 60) seconds ago, and most recent validated ledger was less than <code>threshold</code> seconds ago.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>1</code></td>
|
|
<td>The most recent imported ledger was less than <code>threshold2</code> (Default: 60) seconds ago, but the most recent validated ledger is older than <code>threshold</code> seconds.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>2</code></td>
|
|
<td>The most recent imported ledger was more than <code>threshold2</code> seconds ago.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>3</code></td>
|
|
<td>An error occurred when connecting to HBase, or the API was unable to determine when a ledger was most recently imported.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>If the request specifies <code>verbose=true</code> in the query parameters, the response body is a JSON object, with the following fields:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>score</td>
|
|
<td>0-3</td>
|
|
<td>Health value, as defined above.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>response_time</td>
|
|
<td>String</td>
|
|
<td>The actual response time of the database.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>ledger_gap</td>
|
|
<td>String - Human-readable time</td>
|
|
<td>Difference between the close time of the last saved ledger and the current time.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>ledger_gap_threshold</td>
|
|
<td>String - Human-readable time</td>
|
|
<td>Maximum ledger gap to be considered healthy.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>valildation_gap</td>
|
|
<td>String - Human-readable time</td>
|
|
<td>Difference between the close time of the last imported validated ledger and the current time.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>validation_gap_threshold</td>
|
|
<td>String - Human-readable time</td>
|
|
<td>Maximum validation gap to be considered healthy.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="example-32">Example</h4>
|
|
<p>Request:</p>
|
|
<pre><code>GET /v2/health/importer?verbose=true
|
|
</code></pre>
|
|
<p>Response:</p>
|
|
<pre><code>{
|
|
"score": 0,
|
|
"response_time": "0.081s",
|
|
"ledger_gap": "1.891s",
|
|
"ledger_gap_threshold": "5.00m",
|
|
"validation_gap": "29.894s",
|
|
"validation_gap_threshold": "15.00m"
|
|
}
|
|
</code></pre>
|
|
<h1 id="api-conventions">API Conventions</h1>
|
|
<h2 id="basic-types">Basic Types</h2>
|
|
<p>As a REST API, the Data API v2 uses <a href="http://json.org/">JSON</a>'s native datatypes to represent API fields, with some special cases.</p>
|
|
<h3 id="numbers-and-precision">Numbers and Precision</h3>
|
|
<p>Currency amounts in Ripple require more precision than most native number types, so the Data API v2 uses the String type to represent some values.</p>
|
|
<p>Within the String value, the numbers are serialized in the same way as native JSON numbers:</p>
|
|
<ul>
|
|
<li>Base-10.</li>
|
|
<li>Non-zero-prefaced.</li>
|
|
<li>May contain <code>.</code> as a decimal point. For example, ½ is represented as <code>0.5</code>. (American style, not European)</li>
|
|
<li>May contain <code>E</code> or <code>e</code> to indicate being raised to a power of 10. For example, <code>1.2E5</code> is equivalent to <code>120000</code>.</li>
|
|
<li>No comma (<code>,</code>) characters are used.</li>
|
|
</ul>
|
|
<p>The precision for amounts of <strong>non-XRP currency</strong> in Ripple is as follows:</p>
|
|
<ul>
|
|
<li>Minimum nonzero absolute value: <code>1000000000000000e-96</code></li>
|
|
<li>Maximum value: <code>9999999999999999e80</code></li>
|
|
<li>Minimum value: <code>-9999999999999999e80</code></li>
|
|
<li>15 decimal digits of precision</li>
|
|
</ul>
|
|
<p><strong>XRP</strong> has a different internal representation, and consequently its precision is different:</p>
|
|
<ul>
|
|
<li>Minimum value: <code>0</code></li>
|
|
<li>Maximum value: <code>100000000000</code> (<code>1e11</code>)</li>
|
|
<li>Precise to the nearest <code>0.000001</code> (<code>1e-6</code>)</li>
|
|
</ul>
|
|
<p>In other words, XRP has the same precision as a 64-bit unsigned integer where each unit is equivalent to 0.000001 XRP.</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 just 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 identical.</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><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="timestamps">Timestamps</h3>
|
|
<p>All dates and times are written in ISO 8601 Timestamp Format, using UTC. This format is summarized as:</p>
|
|
<p><code>YYYY-MM-DDThh:mm:ssZ</code></p>
|
|
<ul>
|
|
<li>Four-digit year</li>
|
|
<li>Two-digit month</li>
|
|
<li>Two-digit day</li>
|
|
<li>The letter <code>T</code> indicating the beginning of the time portion</li>
|
|
<li>Two-digit hour using a 24-hour clock</li>
|
|
<li>Two digit minute</li>
|
|
<li>The letter <code>Z</code> indicating zero offset from UTC.</li>
|
|
</ul>
|
|
<p>(As of <a href="https://github.com/ripple/rippled-historical-database/releases/tag/v2.0.4">v2.0.4</a>, the offset <code>+00:00</code> is no longer used.)</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 subsequent 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 identical. 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. Therefore, the hash of a ledger is not calculated until the ledger is closed.</li>
|
|
</ul>
|
|
<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 identical.</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="currency-code">Currency Code</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="pagination">Pagination</h2>
|
|
<p>Many queries may return more data than is reasonable to return in a single HTTP response. The Data API uses a "limit and marker" system to control how much is returned in a single response ("page") and to query for additional content.</p>
|
|
<p>The <code>limit</code> query parameter to many requests restricts the response to a specific number of results in the response. The types of results and default values vary based on the method. For most methods, the <code>limit</code> is <strong>200</strong> by default, and can be set as high as <strong>1000</strong>. If you specify a <code>limit</code> larger than the maximum, the API uses the maximum value instead.</p>
|
|
<p>When a query has additional objects that are not contained in the current response, the JSON response contains a top-level field <code>marker</code> which indicates that you can retrieve additional results by including the contents of the <code>marker</code> field as the <code>marker</code> query parameter of a subsequent request. For the follow-up request, you should use the same parameters as the initial request. When the response omits the <code>marker</code> parameter, that indicates that you have reached the end of the queryable data.</p>
|
|
<p>When a <code>marker</code> is or would be present, the response contains a <a href="https://tools.ietf.org/html/rfc5988#section-5"><code>Link</code> header</a> with <code>rel="next"</code>. This is a full URL to the next page of results. You can use this to paginate over results when the response is in <code>csv</code> format instead of <code>json</code>. <em>(New in <a href="https://github.com/ripple/rippled-historical-database/releases/tag/v2.0.4">v2.0.4</a>)</em></p>
|
|
<h2 id="transaction-objects">Transaction Objects</h2>
|
|
<p>Transactions have two formats - a compact "binary" format where the defining fields of the transaction are encoded as strings of hex, and an expanded format where the defining fields of the transaction are nested as complete JSON objects.</p>
|
|
<h3 id="full-json-format">Full JSON Format</h3>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>hash</td>
|
|
<td>String - <a href="#hashes">Hash</a></td>
|
|
<td>An identifying hash value unique to this transaction, as a hex string.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>date</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>The time when this transaction was included in a validated ledger.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>ledger_index</td>
|
|
<td>Number - <a href="#ledger-index">Ledger Index</a></td>
|
|
<td>The sequence number of the ledger that included this ledger.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>tx</td>
|
|
<td>Object</td>
|
|
<td>The fields of this transaction object, as defined by the <a href="reference-transaction-format.html">Transaction Format</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>meta</td>
|
|
<td>Object</td>
|
|
<td>Metadata about the results of this transaction.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3 id="binary-format">Binary Format</h3>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>hash</td>
|
|
<td>String - <a href="#hashes">Hash</a></td>
|
|
<td>An identifying hash value unique to this transaction, as a hex string.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>date</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>The time when this transaction was included in a validated ledger.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>ledger_index</td>
|
|
<td>Number - <a href="#ledger-index">Ledger Index</a></td>
|
|
<td>The sequence number of the ledger that included this ledger.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>tx</td>
|
|
<td>String</td>
|
|
<td>The binary data that represents this transaction, as a hexadecimal string.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>meta</td>
|
|
<td>String</td>
|
|
<td>The binary data that represents this transaction's metadata, as a hex string.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h2 id="ledger-objects">Ledger Objects</h2>
|
|
<p>A "ledger" is one version of the shared global ledger. Each ledger object has the following fields:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>ledger_hash</td>
|
|
<td>String - <a href="#hashes">Hash</a></td>
|
|
<td>An identifying hash unique to this ledger, as a hex string.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>ledger_index</td>
|
|
<td>Number - <a href="#ledger-index">Ledger Index</a></td>
|
|
<td>The sequence number of the ledger. Each new ledger has a ledger index 1 higher than the ledger that came before it.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parent_hash</td>
|
|
<td>String - <a href="#hashes">Hash</a></td>
|
|
<td>The identifying hash of the previous ledger.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>total_coins</td>
|
|
<td><a href="#numbers-and-precision">String - Number</a></td>
|
|
<td>The total number of "drops" of XRP still in existence at the time of the ledger. (Each XRP is 1,000,000 drops.)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>close_time_res</td>
|
|
<td>Number</td>
|
|
<td>The ledger close time is rounded to approximately this many seconds.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>accounts_hash</td>
|
|
<td>String - <a href="#hashes">Hash</a></td>
|
|
<td>Hash of the account information contained in this ledger, as hex.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>transactions_hash</td>
|
|
<td>String - <a href="#hashes">Hash</a></td>
|
|
<td>Hash of the transaction information contained in this ledger, as hex.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>close_time</td>
|
|
<td>Number</td>
|
|
<td>The time at which this ledger was closed, in UNIX time.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>close_time_human</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>The time at which this ledger was closed.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p><strong>Note:</strong> Ledger close times are approximate, typically rounded to about 10 seconds. Consequently, two subsequent ledgers could have the same close time recorded, when actual close times were several seconds apart. The sequence number (<code>ledger_index</code>) of the ledger makes it unambiguous which ledger closed first.</p>
|
|
<h3 id="genesis-ledger">Genesis Ledger</h3>
|
|
<p>Due to a mishap early in Ripple's history, ledgers 1 through 32569 were lost. Thus, ledger #32570 is the earliest ledger available anywhere. For purposes of the Data API v2, ledger #32570 is considered the <em>genesis ledger</em>.</p>
|
|
<h2 id="account-creation-objects">Account Creation Objects</h2>
|
|
<p>An account creation object represents the action of creating an account in the Ripple Consensus Ledger. There are two variations, depending on whether the account was already present in ledger 32570, the earliest ledger available. Accounts that were already present in ledger 32570 are termed <em>genesis accounts</em>.</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>address</td>
|
|
<td>String - <a href="#addresses">Address</a></td>
|
|
<td>The identifying address of this account, in base-58.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>inception</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>The UTC timestamp that the account was created. For genesis accounts, this is the timestamp of ledger 32570.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>ledger_index</td>
|
|
<td>Number - <a href="#ledger-index">Ledger Index</a></td>
|
|
<td>The sequence number of the ledger when the account was created, or 32570 for genesis accounts.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parent</td>
|
|
<td>String - <a href="#addresses">Address</a></td>
|
|
<td>(Omitted for genesis accounts) The identifying address of the account that provided the initial funding for this account.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>tx_hash</td>
|
|
<td>String - <a href="#hashes">Hash</a></td>
|
|
<td>(Omitted for genesis accounts) The identifying hash of the transaction that funded this account.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>initial_balance</td>
|
|
<td><a href="#numbers-and-precision">String - Number</a></td>
|
|
<td>(Omitted for genesis accounts) The amount of XRP that funded this account.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>genesis_balance</td>
|
|
<td><a href="#numbers-and-precision">String - Number</a></td>
|
|
<td>(Genesis accounts only) The amount of XRP this account held as of ledger #32570.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>genesis_index</td>
|
|
<td>Number - <a href="#account-sequence">Sequence Number</a></td>
|
|
<td>(Genesis accounts only) The transaction sequence number of the account as of ledger #32570.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h2 id="exchange-objects">Exchange Objects</h2>
|
|
<p>An exchange object represents an actual exchange of currency, which can occur in the Ripple Consensus Ledger as the result of executing either an OfferCreate transaction or a Payment transaction. In order for currency to actually change hands, there must be a previously-unfilled Offer previously placed in the ledger with an OfferCreate transaction.</p>
|
|
<p>A single transaction can cause several exchanges to occur. In this case, the sender of the transaction is the taker for all the exchanges, but each exchange will have a different provider, currency pair, or both.</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>base_amount</td>
|
|
<td>Number</td>
|
|
<td>The amount of the base currency that was traded</td>
|
|
</tr>
|
|
<tr>
|
|
<td>counter_amount</td>
|
|
<td>Number</td>
|
|
<td>The amount of the counter currency that was traded</td>
|
|
</tr>
|
|
<tr>
|
|
<td>rate</td>
|
|
<td>Number</td>
|
|
<td>The amount of the counter currency acquired per 1 unit of the base currency</td>
|
|
</tr>
|
|
<tr>
|
|
<td>autobridged_currency</td>
|
|
<td>String - <a href="#currency-code">Currency Code</a></td>
|
|
<td>(May be omitted) If the offer was autobridged (XRP order books were used to bridge two non-XRP currencies), this is the other currency from the offer that executed this exchange.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>autobridged_issuer</td>
|
|
<td>String - <a href="#addresses">Address</a></td>
|
|
<td>(May be omitted) If the offer was autobridged (XRP order books were used to bridge two non-XRP currencies), this is the other currency from the offer that executed this exchange.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>base_currency</td>
|
|
<td>String - <a href="#currency-code">Currency Code</a></td>
|
|
<td>The base currency</td>
|
|
</tr>
|
|
<tr>
|
|
<td>base_issuer</td>
|
|
<td>String - <a href="#addresses">Address</a></td>
|
|
<td>(Omitted for XRP) The account that issued the base currency</td>
|
|
</tr>
|
|
<tr>
|
|
<td>buyer</td>
|
|
<td>String - <a href="#addresses">Address</a></td>
|
|
<td>The account that acquired the base currency</td>
|
|
</tr>
|
|
<tr>
|
|
<td>client</td>
|
|
<td>String</td>
|
|
<td>(May be omitted) If the transaction contains a memo indicating what client application sent it, this is the contents of the memo.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>counter_currency</td>
|
|
<td>String - <a href="#currency-code">Currency Code</a></td>
|
|
<td>The counter currency</td>
|
|
</tr>
|
|
<tr>
|
|
<td>counter_issuer</td>
|
|
<td>String - <a href="#addresses">Address</a></td>
|
|
<td>(Omitted for XRP) The account that issued the counter currency</td>
|
|
</tr>
|
|
<tr>
|
|
<td>executed_time</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>The time the exchange occurred</td>
|
|
</tr>
|
|
<tr>
|
|
<td>ledger_index</td>
|
|
<td>Number - <a href="#ledger-index">Ledger Index</a></td>
|
|
<td>The sequence number of the ledger that included this transaction</td>
|
|
</tr>
|
|
<tr>
|
|
<td>offer_sequence</td>
|
|
<td>Number - <a href="#account-sequence">Sequence Number</a></td>
|
|
<td>The sequence number of the <code>provider</code>'s existing offer in the ledger.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>provider</td>
|
|
<td>String - <a href="#addresses">Address</a></td>
|
|
<td>The account that had an existing Offer in the ledger</td>
|
|
</tr>
|
|
<tr>
|
|
<td>seller</td>
|
|
<td>String - <a href="#addresses">Address</a></td>
|
|
<td>The account that acquired the counter currency</td>
|
|
</tr>
|
|
<tr>
|
|
<td>taker</td>
|
|
<td>String - <a href="#addresses">Address</a></td>
|
|
<td>The account that sent the transaction which executed this exchange</td>
|
|
</tr>
|
|
<tr>
|
|
<td>tx_hash</td>
|
|
<td>String - <a href="#hashes">Hash</a></td>
|
|
<td>The identifying hash of the transaction that executed this exchange. (<strong>Note:</strong> This exchange may be one of several executed in a single transaction.)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>tx_type</td>
|
|
<td>String</td>
|
|
<td>The type of transaction that executed this exchange, either <code>Payment</code> or <code>OfferCreate</code>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h2 id="reports-objects">Reports Objects</h2>
|
|
<p>Reports objects show the activity of a given account over a specific interval of time, typically a day. Reports have the following fields:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>account</td>
|
|
<td>String - <a href="#addresses">Address</a></td>
|
|
<td>The address of the account to which this report pertains.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>date</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>The start of the interval to which this report pertains.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>high_value_received</td>
|
|
<td><a href="#numbers-and-precision">String - Number</a></td>
|
|
<td>Largest amount received in a single transaction, normalized to XRP (as closely as possible). This includes payments and exchanges.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>high_value_sent</td>
|
|
<td><a href="#numbers-and-precision">String - Number</a></td>
|
|
<td>The largest amount sent in a single transaction, normalized to XRP (as closely as possible).</td>
|
|
</tr>
|
|
<tr>
|
|
<td>payments</td>
|
|
<td>Array of <a href="#payment-summary-objects">Payment Summary Objects</a></td>
|
|
<td>(May be omitted) Array with information on each payment sent or received by the account during this interval.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>payments_received</td>
|
|
<td>Number</td>
|
|
<td>The number of payments sent to this account. (This only includes payments for which this account was the destination, not payments that only rippled through the account or consumed the account's offers.)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>payments_sent</td>
|
|
<td>Number</td>
|
|
<td>The number of payments sent by this account.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>receiving_counterparties</td>
|
|
<td>Array or Number</td>
|
|
<td>If account lists requested, an array of addresses that received payments from this account. Otherwise, the number of different accounts that received payments from this account.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>sending_counterparties</td>
|
|
<td>Array or Number</td>
|
|
<td>If account lists requested, an array of addresses that sent payments to this account. Otherwise, the number of different accounts that sent payments to this account.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>total_value</td>
|
|
<td><a href="#numbers-and-precision">String - Number</a></td>
|
|
<td>Sum of total value received and sent in payments, normalized to XRP (as closely as possible).</td>
|
|
</tr>
|
|
<tr>
|
|
<td>total_value_received</td>
|
|
<td><a href="#numbers-and-precision">String - Number</a></td>
|
|
<td>Sum value of all payments to this account, normalized to XRP (as closely as possible).</td>
|
|
</tr>
|
|
<tr>
|
|
<td>total_value_sent</td>
|
|
<td><a href="#numbers-and-precision">String - Number</a></td>
|
|
<td>Sum value of all payments from this account, normalized to XRP (as closely as possible).</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h2 id="payment-summary-objects">Payment Summary Objects</h2>
|
|
<p>A Payment Summary Object contains a reduced amount of information about a single payment from the perspective of either the sender or receiver of that payment.</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>tx_hash</td>
|
|
<td>String - <a href="#hashes">Hash</a></td>
|
|
<td>The identifying hash of the transaction that caused the payment.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>delivered_amount</td>
|
|
<td><a href="#numbers-and-precision">String - Number</a></td>
|
|
<td>The amount of the destination <code>currency</code> actually received by the destination account.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>currency</td>
|
|
<td>String - <a href="#currency-code">Currency Code</a></td>
|
|
<td>The currency delivered to the recipient of the transaction.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>issuer</td>
|
|
<td>String - <a href="#addresses">Address</a></td>
|
|
<td>The gateway issuing the currency, or an empty string for XRP.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Either <code>sent</code> or <code>received</code>, indicating whether the perspective account is sender or receiver of this transaction.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h2 id="payment-objects">Payment Objects</h2>
|
|
<p>In the Data API, a Payment Object represents an event where one account sent value to another account. This mostly lines up with Ripple transactions of the <code>Payment</code> <a href="reference-transaction-format.html">transaction type</a>, except that the Data API does not consider a transaction to be a payment if the sending <code>Account</code> and the <code>Destination</code> account are the same, or if the transaction failed.</p>
|
|
<p>Payment objects have the following fields:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>amount</td>
|
|
<td><a href="#numbers-and-precision">String - Number</a></td>
|
|
<td>The amount of the destination <code>currency</code> that the transaction was instructed to send. In the case of Partial Payments, this is a "maximum" amount.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>delivered_amount</td>
|
|
<td><a href="#numbers-and-precision">String - Number</a></td>
|
|
<td>The amount of the destination <code>currency</code> actually received by the destination account.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>destination_balance_changes</td>
|
|
<td>Array</td>
|
|
<td>Array of <a href="#balance-objects-and-balance-change-objects">balance change objects</a>, indicating all changes made to the <code>destination</code> account's balances.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>source_balance_changes</td>
|
|
<td>Array</td>
|
|
<td>Array of <a href="#balance-objects-and-balance-change-objects">balance change objects</a>, indicating all changes to the <code>source</code> account's balances (except the XRP transaction cost).</td>
|
|
</tr>
|
|
<tr>
|
|
<td>transaction_cost</td>
|
|
<td><a href="#numbers-and-precision">String - Number</a></td>
|
|
<td>The amount of XRP spent by the <code>source</code> account on the transaction cost. (Prior to <a href="https://github.com/ripple/rippled-historical-database/releases/tag/v2.0.4">v2.0.4</a>, this parameter was called <code>fee</code>.)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>destination_tag</td>
|
|
<td>Integer</td>
|
|
<td>(May be omitted) A <a href="tutorial-gateway-guide.html#source-and-destination-tags">destination tag</a> specified in this payment.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>source_tag</td>
|
|
<td>Integer</td>
|
|
<td>(May be omitted) A <a href="tutorial-gateway-guide.html#source-and-destination-tags">source tag</a> specified in this payment.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>currency</td>
|
|
<td>String - <a href="#currency-code">Currency Code</a></td>
|
|
<td>The currency that the <code>destination</code> account received.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>destination</td>
|
|
<td>String - <a href="#addresses">Address</a></td>
|
|
<td>The account that received the payment.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>executed_time</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>The time the ledger that included this payment closed.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>ledger_index</td>
|
|
<td>Number - <a href="#ledger-index">Ledger Index</a></td>
|
|
<td>The sequence number of the ledger that included this payment.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>source</td>
|
|
<td>String - <a href="#addresses">Address</a></td>
|
|
<td>The account that sent the payment.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>source_currency</td>
|
|
<td>String - <a href="#currency-code">Currency Code</a></td>
|
|
<td>The currency that the <code>source</code> account spent.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>tx_hash</td>
|
|
<td>String - <a href="#hashes">Hash</a></td>
|
|
<td>The identifying hash of the transaction that caused the payment.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h2 id="balance-objects-and-balance-change-objects">Balance Objects and Balance Change Objects</h2>
|
|
<p>Balance objects represent an Ripple account's balance in a specific currency with a specific counterparty at a single point in time. Balance change objects represent a change to such balances that occurs in transaction execution.</p>
|
|
<p>A single Ripple transaction may cause changes to balances with several counterparties, as well as changes to XRP.</p>
|
|
<p>Balance objects and Balance Change objects have the same format, with the following fields:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>counterparty</td>
|
|
<td>String - <a href="#addresses">Address</a></td>
|
|
<td>The counterparty, or issuer, of the <code>currency</code>. In the case of XRP, this is an empty string.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>currency</td>
|
|
<td>String - <a href="#currency-code">Currency Code</a></td>
|
|
<td>The currency for which this balance changed.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>value</td>
|
|
<td><a href="#numbers-and-precision">String - Number</a></td>
|
|
<td>The amount of the <code>currency</code> that the associated account gained or lost. In balance change objects, this value can be positive (for amounts gained) or negative (for amounts lost). In balance objects, this value can be positive (for amounts the counterparty owes the account) or negative (for amounts owed to the counterparty).</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h2 id="balance-change-descriptors">Balance Change Descriptors</h2>
|
|
<p>Balance Change Descriptors are objects that describe and analyze a single balance change that occurs in transaction execution. They represent the same events as <a href="#balance-objects-and-balance-change-objects">balance change objects</a>, but in greater detail.</p>
|
|
<p>Balance Change Descriptors have the following fields:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>amount_change</td>
|
|
<td><a href="#numbers-and-precision">String - Number</a></td>
|
|
<td>The difference in the amount of currency held before and after this change. <em>(Prior to <a href="https://github.com/ripple/rippled-historical-database/releases/tag/v2.0.6">v2.0.6</a>, this field was called <code>change</code>.)</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>final_balance</td>
|
|
<td><a href="#numbers-and-precision">String - Number</a></td>
|
|
<td>The balance after the change occurred.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>node_index</td>
|
|
<td>Number (or <code>null</code>)</td>
|
|
<td>This balance change is represented by the entry at this index of the ModifiedNodes array within the metadata section of the transaction that executed this balance change. <strong>Note:</strong> When the transaction cost is combined with other changes to XRP balance, the transaction cost has a <code>node_index</code> of <strong>null</strong> instead.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>tx_index</td>
|
|
<td>Number</td>
|
|
<td>The transaction that executed this balance change is at this index in the array of transactions for the ledger that included it.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>change_type</td>
|
|
<td>String</td>
|
|
<td>One of several <a href="#change-types"></a> describing what caused this balance change to occur.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>currency</td>
|
|
<td>String - <a href="#currency-code">Currency Code</a></td>
|
|
<td>The change affected this currency.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>executed_time</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>The time the change occurred. (This is based on the close time of the ledger that included the transaction that executed the change.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>counterparty</td>
|
|
<td>String - <a href="#addresses">Address</a></td>
|
|
<td>(Omitted for XRP) The <code>currency</code> is held in a trust line to or from this account. <em>(Prior to <a href="https://github.com/ripple/rippled-historical-database/releases/tag/v2.0.6">v2.0.6</a>, this field was called <code>issuer</code>.)</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>ledger_index</td>
|
|
<td>Number - <a href="#ledger-index">Ledger Index</a></td>
|
|
<td>The sequence number of the ledger that included the transaction that executed this balance change.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>tx_hash</td>
|
|
<td>String - <a href="#hashes">Hash</a></td>
|
|
<td>The identifying hash of the transaction that executed this balance change.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3 id="change-types">Change Types</h3>
|
|
<p>The following values are valid for the <code>change_type</code> field of a Balance Change Descriptor:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Value</th>
|
|
<th>Meaning</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>transaction_cost</code></td>
|
|
<td>This balance change reflects XRP that was destroyed to relay a transaction. <em>(Prior to <a href="https://github.com/ripple/rippled-historical-database/releases/tag/v2.0.4">v2.0.4</a>, this was <code>network fee</code> instead.)</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>payment_destination</code></td>
|
|
<td>This balance change reflects currency that was received from a payment.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>payment_source</code></td>
|
|
<td>This balance change reflects currency that was spent in a payment.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>exchange</code></td>
|
|
<td>This balance change reflects currency that was traded for other currency, or the same currency from a different issuer. This can occur in the middle of payment execution as well as from offers.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h2 id="volume-objects">Volume Objects</h2>
|
|
<p>Volume objects represent the total volumes of money moved, in either payments or exchanges, during a given time period.</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>components</td>
|
|
<td>Array of Objects</td>
|
|
<td>The data that was used to assemble this total. For payment volume, each object represents payments in a particular currency and issuer. For exchange volume, each object represents a market between two currencies.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>count</td>
|
|
<td>Number</td>
|
|
<td>The total number of exchanges in this period.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>endTime</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>The end time of this interval.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>exchange</td>
|
|
<td>Object</td>
|
|
<td>Indicates the display currency used, as with fields <code>currency</code> and (except for XRP) <code>issuer</code>. All amounts are normalized by first converting to XRP, and then to the display currency specified in the request.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>exchangeRate</td>
|
|
<td>Number</td>
|
|
<td>The exchange rate to the displayed currency from XRP.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>startTime</td>
|
|
<td>String - <a href="#timestamps">Timestamp</a></td>
|
|
<td>The start of this time period.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>total</td>
|
|
<td>Number</td>
|
|
<td>Total volume of all recorded exchanges in the time period.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h1 id="running-the-historical-database">Running the Historical Database</h1>
|
|
<p>You can also serve the Data API v2 from your own instance of the Historical Database software, and populate it with transactions from your own <code>rippled</code> instance. This is useful if you do not want to depend on Ripple to operate the historical database indefinitely, or you want access to historical transactions from within your own intranet.</p>
|
|
<h2 id="installation">Installation</h2>
|
|
<h3 id="dependencies">Dependencies</h3>
|
|
<p>The Historical Database requires the following software installed first:</p>
|
|
<ul>
|
|
<li><a href="http://hbase.apache.org/">HBase</a> (required for v2),</li>
|
|
<li><a href="http://nodejs.org/">Node.js</a></li>
|
|
<li><a href="https://www.npmjs.org/">npm</a></li>
|
|
<li><a href="http://git-scm.com/">git</a> (optional) for installation and updating.</li>
|
|
</ul>
|
|
<p>Version 2 of the Historical Database requires HBase instead of <a href="http://www.postgresql.org/">PostgreSQL</a>. Postgres support is deprecated.</p>
|
|
<h3 id="installation-process">Installation Process</h3>
|
|
<p>Starting in</p>
|
|
<ol>
|
|
<li>Install HBase. For production use, configure it in distributed mode.</li>
|
|
<li>Clone the rippled Historical Database Git Repository:
|
|
<code>git clone https://github.com/ripple/rippled-historical-database.git</code>
|
|
(You can also download and extract a zipped release instead.)</li>
|
|
<li>Use npm to install additional modules:
|
|
<code>cd rippled-historical-database</code>
|
|
<code>npm install</code>
|
|
The install script will also create the required config files: <code>config/api.config.json</code> and <code>config/import.config.json</code></li>
|
|
<li>Modify the API and import config files as needed. Remove the <code>postgres</code> section from <code>api.config.json</code>.</li>
|
|
</ol>
|
|
<p>Reports, stats, and aggregated exchange data needs additional processing before the API can make it available. This processing uses Apache Storm as well as some custom scripts. See <a href="https://github.com/ripple/rippled-historical-database/blob/develop/storm/README.md">Storm Setup</a> for more information.</p>
|
|
<p>At this point, the rippled Historical Database is installed. See <a href="#services">Services</a> for the different components that you can run.</p>
|
|
<h3 id="tests">Tests</h3>
|
|
<p>Dependencies:
|
|
* <a href="https://docs.docker.com/compose/install/">Docker Compose</a></p>
|
|
<pre><code>$ docker-compose build
|
|
$ docker-compose up -d hbase
|
|
$ docker-compose run webapp npm test
|
|
</code></pre>
|
|
<h3 id="services">Services</h3>
|
|
<p>The <code>rippled</code> Historical Database consists of several processes that can be run separately.</p>
|
|
<ul>
|
|
<li><a href="#live-ledger-importer">Live Ledger Importer</a> - Monitors <code>rippled</code> for newly-validated ledgers.
|
|
Command: <code>node import/live</code></li>
|
|
<li><a href="#backfiller">Backfiller</a> - Populates the database with older ledgers from a <code>rippled</code> instance.
|
|
Command: <code>node import/postgres/backfill</code></li>
|
|
<li>API Server - Provides <a href="#api-method-reference">REST API access</a> to the data.
|
|
Command: <code>npm start</code> (restarts the server automatically when source files change),
|
|
or <code>node api/server.js</code> (simple start)</li>
|
|
</ul>
|
|
<h2 id="importing-data">Importing Data</h2>
|
|
<p>In order to retrieve data from the <code>rippled</code> Historical Database, you must first populate it with data. Broadly speaking, there are two ways this can happen:</p>
|
|
<ul>
|
|
<li>Connect to a <code>rippled</code> server that has the historical ledgers, and retrieve them. (Later, you can reconfigure the <code>rippled</code> server not to maintain history older than what you have in your Historical Database.)<ul>
|
|
<li>You can choose to retrieve only new ledgers as they are validated, or you can retrieve old ledgers, too.</li>
|
|
</ul>
|
|
</li>
|
|
<li>Or, you can load a dump from a database that already has the historical ledger data. (At this time, there are no publicly-available database dumps of historical data.) Use the standard process for your database.</li>
|
|
</ul>
|
|
<p>In all cases, keep in mind that the integrity of the data is only as good as the original source. If you retrieve data from a public server, you are assuming that the operator of that server is trustworthy. If you load from a database dump, you are assuming that the provider of the dump has not corrupted or tampered with the data.</p>
|
|
<h3 id="live-ledger-importer">Live Ledger Importer</h3>
|
|
<p>The Live Ledger Importer is a service that connects to a <code>rippled</code> server using the WebSocket API, and listens for ledger close events. Each time a new ledger is closed, the Importer requests the latest validated ledger. Although this process has some fault tolerance built in to prevent ledgers from being skipped, it is still possible that the Importer may miss ledgers.</p>
|
|
<p>The Live Ledger Importer includes a secondary process that runs periodically to validate the data already imported and check for gaps in the ledger history.</p>
|
|
<p>The Live Ledger Importer can import to one or more different data stores concurrently. If you have configured the historical database to use another storage scheme, you can use the <code>--type</code> parameter to specify the database type or types to use.</p>
|
|
<p>Example usage:</p>
|
|
<pre><code>// start loading records into HBase:
|
|
$ node import/live
|
|
</code></pre>
|
|
<h3 id="backfiller">Backfiller</h3>
|
|
<p>The Backfiller retrieves old ledgers from a <code>rippled</code> instance by moving backwards in time. You can optionally provide start and stop indexes to retrieve a specific range of ledgers, by their sequence number.</p>
|
|
<p>The <code>--startIndex</code> parameter defines the most-recent ledger to retrieve. The Backfiller retrieves this ledger first and then continues retrieving progressively older ledgers. If this parameter is omitted, the Backfiller begins with the newest validated ledger.</p>
|
|
<p>The <code>--stopIndex</code> parameter defines the oldest ledger to retrieve. The Backfiller stops after it retrieves this ledger. If omitted, the Backfiller continues as far back as possible. Because backfilling goes from most recent to least recent, the stop index should be a smaller than the start index.</p>
|
|
<p><strong>Warning:</strong> The Backfiller is best for filling in relatively short histories of transactions. Importing a complete history of all Ripple transactions using the Backfiller could take weeks. If you want a full history, we recommend acquiring a database dump with early transctions, and importing it directly. For the public server, Ripple (the company) used the internal SQLite database from an offline <code>rippled</code> to populate its historical databases with the early transactions, then used the Backfiller to catch up to date after the import finished.</p>
|
|
<p>Example usage:</p>
|
|
<pre><code>// get ledgers #1,000,000 to #2,000,000 (inclusive) and store in HBase
|
|
node import/hbase/backfill --startIndex 2000000 --stopIndex 1000000
|
|
</code></pre>
|
|
</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>
|