-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: expose more data for convenience of explorer
- Loading branch information
Showing
10 changed files
with
134 additions
and
26 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[package] | ||
name = "records_coordinator" | ||
version = "0.0.1" | ||
edition = "2021" | ||
|
||
[lib] | ||
crate-type = ["cdylib", "rlib"] | ||
name = "records_coordinator" | ||
|
||
[dependencies] | ||
hdk = { workspace = true } | ||
serde = { workspace = true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
use hdk::prelude::*; | ||
|
||
#[hdk_extern] | ||
pub fn get_record(action_hash: ActionHash) -> ExternResult<Option<Record>> { | ||
get(action_hash, GetOptions::default()) | ||
} | ||
|
||
#[hdk_extern] | ||
pub fn get_chain_status(agent: AgentPubKey) -> ExternResult<AgentActivity> { | ||
get_agent_activity(agent, ChainQueryFilter::default(), ActivityRequest::Status) | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Debug)] | ||
pub struct GetChainSegmentPayload { | ||
pub agent: AgentPubKey, | ||
pub start: u32, | ||
pub end: u32, | ||
} | ||
|
||
#[hdk_extern] | ||
pub fn get_chain_segment(payload: GetChainSegmentPayload) -> ExternResult<AgentActivity> { | ||
let query = ChainQueryFilter::default() | ||
.descending() | ||
.include_entries(true) | ||
.sequence_range(ChainQueryFilterRange::ActionSeqRange( | ||
payload.start, | ||
payload.end, | ||
)); | ||
|
||
get_agent_activity(payload.agent, query, ActivityRequest::Full) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters