Options
All
  • Public
  • Public/Protected
  • All
Menu

@tgrospic/rnode-http-js

Index

Type aliases

RNodeHttp

RNodeHttp: (httpUrl: string, apiMethod: string, data?: any) => Promise<any>

Type declaration

    • (httpUrl: string, apiMethod: string, data?: any): Promise<any>
    • Parameters

      • httpUrl: string
      • apiMethod: string
      • Optional data: any

      Returns Promise<any>

RNodeHttpAdminUrl

RNodeHttpAdminUrl: { httpAdminUrl: string }

Type declaration

  • httpAdminUrl: string

RNodeHttpUrl

RNodeHttpUrl: { httpUrl: string }

Type declaration

  • httpUrl: string

RNodeWebAPI

Variables

ethDetected

ethDetected: boolean = !!eth_

Functions

createRevAccount

  • createRevAccount(text: string): RevAddress | undefined
  • Creates REV address from different formats (private key -> public key -> ETH address -> REV address)

    Parameters

    • text: string

    Returns RevAddress | undefined

Const decodeAscii

  • decodeAscii(str?: string): number[]
  • Decode ASCII string to bytes.

    Parameters

    • str: string = ''

    Returns number[]

Const decodeBase16

  • decodeBase16(hexStr: string): Uint8Array
  • Decode base 16 string to bytes.

    Parameters

    • hexStr: string

    Returns Uint8Array

Const decodeBase58safe

  • decodeBase58safe(str: string): undefined | Buffer
  • Decode base 58 string (handle errors).

    Parameters

    • str: string

    Returns undefined | Buffer

Const deployDataProtobufSerialize

  • deployDataProtobufSerialize(deployData: DeployData): Uint8Array

Const encodeBase16

  • encodeBase16(bytes: Uint8Array | number[]): string
  • Encode bytes to base 16 string.

    Parameters

    • bytes: Uint8Array | number[]

    Returns string

Const encodeBase58

  • encodeBase58(hexStr: string): string
  • Encode base 16 string to base 58.

    Parameters

    • hexStr: string

    Returns string

Const ethereumAddress

  • ethereumAddress(): Promise<string>
  • Request an address selected in Metamask

    • the first request will ask the user for permission

    Returns Promise<string>

    Base 16 ETH address

Const ethereumSign

  • ethereumSign(bytes: Uint8Array | number[], ethAddr: string): Promise<string>

getAddrFromEth

  • getAddrFromEth(ethAddrRaw: string): string | undefined
  • Get REV address from ETH address.

    Parameters

    • ethAddrRaw: string

    Returns string | undefined

getAddrFromPrivateKey

  • getAddrFromPrivateKey(privateKeyRaw: string): RevAddress | undefined
  • Get REV address (with ETH address and public key) from private key.

    Parameters

    • privateKeyRaw: string

    Returns RevAddress | undefined

getAddrFromPublicKey

  • getAddrFromPublicKey(publicKeyRaw: string): RevAddress | undefined

makeRNodeWeb

newRevAccount

Const recoverPublicKeyEth

  • recoverPublicKeyEth(data: Uint8Array | number[], sigHex: string): string
  • Recover public key from Ethereum signed data and signature.

    Parameters

    • data: Uint8Array | number[]

      Signed message bytes

    • sigHex: string

      Signature base 16

    Returns string

    Public key base 16

Const rhoExprToJson

  • rhoExprToJson(input: any): any

Const signDeploy

Const signMetamask

Const signPrivKey

Const toWebDeploy

Const verifyDeploy

Const verifyDeployEth

verifyRevAddr

  • verifyRevAddr(revAddr: string): boolean

Generated using TypeDoc