Skip to content

API documentation of Agoric SDK / Exports / @agoric/store / index

Module: index

Table of contents

Variables

Functions

Variables

M

Const M: MatcherNamespace

Defined in

node_modules/@endo/patterns/src/patterns/patternMatchers.d.ts:18

Functions

assertKey

assertKey(val): void

Parameters

NameType
valany

Returns

void

Defined in

node_modules/@endo/patterns/src/keys/checkKey.d.ts:8


assertPattern

assertPattern(patt): void

Parameters

NameType
pattany

Returns

void

Defined in

node_modules/@endo/patterns/src/patterns/patternMatchers.d.ts:15


assertScalarKey

assertScalarKey(val): void

Parameters

NameType
valany

Returns

void

Defined in

node_modules/@endo/patterns/src/keys/checkKey.d.ts:5


bagCompare

bagCompare<K>(left, right): number

Type parameters

Name
K

Parameters

NameType
leftCopyBag<K>
rightCopyBag<K>

Returns

number

Defined in

node_modules/@endo/patterns/src/keys/compareKeys.d.ts:2


bagDisjointSubtract

bagDisjointSubtract(xbag, ybag): CopyBag

Parameters

NameType
xbagany
ybagany

Returns

CopyBag

Defined in

node_modules/@endo/patterns/src/keys/merge-bag-operators.d.ts:5


bagIntersection

bagIntersection(xbag, ybag): CopyBag

Parameters

NameType
xbagany
ybagany

Returns

CopyBag

Defined in

node_modules/@endo/patterns/src/keys/merge-bag-operators.d.ts:4


bagIsSuperbag

bagIsSuperbag(xbag, ybag): any

Parameters

NameType
xbagany
ybagany

Returns

any

Defined in

node_modules/@endo/patterns/src/keys/merge-bag-operators.d.ts:1


bagUnion

bagUnion(xbag, ybag): CopyBag

Parameters

NameType
xbagany
ybagany

Returns

CopyBag

Defined in

node_modules/@endo/patterns/src/keys/merge-bag-operators.d.ts:3


coerceToBagEntries

coerceToBagEntries(bagEntriesList): [any, bigint][]

Parameters

NameType
bagEntriesListany

Returns

[any, bigint][]

Defined in

node_modules/@endo/patterns/src/keys/copyBag.d.ts:4


coerceToElements

coerceToElements(elementsList): any[]

Parameters

NameType
elementsListany

Returns

any[]

Defined in

node_modules/@endo/patterns/src/keys/copySet.d.ts:4


compareKeys

compareKeys(left, right): number

Parameters

NameType
leftany
rightany

Returns

number

Defined in

node_modules/@endo/patterns/src/keys/compareKeys.d.ts:4


defineExoClass

defineExoClass<I, M>(tag, interfaceGuard, init, methods, options?): (...args: Parameters<I>) => Guarded<M>

Type parameters

NameType
Iextends (...args: any[]) => any
Mextends Methods

Parameters

NameType
tagstring
interfaceGuardundefined | InterfaceGuard<{ [K in string | number | symbol]: MethodGuard }>
initI
methodsM & ThisType<{ self: Guarded<M> ; state: ReturnType<I> }>
options?FarClassOptions<ClassContext<S, M>, any>

Returns

fn

▸ (...args): Guarded<M>

Parameters
NameType
...argsParameters<I>
Returns

Guarded<M>

Defined in

node_modules/@endo/exo/src/exo-makers.d.ts:2


defineExoClassKit

defineExoClassKit<I, F>(tag, interfaceGuardKit, init, methodsKit, options?): (...args: Parameters<I>) => GuardedKit<F>

Type parameters

NameType
Iextends (...args: any[]) => any
Fextends Record<string, Methods>

Parameters

NameType
tagstring
interfaceGuardKitundefined | { [K in string | number | symbol]: InterfaceGuard<{ [M in string | number | symbol]: MethodGuard }> }
initI
methodsKitF & { [K_1 in string | number | symbol]: ThisType<Object> }
options?FarClassOptions<KitContext<S, F>, GuardedKit<F>>

Returns

fn

▸ (...args): GuardedKit<F>

Parameters
NameType
...argsParameters<I>
Returns

GuardedKit<F>

Defined in

node_modules/@endo/exo/src/exo-makers.d.ts:6


elementsCompare

elementsCompare(xelements, yelements): any

Parameters

NameType
xelementsany
yelementsany

Returns

any

Defined in

node_modules/@endo/patterns/src/keys/merge-set-operators.d.ts:3


elementsDisjointSubtract

