-
Notifications
You must be signed in to change notification settings - Fork 7
docs: add Mars Lending library documentation #373
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
Conversation
""" WalkthroughA new documentation file for the Mars Lending library has been added. This file provides an overview of the library's functionality, configuration, implementation details, error handling, and protocol integration, including a flow diagram and acknowledgments. A new public struct, Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Library
participant MarsCreditManager
participant MarsCreditAccount
User->>Library: Lend(asset)
Library->>MarsCreditManager: Create credit account (if needed)
Library->>MarsCreditAccount: Deposit and lend asset
MarsCreditAccount-->>Library: Confirmation
Library-->>User: Lend complete
User->>Library: Withdraw(amount)
Library->>MarsCreditAccount: Reclaim and withdraw asset
MarsCreditAccount-->>Library: Confirmation
Library-->>User: Withdraw complete
Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (7)
docs/src/libraries/cosmwasm/mars_lending.md (7)
1-3
: Use Title Case for the document header.
The main heading should consistently follow title-case conventions.Apply this diff:
-# Valence Mars Lending library +# Valence Mars Lending Library
7-34
: Refine Mermaid diagram labels and formatting.
The “Input” and “Output” nodes are split across lines, which may render awkwardly. Also, the “if needed” parenthetical can be on the same line as its arrow for clarity.- IA((Input - Account)) - OA((Output - Account)) + IA((Input Account)) + OA((Output Account)) @@ - S -- 3/Execute Create Credit Account - (if needed) --> IA + S -- 3/Execute Create Credit Account (if needed) --> IA
38-42
: Consistently format function names in the table.
Wrap function names in backticks for monospace styling and ensure the table separators remain aligned.-| **Lend** | - | Creates a Mars credit account (if one doesn't exist) and lends the entire balance of the specified denom from the input account to the Mars Protocol through the credit account. | +| `Lend` | - | Creates a Mars credit account (if one doesn't exist) and lends the entire balance of the specified denom from the input account to the Mars Protocol through the credit account. | @@ -| **Withdraw** | `amount: Option<Uint128>` | Withdraws lent assets from the Mars credit account to the output account. If no amount is specified, withdraws the entire position. | +| `Withdraw` | `amount: Option<Uint128>` | Withdraws lent assets from the Mars credit account to the output account. If no amount is specified, withdraws the entire position. |
48-57
: Add doc comments forLibraryConfig
fields.
Including inline Rust doc comments enhances readability and helps generate API docs.pub struct LibraryConfig { /// Address that will own the credit account pub input_addr: LibraryAccountType, /// Address that will receive withdrawn funds pub output_addr: LibraryAccountType, /// Mars credit manager contract address pub credit_manager_addr: String, /// Denom of the asset to lend pub denom: String, }
64-69
: Grammar: add missing article.
Insert “the” before “Mars credit account lifecycle” for clarity.-- The library automatically handles Mars credit account lifecycle: +- The library automatically handles the Mars credit account lifecycle:🧰 Tools
🪛 LanguageTool
[uncategorized] ~64-~64: You might be missing the article “the” here.
Context: ...ment The library automatically handles Mars credit account lifecycle: - **Account ...(AI_EN_LECTOR_MISSING_DETERMINER_THE)
85-90
: Standardize bullet punctuation in Error Handling.
Either omit periods at the end of each bullet or add them consistently.- - **No Funds**: Returns error if attempting to lend with zero balance - - **No Credit Account**: Returns error if attempting to withdraw without an existing credit account + - **No Funds**: Returns error if attempting to lend with zero balance. + - **No Credit Account**: Returns error if attempting to withdraw without an existing credit account.
100-102
: Use a more formal header for acknowledgments.
“Acknowledgments” is preferred over “Thanks” in technical documentation.-## Thanks +## Acknowledgments🧰 Tools
🪛 LanguageTool
[typographical] ~100-~100: This sign-off should end with a comma when followed by your name.
Context: ...i strategies beyond simple lending ## Thanks Thank you to Stana and the [Hydro](htt...(EN_SIGN_OFF_WITHOUT_COMMA)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs/src/libraries/cosmwasm/mars_lending.md
(1 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/src/libraries/cosmwasm/mars_lending.md
[uncategorized] ~64-~64: You might be missing the article “the” here.
Context: ...ment The library automatically handles Mars credit account lifecycle: - **Account ...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[grammar] ~80-~80: Using ‘plenty’ without ‘of’ is considered to be informal.
Context: ...edit account for the input address 2. Amount Calculation: Uses exact amount if specified, othe...
(PLENTY_OF_NOUNS)
[typographical] ~100-~100: This sign-off should end with a comma when followed by your name.
Context: ...i strategies beyond simple lending ## Thanks Thank you to Stana and the [Hydro](htt...
(EN_SIGN_OFF_WITHOUT_COMMA)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: build
- GitHub Check: build-and-deploy
add docs for the mars library added by the hydro team
Summary by CodeRabbit