mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-19 11:45:49 +00:00
75142139184625c8b9fcc480b1825d9985337813
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
#ripple-lib
A JavaScript API for interacting with Ripple in Node.js and the browser
###Features
- Connect to a rippled server in JavaScript (Node.js or browser)
- Issue rippled API requests
- Listen to events on the Ripple network (transaction, ledger, etc.)
- Sign and submit transactions to the Ripple network
##Getting Started
Install ripple-lib using npm:
$ npm install ripple-lib
Then see the documentation and code samples
##Running tests
- Clone the repository
cdinto the repository and install dependencies withnpm installnpm testornpm test --coverage(istanbulwill create coverage reports in coverage/lcov-report/`)
##Generating Documentation
The continuous integration tests require that the documentation stays up-to-date. If you make changes the the JSON schemas, fixtures, or documentation sources, you must update the documentation by running npm run docgen.
##More Information
Description
A JavaScript/TypeScript API for interacting with the Xahau Ledger in Node.js and the browser
Languages
TypeScript
97.4%
JavaScript
2.6%

