Struct solana_gateway::Gateway
source · [−]pub struct Gateway {}
Implementations
sourceimpl Gateway
impl Gateway
sourcepub fn parse_gateway_token(
account_info: &AccountInfo<'_>
) -> Result<GatewayToken, GatewayError>
pub fn parse_gateway_token(
account_info: &AccountInfo<'_>
) -> Result<GatewayToken, GatewayError>
Unpacks an account into a gateway token object
sourcepub fn expect_revoked_gateway_token(
gateway_token: &GatewayToken
) -> Result<(), GatewayError>
pub fn expect_revoked_gateway_token(
gateway_token: &GatewayToken
) -> Result<(), GatewayError>
Returns an error if the gateway token was NOT revoked
sourcepub fn expect_revoked_gateway_token_account_info(
gateway_token_info: &AccountInfo<'_>
) -> Result<(), GatewayError>
pub fn expect_revoked_gateway_token_account_info(
gateway_token_info: &AccountInfo<'_>
) -> Result<(), GatewayError>
Returns an error if the gateway token was NOT revoked
sourcepub fn verify_gateway_token(
gateway_token: &impl GatewayTokenAccess,
expected_owner: &Pubkey,
expected_gatekeeper_network_key: &Pubkey,
gateway_token_account_balance: u64,
options: Option<VerificationOptions>
) -> Result<(), GatewayError>
pub fn verify_gateway_token(
gateway_token: &impl GatewayTokenAccess,
expected_owner: &Pubkey,
expected_gatekeeper_network_key: &Pubkey,
gateway_token_account_balance: u64,
options: Option<VerificationOptions>
) -> Result<(), GatewayError>
Verifies the gateway token belongs to the expected owner, is signed by the gatekeeper and is not revoked.
pub fn gateway_token_reference(
gateway_token_info: &AccountInfo<'_>
) -> Result<Pubkey, GatewayError>
sourcepub fn verify_gateway_token_account_info(
gateway_token_info: &AccountInfo<'_>,
expected_owner: &Pubkey,
expected_gatekeeper_key: &Pubkey,
options: Option<VerificationOptions>
) -> Result<(), GatewayError>
pub fn verify_gateway_token_account_info(
gateway_token_info: &AccountInfo<'_>,
expected_owner: &Pubkey,
expected_gatekeeper_key: &Pubkey,
options: Option<VerificationOptions>
) -> Result<(), GatewayError>
Verifies the gateway token account parses to a valid gateway token, belongs to the expected owner, is signed by the gatekeeper, and is not revoked.
pub fn verify_gateway_token_with_eval(
gateway_token_info: &AccountInfo<'_>,
expected_owner: &Pubkey,
expected_gatekeeper_key: &Pubkey,
options: Option<VerificationOptions>,
eval_function: impl FnOnce(&InPlaceGatewayToken<&[u8]>) -> ProgramResult
) -> ProgramResult
sourcepub fn verify_and_expire_token<'a>(
gateway_program: AccountInfo<'a>,
gateway_token_info: AccountInfo<'a>,
owner: AccountInfo<'a>,
gatekeeper_network: &Pubkey,
expire_feature_account: AccountInfo<'a>
) -> ProgramResult
pub fn verify_and_expire_token<'a>(
gateway_program: AccountInfo<'a>,
gateway_token_info: AccountInfo<'a>,
owner: AccountInfo<'a>,
gatekeeper_network: &Pubkey,
expire_feature_account: AccountInfo<'a>
) -> ProgramResult
Verifies a given token and then expires it. Only works on networks that support this feature.
sourcepub fn verify_and_expire_token_with_eval<'a>(
gateway_program: AccountInfo<'a>,
gateway_token_info: AccountInfo<'a>,
owner: AccountInfo<'a>,
gatekeeper_network: &Pubkey,
expire_feature_account: AccountInfo<'a>,
eval_function: impl FnOnce(&InPlaceGatewayToken<&[u8]>) -> ProgramResult
) -> ProgramResult
pub fn verify_and_expire_token_with_eval<'a>(
gateway_program: AccountInfo<'a>,
gateway_token_info: AccountInfo<'a>,
owner: AccountInfo<'a>,
gatekeeper_network: &Pubkey,
expire_feature_account: AccountInfo<'a>,
eval_function: impl FnOnce(&InPlaceGatewayToken<&[u8]>) -> ProgramResult
) -> ProgramResult
Verifies a given token, followed by a given evaluation function and then expires it. Only works on networks that support this feature.
Auto Trait Implementations
impl RefUnwindSafe for Gateway
impl Send for Gateway
impl Sync for Gateway
impl Unpin for Gateway
impl UnwindSafe for Gateway
Blanket Implementations
impl<T> AbiExample for T
impl<T> AbiExample for T
default fn example() -> T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more