Ecosystem
Direct execution

Write on-chain without graphs.

Use direct execution when a task is too small for a workflow but still needs the SDK's typed transport, chain normalization, and completion polling. This module covers transfers, contract calls, and conditional check-and-execute flows.

Direct execute methods

The namespaced directExecute module exposes both action methods and a polling helper for completion status.

Method Purpose Notes
transfer(input)Send native currency or ERC-20 tokensUse tokenAddress for ERC-20s; omit it for native transfers
contractCall(input)Call a contract functionProvide ABI, function name, args, and optional value
checkAndExecute(input)Read a value and execute conditionallyUseful for guard-rail automation
getStatus(executionId)Read direct execution stateReturns the current direct execution object
waitForCompletion(executionId, options)Poll until terminalStops when status is completed or failed
Network mapping

Chain ID to network

The module normalizes common chain IDs to network names so callers can use chainId for Ethereum, Base, Polygon, Arbitrum, and Optimism without manual translation.

Auth

Dedicated API key support

When a direct execution API key is provided, the module sends it as X-API-Key on requests that need it.

Transfer and contract call examples

These examples mirror the README while staying focused on the two most common direct execution use cases.

const transfer = await client.directExecute.transfer({
  chainId: 8453,
  to: "0xRecipientAddress",
  amount: "1000000",
  tokenAddress: "0xTokenAddress",
});

const transferResult = await client.directExecute.waitForCompletion(transfer.id);

const call = await client.directExecute.contractCall({
  chainId: 1,
  contractAddress: "0xContractAddress",
  functionName: "approve",
  abi: [/* ABI array */],
  args: ["0xSpender", "1000000000000000000"],
});
Check and execute

Read before writing

The conditional flow reads on-chain state first, compares it against a condition, and only sends the write call when the predicate is satisfied.

Completion

Poll to a terminal state

waitForCompletion hides the polling loop and returns the final execution object when the action reaches a completed or failed state.

Use the smallest unit for amounts and remember that direct execution is intended for operations that do not need a full workflow graph or marketplace publication.