Module sui::party
- Struct
Party
- Struct
Permissions
- Constants
- Function
single_owner
- Macro function
transfer
- Macro function
public_transfer
- Function
empty
- Function
set_permissions
- Function
is_single_owner
- Function
into_native
use std::option;
use std::vector;
use sui::vec_map;
Struct Party
The permissions that apply to a party object. If the transaction sender has an entry in the members map, the permissions in that entry apply. Otherwise, the default permissions are used. If the party has the READ permission, the object can be taken as an immutable input. If the party has the WRITE, DELETE, or TRANSFER permissions, the object can be taken as a mutable input. Additional restrictions pertaining to each permission are checked at the end of transaction execution.
public struct Party has copy, drop
Fields
Struct Permissions
The permissions that a party has. The permissions are a bitset of the READ, WRITE, DELETE, and TRANSFER constants.
public struct Permissions has copy, drop
Fields
Constants
A party can read the object, taking it as an immutable argument. This restriction is checked when sending the transaction.
const READ: u8 = 1;
The party can mutate the object, but not change its owner or delete it. This is checked at end end of transaction execution.
const WRITE: u8 = 2;
The party can delete the object, but not otherwise modify it. This is checked at the end of transaction execution.
const DELETE: u8 = 4;
The party can change the owner of the object, but not otherwise modify it. This is checked at the end of transaction execution.
const TRANSFER: u8 = 8;
No permissions.
const NO_PERMISSIONS: u64 = 0;
All permissions.
const ALL_PERMISSIONS: u64 = 15;
Function single_owner
Creates a Party value with a single "owner" that has all permissions. No other party has any permissions. And there are no default permissions.
public fun single_owner(owner: address): sui::party::Party
Implementation
Macro function transfer
A helper macro that calls sui::transfer::party_transfer.
public macro fun transfer<$T: key>($self: sui::party::Party, $obj: $T)
Implementation
Macro function public_transfer
A helper macro that calls sui::transfer::public_party_transfer.
public macro fun public_transfer<$T: key, store>($self: sui::party::Party, $obj: $T)
Implementation
Function empty
fun empty(): sui::party::Party
Implementation
Function set_permissions
fun set_permissions(p: &mut sui::party::Party, address: address, permissions: sui::party::Permissions)
Implementation
Function is_single_owner
public(package) fun is_single_owner(p: &sui::party::Party): bool
Implementation
Function into_native
public(package) fun into_native(p: sui::party::Party): (u64, vector<address>, vector<u64>)