Applesauce
    Preparing search index...

    The base class for building or modifying events

    Hierarchy (View Summary)

    Index

    Constructors

    • Creates a new Promise.

      Parameters

      • executor: (
            resolve: (
                value: WalletInfoTemplate | PromiseLike<WalletInfoTemplate>,
            ) => void,
            reject: (reason?: any) => void,
        ) => void

        A callback used to initialize the promise. This callback is passed two arguments: a resolve callback used to resolve the promise with a value or the result of another promise, and a reject callback used to reject the promise with a provided reason or error.

      Returns WalletInfoFactory

    Properties

    _signerRef: SignerRef

    Shared mutable reference to the signer, propagated through all chain links

    "[toStringTag]": string
    "[species]": PromiseConstructor

    Accessors

    • get signer(): EventSigner | undefined

      The signer used to sign the event (reads from shared ref)

      Returns EventSigner | undefined

    • set signer(value: EventSigner | undefined): void

      Parameters

      Returns void

    Methods

    • Sets the NIP-31 alt tag for the event

      Parameters

      • alt: string

      Returns this

    • Sets the event signer to use when building this event

      Parameters

      Returns this

    • Attaches a callback for only the rejection of the Promise.

      Type Parameters

      • TResult = never

      Parameters

      • Optionalonrejected: ((reason: any) => TResult | PromiseLike<TResult>) | null

        The callback to execute when the Promise is rejected.

      Returns Promise<WalletInfoTemplate | TResult>

      A Promise for the completion of the callback.

    • Sets the event content

      Parameters

      • content: string

      Returns this

    • Sets the NIP-36 content-warning tag for the event

      Parameters

      • warning: string | boolean

      Returns this

    • Set the event created_at timestamp in seconds. if no value is provided, the current unix timestamp will be used

      Parameters

      • Optionalcreated: number | Date

      Returns this

    • Sets the encrypted content of the event

      Parameters

      Returns this

    • Sets the NIP-40 expiration timestamp for the event

      Parameters

      • timestamp: number

      Returns this

    • Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The resolved value cannot be modified from the callback.

      Parameters

      • Optionalonfinally: (() => void) | null

        The callback to execute when the Promise is settled (fulfilled or rejected).

      Returns Promise<WalletInfoTemplate>

      A Promise for the completion of the callback.

    • Sets the NIP-70 "-" tag for the event

      Parameters

      • isProtected: boolean

      Returns this

    • Creates a Promise that is resolved with an array of results when all of the provided Promises resolve, or rejected when any Promise is rejected.

      Type Parameters

      • T

      Parameters

      • values: Iterable<T | PromiseLike<T>>

        An iterable of Promises.

      Returns Promise<Awaited<T>[]>

      A new Promise.

    • Creates a Promise that is resolved with an array of results when all of the provided Promises resolve, or rejected when any Promise is rejected.

      Type Parameters

      • T extends [] | readonly unknown[]

      Parameters

      • values: T

        An array of Promises.

      Returns Promise<{ -readonly [P in string | number | symbol]: Awaited<T[P]> }>

      A new Promise.

    • Creates a Promise that is resolved with an array of results when all of the provided Promises resolve or reject.

      Type Parameters

      • T extends [] | readonly unknown[]

      Parameters

      • values: T

        An array of Promises.

      Returns Promise<
          {
              -readonly [P in string
              | number
              | symbol]: PromiseSettledResult<Awaited<T[P]>>
          },
      >

      A new Promise.

    • Creates a Promise that is resolved with an array of results when all of the provided Promises resolve or reject.

      Type Parameters

      • T

      Parameters

      • values: Iterable<T | PromiseLike<T>>

        An array of Promises.

      Returns Promise<PromiseSettledResult<Awaited<T>>[]>

      A new Promise.

    • The any function returns a promise that is fulfilled by the first given promise to be fulfilled, or rejected with an AggregateError containing an array of rejection reasons if all of the given promises are rejected. It resolves all elements of the passed iterable to promises as it runs this algorithm.

      Type Parameters

      • T extends [] | readonly unknown[]

      Parameters

      • values: T

        An array or iterable of Promises.

      Returns Promise<Awaited<T[number]>>

      A new Promise.

    • The any function returns a promise that is fulfilled by the first given promise to be fulfilled, or rejected with an AggregateError containing an array of rejection reasons if all of the given promises are rejected. It resolves all elements of the passed iterable to promises as it runs this algorithm.

      Type Parameters

      • T

      Parameters

      • values: Iterable<T | PromiseLike<T>>

        An array or iterable of Promises.

      Returns Promise<Awaited<T>>

      A new Promise.

    • Create a new event factory from a kind

      Type Parameters

      • K extends number

      Parameters

      • kind: K

      Returns EventFactory<K>

    • Creates a Promise that is resolved or rejected when any of the provided Promises are resolved or rejected.

      Type Parameters

      • T

      Parameters

      • values: Iterable<T | PromiseLike<T>>

        An iterable of Promises.

      Returns Promise<Awaited<T>>

      A new Promise.

    • Creates a Promise that is resolved or rejected when any of the provided Promises are resolved or rejected.

      Type Parameters

      • T extends [] | readonly unknown[]

      Parameters

      • values: T

        An array of Promises.

      Returns Promise<Awaited<T[number]>>

      A new Promise.

    • Creates a new rejected promise for the provided reason.

      Type Parameters

      • T = never

      Parameters

      • Optionalreason: any

        The reason the promise was rejected.

      Returns Promise<T>

      A new rejected Promise.

    • Creates a new resolved promise.

      Returns Promise<void>

      A resolved promise.

    • Creates a new resolved promise for the provided value.

      Type Parameters

      • T

      Parameters

      • value: T

        A promise.

      Returns Promise<Awaited<T>>

      A promise whose internal state matches the provided promise.

    • Creates a new resolved promise for the provided value.

      Type Parameters

      • T

      Parameters

      • value: T | PromiseLike<T>

        A promise.

      Returns Promise<Awaited<T>>

      A promise whose internal state matches the provided promise.