{% extends "layout.njk" %}
{% block main %}

{#
The following types are used as responses for function that fetch accounts.
Ideally, these types live in a shared crate that can be used by the client but
at time of writing, there are some unresolved questions about how to do this.

For now, we just define them here. This the following caveat:
- These types are not compatible between different clients since the type
  exists in each client individually.
#}

{% if accountsToExport.length > 0 %}

    #[cfg(feature = "fetch")]
    #[derive(Debug, Clone)]
    pub struct DecodedAccount<T> {
        pub address: solana_pubkey::Pubkey,
        pub account: solana_account::Account,
        pub data: T,
    }

    #[cfg(feature = "fetch")]
    #[derive(Debug, Clone)]
    pub enum MaybeAccount<T> {
        Exists(DecodedAccount<T>),
        NotFound(solana_pubkey::Pubkey),
    }

{% endif %}

{% endblock %}
