forked from swarnabgarang/nft-lend-borrow
-
Notifications
You must be signed in to change notification settings - Fork 856
/
lib.rs
48 lines (39 loc) · 1.23 KB
/
lib.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
pub mod errors;
pub mod instructions;
pub mod states;
pub use errors::ErrorCodes;
pub use instructions::*;
pub use states::*;
declare_id!("<PLACE YOUR ADDRESS HERE>");
#[program]
pub mod nft_lend_borrow {
use super::*;
pub fn create_pool(
ctx: Context<CreatePool>,
collection_id: Pubkey,
duration: i64,
) -> Result<()> {
instructions::create_pool::handler(ctx, collection_id, duration)
}
pub fn offer_loan(ctx: Context<OfferLoan>, offer_amount: u64) -> Result<()> {
instructions::offer_loan::handler(ctx, offer_amount)
}
pub fn withdraw_offer(
ctx: Context<WithdrawOffer>,
minimum_balance_for_rent_exemption: u64,
) -> Result<()> {
instructions::withdraw_offer::handler(
ctx,
minimum_balance_for_rent_exemption,
)
}
pub fn borrow(ctx: Context<Borrow>, minimum_balance_for_rent_exemption: u64) -> Result<()> {
instructions::borrow::handler(ctx, minimum_balance_for_rent_exemption)
}
pub fn repay(ctx: Context<Repay>) -> Result<()> {
instructions::repay::handler(ctx)
}
pub fn liquidate(ctx: Context<Liquidate>) -> Result<()> {
instructions::liquidate::handler(ctx)
}
}