feat: Export browser compatible Sui depositAndCall function#435
Open
hernan-clich wants to merge 6 commits intomainfrom
Open
feat: Export browser compatible Sui depositAndCall function#435hernan-clich wants to merge 6 commits intomainfrom
hernan-clich wants to merge 6 commits intomainfrom
Conversation
Contributor
📝 WalkthroughWalkthroughThis pull request adds Sui chain support with browser-based signing capabilities, refactors account data utility functions into a dedicated module, updates all corresponding imports across utility files, and adds BIP32/BIP39 cryptographic dependencies to the package configuration. Changes
Sequence Diagram(s)sequenceDiagram
participant Browser
participant prepareSuiDepositAndCall as prepareSuiDepositAndCall
participant buildSuiDepositAndCallTransaction as buildSuiDepositAndCallTransaction
participant suiClient as Sui Client
Browser->>prepareSuiDepositAndCall: Call with options (chainId, signerAddress, etc.)
prepareSuiDepositAndCall->>prepareSuiDepositAndCall: Validate options against suiBrowserOptionsSchema
prepareSuiDepositAndCall->>buildSuiDepositAndCallTransaction: Invoke builder with validated options
alt Native SUI Transfer
buildSuiDepositAndCallTransaction->>buildSuiDepositAndCallTransaction: Process without signerAddress requirement
else Non-Native Token Transfer
buildSuiDepositAndCallTransaction->>buildSuiDepositAndCallTransaction: Validate signerAddress present
buildSuiDepositAndCallTransaction->>suiClient: Fetch coinObjectId using signerAddress
end
buildSuiDepositAndCallTransaction->>buildSuiDepositAndCallTransaction: Construct unsigned transaction
buildSuiDepositAndCallTransaction-->>prepareSuiDepositAndCall: Return { client, transaction }
prepareSuiDepositAndCall-->>Browser: Return unsigned transaction for browser signing
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
6 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Added browser-compatible Sui functionality by replacing Node.js-specific dependencies with browser-safe alternatives and creating a new
prepareSuiDepositAndCallfunction for wallet adapter integration.Key Changes
Browser-Safe Dependencies
bip39→@scure/bip39ethereum-cryptography/hdkey→@scure/bip32getAccountDatato separate file for better tree-shakingNew Browser-Compatible API
prepareSuiDepositAndCall- Returns unsigned transaction for browser wallet signingsuiBrowserOptionsSchema- Browser-friendly options withoutEd25519Keypairrequirement./chains/suipackage export for browser importsRefactored for DRY
buildSuiDepositAndCallTransactionhelperAPI Design
CLI (Node.js)
Browser (Wallet Adapters)
Benefits
Summary by CodeRabbit
Release Notes
New Features
Dependencies