PrivateStateProvider
Midnight.js API Reference v2.0.2
Midnight.js API Reference / @midnight-ntwrk/midnight-js-types / PrivateStateProvider
Interface: PrivateStateProvider<PSI, PS>
Interface for a typed key-valued store containing contract private states.
Type Parametersβ
PSIβ
PSI extends PrivateStateId = PrivateStateId
Parameter indicating the private state ID, sometimes a union of string literals.
PSβ
PS = any
Parameter indicating the private state type stored, sometimes a union of private state types.
Methodsβ
clear()β
clear():
Promise<void>
Remove all contract private states.
Returnsβ
Promise<void>
clearSigningKeys()β
clearSigningKeys():
Promise<void>
Remove all contract signing keys.
Returnsβ
Promise<void>
get()β
get(
privateStateId):Promise<null|PS>
Retrieve the private state at the given private state ID.
Parametersβ
privateStateIdβ
PSI
The private state identifier.
Returnsβ
Promise<null | PS>
getSigningKey()β
getSigningKey(
address):Promise<null|string>
Retrieve the signing key for a contract.
Parametersβ
addressβ
string
The address of the contract for which to get the signing key.
Returnsβ
Promise<null | string>
remove()β
remove(
privateStateId):Promise<void>
Remove the value at the given private state ID.
Parametersβ
privateStateIdβ
PSI
The private state identifier.
Returnsβ
Promise<void>
removeSigningKey()β
removeSigningKey(
address):Promise<void>
Remove the signing key for a contract.
Parametersβ
addressβ
string
The address of the contract for which to delete the signing key.
Returnsβ
Promise<void>
set()β
set(
privateStateId,state):Promise<void>
Store the given private state at the given private state ID.
Parametersβ
privateStateIdβ
PSI
The private state identifier.
stateβ
PS
The private state to store.
Returnsβ
Promise<void>
setSigningKey()β
setSigningKey(
address,signingKey):Promise<void>
Store the given signing key at the given address.
Parametersβ
addressβ
string
The address of the contract having the given signing key.
signingKeyβ
string
The signing key to store.
Returnsβ
Promise<void>