Agoric / agoric-sdk

monorepo for the Agoric Javascript smart contract platform
Apache License 2.0
327 stars 207 forks source link

Incomplete jsdocs for Orchestration API types, variables, methods and parameters #9757

Open toliaqat opened 3 months ago

toliaqat commented 3 months ago

What is the Problem Being Solved?

The current @agoric/orchestration reference docs (JSDocs) are incomplete for the purpose of devrel to write stuff in docs.agoric.com.

Several methods and parameters are missing detailed descriptions, which hinders the ability of developers to understand and utilize the API effectively.

The missing Orch API JSDocs can be tracked on...

Expected Behavior:

The JSDocs should provide comprehensive information for all methods, including:

### Tasks
- [ ] https://github.com/Agoric/agoric-sdk/issues/9765
- [ ] https://github.com/Agoric/agoric-sdk/issues/9766
- [ ] https://github.com/Agoric/agoric-sdk/issues/9992
- [ ] https://github.com/Agoric/agoric-sdk/issues/9994
- [ ] exos/README.md needs to be refreshed and reviewed before NPM release
dckc commented 3 months ago

re inline KnownChains making Orchestrator messy:

dckc commented 3 months ago

Why is connectionInfo: IBCConnectionInfo referring to the type by name as expected but type for chainInfo is expanded???

image

dckc commented 3 months ago

OrchestrationFlow has no prose, but there's an Orchestration Flows blurb on the @agoric/orchestration page. That blurb should probably move.

dckc commented 3 months ago

GuestOf could really use an example; in Office Hours, we started drafting one:

modified packages/async-flow/src/types.d.ts

@@ -39,6 +39,12 @@ export type HostAsyncFuncWrapper = (
  * The function from the host as it will be available in the guest.
  *
  * Specifically, Vow return values are converted to Promises.
+ *
+ * @example
+ * const localTransfer = (...) => { return asVow(() => ...); };
+ * @param {GuestOf<ZoeTools['localTransfer']>} ctx.localTransfer
+ *
+ * from `orchestration/src/examples/sendAnywhere.flows.js`
  */
 export type GuestOf<F extends HostAsyncFuncWrapper> = F extend
dckc commented 2 months ago

Documentation of failure modes would be nice.

dckc commented 2 months ago

Functions / methods whose results await actions from other chains should be flagged.

In general, anything with cost > O(1) amortized should be documented.

dckc commented 1 month ago

@0xpatrickdev in Documentation Considerations of #10211, you write...

These tests serve as documentation for using the Deposit, Withdraw, Transfer, and Proxying invitationMakers from the Orchestration API

Do we have any JSDoc for those? I'm struggling to find PortfolioHolderKit at all in @agoric/orchestration API docs.

0xpatrickdev commented 1 month ago

@0xpatrickdev in Documentation Considerations of #10211, you write...

These tests serve as documentation for using the Deposit, Withdraw, Transfer, and Proxying invitationMakers from the Orchestration API

Do we have any JSDoc for those? I'm struggling to find PortfolioHolderKit at all in @agoric/orchestration API docs.

Good question, PR'ed here: https://github.com/Agoric/agoric-sdk/pull/10217