Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type aliases

PaginationIterator

PaginationIterator: AsyncIterator<Object, Function, Function>

Functions

Const addWidgetListener

  • Add a widget listener

    since

    2.4.0

    Parameters

    Returns any

createAlertWidget

  • description

    Create Alert widget

    async
    since

    2.52.0

    example
    createAlertWidget({
    programId: "<program id>",
    title: "<alert title>",
    text: "<alert text>",
    imageUrl: "<your image url>",
    linkUrl: "<link url to include on alert widget>",
    linkLabel: "<link label to show on alert widget>",
    }).then(alertWidget => console.log(alertWidget))

    Parameters

    Returns Promise<IAlertWidget>

createImagePollWidget

  • description

    Create Image Poll widget

    async
    since

    2.52.0

    example
    createImagePollWidget({
    question: "<widget question>",
    programId: "xxxx",
    option: [{
    description: "<option description>",
    imageUrl: "<url>"
    }],
    }).then(imagePollWidget => console.log(imagePollWidget))

    Parameters

    Returns Promise<IImagePollWidget>

createImagePredictionWidget

  • description

    Create Image Prediction widget

    async
    since

    2.52.0

    example
    createImagePredictionWidget({
    question: "<widget question>",
    programId: "xxxx",
    options: [{
    description: "<option description>",
    imageUrl: "<url>"
    }],
    }).then(widget => console.log(widget))

    Parameters

    Returns Promise<IImagePredictionWidget>

createPredictionFollowUpWidget

  • description

    Create Prediction followup widget using prediction widget id, widget kind and correct option Id

    async
    since

    2.52.0

    example
    createPredictionFollowUpWidget({
    widgetId: "yyyyy",
    widgetKind: WidgetKind.TEXT_PREDICTION,
    correctOptionId: "zzzz"
    }).then(followUpWidget => console.log(followUpWidget))

    Parameters

    Returns Promise<IPredictionFollowUpWidget>

createTextPollWidget

  • description

    Create Text Poll widget

    async
    since

    2.52.0

    example
    createTextPollWidget({
    question: "<widget question>",
    programId: "xxxx",
    option: [{
    description: "<option description>"
    }],
    }).then(textPollWidget => console.log(textPollWidget))

    Parameters

    Returns Promise<ITextPollWidget>

createTextPredictionWidget

  • description

    Create Text Prediction widget

    async
    since

    2.52.0

    example
    createTextPredictionWidget({
    question: "<widget question>",
    programId: "xxxx",
    options: [{
    description: "<option description>"
    }],
    }).then(widget => console.log(widget))

    Parameters

    Returns Promise<ITextPredictionWidget>

deleteWidget

  • description

    Delete a widget

    async
    since

    2.52.0

    example
    deleteWidget({
    widgetId: "<widget question>",
    widgetKind: WidgetKind.TEXT_POLL,
    }).then(res => console.log(res))

    Parameters

    Returns Promise<void>

Const getPaginatedUnclaimedRewards

  • getPaginatedUnclaimedRewards(args: { programId: string }): Promise<AsyncIterator<Object, Function, Function>>
  • Parameters

    • args: { programId: string }
      • programId: string

    Returns Promise<AsyncIterator<Object, Function, Function>>

Const getPaginatedWidgets

Const getPostedWidgets

Const getWidget

Const getWidgetInteractions

  • Get list of widget interactions based on interaction url or an array of widget id or an array of widget kinds

    async
    example
    getWidgetInteractions({
    interactionUrl: "<url>"
    }).then(interactions => console.log(interactions))

    // OR
    getWidgetInteractions({
    programId: "<program-id>",
    widgets: [{
    kind: WidgetKind.TEXT_POLL,
    id: "<widget-id>"
    }]
    }).then(interactions => console.log(interactions))

    // OR
    getWidgetInteractions({
    programId: "<program-id>",
    widgetKinds: [ WidgetKind.TEXT_POLL, WidgetKind.TEXT_PREDICTION ]
    }).then(interactions => console.log(interactions))

    Parameters

    Returns Promise<IWidgetKindInteractionsMap>

Const getWidgets

  • description

    Fetch paginated List of Widgets filtered by widget status and kind

    since

    2.13.0

    example
    getWidgets({
    programId: "xxxx",
    status: "pending",
    widgetKinds: ["text-poll"],
    ordering: "recent",
    interactive: true,
    since: "2022-05-26T12:41:27.463Z"
    }).then(res => console.log(res));

    Parameters

    Returns Promise<IPaginatedResponse<IWidgetPayload>>

publishWidget

  • description

    Publish a widget based on publish delay duration that would schedule a widget to be published after a given duration. When no publish duration is passed, widget would be instantly published.

    async
    since

    2.52.0

    example
    publishWidget({
    widgetId: "<widget question>",
    widgetKind: WidgetKind.TEXT_POLL,
    delayDuration: "P0DT00H05M00S" // publish widget after 5 mins
    }).then(res => console.log(res))

    Parameters

    Returns Promise<IPublishWidgetRes>

Const registerWidgetMode

  • registerWidgetMode(name: string, mode: WidgetMode): any
  • Registers a custom widget state transition mode. The name argument is used to pass to one of the widget instantiation methods to choose

    since

    1.18.0

    Parameters

    Returns any

Const removeWidgetListener

  • Remove widget listener

    since

    2.4.0

    Parameters

    Returns void

updateImagePredictionWidgetOption

  • description

    Update Image Prediction widget option

    async
    since

    2.52.0

    example
    updateImagePredictionWidgetOption({
    widgetId: "xxxx",
    optionId: "<widget option id>",
    rewardItemId: "yyy-ccvv-qqqq",
    rewardItemAmount: 100,
    description: "<updated description>",
    isCorrect: true,
    imageUrl: "<url for option image>"
    }).then(widget => console.log(widget))

    Parameters

    Returns Promise<IImagePredictionWidgetOption>

updateTextPredictionWidgetOption

  • description

    Update Text Prediction widget option

    async
    since

    2.52.0

    example
    updateTextPredictionWidgetOption({
    widgetId: "xxxx",
    optionId: "<widget option id>",
    rewardItemId: "yyy-ccvv-qqqq",
    rewardItemAmount: 100,
    description: "<updated description>",
    isCorrect: true
    }).then(widget => console.log(widget))

    Parameters

    Returns Promise<ITextPredictionWidgetOption>

Legend

  • Namespace
  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Interface
  • Interface with type parameter
  • Enumeration

Generated using TypeDoc