This commit is contained in:
Conner Gallagher 2023-06-13 20:00:01 -06:00
parent 9e4dc10e28
commit 5527c87045
5 changed files with 33 additions and 26 deletions

View File

@ -3843,7 +3843,7 @@ dependencies = [
[[package]]
name = "switchboard-solana"
version = "0.3.9"
version = "0.3.10"
dependencies = [
"anchor-client",
"anchor-lang",

View File

@ -13,6 +13,9 @@ pub use attestation_program::*;
pub use switchboard_common::{Chain, Error as SwitchboardClientError, FunctionResult};
pub mod seeds;
pub use seeds::*;
pub mod accounts;
pub mod instructions;
pub mod types;
@ -27,30 +30,6 @@ cfg_client! {
pub use sgx::*;
}
/// Seed used to derive the SbState PDA.
pub const STATE_SEED: &[u8] = b"STATE";
/// Seed used to derive the PermissionAccountData PDA.
pub const PERMISSION_SEED: &[u8] = b"PermissionAccountData";
/// Seed used to derive the LeaseAccountData PDA.
pub const LEASE_SEED: &[u8] = b"LeaseAccountData";
/// Seed used to derive the OracleAccountData PDA.
pub const ORACLE_SEED: &[u8] = b"OracleAccountData";
/// Seed used to derive the SlidingWindow PDA.
pub const SLIDING_RESULT_SEED: &[u8] = b"SlidingResultAccountData";
/// Discriminator used for Switchboard buffer accounts.
pub const BUFFER_DISCRIMINATOR: &[u8] = b"BUFFERxx";
/// Seed used to derive the FunctionAccountData PDA.
pub const FUNCTION_SEED: &[u8] = b"FunctionAccountData";
/// Seed used to derive the QuoteAccountData PDA.
pub const QUOTE_SEED: &[u8] = b"QuoteAccountData";
/// Program id for the Switchboard oracle program
/// SW1TCH7qEPTdLsDHRgPuMQjbQxKdH2aBStViMFnt64f
pub const SWITCHBOARD_PROGRAM_ID: anchor_lang::solana_program::pubkey::Pubkey =

View File

@ -12,6 +12,9 @@ macro_rules! cfg_client {
#[macro_export]
macro_rules! cfg_not_client {
($($item:item)*) => {
$( #[cfg(not(feature = "client"))] $item )*
$(
#[cfg(not(feature = "client"))]
$item
)*
}
}

View File

@ -2,6 +2,7 @@ use crate::{cfg_client, cfg_not_client};
pub use crate::accounts::*;
pub use crate::instructions::*;
pub use crate::seeds::*;
pub use crate::types::*;
pub use crate::{SWITCHBOARD_ATTESTATION_PROGRAM_ID, SWITCHBOARD_PROGRAM_ID};
@ -13,6 +14,7 @@ cfg_client! {
pub use crate::client::*;
pub use crate::sgx::*;
pub use anchor_client;
pub use anchor_client::anchor_lang;
pub use anchor_client::solana_client;

View File

@ -0,0 +1,23 @@
/// Seed used to derive the SbState PDA.
pub const STATE_SEED: &[u8] = b"STATE";
/// Seed used to derive the PermissionAccountData PDA.
pub const PERMISSION_SEED: &[u8] = b"PermissionAccountData";
/// Seed used to derive the LeaseAccountData PDA.
pub const LEASE_SEED: &[u8] = b"LeaseAccountData";
/// Seed used to derive the OracleAccountData PDA.
pub const ORACLE_SEED: &[u8] = b"OracleAccountData";
/// Seed used to derive the SlidingWindow PDA.
pub const SLIDING_RESULT_SEED: &[u8] = b"SlidingResultAccountData";
/// Discriminator used for Switchboard buffer accounts.
pub const BUFFER_DISCRIMINATOR: &[u8] = b"BUFFERxx";
/// Seed used to derive the FunctionAccountData PDA.
pub const FUNCTION_SEED: &[u8] = b"FunctionAccountData";
/// Seed used to derive the QuoteAccountData PDA.
pub const QUOTE_SEED: &[u8] = b"QuoteAccountData";