基于区块链的毕业设计Welcome to use-wait-for-transaction-hash 👋 – 欢迎使用等待事务哈希👋

本文提供基于区块链的毕业设计国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,基于区块链的毕业设计Welcome to use-wait-for-transaction-hash 👋 – 欢迎使用等待事务哈希👋 是一篇很好的国外资料

Welcome to use-wait-for-transaction-hash 👋

Welcome to use-wait-for-transaction-hash 👋 - 欢迎使用等待事务哈希👋 Welcome to use-wait-for-transaction-hash 👋 - 欢迎使用等待事务哈希👋 Welcome to use-wait-for-transaction-hash 👋 - 欢迎使用等待事务哈希👋 Welcome to use-wait-for-transaction-hash 👋 - 欢迎使用等待事务哈希👋 Welcome to use-wait-for-transaction-hash 👋 - 欢迎使用等待事务哈希👋

Simple hook for getting transaction status from the ETH network.

Demo

Prerequisites

  • React >=16.8

Install

yarn add use-wait-for-transaction-hash

Usage

Simple usage with Notify component

import { useWaitForTransactionHash } from 'use-wait-for-transaction-hash';  interface Props {   providerUrl: string;   transactionHash: string; }  function Notify({ providerUrl, transactionHash }: Props) {   const { status } = useWaitForTransactionHash({     hash: transactionHash,     providerUrl,   });   return (     <div>       <pre>Hash: {transactionHash}</pre>       <pre>Provider Url: {providerUrl}</pre>       <pre>Status: {status}</pre>     </div>   ); }  function App() {   const [toggle, setToggle] = useState(false);    return (     <div className="App">       <header className="App-header">         <button onClick={() => (toggle ? setToggle(false) : setToggle(true))}>           Toggle the transaction hash         </button>         <Notify           providerUrl="https://data-seed-prebsc-1-s1.binance.org:8545"           transactionHash={             toggle               ? '0x5fbc777b0c99e84b8a3f1c750ae4d1cdaa5f8f852da892897f6b9cf0ea2f59b5'               : '0x35403cfc33cababac41ad998dff9038c57945ac7cbe9f22e5bdfbf89a8756bd7'           }         />       </header>     </div>   ); }

For more detail, please check the example app (example folder),

Recipes

