Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

💳nexus_interface::payment

Struct AgentVaultPaymentAuthorization

Capability proving an agent vault is authorized to settle a payment for a given agent.

Fields

agent_id: sui::object::ID

Struct ExecutionPayment

Custodied payment for one standard agent execution.

Fields

id: sui::object::UID

Struct ExecutionPaymentInnerV1

Version one stored layout for [ExecutionPayment].

The stable [ExecutionPayment] cannot contain these fields because its published layout must remain unchanged while stored data evolves.

Fields

execution_id: addressagent_id: sui::object::IDskill_id: u64interface_revision: nexus_interface::version::InterfaceVersionpayment_policy: nexus_interface::payment::SkillPaymentPolicysource_kind: nexus_interface::payment::PaymentSourceKindmax_budget_mist: u64gas_budget_mist: u64priority_fee_reserve_mist: u64locked_budget_mist: u64funds: sui::balance::Balance<sui::sui::SUI>consumed: u64tool_fee_charged: u64priority_fee_charged: u64priority_fee_percentage: u64accomplished: boolrefunded: boolfinal_state: nexus_interface::payment::ExecutionPaymentFinalStatetool_cost_snapshot: sui::vec_map::VecMap<vector<u8>, u64>locked_vertices: vector<nexus_interface::payment::ExecutionPaymentVertexLock>

Struct ExecutionPaymentVertexLock

Locked payment line for a runtime vertex.

Fields

vertex_key: vector<u8>invocation_id: sui::object::IDamount: u64

Struct InvocationRequest

Canonical workflow and payment data offered to one economic policy.

Fields

execution_id: addressvertex_key: vector<u8>tool_id: sui::object::IDtool_fqn: vector<u8>cashier_id: sui::object::IDpayment_id: sui::object::IDsource: nexus_interface::payment::PaymentSourceKindprice_snapshot: u64authorized_at_ms: u64

Struct InvocationLockReceipt

Linear authority to place one exact Invocation under its execution.

Fields

vertex_key: vector<u8>invocation_id: sui::object::IDamount: u64

Struct InvocationSettlementReceipt

Linear authority to resolve one exact Invocation once.

Fields

invocation_id: sui::object::IDwas_refunded: bool

Struct TaskPaymentReserve

Durable payment custody stored under a scheduler Task.

Occurrence correlation belongs to the owning Task. The reserve records only the identity and policy needed to create and settle execution payments.

Fields

id: sui::object::UID

Struct TaskPaymentReserveInnerV1

Version one stored layout for [TaskPaymentReserve].

The stable [TaskPaymentReserve] cannot contain these fields because its published layout must remain unchanged while stored data evolves.

Fields

task_id: sui::object::IDagent_id: sui::object::IDskill_id: u64interface_version: nexus_interface::version::InterfaceVersionauthorization_id: sui::object::IDsource: nexus_interface::payment::PaymentSourceKindrefund_recipient: std::option::Option<address>Address that receives unused funds from an address-funded Task payment reserve. Agent-vault-funded reserves retain no address refund recipient.occurrence_budget_mist: u64remaining_funds: sui::balance::Balance<sui::sui::SUI>payment_policy: nexus_interface::payment::SkillPaymentPolicy

Struct AgentSkillPaymentCreatedEvent

Emitted when a new execution payment is created and its budget is locked.

Fields

payment_id: addressexecution_id: addressagent_id: sui::object::IDskill_id: u64interface_revision: nexus_interface::version::InterfaceVersionpayment_policy: nexus_interface::payment::SkillPaymentPolicysource_kind: nexus_interface::payment::PaymentSourceKindmax_budget_mist: u64gas_budget_mist: u64priority_fee_reserve_mist: u64locked_budget_mist: u64priority_fee_percentage: u64

Struct TaskPaymentReserveRefilledEvent

Emitted when a [TaskPaymentReserve] receives more funds.

Fields

task_id: sui::object::IDreserve_id: addressagent_id: sui::object::IDskill_id: u64interface_version: nexus_interface::version::InterfaceVersionsource_kind: nexus_interface::payment::PaymentSourceKindrefill_amount: u64occurrence_budget_mist: u64remaining_funds: u64

