Options
All
  • Public
  • Public/Protected
  • All
Menu

A class representing a client to interact with raiden.

Hierarchy

Index

Constructors

constructor

Properties

Optional address

address: undefined | string

Private directChannelChecks

directChannelChecks: boolean

Private disable

disable: boolean

finalLock

finalLock: 100 = 100

Private host

host: string

logger

logger: Logger

Private maximumOutboundAmounts

maximumOutboundAmounts: Map<string, number> = new Map<string, number>()

Private port

port: number

Protected Optional reconnectionTimer

reconnectionTimer: NodeJS.Timer

Protected status

status: ClientStatus = ClientStatus.NotInitialized

tokenAddresses

tokenAddresses: Map<string, string> = new Map<string, string>()

A map of currency symbols to token addresses.

type

type: Raiden = SwapClientType.Raiden

Private unitConverter

unitConverter: UnitConverter

Static RECONNECT_TIME_LIMIT

RECONNECT_TIME_LIMIT: 5000 = 5000

Time in milliseconds between attempts to recheck connectivity to the client.

Static defaultMaxListeners

defaultMaxListeners: number

Accessors

minutesPerBlock

  • get minutesPerBlock(): number

Methods

addInvoice

  • addInvoice(): Promise<void>

addListener

  • addListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

channelBalance

  • channelBalance(currency?: undefined | string): Promise<ChannelBalance>

close

  • close(): Promise<void>

closeChannel

  • closeChannel(channel_address: string): Promise<void>
  • Closes a payment channel.

    Parameters

    • channel_address: string

      the address of the channel to close

    Returns Promise<void>

depositToChannel

  • depositToChannel(channel_address: string, balance: number): Promise<void>
  • Deposits more of a token to an existing channel.

    Parameters

    • channel_address: string

      the address of the channel to deposit to

    • balance: number

      the amount to deposit to the channel

    Returns Promise<void>

Protected disconnect

  • disconnect(): Promise<void>

emit

  • emit(event: "connectionVerified", swapClientInfo: SwapClientInfo): boolean

eventNames

  • eventNames(): Array<string | symbol>
  • Returns Array<string | symbol>

Private getAddress

  • getAddress(): Promise<string>

getChannel

  • getChannel(token_address: string, channel_address: string): Promise<Channel>
  • Gets info about a given raiden payment channel.

    Parameters

    • token_address: string

      the token address for the network to which the channel belongs

    • channel_address: string

      the address of the channel to query

    Returns Promise<Channel>

getChannels

  • getChannels(token_address?: undefined | string): Promise<Channel[]>
  • Gets info about all non-settled channels.

    Parameters

    • Optional token_address: undefined | string

      an optional parameter to specify channels belonging to the specified token network

    Returns Promise<Channel[]>

getHeight

  • getHeight(): Promise<number>

getMaxListeners

  • getMaxListeners(): number
  • Returns number

Private getPaymentEvents

  • getPaymentEvents(currency?: undefined | string, destination?: undefined | string): Promise<object[]>
  • Parameters

    • Optional currency: undefined | string
    • Optional destination: undefined | string

    Returns Promise<object[]>

Private getPendingTransfers

  • getPendingTransfers(currency?: undefined | string, destination?: undefined | string): Promise<object[]>
  • Parameters

    • Optional currency: undefined | string
    • Optional destination: undefined | string

    Returns Promise<object[]>

getRaidenInfo

getRoute

  • getRoute(units: number, destination: string, currency: string): Promise<undefined | object>

getVersion

init

isConnected

  • isConnected(): boolean

isDisabled

  • isDisabled(): boolean

isDisconnected

  • isDisconnected(): boolean

isNotInitialized

  • isNotInitialized(): boolean

isWaitingUnlock

  • isWaitingUnlock(): boolean

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

lookupPayment

  • lookupPayment(rHash: string, currency?: undefined | string, destination?: undefined | string): Promise<object | object>

maximumOutboundCapacity

  • maximumOutboundCapacity(currency: string): number

off

  • off(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

on

  • on(event: "connectionVerified", listener: function): this

once

  • once(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

openChannel

  • openChannel(__namedParameters: object): Promise<void>

Private openChannelRequest

prependListener

  • prependListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Parameters

    • Optional event: string | symbol

    Returns this

removeInvoice

  • removeInvoice(): Promise<void>

removeListener

  • removeListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

Private sanitizeTokenPaymentResponse

sendPayment

  • sendPayment(deal: SwapDeal): Promise<string>

Private sendRequest

  • sendRequest(endpoint: string, method: string, payload?: undefined | object): Promise<IncomingMessage>
  • Sends a request to the Raiden REST API.

    Parameters

    • endpoint: string

      the URL endpoint

    • method: string

      an HTTP request method

    • Optional payload: undefined | object

      the request payload

    Returns Promise<IncomingMessage>

sendSmallestAmount

  • sendSmallestAmount(rHash: string, destination: string, currency: string): Promise<string>

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

Protected setStatus

Private setTokenAddresses

settleInvoice

  • settleInvoice(): Promise<void>

Private tokenPayment

Protected updateCapacity

  • updateCapacity(): Promise<void>

Protected verifyConnection

  • verifyConnection(): Promise<void>

verifyConnectionWithTimeout

  • verifyConnectionWithTimeout(): Promise<void>

Static Private getIdentifier

  • getIdentifier(rHash: string): number
  • Derives an integer identifier using the first 4 bytes of a provided payment hash in hex.

    Parameters

    • rHash: string

      a payment hash in hex

    Returns number

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • deprecated

    since v4.0.0

    Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Generated using TypeDoc