Skip to content

Latest commit

 

History

History
659 lines (392 loc) · 13.1 KB

README.md

File metadata and controls

659 lines (392 loc) · 13.1 KB

p2p-cash

p2p-cash

Table of contents

Enumerations

Classes

Interfaces

Type Aliases

Variables

Functions

Type Aliases

CancelWatch

Ƭ CancelWatch: () => void

Type declaration

▸ (): void

Returns

void

Defined in

src/interfaces.ts:3


RPCMessage

Ƭ RPCMessage: RPCNotification | RPCRequest | RPCResponse

Defined in

src/interfaces.ts:199


RPCParameter

Ƭ RPCParameter: string | number | boolean | Object | null

Defined in

src/interfaces.ts:151


RPCRequestBatch

Ƭ RPCRequestBatch: RPCRequest[]

Defined in

src/interfaces.ts:203


RPCResponse

Ƭ RPCResponse: RPCErrorResponse | RPCStatement

Defined in

src/interfaces.ts:196


RPCResponseBatch

Ƭ RPCResponseBatch: RPCResponse[]

Defined in

src/interfaces.ts:202


RejectFunction

Ƭ RejectFunction: (reason?: any) => void

Type declaration

▸ (reason?): void

Parameters
Name Type
reason? any
Returns

void

Defined in

src/interfaces.ts:114


RequestResolver

Ƭ RequestResolver: (error?: Error, data?: string) => void

Type declaration

▸ (error?, data?): void

Parameters
Name Type
error? Error
data? string
Returns

void

Defined in

src/interfaces.ts:110


RequestResponse

Ƭ RequestResponse: object | string | number | boolean | null | RequestResponse[]

A list of possible responses to requests.

Defined in

src/interfaces.ts:96


ResolveFunction

Ƭ ResolveFunction<T>: (value: T | PromiseLike<T>) => void

Type parameters

Name
T

Type declaration

▸ (value): void

Parameters
Name Type
value T | PromiseLike<T>
Returns

void

Defined in

src/interfaces.ts:113


SubscribeCallback

Ƭ SubscribeCallback: (errorOrData: Error | RequestResponse) => void

Type declaration

▸ (errorOrData): void

Parameters
Name Type
errorOrData Error | RequestResponse
Returns

void

Defined in

src/interfaces.ts:106


TransportScheme

Ƭ TransportScheme: "tcp" | "tcp_tls" | "ws" | "wss"

Possible Transport Schemes for communication with the Electrum server

Defined in

src/interfaces.ts:140

Variables

Address

Const Address: Object

Type declaration

Name Type
read (payload: default | Buffer, versionMessage: boolean) => NetAddress
readAddr (payload: Buffer) => NetAddress[]
write (__namedParameters: MessageAddress) => Buffer

Defined in

src/messages/address.ts:99


DefaultParameters

Const DefaultParameters: Object

Type declaration

Name Type
CLUSTER_CONFIDENCE number
CLUSTER_DISTRIBUTION ALL
CLUSTER_ORDER ClusterOrder
DEBUG_LOG boolean
PING_INTERVAL number
PORT number
RECONNECT number
TIMEOUT number
TRANSPORT_SCHEME TransportScheme

Defined in

src/interfaces.ts:316


ElectrumTransport

Const ElectrumTransport: Object

Object containing the commonly used ports and schemes for specific Transports.

Example

const electrum = new ElectrumClient('Electrum client example', '1.4.1', 'bch.imaginary.cash', Transport.WSS.Port, Transport.WSS.Scheme);

Property

Port and Scheme to use unencrypted TCP sockets.

Property

Port and Scheme to use TLS-encrypted TCP sockets.

Property

Port and Scheme to use unencrypted WebSockets.

Property

Port and Scheme to use TLS-encrypted WebSockets.

Type declaration

Name Type
TCP { Port: number = 50001; Scheme: TransportScheme }
TCP.Port number
TCP.Scheme TransportScheme
TCP_TLS { Port: number = 50002; Scheme: TransportScheme }
TCP_TLS.Port number
TCP_TLS.Scheme TransportScheme
WS { Port: number = 50003; Scheme: TransportScheme }
WS.Port number
WS.Scheme TransportScheme
WSS { Port: number = 50004; Scheme: TransportScheme }
WSS.Port number
WSS.Scheme TransportScheme

