Skip to main content

Event Structure

Understand how events are structured in the automation system and what data is available for each type of action.

📋 Overview

The automation system uses a standardized event structure that allows triggers and actions to share data consistently. Each event contains specific information about the executed operation.

🏗️ Base Structure

All events follow a common base structure:

{
"version": 1,
"account_id": "account-uuid",
"resourceable_id": "resource-uuid",
"resourceable_type": "ResourceType",
"hook_type": "hook.type",
"data": { /* event specific data */ },
"result": { /* execution result */ }
}

🔄 Hook Events

Crypto Charge Events

Hook Types:

  • crypto.charge.deposited - When a deposit is detected
  • crypto.charge.paid - When a payment is confirmed

Available Data:

  • account_txn - Account transaction token
  • resource_id - Charge ID
  • token - Token information (nested object)
    • token.id - Token ID (compatible with field_type: token)
    • token.symbol - Token symbol (compatible with field_type: token_symbol)
    • token.contract_address - Contract address (compatible with field_type: token)
    • token.decimals - Number of decimals (compatible with field_type: numeric)
    • token.chain - Blockchain information (nested object)
  • amount - Transaction amount (compatible with field_type: amount)
  • wallet_address - Wallet address (compatible with field_type: wallet)
  • timestamp - Date/time of event
  • success - Success status

PIX Charge Events

Hook Types:

  • pix.charge.created - When a PIX charge is created
  • pix.charge.paid - When a PIX is paid

Available Data:

  • txid - PIX transaction ID
  • amount - Amount in cents (compatible with field_type: amount)
  • currency - Currency (BRL)
  • payer - Payer information
  • receiver - Receiver information
  • qr_code - QR code for payment
  • expires_at - Expiration date

Ramp Events

Hook Types:

  • ramp.on_ramp.completed - On-ramp completed
  • ramp.off_ramp.completed - Off-ramp completed

Available Data:

  • ramp_id - Ramp ID
  • direction - Direction (on_ramp/off_ramp)
  • status - Current status
  • service_name - Provider (brla, blindpay)
  • source_currency - Source currency
  • target_currency - Target currency
  • amount - Operation amount (compatible with field_type: amount)
  • exchange_rate - Exchange rate (compatible with field_type: numeric)
  • walletable_id - Wallet ID (compatible with field_type: wallet)
  • beneficiary_id - Beneficiary ID (compatible with field_type: beneficiary)

EVM Wallet Events

Hook Types:

  • evm_wallet.transfer - Transfer between wallets

Available Data:

  • from_wallet - Source wallet (compatible with field_type: wallet)
  • to_wallet - Destination wallet (compatible with field_type: wallet)
  • token - Transferred token (compatible with field_type: token)
  • amount - Transferred amount (compatible with field_type: amount)
  • gas_amount - Gas used (compatible with field_type: amount)
  • transaction_hash - Transaction hash

⚡ Action Events

Crypto Transfer Action

Action Type: crypto.transfer.new

Input Data:

  • from_address - Source address (compatible with field_type: wallet)
  • to_address - Destination address (compatible with field_type: wallet)
  • amount - Amount (compatible with field_type: amount)
  • token_symbol - Token symbol (compatible with field_type: token_symbol)
  • network_name - Network name

Result:

  • success - Success status
  • tx_hash - Transaction hash
  • completed_at - Completion date

Cross Swap Action

Action Type: cross.swap.new

Input Data:

  • from_token_id - Source token ID (compatible with field_type: token)
  • to_token_id - Destination token ID (compatible with field_type: token)
  • from_amount - Source amount (compatible with field_type: amount)
  • to_address - Destination address (compatible with field_type: wallet)

Result:

  • cross_swap_id - Cross swap ID
  • status - Current status
  • to_amount - Received amount (compatible with field_type: amount)
  • executed_at - Execution date

On-chain Swap Action

Action Type: onchain.swap.new

Input Data:

  • wallet_address - Wallet address (compatible with field_type: wallet)
  • token_in_symbol - Input token (compatible with field_type: token_symbol)
  • token_out_symbol - Output token (compatible with field_type: token_symbol)
  • amount_in - Input amount (compatible with field_type: amount)
  • slippage - Configured slippage (compatible with field_type: numeric)

Result:

  • success - Success status
  • tx_hash - Transaction hash
  • amount_out - Received amount (compatible with field_type: amount)

DeFi Position Actions

Action Types:

  • defi_position.get_fees_earned - Query earned fees
  • defi_strategy_position.deposit - Deposit into strategy
  • defi_strategy_position.withdraw - Withdraw from strategy
  • defi_strategy_position.get_details - Get position details

