Socket
Socket
Sign inDemoInstall

@metamask/sdk-communication-layer

Package Overview
Dependencies
Maintainers
11
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@metamask/sdk-communication-layer - npm Package Compare versions

Comparing version 0.27.0 to 0.28.0

dist/browser/es/src/services/RemoteCommunication/MessageHandlers/handleWalletInitMessage.d.ts

9

CHANGELOG.md

@@ -9,2 +9,8 @@ # Changelog

## [0.28.0]
### Added
- feat: experimental deeplink protocoll ([#990](https://github.com/MetaMask/metamask-sdk.git/pull/990))
- feat: revert socket server changes ([#985](https://github.com/MetaMask/metamask-sdk.git/pull/985))
- feat: change the default value for 'dappId' to 'N/A' instead of an empty string ([#972](https://github.com/MetaMask/metamask-sdk.git/pull/972))
## [0.27.0]

@@ -239,3 +245,4 @@ ### Added

[Unreleased]: https://github.com/MetaMask/metamask-sdk/compare/@metamask/sdk-communication-layer@0.27.0...HEAD
[Unreleased]: https://github.com/MetaMask/metamask-sdk/compare/@metamask/sdk-communication-layer@0.28.0...HEAD
[0.28.0]: https://github.com/MetaMask/metamask-sdk/compare/@metamask/sdk-communication-layer@0.27.0...@metamask/sdk-communication-layer@0.28.0
[0.27.0]: https://github.com/MetaMask/metamask-sdk/compare/@metamask/sdk-communication-layer@0.26.4...@metamask/sdk-communication-layer@0.27.0

@@ -242,0 +249,0 @@ [0.26.4]: https://github.com/MetaMask/metamask-sdk/compare/@metamask/sdk-communication-layer@0.26.2...@metamask/sdk-communication-layer@0.26.4

4

dist/browser/es/src/index.d.ts

@@ -5,3 +5,3 @@ import { SendAnalytics, AnalyticsProps } from './Analytics';

import { RPCMethodCache, RPCMethodResult, SocketService } from './SocketService';
import { DEFAULT_SERVER_URL } from './config';
import { DEFAULT_SERVER_URL, DEFAULT_SESSION_TIMEOUT_MS } from './config';
import { AutoConnectOptions } from './types/AutoConnectOptions';

@@ -27,3 +27,3 @@ import { AutoConnectType } from './types/AutoConnectType';

export type { AutoConnectOptions, ChannelConfig, CommunicationLayerLoggingOptions, CommunicationLayerMessage, DappMetadata, DisconnectOptions, ECIESProps, KeyInfo, OriginatorInfo, RPCMethodCache, RPCMethodResult, RemoteCommunicationProps, ServiceStatus, StorageManager, StorageManagerProps, WalletInfo, AnalyticsProps, };
export { AutoConnectType, CommunicationLayerPreference, ConnectionStatus, DEFAULT_SERVER_URL, ECIES, EventType, MessageType, PlatformType, RemoteCommunication, KeyExchangeMessageType, SendAnalytics, SocketService, TrackingEvents, };
export { AutoConnectType, CommunicationLayerPreference, ConnectionStatus, DEFAULT_SERVER_URL, DEFAULT_SESSION_TIMEOUT_MS, ECIES, EventType, MessageType, PlatformType, RemoteCommunication, KeyExchangeMessageType, SendAnalytics, SocketService, TrackingEvents, };
//# sourceMappingURL=index.d.ts.map

@@ -78,2 +78,6 @@ import { EventEmitter2 } from 'eventemitter2';

/**
* Initialize the connection from the dapp side.
*/
initFromDappStorage(): Promise<void>;
/**
* Connect from the dapp using session persistence.

@@ -87,6 +91,7 @@ */

clean(): void;
connectToChannel({ channelId, withKeyExchange, }: {
connectToChannel({ channelId, withKeyExchange, authorized, }: {
channelId: string;
authorized?: boolean;
withKeyExchange?: boolean;
}): void;
}): Promise<void>;
sendMessage(message: CommunicationLayerMessage): Promise<void>;

@@ -126,2 +131,4 @@ testStorage(): Promise<void>;

resume(): void;
encrypt(data: string): string | undefined;
decrypt(data: string): string;
getChannelId(): string | undefined;

@@ -128,0 +135,0 @@ getRPCMethodTracker(): import("./SocketService").RPCMethodCache | undefined;

@@ -11,7 +11,8 @@ import { RemoteCommunicationState } from '../../../RemoteCommunication';

*/
export declare function connectToChannel({ channelId, withKeyExchange, state, }: {
export declare function connectToChannel({ channelId, withKeyExchange, authorized, state, }: {
channelId: string;
authorized?: boolean;
withKeyExchange?: boolean;
state: RemoteCommunicationState;
}): void;
}): Promise<void>;
//# sourceMappingURL=connectToChannel.d.ts.map

@@ -17,3 +17,3 @@ import { SocketService } from '../../../SocketService';

instance: SocketService;
}): void;
}): Promise<void>;
//# sourceMappingURL=connectToChannel.d.ts.map

@@ -10,3 +10,3 @@ import { SocketService } from '../../../SocketService';

*/
export declare const reconnectSocket: (instance: SocketService) => Promise<boolean | undefined>;
export declare const reconnectSocket: (instance: SocketService) => Promise<boolean>;
//# sourceMappingURL=reconnectSocket.d.ts.map
import { SocketService } from '../../../SocketService';
export declare function handleChannelConfig(instance: SocketService, channelId: string): (config: {
persistence: boolean;
walletKey: string;
}) => Promise<void>;
//# sourceMappingURL=handleChannelConfig.d.ts.map
import { EventEmitter2 } from 'eventemitter2';
import { Socket } from 'socket.io-client';
import { ECIESProps } from './ECIES';
import { ECIES, ECIESProps } from './ECIES';
import { KeyExchange } from './KeyExchange';

@@ -34,2 +34,3 @@ import { RemoteCommunication } from './RemoteCommunication';

context?: string;
eciesInstance?: ECIES;
withKeyExchange?: boolean;

@@ -64,3 +65,3 @@ communicationServerUrl: string;

createChannel(): Channel;
connectToChannel({ channelId, withKeyExchange, }: ConnectToChannelOptions): void;
connectToChannel({ channelId, withKeyExchange, authorized, }: ConnectToChannelOptions): Promise<void>;
getKeyInfo(): KeyInfo;

@@ -67,0 +68,0 @@ keyCheck(): void;

export interface ConnectToChannelOptions {
channelId: string;
withKeyExchange?: boolean;
authorized?: boolean;
}
//# sourceMappingURL=ConnectToChannelOptions.d.ts.map

@@ -5,2 +5,3 @@ export interface DappMetadata {

iconUrl?: string;
scheme?: string;
base64Icon?: string;

@@ -7,0 +8,0 @@ connector?: string;

@@ -8,2 +8,3 @@ export declare enum EventType {

JOIN_CHANNEL = "join_channel",
PUBLIC_KEY = "public_key",
CHANNEL_CREATED = "channel_created",

@@ -14,2 +15,3 @@ CLIENTS_CONNECTED = "clients_connected",

CLIENTS_READY = "clients_ready",
WALLET_INIT = "wallet_init",
CHANNEL_PERSISTENCE = "channel_persistence",

@@ -16,0 +18,0 @@ MESSAGE_ACK = "ack",

@@ -7,4 +7,5 @@ export declare enum KeyExchangeMessageType {

KEY_HANDSHAKE_ACK = "key_handshake_ACK",
KEY_HANDSHAKE_WALLET = "key_handshake_wallet",
KEY_HANDSHAKE_NONE = "none"
}
//# sourceMappingURL=KeyExchangeMessageType.d.ts.map

@@ -8,2 +8,3 @@ export declare enum MessageType {

WALLET_INFO = "wallet_info",
WALLET_INIT = "wallet_init",
ORIGINATOR_INFO = "originator_info",

@@ -10,0 +11,0 @@ PAUSE = "pause",

@@ -7,2 +7,3 @@ export interface OriginatorInfo {

icon?: string;
scheme?: string;
source?: string;

@@ -9,0 +10,0 @@ apiVersion?: string;

@@ -14,5 +14,7 @@ import { ChannelConfig } from './ChannelConfig';

persistChainId(chainId: string, context?: string): Promise<void>;
getPersistedChannelConfig(): Promise<ChannelConfig | undefined>;
getPersistedChannelConfig(options?: {
context?: string;
}): Promise<ChannelConfig | undefined>;
terminate(channelId: string): Promise<void>;
}
//# sourceMappingURL=StorageManager.d.ts.map

@@ -5,3 +5,3 @@ import { SendAnalytics, AnalyticsProps } from './Analytics';

import { RPCMethodCache, RPCMethodResult, SocketService } from './SocketService';
import { DEFAULT_SERVER_URL } from './config';
import { DEFAULT_SERVER_URL, DEFAULT_SESSION_TIMEOUT_MS } from './config';
import { AutoConnectOptions } from './types/AutoConnectOptions';

@@ -27,3 +27,3 @@ import { AutoConnectType } from './types/AutoConnectType';

export type { AutoConnectOptions, ChannelConfig, CommunicationLayerLoggingOptions, CommunicationLayerMessage, DappMetadata, DisconnectOptions, ECIESProps, KeyInfo, OriginatorInfo, RPCMethodCache, RPCMethodResult, RemoteCommunicationProps, ServiceStatus, StorageManager, StorageManagerProps, WalletInfo, AnalyticsProps, };
export { AutoConnectType, CommunicationLayerPreference, ConnectionStatus, DEFAULT_SERVER_URL, ECIES, EventType, MessageType, PlatformType, RemoteCommunication, KeyExchangeMessageType, SendAnalytics, SocketService, TrackingEvents, };
export { AutoConnectType, CommunicationLayerPreference, ConnectionStatus, DEFAULT_SERVER_URL, DEFAULT_SESSION_TIMEOUT_MS, ECIES, EventType, MessageType, PlatformType, RemoteCommunication, KeyExchangeMessageType, SendAnalytics, SocketService, TrackingEvents, };
//# sourceMappingURL=index.d.ts.map

@@ -78,2 +78,6 @@ import { EventEmitter2 } from 'eventemitter2';

/**
* Initialize the connection from the dapp side.
*/
initFromDappStorage(): Promise<void>;
/**
* Connect from the dapp using session persistence.

@@ -87,6 +91,7 @@ */

clean(): void;
connectToChannel({ channelId, withKeyExchange, }: {
connectToChannel({ channelId, withKeyExchange, authorized, }: {
channelId: string;
authorized?: boolean;
withKeyExchange?: boolean;
}): void;
}): Promise<void>;
sendMessage(message: CommunicationLayerMessage): Promise<void>;

@@ -126,2 +131,4 @@ testStorage(): Promise<void>;

resume(): void;
encrypt(data: string): string | undefined;
decrypt(data: string): string;
getChannelId(): string | undefined;

@@ -128,0 +135,0 @@ getRPCMethodTracker(): import("./SocketService").RPCMethodCache | undefined;

@@ -11,7 +11,8 @@ import { RemoteCommunicationState } from '../../../RemoteCommunication';

*/
export declare function connectToChannel({ channelId, withKeyExchange, state, }: {
export declare function connectToChannel({ channelId, withKeyExchange, authorized, state, }: {
channelId: string;
authorized?: boolean;
withKeyExchange?: boolean;
state: RemoteCommunicationState;
}): void;
}): Promise<void>;
//# sourceMappingURL=connectToChannel.d.ts.map

@@ -17,3 +17,3 @@ import { SocketService } from '../../../SocketService';

instance: SocketService;
}): void;
}): Promise<void>;
//# sourceMappingURL=connectToChannel.d.ts.map

@@ -10,3 +10,3 @@ import { SocketService } from '../../../SocketService';

*/
export declare const reconnectSocket: (instance: SocketService) => Promise<boolean | undefined>;
export declare const reconnectSocket: (instance: SocketService) => Promise<boolean>;
//# sourceMappingURL=reconnectSocket.d.ts.map
import { SocketService } from '../../../SocketService';
export declare function handleChannelConfig(instance: SocketService, channelId: string): (config: {
persistence: boolean;
walletKey: string;
}) => Promise<void>;
//# sourceMappingURL=handleChannelConfig.d.ts.map
import { EventEmitter2 } from 'eventemitter2';
import { Socket } from 'socket.io-client';
import { ECIESProps } from './ECIES';
import { ECIES, ECIESProps } from './ECIES';
import { KeyExchange } from './KeyExchange';

@@ -34,2 +34,3 @@ import { RemoteCommunication } from './RemoteCommunication';

context?: string;
eciesInstance?: ECIES;
withKeyExchange?: boolean;

@@ -64,3 +65,3 @@ communicationServerUrl: string;

createChannel(): Channel;
connectToChannel({ channelId, withKeyExchange, }: ConnectToChannelOptions): void;
connectToChannel({ channelId, withKeyExchange, authorized, }: ConnectToChannelOptions): Promise<void>;
getKeyInfo(): KeyInfo;

@@ -67,0 +68,0 @@ keyCheck(): void;

export interface ConnectToChannelOptions {
channelId: string;
withKeyExchange?: boolean;
authorized?: boolean;
}
//# sourceMappingURL=ConnectToChannelOptions.d.ts.map

@@ -5,2 +5,3 @@ export interface DappMetadata {

iconUrl?: string;
scheme?: string;
base64Icon?: string;

@@ -7,0 +8,0 @@ connector?: string;

@@ -8,2 +8,3 @@ export declare enum EventType {

JOIN_CHANNEL = "join_channel",
PUBLIC_KEY = "public_key",
CHANNEL_CREATED = "channel_created",

@@ -14,2 +15,3 @@ CLIENTS_CONNECTED = "clients_connected",

CLIENTS_READY = "clients_ready",
WALLET_INIT = "wallet_init",
CHANNEL_PERSISTENCE = "channel_persistence",

@@ -16,0 +18,0 @@ MESSAGE_ACK = "ack",

@@ -7,4 +7,5 @@ export declare enum KeyExchangeMessageType {

KEY_HANDSHAKE_ACK = "key_handshake_ACK",
KEY_HANDSHAKE_WALLET = "key_handshake_wallet",
KEY_HANDSHAKE_NONE = "none"
}
//# sourceMappingURL=KeyExchangeMessageType.d.ts.map

@@ -8,2 +8,3 @@ export declare enum MessageType {

WALLET_INFO = "wallet_info",
WALLET_INIT = "wallet_init",
ORIGINATOR_INFO = "originator_info",

@@ -10,0 +11,0 @@ PAUSE = "pause",

@@ -7,2 +7,3 @@ export interface OriginatorInfo {

icon?: string;
scheme?: string;
source?: string;

@@ -9,0 +10,0 @@ apiVersion?: string;

@@ -14,5 +14,7 @@ import { ChannelConfig } from './ChannelConfig';

persistChainId(chainId: string, context?: string): Promise<void>;
getPersistedChannelConfig(): Promise<ChannelConfig | undefined>;
getPersistedChannelConfig(options?: {
context?: string;
}): Promise<ChannelConfig | undefined>;
terminate(channelId: string): Promise<void>;
}
//# sourceMappingURL=StorageManager.d.ts.map

@@ -5,3 +5,3 @@ import { SendAnalytics, AnalyticsProps } from './Analytics';

import { RPCMethodCache, RPCMethodResult, SocketService } from './SocketService';
import { DEFAULT_SERVER_URL } from './config';
import { DEFAULT_SERVER_URL, DEFAULT_SESSION_TIMEOUT_MS } from './config';
import { AutoConnectOptions } from './types/AutoConnectOptions';

@@ -27,3 +27,3 @@ import { AutoConnectType } from './types/AutoConnectType';

export type { AutoConnectOptions, ChannelConfig, CommunicationLayerLoggingOptions, CommunicationLayerMessage, DappMetadata, DisconnectOptions, ECIESProps, KeyInfo, OriginatorInfo, RPCMethodCache, RPCMethodResult, RemoteCommunicationProps, ServiceStatus, StorageManager, StorageManagerProps, WalletInfo, AnalyticsProps, };
export { AutoConnectType, CommunicationLayerPreference, ConnectionStatus, DEFAULT_SERVER_URL, ECIES, EventType, MessageType, PlatformType, RemoteCommunication, KeyExchangeMessageType, SendAnalytics, SocketService, TrackingEvents, };
export { AutoConnectType, CommunicationLayerPreference, ConnectionStatus, DEFAULT_SERVER_URL, DEFAULT_SESSION_TIMEOUT_MS, ECIES, EventType, MessageType, PlatformType, RemoteCommunication, KeyExchangeMessageType, SendAnalytics, SocketService, TrackingEvents, };
//# sourceMappingURL=index.d.ts.map

@@ -78,2 +78,6 @@ import { EventEmitter2 } from 'eventemitter2';

/**
* Initialize the connection from the dapp side.
*/
initFromDappStorage(): Promise<void>;
/**
* Connect from the dapp using session persistence.

@@ -87,6 +91,7 @@ */

clean(): void;
connectToChannel({ channelId, withKeyExchange, }: {
connectToChannel({ channelId, withKeyExchange, authorized, }: {
channelId: string;
authorized?: boolean;
withKeyExchange?: boolean;
}): void;
}): Promise<void>;
sendMessage(message: CommunicationLayerMessage): Promise<void>;

@@ -126,2 +131,4 @@ testStorage(): Promise<void>;

resume(): void;
encrypt(data: string): string | undefined;
decrypt(data: string): string;
getChannelId(): string | undefined;

@@ -128,0 +135,0 @@ getRPCMethodTracker(): import("./SocketService").RPCMethodCache | undefined;

@@ -11,7 +11,8 @@ import { RemoteCommunicationState } from '../../../RemoteCommunication';

*/
export declare function connectToChannel({ channelId, withKeyExchange, state, }: {
export declare function connectToChannel({ channelId, withKeyExchange, authorized, state, }: {
channelId: string;
authorized?: boolean;
withKeyExchange?: boolean;
state: RemoteCommunicationState;
}): void;
}): Promise<void>;
//# sourceMappingURL=connectToChannel.d.ts.map

@@ -17,3 +17,3 @@ import { SocketService } from '../../../SocketService';

instance: SocketService;
}): void;
}): Promise<void>;
//# sourceMappingURL=connectToChannel.d.ts.map

