Home Reference Source Test
public class | source

PeerChannel

Extends:

Observable → PeerChannel

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public get

closed: boolean

public get
public get

id: number

public get
public get
public set
public get
public set
public get

protocol: number

Method Summary

Public Methods
public

accountsProof(blockHash: Hash, proof: AccountsProof): boolean

public

accountsTreeChunk(blockHash: Hash, chunk: AccountsTreeChunk): boolean

public

addr(addresses: Array<PeerAddress>): boolean

public

block(block: Block): boolean

public

blockProof(proof: BlockChain): boolean

public

chainProof(proof: ChainProof): boolean

public

close(type: number, reason: string)

public

equals(o: PeerChannel): boolean

public

expectMessage(types: Message.Type | Array<Message.Type>, timeoutCallback: function(), msgTimeout: number, chunkTimeout: number)

public

getAccountsProof(blockHash: Hash, addresses: Array<Address>): boolean

public

getAccountsTreeChunk(blockHash: Hash, startPrefix: string): boolean

public

getAddr(protocolMask: number, serviceMask: number, maxResults: number): boolean

public

getBlockProof(blockHashToProve: Hash, knownBlockHash: Hash): boolean

public

getBlocks(locators: Array<Hash>, maxInvSize: number, ascending: boolean): boolean

public

getChainProof(): boolean

public

getData(vectors: Array<InvVector>): boolean

public

getHead(): boolean

public

getHeader(vectors: Array<InvVector>): boolean

public

getTransactionReceipts(address: Address): boolean

public

getTransactionsProof(blockHash: Hash, addresses: Array<Address>): boolean

public

hashCode(): string

public

head(header: BlockHeader): boolean

public

header(header: BlockHeader): boolean

public

inv(vectors: Array<InvVector>): boolean

public

isExpectingMessage(type: Message.Type): boolean

public

mempool(): boolean

public

notFound(vectors: Array<InvVector>): boolean

public

ping(nonce: number): boolean

public

pong(nonce: number): boolean

public

rawBlock(block: Uint8Array): boolean

public

reject(messageType: Message.Type, code: RejectMessage.Code, reason: string, extraData: Uint8Array): boolean

public

signal(senderId: PeerId, recipientId: PeerId, nonce: number, ttl: number, flags: SignalMessage.Flag | number, payload: Uint8Array, senderPubKey: PublicKey, signature: Signature): boolean

public

subscribe(subscription: Subscription): boolean

public

toString(): string

public

transactionReceipts(transactionReceipts: Array<TransactionReceipt>): boolean

public

transactionsProof(blockHash: Hash, proof: TransactionsProof): boolean

public

tx(transaction: Transaction, accountsProof: AccountsProof): boolean

public

verack(publicKey: PublicKey, signature: Signature): boolean

public

version(peerAddress: PeerAddress, headHash: Hash, challengeNonce: Uint8Array, appAgent: string): boolean

Inherited Summary

From class Observable
public static get

WILDCARD: string: string

public

bubble(observable: Observable, types: ...string)

public

fire(type: string, args: ...*): Promise | null

public

off(type: string, id: number)

public

on(type: string, callback: Function): number

Public Constructors

public constructor(connection: NetworkConnection) source

Override:

Observable#constructor

Params:

NameTypeAttributeDescription
connection NetworkConnection

Listen:

*

NetworkConnection#message

Public Members

public get closed: boolean source

public get connection: NetworkConnection source

public get id: number source

public get lastMessageReceivedAt: number source

public get netAddress: NetAddress source

public set netAddress: NetAddress source

public get peerAddress: PeerAddress source

public set peerAddress: PeerAddress source

public get protocol: number source

Public Methods

public accountsProof(blockHash: Hash, proof: AccountsProof): boolean source

Params:

NameTypeAttributeDescription
blockHash Hash
proof AccountsProof
  • optional

Return:

boolean

public accountsTreeChunk(blockHash: Hash, chunk: AccountsTreeChunk): boolean source

Params:

NameTypeAttributeDescription
blockHash Hash
chunk AccountsTreeChunk
  • optional

Return:

boolean

public addr(addresses: Array<PeerAddress>): boolean source

Params:

NameTypeAttributeDescription
addresses Array<PeerAddress>

Return:

boolean

public block(block: Block): boolean source

Params:

NameTypeAttributeDescription
block Block

Return:

boolean

public blockProof(proof: BlockChain): boolean source

Params:

NameTypeAttributeDescription
proof BlockChain
  • optional

Return:

boolean

public chainProof(proof: ChainProof): boolean source

Params:

NameTypeAttributeDescription
proof ChainProof

Return:

boolean

public close(type: number, reason: string) source

Params:

NameTypeAttributeDescription
type number
  • optional
reason string
  • optional

public equals(o: PeerChannel): boolean source

Params:

NameTypeAttributeDescription
o PeerChannel

Return:

boolean

public expectMessage(types: Message.Type | Array<Message.Type>, timeoutCallback: function(), msgTimeout: number, chunkTimeout: number) source

Params:

