-
Notifications
You must be signed in to change notification settings - Fork 517
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Chris Clark
committed
Nov 19, 2015
1 parent
f534baf
commit 25d1ac0
Showing
5 changed files
with
165 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# API Events | ||
|
||
## ledgerClosed | ||
|
||
This event is emitted whenever a new ledger version is validated on the connected server. | ||
|
||
### Return Value | ||
|
||
<%- renderSchema('output/ledger-closed.json') %> | ||
|
||
### Example | ||
|
||
```javascript | ||
api.on('ledgerClosed', ledger => { | ||
console.log(JSON.stringify(ledger, null, 2)); | ||
}); | ||
``` | ||
|
||
<%- renderFixture('responses/ledger-closed.json') %> | ||
|
||
## error | ||
|
||
This event is emitted when there is an error on the connection to the server. | ||
|
||
### Return Value | ||
|
||
The first parameter is a string indicating the error type, which may be `badMessage` (meaning that rippled returned a malformed message), or one of the [rippled Universal Errors](https://ripple.com/build/rippled-apis/#universal-errors). The second parameter is a message explaining the error, or the message that caused the error in the case of `badMessage`. | ||
|
||
### Example | ||
|
||
```javascript | ||
api.on('error', (errorCode, errorMessage) => { | ||
console.log(errorCode + ': ' + errorMessage); | ||
}); | ||
``` | ||
|
||
``` | ||
tooBusy: The server is too busy to help you now. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters