ethereumjs-monorepo

@ethereumjs/devp2p / SNAP

Class: SNAP

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new SNAP(version, peer, send)

Parameters

Name Type
version number
peer Peer
send SendMethod

Overrides

Protocol.constructor

Defined in

packages/devp2p/src/protocol/snap.ts:14

Properties

snap

Static snap: Object

Type declaration

Name Type
constructor typeof SNAP
length number
name string
version number

Defined in

packages/devp2p/src/protocol/snap.ts:18

Methods

_handleMessage

_handleMessage(code, data): void

Parameters

Name Type
code MESSAGE_CODES
data Uint8Array

Returns

void

Overrides

Protocol._handleMessage

Defined in

packages/devp2p/src/protocol/snap.ts:20


getMsgPrefix

getMsgPrefix(msgCode): string

Parameters

Name Type
msgCode MESSAGE_CODES

Returns

string

Defined in

packages/devp2p/src/protocol/snap.ts:95


getVersion

getVersion(): number

Returns

number

Defined in

packages/devp2p/src/protocol/snap.ts:99


sendMessage

sendMessage(code, payload): void

Parameters

Name Type Description
code MESSAGE_CODES Message code
payload any Payload (including reqId, e.g. [1, [437000, 1, 0, 0]])

Returns

void

Defined in

packages/devp2p/src/protocol/snap.ts:59


sendStatus

sendStatus(): void

Returns

void

Defined in

packages/devp2p/src/protocol/snap.ts:50