Changed the way you are setting the request callback.
Previous documentation didn't work, ie, the callback was never called (probably old way to set the callback).
MissingLedgerHistoryError - no minLedgerVersion or maxLedgerVersion
There is a ledger gap, but a range should be provided to narrow down the range
of the gap.
MissingLedgerHistoryError
When requesting a tx, if maxLedgerVersion and minLedgerVersion provided, this
means there is a ledger gap in the provided range.
PendingLedgerVersionError:
If maxLedgerVersion provided, check if ledger is ahead of the server's last
validated ledger.
Add flow to api/server/server.js
Add flow check to src/api: index, accountinfo, balances, orderbook..
orders, settings, transaction, transactions
Add flow typecheck to api/ledger/pathfind
Use eslint plugin flowtype to allow flow type annotations
Babel-eslint emits errors when using the type keyword. This plugin works
around the issue by stripping flow annotations before linting.
Source: https://www.npmjs.com/package/eslint-plugin-flowtype
Add flow to ledger/parse/account-order, trustline, orderbook-order
* JSON messages are now parsed in server.js
* Remote._handleMessage expects all messages to be objects rather
than objects or strings
* Invalid responses from the server will now result in a log
message that is not entirely vague
* Added Log.setEngine/getEngine. Use Log.setEngine(Log.engines.none)
to silence logging
* Fix lint violations in various files
* Use per-file comment directives to make new-cap a warning instead of error
* sjcl.* don't conform to our standards and eslint exemptions are unweildy
- add MemoFormat property for memo
- MemoFormat and MemoType must be valid ASCII
- Memo content is converted on the serialization level
- add parsed_* version of Memo content if the parser understand the format
- support `text` and `json` MemoFormat
[FIX] double serialization overriding Memo contents
The copy made in from_json wasn't a deep copy
Do not finalize tef or tel-class errors until LastLedgerSequence is
exceeded. Transactions that fail in this way will now be aborted
with a tej-class error. Errors like tefALREADY and tefMAX_LEDGER
should now be opaque to the user and have no consequence in
determining a final state.
- Deprecate 'save' event
- Add TransactionQueue.getMinLedger(), use this as ledger_index_min
in account_tx request on reconnect
- tx.sign() no longer accepts a callback
- Add various setters and jsdoc to transaction.js
- Normalize setters, e.g. sourceTag() and destinationTag()
- Minor optimization in call to tx.hash() in TransactionManager prior
to submit; allow `serialized` argument to tx.hash() such that the
transaction is not serialized twice
- native support for k256
- improved entropy by taking advantage of platform crypto
- remove unnecessary sjcl overrides from sjcl-secp256k1.js
- updated ripple-lib curve instantiations to use k256
- add curve override so c256 points to k256
16dde36fa2
- add MemoFormat property for memo
- MemoFormat and MemoType must be valid ASCII
- Memo content is converted on the serialization level
- add parsed_* version of Memo content if the parser understand the format
- support `text` and `json` MemoFormat
when using a marker on an account request, a valid ledger_index or ledger_hash is required, otherwise the results can't be guaranteed to be reliable
consolidated test values for addresses, indexes and hashes
- `get_interest_at` for a currency without interest would not hit the intended check since the function was used as variable instead of calling the method
some requests return results that can be paged through, e.g. `account_lines`
use `limit` and `marker` options to specify results per response and position
change `requestAccountLines` and `requestAccountOffers` to use the `pagingAccountRequest`
remote was instantiated as an object and checks through the class for `this.remote` would pass and cause
unintended behavior
e.g. `.complete()` would view an undefined remote as untrusted and not allow local signing
e.g. calling `_computeFee()` with an undefined remote would crash ripple-lib
`precision` expresses precision within the provided value and won't expand it if the max expression of the value is smaller
`min_precision` will expand the value if the max expression of the value is smaller
ledger_index and ledger_hash were being set to true
instead of the specified value, and according to API
docs 'closed','validated', and 'current' can be
supplied to the ledger_index field to get the most
recent of the specified type
The previous version of these tests was using `get_address` just like the code being tested. It's better to check if the code in question has actually been able to correctly find the public key (which means it also found the correct private key.)
+ [Add Remote.closeCurrentPathFind function, so current pathfind can be properly closed](https://github.com/ripple/ripple-lib/commit/e99010f363fc7cbe7fd547d3ca5b32ea083c44e6)
+ [Prevent crash when listening for "model" events on the OrderBook class](https://github.com/ripple/ripple-lib/commit/5824c3cb7cb6bd834d6e037f69943aebf3d83351)
+ [Fix empty order edgecase](https://github.com/ripple/ripple-lib/commit/64809d9ae23dc24f47accd4b4788b48f49880d3e)
+ [Update sjcl and delete custom ripemd160, montgomery, and jacobi](https://github.com/ripple/ripple-lib/commit/50cda426eb83599c38c0b725e1524a01fc415da2)
+ [Fix transaction summary for transactions that fail with remoteError](https://github.com/ripple/ripple-lib/commit/5e714f6143464d7912f42537acaa553b88eaf6dc)
+ [Fix serializedobject append for excessively large bytes length](https://github.com/ripple/ripple-lib/commit/e93f1ab6f4aaad347450aee75a169af0faa2121c)
+ [Switch to sjcl npm module](https://github.com/ripple/ripple-lib/commit/9a502580fd89ec6a9aa55f4e5847f6a4a2cb5bba)
+ [Add `Amount.scale`. Multiply an amount’s value by a scale factor](https://github.com/ripple/ripple-lib/commit/74dac97b368493056474468520f05671f458a69f)
##0.12.2
+ [Check that stack trace is available, fixes logging in browser](https://github.com/ripple/ripple-lib/commit/53cae3a66d48e88e8a6bbb96d6489ce7b9e22975)
##0.12.1
**Breaking Changes**
+ [Removed support for parsing native amounts in floating point format](https://github.com/ripple/ripple-lib/commit/e80cd1ff55deae9cd5b0ae85be957f86856b887e)
**Changes**
+ [Fix taker pays funded calculation](https://github.com/ripple/ripple-lib/commit/5af824f5cf46c7b9caa58ee0a757bf854d26c8dc)
+ [Fix order funded amount calculation](https://github.com/ripple/ripple-lib/commit/b2cdb1a6aed968b1f306e8dadbd4b7ca37e5aa03)
+ [Fix handling of quality in order book](https://github.com/ripple/ripple-lib/commit/2a5a8b498da60df738ba18d5c265f34771e8a1af)
+ [Fix currency parsing of non-alphanumeric and no-currency currencies](https://github.com/ripple/ripple-lib/commit/2166bb2e88eae8d5f1aba77338f69e8a9edf6a6f)
+ [Add Amount.strict_mode for toggling range validation](https://github.com/ripple/ripple-lib/commit/b5ed8f59a7dab1a17491618b8d9193646c314fb4)
+ [Add filename and line number to log, use log.warn() for deprecations](https://github.com/ripple/ripple-lib/commit/90329d3d73f1a76675063655b407513e32dc048b)
+ [Add GlobalFreeze and NoFreeze flags](https://github.com/ripple/ripple-lib/commit/e2ed2bdbf6f01c7d4d690c2cf0b83fba94558dd7)
+ [Fix handling of falsy parameters in requestLedger](https://github.com/ripple/ripple-lib/commit/6023efed41b7812b3bab660a1c0dc9f0a21000b9)
+ [Remove `Features` field requirement in `SetFee` transaction format](https://github.com/ripple/ripple-lib/commit/a20a649013646710c078d4ce1e210f87c7fe74fe)
+ [Remove `RegularKey` field requirement in `SetRegularKey` transaction format](https://github.com/ripple/ripple-lib/commit/c275174f27877ba8f389eb4efe969feb514d6e46)
##0.12.0
**Breaking Changes**
+ REMOVED Remote storage interface
+ REMOVED Remote `ping` configuration
+ REMOVED Old/deprecated Remote server configuration (websocket_ip, websocket_port)
+ [Add deprecation warnings to request constructors. The first argument to request constructor functions should be an object containing request properties](https://github.com/ripple/ripple-lib/commit/35d76b3520934285f80059c1badd6c522539104c)
+ [Track the funded status of an order based on cumulative account orders](https://github.com/ripple/ripple-lib/commit/67d39737a4d5e0fcd9d9b47b9083ee00e5a9e652) and [67d3973](https://github.com/ripple/ripple-lib/commit/b6b99dde022e1e14c4797e454b1d7fca50e49482)
+ Remove blobvault client from ripple-lib, use the [`ripple-vault-client`](https://github.com/ripple/ripple-vault-client) instead [9b3d62b7](https://github.com/ripple/ripple-lib/commit/9b3d62b765c4c25beae6eb0fa57ef3a07f2581b1)
+ [Add support for `ledger` option in requestBookOffers](https://github.com/ripple/ripple-lib/commit/34c0677c453c409ef0a5b351959abdc176d3bacb)
+ [Add support for `limit` option in requestBookOffers](https://github.com/ripple/ripple-lib/commit/d1d4452217c878d0b377d24830b4cd8b3162f6e0)
+ [Add `ledgerSelect` request constructor in `Remote`](https://github.com/ripple/ripple-lib/commit/98f40abfc3aa74dec5067a2d90002756cc8acd01)
+ [Default to binary data for commands that accept the binary flag](https://github.com/ripple/ripple-lib/commit/7cb113fcbcfc1e3e9830a999148b3e78df3387cc)
+ [Double check `tes` code before emitting `success`](https://github.com/ripple/ripple-lib/commit/97a8c874903eb7309d8f755955ac80872f670582)
+ [Decrease redundancy in binary account_tx parsing](https://github.com/ripple/ripple-lib/commit/0aba638e6e7f4f6e22cb6424eed3897ebad90a5a)
+ [Abort server connection on unrecoverable TLS error](https://github.com/ripple/ripple-lib/commit/000a2ea00c57157044aeca0fb3f24b37669b163c)
+ [Fix complete ledgers check on subscription that is not initial](https://github.com/ripple/ripple-lib/commit/89de91301e682a46dc60aaacc7ae152e8fe1b7c7)
+ **Important**`tef*` and `tel*` and errors will no longer be presented as
final. Rather than considering these errors final, ripple-lib will wait until
the `LastLedgerSequence` specified in the transaction is exceeded. This makes
failures more definitive, and ensures that no transaction will resubmit
indefinitely.
+ A new, final tej-class error is introduced to account for transactions that
are locally determined to have expired: `tejMaxLedger`.
+ [Allow per transaction fees to be set, `transaction.setFixedFee()`](https://github.com/ripple/ripple-lib/commit/9b22f279bcbe60ee6bcf4b7fa60a48e9c197a828)
+ [Fix: fractional drops in funded taker_pays setter](https://github.com/ripple/ripple-lib/commit/0d7fc0a573a144caac15dd13798b23eeb1f95fb4)
##0.9.3
+ [Change `presubmit` to emit immediately before transaction submit](https://github.com/ripple/ripple-lib/commit/7a1feaa89701bf861ab31ebd8ffdc8d8d1474e29)
+ [Add a "core" browser build of ripple-lib which has a subset of features and smaller file size](https://github.com/ripple/ripple-lib/pull/205)
+ [Update binformat with missing fields from rippled](https://github.com/ripple/ripple-lib/commit/cae980788efb00191bfd0988ed836d60cdf7a9a2)
+ [Wait for transaction validation before returning `tec` error](https://github.com/ripple/ripple-lib/commit/6bdd4b2670906588852fc4dda457607b4aac08e4)
+ [Change default `max_fee` on `Remote` to `1 XRP`](https://github.com/ripple/ripple-lib/commit/d6b1728c23ff85c3cc791bed6982a750641fd95f)
+ [Fix: Request ledger_accept should return the Remote](https://github.com/ripple/ripple-lib/pull/209)
+ [Add paging behavior for account requests, `account_lines` and `account_offers`](https://github.com/ripple/ripple-lib/commit/722f4e175dbbf378e51b49142d0285f87acb22d7)
+ [Add max_fee setter to transactions to set max fee the submitter is willing to pay] (https://github.com/ripple/ripple-lib/commit/24587fab9c8ad3840d7aa345a7037b48839e09d7)
+ [Fix: cap IOU Amounts to their max and min value] (https://github.com/ripple/ripple-lib/commit/f05941fbc46fdb7c6fe7ad72927af02d527ffeed)
Example on how to use paging with `account_offers`:
```
// A valid `ledger_index` or `ledger_hash` is required to provide a reliable result.
// Results can change between ledger closes, so the provided ledger will be used as base.
var options = {
account: < rippleAccount >,
limit: < Number between 10 and 400 >,
ledger: < valid ledger_index or ledger_hash >
}
// The `marker` comes back in an account request if there are more results than are returned
// in the current response. The amount of results per response are determined by the `limit`.
if (marker) {
options.marker = < marker >;
}
var request = remote.requestAccountOffers(options);
```
[Full working example](https://github.com/geertweening/ripple-lib-scripts/blob/master/account_offers_paging.js)
##0.9.1
+ Switch account requests to use ledgerSelect rather than ledgerChoose ([278df90](https://github.com/ripple/ripple-lib/commit/278df9025a20228de22379a53c76ca12d40fa591))
+ **Deprecated** setting `ident` and `account_index` on account requests ([278df90](https://github.com/ripple/ripple-lib/commit/278df9025a20228de22379a53c76ca12d40fa591))
+ Change initial account transaction sequence to 1 ([a3c1d06](https://github.com/ripple/ripple-lib/commit/a3c1d06eba883dc84fe2bfe700e4309795c84cac))
+ Fix: rsign.js local signing and example ([d3b6b81](https://github.com/ripple/ripple-lib/commit/d3b6b8127c7b01e416b400c25abf1719bdd008ca) and [f1004c6](https://github.com/ripple/ripple-lib/commit/f1004c6db2a0ce59bbabbb8f2b355a9fd9995fd8))
##0.9.0
+ Add routes to the vault client for KYC attestations ([ed2da574](https://github.com/ripple/ripple-lib/commit/ed2da57475acf5e9d2cf3373858f4274832bd83f))
+ Currency: add `show_interest` flag to show or hide interest in `Currency.to_human()` and `Currency.to_json()` [Example use in tests](https://github.com/ripple/ripple-lib/blob/947ec3edc2e7c8f1ef097e496bf552c74366e749/test/currency-test.js#L123)
+ Configurable maxAttempts for transaction submission ([d107092](https://github.com/ripple/ripple-lib/commit/d10709254061e9e4416d2cb78b5cac1ec0d7ffa5))
+ **Breaking change:** make maxLoops in seed.get_key optional. [Example use in tests](https://github.com/ripple/ripple-lib/blob/23e473b6886c457781949c825b3ff48b3984e51f/test/seed-test.js) ([23e473b](https://github.com/ripple/ripple-lib/commit/23e473b6886c457781949c825b3ff48b3984e51f))
+ Shrinkwrap packages for dependency locking ([2dcd5f9](2dcd5f94fbc71200eb08a5044c76ef94f7971913))
+ Fix: Amount.to_human() precision bugs ([4be209e](https://github.com/ripple/ripple-lib/commit/4be209e286b5b209bec7bcd1212098985e15ff2f) and [7708c64](https://github.com/ripple/ripple-lib/commit/7708c64576e70ce3ac190442daceb30e4446aab7))
+ Fix: change handling of requestLedger options ([57b7030](https://github.com/ripple/ripple-lib/commit/57b70300f5f0c7534ede118ddbb5d8762668a4f8))
##0.8.2
+ Currency: Allow mixed letters and numbers in currencies
+ Deprecate account_tx map/reduce/filterg
+ Fix: correct requestLedger arguments
+ Fix: missing subscription on error events for some server methods
+ Fix several stability issues, see merged PR's for details
+ Fix bug in Amount.to_human_full()
+ Fix undefined fee states when connecting to a rippled that is syncing
##0.8.0
+ Orderbook: Added tracking of offer funds for determining when offers are not funded
+ Orderbook: Added tests
+ Orderbook: Update owner funds
+ Transactions: If transaction errs with `tefALREADY`, wait until all possible submissions err with the same before emitting `error`. Fixes a client "Transaction malformed" bug.
+ Transactions: Track submissions, don't bother submitting to unconnected servers
@@ -14,6 +338,11 @@
+ Server: Acquire host information from server without additional request
+ Amount: Add a constant for the maximum canonical value that can be expressed as a Ripple value
+ Amount: Make Constants static fields on the class, instead of a seperate export
##0.7.39
+ Improvements to multi-server support. Fixed an issue where a server's score was not reset and connections would keep dropping after being connected for a significant amount of time.
Then use the minified `build/ripple-*-min.js` in your webpage
##Quickstart
`Remote` ([remote.js](https://github.com/ripple/ripple-lib/blob/develop/src/js/ripple/remote.js)) is the module responsible for managing connections to `rippled` servers:
```js
/* Loading ripple-lib with Node.js */
varRemote=require('ripple-lib').Remote;
/* Loading ripple-lib in a webpage */
// var Remote = ripple.Remote;
varremote=newRemote({
// see the API Reference for available options
trusted:true,
local_signing:true,
local_fee:true,
fee_cushion:1.5,
servers:[
{
host:'s1.ripple.com'
,port:443
,secure:true
}
]
});
remote.connect(function(){
/* remote connected */
// see the API Reference for available functions
});
```
See [The `ripple-lib` Guides](docs/GUIDES.md) and [The `ripple-lib` API Reference](docs/REFERENCE.md) for walkthroughs and details about all of the available functions and options.
Then see the sample code in `docs/samples`.
##Running tests
1. Clone the repository
2.`cd` into the repository and install dependencies with `npm install`
3.`npm test` or `npm test --coverage` (`istanbul` will create coverage reports in coverage/lcov-report/`)
3.`npm test` or `make test` or `node_modules\.bin\mocha test\*-test.js`
##More Information
**Generating code coverage**
ripple-lib uses `istanbul` to generate code coverage. To create a code coverage report, run `npm test --coverage`. The report will be created in `coverage/lcov-report/`.
2. Load the `ripple-lib` module into a Node.js file or webpage:
```js
/* Loading ripple-lib with Node.js */
var Remote = require('ripple-lib').Remote;
/* Loading ripple-lib in a webpage */
// var Remote = ripple.Remote;
```
3. Create a new `Remote` and connect to the network:
```js
var remote = new Remote({options});
remote.connect(function() {
/* remote connected, use some remote functions here */
});
```
__NOTE:__ See the API Reference for available [`Remote` options](REFERENCE.md#1-remote-options)
4. You're connected! Read on to see what to do now.
##2. Using `Remote` functions and `Request` objects
All `Remote` functions return a `Request` object.
A `Request` is an `EventEmitter` so you can listen for success or failure events -- or, instead, you can provide a callback to the `Remote` function.
Here is an example, using `request_server_info()`, of how `Remote` functions can be used with event listeners (the first code block) or with a callback (the second block):
+ Using a `Remote` function with `Request` event listeners:
```js
var request = remote.request_server_info();
request.on('success', function(res) {
//handle success
});
request.on('error', function(err) {
//handle error
});
request.request(); // this triggers the request if it has not already been sent to the server
```
+ Using a `Remote` function with a callback:
```js
remote.request_server_info(function(err, res) {
if (err) {
//handle error
} else {
//handle success
}
});
```
__NOTE:__ See the API Reference for available [`Remote` functions](REFERENCE.md#2-remote-functions)
##3. Submitting a payment to the network
Submitting a payment transaction to the Ripple network involves connecting to a `Remote`, creating a transaction, signing it with the user's secret, and submitting it to the `rippled` server. Note that the `Amount` module is used to convert human-readable amounts like '1XRP' or '10.50USD' to the type of Amount object used by the Ripple network.
```js
/* Loading ripple-lib Remote and Amount modules in Node.js */
var Remote = require('ripple-lib').Remote;
var Amount = require('ripple-lib').Amount;
/* Loading ripple-lib Remote and Amount modules in a webpage */
// var Remote = ripple.Remote;
// var Amount = ripple.Amount;
var MY_ADDRESS = 'rrrMyAddress';
var MY_SECRET = 'secret';
var RECIPIENT = 'rrrRecipient';
var AMOUNT = Amount.from_human('1XRP');
var remote = new Remote({ /* Remote options */ });
remote.connect(function() {
remote.set_secret(MY_ADDRESS, MY_SECRET);
var transaction = remote.transaction();
transaction.payment({
from: MY_ADDRESS,
to: RECIPIENT,
amount: AMOUNT
});
transaction.submit(function(err, res) {
/* handle submission errors / success */
});
});
```
###A note on transaction fees
A full description of network transaction fees can be found on the [Ripple Wiki](https://ripple.com/wiki/Transaction_Fee).
In short, transaction fees are very small amounts (on the order of ~10) of [XRP drops](https://ripple.com/wiki/Ripple_credits#Notes_on_drops) spent and destroyed with every transaction. They are largely used to account for network load and prevent spam. With `ripple-lib`, transaction fees are calculated locally by default and the fee you are willing to pay is submitted along with your transaction.
Since the fee required for a transaction may change between the time when the original fee was calculated and the time when the transaction is submitted, it is wise to use the [`fee_cushion`](REFERENCE.md#1-remote-options) to ensure that the transaction will go through. For example, suppose the original fee calculated for a transaction was 10 XRP drops but at the instant the transaction is submitted the server is experiencing a higher load and it has raised its minimum fee to 12 XRP drops. Without a `fee_cusion`, this transaction would not be processed by the server, but with a `fee_cusion` of, say, 1.5 it would be processed and you would just pay the 2 extra XRP drops.
The [`max_fee`](REFERENCE.md#1-remote-options) option can be used to avoid submitting a transaction to a server that is charging unreasonably high fees.
##4. Submitting a trade offer to the network
Submitting a trade offer to the network is similar to submitting a payment transaction. Here is an example for a trade that expires in 24 hours where you are offering to sell 1 USD in exchange for 100 XRP:
```js
/* Loading ripple-lib Remote and Amount modules in Node.js */
var Remote = require('ripple-lib').Remote;
var Amount = require('ripple-lib').Amount;
/* Loading ripple-lib Remote and Amount modules in a webpage */
// var Remote = ripple.Remote;
// var Amount = ripple.Amount;
var MY_ADDRESS = 'rrrMyAddress';
var MY_SECRET = 'secret';
var BUY_AMOUNT = Amount.from_human('100XRP');
var SELL_AMOUNT = Amount.from_human('1USD');
// EXPIRATION must be a Date object, leave undefined to submit offer that won't expire
var now = new Date();
var tomorrow = new Date(now.getTime() + (24 * 60 * 60 * 1000));
var EXPIRATION = tomorrow;
var remote = new Remote({ /* Remote options */ });
remote.connect(function() {
remote.set_secret(MY_ADDRESS, MY_SECRET);
var transaction = remote.transaction();
transaction.offer_create({
from: MY_ADDRESS,
buy: BUY_AMOUNT,
sell: SELL_AMOUNT,
expiration: EXPIRATION
});
transaction.submit(function(err, res) {
/* handle submission errors / success */
});
});
```
##5. Listening to the network
In some (relatively rare) cases you may want to subscribe to the network event feed and listen for transactions and the ledger closings. [Ripple.com](http://www.ripple.com) uses this feature of `ripple-lib` to display the live feed on the top of each page and the ledger closing visualization on the [Developers page](http://ripple.com/devs).
A new `Remote` can be created with the following options:
+ `trace` Log all of the events emitted (boolean)
+ `max_listeners` Set maxListeners for remote; prevents EventEmitter warnings (number)
+ `connection_offset` Connect to remote servers on supplied interval (number in seconds)
+ `trusted` truthy, if remote is trusted (boolean)
+ `local_fee` Set whether the transaction fee range will be set locally (boolean, default is true, see [A note on transaction fees](GUIDES.md#a-note-on-transaction-fees))
+ `fee_cushion` Extra fee multiplier to account for async fee changes (number, e.g. 1.5, see [A note on transaction fees](GUIDES.md#a-note-on-transaction-fees))
+ `max_fee` Maximum acceptable transaction fee (number in [XRP drops](https://ripple.com/wiki/Ripple_credits#Notes_on_drops), see [A note on transaction fees](GUIDES.md#a-note-on-transaction-fees))
+ `servers` Array of server objects of the following form:
Returns information about the state of the server. If you are connected to multiple servers and want to select by a particular host, use `request.set_server`. Example:
Submit a transaction to the network. This command is used internally to submit transactions with a greater degree of reliability. See [Submitting a payment to the network](GUIDES.md#3-submitting-a-payment-to-the-network) for details.
Returns a [Transaction](https://github.com/ripple/ripple-lib/blob/develop/src/js/ripple/transaction.js) object
#3. Transaction events
[Transaction](https://github.com/ripple/ripple-lib/blob/develop/src/js/ripple/transaction.js) objects are EventEmitters. They may emit the following events.
+ `final` Transaction has erred or succeeded. This event indicates that the transaction has finished processing.
+ `error` Transaction has erred. This event is a final state.
+ `success` Transaction succeeded. This event is a final state.
+ `submitted` Transaction has been submitted to the network. The submission may result in a remote error or success.
+ `proposed` Transaction has been submitted *successfully* to the network. The transaction at this point is awaiting validation in a ledger.
+ `timeout` Transaction submission timed out. The transaction will be resubmitted.
+ `resubmit` Transaction is beginning resubmission.
+ `fee_adjusted` Transaction fee has been adjusted during its pending state. The transaction fee will only be adjusted if the remote is configured for local fees, which it is by default.
+ `abort` Transaction has been aborted. Transactions are only aborted by manual calls to `#abort`.
+ `missing` Four ledgers have closed without detecting validated transaction
+ `lost` Eight ledgers have closed without detecting validated transaction. Consider the transaction lost and err/finalize.
"description":"Options affecting what ledger and how much data to return.",
"properties":{
"ledgerVersion":{
"$ref":"ledgerVersion",
"description":"Get ledger data for this historical ledger version."
},
"includeAllData":{
"type":"boolean",
"description":"Include full transactions and/or state information if `includeTransactions` and/or `includeState` is set."
},
"includeTransactions":{
"type":"boolean",
"description":"Return an array of hashes for each transaction or an array of all transactions that were validated in this ledger version, depending on whether `includeAllData` is set."
},
"includeState":{
"type":"boolean",
"description":"Return an array of hashes for all state data or an array of all state data in this ledger version, depending on whether `includeAllData` is set."
"description":"The address of the account to get transactions for."
},
"options":{
"description":"Options to filter the resulting transactions.",
"properties":{
"start":{
"$ref":"hash256",
"description":"If specified, this transaction will be the first transaction in the result."
},
"limit":{
"type":"integer",
"minimum":1,
"description":"If specified, return at most this many transactions."
},
"minLedgerVersion":{
"$ref":"ledgerVersion",
"description":"Return only transactions in this ledger verion or higher."
},
"maxLedgerVersion":{
"$ref":"ledgerVersion",
"description":"Return only transactions in this ledger version or lower."
},
"earliestFirst":{
"type":"boolean",
"description":"If true, sort transactions so that the earliest ones come first. By default, the newest transactions will come first."
},
"excludeFailures":{
"type":"boolean",
"description":"If true, the result will omit transactions that did not succeed."
},
"initiated":{
"type":"boolean",
"description":"If true, return only transactions initiated by the account specified by `address`. If false, return only transactions not initiated by the account specified by `address`."
},
"counterparty":{
"$ref":"address",
"description":"If provided, only return transactions with this account as a counterparty to the transaction."
},
"types":{
"type":"array",
"items":{"$ref":"transactionType"},
"description":"Only return transactions of the specified [Transaction Types](#transaction-types)."
},
"binary":{
"type":"boolean",
"description":"If true, the transactions will be sent from the server in a condensed binary format rather than JSON."
"description":"An exact amount to deliver to the recipient. If the counterparty is not specified, amounts with any counterparty may be used. (This field is exclusive with destination.minAmount)."
"description":"Conventionally, a unique relation (according to [RFC 5988](http://tools.ietf.org/html/rfc5988#section-4)) that defines the format of this memo. Only characters allowed in URLs are permitted."
"description":"Conventionally containing information on how the memo is encoded, for example as a [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml). Only characters allowed in URLs are permitted."
},
"data":{
"type":"string",
"description":"Arbitrary string, conventionally containing the content of the memo."
"description":"An exact amount to send. If the counterparty is not specified, amounts with any counterparty may be used. (This field is exclusive with source.maxAmount)"
"description":"The next (smallest unused) sequence number for this account."
},
"xrpBalance":{
"$ref":"value",
"description":"The XRP balance owned by the account."
},
"ownerCount":{
"type":"integer",
"minimum":0,
"description":"Number of other ledger entries (specifically, trust lines and offers) attributed to this account. This is used to calculate the total reserve required to use the account."
},
"previousInitiatedTransactionID":{
"$ref":"hash256",
"description":"Hash value representing the most recent transaction that was initiated by this account."
},
"previousAffectingTransactionID":{
"$ref":"hash256",
"description":"Hash value representing the most recent transaction that affected this account node directly. **Note:** This does not include changes to the account’s trust lines and offers."
},
"previousAffectingTransactionLedgerVersion":{
"$ref":"ledgerVersion",
"description":"The ledger version that the transaction identified by the `previousAffectingTransactionID` was validated in."
"description":"Amounts issued to the hotwallet accounts from the request. The keys are hot wallet addresses and the values are arrays of currency amounts they hold. The issuer (omitted from the currency amounts) is the account from the request."
},
"assets":{
"type":"array",
"items":{"$ref":"amount"},
"description":"Total amounts held that are issued by others. For the recommended gateway configuration, there should be none."
},
"obligations":{
"type":"array",
"items":{
"type":"object",
"required":["currency","value"],
"additionalProperties":false,
"properties":{
"currency":{"$ref":"currency"},
"value":{"$ref":"value"}
},
"description":"An amount that is owed."
},
"description":"Total amounts issued to accounts that are not hot wallets, as a map of currencies to the total value issued."
"description":"Hash of all state information in this ledger."
},
"closeTime":{
"type":"string",
"format":"date-time",
"description":"The time at which this ledger was closed."
},
"closeTimeResolution":{
"type":"integer",
"minimum":1,
"description":"Approximate number of seconds between closing one ledger version and closing the next one."
},
"closeFlags":{
"type":"integer",
"minimum":0,
"description":"A bit-map of flags relating to the closing of this ledger. Currently, the ledger has only one flag defined for `closeFlags`: **sLCF_NoConsensusTime** (value 1). If this flag is enabled, it means that validators were in conflict regarding the correct close time for the ledger, but built otherwise the same ledger, so they declared consensus while \"agreeing to disagree\" on the close time. In this case, the consensus ledger contains a `closeTime` value that is 1 second after that of the previous ledger. (In this case, there is no official close time, but the actual real-world close time is probably 3-6 seconds later than the specified `closeTime`.)"
},
"ledgerHash":{
"$ref":"hash256",
"description":"Unique identifying hash of the entire ledger."
},
"ledgerVersion":{
"$ref":"ledgerVersion",
"description":"The ledger version of this ledger."
},
"parentLedgerHash":{
"$ref":"hash256",
"description":"Unique identifying hash of the ledger that came immediately before this one."
},
"parentCloseTime":{
"type":"string",
"format":"date-time",
"description":"The time at which the previous ledger was closed."
},
"totalDrops":{
"$ref":"value",
"description":"Total number of drops (1/1,000,000th of an XRP) in the network, as a quoted integer. (This decreases as transaction fees cause XRP to be destroyed.)"
},
"transactionHash":{
"$ref":"hash256",
"description":"Hash of the transaction information included in this ledger."
},
"transactions":{
"description":"Array of all transactions that were validated in this ledger. Transactions are represented in the same format as the return value of [getTransaction](#gettransaction).",
"type":"array",
"items":{
"$ref":"getTransaction",
"description":"A transaction in the same format as the return value of [getTransaction](#gettransaction)."
}
},
"rawTransactions":{
"type":"string",
"description":"A JSON string containing rippled format transaction JSON for all transactions that were validated in this ledger."
},
"transactionHashes":{
"description":"An array of hashes of all transactions that were validated in this ledger.",
"type":"array",
"items":{
"$ref":"id"
}
},
"rawState":{
"type":"string",
"description":"A JSON string containing all state data for this ledger in rippled JSON format."
},
"stateHashes":{
"description":"An array of hashes of all state data in this ledger.",
"description":"The version number of the running rippled version."
},
"completeLedgers":{
"type":"string",
"pattern":"[0-9,-]+",
"description":"Range expression indicating the sequence numbers of the ledger versions the local rippled has in its database. It is possible to be a disjoint sequence, e.g. “2500-5000,32570-7695432”."
},
"hostID":{
"type":"string",
"description":"On an admin request, returns the hostname of the server running the rippled instance; otherwise, returns a unique four letter word."
},
"ioLatencyMs":{
"type":"number",
"description":"Amount of time spent waiting for I/O operations to be performed, in milliseconds. If this number is not very, very low, then the rippled server is probably having serious load issues."
},
"load":{
"type":"object",
"description":"*(Admin only)* Detailed information about the current load state of the server.",
"properties":{
"jobTypes":{
"type":"array",
"description":"*(Admin only)* Information about the rate of different types of jobs being performed by the server and how much time it spends on each.",
"items":{"type":"object"}
},
"threads":{
"type":"number",
"description":"*(Admin only)* The number of threads in the server’s main job pool, performing various Ripple Network operations."
}
},
"required":["jobTypes","threads"]
},
"lastClose":{
"type":"object",
"description":"Information about the last time the server closed a ledger.",
"properties":{
"convergeTimeS":{
"type":"number",
"description":"The time it took to reach a consensus for the last ledger closing, in seconds."
},
"proposers":{
"type":"integer",
"minimum":0,
"description":"Number of trusted validators participating in the ledger closing."}
},
"required":["convergeTimeS","proposers"]
},
"loadFactor":{
"type":"number",
"description":"The load factor the server is currently enforcing, as a multiplier on the base transaction fee. The load factor is determined by the highest of the individual server’s load factor, cluster’s load factor, and the overall network’s load factor."
},
"peers":{
"type":"integer",
"minimum":0,
"description":"How many other rippled servers the node is currently connected to."
},
"pubkeyNode":{
"type":"string",
"description":"Public key used to verify this node for internal communications; this key is automatically generated by the server the first time it starts up. (If deleted, the node can just create a new pair of keys.)"
},
"pubkeyValidator":{
"type":"string",
"description":"*(Admin only)* Public key used by this node to sign ledger validations."
},
"serverState":{
"type":"string",
"description":"A string indicating to what extent the server is participating in the network. See [Possible Server States](https://ripple.com/build/rippled-apis/#possible-server-states) for more details.",
"description":"Minimum number of trusted validations required in order to validate a ledger version. Some circumstances may cause the server to require more validations."
"description":"Indicates that the account has used its free SetRegularKey transaction."
},
"requireDestinationTag":{
"type":"boolean",
"description":"Requires incoming payments to specify a destination tag."
},
"requireAuthorization":{
"type":"boolean",
"description":"If set, this account must individually approve other users in order for those users to hold this account’s issuances."
},
"disallowIncomingXRP":{
"type":"boolean",
"description":"Indicates that client applications should not send XRP to this account. Not enforced by rippled."
},
"disableMasterKey":{
"type":"boolean",
"description":"Disallows use of the master key to sign transactions for this account."
},
"enableTransactionIDTracking":{
"type":"boolean",
"description":"Track the ID of this account’s most recent transaction."
},
"noFreeze":{
"type":"boolean",
"description":"Permanently give up the ability to freeze individual trust lines. This flag can never be disabled after being enabled."
},
"globalFreeze":{
"type":"boolean",
"description":"Freeze all assets issued by this account."
},
"defaultRipple":{
"type":"boolean",
"description":"Enable [rippling](https://ripple.com/knowledge_center/understanding-the-noripple-flag/) on this account’s trust lines by default. (New in [rippled 0.27.3](https://github.com/ripple/rippled/releases/tag/0.27.3))"
},
"emailHash":{
"description":"Hash of an email address to be used for generating an avatar image. Conventionally, clients use Gravatar to display this image. Use `null` to clear.",
"oneOf":[
{"type":"null"},
{"$ref":"hash128"}
]
},
"messageKey":{
"type":"string",
"description":"Public key for sending encrypted messages to this account. Conventionally, it should be a secp256k1 key, the same encryption that is used by the rest of Ripple."
},
"domain":{
"type":"string",
"description":" The domain that owns this account, as a hexadecimal string representing the ASCII for the domain in lowercase."
},
"transferRate":{
"description":" The fee to charge when users transfer this account’s issuances, represented as billionths of a unit. Use `null` to set no fee.",
"description":"The public key of a new keypair, to use as the regular key to this account, as a base-58-encoded string in the same format as an account address. Use `null` to remove the regular key."
}
},
"additionalProperties":false
}
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.