import { StateChannelsNotification } from './notifications' ; import { JsonRpcError , JsonRpcErrorResponse } from './jsonrpc-header-types' ; import { CreateChannelRequest , JoinChannelRequest , UpdateChannelRequest , GetWalletInformationRequest , EnableEthereumRequest , GetStateRequest , SyncChannelRequest , PushMessageRequest , ChallengeChannelRequest , GetBudgetRequest , ApproveBudgetAndFundRequest , CloseChannelRequest , CloseAndWithdrawRequest , GetChannelsRequest , CreateChannelResponse , JoinChannelResponse , UpdateChannelResponse , EnableEthereumResponse , GetWalletInformationResponse , GetStateResponse , SyncChannelResponse , PushMessageResponse , ChallengeChannelResponse , GetBudgetResponse , CloseChannelResponse , ApproveBudgetAndFundResponse , CloseAndWithdrawResponse , GetChannelsResponse , EnableEthereumError , CloseAndWithdrawError , CloseChannelError , UpdateChannelError , PushMessageError , JoinChannelError , GetStateError , CreateChannelError , ChallengeChannelError } from './methods' ; type GenericError = JsonRpcError < 500 , 'Wallet error' > ; export type StateChannelsRequest = CreateChannelRequest | SyncChannelRequest | JoinChannelRequest | UpdateChannelRequest | GetWalletInformationRequest | EnableEthereumRequest | GetStateRequest | PushMessageRequest | ChallengeChannelRequest | GetBudgetRequest | ApproveBudgetAndFundRequest | CloseChannelRequest | CloseAndWithdrawRequest | GetChannelsRequest ; export type StateChannelsResponse = CreateChannelResponse | SyncChannelResponse | JoinChannelResponse | UpdateChannelResponse | GetWalletInformationResponse | EnableEthereumResponse | GetStateResponse | PushMessageResponse | ChallengeChannelResponse | GetBudgetResponse | CloseChannelResponse | ApproveBudgetAndFundResponse | CloseAndWithdrawResponse | GetChannelsResponse ; export type StateChannelsError = EnableEthereumError | CloseAndWithdrawError | CloseChannelError | UpdateChannelError | PushMessageError | JoinChannelError | GetStateError | CreateChannelError | ChallengeChannelError | PushMessageError | GenericError ; export type StateChannelsErrorResponse = JsonRpcErrorResponse < StateChannelsError > ; export type StateChannelsJsonRpcMessage = StateChannelsRequest | StateChannelsResponse | StateChannelsNotification | StateChannelsErrorResponse ; export function isStateChannelsResponse ( message ) { return message && typeof message == 'object' && 'id' in message && 'result' in message ; } export function isStateChannelsNotification ( message ) { return message && typeof message == 'object' && ! ( 'id' in message ) ; } export function isStateChannelsRequest ( message ) { return message && message && typeof message == 'object' && 'id' in message && 'params' in message ; } export function isStateChannelsErrorResponse ( message ) { return ( message && typeof message == 'object' && 'id' in message && 'message' in message && 'error' in message ) ; } export * from './notifications' ; export * from './methods' ; export * from './data-types' ; export * from './error-codes' ;