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

@zilliqa-js/core

Package Overview
Dependencies
Maintainers
3
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 2.3.0-alpha.0 to 3.0.0

37

dist/index.esm.js

@@ -244,4 +244,2 @@ import fetch from 'cross-fetch';

RPCMethod["GetMinimumGasPrice"] = "GetMinimumGasPrice";
RPCMethod["GetPendingTxn"] = "GetPendingTxn";
RPCMethod["GetPendingTxns"] = "GetPendingTxns";
// Contract-related methods

@@ -520,22 +518,23 @@ RPCMethod["GetSmartContracts"] = "GetSmartContracts";

HTTPProvider.prototype.buildBatchPayload = function (method, paramsList) {
var e_1, _a;
var payloads = [];
try {
for (var paramsList_1 = __values(paramsList), paramsList_1_1 = paramsList_1.next(); !paramsList_1_1.done; paramsList_1_1 = paramsList_1.next()) {
var payloadParam = paramsList_1_1.value;
var params = [payloadParam];
payloads.push({
id: 1,
jsonrpc: '2.0',
method: method,
params: params,
});
for (var i = 0; i < paramsList.length; i++) {
// most of the payloads should be a single param, e.g. GetTransaction
// however, there are special cases e.g. GetSmartContractSubState & GetTransactionsForTxBlockEx
// where the param field is a list
var payloadParams = paramsList[i];
var params = void 0;
if (Array.isArray(payloadParams)) {
// for those param field that is already a list
params = payloadParams;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (paramsList_1_1 && !paramsList_1_1.done && (_a = paramsList_1.return)) _a.call(paramsList_1);
else {
params = [payloadParams];
}
finally { if (e_1) throw e_1.error; }
// id start from index 1
payloads.push({
id: i + 1,
jsonrpc: '2.0',
method: method,
params: params,
});
}

@@ -542,0 +541,0 @@ return {

@@ -245,4 +245,2 @@ (function (global, factory) {

RPCMethod["GetMinimumGasPrice"] = "GetMinimumGasPrice";
RPCMethod["GetPendingTxn"] = "GetPendingTxn";
RPCMethod["GetPendingTxns"] = "GetPendingTxns";
// Contract-related methods

@@ -520,22 +518,23 @@ RPCMethod["GetSmartContracts"] = "GetSmartContracts";

HTTPProvider.prototype.buildBatchPayload = function (method, paramsList) {
var e_1, _a;
var payloads = [];
try {
for (var paramsList_1 = __values(paramsList), paramsList_1_1 = paramsList_1.next(); !paramsList_1_1.done; paramsList_1_1 = paramsList_1.next()) {
var payloadParam = paramsList_1_1.value;
var params = [payloadParam];
payloads.push({
id: 1,
jsonrpc: '2.0',
method: method,
params: params,
});
for (var i = 0; i < paramsList.length; i++) {
// most of the payloads should be a single param, e.g. GetTransaction
// however, there are special cases e.g. GetSmartContractSubState & GetTransactionsForTxBlockEx
// where the param field is a list
var payloadParams = paramsList[i];
var params = void 0;
if (Array.isArray(payloadParams)) {
// for those param field that is already a list
params = payloadParams;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (paramsList_1_1 && !paramsList_1_1.done && (_a = paramsList_1.return)) _a.call(paramsList_1);
else {
params = [payloadParams];
}
finally { if (e_1) throw e_1.error; }
// id start from index 1
payloads.push({
id: i + 1,
jsonrpc: '2.0',
method: method,
params: params,
});
}

@@ -542,0 +541,0 @@ return {

@@ -36,4 +36,2 @@ import { WithRequest } from './util';

GetMinimumGasPrice = "GetMinimumGasPrice",
GetPendingTxn = "GetPendingTxn",
GetPendingTxns = "GetPendingTxns",
GetSmartContracts = "GetSmartContracts",

@@ -65,3 +63,3 @@ GetSmartContractCode = "GetSmartContractCode",

export interface RPCRequestPayload<T> {
id: 1;
id: number;
jsonrpc: '2.0';

@@ -82,3 +80,3 @@ method: RPCMethod;

jsonrpc: '2.0';
id: '1';
id: number;
}

@@ -85,0 +83,0 @@ export interface RPCResponseSuccess<R = any> extends RPCResponseBase {

@@ -59,4 +59,2 @@ "use strict";

RPCMethod["GetMinimumGasPrice"] = "GetMinimumGasPrice";
RPCMethod["GetPendingTxn"] = "GetPendingTxn";
RPCMethod["GetPendingTxns"] = "GetPendingTxns";
// Contract-related methods

@@ -63,0 +61,0 @@ RPCMethod["GetSmartContracts"] = "GetSmartContracts";

@@ -35,22 +35,23 @@ "use strict";

HTTPProvider.prototype.buildBatchPayload = function (method, paramsList) {
var e_1, _a;
var payloads = [];
try {
for (var paramsList_1 = tslib_1.__values(paramsList), paramsList_1_1 = paramsList_1.next(); !paramsList_1_1.done; paramsList_1_1 = paramsList_1.next()) {
var payloadParam = paramsList_1_1.value;
var params = [payloadParam];
payloads.push({
id: 1,
jsonrpc: '2.0',
method: method,
params: params,
});
for (var i = 0; i < paramsList.length; i++) {
// most of the payloads should be a single param, e.g. GetTransaction
// however, there are special cases e.g. GetSmartContractSubState & GetTransactionsForTxBlockEx
// where the param field is a list
var payloadParams = paramsList[i];
var params = void 0;
if (Array.isArray(payloadParams)) {
// for those param field that is already a list
params = payloadParams;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (paramsList_1_1 && !paramsList_1_1.done && (_a = paramsList_1.return)) _a.call(paramsList_1);
else {
params = [payloadParams];
}
finally { if (e_1) throw e_1.error; }
// id start from index 1
payloads.push({
id: i + 1,
jsonrpc: '2.0',
method: method,
params: params,
});
}

@@ -57,0 +58,0 @@ return {

@@ -204,5 +204,2 @@ /// <reference types="node" />

}
export interface PendingTxns {
Txns: TransactionStatus[];
}
export interface TransactionStatus {

@@ -213,7 +210,2 @@ code: number;

}
export interface PendingTxnResult {
code: number;
confirmed: boolean;
pending: boolean;
}
export interface MinerInfo {

@@ -220,0 +212,0 @@ dscommittee: string[];

{
"name": "@zilliqa-js/core",
"version": "2.3.0-alpha.0",
"version": "3.0.0",
"description": "Core abstractions that power the zilliqa JS client.",

@@ -28,4 +28,4 @@ "main": "dist/index.js",

"dependencies": {
"@zilliqa-js/crypto": "2.3.0-alpha.0",
"@zilliqa-js/util": "2.2.0",
"@zilliqa-js/crypto": "3.0.0",
"@zilliqa-js/util": "3.0.0",
"cross-fetch": "^2.2.2",

@@ -35,5 +35,5 @@ "mitt": "^1.1.3"

"engines": {
"node": ">=10.0.0 <15"
"node": ">=12.0.0 <15"
},
"gitHead": "d4f6f6e15d8b33da276e240dbfd85380bb9d397c"
"gitHead": "832bcaf3a930a7257e009481c0c76dc27e39450a"
}

@@ -61,4 +61,2 @@ // Copyright (C) 2018 Zilliqa

GetMinimumGasPrice = 'GetMinimumGasPrice',
GetPendingTxn = 'GetPendingTxn',
GetPendingTxns = 'GetPendingTxns',

@@ -105,3 +103,3 @@ // Contract-related methods

export interface RPCRequestPayload<T> {
id: 1;
id: number;
jsonrpc: '2.0';

@@ -125,3 +123,3 @@ method: RPCMethod;

jsonrpc: '2.0';
id: '1';
id: number;
}

@@ -128,0 +126,0 @@

@@ -43,6 +43,17 @@ // Copyright (C) 2018 Zilliqa

let payloads: RPCRequestPayload<T>[] = [];
for (let payloadParam of paramsList) {
const params: any = [payloadParam];
for (let i = 0; i < paramsList.length; i++) {
// most of the payloads should be a single param, e.g. GetTransaction
// however, there are special cases e.g. GetSmartContractSubState & GetTransactionsForTxBlockEx
// where the param field is a list
let payloadParams = paramsList[i];
let params: any;
if (Array.isArray(payloadParams)) {
// for those param field that is already a list
params = payloadParams;
} else {
params = [payloadParams];
}
// id start from index 1
payloads.push({
id: 1,
id: i + 1,
jsonrpc: '2.0',

@@ -49,0 +60,0 @@ method,

@@ -261,6 +261,2 @@ // Copyright (C) 2018 Zilliqa

export interface PendingTxns {
Txns: TransactionStatus[];
}
export interface TransactionStatus {

@@ -272,8 +268,2 @@ code: number;

export interface PendingTxnResult {
code: number;
confirmed: boolean;
pending: boolean;
}
export interface MinerInfo {

@@ -280,0 +270,0 @@ dscommittee: 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

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