conflux-address-js
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -124,3 +124,3 @@ 'use strict'; | ||
encodedAddress = [prefix, "type=".concat(addressType), payload].join(':'); | ||
encodedAddress = [prefix, "type.".concat(addressType), payload].join(':'); | ||
} | ||
@@ -154,3 +154,3 @@ | ||
if (shouldHaveType !== '' && "type=".concat(returnValue.type) !== shouldHaveType) { | ||
if (shouldHaveType !== '' && "type.".concat(returnValue.type) !== shouldHaveType) { | ||
throw new Error('Type of address doesn\'t match'); | ||
@@ -157,0 +157,0 @@ } |
{ | ||
"name": "conflux-address-js", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "The encoder and decoder for Conflux Network address", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
# conflux-address-js | ||
The simple encoder and decoder for Conflux address | ||
The simple encoder and decoder for Conflux address. | ||
@@ -8,3 +8,3 @@ Check [CIP-37](https://github.com/Conflux-Chain/CIPs/pull/53/) for the protocols. | ||
### Dncoding | ||
### Encoding | ||
@@ -20,3 +20,3 @@ ```javascript | ||
console.log(confluxAddr.encode(hexBuffer, netId, true)) // verbose mode to generate address with type | ||
// cfx:type=user:0086ujfsa1a11uuecwen3xytdmp8f03v140ypk3mxc | ||
// cfx:type.user:0086ujfsa1a11uuecwen3xytdmp8f03v140ypk3mxc | ||
``` | ||
@@ -36,3 +36,3 @@ | ||
console.log(confluxAddr.decode('cfx:type=user:0086ujfsa1a11uuecwen3xytdmp8f03v140ypk3mxc')) | ||
console.log(confluxAddr.decode('cfx:type.user:0086ujfsa1a11uuecwen3xytdmp8f03v140ypk3mxc')) | ||
/* | ||
@@ -39,0 +39,0 @@ { hexAddress: |
@@ -97,3 +97,3 @@ 'use strict' | ||
const [prefix, payload] = encodedAddress.split(':') | ||
encodedAddress = [prefix, `type=${addressType}`, payload].join(':') | ||
encodedAddress = [prefix, `type.${addressType}`, payload].join(':') | ||
} | ||
@@ -125,3 +125,3 @@ return encodedAddress | ||
if (shouldHaveType !== '' && `type=${returnValue.type}` !== shouldHaveType) { | ||
if (shouldHaveType !== '' && `type.${returnValue.type}` !== shouldHaveType) { | ||
throw new Error('Type of address doesn\'t match') | ||
@@ -128,0 +128,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19876