Class PineRequest

Class representing PineRequest for making requests to PineScript services.

Constructors

Properties

fetch: any = undefined

Holds the fetch function for making requests

pineUrl: string = 'https://pine-facade.tradingview.com/pine-facade/'

Holds the URL for the Pine facade

savedList: any[] = []

Holds a list of saved requests

Methods

  • Check if a username is available.

    Returns boolean

    • True if a username is available, otherwise false.
  • Get a PineScript script by ID part and version.

    Parameters

    • scriptIdPart: string

      ID part of the script.

    Returns Promise<any>

    • PineScript script.
  • Get request headers with optional session ID.

    Returns Promise<any>

    • Object containing request headers.
  • Get a PineScript script by ID part and version.

    Parameters

    • scriptIdPart: string

      ID part of the script.

    • version: string = 'last'

      Version of the script (default: 'last').

    Returns Promise<any>

    • PineScript script.
  • Get a list of standard scripts.

    Returns Promise<any>

    • List of standard scripts.
  • Get a list of libraries based on a prefix.

    Parameters

    • libPrefix: string

      Prefix to filter libraries.

    Returns Promise<any>

    • List of libraries.
  • Perform linting on PineScript.

    Returns Promise<any>

    • Linting results.
  • Dynamically imports node-fetch and assigns it to this.fetch. This method ensures compatibility with ES Modules.

    Returns Promise<void>

  • Makes a request to the specified URL using the specified method.

    Parameters

    • method: string

      The HTTP method to use for the request.

    • url: string

      The URL to make the request to.

    Returns Promise<any>

    A promise that resolves to the response from the request.

Generated using TypeDoc