I am trying to understand monero & recieve funds with monero using this python api in my website.
Please check with my plan and correct me freely if I'm wrong.
For every account I will make a sub-address like the following and save it with user info
w = Wallet(JSONRPCWallet(port=28088)) w.new_address() #create new subaddress for a wallet new_address_for_user = w.get_addresses()[-1] #get the newly created subaddress user_info['monero_subaddress'] = new_address_for_user #save the subaddress with user info
If user buys an item, check for the transaction
w = Wallet(JSONRPCWallet(port=28088)) monero_subaddress_for_user = user_info['monero_subaddress'] incoming = w.incoming(local_address=monero_subaddress_for_user)[-1] # get transaction with the particular subaddress in user_info price_of_item = transaction_info['price'] if price_of_item is incoming.amount: #check user paid for item correctly
Stepping aside bugs and other things for later, is this code the right concept for basic transaction with monero?