From 8b8d58cd549eaa6c511f77f8e1798619c6666b41 Mon Sep 17 00:00:00 2001 From: Yuru Shao Date: Thu, 16 Jan 2025 09:25:03 -0800 Subject: [PATCH] anchor: program migration --- anchor/programs/glam/src/constants.rs | 18 +- anchor/programs/glam/src/error.rs | 12 +- .../programs/glam/src/instructions/drift.rs | 18 +- .../glam/src/instructions/investor.rs | 12 +- .../programs/glam/src/instructions/jupiter.rs | 31 +- .../glam/src/instructions/marinade.rs | 10 +- .../glam/src/instructions/share_class.rs | 42 +- .../programs/glam/src/instructions/stake.rs | 12 +- .../programs/glam/src/instructions/state.rs | 297 +- anchor/programs/glam/src/lib.rs | 76 +- anchor/programs/glam/src/state/accounts.rs | 380 +- anchor/programs/glam/src/state/acl.rs | 91 +- anchor/programs/glam/src/state/model/model.rs | 42 +- .../glam/src/state/model/openfunds.rs | 12 +- .../glam/src/state/openfunds/share_class.rs | 326 +- anchor/target/idl/glam.json | 3199 ++++++----------- anchor/target/types/glam.ts | 3199 ++++++----------- 17 files changed, 2641 insertions(+), 5136 deletions(-) diff --git a/anchor/programs/glam/src/constants.rs b/anchor/programs/glam/src/constants.rs index f94eba8c..0f3c63a6 100644 --- a/anchor/programs/glam/src/constants.rs +++ b/anchor/programs/glam/src/constants.rs @@ -2,24 +2,24 @@ use anchor_lang::prelude::*; use solana_program::pubkey; #[constant] -pub const SEED_STATE: &str = "fund"; +pub const SEED_STATE: &str = "state"; #[constant] -pub const SEED_VAULT: &str = "treasury"; +pub const SEED_VAULT: &str = "vault"; #[constant] -pub const SEED_METADATA: &str = "openfunds"; +pub const SEED_METADATA: &str = "metadata"; #[constant] -pub const SEED_MINT: &str = "share"; +pub const SEED_MINT: &str = "mint"; pub const DEFAULT_DRIFT_USER_NAME: [u8; 32] = [ b'G', b'L', b'A', b'M', b' ', b'*', b'.', b'+', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ]; -pub const MAX_ASSETS: usize = 5; -pub const MAX_SHARE_CLASSES: usize = 3; -pub const MAX_SIZE_NAME: usize = 50; -pub const MAX_SIZE_SYMBOL: usize = 20; -pub const MAX_SIZE_URI: usize = 100; +pub const MAX_ASSETS: usize = 100; +pub const MAX_MINTS: usize = 1; +pub const MAX_SIZE_SYMBOL: usize = 32; +pub const MAX_SIZE_NAME: usize = 64; +pub const MAX_SIZE_URI: usize = 128; pub const WSOL: Pubkey = pubkey!("So11111111111111111111111111111111111111112"); pub const MSOL: Pubkey = pubkey!("mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So"); diff --git a/anchor/programs/glam/src/error.rs b/anchor/programs/glam/src/error.rs index 92bc12d0..44fdb2dc 100644 --- a/anchor/programs/glam/src/error.rs +++ b/anchor/programs/glam/src/error.rs @@ -7,17 +7,23 @@ pub enum AccessError { #[msg("Integration is disabled")] IntegrationDisabled, + + #[msg("Wrong state account type")] + WrongStateType, } #[error_code] pub enum StateError { - #[msg("Name too long: max 50 chars")] + #[msg("Invalid account type")] + InvalidAccountType, + + #[msg("Name too long: max 64 chars")] InvalidName, - #[msg("Symbol too long: max 50 chars")] + #[msg("Symbol too long: max 32 chars")] InvalidSymbol, - #[msg("Uri too long: max 20")] + #[msg("Uri too long: max 128 chars")] InvalidUri, #[msg("Too many assets: max 100")] diff --git a/anchor/programs/glam/src/instructions/drift.rs b/anchor/programs/glam/src/instructions/drift.rs index fcf0293f..d550ab41 100644 --- a/anchor/programs/glam/src/instructions/drift.rs +++ b/anchor/programs/glam/src/instructions/drift.rs @@ -46,7 +46,7 @@ pub struct DriftInitialize<'info> { } #[access_control(acl::check_access(&ctx.accounts.state, &ctx.accounts.signer.key, Permission::DriftInitialize))] -#[access_control(acl::check_integration(&ctx.accounts.state, IntegrationName::Drift))] +#[access_control(acl::check_integration(&ctx.accounts.state, Integration::Drift))] #[vault_signer_seeds] pub fn initialize_handler(ctx: Context) -> Result<()> { initialize_user_stats(CpiContext::new_with_signer( @@ -102,7 +102,7 @@ pub struct DriftUpdate<'info> { } #[access_control(acl::check_access(&ctx.accounts.state, &ctx.accounts.signer.key, Permission::DriftUpdateUser))] -#[access_control(acl::check_integration(&ctx.accounts.state, IntegrationName::Drift))] +#[access_control(acl::check_integration(&ctx.accounts.state, Integration::Drift))] #[vault_signer_seeds] pub fn update_user_custom_margin_ratio_handler( ctx: Context, @@ -126,7 +126,7 @@ pub fn update_user_custom_margin_ratio_handler( } #[access_control(acl::check_access(&ctx.accounts.state, &ctx.accounts.signer.key, Permission::DriftUpdateUser))] -#[access_control(acl::check_integration(&ctx.accounts.state, IntegrationName::Drift))] +#[access_control(acl::check_integration(&ctx.accounts.state, Integration::Drift))] #[vault_signer_seeds] pub fn update_user_margin_trading_enabled_handler( ctx: Context, @@ -150,7 +150,7 @@ pub fn update_user_margin_trading_enabled_handler( } #[access_control(acl::check_access(&ctx.accounts.state, &ctx.accounts.signer.key, Permission::DriftUpdateUser))] -#[access_control(acl::check_integration(&ctx.accounts.state, IntegrationName::Drift))] +#[access_control(acl::check_integration(&ctx.accounts.state, Integration::Drift))] #[vault_signer_seeds] pub fn update_user_delegate_handler( ctx: Context, @@ -204,7 +204,7 @@ pub struct DriftDeposit<'info> { } #[access_control(acl::check_access(&ctx.accounts.state, &ctx.accounts.signer.key, Permission::DriftDeposit))] -#[access_control(acl::check_integration(&ctx.accounts.state, IntegrationName::Drift))] +#[access_control(acl::check_integration(&ctx.accounts.state, Integration::Drift))] #[vault_signer_seeds] pub fn deposit_handler<'c: 'info, 'info>( ctx: Context<'_, '_, 'c, 'info, DriftDeposit<'info>>, @@ -267,7 +267,7 @@ pub struct DriftWithdraw<'info> { } #[access_control(acl::check_access(&ctx.accounts.state, &ctx.accounts.signer.key, Permission::DriftWithdraw))] -#[access_control(acl::check_integration(&ctx.accounts.state, IntegrationName::Drift))] +#[access_control(acl::check_integration(&ctx.accounts.state, Integration::Drift))] #[vault_signer_seeds] pub fn withdraw_handler<'c: 'info, 'info>( ctx: Context<'_, '_, 'c, 'info, DriftWithdraw<'info>>, @@ -324,7 +324,7 @@ pub struct DriftDeleteUser<'info> { } #[access_control(acl::check_access(&ctx.accounts.state, &ctx.accounts.signer.key, Permission::DriftDeleteUser))] -#[access_control(acl::check_integration(&ctx.accounts.state, IntegrationName::Drift))] +#[access_control(acl::check_integration(&ctx.accounts.state, Integration::Drift))] #[vault_signer_seeds] pub fn delete_user_handler(ctx: Context) -> Result<()> { delete_user(CpiContext::new_with_signer( @@ -365,7 +365,7 @@ pub struct DriftPlaceOrders<'info> { } #[access_control(acl::check_access(&ctx.accounts.state, &ctx.accounts.signer.key, Permission::DriftPlaceOrders))] -#[access_control(acl::check_integration(&ctx.accounts.state, IntegrationName::Drift))] +#[access_control(acl::check_integration(&ctx.accounts.state, Integration::Drift))] #[vault_signer_seeds] pub fn place_orders_handler<'c: 'info, 'info>( ctx: Context<'_, '_, 'c, 'info, DriftPlaceOrders<'info>>, @@ -452,7 +452,7 @@ pub struct DriftCancelOrders<'info> { } #[access_control(acl::check_access(&ctx.accounts.state, &ctx.accounts.signer.key, Permission::DriftCancelOrders))] -#[access_control(acl::check_integration(&ctx.accounts.state, IntegrationName::Drift))] +#[access_control(acl::check_integration(&ctx.accounts.state, Integration::Drift))] #[vault_signer_seeds] pub fn cancel_orders_handler<'c: 'info, 'info>( ctx: Context<'_, '_, 'c, 'info, DriftCancelOrders<'info>>, diff --git a/anchor/programs/glam/src/instructions/investor.rs b/anchor/programs/glam/src/instructions/investor.rs index 15bf83d4..2c0ddb84 100644 --- a/anchor/programs/glam/src/instructions/investor.rs +++ b/anchor/programs/glam/src/instructions/investor.rs @@ -90,7 +90,7 @@ pub fn subscribe_handler<'c: 'info, 'info>( skip_state: bool, ) -> Result<()> { let state = &ctx.accounts.state; - require!(state.is_enabled(), StateError::Disabled); + require!(state.enabled, StateError::Disabled); let external_vault_accounts = state.get_pubkeys_from_engine_field(EngineFieldName::ExternalVaultAccounts); @@ -154,7 +154,7 @@ pub fn subscribe_handler<'c: 'info, 'info>( } } - let state_assets = state.assets().unwrap(); + let state_assets = &state.assets; let asset_idx = state_assets .iter() .position(|&asset| asset == ctx.accounts.asset.key()); @@ -175,7 +175,7 @@ pub fn subscribe_handler<'c: 'info, 'info>( let aum_components = get_aum_components( Action::Subscribe, - state_assets, + &state_assets, ctx.remaining_accounts, &ctx.accounts.vault, &external_vault_accounts, @@ -325,7 +325,7 @@ pub fn redeem_handler<'c: 'info, 'info>( skip_state: bool, ) -> Result<()> { let state = &ctx.accounts.state; - require!(state.is_enabled(), StateError::Disabled); + require!(state.enabled, StateError::Disabled); let external_vault_accounts = state.get_pubkeys_from_engine_field(EngineFieldName::ExternalVaultAccounts); @@ -397,11 +397,11 @@ pub fn redeem_handler<'c: 'info, 'info>( share_expo, ); - let assets = state.assets().unwrap(); + let assets = &state.assets; let skip_prices = should_transfer_everything || in_kind; let aum_components = get_aum_components( Action::Redeem, - assets, + &assets, ctx.remaining_accounts, &ctx.accounts.vault, &external_vault_accounts, diff --git a/anchor/programs/glam/src/instructions/jupiter.rs b/anchor/programs/glam/src/instructions/jupiter.rs index 4df85871..6d1f0794 100644 --- a/anchor/programs/glam/src/instructions/jupiter.rs +++ b/anchor/programs/glam/src/instructions/jupiter.rs @@ -189,7 +189,7 @@ fn is_lst<'info>(mint: &Pubkey, stake_pool_account: Option<&AccountInfo<'info>>) } #[access_control( - acl::check_integration(&ctx.accounts.state, IntegrationName::JupiterSwap) + acl::check_integration(&ctx.accounts.state, Integration::JupiterSwap) )] #[vault_signer_seeds] pub fn swap_handler<'c: 'info, 'info>( @@ -197,12 +197,11 @@ pub fn swap_handler<'c: 'info, 'info>( amount: u64, data: Vec, ) -> Result<()> { - let state = ctx.accounts.state.clone(); - let assets = ctx.accounts.state.assets_mut().unwrap(); + let state = &mut ctx.accounts.state; // Check if input and output mints are in the assets allowlist - let input_in_assets = assets.contains(&ctx.accounts.input_mint.key()); - let output_in_assets = assets.contains(&ctx.accounts.output_mint.key()); + let input_in_assets = state.assets.contains(&ctx.accounts.input_mint.key()); + let output_in_assets = state.assets.contains(&ctx.accounts.output_mint.key()); let input_is_lst = is_lst( &ctx.accounts.input_mint.key(), @@ -228,10 +227,10 @@ pub fn swap_handler<'c: 'info, 'info>( // TODO: should we add missing assets to the list after permission check? // This will gradually expand the assets allowlist and auto escalate JupiterSwapAllowlisted privilege over time if !input_in_assets { - assets.push(ctx.accounts.input_mint.key()); + state.assets.push(ctx.accounts.input_mint.key()); } if !output_in_assets { - assets.push(ctx.accounts.output_mint.key()); + state.assets.push(ctx.accounts.output_mint.key()); } // Parse Jupiter Swap accounts @@ -332,7 +331,7 @@ pub struct InitLockedVoterEscrow<'info> { acl::check_access(&ctx.accounts.state, &ctx.accounts.signer.key, Permission::StakeJup) )] #[access_control( - acl::check_integration(&ctx.accounts.state, IntegrationName::JupiterVote) + acl::check_integration(&ctx.accounts.state, Integration::JupiterVote) )] #[vault_signer_seeds] pub fn init_locked_voter_escrow_handler<'info>(ctx: Context) -> Result<()> { @@ -379,7 +378,7 @@ pub struct ToogleMaxLock<'info> { vec![Permission::StakeJup, Permission::UnstakeJup]) )] #[access_control( - acl::check_integration(&ctx.accounts.state, IntegrationName::JupiterVote) + acl::check_integration(&ctx.accounts.state, Integration::JupiterVote) )] #[vault_signer_seeds] pub fn toggle_max_lock_handler<'info>(ctx: Context, value: bool) -> Result<()> { @@ -430,7 +429,7 @@ pub struct IncreaseLockedAmount<'info> { acl::check_access(&ctx.accounts.state, &ctx.accounts.signer.key, Permission::StakeJup) )] #[access_control( - acl::check_integration(&ctx.accounts.state, IntegrationName::JupiterVote) + acl::check_integration(&ctx.accounts.state, Integration::JupiterVote) )] #[vault_signer_seeds] pub fn increase_locked_amount_handler<'info>( @@ -485,7 +484,7 @@ pub struct PartialUnstaking<'info> { acl::check_access(&ctx.accounts.state, &ctx.accounts.signer.key, Permission::UnstakeJup) )] #[access_control( - acl::check_integration(&ctx.accounts.state, IntegrationName::JupiterVote) + acl::check_integration(&ctx.accounts.state, Integration::JupiterVote) )] #[vault_signer_seeds] pub fn open_partial_unstaking_handler<'info>( @@ -515,7 +514,7 @@ pub fn open_partial_unstaking_handler<'info>( acl::check_access(&ctx.accounts.state, &ctx.accounts.signer.key, Permission::UnstakeJup) )] #[access_control( - acl::check_integration(&ctx.accounts.state, IntegrationName::JupiterVote) + acl::check_integration(&ctx.accounts.state, Integration::JupiterVote) )] #[vault_signer_seeds] pub fn merge_partial_unstaking_handler<'info>(ctx: Context) -> Result<()> { @@ -563,7 +562,7 @@ pub struct WithdrawAllStakedJup<'info> { acl::check_access(&ctx.accounts.state, &ctx.accounts.signer.key, Permission::UnstakeJup) )] #[access_control( - acl::check_integration(&ctx.accounts.state, IntegrationName::JupiterVote) + acl::check_integration(&ctx.accounts.state, Integration::JupiterVote) )] #[vault_signer_seeds] pub fn withdraw_all_staked_jup_handler<'info>(ctx: Context) -> Result<()> { @@ -618,7 +617,7 @@ pub struct WithdrawPartialUnstaking<'info> { acl::check_access(&ctx.accounts.state, &ctx.accounts.signer.key, Permission::UnstakeJup) )] #[access_control( - acl::check_integration(&ctx.accounts.state, IntegrationName::JupiterVote) + acl::check_integration(&ctx.accounts.state, Integration::JupiterVote) )] #[vault_signer_seeds] pub fn withdraw_partial_unstaking_handler<'info>( @@ -668,7 +667,7 @@ pub struct NewVote<'info> { acl::check_access(&ctx.accounts.state, &ctx.accounts.signer.key, Permission::VoteOnProposal) )] #[access_control( - acl::check_integration(&ctx.accounts.state, IntegrationName::JupiterVote) + acl::check_integration(&ctx.accounts.state, Integration::JupiterVote) )] #[vault_signer_seeds] pub fn new_vote_handler<'info>(ctx: Context) -> Result<()> { @@ -723,7 +722,7 @@ pub struct CastVote<'info> { acl::check_access(&ctx.accounts.state, &ctx.accounts.signer.key, Permission::VoteOnProposal) )] #[access_control( - acl::check_integration(&ctx.accounts.state, IntegrationName::JupiterVote) + acl::check_integration(&ctx.accounts.state, Integration::JupiterVote) )] #[vault_signer_seeds] pub fn cast_vote_handler<'info>(ctx: Context, side: u8) -> Result<()> { diff --git a/anchor/programs/glam/src/instructions/marinade.rs b/anchor/programs/glam/src/instructions/marinade.rs index 2321ed5f..07518700 100644 --- a/anchor/programs/glam/src/instructions/marinade.rs +++ b/anchor/programs/glam/src/instructions/marinade.rs @@ -14,7 +14,7 @@ use marinade::state::delayed_unstake_ticket::TicketAccountData; #[access_control( acl::check_access(&ctx.accounts.state, &ctx.accounts.signer.key, Permission::Stake) )] -#[access_control(acl::check_integration(&ctx.accounts.state, IntegrationName::Marinade))] +#[access_control(acl::check_integration(&ctx.accounts.state, Integration::Marinade))] #[vault_signer_seeds] pub fn marinade_deposit_sol_handler<'c: 'info, 'info>( ctx: Context, @@ -45,7 +45,7 @@ pub fn marinade_deposit_sol_handler<'c: 'info, 'info>( #[access_control( acl::check_access(&ctx.accounts.state, &ctx.accounts.signer.key, Permission::Stake) )] -#[access_control(acl::check_integration(&ctx.accounts.state, IntegrationName::Marinade))] +#[access_control(acl::check_integration(&ctx.accounts.state, Integration::Marinade))] #[vault_signer_seeds] pub fn marinade_deposit_stake_handler<'c: 'info, 'info>( ctx: Context, @@ -78,7 +78,7 @@ pub fn marinade_deposit_stake_handler<'c: 'info, 'info>( #[access_control( acl::check_access(&ctx.accounts.state, &ctx.accounts.signer.key, Permission::Unstake) )] -#[access_control(acl::check_integration(&ctx.accounts.state, IntegrationName::Marinade))] +#[access_control(acl::check_integration(&ctx.accounts.state, Integration::Marinade))] #[vault_signer_seeds] pub fn delayed_unstake_handler<'c: 'info, 'info>( ctx: Context, @@ -142,7 +142,7 @@ pub fn delayed_unstake_handler<'c: 'info, 'info>( #[access_control( acl::check_access(&ctx.accounts.state, &ctx.accounts.signer.key, Permission::Unstake) )] -#[access_control(acl::check_integration(&ctx.accounts.state, IntegrationName::Marinade))] +#[access_control(acl::check_integration(&ctx.accounts.state, Integration::Marinade))] #[vault_signer_seeds] pub fn claim_tickets_handler<'info>( ctx: Context<'_, '_, '_, 'info, MarinadeClaimTickets<'info>>, @@ -180,7 +180,7 @@ pub fn claim_tickets_handler<'info>( #[access_control( acl::check_access(&ctx.accounts.state, &ctx.accounts.signer.key, Permission::LiquidUnstake) )] -#[access_control(acl::check_integration(&ctx.accounts.state, IntegrationName::Marinade))] +#[access_control(acl::check_integration(&ctx.accounts.state, Integration::Marinade))] #[vault_signer_seeds] pub fn liquid_unstake_handler<'c: 'info, 'info>( ctx: Context, diff --git a/anchor/programs/glam/src/instructions/share_class.rs b/anchor/programs/glam/src/instructions/share_class.rs index 7592bc47..12c7eccd 100644 --- a/anchor/programs/glam/src/instructions/share_class.rs +++ b/anchor/programs/glam/src/instructions/share_class.rs @@ -57,8 +57,9 @@ pub struct AddShareClass<'info> { #[account(mut, constraint = state.owner == signer.key() @ AccessError::NotAuthorized)] pub state: Box>, - #[account(mut)] - pub metadata: Box>, + /// CHECK: Metadata + #[account(mut, seeds = [SEED_METADATA.as_bytes(), state.key().as_ref()], bump)] + pub metadata: AccountInfo<'info>, #[account(mut)] pub signer: Signer<'info>, @@ -134,10 +135,16 @@ pub fn add_share_class_handler<'c: 'info, 'info>( let share_class_fields = Vec::::from(&share_class_metadata.clone()); // - // Add share class data to openfunds + // Add share class data metadata, currently only openfunds metadata is supported // - let openfunds = &mut ctx.accounts.metadata; - openfunds.share_classes.push(share_class_fields.clone()); + if let Some(metadata) = state.metadata.clone() { + if metadata.template == MetadataType::Openfunds { + let mut data_slice = ctx.accounts.metadata.data.borrow_mut(); // Borrow the mutable data + let data: &mut [u8] = &mut *data_slice; // Dereference and convert to `&mut [u8]` + let mut openfunds = OpenfundsMetadataAccount::try_deserialize(&mut &data[..])?; // Pass as `&mut &[u8]` + openfunds.share_classes.push(share_class_fields.clone()); + } + } // // Initialize share class mint, extensions and metadata @@ -360,7 +367,7 @@ pub struct SetTokenAccountsStates<'info> { } #[access_control(acl::check_access(&ctx.accounts.state, &ctx.accounts.signer.key, Permission::SetTokenAccountsStates))] -#[access_control(acl::check_integration(&ctx.accounts.state, IntegrationName::Mint))] +#[access_control(acl::check_state_type(&ctx.accounts.state, AccountType::Mint))] #[share_class_signer_seeds] pub fn set_token_accounts_states_handler<'info>( ctx: Context<'_, '_, 'info, 'info, SetTokenAccountsStates<'info>>, @@ -461,7 +468,7 @@ pub struct ForceTransferShare<'info> { } #[access_control(acl::check_access(&ctx.accounts.state, &ctx.accounts.signer.key, Permission::ForceTransferShare))] -#[access_control(acl::check_integration(&ctx.accounts.state, IntegrationName::Mint))] +#[access_control(acl::check_state_type(&ctx.accounts.state, AccountType::Mint))] #[share_class_signer_seeds] pub fn force_transfer_share_handler( ctx: Context, @@ -530,7 +537,7 @@ pub struct BurnShare<'info> { } #[access_control(acl::check_access(&ctx.accounts.state, &ctx.accounts.signer.key, Permission::BurnShare))] -#[access_control(acl::check_integration(&ctx.accounts.state, IntegrationName::Mint))] +#[access_control(acl::check_state_type(&ctx.accounts.state, AccountType::Mint))] #[share_class_signer_seeds] pub fn burn_share_handler(ctx: Context, share_class_id: u8, amount: u64) -> Result<()> { #[cfg(not(feature = "mainnet"))] @@ -589,7 +596,7 @@ pub struct MintShare<'info> { } #[access_control(acl::check_access(&ctx.accounts.state, &ctx.accounts.signer.key, Permission::MintShare))] -#[access_control(acl::check_integration(&ctx.accounts.state, IntegrationName::Mint))] +#[access_control(acl::check_state_type(&ctx.accounts.state, AccountType::Mint))] #[share_class_signer_seeds] pub fn mint_share_handler<'info>( ctx: Context<'_, '_, '_, 'info, MintShare<'info>>, @@ -686,8 +693,9 @@ pub struct CloseShareClass<'info> { )] pub extra_account_meta_list: UncheckedAccount<'info>, - #[account(mut)] - pub metadata: Box>, + /// CHECK: Metadata + #[account(mut, seeds = [SEED_METADATA.as_bytes(), state.key().as_ref()], bump)] + pub metadata: AccountInfo<'info>, #[account(mut)] pub signer: Signer<'info>, @@ -721,10 +729,14 @@ pub fn close_share_class_handler(ctx: Context, share_class_id: ctx.accounts.state.mints.remove(share_class_id as usize); - ctx.accounts - .metadata - .share_classes - .remove(share_class_id as usize); + if let Some(metadata) = ctx.accounts.state.metadata.clone() { + if metadata.template == MetadataType::Openfunds { + let mut data_slice = ctx.accounts.metadata.data.borrow_mut(); // Borrow the mutable data + let data: &mut [u8] = &mut *data_slice; // Dereference and convert to `&mut [u8]` + let mut openfunds = OpenfundsMetadataAccount::try_deserialize(&mut &data[..])?; + openfunds.share_classes.remove(share_class_id as usize); + } + } close_account_info( ctx.accounts.extra_account_meta_list.to_account_info(), diff --git a/anchor/programs/glam/src/instructions/stake.rs b/anchor/programs/glam/src/instructions/stake.rs index 57694949..0e18c7bb 100644 --- a/anchor/programs/glam/src/instructions/stake.rs +++ b/anchor/programs/glam/src/instructions/stake.rs @@ -38,7 +38,7 @@ pub struct InitializeAndDelegateStake<'info> { acl::check_access(&ctx.accounts.state, &ctx.accounts.signer.key, Permission::Stake) )] #[access_control( - acl::check_integration(&ctx.accounts.state, IntegrationName::NativeStaking) + acl::check_integration(&ctx.accounts.state, Integration::NativeStaking) )] #[vault_signer_seeds] pub fn initialize_and_delegate_stake_handler<'c: 'info, 'info>( @@ -140,7 +140,7 @@ pub struct DeactivateStakeAccounts<'info> { acl::check_access(&ctx.accounts.state, &ctx.accounts.signer.key, Permission::Unstake) )] #[access_control( - acl::check_integration(&ctx.accounts.state, IntegrationName::NativeStaking) + acl::check_integration(&ctx.accounts.state, Integration::NativeStaking) )] #[vault_signer_seeds] pub fn deactivate_stake_accounts_handler<'info>( @@ -181,7 +181,7 @@ pub struct WithdrawFromStakeAccounts<'info> { acl::check_access(&ctx.accounts.state, &ctx.accounts.signer.key, Permission::Unstake) )] #[access_control( - acl::check_integration(&ctx.accounts.state, IntegrationName::NativeStaking) + acl::check_integration(&ctx.accounts.state, Integration::NativeStaking) )] #[vault_signer_seeds] pub fn withdraw_from_stake_accounts_handler<'info>( @@ -238,7 +238,7 @@ pub struct MergeStakeAccounts<'info> { acl::check_access(&ctx.accounts.state, &ctx.accounts.signer.key, Permission::Stake) )] #[access_control( - acl::check_integration(&ctx.accounts.state, IntegrationName::NativeStaking) + acl::check_integration(&ctx.accounts.state, Integration::NativeStaking) )] #[vault_signer_seeds] pub fn merge_stake_accounts_handler<'c: 'info, 'info>( @@ -296,7 +296,7 @@ pub struct SplitStakeAccount<'info> { acl::check_access(&ctx.accounts.state, &ctx.accounts.signer.key, Permission::Unstake) )] #[access_control( - acl::check_integration(&ctx.accounts.state, IntegrationName::NativeStaking) + acl::check_integration(&ctx.accounts.state, Integration::NativeStaking) )] #[vault_signer_seeds] pub fn split_stake_account_handler<'c: 'info, 'info>( @@ -395,7 +395,7 @@ pub struct RedelegateStake<'info> { acl::check_access(&ctx.accounts.state, &ctx.accounts.signer.key, Permission::Stake) )] #[access_control( - acl::check_integration(&ctx.accounts.state, IntegrationName::NativeStaking) + acl::check_integration(&ctx.accounts.state, Integration::NativeStaking) )] #[vault_signer_seeds] pub fn redelegate_stake_handler<'c: 'info, 'info>( diff --git a/anchor/programs/glam/src/instructions/state.rs b/anchor/programs/glam/src/instructions/state.rs index cbcb90a7..82c13e95 100644 --- a/anchor/programs/glam/src/instructions/state.rs +++ b/anchor/programs/glam/src/instructions/state.rs @@ -3,7 +3,7 @@ use crate::{ error::{AccessError, StateError}, state::*, }; -use anchor_lang::{prelude::*, system_program}; +use anchor_lang::{prelude::*, solana_program, system_program, Discriminator}; use anchor_spl::{ token::{close_account as close_token_account, CloseAccount as CloseTokenAccount, Token}, token_2022::{ @@ -29,15 +29,16 @@ pub struct InitializeState<'info> { )] pub state: Box>, - #[account(init, seeds = [SEED_METADATA.as_bytes(), state.key().as_ref()], bump, payer = signer, space = MetadataAccount::INIT_SIZE)] - pub metadata: Box>, - #[account(mut, seeds = [SEED_VAULT.as_bytes(), state.key().as_ref()], bump)] pub vault: SystemAccount<'info>, #[account(mut)] pub signer: Signer<'info>, + /// CHECK: Manually initialized metadata account according to template provided in state model + #[account(mut, seeds = [SEED_METADATA.as_bytes(), state.key().as_ref()], bump)] + pub metadata: AccountInfo<'info>, + pub system_program: Program<'info, System>, } @@ -50,52 +51,69 @@ pub fn initialize_state_handler<'c: 'info, 'info>( // let state = &mut ctx.accounts.state; let model = state_model.clone(); + + state.account_type = model.account_type.ok_or(StateError::InvalidAccountType)?; + if let Some(name) = model.name { - require!(name.len() < MAX_SIZE_NAME, StateError::InvalidName); + require!(name.len() <= MAX_SIZE_NAME, StateError::InvalidName); state.name = name; } - if let Some(fund_uri) = model.uri { - require!(fund_uri.len() < MAX_SIZE_URI, StateError::InvalidUri); - state.uri = fund_uri; + if let Some(uri) = model.uri { + require!(uri.len() < MAX_SIZE_URI, StateError::InvalidUri); + state.uri = uri; } - if let Some(metadata_uri) = model.metadata_uri { - require!(metadata_uri.len() < MAX_SIZE_URI, StateError::InvalidUri); - state.metadata_uri = metadata_uri; + if let Some(metadata) = model.metadata { + require!(metadata.uri.len() < MAX_SIZE_URI, StateError::InvalidUri); + state.metadata = Some(Metadata { + template: metadata.template, + pubkey: metadata.pubkey, + uri: metadata.uri, + }); + + if metadata.template == MetadataType::Openfunds { + let rent = Rent::get()?; + let space = 8 + OpenfundsMetadataAccount::INIT_SIZE; + let lamports = rent.minimum_balance(space); + + let create_account_ix = solana_program::system_instruction::create_account( + ctx.accounts.signer.key, + ctx.accounts.metadata.key, + lamports, + space as u64, + &crate::ID, + ); + + solana_program::program::invoke_signed( + &create_account_ix, + &[ + ctx.accounts.signer.to_account_info(), + ctx.accounts.metadata.to_account_info(), + ctx.accounts.system_program.to_account_info(), + ], + &[&[ + SEED_METADATA.as_bytes(), + state.key().as_ref(), + &[ctx.bumps.metadata], + ]], + )?; + + let discriminator = OpenfundsMetadataAccount::discriminator(); + let mut metadata_data = ctx.accounts.metadata.try_borrow_mut_data()?; + metadata_data[..8].copy_from_slice(&discriminator); + + let openfunds_metadata = OpenfundsMetadataAccount::from(state_model); + openfunds_metadata.try_serialize(&mut &mut metadata_data[8..])?; + } } state.vault = ctx.accounts.vault.key(); - state.metadata = ctx.accounts.metadata.key(); state.owner = ctx.accounts.signer.key(); - - // - // Set state params - // - // state.params[0][0]: assets allowlists - // state.params[0][1]: integration acls - // - state.params = vec![vec![ - EngineField { - name: EngineFieldName::Assets, - value: EngineFieldValue::VecPubkey { val: model.assets }, - }, - EngineField { - name: EngineFieldName::IntegrationAcls, - value: EngineFieldValue::VecIntegrationAcl { - val: model.integration_acls, - }, - }, - ]]; - - // - // Initialize metadata account - // - let metadata = &mut ctx.accounts.metadata; - let openfunds_metadata = MetadataAccount::from(state_model); - metadata.state_pubkey = state.key(); - metadata.company = openfunds_metadata.company; - metadata.fund = openfunds_metadata.fund; - metadata.share_classes = openfunds_metadata.share_classes; - metadata.fund_managers = openfunds_metadata.fund_managers; + state.created = Clock::get()?.unix_timestamp; + state.enabled = model.enabled.unwrap_or(true); + state.assets = model.assets.unwrap_or_default(); + state.integrations = model.integrations.unwrap_or_default(); + state.delegate_acls = model.delegate_acls.unwrap_or_default(); + state.params = vec![vec![]]; msg!("State account created: {}", ctx.accounts.state.key()); Ok(()) @@ -124,10 +142,7 @@ pub fn update_state_handler<'c: 'info, 'info>( state.name = name; } if let Some(uri) = state_model.uri { - require!( - uri.as_bytes().len() <= MAX_SIZE_URI, - StateError::InvalidName - ); + require!(uri.as_bytes().len() <= MAX_SIZE_URI, StateError::InvalidUri); state.uri = uri; } @@ -137,162 +152,78 @@ pub fn update_state_handler<'c: 'info, 'info>( } } - if !state_model.assets.is_empty() { - let assets = state.assets_mut().unwrap(); - assets.clear(); - assets.extend(state_model.assets.clone()); + if let Some(assets) = state_model.assets { + state.assets = assets; } - // One of the engine field in `fund.params[0]` stores the existing acls of the fund, - // and `fund_model.acls` is new acls to be upserted or deleted. - // - // For each acl in `fund_model.acls` we check two cases: - // - // 1) a fund acl with same pubkey exists - // - acl.permissions is empty, delete the fund acl - // - acl.permissions is not empty, update permissions - // - // 2) a fund acl with same pubkey doesn't exist - // - add the acl - if !state_model.delegate_acls.is_empty() { - // Add the acls field if it doesn't exist - let delegate_acls_field_exists = state.params[0] - .iter() - .any(|field| field.name == EngineFieldName::DelegateAcls); - - if !delegate_acls_field_exists { - msg!("Adding acls field to state params"); - state.params[0].push(EngineField { - name: EngineFieldName::DelegateAcls, - value: EngineFieldValue::VecDelegateAcl { val: Vec::new() }, - }); - } - - let to_delete: Vec = state_model - .delegate_acls - .clone() - .iter() - .filter(|acl| acl.permissions.is_empty()) - .map(|acl| acl.pubkey) - .collect(); - if !to_delete.is_empty() { - for EngineField { name, value } in &mut state.params[0] { - if let (EngineFieldName::DelegateAcls, EngineFieldValue::VecDelegateAcl { val }) = - (name, value) - { - val.retain(|acl| !to_delete.contains(&acl.pubkey)); - } - } - } - let to_upsert = state_model - .delegate_acls - .clone() - .into_iter() - .filter(|acl| !acl.permissions.is_empty()); - - for new_acl in to_upsert { - for EngineField { name, value } in &mut state.params[0] { - if let (EngineFieldName::DelegateAcls, EngineFieldValue::VecDelegateAcl { val }) = - (name, value) - { - if let Some(existing_acl) = - val.iter_mut().find(|acl| acl.pubkey == new_acl.pubkey) - { - existing_acl.permissions = new_acl.permissions.clone(); - } else { - val.push(new_acl.clone()); - } - } - } - } + if let Some(integrations) = state_model.integrations { + state.integrations = integrations; } - // Update integration acls for the state - if !state_model.integration_acls.is_empty() { - // Check if the integrations field exists - // Add the integrations field if it doesn't exist - let integration_acl_field_exists = state.params[0] - .iter() - .any(|field| field.name == EngineFieldName::IntegrationAcls); - - if !integration_acl_field_exists { - msg!("Adding integrations field to state params"); - state.params[0].push(EngineField { - name: EngineFieldName::IntegrationAcls, - value: EngineFieldValue::VecIntegrationAcl { val: Vec::new() }, - }); - } - - for EngineField { name, value } in &mut state.params[0] { - if let (EngineFieldName::IntegrationAcls, EngineFieldValue::VecIntegrationAcl { val }) = - (name, value) - { - val.clear(); - val.extend(state_model.integration_acls.clone()); + // update or add delegate acls + // if permissions is empty, delete the entry + if let Some(delegate_acls) = state_model.delegate_acls { + state.delegate_acls.retain_mut(|da| { + if let Some(d) = delegate_acls.iter().find(|d| d.pubkey == da.pubkey) { + da.permissions = d.permissions.clone(); + !d.permissions.is_empty() + } else { + true } - } + }); } - if !state_model.drift_market_indexes_perp.is_empty() { - let mut found = false; - for EngineField { name, value } in &mut state.params[0] { - if let (EngineFieldName::DriftMarketIndexesPerp, EngineFieldValue::VecU32 { val }) = - (name, value) - { - val.clear(); - val.extend(state_model.drift_market_indexes_perp.clone()); - found = true; - } - } - if !found { + if let Some(market_indexes_perp) = state_model.drift_market_indexes_perp { + let Some(EngineField { value, .. }) = state.params[0] + .iter_mut() + .find(|f| f.name == EngineFieldName::DriftMarketIndexesPerp) + else { state.params[0].push(EngineField { name: EngineFieldName::DriftMarketIndexesPerp, value: EngineFieldValue::VecU32 { - val: state_model.drift_market_indexes_perp, + val: market_indexes_perp.clone(), }, }); + return Ok(()); + }; + + if let EngineFieldValue::VecU32 { val } = value { + *val = market_indexes_perp; } } - if !state_model.drift_market_indexes_spot.is_empty() { - let mut found = false; - for EngineField { name, value } in &mut state.params[0] { - if let (EngineFieldName::DriftMarketIndexesSpot, EngineFieldValue::VecU32 { val }) = - (name, value) - { - val.clear(); - val.extend(state_model.drift_market_indexes_spot.clone()); - found = true; - } - } - if !found { + if let Some(market_indexes_spot) = state_model.drift_market_indexes_spot { + let Some(EngineField { value, .. }) = state.params[0] + .iter_mut() + .find(|f| f.name == EngineFieldName::DriftMarketIndexesSpot) + else { state.params[0].push(EngineField { name: EngineFieldName::DriftMarketIndexesSpot, value: EngineFieldValue::VecU32 { - val: state_model.drift_market_indexes_spot, + val: market_indexes_spot.clone(), }, }); + return Ok(()); + }; + + if let EngineFieldValue::VecU32 { val } = value { + *val = market_indexes_spot; } } - if !state_model.drift_order_types.is_empty() { - let mut found = false; - for EngineField { name, value } in &mut state.params[0] { - if let (EngineFieldName::DriftOrderTypes, EngineFieldValue::VecU32 { val }) = - (name, value) - { - val.clear(); - val.extend(state_model.drift_order_types.clone()); - found = true; - } - } - if !found { - state.params[0].push(EngineField { - name: EngineFieldName::DriftOrderTypes, - value: EngineFieldValue::VecU32 { - val: state_model.drift_order_types, - }, + if let Some(drift_order_types) = state_model.drift_order_types { + let idx = state.params[0] + .iter() + .position(|f| f.name == EngineFieldName::DriftOrderTypes) + .unwrap_or_else(|| { + state.params[0].push(EngineField { + name: EngineFieldName::DriftOrderTypes, + value: EngineFieldValue::VecU32 { val: Vec::new() }, + }); + state.params[0].len() - 1 }); + if let EngineFieldValue::VecU32 { val } = &mut state.params[0][idx].value { + *val = drift_order_types; } } @@ -304,8 +235,9 @@ pub struct CloseState<'info> { #[account(mut, close = signer, constraint = state.owner == signer.key() @ AccessError::NotAuthorized)] pub state: Account<'info, StateAccount>, - #[account(mut, close = signer)] - pub metadata: Account<'info, MetadataAccount>, + /// CHECK: Manually deserialized + #[account(mut, seeds = [SEED_METADATA.as_bytes(), state.key().as_ref()], bump)] + pub metadata: AccountInfo<'info>, #[account(mut, seeds = [SEED_VAULT.as_bytes(), state.key().as_ref()], bump)] pub vault: SystemAccount<'info>, @@ -338,6 +270,11 @@ pub fn close_state_handler(ctx: Context) -> Result<()> { )?; } + close_account_info( + ctx.accounts.metadata.to_account_info(), + ctx.accounts.signer.to_account_info(), + )?; + msg!("State account closed: {}", ctx.accounts.state.key()); Ok(()) } diff --git a/anchor/programs/glam/src/lib.rs b/anchor/programs/glam/src/lib.rs index 8cced6dd..4cdc3fde 100644 --- a/anchor/programs/glam/src/lib.rs +++ b/anchor/programs/glam/src/lib.rs @@ -169,7 +169,7 @@ pub mod glam { /// - Permission::MintShare /// /// # Integration required - /// - IntegrationName::Mint + /// - Integration::Mint pub fn mint_share<'c: 'info, 'info>( ctx: Context<'_, '_, 'c, 'info, MintShare<'info>>, share_class_id: u8, @@ -189,7 +189,7 @@ pub mod glam { /// - Permission::ForceTransferShare /// /// # Integration required - /// - IntegrationName::Mint + /// - Integration::Mint pub fn force_transfer_share( ctx: Context, share_class_id: u8, @@ -209,7 +209,7 @@ pub mod glam { /// - Permission::BurnShare /// /// # Integration required - /// - IntegrationName::Mint + /// - Integration::Mint pub fn burn_share(ctx: Context, share_class_id: u8, amount: u64) -> Result<()> { share_class::burn_share_handler(ctx, share_class_id, amount) } @@ -225,7 +225,7 @@ pub mod glam { /// - Permission::SetTokenAccountsStates /// /// # Integration required - /// - IntegrationName::Mint + /// - Integration::Mint pub fn set_token_accounts_states<'info>( ctx: Context<'_, '_, 'info, 'info, SetTokenAccountsStates<'info>>, share_class_id: u8, @@ -282,7 +282,7 @@ pub mod glam { /// - Permission::DriftInitialize /// /// # Integration required - /// - IntegrationName::Drift + /// - Integration::Drift pub fn drift_initialize(ctx: Context) -> Result<()> { drift::initialize_handler(ctx) } @@ -298,7 +298,7 @@ pub mod glam { /// - Permission::DriftUpdateUser /// /// # Integration required - /// - IntegrationName::Drift + /// - Integration::Drift pub fn drift_update_user_custom_margin_ratio( ctx: Context, sub_account_id: u16, @@ -318,7 +318,7 @@ pub mod glam { /// - Permission::DriftUpdateUser /// /// # Integration required - /// - IntegrationName::Drift + /// - Integration::Drift pub fn drift_update_user_margin_trading_enabled( ctx: Context, sub_account_id: u16, @@ -342,7 +342,7 @@ pub mod glam { /// - Permission::DriftUpdateUser /// /// # Integration required - /// - IntegrationName::Drift + /// - Integration::Drift pub fn drift_update_user_delegate( ctx: Context, sub_account_id: u16, @@ -362,7 +362,7 @@ pub mod glam { /// - Permission::DriftDeposit /// /// # Integration required - /// - IntegrationName::Drift + /// - Integration::Drift pub fn drift_deposit<'c: 'info, 'info>( ctx: Context<'_, '_, 'c, 'info, DriftDeposit<'info>>, market_index: u16, @@ -382,7 +382,7 @@ pub mod glam { /// - Permission::DriftWithdraw /// /// # Integration required - /// - IntegrationName::Drift + /// - Integration::Drift pub fn drift_withdraw<'c: 'info, 'info>( ctx: Context<'_, '_, 'c, 'info, DriftWithdraw<'info>>, market_index: u16, @@ -400,7 +400,7 @@ pub mod glam { /// - Permission::DriftDeleteUser /// /// # Integration required - /// - IntegrationName::Drift + /// - Integration::Drift pub fn drift_delete_user(ctx: Context) -> Result<()> { drift::delete_user_handler(ctx) } @@ -416,7 +416,7 @@ pub mod glam { /// - Additional permission Permission::DriftSpotMarket or Permission::DriftPerpMarket is required depending on market type. /// /// # Integration required - /// - IntegrationName::Drift + /// - Integration::Drift pub fn drift_place_orders<'c: 'info, 'info>( ctx: Context<'_, '_, 'c, 'info, DriftPlaceOrders<'info>>, order_params: Vec, @@ -436,7 +436,7 @@ pub mod glam { /// - Permission::DriftCancelOrders /// /// # Integration required - /// - IntegrationName::Drift + /// - Integration::Drift pub fn drift_cancel_orders<'c: 'info, 'info>( ctx: Context<'_, '_, 'c, 'info, DriftCancelOrders<'info>>, market_type: Option, @@ -460,7 +460,7 @@ pub mod glam { /// - Permission::Stake /// /// # Integration required - /// - IntegrationName::Marinade + /// - Integration::Marinade pub fn marinade_deposit_sol(ctx: Context, lamports: u64) -> Result<()> { marinade::marinade_deposit_sol_handler(ctx, lamports) } @@ -475,7 +475,7 @@ pub mod glam { /// - Permission::Stake /// /// # Integration required - /// - IntegrationName::Marinade + /// - Integration::Marinade pub fn marinade_deposit_stake( ctx: Context, validator_idx: u32, @@ -493,7 +493,7 @@ pub mod glam { /// - Permission::LiquidUnstake /// /// # Integration required - /// - IntegrationName::Marinade + /// - Integration::Marinade pub fn marinade_liquid_unstake( ctx: Context, msol_amount: u64, @@ -513,7 +513,7 @@ pub mod glam { /// - Permission::Unstake /// /// # Integration required - /// - IntegrationName::Marinade + /// - Integration::Marinade pub fn marinade_delayed_unstake( ctx: Context, msol_amount: u64, @@ -532,7 +532,7 @@ pub mod glam { /// - Permission::Unstake /// /// # Integration required - /// - IntegrationName::Marinade + /// - Integration::Marinade pub fn marinade_claim_tickets<'info>( ctx: Context<'_, '_, '_, 'info, MarinadeClaimTickets<'info>>, ) -> Result<()> { @@ -553,7 +553,7 @@ pub mod glam { /// - Permission::Stake /// /// # Integration required - /// - IntegrationName::SplStakePool or IntegrationName::SanctumStakePool, depending on the stake pool program used. + /// - Integration::SplStakePool or Integration::SanctumStakePool, depending on the stake pool program used. pub fn stake_pool_deposit_sol(ctx: Context, lamports: u64) -> Result<()> { stake_pool::deposit_sol_handler(ctx, lamports) } @@ -567,7 +567,7 @@ pub mod glam { /// - Permission::Stake /// /// # Integration required - /// - IntegrationName::SplStakePool or IntegrationName::SanctumStakePool, depending on the stake pool program used. + /// - Integration::SplStakePool or Integration::SanctumStakePool, depending on the stake pool program used. pub fn stake_pool_deposit_stake(ctx: Context) -> Result<()> { stake_pool::deposit_stake_handler(ctx) } @@ -582,7 +582,7 @@ pub mod glam { /// - Permission::LiquidUnstake /// /// # Integration required - /// - IntegrationName::SplStakePool or IntegrationName::SanctumStakePool, depending on the stake pool program used. + /// - Integration::SplStakePool or Integration::SanctumStakePool, depending on the stake pool program used. pub fn stake_pool_withdraw_sol( ctx: Context, pool_token_amount: u64, @@ -602,7 +602,7 @@ pub mod glam { /// - Permission::Unstake /// /// # Integration required - /// - IntegrationName::SplStakePool or IntegrationName::SanctumStakePool, depending on the stake pool program used. + /// - Integration::SplStakePool or Integration::SanctumStakePool, depending on the stake pool program used. pub fn stake_pool_withdraw_stake( ctx: Context, pool_token_amount: u64, @@ -633,7 +633,7 @@ pub mod glam { /// - Permission::Stake /// /// # Integration required - /// - IntegrationName::NativeStaking + /// - Integration::NativeStaking pub fn initialize_and_delegate_stake<'info>( ctx: Context<'_, '_, '_, 'info, InitializeAndDelegateStake<'info>>, lamports: u64, @@ -657,7 +657,7 @@ pub mod glam { /// - Permission::Unstake /// /// # Integration required - /// - IntegrationName::NativeStaking + /// - Integration::NativeStaking pub fn deactivate_stake_accounts<'info>( ctx: Context<'_, '_, '_, 'info, DeactivateStakeAccounts<'info>>, ) -> Result<()> { @@ -673,7 +673,7 @@ pub mod glam { /// - Permission::Unstake /// /// # Integration required - /// - IntegrationName::NativeStaking + /// - Integration::NativeStaking pub fn withdraw_from_stake_accounts<'info>( ctx: Context<'_, '_, '_, 'info, WithdrawFromStakeAccounts<'info>>, ) -> Result<()> { @@ -689,7 +689,7 @@ pub mod glam { /// - Permission::Stake /// /// # Integration required - /// - IntegrationName::NativeStaking + /// - Integration::NativeStaking pub fn merge_stake_accounts<'info>( ctx: Context<'_, '_, '_, 'info, MergeStakeAccounts<'info>>, ) -> Result<()> { @@ -708,7 +708,7 @@ pub mod glam { /// - Permission::Unstake /// /// # Integration required - /// - IntegrationName::NativeStaking + /// - Integration::NativeStaking pub fn split_stake_account<'info>( ctx: Context<'_, '_, '_, 'info, SplitStakeAccount<'info>>, lamports: u64, @@ -734,7 +734,7 @@ pub mod glam { /// - Permission::Unstake /// /// # Integration required - /// - IntegrationName::NativeStaking + /// - Integration::NativeStaking pub fn redelegate_stake<'info>( ctx: Context<'_, '_, '_, 'info, RedelegateStake<'info>>, new_stake_account_id: String, @@ -761,7 +761,7 @@ pub mod glam { /// - Permission::JupiterSwapLst: input and output assets are both LST. /// /// # Integration required - /// - IntegrationName::JupiterSwap + /// - Integration::JupiterSwap pub fn jupiter_swap<'c: 'info, 'info>( ctx: Context<'_, '_, 'c, 'info, JupiterSwap<'info>>, amount: u64, @@ -783,7 +783,7 @@ pub mod glam { /// - Permission::StakeJup /// /// # Integration required - /// - IntegrationName::JupiterVote + /// - Integration::JupiterVote pub fn init_locked_voter_escrow<'info>(ctx: Context) -> Result<()> { jupiter::init_locked_voter_escrow_handler(ctx) } @@ -798,7 +798,7 @@ pub mod glam { /// - Permission::UnstakeJup /// /// # Integration required - /// - IntegrationName::JupiterVote + /// - Integration::JupiterVote pub fn toggle_max_lock<'info>(ctx: Context, value: bool) -> Result<()> { jupiter::toggle_max_lock_handler(ctx, value) } @@ -813,7 +813,7 @@ pub mod glam { /// - Permission::StakeJup /// /// # Integration required - /// - IntegrationName::JupiterVote + /// - Integration::JupiterVote pub fn increase_locked_amount<'info>( ctx: Context, amount: u64, @@ -832,7 +832,7 @@ pub mod glam { /// - Permission::UnstakeJup /// /// # Integration required - /// - IntegrationName::JupiterVote + /// - Integration::JupiterVote pub fn open_partial_unstaking<'info>( ctx: Context, amount: u64, @@ -850,7 +850,7 @@ pub mod glam { /// - Permission::UnstakeJup /// /// # Integration required - /// - IntegrationName::JupiterVote + /// - Integration::JupiterVote pub fn merge_partial_unstaking<'info>(ctx: Context) -> Result<()> { jupiter::merge_partial_unstaking_handler(ctx) } @@ -864,7 +864,7 @@ pub mod glam { /// - Permission::UnstakeJup /// /// # Integration required - /// - IntegrationName::JupiterVote + /// - Integration::JupiterVote pub fn withdraw_partial_unstaking<'info>(ctx: Context) -> Result<()> { jupiter::withdraw_partial_unstaking_handler(ctx) } @@ -878,7 +878,7 @@ pub mod glam { /// - Permission::UnstakeJup /// /// # Integration required - /// - IntegrationName::JupiterVote + /// - Integration::JupiterVote pub fn withdraw_all_staked_jup<'info>(ctx: Context) -> Result<()> { jupiter::withdraw_all_staked_jup_handler(ctx) } @@ -892,7 +892,7 @@ pub mod glam { /// - Permission::VoteOnProposal /// /// # Integration required - /// - IntegrationName::JupiterVote + /// - Integration::JupiterVote pub fn new_vote<'info>(ctx: Context) -> Result<()> { jupiter::new_vote_handler(ctx) } @@ -907,7 +907,7 @@ pub mod glam { /// - Permission::VoteOnProposal /// /// # Integration required - /// - IntegrationName::JupiterVote + /// - Integration::JupiterVote pub fn cast_vote<'info>(ctx: Context, side: u8) -> Result<()> { jupiter::cast_vote_handler(ctx, side) } diff --git a/anchor/programs/glam/src/state/accounts.rs b/anchor/programs/glam/src/state/accounts.rs index 77fdff45..e4060c63 100644 --- a/anchor/programs/glam/src/state/accounts.rs +++ b/anchor/programs/glam/src/state/accounts.rs @@ -7,15 +7,9 @@ use super::openfunds::*; #[derive(AnchorDeserialize, AnchorSerialize, PartialEq, Clone, Debug, Copy)] pub enum EngineFieldName { - TimeCreated, - IsEnabled, - Assets, - AssetsWeights, - ShareClassAllowlist, // share class - ShareClassBlocklist, // share class - DelegateAcls, - IntegrationAcls, - ExternalVaultAccounts, // external accounts with vaultassets + ShareClassAllowlist, // share class + ShareClassBlocklist, // share class + ExternalVaultAccounts, // external accounts with vault assets LockUp, // share class DriftMarketIndexesPerp, DriftMarketIndexesSpot, @@ -40,8 +34,6 @@ pub enum EngineFieldValue { Timestamp { val: i64 }, VecPubkey { val: Vec }, VecU32 { val: Vec }, - VecDelegateAcl { val: Vec }, - VecIntegrationAcl { val: Vec }, } #[derive(AnchorDeserialize, AnchorSerialize, Clone, Debug)] @@ -50,244 +42,163 @@ pub struct EngineField { pub value: EngineFieldValue, } -pub type StateAccount = FundAccount; -pub type MetadataAccount = FundMetadataAccount; +#[derive(AnchorDeserialize, AnchorSerialize, Clone, Debug, PartialEq)] +pub enum AccountType { + Vault, + Mint, + Fund, + // ... more account types +} + +#[derive(AnchorDeserialize, AnchorSerialize, Clone, Debug, PartialEq, Copy)] +pub enum MetadataType { + Openfunds, + // ... more metadata types +} + +#[derive(AnchorDeserialize, AnchorSerialize, Clone, Debug)] +pub struct Metadata { + pub template: MetadataType, + pub pubkey: Pubkey, // metadata account pubkey + pub uri: String, +} #[account] -pub struct FundAccount { +pub struct StateAccount { + pub account_type: AccountType, pub owner: Pubkey, pub vault: Pubkey, - pub metadata: Pubkey, + pub enabled: bool, + pub created: i64, pub engine: Pubkey, pub mints: Vec, + pub metadata: Option, pub name: String, pub uri: String, - pub metadata_uri: String, + pub assets: Vec, + pub delegate_acls: Vec, + pub integrations: Vec, - // params[0]: fund params + // params[0]: state params // params[1..n+1]: mints [0..n] params pub params: Vec>, } -impl FundAccount { +impl StateAccount { pub const INIT_SIZE: usize = 2048; // TODO: auto extend account size if needed - pub fn is_enabled(&self) -> bool { - return true; - } - // return the share class lockup period in s. 0 == no lockup (default). pub fn share_class_lock_up(&self, share_class_id: usize) -> i64 { - let param_idx = share_class_id + 1; - for EngineField { name, value } in &self.params[param_idx] { - match name { - EngineFieldName::LockUp => { - return match value { - EngineFieldValue::Timestamp { val: v } => { - if *v > 0 { - *v - } else { - 0 - } - } - _ => 0, - }; - } - _ => { /* ignore */ } - } - } - return 0; + self.params + .get(share_class_id + 1) + .and_then(|params| { + params + .iter() + .find(|EngineField { name, .. }| *name == EngineFieldName::LockUp) + .and_then(|EngineField { value, .. }| match value { + EngineFieldValue::Timestamp { val: v } if *v > 0 => Some(*v), + _ => None, + }) + }) + .unwrap_or(0) } pub fn share_class_allowlist(&self, share_class_id: usize) -> Option<&Vec> { - // params[1]: share class 0 acls - // params[2]: share class 1 acls - // ... - let param_idx = share_class_id + 1; - for EngineField { name, value } in &self.params[param_idx] { - match name { - EngineFieldName::ShareClassAllowlist => { - return match value { - EngineFieldValue::VecPubkey { val: v } => Some(v), - _ => None, - }; - } - _ => { /* ignore */ } - } - } - return None; + self.params.get(share_class_id + 1).and_then(|params| { + params + .iter() + .find(|EngineField { name, .. }| *name == EngineFieldName::ShareClassAllowlist) + .and_then(|EngineField { value, .. }| match value { + EngineFieldValue::VecPubkey { val } => Some(val), + _ => None, + }) + }) } pub fn share_class_allowlist_mut(&mut self, share_class_id: usize) -> Option<&mut Vec> { - // params[1]: share class 0 acls - // params[2]: share class 1 acls - // ... - let param_idx = share_class_id + 1; - self.params[param_idx] - .iter_mut() - .find_map(|EngineField { name, value }| { - if *name == EngineFieldName::ShareClassAllowlist { - match value { - EngineFieldValue::VecPubkey { val } => Some(val), - _ => None, - } - } else { - None - } - }) + self.params.get_mut(share_class_id + 1).and_then(|params| { + params + .iter_mut() + .find(|EngineField { name, .. }| *name == EngineFieldName::ShareClassAllowlist) + .and_then(|EngineField { value, .. }| match value { + EngineFieldValue::VecPubkey { val } => Some(val), + _ => None, + }) + }) } pub fn share_class_blocklist(&self, share_class_id: usize) -> Option<&Vec> { - // params[1]: share class 0 acls - // params[2]: share class 1 acls - // ... - let param_idx = share_class_id + 1; - for EngineField { name, value } in &self.params[param_idx] { - match name { - EngineFieldName::ShareClassBlocklist => { - return match value { - EngineFieldValue::VecPubkey { val: v } => Some(v), - _ => None, - }; - } - _ => { /* ignore */ } - } - } - return None; + self.params.get(share_class_id + 1).and_then(|params| { + params + .iter() + .find(|EngineField { name, .. }| *name == EngineFieldName::ShareClassBlocklist) + .and_then(|EngineField { value, .. }| match value { + EngineFieldValue::VecPubkey { val } => Some(val), + _ => None, + }) + }) } pub fn share_class_blocklist_mut(&mut self, share_class_id: usize) -> Option<&mut Vec> { - // params[1]: share class 0 acls - // params[2]: share class 1 acls - // ... - let param_idx = share_class_id + 1; - self.params[param_idx] - .iter_mut() - .find_map(|EngineField { name, value }| { - if *name == EngineFieldName::ShareClassBlocklist { - match value { - EngineFieldValue::VecPubkey { val } => Some(val), - _ => None, - } - } else { - None - } - }) - } - - pub fn assets(&self) -> Option<&Vec> { - for EngineField { name, value } in &self.params[0] { - match name { - EngineFieldName::Assets => { - return match value { - EngineFieldValue::VecPubkey { val: v } => Some(v), - _ => None, - }; - } - _ => { /* ignore */ } - } - } - return None; - } - - pub fn assets_mut(&mut self) -> Option<&mut Vec> { - for EngineField { name, value } in &mut self.params[0] { - match name { - EngineFieldName::Assets => { - return match value { - EngineFieldValue::VecPubkey { val: v } => Some(v), - _ => None, - }; - } - _ => { /* ignore */ } - } - } - return None; - } - - pub fn delegate_acls(&self) -> Option<&Vec> { - for EngineField { name, value } in &self.params[0] { - match name { - EngineFieldName::DelegateAcls => { - return match value { - EngineFieldValue::VecDelegateAcl { val: v } => Some(v), - _ => None, - }; - } - _ => { /* ignore */ } - } - } - return None; - } - - pub fn integration_acls(&self) -> Option<&Vec> { - for EngineField { name, value } in &self.params[0] { - match name { - EngineFieldName::IntegrationAcls => { - return match value { - EngineFieldValue::VecIntegrationAcl { val: v } => Some(v), - _ => None, - }; - } - _ => { /* ignore */ } - } - } - return None; + self.params.get_mut(share_class_id + 1).and_then(|params| { + params + .iter_mut() + .find(|EngineField { name, .. }| *name == EngineFieldName::ShareClassBlocklist) + .and_then(|EngineField { value, .. }| match value { + EngineFieldValue::VecPubkey { val } => Some(val), + _ => None, + }) + }) } pub fn drift_order_types(&self) -> Option<&Vec> { - for EngineField { name, value } in &self.params[0] { - match name { - EngineFieldName::DriftOrderTypes => { - return match value { - EngineFieldValue::VecU32 { val: v } => Some(v), - _ => None, - }; - } - _ => { /* ignore */ } - } - } - return None; + self.params.get(0).and_then(|params| { + params + .iter() + .find(|EngineField { name, .. }| *name == EngineFieldName::DriftOrderTypes) + .and_then(|EngineField { value, .. }| match value { + EngineFieldValue::VecU32 { val } => Some(val), + _ => None, + }) + }) } pub fn drift_market_indexes_perp(&self) -> Option<&Vec> { - for EngineField { name, value } in &self.params[0] { - match name { - EngineFieldName::DriftMarketIndexesPerp => { - return match value { - EngineFieldValue::VecU32 { val: v } => Some(v), - _ => None, - }; - } - _ => { /* ignore */ } - } - } - return None; + self.params.get(0).and_then(|params| { + params + .iter() + .find(|EngineField { name, .. }| *name == EngineFieldName::DriftMarketIndexesPerp) + .and_then(|EngineField { value, .. }| match value { + EngineFieldValue::VecU32 { val } => Some(val), + _ => None, + }) + }) } pub fn drift_market_indexes_spot(&self) -> Option<&Vec> { - for EngineField { name, value } in &self.params[0] { - match name { - EngineFieldName::DriftMarketIndexesSpot => { - return match value { - EngineFieldValue::VecU32 { val: v } => Some(v), - _ => None, - }; - } - _ => { /* ignore */ } - } - } - return None; + self.params.get(0).and_then(|params| { + params + .iter() + .find(|EngineField { name, .. }| *name == EngineFieldName::DriftMarketIndexesSpot) + .and_then(|EngineField { value, .. }| match value { + EngineFieldValue::VecU32 { val } => Some(val), + _ => None, + }) + }) } pub fn add_to_engine_field(&mut self, engine_field_name: EngineFieldName, pubkey: Pubkey) { - // Try to find the MarinadeTickets field, if it exists. - let mut engine_field = self.params[0] - .iter_mut() - .find(|field| field.name == engine_field_name); + let mut engine_field = self.params.get_mut(0).and_then(|params| { + params + .iter_mut() + .find(|field| field.name == engine_field_name) + }); // If the field does not exist, create it and push it to params. if engine_field.is_none() { - msg!("Adding engine field {:?} to fund params", engine_field_name); + msg!( + "Adding engine field {:?} to state params", + engine_field_name + ); self.params[0].push(EngineField { name: engine_field_name, value: EngineFieldValue::VecPubkey { val: Vec::new() }, @@ -314,17 +225,19 @@ impl FundAccount { } pub fn delete_from_engine_field(&mut self, engine_field_name: EngineFieldName, pubkey: Pubkey) { - for EngineField { name, value } in &mut self.params[0] { - if *name == engine_field_name { - if let EngineFieldValue::VecPubkey { val } = value { - if let Some(pos) = val.iter().position(|t| *t == pubkey) { - val.remove(pos); - msg!( - "Removed pubkey {:?} from engine field {:?}", - pubkey, - engine_field_name - ); - } + if let Some(field) = self + .params + .get_mut(0) + .and_then(|params| params.iter_mut().find(|f| f.name == engine_field_name)) + { + if let EngineFieldValue::VecPubkey { val } = &mut field.value { + if let Some(pos) = val.iter().position(|t| *t == pubkey) { + val.remove(pos); + msg!( + "Removed pubkey {:?} from engine field {:?}", + pubkey, + engine_field_name + ); } } } @@ -343,37 +256,36 @@ impl FundAccount { } #[account] -pub struct FundMetadataAccount { - pub state_pubkey: Pubkey, +pub struct OpenfundsMetadataAccount { + pub fund_id: Pubkey, pub company: Vec, pub fund: Vec, pub share_classes: Vec>, pub fund_managers: Vec>, } -impl FundMetadataAccount { +impl OpenfundsMetadataAccount { pub const INIT_SIZE: usize = 1024; } -impl From for FundMetadataAccount { +impl From for OpenfundsMetadataAccount { fn from(model: StateModel) -> Self { - let company = if let Some(company) = &model.company { - company.into() - } else { - vec![] - }; - let fund_managers = if let Some(manager) = &model.owner { - vec![manager.into()] - } else { - vec![] - }; + let fund = model.clone().into(); + let company = model.company.as_ref().map(|c| c.into()).unwrap_or_default(); + let fund_managers = model + .owner + .as_ref() + .map(|m| vec![m.into()]) + .unwrap_or_default(); + let share_classes = model .mints + .unwrap_or_default() .iter() .map(|share_class| share_class.into()) .collect::>(); - let fund = model.into(); - FundMetadataAccount { - state_pubkey: Pubkey::default(), + + OpenfundsMetadataAccount { + fund_id: Pubkey::default(), company, fund, share_classes, diff --git a/anchor/programs/glam/src/state/acl.rs b/anchor/programs/glam/src/state/acl.rs index 68ef1e16..45b86691 100644 --- a/anchor/programs/glam/src/state/acl.rs +++ b/anchor/programs/glam/src/state/acl.rs @@ -1,6 +1,6 @@ use anchor_lang::prelude::*; -use super::StateAccount; +use super::{AccountType, StateAccount}; use crate::error::AccessError; use spl_stake_pool::ID as SPL_STAKE_POOL_PROGRAM_ID; @@ -35,40 +35,26 @@ pub enum Permission { JupiterSwapLst, // Swap LSTs } -#[derive(AnchorDeserialize, AnchorSerialize, Clone, Debug)] +#[derive(AnchorDeserialize, AnchorSerialize, Clone, Debug, PartialEq)] pub struct DelegateAcl { pub pubkey: Pubkey, pub permissions: Vec, + pub expires_at: i64, // Unix timestamp } -/** - * Integration ACL - */ #[derive(AnchorDeserialize, AnchorSerialize, Clone, PartialEq, Debug)] -pub enum IntegrationName { +pub enum Integration { Drift, SplStakePool, SanctumStakePool, NativeStaking, Marinade, JupiterSwap, // Jupiter Swap - Mint, // GLAM Mint JupiterVote, // Jupiter Vote } -#[derive(AnchorDeserialize, AnchorSerialize, Clone, PartialEq, Debug)] -pub enum IntegrationFeature { - All, -} - -#[derive(AnchorDeserialize, AnchorSerialize, Clone, Debug)] -pub struct IntegrationAcl { - pub name: IntegrationName, - pub features: Vec, -} - -pub fn check_access(fund: &StateAccount, signer: &Pubkey, permission: Permission) -> Result<()> { - if fund.owner == *signer { +pub fn check_access(state: &StateAccount, signer: &Pubkey, permission: Permission) -> Result<()> { + if state.owner == *signer { return Ok(()); } @@ -79,22 +65,21 @@ pub fn check_access(fund: &StateAccount, signer: &Pubkey, permission: Permission permission ); - if let Some(acls) = fund.delegate_acls() { - for acl in acls { - if acl.pubkey == *signer && acl.permissions.contains(&permission) { - return Ok(()); - } + for acl in state.delegate_acls.clone() { + if acl.pubkey == *signer && acl.permissions.contains(&permission) { + return Ok(()); } } + return Err(AccessError::NotAuthorized.into()); } pub fn check_access_any( - fund: &StateAccount, + state: &StateAccount, signer: &Pubkey, allowed_permissions: Vec, ) -> Result<()> { - if fund.owner == *signer { + if state.owner == *signer { return Ok(()); } @@ -105,44 +90,50 @@ pub fn check_access_any( allowed_permissions ); - if let Some(acls) = fund.delegate_acls() { - for acl in acls { - if acl.pubkey == *signer - && acl - .permissions - .iter() - .any(|p| allowed_permissions.contains(p)) - { - return Ok(()); - } + for acl in state.delegate_acls.clone() { + if acl.pubkey == *signer + && acl + .permissions + .iter() + .any(|p| allowed_permissions.contains(p)) + { + return Ok(()); } } + return Err(AccessError::NotAuthorized.into()); } -pub fn check_integration(fund: &StateAccount, integration: IntegrationName) -> Result<()> { +pub fn check_state_type(state: &StateAccount, accont_type: AccountType) -> Result<()> { #[cfg(not(feature = "mainnet"))] - msg!("Checking integration {:?} is enabled", integration); + msg!("Checking state account type {:?}", accont_type); - if let Some(acls) = fund.integration_acls() { - for acl in acls { - if acl.name == integration { - return Ok(()); - } - } + if state.account_type == accont_type { + Ok(()) + } else { + Err(AccessError::WrongStateType.into()) } +} - return Err(AccessError::IntegrationDisabled.into()); +pub fn check_integration(state: &StateAccount, integration: Integration) -> Result<()> { + #[cfg(not(feature = "mainnet"))] + msg!("Checking integration {:?} is enabled", integration); + + if state.integrations.contains(&integration) { + Ok(()) + } else { + Err(AccessError::IntegrationDisabled.into()) + } } pub fn check_stake_pool_integration( - fund: &StateAccount, + state: &StateAccount, stake_pool_program: &Pubkey, ) -> Result<()> { let integration = if stake_pool_program == &SPL_STAKE_POOL_PROGRAM_ID { - IntegrationName::SplStakePool + Integration::SplStakePool } else { - IntegrationName::SanctumStakePool + Integration::SanctumStakePool }; - check_integration(fund, integration) + check_integration(state, integration) } diff --git a/anchor/programs/glam/src/state/model/model.rs b/anchor/programs/glam/src/state/model/model.rs index 5a8069f3..2e46f324 100644 --- a/anchor/programs/glam/src/state/model/model.rs +++ b/anchor/programs/glam/src/state/model/model.rs @@ -1,5 +1,7 @@ use anchor_lang::prelude::*; +use crate::state::accounts::*; + use super::super::acl::*; // Fund @@ -10,35 +12,34 @@ use super::super::acl::*; #[derive(AnchorDeserialize, AnchorSerialize, Clone, Debug)] pub struct StateModel { // Core - pub id: Option, + pub account_type: Option, pub name: Option, pub uri: Option, - pub metadata_uri: Option, - pub is_enabled: Option, + pub enabled: Option, // Assets - pub assets: Vec, - pub external_vault_accounts: Vec, + pub assets: Option>, + pub external_vault_accounts: Option>, // Relationships - pub mints: Vec, + pub mints: Option>, pub company: Option, pub owner: Option, pub created: Option, // ACLs - pub delegate_acls: Vec, - pub integration_acls: Vec, - pub drift_market_indexes_perp: Vec, - pub drift_market_indexes_spot: Vec, - pub drift_order_types: Vec, - - // Openfunds - pub is_raw_openfunds: bool, + pub delegate_acls: Option>, + pub integrations: Option>, + pub drift_market_indexes_perp: Option>, + pub drift_market_indexes_spot: Option>, + pub drift_order_types: Option>, + + // Metadata + pub metadata: Option, pub raw_openfunds: Option, } -// Subset of the Openfunds v2 modelled by Glam +// Subset of the Openfunds v2 modeled by Glam #[derive(AnchorDeserialize, AnchorSerialize, Clone, Debug)] pub struct FundOpenfundsModel { pub fund_domicile_alpha_2: Option, @@ -62,6 +63,7 @@ pub struct FundOpenfundsModel { #[derive(AnchorDeserialize, AnchorSerialize, Clone, Debug)] pub struct CreatedModel { pub key: [u8; 8], // seed for computing state PDA + pub created_at: i64, pub owner: Option, } @@ -79,14 +81,10 @@ pub struct ShareClassModel { pub uri: Option, // metadata uri // Glam - pub fund_id: Option, + pub state_pubkey: Option, pub asset: Option, pub image_uri: Option, - // Openfund - pub is_raw_openfunds: bool, - pub raw_openfunds: Option, - // Acls pub allowlist: Vec, pub blocklist: Vec, @@ -95,6 +93,10 @@ pub struct ShareClassModel { pub lock_up_period_in_seconds: i32, pub permanent_delegate: Option, pub default_account_state_frozen: bool, + + // Metadata + pub is_raw_openfunds: bool, + pub raw_openfunds: Option, } #[derive(AnchorDeserialize, AnchorSerialize, Clone, Debug, Default)] diff --git a/anchor/programs/glam/src/state/model/openfunds.rs b/anchor/programs/glam/src/state/model/openfunds.rs index d6d3e456..12f25f0a 100644 --- a/anchor/programs/glam/src/state/model/openfunds.rs +++ b/anchor/programs/glam/src/state/model/openfunds.rs @@ -62,10 +62,9 @@ impl From for Vec { }); } // Derived fields - let is_raw_openfunds = model.is_raw_openfunds; - if !is_raw_openfunds { - //TODO: add Glam extension fields - } + // TODO: impl + // let is_raw_openfunds = model.is_raw_openfunds; + // if !is_raw_openfunds {} res } } @@ -80,7 +79,10 @@ impl From<&ShareClassModel> for Vec { let model = model.clone(); if !is_raw_openfunds { let v: Vec<(Option, ShareClassFieldName)> = vec![ - (pubkey2string(model.fund_id), ShareClassFieldName::FundId), + ( + pubkey2string(model.state_pubkey), + ShareClassFieldName::FundId, + ), (model.image_uri, ShareClassFieldName::ImageUri), ]; v.iter().for_each(|(value, field)| { diff --git a/anchor/programs/glam/src/state/openfunds/share_class.rs b/anchor/programs/glam/src/state/openfunds/share_class.rs index b45cf8d1..29fb2d2e 100644 --- a/anchor/programs/glam/src/state/openfunds/share_class.rs +++ b/anchor/programs/glam/src/state/openfunds/share_class.rs @@ -4,31 +4,36 @@ use anchor_lang::prelude::*; #[derive(AnchorDeserialize, AnchorSerialize, Clone, Debug, strum::Display)] pub enum ShareClassFieldName { + // // Essential + // ISIN, // impl ShareClassCurrency, // impl + + // // Core - AllInFeeApplied, - AllInFeeDate, - AllInFeeIncludesTransactionCosts, - AllInFeeMaximum, + // + // AllInFeeApplied, + // AllInFeeDate, + // AllInFeeIncludesTransactionCosts, + // AllInFeeMaximum, AppliedSubscriptionFeeInFavourOfDistributor, // impl AppliedSubscriptionFeeInFavourOfDistributorReferenceDate, // impl - Benchmark, - CountryLegalRegistration, - CountryMarketingDistribution, - CurrencyHedgeShareClass, + // Benchmark, + // CountryLegalRegistration, + // CountryMarketingDistribution, + // CurrencyHedgeShareClass, CurrencyOfMinimalSubscription, // impl - DistributionDeclarationFrequency, + // DistributionDeclarationFrequency, FullShareClassName, // impl - HasAllInFee, - HasOngoingCharges, + // HasAllInFee, + // HasOngoingCharges, HasPerformanceFee, // impl HasSubscriptionFeeInFavourOfDistributor, // impl InvestmentStatus, // impl - IsETF, - IsRDRCompliant, - IsTrailerFeeClean, + // IsETF, + // IsRDRCompliant, + // IsTrailerFeeClean, ManagementFeeApplied, // impl ManagementFeeAppliedReferenceDate, // impl ManagementFeeMaximum, // impl @@ -40,58 +45,61 @@ pub enum ShareClassFieldName { MinimalSubsequentSubscriptionInAmount, // impl MinimalSubsequentSubscriptionInShares, // impl MinimumSubscriptionFeeInFavourOfDistributor, // impl - OngoingCharges, - OngoingChargesDate, - PerformanceFeeApplied, - PerformanceFeeAppliedReferenceDate, - PerformanceFeeInProspectus, - PerformanceFeeInProspectusReferenceDate, - RecordDateForSRRI, + // OngoingCharges, + // OngoingChargesDate, + // PerformanceFeeApplied, + // PerformanceFeeAppliedReferenceDate, + // PerformanceFeeInProspectus, + // PerformanceFeeInProspectusReferenceDate, + // RecordDateForSRRI, ShareClassDistributionPolicy, // impl ShareClassExtension, // impl ShareClassLaunchDate, // impl ShareClassLifecycle, // impl SRRI, // impl - TERExcludingPerformanceFee, - TERExcludingPerformanceFeeDate, - TERIncludingPerformanceFee, - TERIncludingPerformanceFeeDate, + // TERExcludingPerformanceFee, + // TERExcludingPerformanceFeeDate, + // TERIncludingPerformanceFee, + // TERIncludingPerformanceFeeDate, + + // // Additional - TransferAgentName, - BICOfTransferAgent, - DomicileOfTransferAgent, - FormOfShare, - HasDurationHedge, - TypeOfEqualization, - IsMultiseries, - SeriesIssuance, - SeriesFrequency, - DoesFundIssueSidePocket, - HasRedemptionGates, - TypeOfAlternativeFundStructureVehicle, - BloombergCode, - FIGICode, - AbbreviatedShareClassName, - ValuationFrequency, - NAVPublicationTime, - IsShareClassEligibleForUCITS, - InvestmentStatusDate, + // + // TransferAgentName, + // BICOfTransferAgent, + // DomicileOfTransferAgent, + // FormOfShare, + // HasDurationHedge, + // TypeOfEqualization, + // IsMultiseries, + // SeriesIssuance, + // SeriesFrequency, + // DoesFundIssueSidePocket, + // HasRedemptionGates, + // TypeOfAlternativeFundStructureVehicle, + // BloombergCode, + // FIGICode, + // AbbreviatedShareClassName, + // ValuationFrequency, + // NAVPublicationTime, + // IsShareClassEligibleForUCITS, + // InvestmentStatusDate, LaunchPrice, // impl LaunchPriceCurrency, // impl LaunchPriceDate, // impl - EFAMAMainEFCCategory, - EFAMAEFCClassificationType, - EFAMAActiveEFCClassification, - EFAMAEFCInvestmentTheme, - PricingMethodology, - SinglePricingType, - SwingFactor, - StandardMinimumRemainingAmount, - StandardMinimumRemainingShares, - CurrencyOfMinimumRemainingAmount, - StandardMinimumRemainingCategory, - HurdleRate, - HighWaterMark, + // EFAMAMainEFCCategory, + // EFAMAEFCClassificationType, + // EFAMAActiveEFCClassification, + // EFAMAEFCInvestmentTheme, + // PricingMethodology, + // SinglePricingType, + // SwingFactor, + // StandardMinimumRemainingAmount, + // StandardMinimumRemainingShares, + // CurrencyOfMinimumRemainingAmount, + // StandardMinimumRemainingCategory, + // HurdleRate, + // HighWaterMark, HasAppliedSubscriptionFeeInFavourOfFund, // impl AppliedSubscriptionFeeInFavourOfFund, // impl AppliedSubscriptionFeeInFavourOfFundReferenceDate, // impl @@ -100,84 +108,87 @@ pub enum ShareClassFieldName { AppliedRedemptionFeeInFavourOfFund, // impl AppliedRedemptionFeeInFavourOfFundReferenceDate, // impl MaximumRedemptionFeeInFavourOfFund, // impl - EquivalentTrailerFeeCleanISIN, - HasSeparateDistributionFee, - DistributionFee, - DistributionFeeMaximum, - IASector, + // EquivalentTrailerFeeCleanISIN, + // HasSeparateDistributionFee, + // DistributionFee, + // DistributionFeeMaximum, + // IASector, + + // // Full - AbsorbingFundFullShareClassName, - AbsorbingFundShareClassISIN, - AdministrationFeeMaximum, - AnnualDistributionAtFiscalYearEnd, - AnnualDistributionYieldAtFiscalYearEnd, + // + // AbsorbingFundFullShareClassName, + // AbsorbingFundShareClassISIN, + // AdministrationFeeMaximum, + // AnnualDistributionAtFiscalYearEnd, + // AnnualDistributionYieldAtFiscalYearEnd, AppliedRedemptionFeeInFavourOfDistributor, // impl AppliedRedemptionFeeInFavourOfDistributorReferenceDate, // impl - BankDetailsSSIForPaymentsProvision, - BankDetailsLevelApplication, - BenchmarkBloombergTicker, - CalculationDateOffsetForRedemption, - CalculationDateOffsetForSubscription, - CalendarOrBusinessDaysForCutOffDateOffsetForRedemption, - CalendarOrBusinessDaysForCutOffDateOffsetForSubscription, - CalendarOrBusinessDaysForPrePaymentDaysForSubscription, - CalendarOrBusinessDaysForSettlementPeriodForRedemption, - CalendarOrBusinessDaysForSettlementPeriodForSubscription, - CalendarOrBusinessDaysForTransactions, - CFICode, - ContingentDeferredSalesChargeExitFee, - ContingentDeferredSalesChargeUpfrontFee, - CountryISOCodeAlpha2, - CountryISOCodeAlpha3, - CountryName, - CurrenciesOfMulticurrencyShareClass, + // BankDetailsSSIForPaymentsProvision, + // BankDetailsLevelApplication, + // BenchmarkBloombergTicker, + // CalculationDateOffsetForRedemption, + // CalculationDateOffsetForSubscription, + // CalendarOrBusinessDaysForCutOffDateOffsetForRedemption, + // CalendarOrBusinessDaysForCutOffDateOffsetForSubscription, + // CalendarOrBusinessDaysForPrePaymentDaysForSubscription, + // CalendarOrBusinessDaysForSettlementPeriodForRedemption, + // CalendarOrBusinessDaysForSettlementPeriodForSubscription, + // CalendarOrBusinessDaysForTransactions, + // CFICode, + // ContingentDeferredSalesChargeExitFee, + // ContingentDeferredSalesChargeUpfrontFee, + // CountryISOCodeAlpha2, + // CountryISOCodeAlpha3, + // CountryName, + // CurrenciesOfMulticurrencyShareClass, CurrencyOfMinimalOrMaximumRedemption, // impl - CustodianFeeApplied, - CustodianFeeAppliedReferenceDate, - CustodianFeeMaximum, + // CustodianFeeApplied, + // CustodianFeeAppliedReferenceDate, + // CustodianFeeMaximum, CutOffDateOffsetForRedemption, // impl CutOffDateOffsetForSubscription, // impl CutOffTimeForRedemption, // impl CutOffTimeForSubscription, // impl - CutOffTimeForSwitchIn, - CutOffTimeForSwitchOut, - DealingDaysOfMultipleRedemptionTradeCycles, - DealingDaysOfMultipleSubscriptionTradeCycles, - DisseminationRecipient, - DistributionFeeReferenceDate, - DoesShareClassApplyMandatoryConversion, - DoesShareClassApplyPartialDealingDays, - DoesShareClassApplyPartialPaymentDays, - DormantEndDate, - DormantStartDate, - ExDividendDateCalendar, - ExitCostDescription, - HasContingentDeferredSalesChargeFee, - HasDilutionLevyAppliedByFund, - HasEqualizationMethodForDistribution, - HasEqualizationMethodForPerformanceFee, - HasForcedRedemption, - HasForwardPricing, - HasHighWaterMark, + // CutOffTimeForSwitchIn, + // CutOffTimeForSwitchOut, + // DealingDaysOfMultipleRedemptionTradeCycles, + // DealingDaysOfMultipleSubscriptionTradeCycles, + // DisseminationRecipient, + // DistributionFeeReferenceDate, + // DoesShareClassApplyMandatoryConversion, + // DoesShareClassApplyPartialDealingDays, + // DoesShareClassApplyPartialPaymentDays, + // DormantEndDate, + // DormantStartDate, + // ExDividendDateCalendar, + // ExitCostDescription, + // HasContingentDeferredSalesChargeFee, + // HasDilutionLevyAppliedByFund, + // HasEqualizationMethodForDistribution, + // HasEqualizationMethodForPerformanceFee, + // HasForcedRedemption, + // HasForwardPricing, + // HasHighWaterMark, HasLockUpForRedemption, // impl - HasPreNoticeForSwitchIn, - HasPreNoticeForSwitchOut, - HasPrePaymentForSubscription, + // HasPreNoticeForSwitchIn, + // HasPreNoticeForSwitchOut, + // HasPrePaymentForSubscription, HasRedemptionFeeInFavourOfDistributor, // impl - HasTripartiteReport, - InvestmentStatusDescription, - IrregularRedemptionDealingDays, - IrregularSubscriptionDealingDays, - IsMulticurrencyShareClass, - IsRestrictedToSeparateFeeArrangement, - IsStructuredFinanceProduct, + // HasTripartiteReport, + // InvestmentStatusDescription, + // IrregularRedemptionDealingDays, + // IrregularSubscriptionDealingDays, + // IsMulticurrencyShareClass, + // IsRestrictedToSeparateFeeArrangement, + // IsStructuredFinanceProduct, IsValidISIN, // impl - LiquidationStartDate, + // LiquidationStartDate, LockUpComment, // impl LockUpPeriodInDays, // impl ManagementFeeMinimum, // impl - MandatoryShareConversionDescriptionDetails, - MarketsRelevantToFundTradingCalendar, + // MandatoryShareConversionDescriptionDetails, + // MarketsRelevantToFundTradingCalendar, MaximalNumberOfPossibleDecimalsAmount, // impl MaximalNumberOfPossibleDecimalsNAV, // impl MaximalNumberOfPossibleDecimalsShares, // impl @@ -186,7 +197,7 @@ pub enum ShareClassFieldName { MaximumRedemptionFeeInFavourOfDistributor, // impl MaximumSubsequentRedemptionInAmount, // impl MaximumSubsequentRedemptionInShares, // impl - MergerRatio, + // MergerRatio, MinimalInitialRedemptionInAmount, // impl MinimalInitialRedemptionInShares, // impl MinimalRedemptionCategory, // impl @@ -195,51 +206,54 @@ pub enum ShareClassFieldName { MinimumRedemptionFeeInFavourOfDistributor, // impl MinimumRedemptionFeeInFavourOfFund, // impl MinimumSubscriptionFeeInFavourOfFund, // impl - MonthlyRedemptionDealingDays, - MonthlySubscriptionDealingDays, - NasdaqFundNetworkNFNIdentifier, - NoTradingDate, - NumberOfPossibleRedemptionsWithinPeriod, - NumberOfPossibleSubscriptionsWithinPeriod, - PartialDealingDaysDateAndTime, - PartialPaymentDaysDateAndTime, - PaymentDateCalendar, + // MonthlyRedemptionDealingDays, + // MonthlySubscriptionDealingDays, + // NasdaqFundNetworkNFNIdentifier, + // NoTradingDate, + // NumberOfPossibleRedemptionsWithinPeriod, + // NumberOfPossibleSubscriptionsWithinPeriod, + // PartialDealingDaysDateAndTime, + // PartialPaymentDaysDateAndTime, + // PaymentDateCalendar, PerformanceFeeMinimum, // impl - PreNoticeCutOffForRedemption, - PreNoticeCutOffForSubscription, - PrePaymentCutOffTimeForSubscription, - PrePaymentDaysForSubscription, - RecordDateCalendar, - RedemptionTradeCyclePeriod, + // PreNoticeCutOffForRedemption, + // PreNoticeCutOffForSubscription, + // PrePaymentCutOffTimeForSubscription, + // PrePaymentDaysForSubscription, + // RecordDateCalendar, + // RedemptionTradeCyclePeriod, RoundingMethodForPrices, // impl RoundingMethodForRedemptionInAmount, // impl RoundingMethodForRedemptionInShares, // impl RoundingMethodForSubscriptionInAmount, // impl RoundingMethodForSubscriptionInShares, // impl - SettlementPeriodForRedemption, - SettlementPeriodForSubscription, - SettlementPeriodForSwitchIn, - SettlementPeriodForSwitchOut, + // SettlementPeriodForRedemption, + // SettlementPeriodForSubscription, + // SettlementPeriodForSwitchIn, + // SettlementPeriodForSwitchOut, ShareClassDividendType, // impl - SingleRegisterAccountRestrictions, - SubscriptionPeriodEndDate, - SubscriptionPeriodStartDate, - SubscriptionTradeCyclePeriod, - SwitchInNoticePeriod, - SwitchOutNoticePeriod, - TerminationDate, - TimeZoneForCutOff, - TimeZoneForCutOffUsingTZDatabase, - ValuationFrequencyDetail, - ValuationReduction, - WeeklyRedemptionDealingDays, - WeeklySubscriptionDealingDays, - YearlyRedemptionDealingDays, - YearlySubscriptionDealingDays, + // SingleRegisterAccountRestrictions, + // SubscriptionPeriodEndDate, + // SubscriptionPeriodStartDate, + // SubscriptionTradeCyclePeriod, + // SwitchInNoticePeriod, + // SwitchOutNoticePeriod, + // TerminationDate, + // TimeZoneForCutOff, + // TimeZoneForCutOffUsingTZDatabase, + // ValuationFrequencyDetail, + // ValuationReduction, + // WeeklyRedemptionDealingDays, + // WeeklySubscriptionDealingDays, + // YearlyRedemptionDealingDays, + // YearlySubscriptionDealingDays, // Full | Country CUSIP, // impl Valor, // impl + + // // Glam Extensions + // FundId, // impl ImageUri, // impl } diff --git a/anchor/target/idl/glam.json b/anchor/target/idl/glam.json index 8b55709b..4546853b 100644 --- a/anchor/target/idl/glam.json +++ b/anchor/target/idl/glam.json @@ -77,7 +77,28 @@ }, { "name": "metadata", - "writable": true + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 109, + 101, + 116, + 97, + 100, + 97, + 116, + 97 + ] + }, + { + "kind": "account", + "path": "state" + } + ] + } }, { "name": "signer", @@ -118,7 +139,7 @@ "- Permission::BurnShare", "", "# Integration required", - "- IntegrationName::Mint" + "- Integration::Mint" ], "discriminator": [ 111, @@ -233,7 +254,7 @@ "- Permission::VoteOnProposal", "", "# Integration required", - "- IntegrationName::JupiterVote" + "- Integration::JupiterVote" ], "discriminator": [ 20, @@ -258,14 +279,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -348,14 +366,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -407,7 +422,28 @@ }, { "name": "metadata", - "writable": true + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 109, + 101, + 116, + 97, + 100, + 97, + 116, + 97 + ] + }, + { + "kind": "account", + "path": "state" + } + ] + } }, { "name": "signer", @@ -454,7 +490,28 @@ }, { "name": "metadata", - "writable": true + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 109, + 101, + 116, + 97, + 100, + 97, + 116, + 97 + ] + }, + { + "kind": "account", + "path": "state" + } + ] + } }, { "name": "vault", @@ -464,14 +521,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -527,14 +581,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -572,7 +623,7 @@ "- Permission::Unstake", "", "# Integration required", - "- IntegrationName::NativeStaking" + "- Integration::NativeStaking" ], "discriminator": [ 58, @@ -601,14 +652,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -644,7 +692,7 @@ "- Permission::DriftCancelOrders", "", "# Integration required", - "- IntegrationName::Drift" + "- Integration::Drift" ], "discriminator": [ 98, @@ -675,14 +723,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -747,7 +792,7 @@ "- Permission::DriftDeleteUser", "", "# Integration required", - "- IntegrationName::Drift" + "- Integration::Drift" ], "discriminator": [ 179, @@ -782,14 +827,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -829,7 +871,7 @@ "- Permission::DriftDeposit", "", "# Integration required", - "- IntegrationName::Drift" + "- Integration::Drift" ], "discriminator": [ 252, @@ -864,14 +906,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -927,7 +966,7 @@ "- Permission::DriftInitialize", "", "# Integration required", - "- IntegrationName::Drift" + "- Integration::Drift" ], "discriminator": [ 21, @@ -962,14 +1001,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -1013,7 +1049,7 @@ "- Additional permission Permission::DriftSpotMarket or Permission::DriftPerpMarket is required depending on market type.", "", "# Integration required", - "- IntegrationName::Drift" + "- Integration::Drift" ], "discriminator": [ 117, @@ -1044,14 +1080,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -1102,7 +1135,7 @@ "- Permission::DriftUpdateUser", "", "# Integration required", - "- IntegrationName::Drift" + "- Integration::Drift" ], "discriminator": [ 4, @@ -1129,14 +1162,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -1181,7 +1211,7 @@ "- Permission::DriftUpdateUser", "", "# Integration required", - "- IntegrationName::Drift" + "- Integration::Drift" ], "discriminator": [ 36, @@ -1208,14 +1238,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -1260,7 +1287,7 @@ "- Permission::DriftUpdateUser", "", "# Integration required", - "- IntegrationName::Drift" + "- Integration::Drift" ], "discriminator": [ 157, @@ -1287,14 +1314,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -1339,7 +1363,7 @@ "- Permission::DriftWithdraw", "", "# Integration required", - "- IntegrationName::Drift" + "- Integration::Drift" ], "discriminator": [ 86, @@ -1377,14 +1401,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -1441,7 +1462,7 @@ "- Permission::ForceTransferShare", "", "# Integration required", - "- IntegrationName::Mint" + "- Integration::Mint" ], "discriminator": [ 71, @@ -1616,7 +1637,7 @@ "- Permission::StakeJup", "", "# Integration required", - "- IntegrationName::JupiterVote" + "- Integration::JupiterVote" ], "discriminator": [ 5, @@ -1640,14 +1661,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -1706,7 +1724,7 @@ "- Permission::StakeJup", "", "# Integration required", - "- IntegrationName::JupiterVote" + "- Integration::JupiterVote" ], "discriminator": [ 148, @@ -1730,14 +1748,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -1786,7 +1801,7 @@ "- Permission::Stake", "", "# Integration required", - "- IntegrationName::NativeStaking" + "- Integration::NativeStaking" ], "discriminator": [ 71, @@ -1816,14 +1831,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -1911,10 +1923,11 @@ { "kind": "const", "value": [ - 102, - 117, - 110, - 100 + 115, + 116, + 97, + 116, + 101 ] }, { @@ -1929,22 +1942,18 @@ } }, { - "name": "metadata", + "name": "vault", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ - 111, - 112, - 101, - 110, - 102, + 118, + 97, 117, - 110, - 100, - 115 + 108, + 116 ] }, { @@ -1955,21 +1964,26 @@ } }, { - "name": "vault", + "name": "signer", + "writable": true, + "signer": true + }, + { + "name": "metadata", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ - 116, - 114, + 109, 101, + 116, 97, - 115, - 117, - 114, - 121 + 100, + 97, + 116, + 97 ] }, { @@ -1979,11 +1993,6 @@ ] } }, - { - "name": "signer", - "writable": true, - "signer": true - }, { "name": "system_program", "address": "11111111111111111111111111111111" @@ -2017,7 +2026,7 @@ "- Permission::JupiterSwapLst: input and output assets are both LST.", "", "# Integration required", - "- IntegrationName::JupiterSwap" + "- Integration::JupiterSwap" ], "discriminator": [ 116, @@ -2042,14 +2051,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -2248,7 +2254,7 @@ "- Permission::Unstake", "", "# Integration required", - "- IntegrationName::Marinade" + "- Integration::Marinade" ], "discriminator": [ 14, @@ -2278,14 +2284,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -2341,7 +2344,7 @@ "- Permission::Unstake", "", "# Integration required", - "- IntegrationName::Marinade" + "- Integration::Marinade" ], "discriminator": [ 117, @@ -2371,14 +2374,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -2458,7 +2458,7 @@ "- Permission::Stake", "", "# Integration required", - "- IntegrationName::Marinade" + "- Integration::Marinade" ], "discriminator": [ 64, @@ -2487,14 +2487,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -2659,7 +2656,7 @@ "- Permission::Stake", "", "# Integration required", - "- IntegrationName::Marinade" + "- Integration::Marinade" ], "discriminator": [ 69, @@ -2688,14 +2685,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -2871,7 +2865,7 @@ "- Permission::LiquidUnstake", "", "# Integration required", - "- IntegrationName::Marinade" + "- Integration::Marinade" ], "discriminator": [ 29, @@ -2900,14 +2894,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -2977,7 +2968,7 @@ "- Permission::UnstakeJup", "", "# Integration required", - "- IntegrationName::JupiterVote" + "- Integration::JupiterVote" ], "discriminator": [ 190, @@ -3001,14 +2992,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -3058,7 +3046,7 @@ "- Permission::Stake", "", "# Integration required", - "- IntegrationName::NativeStaking" + "- Integration::NativeStaking" ], "discriminator": [ 173, @@ -3088,14 +3076,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -3146,7 +3131,7 @@ "- Permission::MintShare", "", "# Integration required", - "- IntegrationName::Mint" + "- Integration::Mint" ], "discriminator": [ 145, @@ -3260,7 +3245,7 @@ "- Permission::VoteOnProposal", "", "# Integration required", - "- IntegrationName::JupiterVote" + "- Integration::JupiterVote" ], "discriminator": [ 163, @@ -3284,14 +3269,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -3339,7 +3321,7 @@ "- Permission::UnstakeJup", "", "# Integration required", - "- IntegrationName::JupiterVote" + "- Integration::JupiterVote" ], "discriminator": [ 201, @@ -3363,14 +3345,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -3463,14 +3442,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -3554,7 +3530,7 @@ "- Permission::Unstake", "", "# Integration required", - "- IntegrationName::NativeStaking" + "- Integration::NativeStaking" ], "discriminator": [ 240, @@ -3584,14 +3560,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -3695,7 +3668,7 @@ "- Permission::SetTokenAccountsStates", "", "# Integration required", - "- IntegrationName::Mint" + "- Integration::Mint" ], "discriminator": [ 50, @@ -3752,7 +3725,7 @@ "- Permission::Unstake", "", "# Integration required", - "- IntegrationName::NativeStaking" + "- Integration::NativeStaking" ], "discriminator": [ 130, @@ -3782,14 +3755,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -3848,7 +3818,7 @@ "- Permission::Stake", "", "# Integration required", - "- IntegrationName::SplStakePool or IntegrationName::SanctumStakePool, depending on the stake pool program used." + "- Integration::SplStakePool or Integration::SanctumStakePool, depending on the stake pool program used." ], "discriminator": [ 147, @@ -3877,14 +3847,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -4037,7 +4004,7 @@ "- Permission::Stake", "", "# Integration required", - "- IntegrationName::SplStakePool or IntegrationName::SanctumStakePool, depending on the stake pool program used." + "- Integration::SplStakePool or Integration::SanctumStakePool, depending on the stake pool program used." ], "discriminator": [ 212, @@ -4067,14 +4034,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -4250,7 +4214,7 @@ "- Permission::LiquidUnstake", "", "# Integration required", - "- IntegrationName::SplStakePool or IntegrationName::SanctumStakePool, depending on the stake pool program used." + "- Integration::SplStakePool or Integration::SanctumStakePool, depending on the stake pool program used." ], "discriminator": [ 179, @@ -4279,14 +4243,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -4364,7 +4325,7 @@ "- Permission::Unstake", "", "# Integration required", - "- IntegrationName::SplStakePool or IntegrationName::SanctumStakePool, depending on the stake pool program used." + "- Integration::SplStakePool or Integration::SanctumStakePool, depending on the stake pool program used." ], "discriminator": [ 7, @@ -4394,14 +4355,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -4509,14 +4467,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -4680,7 +4635,7 @@ "- Permission::UnstakeJup", "", "# Integration required", - "- IntegrationName::JupiterVote" + "- Integration::JupiterVote" ], "discriminator": [ 163, @@ -4704,14 +4659,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -5017,14 +4969,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -5179,7 +5128,7 @@ "- Permission::UnstakeJup", "", "# Integration required", - "- IntegrationName::JupiterVote" + "- Integration::JupiterVote" ], "discriminator": [ 210, @@ -5203,14 +5152,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -5264,7 +5210,7 @@ "- Permission::Unstake", "", "# Integration required", - "- IntegrationName::NativeStaking" + "- Integration::NativeStaking" ], "discriminator": [ 93, @@ -5294,14 +5240,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -5338,7 +5281,7 @@ "- Permission::UnstakeJup", "", "# Integration required", - "- IntegrationName::JupiterVote" + "- Integration::JupiterVote" ], "discriminator": [ 201, @@ -5362,14 +5305,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -5448,14 +5388,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -5605,14 +5542,11 @@ { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -5756,32 +5690,6 @@ 155 ] }, - { - "name": "FundAccount", - "discriminator": [ - 49, - 104, - 168, - 214, - 134, - 180, - 173, - 154 - ] - }, - { - "name": "FundMetadataAccount", - "discriminator": [ - 214, - 24, - 35, - 92, - 16, - 104, - 166, - 6 - ] - }, { "name": "Governor", "discriminator": [ @@ -5847,6 +5755,19 @@ 33 ] }, + { + "name": "StateAccount", + "discriminator": [ + 142, + 247, + 54, + 95, + 85, + 133, + 249, + 103 + ] + }, { "name": "Vote", "discriminator": [ @@ -5864,223 +5785,88 @@ "errors": [ { "code": 6000, - "name": "InvalidName", - "msg": "Name too long: max 50 chars" + "name": "InvalidAssetForSwap", + "msg": "Asset cannot be swapped" }, { "code": 6001, - "name": "InvalidSymbol", - "msg": "Symbol too long: max 50 chars" - }, - { - "code": 6002, - "name": "InvalidUri", - "msg": "Uri too long: max 20" - }, - { - "code": 6003, - "name": "InvalidAssetsLen", - "msg": "Too many assets: max 100" - }, - { - "code": 6004, - "name": "Disabled", - "msg": "State account is disabled" - }, - { - "code": 6005, - "name": "NoShareClass", - "msg": "No share class found" - }, - { - "code": 6006, - "name": "ShareClassesNotClosed", - "msg": "Glam state account can't be closed. Close share classes first" - }, - { - "code": 6007, - "name": "CloseNotEmptyError", - "msg": "Error closing state account: not empty" - }, - { - "code": 6008, - "name": "WithdrawDenied", - "msg": "Withdraw denied. Only vaults allow withdraws (funds and mints don't)" + "name": "InvalidSwap", + "msg": "Swap failed" } ], "types": [ { - "name": "CompanyField", + "name": "AccountType", "type": { - "kind": "struct", - "fields": [ + "kind": "enum", + "variants": [ { - "name": "name", - "type": { - "defined": { - "name": "CompanyFieldName" - } - } + "name": "Vault" }, { - "name": "value", - "type": "string" + "name": "Mint" + }, + { + "name": "Fund" } ] } }, { - "name": "CompanyFieldName", + "name": "CompanyModel", "type": { - "kind": "enum", - "variants": [ - { - "name": "FundGroupName" - }, - { - "name": "ManCo" - }, - { - "name": "DomicileOfManCo" - }, - { - "name": "BICOfCustodian" - }, + "kind": "struct", + "fields": [ { - "name": "CollateralManagerName" + "name": "fund_group_name", + "type": { + "option": "string" + } }, { - "name": "CustodianBankName" + "name": "man_co", + "type": { + "option": "string" + } }, { - "name": "DomicileOfCustodianBank" + "name": "domicile_of_man_co", + "type": { + "option": "string" + } }, { - "name": "FundAdministratorName" + "name": "email_address_of_man_co", + "type": { + "option": "string" + } }, { - "name": "FundAdvisorName" - }, + "name": "fund_website_of_man_co", + "type": { + "option": "string" + } + } + ] + } + }, + { + "name": "CreatedModel", + "type": { + "kind": "struct", + "fields": [ { - "name": "FundPromoterName" + "name": "key", + "type": { + "array": [ + "u8", + 8 + ] + } }, { - "name": "IsSelfManagedInvestmentCompany" - }, - { - "name": "LEIOfCustodianBank" - }, - { - "name": "LEIOfManCo" - }, - { - "name": "PortfolioManagingCompanyName" - }, - { - "name": "SecuritiesLendingCounterpartyName" - }, - { - "name": "SwapCounterpartyName" - }, - { - "name": "AddressofManCo" - }, - { - "name": "AuditorName" - }, - { - "name": "CityofManCo" - }, - { - "name": "EmailAddressOfManCo" - }, - { - "name": "FundWebsiteOfManCo" - }, - { - "name": "IsUNPRISignatory" - }, - { - "name": "PhoneCountryCodeofManCo" - }, - { - "name": "PhoneNumberofManCo" - }, - { - "name": "SubInvestmentAdvisorName" - }, - { - "name": "ZIPCodeofManCo" - }, - { - "name": "DomicileOfUmbrella" - }, - { - "name": "HasUmbrella" - }, - { - "name": "LEIOfUmbrella" - }, - { - "name": "Umbrella" - }, - { - "name": "GlobalIntermediaryIdentificationNumberOfUmbrella" - } - ] - } - }, - { - "name": "CompanyModel", - "type": { - "kind": "struct", - "fields": [ - { - "name": "fund_group_name", - "type": { - "option": "string" - } - }, - { - "name": "man_co", - "type": { - "option": "string" - } - }, - { - "name": "domicile_of_man_co", - "type": { - "option": "string" - } - }, - { - "name": "email_address_of_man_co", - "type": { - "option": "string" - } - }, - { - "name": "fund_website_of_man_co", - "type": { - "option": "string" - } - } - ] - } - }, - { - "name": "CreatedModel", - "type": { - "kind": "struct", - "fields": [ - { - "name": "key", - "type": { - "array": [ - "u8", - 8 - ] - } + "name": "created_at", + "type": "i64" }, { "name": "owner", @@ -6109,6 +5895,10 @@ } } } + }, + { + "name": "expires_at", + "type": "i64" } ] } @@ -6142,30 +5932,12 @@ "type": { "kind": "enum", "variants": [ - { - "name": "TimeCreated" - }, - { - "name": "IsEnabled" - }, - { - "name": "Assets" - }, - { - "name": "AssetsWeights" - }, { "name": "ShareClassAllowlist" }, { "name": "ShareClassBlocklist" }, - { - "name": "DelegateAcls" - }, - { - "name": "IntegrationAcls" - }, { "name": "ExternalVaultAccounts" }, @@ -6318,36 +6090,6 @@ } } ] - }, - { - "name": "VecDelegateAcl", - "fields": [ - { - "name": "val", - "type": { - "vec": { - "defined": { - "name": "DelegateAcl" - } - } - } - } - ] - }, - { - "name": "VecIntegrationAcl", - "fields": [ - { - "name": "val", - "type": { - "vec": { - "defined": { - "name": "IntegrationAcl" - } - } - } - } - ] } ] } @@ -6417,1890 +6159,845 @@ } }, { - "name": "FundAccount", + "name": "FundOpenfundsModel", "type": { "kind": "struct", "fields": [ { - "name": "owner", - "type": "pubkey" - }, - { - "name": "vault", - "type": "pubkey" - }, - { - "name": "metadata", - "type": "pubkey" - }, - { - "name": "engine", - "type": "pubkey" + "name": "fund_domicile_alpha_2", + "type": { + "option": "string" + } }, { - "name": "mints", + "name": "legal_fund_name_including_umbrella", "type": { - "vec": "pubkey" + "option": "string" } }, { - "name": "name", - "type": "string" + "name": "fiscal_year_end", + "type": { + "option": "string" + } }, { - "name": "uri", - "type": "string" + "name": "fund_currency", + "type": { + "option": "string" + } }, { - "name": "metadata_uri", - "type": "string" + "name": "fund_launch_date", + "type": { + "option": "string" + } }, { - "name": "params", + "name": "investment_objective", "type": { - "vec": { - "vec": { - "defined": { - "name": "EngineField" - } - } - } + "option": "string" } - } - ] - } - }, - { - "name": "FundField", - "type": { - "kind": "struct", - "fields": [ + }, { - "name": "name", + "name": "is_etc", "type": { - "defined": { - "name": "FundFieldName" - } + "option": "bool" } }, { - "name": "value", - "type": "string" - } - ] - } - }, - { - "name": "FundFieldName", - "type": { - "kind": "enum", - "variants": [ - { - "name": "FundDomicileAlpha2" + "name": "is_eu_directive_relevant", + "type": { + "option": "bool" + } }, { - "name": "FundDomicileAlpha3" + "name": "is_fund_of_funds", + "type": { + "option": "bool" + } }, { - "name": "LegalFundNameIncludingUmbrella" + "name": "is_passive_fund", + "type": { + "option": "bool" + } }, { - "name": "FiscalYearEnd" + "name": "is_reit", + "type": { + "option": "bool" + } }, { - "name": "FundCurrency" + "name": "legal_form", + "type": { + "option": "string" + } }, { - "name": "FundLaunchDate" + "name": "legal_fund_name_only", + "type": { + "option": "string" + } }, { - "name": "InvestmentObjective" + "name": "open_ended_or_closed_ended_fund_structure", + "type": { + "option": "string" + } }, { - "name": "IsETC" + "name": "type_of_eu_directive", + "type": { + "option": "string" + } }, { - "name": "IsEUDirectiveRelevant" - }, + "name": "ucits_version", + "type": { + "option": "string" + } + } + ] + } + }, + { + "name": "GovernanceParameters", + "type": { + "kind": "struct", + "fields": [ { - "name": "IsFundOfFunds" + "name": "voting_delay", + "type": "u64" }, { - "name": "IsPassiveFund" + "name": "voting_period", + "type": "u64" }, { - "name": "IsREIT" + "name": "quorum_votes", + "type": "u64" }, { - "name": "LegalForm" - }, - { - "name": "LegalFundNameOnly" - }, - { - "name": "OpenEndedOrClosedEndedFundStructure" - }, - { - "name": "TypeOfEUDirective" - }, - { - "name": "UCITSVersion" - }, - { - "name": "CurrencyHedgePortfolio" - }, - { - "name": "DepositoryName" - }, - { - "name": "FundValuationPoint" - }, - { - "name": "FundValuationPointTimeZone" - }, - { - "name": "FundValuationPointTimeZoneUsingTZDatabase" - }, - { - "name": "HasCollateralManager" - }, - { - "name": "HasEmbeddedDerivatives" - }, - { - "name": "HasSecuritiesLending" - }, - { - "name": "HasSwap" - }, - { - "name": "IsLeveraged" - }, - { - "name": "IsShariaCompliant" - }, - { - "name": "IsShort" - }, - { - "name": "LEIofDepositoryBank" - }, - { - "name": "LEIOfFund" - }, - { - "name": "LocationOfBearerShare" - }, - { - "name": "LocationOfShareRegister" - }, - { - "name": "MaximumLeverageInFund" - }, + "name": "timelock_delay_seconds", + "type": "i64" + } + ] + } + }, + { + "name": "Governor", + "docs": [ + "Account: Governor" + ], + "type": { + "kind": "struct", + "fields": [ { - "name": "MiFIDSecuritiesClassification" + "name": "base", + "type": "pubkey" }, { - "name": "MoneyMarketTypeOfFund" + "name": "bump", + "type": "u8" }, { - "name": "TrusteeName" + "name": "proposal_count", + "type": "u64" }, { - "name": "AuMFund" + "name": "locker", + "type": "pubkey" }, { - "name": "AuMFundDate" + "name": "smart_wallet", + "type": "pubkey" }, { - "name": "NoSFund" + "name": "params", + "type": { + "defined": { + "name": "GovernanceParameters" + } + } }, { - "name": "NoSFundDate" - } - ] - } - }, - { - "name": "FundManagerField", - "type": { - "kind": "struct", - "fields": [ - { - "name": "name", + "name": "voting_reward", "type": { "defined": { - "name": "FundManagerFieldName" + "name": "VotingReward" } } }, { - "name": "value", - "type": "string" + "name": "buffers", + "type": { + "array": [ + "u128", + 32 + ] + } } ] } }, { - "name": "FundManagerFieldName", + "name": "Integration", "type": { "kind": "enum", "variants": [ { - "name": "PortfolioManagerForename" - }, - { - "name": "PortfolioManagerName" + "name": "Drift" }, { - "name": "PortfolioManagerYearOfBirth" + "name": "SplStakePool" }, { - "name": "PortfolioManagerYearOfExperienceStart" + "name": "SanctumStakePool" }, { - "name": "PortfolioManagerBriefBiography" + "name": "NativeStaking" }, { - "name": "PortfolioManagerType" + "name": "Marinade" }, { - "name": "PortfolioManagerRoleStartingDate" + "name": "JupiterSwap" }, { - "name": "PortfolioManagerRoleEndDate" + "name": "JupiterVote" } ] } }, { - "name": "FundMetadataAccount", + "name": "Locker", + "docs": [ + "Account: Locker" + ], "type": { "kind": "struct", "fields": [ { - "name": "state_pubkey", + "name": "base", "type": "pubkey" }, { - "name": "company", - "type": { - "vec": { - "defined": { - "name": "CompanyField" - } - } - } + "name": "bump", + "type": "u8" }, { - "name": "fund", - "type": { - "vec": { - "defined": { - "name": "FundField" - } - } - } + "name": "token_mint", + "type": "pubkey" + }, + { + "name": "locked_supply", + "type": "u64" + }, + { + "name": "total_escrow", + "type": "u64" + }, + { + "name": "governor", + "type": "pubkey" }, { - "name": "share_classes", + "name": "params", "type": { - "vec": { - "vec": { - "defined": { - "name": "ShareClassField" - } - } + "defined": { + "name": "LockerParams" } } }, { - "name": "fund_managers", + "name": "buffers", "type": { - "vec": { - "vec": { - "defined": { - "name": "FundManagerField" - } - } - } + "array": [ + "u128", + 32 + ] } } ] } }, { - "name": "FundOpenfundsModel", + "name": "LockerParams", "type": { "kind": "struct", "fields": [ { - "name": "fund_domicile_alpha_2", - "type": { - "option": "string" - } - }, - { - "name": "legal_fund_name_including_umbrella", - "type": { - "option": "string" - } - }, - { - "name": "fiscal_year_end", - "type": { - "option": "string" - } - }, - { - "name": "fund_currency", - "type": { - "option": "string" - } - }, - { - "name": "fund_launch_date", - "type": { - "option": "string" - } - }, - { - "name": "investment_objective", - "type": { - "option": "string" - } + "name": "max_stake_vote_multiplier", + "type": "u8" }, { - "name": "is_etc", - "type": { - "option": "bool" - } + "name": "min_stake_duration", + "type": "u64" }, { - "name": "is_eu_directive_relevant", - "type": { - "option": "bool" - } + "name": "max_stake_duration", + "type": "u64" }, { - "name": "is_fund_of_funds", - "type": { - "option": "bool" - } - }, + "name": "proposal_activation_min_votes", + "type": "u64" + } + ] + } + }, + { + "name": "ManagerKind", + "type": { + "kind": "enum", + "variants": [ { - "name": "is_passive_fund", - "type": { - "option": "bool" - } + "name": "Wallet" }, { - "name": "is_reit", - "type": { - "option": "bool" - } - }, + "name": "Squads" + } + ] + } + }, + { + "name": "ManagerModel", + "type": { + "kind": "struct", + "fields": [ { - "name": "legal_form", + "name": "portfolio_manager_name", "type": { "option": "string" } }, { - "name": "legal_fund_name_only", + "name": "pubkey", "type": { - "option": "string" + "option": "pubkey" } }, { - "name": "open_ended_or_closed_ended_fund_structure", + "name": "kind", "type": { - "option": "string" - } - }, - { - "name": "type_of_eu_directive", - "type": { - "option": "string" - } - }, - { - "name": "ucits_version", - "type": { - "option": "string" - } - } - ] - } - }, - { - "name": "GovernanceParameters", - "type": { - "kind": "struct", - "fields": [ - { - "name": "voting_delay", - "type": "u64" - }, - { - "name": "voting_period", - "type": "u64" - }, - { - "name": "quorum_votes", - "type": "u64" - }, - { - "name": "timelock_delay_seconds", - "type": "i64" - } - ] - } - }, - { - "name": "Governor", - "docs": [ - "Account: Governor" - ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "base", - "type": "pubkey" - }, - { - "name": "bump", - "type": "u8" - }, - { - "name": "proposal_count", - "type": "u64" - }, - { - "name": "locker", - "type": "pubkey" - }, - { - "name": "smart_wallet", - "type": "pubkey" - }, - { - "name": "params", - "type": { - "defined": { - "name": "GovernanceParameters" - } - } - }, - { - "name": "voting_reward", - "type": { - "defined": { - "name": "VotingReward" - } - } - }, - { - "name": "buffers", - "type": { - "array": [ - "u128", - 32 - ] - } - } - ] - } - }, - { - "name": "IntegrationAcl", - "type": { - "kind": "struct", - "fields": [ - { - "name": "name", - "type": { - "defined": { - "name": "IntegrationName" - } - } - }, - { - "name": "features", - "type": { - "vec": { + "option": { "defined": { - "name": "IntegrationFeature" + "name": "ManagerKind" } } } } ] } - }, - { - "name": "IntegrationFeature", - "type": { - "kind": "enum", - "variants": [ - { - "name": "All" - } - ] - } - }, - { - "name": "IntegrationName", - "docs": [ - "* Integration ACL" - ], - "type": { - "kind": "enum", - "variants": [ - { - "name": "Drift" - }, - { - "name": "SplStakePool" - }, - { - "name": "SanctumStakePool" - }, - { - "name": "NativeStaking" - }, - { - "name": "Marinade" - }, - { - "name": "JupiterSwap" - }, - { - "name": "Mint" - }, - { - "name": "JupiterVote" - } - ] - } - }, - { - "name": "Locker", - "docs": [ - "Account: Locker" - ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "base", - "type": "pubkey" - }, - { - "name": "bump", - "type": "u8" - }, - { - "name": "token_mint", - "type": "pubkey" - }, - { - "name": "locked_supply", - "type": "u64" - }, - { - "name": "total_escrow", - "type": "u64" - }, - { - "name": "governor", - "type": "pubkey" - }, - { - "name": "params", - "type": { - "defined": { - "name": "LockerParams" - } - } - }, - { - "name": "buffers", - "type": { - "array": [ - "u128", - 32 - ] - } - } - ] - } - }, - { - "name": "LockerParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "max_stake_vote_multiplier", - "type": "u8" - }, - { - "name": "min_stake_duration", - "type": "u64" - }, - { - "name": "max_stake_duration", - "type": "u64" - }, - { - "name": "proposal_activation_min_votes", - "type": "u64" - } - ] - } - }, - { - "name": "ManagerKind", - "type": { - "kind": "enum", - "variants": [ - { - "name": "Wallet" - }, - { - "name": "Squads" - } - ] - } - }, - { - "name": "ManagerModel", - "type": { - "kind": "struct", - "fields": [ - { - "name": "portfolio_manager_name", - "type": { - "option": "string" - } - }, - { - "name": "pubkey", - "type": { - "option": "pubkey" - } - }, - { - "name": "kind", - "type": { - "option": { - "defined": { - "name": "ManagerKind" - } - } - } - } - ] - } - }, - { - "name": "MarketType", - "type": { - "kind": "enum", - "variants": [ - { - "name": "Spot" - }, - { - "name": "Perp" - } - ] - } - }, - { - "name": "OrderParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "order_type", - "type": { - "defined": { - "name": "OrderType" - } - } - }, - { - "name": "market_type", - "type": { - "defined": { - "name": "MarketType" - } - } - }, - { - "name": "direction", - "type": { - "defined": { - "name": "PositionDirection" - } - } - }, - { - "name": "user_order_id", - "type": "u8" - }, - { - "name": "base_asset_amount", - "type": "u64" - }, - { - "name": "price", - "type": "u64" - }, - { - "name": "market_index", - "type": "u16" - }, - { - "name": "reduce_only", - "type": "bool" - }, - { - "name": "post_only", - "type": { - "defined": { - "name": "PostOnlyParam" - } - } - }, - { - "name": "immediate_or_cancel", - "type": "bool" - }, - { - "name": "max_ts", - "type": { - "option": "i64" - } - }, - { - "name": "trigger_price", - "type": { - "option": "u64" - } - }, - { - "name": "trigger_condition", - "type": { - "defined": { - "name": "OrderTriggerCondition" - } - } - }, - { - "name": "oracle_price_offset", - "type": { - "option": "i32" - } - }, - { - "name": "auction_duration", - "type": { - "option": "u8" - } - }, - { - "name": "auction_start_price", - "type": { - "option": "i64" - } - }, - { - "name": "auction_end_price", - "type": { - "option": "i64" - } - } - ] - } - }, - { - "name": "OrderTriggerCondition", - "type": { - "kind": "enum", - "variants": [ - { - "name": "Above" - }, - { - "name": "Below" - }, - { - "name": "TriggeredAbove" - }, - { - "name": "TriggeredBelow" - } - ] - } - }, - { - "name": "OrderType", - "type": { - "kind": "enum", - "variants": [ - { - "name": "Market" - }, - { - "name": "Limit" - }, - { - "name": "TriggerMarket" - }, - { - "name": "TriggerLimit" - }, - { - "name": "Oracle" - } - ] - } - }, - { - "name": "PartialUnstaking", - "docs": [ - "Account: PartialUnstaking" - ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "escrow", - "type": "pubkey" - }, - { - "name": "amount", - "type": "u64" - }, - { - "name": "expiration", - "type": "i64" - }, - { - "name": "buffers", - "type": { - "array": [ - "u128", - 6 - ] - } - }, - { - "name": "memo", - "type": "string" - } - ] - } - }, - { - "name": "Permission", - "docs": [ - "* Delegate ACL" - ], - "type": { - "kind": "enum", - "variants": [ - { - "name": "DriftInitialize" - }, - { - "name": "DriftUpdateUser" - }, - { - "name": "DriftDeleteUser" - }, - { - "name": "DriftDeposit" - }, - { - "name": "DriftWithdraw" - }, - { - "name": "DriftPlaceOrders" - }, - { - "name": "DriftCancelOrders" - }, - { - "name": "DriftPerpMarket" - }, - { - "name": "DriftSpotMarket" - }, - { - "name": "Stake" - }, - { - "name": "Unstake" - }, - { - "name": "LiquidUnstake" - }, - { - "name": "JupiterSwapAllowlisted" - }, - { - "name": "JupiterSwapAny" - }, - { - "name": "WSolWrap" - }, - { - "name": "WSolUnwrap" - }, - { - "name": "MintShare" - }, - { - "name": "BurnShare" - }, - { - "name": "ForceTransferShare" - }, - { - "name": "SetTokenAccountsStates" - }, - { - "name": "StakeJup" - }, - { - "name": "VoteOnProposal" - }, - { - "name": "UnstakeJup" - }, - { - "name": "JupiterSwapLst" - } - ] - } - }, - { - "name": "PolicyAccount", - "type": { - "kind": "struct", - "fields": [ - { - "name": "locked_until_ts", - "type": "i64" - } - ] - } - }, - { - "name": "PositionDirection", - "type": { - "kind": "enum", - "variants": [ - { - "name": "Long" - }, - { - "name": "Short" - } - ] - } - }, - { - "name": "PostOnlyParam", - "type": { - "kind": "enum", - "variants": [ - { - "name": "None" - }, - { - "name": "MustPostOnly" - }, - { - "name": "TryPostOnly" - }, - { - "name": "Slide" - } - ] - } - }, - { - "name": "Proposal", - "docs": [ - "Account: Proposal" - ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "governor", - "type": "pubkey" - }, - { - "name": "index", - "type": "u64" - }, - { - "name": "bump", - "type": "u8" - }, - { - "name": "proposer", - "type": "pubkey" - }, - { - "name": "quorum_votes", - "type": "u64" - }, - { - "name": "max_option", - "type": "u8" - }, - { - "name": "option_votes", - "type": { - "vec": "u64" - } - }, - { - "name": "canceled_at", - "type": "i64" - }, - { - "name": "created_at", - "type": "i64" - }, - { - "name": "activated_at", - "type": "i64" - }, - { - "name": "voting_ends_at", - "type": "i64" - }, - { - "name": "queued_at", - "type": "i64" - }, - { - "name": "queued_transaction", - "type": "pubkey" - }, - { - "name": "voting_reward", - "type": { - "defined": { - "name": "VotingReward" - } - } - }, - { - "name": "total_claimed_reward", - "type": "u64" - }, - { - "name": "proposal_type", - "type": "u8" - }, - { - "name": "buffers", - "type": { - "array": [ - "u128", - 10 - ] - } - }, - { - "name": "instructions", - "type": { - "vec": { - "defined": { - "name": "ProposalInstruction" - } - } - } - } - ] - } - }, - { - "name": "ProposalAccountMeta", - "type": { - "kind": "struct", - "fields": [ - { - "name": "pubkey", - "type": "pubkey" - }, - { - "name": "is_signer", - "type": "bool" - }, - { - "name": "is_writable", - "type": "bool" - } - ] - } - }, - { - "name": "ProposalInstruction", - "type": { - "kind": "struct", - "fields": [ - { - "name": "program_id", - "type": "pubkey" - }, - { - "name": "keys", - "type": { - "vec": { - "defined": { - "name": "ProposalAccountMeta" - } - } - } - }, - { - "name": "data", - "type": "bytes" - } - ] - } - }, - { - "name": "ShareClassField", - "type": { - "kind": "struct", - "fields": [ - { - "name": "name", - "type": { - "defined": { - "name": "ShareClassFieldName" - } - } - }, - { - "name": "value", - "type": "string" - } - ] - } - }, - { - "name": "ShareClassFieldName", - "type": { - "kind": "enum", - "variants": [ - { - "name": "ISIN" - }, - { - "name": "ShareClassCurrency" - }, - { - "name": "AllInFeeApplied" - }, - { - "name": "AllInFeeDate" - }, - { - "name": "AllInFeeIncludesTransactionCosts" - }, - { - "name": "AllInFeeMaximum" - }, - { - "name": "AppliedSubscriptionFeeInFavourOfDistributor" - }, - { - "name": "AppliedSubscriptionFeeInFavourOfDistributorReferenceDate" - }, - { - "name": "Benchmark" - }, - { - "name": "CountryLegalRegistration" - }, - { - "name": "CountryMarketingDistribution" - }, - { - "name": "CurrencyHedgeShareClass" - }, - { - "name": "CurrencyOfMinimalSubscription" - }, - { - "name": "DistributionDeclarationFrequency" - }, - { - "name": "FullShareClassName" - }, - { - "name": "HasAllInFee" - }, - { - "name": "HasOngoingCharges" - }, - { - "name": "HasPerformanceFee" - }, - { - "name": "HasSubscriptionFeeInFavourOfDistributor" - }, - { - "name": "InvestmentStatus" - }, - { - "name": "IsETF" - }, - { - "name": "IsRDRCompliant" - }, - { - "name": "IsTrailerFeeClean" - }, - { - "name": "ManagementFeeApplied" - }, - { - "name": "ManagementFeeAppliedReferenceDate" - }, - { - "name": "ManagementFeeMaximum" - }, - { - "name": "MaximumSubscriptionFeeInFavourOfDistributor" - }, - { - "name": "MinimalInitialSubscriptionCategory" - }, - { - "name": "MinimalInitialSubscriptionInAmount" - }, - { - "name": "MinimalInitialSubscriptionInShares" - }, - { - "name": "MinimalSubsequentSubscriptionCategory" - }, - { - "name": "MinimalSubsequentSubscriptionInAmount" - }, - { - "name": "MinimalSubsequentSubscriptionInShares" - }, - { - "name": "MinimumSubscriptionFeeInFavourOfDistributor" - }, - { - "name": "OngoingCharges" - }, - { - "name": "OngoingChargesDate" - }, - { - "name": "PerformanceFeeApplied" - }, - { - "name": "PerformanceFeeAppliedReferenceDate" - }, - { - "name": "PerformanceFeeInProspectus" - }, - { - "name": "PerformanceFeeInProspectusReferenceDate" - }, - { - "name": "RecordDateForSRRI" - }, - { - "name": "ShareClassDistributionPolicy" - }, - { - "name": "ShareClassExtension" - }, - { - "name": "ShareClassLaunchDate" - }, - { - "name": "ShareClassLifecycle" - }, - { - "name": "SRRI" - }, - { - "name": "TERExcludingPerformanceFee" - }, - { - "name": "TERExcludingPerformanceFeeDate" - }, - { - "name": "TERIncludingPerformanceFee" - }, - { - "name": "TERIncludingPerformanceFeeDate" - }, - { - "name": "TransferAgentName" - }, - { - "name": "BICOfTransferAgent" - }, - { - "name": "DomicileOfTransferAgent" - }, - { - "name": "FormOfShare" - }, - { - "name": "HasDurationHedge" - }, - { - "name": "TypeOfEqualization" - }, - { - "name": "IsMultiseries" - }, - { - "name": "SeriesIssuance" - }, - { - "name": "SeriesFrequency" - }, - { - "name": "DoesFundIssueSidePocket" - }, - { - "name": "HasRedemptionGates" - }, - { - "name": "TypeOfAlternativeFundStructureVehicle" - }, - { - "name": "BloombergCode" - }, - { - "name": "FIGICode" - }, - { - "name": "AbbreviatedShareClassName" - }, - { - "name": "ValuationFrequency" - }, - { - "name": "NAVPublicationTime" - }, - { - "name": "IsShareClassEligibleForUCITS" - }, - { - "name": "InvestmentStatusDate" - }, - { - "name": "LaunchPrice" - }, - { - "name": "LaunchPriceCurrency" - }, - { - "name": "LaunchPriceDate" - }, - { - "name": "EFAMAMainEFCCategory" - }, - { - "name": "EFAMAEFCClassificationType" - }, - { - "name": "EFAMAActiveEFCClassification" - }, - { - "name": "EFAMAEFCInvestmentTheme" - }, - { - "name": "PricingMethodology" - }, - { - "name": "SinglePricingType" - }, - { - "name": "SwingFactor" - }, - { - "name": "StandardMinimumRemainingAmount" - }, - { - "name": "StandardMinimumRemainingShares" - }, - { - "name": "CurrencyOfMinimumRemainingAmount" - }, - { - "name": "StandardMinimumRemainingCategory" - }, - { - "name": "HurdleRate" - }, - { - "name": "HighWaterMark" - }, - { - "name": "HasAppliedSubscriptionFeeInFavourOfFund" - }, - { - "name": "AppliedSubscriptionFeeInFavourOfFund" - }, - { - "name": "AppliedSubscriptionFeeInFavourOfFundReferenceDate" - }, - { - "name": "MaximumSubscriptionFeeInFavourOfFund" - }, - { - "name": "HasAppliedRedemptionFeeInFavourOfFund" - }, - { - "name": "AppliedRedemptionFeeInFavourOfFund" - }, - { - "name": "AppliedRedemptionFeeInFavourOfFundReferenceDate" - }, - { - "name": "MaximumRedemptionFeeInFavourOfFund" - }, - { - "name": "EquivalentTrailerFeeCleanISIN" - }, - { - "name": "HasSeparateDistributionFee" - }, - { - "name": "DistributionFee" - }, - { - "name": "DistributionFeeMaximum" - }, - { - "name": "IASector" - }, - { - "name": "AbsorbingFundFullShareClassName" - }, - { - "name": "AbsorbingFundShareClassISIN" - }, - { - "name": "AdministrationFeeMaximum" - }, - { - "name": "AnnualDistributionAtFiscalYearEnd" - }, - { - "name": "AnnualDistributionYieldAtFiscalYearEnd" - }, - { - "name": "AppliedRedemptionFeeInFavourOfDistributor" - }, - { - "name": "AppliedRedemptionFeeInFavourOfDistributorReferenceDate" - }, - { - "name": "BankDetailsSSIForPaymentsProvision" - }, - { - "name": "BankDetailsLevelApplication" - }, - { - "name": "BenchmarkBloombergTicker" - }, - { - "name": "CalculationDateOffsetForRedemption" - }, - { - "name": "CalculationDateOffsetForSubscription" - }, - { - "name": "CalendarOrBusinessDaysForCutOffDateOffsetForRedemption" - }, - { - "name": "CalendarOrBusinessDaysForCutOffDateOffsetForSubscription" - }, - { - "name": "CalendarOrBusinessDaysForPrePaymentDaysForSubscription" - }, - { - "name": "CalendarOrBusinessDaysForSettlementPeriodForRedemption" - }, - { - "name": "CalendarOrBusinessDaysForSettlementPeriodForSubscription" - }, - { - "name": "CalendarOrBusinessDaysForTransactions" - }, - { - "name": "CFICode" - }, - { - "name": "ContingentDeferredSalesChargeExitFee" - }, - { - "name": "ContingentDeferredSalesChargeUpfrontFee" - }, - { - "name": "CountryISOCodeAlpha2" - }, - { - "name": "CountryISOCodeAlpha3" - }, - { - "name": "CountryName" - }, - { - "name": "CurrenciesOfMulticurrencyShareClass" - }, - { - "name": "CurrencyOfMinimalOrMaximumRedemption" - }, - { - "name": "CustodianFeeApplied" - }, - { - "name": "CustodianFeeAppliedReferenceDate" - }, - { - "name": "CustodianFeeMaximum" - }, - { - "name": "CutOffDateOffsetForRedemption" - }, - { - "name": "CutOffDateOffsetForSubscription" - }, - { - "name": "CutOffTimeForRedemption" - }, - { - "name": "CutOffTimeForSubscription" - }, - { - "name": "CutOffTimeForSwitchIn" - }, - { - "name": "CutOffTimeForSwitchOut" - }, - { - "name": "DealingDaysOfMultipleRedemptionTradeCycles" - }, - { - "name": "DealingDaysOfMultipleSubscriptionTradeCycles" - }, - { - "name": "DisseminationRecipient" - }, - { - "name": "DistributionFeeReferenceDate" - }, - { - "name": "DoesShareClassApplyMandatoryConversion" - }, - { - "name": "DoesShareClassApplyPartialDealingDays" - }, - { - "name": "DoesShareClassApplyPartialPaymentDays" - }, + }, + { + "name": "MarketType", + "type": { + "kind": "enum", + "variants": [ { - "name": "DormantEndDate" + "name": "Spot" }, { - "name": "DormantStartDate" - }, + "name": "Perp" + } + ] + } + }, + { + "name": "Metadata", + "type": { + "kind": "struct", + "fields": [ { - "name": "ExDividendDateCalendar" + "name": "template", + "type": { + "defined": { + "name": "MetadataType" + } + } }, { - "name": "ExitCostDescription" + "name": "pubkey", + "type": "pubkey" }, { - "name": "HasContingentDeferredSalesChargeFee" - }, + "name": "uri", + "type": "string" + } + ] + } + }, + { + "name": "MetadataType", + "type": { + "kind": "enum", + "variants": [ { - "name": "HasDilutionLevyAppliedByFund" - }, + "name": "Openfunds" + } + ] + } + }, + { + "name": "OrderParams", + "type": { + "kind": "struct", + "fields": [ { - "name": "HasEqualizationMethodForDistribution" + "name": "order_type", + "type": { + "defined": { + "name": "OrderType" + } + } }, { - "name": "HasEqualizationMethodForPerformanceFee" + "name": "market_type", + "type": { + "defined": { + "name": "MarketType" + } + } }, { - "name": "HasForcedRedemption" + "name": "direction", + "type": { + "defined": { + "name": "PositionDirection" + } + } }, { - "name": "HasForwardPricing" + "name": "user_order_id", + "type": "u8" }, { - "name": "HasHighWaterMark" + "name": "base_asset_amount", + "type": "u64" }, { - "name": "HasLockUpForRedemption" + "name": "price", + "type": "u64" }, { - "name": "HasPreNoticeForSwitchIn" + "name": "market_index", + "type": "u16" }, { - "name": "HasPreNoticeForSwitchOut" + "name": "reduce_only", + "type": "bool" }, { - "name": "HasPrePaymentForSubscription" + "name": "post_only", + "type": { + "defined": { + "name": "PostOnlyParam" + } + } }, { - "name": "HasRedemptionFeeInFavourOfDistributor" + "name": "immediate_or_cancel", + "type": "bool" }, { - "name": "HasTripartiteReport" + "name": "max_ts", + "type": { + "option": "i64" + } }, { - "name": "InvestmentStatusDescription" + "name": "trigger_price", + "type": { + "option": "u64" + } }, { - "name": "IrregularRedemptionDealingDays" + "name": "trigger_condition", + "type": { + "defined": { + "name": "OrderTriggerCondition" + } + } }, { - "name": "IrregularSubscriptionDealingDays" + "name": "oracle_price_offset", + "type": { + "option": "i32" + } }, { - "name": "IsMulticurrencyShareClass" + "name": "auction_duration", + "type": { + "option": "u8" + } }, { - "name": "IsRestrictedToSeparateFeeArrangement" + "name": "auction_start_price", + "type": { + "option": "i64" + } }, { - "name": "IsStructuredFinanceProduct" - }, + "name": "auction_end_price", + "type": { + "option": "i64" + } + } + ] + } + }, + { + "name": "OrderTriggerCondition", + "type": { + "kind": "enum", + "variants": [ { - "name": "IsValidISIN" + "name": "Above" }, { - "name": "LiquidationStartDate" + "name": "Below" }, { - "name": "LockUpComment" + "name": "TriggeredAbove" }, { - "name": "LockUpPeriodInDays" - }, + "name": "TriggeredBelow" + } + ] + } + }, + { + "name": "OrderType", + "type": { + "kind": "enum", + "variants": [ { - "name": "ManagementFeeMinimum" + "name": "Market" }, { - "name": "MandatoryShareConversionDescriptionDetails" + "name": "Limit" }, { - "name": "MarketsRelevantToFundTradingCalendar" + "name": "TriggerMarket" }, { - "name": "MaximalNumberOfPossibleDecimalsAmount" + "name": "TriggerLimit" }, { - "name": "MaximalNumberOfPossibleDecimalsNAV" - }, + "name": "Oracle" + } + ] + } + }, + { + "name": "PartialUnstaking", + "docs": [ + "Account: PartialUnstaking" + ], + "type": { + "kind": "struct", + "fields": [ { - "name": "MaximalNumberOfPossibleDecimalsShares" + "name": "escrow", + "type": "pubkey" }, { - "name": "MaximumInitialRedemptionInAmount" + "name": "amount", + "type": "u64" }, { - "name": "MaximumInitialRedemptionInShares" + "name": "expiration", + "type": "i64" }, { - "name": "MaximumRedemptionFeeInFavourOfDistributor" + "name": "buffers", + "type": { + "array": [ + "u128", + 6 + ] + } }, { - "name": "MaximumSubsequentRedemptionInAmount" - }, + "name": "memo", + "type": "string" + } + ] + } + }, + { + "name": "Permission", + "docs": [ + "* Delegate ACL" + ], + "type": { + "kind": "enum", + "variants": [ { - "name": "MaximumSubsequentRedemptionInShares" + "name": "DriftInitialize" }, { - "name": "MergerRatio" + "name": "DriftUpdateUser" }, { - "name": "MinimalInitialRedemptionInAmount" + "name": "DriftDeleteUser" }, { - "name": "MinimalInitialRedemptionInShares" + "name": "DriftDeposit" }, { - "name": "MinimalRedemptionCategory" + "name": "DriftWithdraw" }, { - "name": "MinimalSubsequentRedemptionInAmount" + "name": "DriftPlaceOrders" }, { - "name": "MinimalSubsequentRedemptionInShares" + "name": "DriftCancelOrders" }, { - "name": "MinimumRedemptionFeeInFavourOfDistributor" + "name": "DriftPerpMarket" }, { - "name": "MinimumRedemptionFeeInFavourOfFund" + "name": "DriftSpotMarket" }, { - "name": "MinimumSubscriptionFeeInFavourOfFund" + "name": "Stake" }, { - "name": "MonthlyRedemptionDealingDays" + "name": "Unstake" }, { - "name": "MonthlySubscriptionDealingDays" + "name": "LiquidUnstake" }, { - "name": "NasdaqFundNetworkNFNIdentifier" + "name": "JupiterSwapAllowlisted" }, { - "name": "NoTradingDate" + "name": "JupiterSwapAny" }, { - "name": "NumberOfPossibleRedemptionsWithinPeriod" + "name": "WSolWrap" }, { - "name": "NumberOfPossibleSubscriptionsWithinPeriod" + "name": "WSolUnwrap" }, { - "name": "PartialDealingDaysDateAndTime" + "name": "MintShare" }, { - "name": "PartialPaymentDaysDateAndTime" + "name": "BurnShare" }, { - "name": "PaymentDateCalendar" + "name": "ForceTransferShare" }, { - "name": "PerformanceFeeMinimum" + "name": "SetTokenAccountsStates" }, { - "name": "PreNoticeCutOffForRedemption" + "name": "StakeJup" }, { - "name": "PreNoticeCutOffForSubscription" + "name": "VoteOnProposal" }, { - "name": "PrePaymentCutOffTimeForSubscription" + "name": "UnstakeJup" }, { - "name": "PrePaymentDaysForSubscription" - }, + "name": "JupiterSwapLst" + } + ] + } + }, + { + "name": "PolicyAccount", + "type": { + "kind": "struct", + "fields": [ { - "name": "RecordDateCalendar" - }, + "name": "locked_until_ts", + "type": "i64" + } + ] + } + }, + { + "name": "PositionDirection", + "type": { + "kind": "enum", + "variants": [ { - "name": "RedemptionTradeCyclePeriod" + "name": "Long" }, { - "name": "RoundingMethodForPrices" - }, + "name": "Short" + } + ] + } + }, + { + "name": "PostOnlyParam", + "type": { + "kind": "enum", + "variants": [ { - "name": "RoundingMethodForRedemptionInAmount" + "name": "None" }, { - "name": "RoundingMethodForRedemptionInShares" + "name": "MustPostOnly" }, { - "name": "RoundingMethodForSubscriptionInAmount" + "name": "TryPostOnly" }, { - "name": "RoundingMethodForSubscriptionInShares" - }, + "name": "Slide" + } + ] + } + }, + { + "name": "Proposal", + "docs": [ + "Account: Proposal" + ], + "type": { + "kind": "struct", + "fields": [ { - "name": "SettlementPeriodForRedemption" + "name": "governor", + "type": "pubkey" }, { - "name": "SettlementPeriodForSubscription" + "name": "index", + "type": "u64" }, { - "name": "SettlementPeriodForSwitchIn" + "name": "bump", + "type": "u8" }, { - "name": "SettlementPeriodForSwitchOut" + "name": "proposer", + "type": "pubkey" }, { - "name": "ShareClassDividendType" + "name": "quorum_votes", + "type": "u64" }, { - "name": "SingleRegisterAccountRestrictions" + "name": "max_option", + "type": "u8" }, { - "name": "SubscriptionPeriodEndDate" + "name": "option_votes", + "type": { + "vec": "u64" + } }, { - "name": "SubscriptionPeriodStartDate" + "name": "canceled_at", + "type": "i64" }, { - "name": "SubscriptionTradeCyclePeriod" + "name": "created_at", + "type": "i64" }, { - "name": "SwitchInNoticePeriod" + "name": "activated_at", + "type": "i64" }, { - "name": "SwitchOutNoticePeriod" + "name": "voting_ends_at", + "type": "i64" }, { - "name": "TerminationDate" + "name": "queued_at", + "type": "i64" }, { - "name": "TimeZoneForCutOff" + "name": "queued_transaction", + "type": "pubkey" }, { - "name": "TimeZoneForCutOffUsingTZDatabase" + "name": "voting_reward", + "type": { + "defined": { + "name": "VotingReward" + } + } }, { - "name": "ValuationFrequencyDetail" + "name": "total_claimed_reward", + "type": "u64" }, { - "name": "ValuationReduction" + "name": "proposal_type", + "type": "u8" }, { - "name": "WeeklyRedemptionDealingDays" + "name": "buffers", + "type": { + "array": [ + "u128", + 10 + ] + } }, { - "name": "WeeklySubscriptionDealingDays" - }, + "name": "instructions", + "type": { + "vec": { + "defined": { + "name": "ProposalInstruction" + } + } + } + } + ] + } + }, + { + "name": "ProposalAccountMeta", + "type": { + "kind": "struct", + "fields": [ { - "name": "YearlyRedemptionDealingDays" + "name": "pubkey", + "type": "pubkey" }, { - "name": "YearlySubscriptionDealingDays" + "name": "is_signer", + "type": "bool" }, { - "name": "CUSIP" - }, + "name": "is_writable", + "type": "bool" + } + ] + } + }, + { + "name": "ProposalInstruction", + "type": { + "kind": "struct", + "fields": [ { - "name": "Valor" + "name": "program_id", + "type": "pubkey" }, { - "name": "FundId" + "name": "keys", + "type": { + "vec": { + "defined": { + "name": "ProposalAccountMeta" + } + } + } }, { - "name": "ImageUri" + "name": "data", + "type": "bytes" } ] } @@ -8329,7 +7026,7 @@ } }, { - "name": "fund_id", + "name": "state_pubkey", "type": { "option": "pubkey" } @@ -8346,20 +7043,6 @@ "option": "string" } }, - { - "name": "is_raw_openfunds", - "type": "bool" - }, - { - "name": "raw_openfunds", - "type": { - "option": { - "defined": { - "name": "ShareClassOpenfundsModel" - } - } - } - }, { "name": "allowlist", "type": { @@ -8385,6 +7068,20 @@ { "name": "default_account_state_frozen", "type": "bool" + }, + { + "name": "is_raw_openfunds", + "type": "bool" + }, + { + "name": "raw_openfunds", + "type": { + "option": { + "defined": { + "name": "ShareClassOpenfundsModel" + } + } + } } ] } @@ -8566,36 +7263,132 @@ } }, { - "name": "StateModel", + "name": "StateAccount", "type": { "kind": "struct", "fields": [ { - "name": "id", + "name": "account_type", "type": { - "option": "pubkey" + "defined": { + "name": "AccountType" + } } }, { - "name": "name", + "name": "owner", + "type": "pubkey" + }, + { + "name": "vault", + "type": "pubkey" + }, + { + "name": "enabled", + "type": "bool" + }, + { + "name": "created", + "type": "i64" + }, + { + "name": "engine", + "type": "pubkey" + }, + { + "name": "mints", "type": { - "option": "string" + "vec": "pubkey" + } + }, + { + "name": "metadata", + "type": { + "option": { + "defined": { + "name": "Metadata" + } + } } }, + { + "name": "name", + "type": "string" + }, { "name": "uri", + "type": "string" + }, + { + "name": "assets", + "type": { + "vec": "pubkey" + } + }, + { + "name": "delegate_acls", + "type": { + "vec": { + "defined": { + "name": "DelegateAcl" + } + } + } + }, + { + "name": "integrations", + "type": { + "vec": { + "defined": { + "name": "Integration" + } + } + } + }, + { + "name": "params", + "type": { + "vec": { + "vec": { + "defined": { + "name": "EngineField" + } + } + } + } + } + ] + } + }, + { + "name": "StateModel", + "type": { + "kind": "struct", + "fields": [ + { + "name": "account_type", + "type": { + "option": { + "defined": { + "name": "AccountType" + } + } + } + }, + { + "name": "name", "type": { "option": "string" } }, { - "name": "metadata_uri", + "name": "uri", "type": { "option": "string" } }, { - "name": "is_enabled", + "name": "enabled", "type": { "option": "bool" } @@ -8603,21 +7396,27 @@ { "name": "assets", "type": { - "vec": "pubkey" + "option": { + "vec": "pubkey" + } } }, { "name": "external_vault_accounts", "type": { - "vec": "pubkey" + "option": { + "vec": "pubkey" + } } }, { "name": "mints", "type": { - "vec": { - "defined": { - "name": "ShareClassModel" + "option": { + "vec": { + "defined": { + "name": "ShareClassModel" + } } } } @@ -8655,19 +7454,23 @@ { "name": "delegate_acls", "type": { - "vec": { - "defined": { - "name": "DelegateAcl" + "option": { + "vec": { + "defined": { + "name": "DelegateAcl" + } } } } }, { - "name": "integration_acls", + "name": "integrations", "type": { - "vec": { - "defined": { - "name": "IntegrationAcl" + "option": { + "vec": { + "defined": { + "name": "Integration" + } } } } @@ -8675,24 +7478,36 @@ { "name": "drift_market_indexes_perp", "type": { - "vec": "u32" + "option": { + "vec": "u32" + } } }, { "name": "drift_market_indexes_spot", "type": { - "vec": "u32" + "option": { + "vec": "u32" + } } }, { "name": "drift_order_types", "type": { - "vec": "u32" + "option": { + "vec": "u32" + } } }, { - "name": "is_raw_openfunds", - "type": "bool" + "name": "metadata", + "type": { + "option": { + "defined": { + "name": "Metadata" + } + } + } }, { "name": "raw_openfunds", @@ -8776,22 +7591,22 @@ { "name": "SEED_METADATA", "type": "string", - "value": "\"openfunds\"" + "value": "\"metadata\"" }, { "name": "SEED_MINT", "type": "string", - "value": "\"share\"" + "value": "\"mint\"" }, { "name": "SEED_STATE", "type": "string", - "value": "\"fund\"" + "value": "\"state\"" }, { "name": "SEED_VAULT", "type": "string", - "value": "\"treasury\"" + "value": "\"vault\"" } ] } \ No newline at end of file diff --git a/anchor/target/types/glam.ts b/anchor/target/types/glam.ts index 593e096d..7771ae1d 100644 --- a/anchor/target/types/glam.ts +++ b/anchor/target/types/glam.ts @@ -83,7 +83,28 @@ export type Glam = { }, { "name": "metadata", - "writable": true + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 109, + 101, + 116, + 97, + 100, + 97, + 116, + 97 + ] + }, + { + "kind": "account", + "path": "state" + } + ] + } }, { "name": "signer", @@ -124,7 +145,7 @@ export type Glam = { "- Permission::BurnShare", "", "# Integration required", - "- IntegrationName::Mint" + "- Integration::Mint" ], "discriminator": [ 111, @@ -239,7 +260,7 @@ export type Glam = { "- Permission::VoteOnProposal", "", "# Integration required", - "- IntegrationName::JupiterVote" + "- Integration::JupiterVote" ], "discriminator": [ 20, @@ -264,14 +285,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -354,14 +372,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -413,7 +428,28 @@ export type Glam = { }, { "name": "metadata", - "writable": true + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 109, + 101, + 116, + 97, + 100, + 97, + 116, + 97 + ] + }, + { + "kind": "account", + "path": "state" + } + ] + } }, { "name": "signer", @@ -460,7 +496,28 @@ export type Glam = { }, { "name": "metadata", - "writable": true + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 109, + 101, + 116, + 97, + 100, + 97, + 116, + 97 + ] + }, + { + "kind": "account", + "path": "state" + } + ] + } }, { "name": "vault", @@ -470,14 +527,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -533,14 +587,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -578,7 +629,7 @@ export type Glam = { "- Permission::Unstake", "", "# Integration required", - "- IntegrationName::NativeStaking" + "- Integration::NativeStaking" ], "discriminator": [ 58, @@ -607,14 +658,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -650,7 +698,7 @@ export type Glam = { "- Permission::DriftCancelOrders", "", "# Integration required", - "- IntegrationName::Drift" + "- Integration::Drift" ], "discriminator": [ 98, @@ -681,14 +729,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -753,7 +798,7 @@ export type Glam = { "- Permission::DriftDeleteUser", "", "# Integration required", - "- IntegrationName::Drift" + "- Integration::Drift" ], "discriminator": [ 179, @@ -788,14 +833,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -835,7 +877,7 @@ export type Glam = { "- Permission::DriftDeposit", "", "# Integration required", - "- IntegrationName::Drift" + "- Integration::Drift" ], "discriminator": [ 252, @@ -870,14 +912,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -933,7 +972,7 @@ export type Glam = { "- Permission::DriftInitialize", "", "# Integration required", - "- IntegrationName::Drift" + "- Integration::Drift" ], "discriminator": [ 21, @@ -968,14 +1007,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -1019,7 +1055,7 @@ export type Glam = { "- Additional permission Permission::DriftSpotMarket or Permission::DriftPerpMarket is required depending on market type.", "", "# Integration required", - "- IntegrationName::Drift" + "- Integration::Drift" ], "discriminator": [ 117, @@ -1050,14 +1086,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -1108,7 +1141,7 @@ export type Glam = { "- Permission::DriftUpdateUser", "", "# Integration required", - "- IntegrationName::Drift" + "- Integration::Drift" ], "discriminator": [ 4, @@ -1135,14 +1168,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -1187,7 +1217,7 @@ export type Glam = { "- Permission::DriftUpdateUser", "", "# Integration required", - "- IntegrationName::Drift" + "- Integration::Drift" ], "discriminator": [ 36, @@ -1214,14 +1244,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -1266,7 +1293,7 @@ export type Glam = { "- Permission::DriftUpdateUser", "", "# Integration required", - "- IntegrationName::Drift" + "- Integration::Drift" ], "discriminator": [ 157, @@ -1293,14 +1320,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -1345,7 +1369,7 @@ export type Glam = { "- Permission::DriftWithdraw", "", "# Integration required", - "- IntegrationName::Drift" + "- Integration::Drift" ], "discriminator": [ 86, @@ -1383,14 +1407,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -1447,7 +1468,7 @@ export type Glam = { "- Permission::ForceTransferShare", "", "# Integration required", - "- IntegrationName::Mint" + "- Integration::Mint" ], "discriminator": [ 71, @@ -1622,7 +1643,7 @@ export type Glam = { "- Permission::StakeJup", "", "# Integration required", - "- IntegrationName::JupiterVote" + "- Integration::JupiterVote" ], "discriminator": [ 5, @@ -1646,14 +1667,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -1712,7 +1730,7 @@ export type Glam = { "- Permission::StakeJup", "", "# Integration required", - "- IntegrationName::JupiterVote" + "- Integration::JupiterVote" ], "discriminator": [ 148, @@ -1736,14 +1754,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -1792,7 +1807,7 @@ export type Glam = { "- Permission::Stake", "", "# Integration required", - "- IntegrationName::NativeStaking" + "- Integration::NativeStaking" ], "discriminator": [ 71, @@ -1822,14 +1837,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -1917,10 +1929,11 @@ export type Glam = { { "kind": "const", "value": [ - 102, - 117, - 110, - 100 + 115, + 116, + 97, + 116, + 101 ] }, { @@ -1935,22 +1948,18 @@ export type Glam = { } }, { - "name": "metadata", + "name": "vault", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ - 111, - 112, - 101, - 110, - 102, + 118, + 97, 117, - 110, - 100, - 115 + 108, + 116 ] }, { @@ -1961,21 +1970,26 @@ export type Glam = { } }, { - "name": "vault", + "name": "signer", + "writable": true, + "signer": true + }, + { + "name": "metadata", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ - 116, - 114, + 109, 101, + 116, 97, - 115, - 117, - 114, - 121 + 100, + 97, + 116, + 97 ] }, { @@ -1985,11 +1999,6 @@ export type Glam = { ] } }, - { - "name": "signer", - "writable": true, - "signer": true - }, { "name": "systemProgram", "address": "11111111111111111111111111111111" @@ -2023,7 +2032,7 @@ export type Glam = { "- Permission::JupiterSwapLst: input and output assets are both LST.", "", "# Integration required", - "- IntegrationName::JupiterSwap" + "- Integration::JupiterSwap" ], "discriminator": [ 116, @@ -2048,14 +2057,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -2254,7 +2260,7 @@ export type Glam = { "- Permission::Unstake", "", "# Integration required", - "- IntegrationName::Marinade" + "- Integration::Marinade" ], "discriminator": [ 14, @@ -2284,14 +2290,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -2347,7 +2350,7 @@ export type Glam = { "- Permission::Unstake", "", "# Integration required", - "- IntegrationName::Marinade" + "- Integration::Marinade" ], "discriminator": [ 117, @@ -2377,14 +2380,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -2464,7 +2464,7 @@ export type Glam = { "- Permission::Stake", "", "# Integration required", - "- IntegrationName::Marinade" + "- Integration::Marinade" ], "discriminator": [ 64, @@ -2493,14 +2493,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -2665,7 +2662,7 @@ export type Glam = { "- Permission::Stake", "", "# Integration required", - "- IntegrationName::Marinade" + "- Integration::Marinade" ], "discriminator": [ 69, @@ -2694,14 +2691,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -2877,7 +2871,7 @@ export type Glam = { "- Permission::LiquidUnstake", "", "# Integration required", - "- IntegrationName::Marinade" + "- Integration::Marinade" ], "discriminator": [ 29, @@ -2906,14 +2900,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -2983,7 +2974,7 @@ export type Glam = { "- Permission::UnstakeJup", "", "# Integration required", - "- IntegrationName::JupiterVote" + "- Integration::JupiterVote" ], "discriminator": [ 190, @@ -3007,14 +2998,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -3064,7 +3052,7 @@ export type Glam = { "- Permission::Stake", "", "# Integration required", - "- IntegrationName::NativeStaking" + "- Integration::NativeStaking" ], "discriminator": [ 173, @@ -3094,14 +3082,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -3152,7 +3137,7 @@ export type Glam = { "- Permission::MintShare", "", "# Integration required", - "- IntegrationName::Mint" + "- Integration::Mint" ], "discriminator": [ 145, @@ -3266,7 +3251,7 @@ export type Glam = { "- Permission::VoteOnProposal", "", "# Integration required", - "- IntegrationName::JupiterVote" + "- Integration::JupiterVote" ], "discriminator": [ 163, @@ -3290,14 +3275,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -3345,7 +3327,7 @@ export type Glam = { "- Permission::UnstakeJup", "", "# Integration required", - "- IntegrationName::JupiterVote" + "- Integration::JupiterVote" ], "discriminator": [ 201, @@ -3369,14 +3351,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -3469,14 +3448,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -3560,7 +3536,7 @@ export type Glam = { "- Permission::Unstake", "", "# Integration required", - "- IntegrationName::NativeStaking" + "- Integration::NativeStaking" ], "discriminator": [ 240, @@ -3590,14 +3566,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -3701,7 +3674,7 @@ export type Glam = { "- Permission::SetTokenAccountsStates", "", "# Integration required", - "- IntegrationName::Mint" + "- Integration::Mint" ], "discriminator": [ 50, @@ -3758,7 +3731,7 @@ export type Glam = { "- Permission::Unstake", "", "# Integration required", - "- IntegrationName::NativeStaking" + "- Integration::NativeStaking" ], "discriminator": [ 130, @@ -3788,14 +3761,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -3854,7 +3824,7 @@ export type Glam = { "- Permission::Stake", "", "# Integration required", - "- IntegrationName::SplStakePool or IntegrationName::SanctumStakePool, depending on the stake pool program used." + "- Integration::SplStakePool or Integration::SanctumStakePool, depending on the stake pool program used." ], "discriminator": [ 147, @@ -3883,14 +3853,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -4043,7 +4010,7 @@ export type Glam = { "- Permission::Stake", "", "# Integration required", - "- IntegrationName::SplStakePool or IntegrationName::SanctumStakePool, depending on the stake pool program used." + "- Integration::SplStakePool or Integration::SanctumStakePool, depending on the stake pool program used." ], "discriminator": [ 212, @@ -4073,14 +4040,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -4256,7 +4220,7 @@ export type Glam = { "- Permission::LiquidUnstake", "", "# Integration required", - "- IntegrationName::SplStakePool or IntegrationName::SanctumStakePool, depending on the stake pool program used." + "- Integration::SplStakePool or Integration::SanctumStakePool, depending on the stake pool program used." ], "discriminator": [ 179, @@ -4285,14 +4249,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -4370,7 +4331,7 @@ export type Glam = { "- Permission::Unstake", "", "# Integration required", - "- IntegrationName::SplStakePool or IntegrationName::SanctumStakePool, depending on the stake pool program used." + "- Integration::SplStakePool or Integration::SanctumStakePool, depending on the stake pool program used." ], "discriminator": [ 7, @@ -4400,14 +4361,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -4515,14 +4473,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -4686,7 +4641,7 @@ export type Glam = { "- Permission::UnstakeJup", "", "# Integration required", - "- IntegrationName::JupiterVote" + "- Integration::JupiterVote" ], "discriminator": [ 163, @@ -4710,14 +4665,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -5023,14 +4975,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -5185,7 +5134,7 @@ export type Glam = { "- Permission::UnstakeJup", "", "# Integration required", - "- IntegrationName::JupiterVote" + "- Integration::JupiterVote" ], "discriminator": [ 210, @@ -5209,14 +5158,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -5270,7 +5216,7 @@ export type Glam = { "- Permission::Unstake", "", "# Integration required", - "- IntegrationName::NativeStaking" + "- Integration::NativeStaking" ], "discriminator": [ 93, @@ -5300,14 +5246,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -5344,7 +5287,7 @@ export type Glam = { "- Permission::UnstakeJup", "", "# Integration required", - "- IntegrationName::JupiterVote" + "- Integration::JupiterVote" ], "discriminator": [ 201, @@ -5368,14 +5311,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -5454,14 +5394,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -5611,14 +5548,11 @@ export type Glam = { { "kind": "const", "value": [ - 116, - 114, - 101, + 118, 97, - 115, 117, - 114, - 121 + 108, + 116 ] }, { @@ -5762,32 +5696,6 @@ export type Glam = { 155 ] }, - { - "name": "fundAccount", - "discriminator": [ - 49, - 104, - 168, - 214, - 134, - 180, - 173, - 154 - ] - }, - { - "name": "fundMetadataAccount", - "discriminator": [ - 214, - 24, - 35, - 92, - 16, - 104, - 166, - 6 - ] - }, { "name": "governor", "discriminator": [ @@ -5853,6 +5761,19 @@ export type Glam = { 33 ] }, + { + "name": "stateAccount", + "discriminator": [ + 142, + 247, + 54, + 95, + 85, + 133, + 249, + 103 + ] + }, { "name": "vote", "discriminator": [ @@ -5870,223 +5791,88 @@ export type Glam = { "errors": [ { "code": 6000, - "name": "invalidName", - "msg": "Name too long: max 50 chars" + "name": "invalidAssetForSwap", + "msg": "Asset cannot be swapped" }, { "code": 6001, - "name": "invalidSymbol", - "msg": "Symbol too long: max 50 chars" - }, - { - "code": 6002, - "name": "invalidUri", - "msg": "Uri too long: max 20" - }, - { - "code": 6003, - "name": "invalidAssetsLen", - "msg": "Too many assets: max 100" - }, - { - "code": 6004, - "name": "disabled", - "msg": "State account is disabled" - }, - { - "code": 6005, - "name": "noShareClass", - "msg": "No share class found" - }, - { - "code": 6006, - "name": "shareClassesNotClosed", - "msg": "Glam state account can't be closed. Close share classes first" - }, - { - "code": 6007, - "name": "closeNotEmptyError", - "msg": "Error closing state account: not empty" - }, - { - "code": 6008, - "name": "withdrawDenied", - "msg": "Withdraw denied. Only vaults allow withdraws (funds and mints don't)" + "name": "invalidSwap", + "msg": "Swap failed" } ], "types": [ { - "name": "companyField", + "name": "accountType", "type": { - "kind": "struct", - "fields": [ + "kind": "enum", + "variants": [ { - "name": "name", - "type": { - "defined": { - "name": "companyFieldName" - } - } + "name": "vault" }, { - "name": "value", - "type": "string" + "name": "mint" + }, + { + "name": "fund" } ] } }, { - "name": "companyFieldName", + "name": "companyModel", "type": { - "kind": "enum", - "variants": [ - { - "name": "fundGroupName" - }, - { - "name": "manCo" - }, - { - "name": "domicileOfManCo" - }, - { - "name": "bicOfCustodian" - }, + "kind": "struct", + "fields": [ { - "name": "collateralManagerName" + "name": "fundGroupName", + "type": { + "option": "string" + } }, { - "name": "custodianBankName" + "name": "manCo", + "type": { + "option": "string" + } }, { - "name": "domicileOfCustodianBank" + "name": "domicileOfManCo", + "type": { + "option": "string" + } }, { - "name": "fundAdministratorName" + "name": "emailAddressOfManCo", + "type": { + "option": "string" + } }, { - "name": "fundAdvisorName" - }, + "name": "fundWebsiteOfManCo", + "type": { + "option": "string" + } + } + ] + } + }, + { + "name": "createdModel", + "type": { + "kind": "struct", + "fields": [ { - "name": "fundPromoterName" + "name": "key", + "type": { + "array": [ + "u8", + 8 + ] + } }, { - "name": "isSelfManagedInvestmentCompany" - }, - { - "name": "leiOfCustodianBank" - }, - { - "name": "leiOfManCo" - }, - { - "name": "portfolioManagingCompanyName" - }, - { - "name": "securitiesLendingCounterpartyName" - }, - { - "name": "swapCounterpartyName" - }, - { - "name": "addressofManCo" - }, - { - "name": "auditorName" - }, - { - "name": "cityofManCo" - }, - { - "name": "emailAddressOfManCo" - }, - { - "name": "fundWebsiteOfManCo" - }, - { - "name": "isUnpriSignatory" - }, - { - "name": "phoneCountryCodeofManCo" - }, - { - "name": "phoneNumberofManCo" - }, - { - "name": "subInvestmentAdvisorName" - }, - { - "name": "zipCodeofManCo" - }, - { - "name": "domicileOfUmbrella" - }, - { - "name": "hasUmbrella" - }, - { - "name": "leiOfUmbrella" - }, - { - "name": "umbrella" - }, - { - "name": "globalIntermediaryIdentificationNumberOfUmbrella" - } - ] - } - }, - { - "name": "companyModel", - "type": { - "kind": "struct", - "fields": [ - { - "name": "fundGroupName", - "type": { - "option": "string" - } - }, - { - "name": "manCo", - "type": { - "option": "string" - } - }, - { - "name": "domicileOfManCo", - "type": { - "option": "string" - } - }, - { - "name": "emailAddressOfManCo", - "type": { - "option": "string" - } - }, - { - "name": "fundWebsiteOfManCo", - "type": { - "option": "string" - } - } - ] - } - }, - { - "name": "createdModel", - "type": { - "kind": "struct", - "fields": [ - { - "name": "key", - "type": { - "array": [ - "u8", - 8 - ] - } + "name": "createdAt", + "type": "i64" }, { "name": "owner", @@ -6115,6 +5901,10 @@ export type Glam = { } } } + }, + { + "name": "expiresAt", + "type": "i64" } ] } @@ -6148,30 +5938,12 @@ export type Glam = { "type": { "kind": "enum", "variants": [ - { - "name": "timeCreated" - }, - { - "name": "isEnabled" - }, - { - "name": "assets" - }, - { - "name": "assetsWeights" - }, { "name": "shareClassAllowlist" }, { "name": "shareClassBlocklist" }, - { - "name": "delegateAcls" - }, - { - "name": "integrationAcls" - }, { "name": "externalVaultAccounts" }, @@ -6324,36 +6096,6 @@ export type Glam = { } } ] - }, - { - "name": "vecDelegateAcl", - "fields": [ - { - "name": "val", - "type": { - "vec": { - "defined": { - "name": "delegateAcl" - } - } - } - } - ] - }, - { - "name": "vecIntegrationAcl", - "fields": [ - { - "name": "val", - "type": { - "vec": { - "defined": { - "name": "integrationAcl" - } - } - } - } - ] } ] } @@ -6423,1890 +6165,845 @@ export type Glam = { } }, { - "name": "fundAccount", + "name": "fundOpenfundsModel", "type": { "kind": "struct", "fields": [ { - "name": "owner", - "type": "pubkey" - }, - { - "name": "vault", - "type": "pubkey" - }, - { - "name": "metadata", - "type": "pubkey" - }, - { - "name": "engine", - "type": "pubkey" + "name": "fundDomicileAlpha2", + "type": { + "option": "string" + } }, { - "name": "mints", + "name": "legalFundNameIncludingUmbrella", "type": { - "vec": "pubkey" + "option": "string" } }, { - "name": "name", - "type": "string" + "name": "fiscalYearEnd", + "type": { + "option": "string" + } }, { - "name": "uri", - "type": "string" + "name": "fundCurrency", + "type": { + "option": "string" + } }, { - "name": "metadataUri", - "type": "string" + "name": "fundLaunchDate", + "type": { + "option": "string" + } }, { - "name": "params", + "name": "investmentObjective", "type": { - "vec": { - "vec": { - "defined": { - "name": "engineField" - } - } - } + "option": "string" } - } - ] - } - }, - { - "name": "fundField", - "type": { - "kind": "struct", - "fields": [ + }, { - "name": "name", + "name": "isEtc", "type": { - "defined": { - "name": "fundFieldName" - } + "option": "bool" } }, { - "name": "value", - "type": "string" - } - ] - } - }, - { - "name": "fundFieldName", - "type": { - "kind": "enum", - "variants": [ - { - "name": "fundDomicileAlpha2" + "name": "isEuDirectiveRelevant", + "type": { + "option": "bool" + } }, { - "name": "fundDomicileAlpha3" + "name": "isFundOfFunds", + "type": { + "option": "bool" + } }, { - "name": "legalFundNameIncludingUmbrella" + "name": "isPassiveFund", + "type": { + "option": "bool" + } }, { - "name": "fiscalYearEnd" + "name": "isReit", + "type": { + "option": "bool" + } }, { - "name": "fundCurrency" + "name": "legalForm", + "type": { + "option": "string" + } }, { - "name": "fundLaunchDate" + "name": "legalFundNameOnly", + "type": { + "option": "string" + } }, { - "name": "investmentObjective" + "name": "openEndedOrClosedEndedFundStructure", + "type": { + "option": "string" + } }, { - "name": "isEtc" + "name": "typeOfEuDirective", + "type": { + "option": "string" + } }, { - "name": "isEuDirectiveRelevant" - }, + "name": "ucitsVersion", + "type": { + "option": "string" + } + } + ] + } + }, + { + "name": "governanceParameters", + "type": { + "kind": "struct", + "fields": [ { - "name": "isFundOfFunds" + "name": "votingDelay", + "type": "u64" }, { - "name": "isPassiveFund" + "name": "votingPeriod", + "type": "u64" }, { - "name": "isReit" + "name": "quorumVotes", + "type": "u64" }, { - "name": "legalForm" - }, - { - "name": "legalFundNameOnly" - }, - { - "name": "openEndedOrClosedEndedFundStructure" - }, - { - "name": "typeOfEuDirective" - }, - { - "name": "ucitsVersion" - }, - { - "name": "currencyHedgePortfolio" - }, - { - "name": "depositoryName" - }, - { - "name": "fundValuationPoint" - }, - { - "name": "fundValuationPointTimeZone" - }, - { - "name": "fundValuationPointTimeZoneUsingTzDatabase" - }, - { - "name": "hasCollateralManager" - }, - { - "name": "hasEmbeddedDerivatives" - }, - { - "name": "hasSecuritiesLending" - }, - { - "name": "hasSwap" - }, - { - "name": "isLeveraged" - }, - { - "name": "isShariaCompliant" - }, - { - "name": "isShort" - }, - { - "name": "leIofDepositoryBank" - }, - { - "name": "leiOfFund" - }, - { - "name": "locationOfBearerShare" - }, - { - "name": "locationOfShareRegister" - }, - { - "name": "maximumLeverageInFund" - }, + "name": "timelockDelaySeconds", + "type": "i64" + } + ] + } + }, + { + "name": "governor", + "docs": [ + "Account: Governor" + ], + "type": { + "kind": "struct", + "fields": [ { - "name": "miFidSecuritiesClassification" + "name": "base", + "type": "pubkey" }, { - "name": "moneyMarketTypeOfFund" + "name": "bump", + "type": "u8" }, { - "name": "trusteeName" + "name": "proposalCount", + "type": "u64" }, { - "name": "auMFund" + "name": "locker", + "type": "pubkey" }, { - "name": "auMFundDate" + "name": "smartWallet", + "type": "pubkey" }, { - "name": "noSFund" + "name": "params", + "type": { + "defined": { + "name": "governanceParameters" + } + } }, { - "name": "noSFundDate" - } - ] - } - }, - { - "name": "fundManagerField", - "type": { - "kind": "struct", - "fields": [ - { - "name": "name", + "name": "votingReward", "type": { "defined": { - "name": "fundManagerFieldName" + "name": "votingReward" } } }, { - "name": "value", - "type": "string" + "name": "buffers", + "type": { + "array": [ + "u128", + 32 + ] + } } ] } }, { - "name": "fundManagerFieldName", + "name": "integration", "type": { "kind": "enum", "variants": [ { - "name": "portfolioManagerForename" - }, - { - "name": "portfolioManagerName" + "name": "drift" }, { - "name": "portfolioManagerYearOfBirth" + "name": "splStakePool" }, { - "name": "portfolioManagerYearOfExperienceStart" + "name": "sanctumStakePool" }, { - "name": "portfolioManagerBriefBiography" + "name": "nativeStaking" }, { - "name": "portfolioManagerType" + "name": "marinade" }, { - "name": "portfolioManagerRoleStartingDate" + "name": "jupiterSwap" }, { - "name": "portfolioManagerRoleEndDate" + "name": "jupiterVote" } ] } }, { - "name": "fundMetadataAccount", + "name": "locker", + "docs": [ + "Account: Locker" + ], "type": { "kind": "struct", "fields": [ { - "name": "statePubkey", + "name": "base", "type": "pubkey" }, { - "name": "company", - "type": { - "vec": { - "defined": { - "name": "companyField" - } - } - } + "name": "bump", + "type": "u8" }, { - "name": "fund", - "type": { - "vec": { - "defined": { - "name": "fundField" - } - } - } + "name": "tokenMint", + "type": "pubkey" + }, + { + "name": "lockedSupply", + "type": "u64" + }, + { + "name": "totalEscrow", + "type": "u64" + }, + { + "name": "governor", + "type": "pubkey" }, { - "name": "shareClasses", + "name": "params", "type": { - "vec": { - "vec": { - "defined": { - "name": "shareClassField" - } - } + "defined": { + "name": "lockerParams" } } }, { - "name": "fundManagers", + "name": "buffers", "type": { - "vec": { - "vec": { - "defined": { - "name": "fundManagerField" - } - } - } + "array": [ + "u128", + 32 + ] } } ] } }, { - "name": "fundOpenfundsModel", + "name": "lockerParams", "type": { "kind": "struct", "fields": [ { - "name": "fundDomicileAlpha2", - "type": { - "option": "string" - } - }, - { - "name": "legalFundNameIncludingUmbrella", - "type": { - "option": "string" - } - }, - { - "name": "fiscalYearEnd", - "type": { - "option": "string" - } - }, - { - "name": "fundCurrency", - "type": { - "option": "string" - } - }, - { - "name": "fundLaunchDate", - "type": { - "option": "string" - } - }, - { - "name": "investmentObjective", - "type": { - "option": "string" - } + "name": "maxStakeVoteMultiplier", + "type": "u8" }, { - "name": "isEtc", - "type": { - "option": "bool" - } + "name": "minStakeDuration", + "type": "u64" }, { - "name": "isEuDirectiveRelevant", - "type": { - "option": "bool" - } + "name": "maxStakeDuration", + "type": "u64" }, { - "name": "isFundOfFunds", - "type": { - "option": "bool" - } - }, + "name": "proposalActivationMinVotes", + "type": "u64" + } + ] + } + }, + { + "name": "managerKind", + "type": { + "kind": "enum", + "variants": [ { - "name": "isPassiveFund", - "type": { - "option": "bool" - } + "name": "wallet" }, { - "name": "isReit", - "type": { - "option": "bool" - } - }, + "name": "squads" + } + ] + } + }, + { + "name": "managerModel", + "type": { + "kind": "struct", + "fields": [ { - "name": "legalForm", + "name": "portfolioManagerName", "type": { "option": "string" } }, { - "name": "legalFundNameOnly", + "name": "pubkey", "type": { - "option": "string" + "option": "pubkey" } }, { - "name": "openEndedOrClosedEndedFundStructure", + "name": "kind", "type": { - "option": "string" - } - }, - { - "name": "typeOfEuDirective", - "type": { - "option": "string" - } - }, - { - "name": "ucitsVersion", - "type": { - "option": "string" - } - } - ] - } - }, - { - "name": "governanceParameters", - "type": { - "kind": "struct", - "fields": [ - { - "name": "votingDelay", - "type": "u64" - }, - { - "name": "votingPeriod", - "type": "u64" - }, - { - "name": "quorumVotes", - "type": "u64" - }, - { - "name": "timelockDelaySeconds", - "type": "i64" - } - ] - } - }, - { - "name": "governor", - "docs": [ - "Account: Governor" - ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "base", - "type": "pubkey" - }, - { - "name": "bump", - "type": "u8" - }, - { - "name": "proposalCount", - "type": "u64" - }, - { - "name": "locker", - "type": "pubkey" - }, - { - "name": "smartWallet", - "type": "pubkey" - }, - { - "name": "params", - "type": { - "defined": { - "name": "governanceParameters" - } - } - }, - { - "name": "votingReward", - "type": { - "defined": { - "name": "votingReward" - } - } - }, - { - "name": "buffers", - "type": { - "array": [ - "u128", - 32 - ] - } - } - ] - } - }, - { - "name": "integrationAcl", - "type": { - "kind": "struct", - "fields": [ - { - "name": "name", - "type": { - "defined": { - "name": "integrationName" - } - } - }, - { - "name": "features", - "type": { - "vec": { + "option": { "defined": { - "name": "integrationFeature" + "name": "managerKind" } } } } ] } - }, - { - "name": "integrationFeature", - "type": { - "kind": "enum", - "variants": [ - { - "name": "all" - } - ] - } - }, - { - "name": "integrationName", - "docs": [ - "* Integration ACL" - ], - "type": { - "kind": "enum", - "variants": [ - { - "name": "drift" - }, - { - "name": "splStakePool" - }, - { - "name": "sanctumStakePool" - }, - { - "name": "nativeStaking" - }, - { - "name": "marinade" - }, - { - "name": "jupiterSwap" - }, - { - "name": "mint" - }, - { - "name": "jupiterVote" - } - ] - } - }, - { - "name": "locker", - "docs": [ - "Account: Locker" - ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "base", - "type": "pubkey" - }, - { - "name": "bump", - "type": "u8" - }, - { - "name": "tokenMint", - "type": "pubkey" - }, - { - "name": "lockedSupply", - "type": "u64" - }, - { - "name": "totalEscrow", - "type": "u64" - }, - { - "name": "governor", - "type": "pubkey" - }, - { - "name": "params", - "type": { - "defined": { - "name": "lockerParams" - } - } - }, - { - "name": "buffers", - "type": { - "array": [ - "u128", - 32 - ] - } - } - ] - } - }, - { - "name": "lockerParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "maxStakeVoteMultiplier", - "type": "u8" - }, - { - "name": "minStakeDuration", - "type": "u64" - }, - { - "name": "maxStakeDuration", - "type": "u64" - }, - { - "name": "proposalActivationMinVotes", - "type": "u64" - } - ] - } - }, - { - "name": "managerKind", - "type": { - "kind": "enum", - "variants": [ - { - "name": "wallet" - }, - { - "name": "squads" - } - ] - } - }, - { - "name": "managerModel", - "type": { - "kind": "struct", - "fields": [ - { - "name": "portfolioManagerName", - "type": { - "option": "string" - } - }, - { - "name": "pubkey", - "type": { - "option": "pubkey" - } - }, - { - "name": "kind", - "type": { - "option": { - "defined": { - "name": "managerKind" - } - } - } - } - ] - } - }, - { - "name": "marketType", - "type": { - "kind": "enum", - "variants": [ - { - "name": "spot" - }, - { - "name": "perp" - } - ] - } - }, - { - "name": "orderParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "orderType", - "type": { - "defined": { - "name": "orderType" - } - } - }, - { - "name": "marketType", - "type": { - "defined": { - "name": "marketType" - } - } - }, - { - "name": "direction", - "type": { - "defined": { - "name": "positionDirection" - } - } - }, - { - "name": "userOrderId", - "type": "u8" - }, - { - "name": "baseAssetAmount", - "type": "u64" - }, - { - "name": "price", - "type": "u64" - }, - { - "name": "marketIndex", - "type": "u16" - }, - { - "name": "reduceOnly", - "type": "bool" - }, - { - "name": "postOnly", - "type": { - "defined": { - "name": "postOnlyParam" - } - } - }, - { - "name": "immediateOrCancel", - "type": "bool" - }, - { - "name": "maxTs", - "type": { - "option": "i64" - } - }, - { - "name": "triggerPrice", - "type": { - "option": "u64" - } - }, - { - "name": "triggerCondition", - "type": { - "defined": { - "name": "orderTriggerCondition" - } - } - }, - { - "name": "oraclePriceOffset", - "type": { - "option": "i32" - } - }, - { - "name": "auctionDuration", - "type": { - "option": "u8" - } - }, - { - "name": "auctionStartPrice", - "type": { - "option": "i64" - } - }, - { - "name": "auctionEndPrice", - "type": { - "option": "i64" - } - } - ] - } - }, - { - "name": "orderTriggerCondition", - "type": { - "kind": "enum", - "variants": [ - { - "name": "above" - }, - { - "name": "below" - }, - { - "name": "triggeredAbove" - }, - { - "name": "triggeredBelow" - } - ] - } - }, - { - "name": "orderType", - "type": { - "kind": "enum", - "variants": [ - { - "name": "market" - }, - { - "name": "limit" - }, - { - "name": "triggerMarket" - }, - { - "name": "triggerLimit" - }, - { - "name": "oracle" - } - ] - } - }, - { - "name": "partialUnstaking", - "docs": [ - "Account: PartialUnstaking" - ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "escrow", - "type": "pubkey" - }, - { - "name": "amount", - "type": "u64" - }, - { - "name": "expiration", - "type": "i64" - }, - { - "name": "buffers", - "type": { - "array": [ - "u128", - 6 - ] - } - }, - { - "name": "memo", - "type": "string" - } - ] - } - }, - { - "name": "permission", - "docs": [ - "* Delegate ACL" - ], - "type": { - "kind": "enum", - "variants": [ - { - "name": "driftInitialize" - }, - { - "name": "driftUpdateUser" - }, - { - "name": "driftDeleteUser" - }, - { - "name": "driftDeposit" - }, - { - "name": "driftWithdraw" - }, - { - "name": "driftPlaceOrders" - }, - { - "name": "driftCancelOrders" - }, - { - "name": "driftPerpMarket" - }, - { - "name": "driftSpotMarket" - }, - { - "name": "stake" - }, - { - "name": "unstake" - }, - { - "name": "liquidUnstake" - }, - { - "name": "jupiterSwapAllowlisted" - }, - { - "name": "jupiterSwapAny" - }, - { - "name": "wSolWrap" - }, - { - "name": "wSolUnwrap" - }, - { - "name": "mintShare" - }, - { - "name": "burnShare" - }, - { - "name": "forceTransferShare" - }, - { - "name": "setTokenAccountsStates" - }, - { - "name": "stakeJup" - }, - { - "name": "voteOnProposal" - }, - { - "name": "unstakeJup" - }, - { - "name": "jupiterSwapLst" - } - ] - } - }, - { - "name": "policyAccount", - "type": { - "kind": "struct", - "fields": [ - { - "name": "lockedUntilTs", - "type": "i64" - } - ] - } - }, - { - "name": "positionDirection", - "type": { - "kind": "enum", - "variants": [ - { - "name": "long" - }, - { - "name": "short" - } - ] - } - }, - { - "name": "postOnlyParam", - "type": { - "kind": "enum", - "variants": [ - { - "name": "none" - }, - { - "name": "mustPostOnly" - }, - { - "name": "tryPostOnly" - }, - { - "name": "slide" - } - ] - } - }, - { - "name": "proposal", - "docs": [ - "Account: Proposal" - ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "governor", - "type": "pubkey" - }, - { - "name": "index", - "type": "u64" - }, - { - "name": "bump", - "type": "u8" - }, - { - "name": "proposer", - "type": "pubkey" - }, - { - "name": "quorumVotes", - "type": "u64" - }, - { - "name": "maxOption", - "type": "u8" - }, - { - "name": "optionVotes", - "type": { - "vec": "u64" - } - }, - { - "name": "canceledAt", - "type": "i64" - }, - { - "name": "createdAt", - "type": "i64" - }, - { - "name": "activatedAt", - "type": "i64" - }, - { - "name": "votingEndsAt", - "type": "i64" - }, - { - "name": "queuedAt", - "type": "i64" - }, - { - "name": "queuedTransaction", - "type": "pubkey" - }, - { - "name": "votingReward", - "type": { - "defined": { - "name": "votingReward" - } - } - }, - { - "name": "totalClaimedReward", - "type": "u64" - }, - { - "name": "proposalType", - "type": "u8" - }, - { - "name": "buffers", - "type": { - "array": [ - "u128", - 10 - ] - } - }, - { - "name": "instructions", - "type": { - "vec": { - "defined": { - "name": "proposalInstruction" - } - } - } - } - ] - } - }, - { - "name": "proposalAccountMeta", - "type": { - "kind": "struct", - "fields": [ - { - "name": "pubkey", - "type": "pubkey" - }, - { - "name": "isSigner", - "type": "bool" - }, - { - "name": "isWritable", - "type": "bool" - } - ] - } - }, - { - "name": "proposalInstruction", - "type": { - "kind": "struct", - "fields": [ - { - "name": "programId", - "type": "pubkey" - }, - { - "name": "keys", - "type": { - "vec": { - "defined": { - "name": "proposalAccountMeta" - } - } - } - }, - { - "name": "data", - "type": "bytes" - } - ] - } - }, - { - "name": "shareClassField", - "type": { - "kind": "struct", - "fields": [ - { - "name": "name", - "type": { - "defined": { - "name": "shareClassFieldName" - } - } - }, - { - "name": "value", - "type": "string" - } - ] - } - }, - { - "name": "shareClassFieldName", - "type": { - "kind": "enum", - "variants": [ - { - "name": "isin" - }, - { - "name": "shareClassCurrency" - }, - { - "name": "allInFeeApplied" - }, - { - "name": "allInFeeDate" - }, - { - "name": "allInFeeIncludesTransactionCosts" - }, - { - "name": "allInFeeMaximum" - }, - { - "name": "appliedSubscriptionFeeInFavourOfDistributor" - }, - { - "name": "appliedSubscriptionFeeInFavourOfDistributorReferenceDate" - }, - { - "name": "benchmark" - }, - { - "name": "countryLegalRegistration" - }, - { - "name": "countryMarketingDistribution" - }, - { - "name": "currencyHedgeShareClass" - }, - { - "name": "currencyOfMinimalSubscription" - }, - { - "name": "distributionDeclarationFrequency" - }, - { - "name": "fullShareClassName" - }, - { - "name": "hasAllInFee" - }, - { - "name": "hasOngoingCharges" - }, - { - "name": "hasPerformanceFee" - }, - { - "name": "hasSubscriptionFeeInFavourOfDistributor" - }, - { - "name": "investmentStatus" - }, - { - "name": "isEtf" - }, - { - "name": "isRdrCompliant" - }, - { - "name": "isTrailerFeeClean" - }, - { - "name": "managementFeeApplied" - }, - { - "name": "managementFeeAppliedReferenceDate" - }, - { - "name": "managementFeeMaximum" - }, - { - "name": "maximumSubscriptionFeeInFavourOfDistributor" - }, - { - "name": "minimalInitialSubscriptionCategory" - }, - { - "name": "minimalInitialSubscriptionInAmount" - }, - { - "name": "minimalInitialSubscriptionInShares" - }, - { - "name": "minimalSubsequentSubscriptionCategory" - }, - { - "name": "minimalSubsequentSubscriptionInAmount" - }, - { - "name": "minimalSubsequentSubscriptionInShares" - }, - { - "name": "minimumSubscriptionFeeInFavourOfDistributor" - }, - { - "name": "ongoingCharges" - }, - { - "name": "ongoingChargesDate" - }, - { - "name": "performanceFeeApplied" - }, - { - "name": "performanceFeeAppliedReferenceDate" - }, - { - "name": "performanceFeeInProspectus" - }, - { - "name": "performanceFeeInProspectusReferenceDate" - }, - { - "name": "recordDateForSrri" - }, - { - "name": "shareClassDistributionPolicy" - }, - { - "name": "shareClassExtension" - }, - { - "name": "shareClassLaunchDate" - }, - { - "name": "shareClassLifecycle" - }, - { - "name": "srri" - }, - { - "name": "terExcludingPerformanceFee" - }, - { - "name": "terExcludingPerformanceFeeDate" - }, - { - "name": "terIncludingPerformanceFee" - }, - { - "name": "terIncludingPerformanceFeeDate" - }, - { - "name": "transferAgentName" - }, - { - "name": "bicOfTransferAgent" - }, - { - "name": "domicileOfTransferAgent" - }, - { - "name": "formOfShare" - }, - { - "name": "hasDurationHedge" - }, - { - "name": "typeOfEqualization" - }, - { - "name": "isMultiseries" - }, - { - "name": "seriesIssuance" - }, - { - "name": "seriesFrequency" - }, - { - "name": "doesFundIssueSidePocket" - }, - { - "name": "hasRedemptionGates" - }, - { - "name": "typeOfAlternativeFundStructureVehicle" - }, - { - "name": "bloombergCode" - }, - { - "name": "figiCode" - }, - { - "name": "abbreviatedShareClassName" - }, - { - "name": "valuationFrequency" - }, - { - "name": "navPublicationTime" - }, - { - "name": "isShareClassEligibleForUcits" - }, - { - "name": "investmentStatusDate" - }, - { - "name": "launchPrice" - }, - { - "name": "launchPriceCurrency" - }, - { - "name": "launchPriceDate" - }, - { - "name": "efamaMainEfcCategory" - }, - { - "name": "efamaefcClassificationType" - }, - { - "name": "efamaActiveEfcClassification" - }, - { - "name": "efamaefcInvestmentTheme" - }, - { - "name": "pricingMethodology" - }, - { - "name": "singlePricingType" - }, - { - "name": "swingFactor" - }, - { - "name": "standardMinimumRemainingAmount" - }, - { - "name": "standardMinimumRemainingShares" - }, - { - "name": "currencyOfMinimumRemainingAmount" - }, - { - "name": "standardMinimumRemainingCategory" - }, - { - "name": "hurdleRate" - }, - { - "name": "highWaterMark" - }, - { - "name": "hasAppliedSubscriptionFeeInFavourOfFund" - }, - { - "name": "appliedSubscriptionFeeInFavourOfFund" - }, - { - "name": "appliedSubscriptionFeeInFavourOfFundReferenceDate" - }, - { - "name": "maximumSubscriptionFeeInFavourOfFund" - }, - { - "name": "hasAppliedRedemptionFeeInFavourOfFund" - }, - { - "name": "appliedRedemptionFeeInFavourOfFund" - }, - { - "name": "appliedRedemptionFeeInFavourOfFundReferenceDate" - }, - { - "name": "maximumRedemptionFeeInFavourOfFund" - }, - { - "name": "equivalentTrailerFeeCleanIsin" - }, - { - "name": "hasSeparateDistributionFee" - }, - { - "name": "distributionFee" - }, - { - "name": "distributionFeeMaximum" - }, - { - "name": "iaSector" - }, - { - "name": "absorbingFundFullShareClassName" - }, - { - "name": "absorbingFundShareClassIsin" - }, - { - "name": "administrationFeeMaximum" - }, - { - "name": "annualDistributionAtFiscalYearEnd" - }, - { - "name": "annualDistributionYieldAtFiscalYearEnd" - }, - { - "name": "appliedRedemptionFeeInFavourOfDistributor" - }, - { - "name": "appliedRedemptionFeeInFavourOfDistributorReferenceDate" - }, - { - "name": "bankDetailsSsiForPaymentsProvision" - }, - { - "name": "bankDetailsLevelApplication" - }, - { - "name": "benchmarkBloombergTicker" - }, - { - "name": "calculationDateOffsetForRedemption" - }, - { - "name": "calculationDateOffsetForSubscription" - }, - { - "name": "calendarOrBusinessDaysForCutOffDateOffsetForRedemption" - }, - { - "name": "calendarOrBusinessDaysForCutOffDateOffsetForSubscription" - }, - { - "name": "calendarOrBusinessDaysForPrePaymentDaysForSubscription" - }, - { - "name": "calendarOrBusinessDaysForSettlementPeriodForRedemption" - }, - { - "name": "calendarOrBusinessDaysForSettlementPeriodForSubscription" - }, - { - "name": "calendarOrBusinessDaysForTransactions" - }, - { - "name": "cfiCode" - }, - { - "name": "contingentDeferredSalesChargeExitFee" - }, - { - "name": "contingentDeferredSalesChargeUpfrontFee" - }, - { - "name": "countryIsoCodeAlpha2" - }, - { - "name": "countryIsoCodeAlpha3" - }, - { - "name": "countryName" - }, - { - "name": "currenciesOfMulticurrencyShareClass" - }, - { - "name": "currencyOfMinimalOrMaximumRedemption" - }, - { - "name": "custodianFeeApplied" - }, - { - "name": "custodianFeeAppliedReferenceDate" - }, - { - "name": "custodianFeeMaximum" - }, - { - "name": "cutOffDateOffsetForRedemption" - }, - { - "name": "cutOffDateOffsetForSubscription" - }, - { - "name": "cutOffTimeForRedemption" - }, - { - "name": "cutOffTimeForSubscription" - }, - { - "name": "cutOffTimeForSwitchIn" - }, - { - "name": "cutOffTimeForSwitchOut" - }, - { - "name": "dealingDaysOfMultipleRedemptionTradeCycles" - }, - { - "name": "dealingDaysOfMultipleSubscriptionTradeCycles" - }, - { - "name": "disseminationRecipient" - }, - { - "name": "distributionFeeReferenceDate" - }, - { - "name": "doesShareClassApplyMandatoryConversion" - }, - { - "name": "doesShareClassApplyPartialDealingDays" - }, - { - "name": "doesShareClassApplyPartialPaymentDays" - }, + }, + { + "name": "marketType", + "type": { + "kind": "enum", + "variants": [ { - "name": "dormantEndDate" + "name": "spot" }, { - "name": "dormantStartDate" - }, + "name": "perp" + } + ] + } + }, + { + "name": "metadata", + "type": { + "kind": "struct", + "fields": [ { - "name": "exDividendDateCalendar" + "name": "template", + "type": { + "defined": { + "name": "metadataType" + } + } }, { - "name": "exitCostDescription" + "name": "pubkey", + "type": "pubkey" }, { - "name": "hasContingentDeferredSalesChargeFee" - }, + "name": "uri", + "type": "string" + } + ] + } + }, + { + "name": "metadataType", + "type": { + "kind": "enum", + "variants": [ { - "name": "hasDilutionLevyAppliedByFund" - }, + "name": "openfunds" + } + ] + } + }, + { + "name": "orderParams", + "type": { + "kind": "struct", + "fields": [ { - "name": "hasEqualizationMethodForDistribution" + "name": "orderType", + "type": { + "defined": { + "name": "orderType" + } + } }, { - "name": "hasEqualizationMethodForPerformanceFee" + "name": "marketType", + "type": { + "defined": { + "name": "marketType" + } + } }, { - "name": "hasForcedRedemption" + "name": "direction", + "type": { + "defined": { + "name": "positionDirection" + } + } }, { - "name": "hasForwardPricing" + "name": "userOrderId", + "type": "u8" }, { - "name": "hasHighWaterMark" + "name": "baseAssetAmount", + "type": "u64" }, { - "name": "hasLockUpForRedemption" + "name": "price", + "type": "u64" }, { - "name": "hasPreNoticeForSwitchIn" + "name": "marketIndex", + "type": "u16" }, { - "name": "hasPreNoticeForSwitchOut" + "name": "reduceOnly", + "type": "bool" }, { - "name": "hasPrePaymentForSubscription" + "name": "postOnly", + "type": { + "defined": { + "name": "postOnlyParam" + } + } }, { - "name": "hasRedemptionFeeInFavourOfDistributor" + "name": "immediateOrCancel", + "type": "bool" }, { - "name": "hasTripartiteReport" + "name": "maxTs", + "type": { + "option": "i64" + } }, { - "name": "investmentStatusDescription" + "name": "triggerPrice", + "type": { + "option": "u64" + } }, { - "name": "irregularRedemptionDealingDays" + "name": "triggerCondition", + "type": { + "defined": { + "name": "orderTriggerCondition" + } + } }, { - "name": "irregularSubscriptionDealingDays" + "name": "oraclePriceOffset", + "type": { + "option": "i32" + } }, { - "name": "isMulticurrencyShareClass" + "name": "auctionDuration", + "type": { + "option": "u8" + } }, { - "name": "isRestrictedToSeparateFeeArrangement" + "name": "auctionStartPrice", + "type": { + "option": "i64" + } }, { - "name": "isStructuredFinanceProduct" - }, + "name": "auctionEndPrice", + "type": { + "option": "i64" + } + } + ] + } + }, + { + "name": "orderTriggerCondition", + "type": { + "kind": "enum", + "variants": [ { - "name": "isValidIsin" + "name": "above" }, { - "name": "liquidationStartDate" + "name": "below" }, { - "name": "lockUpComment" + "name": "triggeredAbove" }, { - "name": "lockUpPeriodInDays" - }, + "name": "triggeredBelow" + } + ] + } + }, + { + "name": "orderType", + "type": { + "kind": "enum", + "variants": [ { - "name": "managementFeeMinimum" + "name": "market" }, { - "name": "mandatoryShareConversionDescriptionDetails" + "name": "limit" }, { - "name": "marketsRelevantToFundTradingCalendar" + "name": "triggerMarket" }, { - "name": "maximalNumberOfPossibleDecimalsAmount" + "name": "triggerLimit" }, { - "name": "maximalNumberOfPossibleDecimalsNav" - }, + "name": "oracle" + } + ] + } + }, + { + "name": "partialUnstaking", + "docs": [ + "Account: PartialUnstaking" + ], + "type": { + "kind": "struct", + "fields": [ { - "name": "maximalNumberOfPossibleDecimalsShares" + "name": "escrow", + "type": "pubkey" }, { - "name": "maximumInitialRedemptionInAmount" + "name": "amount", + "type": "u64" }, { - "name": "maximumInitialRedemptionInShares" + "name": "expiration", + "type": "i64" }, { - "name": "maximumRedemptionFeeInFavourOfDistributor" + "name": "buffers", + "type": { + "array": [ + "u128", + 6 + ] + } }, { - "name": "maximumSubsequentRedemptionInAmount" - }, + "name": "memo", + "type": "string" + } + ] + } + }, + { + "name": "permission", + "docs": [ + "* Delegate ACL" + ], + "type": { + "kind": "enum", + "variants": [ { - "name": "maximumSubsequentRedemptionInShares" + "name": "driftInitialize" }, { - "name": "mergerRatio" + "name": "driftUpdateUser" }, { - "name": "minimalInitialRedemptionInAmount" + "name": "driftDeleteUser" }, { - "name": "minimalInitialRedemptionInShares" + "name": "driftDeposit" }, { - "name": "minimalRedemptionCategory" + "name": "driftWithdraw" }, { - "name": "minimalSubsequentRedemptionInAmount" + "name": "driftPlaceOrders" }, { - "name": "minimalSubsequentRedemptionInShares" + "name": "driftCancelOrders" }, { - "name": "minimumRedemptionFeeInFavourOfDistributor" + "name": "driftPerpMarket" }, { - "name": "minimumRedemptionFeeInFavourOfFund" + "name": "driftSpotMarket" }, { - "name": "minimumSubscriptionFeeInFavourOfFund" + "name": "stake" }, { - "name": "monthlyRedemptionDealingDays" + "name": "unstake" }, { - "name": "monthlySubscriptionDealingDays" + "name": "liquidUnstake" }, { - "name": "nasdaqFundNetworkNfnIdentifier" + "name": "jupiterSwapAllowlisted" }, { - "name": "noTradingDate" + "name": "jupiterSwapAny" }, { - "name": "numberOfPossibleRedemptionsWithinPeriod" + "name": "wSolWrap" }, { - "name": "numberOfPossibleSubscriptionsWithinPeriod" + "name": "wSolUnwrap" }, { - "name": "partialDealingDaysDateAndTime" + "name": "mintShare" }, { - "name": "partialPaymentDaysDateAndTime" + "name": "burnShare" }, { - "name": "paymentDateCalendar" + "name": "forceTransferShare" }, { - "name": "performanceFeeMinimum" + "name": "setTokenAccountsStates" }, { - "name": "preNoticeCutOffForRedemption" + "name": "stakeJup" }, { - "name": "preNoticeCutOffForSubscription" + "name": "voteOnProposal" }, { - "name": "prePaymentCutOffTimeForSubscription" + "name": "unstakeJup" }, { - "name": "prePaymentDaysForSubscription" - }, + "name": "jupiterSwapLst" + } + ] + } + }, + { + "name": "policyAccount", + "type": { + "kind": "struct", + "fields": [ { - "name": "recordDateCalendar" - }, + "name": "lockedUntilTs", + "type": "i64" + } + ] + } + }, + { + "name": "positionDirection", + "type": { + "kind": "enum", + "variants": [ { - "name": "redemptionTradeCyclePeriod" + "name": "long" }, { - "name": "roundingMethodForPrices" - }, + "name": "short" + } + ] + } + }, + { + "name": "postOnlyParam", + "type": { + "kind": "enum", + "variants": [ { - "name": "roundingMethodForRedemptionInAmount" + "name": "none" }, { - "name": "roundingMethodForRedemptionInShares" + "name": "mustPostOnly" }, { - "name": "roundingMethodForSubscriptionInAmount" + "name": "tryPostOnly" }, { - "name": "roundingMethodForSubscriptionInShares" - }, + "name": "slide" + } + ] + } + }, + { + "name": "proposal", + "docs": [ + "Account: Proposal" + ], + "type": { + "kind": "struct", + "fields": [ { - "name": "settlementPeriodForRedemption" + "name": "governor", + "type": "pubkey" }, { - "name": "settlementPeriodForSubscription" + "name": "index", + "type": "u64" }, { - "name": "settlementPeriodForSwitchIn" + "name": "bump", + "type": "u8" }, { - "name": "settlementPeriodForSwitchOut" + "name": "proposer", + "type": "pubkey" }, { - "name": "shareClassDividendType" + "name": "quorumVotes", + "type": "u64" }, { - "name": "singleRegisterAccountRestrictions" + "name": "maxOption", + "type": "u8" }, { - "name": "subscriptionPeriodEndDate" + "name": "optionVotes", + "type": { + "vec": "u64" + } }, { - "name": "subscriptionPeriodStartDate" + "name": "canceledAt", + "type": "i64" }, { - "name": "subscriptionTradeCyclePeriod" + "name": "createdAt", + "type": "i64" }, { - "name": "switchInNoticePeriod" + "name": "activatedAt", + "type": "i64" }, { - "name": "switchOutNoticePeriod" + "name": "votingEndsAt", + "type": "i64" }, { - "name": "terminationDate" + "name": "queuedAt", + "type": "i64" }, { - "name": "timeZoneForCutOff" + "name": "queuedTransaction", + "type": "pubkey" }, { - "name": "timeZoneForCutOffUsingTzDatabase" + "name": "votingReward", + "type": { + "defined": { + "name": "votingReward" + } + } }, { - "name": "valuationFrequencyDetail" + "name": "totalClaimedReward", + "type": "u64" }, { - "name": "valuationReduction" + "name": "proposalType", + "type": "u8" }, { - "name": "weeklyRedemptionDealingDays" + "name": "buffers", + "type": { + "array": [ + "u128", + 10 + ] + } }, { - "name": "weeklySubscriptionDealingDays" - }, + "name": "instructions", + "type": { + "vec": { + "defined": { + "name": "proposalInstruction" + } + } + } + } + ] + } + }, + { + "name": "proposalAccountMeta", + "type": { + "kind": "struct", + "fields": [ { - "name": "yearlyRedemptionDealingDays" + "name": "pubkey", + "type": "pubkey" }, { - "name": "yearlySubscriptionDealingDays" + "name": "isSigner", + "type": "bool" }, { - "name": "cusip" - }, + "name": "isWritable", + "type": "bool" + } + ] + } + }, + { + "name": "proposalInstruction", + "type": { + "kind": "struct", + "fields": [ { - "name": "valor" + "name": "programId", + "type": "pubkey" }, { - "name": "fundId" + "name": "keys", + "type": { + "vec": { + "defined": { + "name": "proposalAccountMeta" + } + } + } }, { - "name": "imageUri" + "name": "data", + "type": "bytes" } ] } @@ -8335,7 +7032,7 @@ export type Glam = { } }, { - "name": "fundId", + "name": "statePubkey", "type": { "option": "pubkey" } @@ -8352,20 +7049,6 @@ export type Glam = { "option": "string" } }, - { - "name": "isRawOpenfunds", - "type": "bool" - }, - { - "name": "rawOpenfunds", - "type": { - "option": { - "defined": { - "name": "shareClassOpenfundsModel" - } - } - } - }, { "name": "allowlist", "type": { @@ -8391,6 +7074,20 @@ export type Glam = { { "name": "defaultAccountStateFrozen", "type": "bool" + }, + { + "name": "isRawOpenfunds", + "type": "bool" + }, + { + "name": "rawOpenfunds", + "type": { + "option": { + "defined": { + "name": "shareClassOpenfundsModel" + } + } + } } ] } @@ -8572,36 +7269,132 @@ export type Glam = { } }, { - "name": "stateModel", + "name": "stateAccount", "type": { "kind": "struct", "fields": [ { - "name": "id", + "name": "accountType", "type": { - "option": "pubkey" + "defined": { + "name": "accountType" + } } }, { - "name": "name", + "name": "owner", + "type": "pubkey" + }, + { + "name": "vault", + "type": "pubkey" + }, + { + "name": "enabled", + "type": "bool" + }, + { + "name": "created", + "type": "i64" + }, + { + "name": "engine", + "type": "pubkey" + }, + { + "name": "mints", "type": { - "option": "string" + "vec": "pubkey" + } + }, + { + "name": "metadata", + "type": { + "option": { + "defined": { + "name": "metadata" + } + } } }, + { + "name": "name", + "type": "string" + }, { "name": "uri", + "type": "string" + }, + { + "name": "assets", + "type": { + "vec": "pubkey" + } + }, + { + "name": "delegateAcls", + "type": { + "vec": { + "defined": { + "name": "delegateAcl" + } + } + } + }, + { + "name": "integrations", + "type": { + "vec": { + "defined": { + "name": "integration" + } + } + } + }, + { + "name": "params", + "type": { + "vec": { + "vec": { + "defined": { + "name": "engineField" + } + } + } + } + } + ] + } + }, + { + "name": "stateModel", + "type": { + "kind": "struct", + "fields": [ + { + "name": "accountType", + "type": { + "option": { + "defined": { + "name": "accountType" + } + } + } + }, + { + "name": "name", "type": { "option": "string" } }, { - "name": "metadataUri", + "name": "uri", "type": { "option": "string" } }, { - "name": "isEnabled", + "name": "enabled", "type": { "option": "bool" } @@ -8609,21 +7402,27 @@ export type Glam = { { "name": "assets", "type": { - "vec": "pubkey" + "option": { + "vec": "pubkey" + } } }, { "name": "externalVaultAccounts", "type": { - "vec": "pubkey" + "option": { + "vec": "pubkey" + } } }, { "name": "mints", "type": { - "vec": { - "defined": { - "name": "shareClassModel" + "option": { + "vec": { + "defined": { + "name": "shareClassModel" + } } } } @@ -8661,19 +7460,23 @@ export type Glam = { { "name": "delegateAcls", "type": { - "vec": { - "defined": { - "name": "delegateAcl" + "option": { + "vec": { + "defined": { + "name": "delegateAcl" + } } } } }, { - "name": "integrationAcls", + "name": "integrations", "type": { - "vec": { - "defined": { - "name": "integrationAcl" + "option": { + "vec": { + "defined": { + "name": "integration" + } } } } @@ -8681,24 +7484,36 @@ export type Glam = { { "name": "driftMarketIndexesPerp", "type": { - "vec": "u32" + "option": { + "vec": "u32" + } } }, { "name": "driftMarketIndexesSpot", "type": { - "vec": "u32" + "option": { + "vec": "u32" + } } }, { "name": "driftOrderTypes", "type": { - "vec": "u32" + "option": { + "vec": "u32" + } } }, { - "name": "isRawOpenfunds", - "type": "bool" + "name": "metadata", + "type": { + "option": { + "defined": { + "name": "metadata" + } + } + } }, { "name": "rawOpenfunds", @@ -8782,22 +7597,22 @@ export type Glam = { { "name": "seedMetadata", "type": "string", - "value": "\"openfunds\"" + "value": "\"metadata\"" }, { "name": "seedMint", "type": "string", - "value": "\"share\"" + "value": "\"mint\"" }, { "name": "seedState", "type": "string", - "value": "\"fund\"" + "value": "\"state\"" }, { "name": "seedVault", "type": "string", - "value": "\"treasury\"" + "value": "\"vault\"" } ] };