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

ton-core

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ton-core - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

34

dist/boc/Cell.d.ts

@@ -11,2 +11,8 @@ /// <reference types="node" />

export declare class Cell {
/**
* Deserialize cells from BOC
* @param src source buffer
* @returns array of cells
*/
static fromBoc(src: Buffer): Cell[];
readonly type: CellType;

@@ -34,10 +40,38 @@ readonly bits: BitString;

* Get cell hash
* @param level level
* @returns cell hash
*/
hash: (level?: number) => Buffer;
/**
* Get cell depth
* @param level level
* @returns cell depth
*/
depth: (level?: number) => number;
/**
* Get cell level
* @returns cell level
*/
level: () => number;
/**
* Checks cell to be euqal to another cell
* @param other other cell
* @returns true if cells are equal
*/
equals: (other: Cell) => boolean;
/**
* Serializes cell to BOC
* @param opts options
*/
toBoc(opts?: {
idx?: boolean | null | undefined;
crc32?: boolean | null | undefined;
}): Buffer;
/**
* Format cell to string
* @param indent indentation
* @returns string representation
*/
toString(indent?: string): string;
[inspectSymbol]: () => string;
}

@@ -14,2 +14,3 @@ "use strict";

const wonderCalculator_1 = require("./cell/wonderCalculator");
const serialization_1 = require("./cell/serialization");
/**

@@ -19,2 +20,10 @@ * Cell as described in TVM spec

class Cell {
/**
* Deserialize cells from BOC
* @param src source buffer
* @returns array of cells
*/
static fromBoc(src) {
return (0, serialization_1.deserializeBoc)(src);
}
constructor(opts) {

@@ -33,2 +42,3 @@ // Level and depth information

* Get cell hash
* @param level level
* @returns cell hash

@@ -39,8 +49,22 @@ */

};
/**
* Get cell depth
* @param level level
* @returns cell depth
*/
this.depth = (level = 3) => {
return this._depths[Math.min(this._depths.length - 1, level)];
};
/**
* Get cell level
* @returns cell level
*/
this.level = () => {
return this.mask.level;
};
/**
* Checks cell to be euqal to another cell
* @param other other cell
* @returns true if cells are equal
*/
this.equals = (other) => {

@@ -106,2 +130,16 @@ return this.hash().equals(other.hash());

}
/**
* Serializes cell to BOC
* @param opts options
*/
toBoc(opts) {
let idx = (opts && opts.idx !== null && opts.idx !== undefined) ? opts.idx : false;
let crc32 = (opts && opts.crc32 !== null && opts.crc32 !== undefined) ? opts.crc32 : true;
return (0, serialization_1.serializeBoc)(this, { idx, crc32 });
}
/**
* Format cell to string
* @param indent indentation
* @returns string representation
*/
toString(indent) {

@@ -108,0 +146,0 @@ let id = indent || '';

2

package.json
{
"name": "ton-core",
"version": "0.1.0",
"version": "0.2.0",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "repository": "https://github.com/ton-community/ton-core.git",

@@ -8,2 +8,3 @@ import inspectSymbol from 'symbol.inspect';

import { wonderCalculator } from './cell/wonderCalculator';
import { deserializeBoc, serializeBoc } from './cell/serialization';

@@ -15,2 +16,11 @@ /**

/**
* Deserialize cells from BOC
* @param src source buffer
* @returns array of cells
*/
static fromBoc(src: Buffer) {
return deserializeBoc(src);
}
// Public properties

@@ -105,2 +115,3 @@ readonly type: CellType;

* Get cell hash
* @param level level
* @returns cell hash

@@ -112,2 +123,7 @@ */

/**
* Get cell depth
* @param level level
* @returns cell depth
*/
depth = (level: number = 3): number => {

@@ -117,2 +133,6 @@ return this._depths[Math.min(this._depths.length - 1, level)];

/**
* Get cell level
* @returns cell level
*/
level = (): number => {

@@ -122,2 +142,7 @@ return this.mask.level;

/**
* Checks cell to be euqal to another cell
* @param other other cell
* @returns true if cells are equal
*/
equals = (other: Cell): boolean => {

@@ -127,2 +152,17 @@ return this.hash().equals(other.hash());

/**
* Serializes cell to BOC
* @param opts options
*/
toBoc(opts?: { idx?: boolean | null | undefined, crc32?: boolean | null | undefined }): Buffer {
let idx = (opts && opts.idx !== null && opts.idx !== undefined) ? opts.idx : false;
let crc32 = (opts && opts.crc32 !== null && opts.crc32 !== undefined) ? opts.crc32 : true;
return serializeBoc(this, { idx, crc32 });
}
/**
* Format cell to string
* @param indent indentation
* @returns string representation
*/
toString(indent?: string): string {

@@ -129,0 +169,0 @@ let id = indent || '';

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