Open extra topbar

How to generate addresses for every user on new adapter

If you are new here, please see some information on how to ask for support. Thank you!

How to generate addresses for every user on new adapter

dashed-slug.net Forums Full Node Multi Coin Adapter extension support How to generate addresses for every user on new adapter

This topic contains 7 replies, has 2 voices, and was last updated by  alexg 10 months, 1 week ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #5565

    killthrash
    Participant

    I just added a new coin adapter and I was wondering how I could generate a new wallet address for every user for the new coin. I’m seeing new addresses being generated when users are signing in, but I need to generate a masterlist of all users for the new coin and their new address.

    Thanks.

    #5569

    alexg
    Keymaster

    Hello,

    Deposit addresses are normally generated in three occasions:

    1. The first time a user with has_wallets visits your site while logged in.
    2. Whenever a user requests a new deposit address for a coin. This is done with the button in the [wallets_deposit] UI.
    3. You can refresh all the deposit addresses for a coin via the admin interface with “Wallets” -> “Adapters” -> “Renew deposit addresses”.

    Older addresses are still being retained, but only the latest one is displayed.

    If you wish to view a list of current deposit addresses you can do so via “Wallets” -> “Deposit addresses”, and sort by the “Coin” column.

    You can also pull a table of users and deposit addresses via the MySQL console, but keep in mind that deposit addresses can change.

    Deposit addresses are stored in the wp_wallets_adds table. Please let me know if you need help with the SQL query.

    with regards

    #5572

    killthrash
    Participant

    I’m quite familiar with all of this functionality, but none of this answers my question.

    There’s no way to generate an address for every user when adding a new adapter? I have to wait until every single user logs in before an address is generated for them?

    #5573

    alexg
    Keymaster

    OK now I understand your question.

    No, unfortunately right now it is not possible to populate deposit addresses for all users in one go. Of course everything is possible if you can create a script that inserts deposit addresses into the database directly. But this is not easy.

    I might be able to include such a feature in the plugin’s next patch release.

    If you don’t mind me asking, what’s your use case? Why do you need this?

    thank you

    #5575

    killthrash
    Participant

    I’ve built a custom airdrop module that lives outside WordPress and it pulls a list of our user’s addresses from the dB. But because the new coin adapter doesn’t retroactively generate a new address for each registered user, I can’t pull a master list of addresses for this airdrop module.

    The feature I’d like to suggest is – on the list of the adapters, next to the option to “Renew Deposit Addresses”, there would be another option to “Generate Deposit Addresses” for users that don’t already have one. It would be great if it also included the option based on role. So only users with a specific role get the new address generated.

    #5576

    alexg
    Keymaster

    Thank you for sharing these details.

    Actually I have already developed this feature. I have placed it next to the existing “Renew Deposit Addresses” feature, and you will be able to use it tomorrow when version 3.9.4 will be out.

    The command affects all users with the has_wallets capability. If you like, you could temporarily remove this capability from the roles that you do not want affected (see Admin -> “Wallets” -> “Capabilities” menu), then generate the deposit addresses, then finally restore the has_wallets capability to the other roles.

    with regards

    #5577

    killthrash
    Participant

    This is amazing. Thank you so much for your continued support. I will continue to support you and your project however I can.

    Cheers!

    #5583

    alexg
    Keymaster

    Thank you very much!

    Version 3.9.4 is now out and includes the feature you requested.

    with regards

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.