diff --git a/api/src/lib.rs b/api/src/lib.rs index 75b6aba..c0e78a6 100644 --- a/api/src/lib.rs +++ b/api/src/lib.rs @@ -6,6 +6,16 @@ pub mod loaders; pub mod sdk; pub mod state; -use solana_program::declare_id; +pub mod prelude { + pub use crate::consts::*; + pub use crate::error::*; + pub use crate::event::*; + pub use crate::instruction::*; + pub use crate::loaders::*; + pub use crate::sdk::*; + pub use crate::state::*; +} + +use steel::*; declare_id!("oreV2ZymfyeXgNgBdqMkumTqqAprVqgBWQfoYkrtKWQ"); diff --git a/program/src/claim.rs b/program/src/claim.rs index 7fa8c48..c4a9201 100644 --- a/program/src/claim.rs +++ b/program/src/claim.rs @@ -1,4 +1,4 @@ -use ore_api::{consts::*, error::OreError, instruction::*, loaders::*, state::Proof}; +use ore_api::prelude::*; use steel::*; /// Claim distributes claimable ORE from the treasury to a miner. diff --git a/program/src/close.rs b/program/src/close.rs index 8e7b85d..dd58ead 100644 --- a/program/src/close.rs +++ b/program/src/close.rs @@ -1,4 +1,4 @@ -use ore_api::state::Proof; +use ore_api::prelude::*; use steel::*; /// Close closes a proof account and returns the rent to the owner. diff --git a/program/src/initialize.rs b/program/src/initialize.rs index 298e5c0..23cc57e 100644 --- a/program/src/initialize.rs +++ b/program/src/initialize.rs @@ -1,8 +1,4 @@ -use ore_api::{ - consts::*, - instruction::*, - state::{Bus, Config, Treasury}, -}; +use ore_api::prelude::*; use solana_program::program_pack::Pack; use spl_token::state::Mint; use steel::*; diff --git a/program/src/mine.rs b/program/src/mine.rs index 655bb2d..eb8e37b 100644 --- a/program/src/mine.rs +++ b/program/src/mine.rs @@ -1,14 +1,7 @@ use std::mem::size_of; use drillx::Solution; -use ore_api::{ - consts::*, - error::OreError, - event::MineEvent, - instruction::Mine, - loaders::OreAccountInfoValidation, - state::{Bus, Config, Proof}, -}; +use ore_api::prelude::*; use solana_program::program::set_return_data; #[allow(deprecated)] use solana_program::{ diff --git a/program/src/open.rs b/program/src/open.rs index 2e82bd0..bc9c9f3 100644 --- a/program/src/open.rs +++ b/program/src/open.rs @@ -1,6 +1,6 @@ use std::mem::size_of; -use ore_api::{consts::*, instruction::Open, state::Proof}; +use ore_api::prelude::*; use solana_program::{keccak::hashv, slot_hashes::SlotHash}; use steel::*; diff --git a/program/src/reset.rs b/program/src/reset.rs index e59d7f3..b00a6ba 100644 --- a/program/src/reset.rs +++ b/program/src/reset.rs @@ -1,9 +1,4 @@ -use ore_api::{ - consts::*, - error::OreError, - loaders::*, - state::{Bus, Config}, -}; +use ore_api::prelude::*; use steel::*; /// Reset tops up the bus balances, updates the base reward rate, and sets up the ORE program for the next epoch. diff --git a/program/src/stake.rs b/program/src/stake.rs index 48ba171..7a42d80 100644 --- a/program/src/stake.rs +++ b/program/src/stake.rs @@ -1,4 +1,4 @@ -use ore_api::{consts::*, instruction::Stake, loaders::*, state::Proof}; +use ore_api::prelude::*; use steel::*; /// Stake deposits ORE into a proof account to earn multiplier. diff --git a/program/src/update.rs b/program/src/update.rs index 6bf6f74..4f153a6 100644 --- a/program/src/update.rs +++ b/program/src/update.rs @@ -1,4 +1,4 @@ -use ore_api::state::Proof; +use ore_api::prelude::*; use steel::*; /// Update changes the miner authority on a proof account. diff --git a/program/src/upgrade.rs b/program/src/upgrade.rs index 140a499..74090d0 100644 --- a/program/src/upgrade.rs +++ b/program/src/upgrade.rs @@ -1,4 +1,4 @@ -use ore_api::{consts::*, error::OreError, instruction::Stake, loaders::OreAccountInfoValidation}; +use ore_api::prelude::*; use steel::*; /// Upgrade allows a user to migrate a v1 token to a v2 token at a 1:1 exchange rate.