New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ckb-lumos/rpc

Package Overview
Dependencies
Maintainers
3
Versions
160
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ckb-lumos/rpc - npm Package Compare versions

Comparing version 0.21.0-next.1 to 0.21.0-next.2

24

lib/index.js

@@ -12,4 +12,4 @@ "use strict";

var _exceptions = require("./exceptions");
var _axios = _interopRequireDefault(require("axios"));
var _initAxiosWebworkerAdapter = require("./initAxiosWebworkerAdapter");
var _crossFetch = _interopRequireDefault(require("cross-fetch"));
var _abortController = require("abort-controller");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -27,3 +27,3 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } // import axios from 'axios'
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
const ParamsFormatter = _paramsFormatter2.formatter;

@@ -33,3 +33,2 @@ exports.ParamsFormatter = ParamsFormatter;

exports.ResultFormatter = ResultFormatter;
(0, _initAxiosWebworkerAdapter.initAxiosWebworkerAdapter)();
var _config = /*#__PURE__*/new WeakMap();

@@ -126,3 +125,6 @@ var _node = /*#__PURE__*/new WeakMap();

});
const batchRes = await (0, _axios.default)({
const controller = new _abortController.AbortController();
const signal = controller.signal;
const timeout = setTimeout(() => controller.abort(), _classPrivateFieldGet(ctx, _config).timeout);
const batchRes = await (0, _crossFetch.default)(_classPrivateFieldGet(ctx, _node).url, {
method: "POST",

@@ -132,9 +134,7 @@ headers: {

},
data: payload,
url: _classPrivateFieldGet(ctx, _node).url,
httpAgent: _classPrivateFieldGet(ctx, _node).httpAgent,
httpsAgent: _classPrivateFieldGet(ctx, _node).httpsAgent,
timeout: _classPrivateFieldGet(ctx, _config).timeout
});
return batchRes.data.map((res, i) => {
body: JSON.stringify(payload),
signal: signal
}).then(res => res.json());
clearTimeout(timeout);
return batchRes.map((res, i) => {
var _ctx$rpcProperties$pr, _ctx$rpcProperties$pr2, _ctx$rpcProperties$pr3;

@@ -141,0 +141,0 @@ if (res.id !== payload[i].id) {

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

exports.Method = void 0;
var _axios = _interopRequireDefault(require("axios"));
var _exceptions = require("./exceptions");
var _initAxiosWebworkerAdapter = require("./initAxiosWebworkerAdapter");
var _crossFetch = _interopRequireDefault(require("cross-fetch"));
var _abortController = require("abort-controller");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -22,3 +22,2 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
(0, _initAxiosWebworkerAdapter.initAxiosWebworkerAdapter)();
var _name = /*#__PURE__*/new WeakMap();

@@ -57,5 +56,8 @@ var _config = /*#__PURE__*/new WeakMap();

/* eslint-disable @typescript-eslint/ban-types, @typescript-eslint/explicit-module-boundary-types */
_defineProperty(this, "call", (...params) => {
_defineProperty(this, "call", async (...params) => {
const payload = this.getPayload(...params);
return (0, _axios.default)({
const controller = new _abortController.AbortController();
const signal = controller.signal;
const timeout = setTimeout(() => controller.abort(), _classPrivateFieldGet(this, _config).timeout);
const res = await (0, _crossFetch.default)(_classPrivateFieldGet(this, _node).url, {
method: "POST",

@@ -65,17 +67,16 @@ headers: {

},
data: payload,
url: _classPrivateFieldGet(this, _node).url,
httpAgent: _classPrivateFieldGet(this, _node).httpAgent,
httpsAgent: _classPrivateFieldGet(this, _node).httpsAgent,
timeout: _classPrivateFieldGet(this, _config).timeout
}).then(res => {
body: JSON.stringify(payload),
signal
}).then(res => res.json()).then(res => {
var _classPrivateFieldGet2, _classPrivateFieldGet3, _classPrivateFieldGet4;
if (res.data.id !== payload.id) {
throw new _exceptions.IdNotMatchException(payload.id, res.data.id);
if (res.id !== payload.id) {
throw new _exceptions.IdNotMatchException(payload.id, res.id);
}
if (res.data.error) {
throw new _exceptions.ResponseException(JSON.stringify(res.data.error));
if (res.error) {
throw new _exceptions.ResponseException(JSON.stringify(res.error));
}
return (_classPrivateFieldGet2 = (_classPrivateFieldGet3 = (_classPrivateFieldGet4 = _classPrivateFieldGet(this, _options)).resultFormatters) === null || _classPrivateFieldGet3 === void 0 ? void 0 : _classPrivateFieldGet3.call(_classPrivateFieldGet4, res.data.result)) !== null && _classPrivateFieldGet2 !== void 0 ? _classPrivateFieldGet2 : res.data.result;
return (_classPrivateFieldGet2 = (_classPrivateFieldGet3 = (_classPrivateFieldGet4 = _classPrivateFieldGet(this, _options)).resultFormatters) === null || _classPrivateFieldGet3 === void 0 ? void 0 : _classPrivateFieldGet3.call(_classPrivateFieldGet4, res.result)) !== null && _classPrivateFieldGet2 !== void 0 ? _classPrivateFieldGet2 : res.result;
});
clearTimeout(timeout);
return res;
});

@@ -82,0 +83,0 @@ _defineProperty(this, "getPayload", (...params) => {

{
"name": "@ckb-lumos/rpc",
"version": "0.21.0-next.1",
"version": "0.21.0-next.2",
"description": "RPC module for CKB",

@@ -29,7 +29,6 @@ "homepage": "https://github.com/ckb-js/lumos#readme",

"dependencies": {
"@ckb-lumos/base": "0.21.0-next.1",
"@ckb-lumos/bi": "0.21.0-next.1",
"@vespaiach/axios-fetch-adapter": "^0.3.1",
"axios": "0.27.2",
"tslib": "2.3.1"
"@ckb-lumos/base": "0.21.0-next.2",
"@ckb-lumos/bi": "0.21.0-next.2",
"abort-controller": "^3.0.0",
"cross-fetch": "^3.1.5"
},

@@ -36,0 +35,0 @@ "devDependencies": {

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