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 3.1.0 to 3.2.0

1

dist/decorators/index.js

@@ -19,4 +19,5 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.sign = void 0;
var sign_1 = require("./sign");
Object.defineProperty(exports, "sign", { enumerable: true, get: function () { return sign_1.sign; } });
//# sourceMappingURL=index.js.map

9

dist/decorators/sign.js

@@ -32,3 +32,3 @@ "use strict";

*/
exports.sign = function (target, key, descriptor) {
var sign = function (target, key, descriptor) {
var original = descriptor.value;

@@ -40,5 +40,5 @@ function interceptor(arg) {

}
return tslib_1.__awaiter(this, void 0, void 0, function () {
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
var signed;
return tslib_1.__generator(this, function (_a) {
return (0, tslib_1.__generator)(this, function (_a) {
switch (_a.label) {

@@ -50,3 +50,3 @@ case 0:

signed = _a.sent();
return [2 /*return*/, original.call.apply(original, tslib_1.__spread([this, signed], args))];
return [2 /*return*/, original.call.apply(original, (0, tslib_1.__spreadArray)([this, signed], (0, tslib_1.__read)(args), false))];
case 2: return [2 /*return*/];

@@ -60,2 +60,3 @@ }

};
exports.sign = sign;
//# sourceMappingURL=sign.js.map

@@ -21,3 +21,3 @@ "use strict";

var tslib_1 = require("tslib");
var mitt_1 = tslib_1.__importDefault(require("mitt"));
var mitt_1 = (0, tslib_1.__importDefault)(require("mitt"));
var EventEmitter = /** @class */ (function () {

@@ -24,0 +24,0 @@ function EventEmitter() {

@@ -24,7 +24,2 @@ import mitt from 'mitt';

}());
var TxBlockType;
(function (TxBlockType) {
TxBlockType[TxBlockType["MICRO"] = 0] = "MICRO";
TxBlockType[TxBlockType["FINAL"] = 1] = "FINAL";
})(TxBlockType || (TxBlockType = {}));
var TransactionError;

@@ -163,7 +158,10 @@ (function (TransactionError) {

/** @deprecated */
function __spread() {
for (var ar = [], i = 0; i < arguments.length; i++)
ar = ar.concat(__read(arguments[i]));
return ar;
function __spreadArray(to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || from);
}

@@ -199,3 +197,3 @@

signed = _a.sent();
return [2 /*return*/, original.call.apply(original, __spread([this, signed], args))];
return [2 /*return*/, original.call.apply(original, __spreadArray([this, signed], __read(args), false))];
case 2: return [2 /*return*/];

@@ -909,7 +907,7 @@ }

var current = this.reqMiddleware.get(match) || [];
this.reqMiddleware.set(match, __spread(current, [fn]));
this.reqMiddleware.set(match, __spreadArray(__spreadArray([], __read(current), false), [fn], false));
}
else {
var current = this.resMiddleware.get(match) || [];
this.resMiddleware.set(match, __spread(current, [fn]));
this.resMiddleware.set(match, __spreadArray(__spreadArray([], __read(current), false), [fn], false));
}

@@ -935,9 +933,9 @@ };

if (typeof key === 'string' && key !== '*' && key === method) {
reqFns.push.apply(reqFns, __spread(transformers));
reqFns.push.apply(reqFns, __spreadArray([], __read(transformers), false));
}
if (key instanceof RegExp && key.test(method)) {
reqFns.push.apply(reqFns, __spread(transformers));
reqFns.push.apply(reqFns, __spreadArray([], __read(transformers), false));
}
if (key === '*') {
reqFns.push.apply(reqFns, __spread(transformers));
reqFns.push.apply(reqFns, __spreadArray([], __read(transformers), false));
}

@@ -957,9 +955,9 @@ }

if (typeof key === 'string' && key !== '*' && key === method) {
resFns.push.apply(resFns, __spread(transformers));
resFns.push.apply(resFns, __spreadArray([], __read(transformers), false));
}
if (key instanceof RegExp && key.test(method)) {
resFns.push.apply(resFns, __spread(transformers));
resFns.push.apply(resFns, __spreadArray([], __read(transformers), false));
}
if (key === '*') {
resFns.push.apply(resFns, __spread(transformers));
resFns.push.apply(resFns, __spreadArray([], __read(transformers), false));
}

@@ -1026,4 +1024,4 @@ }

var _a = __read(this.getMiddleware(method), 2), tReq = _a[0], tRes = _a[1];
var reqMiddleware = composeMiddleware.apply(void 0, __spread(tReq));
var resMiddleware = composeMiddleware.apply(void 0, __spread(tRes));
var reqMiddleware = composeMiddleware.apply(void 0, __spreadArray([], __read(tReq), false));
var resMiddleware = composeMiddleware.apply(void 0, __spreadArray([], __read(tRes), false));
var req = reqMiddleware(this.buildPayload(method, params));

@@ -1034,4 +1032,4 @@ return performRPC(req, resMiddleware);

var _a = __read(this.getMiddleware(method), 2), tReq = _a[0], tRes = _a[1];
var reqMiddleware = composeMiddleware.apply(void 0, __spread(tReq));
var resMiddleware = composeMiddleware.apply(void 0, __spread(tRes));
var reqMiddleware = composeMiddleware.apply(void 0, __spreadArray([], __read(tReq), false));
var resMiddleware = composeMiddleware.apply(void 0, __spreadArray([], __read(tRes), false));
var batchPayload = this.buildBatchPayload(method, params);

@@ -1038,0 +1036,0 @@ var req = reqMiddleware(batchPayload);

@@ -20,9 +20,9 @@ "use strict";

var tslib_1 = require("tslib");
tslib_1.__exportStar(require("./types"), exports);
tslib_1.__exportStar(require("./decorators"), exports);
tslib_1.__exportStar(require("./net"), exports);
tslib_1.__exportStar(require("./util"), exports);
tslib_1.__exportStar(require("./providers/http"), exports);
tslib_1.__exportStar(require("./constants"), exports);
tslib_1.__exportStar(require("./eventEmitter"), exports);
(0, tslib_1.__exportStar)(require("./types"), exports);
(0, tslib_1.__exportStar)(require("./decorators"), exports);
(0, tslib_1.__exportStar)(require("./net"), exports);
(0, tslib_1.__exportStar)(require("./util"), exports);
(0, tslib_1.__exportStar)(require("./providers/http"), exports);
(0, tslib_1.__exportStar)(require("./constants"), exports);
(0, tslib_1.__exportStar)(require("./eventEmitter"), exports);
//# sourceMappingURL=index.js.map

@@ -30,7 +30,2 @@ (function (global, factory) {

}());
var TxBlockType;
(function (TxBlockType) {
TxBlockType[TxBlockType["MICRO"] = 0] = "MICRO";
TxBlockType[TxBlockType["FINAL"] = 1] = "FINAL";
})(TxBlockType || (TxBlockType = {}));
(function (TransactionError) {

@@ -168,7 +163,10 @@ TransactionError[TransactionError["CHECKER_FAILED"] = 0] = "CHECKER_FAILED";

/** @deprecated */
function __spread() {
for (var ar = [], i = 0; i < arguments.length; i++)
ar = ar.concat(__read(arguments[i]));
return ar;
function __spreadArray(to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || from);
}

@@ -204,3 +202,3 @@

signed = _a.sent();
return [2 /*return*/, original.call.apply(original, __spread([this, signed], args))];
return [2 /*return*/, original.call.apply(original, __spreadArray([this, signed], __read(args), false))];
case 2: return [2 /*return*/];

@@ -909,7 +907,7 @@ }

var current = this.reqMiddleware.get(match) || [];
this.reqMiddleware.set(match, __spread(current, [fn]));
this.reqMiddleware.set(match, __spreadArray(__spreadArray([], __read(current), false), [fn], false));
}
else {
var current = this.resMiddleware.get(match) || [];
this.resMiddleware.set(match, __spread(current, [fn]));
this.resMiddleware.set(match, __spreadArray(__spreadArray([], __read(current), false), [fn], false));
}

@@ -935,9 +933,9 @@ };

if (typeof key === 'string' && key !== '*' && key === method) {
reqFns.push.apply(reqFns, __spread(transformers));
reqFns.push.apply(reqFns, __spreadArray([], __read(transformers), false));
}
if (key instanceof RegExp && key.test(method)) {
reqFns.push.apply(reqFns, __spread(transformers));
reqFns.push.apply(reqFns, __spreadArray([], __read(transformers), false));
}
if (key === '*') {
reqFns.push.apply(reqFns, __spread(transformers));
reqFns.push.apply(reqFns, __spreadArray([], __read(transformers), false));
}

@@ -957,9 +955,9 @@ }

if (typeof key === 'string' && key !== '*' && key === method) {
resFns.push.apply(resFns, __spread(transformers));
resFns.push.apply(resFns, __spreadArray([], __read(transformers), false));
}
if (key instanceof RegExp && key.test(method)) {
resFns.push.apply(resFns, __spread(transformers));
resFns.push.apply(resFns, __spreadArray([], __read(transformers), false));
}
if (key === '*') {
resFns.push.apply(resFns, __spread(transformers));
resFns.push.apply(resFns, __spreadArray([], __read(transformers), false));
}

@@ -1026,4 +1024,4 @@ }

var _a = __read(this.getMiddleware(method), 2), tReq = _a[0], tRes = _a[1];
var reqMiddleware = composeMiddleware.apply(void 0, __spread(tReq));
var resMiddleware = composeMiddleware.apply(void 0, __spread(tRes));
var reqMiddleware = composeMiddleware.apply(void 0, __spreadArray([], __read(tReq), false));
var resMiddleware = composeMiddleware.apply(void 0, __spreadArray([], __read(tRes), false));
var req = reqMiddleware(this.buildPayload(method, params));

@@ -1034,4 +1032,4 @@ return performRPC(req, resMiddleware);

var _a = __read(this.getMiddleware(method), 2), tReq = _a[0], tRes = _a[1];
var reqMiddleware = composeMiddleware.apply(void 0, __spread(tReq));
var resMiddleware = composeMiddleware.apply(void 0, __spread(tRes));
var reqMiddleware = composeMiddleware.apply(void 0, __spreadArray([], __read(tReq), false));
var resMiddleware = composeMiddleware.apply(void 0, __spreadArray([], __read(tRes), false));
var batchPayload = this.buildBatchPayload(method, params);

@@ -1038,0 +1036,0 @@ var req = reqMiddleware(batchPayload);

@@ -98,5 +98,5 @@ "use strict";

var DEFAULT_HEADERS = { 'Content-Type': 'application/json' };
exports.performRPC = function (request, handler) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
var performRPC = function (request, handler) { return (0, tslib_1.__awaiter)(void 0, void 0, void 0, function () {
var response, err_1;
return tslib_1.__generator(this, function (_a) {
return (0, tslib_1.__generator)(this, function (_a) {
switch (_a.label) {

@@ -112,3 +112,3 @@ case 0:

body: JSON.stringify(request.payload),
headers: tslib_1.__assign(tslib_1.__assign({}, DEFAULT_HEADERS), ((request.options && request.options.headers) || {})),
headers: (0, tslib_1.__assign)((0, tslib_1.__assign)({}, DEFAULT_HEADERS), ((request.options && request.options.headers) || {})),
})];

@@ -120,3 +120,3 @@ case 1:

.then(function (body) {
return tslib_1.__assign(tslib_1.__assign({}, body), { req: request });
return (0, tslib_1.__assign)((0, tslib_1.__assign)({}, body), { req: request });
})

@@ -131,6 +131,7 @@ .then(handler)];

}); };
exports.performRPC = performRPC;
// identical to performRPC; difference is the response
exports.performBatchRPC = function (request, handler) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
var performBatchRPC = function (request, handler) { return (0, tslib_1.__awaiter)(void 0, void 0, void 0, function () {
var response, err_2;
return tslib_1.__generator(this, function (_a) {
return (0, tslib_1.__generator)(this, function (_a) {
switch (_a.label) {

@@ -146,3 +147,3 @@ case 0:

body: JSON.stringify(request.payload),
headers: tslib_1.__assign(tslib_1.__assign({}, DEFAULT_HEADERS), ((request.options && request.options.headers) || {})),
headers: (0, tslib_1.__assign)((0, tslib_1.__assign)({}, DEFAULT_HEADERS), ((request.options && request.options.headers) || {})),
})];

@@ -174,2 +175,3 @@ case 1:

}); };
exports.performBatchRPC = performBatchRPC;
//# sourceMappingURL=net.js.map

@@ -10,6 +10,6 @@ import { RPCMethod } from '../net';

request: {
use: <I, O>(fn: import("../util").Transformer<import("../net").RPCRequest<I>, import("../net").RPCRequest<O>>, match?: Matcher) => void;
use: <I, O>(fn: ReqMiddlewareFn<I, O>, match?: Matcher) => void;
};
response: {
use: <I_1, O_1, E>(fn: import("../util").Transformer<import("../util").WithRequest<import("../net").RPCResponse<I_1, E>, any>, import("../util").WithRequest<import("../net").RPCResponse<O_1, E>, any>>, match?: Matcher) => void;
use: <I_1, O_1, E>(fn: ResMiddlewareFn<I_1, O_1, E>, match?: Matcher) => void;
};

@@ -16,0 +16,0 @@ };

@@ -65,7 +65,7 @@ "use strict";

var current = this.reqMiddleware.get(match) || [];
this.reqMiddleware.set(match, tslib_1.__spread(current, [fn]));
this.reqMiddleware.set(match, (0, tslib_1.__spreadArray)((0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(current), false), [fn], false));
}
else {
var current = this.resMiddleware.get(match) || [];
this.resMiddleware.set(match, tslib_1.__spread(current, [fn]));
this.resMiddleware.set(match, (0, tslib_1.__spreadArray)((0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(current), false), [fn], false));
}

@@ -88,12 +88,12 @@ };

try {
for (var _c = tslib_1.__values(this.reqMiddleware.entries()), _d = _c.next(); !_d.done; _d = _c.next()) {
var _e = tslib_1.__read(_d.value, 2), key = _e[0], transformers = _e[1];
for (var _c = (0, tslib_1.__values)(this.reqMiddleware.entries()), _d = _c.next(); !_d.done; _d = _c.next()) {
var _e = (0, tslib_1.__read)(_d.value, 2), key = _e[0], transformers = _e[1];
if (typeof key === 'string' && key !== '*' && key === method) {
reqFns.push.apply(reqFns, tslib_1.__spread(transformers));
reqFns.push.apply(reqFns, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(transformers), false));
}
if (key instanceof RegExp && key.test(method)) {
reqFns.push.apply(reqFns, tslib_1.__spread(transformers));
reqFns.push.apply(reqFns, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(transformers), false));
}
if (key === '*') {
reqFns.push.apply(reqFns, tslib_1.__spread(transformers));
reqFns.push.apply(reqFns, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(transformers), false));
}

@@ -110,12 +110,12 @@ }

try {
for (var _f = tslib_1.__values(this.resMiddleware.entries()), _g = _f.next(); !_g.done; _g = _f.next()) {
var _h = tslib_1.__read(_g.value, 2), key = _h[0], transformers = _h[1];
for (var _f = (0, tslib_1.__values)(this.resMiddleware.entries()), _g = _f.next(); !_g.done; _g = _f.next()) {
var _h = (0, tslib_1.__read)(_g.value, 2), key = _h[0], transformers = _h[1];
if (typeof key === 'string' && key !== '*' && key === method) {
resFns.push.apply(resFns, tslib_1.__spread(transformers));
resFns.push.apply(resFns, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(transformers), false));
}
if (key instanceof RegExp && key.test(method)) {
resFns.push.apply(resFns, tslib_1.__spread(transformers));
resFns.push.apply(resFns, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(transformers), false));
}
if (key === '*') {
resFns.push.apply(resFns, tslib_1.__spread(transformers));
resFns.push.apply(resFns, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(transformers), false));
}

@@ -122,0 +122,0 @@ }

@@ -25,3 +25,3 @@ "use strict";

var HTTPProvider = /** @class */ (function (_super) {
tslib_1.__extends(HTTPProvider, _super);
(0, tslib_1.__extends)(HTTPProvider, _super);
function HTTPProvider() {

@@ -69,15 +69,15 @@ return _super !== null && _super.apply(this, arguments) || this;

}
var _a = tslib_1.__read(this.getMiddleware(method), 2), tReq = _a[0], tRes = _a[1];
var reqMiddleware = util_1.composeMiddleware.apply(void 0, tslib_1.__spread(tReq));
var resMiddleware = util_1.composeMiddleware.apply(void 0, tslib_1.__spread(tRes));
var _a = (0, tslib_1.__read)(this.getMiddleware(method), 2), tReq = _a[0], tRes = _a[1];
var reqMiddleware = util_1.composeMiddleware.apply(void 0, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(tReq), false));
var resMiddleware = util_1.composeMiddleware.apply(void 0, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(tRes), false));
var req = reqMiddleware(this.buildPayload(method, params));
return net_1.performRPC(req, resMiddleware);
return (0, net_1.performRPC)(req, resMiddleware);
};
HTTPProvider.prototype.sendBatch = function (method, params) {
var _a = tslib_1.__read(this.getMiddleware(method), 2), tReq = _a[0], tRes = _a[1];
var reqMiddleware = util_1.composeMiddleware.apply(void 0, tslib_1.__spread(tReq));
var resMiddleware = util_1.composeMiddleware.apply(void 0, tslib_1.__spread(tRes));
var _a = (0, tslib_1.__read)(this.getMiddleware(method), 2), tReq = _a[0], tRes = _a[1];
var reqMiddleware = util_1.composeMiddleware.apply(void 0, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(tReq), false));
var resMiddleware = util_1.composeMiddleware.apply(void 0, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(tRes), false));
var batchPayload = this.buildBatchPayload(method, params);
var req = reqMiddleware(batchPayload);
return net_1.performBatchRPC(req, resMiddleware);
return (0, net_1.performBatchRPC)(req, resMiddleware);
};

