normalizePollingResponse
Normalizes a polling response to ensure compatibility with FCL format
Import
You can import the entire package and access the function:
_10import * as fcl from "@onflow/fcl-core"_10_10fcl.normalizePollingResponse(resp)
Or import directly the specific function:
_10import { normalizePollingResponse } from "@onflow/fcl-core"_10_10normalizePollingResponse(resp)
Usage
_10const 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:
_10export 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
_10export 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