Overview
When using policies with Express API, you need to provide transaction data so that policy conditions can be evaluated. This data is used to check whether transactions meet your policy rules before signing occurs.Transaction data is required when policy evaluation is enabled for your application. It must match the raw transaction data being signed to ensure policy conditions evaluate correctly.
Transaction Data Structure
TheTransactionData object contains information about the transaction or message being signed. Different fields are relevant depending on the signing method and blockchain network.
Transaction Data Fields
The signing method being used. Valid values:
eth_signTransaction- Sign an Ethereum transactionpersonal_sign- Sign a message using personal_signeth_signTypedData- Sign EIP-712 typed data (legacy)eth_signTypedData_v3- Sign EIP-712 typed data v3eth_signTypedData_v4- Sign EIP-712 typed data v4eth_signMessage- Sign fringe message format
Recipient address for transactions. Must be a valid address format (e.g.,
0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb). Relevant for transaction signing methods.Transaction value in wei. Can be provided as a decimal string or hex string (e.g.,
"1000000000000000000" or "0x0de0b6b3a7640000"). Automatically converted to integer for policy evaluation.Transaction data (contract call data) as a hex string. Must start with
0x prefix.The chain ID for the transaction (e.g.,
1 for Ethereum mainnet, 137 for Polygon).Transaction nonce. Used to ensure transaction ordering.
Gas limit for the transaction. Can be provided as decimal string or hex string (e.g.,
"21000" or "0x5208").Maximum fee per gas unit (EIP-1559 transactions). Can be provided as decimal string or hex string.
Maximum priority fee per gas unit (EIP-1559 transactions). Can be provided as decimal string or hex string.
Gas price for legacy transactions. Can be provided as decimal string or hex string.
EIP-712 typed data structure. Required for
eth_signTypedData_v3 and eth_signTypedData_v4 methods.Using Transaction Data
With Sign Data Endpoint
When signing transactions or messages, includetransaction_data in your request to enable policy evaluation:
cURL
With Policy Evaluation Status Endpoint
Check whether a transaction will be allowed by your policies and whether step-up authentication is required:cURL
Whether the transaction passes all active global policies. If
false, the transaction will be blocked.Whether step-up authentication (MFA) is required based on step-up policies. If
true, the user must provide a one-time code.Examples by Signing Method
Ethereum Transaction Signing
For standard Ethereum transactions, include transaction fields:Personal Sign
For personal message signing, only the method is required:EIP-712 Typed Data Signing
For typed data signing, include the full typed data structure:typed_data_domain_{fieldName} and message fields as typed_data_message_{fieldName}.
Field Mapping for Policy Conditions
When creating policy conditions, you need to specify the correctfield_source and field names. Here’s how transaction data maps to policy condition fields:
Ethereum Transaction Fields
Forfield_source: "ethereum_transaction", use these field names:
Available Transaction Fields
Available Transaction Fields
Recipient address. Addresses are normalized to lowercase for comparison.
Transaction value in wei. Automatically converted from hex string to integer.
Transaction data (contract call data) as hex string.
Chain ID for the transaction.
Transaction nonce.
Gas limit for the transaction. Automatically converted from hex string to integer.
Maximum fee per gas (EIP-1559). Automatically converted from hex string to integer.
Maximum priority fee per gas (EIP-1559). Automatically converted from hex string to integer.
Gas price for legacy transactions. Automatically converted from hex string to integer.
Typed Data Fields
Forfield_source: "typed_data", use field names that match the typed data structure. Domain fields are prefixed with typed_data_domain_ and message fields with typed_data_message_.
Example: If your typed data has domain.name and message.to.address, you would use:
- Field name:
typed_data_domain_namefor domain.name - Field name:
typed_data_message_to_addressfor message.to.address
System Fields
Forfield_source: "system", available fields:
Current Unix timestamp in seconds. Useful for time-based policy conditions.
Example Policy Conditions
Check Transaction Value
Check Recipient Address
Check Typed Data Domain
Check Typed Data Message Fields
For typed data message fields, use thetyped_data_message_{fieldName} pattern:
makerAmount field in the typed data message is greater than 10,000,000.
Check Typed Data Verifying Contract
Block signatures for specific smart contract addresses:Check Gas Price
Data Format Guidelines
Value Formatting
- Wei values: Can be provided as decimal strings (
"1000000000000000000") or hex strings ("0x0de0b6b3a7640000") - Policy evaluation: Values are automatically converted to integers for comparison
- Large numbers: Use string format to avoid precision loss
Address Formatting
- Addresses should include the
0xprefix - Addresses are case-insensitive and normalized to lowercase
- Example:
"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
Hex String Formatting
- All hex strings must start with
0xprefix - Gas values, transaction data, and hex-encoded values follow this format
- Example:
"0x5208"for decimal 21000
Chain ID
- Provided as an integer, not a hex string
- Common values:
1(Ethereum mainnet),137(Polygon),42161(Arbitrum)
Best Practices
- Always include transaction data when policy evaluation is enabled to ensure policies can evaluate correctly.
- Match the raw_data_hash - The hash must be computed from the exact transaction data you provide.
- Include all relevant fields - Provide complete transaction information so policies have all necessary data for evaluation.
- Use consistent formats - Stick to either decimal strings or hex strings consistently (though both are supported).
- Check policy status first - Use the policy evaluation status endpoint to check if a transaction will be allowed before attempting to sign.
-
Handle step-up requirements - If
is_step_up_requiredistrue, prompt users for MFA before signing.