Skip to main content

broadcastFlow

Records that a flow transaction has been broadcast. For wallet sources, pass the txHash from the on-chain transaction. For exchange sources, txHash can be omitted.
Most integrations should use submitFlowTransaction instead, which calls broadcastFlow automatically after signing. Use broadcastFlow directly only when you handle signing and broadcasting yourself.

Usage

import { broadcastFlow } from '@dynamic-labs-sdk/client';

const flow = await broadcastFlow({
  flowId: 'your-flow-id',
  txHash: '0xabc123def456...',
});

Parameters

ParameterTypeDescription
flowIdstringThe flow ID.
txHashstring (optional)The on-chain transaction hash. Required for wallet sources, optional for exchange sources.

Returns

Promise<Flow> — the flow with executionState: 'broadcasted'.
After broadcast, the flow cannot be cancelled. The backend begins monitoring the blockchain and orchestrating settlement.

Examples

Wallet source

import { broadcastFlow } from '@dynamic-labs-sdk/client';

const flow = await broadcastFlow({
  flowId: 'your-flow-id',
  txHash: '0xabc123def456...',
});

Exchange source

import { broadcastFlow } from '@dynamic-labs-sdk/client';

// No txHash needed — the user completed payment on the exchange
const flow = await broadcastFlow({
  flowId: 'your-flow-id',
});