rialo-subscriber-interface 0.4.0-alpha.0

Instructions and constructors for the Subscriber program
Documentation
// Copyright (c) Subzero Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

use rialo_s_pubkey::Pubkey;
use thiserror::Error;

#[derive(Debug, Error)]
pub enum SubscriptionError {
    #[error("subscription has no instructions")]
    EmptyInstructions,
    #[error("only the creator of the subscription (payer) can be a signer, found {0}")]
    InvalidSigner(Pubkey),
    #[error("too many accounts in subscription, max is {max_accounts}, got {actual}")]
    TooManyAccounts { max_accounts: usize, actual: usize },
}

impl From<SubscriptionError> for rialo_s_instruction::error::InstructionError {
    fn from(_: SubscriptionError) -> Self {
        rialo_s_instruction::error::InstructionError::InvalidArgument
    }
}