0.5.1-pre.002
This commit is contained in:
49
ks-lib/src/executor/perpetuals/drift_v2.rs
Normal file
49
ks-lib/src/executor/perpetuals/drift_v2.rs
Normal file
@@ -0,0 +1,49 @@
|
||||
// file: ks-lib/src/executor/perpetuals/drift_v2.rs
|
||||
// version: 4
|
||||
|
||||
//! Reserved executor for `perpetuals_drift_v2`.
|
||||
|
||||
/// Reserved executor for the `perpetuals_drift_v2` program surface.
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct ExPerpetualsDriftV2Executor;
|
||||
|
||||
impl crate::ExApiInstructionExecutor for crate::ExPerpetualsDriftV2Executor {
|
||||
fn executor_name(&self) -> &'static str {
|
||||
return "kb-lib.executor.perpetuals.drift_v2";
|
||||
}
|
||||
|
||||
fn executor_version(&self) -> &'static str {
|
||||
return env!("CARGO_PKG_VERSION");
|
||||
}
|
||||
|
||||
fn program_ids(&self) -> &'static [&'static str] {
|
||||
return &[ks_program_ids::PERPETUALS_DRIFT_V2_PROGRAM_ID];
|
||||
}
|
||||
|
||||
fn supports_request(
|
||||
&self,
|
||||
request: &crate::ExApiExecutionRequest,
|
||||
) -> crate::ExApiExecutionSupport {
|
||||
if crate::ExApiInstructionExecutor::handles_program_id(self, &request.program_id) {
|
||||
return crate::ExApiExecutionSupport::Maybe;
|
||||
}
|
||||
return crate::ExApiExecutionSupport::No;
|
||||
}
|
||||
|
||||
fn build_plan(
|
||||
&self,
|
||||
_request: &crate::ExApiExecutionRequest,
|
||||
) -> ks_core::Result<crate::ExApiExecutionPlan> {
|
||||
let payload_json = match crate::executor_api_serialize_payload_json(
|
||||
&serde_json::json!({"status":"reserved_executor","surface":"perpetuals_drift_v2"}),
|
||||
) {
|
||||
std::result::Result::Ok(serialized) => serialized,
|
||||
std::result::Result::Err(error) => return std::result::Result::Err(error),
|
||||
};
|
||||
return std::result::Result::Ok(crate::ExApiExecutionPlan {
|
||||
executor_name: "kb-lib.executor.perpetuals.drift_v2".to_string(),
|
||||
instruction_count: 0,
|
||||
payload_json,
|
||||
});
|
||||
}
|
||||
}
|
||||
49
ks-lib/src/executor/perpetuals/jupiter.rs
Normal file
49
ks-lib/src/executor/perpetuals/jupiter.rs
Normal file
@@ -0,0 +1,49 @@
|
||||
// file: ks-lib/src/executor/perpetuals/jupiter.rs
|
||||
// version: 4
|
||||
|
||||
//! Reserved executor for `perpetuals_jupiter`.
|
||||
|
||||
/// Reserved executor for the `perpetuals_jupiter` program surface.
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct ExPerpetualsJupiterExecutor;
|
||||
|
||||
impl crate::ExApiInstructionExecutor for crate::ExPerpetualsJupiterExecutor {
|
||||
fn executor_name(&self) -> &'static str {
|
||||
return "kb-lib.executor.perpetuals.jupiter";
|
||||
}
|
||||
|
||||
fn executor_version(&self) -> &'static str {
|
||||
return env!("CARGO_PKG_VERSION");
|
||||
}
|
||||
|
||||
fn program_ids(&self) -> &'static [&'static str] {
|
||||
return &[ks_program_ids::PERPETUALS_JUPITER_PROGRAM_ID];
|
||||
}
|
||||
|
||||
fn supports_request(
|
||||
&self,
|
||||
request: &crate::ExApiExecutionRequest,
|
||||
) -> crate::ExApiExecutionSupport {
|
||||
if crate::ExApiInstructionExecutor::handles_program_id(self, &request.program_id) {
|
||||
return crate::ExApiExecutionSupport::Maybe;
|
||||
}
|
||||
return crate::ExApiExecutionSupport::No;
|
||||
}
|
||||
|
||||
fn build_plan(
|
||||
&self,
|
||||
_request: &crate::ExApiExecutionRequest,
|
||||
) -> ks_core::Result<crate::ExApiExecutionPlan> {
|
||||
let payload_json = match crate::executor_api_serialize_payload_json(
|
||||
&serde_json::json!({"status":"reserved_executor","surface":"perpetuals_jupiter"}),
|
||||
) {
|
||||
std::result::Result::Ok(serialized) => serialized,
|
||||
std::result::Result::Err(error) => return std::result::Result::Err(error),
|
||||
};
|
||||
return std::result::Result::Ok(crate::ExApiExecutionPlan {
|
||||
executor_name: "kb-lib.executor.perpetuals.jupiter".to_string(),
|
||||
instruction_count: 0,
|
||||
payload_json,
|
||||
});
|
||||
}
|
||||
}
|
||||
49
ks-lib/src/executor/perpetuals/phoenix_eternal.rs
Normal file
49
ks-lib/src/executor/perpetuals/phoenix_eternal.rs
Normal file
@@ -0,0 +1,49 @@
|
||||
// file: ks-lib/src/executor/perpetuals/phoenix_eternal.rs
|
||||
// version: 2
|
||||
|
||||
//! Reserved executor for `perpetuals_phoenix_eternal`.
|
||||
|
||||
/// Reserved executor for the `perpetuals_phoenix_eternal` program surface.
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct ExPerpetualsPhoenixEternalExecutor;
|
||||
|
||||
impl crate::ExApiInstructionExecutor for crate::ExPerpetualsPhoenixEternalExecutor {
|
||||
fn executor_name(&self) -> &'static str {
|
||||
return "kb-lib.executor.perpetuals.phoenix_eternal";
|
||||
}
|
||||
|
||||
fn executor_version(&self) -> &'static str {
|
||||
return env!("CARGO_PKG_VERSION");
|
||||
}
|
||||
|
||||
fn program_ids(&self) -> &'static [&'static str] {
|
||||
return &[ks_program_ids::PERPETUALS_PHOENIX_ETERNAL_PROGRAM_ID];
|
||||
}
|
||||
|
||||
fn supports_request(
|
||||
&self,
|
||||
request: &crate::ExApiExecutionRequest,
|
||||
) -> crate::ExApiExecutionSupport {
|
||||
if crate::ExApiInstructionExecutor::handles_program_id(self, &request.program_id) {
|
||||
return crate::ExApiExecutionSupport::Maybe;
|
||||
}
|
||||
return crate::ExApiExecutionSupport::No;
|
||||
}
|
||||
|
||||
fn build_plan(
|
||||
&self,
|
||||
_request: &crate::ExApiExecutionRequest,
|
||||
) -> ks_core::Result<crate::ExApiExecutionPlan> {
|
||||
let payload_json = match crate::executor_api_serialize_payload_json(
|
||||
&serde_json::json!({"status":"reserved_executor","surface":"perpetuals_phoenix_eternal"}),
|
||||
) {
|
||||
std::result::Result::Ok(serialized) => serialized,
|
||||
std::result::Result::Err(error) => return std::result::Result::Err(error),
|
||||
};
|
||||
return std::result::Result::Ok(crate::ExApiExecutionPlan {
|
||||
executor_name: "kb-lib.executor.perpetuals.phoenix_eternal".to_string(),
|
||||
instruction_count: 0,
|
||||
payload_json,
|
||||
});
|
||||
}
|
||||
}
|
||||
49
ks-lib/src/executor/perpetuals/zeta.rs
Normal file
49
ks-lib/src/executor/perpetuals/zeta.rs
Normal file
@@ -0,0 +1,49 @@
|
||||
// file: ks-lib/src/executor/perpetuals/zeta.rs
|
||||
// version: 4
|
||||
|
||||
//! Reserved executor for `perpetuals_zeta`.
|
||||
|
||||
/// Reserved executor for the `perpetuals_zeta` program surface.
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct ExPerpetualsZetaExecutor;
|
||||
|
||||
impl crate::ExApiInstructionExecutor for crate::ExPerpetualsZetaExecutor {
|
||||
fn executor_name(&self) -> &'static str {
|
||||
return "kb-lib.executor.perpetuals.zeta";
|
||||
}
|
||||
|
||||
fn executor_version(&self) -> &'static str {
|
||||
return env!("CARGO_PKG_VERSION");
|
||||
}
|
||||
|
||||
fn program_ids(&self) -> &'static [&'static str] {
|
||||
return &[ks_program_ids::PERPETUALS_ZETA_PROGRAM_ID];
|
||||
}
|
||||
|
||||
fn supports_request(
|
||||
&self,
|
||||
request: &crate::ExApiExecutionRequest,
|
||||
) -> crate::ExApiExecutionSupport {
|
||||
if crate::ExApiInstructionExecutor::handles_program_id(self, &request.program_id) {
|
||||
return crate::ExApiExecutionSupport::Maybe;
|
||||
}
|
||||
return crate::ExApiExecutionSupport::No;
|
||||
}
|
||||
|
||||
fn build_plan(
|
||||
&self,
|
||||
_request: &crate::ExApiExecutionRequest,
|
||||
) -> ks_core::Result<crate::ExApiExecutionPlan> {
|
||||
let payload_json = match crate::executor_api_serialize_payload_json(
|
||||
&serde_json::json!({"status":"reserved_executor","surface":"perpetuals_zeta"}),
|
||||
) {
|
||||
std::result::Result::Ok(serialized) => serialized,
|
||||
std::result::Result::Err(error) => return std::result::Result::Err(error),
|
||||
};
|
||||
return std::result::Result::Ok(crate::ExApiExecutionPlan {
|
||||
executor_name: "kb-lib.executor.perpetuals.zeta".to_string(),
|
||||
instruction_count: 0,
|
||||
payload_json,
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user