@@ -10,3 +10,3 @@ import { SocketService } from '../../../SocketService';

*/
export declare const reconnectSocket: (instance: SocketService) => Promise<boolean | undefined>;
export declare const reconnectSocket: (instance: SocketService) => Promise<boolean>;
//# sourceMappingURL=reconnectSocket.d.ts.map
import { SocketService } from '../../../SocketService';
export declare function handleChannelConfig(instance: SocketService, channelId: string): (config: {
persistence: boolean;
walletKey: string;
}) => Promise<void>;
//# sourceMappingURL=handleChannelConfig.d.ts.map
import { EventEmitter2 } from 'eventemitter2';
import { Socket } from 'socket.io-client';
import { ECIESProps } from './ECIES';
import { ECIES, ECIESProps } from './ECIES';
import { KeyExchange } from './KeyExchange';

@@ -34,2 +34,3 @@ import { RemoteCommunication } from './RemoteCommunication';

context?: string;
eciesInstance?: ECIES;
withKeyExchange?: boolean;

@@ -64,3 +65,3 @@ communicationServerUrl: string;

createChannel(): Channel;
connectToChannel({ channelId, withKeyExchange, }: ConnectToChannelOptions): void;
connectToChannel({ channelId, withKeyExchange, authorized, }: ConnectToChannelOptions): Promise<void>;
getKeyInfo(): KeyInfo;

