defuse/
lib.rs

1#![doc = include_str!(concat!("../", env!("CARGO_PKG_README")))]
2#[cfg(feature = "contract")]
3pub mod contract;
4
5#[cfg(feature = "sandbox")]
6pub mod sandbox_ext;
7
8pub mod accounts;
9pub mod fees;
10pub mod garbage_collector;
11pub mod intents;
12pub mod salts;
13pub mod simulation_output;
14pub mod tokens;
15
16pub use defuse_core as core;
17pub use defuse_nep245 as nep245;
18
19use defuse_admin_utils::full_access_keys::FullAccessKeys;
20use defuse_controller::ControllerUpgradable;
21use defuse_nep245::{
22    MultiTokenCore, enumeration::MultiTokenEnumeration, receiver::MultiTokenReceiver,
23};
24use near_contract_standards::{
25    fungible_token::receiver::FungibleTokenReceiver,
26    non_fungible_token::core::NonFungibleTokenReceiver,
27};
28use near_plugins::{AccessControllable, Pausable};
29use near_sdk::ext_contract;
30
31use crate::{accounts::ForceAccountManager, tokens::nep245::MultiTokenForcedCore};
32
33use self::{
34    accounts::AccountManager,
35    intents::{Intents, RelayerKeys},
36    tokens::{
37        nep141::{FungibleTokenForceWithdrawer, FungibleTokenWithdrawer},
38        nep171::{NonFungibleTokenForceWithdrawer, NonFungibleTokenWithdrawer},
39        nep245::{MultiTokenForcedWithdrawer, MultiTokenWithdrawer},
40    },
41};
42
43#[ext_contract(ext_defuse)]
44pub trait Defuse:
45    Intents
46    + RelayerKeys
47    + AccountManager
48    + MultiTokenCore
49    // NEP-141 deposits/withdrawals
50    + FungibleTokenReceiver
51    + FungibleTokenWithdrawer
52    // NEP-171 deposits/withdrawals
53    + NonFungibleTokenReceiver
54    + NonFungibleTokenWithdrawer
55    // NEP-245 deposits/withdrawals
56    + MultiTokenReceiver
57    + MultiTokenWithdrawer
58    + MultiTokenEnumeration
59    // Governance
60    + AccessControllable
61    + MultiTokenForcedCore
62    + FungibleTokenForceWithdrawer
63    + NonFungibleTokenForceWithdrawer
64    + MultiTokenForcedWithdrawer
65    + ForceAccountManager
66    + Pausable
67    + ControllerUpgradable
68    + FullAccessKeys
69{
70}