Struct TaskExecutionPaymentCreatedEvent

Emitted when a reserve creates the payment for one Task occurrence.

Fields

task_id: sui::object::IDreserve_id: addressoccurrence_id: u64execution_id: addresspayment_id: addressagent_id: sui::object::IDskill_id: u64interface_version: nexus_interface::version::InterfaceVersionsource_kind: nexus_interface::payment::PaymentSourceKindbudget: u64remaining_funds: u64

Struct TaskPaymentReserveCanceledEvent

Emitted when a [TaskPaymentReserve] returns all remaining funds.

Fields

task_id: sui::object::IDreserve_id: addressagent_id: sui::object::IDskill_id: u64interface_version: nexus_interface::version::InterfaceVersionsource_kind: nexus_interface::payment::PaymentSourceKindrefunded_amount: u64remaining_funds: u64

Struct TaskExecutionPaymentFinalizedEvent

Emitted when the payment for one Task occurrence reaches a final state.

Fields

task_id: sui::object::IDreserve_id: addressoccurrence_id: u64execution_id: addresspayment_id: addressagent_id: sui::object::IDskill_id: u64interface_version: nexus_interface::version::InterfaceVersionfinal_state: nexus_interface::payment::ExecutionPaymentFinalStateremaining_funds: u64

Struct GasPaymentConsumedEvent

Emitted when gas is consumed from an execution payment.

Fields

payment_id: addressexecution_id: addressagent_id: sui::object::IDskill_id: u64interface_revision: nexus_interface::version::InterfaceVersionamount: u64consumed_total: u64

Struct ExecutionPaymentFeesRecordedEvent

Emitted when payment fee totals are updated after gas, tool, or priority settlement.

Fields

payment_id: addressexecution_id: addressagent_id: sui::object::IDskill_id: u64gas_fee_mist: u64tool_fee_mist: u64priority_fee_mist: u64priority_fee_percentage: u64

Struct ExecutionPaymentToolCostSnapshottedEvent

Emitted when a tool's cost is snapshotted onto an execution payment.

Fields

payment_id: addressexecution_id: addressagent_id: sui::object::IDtool_fqn: vector<u8>cost: u64

Struct ExecutionAccomplishedEvent

Emitted when an execution payment is accomplished.

Fields

execution_id: addresspayment_id: addressagent_id: sui::object::IDskill_id: u64interface_revision: nexus_interface::version::InterfaceVersion

Struct ExecutionRefundedEvent

Emitted when an execution payment is refunded, carrying the refund reason.

Fields

execution_id: addresspayment_id: addressagent_id: sui::object::IDskill_id: u64interface_revision: nexus_interface::version::InterfaceVersionrefund_reason: vector<u8>

Enum PaymentSourceKind

Concrete payment source recorded on execution payments and scheduled reserves.

Variants

Variant UserFundeduser: addressVariant AgentFundedagent_id: sui::object::ID

Enum ExecutionPaymentFinalState

Final lifecycle state for an execution payment.

Variants

Variant PendingVariant AccomplishedVariant Refunded

Enum SkillPaymentPolicy

Payment limits and source mode required by a skill.

Variants

Variant UserFundedVariant AgentFundedmax_budget_mist: u64

Constants

Function new_task_execution_payment

Creates the payment for one Task occurrence.

The occurrence budget is split from the reserve. The owning Task records the relationship between the occurrence and the resulting execution.

Function snapshot_payment_tool_cost

Records the immutable snapshotted cost for a Tool on an ExecutionPayment. Aborts if the payment is already accomplished or refunded, or when that Tool already has a snapshot.

Function consume_payment_for_verified_leader_submission

Consumes gas from an execution payment, reimbursing the transaction sender's address balance.

Function consume_payment_for_verified_leader_submission_to_recipient

Consumes gas from an execution payment, reimbursing the given recipient's address balance; a no-op when the amount is zero. Aborts if the payment is final or if [amount] exceeds available funds.

Function consume_task_payment_reserve_for_sender