@@ -67,0 +68,0 @@ keyCheck(): void;

export interface ConnectToChannelOptions {
channelId: string;
withKeyExchange?: boolean;
authorized?: boolean;
}
//# sourceMappingURL=ConnectToChannelOptions.d.ts.map

@@ -5,2 +5,3 @@ export interface DappMetadata {

iconUrl?: string;
scheme?: string;
base64Icon?: string;

@@ -7,0 +8,0 @@ connector?: string;

@@ -8,2 +8,3 @@ export declare enum EventType {

JOIN_CHANNEL = "join_channel",
PUBLIC_KEY = "public_key",
CHANNEL_CREATED = "channel_created",

@@ -14,2 +15,3 @@ CLIENTS_CONNECTED = "clients_connected",

CLIENTS_READY = "clients_ready",
WALLET_INIT = "wallet_init",
CHANNEL_PERSISTENCE = "channel_persistence",

@@ -16,0 +18,0 @@ MESSAGE_ACK = "ack",

@@ -7,4 +7,5 @@ export declare enum KeyExchangeMessageType {

KEY_HANDSHAKE_ACK = "key_handshake_ACK",
KEY_HANDSHAKE_WALLET = "key_handshake_wallet",
KEY_HANDSHAKE_NONE = "none"
}
//# sourceMappingURL=KeyExchangeMessageType.d.ts.map

@@ -8,2 +8,3 @@ export declare enum MessageType {

WALLET_INFO = "wallet_info",
WALLET_INIT = "wallet_init",
ORIGINATOR_INFO = "originator_info",

@@ -10,0 +11,0 @@ PAUSE = "pause",

@@ -7,2 +7,3 @@ export interface OriginatorInfo {

icon?: string;
scheme?: string;
source?: string;

@@ -9,0 +10,0 @@ apiVersion?: string;

@@ -14,5 +14,7 @@ import { ChannelConfig } from './ChannelConfig';

persistChainId(chainId: string, context?: string): Promise<void>;
getPersistedChannelConfig(): Promise<ChannelConfig | undefined>;
getPersistedChannelConfig(options?: {
context?: string;
}): Promise<ChannelConfig | undefined>;
terminate(channelId: string): Promise<void>;
}
//# sourceMappingURL=StorageManager.d.ts.map

@@ -5,3 +5,3 @@ import { SendAnalytics, AnalyticsProps } from './Analytics';

import { RPCMethodCache, RPCMethodResult, SocketService } from './SocketService';
import { DEFAULT_SERVER_URL } from './config';
import { DEFAULT_SERVER_URL, DEFAULT_SESSION_TIMEOUT_MS } from './config';
import { AutoConnectOptions } from './types/AutoConnectOptions';

@@ -27,3 +27,3 @@ import { AutoConnectType } from './types/AutoConnectType';

export type { AutoConnectOptions, ChannelConfig, CommunicationLayerLoggingOptions, CommunicationLayerMessage, DappMetadata, DisconnectOptions, ECIESProps, KeyInfo, OriginatorInfo, RPCMethodCache, RPCMethodResult, RemoteCommunicationProps, ServiceStatus, StorageManager, StorageManagerProps, WalletInfo, AnalyticsProps, };
export { AutoConnectType, CommunicationLayerPreference, ConnectionStatus, DEFAULT_SERVER_URL, ECIES, EventType, MessageType, PlatformType, RemoteCommunication, KeyExchangeMessageType, SendAnalytics, SocketService, TrackingEvents, };
export { AutoConnectType, CommunicationLayerPreference, ConnectionStatus, DEFAULT_SERVER_URL, DEFAULT_SESSION_TIMEOUT_MS, ECIES, EventType, MessageType, PlatformType, RemoteCommunication, KeyExchangeMessageType, SendAnalytics, SocketService, TrackingEvents, };
//# sourceMappingURL=index.d.ts.map

@@ -78,2 +78,6 @@ import { EventEmitter2 } from 'eventemitter2';

/**
* Initialize the connection from the dapp side.
*/
initFromDappStorage(): Promise<void>;
/**
* Connect from the dapp using session persistence.

@@ -87,6 +91,7 @@ */

clean(): void;
connectToChannel({ channelId, withKeyExchange, }: {
connectToChannel({ channelId, withKeyExchange, authorized, }: {
channelId: string;
authorized?: boolean;
withKeyExchange?: boolean;
}): void;
}): Promise<void>;
sendMessage(message: CommunicationLayerMessage): Promise<void>;

@@ -126,2 +131,4 @@ testStorage(): Promise<void>;

resume(): void;
encrypt(data: string): string | undefined;
decrypt(data: string): string;
getChannelId(): string | undefined;

@@ -128,0 +135,0 @@ getRPCMethodTracker(): import("./SocketService").RPCMethodCache | undefined;

@@ -11,7 +11,8 @@ import { RemoteCommunicationState } from '../../../RemoteCommunication';

*/
export declare function connectToChannel({ channelId, withKeyExchange, state, }: {
export declare function connectToChannel({ channelId, withKeyExchange, authorized, state, }: {
channelId: string;
authorized?: boolean;
withKeyExchange?: boolean;
state: RemoteCommunicationState;
}): void;
}): Promise<void>;
//# sourceMappingURL=connectToChannel.d.ts.map

@@ -17,3 +17,3 @@ import { SocketService } from '../../../SocketService';

instance: SocketService;
}): void;
}): Promise<void>;
//# sourceMappingURL=connectToChannel.d.ts.map

