Store
Last updated
Last updated
• Docs
/ / Store
A store that can fetch and save twines
fetch(
cid
): <null
| <>>
Fetch a twine from storage, returning null if it is not found
it is NOT expected that the twine signature is checked, that is for the to do.
Parameters
cid
The CID of the twine to fetch
Returns
Defined in
Save a twine to storage
Parameters
twine
The twine to save
Returns
Defined in
Save many twines to storage
Parameters
twines
The twines to save
Returns
Defined in
Delete a twine from storage
Parameters
cid
The CID of the twine to delete
Returns
Defined in
resolve(query, options)
Resolve a chain from a query
This is the main way to get a pulse or chain from somewhere and have it automatically verified.
If the input is already a successful resolution, it will be returned as is.
If the input is a chain or pulse, it will be resolved as a chain or pulse resolution.
Parameters
query
The query to resolve
options
?
Options for the resolution
Returns
A chain or pulse resolution
Examples
Inherited from
Defined in
resolve(query, options)
Resolve a pulse (with its chain) from a query
Parameters
query
options
?
Returns
Inherited from
Defined in
Resolve the latest pulse of a chain
Parameters
chain
The chain CID or chain itself to resolve the latest pulse from
options
?
Options for the resolution
Returns
A pulse resolution
Examples
Inherited from
Defined in
Resolve a pulse by index
Parameters
chain
The chain CID or chain itself to resolve the pulse from
index
number
The index of the pulse to resolve
options
?
Options for the resolution
Returns
A pulse resolution
Example
Inherited from
Defined in
Check if a cid can be resolved
Parameters
cid
The CID to check
Returns
True if the CID can be resolved, false otherwise
Example
Inherited from
Defined in
Get the pulses of a chain
Parameters
chain
The chain CID or chain itself to get the pulses from
start
?
The index or CID of the pulse to start from
options
?
Options for the resolution
Returns
An sync/async iterable of pulses
Example
Inherited from
Defined in
Get the chains that are known to the resolver
Returns
An sync/async iterable of chains
Example
Inherited from
Defined in
<null
| <>>
save(twine
): <void
>
<>
<void
>
saveMany(twines
): <void
>
<<>>
<void
>
delete(cid
): <void
>
<void
>
resolve(query
, options
?): Promise
<>
Promise
<>
.
resolve(query
, options
?): Promise
<>
Promise
<>
.
resolveLatest(chain
, options
?): Promise
<>
Promise
<>
.
resolveIndex(chain
, index
, options
?): Promise
<>
Promise
<>
.
has(cid
): <boolean
>
<boolean
>
.
pulses(chain
, start
?, options
?): AsyncGenerator
<, any
, any
> | Generator
<, any
, any
> | <>
number
|
AsyncGenerator
<, any
, any
> | Generator
<, any
, any
> | <>
.
chains(): AsyncGenerator
<, any
, any
> | Generator
<, any
, any
> | <>
AsyncGenerator
<, any
, any
> | Generator
<, any
, any
> | <>
.