p2p-cash
- ClientConfig
- ClusterOptions
- ClusterStrategy
- ConnectionOptions
- Options
- PeerOptions
- RPCBase
- RPCError
- RPCErrorResponse
- RPCNotification
- RPCRequest
- RPCStatement
- SubscriptionTracker
- VersionNegotiated
- VersionRejected
- CancelWatch
- RPCMessage
- RPCParameter
- RPCRequestBatch
- RPCResponse
- RPCResponseBatch
- RejectFunction
- RequestResolver
- RequestResponse
- ResolveFunction
- SubscribeCallback
- TransportScheme
- Address
- DefaultParameters
- ElectrumTransport
- GetData
- Headers
- Inv
- MAGIC_NUMS
- MAX_PER_MSG
- Message
- Reject
- USER_AGENTS
- VERSIONS
- Version
- debug
- isRPCErrorResponse
- isRPCNotification
- isRPCRequest
- isRPCStatement
- isVersionNegotiated
- isVersionRejected
Ƭ CancelWatch: () => void
▸ (): void
void
src/interfaces.ts:3
Ƭ RPCMessage: RPCNotification
| RPCRequest
| RPCResponse
src/interfaces.ts:199
Ƭ RPCParameter: string
| number
| boolean
| Object
| null
src/interfaces.ts:151
Ƭ RPCRequestBatch: RPCRequest
[]
src/interfaces.ts:203
Ƭ RPCResponse: RPCErrorResponse
| RPCStatement
src/interfaces.ts:196
Ƭ RPCResponseBatch: RPCResponse
[]
src/interfaces.ts:202
Ƭ RejectFunction: (reason?
: any
) => void
▸ (reason?
): void
Name | Type |
---|---|
reason? |
any |
void
src/interfaces.ts:114
Ƭ RequestResolver: (error?
: Error
, data?
: string
) => void
▸ (error?
, data?
): void
Name | Type |
---|---|
error? |
Error |
data? |
string |
void
src/interfaces.ts:110
Ƭ RequestResponse: object
| string
| number
| boolean
| null
| RequestResponse
[]
A list of possible responses to requests.
src/interfaces.ts:96
Ƭ ResolveFunction<T
>: (value
: T
| PromiseLike
<T
>) => void
Name |
---|
T |
▸ (value
): void
Name | Type |
---|---|
value |
T | PromiseLike <T > |
void
src/interfaces.ts:113
Ƭ SubscribeCallback: (errorOrData
: Error
| RequestResponse
) => void
▸ (errorOrData
): void
Name | Type |
---|---|
errorOrData |
Error | RequestResponse |
void
src/interfaces.ts:106
Ƭ TransportScheme: "tcp"
| "tcp_tls"
| "ws"
| "wss"
Possible Transport Schemes for communication with the Electrum server
src/interfaces.ts:140
• Const
Address: Object
Name | Type |
---|---|
read |
(payload : default | Buffer , versionMessage : boolean ) => NetAddress |
readAddr |
(payload : Buffer ) => NetAddress [] |
write |
(__namedParameters : MessageAddress ) => Buffer |
• Const
DefaultParameters: Object
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 |
src/interfaces.ts:316
• 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.
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 |
src/interfaces.ts:308
• Const
GetData: Object
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 |
• Const
Headers: Object
Name | Type |
---|---|
getheaders |
(__namedParameters : GetHeadersOptions ) => Buffer |
parseHeaders |
(payload : Buffer ) => { headers : default [] ; txs : number [] } |
• Const
Inv: Object
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 |
• Const
MAGIC_NUMS: Object
▪ [key: string
]: Buffer
• Const
MAX_PER_MSG: 50000
• Const
Message: Object
Name | Type |
---|---|
read |
(__namedParameters : ReadMessageOptions ) => { command : string ; end? : number ; needed : number ; payload : Buffer } |
write |
(__namedParameters : WriteMessageOptions ) => Buffer |
• Const
Reject: Object
Name | Type |
---|---|
read |
(payload : Buffer ) => ReadRejectResult |
• Const
USER_AGENTS: Object
▪ [key: string
]: string
• Const
VERSIONS: Object
▪ [key: string
]: number
• Const
Version: Object
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 |
• Const
debug: Object
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 |
src/interfaces.ts:58
▸ isRPCErrorResponse(message
): message is RPCErrorResponse
Name | Type |
---|---|
message |
RPCBase |
message is RPCErrorResponse
src/interfaces.ts:205
▸ isRPCNotification(message
): message is RPCNotification
Name | Type |
---|---|
message |
RPCBase |
message is RPCNotification
src/interfaces.ts:215
▸ isRPCRequest(message
): message is RPCRequest
Name | Type |
---|---|
message |
RPCBase |
message is RPCRequest
src/interfaces.ts:220
▸ isRPCStatement(message
): message is RPCStatement
Name | Type |
---|---|
message |
RPCBase |
message is RPCStatement
src/interfaces.ts:210
▸ isVersionNegotiated(object
): object is VersionNegotiated
Name | Type |
---|---|
object |
any |
object is VersionNegotiated
src/interfaces.ts:132
▸ isVersionRejected(object
): object is VersionRejected
Name | Type |
---|---|
object |
any |
object is VersionRejected
src/interfaces.ts:127