@@ -10,3 +10,3 @@ import { SocketService } from '../../../SocketService';

*/
export declare const reconnectSocket: (instance: SocketService) => Promise<boolean | undefined>;
export declare const reconnectSocket: (instance: SocketService) => Promise<boolean>;
//# sourceMappingURL=reconnectSocket.d.ts.map
import { SocketService } from '../../../SocketService';
export declare function handleChannelConfig(instance: SocketService, channelId: string): (config: {
persistence: boolean;
walletKey: string;
}) => Promise<void>;
//# sourceMappingURL=handleChannelConfig.d.ts.map
import { EventEmitter2 } from 'eventemitter2';
import { Socket } from 'socket.io-client';
import { ECIESProps } from './ECIES';
import { ECIES, ECIESProps } from './ECIES';
import { KeyExchange } from './KeyExchange';

@@ -34,2 +34,3 @@ import { RemoteCommunication } from './RemoteCommunication';

context?: string;
eciesInstance?: ECIES;
withKeyExchange?: boolean;

@@ -64,3 +65,3 @@ communicationServerUrl: string;

createChannel(): Channel;
connectToChannel({ channelId, withKeyExchange, }: ConnectToChannelOptions): void;
connectToChannel({ channelId, withKeyExchange, authorized, }: ConnectToChannelOptions): Promise<void>;
getKeyInfo(): KeyInfo;

