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

@zilliqa-js/core

Package Overview
Dependencies
Maintainers
1
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zilliqa-js/core - npm Package Compare versions

Comparing version 0.4.1 to 0.5.0

31

dist/index.esm.js

@@ -8,2 +8,30 @@ import fetch from 'cross-fetch';

}());
var TxBlockType;
(function (TxBlockType) {
TxBlockType[TxBlockType["MICRO"] = 0] = "MICRO";
TxBlockType[TxBlockType["FINAL"] = 1] = "FINAL";
})(TxBlockType || (TxBlockType = {}));
var TransactionError;
(function (TransactionError) {
TransactionError[TransactionError["CHECKER_FAILED"] = 0] = "CHECKER_FAILED";
TransactionError[TransactionError["RUNNER_FAILED"] = 1] = "RUNNER_FAILED";
TransactionError[TransactionError["BALANCE_TRANSFER_FAILED"] = 2] = "BALANCE_TRANSFER_FAILED";
TransactionError[TransactionError["EXECUTE_CMD_FAILED"] = 3] = "EXECUTE_CMD_FAILED";
TransactionError[TransactionError["EXECUTE_CMD_TIMEOUT"] = 4] = "EXECUTE_CMD_TIMEOUT";
TransactionError[TransactionError["NO_GAS_REMAINING_FOUND"] = 5] = "NO_GAS_REMAINING_FOUND";
TransactionError[TransactionError["NO_ACCEPTED_FOUND"] = 6] = "NO_ACCEPTED_FOUND";
TransactionError[TransactionError["CALL_CONTRACT_FAILED"] = 7] = "CALL_CONTRACT_FAILED";
TransactionError[TransactionError["CREATE_CONTRACT_FAILED"] = 8] = "CREATE_CONTRACT_FAILED";
TransactionError[TransactionError["JSON_OUTPUT_CORRUPTED"] = 9] = "JSON_OUTPUT_CORRUPTED";
TransactionError[TransactionError["CONTRACT_NOT_EXIST"] = 10] = "CONTRACT_NOT_EXIST";
TransactionError[TransactionError["STATE_CORRUPTED"] = 11] = "STATE_CORRUPTED";
TransactionError[TransactionError["LOG_ENTRY_INSTALL_FAILED"] = 12] = "LOG_ENTRY_INSTALL_FAILED";
TransactionError[TransactionError["MESSAGE_CORRUPTED"] = 13] = "MESSAGE_CORRUPTED";
TransactionError[TransactionError["RECEIPT_IS_NULL"] = 14] = "RECEIPT_IS_NULL";
TransactionError[TransactionError["MAX_DEPTH_REACHED"] = 15] = "MAX_DEPTH_REACHED";
TransactionError[TransactionError["CHAIN_CALL_DIFF_SHARD"] = 16] = "CHAIN_CALL_DIFF_SHARD";
TransactionError[TransactionError["PREPARATION_FAILED"] = 17] = "PREPARATION_FAILED";
TransactionError[TransactionError["NO_OUTPUT"] = 18] = "NO_OUTPUT";
TransactionError[TransactionError["OUTPUT_ILLEGAL"] = 19] = "OUTPUT_ILLEGAL";
})(TransactionError || (TransactionError = {}));

@@ -194,2 +222,3 @@ /*! *****************************************************************************

// Contract-related methods
RPCMethod["GetSmartContracts"] = "GetSmartContracts";
RPCMethod["GetSmartContractCode"] = "GetSmartContractCode";

@@ -432,3 +461,3 @@ RPCMethod["GetSmartContractInit"] = "GetSmartContractInit";

export { Signer, sign, RPCMethod, RPCErrorCode, performRPC, isValidResponse, composeMiddleware, HTTPProvider, GET_TX_ATTEMPTS };
export { Signer, TransactionError, sign, RPCMethod, RPCErrorCode, performRPC, isValidResponse, composeMiddleware, HTTPProvider, GET_TX_ATTEMPTS };
//# sourceMappingURL=index.esm.js.map

@@ -14,2 +14,29 @@ (function (global, factory) {

}());
var TxBlockType;
(function (TxBlockType) {
TxBlockType[TxBlockType["MICRO"] = 0] = "MICRO";
TxBlockType[TxBlockType["FINAL"] = 1] = "FINAL";
})(TxBlockType || (TxBlockType = {}));
(function (TransactionError) {
TransactionError[TransactionError["CHECKER_FAILED"] = 0] = "CHECKER_FAILED";
TransactionError[TransactionError["RUNNER_FAILED"] = 1] = "RUNNER_FAILED";
TransactionError[TransactionError["BALANCE_TRANSFER_FAILED"] = 2] = "BALANCE_TRANSFER_FAILED";
TransactionError[TransactionError["EXECUTE_CMD_FAILED"] = 3] = "EXECUTE_CMD_FAILED";
TransactionError[TransactionError["EXECUTE_CMD_TIMEOUT"] = 4] = "EXECUTE_CMD_TIMEOUT";
TransactionError[TransactionError["NO_GAS_REMAINING_FOUND"] = 5] = "NO_GAS_REMAINING_FOUND";
TransactionError[TransactionError["NO_ACCEPTED_FOUND"] = 6] = "NO_ACCEPTED_FOUND";
TransactionError[TransactionError["CALL_CONTRACT_FAILED"] = 7] = "CALL_CONTRACT_FAILED";
TransactionError[TransactionError["CREATE_CONTRACT_FAILED"] = 8] = "CREATE_CONTRACT_FAILED";
TransactionError[TransactionError["JSON_OUTPUT_CORRUPTED"] = 9] = "JSON_OUTPUT_CORRUPTED";
TransactionError[TransactionError["CONTRACT_NOT_EXIST"] = 10] = "CONTRACT_NOT_EXIST";
TransactionError[TransactionError["STATE_CORRUPTED"] = 11] = "STATE_CORRUPTED";
TransactionError[TransactionError["LOG_ENTRY_INSTALL_FAILED"] = 12] = "LOG_ENTRY_INSTALL_FAILED";
TransactionError[TransactionError["MESSAGE_CORRUPTED"] = 13] = "MESSAGE_CORRUPTED";
TransactionError[TransactionError["RECEIPT_IS_NULL"] = 14] = "RECEIPT_IS_NULL";
TransactionError[TransactionError["MAX_DEPTH_REACHED"] = 15] = "MAX_DEPTH_REACHED";
TransactionError[TransactionError["CHAIN_CALL_DIFF_SHARD"] = 16] = "CHAIN_CALL_DIFF_SHARD";
TransactionError[TransactionError["PREPARATION_FAILED"] = 17] = "PREPARATION_FAILED";
TransactionError[TransactionError["NO_OUTPUT"] = 18] = "NO_OUTPUT";
TransactionError[TransactionError["OUTPUT_ILLEGAL"] = 19] = "OUTPUT_ILLEGAL";
})(exports.TransactionError || (exports.TransactionError = {}));

@@ -196,2 +223,3 @@ /*! *****************************************************************************

// Contract-related methods
RPCMethod["GetSmartContracts"] = "GetSmartContracts";
RPCMethod["GetSmartContractCode"] = "GetSmartContractCode";

@@ -198,0 +226,0 @@ RPCMethod["GetSmartContractInit"] = "GetSmartContractInit";

@@ -32,2 +32,3 @@ import { WithRequest } from './util';

GetMinimumGasPrice = "GetMinimumGasPrice",
GetSmartContracts = "GetSmartContracts",
GetSmartContractCode = "GetSmartContractCode",

@@ -34,0 +35,0 @@ GetSmartContractInit = "GetSmartContractInit",

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

// Contract-related methods
RPCMethod["GetSmartContracts"] = "GetSmartContracts";
RPCMethod["GetSmartContractCode"] = "GetSmartContractCode";

@@ -43,0 +44,0 @@ RPCMethod["GetSmartContractInit"] = "GetSmartContractInit";

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

}
export interface BlockchainInfo {
NumPeers: number;
NumTxBlocks: string;
NumDSBlocks: string;
NumTransactions: string;
TransactionRate: number;
TxBlockRate: number;
DSBlockRate: number;
CurrentMiniEpoch: string;
CurrentDSEpoch: string;
NumTxnsDSEpoch: string;
NumTxnsTxEpoch: string;
ShardingStructure: ShardingStructure;
}
export interface ShardingStructure {
NumPeers: number[];
}
export interface TransactionObj {
ID: string;
version: string;
nonce: number;
toAddr: string;
amount: string;
gasPrice: string;
gasLimit: string;
signature: string;
receipt: TransactionReceiptObj;
}
export interface DsBlockHeader {
BlockNum: string;
Difficulty: number;
DifficultyDS: number;
GasPrice: number;
LeaderPubKey: string;
PoWWinners: string[];
PrevHash: string;
Timestamp: string;
}
export interface DsBlockObj {
header: DsBlockHeader;
signature: string;
}
interface BlockShort {
BlockNum: number;
Hash: string;
}
export interface BlockList {
data: BlockShort[];
maxPages: number;
}
declare const enum TxBlockType {
MICRO = 0,
FINAL = 1
}
export interface TxBlockHeader {
Type: TxBlockType;
Version: number;
GasLimit: string;
GasUsed: string;
Rewards: string;
PrevBlockHash: string;
BlockNum: string;
Timestamp: string;
TxnHash: string;
StateHash: string;
NumTxns: number;
NumMicroBlocks: number;
MinerPubKey: string;
DSBlockNum: string;
}
export interface TxBlockObj {
body: {
HeaderSign: string;
MicroBlockEmpty: number[];
MicroBlockHashes: string[];
};
header: TxBlockHeader;
}
export interface TxList {
number: number;
TxnHashes: string[];
}
export declare const enum TransactionError {
CHECKER_FAILED = 0,
RUNNER_FAILED = 1,
BALANCE_TRANSFER_FAILED = 2,
EXECUTE_CMD_FAILED = 3,
EXECUTE_CMD_TIMEOUT = 4,
NO_GAS_REMAINING_FOUND = 5,
NO_ACCEPTED_FOUND = 6,
CALL_CONTRACT_FAILED = 7,
CREATE_CONTRACT_FAILED = 8,
JSON_OUTPUT_CORRUPTED = 9,
CONTRACT_NOT_EXIST = 10,
STATE_CORRUPTED = 11,
LOG_ENTRY_INSTALL_FAILED = 12,
MESSAGE_CORRUPTED = 13,
RECEIPT_IS_NULL = 14,
MAX_DEPTH_REACHED = 15,
CHAIN_CALL_DIFF_SHARD = 16,
PREPARATION_FAILED = 17,
NO_OUTPUT = 18,
OUTPUT_ILLEGAL = 19
}
export interface TransactionErrorObj {
[depth: number]: TransactionError[];
}
export interface TransactionReceiptObj<TGas = string> {
errors: TransactionErrorObj;
success: boolean;
cumulative_gas: TGas;
event_logs: EventLogEntry[];
}
export interface EventLogEntry {
address: string;
_eventname: string;
params: EventParam[];
}
export interface EventParam {
vname: string;
type: string;
value: string;
}
export {};
//# sourceMappingURL=types.d.ts.map

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

exports.Signer = Signer;
var TxBlockType;
(function (TxBlockType) {
TxBlockType[TxBlockType["MICRO"] = 0] = "MICRO";
TxBlockType[TxBlockType["FINAL"] = 1] = "FINAL";
})(TxBlockType || (TxBlockType = {}));
var TransactionError;
(function (TransactionError) {
TransactionError[TransactionError["CHECKER_FAILED"] = 0] = "CHECKER_FAILED";
TransactionError[TransactionError["RUNNER_FAILED"] = 1] = "RUNNER_FAILED";
TransactionError[TransactionError["BALANCE_TRANSFER_FAILED"] = 2] = "BALANCE_TRANSFER_FAILED";
TransactionError[TransactionError["EXECUTE_CMD_FAILED"] = 3] = "EXECUTE_CMD_FAILED";
TransactionError[TransactionError["EXECUTE_CMD_TIMEOUT"] = 4] = "EXECUTE_CMD_TIMEOUT";
TransactionError[TransactionError["NO_GAS_REMAINING_FOUND"] = 5] = "NO_GAS_REMAINING_FOUND";
TransactionError[TransactionError["NO_ACCEPTED_FOUND"] = 6] = "NO_ACCEPTED_FOUND";
TransactionError[TransactionError["CALL_CONTRACT_FAILED"] = 7] = "CALL_CONTRACT_FAILED";
TransactionError[TransactionError["CREATE_CONTRACT_FAILED"] = 8] = "CREATE_CONTRACT_FAILED";
TransactionError[TransactionError["JSON_OUTPUT_CORRUPTED"] = 9] = "JSON_OUTPUT_CORRUPTED";
TransactionError[TransactionError["CONTRACT_NOT_EXIST"] = 10] = "CONTRACT_NOT_EXIST";
TransactionError[TransactionError["STATE_CORRUPTED"] = 11] = "STATE_CORRUPTED";
TransactionError[TransactionError["LOG_ENTRY_INSTALL_FAILED"] = 12] = "LOG_ENTRY_INSTALL_FAILED";
TransactionError[TransactionError["MESSAGE_CORRUPTED"] = 13] = "MESSAGE_CORRUPTED";
TransactionError[TransactionError["RECEIPT_IS_NULL"] = 14] = "RECEIPT_IS_NULL";
TransactionError[TransactionError["MAX_DEPTH_REACHED"] = 15] = "MAX_DEPTH_REACHED";
TransactionError[TransactionError["CHAIN_CALL_DIFF_SHARD"] = 16] = "CHAIN_CALL_DIFF_SHARD";
TransactionError[TransactionError["PREPARATION_FAILED"] = 17] = "PREPARATION_FAILED";
TransactionError[TransactionError["NO_OUTPUT"] = 18] = "NO_OUTPUT";
TransactionError[TransactionError["OUTPUT_ILLEGAL"] = 19] = "OUTPUT_ILLEGAL";
})(TransactionError = exports.TransactionError || (exports.TransactionError = {}));
//# sourceMappingURL=types.js.map

6

package.json
{
"name": "@zilliqa-js/core",
"version": "0.4.1",
"version": "0.5.0",
"description": "Core abstractions that power the zilliqa JS client.",

@@ -22,3 +22,3 @@ "main": "dist/index.js",

"dependencies": {
"@zilliqa-js/util": "0.4.0",
"@zilliqa-js/util": "0.5.0",
"axios": "^0.18.0",

@@ -28,3 +28,3 @@ "cross-fetch": "^2.2.2",

},
"gitHead": "5ad08902a0f8ba364e4f1d9aa3cf7c2a9c65b1fb"
"gitHead": "c9ac41a9624e4797e8a94f8c1d7558bf96f92d25"
}

@@ -42,2 +42,3 @@ import fetch from 'cross-fetch';

// Contract-related methods
GetSmartContracts = 'GetSmartContracts',
GetSmartContractCode = 'GetSmartContractCode',

@@ -44,0 +45,0 @@ GetSmartContractInit = 'GetSmartContractInit',

@@ -37,1 +37,143 @@ import { RPCResponse } from './net';

}
export interface BlockchainInfo {
NumPeers: number;
NumTxBlocks: string;
NumDSBlocks: string;
NumTransactions: string;
TransactionRate: number;
TxBlockRate: number;
DSBlockRate: number;
CurrentMiniEpoch: string;
CurrentDSEpoch: string;
NumTxnsDSEpoch: string;
NumTxnsTxEpoch: string;
ShardingStructure: ShardingStructure;
}
export interface ShardingStructure {
NumPeers: number[];
}
export interface TransactionObj {
ID: string;
version: string;
nonce: number;
toAddr: string;
amount: string;
gasPrice: string;
gasLimit: string;
signature: string;
receipt: TransactionReceiptObj;
}
export interface DsBlockHeader {
BlockNum: string;
Difficulty: number;
DifficultyDS: number;
GasPrice: number;
LeaderPubKey: string;
PoWWinners: string[];
PrevHash: string;
// unix epoch
Timestamp: string;
}
export interface DsBlockObj {
header: DsBlockHeader;
signature: string;
}
interface BlockShort {
BlockNum: number;
Hash: string;
}
export interface BlockList {
data: BlockShort[];
maxPages: number;
}
const enum TxBlockType {
MICRO,
FINAL,
}
export interface TxBlockHeader {
Type: TxBlockType;
Version: number;
GasLimit: string;
GasUsed: string;
Rewards: string;
PrevBlockHash: string;
BlockNum: string;
Timestamp: string;
TxnHash: string;
StateHash: string;
NumTxns: number;
NumMicroBlocks: number;
MinerPubKey: string;
DSBlockNum: string;
}
export interface TxBlockObj {
body: {
HeaderSign: string;
MicroBlockEmpty: number[];
MicroBlockHashes: string[];
};
header: TxBlockHeader;
}
export interface TxList {
number: number;
TxnHashes: string[];
}
export const enum TransactionError {
CHECKER_FAILED = 0,
RUNNER_FAILED,
BALANCE_TRANSFER_FAILED,
EXECUTE_CMD_FAILED,
EXECUTE_CMD_TIMEOUT,
NO_GAS_REMAINING_FOUND,
NO_ACCEPTED_FOUND,
CALL_CONTRACT_FAILED,
CREATE_CONTRACT_FAILED,
JSON_OUTPUT_CORRUPTED,
CONTRACT_NOT_EXIST,
STATE_CORRUPTED,
LOG_ENTRY_INSTALL_FAILED,
MESSAGE_CORRUPTED,
RECEIPT_IS_NULL,
MAX_DEPTH_REACHED,
CHAIN_CALL_DIFF_SHARD,
PREPARATION_FAILED,
NO_OUTPUT,
OUTPUT_ILLEGAL,
}
export interface TransactionErrorObj {
[depth: number]: TransactionError[];
}
export interface TransactionReceiptObj<TGas = string> {
errors: TransactionErrorObj;
success: boolean;
cumulative_gas: TGas;
event_logs: EventLogEntry[];
}
export interface EventLogEntry {
address: string;
_eventname: string;
params: EventParam[];
}
export interface EventParam {
vname: string;
type: string;
value: string;
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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