Skip to content

@gala-chain/chaincodeAPI


API > getRangedObjectByKey

Function: getRangedObjectByKey()

getRangedObjectByKey\<T>(ctx, constructor, objectId): Promise\<T>

Type parameters

T extends RangedChainObject

Parameters

ctx: GalaChainContext

constructor: ClassConstructor\<Inferred\<T, RangedChainObject>>

objectId: string

Returns

Description

Lookup a single ranged object by its key. RangedChainObject instances use HyperLedger Fabric's simple key scheme and are indexed in World State separately from the composite key namespace.

The result will be deserialized and returned as an instantiated class instance using the provided constructor.

Remarks

Reads from GalaChainStub if object has been read previously during transaction execution.

Source

chaincode/src/utils/state.ts:273