KalshiApiTask fetches a GET endpoint from the Kalshi API (with a token if supplied) and returns the JSON result

Implements

Constructors

Properties

apiKeyId: string

A string containing the API Key ID

privateKey: string

A string containing the private key for authentication

signature: string

Optional signature string field

timestamp: string

Optional timestamp in milliseconds (used with signature)

url: string

A string containing the URL to direct this HTTP request to.

Methods

  • Converts this KalshiApiTask to JSON.

    Returns { [k: string]: any }

    JSON object

  • Decodes a KalshiApiTask message from the specified reader or buffer.

    Parameters

    • reader: Uint8Array<ArrayBufferLike> | Reader

      Reader or buffer to decode from

    • Optionallength: number

      Message length if known beforehand

    Returns KalshiApiTask

    KalshiApiTask

    If the payload is not a reader or valid buffer

    If required fields are missing

  • Decodes a KalshiApiTask message from the specified reader or buffer, length delimited.

    Parameters

    • reader: Uint8Array<ArrayBufferLike> | Reader

      Reader or buffer to decode from

    Returns KalshiApiTask

    KalshiApiTask

    If the payload is not a reader or valid buffer

    If required fields are missing

  • Encodes the specified KalshiApiTask message. Does not implicitly {@apilink oracle_job.OracleJob.KalshiApiTask.verify|verify} messages.

    Parameters

    • message: IKalshiApiTask

      KalshiApiTask message or plain object to encode

    • Optionalwriter: Writer

      Writer to encode to

    Returns Writer

    Writer

  • Encodes the specified KalshiApiTask message, length delimited. Does not implicitly {@apilink oracle_job.OracleJob.KalshiApiTask.verify|verify} messages.

    Parameters

    • message: IKalshiApiTask

      KalshiApiTask message or plain object to encode

    • Optionalwriter: Writer

      Writer to encode to

    Returns Writer

    Writer

  • Creates a KalshiApiTask message from a plain object. Also converts values to their respective internal types.

    Parameters

    • object: { [k: string]: any }

      Plain object

    Returns KalshiApiTask

    KalshiApiTask

  • Gets the default type url for KalshiApiTask

    Parameters

    Returns string

    The default type url

  • Creates a plain object from a KalshiApiTask message. Also converts values to other types if specified.

    Parameters

    • message: KalshiApiTask

      KalshiApiTask

    • Optionaloptions: IConversionOptions

      Conversion options

    Returns { [k: string]: any }

    Plain object

  • Verifies a KalshiApiTask message.

    Parameters

    • message: { [k: string]: any }

      Plain object to verify

    Returns null | string

    null if valid, otherwise the reason why it is not