execStrategy
Executes a service strategy based on the service method. This function looks up the appropriate strategy from the service registry and executes it with the provided parameters. It's used internally by FCL to handle different communication methods with wallet services.
Import
You can import the entire package and access the function:
_10import * as fcl from "@onflow/fcl-core"_10_10fcl.execStrategy(execStrategyParams)
Or import directly the specific function:
_10import { execStrategy } from "@onflow/fcl-core"_10_10execStrategy(execStrategyParams)
Usage
_10// Execute a service strategy (internal usage)_10const response = await execStrategy({_10 service: { method: "HTTP/POST", endpoint: "https://wallet.example.com/authz" },_10 body: { transaction: "..." },_10 config: execConfig,_10 abortSignal: controller.signal_10})
Parameters
execStrategyParams
- Type:
_10export interface ExecStrategyParams {_10 service: Service_10 body: Record<string, any>_10 config: ExecConfig_10 abortSignal: AbortSignal_10 customRpc?: string_10 user?: CurrentUser_10 opts?: Record<string, any>_10}
Returns
_10export interface StrategyResponse {_10 status: string_10 data?: any_10 updates?: Record<string, any>_10 local?: boolean_10 authorizationUpdates?: Record<string, any>_10}
Promise resolving to the strategy response