Skip to content

feat: implement license transfer UI with recipient safeguards - #544

Merged
barry01-hash merged 1 commit into
PromptMintLabs:mainfrom
Tee-Gee57:feat/license-transfer-ui-with-safeguards
Aug 31, 2026
Merged

feat: implement license transfer UI with recipient safeguards#544
barry01-hash merged 1 commit into
PromptMintLabs:mainfrom
Tee-Gee57:feat/license-transfer-ui-with-safeguards

Conversation

@Tee-Gee57

Copy link
Copy Markdown

Description

Implement the license transfer flow in the buyer library, exposing the existing transfer_license capability through a secure, multi-step user interface with comprehensive recipient validation and safeguards.

This PR adds the transferLicense method to PromptHashClient, including a mock implementation, and introduces a dedicated TransferLicense component 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

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactor / code cleanup
  • CI / tooling / developer experience

How Has This Been Tested?

The transfer flow was tested across the primary success, validation, cancellation, and failure scenarios.

  • Manual testing (describe steps below)
  • Automated tests added / updated

Test steps:

  1. Open the BuyerLibrary and locate a prompt with an eligible transferable license.

  2. Select the new Transfer action on the prompt card.

  3. Enter a recipient address and verify that invalid or incorrectly formatted addresses are rejected.

  4. Verify that addresses belonging to a different network are rejected.

  5. Attempt to transfer the license to the current owner's own address and verify that self-transfer is prevented.

  6. Attempt to transfer to an address that already owns the license and verify that duplicate ownership is prevented.

  7. Continue with a valid recipient and verify the multi-step review screen displays:

    • Prompt information.
    • Recipient address.
    • Applicable fees.
    • Clear warning that transferring the license permanently removes the current owner's access.
  8. Cancel the transfer during the review/confirmation flow and verify that no transaction is submitted.

  9. Confirm a valid transfer and verify that the real transaction hash returned by the contract is displayed/used.

  10. Verify that the buyer library and relevant access states refresh after a successful transfer.

  11. Simulate a failed transaction and verify that an appropriate error state is displayed without incorrectly updating ownership.

  12. Use the retry flow after a failure and verify that the user can attempt the operation again.

  13. Verify that existing BuyerLibrary functionality remains unaffected.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented on complex or non-obvious areas of the code
  • I have updated documentation where necessary
  • My changes generate no new warnings
  • New and existing tests pass locally
  • I have checked that no sensitive information (keys, passwords, tokens) is committed

Screenshots (if applicable)

The PR introduces a new transfer flow and UI modal.

Screenshots/screen recordings should demonstrate:

  • Transfer button on BuyerLibrary prompt cards.
  • Recipient address entry and validation.
  • Multi-step review screen.
  • Fees and recipient information.
  • Permanent license-loss warning.
  • Cancellation state.
  • Transfer failure and retry state.
  • Successful transfer with transaction confirmation.

- 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
@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@barry01-hash
barry01-hash merged commit 4493c5d into PromptMintLabs:main Aug 31, 2026
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.

Implement license transfer UI with recipient safeguards

2 participants