mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-17 10:55:48 +00:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e311b74dac | ||
|
|
e3748e070b | ||
|
|
0c318816cc | ||
|
|
55e6801f4a | ||
|
|
4f60fc301f | ||
|
|
139159bf1a | ||
|
|
3ebbca0083 | ||
|
|
51aaa75a05 | ||
|
|
01a25f55f2 | ||
|
|
94196ab268 |
10
.flowconfig
10
.flowconfig
@@ -1,10 +0,0 @@
|
||||
[ignore]
|
||||
.*/ripple-lib/dist/.*
|
||||
.*/ripple-lib/test/fixtures/.*
|
||||
|
||||
[include]
|
||||
|
||||
[libs]
|
||||
|
||||
[options]
|
||||
module.system=node
|
||||
@@ -51,7 +51,9 @@ function getWebpackConfig(extension, overrides) {
|
||||
}, {
|
||||
test: /\.ts$/,
|
||||
use: 'ts-loader',
|
||||
exclude: /node_modules/,
|
||||
include: [
|
||||
path.resolve(__dirname, 'src')
|
||||
]
|
||||
}, {
|
||||
test: /\.json/,
|
||||
use: 'json-loader',
|
||||
|
||||
23
HISTORY.md
23
HISTORY.md
@@ -1,7 +1,30 @@
|
||||
# ripple-lib Release History
|
||||
|
||||
## 0.18.2 (2018-02-13)
|
||||
|
||||
+ [Fix: Publish updated browser builds to npm so that users can easily use
|
||||
CDNs](https://github.com/ripple/ripple-lib/pull/849)
|
||||
+ [Fix: Browserify fails due to dependency on `ws`](https://github.com/ripple/ripple-lib/pull/847)
|
||||
+ [Fix: `build` script fails when `node_modules` is in path](https://github.com/ripple/ripple-lib/pull/846)
|
||||
+ [Reduce size of published npm package](https://github.com/ripple/ripple-lib/commit/0c318816ccf25c4c3932934a35ef903cc552edc1)
|
||||
+ Clean up files from Flow (we migrated to TypeScript)
|
||||
+ Typos and code cleanup
|
||||
|
||||
The SHA-256 checksums for the browser version of this release can be found
|
||||
below.
|
||||
```
|
||||
% shasum -a 256 *
|
||||
f08ab61137255be3639e9d210ded2a182b6e0388f257a70d9b372ce7e7e518a6 ripple-0.18.2-debug.js
|
||||
0604835b8421391167b4314ce93a76b5994780a08bd7edf36d91eb5e8f2643a2 ripple-0.18.2-min.js
|
||||
fda56ab5c8256e04355e20064877ef4053f26c87f37cfcf861340f22bf89ee40 ripple-0.18.2.js
|
||||
```
|
||||
|
||||
## 0.18.1 (2018-01-27)
|
||||
|
||||
Note: The package published to npm for this version did not include updated
|
||||
browser builds. If you are using a CDN that pulls from npm, please use 0.18.2 or
|
||||
later.
|
||||
|
||||
+ [Fix: isSameIssue() should check counterparty](https://github.com/ripple/ripple-lib/pull/836). This bug caused `getOrderbook()` to return incorrect values.
|
||||
|
||||
The SHA-256 checksums for the browser version of this release can be found below.
|
||||
|
||||
19
package.json
19
package.json
@@ -1,16 +1,16 @@
|
||||
{
|
||||
"name": "ripple-lib",
|
||||
"version": "0.18.1",
|
||||
"version": "0.18.2",
|
||||
"license": "ISC",
|
||||
"description": "A JavaScript API for interacting with Ripple in Node.js and the browser",
|
||||
"files": [
|
||||
"dist/npm/*",
|
||||
"bin/*",
|
||||
"build/*",
|
||||
"test/*",
|
||||
"Gulpfile.js"
|
||||
"build/*"
|
||||
],
|
||||
"main": "dist/npm/",
|
||||
"browser": {
|
||||
"ws": "./dist/npm/common/wswrapper.js"
|
||||
},
|
||||
"directories": {
|
||||
"test": "test"
|
||||
},
|
||||
@@ -64,14 +64,13 @@
|
||||
"clean": "rm -rf dist/npm",
|
||||
"compile": "mkdir -p dist/npm/common && cp -r src/common/schemas dist/npm/common/ && tsc",
|
||||
"watch": "tsc -w",
|
||||
"compile-with-source-maps": "babel -D --optional runtime -s -t -d dist/npm/ src/",
|
||||
"prepublish": "npm run clean && npm run compile",
|
||||
"prepublish": "npm run clean && npm run compile && npm run build",
|
||||
"test": "nyc mocha",
|
||||
"coveralls": "cat ./coverage/lcov.info | coveralls",
|
||||
"lint": "tslint -p ./",
|
||||
"perf": "./scripts/perf_test.sh",
|
||||
"start": "babel-node scripts/http.js",
|
||||
"sauce": "babel-node scripts/sauce-runner.js"
|
||||
"start": "node scripts/http.js",
|
||||
"sauce": "node scripts/sauce-runner.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -79,6 +78,6 @@
|
||||
},
|
||||
"readmeFilename": "README.md",
|
||||
"engines": {
|
||||
"node": ">=0.12.0"
|
||||
"node": ">=6.12.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
const createHTTPServer = require('../src/http').createHTTPServer;
|
||||
const createHTTPServer = require('../dist/npm/http').createHTTPServer;
|
||||
const port = 5990;
|
||||
const serverUrl = 'wss://s1.ripple.com';
|
||||
|
||||
|
||||
@@ -4,8 +4,7 @@ import {RippleAPI} from './api'
|
||||
|
||||
class RippleAPIBroadcast extends RippleAPI {
|
||||
|
||||
// TODO: Should this default to 0, or null/undefined?
|
||||
ledgerVersion: number = 0
|
||||
ledgerVersion: number | undefined = undefined
|
||||
private _apis: RippleAPI[]
|
||||
|
||||
constructor(servers, options) {
|
||||
@@ -50,7 +49,8 @@ class RippleAPIBroadcast extends RippleAPI {
|
||||
}
|
||||
|
||||
onLedgerEvent(ledger) {
|
||||
if (ledger.ledgerVersion > this.ledgerVersion) {
|
||||
if (ledger.ledgerVersion > this.ledgerVersion ||
|
||||
this.ledgerVersion === undefined) {
|
||||
this.ledgerVersion = ledger.ledgerVersion
|
||||
this.emit('ledger', ledger)
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
]
|
||||
},
|
||||
"maxLedgerVersionOffset": {
|
||||
"description": "Offset from current validated legder version to highest ledger version that the transaction can be included in.",
|
||||
"description": "Offset from current validated ledger version to highest ledger version that the transaction can be included in.",
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
},
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import * as _ from 'lodash'
|
||||
import {convertKeysFromSnakeCaseToCamelCase} from './utils'
|
||||
import Connection from './connection'
|
||||
import BigNumber from 'bignumber.js'
|
||||
|
||||
export type GetServerInfoResponse = {
|
||||
buildVersion: string,
|
||||
@@ -60,13 +61,12 @@ function getServerInfo(connection: Connection): Promise<GetServerInfoResponse> {
|
||||
})
|
||||
}
|
||||
|
||||
// TODO: This was originally annotated to return a number, but actually
|
||||
// returned a toString'ed number. Should this actually be returning a number?
|
||||
function computeFeeFromServerInfo(cushion: number,
|
||||
serverInfo: GetServerInfoResponse
|
||||
): string {
|
||||
return (Number(serverInfo.validatedLedger.baseFeeXRP)
|
||||
* Number(serverInfo.loadFactor) * cushion).toString()
|
||||
return (new BigNumber(serverInfo.validatedLedger.baseFeeXRP)).
|
||||
times(serverInfo.loadFactor).
|
||||
times(cushion).toString()
|
||||
}
|
||||
|
||||
function getFee(connection: Connection, cushion: number): Promise<string> {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import * as assert from 'assert'
|
||||
import * as _ from 'lodash'
|
||||
import jayson from 'jayson'
|
||||
import * as jayson from 'jayson'
|
||||
import {RippleAPI} from './api'
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user