Runtime injection gives developers a powerful way to compose transactions when some values — like token amounts — aren’t known until execution time. This is a major evolution beyond traditional static batching, where all parameters must be known upfront. Instead of asking users to guess or estimate how much will arrive after a bridge or swap, AbstractJS lets you define placeholders — runtime values — that get resolved dynamically when the transaction is executed.Documentation Index
Fetch the complete documentation index at: https://docs.biconomy.io/llms.txt
Use this file to discover all available pages before exploring further.
Why It Matters
Traditional transaction batching is rigid:- You must hardcode every parameter
- You can’t adapt to bridges, swaps, or slippage
- You often over- or under-estimate received amounts
- Use actual token balances at the moment of execution
- Protect users with constraints (e.g. slippage limits)
- Compose flows across chains with fewer assumptions
Basic Usage
Available Runtime Functions
| Function | Description | Introduced in |
|---|---|---|
runtimeERC20BalanceOf | Inject the ERC20 balance of a target address at runtime | MEE v1.0.0 |
runtimeNativeBalanceOf | Inject the native token balance of a target address at runtime | MEE v2.2.0 |
runtimeERC20AllowanceOf | Inject the ERC20 token allowance | MEE v1.0.0 |
runtimeParamViaCustomStaticCall | Inject any return data (up to 32 bytes in size) at runtime | MEE v2.2.0 |
runtimeERC20BalanceOf
Inject the token balance of an address — most often your orchestrator address — at the time of execution.runtimeNativeBalanceOf
Inject the native token balance of an address — most often your orchestrator address — at the time of execution.runtimeERC20AllowanceOf
Inject the ERC20 token allowance between two addresses at the time of execution. This is useful when you need to check or use allowances dynamically.runtimeParamViaCustomStaticCall
Allows to execute an arbitrary READ (static) call on-chain, and use the return of this call as an input argument. Return data should be up to 32 bytes:address, bytes32, uintXXX Solidity types are expected.
Constraints = Execution Control
Constraints ensure that runtime-injected values meet specific criteria. If constraints are not met, the instruction will not execute. But even more importantly — they determine when instructions will execute. This is key for cross-chain orchestration.Transaction Ordering
When a runtime value is used, the orchestration system will wait until all constraints are satisfied before executing. This means constraints enforce dependency:nexusAddress has a non-zero balance of USDC.
In multi-chain orchestration, this is the mechanism that controls execution sequencing.
Handling Slippage
Safety Nets
Constraints act like assert statements. If the value isn’t good — don’t execute.Cross-Chain Example
- MEE simulates the swap instruction
- Simulation fails (no tokens yet)
- MEE waits and retries
- Bridge completes
- Constraints satisfied → transaction proceeds
Best Practices
Use runtime injection when values are unknown ahead of time
Always apply constraints to protect users and define execution rules
Use with transfer instructions to sweep remaining balances
Design for graceful failure if constraints aren’t met
How It Works
AbstractJS builds orchestration callData with placeholders. During execution:- The smart account receives
executeComposable() - The fallback handler reads blockchain state
- Runtime values are injected into calldata
- The final transaction executes with those resolved parameters
Summary
Runtime injection turns your orchestration flows into state-aware, auto-sequencing logic that adapts to bridge results, swap outputs, slippage conditions, and more. Use it when:- You’re building cross-chain workflows
- You can’t predict output values
- You want fewer failures and better UX