Code Monkey home page Code Monkey logo

dropkit.js's People

Contributors

jcurbelo avatar kelokchan avatar tpae avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dropkit.js's Issues

Ability to work with multiple networks

It would be nice the warn the user that they are connected to the wrong network.
We could know which chainId or networkId is the current collection created on, by obtaining it from api/drops/address endpoint.

Better error handling

Need to make sure that messages are human friendly, we can create our own mappings from Metamask errors

Comon Errors/Messages WIP

  • Metamask extension is not installed
  • Collection is not started
  • User doesn't belong to whitelist (presale)
  • User doesn't have enough balance
  • User is not connected to the proper network (mainnet)
  • User exceeded the maxPerWallet amount
    • We can limit the UX to avoid this one

Future Steps

Would be nice if the SDK also shows a toaster/snackbark with these errors, this will be noted on a different issue

Better presale handling

As a first thought, we can distinguish the Collection state (presale or public sale) to determine which action to use: either mint or presaleMint:

The whole logic flow can be described as follow:

Presale

  • Check whether the user wallet belongs or not into the whitelist by retrieving the "Merkle Proof" using POST /api/drops/list endpoint
  • If a proof is returned then the presaleMint action gets invoked with its corresponding params: amount, proof
  • If not, an error gets shown to the user (see #3 )

Public Sale

  • The mint action gets invoked with amount

If we are able to do this separation we can save some extra calls to POST /api/drops/list which I think we are calling each time

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.