Skip to content
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

Update Solana gateway docs #480

Merged
merged 2 commits into from
Oct 10, 2024
Merged

Update Solana gateway docs #480

merged 2 commits into from
Oct 10, 2024

Conversation

fadeev
Copy link
Member

@fadeev fadeev commented Oct 1, 2024

  • making a deposit and deposit and call
  • calling from the frontend
  • future features

Summary by CodeRabbit

  • New Features

    • Introduced a deposit functionality for SOL to both externally-owned accounts and universal applications on ZetaChain.
    • Added detailed documentation with examples for depositing SOL and using the memo feature.
  • Documentation

    • Clarified previous functionalities and outlined the frontend interaction process for users.
    • Included information on error handling and transaction reversion mechanisms.

@fadeev fadeev requested review from bbbeeeee, brewmaster012 and a team as code owners October 1, 2024 10:14
Copy link

vercel bot commented Oct 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 1, 2024 3:47pm

Copy link
Contributor

coderabbitai bot commented Oct 1, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The changes introduce a new deposit functionality for the Solana Gateway, enabling users to deposit SOL to an externally-owned account (EOA) or a universal application on ZetaChain. The implementation clarifies the parameters required for the deposit, including a memo, and outlines the frontend interaction process, error handling, and transaction reversion mechanisms.

Changes

File Path Change Summary
src/pages/developers/chains/solana.mdx Added documentation for the new deposit function, including its parameters, usage examples, and frontend interaction process. Clarified previous functionalities and noted future separation of deposit and deposit_and_call.

Possibly related issues

  • Expand the Solana doc #465: The changes address the request to expand the Solana documentation by detailing the new deposit functionality and providing high-level interaction guidelines with the Solana Gateway.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

🧹 Outside diff range and nitpick comments (5)
src/pages/developers/chains/solana.mdx (5)

1-5: Consider adding a brief explanation of universal applications.

The introduction effectively explains the purpose of the Solana Gateway. However, it might be beneficial to include a brief explanation or link to documentation about universal applications for readers who may be unfamiliar with the concept.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~2-~2: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ... (the native gas token of Solana) to an externally-owned account (EOA) or a universal applicatio...

(HYPHENATED_LY_ADVERB_ADJECTIVE)


91-183: Consider adding error handling examples in the frontend code.

The frontend interaction section provides a comprehensive guide on how to call the deposit function. To enhance the robustness of the example, consider adding error handling code snippets. This would demonstrate how to catch and handle potential errors that may occur during the transaction process, improving the overall reliability of the implementation.


217-227: Consider adding estimated timelines for upcoming features.

The future support section provides valuable information about upcoming features. To help developers plan their implementations more effectively, consider adding estimated timelines or release versions for each of the mentioned features. This would give users a clearer expectation of when they can leverage these new capabilities.


229-241: Consider adding practical error handling examples.

The error handling section effectively lists the possible error codes. To further assist developers in implementing robust error handling, consider adding practical code examples demonstrating how to catch and handle these specific errors in both Solana programs and frontend applications. This would provide developers with a clear template for implementing error handling in their own code.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~234-~234: Loose punctuation mark.
Context: ...ure scenarios: - SignerIsNotAuthority: The signer is not authorized to perform...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~235-~235: Loose punctuation mark.
Context: ...to perform the action. - DepositPaused: Deposits are currently paused. - `MemoL...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~236-~236: Loose punctuation mark.
Context: ...currently paused. - MemoLengthTooShort: The memo payload is less than the min...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~238-~238: Loose punctuation mark.
Context: ...ngth of 20 bytes. - MemoLengthExceeded: The memo payload exceeds the maximum ...

(UNLIKELY_OPENING_PUNCTUATION)


243-247: Consider elaborating on the revert process.

The revert transactions section provides crucial information about how failed cross-chain calls are handled. To give developers a more comprehensive understanding, consider expanding this section to include:

  1. The specific conditions that trigger a revert.
  2. The expected timeframe for the revert process to complete.
  3. Any actions developers or users need to take in case of a revert.
  4. How developers can monitor or be notified of reverted transactions.

This additional information would help developers better prepare for and handle potential revert scenarios in their applications.

🧰 Tools
🪛 LanguageTool

[style] ~246-~246: Consider using just “reverted”.
Context: ...taChain side, the deposited SOL will be reverted back to the original sender on Solana. ## C...

(RETURN_BACK)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between c80b227 and 399d463.

📒 Files selected for processing (1)
  • src/pages/developers/chains/solana.mdx (1 hunks)
🧰 Additional context used
🪛 LanguageTool
src/pages/developers/chains/solana.mdx

[uncategorized] ~2-~2: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ... (the native gas token of Solana) to an externally-owned account (EOA) or a universal applicatio...

(HYPHENATED_LY_ADVERB_ADJECTIVE)


[uncategorized] ~21-~21: Loose punctuation mark.
Context: ...sult<()> ``` ### Parameters - amount: The amount of SOL (in lamports) to depo...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~22-~22: Loose punctuation mark.
Context: ...f SOL (in lamports) to deposit. - memo: A vector of bytes containing the receiv...

(UNLIKELY_OPENING_PUNCTUATION)


[style] ~84-~84: This phrasing could be wordy, so try replacing it with something more concise.
Context: ...a contract call. - If the memo length is greater than 20 bytes, depositing SOL will **trigger...

(MORE_THAN_EXCEEDS)


[uncategorized] ~234-~234: Loose punctuation mark.
Context: ...ure scenarios: - SignerIsNotAuthority: The signer is not authorized to perform...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~235-~235: Loose punctuation mark.
Context: ...to perform the action. - DepositPaused: Deposits are currently paused. - `MemoL...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~236-~236: Loose punctuation mark.
Context: ...currently paused. - MemoLengthTooShort: The memo payload is less than the min...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~238-~238: Loose punctuation mark.
Context: ...ngth of 20 bytes. - MemoLengthExceeded: The memo payload exceeds the maximum ...

(UNLIKELY_OPENING_PUNCTUATION)


[style] ~246-~246: Consider using just “reverted”.
Context: ...taChain side, the deposited SOL will be reverted back to the original sender on Solana. ## C...

(RETURN_BACK)

@fadeev
Copy link
Member Author

fadeev commented Oct 8, 2024

@bbbeeeee @zeta-chain/fullstack @brewmaster012 please, review.

Copy link
Collaborator

@GMaiolo GMaiolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fadeev fadeev merged commit 93464d6 into main Oct 10, 2024
6 checks passed
@fadeev fadeev deleted the solana-gateway branch October 10, 2024 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants