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
ownermust be a signer. - The
storemust be properly initialized with an initialized GT state. - The
usermust be properly initialized and correspond to theowner. - The
vaultmust be properly initialized, owned by thestore, and currently accepting deposits (not yet confirmed). - The
exchangemust be either:- Uninitialized, or
- Properly initialized and owned by both the
ownerandvault
- The
amountmust be:- Greater than 0
- Not exceed the owner’s available (excluding reserved) GT balance in their user account