Available Data:

  • position_id - Position ID (compatible with field_type: defi_position)
  • protocol_name - Protocol name
  • token_pair - Token pair
  • fees_earned - Accumulated fees (compatible with field_type: amount)
  • current_apy - Current APY (compatible with field_type: numeric)
  • balance - Current balance (compatible with field_type: amount)

EVM Wallet Actions

Action Types:

  • evm_wallet.get_native_balance - Query native balance
  • evm_wallet.get_token_balance - Query token balance

Available Data:

  • wallet_address - Wallet address (compatible with field_type: wallet)
  • balance_wei - Balance in wei (compatible with field_type: amount)
  • balance_formatted - Formatted balance (compatible with field_type: amount)
  • network_name - Network name
  • token_symbol - Token symbol (compatible with field_type: token_symbol)

🔧 Conditional Actions

Conditional Action

Configuration:

  • condition.path - Path to value to evaluate
  • condition.operator - Comparison operator
  • condition.value - Expected value

Available Operators:

  • equals, not_equals
  • greater_than, less_than
  • greater_than_or_equal, less_than_or_equal
  • contains, not_contains
  • is_present, is_empty
  • is_true, is_false

Transform Numeric Split Action

Configuration:

  • source_value_path - Source value path (compatible with field_type: numeric)
  • allocations - Allocations to apply
  • dust_strategy - Strategy for residual values

Allocation Types:

  • percentage - Percentage (0-100)
  • fixed_value - Fixed value

Result:

  • total - Total processed value (compatible with field_type: amount)
  • dust - Residual value (compatible with field_type: amount)
  • allocations.{name} - Value of each allocation (compatible with field_type: amount)
  • values.{name} - Processed value of each allocation (compatible with field_type: amount)

📊 Scheduler Events

Scheduler Events

Hook Type: scheduler

Supported Resources:

  • DefiPosition - DeFi Positions
  • EvmWallet - EVM Wallets

Available Data:

  • resource_id - Resource ID (compatible with field_type: uuid)
  • resource_type - Resource type
  • timestamp - Date/time of event
  • position_info - Position information (for DeFi)
  • chain_cache - Cached blockchain data

For EvmWallet:

  • address - Wallet address (compatible with field_type: wallet)

For DefiPosition:

  • position_id - Position ID (compatible with field_type: defi_position)
  • protocol_name - Protocol name
  • balance - Current balance (compatible with field_type: amount)

🎯 Dynamic Value Resolution

To access event data in your automations, use the path format:

{events.hooks.crypto_charge_paid.amount}
{events.actions.cross_swap_123.to_amount}
{events.triggers.scheduler_456.data.position_info}

Path Formats:

  • Hooks: events.hooks.<event_key>.<field>
  • Actions: events.actions.<ACTION_ID>.<field>
  • Triggers: events.triggers.<TRIGGER_ID>.<field>

🔍 Compatibility Filters

The Field Selector system uses smart filters based on automation_type to show only compatible fields for each field type:

Supported Field Types

field_typeDescriptionCompatible Fields
walletWallets and addresseswallet_id, wallet_address, from_wallet, to_wallet, address
tokenTokens and cryptocurrenciestoken_id, token_address, from_token_id, to_token_id
token_symbolToken symbolstoken_symbol, symbol
amountNumeric valuesamount, value, balance, from_amount, to_amount
numericNumeric fieldsamount, value, balance, decimals, gas_used
beneficiaryBeneficiariesbeneficiary_id, beneficiary_address, recipient_id
ramp_tokenRamp tokensinput_asset_id, output_asset_id
ramp_fiatRamp fiat currenciesinput_asset_id, output_asset_id
defi_positionDeFi positionsposition_id, defi_position_id
uuidUnique identifiersid, resource_id, account_id
anyAny fieldAll available fields

Temporal Filters

The system also applies temporal filters to ensure that only events happening BEFORE the current action are shown:

  • Included: Hooks (always depth 0) and Actions with lower depth
  • Excluded: The current action itself and Actions that depend on it

Usage Examples

# Wallet field - shows only compatible fields
power_autocomplete_field(
label: "Source Wallet",
field_type: "wallet"
# Shows: {events.hooks.crypto_charge_paid.wallet_address}
# Does not show: {events.hooks.crypto_charge_paid.amount}
)

# Token field - shows only token fields
power_autocomplete_field(
label: "Token",
field_type: "token"
# Shows: {events.hooks.crypto_charge_paid.token.id}
# Does not show: {events.hooks.crypto_charge_paid.wallet_address}
)

# Amount field - shows only numeric values
power_autocomplete_field(
label: "Amount",
field_type: "amount"
# Shows: {events.hooks.crypto_charge_paid.amount}
# Does not show: {events.hooks.crypto_charge_paid.token.symbol}
)

Next steps: Explore Workspaces to create your automations.