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

🪙nexus_tool::finite_credits

Struct Policy

Private construction witness for this policy.

Fields

Struct Config

Owner configured sale terms for finite credits.

Fields

issuance_enabled: boolprice_per_credit: u64minimum_credits: u64maximum_credits: u64

Struct State

Policy state stored in one beneficiary's canonical account.

Fields

Struct CreditReserve

One prepaid unit held by an in flight [Invocation].

[CreditReserve] carries no SUI. Payment occurs when credits are purchased; this marker preserves one unit until finalization or refund.

Fields

Struct CreditsCreatedEvent

Records creation of one canonical finite credit [PolicyAccount].

Fields

tool: sui::object::IDcashier: sui::object::IDcredits: sui::object::IDbeneficiary: nexus_interface::payment::PaymentSourceKindremaining: u64

Struct CreditOfferChangedEvent

Records the complete commercial offer for future credit purchases.

Fields

cashier: sui::object::IDissuance_enabled: boolprice_per_credit: u64minimum_credits: u64maximum_credits: u64

Constants

Function enable

Enables finite credit admission and sales.

Function buy

Purchases credits, shares the canonical policy account, and transfers prepaid SUI to the cashier inbox. The public call returns only the deposit ID.

Function buy_more

Purchases units for an existing canonical credit account.

Function close_issuance

Stops purchases and owner issuance without invalidating existing accounts.

Function open_issuance

Resumes purchases and owner issuance for canonical credit accounts.

Function update_terms

Replaces the sale terms used only for future purchases and grants.

Function offer

Returns the current finite credit offer.

Function issue

Issues credits under Tool owner authority.

Function issue_more

Adds an owner granted amount to an existing canonical credit account.

Function get_invocation

Decrements [State] and creates an [Invocation] holding one prepaid unit.

The held [CreditReserve] is a unit marker, not an execution payment reserve. The Invocation therefore records zero SUI and names [credits] as its exact accounting source.

Function restore_refund

Restores one exact refunded unit to its canonical credit account.

Function collect

Collects finalized credit Invocations and consumes their reserved units.

Function share

Shares a canonical credit [PolicyAccount] for runtime admission.

Function remaining

Returns the units currently available in [self].

Function derive_id

Derives the canonical finite credit account for [beneficiary].

Last updated