diff --git a/crates/af-iperps/src/errors.rs b/crates/af-iperps/src/errors.rs index c2b61529..7c3a8861 100644 --- a/crates/af-iperps/src/errors.rs +++ b/crates/af-iperps/src/errors.rs @@ -210,6 +210,12 @@ module perpetuals::errors { /// When trying to change a map configuration, but the map has /// length less than 4 const MapTooSmall: u64 = 3007; + + // Account --------------------------------------------------------------- + + /// When trying to create another `AccountCap` for an `Account` that already + /// has `constants::MAX_ASSISTANTS_PER_ACCOUNT` active assistants. + const TooManyAssistantsPerAccount: u64 = 4000; } } diff --git a/crates/af-iperps/src/event_instance.rs b/crates/af-iperps/src/event_instance.rs index ff1d1a80..e9e5873c 100644 --- a/crates/af-iperps/src/event_instance.rs +++ b/crates/af-iperps/src/event_instance.rs @@ -63,6 +63,7 @@ event_instance!(EventInstance { ClosedMarket, ClosedPositionAtSettlementPrices, CreatedAccount, + CreatedAssistantAccountCap, CreatedClearingHouse, CreatedIntegratorVault, CreatedMarginRatiosProposal, @@ -95,6 +96,7 @@ event_instance!(EventInstance { RemovedRegisteredMarketInfo, ResettedPositionFees, ResumedMarket, + RevokedAssistantAccountCap, SetPositionInitialMarginRatio, SettledFunding, SocializedBadDebt, diff --git a/crates/af-iperps/src/lib.rs b/crates/af-iperps/src/lib.rs index 4249b6f4..aa915cde 100644 --- a/crates/af-iperps/src/lib.rs +++ b/crates/af-iperps/src/lib.rs @@ -26,19 +26,13 @@ pub mod stop_order_helpers; pub use self::market::{MarketParams, MarketState}; pub use self::orderbook::Order; pub use self::position::Position; -use crate::authority::{ADMIN, ASSISTANT}; - -/// Package IDs of the perpetuals contract versions published on testnet, in order of its versions. -pub const TESTNET_PACKAGE_VERSIONS: &[Address] = &[Address::from_static( - "0x1fc71972750d0d81567183a8500befef94d7699aac76edffcca253fe541367fd", -)]; // Convenient aliases since these types will never exist onchain with a type argument other than an // OTW. -pub type AdminCapability = self::authority::Capability; -pub type AssistantCapability = self::authority::Capability; -pub type AccountCap = self::account::AccountCap; -pub type AccountCapTypeTag = self::account::AccountCapTypeTag; +pub type AdminCapability = self::authority::Capability; +pub type AssistantCapability = self::authority::Capability; +pub type AdminAccountCap = self::account::AccountCap; +pub type AssistantAccountCap = self::account::AccountCap; pub type Account = self::account::Account; pub type AccountTypeTag = self::account::AccountTypeTag; pub type StopOrderTicket = self::stop_orders::StopOrderTicket; @@ -71,8 +65,14 @@ pub type CollateralInfoDf = Field, CollateralI sui_pkg_sdk!(perpetuals { module account { + /// Admin Role + struct ADMIN(); + + /// Assistant Role + struct ASSISTANT(); + /// The AccountCap is used to check ownership of `Account` with the same `account_id`. - struct AccountCap has key, store { + struct AccountCap has key, store { id: UID, // Account object id account_obj_id: ID, @@ -87,6 +87,10 @@ sui_pkg_sdk!(perpetuals { account_id: u64, /// Balance available to be allocated to markets. collateral: Balance, + /// Tracks the `ID`s of all `AccountCap`s that have the authority + /// to interact with thie `Account`. Appended to in `new_assistant_account_cap` + /// and reduced in `revoke_assistant_account_cap`. + active_assistants: vector, } struct IntegratorConfig has store { @@ -768,6 +772,16 @@ sui_pkg_sdk!(perpetuals { open_interest: IFixed, fees_accrued: IFixed } + + struct CreatedAssistantAccountCap has copy, drop { + account_id: u64, + assistant_cap_id: ID, + } + + struct RevokedAssistantAccountCap has copy, drop { + account_id: u64, + assistant_cap_id: ID, + } } module keys { @@ -1148,20 +1162,6 @@ impl clearing_house::ClearingHouse { ID::type_(SUI_FRAMEWORK_ADDRESS, IdentStr::cast("object").to_owned()), ) } - - /// The ID of the package that governs this clearing house's logic. - /// - /// This may be different than the package defining the clearing house's type because a package - /// upgrade + `interface::upgrade_clearing_house_version` call can change - /// [`ClearingHouse::version`] so that the upgraded package is the one that is allowed to make - /// changes to it. - /// - /// Attempting to make a PTB Move call that mutates this clearing house but is not defined in - /// this package version will fail. - pub const fn governing_package_testnet(&self) -> Address { - // NOTE: we published the most recent testnet contracts starting with `VERSION = 1` - TESTNET_PACKAGE_VERSIONS[self.version as usize - 1] - } } impl self::orderbook::Orderbook { diff --git a/crates/af-iperps/src/snapshots/af_iperps__tests__public_api.snap b/crates/af-iperps/src/snapshots/af_iperps__tests__public_api.snap index 1b17c974..d8a7147a 100644 --- a/crates/af-iperps/src/snapshots/af_iperps__tests__public_api.snap +++ b/crates/af-iperps/src/snapshots/af_iperps__tests__public_api.snap @@ -4,15 +4,98 @@ expression: public_api --- pub mod af_iperps pub mod af_iperps::account +pub struct af_iperps::account::ADMIN(_) +impl af_iperps::account::ADMIN +pub fn af_iperps::account::ADMIN::move_instance(self, address: sui_sdk_types::address::Address) -> af_move_type::MoveInstance +pub fn af_iperps::account::ADMIN::type_(address: sui_sdk_types::address::Address) -> af_iperps::account::ADMINTypeTag +impl af_iperps::account::ADMIN +pub fn af_iperps::account::ADMIN::new() -> Self +impl af_move_type::MoveStruct for af_iperps::account::ADMIN +pub type af_iperps::account::ADMIN::StructTag = af_iperps::account::ADMINTypeTag +impl af_move_type::MoveType for af_iperps::account::ADMIN +pub type af_iperps::account::ADMIN::TypeTag = af_iperps::account::ADMINTypeTag +impl af_move_type::StaticModule for af_iperps::account::ADMIN +pub fn af_iperps::account::ADMIN::module() -> sui_sdk_types::type_tag::Identifier +impl af_move_type::StaticName for af_iperps::account::ADMIN +pub fn af_iperps::account::ADMIN::name() -> sui_sdk_types::type_tag::Identifier +impl af_move_type::StaticTypeParams for af_iperps::account::ADMIN +pub fn af_iperps::account::ADMIN::type_params() -> alloc::vec::Vec +impl core::default::Default for af_iperps::account::ADMIN +pub fn af_iperps::account::ADMIN::default() -> Self +impl core::fmt::Display for af_iperps::account::ADMIN +pub fn af_iperps::account::ADMIN::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl tabled::tabled::Tabled for af_iperps::account::ADMIN +pub const af_iperps::account::ADMIN::LENGTH: usize +pub fn af_iperps::account::ADMIN::fields(&self) -> alloc::vec::Vec> +pub fn af_iperps::account::ADMIN::headers() -> alloc::vec::Vec> +pub struct af_iperps::account::ADMINTypeTag +pub af_iperps::account::ADMINTypeTag::address: sui_sdk_types::address::Address +impl core::convert::From for sui_sdk_types::type_tag::StructTag +pub fn sui_sdk_types::type_tag::StructTag::from(value: af_iperps::account::ADMINTypeTag) -> Self +impl core::convert::From for sui_sdk_types::type_tag::TypeTag +pub fn sui_sdk_types::type_tag::TypeTag::from(value: af_iperps::account::ADMINTypeTag) -> Self +impl core::convert::TryFrom for af_iperps::account::ADMINTypeTag +pub type af_iperps::account::ADMINTypeTag::Error = af_move_type::StructTagError +pub fn af_iperps::account::ADMINTypeTag::try_from(value: sui_sdk_types::type_tag::StructTag) -> core::result::Result +impl core::convert::TryFrom for af_iperps::account::ADMINTypeTag +pub type af_iperps::account::ADMINTypeTag::Error = af_move_type::TypeTagError +pub fn af_iperps::account::ADMINTypeTag::try_from(value: sui_sdk_types::type_tag::TypeTag) -> core::result::Result +impl core::fmt::Display for af_iperps::account::ADMINTypeTag +pub fn af_iperps::account::ADMINTypeTag::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::str::traits::FromStr for af_iperps::account::ADMINTypeTag +pub type af_iperps::account::ADMINTypeTag::Err = af_move_type::ParseStructTagError +pub fn af_iperps::account::ADMINTypeTag::from_str(s: &str) -> core::result::Result +pub struct af_iperps::account::ASSISTANT(_) +impl af_iperps::account::ASSISTANT +pub fn af_iperps::account::ASSISTANT::move_instance(self, address: sui_sdk_types::address::Address) -> af_move_type::MoveInstance +pub fn af_iperps::account::ASSISTANT::type_(address: sui_sdk_types::address::Address) -> af_iperps::account::ASSISTANTTypeTag +impl af_iperps::account::ASSISTANT +pub fn af_iperps::account::ASSISTANT::new() -> Self +impl af_move_type::MoveStruct for af_iperps::account::ASSISTANT +pub type af_iperps::account::ASSISTANT::StructTag = af_iperps::account::ASSISTANTTypeTag +impl af_move_type::MoveType for af_iperps::account::ASSISTANT +pub type af_iperps::account::ASSISTANT::TypeTag = af_iperps::account::ASSISTANTTypeTag +impl af_move_type::StaticModule for af_iperps::account::ASSISTANT +pub fn af_iperps::account::ASSISTANT::module() -> sui_sdk_types::type_tag::Identifier +impl af_move_type::StaticName for af_iperps::account::ASSISTANT +pub fn af_iperps::account::ASSISTANT::name() -> sui_sdk_types::type_tag::Identifier +impl af_move_type::StaticTypeParams for af_iperps::account::ASSISTANT +pub fn af_iperps::account::ASSISTANT::type_params() -> alloc::vec::Vec +impl core::default::Default for af_iperps::account::ASSISTANT +pub fn af_iperps::account::ASSISTANT::default() -> Self +impl core::fmt::Display for af_iperps::account::ASSISTANT +pub fn af_iperps::account::ASSISTANT::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl tabled::tabled::Tabled for af_iperps::account::ASSISTANT +pub const af_iperps::account::ASSISTANT::LENGTH: usize +pub fn af_iperps::account::ASSISTANT::fields(&self) -> alloc::vec::Vec> +pub fn af_iperps::account::ASSISTANT::headers() -> alloc::vec::Vec> +pub struct af_iperps::account::ASSISTANTTypeTag +pub af_iperps::account::ASSISTANTTypeTag::address: sui_sdk_types::address::Address +impl core::convert::From for sui_sdk_types::type_tag::StructTag +pub fn sui_sdk_types::type_tag::StructTag::from(value: af_iperps::account::ASSISTANTTypeTag) -> Self +impl core::convert::From for sui_sdk_types::type_tag::TypeTag +pub fn sui_sdk_types::type_tag::TypeTag::from(value: af_iperps::account::ASSISTANTTypeTag) -> Self +impl core::convert::TryFrom for af_iperps::account::ASSISTANTTypeTag +pub type af_iperps::account::ASSISTANTTypeTag::Error = af_move_type::StructTagError +pub fn af_iperps::account::ASSISTANTTypeTag::try_from(value: sui_sdk_types::type_tag::StructTag) -> core::result::Result +impl core::convert::TryFrom for af_iperps::account::ASSISTANTTypeTag +pub type af_iperps::account::ASSISTANTTypeTag::Error = af_move_type::TypeTagError +pub fn af_iperps::account::ASSISTANTTypeTag::try_from(value: sui_sdk_types::type_tag::TypeTag) -> core::result::Result +impl core::fmt::Display for af_iperps::account::ASSISTANTTypeTag +pub fn af_iperps::account::ASSISTANTTypeTag::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::str::traits::FromStr for af_iperps::account::ASSISTANTTypeTag +pub type af_iperps::account::ASSISTANTTypeTag::Err = af_move_type::ParseStructTagError +pub fn af_iperps::account::ASSISTANTTypeTag::from_str(s: &str) -> core::result::Result pub struct af_iperps::account::Account pub af_iperps::account::Account::account_id: u64 +pub af_iperps::account::Account::active_assistants: af_move_type::vector::MoveVec pub af_iperps::account::Account::collateral: sui_framework_sdk::balance::Balance pub af_iperps::account::Account::id: sui_framework_sdk::object::UID impl af_iperps::account::Account pub fn af_iperps::account::Account::move_instance(self, address: sui_sdk_types::address::Address, t: ::TypeTag) -> af_move_type::MoveInstance pub fn af_iperps::account::Account::type_(address: sui_sdk_types::address::Address, t: ::TypeTag) -> af_iperps::account::AccountTypeTag impl af_iperps::account::Account -pub fn af_iperps::account::Account::new(id: sui_framework_sdk::object::UID, account_id: u64, collateral: sui_framework_sdk::balance::Balance) -> Self +pub fn af_iperps::account::Account::new(id: sui_framework_sdk::object::UID, account_id: u64, collateral: sui_framework_sdk::balance::Balance, active_assistants: af_move_type::vector::MoveVec) -> Self impl af_move_type::StaticTypeParams for af_iperps::account::Account pub fn af_iperps::account::Account::type_params() -> alloc::vec::Vec impl af_move_type::HasKey for af_iperps::account::Account @@ -31,51 +114,51 @@ impl tabled::tabled::Tabled for af_iperps::account::A pub const af_iperps::account::Account::LENGTH: usize pub fn af_iperps::account::Account::fields(&self) -> alloc::vec::Vec> pub fn af_iperps::account::Account::headers() -> alloc::vec::Vec> -pub struct af_iperps::account::AccountCap +pub struct af_iperps::account::AccountCap pub af_iperps::account::AccountCap::account_id: u64 pub af_iperps::account::AccountCap::account_obj_id: sui_framework_sdk::object::ID pub af_iperps::account::AccountCap::id: sui_framework_sdk::object::UID -impl af_iperps::account::AccountCap -pub fn af_iperps::account::AccountCap::move_instance(self, address: sui_sdk_types::address::Address, t: ::TypeTag) -> af_move_type::MoveInstance -pub fn af_iperps::account::AccountCap::type_(address: sui_sdk_types::address::Address, t: ::TypeTag) -> af_iperps::account::AccountCapTypeTag -impl af_iperps::account::AccountCap -pub fn af_iperps::account::AccountCap::new(id: sui_framework_sdk::object::UID, account_obj_id: sui_framework_sdk::object::ID, account_id: u64) -> Self -impl af_move_type::StaticTypeParams for af_iperps::account::AccountCap -pub fn af_iperps::account::AccountCap::type_params() -> alloc::vec::Vec -impl af_move_type::HasKey for af_iperps::account::AccountCap -pub fn af_iperps::account::AccountCap::object_id(&self) -> sui_sdk_types::address::Address -impl af_move_type::MoveStruct for af_iperps::account::AccountCap -pub type af_iperps::account::AccountCap::StructTag = af_iperps::account::AccountCapTypeTag -impl af_move_type::MoveType for af_iperps::account::AccountCap -pub type af_iperps::account::AccountCap::TypeTag = af_iperps::account::AccountCapTypeTag -impl af_move_type::StaticModule for af_iperps::account::AccountCap -pub fn af_iperps::account::AccountCap::module() -> sui_sdk_types::type_tag::Identifier -impl af_move_type::StaticName for af_iperps::account::AccountCap -pub fn af_iperps::account::AccountCap::name() -> sui_sdk_types::type_tag::Identifier -impl core::fmt::Display for af_iperps::account::AccountCap -pub fn af_iperps::account::AccountCap::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -impl tabled::tabled::Tabled for af_iperps::account::AccountCap -pub const af_iperps::account::AccountCap::LENGTH: usize -pub fn af_iperps::account::AccountCap::fields(&self) -> alloc::vec::Vec> -pub fn af_iperps::account::AccountCap::headers() -> alloc::vec::Vec> -pub struct af_iperps::account::AccountCapTypeTag +impl af_iperps::account::AccountCap +pub fn af_iperps::account::AccountCap::move_instance(self, address: sui_sdk_types::address::Address, role: ::TypeTag) -> af_move_type::MoveInstance +pub fn af_iperps::account::AccountCap::type_(address: sui_sdk_types::address::Address, role: ::TypeTag) -> af_iperps::account::AccountCapTypeTag +impl af_iperps::account::AccountCap +pub fn af_iperps::account::AccountCap::new(id: sui_framework_sdk::object::UID, account_obj_id: sui_framework_sdk::object::ID, account_id: u64) -> Self +impl af_move_type::StaticTypeParams for af_iperps::account::AccountCap +pub fn af_iperps::account::AccountCap::type_params() -> alloc::vec::Vec +impl af_move_type::HasKey for af_iperps::account::AccountCap +pub fn af_iperps::account::AccountCap::object_id(&self) -> sui_sdk_types::address::Address +impl af_move_type::MoveStruct for af_iperps::account::AccountCap +pub type af_iperps::account::AccountCap::StructTag = af_iperps::account::AccountCapTypeTag +impl af_move_type::MoveType for af_iperps::account::AccountCap +pub type af_iperps::account::AccountCap::TypeTag = af_iperps::account::AccountCapTypeTag +impl af_move_type::StaticModule for af_iperps::account::AccountCap +pub fn af_iperps::account::AccountCap::module() -> sui_sdk_types::type_tag::Identifier +impl af_move_type::StaticName for af_iperps::account::AccountCap +pub fn af_iperps::account::AccountCap::name() -> sui_sdk_types::type_tag::Identifier +impl core::fmt::Display for af_iperps::account::AccountCap +pub fn af_iperps::account::AccountCap::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl tabled::tabled::Tabled for af_iperps::account::AccountCap +pub const af_iperps::account::AccountCap::LENGTH: usize +pub fn af_iperps::account::AccountCap::fields(&self) -> alloc::vec::Vec> +pub fn af_iperps::account::AccountCap::headers() -> alloc::vec::Vec> +pub struct af_iperps::account::AccountCapTypeTag pub af_iperps::account::AccountCapTypeTag::address: sui_sdk_types::address::Address -pub af_iperps::account::AccountCapTypeTag::t: ::TypeTag -impl core::convert::From> for sui_sdk_types::type_tag::StructTag -pub fn sui_sdk_types::type_tag::StructTag::from(value: af_iperps::account::AccountCapTypeTag) -> Self -impl core::convert::From> for sui_sdk_types::type_tag::TypeTag -pub fn sui_sdk_types::type_tag::TypeTag::from(value: af_iperps::account::AccountCapTypeTag) -> Self -impl core::convert::TryFrom for af_iperps::account::AccountCapTypeTag -pub type af_iperps::account::AccountCapTypeTag::Error = af_move_type::StructTagError -pub fn af_iperps::account::AccountCapTypeTag::try_from(value: sui_sdk_types::type_tag::StructTag) -> core::result::Result -impl core::convert::TryFrom for af_iperps::account::AccountCapTypeTag -pub type af_iperps::account::AccountCapTypeTag::Error = af_move_type::TypeTagError -pub fn af_iperps::account::AccountCapTypeTag::try_from(value: sui_sdk_types::type_tag::TypeTag) -> core::result::Result -impl core::fmt::Display for af_iperps::account::AccountCapTypeTag -pub fn af_iperps::account::AccountCapTypeTag::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -impl core::str::traits::FromStr for af_iperps::account::AccountCapTypeTag -pub type af_iperps::account::AccountCapTypeTag::Err = af_move_type::ParseStructTagError -pub fn af_iperps::account::AccountCapTypeTag::from_str(s: &str) -> core::result::Result +pub af_iperps::account::AccountCapTypeTag::role: ::TypeTag +impl core::convert::From> for sui_sdk_types::type_tag::StructTag +pub fn sui_sdk_types::type_tag::StructTag::from(value: af_iperps::account::AccountCapTypeTag) -> Self +impl core::convert::From> for sui_sdk_types::type_tag::TypeTag +pub fn sui_sdk_types::type_tag::TypeTag::from(value: af_iperps::account::AccountCapTypeTag) -> Self +impl core::convert::TryFrom for af_iperps::account::AccountCapTypeTag +pub type af_iperps::account::AccountCapTypeTag::Error = af_move_type::StructTagError +pub fn af_iperps::account::AccountCapTypeTag::try_from(value: sui_sdk_types::type_tag::StructTag) -> core::result::Result +impl core::convert::TryFrom for af_iperps::account::AccountCapTypeTag +pub type af_iperps::account::AccountCapTypeTag::Error = af_move_type::TypeTagError +pub fn af_iperps::account::AccountCapTypeTag::try_from(value: sui_sdk_types::type_tag::TypeTag) -> core::result::Result +impl core::fmt::Display for af_iperps::account::AccountCapTypeTag +pub fn af_iperps::account::AccountCapTypeTag::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::str::traits::FromStr for af_iperps::account::AccountCapTypeTag +pub type af_iperps::account::AccountCapTypeTag::Err = af_move_type::ParseStructTagError +pub fn af_iperps::account::AccountCapTypeTag::from_str(s: &str) -> core::result::Result pub struct af_iperps::account::AccountTypeTag pub af_iperps::account::AccountTypeTag::address: sui_sdk_types::address::Address pub af_iperps::account::AccountTypeTag::t: ::TypeTag @@ -268,16 +351,15 @@ pub af_iperps::clearing_house::ClearingHouse::market_state: af_iperps::market::M pub af_iperps::clearing_house::ClearingHouse::paused: bool pub af_iperps::clearing_house::ClearingHouse::version: u64 impl af_iperps::clearing_house::ClearingHouse -pub const fn af_iperps::clearing_house::ClearingHouse::governing_package_testnet(&self) -> sui_sdk_types::address::Address -pub fn af_iperps::clearing_house::ClearingHouse::orderbook_dof_wrapper_type(package: sui_sdk_types::address::Address) -> sui_framework_sdk::dynamic_field::FieldTypeTag, sui_framework_sdk::object::ID> -pub fn af_iperps::clearing_house::ClearingHouse::position_df_type(package: sui_sdk_types::address::Address) -> sui_framework_sdk::dynamic_field::FieldTypeTag -impl af_iperps::clearing_house::ClearingHouse pub fn af_iperps::clearing_house::ClearingHouse::liquidation_price(&self, pos: &af_iperps::position::Position, coll_price: af_utilities::types::ifixed::IFixed) -> core::option::Option impl af_iperps::clearing_house::ClearingHouse pub fn af_iperps::clearing_house::ClearingHouse::move_instance(self, address: sui_sdk_types::address::Address, t: ::TypeTag) -> af_move_type::MoveInstance pub fn af_iperps::clearing_house::ClearingHouse::type_(address: sui_sdk_types::address::Address, t: ::TypeTag) -> af_iperps::clearing_house::ClearingHouseTypeTag impl af_iperps::clearing_house::ClearingHouse pub fn af_iperps::clearing_house::ClearingHouse::new(id: sui_framework_sdk::object::UID, version: u64, paused: bool, market_params: af_iperps::market::MarketParams, market_state: af_iperps::market::MarketState) -> Self +impl af_iperps::clearing_house::ClearingHouse +pub fn af_iperps::clearing_house::ClearingHouse::orderbook_dof_wrapper_type(package: sui_sdk_types::address::Address) -> sui_framework_sdk::dynamic_field::FieldTypeTag, sui_framework_sdk::object::ID> +pub fn af_iperps::clearing_house::ClearingHouse::position_df_type(package: sui_sdk_types::address::Address) -> sui_framework_sdk::dynamic_field::FieldTypeTag impl af_move_type::StaticTypeParams for af_iperps::clearing_house::ClearingHouse pub fn af_iperps::clearing_house::ClearingHouse::type_params() -> alloc::vec::Vec impl af_iperps::math::OrderBookUnits for af_iperps::clearing_house::ClearingHouse @@ -742,6 +824,7 @@ pub af_iperps::errors::MoveAbort::SizeNotMultipleOfLotSize = 34 pub af_iperps::errors::MoveAbort::SizeOrPositionZero = 1 pub af_iperps::errors::MoveAbort::StopOrderConditionsViolated = 9 pub af_iperps::errors::MoveAbort::StopOrderTicketExpired = 8 +pub af_iperps::errors::MoveAbort::TooManyAssistantsPerAccount = 4000 pub af_iperps::errors::MoveAbort::UpdatingFundingTooEarly = 1001 pub af_iperps::errors::MoveAbort::WrongAccountIdForAllocation = 31 pub af_iperps::errors::MoveAbort::WrongOrderDetails = 10 @@ -826,6 +909,7 @@ pub const af_iperps::errors::SizeNotMultipleOfLotSize: u64 pub const af_iperps::errors::SizeOrPositionZero: u64 pub const af_iperps::errors::StopOrderConditionsViolated: u64 pub const af_iperps::errors::StopOrderTicketExpired: u64 +pub const af_iperps::errors::TooManyAssistantsPerAccount: u64 pub const af_iperps::errors::UpdatingFundingTooEarly: u64 pub const af_iperps::errors::WrongAccountIdForAllocation: u64 pub const af_iperps::errors::WrongOrderDetails: u64 @@ -853,6 +937,7 @@ pub af_iperps::event_instance::EventInstance::CanceledOrder(af_move_type::MoveIn pub af_iperps::event_instance::EventInstance::ClosedMarket(af_move_type::MoveInstance) pub af_iperps::event_instance::EventInstance::ClosedPositionAtSettlementPrices(af_move_type::MoveInstance) pub af_iperps::event_instance::EventInstance::CreatedAccount(af_move_type::MoveInstance>) +pub af_iperps::event_instance::EventInstance::CreatedAssistantAccountCap(af_move_type::MoveInstance) pub af_iperps::event_instance::EventInstance::CreatedClearingHouse(af_move_type::MoveInstance) pub af_iperps::event_instance::EventInstance::CreatedIntegratorVault(af_move_type::MoveInstance) pub af_iperps::event_instance::EventInstance::CreatedMarginRatiosProposal(af_move_type::MoveInstance) @@ -885,6 +970,7 @@ pub af_iperps::event_instance::EventInstance::RemovedIntegratorConfig(af_move_ty pub af_iperps::event_instance::EventInstance::RemovedRegisteredMarketInfo(af_move_type::MoveInstance>) pub af_iperps::event_instance::EventInstance::ResettedPositionFees(af_move_type::MoveInstance) pub af_iperps::event_instance::EventInstance::ResumedMarket(af_move_type::MoveInstance) +pub af_iperps::event_instance::EventInstance::RevokedAssistantAccountCap(af_move_type::MoveInstance) pub af_iperps::event_instance::EventInstance::SetPositionInitialMarginRatio(af_move_type::MoveInstance) pub af_iperps::event_instance::EventInstance::SettledFunding(af_move_type::MoveInstance) pub af_iperps::event_instance::EventInstance::SocializedBadDebt(af_move_type::MoveInstance) @@ -1229,6 +1315,47 @@ pub fn af_iperps::events::CreatedAccountTypeTag::fmt(&self, f: &mut core::fmt impl core::str::traits::FromStr for af_iperps::events::CreatedAccountTypeTag pub type af_iperps::events::CreatedAccountTypeTag::Err = af_move_type::ParseStructTagError pub fn af_iperps::events::CreatedAccountTypeTag::from_str(s: &str) -> core::result::Result +pub struct af_iperps::events::CreatedAssistantAccountCap +pub af_iperps::events::CreatedAssistantAccountCap::account_id: u64 +pub af_iperps::events::CreatedAssistantAccountCap::assistant_cap_id: sui_framework_sdk::object::ID +impl af_iperps::events::CreatedAssistantAccountCap +pub fn af_iperps::events::CreatedAssistantAccountCap::move_instance(self, address: sui_sdk_types::address::Address) -> af_move_type::MoveInstance +pub fn af_iperps::events::CreatedAssistantAccountCap::type_(address: sui_sdk_types::address::Address) -> af_iperps::events::CreatedAssistantAccountCapTypeTag +impl af_iperps::events::CreatedAssistantAccountCap +pub fn af_iperps::events::CreatedAssistantAccountCap::new(account_id: u64, assistant_cap_id: sui_framework_sdk::object::ID) -> Self +impl af_move_type::MoveStruct for af_iperps::events::CreatedAssistantAccountCap +pub type af_iperps::events::CreatedAssistantAccountCap::StructTag = af_iperps::events::CreatedAssistantAccountCapTypeTag +impl af_move_type::MoveType for af_iperps::events::CreatedAssistantAccountCap +pub type af_iperps::events::CreatedAssistantAccountCap::TypeTag = af_iperps::events::CreatedAssistantAccountCapTypeTag +impl af_move_type::StaticModule for af_iperps::events::CreatedAssistantAccountCap +pub fn af_iperps::events::CreatedAssistantAccountCap::module() -> sui_sdk_types::type_tag::Identifier +impl af_move_type::StaticName for af_iperps::events::CreatedAssistantAccountCap +pub fn af_iperps::events::CreatedAssistantAccountCap::name() -> sui_sdk_types::type_tag::Identifier +impl af_move_type::StaticTypeParams for af_iperps::events::CreatedAssistantAccountCap +pub fn af_iperps::events::CreatedAssistantAccountCap::type_params() -> alloc::vec::Vec +impl core::fmt::Display for af_iperps::events::CreatedAssistantAccountCap +pub fn af_iperps::events::CreatedAssistantAccountCap::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl tabled::tabled::Tabled for af_iperps::events::CreatedAssistantAccountCap +pub const af_iperps::events::CreatedAssistantAccountCap::LENGTH: usize +pub fn af_iperps::events::CreatedAssistantAccountCap::fields(&self) -> alloc::vec::Vec> +pub fn af_iperps::events::CreatedAssistantAccountCap::headers() -> alloc::vec::Vec> +pub struct af_iperps::events::CreatedAssistantAccountCapTypeTag +pub af_iperps::events::CreatedAssistantAccountCapTypeTag::address: sui_sdk_types::address::Address +impl core::convert::From for sui_sdk_types::type_tag::StructTag +pub fn sui_sdk_types::type_tag::StructTag::from(value: af_iperps::events::CreatedAssistantAccountCapTypeTag) -> Self +impl core::convert::From for sui_sdk_types::type_tag::TypeTag +pub fn sui_sdk_types::type_tag::TypeTag::from(value: af_iperps::events::CreatedAssistantAccountCapTypeTag) -> Self +impl core::convert::TryFrom for af_iperps::events::CreatedAssistantAccountCapTypeTag +pub type af_iperps::events::CreatedAssistantAccountCapTypeTag::Error = af_move_type::StructTagError +pub fn af_iperps::events::CreatedAssistantAccountCapTypeTag::try_from(value: sui_sdk_types::type_tag::StructTag) -> core::result::Result +impl core::convert::TryFrom for af_iperps::events::CreatedAssistantAccountCapTypeTag +pub type af_iperps::events::CreatedAssistantAccountCapTypeTag::Error = af_move_type::TypeTagError +pub fn af_iperps::events::CreatedAssistantAccountCapTypeTag::try_from(value: sui_sdk_types::type_tag::TypeTag) -> core::result::Result +impl core::fmt::Display for af_iperps::events::CreatedAssistantAccountCapTypeTag +pub fn af_iperps::events::CreatedAssistantAccountCapTypeTag::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::str::traits::FromStr for af_iperps::events::CreatedAssistantAccountCapTypeTag +pub type af_iperps::events::CreatedAssistantAccountCapTypeTag::Err = af_move_type::ParseStructTagError +pub fn af_iperps::events::CreatedAssistantAccountCapTypeTag::from_str(s: &str) -> core::result::Result pub struct af_iperps::events::CreatedClearingHouse pub af_iperps::events::CreatedClearingHouse::base_oracle_id: sui_framework_sdk::object::ID pub af_iperps::events::CreatedClearingHouse::ch_id: sui_framework_sdk::object::ID @@ -2640,6 +2767,47 @@ pub fn af_iperps::events::ResumedMarketTypeTag::fmt(&self, f: &mut core::fmt::Fo impl core::str::traits::FromStr for af_iperps::events::ResumedMarketTypeTag pub type af_iperps::events::ResumedMarketTypeTag::Err = af_move_type::ParseStructTagError pub fn af_iperps::events::ResumedMarketTypeTag::from_str(s: &str) -> core::result::Result +pub struct af_iperps::events::RevokedAssistantAccountCap +pub af_iperps::events::RevokedAssistantAccountCap::account_id: u64 +pub af_iperps::events::RevokedAssistantAccountCap::assistant_cap_id: sui_framework_sdk::object::ID +impl af_iperps::events::RevokedAssistantAccountCap +pub fn af_iperps::events::RevokedAssistantAccountCap::move_instance(self, address: sui_sdk_types::address::Address) -> af_move_type::MoveInstance +pub fn af_iperps::events::RevokedAssistantAccountCap::type_(address: sui_sdk_types::address::Address) -> af_iperps::events::RevokedAssistantAccountCapTypeTag +impl af_iperps::events::RevokedAssistantAccountCap +pub fn af_iperps::events::RevokedAssistantAccountCap::new(account_id: u64, assistant_cap_id: sui_framework_sdk::object::ID) -> Self +impl af_move_type::MoveStruct for af_iperps::events::RevokedAssistantAccountCap +pub type af_iperps::events::RevokedAssistantAccountCap::StructTag = af_iperps::events::RevokedAssistantAccountCapTypeTag +impl af_move_type::MoveType for af_iperps::events::RevokedAssistantAccountCap +pub type af_iperps::events::RevokedAssistantAccountCap::TypeTag = af_iperps::events::RevokedAssistantAccountCapTypeTag +impl af_move_type::StaticModule for af_iperps::events::RevokedAssistantAccountCap +pub fn af_iperps::events::RevokedAssistantAccountCap::module() -> sui_sdk_types::type_tag::Identifier +impl af_move_type::StaticName for af_iperps::events::RevokedAssistantAccountCap +pub fn af_iperps::events::RevokedAssistantAccountCap::name() -> sui_sdk_types::type_tag::Identifier +impl af_move_type::StaticTypeParams for af_iperps::events::RevokedAssistantAccountCap +pub fn af_iperps::events::RevokedAssistantAccountCap::type_params() -> alloc::vec::Vec +impl core::fmt::Display for af_iperps::events::RevokedAssistantAccountCap +pub fn af_iperps::events::RevokedAssistantAccountCap::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl tabled::tabled::Tabled for af_iperps::events::RevokedAssistantAccountCap +pub const af_iperps::events::RevokedAssistantAccountCap::LENGTH: usize +pub fn af_iperps::events::RevokedAssistantAccountCap::fields(&self) -> alloc::vec::Vec> +pub fn af_iperps::events::RevokedAssistantAccountCap::headers() -> alloc::vec::Vec> +pub struct af_iperps::events::RevokedAssistantAccountCapTypeTag +pub af_iperps::events::RevokedAssistantAccountCapTypeTag::address: sui_sdk_types::address::Address +impl core::convert::From for sui_sdk_types::type_tag::StructTag +pub fn sui_sdk_types::type_tag::StructTag::from(value: af_iperps::events::RevokedAssistantAccountCapTypeTag) -> Self +impl core::convert::From for sui_sdk_types::type_tag::TypeTag +pub fn sui_sdk_types::type_tag::TypeTag::from(value: af_iperps::events::RevokedAssistantAccountCapTypeTag) -> Self +impl core::convert::TryFrom for af_iperps::events::RevokedAssistantAccountCapTypeTag +pub type af_iperps::events::RevokedAssistantAccountCapTypeTag::Error = af_move_type::StructTagError +pub fn af_iperps::events::RevokedAssistantAccountCapTypeTag::try_from(value: sui_sdk_types::type_tag::StructTag) -> core::result::Result +impl core::convert::TryFrom for af_iperps::events::RevokedAssistantAccountCapTypeTag +pub type af_iperps::events::RevokedAssistantAccountCapTypeTag::Error = af_move_type::TypeTagError +pub fn af_iperps::events::RevokedAssistantAccountCapTypeTag::try_from(value: sui_sdk_types::type_tag::TypeTag) -> core::result::Result +impl core::fmt::Display for af_iperps::events::RevokedAssistantAccountCapTypeTag +pub fn af_iperps::events::RevokedAssistantAccountCapTypeTag::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::str::traits::FromStr for af_iperps::events::RevokedAssistantAccountCapTypeTag +pub type af_iperps::events::RevokedAssistantAccountCapTypeTag::Err = af_move_type::ParseStructTagError +pub fn af_iperps::events::RevokedAssistantAccountCapTypeTag::from_str(s: &str) -> core::result::Result pub struct af_iperps::events::SetPositionInitialMarginRatio pub af_iperps::events::SetPositionInitialMarginRatio::account_id: u64 pub af_iperps::events::SetPositionInitialMarginRatio::ch_id: sui_framework_sdk::object::ID @@ -5591,13 +5759,12 @@ impl tabled::tabled::Tabled for af_iperps::position::Position pub const af_iperps::position::Position::LENGTH: usize pub fn af_iperps::position::Position::fields(&self) -> alloc::vec::Vec> pub fn af_iperps::position::Position::headers() -> alloc::vec::Vec> -pub const af_iperps::TESTNET_PACKAGE_VERSIONS: &[sui_sdk_types::address::Address] pub type af_iperps::Account = af_iperps::account::Account -pub type af_iperps::AccountCap = af_iperps::account::AccountCap -pub type af_iperps::AccountCapTypeTag = af_iperps::account::AccountCapTypeTag pub type af_iperps::AccountTypeTag = af_iperps::account::AccountTypeTag +pub type af_iperps::AdminAccountCap = af_iperps::account::AccountCap pub type af_iperps::AdminCapability = af_iperps::authority::Capability pub type af_iperps::AsksMapDofWrapper = sui_framework_sdk::dynamic_field::Field, sui_framework_sdk::object::ID> +pub type af_iperps::AssistantAccountCap = af_iperps::account::AccountCap pub type af_iperps::AssistantCapability = af_iperps::authority::Capability pub type af_iperps::BidsMapDofWrapper = sui_framework_sdk::dynamic_field::Field, sui_framework_sdk::object::ID> pub type af_iperps::ClearingHouse = af_iperps::clearing_house::ClearingHouse