Skip to main content

Actions & Adapters

Tools for managing HAL actions and adapters — the core building blocks of the HAL Expression System. Actions are executable batches of write functions for on-chain transactions. Adapters are reusable functions (write, read, or code) that can be imported into actions or other adapters.

Search Actions & Adapters

Search existing actions and adapters before creating new ones — existing adapters can be imported directly into new actions.

Parameters

ParameterRequiredDescription
expressionTypeNoaction, adapter, or both (default)
nameNoSearch by name
scopeNoFilter by yours and/or verified
contractAddressNoFilter by contract address
functionSignatureNoFilter by function signature (4-byte selector)
blockchainNoethereum or base
pageNoPage number for pagination (20 per page)

Example Queries

Search for existing USDC transfer adapters
Find verified swap actions on Base

Get Action or Adapter

Retrieve a specific action or adapter by ID, including its full HAL expression.

Parameters

ParameterRequiredDescription
idYesAction or adapter ID
versionNameNoVersion name (e.g. v1); defaults to latest
includeReferencesNoWhen true, inlines imported expressions and code blocks

Create Action

Create a new action from a HAL expression. Actions have batched steps — each batch contains write-function calls.
Before creating an action, read the HAL documentation using the Documentation tool with document IDs hal://spec/syntax, hal://spec/modules/herd, and hal://spec/examples. Search for existing adapters first with the search tool above.

Parameters

ParameterRequiredDescription
nameYesAction name
descriptionNoDescription of what the action does
expressionYesHAL expression (JSON array)
publishNoPublish immediately (true/false)

Create Adapter

Create a new adapter from a HAL expression. Adapters encapsulate reusable logic (queries and writes) for import into actions.

Parameters

ParameterRequiredDescription
nameYesAdapter name
descriptionNoDescription of what the adapter does
expressionYesHAL expression (JSON array)
publishNoPublish immediately (true/false)
Start with logic in actions — extract to adapters when you see the same pattern repeated across multiple actions.

Update Action

Update an existing action’s name, description, expression, or publish status.

Parameters

ParameterRequiredDescription
idYesAction ID
nameNoNew name
descriptionNoNew description
expressionNoJSON Patch operations (RFC 6902) to modify the expression
publishNoPublish the latest version
Expression updates use JSON Patch operations: add, remove, replace, move, copy, test. Paths use JSON Pointer syntax (e.g., /0, /1/2, /1/2/1).

Update Adapter

Update an existing adapter’s name, description, expression, or publish status. Same parameters and patch format as Update Action.

Parameters

ParameterRequiredDescription
idYesAdapter ID
nameNoNew name
descriptionNoNew description
expressionNoJSON Patch operations (RFC 6902) to modify the expression
publishNoPublish the latest version

Delete Action or Adapter

Delete an action or adapter by ID.

Parameters

ParameterRequiredDescription
idYesAction or adapter ID
Deletion fails if the action/adapter is auto-synced to a code block (delete the code block instead) or if other actions/adapters import it.

Workflow

  1. Search for existing adapters that do what you need
  2. Read HAL documentation if creating new expressions
  3. Create adapters for reusable logic, actions for transactions
  4. Simulate with Evaluation tools before publishing
  5. Publish once tested

Next Steps

HAL Reference

Full HAL language documentation

Evaluation

Simulate before publishing