I reply to all queries on the forums and via email, once per day, Monday to Friday (not weekends).

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

how does this extension connect to read DB

dashed-slug.net Forums Exchange extension support how does this extension connect to read DB

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #5727
    Anonymous
    Inactive

    i use a points system on my site

    i would like to make it tradeable with my coin.

    so if the user balance etc being pulled from DB to check if able to trade, theoretically it should be able to pull the users balance from the points DB correct?

    i know this is probably out of the scope of the plugin, but i have a reason for it.

    if you could point me in the right direction i think i could make this happen OR make it its own stripped down “coin adapter” ??

    #5730
    alexg
    Keymaster

    Hello,

    The high-level architecture is as follows:

    The parent plugin is responsible for holding a list of transactions for each user account. From this the balance is calculated on the fly.

    The coin adapters are responsible for communicating with wallets. They do the withdrawals and notify the plugin of incoming deposits.

    The Exchange extension holds markets, orderbooks, orders and trades. It affects the balances by inserting trade transactions in the transaction table of the parent plugin.

    What you want to do, would be possible with a coin adapter. If you are interested in a simple example of how this works, you can have a look at the now deprecated Litecoin adapter. The Full Node Multi Coin Adapter is the evolution of that, for handling multiple wallets.

    If you attempt to develop your own coin adapter, feel free to ask me any questions. You should start by subclassing Dashed_Slug_Wallets_Coin_Adapter. Implement the abstract methods and override the other methods as needed. Then, make sure the class still has a no-argument constructor, and include the class file on the wallets_declare_adapters action. The plugin will discover and instantiate your adapter using reflection.

    with regards

    #5761
    Anonymous
    Inactive

    i use the old litecoin in my site now. thats where i got the idea.. i cant find the instructions on how i did it b4, and which files etc to change. where were thos instructions again? cant find any where on the site or google search

    so i just need to strip out where it connects to my node and do mysql calls correct?

    if so where would i look to do this? in more than one file?

    #5768
    alexg
    Keymaster

    Hello,

    The instructions are the ones I just gave you here. There is nothing else to it.

    Other material that you can also review: https://www.dashed-slug.net/developers-coin-adapters-api/

    There is also some info in the documentation under the “Adapters” section.

    Follow the instructions and ask me if you get stuck.

    Also, you do not need to edit any files. I would recommend that you create your own adapter class, and add it into a plugin file in any way you see fit. Just remember to make the code include/require the class file on the wallets_declare_adapters action, as discussed above.

    with regards

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.