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 theowner
. - The
vault
must be properly initialized, owned by thestore
, and currently accepting deposits (not yet confirmed). - The
exchange
must be either:- Uninitialized, or
- Properly initialized and owned by both the
owner
andvault
- The
amount
must be:- Greater than 0
- Not exceed the owner’s available (excluding reserved) GT balance in their user account