Compare commits

...

1528 Commits

Author SHA1 Message Date
Elliot Lee
ebb64ba177 v1.3.2 2019-09-03 16:43:31 -07:00
Elliot Lee
1a685e2b68 Fix #1032 (#1033)
* Update ripple-address-codec@latest

* Export and document rippleTimeToISO8601
2019-09-03 16:38:56 -07:00
Rome Reginelli
9c561885a1 Docs: update recommended Node ver. (#1031) 2019-08-29 20:34:25 -07:00
Elliot Lee
612e98b198 Release 1.3.1 2019-08-26 13:58:09 -07:00
Elliot Lee
0a41d5ccf1 Upgrade to gulp 4; remove http server (#1030)
* Update gulp version to ^4.0.2 and Gulpfile.js

* Remove http server
2019-08-26 13:50:36 -07:00
Elliot Lee
ba8fe1f32c Update HISTORY - rippled 1.3.1 2019-08-16 21:28:32 -07:00
Elliot Lee
0f840876a5 Update HISTORY 2019-08-16 21:11:02 -07:00
Elliot Lee
ac3900b6f4 Release 1.2.5 and 1.3.0 2019-08-16 21:09:08 -07:00
Elliot Lee
5e138b9937 Sign method - verify accurate encoding (#1026)
* Decode signed transactions and check field integrity

* Add tests (including signing a tx without Flags)

* Update tests to output more descriptive errors on failure

* Update ripple-binary-codec to 0.2.2
2019-08-16 16:22:25 -07:00
Elliot Lee
82d50cd903 Document setCanonicalFlag and export from src/transaction/utils 2019-08-09 10:16:33 -07:00
Elliot Lee
c5b1d4daac Update lodash to ^4.14.136, fix docs typo, update HISTORY.md 2019-08-07 12:20:56 -07:00
Namrata
b4a30d49d8 Support removing a signer list (#1021)
* Make weights an optional field
* Fix #971
2019-07-30 16:48:30 -07:00
Elliot Lee
229360d1b9 README - Update link 2019-07-18 21:50:58 -07:00
Rome Reginelli
d627d362af Merge pull request #1023 from mDuo13/doc_cleanup
Phrasing cleanup in schema descriptions
2019-07-16 15:11:01 -07:00
mDuo13
7ca7a07942 Phrasing cleanup in schema descriptions
- Change 'Ripple address'→'XRP Ledger address'
- Change 'is exclusive with'→'cannot be used with'
2019-07-15 14:26:43 -07:00
dependabot[bot]
09f81fa3cd Bump lodash from 4.17.11 to 4.17.13
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.11 to 4.17.13.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.11...4.17.13)

Signed-off-by: dependabot[bot] <support@github.com>
2019-07-13 13:26:48 -07:00
The XRP Scan Project
b03bf9c7f1 Updated APPLICATIONS.md and added xrpscan
Added xrpscan.com under Data and Visualization section.
2019-06-24 02:03:21 -07:00
Elliot Lee
4d696369fe APIOptions: extend ConnectionOptions (#1018)
Fix #1017
2019-06-21 01:45:47 -07:00
Elliot Lee
bcb80ea5f5 Fix getServerInfo (#1012)
* Return array for serverInfo.load.jobTypes

* Include start/end in invalid range assertion error
2019-06-14 14:57:36 -07:00
Elliot Lee
1be2ee5875 Docs: fix #574 (#1011)
destination.address
2019-06-14 14:57:14 -07:00
Elliot Lee
3554e807df Release 1.2.4 2019-06-06 16:01:24 -07:00
Elliot Lee
5ffbd6e86d Update dependencies (#1007)
* Update dependencies: @types/lodash@4.14.133, mocha-junit-reporter@1.22.0, tslint@5.17.0, nyc

Fix type errors
2019-06-06 15:56:29 -07:00
Elliot Lee
e2572c61cf Add details about transaction fees, master keys, and multi-signing 2019-06-05 00:27:25 -07:00
Elliot Lee
7df2b74d43 Update get-server-info.json 2019-05-27 14:37:38 -07:00
Elliot Lee
f51a69f080 Fix typo 2019-05-22 10:04:43 -07:00
Elliot Lee
c0a2d9fc2b Update README.md 2019-05-16 22:51:22 -07:00
Elliot Lee
51dad19f88 Release 1.2.3 2019-04-30 15:01:54 -07:00
Elliot Lee
3d1a530796 Fix browser builds (#1006)
tsconfig:
- Must set composite: false
- Must set declarationMap: false in order to use declaration: false

json-loader:
- Not needed with webpack >= v2.0.0 and in fact does not work

https-proxy-agent cannot be used in the browser
2019-04-29 23:19:05 -07:00
Elliot Lee
f6a22d2121 No working browser version for 1.2.2
Using `"noEmitOnError": true` in `tsconfig.json` prevents the browser build from being created
2019-04-18 00:53:28 -07:00
Elliot Lee
6f2d448059 Release 1.2.2 2019-04-15 12:30:20 -07:00
Elliot Lee
0d5103a3f3 Use TypeScript project reference (#1002)
* Add *.tsbuildinfo to .gitignore

* Bump versions of dependencies, nyc and yargs

* Drop support for node 9 (EOL 2018-06-30)

https://github.com/nodejs/Release

* Add getTransaction snippet
2019-04-15 11:06:31 -07:00
Elliot Lee
4da80028bf Prevent prepareTransaction from overwriting values in txJSON (#1000)
Fix #997
2019-04-13 11:33:16 -07:00
Daniel Chan
bb40dbde9d Add deliveredAmount as optional field for type Outcome (#996) 2019-04-11 17:13:42 -07:00
Elliot Lee
50fc36ec3e Add "strict": true to tsconfig.json (#994)
- Remove process.browser
2019-04-11 15:48:23 -07:00
Elliot Lee
1abcef73a0 Merge pull request #993 from adrianhopebailie/patch-1
fix: build fails with strict checks
2019-04-08 13:04:27 -07:00
Adrian Hope-Bailie
0d7879b25c fix: build fails with strict checks 2019-03-29 11:48:13 +02:00
Elliot Lee
8278dc5b5b Release 1.2.1 2019-03-23 15:50:26 -07:00
Elliot Lee
c90d486454 Update ripple-binary-codec to 0.2.1 to support tecKILLED 2019-03-23 15:12:22 -07:00
Elliot Lee
35f9b7ec8d Release 1.2.0 2019-03-19 01:28:42 -07:00
Elliot Lee
69e621af86 Remove coveralls from devDependencies 2019-03-19 01:21:36 -07:00
Elliot Lee
0e92e696d4 Remove unused http-server from devDependencies 2019-03-18 16:51:08 -07:00
Elliot Lee
0b1445bfe9 Remove sauce runner 2019-03-18 16:14:21 -07:00
Elliot Lee
db2d7ba1f5 Update mocha to 6.0.2 2019-03-18 16:09:26 -07:00
Elliot Lee
d82703f41b prepareTransaction should not overwrite Sequence (#990)
* Cleans up some code and fixes some type errors

* Clarify how null settings work

* Document updated RippledError

* Updates per review by @mDuo13
2019-03-18 15:55:42 -07:00
Elliot Lee
8213861ab7 Update HISTORY.md 2019-03-13 14:34:31 -07:00
Kincaid O'Neil
a842c380cf fix: add amount to FormattedPaymentChannel type (#989)
* fix: add amount to FormattedPaymentChannel type

* fix: ignore package-lock.json
2019-03-12 16:58:30 -07:00
Elliot Lee
5bf6f1849a Fix typos in docs 2019-03-12 15:27:19 -07:00
Elliot Lee
bfe4877f73 Merge remote-tracking branch 'origin/master' into develop 2019-03-12 15:12:58 -07:00
Elliot Lee
63dcddf6f4 [Docs] Update transaction responses link
List of transaction responses
2019-03-11 12:14:41 -07:00
Rome Reginelli
68735ddb35 Docs: Fix prepareTransaction method specification (#986) 2019-02-11 23:39:41 -08:00
Elliot Lee
1fd9ca7ef2 Use Buffer.from and clean up a few things (#985) 2019-02-07 00:29:59 -08:00
Elliot Lee
2445004333 Change prepare* methods to reject Promise on error (#984)
* Reject Promise on error, update docs, and add tests:
  * preparePayment
  * prepareTrustline
  * prepareOrder
  * prepareOrderCancellation
  * prepareSettings
  * prepareEscrowCreation
  * prepareEscrowExecution
  * prepareCheckCreate
  * prepareCheckCash
  * prepareCheckCancel
  * preparePaymentChannelCreate
  * preparePaymentChannelFund
  * preparePaymentChannelClaim

Note that we can't update mocha to ^5.2.0 because it causes testing to hang indefinitely; this needs to be investigated.
2019-01-29 15:22:18 -08:00
Elliot Lee
dc148bf954 Update HISTORY.md 2018-12-12 17:38:34 -08:00
Elliot Lee
f3c34bd75a Release 1.1.2 2018-12-12 14:55:15 -08:00
Alexandru Chiriac
5419e67dbc GetLedger by hash option (#980)
* update ledger input schema
* include ledgerHash option
2018-12-12 11:02:50 -08:00
Alexandru Chiriac
8d37da0952 Update Submit Response (#978)
* update submit output schema
* update submit response object
2018-12-04 15:35:07 -08:00
Elliot Lee
a8075d98df Add list of applications using ripple-lib (#976) 2018-11-29 16:39:48 -08:00
Elliot Lee
fcc205b85a Release 1.1.1 2018-11-27 15:17:42 -08:00
Elliot Lee
0f5056221f Fix getOrderbook (#970)
* Fix `getOrderbook` (Fix #766)
* Add `formatBidsAndAsks` as a recommended alternative to `getOrderbook`
* Add `renameCounterpartyToIssuer`
2018-11-26 15:25:15 -08:00
Elliot Lee
8384ace746 Add return type for generateAddress (#968)
For TypeScript apps
2018-11-20 15:35:34 -08:00
Elliot Lee
040cabece0 Add comments for accountRootFlags (#962) 2018-11-16 22:34:41 -08:00
Elliot Lee
319a8d6ab2 Fix book-offers test fixture by swapping bids/asks (#966) 2018-10-31 22:48:27 -07:00
Elliot Lee
50a7320886 Release 1.1.0 2018-10-31 16:36:20 -07:00
Elliot Lee
418987476e Add DepositPreauth (#958)
* Expose parseAccountFlags() and add docs
* Add example snippet
* Default to node v10 for nvm
* Maintain existing behavior for getSettings
* Increase max line length from 80 to 120 (ter-max-len)
2018-10-31 16:27:32 -07:00
Elliot Lee
89e4ff328c Apply formatting to book-offers fixture 2018-10-31 16:07:25 -07:00
Elliot Lee
04bf49cb43 Support node 10 (#964)
* Update webpack from 3.11.0 to 3.12.0 and upath from 1.0.4 to 1.1.0
* Run: yarn upgrade gulp
  * See https://github.com/gulpjs/gulp/issues/2162
* Update README
* Travis: test node 10
2018-10-30 14:15:42 -07:00
Elliot Lee
1c017df2a3 Merge pull request #955 from jcperkins12/feature/balanceChanges-TypeCorrection
Type balanceChanges should be array of changes not array with one change
2018-10-24 20:34:03 -07:00
Elliot Lee
5fed1f08e4 Document xrpToDrops, dropsToXrp, iso8601ToRippleTime, schemaValidator, and more
The following methods are available directly under the RippleAPI object,
not under schemaValidator:

isValidAddress, isValidSecret, deriveKeypair, deriveAddress
2018-10-18 01:16:50 -07:00
Elliot Lee
82c349c8c4 HISTORY: List Check transaction types
Transaction types that were added in 0.19.0
2018-10-17 16:22:48 -07:00
Elliot Lee
0f7af6a4e9 Add depositAuth to FormattedSettings type 2018-10-17 15:58:52 -07:00
Elliot Lee
8db1791ed2 README: Remove obsolete badges 2018-10-16 12:48:48 -07:00
Elliot Lee
a29ec1b8c7 Release 1.0.2 2018-10-16 12:28:24 -07:00
Elliot Lee
232a760a58 yarn: Add integrity hashes to yarn.lock
Added in yarn v1.10.0, see https://github.com/yarnpkg/yarn/pull/5042
2018-10-16 12:24:15 -07:00
Elliot Lee
f4ad04d334 Exclude SendMax from XRP to XRP payments (#957)
Fix #954
2018-10-16 12:21:29 -07:00
Cory Perkins
8dfec20871 Changed type of balanceChanges made to an account from an array of one change to an array of 1 change to and array of records with the type of a blanceChange 2018-10-10 12:21:16 -05:00
Cory Perkins
64745017e9 book_offers returns offers type OfferLedgerEntry (#951)
* rippled-api function book_offers returns offers in the format of OfferLedgerEntry not OfferCreateTransaction
* updated type of account_objects
2018-10-02 02:14:17 -07:00
Elliot Lee
37edede728 Use object instead of Object (#936) 2018-10-02 02:13:28 -07:00
Elliot Lee
f785605db8 Release 1.0.1 2018-09-27 19:01:38 -07:00
Elliot Lee
01ad30ab07 Fix typos in ledger_entries.ts 2018-09-19 14:24:02 -07:00
Cory Perkins
e08d507462 Add remaining LedgerEntry types (#943)
* Replaced the union with 'any' in the LedgerEntry type
* Added DepositPreauthLedgerEntry (new in rippled 1.1.0)
2018-09-19 14:21:52 -07:00
wudanjs
4c23bd5ad3 Include memos when parsing trustlines (#949) 2018-09-19 14:17:38 -07:00
Scott M Sunarto
b15abd5376 Update server regex to accommodate UDS (#944) 2018-09-18 11:47:46 -07:00
Elliot Lee
79971f906b Update release notes 2018-09-11 18:45:52 -07:00
Elliot Lee
9eec98778f Expose validation methods (#932)
Merge branch 'movitto-expose_validation_methods' into develop
2018-09-11 18:33:55 -07:00
Elliot Lee
dcd0e14142 Add test of deriveKeypair with ed25519 secret 2018-09-11 18:33:07 -07:00
Elliot Lee
cfcbc9aab7 Update checksums for 1.0.0 2018-09-10 14:52:14 -07:00
Mo Morsi
a80de5658a Move deriveKeypair and deriveAddress to offline module 2018-09-09 09:39:25 -04:00
Mo Morsi
34215eb309 Add docs for newly exposed API methods 2018-09-09 09:39:25 -04:00
Mo Morsi
9458005d7f Add tests for newly exposed API methods 2018-09-09 09:39:25 -04:00
Mo Morsi
5f36df0172 Expose deriveKeypair, deriveAddress, isValidAddress, and isValidSecret to the public API 2018-09-09 09:39:25 -04:00
Elliot Lee
3ff4929a49 Fix PendingLedgerVersionError message and export FormattedTransactionType (#941) 2018-09-04 18:31:24 -07:00
Elliot Lee
4bea69d647 Release 1.0.0 2018-08-30 14:30:57 -07:00
Elliot Lee
09541dae86 docs: rippled APIs use issuer 2018-08-30 14:12:45 -07:00
Elliot Lee
bcbcc53c87 No `--coverage' option anymore with nyc
See https://github.com/istanbuljs/nyc
2018-08-30 13:41:52 -07:00
Elliot Lee
76f120bec9 Merge branch 'getLedger-includeRawTransaction-2' into develop 2018-08-30 13:30:18 -07:00
Elliot Lee
f8bf28876d if statements must be braced 2018-08-30 13:29:50 -07:00
wilsonianb
b03795df09 Add hidden computeTreeHashes option 2018-08-30 13:29:50 -07:00
Elliot Lee
dbe20d6574 getLedger: include raw transaction with each transaction
computeLedgerHash: support new getLedger response by using
rawTransaction

BREAKING CHANGES:

* Remove the `rawTransactions` field and replace it with a new `rawTransaction` field in each transaction.
* Rename the `metaData` field (in each raw transaction) to `meta` (for consistency with rippled's `tx` method).
* Add `ledger_index` to each raw transaction.
2018-08-30 13:28:52 -07:00
Elliot Lee
0550fab73e Update escrowCreation error message and docs (#934)
Fix #933
2018-08-29 19:03:33 -07:00
Elliot Lee
3f2d9d198e computeLedgerHash - add requireRawTransactions option 2018-08-28 17:31:12 -07:00
Elliot Lee
b9c953fce6 Fix getPaths (#930)
* getPaths:
  * Filter paths correctly
  * Use correct value when XRP is the destination currency
2018-08-23 17:37:02 -07:00
Elliot Lee
181cfd69de Prevent 'amount' from being misinterpreted (#924)
The 'amount' field should almost never be used.
With partial payments, the field can show an amount that is
significantly less than the amount that the transaction actually
delivered. This change sets amount to 0 XRP when it may be misleading.

This change omits the `amount` when parsing payment transactions.
See `HISTORY.md` for recommended alternatives.
2018-08-23 16:17:23 -07:00
Elliot Lee
569766b8f8 Rename json schemas (#931)
Rename files for consistency with their titles:

* Rename amount-base to amountbase
* Rename tx-hash to transaction-hash
* Rename id to transactionHash
* Rename objects/settings.json to objects/settings-plus-memos.json
* Rename ledgerversion to ledger-version
2018-08-22 14:41:41 -07:00
Elliot Lee
53a232ebdc Update docs 2018-08-14 20:05:50 -07:00
Elliot Lee
4c9a2ff538 Improve Order docs. Fix #776 2018-08-14 19:27:50 -07:00
Elliot Lee
dc623cd049 Release 1.0.0-beta.5 2018-08-11 01:38:36 -07:00
Elliot Lee
7cd517268b Fix error TS2307: Cannot find module 2018-08-11 01:35:47 -07:00
Elliot Lee
2438295e70 Release 1.0.0-beta.4 2018-08-10 14:58:19 -07:00
Elliot Lee
f5e1a4a588 Revert "Expose validation methods in public api"
This reverts commit 9e9a0a7d9b.

We should move methods like deriveKeypair and deriveAddress
off of the schemaValidator object.
2018-08-10 14:54:01 -07:00
Mo Morsi
9e9a0a7d9b Expose validation methods in public api
Updated to fix tests
2018-08-06 16:09:04 -07:00
Elliot Lee
1c68283d1e ES6: omit property value since it matches the variable name 2018-07-28 00:42:37 -07:00
Elliot Lee
28796d37cb Update TypeScript to 2.9.2 2018-07-28 00:18:58 -07:00
Elliot Lee
067bc48d4e Add prepareTransaction() (#898)
* Export iso8601ToRippleTime(), txFlags, convertStringToHex()

* Fix a bug that caused fees exceeding 999 to throw an error

e.g. '1,000' would not be recognized as a valid number.
To use 6 decimal places, toFixed should be used instead of toFormat.
2018-07-26 12:24:29 -07:00
Fred K. Schott
b94698df0b Update some API methods to use api.request() internally (#896)
* use any instead of object
2018-07-26 12:23:07 -07:00
Elliot Lee
4f40b5cb6d Update README.md - How to build ripple-lib (#837) 2018-07-25 12:09:55 -07:00
Elliot Lee
14704eee6b Add more tests of getFee (#897) 2018-07-25 01:53:27 -07:00
Elliot Lee
860f6a6cd8 Release 1.0.0-beta.3 2018-07-17 22:39:00 -07:00
Elliot Lee
7a928804ec feat: add payment channel details to tx (2) (#920)
* Bump transactionparser to v0.7.1 and update output schema
* yarn docgen for required `threshold` and `weights`
2018-07-17 22:22:07 -07:00
adrianhopebailie
14444bea3f feat: add payment channel details to tx 2018-07-17 22:20:47 -07:00
Rome Reginelli
47a139fdff Fix text/plain MIMETYPE in examples with memos (#914) 2018-07-03 17:18:46 -07:00
Brandon Wilson
4e30b9b2fa Require threshold and weights in signers settings (#909)
Fixes #908
2018-07-02 16:27:03 -07:00
Elliot Lee
2112d4c0b3 Round XRP fee to 6 decimal places (#912)
* Round XRP fee to 6 decimal places

Fix #911
2018-06-28 17:59:00 -07:00
Elliot Lee
1d1132b7fa Release 1.0.0-beta.2 2018-06-08 08:11:00 -07:00
Elliot Lee
e07fa11923 Maximum fee values (#902)
* Add maxFeeXRP (default 2 XRP) as an optional RippleAPI constructor parameter
  - No calculated or specified fee can exceed this value
  - If the fee exceeds 2 XRP, throw a ValidationError
* sign() - throw ValidationError when Fee exceeds maxFeeXRP
* Document getFee parameters
* Explain new fee limits in HISTORY.md
* Deprecate `maxFee`
2018-06-07 23:29:24 -07:00
Elliot Lee
7c92adbf45 Release 1.0.0-beta.1 2018-05-24 20:13:26 -07:00
Elliot Lee
d55aa2339f Improve docs (raw order data) 2018-05-24 20:02:45 -07:00
Elliot Lee
95e39153da Bump node version to v8 2018-05-24 19:29:09 -07:00
Daniel Davis
65d8260908 Updated yarn command (#900)
`yarn install` deprecated in favor of `yarn add`
2018-05-23 23:05:09 -07:00
Elliot Lee
1aa9feda71 Allow specifying amounts in drops (#892)
* Accept "drops" in lieu of "XRP"
* Export xrpToDrops() and dropsToXrp()
* Throw our own validation errors instead of BigNumber Errors
2018-05-21 13:19:18 -07:00
Fred K. Schott
2e5b435b11 add server_info request typing (#895) 2018-05-17 16:37:17 -07:00
Elliot Lee
54f12862dc Improve errors (#893)
- `RippledError`: Include the full response from the `rippled` server.
- A new test ensures correct behavior when `streams` is not an array.
- `NotConnectedError` may be thrown with a different message than before.
2018-05-12 09:38:49 -07:00
Elliot Lee
226ef862ae Link to mailing lists 2018-05-10 16:25:05 -07:00
Elliot Lee
4a0d675726 Release 1.0.0-beta.0 2018-05-10 15:56:23 -07:00
Elliot Lee
b2b6715ac0 Add request(), hasNextPage(), and requestNextPage() (#887)
* Add support for all rippled APIs, including subscriptions.
* Add support for arbitrary stream message types.
* Note that rippled APIs take amounts in drops.
* request() will be available in ripple-lib version 1.0.0+
2018-05-10 15:43:56 -07:00
Elliot Lee
823d93b86c Add checksums for 0.22.0 2018-05-10 15:26:43 -07:00
Elliot Lee
7a42db99c9 Bump version to 0.22.0 2018-05-10 00:33:20 -07:00
Elliot Lee
f28ec27614 getOrderbook - return raw order data (#886)
Fix #799
2018-05-08 15:05:41 -07:00
Elliot Lee
a36e23ebfa Release 0.21.0 2018-04-11 21:33:44 -07:00
Elliot Lee
e978ef1888 Add getAccountObjects (#881)
Squashed commit of the following:

commit 361ead8cbbbe4fa25ecba614f8f11930ff679996
commit 5ff26d7d2defbbaaa7c50d6b3b5b74bf30be19ef
commit 97f5dfc86d4730082fd016197b0c025e499912e3
commit d48654098601f2a19484d9bbae7c65786e3c5dd4
commit 4790401123e7836f6bea8d03111bce60dcf95114
commit 57512f7fc000689bb8224f33173ba91221f27281
commit e75a7e95b11368b26c40e8e6e7b583d978475e95
2018-04-11 14:37:37 -07:00
Chris Yuen
9af3968508 Upgrade https-proxy-agent to version 2 (#883) 2018-04-10 12:59:24 -07:00
Elliot Lee
86ce7b707c Release 0.20.0 2018-04-09 12:03:05 -07:00
Elliot Lee
e0eb27ed8e Use jsonschema v1.2.2 and run yarn upgrade (#882)
- Fixes #880
2018-04-09 11:54:30 -07:00
amougel
2570e2a6d8 Add signWithKeypair (#769) 2018-04-03 15:33:24 -07:00
Rome Reginelli
c71540e77a Merge pull request #877 from mDuo13/add-tx-types
Improve Payment Channel documentation
2018-03-30 18:57:17 -07:00
mDuo13
8eba827d11 Improve Payment Channel documentation 2018-03-28 11:54:05 -07:00
Elliot Lee
90be539b09 Release 0.19.1 2018-03-22 14:12:22 -07:00
Fred K. Schott
43c08e5ea7 Clean up min/max adjustments (#873) 2018-03-22 12:31:44 -07:00
Fred K. Schott
3f22b12216 Add linting to travis (#872) 2018-03-20 14:30:37 -07:00
darkmemo
a72041a321 Fix Payment source & destination types (#870)
Payment `source` and `destination` are defined as intersection types, `Adjustment & MaxAdjustment` and  `Adjustment & MinAdjustment` respectively. But they should be union types instead. This problem was introduced during js to ts conversion.

Fixes #866
2018-03-20 11:26:41 -07:00
Elliot Lee
71a0c16fec Ledger object - accountState supersedes accounts (#868)
This appears to originate from a mistake in the docs.
The actual name of the field is `accountState`.

See:
9af994ceb4/src/ripple/app/ledger/impl/LedgerToJson.cpp (L167)

* Remove TODOs addressed by docs PR

https://github.com/ripple/ripple-dev-portal/pull/324
2018-03-19 14:52:18 -07:00
Elliot Lee
27ab98160a Fix link to checkCash (#871)
Fix source file for 4eaaa8188d
2018-03-19 14:41:18 -07:00
Ryan Young
4eaaa8188d Fix link to checkCash (#871)
#checkCash -- > #check-cash
2018-03-19 14:39:54 -07:00
Fred K. Schott
187154a2b0 Types cleanup + more API methods onto new request method (#857)
* major types cleanup, more formatted api methods onto new request method

- getPaymentChannel() now uses this.request()
- getSettings() now uses this.request()
- getLedger() now uses this.request()
- transaction types cleaned up a bit, but still some work left to do
2018-03-14 16:08:57 -07:00
Elliot Lee
c175e3f58e Point to types in package.json (#863) 2018-03-06 23:15:55 -08:00
Fred K. Schott
2ea22a099e Don't generate TS definitions for browser build (#864) 2018-03-06 23:15:11 -08:00
Elliot Lee
c3aa062edd Bump version to 0.19.0 and add release notes 2018-03-02 13:58:39 -08:00
Elliot Lee
0ad8c577c0 Export Check* transaction param types 2018-03-01 21:46:20 -08:00
Elliot Lee
facc513a52 Add support for Checks (#853)
- See https://github.com/ripple/rippled/pull/2245

* Add support for depositAuth flag

* Upgrade ripple-binary-codec to 0.1.13
2018-03-01 21:42:46 -08:00
Elliot Lee
df711ecb06 Import from 'server' to fix TS4029 2018-03-01 21:23:02 -08:00
Elliot Lee
144be08af0 Export types used by exported variables (#858)
Fixes TypeScript compile errors due to generating TS declaration files.

See #851
2018-03-01 17:48:28 -08:00
Fred K. Schott
c53db4844a Add .travis.yml (#859) 2018-03-01 17:32:31 -08:00
Elliot Lee
68b34f7532 Improve documentation of getTransactions params (#856)
* Improve documentation of getTransactions params

- Resolve #855
2018-02-26 17:39:06 -08:00
cryptcoin-junkey
3fe5d715a5 Generate/publish *.ts.d (#851)
For TypeScript
2018-02-24 23:52:45 -08:00
Elliot Lee
ca74cf1028 Apply automatic formatting 2018-02-23 16:50:40 -08:00
Elliot Lee
5b51ff6071 Support for the Deposit Authorization account root flag (#852)
* Add depositAuth flag tests
* Add support for depositAuth flag
2018-02-21 17:15:23 -08:00
Elliot Lee
3cad4f4aa3 Apply code formatting to API unit tests 2018-02-21 16:05:57 -08:00
Fred K. Schott
365de6d18a Add new request interface, implement first few request typings (#843)
* Add request interface & typings

- src/api: add basic implementation of request/requestAll()
- src/ledgers/account_info: refactor to simplify with request()
- src/ledgers/balances: refactor to simplify with request()
- src/ledgers/orderbook: refactor to simplify with requestAll()
- src/ledgers/orders: refactor to simplify with requestAll()
- src/ledgers/trustlines: refactor to simplify with requestAll()

* standardize on Formatted prefix
2018-02-20 11:44:36 -08:00
Elliot Lee
4a21360e37 Alphabetize properties for Settings object
- Generate docs to fix earlier typo (yarn run docgen)
2018-02-14 16:22:05 -08:00
Elliot Lee
43a3cfa010 HISTORY.md - remove broken link (404) 2018-02-14 16:00:51 -08:00
Elliot Lee
b89eae5cb1 Add test of getTrustlines with multiple pages of results (#850) 2018-02-14 15:57:35 -08:00
Elliot Lee
e311b74dac Add release notes for 0.18.2 2018-02-13 13:59:02 -08:00
Elliot Lee
e3748e070b Bump version to 0.18.2 2018-02-13 13:53:42 -08:00
Elliot Lee
0c318816cc Remove unnecessary files from npm
- `"bin/*"`, `"test/*"`, and `"Gulpfile.js"` can be removed
- See #844
2018-02-13 13:36:02 -08:00
Fred K. Schott
55e6801f4a Add build to prepublish in package.json (#849)
Continue to publish the build/ directory so that users can easily grab it from CDNs.
2018-02-12 09:47:25 -08:00
Elliot Lee
4f60fc301f Add "browser" property to package.json (#847)
* Use wswrapper shim for browserify
2018-02-11 08:52:19 -08:00
Elliot Lee
139159bf1a webpack config - include src instead of excluding node_modules 2018-02-07 14:14:35 -08:00
Elliot Lee
3ebbca0083 instructions.json - fix typo 2018-02-02 10:49:32 -08:00
Elliot Lee
51aaa75a05 Use BigNumber internally to compute fee 2018-01-30 15:29:28 -08:00
Elliot Lee
01a25f55f2 Initialize ledgerVersion to undefined 2018-01-30 14:58:59 -08:00
Fred K. Schott
94196ab268 post flow-to-ts cleanup 2018-01-29 12:11:32 -08:00
Elliot Lee
dc39343899 HISTORY.md - Add 0.18.1 2018-01-27 19:38:25 -08:00
Elliot Lee
272eabd1cd v0.18.1 2018-01-27 00:46:23 -08:00
Elliot Lee
7a653e6e63 Fix: isSameIssue() should check counterparty 2018-01-26 16:06:25 -08:00
Elliot Lee
994a6d5e76 Add SHA-256 checksums for 0.18.0 release 2018-01-25 15:36:02 -08:00
Elliot Lee
3db72716b4 HISTORY.md - Add release date for 0.18.0 2018-01-25 15:30:02 -08:00
Elliot Lee
6d39e072f8 Docs: getFee() returns a string 2018-01-23 16:13:27 -08:00
Elliot Lee
b7d636d157 Rerun docgen to update docs 2018-01-23 16:11:35 -08:00
Elliot Lee
e8ac4f3d40 Set PublicKey type to string 2018-01-23 16:08:40 -08:00
Elliot Lee
ae2ccd9887 Add SHA-256 checksums 2018-01-23 15:24:18 -08:00
Elliot Lee
4fff85096c Bump version to 0.18.0 and update HISTORY.md 2018-01-17 16:03:57 -08:00
Elliot Lee
b4d8684740 Update escrow creation response fixture
- Request fixture was changed by #820
- Add an ExecuteAfter (aka FinishAfter) timestamp
2018-01-17 15:50:34 -08:00
Fred K. Schott
d3fb4b6260 Add TypeScript linting (#827)
* add tslint, create tslint.json ruleset from .eslintrc

* remove leftover rules

* fix up meta files
2018-01-17 14:41:24 -08:00
Nicolás López Jullian
19eaedf50d Change yarn install to yarn add 2018-01-16 23:18:17 -08:00
Elliot Lee
c56e6a6c08 Update yarn.lock 2018-01-16 23:16:22 -08:00
Fred K. Schott
01ecfb0a07 update istanbul to nyc (their new cli) to get typescript coverage 2018-01-11 17:20:44 -08:00
Elliot Lee
e1630e1693 HISTORY - Add SHA checksums for 0.17.9 2017-12-29 01:52:24 -08:00
Elliot Lee
526d87c1fc Update HISTORY.md 2017-12-24 00:44:14 -08:00
Fred K. Schott
8204f6c648 Convert from Flow to Typescript (#816)
* convert to typescript
* add docs for custom node typing
* update webpack, gulpfile
2017-12-24 00:39:18 -08:00
Rome Reginelli
5979ff6197 Merge pull request #820 from mDuo13/fix-escrow-example
[Docs] Improve escrow creation example to have ExecuteAfter date
2017-12-20 12:15:24 -08:00
mDuo13
d22828b222 [Docs] Improve escrow creation example to have ExecuteAfter date 2017-12-18 10:23:54 -08:00
Fred K. Schott
7e5b9948a8 convert common.js modules to new standard esm module syntax (#815) 2017-12-04 11:21:56 -08:00
Fred K. Schott
7ece43e2e2 fix whitespace (lint errors) (#813) 2017-11-27 10:54:40 -08:00
Fred K. Schott
f90617eac4 fix flow type errors (#811) 2017-11-21 16:52:48 -08:00
Fred K. Schott
2469fb2307 Update package.json 2017-11-16 14:37:46 -08:00
Fred K. Schott
a051e6fd71 fix and update flow to get typechecker running again 2017-11-16 14:37:46 -08:00
Elliot Lee
cabe029861 Release 0.17.9 2017-11-14 13:45:55 -08:00
Elliot Lee
1ac4ad2076 Update HISTORY.md for 0.17.9 2017-11-14 13:41:53 -08:00
Fred K. Schott
44119ddf2d remove unneccessary double-polyfills from runtime 2017-11-12 23:40:29 -08:00
Fred K. Schott
567036f382 fix lint errors and configure eslintrc to automatically work /w tooling 2017-11-12 12:46:50 -08:00
Elliot Lee
27aa0247e7 yarn.lock: Update ripple-keypairs to 0.10.1 2017-11-10 15:22:54 -08:00
Elliot Lee
0fc10b302f Update ripple-keypairs to 0.10.1 (#805) 2017-11-10 15:21:57 -08:00
Elliot Lee
0bc51a869d Merge pull request #786 from ripple/escrow-execution-ValidationError
escrow-execution - Add reference to ValidationError
2017-11-10 14:57:38 -08:00
Elliot Lee
a3dff0dcf7 Update HISTORY.md 2017-11-08 22:51:53 -08:00
Elliot Lee
048fc7ce71 Merge branch 'bsclifton-develop' into develop 2017-11-08 22:49:58 -08:00
Elliot Lee
6265e81afb Update yarn.lock for ws 3.3.1 2017-11-08 22:49:01 -08:00
Brian Clifton
38ca96a938 Update ws dependency >= 3.3.1 per https://nodesecurity.io/advisories/550 2017-11-08 21:42:23 -07:00
wilsonianb
8ed5f764fa Add missing condition or fulfillment test 2017-11-06 13:49:38 -06:00
Elliot Lee
227ea82a29 escrow-execution - Add reference to ValidationError 2017-11-06 11:08:06 -08:00
Elliot Lee
0e2a5e36c6 Add 0.17.8 release date 2017-11-06 10:13:23 -08:00
Elliot Lee
332b656860 Merge pull request #802 from ripple/update-bignumber
Update bignumber.js, ripple-hashes, ripple-lib-transactionparser
2017-11-06 08:58:27 -08:00
Elliot Lee
0230b963c1 Update HISTORY.md 2017-11-06 08:54:49 -08:00
Waldir Pimenta
48e2ea9ff2 LICENSE: add title (#803) 2017-11-04 18:18:55 -07:00
Elliot Lee
b6f1394c61 Update HISTORY.md 2017-11-03 23:44:17 -07:00
Elliot Lee
560e43b1a6 Update scripts/ci.sh to use yarn 2017-11-03 23:43:33 -07:00
Elliot Lee
cc1ab7ae97 Update references of npm to yarn 2017-11-03 15:30:41 -07:00
Elliot Lee
4886561f7d Add yarn lockfile
Use yarn to ensure that we always get the same dependencies each time
2017-11-03 14:20:00 -07:00
Elliot Lee
658d8a182e Update bignumber.js, ripple-hashes, ripple-lib-transactionparser 2017-11-03 14:20:00 -07:00
wilsonianb
2a90f9b134 Include signers in getSettings 2017-10-10 19:10:26 -05:00
Elliot Lee
f42dafd304 Merge branch 'update-lodash' into develop 2017-09-27 15:47:51 -07:00
Elliot Lee
ec2100094a Docs: Specify Node 6.11.3
- Add .nvmrc and update HISTORY.md
2017-09-27 15:45:50 -07:00
Elliot Lee
ecd6347859 Update to lodash 4
- Update ripple-lib-transactionparser
2017-09-27 10:25:53 -07:00
Elliot Lee
ab17b19ff0 Update for CircleCI
- circle.yml - use node 6
- Fix eslint errors
- Update coveralls and add path to babel
2017-09-27 10:25:08 -07:00
Elliot Lee
a9e5ac6290 Fix typos
Thanks @seelabs
2017-09-06 23:53:20 -07:00
Elliot Lee
4974f73f26 Clean up release history
- Fix some typos
- Improve consistency of formatting
2017-09-06 00:55:26 -07:00
Rome Reginelli
e6d71471e2 Merge pull request #791 from ripple/rr-xrp-ledger-rebranding
Fix case-sensitive broken link for preparePaymentChannelClaim
2017-09-01 15:16:58 -07:00
mDuo13
50db68dff7 Fix case-sensitive broken link for preparePaymentChannelClaim 2017-09-01 15:12:58 -07:00
Rome Reginelli
c8eb5b6a70 Merge pull request #790 from ripple/rr-xrp-ledger-rebranding
Fix 'Paymment' typo
2017-09-01 15:06:11 -07:00
mDuo13
c61a15e4f3 Fix 'Paymment' typo 2017-09-01 14:50:02 -07:00
Rome Reginelli
c151ff2d66 Merge pull request #788 from ripple/rr-xrp-ledger-rebranding
Docs: fix broken links
2017-09-01 14:45:56 -07:00
mDuo13
393b2f9d78 Docs: fix broken links 2017-09-01 12:45:03 -07:00
Rome Reginelli
bf36cf03d6 Merge pull request #785 from ripple/rr-xrp-ledger-rebranding
Rebrand 'Ripple Consensus Ledger' to 'XRP Ledger'
2017-08-31 14:47:52 -07:00
mDuo13
d3332e0db9 README updates for rebranding 2017-07-31 17:17:30 -07:00
mDuo13
ed62b20645 Rebrand 'Ripple Consensus Ledger' to 'XRP Ledger' 2017-07-31 14:05:40 -07:00
Rome Reginelli
5f2c5e27f1 Merge pull request #771 from xasos/develop
Fix readme syntax
2017-07-31 11:53:20 -07:00
Abraham Tom
ff702b85e2 Merge pull request #760 from mDuo13/doc_nodever_update
Docs: Require Node 6.9.0, update boilerplate to avoid destructuring assign
2017-07-28 12:04:23 -07:00
Niraj Pant
f91eb68556 Fix readme syntax 2017-06-09 11:12:42 -07:00
mDuo13
469fefee92 Docs: Require Node 6.9.0, update boilerplate to avoid destructuring assign 2017-05-09 15:51:45 -07:00
Matthew Fettig
de47263087 0.17.7 2017-05-08 15:10:26 -07:00
Matthew Fettig
3b9679a673 Merge pull request #759 from bachase/jsonschema
Switch to jsonschema
2017-05-08 15:09:04 -07:00
Brad Chase
f175966816 Make http server dev only 2017-05-05 14:59:15 -04:00
Brad Chase
f1f5364d07 Switch to jsonschema 2017-05-03 20:34:24 -04:00
Matthew Fettig
1b8b0c76ac Merge pull request #757 from ripple/fix-condition
Fix escrow condition and fulfillment descriptions
2017-04-13 19:39:27 -07:00
Matthew Fettig
1a8096ab18 Merge pull request #756 from ripple/sign-claim
Payment channel lookup and claim signing & verification
2017-04-13 19:38:45 -07:00
wilsonianb
f177771c67 Update ripple-binary-codec version 2017-04-13 17:39:27 -07:00
wilsonianb
081fcbfa32 Fix escrow condition and fulfillment descriptions 2017-04-12 15:16:01 -07:00
wilsonianb
0a5e4e2155 Update docs for escrow and paychan activation 2017-04-07 13:04:32 -07:00
wilsonianb
19eb88a00e Add getPaymentChannel 2017-04-07 13:04:21 -07:00
wilsonianb
c8f2967de0 Sign and verify payment channel claim 2017-04-07 13:01:58 -07:00
Matthew Fettig
b5564330f6 Merge pull request #755 from ripple/develop
0.17.6
2017-03-30 21:49:59 -07:00
Matthew Fettig
43ccb83f73 0.17.6 2017-03-30 21:33:09 -07:00
Brandon Wilson
e2d92126c0 Merge pull request #745 from ripple/feat/bs-paychan
Add transactions for payment channels
2017-03-30 21:26:13 -07:00
Ben Sharafian
8c8eef45d5 Add docs for payment channels 2017-03-30 21:19:31 -07:00
Ben Sharafian
a574e1158a Add transactions for payment channels 2017-03-30 21:19:31 -07:00
Matthew Fettig
af687a6aed Merge pull request #754 from ripple/escrowcreate
Simplify EscrowCreate parameters
2017-03-30 21:18:33 -07:00
wilsonianb
016e82ab5d Simplify EscrowCreate parameters 2017-03-30 19:01:58 -07:00
Matthew Fettig
f300a412d7 Merge pull request #753 from ripple/feature/dependancy-update
update ripple-hashes and ripple-binary-codec
2017-03-30 15:21:27 -07:00
Matthew Fettig
75e2249cf3 update ripple-hashes and ripple-binary-codec 2017-03-30 15:12:09 -07:00
Matthew Fettig
1942bcb971 Merge pull request #752 from ripple/rm-escrow-iou
Disallow escrow of IOU
2017-03-30 14:53:29 -07:00
wilsonianb
9393adf66f Disallow escrow of IOU 2017-03-30 10:10:00 -07:00
Matthew Fettig
917aae9bf3 Merge pull request #751 from ripple/feature/escrow
Replace suspended payments with escrow
2017-03-29 17:38:32 -07:00
wilsonianb
da36457d5c Update condition and fulfillment for escrow
Calculate escrowFinish fulfillment fee
2017-03-29 10:27:34 -07:00
wilsonianb
15a0ededc8 Replace suspended payments with escrow 2017-03-24 12:35:22 -07:00
wilsonianb
68d7864f93 Rename suspended payment files as escrow 2017-03-24 12:32:17 -07:00
Matthew Fettig
1eddbf995f 0.17.5 2017-03-24 12:31:10 -07:00
Matthew Fettig
592385ac73 Merge pull request #750 from ripple/feature/dependancy-update
update ripple-binary-codec to version 0.1.8
2017-03-24 12:26:35 -07:00
Matthew Fettig
56d626f5b1 Merge pull request #744 from choiip/develop
Added .json in missing require()
2017-03-24 10:53:42 -07:00
Matthew Fettig
7a14300409 update ripple-binary-codec to version 0.1.8 2017-03-24 10:40:19 -07:00
alex.choi
30fa8d658e Added .json in missing require() 2017-02-15 18:51:49 +08:00
Chris Clark
c0101cb5e7 Merge pull request #740 from wilsonianb/shamapv2
Check SHAMapV2 ledger close flag
2016-12-02 12:31:46 -08:00
wilsonianb
fd640cd65e Check SHAMapV2 ledger close flag 2016-12-02 12:25:32 -08:00
Chris Clark
11528eff92 Merge pull request #741 from wilsonianb/fix-lint-errors
Fix eslint errors
2016-12-02 11:55:21 -08:00
wilsonianb
3c9175459d Fix eslint errors 2016-12-02 08:16:16 -08:00
Chris Clark
bd4e0e01e2 Merge pull request #739 from clark800/develop
Update ripple-binary-codec and ripple-hashes dependencies
2016-11-30 14:59:52 -08:00
Chris Clark
cfcf6e473c Update ripple-binary-codec and ripple-hashes dependencies 2016-11-30 14:49:40 -08:00
Chris Clark
50c6af3158 Merge pull request #734 from clark800/bump-codec
Bump version to 0.17.3 and bump ripple-binary-codec to 0.1.4
2016-09-29 11:24:04 -07:00
Chris Clark
1d4310cd3a Disable flow type checking in CircleCI 2016-09-29 11:19:46 -07:00
Chris Clark
2191596e68 Bump version to 0.17.3 and bump ripple-binary-codec to 0.1.4 2016-09-29 11:19:32 -07:00
Chris Clark
acf8f87a88 Merge pull request #727 from clark800/order-seq
Add orderToReplace option
2016-08-01 14:34:27 -07:00
Chris Clark
cfac146620 Add orderToReplace option 2016-08-01 14:27:08 -07:00
Chris Clark
f3234ad853 Merge pull request #726 from clark800/doc-typos
Fix typos in docs
2016-08-01 14:24:22 -07:00
Chris Clark
b65fee3d85 Merge pull request #725 from shekenahglory/develop
update parseDeliveredAmount for cases where delivered_amount is not p…
2016-08-01 14:21:43 -07:00
Chris Clark
82b294bc7d Update flow 2016-08-01 14:13:00 -07:00
Chris Clark
2a58573823 Fix typos in docs 2016-08-01 11:53:46 -07:00
Matthew Fettig
a96f71b7fd fix missing deliveredAmount data from getLedger requests 2016-07-19 21:29:50 -07:00
Chris Clark
077f4a4c79 Merge pull request #723 from clark800/fix-coverage
Fix code coverage tool
2016-07-08 15:04:38 -07:00
Chris Clark
9a495467fb Disable sauce tests because they usually timeout 2016-07-08 11:45:27 -07:00
Chris Clark
db2e62b219 Fix code coverage tool 2016-07-08 11:28:10 -07:00
Alan Cohen
2fafa493a2 Version 0.17.2 2016-06-24 10:59:04 -07:00
Alan Cohen
7617c3005c Merge pull request #721 from mDuo13/fix_transferrate_docs
[DOC] fix transferRate description
2016-06-22 11:13:14 -07:00
mDuo13
5cdbb71277 [DOC] fix transferRate description 2016-06-16 15:11:08 -07:00
Chris Clark
f9339c36bf Merge pull request #720 from clark800/update-binary-codec
0.17.1
2016-05-11 18:20:29 -07:00
Chris Clark
67dc57e9d0 Disable PhantomJS tests due to issue downloading from bitbucket 2016-05-11 17:49:57 -07:00
Chris Clark
757f3190d1 0.17.1 2016-05-11 17:49:54 -07:00
Chris Clark
0d94a15ee7 0.17.0 2016-05-05 18:35:13 -07:00
Chris Clark
7f1c80da1b Merge pull request #718 from clark800/pseudo
Add support for parsing SetFee and EnableAmendment pseudo-transactions
2016-05-05 16:15:32 -07:00
Chris Clark
f74e11bce0 Add support for parsing SetFee and EnableAmendment pseudo-transactions 2016-05-05 15:37:23 -07:00
Chris Clark
d4c843e8e3 Merge pull request #714 from darkdarkdragon/remove_tej
[FIX] remove check for `tej` class of errors.
2016-04-05 15:15:42 -07:00
Ivan Tivonenko
bae190b282 [FIX] remove check for tej class of errors. 2016-04-05 23:50:41 +03:00
Chris Clark
d2cbd70da8 Merge pull request #712 from darkdarkdragon/reconnect_fix_browser
[FIX] on reconnect wait for server to be synced
2016-03-30 15:50:58 -07:00
Ivan Tivonenko
5da78ce583 [FIX] handle websocket errors in browsers
emit not RippledNotInitializedError if server doesn't have any
completed ledgers on connect
2016-03-31 00:46:00 +03:00
Chris Clark
14bbe3e30b Merge pull request #680 from ripple/sublimator-patch-1
Fix typo in docs
2016-03-29 10:27:34 -07:00
Nicholas Dudfield
e52e2bbc68 Fix IOU Amount precision related typo in docs 2016-03-29 13:51:30 +07:00
Alan Cohen
b56752e45b 0.16.10 2016-03-24 14:52:36 -07:00
Chris Clark
4632f511ab Merge pull request #711 from darkdarkdragon/reconnect_fix2
[FIX] on connect return error if server doesn't have validated ledgers
2016-03-24 14:27:50 -07:00
Ivan Tivonenko
e17b6f172d [FIX] on connect return error if server doesn't have validated ledgers 2016-03-24 22:26:33 +02:00
Alan Cohen
eb04e878ba 0.16.9 2016-03-22 18:39:33 -07:00
Chris Clark
c71febd116 Merge pull request #709 from darkdarkdragon/reconnect_fix
Reconnection fix
2016-03-22 18:12:28 -07:00
Ivan Tivonenko
69c1ccbb6b [TASK] emit connected and disconnected events from api 2016-03-23 02:05:07 +02:00
Ivan Tivonenko
499b8c8d8b [FIX] fix multiple reconnections issue 2016-03-23 01:18:08 +02:00
Chris Clark
ea009f9a84 Merge pull request #708 from clark800/fix-maker-exchange-rate
Fix makerExchangeRate for getOrders when rippled provides quality
2016-03-22 14:14:23 -07:00
Chris Clark
dc784d4567 Fix makerExchangeRate for getOrders when rippled provides quality 2016-03-22 13:21:26 -07:00
Alan Cohen
9ffc8a2c0b Merge pull request #707 from ripple/fix/filter-source-amount
FIX: Filtering source_amount pathfind correctly
2016-03-21 14:48:37 -07:00
Alan Cohen
5b20fe573e FIX: Filtering source_amount pathfind correctly
Bug:

```js
api.connect().then(() => {
  const pathfind = {
    source: {
      address: USDCold,
      amount: {
        currency: 'USD',
        value: '1.00' // <<<< Rippled response has "1" not "1.00"
      }
    },
    destination: {
      address: EURCold,
      amount: {currency: 'EUR'}
    }
  };
  return api.getPaths(pathfind).then(paths => {
    console.log('PATHS: \n', JSON.stringify(paths, null, 2));
  });
}).catch(console.log);

```
2016-03-21 11:44:55 -07:00
Chris Clark
7e466bb80f Merge pull request #705 from darkdarkdragon/code_comment
[FIX] add small code comment
2016-03-15 12:14:05 -07:00
Ivan Tivonenko
1f8418b447 [FIX] add small code comment 2016-03-15 20:58:22 +02:00
Alan Cohen
ccfc57fc62 Merge pull request #704 from darkdarkdragon/fix_edge_test
[FIX] fix test hang in microsoft edge
2016-03-15 10:27:01 -07:00
Ivan Tivonenko
1d31fccd72 [FIX] fix test hang in microsoft edge 2016-03-15 05:04:47 +02:00
Alan Cohen
9ac1a89e48 0.16.8 2016-03-09 12:30:10 -08:00
Chris Clark
bfc0696324 Merge pull request #701 from h0vhannes/develop
Documentation fixes
2016-03-09 12:24:55 -08:00
Hovhannes Kuloghlyan
e33e782f9e [DOC] Fix transaction spelling in getTransaction description 2016-03-09 22:14:09 +04:00
Hovhannes Kuloghlyan
f2b591d1b2 [DOC] Fix transaction responses link in submit() description 2016-03-09 22:07:54 +04:00
Chris Clark
fe9af5153d Merge pull request #699 from darkdarkdragon/develop_connection_error
[FIX] fix connection error handling
2016-02-24 14:12:12 -08:00
Ivan Tivonenko
0dfdd0a601 [FIX] change eslint version to 2.1 2016-02-24 23:08:49 +02:00
Ivan Tivonenko
4acc42e1b6 [FIX] fix connection error handling
if connection to server can't be established, reject Promise of `connect()` method caller,
instead of throwing error event on base object.
2016-02-24 23:08:47 +02:00
Alan Cohen
7c9a179865 Merge pull request #698 from h0vhannes/develop
[FIX] Fix typo in PrepareTrustline description
2016-02-23 08:44:43 -07:00
Hovhannes Kuloghlyan
c6296a4918 [FIX] Modify PrepareTrustline doc source to pass tests 2016-02-23 16:45:32 +04:00
Hovhannes Kuloghlyan
cc399f1164 [FIX] Fix typo in PrepareTrustline description 2016-02-21 17:02:27 +03:00
Alan Cohen
e4ffb96646 Update version to 0.16.7 2016-02-12 11:38:51 -08:00
Chris Clark
8d34428dac Merge pull request #694 from lumberj/add-deliveredAmount
Add deliveredAmount to payment outcome
2016-02-12 11:25:01 -08:00
Alan Cohen
353637a0c0 Add TODO comment for fixing workaround for rippled bug 2016-02-12 10:56:35 -08:00
Alan Cohen
00713d8ec1 Update version to 0.16.6 2016-02-11 17:02:18 -08:00
Alan Cohen
d949881e9f Merge pull request #695 from lumberj/fix-typo
Fix typo in common/connection.js
2016-02-11 16:30:23 -08:00
Alan Cohen
5075441a69 Fix lint error 2016-02-11 13:39:35 -08:00
Alan Cohen
94a852cb8b Fix typo in common/connection.js 2016-02-11 13:36:12 -08:00
Alan Cohen
06f847c2d0 Fix lint errors 2016-02-10 19:45:51 -08:00
Alan Cohen
0c2f9d0e62 Add deliveredAmount to payment outcome
It is impossible to reliably compute the delivered amount from the metadata due
to fixed precision. If the partial payment flag is not set and the transaction
succeeded, the delivered amount should always be considered to be the amount
specified in the transaction.
2016-02-10 17:25:27 -08:00
Chris Clark
11ed6b124f Merge pull request #692 from darkdarkdragon/develop-minify
fixes for minified version
2016-02-08 17:22:14 -08:00
Ivan Tivonenko
8767fc0068 fixes for minified version test minified version in SauceLabs 2016-02-09 03:08:23 +02:00
Chris Clark
66b07623b0 Merge pull request #691 from darkdarkdragon/develop-sauce
add SauceLabs testing
2016-02-05 10:10:37 -08:00
Ivan Tivonenko
4f3635eef0 add SauceLabs testing 2016-02-05 07:59:34 +02:00
Chris Clark
f638833759 Merge pull request #686 from darkdarkdragon/develop-RLJS-565
switch from Babel 5 to Babel 6
2016-01-21 15:42:00 -08:00
Ivan Tivonenko
ab9d1936d9 fix reconnect error - in case of connection was unexpectedly closed before it was open,
resolve first promise that was returned from call to connect
2016-01-21 18:35:59 +02:00
Ivan Tivonenko
0fefb2bd2c do not pack lodash inside browser version 2016-01-16 01:12:48 +02:00
Ivan Tivonenko
6740eee495 combine with different transaction test
test for trying to sign already signed transaction
ignore http server in coverage
2016-01-16 01:12:46 +02:00
Ivan Tivonenko
aa6020e00d switch from Babel 5 to Babel 6
use of isparta for coverage reporting
2016-01-16 01:12:43 +02:00
Alan Cohen
7bfe4a6cd8 Update version to 0.16.5 2016-01-15 14:44:05 -08:00
Chris Clark
aa467681e4 Merge pull request #688 from lumberj/source-amount-paths
Filter insufficient source funds paths from pathfind results
2016-01-15 13:47:17 -08:00
Alan Cohen
6b8cd6151d Filter insufficient source funds paths from pathfind results
When pathfinding with source amount, we need to filter out paths where source
amount is not equal to the specified source amount. This is due to the behavior
of rippled when specifying a source amount during pathfinding.

Example:

 {
  "command": "ripple_path_find",
  "source_account": "rhFQQ4ATC6MDF9ghTq3qAoCsGbGtjnhcXF",
  "destination_account": "rp91GUd5R3Rk3ipqW7XBdtrUJcX8epzGyb",
  "destination_amount": {
    "currency": "EUR",
    "issuer": "rp91GUd5R3Rk3ipqW7XBdtrUJcX8epzGyb",
    "value": -1
  },
  "send_max": {
    "currency": "USD",
    "issuer": "rhFQQ4ATC6MDF9ghTq3qAoCsGbGtjnhcXF",
    "value": "1234567891"
  },
  "id": 2
}
{
  "id": 2,
  "result": {
    "alternatives": [
      {
        "destination_amount": {
          "currency": "EUR",
          "issuer": "rp91GUd5R3Rk3ipqW7XBdtrUJcX8epzGyb",
          "value": "3999889.62127857"
        },
        "paths_canonical": [],
        "paths_computed": [
          [
            {
              "account": "rcsxQxEqU2qquAKp3tBUJy8Z2t19ioQPJ",
              "type": 1,
              "type_hex": "0000000000000001"
            },
            {
              "currency": "EUR",
              "issuer": "rp91GUd5R3Rk3ipqW7XBdtrUJcX8epzGyb",
              "type": 48,
              "type_hex": "0000000000000030"
            }
          ]
        ],
        "source_amount": {
          "currency": "USD",
          "issuer": "rhFQQ4ATC6MDF9ghTq3qAoCsGbGtjnhcXF",
          "value": "4170759.906037564"
        }
      }
    ],
    "destination_account": "rp91GUd5R3Rk3ipqW7XBdtrUJcX8epzGyb",
    "destination_amount": {
      "currency": "EUR",
      "issuer": "rp91GUd5R3Rk3ipqW7XBdtrUJcX8epzGyb",
      "value": "-1"
    },
    "destination_currencies": [
      "EUR",
      "XRP"
    ],
    "full_reply": true,
    "id": 2,
    "source_account": "rhFQQ4ATC6MDF9ghTq3qAoCsGbGtjnhcXF",
    "status": "success"
  },
  "status": "success",
  "type": "response"
}
2016-01-15 13:38:57 -08:00
Chris Clark
0d6aaee12a Merge pull request #681 from darkdarkdragon/develop-RLJS-564
fix for browser
2016-01-13 11:31:14 -08:00
Ivan Tivonenko
dc03c6e0ac fix to work in browser
run unit tests and integration tests in PhantomJS
add JUnit reporter to unit test so CircleCI can show results
2016-01-13 07:11:39 +02:00
Alan Cohen
0f4d957d14 Update version to 0.16.4 2016-01-04 19:48:59 -08:00
Alan Cohen
71a13224a1 Merge branch 'develop' into release
* develop:
  Update ws to 1.0.1
  run integration tests using standalone server
  Add multisignature support
  Add sample code to cancel all orders for a specified account
  Remove references to browser support
  add check for windows eol on commit removes windows eols from some files
  Fix error on ledger subscription message without validated_ledgers
2016-01-04 19:47:24 -08:00
Alan Cohen
8097ed60ba Update version to 0.16.3 2016-01-04 19:45:47 -08:00
Alan Cohen
408bb74214 Merge pull request #682 from lumberj/update-ws
Update ws to 1.0.1
2016-01-04 19:12:11 -08:00
Alan Cohen
9433b43873 Update ws to 1.0.1
Also, addresses remote memory disclosure vulnerability
https://nodesecurity.io/advisories/67
2016-01-04 19:06:30 -08:00
Chris Clark
896bf48c79 Merge pull request #672 from darkdarkdragon/develop-RLJS-558
testing circleci standalone integration
2015-12-18 16:11:13 -08:00
Ivan Tivonenko
3dd21a7e11 run integration tests using standalone server 2015-12-19 02:04:05 +02:00
Chris Clark
ed79a04018 Merge pull request #679 from clark800/multisign
Add multisignature support
2015-12-17 13:27:52 -08:00
Chris Clark
ebfe20defb Add multisignature support 2015-12-17 11:45:08 -08:00
Chris Clark
28b148348d Merge pull request #678 from clark800/cancel-all
Add sample code to cancel all orders for a specified account
2015-12-16 12:05:09 -08:00
Chris Clark
fe099f2c8b Add sample code to cancel all orders for a specified account 2015-12-16 11:40:39 -08:00
Chris Clark
107c8c9f0f Merge pull request #677 from lumberj/no-browser
Remove references to browser support
2015-12-16 11:35:33 -08:00
Alan Cohen
39e818b3e5 Remove references to browser support 2015-12-16 10:34:57 -08:00
Chris Clark
588ffa3d5c Merge pull request #674 from darkdarkdragon/develop-eol
add check for windows eol
2015-12-14 12:57:57 -08:00
Ivan Tivonenko
691e4dd114 add check for windows eol on commit
removes windows eols from some files
2015-12-14 22:15:30 +02:00
Chris Clark
55bc42725f Merge pull request #675 from clark800/fix-validated-ledgers
Fix error on ledger subscription message without validated_ledgers
2015-12-14 11:30:35 -08:00
Chris Clark
cce55b9361 Fix error on ledger subscription message without validated_ledgers 2015-12-14 11:07:58 -08:00
Chris Clark
c23c6e4fc9 Bump version to 0.16.2 2015-12-10 14:41:45 -08:00
Chris Clark
afdd60efe8 Merge pull request #671 from clark800/bump-binary
Bump ripple-binary-codec dependency version to 0.1.1 to fix issue wit…
2015-12-10 14:38:11 -08:00
Chris Clark
8f6ea573ff Bump ripple-binary-codec dependency version to 0.1.1 to fix issue with computeLedgerHash for transactions with DeliverMin 2015-12-10 14:29:28 -08:00
Alan Cohen
3271b544ef Bump version to 0.16.1 2015-12-09 16:51:26 -08:00
Alan Cohen
6e83130754 Merge pull request #669 from lumberj/fix-assertdiff
FIX: Use assert not assert-diff
2015-12-09 16:49:36 -08:00
Alan Cohen
f6ebe32519 FIX: Use assert not assert-diff 2015-12-09 16:45:08 -08:00
Chris Clark
3caed3c761 Bump version to 0.16.0 2015-12-09 13:17:04 -08:00
Chris Clark
ce1c55427a Merge pull request #668 from clark800/fix-ws-error
BREAKING CHANGE: Change error event format and fix crash due to error event on websocket
2015-12-09 13:06:45 -08:00
Chris Clark
9cd72595f0 BREAKING CHANGE: Change error event format and fix crash due to error event on websocket 2015-12-09 12:56:45 -08:00
Chris Clark
ad1d3e135f Merge pull request #663 from darkdarkdragon/develop-http-server
http server example
2015-12-09 11:15:52 -08:00
Ivan Tivonenko
76866ab901 http server example
allows to use both positional and named parameters
2015-12-09 21:00:47 +02:00
Chris Clark
20b647dfbf Merge pull request #667 from clark800/fix-server-info
BREAKING CHANGE: Fix types of XRP values in getServerInfo response
2015-12-07 17:03:09 -08:00
Chris Clark
99d08065e4 BREAKING CHANGE: Fix types of XRP values in getServerInfo response 2015-12-07 16:47:56 -08:00
Chris Clark
261fba3d21 Merge pull request #666 from clark800/fix-deliver-min
Fix DeliverMin value when specifying minAmount
2015-12-04 15:35:30 -08:00
Chris Clark
e1d9de7b1f Fix DeliverMin value when specifying minAmount 2015-12-04 15:18:03 -08:00
Chris Clark
391b2f3622 Merge pull request #665 from clark800/fix-quality
Fix parsing of quality for getTrustlines
2015-12-04 13:55:46 -08:00
Chris Clark
86ff315ef2 Fix parsing of quality for getTrustlines 2015-12-04 13:40:59 -08:00
Chris Clark
8d8a850864 Merge pull request #662 from lumberj/doc-fix
getFee returns a string not float
2015-12-02 13:32:11 -08:00
Alan Cohen
7bf2da6014 getFee returns a string not float
> api.connect().then(() => api.getFee().then(fee => console.log(typeof fee)));
> string
2015-12-02 13:17:35 -08:00
Chris Clark
7eae3ce709 Merge pull request #661 from clark800/client-cert
Add support for client certificates
2015-11-30 16:48:52 -08:00
Chris Clark
5f5e48e414 Add support for client certificates 2015-11-30 16:26:27 -08:00
Chris Clark
4f6a37f7b1 Merge pull request #660 from clark800/null-max
Allow setting maxLedgerVersion to null to specify no maximum
2015-11-30 16:13:41 -08:00
Chris Clark
82613e7e8b Allow setting maxLedgerVersion to null to specify no maximum 2015-11-30 15:52:36 -08:00
Chris Clark
588aa382a1 Merge pull request #659 from clark800/doc-fixes
Fix generateAddress docs and add error event listener to boilerplate
2015-11-30 15:32:02 -08:00
Chris Clark
809d981987 Fix generateAddress docs and add error event listener to boilerplate 2015-11-30 15:16:37 -08:00
Chris Clark
cfc21fde8c Bump version to 0.15.2 2015-11-25 13:13:53 -08:00
Geert Weening
5c06ef547b Merge pull request #658 from clark800/fix-proxy-auth
Fix support for proxy credentials in proxy URL and fix error when the…
2015-11-25 13:11:42 -08:00
Chris Clark
0990ad4a6f Fix support for proxy credentials in proxy URL and fix error when there are more than 10 outstanding requests 2015-11-25 12:53:50 -08:00
Chris Clark
d8f967d2b8 Bump version to 0.15.1 2015-11-25 11:46:33 -08:00
Geert Weening
fe1c3e7130 Merge pull request #657 from clark800/fix-polyfill
Fix babel-polyfill require
2015-11-25 11:38:52 -08:00
Chris Clark
062148674c Fix babel-polyfill require 2015-11-25 11:31:32 -08:00
Chris Clark
11320693fd Merge pull request #656 from clark800/fix-samples
Fix samples
2015-11-25 11:08:39 -08:00
Chris Clark
7af7eaccb4 Merge pull request #655 from darkdarkdragon/develop-RLJS-549-3
add unit tests for RippleAPIBroadcast
2015-11-25 11:04:55 -08:00
Chris Clark
5d5cf868a2 Fix samples 2015-11-25 10:26:30 -08:00
Ivan Tivonenko
ddf8fe5b1a add unit tests for RippleAPIBroadcast 2015-11-25 05:58:48 +02:00
Chris Clark
dc24f6afe0 Bump version to 0.15.0 2015-11-24 17:53:53 -08:00
Chris Clark
f7dac6ab25 Merge pull request #654 from clark800/mDuo13-docs-patch-3
Docs: SusPay warnings, offline mode, and other tweaks
2015-11-24 17:49:01 -08:00
mDuo13
4b4fc36ebd Docs: SusPay warnings, offline mode, and other tweaks 2015-11-24 17:37:52 -08:00
Chris Clark
7626ea5ed8 Merge pull request #653 from clark800/multi
BREAKING CHANGE: "servers" parameter changed to single "server" and a…
2015-11-24 17:08:58 -08:00
Chris Clark
7061e9afe4 BREAKING CHANGE: "servers" parameter changed to single "server" and added a new broadcast wrapper class for multiple servers 2015-11-24 16:47:12 -08:00
Chris Clark
a124635c2c Merge pull request #652 from darkdarkdragon/develop-RLJS-549-2
fix handling memos in prepareSettings
2015-11-24 16:33:43 -08:00
Ivan Tivonenko
c9704137b7 fix handling memos in prepareSettings
boost coverage back to 99.88%
move connection tests to separate file
group test fixtures into namespaces
2015-11-25 02:10:54 +02:00
Chris Clark
ab8d75d3cc Merge pull request #650 from clark800/cancel-doc-fix
Fix prepareOrderCancellation documentation
2015-11-24 14:32:24 -08:00
Chris Clark
5e720891f5 Fix prepareOrderCancellation documentation 2015-11-23 18:24:19 -08:00
Chris Clark
27ed1aadd5 Bump version to 0.14.0 2015-11-23 17:36:16 -08:00
Chris Clark
001f203983 Merge pull request #648 from clark800/memos
Allow memos on all transaction types
2015-11-23 17:25:09 -08:00
Chris Clark
515047d2dc Merge pull request #649 from clark800/darkdarkdragon-develop-RLJS-549
boost coverage to almost 100%
2015-11-23 17:24:46 -08:00
Ivan Tivonenko
995606b1e6 boost coverage to almost 100% 2015-11-23 17:06:55 -08:00
Chris Clark
b5081344da Allow memos on all transaction types 2015-11-23 14:12:32 -08:00
Chris Clark
4f86691fb8 Merge pull request #647 from clark800/cancellation-spec
BREAKING CHANGE: prepareOrderCancellation now takes orderCancellation specification instead of sequence
2015-11-23 13:14:00 -08:00
Chris Clark
45aca016d4 Merge pull request #646 from clark800/api-options-doc
Add documentation for RippleAPI options
2015-11-23 12:47:43 -08:00
Chris Clark
7f33d8a71e BREAKING CHANGE: prepareOrderCancellation now takes orderCancellation specification instead of sequence 2015-11-23 12:45:44 -08:00
Chris Clark
af620755c5 Fix trace option 2015-11-23 12:01:28 -08:00
Chris Clark
a76b554cad Add documentation for RippleAPI options 2015-11-23 12:01:28 -08:00
Chris Clark
ef1e9e1b70 Merge pull request #644 from mDuo13/patch-1
Docs: more on basic types, tx types
2015-11-23 10:23:38 -08:00
mDuo13
fdbac63f46 Docs: more on basic types, tx types 2015-11-20 18:49:03 -08:00
Chris Clark
377f1dbfa1 Merge pull request #643 from clark800/proxy-auth
Fix proxy support and add support for proxy authorization
2015-11-20 16:32:53 -08:00
Chris Clark
14b840f3fe Fix proxy support and add support for proxy authorization 2015-11-20 15:23:56 -08:00
Chris Clark
beb1cc0cde Merge pull request #642 from mDuo13/patch-1
Doc introduction changes
2015-11-20 14:30:05 -08:00
Rome Reginelli
ef2515507d Docs: revised introductory material 2015-11-20 14:15:40 -08:00
Chris Clark
a271b9e816 Merge pull request #641 from clark800/ledger-event
BREAKING CHANGE: Rename "ledgerClosed" event to "ledger" and convert drops amounts to XRP
2015-11-20 11:30:35 -08:00
Chris Clark
8a3d4a64db BREAKING CHANGE: Rename "ledgerClosed" event to "ledger" and convert drops amounts to XRP 2015-11-20 11:23:19 -08:00
Alan Cohen
9cd8beb778 Bump version to 0.13.2 2015-11-20 10:54:01 -08:00
Chris Clark
aaa165a0f3 Merge pull request #640 from lumberj/fix-pathfind
Fix: Specify send_max when pathfinding with a source amount
2015-11-20 10:48:39 -08:00
Alan Cohen
7514213918 Fix: Specify send_max when pathfinding with a source amount
When specifying a fixed sending amount during a pathfind request, the source
amount is specified as a `send_max` field. This fixes a bug where the amount was
specified as `source_amount`. Leading to strange pathfinding behavior.

Example bad behavior (rippled pathfind request/response):

```
 {
  "command": "ripple_path_find",
  "source_account": "rM21sWyMAJY1oqzgnweDatURxGMurBs7Kf",
  "destination_account": "raDjTrcEtyMqZT6s3PyKGcikUJqYNXUPPv",
  "destination_amount": {
    "currency": "EUR",
    "issuer": "raDjTrcEtyMqZT6s3PyKGcikUJqYNXUPPv",
    "value": -1
  },
  "source_amount": {
    "currency": "USD",
    "issuer": "rM21sWyMAJY1oqzgnweDatURxGMurBs7Kf",
    "value": "9.9"
  },
  "id": 2
}
{
  "id": 2,
  "result": {
    "alternatives": [
      {
        "destination_amount": {
          "currency": "EUR",
          "issuer": "raDjTrcEtyMqZT6s3PyKGcikUJqYNXUPPv",
          "value": "147520.7583553951"
        },
        "paths_canonical": [],
        "paths_computed": [
          [
            {
              "account": "r9HqF3wexBb1vtu2DfZKiFuyy3HoTAwUnH",
              "type": 1,
              "type_hex": "0000000000000001"
            },
            {
              "currency": "EUR",
              "issuer": "raDjTrcEtyMqZT6s3PyKGcikUJqYNXUPPv",
              "type": 48,
              "type_hex": "0000000000000030"
            }
          ]
        ],
        "source_amount": {
          "currency": "USD",
          "issuer": "rM21sWyMAJY1oqzgnweDatURxGMurBs7Kf",
          "value": "160510.6025237665"
        }
      }
    ],
    "destination_account": "raDjTrcEtyMqZT6s3PyKGcikUJqYNXUPPv",
    "destination_currencies": [
      "EUR",
      "XRP"
    ],
    "ledger_current_index": 2771044,
    "validated": false
  },
  "status": "success",
  "type": "response"
}
```

https://ripple.com/build/rippled-apis/#ripple-path-find
2015-11-20 10:44:21 -08:00
Alan Cohen
849ba999cb Bump version to 0.13.1 2015-11-19 18:00:22 -08:00
Chris Clark
10eb08095a Merge pull request #639 from lumberj/babel-polyfill
Add babel-polyfill
2015-11-19 17:46:54 -08:00
Chris Clark
23eb4c90fd Merge pull request #636 from clark800/events-doc
Add documentation for API events
2015-11-19 17:45:00 -08:00
Alan Cohen
12e5765c64 Bump version on ripple-hashes 2015-11-19 17:42:54 -08:00
Alan Cohen
8a53abc32f Add babel-polyfill
» node
> ripple = require('ripple-lib')
Error: Cannot find module 'babel-core/polyfill'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/alan/Projects/ripple-connect/node_modules/ripple-lib/dist/npm/index.js:23:3)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
2015-11-19 17:31:52 -08:00
Chris Clark
25d1ac0c5f Add documentation for API events 2015-11-19 15:40:35 -08:00
Chris Clark
f534bafb79 Merge branch 'develop' 2015-11-19 12:48:08 -08:00
Alan Cohen
f5fa1e6c2a Merge pull request #635 from clark800/docs
Bump version to 0.13.0
2015-11-19 12:34:42 -08:00
Chris Clark
60842540cb Bump version to 0.13.0 2015-11-19 12:26:24 -08:00
Chris Clark
0fb04cdcb4 Merge pull request #634 from clark800/docs
Add table of contents to docs
2015-11-19 11:29:43 -08:00
Chris Clark
5fb8d9214f Add table of contents to docs 2015-11-19 11:19:35 -08:00
Chris Clark
f7f2de291f Merge pull request #633 from clark800/docs
Add documentation and documentation testing
2015-11-18 17:51:36 -08:00
Chris Clark
0c27a13a00 Fix ci.sh error detection 2015-11-18 16:54:13 -08:00
Chris Clark
02a887776f Add documentation and documentation testing 2015-11-18 16:54:10 -08:00
Alan Cohen
f8c885c0a9 Bump version to 0.13.0-rc16 2015-11-18 14:43:50 -08:00
Chris Clark
327ee2b8dd Merge pull request #632 from clark800/error-message
Add resultCode and resultMessage to submit failure RippledError
2015-11-17 17:46:00 -08:00
Chris Clark
4f90bbd931 Add resultCode and resultMessage to submit failure RippledError 2015-11-17 17:33:36 -08:00
Chris Clark
f196304a56 Merge pull request #630 from darkdarkdragon/develop-RLJS-540
add test case for get transaction of types
2015-11-17 16:27:57 -08:00
Ivan Tivonenko
f146ea05c7 add test case for get transaction of types
suspendedPaymentExecution, suspendedPaymentCancellation, suspendedPaymentCreation
2015-11-17 23:43:01 +02:00
Chris Clark
a602d4d73d Merge pull request #631 from clark800/fix-todos
Fix TODOs in schemas and update README for RippleAPI
2015-11-17 13:02:59 -08:00
Chris Clark
2422b9a30b Update README for RippleAPI 2015-11-17 11:30:26 -08:00
Chris Clark
ef72c9fe02 Fix TODOs in schemas 2015-11-16 16:59:27 -08:00
Chris Clark
ee12a214d3 Merge pull request #629 from clark800/remove-closed
Miscellaneous cleanup
2015-11-16 14:17:55 -08:00
Chris Clark
83a85a4549 Remove walletLocator and walletSize from settings 2015-11-16 13:07:25 -08:00
Chris Clark
420413268d Rename server info response fields 2015-11-16 13:07:25 -08:00
Chris Clark
c1bf1fd211 Rename "paymentSequence" to "suspensionSequence" in suspended payments 2015-11-16 13:07:25 -08:00
Chris Clark
9af20f9176 Simplify "submit" response 2015-11-16 13:07:22 -08:00
Chris Clark
230a80852a Remove "closed" from getLedger response 2015-11-16 11:44:15 -08:00
Chris Clark
ff9474b2f9 Merge pull request #628 from clark800/remove-regular-key
Support removing RegularKey
2015-11-16 10:58:49 -08:00
Chris Clark
ed8f1e4111 Support removing RegularKey 2015-11-16 10:24:02 -08:00
Chris Clark
c7eb625ac0 Merge pull request #627 from clark800/docprep
Add descriptions to JSON schemas and organize for documentation generation
2015-11-13 16:22:48 -08:00
Chris Clark
5a8e4be9df Add descriptions to JSON schemas and organize for documentation generation 2015-11-13 15:05:53 -08:00
Chris Clark
e267e4131b Merge pull request #625 from clark800/json-schemas
Organize JSON schemas for documentation generation
2015-11-06 12:50:10 -08:00
Chris Clark
782adc6a1a Organize JSON schemas for documentation generation 2015-11-06 11:57:33 -08:00
Chris Clark
dce8b2d61a Merge pull request #624 from clark800/misc
Better error message when using methods that require a connection when servers are not provided
2015-11-03 11:05:21 -08:00
Chris Clark
8074baa3b5 Better error message when using methods that require a connection when servers are not provided 2015-11-02 14:50:38 -08:00
Chris Clark
c104a51458 Merge pull request #623 from clark800/ledgerclose
BREAKING CHANGE: Specify ledger close time and suspended payment timestamps in ISO 8601 format
2015-11-02 14:17:14 -08:00
Chris Clark
6cc8c5a0f4 BREAKING CHANGE: Specify ledger close time and suspended payment timestamps in ISO 8601 format 2015-11-02 12:34:50 -08:00
Geert Weening
90c928205a Merge pull request #621 from clark800/schemas
Fix and reorganize schemas and switch to ajv validator
2015-11-02 21:34:01 +01:00
Geert Weening
7c1831ef38 Merge pull request #622 from clark800/fix-samples
Fix samples
2015-11-02 20:08:27 +01:00
Chris Clark
f722514ecf Fix samples 2015-10-30 15:22:42 -07:00
Chris Clark
c7b021c7be Fix and reorganize schemas and switch to ajv validator 2015-10-30 14:28:50 -07:00
Chris Clark
2aa1695b74 Delete obsolete files and update LICENSE file 2015-10-30 14:25:33 -07:00
Chris Clark
7bc242bcd0 Merge pull request #620 from clark800/expiration
Add support for order expiration
2015-10-29 17:59:49 -07:00
Chris Clark
665f5f9664 Add support for order expiration 2015-10-29 17:25:52 -07:00
sublimator
36806e4724 Merge pull request #619 from clark800/current-error
Expose computeLedgerHash and prevent access to non-validated ledgers
2015-10-29 11:29:59 +07:00
Chris Clark
6c2fad508a Expose computeLedgerHash and prevent access to non-validated ledgers 2015-10-28 15:39:43 -07:00
Chris Clark
252b99db18 Merge pull request #618 from clark800/cleanup
Emit Connection errors on RippleAPI, remove unused exports, use ripple-hashes in sign
2015-10-28 12:39:50 -07:00
Chris Clark
c238596a81 Emit Connection errors on RippleAPI, remove unused exports, use ripple-hashes in sign 2015-10-28 11:33:51 -07:00
Chris Clark
85c1a3cc42 Merge pull request #615 from clark800/cleanup-errors
Cleanup error classes
2015-10-28 10:08:11 -07:00
sublimator
b6e8dc4c8d Merge pull request #616 from clark800/proxy
Add proxy and authorization support to Connection class
2015-10-28 13:24:07 +07:00
Chris Clark
ba95514d8d Add proxy and authorization support to Connection class 2015-10-27 17:41:46 -07:00
Chris Clark
87dac75919 Cleanup error classes 2015-10-27 17:14:23 -07:00
Chris Clark
37178eeb0b Merge pull request #614 from clark800/api-class
Delete core
2015-10-27 13:27:15 -07:00
Chris Clark
97747deed9 Delete core, move "api" directory up to "src", and remove unused dependencies 2015-10-27 12:37:07 -07:00
Chris Clark
88b1c7e6eb Convert RippleAPI to ES6 class 2015-10-27 12:13:45 -07:00
Chris Clark
29c933e31b Merge pull request #612 from clark800/delete-core
BREAKING CHANGE: Remove dependency of src/api on src/core, removes multiserver support
2015-10-27 11:54:29 -07:00
Chris Clark
b224d4d1c4 Use Promise.resolve 2015-10-27 10:49:59 -07:00
Chris Clark
6db2a72eb8 Use Promise.resolve 2015-10-27 10:39:18 -07:00
Chris Clark
cd5eedff84 Rename toTimestamp/fromTimestamp 2015-10-26 17:46:57 -07:00
Chris Clark
75a427ab27 Avoid catching listener exceptions in Connection class 2015-10-26 17:39:21 -07:00
Chris Clark
ae439afaa4 Remove unnecessary server_info request 2015-10-26 17:29:32 -07:00
Chris Clark
1a99a2fddb BREAKING CHANGE: Remove dependency of src/api on src/core, removes multiserver support 2015-10-26 16:28:43 -07:00
sublimator
c867f2a29a Merge pull request #603 from wltsmrz/add-basic-auth
Add basic auth
2015-10-24 10:18:56 +07:00
Chris Clark
ce65d83cc3 Merge pull request #610 from darkdarkdragon/develop-RLJS-534
fix error in remote.createPathFind
2015-10-23 14:28:31 -07:00
Chris Clark
38dc1c29d6 Merge pull request #611 from darkdarkdragon/develop-RLJS-535
add timeout logic to Remote.getLedgerSequence
2015-10-23 14:28:12 -07:00
Ivan Tivonenko
eeb62ff85e add timeout logic to Remote.getLedgerSequence 2015-10-24 00:20:06 +03:00
Ivan Tivonenko
1dca40c1c9 fix error in remote.createPathFind
add toString method on RippleError
2015-10-24 00:03:53 +03:00
Chris Clark
7e1f2b99b1 Merge pull request #609 from clark800/ripple-path-find
Switch back to ripple_path_find
2015-10-23 13:32:59 -07:00
wltsmrz
f65b673451 Add basic auth 2015-10-22 23:03:48 -07:00
Chris Clark
391a9fd260 Switch back to ripple_path_find 2015-10-22 17:51:16 -07:00
Chris Clark
9a759e7ef1 Merge pull request #608 from clark800/decouple-remote
BREAKING CHANGE: getFee returns promise, express fee in XRP in instru…
2015-10-22 16:37:24 -07:00
Chris Clark
3de0030d07 Add ledger version range checking to Connection class 2015-10-22 14:34:44 -07:00
Chris Clark
cd17d6940f BREAKING CHANGE: getFee returns promise, express fee in XRP in instructions response, use rawRequest to start decoupling Remote from API 2015-10-22 14:34:42 -07:00
Chris Clark
5aa212471c Merge pull request #606 from clark800/decouple-transaction
Decouple core.Transaction from API
2015-10-22 11:16:29 -07:00
Chris Clark
c324682ca3 Decouple core.Transaction from API 2015-10-21 11:48:40 -07:00
Chris Clark
33565d8b96 Merge pull request #604 from shekenahglory/develop
rename metaData to meta
2015-10-21 11:13:35 -07:00
Matthew Fettig
aeb56dee17 rename metaData to meta on getLedger 2015-10-21 10:00:07 -07:00
Chris Clark
98422e4153 Merge pull request #605 from clark800/replace-transaction
Set FullyCanoncialSig flag and fix integration tests
2015-10-20 15:51:44 -07:00
Chris Clark
2c7ce4a107 Run integration tests in CI 2015-10-20 15:49:06 -07:00
Chris Clark
3fbde86548 Set FullyCanoncialSig flag and fix integration tests 2015-10-20 15:49:03 -07:00
Chris Clark
01ecd197ce Merge pull request #601 from clark800/replace-core
Add Connection class
2015-10-20 10:38:00 -07:00
Chris Clark
15eb4c290a Add Connection class 2015-10-19 17:32:45 -07:00
wltsmrz
5fa20dc1f7 Merge pull request #593 from clark800/remove-rsign
Remove rsign.js
2015-10-19 13:45:52 -07:00
Alan Cohen
3df64091dd Bump version to 0.13.0-rc15 2015-10-19 08:51:44 -07:00
Chris Clark
de5d9335d1 Merge pull request #598 from clark800/remove-currency
Remove Currency class
2015-10-16 11:51:20 -07:00
Chris Clark
88a65f08d8 Merge pull request #596 from darkdarkdragon/develop-RLJS-520
getBalances fixes:
2015-10-16 10:54:16 -07:00
Chris Clark
a505354363 Remove bin scripts 2015-10-16 10:52:11 -07:00
Chris Clark
837f7e6e9b Remove Currency class 2015-10-16 10:48:09 -07:00
Ivan Tivonenko
4faa857330 getBalances fixes:
obey limit, do not return XRP if currency or issuer specified
2015-10-16 20:46:52 +03:00
Alan Cohen
9c7b0cb889 Merge '0.13.0-rc11.1' into develop
Bump version to 0.13.0-rc11.1
  Add proxy support to schema
2015-10-15 18:28:27 -07:00
Alan Cohen
a11abcc016 Bump version to 0.13.0-rc11.1 2015-10-15 18:22:20 -07:00
Alan Cohen
dd693fdc5f Add proxy support to schema 2015-10-15 18:14:22 -07:00
Chris Clark
5ac2576fcf Merge pull request #597 from clark800/remove-ieee754
Remove demurrage
2015-10-15 12:18:21 -07:00
Chris Clark
512817a2db Remove demurrage 2015-10-15 11:56:39 -07:00
Chris Clark
1f8c8d88fa Merge pull request #595 from clark800/ripple-hashes
Use ripple-hashes
2015-10-15 10:51:06 -07:00
Chris Clark
044ed53935 Merge pull request #582 from darkdarkdragon/develop-flow-annotate-4
add more flow annotations to RippleApi
2015-10-15 10:32:32 -07:00
Ivan Tivonenko
d47bb2749a add more flow annotations to RippleApi 2015-10-15 03:51:45 +03:00
Chris Clark
0dc000839b Use ripple-hashes 2015-10-14 15:48:40 -07:00
Chris Clark
462e440d5b Merge pull request #594 from clark800/hex-sign
Update ripple-keypairs
2015-10-14 14:12:23 -07:00
Chris Clark
1891fe0afd Update ripple-keypairs 2015-10-14 13:24:13 -07:00
Geert Weening
8cec60c4b0 Merge pull request #592 from clark800/remote-serial
Delete serialization code
2015-10-14 11:28:11 -07:00
Chris Clark
7419244b39 Delete serialization code 2015-10-13 18:24:21 -07:00
Chris Clark
eb9a48d2d6 Merge pull request #589 from wltsmrz/multisign-update
Fix Transaction.complete() for multisigned transactions
2015-10-13 16:18:01 -07:00
Chris Clark
e44d36b4af Merge pull request #591 from clark800/ledger-hashes
Decouple ledger.js and serialization code
2015-10-13 16:15:40 -07:00
Chris Clark
9a5d05f198 Decouple ledger.js and serialization code 2015-10-13 14:51:04 -07:00
Chris Clark
d7a20a5d53 Merge pull request #588 from darkdarkdragon/develop-broadcast-fix
fix Request.broadcast logic
2015-10-13 14:06:31 -07:00
Ivan Tivonenko
b56680e24e fix Request.broadcast logic
Add default timeout to Request.broadcas
Add default timeout to Remote.createPathFind
Handle 'slowDown' error in many places
2015-10-13 22:40:02 +03:00
Chris Clark
886e80ff6d Merge pull request #590 from FrRichard/patch-4
Update REFERENCE.md
2015-10-13 10:51:57 -07:00
FrRichard
142187b024 Update REFERENCE.md
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).
2015-10-10 19:52:55 +02:00
wltsmrz
72f3237aba Fix Transaction.complete() for multisigned transactions 2015-10-09 10:50:54 -07:00
Chris Clark
a2406ac163 Merge pull request #587 from clark800/serialize-quality
Use ripple-binary-codec
2015-10-08 15:51:15 -07:00
Chris Clark
91a64137fe BREAKING CHANGE: Use ripple-binary-codec 2015-10-08 15:48:23 -07:00
Geert Weening
57ecbc58f8 bump version to 0.13.0-rc14 2015-10-07 11:42:08 -07:00
Geert Weening
ea4d1007b8 Merge branch 'release' into develop 2015-10-07 11:17:36 -07:00
Geert Weening
16bc7b986b Bump version to 0.13.0-rc13 2015-10-07 11:14:39 -07:00
Geert Weening
115f95fa96 update release notes 2015-10-07 11:14:01 -07:00
Chris Clark
b77b76ebb5 Merge pull request #586 from darkdarkdragon/develop-log-fix
get back lost argument in debug logger
2015-10-07 10:20:01 -07:00
Ivan Tivonenko
f516298a84 get back lost argument in debug logger 2015-10-07 11:43:17 +03:00
Chris Clark
edb31a0c9c Merge pull request #584 from darkdarkdragon/develop-RLJS-521
Add Remote.closeCurrentPathFind function, so current pathfind can be …
2015-10-06 18:40:25 -07:00
Ivan Tivonenko
e99010f363 Add Remote.closeCurrentPathFind function, so current pathfind can be properly closed,
so new can be created without adding to queue
2015-10-07 04:10:13 +03:00
Chris Clark
fa865f8409 Merge pull request #580 from FrRichard/patch-1
Update REFERENCE.md
2015-10-06 17:43:47 -07:00
FrRichard
40b613b7a2 Update REFERENCE.md
Update REFERENCE.md

Update REFERENCE.md
2015-10-07 02:29:17 +02:00
Chris Clark
786c371acd Merge pull request #585 from shekenahglory/master
fix orderbook subscription bug
2015-10-06 16:24:48 -07:00
Matthew Fettig
c4920f474d fix orderbook subscription bug 2015-10-06 15:56:10 -07:00
Chris Clark
a79b010572 Merge pull request #576 from shekenahglory/develop
allow offers request on orderbook subscribe when disconnected
2015-10-06 14:09:25 -07:00
Matthew Fettig
7404795dc6 fix bugs in orderbook subscription 2015-10-06 13:59:21 -07:00
Chris Clark
47a9fb5803 Merge pull request #583 from clark800/fix-merge-error
Fix merge error
2015-10-06 12:54:41 -07:00
Chris Clark
701d4c5722 Fix merge error 2015-10-06 12:47:26 -07:00
Chris Clark
d8d6f945ec Merge pull request #581 from clark800/binary-codec
Decouple UInt from non-serialization code
2015-10-05 16:39:17 -07:00
Geert Weening
a6821bb8ab Fix bower version regex 2015-10-05 15:58:49 -07:00
Geert Weening
ed40eec711 Bump version to 0.13.0-rc12 2015-10-05 15:38:20 -07:00
Chris Clark
2f163c3b6e Decouple UInt from non-serialization code 2015-10-05 15:27:43 -07:00
Geert Weening
43488c55f1 Update release notes 2015-10-05 15:07:31 -07:00
Geert Weening
2f727b553c Merge branch 'develop' into release 2015-10-05 15:04:18 -07:00
Chris Clark
29c37aa6da Merge pull request #579 from wltsmrz/balance-sheet
Balance sheet
2015-10-05 13:41:24 -07:00
wltsmrz
64baef431d Use amount schema 2015-10-05 13:37:55 -07:00
Chris Clark
634fe5683a Merge pull request #577 from darkdarkdragon/develop-reconnect-2
remove Request resubmit logic
2015-10-05 13:28:47 -07:00
Ivan Tivonenko
225ca3f852 BREAKING CHANGE: removed 'timeout' method of Request
added default timeout to Request - will emit 'timeout' event
and RippleError('tejTimeout') to callback
2015-10-05 23:22:32 +03:00
wltsmrz
ff2ac6c3cd Format balancesheet schema 2015-10-05 13:09:04 -07:00
wltsmrz
607777f2a3 Lint 2015-10-05 12:30:41 -07:00
wltsmrz
78eeb40322 Change rippled test fixture name 2015-10-05 12:23:22 -07:00
wltsmrz
772f79ae21 Update schema 2015-10-05 12:16:25 -07:00
wltsmrz
806a4e823f Add getBalanceSheet() to RippleAPI 2015-10-02 17:30:13 -07:00
wltsmrz
323e402e0c Add requestGatewayBalances() to core 2015-10-02 17:30:04 -07:00
Chris Clark
9ebb59580d Merge pull request #575 from clark800/get-paths-source-amount
Support source.amount in getPaths and destination.minAmount in preparePayment
2015-10-02 13:30:04 -07:00
wltsmrz
bafab6eb18 Merge pull request #574 from clark800/fix-ratio-human
Fix bug in Amount.ratio_human
2015-10-01 15:18:20 -07:00
Chris Clark
35acbb62c3 Support source.amount in getPaths and destination.minAmount in preparePayment 2015-10-01 14:55:11 -07:00
Chris Clark
4676ade4ee Fix bug in Amount.ratio_human 2015-10-01 11:58:09 -07:00
Geert Weening
61afca2337 bump to 0.12.9 2015-09-30 16:05:29 -07:00
Geert Weening
47251bd38b update release notes 2015-09-30 15:44:38 -07:00
wltsmrz
8edc3b1f36 Merge pull request #572 from darkdarkdragon/develop-request-once
throw error if Request.request called more than once
2015-09-30 12:00:06 -07:00
Chris Clark
8acfb1a537 Merge pull request #546 from darkdarkdragon/develop-async
make Remote.getLedgerSequence asynchronous
2015-09-30 11:18:49 -07:00
Ivan Tivonenko
ac78171099 make orderbook use Remote.getLedgerSequenceSync
fix some variables naming in src/api
2015-09-30 07:46:30 +03:00
Ivan Tivonenko
d573c5746b refactor getLedgerVersionHelper 2015-09-30 07:07:46 +03:00
Ivan Tivonenko
51e8f9a87a make Remote.getLedgerSequence asynchronous 2015-09-30 07:05:39 +03:00
Ivan Tivonenko
bfe590d96d copy message from Error instance into RippleError 2015-09-30 06:34:58 +03:00
Ivan Tivonenko
60e2d10775 throw error if Request.request called more than once 2015-09-30 06:29:07 +03:00
Chris Clark
2f432cef62 Merge pull request #571 from clark800/fix-pathfind-queue
Fix pathfind queuing and add unit test
2015-09-29 15:22:38 -07:00
Chris Clark
5217b66396 Fix pathfind queuing and add unit test 2015-09-29 12:54:23 -07:00
Chris Clark
b8bb191d24 Merge pull request #566 from clark800/refactor
Decouple UInt160 from account.js and amount.js
2015-09-28 14:15:50 -07:00
Chris Clark
8070a52dc7 Merge pull request #568 from ripple/revert-max-ledger
Revert "Set default maxLedgerVersion to last closed ledger when reque…
2015-09-28 13:27:57 -07:00
wltsmrz
3205f3cf8c Merge pull request #570 from darkdarkdragon/develop-before-once
make sure that 'before' event emitted from Request only once
2015-09-28 12:06:15 -07:00
Alan Cohen
e0cdd610dd Set default max ledger to -1 when requesting account_tx
-1 means up to the most recent available _validated_ ledger for ledger_index_max

account_tx operates only on valided ledgers
2015-09-28 10:35:33 -07:00
Ivan Tivonenko
ed3b04ed6f make sure that 'before' event emitted from Request only once 2015-09-28 03:00:59 +03:00
Alan Cohen
62a2d2ae39 Revert "Set default maxLedgerVersion to last closed ledger when requesting account_tx"
This reverts commit 90b53002aa.

account_tx operates against validated ledgers only
2015-09-25 20:18:36 -07:00
Geert Weening
e2c853e40d Bump version to 0.13.0-rc11 2015-09-25 17:05:22 -07:00
Geert Weening
b9b5a71869 Update release notes 2015-09-25 17:01:58 -07:00
Geert Weening
87fdbc932f Merge pull request #567 from clark800/fix-crash
Fix crash due to rippled slowDown error
2015-09-25 16:59:42 -07:00
Chris Clark
84838b2e9f Fix crash due to rippled slowDown error 2015-09-25 16:41:37 -07:00
Chris Clark
c2ca37a790 Fix lint errors in meta.js and serializedtypes.js 2015-09-25 12:42:13 -07:00
Chris Clark
c6805b9f0d Decouple UInt160 from amount.js 2015-09-25 12:42:13 -07:00
Chris Clark
b1dbdc03dd Decouple UInt160 from account.js 2015-09-25 12:42:10 -07:00
Chris Clark
88a3f3d43b Merge pull request #565 from clark800/value
Use ripple-lib-value package and update ripple-lib-transactionparser dependency
2015-09-25 12:39:03 -07:00
Chris Clark
5f8dcd71a5 Merge pull request #564 from darkdarkdragon/develop-master-merge-2
Merge branch 'master' into develop
2015-09-24 13:58:11 -07:00
Ivan Tivonenko
45db95da79 put back UInt160 in AutobridgeCalculator
fix lint issues
2015-09-24 23:49:32 +03:00
Chris Clark
c79b12b27f Use ripple-lib-value package and update ripple-lib-transactionparser dependency 2015-09-24 12:32:15 -07:00
Chris Clark
135da6108d Merge pull request #563 from clark800/keypairs
Move to new ripple-keypairs API
2015-09-24 11:53:20 -07:00
Ivan Tivonenko
0d6dda579f Merge branch 'master' into develop 2015-09-24 20:04:18 +03:00
Chris Clark
e641a347db Merge pull request #561 from darkdarkdragon/master-performance-2
more OrderBook performance optimizations
2015-09-23 17:14:44 -07:00
Ivan Tivonenko
3e17d91edf more OrderBook performance optimizations
OrderBook: emit 'model' event only after last transaction in closed ledger
run AutobridgeCalculator only once in a ledger
2015-09-24 02:50:48 +03:00
Chris Clark
715c648d52 Move to new ripple-keypairs API 2015-09-23 14:30:56 -07:00
Geert Weening
d0ebed9822 bump version to 0.12.8 2015-09-23 11:51:42 -07:00
Geert Weening
a3775f18ba update release notes 2015-09-23 11:51:29 -07:00
wltsmrz
7b5d6e9fc5 Merge pull request #562 from wltsmrz/add-reconnect-test
Add test for Server automatic reconnection
2015-09-22 21:52:11 -07:00
wltsmrz
368ac0b9e0 Merge pull request #560 from wltsmrz/fix-connect-when-already-connected
Always call Remote.connect() callback
2015-09-22 21:51:30 -07:00
wltsmrz
0448696bd8 Merge pull request #552 from wltsmrz/update-multisigning
Autofill LastLedgerSequence for multisigned transactions
2015-09-22 21:50:53 -07:00
wltsmrz
deb75ed0d7 Add test for Server automatic reconnection 2015-09-22 19:48:25 -07:00
Geert Weening
fcc9bacb4e bump version to 0.13.0-rc10 2015-09-22 18:33:48 -07:00
wltsmrz
9a5e8fd2ba Merge pull request #558 from clark800/wss
Add pattern for servers option
2015-09-22 18:25:17 -07:00
wltsmrz
1c023c4377 Always call Remote.connect() callback
Fixes non-resolving Promise in RippleAPI.connect()
2015-09-22 18:22:28 -07:00
Chris Clark
c213b98329 Add pattern for servers option 2015-09-21 17:34:39 -07:00
Alan Cohen
27d2e6e519 Merge pull request #557 from clark800/ledger-close
Add ledgerClosed event
2015-09-21 15:33:44 -07:00
Chris Clark
7ee368965c Add ledgerClosed event 2015-09-21 14:38:51 -07:00
Alan Cohen
d8b5b825b3 Update verison to 0.13.0-rc9 2015-09-21 10:48:03 -07:00
wltsmrz
de67570230 Autofill LastLedgerSequence for multisigned transactions 2015-09-21 10:26:00 -07:00
Chris Clark
60c604fbe6 Merge pull request #536 from sentientwaffle/dj/suspay
suspended payments
2015-09-18 10:58:10 -07:00
sentientwaffle
2f6d25ed01 lint 2015-09-18 10:52:00 -07:00
sentientwaffle
b134081293 Add SuspendedPayment{Create,Finish,Cancel}
* Add SusPay core tests
* Rename SusPay -> SuspendedPayment (code review)
* Rename cancelAfter -> allowCancelAfter
* Rename suspendedPayment{Finish,Execution}
2015-09-18 10:51:34 -07:00
Chris Clark
a0528d7f9c Merge pull request #553 from darkdarkdragon/develop-master-merge
Merge OrderBook optimizations from master to develop
2015-09-18 10:41:22 -07:00
Alan Cohen
348335ddf0 Merge pull request #556 from clark800/tel-fix
Remove "tel" errors from submit's immediate failure category
2015-09-17 17:20:42 -07:00
Ivan Tivonenko
01752e5486 fix eslint errors 2015-09-18 03:15:09 +03:00
Chris Clark
3e758e1b86 Remove "tel" errors from submit's immediate failure category 2015-09-17 17:06:12 -07:00
Chris Clark
fb0b30a9a7 Merge pull request #555 from lumberj/add-data-to-error
RippleAPI: Add data property to error object
2015-09-17 16:29:12 -07:00
Alan Cohen
0c9aea454e RippleAPI: Add data property to error object 2015-09-17 16:05:43 -07:00
Geert Weening
f282585c3f Bump version to 0.12.7
bump dependencies and regenerate shrinkwrap
2015-09-17 10:30:23 -07:00
Geert Weening
ae5ff31c96 Update release notes 2015-09-17 10:20:52 -07:00
Ivan Tivonenko
20fa8bc953 optimize AutobridgeCalculator and Amount for speed 2015-09-17 19:06:47 +03:00
Alan Cohen
778f59b4fd Merge pull request #535 from clark800/submit-error
Return promise error if submit result is an immediate failure
2015-09-16 17:53:35 -07:00
Chris Clark
49623cb4dd Merge pull request #550 from lumberj/max-ledger-sequence
Set default maxLedgerVersion to last closed ledger when requesting ac…
2015-09-16 17:11:11 -07:00
Alan Cohen
90b53002aa Set default maxLedgerVersion to last closed ledger when requesting account_tx 2015-09-16 16:45:25 -07:00
Alan Cohen
93c12af305 Merge pull request #548 from lumberj/check-disjoint
Add PendingLedgerVersionError
2015-09-16 16:29:46 -07:00
Alan Cohen
60f2419b5c Add PendingLedgerVersionError
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.
2015-09-16 15:57:55 -07:00
Chris Clark
80494ad813 Return promise error if submit result is an immediate failure 2015-09-16 15:56:24 -07:00
Alan Cohen
b43c4a7ad4 Merge pull request #549 from lumberj/validated-tx
Do not return non-validated transaction from RippleAPI#getTransaction
2015-09-16 12:29:23 -07:00
Alan Cohen
3c608de5bb Do not return non-validated transaction from RippleAPI#getTransaction 2015-09-16 12:19:20 -07:00
Chris Clark
fe5bc1d215 Merge pull request #538 from darkdarkdragon/develop-negative-error
shows event that leads to "Offer total cannot be negative" error
2015-09-16 10:26:19 -07:00
Ivan Tivonenko
580bf9a755 shows event that leads to "Offer total cannot be negative" error 2015-09-16 09:57:51 +03:00
Ivan Tivonenko
c7df5df163 make tests pass 2015-09-15 09:14:12 +03:00
Ivan Tivonenko
a08c52af55 Merge branch 'master' into develop-master-merge 2015-09-15 06:29:26 +03:00
Chris Clark
e11db0f0f3 Merge pull request #547 from vhpoet/develop
Remote: Add LowFreeze, HighFreeze flags
2015-09-14 16:59:20 -07:00
Vahe Hovhannisyan
c6e0582729 Remote: Add LowFreeze, HighFreeze flags 2015-09-14 16:57:13 -07:00
wltsmrz
6e98629f9b Merge pull request #543 from darkdarkdragon/develop-reconnect
resend request in case server was disconnected after request was sent
2015-09-13 02:14:22 -07:00
sublimator
2243760442 Merge pull request #541 from wltsmrz/add-tecOVERSIZE
Add tecOVERSIZE transaction result
2015-09-13 16:11:26 +07:00
wltsmrz
91dd6877aa Add tecOVERSIZE transaction result 2015-09-13 02:07:53 -07:00
sublimator
e73bcd8fc1 Merge pull request #545 from wltsmrz/add-multisign
Add multisign helpers
2015-09-13 15:10:19 +07:00
wltsmrz
7e886b3260 Add multisign helpers 2015-09-13 00:59:27 -07:00
Ivan Tivonenko
5c9451d3ed allow Request.request(callback) 2015-09-12 22:18:52 +03:00
wltsmrz
c6c2dcc6c0 Merge pull request #533 from clark800/webpack-net-fix
Fix browser build
2015-09-11 13:15:58 -07:00
wltsmrz
0bdd37090e Merge pull request #537 from darkdarkdragon/master-performance
Optimize performance (for 0.12 master branch)
2015-09-10 17:04:16 -07:00
Ivan Tivonenko
c745faaaf0 optimize baseconverter , OrderBook and AutobridgeCalculator for speed 2015-09-11 02:34:48 +03:00
Alan Cohen
9ad03ca873 Bump version to 0.13.0-rc8 2015-09-09 13:22:18 -07:00
wltsmrz
138914384e Merge pull request #531 from clark800/fix-pathfind-queue
Fix queueing of pathfind requests
2015-09-09 13:09:34 -07:00
Ivan Tivonenko
77068667e4 move reconnect logic from Request.callback to Request.request 2015-09-09 21:16:10 +03:00
Ivan Tivonenko
c57cef4a21 resend request in case server was disconnected after request was sent 2015-09-09 02:22:02 +03:00
Alan Cohen
50acc4c708 Merge pull request #542 from lumberj/fix-destination_currencies
Fix: Check for destination_currencies property
2015-09-08 16:04:54 -07:00
Alan Cohen
b5f8ba4817 Fix: Check for destination_currencies property
Example stack:

TypeError: Cannot read property 'join' of undefined
    at formatResponse
    (ripple-lib/dist/npm/api/ledger/pathfind.js:75:187)
2015-09-08 16:02:23 -07:00
Alan Cohen
a53249ccd7 Bump version to 0.13.-rc7 2015-09-03 14:04:07 -07:00
Ivan Tivonenko
0c62fa2112 remove Firefox warning about prototype overwrite 2015-09-01 01:34:59 +03:00
Ivan Tivonenko
806547dd15 fix Amount compare bug
return 0 if values not comparable
2015-09-01 01:29:37 +03:00
Chris Clark
fb1669b2b3 Merge pull request #534 from clark800/prepare
Return instructions in prepare responses
2015-08-28 15:31:59 -07:00
Chris Clark
0cda15f2b5 Update is-my-json-valid depedency to fix webpack issue 2015-08-28 14:18:02 -07:00
Chris Clark
b88e9370c6 Return instructions in prepare responses 2015-08-28 14:11:02 -07:00
Chris Clark
e343f3beb8 Remove usage of fs module because it does not work in browser 2015-08-28 11:53:45 -07:00
Chris Clark
a13bfae714 Merge pull request #528 from mDuo13/min_value_abs
remove redundant abs from MIN_IOU_VALUE
2015-08-27 14:27:33 -07:00
mDuo13
877c6bbb2a amount min/max - more tests 2015-08-27 14:06:47 -07:00
Chris Clark
30d5134394 Fix require failure in browser code due to proxy library 2015-08-27 11:57:15 -07:00
Chris Clark
fae5c74487 Merge pull request #530 from clark800/remove-methods
Remove computeLedgerHash and isValidAddress from API
2015-08-26 17:57:15 -07:00
Chris Clark
255332ea2e Fix queueing of pathfind requests 2015-08-26 17:38:11 -07:00
Chris Clark
15c0e6db19 Remove computeLedgerHash and isValidAddress from API 2015-08-26 17:19:09 -07:00
mDuo13
2b600a1e4e more amount minimum abs test fixes 2015-08-26 12:26:47 -07:00
mDuo13
297fb2483d fix test for amount min 2015-08-25 17:38:32 -07:00
mDuo13
5049822415 remove redundant abs from MIN_IOU_VALUE 2015-08-25 17:14:33 -07:00
Chris Clark
e3787e0f4f Merge pull request #527 from clark800/fix-getpaths
Use maxAmount in getPaths results so they can be passed to preparePayment
2015-08-25 15:18:21 -07:00
Chris Clark
683199044b Use maxAmount in getPaths results so they can be passed to preparePayment 2015-08-25 15:14:06 -07:00
sublimator
4f3c3e9f66 Merge pull request #524 from wltsmrz/deprecate-positional-api
Deprecate positional request constructor API
2015-08-25 20:52:59 +07:00
wltsmrz
fc0240c06b Deprecate positional request constructor API 2015-08-25 06:42:47 -07:00
sublimator
6bfa284bac Merge pull request #526 from sublimator/update-legacy-support
Update legacy-support & JSDoc comments
2015-08-25 20:18:06 +07:00
Nicholas Dudfield
dfee9bc578 Update legacy-support & JSDoc comments 2015-08-25 20:14:14 +07:00
Chris Clark
0838a0e865 Merge pull request #525 from clark800/test-compiled
Fix testing of compiled library
2015-08-24 17:57:50 -07:00
Chris Clark
5f61d80e2d Fix bugs in compiled library 2015-08-24 17:38:30 -07:00
Chris Clark
c4fa4c237c Compile test cases to run tests without using Babel 2015-08-24 16:58:50 -07:00
Geert Weening
44d00d5ef4 Bump version to 0.13.0-rc6 2015-08-24 14:24:48 -07:00
Geert Weening
d4d3efcb65 Update releas notes 2015-08-24 14:24:40 -07:00
Geert Weening
f23e105240 Merge branch 'develop' into release 2015-08-24 13:47:00 -07:00
Chris Clark
5a396a7060 Merge pull request #517 from darkdarkdragon/develop-RLJS-463
Add schema for RippleAPI constructor options
2015-08-24 11:39:21 -07:00
Ivan Tivonenko
513632299f Add schema for RippleAPI constructor options 2015-08-24 21:29:50 +03:00
Chris Clark
0d40558f1e Merge pull request #522 from clark800/srcActNotFound-pathfind
Fix: Emit error events and return error on pathfind
2015-08-21 14:26:19 -07:00
Alan Cohen
1ccbaf6776 Fix: Emit error events and return error on pathfind 2015-08-21 14:24:13 -07:00
sublimator
ba6c703163 Merge pull request #518 from darkdarkdragon/develop-RLJS-467
Allow to specify server url without explicit port number
2015-08-21 20:41:25 +07:00
sublimator
3b9eb02bbb Merge pull request #520 from sublimator/ledger-select
Update ledgerSelect to throw if ledger arg is unrecognized
2015-08-21 17:34:35 +07:00
Nicholas Dudfield
bca7382015 Update ledgerSelect to throw if ledger arg is unrecognized 2015-08-21 15:31:14 +07:00
wltsmrz
67672bd389 Merge pull request #519 from sublimator/hackz
Move positional args wrappers into legacy-support module
2015-08-21 14:19:50 +07:00
Nicholas Dudfield
232017d9a2 Move positional args wrappers into legacy-support module 2015-08-21 14:06:32 +07:00
Ivan Tivonenko
23653f67f0 Allow to specify server url without explicit port number 2015-08-21 06:39:48 +03:00
Chris Clark
e3b688d1dd Merge pull request #516 from darkdarkdragon/develop-server-info-schema-fix
fix get-server-info.json schema
2015-08-20 17:40:03 -07:00
Ivan Tivonenko
a94b21ca3c fix get-server-info.json schema 2015-08-21 03:36:04 +03:00
Geert Weening
9c9be3e6e4 Bump version to 0.13.0-rc5 2015-08-20 13:46:11 -07:00
Chris Clark
062561686e Update release notes 2015-08-20 11:49:04 -07:00
Geert Weening
761682c206 Merge branch 'develop' into release 2015-08-20 10:18:22 -07:00
Chris Clark
39c48d631c Merge pull request #513 from darkdarkdragon/develop-parse-trustline-fix
fix parseTrustline for case when no QualityIn or QualityOut are set i…
2015-08-19 11:20:32 -07:00
Ivan Tivonenko
a55d26a726 fix parseTrustline for case when no QualityIn or QualityOut are set in transaction 2015-08-19 21:17:50 +03:00
Chris Clark
597ae157b3 Merge pull request #515 from darkdarkdragon/develop-isvalidaddress-fix
in isValidAddress check that address starting with 'r'
2015-08-19 10:56:40 -07:00
wltsmrz
c1c7458914 Merge pull request #514 from sublimator/eslint-1.2.0
Update eslint to 1.2.0
2015-08-19 16:28:14 +07:00
Ivan Tivonenko
0e97f269ab in isValidAddress check that address starting with 'r'
because UInt160 considers valid hex values
2015-08-19 05:26:08 +03:00
Nicholas Dudfield
bbe4cd63a1 Update eslint to 1.2.0 2015-08-19 08:41:35 +07:00
Chris Clark
2515d17a85 Merge pull request #509 from clark800/generate-address
Rename generateWallet to generateAddress
2015-08-18 18:11:22 -07:00
Chris Clark
d8e95a3c3b Rename generateWallet to generateAddress 2015-08-18 17:44:10 -07:00
Chris Clark
98f6bed8c9 Merge pull request #511 from darkdarkdragon/develop-filter-fix
fix transactionFilter
2015-08-18 17:21:17 -07:00
Ivan Tivonenko
bd000c2662 fix transactionFilter 2015-08-19 03:15:10 +03:00
Chris Clark
a46141111a Merge pull request #512 from clark800/validate-address
Add isValidAddress
2015-08-18 14:48:44 -07:00
Chris Clark
f57c89c6e9 Add isValidAddress 2015-08-18 14:46:11 -07:00
Chris Clark
6d4cac948d Merge pull request #504 from clark800/get-ledger
Add getLedger method, remove getLedgerHeader method
2015-08-18 10:01:22 -07:00
Chris Clark
1f54b3a0cf Rename ledger "account" to "state" 2015-08-17 18:41:22 -07:00
Chris Clark
2f8655dc23 Add getLedger method, remove getLedgerHeader method 2015-08-17 18:39:34 -07:00
sublimator
d624923cd8 Merge pull request #510 from clark800/underscore-fixes
Fix snake case method calls
2015-08-18 07:33:56 +07:00
Chris Clark
2180c076dd Fix snake case method calls 2015-08-17 17:28:16 -07:00
Chris Clark
0dbdf0a21a Merge pull request #503 from darkdarkdragon/develop-RLJS-444-01
annotate api functions with types
2015-08-17 14:34:12 -07:00
Ivan Tivonenko
5cb63a258c annotate api functions with types 2015-08-17 20:51:03 +03:00
Chris Clark
39ac6caaef Merge pull request #506 from sublimator/uint-scraggles
Remove UInt#from_bn
2015-08-17 10:04:18 -07:00
Chris Clark
de4ef8b2b4 Merge pull request #505 from sublimator/reserve
[WIP] Fix reserve calculation
2015-08-17 10:01:10 -07:00
Nicholas Dudfield
99cba09a4a Remove UInt#from_bn 2015-08-16 21:31:46 +07:00
Nicholas Dudfield
300967f0f3 [WIP] Fix lint issues 2015-08-15 18:15:36 +07:00
Nicholas Dudfield
52879febb9 [WIP] Fix reserve calculation 2015-08-15 18:11:43 +07:00
Chris Clark
f077a563c4 Merge pull request #498 from clark800/compute-ledger-hash
Add computeLedgerHash method
2015-08-14 14:43:57 -07:00
Chris Clark
92fbc61f47 Add computeLedgerHash method 2015-08-14 14:25:56 -07:00
Chris Clark
5ac1bcc414 Merge pull request #502 from sublimator/hash.js
Remove sjcl-extended/ripple-wallet-generator. Use hash.js & sjcl-codec.
2015-08-14 11:14:33 -07:00
Nicholas Dudfield
5837aa23ea Remove sjcl-extended/ripple-wallet-generator. Use hash.js & sjcl-codec. 2015-08-14 09:31:49 +07:00
Chris Clark
8c431b4ec3 Merge pull request #499 from clark800/validated-ledger
Get validated ledger in getSettings and getAccountInfo
2015-08-13 13:20:55 -07:00
sublimator
25086a7944 Merge pull request #501 from sublimator/bn.js
Replace sjcl.bn with bn.js
2015-08-14 01:38:13 +07:00
Nicholas Dudfield
b0889b4afe Replace sjcl.bn with bn.js 2015-08-14 01:33:59 +07:00
wltsmrz
ed971bc41c Merge pull request #500 from clark800/get-ledger-header
Add getLedgerHeader method
2015-08-13 07:57:45 +07:00
Chris Clark
728595dc96 Add getLedgerHeader method 2015-08-12 17:37:13 -07:00
Chris Clark
7fc6adb776 Get validated ledger in getSettings and getAccountInfo 2015-08-12 15:58:47 -07:00
Chris Clark
002102ce62 Merge pull request #494 from clark800/streaming-pathfinding
Use streaming pathfinding: rippled path_find instead of ripple_path_find
2015-08-12 13:14:13 -07:00
Chris Clark
bf9da80d46 Fix lint errors in remote.js and pathfind.js 2015-08-12 12:34:12 -07:00
Chris Clark
dda9994869 Use streaming pathfinding: rippled path_find instead of ripple_path_find 2015-08-12 12:34:08 -07:00
sublimator
4c76ad159e Merge pull request #495 from sublimator/ripple-keypairs
Use ripple-keypairs and ripple-address-codec
2015-08-12 13:01:56 +07:00
Nicholas Dudfield
f76a8daca8 Update babel, eslint & co 2015-08-12 12:54:33 +07:00
Nicholas Dudfield
3263629ebe Use ripple-keypairs and ripple-address-codec 2015-08-12 12:54:30 +07:00
Chris Clark
fcbe7d3c98 Merge pull request #493 from clark800/max-amount-2
Rename source.amount to source.maxAmount
2015-08-10 14:29:47 -07:00
Chris Clark
a6662ccdff Rename source.amount to source.maxAmount 2015-08-10 14:15:30 -07:00
Chris Clark
854fe85151 Check for duplicate schema titles 2015-08-10 11:35:41 -07:00
Geert Weening
2b2fdf1b11 Bump version to 0.13.0-rc4 2015-08-07 15:32:21 -07:00
Geert Weening
cbe44d6a96 Update release notes 2015-08-07 15:32:21 -07:00
Geert Weening
420346faea Bump version to 0.13.0-rc3 2015-08-07 15:32:20 -07:00
Geert Weening
6220162852 Update release notes 2015-08-07 15:32:20 -07:00
Geert Weening
37198bde66 Bump version to 0.13.0-rc4 2015-08-07 15:31:56 -07:00
Geert Weening
281c056f6c Update release notes 2015-08-07 15:31:24 -07:00
Geert Weening
49a513cd07 Merge branch 'release' into develop 2015-08-07 14:47:26 -07:00
Alan Cohen
7a95aabbf4 Merge pull request #491 from lumberj/empty-paths
Don't set empty paths
2015-08-07 10:35:41 -07:00
Alan Cohen
83874ec096 Don't set empty paths
"The Paths field must not be an empty array, nor an array whose members are all
empty arrays."
https://ripple.com/build/transactions/#paths

Fix test file lint errors
2015-08-07 10:26:45 -07:00
Chris Clark
9270d0a33d Merge pull request #490 from clark800/test-dist
Clean up package.json
2015-08-06 15:30:09 -07:00
Chris Clark
30295efdb4 Clean up package.json 2015-08-06 15:09:49 -07:00
Chris Clark
f1342c1456 Merge pull request #489 from clark800/test-compiled
Test compiled code in dist/npm on CI server
2015-08-06 15:02:56 -07:00
Chris Clark
194b73c293 Test compiled code in dist/npm on CI server 2015-08-06 14:59:48 -07:00
Chris Clark
89e5f79bbb Merge pull request #487 from clark800/orderbook-changes
Switch to direction/quantity/totalPrice for orderbookChanges
2015-08-06 14:53:18 -07:00
Chris Clark
82d7ce7ac2 Switch to direction/quantity/totalPrice for orderbookChanges 2015-08-06 12:27:03 -07:00
Geert Weening
0cc4c704f8 Merge pull request #482 from clark800/deprecate
Deprecate core
2015-08-06 11:35:12 -07:00
Chris Clark
dde762a1d6 Merge pull request #483 from clark800/fix-prepare-trustline
Fix prepareTrustline with no quality setting
2015-08-06 10:40:34 -07:00
Chris Clark
1c86e246c7 Merge pull request #484 from darkdarkdragon/develop-schema-fix
small adjustment.json schema fix
2015-08-05 16:31:27 -07:00
Ivan Tivonenko
2d173c8e69 small adjustment.json schema fix 2015-08-06 02:25:59 +03:00
Chris Clark
600fd34d30 Fix prepareTrustline with no quality setting 2015-08-05 15:42:48 -07:00
Geert Weening
4cb9cf801c Bump version to 0.13.0-rc3 2015-08-04 17:20:25 -07:00
Geert Weening
50fb8789b4 Update release notes 2015-08-04 17:06:57 -07:00
Chris Clark
fb8dc44ec1 Deprecate core 2015-08-04 16:57:39 -07:00
Geert Weening
0781caa8bc Merge pull request #481 from clark800/pathfind-fix
Add test case for createPathFind and convert snake case function calls to camel case
2015-08-04 16:57:18 -07:00
Chris Clark
2cdb23f0dd Fix lint errors in pathfind.js 2015-08-04 15:51:52 -07:00
Chris Clark
8e536c00b9 Add test case for createPathFind and convert snake case function calls to camel case 2015-08-04 15:51:18 -07:00
Geert Weening
8ff154cc2d Merge pull request #480 from clark800/promise-docs
Update RippleAPI documentation for promises
2015-08-04 15:29:08 -07:00
Chris Clark
daaae6e01e Update RippleAPI documentation for promises 2015-08-04 14:53:46 -07:00
Chris Clark
a64a4e697a Merge pull request #478 from clark800/promises
Convert API to promises
2015-08-04 11:32:52 -07:00
wltsmrz
3f51d8cc12 Merge pull request #479 from wltsmrz/fix-validated-ledgers-single-ledger
Fix RangeSet for validated_ledger as single ledger
2015-08-05 00:48:48 +07:00
wltsmrz
9f9e76f8b9 Fix RangeSet for validated_ledger as single ledger 2015-08-04 10:45:29 -07:00
sublimator
5b51db158d Merge pull request #476 from clark800/badge
Replace Travis badge with CircleCI badge
2015-08-04 07:44:59 +07:00
Chris Clark
a4d1509448 Replace Travis badge with CircleCI badge 2015-08-03 17:39:01 -07:00
Chris Clark
bbd51a03b6 Convert API to promises 2015-08-03 17:22:17 -07:00
sublimator
b55b82b2fd Merge pull request #474 from shekenahglory/develop
add 'DeliveredAmount' as optional metadata field
2015-08-01 06:30:36 +07:00
Matthew Fettig
fdb0f101bd add 'DeliveredAmount' as optional metadata field 2015-07-31 16:21:18 -07:00
Chris Clark
0afca5633d Merge pull request #473 from clark800/remove-slippage
Remove slippage parameter
2015-07-31 11:06:32 -07:00
Chris Clark
7c0d9a7172 Remove slippage parameter 2015-07-31 10:43:39 -07:00
sublimator
f6b7e27c67 Merge pull request #472 from clark800/offline
Add unit test for offline prepare and sign
2015-07-31 08:47:29 +07:00
Chris Clark
b8624bc55f Add unit test for offline prepare and sign 2015-07-30 18:19:52 -07:00
sublimator
2eec30756d Merge pull request #471 from clark800/no-xrp-paths
Don't set paths for XRP to XRP payment
2015-07-31 06:46:12 +07:00
sublimator
6b44ce8973 Merge pull request #458 from clark800/fix-pathfind
Fix counterparty logic in pathfind parsing
2015-07-31 06:26:58 +07:00
Chris Clark
ed0b501716 Don't set paths for XRP to XRP payment 2015-07-30 13:43:44 -07:00
Geert Weening
0fd391af72 bump version to 0.13.0.rc2 2015-07-30 12:18:48 -07:00
Chris Clark
fe9c1ada88 Fix counterparty logic in pathfind parsing 2015-07-30 11:55:52 -07:00
Alan Cohen
4c1f4ef58c Merge pull request #470 from clark800/remove-asyncify
Remove simple-asyncify dependency
2015-07-30 11:47:03 -07:00
Chris Clark
10afc770ff Remove simple-asyncify dependency 2015-07-30 11:38:46 -07:00
Alan Cohen
8543e60f86 Merge pull request #469 from lumberj/update-flow
Update Flow to 0.14
2015-07-30 11:09:57 -07:00
Alan Cohen
116d7e0f29 Update Flow to 0.14
Fixes issue with fs.readFileSync return type
See: https://github.com/facebook/flow/issues/416
https://github.com/facebook/flow/compare/v0.13.1...v0.14.0
2015-07-30 10:06:53 -07:00
Chris Clark
68adaec55b Merge pull request #467 from darkdarkdragon/develop-RLJS-440
change snake_case to camelCase in responses from api.submit and api.g…
2015-07-29 17:31:36 -07:00
Ivan Tivonenko
03640efef5 change snake_case to camelCase in responses from api.submit and api.getServerInfo and add schema for it 2015-07-30 03:10:10 +03:00
Alan Cohen
c6f450842e Merge pull request #466 from lumberj/continue-flowing
Typecheck remaining files in src/api
2015-07-29 16:03:15 -07:00
Alan Cohen
e583eb4592 Typecheck remaining files in src/api 2015-07-29 15:59:07 -07:00
Chris Clark
7fffbe0c64 Merge pull request #465 from darkdarkdragon/develop-RLJS-370-12
more unit tests coverage
2015-07-29 11:22:06 -07:00
Ivan Tivonenko
63e3b71eb5 cover api/common/errors.js with tests 2015-07-29 21:15:28 +03:00
Ivan Tivonenko
823ef738fe cover api/common/utils.js with tests 2015-07-29 17:40:59 +03:00
Ivan Tivonenko
0977ef0ec2 cover api/common/validate.js with tests 2015-07-29 17:15:34 +03:00
Ivan Tivonenko
cecf3f3d22 cover api/ledger/parse/utils.js with tests 2015-07-29 16:42:23 +03:00
Ivan Tivonenko
472fbce23a cover api/ledger/parse/trustline.js with tests 2015-07-29 15:46:15 +03:00
sublimator
e44aea1767 Merge pull request #464 from wltsmrz/add-delivermin
Add DeliverMin setter
2015-07-29 14:52:56 +07:00
wltsmrz
d682d90d86 Add DeliverMin setter 2015-07-29 00:25:27 -07:00
Chris Clark
141aa17dfc Merge pull request #463 from darkdarkdragon/develop-RLJS-370-11
cover api/common/schema-validator.js with tests
2015-07-28 17:40:48 -07:00
Ivan Tivonenko
0b09e53479 cover api/common/schema-validator.js with tests 2015-07-29 03:22:17 +03:00
Chris Clark
528d8bf25d Merge pull request #457 from darkdarkdragon/develop-sign-with-regular-key
allow to sign transaction in api.sign using regular key
2015-07-28 15:53:37 -07:00
Ivan Tivonenko
03a2109e24 allow to sign transaction in api.sign using regular key
make Seed.parse_json try different input types instead
of stopping on first failing
2015-07-29 01:49:25 +03:00
Chris Clark
b38b9bced6 Merge pull request #462 from darkdarkdragon/develop-RLJS-370-10
cover api/ledger/parse/settings.js with tests
2015-07-28 14:05:04 -07:00
Ivan Tivonenko
ea063d0c95 cover api/ledger/parse/settings.js with tests 2015-07-28 22:21:25 +03:00
Chris Clark
7f93929014 Merge pull request #461 from lumberj/update-parser
Update ripple-lib-transactionparser to 0.4
2015-07-28 11:23:06 -07:00
Alan Cohen
4cd10ecb87 Update ripple-lib-transactionparser to 0.4 2015-07-28 09:55:01 -07:00
sublimator
6ef30debd2 Merge pull request #459 from wltsmrz/fix-transaction-constructor
Fix transaction construction for SetRegularKey transactions
2015-07-28 14:50:58 +07:00
wltsmrz
4766bace4e Fix transaction construction for SetRegularKey transactions 2015-07-28 00:47:30 -07:00
sublimator
261500a3a4 Merge pull request #460 from wltsmrz/fix-transaction-sequencing
Fix transaction sequencing
2015-07-28 14:37:32 +07:00
wltsmrz
fae22b7023 Fix transaction sequencing 2015-07-27 23:17:05 -07:00
Chris Clark
4568b39997 Merge pull request #450 from clark800/api-names
Rename API parameters
2015-07-27 17:06:14 -07:00
Chris Clark
4a218cacfa Merge pull request #449 from clark800/numbers
Express trustline quality and account transferRate as floats
2015-07-27 17:02:35 -07:00
Chris Clark
34a4dd3077 Express transferRate as a float 2015-07-27 16:59:58 -07:00
Chris Clark
a383bd7e52 Express trustline quality as a float 2015-07-27 16:56:46 -07:00
Chris Clark
e76e693bdb Merge pull request #452 from darkdarkdragon/develop-RLJS-370-9-1
Increase tests coverage even more
2015-07-27 16:35:59 -07:00
Ivan Tivonenko
2c52e4aa69 more unit tests coverage 2015-07-28 02:24:27 +03:00
Ivan Tivonenko
13dee36e93 propagate message from remote error to RippledNetworkError 2015-07-28 02:17:40 +03:00
Ivan Tivonenko
6e180439d1 cover api/ledger/transaction.js with unit tests 2015-07-28 02:17:38 +03:00
Ivan Tivonenko
e8d0c1ae95 make api.getTransaction return NotFound error in case of transaction not found
instead of core.RippleError
2015-07-28 02:16:30 +03:00
Ivan Tivonenko
068bda0c95 cover api/ledger/transactions.js with unit tests 2015-07-28 02:16:28 +03:00
Ivan Tivonenko
ab694381d5 fix some api functions to work with parsed version of transaction 2015-07-28 02:13:54 +03:00
Chris Clark
dc2a6c75cf Merge pull request #456 from clark800/docs
Update api.html doc
2015-07-27 14:57:13 -07:00
Chris Clark
98dbba8f27 Add api.html doc 2015-07-27 14:54:15 -07:00
Chris Clark
9a1b80d77a Merge pull request #451 from clark800/sample
Add sample API usage for getting balances and making a payment
2015-07-27 14:46:59 -07:00
Chris Clark
a655be30d6 Merge pull request #455 from clark800/doc
Add api.html
2015-07-27 14:46:50 -07:00
Chris Clark
e5aabc3072 Add api.html 2015-07-27 14:42:29 -07:00
Chris Clark
2cd32d58ad Merge pull request #454 from clark800/response-schemas
Add response schemas and small fixes
2015-07-27 14:22:55 -07:00
Chris Clark
0c02b92717 Add response schemas and small fixes 2015-07-27 14:20:09 -07:00
Geert Weening
c58a077a2f Merge branch 'release' into develop 2015-07-24 15:39:50 -07:00
Geert Weening
6e7dc9d7d3 Merge branch 'master' into release
Conflicts:
	npm-shrinkwrap.json
	package.json
2015-07-24 15:39:00 -07:00
Geert Weening
572c945274 Bump version to 0.12.6 2015-07-24 15:32:07 -07:00
Geert Weening
c605efab61 Update release notes 2015-07-24 15:31:59 -07:00
wltsmrz
2695f4302a Merge pull request #436 from wltsmrz/fix-orderbook-notification
Fix orderbook notification while disconnected
2015-07-25 06:25:31 +08:00
Chris Clark
a17011243e Fix webpack require failure due to "./" notation 2015-07-24 15:24:40 -07:00
Geert Weening
9a533ab807 Merge branch 'develop' into release 2015-07-24 15:22:35 -07:00
wltsmrz
a037952493 Fix orderbook notification while disconnected 2015-07-24 15:22:21 -07:00
Geert Weening
dc96795a02 Merge pull request #453 from clark800/webpack-fix
Fix webpack require failure due to "./" notation
2015-07-24 15:03:44 -07:00
Chris Clark
8d9746d7b1 Fix webpack require failure due to "./" notation 2015-07-24 14:59:25 -07:00
Chris Clark
00342c4239 Merge pull request #446 from darkdarkdragon/develop-RLJS-370-8
Increase tests coverage
2015-07-23 16:47:42 -07:00
Chris Clark
e48df2c1fd Add sample API usage for getting balances and making a payment 2015-07-23 15:51:15 -07:00
Ivan Tivonenko
6ade0f6554 cover api/ledger/pathfind.js with tests 2015-07-24 01:34:54 +03:00
Ivan Tivonenko
a88157bb92 change pathfind scheme so destination can be specified without counterparty 2015-07-24 01:34:51 +03:00
Ivan Tivonenko
00f318284f cover api/transaction/utils.js with tests 2015-07-24 01:34:49 +03:00
Chris Clark
2e12dc6d53 Merge pull request #445 from darkdarkdragon/develop-RLJS-370-7
fix settings.json schema to allow empty stings to
2015-07-23 15:27:50 -07:00
Chris Clark
34435d4d05 Rename API parameters 2015-07-23 14:24:11 -07:00
Ivan Tivonenko
a99452b773 fix settings.json schema to allow null to
'walletSize', 'transferRate', 'emailHash' and
'walletLocator' fields so they
can be cleared

cover api/transaction/settings.js with tests
2015-07-23 23:29:00 +03:00
Geert Weening
a05cb39ab0 Merge pull request #447 from geertweening/develop
Remove `src/js`
2015-07-23 11:12:21 -07:00
Geert Weening
0c69f7f10e Remove src/js 2015-07-23 11:06:12 -07:00
Geert Weening
8d50034265 Bump version to 0.13.0-rc1 2015-07-22 12:02:15 -07:00
Geert Weening
64f451e904 Merge branch 'release' into develop
Conflicts:
	npm-shrinkwrap.json
	package.json
2015-07-22 11:59:36 -07:00
Geert Weening
b1b47d7d91 Bump version to 0.12.5 2015-07-22 11:53:13 -07:00
Geert Weening
a93c580c92 Bump version to 0.12.5-rc3 2015-07-22 11:49:08 -07:00
Geert Weening
030e2786d1 Update release notes 2015-07-22 11:48:34 -07:00
Geert Weening
56bbe1d437 Update shrinkwrap 2015-07-22 11:42:34 -07:00
Ivan Tivonenko
1fff5ea6dc [FIX] fix AutobridgeCalculator (RT-3445)
pass issuers to AutobridgeCalculator so
it can create offers with right issuers
2015-07-22 11:28:10 -07:00
Ivan Tivonenko
ad9956375f [FIX] change var to let and const 2015-07-22 11:28:00 -07:00
Chris Clark
4787e5d29a Merge pull request #444 from darkdarkdragon/develop-RLJS-370-6
cover api/transaction/order.js with tests
2015-07-21 18:26:36 -07:00
Ivan Tivonenko
194f76d57f cover api/transaction/order.js with tests 2015-07-22 04:18:35 +03:00
Chris Clark
d2ee5cb0bc Merge pull request #443 from darkdarkdragon/develop-RLJS-370-5
cover src/api/transaction/payment.js with unit tests
2015-07-21 17:50:05 -07:00
Ivan Tivonenko
040298db2c cover src/api/transaction/payment.js with unit tests 2015-07-22 03:29:30 +03:00
Chris Clark
b4e6d4b98c Merge pull request #442 from reedrosenbluth/proxy
check if proxy option is undefined, not if it exists
2015-07-21 17:11:42 -07:00
Reed Rosenbluth
a2b31e2677 check if proxy option is undefined, not if it exists 2015-07-21 17:01:02 -07:00
Chris Clark
e997c44a18 Merge pull request #440 from darkdarkdragon/develop-RLJS-370-4
increase test coverage of Account object
2015-07-21 11:37:53 -07:00
Alan Cohen
b27011fb38 Merge pull request #441 from lumberj/add-flow-to-api
Add flow to api
2015-07-21 11:22:47 -07:00
Alan Cohen
b477eb238b Add flow-bin to dev dependencies and ignore it in flowconfig
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
2015-07-21 10:59:49 -07:00
Ivan Tivonenko
02bc256225 increase test coverage of Account object 2015-07-21 09:19:25 +03:00
sublimator
9f7293127c Merge pull request #439 from clark800/cleanup
Cleanup
2015-07-21 10:38:57 +07:00
sublimator
61a0ea7eac Merge pull request #437 from clark800/naming
Rename "incoming"/"outgoing" to "initiated"
2015-07-21 10:37:40 +07:00
sublimator
51ef93e23b Merge pull request #435 from clark800/consistency
Don't show flags that are set to false
2015-07-21 09:06:05 +07:00
Chris Clark
ab11220e27 Merge pull request #438 from reedrosenbluth/proxy
Proxy Support
2015-07-20 18:22:59 -07:00
Reed Rosenbluth
b23d588747 disable eslint for lines 538 - 548 2015-07-20 18:18:45 -07:00
Reed Rosenbluth
a71dc28523 updated shrinkwrap 2015-07-20 18:02:42 -07:00
Reed Rosenbluth
2de0e13ec5 proxy support 2015-07-20 17:39:46 -07:00
Chris Clark
d0c922ed13 Require uppercase hex for currency codes 2015-07-20 17:34:03 -07:00
Chris Clark
8c82ebec79 Use "core" instead of "utils.core" 2015-07-20 17:33:19 -07:00
Chris Clark
ddd83d10fa Don't show flags that are set to false 2015-07-20 16:52:43 -07:00
Chris Clark
031375e701 Rename "incoming"/"outgoing" to "initiated" 2015-07-20 14:59:59 -07:00
sublimator
4bc285313c Merge pull request #434 from clark800/fixes
Simplify getServerInfo response
2015-07-21 01:21:16 +07:00
Chris Clark
f42dd69b53 Simplify getServerInfo response 2015-07-20 11:15:54 -07:00
sublimator
1dae06fdd8 Merge pull request #433 from clark800/mock-fixtures
Organize rippled mock fixtures
2015-07-20 14:26:17 +07:00
Chris Clark
ff29247b9e Organize rippled mock fixtures 2015-07-17 15:36:37 -07:00
Chris Clark
d9eca203ed Merge pull request #431 from darkdarkdragon/develop-RLJS-370-2
test parseTrustline in getTransaction
2015-07-17 14:22:40 -07:00
Chris Clark
4a85182a79 Merge pull request #432 from darkdarkdragon/develop-RLJS-370-3
testing - add memo field into payment transaction so parsePaymentMemo…
2015-07-17 14:21:46 -07:00
Ivan Tivonenko
055d275f0a test parseTrustline in getTransaction 2015-07-18 00:18:35 +03:00
Ivan Tivonenko
eb7bbe5715 testing - add memo field into payment transaction so parsePaymentMemos from parsePayment is tested 2015-07-18 00:13:31 +03:00
Chris Clark
8d5752883f Merge pull request #430 from clark800/fixtures
Organize fixtures
2015-07-16 15:29:59 -07:00
Chris Clark
2b5f356de8 Organize fixtures 2015-07-16 15:02:27 -07:00
Chris Clark
c9610900fd Merge pull request #429 from darkdarkdragon/develop-RLJS-370-1
add test for getting order and order cancellation transations
2015-07-16 13:31:15 -07:00
Ivan Tivonenko
79b1a65a7b add test for getting order and order cancellation transations 2015-07-16 23:08:57 +03:00
Chris Clark
df21b9453f Merge pull request #428 from darkdarkdragon/develop-fix-transaction-parse
fix attachTransactionDate in getTransaction
2015-07-16 10:25:42 -07:00
Ivan Tivonenko
22257bdd2b fix attachTransactionDate in getTransaction 2015-07-16 05:23:56 +03:00
sublimator
aa3767b180 Merge pull request #427 from clark800/account-info
Add getAccountInfo method and move sequence field in response
2015-07-16 09:48:02 +08:00
Chris Clark
c073c2b7de Add getAccountInfo method and unit test 2015-07-15 17:13:14 -07:00
Chris Clark
529a55efb0 Remove sequence from AccountFields 2015-07-15 15:49:05 -07:00
Chris Clark
c36567e062 Merge pull request #426 from clark800/cleanup
Fix hash128 schema
2015-07-15 15:19:02 -07:00
Chris Clark
f7873f3b41 Fix hash128 schema 2015-07-15 15:15:31 -07:00
Chris Clark
6b54f1c1eb Merge pull request #423 from clark800/cleanup
Cleanup RippleAPI
2015-07-15 15:06:52 -07:00
Chris Clark
1fb1bc7404 Cleanup RippleAPI 2015-07-15 14:55:24 -07:00
Chris Clark
aa646a3acf Merge pull request #421 from clark800/bugfix
Fix parsing of settings transactions
2015-07-15 14:54:25 -07:00
Chris Clark
18ac8a9d03 Fix parsing of settings transactions 2015-07-15 14:43:04 -07:00
Chris Clark
7c357c5d52 Merge pull request #424 from clark800/disable-resubmit
Disable automatic transaction resubmission for RippleAPI
2015-07-15 14:24:18 -07:00
Chris Clark
816db9e0dc Merge pull request #425 from clark800/tx-hash
Add transaction id to response of getTransaction and getTransactions
2015-07-15 14:22:08 -07:00
Chris Clark
fa9e1de4df Add transaction id to response of getTransaction and getTransactions 2015-07-15 13:57:00 -07:00
Chris Clark
137d947606 Disable automatic transaction resubmission for RippleAPI 2015-07-15 13:45:27 -07:00
sublimator
77a05c1881 2000 2015-07-15 19:49:39 +08:00
sublimator
ab13e3fe18 Merge pull request #422 from darentuzi/patch-1
Ternary operator syntax fix
2015-07-15 19:47:22 +08:00
darentuzi
fc4b085026 Ternary operator syntax fix
let to const and syntax update
2015-07-15 14:44:41 +03:00
Chris Clark
67e8f6ab65 Merge pull request #420 from darkdarkdragon/develop-RLJS-408
Test all methods of RippleApi in integration-test
2015-07-14 17:21:37 -07:00
Ivan Tivonenko
792b30c8b5 Test all methods of RippleApi in integration-test 2015-07-15 03:17:39 +03:00
sublimator
3407aadfb8 Merge pull request #418 from clark800/ledger-gaps
Refine ledger gap detection to reduce false positives
2015-07-15 07:21:09 +08:00
sublimator
29e59ebfd2 Merge pull request #419 from clark800/set-regular-key
Add support for regularKey in prepareSettings
2015-07-14 15:29:46 +08:00
Chris Clark
286a684963 Add support for regularKey in prepareSettings 2015-07-13 16:46:57 -07:00
Chris Clark
3ef586d2d3 Refine ledger gap detection to reduce false positives 2015-07-13 15:57:50 -07:00
sublimator
5889037a71 Merge pull request #414 from clark800/merge-orderbook
Merge flipped orderbook in getOrderbook
2015-07-14 06:54:54 +08:00
sublimator
5e3f3969f5 Merge pull request #403 from clark800/no-limit
Get all results when limit is not specified
2015-07-14 06:52:20 +08:00
Chris Clark
eecf45918b Merge pull request #415 from darkdarkdragon/develop-RLJS-404
Port integration tests from ripple-rest
2015-07-13 15:50:54 -07:00
Chris Clark
6d91e6e6b2 Merge pull request #417 from darkdarkdragon/develop-fix-gettransaction-missing-history
throw MissingLedgerHistoryError in getTransaction only when ledgers a…
2015-07-13 15:43:06 -07:00
Ivan Tivonenko
7808f87060 Throw MissingLedgerHistoryError in getTransaction only when ledgers are missing prior to the last closed ledger. 2015-07-14 01:25:07 +03:00
Ivan Tivonenko
6c48b22eea Port integration tests from ripple-rest 2015-07-14 01:10:42 +03:00
Chris Clark
7344f1178b Merge flipped orderbook in getOrderbook 2015-07-13 14:09:33 -07:00
Chris Clark
5a6a3ce6e0 Merge pull request #413 from darkdarkdragon/develop-fix-gettransaction
[FIX] fix getTransaction
2015-07-13 11:06:59 -07:00
Chris Clark
f3a54bf02a Get all results when limit is not specified 2015-07-13 10:30:51 -07:00
Ivan Tivonenko
766dc5d0ce [FIX] fix getTransaction
Do not try to parse transaction if there was error

Throw NotFoundError instead of ApiError in case of ledger_index not defined.
2015-07-11 15:30:41 +03:00
wltsmrz
f8f196903a Merge pull request #406 from wltsmrz/add-resubmission-switch
Add switch to disable transaction resubmission
2015-07-11 02:22:30 +08:00
sublimator
337c41fe10 Merge pull request #400 from clark800/refactor
Refactor to make quality adjustment for XRP more clear
2015-07-11 01:48:35 +08:00
Chris Clark
fb8eefd00d Refactor to make quality adjustment for XRP more clear 2015-07-10 10:24:52 -07:00
wltsmrz
3082b959f6 Add switch to disable transaction resubmission
* Add Transaction.setResumittable(Boolean)
* Add Transaction.isResumittable() -> Boolean
* Add automatic_resubmission (Boolean) config option to Remote
2015-07-10 09:53:31 -07:00
wltsmrz
487371737c Merge pull request #408 from wilsonianb/subscribe-vals
Handle validations subscription messages
2015-07-11 00:51:36 +08:00
Chris Clark
14ccc9359d Merge pull request #410 from clark800/range-check
Check for ledger gaps in getTransactions
2015-07-09 15:19:33 -07:00
Chris Clark
665b76271c Merge pull request #411 from clark800/get-paths
Rename getPathFind to getPaths
2015-07-09 15:15:49 -07:00
Chris Clark
11ca00bb45 Check for ledger gaps in getTransactions 2015-07-09 15:14:59 -07:00
Chris Clark
046d397dfb Rename getPathFind to getPaths 2015-07-09 15:12:45 -07:00
wilsonianb
58cc01b6d3 Handle validations subscription messages 2015-07-09 15:08:39 -07:00
Chris Clark
6a3eb7b9b9 Merge pull request #409 from clark800/counterparty
Add counterparty option to getTransactions
2015-07-09 14:59:10 -07:00
Chris Clark
935a463d3b Merge pull request #407 from clark800/rangeset
Add support for efficient range checking to RangeSet
2015-07-09 13:57:47 -07:00
Chris Clark
f2f4173d7b Add support for efficient range checking to RangeSet 2015-07-09 13:51:27 -07:00
Chris Clark
941aaf6d8b Add counterparty option to getTransactions 2015-07-09 13:46:12 -07:00
Chris Clark
1068b68568 Merge pull request #404 from clark800/options-schemas
Add schemas for options for each ledger request
2015-07-08 16:59:50 -07:00
Chris Clark
e76b9a9051 Add schemas for options for each ledger request 2015-07-08 16:49:47 -07:00
Chris Clark
410ac117f6 Merge pull request #402 from clark800/get-ledger-version
Add ledgerVersion option to getSettings
2015-07-08 16:23:45 -07:00
Chris Clark
fa89c4dee8 Add ledgerVersion option to getSettings 2015-07-08 14:48:29 -07:00
Chris Clark
a464ca2368 Merge pull request #401 from clark800/get-ledger-version
Add getLedgerVersion and unit test
2015-07-08 14:21:16 -07:00
Chris Clark
befd89c3d7 Add getLedgerVersion and unit test 2015-07-08 14:05:25 -07:00
Chris Clark
49640cf282 Merge pull request #384 from mwshortt/IOU-suffix-removal
Decouple the Amount class from math performed on values
2015-07-08 12:14:05 -07:00
Madeline Shortt
2ac4549712 Rename IOUValue.js and XRPValue.js to lowercase and other fixes 2015-07-08 11:49:15 -07:00
Madeline Shortt
6bffe06c3b Change this._value to be an instance of IOU or XRP Value 2015-07-08 11:49:14 -07:00
Madeline Shortt
13e9ad45f9 Remove BigNumber completely from Amount and small changes 2015-07-08 11:49:13 -07:00
Madeline Shortt
193fcc9014 Create separate Value classes to decouple currency math and the Amount class 2015-07-08 10:25:45 -07:00
Madeline Shortt
30529b7a04 Remove IOU_SUFFIX from orderbookutils.js and clean up serializedtypes.js 2015-07-08 10:25:45 -07:00
sublimator
38b254e7f0 Merge pull request #399 from clark800/rename
Rename getAccountTransactions to getTransactions
2015-07-08 09:08:16 +07:00
sublimator
c4b98d2139 Merge pull request #398 from clark800/orders
Add makerExchangeRate (quality) to orders, and maker to account orders
2015-07-08 08:55:41 +07:00
Chris Clark
1309b58592 Add makerExchangeRate (quality) to orders, and maker to account orders 2015-07-07 18:28:37 -07:00
Chris Clark
9b9d2dc32b Rename getAccountTransactions to getTransactions 2015-07-07 17:52:28 -07:00
Chris Clark
73020fb8ae Merge pull request #397 from lukeburns/develop
Added issuer to payment example in guide
2015-07-07 14:00:02 -07:00
sublimator
8221db833f Merge pull request #391 from clark800/get-pathfind
Convert getPathFind and add unit test
2015-07-07 13:16:16 +07:00
Chris Clark
09b10d3f2c Convert getPathFind and add unit test 2015-07-06 16:11:23 -07:00
Luke Burns
c31798c7f8 changed currency to USD in submit payment example 2015-07-03 00:43:46 -04:00
Luke Burns
064c5e9e50 added issuer to submit payment example 2015-07-02 23:21:19 -04:00
Chris Clark
077a53475d Merge pull request #392 from clark800/server
Convert server methods, add unit tests, and cleanup
2015-07-02 11:23:29 -07:00
Chris Clark
32ca23a00b Convert server methods, add unit tests, and cleanup 2015-07-02 11:17:06 -07:00
Chris Clark
1a7cdd7d04 Merge pull request #396 from sublimator/eslint-update
Use parser: babel-eslint which supports facebook flow
2015-07-02 10:13:43 -07:00
Nicholas Dudfield
85befa467b Use parser: babel-eslint which supports facebook flow 2015-07-02 18:30:11 +07:00
wltsmrz
9b956e57ac Merge pull request #394 from sublimator/eslint-update
Update eslint
2015-07-02 18:56:40 +08:00
sublimator
93c0c49002 Merge pull request #390 from wltsmrz/refactor-api-deprecation
Refactor API deprecation, fix request constructors with positional args
2015-07-02 17:51:28 +07:00
wltsmrz
44954621e0 Refactor API deprecation, fix request constructors with positional args 2015-07-02 03:46:55 -07:00
Nicholas Dudfield
96e5d484da Update eslint 2015-07-02 17:44:38 +07:00
sublimator
4efe0b920e Merge pull request #388 from clark800/get-orderbook
Convert getOrderBook and add unit test
2015-07-01 12:43:00 +07:00
Chris Clark
d158cc7fc1 Fix other indentation problems 2015-06-30 16:53:48 -07:00
Chris Clark
034cd4eaf6 Fix indentation 2015-06-30 16:36:14 -07:00
Chris Clark
d5f3d90486 Add flipped orderbook to getOrderBook response 2015-06-30 15:43:30 -07:00
Chris Clark
99e076b7dd Sort orderbook orders by price 2015-06-30 15:21:28 -07:00
Chris Clark
8f9aec83f2 Fix counterparty/issuer bug 2015-06-30 13:02:42 -07:00
Chris Clark
87a8745a64 Fix unit tests 2015-06-30 12:52:21 -07:00
Chris Clark
2ab51d7a8a Revert remote.js 2015-06-30 12:12:21 -07:00
Chris Clark
3e0f43e44e Convert getOrderBook and add unit test 2015-06-26 16:27:34 -07:00
Chris Clark
6a763fab18 Merge pull request #385 from clark800/get-orders
Convert getOrders and add unit test
2015-06-26 10:46:41 -07:00
Chris Clark
3fe6726789 Merge pull request #386 from sublimator/rm-message
Remove message.js
2015-06-26 10:30:04 -07:00
Nicholas Dudfield
5b4deabd90 Remove message.js 2015-06-26 15:33:26 +07:00
Chris Clark
84bc7dd4aa Convert getOrders and add unit test 2015-06-25 14:21:39 -07:00
Chris Clark
3960b4e11f Merge pull request #383 from clark800/remove
Add unit test for generateWallet and reorganize API files
2015-06-25 11:43:39 -07:00
Chris Clark
141215fc38 Add unit test for getSettings 2015-06-25 11:23:56 -07:00
Chris Clark
2446e2f6da Add unit test for generateWallet and reorganize API files 2015-06-24 18:03:03 -07:00
Chris Clark
81a9bc0739 Merge pull request #382 from clark800/notifications
Merge notifications functionality into getAccountTransactions
2015-06-24 16:44:53 -07:00
Chris Clark
64e86f403e Merge notifications functionality into getAccountTransactions 2015-06-24 16:14:28 -07:00
Chris Clark
77f1351e5b Merge pull request #381 from clark800/balances
Update getBalances to use getTrustlines
2015-06-24 12:53:58 -07:00
Chris Clark
47a87f3a92 Update getBalances to use getTrustlines 2015-06-24 12:38:13 -07:00
Chris Clark
d2df75dc25 Merge pull request #380 from clark800/trustlines
Add getTrustlines and unit test
2015-06-24 11:36:34 -07:00
Chris Clark
d92fbfb7aa Add getTrustlines and unit test 2015-06-24 11:17:46 -07:00
wltsmrz
1b3be55711 Merge pull request #378 from sublimator/signing-data
Add Transaction.signingData
2015-06-23 20:58:21 +08:00
Nicholas Dudfield
8d98e443c5 Add Transaction.signingData() 2015-06-23 19:52:41 +07:00
Nicholas Dudfield
46121edd62 Remove global install for CI dependencies:
* Add them to package.json
* Fixes weird error with missing `esprima-fb`
2015-06-23 19:47:05 +07:00
sublimator
1a32536ac8 Merge pull request #355 from ripple/validate-uint-hex-input
Validate UInt* hex input
2015-06-22 13:59:17 +07:00
Chris Clark
85bf6891f9 Merge pull request #374 from clark800/empty-strings
Remove empty counterparties in XRP amounts
2015-06-18 17:39:18 -07:00
Chris Clark
1ccca1c4ec Remove empty counterparties in XRP amounts 2015-06-18 17:36:45 -07:00
Geert Weening
22cd70e53f Merge pull request #373 from clark800/get-acct-tx
Convert getAccountTransactions
2015-06-18 17:29:38 -07:00
Chris Clark
d8aad1444e Merge pull request #375 from clark800/flow-check
Use "flow check" to prevent "out of retries" errors
2015-06-18 15:12:56 -07:00
Chris Clark
621dfd9ca5 Use "flow check" to prevent "out of retries" errors 2015-06-18 15:10:16 -07:00
wltsmrz
2ad6a1a77e Validate UInt hex input 2015-06-18 13:50:11 -07:00
Chris Clark
8f37438a08 Convert getAccountTransactions 2015-06-17 18:04:24 -07:00
Chris Clark
ff6ac0333c Merge pull request #369 from clark800/parse-tx
Rewrite transaction parser and add unit test for getTransaction
2015-06-16 16:55:15 -07:00
Chris Clark
1b936d2aa2 Rewrite transaction parser and add unit test for getTransaction 2015-06-16 16:24:21 -07:00
sublimator
df0cff969c Merge pull request #372 from clark800/license
Add license to package.json
2015-06-16 18:33:49 +07:00
Chris Clark
46e2598499 Add license to package.json 2015-06-15 17:28:38 -07:00
Chris Clark
0b32378ab5 Merge pull request #364 from clark800/submit-test
Add unit test for submit
2015-06-15 14:39:19 -07:00
Chris Clark
bf25eb350f Display git log in travis output 2015-06-15 14:32:21 -07:00
Chris Clark
97cea2ce4d Add unit test for submit 2015-06-12 16:54:38 -07:00
Chris Clark
82ed402b16 Merge pull request #370 from clark800/fix-perf-test
Fix perf test
2015-06-12 16:28:24 -07:00
Chris Clark
ca7b69a2a0 Fix perf test 2015-06-12 16:22:05 -07:00
Chris Clark
d9c61a9431 Merge pull request #366 from darkdarkdragon/develop-RT-3462
[FIX] emit empty offers list (RT-3462)
2015-06-10 11:38:25 -07:00
Ivan Tivonenko
3b636ce2d1 [FIX] emit empty offers list (RT-3462)
For autobridged order books, emit 'model' event,
even if offers is empty, to indicate that
orderbook is loaded
2015-06-10 21:10:18 +03:00
wltsmrz
2196352335 Merge pull request #363 from clark800/parallel
Parallelize CircleCI tests
2015-06-10 05:06:11 +08:00
Chris Clark
823d7048ba Parallelize CircleCI tests 2015-06-09 13:13:13 -07:00
Chris Clark
d066e1145d Merge pull request #361 from clark800/prepare-trustline
Add unit tests for prepareTrustline, prepareOrderCancellation, and sign
2015-06-09 13:12:24 -07:00
Chris Clark
fb7021abcc Add unit tests for prepareTrustline, prepareOrderCancellation, and sign 2015-06-09 11:30:51 -07:00
Chris Clark
9c14fb2379 Merge pull request #360 from clark800/prepare-order
Add unit test for prepareOrder and fix bugs
2015-06-08 14:36:13 -07:00
Chris Clark
a114bf42c4 Add unit test for prepareOrder and fix bugs 2015-06-08 14:11:35 -07:00
Chris Clark
87b6c09de3 Merge pull request #358 from clark800/flow-type
Add flow type checking
2015-06-08 14:08:07 -07:00
Chris Clark
f1c95112bd Add circle.yml file 2015-06-08 14:00:08 -07:00
Chris Clark
76d8c8b061 Add flow type checking 2015-06-08 14:00:08 -07:00
Chris Clark
7cbcb9a220 Merge pull request #359 from darkdarkdragon/develop-RT-3445
[FIX] fix AutobridgeCalculator (RT-3445)
2015-06-08 11:08:44 -07:00
Ivan Tivonenko
4433ac57bd [FIX] change var to let and const 2015-06-08 20:38:22 +03:00
Ivan Tivonenko
5379da4874 [FIX] fix AutobridgeCalculator (RT-3445)
pass issuers to AutobridgeCalculator so
it can create offers with right issuers
2015-06-07 01:35:49 +03:00
Chris Clark
d488ce55b3 Merge pull request #357 from clark800/v2-schemas
Update schemas, use schemas for validation, and switch to is-my-json-valid
2015-06-05 15:25:32 -07:00
Chris Clark
908e306f04 Update schemas, use schemas for validation, and switch to is-my-json-valid 2015-06-05 14:58:23 -07:00
Chris Clark
62b5953abe Merge pull request #356 from sublimator/remove-sjcl-custom
Remove sjcl-custom in favor of sjcl-extended module in separate repo
2015-06-04 11:50:10 -07:00
Nicholas Dudfield
35ae968d9f Remove sjcl-custom in favor of sjcl-extended module in separate repo 2015-06-04 16:19:31 +07:00
Chris Clark
22dc39b920 Merge pull request #354 from clark800/v2
Move ripple-rest/api into src/api, exposing RippleAPI
2015-05-29 11:12:39 -07:00
Chris Clark
278331cc4a Move ripple-rest/api into src/api, exposing RippleAPI 2015-05-29 10:49:14 -07:00
wltsmrz
16e3541a10 Merge pull request #353 from clark800/develop
Fix bug in trace message for updateOwnerOffersFundedAmount
2015-05-28 13:54:43 -07:00
Chris Clark
7d7970d318 Fix bug in trace message for updateOwnerOffersFundedAmount 2015-05-27 11:56:27 -07:00
wltsmrz
f4fa10b9c0 Merge pull request #351 from clark800/sjcl-update
Update sjcl and delete custom ripemd160 and montgomery
2015-05-26 15:05:46 -07:00
Chris Clark
e68096bd27 Fix lint errors in sjcl-ecdsa-recoverablepublickey.js 2015-05-26 14:42:30 -07:00
Chris Clark
50cda426eb Update sjcl and delete custom ripemd160, montgomery, and jacobi 2015-05-26 14:42:18 -07:00
Chris Clark
1038421428 Merge pull request #350 from fhinkel/develop
Add missing semicolon in example
2015-05-26 13:56:44 -07:00
Franziska Hinkelmann
a5046ab086 Add missing semicolon in example 2015-05-24 11:40:43 +02:00
Geert Weening
ebbec1954e Merge pull request #348 from clark800/fix-orderbook-crash
Prevent crash when listening for "model" events on the OrderBook clas…
2015-05-21 12:07:47 -07:00
Chris Clark
4021018931 Fix lint errors in orderbook.js 2015-05-21 10:07:24 -07:00
Chris Clark
5824c3cb7c Prevent crash when listening for "model" events on the OrderBook class and an issuer creates an order with one of their issues 2015-05-21 09:53:55 -07:00
Geert Weening
45a1b9471e Merge pull request #328 from ripple/fix-remote-error-log
Fix error logging on Remote for object-type messages
2015-05-21 09:07:48 -07:00
wltsmrz
70bc819665 Lint 2015-05-21 04:17:11 -07:00
sublimator
e05f3e9b9c Merge pull request #343 from ripple/fix-serializedobject-append
Fix serializedobject append for excessively large bytes length
2015-05-21 10:35:20 +07:00
wltsmrz
e93f1ab6f4 Fix serializedobject append for excessively large bytes length 2015-05-20 20:18:17 -07:00
wltsmrz
0878a8ecf0 Fix error logging on Remote
* 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
2015-05-20 20:08:32 -07:00
sublimator
6ea07139dc Merge pull request #349 from ripple/check-unknown-serialization-fields
Check unknown serialization fields
2015-05-21 09:14:17 +07:00
wltsmrz
55fca2d7d5 Lint 2015-05-20 18:47:05 -07:00
wltsmrz
8596dcef21 Check unknown serialization fields 2015-05-20 18:09:02 -07:00
Geert Weening
bca84d5508 Merge pull request #338 from ripple/fix-tx-summary
Fix transaction summary for transactions that fail format validation
2015-05-20 16:11:27 -07:00
wltsmrz
65f7485497 Lint 2015-05-20 05:00:08 -07:00
wltsmrz
457b02c781 Merge pull request #345 from sublimator/es6-lints
Fix eslint issues
2015-05-20 04:40:43 -07:00
Nicholas Dudfield
c8e0fa85f3 Fix eslint issues. 2015-05-20 16:04:04 +07:00
wltsmrz
5e714f6143 Fix transaction summary for transactions that fail with remoteError 2015-05-15 22:41:29 -07:00
Chris Clark
4ecbf31898 Merge pull request #344 from clark800/babel
Setup babel transpiler
2015-05-15 16:59:32 -07:00
Chris Clark
ea24bf0415 Fix lint errors 2015-05-15 16:45:24 -07:00
Chris Clark
171f8349cb Fix requires in bin directory 2015-05-15 16:34:50 -07:00
Chris Clark
398f8d001f Set up babel transpiler 2015-05-14 16:07:47 -07:00
Chris Clark
e66978fb48 Merge pull request #342 from clark800/remove-cpp
Remove src/cpp and clean up files
2015-05-13 17:13:44 -07:00
Chris Clark
c57d528db7 Fix lint errors in remote-test.js 2015-05-13 16:37:46 -07:00
Chris Clark
0c47310063 Prevent lint checking of moved files 2015-05-13 15:21:20 -07:00
Chris Clark
cb4f6e37a8 Remove src/cpp and clean up files 2015-05-13 15:03:32 -07:00
Geert Weening
ab943f36c3 Merge pull request #337 from clark800/sjcl_npm
Use sjcl npm module, delete sjcl code
2015-05-12 16:14:59 -07:00
Chris Clark
de7fc78ef0 Remove lint errors in sjcl-custom 2015-05-12 15:00:07 -07:00
Chris Clark
9a502580fd Use sjcl npm module, delete sjcl code 2015-05-12 15:00:02 -07:00
Chris Clark
d56e70b995 Merge pull request #340 from clark800/remove-return-value
Remove return value of mergeDirectAndAutobridgedBooks
2015-05-11 16:51:55 -07:00
Chris Clark
e9aaf50d59 Remove return value of mergeDirectAndAutobridgedBooks 2015-05-11 10:49:13 -07:00
Geert Weening
ac0a4f521a Bump version to 0.12.5-rc2 2015-05-05 11:20:08 -07:00
Geert Weening
a3380c5cdd Update release notes 2015-05-05 11:15:31 -07:00
Geert Weening
6a6d2a0787 Merge pull request #339 from boxbag/autobridging-empty-orders
[TASK] add short circuit when there are no direct nor autobridged offers
2015-05-05 09:52:42 -07:00
Bo Chen
64809d9ae2 [TASK] add short circuit when there are no direct nor autobridged offers 2015-05-04 13:11:54 -07:00
Chris Clark
d14b38bc91 Merge pull request #335 from clark800/remove-float
Remove float.js and wallet.js
2015-05-01 13:31:17 -07:00
Chris Clark
440dfb5785 Merge pull request #334 from clark800/remove-config
Remove config singleton (global state)
2015-05-01 13:30:36 -07:00
Chris Clark
d4a4b5f4fb Remove float.js and wallet.js 2015-04-30 18:47:43 -07:00
Chris Clark
0c000a7fee Fix lint errors in amount-test.js 2015-04-30 18:31:59 -07:00
Chris Clark
c655c2a20e Remove config singleton (global state) 2015-04-30 18:30:53 -07:00
Geert Weening
3ba5a18b91 Bump version to 0.12.5-rc1 2015-04-29 11:54:36 -07:00
Geert Weening
bdb3415855 Update release notes 2015-04-29 11:54:05 -07:00
Geert Weening
5ef5bdd9d9 Merge pull request #332 from geertweening/develop
Add offer autobridging
2015-04-29 11:47:05 -07:00
Bo Chen
c7bbce8371 [FEATURE] add offer autobridging 2015-04-29 11:28:14 -07:00
Geert Weening
5e2c26a4a2 Merge branch 'release'
Conflicts:
	npm-shrinkwrap.json
	package.json
2015-04-29 08:50:44 -07:00
Geert Weening
631faa20ec Generate shrinkwrap for node 0.10.38 2015-04-29 08:48:39 -07:00
Geert Weening
2db17ba67c Regenerate shrinkwrap using npm-shrinkwrap
cleans up inconsistencies
2015-04-24 16:22:16 -07:00
Geert Weening
50eca42e35 Bump version to 0.12.4 2015-04-24 16:21:32 -07:00
Geert Weening
f327487157 Update release notes 2015-04-24 16:18:05 -07:00
Geert Weening
85b64b7ac3 Bump version to 0.12.4-rc1 2015-04-24 15:44:08 -07:00
Geert Weening
cf17a9e8d6 Update release notes 2015-04-24 15:44:07 -07:00
Chris Clark
71a1282b89 Remove unused dependency: superagent 2015-04-24 15:44:07 -07:00
Chris Clark
85e1f2f47d Fix lint errors in ledger.js 2015-04-24 15:44:07 -07:00
Chris Clark
1f68eba146 Delete unused crypt.js 2015-04-24 15:44:07 -07:00
Chris Clark
d71873442f Update ripple-wallet-generator version 2015-04-24 15:44:07 -07:00
Chris Clark
10ca2da2d6 Fix lint errors in crypt.js, messages.js, remote.js, message-test.js 2015-04-24 15:44:07 -07:00
Chris Clark
c7ba822320 Improve entropy security and increase CCM tag length 2015-04-24 15:44:06 -07:00
Geert Weening
ef3ce46d00 Bump dependency versions
bignumber 2.0.7
lodash 3.6.0
lru-cache 2.5.2
2015-04-24 15:44:06 -07:00
Geert Weening
c4595e03ce Bump version to 0.12.3 2015-04-24 15:44:06 -07:00
Geert Weening
26a7eb456b Bump version to 0.12.3-rc2 2015-04-24 15:44:06 -07:00
Geert Weening
142a85d6a7 Update release notes 2015-04-24 15:44:06 -07:00
Geert Weening
ef51490a1a Bump version to 0.12.3 2015-04-13 16:27:52 -07:00
Geert Weening
c40d643238 Bump version to 0.12.3-rc2 2015-04-10 14:36:47 -07:00
Geert Weening
6f23c88567 Update release notes 2015-04-10 14:36:15 -07:00
Geert Weening
56958a6242 Merge pull request #324 from clark800/develop
Add Amount.scale
2015-04-10 13:25:57 -07:00
Chris Clark
74dac97b36 Add Amount.scale 2015-04-10 12:56:50 -07:00
Geert Weening
2f2e41c781 Bump version to 0.12.3-rc1 2015-04-08 13:36:23 -07:00
Geert Weening
8c872f71c6 Update release notes 2015-04-08 13:36:01 -07:00
wltsmrz
b40b496866 Merge pull request #322 from clark800/rest1.7
Add getLedgerSequence method
2015-04-08 11:20:46 -07:00
Geert Weening
569fec296e Merge pull request #321 from clark800/paranoia
[FIX] Fail if PRNG has not been seeded with at least 256 bits of entr…
2015-04-08 11:16:47 -07:00
Chris Clark
56d8aa797a Fix lint errors in transaction-test.js and transaction-manager-test.js 2015-04-07 18:08:07 -07:00
Chris Clark
fe7e30b737 [FIX] Fail if PRNG has not been seeded with at least 256 bits of entropy before generating ECDSA signatures 2015-04-07 18:08:02 -07:00
Chris Clark
a114281c60 Update comment about the fee base reference constant 2015-04-07 14:34:26 -07:00
Chris Clark
d09548d04d Add getLedgerSequence 2015-04-07 14:34:22 -07:00
Geert Weening
a02b8e3e5c Merge branch 'release' into develop 2015-04-06 13:00:36 -07:00
Geert Weening
2c3f9ca202 bump version to 0.12.2 2015-04-06 12:57:47 -07:00
Geert Weening
587782820d Merge pull request #318 from sublimator/serial-offender
Fix SerializedObject.append performance issue
2015-04-06 12:54:48 -07:00
Nicholas Dudfield
8fad048569 Update verify_ledger_json.js script:
* Set `Amount.strict_mode = false` in verify_ledger_json.js script
* Don't try and calculate hash of non present accountState
* Fix lint issues
2015-04-04 14:51:35 +07:00
Nicholas Dudfield
f7c35b118e Fix SerializedObject.append perf issue:
* Replace array.concat(array2) with Array.prototype.push.apply
2015-04-04 14:51:12 +07:00
Geert Weening
65a669bbb2 Merge pull request #319 from sublimator/lints
eslint fixes
2015-04-04 00:35:57 -07:00
Nicholas Dudfield
9985acc539 Fix linting issues:
* 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
2015-04-04 14:23:41 +07:00
Geert Weening
f1f0a43f21 Bump version to 0.12.1-rc1 2015-03-27 16:56:27 -07:00
Geert Weening
6b856c3cc5 Update release notes 2015-03-27 16:55:44 -07:00
Geert Weening
d92888ed73 Merge pull request #317 from ripple/fix-browser-log
Check that Error.stack is available, fixes logging in browser
2015-03-27 16:52:18 -07:00
wltsmrz
0357840654 Lint 2015-03-27 15:54:26 -07:00
wltsmrz
53cae3a66d Check that stack trace is available, fixes logging in browser 2015-03-27 15:49:13 -07:00
Geert Weening
949a1ca4ae Bump version to 0.12.1 2015-03-26 15:12:14 -07:00
Geert Weening
e667536a5b Bump version to 0.12.1-rc6 2015-03-25 12:15:09 -07:00
Geert Weening
dde000a4bb Update release notes 2015-03-25 12:14:30 -07:00
Geert Weening
aa1f5a8e7d Merge pull request #316 from clark800/fix/to_human_small_number
[FIX] Make Amount.to_human return correct results for very small numbers
2015-03-25 12:09:13 -07:00
Chris Clark
bfbfcc2894 Fix lint errors in amount-test.js 2015-03-25 11:28:13 -07:00
Chris Clark
6abfa759aa [FIX] Make Amount.to_human return correct results for very small numbers 2015-03-25 11:19:25 -07:00
Alan Cohen
7cbac2e757 Merge pull request #315 from ripple/readme-link-fix
Fix link in GUIDES.md
2015-03-24 11:04:31 -07:00
Alan Cohen
1012381d3d Update GUIDES.md 2015-03-24 09:17:43 -07:00
Geert Weening
6de96f62df Merge pull request #314 from lumberj/addflags
[TASK] Add GlobalFreeze and NoFreeze flags
2015-03-23 12:23:05 -07:00
Alan Cohen
e2ed2bdbf6 [TASK] Add GlobalFreeze and NoFreeze flags
See: https://wiki.ripple.com/Ledger_Format#AccountRoot
2015-03-20 14:31:47 -07:00
Geert Weening
e248c54aa5 Merge pull request #312 from clark800/mocha-timeout
Increase timeout for mocha tests because sometimes tests fail on travis ...
2015-03-19 09:09:46 -07:00
Chris Clark
1c9635edad Increase timeout for mocha tests because sometimes tests fail on travis due to taking too long 2015-03-18 17:27:06 -07:00
Geert Weening
25cf6c52e4 Bump version to 0.12.1-rc5 2015-03-18 17:24:24 -07:00
Geert Weening
7859ef6145 Update release notes 2015-03-18 17:23:46 -07:00
Geert Weening
6efaa4ac7e Merge pull request #311 from vhpoet/patch-4
[FIX] Amount: clone in ratio_human, product_human
2015-03-18 17:21:21 -07:00
Vahe Hovhannisyan
19e17a8431 [FIX] Amount: clone in ratio_human, product_human
Amount.ratio_human and Amount.product_human should change and return the cloned Amount object.
2015-03-18 17:09:17 -07:00
Geert Weening
c865ae9734 Bump version to 0.12.1-rc4 2015-03-17 11:19:34 -07:00
Geert Weening
6959f74073 Update release notes 2015-03-17 11:14:36 -07:00
Chris Clark
9f4d21e976 Merge pull request #310 from darkdarkdragon/release-base-decode-fix
[FIX] fix Base:decode
2015-03-17 10:12:07 -07:00
Ivan Tivonenko
719f39c01c [FIX] fix Base:decode
check for invalid input in decoded data
2015-03-17 05:53:02 +02:00
Geert Weening
25bb9c7320 Bump version to 0.12.1-rc3 2015-03-11 11:49:30 -07:00
Geert Weening
a160e16abd Update release notes 2015-03-11 11:48:46 -07:00
Geert Weening
ec31841aa5 Merge pull request #305 from geertweening/add-default-rippling-flag
Add DefaultRipple account flag
2015-03-11 11:41:49 -07:00
wltsmrz
3e249902c4 Add DefaultRipple account flag 2015-03-10 11:44:50 -07:00
Geert Weening
21bb766f06 Update release notes 2015-03-10 11:30:34 -07:00
Geert Weening
a883151400 Bump version to 0.12.1-rc2 2015-03-09 10:06:04 -07:00
Geert Weening
3c7fe82cbd Regenerate shrinkwrap 2015-03-09 10:05:49 -07:00
Geert Weening
899fc09704 Update release notes 2015-03-09 10:03:32 -07:00
Geert Weening
daa45a44b9 Merge pull request #297 from ripple/add-log-info
Add filename and line number to log, use log.warn() for deprecations
2015-03-09 09:45:18 -07:00
Geert Weening
52494628c3 Merge pull request #301 from ripple/amount-strict-mode
Add Amount.strict_mode for toggling range validation
2015-03-06 19:54:58 -08:00
Geert Weening
dbf5d21b72 Merge pull request #303 from clark800/morebasetest
[TASK] Fix issues in base.js and add more tests
2015-03-06 19:53:27 -08:00
wltsmrz
441bd4dfbf Lint remote.js 2015-03-06 19:06:24 -08:00
wltsmrz
8452f05dda Lint log.js 2015-03-06 18:36:27 -08:00
Chris Clark
0d2325e646 [TASK] Fix seed-test.js lint errors 2015-03-06 17:41:42 -08:00
wltsmrz
90329d3d73 Add filename and line number to log, use log.warn() for deprecations 2015-03-06 17:35:24 -08:00
Chris Clark
ca83a142f8 [TASK] Fix issues in base.js and add more tests 2015-03-06 17:33:52 -08:00
wltsmrz
d3b2d3d5c5 Merge pull request #304 from clark800/fix/travis_eslint2
[FIX] Fix bug in .travis.yml generation of list of modified files in pul...
2015-03-06 17:18:55 -08:00
Chris Clark
255177487c [FIX] Fix bug in .travis.yml generation of list of modified files in pull request 2015-03-06 15:53:52 -08:00
wltsmrz
ed0b75bcde Use new Amount(NaN) rather than Amount.NaN() 2015-03-06 15:38:44 -08:00
Chris Clark
06500a7909 Merge pull request #302 from clark800/fix/travis_eslint
[FIX] Don't lint deleted files and pull eslintrc from javascript-style-g...
2015-03-06 13:32:47 -08:00
wltsmrz
6e16bf68ae Lint serializedobject test 2015-03-06 13:01:57 -08:00
Chris Clark
ad22480117 [FIX] Don't lint deleted files and pull eslintrc from javascript-style-guide repo to ensure that it is up to date 2015-03-06 11:20:20 -08:00
wltsmrz
2fcd09072f Lint serializedtypes.js 2015-03-06 01:10:22 -08:00
wltsmrz
f0c785b196 Lint amount.js 2015-03-06 01:06:58 -08:00
Geert Weening
84fe76bada Merge pull request #296 from ripple/fix-currency-parsing
Fix currency parsing of non-alphanumeric and no-currency currencies
2015-03-05 22:32:04 -08:00
wltsmrz
b5ed8f59a7 Add Amount.strict_mode for toggling range validation 2015-03-05 22:21:35 -08:00
Geert Weening
52526f90d7 Merge pull request #298 from clark800/basetest
[TEST] Add unit tests for Base
2015-03-05 13:08:56 -08:00
wltsmrz
99e6e81e65 Merge pull request #299 from boxbag/fix-taker-pays-funded
[FIX] fix taker pays funded calculation
2015-03-05 11:17:43 -08:00
Bo Chen
5af824f5cf [FIX] fix taker pays funded calculation
When calling `parseInt` on a string with scientific notation, it ignores the exponents.
2015-03-05 09:43:27 -08:00
wltsmrz
2166bb2e88 Fix currency parsing of non-alphanumeric and no-currency currencies 2015-03-04 19:10:39 -08:00
Chris Clark
ae884c0200 [TEST] Add unit tests for Base 2015-03-04 13:02:36 -08:00
wltsmrz
423ec7d08a Merge pull request #294 from clark800/baseconverter
Refactor base conversion
2015-03-03 20:23:08 -08:00
Chris Clark
914cd6ecb2 Add unit tests for convertBase 2015-03-03 12:22:42 -08:00
Geert Weening
f221c82859 Merge pull request #293 from boxbag/offer-quality
Offer quality
2015-03-03 10:52:38 -08:00
wltsmrz
d57be723e6 Merge pull request #295 from stevenzeiler/ripple-wallet-version
[TASK] Bump ripple-wallet-generator patch version
2015-03-02 16:58:40 -08:00
Steven Zeiler
777554809a [TASK] Bump ripple-wallet-generator patch version 2015-03-02 16:53:52 -08:00
Chris Clark
f2b63fa4a8 Refactor base conversion 2015-02-27 21:28:23 -08:00
Bo Chen
4d06ce7454 [FIX] fix eslint errors 2015-02-27 16:12:06 -08:00
Bo Chen
8da6ec5fa3 [TASK] reverse skip of order book tests 2015-02-27 09:18:01 -08:00
Bo Chen
2a5a8b498d [FIX] fix handling of quality in order book 2015-02-27 09:18:01 -08:00
Bo Chen
a9b7d7d793 Merge pull request #292 from ripple/revert-286-set-user-agent
Revert "Set User-Agent Header with ripple-lib/{version}"
2015-02-27 09:17:27 -08:00
Bo Chen
6578cf5dd7 Revert "Set User-Agent Header with ripple-lib/{version}" 2015-02-26 14:40:07 -08:00
Geert Weening
2e21e8a43c Merge pull request #290 from ripple/transactionmanager-tests
Add TransactionManager test
2015-02-26 12:48:42 -08:00
Geert Weening
176e1fd9d4 Merge pull request #291 from ripple/update-binary-format
Update binary format
2015-02-26 11:41:34 -08:00
wltsmrz
c3b274b18f Add TransactionManager test 2015-02-25 18:49:59 -08:00
wltsmrz
8e134918fb Update binary format 2015-02-25 18:39:42 -08:00
wltsmrz
2b531d2a1f Disable breaking OrderBook tests 2015-02-25 01:36:12 -08:00
Geert Weening
87317dd54a Merge pull request #289 from ripple/fix-setregularkey-transaction-format
Fix RegularKey requirement in SetRegularKey transaction format
2015-02-24 09:23:48 -08:00
wltsmrz
618548c88d Merge pull request #273 from clark800/feature/eslint
[TASK] Add eslint enforcement to travis.yml
2015-02-23 17:50:41 -08:00
Chris Clark
b62f42006c [TASK] Add eslint enforcement to travis.yml 2015-02-23 16:34:22 -08:00
wltsmrz
c275174f27 Fix RegularKey requirement in SetRegularKey transaction format 2015-02-23 13:09:50 -08:00
Geert Weening
af4ed295e0 Bump version to 0.12.1-rc1 2015-02-23 09:25:42 -08:00
Geert Weening
7614a03ea8 Update release notes 2015-02-23 09:24:13 -08:00
Geert Weening
d9527726b6 Merge pull request #285 from boxbag/orderbook-fix
[FIX] fix order funded amount calculation
2015-02-23 09:16:44 -08:00
Geert Weening
05f4099709 Merge pull request #288 from ripple/fix-setfee-transaction-format
Fix Features field requirement in SetFee transaction format
2015-02-23 09:16:13 -08:00
wltsmrz
a20a649013 Fix Features field requirement in SetFee transaction format 2015-02-20 15:01:05 -08:00
Geert Weening
0e3e64105c Merge pull request #287 from clark800/bignumber_update
[TASK] Update bignumber.js and use new feature to simplify our code
2015-02-20 14:50:59 -08:00
Bo Chen
b2cdb1a6ae [FIX] fix order funded amount calculation 2015-02-20 14:49:47 -08:00
Alan Cohen
812432db96 Merge pull request #286 from lumberj/set-user-agent
Set User-Agent Header with ripple-lib/{version}
2015-02-20 10:23:32 -08:00
Alan Cohen
5b2c4aef2d Set User-Agent Header with ripple-lib/{version}
- This would be helpful for us to analyze usage of ripple-lib for anyone
  using the public rippled
2015-02-20 09:06:02 -08:00
Chris Clark
b7ccf424f4 [TASK] Update bignumber.js and use new feature to simplify our code 2015-02-19 19:51:05 -08:00
Geert Weening
77d5db168b Merge pull request #283 from clark800/feature/amount_sanity
[TASK] Disable parsing native amounts in foating point format
2015-02-17 14:29:38 -08:00
Chris Clark
e80cd1ff55 [TASK] Disable parsing native amounts in foating point format 2015-02-17 14:03:23 -08:00
Geert Weening
4ff25a21f6 Merge pull request #282 from boxbag/orderbook
[TEST] test and refactor orderbooks
2015-02-17 13:35:55 -08:00
Bo Chen
f184a71360 [TEST] test and refactor orderbooks 2015-02-13 13:37:57 -08:00
wltsmrz
fc38a9853d Merge pull request #281 from shekenahglory/develop
fix handling of false parameters in requestLedger
2015-02-11 14:24:27 -08:00
Matthew Fettig
6023efed41 fix handling of false parameters in requestLedger 2015-02-11 14:11:24 -08:00
Geert Weening
2abac6ce5c Bump version to 0.12.0 2015-02-11 12:24:40 -08:00
Geert Weening
53c7705c36 Update release notes 2015-02-11 12:24:00 -08:00
Geert Weening
7059ab65d6 Bump version to 0.12.0-rc3 2015-02-10 16:46:58 -08:00
Geert Weening
e133988b36 Update release notes 2015-02-10 16:46:36 -08:00
Geert Weening
9af27e7964 Merge branch 'develop' into release 2015-02-10 16:44:01 -08:00
Geert Weening
a57b3835fb Merge pull request #279 from ripple/fix-set-funded-amount
Fix IOU value passed to Amount.from_json()
2015-02-10 15:01:18 -08:00
Geert Weening
451cbb809e Disable Travis email notifications 2015-02-09 13:57:48 -08:00
wltsmrz
fd1b64393d Fix IOU value passed to Amount.from_json() 2015-02-09 13:41:40 -08:00
Geert Weening
ed875a35b4 Bump version to 0.12.0-rc2 2015-02-07 11:52:04 -08:00
Geert Weening
e85b0c2122 Update release notes 2015-02-07 11:51:20 -08:00
Geert Weening
f5b192f55f Merge branch 'develop' into release 2015-02-07 11:49:42 -08:00
Geert Weening
ff86d5381d Merge pull request #277 from geertweening/fix/memo_serialization
[FIX] unsymmetric memo serializing
2015-02-07 10:28:08 -08:00
Geert Weening
b63ac4addb [TASK] bump version to 0.12.0-rc1 2015-02-06 15:10:03 -08:00
Geert Weening
3e1a66d617 [DOC] update release notes 2015-02-06 15:09:02 -08:00
Geert Weening
93ed5a8cae Merge pull request #278 from ripple/fix-tests
Fix server-test for updated WS
2015-02-05 14:30:06 -08:00
wltsmrz
2e6e8807be Fix server-test for updated WS 2015-02-05 13:51:25 -08:00
Geert Weening
1ed36fabdb [FIX] unsymmetric memo serializing
treat memos as unknown binary, with optionally parsing unsynthesized hint fields
2015-02-05 11:13:37 -08:00
Geert Weening
8dc40ee379 Merge pull request #276 from ripple/bump-dependencies
Bump dependencies versions
2015-02-05 11:13:16 -08:00
Geert Weening
db4c7c89e3 Merge pull request #275 from ripple/mocha-reporter
Use mocha tap reporter only for Travis CI
2015-02-05 11:12:21 -08:00
wltsmrz
f9bc7cc746 Bump dependencies versions 2015-02-05 00:54:07 -08:00
wltsmrz
8f87ed65f9 Use mocha tap reporter only for Travis CI 2015-02-04 23:32:14 -08:00
Geert Weening
39c37631f3 Merge pull request #269 from clark800/feature/amount_cleanup
Cleanup amount.js
2015-02-04 14:06:17 -08:00
Chris Clark
d0fb291c4e Cleanup amount.js 2015-02-04 13:57:57 -08:00
wltsmrz
793523cbe9 Merge pull request #274 from clark800/fix/parse_human
[FIX] Handle invalid input in parse_human
2015-02-04 12:59:05 -08:00
wltsmrz
6da4dd9ecc Remove Gulp lint task, update eslint.json 2015-02-04 02:50:32 -08:00
Geert Weening
79892af8f8 Merge pull request #272 from ripple/fix-taker-gets-funded
Fix taker_gets_funded exceeding offer.TakerGets
2015-02-03 18:35:25 -08:00
Chris Clark
b86790c854 Check for null in isNumber 2015-02-03 18:23:18 -08:00
Chris Clark
c8f18c8c85 [FIX] Handle invalid input in parse_human 2015-02-03 18:06:15 -08:00
wltsmrz
b19ecb4482 Fix taker_gets_funded exceeding offer.TakerGets 2015-02-03 14:50:33 -08:00
wltsmrz
ba9af55aca Merge pull request #268 from ripple/remote-updates
Remote updates
2015-02-02 16:19:45 -08:00
wltsmrz
35d76b3520 Add deprecation warnings to request constructors
* The first argument to request constructor functions should be an
object containing request properties
* Improve Remote test coverage
2015-01-30 21:08:45 -08:00
Geert Weening
a5a0326092 Merge branch 'release' into develop 2015-01-29 15:39:18 -08:00
Geert Weening
a05833f845 bump version to 0.11.0 2015-01-29 14:58:28 -08:00
Bo Chen
c5deb60510 [FIX] update transaction binary parsing to account for XRP delivered amounts 2015-01-29 14:27:11 -08:00
Geert Weening
ff2ff89e3e Merge pull request #271 from boxbag/parse-binary-transaction
[FIX] update transaction binary parsing to account for XRP delivered amounts
2015-01-29 10:52:12 -08:00
Bo Chen
35a346a674 [FIX] update transaction binary parsing to account for XRP delivered amounts 2015-01-29 10:06:10 -08:00
Geert Weening
1217a95c52 Merge pull request #267 from clark800/feature/bignumberjs
[TASK] Refactor to use bignumber.js
2015-01-27 11:43:09 -08:00
Chris Clark
d025b4a0c3 [TASK] Refactor to use bignumber.js 2015-01-27 10:23:33 -08:00
Geert Weening
2cab50f920 [TASK] bump version to 0.11.0-rc3 2015-01-26 14:42:51 -08:00
Geert Weening
b049278dde [DOC] update release notes 2015-01-26 14:42:34 -08:00
Geert Weening
93335e74cb Merge branch 'release' into develop 2015-01-26 14:34:18 -08:00
wltsmrz
2833a7b66e Cleanup, deprecations
* REMOVED Remote storage interface
* REMOVED Remote "ping" configuration
* REMOVED Old/deprecated Remote server configuration
	  (websocket_ip, websocket_port)
* REMOVED browser "online" reconnect listener
2015-01-26 14:00:54 -08:00
wltsmrz
0d05b960f7 Merge pull request #266 from clark800/feature/perftest
[TASK] Add performance test "npm run perf"
2015-01-26 13:31:31 -08:00
Chris Clark
9fd64a9209 [TASK] Add performance test "npm run perf" 2015-01-23 17:03:57 -08:00
wltsmrz
1637d26de3 Merge pull request #264 from lumberj/bug/ledger_select
[BUG] `Request.prototype.ledgerSelect` can accept ledger_index as String
2015-01-21 10:13:06 -08:00
Alan Cohen
525ff9b75e [BUG] Request.prototype.ledgerSelect can accept ledger_index as String 2015-01-21 08:54:40 -08:00
wltsmrz
42e7932f59 Merge pull request #263 from lumberj/feature/requestOffer
[FEATURE] Remote.prototype.requestOffer
2015-01-20 18:40:42 -08:00
Alan Cohen
98f40abfc3 [FEATURE] Remote.prototype.requestOffer
See: https://ripple.com/build/rippled-apis/#ledger-entry

Rippled request
```js
{
  "id": 1,
  "command": "ledger_entry",
  "type": "offer",
  "offer": {"account": "rEQWVz1qN4DWw5J17s3DgXQzUuVYDSpK6M", "seq":5 },
  "ledger_index": 10850610
}
```

Response
```js
{
  "id": 7,
  "status": "success",
  "type": "response",
  "result": {
    "index": "F9DCCD26C770952D216085BF97D7E225F6A8B578ABD066AA92D7D06144B535EE",
    "ledger_index": 10850610,
    "node": {
      "Account": "rEQWVz1qN4DWw5J17s3DgXQzUuVYDSpK6M",
      "BookDirectory": "CF8D13399C6ED20BA82740CFA78E928DC8D498255249BA6351038D7EA4C68000",
      "BookNode": "0000000000000000",
      "Flags": 131072,
      "LedgerEntryType": "Offer",
      "OwnerNode": "0000000000000000",
      "PreviousTxnID": "64FAB660F9F5D9E7183E977701930AD09F372129C56E1685B68A914D8A43CA41",
      "PreviousTxnLgrSeq": 10850602,
      "Sequence": 5,
      "TakerGets": "1000000",
      "TakerPays": {
        "currency": "USD",
        "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
        "value": "100"
      },
      "index": "F9DCCD26C770952D216085BF97D7E225F6A8B578ABD066AA92D7D06144B535EE"
    },
    "validated": false
  }
}
```
2015-01-20 18:17:33 -08:00
Geert Weening
55cd13ed4e Merge pull request #261 from boxbag/binary-default
[TASK] set binary as default for commands that accept the flag
2015-01-20 15:56:29 -08:00
Bo Chen
7cb113fcbc [TASK] set binary as default for commands that accept the flag 2015-01-20 14:10:22 -08:00
wltsmrz
ddbb999194 Merge pull request #262 from darkdarkdragon/develop-pathfind-fix
[FIX] properly close path find request
2015-01-16 16:17:32 -08:00
Ivan Tivonenko
1db96829ed [FIX] properly close path find request
path create uses broadcast, so close must
use this too
2015-01-17 01:48:18 +02:00
wltsmrz
3498dea18c Merge pull request #260 from ripplerm/develop
double check 'tes' code before emitting 'success'
2015-01-16 09:46:30 -08:00
ripplerm
97a8c87490 double check 'tes' code before emitting 'success'
result of a received transaction could be in 'tes' or 'tec'.
2015-01-17 01:01:27 +08:00
Geert Weening
fa72e09840 [TASK] bump version to 0.11.0-rc2 2015-01-15 16:24:14 -08:00
Geert Weening
d8cad710a5 [TASK] fix superagent dependency 2015-01-15 16:24:14 -08:00
Geert Weening
f91dcc33d3 [TASK] bump version to 0.11.0-rc1 2015-01-15 16:24:14 -08:00
Geert Weening
e5f524ec56 [DOC] update release notes 2015-01-15 16:24:14 -08:00
Geert Weening
f9b13cbc7f [TASK] re-add package.json for crypt 2015-01-15 16:24:14 -08:00
Geert Weening
c7e0ba68f6 [TASK] bump version to 0.11.0-rc2 2015-01-15 16:20:38 -08:00
Geert Weening
220262d192 [TASK] fix superagent dependency 2015-01-15 16:19:36 -08:00
Geert Weening
1f860ecba6 Merge pull request #259 from ripple/use-eslint
Use eslint, remove jshint
2015-01-15 16:11:26 -08:00
wltsmrz
69a13b71ea Use eslint, remove jshint 2015-01-15 16:05:38 -08:00
Geert Weening
0a27afe6ee [TASK] bump version to 0.11.0-rc1 2015-01-15 12:32:05 -08:00
Geert Weening
a3de021cd2 [DOC] update release notes 2015-01-15 12:31:55 -08:00
Geert Weening
4dcbe78e83 [TASK] re-add package.json for crypt 2015-01-15 12:31:46 -08:00
Geert Weening
84a8e8cbf6 Merge pull request #258 from ripple/throw-on-tls-error
Throw on tls error
2015-01-14 17:54:26 -08:00
Geert Weening
e4b2b3d06b Merge pull request #257 from ripple/fix-subscribe-handler
Fix complete ledgers check on subscription that is not initial
2015-01-14 17:53:42 -08:00
wltsmrz
000a2ea00c Abort server connection on unrecoverable TLS error 2015-01-14 17:47:23 -08:00
wltsmrz
89de91301e Fix complete ledgers check on subscription that is not initial 2015-01-14 17:19:21 -08:00
wltsmrz
6be84bfa73 Merge pull request #254 from ripple/use-tap-reporter
Use TAP reporter
2015-01-14 15:30:54 -08:00
wltsmrz
6cd79e7237 Use TAP reporter 2015-01-14 15:21:48 -08:00
wltsmrz
11d73173b8 Merge pull request #252 from ripple/remove-vault-client
Remove blobvault client
2015-01-14 15:07:54 -08:00
wltsmrz
9b3d62b765 Remove blobvault client 2015-01-14 14:54:55 -08:00
wltsmrz
2bdff53e68 Merge pull request #249 from ripple/request-broadcast/filter
Request broadcast/filter
2015-01-14 13:43:58 -08:00
wltsmrz
8af5f9c28e Add request broadcast/filter 2015-01-14 13:40:54 -08:00
Geert Weening
9f71abf978 Merge pull request #248 from clark800/feature/flow
[TASK] Add flow tasks to Gulpfile
2015-01-13 16:48:58 -08:00
Chris Clark
3fc2d3c1d9 [TASK] Add flow tasks to Gulpfile 2015-01-12 17:34:11 -08:00
Geert Weening
c0c8db6dcc [TASK] bump version to 0.10.1-rc2 2015-01-07 11:39:37 -08:00
Geert Weening
27249c0bb4 [DOC] update release notes 2015-01-07 11:39:04 -08:00
Geert Weening
62e9684542 Merge branch 'release' into develop 2015-01-07 11:37:23 -08:00
Geert Weening
74b006cb0b Merge pull request #247 from ripple/binary-account-tx
Decrease redundancy in binary account_tx parsing
2015-01-07 11:00:09 -08:00
Geert Weening
77b33f11ab Merge pull request #246 from lumberj/bug/incorrectly_deleted_function
[BUG] Add function removed in revert 51211bb
2015-01-07 10:59:20 -08:00
wltsmrz
0aba638e6e Decrease redundancy in binary account_tx parsing 2015-01-07 10:53:46 -08:00
Geert Weening
e82522349f Merge pull request #242 from clark800/feature/jshintrc
[TASK] Update jshintrc
2015-01-07 10:37:56 -08:00
Chris Clark
e520700260 [TASK] Update jshintrc 2015-01-07 10:06:54 -08:00
Alan Cohen
3ec335f3a6 [BUG] Add function removed in revert 51211bb
- Also, add tests
2015-01-07 09:55:12 -08:00
Geert Weening
0f212e4dd1 [TASK] bump version to 0.10.1-rc1 2015-01-06 14:59:05 -08:00
Geert Weening
c263654c88 [DOC] update release notes 2015-01-06 14:58:30 -08:00
Geert Weening
874e3f24a6 Merge branch 'release' into develop 2015-01-06 14:52:03 -08:00
Geert Weening
b14343f3cf [TASK] shrinkwrap dependencies 2015-01-06 14:48:13 -08:00
Geert Weening
732b50dea7 [TASK] bump version to 0.10.0 2015-01-06 14:48:05 -08:00
Geert Weening
be3bbe9b61 [DOC] update release notes 2015-01-06 14:46:44 -08:00
Geert Weening
51211bbba0 Revert "[TASK] Add Transaction.getBalanceChanges, computed from metadata"
See the balance change package in [ripple-lib-extensions](https://github.com/ripple/ripple-lib-extensions)

This reverts commit 72387873b4.

Conflicts:
	test/metadata-test.js
2015-01-06 14:42:24 -08:00
Geert Weening
5d1ff1c912 Merge pull request #245 from ripple/binary-account-tx
Wrap account_tx binary parsing in async.setImmediate
2015-01-06 11:08:22 -08:00
wltsmrz
ea1be4fc50 Wrap account_tx binary parsing in async.setImmediate 2015-01-06 06:51:18 -08:00
Geert Weening
7cc05f0d92 Merge pull request #244 from mehulkar/patch-1
Update link to deprecated API docs
2015-01-05 14:48:12 -08:00
Mehul Kar
54606f3c21 Update link to deprecated API docs 2015-01-05 14:43:05 -08:00
wltsmrz
a5d1705930 Merge pull request #236 from ripple/sum-account-offers
Fix cumulative account order tracking for native amounts
2014-12-26 21:06:42 -08:00
wltsmrz
bfc0fb6c88 Merge pull request #240 from lumberj/task/add_limit_to_bookoffers
[TASK] Allow `limit` option in remote.requestBookOffers
2014-12-24 14:44:15 -08:00
Alan Cohen
d1d4452217 [TASK] Allow limit option in remote.requestBookOffers 2014-12-24 14:24:32 -08:00
wltsmrz
2166a434a3 Merge pull request #241 from ripple/add-jshintrc
Add jshintrc
2014-12-23 23:08:52 -08:00
wltsmrz
1053fa18e1 Add jshintrc 2014-12-23 20:20:31 -08:00
wltsmrz
fa147d467e Merge pull request #239 from ripple/metadata-account-fix
Fix metadata account check
2014-12-23 20:19:09 -08:00
wltsmrz
3f61598d6c Fix metadata account check 2014-12-23 03:22:46 -08:00
wltsmrz
9bf3724ce6 Merge pull request #237 from lumberj/task/fix_jsdoc
[TASK] Fixup the annotation for remote.requestBookOffers
2014-12-22 15:37:28 -08:00
Alan Cohen
c2f27a4deb [TASK] Fixup the annotation for remote.requestBookOffers 2014-12-22 15:31:56 -08:00
wltsmrz
b6b99dde02 Fix cumulative account order tracking for native amounts 2014-12-20 20:43:01 -08:00
Geert Weening
1fd0f4a8fe Merge pull request #234 from ripple/sum-account-offers
Track order funded status based on cumulative account offers
2014-12-19 17:27:38 -08:00
wltsmrz
67d39737a4 Track order funded status based on cumulative account orders 2014-12-19 16:43:37 -08:00
Geert Weening
aef4fe29a3 Merge pull request #233 from lumberj/feature_test/request_book_offers
[FEATURE] Add tests and support for ledger for requestBookOffers (RLJS-115)
2014-12-19 16:39:24 -08:00
Alan Cohen
34c0677c45 [FEATURE] Add tests and support for ledger for requestBookOffers 2014-12-19 16:35:29 -08:00
Geert Weening
3cb4a64b47 [TEST] fix Meta require 2014-12-19 16:29:29 -08:00
Geert Weening
0db0375a5e Merge pull request #227 from clark800/feature/balance_changes
[TASK] Add balance_change array to transaction response, computed from metadata
2014-12-19 15:14:22 -08:00
wltsmrz
47e6bdc644 Merge pull request #231 from clark800/feature/test_compiled_js
[TASK] Refactor tests to support testing compiled javascript
2014-12-19 13:28:03 -08:00
Chris Clark
66c2e27711 [TASK] Refactor tests to support testing compiled javascript 2014-12-19 13:17:02 -08:00
Chris Clark
72387873b4 [TASK] Add Transaction.getBalanceChanges, computed from metadata 2014-12-18 16:12:06 -08:00
Geert Weening
59017bc0bd Merge pull request #229 from ripple/account-txn-id
Add AccountTxnID flag and setter
2014-12-17 12:42:40 -08:00
wltsmrz
2dde114d3d Add AccountTxnID flag and setter 2014-12-16 13:25:32 -08:00
wltsmrz
9e89904f03 Fix undefined log function in Transaction.finalize() 2014-12-12 21:26:54 -08:00
Geert Weening
56d0aca254 Merge pull request #224 from kureus/patch-1
Doc example code syntax error
2014-12-12 11:13:54 -08:00
Dan Quirk
239710cebf Doc example code syntax error 2014-12-11 13:16:14 +00:00
Geert Weening
1eaad617cb [TASK] bump version to 0.10.0-rc2 2014-12-11 00:20:50 -08:00
wltsmrz
3c21994adc [FIX] Fix empty queue check on reconnect 2014-12-10 23:58:00 -08:00
wltsmrz
d15d14e197 [FIX] Fix undefined Transaction.prototype.summary() 2014-12-10 14:17:28 -08:00
Geert Weening
e32694dc79 [TASK] bump version to 0.10.0-rc1 2014-12-10 14:02:48 -08:00
wltsmrz
6ec8124287 [DOC] Update release notes 2014-12-10 14:00:10 -08:00
Geert Weening
2222adfc10 [DOC] update release notes 2014-12-10 13:29:47 -08:00
Geert Weening
fcc2377657 Merge pull request #223 from geertweening/feature/memo_format_type
[FEATURE] improve memo support
2014-12-10 13:08:04 -08:00
Geert Weening
1704ac4ae1 [FEATURE] improve memo support
- 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
2014-12-10 13:07:44 -08:00
Geert Weening
666e4348e0 Merge pull request #222 from boxbag/transaction-set-fee
[FEATURE] allow per transaction fees to be set
2014-12-10 13:07:20 -08:00
Bo Chen
9b22f279bc [FEATURE] allow per transaction fees to be set 2014-12-10 11:52:16 -08:00
Geert Weening
0835de983b Merge pull request #221 from ripple/transaction-updates
Transaction updates
2014-12-10 11:37:36 -08:00
wltsmrz
1a892d58fc Rework tef and tel-class transaction error handling
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.
2014-12-10 11:30:45 -08:00
wltsmrz
73a3cce4a4 Do not bump LastLedgerSequence on resubmit 2014-12-10 11:30:45 -08:00
wltsmrz
d5ef4774fa Make LastLedgerSequence offset configurable, default to 3 2014-12-10 11:30:45 -08:00
wltsmrz
c5bd4239a4 Cleanup
- 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
2014-12-10 11:30:45 -08:00
Geert Weening
634e811888 Merge pull request #220 from geertweening/update_sjcl
[TASK] update sjcl
2014-12-08 15:21:13 -08:00
Geert Weening
3204998fcb [TASK] update sjcl
- 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
2014-12-08 15:02:24 -08:00
Geert Weening
12e428733a [TASK] bump version to 0.9.4 2014-12-05 15:48:24 -08:00
Geert Weening
9cc6ad09a9 [DOC] update release notes 2014-12-05 15:47:46 -08:00
Geert Weening
84abb5962e [TASK] bump ripple-lib to 0.9.4-rc2 2014-12-04 12:56:17 -08:00
Geert Weening
4bba55d2dc Revert "[FEATURE] improve memo support"
This reverts commit 89adcf4f4e.
2014-12-04 12:54:48 -08:00
Geert Weening
b4cabad44e [TASK] bump version to 0.9.4-rc1 2014-12-04 11:03:01 -08:00
Geert Weening
28cc0f9e3b [DOC] update release notes 2014-12-04 11:02:20 -08:00
wltsmrz
95a2cc18fe Merge pull request #213 from geertweening/feature/memo_format_type
[FEATURE] improve memo support
2014-12-02 00:00:10 -08:00
Geert Weening
8e315a9859 [DOC] update generate wallet example
to take advantage of randomness collected from a rippled
2014-12-01 17:54:34 -08:00
Geert Weening
89adcf4f4e [FEATURE] improve memo support
- 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
2014-12-01 09:48:56 -08:00
Geert Weening
3a6c5e41c9 Merge pull request #217 from ripple/orderbook-cleanup
Cleanup, normalize offers from book_offers and transaction stream
2014-11-30 14:14:01 -08:00
wltsmrz
86ed24b94c Cleanup, normalize offers from book_offers and transaction stream 2014-11-29 15:24:15 -08:00
wltsmrz
c792c471c3 Merge pull request #215 from ripple/fix-precision-rounding
Fix to_human precision rounding
2014-11-26 18:31:29 -08:00
wltsmrz
e371cc2c3c Fix to_human precision rounding 2014-11-26 11:32:15 -08:00
Geert Weening
ccf218c8f0 Merge pull request #214 from ripple/fix-fractional-drops
Fix fractional drops in funded taker_pays setter
2014-11-26 09:16:55 -08:00
wltsmrz
0d7fc0a573 Fix fractional drops in funded taker_pays setter 2014-11-25 21:10:57 -08:00
Geert Weening
74cacd5209 [DOC] update offer example 2014-11-19 18:04:45 -08:00
Geert Weening
bb79cf2a87 [TASK] bump version to 0.9.3 2014-11-19 12:09:18 -08:00
Geert Weening
28451df1a8 Merge branch 'develop' into release 2014-11-19 11:32:19 -08:00
Geert Weening
38e288f62a [TASK] bump version to 0.9.2-rc3 2014-11-19 11:31:19 -08:00
Geert Weening
905f908450 [DOC] update release notes 2014-11-19 11:31:19 -08:00
wltsmrz
672171fd0c Merge pull request #211 from jks-liu/fix-link
Fix link in README
2014-11-19 05:24:58 -08:00
Jks Liu
520660ecbc Fix link in README 2014-11-19 16:42:25 +08:00
Geert Weening
06acb5faf2 [TASK] bump version to 0.9.2-rc3 2014-11-18 11:58:41 -08:00
Geert Weening
d43fa03f05 [DOC] update release notes 2014-11-18 11:57:49 -08:00
Geert Weening
baed1aaf92 Merge branch 'release' into develop 2014-11-18 11:54:17 -08:00
wltsmrz
cc229e803c Merge pull request #210 from geertweening/fix/max_fee
[TASK] change default `max_fee` for Remote to 1 XRP
2014-11-18 11:48:37 -08:00
Geert Weening
d6b1728c23 [TASK] change default max_fee for Remote to 1 XRP 2014-11-18 10:47:28 -08:00
wltsmrz
bc5dcc359c Merge pull request #209 from ximinez/ledger_accept
Request ledger_accept returns the Request, not Remote
2014-11-17 12:08:38 -08:00
Edward Hennis
ced07e1d6b Request ledger_accept returns the Request, not Remote 2014-11-17 15:02:45 -05:00
Geert Weening
cffffd9591 [TASK] bump version to 0.9.3-rc2 2014-11-14 10:24:44 -08:00
Geert Weening
b8766e263f [DOC] update release notes 2014-11-14 10:24:00 -08:00
Geert Weening
fc426d5764 Merge branch 'release' into develop 2014-11-14 10:16:34 -08:00
Geert Weening
056d2381cd Merge pull request #208 from ripple/relocate-presubmit
Relocate presubmit emission to immediately before transaction submit
2014-11-14 10:14:02 -08:00
Geert Weening
2932a0ec5f [DOC] add doc that accountRequest throws
if a marker is provided, but no ledger_index or ledger_hash
2014-11-14 10:11:26 -08:00
Geert Weening
d3d85a3fcf [DOC] add doc that accountRequest throws
if a marker is provided, but no ledger_index or ledger_hash
2014-11-14 10:11:13 -08:00
wltsmrz
7a1feaa897 Relocate presubmit emission to immediately before transaction submit 2014-11-13 21:44:20 -08:00
Geert Weening
5f3cf72cc6 Merge pull request #207 from shekenahglory/develop
[TASK] binformat: update fields to match rippled
2014-11-13 14:13:52 -08:00
Matthew Fettig
cae980788e binformat: update fields to match rippled 2014-11-13 11:14:46 -08:00
Geert Weening
df763b8765 Merge pull request #205 from ripple/core-build
Add core build
2014-11-12 10:51:45 -08:00
wltsmrz
365085809e Add note on restricted browser builds 2014-11-12 03:04:51 -08:00
Geert Weening
3ee7998261 [TASK] bump version to 0.9.3-rc1 2014-11-11 17:52:30 -08:00
Geert Weening
6fb9ed8312 [DOC] update release notes 2014-11-11 17:52:13 -08:00
Geert Weening
89f79c35f5 Merge pull request #206 from geertweening/fix/tec_wait_for_validated
[TASK] wait for validation before returning tec error
2014-11-11 17:49:38 -08:00
Geert Weening
6bdd4b2670 [TASK] wait for validation before returning tec error 2014-11-11 16:54:25 -08:00
Geert Weening
acd79d19e2 [TASK] bump version to 0.9.2 2014-11-11 12:14:04 -08:00
Geert Weening
674d4a957d [TASK] bump version to 0.9.2-rc6 2014-11-11 11:51:54 -08:00
Geert Weening
bdbf264771 [FIX] support string '0' being interpreted as XRP 2014-11-11 11:51:12 -08:00
wltsmrz
8f17873da2 Remove server._computeFee(Transaction), require fee units argument 2014-11-11 06:24:34 -08:00
wltsmrz
b0cac776ee Throw an error when trying to use unavailable class in WebPack build 2014-11-11 06:23:37 -08:00
wltsmrz
625dba4d85 Add build-core gulp task 2014-11-11 05:30:50 -08:00
Geert Weening
261b72d0fc [DOC] update API reference 2014-11-10 14:32:35 -08:00
Geert Weening
b5b167ef6d [DOC] update README and GUIDES
to match current API's
2014-11-10 10:14:11 -08:00
Geert Weening
66d21b24cd [TASK] bump ripple-lib to 0.9.2-rc5 2014-11-07 18:22:23 -08:00
Geert Weening
5a084ea3cc [TEST] fix broken tests
as a result of updating account_info request in account.js
2014-11-07 18:22:05 -08:00
Geert Weening
486944fa4c [FIX] request account info in account.js 2014-11-07 18:04:04 -08:00
Geert Weening
b63a76d298 [TASK] bump version to 0.9.2-rc4 2014-11-07 17:45:17 -08:00
Geert Weening
31045039c0 [DOC] update release notes 2014-11-07 17:44:30 -08:00
Geert Weening
6f5d1104aa [TASK] change accountRequest method signature
`(type, options, callback)` where the last argument will be considered for callback if it's a function
2014-11-07 17:08:01 -08:00
Geert Weening
3c9660203b Merge pull request #203 from geertweening/feature/marker_valid_ledger
[FEATURE] check for valid ledger when using marker
2014-11-07 12:57:57 -08:00
Geert Weening
29e1423f84 [FEATURE] check for valid ledger when using marker
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
2014-11-07 11:18:24 -08:00
Geert Weening
e42e67e259 [TASK] consolidate accountRequest and pagingAccountRequest
update `requestAccountCurrencies` and  `requestAccountInfo`
2014-11-07 09:52:17 -08:00
Geert Weening
ed018282c4 [TASK] remove clone in favor of copy and update
see 'object' case in `parse_json`
2014-11-06 22:58:04 -08:00
Geert Weening
fbe015758c [TASK] bump version to 0.9.2-rc3 2014-11-06 21:48:01 -08:00
Geert Weening
7e24a81764 [DOC] update release notes 2014-11-06 21:47:44 -08:00
Geert Weening
9ab77e90fe Merge pull request #202 from geertweening/feature/paging_account_request
[FEATURE] add paging account request
2014-11-06 21:41:44 -08:00
Geert Weening
ae3ed699db Merge pull request #201 from geertweening/fix/from_human_full_name_native
[FIX] from_human 'XRP' with full name
2014-11-06 21:41:30 -08:00
Geert Weening
0c22a9753e Merge pull request #199 from geertweening/fix/amount_cap
[FIX] cap IOU Amounts to their max and min value
2014-11-06 21:41:08 -08:00
Geert Weening
a447f6b723 [TEST] add missing testcases for interest bearing currencies
- `get_interest_at` by providing a Date object
- `get_interest_at` for a Currency without interest
2014-11-06 21:38:00 -08:00
Geert Weening
a8ef614b81 [FIX] Currency constructor with Currency object
clone the given Currency instance in `parse_json`
2014-11-06 21:36:57 -08:00
Geert Weening
9025e8bfa8 [FIX] get interest for currency without interest
- `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
2014-11-06 21:35:41 -08:00
Geert Weening
722f4e175d [FEATURE] add paging account request
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`
2014-11-06 18:40:45 -08:00
Geert Weening
1ad6e5a15f [FIX] from_human 'XRP' with full name
from_human 'XRP - Ripples' should result in native XRP
2014-11-05 16:54:45 -08:00
Geert Weening
3554572db7 [TASK] bump version to 0.9.2-rc2 2014-11-05 16:32:37 -08:00
Geert Weening
f1abff962f Merge pull request #200 from boxbag/fix-max-fee
[FIX] fix test and do not set tx_json.Fee in maxFee method
2014-11-05 16:07:01 -08:00
Geert Weening
f05941fbc4 [FIX] cap IOU Amounts to their max and min value
respect rippled's limits
2014-11-05 16:04:02 -08:00
Bo Chen
237c46d5a0 [FIX] fix test and do not set tx_json.Fee in maxFee method 2014-11-05 15:59:57 -08:00
Geert Weening
76cfb69d9f [TASK] bump version to 0.9.2-rc1 2014-11-05 14:38:47 -08:00
Geert Weening
7610df0fbb [DOC] update release notes 2014-11-05 14:38:35 -08:00
Geert Weening
8bc935aa62 Merge pull request #198 from boxbag/transaction-max-fee
[FEATURE] set max fee the submitter of a transaction is willing to pay
2014-11-05 09:27:26 -08:00
Bo Chen
24587fab9c [FEATURE] set max fee the submitter of a transaction is willing to pay 2014-11-04 14:13:42 -08:00
Geert Weening
0248475473 [DOC] update description in package.json 2014-10-31 18:52:09 -07:00
Geert Weening
d2fa5c4b12 [TASK] bump version to 0.9.1 2014-10-30 10:01:16 -07:00
Geert Weening
c60c0cb6e0 [TASK] bump version to 0.9.1-rc3 2014-10-28 17:35:29 -07:00
Geert Weening
cdf1112666 [FIX] ledgerSelect setting both ledger_index and ledger_hash 2014-10-28 17:33:55 -07:00
Geert Weening
d861bb2e34 [TASK] bump version to 0.9.1-rc2 2014-10-27 17:32:37 -07:00
Geert Weening
006849a3d5 [DOC] update release notes 2014-10-27 17:32:18 -07:00
wltsmrz
a3c1d06eba Change initial account transaction sequence to 1 2014-10-27 17:29:51 -07:00
Geert Weening
4bd1e7a2bc [TASK] bump version to 0.9.1-rc1 2014-10-27 16:40:46 -07:00
Geert Weening
68643f3118 [DOC] update release notes 2014-10-27 16:37:14 -07:00
Geert Weening
560dfc8ae6 Merge branch 'release' into develop 2014-10-27 16:27:52 -07:00
Geert Weening
b0459e096b [TASK] bump version to 0.9.0 2014-10-27 16:25:34 -07:00
Geert Weening
2a0dfc4587 [DOC] update release notes 2014-10-27 16:25:09 -07:00
Geert Weening
2dcd5f94fb [TASK] shrinkwrap packages for dependency locking 2014-10-27 16:24:18 -07:00
Geert Weening
13685d03e1 Merge pull request #195 from ripple/use-ledgerselect
Switch account requests to use ledgerSelect rather than ledgerChoose
2014-10-27 16:07:40 -07:00
wltsmrz
278df9025a Switch account requests to use ledgerSelect rather than ledgerChoose 2014-10-27 15:35:07 -07:00
Geert Weening
cb608406f8 Merge pull request #191 from geertweening/fix/undefined_remote
[FIX] transaction without explicit remote
2014-10-27 12:09:59 -07:00
Geert Weening
f4a55d03d3 Merge pull request #192 from geertweening/fix/amount_precision
[FIX] confusion between precision and min_precision
2014-10-26 19:21:09 -04:00
Geert Weening
d3b6b8127c [FIX] transaction without explicit remote
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
2014-10-26 19:09:04 -04:00
wltsmrz
bc1f9f8a28 Fix account root request ledger argument #121 2014-10-26 15:39:17 -07:00
wltsmrz
9a5c9aea75 Merge pull request #193 from professorhantzen/patch-1
[FIX] correct usage example with surrounding apostrophes
2014-10-24 18:12:32 -07:00
professorhantzen
f1004c6db2 Correct usage example with surrounding apostrophes 2014-10-25 13:14:07 +13:00
Geert Weening
7708c64576 [FIX] confusion between precision and min_precision
`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
2014-10-23 17:59:53 -07:00
Geert Weening
0527b8c981 [TASK] move gulp-bump to devDependencies 2014-10-22 12:07:36 -07:00
Geert Weening
13f89e2fcc [TASK] bump version to 0.9.0-rc5 2014-10-21 15:05:02 -07:00
Geert Weening
69a0a473a6 [DOC] update release notes 2014-10-21 15:04:52 -07:00
Geert Weening
4ab82d7e01 Merge pull request #188 from geertweening/fix/amount_precision
[FIX] amount precision bugs
2014-10-21 15:01:50 -07:00
Geert Weening
4be209e286 [FIX] amount precision bugs
- leading 0's for fraction part disappearing
- first decimal lower than 5 wouldn't result in dropping the decimal
2014-10-21 13:22:42 -07:00
Geert Weening
8b10325895 [TASK] bump version to 0.9.0-rc4 2014-10-16 14:11:36 -07:00
Geert Weening
70bf600247 [DOC] update release notes 2014-10-16 14:11:14 -07:00
Geert Weening
d42e06d48b [FIX] fraction_part is a string 2014-10-16 14:05:26 -07:00
wltsmrz
9c080b6790 Merge pull request #187 from ripple/amount_precision
[FIX] Amount.to_human() precision slicing instead of rounding
2014-10-16 14:00:29 -07:00
Geert Weening
033257b03b [FIX] Amount.to_human() precision slicing instead of rounding 2014-10-16 13:54:42 -07:00
Geert Weening
39d8bcdfc2 [TASK] bump version to 0.9.0-rc3 2014-10-15 11:32:16 -07:00
Geert Weening
2ddcb4e2b7 [DOC] update release notes 2014-10-15 11:31:52 -07:00
Geert Weening
d972718a53 Merge pull request #185 from shekenahglory/fix/serialize
[FIX] binformat: added missing TransactionResult options
2014-10-14 11:37:35 -07:00
Matthew Fettig
6abed8dd53 [FIX] binformat: added missing TransactionResult options 2014-10-14 11:32:33 -07:00
Geert Weening
e74e697b45 [TASK] bump version to 0.9.0-rc2 2014-10-09 14:46:12 -07:00
Geert Weening
26c59e8565 [DOC] update release notes 2014-10-09 14:45:44 -07:00
Geert Weening
a5e83c4f23 [FIX] run test by _mocha to capture coverage 2014-10-09 14:35:14 -07:00
wltsmrz
900c4bbd2e Merge pull request #184 from geertweening/show_interest_flag
[FEATURE] add flag to show or hide interest in to_human/to_json
2014-10-09 14:31:43 -07:00
Geert Weening
947ec3edc2 [FEATURE] add flag to show or hide interest in to_human/to_json
The show_interest flag will default to true for interest bearing currencies and false for currencies without interest
2014-10-09 14:31:02 -07:00
Geert Weening
957f10d9f1 [TASK] bump version to 0.9.0-rc1 2014-10-09 09:40:31 -07:00
Geert Weening
89aa54dff8 [DOC] update release notes 2014-10-09 09:39:15 -07:00
Geert Weening
bb76530e4b Merge pull request #179 from geertweening/develop
[FEATURE] make maxLoops in seed.get_key() optional
2014-10-09 09:32:17 -07:00
wltsmrz
011e2cc1e3 Merge pull request #182 from shekenahglory/fix/attestation
[FIX] vault client: URI decode attestation token
2014-10-08 18:41:38 -07:00
Matthew Fettig
4c594f8964 [FIX] vault client: URI decode attestation token 2014-10-08 18:17:30 -07:00
Geert Weening
1fcfcf2392 [TASK] bump version to 0.8.3-rc1 2014-10-06 18:23:59 -07:00
Geert Weening
6311abff81 [DOC] update release notes 2014-10-06 18:23:05 -07:00
Geert Weening
ed2da57475 Merge pull request #181 from shekenahglory/feature/identity
Feature/identity
2014-10-06 18:15:38 -07:00
Matthew Fettig
778ccd4805 [TASK] vault client: tests for attestation routes and full summary 2014-10-06 18:03:52 -07:00
Matthew Fettig
327c35252f [FEATURE] vault client: update attestation and attestation summary 2014-10-03 17:17:09 -07:00
Matthew Fettig
5e7af2fba4 [TASK] switch to new attestation endpoint 2014-10-03 17:17:09 -07:00
Matthew Fettig
dce15bc579 [TASK] vault client: add parameters to attest 2014-10-03 17:17:08 -07:00
Matthew Fettig
d5e32db954 [CHORE] vault client: add type to attest parameters 2014-10-03 17:17:08 -07:00
Matthew Fettig
bdfa83592b [FEATURE] identity functions 2014-10-03 17:17:08 -07:00
Geert Weening
23e473b688 [FEATURE] make maxLoops in seed.get_key optional
default to 1 or the index of the requested account +1
2014-10-02 17:26:01 -07:00
wltsmrz
0dfd3a0ae0 Merge pull request #178 from ripplerm/develop
configurable maxAttempts
2014-10-01 02:07:04 -07:00
ripplerm
d107092540 configurable maxAttempts 2014-10-01 14:43:44 +08:00
wltsmrz
c2f379d3b3 Merge pull request #176 from shekenahglory/develop
[FIX] change handling of requestLedger options
2014-09-28 00:34:30 -07:00
Matthew Fettig
57b70300f5 [FIX] change handling of requestLedger options
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
2014-09-26 21:41:22 -07:00
Geert Weening
eeba86f9c5 [TASK] bump version to 0.8.2 2014-09-25 10:05:57 -07:00
Geert Weening
e0d68e60ec Merge pull request #172 from booxood/modify-docs-guides-md
Update docs/GUIDES.md
2014-09-24 23:44:08 -07:00
Liucw
254248486b Update docs/GUIDES.md 2014-09-25 14:34:29 +08:00
Geert Weening
1b57cc6d35 [TASK] bump verison to 0.8.2-rc2 2014-09-22 23:59:12 -07:00
Geert Weening
77234f256d [DOC] update release notes 2014-09-22 23:58:49 -07:00
Geert Weening
795d31d2db Merge branch 'release' into develop 2014-09-22 23:50:45 -07:00
wltsmrz
f3f10fd9bd Fix requestLedger arguments 2014-09-18 02:03:29 -07:00
wltsmrz
7100b4be8d Emit server with subscription events 2014-09-18 01:41:23 -07:00
wltsmrz
b1a7200d1b Deprecate account_tx map/reduce/filter 2014-09-18 01:28:43 -07:00
Geert Weening
5d8bb541c6 [TASK] bump version to 0.8.2-rc1 2014-09-17 15:02:44 -07:00
Geert Weening
b51c59b23a [TASK] update release notes 2014-09-17 15:02:21 -07:00
wltsmrz
2cd434e861 Fix orderbook reset on reconnect 2014-09-17 13:42:24 -07:00
wltsmrz
1599eb9629 Add potential missing error handlers 2014-09-17 13:40:49 -07:00
wltsmrz
8ef7481858 Allow mixed letters and numbers in currencies 2014-09-17 13:39:49 -07:00
Geert Weening
344d478b3f [TASK] bump version to 0.8.1 2014-09-15 16:52:23 -07:00
897 changed files with 66543 additions and 67404 deletions

20
.gitignore vendored
View File

@@ -1,5 +1,9 @@
# .gitignore
# Ignore package locks other than Yarn.
package-lock.json
npm-shrinkwrap.json
# Ignore vim swap files.
*.swp
@@ -17,7 +21,7 @@
# Ignore object files.
*.o
build/*.js
build/
tags
bin/rippled
Debug/*.*
@@ -25,6 +29,7 @@ Release/*.*
# Ignore locally installed node_modules
node_modules
!test/node_modules
# Ignore tmp directory.
tmp
@@ -50,5 +55,16 @@ test/config.js
# Ignore npm-debug
npm-debug.log
# Ignore dist folder, build for bower
# Ignore dist folder, built from tsc
dist/
# TypeScript incremental compilation cache
*.tsbuildinfo
# Ignore perf test cache
scripts/cache
.eslintrc
# nyc (istanbul)
.nyc_output

View File

@@ -1,3 +1,4 @@
deploy
lib-cov
coverage.html
src
dist/bower

1
.nvmrc Normal file
View File

@@ -0,0 +1 @@
v10

10
.nycrc Normal file
View File

@@ -0,0 +1,10 @@
{
"include": ["src/**/*.ts"],
"exclude": ["src/**/*.d.ts"],
"extension": [".ts"],
"require": ["ts-node/register"],
"reporter": ["text-summary", "html"],
"sourceMap": true,
"instrument": true,
"cache": true
}

View File

@@ -1,13 +1,11 @@
language: node_js
node_js:
- "0.10"
script: npm test --coverage
after_success:
- npm run coveralls
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/d1ec4245f90231619d30
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: false # default: false
- 6
- 8
- 10
- 11
script:
- yarn compile
- yarn test
- yarn build
- yarn lint

123
APPLICATIONS.md Normal file
View File

@@ -0,0 +1,123 @@
# Applications using ripple-lib (RippleAPI)
A curated list of some of the projects and apps that leverage `ripple-lib` in some way.
**Have one to add?** Please edit this file and open a PR!
## Notice (disclaimer)
These sites are independent of Ripple and have not been authorized, endorsed, sponsored or otherwise approved by Ripple or its affiliates.
Warning: Use at your own risk.
## Data and visualizations
- **[Wipple - XRP Intelligence](https://wipple.devnull.network/)**
Monitor the XRP Network in real time and explore historical statistics.
- **[XRP Charts](https://xrpcharts.ripple.com/)** (xrpcharts.ripple.com)
XRP Charts provides information based on public data, including trade volume, top markets, metrics, transactions, and more.
- **[Ripple Live](https://gatehub.net/live)** (gatehub.net/live)
Visualize XRP network transactions.
- **[XRPL Dev. Dashboard](https://xrp.fans/)** (xrp.fans)
Debugging dashboard for `rippled-ws-client-pool`, transaction and query explorer, and transaction signing and submission tool.
- **[XRP Value](http://xrpvalue.com/)**
Real-time XRP price, trades, and orderbook data from the XRP Ledger.
- **[Bithomp - XRPL validators](https://bithomp.com/validators)**
List of XRPL validators, nodes, and testnet validators.
- **[XRP Scan - XRP Ledger explorer](https://http://xrpscan.com)**
XRP Ledger explorer, metrics and analytics.
## Send and request payments
- **[XRP Tip Bot](https://www.xrptipbot.com/)**
A bot that enables users on reddit, Twitter and Discord to send XRP to each other through reddit comments and Twitter tweets.
- **[XRP Text](https://xrptext.com/)**
Send XRP using SMS text messages.
- **[XRParrot](https://xrparrot.com/)** (uses `ripple-address-codec`)
Easy EUR (SEPA) to XRP transfer (currency conversion).
- **[XRP Payment](https://xrpayments.co/)** (xrpayments.co)
Tool for generating a XRP payment request URI in a QR code, with currency converter.
## Wallets and wallet tools
- **[Toast Wallet](https://toastwallet.com/)**
A free, open source XRP Wallet for iOS, Android, Windows, Mac and Linux.
- **[Toastify Ledger](https://github.com/WietseWind/toastify-ledger)** (uses `ripple-keypairs`)
Add a Regular Key to a mnemonic XRP Wallet (e.g. Ledger Nano S) to use the account with a Family Seed (secret).
- **[Bithomp-submit](https://github.com/Bithomp/bithomp-submit)** (GitHub)
A tool to submit an offline-signed XRPL transaction.
- **[Kyte](https://kyteapp.co/)** (kyteapp.co) ([Source](https://github.com/WietseWind/Zerp-Wallet)) (Deprecated)
Web-based XRP wallet.
- **[XRP Vanity Address Generator](https://github.com/WietseWind/xrp-vanity-generator)** (Node.js)
A vanity address is a wallet address containing a few characters you like at the beginning or the end of the wallet address.
- **[XRP Account Mnemonic Recovery](https://github.com/WietseWind/xrp-mnemonic-recovery)** (uses `ripple-keypairs`)
Recover a 24 word mnemonic if one word is wrong or one word is missing.
## Development tools
- **[XRP Test Net Faucet](https://developers.ripple.com/xrp-test-net-faucet.html)**
Get some test funds for development on the test network. The faucet was built using `ripple-lib`.
## Code samples and libraries
- **[ilp-plugin-xrp-paychan](https://github.com/interledgerjs/ilp-plugin-xrp-paychan)**
Send ILP payments using XRP and payment channels (PayChan).
- **[RunKit: WietseWind](https://runkit.com/wietsewind/)**
XRP Ledger code samples for Node.js.
- **[GitHub Gist: WietseWind](https://gist.github.com/WietseWind)**
XRP Ledger code samples for Node.js and the web (mostly).
- **[rippled-ws-client-sign](https://github.com/WietseWind/rippled-ws-client-sign)**
Sign transactions, with support for MultiSign.
- **[ILP-enabled power switch](https://xrpcommunity.blog/raspberry-pi-interledger-xp-powerswitch-howto/)** ([video](https://www.youtube.com/watch?v=c-eS0HQUuJg)) (uses [`moneyd-uplink-xrp`](https://github.com/interledgerjs/moneyd-uplink-xrp))
For about $30 in parts (Raspberry Pi, 3.3V Relay board and a few wires) you can build your own power switch that will switch on if a streaming ILP payment comes in. When the payment stream stops, the power turns off.
## Related apps that do not appear to use ripple-lib
- **[XRP Stats](https://ledger.exposed/)** (ledger.exposed)
Rich list, live ledger stats and XRP distribution. Visualize escrows and flow of funds.
- **[XRP Vanity](https://xrpvanity.com/)** (xrpvanity.com)
Custom XRP addresses for sale, delivered by SetRegularKey.

View File

@@ -1,163 +1,151 @@
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var webpack = require('webpack');
var jshint = require('gulp-jshint');
var map = require('map-stream');
var bump = require('gulp-bump');
var argv = require('yargs').argv;
//var header = require('gulp-header');
/* eslint-disable no-var, no-param-reassign */
/* these eslint rules are disabled because gulp does not support babel yet */
'use strict';
const _ = require('lodash');
const fs = require('fs');
const path = require('path');
const assert = require('assert');
const gulp = require('gulp');
const webpack = require('webpack');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
var pkg = require('./package.json');
const pkg = require('./package.json');
var banner = '/*! <%= pkg.name %> - v<%= pkg.version %> - '
+ '<%= new Date().toISOString() %>\n'
+ '<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>'
+ '* Copyright (c) <%= new Date().getFullYear() %> <%= pkg.author.name %>;'
+ ' Licensed <%= pkg.license %> */'
var sjclSrc = [
'src/js/sjcl/core/sjcl.js',
'src/js/sjcl/core/aes.js',
'src/js/sjcl/core/bitArray.js',
'src/js/sjcl/core/codecString.js',
'src/js/sjcl/core/codecHex.js',
'src/js/sjcl/core/codecBase64.js',
'src/js/sjcl/core/codecBytes.js',
'src/js/sjcl/core/sha256.js',
'src/js/sjcl/core/sha512.js',
'src/js/sjcl/core/sha1.js',
'src/js/sjcl/core/ccm.js',
// 'src/js/sjcl/core/cbc.js',
// 'src/js/sjcl/core/ocb2.js',
'src/js/sjcl/core/hmac.js',
'src/js/sjcl/core/pbkdf2.js',
'src/js/sjcl/core/random.js',
'src/js/sjcl/core/convenience.js',
'src/js/sjcl/core/bn.js',
'src/js/sjcl/core/ecc.js',
'src/js/sjcl/core/srp.js',
'src/js/sjcl-custom/sjcl-ecc-pointextras.js',
'src/js/sjcl-custom/sjcl-secp256k1.js',
'src/js/sjcl-custom/sjcl-ripemd160.js',
'src/js/sjcl-custom/sjcl-extramath.js',
'src/js/sjcl-custom/sjcl-montgomery.js',
'src/js/sjcl-custom/sjcl-validecc.js',
'src/js/sjcl-custom/sjcl-ecdsa-canonical.js',
'src/js/sjcl-custom/sjcl-ecdsa-der.js',
'src/js/sjcl-custom/sjcl-ecdsa-recoverablepublickey.js',
'src/js/sjcl-custom/sjcl-jacobi.js'
];
gulp.task('concat-sjcl', function() {
return gulp.src(sjclSrc)
.pipe(concat('sjcl.js'))
.pipe(gulp.dest('./build/'));
});
gulp.task('build', [ 'concat-sjcl' ], function(callback) {
webpack({
cache: true,
entry: './src/js/ripple/index.js',
output: {
library: 'ripple',
path: './build/',
filename: [ 'ripple-', '.js' ].join(pkg.version)
},
}, callback);
});
gulp.task('bower-build', [ 'build' ], function(callback) {
return gulp.src([ './build/ripple-', '.js' ].join(pkg.version))
.pipe(rename('ripple.js'))
.pipe(gulp.dest('./dist/'));
});
gulp.task('bower-build-min', [ 'build-min' ], function(callback) {
return gulp.src([ './build/ripple-', '-min.js' ].join(pkg.version))
.pipe(rename('ripple-min.js'))
.pipe(gulp.dest('./dist/'));
});
gulp.task('bower-build-debug', [ 'build-debug' ], function(callback) {
return gulp.src([ './build/ripple-', '-debug.js' ].join(pkg.version))
.pipe(rename('ripple-debug.js'))
.pipe(gulp.dest('./dist/'));
});
gulp.task('bower-version', function() {
gulp.src('./dist/bower.json')
.pipe(bump({version: pkg.version}))
.pipe(gulp.dest('./dist/'));
});
gulp.task('version-bump', function() {
if (!argv.type) {
throw new Error("No type found, pass it in using the --type argument");
const uglifyOptions = {
mangle: {
reserved: ['_', 'RippleError', 'RippledError', 'UnexpectedError',
'LedgerVersionError', 'ConnectionError', 'NotConnectedError',
'DisconnectedError', 'TimeoutError', 'ResponseFormatError',
'ValidationError', 'NotFoundError', 'MissingLedgerHistoryError',
'PendingLedgerVersionError'
]
}
gulp.src('./package.json')
.pipe(bump({type:argv.type}))
.pipe(gulp.dest('./'));
});
};
gulp.task('version-beta', function() {
gulp.src('./package.json')
.pipe(bump({version: pkg.version+'-beta'}))
.pipe(gulp.dest('./'));
});
gulp.task('build-min', [ 'build' ], function(callback) {
return gulp.src([ './build/ripple-', '.js' ].join(pkg.version))
.pipe(uglify())
.pipe(rename([ 'ripple-', '-min.js' ].join(pkg.version)))
.pipe(gulp.dest('./build/'));
});
gulp.task('build-debug', [ 'concat-sjcl' ], function(callback) {
webpack({
function getWebpackConfig(extension, overrides) {
overrides = overrides || {};
let defaults = {
cache: true,
entry: './src/js/ripple/index.js',
externals: [{
'lodash': '_'
}],
entry: './src/index.ts',
output: {
library: 'ripple',
path: './build/',
filename: [ 'ripple-', '-debug.js' ].join(pkg.version)
path: path.join(__dirname, 'build/'),
filename: `ripple-${pkg.version}${extension}`
},
debug: true,
devtool: 'eval'
}, callback);
});
plugins: [
new webpack.NormalModuleReplacementPlugin(/^ws$/, './wswrapper'),
new webpack.NormalModuleReplacementPlugin(/^\.\/wallet$/, './wallet-web'),
new webpack.NormalModuleReplacementPlugin(/^.*setup-api$/,
'./setup-api-web')
],
module: {
rules: [{
test: /jayson/,
use: 'null',
}, {
test: /\.ts$/,
use: [{
loader: 'ts-loader',
options: {
compilerOptions: {
composite: false,
declaration: false,
declarationMap: false
}
},
}],
}]
},
resolve: {
extensions: [ '.ts', '.js' ]
},
};
return _.assign({}, defaults, overrides);
}
gulp.task('lint', function() {
gulp.src('src/js/ripple/*.js')
.pipe(jshint())
.pipe(map(function(file, callback) {
if (!file.jshint.success) {
console.log('\nIn', file.path);
file.jshint.results.forEach(function(err) {
if (err && err.error) {
var col1 = err.error.line + ':' + err.error.character;
var col2 = '[' + err.error.reason + ']';
var col3 = '(' + err.error.code + ')';
while (col1.length < 8) {
col1 += ' ';
}
console.log(' ' + [ col1, col2, col3 ].join(' '));
}
});
function webpackConfigForWebTest(testFileName) {
var match = testFileName.match(/\/?([^\/]*)-test.js$/);
if (!match) {
assert(false, 'wrong filename:' + testFileName);
}
var configOverrides = {
externals: [{
'lodash': '_',
'ripple-api': 'ripple',
'net': 'null'
}],
entry: testFileName,
output: {
library: match[1].replace(/-/g, '_'),
path: path.join(__dirname, 'test-compiled-for-web/'),
filename: match[1] + '-test.js'
}
};
return getWebpackConfig('.js', configOverrides);
}
callback(null, file);
}));
});
function createLink(from, to) {
if (fs.existsSync(to)) {
fs.unlinkSync(to);
}
fs.linkSync(from, to);
}
gulp.task('watch', function() {
gulp.watch('src/js/ripple/*', [ 'build-debug' ]);
});
function createBuildLink(callback) {
return function(err, res) {
createLink('./build/ripple-' + pkg.version + '.js',
'./build/ripple-latest.js');
callback(err, res);
};
}
gulp.task('default', [ 'concat-sjcl', 'build', 'build-debug', 'build-min' ]);
function watch(callback) {
gulp.watch('src/*', gulp.series(buildDebug));
callback();
}
gulp.task('bower', ['bower-build', 'bower-build-min', 'bower-build-debug', 'bower-version']);
function build(callback) {
webpack(getWebpackConfig('.js'), createBuildLink(callback));
}
function buildDebug(callback) {
const webpackConfig = getWebpackConfig('-debug.js', {devtool: 'eval'});
webpackConfig.plugins.unshift(new webpack.LoaderOptionsPlugin({debug: true}));
webpack(webpackConfig, callback);
}
function buildMin(callback) {
const webpackConfig = getWebpackConfig('-min.js');
webpackConfig.plugins.push(new UglifyJsPlugin({uglifyOptions}));
webpack(webpackConfig, function() {
createLink('./build/ripple-' + pkg.version + '-min.js',
'./build/ripple-latest-min.js');
callback();
});
}
function buildTests(callback) {
var times = 0;
function done() {
if (++times >= 5) {
callback();
}
}
webpack(webpackConfigForWebTest('./test/rangeset-test.js'), done);
webpack(webpackConfigForWebTest('./test/connection-test.js'), done);
webpack(webpackConfigForWebTest('./test/api-test.js'), done);
webpack(webpackConfigForWebTest('./test/broadcast-api-test.js'), done);
webpack(webpackConfigForWebTest('./test/integration/integration-test.js',
'integration/'), done);
}
exports.watch = watch;
exports.build = build;
exports.buildDebug = buildDebug;
exports.buildMin = buildMin;
exports.buildTests = buildTests;
exports.default = gulp.parallel(build, buildDebug, buildMin);

1059
HISTORY.md

File diff suppressed because it is too large Load Diff

43
LICENSE
View File

@@ -1,4 +1,6 @@
Copyright (c) 2012,2013,2014 Ripple Labs Inc.
ISC License
Copyright (c) 2012-2015 Ripple Labs Inc.
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
@@ -11,42 +13,3 @@ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
--------------------------------------
Some code from Tom Wu:
This software is covered under the following copyright:
Copyright (c) 2003-2005 Tom Wu
All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER
RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF
THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
In addition, the following condition applies:
All redistributions must retain an intact copy of this copyright notice
and disclaimer.
Address all questions regarding this license to:
Tom Wu
tjw@cs.Stanford.EDU

112
README.md
View File

@@ -1,94 +1,78 @@
#ripple-lib
# ripple-lib
JavaScript client for [rippled](https://github.com/ripple/rippled)
[![Build Status](https://travis-ci.org/ripple/ripple-lib.svg?branch=develop)](https://travis-ci.org/ripple/ripple-lib) [![Coverage Status](https://coveralls.io/repos/ripple/ripple-lib/badge.png?branch=develop)](https://coveralls.io/r/ripple/ripple-lib?branch=develop)
A JavaScript API for interacting with the XRP Ledger
[![NPM](https://nodei.co/npm/ripple-lib.png)](https://www.npmjs.org/package/ripple-lib)
###Features
### Features
+ Connect to a rippled server in JavaScript (Node.js or browser)
+ Issue [rippled API](https://ripple.com/wiki/JSON_Messages) requests
+ Listen to events on the Ripple network (transaction, ledger, etc.)
+ Sign and submit transactions to the Ripple network
+ Connect to a `rippled` server from Node.js or a web browser
+ Helpers for creating requests and parsing responses for the [rippled API](https://developers.ripple.com/rippled-api.html)
+ Listen to events on the XRP Ledger (transactions, ledger, validations, etc.)
+ Sign and submit transactions to the XRP Ledger
+ Type definitions for TypeScript
###In this file
## Getting Started
1. [Installation](README.md#installation)
2. [Quickstart](README.md#quickstart)
3. [Running tests](https://github.com/ripple/ripple-lib#running-tests)
See also: [RippleAPI Beginners Guide](https://xrpl.org/get-started-with-rippleapi-for-javascript.html)
###Additional documentation
### Requirements
1. [Guides](docs/GUIDES.md)
2. [API Reference](docs/REFERENCE.md)
3. [Wiki](https://ripple.com/wiki/Ripple_JavaScript_library)
+ **[Node v10](https://nodejs.org/)** is recommended. Other versions may work but are not frequently tested.
+ **[Yarn](https://yarnpkg.com/)** is recommended. `npm` may work but we use `yarn.lock`.
###Also see
+ [The Ripple wiki](https://ripple.com/wiki)
+ [ripple.com](https://ripple.com)
##Installation
**Via npm for Node.js**
### Install
In an existing project (with `package.json`), install `ripple-lib`:
```
$ npm install ripple-lib
$ yarn add ripple-lib
```
**Via bower (for browser use)**
Then see the [documentation](https://github.com/ripple/ripple-lib/blob/develop/docs/index.md) and [code samples](https://github.com/ripple/ripple-lib/tree/develop/docs/samples).
**What is ripple-lib used for?** Here's a [list of applications](APPLICATIONS.md) that use `ripple-lib`. Open a PR to add your app or project to the list!
### Mailing Lists
We have a low-traffic mailing list for announcements of new ripple-lib releases. (About 1 email per week)
+ [Subscribe to ripple-lib-announce](https://groups.google.com/forum/#!forum/ripple-lib-announce)
If you're using the XRP Ledger in production, you should run a [rippled server](https://github.com/ripple/rippled) and subscribe to the ripple-server mailing list as well.
+ [Subscribe to ripple-server](https://groups.google.com/forum/#!forum/ripple-server)
## Development
To build the library for Node.js:
```
$ bower install ripple
$ yarn compile
```
See the [bower-ripple repo](https://github.com/ripple/bower-ripple) for additional bower instructions
**Building ripple-lib from github**
The TypeScript compiler will [output](./tsconfig.json#L7) the resulting JS files in `./dist/npm/`.
To build the library for the browser:
```
$ git clone https://github.com/ripple/ripple-lib
$ npm install
$ npm run build
$ yarn build
```
Then use the minified `build/ripple-*-min.js`
Gulp will [output](./Gulpfile.js) the resulting JS files in `./build/`.
##Quickstart
For details, see the `scripts` in `package.json`.
`Remote.js` ([remote.js](https://github.com/ripple/ripple-lib/blob/develop/src/js/ripple/remote.js)) is the point of entry for interacting with rippled
```js
/* Loading ripple-lib with Node.js */
var Remote = require('ripple-lib').Remote;
/* Loading ripple-lib in a webpage */
// var Remote = ripple.Remote;
var remote = new Remote({
// see the API Reference for available options
servers: [ 'wss://s1.ripple.com:443' ]
});
remote.connect(function() {
/* remote connected */
remote.request('server_info', function(err, info) {
});
});
```
##Running tests
## Running Tests
1. Clone the repository
2. `cd` into the repository and install dependencies with `yarn install`
3. `yarn test`
2. `cd` into the repository and install dependencies with `npm install`
Also, run `yarn lint` to lint the code with `tslint`.
3. `npm test` or `node_modules/.bin/mocha test/*-test.js`
## Generating Documentation
**Generating code coverage**
The continuous integration tests require that the documentation stays up-to-date. If you make changes to the JSON schemas, fixtures, or documentation sources, you must update the documentation by running `yarn run docgen`.
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/`.
## More Information
+ [RippleAPI Reference](https://developers.ripple.com/rippleapi-reference.html) - XRP Ledger Dev Portal
+ [XRP Ledger Dev Portal](https://developers.ripple.com/)

View File

@@ -1,44 +0,0 @@
var Benchmark;
try {
Benchmark = require('benchmark');
} catch (e) {
console.error("Please install Benchmark.js: npm install benchmark");
process.exit(1);
}
var sjcl = require('../build/sjcl');
var jsbn = require('../src/js/jsbn/jsbn');
var base = "3f70f29d3f3ae354a6d2536ceafba83cfc787cd91e7acd2b6bde05e62beb8295ae18e3f786726f8d034bbc15bf8331df959f59d431736d5f306aaba63dacec279484e39d76db9b527738072af15730e8b9956a64e8e4dbe868f77d1414a8a8b8bf65380a1f008d39c5fabe1a9f8343929342ab7b4f635bdc52532d764701ff3d8072c475c012ff0c59373e8bc423928d99f58c3a6d9f6ab21ee20bc8e8818fc147db09f60c81906f2c6f73dc69725f075853a89f0cd02a30a8dd86b660ccdeffc292f398efb54088c822774445a6afde471f7dd327ef9996296898a5747726ccaeeceeb2e459df98b4128cb5ab8c7cd20c563f960a1aa770f3c81f13f967b6cc";
var exponent = "322e393f76a1c22b147e7d193c00c023afb7c1500b006ff1bc1cc8d391fc38bd";
var modulus = "c7f1bc1dfb1be82d244aef01228c1409c198894eca9e21430f1669b4aa3864c9f37f3d51b2b4ba1ab9e80f59d267fda1521e88b05117993175e004543c6e3611242f24432ce8efa3b81f0ff660b4f91c5d52f2511a6f38181a7bf9abeef72db056508bbb4eeb5f65f161dd2d5b439655d2ae7081fcc62fdcb281520911d96700c85cdaf12e7d1f15b55ade867240722425198d4ce39019550c4c8a921fc231d3e94297688c2d77cd68ee8fdeda38b7f9a274701fef23b4eaa6c1a9c15b2d77f37634930386fc20ec291be95aed9956801e1c76601b09c413ad915ff03bfdc0b6b233686ae59e8caf11750b509ab4e57ee09202239baee3d6e392d1640185e1cd";
var expected = "5b3823974b3eda87286d3f38499de290bd575d8b02f06720acacf3d50950f9ca0ff6b749f3be03913ddca0b291e0b263bdab6c9cb97e4ab47ee9c235ff20931a8ca358726fab93614e2c549594f5c50b1c979b34f840b6d4fc51d6feb2dd072995421d17862cb405e040fc1ed662a3245a1f97bbafa6d1f7f76c7db6a802e3037acdf01ab5053f5da518d6753477193b9c25e1720519dcb9e2f6e70d5786656d356151845a49861dfc40187eff0e85cd18b1f3f3b97c476472edfa090b868b2388edfffecc521c20df8cebb8aacfb3669b020330dd6ea64b2a3067a972b8f249bccc19347eff43893e916f0949bd5789a5cce0f8b7cd87cece909d679345c0d4";
var BigInteger = jsbn.BigInteger;
var jsbnBase = new BigInteger(base, 16);
var jsbnExponent = new BigInteger(exponent, 16);
var jsbnModulus = new BigInteger(modulus, 16);
var bn = sjcl.bn;
var sjclBase = new bn(base);
var sjclExponent = new bn(exponent);
var sjclModulus = new bn(modulus);
var suite = new Benchmark.Suite;
// add tests
suite.add('jsbn#modPow', function() {
jsbnBase.modPow(jsbnExponent, jsbnModulus);
});
suite.add('sjcl#powermodMontgomery', function() {
sjclBase.powermodMontgomery(sjclExponent, sjclModulus);
});
suite.on('cycle', function(event) {
console.log(String(event.target));
});
suite.on('complete', function() {
console.log('Fastest is ' + this.filter('fastest').pluck('name'));
});
// run async
console.log("Running benchmark...");
suite.run({ 'async': false });

View File

@@ -1,47 +0,0 @@
#!/usr/bin/env node
var SerializedObject = require('../src/js/ripple/serializedobject').SerializedObject;
var argv = process.argv.slice(2);
var blob;
blob = argv.shift();
if (blob === '-') {
read_input(ready);
} else {
ready();
}
function read_input(callback) {
tx_json = '';
process.stdin.on('data', function(data) { tx_json += data; });
process.stdin.on('end', callback);
process.stdin.resume();
}
function ready() {
var valid_arguments = blob;
if (!valid_arguments) {
console.error('Invalid arguments\n');
print_usage();
} else {
decode();
}
}
function print_usage() {
console.log(
'Usage: decode_binary.js <hex_blob>\n\n',
'Example: decode_binary.js 120000240000000161D6871AFD498D00000000000000000000000000005553440000000000550FC62003E785DC231A1058A05E56E3F09CF4E668400000000000000A732102AE75B908F0A95F740A7BFA96057637E5C2170BC8DAD13B2F7B52AE75FAEBEFCF811450F97A072F1C4357F1AD84566A609479D927C9428314550FC62003E785DC231A1058A05E56E3F09CF4E6'
);
};
function decode() {
buffer = new SerializedObject(blob);
console.log(buffer.to_json());
};
// vim:sw=2:sts=2:ts=8:et

View File

@@ -1,96 +0,0 @@
#!/usr/bin/env node
var Transaction = require('../src/js/ripple/transaction').Transaction;
var argv = process.argv.slice(2);
var verbose;
var secret;
var tx_json;
if (~argv.indexOf('-v')){
argv.splice(argv.indexOf('-v'), 1);
verbose = true;
}
secret = argv.shift();
tx_json = argv.shift();
if (tx_json === '-') {
read_input(ready);
} else {
ready();
}
function read_input(callback) {
tx_json = '';
process.stdin.on('data', function(data) { tx_json += data; });
process.stdin.on('end', callback);
process.stdin.resume();
}
function ready() {
var valid_arguments = secret && tx_json;
if (!valid_arguments) {
console.error('Invalid arguments\n');
print_usage();
} else {
var valid_json = true;
try {
tx_json = JSON.parse(tx_json);
} catch(exception) {
valid_json = false;
}
if (!valid_json) {
console.error('Invalid JSON\n');
print_usage();
} else {
sign_transaction();
}
}
}
function print_usage() {
console.log(
'Usage: rsign.js <secret> <json>\n\n',
'Example: rsign.js ssq55ueDob4yV3kPVnNQLHB6icwpC',
JSON.stringify({
TransactionType: 'Payment',
Account: 'r3P9vH81KBayazSTrQj6S25jW6kDb779Gi',
Destination: 'r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV',
Amount: '200000000',
Fee: '10',
Sequence: 1
})
);
};
function sign_transaction() {
var tx = new Transaction();
tx.tx_json = tx_json;
tx._secret = secret;
tx.complete();
var unsigned_blob = tx.serialize().to_hex();
var unsigned_hash = tx.signingHash();
tx.sign();
if (verbose) {
var sim = { };
sim.tx_blob = tx.serialize().to_hex();
sim.tx_json = tx.tx_json;
sim.tx_signing_hash = unsigned_hash;
sim.tx_unsigned = unsigned_blob;
console.log(JSON.stringify(sim, null, 2));
} else {
console.log(tx.serialize().to_hex());
}
};
// vim:sw=2:sts=2:ts=8:et

View File

@@ -1,26 +0,0 @@
#!/usr/bin/env node
var UInt160 = require('../').UInt160;
var address = process.argv[2];
if (address === '-') {
readInput(validateAddress);
} else {
validateAddress(address);
}
function readInput(callback) {
var result = '';
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function(data) {
result += data;
});
process.stdin.on('end', function() {
callback(result);
});
};
function validateAddress(address) {
process.stdout.write((UInt160.is_valid(address.trim()) ? '0' : '1') + '\r\n');
};

18
circle.yml Normal file
View File

@@ -0,0 +1,18 @@
machine:
node:
version: 6.11.3
hosts:
testripple.circleci.com: 127.0.0.1
dependencies:
pre:
- wget https://s3-us-west-2.amazonaws.com/ripple-debs/rippled_0.30.1-b11-1.deb
- sudo dpkg -i rippled_0.30.1-b11-1.deb
test:
pre:
- rippled -a --start --conf "$HOME/$CIRCLE_PROJECT_REPONAME/test/integration/rippled.cfg":
background: true
override:
- scripts/ci.sh "$CIRCLE_NODE_INDEX" "$CIRCLE_NODE_TOTAL":
parallel: true
post:
- killall /usr/bin/rippled

View File

@@ -1,3 +0,0 @@
start newcoin
sleep 4
start index.html

View File

@@ -1,214 +0,0 @@
#Guides
This file provides step-by-step walkthroughs for some of the most common usages of `ripple-lib`.
###In this document
1. [Connecting to the Ripple network with `Remote`](GUIDES.md#connecting-to-the-ripple-network)
2. [Using `Remote` functions and `Request` objects](GUIDES.md#sending-rippled-API-requests)
3. [Listening to the network](GUIDES.md#listening-to-the-network)
4. [Submitting a payment to the network](GUIDES.md#submitting-a-payment-to-the-network)
* [A note on transaction fees](GUIDES.md#a-note-on-transaction-fees)
5. [Submitting a trade offer to the network](GUIDES.md#submitting-a-trade-offer-to-the-network)
###Also see
1. [The ripple-lib README](../README.md)
2. [The ripple-lib API Reference](REFERENCE.md)
##Generating a new Ripple Wallet
```js
var Wallet = require('ripple-lib').Wallet;
var wallet = Wallet.generate();
console.log(wallet);
// { address: 'rEf4sbVobiiDGExrNj2PkNHGMA8eS6jWh3',
// secret: 'shFh4a38EZpEdZxrLifEnVPAoBRce' }
```
##Connecting to the Ripple network
1. [Get ripple-lib](README.md#getting-ripple-lib)
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.
##Sending rippled API requests
`Remote` contains functions for constructing a `Request` object.
A `Request` is an `EventEmitter` so you can listen for success or failure events -- or, instead, you can provide a callback.
Here is an example, using [request_server_info](https://ripple.com/wiki/JSON_Messages#server_info).
+ Constructing a `Request` with event listeners
```js
var request = remote.request('server_info');
request.on('success', function onSuccess(res) {
//handle success
});
request.on('error', function onError(err) {
//handle error
});
request.request();
```
+ Using 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)
##Listening to the network
See the [wiki](https://ripple.com/wiki/JSON_Messages#subscribe) for details on subscription requests.
```js
/* Loading ripple-lib with Node.js */
var Remote = require('ripple-lib').Remote;
/* Loading ripple-lib in a webpage */
// var Remote = ripple.Remote;
var remote = new Remote({options});
remote.connect(function() {
var request = remote.request('subscribe');
request.addStream('ledger'); //remote will emit `ledger_closed`
request.addStream('transactions'); //remote will emit `transaction`
request.on('ledger_closed', function onLedgerClosed(ledgerData) {
//handle ledger
});
remote.on('transaction', function onTransacstion(transaction) {
//handle transaction
});
remote.request(function(err) {
if (err) {
} else {
}
});
});
```
* https://ripple.com/wiki/RPC_API#transactions_stream_messages
* https://ripple.com/wiki/RPC_API#ledger_stream_messages
##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.setSecret(MY_ADDRESS, MY_SECRET);
var transaction = remote.createTransaction('Payment', {
account: MY_ADDRESS,
destination: 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.setSecret(MY_ADDRESS, MY_SECRET);
var transaction = remote.createTransaction('OfferCreate', {
account: MY_ADDRESS,
buy: BUY_AMOUNT,
sell: SELL_AMOUNT,
expiration: EXPIRATION
});
transaction.submit(function(err, res) {
/* handle submission errors / success */
});
});
```

View File

@@ -1,302 +0,0 @@
#API Reference
__(More examples coming soon!)__
###In this document:
1. [`Remote` options](REFERENCE.md#remote-options)
2. [`Request` constructors](REFERENCE.md#request-constructor-functions)
+ [Server requests](REFERENCE.md#server-requests)
+ [Ledger requests](REFERENCE.md#ledger-requests)
+ [Transaction requests](REFERENCE.md#transaction-requests)
+ [Account requests](REFERENCE.md#account-requests)
+ [Orderbook requests](REFERENCE.md#orderbook-requests)
+ [Transaction requests](REFERENCE.md#transaction-requests)
3. [`Transaction` constructors](REFERENCE.md#transaction-constructors)
+ [Transaction events](REFERENCE.md#transaction-events)
###Also see:
1. [The ripple-lib README](../README.md)
2. [The ripple-lib GUIDES](GUIDES.md)
#Remote options
```js
/* Loading ripple-lib with Node.js */
var Remote = require('ripple-lib').Remote;
/* Loading ripple-lib in a webpage */
// var Remote = ripple.Remote;
var options = { };
var remote = new Remote(options);
```
A new `Remote` can be created with the following options:
+ `trace` *boolean default: false* Log all of the events emitted
+ `max_listeners` *number default: 0* Set maxListeners for servers
+ `trusted` *boolean default: false*, if remote is trusted (boolean)
+ `local_signing` *boolean default: true*
+ `local_fee` *boolean default: true* Set whether the transaction fee range will be set locally, see [A note on transaction fees](GUIDES.md#a-note-on-transaction-fees))
+ `fee_cushion` *number default: 1.2* Extra fee multiplier to account for async fee changes, see [A note on transaction fees](GUIDES.md#a-note-on-transaction-fees))
+ `max_fee` *number default: Infinity* Maximum acceptable transaction fee, see [A note on transaction fees](GUIDES.md#a-note-on-transaction-fees)
+ `servers` *array* Array of server objects of the following form:
```js
{
host: <string>,
port: <number>,
secure: <boolean>
}
```
or
```js
'wss://host:port'
```
#Request constructor functions
##Server requests
**[server_info([callback])](https://ripple.com/wiki/JSON_Messages#server_info)**
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.setServer`. Example:
```js
var request = remote.request('server_info');
request.setServer('wss://s1.ripple.com');
request.request(function(err, res) {
});
```
**[unl_list([callback])](https://ripple.com/wiki/JSON_Messages#unl_list)**
**[unl_add(addr, comment, [callback])](https://ripple.com/wiki/JSON_Messages#unl_add)**
**[unl_delete(node, [callback])](https://ripple.com/wiki/JSON_Messages#unl_delete)**
**[requestPeers([callback])](https://ripple.com/wiki/JSON_Messages#peers)**
**[connect(ip, port, [callback])](https://ripple.com/wiki/JSON_Messages#connect)**
##Ledger requests
**[ledger(ledger, [opts], [callback])](https://ripple.com/wiki/JSON_Messages#ledger)**
**ledger_header([callback])**
**[ledger_current([callback])](https://ripple.com/wiki/JSON_Messages#ledger_current)**
**[ledger_entry(type, [callback])](https://ripple.com/wiki/JSON_Messages#ledger_entry)**
**[subscribe([streams], [callback])](https://ripple.com/wiki/JSON_Messages#subscribe)**
Start receiving selected streams from the server.
**[unsubscribe([streams], [callback])](https://ripple.com/wiki/JSON_Messages#unsubscribe)**
Stop receiving selected streams from the server.
##Account requests
**[account_info(account, [callback])](https://ripple.com/wiki/JSON_Messages#account_info)**
Return information about the specified account.
```
{
ledger_current_index: <number>,
account_data: {
Account: <string>,
Balance: <number>,
Flags: <number>,
LedgerEntryType: <string>,
OwnerCount: <number>,
PreviousTxnID: <string>,
PreviousTxnLgrSeq: <number>,
Sequence: <number> ,
index: <string>
}
}
```
**[account_lines(accountID, [account_index], [ledger], [callback])](https://ripple.com/wiki/JSON_Messages#account_lines)**
**[account_offers(accountID, [account_index], [ledger], [callback])](https://ripple.com/wiki/JSON_Messages#account_offers)**
Return the specified account's outstanding offers.
**[account_tx(options, [callback])](https://ripple.com/wiki/JSON_Messages#account_tx)**
Fetch a list of transactions that applied to this account.
Options:
+ `account`
+ `ledger_index_min`
+ `ledger_index_max`
+ `binary` *false*
+ `count` *false*
+ `descending` *false*
+ `offset` *0*
+ `limit`
+ `forward` *false*
+ `fwd_marker`
+ `rev_marker`
**[wallet_accounts(seed, [callback])](https://ripple.com/wiki/JSON_Messages#wallet_accounts)**
Return a list of accounts for a wallet. *Requires trusted remote*
**account_balance(account, [ledger], [callback])**
Get the balance for an account. Returns an [Amount](https://github.com/ripple/ripple-lib/blob/develop/src/js/ripple/amount.js) object.
**account_flags(account, [ledger], [callback])**
Return the flags for an account.
**owner_count(account, [ledger], [callback])**
Return the owner count for an account.
**ripple_balance(account, issuer, currency, [ledger], [callback])**
Return a request to get a ripple balance
##Orderbook requests
**[book_offers(options, [callback])](https://ripple.com/wiki/JSON_Messages#book_offers)**
Return the offers for an order book, also called a *snapshot*
```js
var request = remote.request('book_offers', {
taker_gets: {
'currency':'XRP'
},
taker_pays: {
'currency':'USD',
'issuer': 'rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B'
}
});
request.request(function(err, offers) {
//handle offers
});
```
##Transaction requests
**[transaction_entry(hash, [ledger_hash], [callback])](https://ripple.com/wiki/JSON_Messages#transaction_entry)**
Searches a particular ledger for a transaction hash. Default ledger is the open ledger.
**[tx(hash, [callback])](https://ripple.com/wiki/JSON_Messages#tx)**
Searches ledger history for validated transaction hashes.
**[sign(secret, tx_json, [callback])](https://ripple.com/wiki/JSON_Messages#sign)**
Sign a transaction. *Requires trusted remote*
**[submit([callback])](https://ripple.com/wiki/JSON_Messages#submit)**
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.
**[ripple_path_find(src_account, dst_account, dst_amount, src_currencies, [callback])](https://ripple.com/wiki/JSON_Messages#path_find)**
#Transaction constructors
Use `remote.createTransaction('TransactionType', [options])` to construct a transaction. To submit, use `transaction.submit([callback])`.
**Payment**
```js
var transaction = remote.createTransaction('Payment', {
account: MY_ADDRESS,
destination: DEST_ADDRESS,
amount: AMOUNT
});
```
**AccountSet**
```js
var transaction = remote.createTransaction('AccountSet', {
account: MY_ADDRESS,
set: 'RequireDest',
clear: 'RequireAuth'
});
```
**TrustSet**
```js
var transaction = remote.createTransaction('TrustSet', {
account: MY_ADDRESS,
limit: '1/USD/rrrrrrrrrrrrrrrrrrrrBZbvji'
});
```
**OfferCreate**
```js
var transaction = remote.createTransaction('OfferCreate', {
account: MY_ADDRESS,
taker_pays: '1',
taker_gets: '1/USD/rrrrrrrrrrrrrrrrrrrrBZbvji'
});
```
##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.
+ `presubmit` Immediately before transaction is submitted
+ `postsubmit` Immediately after transaction is submitted
+ `submitted` Transaction has been submitted to the network. The submission may result in a remote error or success.
+ `resubmitted` Transaction is beginning resubmission.
+ `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.
+ `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.
##Complete payment example
```js
remote.setSecret(MY_ADDRESS, MY_SECRET);
var transaction = remote.createTransaction('Payment', {
account: MY_ADDRESS,
destination: DEST_ADDRESS,
amount: AMOUNT
});
transaction.on('resubmitted', function() {
// initial submission failed, resubmitting
});
transaction.submit(function(err, res) {
// submission has finalized with either an error or success.
// the transaction will not be retried after this point
});
```
#Amount objects
Coming Soon

View File

@@ -1,168 +0,0 @@
ripple-vault-client
===================
A javascript / http client to interact with Ripple Vault servers.
The purpose of this tool is to enable applications in any javascript
environment to login with the ripple vault and access the decrypted
data stored using credentials originally obtained at ripple.com
## Vault Client Usage
vaultClient = new ripple.VaultClient(domain);
vaultClient.getAuthInfo(username, callback);
vaultClient.getRippleName(address, url, callback);
vaultClient.exists(username, callback);
vaultClient.login(username, password, callback);
vaultClient.relogin(id, cryptKey, callback);
vaultClient.unlock(username, password, encryptSecret, callback);
vaultClient.loginAndUnlock(username, password, callback);
vaultClient.register(options, callback);
vaultClient.deleteBlob(options, callback);
vaultClient.recoverBlob(options, callback);
vaultClient.rename(options, callback);
vaultClient.changePassword(options, callback);
vaultClient.verify(username, token, callback);
vaultClient.resendEmail(options, callback);
vaultClient.updateProfile(options, fn);
# Blob Methods
blob.encrypt();
blob.decrypt(encryptedBlob);
blob.encryptSecret(encryptionKey);
blob.decryptSecret(encryptionKey, secret);
blob.set(pointer, value, callback);
blob.unset(pointer, callback);
blob.extend(pointer, value, callback);
blob.unshift(pointer, value, callback);
blob.filter(pointer, field, value, subcommands, callback);
## Identity Vault
The identity vault stores identity information inside the encrypted
blob vault. The identity fields can be additionally encrypted with the
unlock key, that encrypts the secret, for added security. Methods are
accessed from the 'identity' property of the blob object.
# Identity fields
+ name
+ entityType (individual, corporation, organization)
+ email
+ phone
+ address
+ contact
+ line1
+ line2
+ city
+ postalCode
+ region - state/province/region
+ country
+ nationalID
+ number
+ type (ssn, taxID, passport, driversLicense, other)
+ country - issuing country
+ birthday
+ birthplace
# Identity Methods
blob.identity.set(pointer, key, value, callback);
blob.identity.unset(pointer, key, callback);
blob.identity.get(pointer, key);
blob.identity.getAll(key);
blob.identity.getFullAddress(key); //get text string of full address
## Spec Tests
Run `npm test` to test the high-level behavior specs
Ripple Txt
✓ should get the content of a ripple.txt file from a given domain
✓ should get currencies from a ripple.txt file for a given domain
✓ should get the domain from a given url
AuthInfo
✓ should get auth info
VaultClient
#initialization
✓ should be initialized with a domain
✓ should default to ripple.com without a domain
#exists
✓ should determine if a username exists on the domain
#login
✓ with username and password should retrive the blob, crypt key, and id
#relogin
✓ should retrieve the decrypted blob with blob vault url, id, and crypt key
#unlock
✓ should access the wallet secret using encryption secret, username and password
#loginAndUnlock
✓ should get the decrypted blob and decrypted secret given name and password
#register
✓ should create a new blob
#deleteBlob
✓ should remove an existing blob
#updateProfile
✓ should update profile parameters associated with a blob
Blob
#set
#extend
#unset
#unshift
#filter
#consolidate
#rename
✓ should change the username of a blob
#changePassword
✓ should change the password and keys of a blob
#recoverBlob
✓ should recover the blob given a username and secret
#verifyEmail
✓ should verify an email given a username and token
#resendVerifcationEmail
✓ should resend a verification given options
identity
#identity_set
#identity_get
#identity_getAll
#identity_getFullAddress
#identity_unset

6114
docs/index.md Normal file

File diff suppressed because it is too large Load Diff

3
docs/samples/README.md Normal file
View File

@@ -0,0 +1,3 @@
Usage:
babel-node balances.js
babel-node payment.js (requires setting address and secret in source file first)

12
docs/samples/balances.js Normal file
View File

@@ -0,0 +1,12 @@
'use strict';
const RippleAPI = require('../../src').RippleAPI; // require('ripple-lib')
const api = new RippleAPI({server: 'wss://s1.ripple.com:443'});
const address = 'r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV';
api.connect().then(() => {
api.getBalances(address).then(balances => {
console.log(JSON.stringify(balances, null, 2));
process.exit();
});
});

38
docs/samples/cancelall.js Normal file
View File

@@ -0,0 +1,38 @@
'use strict';
const RippleAPI = require('../../dist/npm').RippleAPI; // require('ripple-lib')
const address = 'rLDYrujdKUfVx28T9vRDAbyJ7G2WVXKo4K';
const secret = '';
const api = new RippleAPI({server: 'wss://s1.ripple.com:443'});
const instructions = {maxLedgerVersionOffset: 5};
function fail(message) {
console.error(message);
process.exit(1);
}
function cancelOrder(orderSequence) {
console.log('Cancelling order: ' + orderSequence.toString());
return api.prepareOrderCancellation(address, {orderSequence}, instructions)
.then(prepared => {
const signing = api.sign(prepared.txJSON, secret);
return api.submit(signing.signedTransaction);
});
}
function cancelAllOrders(orderSequences) {
if (orderSequences.length === 0) {
return Promise.resolve();
}
const orderSequence = orderSequences.pop();
return cancelOrder(orderSequence).then(() => cancelAllOrders(orderSequences));
}
api.connect().then(() => {
console.log('Connected...');
return api.getOrders(address).then(orders => {
const orderSequences = orders.map(order => order.properties.sequence);
return cancelAllOrders(orderSequences);
}).then(() => process.exit(0));
}).catch(fail);

45
docs/samples/payment.js Normal file
View File

@@ -0,0 +1,45 @@
'use strict';
const RippleAPI = require('../../src').RippleAPI; // require('ripple-lib')
const address = 'INSERT ADDRESS HERE';
const secret = 'INSERT SECRET HERE';
const api = new RippleAPI({server: 'wss://s1.ripple.com:443'});
const instructions = {maxLedgerVersionOffset: 5};
const payment = {
source: {
address: address,
maxAmount: {
value: '0.01',
currency: 'XRP'
}
},
destination: {
address: 'rKmBGxocj9Abgy25J51Mk1iqFzW9aVF9Tc',
amount: {
value: '0.01',
currency: 'XRP'
}
}
};
function quit(message) {
console.log(message);
process.exit(0);
}
function fail(message) {
console.error(message);
process.exit(1);
}
api.connect().then(() => {
console.log('Connected...');
return api.preparePayment(address, payment, instructions).then(prepared => {
console.log('Payment transaction prepared...');
const {signedTransaction} = api.sign(prepared.txJSON, secret);
console.log('Payment transaction signed...');
api.submit(signedTransaction).then(quit, fail);
});
}).catch(fail);

View File

@@ -0,0 +1,55 @@
# Basic Types
## Address
```json
"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59"
```
Every XRP Ledger account has an *address*, which is a base58-encoding of a hash of the account's public key. XRP Ledger addresses always start with the lowercase letter `r`.
## Account Sequence Number
Every XRP Ledger account has a *sequence number* that is used to keep transactions in order. Every transaction must have a sequence number. A transaction can only be executed if it has the next sequence number in order, of the account sending it. This prevents one transaction from executing twice and transactions executing out of order. The sequence number starts at `1` and increments for each transaction that the account makes.
## Currency
Currencies are represented as either 3-character currency codes or 40-character uppercase hexadecimal strings. We recommend using uppercase [ISO 4217 Currency Codes](http://www.xe.com/iso4217.php) only. The string "XRP" is disallowed on trustlines because it is reserved for the XRP Ledger's native currency. The following characters are permitted: all uppercase and lowercase letters, digits, as well as the symbols `?`, `!`, `@`, `#`, `$`, `%`, `^`, `&`, `*`, `<`, `>`, `(`, `)`, `{`, `}`, `[`, `]`, and `|`.
## Value
A *value* is a quantity of a currency represented as a decimal string. Be careful: JavaScript's native number format does not have sufficient precision to represent all values. XRP has different precision from other currencies.
**XRP** has 6 significant digits past the decimal point. In other words, XRP cannot be divided into positive values smaller than `0.000001` (1e-6). This smallest unit is called a "drop". XRP has a maximum value of `100000000000` (1e11). Some RippleAPI methods accept XRP in order to maintain compatibility with older versions of the API. For consistency with the `rippled` APIs, we recommend formally specifying XRP values in *drops* in all API requests, and converting them to XRP for display. This is similar to Bitcoin's *satoshis* and Ethereum's *wei*. 1 XRP = 1,000,000 drops.
**Non-XRP values** have 16 decimal digits of precision, with a maximum value of `9999999999999999e80`. The smallest positive non-XRP value is `1e-81`.
## Amount
Example 100.00 USD amount:
```json
{
"currency": "USD",
"counterparty": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM",
"value": "100"
}
```
Example 3.0 XRP amount, in drops:
```json
{
"currency": "drops",
"value": "3000000"
}
```
(Requires `ripple-lib` version 1.0.0 or higher.)
An *amount* is an object specifying a currency, a quantity of that currency, and the counterparty (issuer) on the trustline that holds the value. For XRP, there is no counterparty.
A *lax amount* allows the counterparty to be omitted for all currencies. If the counterparty is not specified in an amount within a transaction specification, then any counterparty may be used for that amount.
A *lax lax amount* allows either or both the counterparty and value to be omitted.
A *balance* is an amount than can have a negative value.
<%- renderSchema('objects/amountbase.json') %>

View File

@@ -0,0 +1,62 @@
## Boilerplate
Use the following [boilerplate code](https://en.wikipedia.org/wiki/Boilerplate_code) to wrap your custom code using RippleAPI.
```javascript
const RippleAPI = require('ripple-lib').RippleAPI;
const api = new RippleAPI({
server: 'wss://s1.ripple.com' // Public rippled server hosted by Ripple, Inc.
});
api.on('error', (errorCode, errorMessage) => {
console.log(errorCode + ': ' + errorMessage);
});
api.on('connected', () => {
console.log('connected');
});
api.on('disconnected', (code) => {
// code - [close code](https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent) sent by the server
// will be 1000 if this was normal closure
console.log('disconnected, code:', code);
});
api.connect().then(() => {
/* insert code here */
}).then(() => {
return api.disconnect();
}).catch(console.error);
```
RippleAPI is designed to work in [Node.js](https://nodejs.org) version 6 or higher. Ripple recommends Node.js v10 LTS.
The code samples in this documentation are written with ECMAScript 6 (ES6) features, but `RippleAPI` also works with ECMAScript 5 (ES5). Regardless of whether you use ES5 or ES6, the methods that return Promises return [ES6-style promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).
<aside class="notice">
All the code snippets in this documentation assume that you have surrounded them with this boilerplate.
</aside>
<aside class="notice">
If you omit the "catch" section, errors may not be visible.
</aside>
<aside class="notice">
The "error" event is emitted whenever an error occurs that cannot be associated with a specific request. If the listener is not registered, an exception will be thrown whenever the event is emitted.
</aside>
### Parameters
The RippleAPI constructor optionally takes one argument, an object with the following options:
<%- renderSchema('input/api-options.json') %>
If you omit the `server` parameter, RippleAPI operates [offline](#offline-functionality).
### Installation ###
1. Install [Node.js](https://nodejs.org) and [Yarn](https://yarnpkg.com/en/docs/install). Most Linux distros have a package for Node.js; check that it's the version you want.
2. Use yarn to install RippleAPI:
`yarn add ripple-lib`
After you have installed ripple-lib, you can create scripts using the [boilerplate](#boilerplate) and run them using the Node.js executable, typically named `node`:
`node script.js`

24
docs/src/combine.md.ejs Normal file
View File

@@ -0,0 +1,24 @@
## combine
`combine(signedTransactions: Array<string>): {signedTransaction: string, id: string}`
Combines signed transactions from multiple accounts for a multisignature transaction. The signed transaction must subsequently be [submitted](#submit).
### Parameters
<%- renderSchema("input/combine.json") %>
### Return Value
This method returns an object with the following structure:
<%- renderSchema("output/sign.json") %>
### Example
```javascript
const signedTransactions = <%- importFile('test/fixtures/requests/combine.json') %>;
return api.combine(signedTransactions);
```
<%- renderFixture("responses/combine.json") %>

View File

@@ -0,0 +1,28 @@
## computeLedgerHash
`computeLedgerHash(ledger: object): string`
Compute the hash of a ledger.
### Parameters
<aside class="notice">
The parameter to this method has the same structure as the return value of getLedger.
</aside>
<%- renderSchema('input/compute-ledger-hash.json') %>
### Return Value
This method returns an uppercase hexadecimal string representing the hash of the ledger.
### Example
```javascript
const ledger = <%- importFile('test/fixtures/requests/compute-ledger-hash.json') %>;
return api.computeLedgerHash(ledger);
```
```json
"F4D865D83EB88C1A1911B9E90641919A1314F36E1B099F8E95FE3B7C77BE3349"
```

17
docs/src/connect.md.ejs Normal file
View File

@@ -0,0 +1,17 @@
## connect
`connect(): Promise<void>`
Tells the RippleAPI instance to connect to its rippled server.
### Parameters
This method has no parameters.
### Return Value
This method returns a promise that resolves with a void value when a connection is established.
### Example
See [Boilerplate](#boilerplate) for code sample.

View File

@@ -0,0 +1,19 @@
## deriveAddress
`deriveAddress(publicKey: string): string`
Derive an XRP Ledger address from a public key.
### Parameters
This method takes one parameter, the public key from which to derive the address.
### Return Value
This method returns a string corresponding to the address derived from the public key.
### Example
```javascript
var address = api.deriveAddress(public_key);
```

View File

@@ -0,0 +1,21 @@
## deriveKeypair
`deriveKeypair(seed: string): {privateKey: string, publicKey: string}`
Derive a public and private key from a seed.
### Parameters
This method takes one parameter, the seed from which to derive the public and private key.
### Return Value
This method returns an object containing the public and private components of the keypair corresponding to the seed.
### Example
```javascript
var keypair = api.deriveKeypair(seed)
var public_key = keypair.publicKey;
var private_key = keypair.privateKey;
```

View File

@@ -0,0 +1,17 @@
## disconnect
`disconnect(): Promise<void>`
Tells the RippleAPI instance to disconnect from its rippled server.
### Parameters
This method has no parameters.
### Return Value
This method returns a promise that resolves with a void value when a connection is destroyed.
### Example
See [Boilerplate](#boilerplate) for code sample

81
docs/src/events.md.ejs Normal file
View File

@@ -0,0 +1,81 @@
# API Events
## ledger
This event is emitted whenever a new ledger version is validated on the connected server.
### Return Value
<%- renderSchema('output/ledger-event.json') %>
### Example
```javascript
api.on('ledger', ledger => {
console.log(JSON.stringify(ledger, null, 2));
});
```
<%- renderFixture('responses/ledger-event.json') %>
## error
This event is emitted when there is an error on the connection to the server that cannot be associated to a specific request.
### Return Value
The first parameter is a string indicating the error type:
* `badMessage` - rippled returned a malformed message
* `websocket` - the websocket library emitted an error
* one of the error codes found in the [rippled Universal Errors](https://ripple.com/build/rippled-apis/#universal-errors).
The second parameter is a message explaining the error.
The third parameter is:
* the message that caused the error for `badMessage`
* the error object emitted for `websocket`
* the parsed response for rippled errors
### Example
```javascript
api.on('error', (errorCode, errorMessage, data) => {
console.log(errorCode + ': ' + errorMessage);
});
```
```
tooBusy: The server is too busy to help you now.
```
## connected
This event is emitted after connection successfully opened.
### Example
```javascript
api.on('connected', () => {
console.log('Connection is open now.');
});
```
## disconnected
This event is emitted when connection is closed.
### Return Value
The only parameter is a number containing the [close code](https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent) send by the server.
### Example
```javascript
api.on('disconnected', (code) => {
if (code !== 1000) {
console.log('Connection is closed due to error.');
} else {
console.log('Connection is closed normally.');
}
});
```

View File

@@ -0,0 +1,254 @@
## formatBidsAndAsks
`formatBidsAndAsks(orderbookInfo: {base: Issue, counter: Issue}, offers: BookOffer[]): orderbook`
Returns formatted bids and asks, which make up an orderbook.
This is a static method on the `RippleAPI` class.
### Parameters
This method takes two parameters.
1. An `OrderbookInfo` object: `{ base: Issue, counter: Issue }`.
2. An array of `BookOffer` objects.
### Return Value
This method returns an object with two properties: `bids` and `asks`, each of which is an array of bids (buy orders) or asks (sell orders), respectively. (Note: the structures of `bids` and `asks` are identical.)
Object structure:
<%- renderSchema('output/get-orderbook.json') %>
**Raw order data:** The response includes a `data` property containing the raw order data. This may include `owner_funds`, `Flags`, and other fields.
For details, see the rippled method [book_offers](https://ripple.com/build/rippled-apis/#book-offers).
### Example
```javascript
const orderbookInfo = {
"base": {
"currency": "USD",
"counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
},
"counter": {
"currency": "BTC",
"counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
}
};
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
return Promise.all(
[
this.api.request('book_offers', {
taker_gets: RippleAPI.renameCounterpartyToIssuer(orderbookInfo.base),
taker_pays: RippleAPI.renameCounterpartyToIssuer(orderbookInfo.counter),
ledger_index: 'validated',
limit: 20,
taker: address
}),
this.api.request('book_offers', {
taker_gets: RippleAPI.renameCounterpartyToIssuer(orderbookInfo.counter),
taker_pays: RippleAPI.renameCounterpartyToIssuer(orderbookInfo.base),
ledger_index: 'validated',
limit: 20,
taker: address
})
]
).then((directOfferResults, reverseOfferResults) => {
const directOffers = (directOfferResults ? directOfferResults : []).reduce((acc, res) => acc.concat(res.offers), [])
const reverseOffers = (reverseOfferResults ? reverseOfferResults : []).reduce((acc, res) => acc.concat(res.offers), [])
const orderbook = RippleAPI.formatBidsAndAsks(orderbookInfo, [...directOffers, ...reverseOffers]);
console.log(JSON.stringify(orderbook, null, 2));
});
```
```
{
"bids": [
{
"specification": {
"direction": "buy",
"quantity": {
"currency": "USD",
"value": "0.71800168",
"counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
},
"totalPrice": {
"currency": "BTC",
"value": "0.00016708342",
"counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
}
},
"properties": {
"maker": "rUKoQ1Zhn6c8EfPsaVa2Yx5NqaKN1JQSvq",
"sequence": 262660,
"makerExchangeRate": "4297.264683713081"
},
"data": {
"Account": "rUKoQ1Zhn6c8EfPsaVa2Yx5NqaKN1JQSvq",
"BookDirectory": "6EAB7C172DEFA430DBFAD120FDC373B5F5AF8B191649EC98580F4456E6FA8239",
"BookNode": "0000000000000000",
"Flags": 0,
"LedgerEntryType": "Offer",
"OwnerNode": "000000000000001D",
"PreviousTxnID": "16D75506C6317723FC03543130B5E0AAB13E8AD22514C1DB098BE05771C90447",
"PreviousTxnLgrSeq": 43127860,
"Sequence": 262660,
"TakerGets": {
"currency": "BTC",
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
"value": "0.00016708342"
},
"TakerPays": {
"currency": "USD",
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
"value": "0.71800168"
},
"index": "DE877FB94EF892A4BCC58DB8CDE063D97AB5133201905DE6C8650B5DEA19E11B",
"owner_funds": "0.03358376764081196",
"quality": "4297.264683713081"
}
},
{
"specification": {
"direction": "buy",
"quantity": {
"currency": "USD",
"value": "1.6770875",
"counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
},
"totalPrice": {
"currency": "BTC",
"value": "0.00038681218",
"counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
}
},
"properties": {
"maker": "rpmL45YbZWKgp8AH8EjBSknWo5c8dNuuBM",
"sequence": 231459,
"makerExchangeRate": "4335.663628792661"
},
"data": {
"Account": "rpmL45YbZWKgp8AH8EjBSknWo5c8dNuuBM",
"BookDirectory": "6EAB7C172DEFA430DBFAD120FDC373B5F5AF8B191649EC98580F67435A75B355",
"BookNode": "0000000000000000",
"Flags": 0,
"LedgerEntryType": "Offer",
"OwnerNode": "0000000000000001",
"PreviousTxnID": "F049EAFDDDA7B99970F77533743D95C9E12A16FE6C56215A0B09C32C4D23163F",
"PreviousTxnLgrSeq": 43127094,
"Sequence": 231459,
"TakerGets": {
"currency": "BTC",
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
"value": "0.00038681218"
},
"TakerPays": {
"currency": "USD",
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
"value": "1.6770875"
},
"index": "3B314A51BD57601CA1509834DF9462037BF4B05AFCC1E1EFD334DB4E2D7B2AA6",
"owner_funds": "0.03906802968738533",
"quality": "4335.663628792661"
}
},
// ... trimmed for brevity ...
],
"asks": [
{
"specification": {
"direction": "sell",
"quantity": {
"currency": "USD",
"value": "0.71085738",
"counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
},
"totalPrice": {
"currency": "BTC",
"value": "0.00016876265",
"counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
}
},
"properties": {
"maker": "rUKoQ1Zhn6c8EfPsaVa2Yx5NqaKN1JQSvq",
"sequence": 262664,
"makerExchangeRate": "0.0002374071856720401"
},
"data": {
"Account": "rUKoQ1Zhn6c8EfPsaVa2Yx5NqaKN1JQSvq",
"BookDirectory": "20294C923E80A51B487EB9547B3835FD483748B170D2D0A451086F34ADB0EA11",
"BookNode": "0000000000000000",
"Flags": 0,
"LedgerEntryType": "Offer",
"OwnerNode": "000000000000001D",
"PreviousTxnID": "54CE0B2783AF973718FAFA35E864A3C172BE488EBBB6F2852611C6DAC8893BDF",
"PreviousTxnLgrSeq": 43127875,
"Sequence": 262664,
"TakerGets": {
"currency": "USD",
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
"value": "0.71085738"
},
"TakerPays": {
"currency": "BTC",
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
"value": "0.00016876265"
},
"index": "2D4ED103D6B3FEFA21BC385C53B63359F5678E5AA5429DDE6E1D8FE8B41CD6A8",
"owner_funds": "142.8821425048244",
"quality": "0.0002374071856720401"
}
},
{
"specification": {
"direction": "sell",
"quantity": {
"currency": "USD",
"value": "1.6438778",
"counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
},
"totalPrice": {
"currency": "BTC",
"value": "0.00039462656",
"counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
}
},
"properties": {
"maker": "rpmL45YbZWKgp8AH8EjBSknWo5c8dNuuBM",
"sequence": 231483,
"makerExchangeRate": "0.0002400583303698121"
},
"data": {
"Account": "rpmL45YbZWKgp8AH8EjBSknWo5c8dNuuBM",
"BookDirectory": "20294C923E80A51B487EB9547B3835FD483748B170D2D0A4510887515B1216C9",
"BookNode": "0000000000000000",
"Flags": 0,
"LedgerEntryType": "Offer",
"OwnerNode": "0000000000000001",
"PreviousTxnID": "6FA370F52C45F6149482156FF7B4226713AECE991FB7D053F74172CB0B8F24E9",
"PreviousTxnLgrSeq": 43127158,
"Sequence": 231483,
"TakerGets": {
"currency": "USD",
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
"value": "1.6438778"
},
"TakerPays": {
"currency": "BTC",
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
"value": "0.00039462656"
},
"index": "735F9661AD006BA0776859BE371D445555FC0815604603AC056469C16AC84AE3",
"owner_funds": "166.0316626329364",
"quality": "0.0002400583303698121"
}
},
// ... trimmed for brevity ...
]
}
```

View File

@@ -0,0 +1,23 @@
## generateAddress
`generateAddress(): {address: string, secret: string}`
Generate a new XRP Ledger address and corresponding secret.
### Parameters
<%- renderSchema('input/generate-address.json') %>
### Return Value
This method returns an object with the following structure:
<%- renderSchema('output/generate-address.json') %>
### Example
```javascript
return api.generateAddress();
```
<%- renderFixture('responses/generate-address.json') %>

View File

@@ -0,0 +1,25 @@
## getAccountInfo
`getAccountInfo(address: string, options: object): Promise<object>`
Returns information for the specified account. Note: For account data that is modifiable by the user, see [getSettings](#getsettings).
### Parameters
<%- renderSchema('input/get-account-info.json') %>
### Return Value
This method returns a promise that resolves with an object with the following structure:
<%- renderSchema('output/get-account-info.json') %>
### Example
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
return api.getAccountInfo(address).then(info =>
{/* ... */});
```
<%- renderFixture('responses/get-account-info.json') %>

View File

@@ -0,0 +1,33 @@
## getAccountObjects
`getAccountObjects(address: string, options: object): Promise<AccountObjectsResponse>`
Returns objects owned by an account. For an account's trust lines and balances, see `getTrustlines` and `getBalances`.
### Parameters
<%- renderSchema('input/get-account-objects.json') %>
### Return Value
This method returns a promise that resolves with an object with the following structure:
<%- renderSchema('output/get-account-objects.json') %>
The types of objects that may be returned include:
* Offer objects for orders that are currently live, unfunded, or expired but not yet removed.
* RippleState objects for trust lines where this account's side is not in the default state.
* A SignerList object if the account has multi-signing enabled.
* Escrow objects for held payments that have not yet been executed or canceled.
* PayChannel objects for open payment channels.
* Check objects for pending checks.
### Example
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
return api.getAccountObjects(address: address).then(objects =>
{/* ... */});
```
<%- renderFixture('responses/get-account-objects.json') %>

View File

@@ -0,0 +1,25 @@
## getBalanceSheet
`getBalanceSheet(address: string, options: object): Promise<object>`
Returns aggregate balances by currency plus a breakdown of assets and obligations for a specified account.
### Parameters
<%- renderSchema('input/get-balance-sheet.json') %>
### Return Value
This method returns a promise that resolves with an object with the following structure:
<%- renderSchema('output/get-balance-sheet.json') %>
### Example
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
return api.getBalanceSheet(address).then(balanceSheet =>
{/* ... */});
```
<%- renderFixture('responses/get-balance-sheet.json') %>

View File

@@ -0,0 +1,25 @@
## getBalances
`getBalances(address: string, options: object): Promise<Array<object>>`
Returns balances for a specified account.
### Parameters
<%- renderSchema('input/get-balances.json') %>
### Return Value
This method returns a promise that resolves with an array of objects with the following structure:
<%- renderSchema('output/get-balances.json') %>
### Example
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
return api.getBalances(address).then(balances =>
{/* ... */});
```
<%- renderFixture('responses/get-balances.json') %>

25
docs/src/getFee.md.ejs Normal file
View File

@@ -0,0 +1,25 @@
## getFee
`getFee(): Promise<string>`
Returns the estimated transaction fee for the rippled server the RippleAPI instance is connected to.
This will use the [feeCushion parameter](#parameters) provided to the RippleAPI constructor, or the default value of `1.2`.
### Parameters
<%- renderSchema('input/get-fee.json') %>
### Return Value
This method returns a promise that resolves with a string-encoded floating point value representing the estimated fee to submit a transaction, expressed in XRP.
### Example
```javascript
return api.getFee().then(fee => {/* ... */});
```
```json
"0.000012"
```

24
docs/src/getLedger.md.ejs Normal file
View File

@@ -0,0 +1,24 @@
## getLedger
`getLedger(options: object): Promise<object>`
Returns header information for the specified ledger (or the most recent validated ledger if no ledger is specified). Optionally, all the transactions that were validated in the ledger or the account state information can be returned with the ledger header.
### Parameters
<%- renderSchema('input/get-ledger.json') %>
### Return Value
This method returns a promise that resolves with an object with the following structure:
<%- renderSchema('output/get-ledger.json') %>
### Example
```javascript
return api.getLedger()
.then(ledger => {/* ... */});
```
<%- renderFixture('responses/get-ledger.json') %>

View File

@@ -0,0 +1,26 @@
## getLedgerVersion
`getLedgerVersion(): Promise<number>`
Returns the most recent validated ledger version number known to the connected server.
### Parameters
This method has no parameters.
### Return Value
This method returns a promise that resolves with a positive integer representing the most recent validated ledger version number known to the connected server.
### Example
```javascript
return api.getLedgerVersion().then(ledgerVersion => {
/* ... */
});
```
```json
16869039
```

View File

@@ -0,0 +1,34 @@
## getOrderbook
`getOrderbook(address: string, orderbook: object, options: object): Promise<object>`
Returns open orders for the specified account. Open orders are orders that have not yet been fully executed and are still in the order book.
**Breaking change:** In ripple-lib 1.1.0 and earlier, orders returned by this method were not sorted correctly. Orders are now sorted correctly, from best to worst.
**See also:** An alternative way to get orderbooks is with `request` and [`formatBidsAndAsks`](#formatbidsandasks).
### Parameters
<%- renderSchema('input/get-orderbook.json') %>
### Return Value
This method returns a promise that resolves with an object with the following structure (Note: the structures of `bids` and `asks` are identical):
<%- renderSchema('output/get-orderbook.json') %>
**Raw order data:** The response includes a `data` property containing the raw order data. This may include `owner_funds`, `Flags`, and other fields.
For details, see the rippled method [book_offers](https://ripple.com/build/rippled-apis/#book-offers).
### Example
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const orderbook = <%- importFile('test/fixtures/requests/get-orderbook.json') %>;
return api.getOrderbook(address, orderbook)
.then(orderbook => {/* ... */});
```
<%- renderFixture('responses/get-orderbook.json') %>

25
docs/src/getOrders.md.ejs Normal file
View File

@@ -0,0 +1,25 @@
## getOrders
`getOrders(address: string, options: object): Promise<Array<object>>`
Returns open orders for the specified account. Open orders are orders that have not yet been fully executed and are still in the order book.
### Parameters
<%- renderSchema('input/get-orders.json') %>
### Return Value
This method returns a promise that resolves with an array of objects with the following structure:
<%- renderSchema('output/get-orders.json') %>
### Example
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
return api.getOrders(address).then(orders =>
{/* ... */});
```
<%- renderFixture('responses/get-orders.json') %>

25
docs/src/getPaths.md.ejs Normal file
View File

@@ -0,0 +1,25 @@
## getPaths
`getPaths(pathfind: object): Promise<Array<object>>`
Finds paths to send a payment. Paths are options for how to route a payment.
### Parameters
<%- renderSchema("input/get-paths.json") %>
### Return Value
This method returns a promise that resolves with an array of objects with the following structure:
<%- renderSchema("output/get-paths.json") %>
### Example
```javascript
const pathfind = <%- importFile('test/fixtures/requests/getpaths/normal.json') %>;
return api.getPaths(pathfind)
.then(paths => {/* ... */});
```
<%- renderFixture("responses/get-paths.json") %>

View File

@@ -0,0 +1,26 @@
## getPaymentChannel
`getPaymentChannel(id: string): Promise<object>`
Returns specified payment channel.
### Parameters
<%- renderSchema('input/get-payment-channel.json') %>
### Return Value
This method returns a promise that resolves with an object with the following structure:
<%- renderSchema('output/get-payment-channel.json') %>
### Example
```javascript
const channelId =
'E30E709CF009A1F26E0E5C48F7AA1BFB79393764F15FB108BDC6E06D3CBD8415';
return api.getPaymentChannel(channelId).then(channel =>
{/* ... */});
```
<%- renderFixture('responses/get-payment-channel.json') %>

View File

@@ -0,0 +1,23 @@
## getServerInfo
`getServerInfo(): Promise<object>`
Get status information about the server that the RippleAPI instance is connected to.
### Parameters
This method has no parameters.
### Return Value
This method returns a promise that resolves with an object with the following structure:
<%- renderSchema('output/get-server-info.json') %>
### Example
```javascript
return api.getServerInfo().then(info => {/* ... */});
```
<%- renderFixture('responses/get-server-info.json') %>

View File

@@ -0,0 +1,25 @@
## getSettings
`getSettings(address: string, options: object): Promise<object>`
Returns settings for the specified account. Note: For account data that is not modifiable by the user, see [getAccountInfo](#getaccountinfo).
### Parameters
<%- renderSchema('input/get-settings.json') %>
### Return Value
This method returns a promise that resolves with an array of objects with the following structure (Note: all fields are optional as they will not be shown if they are set to their default value):
<%- renderSchema('output/get-settings.json') %>
### Example
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
return api.getSettings(address).then(settings =>
{/* ... */});
```
<%- renderFixture('responses/get-settings.json') %>

View File

@@ -0,0 +1,26 @@
## getTransaction
`getTransaction(id: string, options: object): Promise<object>`
Retrieves a transaction by its [Transaction ID](#transaction-id).
### Parameters
<%- renderSchema('input/get-transaction.json') %>
### Return Value
This method returns a promise that resolves with a transaction object containing the following fields.
<%- renderSchema('output/get-transaction.json') %>
### Example
```javascript
const id = '01CDEAA89BF99D97DFD47F79A0477E1DCC0989D39F70E8AACBFE68CC83BD1E94';
return api.getTransaction(id).then(transaction => {
/* ... */
});
```
<%- renderFixture('responses/get-transaction-payment.json') %>

View File

@@ -0,0 +1,24 @@
## getTransactions
`getTransactions(address: string, options: object): Promise<Array<object>>`
Retrieves historical transactions of an account.
### Parameters
<%- renderSchema('input/get-transactions.json') %>
### Return Value
This method returns a promise that resolves with an array of transaction object in the same format as [getTransaction](#gettransaction).
### Example
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
return api.getTransactions(address).then(transaction => {
/* ... */
});
```
<%- renderFixture('responses/get-transactions.json') %>

View File

@@ -0,0 +1,25 @@
## getTrustlines
`getTrustlines(address: string, options: object): Promise<Array<object>>`
Returns trustlines for a specified account.
### Parameters
<%- renderSchema("input/get-trustlines.json") %>
### Return Value
This method returns a promise that resolves with an array of objects with the following structure.
<%- renderSchema("output/get-trustlines.json") %>
### Example
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
return api.getTrustlines(address).then(trustlines =>
{/* ... */});
```
<%- renderFixture("responses/get-trustlines.json") %>

View File

@@ -0,0 +1,27 @@
## hasNextPage
`hasNextPage(currentResponse): boolean`
Returns `true` when there are more pages available.
When there are more results than contained in the response, the response includes a `marker` field. You can use this convenience method, or check for `marker` yourself.
See [Markers and Pagination](https://ripple.com/build/rippled-apis/#markers-and-pagination).
### Return Value
This method returns `true` if `currentResponse` includes a `marker`.
### Example
```javascript
return api.request('ledger_data', {
ledger_index: 'validated'
}).then(response => {
/* Do something useful with response */
if (api.hasNextPage(response)) {
/* There are more pages available */
}
}).catch(console.error);
```

68
docs/src/index.md.ejs Normal file
View File

@@ -0,0 +1,68 @@
<% include introduction.md.ejs %>
<% include boilerplate.md.ejs %>
<% include offline.md.ejs %>
<% include basictypes.md.ejs %>
<% include transactions.md.ejs %>
<% include specifications.md.ejs %>
<% include rippledAPIs.md.ejs %>
<% include request.md.ejs %>
<% include hasNextPage.md.ejs %>
<% include requestNextPage.md.ejs %>
<% include staticMethods.md.ejs %>
<% include renameCounterpartyToIssuer.md.ejs %>
<% include formatBidsAndAsks.md.ejs %>
<% include methods.md.ejs %>
<% include connect.md.ejs %>
<% include disconnect.md.ejs %>
<% include isConnected.md.ejs %>
<% include getServerInfo.md.ejs %>
<% include getFee.md.ejs %>
<% include getLedgerVersion.md.ejs %>
<% include getTransaction.md.ejs %>
<% include getTransactions.md.ejs %>
<% include getTrustlines.md.ejs %>
<% include getBalances.md.ejs %>
<% include getBalanceSheet.md.ejs %>
<% include getPaths.md.ejs %>
<% include getOrders.md.ejs %>
<% include getOrderbook.md.ejs %>
<% include getSettings.md.ejs %>
<% include getAccountInfo.md.ejs %>
<% include getAccountObjects.md.ejs %>
<% include getPaymentChannel.md.ejs %>
<% include getLedger.md.ejs %>
<% include parseAccountFlags.md.ejs %>
<% include prepareTransaction.md.ejs %>
<% include preparePayment.md.ejs %>
<% include prepareTrustline.md.ejs %>
<% include prepareOrder.md.ejs %>
<% include prepareOrderCancellation.md.ejs %>
<% include prepareSettings.md.ejs %>
<% include prepareEscrowCreation.md.ejs %>
<% include prepareEscrowCancellation.md.ejs %>
<% include prepareEscrowExecution.md.ejs %>
<% include preparePaymentChannelCreate.md.ejs %>
<% include preparePaymentChannelClaim.md.ejs %>
<% include preparePaymentChannelFund.md.ejs %>
<% include prepareCheckCreate.md.ejs %>
<% include prepareCheckCancel.md.ejs %>
<% include prepareCheckCash.md.ejs %>
<% include sign.md.ejs %>
<% include combine.md.ejs %>
<% include submit.md.ejs %>
<% include generateAddress.md.ejs %>
<% include isValidAddress.md.ejs %>
<% include isValidSecret.md.ejs %>
<% include deriveKeypair.md.ejs %>
<% include deriveAddress.md.ejs %>
<% include signPaymentChannelClaim.md.ejs %>
<% include verifyPaymentChannelClaim.md.ejs %>
<% include computeLedgerHash.md.ejs %>
<% include xrpToDropsAndDropsToXrp.md.ejs %>
<% include iso8601ToRippleTime.md.ejs %>
<% include rippleTimeToISO8601.md.ejs %>
<% include txFlags.md.ejs %>
<% include schemaValidator.md.ejs %>
<% include events.md.ejs %>

View File

@@ -0,0 +1,10 @@
# Introduction
RippleAPI (ripple-lib) is the official client library to the XRP Ledger. Currently, RippleAPI is only available in JavaScript.
Using RippleAPI, you can:
* [Query transactions from the XRP Ledger history](#gettransaction)
* [Sign](#sign) transactions securely without connecting to any server
* [Submit](#submit) transactions to the XRP Ledger, including [Payments](#payment), [Orders](#order), [Settings changes](#settings), and [other types](#transaction-types)
* [Generate a new XRP Ledger Address](#generateaddress)
* ... and [much more](#api-methods).

View File

@@ -0,0 +1,23 @@
## isConnected
`isConnected(): boolean`
Checks if the RippleAPI instance is connected to its rippled server.
### Parameters
This method has no parameters.
### Return Value
This method returns `true` if connected and `false` if not connected.
### Example
```javascript
return api.isConnected();
```
```json
true
```

View File

@@ -0,0 +1,19 @@
## isValidAddress
`isValidAddress(address: string): boolean`
Checks if the specified string contains a valid address.
### Parameters
This method takes one parameter, the address to validate.
### Return Value
This method returns `true` if the address is valid and `false` if it is not.
### Example
```javascript
return api.isValidAddress("address")
```

View File

@@ -0,0 +1,19 @@
## isValidSecret
`isValidSecret(secret: string): boolean`
Checks if the specified string contains a valid secret.
### Parameters
This method takes one parameter, the secret which to validate.
### Return Value
This method returns `true` if the secret is valid and `false` if it is not.
### Example
```javascript
return api.isValidSecret("secret")
```

View File

@@ -0,0 +1,27 @@
## iso8601ToRippleTime
`iso8601ToRippleTime(iso8601: string): number`
This method parses a string representation of a date, and returns the number of seconds since the "Ripple Epoch" of January 1, 2000 (00:00 UTC).
The Ripple Epoch is 946684800 seconds after the Unix Epoch.
This method is useful for creating timestamps to use with the rippled APIs. The rippled APIs represent time as an unsigned integer of the number of seconds since the Ripple Epoch.
### Parameters
`iso8601`: A string representing a date and time. This string is parsed using JavaScript's `Date.parse()` method.
### Return Value
The number of seconds since the Ripple Epoch.
### Example
```javascript
api.iso8601ToRippleTime('2017-02-17T15:04:57Z');
```
```json
540659097
```

1
docs/src/methods.md.ejs Normal file
View File

@@ -0,0 +1 @@
# API Methods

26
docs/src/offline.md.ejs Normal file
View File

@@ -0,0 +1,26 @@
## Offline functionality
RippleAPI can also function without internet connectivity. This can be useful in order to generate secrets and sign transactions from a secure, isolated machine.
To instantiate RippleAPI in offline mode, use the following boilerplate code:
```javascript
const RippleAPI = require('ripple-lib').RippleAPI;
const api = new RippleAPI();
/* insert code here */
```
Methods that depend on the state of the XRP Ledger are unavailable in offline mode. To prepare transactions offline, you **must** specify the `fee`, `sequence`, and `maxLedgerVersion` parameters in the [transaction instructions](#transaction-instructions). You can use the following methods while offline:
* [preparePayment](#preparepayment)
* [prepareTrustline](#preparetrustline)
* [prepareOrder](#prepareorder)
* [prepareOrderCancellation](#prepareordercancellation)
* [prepareSettings](#preparesettings)
* [prepareEscrowCreation](#prepareescrowcreation)
* [prepareEscrowCancellation](#prepareescrowcancellation)
* [prepareEscrowExecution](#prepareescrowexecution)
* [sign](#sign)
* [generateAddress](#generateaddress)
* [computeLedgerHash](#computeledgerhash)

View File

@@ -0,0 +1,35 @@
## parseAccountFlags
`parseAccountFlags(Flags: number): object`
Parse an `AccountRoot` object's [`Flags`](https://developers.ripple.com/accountroot.html#accountroot-flags).
### Parameters
This method takes one parameter, the AccountRoot `Flags` number to parse. Note that flags have different mappings on other types of objects or in transactions such as AccountSet.
### Return Value
This method returns an object with containing a key for each AccountRoot flag known to this version of RippleAPI. Each flag has a boolean value of `true` or `false`.
### Example
```javascript
const account_info = await api.request('account_info', {account: 'rKsdkGhyZH6b2Zzd5hNnEqSv2wpznn4n6N'})
const flags = api.parseAccountFlags(account_info.account_data.Flags)
console.log(JSON.stringify(flags, null, 2))
```
```json
{
"passwordSpent": false,
"requireDestinationTag": false,
"requireAuthorization": false,
"depositAuth": true,
"disallowIncomingXRP": false,
"disableMasterKey": false,
"noFreeze": false,
"globalFreeze": false,
"defaultRipple": false
}
```

View File

@@ -0,0 +1,30 @@
## prepareCheckCancel
`prepareCheckCancel(address: string, checkCancel: object, instructions: object): Promise<object>`
Prepare a Check cancellation transaction. This cancels an unredeemed Check, removing it from the ledger without sending any money. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
### Parameters
<%- renderSchema('input/prepare-check-cancel.json') %>
### Return Value
This method returns a promise that resolves with an object with the following structure:
<aside class="notice">
All "prepare*" methods have the same return type.
</aside>
<%- renderSchema('output/prepare.json') %>
### Example
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const checkCancel = <%- importFile('test/fixtures/requests/prepare-check-cancel.json') %>;
return api.prepareCheckCancel(address, checkCancel).then(prepared =>
{/* ... */});
```
<%- renderFixture('responses/prepare-check-cancel.json') %>

View File

@@ -0,0 +1,30 @@
## prepareCheckCash
`prepareCheckCash(address: string, checkCash: object, instructions: object): Promise<object>`
Prepare a Check cashing transaction. This redeems a Check to receive up to the amount authorized by the corresponding CheckCreate transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
### Parameters
<%- renderSchema('input/prepare-check-cash.json') %>
### Return Value
This method returns a promise that resolves with an object with the following structure:
<aside class="notice">
All "prepare*" methods have the same return type.
</aside>
<%- renderSchema('output/prepare.json') %>
### Example
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const checkCash = <%- importFile('test/fixtures/requests/prepare-check-cash-amount.json') %>;
return api.prepareCheckCash(address, checkCash).then(prepared =>
{/* ... */});
```
<%- renderFixture('responses/prepare-check-cash-amount.json') %>

View File

@@ -0,0 +1,30 @@
## prepareCheckCreate
`prepareCheckCreate(address: string, checkCreate: object, instructions: object): Promise<object>`
Prepare a Check creation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
### Parameters
<%- renderSchema('input/prepare-check-create.json') %>
### Return Value
This method returns a promise that resolves with an object with the following structure:
<aside class="notice">
All "prepare*" methods have the same return type.
</aside>
<%- renderSchema('output/prepare.json') %>
### Example
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const checkCreate = <%- importFile('test/fixtures/requests/prepare-check-create.json') %>;
return api.prepareCheckCreate(address, checkCreate).then(prepared =>
{/* ... */});
```
<%- renderFixture('responses/prepare-check-create.json') %>

View File

@@ -0,0 +1,30 @@
## prepareEscrowCancellation
`prepareEscrowCancellation(address: string, escrowCancellation: object, instructions: object): Promise<object>`
Prepare an escrow cancellation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
### Parameters
<%- renderSchema('input/prepare-escrow-cancellation.json') %>
### Return Value
This method returns a promise that resolves with an object with the following structure:
<aside class="notice">
All "prepare*" methods have the same return type.
</aside>
<%- renderSchema('output/prepare.json') %>
### Example
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const escrowCancellation = <%- importFile('test/fixtures/requests/prepare-escrow-cancellation.json') %>;
return api.prepareEscrowCancellation(address, escrowCancellation).then(prepared =>
{/* ... */});
```
<%- renderFixture('responses/prepare-escrow-cancellation.json') %>

View File

@@ -0,0 +1,36 @@
## prepareEscrowCreation
`prepareEscrowCreation(address: string, escrowCreation: object, instructions: object): Promise<object>`
Prepare an escrow creation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
### Parameters
<%- renderSchema('input/prepare-escrow-creation.json') %>
This is a convenience method for generating the EscrowCreate JSON used by rippled, so the same restrictions apply.
Field mapping: `allowCancelAfter` is equivalent to rippled's `CancelAfter`; `allowExecuteAfter` is equivalent to `FinishAfter`. At the `allowCancelAfter` time, the escrow is considered expired. This means that the funds can only be returned to the sender. At the `allowExecuteAfter` time, the escrow is permitted to be released to the recipient (if the `condition` is fulfilled).
Note that `allowCancelAfter` must be chronologically later than `allowExecuteAfter`.
### Return Value
This method returns a promise that resolves with an object with the following structure:
<aside class="notice">
All "prepare*" methods have the same return type.
</aside>
<%- renderSchema('output/prepare.json') %>
### Example
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const escrowCreation = <%- importFile('test/fixtures/requests/prepare-escrow-creation.json') %>;
return api.prepareEscrowCreation(address, escrowCreation).then(prepared =>
{/* ... */});
```
<%- renderFixture('responses/prepare-escrow-creation.json') %>

View File

@@ -0,0 +1,30 @@
## prepareEscrowExecution
`prepareEscrowExecution(address: string, escrowExecution: object, instructions: object): Promise<object>`
Prepare an escrow execution transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
### Parameters
<%- renderSchema('input/prepare-escrow-execution.json') %>
### Return Value
This method returns a promise that resolves with an object with the following structure:
<aside class="notice">
All "prepare*" methods have the same return type.
</aside>
<%- renderSchema('output/prepare.json') %>
### Example
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const escrowExecution = <%- importFile('test/fixtures/requests/prepare-escrow-execution.json') %>;
return api.prepareEscrowExecution(address, escrowExecution).then(prepared =>
{/* ... */});
```
<%- renderFixture('responses/prepare-escrow-execution.json') %>

View File

@@ -0,0 +1,32 @@
## prepareOrder
`prepareOrder(address: string, order: object, instructions: object): Promise<object>`
Prepare an order transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
### Parameters
<%- renderSchema('input/prepare-order.json') %>
### Return Value
This method returns a promise that resolves with an object with the following structure:
<aside class="notice">
All "prepare*" methods have the same return type.
</aside>
<%- renderSchema('output/prepare.json') %>
### Example
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
// Buy 10.10 USD (of the specified issuer) for 2.0 XRP (2000000 drops), fill or kill.
const order = <%- importFile('test/fixtures/requests/prepare-order.json') %>;
return api.prepareOrder(address, order)
.then(prepared => {/* ... */});
```
<%- renderFixture('responses/prepare-order.json') %>

View File

@@ -0,0 +1,30 @@
## prepareOrderCancellation
`prepareOrderCancellation(address: string, orderCancellation: object, instructions: object): Promise<object>`
Prepare an order cancellation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
### Parameters
<%- renderSchema("input/prepare-order-cancellation.json") %>
### Return Value
This method returns a promise that resolves with an object with the following structure:
<aside class="notice">
All "prepare*" methods have the same return type.
</aside>
<%- renderSchema("output/prepare.json") %>
### Example
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const orderCancellation = {orderSequence: 123};
return api.prepareOrderCancellation(address, orderCancellation)
.then(prepared => {/* ... */});
```
<%- renderFixture("responses/prepare-order-cancellation.json") %>

View File

@@ -0,0 +1,33 @@
## preparePayment
`preparePayment(address: string, payment: object, instructions: object): Promise<object>`
Prepare a payment transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
### Parameters
<%- renderSchema("input/prepare-payment.json") %>
### Return Value
This method returns a promise that resolves with an object with the following structure:
<aside class="notice">
All "prepare*" methods have the same return type.
</aside>
<%- renderSchema("output/prepare.json") %>
### Example
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const payment = <%- importFile('test/fixtures/requests/prepare-payment.json') %>;
return api.preparePayment(address, payment).then(prepared => {
/* ... */
}).catch(error => {
/* ... as with all prepare* methods, use a Promise catch block to handle errors ... */
})
```
<%- renderFixture("responses/prepare-payment.json") %>

View File

@@ -0,0 +1,30 @@
## preparePaymentChannelClaim
`preparePaymentChannelClaim(address: string, paymentChannelClaim: object, instructions: object): Promise<object>`
Prepare a payment channel claim transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
### Parameters
<%- renderSchema('input/prepare-payment-channel-claim.json') %>
### Return Value
This method returns a promise that resolves with an object with the following structure:
<aside class="notice">
All "prepare*" methods have the same return type.
</aside>
<%- renderSchema('output/prepare.json') %>
### Example
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const paymentChannelClaim = <%- importFile('test/fixtures/requests/prepare-payment-channel-claim.json') %>;
return api.preparePaymentChannelClaim(address, paymentChannelClaim).then(prepared =>
{/* ... */});
```
<%- renderFixture('responses/prepare-payment-channel-claim.json') %>

View File

@@ -0,0 +1,30 @@
## preparePaymentChannelCreate
`preparePaymentChannelCreate(address: string, paymentChannelCreate: object, instructions: object): Promise<object>`
Prepare a payment channel creation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
### Parameters
<%- renderSchema('input/prepare-payment-channel-create.json') %>
### Return Value
This method returns a promise that resolves with an object with the following structure:
<aside class="notice">
All "prepare*" methods have the same return type.
</aside>
<%- renderSchema('output/prepare.json') %>
### Example
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const paymentChannelCreate = <%- importFile('test/fixtures/requests/prepare-payment-channel-create.json') %>;
return api.preparePaymentChannelCreate(address, paymentChannelCreate).then(prepared =>
{/* ... */});
```
<%- renderFixture('responses/prepare-payment-channel-create.json') %>

View File

@@ -0,0 +1,30 @@
## preparePaymentChannelFund
`preparePaymentChannelFund(address: string, paymentChannelFund: object, instructions: object): Promise<object>`
Prepare a payment channel fund transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
### Parameters
<%- renderSchema('input/prepare-payment-channel-fund.json') %>
### Return Value
This method returns a promise that resolves with an object with the following structure:
<aside class="notice">
All "prepare*" methods have the same return type.
</aside>
<%- renderSchema('output/prepare.json') %>
### Example
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const paymentChannelFund = <%- importFile('test/fixtures/requests/prepare-payment-channel-fund.json') %>;
return api.preparePaymentChannelFund(address, paymentChannelFund).then(prepared =>
{/* ... */});
```
<%- renderFixture('responses/prepare-payment-channel-fund.json') %>

View File

@@ -0,0 +1,30 @@
## prepareSettings
`prepareSettings(address: string, settings: object, instructions: object): Promise<object>`
Prepare a settings transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
### Parameters
<%- renderSchema('input/prepare-settings.json') %>
### Return Value
This method returns a promise that resolves with an object with the following structure:
<aside class="notice">
All "prepare*" methods have the same return type.
</aside>
<%- renderSchema('output/prepare.json') %>
### Example
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const settings = <%- importFile('test/fixtures/requests/prepare-settings.json') %>;
return api.prepareSettings(address, settings)
.then(prepared => {/* ... */});
```
<%- renderFixture('requests/prepare-settings.json') %>

View File

@@ -0,0 +1,50 @@
## prepareTransaction
`prepareTransaction(transaction: object, instructions: object): Promise<object>`
Prepare a transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
This method works with any of [the transaction types supported by rippled](https://developers.ripple.com/transaction-types.html).
Notably, this is the preferred method for preparing a `DepositPreauth` transaction (added in rippled 1.1.0).
### Parameters
Name | Type | Description
---- | ---- | -----------
transaction | [transaction](https://developers.ripple.com/transaction-formats.html) | The specification (JSON) of the transaction to prepare. Set `Account` to the address of the account that is creating the transaction. You may omit auto-fillable fields like `Fee`, `Flags`, and `Sequence` to have them set automatically.
instructions | [instructions](#transaction-instructions) | *Optional* Instructions for executing the transaction.
### Return Value
This method returns a promise that resolves with an object with the following structure:
<aside class="notice">
All "prepare*" methods have the same return type.
</aside>
<%- renderSchema("output/prepare.json") %>
### Example
```javascript
async function preparedPreauth() {
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
return api.prepareTransaction({
TransactionType: 'DepositPreauth',
Account: address,
Authorize: 'rMyVso4p83khNyHdV1m1PggV9QNadCj8wM'
});
}
```
```javascript
{
txJSON: '{"TransactionType":"DepositPreauth","Account":"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59","Authorize":"rMyVso4p83khNyHdV1m1PggV9QNadCj8wM","Flags":2147483648,"LastLedgerSequence":13561714,"Fee":"12","Sequence":1}',
instructions: {
fee: '0.000012',
sequence: 1,
maxLedgerVersion: 13561714
}
}
```

View File

@@ -0,0 +1,30 @@
## prepareTrustline
`prepareTrustline(address: string, trustline: object, instructions: object): Promise<object>`
Prepare a trustline transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
### Parameters
<%- renderSchema("input/prepare-trustline.json") %>
### Return Value
This method returns a promise that resolves with an object with the following structure:
<aside class="notice">
All "prepare*" methods have the same return type.
</aside>
<%- renderSchema("output/prepare.json") %>
### Example
```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const trustline = <%- importFile('test/fixtures/requests/prepare-trustline.json') %>;
return api.prepareTrustline(address, trustline).then(prepared =>
{/* ... */});
```
<%- renderFixture("responses/prepare-trustline.json") %>

View File

@@ -0,0 +1,37 @@
## renameCounterpartyToIssuer
`renameCounterpartyToIssuer(issue: {currency: string, counterparty: address}): {currency: string, issuer: address}`
Returns an object with the `counterparty` field renamed to `issuer`. This is useful because RippleAPI generally uses the name `counterparty` while the rippled API generally uses the name `issuer`.
This is a static method on the `RippleAPI` class.
### Parameters
This method takes one parameter, an object with a `counterparty` field.
### Return Value
This method returns a new object similar to the source object, but with `issuer` instead of `counterparty`.
### Example
```javascript
const orderbookInfo = {
"base": {
"currency": "USD",
"counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
},
"counter": {
"currency": "BTC",
"counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
}
};
console.log(RippleAPI.renameCounterpartyToIssuer(orderbookInfo.base))
console.log(RippleAPI.renameCounterpartyToIssuer(orderbookInfo.counter))
```
```
{ currency: 'USD', issuer: 'rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B' }
{ currency: 'BTC', issuer: 'rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B' }
```

27
docs/src/request.md.ejs Normal file
View File

@@ -0,0 +1,27 @@
## request
`request(command: string, options: object): Promise<object>`
Returns the response from invoking the specified command, with the specified options, on the connected rippled server.
Refer to [rippled APIs](https://ripple.com/build/rippled-apis/) for commands and options. All XRP amounts must be specified in drops. One drop is equal to 0.000001 XRP. See [Specifying Currency Amounts](https://ripple.com/build/rippled-apis/#specifying-currency-amounts).
Most commands return data for the `current` (in-progress, open) ledger by default. Do not rely on this. Always specify a ledger version in your request. In the example below, the 'validated' ledger is requested, which is the most recent ledger that has been validated by the whole network. See [Specifying Ledgers](https://ripple.com/build/rippled-apis/#specifying-ledgers).
### Return Value
This method returns a promise that resolves with the response from rippled.
### Example
```javascript
// Replace 'ledger' with your desired rippled command
return api.request('ledger', {
ledger_index: 'validated'
}).then(response => {
/* Do something useful with response */
console.log(JSON.stringify(response, null, 2))
}).catch(console.error);
```
<%- renderFixture('responses/ledger.json') %>

View File

@@ -0,0 +1,29 @@
## requestNextPage
`requestNextPage(command: string, params: object = {}, currentResponse: object): Promise<object>`
Requests the next page of data.
You can use this convenience method, or include `currentResponse.marker` in `params` yourself, when using `request`.
See [Markers and Pagination](https://ripple.com/build/rippled-apis/#markers-and-pagination).
### Return Value
This method returns a promise that resolves with the next page of data from rippled.
If the response does not have a next page, the promise will reject with `new errors.NotFoundError('response does not have a next page')`.
### Example
```javascript
const command = 'ledger_data'
const params = {
ledger_index: 'validated'
}
return api.request(command, params).then(response => {
return api.requestNextPage(command, params, response)
}).then(response_page_2 => {
/* Do something useful with second page of response */
}).catch(console.error);
```

View File

@@ -0,0 +1,69 @@
# rippled APIs
ripple-lib relies on [rippled APIs](https://ripple.com/build/rippled-apis/) for all online functionality. With ripple-lib version 1.0.0 and higher, you can easily access rippled APIs through ripple-lib. Use the `request()`, `hasNextPage()`, and `requestNextPage()` methods:
* Use `request()` to issue any `rippled` command, including `account_currencies`, `subscribe`, and `unsubscribe`. [Full list of API Methods](https://ripple.com/build/rippled-apis/#api-methods).
* Use `hasNextPage()` to determine whether a response has more pages. This is true when the response includes a [`marker` field](https://ripple.com/build/rippled-apis/#markers-and-pagination).
* Use `requestNextPage()` to request the next page of data.
When using rippled APIs:
* [Specify XRP amounts in drops](https://developers.ripple.com/basic-data-types.html#specifying-currency-amounts).
* [Specify timestamps as the number of seconds since the "Ripple Epoch"](https://developers.ripple.com/basic-data-types.html#specifying-time).
* Instead of `counterparty`, use `issuer`.
## Listening to streams
The `rippled` server can push updates to your client when various events happen. Refer to [Subscriptions in the `rippled` API docs](https://developers.ripple.com/subscription-methods.html) for details.
Note that the `streams` parameter for generic streams takes an array. For example, to subscribe to the `validations` stream, use `{ streams: [ 'validations' ] }`.
The string names of some generic streams to subscribe to are in the table below. (Refer to `rippled` for an up-to-date list of streams.)
Type | Description
---- | -----------
`server` | Sends a message whenever the status of the `rippled` server (for example, network connectivity) changes.
`ledger` | Sends a message whenever the consensus process declares a new validated ledger.
`transactions` | Sends a message whenever a transaction is included in a closed ledger.
`transactions_proposed` | Sends a message whenever a transaction is included in a closed ledger, as well as some transactions that have not yet been included in a validated ledger and may never be. Not all proposed transactions appear before validation. Even some transactions that don't succeed are included in validated ledgers because they take the anti-spam transaction fee.
`validations` | Sends a message whenever the server receives a validation message, also called a validation vote, regardless of whether the server trusts the validator.
`manifests` | Sends a message whenever the server receives a manifest.
`peer_status` | (Admin-only) Information about connected peer `rippled` servers, especially with regards to the consensus process.
When you subscribe to a stream, you must also listen to the relevant message type(s). Some of the available message types are in the table below. (Refer to `rippled` for an up-to-date list of message types.)
Type | Description
---- | -----------
`ledgerClosed` | Sent by the `ledger` stream when the consensus process declares a new fully validated ledger. The message identifies the ledger and provides some information about its contents.
`validationReceived` | Sent by the `validations` stream when the server receives a validation message, also called a validation vote, regardless of whether the server trusts the validator.
`manifestReceived` | Sent by the `manifests` stream when the server receives a manifest.
`transaction` | Sent by many subscriptions including `transactions`, `transactions_proposed`, `accounts`, `accounts_proposed`, and `book` (Order Book). See [Transaction Streams](https://ripple.com/build/rippled-apis/#transaction-streams) for details.
`peerStatusChange` | (Admin-only) Reports a large amount of information on the activities of other `rippled` servers to which the server is connected.
To register your listener function, use `connection.on(type, handler)`.
Here is an example of listening for transactions on given account(s):
```
const account = 'rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn' // Replace with the account you want notifications for
api.connect().then(() => { // Omit this if you are already connected
// 'transaction' can be replaced with the relevant `type` from the table above
api.connection.on('transaction', (event) => {
// Do something useful with `event`
console.log(JSON.stringify(event, null, 2))
})
api.request('subscribe', {
accounts: [ account ]
}).then(response => {
if (response.status === 'success') {
console.log('Successfully subscribed')
}
}).catch(error => {
// Handle `error`
})
})
```
The subscription ends when you unsubscribe or the WebSocket connection is closed.
For full details, see [rippled Subscriptions](https://ripple.com/build/rippled-apis/#subscriptions).

View File

@@ -0,0 +1,35 @@
## schemaValidator
Unlike the rest of the ripple-lib API, schemaValidator is a static object on RippleAPI. It provides utility methods that do not use a server.
## schemaValidate
`RippleAPI.schemaValidator.schemaValidate(schemaName: string, object: any): void`
This method checks an object for conformance to a specified schema. It does not return anything, but will throw a `ValidationError` if the object does not conform to the schema.
### Example
```javascript
RippleAPI.schemaValidator.schemaValidate('sign', {
signedTransaction: '12000322800000002400000017201B0086955368400000000000000C732102F89EAEC7667B30F33D0687BBA86C3FE2A08CCA40A9186C5BDE2DAA6FA97A37D874473045022100BDE09A1F6670403F341C21A77CF35BA47E45CDE974096E1AA5FC39811D8269E702203D60291B9A27F1DCABA9CF5DED307B4F23223E0B6F156991DB601DFB9C41CE1C770A726970706C652E636F6D81145E7B112523F68D2F5E879DB4EAC51C6698A69304',
id: '02ACE87F1996E3A23690A5BB7F1774BF71CCBA68F79805831B42ABAD5913D6F4'
})
```
```json
undefined
```
If the object is valid (conforms to the schema), nothing is returned. Otherwise, `schemaValidate` throws an error:
```javascript
RippleAPI.schemaValidator.schemaValidate('sign', {
signedTransaction: '12000322800000002400000017201B0086955368400000000000000C732102F89EAEC7667B30F33D0687BBA86C3FE2A08CCA40A9186C5BDE2DAA6FA97A37D874473045022100BDE09A1F6670403F341C21A77CF35BA47E45CDE974096E1AA5FC39811D8269E702203D60291B9A27F1DCABA9CF5DED307B4F23223E0B6F156991DB601DFB9C41CE1C770A726970706C652E636F6D81145E7B112523F68D2F5E879DB4EAC51C6698A69304',
id: '123'
})
```
```
[ValidationError(instance.id does not match pattern "^[A-F0-9]{64}$")]
```

33
docs/src/sign.md.ejs Normal file
View File

@@ -0,0 +1,33 @@
## sign
```
sign(txJSON: string, secret: string, options: object): {signedTransaction: string, id: string}
sign(txJSON: string, keypair: object, options: object): {signedTransaction: string, id: string}
```
Sign a prepared transaction. The signed transaction must subsequently be [submitted](#submit).
This method can sign any of [the transaction types supported by ripple-binary-codec](https://github.com/ripple/ripple-binary-codec/blob/cfcde79c19c359e9a0466d7bc3dc9a3aef47bb99/src/enums/definitions.json#L1637). When a new transaction type is added to the XRP Ledger, it will be unrecognized until `ripple-binary-codec` is updated. If you try to sign an unrecognized transaction type, this method throws an error similar to the following:
`Error: [TRANSACTION_TYPE] is not a valid name or ordinal for TransactionType`
### Parameters
<%- renderSchema("input/sign.json") %>
### Return Value
This method returns an object with the following structure:
<%- renderSchema("output/sign.json") %>
### Example
```javascript
const txJSON = '{"Flags":2147483648,"TransactionType":"AccountSet","Account":"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59","Domain":"726970706C652E636F6D","LastLedgerSequence":8820051,"Fee":"12","Sequence":23}';
const secret = 'shsWGZcmZz6YsWWmcnpfr6fLTdtFV';
const keypair = { privateKey: '00ACCD3309DB14D1A4FC9B1DAE608031F4408C85C73EE05E035B7DC8B25840107A', publicKey: '02F89EAEC7667B30F33D0687BBA86C3FE2A08CCA40A9186C5BDE2DAA6FA97A37D8' };
return api.sign(txJSON, secret); // or: api.sign(txJSON, keypair);
```
<%- renderFixture("responses/sign.json") %>

View File

@@ -0,0 +1,28 @@
## signPaymentChannelClaim
`signPaymentChannelClaim(channel: string, amount: string, privateKey: string): string`
Sign a payment channel claim. The signature can be submitted in a subsequent [PaymentChannelClaim](#preparepaymentchannelclaim) transaction.
### Parameters
<%- renderSchema("input/sign-payment-channel-claim.json") %>
### Return Value
This method returns a signature string:
<%- renderSchema("output/sign-payment-channel-claim.json") %>
### Example
```javascript
const channel =
'3E18C05AD40319B809520F1A136370C4075321B285217323396D6FD9EE1E9037';
const amount = '.00001';
const privateKey =
'ACCD3309DB14D1A4FC9B1DAE608031F4408C85C73EE05E035B7DC8B25840107A';
return api.signPaymentChannelClaim(channel, amount, privateKey);
```
<%- renderFixture("responses/sign-payment-channel-claim.json") %>

View File

@@ -0,0 +1,145 @@
# Transaction Specifications
A *transaction specification* specifies what a transaction should do. Each [Transaction Type](#transaction-types) has its own type of specification.
## Payment
See [Transaction Types](#transaction-types) for a description.
<%- renderSchema('specifications/payment.json') %>
### Example
<%- renderFixture('requests/prepare-payment.json') %>
## Trustline
See [Transaction Types](#transaction-types) for a description.
<%- renderSchema('specifications/trustline.json') %>
### Example
<%- renderFixture('requests/prepare-trustline.json') %>
## Order
See [Transaction Types](#transaction-types) for a description.
<%- renderSchema('specifications/order.json') %>
The following invalid flag combination causes a `ValidationError`: `immediateOrCancel` and `fillOrKill`. These fields are mutually exclusive, and cannot both be set at the same time.
### Example
<%- renderFixture('requests/prepare-order.json') %>
## Order Cancellation
See [Transaction Types](#transaction-types) for a description.
<%- renderSchema('specifications/order-cancellation.json') %>
### Example
<%- renderFixture('requests/prepare-order-cancellation.json') %>
## Settings
See [Transaction Types](#transaction-types) for a description.
<%- renderSchema('output/get-settings.json') %>
### Example
<%- renderFixture('requests/prepare-settings.json') %>
## Escrow Creation
See [Transaction Types](#transaction-types) for a description.
<%- renderSchema('specifications/escrow-creation.json') %>
### Example
<%- renderFixture('requests/prepare-escrow-creation.json') %>
## Escrow Cancellation
See [Transaction Types](#transaction-types) for a description.
<%- renderSchema('specifications/escrow-cancellation.json') %>
### Example
<%- renderFixture('requests/prepare-escrow-cancellation.json') %>
## Escrow Execution
See [Transaction Types](#transaction-types) for a description.
<%- renderSchema('specifications/escrow-execution.json') %>
### Example
<%- renderFixture('requests/prepare-escrow-execution.json') %>
## Check Create
See [Transaction Types](#transaction-types) for a description.
<%- renderSchema('specifications/check-create.json') %>
### Example
<%- renderFixture('requests/prepare-check-create.json') %>
## Check Cancel
See [Transaction Types](#transaction-types) for a description.
<%- renderSchema('specifications/check-cancel.json') %>
### Example
<%- renderFixture('requests/prepare-check-cancel.json') %>
## Check Cash
See [Transaction Types](#transaction-types) for a description.
<%- renderSchema('specifications/check-cash.json') %>
### Example
<%- renderFixture('requests/prepare-check-cash-amount.json') %>
## Payment Channel Create
See [Transaction Types](#transaction-types) for a description.
<%- renderSchema('specifications/payment-channel-create.json') %>
### Example
<%- renderFixture('requests/prepare-payment-channel-create.json') %>
## Payment Channel Fund
See [Transaction Types](#transaction-types) for a description.
<%- renderSchema('specifications/payment-channel-fund.json') %>
### Example
<%- renderFixture('requests/prepare-payment-channel-fund.json') %>
## Payment Channel Claim
See [Transaction Types](#transaction-types) for a description.
<%- renderSchema('specifications/payment-channel-claim.json') %>
### Example
<%- renderFixture('requests/prepare-payment-channel-claim.json') %>

View File

@@ -0,0 +1 @@
# Static Methods

25
docs/src/submit.md.ejs Normal file
View File

@@ -0,0 +1,25 @@
## submit
`submit(signedTransaction: string): Promise<object>`
Submits a signed transaction. The transaction is not guaranteed to succeed; it must be verified with [getTransaction](#gettransaction).
### Parameters
<%- renderSchema('input/submit.json') %>
### Return Value
This method returns an object with the following structure:
<%- renderSchema('output/submit.json') %>
### Example
```javascript
const signedTransaction = '12000322800000002400000017201B0086955368400000000000000C732102F89EAEC7667B30F33D0687BBA86C3FE2A08CCA40A9186C5BDE2DAA6FA97A37D874473045022100BDE09A1F6670403F341C21A77CF35BA47E45CDE974096E1AA5FC39811D8269E702203D60291B9A27F1DCABA9CF5DED307B4F23223E0B6F156991DB601DFB9C41CE1C770A726970706C652E636F6D81145E7B112523F68D2F5E879DB4EAC51C6698A69304';
return api.submit(signedTransaction)
.then(result => {/* ... */});
```
<%- renderFixture('responses/submit.json') %>

View File

@@ -0,0 +1,74 @@
# Transaction Overview
## Transaction Types
A transaction type is specified by the strings in the first column in the table below.
Type | Description
---- | -----------
[payment](#payment) | A `payment` transaction represents a transfer of value from one account to another. Depending on the [path](https://ripple.com/build/paths/) taken, additional exchanges of value may occur atomically to facilitate the payment.
[order](#order) | An `order` transaction creates a limit order. It defines an intent to exchange currencies, and creates an order in the XRP Ledger's order book if not completely fulfilled when placed. Orders can be partially fulfilled.
[orderCancellation](#order-cancellation) | An `orderCancellation` transaction cancels an order in the XRP Ledger's order book.
[trustline](#trustline) | A `trustline` transactions creates or modifies a trust line between two accounts.
[settings](#settings) | A `settings` transaction modifies the settings of an account in the XRP Ledger.
[escrowCreation](#escrow-creation) | An `escrowCreation` transaction creates an escrow on the ledger, which locks XRP until a cryptographic condition is met or it expires. It is like an escrow service where the XRP Ledger acts as the escrow agent.
[escrowCancellation](#escrow-cancellation) | An `escrowCancellation` transaction unlocks the funds in an escrow and sends them back to the creator of the escrow, but it will only work after the escrow expires.
[escrowExecution](#escrow-execution) | An `escrowExecution` transaction unlocks the funds in an escrow and sends them to the destination of the escrow, but it will only work if the cryptographic condition is provided.
[checkCreate](#check-create) | A `checkCreate` transaction creates a check on the ledger, which is a deferred payment that can be cashed by its intended destination.
[checkCancel](#check-cancel) | A `checkCancel` transaction cancels an unredeemed Check, removing it from the ledger without sending any money.
[checkCash](#check-cash) | A `checkCash` transaction redeems a Check to receive up to the amount authorized by the corresponding `checkCreate` transaction. Only the `destination` address of a Check can cash it.
[paymentChannelCreate](#payment-channel-create) | A `paymentChannelCreate` transaction opens a payment channel between two addresses with XRP set aside for asynchronous payments.
[paymentChannelFund](#payment-channel-fund) | A `paymentChannelFund` transaction adds XRP to a payment channel and optionally sets a new expiration for the channel.
[paymentChannelClaim](#payment-channel-claim) | A `paymentChannelClaim` transaction withdraws XRP from a channel and optionally requests to close it.
## Transaction Flow
Executing a transaction with `RippleAPI` requires the following four steps:
1. Prepare - Create an unsigned transaction based on a [specification](#transaction-specifications) and [instructions](#transaction-instructions). There is a method to prepare each type of transaction:
* [preparePayment](#preparepayment)
* [prepareTrustline](#preparetrustline)
* [prepareOrder](#prepareorder)
* [prepareOrderCancellation](#prepareordercancellation)
* [prepareSettings](#preparesettings)
* [prepareEscrowCreation](#prepareescrowcreation)
* [prepareEscrowCancellation](#prepareescrowcancellation)
* [prepareEscrowExecution](#prepareescrowexecution)
* [prepareCheckCreate](#preparecheckcreate)
* [prepareCheckCancel](#preparecheckcancel)
* [prepareCheckCash](#preparecheckcash)
2. [Sign](#sign) - Cryptographically sign the transaction locally and save the [transaction ID](#transaction-id). Signing is how the owner of an account authorizes a transaction to take place. For multisignature transactions, the `signedTransaction` fields returned by `sign` must be collected and passed to the [combine](#combine) method.
3. [Submit](#submit) - Submit the transaction to the connected server.
4. Verify - Verify that the transaction got validated by querying with [getTransaction](#gettransaction). This is necessary because transactions may fail even if they were successfully submitted.
## Transaction Fees
Every transaction must destroy a small amount of XRP as a cost to apply the transaction to the ledger. This is also called a *transaction fee*. The transaction cost is designed to increase along with the load on the XRP Ledger, making it very expensive to deliberately or inadvertently overload the peer-to-peer network that powers the XRP Ledger.
You can choose the size of the fee you want to pay or let a default be used. You can get an estimate of the fee required to be included in the next ledger closing with the [getFee](#getfee) method.
For a multi-signed transaction, ripple-lib automatically multiplies the `fee` by (1 + Number of Signatures Provided). For example, if you set `instructions.fee = '0.000020'` and `instructions.signersCount = 2`, the prepared transaction's `Fee` will be 20 drops × (1 + 2 Signatures) = 60 drops. See [Transaction Cost](https://developers.ripple.com/transaction-cost.html).
## Transaction Instructions
Transaction instructions indicate how to execute a transaction, complementary with the [transaction specification](#transaction-specifications).
<%- renderSchema("objects/instructions.json") %>
We recommend that you specify a `maxLedgerVersion` so that you can quickly determine that a failed transaction will never succeed in the future. It is impossible for a transaction to succeed after the XRP Ledger's consensus-validated ledger version exceeds the transaction's `maxLedgerVersion`. If you omit `maxLedgerVersion`, the "prepare\*" method automatically supplies a `maxLedgerVersion` equal to the current ledger plus 3, which it includes in the return value from the "prepare\*" method.
## Transaction ID
```json
"F4AB442A6D4CBB935D66E1DA7309A5FC71C7143ED4049053EC14E3875B0CF9BF"
```
A transaction ID is a 64-bit hexadecimal string that uniquely identifies the transaction. The transaction ID is derived from the transaction instruction and specifications, using a strong hash function.
You can look up a transaction by ID using the [getTransaction](#gettransaction) method.
## Transaction Memos
Every transaction can optionally have an array of memos for user applications. The `memos` field in each [transaction specification](#transaction-specifications) is an array of objects with the following structure:
<%- renderSchema('objects/memos.json') %>

81
docs/src/txFlags.md.ejs Normal file
View File

@@ -0,0 +1,81 @@
## txFlags
`txFlags.TRANSACTION_TYPE.FLAG`
This object provides constants for use when creating or interpreting transaction flags. Most transactions have a set of bit-flags that represent various options that affect how a transaction should behave. These options are represented as binary values that can be combined with bitwise-or operations to encode multiple flags at once.
Most flags only have meaning for a specific transaction type. The same bitwise value may be reused for flags on different transaction types, so it is important to pay attention to the transaction type when setting and reading flags.
Bits that are not defined as flags MUST be 0.
### Global Flag
Applies globally to all transactions.
`txFlags.Universal.FullyCanonicalSig`: Require a fully-canonical signature. When preparing transactions, ripple-lib enables this flag for you.
### Payment Flags
`txFlags.Payment.NoRippleDirect`: Do not use the default path; only use specified paths. This is intended to force the transaction to take arbitrage opportunities. Most clients do not need this.
`txFlags.Payment.PartialPayment`: If the specified destination amount cannot be sent without spending more than the source maxAmount, reduce the received amount instead of failing outright. See [Partial Payments](https://developers.ripple.com/partial-payments.html) for more details.
`txFlags.Payment.LimitQuality`: Only take paths where all the conversions have an input:output ratio that is equal or better than the ratio of `destination.amount`:`source.maxAmount`. See [Limit Quality](https://developers.ripple.com/payment.html#limit-quality) for details.
### OfferCreate Flags
`txFlags.OfferCreate.Passive`: If enabled, the offer does not consume offers that exactly match it, and instead becomes an Offer object in the ledger. It still consumes offers that cross it.
`txFlags.OfferCreate.ImmediateOrCancel`: Treat the offer as an Immediate or Cancel order. If enabled, the offer never becomes a ledger object: it only tries to match existing offers in the ledger.
`txFlags.OfferCreate.FillOrKill`: Treat the offer as a Fill or Kill order.
`txFlags.OfferCreate.Sell`: Treat the offer as a Sell order. With `order.direction = 'sell'`, exchange the entire `order.quantity`, even if it means obtaining more than the `order.totalPrice` amount in exchange. If using `prepareOrder`, ripple-lib sets this flag for you.
### TrustSet Flags
`txFlags.TrustSet.SetAuth`: Authorize the other party to hold issuances from this account. (No effect unless using the AccountSet.RequireAuth flag.) Cannot be unset.
`txFlags.TrustSet.NoRipple`: Obsolete.
`txFlags.TrustSet.SetNoRipple`: Blocks [rippling](https://developers.ripple.com/rippling.html) between two trustlines of the same currency, if this flag is set on both.
`txFlags.TrustSet.ClearNoRipple`: Clears the No-[Rippling](https://developers.ripple.com/rippling.html) flag.
`txFlags.TrustSet.SetFreeze`: Freeze the trustline. A non-XRP currency can be frozen by the exchange or gateway that issued it. XRP cannot be frozen.
`txFlags.TrustSet.ClearFreeze`: Unfreeze the trustline.
### AccountSet Flags
You can use the `prepareSettings` method to change your account flags. This method uses AccountSet flags internally.
In the rippled API, Account Flags can be enabled and disabled with the SetFlag and ClearFlag parameters. See [AccountSet Flags](https://developers.ripple.com/accountset.html#accountset-flags).
The AccountSet transaction type has some transaction flags, but their use is discouraged.
* `txFlags.AccountSet.RequireDestTag`
* `txFlags.AccountSet.OptionalDestTag`
* `txFlags.AccountSet.RequireAuth`
* `txFlags.AccountSet.OptionalAuth`
* `txFlags.AccountSet.DisallowXRP`
* `txFlags.AccountSet.AllowXRP`
### PaymentChannelClaim Flags
`txFlags.PaymentChannelClaim.Renew`: Clear the channel's Expiration time. (Expiration is different from the channel's immutable CancelAfter time.) Only the source address of the payment channel can use this flag.
`txFlags.PaymentChannelClaim.Close`: Request to close the channel. Only the channel source and destination addresses can use this flag. This flag closes the channel immediately if it has no more XRP allocated to it after processing the current claim, or if the destination address uses it. If the source address uses this flag when the channel still holds XRP, this schedules the channel to close after SettleDelay seconds have passed. (Specifically, this sets the Expiration of the channel to the close time of the previous ledger plus the channel's SettleDelay time, unless the channel already has an earlier Expiration time.) If the destination address uses this flag when the channel still holds XRP, any XRP that remains after processing the claim is returned to the source address.
### Other Transaction Types
The remaining transaction types do not have any flags at this time.
* OfferCancel
* SetRegularKey
* SignerListSet
* EscrowCreate
* EscrowFinish
* EscrowCancel
* PaymentChannelCreate
* PaymentChannelFund

View File

@@ -0,0 +1,31 @@
## verifyPaymentChannelClaim
`verifyPaymentChannelClaim(channel: string, amount: string, signature: string, publicKey: string): boolean`
Verify a payment channel claim signature.
### Parameters
<%- renderSchema("input/verify-payment-channel-claim.json") %>
### Return Value
This method returns `true` if the claim signature is valid.
<%- renderSchema("output/verify-payment-channel-claim.json") %>
### Example
```javascript
const channel =
'3E18C05AD40319B809520F1A136370C4075321B285217323396D6FD9EE1E9037';
const amount = '.00001';
const signature = <%- importFile("test/fixtures/responses/sign-payment-channel-claim.json") %>;
const publicKey =
'02F89EAEC7667B30F33D0687BBA86C3FE2A08CCA40A9186C5BDE2DAA6FA97A37D8';
return api.verifyPaymentChannelClaim(channel, amount, signature, publicKey);
```
```json
true
```

View File

@@ -0,0 +1,47 @@
## xrpToDrops
`xrpToDrops(xrp: string | BigNumber): string`
Converts an XRP amount to drops. 1 XRP = 1,000,000 drops, so 1 drop = 0.000001 XRP. This method is useful when converting amounts for use with the rippled API, which requires XRP amounts to be specified in drops.
### Parameters
`xrp`: A string or BigNumber representing an amount of XRP. If `xrp` is a string, it may start with `-`, must contain at least one number, and may contain up to one `.`. This method throws a `ValidationError` for invalid input.
### Return Value
A string representing an equivalent amount of drops.
### Example
```javascript
return api.xrpToDrops('1');
```
```json
'1000000'
```
## dropsToXrp
`dropsToXrp(drops: string | BigNumber): string`
Converts an amount of drops to XRP. 1 drop = 0.000001 XRP, so 1 XRP = 1,000,000 drops. This method is useful when converting amounts from the rippled API, which describes XRP amounts in drops.
### Parameters
`drops`: A string or BigNumber representing an amount of drops. If `drops` is a string, it may start with `-` and must contain at least one number. This method throws a `ValidationError` for invalid input.
### Return Value
A string representing an equivalent amount of XRP.
### Example
```javascript
return api.dropsToXrp('1');
```
```json
'0.000001'
```

View File

@@ -1,47 +1,69 @@
{
"name": "ripple-lib",
"version": "0.8.1-rc3",
"description": "Ripple JavaScript client library",
"version": "1.3.2",
"license": "ISC",
"description": "A JavaScript API for interacting with Ripple in Node.js and the browser",
"files": [
"src/js/*",
"bin/*",
"build/*",
"test/*",
"Makefile",
"Gulpfile.js"
"dist/npm/*",
"build/*"
],
"main": "src/js/ripple",
"main": "dist/npm/",
"types": "dist/npm/index.d.ts",
"browser": {
"ws": "./dist/npm/common/wswrapper.js",
"https-proxy-agent": false
},
"directories": {
"test": "test"
},
"dependencies": {
"async": "~0.8.0",
"ws": "~0.4.31",
"extend": "~1.2.1",
"lru-cache": "~2.5.0",
"superagent": "^0.18.0",
"gulp-bump": "~0.1.10",
"ripple-wallet-generator": "1.0.1"
"@types/lodash": "^4.14.136",
"@types/ws": "^3.2.0",
"bignumber.js": "^4.1.0",
"https-proxy-agent": "2.2.1",
"jsonschema": "1.2.2",
"lodash": "^4.17.4",
"ripple-address-codec": "^3.0.4",
"ripple-binary-codec": "0.2.2",
"ripple-hashes": "0.3.2",
"ripple-keypairs": "^0.10.1",
"ripple-lib-transactionparser": "0.7.1",
"ws": "^3.3.1"
},
"devDependencies": {
"mocha": "~1.14.0",
"gulp": "~3.6.2",
"gulp-concat": "~2.2.0",
"gulp-jshint": "~1.5.5",
"gulp-uglify": "~0.3.0",
"gulp-rename": "~1.2.0",
"webpack": "~1.1.11",
"map-stream": "~0.1.0",
"istanbul": "~0.2.10",
"coveralls": "~2.10.0",
"nock": "^0.34.1",
"yargs": "~1.3.1"
"@types/node": "11.13.0",
"assert-diff": "^1.0.1",
"doctoc": "^0.15.0",
"ejs": "^2.3.4",
"eventemitter2": "^0.4.14",
"gulp": "^4.0.2",
"json-loader": "^0.5.2",
"json-schema-to-markdown-table": "^0.4.0",
"mocha": "6.1.3",
"mocha-junit-reporter": "^1.9.1",
"null-loader": "^0.1.1",
"nyc": "^14.1.1",
"source-map-support": "0.5.12",
"ts-loader": "^3.2.0",
"ts-node": "8.0.3",
"tslint": "^5.8.0",
"tslint-eslint-rules": "^4.1.1",
"typescript": "3.4.2",
"uglifyjs-webpack-plugin": "^1.1.4",
"webpack": "3.12.0"
},
"scripts": {
"build": "node_modules/.bin/gulp",
"pretest": "node_modules/.bin/gulp concat-sjcl",
"test": "./node_modules/.bin/istanbul test -x build/sjcl.js -x src/js/jsbn/* ./node_modules/mocha/bin/mocha -- --reporter spec test/*-test.js",
"coveralls": "cat ./coverage/lcov.info | ./node_modules/.bin/coveralls"
"build": "gulp",
"doctoc": "doctoc docs/index.md --title '# RippleAPI Reference' --github --maxlevel 2",
"docgen": "node --harmony scripts/build_docs.js",
"clean": "rm -rf dist/npm",
"compile": "mkdir -p dist/npm/common/js && cp -r src/common/js/ dist/npm/common/js/ && mkdir -p dist/npm/common && cp -r src/common/schemas dist/npm/common/ && tsc --build",
"watch": "tsc -w",
"prepublish": "npm run clean && npm run compile && npm run build",
"test": "TS_NODE_PROJECT=src/tsconfig.json nyc mocha --exit",
"lint": "tslint -p ./",
"perf": "./scripts/perf_test.sh",
"start": "node scripts/http.js"
},
"repository": {
"type": "git",
@@ -49,6 +71,6 @@
},
"readmeFilename": "README.md",
"engines": {
"node": ">=0.10.0"
"node": ">=6.12.3"
}
}

51
scripts/build_docs.js Normal file
View File

@@ -0,0 +1,51 @@
'use strict';
const fs = require('fs');
const path = require('path');
const execSync = require('child_process').execSync;
const ejs = require('ejs');
const renderFromPaths =
require('json-schema-to-markdown-table').renderFromPaths;
const ROOT = path.dirname(path.normalize(__dirname));
function strip(string) {
return string.replace(/^\s+|\s+$/g, '');
}
function importFile(relativePath) {
const absolutePath = path.join(ROOT, relativePath);
return strip(fs.readFileSync(absolutePath).toString('utf-8'));
}
function renderFixture(fixtureRelativePath) {
const json = importFile(path.join('test', 'fixtures', fixtureRelativePath));
return '\n```json\n' + json + '\n```\n';
}
function renderSchema(schemaRelativePath) {
const schemasPath = path.join(ROOT, 'src', 'common', 'schemas');
const schemaPath = path.join(schemasPath, schemaRelativePath);
return renderFromPaths(schemaPath, schemasPath);
}
function main() {
const locals = {
importFile: importFile,
renderFixture: renderFixture,
renderSchema: renderSchema
};
const indexPath = path.join(ROOT, 'docs', 'src', 'index.md.ejs');
ejs.renderFile(indexPath, locals, function(error, output) {
if (error) {
console.error(error);
process.exit(1);
} else {
const outputPath = path.join(ROOT, 'docs', 'index.md');
fs.writeFileSync(outputPath, output);
execSync('npm run doctoc', {cwd: ROOT});
process.exit(0);
}
});
}
main();

18
scripts/checkeol.sh Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
function checkEOL {
local changedFiles=$(git --no-pager diff --name-only -M100% --diff-filter=AM --relative $(git merge-base FETCH_HEAD origin/HEAD) FETCH_HEAD)
local result=0
for name in $changedFiles; do
grep -c -U -q $'\r' $name
if [ $? -eq 0 ]; then
echo "windows eol found in $name" >&2
result=1
fi
done
if [ $result -eq 1 ]; then
false
fi
}
checkEOL

95
scripts/ci.sh Executable file
View File

@@ -0,0 +1,95 @@
#!/bin/bash -ex
NODE_INDEX="$1"
TOTAL_NODES="$2"
function checkEOL {
./scripts/checkeol.sh
}
lint() {
echo "tslint $(node_modules/.bin/tslint --version)"
yarn lint
}
unittest() {
# test "src"
mocha test --reporter mocha-junit-reporter --reporter-options mochaFile=$CIRCLE_TEST_REPORTS/test-results.xml
yarn test --coverage
#yarn run coveralls
# test compiled version in "dist/npm"
$(npm bin)/babel -D --optional runtime --ignore "**/node_modules/**" -d test-compiled/ test/
echo "--reporter spec --timeout 5000 --slow 500" > test-compiled/mocha.opts
mkdir -p test-compiled/node_modules
ln -nfs ../../dist/npm test-compiled/node_modules/ripple-api
mocha --opts test-compiled/mocha.opts test-compiled
#compile tests for browser testing
#gulp build-min build-tests
#node --harmony test-compiled/mocked-server.js > /dev/null &
#echo "Running tests in PhantomJS"
#mocha-phantomjs test/localrunner.html
#echo "Running tests using minified version in PhantomJS"
#mocha-phantomjs test/localrunnermin.html
#echo "Running tests in SauceLabs"
#http-server &
#yarn run sauce
#pkill -f mocked-server.js
#pkill -f http-server
rm -rf test-compiled
}
integrationtest() {
mocha test/integration/integration-test.js
# run integration tests in PhantomJS
#gulp build-tests build-min
#echo "Running integragtion tests in PhantomJS"
#mocha-phantomjs test/localintegrationrunner.html
}
doctest() {
mv docs/index.md docs/index.md.save
yarn run docgen
mv docs/index.md docs/index.md.test
mv docs/index.md.save docs/index.md
cmp docs/index.md docs/index.md.test
rm docs/index.md.test
}
oneNode() {
checkEOL
doctest
lint
unittest
integrationtest
}
twoNodes() {
case "$NODE_INDEX" in
0) doctest; lint; integrationtest;;
1) checkEOL; unittest;;
*) echo "ERROR: invalid usage"; exit 2;;
esac
}
threeNodes() {
case "$NODE_INDEX" in
0) doctest; lint; integrationtest;;
1) checkEOL;;
2) unittest;;
*) echo "ERROR: invalid usage"; exit 2;;
esac
}
case "$TOTAL_NODES" in
"") oneNode;;
1) oneNode;;
2) twoNodes;;
3) threeNodes;;
*) echo "ERROR: invalid usage"; exit 2;;
esac

View File

@@ -7,37 +7,12 @@ function exit_on_error {
rm -rf build
npm install
yarn install
gulp
npm test
yarn test
exit_on_error
echo ""
echo "publish to npm"
npm publish
yarn publish
exit_on_error
rm -rf dist
echo ""
echo "publish to bower"
git clone git@github.com:ripple/bower-ripple.git dist
gulp bower
exit_on_error
cd dist
version=$(cat bower.json | grep -Eo '([0-9]\.?)+(-rc[0-9])?')
echo "version: $version"
git add ripple.js ripple-debug.js ripple-min.js bower.json
exit_on_error
git commit -m "[TASK] add v$version"
exit_on_error
git tag "v$version"
exit_on_error
git push origin master
git push --tags origin master
cd ..

View File

@@ -7,37 +7,12 @@ function exit_on_error {
rm -rf build
npm install
yarn install
gulp
npm test
yarn test
exit_on_error
echo ""
echo "publish rc to npm"
npm publish --tag beta
yarn publish --tag beta
exit_on_error
rm -rf dist
echo ""
echo "publish to bower"
git clone git@github.com:ripple/bower-ripple.git dist
gulp bower
exit_on_error
cd dist
version=$(cat bower.json | grep -Eo '([0-9]\.?)+(-rc[0-9])?')
echo "version: $version"
git add ripple.js ripple-debug.js ripple-min.js bower.json
exit_on_error
git commit -m "[TASK] add v$version"
exit_on_error
git tag "v$version"
exit_on_error
git push origin master
git push --tags origin master
cd ..

View File

@@ -1,12 +0,0 @@
rm -rf dist
git clone git@github.com:ripple/bower-ripple.git dist
gulp bower
cd dist
version=$(cat bower.json | grep -Eo '([0-9]\.?)+(-rc[0-9])?')
echo "version: $version"
git add ripple.js ripple-debug.js ripple-min.js bower.json
git commit -m "[TASK] add v$version"
git tag "v$version"
git push origin master
git push --tags origin master
cd ..

View File

@@ -1,49 +0,0 @@
var fs = require('fs');
var Ledger = require('../src/js/ripple/ledger').Ledger;
function parse_options(from, flags) {
var argv = from.slice(),
opts = {argv:argv};
flags.forEach(function(f) {
// Do we have the flag?
var flag_index = argv.indexOf('--' + f);
// normalize the name of the flag
f = f.replace('-', '_');
// opts has Boolean value for normalized flag key
opts[f] = !!~flag_index;
if (opts[f]) {
// remove the flag from the argv
argv.splice(flag_index, 1);
}
});
return opts;
}
var opts = parse_options(process.argv.slice(2), // remove `node` and `this.js`
['sanity-test']);
if (opts.argv.length < 1) {
console.error("Usage: scripts/verify_ledger_json path/to/ledger.json");
console.error(" optional: --sanity-test (json>binary>json>binary)");
process.exit(1);
}
var json = fs.readFileSync(opts.argv[0], 'utf-8');
var ledger = Ledger.from_json(JSON.parse(json));
// This will serialize each accountState object to binary and then back to json
// before finally serializing for hashing. This is mostly to expose any issues
// with ripple-libs binary <--> json codecs.
if (opts.sanity_test) {
console.log("All accountState nodes will be processed from " +
"json->binary->json->binary. This may take some time " +
"with large ledgers.");
}
console.log("Transaction hash in header: " + ledger.ledger_json.transaction_hash);
console.log("Calculated transaction hash: " + ledger.calc_tx_hash().to_hex());
console.log("Account state hash in header: " + ledger.ledger_json.account_hash);
console.log("Calculated account state hash: " + ledger.calc_account_hash(
{sanity_test:opts.sanity_test})
.to_hex());

View File

@@ -0,0 +1,17 @@
import {RippleAPI} from '../../dist/npm'
const api = new RippleAPI({
server: 'wss://s.altnet.rippletest.net:51233'
})
getTransaction()
async function getTransaction() {
await api.connect()
const ledger = await api.getLedger({includeTransactions: true})
console.log(ledger)
const tx = await api.getTransaction(ledger.transactionHashes[0])
console.log(tx)
console.log('deliveredAmount:', tx.outcome.deliveredAmount)
process.exit(0)
}

View File

@@ -0,0 +1,13 @@
import {RippleAPI} from '../../dist/npm'
const api = new RippleAPI({server: 'wss://s.altnet.rippletest.net:51233'})
parseAccountFlags()
async function parseAccountFlags() {
await api.connect()
const account_info = await api.request('account_info', {account: 'rKsdkGhyZH6b2Zzd5hNnEqSv2wpznn4n6N'})
const flags = api.parseAccountFlags(account_info.account_data.Flags)
console.log(JSON.stringify(flags, null, 2))
process.exit(0)
}

Some files were not shown because too many files have changed in this diff Show More