@masa-finance/analytics-sdk
Advanced tools
Comparing version 0.0.2 to 0.0.3
{ | ||
"name": "@masa-finance/analytics-sdk", | ||
"version": ".0.0", | ||
"main": "dist/index.js", | ||
"version": "0.0.2", | ||
"main": "dist/src/index.js", | ||
"license": "MIT", | ||
@@ -15,2 +15,3 @@ "scripts": { | ||
"devDependencies": { | ||
"@types/node": "^20.6.1", | ||
"@types/uuid": "^9.0.4", | ||
@@ -21,2 +22,3 @@ "prettier": "^3.0.3", | ||
"dependencies": { | ||
"axios": "^1.5.0", | ||
"ethers": "5", | ||
@@ -23,0 +25,0 @@ "uuid": "^9.0.1" |
@@ -1,6 +0,5 @@ | ||
import { Signer } from "ethers"; | ||
export declare const generateSignature: (wallet: Signer, client_app: string, client_name: string) => Promise<{ | ||
message: string; | ||
signature: string; | ||
}>; | ||
export * from "./interfaces"; | ||
export { generateSignature } from "./tools"; | ||
export { logEvent } from "./event-logger"; | ||
export { MasaAnalytics } from "./masa-analytics"; | ||
//# sourceMappingURL=index.d.ts.map |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.generateSignature = void 0; | ||
const uuid_1 = require("uuid"); | ||
// Function to generate a random nonce using a UUID | ||
const generateRandomNonce = () => { | ||
return (0, uuid_1.v4)(); | ||
}; | ||
const generateSignature = (wallet, client_app, client_name) => __awaiter(void 0, void 0, void 0, function* () { | ||
// Generate a unique nonce | ||
const nonce = generateRandomNonce(); | ||
// Log the generated nonce | ||
console.log("Nonce:", nonce); | ||
// Request body | ||
const requestBody = { | ||
client_app, | ||
client_name, | ||
}; | ||
// Convert the request body to a string | ||
const requestBodyString = JSON.stringify(requestBody); | ||
// Construct the message to sign, including the nonce and request body | ||
const message = `Please sign this message to confirm your request. Nonce: ${nonce}. Request Body: ${requestBodyString}`; | ||
// Sign the message | ||
const signature = yield wallet.signMessage(message); | ||
return { | ||
message, | ||
signature, | ||
}; | ||
}); | ||
exports.generateSignature = generateSignature; | ||
exports.MasaAnalytics = exports.logEvent = exports.generateSignature = void 0; | ||
__exportStar(require("./interfaces"), exports); | ||
var tools_1 = require("./tools"); | ||
Object.defineProperty(exports, "generateSignature", { enumerable: true, get: function () { return tools_1.generateSignature; } }); | ||
var event_logger_1 = require("./event-logger"); | ||
Object.defineProperty(exports, "logEvent", { enumerable: true, get: function () { return event_logger_1.logEvent; } }); | ||
var masa_analytics_1 = require("./masa-analytics"); | ||
Object.defineProperty(exports, "MasaAnalytics", { enumerable: true, get: function () { return masa_analytics_1.MasaAnalytics; } }); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@masa-finance/analytics-sdk", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"main": "dist/src/index.js", | ||
@@ -15,2 +15,3 @@ "license": "MIT", | ||
"devDependencies": { | ||
"@types/node": "^20.6.1", | ||
"@types/uuid": "^9.0.4", | ||
@@ -21,2 +22,3 @@ "prettier": "^3.0.3", | ||
"dependencies": { | ||
"axios": "^1.5.0", | ||
"ethers": "5", | ||
@@ -23,0 +25,0 @@ "uuid": "^9.0.1" |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
42351
38
687
3
4
1
+ Addedaxios@^1.5.0
+ Addedasynckit@0.4.0(transitive)
+ Addedaxios@1.7.7(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedfollow-redirects@1.15.9(transitive)
+ Addedform-data@4.0.1(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedproxy-from-env@1.1.0(transitive)