elementsDisjointSubtract(xelements, yelements): any

Parameters

NameType
xelementsany
yelementsany

Returns

any

Defined in

node_modules/@endo/patterns/src/keys/merge-set-operators.d.ts:7


elementsDisjointUnion

elementsDisjointUnion(xelements, yelements): any

Parameters

NameType
xelementsany
yelementsany

Returns

any

Defined in

node_modules/@endo/patterns/src/keys/merge-set-operators.d.ts:5


elementsIntersection

elementsIntersection(xelements, yelements): any

Parameters

NameType
xelementsany
yelementsany

Returns

any

Defined in

node_modules/@endo/patterns/src/keys/merge-set-operators.d.ts:6


elementsIsDisjoint

elementsIsDisjoint(xelements, yelements): any

Parameters

NameType
xelementsany
yelementsany

Returns

any

Defined in

node_modules/@endo/patterns/src/keys/merge-set-operators.d.ts:2


elementsIsSuperset

elementsIsSuperset(xelements, yelements): any

Parameters

NameType
xelementsany
yelementsany

Returns

any

Defined in

node_modules/@endo/patterns/src/keys/merge-set-operators.d.ts:1


elementsUnion

elementsUnion(xelements, yelements): any

Parameters

NameType
xelementsany
yelementsany

Returns

any

Defined in

node_modules/@endo/patterns/src/keys/merge-set-operators.d.ts:4


getCopyBagEntries

getCopyBagEntries<K>(b): [K, bigint][]

Type parameters

Name
K

Parameters

NameType
bCopyBag<K>

Returns

[K, bigint][]

Defined in

node_modules/@endo/patterns/src/keys/checkKey.d.ts:42


getCopyMapEntries

getCopyMapEntries<K, V>(m): Iterable<[K, V]>

Type parameters

NameType
Kextends unknown
Vextends unknown

Parameters

NameType
mCopyMap<K, V>

Returns

Iterable<[K, V]>

Defined in

node_modules/@endo/patterns/src/keys/checkKey.d.ts:64


getCopySetKeys

getCopySetKeys<K>(s): K[]

Type parameters

Name
K

Parameters

NameType
sCopySet<K>

Returns

K[]

Defined in

node_modules/@endo/patterns/src/keys/checkKey.d.ts:24


getRankCover

getRankCover(payload, encodePassable): RankCover

Parameters

NameType
payloadany
encodePassableKeyToDBKey

Returns

RankCover

Defined in

node_modules/@endo/patterns/src/patterns/patternMatchers.d.ts:17


initEmpty

initEmpty(): Object

Returns

Object

Defined in

node_modules/@endo/exo/src/exo-makers.d.ts:1


isCopyMap

isCopyMap(m): m is CopyMap<any, any>

Parameters

NameType
many

Returns

m is CopyMap<any, any>

Defined in

node_modules/@endo/patterns/src/keys/checkKey.d.ts:53


isCopySet

isCopySet(s): s is CopySet<any>

Parameters

NameType
sany

Returns

s is CopySet<any>

Defined in

node_modules/@endo/patterns/src/keys/checkKey.d.ts:16


isKey

isKey(val): boolean

Parameters

NameType
valany

Returns

boolean

Defined in

node_modules/@endo/patterns/src/keys/checkKey.d.ts:7


isPattern

isPattern(patt): boolean

Parameters

NameType
pattany

Returns

boolean

Defined in

node_modules/@endo/patterns/src/patterns/patternMatchers.d.ts:16


keyEQ

keyEQ(left, right): boolean

Parameters

NameType
leftany
rightany

Returns

boolean

Defined in

node_modules/@endo/patterns/src/keys/compareKeys.d.ts:7


keyGT

keyGT(left, right): boolean

Parameters

NameType
leftany
rightany

Returns

boolean

Defined in

node_modules/@endo/patterns/src/keys/compareKeys.d.ts:9


keyGTE

keyGTE(left, right): boolean

Parameters

NameType
leftany
rightany

Returns

boolean

Defined in

node_modules/@endo/patterns/src/keys/compareKeys.d.ts:8


keyLT

keyLT(left, right): boolean

Parameters

NameType
leftany
rightany

Returns

boolean

Defined in

node_modules/@endo/patterns/src/keys/compareKeys.d.ts:5


keyLTE

keyLTE(left, right): boolean

Parameters

NameType
leftany
rightany

Returns

boolean

Defined in

node_modules/@endo/patterns/src/keys/compareKeys.d.ts:6


makeCopyBag

makeCopyBag<K>(bagEntryIter): CopyBag<K>

