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

@rei-network/blockchain

Package Overview
Dependencies
Maintainers
2
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rei-network/blockchain - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

12

dist/clique.d.ts
/// <reference types="bn.js" />
/// <reference types="node" />
import { Address, BN } from 'ethereumjs-util';
export declare type CliqueSignerState = [BN, Address[]];
export declare type CliqueLatestSignerStates = CliqueSignerState[];
export declare type CliqueVote = [BN, [Address, Address, Buffer]];
export declare type CliqueLatestVotes = CliqueVote[];
export declare type CliqueBlockSigner = [BN, Address];
export declare type CliqueLatestBlockSigners = CliqueBlockSigner[];
export type CliqueSignerState = [BN, Address[]];
export type CliqueLatestSignerStates = CliqueSignerState[];
export type CliqueVote = [BN, [Address, Address, Buffer]];
export type CliqueLatestVotes = CliqueVote[];
export type CliqueBlockSigner = [BN, Address];
export type CliqueLatestBlockSigners = CliqueBlockSigner[];
export declare const CLIQUE_NONCE_AUTH: Buffer;
export declare const CLIQUE_NONCE_DROP: Buffer;

@@ -7,3 +7,3 @@ /// <reference types="node" />

import { Database } from '@rei-network/database';
declare type OnBlock = (block: Block, reorg: boolean) => Promise<void> | void;
type OnBlock = (block: Block, reorg: boolean) => Promise<void> | void;
export interface PutBlockOptions {

@@ -10,0 +10,0 @@ receipts?: Receipt[];

@@ -20,2 +20,33 @@ "use strict";

/**
* Safe creation of a new Blockchain object awaiting the initialization function,
* encouraged method to use when creating a blockchain object.
*
* @param opts Constructor options, see {@link BlockchainOptions}
*/
static async create(opts) {
const blockchain = new Blockchain(opts);
await blockchain.initPromise.catch((e) => {
throw e;
});
return blockchain;
}
/**
* Creates a blockchain from a list of block objects,
* objects must be readable by {@link Block.fromBlockData}
*
* @param blockData List of block objects
* @param opts Constructor options, see {@link BlockchainOptions}
*/
static async fromBlocksData(blocksData, opts) {
const blockchain = await Blockchain.create(opts);
for (const blockData of blocksData) {
const block = structure_1.Block.fromBlockData(blockData, {
common: blockchain._common,
hardforkByBlockNumber: true
});
await blockchain.putBlock(block);
}
return blockchain;
}
/**
* Creates new Blockchain object

@@ -113,33 +144,2 @@ *

/**
* Safe creation of a new Blockchain object awaiting the initialization function,
* encouraged method to use when creating a blockchain object.
*
* @param opts Constructor options, see {@link BlockchainOptions}
*/
static async create(opts) {
const blockchain = new Blockchain(opts);
await blockchain.initPromise.catch((e) => {
throw e;
});
return blockchain;
}
/**
* Creates a blockchain from a list of block objects,
* objects must be readable by {@link Block.fromBlockData}
*
* @param blockData List of block objects
* @param opts Constructor options, see {@link BlockchainOptions}
*/
static async fromBlocksData(blocksData, opts) {
const blockchain = await Blockchain.create(opts);
for (const blockData of blocksData) {
const block = structure_1.Block.fromBlockData(blockData, {
common: blockchain._common,
hardforkByBlockNumber: true
});
await blockchain.putBlock(block);
}
return blockchain;
}
/**
* Returns an object with metadata about the Blockchain. It's defined for

@@ -146,0 +146,0 @@ * backwards compatibility.

{
"name": "@rei-network/blockchain",
"version": "1.1.1",
"version": "1.1.2",
"main": "dist/index.js",

@@ -17,5 +17,5 @@ "types": "dist/index.d.ts",

"dependencies": {
"@rei-network/common": "^1.1.1",
"@rei-network/database": "^1.1.1",
"@rei-network/structure": "^0.1.3",
"@rei-network/common": "^1.1.2",
"@rei-network/database": "^1.1.2",
"@rei-network/structure": "^0.1.4",
"debug": "^4.3.3",

@@ -22,0 +22,0 @@ "ethereumjs-util": "^7.1.4",

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