Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

conflux-address-js

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

conflux-address-js - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

4

lib/index.js

@@ -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 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc