Options
All
  • Public
  • Public/Protected
  • All
Menu

Main service exposed to outside. Needs to be instantiated with username, password and toolName (optional) fields. Please note that this is exported as Client.

example

import { Client } from 'mythxjs'.

const mythx = new Client('0x0000000000000000000000000000000000000000', 'trial', 'testTool');

Hierarchy

  • ClientService

Index

Constructors

constructor

  • new ClientService(ethAddress: string, password: string, toolName?: string): ClientService

Methods

analyze

  • Submit a smart contract using custom parameters.

    Parameters

    Returns Promise<any>

    Resolves with API response, or throws an an error.

getAnalysesList

  • getAnalysesList(): Promise<any>

getAnalysisStatus

  • getAnalysisStatus(uuid: string): Promise<any>
  • Get status for analysis on given UUID.

    Parameters

    • uuid: string

      unique identifier of analysis job

    Returns Promise<any>

    Resolves with API response, or throws error

getDetectedIssues

  • getDetectedIssues(uuid: string): Promise<any>
  • Gets the array of issues from the API.

    Parameters

    • uuid: string

      unique identifier of analysis job

    Returns Promise<any>

    Resolves with API response, or throws error

getStats

  • getStats(queryString?: undefined | string): Promise<any>
  • Returns API stats. Internal only, needs admin credentials to be accessed.

    Parameters

    • Optional queryString: undefined | string

    Returns Promise<any>

getVersion

  • getVersion(): Promise<any>

login

  • Login to the API using ethAddress and password specified in the library constructor.

    Returns Promise<JwtTokensInterface>

    Returns an object containing two tokens (access+refresh) that can be saved in storage.

loginWithToken

  • Login to the API using a set of pre-existing tokens. Can be used when user has previously log in and stored those tokens in memory.

    Parameters

    • jwtTokens: JwtTokensInterface

      object containing access + refresh token

      • example: loginWithToken({access:'foo', refresh: 'foo2'})

    Returns void

logout

  • logout(): Promise<any>

refreshToken

submitBytecode

  • submitBytecode(bytecode: string): Promise<any>
  • Submit a smart contract using bytecode only.

    Parameters

    • bytecode: string

      Compiled bytecode of a smart contract for example "0xfe".

    Returns Promise<any>

    Resolves with API response, or throws an an error.

submitSourceCode

  • submitSourceCode(sourceCode: string, contractName: string): Promise<any>
  • Submit a smart contract using sourcecode only.

    Parameters

    • sourceCode: string

      String containing smart contract sourcecode.

    • contractName: string

      Name of the contract to submit for analysis.

    Returns Promise<any>

    Resolves with API response, or throws an an error.

Generated using TypeDoc