Type parameters

Name
K

Parameters

NameType
bagEntryIterIterable<[K, bigint]>

Returns

CopyBag<K>

Defined in

node_modules/@endo/patterns/src/keys/checkKey.d.ts:44


makeCopyBagFromElements

makeCopyBagFromElements<K>(elementIter): CopyBag<K>

Type parameters

Name
K

Parameters

NameType
elementIterIterable<K>

Returns

CopyBag<K>

Defined in

node_modules/@endo/patterns/src/keys/checkKey.d.ts:45


makeCopyMap

makeCopyMap<K, V>(entries): CopyMap<K, V>

Type parameters

NameType
Kextends unknown
Vextends unknown

Parameters

NameType
entriesIterable<[K, V]>

Returns

CopyMap<K, V>

Defined in

node_modules/@endo/patterns/src/keys/checkKey.d.ts:68


makeCopySet

makeCopySet<K>(elementIter): CopySet<K>

Type parameters

Name
K

Parameters

NameType
elementIterIterable<K>

Returns

CopySet<K>

Defined in

node_modules/@endo/patterns/src/keys/checkKey.d.ts:26


makeExo

makeExo<T>(tag, interfaceGuard, methods, options?): Guarded<T>

Type parameters

NameType
Textends Methods

Parameters

NameType
tagstring
interfaceGuardundefined | InterfaceGuard<{ [M in string | number | symbol]: MethodGuard }>
methodsT
options?FarClassOptions<ClassContext<S, M>, any>

Returns

Guarded<T>

Defined in

node_modules/@endo/exo/src/exo-makers.d.ts:10


makeLegacyMap

makeLegacyMap<K, V>(tag?): LegacyMap<K, V>

This module and its fraternal sibling legacyWeakMap exist only to ease a transition to the modern store system, are deprecated, and will eventually disappear. They are needed for now to support some of the uses of the old behavior that are not compatible with the new. The constraint imposed by the new is that only passables can be used as values, and only keys (roughly, structures, aka comparables) can be used as values.

See https://github.com/Agoric/agoric-sdk/pull/3567

TODO Once that PR is merged, link to the documents rather than the PRs.

Each of these non-conforming uses should be marked with a

js
// Legacy because...

comment explaining the problem inhibiting conversion to the new system. Some of these problems as of this writing:

  • A promiseKit used as a value, even though a promiseKit is not a passable. Solutions are to make it a passable, or to convert the container back to a conventional JavaScript Map.
  • A mutable array used as a value, that is subsequently mutated. Freezing the array wouldn't work of course because it would break the subsequent mutation. Using a far object wrapping an array would likely work fine.

Type parameters

Name
K
V

Parameters

NameTypeDefault valueDescription
tag?string'key'tag for debugging

Returns

LegacyMap<K, V>

Deprecated

switch to ScalarMap if possible, Map otherwise

Defined in

packages/store/src/legacy/legacyMap.js:39


makeLegacyWeakMap

makeLegacyWeakMap<K, V>(tag?): LegacyWeakMap<K, V>

See doccomment in the closely related legacyMap.js module.

Type parameters

Name
K
V

Parameters

NameTypeDefault valueDescription
tag?string'key'tag for debugging

Returns

LegacyWeakMap<K, V>

Deprecated

switch to ScalarWeakMap if possible, WeakMap otherwise

Defined in

packages/store/src/legacy/legacyWeakMap.js:14


makeScalarMapStore

makeScalarMapStore<K, V>(tag?, options?): MapStore<K, V>

Distinguishes between adding a new key (init) and updating or referencing a key (get, set, delete).

init is only allowed if the key does not already exist. Get, set and delete are only allowed if the key does already exist.

This is a scalar map in that the keys can only be atomic values, primitives or remotables. Other storeMaps will accept, for example, copyArrays and copyRecords, as keys and look them up based on equality of their contents.

Type parameters

NameType
Kextends unknown
Vextends unknown

Parameters

NameTypeDefault valueDescription
tag?string'key'the column name for the key
options?StoreOptions{}-

Returns

MapStore<K, V>

Defined in

packages/store/src/stores/scalarMapStore.js:136


makeScalarSetStore

makeScalarSetStore<K>(tag?, options?): SetStore<K>

Distinguishes between adding a new key (init) and updating or referencing a key (get, set, delete).

init is only allowed if the key does not already exist. Get, set and delete are only allowed if the key does already exist.

This is a scalar set in that the keys can only be atomic values, primitives or remotables. Other storeSets will accept, for example, copyArrays and copyRecords, as keys and look them up based on equality of their contents.

