Skip to main content

normalizePollingResponse

Normalizes a polling response to ensure compatibility with FCL format

Import

You can import the entire package and access the function:


_10
import * as fcl from "@onflow/fcl-core"
_10
_10
fcl.normalizePollingResponse(resp)

Or import directly the specific function:


_10
import { normalizePollingResponse } from "@onflow/fcl-core"
_10
_10
normalizePollingResponse(resp)

Usage


_10
const resp = normalizePollingResponse({
_10
f_type: "PollingResponse",
_10
f_vsn: "1.0.0",
_10
status: "PENDING", // PENDING | APPROVED | DECLINED | REDIRECT
_10
reason: null, // Reason for Declining Transaction
_10
data: null, // Return value for APPROVED
_10
updates: BackChannelRpc,
_10
local: Frame,
_10
})

Parameters

resp

  • Type:

_10
export interface PollingResponse {
_10
f_type: "PollingResponse"
_10
f_vsn: "1.0.0"
_10
status: "APPROVED" | "DECLINED" | "REDIRECT"
_10
reason: string | null
_10
data: any
_10
}

  • Description: The polling response to normalize

Returns


_10
export interface PollingResponse {
_10
f_type: "PollingResponse"
_10
f_vsn: "1.0.0"
_10
status: "APPROVED" | "DECLINED" | "REDIRECT"
_10
reason: string | null
_10
data: any
_10
}

The normalized polling response or null


Rate this page