NameTypeAttributeDescription
types Message.Type | Array<Message.Type>
timeoutCallback function()
msgTimeout number
  • optional
chunkTimeout number
  • optional

public getAccountsProof(blockHash: Hash, addresses: Array<Address>): boolean source

Params:

NameTypeAttributeDescription
blockHash Hash
addresses Array<Address>

Return:

boolean

public getAccountsTreeChunk(blockHash: Hash, startPrefix: string): boolean source

Params:

NameTypeAttributeDescription
blockHash Hash
startPrefix string

Return:

boolean

public getAddr(protocolMask: number, serviceMask: number, maxResults: number): boolean source

Params:

NameTypeAttributeDescription
protocolMask number
serviceMask number
maxResults number

Return:

boolean

public getBlockProof(blockHashToProve: Hash, knownBlockHash: Hash): boolean source

Params:

NameTypeAttributeDescription
blockHashToProve Hash
knownBlockHash Hash

Return:

boolean

public getBlocks(locators: Array<Hash>, maxInvSize: number, ascending: boolean): boolean source

Params:

NameTypeAttributeDescription
locators Array<Hash>
maxInvSize number
ascending boolean
  • optional

Return:

boolean

public getChainProof(): boolean source

Return:

boolean

public getData(vectors: Array<InvVector>): boolean source

Params:

NameTypeAttributeDescription
vectors Array<InvVector>

Return:

boolean

public getHead(): boolean source

Return:

boolean

public getHeader(vectors: Array<InvVector>): boolean source

Params:

NameTypeAttributeDescription
vectors Array<InvVector>

Return:

boolean

public getTransactionReceipts(address: Address): boolean source

Params:

NameTypeAttributeDescription
address Address

Return:

boolean

public getTransactionsProof(blockHash: Hash, addresses: Array<Address>): boolean source

Params:

NameTypeAttributeDescription
blockHash Hash
addresses Array<Address>

Return:

boolean

public hashCode(): string source

Return:

string

public head(header: BlockHeader): boolean source

Params:

NameTypeAttributeDescription
header BlockHeader

Return:

boolean

public header(header: BlockHeader): boolean source

Params:

NameTypeAttributeDescription
header BlockHeader

Return:

boolean

public inv(vectors: Array<InvVector>): boolean source

Params:

NameTypeAttributeDescription
vectors Array<InvVector>

Return:

boolean

public isExpectingMessage(type: Message.Type): boolean source

Params:

NameTypeAttributeDescription
type Message.Type

Return:

boolean

public mempool(): boolean source

Return:

boolean

public notFound(vectors: Array<InvVector>): boolean source

Params:

NameTypeAttributeDescription
vectors Array<InvVector>

Return:

boolean

public ping(nonce: number): boolean source

Params:

NameTypeAttributeDescription
nonce number

Return:

boolean

public pong(nonce: number): boolean source

Params:

NameTypeAttributeDescription
nonce number

Return:

boolean

public rawBlock(block: Uint8Array): boolean source

Params:

NameTypeAttributeDescription
block Uint8Array

Return:

boolean

public reject(messageType: Message.Type, code: RejectMessage.Code, reason: string, extraData: Uint8Array): boolean source

Params:

NameTypeAttributeDescription
messageType Message.Type
code RejectMessage.Code
reason string
extraData Uint8Array
  • optional

Return:

boolean

public signal(senderId: PeerId, recipientId: PeerId, nonce: number, ttl: number, flags: SignalMessage.Flag | number, payload: Uint8Array, senderPubKey: PublicKey, signature: Signature): boolean source

Params:

NameTypeAttributeDescription
senderId PeerId
recipientId PeerId
nonce number
ttl number
flags SignalMessage.Flag | number
payload Uint8Array
  • optional
senderPubKey PublicKey
  • optional
signature Signature
  • optional

Return:

boolean

public subscribe(subscription: Subscription): boolean source

Params:

NameTypeAttributeDescription
subscription Subscription

Return:

boolean

public toString(): string source

Return:

string

public transactionReceipts(transactionReceipts: Array<TransactionReceipt>): boolean source

Params:

NameTypeAttributeDescription
transactionReceipts Array<TransactionReceipt>
  • nullable: true

Return:

boolean

public transactionsProof(blockHash: Hash, proof: TransactionsProof): boolean source

Params:

NameTypeAttributeDescription
blockHash Hash
proof TransactionsProof
  • optional

Return:

boolean

public tx(transaction: Transaction, accountsProof: AccountsProof): boolean source

Params:

NameTypeAttributeDescription
transaction Transaction
accountsProof AccountsProof
  • optional
  • nullable: true

Return:

boolean

public verack(publicKey: PublicKey, signature: Signature): boolean source

Params:

NameTypeAttributeDescription
publicKey PublicKey
signature Signature

Return:

boolean

public version(peerAddress: PeerAddress, headHash: Hash, challengeNonce: Uint8Array, appAgent: string): boolean source

Params:

NameTypeAttributeDescription
peerAddress PeerAddress
headHash Hash
challengeNonce Uint8Array
appAgent string
  • optional

Return:

boolean