Type parameters

Name
K

Parameters

NameTypeDefault valueDescription
tag?string'key'tag for debugging
options?StoreOptions{}-

Returns

SetStore<K>

Defined in

packages/store/src/stores/scalarSetStore.js:92


makeScalarWeakMapStore

makeScalarWeakMapStore<K, V>(tag?, options?): WeakMapStore<K, V>

This is a scalar mapStore in that the keys can only be atomic values: primitives or remotables. Other mapStores will accept, for example, copyArrays and copyRecords as keys and look them up based on equality of their contents.

TODO For now, this scalarWeakMap accepts only remotables, reflecting the constraints of the underlying JavaScript WeakMap it uses internally. But it should accept the primitives as well, storing them in a separate internal map. What makes it "weak" is that it provides no API for enumerating what's there. Though note that this would only enables collection of the remotables, since the other primitives may always reappear.

Type parameters

Name
K
V

Parameters

NameTypeDefault valueDescription
tag?string'key'tag for debugging
options?StoreOptions{}-

Returns

WeakMapStore<K, V>

Defined in

packages/store/src/stores/scalarWeakMapStore.js:99


makeScalarWeakSetStore

makeScalarWeakSetStore<K>(tag?, options?): WeakSetStore<K>

This is a scalar set in that the keys can only be atomic values, primitives or remotables. Other storeSets will accept, for example, copyArrays and copyRecords, as keys and look them up based on equality of their contents.

TODO For now, this scalarWeakSet accepts only remotables, reflecting the constraints of the underlying JavaScript WeakSet it uses internally. But it should accept the primitives as well, storing them in a separate internal set. What makes it "weak" is that it provides no API for enumerating what's there. Though note that this would only enables collection of the remotables, since the other primitives may always appear.

Type parameters

Name
K

Parameters

NameTypeDefault valueDescription
tag?string'key'tag for debugging
options?StoreOptions{}-

Returns

WeakSetStore<K>

Defined in

packages/store/src/stores/scalarWeakSetStore.js:81


matches

matches(specimen, patt): boolean

Parameters

NameType
specimenany
pattany

Returns

boolean

Defined in

node_modules/@endo/patterns/src/patterns/patternMatchers.d.ts:13


mustMatch

mustMatch(specimen, patt, label?): void

Parameters

NameType
specimenany
pattany
label?string | number

Returns

void

Defined in

node_modules/@endo/patterns/src/patterns/patternMatchers.d.ts:14


provideLazy

provideLazy<K, V>(mapStore, key, makeValue): V

Call provideLazy to get or make the value associated with the key. If there already is one, return that. Otherwise, call makeValue(key), remember it as the value for that key, and return it.

Type parameters

Name
K
V

Parameters

NameType
mapStoreWeakMapStore<K, V>
keyK
makeValue(key: K) => V

Returns

V

Defined in

packages/store/src/stores/store-utils.js:97


setCompare

setCompare<K>(left, right): number

Type parameters

NameType
Kextends unknown

Parameters

NameType
leftCopySet<K>
rightCopySet<K>

Returns

number

Defined in

node_modules/@endo/patterns/src/keys/compareKeys.d.ts:1


setDisjointSubtract

setDisjointSubtract(xset, yset): CopySet

Parameters

NameType
xsetany
ysetany

Returns

CopySet

Defined in

node_modules/@endo/patterns/src/keys/merge-set-operators.d.ts:13


setDisjointUnion

setDisjointUnion(xset, yset): CopySet

Parameters

NameType
xsetany
ysetany

Returns

CopySet

Defined in

node_modules/@endo/patterns/src/keys/merge-set-operators.d.ts:11


setIntersection

setIntersection(xset, yset): CopySet

Parameters

NameType
xsetany
ysetany

Returns

CopySet

Defined in

node_modules/@endo/patterns/src/keys/merge-set-operators.d.ts:12


setIsDisjoint

setIsDisjoint(xset, yset): any

Parameters

NameType
xsetany
ysetany

Returns

any

Defined in

node_modules/@endo/patterns/src/keys/merge-set-operators.d.ts:9


setIsSuperset

setIsSuperset(xset, yset): any

Parameters

NameType
xsetany
ysetany

Returns

any

Defined in

node_modules/@endo/patterns/src/keys/merge-set-operators.d.ts:8


setUnion

setUnion(xset, yset): CopySet

Parameters

NameType
xsetany
ysetany

Returns

CopySet

Defined in

node_modules/@endo/patterns/src/keys/merge-set-operators.d.ts:10