AppleSauce
    Preparing search index...

    Type Alias ActionContext

    The context that is passed to actions for them to use to preform actions

    type ActionContext = {
        events: IEventStoreRead & IEventStoreStreams & IEventSubscriptions & EventModels;
        factory: EventFactory;
        publish: (
            event: NostrEvent | NostrEvent[],
            relays?: string[],
        ) => Promise<void>;
        run: <Args extends any[]>(
            builder: ActionBuilder<Args>,
            ...args: Args,
        ) => Promise<void>;
        self: string;
        sign: (draft: Helpers.EventTemplate | UnsignedEvent) => Promise<NostrEvent>;
        signer?: EventSigner;
        user: User;
    }
    Index

    Properties

    events: IEventStoreRead & IEventStoreStreams & IEventSubscriptions & EventModels

    The event store to load events from

    factory: EventFactory

    The event factory used to build and modify events

    publish: (event: NostrEvent | NostrEvent[], relays?: string[]) => Promise<void>

    The method to publish events to an optional list of relays

    run: <Args extends any[]>(
        builder: ActionBuilder<Args>,
        ...args: Args,
    ) => Promise<void>

    Run a sub-action within the current action context and return the events

    self: string

    The pubkey of the signer in the event factory

    sign: (draft: Helpers.EventTemplate | UnsignedEvent) => Promise<NostrEvent>

    Sign an event using the event factory

    signer?: EventSigner

    The event signer used to sign events

    user: User

    The User cast that is signing the events