@celo/identity › "offchain/accessors/simple" › PrivateSimpleAccessor
Class: PrivateSimpleAccessor <DataType>
A generic schema for writing and reading encrypted objects to and from storage. Passing in a type parameter is supported for runtime type safety.
Type parameters
▪ DataType
Hierarchy
- PrivateSimpleAccessor
Implements
- PrivateAccessor‹DataType›
Index
Constructors
Properties
Methods
Constructors
constructor
+ new PrivateSimpleAccessor(wrapper
: OffchainDataWrapper, type
: Type‹DataType›, dataPath
: string): PrivateSimpleAccessor
Defined in packages/sdk/identity/src/offchain/accessors/simple.ts:74
Parameters:
Name | Type |
---|---|
wrapper |
OffchainDataWrapper |
type |
Type‹DataType› |
dataPath |
string |
Returns: PrivateSimpleAccessor
Properties
Readonly
dataPath
• dataPath: string
Defined in packages/sdk/identity/src/offchain/accessors/simple.ts:78
read
• read: function = makeAsyncThrowable(this.readAsResult.bind(this))
Implementation of PrivateAccessor.read
Defined in packages/sdk/identity/src/offchain/accessors/simple.ts:103
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:77
Readonly
wrapper
• wrapper: OffchainDataWrapper
Defined in packages/sdk/identity/src/offchain/accessors/simple.ts:76
Methods
allowAccess
▸ allowAccess(toAddresses
: Address[], symmetricKey?
: Buffer): Promise‹void | InvalidDataError‹› | OffchainError‹› | UnknownCiphertext‹› | UnavailableKey‹› | InvalidKey‹››
Defined in packages/sdk/identity/src/offchain/accessors/simple.ts:89
Parameters:
Name | Type |
---|---|
toAddresses |
Address[] |
symmetricKey? |
Buffer |
Returns: Promise‹void | InvalidDataError‹› | OffchainError‹› | UnknownCiphertext‹› | UnavailableKey‹› | InvalidKey‹››
readAsResult
▸ readAsResult(account
: Address): Promise‹Result‹DataType, SchemaErrors››
Defined in packages/sdk/identity/src/offchain/accessors/simple.ts:93
Parameters:
Name | Type |
---|---|
account |
Address |
Returns: Promise‹Result‹DataType, SchemaErrors››
write
▸ write(data
: DataType, toAddresses
: Address[], symmetricKey?
: Buffer): Promise‹void | InvalidDataError‹› | OffchainError‹› | UnknownCiphertext‹› | UnavailableKey‹› | InvalidKey‹››
Defined in packages/sdk/identity/src/offchain/accessors/simple.ts:81
Parameters:
Name | Type |
---|---|
data |
DataType |
toAddresses |
Address[] |
symmetricKey? |
Buffer |
Returns: Promise‹void | InvalidDataError‹› | OffchainError‹› | UnknownCiphertext‹› | UnavailableKey‹› | InvalidKey‹››