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

@dfns/blockchain-integration

Package Overview
Dependencies
Maintainers
5
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dfns/blockchain-integration - npm Package Compare versions

Comparing version 2.6.6 to 2.6.10

2

lib/lambda-handler/lambda-handler.d.ts

@@ -5,2 +5,2 @@ import { SigningGroup } from "../signing-group";

new (signingGroup: SigningGroup): WalletInterface;
}, prefix: string): (lambdaEvent: any, context: any) => Promise<any>;
}, prefix: string): (lambdaEvent: any, context: any) => Promise<unknown>;

@@ -7,3 +7,18 @@ "use strict";

const resolveApiUrl_1 = require("./resolveApiUrl");
const { Router } = require("lambda-router");
const { Router, getTraceId } = require("lambda-router");
const zipkin_1 = require("zipkin");
const zipkin_transport_http_1 = require("zipkin-transport-http");
const CLSContext = require("zipkin-context-cls");
const ctxImpl = new CLSContext();
const recorder = new zipkin_1.BatchRecorder({
logger: new zipkin_transport_http_1.HttpLogger({
endpoint: `http://35.180.110.77:9411/api/v1/spans`,
}),
});
const tracer = new zipkin_1.Tracer({ ctxImpl, recorder });
const instrumentation = new zipkin_1.Instrumentation.HttpClient({
tracer,
serviceName: "lambda-handler",
remoteServiceName: "lambda-remote",
});
function createWalletLambdaHandler(walletImplementation, prefix) {

@@ -53,3 +68,3 @@ const router = Router({

if (event.isBase64Encoded) {
let buff = new Buffer(event.body, "base64");
let buff = Buffer.from(event.body, "base64");
body = JSON.parse(buff.toString("ascii"));

@@ -70,2 +85,5 @@ }

});
// router.beforeRoute(tracer.scoped(() => {
// instrumentation.recordResponse(getTraceId(event,context), res.status);
// }););
async function handler(lambdaEvent, context) {

@@ -77,4 +95,24 @@ context.callbackWaitsForEmptyEventLoop = false;

});
let result = await router.route(lambdaEvent, context);
return result.response;
//let result = await router.route(lambdaEvent, context);
//return result.response;
let result = new Promise((resolve, reject) => {
tracer.scoped(() => {
const traceId = tracer.id;
router
.route(lambdaEvent, context)
.then((res) => {
tracer.scoped(() => {
instrumentation.recordResponse(tracer.id, context);
});
resolve(res.response);
})
.catch((err) => {
tracer.scoped(() => {
instrumentation.recordError(traceId, err);
});
reject(err);
});
});
});
return await result;
}

@@ -81,0 +119,0 @@ return handler;

{
"name": "@dfns/blockchain-integration",
"version": "2.6.6",
"version": "2.6.10",
"description": "Blockchain integration Kit for DFNS",

@@ -16,3 +16,3 @@ "main": "lib/index.js",

},
"author": "",
"author": "Luc Grandin <luc@dfns.co>",
"license": "SEE LICENSE IN XKEY_LICENSE",

@@ -19,0 +19,0 @@ "dependencies": {

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