@transia/ripple-binary-codec 1.4.6-alpha.4 → 1.4.6-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37,7 +37,7 @@
37
37
  "LedgerHashes": 104,
38
38
  "Amendments": 102,
39
39
  "FeeSettings": 115,
40
- "ImportVlseq": 73,
40
+ "ImportVLSequence": 73,
41
41
  "Escrow": 117,
42
42
  "PayChannel": 120,
43
43
  "Check": 67,
@@ -37,7 +37,7 @@
37
37
  "LedgerHashes": 104,
38
38
  "Amendments": 102,
39
39
  "FeeSettings": 115,
40
- "ImportVlseq": 73,
40
+ "ImportVLSequence": 73,
41
41
  "Escrow": 117,
42
42
  "PayChannel": 120,
43
43
  "Check": 67,
@@ -13,7 +13,7 @@ const STANDARD_FORMAT_HEX_REGEX = /^0{24}[\x00-\x7F]{6}0{10}$/;
13
13
  */
14
14
  function isoToBytes(iso) {
15
15
  const bytes = buffer_1.Buffer.alloc(20);
16
- if (iso !== 'XRP') {
16
+ if (iso !== 'XAH') {
17
17
  const isoBytes = iso.split('').map((c) => c.charCodeAt(0));
18
18
  bytes.set(isoBytes, 12);
19
19
  }
@@ -27,7 +27,7 @@ function isIsoCode(iso) {
27
27
  }
28
28
  function isoCodeFromHex(code) {
29
29
  const iso = code.toString();
30
- if (iso === 'XRP') {
30
+ if (iso === 'XAH') {
31
31
  return null;
32
32
  }
33
33
  if (isIsoCode(iso)) {
@@ -78,7 +78,7 @@ class Currency extends hash_160_1.Hash160 {
78
78
  super(byteBuf !== null && byteBuf !== void 0 ? byteBuf : Currency.XRP.bytes);
79
79
  const hex = this.bytes.toString('hex');
80
80
  if (XRP_HEX_REGEX.test(hex)) {
81
- this._iso = 'XRP';
81
+ this._iso = 'XAH';
82
82
  }
83
83
  else if (STANDARD_FORMAT_HEX_REGEX.test(hex)) {
84
84
  this._iso = isoCodeFromHex(this.bytes.slice(12, 15));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transia/ripple-binary-codec",
3
- "version": "1.4.6-alpha.4",
3
+ "version": "1.4.6-alpha.6",
4
4
  "description": "XRP Ledger binary codec",
5
5
  "files": [
6
6
  "dist/*",
@@ -40,5 +40,5 @@
40
40
  "engines": {
41
41
  "node": ">= 10"
42
42
  },
43
- "gitHead": "e24cbccc2bcf3a64b09a19033718cae0d8c7b8a2"
43
+ "gitHead": "420d6b2c35ba8ecadf006161fa45b19d851476bf"
44
44
  }
@@ -369,7 +369,7 @@ function pathSetBinaryTests() {
369
369
  currency: 'BTC',
370
370
  issuer: 'r3AWbdp2jQLXLywJypdoNwVSvr81xs3uhn',
371
371
  },
372
- { currency: 'XRP' },
372
+ { currency: 'XAH' },
373
373
  {
374
374
  currency: 'USD',
375
375
  issuer: 'rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B',
@@ -2904,7 +2904,7 @@
2904
2904
  "type_id": 6,
2905
2905
  "is_native": true,
2906
2906
  "type": "Amount",
2907
- "error": "1000000000000 absolute XRP is bigger than max native value 100000000000.0",
2907
+ "error": "1000000000000 absolute XAH is bigger than max native value 100000000000.0",
2908
2908
  "is_negative": false
2909
2909
  },
2910
2910
  {
@@ -2912,7 +2912,7 @@
2912
2912
  "type_id": 6,
2913
2913
  "is_native": true,
2914
2914
  "type": "Amount",
2915
- "error": "10000000000000000000 absolute XRP is bigger than max native value 100000000000.0",
2915
+ "error": "10000000000000000000 absolute XAH is bigger than max native value 100000000000.0",
2916
2916
  "is_negative": true
2917
2917
  }
2918
2918
  ]
package/test/hash.test.js CHANGED
@@ -77,7 +77,7 @@ describe('Hash256', function () {
77
77
 
78
78
  describe('Currency', function () {
79
79
  test('Decoding allows dodgy XRP without throwing', function () {
80
- const currencyCode = '0000000000000000000000005852500000000000'
80
+ const currencyCode = '0000000000000000000000005841480000000000'
81
81
  expect(Currency.from(currencyCode).toJSON()).toBe(currencyCode)
82
82
  })
83
83
  test('Currency code with lowercase letters decodes to ISO code', () => {
@@ -113,7 +113,7 @@ describe('Currency', function () {
113
113
 
114
114
  test('can be constructed from a Buffer', function () {
115
115
  const xrp = new Currency(Buffer.alloc(20))
116
- expect(xrp.iso()).toBe('XRP')
116
+ expect(xrp.iso()).toBe('XAH')
117
117
  })
118
118
  test('Can handle non-standard currency codes', () => {
119
119
  const currency = '015841551A748AD2C1F76FF6ECB0CCCD00000000'
@@ -58,7 +58,7 @@ describe('encoding and decoding tx_json', function () {
58
58
  Sequence: 19,
59
59
  LimitAmount: {
60
60
  value: '200',
61
- currency: '0000000000000000000000005852500000000000',
61
+ currency: '0000000000000000000000005841480000000000',
62
62
  issuer: 'r9hEDb4xBGRfBCcX3E4FirDWQBAYtpxC8K',
63
63
  },
64
64
  Fee: '10',