@celo/identity"offchain/accessors/simple"PublicSimpleAccessor

Class: PublicSimpleAccessor <DataType>

A generic schema for reading and writing objects to and from storage. Passing in a type parameter is supported for runtime type safety.

Type parameters

DataType

Hierarchy

  • PublicSimpleAccessor

PublicNameAccessor

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

+ new PublicSimpleAccessor(wrapper: OffchainDataWrapper, type: Type‹DataType›, dataPath: string): PublicSimpleAccessor

Defined in packages/sdk/identity/src/offchain/accessors/simple.ts:23

Parameters:

Name Type
wrapper OffchainDataWrapper
type Type‹DataType›
dataPath string

Returns: PublicSimpleAccessor

Properties

Readonly dataPath

dataPath: string

Defined in packages/sdk/identity/src/offchain/accessors/simple.ts:27


read

read: function = makeAsyncThrowable(this.readAsResult.bind(this))

Implementation of PublicAccessor.read

Defined in packages/sdk/identity/src/offchain/accessors/simple.ts:67

Type declaration:

▸ (...args: TArgs): Promise‹TResult›

Parameters:

Name Type
...args TArgs

Readonly type

type: Type‹DataType›

Defined in packages/sdk/identity/src/offchain/accessors/simple.ts:26


Readonly wrapper

wrapper: OffchainDataWrapper

Defined in packages/sdk/identity/src/offchain/accessors/simple.ts:25

Methods

readAsResult

readAsResult(account: Address): Promise‹Result‹DataType, SchemaErrors››

Defined in packages/sdk/identity/src/offchain/accessors/simple.ts:52

Parameters:

Name Type
account Address

Returns: Promise‹Result‹DataType, SchemaErrors››


write

write(data: DataType): Promise‹undefined | InvalidDataError‹› | OffchainError‹››

Defined in packages/sdk/identity/src/offchain/accessors/simple.ts:36

Parameters:

Name Type
data DataType

Returns: Promise‹undefined | InvalidDataError‹› | OffchainError‹››