3.4. Accepting Deposits

How to generate addresses for user deposits is described in section 3.1. After each successful deposit, you should send the tokens to your hot or cold wallet and generate a new address available at the users disposal for making a new deposit. For extra security purposes, you can use the tag field to identify users and their deposits. The tag field makes it possible to store a unique, 27-tryte value.

Generally we advise exchanges to generate a pool of addresses from a seed

Once a user has made a transaction to the deposit address, you should wait until the transaction is officially confirmed. There are two ways to check whether a deposit was confirmed:

via getBalances

Probably the most straightforward way to know if a deposit was successful is to check what the balance of an address is with the getBalances API call. Prerequisite of this is that you have a unique deposit address for each individual user. You can continuously call getBalances with the deposit address as input to determine whether an address has a confirmed balance or not.

via findTransactions

Continuously call findTransactions on the deposit address. Once there is a transaction, get its bundle hash (via utils.transactionObject) search for all transactions with the same bundle hash, get the correct tail transaction and then call getInclusionState on that transaction.

results matching ""

    No results matching ""