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

cc-assetid-encoder

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cc-assetid-encoder - npm Package Compare versions

Comparing version 0.2.2 to 0.3.0

8

assetIdEncoder.js

@@ -28,6 +28,6 @@ var cs = require('coinstring')

module.exports = function (bitcoinTransaction) {
if (!bitcoinTransaction.cc_metadata) throw new Error('Missing Colored Coin Metadata')
if (bitcoinTransaction.cc_metadata[0].type !== 'issuance') throw new Error('Not An issuance transaction')
if (typeof bitcoinTransaction.cc_metadata[0].lockStatus === 'undefined') throw new Error('Missing Lock Status data')
var lockStatus = bitcoinTransaction.cc_metadata.lockStatus
if (!bitcoinTransaction.cc_data) throw new Error('Missing Colored Coin Metadata')
if (bitcoinTransaction.cc_data[0].type !== 'issuance') throw new Error('Not An issuance transaction')
if (typeof bitcoinTransaction.cc_data[0].lockStatus === 'undefined') throw new Error('Missing Lock Status data')
var lockStatus = bitcoinTransaction.cc_data.lockStatus
var firstInput = bitcoinTransaction.vin[0]

@@ -34,0 +34,0 @@ if (lockStatus) return createId(firstInput.txid + '-' + firstInput.vout, LOCKEPADDING)

{
"name": "cc-assetid-encoder",
"version": "0.2.2",
"version": "0.3.0",
"description": "Creates an Asset Id for Issuance transaction",

@@ -5,0 +5,0 @@ "main": "assetIdEncoder.js",

@@ -20,3 +20,3 @@ # AssetID-Encoder

{
'cc_metadata': [{
'cc_data': [{
'type': 'issuance',

@@ -49,3 +49,3 @@ 'lockStatus': false,

var bitcoinTransaction = {
'cc_metadata': [{
'cc_data': [{
'type': 'issuance',

@@ -52,0 +52,0 @@ 'lockStatus': false,

@@ -8,3 +8,3 @@ var assetId = require(__dirname + '/../assetIdEncoder')

'txid': 'bc1083ff98873050d2fa9d38823057f0125161ecad43ab2e2dcd1dd3c2668fb7',
'cc_metadata': [{
'cc_data': [{
'protocol': 17219,

@@ -81,3 +81,3 @@ 'version': 1,

it('should return Locked asset ID', function (done) {
bitcoinTransaction.cc_metadata.lockStatus = true
bitcoinTransaction.cc_data.lockStatus = true
assetId2 = assetId(bitcoinTransaction)

@@ -91,3 +91,3 @@ assert.equal(assetId2[0], 'L', 'Should be Locked')

bitcoinTransaction = {
cc_metadata:
cc_data:
[{

@@ -112,3 +112,3 @@ type: 'issuance',

bitcoinTransaction = {
cc_metadata:
cc_data:
[{

@@ -134,3 +134,3 @@ type: 'issuance',

bitcoinTransaction = {
cc_metadata:
cc_data:
[{

@@ -154,3 +154,3 @@ type: 'issuance',

bitcoinTransaction = {
cc_metadata:
cc_data:
[{

@@ -174,3 +174,3 @@ type: 'issuance',

bitcoinTransaction = {
cc_metadata:
cc_data:
[{

@@ -177,0 +177,0 @@ type: 'issuance',

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