parse_pages - configurable apitool doc and base urls

This commit is contained in:
mDuo13
2016-03-03 18:09:04 -08:00
parent 5b274c06ca
commit 9abb1c6f20
29 changed files with 1124 additions and 1146 deletions

View File

@@ -1,267 +0,0 @@
//---------- List of requests ------------------------//
// Must be loaded after apitool-rest.js //
var DOC_BASE = "charts_api.html";
var URL_BASE = "https://api.ripplecharts.com:443";
var DEFAULT_ADDRESS_1 = "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn";
var TIME_20140101 = "2014-01-01T00:00:00.000Z";
var TIME_20150101 = "2015-01-01T00:00:00.000Z";
var TIME_20150101_2 = "2015-01-01T02:00:00.000Z";
//DEPRECATED and shut down!
//Request('Account Offers Exercised', {
// method: POST,
// path: "/api/account_offers_exercised",
// description: "Retrieve currency-exchange orders being exercised for a single account.",
// link: "#account-offers-exercised",
// params: {},
// body: {
// account: DEFAULT_ADDRESS_1,
// startTime: TIME_20140101,
// limit: 5,
// offset: 0,
// format: "json"
// }
//});
Request('Accounts Created', {
method: POST,
path: "/api/accounts_created",
description: "Retrieve information about the creation of new Ripple accounts.",
link: "#accounts-created",
params: {},
body: {
"startTime": TIME_20140101,
"endTime": "2015-03-31T00:00:00.000Z",
"timeIncrement": "week",
"descending": true,
"reduce": true
}
});
Request('Exchange Rates', {
method: POST,
path: "/api/exchange_rates",
description: "Retrieve information about the exchange rates between one or more pairs of currency.",
link: "#exchange-rates",
params: {},
body: {
"pairs": [
{
"base": {
"currency": "CNY",
"issuer": "rnuF96W4SZoCJmbHYBFoJZpR8eCaxNvekK"
},
"counter": {
"currency": "XRP"
}
},
{
"base": {
"currency": "MXN",
"issuer": "rG6FZ31hDHN1K5Dkbma3PSB5uVCuVVRzfn"
},
"counter": {
"currency": "USD",
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q"
}
}
],
"range": "day"
}
});
Request('Issuer Capitalization', {
method: POST,
path: "/api/issuer_capitalization",
description: "Retrieve the total capitalization (outstanding balance) of specified currency issuers over time.",
link: "#issuer-capitalization",
params: {},
body: {
"currencies": [
{
"currency": "USD",
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
},
{
"currency": "USD",
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q"
}
],
"startTime": TIME_20140101,
"endTime": TIME_20150101,
"timeIncrement": "month"
}
});
//DEPRECATED and removed!
//Request('Ledgers Closed', {
// method: POST,
// path: "/api/ledgers_closed",
// description: "Retrieve information about ledgers closed over time.",
// link: "#ledgers-closed",
// params: {},
// body: {
// "startTime": TIME_20140101,
// "endTime": TIME_20150101,
// "timeIncrement": "month",
// "descending": false,
// "reduce": true,
// "format": "json"
// }
//});
Request('Market Traders', {
method: POST,
path: "/api/market_traders",
description: "Return a list of accounts that participated in trading a specified currency exchange.",
link: "#market-traders",
params: {},
body: {
"base": {
"currency": "XRP"
},
"counter": {
"currency": "KRW",
"issuer": "rUkMKjQitpgAM5WTGk79xpjT38DEJY283d"
},
"startTime": TIME_20150101,
"transactions": true,
"format": "json"
}
});
//DEPRECATED and removed!
//Request('Offers', {
// method: POST,
// path: "/api/offers",
// description: "Returns all currency-exchange orders and cancellations over time for a specified currency pair, including unfulfilled offers.",
// link: "#offers",
// params: {},
// body: {
// "base": {
// "currency": "GBP",
// "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q"
// },
// "counter": {
// "currency": "XRP"
// },
// "startTime": "2015-03-01T00:00:00.000Z",
// "endTime": "2015-03-07T00:00:00.000Z",
// "timeIncrement": "day",
// "descending": false,
// "reduce": true,
// "format": "json"
// }
//});
Request('Offers Exercised', {
method: POST,
path: "/api/offers_exercised",
description: "Retrieve information about currency-exchange orders being exercised on the network, for a specific pair of currencies and timeframe.",
link: "#offers-exercised",
params: {},
body: {
"base": {
"currency": "USD",
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
},
"counter": {
"currency": "BTC",
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
},
"endTime": TIME_20150101,
"startTime": TIME_20150101_2,
"timeIncrement": "minute",
"timeMultiple": 15,
"format": "json"
}
});
Request('Top Markets', {
method: POST,
path: "/api/top_markets",
description: "Returns the total trade volume for a selection of the largest currency-exchange markets in the Ripple Network during a given time period.",
link: "#top-markets",
params: {},
body: {
"startTime": TIME_20150101,
"interval": "week",
"exchange": {
"currency": "USD",
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
}
}
});
//DEPRECATED and removed!
//Request('Total Network Value', {
// method: POST,
// path: "/api/total_network_value",
// description: "Retrieve the total amount of currency held in the network, as of a specified time.",
// link: "#total-network-value",
// params: {},
// body: {
// "time": TIME_20150101,
// "exchange":{
// "currency": "USD",
// "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
// }
// }
//});
//DEPRECATED and removed!
//Request('Total Value Sent', {
// method: POST,
// path: "/api/total_value_sent",
// description: "The total amount of money sent, in payments and currency exchanges, for a curated list of currencies and issuers.",
// link: "#total-value-sent",
// params: {},
// body: {
// "startTime": TIME_20150101,
// "interval": "month",
// "exchange": {
// "currency": "USD",
// "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
// }
// }
//});
//DEPRECATED and removed!
//Request('Transaction Stats', {
// method: POST,
// path: "/api/transaction_stats",
// description: "Retrieve information about Ripple transactions during a specific time frame.",
// link: "#transaction-stats",
// params: {},
// body: {
// "startTime": TIME_20150101,
// "endTime": TIME_20150101_2,
// "timeIncrement": "hour",
// "descending": true,
// "reduce": true,
// "format": "json"
// }
//});
//DEPRECATED and removed!
//Request('Value Sent', {
// method: POST,
// path: "/api/value_sent",
// description: "Retrieve the total amount of a single currency sent, in payments and currency exchanges, during a specific time period.",
// link: "#value-sent",
// params: {},
// body: {
// "currency": "JPY",
// "issuer": "r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN",
// "startTime": TIME_20150101,
// "endTime": TIME_20150101_2,
// "timeIncrement": "hour",
// "descending": false,
// "reduce": true,
// "format": "json"
// }
//});
//---------- End req. List ---------------------------//

View File

@@ -1,7 +1,7 @@
//---------- List of requests ------------------------//
// Must be loaded after apitool-rest.js //
var DOC_BASE = "data_api_v2.html";
var URL_BASE = "https://data-staging.ripple.com";
//var DOC_BASE = "reference-data-api.html";
//var URL_BASE = "https://data-staging.ripple.com";
var DEFAULT_ADDRESS_1 = "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn";
var KRW_TRADER_ADDRESS = "rsyDrDi9Emy6vPU78qdxovmNpmj5Qh4NKw";

View File

@@ -1,56 +0,0 @@
//---------- List of requests ------------------------//
// Must be loaded after apitool-rest.js //
var DOC_BASE = "historical_data.html";
var URL_BASE = "https://history.ripple.com:443";
var DEFAULT_ADDRESS_1 = "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn";
var DEFAULT_HASH = "9D591B18EDDD34F0B6CF4223A2940AEA2C3CC778925BABF289E0011CD8FA056E";
var DEFAULT_LEDGER = "3170DA37CE2B7F045F889594CBC323D88686D2E90E8FFD2BBCD9BAD12E416DB5";
Request('Get Account Transaction History', {
method: GET,
path: "/v1/accounts/{:address}/transactions?{:query_params}",
description: "Retrieve transactions that affected the given account.",
link: "#get-account-transaction-history",
params: {
"{:address}": DEFAULT_ADDRESS_1,
"{:query_params}": "type=Payment&result=tesSUCCESS"
}
});
Request('Get Transaction By Account and Sequence', {
method: GET,
path: "/v1/accounts/{:address}/transactions/{:sequence}?{:query_params}",
description: "Retrieve a specific transaction, by the account that sent it and the sequence number it used.",
link: "#get-transaction-by-account-and-sequence",
params: {
"{:address}": DEFAULT_ADDRESS_1,
"{:sequence}": 1,
"{:query_params}": "binary=false"
}
});
Request('Get Transaction', {
method: GET,
path: "/v1/transactions/{:hash}?{:query_params}",
description: "Retrieve a transactions by its identifying hash.",
link: "#get-transaction",
params: {
"{:hash}": DEFAULT_HASH,
"{:query_params}": "binary=false"
}
});
Request('Get Ledger', {
method: GET,
path: "/v1/ledgers/{:ledger_identifier}?{:query_params}",
description: "Retrieve a ledger by its sequence number or identifying hash.",
link: "#get-ledger",
params: {
"{:ledger_identifier}": DEFAULT_LEDGER,
"{:query_params}": "transactions=true&binary=false&expand=true"
}
});
//---------- End req. List ---------------------------//

