Socket
Socket
Sign inDemoInstall

@front-finance/link

Package Overview
Dependencies
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@front-finance/link - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

0

cjs/FrontConnection.d.ts
import { FrontOptions, FrontConnection } from './utils/types';
export declare const createFrontConnection: (options: FrontOptions) => FrontConnection;

@@ -0,0 +0,0 @@ "use strict";

export * from './utils/nonce';
export * from './utils/types';
export { createFrontConnection } from './FrontConnection';

@@ -0,0 +0,0 @@ "use strict";

export declare function generateAndSaveNonce(): Promise<string>;
export declare function validateNonce(nonce: string): Promise<boolean>;

@@ -0,0 +0,0 @@ "use strict";

import { FrontOptions } from './types';
export declare function removePopup(): void;
export declare function addPopup(iframeLink: string, options: FrontOptions): void;

13

cjs/utils/popup.js

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

function eventsListener(event) {
var _a, _b, _c, _d;
var _a, _b, _c, _d, _e;
switch (event.data.type) {

@@ -35,5 +35,10 @@ case 'brokerageAccountAccessToken': {

}
case 'transferFinished': {
var payload = event.data.payload;
(_c = currentOptions === null || currentOptions === void 0 ? void 0 : currentOptions.onTransferFinished) === null || _c === void 0 ? void 0 : _c.call(currentOptions, payload);
break;
}
case 'close':
case 'done': {
(_c = currentOptions === null || currentOptions === void 0 ? void 0 : currentOptions.onExit) === null || _c === void 0 ? void 0 : _c.call(currentOptions, event.data.message);
(_d = currentOptions === null || currentOptions === void 0 ? void 0 : currentOptions.onExit) === null || _d === void 0 ? void 0 : _d.call(currentOptions, event.data.message);
removePopup();

@@ -48,4 +53,4 @@ break;

var top_1 = screen.height / 2 - h / 2;
(_d = window
.open(event.data.link, '_blank', "popup,noopener,noreferrer,resizable,scrollbars,width=".concat(w, ",height=").concat(h, ",top=").concat(top_1, ",left=").concat(left))) === null || _d === void 0 ? void 0 : _d.focus();
(_e = window
.open(event.data.link, '_blank', "popup,noopener,noreferrer,resizable,scrollbars,width=".concat(w, ",height=").concat(h, ",top=").concat(top_1, ",left=").concat(left))) === null || _e === void 0 ? void 0 : _e.focus();
}

@@ -52,0 +57,0 @@ break;

import type { BrokerType } from '@front-finance/api';
export type EventType = 'brokerageAccountAccessToken' | 'delayedAuthentication' | 'close' | 'done' | 'loaded' | 'oauthLinkOpen';
export type EventType = 'brokerageAccountAccessToken' | 'delayedAuthentication' | 'close' | 'done' | 'loaded' | 'oauthLinkOpen' | 'transferFinished';
export interface FrontConnection {

@@ -48,2 +48,16 @@ openLink: (authLink: string) => Promise<void>;

}
export interface TransferFinishedSuccessPayload {
status: 'success';
txId: string;
fromAddress: string;
toAddress: string;
symbol: string;
amount: number;
networkId: string;
}
export interface TransferFinishedErrorPayload {
status: 'error';
errorMessage: string;
}
export type TransferFinishedPayload = TransferFinishedSuccessPayload | TransferFinishedErrorPayload;
export interface FrontOptions {

@@ -53,2 +67,3 @@ clientId: string;

onExit?: (error?: string) => void;
onTransferFinished?: (payload: TransferFinishedPayload) => void;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
import { FrontOptions, FrontConnection } from './utils/types';
export declare const createFrontConnection: (options: FrontOptions) => FrontConnection;

@@ -0,0 +0,0 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

export * from './utils/nonce';
export * from './utils/types';
export { createFrontConnection } from './FrontConnection';
export * from './utils/nonce';
export * from './utils/types';
export { createFrontConnection } from './FrontConnection';
{
"name": "@front-finance/link",
"version": "1.0.6",
"version": "1.0.7",
"description": "Front Finance accounts connection client lib",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -105,7 +105,8 @@ # @front-finance/link

| key | type | description |
| ------------------- | ------------------------------------------------------ | ---------------------------------------------------------- |
| `clientId` | `string` | Keys from https://dashboard.getfront.com/company/keys page |
| `onBrokerConnected` | `(payload: FrontPayload) => void` | Callback called when users connects their accounts |
| `onExit` | `((error?: string \| undefined) => void) \| undefined` | Called if connection not happened |
| key | type | description |
| -------------------- | ------------------------------------------------------ | ---------------------------------------------------------- |
| `clientId` | `string` | Keys from https://dashboard.getfront.com/company/keys page |
| `onBrokerConnected` | `(payload: FrontPayload) => void` | Callback called when users connects their accounts |
| `onExit` | `((error?: string \| undefined) => void) \| undefined` | Called if connection not happened |
| `onTransferFinished` | `(payload: TransferFinishedPayload) => void` | Callback called when a crypto transfer is executed |

@@ -112,0 +113,0 @@ #### `createFrontConnection` return value

export declare function generateAndSaveNonce(): Promise<string>;
export declare function validateNonce(nonce: string): Promise<boolean>;

@@ -0,0 +0,0 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

import { FrontOptions } from './types';
export declare function removePopup(): void;
export declare function addPopup(iframeLink: string, options: FrontOptions): void;

@@ -15,3 +15,3 @@ var popupId = 'front-link-popup';

function eventsListener(event) {
var _a, _b, _c, _d;
var _a, _b, _c, _d, _e;
switch (event.data.type) {

@@ -32,5 +32,10 @@ case 'brokerageAccountAccessToken': {

}
case 'transferFinished': {
var payload = event.data.payload;
(_c = currentOptions === null || currentOptions === void 0 ? void 0 : currentOptions.onTransferFinished) === null || _c === void 0 ? void 0 : _c.call(currentOptions, payload);
break;
}
case 'close':
case 'done': {
(_c = currentOptions === null || currentOptions === void 0 ? void 0 : currentOptions.onExit) === null || _c === void 0 ? void 0 : _c.call(currentOptions, event.data.message);
(_d = currentOptions === null || currentOptions === void 0 ? void 0 : currentOptions.onExit) === null || _d === void 0 ? void 0 : _d.call(currentOptions, event.data.message);
removePopup();

@@ -45,4 +50,4 @@ break;

var top_1 = screen.height / 2 - h / 2;
(_d = window
.open(event.data.link, '_blank', "popup,noopener,noreferrer,resizable,scrollbars,width=".concat(w, ",height=").concat(h, ",top=").concat(top_1, ",left=").concat(left))) === null || _d === void 0 ? void 0 : _d.focus();
(_e = window
.open(event.data.link, '_blank', "popup,noopener,noreferrer,resizable,scrollbars,width=".concat(w, ",height=").concat(h, ",top=").concat(top_1, ",left=").concat(left))) === null || _e === void 0 ? void 0 : _e.focus();
}

@@ -49,0 +54,0 @@ break;

import type { BrokerType } from '@front-finance/api';
export type EventType = 'brokerageAccountAccessToken' | 'delayedAuthentication' | 'close' | 'done' | 'loaded' | 'oauthLinkOpen';
export type EventType = 'brokerageAccountAccessToken' | 'delayedAuthentication' | 'close' | 'done' | 'loaded' | 'oauthLinkOpen' | 'transferFinished';
export interface FrontConnection {

@@ -48,2 +48,16 @@ openLink: (authLink: string) => Promise<void>;

}
export interface TransferFinishedSuccessPayload {
status: 'success';
txId: string;
fromAddress: string;
toAddress: string;
symbol: string;
amount: number;
networkId: string;
}
export interface TransferFinishedErrorPayload {
status: 'error';
errorMessage: string;
}
export type TransferFinishedPayload = TransferFinishedSuccessPayload | TransferFinishedErrorPayload;
export interface FrontOptions {

@@ -53,2 +67,3 @@ clientId: string;

onExit?: (error?: string) => void;
onTransferFinished?: (payload: TransferFinishedPayload) => void;
}
export {};
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