Compare commits

...

10 Commits

Author SHA1 Message Date
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
10 changed files with 45 additions and 34 deletions

View File

@@ -1,3 +0,0 @@
{
"presets": ["es2015", "stage-1", "flow"]
}

View File

@@ -1,10 +0,0 @@
[ignore]
.*/ripple-lib/dist/.*
.*/ripple-lib/test/fixtures/.*
[include]
[libs]
[options]
module.system=node

View File

@@ -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',

View File

@@ -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.

View File

@@ -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"
}
}

View File

@@ -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';

View File

@@ -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)
}

View File

@@ -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
},

View File

@@ -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> {

View File

@@ -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'