Skip to main content

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:


_10
import * as fcl from "@onflow/fcl-core"
_10
_10
fcl.execStrategy(execStrategyParams)

Or import directly the specific function:


_10
import { execStrategy } from "@onflow/fcl-core"
_10
_10
execStrategy(execStrategyParams)

Usage


_10
// Execute a service strategy (internal usage)
_10
const 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:

_10
export 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


_10
export 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


Rate this page