@@ -84,0 +84,0 @@ HTTPProvider.prototype.subscribe = function (event, subscriber) {

@@ -104,6 +104,2 @@ /// <reference types="node" />

}
declare enum TxBlockType {
MICRO = 0,
FINAL = 1
}
export interface TxBlockHeader {

@@ -117,2 +113,3 @@ BlockNum: string;

NumMicroBlocks: number;
NumPages: number;
NumTxns: number;

@@ -126,3 +123,2 @@ PrevBlockHash: string;

Version: number;
Type: TxBlockType;
}

@@ -129,0 +125,0 @@ export interface MicroBlockInfoObj {

@@ -26,7 +26,2 @@ "use strict";

exports.Signer = Signer;
var TxBlockType;
(function (TxBlockType) {
TxBlockType[TxBlockType["MICRO"] = 0] = "MICRO";
TxBlockType[TxBlockType["FINAL"] = 1] = "FINAL";
})(TxBlockType || (TxBlockType = {}));
var TransactionError;

@@ -33,0 +28,0 @@ (function (TransactionError) {

{
"name": "@zilliqa-js/core",
"version": "3.1.0",
"version": "3.2.0",
"description": "Core abstractions that power the zilliqa JS client.",

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

"scripts": {
"clean": "rimraf ./dist"
"clean": "rimraf ./dist ./tsconfig.tsbuildinfo"
},

@@ -41,5 +41,5 @@ "dependencies": {

"engines": {
"node": ">=12.0.0 <15"
"node": ">=12.0.0 <17"
},
"gitHead": "5812a8d2199d8f4ff584dfd343b91cac3ee0dbbc"
"gitHead": "76b5911234aeb9b928ca81ebace202aa5e6ed815"
}

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

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