Giter Site home page Giter Site logo

bedlam520 / web3button Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thirdweb-example/web3button

0.0 0.0 0.0 189 KB

Learn how to use the Web3Button component from the thirdweb React SDK!

Home Page: https://web3button.thirdweb-example.com/

License: Apache License 2.0

JavaScript 79.61% CSS 20.39%

web3button's Introduction

Web3Button

This template shows you how you can use our Web3Button component from our React SDK to call any function on any smart contract; and ensure the user:

  • Has their wallet connected
  • Is on the correct network (as defined in _app.js)

before attempting to call the function.

<Web3Button
  // The contract address
  contractAddress="0x424037abd63d32595bD843791ab015C31c87Cb6d"
  // Access the contract itself, perform any action you want on it:
  action={(contract) =>
    contract.nft.mint.to(address, {
      name: "Hello world!",
      // Image can be a File, or any url that points to a file
      image: myFile,
      description: "Your awesome NFT",
    })
  }
  // Or just call the function name and parameters directly:
  // functionName="mintTo"
  // // The mintTo Function on this contract accepts two parameters, we can pass them in an array here.
  // params={[
  //   // First parameter is the address to mint to
  //   address,
  //   // Second parameter is the metadata URI
  //   "ipfs://Qmf9csTfndWRgH2z35WUBm9jTuQKfSv1dJC9YKW6iTZkDP/0",
  // ]}

  // Some customization of colors and styling
  colorMode="light"
  accentColor="#F213A4"
  // If the function is successful, we can do something here.
  onSuccess={(result) => console.log(result)}
  // If the function fails, we can do something here.
  onError={(error) => console.error(error)}
>
  Mint NFT
</Web3Button>

web3button's People

Contributors

avneesh0612 avatar jarrodwatts avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.