@xyo-network/xl1-protocol-sdk 1.26.46 → 1.26.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,52 @@
1
+ /**
2
+ * A `Backing` names a class of runtime resources a provider may need access to.
3
+ * Each backing is owned (writable) by exactly one actor in a deployment; other
4
+ * actors may hold it as read-only or not at all.
5
+ *
6
+ * - `chain-store` — finalized/canonical chain archivists. Owned by the Finalizer.
7
+ * - `mempool-store` — pending transaction and pending block archivists. Owned by the Mempool actor.
8
+ * - `dlq-store` — rejected blocks and rejected transactions archivists. Owned by the Finalizer.
9
+ * - `indexer-store` — derived summary maps (account balances, transfers, etc.).
10
+ * Owned by the IndexerActor.
11
+ * - `evm-rpc` — connection to the backing EVM chain (Sepolia/Mainnet/Hardhat). Owned by the Bridge.
12
+ * - `wallet` — per-actor signing wallet. Each actor owns its own.
13
+ * - `network` — JSON-RPC transport to another XL1 actor. Pure transport; no ownership.
14
+ */
15
+ export type Backing = 'chain-store' | 'mempool-store' | 'dlq-store' | 'indexer-store' | 'evm-rpc' | 'wallet' | 'network';
16
+ /**
17
+ * A `BackingNeed` pairs a backing with the access mode required.
18
+ *
19
+ * - `read` is satisfied by either a `read` or `write` ownership in the locator.
20
+ * - `write` is only satisfied by `write` ownership.
21
+ *
22
+ * Descriptors declare the backings they need; locators declare the backings they have.
23
+ * The resolver filters out descriptors whose backings aren't a subset of the locator's.
24
+ */
25
+ export interface BackingNeed {
26
+ readonly backing: Backing;
27
+ readonly mode: 'read' | 'write';
28
+ }
29
+ /**
30
+ * The two API surfaces exposed by an XL1 API actor over JSON-RPC.
31
+ *
32
+ * - `node` — point queries on canonical chain state (block/tx/mempool/finality/balance).
33
+ * Analogous to a base Ethereum node's RPC. Exposed at `POST /rpc`.
34
+ * - `indexed` — cross-key or aggregate queries that require an indexer
35
+ * (stake-by-staker, stake-events, NetworkStake step rewards, etc.).
36
+ * Analogous to Etherscan-style APIs. Exposed at `POST /rpc/indexed`.
37
+ *
38
+ * The litmus test: if the query is `f(primary_key) → value` it's `node`; if it's
39
+ * `f(secondary_attribute) → list` it's `indexed`.
40
+ */
41
+ export type Surface = 'node' | 'indexed';
42
+ /**
43
+ * Returns true iff every need in `required` is satisfied by some entry in `available`.
44
+ * `read` is satisfied by either `read` or `write`; `write` requires `write`.
45
+ */
46
+ export declare function backingsSatisfied(required: readonly BackingNeed[], available: readonly BackingNeed[]): boolean;
47
+ /**
48
+ * Diagnostic helper: returns a human-readable description of which needs are unmet
49
+ * given the available backings.
50
+ */
51
+ export declare function unmetBackings(required: readonly BackingNeed[], available: readonly BackingNeed[]): readonly BackingNeed[];
52
+ //# sourceMappingURL=Backing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Backing.d.ts","sourceRoot":"","sources":["../../../src/capabilities/Backing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,OAAO,GACb,aAAa,GACb,eAAe,GACf,WAAW,GACX,eAAe,GACf,SAAS,GACT,QAAQ,GACR,SAAS,CAAA;AAEf;;;;;;;;GAQG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;CAChC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,SAAS,CAAA;AAExC;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,SAAS,WAAW,EAAE,EAChC,SAAS,EAAE,SAAS,WAAW,EAAE,GAChC,OAAO,CAMT;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,SAAS,WAAW,EAAE,EAChC,SAAS,EAAE,SAAS,WAAW,EAAE,GAChC,SAAS,WAAW,EAAE,CAIxB"}
@@ -0,0 +1,40 @@
1
+ import type { ProviderMoniker } from '@xyo-network/xl1-protocol-model';
2
+ import type { Surface } from './Backing.ts';
3
+ export type { ProviderMoniker } from '@xyo-network/xl1-protocol-model';
4
+ /**
5
+ * Declarative description of a capability that an actor may need.
6
+ *
7
+ * The capability registry is a sidecar to the moniker namespace — every
8
+ * moniker that an actor consumes should have a corresponding `Capability`
9
+ * entry. The registry is what lets the resolver walk transitive needs
10
+ * (via `implies`) and produce useful diagnostics.
11
+ */
12
+ export interface Capability {
13
+ /** Canonical id — equals the existing moniker constant string. */
14
+ readonly id: ProviderMoniker;
15
+ /**
16
+ * Other capabilities a consumer of this one transitively requires.
17
+ * Drives plan-time prerequisite walking — e.g. `BlockRunner` requires
18
+ * `BlockViewer`, `MempoolRunner`, `MempoolViewer`, etc.
19
+ */
20
+ readonly implies?: readonly ProviderMoniker[];
21
+ readonly kind: 'viewer' | 'runner' | 'gateway' | 'archivist' | 'signer';
22
+ /** Human label for diagnostics. */
23
+ readonly label: string;
24
+ /**
25
+ * Which API surface this capability is exposed under — `'node'` for point
26
+ * queries on canonical state (Ethereum-node analog) or `'indexed'` for
27
+ * cross-key/aggregate queries (Etherscan analog). Connection-level umbrellas
28
+ * (`XyoConnection`, `XyoGatewayRunner`) carry `'node'`; the actual filtering
29
+ * is done downstream by `connectionSubsetBySurface`.
30
+ */
31
+ readonly surface: Surface;
32
+ }
33
+ export interface CapabilityRegistryInstance {
34
+ get(id: ProviderMoniker): Capability;
35
+ register(cap: Capability): this;
36
+ toJson(): Record<ProviderMoniker, Omit<Capability, 'id'>>;
37
+ tryGet(id: ProviderMoniker): Capability | undefined;
38
+ }
39
+ export declare function createCapabilityRegistry(): CapabilityRegistryInstance;
40
+ //# sourceMappingURL=Capability.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Capability.d.ts","sourceRoot":"","sources":["../../../src/capabilities/Capability.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AAEtE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C,YAAY,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AAEtE;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU;IACzB,kEAAkE;IAClE,QAAQ,CAAC,EAAE,EAAE,eAAe,CAAA;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,eAAe,EAAE,CAAA;IAC7C,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAA;IACvE,mCAAmC;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;CAC1B;AAED,MAAM,WAAW,0BAA0B;IACzC,GAAG,CAAC,EAAE,EAAE,eAAe,GAAG,UAAU,CAAA;IACpC,QAAQ,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI,CAAA;IAC/B,MAAM,IAAI,MAAM,CAAC,eAAe,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAA;IACzD,MAAM,CAAC,EAAE,EAAE,eAAe,GAAG,UAAU,GAAG,SAAS,CAAA;CACpD;AAiCD,wBAAgB,wBAAwB,IAAI,0BAA0B,CAErE"}
@@ -0,0 +1,64 @@
1
+ import type { CreatableProviderFactory } from '../CreatableProvider/index.ts';
2
+ import type { BackingNeed, Surface } from './Backing.ts';
3
+ import type { CapabilityRegistryInstance, ProviderMoniker } from './Capability.ts';
4
+ /**
5
+ * Tier expresses *intrinsic strength* of a provider — lower numbers win.
6
+ *
7
+ * - `1` — In-process, direct backing-store access (Simple* providers reading/writing the local archivist).
8
+ * - `2` — Direct EVM contract access (Evm* providers calling Ethereum nodes for chain-of-truth data).
9
+ * - `3` — Remote JSON-RPC to another XL1 node (JsonRpc* providers).
10
+ * - `4` — Stub/fallback (Simple* providers fed empty arrays — usable only when nothing better exists).
11
+ */
12
+ export type ProviderTier = 1 | 2 | 3 | 4;
13
+ /**
14
+ * Sidecar metadata for a `CreatableProviderFactory`-producing class. Tells the
15
+ * resolver which capability the provider satisfies, at what tier, under what
16
+ * preconditions, and how to construct the factory at plan time.
17
+ *
18
+ * Descriptors are deliberately separated from the provider classes themselves
19
+ * so the SDK packages stay un-coupled to the descriptor system — descriptors
20
+ * live alongside the consumer that picks them.
21
+ */
22
+ export interface ProviderDescriptor<TCtx extends ResolutionContext = ResolutionContext> {
23
+ /**
24
+ * The backing resources this descriptor's `build()` reads from `ctx`. Used
25
+ * by the resolver to filter out descriptors whose backings are not a subset
26
+ * of the locator's `availableBackings`. Empty array means the descriptor
27
+ * has no backing needs (pure stateless factory or function-only viewer).
28
+ */
29
+ readonly backings: readonly BackingNeed[];
30
+ /** Globally-unique key, usually `<className>` — used in snapshots and diagnostics. */
31
+ readonly id: string;
32
+ /** Soft tie-break inside a tier; higher wins. Default 0. */
33
+ readonly priority?: number;
34
+ /** Capabilities this provider satisfies (typically one moniker, occasionally several). */
35
+ readonly satisfies: readonly ProviderMoniker[];
36
+ /**
37
+ * Which API surface this descriptor's capability is exposed under. Mirrors
38
+ * the corresponding `Capability.surface`; declared on the descriptor too so
39
+ * the resolver can filter candidates by surface without a registry lookup.
40
+ */
41
+ readonly surface: Surface;
42
+ readonly tier: ProviderTier;
43
+ /**
44
+ * Build the factory args from the resolution context. Returning undefined
45
+ * signals "skip me at runtime" (preconditions said yes, but a missing optional
46
+ * resource was discovered during the build).
47
+ */
48
+ build(ctx: TCtx): CreatableProviderFactory | undefined;
49
+ /**
50
+ * Returns true iff the provider can be constructed in this process given `ctx`.
51
+ * Pure & sync — must not read DB or do I/O.
52
+ */
53
+ preconditions(ctx: TCtx): boolean;
54
+ }
55
+ /**
56
+ * Inputs the resolver hands to descriptors. `capabilities` is the registry
57
+ * the resolver consults for `implies` walks. Subtypes may extend this with
58
+ * live runtime resources — archivists, EVM provider, wallet — that descriptors
59
+ * need at `build()` time.
60
+ */
61
+ export interface ResolutionContext {
62
+ readonly capabilities: CapabilityRegistryInstance;
63
+ }
64
+ //# sourceMappingURL=Provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../src/capabilities/Provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AAC7E,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,KAAK,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAElF;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAExC;;;;;;;;GAQG;AACH,MAAM,WAAW,kBAAkB,CAAC,IAAI,SAAS,iBAAiB,GAAG,iBAAiB;IACpF;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,CAAA;IACzC,sFAAsF;IACtF,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,4DAA4D;IAC5D,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B,0FAA0F;IAC1F,QAAQ,CAAC,SAAS,EAAE,SAAS,eAAe,EAAE,CAAA;IAC9C;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAA;IAC3B;;;;OAIG;IACH,KAAK,CAAC,GAAG,EAAE,IAAI,GAAG,wBAAwB,GAAG,SAAS,CAAA;IACtD;;;OAGG;IACH,aAAa,CAAC,GAAG,EAAE,IAAI,GAAG,OAAO,CAAA;CAClC;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,YAAY,EAAE,0BAA0B,CAAA;CAClD"}
@@ -0,0 +1,17 @@
1
+ import type { XyoConnection } from '@xyo-network/xl1-protocol-lib';
2
+ import type { Surface } from './Backing.ts';
3
+ /**
4
+ * Returns a shallow-cloned `XyoConnection` retaining only the branches whose
5
+ * surface matches the requested one.
6
+ *
7
+ * The filter walks a fixed structural map of `XyoConnection` (see
8
+ * `surfaceMap.ts`). Branches whose surface differs are omitted from the
9
+ * returned connection so that downstream consumers (`rpcMethodHandlersFromConnection`,
10
+ * `rpcServerFromConnection`, etc.) naturally produce a smaller method set
11
+ * without having to know about surfaces themselves.
12
+ *
13
+ * Used by API actor route wiring to mount `POST /rpc` (node-only) and
14
+ * `POST /rpc/indexed` (indexer-only) over the same underlying connection.
15
+ */
16
+ export declare function connectionSubsetBySurface(connection: XyoConnection, surface: Surface): XyoConnection;
17
+ //# sourceMappingURL=connectionSubsetBySurface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connectionSubsetBySurface.d.ts","sourceRoot":"","sources":["../../../src/capabilities/connectionSubsetBySurface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAElE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAM3C;;;;;;;;;;;;GAYG;AACH,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,aAAa,EACzB,OAAO,EAAE,OAAO,GACf,aAAa,CAcf"}
@@ -0,0 +1,46 @@
1
+ import type { CreatableProviderFactory } from '../CreatableProvider/index.ts';
2
+ import type { BackingNeed } from './Backing.ts';
3
+ /**
4
+ * Phantom-typed brand on `CreatableProviderFactory` recording which backings
5
+ * the factory's underlying provider needs.
6
+ *
7
+ * Purely a compile-time tag — there is no runtime impact. Runtime callers
8
+ * that don't care can keep using the bare `CreatableProviderFactory` type;
9
+ * locators that want to enforce a backing-subset rule at compile time can
10
+ * accept `BrandedFactory<L>` parameters that constrain what factories may be
11
+ * registered.
12
+ */
13
+ export type BrandedFactory<B extends readonly BackingNeed[] = readonly BackingNeed[]> = CreatableProviderFactory & {
14
+ readonly __backings?: B;
15
+ };
16
+ /**
17
+ * Brand a factory with the backings it depends on. Returns the same value at
18
+ * runtime — the brand is only a phantom type.
19
+ *
20
+ * @example
21
+ * const f = backedFactory(
22
+ * [{ backing: 'chain-store', mode: 'write' }] as const,
23
+ * SimpleFinalizationRunner.factory(SimpleFinalizationRunner.dependencies, {...}),
24
+ * )
25
+ * // f is BrandedFactory<readonly [{backing: 'chain-store', mode: 'write'}]>
26
+ */
27
+ export declare function backedFactory<B extends readonly BackingNeed[]>(_backings: B, factory: CreatableProviderFactory): BrandedFactory<B>;
28
+ /**
29
+ * Helper: brand a factory as needing only the network transport. Convenient
30
+ * shorthand for `JsonRpc*` factories.
31
+ */
32
+ export declare function networkBackedFactory(factory: CreatableProviderFactory): BrandedFactory<readonly [{
33
+ readonly backing: 'network';
34
+ readonly mode: 'read';
35
+ }]>;
36
+ /**
37
+ * Runtime check: is `factory`'s declared backings a subset of `availableBackings`?
38
+ *
39
+ * The brand is type-only, so at runtime we have no way to inspect what backings
40
+ * the factory was branded with. This helper exists for cases where the caller
41
+ * has the backings array separately (e.g. from the descriptor that built the
42
+ * factory) and wants a runtime gate. Use `backingsSatisfied` directly with the
43
+ * descriptor's `backings` field.
44
+ */
45
+ export declare function factoryBackingsCompatible(declared: readonly BackingNeed[], available: readonly BackingNeed[]): boolean;
46
+ //# sourceMappingURL=factoryBrand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factoryBrand.d.ts","sourceRoot":"","sources":["../../../src/capabilities/factoryBrand.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AAC7E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAG/C;;;;;;;;;GASG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,SAAS,WAAW,EAAE,GAAG,SAAS,WAAW,EAAE,IAChF,wBAAwB,GAAG;IAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,CAAA;CAAE,CAAA;AAE1D;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,SAAS,WAAW,EAAE,EAC5D,SAAS,EAAE,CAAC,EACZ,OAAO,EAAE,wBAAwB,GAChC,cAAc,CAAC,CAAC,CAAC,CAEnB;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,wBAAwB,GAChC,cAAc,CAAC,SAAS,CAAC;IAAE,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAEnF;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,SAAS,WAAW,EAAE,EAChC,SAAS,EAAE,SAAS,WAAW,EAAE,GAChC,OAAO,CAET"}
@@ -0,0 +1,8 @@
1
+ export * from './Backing.ts';
2
+ export * from './Capability.ts';
3
+ export * from './connectionSubsetBySurface.ts';
4
+ export * from './factoryBrand.ts';
5
+ export * from './Provider.ts';
6
+ export * from './resolveProviders.ts';
7
+ export * from './surfaceMap.ts';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/capabilities/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gCAAgC,CAAA;AAC9C,cAAc,mBAAmB,CAAA;AACjC,cAAc,eAAe,CAAA;AAC7B,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA"}
@@ -0,0 +1,41 @@
1
+ import type { BackingNeed } from './Backing.ts';
2
+ import type { ProviderMoniker } from './Capability.ts';
3
+ import type { ProviderDescriptor, ResolutionContext } from './Provider.ts';
4
+ export interface ResolutionPlan {
5
+ /** Capability moniker -> winning descriptor id (for snapshot diffing). */
6
+ readonly bindings: Readonly<Record<ProviderMoniker, string>>;
7
+ /** Descriptors that lost; included for diagnostics. */
8
+ readonly rejected: readonly RejectedDescriptor[];
9
+ /** Descriptors that should be instantiated, in topological order. */
10
+ readonly selected: readonly ProviderDescriptor[];
11
+ }
12
+ export interface RejectedDescriptor {
13
+ readonly descriptor: ProviderDescriptor;
14
+ readonly reason: string;
15
+ }
16
+ export declare class MissingCapabilityError extends Error {
17
+ readonly moniker: ProviderMoniker;
18
+ readonly reasons: readonly string[];
19
+ constructor(moniker: ProviderMoniker, reasons: readonly string[]);
20
+ }
21
+ export interface ResolveProvidersOptions {
22
+ /**
23
+ * The backings the locator's process holds. If provided, the resolver filters
24
+ * out any candidate whose `backings` are not a subset of `availableBackings`
25
+ * (with mode compatibility — `read` is satisfied by either `read` or `write`;
26
+ * `write` requires `write`). If omitted, no backing-based filtering happens.
27
+ */
28
+ readonly availableBackings?: readonly BackingNeed[];
29
+ }
30
+ /**
31
+ * Plans which providers to register for a given set of needs.
32
+ *
33
+ * 1. Walk `Capability.implies` from the needs set to fixed point.
34
+ * 2. Filter candidates by backing requirements (if `availableBackings` provided).
35
+ * 3. Filter remaining candidates by `preconditions(ctx)`.
36
+ * 4. Pick the head of `(tier asc, priority desc, descriptor.id asc)` per moniker.
37
+ * 5. Toposort selected descriptors using the registry's `implies`.
38
+ * 6. Throw `MissingCapabilityError` if any wanted moniker has zero survivors.
39
+ */
40
+ export declare function resolveProviders<TCtx extends ResolutionContext>(needs: ReadonlySet<ProviderMoniker>, candidates: readonly ProviderDescriptor<TCtx>[], ctx: TCtx, options?: ResolveProvidersOptions): ResolutionPlan;
41
+ //# sourceMappingURL=resolveProviders.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveProviders.d.ts","sourceRoot":"","sources":["../../../src/capabilities/resolveProviders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAE1E,MAAM,WAAW,cAAc;IAC7B,0EAA0E;IAC1E,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAA;IAC5D,uDAAuD;IACvD,QAAQ,CAAC,QAAQ,EAAE,SAAS,kBAAkB,EAAE,CAAA;IAChD,qEAAqE;IACrE,QAAQ,CAAC,QAAQ,EAAE,SAAS,kBAAkB,EAAE,CAAA;CACjD;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,UAAU,EAAE,kBAAkB,CAAA;IACvC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED,qBAAa,sBAAuB,SAAQ,KAAK;IAC/C,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAA;IACjC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;gBAEvB,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE;CAOjE;AAED,MAAM,WAAW,uBAAuB;IACtC;;;;;OAKG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,SAAS,WAAW,EAAE,CAAA;CACpD;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,SAAS,iBAAiB,EAC7D,KAAK,EAAE,WAAW,CAAC,eAAe,CAAC,EACnC,UAAU,EAAE,SAAS,kBAAkB,CAAC,IAAI,CAAC,EAAE,EAC/C,GAAG,EAAE,IAAI,EACT,OAAO,GAAE,uBAA4B,GACpC,cAAc,CAWhB"}
@@ -0,0 +1,11 @@
1
+ import type { Surface } from './Backing.ts';
2
+ export declare function surfaceForBranch(branch: string): Surface | undefined;
3
+ /**
4
+ * Branch keys on `XyoViewer` that may need to be filtered by surface.
5
+ * `connectionSubsetBySurface` iterates over this list to decide what to keep.
6
+ *
7
+ * Each entry is `[viewerKey, fully-qualified-branch-key]`.
8
+ */
9
+ export declare const VIEWER_BRANCH_KEYS: readonly [readonly ["block", "viewer.block"], readonly ["transaction", "viewer.transaction"], readonly ["mempool", "viewer.mempool"], readonly ["finalization", "viewer.finalization"], readonly ["time", "viewer.time"], readonly ["account", "viewer.account.balance"], readonly ["networkStake", "viewer.networkStake"], readonly ["stake", "viewer.stake"], readonly ["step", "viewer.step"]];
10
+ export type ViewerBranchKey = (typeof VIEWER_BRANCH_KEYS)[number][0];
11
+ //# sourceMappingURL=surfaceMap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"surfaceMap.d.ts","sourceRoot":"","sources":["../../../src/capabilities/surfaceMap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAgC3C,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAEpE;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,mYAUrB,CAAA;AAEV,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA"}
@@ -1,5 +1,6 @@
1
1
  export * from './amount/index.ts';
2
2
  export * from './block/index.ts';
3
+ export * from './capabilities/index.ts';
3
4
  export * from './ChainContextHelpers.ts';
4
5
  export * from './config/index.ts';
5
6
  export * from './constants.ts';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,0BAA0B,CAAA;AACxC,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,oBAAoB,CAAA;AAClC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,kBAAkB,CAAA;AAChC,cAAc,uBAAuB,CAAA;AACrC,cAAc,mBAAmB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,oBAAoB,CAAA;AAClC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,kBAAkB,CAAA;AAChC,cAAc,uBAAuB,CAAA;AACrC,cAAc,mBAAmB,CAAA"}