Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LightClient

Hierarchy

  • LightClient

Index

Constructors

constructor

  • new LightClient(GCI: string, options: any, privKey: any, ethConfig?: any): LightClient
  • Parameters

    • GCI: string
    • options: any
    • privKey: any
    • Optional ethConfig: any

    Returns LightClient

Properties

Private GCI

GCI: string

Private acc

Private eng

eng: EthEngine

Private Optional ethConfig

ethConfig: any

Private keystore

keystore: any

Private options

options: any

Private privKey

privKey: any

Private state

state: any

Private ulotion

ulotion: uLotion

Methods

authenticate

  • authenticate(privKey: string): void
  • Authenticate user

    Parameters

    • privKey: string

    Returns void

deposit

  • deposit(token: TOKENS, amount: number): Promise<any>
  • Deposit token

    Parameters

    • token: TOKENS
    • amount: number

    Returns Promise<any>

getActiveOrders

  • getActiveOrders(all?: boolean, sellToken?: TOKENS, buyToken?: TOKENS): Promise<any>
  • Get active orders for this account

    Parameters

    • Default value all: boolean = false
    • Optional sellToken: TOKENS
    • Optional buyToken: TOKENS

    Returns Promise<any>

make

  • make(sellToken: TOKENS, buyToken: TOKENS, sellAmount: number, buyAmount: number): Promise<any>
  • Make order

    Parameters

    • sellToken: TOKENS
    • buyToken: TOKENS
    • sellAmount: number
    • buyAmount: number

    Returns Promise<any>

recoverAccountAndSignOrder

  • recoverAccountAndSignOrder(pkey: any, order: any): any
  • Recover account and sign order

    Parameters

    • pkey: any
    • order: any

    Returns any

recoverAccountAndSignWithdraw

  • recoverAccountAndSignWithdraw(pkey: any, token: string, amount: number): WithdrawDto
  • Sign withdraw request and send to the tendermint

    Parameters

    • pkey: any
    • token: string
    • amount: number

    Returns WithdrawDto

refreshState

  • refreshState(path?: string): Promise<any>
  • Get lastest state from node

    Parameters

    • Default value path: string = ""

    Returns Promise<any>

Private send

  • send(data: any): Promise<any>
  • Send transaction to node

    Parameters

    • data: any

    Returns Promise<any>

withdraw

  • withdraw(withdrawToken: TOKENS, amount: number, useLatestState?: boolean): Promise<any>
  • Withdraw token

    Parameters

    • withdrawToken: TOKENS
    • amount: number
    • Default value useLatestState: boolean = false

      use latest state insead of the sending new one on the blockchain This is used if there is case when withdraw from blockchain is failed due to the gas limit therefore last signed transaction is repeated on the main chain

    Returns Promise<any>

Generated using TypeDoc