defituna-staking 1.0.7

Rust client to interact with DefiTuna's Staking on-chain program.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::TUNA_STAKING_ID;
use solana_program::pubkey::Pubkey;

pub fn get_treasury_address(staked_token_mint: &Pubkey) -> (Pubkey, u8) {
    let seeds = &[b"treasury", staked_token_mint.as_ref()];
    Pubkey::find_program_address(seeds, &TUNA_STAKING_ID)
}

pub fn get_position_address(treasury: &Pubkey, authority: &Pubkey) -> (Pubkey, u8) {
    let seeds = &[b"position", treasury.as_ref(), authority.as_ref()];
    Pubkey::find_program_address(seeds, &TUNA_STAKING_ID)
}

pub fn get_vesting_strategy_address(treasury: &Pubkey, authority: &Pubkey) -> (Pubkey, u8) {
    let seeds = &[b"vesting_strategy", treasury.as_ref(), authority.as_ref()];
    Pubkey::find_program_address(seeds, &TUNA_STAKING_ID)
}