@@ -67,0 +68,0 @@ keyCheck(): void;

export interface ConnectToChannelOptions {
channelId: string;
withKeyExchange?: boolean;
authorized?: boolean;
}
//# sourceMappingURL=ConnectToChannelOptions.d.ts.map

@@ -5,2 +5,3 @@ export interface DappMetadata {

iconUrl?: string;
scheme?: string;
base64Icon?: string;

@@ -7,0 +8,0 @@ connector?: string;

@@ -8,2 +8,3 @@ export declare enum EventType {

JOIN_CHANNEL = "join_channel",
PUBLIC_KEY = "public_key",
CHANNEL_CREATED = "channel_created",

@@ -14,2 +15,3 @@ CLIENTS_CONNECTED = "clients_connected",

CLIENTS_READY = "clients_ready",
WALLET_INIT = "wallet_init",
CHANNEL_PERSISTENCE = "channel_persistence",

@@ -16,0 +18,0 @@ MESSAGE_ACK = "ack",

@@ -7,4 +7,5 @@ export declare enum KeyExchangeMessageType {

KEY_HANDSHAKE_ACK = "key_handshake_ACK",
KEY_HANDSHAKE_WALLET = "key_handshake_wallet",
KEY_HANDSHAKE_NONE = "none"
}
//# sourceMappingURL=KeyExchangeMessageType.d.ts.map

@@ -8,2 +8,3 @@ export declare enum MessageType {

WALLET_INFO = "wallet_info",
WALLET_INIT = "wallet_init",
ORIGINATOR_INFO = "originator_info",

@@ -10,0 +11,0 @@ PAUSE = "pause",

@@ -7,2 +7,3 @@ export interface OriginatorInfo {

icon?: string;
scheme?: string;
source?: string;

@@ -9,0 +10,0 @@ apiVersion?: string;

@@ -14,5 +14,7 @@ import { ChannelConfig } from './ChannelConfig';

persistChainId(chainId: string, context?: string): Promise<void>;
getPersistedChannelConfig(): Promise<ChannelConfig | undefined>;
getPersistedChannelConfig(options?: {
context?: string;
}): Promise<ChannelConfig | undefined>;
terminate(channelId: string): Promise<void>;
}
//# sourceMappingURL=StorageManager.d.ts.map

@@ -5,3 +5,3 @@ import { SendAnalytics, AnalyticsProps } from './Analytics';

import { RPCMethodCache, RPCMethodResult, SocketService } from './SocketService';
import { DEFAULT_SERVER_URL } from './config';
import { DEFAULT_SERVER_URL, DEFAULT_SESSION_TIMEOUT_MS } from './config';
import { AutoConnectOptions } from './types/AutoConnectOptions';

@@ -27,3 +27,3 @@ import { AutoConnectType } from './types/AutoConnectType';

export type { AutoConnectOptions, ChannelConfig, CommunicationLayerLoggingOptions, CommunicationLayerMessage, DappMetadata, DisconnectOptions, ECIESProps, KeyInfo, OriginatorInfo, RPCMethodCache, RPCMethodResult, RemoteCommunicationProps, ServiceStatus, StorageManager, StorageManagerProps, WalletInfo, AnalyticsProps, };
export { AutoConnectType, CommunicationLayerPreference, ConnectionStatus, DEFAULT_SERVER_URL, ECIES, EventType, MessageType, PlatformType, RemoteCommunication, KeyExchangeMessageType, SendAnalytics, SocketService, TrackingEvents, };
export { AutoConnectType, CommunicationLayerPreference, ConnectionStatus, DEFAULT_SERVER_URL, DEFAULT_SESSION_TIMEOUT_MS, ECIES, EventType, MessageType, PlatformType, RemoteCommunication, KeyExchangeMessageType, SendAnalytics, SocketService, TrackingEvents, };
//# sourceMappingURL=index.d.ts.map

@@ -78,2 +78,6 @@ import { EventEmitter2 } from 'eventemitter2';

/**
* Initialize the connection from the dapp side.
*/
initFromDappStorage(): Promise<void>;
/**
* Connect from the dapp using session persistence.

@@ -87,6 +91,7 @@ */

clean(): void;
connectToChannel({ channelId, withKeyExchange, }: {
connectToChannel({ channelId, withKeyExchange, authorized, }: {
channelId: string;
authorized?: boolean;
withKeyExchange?: boolean;
}): void;
}): Promise<void>;
sendMessage(message: CommunicationLayerMessage): Promise<void>;

@@ -126,2 +131,4 @@ testStorage(): Promise<void>;

resume(): void;
encrypt(data: string): string | undefined;
decrypt(data: string): string;
getChannelId(): string | undefined;

@@ -128,0 +135,0 @@ getRPCMethodTracker(): import("./SocketService").RPCMethodCache | undefined;

@@ -11,7 +11,8 @@ import { RemoteCommunicationState } from '../../../RemoteCommunication';

*/
export declare function connectToChannel({ channelId, withKeyExchange, state, }: {
export declare function connectToChannel({ channelId, withKeyExchange, authorized, state, }: {
channelId: string;
authorized?: boolean;
withKeyExchange?: boolean;
state: RemoteCommunicationState;
}): void;
}): Promise<void>;
//# sourceMappingURL=connectToChannel.d.ts.map

@@ -17,3 +17,3 @@ import { SocketService } from '../../../SocketService';

instance: SocketService;
}): void;
}): Promise<void>;
//# sourceMappingURL=connectToChannel.d.ts.map

@@ -10,3 +10,3 @@ import { SocketService } from '../../../SocketService';

*/
export declare const reconnectSocket: (instance: SocketService) => Promise<boolean | undefined>;
export declare const reconnectSocket: (instance: SocketService) => Promise<boolean>;
//# sourceMappingURL=reconnectSocket.d.ts.map
import { SocketService } from '../../../SocketService';
export declare function handleChannelConfig(instance: SocketService, channelId: string): (config: {
persistence: boolean;
walletKey: string;
}) => Promise<void>;
//# sourceMappingURL=handleChannelConfig.d.ts.map
import { EventEmitter2 } from 'eventemitter2';
import { Socket } from 'socket.io-client';
import { ECIESProps } from './ECIES';
import { ECIES, ECIESProps } from './ECIES';
import { KeyExchange } from './KeyExchange';

@@ -34,2 +34,3 @@ import { RemoteCommunication } from './RemoteCommunication';

context?: string;
eciesInstance?: ECIES;
withKeyExchange?: boolean;

@@ -64,3 +65,3 @@ communicationServerUrl: string;

createChannel(): Channel;
connectToChannel({ channelId, withKeyExchange, }: ConnectToChannelOptions): void;
connectToChannel({ channelId, withKeyExchange, authorized, }: ConnectToChannelOptions): Promise<void>;
getKeyInfo(): KeyInfo;

