Options
All
  • Public
  • Public/Protected
  • All
Menu

Class StubHelper

The StubHelper is a wrapper around the fabric-shim ChaincodeStub. Its a helper to automatically serialize and deserialize data being saved/retreived.

Hierarchy

  • StubHelper

Index

Constructors

constructor

Methods

deleteAllByQuery

  • Deletes all objects returned by the query @param {Object} query the query

    Parameters

    Returns Promise<void[]>

generateUUID

  • generateUUID(name: string): string
  • Generate deterministic UUID

    Parameters

    • name: string

    Returns string

getChaincodeCrypto

  • getChaincodeCrypto(): ShimCrypto
  • Return Fabric crypto library for signing and encryption

    Returns ShimCrypto

getClientIdentity

  • getClientIdentity(): ClientIdentity

getHistoryForKeyAsList

  • getHistoryForKeyAsList(key: string): Promise<any[]>
  • Fetch a history for a specific key and return a list of results.

    Parameters

    • key: string

    Returns Promise<any[]>

getQueryResultAsList

getStateAsDate

  • Parameters

    Returns Promise<Date>

    the state for the given key parsed as a Date

getStateAsObject

  • getStateAsObject(key: string, options?: GetStateOptions): Promise<Object>
  • Parameters

    Returns Promise<Object>

    the state for the given key parsed as an Object

getStateAsString

  • getStateAsString(key: string, options?: GetStateOptions): Promise<string>
  • Parameters

    Returns Promise<string>

    the state for the given key parsed as a String

getStateByRangeAsList

getStub

  • getStub(): ChaincodeStub

getTxDate

  • getTxDate(): Date
  • Returns Date

    the Transaction date as a Javascript Date Object.

putState

  • putState(key: string, value: any, options?: PutStateOptions): Promise<any>
  • Serializes the value and store it on the state db.

    Parameters

    Returns Promise<any>

setEvent

  • setEvent(name: string, payload: object): void
  • Publish an event to the Blockchain

    Parameters

    • name: string
    • payload: object

    Returns void

Generated using TypeDoc