Compare commits

..

4 Commits

Author SHA1 Message Date
Mayukha Vadari
78d9b11794 release: release new versions (#1859) 2021-12-02 14:59:58 -05:00
Mayukha Vadari
4e0a093677 chore: update HISTORY for rbc release (#1858) 2021-12-02 14:52:08 -05:00
Mayukha Vadari
fe845de884 fix: encoding issue with encoding non-traditional currency codes (#1857)
* add test

* fix decoding issue
2021-12-02 14:43:26 -05:00
dependabot[bot]
8461ef6804 build(deps-dev): bump typedoc from 0.22.8 to 0.22.10 (#1837)
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.22.8 to 0.22.10.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Changelog](https://github.com/TypeStrong/typedoc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.22.8...v0.22.10)

---
updated-dependencies:
- dependency-name: typedoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-02 09:45:51 -08:00
8 changed files with 45 additions and 37 deletions

40
package-lock.json generated
View File

@@ -15575,8 +15575,9 @@
} }
}, },
"node_modules/typedoc": { "node_modules/typedoc": {
"version": "0.22.8", "version": "0.22.10",
"integrity": "sha512-92S+YzyhospdXN5rnkYUTgirdTYqNWY7NP9vco+IqQQoiSXzVSUsawVro+tMyEEsWUS7EMaJ2YOjB9uE0CBi6A==", "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.22.10.tgz",
"integrity": "sha512-hQYZ4WtoMZ61wDC6w10kxA42+jclWngdmztNZsDvIz7BMJg7F2xnT+uYsUa7OluyKossdFj9E9Ye4QOZKTy8SA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"glob": "^7.2.0", "glob": "^7.2.0",
@@ -15592,7 +15593,7 @@
"node": ">= 12.10.0" "node": ">= 12.10.0"
}, },
"peerDependencies": { "peerDependencies": {
"typescript": "4.0.x || 4.1.x || 4.2.x || 4.3.x || 4.4.x" "typescript": "4.0.x || 4.1.x || 4.2.x || 4.3.x || 4.4.x || 4.5.x"
} }
}, },
"node_modules/typedoc/node_modules/glob": { "node_modules/typedoc/node_modules/glob": {
@@ -16607,7 +16608,7 @@
} }
}, },
"packages/ripple-address-codec": { "packages/ripple-address-codec": {
"version": "4.2.1", "version": "4.2.2",
"integrity": "sha512-9QhBNDiWjwj7l+WQ7H7klXF/VwxVj2Q0HRhd4vLCueTPoxUtaNQyfvUZFiXJrqxg0heM3/iWxupkq4TwrXgSuQ==", "integrity": "sha512-9QhBNDiWjwj7l+WQ7H7klXF/VwxVj2Q0HRhd4vLCueTPoxUtaNQyfvUZFiXJrqxg0heM3/iWxupkq4TwrXgSuQ==",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
@@ -16619,7 +16620,7 @@
} }
}, },
"packages/ripple-binary-codec": { "packages/ripple-binary-codec": {
"version": "1.2.1", "version": "1.2.2",
"integrity": "sha512-XMRCbFXyG+dGp3x7tMs9IwA+FVWPPaGjdHYW2+g4Q/WQJqFp5MRED+jjOBOUafmrW4TUsOn1PEEdbB4ozWbDBw==", "integrity": "sha512-XMRCbFXyG+dGp3x7tMs9IwA+FVWPPaGjdHYW2+g4Q/WQJqFp5MRED+jjOBOUafmrW4TUsOn1PEEdbB4ozWbDBw==",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
@@ -16628,7 +16629,7 @@
"buffer": "5.6.0", "buffer": "5.6.0",
"create-hash": "^1.2.0", "create-hash": "^1.2.0",
"decimal.js": "^10.2.0", "decimal.js": "^10.2.0",
"ripple-address-codec": "^4.2.1" "ripple-address-codec": "^4.2.2"
}, },
"engines": { "engines": {
"node": ">=10.22.0" "node": ">=10.22.0"
@@ -16643,7 +16644,7 @@
} }
}, },
"packages/ripple-keypairs": { "packages/ripple-keypairs": {
"version": "1.1.1", "version": "1.1.2",
"integrity": "sha512-Zlmbtn2YUpW4uKlLm2/tpkY5RC/EXQlkJwIIKp0AoF9D23pJ43/EuipNW2F6qURdbkUezDwB0bMV7uRXip3x2w==", "integrity": "sha512-Zlmbtn2YUpW4uKlLm2/tpkY5RC/EXQlkJwIIKp0AoF9D23pJ43/EuipNW2F6qURdbkUezDwB0bMV7uRXip3x2w==",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
@@ -16651,14 +16652,14 @@
"brorand": "^1.0.5", "brorand": "^1.0.5",
"elliptic": "^6.5.4", "elliptic": "^6.5.4",
"hash.js": "^1.0.3", "hash.js": "^1.0.3",
"ripple-address-codec": "^4.2.1" "ripple-address-codec": "^4.2.2"
}, },
"engines": { "engines": {
"node": ">= 10" "node": ">= 10"
} }
}, },
"packages/xrpl": { "packages/xrpl": {
"version": "2.0.3", "version": "2.0.4",
"integrity": "sha512-NmrSYpXym7NzGABeXU1H8g4ZtCxRhr/3wu0lguxzcIYpcKPgWLYimg+s9NLLNbPWTZdxXu9SeSWu5zh4gyqAeA==", "integrity": "sha512-NmrSYpXym7NzGABeXU1H8g4ZtCxRhr/3wu0lguxzcIYpcKPgWLYimg+s9NLLNbPWTZdxXu9SeSWu5zh4gyqAeA==",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
@@ -16667,9 +16668,9 @@
"bip39": "^3.0.4", "bip39": "^3.0.4",
"https-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.0",
"lodash": "^4.17.4", "lodash": "^4.17.4",
"ripple-address-codec": "^4.2.1", "ripple-address-codec": "^4.2.2",
"ripple-binary-codec": "^1.2.1", "ripple-binary-codec": "^1.2.2",
"ripple-keypairs": "^1.1.1", "ripple-keypairs": "^1.1.2",
"ws": "^8.2.2" "ws": "^8.2.2"
}, },
"devDependencies": { "devDependencies": {
@@ -27095,7 +27096,7 @@
"buffer": "5.6.0", "buffer": "5.6.0",
"create-hash": "^1.2.0", "create-hash": "^1.2.0",
"decimal.js": "^10.2.0", "decimal.js": "^10.2.0",
"ripple-address-codec": "^4.2.1" "ripple-address-codec": "^4.2.2"
}, },
"dependencies": { "dependencies": {
"buffer": { "buffer": {
@@ -27115,7 +27116,7 @@
"brorand": "^1.0.5", "brorand": "^1.0.5",
"elliptic": "^6.5.4", "elliptic": "^6.5.4",
"hash.js": "^1.0.3", "hash.js": "^1.0.3",
"ripple-address-codec": "^4.2.1" "ripple-address-codec": "^4.2.2"
} }
}, },
"rsvp": { "rsvp": {
@@ -28569,8 +28570,9 @@
} }
}, },
"typedoc": { "typedoc": {
"version": "0.22.8", "version": "0.22.10",
"integrity": "sha512-92S+YzyhospdXN5rnkYUTgirdTYqNWY7NP9vco+IqQQoiSXzVSUsawVro+tMyEEsWUS7EMaJ2YOjB9uE0CBi6A==", "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.22.10.tgz",
"integrity": "sha512-hQYZ4WtoMZ61wDC6w10kxA42+jclWngdmztNZsDvIz7BMJg7F2xnT+uYsUa7OluyKossdFj9E9Ye4QOZKTy8SA==",
"dev": true, "dev": true,
"requires": { "requires": {
"glob": "^7.2.0", "glob": "^7.2.0",
@@ -29252,9 +29254,9 @@
"bip39": "^3.0.4", "bip39": "^3.0.4",
"https-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.0",
"lodash": "^4.17.4", "lodash": "^4.17.4",
"ripple-address-codec": "^4.2.1", "ripple-address-codec": "^4.2.2",
"ripple-binary-codec": "^1.2.1", "ripple-binary-codec": "^1.2.2",
"ripple-keypairs": "^1.1.1", "ripple-keypairs": "^1.1.2",
"ws": "^8.2.2", "ws": "^8.2.2",
"xrpl-local": "file:src" "xrpl-local": "file:src"
}, },

View File

@@ -1,6 +1,6 @@
{ {
"name": "ripple-address-codec", "name": "ripple-address-codec",
"version": "4.2.1", "version": "4.2.2",
"description": "encodes/decodes base58 encoded XRP Ledger identifiers", "description": "encodes/decodes base58 encoded XRP Ledger identifiers",
"files": [ "files": [
"dist/*", "dist/*",
@@ -28,6 +28,5 @@
"prettier": "@xrplf/prettier-config", "prettier": "@xrplf/prettier-config",
"engines": { "engines": {
"node": ">= 10" "node": ">= 10"
}, }
"gitHead": "7c6230b18ec2ed031c7e379ffb94e34b940b6542"
} }

View File

@@ -1,5 +1,8 @@
# ripple-binary-codec Release History # ripple-binary-codec Release History
## 1.2.2 (2021-12-2)
- Fix issue where unsupported currency codes weren't being correctly processed
## 1.2.1 (2021-12-1) ## 1.2.1 (2021-12-1)
- Fix issue where npm < 7 could not install the library - Fix issue where npm < 7 could not install the library

View File

@@ -1,6 +1,6 @@
{ {
"name": "ripple-binary-codec", "name": "ripple-binary-codec",
"version": "1.2.1", "version": "1.2.2",
"description": "XRP Ledger binary codec", "description": "XRP Ledger binary codec",
"files": [ "files": [
"dist/*", "dist/*",
@@ -17,7 +17,7 @@
"buffer": "5.6.0", "buffer": "5.6.0",
"create-hash": "^1.2.0", "create-hash": "^1.2.0",
"decimal.js": "^10.2.0", "decimal.js": "^10.2.0",
"ripple-address-codec": "^4.2.1" "ripple-address-codec": "^4.2.2"
}, },
"scripts": { "scripts": {
"build": "run-script-os", "build": "run-script-os",
@@ -41,6 +41,5 @@
"prettier": "@xrplf/prettier-config", "prettier": "@xrplf/prettier-config",
"engines": { "engines": {
"node": ">=10.22.0" "node": ">=10.22.0"
}, }
"gitHead": "7c6230b18ec2ed031c7e379ffb94e34b940b6542"
} }

View File

@@ -89,7 +89,7 @@ class Currency extends Hash160 {
if (this.bytes[0] !== 0) { if (this.bytes[0] !== 0) {
this._iso = null this._iso = null
} else if (code.toString('hex') === '000000') { } else if (/^0*$/.test(this.bytes.toString('hex'))) {
this._iso = 'XRP' this._iso = 'XRP'
} else { } else {
this._iso = isoCodeFromHex(code) this._iso = isoCodeFromHex(code)

View File

@@ -69,6 +69,7 @@ describe('Currency', function () {
expect(Currency.from('X8P').toJSON()).toBe('X8P') expect(Currency.from('X8P').toJSON()).toBe('X8P')
expect(Currency.from('USD').toJSON()).toBe('USD') expect(Currency.from('USD').toJSON()).toBe('USD')
}) })
test('can be constructed from a Buffer', function () { test('can be constructed from a Buffer', function () {
const xrp = new Currency(Buffer.alloc(20)) const xrp = new Currency(Buffer.alloc(20))
expect(xrp.iso()).toBe('XRP') expect(xrp.iso()).toBe('XRP')
@@ -77,6 +78,12 @@ describe('Currency', function () {
const currency = '015841551A748AD2C1F76FF6ECB0CCCD00000000' const currency = '015841551A748AD2C1F76FF6ECB0CCCD00000000'
expect(Currency.from(currency).toJSON()).toBe(currency) expect(Currency.from(currency).toJSON()).toBe(currency)
}) })
test('Can handle other non-standard currency codes', () => {
const currency = '0000000000414C6F676F30330000000000000000'
expect(Currency.from(currency).toJSON()).toBe(currency)
})
test('throws on invalid reprs', function () { test('throws on invalid reprs', function () {
expect(() => Currency.from(Buffer.alloc(19))).toThrow() expect(() => Currency.from(Buffer.alloc(19))).toThrow()
expect(() => Currency.from(1)).toThrow() expect(() => Currency.from(1)).toThrow()

View File

@@ -1,6 +1,6 @@
{ {
"name": "ripple-keypairs", "name": "ripple-keypairs",
"version": "1.1.1", "version": "1.1.2",
"description": "Cryptographic key pairs for the XRP Ledger", "description": "Cryptographic key pairs for the XRP Ledger",
"scripts": { "scripts": {
"build": "tsc -b", "build": "tsc -b",
@@ -21,7 +21,7 @@
"brorand": "^1.0.5", "brorand": "^1.0.5",
"elliptic": "^6.5.4", "elliptic": "^6.5.4",
"hash.js": "^1.0.3", "hash.js": "^1.0.3",
"ripple-address-codec": "^4.2.1" "ripple-address-codec": "^4.2.2"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@@ -31,6 +31,5 @@
"prettier": "@xrplf/prettier-config", "prettier": "@xrplf/prettier-config",
"engines": { "engines": {
"node": ">= 10" "node": ">= 10"
}, }
"gitHead": "7c6230b18ec2ed031c7e379ffb94e34b940b6542"
} }

View File

@@ -1,6 +1,6 @@
{ {
"name": "xrpl", "name": "xrpl",
"version": "2.0.3", "version": "2.0.4",
"license": "ISC", "license": "ISC",
"description": "A TypeScript/JavaScript API for interacting with the XRP Ledger in Node.js and the browser", "description": "A TypeScript/JavaScript API for interacting with the XRP Ledger in Node.js and the browser",
"files": [ "files": [
@@ -24,9 +24,9 @@
"bip39": "^3.0.4", "bip39": "^3.0.4",
"https-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.0",
"lodash": "^4.17.4", "lodash": "^4.17.4",
"ripple-address-codec": "^4.2.1", "ripple-address-codec": "^4.2.2",
"ripple-binary-codec": "^1.2.1", "ripple-binary-codec": "^1.2.2",
"ripple-keypairs": "^1.1.1", "ripple-keypairs": "^1.1.2",
"ws": "^8.2.2" "ws": "^8.2.2"
}, },
"devDependencies": { "devDependencies": {
@@ -65,6 +65,5 @@
"readmeFilename": "README.md", "readmeFilename": "README.md",
"engines": { "engines": {
"node": ">=10.13.0" "node": ">=10.13.0"
}, }
"gitHead": "7c6230b18ec2ed031c7e379ffb94e34b940b6542"
} }