Consumes gas from a [TaskPaymentReserve] and reimburses the transaction sender.

Authorization is exactly mutable access to [TaskPaymentReserve]. The caller cannot select another reimbursement address. Does nothing when the amount is zero.

Function refill_execution_payment_from_coin

Adds coin funds to an execution payment, increasing its max budget, and returns the refill amount. Aborts if the coin value is zero, or if the payment is already accomplished or refunded.

Function new_invocation_request

Creates canonical policy input for one workflow [Invocation].

Function lock_invocation

Records one exact Invocation obligation and returns its placement authority.

Function invocation_request_execution_id

Returns the execution recorded by [InvocationRequest].

Function invocation_request_vertex_key

Returns the runtime vertex key recorded by [InvocationRequest].

Function invocation_request_tool_id

Returns the Tool recorded by [InvocationRequest].

Function invocation_request_tool_fqn

Returns the Tool name recorded by [InvocationRequest].

Function invocation_request_cashier_id

Returns the cashier recorded by [InvocationRequest].

Function invocation_request_payment_id

Returns the payment recorded by [InvocationRequest].

Function invocation_request_source

Returns the payment source recorded by [InvocationRequest].

Function invocation_request_price_snapshot

Returns the snapshotted Tool price recorded by [InvocationRequest].

Function invocation_request_authorized_at_ms

Returns the authorization time recorded by [InvocationRequest].

Function into_invocation_request

Consumes [InvocationRequest] and returns its canonical fields.

Function into_invocation_lock_receipt

Consumes [InvocationLockReceipt] and returns the exact placement fields.

Function settle_invocation

Resolves one exact Invocation obligation.

A finalized obligation withdraws the amount recorded by its lock. A refunded obligation only removes the lock and leaves all funds available.

Function into_invocation_settlement_receipt

Consumes [InvocationSettlementReceipt] and returns its exact fields.

Function payment_leader_gas_consumed

Returns the base leader gas consumed by the payment, excluding paid tool fees and priority.

Function priority_charge_for

Returns the cumulative priority charge due for the payment's consumed leader gas.

Function settlement_priority_delta_for_leader_gas

Returns the priority delta due after adding a settlement's valid payable leader gas.

Function settlement_charge_required

Returns the base leader gas plus priority delta required for a committed-result settlement.

Function payment_available_settlement_funds

Returns spendable payment funds for settlement after preserving locked tool payments.

Function payment_available_settlement_charge

Returns the amount currently available for a settlement requiring the given leader gas.

Function settlement_charge_missing

Returns the missing amount for a committed-result settlement, or zero when payable.

Function consume_priority_fee_for_settlement

Records and splits a committed-result settlement's priority delta.

Function invocation_locked

Returns whether [payment] contains an obligation for [vertex_key].

Function locked_invocation_id

Returns the exact [Invocation] locked for [vertex_key], if one exists.

Function accomplish_invoker_payment

Marks a user-funded payment accomplished and returns any remaining funds to the funding user; a no-op if already accomplished. Aborts if the payment still has locked vertices, if its source is not user-funded, or if it is already refunded.

Function refund_invoker_payment

Marks a user-funded payment refunded and returns all remaining funds to the funding user; a no-op if already refunded. Aborts if the payment still has locked vertices, if its source is not user-funded, or if it is already accomplished.

Function payment_source_kind_user_funded

Constructs a user-funded payment source for the given user address.

Function payment_source_kind_agent_funded

Constructs an agent-funded payment source for the given agent.

Function payment_source_kind_is_user_funded

Returns whether the payment source is user-funded.

Function payment_source_kind_is_agent_funded

Returns whether the payment source is agent-funded.

Function payment_source_kind_user

Returns the funding user address of a user-funded payment source. Aborts if the source is agent-funded.

Function payment_source_kind_agent_id

Returns the agent id of an agent-funded payment source. Aborts if the source is user-funded.

Function payment_final_state_pending

Returns the pending execution payment final state.

Function payment_final_state_accomplished

Returns the accomplished execution payment final state.

Function payment_final_state_refunded

Returns the refunded execution payment final state.

Function payment_policy_user_funded

