/** * Shared resource-level helpers. * * One implementation of the small utilities every hand-written resource * needs: resolving the acting user, building wallet-scoped header bags, * merging abort signals, and emitting receipt/budget headers on the SDK * event bus. Resources used to carry private copies of each; they now * import them from here. */ import type { EventBus } from "../events.js"; import type { NetworkId } from "../chains/index.js"; import type { Receipt } from "../types/index.js"; export interface WalletContext { getWalletMaybe(): { address: string | null; network: NetworkId | null; }; getTokenMaybe(): string | null; } export interface EventedContext extends WalletContext { events: EventBus; } export declare function resolveUserAddress(input: { userAddress?: string; }, fallback: string | null): string; export declare function walletHeaders(ctx: WalletContext, userAddress?: string, network?: NetworkId): { key?: string; userAddress?: string; network?: NetworkId; }; export declare function mergeSignals(a: AbortSignal | undefined, b: AbortSignal): { signal: AbortSignal; cleanup: () => void; }; export declare function emitHeaders(ctx: EventedContext, response: Response, requestId: string | null, wallet: { address: string | null; network: NetworkId | null; }): Receipt | null; //# sourceMappingURL=shared.d.ts.map