Defined in

src/interfaces.ts:308


GetData

Const GetData: Object

Type declaration

Name Type
read (buffer: Buffer) => { blocks: Buffer[] ; compact_blocks: Buffer[] ; dsproofs: Buffer[] ; errors: Buffer[] ; filtered_blocks: Buffer[] ; other: [Buffer, number][] ; txs: Buffer[] }
write (__namedParameters: WriteGetDataOptions) => Buffer

Defined in

src/messages/getdata.ts:97


Headers

Const Headers: Object

Type declaration

Name Type
getheaders (__namedParameters: GetHeadersOptions) => Buffer
parseHeaders (payload: Buffer) => { headers: default[] ; txs: number[] }

Defined in

src/messages/headers.ts:41


Inv

Const Inv: Object

Type declaration

Name Type
read (buffer: Buffer) => { blocks: Buffer[] ; compact_blocks: Buffer[] ; dsproofs: Buffer[] ; errors: Buffer[] ; filtered_blocks: Buffer[] ; other: [Buffer, number][] ; txs: Buffer[] }
write (__namedParameters: WriteInvOptions) => Buffer

Defined in

src/messages/inv.ts:98


MAGIC_NUMS

Const MAGIC_NUMS: Object

Index signature

▪ [key: string]: Buffer

Defined in

src/config.ts:1


MAX_PER_MSG

Const MAX_PER_MSG: 50000

Defined in

src/config.ts:30


Message

Const Message: Object

Type declaration

Name Type
read (__namedParameters: ReadMessageOptions) => { command: string ; end?: number ; needed: number ; payload: Buffer }
write (__namedParameters: WriteMessageOptions) => Buffer

Defined in

src/messages/message.ts:122


Reject

Const Reject: Object

Type declaration

Name Type
read (payload: Buffer) => ReadRejectResult

Defined in

src/messages/reject.ts:24


USER_AGENTS

Const USER_AGENTS: Object

Index signature

▪ [key: string]: string

Defined in

src/config.ts:21


VERSIONS

Const VERSIONS: Object

Index signature

▪ [key: string]: number

Defined in

src/config.ts:12


Version

Const Version: Object

Type declaration

Name Type
read (payload: default | Buffer) => { addrFrom: NetAddress ; addrRecv: NetAddress ; nonce: Buffer ; relay: number ; services: Buffer ; startHeight: number ; timestamp: number ; userAgent: string ; version: number }
write (__namedParameters: WriteVersionOptions) => Buffer

Defined in

src/messages/version.ts:119


debug

Const debug: Object

Type declaration

Name Type
client (...log: any) => void
cluster (...log: any) => void
errors (...log: any) => void
network (...log: any) => void
ping (...log: any) => void
warning (...log: any) => void

Defined in

src/interfaces.ts:58

Functions

isRPCErrorResponse

isRPCErrorResponse(message): message is RPCErrorResponse

Parameters

Name Type
message RPCBase

Returns

message is RPCErrorResponse

Defined in

src/interfaces.ts:205


isRPCNotification

isRPCNotification(message): message is RPCNotification

Parameters

Name Type
message RPCBase

Returns

message is RPCNotification

Defined in

src/interfaces.ts:215


isRPCRequest

isRPCRequest(message): message is RPCRequest

Parameters

Name Type
message RPCBase

Returns

message is RPCRequest

Defined in

src/interfaces.ts:220


isRPCStatement

isRPCStatement(message): message is RPCStatement

Parameters

Name Type
message RPCBase

Returns

message is RPCStatement

Defined in

src/interfaces.ts:210


isVersionNegotiated

isVersionNegotiated(object): object is VersionNegotiated

Parameters

Name Type
object any

Returns

object is VersionNegotiated

Defined in

src/interfaces.ts:132


isVersionRejected

isVersionRejected(object): object is VersionRejected

Parameters

Name Type
object any

Returns

object is VersionRejected

Defined in

src/interfaces.ts:127