descro resolvers extension
This commit is contained in:
47
programs/descro_ext_resolvers/src/lib.rs
Normal file
47
programs/descro_ext_resolvers/src/lib.rs
Normal file
@@ -0,0 +1,47 @@
|
||||
pub mod error;
|
||||
pub mod instructions;
|
||||
pub mod state;
|
||||
|
||||
use anchor_lang::prelude::*;
|
||||
|
||||
pub use error::*;
|
||||
pub use instructions::*;
|
||||
pub use state::*;
|
||||
|
||||
// Replace with actual program ID after first deployment
|
||||
declare_id!("Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS");
|
||||
|
||||
/// Escrow Program ID — only its PDA may call update_stats.
|
||||
pub const ESCROW_PROGRAM_ID: Pubkey =
|
||||
pubkey!("DjVR4EuYV6USMJFfsGZwhZ3y8rtWsmG8EvDY96GTqqi3");
|
||||
|
||||
#[program]
|
||||
pub mod descro_ext_resolvers {
|
||||
use super::*;
|
||||
|
||||
pub fn register_resolver(
|
||||
ctx: Context<RegisterResolver>,
|
||||
resolver_type: ResolverType,
|
||||
name: String,
|
||||
description: String,
|
||||
fee_bps: u16,
|
||||
fee_recipient: Pubkey,
|
||||
metadata_uri: String,
|
||||
) -> Result<()> {
|
||||
register::handler(ctx, resolver_type, name, description, fee_bps, fee_recipient, metadata_uri)
|
||||
}
|
||||
|
||||
pub fn update_resolver(
|
||||
ctx: Context<UpdateResolver>,
|
||||
name: String,
|
||||
description: String,
|
||||
fee_bps: u16,
|
||||
metadata_uri: String,
|
||||
) -> Result<()> {
|
||||
update::handler(ctx, name, description, fee_bps, metadata_uri)
|
||||
}
|
||||
|
||||
pub fn update_stats(ctx: Context<UpdateStats>, ruling: Ruling) -> Result<()> {
|
||||
update_stats::handler(ctx, ruling)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user