@zilliqa-js/core
Advanced tools
Comparing version 2.3.0-alpha.0 to 3.0.0
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
432294
1
3759
+ Added@types/node@22.9.3(transitive)
+ Added@zilliqa-js/crypto@3.0.0(transitive)
+ Added@zilliqa-js/util@3.0.0(transitive)
+ Addedcipher-base@1.0.5(transitive)
+ Addedundici-types@6.19.8(transitive)
- Removed@types/node@22.10.0(transitive)
- Removed@zilliqa-js/crypto@2.3.0-alpha.0(transitive)
- Removed@zilliqa-js/util@2.2.0(transitive)
- Removedcipher-base@1.0.6(transitive)
- Removedundici-types@6.20.0(transitive)
Updated@zilliqa-js/crypto@3.0.0
Updated@zilliqa-js/util@3.0.0