1pub mod accumulator;
2pub mod asset;
3pub mod borrow;
4pub mod chunked_append_only_list;
5pub mod event;
6pub mod fee;
7pub mod guard;
8pub mod incoming_deposit;
9pub mod interest_rate_strategy;
10pub mod market;
11pub mod number;
12pub mod oracle;
13pub mod price;
14pub mod registry;
15pub mod snapshot;
16pub mod supply;
17pub mod time_chunk;
18#[cfg(feature = "rpc")]
19pub mod utils;
20pub mod vault;
21pub mod withdrawal_queue;
22
23pub use primitive_types;
24pub use schemars;
25
26#[cfg(target_arch = "wasm32")]
31#[inline]
32pub fn panic_with_message(msg: &str) -> ! {
33 near_sdk::env::panic_str(msg);
34}
35
36#[cfg(not(target_arch = "wasm32"))]
41#[inline]
42pub fn panic_with_message(msg: &str) -> ! {
43 panic!("{}", msg);
44}
45
46pub static YEAR_PER_MS: number::Decimal =
53 number::Decimal::from_repr([0x40FC_AB61_4AE4_B2B5, 0x22D7_9641, 0, 0, 0, 0, 0, 0]);
54
55pub mod contract {
56 pub fn list<T, U: FromIterator<T>>(
57 i: impl IntoIterator<Item = T>,
58 offset: Option<u32>,
59 count: Option<u32>,
60 ) -> U {
61 let offset = offset.map_or(0, |o| o as usize);
62 let count = count.map_or(usize::MAX, |c| c as usize);
63 i.into_iter().skip(offset).take(count).collect()
64 }
65
66 #[macro_export]
67 macro_rules! self_ext {
68 ($gas:expr) => {
69 Self::ext(::near_sdk::env::current_account_id()).with_static_gas($gas)
70 };
71 }
72}