-
Notifications
You must be signed in to change notification settings - Fork 132
Add useBridgeNftFromEvm hook #2624
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
base: master
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 2dd6443 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
The latest updates on your projects. Learn more about Vercel for GitHub.
💡 Enable Vercel Agent with $100 free credit for automated AI reviews |
There was a problem hiding this 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), |
Copilot
AI
Aug 19, 2025
There was a problem hiding this comment.
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 |
Copilot
AI
Aug 19, 2025
There was a problem hiding this comment.
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).
<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" |
There was a problem hiding this comment.
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?
…k-nft-evm-to-cadence
Closes #2623