feat: implement license transfer UI with recipient safeguards - #544
Merged
barry01-hash merged 1 commit intoAug 31, 2026
Merged
Conversation
- Add transferLicense method to PromptHashClient with mock implementation - Create TransferLicense component with comprehensive UI flows - Implement recipient address validation for network and format - Add multi-step review process showing prompt, recipient, fees, and loss-of-access consequences - Use real transaction hash from contract and refresh buyer library on success - Validate against self-transfer and duplicate ownership scenarios - Add transfer button to BuyerLibrary prompt cards - Display modal with clear warnings about permanent license loss - Implement error handling and retry flows - Handle cancellation, failure, and success cases Closes PromptMintLabs#19
|
@Tee-Gee57 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Description
Implement the license transfer flow in the buyer library, exposing the existing
transfer_licensecapability through a secure, multi-step user interface with comprehensive recipient validation and safeguards.This PR adds the
transferLicensemethod toPromptHashClient, including a mock implementation, and introduces a dedicatedTransferLicensecomponent that guides users through reviewing and confirming a license transfer.The flow validates recipient addresses for both network and format, prevents self-transfer and duplicate ownership scenarios, clearly communicates fees and the permanent loss of access associated with transferring a license, and handles cancellation, failure, retry, and success states.
On successful transfer, the UI uses the real transaction hash returned by the contract and refreshes the buyer library/access state.
Closes #19
Type of Change
How Has This Been Tested?
The transfer flow was tested across the primary success, validation, cancellation, and failure scenarios.
Test steps:
Open the BuyerLibrary and locate a prompt with an eligible transferable license.
Select the new Transfer action on the prompt card.
Enter a recipient address and verify that invalid or incorrectly formatted addresses are rejected.
Verify that addresses belonging to a different network are rejected.
Attempt to transfer the license to the current owner's own address and verify that self-transfer is prevented.
Attempt to transfer to an address that already owns the license and verify that duplicate ownership is prevented.
Continue with a valid recipient and verify the multi-step review screen displays:
Cancel the transfer during the review/confirmation flow and verify that no transaction is submitted.
Confirm a valid transfer and verify that the real transaction hash returned by the contract is displayed/used.
Verify that the buyer library and relevant access states refresh after a successful transfer.
Simulate a failed transaction and verify that an appropriate error state is displayed without incorrectly updating ownership.
Use the retry flow after a failure and verify that the user can attempt the operation again.
Verify that existing BuyerLibrary functionality remains unaffected.
Checklist
Screenshots (if applicable)
The PR introduces a new transfer flow and UI modal.
Screenshots/screen recordings should demonstrate: