Skip to content

Conversation

mfbz
Copy link
Contributor

@mfbz mfbz commented Aug 19, 2025

Closes #2623

@mfbz mfbz requested a review from a team as a code owner August 19, 2025 19:43
Copy link

changeset-bot bot commented Aug 19, 2025

🦋 Changeset detected

Latest commit: 2dd6443

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@onflow/react-sdk Minor
@onflow/demo Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Aug 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
react-sdk-demo Ready Ready Preview Comment Oct 17, 2025 7:01pm

💡 Enable Vercel Agent with $100 free credit for automated AI reviews

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new React hook useCrossVmReceiveNft for bridging NFTs from EVM to Cadence on the Flow blockchain. It enables developers to move NFTs from the EVM environment back to the Cadence environment within their applications.

  • Added useCrossVmReceiveNft hook with comprehensive Cadence transaction logic for NFT bridging
  • Added complete test coverage for the new hook functionality
  • Added demo components to showcase the NFT receiving functionality in the demo application

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/react-sdk/src/hooks/useCrossVmReceiveNft.ts New hook implementation with Cadence transaction for bridging NFTs from EVM to Cadence
packages/react-sdk/src/hooks/useCrossVmReceiveNft.test.ts Comprehensive test suite for the new hook covering success, error, and edge cases
packages/react-sdk/src/hooks/index.ts Export for the new hook
packages/demo/src/constants.ts Added ExampleNFT contract addresses for demo purposes
packages/demo/src/components/sidebar.tsx Added navigation items for cross-VM NFT operations
packages/demo/src/components/navbar.tsx Improved navbar styling for dark mode
packages/demo/src/components/container.tsx Added demo cards for cross-VM NFT operations
packages/demo/src/components/cards/cross-vm-receive-nft-card.tsx Demo component for testing NFT receiving functionality
packages/demo/src/components/cards/cross-vm-spend-nft-card.tsx Demo component for testing NFT spending functionality
packages/demo/src/app.tsx Added dark mode class management
packages/demo/src/app.css Added custom scrollbar styling for light and dark modes
.changeset/mighty-rocks-smell.md Changeset documentation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

cadence: cadenceTx,
args: (arg, t) => [
arg(nftIdentifier, t.String),
arg(nftId, t.UInt256),
Copy link

Copilot AI Aug 19, 2025

Choose a reason for hiding this comment

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

The parameter nftId is passed as a string but converted to t.UInt256 in the transaction. This could cause issues if the string cannot be properly converted to UInt256. Consider validating the input format or ensuring the conversion is handled properly.

Copilot uses AI. Check for mistakes.

</h2>
<div className="mb-6">
<label className="block mb-2 text-black">
<strong>Note:</strong> Example prefilled with ExampleNFT type
Copy link

Copilot AI Aug 19, 2025

Choose a reason for hiding this comment

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

The label text says 'Example prefilled with ExampleNFT type identifier' but should be 'Example pre-filled with ExampleNFT type identifier' (hyphenated).

Suggested change
<strong>Note:</strong> Example prefilled with ExampleNFT type
<strong>Note:</strong> Example pre-filled with ExampleNFT type

Copilot uses AI. Check for mistakes.

export {useFlowTransactionStatus} from "./useFlowTransactionStatus"
export {useCrossVmSpendNft} from "./useCrossVmSpendNft"
export {useCrossVmSpendToken} from "./useCrossVmSpendToken"
export {useCrossVmReceiveNft} from "./useCrossVmReceiveNft"
Copy link
Member

Choose a reason for hiding this comment

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

Didn't we discuss a bridge naming for this? Because you're not spending right? Just bridging?

@mfbz mfbz changed the title Added hook to move NFT from evm to cadence Add useBridgeNftFromEvm hook Oct 2, 2025
@mfbz mfbz requested a review from chasefleming October 2, 2025 14:52
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.

Create hook to transfer NFT from evm to cadence

2 participants