diff --git a/packages/ripple-address-codec/HISTORY.md b/packages/ripple-address-codec/HISTORY.md new file mode 100644 index 00000000..13aa7eb4 --- /dev/null +++ b/packages/ripple-address-codec/HISTORY.md @@ -0,0 +1,16 @@ +# ripple-address-codec Release History + +## 4.0.0 (UNRELEASED) + +### Breaking Changes + +* `decodeAddress` has been renamed to `decodeAccountID` +* `isValidAddress` has been renamed to `isValidClassicAddress` + +### New Features + +* `classicAddressToXAddress` - Derive X-address from classic address, tag, and network ID +* `encodeXAddress` - Encode account ID, tag, and network ID as an X-address +* `xAddressToClassicAddress` - Decode an X-address to account ID, tag, and network ID +* `decodeXAddress` - Convert X-address to classic address, tag, and network ID +* `isValidXAddress` - Check whether an X-address (X...) is valid diff --git a/packages/ripple-address-codec/README.md b/packages/ripple-address-codec/README.md index e2f3f080..de4450b6 100644 --- a/packages/ripple-address-codec/README.md +++ b/packages/ripple-address-codec/README.md @@ -1,7 +1,49 @@ # ripple-address-codec [![NPM](https://img.shields.io/npm/v/ripple-address-codec.svg)](https://npmjs.org/package/ripple-address-codec) +Functions for encoding and decoding XRP Ledger addresses and seeds. Also includes support for encoding/decoding [rippled validator (node) public keys](https://xrpl.org/run-rippled-as-a-validator.html). + +## X-address Conversion + +All tools and apps in the XRP Ledger ecosystem are encouraged to adopt support for the X-address format. The X-address format is a single Base58 string that encodes an 'Account ID', a (destination) tag, and whether the address is intended for a test network. This prevents users from unintentionally omitting the destination tag when sending and receiving payments and other transactions. + ## API +### classicAddressToXAddress(classicAddress: string, tag: number | false, test: boolean): string + +Convert a classic address and (optional) tag to an X-address. If `tag` is `false`, the returned X-address explicitly indicates that the recipient does not want a tag to be used. If `test` is `true`, consumers of the address will know that the address is intended for use on test network(s) and the address will start with `T`. + +```js +> const api = require('ripple-address-codec') +> api.classicAddressToXAddress('rGWrZyQqhTp9Xu7G5Pkayo7bXjH4k4QYpf', 4294967295) +'XVLhHMPHU98es4dbozjVtdWzVrDjtV18pX8yuPT7y4xaEHi' +``` + +### xAddressToClassicAddress(xAddress: string): {classicAddress: string, tag: number | false, test: boolean} + +Convert an X-address to a classic address and tag. If the X-address did not have a tag, the returned object will not have a `tag` field. If the X-address is intended for use on test network(s), `test` will be `true`; if it is intended for use on the main network (mainnet), `test` will be `false`. + +```js +> const api = require('ripple-address-codec') +> rippleAddressCodec.xAddressToClassicAddress('XVLhHMPHU98es4dbozjVtdWzVrDjtV18pX8yuPT7y4xaEHi') +{ + classicAddress: 'rGWrZyQqhTp9Xu7G5Pkayo7bXjH4k4QYpf', + tag: 4294967295, + test: true +} +``` + +### isValidXAddress(xAddress: string): boolean + +Returns `true` if the provided X-address is valid, or `false` otherwise. + +```js +> const api = require('ripple-address-codec') +> api.isValidXAddress('XVLhHMPHU98es4dbozjVtdWzVrDjtV18pX8yuPT7y4xaEHi') +true +``` + +### Other functions + ```js > var api = require('ripple-address-codec'); > api.decodeSeed('sEdTM1uX8pu2do5XvTnutH6HsouMaM2') @@ -50,3 +92,11 @@ Use `--coverage` to generate and display code coverage information: yarn test --coverage This tells jest to output code coverage info in the `./coverage` directory, in addition to showing it on the command line. + +## Acknowledgements + +This library references and adopts code and standards from the following sources: + +- [XLS-5d Standard for Tagged Addresses](https://github.com/xrp-community/standards-drafts/issues/6) by @nbougalis +- [XRPL Tagged Address Codec](https://github.com/xrp-community/xrpl-tagged-address-codec) by @WietseWind +- [X-Address transaction functions](https://github.com/codetsunami/xrpl-tools/tree/master/xaddress-functions) by @codetsunami diff --git a/packages/ripple-address-codec/package.json b/packages/ripple-address-codec/package.json index 0515a06f..29bae2e2 100644 --- a/packages/ripple-address-codec/package.json +++ b/packages/ripple-address-codec/package.json @@ -1,6 +1,6 @@ { "name": "ripple-address-codec", - "version": "3.0.4", + "version": "4.0.0-b5", "description": "encodes/decodes base58 encoded XRP Ledger identifiers", "files": [ "dist/*", @@ -19,6 +19,7 @@ "url": "git://github.com/ripple/ripple-address-codec.git" }, "prepublish": "tsc", + "prepublishOnly": "tslint -p ./ && jest", "scripts": { "compile": "tsc", "test": "jest", diff --git a/packages/ripple-address-codec/src/index.test.ts b/packages/ripple-address-codec/src/index.test.ts new file mode 100644 index 00000000..6bd162bd --- /dev/null +++ b/packages/ripple-address-codec/src/index.test.ts @@ -0,0 +1,229 @@ +import { + classicAddressToXAddress, + xAddressToClassicAddress, + isValidXAddress, + encodeXAddress +} from './index' + +const testCases = [ + [ + 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59', + false, + 'X7AcgcsBL6XDcUb289X4mJ8djcdyKaB5hJDWMArnXr61cqZ', + 'T719a5UwUCnEs54UsxG9CJYYDhwmFCqkr7wxCcNcfZ6p5GZ' + ], + [ + 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59', + 1, + 'X7AcgcsBL6XDcUb289X4mJ8djcdyKaGZMhc9YTE92ehJ2Fu', + 'T719a5UwUCnEs54UsxG9CJYYDhwmFCvbJNZbi37gBGkRkbE' + ], + [ + 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59', + 11747, + 'X7AcgcsBL6XDcUb289X4mJ8djcdyKaLFuhLRuNXPrDeJd9A', + 'T719a5UwUCnEs54UsxG9CJYYDhwmFCziiNHtUukubF2Mg6t' + ], + [ + 'rLczgQHxPhWtjkaQqn3Q6UM8AbRbbRvs5K', + false, + 'XVZVpQj8YSVpNyiwXYSqvQoQqgBttTxAZwMcuJd4xteQHyt', + 'TVVrSWtmQQssgVcmoMBcFQZKKf56QscyWLKnUyiuZW8ALU4' + ], + [ + 'rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo', + false, + 'X7YenJqxv3L66CwhBSfd3N8RzGXxYqPopMGMsCcpho79rex', + 'T77wVQzA8ntj9wvCTNiQpNYLT5hmhRsFyXDoMLqYC4BzQtV' + ], + [ + 'rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW', + 23480, + 'X7d3eHCXzwBeWrZec1yT24iZerQjYL8m8zCJ16ACxu1BrBY', + 'T7YChPFWifjCAXLEtg5N74c7fSAYsvSokwcmBPBUZWhxH5P' + ], + [ + 'rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW', + 11747, + 'X7d3eHCXzwBeWrZec1yT24iZerQjYLo2CJf8oVC5CMWey5m', + 'T7YChPFWifjCAXLEtg5N74c7fSAYsvTcc7nEfwuEEvn5Q4w' + ], + [ + 'rGWrZyQqhTp9Xu7G5Pkayo7bXjH4k4QYpf', + false, + 'XVLhHMPHU98es4dbozjVtdWzVrDjtV5fdx1mHp98tDMoQXb', + 'TVE26TYGhfLC7tQDno7G8dGtxSkYQn49b3qD26PK7FcGSKE' + ], + [ + 'rGWrZyQqhTp9Xu7G5Pkayo7bXjH4k4QYpf', + 0, + 'XVLhHMPHU98es4dbozjVtdWzVrDjtV8AqEL4xcZj5whKbmc', + 'TVE26TYGhfLC7tQDno7G8dGtxSkYQnSy8RHqGHoGJ59spi2' + ], + [ + 'rGWrZyQqhTp9Xu7G5Pkayo7bXjH4k4QYpf', + 1, + 'XVLhHMPHU98es4dbozjVtdWzVrDjtV8xvjGQTYPiAx6gwDC', + 'TVE26TYGhfLC7tQDno7G8dGtxSkYQnSz1uDimDdPYXzSpyw' + ], + [ + 'rGWrZyQqhTp9Xu7G5Pkayo7bXjH4k4QYpf', + 2, + 'XVLhHMPHU98es4dbozjVtdWzVrDjtV8zpDURx7DzBCkrQE7', + 'TVE26TYGhfLC7tQDno7G8dGtxSkYQnTryP9tG9TW8GeMBmd' + ], + [ + 'rGWrZyQqhTp9Xu7G5Pkayo7bXjH4k4QYpf', + 32, + 'XVLhHMPHU98es4dbozjVtdWzVrDjtVoYiC9UvKfjKar4LJe', + 'TVE26TYGhfLC7tQDno7G8dGtxSkYQnT2oqaCDzMEuCDAj1j' + ], + [ + 'rGWrZyQqhTp9Xu7G5Pkayo7bXjH4k4QYpf', + 276, + 'XVLhHMPHU98es4dbozjVtdWzVrDjtVoKj3MnFGMXEFMnvJV', + 'TVE26TYGhfLC7tQDno7G8dGtxSkYQnTMgJJYfAbsiPsc6Zg' + ], + [ + 'rGWrZyQqhTp9Xu7G5Pkayo7bXjH4k4QYpf', + 65591, + 'XVLhHMPHU98es4dbozjVtdWzVrDjtVozpjdhPQVdt3ghaWw', + 'TVE26TYGhfLC7tQDno7G8dGtxSkYQn7ryu2W6njw7mT1jmS' + ], + [ + 'rGWrZyQqhTp9Xu7G5Pkayo7bXjH4k4QYpf', + 16781933, + 'XVLhHMPHU98es4dbozjVtdWzVrDjtVqrDUk2vDpkTjPsY73', + 'TVE26TYGhfLC7tQDno7G8dGtxSkYQnVsw45sDtGHhLi27Qa' + ], + [ + 'rGWrZyQqhTp9Xu7G5Pkayo7bXjH4k4QYpf', + 4294967294, + 'XVLhHMPHU98es4dbozjVtdWzVrDjtV1kAsixQTdMjbWi39u', + 'TVE26TYGhfLC7tQDno7G8dGtxSkYQnX8tDFQ53itLNqs6vU' + ], + [ + 'rGWrZyQqhTp9Xu7G5Pkayo7bXjH4k4QYpf', + 4294967295, + 'XVLhHMPHU98es4dbozjVtdWzVrDjtV18pX8yuPT7y4xaEHi', + 'TVE26TYGhfLC7tQDno7G8dGtxSkYQnXoy6kSDh6rZzApc69' + ], + [ + 'rPEPPER7kfTD9w2To4CQk6UCfuHM9c6GDY', + false, + 'XV5sbjUmgPpvXv4ixFWZ5ptAYZ6PD2gYsjNFQLKYW33DzBm', + 'TVd2rqMkYL2AyS97NdELcpeiprNBjwLZzuUG5rZnaewsahi' + ], + [ + 'rPEPPER7kfTD9w2To4CQk6UCfuHM9c6GDY', + 0, + 'XV5sbjUmgPpvXv4ixFWZ5ptAYZ6PD2m4Er6SnvjVLpMWPjR', + 'TVd2rqMkYL2AyS97NdELcpeiprNBjwRQUBetPbyrvXSTuxU' + ], + [ + 'rPEPPER7kfTD9w2To4CQk6UCfuHM9c6GDY', + 13371337, + 'XV5sbjUmgPpvXv4ixFWZ5ptAYZ6PD2qwGkhgc48zzcx6Gkr', + 'TVd2rqMkYL2AyS97NdELcpeiprNBjwVUDvp3vhpXbNhLwJi' + ] +] + +;[false, true].forEach(isTestAddress => { + const MAX_32_BIT_UNSIGNED_INT = 4294967295 + const network = isTestAddress ? ' (test)' : ' (main)' + + for (const i in testCases) { + const testCase = testCases[i] + const classicAddress = testCase[0] as string + const tag = testCase[1] !== false ? testCase[1] as number : false + const xAddress = isTestAddress ? testCase[3] as string : testCase[2] as string + test(`Converts ${classicAddress}${tag ? ':' + tag : ''} to ${xAddress}${network}`, () => { + expect(classicAddressToXAddress(classicAddress, tag, isTestAddress)).toBe(xAddress) + const myClassicAddress = xAddressToClassicAddress(xAddress) + expect(myClassicAddress).toEqual({ + classicAddress, + tag, + test: isTestAddress + }) + expect(isValidXAddress(xAddress)).toBe(true) + }) + } + + { + const classicAddress = 'rGWrZyQqhTp9Xu7G5Pkayo7bXjH4k4QYpf' + const tag = MAX_32_BIT_UNSIGNED_INT + 1 + + test(`Converting ${classicAddress}:${tag}${network} throws`, () => { + expect(() => { + classicAddressToXAddress(classicAddress, tag, isTestAddress) + }).toThrowError(new Error('Invalid tag')) + }) + } + + { + const classicAddress = 'r' + test(`Invalid classic address: Converting ${classicAddress}${network} throws`, () => { + expect(() => { + classicAddressToXAddress(classicAddress, false, isTestAddress) + }).toThrowError(new Error('invalid_input_size: decoded data must have length >= 5')) + }) + } + + { + const highAndLowAccounts = [ + Buffer.from('00'.repeat(20), 'hex'), + Buffer.from('00'.repeat(19) + '01', 'hex'), + Buffer.from('01'.repeat(20), 'hex'), + Buffer.from('FF'.repeat(20), 'hex') + ] + + highAndLowAccounts.forEach(accountId => { + [false, 0, 1, MAX_32_BIT_UNSIGNED_INT].forEach(t => { + const tag = (t as number | false) + const xAddress = encodeXAddress(accountId, tag, isTestAddress) + test(`Encoding ${accountId.toString('hex')}${tag ? ':' + tag : ''} to ${xAddress} has expected length`, () => { + expect(xAddress.length).toBe(47) + }) + }) + }) + } +}) + +{ + const xAddress = 'XVLhHMPHU98es4dbozjVtdWzVrDjtV5fdx1mHp98tDMoQXa' + test(`Invalid X-address (bad checksum): Converting ${xAddress} throws`, () => { + expect(() => { + xAddressToClassicAddress(xAddress) + }).toThrowError(new Error('checksum_invalid')) + }) +} + +{ + const xAddress = 'dGzKGt8CVpWoa8aWL1k18tAdy9Won3PxynvbbpkAqp3V47g' + test(`Invalid X-address (bad prefix): Converting ${xAddress} throws`, () => { + expect(() => { + xAddressToClassicAddress(xAddress) + }).toThrowError(new Error('Invalid X-address: bad prefix')) + }) +} + +test(`Invalid X-address (64-bit tag) throws`, () => { + expect(() => { + // Encoded from: + // { + // classicAddress: 'rGWrZyQqhTp9Xu7G5Pkayo7bXjH4k4QYpf', + // tag: MAX_32_BIT_UNSIGNED_INT + 1 + // } + xAddressToClassicAddress('XVLhHMPHU98es4dbozjVtdWzVrDjtV18pX8zeUygYrCgrPh') + }).toThrowError('Unsupported X-address') +}) + +test(`Invalid Account ID throws`, () => { + expect(() => { + encodeXAddress(Buffer.from('00'.repeat(19), 'hex'), false, false) + }).toThrowError('Account ID must be 20 bytes') +}) + +test(`isValidXAddress returns false for invalid X-address`, () => { + expect(isValidXAddress('XVLhHMPHU98es4dbozjVtdWzVrDjtV18pX8zeUygYrCgrPh')).toBe(false) +}) diff --git a/packages/ripple-address-codec/src/index.ts b/packages/ripple-address-codec/src/index.ts index 30f76518..39fc8619 100644 --- a/packages/ripple-address-codec/src/index.ts +++ b/packages/ripple-address-codec/src/index.ts @@ -1 +1,132 @@ -export * from './xrp-codec' +import { + codec, + encodeSeed, + decodeSeed, + encodeAccountID, + decodeAccountID, + encodeNodePublic, + decodeNodePublic, + isValidClassicAddress +} from './xrp-codec' +import * as assert from 'assert' + +const PREFIX_BYTES = { + MAIN: Buffer.from([0x05, 0x44]), // 5, 68 + TEST: Buffer.from([0x04, 0x93]) // 4, 147 +} + +function classicAddressToXAddress(classicAddress: string, tag: number | false, test: boolean): string { + const accountId = decodeAccountID(classicAddress) + return encodeXAddress(accountId, tag, test) +} + +function encodeXAddress(accountId: Buffer, tag: number | false, test: boolean): string { + if (accountId.length !== 20) { + // RIPEMD160 is 160 bits = 20 bytes + throw new Error('Account ID must be 20 bytes') + } + const MAX_32_BIT_UNSIGNED_INT = 4294967295 + const flag = tag === false ? 0 : tag <= MAX_32_BIT_UNSIGNED_INT ? 1 : 2 + if (flag === 2) { + throw new Error('Invalid tag') + } + if (tag === false) { + tag = 0 + } + const bytes = Buffer.concat( + [ + test ? PREFIX_BYTES.TEST : PREFIX_BYTES.MAIN, + accountId, + Buffer.from( + [ + flag, // 0x00 if no tag, 0x01 if 32-bit tag + tag & 0xff, // first byte + (tag >> 8) & 0xff, // second byte + (tag >> 16) & 0xff, // third byte + (tag >> 24) & 0xff, // fourth byte + 0, 0, 0, 0 // four zero bytes (reserved for 64-bit tags) + ] + ) + ] + ) + const xAddress = codec.encodeChecked(bytes) + return xAddress +} + +function xAddressToClassicAddress(xAddress: string): {classicAddress: string, tag: number | false, test: boolean} { + const { + accountId, + tag, + test + } = decodeXAddress(xAddress) + const classicAddress = encodeAccountID(accountId) + return { + classicAddress, + tag, + test + } +} + +function decodeXAddress(xAddress: string): {accountId: Buffer, tag: number | false, test: boolean} { + const decoded = codec.decodeChecked(xAddress) + const test = isBufferForTestAddress(decoded) + const accountId = decoded.slice(2, 22) + const tag = tagFromBuffer(decoded) + return { + accountId, + tag, + test + } +} + +function isBufferForTestAddress(buf: Buffer): boolean { + const decodedPrefix = buf.slice(0, 2) + if (PREFIX_BYTES.MAIN.equals(decodedPrefix)) { + return false + } else if (PREFIX_BYTES.TEST.equals(decodedPrefix)) { + return true + } else { + throw new Error('Invalid X-address: bad prefix') + } +} + +function tagFromBuffer(buf: Buffer): number | false { + const flag = buf[22] + if (flag >= 2) { + // No support for 64-bit tags at this time + throw new Error('Unsupported X-address') + } + if (flag === 1) { + // Little-endian to big-endian + return buf[23] + buf[24] * 0x100 + buf[25] * 0x10000 + buf[26] * 0x1000000 + } + assert.strictEqual(flag, 0, 'flag must be zero to indicate no tag') + assert.ok(Buffer.from('0000000000000000', 'hex').equals(buf.slice(23, 23 + 8)), + 'remaining bytes must be zero') + return false +} + +function isValidXAddress(xAddress: string): boolean { + try { + decodeXAddress(xAddress) + } catch (e) { + return false + } + return true +} + +export { + codec, // Codec with XRP alphabet + encodeSeed, // Encode entropy as a "seed" + decodeSeed, // Decode a seed into an object with its version, type, and bytes + encodeAccountID, // Encode bytes as a classic address (r...) + decodeAccountID, // Decode a classic address to its raw bytes + encodeNodePublic, // Encode bytes to XRP Ledger node public key format + decodeNodePublic, // Decode an XRP Ledger node public key into its raw bytes + isValidClassicAddress, // Check whether a classic address (r...) is valid + classicAddressToXAddress, // Derive X-address from classic address, tag, and network ID + encodeXAddress, // Encode account ID, tag, and network ID to X-address + xAddressToClassicAddress, // Decode X-address to account ID, tag, and network ID + decodeXAddress, // Convert X-address to classic address, tag, and network ID + isValidXAddress, // Check whether an X-address (X...) is valid +} diff --git a/packages/ripple-address-codec/src/xrp-codec.test.ts b/packages/ripple-address-codec/src/xrp-codec.test.ts index 123434b6..0f6092e8 100644 --- a/packages/ripple-address-codec/src/xrp-codec.test.ts +++ b/packages/ripple-address-codec/src/xrp-codec.test.ts @@ -53,20 +53,20 @@ test('can pass a type as second arg to encodeSeed', function() { expect(api.encodeSeed(decoded.bytes, type)).toBe(edSeed) }) -test('isValidAddress - secp256k1 address valid', function() { - expect(api.isValidAddress('rU6K7V3Po4snVhBBaU29sesqs2qTQJWDw1')).toBe(true) +test('isValidClassicAddress - secp256k1 address valid', function() { + expect(api.isValidClassicAddress('rU6K7V3Po4snVhBBaU29sesqs2qTQJWDw1')).toBe(true) }) -test('isValidAddress - ed25519 address valid', function() { - expect(api.isValidAddress('rLUEXYuLiQptky37CqLcm9USQpPiz5rkpD')).toBe(true) +test('isValidClassicAddress - ed25519 address valid', function() { + expect(api.isValidClassicAddress('rLUEXYuLiQptky37CqLcm9USQpPiz5rkpD')).toBe(true) }) -test('isValidAddress - invalid', function() { - expect(api.isValidAddress('rU6K7V3Po4snVhBBaU29sesqs2qTQJWDw2')).toBe(false) +test('isValidClassicAddress - invalid', function() { + expect(api.isValidClassicAddress('rU6K7V3Po4snVhBBaU29sesqs2qTQJWDw2')).toBe(false) }) -test('isValidAddress - empty', function() { - expect(api.isValidAddress('')).toBe(false) +test('isValidClassicAddress - empty', function() { + expect(api.isValidClassicAddress('')).toBe(false) }) describe('encodeSeed', function() { diff --git a/packages/ripple-address-codec/src/xrp-codec.ts b/packages/ripple-address-codec/src/xrp-codec.ts index 65eaf739..e010e78c 100644 --- a/packages/ripple-address-codec/src/xrp-codec.ts +++ b/packages/ripple-address-codec/src/xrp-codec.ts @@ -30,24 +30,24 @@ class Codec { encode(bytes: Buffer, opts: { versions: number[], expectedLength: number - }) { + }): string { const versions = opts.versions return this.encodeVersioned(bytes, versions, opts.expectedLength) } - encodeVersioned(bytes: Buffer, versions: number[], expectedLength: number) { + encodeVersioned(bytes: Buffer, versions: number[], expectedLength: number): string { if (expectedLength && bytes.length !== expectedLength) { throw new Error('unexpected_payload_length: bytes.length does not match expectedLength') } return this.encodeChecked(Buffer.from(concatArgs(versions, bytes))) } - encodeChecked(buffer: Buffer) { + encodeChecked(buffer: Buffer): string { const check = this.sha256(this.sha256(buffer)).slice(0, 4) return this.encodeRaw(Buffer.from(concatArgs(buffer, check))) } - encodeRaw(bytes: Buffer) { + encodeRaw(bytes: Buffer): string { return this.codec.encode(bytes) } @@ -93,7 +93,7 @@ class Codec { throw new Error('version_invalid: version bytes do not match any of the provided version(s)') } - decodeChecked(base58string: string) { + decodeChecked(base58string: string): Buffer { const buffer = this.decodeRaw(base58string) if (buffer.length < 5) { throw new Error('invalid_input_size: decoded data must have length >= 5') @@ -104,11 +104,11 @@ class Codec { return buffer.slice(0, -4) } - decodeRaw(base58string: string) { + decodeRaw(base58string: string): Buffer { return this.codec.decode(base58string) } - verifyCheckSum(bytes: Buffer) { + verifyCheckSum(bytes: Buffer): boolean { const computed = this.sha256(this.sha256(bytes.slice(0, -4))).slice(0, 4) const checksum = bytes.slice(-4) return seqEqual(computed, checksum) @@ -119,6 +119,7 @@ class Codec { * XRP codec */ +// Pure JavaScript hash functions in the browser, native hash functions in Node.js const createHash = require('create-hash') const NODE_PUBLIC = 28 @@ -190,8 +191,7 @@ export function encodeNodePublic(bytes: Buffer): string { return codecWithXrpAlphabet.encode(bytes, opts) } -// Address === AccountID -export function isValidAddress(address: string): boolean { +export function isValidClassicAddress(address: string): boolean { try { decodeAccountID(address) } catch (e) { diff --git a/packages/ripple-address-codec/yarn.lock b/packages/ripple-address-codec/yarn.lock index ebfb93a8..cb87413c 100644 --- a/packages/ripple-address-codec/yarn.lock +++ b/packages/ripple-address-codec/yarn.lock @@ -10,16 +10,16 @@ "@babel/highlight" "^7.0.0" "@babel/core@^7.1.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.6.0.tgz#9b00f73554edd67bebc86df8303ef678be3d7b48" - integrity sha512-FuRhDRtsd6IptKpHXAa+4WPZYY2ZzgowkbLBecEDDSje1X/apG7jQM33or3NdOmjXBKWGOg4JmSiRfUfuTtHXw== + version "7.6.2" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.6.2.tgz#069a776e8d5e9eefff76236bc8845566bd31dd91" + integrity sha512-l8zto/fuoZIbncm+01p8zPSDZu/VuuJhAfA7d/AbzM09WR7iVhavvfNDYCNpo1VvLk6E6xgAoP9P+/EMJHuRkQ== dependencies: "@babel/code-frame" "^7.5.5" - "@babel/generator" "^7.6.0" - "@babel/helpers" "^7.6.0" - "@babel/parser" "^7.6.0" + "@babel/generator" "^7.6.2" + "@babel/helpers" "^7.6.2" + "@babel/parser" "^7.6.2" "@babel/template" "^7.6.0" - "@babel/traverse" "^7.6.0" + "@babel/traverse" "^7.6.2" "@babel/types" "^7.6.0" convert-source-map "^1.1.0" debug "^4.1.0" @@ -29,16 +29,15 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/generator@^7.4.0", "@babel/generator@^7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.6.0.tgz#e2c21efbfd3293ad819a2359b448f002bfdfda56" - integrity sha512-Ms8Mo7YBdMMn1BYuNtKuP/z0TgEIhbcyB8HVR6PPNYp4P61lMsABiS4A3VG1qznjXVCf3r+fVHhm4efTYVsySA== +"@babel/generator@^7.4.0", "@babel/generator@^7.6.2": + version "7.6.2" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.6.2.tgz#dac8a3c2df118334c2a29ff3446da1636a8f8c03" + integrity sha512-j8iHaIW4gGPnViaIHI7e9t/Hl8qLjERI6DcV9kEpAIDJsAOrcnXqRS7t+QbhL76pwbtqP+QCQLL0z1CyVmtjjQ== dependencies: "@babel/types" "^7.6.0" jsesc "^2.5.1" lodash "^4.17.13" source-map "^0.5.0" - trim-right "^1.0.1" "@babel/helper-function-name@^7.1.0": version "7.1.0" @@ -68,13 +67,13 @@ dependencies: "@babel/types" "^7.4.4" -"@babel/helpers@^7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.6.0.tgz#21961d16c6a3c3ab597325c34c465c0887d31c6e" - integrity sha512-W9kao7OBleOjfXtFGgArGRX6eCP0UEcA2ZWEWNkJdRZnHhW4eEbeswbG3EwaRsnQUAEGWYgMq1HsIXuNNNy2eQ== +"@babel/helpers@^7.6.2": + version "7.6.2" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.6.2.tgz#681ffe489ea4dcc55f23ce469e58e59c1c045153" + integrity sha512-3/bAUL8zZxYs1cdX2ilEE0WobqbCmKWr/889lf2SS0PpDcpEIY8pb1CCyz0pEcX3pEb+MCbks1jIokz2xLtGTA== dependencies: "@babel/template" "^7.6.0" - "@babel/traverse" "^7.6.0" + "@babel/traverse" "^7.6.2" "@babel/types" "^7.6.0" "@babel/highlight@^7.0.0": @@ -86,10 +85,10 @@ esutils "^2.0.2" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.6.0.tgz#3e05d0647432a8326cb28d0de03895ae5a57f39b" - integrity sha512-+o2q111WEx4srBs7L9eJmcwi655eD8sXniLqMB93TBK9GrNzGrxDWSjiqz2hLU0Ha8MTXFIP0yd9fNdP+m43ZQ== +"@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.6.0", "@babel/parser@^7.6.2": + version "7.6.2" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.6.2.tgz#205e9c95e16ba3b8b96090677a67c9d6075b70a1" + integrity sha512-mdFqWrSPCmikBoaBYMuBulzTIKuXVPtEISFbRRVNwMWpCms/hmE2kRq0bblUHaNRKrjRlmVbx1sDHmjmRgD2Xg== "@babel/plugin-syntax-object-rest-spread@^7.0.0": version "7.2.0" @@ -107,16 +106,16 @@ "@babel/parser" "^7.6.0" "@babel/types" "^7.6.0" -"@babel/traverse@^7.1.0", "@babel/traverse@^7.4.3", "@babel/traverse@^7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.6.0.tgz#389391d510f79be7ce2ddd6717be66d3fed4b516" - integrity sha512-93t52SaOBgml/xY74lsmt7xOR4ufYvhb5c5qiM6lu4J/dWGMAfAh6eKw4PjLes6DI6nQgearoxnFJk60YchpvQ== +"@babel/traverse@^7.1.0", "@babel/traverse@^7.4.3", "@babel/traverse@^7.6.2": + version "7.6.2" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.6.2.tgz#b0e2bfd401d339ce0e6c05690206d1e11502ce2c" + integrity sha512-8fRE76xNwNttVEF2TwxJDGBLWthUkHWSldmfuBzVRmEDWOtu4XdINTgN7TDWzuLg4bbeIMLvfMFD9we5YcWkRQ== dependencies: "@babel/code-frame" "^7.5.5" - "@babel/generator" "^7.6.0" + "@babel/generator" "^7.6.2" "@babel/helper-function-name" "^7.1.0" "@babel/helper-split-export-declaration" "^7.4.4" - "@babel/parser" "^7.6.0" + "@babel/parser" "^7.6.2" "@babel/types" "^7.6.0" debug "^4.1.0" globals "^11.1.0" @@ -299,9 +298,9 @@ "@types/babel__traverse" "*" "@types/babel__generator@*": - version "7.0.2" - resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.0.2.tgz#d2112a6b21fad600d7674274293c85dce0cb47fc" - integrity sha512-NHcOfab3Zw4q5sEE2COkpfXjoE7o+PmqD9DQW4koUT3roNxwziUdXGnRndMat/LJNUtePwn1TlP4do3uoe3KZQ== + version "7.6.0" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.0.tgz#f1ec1c104d1bb463556ecb724018ab788d0c172a" + integrity sha512-c1mZUu4up5cp9KROs/QAw0gTeHrw/x7m52LcnvMxxOZ03DmLwPV0MlGmlgzV3cnSdjhJOZsj7E7FHeioai+egw== dependencies: "@babel/types" "^7.0.0" @@ -360,14 +359,14 @@ "@types/jest-diff" "*" "@types/node@*": - version "12.7.5" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.7.5.tgz#e19436e7f8e9b4601005d73673b6dc4784ffcc2f" - integrity sha512-9fq4jZVhPNW8r+UYKnxF1e2HkDWOWKM5bC2/7c9wPV835I0aOrVbS/Hw/pWPk2uKrNXQqg9Z959Kz+IYDd5p3w== + version "12.7.7" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.7.7.tgz#f9bd8c00fa9e1a8129af910fc829f6139c397d6c" + integrity sha512-4jUncNe2tj1nmrO/34PsRpZqYVnRV1svbU78cKhuQKkMntKB/AmdLyGgswcZKjFHEHGpiY8pVD8CuVI55nP54w== "@types/node@^10.12.0": - version "10.12.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.0.tgz#ea6dcbddbc5b584c83f06c60e82736d8fbb0c235" - integrity sha512-3TUHC3jsBAB7qVRGxT6lWyYo2v96BMmD2PTcl47H25Lu7UXtFH/2qqmKiVrnel6Ne//0TFYf6uvNX+HW2FRkLQ== + version "10.14.19" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.19.tgz#f52742c7834a815dedf66edfc8a51547e2a67342" + integrity sha512-j6Sqt38ssdMKutXBUuAcmWF8QtHW1Fwz/mz4Y+Wd9mzpBiVFirjpNQf363hG5itkG+yGaD+oiLyb50HxJ36l9Q== "@types/stack-utils@^1.0.1": version "1.0.1" @@ -728,7 +727,7 @@ caseless@~0.12.0: resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= -chalk@^2.0.0, chalk@^2.0.1, chalk@^2.4.2: +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.3.0, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -737,15 +736,6 @@ chalk@^2.0.0, chalk@^2.0.1, chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^2.3.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" - integrity sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - chownr@^1.1.1: version "1.1.2" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.2.tgz#a18f1e0b269c8a6a5d3c86eb298beb14c3dd7bf6" @@ -802,13 +792,13 @@ collection-visit@^1.0.0: object-visit "^1.0.0" color-convert@^1.9.0: - version "1.9.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.1.tgz#c1261107aeb2f294ebffec9ed9ecad529a6097ed" - integrity sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ== + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== dependencies: - color-name "^1.1.1" + color-name "1.1.3" -color-name@^1.1.1: +color-name@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= @@ -820,12 +810,7 @@ combined-stream@^1.0.6, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" -commander@^2.12.1: - version "2.19.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a" - integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg== - -commander@~2.20.0: +commander@^2.12.1, commander@~2.20.0: version "2.20.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== @@ -1007,10 +992,10 @@ diff-sequences@^24.9.0: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-24.9.0.tgz#5715d6244e2aa65f48bba0bc972db0b0b11e95b5" integrity sha512-Dj6Wk3tWyTE+Fo1rW8v0Xhwk80um6yFYKbuAxc9c3EZxIHFDYwbi34Uk42u1CdnIiVorvt4RmlSDjIPyzGC2ew== -diff@^3.2.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" - integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== +diff@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.1.tgz#0c667cb467ebbb5cea7f14f135cc2dba7780a8ff" + integrity sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q== doctrine@0.7.2: version "0.7.2" @@ -1041,9 +1026,9 @@ emoji-regex@^7.0.1: integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== end-of-stream@^1.1.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" - integrity sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q== + version "1.4.3" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.3.tgz#9db9861620e47283cd49513be9c344f339ec5153" + integrity sha512-cbNhPFS6MlYlWTGncSiDYbdqKhwWFy7kNeb1YSOG6K65i/wPTkLVCJQj0hXA4j0m5Da+hBWnqopEnu1FFelisQ== dependencies: once "^1.4.0" @@ -1102,9 +1087,9 @@ esprima@^3.1.3: integrity sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM= esprima@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" - integrity sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw== + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== estraverse@^4.2.0: version "4.3.0" @@ -1117,9 +1102,9 @@ esutils@^1.1.6: integrity sha1-wBzKqa5LiXxtDD4hCuUvPHqEQ3U= esutils@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" - integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== exec-sh@^0.3.2: version "0.3.2" @@ -1341,19 +1326,7 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" -glob@^7.1.1: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^7.1.2, glob@^7.1.3: +glob@^7.1.1, glob@^7.1.2, glob@^7.1.3: version "7.1.4" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A== @@ -1381,9 +1354,9 @@ growly@^1.3.0: integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= handlebars@^4.1.2: - version "4.2.0" - resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.2.0.tgz#57ce8d2175b9bbb3d8b3cf3e4217b1aec8ddcb2e" - integrity sha512-Kb4xn5Qh1cxAKvQnzNWZ512DhABzyFNmsaJf3OAkWNa4NkaqWcNI8Tao8Tasi0/F4JD9oyG0YxuFyvyR57d+Gw== + version "4.3.1" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.3.1.tgz#6febc1890851f62a8932d495cc88d29390fa850d" + integrity sha512-c0HoNHzDiHpBt4Kqe99N8tdLPKAnGCQ73gYMPWtAYM4PwGnf7xl8PBUHJqh9ijlzt2uQKaSRxbXRt+rZ7M2/kA== dependencies: neo-async "^2.6.0" optimist "^0.6.1" @@ -1521,12 +1494,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.1: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -inherits@~2.0.3: +inherits@2, inherits@^2.0.1, inherits@~2.0.3: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -2336,12 +2304,13 @@ map-visit@^1.0.0: object-visit "^1.0.0" md5.js@^1.3.4: - version "1.3.4" - resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.4.tgz#e9bdbde94a20a5ac18b04340fc5764d5b09d901d" - integrity sha1-6b296UogpawYsENA/Fdk1bCdkB0= + version "1.3.5" + resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" + integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== dependencies: hash-base "^3.0.0" inherits "^2.0.1" + safe-buffer "^5.1.2" merge-stream@^2.0.0: version "2.0.0" @@ -2401,10 +2370,10 @@ minimist@~0.0.1: resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= -minipass@^2.2.1, minipass@^2.6.0, minipass@^2.6.4: - version "2.6.5" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.6.5.tgz#1c245f9f2897f70fd4a219066261ce6c29f80b18" - integrity sha512-ewSKOPFH9blOLXx0YSE+mbrNMBFPS+11a2b03QZ+P4LVrUHW/GAlqeYC7DBknDyMWkHzrzTpDhUvy7MUxqyrPA== +minipass@^2.2.1, minipass@^2.6.0, minipass@^2.8.6: + version "2.8.6" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.8.6.tgz#620d889ace26356391d010ecb9458749df9b6db5" + integrity sha512-lFG7d6g3+/UaFDCOtqPiKAC9zngWWsQZl1g5q6gaONqrjq61SX2xFqXMleQiFVyDpYwa018E9hmlAFY22PCb+A== dependencies: safe-buffer "^5.1.2" yallist "^3.0.0" @@ -2754,7 +2723,7 @@ path-key@^2.0.0, path-key@^2.0.1: resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= -path-parse@^1.0.5, path-parse@^1.0.6: +path-parse@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== @@ -3010,20 +2979,13 @@ resolve@1.1.7: resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= -resolve@1.x, resolve@^1.10.0: +resolve@1.x, resolve@^1.10.0, resolve@^1.3.2: version "1.12.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.12.0.tgz#3fc644a35c84a48554609ff26ec52b66fa577df6" integrity sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w== dependencies: path-parse "^1.0.6" -resolve@^1.3.2: - version "1.8.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26" - integrity sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA== - dependencies: - path-parse "^1.0.5" - ret@~0.1.10: version "0.1.15" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" @@ -3049,16 +3011,16 @@ rsvp@^4.8.4: resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" integrity sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA== -safe-buffer@^5.0.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -safe-buffer@^5.1.2: +safe-buffer@^5.0.1, safe-buffer@^5.1.2: version "5.2.0" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519" integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== +safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + safe-regex@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" @@ -3091,16 +3053,11 @@ sax@^1.2.4: resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== -"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5, semver@^5.5.0, semver@^5.6.0: +"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5, semver@^5.5.0, semver@^5.6.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -semver@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" - integrity sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA== - semver@^6.0.0, semver@^6.2.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" @@ -3390,9 +3347,9 @@ strip-json-comments@~2.0.1: integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= supports-color@^5.3.0: - version "5.4.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" - integrity sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w== + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== dependencies: has-flag "^3.0.0" @@ -3409,13 +3366,13 @@ symbol-tree@^3.2.2: integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== tar@^4: - version "4.4.11" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.11.tgz#7ac09801445a3cf74445ed27499136b5240ffb73" - integrity sha512-iI4zh3ktLJKaDNZKZc+fUONiQrSn9HkCFzamtb7k8FFmVilHVob7QsLX/VySAW8lAviMzMbFw4QtFb4errwgYA== + version "4.4.12" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.12.tgz#6a1275a870a782f92828e24d28fa6aa253193af7" + integrity sha512-4GwpJwdSjIHlUrWd/1yJrl63UqcqjJyVglgIwn4gcG+Lrp9TXpZ1ZRrGLIRBNqLTUvz6yoPJrX4B/MISxY/Ukg== dependencies: chownr "^1.1.1" fs-minipass "^1.2.5" - minipass "^2.6.4" + minipass "^2.8.6" minizlib "^1.2.1" mkdirp "^0.5.0" safe-buffer "^5.1.2" @@ -3494,11 +3451,6 @@ tr46@^1.0.1: dependencies: punycode "^2.1.0" -trim-right@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" - integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= - ts-jest@^24.1.0: version "24.1.0" resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-24.1.0.tgz#2eaa813271a2987b7e6c3fefbda196301c131734" @@ -3521,9 +3473,9 @@ tslib@1.9.0: integrity sha512-f/qGG2tUkrISBlQZEjEqoZ3B2+npJjIf04H1wuAv9iA8i04Icp+61KRXxFdha22670NJopsZCIjhC3SnjPRKrQ== tslib@^1.8.0, tslib@^1.8.1: - version "1.9.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" - integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== + version "1.10.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" + integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== tslint-eslint-rules@^5.4.0: version "5.4.0" @@ -3535,15 +3487,15 @@ tslint-eslint-rules@^5.4.0: tsutils "^3.0.0" tslint@^5.19.0: - version "5.19.0" - resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.19.0.tgz#a2cbd4a7699386da823f6b499b8394d6c47bb968" - integrity sha512-1LwwtBxfRJZnUvoS9c0uj8XQtAnyhWr9KlNvDIdB+oXyT+VpsOAaEhEgKi1HrZ8rq0ki/AAnbGSv4KM6/AfVZw== + version "5.20.0" + resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.20.0.tgz#fac93bfa79568a5a24e7be9cdde5e02b02d00ec1" + integrity sha512-2vqIvkMHbnx8acMogAERQ/IuINOq6DFqgF8/VDvhEkBqQh/x6SP0Y+OHnKth9/ZcHQSroOZwUQSN18v8KKF0/g== dependencies: "@babel/code-frame" "^7.0.0" builtin-modules "^1.1.1" chalk "^2.3.0" commander "^2.12.1" - diff "^3.2.0" + diff "^4.0.1" glob "^7.1.1" js-yaml "^3.13.1" minimatch "^3.0.4" @@ -3561,9 +3513,9 @@ tsutils@^2.29.0: tslib "^1.8.1" tsutils@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.2.0.tgz#bb2a7e2f34331f1dbd9fbe04ac0886524ae11e36" - integrity sha512-CvWEadl8VwlxOq6F3hfNbGrrRVSAjN2EPCEBgcbCUVDUxmwkV5254OGKsITNxDz8IGDQPAw7YJMtBHniHu2tbA== + version "3.17.1" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759" + integrity sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g== dependencies: tslib "^1.8.1" @@ -3587,9 +3539,9 @@ type-check@~0.3.2: prelude-ls "~1.1.2" typescript@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.3.tgz#01b70247a6d3c2467f70c45795ef5ea18ce191d5" - integrity sha512-+81MUSyX+BaSo+u2RbozuQk/UWx6hfG0a5gHu4ANEM4sU96XbuIyAB+rWBW1u70c6a5QuZfuYICn3s2UjuHUpA== + version "3.6.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.6.3.tgz#fea942fabb20f7e1ca7164ff626f1a9f3f70b4da" + integrity sha512-N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw== uglify-js@^3.1.4: version "3.6.0"