Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Commit

Permalink
Add few more hooks/methods for migration page (v4 -> v5) (#360)
Browse files Browse the repository at this point in the history
* Add few more hooks/methods for migration page (v4 -> v5)

* fix method names for v5
  • Loading branch information
Yash094 authored Apr 24, 2024
1 parent 7b3b9c3 commit b34c64b
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions src/app/typescript/v5/migrate/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,23 @@ const onClick = async () => {
| Prepare | `await contract.prepare(...)` | `prepareContractCall(...) // no await` |
| Send | `await contract.call(...)` | `await sendTransaction(...)` |
| Extensions | `await contract.erc721.getAll()` | `await getNFTs(...)` |
| Deploy | `sdk.deployer.deployBuiltInContract(...)` | `await deployPublishedContract(...)` |


### React Cheatsheet

| Task | `@thirdweb-dev/react` | `thirdweb` |
| ---------- | ----------------------------------------------------- | --------------------------------------------------- |
| Provider | `import { ThirdwebProvider} from @thirdweb-dev/react` | `import { ThirdwebProvider } from "thirdweb/react"` |
| Contract | `useContract(...)` | `getContract(...) // not a hook` |
| Address | `useAddress(...)` | `useActiveAccount(...) // account?.address` |
| Read | `useContractRead(...)` | `useReadContract(...)` |
| Write | `useContractWrite(...)` | `useSendTransaction()` |
| Extensions | `useNFTs(...)` | `useReadContract(getNFTs, { ... })` |
| Task | `@thirdweb-dev/react` | `thirdweb` |
| ---------------------| ----------------------------------------------------- | --------------------------------------------------- |
| Provider | `import { ThirdwebProvider} from @thirdweb-dev/react` | `import { ThirdwebProvider } from "thirdweb/react"` |
| Contract | `useContract(...)` | `getContract(...) // not a hook` |
| Address | `useAddress(...)` | `useActiveAccount(...) // account?.address` |
| Read | `useContractRead(...)` | `useReadContract(...)` |
| Write | `useContractWrite(...)` | `useSendTransaction()` |
| Extensions | `useNFTs(...)` | `useReadContract(getNFTs, { ... })` |
| Get Signer | `useSigner()` | `useActiveAccount()` |
| Get Wallet | `useWallet()` | `useActiveWallet()` |
| Button | `Web3Button` | `TransactionButton` |
| Connect | `ConnectWallet` | `ConnectButton` |
| Connection Status | `useConnectionStatus()` | `useActiveWalletConnectionStatus()` |
| Switch Chain | `useSwitchChain()` | `useSwitchActiveWalletChain()` |
| Get Connected Chain | `useChain()` | `useSwitchActiveWalletChain()` |

0 comments on commit b34c64b

Please sign in to comment.