mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-21 12:15:50 +00:00
Merge branch 'data_v2_004' of https://github.com/ripple/ripple-dev-portal into gh-pages
This commit is contained in:
1617
content/data_v2.md
1617
content/data_v2.md
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,11 @@
|
||||
//---------- List of requests ------------------------//
|
||||
// Must be loaded after apitool-rest.js //
|
||||
var DOC_BASE = "data_api_v2.html";
|
||||
var URL_BASE = "https://data.ripple.com:443";
|
||||
var URL_BASE = "https://data-staging.ripple.com";
|
||||
|
||||
var DEFAULT_ADDRESS_1 = "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn";
|
||||
var KRW_TRADER_ADDRESS = "rsyDrDi9Emy6vPU78qdxovmNpmj5Qh4NKw";
|
||||
var JPY_TRADER_ADDRESS = "rK5j9n8baXfL4gzUoZsfxBvvsv97P5swaV";
|
||||
var DEFAULT_HASH = "9D591B18EDDD34F0B6CF4223A2940AEA2C3CC778925BABF289E0011CD8FA056E";
|
||||
var DEFAULT_LEDGER = "3170DA37CE2B7F045F889594CBC323D88686D2E90E8FFD2BBCD9BAD12E416DB5";
|
||||
|
||||
@@ -44,6 +45,17 @@ Request('Get Transactions', {
|
||||
}
|
||||
});
|
||||
|
||||
Request('Get Payments', {
|
||||
method: GET,
|
||||
path: "/v2/payments/{:currency}?{:query_params}",
|
||||
description: "Retrieve Payments over time, where Payments are defined as Payment-type transactions where the sender of the transaction is not also the destination. ",
|
||||
link: "#get-payments",
|
||||
params: {
|
||||
"{:currency}": "BTC+rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
||||
"{:query_params}": "limit=2"
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Request('Get Exchanges', {
|
||||
method: GET,
|
||||
@@ -57,11 +69,33 @@ Request('Get Exchanges', {
|
||||
}
|
||||
});
|
||||
|
||||
Request('Get Daily Summary', {
|
||||
Request('Get Exchange Rates', {
|
||||
method: GET,
|
||||
path: "/v2/exchange_rates/{:base}/{:counter}?{:query_params}",
|
||||
description: "Retrieve an exchange rate for a given currency pair at a specific time.",
|
||||
link: "#get-exchange-rates",
|
||||
params: {
|
||||
"{:base}": "USD+rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
||||
"{:counter}": "XRP",
|
||||
"{:query_params}": "date=2015-11-13T00:00:00Z"
|
||||
}
|
||||
});
|
||||
|
||||
Request('Normalize', {
|
||||
method: GET,
|
||||
path: "/v2/normalize?{:query_params}",
|
||||
description: "Convert an amount from one currency and issuer to another, using the network exchange rates.",
|
||||
link: "#normalize",
|
||||
params: {
|
||||
"{:query_params}": "amount=100¤cy=XRP&exchange_currency=USD&exchange_issuer=rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q"
|
||||
}
|
||||
});
|
||||
|
||||
Request('Get Daily Reports', {
|
||||
method: GET,
|
||||
path: "/v2/reports/{:date}?{:query_params}",
|
||||
description: "Retrieve an aggregated summary of payments per account for one day.",
|
||||
link: "#get-daily-summary",
|
||||
link: "#get-daily-reports",
|
||||
params: {
|
||||
"{:date}": "2015-08-19T00:00:00Z",
|
||||
"{:query_params}": "accounts=true&payments=true"
|
||||
@@ -78,6 +112,78 @@ Request('Get Stats', {
|
||||
}
|
||||
});
|
||||
|
||||
Request('Get Capitalization', {
|
||||
method: GET,
|
||||
path: "/v2/capitalization/{:currency}?{:query_params}",
|
||||
description: "Get capitalization data for a specific currency and issuer.",
|
||||
link: "#get-capitalization",
|
||||
params: {
|
||||
"{:currency}": "USD+rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
||||
"{:query_params}": "start=2015-01-01T00:00:00Z&end=2015-10-31&interval=month"
|
||||
}
|
||||
});
|
||||
|
||||
Request('Get Active Accounts', {
|
||||
method: GET,
|
||||
path: "/v2/active_accounts/{:base}/{:counter}?{:query_params}",
|
||||
description: "Get information on which accounts are actively trading in a specific currency pair.",
|
||||
link: "#get-active-accounts",
|
||||
params: {
|
||||
"{:base}": "USD+rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
|
||||
"{:counter}": "XRP",
|
||||
"{:query_params}": "period=7day"
|
||||
}
|
||||
});
|
||||
|
||||
Request('Get Exchange Volume', {
|
||||
method: GET,
|
||||
path: "/v2/network/exchange_volume?{:query_params}",
|
||||
description: "Get aggregated exchange volume for a given time period.",
|
||||
link: "#get-exchange-volume",
|
||||
params: {
|
||||
"{:query_params}": "start=2015-10-01T00:00:00&end=2015-11-15T00:00:00&interval=week&exchange_currency=USD&exchange_issuer=rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q"
|
||||
}
|
||||
});
|
||||
|
||||
Request('Get Payment Volume', {
|
||||
method: GET,
|
||||
path: "/v2/network/payment_volume?{:query_params}",
|
||||
description: "Get aggregated payment volume for a given time period.",
|
||||
link: "#get-exchange-volume",
|
||||
params: {
|
||||
"{:query_params}": "start=2015-10-01T00:00:00&end=2015-11-15T00:00:00&interval=week&exchange_currency=USD&exchange_issuer=rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q"
|
||||
}
|
||||
});
|
||||
|
||||
Request('Get Issued Value', {
|
||||
method: GET,
|
||||
path: "/v2/network/issued_value?{:query_params}",
|
||||
description: "Get aggregated payment volume for a given time period.",
|
||||
link: "#get-exchange-volume",
|
||||
params: {
|
||||
"{:query_params}": "start=2015-10-01T00:00:00&end=2015-11-15T00:00:00&exchange_currency=USD&exchange_issuer=rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q"
|
||||
}
|
||||
});
|
||||
|
||||
Request('Get All Gateways', {
|
||||
method: GET,
|
||||
path: "/v2/gateways",
|
||||
description: "Get information about known gateways.",
|
||||
link: "#get-all-gateways",
|
||||
params: {}
|
||||
});
|
||||
|
||||
Request('Get Gateway', {
|
||||
method: GET,
|
||||
path: "/v2/gateways/{:gateway}",
|
||||
description: "Get information about a specific known gateway.",
|
||||
link: "#get-gateway",
|
||||
params: {
|
||||
"{:gateway}": "Gatehub"
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// account methods -----------------------------------//
|
||||
|
||||
Request("ACCOUNT METHODS");
|
||||
@@ -114,6 +220,18 @@ Request('Get Account Balances', {
|
||||
});
|
||||
|
||||
|
||||
Request('Get Account Orders', {
|
||||
method: GET,
|
||||
path: "/v2/accounts/{:address}/orders?{:query_params}",
|
||||
description: "Get orders in the order books, placed by a specific account.",
|
||||
link: "#get-account-orders",
|
||||
params: {
|
||||
"{:address}": JPY_TRADER_ADDRESS,
|
||||
"{:query_params}": "limit=2&date=2015-11-11T00:00:00Z"
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Request('Get Account Transaction History', {
|
||||
method: GET,
|
||||
path: "/v2/accounts/{:address}/transactions?{:query_params}",
|
||||
|
||||
@@ -35,21 +35,26 @@ PRINCE_PAGE_MANIFEST_FILE = "/tmp/devportal-pages.txt"
|
||||
|
||||
PDF_TARGET = "pdf"
|
||||
DEFAULT_TARGET = "local"
|
||||
MULTICODE_TAB_TARGETS = ["local","ripple.com"]
|
||||
|
||||
|
||||
MC_START_REGEX = re.compile("<!-- *<div class='multicode'[^>]*> *-->")
|
||||
MC_END_REGEX = re.compile("<!-- *</div> *-->")
|
||||
|
||||
def parse_markdown(md, target=DEFAULT_TARGET, pages=None):
|
||||
## Python markdown requires markdown="1" on HTML block elements
|
||||
## that contain markdown. AND there's a bug where if you use
|
||||
## markdown.extensions.extra, it replaces code fences in HTML
|
||||
## block elements with garbled text
|
||||
print("adding markdown class to embedded divs...")
|
||||
def add_markdown_class(m):
|
||||
if m.group(0).find("markdown=") == -1:
|
||||
return m.group(1) + ' markdown="1">'
|
||||
else:
|
||||
return m.group(0)
|
||||
|
||||
md = re.sub("(<div[^>]*)>", add_markdown_class, md)
|
||||
print("done")
|
||||
# print("adding markdown class to embedded divs...")
|
||||
# def add_markdown_class(m):
|
||||
# if m.group(0).find("markdown=") == -1:
|
||||
# return m.group(1) + ' markdown="1">'
|
||||
# else:
|
||||
# return m.group(0)
|
||||
#
|
||||
# md = re.sub("(<div[^>]*)>", add_markdown_class, md)
|
||||
# print("done")
|
||||
|
||||
#the actual markdown parsing is the easy part
|
||||
print("parsing markdown...")
|
||||
@@ -57,6 +62,13 @@ def parse_markdown(md, target=DEFAULT_TARGET, pages=None):
|
||||
"markdown.extensions.toc"])
|
||||
print("done")
|
||||
|
||||
#if target uses multicode tabs, uncomment the divs
|
||||
if target in MULTICODE_TAB_TARGETS:
|
||||
print("enabling multicode tabs...")
|
||||
html = re.sub(MC_START_REGEX, "<div class='multicode'>", html)
|
||||
html = re.sub(MC_END_REGEX, "</div>", html)
|
||||
print("done")
|
||||
|
||||
#replace underscores with dashes in h1,h2,etc. for Flatdoc compatibility
|
||||
print("tweaking header IDs...")
|
||||
soup = BeautifulSoup(html, "html.parser")
|
||||
@@ -248,8 +260,7 @@ if __name__ == "__main__":
|
||||
help="Watch for changes and re-generate the files. This runs until force-quit.")
|
||||
parser.add_argument("--pdf", type=str,
|
||||
help="Generate a PDF, too. Requires Prince.")
|
||||
parser.add_argument("--target", "-t", type=str, default=DEFAULT_TARGET,
|
||||
choices=[DEFAULT_TARGET,"ripple.com"])
|
||||
parser.add_argument("--target", "-t", type=str, default=DEFAULT_TARGET)
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.pdf:
|
||||
|
||||
Reference in New Issue
Block a user