Returns the user-funded skill payment policy.

Function payment_policy_agent_funded

Returns an agent-funded skill payment policy with the given maximum budget. Aborts if the maximum budget is zero.

Function payment_policy_is_agent_funded

Returns whether the skill payment policy is agent-funded.

Function payment_policy_max_budget_mist

Returns the maximum budget of the payment policy, or zero for a user-funded policy.

Function assert_payment_policy

Asserts that a payment source and budget satisfy the skill payment policy for the given agent. Aborts if a user-funded policy is not user-funded, if an agent-funded budget is zero or exceeds the policy maximum, or if the agent-funded source's agent does not match.

Function payment_agent_id

Returns the agent id owning the execution payment.

Function payment_skill_id

Returns the skill id of the execution payment.

Function payment_interface_revision

Returns the interface revision the execution payment was created under.

Function payment_execution_id

Returns the execution id the payment funds.

Function payment_consumed

Returns the total amount consumed from the execution payment so far.

Function payment_funds

Returns the current balance of funds held by the execution payment.

Function payment_source_kind

Returns the funding source of the execution payment.

Function payment_locked_budget_mist

Returns the MIST budget locked by the execution payment, including refills.

Function payment_final_state

Returns the execution payment's lifecycle final state.

Function payment_max_budget_mist

Returns the execution payment's total gas-plus-priority ceiling in MIST.

Function payment_gas_budget_mist

Returns the maximal transaction gas and Tool invocation budget in MIST.

Function payment_priority_fee_reserve_mist

Returns the priority-fee reserve in MIST derived from the total ceiling.

Function payment_priority_fee_percentage

Returns the priority fee percentage stored on the execution payment.

Function payment_priority_fee_charged

Returns the priority fee charged during terminal settlement.

Function payment_accomplished

Returns whether the execution payment has been accomplished.

Function payment_refunded

Returns whether the execution payment has been refunded.

Function payment_locks

Returns the number of currently locked vertices on the execution payment.

Function payment_available_funds

Returns the base execution funds still available to spend in MIST.

Function can_lock_payment_vertex_with_amount

Returns whether available funds can cover a vertex amount.

Function payment_tool_cost

Returns the snapshotted cost for the given tool on the execution payment. Aborts if no cost snapshot exists for the tool.

Function has_payment_tool_cost_snapshot

Returns whether an ExecutionPayment has frozen the supplied Tool price.

Function task_payment_reserve_task_id

Returns the Task that owns the reserve.

Function task_payment_reserve_agent_id

Returns the agent id of the reserve.

Function task_payment_reserve_skill_id

Returns the skill id of the reserve.

Function task_payment_reserve_interface_version

Returns the interface version of the reserve.

Function task_payment_reserve_authorization_id

Returns the id of the agent-skill authorization bound to the reserve.

Function task_payment_reserve_occurrence_budget_mist

Returns the per-occurrence budget of the reserve.

Function task_payment_reserve_remaining_funds

Returns the remaining funds held by the reserve.

Function task_payment_reserve_source_kind

Returns the funding source of the reserve.

Function task_payment_reserve_payment_policy

Returns the skill payment policy of the reserve.

Function refill_task_payment_reserve_address_funded

Adds user funds to a [TaskPaymentReserve].

Function cancel_task_payment_reserve_address_funded

Returns all user funds held by a [TaskPaymentReserve].

Function accomplish_task_execution_payment

Accomplishes one Task execution and restores its unused funds.

Function refund_task_execution_payment

Refunds one Task execution and restores its unused funds.

Function priority_fee_percentage

Normalizes an optional priority-fee percentage to the effective on-chain value.

Function priority_fee_mist_for_gas_budget

Computes the priority fee in MIST as floor(gas_budget_mist * priority_fee_percentage / 100).

Function budget_split_mist

Computes the maximal base gas budget and its priority reserve for a total MIST ceiling.

Function gas_budget_mist_for_max_budget_mist

Computes the largest base gas budget that fits within a total MIST ceiling.

Function destroy_empty_task_payment_reserve

Destroys a [TaskPaymentReserve] after all funds were returned.

Last updated