New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@defichain/jellyfish-buffer

Package Overview
Dependencies
Maintainers
2
Versions
235
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@defichain/jellyfish-buffer - npm Package Compare versions

Comparing version 0.52.0 to 0.54.0

12

dist/composer.d.ts

@@ -53,2 +53,14 @@ import BigNumber from 'bignumber.js';

/**
* The length of the array is set with VarUInt in the first sequence of 1 - 9 bytes.
* Mainly created to handle array of primitive type as varUIntArray<T> always expect data to be object.
*
* @param arrayGetter to read array of ComposableBuffer Object from to buffer
* @param arraySetter to set array of ComposableBuffer Object from buffer
* @param writeBuffer to write single data into SmartBuffer
* @param readBuffer to read single data from SmartBuffer
*
* @see array if length is not given but known
*/
static varUIntArrayRaw<T>(arrayGetter: () => T[], arraySetter: (data: T[]) => void, writeBuffer: (data: T, buffer: SmartBuffer) => void, readBuffer: (buffer: SmartBuffer) => T): BufferComposer;
/**
* The length of the array must be known and given to the composer, use varUIntArray if length is set as VarUInt.

@@ -55,0 +67,0 @@ *

@@ -100,2 +100,30 @@ "use strict";

/**
* The length of the array is set with VarUInt in the first sequence of 1 - 9 bytes.
* Mainly created to handle array of primitive type as varUIntArray<T> always expect data to be object.
*
* @param arrayGetter to read array of ComposableBuffer Object from to buffer
* @param arraySetter to set array of ComposableBuffer Object from buffer
* @param writeBuffer to write single data into SmartBuffer
* @param readBuffer to read single data from SmartBuffer
*
* @see array if length is not given but known
*/
static varUIntArrayRaw(arrayGetter, arraySetter, writeBuffer, readBuffer) {
return {
fromBuffer: (buffer) => {
const length = varuint_1.readVarUInt(buffer);
const array = [];
for (let i = 0; i < length; i++) {
array.push(readBuffer(buffer));
}
arraySetter(array);
},
toBuffer: (buffer) => {
const array = arrayGetter();
varuint_1.writeVarUInt(array.length, buffer);
array.forEach(data => writeBuffer(data, buffer));
}
};
}
/**
* The length of the array must be known and given to the composer, use varUIntArray if length is set as VarUInt.

@@ -102,0 +130,0 @@ *

4

package.json
{
"private": false,
"name": "@defichain/jellyfish-buffer",
"version": "0.52.0",
"version": "0.54.0",
"description": "A collection of TypeScript + JavaScript tools and libraries for DeFi Blockchain developers to build decentralized finance for Bitcoin",

@@ -29,4 +29,4 @@ "keywords": [

"peerDependencies": {
"defichain": "0.52.0"
"defichain": "0.54.0"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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