Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

constructor

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

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

    Returns Transport

Properties

TransportStatusEnum

TransportStatusEnum: typeof TransportStatusEnum = ...

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

all

  • all(options?: { receiver?: string; sender?: string; transportCompany?: string }): Promise<ITransport[]>
  • Get all transports

    Parameters

    • options: { receiver?: string; sender?: string; transportCompany?: string } = {}

      Fetch filters

      • Optional receiver?: string

        The receiver of the transport

      • Optional sender?: string

        The sender of the transport

      • Optional transportCompany?: string

        The tranport company associated with this transport

    Returns Promise<ITransport[]>

    Fetched transports

ensureContract

  • ensureContract(): Promise<any>

finaliseTransport

  • Sets a transport as finalised

    Parameters

    • options: { password?: string; transportId: number }

      Transport finalisation options

      • Optional password?: string

        Transport password

      • transportId: number

        Traget transport id

    Returns Transaction<{ TransportStatus: TransportStatusEvent }>

    Transport finalised event

getBatchIds

  • getBatchIds(transportId: number): Promise<number[]>
  • Get transport batches

    Parameters

    • transportId: number

      Transport id

    Returns Promise<number[]>

    Transport batches

getById

  • getById(transportId: number): Promise<ITransport>
  • Get a transport by id

    Parameters

    • transportId: number

      Transport id

    Returns Promise<ITransport>

    Transport data

getContractAddress

  • getContractAddress(): Promise<any>

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[]>

getStatusEvents

  • Get all status events from a transport

    Parameters

    • transportId: number

      Transport id

    Returns Promise<TransportStatusEvent[]>

    Transport status events

initiate

  • initiate(options: { batchIds: number[]; password?: string; receiver: string; transportCompany: string }): Transaction<{ TransportCreated: TransportCreatedEvent }>
  • Creates a new transport

    Parameters

    • options: { batchIds: number[]; password?: string; receiver: string; transportCompany: string }

      Transport options

      • batchIds: number[]

        Transport batches

      • Optional password?: string

        Transport password

      • receiver: string

        Transport receiver

      • transportCompany: string

        Transport company

    Returns Transaction<{ TransportCreated: TransportCreatedEvent }>

    Transport created event

setTransportStatus

  • Set a new status to a transport

    Parameters

    Returns Transaction<{ TransportStatus: TransportStatusEvent }>

    Transport status chaged event

Generated using TypeDoc