@metamask/sdk-communication-layer
Advanced tools
Comparing version 0.18.5 to 0.19.0
@@ -9,2 +9,3 @@ export declare const DEFAULT_SERVER_URL = "https://metamask-sdk.api.cx.metamask.io/"; | ||
export declare const MAX_RPC_WAIT_TIME: number; | ||
export declare const PROTOCOL_VERSION = 2; | ||
export declare const RPC_METHODS: { | ||
@@ -11,0 +12,0 @@ METAMASK_GETPROVIDERSTATE: string; |
@@ -6,3 +6,3 @@ /** | ||
debug?: boolean; | ||
pkey?: string; | ||
privateKey?: string; | ||
} | ||
@@ -9,0 +9,0 @@ /** |
import { EventEmitter2 } from 'eventemitter2'; | ||
import { ECIESProps } from './ECIES'; | ||
import { CommunicationLayer } from './types/CommunicationLayer'; | ||
import { SocketService } from './SocketService'; | ||
import { CommunicationLayerMessage } from './types/CommunicationLayerMessage'; | ||
@@ -9,3 +9,3 @@ import { KeyExchangeMessageType } from './types/KeyExchangeMessageType'; | ||
export interface KeyExchangeProps { | ||
communicationLayer: CommunicationLayer; | ||
communicationLayer: SocketService; | ||
otherPublicKey?: string; | ||
@@ -38,2 +38,6 @@ sendPublicKey: boolean; | ||
checkStep(stepList: string[]): void; | ||
setRelayPersistence({ localKey, otherKey, }: { | ||
localKey: string; | ||
otherKey: string; | ||
}): void; | ||
setKeysExchanged(keysExchanged: boolean): void; | ||
@@ -40,0 +44,0 @@ areKeysExchanged(): boolean; |
import { EventEmitter2 } from 'eventemitter2'; | ||
import { ECIESProps } from './ECIES'; | ||
import { SocketService } from './SocketService'; | ||
import { AutoConnectOptions } from './types/AutoConnectOptions'; | ||
import { ChannelConfig } from './types/ChannelConfig'; | ||
import { CommunicationLayer } from './types/CommunicationLayer'; | ||
import { CommunicationLayerMessage } from './types/CommunicationLayerMessage'; | ||
@@ -22,3 +22,6 @@ import { CommunicationLayerPreference } from './types/CommunicationLayerPreference'; | ||
otherPublicKey?: string; | ||
protocolVersion?: number; | ||
privateKey?: string; | ||
reconnect?: boolean; | ||
relayPersistence?: boolean; | ||
dappMetadata?: DappMetadataWithSource; | ||
@@ -41,3 +44,7 @@ walletInfo?: WalletInfo; | ||
paused: boolean; | ||
relayPersistence?: boolean; | ||
otherPublicKey?: string; | ||
protocolVersion: number; | ||
privateKey?: string; | ||
terminated: boolean; | ||
transports?: string[]; | ||
@@ -49,3 +56,4 @@ platformType: PlatformType | MetaMaskMobile; | ||
walletInfo?: WalletInfo; | ||
communicationLayer?: CommunicationLayer; | ||
persist?: boolean; | ||
communicationLayer?: SocketService; | ||
originatorInfo?: OriginatorInfo; | ||
@@ -70,3 +78,3 @@ originatorInfoSent: boolean; | ||
state: RemoteCommunicationState; | ||
constructor({ platformType, communicationLayerPreference, otherPublicKey, reconnect, walletInfo, dappMetadata, transports, context, ecies, analytics, storage, sdkVersion, communicationServerUrl, logging, autoConnect, }: RemoteCommunicationProps); | ||
constructor({ platformType, communicationLayerPreference, otherPublicKey, reconnect, walletInfo, dappMetadata, protocolVersion, transports, context, relayPersistence, ecies, analytics, storage, sdkVersion, communicationServerUrl, logging, autoConnect, }: RemoteCommunicationProps); | ||
private initCommunicationLayer; | ||
@@ -82,3 +90,6 @@ /** | ||
clean(): void; | ||
connectToChannel(channelId: string, withKeyExchange?: boolean): void; | ||
connectToChannel({ channelId, withKeyExchange, }: { | ||
channelId: string; | ||
withKeyExchange?: boolean; | ||
}): void; | ||
sendMessage(message: CommunicationLayerMessage): Promise<void>; | ||
@@ -101,7 +112,10 @@ testStorage(): Promise<void>; | ||
isPaused(): boolean; | ||
getCommunicationLayer(): CommunicationLayer | undefined; | ||
getCommunicationLayer(): SocketService | undefined; | ||
ping(): void; | ||
testLogger(): void; | ||
keyCheck(): void; | ||
setConnectionStatus(connectionStatus: ConnectionStatus): void; | ||
emitServiceStatusEvent(): void; | ||
emitServiceStatusEvent(_?: { | ||
context?: string; | ||
}): void; | ||
getConnectionStatus(): ConnectionStatus; | ||
@@ -114,2 +128,3 @@ getServiceStatus(): ServiceStatus; | ||
getVersion(): string; | ||
hasRelayPersistence(): boolean; | ||
resume(): void; | ||
@@ -116,0 +131,0 @@ getChannelId(): string | undefined; |
@@ -10,7 +10,11 @@ import { SocketService } from '../../../SocketService'; | ||
*/ | ||
export declare function handleMessage(instance: SocketService, channelId: string): ({ id, message, error, }: { | ||
export declare function handleMessage(instance: SocketService, channelId: string): (rawMsg: { | ||
id: string; | ||
message: any; | ||
ackId?: string | undefined; | ||
message: string | { | ||
[key: string]: any; | ||
type: string; | ||
}; | ||
error?: any; | ||
}) => void; | ||
//# sourceMappingURL=handleMessage.d.ts.map |
@@ -5,2 +5,3 @@ import { EventEmitter2 } from 'eventemitter2'; | ||
import { KeyExchange } from './KeyExchange'; | ||
import { RemoteCommunication } from './RemoteCommunication'; | ||
import { Channel } from './types/Channel'; | ||
@@ -14,3 +15,2 @@ import { CommunicationLayer } from './types/CommunicationLayer'; | ||
import { CommunicationLayerLoggingOptions } from './types/LoggingOptions'; | ||
import { RemoteCommunication } from './RemoteCommunication'; | ||
export interface SocketServiceProps { | ||
@@ -65,3 +65,3 @@ communicationLayerPreference: CommunicationLayerPreference; | ||
createChannel(): Channel; | ||
connectToChannel({ channelId, isOriginator, withKeyExchange, }: ConnectToChannelOptions): void; | ||
connectToChannel({ channelId, withKeyExchange, }: ConnectToChannelOptions): void; | ||
getKeyInfo(): KeyInfo; | ||
@@ -68,0 +68,0 @@ keyCheck(): void; |
export interface ChannelConfig { | ||
channelId: string; | ||
validUntil: number; | ||
otherKey?: string; | ||
localKey?: string; | ||
relayPersistence?: boolean; | ||
/** | ||
@@ -5,0 +8,0 @@ * lastActive: ms value of the last time connection was ready CLIENTS_READY event. |
@@ -13,2 +13,3 @@ import { KeyExchangeMessageType } from './KeyExchangeMessageType'; | ||
offer?: RTCSessionDescriptionInit; | ||
v?: number; | ||
otpAnswer?: number; | ||
@@ -15,0 +16,0 @@ candidate?: unknown; |
export interface ConnectToChannelOptions { | ||
channelId: string; | ||
isOriginator?: boolean; | ||
withKeyExchange?: boolean; | ||
} | ||
//# sourceMappingURL=ConnectToChannelOptions.d.ts.map |
@@ -13,2 +13,4 @@ export declare enum EventType { | ||
CLIENTS_READY = "clients_ready", | ||
CHANNEL_PERSISTENCE = "channel_persistence", | ||
MESSAGE_ACK = "ack", | ||
SOCKET_DISCONNECTED = "socket_disconnected", | ||
@@ -15,0 +17,0 @@ SOCKET_RECONNECT = "socket_reconnect", |
@@ -9,6 +9,10 @@ import { ChannelConfig } from './ChannelConfig'; | ||
export interface StorageManager { | ||
persistChannelConfig(channelConfig: ChannelConfig): Promise<void>; | ||
getPersistedChannelConfig(channelId: string): Promise<ChannelConfig | undefined>; | ||
persistChannelConfig(channelConfig: ChannelConfig, context?: string): Promise<void>; | ||
persistAccounts(accounts: string[], context?: string): Promise<void>; | ||
getCachedAccounts(): Promise<string[]>; | ||
getCachedChainId(): Promise<string | undefined>; | ||
persistChainId(chainId: string, context?: string): Promise<void>; | ||
getPersistedChannelConfig(): Promise<ChannelConfig | undefined>; | ||
terminate(channelId: string): Promise<void>; | ||
} | ||
//# sourceMappingURL=StorageManager.d.ts.map |
@@ -9,2 +9,3 @@ export declare const DEFAULT_SERVER_URL = "https://metamask-sdk.api.cx.metamask.io/"; | ||
export declare const MAX_RPC_WAIT_TIME: number; | ||
export declare const PROTOCOL_VERSION = 2; | ||
export declare const RPC_METHODS: { | ||
@@ -11,0 +12,0 @@ METAMASK_GETPROVIDERSTATE: string; |
@@ -6,3 +6,3 @@ /** | ||
debug?: boolean; | ||
pkey?: string; | ||
privateKey?: string; | ||
} | ||
@@ -9,0 +9,0 @@ /** |
import { EventEmitter2 } from 'eventemitter2'; | ||
import { ECIESProps } from './ECIES'; | ||
import { CommunicationLayer } from './types/CommunicationLayer'; | ||
import { SocketService } from './SocketService'; | ||
import { CommunicationLayerMessage } from './types/CommunicationLayerMessage'; | ||
@@ -9,3 +9,3 @@ import { KeyExchangeMessageType } from './types/KeyExchangeMessageType'; | ||
export interface KeyExchangeProps { | ||
communicationLayer: CommunicationLayer; | ||
communicationLayer: SocketService; | ||
otherPublicKey?: string; | ||
@@ -38,2 +38,6 @@ sendPublicKey: boolean; | ||
checkStep(stepList: string[]): void; | ||
setRelayPersistence({ localKey, otherKey, }: { | ||
localKey: string; | ||
otherKey: string; | ||
}): void; | ||
setKeysExchanged(keysExchanged: boolean): void; | ||
@@ -40,0 +44,0 @@ areKeysExchanged(): boolean; |
import { EventEmitter2 } from 'eventemitter2'; | ||
import { ECIESProps } from './ECIES'; | ||
import { SocketService } from './SocketService'; | ||
import { AutoConnectOptions } from './types/AutoConnectOptions'; | ||
import { ChannelConfig } from './types/ChannelConfig'; | ||
import { CommunicationLayer } from './types/CommunicationLayer'; | ||
import { CommunicationLayerMessage } from './types/CommunicationLayerMessage'; | ||
@@ -22,3 +22,6 @@ import { CommunicationLayerPreference } from './types/CommunicationLayerPreference'; | ||
otherPublicKey?: string; | ||
protocolVersion?: number; | ||
privateKey?: string; | ||
reconnect?: boolean; | ||
relayPersistence?: boolean; | ||
dappMetadata?: DappMetadataWithSource; | ||
@@ -41,3 +44,7 @@ walletInfo?: WalletInfo; | ||
paused: boolean; | ||
relayPersistence?: boolean; | ||
otherPublicKey?: string; | ||
protocolVersion: number; | ||
privateKey?: string; | ||
terminated: boolean; | ||
transports?: string[]; | ||
@@ -49,3 +56,4 @@ platformType: PlatformType | MetaMaskMobile; | ||
walletInfo?: WalletInfo; | ||
communicationLayer?: CommunicationLayer; | ||
persist?: boolean; | ||
communicationLayer?: SocketService; | ||
originatorInfo?: OriginatorInfo; | ||
@@ -70,3 +78,3 @@ originatorInfoSent: boolean; | ||
state: RemoteCommunicationState; | ||
constructor({ platformType, communicationLayerPreference, otherPublicKey, reconnect, walletInfo, dappMetadata, transports, context, ecies, analytics, storage, sdkVersion, communicationServerUrl, logging, autoConnect, }: RemoteCommunicationProps); | ||
constructor({ platformType, communicationLayerPreference, otherPublicKey, reconnect, walletInfo, dappMetadata, protocolVersion, transports, context, relayPersistence, ecies, analytics, storage, sdkVersion, communicationServerUrl, logging, autoConnect, }: RemoteCommunicationProps); | ||
private initCommunicationLayer; | ||
@@ -82,3 +90,6 @@ /** | ||
clean(): void; | ||
connectToChannel(channelId: string, withKeyExchange?: boolean): void; | ||
connectToChannel({ channelId, withKeyExchange, }: { | ||
channelId: string; | ||
withKeyExchange?: boolean; | ||
}): void; | ||
sendMessage(message: CommunicationLayerMessage): Promise<void>; | ||
@@ -101,7 +112,10 @@ testStorage(): Promise<void>; | ||
isPaused(): boolean; | ||
getCommunicationLayer(): CommunicationLayer | undefined; | ||
getCommunicationLayer(): SocketService | undefined; | ||
ping(): void; | ||
testLogger(): void; | ||
keyCheck(): void; | ||
setConnectionStatus(connectionStatus: ConnectionStatus): void; | ||
emitServiceStatusEvent(): void; | ||
emitServiceStatusEvent(_?: { | ||
context?: string; | ||
}): void; | ||
getConnectionStatus(): ConnectionStatus; | ||
@@ -114,2 +128,3 @@ getServiceStatus(): ServiceStatus; | ||
getVersion(): string; | ||
hasRelayPersistence(): boolean; | ||
resume(): void; | ||
@@ -116,0 +131,0 @@ getChannelId(): string | undefined; |
@@ -10,7 +10,11 @@ import { SocketService } from '../../../SocketService'; | ||
*/ | ||
export declare function handleMessage(instance: SocketService, channelId: string): ({ id, message, error, }: { | ||
export declare function handleMessage(instance: SocketService, channelId: string): (rawMsg: { | ||
id: string; | ||
message: any; | ||
ackId?: string | undefined; | ||
message: string | { | ||
[key: string]: any; | ||
type: string; | ||
}; | ||
error?: any; | ||
}) => void; | ||
//# sourceMappingURL=handleMessage.d.ts.map |
@@ -5,2 +5,3 @@ import { EventEmitter2 } from 'eventemitter2'; | ||
import { KeyExchange } from './KeyExchange'; | ||
import { RemoteCommunication } from './RemoteCommunication'; | ||
import { Channel } from './types/Channel'; | ||
@@ -14,3 +15,2 @@ import { CommunicationLayer } from './types/CommunicationLayer'; | ||
import { CommunicationLayerLoggingOptions } from './types/LoggingOptions'; | ||
import { RemoteCommunication } from './RemoteCommunication'; | ||
export interface SocketServiceProps { | ||
@@ -65,3 +65,3 @@ communicationLayerPreference: CommunicationLayerPreference; | ||
createChannel(): Channel; | ||
connectToChannel({ channelId, isOriginator, withKeyExchange, }: ConnectToChannelOptions): void; | ||
connectToChannel({ channelId, withKeyExchange, }: ConnectToChannelOptions): void; | ||
getKeyInfo(): KeyInfo; | ||
@@ -68,0 +68,0 @@ keyCheck(): void; |
export interface ChannelConfig { | ||
channelId: string; | ||
validUntil: number; | ||
otherKey?: string; | ||
localKey?: string; | ||
relayPersistence?: boolean; | ||
/** | ||
@@ -5,0 +8,0 @@ * lastActive: ms value of the last time connection was ready CLIENTS_READY event. |
@@ -13,2 +13,3 @@ import { KeyExchangeMessageType } from './KeyExchangeMessageType'; | ||
offer?: RTCSessionDescriptionInit; | ||
v?: number; | ||
otpAnswer?: number; | ||
@@ -15,0 +16,0 @@ candidate?: unknown; |
export interface ConnectToChannelOptions { | ||
channelId: string; | ||
isOriginator?: boolean; | ||
withKeyExchange?: boolean; | ||
} | ||
//# sourceMappingURL=ConnectToChannelOptions.d.ts.map |
@@ -13,2 +13,4 @@ export declare enum EventType { | ||
CLIENTS_READY = "clients_ready", | ||
CHANNEL_PERSISTENCE = "channel_persistence", | ||
MESSAGE_ACK = "ack", | ||
SOCKET_DISCONNECTED = "socket_disconnected", | ||
@@ -15,0 +17,0 @@ SOCKET_RECONNECT = "socket_reconnect", |
@@ -9,6 +9,10 @@ import { ChannelConfig } from './ChannelConfig'; | ||
export interface StorageManager { | ||
persistChannelConfig(channelConfig: ChannelConfig): Promise<void>; | ||
getPersistedChannelConfig(channelId: string): Promise<ChannelConfig | undefined>; | ||
persistChannelConfig(channelConfig: ChannelConfig, context?: string): Promise<void>; | ||
persistAccounts(accounts: string[], context?: string): Promise<void>; | ||
getCachedAccounts(): Promise<string[]>; | ||
getCachedChainId(): Promise<string | undefined>; | ||
persistChainId(chainId: string, context?: string): Promise<void>; | ||
getPersistedChannelConfig(): Promise<ChannelConfig | undefined>; | ||
terminate(channelId: string): Promise<void>; | ||
} | ||
//# sourceMappingURL=StorageManager.d.ts.map |
@@ -9,2 +9,3 @@ export declare const DEFAULT_SERVER_URL = "https://metamask-sdk.api.cx.metamask.io/"; | ||
export declare const MAX_RPC_WAIT_TIME: number; | ||
export declare const PROTOCOL_VERSION = 2; | ||
export declare const RPC_METHODS: { | ||
@@ -11,0 +12,0 @@ METAMASK_GETPROVIDERSTATE: string; |
@@ -6,3 +6,3 @@ /** | ||
debug?: boolean; | ||
pkey?: string; | ||
privateKey?: string; | ||
} | ||
@@ -9,0 +9,0 @@ /** |
import { EventEmitter2 } from 'eventemitter2'; | ||
import { ECIESProps } from './ECIES'; | ||
import { CommunicationLayer } from './types/CommunicationLayer'; | ||
import { SocketService } from './SocketService'; | ||
import { CommunicationLayerMessage } from './types/CommunicationLayerMessage'; | ||
@@ -9,3 +9,3 @@ import { KeyExchangeMessageType } from './types/KeyExchangeMessageType'; | ||
export interface KeyExchangeProps { | ||
communicationLayer: CommunicationLayer; | ||
communicationLayer: SocketService; | ||
otherPublicKey?: string; | ||
@@ -38,2 +38,6 @@ sendPublicKey: boolean; | ||
checkStep(stepList: string[]): void; | ||
setRelayPersistence({ localKey, otherKey, }: { | ||
localKey: string; | ||
otherKey: string; | ||
}): void; | ||
setKeysExchanged(keysExchanged: boolean): void; | ||
@@ -40,0 +44,0 @@ areKeysExchanged(): boolean; |
import { EventEmitter2 } from 'eventemitter2'; | ||
import { ECIESProps } from './ECIES'; | ||
import { SocketService } from './SocketService'; | ||
import { AutoConnectOptions } from './types/AutoConnectOptions'; | ||
import { ChannelConfig } from './types/ChannelConfig'; | ||
import { CommunicationLayer } from './types/CommunicationLayer'; | ||
import { CommunicationLayerMessage } from './types/CommunicationLayerMessage'; | ||
@@ -22,3 +22,6 @@ import { CommunicationLayerPreference } from './types/CommunicationLayerPreference'; | ||
otherPublicKey?: string; | ||
protocolVersion?: number; | ||
privateKey?: string; | ||
reconnect?: boolean; | ||
relayPersistence?: boolean; | ||
dappMetadata?: DappMetadataWithSource; | ||
@@ -41,3 +44,7 @@ walletInfo?: WalletInfo; | ||
paused: boolean; | ||
relayPersistence?: boolean; | ||
otherPublicKey?: string; | ||
protocolVersion: number; | ||
privateKey?: string; | ||
terminated: boolean; | ||
transports?: string[]; | ||
@@ -49,3 +56,4 @@ platformType: PlatformType | MetaMaskMobile; | ||
walletInfo?: WalletInfo; | ||
communicationLayer?: CommunicationLayer; | ||
persist?: boolean; | ||
communicationLayer?: SocketService; | ||
originatorInfo?: OriginatorInfo; | ||
@@ -70,3 +78,3 @@ originatorInfoSent: boolean; | ||
state: RemoteCommunicationState; | ||
constructor({ platformType, communicationLayerPreference, otherPublicKey, reconnect, walletInfo, dappMetadata, transports, context, ecies, analytics, storage, sdkVersion, communicationServerUrl, logging, autoConnect, }: RemoteCommunicationProps); | ||
constructor({ platformType, communicationLayerPreference, otherPublicKey, reconnect, walletInfo, dappMetadata, protocolVersion, transports, context, relayPersistence, ecies, analytics, storage, sdkVersion, communicationServerUrl, logging, autoConnect, }: RemoteCommunicationProps); | ||
private initCommunicationLayer; | ||
@@ -82,3 +90,6 @@ /** | ||
clean(): void; | ||
connectToChannel(channelId: string, withKeyExchange?: boolean): void; | ||
connectToChannel({ channelId, withKeyExchange, }: { | ||
channelId: string; | ||
withKeyExchange?: boolean; | ||
}): void; | ||
sendMessage(message: CommunicationLayerMessage): Promise<void>; | ||
@@ -101,7 +112,10 @@ testStorage(): Promise<void>; | ||
isPaused(): boolean; | ||
getCommunicationLayer(): CommunicationLayer | undefined; | ||
getCommunicationLayer(): SocketService | undefined; | ||
ping(): void; | ||
testLogger(): void; | ||
keyCheck(): void; | ||
setConnectionStatus(connectionStatus: ConnectionStatus): void; | ||
emitServiceStatusEvent(): void; | ||
emitServiceStatusEvent(_?: { | ||
context?: string; | ||
}): void; | ||
getConnectionStatus(): ConnectionStatus; | ||
@@ -114,2 +128,3 @@ getServiceStatus(): ServiceStatus; | ||
getVersion(): string; | ||
hasRelayPersistence(): boolean; | ||
resume(): void; | ||
@@ -116,0 +131,0 @@ getChannelId(): string | undefined; |
@@ -10,7 +10,11 @@ import { SocketService } from '../../../SocketService'; | ||
*/ | ||
export declare function handleMessage(instance: SocketService, channelId: string): ({ id, message, error, }: { | ||
export declare function handleMessage(instance: SocketService, channelId: string): (rawMsg: { | ||
id: string; | ||
message: any; | ||
ackId?: string | undefined; | ||
message: string | { | ||
[key: string]: any; | ||
type: string; | ||
}; | ||
error?: any; | ||
}) => void; | ||
//# sourceMappingURL=handleMessage.d.ts.map |
@@ -5,2 +5,3 @@ import { EventEmitter2 } from 'eventemitter2'; | ||
import { KeyExchange } from './KeyExchange'; | ||
import { RemoteCommunication } from './RemoteCommunication'; | ||
import { Channel } from './types/Channel'; | ||
@@ -14,3 +15,2 @@ import { CommunicationLayer } from './types/CommunicationLayer'; | ||
import { CommunicationLayerLoggingOptions } from './types/LoggingOptions'; | ||
import { RemoteCommunication } from './RemoteCommunication'; | ||
export interface SocketServiceProps { | ||
@@ -65,3 +65,3 @@ communicationLayerPreference: CommunicationLayerPreference; | ||
createChannel(): Channel; | ||
connectToChannel({ channelId, isOriginator, withKeyExchange, }: ConnectToChannelOptions): void; | ||
connectToChannel({ channelId, withKeyExchange, }: ConnectToChannelOptions): void; | ||
getKeyInfo(): KeyInfo; | ||
@@ -68,0 +68,0 @@ keyCheck(): void; |
export interface ChannelConfig { | ||
channelId: string; | ||
validUntil: number; | ||
otherKey?: string; | ||
localKey?: string; | ||
relayPersistence?: boolean; | ||
/** | ||
@@ -5,0 +8,0 @@ * lastActive: ms value of the last time connection was ready CLIENTS_READY event. |
@@ -13,2 +13,3 @@ import { KeyExchangeMessageType } from './KeyExchangeMessageType'; | ||
offer?: RTCSessionDescriptionInit; | ||
v?: number; | ||
otpAnswer?: number; | ||
@@ -15,0 +16,0 @@ candidate?: unknown; |
export interface ConnectToChannelOptions { | ||
channelId: string; | ||
isOriginator?: boolean; | ||
withKeyExchange?: boolean; | ||
} | ||
//# sourceMappingURL=ConnectToChannelOptions.d.ts.map |
@@ -13,2 +13,4 @@ export declare enum EventType { | ||
CLIENTS_READY = "clients_ready", | ||
CHANNEL_PERSISTENCE = "channel_persistence", | ||
MESSAGE_ACK = "ack", | ||
SOCKET_DISCONNECTED = "socket_disconnected", | ||
@@ -15,0 +17,0 @@ SOCKET_RECONNECT = "socket_reconnect", |
@@ -9,6 +9,10 @@ import { ChannelConfig } from './ChannelConfig'; | ||
export interface StorageManager { | ||
persistChannelConfig(channelConfig: ChannelConfig): Promise<void>; | ||
getPersistedChannelConfig(channelId: string): Promise<ChannelConfig | undefined>; | ||
persistChannelConfig(channelConfig: ChannelConfig, context?: string): Promise<void>; | ||
persistAccounts(accounts: string[], context?: string): Promise<void>; | ||
getCachedAccounts(): Promise<string[]>; | ||
getCachedChainId(): Promise<string | undefined>; | ||
persistChainId(chainId: string, context?: string): Promise<void>; | ||
getPersistedChannelConfig(): Promise<ChannelConfig | undefined>; | ||
terminate(channelId: string): Promise<void>; | ||
} | ||
//# sourceMappingURL=StorageManager.d.ts.map |
@@ -9,2 +9,3 @@ export declare const DEFAULT_SERVER_URL = "https://metamask-sdk.api.cx.metamask.io/"; | ||
export declare const MAX_RPC_WAIT_TIME: number; | ||
export declare const PROTOCOL_VERSION = 2; | ||
export declare const RPC_METHODS: { | ||
@@ -11,0 +12,0 @@ METAMASK_GETPROVIDERSTATE: string; |
@@ -6,3 +6,3 @@ /** | ||
debug?: boolean; | ||
pkey?: string; | ||
privateKey?: string; | ||
} | ||
@@ -9,0 +9,0 @@ /** |
import { EventEmitter2 } from 'eventemitter2'; | ||
import { ECIESProps } from './ECIES'; | ||
import { CommunicationLayer } from './types/CommunicationLayer'; | ||
import { SocketService } from './SocketService'; | ||
import { CommunicationLayerMessage } from './types/CommunicationLayerMessage'; | ||
@@ -9,3 +9,3 @@ import { KeyExchangeMessageType } from './types/KeyExchangeMessageType'; | ||
export interface KeyExchangeProps { | ||
communicationLayer: CommunicationLayer; | ||
communicationLayer: SocketService; | ||
otherPublicKey?: string; | ||
@@ -38,2 +38,6 @@ sendPublicKey: boolean; | ||
checkStep(stepList: string[]): void; | ||
setRelayPersistence({ localKey, otherKey, }: { | ||
localKey: string; | ||
otherKey: string; | ||
}): void; | ||
setKeysExchanged(keysExchanged: boolean): void; | ||
@@ -40,0 +44,0 @@ areKeysExchanged(): boolean; |
import { EventEmitter2 } from 'eventemitter2'; | ||
import { ECIESProps } from './ECIES'; | ||
import { SocketService } from './SocketService'; | ||
import { AutoConnectOptions } from './types/AutoConnectOptions'; | ||
import { ChannelConfig } from './types/ChannelConfig'; | ||
import { CommunicationLayer } from './types/CommunicationLayer'; | ||
import { CommunicationLayerMessage } from './types/CommunicationLayerMessage'; | ||
@@ -22,3 +22,6 @@ import { CommunicationLayerPreference } from './types/CommunicationLayerPreference'; | ||
otherPublicKey?: string; | ||
protocolVersion?: number; | ||
privateKey?: string; | ||
reconnect?: boolean; | ||
relayPersistence?: boolean; | ||
dappMetadata?: DappMetadataWithSource; | ||
@@ -41,3 +44,7 @@ walletInfo?: WalletInfo; | ||
paused: boolean; | ||
relayPersistence?: boolean; | ||
otherPublicKey?: string; | ||
protocolVersion: number; | ||
privateKey?: string; | ||
terminated: boolean; | ||
transports?: string[]; | ||
@@ -49,3 +56,4 @@ platformType: PlatformType | MetaMaskMobile; | ||
walletInfo?: WalletInfo; | ||
communicationLayer?: CommunicationLayer; | ||
persist?: boolean; | ||
communicationLayer?: SocketService; | ||
originatorInfo?: OriginatorInfo; | ||
@@ -70,3 +78,3 @@ originatorInfoSent: boolean; | ||
state: RemoteCommunicationState; | ||
constructor({ platformType, communicationLayerPreference, otherPublicKey, reconnect, walletInfo, dappMetadata, transports, context, ecies, analytics, storage, sdkVersion, communicationServerUrl, logging, autoConnect, }: RemoteCommunicationProps); | ||
constructor({ platformType, communicationLayerPreference, otherPublicKey, reconnect, walletInfo, dappMetadata, protocolVersion, transports, context, relayPersistence, ecies, analytics, storage, sdkVersion, communicationServerUrl, logging, autoConnect, }: RemoteCommunicationProps); | ||
private initCommunicationLayer; | ||
@@ -82,3 +90,6 @@ /** | ||
clean(): void; | ||
connectToChannel(channelId: string, withKeyExchange?: boolean): void; | ||
connectToChannel({ channelId, withKeyExchange, }: { | ||
channelId: string; | ||
withKeyExchange?: boolean; | ||
}): void; | ||
sendMessage(message: CommunicationLayerMessage): Promise<void>; | ||
@@ -101,7 +112,10 @@ testStorage(): Promise<void>; | ||
isPaused(): boolean; | ||
getCommunicationLayer(): CommunicationLayer | undefined; | ||
getCommunicationLayer(): SocketService | undefined; | ||
ping(): void; | ||
testLogger(): void; | ||
keyCheck(): void; | ||
setConnectionStatus(connectionStatus: ConnectionStatus): void; | ||
emitServiceStatusEvent(): void; | ||
emitServiceStatusEvent(_?: { | ||
context?: string; | ||
}): void; | ||
getConnectionStatus(): ConnectionStatus; | ||
@@ -114,2 +128,3 @@ getServiceStatus(): ServiceStatus; | ||
getVersion(): string; | ||
hasRelayPersistence(): boolean; | ||
resume(): void; | ||
@@ -116,0 +131,0 @@ getChannelId(): string | undefined; |
@@ -10,7 +10,11 @@ import { SocketService } from '../../../SocketService'; | ||
*/ | ||
export declare function handleMessage(instance: SocketService, channelId: string): ({ id, message, error, }: { | ||
export declare function handleMessage(instance: SocketService, channelId: string): (rawMsg: { | ||
id: string; | ||
message: any; | ||
ackId?: string | undefined; | ||
message: string | { | ||
[key: string]: any; | ||
type: string; | ||
}; | ||
error?: any; | ||
}) => void; | ||
//# sourceMappingURL=handleMessage.d.ts.map |
@@ -5,2 +5,3 @@ import { EventEmitter2 } from 'eventemitter2'; | ||
import { KeyExchange } from './KeyExchange'; | ||
import { RemoteCommunication } from './RemoteCommunication'; | ||
import { Channel } from './types/Channel'; | ||
@@ -14,3 +15,2 @@ import { CommunicationLayer } from './types/CommunicationLayer'; | ||
import { CommunicationLayerLoggingOptions } from './types/LoggingOptions'; | ||
import { RemoteCommunication } from './RemoteCommunication'; | ||
export interface SocketServiceProps { | ||
@@ -65,3 +65,3 @@ communicationLayerPreference: CommunicationLayerPreference; | ||
createChannel(): Channel; | ||
connectToChannel({ channelId, isOriginator, withKeyExchange, }: ConnectToChannelOptions): void; | ||
connectToChannel({ channelId, withKeyExchange, }: ConnectToChannelOptions): void; | ||
getKeyInfo(): KeyInfo; | ||
@@ -68,0 +68,0 @@ keyCheck(): void; |
export interface ChannelConfig { | ||
channelId: string; | ||
validUntil: number; | ||
otherKey?: string; | ||
localKey?: string; | ||
relayPersistence?: boolean; | ||
/** | ||
@@ -5,0 +8,0 @@ * lastActive: ms value of the last time connection was ready CLIENTS_READY event. |
@@ -13,2 +13,3 @@ import { KeyExchangeMessageType } from './KeyExchangeMessageType'; | ||
offer?: RTCSessionDescriptionInit; | ||
v?: number; | ||
otpAnswer?: number; | ||
@@ -15,0 +16,0 @@ candidate?: unknown; |
export interface ConnectToChannelOptions { | ||
channelId: string; | ||
isOriginator?: boolean; | ||
withKeyExchange?: boolean; | ||
} | ||
//# sourceMappingURL=ConnectToChannelOptions.d.ts.map |
@@ -13,2 +13,4 @@ export declare enum EventType { | ||
CLIENTS_READY = "clients_ready", | ||
CHANNEL_PERSISTENCE = "channel_persistence", | ||
MESSAGE_ACK = "ack", | ||
SOCKET_DISCONNECTED = "socket_disconnected", | ||
@@ -15,0 +17,0 @@ SOCKET_RECONNECT = "socket_reconnect", |
@@ -9,6 +9,10 @@ import { ChannelConfig } from './ChannelConfig'; | ||
export interface StorageManager { | ||
persistChannelConfig(channelConfig: ChannelConfig): Promise<void>; | ||
getPersistedChannelConfig(channelId: string): Promise<ChannelConfig | undefined>; | ||
persistChannelConfig(channelConfig: ChannelConfig, context?: string): Promise<void>; | ||
persistAccounts(accounts: string[], context?: string): Promise<void>; | ||
getCachedAccounts(): Promise<string[]>; | ||
getCachedChainId(): Promise<string | undefined>; | ||
persistChainId(chainId: string, context?: string): Promise<void>; | ||
getPersistedChannelConfig(): Promise<ChannelConfig | undefined>; | ||
terminate(channelId: string): Promise<void>; | ||
} | ||
//# sourceMappingURL=StorageManager.d.ts.map |
@@ -9,2 +9,3 @@ export declare const DEFAULT_SERVER_URL = "https://metamask-sdk.api.cx.metamask.io/"; | ||
export declare const MAX_RPC_WAIT_TIME: number; | ||
export declare const PROTOCOL_VERSION = 2; | ||
export declare const RPC_METHODS: { | ||
@@ -11,0 +12,0 @@ METAMASK_GETPROVIDERSTATE: string; |
@@ -6,3 +6,3 @@ /** | ||
debug?: boolean; | ||
pkey?: string; | ||
privateKey?: string; | ||
} | ||
@@ -9,0 +9,0 @@ /** |
import { EventEmitter2 } from 'eventemitter2'; | ||
import { ECIESProps } from './ECIES'; | ||
import { CommunicationLayer } from './types/CommunicationLayer'; | ||
import { SocketService } from './SocketService'; | ||
import { CommunicationLayerMessage } from './types/CommunicationLayerMessage'; | ||
@@ -9,3 +9,3 @@ import { KeyExchangeMessageType } from './types/KeyExchangeMessageType'; | ||
export interface KeyExchangeProps { | ||
communicationLayer: CommunicationLayer; | ||
communicationLayer: SocketService; | ||
otherPublicKey?: string; | ||
@@ -38,2 +38,6 @@ sendPublicKey: boolean; | ||
checkStep(stepList: string[]): void; | ||
setRelayPersistence({ localKey, otherKey, }: { | ||
localKey: string; | ||
otherKey: string; | ||
}): void; | ||
setKeysExchanged(keysExchanged: boolean): void; | ||
@@ -40,0 +44,0 @@ areKeysExchanged(): boolean; |
import { EventEmitter2 } from 'eventemitter2'; | ||
import { ECIESProps } from './ECIES'; | ||
import { SocketService } from './SocketService'; | ||
import { AutoConnectOptions } from './types/AutoConnectOptions'; | ||
import { ChannelConfig } from './types/ChannelConfig'; | ||
import { CommunicationLayer } from './types/CommunicationLayer'; | ||
import { CommunicationLayerMessage } from './types/CommunicationLayerMessage'; | ||
@@ -22,3 +22,6 @@ import { CommunicationLayerPreference } from './types/CommunicationLayerPreference'; | ||
otherPublicKey?: string; | ||
protocolVersion?: number; | ||
privateKey?: string; | ||
reconnect?: boolean; | ||
relayPersistence?: boolean; | ||
dappMetadata?: DappMetadataWithSource; | ||
@@ -41,3 +44,7 @@ walletInfo?: WalletInfo; | ||
paused: boolean; | ||
relayPersistence?: boolean; | ||
otherPublicKey?: string; | ||
protocolVersion: number; | ||
privateKey?: string; | ||
terminated: boolean; | ||
transports?: string[]; | ||
@@ -49,3 +56,4 @@ platformType: PlatformType | MetaMaskMobile; | ||
walletInfo?: WalletInfo; | ||
communicationLayer?: CommunicationLayer; | ||
persist?: boolean; | ||
communicationLayer?: SocketService; | ||
originatorInfo?: OriginatorInfo; | ||
@@ -70,3 +78,3 @@ originatorInfoSent: boolean; | ||
state: RemoteCommunicationState; | ||
constructor({ platformType, communicationLayerPreference, otherPublicKey, reconnect, walletInfo, dappMetadata, transports, context, ecies, analytics, storage, sdkVersion, communicationServerUrl, logging, autoConnect, }: RemoteCommunicationProps); | ||
constructor({ platformType, communicationLayerPreference, otherPublicKey, reconnect, walletInfo, dappMetadata, protocolVersion, transports, context, relayPersistence, ecies, analytics, storage, sdkVersion, communicationServerUrl, logging, autoConnect, }: RemoteCommunicationProps); | ||
private initCommunicationLayer; | ||
@@ -82,3 +90,6 @@ /** | ||
clean(): void; | ||
connectToChannel(channelId: string, withKeyExchange?: boolean): void; | ||
connectToChannel({ channelId, withKeyExchange, }: { | ||
channelId: string; | ||
withKeyExchange?: boolean; | ||
}): void; | ||
sendMessage(message: CommunicationLayerMessage): Promise<void>; | ||
@@ -101,7 +112,10 @@ testStorage(): Promise<void>; | ||
isPaused(): boolean; | ||
getCommunicationLayer(): CommunicationLayer | undefined; | ||
getCommunicationLayer(): SocketService | undefined; | ||
ping(): void; | ||
testLogger(): void; | ||
keyCheck(): void; | ||
setConnectionStatus(connectionStatus: ConnectionStatus): void; | ||
emitServiceStatusEvent(): void; | ||
emitServiceStatusEvent(_?: { | ||
context?: string; | ||
}): void; | ||
getConnectionStatus(): ConnectionStatus; | ||
@@ -114,2 +128,3 @@ getServiceStatus(): ServiceStatus; | ||
getVersion(): string; | ||
hasRelayPersistence(): boolean; | ||
resume(): void; | ||
@@ -116,0 +131,0 @@ getChannelId(): string | undefined; |
@@ -10,7 +10,11 @@ import { SocketService } from '../../../SocketService'; | ||
*/ | ||
export declare function handleMessage(instance: SocketService, channelId: string): ({ id, message, error, }: { | ||
export declare function handleMessage(instance: SocketService, channelId: string): (rawMsg: { | ||
id: string; | ||
message: any; | ||
ackId?: string | undefined; | ||
message: string | { | ||
[key: string]: any; | ||
type: string; | ||
}; | ||
error?: any; | ||
}) => void; | ||
//# sourceMappingURL=handleMessage.d.ts.map |
@@ -5,2 +5,3 @@ import { EventEmitter2 } from 'eventemitter2'; | ||
import { KeyExchange } from './KeyExchange'; | ||
import { RemoteCommunication } from './RemoteCommunication'; | ||
import { Channel } from './types/Channel'; | ||
@@ -14,3 +15,2 @@ import { CommunicationLayer } from './types/CommunicationLayer'; | ||
import { CommunicationLayerLoggingOptions } from './types/LoggingOptions'; | ||
import { RemoteCommunication } from './RemoteCommunication'; | ||
export interface SocketServiceProps { | ||
@@ -65,3 +65,3 @@ communicationLayerPreference: CommunicationLayerPreference; | ||
createChannel(): Channel; | ||
connectToChannel({ channelId, isOriginator, withKeyExchange, }: ConnectToChannelOptions): void; | ||
connectToChannel({ channelId, withKeyExchange, }: ConnectToChannelOptions): void; | ||
getKeyInfo(): KeyInfo; | ||
@@ -68,0 +68,0 @@ keyCheck(): void; |
export interface ChannelConfig { | ||
channelId: string; | ||
validUntil: number; | ||
otherKey?: string; | ||
localKey?: string; | ||
relayPersistence?: boolean; | ||
/** | ||
@@ -5,0 +8,0 @@ * lastActive: ms value of the last time connection was ready CLIENTS_READY event. |
@@ -13,2 +13,3 @@ import { KeyExchangeMessageType } from './KeyExchangeMessageType'; | ||
offer?: RTCSessionDescriptionInit; | ||
v?: number; | ||
otpAnswer?: number; | ||
@@ -15,0 +16,0 @@ candidate?: unknown; |
export interface ConnectToChannelOptions { | ||
channelId: string; | ||
isOriginator?: boolean; | ||
withKeyExchange?: boolean; | ||
} | ||
//# sourceMappingURL=ConnectToChannelOptions.d.ts.map |
@@ -13,2 +13,4 @@ export declare enum EventType { | ||
CLIENTS_READY = "clients_ready", | ||
CHANNEL_PERSISTENCE = "channel_persistence", | ||
MESSAGE_ACK = "ack", | ||
SOCKET_DISCONNECTED = "socket_disconnected", | ||
@@ -15,0 +17,0 @@ SOCKET_RECONNECT = "socket_reconnect", |
@@ -9,6 +9,10 @@ import { ChannelConfig } from './ChannelConfig'; | ||
export interface StorageManager { | ||
persistChannelConfig(channelConfig: ChannelConfig): Promise<void>; | ||
getPersistedChannelConfig(channelId: string): Promise<ChannelConfig | undefined>; | ||
persistChannelConfig(channelConfig: ChannelConfig, context?: string): Promise<void>; | ||
persistAccounts(accounts: string[], context?: string): Promise<void>; | ||
getCachedAccounts(): Promise<string[]>; | ||
getCachedChainId(): Promise<string | undefined>; | ||
persistChainId(chainId: string, context?: string): Promise<void>; | ||
getPersistedChannelConfig(): Promise<ChannelConfig | undefined>; | ||
terminate(channelId: string): Promise<void>; | ||
} | ||
//# sourceMappingURL=StorageManager.d.ts.map |
@@ -9,2 +9,3 @@ export declare const DEFAULT_SERVER_URL = "https://metamask-sdk.api.cx.metamask.io/"; | ||
export declare const MAX_RPC_WAIT_TIME: number; | ||
export declare const PROTOCOL_VERSION = 2; | ||
export declare const RPC_METHODS: { | ||
@@ -11,0 +12,0 @@ METAMASK_GETPROVIDERSTATE: string; |
@@ -6,3 +6,3 @@ /** | ||
debug?: boolean; | ||
pkey?: string; | ||
privateKey?: string; | ||
} | ||
@@ -9,0 +9,0 @@ /** |
import { EventEmitter2 } from 'eventemitter2'; | ||
import { ECIESProps } from './ECIES'; | ||
import { CommunicationLayer } from './types/CommunicationLayer'; | ||
import { SocketService } from './SocketService'; | ||
import { CommunicationLayerMessage } from './types/CommunicationLayerMessage'; | ||
@@ -9,3 +9,3 @@ import { KeyExchangeMessageType } from './types/KeyExchangeMessageType'; | ||
export interface KeyExchangeProps { | ||
communicationLayer: CommunicationLayer; | ||
communicationLayer: SocketService; | ||
otherPublicKey?: string; | ||
@@ -38,2 +38,6 @@ sendPublicKey: boolean; | ||
checkStep(stepList: string[]): void; | ||
setRelayPersistence({ localKey, otherKey, }: { | ||
localKey: string; | ||
otherKey: string; | ||
}): void; | ||
setKeysExchanged(keysExchanged: boolean): void; | ||
@@ -40,0 +44,0 @@ areKeysExchanged(): boolean; |
import { EventEmitter2 } from 'eventemitter2'; | ||
import { ECIESProps } from './ECIES'; | ||
import { SocketService } from './SocketService'; | ||
import { AutoConnectOptions } from './types/AutoConnectOptions'; | ||
import { ChannelConfig } from './types/ChannelConfig'; | ||
import { CommunicationLayer } from './types/CommunicationLayer'; | ||
import { CommunicationLayerMessage } from './types/CommunicationLayerMessage'; | ||
@@ -22,3 +22,6 @@ import { CommunicationLayerPreference } from './types/CommunicationLayerPreference'; | ||
otherPublicKey?: string; | ||
protocolVersion?: number; | ||
privateKey?: string; | ||
reconnect?: boolean; | ||
relayPersistence?: boolean; | ||
dappMetadata?: DappMetadataWithSource; | ||
@@ -41,3 +44,7 @@ walletInfo?: WalletInfo; | ||
paused: boolean; | ||
relayPersistence?: boolean; | ||
otherPublicKey?: string; | ||
protocolVersion: number; | ||
privateKey?: string; | ||
terminated: boolean; | ||
transports?: string[]; | ||
@@ -49,3 +56,4 @@ platformType: PlatformType | MetaMaskMobile; | ||
walletInfo?: WalletInfo; | ||
communicationLayer?: CommunicationLayer; | ||
persist?: boolean; | ||
communicationLayer?: SocketService; | ||
originatorInfo?: OriginatorInfo; | ||
@@ -70,3 +78,3 @@ originatorInfoSent: boolean; | ||
state: RemoteCommunicationState; | ||
constructor({ platformType, communicationLayerPreference, otherPublicKey, reconnect, walletInfo, dappMetadata, transports, context, ecies, analytics, storage, sdkVersion, communicationServerUrl, logging, autoConnect, }: RemoteCommunicationProps); | ||
constructor({ platformType, communicationLayerPreference, otherPublicKey, reconnect, walletInfo, dappMetadata, protocolVersion, transports, context, relayPersistence, ecies, analytics, storage, sdkVersion, communicationServerUrl, logging, autoConnect, }: RemoteCommunicationProps); | ||
private initCommunicationLayer; | ||
@@ -82,3 +90,6 @@ /** | ||
clean(): void; | ||
connectToChannel(channelId: string, withKeyExchange?: boolean): void; | ||
connectToChannel({ channelId, withKeyExchange, }: { | ||
channelId: string; | ||
withKeyExchange?: boolean; | ||
}): void; | ||
sendMessage(message: CommunicationLayerMessage): Promise<void>; | ||
@@ -101,7 +112,10 @@ testStorage(): Promise<void>; | ||
isPaused(): boolean; | ||
getCommunicationLayer(): CommunicationLayer | undefined; | ||
getCommunicationLayer(): SocketService | undefined; | ||
ping(): void; | ||
testLogger(): void; | ||
keyCheck(): void; | ||
setConnectionStatus(connectionStatus: ConnectionStatus): void; | ||
emitServiceStatusEvent(): void; | ||
emitServiceStatusEvent(_?: { | ||
context?: string; | ||
}): void; | ||
getConnectionStatus(): ConnectionStatus; | ||
@@ -114,2 +128,3 @@ getServiceStatus(): ServiceStatus; | ||
getVersion(): string; | ||
hasRelayPersistence(): boolean; | ||
resume(): void; | ||
@@ -116,0 +131,0 @@ getChannelId(): string | undefined; |
@@ -10,7 +10,11 @@ import { SocketService } from '../../../SocketService'; | ||
*/ | ||
export declare function handleMessage(instance: SocketService, channelId: string): ({ id, message, error, }: { | ||
export declare function handleMessage(instance: SocketService, channelId: string): (rawMsg: { | ||
id: string; | ||
message: any; | ||
ackId?: string | undefined; | ||
message: string | { | ||
[key: string]: any; | ||
type: string; | ||
}; | ||
error?: any; | ||
}) => void; | ||
//# sourceMappingURL=handleMessage.d.ts.map |
@@ -5,2 +5,3 @@ import { EventEmitter2 } from 'eventemitter2'; | ||
import { KeyExchange } from './KeyExchange'; | ||
import { RemoteCommunication } from './RemoteCommunication'; | ||
import { Channel } from './types/Channel'; | ||
@@ -14,3 +15,2 @@ import { CommunicationLayer } from './types/CommunicationLayer'; | ||
import { CommunicationLayerLoggingOptions } from './types/LoggingOptions'; | ||
import { RemoteCommunication } from './RemoteCommunication'; | ||
export interface SocketServiceProps { | ||
@@ -65,3 +65,3 @@ communicationLayerPreference: CommunicationLayerPreference; | ||
createChannel(): Channel; | ||
connectToChannel({ channelId, isOriginator, withKeyExchange, }: ConnectToChannelOptions): void; | ||
connectToChannel({ channelId, withKeyExchange, }: ConnectToChannelOptions): void; | ||
getKeyInfo(): KeyInfo; | ||
@@ -68,0 +68,0 @@ keyCheck(): void; |
export interface ChannelConfig { | ||
channelId: string; | ||
validUntil: number; | ||
otherKey?: string; | ||
localKey?: string; | ||
relayPersistence?: boolean; | ||
/** | ||
@@ -5,0 +8,0 @@ * lastActive: ms value of the last time connection was ready CLIENTS_READY event. |
@@ -13,2 +13,3 @@ import { KeyExchangeMessageType } from './KeyExchangeMessageType'; | ||
offer?: RTCSessionDescriptionInit; | ||
v?: number; | ||
otpAnswer?: number; | ||
@@ -15,0 +16,0 @@ candidate?: unknown; |
export interface ConnectToChannelOptions { | ||
channelId: string; | ||
isOriginator?: boolean; | ||
withKeyExchange?: boolean; | ||
} | ||
//# sourceMappingURL=ConnectToChannelOptions.d.ts.map |
@@ -13,2 +13,4 @@ export declare enum EventType { | ||
CLIENTS_READY = "clients_ready", | ||
CHANNEL_PERSISTENCE = "channel_persistence", | ||
MESSAGE_ACK = "ack", | ||
SOCKET_DISCONNECTED = "socket_disconnected", | ||
@@ -15,0 +17,0 @@ SOCKET_RECONNECT = "socket_reconnect", |
@@ -9,6 +9,10 @@ import { ChannelConfig } from './ChannelConfig'; | ||
export interface StorageManager { | ||
persistChannelConfig(channelConfig: ChannelConfig): Promise<void>; | ||
getPersistedChannelConfig(channelId: string): Promise<ChannelConfig | undefined>; | ||
persistChannelConfig(channelConfig: ChannelConfig, context?: string): Promise<void>; | ||
persistAccounts(accounts: string[], context?: string): Promise<void>; | ||
getCachedAccounts(): Promise<string[]>; | ||
getCachedChainId(): Promise<string | undefined>; | ||
persistChainId(chainId: string, context?: string): Promise<void>; | ||
getPersistedChannelConfig(): Promise<ChannelConfig | undefined>; | ||
terminate(channelId: string): Promise<void>; | ||
} | ||
//# sourceMappingURL=StorageManager.d.ts.map |
{ | ||
"name": "@metamask/sdk-communication-layer", | ||
"version": "0.18.5", | ||
"version": "0.19.0", | ||
"description": "", | ||
@@ -121,2 +121,2 @@ "homepage": "https://github.com/MetaMask/metamask-sdk#readme", | ||
} | ||
} | ||
} |
@@ -63,3 +63,3 @@ # MetaMask SDK Communication Layer | ||
remote.connectToChannel(channelId); | ||
remote.connectToChannel({ channelId }); | ||
@@ -66,0 +66,0 @@ remote.on(MessageType.CLIENTS_READY, () => { |
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 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 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 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 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 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 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 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 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 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 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 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 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
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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
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
3020312
1275
10534
1