@@ -67,0 +68,0 @@ keyCheck(): void;

export interface ConnectToChannelOptions {
channelId: string;
withKeyExchange?: boolean;
authorized?: boolean;
}
//# sourceMappingURL=ConnectToChannelOptions.d.ts.map

@@ -5,2 +5,3 @@ export interface DappMetadata {

iconUrl?: string;
scheme?: string;
base64Icon?: string;

@@ -7,0 +8,0 @@ connector?: string;

@@ -8,2 +8,3 @@ export declare enum EventType {

JOIN_CHANNEL = "join_channel",
PUBLIC_KEY = "public_key",
CHANNEL_CREATED = "channel_created",

@@ -14,2 +15,3 @@ CLIENTS_CONNECTED = "clients_connected",

CLIENTS_READY = "clients_ready",
WALLET_INIT = "wallet_init",
CHANNEL_PERSISTENCE = "channel_persistence",

@@ -16,0 +18,0 @@ MESSAGE_ACK = "ack",

@@ -7,4 +7,5 @@ export declare enum KeyExchangeMessageType {

KEY_HANDSHAKE_ACK = "key_handshake_ACK",
KEY_HANDSHAKE_WALLET = "key_handshake_wallet",
KEY_HANDSHAKE_NONE = "none"
}
//# sourceMappingURL=KeyExchangeMessageType.d.ts.map

@@ -8,2 +8,3 @@ export declare enum MessageType {

WALLET_INFO = "wallet_info",
WALLET_INIT = "wallet_init",
ORIGINATOR_INFO = "originator_info",

@@ -10,0 +11,0 @@ PAUSE = "pause",

@@ -7,2 +7,3 @@ export interface OriginatorInfo {

icon?: string;
scheme?: string;
source?: string;

@@ -9,0 +10,0 @@ apiVersion?: string;

@@ -14,5 +14,7 @@ import { ChannelConfig } from './ChannelConfig';

persistChainId(chainId: string, context?: string): Promise<void>;
getPersistedChannelConfig(): Promise<ChannelConfig | undefined>;
getPersistedChannelConfig(options?: {
context?: string;
}): Promise<ChannelConfig | undefined>;
terminate(channelId: string): Promise<void>;
}
//# sourceMappingURL=StorageManager.d.ts.map

@@ -5,3 +5,3 @@ import { SendAnalytics, AnalyticsProps } from './Analytics';

import { RPCMethodCache, RPCMethodResult, SocketService } from './SocketService';
import { DEFAULT_SERVER_URL } from './config';
import { DEFAULT_SERVER_URL, DEFAULT_SESSION_TIMEOUT_MS } from './config';
import { AutoConnectOptions } from './types/AutoConnectOptions';

@@ -27,3 +27,3 @@ import { AutoConnectType } from './types/AutoConnectType';

export type { AutoConnectOptions, ChannelConfig, CommunicationLayerLoggingOptions, CommunicationLayerMessage, DappMetadata, DisconnectOptions, ECIESProps, KeyInfo, OriginatorInfo, RPCMethodCache, RPCMethodResult, RemoteCommunicationProps, ServiceStatus, StorageManager, StorageManagerProps, WalletInfo, AnalyticsProps, };
export { AutoConnectType, CommunicationLayerPreference, ConnectionStatus, DEFAULT_SERVER_URL, ECIES, EventType, MessageType, PlatformType, RemoteCommunication, KeyExchangeMessageType, SendAnalytics, SocketService, TrackingEvents, };
export { AutoConnectType, CommunicationLayerPreference, ConnectionStatus, DEFAULT_SERVER_URL, DEFAULT_SESSION_TIMEOUT_MS, ECIES, EventType, MessageType, PlatformType, RemoteCommunication, KeyExchangeMessageType, SendAnalytics, SocketService, TrackingEvents, };
//# sourceMappingURL=index.d.ts.map

@@ -78,2 +78,6 @@ import { EventEmitter2 } from 'eventemitter2';

/**
* Initialize the connection from the dapp side.
*/
initFromDappStorage(): Promise<void>;
/**
* Connect from the dapp using session persistence.

@@ -87,6 +91,7 @@ */

clean(): void;
connectToChannel({ channelId, withKeyExchange, }: {
connectToChannel({ channelId, withKeyExchange, authorized, }: {
channelId: string;
authorized?: boolean;
withKeyExchange?: boolean;
}): void;
}): Promise<void>;
sendMessage(message: CommunicationLayerMessage): Promise<void>;

@@ -126,2 +131,4 @@ testStorage(): Promise<void>;

resume(): void;
encrypt(data: string): string | undefined;
decrypt(data: string): string;
getChannelId(): string | undefined;

@@ -128,0 +135,0 @@ getRPCMethodTracker(): import("./SocketService").RPCMethodCache | undefined;

@@ -11,7 +11,8 @@ import { RemoteCommunicationState } from '../../../RemoteCommunication';

*/
export declare function connectToChannel({ channelId, withKeyExchange, state, }: {
export declare function connectToChannel({ channelId, withKeyExchange, authorized, state, }: {
channelId: string;
authorized?: boolean;
withKeyExchange?: boolean;
state: RemoteCommunicationState;
}): void;
}): Promise<void>;
//# sourceMappingURL=connectToChannel.d.ts.map

@@ -17,3 +17,3 @@ import { SocketService } from '../../../SocketService';

instance: SocketService;
}): void;
}): Promise<void>;
//# sourceMappingURL=connectToChannel.d.ts.map

