Multi-Actions

To support multiple actions, Action Provider GET responses may include additional action URLs via the links attribute.

export interface LinkedAction {
  /** URL endpoint for an action */
  href: string;
  /** button text rendered to the user */
  label: string;
  /** Parameter to accept user input within an action */
  parameters?: [ActionParameter];
}

/** Parameter to accept user input within an action */
export interface ActionParameter {
  /** parameter name in url */
  name: string;
  /** placeholder text for the user input field */
  label?: string;
  /** declare if this field is required (defaults to `false`) */
  required?: boolean;
}

All of these linked actions are themselves Action URLs at href, and may themselves also return multiple actions.

Linked actions, although valid actions, only provide a label and href as they are are intended to be used to display additional buttons in a single Blink.

Such examples include “Buy 1 SOL”, “Buy 5 SOL”, “Buy 10 SOL” as options within a single API call or single interface.

Linked actions hrefs support both absolute and relative paths.

The optional parameters attribute allows for a second action type, which is covered in the next section.

NOTE: If you're looking to create blinks with multiple-input forms like the one below, check out the next section.

Last updated