> 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_tool/tool_cashier.md).

# nexus\_tool::tool\_cashier

* [Struct `ToolCashier`](#struct-toolcashier)
* [Struct `ToolCashierInnerV1`](#struct-toolcashierinnerv1)
* [Struct `OverToolCashier`](#struct-overtoolcashier)
* [Struct `ToolCashierKey`](#struct-toolcashierkey)
* [Struct `PolicyKey`](#struct-policykey)
* [Struct `PolicyAccountKey`](#struct-policyaccountkey)
* [Struct `PolicyAccount`](#struct-policyaccount)
* [Struct `CashierDeposit`](#struct-cashierdeposit)
* [Struct `CashierDepositCreatedEvent`](#struct-cashierdepositcreatedevent)
* [Struct `PolicyAddedEvent`](#struct-policyaddedevent)
* [Struct `PolicyRemovedEvent`](#struct-policyremovedevent)
* [Constants](#constants)
* [Function `add_policy`](#function-add_policy)
* [Function `add_policy_with_config`](#function-add_policy_with_config)
* [Function `remove_policy`](#function-remove_policy)
* [Function `remove_policy_with_config`](#function-remove_policy_with_config)
* [Function `policy_config`](#function-policy_config)
* [Function `policy_config_mut`](#function-policy_config_mut)
* [Function `has_policy`](#function-has_policy)
* [Function `policies`](#function-policies)
* [Function `derive_policy_account_id`](#function-derive_policy_account_id)
* [Function `new_policy_account`](#function-new_policy_account)
* [Function `share_policy_account`](#function-share_policy_account)
* [Function `policy_account_id`](#function-policy_account_id)
* [Function `policy_account_cashier`](#function-policy_account_cashier)
* [Function `policy_account_beneficiary`](#function-policy_account_beneficiary)
* [Function `policy_account_state`](#function-policy_account_state)
* [Function `policy_account_state_mut`](#function-policy_account_state_mut)
* [Function `policy_account_uid_mut`](#function-policy_account_uid_mut)
* [Function `send_deposit`](#function-send_deposit)
* [Function `collect_deposits`](#function-collect_deposits)
* [Function `tool_fqn`](#function-tool_fqn)
* [Function `tool`](#function-tool)
* [Function `id`](#function-id)
* [Function `derive_id`](#function-derive_id)
* [Function `assert_owner`](#function-assert_owner)

### Struct `ToolCashier`

Shared policy directory and completed invocation inbox for one Tool.

```move
public struct ToolCashier has key
```

<details>

<summary>Fields</summary>

[`id`](#nexus_tool_tool_cashier_id)`: sui::object::UID`

</details>

#### Struct `ToolCashierInnerV1`

Version one stored layout for \[[`ToolCashier`](#nexus_tool_tool_cashier_ToolCashier)].

```move
public struct ToolCashierInnerV1 has store
```

<details>

<summary>Fields</summary>

[`tool`](#nexus_tool_tool_cashier_tool)`: sui::object::ID`[`tool_fqn`](#nexus_tool_tool_cashier_tool_fqn)`: std::ascii::String`[`policies`](#nexus_tool_tool_cashier_policies)`: sui::vec_set::VecSet<std::type_name::TypeName>`

</details>

#### Struct `OverToolCashier`

Authorization marker for delegated \[ToolCashier] administration.

```move
public struct OverToolCashier has drop
```

<details>

<summary>Fields</summary>

</details>

#### Struct `ToolCashierKey`

Typed key for the \[ToolCashier] derived from a Tool.

```move
public struct ToolCashierKey has copy, drop, store
```

<details>

<summary>Fields</summary>

</details>

#### Struct `PolicyKey`

Typed configuration key for policy witness \[P].

```move
public struct PolicyKey<phantom P: drop> has copy, drop, store
```

<details>

<summary>Fields</summary>

</details>

#### Struct `PolicyAccountKey`

Canonical account slot for policy \[P] and one payment beneficiary.

```move
public struct PolicyAccountKey<phantom P: drop> has copy, drop, store
```

<details>

<summary>Fields</summary>

`0:` [`nexus_interface::payment::PaymentSourceKind`](/reference/move/nexus_interface/payment.md#nexus_interface_payment_PaymentSourceKind)

</details>

#### Struct `PolicyAccount`

Canonical beneficiary account containing state defined by policy \[P].

```move
public struct PolicyAccount<phantom P: drop, State: store> has key
```

<details>

<summary>Fields</summary>

[`id`](#nexus_tool_tool_cashier_id)`: sui::object::UIDcashier: sui::object::IDbeneficiary:` [`nexus_interface::payment::PaymentSourceKind`](/reference/move/nexus_interface/payment.md#nexus_interface_payment_PaymentSourceKind)`state: State`

</details>

#### Struct `CashierDeposit`

SUI transferred to a cashier for later owner collection.

```move
public struct CashierDeposit has key
```

<details>

<summary>Fields</summary>

[`id`](#nexus_tool_tool_cashier_id)`: sui::object::UIDfunds: sui::balance::Balance<sui::sui::SUI>`

</details>

#### Struct `CashierDepositCreatedEvent`

Identifies one deposit transferred to a \[ToolCashier].

```move
public struct CashierDepositCreatedEvent has copy, drop
```

<details>

<summary>Fields</summary>

`cashier: sui::object::IDdeposit: sui::object::IDamount: u64`

</details>

#### Struct `PolicyAddedEvent`

Records that a \[ToolCashier] accepts a policy for new \[Invocation] objects.

```move
public struct PolicyAddedEvent has copy, drop
```

<details>

<summary>Fields</summary>

`cashier: sui::object::IDpolicy: std::type_name::TypeName`

</details>

#### Struct `PolicyRemovedEvent`

Records that a \[ToolCashier] no longer accepts a policy.

```move
public struct PolicyRemovedEvent has copy, drop
```

<details>

<summary>Fields</summary>

`cashier: sui::object::IDpolicy: std::type_name::TypeName`

</details>

#### Constants

```move
#[error]
const EEmptyDeposit: vector<u8> = b"Cashier deposit must contain SUI";
```

```move
#[error]
const EInvalidToolCashier: vector<u8> = b"Capability does not match this Tool cashier";
```

```move
#[error]
const EPolicyAlreadyAccepted: vector<u8> = b"Invocation policy is already accepted";
```

```move
#[error]
const EPolicyNotAccepted: vector<u8> = b"Invocation policy is not accepted";
```

#### Function `add_policy`

Accepts configless policy witness \[P].

```move
public fun add_policy<P: drop>(self: &mut nexus_tool::tool_cashier::ToolCashier, owner_cap: &nexus_primitives::owner_cap::CloneableOwnerCap<nexus_tool::tool_cashier::OverToolCashier>, _: P)
```

#### Function `add_policy_with_config`

Accepts policy witness \[P] and stores its typed configuration.

```move
public fun add_policy_with_config<P: drop, C: store>(self: &mut nexus_tool::tool_cashier::ToolCashier, owner_cap: &nexus_primitives::owner_cap::CloneableOwnerCap<nexus_tool::tool_cashier::OverToolCashier>, policy: P, config: C)
```

#### Function `remove_policy`

Stops accepting configless policy witness \[P].

Existing Invocations remain valid because their material terms are stored in the exact \[Invocation] objects.

```move
public fun remove_policy<P: drop>(self: &mut nexus_tool::tool_cashier::ToolCashier, owner_cap: &nexus_primitives::owner_cap::CloneableOwnerCap<nexus_tool::tool_cashier::OverToolCashier>, _: P)
```

#### Function `remove_policy_with_config`

Stops accepting policy witness \[P] and returns its typed configuration.

```move
public fun remove_policy_with_config<P: drop, C: store>(self: &mut nexus_tool::tool_cashier::ToolCashier, owner_cap: &nexus_primitives::owner_cap::CloneableOwnerCap<nexus_tool::tool_cashier::OverToolCashier>, policy: P): C
```

#### Function `policy_config`

Returns the configuration for accepted policy witness \[P].

```move
public fun policy_config<P: drop, C: store>(self: &nexus_tool::tool_cashier::ToolCashier, _: P): &C
```

#### Function `policy_config_mut`

Returns mutable owner access to the configuration for policy witness \[P].

```move
public fun policy_config_mut<P: drop, C: store>(self: &mut nexus_tool::tool_cashier::ToolCashier, owner_cap: &nexus_primitives::owner_cap::CloneableOwnerCap<nexus_tool::tool_cashier::OverToolCashier>, _: P): &mut C
```

#### Function `has_policy`

Returns whether policy witness \[P] is accepted for new invocations.

```move
public fun has_policy<P: drop>(self: &nexus_tool::tool_cashier::ToolCashier): bool
```

#### Function `policies`

Returns the accepted policy types for off chain discovery.

```move
public fun policies(self: &nexus_tool::tool_cashier::ToolCashier): &sui::vec_set::VecSet<std::type_name::TypeName>
```

#### Function `derive_policy_account_id`

Derives the canonical policy account for \[beneficiary].

```move
public fun derive_policy_account_id<P: drop>(cashier: sui::object::ID, beneficiary: nexus_interface::payment::PaymentSourceKind): sui::object::ID
```

#### Function `new_policy_account`

Creates the canonical policy account for \[beneficiary].

Creation mutates \[ToolCashier] only when the account is first claimed.

```move
public fun new_policy_account<P: drop, State: store>(self: &mut nexus_tool::tool_cashier::ToolCashier, beneficiary: nexus_interface::payment::PaymentSourceKind, _: P, state: State): nexus_tool::tool_cashier::PolicyAccount<P, State>
```

#### Function `share_policy_account`

Shares a canonical policy account.

```move
public fun share_policy_account<P: drop, State: store>(account: nexus_tool::tool_cashier::PolicyAccount<P, State>)
```

#### Function `policy_account_id`

Returns the canonical policy account ID.

```move
public fun policy_account_id<P: drop, State: store>(account: &nexus_tool::tool_cashier::PolicyAccount<P, State>): sui::object::ID
```

#### Function `policy_account_cashier`

Returns the cashier that created \[account].

```move
public fun policy_account_cashier<P: drop, State: store>(account: &nexus_tool::tool_cashier::PolicyAccount<P, State>): sui::object::ID
```

#### Function `policy_account_beneficiary`

Returns the beneficiary authorized by \[account].

```move
public fun policy_account_beneficiary<P: drop, State: store>(account: &nexus_tool::tool_cashier::PolicyAccount<P, State>): nexus_interface::payment::PaymentSourceKind
```

#### Function `policy_account_state`

Returns policy module access to the state in \[account].

```move
public fun policy_account_state<P: drop, State: store>(account: &nexus_tool::tool_cashier::PolicyAccount<P, State>, _: P): &State
```

#### Function `policy_account_state_mut`

Returns mutable policy module access to the state in \[account].

```move
public fun policy_account_state_mut<P: drop, State: store>(account: &mut nexus_tool::tool_cashier::PolicyAccount<P, State>, _: P): &mut State
```

#### Function `policy_account_uid_mut`

Returns policy module access to the receiving identity of \[account].

```move
public fun policy_account_uid_mut<P: drop, State: store>(account: &mut nexus_tool::tool_cashier::PolicyAccount<P, State>, _: P): &mut sui::object::UID
```

#### Function `send_deposit`

Transfers SUI to the \[ToolCashier] inbox.

```move
public fun send_deposit(self: &nexus_tool::tool_cashier::ToolCashier, funds: sui::balance::Balance<sui::sui::SUI>, ctx: &mut sui::tx_context::TxContext): sui::object::ID
```

#### Function `collect_deposits`

Receives a batch of deposits under Tool owner authority.

```move
public fun collect_deposits(self: &mut nexus_tool::tool_cashier::ToolCashier, owner_cap: &nexus_primitives::owner_cap::CloneableOwnerCap<nexus_tool::tool_cashier::OverToolCashier>, deposits: vector<sui::transfer::Receiving<nexus_tool::tool_cashier::CashierDeposit>>): sui::balance::Balance<sui::sui::SUI>
```

#### Function `tool_fqn`

Returns the fully qualified name of the Tool served by \[ToolCashier].

```move
public fun tool_fqn(self: &nexus_tool::tool_cashier::ToolCashier): std::ascii::String
```

#### Function `tool`

Returns the stable Tool object ID served by \[ToolCashier].

```move
public fun tool(self: &nexus_tool::tool_cashier::ToolCashier): sui::object::ID
```

#### Function `id`

Returns the object ID of \[ToolCashier].

```move
public fun id(self: &nexus_tool::tool_cashier::ToolCashier): sui::object::ID
```

#### Function `derive_id`

Derives the stable \[ToolCashier] ID for a Tool ID.

```move
public fun derive_id(tool: sui::object::ID): sui::object::ID
```

#### Function `assert_owner`

Verifies exact Tool owner authority for policy module operations.

```move
public fun assert_owner(self: &nexus_tool::tool_cashier::ToolCashier, owner_cap: &nexus_primitives::owner_cap::CloneableOwnerCap<nexus_tool::tool_cashier::OverToolCashier>)
```


---

# 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_tool/tool_cashier.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.
