getExecHttpPost
Creates an HTTP POST strategy executor that handles wallet service communication via HTTP POST requests. This function manages the full lifecycle including polling for responses, handling local views, and managing user interactions.
Import
You can import the entire package and access the function:
_10import * as fcl from "@onflow/fcl-core"_10_10fcl.getExecHttpPost(execLocal)
Or import directly the specific function:
_10import { getExecHttpPost } from "@onflow/fcl-core"_10_10getExecHttpPost(execLocal)
Usage
_10// Create an HTTP POST executor_10const httpPostExec = getExecHttpPost(async (view, { serviceEndpoint, onClose }) => {_10 // Render local view and return cleanup function_10 return [viewData, () => cleanup()]_10})
Parameters
execLocal
- Type:
_10export type ExecLocalFunction = (_10 view: any,_10 options: {_10 serviceEndpoint: typeof serviceEndpoint_10 onClose: () => void_10 }_10) => Promise<[any, () => void]>
- Description: Function to execute local view rendering and user interaction
Returns
_10({ service, body, config, opts }: ExecHttpPostParams) => Promise<any>
HTTP POST strategy function that can be used to execute services