Function request_gt_exchange

Source
pub fn request_gt_exchange(
    ctx: Context<'_, '_, '_, '_, RequestGtExchange<'_>>,
    amount: u64,
) -> Result<()>
Expand description

Request a GT exchange.

§Accounts

See the documentation for the accounts.

§Arguments

  • amount: The amount of GT to exchange for rewards.

§Errors

  • The owner must be a signer.
  • The store must be properly initialized with an initialized GT state.
  • The user must be properly initialized and correspond to the owner.
  • The vault must be properly initialized, owned by the store, and currently accepting deposits (not yet confirmed).
  • The exchange must be either:
    • Uninitialized, or
    • Properly initialized and owned by both the owner and vault
  • The amount must be:
    • Greater than 0
    • Not exceed the owner’s available (excluding reserved) GT balance in their user account