Usage with react-hot-toast
import { useEffect } from 'react'; import { useWaitForTransactionHash } from 'use-wait-for-transaction-hash'; import toast, { Toaster } from 'react-hot-toast';  function Notify({ providerUrl, transactionHash }: Props) {   const { status } = useWaitForTransactionHash({     hash: transactionHash,     providerUrl,   });    // measure performance base on the transaction status   useEffect(() => {     switch (status) {       case 'SUCCESS':         toast.success('This is a success transaction');         break;        case 'FAILED':         toast.error('This is a failed transaction');         break;       default: // PENDING     }   }, [status]);    // clear previous toast message and show checking information   useEffect(() => {     toast.dismiss();     toast.loading('Checking...' + transactionHash);   }, [transactionHash]);    return (     <div>       <pre>Hash: {transactionHash}</pre>       <pre>Provider Url: {providerUrl}</pre>       <pre>Status: {status}</pre>     </div>   ); }  function App() {   return (     <div className="App">       <Notify         providerUrl="https://data-seed-prebsc-1-s1.binance.org:8545"         transactionHash="0x5fbc777b0c99e84b8a3f1c750ae4d1cdaa5f8f852da892897f6b9cf0ea2f59b5"       />        <Toaster position="top-right" />     </div>   ); }

Run tests

yarn test

Author

👤 Huynh Duc Dung

  • Website: https://productsway.com/
  • Twitter: @jellydn
  • Github: @jellydn

Stargazers 🌟

Welcome to use-wait-for-transaction-hash 👋 - 欢迎使用等待事务哈希👋

Show your support

Give a ⭐️ if this project helped you!

![support us](https://img.shields.io/badge/become-a patreon%20us-orange.svg?cacheSeconds=2592000)


This README was generated with ❤️ by readme-md-generator


欢迎使用等待事务哈希👋

Welcome to use-wait-for-transaction-hash 👋 - 欢迎使用等待事务哈希👋<Welcome to use-wait-for-transaction-hash 👋><Welcome to use-wait-for-transaction-hash 👋><Welcome to use-wait-for-transaction-hash 👋><Welcome to use-wait-for-transaction-hash 👋><Welcome to use-wait-for-transaction-hash 👋>Welcome to use-wait-for-transaction-hash 👋 - 欢迎使用等待事务哈希👋

从ETH网络获取交易状态的简单钩子

通知组件的简单用法

有关更多详细信息,请查看示例应用程序(示例文件夹),

👤 Huynh Duc Dung

<Welcome to use-wait-for-transaction-hash 👋><Welcome to use-wait-for-transaction-hash 👋>

给出一个⭐️ 如果这个项目对你有帮助

[支持我们](https://img.shields.io/badge/become-a patreon%20us orange.svg?cacheSeconds=2592000)

此自述文件是使用❤️ 通过自述md生成器

欢迎使用等待事务哈希👋

✨ 演示

先决条件

安装

使用

配方

运行测试

作者

星探🌟

表示您的支持

  • 反应&gt=16.8网站:https://productsway.com/
  • 推特:@jellydn
  • Github:@jellydn
  • 从ETH网络获取交易状态的简单钩子

    ✨ 演示

    先决条件

    • 反应&gt=16.8网站:https://productsway.com/

    安装

    yarn add use-wait-for-transaction-hash

    使用

    通知组件的简单用法

    import { useWaitForTransactionHash } from 'use-wait-for-transaction-hash';  interface Props {   providerUrl: string;   transactionHash: string; }  function Notify({ providerUrl, transactionHash }: Props) {   const { status } = useWaitForTransactionHash({     hash: transactionHash,     providerUrl,   });   return (     <div>       <pre>Hash: {transactionHash}</pre>       <pre>Provider Url: {providerUrl}</pre>       <pre>Status: {status}</pre>     </div>   ); }  function App() {   const [toggle, setToggle] = useState(false);    return (     <div className="App">       <header className="App-header">         <button onClick={() => (toggle ? setToggle(false) : setToggle(true))}>           Toggle the transaction hash         </button>         <Notify           providerUrl="https://data-seed-prebsc-1-s1.binance.org:8545"           transactionHash={             toggle               ? '0x5fbc777b0c99e84b8a3f1c750ae4d1cdaa5f8f852da892897f6b9cf0ea2f59b5'               : '0x35403cfc33cababac41ad998dff9038c57945ac7cbe9f22e5bdfbf89a8756bd7'           }         />       </header>     </div>   ); }

    有关更多详细信息,请查看示例应用程序(示例文件夹),

    配方

    Usage with react-hot-toast
    import { useEffect } from 'react'; import { useWaitForTransactionHash } from 'use-wait-for-transaction-hash'; import toast, { Toaster } from 'react-hot-toast';  function Notify({ providerUrl, transactionHash }: Props) {   const { status } = useWaitForTransactionHash({     hash: transactionHash,     providerUrl,   });    // measure performance base on the transaction status   useEffect(() => {     switch (status) {       case 'SUCCESS':         toast.success('This is a success transaction');         break;        case 'FAILED':         toast.error('This is a failed transaction');         break;       default: // PENDING     }   }, [status]);    // clear previous toast message and show checking information   useEffect(() => {     toast.dismiss();     toast.loading('Checking...' + transactionHash);   }, [transactionHash]);    return (     <div>       <pre>Hash: {transactionHash}</pre>       <pre>Provider Url: {providerUrl}</pre>       <pre>Status: {status}</pre>     </div>   ); }  function App() {   return (     <div className="App">       <Notify         providerUrl="https://data-seed-prebsc-1-s1.binance.org:8545"         transactionHash="0x5fbc777b0c99e84b8a3f1c750ae4d1cdaa5f8f852da892897f6b9cf0ea2f59b5"       />        <Toaster position="top-right" />     </div>   ); }

    运行测试

    yarn test

    作者

    👤 Huynh Duc Dung

    • 推特:@jellydn
    • Github:@jellydn
    • Github: @jellydn

    星探🌟

    <Welcome to use-wait-for-transaction-hash 👋><Welcome to use-wait-for-transaction-hash 👋>

    给出一个⭐️ 如果这个项目对你有帮助

    [支持我们](https://img.shields.io/badge/become-a patreon%20us orange.svg?cacheSeconds=2592000)

    此自述文件是使用❤️ 通过自述md生成器

    欢迎使用等待事务哈希👋

    ✨ 演示

    先决条件

    安装

    使用

    配方

    运行测试

    作者

    星探🌟

    表示您的支持

  • 反应&gt=16.8网站:https://productsway.com/
  • 推特:@jellydn
  • Github:@jellydn
  • 表示您的支持

    给出一个⭐️ 如果这个项目对你有帮助

    [支持我们](https://img.shields.io/badge/become-a patreon%20us orange.svg?cacheSeconds=2592000)


    此自述文件是使用❤️ 通过自述md生成器

    部分转自网络,侵权联系删除区块链源码网

    www.interchains.cc

    https://www.interchains.cc/24167.html

    区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 ! QQ3039046426
    区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » 基于区块链的毕业设计Welcome to use-wait-for-transaction-hash 👋 – 欢迎使用等待事务哈希👋

    提供最优质的资源集合

    立即查看 了解详情