pub struct Gateway {}
Implementations§
Source§impl Gateway
impl Gateway
pub fn program_id() -> Pubkey
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,
options: Option<VerificationOptions>,
) -> Result<(), GatewayError>
pub fn verify_gateway_token( gateway_token: &impl GatewayTokenAccess, expected_owner: &Pubkey, expected_gatekeeper_network_key: &Pubkey, 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(&GatewayToken) -> 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(&GatewayToken) -> 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(&GatewayToken) -> 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 Freeze for Gateway
impl RefUnwindSafe for Gateway
impl Send for Gateway
impl Sync for Gateway
impl Unpin for Gateway
impl UnwindSafe for Gateway
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more