-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: CanisterStatus utility #572
Conversation
@@ -0,0 +1,245 @@ | |||
/** @module CanisterStatus */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if canisterStatus
is a good name. time
and subnet
are not tied to the canister. Maybe call it StateTree
to match with the interface spec?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My reasoning is that StateTree
sounds overly generic - state tree of what? The entire IC? State tends to be an overloaded term in frontend
The feature was motivated by me wanting to discover the ModuleHash, Metadata, Controllers, and Subnet of a canister. I'd like the naming to reflect that motivation, which should make it more discoverable.
the fact that this involves a state tree in a certificate is more or less an implementation detail, from my POV as a developer
Co-authored-by: Yan Chen <48968912+chenyan-dfinity@users.noreply.github.com>
Co-authored-by: Yan Chen <48968912+chenyan-dfinity@users.noreply.github.com>
Co-authored-by: Yan Chen <48968912+chenyan-dfinity@users.noreply.github.com>
…ty/agent-js into SDK-493-canister-state-api
Co-authored-by: Yan Chen <48968912+chenyan-dfinity@users.noreply.github.com>
Description
The CanisterStatus utility is used to request structured data directly from the IC public API. This data can be accessed using agent.readState, but CanisterStatus provides a helpful abstraction with some known paths.
You can request a canisters Controllers, ModuleHash, Candid interface, Subnet, or Time, or provide a custom path {@link CanisterStatus.CustomPath} and pass arbitrary buffers for valid paths identified in https://smartcontracts.org/docs/current/references/ic-interface-spec/.
How Has This Been Tested?
Unit testing & local e2e testing
Checklist: