Need a way to replace coinpayments.net

Their api allowed me to create a new payment address and get an event fired when the payment has been sent to the address. Then I would mark the transaction in my database as paid and upgrade the user.

How would I do this with NIM?

1 Like

Just a few lines of code with Nimiq Wrapper. If you elaborate on how you created the address and receive the events I could look into writing up a barebones implementation of it using NimiqWrapper so you can see how to get going.

To do it with the wrapper (which uses core nimiq library so if you don’t want to use the wrapper just look at how NimiqWrapper does everything on GitHub) you would:

Backend

  • initialize the wrapper (construct a NimiqWrapper object, let’s call it wrapper for now)
  • initialize the node (wrapper.initNode)
  • create a wallet (wrapper. accountHelper.createWallet)
  • start watching that wallet for incoming transactions (wrapper. transactionHelper . watchForTransactionsTo)