> 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/talus-docs-v2.1.0/reference/sdk/transactions.md).

# Transaction Builders

**Audience:** Nexus SDK integrators (Rust).

**Area:** Transaction Builders.

**Generated from:** Nexus SDK public transaction API at release `v2.1.0` commit `45d397aafcfbeeeaf5032d5fb9fa5d99b3f36205`; the generated inventory is preserved and 2.1.0 builders are source-verified.

{% hint style="warning" %}
**Before executing a builder:** Verify matching SDK bindings, package IDs, RuntimeAuthority, and deployment effects. `authorize_ptb` uses `RuntimeAuthority` and the exact leader capability, while `abort_expired_ptb` refunds one exact Invocation before optional occurrence settlement. Use [Invocation policy and settlement model](/talus-docs-v2.1.0/concepts/06-payment-vaults-reserves-and-settlement.md#invocation-policy-and-settlement-model) and [Protocol Upgrades and Compatibility](/talus-docs-v2.1.0/concepts/14-protocol-upgrades-and-compatibility.md) for identity and witness/permit boundaries.
{% endhint %}

### 2.1.0 transaction boundaries

Transaction builders consume generated binding values and object references resolved from an authenticated context. Use the SDK's execution-ID helpers and transaction-output reads to connect a submitted digest to the resulting Task, Occurrence, Execution, or Tool object; do not infer identity from a caller-supplied ID alone.

`TaskInnerV1::advertised_offer` returns an offer only for an active task with an advertised occurrence, and its `DispatchOffer` conversion validates deadline ordering and priority-fee bounds. Separately, the on-chain scheduler uses `LEADER_SUBMISSION_WINDOW_MS = 30000` as the leader-submission and retry window. Re-read effects and object versions before submitting or retrying an ambiguous transaction.

#### `sdk/src/transactions/leader.rs`

**`SchedulerTransaction<'transaction>`**

```rust
pub struct SchedulerTransaction<'transaction> { /* private fields */ }
```

**`sdk/src/transactions/tool.rs`**

**Public input types**

* `ExternalVerifierObjectInput { object_ref, mutable }` describes one verifier object.
* `ExternalVerifierRegistrationInput { package_id, module_name, function_name, witness, shared_objects }` is the preflighted external-verifier registration.
* `OffChainToolRegistration` carries an off-chain Tool's owner address, `ToolMeta`, invocation cost, optional initial NetworkAuth key, and verifier support.

**Registration and mutation builders**

| Builder                                                      | Purpose                                                         |
| ------------------------------------------------------------ | --------------------------------------------------------------- |
| `register_off_chain_for_self_ptb`                            | Register one off-chain Tool with sender ownership and coin gas. |
| `register_off_chain_for_self_with_address_balance_ptb`       | Register one off-chain Tool while using address-balance gas.    |
| `register_off_chain_batch_for_self_with_address_balance_ptb` | Register a batch through address-balance gas.                   |
| `register_on_chain_for_self_ptb`                             | Register one on-chain Tool with sender ownership and coin gas.  |
| `register_on_chain_for_self_with_address_balance_ptb`        | Register one on-chain Tool through address-balance gas.         |
| `set_invocation_cost_ptb`                                    | Set the registered Tool invocation price.                       |
| `unregister_ptb`                                             | Unregister an active Tool.                                      |
| `migrate_on_chain_tool_package_ptb`                          | Replace an active on-chain Tool's package address.              |
| `configure_registered_key_verifier_ptb`                      | Select the built-in RegisteredKey verifier.                     |
| `register_external_verifier_ptb`                             | Register a preflighted external verifier.                       |
| `claim_collateral_for_self_ptb`                              | Claim Tool collateral through the owner capability.             |
| `update_tool_timeout_ptb`                                    | Update invocation timeout.                                      |
| `update_off_chain_tool_url_ptb`                              | Replace an off-chain Tool endpoint.                             |

**`sdk/src/transactions/dag.rs`**

**Public preparation types**

* `RuntimeToolCashierRef` identifies one runtime ToolCashier reference.
* `OffchainVerifierKeyBindings` holds resolved request and response key bindings.
* `PreparedOffchainToolResultSubmission` distinguishes direct, RegisteredKey, and external-verifier off-chain submission preparation.
* `OnchainToolArgument` represents a pure, owned, immutable shared, or mutable shared Tool argument.
* `PreparedOnchainToolExecution` contains the derived package call and arguments for one on-chain Tool.
* `PreparedOnchainToolResultSubmission` distinguishes a result object from a failed execution.
* `BrokenOnchainToolResultCleanupInput` identifies a broken result that must be cleaned during abort.

**Public builders and composition helpers**

| Builder                                                 | Purpose                                                      |
| ------------------------------------------------------- | ------------------------------------------------------------ |
| `submit_off_chain_tool_result_for_walk_ptb`             | Submit one prepared off-chain result for a walk.             |
| `submit_on_chain_tool_result_for_walk_ptb`              | Execute and submit one prepared on-chain result.             |
| `consume_on_chain_tool_result_for_walk_ptb`             | Consume a prepared on-chain result object.                   |
| `dry_run_on_chain_tool_result_for_walk_ptb`             | Build the on-chain Tool dry-run transaction.                 |
| `create_on_chain_tool_result_for_walk`                  | Compose creation of an on-chain result inside a PTB.         |
| `framework_random_object`                               | Add the Sui framework Random shared object.                  |
| `consume_on_chain_tool_result_for_walk`                 | Compose result consumption inside a PTB.                     |
| `record_committed_tool_result_gas_charge_by_leader_ptb` | Record leader commit and settlement gas.                     |
| `settle_committed_tool_result_for_walk_by_leader_ptb`   | Settle a committed result with leader authority.             |
| `abort_expired_execution_for_self_ptb`                  | Abort expired execution and supplied broken-result cleanups. |
| `settle_committed_tool_result_for_walk_for_self_ptb`    | Permissionlessly settle one committed result.                |
| `settle_onchain_tool_result_for_walk`                   | Compose on-chain result settlement.                          |
| `settle_onchain_tool_result_for_walk_for_self_ptb`      | Build a permissionless on-chain result settlement.           |
| `cleanup_broken_onchain_tool_result`                    | Compose cleanup for one broken on-chain result.              |

These builders derive identity from authenticated Move objects. Do not reintroduce caller-supplied Execution, vertex, or leader identity where the documented signatures resolve it from object inputs.

**`sdk/src/transactions/gas.rs`**

**`sdk/src/transactions/network.rs`**

**`sdk/src/transactions/tool_cashier.rs`**

The SDK does not expose the historical `abort_expired_execution_with_tool_cashier_ptb` cashier-candidate builder. Do not use a ToolCashier ID, FQN, or discovered cashier candidate as the identity of an expired Invocation.

**`sdk/src/transactions/invocation.rs`**

The exact `abort_expired_ptb` declaration appears once in the source-derived inventory below. It consumes the matching timeout/refund receipt before applying the abort and any optional occurrence settlement; the neighboring `settle` function is crate-private and is not a public caller-facing builder.

**`sdk/src/transactions/scheduler/mod.rs`**

The scheduler transaction module exports three low-level production builders: `dispatch_occurrence_ptb`, `expire_occurrence_with_gas_charge_ptb`, and `reject_occurrence_with_gas_charge_ptb`. Task creation and the remaining lifecycle compilers are crate-private implementation details of the `Scheduler` facade.

**`sdk/src/transactions/network_auth.rs`**

Tool-binding composition is crate-private and consumed by higher-level Tool and NetworkAuth actions. The public transaction surface contains only the leader variants:

* `create_leader_binding_and_register_key_ptb` creates a leader key binding, verifies proof of possession, registers its first key, and shares the binding.
* `register_leader_key_on_existing_binding_ptb` rotates a key on an existing leader binding.

**`sdk/src/transactions/leader.rs`**

* `over_network_cap_struct_tag(objects)` returns the configured `CloneableOwnerCap<OverNetwork>` tag.
* `register_for_self_ptb(objects, stake_coin, stake_us)` registers the sender as a leader while retaining unused `$US` in the input coin.
* `activate_and_claim_for_self_ptb(objects, leader_cap_over_network)` activates and claims leadership with the transaction digest token.
* `suspend_if_token_for_self_ptb(objects, leader_cap_over_network, token)` suspends only when the supplied token still matches the active claim.

No public Protocol state-schema migration module or V2 state decoder exists in the documented SDK. Do not infer such a surface from test fixtures or from the on-chain Tool package-pointer builder documented above.

### Source-derived public API inventory

#### `NexusTransaction`

```rust
pub struct NexusTransaction {
    client: NexusClient,
    source: TransactionSource,
    transaction: NexusPtbBuilder,
}
```

#### `NexusTransaction::scheduler`

```rust
pub fn scheduler(&mut self) -> SchedulerTransaction<'_> {
```

#### `NexusTransaction::finish`

```rust
pub fn finish(self) -> sui::types::ProgrammableTransaction {
```

#### `NexusTransaction::submit`

```rust
pub async fn submit(self) -> Result<ExecutedTransaction, NexusError> {
```

#### `SchedulerTransaction`

```rust
pub struct SchedulerTransaction<'transaction> {
    client: &'transaction NexusClient,
    source: TransactionSource,
    transaction: &'transaction mut NexusPtbBuilder,
}
```

#### `SchedulerTransaction::create_task`

```rust
pub async fn create_task<'draft>(
        &'draft mut self,
        task: &TaskSpec,
    ) -> Result<TaskDraft<'draft>, SchedulerError> {
```

#### `SchedulerTransaction::dispatch_occurrence`

```rust
pub fn dispatch_occurrence(
        &mut self,
        offer: &DispatchOffer,
        task: &sui::types::ObjectReference,
        dag: &sui::types::ObjectReference,
        leader_cap: &sui::types::ObjectReference,
        gas_charge: u64,
    ) -> Result<(), SchedulerError> {
```

#### `SchedulerTransaction::expire_occurrence`

```rust
pub fn expire_occurrence(
        &mut self,
        occurrence: OccurrenceRef,
        task: &sui::types::ObjectReference,
    ) -> Result<(), SchedulerError> {
```

#### `TaskDraft`

```rust
pub struct TaskDraft<'builder> {
    client: &'builder NexusClient,
    compiler: TaskDraftCompiler<'builder>,
}
```

#### `TaskDraft::schedule`

```rust
pub async fn schedule(self, schedule: &Schedule) -> Result<Self, SchedulerError> {
```

#### `TaskDraft::share`

```rust
pub fn share(self) -> Result<(), SchedulerError> {
```

#### `AgentInput`

```rust
pub enum AgentInput {
    Owned(sui::types::ObjectReference),
    Shared(sui::types::ObjectReference),
    Immutable(sui::types::ObjectReference),
}
```

#### `AgentInput::object_id`

```rust
pub fn object_id(&self) -> sui::types::Address {
```

#### `OffchainVerifierKeyBindings`

```rust
pub struct OffchainVerifierKeyBindings {
    pub leader_key_binding: sui::types::ObjectReference,
    pub tool_key_binding: sui::types::ObjectReference,
}
```

#### `PreparedOffchainToolResultSubmission`

```rust
pub enum PreparedOffchainToolResultSubmission {
    NoVerifier {
        result: OffchainToolOutput,
        meta_schema: MetaSchema,
    },
    RegisteredKeyVerifier {
        tool_id: sui::types::Address,
        result: OffchainToolOutput,
        meta_schema: MetaSchema,
        auxiliary: RegisteredKeyAuxiliary,
        bindings: OffchainVerifierKeyBindings,
    },
    ExternalVerifier {
        result: OffchainToolOutput,
        meta_schema: MetaSchema,
        auxiliary: Vec<u8>,
        runtime_call: ExternalVerifierRuntimeCall,
    },
}
```

#### `OnchainToolArgument`

```rust
pub enum OnchainToolArgument {
    ObjectId(sui::types::Address),
    Pure(Vec<u8>),
    SharedObject {
        object_id: sui::types::Address,
        initial_shared_version: sui::types::Version,
        mutable: bool,
    },
    Object(sui::types::ObjectReference),
    Vector {
        type_tag: Option<sui::types::TypeTag>,
        elements: Vec<OnchainToolArgument>,
    },
}
```

#### `PreparedOnchainToolExecution`

```rust
pub struct PreparedOnchainToolExecution {
    pub package: sui::types::Address,
    pub module: String,
    pub tool_witness_id: sui::types::Address,
    pub requires_authorization_cap: bool,
    pub arguments: Vec<OnchainToolArgument>,
}
```

#### `PreparedOnchainToolResultSubmission`

```rust
pub enum PreparedOnchainToolResultSubmission {
    Execute(PreparedOnchainToolExecution),
}
```

#### `BrokenOnchainToolResultCleanupInput`

```rust
pub struct BrokenOnchainToolResultCleanupInput {
    pub walk_index: u64,
    pub result_ref: sui::types::ObjectReference,
    pub tool_witness_id: sui::types::Address,
}
```

#### `submit_off_chain_tool_result_for_walk_ptb`

```rust
pub fn submit_off_chain_tool_result_for_walk_ptb(
    objects: &NexusContext,
    dag: &sui::types::ObjectReference,
    execution: (sui::types::Address, sui::types::Version),
    leader_cap: &sui::types::ObjectReference,
    walk_index: u64,
    next_vertex: &RuntimeVertex,
    submission: &PreparedOffchainToolResultSubmission,
) -> anyhow::Result<ProgrammableTransaction> {
```

#### `submit_on_chain_tool_result_for_walk_ptb`

```rust
pub fn submit_on_chain_tool_result_for_walk_ptb(
    objects: &NexusContext,
    dag: &sui::types::ObjectReference,
    execution: (sui::types::Address, sui::types::Version),
    leader_cap: &sui::types::ObjectReference,
    walk_index: u64,
    next_vertex: &RuntimeVertex,
    submission: &PreparedOnchainToolResultSubmission,
) -> anyhow::Result<ProgrammableTransaction> {
```

#### `consume_on_chain_tool_result_for_walk_ptb`

```rust
pub fn consume_on_chain_tool_result_for_walk_ptb(
    objects: &NexusContext,
    dag: &sui::types::ObjectReference,
    execution: (sui::types::Address, sui::types::Version),
    leader_cap: &sui::types::ObjectReference,
    invocation: &sui::types::ObjectReference,
    walk_index: u64,
    next_vertex: &RuntimeVertex,
    result: (sui::types::Address, sui::types::Version),
    tool_witness_id: sui::types::Address,
    finalize_gas_charge: u64,
    settlement_gas_charge: u64,
    task_settlement: Option<&sui::types::ObjectReference>,
) -> anyhow::Result<ProgrammableTransaction> {
```

#### `dry_run_on_chain_tool_result_for_walk_ptb`

```rust
pub fn dry_run_on_chain_tool_result_for_walk_ptb(
    objects: &NexusContext,
    dag: &sui::types::ObjectReference,
    execution: (sui::types::Address, sui::types::Version),
    leader_cap: &sui::types::ObjectReference,
    walk_index: u64,
    next_vertex: &RuntimeVertex,
    execution_plan: &PreparedOnchainToolExecution,
) -> anyhow::Result<ProgrammableTransaction> {
```

#### `create_on_chain_tool_result_for_walk`

```rust
pub fn create_on_chain_tool_result_for_walk(
    tx: &mut move_boundary::NexusPtbBuilder,
    dag: sui::types::Argument,
    execution: sui::types::Argument,
    tool_registry: sui::types::Argument,
    worksheet: sui::types::Argument,
    stamp: sui::types::Argument,
    leader_cap: sui::types::Argument,
    leader_registry: sui::types::Argument,
    walk_index: u64,
    expected_vertex: sui::types::Argument,
) -> anyhow::Result<(sui::types::Argument, sui::types::Argument)> {
```

#### `framework_random_object`

```rust
pub fn framework_random_object(
    tx: &mut move_boundary::NexusPtbBuilder,
) -> anyhow::Result<sui::types::Argument> {
```

#### `consume_on_chain_tool_result_for_walk`

```rust
pub fn consume_on_chain_tool_result_for_walk(
    tx: &mut move_boundary::NexusPtbBuilder,
    dag: sui::types::Argument,
    execution: sui::types::Argument,
    tool_registry: sui::types::Argument,
    result: sui::types::Argument,
    leader_cap: sui::types::Argument,
    leader_registry: sui::types::Argument,
    priority_fee_vault: sui::types::Argument,
    walk_index: u64,
    expected_vertex: &RuntimeVertex,
    tool_witness_id: sui::types::Address,
    commit_gas_charge: u64,
    settlement_gas_charge: u64,
    clock: sui::types::Argument,
) -> anyhow::Result<()> {
```

#### `record_committed_tool_result_gas_charge_by_leader_ptb`

```rust
pub fn record_committed_tool_result_gas_charge_by_leader_ptb(
    objects: &NexusContext,
    dag: &sui::types::ObjectReference,
    execution: (sui::types::Address, sui::types::Version),
    leader_cap: &sui::types::ObjectReference,
    walk_index: u64,
    expected_vertex: &RuntimeVertex,
    failed_onchain_tool_reason: Option<Vec<u8>>,
    commit_tx_digest: Vec<u8>,
    commit_gas_charge: u64,
    settlement_gas_charge: u64,
) -> anyhow::Result<ProgrammableTransaction> {
```

#### `settle_committed_tool_result_for_walk_by_leader_ptb`

```rust
pub fn settle_committed_tool_result_for_walk_by_leader_ptb(
    objects: &NexusContext,
    dag: &sui::types::ObjectReference,
    execution: (sui::types::Address, sui::types::Version),
    leader_cap: &sui::types::ObjectReference,
    invocation: &sui::types::ObjectReference,
    walk_index: u64,
    expected_vertex: &RuntimeVertex,
    failed_onchain_tool_reason: Option<Vec<u8>>,
    commit_tx_digest: Vec<u8>,
    commit_gas_charge: u64,
    settlement_gas_charge: u64,
    task_settlement: Option<&sui::types::ObjectReference>,
) -> anyhow::Result<ProgrammableTransaction> {
```

#### `abort_expired_execution_for_self_ptb`

```rust
pub fn abort_expired_execution_for_self_ptb(
    objects: &NexusContext,
    dag: &sui::types::ObjectReference,
    execution: &sui::types::ObjectReference,
    broken_onchain_result_cleanups: &[BrokenOnchainToolResultCleanupInput],
    task_settlement: Option<&sui::types::ObjectReference>,
) -> anyhow::Result<ProgrammableTransaction> {
```

#### `settle_committed_tool_result_for_walk_for_self_ptb`

```rust
pub fn settle_committed_tool_result_for_walk_for_self_ptb(
    objects: &NexusContext,
    dag: &sui::types::ObjectReference,
    execution: &sui::types::ObjectReference,
    invocation: &sui::types::ObjectReference,
    walk_index: u64,
    expected_vertex: &RuntimeVertex,
    task_settlement: Option<&sui::types::ObjectReference>,
) -> anyhow::Result<ProgrammableTransaction> {
```

#### `settle_onchain_tool_result_for_walk`

```rust
pub fn settle_onchain_tool_result_for_walk(
    tx: &mut move_boundary::NexusPtbBuilder,
    dag: sui::types::Argument,
    execution: sui::types::Argument,
    tool_registry: sui::types::Argument,
    result: sui::types::Argument,
    leader_registry: sui::types::Argument,
    priority_fee_vault: sui::types::Argument,
    walk_index: u64,
    expected_vertex: &RuntimeVertex,
    tool_witness_id: sui::types::Address,
    clock: sui::types::Argument,
) -> anyhow::Result<()> {
```

#### `settle_onchain_tool_result_for_walk_for_self_ptb`

```rust
pub fn settle_onchain_tool_result_for_walk_for_self_ptb(
    objects: &NexusContext,
    dag: &sui::types::ObjectReference,
    execution: &sui::types::ObjectReference,
    invocation: &sui::types::ObjectReference,
    result: &sui::types::ObjectReference,
    walk_index: u64,
    expected_vertex: &RuntimeVertex,
    tool_witness_id: sui::types::Address,
    task_settlement: Option<&sui::types::ObjectReference>,
) -> anyhow::Result<ProgrammableTransaction> {
```

#### `cleanup_broken_onchain_tool_result`

```rust
pub fn cleanup_broken_onchain_tool_result(
    tx: &mut move_boundary::NexusPtbBuilder,
    dag: sui::types::Argument,
    execution: sui::types::Argument,
    tool_registry: sui::types::Argument,
    result: sui::types::Argument,
    leader_registry: sui::types::Argument,
    walk_index: u64,
    tool_witness_id: sui::types::Address,
    clock: sui::types::Argument,
) -> anyhow::Result<()> {
```

#### `deposit_sui_to_address_balance`

```rust
pub fn deposit_sui_to_address_balance(
    objects: &NexusContext,
    amount_mist: u64,
    recipient: sui::types::Address,
) -> anyhow::Result<sui::types::ProgrammableTransaction> {
```

#### `deposit_sui_to_address_balances`

```rust
pub fn deposit_sui_to_address_balances(
    objects: &NexusContext,
    deposits: &[(u64, sui::types::Address)],
) -> anyhow::Result<sui::types::ProgrammableTransaction> {
```

#### `InvocationPolicyCall`

```rust
pub struct InvocationPolicyCall {
    pub policy: TypeName,
    pub arguments: Vec<OnchainToolArgument>,
}
```

#### `InvocationTarget`

```rust
pub struct InvocationTarget<'a> {
    pub walk_index: u64,
    pub vertex: &'a RuntimeVertex,
}
```

#### `InvocationPolicyCall::new`

```rust
pub fn new(policy: TypeName, arguments: Vec<OnchainToolArgument>) -> Self {
```

#### `InvocationPolicyCall::fixed_price`

```rust
pub fn fixed_price(context: &NexusContext) -> anyhow::Result<Self> {
```

#### `InvocationPolicyCall::finite_credits`

```rust
pub fn finite_credits(
        context: &NexusContext,
        credits: sui::types::Address,
        initial_shared_version: sui::types::Version,
    ) -> anyhow::Result<Self> {
```

#### `finite_credits_policy`

```rust
pub fn finite_credits_policy(context: &NexusContext) -> anyhow::Result<TypeName> {
```

#### `time_pass`

```rust
pub fn time_pass(
        context: &NexusContext,
        pass: sui::types::Address,
        initial_shared_version: sui::types::Version,
    ) -> anyhow::Result<Self> {
```

#### `authorize`

```rust
pub fn authorize(
    transaction: &mut move_boundary::NexusPtbBuilder,
    cashier: sui::types::Argument,
    dag: sui::types::Argument,
    execution: sui::types::Argument,
    leader_registry: sui::types::Argument,
    leader_cap: sui::types::Argument,
    target: InvocationTarget<'_>,
    policy: &InvocationPolicyCall,
    submission_gas_charge: u64,
) -> anyhow::Result<sui::types::Argument> {
```

#### `authorize_ptb`

```rust
pub fn authorize_ptb(
    context: &NexusContext,
    cashier: &sui::types::ObjectReference,
    dag: &sui::types::ObjectReference,
    execution: &sui::types::ObjectReference,
    leader_cap: &sui::types::ObjectReference,
    target: InvocationTarget<'_>,
    policy: &InvocationPolicyCall,
    submission_gas_charge: u64,
) -> anyhow::Result<sui::types::ProgrammableTransaction> {
```

#### `abort_expired_ptb`

```rust
pub fn abort_expired_ptb(
    context: &NexusContext,
    dag: &sui::types::ObjectReference,
    execution: &sui::types::ObjectReference,
    vertex: &RuntimeVertex,
    invocation: &sui::types::ObjectReference,
    task_settlement: Option<&sui::types::ObjectReference>,
) -> anyhow::Result<sui::types::ProgrammableTransaction> {
```

#### `over_network_cap_struct_tag`

```rust
pub fn over_network_cap_struct_tag(objects: &NexusContext) -> sui::types::StructTag {
```

#### `configure_registry_ptb`

```rust
pub fn configure_registry_ptb(
    objects: &NexusContext,
    admin_cap: &sui::types::ObjectReference,
    admin_owner: &sui::types::Owner,
    unbonding_duration_ms: u64,
    min_stake_us: u64,
    max_transaction_budget_mist: u64,
) -> anyhow::Result<ProgrammableTransaction> {
```

#### `register_for_self_ptb`

```rust
pub fn register_for_self_ptb(
    objects: &NexusContext,
    stake_coin: &sui::types::ObjectReference,
    stake_us: u64,
) -> anyhow::Result<ProgrammableTransaction> {
```

#### `activate_and_claim_for_self_ptb`

```rust
pub fn activate_and_claim_for_self_ptb(
    objects: &NexusContext,
    leader_cap_over_network: &sui::types::ObjectReference,
) -> anyhow::Result<ProgrammableTransaction> {
```

#### `suspend_if_token_for_self_ptb`

```rust
pub fn suspend_if_token_for_self_ptb(
    objects: &NexusContext,
    leader_cap_over_network: &sui::types::ObjectReference,
    token: Vec<u8>,
) -> anyhow::Result<ProgrammableTransaction> {
```

#### `collect_priority_fee_deposits`

```rust
pub fn collect_priority_fee_deposits(
    context: &NexusContext,
    deposits: &[sui::types::ObjectReference],
) -> anyhow::Result<sui::types::ProgrammableTransaction> {
```

#### `configure_priority_fee_vault`

```rust
pub fn configure_priority_fee_vault(
    context: &NexusContext,
    owner_cap: &sui::types::ObjectReference,
    exchange_rate_million_mists_us: u64,
) -> anyhow::Result<sui::types::ProgrammableTransaction> {
```

#### `swap_us_for_sui`

```rust
pub fn swap_us_for_sui(
    context: &NexusContext,
    us_coin: &sui::types::ObjectReference,
    min_sui_out: u64,
    recipient: sui::types::Address,
) -> anyhow::Result<sui::types::ProgrammableTransaction> {
```

#### `withdraw_priority_fee`

```rust
pub fn withdraw_priority_fee(
    context: &NexusContext,
    leader_cap: &sui::types::ObjectReference,
    leader_cap_owner: &sui::types::Owner,
    share_to_withdraw: u64,
    recipient: sui::types::Address,
) -> anyhow::Result<sui::types::ProgrammableTransaction> {
```

#### `create_leader_binding_and_register_key_ptb`

```rust
pub fn create_leader_binding_and_register_key_ptb(
    objects: &NexusContext,
    leader_cap_over_network: &sui::types::ObjectReference,
    public_key: [u8; 32],
```

#### `register_leader_key_on_existing_binding_ptb`

```rust
pub fn register_leader_key_on_existing_binding_ptb(
    objects: &NexusContext,
    binding: &sui::types::ObjectReference,
    leader_cap_over_network: &sui::types::ObjectReference,
    public_key: [u8; 32],
```

#### `expire_occurrence_with_gas_charge_ptb`

```rust
pub fn expire_occurrence_with_gas_charge_ptb(
    objects: &NexusContext,
    task: &sui::types::ObjectReference,
    leader_cap: &sui::types::ObjectReference,
    occurrence_id: u64,
    gas_charge: u64,
) -> Result<ProgrammableTransaction, SchedulerError> {
```

#### `reject_occurrence_with_gas_charge_ptb`

```rust
pub fn reject_occurrence_with_gas_charge_ptb(
    objects: &NexusContext,
    task: &sui::types::ObjectReference,
    dag: &sui::types::ObjectReference,
    leader_cap: &sui::types::ObjectReference,
    occurrence_id: u64,
    gas_charge: u64,
) -> Result<ProgrammableTransaction, SchedulerError> {
```

#### `dispatch_occurrence_ptb`

```rust
pub fn dispatch_occurrence_ptb(
    objects: &NexusContext,
    task: &sui::types::ObjectReference,
    dag: &sui::types::ObjectReference,
    leader_cap: &sui::types::ObjectReference,
    occurrence_id: u64,
    gas_charge: u64,
) -> Result<ProgrammableTransaction, SchedulerError> {
```

#### `settle_occurrence_ptb`

```rust
pub fn settle_occurrence_ptb(
    objects: &NexusContext,
    task: &sui::types::ObjectReference,
    execution: &sui::types::ObjectReference,
) -> Result<ProgrammableTransaction, SchedulerError> {
```

#### `re-export pub, use, command, dispatch_occurrence_ptb, expire_occurrence_with_gas_charge_ptb, reject_occurrence_with_gas_charge_ptb, settle_occurrence_ptb`

```rust
pub use command::{
    dispatch_occurrence_ptb,
    expire_occurrence_with_gas_charge_ptb,
    reject_occurrence_with_gas_charge_ptb,
    settle_occurrence_ptb,
};
```

#### `publish_package_ptb`

```rust
pub fn publish_package_ptb(
    package: MovePackageArtifact,
    recipient: sui::types::Address,
) -> anyhow::Result<ProgrammableTransaction> {
```

#### `ExternalVerifierObjectInput`

```rust
pub struct ExternalVerifierObjectInput {
    /// Current shared object reference.
    pub object_ref: sui::types::ObjectReference,
    /// Exact concrete Move type required by the verifier ABI.
    pub object_type: sui::types::TypeTag,
}
```

#### `ExternalVerifierRegistrationInput`

```rust
pub struct ExternalVerifierRegistrationInput {
    /// Package that publishes the verifier function.
    pub package_id: sui::types::Address,
    /// Module containing the verifier function.
    pub module_name: String,
    /// Public verifier function name.
    pub function_name: String,
    /// Ordered immutable shared objects; object zero is the verifier witness.
    pub verifier_objects: Vec<ExternalVerifierObjectInput>,
}
```

#### `OffChainToolRegistration`

```rust
pub struct OffChainToolRegistration {
    /// Metadata written to the tool registry.
    pub meta: ToolMeta,
    /// Initial Ed25519 public key bytes.
    pub public_key: [u8; 32],
    /// Proof that the initial key belongs to the tool identity.
    pub pop_signature: [u8; 64],
    /// Cost charged for one invocation in MIST.
    pub invocation_cost_mist: u64,
}
```

#### `register_off_chain_for_self_ptb`

```rust
pub fn register_off_chain_for_self_ptb(
    objects: &NexusContext,
    meta: &ToolMeta,
    address: sui::types::Address,
    collateral_coin: &sui::types::ObjectReference,
    invocation_cost_mist: u64,
) -> anyhow::Result<ProgrammableTransaction> {
```

#### `register_off_chain_for_self_with_address_balance_ptb`

```rust
pub fn register_off_chain_for_self_with_address_balance_ptb(
    objects: &NexusContext,
    meta: &ToolMeta,
    address: sui::types::Address,
    collateral_us: u64,
    invocation_cost_mist: u64,
) -> anyhow::Result<ProgrammableTransaction> {
```

#### `register_off_chain_batch_for_self_with_address_balance_ptb`

```rust
pub fn register_off_chain_batch_for_self_with_address_balance_ptb(
    objects: &NexusContext,
    registrations: &[OffChainToolRegistration],
    owner: sui::types::Address,
    collateral_per_tool_us: u64,
) -> anyhow::Result<ProgrammableTransaction> {
```

#### `register_on_chain_for_self_ptb`

```rust
pub fn register_on_chain_for_self_ptb(
    objects: &NexusContext,
    package_address: sui::types::Address,
    module_name: &str,
    fqn: &ToolFqn,
    description: &str,
    input_schema: &str,
    output_schema: &str,
    timeout: Duration,
    tool_witness_id: sui::types::Address,
    invocation_cost_mist: u64,
    collateral_coin: &sui::types::ObjectReference,
    address: sui::types::Address,
    mode: OnchainToolMode,
) -> anyhow::Result<ProgrammableTransaction> {
```

#### `register_on_chain_for_self_with_address_balance_ptb`

```rust
pub fn register_on_chain_for_self_with_address_balance_ptb(
    objects: &NexusContext,
    package_address: sui::types::Address,
    module_name: &str,
    fqn: &ToolFqn,
    description: &str,
    input_schema: &str,
    output_schema: &str,
    timeout: Duration,
    tool_witness_id: sui::types::Address,
    invocation_cost_mist: u64,
    collateral_us: u64,
    address: sui::types::Address,
    mode: OnchainToolMode,
) -> anyhow::Result<ProgrammableTransaction> {
```

#### `set_invocation_cost_ptb`

```rust
pub fn set_invocation_cost_ptb(
    context: &NexusContext,
    tool: &sui::types::ObjectReference,
    cashier_admin: &sui::types::ObjectReference,
    invocation_cost_mist: u64,
) -> anyhow::Result<ProgrammableTransaction> {
```

#### `set_verified_ptb`

```rust
pub fn set_verified_ptb(
    context: &NexusContext,
    tool: &sui::types::ObjectReference,
    admin: &sui::types::ObjectReference,
    verified: bool,
) -> anyhow::Result<ProgrammableTransaction> {
```

#### `unregister_ptb`

```rust
pub fn unregister_ptb(
    context: &NexusContext,
    tool: &sui::types::ObjectReference,
    owner_cap: &sui::types::ObjectReference,
) -> anyhow::Result<ProgrammableTransaction> {
```

#### `migrate_on_chain_tool_package_ptb`

```rust
pub fn migrate_on_chain_tool_package_ptb(
    context: &NexusContext,
    tool: &sui::types::ObjectReference,
    owner_cap: &sui::types::ObjectReference,
    target_package: sui::types::Address,
) -> anyhow::Result<ProgrammableTransaction> {
```

#### `configure_registered_key_verifier_ptb`

```rust
pub fn configure_registered_key_verifier_ptb(
    context: &NexusContext,
    tool: &sui::types::ObjectReference,
    owner_cap: &sui::types::ObjectReference,
    tool_key_binding: &sui::types::ObjectReference,
) -> anyhow::Result<ProgrammableTransaction> {
```

#### `register_external_verifier_ptb`

```rust
pub fn register_external_verifier_ptb(
    context: &NexusContext,
    tool: &sui::types::ObjectReference,
    owner_cap: &sui::types::ObjectReference,
    input: &ExternalVerifierRegistrationInput,
) -> anyhow::Result<ProgrammableTransaction> {
```

#### `claim_collateral_for_self_ptb`

```rust
pub fn claim_collateral_for_self_ptb(
    objects: &NexusContext,
    tool: &sui::types::ObjectReference,
    owner_cap: &sui::types::ObjectReference,
) -> anyhow::Result<ProgrammableTransaction> {
```

#### `update_tool_timeout_ptb`

```rust
pub fn update_tool_timeout_ptb(
    context: &NexusContext,
    tool: &sui::types::ObjectReference,
    owner_cap: &sui::types::ObjectReference,
    timeout: Duration,
) -> anyhow::Result<ProgrammableTransaction> {
```

#### `update_off_chain_tool_url_ptb`

```rust
pub fn update_off_chain_tool_url_ptb(
    context: &NexusContext,
    tool: &sui::types::ObjectReference,
    owner_cap: &sui::types::ObjectReference,
    new_url: &str,
) -> anyhow::Result<ProgrammableTransaction> {
```

#### `update_tool_metadata_ptb`

```rust
pub fn update_tool_metadata_ptb(
    context: &NexusContext,
    tool: &sui::types::ObjectReference,
    owner_cap: &sui::types::ObjectReference,
    description: &str,
) -> anyhow::Result<ProgrammableTransaction> {
```

#### `enable_finite_credits_ptb`

```rust
pub fn enable_finite_credits_ptb(
    objects: &NexusContext,
    tool_cashier: &sui::types::ObjectReference,
    cashier_admin: &sui::types::ObjectReference,
    price_per_credit: u64,
    minimum_credits: u64,
    maximum_credits: u64,
) -> anyhow::Result<sui::types::ProgrammableTransaction> {
```

#### `close_finite_credit_issuance_ptb`

```rust
pub fn close_finite_credit_issuance_ptb(
    objects: &NexusContext,
    tool_cashier: &sui::types::ObjectReference,
    cashier_admin: &sui::types::ObjectReference,
) -> anyhow::Result<sui::types::ProgrammableTransaction> {
```

#### `open_finite_credit_issuance_ptb`

```rust
pub fn open_finite_credit_issuance_ptb(
    objects: &NexusContext,
    tool_cashier: &sui::types::ObjectReference,
    cashier_admin: &sui::types::ObjectReference,
) -> anyhow::Result<sui::types::ProgrammableTransaction> {
```

#### `update_finite_credit_terms_ptb`

```rust
pub fn update_finite_credit_terms_ptb(
    objects: &NexusContext,
    tool_cashier: &sui::types::ObjectReference,
    cashier_admin: &sui::types::ObjectReference,
    price_per_credit: u64,
    minimum_credits: u64,
    maximum_credits: u64,
) -> anyhow::Result<sui::types::ProgrammableTransaction> {
```

#### `buy_finite_credits_ptb`

```rust
pub fn buy_finite_credits_ptb(
    objects: &NexusContext,
    tool_cashier: &sui::types::ObjectReference,
    pay_with: &sui::types::ObjectReference,
    beneficiary: PaymentSourceKind,
    credits: u64,
) -> anyhow::Result<sui::types::ProgrammableTransaction> {
```

#### `buy_more_finite_credits_ptb`

```rust
pub fn buy_more_finite_credits_ptb(
    objects: &NexusContext,
    tool_cashier: &sui::types::ObjectReference,
    credits: &sui::types::ObjectReference,
    pay_with: &sui::types::ObjectReference,
    additional_credits: u64,
) -> anyhow::Result<sui::types::ProgrammableTransaction> {
```

#### `buy_finite_credits_from_balance_ptb`

```rust
pub fn buy_finite_credits_from_balance_ptb(
    objects: &NexusContext,
    tool_cashier: &sui::types::ObjectReference,
    account: Option<&sui::types::ObjectReference>,
    beneficiary: PaymentSourceKind,
    credits: u64,
    price: u64,
) -> anyhow::Result<sui::types::ProgrammableTransaction> {
```

#### `issue_finite_credits_ptb`

```rust
pub fn issue_finite_credits_ptb(
    objects: &NexusContext,
    tool_cashier: &sui::types::ObjectReference,
    cashier_admin: &sui::types::ObjectReference,
    beneficiary: PaymentSourceKind,
    credits: u64,
) -> anyhow::Result<sui::types::ProgrammableTransaction> {
```

#### `issue_more_finite_credits_ptb`

```rust
pub fn issue_more_finite_credits_ptb(
    objects: &NexusContext,
    tool_cashier: &sui::types::ObjectReference,
    credits: &sui::types::ObjectReference,
    cashier_admin: &sui::types::ObjectReference,
    additional_credits: u64,
) -> anyhow::Result<sui::types::ProgrammableTransaction> {
```

#### `enable_time_pass_ptb`

```rust
pub fn enable_time_pass_ptb(
    objects: &NexusContext,
    tool_cashier: &sui::types::ObjectReference,
    cashier_admin: &sui::types::ObjectReference,
    price_per_ms: u64,
    minimum_duration_ms: u64,
    maximum_duration_ms: u64,
) -> anyhow::Result<sui::types::ProgrammableTransaction> {
```

#### `close_time_pass_issuance_ptb`

```rust
pub fn close_time_pass_issuance_ptb(
    objects: &NexusContext,
    tool_cashier: &sui::types::ObjectReference,
    cashier_admin: &sui::types::ObjectReference,
) -> anyhow::Result<sui::types::ProgrammableTransaction> {
```

#### `open_time_pass_issuance_ptb`

```rust
pub fn open_time_pass_issuance_ptb(
    objects: &NexusContext,
    tool_cashier: &sui::types::ObjectReference,
    cashier_admin: &sui::types::ObjectReference,
) -> anyhow::Result<sui::types::ProgrammableTransaction> {
```

#### `update_time_pass_terms_ptb`

```rust
pub fn update_time_pass_terms_ptb(
    objects: &NexusContext,
    tool_cashier: &sui::types::ObjectReference,
    cashier_admin: &sui::types::ObjectReference,
    price_per_ms: u64,
    minimum_duration_ms: u64,
    maximum_duration_ms: u64,
) -> anyhow::Result<sui::types::ProgrammableTransaction> {
```

#### `buy_time_pass_ptb`

```rust
pub fn buy_time_pass_ptb(
    objects: &NexusContext,
    tool_cashier: &sui::types::ObjectReference,
    pay_with: &sui::types::ObjectReference,
    beneficiary: PaymentSourceKind,
    duration_ms: u64,
) -> anyhow::Result<sui::types::ProgrammableTransaction> {
```

#### `buy_more_time_pass_ptb`

```rust
pub fn buy_more_time_pass_ptb(
    objects: &NexusContext,
    tool_cashier: &sui::types::ObjectReference,
    pass: &sui::types::ObjectReference,
    pay_with: &sui::types::ObjectReference,
    duration_ms: u64,
) -> anyhow::Result<sui::types::ProgrammableTransaction> {
```

#### `buy_time_pass_from_balance_ptb`

```rust
pub fn buy_time_pass_from_balance_ptb(
    objects: &NexusContext,
    tool_cashier: &sui::types::ObjectReference,
    account: Option<&sui::types::ObjectReference>,
    beneficiary: PaymentSourceKind,
    duration_ms: u64,
    price: u64,
) -> anyhow::Result<sui::types::ProgrammableTransaction> {
```

#### `issue_time_pass_ptb`

```rust
pub fn issue_time_pass_ptb(
    objects: &NexusContext,
    tool_cashier: &sui::types::ObjectReference,
    cashier_admin: &sui::types::ObjectReference,
    beneficiary: PaymentSourceKind,
    valid_from_ms: u64,
    valid_until_ms: u64,
) -> anyhow::Result<sui::types::ProgrammableTransaction> {
```

#### `update_time_pass_window_ptb`

```rust
pub fn update_time_pass_window_ptb(
    objects: &NexusContext,
    tool_cashier: &sui::types::ObjectReference,
    pass: &sui::types::ObjectReference,
    cashier_admin: &sui::types::ObjectReference,
    valid_from_ms: u64,
    valid_until_ms: u64,
) -> anyhow::Result<sui::types::ProgrammableTransaction> {
```

#### `restore_finite_credit_refund_ptb`

```rust
pub fn restore_finite_credit_refund_ptb(
    objects: &NexusContext,
    credits: &sui::types::ObjectReference,
    refunded: &sui::types::ObjectReference,
) -> anyhow::Result<sui::types::ProgrammableTransaction> {
```

#### `collect_invocations_ptb`

```rust
pub fn collect_invocations_ptb(
    objects: &NexusContext,
    tool_cashier: &sui::types::ObjectReference,
    cashier_admin: &sui::types::ObjectReference,
    policy: &TypeName,
    invocations: &[sui::types::ObjectReference],
    recipient: sui::types::Address,
) -> anyhow::Result<sui::types::ProgrammableTransaction> {
```

#### `collect_deposits_ptb`

```rust
pub fn collect_deposits_ptb(
    objects: &NexusContext,
    tool_cashier: &sui::types::ObjectReference,
    cashier_admin: &sui::types::ObjectReference,
    deposits: &[sui::types::ObjectReference],
    recipient: sui::types::Address,
) -> anyhow::Result<sui::types::ProgrammableTransaction> {
```


---

# 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/talus-docs-v2.1.0/reference/sdk/transactions.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.
