express_relay/sdk/
cpi.rs

1use {
2    crate::{
3        __cpi_client_accounts_check_permission::CheckPermission,
4        cpi::check_permission,
5    },
6    anchor_lang::prelude::*,
7};
8
9/// Makes a CPI call to the `CheckPermission` instruction in the Express Relay program.
10/// Permissioning takes the form of a `SubmitBid` instruction with matching permission and router accounts.
11/// Returns the fees paid to the router in the matching instructions.
12pub fn check_permission_cpi<'info>(
13    check_permission_accounts: CheckPermission<'info>,
14    express_relay_program: AccountInfo<'info>,
15) -> Result<u64> {
16    let result = check_permission(CpiContext::new(
17        express_relay_program.to_account_info(),
18        check_permission_accounts,
19    ))?;
20    let fees_router = result.get();
21    Ok(fees_router)
22}