View File

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

View File

@@ -12,6 +12,7 @@ var urlParams;
})();
;(function() {
var DOC_BASE = 'reference-rippled.html';
var request_button = $('#request_button');
var online_state = $('#online_state');
@@ -118,17 +119,17 @@ var urlParams;
Request('server_info', {
_description: 'Get information about the state of the server for human consumption. Results are subject to change without notice.',
_link: 'rippled-apis.html#server-info'
_link: DOC_BASE + '#server-info'
});
Request('server_state', {
_description: 'Get information about the state of the server for machine consumption.',
_link: 'rippled-apis.html#server-state'
_link: DOC_BASE + '#server-state'
});
Request('ping', {
_description: 'Check connectivity to the server.',
_link: 'rippled-apis.html#ping'
_link: DOC_BASE + '#ping'
});
/* ---- ---- */
@@ -137,7 +138,7 @@ var urlParams;
accounts: [ ],
streams: [ 'server', 'ledger' ],
_description: 'Start receiving selected streams from the server.',
_link: 'rippled-apis.html#subscribe',
_link: DOC_BASE + '#subscribe',
_stream: true
});
@@ -145,7 +146,7 @@ var urlParams;
accounts: [ ],
streams: [ 'server', 'ledger' ],
_description: 'Stop receiving selected streams from the server.',
_link: 'rippled-apis.html#unsubscribe',
_link: DOC_BASE + '#unsubscribe',
_stream: true
});
@@ -159,7 +160,7 @@ var urlParams;
transactions: true,
accounts: true,
_description: 'Returns ledger information.',
_link: 'rippled-apis.html#ledger'
_link: DOC_BASE + '#ledger'
});
Request('ledger_entry', {
@@ -168,17 +169,17 @@ var urlParams;
ledger_index: 'validated',
ledger_hash: void(0),
_description: 'Get a single node from the ledger',
_link: 'rippled-apis.html#ledger-entry'
_link: DOC_BASE + '#ledger-entry'
});
Request('ledger_closed', {
_description: 'Get the most recent closed ledger index.',
_link: 'rippled-apis.html#ledger-closed'
_link: DOC_BASE + '#ledger-closed'
});
Request('ledger_current', {
_description: 'Get the current in-progress ledger index.',
_link: 'rippled-apis.html#ledger-current'
_link: DOC_BASE + '#ledger-current'
});
/* ---- ---- */
@@ -186,7 +187,7 @@ var urlParams;
Request('account_info', {
account: sample_address,
_description: 'Get information about the specified account.',
_link: 'rippled-apis.html#account-info'
_link: DOC_BASE + '#account-info'
});
Request('account_lines', {
@@ -194,7 +195,7 @@ var urlParams;
account_index: void(0),
ledger: 'current',
_description: "Get a list of trust lines connected to an account.",
_link: 'rippled-apis.html#account-lines'
_link: DOC_BASE + '#account-lines'
});
Request('account_offers', {
@@ -202,7 +203,7 @@ var urlParams;
account_index: void(0),
ledger: 'current',
_description: 'Get a list of offers created by an account.',
_link: 'rippled-apis.html#account-offers'
_link: DOC_BASE + '#account-offers'
});
Request('account_tx', {
@@ -215,7 +216,7 @@ var urlParams;
forward: false,
marker: void(0),
_description: 'Get a list of transactions that applied to a specified account.',
_link: 'rippled-apis.html#account-tx'
_link: DOC_BASE + '#account-tx'
});
Request('account_currencies', {
@@ -224,7 +225,7 @@ var urlParams;
ledger_index: "validated",
account_index: 0,
_description: 'Returns a list of currencies the account can send or receive.',
_link: 'rippled-apis.html#account-currencies'
_link: DOC_BASE + '#account-currencies'
});
Request('gateway_balances', {
@@ -234,7 +235,7 @@ var urlParams;
ledger_index: "validated",
account_index: 0,
_description: 'Returns a list of currencies the account can send or receive.',
_link: 'rippled-apis.html#gateway-balances'
_link: DOC_BASE + '#gateway-balances'
});
/* ---- ---- */
@@ -244,19 +245,19 @@ var urlParams;
ledger_index: 348734,
ledger_hash: void(0),
_description: 'Get information about a specified transaction.',
_link: 'rippled-apis.html#transaction-entry'
_link: DOC_BASE + '#transaction-entry'
});
Request('tx', {
transaction: sample_tx,
_description: 'Returns information about a specified transaction.',
_link: 'rippled-apis.html#tx'
_link: DOC_BASE + '#tx'
});
Request('tx_history', {
start: 10,
_description: 'Returns the last N transactions starting from start index, in descending order, by ledger sequence number. Server sets N.',
_link: 'rippled-apis.html#tx-history'
_link: DOC_BASE + '#tx-history'
});
Request('book_offers', {
@@ -272,7 +273,7 @@ var urlParams;
},
limit: 10,
_description: 'Returns a snapshot of the offers for an order book.',
_link: 'rippled-apis.html#book-offers'
_link: DOC_BASE + '#book-offers'
});
Request('path_find', {
@@ -285,7 +286,7 @@ var urlParams;
"issuer": sample_address_2
},
_description: 'Start or stop searching for payment paths between specified accounts.',
_link: 'rippled-apis.html#path-find',
_link: DOC_BASE + '#path-find',
_stream: true
});
@@ -301,7 +302,7 @@ var urlParams;
"issuer": sample_address_2
},
_description: 'Find a path between specified accounts once. For repeated usage, call <strong>path_find</strong> instead.',
_link: 'rippled-apis.html#ripple-path-find'
_link: DOC_BASE + '#ripple-path-find'
});
Request('submit', {
@@ -315,7 +316,7 @@ var urlParams;
Flags: 0
},
_description: 'Submits a transaction to the network.',
_link: 'rippled-apis.html#submit',
_link: DOC_BASE + '#submit',
_takes_secret: true
});
@@ -334,7 +335,7 @@ var urlParams;
offline: false,
fee_mult_max: 1000,
_description: 'Sends a transaction to be signed by the server.',
_link: 'rippled-apis.html#sign',
_link: DOC_BASE + '#sign',
_takes_secret: true
});