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

@airgap/beacon-sdk

Package Overview
Dependencies
Maintainers
1
Versions
286
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@airgap/beacon-sdk - npm Package Compare versions

Comparing version 0.1.0-beta.0 to 0.1.0

dist/utils/check-permissions.d.ts

13

dist/clients/dapp-client/DAppClient.js

@@ -11,2 +11,3 @@ "use strict";

const beacon_message_events_1 = require("../../beacon-message-events");
const check_permissions_1 = require("../../utils/check-permissions");
const logger = new Logger_1.Logger('DAppClient');

@@ -100,12 +101,4 @@ class DAppClient extends __1.Client {

}
switch (type) {
case __1.BeaconMessageType.OperationRequest:
return accountInfo.scopes.some((permission) => permission === __1.PermissionScope.OPERATION_REQUEST);
case __1.BeaconMessageType.SignPayloadRequest:
return accountInfo.scopes.some((permission) => permission === __1.PermissionScope.SIGN);
case __1.BeaconMessageType.BroadcastRequest:
return true;
default:
return false;
}
const permissions = accountInfo.scopes;
return check_permissions_1.checkPermissions(type, permissions);
}

@@ -112,0 +105,0 @@ async requestPermissions(input) {

import { ConnectionContext } from '../../types/ConnectionContext';
import { Client, TransportType, PermissionRequest, AppMetadata, BeaconMessageType, PermissionScope, BeaconResponseInputMessage } from '../..';
import { Client, TransportType, PermissionRequest, AppMetadata, BeaconResponseInputMessage } from '../..';
import { BeaconRequestOutputMessage } from '../../types/beacon/messages/BeaconRequestOutputMessage';

@@ -14,3 +14,2 @@ import { WalletClientOptions } from './WalletClientOptions';

saveAppMetadata(message: PermissionRequest, connectionInfo: ConnectionContext): Promise<void>;
checkPermissions(type: BeaconMessageType, permissions: PermissionScope[]): Promise<boolean>;
connect(newMessageCallback: (message: BeaconRequestOutputMessage, connectionInfo: ConnectionContext) => void): Promise<boolean>;

@@ -17,0 +16,0 @@ respond(message: BeaconResponseInputMessage): Promise<void>;

@@ -28,15 +28,2 @@ "use strict";

// public async savePermission() {}
async checkPermissions(type, permissions) {
switch (type) {
case __1.BeaconMessageType.OperationRequest:
return permissions.some((permission) => permission === __1.PermissionScope.OPERATION_REQUEST);
case __1.BeaconMessageType.SignPayloadRequest:
return permissions.some((permission) => permission === __1.PermissionScope.SIGN);
case __1.BeaconMessageType.PermissionRequest:
case __1.BeaconMessageType.BroadcastRequest:
return true;
default:
return false;
}
}
async connect(newMessageCallback) {

@@ -43,0 +30,0 @@ this.handleResponse = async (message, connectionInfo) => {

@@ -1,2 +0,2 @@

export declare const SDK_VERSION = "0.1.0";
export declare const BEACON_VERSION = "0.1";
export declare const SDK_VERSION: string;
export declare const BEACON_VERSION: string;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SDK_VERSION = '0.1.0';
exports.BEACON_VERSION = '0.1'; // TODO: Update to 1 once we have the final release
exports.BEACON_VERSION = '1';
//# sourceMappingURL=constants.js.map

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

const emptyHandler = async (data) => {
logger.log('emptyHandler', `event ${event}`, data);
logger.log('emptyHandler', data);
};

@@ -63,0 +63,0 @@ exports.defaultEventCallbacks = {

@@ -30,6 +30,2 @@ "use strict";

MockWindow_1.myWindow.postMessage(message, '*');
setTimeout(() => {
resolve(false);
MockWindow_1.myWindow.removeEventListener('message', fn);
}, 100);
});

@@ -36,0 +32,0 @@ }

{
"name": "@airgap/beacon-sdk",
"version": "0.1.0-beta.0",
"version": "0.1.0",
"description": "The beacon-sdk is setup in a way to allow for p2p communication between wallets and dapps",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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