Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Implements

Index

Constructors

constructor

  • new Company(web3: default, _fromAddress: string, factoryContract: any, contractName: BaseContracts, contractAbi: any[]): Company
  • Parameters

    • web3: default
    • _fromAddress: string
    • factoryContract: any
    • contractName: BaseContracts
    • contractAbi: any[]

    Returns Company

Properties

contract

contract: any = null

Protected contractAbi

contractAbi: any[]

Protected contractName

contractName: BaseContracts

Protected factoryContract

factoryContract: any

Protected web3

web3: default

Accessors

fromAddress

  • get fromAddress(): string
  • Returns string

Methods

assigedCertificates

  • Get all assigned certificates to a company

    Parameters

    • Optional companyAddress: string

      Company address. If not provided, this will default to "fromAddress"

    Returns Promise<ICertificateInstance[]>

    Array of certificate instances

assignCertificate

  • Assign a certificate to a company

    Parameters

    • options: { certificateCode: number; companyAddress: string; stake: string }

      Assign Certificate Options

      • certificateCode: number

        The code of the certificate to be assigned

      • companyAddress: string

        The address of the company that will be assigned the certificate to

      • stake: string

        The amount in wei that will be sent as a stake

    Returns Transaction<{ CompanyAssignedCertificate: CompanyAssignedCertificateEvent }>

    Assigned certificate event

cancelCertificate

  • Cancel a certificate from a company

    Parameters

    • options: { certificateCode: number; companyAddress: string }

      Cancel certificate options

      • certificateCode: number

        The code of the certificate to be canceled

      • companyAddress: string

        The address of the company that the certificate will be canceled

    Returns Transaction<{ CompanyCanceledCertificate: CompanyCanceledCertificateEvent }>

    Canceled certificate event

certificateAssignmentHistory

  • Get certificate assignment history

    Parameters

    • options: { certificateCode?: number; companyAddress: string }

      Filtering options

      • Optional certificateCode?: number

        The certificate code

      • companyAddress: string

    Returns Promise<ICertificateAssignmentHistory>

    Certificate history events

create

ensureContract

  • ensureContract(): Promise<any>

getCertificateInstance

  • Get a certificate instance by a certificate id

    Parameters

    • certificateInstanceId: number

      Certification instance identification number

    Returns Promise<ICertificateInstance>

    A certificate instance

getCompany

  • getCompany(address?: string): Promise<ICompany>
  • Get company by onwer address

    Parameters

    • address: string = ''

      Owner address. If no address is provided it will default to the fromAddress specified at proofchain initiation.

    Returns Promise<ICompany>

    Company Information

getContractAddress

  • getContractAddress(): Promise<any>

getFromCertificate

  • Get the companies that have the specified certificate assigned

    Parameters

    • certificateCode: number

      Certificate code

    Returns Promise<({ assignEvent: CompanyAssignedCertificateEvent } & ICertificateInstance)[]>

    Companies that have the specified certificate assigned

getPastEvents

  • getPastEvents<T>(eventName: string, filter?: object, includeBlockData?: boolean): Promise<T[]>
  • Type parameters

    • T

    Parameters

    • eventName: string
    • filter: object = {}
    • includeBlockData: boolean = false

    Returns Promise<T[]>

getRawPastEvents

  • getRawPastEvents(eventName: string, filter?: object): Promise<default[]>
  • Parameters

    • eventName: string
    • filter: object = {}

    Returns Promise<default[]>

hasCompany

  • hasCompany(address?: string): Promise<boolean>
  • Checks whether an address has a company

    Parameters

    • address: string = ''

      Owner address. If no address is provided it will default to the fromAddress specified at proofchain initiation.

    Returns Promise<boolean>

    True if the owner has a company

revokeCertificate

  • Revoke a certificate from a company

    Parameters

    • options: { certificateCode: number; companyAddress: string }

      Revoke certificate options

      • certificateCode: number

        The code of the certificate to be revoked

      • companyAddress: string

        The address of the company that the certificate will be revoked

    Returns Transaction<{ CompanyRevokedCertificate: CompanyRevokedCertificateEvent }>

    Revoked certificate event

Generated using TypeDoc