Skip to main content
All functions below are in the pacta::pacta module. If you are calling them directly via PTB (not through the SDK), use the full target: PACKAGE_ID::pacta::FUNCTION_NAME.

Agreement Creation

create_and_share

Creates a new agreement and shares it as a Sui shared object. This is the standard way to create agreements.

Party Management

set_party_b

Update party B’s address. Creator only. Cannot be called after party B deposits.

Deposits

deposit_coin<T>

Deposit a coin into the agreement. Resolves the party (A or B) from the sender address automatically.

deposit_object<V: key + store>

Deposit a Move object into the agreement.

Approval and Settlement

approve

Record the caller’s approval to release funds. Both parties must approve (if conditions require it).

settle_with_receipt

Trigger settlement. Returns a SettlementReceipt hot potato that must be consumed in the same PTB by calling consume_settlement_receipt. Any address can call this once conditions are met.

consume_settlement_receipt

Consume the settlement receipt. Must be called in the same PTB as settle_with_receipt.

Cancellation

cancel

Cancel the agreement. Creator can cancel in Created state. Either party can cancel in Active state if only one has deposited.

mutual_cancel

Signal consent to a mutual cancel. Both parties must call this. Agreement cancels when both consent.

cancel_expired

Cancel an expired agreement. Anyone can call this after expiry_ms has passed.

Dispute

raise_dispute

Raise a dispute on an active agreement. Either party can call this.

resolve_dispute

Resolve a dispute. Arbiter only. resolution: 0 = favour party A, 1 = favour party B.

resolve_dispute_split_coin<T>

Resolve dispute by splitting a coin balance between both parties at a specified basis points ratio. Arbiter only.

arbiter_settle

Settle an agreement directly as arbiter, bypassing normal conditions. Only callable by the arbiter when agreement is Active.

arbiter_cancel

Cancel an agreement as arbiter. Only callable when agreement is Active.

Claiming

claim_coin<T>

Claim an allocated coin from a finalized agreement.

claim_object<V: key + store>

Claim an allocated object from a finalized agreement.

Admin

transfer_admin_cap

Transfer the AdminCap to a new address. Used to hand governance to a multisig wallet.

record_outcome

Record a settlement outcome in the global PactaRegistry. Optional — do not call this in user-facing settlement flow. Call it in a background transaction after funds are already claimed.