ethereumjs-monorepo

@ethereumjs/devp2p

@ethereumjs/devp2p

Table of contents

Namespaces

Enumerations

Classes

Interfaces

Type Aliases

Variables

Functions

Type Aliases

DNSOptions

Ƭ DNSOptions: Object

Type declaration

Name Type Description
dnsServerAddress? string ipv4 or ipv6 address of server to pass to native dns.setServers() Sets the IP address of servers to be used when performing DNS resolution.

Defined in

packages/devp2p/src/types.ts:32


SendMethod

Ƭ SendMethod: (code: number, data: Uint8Array) => any

Type declaration

▸ (code, data): any

Parameters
Name Type
code number
data Uint8Array
Returns

any

Defined in

packages/devp2p/src/types.ts:212

Variables

DEFAULT_ANNOUNCE_TYPE

Const DEFAULT_ANNOUNCE_TYPE: 1

Defined in

packages/devp2p/src/protocol/les.ts:21

Functions

assertEq

assertEq(expected, actual, msg, debug, messageName?): void

Parameters

Name Type
expected assertInput
actual assertInput
msg string
debug Function
messageName? string

Returns

void

Defined in

packages/devp2p/src/util.ts:51


createDeferred

createDeferred<T>(): Deferred<T>

Type parameters

Name
T

Returns

Deferred<T>

Defined in

packages/devp2p/src/util.ts:112


decode

decode(bytes): Object

Parameters

Name Type
bytes Uint8Array

Returns

Object

Name Type
data any
publicKey Uint8Array
typename string | number

Defined in

packages/devp2p/src/dpt/message.ts:190


devp2pDebug

devp2pDebug(formatter, …args): void

Parameters

Name Type
formatter any
...args any[]

Returns

void

Defined in

node_modules/@types/debug/index.d.ts:51


encode

encode<T>(typename, data, privateKey): Uint8Array

Type parameters

Name
T

Parameters

Name Type
typename string
data T
privateKey Uint8Array

Returns

Uint8Array

Defined in

packages/devp2p/src/dpt/message.ts:177


formatLogData

formatLogData(data, verbose): string

Parameters

Name Type
data string
verbose boolean

Returns

string

Defined in

packages/devp2p/src/util.ts:91


formatLogId

formatLogId(id, verbose): string

Parameters

Name Type
id string
verbose boolean

Returns

string

Defined in

packages/devp2p/src/util.ts:82


genPrivateKey

genPrivateKey(): Uint8Array

Returns

Uint8Array

Defined in

packages/devp2p/src/util.ts:19


id2pk

id2pk(id): Uint8Array

Parameters

Name Type
id Uint8Array

Returns

Uint8Array

Defined in

packages/devp2p/src/util.ts:31


ipToBytes

ipToBytes(ip, bytes?, offset?): Uint8Array

Parameters

Name Type Default value
ip string undefined
bytes? Uint8Array undefined
offset number 0

Returns

Uint8Array

Defined in

packages/devp2p/src/util.ts:167


ipToString

ipToString(bytes, offset?, length?): string


Parameters

Name Type
bytes Uint8Array
offset? number
length? number

Returns

string

Defined in

packages/devp2p/src/util.ts:131


isV4Format

isV4Format(ip): boolean

Parameters

Name Type
ip string

Returns

boolean

Defined in

packages/devp2p/src/util.ts:159


isV6Format

isV6Format(ip): boolean

Parameters

Name Type
ip string

Returns

boolean

Defined in

packages/devp2p/src/util.ts:163


keccak256

keccak256(…bytes): Uint8Array

Parameters

Name Type
...bytes Uint8Array[]

Returns

Uint8Array

Defined in

packages/devp2p/src/util.ts:14


pk2id

pk2id(pk): Uint8Array

Parameters

Name Type
pk Uint8Array

Returns

Uint8Array

Defined in

packages/devp2p/src/util.ts:24


toNewUint8Array

toNewUint8Array(buf): Uint8Array

Parameters

Name Type
buf Uint8Array

Returns

Uint8Array

Defined in

packages/devp2p/src/util.ts:123


unstrictDecode

unstrictDecode(value): Uint8Array | NestedUint8Array

Parameters

Name Type
value Uint8Array

Returns

Uint8Array | NestedUint8Array

Defined in

packages/devp2p/src/util.ts:116


xor

xor(a, b): Uint8Array

Parameters

Name Type
a Uint8Array
b any

Returns

Uint8Array

Defined in

packages/devp2p/src/util.ts:42


zfill

zfill(bytes, size, leftpad?): Uint8Array

Parameters

Name Type Default value
bytes Uint8Array undefined
size number undefined
leftpad boolean true

Returns

Uint8Array

Defined in

packages/devp2p/src/util.ts:35