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

@fortmatic/admin

Package Overview
Dependencies
Maintainers
9
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fortmatic/admin - npm Package Compare versions

Comparing version 0.0.1 to 0.0.3

4

dist/core/dat-validator.d.ts

@@ -6,4 +6,4 @@ import { ChallengeMessageService } from '../types';

validateToken(DecentralizedAccessToken: string): Promise<void>;
invalidateToken(DecentralizedAccessToken: string): Promise<any>;
invalidateTokenBySignerAddress(userPublicAddress: string): Promise<any>;
invalidateToken(DecentralizedAccessToken: string): Promise<boolean>;
invalidateTokenBySignerAddress(userPublicAddress: string): Promise<boolean>;
decodeToken(DecentralizedAccessToken: string): any[];

@@ -10,0 +10,0 @@ getUserPublicAddress(authorizationHeader: string): string;

@@ -135,4 +135,3 @@ "use strict";

userPublicAddress = (_b = (_a = claim) === null || _a === void 0 ? void 0 : _a.message) === null || _b === void 0 ? void 0 : _b.addr;
this.cms.resetChallengeMessage(userPublicAddress);
return [2 /*return*/];
return [2 /*return*/, this.cms.resetChallengeMessage(userPublicAddress)];
}

@@ -139,0 +138,0 @@ });

{
"name": "@fortmatic/admin",
"version": "0.0.1",
"version": "0.0.3",
"description": "Fortmatic Javascript Admin SDK",

@@ -5,0 +5,0 @@ "author": "Fortmatic <team@fortmatic.com> (https://fortmatic.com/)",

# Fortmatic Admin Javascript SDK
Fortmatic JavaScript SDK lets developers conveniently connect their web apps
to the Ethereum blockchain - allowing end-users to interact with their apps on
any modern browser, without requiring them to download any browser extensions or
mobile dApp browsers.
Fortmatic Admin JavaScript SDK lets developers secure endpoints in their Express-based NodeJS application via easy-to-use middleware.
## Documentation
See the [Developer Documentation](https://developers.fortmatic.com).
See the [Developer Documentation](https://docs.fortmatic.com).
## Installation
Integrating your NodeJS application with Fortmatic Auth will require our NPM package:
```zsh
npm install --save @fortmatic/admin
```
## Usage
Sign up or log in to your [Developer Dashboard](https://dashboard.fortmatic.com) to receive API keys that will allow your app to interact with the Ethereum blockchain through Fortmatic.
You can then integrate by simply replacing your web3 provider with Fortmatic
provider. Now instead of the MetaMask Chrome Extension opening, a Fortmatic
modal will open instead - requiring no extra user downloads, and works on all
modern desktop and mobile Chrome, Safari and Firefox browsers.
```jspx
import Fortmatic from 'fortmatic';
const Fortmatic = require('@fortmatic/admin');
// Create a Fortmatic Admin instance
const fm = new Fortmatic(‘YOUR_DEVELOPER_SECRET_KEY’);
// Create client and replace web3 provider
const fm = new Fortmatic('YOUR_API_KEY');
web3 = new Web3(fm.getProvider());
// Send transactions the way your are used to
web3.eth.sendTransaction({/* ... */});
// Apply middleware
app.use(fortmatic.expressMiddleware);
```

@@ -50,10 +50,10 @@ import ethSigUtil from 'eth-sig-util';

public async invalidateToken(DecentralizedAccessToken: string): Promise<any> {
public async invalidateToken(DecentralizedAccessToken: string): Promise<boolean> {
await this.validateToken(DecentralizedAccessToken);
const claim = this.decodeToken(DecentralizedAccessToken)[1];
const userPublicAddress = claim?.message?.addr;
this.cms.resetChallengeMessage(userPublicAddress);
return this.cms.resetChallengeMessage(userPublicAddress);
}
public invalidateTokenBySignerAddress(userPublicAddress: string): Promise<any> {
public invalidateTokenBySignerAddress(userPublicAddress: string): Promise<boolean> {
return this.cms.resetChallengeMessage(userPublicAddress);

@@ -60,0 +60,0 @@ }

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