@@ -10,3 +10,3 @@ import { SocketService } from '../../../SocketService';

*/
export declare const reconnectSocket: (instance: SocketService) => Promise<boolean | undefined>;
export declare const reconnectSocket: (instance: SocketService) => Promise<boolean>;
//# sourceMappingURL=reconnectSocket.d.ts.map
import { SocketService } from '../../../SocketService';
export declare function handleChannelConfig(instance: SocketService, channelId: string): (config: {
persistence: boolean;
walletKey: string;
}) => Promise<void>;
//# sourceMappingURL=handleChannelConfig.d.ts.map
import { EventEmitter2 } from 'eventemitter2';
import { Socket } from 'socket.io-client';
import { ECIESProps } from './ECIES';
import { ECIES, ECIESProps } from './ECIES';
import { KeyExchange } from './KeyExchange';

@@ -34,2 +34,3 @@ import { RemoteCommunication } from './RemoteCommunication';

context?: string;
eciesInstance?: ECIES;
withKeyExchange?: boolean;

@@ -64,3 +65,3 @@ communicationServerUrl: string;

createChannel(): Channel;
connectToChannel({ channelId, withKeyExchange, }: ConnectToChannelOptions): void;
connectToChannel({ channelId, withKeyExchange, authorized, }: ConnectToChannelOptions): Promise<void>;
getKeyInfo(): KeyInfo;

@@ -67,0 +68,0 @@ keyCheck(): void;

export interface ConnectToChannelOptions {
channelId: string;
withKeyExchange?: boolean;
authorized?: boolean;
}
//# sourceMappingURL=ConnectToChannelOptions.d.ts.map

@@ -5,2 +5,3 @@ export interface DappMetadata {

iconUrl?: string;
scheme?: string;
base64Icon?: string;

@@ -7,0 +8,0 @@ connector?: string;

@@ -8,2 +8,3 @@ export declare enum EventType {

JOIN_CHANNEL = "join_channel",
PUBLIC_KEY = "public_key",
CHANNEL_CREATED = "channel_created",

@@ -14,2 +15,3 @@ CLIENTS_CONNECTED = "clients_connected",

CLIENTS_READY = "clients_ready",
WALLET_INIT = "wallet_init",
CHANNEL_PERSISTENCE = "channel_persistence",

@@ -16,0 +18,0 @@ MESSAGE_ACK = "ack",

@@ -7,4 +7,5 @@ export declare enum KeyExchangeMessageType {

KEY_HANDSHAKE_ACK = "key_handshake_ACK",
KEY_HANDSHAKE_WALLET = "key_handshake_wallet",
KEY_HANDSHAKE_NONE = "none"
}
//# sourceMappingURL=KeyExchangeMessageType.d.ts.map

@@ -8,2 +8,3 @@ export declare enum MessageType {

WALLET_INFO = "wallet_info",
WALLET_INIT = "wallet_init",
ORIGINATOR_INFO = "originator_info",

@@ -10,0 +11,0 @@ PAUSE = "pause",

@@ -7,2 +7,3 @@ export interface OriginatorInfo {

icon?: string;
scheme?: string;
source?: string;

@@ -9,0 +10,0 @@ apiVersion?: string;

@@ -14,5 +14,7 @@ import { ChannelConfig } from './ChannelConfig';

persistChainId(chainId: string, context?: string): Promise<void>;
getPersistedChannelConfig(): Promise<ChannelConfig | undefined>;
getPersistedChannelConfig(options?: {
context?: string;
}): Promise<ChannelConfig | undefined>;
terminate(channelId: string): Promise<void>;
}
//# sourceMappingURL=StorageManager.d.ts.map
{
"name": "@metamask/sdk-communication-layer",
"version": "0.27.0",
"version": "0.28.0",
"description": "",

@@ -41,3 +41,3 @@ "homepage": "https://github.com/MetaMask/metamask-sdk#readme",

"test:coverage": "jest --coverage",
"test:ci": "jest --coverage --passWithNoTests --setupFilesAfterEnv ./jest-preload.js",
"test:ci": "jest --coverage --passWithNoTests --setupFilesAfterEnv ./jest-preload.js --testPathIgnorePatterns \"/e2e/\"",
"test:dev": "jest",

@@ -44,0 +44,0 @@ "watch": "rollup -c --bundleConfigAsCjs -w"

Sorry, the diff of this file is too big to display

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

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

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 too big to display

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

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

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 too big to display

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

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

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 too big to display

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

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

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 too big to display

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

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

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 too big to display

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

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

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