From 2698742edc51e0020a835055c04aa98a8e3e15be Mon Sep 17 00:00:00 2001 From: Blasco <37955180+blascokoa@users.noreply.github.com> Date: Mon, 13 Mar 2023 18:18:11 +0100 Subject: [PATCH 1/8] Add ACE --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8d367ed0..4e09c3d4 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ console.log(addr); // 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa This library currently supports the following cryptocurrencies and address formats (ordered alphabetically): - ABBC (base58 + ripemd160-checksum) +- ACE (checksummed-hex) - ADA (base58, no check + crc32-checksum and bech32) - AE (base58check) - AIB (base58check P2PKH and P2SH) From 42f043f723e95b4772431488a80a36872ec031e7 Mon Sep 17 00:00:00 2001 From: Blasco <37955180+blascokoa@users.noreply.github.com> Date: Mon, 13 Mar 2023 18:22:56 +0100 Subject: [PATCH 2/8] Add ACE Add ACE coin from Endurance Chain --- src/__tests__/index.test.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/__tests__/index.test.ts b/src/__tests__/index.test.ts index 99cb1dc6..d32d2fc3 100644 --- a/src/__tests__/index.test.ts +++ b/src/__tests__/index.test.ts @@ -1288,7 +1288,14 @@ const vectors: Array = [ passingVectors: [ { text: '0x67316300f17f063085Ca8bCa4bd3f7a5a3C66275', hex: '67316300f17f063085ca8bca4bd3f7a5a3c66275' }, ], - } + }, + { + name: 'ACE', + coinType: convertEVMChainIdToCoinType(648), + passingVectors: [ + { text: '0x314159265dD8dbb310642f98f50C066173C1259b', hex: '314159265dd8dbb310642f98f50c066173c1259b' }, + ], + }, ]; var lastCointype = -1; From ebbbbccafb6ae546a1074b5ef1176422d21bc1db Mon Sep 17 00:00:00 2001 From: Blasco <37955180+blascokoa@users.noreply.github.com> Date: Mon, 13 Mar 2023 18:24:24 +0100 Subject: [PATCH 3/8] Add ACE --- src/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index cd566be8..054c5e01 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1613,7 +1613,8 @@ export const formats: IFormat[] = [ evmChain('NRG', 39797), evmChain('ARB1', 42161), evmChain('CELO', 42220), - evmChain('AVAXC', 43114) + evmChain('AVAXC', 43114), + evmChain('ACE', 648) ]; export const formatsByName: { [key: string]: IFormat } = Object.assign({}, ...formats.map(x => ({ [x.name]: x }))); @@ -1640,4 +1641,4 @@ const handler = { }, }; -export const formatsByCoinType = new Proxy(coinTypeFormats, handler); \ No newline at end of file +export const formatsByCoinType = new Proxy(coinTypeFormats, handler); From 4492ee11f97e340e6dab5d8e29dc9ae22bf17b11 Mon Sep 17 00:00:00 2001 From: Blasco Date: Mon, 13 Mar 2023 18:42:00 +0100 Subject: [PATCH 4/8] Refactor: change ordering --- src/__tests__/index.test.ts | 16 ++++++++-------- src/index.ts | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/__tests__/index.test.ts b/src/__tests__/index.test.ts index d32d2fc3..c8114003 100644 --- a/src/__tests__/index.test.ts +++ b/src/__tests__/index.test.ts @@ -1254,6 +1254,13 @@ const vectors: Array = [ { text: '0x314159265dD8dbb310642f98f50C066173C1259b', hex: '314159265dd8dbb310642f98f50c066173c1259b' }, ], }, + { + name: 'ACE', + coinType: convertEVMChainIdToCoinType(648), + passingVectors: [ + { text: '0x314159265dD8dbb310642f98f50C066173C1259b', hex: '314159265dd8dbb310642f98f50c066173c1259b' }, + ], + }, { name: 'CLO', coinType: convertEVMChainIdToCoinType(820), @@ -1288,14 +1295,7 @@ const vectors: Array = [ passingVectors: [ { text: '0x67316300f17f063085Ca8bCa4bd3f7a5a3C66275', hex: '67316300f17f063085ca8bca4bd3f7a5a3c66275' }, ], - }, - { - name: 'ACE', - coinType: convertEVMChainIdToCoinType(648), - passingVectors: [ - { text: '0x314159265dD8dbb310642f98f50C066173C1259b', hex: '314159265dd8dbb310642f98f50c066173c1259b' }, - ], - }, + } ]; var lastCointype = -1; diff --git a/src/index.ts b/src/index.ts index 054c5e01..1184bb58 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1609,12 +1609,12 @@ export const formats: IFormat[] = [ evmChain('EWT', 246), evmChain('FTM', 250), evmChain('THETA', 361), + evmChain('ACE', 648), evmChain('CLO', 820), evmChain('NRG', 39797), evmChain('ARB1', 42161), evmChain('CELO', 42220), - evmChain('AVAXC', 43114), - evmChain('ACE', 648) + evmChain('AVAXC', 43114) ]; export const formatsByName: { [key: string]: IFormat } = Object.assign({}, ...formats.map(x => ({ [x.name]: x }))); From 2042174598f2d572463d661e9113ab929948c68b Mon Sep 17 00:00:00 2001 From: Blasco Date: Fri, 17 Mar 2023 11:27:40 +0100 Subject: [PATCH 5/8] publish --- .npmrc | 1 + package.json | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 .npmrc diff --git a/.npmrc b/.npmrc new file mode 100644 index 00000000..421b35c6 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +@ace_domains:registry=https://registry.npmjs.org/ \ No newline at end of file diff --git a/package.json b/package.json index f80ba5c3..6fcf19c3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "@ensdomains/address-encoder", - "version": "0.2.18", + "name": "@ace_domains/address-encoder", + "version": "0.1.0", "description": "Encodes and decodes address formats for various cryptocurrencies", "source": "src/index.ts", "main": "lib/index.js", @@ -53,5 +53,8 @@ "nano-base32": "^1.0.1", "ripemd160": "^2.0.2", "sha3": "^2.1.3" + }, + "publishConfig": { + "@ace_domains:registry": "https://registry.npmjs.org" } } From 67fedc5dbf97f43dcfee305c7dcb5903fc832a40 Mon Sep 17 00:00:00 2001 From: Blasco <37955180+blascokoa@users.noreply.github.com> Date: Tue, 21 Mar 2023 10:30:33 +0100 Subject: [PATCH 6/8] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6fcf19c3..b22251ab 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@ace_domains/address-encoder", + "name": "@ensdomains/address-encoder", "version": "0.1.0", "description": "Encodes and decodes address formats for various cryptocurrencies", "source": "src/index.ts", From 90ce94b64a3620407ce4ed2e9b5f1ce869198c31 Mon Sep 17 00:00:00 2001 From: Blasco <37955180+blascokoa@users.noreply.github.com> Date: Tue, 21 Mar 2023 10:38:10 +0100 Subject: [PATCH 7/8] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b22251ab..c848638d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ensdomains/address-encoder", - "version": "0.1.0", + "version": "0.2.18", "description": "Encodes and decodes address formats for various cryptocurrencies", "source": "src/index.ts", "main": "lib/index.js", From 4feea6792cd9c4fb5c7848498c2596a269dd10bb Mon Sep 17 00:00:00 2001 From: Blasco <37955180+blascokoa@users.noreply.github.com> Date: Tue, 21 Mar 2023 10:38:31 +0100 Subject: [PATCH 8/8] Update package.json --- package.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/package.json b/package.json index c848638d..f80ba5c3 100644 --- a/package.json +++ b/package.json @@ -53,8 +53,5 @@ "nano-base32": "^1.0.1", "ripemd160": "^2.0.2", "sha3": "^2.1.3" - }, - "publishConfig": { - "@ace_domains:registry": "https://registry.npmjs.org" } }