SDK

list

What geode.list returns, where the entries come from, and the errors it raises.

TypeScript
list(): Promise<FileEntry[]>

list returns the files in the vault: the entries of its encrypted manifest, in the order they were stored. Each entry is a copy; changing it changes nothing in the client.

What it does

  1. Unlock the vault

    On the client's first vault call, the wallet signs the key message, and the client reads the manifest at the vault's locator, decrypts it with the view key and checks every entry, as in recover.

  2. Return the entries

    The client returns its entries from memory. A file stored by this client joins the list once its upload succeeds, when store reads the manifest again, before the manifest itself is paid for. Files stored from another client of the same wallet appear after recover or a store on this client reads the newer manifest.

Return value

FileEntry
id
string
The Irys id of the ciphertext.
key
string
The file key, 43 base64url characters.
receipt
string
The receipt the payment is bound to, 0x and 64 hex digits.
bucket
Bucket
The ciphertext size in bytes.
term
Term
The term the file was paid for.
link
string
The relative share link /s/<id>#<key>, rebuilt from id and key when the manifest is read.
name
string
The file name.
type
string
The media type.
size
number
The plaintext size in bytes.
storedAt
string
ISO 8601 UTC time the relayer stored the file, from POST /upload.

The name, type and size exist only inside the manifest, which is sealed under the view key. The chain and Irys hold the bucket.

What it costs

Nothing. No transaction is sent.

Errors

CodeRaised when
WALLET_REJECTEDThe client has no wallet, or the wallet declines the key message
VALIDATION_ERRORThe manifest has an unsupported format or an invalid entry, or a note memo is malformed
WRONG_KEYThe manifest does not decrypt under the view key
NOT_FOUND, IRYS_UNAVAILABLE, PAYLOAD_TOO_LARGE, CONFIGURATION_REQUIREDThe manifest ciphertext cannot be fetched
UNKNOWN_ROOTThe tree leaves the relayer returned do not hash to its root
RELAYER_FAILEDA relayer reply does not match the contract
UPSTREAM_UNAVAILABLEA network failure or any other unrecognised error

Codes from /manifest and /tree pass through as listed at /docs/api#errors.

Sample

TypeScript
const entries = await geode.list()
for (const entry of entries) console.log(entry.name, entry.size, entry.term, entry.storedAt)