> For the complete documentation index, see [llms.txt](https://docs.talus.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.talus.network/reference/move/nexus_scheduler/execution_settlement.md).

# nexus\_scheduler::execution\_settlement

* [Function `abort_expired_execution`](#function-abort_expired_execution)
* [Function `settle_committed_tool_result_for_walk_by_leader`](#function-settle_committed_tool_result_for_walk_by_leader)
* [Function `record_committed_tool_result_gas_charge_by_leader`](#function-record_committed_tool_result_gas_charge_by_leader)
* [Function `refill_tap_execution_payment`](#function-refill_tap_execution_payment)
* [Function `refill_tap_execution_payment_from_agent_vault`](#function-refill_tap_execution_payment_from_agent_vault)
* [Function `settle_committed_tool_result_for_walk`](#function-settle_committed_tool_result_for_walk)
* [Function `cleanup_broken_onchain_tool_result`](#function-cleanup_broken_onchain_tool_result)
* [Function `settle_onchain_tool_result_for_walk`](#function-settle_onchain_tool_result_for_walk)
* [Function `emit_payment_ready_walk_requests`](#function-emit_payment_ready_walk_requests)

### Function `abort_expired_execution`

Aborts an execution whose active walk has expired.

```move
public fun abort_expired_execution(authority: &nexus_kernel::runtime_authority::RuntimeAuthority, dag: &nexus_interface::dag::DAG, execution: &mut nexus_workflow::execution::DAGExecution, clock: &sui::clock::Clock, ctx: &mut sui::tx_context::TxContext)
```

#### Function `settle_committed_tool_result_for_walk_by_leader`

Records gas and settles one committed Tool result as the responsible leader.

```move
public fun settle_committed_tool_result_for_walk_by_leader(authority: &nexus_kernel::runtime_authority::RuntimeAuthority, dag: &nexus_interface::dag::DAG, execution: &mut nexus_workflow::execution::DAGExecution, tool_registry: &nexus_tool::tool_registry::ToolRegistry, leader_registry: &nexus_registry::leader::LeaderRegistry, priority_fee_vault: &nexus_registry::priority_fee_vault::PriorityFeeVault, leader_cap: &nexus_primitives::owner_cap::CloneableOwnerCap<nexus_registry::leader_cap::OverNetwork>, walk_index: u64, expected_vertex: nexus_interface::graph::RuntimeVertex, failed_onchain_tool_reason: std::option::Option<vector<u8>>, commit_tx_digest: vector<u8>, commit_gas_charge: u64, settlement_gas_charge: u64, clock: &sui::clock::Clock, ctx: &mut sui::tx_context::TxContext)
```

#### Function `record_committed_tool_result_gas_charge_by_leader`

Records one leader's committed Tool result gas charge.

```move
public fun record_committed_tool_result_gas_charge_by_leader(authority: &nexus_kernel::runtime_authority::RuntimeAuthority, dag: &nexus_interface::dag::DAG, execution: &mut nexus_workflow::execution::DAGExecution, leader_registry: &nexus_registry::leader::LeaderRegistry, leader_cap: &nexus_primitives::owner_cap::CloneableOwnerCap<nexus_registry::leader_cap::OverNetwork>, walk_index: u64, expected_vertex: nexus_interface::graph::RuntimeVertex, failed_onchain_tool_reason: std::option::Option<vector<u8>>, commit_tx_digest: vector<u8>, commit_gas_charge: u64, settlement_gas_charge: u64, clock: &sui::clock::Clock, ctx: &mut sui::tx_context::TxContext)
```

#### Function `refill_tap_execution_payment`

Refills one execution payment from a coin.

```move
public fun refill_tap_execution_payment(authority: &nexus_kernel::runtime_authority::RuntimeAuthority, execution: &mut nexus_workflow::execution::DAGExecution, coin: sui::coin::Coin<sui::sui::SUI>, ctx: &mut sui::tx_context::TxContext)
```

#### Function `refill_tap_execution_payment_from_agent_vault`

Refills one execution payment from its Agent vault.

```move
public fun refill_tap_execution_payment_from_agent_vault(authority: &nexus_kernel::runtime_authority::RuntimeAuthority, agent: &mut nexus_interface::agent::Agent, execution: &mut nexus_workflow::execution::DAGExecution, amount: u64)
```

#### Function `settle_committed_tool_result_for_walk`

Settles one committed Tool result after its permissionless deadline.

```move
public fun settle_committed_tool_result_for_walk(authority: &nexus_kernel::runtime_authority::RuntimeAuthority, dag: &nexus_interface::dag::DAG, execution: &mut nexus_workflow::execution::DAGExecution, tool_registry: &nexus_tool::tool_registry::ToolRegistry, leader_registry: &nexus_registry::leader::LeaderRegistry, priority_fee_vault: &nexus_registry::priority_fee_vault::PriorityFeeVault, walk_index: u64, clock: &sui::clock::Clock, ctx: &mut sui::tx_context::TxContext)
```

#### Function `cleanup_broken_onchain_tool_result`

Removes an invalid Tool result after its cleanup deadline.

```move
public fun cleanup_broken_onchain_tool_result(authority: &nexus_kernel::runtime_authority::RuntimeAuthority, dag: &nexus_interface::dag::DAG, execution: &mut nexus_workflow::execution::DAGExecution, tool_registry: &nexus_tool::tool_registry::ToolRegistry, result: nexus_interface::onchain_tool_result::OnchainToolResult, leader_registry: &nexus_registry::leader::LeaderRegistry, walk_index: u64, tool_witness_id: sui::object::ID, clock: &sui::clock::Clock)
```

#### Function `settle_onchain_tool_result_for_walk`

Consumes and settles a permissionless onchain Tool result.

```move
public fun settle_onchain_tool_result_for_walk(authority: &nexus_kernel::runtime_authority::RuntimeAuthority, dag: &nexus_interface::dag::DAG, execution: &mut nexus_workflow::execution::DAGExecution, tool_registry: &nexus_tool::tool_registry::ToolRegistry, result: nexus_interface::onchain_tool_result::OnchainToolResult, leader_registry: &nexus_registry::leader::LeaderRegistry, priority_fee_vault: &nexus_registry::priority_fee_vault::PriorityFeeVault, walk_index: u64, expected_vertex: nexus_interface::graph::RuntimeVertex, tool_witness_id: sui::object::ID, clock: &sui::clock::Clock, ctx: &mut sui::tx_context::TxContext)
```

#### Function `emit_payment_ready_walk_requests`

Emits requests for active walks whose payment is ready.

```move
public fun emit_payment_ready_walk_requests(authority: &nexus_kernel::runtime_authority::RuntimeAuthority, dag: &nexus_interface::dag::DAG, execution: &mut nexus_workflow::execution::DAGExecution, leader_registry: &nexus_registry::leader::LeaderRegistry, clock: &sui::clock::Clock, ctx: &mut sui::tx_context::TxContext)
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.talus.network/reference/move/nexus_scheduler/execution_settlement.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
