Skip to content
Discussion options

You must be logged in to vote

implement like this :

use anchor_client::solana_sdk::pubkey::Pubkey;
use anchor_client::Program;
use solana_sdk::account::Account;
use solana_sdk::instruction::Instruction;

use crate::pools::*;
use std::fmt::Debug;

use anchor_client::Cluster;

#[derive(Debug)]
pub struct PoolDir {
    pub tipe: PoolType,
    pub dir_path: String,
}

#[derive(Debug)]
pub enum PoolType {
    OrcaPoolType,
    MercurialPoolType,
    SaberPoolType,
    AldrinPoolType,
    SerumPoolType,
}

pub fn pool_factory(tipe: &PoolType, json_str: &String) -> Box<dyn PoolOperations> {
    match tipe {
        PoolType::OrcaPoolType => {
            let pool: OrcaPool = serde_json::from_str(json_str).unwrap();
         …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kindlysmothly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants